@waniwani/sdk 0.22.0-beta.6 → 0.22.0-beta.7
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 +68 -68
- package/dist/chat/embed.js.map +1 -1
- package/dist/chat/index.js +12 -12
- package/dist/chat/index.js.map +1 -1
- package/package.json +1 -1
package/dist/chat/embed.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
"use strict";var WaniWaniChatEmbed=(()=>{var h3=Object.create;var rf=Object.defineProperty;var g3=Object.getOwnPropertyDescriptor;var y3=Object.getOwnPropertyNames;var w3=Object.getPrototypeOf,v3=Object.prototype.hasOwnProperty;var yI=e=>{throw TypeError(e)};var x3=(e,t,a)=>t in e?rf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var L=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ia=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),of=(e,t)=>{for(var a in t)rf(e,a,{get:t[a],enumerable:!0})},b3=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of y3(t))!v3.call(e,r)&&r!==a&&rf(e,r,{get:()=>t[r],enumerable:!(n=g3(t,r))||n.enumerable});return e};var j=(e,t,a)=>(a=e!=null?h3(w3(e)):{},b3(t||!e||!e.__esModule?rf(a,"default",{value:e,enumerable:!0}):a,e));var K=(e,t,a)=>x3(e,typeof t!="symbol"?t+"":t,a),Jh=(e,t,a)=>t.has(e)||yI("Cannot "+a);var b=(e,t,a)=>(Jh(e,t,"read from private field"),a?a.call(e):t.get(e)),ue=(e,t,a)=>t.has(e)?yI("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),F=(e,t,a,n)=>(Jh(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a),Y=(e,t,a)=>(Jh(e,t,"access private method"),a);var MI=Ia(Re=>{"use strict";var tg=Symbol.for("react.transitional.element"),S3=Symbol.for("react.portal"),I3=Symbol.for("react.fragment"),C3=Symbol.for("react.strict_mode"),k3=Symbol.for("react.profiler"),T3=Symbol.for("react.consumer"),L3=Symbol.for("react.context"),E3=Symbol.for("react.forward_ref"),A3=Symbol.for("react.suspense"),M3=Symbol.for("react.memo"),CI=Symbol.for("react.lazy"),R3=Symbol.for("react.activity"),xI=Symbol.iterator;function D3(e){return e===null||typeof e!="object"?null:(e=xI&&e[xI]||e["@@iterator"],typeof e=="function"?e:null)}var kI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},TI=Object.assign,LI={};function Ts(e,t,a){this.props=e,this.context=t,this.refs=LI,this.updater=a||kI}Ts.prototype.isReactComponent={};Ts.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")};Ts.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function EI(){}EI.prototype=Ts.prototype;function ag(e,t,a){this.props=e,this.context=t,this.refs=LI,this.updater=a||kI}var ng=ag.prototype=new EI;ng.constructor=ag;TI(ng,Ts.prototype);ng.isPureReactComponent=!0;var bI=Array.isArray;function eg(){}var kt={H:null,A:null,T:null,S:null},AI=Object.prototype.hasOwnProperty;function rg(e,t,a){var n=a.ref;return{$$typeof:tg,type:e,key:t,ref:n!==void 0?n:null,props:a}}function _3(e,t){return rg(e.type,t,e.props)}function og(e){return typeof e=="object"&&e!==null&&e.$$typeof===tg}function P3(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var SI=/\/+/g;function Qh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?P3(""+e.key):t.toString(36)}function O3(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(eg,eg):(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 ks(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 tg:case S3:i=!0;break;case CI:return i=e._init,ks(i(e._payload),t,a,n,r)}}if(i)return r=r(e),i=n===""?"."+Qh(e,0):n,bI(r)?(a="",i!=null&&(a=i.replace(SI,"$&/")+"/"),ks(r,t,a,"",function(u){return u})):r!=null&&(og(r)&&(r=_3(r,a+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(SI,"$&/")+"/")+i)),t.push(r)),1;i=0;var s=n===""?".":n+":";if(bI(e))for(var l=0;l<e.length;l++)n=e[l],o=s+Qh(n,l),i+=ks(n,t,a,o,r);else if(l=D3(e),typeof l=="function")for(e=l.call(e),l=0;!(n=e.next()).done;)n=n.value,o=s+Qh(n,l++),i+=ks(n,t,a,o,r);else if(o==="object"){if(typeof e.then=="function")return ks(O3(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 sf(e,t,a){if(e==null)return e;var n=[],r=0;return ks(e,n,"","",function(o){return t.call(a,o,r++)}),n}function N3(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 II=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)},U3={map:sf,forEach:function(e,t,a){sf(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return sf(e,function(){t++}),t},toArray:function(e){return sf(e,function(t){return t})||[]},only:function(e){if(!og(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Re.Activity=R3;Re.Children=U3;Re.Component=Ts;Re.Fragment=I3;Re.Profiler=k3;Re.PureComponent=ag;Re.StrictMode=C3;Re.Suspense=A3;Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=kt;Re.__COMPILER_RUNTIME={__proto__:null,c:function(e){return kt.H.useMemoCache(e)}};Re.cache=function(e){return function(){return e.apply(null,arguments)}};Re.cacheSignal=function(){return null};Re.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=TI({},e.props),r=e.key;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)!AI.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),s=0;s<o;s++)i[s]=arguments[s+2];n.children=i}return rg(e.type,r,n)};Re.createContext=function(e){return e={$$typeof:L3,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:T3,_context:e},e};Re.createElement=function(e,t,a){var n,r={},o=null;if(t!=null)for(n in t.key!==void 0&&(o=""+t.key),t)AI.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 s=Array(i),l=0;l<i;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(n in i=e.defaultProps,i)r[n]===void 0&&(r[n]=i[n]);return rg(e,o,r)};Re.createRef=function(){return{current:null}};Re.forwardRef=function(e){return{$$typeof:E3,render:e}};Re.isValidElement=og;Re.lazy=function(e){return{$$typeof:CI,_payload:{_status:-1,_result:e},_init:N3}};Re.memo=function(e,t){return{$$typeof:M3,type:e,compare:t===void 0?null:t}};Re.startTransition=function(e){var t=kt.T,a={};kt.T=a;try{var n=e(),r=kt.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(eg,II)}catch(o){II(o)}finally{t!==null&&a.types!==null&&(t.types=a.types),kt.T=t}};Re.unstable_useCacheRefresh=function(){return kt.H.useCacheRefresh()};Re.use=function(e){return kt.H.use(e)};Re.useActionState=function(e,t,a){return kt.H.useActionState(e,t,a)};Re.useCallback=function(e,t){return kt.H.useCallback(e,t)};Re.useContext=function(e){return kt.H.useContext(e)};Re.useDebugValue=function(){};Re.useDeferredValue=function(e,t){return kt.H.useDeferredValue(e,t)};Re.useEffect=function(e,t){return kt.H.useEffect(e,t)};Re.useEffectEvent=function(e){return kt.H.useEffectEvent(e)};Re.useId=function(){return kt.H.useId()};Re.useImperativeHandle=function(e,t,a){return kt.H.useImperativeHandle(e,t,a)};Re.useInsertionEffect=function(e,t){return kt.H.useInsertionEffect(e,t)};Re.useLayoutEffect=function(e,t){return kt.H.useLayoutEffect(e,t)};Re.useMemo=function(e,t){return kt.H.useMemo(e,t)};Re.useOptimistic=function(e,t){return kt.H.useOptimistic(e,t)};Re.useReducer=function(e,t,a){return kt.H.useReducer(e,t,a)};Re.useRef=function(e){return kt.H.useRef(e)};Re.useState=function(e){return kt.H.useState(e)};Re.useSyncExternalStore=function(e,t,a){return kt.H.useSyncExternalStore(e,t,a)};Re.useTransition=function(){return kt.H.useTransition()};Re.version="19.2.4"});var Ee=Ia((MZ,RI)=>{"use strict";RI.exports=MI()});var qI=Ia(Dt=>{"use strict";function ug(e,t){var a=e.length;e.push(t);e:for(;0<a;){var n=a-1>>>1,r=e[n];if(0<lf(r,t))e[n]=t,e[a]=r,a=n;else break e}}function lr(e){return e.length===0?null:e[0]}function cf(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,s=e[i],l=i+1,u=e[l];if(0>lf(s,a))l<r&&0>lf(u,s)?(e[n]=u,e[l]=a,n=l):(e[n]=s,e[i]=a,n=i);else if(l<r&&0>lf(u,a))e[n]=u,e[l]=a,n=l;else break e}}return t}function lf(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}Dt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(DI=performance,Dt.unstable_now=function(){return DI.now()}):(ig=Date,_I=ig.now(),Dt.unstable_now=function(){return ig.now()-_I});var DI,ig,_I,Er=[],co=[],B3=1,Tn=null,Ca=3,cg=!1,xu=!1,bu=!1,dg=!1,NI=typeof setTimeout=="function"?setTimeout:null,UI=typeof clearTimeout=="function"?clearTimeout:null,PI=typeof setImmediate<"u"?setImmediate:null;function uf(e){for(var t=lr(co);t!==null;){if(t.callback===null)cf(co);else if(t.startTime<=e)cf(co),t.sortIndex=t.expirationTime,ug(Er,t);else break;t=lr(co)}}function fg(e){if(bu=!1,uf(e),!xu)if(lr(Er)!==null)xu=!0,Es||(Es=!0,Ls());else{var t=lr(co);t!==null&&pg(fg,t.startTime-e)}}var Es=!1,Su=-1,BI=5,zI=-1;function FI(){return dg?!0:!(Dt.unstable_now()-zI<BI)}function sg(){if(dg=!1,Es){var e=Dt.unstable_now();zI=e;var t=!0;try{e:{xu=!1,bu&&(bu=!1,UI(Su),Su=-1),cg=!0;var a=Ca;try{t:{for(uf(e),Tn=lr(Er);Tn!==null&&!(Tn.expirationTime>e&&FI());){var n=Tn.callback;if(typeof n=="function"){Tn.callback=null,Ca=Tn.priorityLevel;var r=n(Tn.expirationTime<=e);if(e=Dt.unstable_now(),typeof r=="function"){Tn.callback=r,uf(e),t=!0;break t}Tn===lr(Er)&&cf(Er),uf(e)}else cf(Er);Tn=lr(Er)}if(Tn!==null)t=!0;else{var o=lr(co);o!==null&&pg(fg,o.startTime-e),t=!1}}break e}finally{Tn=null,Ca=a,cg=!1}t=void 0}}finally{t?Ls():Es=!1}}}var Ls;typeof PI=="function"?Ls=function(){PI(sg)}:typeof MessageChannel<"u"?(lg=new MessageChannel,OI=lg.port2,lg.port1.onmessage=sg,Ls=function(){OI.postMessage(null)}):Ls=function(){NI(sg,0)};var lg,OI;function pg(e,t){Su=NI(function(){e(Dt.unstable_now())},t)}Dt.unstable_IdlePriority=5;Dt.unstable_ImmediatePriority=1;Dt.unstable_LowPriority=4;Dt.unstable_NormalPriority=3;Dt.unstable_Profiling=null;Dt.unstable_UserBlockingPriority=2;Dt.unstable_cancelCallback=function(e){e.callback=null};Dt.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"):BI=0<e?Math.floor(1e3/e):5};Dt.unstable_getCurrentPriorityLevel=function(){return Ca};Dt.unstable_next=function(e){switch(Ca){case 1:case 2:case 3:var t=3;break;default:t=Ca}var a=Ca;Ca=t;try{return e()}finally{Ca=a}};Dt.unstable_requestPaint=function(){dg=!0};Dt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Ca;Ca=e;try{return t()}finally{Ca=a}};Dt.unstable_scheduleCallback=function(e,t,a){var n=Dt.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:B3++,callback:t,priorityLevel:e,startTime:a,expirationTime:r,sortIndex:-1},a>n?(e.sortIndex=a,ug(co,e),lr(Er)===null&&e===lr(co)&&(bu?(UI(Su),Su=-1):bu=!0,pg(fg,a-n))):(e.sortIndex=r,ug(Er,e),xu||cg||(xu=!0,Es||(Es=!0,Ls()))),e};Dt.unstable_shouldYield=FI;Dt.unstable_wrapCallback=function(e){var t=Ca;return function(){var a=Ca;Ca=t;try{return e.apply(this,arguments)}finally{Ca=a}}}});var jI=Ia((DZ,HI)=>{"use strict";HI.exports=qI()});var $I=Ia(_a=>{"use strict";var z3=Ee();function VI(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 fo(){}var Da={d:{f:fo,r:function(){throw Error(VI(522))},D:fo,C:fo,L:fo,m:fo,X:fo,S:fo,M:fo},p:0,findDOMNode:null},F3=Symbol.for("react.portal");function q3(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:F3,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var Iu=z3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function df(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}_a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Da;_a.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(VI(299));return q3(e,t,null,a)};_a.flushSync=function(e){var t=Iu.T,a=Da.p;try{if(Iu.T=null,Da.p=2,e)return e()}finally{Iu.T=t,Da.p=a,Da.d.f()}};_a.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Da.d.C(e,t))};_a.prefetchDNS=function(e){typeof e=="string"&&Da.d.D(e)};_a.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,n=df(a,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,o=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Da.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:o}):a==="script"&&Da.d.X(e,{crossOrigin:n,integrity:r,fetchPriority:o,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};_a.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=df(t.as,t.crossOrigin);Da.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&&Da.d.M(e)};_a.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,n=df(a,t.crossOrigin);Da.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})}};_a.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=df(t.as,t.crossOrigin);Da.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 Da.d.m(e)};_a.requestFormReset=function(e){Da.d.r(e)};_a.unstable_batchedUpdates=function(e,t){return e(t)};_a.useFormState=function(e,t,a){return Iu.H.useFormState(e,t,a)};_a.useFormStatus=function(){return Iu.H.useHostTransitionStatus()};_a.version="19.2.4"});var mg=Ia((PZ,GI)=>{"use strict";function WI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(WI)}catch(e){console.error(e)}}WI(),GI.exports=$I()});var o1=Ia(Np=>{"use strict";var ia=jI(),vC=Ee(),H3=mg();function z(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 xC(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function uc(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 bC(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 SC(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 XI(e){if(uc(e)!==e)throw Error(z(188))}function j3(e){var t=e.alternate;if(!t){if(t=uc(e),t===null)throw Error(z(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 XI(r),e;if(o===n)return XI(r),t;o=o.sibling}throw Error(z(188))}if(a.return!==n.return)a=r,n=o;else{for(var i=!1,s=r.child;s;){if(s===a){i=!0,a=r,n=o;break}if(s===n){i=!0,n=r,a=o;break}s=s.sibling}if(!i){for(s=o.child;s;){if(s===a){i=!0,a=o,n=r;break}if(s===n){i=!0,n=o,a=r;break}s=s.sibling}if(!i)throw Error(z(189))}}if(a.alternate!==n)throw Error(z(190))}if(a.tag!==3)throw Error(z(188));return a.stateNode.current===a?e:t}function IC(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=IC(e),t!==null)return t;e=e.sibling}return null}var Et=Object.assign,V3=Symbol.for("react.element"),ff=Symbol.for("react.transitional.element"),Ru=Symbol.for("react.portal"),Ps=Symbol.for("react.fragment"),CC=Symbol.for("react.strict_mode"),Xg=Symbol.for("react.profiler"),kC=Symbol.for("react.consumer"),Nr=Symbol.for("react.context"),jy=Symbol.for("react.forward_ref"),Kg=Symbol.for("react.suspense"),Yg=Symbol.for("react.suspense_list"),Vy=Symbol.for("react.memo"),po=Symbol.for("react.lazy"),Zg=Symbol.for("react.activity"),$3=Symbol.for("react.memo_cache_sentinel"),KI=Symbol.iterator;function Cu(e){return e===null||typeof e!="object"?null:(e=KI&&e[KI]||e["@@iterator"],typeof e=="function"?e:null)}var W3=Symbol.for("react.client.reference");function Jg(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===W3?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ps:return"Fragment";case Xg:return"Profiler";case CC:return"StrictMode";case Kg:return"Suspense";case Yg:return"SuspenseList";case Zg:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Ru:return"Portal";case Nr:return e.displayName||"Context";case kC:return(e._context.displayName||"Context")+".Consumer";case jy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Vy:return t=e.displayName||null,t!==null?t:Jg(e.type)||"Memo";case po:t=e._payload,e=e._init;try{return Jg(e(t))}catch{}}return null}var Du=Array.isArray,Te=vC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lt=H3.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,yi={pending:!1,data:null,method:null,action:null},Qg=[],Os=-1;function pr(e){return{current:e}}function da(e){0>Os||(e.current=Qg[Os],Qg[Os]=null,Os--)}function It(e,t){Os++,Qg[Os]=e.current,e.current=t}var fr=pr(null),Ku=pr(null),Co=pr(null),$f=pr(null);function Wf(e,t){switch(It(Co,t),It(Ku,e),It(fr,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?aC(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=aC(t),e=$T(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}da(fr),It(fr,e)}function Qs(){da(fr),da(Ku),da(Co)}function ey(e){e.memoizedState!==null&&It($f,e);var t=fr.current,a=$T(t,e.type);t!==a&&(It(Ku,e),It(fr,a))}function Gf(e){Ku.current===e&&(da(fr),da(Ku)),$f.current===e&&(da($f),ic._currentValue=yi)}var hg,YI;function pi(e){if(hg===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);hg=t&&t[1]||"",YI=-1<a.stack.indexOf(`
|
|
1
|
+
"use strict";var WaniWaniChatEmbed=(()=>{var y3=Object.create;var sf=Object.defineProperty;var w3=Object.getOwnPropertyDescriptor;var v3=Object.getOwnPropertyNames;var x3=Object.getPrototypeOf,b3=Object.prototype.hasOwnProperty;var v0=e=>{throw TypeError(e)};var S3=(e,t,a)=>t in e?sf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var L=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ca=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),lf=(e,t)=>{for(var a in t)sf(e,a,{get:t[a],enumerable:!0})},I3=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v3(t))!b3.call(e,r)&&r!==a&&sf(e,r,{get:()=>t[r],enumerable:!(n=w3(t,r))||n.enumerable});return e};var j=(e,t,a)=>(a=e!=null?y3(x3(e)):{},I3(t||!e||!e.__esModule?sf(a,"default",{value:e,enumerable:!0}):a,e));var K=(e,t,a)=>S3(e,typeof t!="symbol"?t+"":t,a),eg=(e,t,a)=>t.has(e)||v0("Cannot "+a);var b=(e,t,a)=>(eg(e,t,"read from private field"),a?a.call(e):t.get(e)),ue=(e,t,a)=>t.has(e)?v0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),q=(e,t,a,n)=>(eg(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a),Y=(e,t,a)=>(eg(e,t,"access private method"),a);var D0=Ca(Re=>{"use strict";var ng=Symbol.for("react.transitional.element"),C3=Symbol.for("react.portal"),k3=Symbol.for("react.fragment"),T3=Symbol.for("react.strict_mode"),L3=Symbol.for("react.profiler"),E3=Symbol.for("react.consumer"),A3=Symbol.for("react.context"),M3=Symbol.for("react.forward_ref"),R3=Symbol.for("react.suspense"),D3=Symbol.for("react.memo"),T0=Symbol.for("react.lazy"),_3=Symbol.for("react.activity"),S0=Symbol.iterator;function P3(e){return e===null||typeof e!="object"?null:(e=S0&&e[S0]||e["@@iterator"],typeof e=="function"?e:null)}var L0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E0=Object.assign,A0={};function Ts(e,t,a){this.props=e,this.context=t,this.refs=A0,this.updater=a||L0}Ts.prototype.isReactComponent={};Ts.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")};Ts.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function M0(){}M0.prototype=Ts.prototype;function rg(e,t,a){this.props=e,this.context=t,this.refs=A0,this.updater=a||L0}var og=rg.prototype=new M0;og.constructor=rg;E0(og,Ts.prototype);og.isPureReactComponent=!0;var I0=Array.isArray;function ag(){}var Ct={H:null,A:null,T:null,S:null},R0=Object.prototype.hasOwnProperty;function ig(e,t,a){var n=a.ref;return{$$typeof:ng,type:e,key:t,ref:n!==void 0?n:null,props:a}}function O3(e,t){return ig(e.type,t,e.props)}function sg(e){return typeof e=="object"&&e!==null&&e.$$typeof===ng}function N3(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var C0=/\/+/g;function tg(e,t){return typeof e=="object"&&e!==null&&e.key!=null?N3(""+e.key):t.toString(36)}function U3(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(ag,ag):(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 ks(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 ng:case C3:i=!0;break;case T0:return i=e._init,ks(i(e._payload),t,a,n,r)}}if(i)return r=r(e),i=n===""?"."+tg(e,0):n,I0(r)?(a="",i!=null&&(a=i.replace(C0,"$&/")+"/"),ks(r,t,a,"",function(u){return u})):r!=null&&(sg(r)&&(r=O3(r,a+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(C0,"$&/")+"/")+i)),t.push(r)),1;i=0;var s=n===""?".":n+":";if(I0(e))for(var l=0;l<e.length;l++)n=e[l],o=s+tg(n,l),i+=ks(n,t,a,o,r);else if(l=P3(e),typeof l=="function")for(e=l.call(e),l=0;!(n=e.next()).done;)n=n.value,o=s+tg(n,l++),i+=ks(n,t,a,o,r);else if(o==="object"){if(typeof e.then=="function")return ks(U3(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 uf(e,t,a){if(e==null)return e;var n=[],r=0;return ks(e,n,"","",function(o){return t.call(a,o,r++)}),n}function B3(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 k0=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)},z3={map:uf,forEach:function(e,t,a){uf(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return uf(e,function(){t++}),t},toArray:function(e){return uf(e,function(t){return t})||[]},only:function(e){if(!sg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Re.Activity=_3;Re.Children=z3;Re.Component=Ts;Re.Fragment=k3;Re.Profiler=L3;Re.PureComponent=rg;Re.StrictMode=T3;Re.Suspense=R3;Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ct;Re.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Ct.H.useMemoCache(e)}};Re.cache=function(e){return function(){return e.apply(null,arguments)}};Re.cacheSignal=function(){return null};Re.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=E0({},e.props),r=e.key;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)!R0.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),s=0;s<o;s++)i[s]=arguments[s+2];n.children=i}return ig(e.type,r,n)};Re.createContext=function(e){return e={$$typeof:A3,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:E3,_context:e},e};Re.createElement=function(e,t,a){var n,r={},o=null;if(t!=null)for(n in t.key!==void 0&&(o=""+t.key),t)R0.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 s=Array(i),l=0;l<i;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(n in i=e.defaultProps,i)r[n]===void 0&&(r[n]=i[n]);return ig(e,o,r)};Re.createRef=function(){return{current:null}};Re.forwardRef=function(e){return{$$typeof:M3,render:e}};Re.isValidElement=sg;Re.lazy=function(e){return{$$typeof:T0,_payload:{_status:-1,_result:e},_init:B3}};Re.memo=function(e,t){return{$$typeof:D3,type:e,compare:t===void 0?null:t}};Re.startTransition=function(e){var t=Ct.T,a={};Ct.T=a;try{var n=e(),r=Ct.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(ag,k0)}catch(o){k0(o)}finally{t!==null&&a.types!==null&&(t.types=a.types),Ct.T=t}};Re.unstable_useCacheRefresh=function(){return Ct.H.useCacheRefresh()};Re.use=function(e){return Ct.H.use(e)};Re.useActionState=function(e,t,a){return Ct.H.useActionState(e,t,a)};Re.useCallback=function(e,t){return Ct.H.useCallback(e,t)};Re.useContext=function(e){return Ct.H.useContext(e)};Re.useDebugValue=function(){};Re.useDeferredValue=function(e,t){return Ct.H.useDeferredValue(e,t)};Re.useEffect=function(e,t){return Ct.H.useEffect(e,t)};Re.useEffectEvent=function(e){return Ct.H.useEffectEvent(e)};Re.useId=function(){return Ct.H.useId()};Re.useImperativeHandle=function(e,t,a){return Ct.H.useImperativeHandle(e,t,a)};Re.useInsertionEffect=function(e,t){return Ct.H.useInsertionEffect(e,t)};Re.useLayoutEffect=function(e,t){return Ct.H.useLayoutEffect(e,t)};Re.useMemo=function(e,t){return Ct.H.useMemo(e,t)};Re.useOptimistic=function(e,t){return Ct.H.useOptimistic(e,t)};Re.useReducer=function(e,t,a){return Ct.H.useReducer(e,t,a)};Re.useRef=function(e){return Ct.H.useRef(e)};Re.useState=function(e){return Ct.H.useState(e)};Re.useSyncExternalStore=function(e,t,a){return Ct.H.useSyncExternalStore(e,t,a)};Re.useTransition=function(){return Ct.H.useTransition()};Re.version="19.2.4"});var Ee=Ca((DZ,_0)=>{"use strict";_0.exports=D0()});var j0=Ca(Rt=>{"use strict";function dg(e,t){var a=e.length;e.push(t);e:for(;0<a;){var n=a-1>>>1,r=e[n];if(0<cf(r,t))e[n]=t,e[a]=r,a=n;else break e}}function ir(e){return e.length===0?null:e[0]}function ff(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,s=e[i],l=i+1,u=e[l];if(0>cf(s,a))l<r&&0>cf(u,s)?(e[n]=u,e[l]=a,n=l):(e[n]=s,e[i]=a,n=i);else if(l<r&&0>cf(u,a))e[n]=u,e[l]=a,n=l;else break e}}return t}function cf(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}Rt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(P0=performance,Rt.unstable_now=function(){return P0.now()}):(lg=Date,O0=lg.now(),Rt.unstable_now=function(){return lg.now()-O0});var P0,lg,O0,Tr=[],co=[],F3=1,Cn=null,ka=3,fg=!1,bu=!1,Su=!1,pg=!1,B0=typeof setTimeout=="function"?setTimeout:null,z0=typeof clearTimeout=="function"?clearTimeout:null,N0=typeof setImmediate<"u"?setImmediate:null;function df(e){for(var t=ir(co);t!==null;){if(t.callback===null)ff(co);else if(t.startTime<=e)ff(co),t.sortIndex=t.expirationTime,dg(Tr,t);else break;t=ir(co)}}function mg(e){if(Su=!1,df(e),!bu)if(ir(Tr)!==null)bu=!0,Es||(Es=!0,Ls());else{var t=ir(co);t!==null&&hg(mg,t.startTime-e)}}var Es=!1,Iu=-1,F0=5,q0=-1;function H0(){return pg?!0:!(Rt.unstable_now()-q0<F0)}function ug(){if(pg=!1,Es){var e=Rt.unstable_now();q0=e;var t=!0;try{e:{bu=!1,Su&&(Su=!1,z0(Iu),Iu=-1),fg=!0;var a=ka;try{t:{for(df(e),Cn=ir(Tr);Cn!==null&&!(Cn.expirationTime>e&&H0());){var n=Cn.callback;if(typeof n=="function"){Cn.callback=null,ka=Cn.priorityLevel;var r=n(Cn.expirationTime<=e);if(e=Rt.unstable_now(),typeof r=="function"){Cn.callback=r,df(e),t=!0;break t}Cn===ir(Tr)&&ff(Tr),df(e)}else ff(Tr);Cn=ir(Tr)}if(Cn!==null)t=!0;else{var o=ir(co);o!==null&&hg(mg,o.startTime-e),t=!1}}break e}finally{Cn=null,ka=a,fg=!1}t=void 0}}finally{t?Ls():Es=!1}}}var Ls;typeof N0=="function"?Ls=function(){N0(ug)}:typeof MessageChannel<"u"?(cg=new MessageChannel,U0=cg.port2,cg.port1.onmessage=ug,Ls=function(){U0.postMessage(null)}):Ls=function(){B0(ug,0)};var cg,U0;function hg(e,t){Iu=B0(function(){e(Rt.unstable_now())},t)}Rt.unstable_IdlePriority=5;Rt.unstable_ImmediatePriority=1;Rt.unstable_LowPriority=4;Rt.unstable_NormalPriority=3;Rt.unstable_Profiling=null;Rt.unstable_UserBlockingPriority=2;Rt.unstable_cancelCallback=function(e){e.callback=null};Rt.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"):F0=0<e?Math.floor(1e3/e):5};Rt.unstable_getCurrentPriorityLevel=function(){return ka};Rt.unstable_next=function(e){switch(ka){case 1:case 2:case 3:var t=3;break;default:t=ka}var a=ka;ka=t;try{return e()}finally{ka=a}};Rt.unstable_requestPaint=function(){pg=!0};Rt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=ka;ka=e;try{return t()}finally{ka=a}};Rt.unstable_scheduleCallback=function(e,t,a){var n=Rt.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:F3++,callback:t,priorityLevel:e,startTime:a,expirationTime:r,sortIndex:-1},a>n?(e.sortIndex=a,dg(co,e),ir(Tr)===null&&e===ir(co)&&(Su?(z0(Iu),Iu=-1):Su=!0,hg(mg,a-n))):(e.sortIndex=r,dg(Tr,e),bu||fg||(bu=!0,Es||(Es=!0,Ls()))),e};Rt.unstable_shouldYield=H0;Rt.unstable_wrapCallback=function(e){var t=ka;return function(){var a=ka;ka=t;try{return e.apply(this,arguments)}finally{ka=a}}}});var $0=Ca((PZ,V0)=>{"use strict";V0.exports=j0()});var G0=Ca(Pa=>{"use strict";var q3=Ee();function W0(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 fo(){}var _a={d:{f:fo,r:function(){throw Error(W0(522))},D:fo,C:fo,L:fo,m:fo,X:fo,S:fo,M:fo},p:0,findDOMNode:null},H3=Symbol.for("react.portal");function j3(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H3,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var Cu=q3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function pf(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Pa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_a;Pa.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(W0(299));return j3(e,t,null,a)};Pa.flushSync=function(e){var t=Cu.T,a=_a.p;try{if(Cu.T=null,_a.p=2,e)return e()}finally{Cu.T=t,_a.p=a,_a.d.f()}};Pa.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,_a.d.C(e,t))};Pa.prefetchDNS=function(e){typeof e=="string"&&_a.d.D(e)};Pa.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,n=pf(a,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,o=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?_a.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:o}):a==="script"&&_a.d.X(e,{crossOrigin:n,integrity:r,fetchPriority:o,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Pa.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=pf(t.as,t.crossOrigin);_a.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&&_a.d.M(e)};Pa.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,n=pf(a,t.crossOrigin);_a.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})}};Pa.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=pf(t.as,t.crossOrigin);_a.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 _a.d.m(e)};Pa.requestFormReset=function(e){_a.d.r(e)};Pa.unstable_batchedUpdates=function(e,t){return e(t)};Pa.useFormState=function(e,t,a){return Cu.H.useFormState(e,t,a)};Pa.useFormStatus=function(){return Cu.H.useHostTransitionStatus()};Pa.version="19.2.4"});var gg=Ca((NZ,K0)=>{"use strict";function X0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(X0)}catch(e){console.error(e)}}X0(),K0.exports=G0()});var s1=Ca(Bp=>{"use strict";var sa=$0(),bC=Ee(),V3=gg();function z(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 SC(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cc(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 IC(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 CC(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 Y0(e){if(cc(e)!==e)throw Error(z(188))}function $3(e){var t=e.alternate;if(!t){if(t=cc(e),t===null)throw Error(z(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 Y0(r),e;if(o===n)return Y0(r),t;o=o.sibling}throw Error(z(188))}if(a.return!==n.return)a=r,n=o;else{for(var i=!1,s=r.child;s;){if(s===a){i=!0,a=r,n=o;break}if(s===n){i=!0,n=r,a=o;break}s=s.sibling}if(!i){for(s=o.child;s;){if(s===a){i=!0,a=o,n=r;break}if(s===n){i=!0,n=o,a=r;break}s=s.sibling}if(!i)throw Error(z(189))}}if(a.alternate!==n)throw Error(z(190))}if(a.tag!==3)throw Error(z(188));return a.stateNode.current===a?e:t}function kC(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=kC(e),t!==null)return t;e=e.sibling}return null}var Lt=Object.assign,W3=Symbol.for("react.element"),mf=Symbol.for("react.transitional.element"),Du=Symbol.for("react.portal"),Ps=Symbol.for("react.fragment"),TC=Symbol.for("react.strict_mode"),Yg=Symbol.for("react.profiler"),LC=Symbol.for("react.consumer"),Pr=Symbol.for("react.context"),$y=Symbol.for("react.forward_ref"),Zg=Symbol.for("react.suspense"),Jg=Symbol.for("react.suspense_list"),Wy=Symbol.for("react.memo"),po=Symbol.for("react.lazy"),Qg=Symbol.for("react.activity"),G3=Symbol.for("react.memo_cache_sentinel"),Z0=Symbol.iterator;function ku(e){return e===null||typeof e!="object"?null:(e=Z0&&e[Z0]||e["@@iterator"],typeof e=="function"?e:null)}var X3=Symbol.for("react.client.reference");function ey(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===X3?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ps:return"Fragment";case Yg:return"Profiler";case TC:return"StrictMode";case Zg:return"Suspense";case Jg:return"SuspenseList";case Qg:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Du:return"Portal";case Pr:return e.displayName||"Context";case LC:return(e._context.displayName||"Context")+".Consumer";case $y:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Wy:return t=e.displayName||null,t!==null?t:ey(e.type)||"Memo";case po:t=e._payload,e=e._init;try{return ey(e(t))}catch{}}return null}var _u=Array.isArray,Te=bC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lt=V3.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,yi={pending:!1,data:null,method:null,action:null},ty=[],Os=-1;function dr(e){return{current:e}}function pa(e){0>Os||(e.current=ty[Os],ty[Os]=null,Os--)}function St(e,t){Os++,ty[Os]=e.current,e.current=t}var cr=dr(null),Yu=dr(null),Co=dr(null),Gf=dr(null);function Xf(e,t){switch(St(Co,t),St(Yu,e),St(cr,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?rC(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=rC(t),e=GT(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}pa(cr),St(cr,e)}function Qs(){pa(cr),pa(Yu),pa(Co)}function ay(e){e.memoizedState!==null&&St(Gf,e);var t=cr.current,a=GT(t,e.type);t!==a&&(St(Yu,e),St(cr,a))}function Kf(e){Yu.current===e&&(pa(cr),pa(Yu)),Gf.current===e&&(pa(Gf),sc._currentValue=yi)}var yg,J0;function pi(e){if(yg===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);yg=t&&t[1]||"",J0=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
3
|
+
`+yg+e+J0}var wg=!1;function vg(e,t){if(!e||wg)return"";wg=!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(m){var p=m}Reflect.construct(e,[],d)}else{try{d.call()}catch(m){p=m}e.call(d.prototype)}}else{try{throw Error()}catch(m){p=m}(d=e())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(m){if(m&&p&&typeof m.stack=="string")return[m.stack,p.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(),i=o[0],s=o[1];if(i&&s){var l=i.split(`
|
|
4
4
|
`),u=s.split(`
|
|
5
5
|
`);for(r=n=0;n<l.length&&!l[n].includes("DetermineComponentFrameRoot");)n++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(n===l.length||r===u.length)for(n=l.length-1,r=u.length-1;1<=n&&0<=r&&l[n]!==u[r];)r--;for(;1<=n&&0<=r;n--,r--)if(l[n]!==u[r]){if(n!==1||r!==1)do if(n--,r--,0>r||l[n]!==u[r]){var c=`
|
|
6
|
-
`+l[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
|
+
`+l[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{wg=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?pi(a):""}function K3(e,t){switch(e.tag){case 26:case 27:case 5:return pi(e.type);case 16:return pi("Lazy");case 13:return e.child!==t&&t!==null?pi("Suspense Fallback"):pi("Suspense");case 19:return pi("SuspenseList");case 0:case 15:return vg(e.type,!1);case 11:return vg(e.type.render,!1);case 1:return vg(e.type,!0);case 31:return pi("Activity");default:return""}}function Q0(e){try{var t="",a=null;do t+=K3(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 ty=Object.prototype.hasOwnProperty,$y=ia.unstable_scheduleCallback,wg=ia.unstable_cancelCallback,X3=ia.unstable_shouldYield,K3=ia.unstable_requestPaint,dn=ia.unstable_now,Y3=ia.unstable_getCurrentPriorityLevel,TC=ia.unstable_ImmediatePriority,LC=ia.unstable_UserBlockingPriority,Xf=ia.unstable_NormalPriority,Z3=ia.unstable_LowPriority,EC=ia.unstable_IdlePriority,J3=ia.log,Q3=ia.unstable_setDisableYieldValue,cc=null,fn=null;function vo(e){if(typeof J3=="function"&&Q3(e),fn&&typeof fn.setStrictMode=="function")try{fn.setStrictMode(cc,e)}catch{}}var pn=Math.clz32?Math.clz32:az,ez=Math.log,tz=Math.LN2;function az(e){return e>>>=0,e===0?32:31-(ez(e)/tz|0)|0}var pf=256,mf=262144,hf=4194304;function mi(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 xp(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 s=n&134217727;return s!==0?(n=s&~o,n!==0?r=mi(n):(i&=s,i!==0?r=mi(i):a||(a=s&~e,a!==0&&(r=mi(a))))):(s=n&~o,s!==0?r=mi(s):i!==0?r=mi(i):a||(a=n&~e,a!==0&&(r=mi(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 dc(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nz(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 AC(){var e=hf;return hf<<=1,(hf&62914560)===0&&(hf=4194304),e}function vg(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function fc(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function rz(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 s=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(a=i&~a;0<a;){var c=31-pn(a),d=1<<c;s[c]=0,l[c]=-1;var p=u[c];if(p!==null)for(u[c]=null,c=0;c<p.length;c++){var m=p[c];m!==null&&(m.lane&=-536870913)}a&=~d}n!==0&&MC(e,n,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function MC(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-pn(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function RC(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-pn(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function DC(e,t){var a=t&-t;return a=(a&42)!==0?1:Wy(a),(a&(e.suspendedLanes|t))!==0?0:a}function Wy(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 Gy(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function _C(){var e=lt.p;return e!==0?e:(e=window.event,e===void 0?32:a1(e.type))}function JI(e,t){var a=lt.p;try{return lt.p=e,t()}finally{lt.p=a}}var Uo=Math.random().toString(36).slice(2),ya="__reactFiber$"+Uo,Ka="__reactProps$"+Uo,cl="__reactContainer$"+Uo,ay="__reactEvents$"+Uo,oz="__reactListeners$"+Uo,iz="__reactHandles$"+Uo,QI="__reactResources$"+Uo,pc="__reactMarker$"+Uo;function Xy(e){delete e[ya],delete e[Ka],delete e[ay],delete e[oz],delete e[iz]}function Ns(e){var t=e[ya];if(t)return t;for(var a=e.parentNode;a;){if(t=a[cl]||a[ya]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=sC(e);e!==null;){if(a=e[ya])return a;e=sC(e)}return t}e=a,a=e.parentNode}return null}function dl(e){if(e=e[ya]||e[cl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _u(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(z(33))}function Ws(e){var t=e[QI];return t||(t=e[QI]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ca(e){e[pc]=!0}var PC=new Set,OC={};function Li(e,t){el(e,t),el(e+"Capture",t)}function el(e,t){for(OC[e]=t,e=0;e<t.length;e++)PC.add(t[e])}var sz=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]*$"),e0={},t0={};function lz(e){return ty.call(t0,e)?!0:ty.call(e0,e)?!1:sz.test(e)?t0[e]=!0:(e0[e]=!0,!1)}function Mf(e,t,a){if(lz(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 gf(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 Ar(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 En(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function NC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uz(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 ny(e){if(!e._valueTracker){var t=NC(e)?"checked":"value";e._valueTracker=uz(e,t,""+e[t])}}function UC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=NC(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Kf(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 cz=/[\n"\\]/g;function Rn(e){return e.replace(cz,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ry(e,t,a,n,r,o,i,s){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=""+En(t)):e.value!==""+En(t)&&(e.value=""+En(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?oy(e,i,En(t)):a!=null?oy(e,i,En(a)):n!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+En(s):e.removeAttribute("name")}function BC(e,t,a,n,r,o,i,s){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)){ny(e);return}a=a!=null?""+En(a):"",t=t!=null?""+En(t):a,s||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=s?e.checked:!!n,e.defaultChecked=!!n,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),ny(e)}function oy(e,t,a){t==="number"&&Kf(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Gs(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=""+En(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 zC(e,t,a){if(t!=null&&(t=""+En(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+En(a):""}function FC(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(z(92));if(Du(n)){if(1<n.length)throw Error(z(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=En(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),ny(e)}function tl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var dz=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 a0(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||dz.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function qC(e,t,a){if(t!=null&&typeof t!="object")throw Error(z(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&&a0(e,r,n)}else for(var o in t)t.hasOwnProperty(o)&&a0(e,o,t[o])}function Ky(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 fz=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"]]),pz=/^[\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 Rf(e){return pz.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ur(){}var iy=null;function Yy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Us=null,Xs=null;function n0(e){var t=dl(e);if(t&&(e=t.stateNode)){var a=e[Ka]||null;e:switch(e=t.stateNode,t.type){case"input":if(ry(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="'+Rn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[Ka]||null;if(!r)throw Error(z(90));ry(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&&UC(n)}break e;case"textarea":zC(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Gs(e,!!a.multiple,t,!1)}}}var xg=!1;function HC(e,t,a){if(xg)return e(t,a);xg=!0;try{var n=e(t);return n}finally{if(xg=!1,(Us!==null||Xs!==null)&&(Dp(),Us&&(t=Us,e=Xs,Xs=Us=null,n0(t),e)))for(t=0;t<e.length;t++)n0(e[t])}}function Yu(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Ka]||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(z(231,t,typeof a));return a}var Hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sy=!1;if(Hr)try{As={},Object.defineProperty(As,"passive",{get:function(){sy=!0}}),window.addEventListener("test",As,As),window.removeEventListener("test",As,As)}catch{sy=!1}var As,xo=null,Zy=null,Df=null;function jC(){if(Df)return Df;var e,t=Zy,a=t.length,n,r="value"in xo?xo.value:xo.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 Df=r.slice(e,1<n?1-n:void 0)}function _f(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 yf(){return!0}function r0(){return!1}function Ya(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 s in e)e.hasOwnProperty(s)&&(a=e[s],this[s]=a?a(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?yf:r0,this.isPropagationStopped=r0,this}return Et(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=yf)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=yf)},persist:function(){},isPersistent:yf}),t}var Ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bp=Ya(Ei),mc=Et({},Ei,{view:0,detail:0}),mz=Ya(mc),bg,Sg,ku,Sp=Et({},mc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jy,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!==ku&&(ku&&e.type==="mousemove"?(bg=e.screenX-ku.screenX,Sg=e.screenY-ku.screenY):Sg=bg=0,ku=e),bg)},movementY:function(e){return"movementY"in e?e.movementY:Sg}}),o0=Ya(Sp),hz=Et({},Sp,{dataTransfer:0}),gz=Ya(hz),yz=Et({},mc,{relatedTarget:0}),Ig=Ya(yz),wz=Et({},Ei,{animationName:0,elapsedTime:0,pseudoElement:0}),vz=Ya(wz),xz=Et({},Ei,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bz=Ya(xz),Sz=Et({},Ei,{data:0}),i0=Ya(Sz),Iz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cz={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"},kz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tz(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kz[e])?!!t[e]:!1}function Jy(){return Tz}var Lz=Et({},mc,{key:function(e){if(e.key){var t=Iz[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=_f(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Cz[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jy,charCode:function(e){return e.type==="keypress"?_f(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_f(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ez=Ya(Lz),Az=Et({},Sp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),s0=Ya(Az),Mz=Et({},mc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jy}),Rz=Ya(Mz),Dz=Et({},Ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),_z=Ya(Dz),Pz=Et({},Sp,{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}),Oz=Ya(Pz),Nz=Et({},Ei,{newState:0,oldState:0}),Uz=Ya(Nz),Bz=[9,13,27,32],Qy=Hr&&"CompositionEvent"in window,Nu=null;Hr&&"documentMode"in document&&(Nu=document.documentMode);var zz=Hr&&"TextEvent"in window&&!Nu,VC=Hr&&(!Qy||Nu&&8<Nu&&11>=Nu),l0=" ",u0=!1;function $C(e,t){switch(e){case"keyup":return Bz.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function WC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bs=!1;function Fz(e,t){switch(e){case"compositionend":return WC(t);case"keypress":return t.which!==32?null:(u0=!0,l0);case"textInput":return e=t.data,e===l0&&u0?null:e;default:return null}}function qz(e,t){if(Bs)return e==="compositionend"||!Qy&&$C(e,t)?(e=jC(),Df=Zy=xo=null,Bs=!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 VC&&t.locale!=="ko"?null:t.data;default:return null}}var Hz={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 c0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Hz[e.type]:t==="textarea"}function GC(e,t,a,n){Us?Xs?Xs.push(n):Xs=[n]:Us=n,t=pp(t,"onChange"),0<t.length&&(a=new bp("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Uu=null,Zu=null;function jz(e){HT(e,0)}function Ip(e){var t=_u(e);if(UC(t))return e}function d0(e,t){if(e==="change")return t}var XC=!1;Hr&&(Hr?(vf="oninput"in document,vf||(Cg=document.createElement("div"),Cg.setAttribute("oninput","return;"),vf=typeof Cg.oninput=="function"),wf=vf):wf=!1,XC=wf&&(!document.documentMode||9<document.documentMode));var wf,vf,Cg;function f0(){Uu&&(Uu.detachEvent("onpropertychange",KC),Zu=Uu=null)}function KC(e){if(e.propertyName==="value"&&Ip(Zu)){var t=[];GC(t,Zu,e,Yy(e)),HC(jz,t)}}function Vz(e,t,a){e==="focusin"?(f0(),Uu=t,Zu=a,Uu.attachEvent("onpropertychange",KC)):e==="focusout"&&f0()}function $z(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ip(Zu)}function Wz(e,t){if(e==="click")return Ip(t)}function Gz(e,t){if(e==="input"||e==="change")return Ip(t)}function Xz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hn=typeof Object.is=="function"?Object.is:Xz;function Ju(e,t){if(hn(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(!ty.call(t,r)||!hn(e[r],t[r]))return!1}return!0}function p0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function m0(e,t){var a=p0(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=p0(a)}}function YC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?YC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ZC(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kf(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=Kf(e.document)}return t}function ew(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 Kz=Hr&&"documentMode"in document&&11>=document.documentMode,zs=null,ly=null,Bu=null,uy=!1;function h0(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;uy||zs==null||zs!==Kf(n)||(n=zs,"selectionStart"in n&&ew(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}),Bu&&Ju(Bu,n)||(Bu=n,n=pp(ly,"onSelect"),0<n.length&&(t=new bp("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=zs)))}function fi(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Fs={animationend:fi("Animation","AnimationEnd"),animationiteration:fi("Animation","AnimationIteration"),animationstart:fi("Animation","AnimationStart"),transitionrun:fi("Transition","TransitionRun"),transitionstart:fi("Transition","TransitionStart"),transitioncancel:fi("Transition","TransitionCancel"),transitionend:fi("Transition","TransitionEnd")},kg={},JC={};Hr&&(JC=document.createElement("div").style,"AnimationEvent"in window||(delete Fs.animationend.animation,delete Fs.animationiteration.animation,delete Fs.animationstart.animation),"TransitionEvent"in window||delete Fs.transitionend.transition);function Ai(e){if(kg[e])return kg[e];if(!Fs[e])return e;var t=Fs[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in JC)return kg[e]=t[a];return e}var QC=Ai("animationend"),ek=Ai("animationiteration"),tk=Ai("animationstart"),Yz=Ai("transitionrun"),Zz=Ai("transitionstart"),Jz=Ai("transitioncancel"),ak=Ai("transitionend"),nk=new Map,cy="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(" ");cy.push("scrollEnd");function Xn(e,t){nk.set(e,t),Li(t,[e])}var Yf=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)},Ln=[],qs=0,tw=0;function Cp(){for(var e=qs,t=tw=qs=0;t<e;){var a=Ln[t];Ln[t++]=null;var n=Ln[t];Ln[t++]=null;var r=Ln[t];Ln[t++]=null;var o=Ln[t];if(Ln[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&&rk(a,r,o)}}function kp(e,t,a,n){Ln[qs++]=e,Ln[qs++]=t,Ln[qs++]=a,Ln[qs++]=n,tw|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function aw(e,t,a,n){return kp(e,t,a,n),Zf(e)}function Mi(e,t){return kp(e,null,null,t),Zf(e)}function rk(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-pn(a),e=o.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),o):null}function Zf(e){if(50<Gu)throw Gu=0,Ry=null,Error(z(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Hs={};function Qz(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 un(e,t,a,n){return new Qz(e,t,a,n)}function nw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zr(e,t){var a=e.alternate;return a===null?(a=un(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 ok(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 Pf(e,t,a,n,r,o){var i=0;if(n=e,typeof e=="function")nw(e)&&(i=1);else if(typeof e=="string")i=aq(e,a,fr.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Zg:return e=un(31,a,t,r),e.elementType=Zg,e.lanes=o,e;case Ps:return wi(a.children,r,o,t);case CC:i=8,r|=24;break;case Xg:return e=un(12,a,t,r|2),e.elementType=Xg,e.lanes=o,e;case Kg:return e=un(13,a,t,r),e.elementType=Kg,e.lanes=o,e;case Yg:return e=un(19,a,t,r),e.elementType=Yg,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nr:i=10;break e;case kC:i=9;break e;case jy:i=11;break e;case Vy:i=14;break e;case po:i=16,n=null;break e}i=29,a=Error(z(130,e===null?"null":typeof e,"")),n=null}return t=un(i,a,t,r),t.elementType=e,t.type=n,t.lanes=o,t}function wi(e,t,a,n){return e=un(7,e,n,t),e.lanes=a,e}function Tg(e,t,a){return e=un(6,e,null,t),e.lanes=a,e}function ik(e){var t=un(18,null,null,0);return t.stateNode=e,t}function Lg(e,t,a){return t=un(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var g0=new WeakMap;function Dn(e,t){if(typeof e=="object"&&e!==null){var a=g0.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ZI(t)},g0.set(e,t),t)}return{value:e,source:t,stack:ZI(t)}}var js=[],Vs=0,Jf=null,Qu=0,An=[],Mn=0,_o=null,ur=1,cr="";function Pr(e,t){js[Vs++]=Qu,js[Vs++]=Jf,Jf=e,Qu=t}function sk(e,t,a){An[Mn++]=ur,An[Mn++]=cr,An[Mn++]=_o,_o=e;var n=ur;e=cr;var r=32-pn(n)-1;n&=~(1<<r),a+=1;var o=32-pn(t)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,ur=1<<32-pn(t)+r|a<<r|n,cr=o+e}else ur=1<<o|a<<r|n,cr=e}function rw(e){e.return!==null&&(Pr(e,1),sk(e,1,0))}function ow(e){for(;e===Jf;)Jf=js[--Vs],js[Vs]=null,Qu=js[--Vs],js[Vs]=null;for(;e===_o;)_o=An[--Mn],An[Mn]=null,cr=An[--Mn],An[Mn]=null,ur=An[--Mn],An[Mn]=null}function lk(e,t){An[Mn++]=ur,An[Mn++]=cr,An[Mn++]=_o,ur=t.id,cr=t.overflow,_o=e}var wa=null,Lt=null,Ze=!1,ko=null,_n=!1,dy=Error(z(519));function Po(e){var t=Error(z(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ec(Dn(t,e)),dy}function y0(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[ya]=e,t[Ka]=n,a){case"dialog":Ge("cancel",t),Ge("close",t);break;case"iframe":case"object":case"embed":Ge("load",t);break;case"video":case"audio":for(a=0;a<rc.length;a++)Ge(rc[a],t);break;case"source":Ge("error",t);break;case"img":case"image":case"link":Ge("error",t),Ge("load",t);break;case"details":Ge("toggle",t);break;case"input":Ge("invalid",t),BC(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ge("invalid",t);break;case"textarea":Ge("invalid",t),FC(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||VT(t.textContent,a)?(n.popover!=null&&(Ge("beforetoggle",t),Ge("toggle",t)),n.onScroll!=null&&Ge("scroll",t),n.onScrollEnd!=null&&Ge("scrollend",t),n.onClick!=null&&(t.onclick=Ur),t=!0):t=!1,t||Po(e,!0)}function w0(e){for(wa=e.return;wa;)switch(wa.tag){case 5:case 31:case 13:_n=!1;return;case 27:case 3:_n=!0;return;default:wa=wa.return}}function Ms(e){if(e!==wa)return!1;if(!Ze)return w0(e),Ze=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Ny(e.type,e.memoizedProps)),a=!a),a&&Lt&&Po(e),w0(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));Lt=iC(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));Lt=iC(e)}else t===27?(t=Lt,Bo(e.type)?(e=Fy,Fy=null,Lt=e):Lt=t):Lt=wa?On(e.stateNode.nextSibling):null;return!0}function Si(){Lt=wa=null,Ze=!1}function Eg(){var e=ko;return e!==null&&(Ga===null?Ga=e:Ga.push.apply(Ga,e),ko=null),e}function ec(e){ko===null?ko=[e]:ko.push(e)}var fy=pr(null),Ri=null,Br=null;function ho(e,t,a){It(fy,t._currentValue),t._currentValue=a}function Fr(e){e._currentValue=fy.current,da(fy)}function py(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 my(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 s=o;o=r;for(var l=0;l<t.length;l++)if(s.context===t[l]){o.lanes|=a,s=o.alternate,s!==null&&(s.lanes|=a),py(o.return,a,e),n||(i=null);break e}o=s.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(z(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),py(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 fl(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(z(387));if(i=i.memoizedProps,i!==null){var s=r.type;hn(r.pendingProps.value,i.value)||(e!==null?e.push(s):e=[s])}}else if(r===$f.current){if(i=r.alternate,i===null)throw Error(z(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(ic):e=[ic])}r=r.return}e!==null&&my(t,e,a,n),t.flags|=262144}function Qf(e){for(e=e.firstContext;e!==null;){if(!hn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ii(e){Ri=e,Br=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function va(e){return uk(Ri,e)}function xf(e,t){return Ri===null&&Ii(e),uk(e,t)}function uk(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Br===null){if(e===null)throw Error(z(308));Br=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Br=Br.next=t;return a}var eF=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()})}},tF=ia.unstable_scheduleCallback,aF=ia.unstable_NormalPriority,aa={$$typeof:Nr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function iw(){return{controller:new eF,data:new Map,refCount:0}}function hc(e){e.refCount--,e.refCount===0&&tF(aF,function(){e.controller.abort()})}var zu=null,hy=0,al=0,Ks=null;function nF(e,t){if(zu===null){var a=zu=[];hy=0,al=Rw(),Ks={status:"pending",value:void 0,then:function(n){a.push(n)}}}return hy++,t.then(v0,v0),t}function v0(){if(--hy===0&&zu!==null){Ks!==null&&(Ks.status="fulfilled");var e=zu;zu=null,al=0,Ks=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function rF(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 x0=Te.S;Te.S=function(e,t){IT=dn(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&nF(e,t),x0!==null&&x0(e,t)};var vi=pr(null);function sw(){var e=vi.current;return e!==null?e:xt.pooledCache}function Of(e,t){t===null?It(vi,vi.current):It(vi,t.pool)}function ck(){var e=sw();return e===null?null:{parent:aa._currentValue,pool:e}}var pl=Error(z(460)),lw=Error(z(474)),Tp=Error(z(542)),ep={then:function(){}};function b0(e){return e=e.status,e==="fulfilled"||e==="rejected"}function dk(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Ur,Ur),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,I0(e),e;default:if(typeof t.status=="string")t.then(Ur,Ur);else{if(e=xt,e!==null&&100<e.shellSuspendCounter)throw Error(z(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,I0(e),e}throw xi=t,pl}}function hi(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(xi=a,pl):a}}var xi=null;function S0(){if(xi===null)throw Error(z(459));var e=xi;return xi=null,e}function I0(e){if(e===pl||e===Tp)throw Error(z(483))}var Ys=null,tc=0;function bf(e){var t=tc;return tc+=1,Ys===null&&(Ys=[]),dk(Ys,e,t)}function Tu(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Sf(e,t){throw t.$$typeof===V3?Error(z(525)):(e=Object.prototype.toString.call(t),Error(z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function fk(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=zr(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 s(y,w,g,S){return w===null||w.tag!==6?(w=Tg(g,y.mode,S),w.return=y,w):(w=r(w,g),w.return=y,w)}function l(y,w,g,S){var E=g.type;return E===Ps?c(y,w,g.props.children,S,g.key):w!==null&&(w.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===po&&hi(E)===w.type)?(w=r(w,g.props),Tu(w,g),w.return=y,w):(w=Pf(g.type,g.key,g.props,null,y.mode,S),Tu(w,g),w.return=y,w)}function u(y,w,g,S){return w===null||w.tag!==4||w.stateNode.containerInfo!==g.containerInfo||w.stateNode.implementation!==g.implementation?(w=Lg(g,y.mode,S),w.return=y,w):(w=r(w,g.children||[]),w.return=y,w)}function c(y,w,g,S,E){return w===null||w.tag!==7?(w=wi(g,y.mode,S,E),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=Tg(""+w,y.mode,g),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ff:return g=Pf(w.type,w.key,w.props,null,y.mode,g),Tu(g,w),g.return=y,g;case Ru:return w=Lg(w,y.mode,g),w.return=y,w;case po:return w=hi(w),d(y,w,g)}if(Du(w)||Cu(w))return w=wi(w,y.mode,g,null),w.return=y,w;if(typeof w.then=="function")return d(y,bf(w),g);if(w.$$typeof===Nr)return d(y,xf(y,w),g);Sf(y,w)}return null}function p(y,w,g,S){var E=w!==null?w.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return E!==null?null:s(y,w,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ff:return g.key===E?l(y,w,g,S):null;case Ru:return g.key===E?u(y,w,g,S):null;case po:return g=hi(g),p(y,w,g,S)}if(Du(g)||Cu(g))return E!==null?null:c(y,w,g,S,null);if(typeof g.then=="function")return p(y,w,bf(g),S);if(g.$$typeof===Nr)return p(y,w,xf(y,g),S);Sf(y,g)}return null}function m(y,w,g,S,E){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return y=y.get(g)||null,s(w,y,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ff:return y=y.get(S.key===null?g:S.key)||null,l(w,y,S,E);case Ru:return y=y.get(S.key===null?g:S.key)||null,u(w,y,S,E);case po:return S=hi(S),m(y,w,g,S,E)}if(Du(S)||Cu(S))return y=y.get(g)||null,c(w,y,S,E,null);if(typeof S.then=="function")return m(y,w,g,bf(S),E);if(S.$$typeof===Nr)return m(y,w,g,xf(w,S),E);Sf(w,S)}return null}function h(y,w,g,S){for(var E=null,T=null,R=w,O=w=0,U=null;R!==null&&O<g.length;O++){R.index>O?(U=R,R=null):U=R.sibling;var A=p(y,R,g[O],S);if(A===null){R===null&&(R=U);break}e&&R&&A.alternate===null&&t(y,R),w=o(A,w,O),T===null?E=A:T.sibling=A,T=A,R=U}if(O===g.length)return a(y,R),Ze&&Pr(y,O),E;if(R===null){for(;O<g.length;O++)R=d(y,g[O],S),R!==null&&(w=o(R,w,O),T===null?E=R:T.sibling=R,T=R);return Ze&&Pr(y,O),E}for(R=n(R);O<g.length;O++)U=m(R,y,O,g[O],S),U!==null&&(e&&U.alternate!==null&&R.delete(U.key===null?O:U.key),w=o(U,w,O),T===null?E=U:T.sibling=U,T=U);return e&&R.forEach(function(Q){return t(y,Q)}),Ze&&Pr(y,O),E}function v(y,w,g,S){if(g==null)throw Error(z(151));for(var E=null,T=null,R=w,O=w=0,U=null,A=g.next();R!==null&&!A.done;O++,A=g.next()){R.index>O?(U=R,R=null):U=R.sibling;var Q=p(y,R,A.value,S);if(Q===null){R===null&&(R=U);break}e&&R&&Q.alternate===null&&t(y,R),w=o(Q,w,O),T===null?E=Q:T.sibling=Q,T=Q,R=U}if(A.done)return a(y,R),Ze&&Pr(y,O),E;if(R===null){for(;!A.done;O++,A=g.next())A=d(y,A.value,S),A!==null&&(w=o(A,w,O),T===null?E=A:T.sibling=A,T=A);return Ze&&Pr(y,O),E}for(R=n(R);!A.done;O++,A=g.next())A=m(R,y,O,A.value,S),A!==null&&(e&&A.alternate!==null&&R.delete(A.key===null?O:A.key),w=o(A,w,O),T===null?E=A:T.sibling=A,T=A);return e&&R.forEach(function($){return t(y,$)}),Ze&&Pr(y,O),E}function I(y,w,g,S){if(typeof g=="object"&&g!==null&&g.type===Ps&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ff:e:{for(var E=g.key;w!==null;){if(w.key===E){if(E=g.type,E===Ps){if(w.tag===7){a(y,w.sibling),S=r(w,g.props.children),S.return=y,y=S;break e}}else if(w.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===po&&hi(E)===w.type){a(y,w.sibling),S=r(w,g.props),Tu(S,g),S.return=y,y=S;break e}a(y,w);break}else t(y,w);w=w.sibling}g.type===Ps?(S=wi(g.props.children,y.mode,S,g.key),S.return=y,y=S):(S=Pf(g.type,g.key,g.props,null,y.mode,S),Tu(S,g),S.return=y,y=S)}return i(y);case Ru:e:{for(E=g.key;w!==null;){if(w.key===E)if(w.tag===4&&w.stateNode.containerInfo===g.containerInfo&&w.stateNode.implementation===g.implementation){a(y,w.sibling),S=r(w,g.children||[]),S.return=y,y=S;break e}else{a(y,w);break}else t(y,w);w=w.sibling}S=Lg(g,y.mode,S),S.return=y,y=S}return i(y);case po:return g=hi(g),I(y,w,g,S)}if(Du(g))return h(y,w,g,S);if(Cu(g)){if(E=Cu(g),typeof E!="function")throw Error(z(150));return g=E.call(g),v(y,w,g,S)}if(typeof g.then=="function")return I(y,w,bf(g),S);if(g.$$typeof===Nr)return I(y,w,xf(y,g),S);Sf(y,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,w!==null&&w.tag===6?(a(y,w.sibling),S=r(w,g),S.return=y,y=S):(a(y,w),S=Tg(g,y.mode,S),S.return=y,y=S),i(y)):a(y,w)}return function(y,w,g,S){try{tc=0;var E=I(y,w,g,S);return Ys=null,E}catch(R){if(R===pl||R===Tp)throw R;var T=un(29,R,null,y.mode);return T.lanes=S,T.return=y,T}}}var Ci=fk(!0),pk=fk(!1),mo=!1;function uw(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gy(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 To(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Lo(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(st&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=Zf(e),rk(e,null,a),t}return kp(e,n,t,a),Zf(e)}function Fu(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,RC(e,a)}}function Ag(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 yy=!1;function qu(){if(yy){var e=Ks;if(e!==null)throw e}}function Hu(e,t,a,n){yy=!1;var r=e.updateQueue;mo=!1;var o=r.firstBaseUpdate,i=r.lastBaseUpdate,s=r.shared.pending;if(s!==null){r.shared.pending=null;var l=s,u=l.next;l.next=null,i===null?o=u:i.next=u,i=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==i&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=r.baseState;i=0,c=u=l=null,s=o;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Ke&p)===p:(n&p)===p){p!==0&&p===al&&(yy=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var h=e,v=s;p=t;var I=a;switch(v.tag){case 1:if(h=v.payload,typeof h=="function"){d=h.call(I,d,p);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=v.payload,p=typeof h=="function"?h.call(I,d,p):h,p==null)break e;d=Et({},d,p);break e;case 2:mo=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=m,l=d):c=c.next=m,i|=p;if(s=s.next,s===null){if(s=r.shared.pending,s===null)break;m=s,s=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);c===null&&(l=d),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=c,o===null&&(r.shared.lanes=0),No|=i,e.lanes=i,e.memoizedState=d}}function mk(e,t){if(typeof e!="function")throw Error(z(191,e));e.call(t)}function hk(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)mk(a[e],t)}var nl=pr(null),tp=pr(0);function C0(e,t){e=Wr,It(tp,e),It(nl,t),Wr=e|t.baseLanes}function wy(){It(tp,Wr),It(nl,nl.current)}function cw(){Wr=tp.current,da(nl),da(tp)}var gn=pr(null),Pn=null;function go(e){var t=e.alternate;It(Kt,Kt.current&1),It(gn,e),Pn===null&&(t===null||nl.current!==null||t.memoizedState!==null)&&(Pn=e)}function vy(e){It(Kt,Kt.current),It(gn,e),Pn===null&&(Pn=e)}function gk(e){e.tag===22?(It(Kt,Kt.current),It(gn,e),Pn===null&&(Pn=e)):yo(e)}function yo(){It(Kt,Kt.current),It(gn,gn.current)}function ln(e){da(gn),Pn===e&&(Pn=null),da(Kt)}var Kt=pr(0);function ap(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||By(a)||zy(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 jr=0,Pe=null,wt=null,ea=null,np=!1,Zs=!1,ki=!1,rp=0,ac=0,Js=null,oF=0;function qt(){throw Error(z(321))}function dw(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!hn(e[a],t[a]))return!1;return!0}function fw(e,t,a,n,r,o){return jr=o,Pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Te.H=e===null||e.memoizedState===null?Gk:Iw,ki=!1,o=a(n,r),ki=!1,Zs&&(o=wk(t,a,n,r)),yk(e),o}function yk(e){Te.H=nc;var t=wt!==null&&wt.next!==null;if(jr=0,ea=wt=Pe=null,np=!1,ac=0,Js=null,t)throw Error(z(300));e===null||na||(e=e.dependencies,e!==null&&Qf(e)&&(na=!0))}function wk(e,t,a,n){Pe=e;var r=0;do{if(Zs&&(Js=null),ac=0,Zs=!1,25<=r)throw Error(z(301));if(r+=1,ea=wt=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}Te.H=Xk,o=t(a,n)}while(Zs);return o}function iF(){var e=Te.H,t=e.useState()[0];return t=typeof t.then=="function"?gc(t):t,e=e.useState()[0],(wt!==null?wt.memoizedState:null)!==e&&(Pe.flags|=1024),t}function pw(){var e=rp!==0;return rp=0,e}function mw(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function hw(e){if(np){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}np=!1}jr=0,ea=wt=Pe=null,Zs=!1,ac=rp=0,Js=null}function Pa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ea===null?Pe.memoizedState=ea=e:ea=ea.next=e,ea}function Yt(){if(wt===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=wt.next;var t=ea===null?Pe.memoizedState:ea.next;if(t!==null)ea=t,wt=e;else{if(e===null)throw Pe.alternate===null?Error(z(467)):Error(z(310));wt=e,e={memoizedState:wt.memoizedState,baseState:wt.baseState,baseQueue:wt.baseQueue,queue:wt.queue,next:null},ea===null?Pe.memoizedState=ea=e:ea=ea.next=e}return ea}function Lp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gc(e){var t=ac;return ac+=1,Js===null&&(Js=[]),e=dk(Js,e,t),t=Pe,(ea===null?t.memoizedState:ea.next)===null&&(t=t.alternate,Te.H=t===null||t.memoizedState===null?Gk:Iw),e}function Ep(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return gc(e);if(e.$$typeof===Nr)return va(e)}throw Error(z(438,String(e)))}function gw(e){var t=null,a=Pe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Pe.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=Lp(),Pe.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]=$3;return t.index++,a}function Vr(e,t){return typeof t=="function"?t(e):t}function Nf(e){var t=Yt();return yw(t,wt,e)}function yw(e,t,a){var n=e.queue;if(n===null)throw Error(z(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 s=i=null,l=null,u=t,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Ke&d)===d:(jr&d)===d){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===al&&(c=!0);else if((jr&p)===p){u=u.next,p===al&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=d,i=o):l=l.next=d,Pe.lanes|=p,No|=p;d=u.action,ki&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else p={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=p,i=o):l=l.next=p,Pe.lanes|=d,No|=d;u=u.next}while(u!==null&&u!==t);if(l===null?i=o:l.next=s,!hn(o,e.memoizedState)&&(na=!0,c&&(a=Ks,a!==null)))throw a;e.memoizedState=o,e.baseState=i,e.baseQueue=l,n.lastRenderedState=o}return r===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Mg(e){var t=Yt(),a=t.queue;if(a===null)throw Error(z(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);hn(o,t.memoizedState)||(na=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function vk(e,t,a){var n=Pe,r=Yt(),o=Ze;if(o){if(a===void 0)throw Error(z(407));a=a()}else a=t();var i=!hn((wt||r).memoizedState,a);if(i&&(r.memoizedState=a,na=!0),r=r.queue,ww(Sk.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||ea!==null&&ea.memoizedState.tag&1){if(n.flags|=2048,rl(9,{destroy:void 0},bk.bind(null,n,r,a,t),null),xt===null)throw Error(z(349));o||(jr&127)!==0||xk(n,t,a)}return a}function xk(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Pe.updateQueue,t===null?(t=Lp(),Pe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function bk(e,t,a,n){t.value=a,t.getSnapshot=n,Ik(t)&&Ck(e)}function Sk(e,t,a){return a(function(){Ik(t)&&Ck(e)})}function Ik(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!hn(e,a)}catch{return!0}}function Ck(e){var t=Mi(e,2);t!==null&&Xa(t,e,2)}function xy(e){var t=Pa();if(typeof e=="function"){var a=e;if(e=a(),ki){vo(!0);try{a()}finally{vo(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:e},t}function kk(e,t,a,n){return e.baseState=a,yw(e,wt,typeof n=="function"?n:Vr)}function sF(e,t,a,n,r){if(Mp(e))throw Error(z(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)}};Te.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,Tk(t,o)):(o.next=a.next,t.pending=a.next=o)}}function Tk(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var o=Te.T,i={};Te.T=i;try{var s=a(r,n),l=Te.S;l!==null&&l(i,s),k0(e,t,s)}catch(u){by(e,t,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),Te.T=o}}else try{o=a(r,n),k0(e,t,o)}catch(u){by(e,t,u)}}function k0(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){T0(e,t,n)},function(n){return by(e,t,n)}):T0(e,t,a)}function T0(e,t,a){t.status="fulfilled",t.value=a,Lk(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Tk(e,a)))}function by(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,Lk(t),t=t.next;while(t!==n)}e.action=null}function Lk(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ek(e,t){return t}function L0(e,t){if(Ze){var a=xt.formState;if(a!==null){e:{var n=Pe;if(Ze){if(Lt){t:{for(var r=Lt,o=_n;r.nodeType!==8;){if(!o){r=null;break t}if(r=On(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){Lt=On(r.nextSibling),n=r.data==="F!";break e}}Po(n)}n=!1}n&&(t=a[0])}}return a=Pa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ek,lastRenderedState:t},a.queue=n,a=Vk.bind(null,Pe,n),n.dispatch=a,n=xy(!1),o=Sw.bind(null,Pe,!1,n.queue),n=Pa(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=sF.bind(null,Pe,r,o,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function E0(e){var t=Yt();return Ak(t,wt,e)}function Ak(e,t,a){if(t=yw(e,t,Ek)[0],e=Nf(Vr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=gc(t)}catch(i){throw i===pl?Tp:i}else n=t;t=Yt();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(Pe.flags|=2048,rl(9,{destroy:void 0},lF.bind(null,r,a),null)),[n,o,e]}function lF(e,t){e.action=t}function A0(e){var t=Yt(),a=wt;if(a!==null)return Ak(t,a,e);Yt(),t=t.memoizedState,a=Yt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function rl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Pe.updateQueue,t===null&&(t=Lp(),Pe.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 Mk(){return Yt().memoizedState}function Uf(e,t,a,n){var r=Pa();Pe.flags|=e,r.memoizedState=rl(1|t,{destroy:void 0},a,n===void 0?null:n)}function Ap(e,t,a,n){var r=Yt();n=n===void 0?null:n;var o=r.memoizedState.inst;wt!==null&&n!==null&&dw(n,wt.memoizedState.deps)?r.memoizedState=rl(t,o,a,n):(Pe.flags|=e,r.memoizedState=rl(1|t,o,a,n))}function M0(e,t){Uf(8390656,8,e,t)}function ww(e,t){Ap(2048,8,e,t)}function uF(e){Pe.flags|=4;var t=Pe.updateQueue;if(t===null)t=Lp(),Pe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Rk(e){var t=Yt().memoizedState;return uF({ref:t,nextImpl:e}),function(){if((st&2)!==0)throw Error(z(440));return t.impl.apply(void 0,arguments)}}function Dk(e,t){return Ap(4,2,e,t)}function _k(e,t){return Ap(4,4,e,t)}function Pk(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 Ok(e,t,a){a=a!=null?a.concat([e]):null,Ap(4,4,Pk.bind(null,t,e),a)}function vw(){}function Nk(e,t){var a=Yt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&dw(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function Uk(e,t){var a=Yt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&dw(t,n[1]))return n[0];if(n=e(),ki){vo(!0);try{e()}finally{vo(!1)}}return a.memoizedState=[n,t],n}function xw(e,t,a){return a===void 0||(jr&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=kT(),Pe.lanes|=e,No|=e,a)}function Bk(e,t,a,n){return hn(a,t)?a:nl.current!==null?(e=xw(e,a,n),hn(e,t)||(na=!0),e):(jr&42)===0||(jr&1073741824)!==0&&(Ke&261930)===0?(na=!0,e.memoizedState=a):(e=kT(),Pe.lanes|=e,No|=e,t)}function zk(e,t,a,n,r){var o=lt.p;lt.p=o!==0&&8>o?o:8;var i=Te.T,s={};Te.T=s,Sw(e,!1,t,a);try{var l=r(),u=Te.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=rF(l,n);ju(e,t,c,mn(e))}else ju(e,t,n,mn(e))}catch(d){ju(e,t,{then:function(){},status:"rejected",reason:d},mn())}finally{lt.p=o,i!==null&&s.types!==null&&(i.types=s.types),Te.T=i}}function cF(){}function Sy(e,t,a,n){if(e.tag!==5)throw Error(z(476));var r=Fk(e).queue;zk(e,r,t,yi,a===null?cF:function(){return qk(e),a(n)})}function Fk(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:yi,baseState:yi,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:yi},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function qk(e){var t=Fk(e);t.next===null&&(t=e.alternate.memoizedState),ju(e,t.next.queue,{},mn())}function bw(){return va(ic)}function Hk(){return Yt().memoizedState}function jk(){return Yt().memoizedState}function dF(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=mn();e=To(a);var n=Lo(t,e,a);n!==null&&(Xa(n,t,a),Fu(n,t,a)),t={cache:iw()},e.payload=t;return}t=t.return}}function fF(e,t,a){var n=mn();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Mp(e)?$k(t,a):(a=aw(e,t,a,n),a!==null&&(Xa(a,e,n),Wk(a,t,n)))}function Vk(e,t,a){var n=mn();ju(e,t,a,n)}function ju(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Mp(e))$k(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,s=o(i,a);if(r.hasEagerState=!0,r.eagerState=s,hn(s,i))return kp(e,t,r,0),xt===null&&Cp(),!1}catch{}if(a=aw(e,t,r,n),a!==null)return Xa(a,e,n),Wk(a,t,n),!0}return!1}function Sw(e,t,a,n){if(n={lane:2,revertLane:Rw(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Mp(e)){if(t)throw Error(z(479))}else t=aw(e,a,n,2),t!==null&&Xa(t,e,2)}function Mp(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function $k(e,t){Zs=np=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Wk(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,RC(e,a)}}var nc={readContext:va,use:Ep,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useLayoutEffect:qt,useInsertionEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useSyncExternalStore:qt,useId:qt,useHostTransitionStatus:qt,useFormState:qt,useActionState:qt,useOptimistic:qt,useMemoCache:qt,useCacheRefresh:qt};nc.useEffectEvent=qt;var Gk={readContext:va,use:Ep,useCallback:function(e,t){return Pa().memoizedState=[e,t===void 0?null:t],e},useContext:va,useEffect:M0,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Uf(4194308,4,Pk.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Uf(4194308,4,e,t)},useInsertionEffect:function(e,t){Uf(4,2,e,t)},useMemo:function(e,t){var a=Pa();t=t===void 0?null:t;var n=e();if(ki){vo(!0);try{e()}finally{vo(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Pa();if(a!==void 0){var r=a(t);if(ki){vo(!0);try{a(t)}finally{vo(!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=fF.bind(null,Pe,e),[n.memoizedState,e]},useRef:function(e){var t=Pa();return e={current:e},t.memoizedState=e},useState:function(e){e=xy(e);var t=e.queue,a=Vk.bind(null,Pe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:vw,useDeferredValue:function(e,t){var a=Pa();return xw(a,e,t)},useTransition:function(){var e=xy(!1);return e=zk.bind(null,Pe,e.queue,!0,!1),Pa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Pe,r=Pa();if(Ze){if(a===void 0)throw Error(z(407));a=a()}else{if(a=t(),xt===null)throw Error(z(349));(Ke&127)!==0||xk(n,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,M0(Sk.bind(null,n,o,e),[e]),n.flags|=2048,rl(9,{destroy:void 0},bk.bind(null,n,o,a,t),null),a},useId:function(){var e=Pa(),t=xt.identifierPrefix;if(Ze){var a=cr,n=ur;a=(n&~(1<<32-pn(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=rp++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=oF++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:bw,useFormState:L0,useActionState:L0,useOptimistic:function(e){var t=Pa();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Sw.bind(null,Pe,!0,a),a.dispatch=t,[e,t]},useMemoCache:gw,useCacheRefresh:function(){return Pa().memoizedState=dF.bind(null,Pe)},useEffectEvent:function(e){var t=Pa(),a={impl:e};return t.memoizedState=a,function(){if((st&2)!==0)throw Error(z(440));return a.impl.apply(void 0,arguments)}}},Iw={readContext:va,use:Ep,useCallback:Nk,useContext:va,useEffect:ww,useImperativeHandle:Ok,useInsertionEffect:Dk,useLayoutEffect:_k,useMemo:Uk,useReducer:Nf,useRef:Mk,useState:function(){return Nf(Vr)},useDebugValue:vw,useDeferredValue:function(e,t){var a=Yt();return Bk(a,wt.memoizedState,e,t)},useTransition:function(){var e=Nf(Vr)[0],t=Yt().memoizedState;return[typeof e=="boolean"?e:gc(e),t]},useSyncExternalStore:vk,useId:Hk,useHostTransitionStatus:bw,useFormState:E0,useActionState:E0,useOptimistic:function(e,t){var a=Yt();return kk(a,wt,e,t)},useMemoCache:gw,useCacheRefresh:jk};Iw.useEffectEvent=Rk;var Xk={readContext:va,use:Ep,useCallback:Nk,useContext:va,useEffect:ww,useImperativeHandle:Ok,useInsertionEffect:Dk,useLayoutEffect:_k,useMemo:Uk,useReducer:Mg,useRef:Mk,useState:function(){return Mg(Vr)},useDebugValue:vw,useDeferredValue:function(e,t){var a=Yt();return wt===null?xw(a,e,t):Bk(a,wt.memoizedState,e,t)},useTransition:function(){var e=Mg(Vr)[0],t=Yt().memoizedState;return[typeof e=="boolean"?e:gc(e),t]},useSyncExternalStore:vk,useId:Hk,useHostTransitionStatus:bw,useFormState:A0,useActionState:A0,useOptimistic:function(e,t){var a=Yt();return wt!==null?kk(a,wt,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:gw,useCacheRefresh:jk};Xk.useEffectEvent=Rk;function Rg(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:Et({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Iy={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=mn(),r=To(n);r.payload=t,a!=null&&(r.callback=a),t=Lo(e,r,n),t!==null&&(Xa(t,e,n),Fu(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=mn(),r=To(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=Lo(e,r,n),t!==null&&(Xa(t,e,n),Fu(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=mn(),n=To(a);n.tag=2,t!=null&&(n.callback=t),t=Lo(e,n,a),t!==null&&(Xa(t,e,a),Fu(t,e,a))}};function R0(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?!Ju(a,n)||!Ju(r,o):!0}function D0(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&&Iy.enqueueReplaceState(t,t.state,null)}function Ti(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=Et({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function Kk(e){Yf(e)}function Yk(e){console.error(e)}function Zk(e){Yf(e)}function op(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function _0(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 Cy(e,t,a){return a=To(a),a.tag=3,a.payload={element:null},a.callback=function(){op(e,t)},a}function Jk(e){return e=To(e),e.tag=3,e}function Qk(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(){_0(t,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){_0(t,a,n),typeof r!="function"&&(Eo===null?Eo=new Set([this]):Eo.add(this));var s=n.stack;this.componentDidCatch(n.value,{componentStack:s!==null?s:""})})}function pF(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&fl(t,a,r,!0),a=gn.current,a!==null){switch(a.tag){case 31:case 13:return Pn===null?cp():a.alternate===null&&Ht===0&&(Ht=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===ep?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Hg(e,n,r)),!1;case 22:return a.flags|=65536,n===ep?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)),Hg(e,n,r)),!1}throw Error(z(435,a.tag))}return Hg(e,n,r),cp(),!1}if(Ze)return t=gn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==dy&&(e=Error(z(422),{cause:n}),ec(Dn(e,a)))):(n!==dy&&(t=Error(z(423),{cause:n}),ec(Dn(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=Dn(n,a),r=Cy(e.stateNode,n,r),Ag(e,r),Ht!==4&&(Ht=2)),!1;var o=Error(z(520),{cause:n});if(o=Dn(o,a),Wu===null?Wu=[o]:Wu.push(o),Ht!==4&&(Ht=2),t===null)return!0;n=Dn(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=Cy(a.stateNode,n,e),Ag(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"&&(Eo===null||!Eo.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=Jk(r),Qk(r,e,a,n),Ag(a,r),!1}a=a.return}while(a!==null);return!1}var Cw=Error(z(461)),na=!1;function ga(e,t,a,n){t.child=e===null?pk(t,null,a,n):Ci(t,e.child,a,n)}function P0(e,t,a,n,r){a=a.render;var o=t.ref;if("ref"in n){var i={};for(var s in n)s!=="ref"&&(i[s]=n[s])}else i=n;return Ii(t),n=fw(e,t,a,i,o,r),s=pw(),e!==null&&!na?(mw(e,t,r),$r(e,t,r)):(Ze&&s&&rw(t),t.flags|=1,ga(e,t,n,r),t.child)}function O0(e,t,a,n,r){if(e===null){var o=a.type;return typeof o=="function"&&!nw(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,eT(e,t,o,n,r)):(e=Pf(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!kw(e,r)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Ju,a(i,n)&&e.ref===t.ref)return $r(e,t,r)}return t.flags|=1,e=zr(o,n),e.ref=t.ref,e.return=t,t.child=e}function eT(e,t,a,n,r){if(e!==null){var o=e.memoizedProps;if(Ju(o,n)&&e.ref===t.ref)if(na=!1,t.pendingProps=n=o,kw(e,r))(e.flags&131072)!==0&&(na=!0);else return t.lanes=e.lanes,$r(e,t,r)}return ky(e,t,a,n,r)}function tT(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 N0(e,t,o,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Of(t,o!==null?o.cachePool:null),o!==null?C0(t,o):wy(),gk(t);else return n=t.lanes=536870912,N0(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(Of(t,o.cachePool),C0(t,o),yo(t),t.memoizedState=null):(e!==null&&Of(t,null),wy(),yo(t));return ga(e,t,r,a),t.child}function Pu(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function N0(e,t,a,n,r){var o=sw();return o=o===null?null:{parent:aa._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&Of(t,null),wy(),gk(t),e!==null&&fl(e,t,n,!0),t.childLanes=r,null}function Bf(e,t){return t=ip({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function U0(e,t,a){return Ci(t,e.child,null,a),e=Bf(t,t.pendingProps),e.flags|=2,ln(t),t.memoizedState=null,e}function mF(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ze){if(n.mode==="hidden")return e=Bf(t,n),t.lanes=536870912,Pu(null,e);if(vy(t),(e=Lt)?(e=GT(e,_n),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_o!==null?{id:ur,overflow:cr}:null,retryLane:536870912,hydrationErrors:null},a=ik(e),a.return=t,t.child=a,wa=t,Lt=null)):e=null,e===null)throw Po(t);return t.lanes=536870912,null}return Bf(t,n)}var o=e.memoizedState;if(o!==null){var i=o.dehydrated;if(vy(t),r)if(t.flags&256)t.flags&=-257,t=U0(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(z(558));else if(na||fl(e,t,a,!1),r=(a&e.childLanes)!==0,na||r){if(n=xt,n!==null&&(i=DC(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Mi(e,i),Xa(n,e,i),Cw;cp(),t=U0(e,t,a)}else e=o.treeContext,Lt=On(i.nextSibling),wa=t,Ze=!0,ko=null,_n=!1,e!==null&&lk(t,e),t=Bf(t,n),t.flags|=4096;return t}return e=zr(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zf(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(z(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function ky(e,t,a,n,r){return Ii(t),a=fw(e,t,a,n,void 0,r),n=pw(),e!==null&&!na?(mw(e,t,r),$r(e,t,r)):(Ze&&n&&rw(t),t.flags|=1,ga(e,t,a,r),t.child)}function B0(e,t,a,n,r,o){return Ii(t),t.updateQueue=null,a=wk(t,n,a,r),yk(e),n=pw(),e!==null&&!na?(mw(e,t,o),$r(e,t,o)):(Ze&&n&&rw(t),t.flags|=1,ga(e,t,a,o),t.child)}function z0(e,t,a,n,r){if(Ii(t),t.stateNode===null){var o=Hs,i=a.contextType;typeof i=="object"&&i!==null&&(o=va(i)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Iy,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},uw(t),i=a.contextType,o.context=typeof i=="object"&&i!==null?va(i):Hs,o.state=t.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(Rg(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&&Iy.enqueueReplaceState(o,o.state,null),Hu(t,n,o,r),qu(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){o=t.stateNode;var s=t.memoizedProps,l=Ti(a,s);o.props=l;var u=o.context,c=a.contextType;i=Hs,typeof c=="object"&&c!==null&&(i=va(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=t.pendingProps!==s,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||u!==i)&&D0(t,o,n,i),mo=!1;var p=t.memoizedState;o.state=p,Hu(t,n,o,r),qu(),u=t.memoizedState,s||p!==u||mo?(typeof d=="function"&&(Rg(t,a,d,n),u=t.memoizedState),(l=mo||R0(t,a,l,n,p,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=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,gy(e,t),i=t.memoizedProps,c=Ti(a,i),o.props=c,d=t.pendingProps,p=o.context,u=a.contextType,l=Hs,typeof u=="object"&&u!==null&&(l=va(u)),s=a.getDerivedStateFromProps,(u=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||p!==l)&&D0(t,o,n,l),mo=!1,p=t.memoizedState,o.state=p,Hu(t,n,o,r),qu();var m=t.memoizedState;i!==d||p!==m||mo||e!==null&&e.dependencies!==null&&Qf(e.dependencies)?(typeof s=="function"&&(Rg(t,a,s,n),m=t.memoizedState),(c=mo||R0(t,a,c,n,p,m,l)||e!==null&&e.dependencies!==null&&Qf(e.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=m),o.props=n,o.state=m,o.context=l,n=c):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),n=!1)}return o=n,zf(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=Ci(t,e.child,null,r),t.child=Ci(t,null,a,r)):ga(e,t,a,r),t.memoizedState=o.state,e=t.child):e=$r(e,t,r),e}function F0(e,t,a,n){return Si(),t.flags|=256,ga(e,t,a,n),t.child}var Dg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _g(e){return{baseLanes:e,cachePool:ck()}}function Pg(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=cn),e}function aT(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:(Kt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ze){if(r?go(t):yo(t),(e=Lt)?(e=GT(e,_n),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_o!==null?{id:ur,overflow:cr}:null,retryLane:536870912,hydrationErrors:null},a=ik(e),a.return=t,t.child=a,wa=t,Lt=null)):e=null,e===null)throw Po(t);return zy(e)?t.lanes=32:t.lanes=536870912,null}var s=n.children;return n=n.fallback,r?(yo(t),r=t.mode,s=ip({mode:"hidden",children:s},r),n=wi(n,r,a,null),s.return=t,n.return=t,s.sibling=n,t.child=s,n=t.child,n.memoizedState=_g(a),n.childLanes=Pg(e,i,a),t.memoizedState=Dg,Pu(null,n)):(go(t),Ty(t,s))}var l=e.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)t.flags&256?(go(t),t.flags&=-257,t=Og(e,t,a)):t.memoizedState!==null?(yo(t),t.child=e.child,t.flags|=128,t=null):(yo(t),s=n.fallback,r=t.mode,n=ip({mode:"visible",children:n.children},r),s=wi(s,r,a,null),s.flags|=2,n.return=t,s.return=t,n.sibling=s,t.child=n,Ci(t,e.child,null,a),n=t.child,n.memoizedState=_g(a),n.childLanes=Pg(e,i,a),t.memoizedState=Dg,t=Pu(null,n));else if(go(t),zy(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,n=Error(z(419)),n.stack="",n.digest=i,ec({value:n,source:null,stack:null}),t=Og(e,t,a)}else if(na||fl(e,t,a,!1),i=(a&e.childLanes)!==0,na||i){if(i=xt,i!==null&&(n=DC(i,a),n!==0&&n!==l.retryLane))throw l.retryLane=n,Mi(e,n),Xa(i,e,n),Cw;By(s)||cp(),t=Og(e,t,a)}else By(s)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Lt=On(s.nextSibling),wa=t,Ze=!0,ko=null,_n=!1,e!==null&&lk(t,e),t=Ty(t,n.children),t.flags|=4096);return t}return r?(yo(t),s=n.fallback,r=t.mode,l=e.child,u=l.sibling,n=zr(l,{mode:"hidden",children:n.children}),n.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=zr(u,s):(s=wi(s,r,a,null),s.flags|=2),s.return=t,n.return=t,n.sibling=s,t.child=n,Pu(null,n),n=t.child,s=e.child.memoizedState,s===null?s=_g(a):(r=s.cachePool,r!==null?(l=aa._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=ck(),s={baseLanes:s.baseLanes|a,cachePool:r}),n.memoizedState=s,n.childLanes=Pg(e,i,a),t.memoizedState=Dg,Pu(e.child,n)):(go(t),a=e.child,e=a.sibling,a=zr(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 Ty(e,t){return t=ip({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ip(e,t){return e=un(22,e,null,t),e.lanes=0,e}function Og(e,t,a){return Ci(t,e.child,null,a),e=Ty(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function q0(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),py(e.return,t,a)}function Ng(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 nT(e,t,a){var n=t.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=Kt.current,s=(i&2)!==0;if(s?(i=i&1|2,t.flags|=128):i&=1,It(Kt,i),ga(e,t,n,a),n=Ze?Qu:0,!s&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&q0(e,a,t);else if(e.tag===19)q0(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&&ap(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),Ng(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&&ap(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}Ng(t,!0,a,null,o,n);break;case"together":Ng(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function $r(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),No|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(fl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(z(153));if(t.child!==null){for(e=t.child,a=zr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=zr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function kw(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Qf(e)))}function hF(e,t,a){switch(t.tag){case 3:Wf(t,t.stateNode.containerInfo),ho(t,aa,e.memoizedState.cache),Si();break;case 27:case 5:ey(t);break;case 4:Wf(t,t.stateNode.containerInfo);break;case 10:ho(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,vy(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(go(t),t.flags|=128,null):(a&t.child.childLanes)!==0?aT(e,t,a):(go(t),e=$r(e,t,a),e!==null?e.sibling:null);go(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(fl(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return nT(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),It(Kt,Kt.current),n)break;return null;case 22:return t.lanes=0,tT(e,t,a,t.pendingProps);case 24:ho(t,aa,e.memoizedState.cache)}return $r(e,t,a)}function rT(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)na=!0;else{if(!kw(e,a)&&(t.flags&128)===0)return na=!1,hF(e,t,a);na=(e.flags&131072)!==0}else na=!1,Ze&&(t.flags&1048576)!==0&&sk(t,Qu,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=hi(t.elementType),t.type=e,typeof e=="function")nw(e)?(n=Ti(e,n),t.tag=1,t=z0(null,t,e,n,a)):(t.tag=0,t=ky(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===jy){t.tag=11,t=P0(null,t,e,n,a);break e}else if(r===Vy){t.tag=14,t=O0(null,t,e,n,a);break e}}throw t=Jg(e)||e,Error(z(306,t,""))}}return t;case 0:return ky(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=Ti(n,t.pendingProps),z0(e,t,n,r,a);case 3:e:{if(Wf(t,t.stateNode.containerInfo),e===null)throw Error(z(387));n=t.pendingProps;var o=t.memoizedState;r=o.element,gy(e,t),Hu(t,n,null,a);var i=t.memoizedState;if(n=i.cache,ho(t,aa,n),n!==o.cache&&my(t,[aa],a,!0),qu(),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=F0(e,t,n,a);break e}else if(n!==r){r=Dn(Error(z(424)),t),ec(r),t=F0(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=On(e.firstChild),wa=t,Ze=!0,ko=null,_n=!0,a=pk(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Si(),n===r){t=$r(e,t,a);break e}ga(e,t,n,a)}t=t.child}return t;case 26:return zf(e,t),e===null?(a=uC(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ze||(a=t.type,e=t.pendingProps,n=mp(Co.current).createElement(a),n[ya]=t,n[Ka]=e,xa(n,a,e),ca(n),t.stateNode=n):t.memoizedState=uC(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ey(t),e===null&&Ze&&(n=t.stateNode=XT(t.type,t.pendingProps,Co.current),wa=t,_n=!0,r=Lt,Bo(t.type)?(Fy=r,Lt=On(n.firstChild)):Lt=r),ga(e,t,t.pendingProps.children,a),zf(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ze&&((r=n=Lt)&&(n=jF(n,t.type,t.pendingProps,_n),n!==null?(t.stateNode=n,wa=t,Lt=On(n.firstChild),_n=!1,r=!0):r=!1),r||Po(t)),ey(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,n=o.children,Ny(r,o)?n=null:i!==null&&Ny(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=fw(e,t,iF,null,null,a),ic._currentValue=r),zf(e,t),ga(e,t,n,a),t.child;case 6:return e===null&&Ze&&((e=a=Lt)&&(a=VF(a,t.pendingProps,_n),a!==null?(t.stateNode=a,wa=t,Lt=null,e=!0):e=!1),e||Po(t)),null;case 13:return aT(e,t,a);case 4:return Wf(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ci(t,null,n,a):ga(e,t,n,a),t.child;case 11:return P0(e,t,t.type,t.pendingProps,a);case 7:return ga(e,t,t.pendingProps,a),t.child;case 8:return ga(e,t,t.pendingProps.children,a),t.child;case 12:return ga(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,ho(t,t.type,n.value),ga(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,Ii(t),r=va(r),n=n(r),t.flags|=1,ga(e,t,n,a),t.child;case 14:return O0(e,t,t.type,t.pendingProps,a);case 15:return eT(e,t,t.type,t.pendingProps,a);case 19:return nT(e,t,a);case 31:return mF(e,t,a);case 22:return tT(e,t,a,t.pendingProps);case 24:return Ii(t),n=va(aa),e===null?(r=sw(),r===null&&(r=xt,o=iw(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:n,cache:r},uw(t),ho(t,aa,r)):((e.lanes&a)!==0&&(gy(e,t),Hu(t,null,null,a),qu()),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),ho(t,aa,n)):(n=o.cache,ho(t,aa,n),n!==r.cache&&my(t,[aa],a,!0))),ga(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(z(156,t.tag))}function Mr(e){e.flags|=4}function Ug(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(ET())e.flags|=8192;else throw xi=ep,lw}else e.flags&=-16777217}function H0(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ZT(t))if(ET())e.flags|=8192;else throw xi=ep,lw}function If(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?AC():536870912,e.lanes|=t,ol|=t)}function Lu(e,t){if(!Ze)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 Tt(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 gF(e,t,a){var n=t.pendingProps;switch(ow(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(t),null;case 1:return Tt(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Fr(aa),Qs(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ms(t)?Mr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Eg())),Tt(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?(Mr(t),o!==null?(Tt(t),H0(t,o)):(Tt(t),Ug(t,r,null,n,a))):o?o!==e.memoizedState?(Mr(t),Tt(t),H0(t,o)):(Tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Mr(t),Tt(t),Ug(t,r,e,n,a)),null;case 27:if(Gf(t),a=Co.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Mr(t);else{if(!n){if(t.stateNode===null)throw Error(z(166));return Tt(t),null}e=fr.current,Ms(t)?y0(t,e):(e=XT(r,n,a),t.stateNode=e,Mr(t))}return Tt(t),null;case 5:if(Gf(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Mr(t);else{if(!n){if(t.stateNode===null)throw Error(z(166));return Tt(t),null}if(o=fr.current,Ms(t))y0(t,o);else{var i=mp(Co.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[ya]=t,o[Ka]=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(xa(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&&Mr(t)}}return Tt(t),Ug(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Mr(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(z(166));if(e=Co.current,Ms(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=wa,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[ya]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||VT(e.nodeValue,a)),e||Po(t,!0)}else e=mp(e).createTextNode(n),e[ya]=t,t.stateNode=e}return Tt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Ms(t),a!==null){if(e===null){if(!n)throw Error(z(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(557));e[ya]=t}else Si(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Tt(t),e=!1}else a=Eg(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ln(t),t):(ln(t),null);if((t.flags&128)!==0)throw Error(z(558))}return Tt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Ms(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(z(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(z(317));r[ya]=t}else Si(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Tt(t),r=!1}else r=Eg(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ln(t),t):(ln(t),null)}return ln(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),If(t,t.updateQueue),Tt(t),null);case 4:return Qs(),e===null&&Dw(t.stateNode.containerInfo),Tt(t),null;case 10:return Fr(t.type),Tt(t),null;case 19:if(da(Kt),n=t.memoizedState,n===null)return Tt(t),null;if(r=(t.flags&128)!==0,o=n.rendering,o===null)if(r)Lu(n,!1);else{if(Ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=ap(e),o!==null){for(t.flags|=128,Lu(n,!1),e=o.updateQueue,t.updateQueue=e,If(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)ok(a,e),a=a.sibling;return It(Kt,Kt.current&1|2),Ze&&Pr(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&dn()>lp&&(t.flags|=128,r=!0,Lu(n,!1),t.lanes=4194304)}else{if(!r)if(e=ap(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,If(t,e),Lu(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!Ze)return Tt(t),null}else 2*dn()-n.renderingStartTime>lp&&a!==536870912&&(t.flags|=128,r=!0,Lu(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=dn(),e.sibling=null,a=Kt.current,It(Kt,r?a&1|2:a&1),Ze&&Pr(t,n.treeForkCount),e):(Tt(t),null);case 22:case 23:return ln(t),cw(),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&&(Tt(t),t.subtreeFlags&6&&(t.flags|=8192)):Tt(t),a=t.updateQueue,a!==null&&If(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&&da(vi),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Fr(aa),Tt(t),null;case 25:return null;case 30:return null}throw Error(z(156,t.tag))}function yF(e,t){switch(ow(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fr(aa),Qs(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Gf(t),null;case 31:if(t.memoizedState!==null){if(ln(t),t.alternate===null)throw Error(z(340));Si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ln(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));Si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return da(Kt),null;case 4:return Qs(),null;case 10:return Fr(t.type),null;case 22:case 23:return ln(t),cw(),e!==null&&da(vi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fr(aa),null;case 25:return null;default:return null}}function oT(e,t){switch(ow(t),t.tag){case 3:Fr(aa),Qs();break;case 26:case 27:case 5:Gf(t);break;case 4:Qs();break;case 31:t.memoizedState!==null&&ln(t);break;case 13:ln(t);break;case 19:da(Kt);break;case 10:Fr(t.type);break;case 22:case 23:ln(t),cw(),e!==null&&da(vi);break;case 24:Fr(aa)}}function yc(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(s){ft(t,t.return,s)}}function Oo(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,s=i.destroy;if(s!==void 0){i.destroy=void 0,r=t;var l=a,u=s;try{u()}catch(c){ft(r,l,c)}}}n=n.next}while(n!==o)}}catch(c){ft(t,t.return,c)}}function iT(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{hk(t,a)}catch(n){ft(e,e.return,n)}}}function sT(e,t,a){a.props=Ti(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){ft(e,t,n)}}function Vu(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){ft(e,t,r)}}function dr(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){ft(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){ft(e,t,r)}else a.current=null}function lT(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){ft(e,e.return,r)}}function Bg(e,t,a){try{var n=e.stateNode;UF(n,e.type,a,t),n[Ka]=t}catch(r){ft(e,e.return,r)}}function uT(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Bo(e.type)||e.tag===4}function zg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||uT(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&&Bo(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 Ly(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=Ur));else if(n!==4&&(n===27&&Bo(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Ly(e,t,a),e=e.sibling;e!==null;)Ly(e,t,a),e=e.sibling}function sp(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&&Bo(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(sp(e,t,a),e=e.sibling;e!==null;)sp(e,t,a),e=e.sibling}function cT(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);xa(t,n,a),t[ya]=e,t[Ka]=a}catch(o){ft(e,e.return,o)}}var Or=!1,ta=!1,Fg=!1,j0=typeof WeakSet=="function"?WeakSet:Set,ua=null;function wF(e,t){if(e=e.containerInfo,Py=wp,e=ZC(e),ew(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,s=-1,l=-1,u=0,c=0,d=e,p=null;t:for(;;){for(var m;d!==a||r!==0&&d.nodeType!==3||(s=i+r),d!==o||n!==0&&d.nodeType!==3||(l=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===e)break t;if(p===a&&++u===r&&(s=i),p===o&&++c===n&&(l=i),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}a=s===-1||l===-1?null:{start:s,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(Oy={focusedElem:e,selectionRange:a},wp=!1,ua=t;ua!==null;)if(t=ua,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ua=e;else for(;ua!==null;){switch(t=ua,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 h=Ti(a.type,r);e=n.getSnapshotBeforeUpdate(h,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(v){ft(a,a.return,v)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Uy(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Uy(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(z(163))}if(e=t.sibling,e!==null){e.return=t.return,ua=e;break}ua=t.return}}function dT(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Dr(e,a),n&4&&yc(5,a);break;case 1:if(Dr(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(i){ft(a,a.return,i)}else{var r=Ti(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){ft(a,a.return,i)}}n&64&&iT(a),n&512&&Vu(a,a.return);break;case 3:if(Dr(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{hk(e,t)}catch(i){ft(a,a.return,i)}}break;case 27:t===null&&n&4&&cT(a);case 26:case 5:Dr(e,a),t===null&&n&4&&lT(a),n&512&&Vu(a,a.return);break;case 12:Dr(e,a);break;case 31:Dr(e,a),n&4&&mT(e,a);break;case 13:Dr(e,a),n&4&&hT(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=LF.bind(null,a),$F(e,a))));break;case 22:if(n=a.memoizedState!==null||Or,!n){t=t!==null&&t.memoizedState!==null||ta,r=Or;var o=ta;Or=n,(ta=t)&&!o?_r(e,a,(a.subtreeFlags&8772)!==0):Dr(e,a),Or=r,ta=o}break;case 30:break;default:Dr(e,a)}}function fT(e){var t=e.alternate;t!==null&&(e.alternate=null,fT(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Xy(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 _t=null,Wa=!1;function Rr(e,t,a){for(a=a.child;a!==null;)pT(e,t,a),a=a.sibling}function pT(e,t,a){if(fn&&typeof fn.onCommitFiberUnmount=="function")try{fn.onCommitFiberUnmount(cc,a)}catch{}switch(a.tag){case 26:ta||dr(a,t),Rr(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ta||dr(a,t);var n=_t,r=Wa;Bo(a.type)&&(_t=a.stateNode,Wa=!1),Rr(e,t,a),Xu(a.stateNode),_t=n,Wa=r;break;case 5:ta||dr(a,t);case 6:if(n=_t,r=Wa,_t=null,Rr(e,t,a),_t=n,Wa=r,_t!==null)if(Wa)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(a.stateNode)}catch(o){ft(a,t,o)}else try{_t.removeChild(a.stateNode)}catch(o){ft(a,t,o)}break;case 18:_t!==null&&(Wa?(e=_t,rC(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),ul(e)):rC(_t,a.stateNode));break;case 4:n=_t,r=Wa,_t=a.stateNode.containerInfo,Wa=!0,Rr(e,t,a),_t=n,Wa=r;break;case 0:case 11:case 14:case 15:Oo(2,a,t),ta||Oo(4,a,t),Rr(e,t,a);break;case 1:ta||(dr(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&sT(a,t,n)),Rr(e,t,a);break;case 21:Rr(e,t,a);break;case 22:ta=(n=ta)||a.memoizedState!==null,Rr(e,t,a),ta=n;break;default:Rr(e,t,a)}}function mT(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ul(e)}catch(a){ft(t,t.return,a)}}}function hT(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ul(e)}catch(a){ft(t,t.return,a)}}function vF(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new j0),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new j0),t;default:throw Error(z(435,e.tag))}}function Cf(e,t){var a=vF(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=EF.bind(null,e,n);n.then(r,r)}})}function Va(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,s=i;e:for(;s!==null;){switch(s.tag){case 27:if(Bo(s.type)){_t=s.stateNode,Wa=!1;break e}break;case 5:_t=s.stateNode,Wa=!1;break e;case 3:case 4:_t=s.stateNode.containerInfo,Wa=!0;break e}s=s.return}if(_t===null)throw Error(z(160));pT(o,i,r),_t=null,Wa=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gT(t,e),t=t.sibling}var Gn=null;function gT(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Va(t,e),$a(e),n&4&&(Oo(3,e,e.return),yc(3,e),Oo(5,e,e.return));break;case 1:Va(t,e),$a(e),n&512&&(ta||a===null||dr(a,a.return)),n&64&&Or&&(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=Gn;if(Va(t,e),$a(e),n&512&&(ta||a===null||dr(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[pc]||o[ya]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),xa(o,n,a),o[ya]=e,ca(o),n=o;break e;case"link":var i=dC("link","href",r).get(n+(a.href||""));if(i){for(var s=0;s<i.length;s++)if(o=i[s],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(s,1);break t}}o=r.createElement(n),xa(o,n,a),r.head.appendChild(o);break;case"meta":if(i=dC("meta","content",r).get(n+(a.content||""))){for(s=0;s<i.length;s++)if(o=i[s],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(s,1);break t}}o=r.createElement(n),xa(o,n,a),r.head.appendChild(o);break;default:throw Error(z(468,n))}o[ya]=e,ca(o),n=o}e.stateNode=n}else fC(r,e.type,e.stateNode);else e.stateNode=cC(r,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?fC(r,e.type,e.stateNode):cC(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Bg(e,e.memoizedProps,a.memoizedProps)}break;case 27:Va(t,e),$a(e),n&512&&(ta||a===null||dr(a,a.return)),a!==null&&n&4&&Bg(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Va(t,e),$a(e),n&512&&(ta||a===null||dr(a,a.return)),e.flags&32){r=e.stateNode;try{tl(r,"")}catch(h){ft(e,e.return,h)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,Bg(e,r,a!==null?a.memoizedProps:r)),n&1024&&(Fg=!0);break;case 6:if(Va(t,e),$a(e),n&4){if(e.stateNode===null)throw Error(z(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(h){ft(e,e.return,h)}}break;case 3:if(Hf=null,r=Gn,Gn=hp(t.containerInfo),Va(t,e),Gn=r,$a(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{ul(t.containerInfo)}catch(h){ft(e,e.return,h)}Fg&&(Fg=!1,yT(e));break;case 4:n=Gn,Gn=hp(e.stateNode.containerInfo),Va(t,e),$a(e),Gn=n;break;case 12:Va(t,e),$a(e);break;case 31:Va(t,e),$a(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Cf(e,n)));break;case 13:Va(t,e),$a(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Rp=dn()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Cf(e,n)));break;case 22:r=e.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=Or,c=ta;if(Or=u||r,ta=c||l,Va(t,e),ta=c,Or=u,$a(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||l||Or||ta||gi(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){l=a=t;try{if(o=l.stateNode,r)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,p=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(h){ft(l,l.return,h)}}}else if(t.tag===6){if(a===null){l=t;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(h){ft(l,l.return,h)}}}else if(t.tag===18){if(a===null){l=t;try{var m=l.stateNode;r?oC(m,!0):oC(l.stateNode,!1)}catch(h){ft(l,l.return,h)}}}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,Cf(e,a))));break;case 19:Va(t,e),$a(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Cf(e,n)));break;case 30:break;case 21:break;default:Va(t,e),$a(e)}}function $a(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(uT(n)){a=n;break}n=n.return}if(a==null)throw Error(z(160));switch(a.tag){case 27:var r=a.stateNode,o=zg(e);sp(e,o,r);break;case 5:var i=a.stateNode;a.flags&32&&(tl(i,""),a.flags&=-33);var s=zg(e);sp(e,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=zg(e);Ly(e,u,l);break;default:throw Error(z(161))}}catch(c){ft(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yT(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yT(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Dr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dT(e,t.alternate,t),t=t.sibling}function gi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Oo(4,t,t.return),gi(t);break;case 1:dr(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&sT(t,t.return,a),gi(t);break;case 27:Xu(t.stateNode);case 26:case 5:dr(t,t.return),gi(t);break;case 22:t.memoizedState===null&&gi(t);break;case 30:gi(t);break;default:gi(t)}e=e.sibling}}function _r(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:_r(r,o,a),yc(4,o);break;case 1:if(_r(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){ft(n,n.return,u)}if(n=o,r=n.updateQueue,r!==null){var s=n.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)mk(l[r],s)}catch(u){ft(n,n.return,u)}}a&&i&64&&iT(o),Vu(o,o.return);break;case 27:cT(o);case 26:case 5:_r(r,o,a),a&&n===null&&i&4&&lT(o),Vu(o,o.return);break;case 12:_r(r,o,a);break;case 31:_r(r,o,a),a&&i&4&&mT(r,o);break;case 13:_r(r,o,a),a&&i&4&&hT(r,o);break;case 22:o.memoizedState===null&&_r(r,o,a),Vu(o,o.return);break;case 30:break;default:_r(r,o,a)}t=t.sibling}}function Tw(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&&hc(a))}function Lw(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&hc(e))}function Wn(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wT(e,t,a,n),t=t.sibling}function wT(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Wn(e,t,a,n),r&2048&&yc(9,t);break;case 1:Wn(e,t,a,n);break;case 3:Wn(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&&hc(e)));break;case 12:if(r&2048){Wn(e,t,a,n),e=t.stateNode;try{var o=t.memoizedProps,i=o.id,s=o.onPostCommit;typeof s=="function"&&s(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){ft(t,t.return,l)}}else Wn(e,t,a,n);break;case 31:Wn(e,t,a,n);break;case 13:Wn(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,t.memoizedState!==null?o._visibility&2?Wn(e,t,a,n):$u(e,t):o._visibility&2?Wn(e,t,a,n):(o._visibility|=2,Ds(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Tw(i,t);break;case 24:Wn(e,t,a,n),r&2048&&Lw(t.alternate,t);break;default:Wn(e,t,a,n)}}function Ds(e,t,a,n,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,i=t,s=a,l=n,u=i.flags;switch(i.tag){case 0:case 11:case 15:Ds(o,i,s,l,r),yc(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?Ds(o,i,s,l,r):$u(o,i):(c._visibility|=2,Ds(o,i,s,l,r)),r&&u&2048&&Tw(i.alternate,i);break;case 24:Ds(o,i,s,l,r),r&&u&2048&&Lw(i.alternate,i);break;default:Ds(o,i,s,l,r)}t=t.sibling}}function $u(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:$u(a,n),r&2048&&Tw(n.alternate,n);break;case 24:$u(a,n),r&2048&&Lw(n.alternate,n);break;default:$u(a,n)}t=t.sibling}}var Ou=8192;function Rs(e,t,a){if(e.subtreeFlags&Ou)for(e=e.child;e!==null;)vT(e,t,a),e=e.sibling}function vT(e,t,a){switch(e.tag){case 26:Rs(e,t,a),e.flags&Ou&&e.memoizedState!==null&&nq(a,Gn,e.memoizedState,e.memoizedProps);break;case 5:Rs(e,t,a);break;case 3:case 4:var n=Gn;Gn=hp(e.stateNode.containerInfo),Rs(e,t,a),Gn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Ou,Ou=16777216,Rs(e,t,a),Ou=n):Rs(e,t,a));break;default:Rs(e,t,a)}}function xT(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 Eu(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];ua=n,ST(n,e)}xT(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)bT(e),e=e.sibling}function bT(e){switch(e.tag){case 0:case 11:case 15:Eu(e),e.flags&2048&&Oo(9,e,e.return);break;case 3:Eu(e);break;case 12:Eu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ff(e)):Eu(e);break;default:Eu(e)}}function Ff(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];ua=n,ST(n,e)}xT(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Oo(8,t,t.return),Ff(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ff(t));break;default:Ff(t)}e=e.sibling}}function ST(e,t){for(;ua!==null;){var a=ua;switch(a.tag){case 0:case 11:case 15:Oo(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:hc(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,ua=n;else e:for(a=e;ua!==null;){n=ua;var r=n.sibling,o=n.return;if(fT(n),n===a){ua=null;break e}if(r!==null){r.return=o,ua=r;break e}ua=o}}}var xF={getCacheForType:function(e){var t=va(aa),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return va(aa).controller.signal}},bF=typeof WeakMap=="function"?WeakMap:Map,st=0,xt=null,Xe=null,Ke=0,dt=0,sn=null,bo=!1,ml=!1,Ew=!1,Wr=0,Ht=0,No=0,bi=0,Aw=0,cn=0,ol=0,Wu=null,Ga=null,Ey=!1,Rp=0,IT=0,lp=1/0,up=null,Eo=null,oa=0,Ao=null,il=null,qr=0,Ay=0,My=null,CT=null,Gu=0,Ry=null;function mn(){return(st&2)!==0&&Ke!==0?Ke&-Ke:Te.T!==null?Rw():_C()}function kT(){if(cn===0)if((Ke&536870912)===0||Ze){var e=mf;mf<<=1,(mf&3932160)===0&&(mf=262144),cn=e}else cn=536870912;return e=gn.current,e!==null&&(e.flags|=32),cn}function Xa(e,t,a){(e===xt&&(dt===2||dt===9)||e.cancelPendingCommit!==null)&&(sl(e,0),So(e,Ke,cn,!1)),fc(e,a),((st&2)===0||e!==xt)&&(e===xt&&((st&2)===0&&(bi|=a),Ht===4&&So(e,Ke,cn,!1)),mr(e))}function TT(e,t,a){if((st&6)!==0)throw Error(z(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||dc(e,t),r=n?CF(e,t):qg(e,t,!0),o=n;do{if(r===0){ml&&!n&&So(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!SF(a)){r=qg(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 s=e;r=Wu;var l=s.current.memoizedState.isDehydrated;if(l&&(sl(s,i).flags|=256),i=qg(s,i,!1),i!==2){if(Ew&&!l){s.errorRecoveryDisabledLanes|=o,bi|=o,r=4;break e}o=Ga,Ga=r,o!==null&&(Ga===null?Ga=o:Ga.push.apply(Ga,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){sl(e,0),So(e,t,0,!0);break}e:{switch(n=e,o=r,o){case 0:case 1:throw Error(z(345));case 4:if((t&4194048)!==t)break;case 6:So(n,t,cn,!bo);break e;case 2:Ga=null;break;case 3:case 5:break;default:throw Error(z(329))}if((t&62914560)===t&&(r=Rp+300-dn(),10<r)){if(So(n,t,cn,!bo),xp(n,0,!0)!==0)break e;qr=t,n.timeoutHandle=WT(V0.bind(null,n,a,Ga,up,Ey,t,cn,bi,ol,bo,o,"Throttled",-0,0),r);break e}V0(n,a,Ga,up,Ey,t,cn,bi,ol,bo,o,null,-0,0)}}break}while(!0);mr(e)}function V0(e,t,a,n,r,o,i,s,l,u,c,d,p,m){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:Ur},vT(t,o,d);var h=(o&62914560)===o?Rp-dn():(o&4194048)===o?IT-dn():0;if(h=rq(d,h),h!==null){qr=o,e.cancelPendingCommit=h(W0.bind(null,e,t,o,a,n,r,i,s,l,c,d,null,p,m)),So(e,o,i,!u);return}}W0(e,t,o,a,n,r,i,s,l)}function SF(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(!hn(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 So(e,t,a,n){t&=~Aw,t&=~bi,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var o=31-pn(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&MC(e,a,t)}function Dp(){return(st&6)===0?(wc(0,!1),!1):!0}function Mw(){if(Xe!==null){if(dt===0)var e=Xe.return;else e=Xe,Br=Ri=null,hw(e),Ys=null,tc=0,e=Xe;for(;e!==null;)oT(e.alternate,e),e=e.return;Xe=null}}function sl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,FF(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),qr=0,Mw(),xt=e,Xe=a=zr(e.current,null),Ke=t,dt=0,sn=null,bo=!1,ml=dc(e,t),Ew=!1,ol=cn=Aw=bi=No=Ht=0,Ga=Wu=null,Ey=!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-pn(n),o=1<<r;t|=e[r],n&=~o}return Wr=t,Cp(),a}function LT(e,t){Pe=null,Te.H=nc,t===pl||t===Tp?(t=S0(),dt=3):t===lw?(t=S0(),dt=4):dt=t===Cw?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,sn=t,Xe===null&&(Ht=1,op(e,Dn(t,e.current)))}function ET(){var e=gn.current;return e===null?!0:(Ke&4194048)===Ke?Pn===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===Pn:!1}function AT(){var e=Te.H;return Te.H=nc,e===null?nc:e}function MT(){var e=Te.A;return Te.A=xF,e}function cp(){Ht=4,bo||(Ke&4194048)!==Ke&&gn.current!==null||(ml=!0),(No&134217727)===0&&(bi&134217727)===0||xt===null||So(xt,Ke,cn,!1)}function qg(e,t,a){var n=st;st|=2;var r=AT(),o=MT();(xt!==e||Ke!==t)&&(up=null,sl(e,t)),t=!1;var i=Ht;e:do try{if(dt!==0&&Xe!==null){var s=Xe,l=sn;switch(dt){case 8:Mw(),i=6;break e;case 3:case 2:case 9:case 6:gn.current===null&&(t=!0);var u=dt;if(dt=0,sn=null,$s(e,s,l,u),a&&ml){i=0;break e}break;default:u=dt,dt=0,sn=null,$s(e,s,l,u)}}IF(),i=Ht;break}catch(c){LT(e,c)}while(!0);return t&&e.shellSuspendCounter++,Br=Ri=null,st=n,Te.H=r,Te.A=o,Xe===null&&(xt=null,Ke=0,Cp()),i}function IF(){for(;Xe!==null;)RT(Xe)}function CF(e,t){var a=st;st|=2;var n=AT(),r=MT();xt!==e||Ke!==t?(up=null,lp=dn()+500,sl(e,t)):ml=dc(e,t);e:do try{if(dt!==0&&Xe!==null){t=Xe;var o=sn;t:switch(dt){case 1:dt=0,sn=null,$s(e,t,o,1);break;case 2:case 9:if(b0(o)){dt=0,sn=null,$0(t);break}t=function(){dt!==2&&dt!==9||xt!==e||(dt=7),mr(e)},o.then(t,t);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:b0(o)?(dt=0,sn=null,$0(t)):(dt=0,sn=null,$s(e,t,o,7));break;case 5:var i=null;switch(Xe.tag){case 26:i=Xe.memoizedState;case 5:case 27:var s=Xe;if(i?ZT(i):s.stateNode.complete){dt=0,sn=null;var l=s.sibling;if(l!==null)Xe=l;else{var u=s.return;u!==null?(Xe=u,_p(u)):Xe=null}break t}}dt=0,sn=null,$s(e,t,o,5);break;case 6:dt=0,sn=null,$s(e,t,o,6);break;case 8:Mw(),Ht=6;break e;default:throw Error(z(462))}}kF();break}catch(c){LT(e,c)}while(!0);return Br=Ri=null,Te.H=n,Te.A=r,st=a,Xe!==null?0:(xt=null,Ke=0,Cp(),Ht)}function kF(){for(;Xe!==null&&!X3();)RT(Xe)}function RT(e){var t=rT(e.alternate,e,Wr);e.memoizedProps=e.pendingProps,t===null?_p(e):Xe=t}function $0(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=B0(a,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=B0(a,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:hw(t);default:oT(a,t),t=Xe=ok(t,Wr),t=rT(a,t,Wr)}e.memoizedProps=e.pendingProps,t===null?_p(e):Xe=t}function $s(e,t,a,n){Br=Ri=null,hw(t),Ys=null,tc=0;var r=t.return;try{if(pF(e,r,t,a,Ke)){Ht=1,op(e,Dn(a,e.current)),Xe=null;return}}catch(o){if(r!==null)throw Xe=r,o;Ht=1,op(e,Dn(a,e.current)),Xe=null;return}t.flags&32768?(Ze||n===1?e=!0:ml||(Ke&536870912)!==0?e=!1:(bo=e=!0,(n===2||n===9||n===3||n===6)&&(n=gn.current,n!==null&&n.tag===13&&(n.flags|=16384))),DT(t,e)):_p(t)}function _p(e){var t=e;do{if((t.flags&32768)!==0){DT(t,bo);return}e=t.return;var a=gF(t.alternate,t,Wr);if(a!==null){Xe=a;return}if(t=t.sibling,t!==null){Xe=t;return}Xe=t=e}while(t!==null);Ht===0&&(Ht=5)}function DT(e,t){do{var a=yF(e.alternate,e);if(a!==null){a.flags&=32767,Xe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Xe=e;return}Xe=e=a}while(e!==null);Ht=6,Xe=null}function W0(e,t,a,n,r,o,i,s,l){e.cancelPendingCommit=null;do Pp();while(oa!==0);if((st&6)!==0)throw Error(z(327));if(t!==null){if(t===e.current)throw Error(z(177));if(o=t.lanes|t.childLanes,o|=tw,rz(e,a,o,i,s,l),e===xt&&(Xe=xt=null,Ke=0),il=t,Ao=e,qr=a,Ay=o,My=r,CT=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,AF(Xf,function(){return UT(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=Te.T,Te.T=null,r=lt.p,lt.p=2,i=st,st|=4;try{wF(e,t,a)}finally{st=i,lt.p=r,Te.T=n}}oa=1,_T(),PT(),OT()}}function _T(){if(oa===1){oa=0;var e=Ao,t=il,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=Te.T,Te.T=null;var n=lt.p;lt.p=2;var r=st;st|=4;try{gT(t,e);var o=Oy,i=ZC(e.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&YC(s.ownerDocument.documentElement,s)){if(l!==null&&ew(s)){var u=l.start,c=l.end;if(c===void 0&&(c=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(c,s.value.length);else{var d=s.ownerDocument||document,p=d&&d.defaultView||window;if(p.getSelection){var m=p.getSelection(),h=s.textContent.length,v=Math.min(l.start,h),I=l.end===void 0?v:Math.min(l.end,h);!m.extend&&v>I&&(i=I,I=v,v=i);var y=m0(s,v),w=m0(s,I);if(y&&w&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var g=d.createRange();g.setStart(y.node,y.offset),m.removeAllRanges(),v>I?(m.addRange(g),m.extend(w.node,w.offset)):(g.setEnd(w.node,w.offset),m.addRange(g))}}}}for(d=[],m=s;m=m.parentNode;)m.nodeType===1&&d.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<d.length;s++){var S=d[s];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}wp=!!Py,Oy=Py=null}finally{st=r,lt.p=n,Te.T=a}}e.current=t,oa=2}}function PT(){if(oa===2){oa=0;var e=Ao,t=il,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=Te.T,Te.T=null;var n=lt.p;lt.p=2;var r=st;st|=4;try{dT(e,t.alternate,t)}finally{st=r,lt.p=n,Te.T=a}}oa=3}}function OT(){if(oa===4||oa===3){oa=0,K3();var e=Ao,t=il,a=qr,n=CT;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?oa=5:(oa=0,il=Ao=null,NT(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Eo=null),Gy(a),t=t.stateNode,fn&&typeof fn.onCommitFiberRoot=="function")try{fn.onCommitFiberRoot(cc,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=Te.T,r=lt.p,lt.p=2,Te.T=null;try{for(var o=e.onRecoverableError,i=0;i<n.length;i++){var s=n[i];o(s.value,{componentStack:s.stack})}}finally{Te.T=t,lt.p=r}}(qr&3)!==0&&Pp(),mr(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===Ry?Gu++:(Gu=0,Ry=e):Gu=0,wc(0,!1)}}function NT(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,hc(t)))}function Pp(){return _T(),PT(),OT(),UT()}function UT(){if(oa!==5)return!1;var e=Ao,t=Ay;Ay=0;var a=Gy(qr),n=Te.T,r=lt.p;try{lt.p=32>a?32:a,Te.T=null,a=My,My=null;var o=Ao,i=qr;if(oa=0,il=Ao=null,qr=0,(st&6)!==0)throw Error(z(331));var s=st;if(st|=4,bT(o.current),wT(o,o.current,i,a),st=s,wc(0,!1),fn&&typeof fn.onPostCommitFiberRoot=="function")try{fn.onPostCommitFiberRoot(cc,o)}catch{}return!0}finally{lt.p=r,Te.T=n,NT(e,t)}}function G0(e,t,a){t=Dn(a,t),t=Cy(e.stateNode,t,2),e=Lo(e,t,2),e!==null&&(fc(e,2),mr(e))}function ft(e,t,a){if(e.tag===3)G0(e,e,a);else for(;t!==null;){if(t.tag===3){G0(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Eo===null||!Eo.has(n))){e=Dn(a,e),a=Jk(2),n=Lo(t,a,2),n!==null&&(Qk(a,n,t,e),fc(n,2),mr(n));break}}t=t.return}}function Hg(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new bF;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)||(Ew=!0,r.add(a),e=TF.bind(null,e,t,a),t.then(e,e))}function TF(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,xt===e&&(Ke&a)===a&&(Ht===4||Ht===3&&(Ke&62914560)===Ke&&300>dn()-Rp?(st&2)===0&&sl(e,0):Aw|=a,ol===Ke&&(ol=0)),mr(e)}function BT(e,t){t===0&&(t=AC()),e=Mi(e,t),e!==null&&(fc(e,t),mr(e))}function LF(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),BT(e,a)}function EF(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(z(314))}n!==null&&n.delete(t),BT(e,a)}function AF(e,t){return $y(e,t)}var dp=null,_s=null,Dy=!1,fp=!1,jg=!1,Io=0;function mr(e){e!==_s&&e.next===null&&(_s===null?dp=_s=e:_s=_s.next=e),fp=!0,Dy||(Dy=!0,RF())}function wc(e,t){if(!jg&&fp){jg=!0;do for(var a=!1,n=dp;n!==null;){if(!t)if(e!==0){var r=n.pendingLanes;if(r===0)var o=0;else{var i=n.suspendedLanes,s=n.pingedLanes;o=(1<<31-pn(42|e)+1)-1,o&=r&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,X0(n,o))}else o=Ke,o=xp(n,n===xt?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||dc(n,o)||(a=!0,X0(n,o));n=n.next}while(a);jg=!1}}function MF(){zT()}function zT(){fp=Dy=!1;var e=0;Io!==0&&zF()&&(e=Io);for(var t=dn(),a=null,n=dp;n!==null;){var r=n.next,o=FT(n,t);o===0?(n.next=null,a===null?dp=r:a.next=r,r===null&&(_s=a)):(a=n,(e!==0||(o&3)!==0)&&(fp=!0)),n=r}oa!==0&&oa!==5||wc(e,!1),Io!==0&&(Io=0)}function FT(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var i=31-pn(o),s=1<<i,l=r[i];l===-1?((s&a)===0||(s&n)!==0)&&(r[i]=nz(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}if(t=xt,a=Ke,a=xp(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(dt===2||dt===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&wg(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||dc(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&wg(n),Gy(a)){case 2:case 8:a=LC;break;case 32:a=Xf;break;case 268435456:a=EC;break;default:a=Xf}return n=qT.bind(null,e),a=$y(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&wg(n),e.callbackPriority=2,e.callbackNode=null,2}function qT(e,t){if(oa!==0&&oa!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Pp()&&e.callbackNode!==a)return null;var n=Ke;return n=xp(e,e===xt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(TT(e,n,t),FT(e,dn()),e.callbackNode!=null&&e.callbackNode===a?qT.bind(null,e):null)}function X0(e,t){if(Pp())return null;TT(e,t,!0)}function RF(){qF(function(){(st&6)!==0?$y(TC,MF):zT()})}function Rw(){if(Io===0){var e=al;e===0&&(e=pf,pf<<=1,(pf&261888)===0&&(pf=256)),Io=e}return Io}function K0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Rf(""+e)}function Y0(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 DF(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var o=K0((r[Ka]||null).action),i=n.submitter;i&&(t=(t=i[Ka]||null)?K0(t.formAction):i.getAttribute("formAction"),t!==null&&(o=t,i=null));var s=new bp("action","action",null,n,r);e.push({event:s,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Io!==0){var l=i?Y0(r,i):new FormData(r);Sy(a,{pending:!0,data:l,method:r.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?Y0(r,i):new FormData(r),Sy(a,{pending:!0,data:l,method:r.method,action:o},o,l))},currentTarget:r}]})}}for(kf=0;kf<cy.length;kf++)Tf=cy[kf],Z0=Tf.toLowerCase(),J0=Tf[0].toUpperCase()+Tf.slice(1),Xn(Z0,"on"+J0);var Tf,Z0,J0,kf;Xn(QC,"onAnimationEnd");Xn(ek,"onAnimationIteration");Xn(tk,"onAnimationStart");Xn("dblclick","onDoubleClick");Xn("focusin","onFocus");Xn("focusout","onBlur");Xn(Yz,"onTransitionRun");Xn(Zz,"onTransitionStart");Xn(Jz,"onTransitionCancel");Xn(ak,"onTransitionEnd");el("onMouseEnter",["mouseout","mouseover"]);el("onMouseLeave",["mouseout","mouseover"]);el("onPointerEnter",["pointerout","pointerover"]);el("onPointerLeave",["pointerout","pointerover"]);Li("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Li("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Li("onBeforeInput",["compositionend","keypress","textInput","paste"]);Li("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Li("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Li("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rc="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(" "),_F=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rc));function HT(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 s=n[i],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=u;try{o(r)}catch(c){Yf(c)}r.currentTarget=null,o=l}else for(i=0;i<n.length;i++){if(s=n[i],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=u;try{o(r)}catch(c){Yf(c)}r.currentTarget=null,o=l}}}}function Ge(e,t){var a=t[ay];a===void 0&&(a=t[ay]=new Set);var n=e+"__bubble";a.has(n)||(jT(t,e,2,!1),a.add(n))}function Vg(e,t,a){var n=0;t&&(n|=4),jT(a,e,n,t)}var Lf="_reactListening"+Math.random().toString(36).slice(2);function Dw(e){if(!e[Lf]){e[Lf]=!0,PC.forEach(function(a){a!=="selectionchange"&&(_F.has(a)||Vg(a,!1,e),Vg(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Lf]||(t[Lf]=!0,Vg("selectionchange",!1,t))}}function jT(e,t,a,n){switch(a1(t)){case 2:var r=sq;break;case 8:r=lq;break;default:r=Nw}a=r.bind(null,t,a,e),r=void 0,!sy||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 $g(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 s=n.stateNode.containerInfo;if(s===r)break;if(i===4)for(i=n.return;i!==null;){var l=i.tag;if((l===3||l===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;s!==null;){if(i=Ns(s),i===null)return;if(l=i.tag,l===5||l===6||l===26||l===27){n=o=i;continue e}s=s.parentNode}}n=n.return}HC(function(){var u=o,c=Yy(a),d=[];e:{var p=nk.get(e);if(p!==void 0){var m=bp,h=e;switch(e){case"keypress":if(_f(a)===0)break e;case"keydown":case"keyup":m=Ez;break;case"focusin":h="focus",m=Ig;break;case"focusout":h="blur",m=Ig;break;case"beforeblur":case"afterblur":m=Ig;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":m=o0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=gz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Rz;break;case QC:case ek:case tk:m=vz;break;case ak:m=_z;break;case"scroll":case"scrollend":m=mz;break;case"wheel":m=Oz;break;case"copy":case"cut":case"paste":m=bz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=s0;break;case"toggle":case"beforetoggle":m=Uz}var v=(t&4)!==0,I=!v&&(e==="scroll"||e==="scrollend"),y=v?p!==null?p+"Capture":null:p;v=[];for(var w=u,g;w!==null;){var S=w;if(g=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||g===null||y===null||(S=Yu(w,y),S!=null&&v.push(oc(w,S,g))),I)break;w=w.return}0<v.length&&(p=new m(p,h,null,a,c),d.push({event:p,listeners:v}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&a!==iy&&(h=a.relatedTarget||a.fromElement)&&(Ns(h)||h[cl]))break e;if((m||p)&&(p=c.window===c?c:(p=c.ownerDocument)?p.defaultView||p.parentWindow:window,m?(h=a.relatedTarget||a.toElement,m=u,h=h?Ns(h):null,h!==null&&(I=uc(h),v=h.tag,h!==I||v!==5&&v!==27&&v!==6)&&(h=null)):(m=null,h=u),m!==h)){if(v=o0,S="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(v=s0,S="onPointerLeave",y="onPointerEnter",w="pointer"),I=m==null?p:_u(m),g=h==null?p:_u(h),p=new v(S,w+"leave",m,a,c),p.target=I,p.relatedTarget=g,S=null,Ns(c)===u&&(v=new v(y,w+"enter",h,a,c),v.target=g,v.relatedTarget=I,S=v),I=S,m&&h)t:{for(v=PF,y=m,w=h,g=0,S=y;S;S=v(S))g++;S=0;for(var E=w;E;E=v(E))S++;for(;0<g-S;)y=v(y),g--;for(;0<S-g;)w=v(w),S--;for(;g--;){if(y===w||w!==null&&y===w.alternate){v=y;break t}y=v(y),w=v(w)}v=null}else v=null;m!==null&&Q0(d,p,m,v,!1),h!==null&&I!==null&&Q0(d,I,h,v,!0)}}e:{if(p=u?_u(u):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var T=d0;else if(c0(p))if(XC)T=Gz;else{T=$z;var R=Vz}else m=p.nodeName,!m||m.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?u&&Ky(u.elementType)&&(T=d0):T=Wz;if(T&&(T=T(e,u))){GC(d,T,a,c);break e}R&&R(e,p,u),e==="focusout"&&u&&p.type==="number"&&u.memoizedProps.value!=null&&oy(p,"number",p.value)}switch(R=u?_u(u):window,e){case"focusin":(c0(R)||R.contentEditable==="true")&&(zs=R,ly=u,Bu=null);break;case"focusout":Bu=ly=zs=null;break;case"mousedown":uy=!0;break;case"contextmenu":case"mouseup":case"dragend":uy=!1,h0(d,a,c);break;case"selectionchange":if(Kz)break;case"keydown":case"keyup":h0(d,a,c)}var O;if(Qy)e:{switch(e){case"compositionstart":var U="onCompositionStart";break e;case"compositionend":U="onCompositionEnd";break e;case"compositionupdate":U="onCompositionUpdate";break e}U=void 0}else Bs?$C(e,a)&&(U="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(U="onCompositionStart");U&&(VC&&a.locale!=="ko"&&(Bs||U!=="onCompositionStart"?U==="onCompositionEnd"&&Bs&&(O=jC()):(xo=c,Zy="value"in xo?xo.value:xo.textContent,Bs=!0)),R=pp(u,U),0<R.length&&(U=new i0(U,e,null,a,c),d.push({event:U,listeners:R}),O?U.data=O:(O=WC(a),O!==null&&(U.data=O)))),(O=zz?Fz(e,a):qz(e,a))&&(U=pp(u,"onBeforeInput"),0<U.length&&(R=new i0("onBeforeInput","beforeinput",null,a,c),d.push({event:R,listeners:U}),R.data=O)),DF(d,e,u,a,c)}HT(d,t)})}function oc(e,t,a){return{instance:e,listener:t,currentTarget:a}}function pp(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=Yu(e,a),r!=null&&n.unshift(oc(e,r,o)),r=Yu(e,t),r!=null&&n.push(oc(e,r,o))),e.tag===3)return n;e=e.return}return[]}function PF(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Q0(e,t,a,n,r){for(var o=t._reactName,i=[];a!==null&&a!==n;){var s=a,l=s.alternate,u=s.stateNode;if(s=s.tag,l!==null&&l===n)break;s!==5&&s!==26&&s!==27||u===null||(l=u,r?(u=Yu(a,o),u!=null&&i.unshift(oc(a,u,l))):r||(u=Yu(a,o),u!=null&&i.push(oc(a,u,l)))),a=a.return}i.length!==0&&e.push({event:t,listeners:i})}var OF=/\r\n?/g,NF=/\u0000|\uFFFD/g;function eC(e){return(typeof e=="string"?e:""+e).replace(OF,`
|
|
9
|
-
`).replace(NF,"")}function VT(e,t){return t=eC(t),eC(e)===t}function yt(e,t,a,n,r,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||tl(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&tl(e,""+n);break;case"className":gf(e,"class",n);break;case"tabIndex":gf(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":gf(e,a,n);break;case"style":qC(e,n,o);break;case"data":if(t!=="object"){gf(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=Rf(""+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"&&yt(e,t,"name",r.name,r,null),yt(e,t,"formEncType",r.formEncType,r,null),yt(e,t,"formMethod",r.formMethod,r,null),yt(e,t,"formTarget",r.formTarget,r,null)):(yt(e,t,"encType",r.encType,r,null),yt(e,t,"method",r.method,r,null),yt(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Rf(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Ur);break;case"onScroll":n!=null&&Ge("scroll",e);break;case"onScrollEnd":n!=null&&Ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(z(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(z(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=Rf(""+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":Ge("beforetoggle",e),Ge("toggle",e),Mf(e,"popover",n);break;case"xlinkActuate":Ar(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Ar(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Ar(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Ar(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Ar(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Ar(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Ar(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Ar(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Ar(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Mf(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=fz.get(a)||a,Mf(e,a,n))}}function _y(e,t,a,n,r,o){switch(a){case"style":qC(e,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(z(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(z(60));e.innerHTML=a}}break;case"children":typeof n=="string"?tl(e,n):(typeof n=="number"||typeof n=="bigint")&&tl(e,""+n);break;case"onScroll":n!=null&&Ge("scroll",e);break;case"onScrollEnd":n!=null&&Ge("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Ur);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!OC.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[Ka]||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,""):Mf(e,a,n)}}}function xa(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",e),Ge("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(z(137,t));default:yt(e,t,o,i,a,null)}}r&&yt(e,t,"srcSet",a.srcSet,a,null),n&&yt(e,t,"src",a.src,a,null);return;case"input":Ge("invalid",e);var s=o=i=r=null,l=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":l=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":s=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(z(137,t));break;default:yt(e,t,n,c,a,null)}}BC(e,o,s,l,u,i,r,!1);return;case"select":Ge("invalid",e),n=i=o=null;for(r in a)if(a.hasOwnProperty(r)&&(s=a[r],s!=null))switch(r){case"value":o=s;break;case"defaultValue":i=s;break;case"multiple":n=s;default:yt(e,t,r,s,a,null)}t=o,a=i,e.multiple=!!n,t!=null?Gs(e,!!n,t,!1):a!=null&&Gs(e,!!n,a,!0);return;case"textarea":Ge("invalid",e),o=r=n=null;for(i in a)if(a.hasOwnProperty(i)&&(s=a[i],s!=null))switch(i){case"value":n=s;break;case"defaultValue":r=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(z(91));break;default:yt(e,t,i,s,a,null)}FC(e,n,r,o);return;case"option":for(l in a)a.hasOwnProperty(l)&&(n=a[l],n!=null)&&(l==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":yt(e,t,l,n,a,null));return;case"dialog":Ge("beforetoggle",e),Ge("toggle",e),Ge("cancel",e),Ge("close",e);break;case"iframe":case"object":Ge("load",e);break;case"video":case"audio":for(n=0;n<rc.length;n++)Ge(rc[n],e);break;case"image":Ge("error",e),Ge("load",e);break;case"details":Ge("toggle",e);break;case"embed":case"source":case"link":Ge("error",e),Ge("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(z(137,t));default:yt(e,t,u,n,a,null)}return;default:if(Ky(t)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&_y(e,t,c,n,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(n=a[s],n!=null&&yt(e,t,s,n,a,null))}function UF(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,s=null,l=null,u=null,c=null;for(m in a){var d=a[m];if(a.hasOwnProperty(m)&&d!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":l=d;default:n.hasOwnProperty(m)||yt(e,t,m,null,n,d)}}for(var p in n){var m=n[p];if(d=a[p],n.hasOwnProperty(p)&&(m!=null||d!=null))switch(p){case"type":o=m;break;case"name":r=m;break;case"checked":u=m;break;case"defaultChecked":c=m;break;case"value":i=m;break;case"defaultValue":s=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(z(137,t));break;default:m!==d&&yt(e,t,p,m,n,d)}}ry(e,i,s,l,u,c,o,r);return;case"select":m=i=s=p=null;for(o in a)if(l=a[o],a.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":m=l;default:n.hasOwnProperty(o)||yt(e,t,o,null,n,l)}for(r in n)if(o=n[r],l=a[r],n.hasOwnProperty(r)&&(o!=null||l!=null))switch(r){case"value":p=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&&yt(e,t,r,o,n,l)}t=s,a=i,n=m,p!=null?Gs(e,!!a,p,!1):!!n!=!!a&&(t!=null?Gs(e,!!a,t,!0):Gs(e,!!a,a?[]:"",!1));return;case"textarea":m=p=null;for(s in a)if(r=a[s],a.hasOwnProperty(s)&&r!=null&&!n.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:yt(e,t,s,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":p=r;break;case"defaultValue":m=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(z(91));break;default:r!==o&&yt(e,t,i,r,n,o)}zC(e,p,m);return;case"option":for(var h in a)p=a[h],a.hasOwnProperty(h)&&p!=null&&!n.hasOwnProperty(h)&&(h==="selected"?e.selected=!1:yt(e,t,h,null,n,p));for(l in n)p=n[l],m=a[l],n.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null)&&(l==="selected"?e.selected=p&&typeof p!="function"&&typeof p!="symbol":yt(e,t,l,p,n,m));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 v in a)p=a[v],a.hasOwnProperty(v)&&p!=null&&!n.hasOwnProperty(v)&&yt(e,t,v,null,n,p);for(u in n)if(p=n[u],m=a[u],n.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(z(137,t));break;default:yt(e,t,u,p,n,m)}return;default:if(Ky(t)){for(var I in a)p=a[I],a.hasOwnProperty(I)&&p!==void 0&&!n.hasOwnProperty(I)&&_y(e,t,I,void 0,n,p);for(c in n)p=n[c],m=a[c],!n.hasOwnProperty(c)||p===m||p===void 0&&m===void 0||_y(e,t,c,p,n,m);return}}for(var y in a)p=a[y],a.hasOwnProperty(y)&&p!=null&&!n.hasOwnProperty(y)&&yt(e,t,y,null,n,p);for(d in n)p=n[d],m=a[d],!n.hasOwnProperty(d)||p===m||p==null&&m==null||yt(e,t,d,p,n,m)}function tC(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function BF(){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,s=r.duration;if(o&&s&&tC(i)){for(i=0,s=r.responseEnd,n+=1;n<a.length;n++){var l=a[n],u=l.startTime;if(u>s)break;var c=l.transferSize,d=l.initiatorType;c&&tC(d)&&(l=l.responseEnd,i+=c*(l<s?1:(s-u)/(l-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 Py=null,Oy=null;function mp(e){return e.nodeType===9?e:e.ownerDocument}function aC(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 $T(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 Ny(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 Wg=null;function zF(){var e=window.event;return e&&e.type==="popstate"?e===Wg?!1:(Wg=e,!0):(Wg=null,!1)}var WT=typeof setTimeout=="function"?setTimeout:void 0,FF=typeof clearTimeout=="function"?clearTimeout:void 0,nC=typeof Promise=="function"?Promise:void 0,qF=typeof queueMicrotask=="function"?queueMicrotask:typeof nC<"u"?function(e){return nC.resolve(null).then(e).catch(HF)}:WT;function HF(e){setTimeout(function(){throw e})}function Bo(e){return e==="head"}function rC(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),ul(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Xu(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Xu(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[pc]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&Xu(e.ownerDocument.body);a=r}while(a);ul(t)}function oC(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 Uy(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":Uy(a),Xy(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function jF(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[pc])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=On(e.nextSibling),e===null)break}return null}function VF(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=On(e.nextSibling),e===null))return null;return e}function GT(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=On(e.nextSibling),e===null))return null;return e}function By(e){return e.data==="$?"||e.data==="$~"}function zy(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $F(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 On(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 Fy=null;function iC(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return On(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function sC(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 XT(e,t,a){switch(t=mp(a),e){case"html":if(e=t.documentElement,!e)throw Error(z(452));return e;case"head":if(e=t.head,!e)throw Error(z(453));return e;case"body":if(e=t.body,!e)throw Error(z(454));return e;default:throw Error(z(451))}}function Xu(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Xy(e)}var Nn=new Map,lC=new Set;function hp(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Gr=lt.d;lt.d={f:WF,r:GF,D:XF,C:KF,L:YF,m:ZF,X:QF,S:JF,M:eq};function WF(){var e=Gr.f(),t=Dp();return e||t}function GF(e){var t=dl(e);t!==null&&t.tag===5&&t.type==="form"?qk(t):Gr.r(e)}var hl=typeof document>"u"?null:document;function KT(e,t,a){var n=hl;if(n&&typeof t=="string"&&t){var r=Rn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),lC.has(r)||(lC.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),xa(t,"link",e),ca(t),n.head.appendChild(t)))}}function XF(e){Gr.D(e),KT("dns-prefetch",e,null)}function KF(e,t){Gr.C(e,t),KT("preconnect",e,t)}function YF(e,t,a){Gr.L(e,t,a);var n=hl;if(n&&e&&t){var r='link[rel="preload"][as="'+Rn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+Rn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+Rn(a.imageSizes)+'"]')):r+='[href="'+Rn(e)+'"]';var o=r;switch(t){case"style":o=ll(e);break;case"script":o=gl(e)}Nn.has(o)||(e=Et({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Nn.set(o,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(vc(o))||t==="script"&&n.querySelector(xc(o))||(t=n.createElement("link"),xa(t,"link",e),ca(t),n.head.appendChild(t)))}}function ZF(e,t){Gr.m(e,t);var a=hl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Rn(n)+'"][href="'+Rn(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=gl(e)}if(!Nn.has(o)&&(e=Et({rel:"modulepreload",href:e},t),Nn.set(o,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(xc(o)))return}n=a.createElement("link"),xa(n,"link",e),ca(n),a.head.appendChild(n)}}}function JF(e,t,a){Gr.S(e,t,a);var n=hl;if(n&&e){var r=Ws(n).hoistableStyles,o=ll(e);t=t||"default";var i=r.get(o);if(!i){var s={loading:0,preload:null};if(i=n.querySelector(vc(o)))s.loading=5;else{e=Et({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Nn.get(o))&&_w(e,a);var l=i=n.createElement("link");ca(l),xa(l,"link",e),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,qf(i,t,n)}i={type:"stylesheet",instance:i,count:1,state:s},r.set(o,i)}}}function QF(e,t){Gr.X(e,t);var a=hl;if(a&&e){var n=Ws(a).hoistableScripts,r=gl(e),o=n.get(r);o||(o=a.querySelector(xc(r)),o||(e=Et({src:e,async:!0},t),(t=Nn.get(r))&&Pw(e,t),o=a.createElement("script"),ca(o),xa(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function eq(e,t){Gr.M(e,t);var a=hl;if(a&&e){var n=Ws(a).hoistableScripts,r=gl(e),o=n.get(r);o||(o=a.querySelector(xc(r)),o||(e=Et({src:e,async:!0,type:"module"},t),(t=Nn.get(r))&&Pw(e,t),o=a.createElement("script"),ca(o),xa(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function uC(e,t,a,n){var r=(r=Co.current)?hp(r):null;if(!r)throw Error(z(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=ll(a.href),a=Ws(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=ll(a.href);var o=Ws(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(vc(e)))&&!o._p&&(i.instance=o,i.state.loading=5),Nn.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},Nn.set(e,a),o||tq(r,e,a,i.state))),t&&n===null)throw Error(z(528,""));return i}if(t&&n!==null)throw Error(z(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=gl(a),a=Ws(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(z(444,e))}}function ll(e){return'href="'+Rn(e)+'"'}function vc(e){return'link[rel="stylesheet"]['+e+"]"}function YT(e){return Et({},e,{"data-precedence":e.precedence,precedence:null})}function tq(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}),xa(t,"link",a),ca(t),e.head.appendChild(t))}function gl(e){return'[src="'+Rn(e)+'"]'}function xc(e){return"script[async]"+e}function cC(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Rn(a.href)+'"]');if(n)return t.instance=n,ca(n),n;var r=Et({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ca(n),xa(n,"style",r),qf(n,a.precedence,e),t.instance=n;case"stylesheet":r=ll(a.href);var o=e.querySelector(vc(r));if(o)return t.state.loading|=4,t.instance=o,ca(o),o;n=YT(a),(r=Nn.get(r))&&_w(n,r),o=(e.ownerDocument||e).createElement("link"),ca(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),xa(o,"link",n),t.state.loading|=4,qf(o,a.precedence,e),t.instance=o;case"script":return o=gl(a.src),(r=e.querySelector(xc(o)))?(t.instance=r,ca(r),r):(n=a,(r=Nn.get(o))&&(n=Et({},a),Pw(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),ca(r),xa(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(z(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,qf(n,a.precedence,e));return t.instance}function qf(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 s=n[i];if(s.dataset.precedence===t)o=s;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 _w(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Pw(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Hf=null;function dC(e,t,a){if(Hf===null){var n=new Map,r=Hf=new Map;r.set(a,n)}else r=Hf,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[pc]||o[ya]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(t)||"";i=e+i;var s=n.get(i);s?s.push(o):n.set(i,[o])}}return n}function fC(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function aq(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 ZT(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function nq(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=ll(n.href),o=t.querySelector(vc(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=gp.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,ca(o);return}o=t.ownerDocument||t,n=YT(n),(r=Nn.get(r))&&_w(n,r),o=o.createElement("link"),ca(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),xa(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=gp.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Gg=0;function rq(e,t){return e.stylesheets&&e.count===0&&jf(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&jf(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Gg===0&&(Gg=62500*BF());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jf(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Gg?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function gp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var yp=null;function jf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yp=new Map,t.forEach(oq,e),yp=null,gp.call(e))}function oq(e,t){if(!(t.state.loading&4)){var a=yp.get(e);if(a)var n=a.get(null);else{a=new Map,yp.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=gp.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 ic={$$typeof:Nr,Provider:null,Consumer:null,_currentValue:yi,_currentValue2:yi,_threadCount:0};function iq(e,t,a,n,r,o,i,s,l){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=vg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vg(0),this.hiddenUpdates=vg(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function JT(e,t,a,n,r,o,i,s,l,u,c,d){return e=new iq(e,t,a,i,l,u,c,d,s),t=1,o===!0&&(t|=24),o=un(3,null,null,t),e.current=o,o.stateNode=e,t=iw(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},uw(o),e}function QT(e){return e?(e=Hs,e):Hs}function e1(e,t,a,n,r,o){r=QT(r),n.context===null?n.context=r:n.pendingContext=r,n=To(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=Lo(e,n,t),a!==null&&(Xa(a,e,t),Fu(a,e,t))}function pC(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ow(e,t){pC(e,t),(e=e.alternate)&&pC(e,t)}function t1(e){if(e.tag===13||e.tag===31){var t=Mi(e,67108864);t!==null&&Xa(t,e,67108864),Ow(e,67108864)}}function mC(e){if(e.tag===13||e.tag===31){var t=mn();t=Wy(t);var a=Mi(e,t);a!==null&&Xa(a,e,t),Ow(e,t)}}var wp=!0;function sq(e,t,a,n){var r=Te.T;Te.T=null;var o=lt.p;try{lt.p=2,Nw(e,t,a,n)}finally{lt.p=o,Te.T=r}}function lq(e,t,a,n){var r=Te.T;Te.T=null;var o=lt.p;try{lt.p=8,Nw(e,t,a,n)}finally{lt.p=o,Te.T=r}}function Nw(e,t,a,n){if(wp){var r=qy(n);if(r===null)$g(e,t,n,vp,a),hC(e,n);else if(cq(r,e,t,a,n))n.stopPropagation();else if(hC(e,n),t&4&&-1<uq.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 i=mi(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-pn(i);s.entanglements[1]|=l,i&=~l}mr(o),(st&6)===0&&(lp=dn()+500,wc(0,!1))}}break;case 31:case 13:s=Mi(o,2),s!==null&&Xa(s,o,2),Dp(),Ow(o,2)}if(o=qy(n),o===null&&$g(e,t,n,vp,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else $g(e,t,n,null,a)}}function qy(e){return e=Yy(e),Uw(e)}var vp=null;function Uw(e){if(vp=null,e=Ns(e),e!==null){var t=uc(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=bC(t),e!==null)return e;e=null}else if(a===31){if(e=SC(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 vp=e,null}function a1(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(Y3()){case TC:return 2;case LC:return 8;case Xf:case Z3:return 32;case EC:return 268435456;default:return 32}default:return 32}}var Hy=!1,Mo=null,Ro=null,Do=null,sc=new Map,lc=new Map,wo=[],uq="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 hC(e,t){switch(e){case"focusin":case"focusout":Mo=null;break;case"dragenter":case"dragleave":Ro=null;break;case"mouseover":case"mouseout":Do=null;break;case"pointerover":case"pointerout":sc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":lc.delete(t.pointerId)}}function Au(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&&t1(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function cq(e,t,a,n,r){switch(t){case"focusin":return Mo=Au(Mo,e,t,a,n,r),!0;case"dragenter":return Ro=Au(Ro,e,t,a,n,r),!0;case"mouseover":return Do=Au(Do,e,t,a,n,r),!0;case"pointerover":var o=r.pointerId;return sc.set(o,Au(sc.get(o)||null,e,t,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,lc.set(o,Au(lc.get(o)||null,e,t,a,n,r)),!0}return!1}function n1(e){var t=Ns(e.target);if(t!==null){var a=uc(t);if(a!==null){if(t=a.tag,t===13){if(t=bC(a),t!==null){e.blockedOn=t,JI(e.priority,function(){mC(a)});return}}else if(t===31){if(t=SC(a),t!==null){e.blockedOn=t,JI(e.priority,function(){mC(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 Vf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=qy(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);iy=n,a.target.dispatchEvent(n),iy=null}else return t=dl(a),t!==null&&t1(t),e.blockedOn=a,!1;t.shift()}return!0}function gC(e,t,a){Vf(e)&&a.delete(t)}function dq(){Hy=!1,Mo!==null&&Vf(Mo)&&(Mo=null),Ro!==null&&Vf(Ro)&&(Ro=null),Do!==null&&Vf(Do)&&(Do=null),sc.forEach(gC),lc.forEach(gC)}function Ef(e,t){e.blockedOn===t&&(e.blockedOn=null,Hy||(Hy=!0,ia.unstable_scheduleCallback(ia.unstable_NormalPriority,dq)))}var Af=null;function yC(e){Af!==e&&(Af=e,ia.unstable_scheduleCallback(ia.unstable_NormalPriority,function(){Af===e&&(Af=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(Uw(n||a)===null)continue;break}var o=dl(a);o!==null&&(e.splice(t,3),t-=3,Sy(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function ul(e){function t(l){return Ef(l,e)}Mo!==null&&Ef(Mo,e),Ro!==null&&Ef(Ro,e),Do!==null&&Ef(Do,e),sc.forEach(t),lc.forEach(t);for(var a=0;a<wo.length;a++){var n=wo[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<wo.length&&(a=wo[0],a.blockedOn===null);)n1(a),a.blockedOn===null&&wo.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[Ka]||null;if(typeof o=="function")i||yC(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[Ka]||null)s=i.formAction;else if(Uw(r)!==null)continue}else s=i.action;typeof s=="function"?a[n+1]=s:(a.splice(n,3),n-=3),yC(a)}}}function r1(){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 Bw(e){this._internalRoot=e}Op.prototype.render=Bw.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(z(409));var a=t.current,n=mn();e1(a,n,e,t,null,null)};Op.prototype.unmount=Bw.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;e1(e.current,2,null,e,null,null),Dp(),t[cl]=null}};function Op(e){this._internalRoot=e}Op.prototype.unstable_scheduleHydration=function(e){if(e){var t=_C();e={blockedOn:null,target:e,priority:t};for(var a=0;a<wo.length&&t!==0&&t<wo[a].priority;a++);wo.splice(a,0,e),a===0&&n1(e)}};var wC=vC.version;if(wC!=="19.2.4")throw Error(z(527,wC,"19.2.4"));lt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(z(188)):(e=Object.keys(e).join(","),Error(z(268,e)));return e=j3(t),e=e!==null?IC(e):null,e=e===null?null:e.stateNode,e};var fq={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Te,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Mu=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Mu.isDisabled&&Mu.supportsFiber))try{cc=Mu.inject(fq),fn=Mu}catch{}var Mu;Np.createRoot=function(e,t){if(!xC(e))throw Error(z(299));var a=!1,n="",r=Kk,o=Yk,i=Zk;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=JT(e,1,!1,null,null,a,n,null,r,o,i,r1),e[cl]=t.current,Dw(e),new Bw(t)};Np.hydrateRoot=function(e,t,a){if(!xC(e))throw Error(z(299));var n=!1,r="",o=Kk,i=Yk,s=Zk,l=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&&(s=a.onRecoverableError),a.formState!==void 0&&(l=a.formState)),t=JT(e,1,!0,t,a??null,n,r,l,o,i,s,r1),t.context=QT(null),a=t.current,n=mn(),n=Wy(n),r=To(n),r.callback=null,Lo(a,r,n),a=n,t.current.lanes=a,fc(t,a),mr(t),e[cl]=t.current,Dw(e),new Op(t)};Np.version="19.2.4"});var zw=Ia((NZ,s1)=>{"use strict";function i1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i1)}catch(e){console.error(e)}}i1(),s1.exports=o1()});var N1=Ia(Gp=>{"use strict";var R4=Symbol.for("react.transitional.element"),D4=Symbol.for("react.fragment");function O1(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:R4,type:e,key:n,ref:t!==void 0?t:null,props:a}}Gp.Fragment=D4;Gp.jsx=O1;Gp.jsxs=O1});var he=Ia((OQ,U1)=>{"use strict";U1.exports=N1()});function B1(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=B1(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function Kp(){for(var e,t,a=0,n="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=B1(e))&&(n&&(n+=" "),n+=t);return n}var Qw=L(()=>{"use strict"});function ev(...e){return e.filter(Boolean).join(" ")}function z1(){return ev}var tv=L(()=>{"use strict"});function pV(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Zo(e[a]);return vm(n);function n(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function mV(e){let t=e;return vm(a);function a(n){let r=n,o;for(o in e)if(r[o]!==t[o])return!1;return!0}}function hV(e){return vm(t);function t(a){return a&&a.type===e}}function vm(e){return t;function t(a,n,r){return!!(yV(a)&&e.call(this,a,typeof n=="number"?n:void 0,r||void 0))}}function gV(){return!0}function yV(e){return e!==null&&typeof e=="object"&&"type"in e}var Zo,qM=L(()=>{"use strict";Zo=(function(e){if(e==null)return gV;if(typeof e=="function")return vm(e);if(typeof e=="object")return Array.isArray(e)?pV(e):mV(e);if(typeof e=="string")return hV(e);throw new Error("Expected function, string, or object as test")})});var xm=L(()=>{"use strict";qM()});function ud(e,t,a,n){let r;typeof t=="function"&&typeof a!="function"?(n=a,a=t):r=t;let o=Zo(r),i=n?-1:1;s(e,void 0,[])();function s(l,u,c){let d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){let m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=HM,h,v,I;if((!t||o(l,u,c[c.length-1]||void 0))&&(m=wV(a(l,c)),m[0]===ns))return m;if("children"in l&&l.children){let y=l;if(y.children&&m[0]!==rs)for(v=(n?y.children.length:-1)+i,I=c.concat(y);v>-1&&v<y.children.length;){let w=y.children[v];if(h=s(w,v,I)(),h[0]===ns)return h;v=typeof h[1]=="number"?h[1]:v+i}}return m}}}function wV(e){return Array.isArray(e)?e:typeof e=="number"?[eo,e]:e==null?HM:[e]}var HM,eo,ns,rs,jM=L(()=>{"use strict";xm();HM=[],eo=!0,ns=!1,rs="skip"});var bm=L(()=>{"use strict";jM()});function to(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),ud(e,o,s,r);function s(l,u){let c=u[u.length-1],d=c?c.children.indexOf(l):void 0;return i(l,d,c)}}var VM=L(()=>{"use strict";bm();bm()});var Sm=L(()=>{"use strict";VM()});function GM({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 s=t.length&&!t.every(u=>u==="*"),l=a.length&&!a.every(u=>u==="*");if(!e&&(s||l))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return u=>{let c=SV(e,t,a,n,r,o,i);to(u,c)}}function $M(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 vV(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function WM(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=$M(e,a);if(!i||bV.has(i.protocol)||!(xV.has(i.protocol)||o.includes(i.protocol)||o.includes("*")))return null;if(i.protocol==="mailto:"||!i.protocol.match(/^https?:$/))return i.href;let l=vV(e);return i&&t.some(u=>{let c=$M(u,a);return!c||c.origin!==i.origin?!1:i.href.startsWith(c.href)})?l?i.pathname+i.search+i.hash:i.href:t.includes("*")?i.protocol!=="https:"&&i.protocol!=="http:"?null:l?i.pathname+i.search+i.hash:i.href:null}var xV,bV,hx,SV,XM=L(()=>{"use strict";Sm();xV=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),bV=new Set(["javascript:","data:","file:","vbscript:"]);hx=Symbol("node-seen"),SV=(e,t,a,n,r,o,i)=>{let s=(l,u,c)=>{if(l.type!=="element"||l[hx])return eo;if(l.tagName==="a"){let d=WM(l.properties.href,t,e,!1,!1,r);return d===null?(l[hx]=!0,to(l,s),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(l.properties.href),class:i},children:[...l.children,{type:"text",value:" [blocked]"}]}),rs):(l.properties.href=d,l.properties.target="_blank",l.properties.rel="noopener noreferrer",eo)}if(l.tagName==="img"){let d=WM(l.properties.src,a,e,n,!0,r);return d===null?(l[hx]=!0,to(l,s),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{class:o},children:[{type:"text",value:"[Image blocked: "+String(l.properties.alt||"No description")+"]"}]}),rs):(l.properties.src=d,eo)}return eo};return s}});function IV(){return e=>e}var KM,YM=L(()=>{"use strict";KM=IV});var ZM,LV,wx,aR=L(()=>{"use strict";ZM=typeof self=="object"?self:globalThis,LV=(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 s=a([],r);for(let l of i)s.push(n(l));return s}case 2:{let s=a({},r);for(let[l,u]of i)s[n(l)]=n(u);return s}case 3:return a(new Date(i),r);case 4:{let{source:s,flags:l}=i;return a(new RegExp(s,l),r)}case 5:{let s=a(new Map,r);for(let[l,u]of i)s.set(n(l),n(u));return s}case 6:{let s=a(new Set,r);for(let l of i)s.add(n(l));return s}case 7:{let{name:s,message:l}=i;return a(new ZM[s](l),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:s}=new Uint8Array(i);return a(new DataView(s),i)}}return a(new ZM[o](i),r)};return n},wx=e=>LV(new Map,e)(0)});var $l,EV,AV,cd,Cm,MV,vx,nR=L(()=>{"use strict";$l="",{toString:EV}={},{keys:AV}=Object,cd=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=EV.call(e).slice(8,-1);switch(a){case"Array":return[1,$l];case"Object":return[2,$l];case"Date":return[3,$l];case"RegExp":return[4,$l];case"Map":return[5,$l];case"Set":return[6,$l];case"DataView":return[1,a]}return a.includes("Array")?[1,a]:a.includes("Error")?[7,a]:[2,a]},Cm=([e,t])=>e===0&&(t==="function"||t==="symbol"),MV=(e,t,a,n)=>{let r=(i,s)=>{let l=n.push(i)-1;return a.set(s,l),l},o=i=>{if(a.has(i))return a.get(i);let[s,l]=cd(i);switch(s){case 0:{let c=i;switch(l){case"bigint":s=8,c=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return r([-1],i)}return r([s,c],i)}case 1:{if(l){let p=i;return l==="DataView"?p=new Uint8Array(i.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(i)),r([l,[...p]],i)}let c=[],d=r([s,c],i);for(let p of i)c.push(o(p));return d}case 2:{if(l)switch(l){case"BigInt":return r([l,i.toString()],i);case"Boolean":case"Number":case"String":return r([l,i.valueOf()],i)}if(t&&"toJSON"in i)return o(i.toJSON());let c=[],d=r([s,c],i);for(let p of AV(i))(e||!Cm(cd(i[p])))&&c.push([o(p),o(i[p])]);return d}case 3:return r([s,i.toISOString()],i);case 4:{let{source:c,flags:d}=i;return r([s,{source:c,flags:d}],i)}case 5:{let c=[],d=r([s,c],i);for(let[p,m]of i)(e||!(Cm(cd(p))||Cm(cd(m))))&&c.push([o(p),o(m)]);return d}case 6:{let c=[],d=r([s,c],i);for(let p of i)(e||!Cm(cd(p)))&&c.push(o(p));return d}}let{message:u}=i;return r([s,{name:l,message:u}],i)};return o},vx=(e,{json:t,lossy:a}={})=>{let n=[];return MV(!(t||a),!!t,new Map,n)(e),n}});var Jo,km=L(()=>{"use strict";aR();nR();Jo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?wx(vx(e,t)):structuredClone(e):(e,t)=>wx(vx(e,t))});function rR(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 dd(e){let t=Wl(e),a=Tm(e);if(t&&a)return{start:t,end:a}}var Tm,Wl,oR=L(()=>{"use strict";Tm=rR("end"),Wl=rR("start")});var fd=L(()=>{"use strict";oR()});var os,xx,iR=L(()=>{"use strict";os=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],xx={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...os,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...os],h2:[["className","sr-only"]],img:[...os,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...os,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...os],table:[...os],ul:[...os,["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 bx(e,t){let a={type:"root",children:[]},n={schema:t?{...xx,...t}:xx,stack:[]},r=uR(n,e);return r&&(Array.isArray(r)?r.length===1?a=r[0]:a.children=r:a=r),a}function uR(e,t){if(t&&typeof t=="object"){let a=t;switch(typeof a.type=="string"?a.type:""){case"comment":return RV(e,a);case"doctype":return DV(e,a);case"element":return _V(e,a);case"root":return PV(e,a);case"text":return OV(e,a);default:}}}function RV(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 pd(o,t),o}}function DV(e,t){if(e.schema.allowDoctypes){let a={type:"doctype"};return pd(a,t),a}}function _V(e,t){let a=typeof t.tagName=="string"?t.tagName:"";e.stack.push(a);let n=cR(e,t.children),r=NV(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&&Qo.call(e.schema.ancestors,a))){let s=e.schema.ancestors[a],l=-1;for(o=!1;++l<s.length;)e.stack.includes(s[l])&&(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 pd(i,t),i}function PV(e,t){let n={type:"root",children:cR(e,t.children)};return pd(n,t),n}function OV(e,t){let n={type:"text",value:typeof t.value=="string"?t.value:""};return pd(n,t),n}function cR(e,t){let a=[];if(Array.isArray(t)){let n=t,r=-1;for(;++r<n.length;){let o=uR(e,n[r]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function NV(e,t){let a=e.stack[e.stack.length-1],n=e.schema.attributes,r=e.schema.required,o=n&&Qo.call(n,a)?n[a]:void 0,i=n&&Qo.call(n,"*")?n["*"]:void 0,s=t&&typeof t=="object"?t:{},l={},u;for(u in s)if(Qo.call(s,u)){let c=s[u],d=sR(e,lR(o,u),u,c);d==null&&(d=sR(e,lR(i,u),u,c)),d!=null&&(l[u]=d)}if(r&&Qo.call(r,a)){let c=r[a];for(u in c)Qo.call(c,u)&&!Qo.call(l,u)&&(l[u]=c[u])}return l}function sR(e,t,a,n){return t?Array.isArray(n)?UV(e,t,a,n):dR(e,t,a,n):void 0}function UV(e,t,a,n){let r=-1,o=[];for(;++r<n.length;){let i=dR(e,t,a,n[r]);(typeof i=="number"||typeof i=="string")&&o.push(i)}return o}function dR(e,t,a,n){if(!(typeof n!="boolean"&&typeof n!="number"&&typeof n!="string")&&BV(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 BV(e,t,a){let n=e.schema.protocols&&Qo.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("?"),s=r.indexOf("#"),l=r.indexOf("/");if(o<0||l>-1&&o>l||i>-1&&o>i||s>-1&&o>s)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 pd(e,t){let a=dd(t);t.data&&(e.data=Jo(t.data)),a&&(e.position=a)}function lR(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 Qo,fR=L(()=>{"use strict";km();fd();iR();Qo={}.hasOwnProperty});var pR=L(()=>{"use strict";fR()});function Lm(e){return function(t){return bx(t,e)}}var mR=L(()=>{"use strict";pR()});var hR=L(()=>{"use strict";mR()});function Sx(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 gR=L(()=>{"use strict"});function is(e){return e!==null&&(e<32||e===127)}function ne(e){return e!==null&&e<-2}function $e(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}function ei(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}var sa,jt,yR,md,wR,vR,ss,Cr,at=L(()=>{"use strict";sa=ei(/[A-Za-z]/),jt=ei(/[\dA-Za-z]/),yR=ei(/[#-'*+\--9=?A-Z^-~]/);md=ei(/\d/),wR=ei(/[\dA-Fa-f]/),vR=ei(/[!-/:-@[-`{-~]/);ss=ei(/\p{P}|\p{S}/u),Cr=ei(/\s/)});function Ix(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var xR=L(()=>{"use strict"});function Cx(e,t,a){let r=Zo((a||{}).ignore||[]),o=zV(t),i=-1;for(;++i<o.length;)ud(e,"text",s);function s(u,c){let d=-1,p;for(;++d<c.length;){let m=c[d],h=p?p.children:void 0;if(r(m,h?h.indexOf(m):void 0,p))return;p=m}if(p)return l(u,c)}function l(u,c){let d=c[c.length-1],p=o[i][0],m=o[i][1],h=0,I=d.children.indexOf(u),y=!1,w=[];p.lastIndex=0;let g=p.exec(u.value);for(;g;){let S=g.index,E={index:g.index,input:g.input,stack:[...c,u]},T=m(...g,E);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?p.lastIndex=S+1:(h!==S&&w.push({type:"text",value:u.value.slice(h,S)}),Array.isArray(T)?w.push(...T):T&&w.push(T),h=S+g[0].length,y=!0),!p.global)break;g=p.exec(u.value)}return y?(h<u.value.length&&w.push({type:"text",value:u.value.slice(h)}),d.children.splice(I,1,...w)):w=[u],I+w.length}}function zV(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([FV(r[0]),qV(r[1])])}return t}function FV(e){return typeof e=="string"?new RegExp(Ix(e),"g"):e}function qV(e){return typeof e=="function"?e:function(){return e}}var bR=L(()=>{"use strict";xR();bm();xm()});var SR=L(()=>{"use strict";bR()});function Ex(){return{transforms:[GV],enter:{literalAutolink:HV,literalAutolinkEmail:Lx,literalAutolinkHttp:Lx,literalAutolinkWww:Lx},exit:{literalAutolink:WV,literalAutolinkEmail:$V,literalAutolinkHttp:jV,literalAutolinkWww:VV}}}function Ax(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:kx,notInConstruct:Tx},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:kx,notInConstruct:Tx},{character:":",before:"[ps]",after:"\\/",inConstruct:kx,notInConstruct:Tx}]}}function HV(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Lx(e){this.config.enter.autolinkProtocol.call(this,e)}function jV(e){this.config.exit.autolinkProtocol.call(this,e)}function VV(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 $V(e){this.config.exit.autolinkEmail.call(this,e)}function WV(e){this.exit(e)}function GV(e){Cx(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,XV],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,KV]],{ignore:["link","linkReference"]})}function XV(e,t,a,n,r){let o="";if(!IR(r)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!YV(a)))return!1;let i=ZV(a+n);if(!i[0])return!1;let s={type:"link",title:null,url:o+t+i[0],children:[{type:"text",value:t+i[0]}]};return i[1]?[s,{type:"text",value:i[1]}]:s}function KV(e,t,a,n){return!IR(n,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function YV(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 ZV(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=Sx(e,"("),o=Sx(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 IR(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||Cr(a)||ss(a))&&(!t||a!==47)}var kx,Tx,CR=L(()=>{"use strict";gR();at();SR();kx="phrasing",Tx=["autolink","link","image","label"]});var kR=L(()=>{"use strict";CR()});function Aa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Gl=L(()=>{"use strict"});function JV(){this.buffer()}function QV(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function e$(){this.buffer()}function t$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function a$(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Aa(this.sliceSerialize(e)).toLowerCase(),a.label=t}function n$(e){this.exit(e)}function r$(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Aa(this.sliceSerialize(e)).toLowerCase(),a.label=t}function o$(e){this.exit(e)}function i$(){return"["}function TR(e,t,a,n){let r=a.createTracker(n),o=r.move("[^"),i=a.enter("footnoteReference"),s=a.enter("reference");return o+=r.move(a.safe(a.associationId(e),{after:"]",before:o})),s(),i(),o+=r.move("]"),o}function Mx(){return{enter:{gfmFootnoteCallString:JV,gfmFootnoteCall:QV,gfmFootnoteDefinitionLabelString:e$,gfmFootnoteDefinition:t$},exit:{gfmFootnoteCallString:a$,gfmFootnoteCall:n$,gfmFootnoteDefinitionLabelString:r$,gfmFootnoteDefinition:o$}}}function Rx(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:TR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(n,r,o,i){let s=o.createTracker(i),l=s.move("[^"),u=o.enter("footnoteDefinition"),c=o.enter("label");return l+=s.move(o.safe(o.associationId(n),{before:l,after:"]"})),c(),l+=s.move("]:"),n.children&&n.children.length>0&&(s.shift(4),l+=s.move((t?`
|
|
10
|
-
`:" ")+o.indentLines(o.containerFlow(n,s.current()),t?
|
|
11
|
-
`)}function
|
|
12
|
-
`&&
|
|
13
|
-
`}var
|
|
8
|
+
`+n.stack}}var ny=Object.prototype.hasOwnProperty,Gy=sa.unstable_scheduleCallback,xg=sa.unstable_cancelCallback,Y3=sa.unstable_shouldYield,Z3=sa.unstable_requestPaint,dn=sa.unstable_now,J3=sa.unstable_getCurrentPriorityLevel,EC=sa.unstable_ImmediatePriority,AC=sa.unstable_UserBlockingPriority,Yf=sa.unstable_NormalPriority,Q3=sa.unstable_LowPriority,MC=sa.unstable_IdlePriority,ez=sa.log,tz=sa.unstable_setDisableYieldValue,dc=null,fn=null;function vo(e){if(typeof ez=="function"&&tz(e),fn&&typeof fn.setStrictMode=="function")try{fn.setStrictMode(dc,e)}catch{}}var pn=Math.clz32?Math.clz32:rz,az=Math.log,nz=Math.LN2;function rz(e){return e>>>=0,e===0?32:31-(az(e)/nz|0)|0}var hf=256,gf=262144,yf=4194304;function mi(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 Sp(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 s=n&134217727;return s!==0?(n=s&~o,n!==0?r=mi(n):(i&=s,i!==0?r=mi(i):a||(a=s&~e,a!==0&&(r=mi(a))))):(s=n&~o,s!==0?r=mi(s):i!==0?r=mi(i):a||(a=n&~e,a!==0&&(r=mi(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 fc(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function oz(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 RC(){var e=yf;return yf<<=1,(yf&62914560)===0&&(yf=4194304),e}function bg(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function pc(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function iz(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 s=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(a=i&~a;0<a;){var c=31-pn(a),d=1<<c;s[c]=0,l[c]=-1;var p=u[c];if(p!==null)for(u[c]=null,c=0;c<p.length;c++){var m=p[c];m!==null&&(m.lane&=-536870913)}a&=~d}n!==0&&DC(e,n,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function DC(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-pn(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function _C(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-pn(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function PC(e,t){var a=t&-t;return a=(a&42)!==0?1:Xy(a),(a&(e.suspendedLanes|t))!==0?0:a}function Xy(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 Ky(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function OC(){var e=lt.p;return e!==0?e:(e=window.event,e===void 0?32:r1(e.type))}function eI(e,t){var a=lt.p;try{return lt.p=e,t()}finally{lt.p=a}}var Uo=Math.random().toString(36).slice(2),wa="__reactFiber$"+Uo,Xa="__reactProps$"+Uo,cl="__reactContainer$"+Uo,ry="__reactEvents$"+Uo,sz="__reactListeners$"+Uo,lz="__reactHandles$"+Uo,tI="__reactResources$"+Uo,mc="__reactMarker$"+Uo;function Yy(e){delete e[wa],delete e[Xa],delete e[ry],delete e[sz],delete e[lz]}function Ns(e){var t=e[wa];if(t)return t;for(var a=e.parentNode;a;){if(t=a[cl]||a[wa]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=uC(e);e!==null;){if(a=e[wa])return a;e=uC(e)}return t}e=a,a=e.parentNode}return null}function dl(e){if(e=e[wa]||e[cl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pu(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(z(33))}function Ws(e){var t=e[tI];return t||(t=e[tI]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function fa(e){e[mc]=!0}var NC=new Set,UC={};function Li(e,t){el(e,t),el(e+"Capture",t)}function el(e,t){for(UC[e]=t,e=0;e<t.length;e++)NC.add(t[e])}var uz=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]*$"),aI={},nI={};function cz(e){return ny.call(nI,e)?!0:ny.call(aI,e)?!1:uz.test(e)?nI[e]=!0:(aI[e]=!0,!1)}function Df(e,t,a){if(cz(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 wf(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 Lr(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 Tn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function BC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dz(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 oy(e){if(!e._valueTracker){var t=BC(e)?"checked":"value";e._valueTracker=dz(e,t,""+e[t])}}function zC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=BC(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Zf(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 fz=/[\n"\\]/g;function An(e){return e.replace(fz,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function iy(e,t,a,n,r,o,i,s){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=""+Tn(t)):e.value!==""+Tn(t)&&(e.value=""+Tn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?sy(e,i,Tn(t)):a!=null?sy(e,i,Tn(a)):n!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+Tn(s):e.removeAttribute("name")}function FC(e,t,a,n,r,o,i,s){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)){oy(e);return}a=a!=null?""+Tn(a):"",t=t!=null?""+Tn(t):a,s||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=s?e.checked:!!n,e.defaultChecked=!!n,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),oy(e)}function sy(e,t,a){t==="number"&&Zf(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Gs(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=""+Tn(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 qC(e,t,a){if(t!=null&&(t=""+Tn(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Tn(a):""}function HC(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(z(92));if(_u(n)){if(1<n.length)throw Error(z(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Tn(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),oy(e)}function tl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var pz=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 rI(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||pz.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function jC(e,t,a){if(t!=null&&typeof t!="object")throw Error(z(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&&rI(e,r,n)}else for(var o in t)t.hasOwnProperty(o)&&rI(e,o,t[o])}function Zy(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 mz=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"]]),hz=/^[\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 _f(e){return hz.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Or(){}var ly=null;function Jy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Us=null,Xs=null;function oI(e){var t=dl(e);if(t&&(e=t.stateNode)){var a=e[Xa]||null;e:switch(e=t.stateNode,t.type){case"input":if(iy(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="'+An(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[Xa]||null;if(!r)throw Error(z(90));iy(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&&zC(n)}break e;case"textarea":qC(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Gs(e,!!a.multiple,t,!1)}}}var Sg=!1;function VC(e,t,a){if(Sg)return e(t,a);Sg=!0;try{var n=e(t);return n}finally{if(Sg=!1,(Us!==null||Xs!==null)&&(Pp(),Us&&(t=Us,e=Xs,Xs=Us=null,oI(t),e)))for(t=0;t<e.length;t++)oI(e[t])}}function Zu(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Xa]||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(z(231,t,typeof a));return a}var Fr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uy=!1;if(Fr)try{As={},Object.defineProperty(As,"passive",{get:function(){uy=!0}}),window.addEventListener("test",As,As),window.removeEventListener("test",As,As)}catch{uy=!1}var As,xo=null,Qy=null,Pf=null;function $C(){if(Pf)return Pf;var e,t=Qy,a=t.length,n,r="value"in xo?xo.value:xo.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 Pf=r.slice(e,1<n?1-n:void 0)}function Of(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 vf(){return!0}function iI(){return!1}function Ka(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 s in e)e.hasOwnProperty(s)&&(a=e[s],this[s]=a?a(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?vf:iI,this.isPropagationStopped=iI,this}return Lt(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=vf)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=vf)},persist:function(){},isPersistent:vf}),t}var Ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ip=Ka(Ei),hc=Lt({},Ei,{view:0,detail:0}),gz=Ka(hc),Ig,Cg,Tu,Cp=Lt({},hc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ew,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!==Tu&&(Tu&&e.type==="mousemove"?(Ig=e.screenX-Tu.screenX,Cg=e.screenY-Tu.screenY):Cg=Ig=0,Tu=e),Ig)},movementY:function(e){return"movementY"in e?e.movementY:Cg}}),sI=Ka(Cp),yz=Lt({},Cp,{dataTransfer:0}),wz=Ka(yz),vz=Lt({},hc,{relatedTarget:0}),kg=Ka(vz),xz=Lt({},Ei,{animationName:0,elapsedTime:0,pseudoElement:0}),bz=Ka(xz),Sz=Lt({},Ei,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Iz=Ka(Sz),Cz=Lt({},Ei,{data:0}),lI=Ka(Cz),kz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tz={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"},Lz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ez(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Lz[e])?!!t[e]:!1}function ew(){return Ez}var Az=Lt({},hc,{key:function(e){if(e.key){var t=kz[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Of(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Tz[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ew,charCode:function(e){return e.type==="keypress"?Of(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Of(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Mz=Ka(Az),Rz=Lt({},Cp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uI=Ka(Rz),Dz=Lt({},hc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ew}),_z=Ka(Dz),Pz=Lt({},Ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),Oz=Ka(Pz),Nz=Lt({},Cp,{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}),Uz=Ka(Nz),Bz=Lt({},Ei,{newState:0,oldState:0}),zz=Ka(Bz),Fz=[9,13,27,32],tw=Fr&&"CompositionEvent"in window,Uu=null;Fr&&"documentMode"in document&&(Uu=document.documentMode);var qz=Fr&&"TextEvent"in window&&!Uu,WC=Fr&&(!tw||Uu&&8<Uu&&11>=Uu),cI=" ",dI=!1;function GC(e,t){switch(e){case"keyup":return Fz.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function XC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bs=!1;function Hz(e,t){switch(e){case"compositionend":return XC(t);case"keypress":return t.which!==32?null:(dI=!0,cI);case"textInput":return e=t.data,e===cI&&dI?null:e;default:return null}}function jz(e,t){if(Bs)return e==="compositionend"||!tw&&GC(e,t)?(e=$C(),Pf=Qy=xo=null,Bs=!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 WC&&t.locale!=="ko"?null:t.data;default:return null}}var Vz={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 fI(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Vz[e.type]:t==="textarea"}function KC(e,t,a,n){Us?Xs?Xs.push(n):Xs=[n]:Us=n,t=hp(t,"onChange"),0<t.length&&(a=new Ip("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Bu=null,Ju=null;function $z(e){VT(e,0)}function kp(e){var t=Pu(e);if(zC(t))return e}function pI(e,t){if(e==="change")return t}var YC=!1;Fr&&(Fr?(bf="oninput"in document,bf||(Tg=document.createElement("div"),Tg.setAttribute("oninput","return;"),bf=typeof Tg.oninput=="function"),xf=bf):xf=!1,YC=xf&&(!document.documentMode||9<document.documentMode));var xf,bf,Tg;function mI(){Bu&&(Bu.detachEvent("onpropertychange",ZC),Ju=Bu=null)}function ZC(e){if(e.propertyName==="value"&&kp(Ju)){var t=[];KC(t,Ju,e,Jy(e)),VC($z,t)}}function Wz(e,t,a){e==="focusin"?(mI(),Bu=t,Ju=a,Bu.attachEvent("onpropertychange",ZC)):e==="focusout"&&mI()}function Gz(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kp(Ju)}function Xz(e,t){if(e==="click")return kp(t)}function Kz(e,t){if(e==="input"||e==="change")return kp(t)}function Yz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hn=typeof Object.is=="function"?Object.is:Yz;function Qu(e,t){if(hn(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(!ny.call(t,r)||!hn(e[r],t[r]))return!1}return!0}function hI(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gI(e,t){var a=hI(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=hI(a)}}function JC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?JC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function QC(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Zf(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=Zf(e.document)}return t}function aw(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 Zz=Fr&&"documentMode"in document&&11>=document.documentMode,zs=null,cy=null,zu=null,dy=!1;function yI(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;dy||zs==null||zs!==Zf(n)||(n=zs,"selectionStart"in n&&aw(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}),zu&&Qu(zu,n)||(zu=n,n=hp(cy,"onSelect"),0<n.length&&(t=new Ip("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=zs)))}function fi(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Fs={animationend:fi("Animation","AnimationEnd"),animationiteration:fi("Animation","AnimationIteration"),animationstart:fi("Animation","AnimationStart"),transitionrun:fi("Transition","TransitionRun"),transitionstart:fi("Transition","TransitionStart"),transitioncancel:fi("Transition","TransitionCancel"),transitionend:fi("Transition","TransitionEnd")},Lg={},ek={};Fr&&(ek=document.createElement("div").style,"AnimationEvent"in window||(delete Fs.animationend.animation,delete Fs.animationiteration.animation,delete Fs.animationstart.animation),"TransitionEvent"in window||delete Fs.transitionend.transition);function Ai(e){if(Lg[e])return Lg[e];if(!Fs[e])return e;var t=Fs[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in ek)return Lg[e]=t[a];return e}var tk=Ai("animationend"),ak=Ai("animationiteration"),nk=Ai("animationstart"),Jz=Ai("transitionrun"),Qz=Ai("transitionstart"),eF=Ai("transitioncancel"),rk=Ai("transitionend"),ok=new Map,fy="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(" ");fy.push("scrollEnd");function Gn(e,t){ok.set(e,t),Li(t,[e])}var Jf=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)},kn=[],qs=0,nw=0;function Tp(){for(var e=qs,t=nw=qs=0;t<e;){var a=kn[t];kn[t++]=null;var n=kn[t];kn[t++]=null;var r=kn[t];kn[t++]=null;var o=kn[t];if(kn[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&&ik(a,r,o)}}function Lp(e,t,a,n){kn[qs++]=e,kn[qs++]=t,kn[qs++]=a,kn[qs++]=n,nw|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function rw(e,t,a,n){return Lp(e,t,a,n),Qf(e)}function Mi(e,t){return Lp(e,null,null,t),Qf(e)}function ik(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-pn(a),e=o.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),o):null}function Qf(e){if(50<Xu)throw Xu=0,_y=null,Error(z(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Hs={};function tF(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 un(e,t,a,n){return new tF(e,t,a,n)}function ow(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ur(e,t){var a=e.alternate;return a===null?(a=un(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 sk(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 Nf(e,t,a,n,r,o){var i=0;if(n=e,typeof e=="function")ow(e)&&(i=1);else if(typeof e=="string")i=rq(e,a,cr.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Qg:return e=un(31,a,t,r),e.elementType=Qg,e.lanes=o,e;case Ps:return wi(a.children,r,o,t);case TC:i=8,r|=24;break;case Yg:return e=un(12,a,t,r|2),e.elementType=Yg,e.lanes=o,e;case Zg:return e=un(13,a,t,r),e.elementType=Zg,e.lanes=o,e;case Jg:return e=un(19,a,t,r),e.elementType=Jg,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Pr:i=10;break e;case LC:i=9;break e;case $y:i=11;break e;case Wy:i=14;break e;case po:i=16,n=null;break e}i=29,a=Error(z(130,e===null?"null":typeof e,"")),n=null}return t=un(i,a,t,r),t.elementType=e,t.type=n,t.lanes=o,t}function wi(e,t,a,n){return e=un(7,e,n,t),e.lanes=a,e}function Eg(e,t,a){return e=un(6,e,null,t),e.lanes=a,e}function lk(e){var t=un(18,null,null,0);return t.stateNode=e,t}function Ag(e,t,a){return t=un(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var wI=new WeakMap;function Mn(e,t){if(typeof e=="object"&&e!==null){var a=wI.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Q0(t)},wI.set(e,t),t)}return{value:e,source:t,stack:Q0(t)}}var js=[],Vs=0,ep=null,ec=0,Ln=[],En=0,_o=null,sr=1,lr="";function Dr(e,t){js[Vs++]=ec,js[Vs++]=ep,ep=e,ec=t}function uk(e,t,a){Ln[En++]=sr,Ln[En++]=lr,Ln[En++]=_o,_o=e;var n=sr;e=lr;var r=32-pn(n)-1;n&=~(1<<r),a+=1;var o=32-pn(t)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,sr=1<<32-pn(t)+r|a<<r|n,lr=o+e}else sr=1<<o|a<<r|n,lr=e}function iw(e){e.return!==null&&(Dr(e,1),uk(e,1,0))}function sw(e){for(;e===ep;)ep=js[--Vs],js[Vs]=null,ec=js[--Vs],js[Vs]=null;for(;e===_o;)_o=Ln[--En],Ln[En]=null,lr=Ln[--En],Ln[En]=null,sr=Ln[--En],Ln[En]=null}function ck(e,t){Ln[En++]=sr,Ln[En++]=lr,Ln[En++]=_o,sr=t.id,lr=t.overflow,_o=e}var va=null,Tt=null,Ze=!1,ko=null,Rn=!1,py=Error(z(519));function Po(e){var t=Error(z(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw tc(Mn(t,e)),py}function vI(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[wa]=e,t[Xa]=n,a){case"dialog":Ge("cancel",t),Ge("close",t);break;case"iframe":case"object":case"embed":Ge("load",t);break;case"video":case"audio":for(a=0;a<oc.length;a++)Ge(oc[a],t);break;case"source":Ge("error",t);break;case"img":case"image":case"link":Ge("error",t),Ge("load",t);break;case"details":Ge("toggle",t);break;case"input":Ge("invalid",t),FC(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ge("invalid",t);break;case"textarea":Ge("invalid",t),HC(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||WT(t.textContent,a)?(n.popover!=null&&(Ge("beforetoggle",t),Ge("toggle",t)),n.onScroll!=null&&Ge("scroll",t),n.onScrollEnd!=null&&Ge("scrollend",t),n.onClick!=null&&(t.onclick=Or),t=!0):t=!1,t||Po(e,!0)}function xI(e){for(va=e.return;va;)switch(va.tag){case 5:case 31:case 13:Rn=!1;return;case 27:case 3:Rn=!0;return;default:va=va.return}}function Ms(e){if(e!==va)return!1;if(!Ze)return xI(e),Ze=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||By(e.type,e.memoizedProps)),a=!a),a&&Tt&&Po(e),xI(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));Tt=lC(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));Tt=lC(e)}else t===27?(t=Tt,Bo(e.type)?(e=Hy,Hy=null,Tt=e):Tt=t):Tt=va?_n(e.stateNode.nextSibling):null;return!0}function Si(){Tt=va=null,Ze=!1}function Mg(){var e=ko;return e!==null&&(Wa===null?Wa=e:Wa.push.apply(Wa,e),ko=null),e}function tc(e){ko===null?ko=[e]:ko.push(e)}var my=dr(null),Ri=null,Nr=null;function ho(e,t,a){St(my,t._currentValue),t._currentValue=a}function Br(e){e._currentValue=my.current,pa(my)}function hy(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 gy(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 s=o;o=r;for(var l=0;l<t.length;l++)if(s.context===t[l]){o.lanes|=a,s=o.alternate,s!==null&&(s.lanes|=a),hy(o.return,a,e),n||(i=null);break e}o=s.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(z(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),hy(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 fl(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(z(387));if(i=i.memoizedProps,i!==null){var s=r.type;hn(r.pendingProps.value,i.value)||(e!==null?e.push(s):e=[s])}}else if(r===Gf.current){if(i=r.alternate,i===null)throw Error(z(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(sc):e=[sc])}r=r.return}e!==null&&gy(t,e,a,n),t.flags|=262144}function tp(e){for(e=e.firstContext;e!==null;){if(!hn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ii(e){Ri=e,Nr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return dk(Ri,e)}function Sf(e,t){return Ri===null&&Ii(e),dk(e,t)}function dk(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Nr===null){if(e===null)throw Error(z(308));Nr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Nr=Nr.next=t;return a}var aF=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()})}},nF=sa.unstable_scheduleCallback,rF=sa.unstable_NormalPriority,na={$$typeof:Pr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lw(){return{controller:new aF,data:new Map,refCount:0}}function gc(e){e.refCount--,e.refCount===0&&nF(rF,function(){e.controller.abort()})}var Fu=null,yy=0,al=0,Ks=null;function oF(e,t){if(Fu===null){var a=Fu=[];yy=0,al=_w(),Ks={status:"pending",value:void 0,then:function(n){a.push(n)}}}return yy++,t.then(bI,bI),t}function bI(){if(--yy===0&&Fu!==null){Ks!==null&&(Ks.status="fulfilled");var e=Fu;Fu=null,al=0,Ks=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function iF(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 SI=Te.S;Te.S=function(e,t){kT=dn(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&oF(e,t),SI!==null&&SI(e,t)};var vi=dr(null);function uw(){var e=vi.current;return e!==null?e:vt.pooledCache}function Uf(e,t){t===null?St(vi,vi.current):St(vi,t.pool)}function fk(){var e=uw();return e===null?null:{parent:na._currentValue,pool:e}}var pl=Error(z(460)),cw=Error(z(474)),Ep=Error(z(542)),ap={then:function(){}};function II(e){return e=e.status,e==="fulfilled"||e==="rejected"}function pk(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Or,Or),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,kI(e),e;default:if(typeof t.status=="string")t.then(Or,Or);else{if(e=vt,e!==null&&100<e.shellSuspendCounter)throw Error(z(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,kI(e),e}throw xi=t,pl}}function hi(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(xi=a,pl):a}}var xi=null;function CI(){if(xi===null)throw Error(z(459));var e=xi;return xi=null,e}function kI(e){if(e===pl||e===Ep)throw Error(z(483))}var Ys=null,ac=0;function If(e){var t=ac;return ac+=1,Ys===null&&(Ys=[]),pk(Ys,e,t)}function Lu(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cf(e,t){throw t.$$typeof===W3?Error(z(525)):(e=Object.prototype.toString.call(t),Error(z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function mk(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=Ur(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 s(y,w,g,S){return w===null||w.tag!==6?(w=Eg(g,y.mode,S),w.return=y,w):(w=r(w,g),w.return=y,w)}function l(y,w,g,S){var E=g.type;return E===Ps?c(y,w,g.props.children,S,g.key):w!==null&&(w.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===po&&hi(E)===w.type)?(w=r(w,g.props),Lu(w,g),w.return=y,w):(w=Nf(g.type,g.key,g.props,null,y.mode,S),Lu(w,g),w.return=y,w)}function u(y,w,g,S){return w===null||w.tag!==4||w.stateNode.containerInfo!==g.containerInfo||w.stateNode.implementation!==g.implementation?(w=Ag(g,y.mode,S),w.return=y,w):(w=r(w,g.children||[]),w.return=y,w)}function c(y,w,g,S,E){return w===null||w.tag!==7?(w=wi(g,y.mode,S,E),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=Eg(""+w,y.mode,g),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case mf:return g=Nf(w.type,w.key,w.props,null,y.mode,g),Lu(g,w),g.return=y,g;case Du:return w=Ag(w,y.mode,g),w.return=y,w;case po:return w=hi(w),d(y,w,g)}if(_u(w)||ku(w))return w=wi(w,y.mode,g,null),w.return=y,w;if(typeof w.then=="function")return d(y,If(w),g);if(w.$$typeof===Pr)return d(y,Sf(y,w),g);Cf(y,w)}return null}function p(y,w,g,S){var E=w!==null?w.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return E!==null?null:s(y,w,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case mf:return g.key===E?l(y,w,g,S):null;case Du:return g.key===E?u(y,w,g,S):null;case po:return g=hi(g),p(y,w,g,S)}if(_u(g)||ku(g))return E!==null?null:c(y,w,g,S,null);if(typeof g.then=="function")return p(y,w,If(g),S);if(g.$$typeof===Pr)return p(y,w,Sf(y,g),S);Cf(y,g)}return null}function m(y,w,g,S,E){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return y=y.get(g)||null,s(w,y,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case mf:return y=y.get(S.key===null?g:S.key)||null,l(w,y,S,E);case Du:return y=y.get(S.key===null?g:S.key)||null,u(w,y,S,E);case po:return S=hi(S),m(y,w,g,S,E)}if(_u(S)||ku(S))return y=y.get(g)||null,c(w,y,S,E,null);if(typeof S.then=="function")return m(y,w,g,If(S),E);if(S.$$typeof===Pr)return m(y,w,g,Sf(w,S),E);Cf(w,S)}return null}function h(y,w,g,S){for(var E=null,T=null,R=w,O=w=0,U=null;R!==null&&O<g.length;O++){R.index>O?(U=R,R=null):U=R.sibling;var A=p(y,R,g[O],S);if(A===null){R===null&&(R=U);break}e&&R&&A.alternate===null&&t(y,R),w=o(A,w,O),T===null?E=A:T.sibling=A,T=A,R=U}if(O===g.length)return a(y,R),Ze&&Dr(y,O),E;if(R===null){for(;O<g.length;O++)R=d(y,g[O],S),R!==null&&(w=o(R,w,O),T===null?E=R:T.sibling=R,T=R);return Ze&&Dr(y,O),E}for(R=n(R);O<g.length;O++)U=m(R,y,O,g[O],S),U!==null&&(e&&U.alternate!==null&&R.delete(U.key===null?O:U.key),w=o(U,w,O),T===null?E=U:T.sibling=U,T=U);return e&&R.forEach(function(Q){return t(y,Q)}),Ze&&Dr(y,O),E}function v(y,w,g,S){if(g==null)throw Error(z(151));for(var E=null,T=null,R=w,O=w=0,U=null,A=g.next();R!==null&&!A.done;O++,A=g.next()){R.index>O?(U=R,R=null):U=R.sibling;var Q=p(y,R,A.value,S);if(Q===null){R===null&&(R=U);break}e&&R&&Q.alternate===null&&t(y,R),w=o(Q,w,O),T===null?E=Q:T.sibling=Q,T=Q,R=U}if(A.done)return a(y,R),Ze&&Dr(y,O),E;if(R===null){for(;!A.done;O++,A=g.next())A=d(y,A.value,S),A!==null&&(w=o(A,w,O),T===null?E=A:T.sibling=A,T=A);return Ze&&Dr(y,O),E}for(R=n(R);!A.done;O++,A=g.next())A=m(R,y,O,A.value,S),A!==null&&(e&&A.alternate!==null&&R.delete(A.key===null?O:A.key),w=o(A,w,O),T===null?E=A:T.sibling=A,T=A);return e&&R.forEach(function($){return t(y,$)}),Ze&&Dr(y,O),E}function I(y,w,g,S){if(typeof g=="object"&&g!==null&&g.type===Ps&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case mf:e:{for(var E=g.key;w!==null;){if(w.key===E){if(E=g.type,E===Ps){if(w.tag===7){a(y,w.sibling),S=r(w,g.props.children),S.return=y,y=S;break e}}else if(w.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===po&&hi(E)===w.type){a(y,w.sibling),S=r(w,g.props),Lu(S,g),S.return=y,y=S;break e}a(y,w);break}else t(y,w);w=w.sibling}g.type===Ps?(S=wi(g.props.children,y.mode,S,g.key),S.return=y,y=S):(S=Nf(g.type,g.key,g.props,null,y.mode,S),Lu(S,g),S.return=y,y=S)}return i(y);case Du:e:{for(E=g.key;w!==null;){if(w.key===E)if(w.tag===4&&w.stateNode.containerInfo===g.containerInfo&&w.stateNode.implementation===g.implementation){a(y,w.sibling),S=r(w,g.children||[]),S.return=y,y=S;break e}else{a(y,w);break}else t(y,w);w=w.sibling}S=Ag(g,y.mode,S),S.return=y,y=S}return i(y);case po:return g=hi(g),I(y,w,g,S)}if(_u(g))return h(y,w,g,S);if(ku(g)){if(E=ku(g),typeof E!="function")throw Error(z(150));return g=E.call(g),v(y,w,g,S)}if(typeof g.then=="function")return I(y,w,If(g),S);if(g.$$typeof===Pr)return I(y,w,Sf(y,g),S);Cf(y,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,w!==null&&w.tag===6?(a(y,w.sibling),S=r(w,g),S.return=y,y=S):(a(y,w),S=Eg(g,y.mode,S),S.return=y,y=S),i(y)):a(y,w)}return function(y,w,g,S){try{ac=0;var E=I(y,w,g,S);return Ys=null,E}catch(R){if(R===pl||R===Ep)throw R;var T=un(29,R,null,y.mode);return T.lanes=S,T.return=y,T}}}var Ci=mk(!0),hk=mk(!1),mo=!1;function dw(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wy(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 To(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Lo(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(st&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=Qf(e),ik(e,null,a),t}return Lp(e,n,t,a),Qf(e)}function qu(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,_C(e,a)}}function Rg(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 vy=!1;function Hu(){if(vy){var e=Ks;if(e!==null)throw e}}function ju(e,t,a,n){vy=!1;var r=e.updateQueue;mo=!1;var o=r.firstBaseUpdate,i=r.lastBaseUpdate,s=r.shared.pending;if(s!==null){r.shared.pending=null;var l=s,u=l.next;l.next=null,i===null?o=u:i.next=u,i=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==i&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=r.baseState;i=0,c=u=l=null,s=o;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Ke&p)===p:(n&p)===p){p!==0&&p===al&&(vy=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var h=e,v=s;p=t;var I=a;switch(v.tag){case 1:if(h=v.payload,typeof h=="function"){d=h.call(I,d,p);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=v.payload,p=typeof h=="function"?h.call(I,d,p):h,p==null)break e;d=Lt({},d,p);break e;case 2:mo=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=m,l=d):c=c.next=m,i|=p;if(s=s.next,s===null){if(s=r.shared.pending,s===null)break;m=s,s=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);c===null&&(l=d),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=c,o===null&&(r.shared.lanes=0),No|=i,e.lanes=i,e.memoizedState=d}}function gk(e,t){if(typeof e!="function")throw Error(z(191,e));e.call(t)}function yk(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)gk(a[e],t)}var nl=dr(null),np=dr(0);function TI(e,t){e=Vr,St(np,e),St(nl,t),Vr=e|t.baseLanes}function xy(){St(np,Vr),St(nl,nl.current)}function fw(){Vr=np.current,pa(nl),pa(np)}var gn=dr(null),Dn=null;function go(e){var t=e.alternate;St(Yt,Yt.current&1),St(gn,e),Dn===null&&(t===null||nl.current!==null||t.memoizedState!==null)&&(Dn=e)}function by(e){St(Yt,Yt.current),St(gn,e),Dn===null&&(Dn=e)}function wk(e){e.tag===22?(St(Yt,Yt.current),St(gn,e),Dn===null&&(Dn=e)):yo(e)}function yo(){St(Yt,Yt.current),St(gn,gn.current)}function ln(e){pa(gn),Dn===e&&(Dn=null),pa(Yt)}var Yt=dr(0);function rp(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Fy(a)||qy(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 qr=0,Pe=null,yt=null,ta=null,op=!1,Zs=!1,ki=!1,ip=0,nc=0,Js=null,sF=0;function Ht(){throw Error(z(321))}function pw(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!hn(e[a],t[a]))return!1;return!0}function mw(e,t,a,n,r,o){return qr=o,Pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Te.H=e===null||e.memoizedState===null?Kk:kw,ki=!1,o=a(n,r),ki=!1,Zs&&(o=xk(t,a,n,r)),vk(e),o}function vk(e){Te.H=rc;var t=yt!==null&&yt.next!==null;if(qr=0,ta=yt=Pe=null,op=!1,nc=0,Js=null,t)throw Error(z(300));e===null||ra||(e=e.dependencies,e!==null&&tp(e)&&(ra=!0))}function xk(e,t,a,n){Pe=e;var r=0;do{if(Zs&&(Js=null),nc=0,Zs=!1,25<=r)throw Error(z(301));if(r+=1,ta=yt=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}Te.H=Yk,o=t(a,n)}while(Zs);return o}function lF(){var e=Te.H,t=e.useState()[0];return t=typeof t.then=="function"?yc(t):t,e=e.useState()[0],(yt!==null?yt.memoizedState:null)!==e&&(Pe.flags|=1024),t}function hw(){var e=ip!==0;return ip=0,e}function gw(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function yw(e){if(op){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}op=!1}qr=0,ta=yt=Pe=null,Zs=!1,nc=ip=0,Js=null}function Oa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ta===null?Pe.memoizedState=ta=e:ta=ta.next=e,ta}function Zt(){if(yt===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=yt.next;var t=ta===null?Pe.memoizedState:ta.next;if(t!==null)ta=t,yt=e;else{if(e===null)throw Pe.alternate===null?Error(z(467)):Error(z(310));yt=e,e={memoizedState:yt.memoizedState,baseState:yt.baseState,baseQueue:yt.baseQueue,queue:yt.queue,next:null},ta===null?Pe.memoizedState=ta=e:ta=ta.next=e}return ta}function Ap(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yc(e){var t=nc;return nc+=1,Js===null&&(Js=[]),e=pk(Js,e,t),t=Pe,(ta===null?t.memoizedState:ta.next)===null&&(t=t.alternate,Te.H=t===null||t.memoizedState===null?Kk:kw),e}function Mp(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return yc(e);if(e.$$typeof===Pr)return xa(e)}throw Error(z(438,String(e)))}function ww(e){var t=null,a=Pe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Pe.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=Ap(),Pe.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]=G3;return t.index++,a}function Hr(e,t){return typeof t=="function"?t(e):t}function Bf(e){var t=Zt();return vw(t,yt,e)}function vw(e,t,a){var n=e.queue;if(n===null)throw Error(z(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 s=i=null,l=null,u=t,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Ke&d)===d:(qr&d)===d){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===al&&(c=!0);else if((qr&p)===p){u=u.next,p===al&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=d,i=o):l=l.next=d,Pe.lanes|=p,No|=p;d=u.action,ki&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else p={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=p,i=o):l=l.next=p,Pe.lanes|=d,No|=d;u=u.next}while(u!==null&&u!==t);if(l===null?i=o:l.next=s,!hn(o,e.memoizedState)&&(ra=!0,c&&(a=Ks,a!==null)))throw a;e.memoizedState=o,e.baseState=i,e.baseQueue=l,n.lastRenderedState=o}return r===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Dg(e){var t=Zt(),a=t.queue;if(a===null)throw Error(z(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);hn(o,t.memoizedState)||(ra=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function bk(e,t,a){var n=Pe,r=Zt(),o=Ze;if(o){if(a===void 0)throw Error(z(407));a=a()}else a=t();var i=!hn((yt||r).memoizedState,a);if(i&&(r.memoizedState=a,ra=!0),r=r.queue,xw(Ck.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||ta!==null&&ta.memoizedState.tag&1){if(n.flags|=2048,rl(9,{destroy:void 0},Ik.bind(null,n,r,a,t),null),vt===null)throw Error(z(349));o||(qr&127)!==0||Sk(n,t,a)}return a}function Sk(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Pe.updateQueue,t===null?(t=Ap(),Pe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Ik(e,t,a,n){t.value=a,t.getSnapshot=n,kk(t)&&Tk(e)}function Ck(e,t,a){return a(function(){kk(t)&&Tk(e)})}function kk(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!hn(e,a)}catch{return!0}}function Tk(e){var t=Mi(e,2);t!==null&&Ga(t,e,2)}function Sy(e){var t=Oa();if(typeof e=="function"){var a=e;if(e=a(),ki){vo(!0);try{a()}finally{vo(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:e},t}function Lk(e,t,a,n){return e.baseState=a,vw(e,yt,typeof n=="function"?n:Hr)}function uF(e,t,a,n,r){if(Dp(e))throw Error(z(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)}};Te.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,Ek(t,o)):(o.next=a.next,t.pending=a.next=o)}}function Ek(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var o=Te.T,i={};Te.T=i;try{var s=a(r,n),l=Te.S;l!==null&&l(i,s),LI(e,t,s)}catch(u){Iy(e,t,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),Te.T=o}}else try{o=a(r,n),LI(e,t,o)}catch(u){Iy(e,t,u)}}function LI(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){EI(e,t,n)},function(n){return Iy(e,t,n)}):EI(e,t,a)}function EI(e,t,a){t.status="fulfilled",t.value=a,Ak(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Ek(e,a)))}function Iy(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,Ak(t),t=t.next;while(t!==n)}e.action=null}function Ak(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Mk(e,t){return t}function AI(e,t){if(Ze){var a=vt.formState;if(a!==null){e:{var n=Pe;if(Ze){if(Tt){t:{for(var r=Tt,o=Rn;r.nodeType!==8;){if(!o){r=null;break t}if(r=_n(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){Tt=_n(r.nextSibling),n=r.data==="F!";break e}}Po(n)}n=!1}n&&(t=a[0])}}return a=Oa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mk,lastRenderedState:t},a.queue=n,a=Wk.bind(null,Pe,n),n.dispatch=a,n=Sy(!1),o=Cw.bind(null,Pe,!1,n.queue),n=Oa(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=uF.bind(null,Pe,r,o,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function MI(e){var t=Zt();return Rk(t,yt,e)}function Rk(e,t,a){if(t=vw(e,t,Mk)[0],e=Bf(Hr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=yc(t)}catch(i){throw i===pl?Ep:i}else n=t;t=Zt();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(Pe.flags|=2048,rl(9,{destroy:void 0},cF.bind(null,r,a),null)),[n,o,e]}function cF(e,t){e.action=t}function RI(e){var t=Zt(),a=yt;if(a!==null)return Rk(t,a,e);Zt(),t=t.memoizedState,a=Zt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function rl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Pe.updateQueue,t===null&&(t=Ap(),Pe.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 Dk(){return Zt().memoizedState}function zf(e,t,a,n){var r=Oa();Pe.flags|=e,r.memoizedState=rl(1|t,{destroy:void 0},a,n===void 0?null:n)}function Rp(e,t,a,n){var r=Zt();n=n===void 0?null:n;var o=r.memoizedState.inst;yt!==null&&n!==null&&pw(n,yt.memoizedState.deps)?r.memoizedState=rl(t,o,a,n):(Pe.flags|=e,r.memoizedState=rl(1|t,o,a,n))}function DI(e,t){zf(8390656,8,e,t)}function xw(e,t){Rp(2048,8,e,t)}function dF(e){Pe.flags|=4;var t=Pe.updateQueue;if(t===null)t=Ap(),Pe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function _k(e){var t=Zt().memoizedState;return dF({ref:t,nextImpl:e}),function(){if((st&2)!==0)throw Error(z(440));return t.impl.apply(void 0,arguments)}}function Pk(e,t){return Rp(4,2,e,t)}function Ok(e,t){return Rp(4,4,e,t)}function Nk(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 Uk(e,t,a){a=a!=null?a.concat([e]):null,Rp(4,4,Nk.bind(null,t,e),a)}function bw(){}function Bk(e,t){var a=Zt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&pw(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function zk(e,t){var a=Zt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&pw(t,n[1]))return n[0];if(n=e(),ki){vo(!0);try{e()}finally{vo(!1)}}return a.memoizedState=[n,t],n}function Sw(e,t,a){return a===void 0||(qr&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=LT(),Pe.lanes|=e,No|=e,a)}function Fk(e,t,a,n){return hn(a,t)?a:nl.current!==null?(e=Sw(e,a,n),hn(e,t)||(ra=!0),e):(qr&42)===0||(qr&1073741824)!==0&&(Ke&261930)===0?(ra=!0,e.memoizedState=a):(e=LT(),Pe.lanes|=e,No|=e,t)}function qk(e,t,a,n,r){var o=lt.p;lt.p=o!==0&&8>o?o:8;var i=Te.T,s={};Te.T=s,Cw(e,!1,t,a);try{var l=r(),u=Te.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=iF(l,n);Vu(e,t,c,mn(e))}else Vu(e,t,n,mn(e))}catch(d){Vu(e,t,{then:function(){},status:"rejected",reason:d},mn())}finally{lt.p=o,i!==null&&s.types!==null&&(i.types=s.types),Te.T=i}}function fF(){}function Cy(e,t,a,n){if(e.tag!==5)throw Error(z(476));var r=Hk(e).queue;qk(e,r,t,yi,a===null?fF:function(){return jk(e),a(n)})}function Hk(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:yi,baseState:yi,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:yi},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function jk(e){var t=Hk(e);t.next===null&&(t=e.alternate.memoizedState),Vu(e,t.next.queue,{},mn())}function Iw(){return xa(sc)}function Vk(){return Zt().memoizedState}function $k(){return Zt().memoizedState}function pF(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=mn();e=To(a);var n=Lo(t,e,a);n!==null&&(Ga(n,t,a),qu(n,t,a)),t={cache:lw()},e.payload=t;return}t=t.return}}function mF(e,t,a){var n=mn();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Dp(e)?Gk(t,a):(a=rw(e,t,a,n),a!==null&&(Ga(a,e,n),Xk(a,t,n)))}function Wk(e,t,a){var n=mn();Vu(e,t,a,n)}function Vu(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Dp(e))Gk(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,s=o(i,a);if(r.hasEagerState=!0,r.eagerState=s,hn(s,i))return Lp(e,t,r,0),vt===null&&Tp(),!1}catch{}if(a=rw(e,t,r,n),a!==null)return Ga(a,e,n),Xk(a,t,n),!0}return!1}function Cw(e,t,a,n){if(n={lane:2,revertLane:_w(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Dp(e)){if(t)throw Error(z(479))}else t=rw(e,a,n,2),t!==null&&Ga(t,e,2)}function Dp(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function Gk(e,t){Zs=op=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Xk(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,_C(e,a)}}var rc={readContext:xa,use:Mp,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};rc.useEffectEvent=Ht;var Kk={readContext:xa,use:Mp,useCallback:function(e,t){return Oa().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:DI,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,zf(4194308,4,Nk.bind(null,t,e),a)},useLayoutEffect:function(e,t){return zf(4194308,4,e,t)},useInsertionEffect:function(e,t){zf(4,2,e,t)},useMemo:function(e,t){var a=Oa();t=t===void 0?null:t;var n=e();if(ki){vo(!0);try{e()}finally{vo(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Oa();if(a!==void 0){var r=a(t);if(ki){vo(!0);try{a(t)}finally{vo(!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=mF.bind(null,Pe,e),[n.memoizedState,e]},useRef:function(e){var t=Oa();return e={current:e},t.memoizedState=e},useState:function(e){e=Sy(e);var t=e.queue,a=Wk.bind(null,Pe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:bw,useDeferredValue:function(e,t){var a=Oa();return Sw(a,e,t)},useTransition:function(){var e=Sy(!1);return e=qk.bind(null,Pe,e.queue,!0,!1),Oa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Pe,r=Oa();if(Ze){if(a===void 0)throw Error(z(407));a=a()}else{if(a=t(),vt===null)throw Error(z(349));(Ke&127)!==0||Sk(n,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,DI(Ck.bind(null,n,o,e),[e]),n.flags|=2048,rl(9,{destroy:void 0},Ik.bind(null,n,o,a,t),null),a},useId:function(){var e=Oa(),t=vt.identifierPrefix;if(Ze){var a=lr,n=sr;a=(n&~(1<<32-pn(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ip++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=sF++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Iw,useFormState:AI,useActionState:AI,useOptimistic:function(e){var t=Oa();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Cw.bind(null,Pe,!0,a),a.dispatch=t,[e,t]},useMemoCache:ww,useCacheRefresh:function(){return Oa().memoizedState=pF.bind(null,Pe)},useEffectEvent:function(e){var t=Oa(),a={impl:e};return t.memoizedState=a,function(){if((st&2)!==0)throw Error(z(440));return a.impl.apply(void 0,arguments)}}},kw={readContext:xa,use:Mp,useCallback:Bk,useContext:xa,useEffect:xw,useImperativeHandle:Uk,useInsertionEffect:Pk,useLayoutEffect:Ok,useMemo:zk,useReducer:Bf,useRef:Dk,useState:function(){return Bf(Hr)},useDebugValue:bw,useDeferredValue:function(e,t){var a=Zt();return Fk(a,yt.memoizedState,e,t)},useTransition:function(){var e=Bf(Hr)[0],t=Zt().memoizedState;return[typeof e=="boolean"?e:yc(e),t]},useSyncExternalStore:bk,useId:Vk,useHostTransitionStatus:Iw,useFormState:MI,useActionState:MI,useOptimistic:function(e,t){var a=Zt();return Lk(a,yt,e,t)},useMemoCache:ww,useCacheRefresh:$k};kw.useEffectEvent=_k;var Yk={readContext:xa,use:Mp,useCallback:Bk,useContext:xa,useEffect:xw,useImperativeHandle:Uk,useInsertionEffect:Pk,useLayoutEffect:Ok,useMemo:zk,useReducer:Dg,useRef:Dk,useState:function(){return Dg(Hr)},useDebugValue:bw,useDeferredValue:function(e,t){var a=Zt();return yt===null?Sw(a,e,t):Fk(a,yt.memoizedState,e,t)},useTransition:function(){var e=Dg(Hr)[0],t=Zt().memoizedState;return[typeof e=="boolean"?e:yc(e),t]},useSyncExternalStore:bk,useId:Vk,useHostTransitionStatus:Iw,useFormState:RI,useActionState:RI,useOptimistic:function(e,t){var a=Zt();return yt!==null?Lk(a,yt,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:ww,useCacheRefresh:$k};Yk.useEffectEvent=_k;function _g(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:Lt({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var ky={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=mn(),r=To(n);r.payload=t,a!=null&&(r.callback=a),t=Lo(e,r,n),t!==null&&(Ga(t,e,n),qu(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=mn(),r=To(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=Lo(e,r,n),t!==null&&(Ga(t,e,n),qu(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=mn(),n=To(a);n.tag=2,t!=null&&(n.callback=t),t=Lo(e,n,a),t!==null&&(Ga(t,e,a),qu(t,e,a))}};function _I(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?!Qu(a,n)||!Qu(r,o):!0}function PI(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&&ky.enqueueReplaceState(t,t.state,null)}function Ti(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=Lt({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function Zk(e){Jf(e)}function Jk(e){console.error(e)}function Qk(e){Jf(e)}function sp(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function OI(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 Ty(e,t,a){return a=To(a),a.tag=3,a.payload={element:null},a.callback=function(){sp(e,t)},a}function eT(e){return e=To(e),e.tag=3,e}function tT(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(){OI(t,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){OI(t,a,n),typeof r!="function"&&(Eo===null?Eo=new Set([this]):Eo.add(this));var s=n.stack;this.componentDidCatch(n.value,{componentStack:s!==null?s:""})})}function hF(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&fl(t,a,r,!0),a=gn.current,a!==null){switch(a.tag){case 31:case 13:return Dn===null?fp():a.alternate===null&&jt===0&&(jt=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===ap?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Vg(e,n,r)),!1;case 22:return a.flags|=65536,n===ap?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)),Vg(e,n,r)),!1}throw Error(z(435,a.tag))}return Vg(e,n,r),fp(),!1}if(Ze)return t=gn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==py&&(e=Error(z(422),{cause:n}),tc(Mn(e,a)))):(n!==py&&(t=Error(z(423),{cause:n}),tc(Mn(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=Mn(n,a),r=Ty(e.stateNode,n,r),Rg(e,r),jt!==4&&(jt=2)),!1;var o=Error(z(520),{cause:n});if(o=Mn(o,a),Gu===null?Gu=[o]:Gu.push(o),jt!==4&&(jt=2),t===null)return!0;n=Mn(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=Ty(a.stateNode,n,e),Rg(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"&&(Eo===null||!Eo.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=eT(r),tT(r,e,a,n),Rg(a,r),!1}a=a.return}while(a!==null);return!1}var Tw=Error(z(461)),ra=!1;function ya(e,t,a,n){t.child=e===null?hk(t,null,a,n):Ci(t,e.child,a,n)}function NI(e,t,a,n,r){a=a.render;var o=t.ref;if("ref"in n){var i={};for(var s in n)s!=="ref"&&(i[s]=n[s])}else i=n;return Ii(t),n=mw(e,t,a,i,o,r),s=hw(),e!==null&&!ra?(gw(e,t,r),jr(e,t,r)):(Ze&&s&&iw(t),t.flags|=1,ya(e,t,n,r),t.child)}function UI(e,t,a,n,r){if(e===null){var o=a.type;return typeof o=="function"&&!ow(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,aT(e,t,o,n,r)):(e=Nf(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Lw(e,r)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Qu,a(i,n)&&e.ref===t.ref)return jr(e,t,r)}return t.flags|=1,e=Ur(o,n),e.ref=t.ref,e.return=t,t.child=e}function aT(e,t,a,n,r){if(e!==null){var o=e.memoizedProps;if(Qu(o,n)&&e.ref===t.ref)if(ra=!1,t.pendingProps=n=o,Lw(e,r))(e.flags&131072)!==0&&(ra=!0);else return t.lanes=e.lanes,jr(e,t,r)}return Ly(e,t,a,n,r)}function nT(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 BI(e,t,o,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Uf(t,o!==null?o.cachePool:null),o!==null?TI(t,o):xy(),wk(t);else return n=t.lanes=536870912,BI(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(Uf(t,o.cachePool),TI(t,o),yo(t),t.memoizedState=null):(e!==null&&Uf(t,null),xy(),yo(t));return ya(e,t,r,a),t.child}function Ou(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function BI(e,t,a,n,r){var o=uw();return o=o===null?null:{parent:na._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&Uf(t,null),xy(),wk(t),e!==null&&fl(e,t,n,!0),t.childLanes=r,null}function Ff(e,t){return t=lp({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zI(e,t,a){return Ci(t,e.child,null,a),e=Ff(t,t.pendingProps),e.flags|=2,ln(t),t.memoizedState=null,e}function gF(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ze){if(n.mode==="hidden")return e=Ff(t,n),t.lanes=536870912,Ou(null,e);if(by(t),(e=Tt)?(e=KT(e,Rn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_o!==null?{id:sr,overflow:lr}:null,retryLane:536870912,hydrationErrors:null},a=lk(e),a.return=t,t.child=a,va=t,Tt=null)):e=null,e===null)throw Po(t);return t.lanes=536870912,null}return Ff(t,n)}var o=e.memoizedState;if(o!==null){var i=o.dehydrated;if(by(t),r)if(t.flags&256)t.flags&=-257,t=zI(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(z(558));else if(ra||fl(e,t,a,!1),r=(a&e.childLanes)!==0,ra||r){if(n=vt,n!==null&&(i=PC(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Mi(e,i),Ga(n,e,i),Tw;fp(),t=zI(e,t,a)}else e=o.treeContext,Tt=_n(i.nextSibling),va=t,Ze=!0,ko=null,Rn=!1,e!==null&&ck(t,e),t=Ff(t,n),t.flags|=4096;return t}return e=Ur(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qf(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(z(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Ly(e,t,a,n,r){return Ii(t),a=mw(e,t,a,n,void 0,r),n=hw(),e!==null&&!ra?(gw(e,t,r),jr(e,t,r)):(Ze&&n&&iw(t),t.flags|=1,ya(e,t,a,r),t.child)}function FI(e,t,a,n,r,o){return Ii(t),t.updateQueue=null,a=xk(t,n,a,r),vk(e),n=hw(),e!==null&&!ra?(gw(e,t,o),jr(e,t,o)):(Ze&&n&&iw(t),t.flags|=1,ya(e,t,a,o),t.child)}function qI(e,t,a,n,r){if(Ii(t),t.stateNode===null){var o=Hs,i=a.contextType;typeof i=="object"&&i!==null&&(o=xa(i)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=ky,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},dw(t),i=a.contextType,o.context=typeof i=="object"&&i!==null?xa(i):Hs,o.state=t.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(_g(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&&ky.enqueueReplaceState(o,o.state,null),ju(t,n,o,r),Hu(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){o=t.stateNode;var s=t.memoizedProps,l=Ti(a,s);o.props=l;var u=o.context,c=a.contextType;i=Hs,typeof c=="object"&&c!==null&&(i=xa(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=t.pendingProps!==s,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||u!==i)&&PI(t,o,n,i),mo=!1;var p=t.memoizedState;o.state=p,ju(t,n,o,r),Hu(),u=t.memoizedState,s||p!==u||mo?(typeof d=="function"&&(_g(t,a,d,n),u=t.memoizedState),(l=mo||_I(t,a,l,n,p,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=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,wy(e,t),i=t.memoizedProps,c=Ti(a,i),o.props=c,d=t.pendingProps,p=o.context,u=a.contextType,l=Hs,typeof u=="object"&&u!==null&&(l=xa(u)),s=a.getDerivedStateFromProps,(u=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||p!==l)&&PI(t,o,n,l),mo=!1,p=t.memoizedState,o.state=p,ju(t,n,o,r),Hu();var m=t.memoizedState;i!==d||p!==m||mo||e!==null&&e.dependencies!==null&&tp(e.dependencies)?(typeof s=="function"&&(_g(t,a,s,n),m=t.memoizedState),(c=mo||_I(t,a,c,n,p,m,l)||e!==null&&e.dependencies!==null&&tp(e.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=m),o.props=n,o.state=m,o.context=l,n=c):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),n=!1)}return o=n,qf(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=Ci(t,e.child,null,r),t.child=Ci(t,null,a,r)):ya(e,t,a,r),t.memoizedState=o.state,e=t.child):e=jr(e,t,r),e}function HI(e,t,a,n){return Si(),t.flags|=256,ya(e,t,a,n),t.child}var Pg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Og(e){return{baseLanes:e,cachePool:fk()}}function Ng(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=cn),e}function rT(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:(Yt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ze){if(r?go(t):yo(t),(e=Tt)?(e=KT(e,Rn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_o!==null?{id:sr,overflow:lr}:null,retryLane:536870912,hydrationErrors:null},a=lk(e),a.return=t,t.child=a,va=t,Tt=null)):e=null,e===null)throw Po(t);return qy(e)?t.lanes=32:t.lanes=536870912,null}var s=n.children;return n=n.fallback,r?(yo(t),r=t.mode,s=lp({mode:"hidden",children:s},r),n=wi(n,r,a,null),s.return=t,n.return=t,s.sibling=n,t.child=s,n=t.child,n.memoizedState=Og(a),n.childLanes=Ng(e,i,a),t.memoizedState=Pg,Ou(null,n)):(go(t),Ey(t,s))}var l=e.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)t.flags&256?(go(t),t.flags&=-257,t=Ug(e,t,a)):t.memoizedState!==null?(yo(t),t.child=e.child,t.flags|=128,t=null):(yo(t),s=n.fallback,r=t.mode,n=lp({mode:"visible",children:n.children},r),s=wi(s,r,a,null),s.flags|=2,n.return=t,s.return=t,n.sibling=s,t.child=n,Ci(t,e.child,null,a),n=t.child,n.memoizedState=Og(a),n.childLanes=Ng(e,i,a),t.memoizedState=Pg,t=Ou(null,n));else if(go(t),qy(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,n=Error(z(419)),n.stack="",n.digest=i,tc({value:n,source:null,stack:null}),t=Ug(e,t,a)}else if(ra||fl(e,t,a,!1),i=(a&e.childLanes)!==0,ra||i){if(i=vt,i!==null&&(n=PC(i,a),n!==0&&n!==l.retryLane))throw l.retryLane=n,Mi(e,n),Ga(i,e,n),Tw;Fy(s)||fp(),t=Ug(e,t,a)}else Fy(s)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Tt=_n(s.nextSibling),va=t,Ze=!0,ko=null,Rn=!1,e!==null&&ck(t,e),t=Ey(t,n.children),t.flags|=4096);return t}return r?(yo(t),s=n.fallback,r=t.mode,l=e.child,u=l.sibling,n=Ur(l,{mode:"hidden",children:n.children}),n.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=Ur(u,s):(s=wi(s,r,a,null),s.flags|=2),s.return=t,n.return=t,n.sibling=s,t.child=n,Ou(null,n),n=t.child,s=e.child.memoizedState,s===null?s=Og(a):(r=s.cachePool,r!==null?(l=na._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=fk(),s={baseLanes:s.baseLanes|a,cachePool:r}),n.memoizedState=s,n.childLanes=Ng(e,i,a),t.memoizedState=Pg,Ou(e.child,n)):(go(t),a=e.child,e=a.sibling,a=Ur(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 Ey(e,t){return t=lp({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function lp(e,t){return e=un(22,e,null,t),e.lanes=0,e}function Ug(e,t,a){return Ci(t,e.child,null,a),e=Ey(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jI(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),hy(e.return,t,a)}function Bg(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 oT(e,t,a){var n=t.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=Yt.current,s=(i&2)!==0;if(s?(i=i&1|2,t.flags|=128):i&=1,St(Yt,i),ya(e,t,n,a),n=Ze?ec:0,!s&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jI(e,a,t);else if(e.tag===19)jI(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&&rp(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),Bg(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&&rp(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}Bg(t,!0,a,null,o,n);break;case"together":Bg(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function jr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),No|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(fl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(z(153));if(t.child!==null){for(e=t.child,a=Ur(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ur(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Lw(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&tp(e)))}function yF(e,t,a){switch(t.tag){case 3:Xf(t,t.stateNode.containerInfo),ho(t,na,e.memoizedState.cache),Si();break;case 27:case 5:ay(t);break;case 4:Xf(t,t.stateNode.containerInfo);break;case 10:ho(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,by(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(go(t),t.flags|=128,null):(a&t.child.childLanes)!==0?rT(e,t,a):(go(t),e=jr(e,t,a),e!==null?e.sibling:null);go(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(fl(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return oT(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),St(Yt,Yt.current),n)break;return null;case 22:return t.lanes=0,nT(e,t,a,t.pendingProps);case 24:ho(t,na,e.memoizedState.cache)}return jr(e,t,a)}function iT(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ra=!0;else{if(!Lw(e,a)&&(t.flags&128)===0)return ra=!1,yF(e,t,a);ra=(e.flags&131072)!==0}else ra=!1,Ze&&(t.flags&1048576)!==0&&uk(t,ec,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=hi(t.elementType),t.type=e,typeof e=="function")ow(e)?(n=Ti(e,n),t.tag=1,t=qI(null,t,e,n,a)):(t.tag=0,t=Ly(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===$y){t.tag=11,t=NI(null,t,e,n,a);break e}else if(r===Wy){t.tag=14,t=UI(null,t,e,n,a);break e}}throw t=ey(e)||e,Error(z(306,t,""))}}return t;case 0:return Ly(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=Ti(n,t.pendingProps),qI(e,t,n,r,a);case 3:e:{if(Xf(t,t.stateNode.containerInfo),e===null)throw Error(z(387));n=t.pendingProps;var o=t.memoizedState;r=o.element,wy(e,t),ju(t,n,null,a);var i=t.memoizedState;if(n=i.cache,ho(t,na,n),n!==o.cache&&gy(t,[na],a,!0),Hu(),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=HI(e,t,n,a);break e}else if(n!==r){r=Mn(Error(z(424)),t),tc(r),t=HI(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,Tt=_n(e.firstChild),va=t,Ze=!0,ko=null,Rn=!0,a=hk(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Si(),n===r){t=jr(e,t,a);break e}ya(e,t,n,a)}t=t.child}return t;case 26:return qf(e,t),e===null?(a=dC(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ze||(a=t.type,e=t.pendingProps,n=gp(Co.current).createElement(a),n[wa]=t,n[Xa]=e,ba(n,a,e),fa(n),t.stateNode=n):t.memoizedState=dC(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ay(t),e===null&&Ze&&(n=t.stateNode=YT(t.type,t.pendingProps,Co.current),va=t,Rn=!0,r=Tt,Bo(t.type)?(Hy=r,Tt=_n(n.firstChild)):Tt=r),ya(e,t,t.pendingProps.children,a),qf(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ze&&((r=n=Tt)&&(n=$F(n,t.type,t.pendingProps,Rn),n!==null?(t.stateNode=n,va=t,Tt=_n(n.firstChild),Rn=!1,r=!0):r=!1),r||Po(t)),ay(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,n=o.children,By(r,o)?n=null:i!==null&&By(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=mw(e,t,lF,null,null,a),sc._currentValue=r),qf(e,t),ya(e,t,n,a),t.child;case 6:return e===null&&Ze&&((e=a=Tt)&&(a=WF(a,t.pendingProps,Rn),a!==null?(t.stateNode=a,va=t,Tt=null,e=!0):e=!1),e||Po(t)),null;case 13:return rT(e,t,a);case 4:return Xf(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ci(t,null,n,a):ya(e,t,n,a),t.child;case 11:return NI(e,t,t.type,t.pendingProps,a);case 7:return ya(e,t,t.pendingProps,a),t.child;case 8:return ya(e,t,t.pendingProps.children,a),t.child;case 12:return ya(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,ho(t,t.type,n.value),ya(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,Ii(t),r=xa(r),n=n(r),t.flags|=1,ya(e,t,n,a),t.child;case 14:return UI(e,t,t.type,t.pendingProps,a);case 15:return aT(e,t,t.type,t.pendingProps,a);case 19:return oT(e,t,a);case 31:return gF(e,t,a);case 22:return nT(e,t,a,t.pendingProps);case 24:return Ii(t),n=xa(na),e===null?(r=uw(),r===null&&(r=vt,o=lw(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:n,cache:r},dw(t),ho(t,na,r)):((e.lanes&a)!==0&&(wy(e,t),ju(t,null,null,a),Hu()),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),ho(t,na,n)):(n=o.cache,ho(t,na,n),n!==r.cache&&gy(t,[na],a,!0))),ya(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(z(156,t.tag))}function Er(e){e.flags|=4}function zg(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(MT())e.flags|=8192;else throw xi=ap,cw}else e.flags&=-16777217}function VI(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!QT(t))if(MT())e.flags|=8192;else throw xi=ap,cw}function kf(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?RC():536870912,e.lanes|=t,ol|=t)}function Eu(e,t){if(!Ze)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 kt(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 wF(e,t,a){var n=t.pendingProps;switch(sw(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(t),null;case 1:return kt(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Br(na),Qs(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ms(t)?Er(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Mg())),kt(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?(Er(t),o!==null?(kt(t),VI(t,o)):(kt(t),zg(t,r,null,n,a))):o?o!==e.memoizedState?(Er(t),kt(t),VI(t,o)):(kt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Er(t),kt(t),zg(t,r,e,n,a)),null;case 27:if(Kf(t),a=Co.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Er(t);else{if(!n){if(t.stateNode===null)throw Error(z(166));return kt(t),null}e=cr.current,Ms(t)?vI(t,e):(e=YT(r,n,a),t.stateNode=e,Er(t))}return kt(t),null;case 5:if(Kf(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Er(t);else{if(!n){if(t.stateNode===null)throw Error(z(166));return kt(t),null}if(o=cr.current,Ms(t))vI(t,o);else{var i=gp(Co.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[wa]=t,o[Xa]=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(ba(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&&Er(t)}}return kt(t),zg(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Er(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(z(166));if(e=Co.current,Ms(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=va,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[wa]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||WT(e.nodeValue,a)),e||Po(t,!0)}else e=gp(e).createTextNode(n),e[wa]=t,t.stateNode=e}return kt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Ms(t),a!==null){if(e===null){if(!n)throw Error(z(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(557));e[wa]=t}else Si(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;kt(t),e=!1}else a=Mg(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ln(t),t):(ln(t),null);if((t.flags&128)!==0)throw Error(z(558))}return kt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Ms(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(z(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(z(317));r[wa]=t}else Si(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;kt(t),r=!1}else r=Mg(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ln(t),t):(ln(t),null)}return ln(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),kf(t,t.updateQueue),kt(t),null);case 4:return Qs(),e===null&&Pw(t.stateNode.containerInfo),kt(t),null;case 10:return Br(t.type),kt(t),null;case 19:if(pa(Yt),n=t.memoizedState,n===null)return kt(t),null;if(r=(t.flags&128)!==0,o=n.rendering,o===null)if(r)Eu(n,!1);else{if(jt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=rp(e),o!==null){for(t.flags|=128,Eu(n,!1),e=o.updateQueue,t.updateQueue=e,kf(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)sk(a,e),a=a.sibling;return St(Yt,Yt.current&1|2),Ze&&Dr(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&dn()>cp&&(t.flags|=128,r=!0,Eu(n,!1),t.lanes=4194304)}else{if(!r)if(e=rp(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,kf(t,e),Eu(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!Ze)return kt(t),null}else 2*dn()-n.renderingStartTime>cp&&a!==536870912&&(t.flags|=128,r=!0,Eu(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=dn(),e.sibling=null,a=Yt.current,St(Yt,r?a&1|2:a&1),Ze&&Dr(t,n.treeForkCount),e):(kt(t),null);case 22:case 23:return ln(t),fw(),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&&(kt(t),t.subtreeFlags&6&&(t.flags|=8192)):kt(t),a=t.updateQueue,a!==null&&kf(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&&pa(vi),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Br(na),kt(t),null;case 25:return null;case 30:return null}throw Error(z(156,t.tag))}function vF(e,t){switch(sw(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Br(na),Qs(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Kf(t),null;case 31:if(t.memoizedState!==null){if(ln(t),t.alternate===null)throw Error(z(340));Si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ln(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));Si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pa(Yt),null;case 4:return Qs(),null;case 10:return Br(t.type),null;case 22:case 23:return ln(t),fw(),e!==null&&pa(vi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Br(na),null;case 25:return null;default:return null}}function sT(e,t){switch(sw(t),t.tag){case 3:Br(na),Qs();break;case 26:case 27:case 5:Kf(t);break;case 4:Qs();break;case 31:t.memoizedState!==null&&ln(t);break;case 13:ln(t);break;case 19:pa(Yt);break;case 10:Br(t.type);break;case 22:case 23:ln(t),fw(),e!==null&&pa(vi);break;case 24:Br(na)}}function wc(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(s){ft(t,t.return,s)}}function Oo(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,s=i.destroy;if(s!==void 0){i.destroy=void 0,r=t;var l=a,u=s;try{u()}catch(c){ft(r,l,c)}}}n=n.next}while(n!==o)}}catch(c){ft(t,t.return,c)}}function lT(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{yk(t,a)}catch(n){ft(e,e.return,n)}}}function uT(e,t,a){a.props=Ti(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){ft(e,t,n)}}function $u(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){ft(e,t,r)}}function ur(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){ft(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){ft(e,t,r)}else a.current=null}function cT(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){ft(e,e.return,r)}}function Fg(e,t,a){try{var n=e.stateNode;zF(n,e.type,a,t),n[Xa]=t}catch(r){ft(e,e.return,r)}}function dT(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Bo(e.type)||e.tag===4}function qg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dT(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&&Bo(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 Ay(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=Or));else if(n!==4&&(n===27&&Bo(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Ay(e,t,a),e=e.sibling;e!==null;)Ay(e,t,a),e=e.sibling}function up(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&&Bo(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(up(e,t,a),e=e.sibling;e!==null;)up(e,t,a),e=e.sibling}function fT(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);ba(t,n,a),t[wa]=e,t[Xa]=a}catch(o){ft(e,e.return,o)}}var _r=!1,aa=!1,Hg=!1,$I=typeof WeakSet=="function"?WeakSet:Set,da=null;function xF(e,t){if(e=e.containerInfo,Ny=xp,e=QC(e),aw(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,s=-1,l=-1,u=0,c=0,d=e,p=null;t:for(;;){for(var m;d!==a||r!==0&&d.nodeType!==3||(s=i+r),d!==o||n!==0&&d.nodeType!==3||(l=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===e)break t;if(p===a&&++u===r&&(s=i),p===o&&++c===n&&(l=i),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}a=s===-1||l===-1?null:{start:s,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(Uy={focusedElem:e,selectionRange:a},xp=!1,da=t;da!==null;)if(t=da,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,da=e;else for(;da!==null;){switch(t=da,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 h=Ti(a.type,r);e=n.getSnapshotBeforeUpdate(h,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(v){ft(a,a.return,v)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)zy(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":zy(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(z(163))}if(e=t.sibling,e!==null){e.return=t.return,da=e;break}da=t.return}}function pT(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Mr(e,a),n&4&&wc(5,a);break;case 1:if(Mr(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(i){ft(a,a.return,i)}else{var r=Ti(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){ft(a,a.return,i)}}n&64&&lT(a),n&512&&$u(a,a.return);break;case 3:if(Mr(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{yk(e,t)}catch(i){ft(a,a.return,i)}}break;case 27:t===null&&n&4&&fT(a);case 26:case 5:Mr(e,a),t===null&&n&4&&cT(a),n&512&&$u(a,a.return);break;case 12:Mr(e,a);break;case 31:Mr(e,a),n&4&&gT(e,a);break;case 13:Mr(e,a),n&4&&yT(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=AF.bind(null,a),GF(e,a))));break;case 22:if(n=a.memoizedState!==null||_r,!n){t=t!==null&&t.memoizedState!==null||aa,r=_r;var o=aa;_r=n,(aa=t)&&!o?Rr(e,a,(a.subtreeFlags&8772)!==0):Mr(e,a),_r=r,aa=o}break;case 30:break;default:Mr(e,a)}}function mT(e){var t=e.alternate;t!==null&&(e.alternate=null,mT(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Yy(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 Dt=null,$a=!1;function Ar(e,t,a){for(a=a.child;a!==null;)hT(e,t,a),a=a.sibling}function hT(e,t,a){if(fn&&typeof fn.onCommitFiberUnmount=="function")try{fn.onCommitFiberUnmount(dc,a)}catch{}switch(a.tag){case 26:aa||ur(a,t),Ar(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:aa||ur(a,t);var n=Dt,r=$a;Bo(a.type)&&(Dt=a.stateNode,$a=!1),Ar(e,t,a),Ku(a.stateNode),Dt=n,$a=r;break;case 5:aa||ur(a,t);case 6:if(n=Dt,r=$a,Dt=null,Ar(e,t,a),Dt=n,$a=r,Dt!==null)if($a)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(a.stateNode)}catch(o){ft(a,t,o)}else try{Dt.removeChild(a.stateNode)}catch(o){ft(a,t,o)}break;case 18:Dt!==null&&($a?(e=Dt,iC(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),ul(e)):iC(Dt,a.stateNode));break;case 4:n=Dt,r=$a,Dt=a.stateNode.containerInfo,$a=!0,Ar(e,t,a),Dt=n,$a=r;break;case 0:case 11:case 14:case 15:Oo(2,a,t),aa||Oo(4,a,t),Ar(e,t,a);break;case 1:aa||(ur(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&uT(a,t,n)),Ar(e,t,a);break;case 21:Ar(e,t,a);break;case 22:aa=(n=aa)||a.memoizedState!==null,Ar(e,t,a),aa=n;break;default:Ar(e,t,a)}}function gT(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ul(e)}catch(a){ft(t,t.return,a)}}}function yT(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ul(e)}catch(a){ft(t,t.return,a)}}function bF(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $I),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $I),t;default:throw Error(z(435,e.tag))}}function Tf(e,t){var a=bF(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=MF.bind(null,e,n);n.then(r,r)}})}function ja(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,s=i;e:for(;s!==null;){switch(s.tag){case 27:if(Bo(s.type)){Dt=s.stateNode,$a=!1;break e}break;case 5:Dt=s.stateNode,$a=!1;break e;case 3:case 4:Dt=s.stateNode.containerInfo,$a=!0;break e}s=s.return}if(Dt===null)throw Error(z(160));hT(o,i,r),Dt=null,$a=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wT(t,e),t=t.sibling}var Wn=null;function wT(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ja(t,e),Va(e),n&4&&(Oo(3,e,e.return),wc(3,e),Oo(5,e,e.return));break;case 1:ja(t,e),Va(e),n&512&&(aa||a===null||ur(a,a.return)),n&64&&_r&&(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=Wn;if(ja(t,e),Va(e),n&512&&(aa||a===null||ur(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[mc]||o[wa]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),ba(o,n,a),o[wa]=e,fa(o),n=o;break e;case"link":var i=pC("link","href",r).get(n+(a.href||""));if(i){for(var s=0;s<i.length;s++)if(o=i[s],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(s,1);break t}}o=r.createElement(n),ba(o,n,a),r.head.appendChild(o);break;case"meta":if(i=pC("meta","content",r).get(n+(a.content||""))){for(s=0;s<i.length;s++)if(o=i[s],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(s,1);break t}}o=r.createElement(n),ba(o,n,a),r.head.appendChild(o);break;default:throw Error(z(468,n))}o[wa]=e,fa(o),n=o}e.stateNode=n}else mC(r,e.type,e.stateNode);else e.stateNode=fC(r,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?mC(r,e.type,e.stateNode):fC(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Fg(e,e.memoizedProps,a.memoizedProps)}break;case 27:ja(t,e),Va(e),n&512&&(aa||a===null||ur(a,a.return)),a!==null&&n&4&&Fg(e,e.memoizedProps,a.memoizedProps);break;case 5:if(ja(t,e),Va(e),n&512&&(aa||a===null||ur(a,a.return)),e.flags&32){r=e.stateNode;try{tl(r,"")}catch(h){ft(e,e.return,h)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,Fg(e,r,a!==null?a.memoizedProps:r)),n&1024&&(Hg=!0);break;case 6:if(ja(t,e),Va(e),n&4){if(e.stateNode===null)throw Error(z(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(h){ft(e,e.return,h)}}break;case 3:if(Vf=null,r=Wn,Wn=yp(t.containerInfo),ja(t,e),Wn=r,Va(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{ul(t.containerInfo)}catch(h){ft(e,e.return,h)}Hg&&(Hg=!1,vT(e));break;case 4:n=Wn,Wn=yp(e.stateNode.containerInfo),ja(t,e),Va(e),Wn=n;break;case 12:ja(t,e),Va(e);break;case 31:ja(t,e),Va(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Tf(e,n)));break;case 13:ja(t,e),Va(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(_p=dn()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Tf(e,n)));break;case 22:r=e.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=_r,c=aa;if(_r=u||r,aa=c||l,ja(t,e),aa=c,_r=u,Va(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||l||_r||aa||gi(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){l=a=t;try{if(o=l.stateNode,r)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,p=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(h){ft(l,l.return,h)}}}else if(t.tag===6){if(a===null){l=t;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(h){ft(l,l.return,h)}}}else if(t.tag===18){if(a===null){l=t;try{var m=l.stateNode;r?sC(m,!0):sC(l.stateNode,!1)}catch(h){ft(l,l.return,h)}}}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,Tf(e,a))));break;case 19:ja(t,e),Va(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Tf(e,n)));break;case 30:break;case 21:break;default:ja(t,e),Va(e)}}function Va(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(dT(n)){a=n;break}n=n.return}if(a==null)throw Error(z(160));switch(a.tag){case 27:var r=a.stateNode,o=qg(e);up(e,o,r);break;case 5:var i=a.stateNode;a.flags&32&&(tl(i,""),a.flags&=-33);var s=qg(e);up(e,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=qg(e);Ay(e,u,l);break;default:throw Error(z(161))}}catch(c){ft(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vT(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vT(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Mr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pT(e,t.alternate,t),t=t.sibling}function gi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Oo(4,t,t.return),gi(t);break;case 1:ur(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&uT(t,t.return,a),gi(t);break;case 27:Ku(t.stateNode);case 26:case 5:ur(t,t.return),gi(t);break;case 22:t.memoizedState===null&&gi(t);break;case 30:gi(t);break;default:gi(t)}e=e.sibling}}function Rr(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:Rr(r,o,a),wc(4,o);break;case 1:if(Rr(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){ft(n,n.return,u)}if(n=o,r=n.updateQueue,r!==null){var s=n.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)gk(l[r],s)}catch(u){ft(n,n.return,u)}}a&&i&64&&lT(o),$u(o,o.return);break;case 27:fT(o);case 26:case 5:Rr(r,o,a),a&&n===null&&i&4&&cT(o),$u(o,o.return);break;case 12:Rr(r,o,a);break;case 31:Rr(r,o,a),a&&i&4&&gT(r,o);break;case 13:Rr(r,o,a),a&&i&4&&yT(r,o);break;case 22:o.memoizedState===null&&Rr(r,o,a),$u(o,o.return);break;case 30:break;default:Rr(r,o,a)}t=t.sibling}}function Ew(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&&gc(a))}function Aw(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&gc(e))}function $n(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xT(e,t,a,n),t=t.sibling}function xT(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:$n(e,t,a,n),r&2048&&wc(9,t);break;case 1:$n(e,t,a,n);break;case 3:$n(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&&gc(e)));break;case 12:if(r&2048){$n(e,t,a,n),e=t.stateNode;try{var o=t.memoizedProps,i=o.id,s=o.onPostCommit;typeof s=="function"&&s(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){ft(t,t.return,l)}}else $n(e,t,a,n);break;case 31:$n(e,t,a,n);break;case 13:$n(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,t.memoizedState!==null?o._visibility&2?$n(e,t,a,n):Wu(e,t):o._visibility&2?$n(e,t,a,n):(o._visibility|=2,Ds(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Ew(i,t);break;case 24:$n(e,t,a,n),r&2048&&Aw(t.alternate,t);break;default:$n(e,t,a,n)}}function Ds(e,t,a,n,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,i=t,s=a,l=n,u=i.flags;switch(i.tag){case 0:case 11:case 15:Ds(o,i,s,l,r),wc(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?Ds(o,i,s,l,r):Wu(o,i):(c._visibility|=2,Ds(o,i,s,l,r)),r&&u&2048&&Ew(i.alternate,i);break;case 24:Ds(o,i,s,l,r),r&&u&2048&&Aw(i.alternate,i);break;default:Ds(o,i,s,l,r)}t=t.sibling}}function Wu(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:Wu(a,n),r&2048&&Ew(n.alternate,n);break;case 24:Wu(a,n),r&2048&&Aw(n.alternate,n);break;default:Wu(a,n)}t=t.sibling}}var Nu=8192;function Rs(e,t,a){if(e.subtreeFlags&Nu)for(e=e.child;e!==null;)bT(e,t,a),e=e.sibling}function bT(e,t,a){switch(e.tag){case 26:Rs(e,t,a),e.flags&Nu&&e.memoizedState!==null&&oq(a,Wn,e.memoizedState,e.memoizedProps);break;case 5:Rs(e,t,a);break;case 3:case 4:var n=Wn;Wn=yp(e.stateNode.containerInfo),Rs(e,t,a),Wn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Nu,Nu=16777216,Rs(e,t,a),Nu=n):Rs(e,t,a));break;default:Rs(e,t,a)}}function ST(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 Au(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];da=n,CT(n,e)}ST(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)IT(e),e=e.sibling}function IT(e){switch(e.tag){case 0:case 11:case 15:Au(e),e.flags&2048&&Oo(9,e,e.return);break;case 3:Au(e);break;case 12:Au(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Hf(e)):Au(e);break;default:Au(e)}}function Hf(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];da=n,CT(n,e)}ST(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Oo(8,t,t.return),Hf(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Hf(t));break;default:Hf(t)}e=e.sibling}}function CT(e,t){for(;da!==null;){var a=da;switch(a.tag){case 0:case 11:case 15:Oo(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:gc(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,da=n;else e:for(a=e;da!==null;){n=da;var r=n.sibling,o=n.return;if(mT(n),n===a){da=null;break e}if(r!==null){r.return=o,da=r;break e}da=o}}}var SF={getCacheForType:function(e){var t=xa(na),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return xa(na).controller.signal}},IF=typeof WeakMap=="function"?WeakMap:Map,st=0,vt=null,Xe=null,Ke=0,dt=0,sn=null,bo=!1,ml=!1,Mw=!1,Vr=0,jt=0,No=0,bi=0,Rw=0,cn=0,ol=0,Gu=null,Wa=null,My=!1,_p=0,kT=0,cp=1/0,dp=null,Eo=null,ia=0,Ao=null,il=null,zr=0,Ry=0,Dy=null,TT=null,Xu=0,_y=null;function mn(){return(st&2)!==0&&Ke!==0?Ke&-Ke:Te.T!==null?_w():OC()}function LT(){if(cn===0)if((Ke&536870912)===0||Ze){var e=gf;gf<<=1,(gf&3932160)===0&&(gf=262144),cn=e}else cn=536870912;return e=gn.current,e!==null&&(e.flags|=32),cn}function Ga(e,t,a){(e===vt&&(dt===2||dt===9)||e.cancelPendingCommit!==null)&&(sl(e,0),So(e,Ke,cn,!1)),pc(e,a),((st&2)===0||e!==vt)&&(e===vt&&((st&2)===0&&(bi|=a),jt===4&&So(e,Ke,cn,!1)),fr(e))}function ET(e,t,a){if((st&6)!==0)throw Error(z(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||fc(e,t),r=n?TF(e,t):jg(e,t,!0),o=n;do{if(r===0){ml&&!n&&So(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!CF(a)){r=jg(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 s=e;r=Gu;var l=s.current.memoizedState.isDehydrated;if(l&&(sl(s,i).flags|=256),i=jg(s,i,!1),i!==2){if(Mw&&!l){s.errorRecoveryDisabledLanes|=o,bi|=o,r=4;break e}o=Wa,Wa=r,o!==null&&(Wa===null?Wa=o:Wa.push.apply(Wa,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){sl(e,0),So(e,t,0,!0);break}e:{switch(n=e,o=r,o){case 0:case 1:throw Error(z(345));case 4:if((t&4194048)!==t)break;case 6:So(n,t,cn,!bo);break e;case 2:Wa=null;break;case 3:case 5:break;default:throw Error(z(329))}if((t&62914560)===t&&(r=_p+300-dn(),10<r)){if(So(n,t,cn,!bo),Sp(n,0,!0)!==0)break e;zr=t,n.timeoutHandle=XT(WI.bind(null,n,a,Wa,dp,My,t,cn,bi,ol,bo,o,"Throttled",-0,0),r);break e}WI(n,a,Wa,dp,My,t,cn,bi,ol,bo,o,null,-0,0)}}break}while(!0);fr(e)}function WI(e,t,a,n,r,o,i,s,l,u,c,d,p,m){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:Or},bT(t,o,d);var h=(o&62914560)===o?_p-dn():(o&4194048)===o?kT-dn():0;if(h=iq(d,h),h!==null){zr=o,e.cancelPendingCommit=h(XI.bind(null,e,t,o,a,n,r,i,s,l,c,d,null,p,m)),So(e,o,i,!u);return}}XI(e,t,o,a,n,r,i,s,l)}function CF(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(!hn(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 So(e,t,a,n){t&=~Rw,t&=~bi,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var o=31-pn(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&DC(e,a,t)}function Pp(){return(st&6)===0?(vc(0,!1),!1):!0}function Dw(){if(Xe!==null){if(dt===0)var e=Xe.return;else e=Xe,Nr=Ri=null,yw(e),Ys=null,ac=0,e=Xe;for(;e!==null;)sT(e.alternate,e),e=e.return;Xe=null}}function sl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,HF(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),zr=0,Dw(),vt=e,Xe=a=Ur(e.current,null),Ke=t,dt=0,sn=null,bo=!1,ml=fc(e,t),Mw=!1,ol=cn=Rw=bi=No=jt=0,Wa=Gu=null,My=!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-pn(n),o=1<<r;t|=e[r],n&=~o}return Vr=t,Tp(),a}function AT(e,t){Pe=null,Te.H=rc,t===pl||t===Ep?(t=CI(),dt=3):t===cw?(t=CI(),dt=4):dt=t===Tw?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,sn=t,Xe===null&&(jt=1,sp(e,Mn(t,e.current)))}function MT(){var e=gn.current;return e===null?!0:(Ke&4194048)===Ke?Dn===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===Dn:!1}function RT(){var e=Te.H;return Te.H=rc,e===null?rc:e}function DT(){var e=Te.A;return Te.A=SF,e}function fp(){jt=4,bo||(Ke&4194048)!==Ke&&gn.current!==null||(ml=!0),(No&134217727)===0&&(bi&134217727)===0||vt===null||So(vt,Ke,cn,!1)}function jg(e,t,a){var n=st;st|=2;var r=RT(),o=DT();(vt!==e||Ke!==t)&&(dp=null,sl(e,t)),t=!1;var i=jt;e:do try{if(dt!==0&&Xe!==null){var s=Xe,l=sn;switch(dt){case 8:Dw(),i=6;break e;case 3:case 2:case 9:case 6:gn.current===null&&(t=!0);var u=dt;if(dt=0,sn=null,$s(e,s,l,u),a&&ml){i=0;break e}break;default:u=dt,dt=0,sn=null,$s(e,s,l,u)}}kF(),i=jt;break}catch(c){AT(e,c)}while(!0);return t&&e.shellSuspendCounter++,Nr=Ri=null,st=n,Te.H=r,Te.A=o,Xe===null&&(vt=null,Ke=0,Tp()),i}function kF(){for(;Xe!==null;)_T(Xe)}function TF(e,t){var a=st;st|=2;var n=RT(),r=DT();vt!==e||Ke!==t?(dp=null,cp=dn()+500,sl(e,t)):ml=fc(e,t);e:do try{if(dt!==0&&Xe!==null){t=Xe;var o=sn;t:switch(dt){case 1:dt=0,sn=null,$s(e,t,o,1);break;case 2:case 9:if(II(o)){dt=0,sn=null,GI(t);break}t=function(){dt!==2&&dt!==9||vt!==e||(dt=7),fr(e)},o.then(t,t);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:II(o)?(dt=0,sn=null,GI(t)):(dt=0,sn=null,$s(e,t,o,7));break;case 5:var i=null;switch(Xe.tag){case 26:i=Xe.memoizedState;case 5:case 27:var s=Xe;if(i?QT(i):s.stateNode.complete){dt=0,sn=null;var l=s.sibling;if(l!==null)Xe=l;else{var u=s.return;u!==null?(Xe=u,Op(u)):Xe=null}break t}}dt=0,sn=null,$s(e,t,o,5);break;case 6:dt=0,sn=null,$s(e,t,o,6);break;case 8:Dw(),jt=6;break e;default:throw Error(z(462))}}LF();break}catch(c){AT(e,c)}while(!0);return Nr=Ri=null,Te.H=n,Te.A=r,st=a,Xe!==null?0:(vt=null,Ke=0,Tp(),jt)}function LF(){for(;Xe!==null&&!Y3();)_T(Xe)}function _T(e){var t=iT(e.alternate,e,Vr);e.memoizedProps=e.pendingProps,t===null?Op(e):Xe=t}function GI(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=FI(a,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=FI(a,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:yw(t);default:sT(a,t),t=Xe=sk(t,Vr),t=iT(a,t,Vr)}e.memoizedProps=e.pendingProps,t===null?Op(e):Xe=t}function $s(e,t,a,n){Nr=Ri=null,yw(t),Ys=null,ac=0;var r=t.return;try{if(hF(e,r,t,a,Ke)){jt=1,sp(e,Mn(a,e.current)),Xe=null;return}}catch(o){if(r!==null)throw Xe=r,o;jt=1,sp(e,Mn(a,e.current)),Xe=null;return}t.flags&32768?(Ze||n===1?e=!0:ml||(Ke&536870912)!==0?e=!1:(bo=e=!0,(n===2||n===9||n===3||n===6)&&(n=gn.current,n!==null&&n.tag===13&&(n.flags|=16384))),PT(t,e)):Op(t)}function Op(e){var t=e;do{if((t.flags&32768)!==0){PT(t,bo);return}e=t.return;var a=wF(t.alternate,t,Vr);if(a!==null){Xe=a;return}if(t=t.sibling,t!==null){Xe=t;return}Xe=t=e}while(t!==null);jt===0&&(jt=5)}function PT(e,t){do{var a=vF(e.alternate,e);if(a!==null){a.flags&=32767,Xe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Xe=e;return}Xe=e=a}while(e!==null);jt=6,Xe=null}function XI(e,t,a,n,r,o,i,s,l){e.cancelPendingCommit=null;do Np();while(ia!==0);if((st&6)!==0)throw Error(z(327));if(t!==null){if(t===e.current)throw Error(z(177));if(o=t.lanes|t.childLanes,o|=nw,iz(e,a,o,i,s,l),e===vt&&(Xe=vt=null,Ke=0),il=t,Ao=e,zr=a,Ry=o,Dy=r,TT=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,RF(Yf,function(){return zT(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=Te.T,Te.T=null,r=lt.p,lt.p=2,i=st,st|=4;try{xF(e,t,a)}finally{st=i,lt.p=r,Te.T=n}}ia=1,OT(),NT(),UT()}}function OT(){if(ia===1){ia=0;var e=Ao,t=il,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=Te.T,Te.T=null;var n=lt.p;lt.p=2;var r=st;st|=4;try{wT(t,e);var o=Uy,i=QC(e.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&JC(s.ownerDocument.documentElement,s)){if(l!==null&&aw(s)){var u=l.start,c=l.end;if(c===void 0&&(c=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(c,s.value.length);else{var d=s.ownerDocument||document,p=d&&d.defaultView||window;if(p.getSelection){var m=p.getSelection(),h=s.textContent.length,v=Math.min(l.start,h),I=l.end===void 0?v:Math.min(l.end,h);!m.extend&&v>I&&(i=I,I=v,v=i);var y=gI(s,v),w=gI(s,I);if(y&&w&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var g=d.createRange();g.setStart(y.node,y.offset),m.removeAllRanges(),v>I?(m.addRange(g),m.extend(w.node,w.offset)):(g.setEnd(w.node,w.offset),m.addRange(g))}}}}for(d=[],m=s;m=m.parentNode;)m.nodeType===1&&d.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<d.length;s++){var S=d[s];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}xp=!!Ny,Uy=Ny=null}finally{st=r,lt.p=n,Te.T=a}}e.current=t,ia=2}}function NT(){if(ia===2){ia=0;var e=Ao,t=il,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=Te.T,Te.T=null;var n=lt.p;lt.p=2;var r=st;st|=4;try{pT(e,t.alternate,t)}finally{st=r,lt.p=n,Te.T=a}}ia=3}}function UT(){if(ia===4||ia===3){ia=0,Z3();var e=Ao,t=il,a=zr,n=TT;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ia=5:(ia=0,il=Ao=null,BT(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Eo=null),Ky(a),t=t.stateNode,fn&&typeof fn.onCommitFiberRoot=="function")try{fn.onCommitFiberRoot(dc,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=Te.T,r=lt.p,lt.p=2,Te.T=null;try{for(var o=e.onRecoverableError,i=0;i<n.length;i++){var s=n[i];o(s.value,{componentStack:s.stack})}}finally{Te.T=t,lt.p=r}}(zr&3)!==0&&Np(),fr(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===_y?Xu++:(Xu=0,_y=e):Xu=0,vc(0,!1)}}function BT(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,gc(t)))}function Np(){return OT(),NT(),UT(),zT()}function zT(){if(ia!==5)return!1;var e=Ao,t=Ry;Ry=0;var a=Ky(zr),n=Te.T,r=lt.p;try{lt.p=32>a?32:a,Te.T=null,a=Dy,Dy=null;var o=Ao,i=zr;if(ia=0,il=Ao=null,zr=0,(st&6)!==0)throw Error(z(331));var s=st;if(st|=4,IT(o.current),xT(o,o.current,i,a),st=s,vc(0,!1),fn&&typeof fn.onPostCommitFiberRoot=="function")try{fn.onPostCommitFiberRoot(dc,o)}catch{}return!0}finally{lt.p=r,Te.T=n,BT(e,t)}}function KI(e,t,a){t=Mn(a,t),t=Ty(e.stateNode,t,2),e=Lo(e,t,2),e!==null&&(pc(e,2),fr(e))}function ft(e,t,a){if(e.tag===3)KI(e,e,a);else for(;t!==null;){if(t.tag===3){KI(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Eo===null||!Eo.has(n))){e=Mn(a,e),a=eT(2),n=Lo(t,a,2),n!==null&&(tT(a,n,t,e),pc(n,2),fr(n));break}}t=t.return}}function Vg(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new IF;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)||(Mw=!0,r.add(a),e=EF.bind(null,e,t,a),t.then(e,e))}function EF(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,vt===e&&(Ke&a)===a&&(jt===4||jt===3&&(Ke&62914560)===Ke&&300>dn()-_p?(st&2)===0&&sl(e,0):Rw|=a,ol===Ke&&(ol=0)),fr(e)}function FT(e,t){t===0&&(t=RC()),e=Mi(e,t),e!==null&&(pc(e,t),fr(e))}function AF(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),FT(e,a)}function MF(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(z(314))}n!==null&&n.delete(t),FT(e,a)}function RF(e,t){return Gy(e,t)}var pp=null,_s=null,Py=!1,mp=!1,$g=!1,Io=0;function fr(e){e!==_s&&e.next===null&&(_s===null?pp=_s=e:_s=_s.next=e),mp=!0,Py||(Py=!0,_F())}function vc(e,t){if(!$g&&mp){$g=!0;do for(var a=!1,n=pp;n!==null;){if(!t)if(e!==0){var r=n.pendingLanes;if(r===0)var o=0;else{var i=n.suspendedLanes,s=n.pingedLanes;o=(1<<31-pn(42|e)+1)-1,o&=r&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,YI(n,o))}else o=Ke,o=Sp(n,n===vt?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||fc(n,o)||(a=!0,YI(n,o));n=n.next}while(a);$g=!1}}function DF(){qT()}function qT(){mp=Py=!1;var e=0;Io!==0&&qF()&&(e=Io);for(var t=dn(),a=null,n=pp;n!==null;){var r=n.next,o=HT(n,t);o===0?(n.next=null,a===null?pp=r:a.next=r,r===null&&(_s=a)):(a=n,(e!==0||(o&3)!==0)&&(mp=!0)),n=r}ia!==0&&ia!==5||vc(e,!1),Io!==0&&(Io=0)}function HT(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var i=31-pn(o),s=1<<i,l=r[i];l===-1?((s&a)===0||(s&n)!==0)&&(r[i]=oz(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}if(t=vt,a=Ke,a=Sp(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(dt===2||dt===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&xg(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||fc(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&xg(n),Ky(a)){case 2:case 8:a=AC;break;case 32:a=Yf;break;case 268435456:a=MC;break;default:a=Yf}return n=jT.bind(null,e),a=Gy(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&xg(n),e.callbackPriority=2,e.callbackNode=null,2}function jT(e,t){if(ia!==0&&ia!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Np()&&e.callbackNode!==a)return null;var n=Ke;return n=Sp(e,e===vt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(ET(e,n,t),HT(e,dn()),e.callbackNode!=null&&e.callbackNode===a?jT.bind(null,e):null)}function YI(e,t){if(Np())return null;ET(e,t,!0)}function _F(){jF(function(){(st&6)!==0?Gy(EC,DF):qT()})}function _w(){if(Io===0){var e=al;e===0&&(e=hf,hf<<=1,(hf&261888)===0&&(hf=256)),Io=e}return Io}function ZI(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_f(""+e)}function JI(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 PF(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var o=ZI((r[Xa]||null).action),i=n.submitter;i&&(t=(t=i[Xa]||null)?ZI(t.formAction):i.getAttribute("formAction"),t!==null&&(o=t,i=null));var s=new Ip("action","action",null,n,r);e.push({event:s,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Io!==0){var l=i?JI(r,i):new FormData(r);Cy(a,{pending:!0,data:l,method:r.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?JI(r,i):new FormData(r),Cy(a,{pending:!0,data:l,method:r.method,action:o},o,l))},currentTarget:r}]})}}for(Lf=0;Lf<fy.length;Lf++)Ef=fy[Lf],QI=Ef.toLowerCase(),eC=Ef[0].toUpperCase()+Ef.slice(1),Gn(QI,"on"+eC);var Ef,QI,eC,Lf;Gn(tk,"onAnimationEnd");Gn(ak,"onAnimationIteration");Gn(nk,"onAnimationStart");Gn("dblclick","onDoubleClick");Gn("focusin","onFocus");Gn("focusout","onBlur");Gn(Jz,"onTransitionRun");Gn(Qz,"onTransitionStart");Gn(eF,"onTransitionCancel");Gn(rk,"onTransitionEnd");el("onMouseEnter",["mouseout","mouseover"]);el("onMouseLeave",["mouseout","mouseover"]);el("onPointerEnter",["pointerout","pointerover"]);el("onPointerLeave",["pointerout","pointerover"]);Li("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Li("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Li("onBeforeInput",["compositionend","keypress","textInput","paste"]);Li("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Li("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Li("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oc="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(" "),OF=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(oc));function VT(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 s=n[i],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=u;try{o(r)}catch(c){Jf(c)}r.currentTarget=null,o=l}else for(i=0;i<n.length;i++){if(s=n[i],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=u;try{o(r)}catch(c){Jf(c)}r.currentTarget=null,o=l}}}}function Ge(e,t){var a=t[ry];a===void 0&&(a=t[ry]=new Set);var n=e+"__bubble";a.has(n)||($T(t,e,2,!1),a.add(n))}function Wg(e,t,a){var n=0;t&&(n|=4),$T(a,e,n,t)}var Af="_reactListening"+Math.random().toString(36).slice(2);function Pw(e){if(!e[Af]){e[Af]=!0,NC.forEach(function(a){a!=="selectionchange"&&(OF.has(a)||Wg(a,!1,e),Wg(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Af]||(t[Af]=!0,Wg("selectionchange",!1,t))}}function $T(e,t,a,n){switch(r1(t)){case 2:var r=uq;break;case 8:r=cq;break;default:r=Bw}a=r.bind(null,t,a,e),r=void 0,!uy||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 Gg(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 s=n.stateNode.containerInfo;if(s===r)break;if(i===4)for(i=n.return;i!==null;){var l=i.tag;if((l===3||l===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;s!==null;){if(i=Ns(s),i===null)return;if(l=i.tag,l===5||l===6||l===26||l===27){n=o=i;continue e}s=s.parentNode}}n=n.return}VC(function(){var u=o,c=Jy(a),d=[];e:{var p=ok.get(e);if(p!==void 0){var m=Ip,h=e;switch(e){case"keypress":if(Of(a)===0)break e;case"keydown":case"keyup":m=Mz;break;case"focusin":h="focus",m=kg;break;case"focusout":h="blur",m=kg;break;case"beforeblur":case"afterblur":m=kg;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":m=sI;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=wz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=_z;break;case tk:case ak:case nk:m=bz;break;case rk:m=Oz;break;case"scroll":case"scrollend":m=gz;break;case"wheel":m=Uz;break;case"copy":case"cut":case"paste":m=Iz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=uI;break;case"toggle":case"beforetoggle":m=zz}var v=(t&4)!==0,I=!v&&(e==="scroll"||e==="scrollend"),y=v?p!==null?p+"Capture":null:p;v=[];for(var w=u,g;w!==null;){var S=w;if(g=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||g===null||y===null||(S=Zu(w,y),S!=null&&v.push(ic(w,S,g))),I)break;w=w.return}0<v.length&&(p=new m(p,h,null,a,c),d.push({event:p,listeners:v}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&a!==ly&&(h=a.relatedTarget||a.fromElement)&&(Ns(h)||h[cl]))break e;if((m||p)&&(p=c.window===c?c:(p=c.ownerDocument)?p.defaultView||p.parentWindow:window,m?(h=a.relatedTarget||a.toElement,m=u,h=h?Ns(h):null,h!==null&&(I=cc(h),v=h.tag,h!==I||v!==5&&v!==27&&v!==6)&&(h=null)):(m=null,h=u),m!==h)){if(v=sI,S="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(v=uI,S="onPointerLeave",y="onPointerEnter",w="pointer"),I=m==null?p:Pu(m),g=h==null?p:Pu(h),p=new v(S,w+"leave",m,a,c),p.target=I,p.relatedTarget=g,S=null,Ns(c)===u&&(v=new v(y,w+"enter",h,a,c),v.target=g,v.relatedTarget=I,S=v),I=S,m&&h)t:{for(v=NF,y=m,w=h,g=0,S=y;S;S=v(S))g++;S=0;for(var E=w;E;E=v(E))S++;for(;0<g-S;)y=v(y),g--;for(;0<S-g;)w=v(w),S--;for(;g--;){if(y===w||w!==null&&y===w.alternate){v=y;break t}y=v(y),w=v(w)}v=null}else v=null;m!==null&&tC(d,p,m,v,!1),h!==null&&I!==null&&tC(d,I,h,v,!0)}}e:{if(p=u?Pu(u):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var T=pI;else if(fI(p))if(YC)T=Kz;else{T=Gz;var R=Wz}else m=p.nodeName,!m||m.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?u&&Zy(u.elementType)&&(T=pI):T=Xz;if(T&&(T=T(e,u))){KC(d,T,a,c);break e}R&&R(e,p,u),e==="focusout"&&u&&p.type==="number"&&u.memoizedProps.value!=null&&sy(p,"number",p.value)}switch(R=u?Pu(u):window,e){case"focusin":(fI(R)||R.contentEditable==="true")&&(zs=R,cy=u,zu=null);break;case"focusout":zu=cy=zs=null;break;case"mousedown":dy=!0;break;case"contextmenu":case"mouseup":case"dragend":dy=!1,yI(d,a,c);break;case"selectionchange":if(Zz)break;case"keydown":case"keyup":yI(d,a,c)}var O;if(tw)e:{switch(e){case"compositionstart":var U="onCompositionStart";break e;case"compositionend":U="onCompositionEnd";break e;case"compositionupdate":U="onCompositionUpdate";break e}U=void 0}else Bs?GC(e,a)&&(U="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(U="onCompositionStart");U&&(WC&&a.locale!=="ko"&&(Bs||U!=="onCompositionStart"?U==="onCompositionEnd"&&Bs&&(O=$C()):(xo=c,Qy="value"in xo?xo.value:xo.textContent,Bs=!0)),R=hp(u,U),0<R.length&&(U=new lI(U,e,null,a,c),d.push({event:U,listeners:R}),O?U.data=O:(O=XC(a),O!==null&&(U.data=O)))),(O=qz?Hz(e,a):jz(e,a))&&(U=hp(u,"onBeforeInput"),0<U.length&&(R=new lI("onBeforeInput","beforeinput",null,a,c),d.push({event:R,listeners:U}),R.data=O)),PF(d,e,u,a,c)}VT(d,t)})}function ic(e,t,a){return{instance:e,listener:t,currentTarget:a}}function hp(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=Zu(e,a),r!=null&&n.unshift(ic(e,r,o)),r=Zu(e,t),r!=null&&n.push(ic(e,r,o))),e.tag===3)return n;e=e.return}return[]}function NF(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tC(e,t,a,n,r){for(var o=t._reactName,i=[];a!==null&&a!==n;){var s=a,l=s.alternate,u=s.stateNode;if(s=s.tag,l!==null&&l===n)break;s!==5&&s!==26&&s!==27||u===null||(l=u,r?(u=Zu(a,o),u!=null&&i.unshift(ic(a,u,l))):r||(u=Zu(a,o),u!=null&&i.push(ic(a,u,l)))),a=a.return}i.length!==0&&e.push({event:t,listeners:i})}var UF=/\r\n?/g,BF=/\u0000|\uFFFD/g;function aC(e){return(typeof e=="string"?e:""+e).replace(UF,`
|
|
9
|
+
`).replace(BF,"")}function WT(e,t){return t=aC(t),aC(e)===t}function gt(e,t,a,n,r,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||tl(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&tl(e,""+n);break;case"className":wf(e,"class",n);break;case"tabIndex":wf(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":wf(e,a,n);break;case"style":jC(e,n,o);break;case"data":if(t!=="object"){wf(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=_f(""+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"&>(e,t,"name",r.name,r,null),gt(e,t,"formEncType",r.formEncType,r,null),gt(e,t,"formMethod",r.formMethod,r,null),gt(e,t,"formTarget",r.formTarget,r,null)):(gt(e,t,"encType",r.encType,r,null),gt(e,t,"method",r.method,r,null),gt(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=_f(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Or);break;case"onScroll":n!=null&&Ge("scroll",e);break;case"onScrollEnd":n!=null&&Ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(z(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(z(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=_f(""+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":Ge("beforetoggle",e),Ge("toggle",e),Df(e,"popover",n);break;case"xlinkActuate":Lr(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Lr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Lr(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Lr(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Lr(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Lr(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Lr(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Lr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Lr(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Df(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=mz.get(a)||a,Df(e,a,n))}}function Oy(e,t,a,n,r,o){switch(a){case"style":jC(e,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(z(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(z(60));e.innerHTML=a}}break;case"children":typeof n=="string"?tl(e,n):(typeof n=="number"||typeof n=="bigint")&&tl(e,""+n);break;case"onScroll":n!=null&&Ge("scroll",e);break;case"onScrollEnd":n!=null&&Ge("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Or);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!UC.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[Xa]||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,""):Df(e,a,n)}}}function ba(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",e),Ge("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(z(137,t));default:gt(e,t,o,i,a,null)}}r&>(e,t,"srcSet",a.srcSet,a,null),n&>(e,t,"src",a.src,a,null);return;case"input":Ge("invalid",e);var s=o=i=r=null,l=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":l=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":s=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(z(137,t));break;default:gt(e,t,n,c,a,null)}}FC(e,o,s,l,u,i,r,!1);return;case"select":Ge("invalid",e),n=i=o=null;for(r in a)if(a.hasOwnProperty(r)&&(s=a[r],s!=null))switch(r){case"value":o=s;break;case"defaultValue":i=s;break;case"multiple":n=s;default:gt(e,t,r,s,a,null)}t=o,a=i,e.multiple=!!n,t!=null?Gs(e,!!n,t,!1):a!=null&&Gs(e,!!n,a,!0);return;case"textarea":Ge("invalid",e),o=r=n=null;for(i in a)if(a.hasOwnProperty(i)&&(s=a[i],s!=null))switch(i){case"value":n=s;break;case"defaultValue":r=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(z(91));break;default:gt(e,t,i,s,a,null)}HC(e,n,r,o);return;case"option":for(l in a)a.hasOwnProperty(l)&&(n=a[l],n!=null)&&(l==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":gt(e,t,l,n,a,null));return;case"dialog":Ge("beforetoggle",e),Ge("toggle",e),Ge("cancel",e),Ge("close",e);break;case"iframe":case"object":Ge("load",e);break;case"video":case"audio":for(n=0;n<oc.length;n++)Ge(oc[n],e);break;case"image":Ge("error",e),Ge("load",e);break;case"details":Ge("toggle",e);break;case"embed":case"source":case"link":Ge("error",e),Ge("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(z(137,t));default:gt(e,t,u,n,a,null)}return;default:if(Zy(t)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Oy(e,t,c,n,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(n=a[s],n!=null&>(e,t,s,n,a,null))}function zF(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,s=null,l=null,u=null,c=null;for(m in a){var d=a[m];if(a.hasOwnProperty(m)&&d!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":l=d;default:n.hasOwnProperty(m)||gt(e,t,m,null,n,d)}}for(var p in n){var m=n[p];if(d=a[p],n.hasOwnProperty(p)&&(m!=null||d!=null))switch(p){case"type":o=m;break;case"name":r=m;break;case"checked":u=m;break;case"defaultChecked":c=m;break;case"value":i=m;break;case"defaultValue":s=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(z(137,t));break;default:m!==d&>(e,t,p,m,n,d)}}iy(e,i,s,l,u,c,o,r);return;case"select":m=i=s=p=null;for(o in a)if(l=a[o],a.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":m=l;default:n.hasOwnProperty(o)||gt(e,t,o,null,n,l)}for(r in n)if(o=n[r],l=a[r],n.hasOwnProperty(r)&&(o!=null||l!=null))switch(r){case"value":p=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&>(e,t,r,o,n,l)}t=s,a=i,n=m,p!=null?Gs(e,!!a,p,!1):!!n!=!!a&&(t!=null?Gs(e,!!a,t,!0):Gs(e,!!a,a?[]:"",!1));return;case"textarea":m=p=null;for(s in a)if(r=a[s],a.hasOwnProperty(s)&&r!=null&&!n.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:gt(e,t,s,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":p=r;break;case"defaultValue":m=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(z(91));break;default:r!==o&>(e,t,i,r,n,o)}qC(e,p,m);return;case"option":for(var h in a)p=a[h],a.hasOwnProperty(h)&&p!=null&&!n.hasOwnProperty(h)&&(h==="selected"?e.selected=!1:gt(e,t,h,null,n,p));for(l in n)p=n[l],m=a[l],n.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null)&&(l==="selected"?e.selected=p&&typeof p!="function"&&typeof p!="symbol":gt(e,t,l,p,n,m));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 v in a)p=a[v],a.hasOwnProperty(v)&&p!=null&&!n.hasOwnProperty(v)&>(e,t,v,null,n,p);for(u in n)if(p=n[u],m=a[u],n.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(z(137,t));break;default:gt(e,t,u,p,n,m)}return;default:if(Zy(t)){for(var I in a)p=a[I],a.hasOwnProperty(I)&&p!==void 0&&!n.hasOwnProperty(I)&&Oy(e,t,I,void 0,n,p);for(c in n)p=n[c],m=a[c],!n.hasOwnProperty(c)||p===m||p===void 0&&m===void 0||Oy(e,t,c,p,n,m);return}}for(var y in a)p=a[y],a.hasOwnProperty(y)&&p!=null&&!n.hasOwnProperty(y)&>(e,t,y,null,n,p);for(d in n)p=n[d],m=a[d],!n.hasOwnProperty(d)||p===m||p==null&&m==null||gt(e,t,d,p,n,m)}function nC(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function FF(){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,s=r.duration;if(o&&s&&nC(i)){for(i=0,s=r.responseEnd,n+=1;n<a.length;n++){var l=a[n],u=l.startTime;if(u>s)break;var c=l.transferSize,d=l.initiatorType;c&&nC(d)&&(l=l.responseEnd,i+=c*(l<s?1:(s-u)/(l-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 Ny=null,Uy=null;function gp(e){return e.nodeType===9?e:e.ownerDocument}function rC(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 GT(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 By(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 Xg=null;function qF(){var e=window.event;return e&&e.type==="popstate"?e===Xg?!1:(Xg=e,!0):(Xg=null,!1)}var XT=typeof setTimeout=="function"?setTimeout:void 0,HF=typeof clearTimeout=="function"?clearTimeout:void 0,oC=typeof Promise=="function"?Promise:void 0,jF=typeof queueMicrotask=="function"?queueMicrotask:typeof oC<"u"?function(e){return oC.resolve(null).then(e).catch(VF)}:XT;function VF(e){setTimeout(function(){throw e})}function Bo(e){return e==="head"}function iC(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),ul(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Ku(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ku(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[mc]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&Ku(e.ownerDocument.body);a=r}while(a);ul(t)}function sC(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 zy(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":zy(a),Yy(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function $F(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[mc])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=_n(e.nextSibling),e===null)break}return null}function WF(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=_n(e.nextSibling),e===null))return null;return e}function KT(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=_n(e.nextSibling),e===null))return null;return e}function Fy(e){return e.data==="$?"||e.data==="$~"}function qy(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function GF(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 _n(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 Hy=null;function lC(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return _n(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function uC(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 YT(e,t,a){switch(t=gp(a),e){case"html":if(e=t.documentElement,!e)throw Error(z(452));return e;case"head":if(e=t.head,!e)throw Error(z(453));return e;case"body":if(e=t.body,!e)throw Error(z(454));return e;default:throw Error(z(451))}}function Ku(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Yy(e)}var Pn=new Map,cC=new Set;function yp(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var $r=lt.d;lt.d={f:XF,r:KF,D:YF,C:ZF,L:JF,m:QF,X:tq,S:eq,M:aq};function XF(){var e=$r.f(),t=Pp();return e||t}function KF(e){var t=dl(e);t!==null&&t.tag===5&&t.type==="form"?jk(t):$r.r(e)}var hl=typeof document>"u"?null:document;function ZT(e,t,a){var n=hl;if(n&&typeof t=="string"&&t){var r=An(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),cC.has(r)||(cC.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),ba(t,"link",e),fa(t),n.head.appendChild(t)))}}function YF(e){$r.D(e),ZT("dns-prefetch",e,null)}function ZF(e,t){$r.C(e,t),ZT("preconnect",e,t)}function JF(e,t,a){$r.L(e,t,a);var n=hl;if(n&&e&&t){var r='link[rel="preload"][as="'+An(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+An(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+An(a.imageSizes)+'"]')):r+='[href="'+An(e)+'"]';var o=r;switch(t){case"style":o=ll(e);break;case"script":o=gl(e)}Pn.has(o)||(e=Lt({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Pn.set(o,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(xc(o))||t==="script"&&n.querySelector(bc(o))||(t=n.createElement("link"),ba(t,"link",e),fa(t),n.head.appendChild(t)))}}function QF(e,t){$r.m(e,t);var a=hl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+An(n)+'"][href="'+An(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=gl(e)}if(!Pn.has(o)&&(e=Lt({rel:"modulepreload",href:e},t),Pn.set(o,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(bc(o)))return}n=a.createElement("link"),ba(n,"link",e),fa(n),a.head.appendChild(n)}}}function eq(e,t,a){$r.S(e,t,a);var n=hl;if(n&&e){var r=Ws(n).hoistableStyles,o=ll(e);t=t||"default";var i=r.get(o);if(!i){var s={loading:0,preload:null};if(i=n.querySelector(xc(o)))s.loading=5;else{e=Lt({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Pn.get(o))&&Ow(e,a);var l=i=n.createElement("link");fa(l),ba(l,"link",e),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,jf(i,t,n)}i={type:"stylesheet",instance:i,count:1,state:s},r.set(o,i)}}}function tq(e,t){$r.X(e,t);var a=hl;if(a&&e){var n=Ws(a).hoistableScripts,r=gl(e),o=n.get(r);o||(o=a.querySelector(bc(r)),o||(e=Lt({src:e,async:!0},t),(t=Pn.get(r))&&Nw(e,t),o=a.createElement("script"),fa(o),ba(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function aq(e,t){$r.M(e,t);var a=hl;if(a&&e){var n=Ws(a).hoistableScripts,r=gl(e),o=n.get(r);o||(o=a.querySelector(bc(r)),o||(e=Lt({src:e,async:!0,type:"module"},t),(t=Pn.get(r))&&Nw(e,t),o=a.createElement("script"),fa(o),ba(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function dC(e,t,a,n){var r=(r=Co.current)?yp(r):null;if(!r)throw Error(z(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=ll(a.href),a=Ws(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=ll(a.href);var o=Ws(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(xc(e)))&&!o._p&&(i.instance=o,i.state.loading=5),Pn.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},Pn.set(e,a),o||nq(r,e,a,i.state))),t&&n===null)throw Error(z(528,""));return i}if(t&&n!==null)throw Error(z(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=gl(a),a=Ws(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(z(444,e))}}function ll(e){return'href="'+An(e)+'"'}function xc(e){return'link[rel="stylesheet"]['+e+"]"}function JT(e){return Lt({},e,{"data-precedence":e.precedence,precedence:null})}function nq(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}),ba(t,"link",a),fa(t),e.head.appendChild(t))}function gl(e){return'[src="'+An(e)+'"]'}function bc(e){return"script[async]"+e}function fC(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+An(a.href)+'"]');if(n)return t.instance=n,fa(n),n;var r=Lt({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),fa(n),ba(n,"style",r),jf(n,a.precedence,e),t.instance=n;case"stylesheet":r=ll(a.href);var o=e.querySelector(xc(r));if(o)return t.state.loading|=4,t.instance=o,fa(o),o;n=JT(a),(r=Pn.get(r))&&Ow(n,r),o=(e.ownerDocument||e).createElement("link"),fa(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),ba(o,"link",n),t.state.loading|=4,jf(o,a.precedence,e),t.instance=o;case"script":return o=gl(a.src),(r=e.querySelector(bc(o)))?(t.instance=r,fa(r),r):(n=a,(r=Pn.get(o))&&(n=Lt({},a),Nw(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),fa(r),ba(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(z(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,jf(n,a.precedence,e));return t.instance}function jf(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 s=n[i];if(s.dataset.precedence===t)o=s;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 Ow(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Nw(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vf=null;function pC(e,t,a){if(Vf===null){var n=new Map,r=Vf=new Map;r.set(a,n)}else r=Vf,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[mc]||o[wa]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(t)||"";i=e+i;var s=n.get(i);s?s.push(o):n.set(i,[o])}}return n}function mC(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function rq(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 QT(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function oq(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=ll(n.href),o=t.querySelector(xc(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=wp.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,fa(o);return}o=t.ownerDocument||t,n=JT(n),(r=Pn.get(r))&&Ow(n,r),o=o.createElement("link"),fa(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),ba(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=wp.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Kg=0;function iq(e,t){return e.stylesheets&&e.count===0&&$f(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Kg===0&&(Kg=62500*FF());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Kg?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function wp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$f(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vp=null;function $f(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vp=new Map,t.forEach(sq,e),vp=null,wp.call(e))}function sq(e,t){if(!(t.state.loading&4)){var a=vp.get(e);if(a)var n=a.get(null);else{a=new Map,vp.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=wp.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 sc={$$typeof:Pr,Provider:null,Consumer:null,_currentValue:yi,_currentValue2:yi,_threadCount:0};function lq(e,t,a,n,r,o,i,s,l){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=bg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bg(0),this.hiddenUpdates=bg(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function e1(e,t,a,n,r,o,i,s,l,u,c,d){return e=new lq(e,t,a,i,l,u,c,d,s),t=1,o===!0&&(t|=24),o=un(3,null,null,t),e.current=o,o.stateNode=e,t=lw(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},dw(o),e}function t1(e){return e?(e=Hs,e):Hs}function a1(e,t,a,n,r,o){r=t1(r),n.context===null?n.context=r:n.pendingContext=r,n=To(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=Lo(e,n,t),a!==null&&(Ga(a,e,t),qu(a,e,t))}function hC(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Uw(e,t){hC(e,t),(e=e.alternate)&&hC(e,t)}function n1(e){if(e.tag===13||e.tag===31){var t=Mi(e,67108864);t!==null&&Ga(t,e,67108864),Uw(e,67108864)}}function gC(e){if(e.tag===13||e.tag===31){var t=mn();t=Xy(t);var a=Mi(e,t);a!==null&&Ga(a,e,t),Uw(e,t)}}var xp=!0;function uq(e,t,a,n){var r=Te.T;Te.T=null;var o=lt.p;try{lt.p=2,Bw(e,t,a,n)}finally{lt.p=o,Te.T=r}}function cq(e,t,a,n){var r=Te.T;Te.T=null;var o=lt.p;try{lt.p=8,Bw(e,t,a,n)}finally{lt.p=o,Te.T=r}}function Bw(e,t,a,n){if(xp){var r=jy(n);if(r===null)Gg(e,t,n,bp,a),yC(e,n);else if(fq(r,e,t,a,n))n.stopPropagation();else if(yC(e,n),t&4&&-1<dq.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 i=mi(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-pn(i);s.entanglements[1]|=l,i&=~l}fr(o),(st&6)===0&&(cp=dn()+500,vc(0,!1))}}break;case 31:case 13:s=Mi(o,2),s!==null&&Ga(s,o,2),Pp(),Uw(o,2)}if(o=jy(n),o===null&&Gg(e,t,n,bp,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else Gg(e,t,n,null,a)}}function jy(e){return e=Jy(e),zw(e)}var bp=null;function zw(e){if(bp=null,e=Ns(e),e!==null){var t=cc(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=IC(t),e!==null)return e;e=null}else if(a===31){if(e=CC(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 bp=e,null}function r1(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(J3()){case EC:return 2;case AC:return 8;case Yf:case Q3:return 32;case MC:return 268435456;default:return 32}default:return 32}}var Vy=!1,Mo=null,Ro=null,Do=null,lc=new Map,uc=new Map,wo=[],dq="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 yC(e,t){switch(e){case"focusin":case"focusout":Mo=null;break;case"dragenter":case"dragleave":Ro=null;break;case"mouseover":case"mouseout":Do=null;break;case"pointerover":case"pointerout":lc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":uc.delete(t.pointerId)}}function Mu(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&&n1(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function fq(e,t,a,n,r){switch(t){case"focusin":return Mo=Mu(Mo,e,t,a,n,r),!0;case"dragenter":return Ro=Mu(Ro,e,t,a,n,r),!0;case"mouseover":return Do=Mu(Do,e,t,a,n,r),!0;case"pointerover":var o=r.pointerId;return lc.set(o,Mu(lc.get(o)||null,e,t,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,uc.set(o,Mu(uc.get(o)||null,e,t,a,n,r)),!0}return!1}function o1(e){var t=Ns(e.target);if(t!==null){var a=cc(t);if(a!==null){if(t=a.tag,t===13){if(t=IC(a),t!==null){e.blockedOn=t,eI(e.priority,function(){gC(a)});return}}else if(t===31){if(t=CC(a),t!==null){e.blockedOn=t,eI(e.priority,function(){gC(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 Wf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=jy(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);ly=n,a.target.dispatchEvent(n),ly=null}else return t=dl(a),t!==null&&n1(t),e.blockedOn=a,!1;t.shift()}return!0}function wC(e,t,a){Wf(e)&&a.delete(t)}function pq(){Vy=!1,Mo!==null&&Wf(Mo)&&(Mo=null),Ro!==null&&Wf(Ro)&&(Ro=null),Do!==null&&Wf(Do)&&(Do=null),lc.forEach(wC),uc.forEach(wC)}function Mf(e,t){e.blockedOn===t&&(e.blockedOn=null,Vy||(Vy=!0,sa.unstable_scheduleCallback(sa.unstable_NormalPriority,pq)))}var Rf=null;function vC(e){Rf!==e&&(Rf=e,sa.unstable_scheduleCallback(sa.unstable_NormalPriority,function(){Rf===e&&(Rf=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(zw(n||a)===null)continue;break}var o=dl(a);o!==null&&(e.splice(t,3),t-=3,Cy(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function ul(e){function t(l){return Mf(l,e)}Mo!==null&&Mf(Mo,e),Ro!==null&&Mf(Ro,e),Do!==null&&Mf(Do,e),lc.forEach(t),uc.forEach(t);for(var a=0;a<wo.length;a++){var n=wo[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<wo.length&&(a=wo[0],a.blockedOn===null);)o1(a),a.blockedOn===null&&wo.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[Xa]||null;if(typeof o=="function")i||vC(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[Xa]||null)s=i.formAction;else if(zw(r)!==null)continue}else s=i.action;typeof s=="function"?a[n+1]=s:(a.splice(n,3),n-=3),vC(a)}}}function i1(){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 Fw(e){this._internalRoot=e}Up.prototype.render=Fw.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(z(409));var a=t.current,n=mn();a1(a,n,e,t,null,null)};Up.prototype.unmount=Fw.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;a1(e.current,2,null,e,null,null),Pp(),t[cl]=null}};function Up(e){this._internalRoot=e}Up.prototype.unstable_scheduleHydration=function(e){if(e){var t=OC();e={blockedOn:null,target:e,priority:t};for(var a=0;a<wo.length&&t!==0&&t<wo[a].priority;a++);wo.splice(a,0,e),a===0&&o1(e)}};var xC=bC.version;if(xC!=="19.2.4")throw Error(z(527,xC,"19.2.4"));lt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(z(188)):(e=Object.keys(e).join(","),Error(z(268,e)));return e=$3(t),e=e!==null?kC(e):null,e=e===null?null:e.stateNode,e};var mq={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Te,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Ru=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Ru.isDisabled&&Ru.supportsFiber))try{dc=Ru.inject(mq),fn=Ru}catch{}var Ru;Bp.createRoot=function(e,t){if(!SC(e))throw Error(z(299));var a=!1,n="",r=Zk,o=Jk,i=Qk;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=e1(e,1,!1,null,null,a,n,null,r,o,i,i1),e[cl]=t.current,Pw(e),new Fw(t)};Bp.hydrateRoot=function(e,t,a){if(!SC(e))throw Error(z(299));var n=!1,r="",o=Zk,i=Jk,s=Qk,l=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&&(s=a.onRecoverableError),a.formState!==void 0&&(l=a.formState)),t=e1(e,1,!0,t,a??null,n,r,l,o,i,s,i1),t.context=t1(null),a=t.current,n=mn(),n=Xy(n),r=To(n),r.callback=null,Lo(a,r,n),a=n,t.current.lanes=a,pc(t,a),fr(t),e[cl]=t.current,Pw(e),new Up(t)};Bp.version="19.2.4"});var qw=Ca((BZ,u1)=>{"use strict";function l1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l1)}catch(e){console.error(e)}}l1(),u1.exports=s1()});var B1=Ca(Kp=>{"use strict";var _4=Symbol.for("react.transitional.element"),P4=Symbol.for("react.fragment");function U1(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:_4,type:e,key:n,ref:t!==void 0?t:null,props:a}}Kp.Fragment=P4;Kp.jsx=U1;Kp.jsxs=U1});var me=Ca((UQ,z1)=>{"use strict";z1.exports=B1()});function F1(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=F1(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function Zp(){for(var e,t,a=0,n="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=F1(e))&&(n&&(n+=" "),n+=t);return n}var tv=L(()=>{"use strict"});function av(...e){return e.filter(Boolean).join(" ")}function q1(){return av}var nv=L(()=>{"use strict"});function hV(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Zo(e[a]);return bm(n);function n(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function gV(e){let t=e;return bm(a);function a(n){let r=n,o;for(o in e)if(r[o]!==t[o])return!1;return!0}}function yV(e){return bm(t);function t(a){return a&&a.type===e}}function bm(e){return t;function t(a,n,r){return!!(vV(a)&&e.call(this,a,typeof n=="number"?n:void 0,r||void 0))}}function wV(){return!0}function vV(e){return e!==null&&typeof e=="object"&&"type"in e}var Zo,jM=L(()=>{"use strict";Zo=(function(e){if(e==null)return wV;if(typeof e=="function")return bm(e);if(typeof e=="object")return Array.isArray(e)?hV(e):gV(e);if(typeof e=="string")return yV(e);throw new Error("Expected function, string, or object as test")})});var Sm=L(()=>{"use strict";jM()});function cd(e,t,a,n){let r;typeof t=="function"&&typeof a!="function"?(n=a,a=t):r=t;let o=Zo(r),i=n?-1:1;s(e,void 0,[])();function s(l,u,c){let d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){let m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=VM,h,v,I;if((!t||o(l,u,c[c.length-1]||void 0))&&(m=xV(a(l,c)),m[0]===ns))return m;if("children"in l&&l.children){let y=l;if(y.children&&m[0]!==rs)for(v=(n?y.children.length:-1)+i,I=c.concat(y);v>-1&&v<y.children.length;){let w=y.children[v];if(h=s(w,v,I)(),h[0]===ns)return h;v=typeof h[1]=="number"?h[1]:v+i}}return m}}}function xV(e){return Array.isArray(e)?e:typeof e=="number"?[Jr,e]:e==null?VM:[e]}var VM,Jr,ns,rs,$M=L(()=>{"use strict";Sm();VM=[],Jr=!0,ns=!1,rs="skip"});var Im=L(()=>{"use strict";$M()});function Qr(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),cd(e,o,s,r);function s(l,u){let c=u[u.length-1],d=c?c.children.indexOf(l):void 0;return i(l,d,c)}}var WM=L(()=>{"use strict";Im();Im()});var Cm=L(()=>{"use strict";WM()});function KM({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 s=t.length&&!t.every(u=>u==="*"),l=a.length&&!a.every(u=>u==="*");if(!e&&(s||l))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return u=>{let c=CV(e,t,a,n,r,o,i);Qr(u,c)}}function GM(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 bV(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function XM(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=GM(e,a);if(!i||IV.has(i.protocol)||!(SV.has(i.protocol)||o.includes(i.protocol)||o.includes("*")))return null;if(i.protocol==="mailto:"||!i.protocol.match(/^https?:$/))return i.href;let l=bV(e);return i&&t.some(u=>{let c=GM(u,a);return!c||c.origin!==i.origin?!1:i.href.startsWith(c.href)})?l?i.pathname+i.search+i.hash:i.href:t.includes("*")?i.protocol!=="https:"&&i.protocol!=="http:"?null:l?i.pathname+i.search+i.hash:i.href:null}var SV,IV,yx,CV,YM=L(()=>{"use strict";Cm();SV=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),IV=new Set(["javascript:","data:","file:","vbscript:"]);yx=Symbol("node-seen"),CV=(e,t,a,n,r,o,i)=>{let s=(l,u,c)=>{if(l.type!=="element"||l[yx])return Jr;if(l.tagName==="a"){let d=XM(l.properties.href,t,e,!1,!1,r);return d===null?(l[yx]=!0,Qr(l,s),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(l.properties.href),class:i},children:[...l.children,{type:"text",value:" [blocked]"}]}),rs):(l.properties.href=d,l.properties.target="_blank",l.properties.rel="noopener noreferrer",Jr)}if(l.tagName==="img"){let d=XM(l.properties.src,a,e,n,!0,r);return d===null?(l[yx]=!0,Qr(l,s),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{class:o},children:[{type:"text",value:"[Image blocked: "+String(l.properties.alt||"No description")+"]"}]}),rs):(l.properties.src=d,Jr)}return Jr};return s}});function kV(){return e=>e}var ZM,JM=L(()=>{"use strict";ZM=kV});var QM,AV,xx,rR=L(()=>{"use strict";QM=typeof self=="object"?self:globalThis,AV=(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 s=a([],r);for(let l of i)s.push(n(l));return s}case 2:{let s=a({},r);for(let[l,u]of i)s[n(l)]=n(u);return s}case 3:return a(new Date(i),r);case 4:{let{source:s,flags:l}=i;return a(new RegExp(s,l),r)}case 5:{let s=a(new Map,r);for(let[l,u]of i)s.set(n(l),n(u));return s}case 6:{let s=a(new Set,r);for(let l of i)s.add(n(l));return s}case 7:{let{name:s,message:l}=i;return a(new QM[s](l),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:s}=new Uint8Array(i);return a(new DataView(s),i)}}return a(new QM[o](i),r)};return n},xx=e=>AV(new Map,e)(0)});var $l,MV,RV,dd,Tm,DV,bx,oR=L(()=>{"use strict";$l="",{toString:MV}={},{keys:RV}=Object,dd=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=MV.call(e).slice(8,-1);switch(a){case"Array":return[1,$l];case"Object":return[2,$l];case"Date":return[3,$l];case"RegExp":return[4,$l];case"Map":return[5,$l];case"Set":return[6,$l];case"DataView":return[1,a]}return a.includes("Array")?[1,a]:a.includes("Error")?[7,a]:[2,a]},Tm=([e,t])=>e===0&&(t==="function"||t==="symbol"),DV=(e,t,a,n)=>{let r=(i,s)=>{let l=n.push(i)-1;return a.set(s,l),l},o=i=>{if(a.has(i))return a.get(i);let[s,l]=dd(i);switch(s){case 0:{let c=i;switch(l){case"bigint":s=8,c=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return r([-1],i)}return r([s,c],i)}case 1:{if(l){let p=i;return l==="DataView"?p=new Uint8Array(i.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(i)),r([l,[...p]],i)}let c=[],d=r([s,c],i);for(let p of i)c.push(o(p));return d}case 2:{if(l)switch(l){case"BigInt":return r([l,i.toString()],i);case"Boolean":case"Number":case"String":return r([l,i.valueOf()],i)}if(t&&"toJSON"in i)return o(i.toJSON());let c=[],d=r([s,c],i);for(let p of RV(i))(e||!Tm(dd(i[p])))&&c.push([o(p),o(i[p])]);return d}case 3:return r([s,i.toISOString()],i);case 4:{let{source:c,flags:d}=i;return r([s,{source:c,flags:d}],i)}case 5:{let c=[],d=r([s,c],i);for(let[p,m]of i)(e||!(Tm(dd(p))||Tm(dd(m))))&&c.push([o(p),o(m)]);return d}case 6:{let c=[],d=r([s,c],i);for(let p of i)(e||!Tm(dd(p)))&&c.push(o(p));return d}}let{message:u}=i;return r([s,{name:l,message:u}],i)};return o},bx=(e,{json:t,lossy:a}={})=>{let n=[];return DV(!(t||a),!!t,new Map,n)(e),n}});var Jo,Lm=L(()=>{"use strict";rR();oR();Jo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?xx(bx(e,t)):structuredClone(e):(e,t)=>xx(bx(e,t))});function iR(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 fd(e){let t=Wl(e),a=Em(e);if(t&&a)return{start:t,end:a}}var Em,Wl,sR=L(()=>{"use strict";Em=iR("end"),Wl=iR("start")});var pd=L(()=>{"use strict";sR()});var os,Sx,lR=L(()=>{"use strict";os=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Sx={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...os,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...os],h2:[["className","sr-only"]],img:[...os,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...os,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...os],table:[...os],ul:[...os,["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 Ix(e,t){let a={type:"root",children:[]},n={schema:t?{...Sx,...t}:Sx,stack:[]},r=dR(n,e);return r&&(Array.isArray(r)?r.length===1?a=r[0]:a.children=r:a=r),a}function dR(e,t){if(t&&typeof t=="object"){let a=t;switch(typeof a.type=="string"?a.type:""){case"comment":return _V(e,a);case"doctype":return PV(e,a);case"element":return OV(e,a);case"root":return NV(e,a);case"text":return UV(e,a);default:}}}function _V(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 md(o,t),o}}function PV(e,t){if(e.schema.allowDoctypes){let a={type:"doctype"};return md(a,t),a}}function OV(e,t){let a=typeof t.tagName=="string"?t.tagName:"";e.stack.push(a);let n=fR(e,t.children),r=BV(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&&Qo.call(e.schema.ancestors,a))){let s=e.schema.ancestors[a],l=-1;for(o=!1;++l<s.length;)e.stack.includes(s[l])&&(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 md(i,t),i}function NV(e,t){let n={type:"root",children:fR(e,t.children)};return md(n,t),n}function UV(e,t){let n={type:"text",value:typeof t.value=="string"?t.value:""};return md(n,t),n}function fR(e,t){let a=[];if(Array.isArray(t)){let n=t,r=-1;for(;++r<n.length;){let o=dR(e,n[r]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function BV(e,t){let a=e.stack[e.stack.length-1],n=e.schema.attributes,r=e.schema.required,o=n&&Qo.call(n,a)?n[a]:void 0,i=n&&Qo.call(n,"*")?n["*"]:void 0,s=t&&typeof t=="object"?t:{},l={},u;for(u in s)if(Qo.call(s,u)){let c=s[u],d=uR(e,cR(o,u),u,c);d==null&&(d=uR(e,cR(i,u),u,c)),d!=null&&(l[u]=d)}if(r&&Qo.call(r,a)){let c=r[a];for(u in c)Qo.call(c,u)&&!Qo.call(l,u)&&(l[u]=c[u])}return l}function uR(e,t,a,n){return t?Array.isArray(n)?zV(e,t,a,n):pR(e,t,a,n):void 0}function zV(e,t,a,n){let r=-1,o=[];for(;++r<n.length;){let i=pR(e,t,a,n[r]);(typeof i=="number"||typeof i=="string")&&o.push(i)}return o}function pR(e,t,a,n){if(!(typeof n!="boolean"&&typeof n!="number"&&typeof n!="string")&&FV(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 FV(e,t,a){let n=e.schema.protocols&&Qo.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("?"),s=r.indexOf("#"),l=r.indexOf("/");if(o<0||l>-1&&o>l||i>-1&&o>i||s>-1&&o>s)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 md(e,t){let a=fd(t);t.data&&(e.data=Jo(t.data)),a&&(e.position=a)}function cR(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 Qo,mR=L(()=>{"use strict";Lm();pd();lR();Qo={}.hasOwnProperty});var hR=L(()=>{"use strict";mR()});function Am(e){return function(t){return Ix(t,e)}}var gR=L(()=>{"use strict";hR()});var yR=L(()=>{"use strict";gR()});function Cx(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 wR=L(()=>{"use strict"});function is(e){return e!==null&&(e<32||e===127)}function ne(e){return e!==null&&e<-2}function $e(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}function ei(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}var la,Vt,vR,hd,xR,bR,ss,Sr,at=L(()=>{"use strict";la=ei(/[A-Za-z]/),Vt=ei(/[\dA-Za-z]/),vR=ei(/[#-'*+\--9=?A-Z^-~]/);hd=ei(/\d/),xR=ei(/[\dA-Fa-f]/),bR=ei(/[!-/:-@[-`{-~]/);ss=ei(/\p{P}|\p{S}/u),Sr=ei(/\s/)});function kx(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var SR=L(()=>{"use strict"});function Tx(e,t,a){let r=Zo((a||{}).ignore||[]),o=qV(t),i=-1;for(;++i<o.length;)cd(e,"text",s);function s(u,c){let d=-1,p;for(;++d<c.length;){let m=c[d],h=p?p.children:void 0;if(r(m,h?h.indexOf(m):void 0,p))return;p=m}if(p)return l(u,c)}function l(u,c){let d=c[c.length-1],p=o[i][0],m=o[i][1],h=0,I=d.children.indexOf(u),y=!1,w=[];p.lastIndex=0;let g=p.exec(u.value);for(;g;){let S=g.index,E={index:g.index,input:g.input,stack:[...c,u]},T=m(...g,E);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?p.lastIndex=S+1:(h!==S&&w.push({type:"text",value:u.value.slice(h,S)}),Array.isArray(T)?w.push(...T):T&&w.push(T),h=S+g[0].length,y=!0),!p.global)break;g=p.exec(u.value)}return y?(h<u.value.length&&w.push({type:"text",value:u.value.slice(h)}),d.children.splice(I,1,...w)):w=[u],I+w.length}}function qV(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([HV(r[0]),jV(r[1])])}return t}function HV(e){return typeof e=="string"?new RegExp(kx(e),"g"):e}function jV(e){return typeof e=="function"?e:function(){return e}}var IR=L(()=>{"use strict";SR();Im();Sm()});var CR=L(()=>{"use strict";IR()});function Mx(){return{transforms:[KV],enter:{literalAutolink:VV,literalAutolinkEmail:Ax,literalAutolinkHttp:Ax,literalAutolinkWww:Ax},exit:{literalAutolink:XV,literalAutolinkEmail:GV,literalAutolinkHttp:$V,literalAutolinkWww:WV}}}function Rx(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Lx,notInConstruct:Ex},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Lx,notInConstruct:Ex},{character:":",before:"[ps]",after:"\\/",inConstruct:Lx,notInConstruct:Ex}]}}function VV(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ax(e){this.config.enter.autolinkProtocol.call(this,e)}function $V(e){this.config.exit.autolinkProtocol.call(this,e)}function WV(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 GV(e){this.config.exit.autolinkEmail.call(this,e)}function XV(e){this.exit(e)}function KV(e){Tx(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,YV],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ZV]],{ignore:["link","linkReference"]})}function YV(e,t,a,n,r){let o="";if(!kR(r)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!JV(a)))return!1;let i=QV(a+n);if(!i[0])return!1;let s={type:"link",title:null,url:o+t+i[0],children:[{type:"text",value:t+i[0]}]};return i[1]?[s,{type:"text",value:i[1]}]:s}function ZV(e,t,a,n){return!kR(n,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function JV(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 QV(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=Cx(e,"("),o=Cx(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 kR(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||Sr(a)||ss(a))&&(!t||a!==47)}var Lx,Ex,TR=L(()=>{"use strict";wR();at();CR();Lx="phrasing",Ex=["autolink","link","image","label"]});var LR=L(()=>{"use strict";TR()});function Ma(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Gl=L(()=>{"use strict"});function e$(){this.buffer()}function t$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function a$(){this.buffer()}function n$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function r$(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ma(this.sliceSerialize(e)).toLowerCase(),a.label=t}function o$(e){this.exit(e)}function i$(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ma(this.sliceSerialize(e)).toLowerCase(),a.label=t}function s$(e){this.exit(e)}function l$(){return"["}function ER(e,t,a,n){let r=a.createTracker(n),o=r.move("[^"),i=a.enter("footnoteReference"),s=a.enter("reference");return o+=r.move(a.safe(a.associationId(e),{after:"]",before:o})),s(),i(),o+=r.move("]"),o}function Dx(){return{enter:{gfmFootnoteCallString:e$,gfmFootnoteCall:t$,gfmFootnoteDefinitionLabelString:a$,gfmFootnoteDefinition:n$},exit:{gfmFootnoteCallString:r$,gfmFootnoteCall:o$,gfmFootnoteDefinitionLabelString:i$,gfmFootnoteDefinition:s$}}}function _x(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:ER},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(n,r,o,i){let s=o.createTracker(i),l=s.move("[^"),u=o.enter("footnoteDefinition"),c=o.enter("label");return l+=s.move(o.safe(o.associationId(n),{before:l,after:"]"})),c(),l+=s.move("]:"),n.children&&n.children.length>0&&(s.shift(4),l+=s.move((t?`
|
|
10
|
+
`:" ")+o.indentLines(o.containerFlow(n,s.current()),t?AR:u$))),u(),l}}function u$(e,t,a){return t===0?e:AR(e,t,a)}function AR(e,t,a){return(a?"":" ")+e}var MR=L(()=>{"use strict";Gl();ER.peek=l$});var RR=L(()=>{"use strict";MR()});function Px(){return{canContainEols:["delete"],enter:{strikethrough:d$},exit:{strikethrough:f$}}}function Ox(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:c$}],handlers:{delete:DR}}}function d$(e){this.enter({type:"delete",children:[]},e)}function f$(e){this.exit(e)}function DR(e,t,a,n){let r=a.createTracker(n),o=a.enter("strikethrough"),i=r.move("~~");return i+=a.containerPhrasing(e,{...r.current(),before:i,after:"~"}),i+=r.move("~~"),o(),i}function p$(){return"~"}var c$,_R=L(()=>{"use strict";c$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];DR.peek=p$});var PR=L(()=>{"use strict";_R()});function m$(e){return e.length}function NR(e,t){let a=t||{},n=(a.align||[]).concat(),r=a.stringLength||m$,o=[],i=[],s=[],l=[],u=0,c=-1;for(;++c<e.length;){let v=[],I=[],y=-1;for(e[c].length>u&&(u=e[c].length);++y<e[c].length;){let w=h$(e[c][y]);if(a.alignDelimiters!==!1){let g=r(w);I[y]=g,(l[y]===void 0||g>l[y])&&(l[y]=g)}v.push(w)}i[c]=v,s[c]=I}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<u;)o[d]=OR(n[d]);else{let v=OR(n);for(;++d<u;)o[d]=v}d=-1;let p=[],m=[];for(;++d<u;){let v=o[d],I="",y="";v===99?(I=":",y=":"):v===108?I=":":v===114&&(y=":");let w=a.alignDelimiters===!1?1:Math.max(1,l[d]-I.length-y.length),g=I+"-".repeat(w)+y;a.alignDelimiters!==!1&&(w=I.length+w+y.length,w>l[d]&&(l[d]=w),m[d]=w),p[d]=g}i.splice(1,0,p),s.splice(1,0,m),c=-1;let h=[];for(;++c<i.length;){let v=i[c],I=s[c];d=-1;let y=[];for(;++d<u;){let w=v[d]||"",g="",S="";if(a.alignDelimiters!==!1){let E=l[d]-(I[d]||0),T=o[d];T===114?g=" ".repeat(E):T===99?E%2?(g=" ".repeat(E/2+.5),S=" ".repeat(E/2-.5)):(g=" ".repeat(E/2),S=g):S=" ".repeat(E)}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(S),a.padding!==!1&&y.push(" "),(a.delimiterEnd!==!1||d!==u-1)&&y.push("|")}h.push(a.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return h.join(`
|
|
11
|
+
`)}function h$(e){return e==null?"":String(e)}function OR(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 UR=L(()=>{"use strict"});function BR(e,t,a,n){let r=a.enter("blockquote"),o=a.createTracker(n);o.move("> "),o.shift(2);let i=a.indentLines(a.containerFlow(e,o.current()),g$);return r(),i}function g$(e,t,a){return">"+(a?"":" ")+e}var zR=L(()=>{"use strict"});function qR(e,t){return FR(e,t.inConstruct,!0)&&!FR(e,t.notInConstruct,!1)}function FR(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 HR=L(()=>{"use strict"});function Nx(e,t,a,n){let r=-1;for(;++r<a.unsafe.length;)if(a.unsafe[r].character===`
|
|
12
|
+
`&&qR(a.stack,a.unsafe[r]))return/[ \t]/.test(n.before)?"":" ";return`\\
|
|
13
|
+
`}var jR=L(()=>{"use strict";HR()});function VR(e,t){let a=String(e),n=a.indexOf(t),r=n,o=0,i=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===r?++o>i&&(i=o):o=1,r=n+t.length,n=a.indexOf(t,r);return i}var $R=L(()=>{"use strict"});function WR(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 GR=L(()=>{"use strict"});function XR(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 KR=L(()=>{"use strict"});function YR(e,t,a,n){let r=XR(a),o=e.value||"",i=r==="`"?"GraveAccent":"Tilde";if(WR(e,a)){let d=a.enter("codeIndented"),p=a.indentLines(o,y$);return d(),p}let s=a.createTracker(n),l=r.repeat(Math.max(VR(o,r)+1,3)),u=a.enter("codeFenced"),c=s.move(l);if(e.lang){let d=a.enter(`codeFencedLang${i}`);c+=s.move(a.safe(e.lang,{before:c,after:" ",encode:["`"],...s.current()})),d()}if(e.lang&&e.meta){let d=a.enter(`codeFencedMeta${i}`);c+=s.move(" "),c+=s.move(a.safe(e.meta,{before:c,after:`
|
|
14
14
|
`,encode:["`"],...s.current()})),d()}return c+=s.move(`
|
|
15
15
|
`),o&&(c+=s.move(o+`
|
|
16
|
-
`)),c+=s.move(l),u(),c}function
|
|
17
|
-
`,...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()),i(),u}var
|
|
16
|
+
`)),c+=s.move(l),u(),c}function y$(e,t,a){return(a?"":" ")+e}var ZR=L(()=>{"use strict";$R();GR();KR()});function Xl(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 Mm=L(()=>{"use strict"});function JR(e,t,a,n){let r=Xl(a),o=r==='"'?"Quote":"Apostrophe",i=a.enter("definition"),s=a.enter("label"),l=a.createTracker(n),u=l.move("[");return u+=l.move(a.safe(a.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),s(),!e.url||/[\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?" ":`
|
|
17
|
+
`,...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()),i(),u}var QR=L(()=>{"use strict";Mm()});function e2(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 t2=L(()=>{"use strict"});function ti(e){return"&#x"+e.toString(16).toUpperCase()+";"}var Rm=L(()=>{"use strict"});function eo(e){if(e===null||$e(e)||Sr(e))return 1;if(ss(e))return 2}var Dm=L(()=>{"use strict";at()});function Kl(e,t,a){let n=eo(e),r=eo(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 Ux=L(()=>{"use strict";Dm()});function Bx(e,t,a,n){let r=e2(a),o=a.enter("emphasis"),i=a.createTracker(n),s=i.move(r),l=i.move(a.containerPhrasing(e,{after:r,before:s,...i.current()})),u=l.charCodeAt(0),c=Kl(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(l=ti(u)+l.slice(1));let d=l.charCodeAt(l.length-1),p=Kl(n.after.charCodeAt(0),d,r);p.inside&&(l=l.slice(0,-1)+ti(d));let m=i.move(r);return o(),a.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},s+l+m}function w$(e,t,a){return a.options.emphasis||"*"}var a2=L(()=>{"use strict";t2();Rm();Ux();Bx.peek=w$});function ls(e,t){let a=t||v$,n=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,r=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return r2(e,n,r)}function r2(e,t,a){if(x$(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 n2(e.children,t,a)}return Array.isArray(e)?n2(e,t,a):""}function n2(e,t,a){let n=[],r=-1;for(;++r<e.length;)n[r]=r2(e[r],t,a);return n.join("")}function x$(e){return!!(e&&typeof e=="object")}var v$,o2=L(()=>{"use strict";v$={}});var _m=L(()=>{"use strict";o2()});function i2(e,t){let a=!1;return Qr(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return a=!0,ns}),!!((!e.depth||e.depth<3)&&ls(e)&&(t.options.setext||a))}var s2=L(()=>{"use strict";Cm();_m()});function l2(e,t,a,n){let r=Math.max(Math.min(6,e.depth||1),1),o=a.createTracker(n);if(i2(e,a)){let c=a.enter("headingSetext"),d=a.enter("phrasing"),p=a.containerPhrasing(e,{...o.current(),before:`
|
|
18
18
|
`,after:`
|
|
19
19
|
`});return d(),c(),p+`
|
|
20
20
|
`+(r===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
21
21
|
`))+1))}let i="#".repeat(r),s=a.enter("headingAtx"),l=a.enter("phrasing");o.move(i+" ");let u=a.containerPhrasing(e,{before:"# ",after:`
|
|
22
|
-
`,...o.current()});return/^[\t ]/.test(u)&&(u=ti(u.charCodeAt(0))+u.slice(1)),u=u?i+" "+u:i,a.options.closeAtx&&(u+=" "+i),l(),s(),u}var s2=L(()=>{"use strict";Am();o2()});function Ux(e){return e.value||""}function v$(){return"<"}var l2=L(()=>{"use strict";Ux.peek=v$});function Bx(e,t,a,n){let r=Xl(a),o=r==='"'?"Quote":"Apostrophe",i=a.enter("image"),s=a.enter("label"),l=a.createTracker(n),u=l.move("![");return u+=l.move(a.safe(e.alt,{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 x$(){return"!"}var u2=L(()=>{"use strict";Em();Bx.peek=x$});function zx(e,t,a,n){let r=e.referenceType,o=a.enter("imageReference"),i=a.enter("label"),s=a.createTracker(n),l=s.move("!["),u=a.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:l,after:"]",...s.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?l+=s.move(d+"]"):r==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function b$(){return"!"}var c2=L(()=>{"use strict";zx.peek=b$});function Fx(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],s=a.compilePattern(i),l;if(i.atBreak)for(;l=s.exec(n);){let u=l.index;n.charCodeAt(u)===10&&n.charCodeAt(u-1)===13&&u--,n=n.slice(0,u)+" "+n.slice(l.index+1)}}return r+n+r}function S$(){return"`"}var d2=L(()=>{"use strict";Fx.peek=S$});function qx(e,t){let a=ls(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 f2=L(()=>{"use strict";Rm()});function Hx(e,t,a,n){let r=Xl(a),o=r==='"'?"Quote":"Apostrophe",i=a.createTracker(n),s,l;if(qx(e,a)){let c=a.stack;a.stack=[],s=a.enter("autolink");let d=i.move("<");return d+=i.move(a.containerPhrasing(e,{before:d,after:">",...i.current()})),d+=i.move(">"),s(),a.stack=c,d}s=a.enter("link"),l=a.enter("label");let u=i.move("[");return u+=i.move(a.containerPhrasing(e,{before:u,after:"](",...i.current()})),u+=i.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=a.enter("destinationLiteral"),u+=i.move("<"),u+=i.move(a.safe(e.url,{before:u,after:">",...i.current()})),u+=i.move(">")):(l=a.enter("destinationRaw"),u+=i.move(a.safe(e.url,{before:u,after:e.title?" ":")",...i.current()}))),l(),e.title&&(l=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),l()),u+=i.move(")"),s(),u}function I$(e,t,a){return qx(e,a)?"<":"["}var p2=L(()=>{"use strict";Em();f2();Hx.peek=I$});function jx(e,t,a,n){let r=e.referenceType,o=a.enter("linkReference"),i=a.enter("label"),s=a.createTracker(n),l=s.move("["),u=a.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:l,after:"]",...s.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?l+=s.move(d+"]"):r==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function C$(){return"["}var m2=L(()=>{"use strict";jx.peek=C$});function Yl(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 Dm=L(()=>{"use strict"});function h2(e){let t=Yl(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 g2=L(()=>{"use strict";Dm()});function y2(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 w2=L(()=>{"use strict"});function _m(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 Vx=L(()=>{"use strict"});function v2(e,t,a,n){let r=a.enter("list"),o=a.bulletCurrent,i=e.ordered?y2(a):Yl(a),s=e.ordered?i==="."?")":".":h2(a),l=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&&(l=!0),_m(a)===i&&c){let d=-1;for(;++d<e.children.length;){let p=e.children[d];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(i=s),a.bulletCurrent=i;let u=a.containerFlow(e,n);return a.bulletLastUsed=i,a.bulletCurrent=o,r(),u}var x2=L(()=>{"use strict";Dm();g2();w2();Vx()});function b2(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 S2=L(()=>{"use strict"});function I2(e,t,a,n){let r=b2(a),o=a.bulletCurrent||Yl(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 s=a.createTracker(n);s.move(o+" ".repeat(i-o.length)),s.shift(i);let l=a.enter("listItem"),u=a.indentLines(a.containerFlow(e,s.current()),c);return l(),u;function c(d,p,m){return p?(m?"":" ".repeat(i))+d:(m?o:o+" ".repeat(i-o.length))+d}}var C2=L(()=>{"use strict";Dm();S2()});function k2(e,t,a,n){let r=a.enter("paragraph"),o=a.enter("phrasing"),i=a.containerPhrasing(e,n);return o(),r(),i}var T2=L(()=>{"use strict"});var $x,L2=L(()=>{"use strict";xm();$x=Zo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var E2=L(()=>{"use strict";L2()});function A2(e,t,a,n){return(e.children.some(function(i){return $x(i)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}var M2=L(()=>{"use strict";E2()});function R2(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 D2=L(()=>{"use strict"});function Wx(e,t,a,n){let r=R2(a),o=a.enter("strong"),i=a.createTracker(n),s=i.move(r+r),l=i.move(a.containerPhrasing(e,{after:r,before:s,...i.current()})),u=l.charCodeAt(0),c=Kl(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(l=ti(u)+l.slice(1));let d=l.charCodeAt(l.length-1),p=Kl(n.after.charCodeAt(0),d,r);p.inside&&(l=l.slice(0,-1)+ti(d));let m=i.move(r+r);return o(),a.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},s+l+m}function k$(e,t,a){return a.options.strong||"*"}var _2=L(()=>{"use strict";D2();Am();Ox();Wx.peek=k$});function P2(e,t,a,n){return a.safe(e.value,n)}var O2=L(()=>{"use strict"});function N2(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 U2=L(()=>{"use strict"});function B2(e,t,a){let n=(_m(a)+(a.options.ruleSpaces?" ":"")).repeat(N2(a));return a.options.ruleSpaces?n.slice(0,-1):n}var z2=L(()=>{"use strict";U2();Vx()});var hd,F2=L(()=>{"use strict";UR();qR();KR();ZR();e2();s2();l2();u2();c2();d2();p2();m2();x2();C2();T2();M2();_2();O2();z2();hd={blockquote:NR,break:Px,code:XR,definition:YR,emphasis:Nx,hardBreak:Px,heading:i2,html:Ux,image:Bx,imageReference:zx,inlineCode:Fx,link:Hx,linkReference:jx,list:v2,listItem:I2,paragraph:k2,root:A2,strong:Wx,text:P2,thematicBreak:B2}});function Zl(e){let t="&"+e+";";q2.innerHTML=t;let a=q2.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}var q2,Pm=L(()=>{"use strict";q2=document.createElement("i")});function Om(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 Gx=L(()=>{"use strict"});function H2(e){return e.replace(T$,L$)}function L$(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let r=a.charCodeAt(1),o=r===120||r===88;return Om(a.slice(o?2:1),o?16:10)}return Zl(a)||e}var T$,j2=L(()=>{"use strict";Pm();Gx();T$=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var Xx=L(()=>{"use strict";F2()});function Yx(){return{enter:{table:E$,tableData:V2,tableHeader:V2,tableRow:M$},exit:{codeText:R$,table:A$,tableData:Kx,tableHeader:Kx,tableRow:Kx}}}function E$(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 A$(e){this.exit(e),this.data.inTable=void 0}function M$(e){this.enter({type:"tableRow",children:[]},e)}function Kx(e){this.exit(e)}function V2(e){this.enter({type:"tableCell",children:[]},e)}function R$(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,D$));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function D$(e,t){return t==="|"?t:e}function Zx(e){let t=e||{},a=t.tableCellPadding,n=t.tablePipeAlign,r=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
22
|
+
`,...o.current()});return/^[\t ]/.test(u)&&(u=ti(u.charCodeAt(0))+u.slice(1)),u=u?i+" "+u:i,a.options.closeAtx&&(u+=" "+i),l(),s(),u}var u2=L(()=>{"use strict";Rm();s2()});function zx(e){return e.value||""}function b$(){return"<"}var c2=L(()=>{"use strict";zx.peek=b$});function Fx(e,t,a,n){let r=Xl(a),o=r==='"'?"Quote":"Apostrophe",i=a.enter("image"),s=a.enter("label"),l=a.createTracker(n),u=l.move("![");return u+=l.move(a.safe(e.alt,{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 S$(){return"!"}var d2=L(()=>{"use strict";Mm();Fx.peek=S$});function qx(e,t,a,n){let r=e.referenceType,o=a.enter("imageReference"),i=a.enter("label"),s=a.createTracker(n),l=s.move("!["),u=a.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:l,after:"]",...s.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?l+=s.move(d+"]"):r==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function I$(){return"!"}var f2=L(()=>{"use strict";qx.peek=I$});function Hx(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],s=a.compilePattern(i),l;if(i.atBreak)for(;l=s.exec(n);){let u=l.index;n.charCodeAt(u)===10&&n.charCodeAt(u-1)===13&&u--,n=n.slice(0,u)+" "+n.slice(l.index+1)}}return r+n+r}function C$(){return"`"}var p2=L(()=>{"use strict";Hx.peek=C$});function jx(e,t){let a=ls(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 m2=L(()=>{"use strict";_m()});function Vx(e,t,a,n){let r=Xl(a),o=r==='"'?"Quote":"Apostrophe",i=a.createTracker(n),s,l;if(jx(e,a)){let c=a.stack;a.stack=[],s=a.enter("autolink");let d=i.move("<");return d+=i.move(a.containerPhrasing(e,{before:d,after:">",...i.current()})),d+=i.move(">"),s(),a.stack=c,d}s=a.enter("link"),l=a.enter("label");let u=i.move("[");return u+=i.move(a.containerPhrasing(e,{before:u,after:"](",...i.current()})),u+=i.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=a.enter("destinationLiteral"),u+=i.move("<"),u+=i.move(a.safe(e.url,{before:u,after:">",...i.current()})),u+=i.move(">")):(l=a.enter("destinationRaw"),u+=i.move(a.safe(e.url,{before:u,after:e.title?" ":")",...i.current()}))),l(),e.title&&(l=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),l()),u+=i.move(")"),s(),u}function k$(e,t,a){return jx(e,a)?"<":"["}var h2=L(()=>{"use strict";Mm();m2();Vx.peek=k$});function $x(e,t,a,n){let r=e.referenceType,o=a.enter("linkReference"),i=a.enter("label"),s=a.createTracker(n),l=s.move("["),u=a.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:l,after:"]",...s.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?l+=s.move(d+"]"):r==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function T$(){return"["}var g2=L(()=>{"use strict";$x.peek=T$});function Yl(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 Pm=L(()=>{"use strict"});function y2(e){let t=Yl(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 w2=L(()=>{"use strict";Pm()});function v2(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 x2=L(()=>{"use strict"});function Om(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 Wx=L(()=>{"use strict"});function b2(e,t,a,n){let r=a.enter("list"),o=a.bulletCurrent,i=e.ordered?v2(a):Yl(a),s=e.ordered?i==="."?")":".":y2(a),l=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&&(l=!0),Om(a)===i&&c){let d=-1;for(;++d<e.children.length;){let p=e.children[d];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(i=s),a.bulletCurrent=i;let u=a.containerFlow(e,n);return a.bulletLastUsed=i,a.bulletCurrent=o,r(),u}var S2=L(()=>{"use strict";Pm();w2();x2();Wx()});function I2(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 C2=L(()=>{"use strict"});function k2(e,t,a,n){let r=I2(a),o=a.bulletCurrent||Yl(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 s=a.createTracker(n);s.move(o+" ".repeat(i-o.length)),s.shift(i);let l=a.enter("listItem"),u=a.indentLines(a.containerFlow(e,s.current()),c);return l(),u;function c(d,p,m){return p?(m?"":" ".repeat(i))+d:(m?o:o+" ".repeat(i-o.length))+d}}var T2=L(()=>{"use strict";Pm();C2()});function L2(e,t,a,n){let r=a.enter("paragraph"),o=a.enter("phrasing"),i=a.containerPhrasing(e,n);return o(),r(),i}var E2=L(()=>{"use strict"});var Gx,A2=L(()=>{"use strict";Sm();Gx=Zo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var M2=L(()=>{"use strict";A2()});function R2(e,t,a,n){return(e.children.some(function(i){return Gx(i)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}var D2=L(()=>{"use strict";M2()});function _2(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 P2=L(()=>{"use strict"});function Xx(e,t,a,n){let r=_2(a),o=a.enter("strong"),i=a.createTracker(n),s=i.move(r+r),l=i.move(a.containerPhrasing(e,{after:r,before:s,...i.current()})),u=l.charCodeAt(0),c=Kl(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(l=ti(u)+l.slice(1));let d=l.charCodeAt(l.length-1),p=Kl(n.after.charCodeAt(0),d,r);p.inside&&(l=l.slice(0,-1)+ti(d));let m=i.move(r+r);return o(),a.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},s+l+m}function L$(e,t,a){return a.options.strong||"*"}var O2=L(()=>{"use strict";P2();Rm();Ux();Xx.peek=L$});function N2(e,t,a,n){return a.safe(e.value,n)}var U2=L(()=>{"use strict"});function B2(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 z2=L(()=>{"use strict"});function F2(e,t,a){let n=(Om(a)+(a.options.ruleSpaces?" ":"")).repeat(B2(a));return a.options.ruleSpaces?n.slice(0,-1):n}var q2=L(()=>{"use strict";z2();Wx()});var gd,H2=L(()=>{"use strict";zR();jR();ZR();QR();a2();u2();c2();d2();f2();p2();h2();g2();S2();T2();E2();D2();O2();U2();q2();gd={blockquote:BR,break:Nx,code:YR,definition:JR,emphasis:Bx,hardBreak:Nx,heading:l2,html:zx,image:Fx,imageReference:qx,inlineCode:Hx,link:Vx,linkReference:$x,list:b2,listItem:k2,paragraph:L2,root:R2,strong:Xx,text:N2,thematicBreak:F2}});function Zl(e){let t="&"+e+";";j2.innerHTML=t;let a=j2.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}var j2,Nm=L(()=>{"use strict";j2=document.createElement("i")});function Um(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 Kx=L(()=>{"use strict"});function V2(e){return e.replace(E$,A$)}function A$(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let r=a.charCodeAt(1),o=r===120||r===88;return Um(a.slice(o?2:1),o?16:10)}return Zl(a)||e}var E$,$2=L(()=>{"use strict";Nm();Kx();E$=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var Yx=L(()=>{"use strict";H2()});function Jx(){return{enter:{table:M$,tableData:W2,tableHeader:W2,tableRow:D$},exit:{codeText:_$,table:R$,tableData:Zx,tableHeader:Zx,tableRow:Zx}}}function M$(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 R$(e){this.exit(e),this.data.inTable=void 0}function D$(e){this.enter({type:"tableRow",children:[]},e)}function Zx(e){this.exit(e)}function W2(e){this.enter({type:"tableCell",children:[]},e)}function _$(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,P$));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function P$(e,t){return t==="|"?t:e}function Qx(e){let t=e||{},a=t.tableCellPadding,n=t.tablePipeAlign,r=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
23
23
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:i,tableCell:l,tableRow:s}};function i(m,h,v,I){return u(c(m,v,I),m.align)}function s(m,h,v,I){let y=d(m,v,I),w=u([y]);return w.slice(0,w.indexOf(`
|
|
24
|
-
`))}function l(m,h,v,I){let y=v.enter("tableCell"),w=v.enter("phrasing"),g=v.containerPhrasing(m,{...I,before:o,after:o});return w(),y(),g}function u(m,h){return PR(m,{align:h,alignDelimiters:n,padding:a,stringLength:r})}function c(m,h,v){let I=m.children,y=-1,w=[],g=h.enter("table");for(;++y<I.length;)w[y]=d(I[y],h,v);return g(),w}function d(m,h,v){let I=m.children,y=-1,w=[],g=h.enter("tableRow");for(;++y<I.length;)w[y]=l(I[y],m,h,v);return g(),w}function p(m,h,v){let I=hd.inlineCode(m,h,v);return v.stack.includes("tableCell")&&(I=I.replace(/\|/g,"\\$&")),I}}var $2=L(()=>{"use strict";OR();Xx()});var W2=L(()=>{"use strict";$2()});function Jx(){return{exit:{taskListCheckValueChecked:G2,taskListCheckValueUnchecked:G2,paragraph:_$}}}function Qx(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:P$}}}function G2(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function _$(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 s=r[o];if(s.type==="paragraph"){i=s;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 P$(e,t,a,n){let r=e.children[0],o=typeof e.checked=="boolean"&&r&&r.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",s=a.createTracker(n);o&&s.move(i);let l=hd.listItem(e,t,a,{...n,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+i}}var X2=L(()=>{"use strict";Xx()});var K2=L(()=>{"use strict";X2()});function eb(){return[Ex(),Mx(),Dx(),Yx(),Jx()]}function tb(e){return{extensions:[Ax(),Rx(e),_x(),Zx(e),Qx()]}}var Y2=L(()=>{"use strict";kR();AR();DR();W2();K2()});var Z2=L(()=>{"use strict";Y2()});function Zt(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 Ba(e,t){return e.length>0?(Zt(e,e.length,0,t),e):t}var no=L(()=>{"use strict"});function Nm(e){let t={},a=-1;for(;++a<e.length;)O$(t,e[a]);return t}function O$(e,t){let a;for(a in t){let r=(J2.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){J2.call(r,i)||(r[i]=[]);let s=o[i];N$(r[i],Array.isArray(s)?s:s?[s]:[])}}}function N$(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);Zt(e,0,0,n)}var J2,ab=L(()=>{"use strict";no();J2={}.hasOwnProperty});function rb(){return{text:kr}}function z$(e,t,a){let n=this,r,o;return i;function i(d){return!nb(d)||!iD.call(n,n.previous)||ob(n.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return nb(d)?(e.consume(d),s):d===64?(e.consume(d),l):a(d)}function l(d){return d===46?e.check(B$,c,u)(d):d===45||d===95||jt(d)?(o=!0,e.consume(d),l):c(d)}function u(d){return e.consume(d),r=!0,l}function c(d){return o&&r&&sa(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):a(d)}}function F$(e,t,a){let n=this;return r;function r(i){return i!==87&&i!==119||!rD.call(n,n.previous)||ob(n.events)?a(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(U$,e.attempt(Q2,e.attempt(eD,o),a),a)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function q$(e,t,a){let n=this,r="",o=!1;return i;function i(d){return(d===72||d===104)&&oD.call(n,n.previous)&&!ob(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(d),e.consume(d),s):a(d)}function s(d){if(sa(d)&&r.length<5)return r+=String.fromCodePoint(d),e.consume(d),s;if(d===58){let p=r.toLowerCase();if(p==="http"||p==="https")return e.consume(d),l}return a(d)}function l(d){return d===47?(e.consume(d),o?u:(o=!0,l)):a(d)}function u(d){return d===null||is(d)||$e(d)||Cr(d)||ss(d)?a(d):e.attempt(Q2,e.attempt(eD,c),a)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function H$(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 j$(e,t,a){let n,r,o;return i;function i(u){return u===46||u===95?e.check(tD,l,s)(u):u===null||$e(u)||Cr(u)||u!==45&&ss(u)?l(u):(o=!0,e.consume(u),i)}function s(u){return u===95?n=!0:(r=n,n=void 0),e.consume(u),i}function l(u){return r||n||!o?a(u):t(u)}}function V$(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(tD,t,o)(i):i===null||$e(i)||Cr(i)?t(i):(e.consume(i),r)}function o(i){return i===41&&n++,e.consume(i),r}}function $$(e,t,a){return n;function n(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),n):s===38?(e.consume(s),o):s===93?(e.consume(s),r):s===60||s===null||$e(s)||Cr(s)?t(s):a(s)}function r(s){return s===null||s===40||s===91||$e(s)||Cr(s)?t(s):n(s)}function o(s){return sa(s)?i(s):a(s)}function i(s){return s===59?(e.consume(s),n):sa(s)?(e.consume(s),i):a(s)}}function W$(e,t,a){return n;function n(o){return e.consume(o),r}function r(o){return jt(o)?a(o):t(o)}}function rD(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||$e(e)}function oD(e){return!sa(e)}function iD(e){return!(e===47||nb(e))}function nb(e){return e===43||e===45||e===46||e===95||jt(e)}function ob(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 U$,Q2,eD,tD,B$,aD,nD,ro,kr,us,sD=L(()=>{"use strict";at();U$={tokenize:H$,partial:!0},Q2={tokenize:j$,partial:!0},eD={tokenize:V$,partial:!0},tD={tokenize:$$,partial:!0},B$={tokenize:W$,partial:!0},aD={name:"wwwAutolink",tokenize:F$,previous:rD},nD={name:"protocolAutolink",tokenize:q$,previous:oD},ro={name:"emailAutolink",tokenize:z$,previous:iD},kr={};us=48;for(;us<123;)kr[us]=ro,us++,us===58?us=65:us===91&&(us=97);kr[43]=ro;kr[45]=ro;kr[46]=ro;kr[95]=ro;kr[72]=[ro,nD];kr[104]=[ro,nD];kr[87]=[ro,aD];kr[119]=[ro,aD]});function Fn(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";if(o===37&&jt(e.charCodeAt(a+1))&&jt(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 s=e.charCodeAt(a+1);o<56320&&s>56319&&s<57344?(i=String.fromCharCode(o,s),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 cs=L(()=>{"use strict";at()});var lD=L(()=>{"use strict";sD()});function ai(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 gd=L(()=>{"use strict"});function G$(e,t){let a=-1,n,r,o,i,s,l,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;l=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},p={...e[a][1].start};uD(d,-l),uD(p,l),i={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[a][1].start}},r={type:l>1?"strong":"emphasis",start:{...i.start},end:{...s.end}},e[n][1].end={...i.start},e[a][1].start={...s.end},u=[],e[n][1].end.offset-e[n][1].start.offset&&(u=Ba(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=Ba(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=Ba(u,ai(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=Ba(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[a][1].end.offset-e[a][1].start.offset?(c=2,u=Ba(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,Zt(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 X$(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=ao(n),o;return i;function i(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;let u=e.exit("attentionSequence"),c=ao(l),d=!c||c===2&&r||a.includes(l),p=!r||r===2&&c||a.includes(n);return u._open=!!(o===42?d:d&&(r||!p)),u._close=!!(o===42?p:p&&(c||!d)),t(l)}}function uD(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var yd,cD=L(()=>{"use strict";no();Mm();gd();yd={name:"attention",resolveAll:G$,tokenize:X$}});function K$(e,t,a){let n=0;return r;function r(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(m){return sa(m)?(e.consume(m),i):m===64?a(m):u(m)}function i(m){return m===43||m===45||m===46||jt(m)?(n=1,s(m)):u(m)}function s(m){return m===58?(e.consume(m),n=0,l):(m===43||m===45||m===46||jt(m))&&n++<32?(e.consume(m),s):(n=0,u(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||is(m)?a(m):(e.consume(m),l)}function u(m){return m===64?(e.consume(m),c):yR(m)?(e.consume(m),u):a(m)}function c(m){return jt(m)?d(m):a(m)}function d(m){return m===46?(e.consume(m),n=0,c):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||jt(m))&&n++<63){let h=m===45?p:d;return e.consume(m),h}return a(m)}}var ib,dD=L(()=>{"use strict";at();ib={name:"autolink",tokenize:K$}});function ye(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(l){return ve(l)?(e.enter(a),s(l)):t(l)}function s(l){return ve(l)&&o++<r?(e.consume(l),s):(e.exit(a),t(l))}}var Jt=L(()=>{"use strict";at()});function Y$(e,t,a){return n;function n(o){return ve(o)?ye(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||ne(o)?t(o):a(o)}}var Tr,Um=L(()=>{"use strict";Jt();at();Tr={partial:!0,tokenize:Y$}});function Z$(e,t,a){let n=this;return r;function r(i){if(i===62){let s=n.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),o}return a(i)}function o(i){return ve(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function J$(e,t,a){let n=this;return r;function r(i){return ve(i)?ye(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(Bm,t,a)(i)}}function Q$(e){e.exit("blockQuote")}var Bm,fD=L(()=>{"use strict";Jt();at();Bm={continuation:{tokenize:J$},exit:Q$,name:"blockQuote",tokenize:Z$}});function e8(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 vR(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var zm,pD=L(()=>{"use strict";at();zm={name:"characterEscape",tokenize:e8}});function t8(e,t,a){let n=this,r=0,o,i;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,i=jt,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=wR,c):(e.enter("characterReferenceValue"),o=7,i=md,c(d))}function c(d){if(d===59&&r){let p=e.exit("characterReferenceValue");return i===jt&&!Zl(n.sliceSerialize(p))?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 Fm,mD=L(()=>{"use strict";Pm();at();Fm={name:"characterReference",tokenize:t8}});function a8(e,t,a){let n=this,r={partial:!0,tokenize:E},o=0,i=0,s;return l;function l(T){return u(T)}function u(T){let R=n.events[n.events.length-1];return o=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,s=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(T)}function c(T){return T===s?(i++,e.consume(T),c):i<3?a(T):(e.exit("codeFencedFenceSequence"),ve(T)?ye(e,d,"whitespace")(T):d(T))}function d(T){return T===null||ne(T)?(e.exit("codeFencedFence"),n.interrupt?t(T):e.check(hD,v,S)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(T))}function p(T){return T===null||ne(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(T)):ve(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ye(e,m,"whitespace")(T)):T===96&&T===s?a(T):(e.consume(T),p)}function m(T){return T===null||ne(T)?d(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===null||ne(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(T)):T===96&&T===s?a(T):(e.consume(T),h)}function v(T){return e.attempt(r,S,I)(T)}function I(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),y}function y(T){return o>0&&ve(T)?ye(e,w,"linePrefix",o+1)(T):w(T)}function w(T){return T===null||ne(T)?e.check(hD,v,S)(T):(e.enter("codeFlowValue"),g(T))}function g(T){return T===null||ne(T)?(e.exit("codeFlowValue"),w(T)):(e.consume(T),g)}function S(T){return e.exit("codeFenced"),t(T)}function E(T,R,O){let U=0;return A;function A(X){return T.enter("lineEnding"),T.consume(X),T.exit("lineEnding"),Q}function Q(X){return T.enter("codeFencedFence"),ve(X)?ye(T,$,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):$(X)}function $(X){return X===s?(T.enter("codeFencedFenceSequence"),q(X)):O(X)}function q(X){return X===s?(U++,T.consume(X),q):U>=i?(T.exit("codeFencedFenceSequence"),ve(X)?ye(T,Z,"whitespace")(X):Z(X)):O(X)}function Z(X){return X===null||ne(X)?(T.exit("codeFencedFence"),R(X)):O(X)}}}function n8(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 hD,qm,gD=L(()=>{"use strict";Jt();at();hD={partial:!0,tokenize:n8},qm={concrete:!0,name:"codeFenced",tokenize:a8}});function o8(e,t,a){let n=this;return r;function r(u){return e.enter("codeIndented"),ye(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?l(u):ne(u)?e.attempt(r8,i,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||ne(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function i8(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):ne(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):ye(e,o,"linePrefix",5)(i)}function o(i){let s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):ne(i)?r(i):a(i)}}var wd,r8,yD=L(()=>{"use strict";Jt();at();wd={name:"codeIndented",tokenize:o8},r8={partial:!0,tokenize:i8}});function s8(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 l8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function u8(e,t,a){let n=this,r=0,o,i;return s;function s(p){return e.enter("codeText"),e.enter("codeTextSequence"),l(p)}function l(p){return p===96?(e.consume(p),r++,l):(e.exit("codeTextSequence"),u(p))}function u(p){return p===null?a(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),u):p===96?(i=e.enter("codeTextSequence"),o=0,d(p)):ne(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||ne(p)?(e.exit("codeTextData"),u(p)):(e.consume(p),c)}function d(p){return p===96?(e.consume(p),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}var sb,wD=L(()=>{"use strict";at();sb={name:"codeText",previous:l8,resolve:s8,tokenize:u8}});function vd(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 Hm,vD=L(()=>{"use strict";Hm=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&&vd(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),vd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vd(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);vd(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);vd(this.left,a.reverse())}}}});function jm(e){let t={},a=-1,n,r,o,i,s,l,u,c=new Hm(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"&&(l=n[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,c8(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},s=c.slice(r,a),s.unshift(n),c.splice(r,a-r+1,s))}}return Zt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function c8(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 s=i.events,l=[],u={},c,d,p=-1,m=a,h=0,v=0,I=[v];for(;m;){for(;e.get(++r)[1]!==m;);o.push(r),m._tokenizer||(c=n.sliceStream(m),m.next||c.push(null),d&&i.defineSkip(m.start),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=a;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(v=p+1,I.push(v),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(i.events=[],m?(m._tokenizer=void 0,m.previous=void 0):I.pop(),p=I.length;p--;){let y=s.slice(I[p],I[p+1]),w=o.pop();l.push([w,w+y.length-1]),e.splice(w,2,y)}for(l.reverse(),p=-1;++p<l.length;)u[h+l[p][0]]=h+l[p][1],h+=l[p][1]-l[p][0]-1;return u}var lb=L(()=>{"use strict";no();vD()});function f8(e){return jm(e),e}function p8(e,t){let a;return n;function n(s){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),r(s)}function r(s){return s===null?o(s):ne(s)?e.check(d8,i,o)(s):(e.consume(s),r)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function i(s){return e.consume(s),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,r}}function m8(e,t,a){let n=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),ye(e,o,"linePrefix")}function o(i){if(i===null||ne(i))return a(i);let s=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):e.interrupt(n.parser.constructs.flow,a,t)(i)}}var ub,d8,xD=L(()=>{"use strict";Jt();at();lb();ub={resolve:f8,tokenize:p8},d8={partial:!0,tokenize:m8}});function Vm(e,t,a,n,r,o,i,s,l){let u=l||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),p):y===null||y===32||y===41||is(y)?a(y):(e.enter(n),e.enter(i),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(s),p(y)):y===null||y===60||ne(y)?a(y):(e.consume(y),y===92?h:m)}function h(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function v(y){return!c&&(y===null||y===41||$e(y))?(e.exit("chunkString"),e.exit(s),e.exit(i),e.exit(n),t(y)):c<u&&y===40?(e.consume(y),c++,v):y===41?(e.consume(y),c--,v):y===null||y===32||y===40||is(y)?a(y):(e.consume(y),y===92?I:v)}function I(y){return y===40||y===41||y===92?(e.consume(y),v):v(y)}}var cb=L(()=>{"use strict";at()});function $m(e,t,a,n,r,o){let i=this,s=0,l;return u;function u(m){return e.enter(n),e.enter(r),e.consume(m),e.exit(r),e.enter(o),c}function c(m){return s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?a(m):m===93?(e.exit(o),e.enter(r),e.consume(m),e.exit(r),e.exit(n),t):ne(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||ne(m)||s++>999?(e.exit("chunkString"),c(m)):(e.consume(m),l||(l=!ve(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}var db=L(()=>{"use strict";at()});function Wm(e,t,a,n,r,o){let i;return s;function s(p){return p===34||p===39||p===40?(e.enter(n),e.enter(r),e.consume(p),e.exit(r),i=p===40?41:p,l):a(p)}function l(p){return p===i?(e.enter(r),e.consume(p),e.exit(r),e.exit(n),t):(e.enter(o),u(p))}function u(p){return p===i?(e.exit(o),l(i)):p===null?a(p):ne(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ye(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===i||p===null||ne(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:c)}function d(p){return p===i||p===92?(e.consume(p),c):c(p)}}var fb=L(()=>{"use strict";Jt();at()});function ds(e,t){let a;return n;function n(r){return ne(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):ve(r)?ye(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var pb=L(()=>{"use strict";Jt();at()});function g8(e,t,a){let n=this,r;return o;function o(m){return e.enter("definition"),i(m)}function i(m){return $m.call(n,e,s,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return r=Aa(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):a(m)}function l(m){return $e(m)?ds(e,u)(m):u(m)}function u(m){return Vm(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function c(m){return e.attempt(h8,d,d)(m)}function d(m){return ve(m)?ye(e,p,"whitespace")(m):p(m)}function p(m){return m===null||ne(m)?(e.exit("definition"),n.parser.defined.push(r),t(m)):a(m)}}function y8(e,t,a){return n;function n(s){return $e(s)?ds(e,r)(s):a(s)}function r(s){return Wm(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ve(s)?ye(e,i,"whitespace")(s):i(s)}function i(s){return s===null||ne(s)?t(s):a(s)}}var mb,h8,bD=L(()=>{"use strict";cb();db();Jt();fb();pb();at();Gl();mb={name:"definition",tokenize:g8},h8={partial:!0,tokenize:y8}});function w8(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return ne(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var hb,SD=L(()=>{"use strict";at();hb={name:"hardBreakEscape",tokenize:w8}});function v8(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"},Zt(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function x8(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||$e(c)?(e.exit("atxHeadingSequence"),s(c)):a(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||ne(c)?(e.exit("atxHeading"),t(c)):ve(c)?ye(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||$e(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}var gb,ID=L(()=>{"use strict";Jt();at();no();gb={name:"headingAtx",resolve:v8,tokenize:x8}});var CD,yb,kD=L(()=>{"use strict";CD=["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"],yb=["pre","script","style","textarea"]});function I8(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 C8(e,t,a){let n=this,r,o,i,s,l;return u;function u(x){return c(x)}function c(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),d}function d(x){return x===33?(e.consume(x),p):x===47?(e.consume(x),o=!0,v):x===63?(e.consume(x),r=3,n.interrupt?t:C):sa(x)?(e.consume(x),i=String.fromCharCode(x),I):a(x)}function p(x){return x===45?(e.consume(x),r=2,m):x===91?(e.consume(x),r=5,s=0,h):sa(x)?(e.consume(x),r=4,n.interrupt?t:C):a(x)}function m(x){return x===45?(e.consume(x),n.interrupt?t:C):a(x)}function h(x){let ae="CDATA[";return x===ae.charCodeAt(s++)?(e.consume(x),s===ae.length?n.interrupt?t:$:h):a(x)}function v(x){return sa(x)?(e.consume(x),i=String.fromCharCode(x),I):a(x)}function I(x){if(x===null||x===47||x===62||$e(x)){let ae=x===47,re=i.toLowerCase();return!ae&&!o&&yb.includes(re)?(r=1,n.interrupt?t(x):$(x)):CD.includes(i.toLowerCase())?(r=6,ae?(e.consume(x),y):n.interrupt?t(x):$(x)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(x):o?w(x):g(x))}return x===45||jt(x)?(e.consume(x),i+=String.fromCharCode(x),I):a(x)}function y(x){return x===62?(e.consume(x),n.interrupt?t:$):a(x)}function w(x){return ve(x)?(e.consume(x),w):A(x)}function g(x){return x===47?(e.consume(x),A):x===58||x===95||sa(x)?(e.consume(x),S):ve(x)?(e.consume(x),g):A(x)}function S(x){return x===45||x===46||x===58||x===95||jt(x)?(e.consume(x),S):E(x)}function E(x){return x===61?(e.consume(x),T):ve(x)?(e.consume(x),E):g(x)}function T(x){return x===null||x===60||x===61||x===62||x===96?a(x):x===34||x===39?(e.consume(x),l=x,R):ve(x)?(e.consume(x),T):O(x)}function R(x){return x===l?(e.consume(x),l=null,U):x===null||ne(x)?a(x):(e.consume(x),R)}function O(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||$e(x)?E(x):(e.consume(x),O)}function U(x){return x===47||x===62||ve(x)?g(x):a(x)}function A(x){return x===62?(e.consume(x),Q):a(x)}function Q(x){return x===null||ne(x)?$(x):ve(x)?(e.consume(x),Q):a(x)}function $(x){return x===45&&r===2?(e.consume(x),B):x===60&&r===1?(e.consume(x),P):x===62&&r===4?(e.consume(x),ze):x===63&&r===3?(e.consume(x),C):x===93&&r===5?(e.consume(x),ge):ne(x)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(b8,ot,q)(x)):x===null||ne(x)?(e.exit("htmlFlowData"),q(x)):(e.consume(x),$)}function q(x){return e.check(S8,Z,ot)(x)}function Z(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),X}function X(x){return x===null||ne(x)?q(x):(e.enter("htmlFlowData"),$(x))}function B(x){return x===45?(e.consume(x),C):$(x)}function P(x){return x===47?(e.consume(x),i="",J):$(x)}function J(x){if(x===62){let ae=i.toLowerCase();return yb.includes(ae)?(e.consume(x),ze):$(x)}return sa(x)&&i.length<8?(e.consume(x),i+=String.fromCharCode(x),J):$(x)}function ge(x){return x===93?(e.consume(x),C):$(x)}function C(x){return x===62?(e.consume(x),ze):x===45&&r===2?(e.consume(x),C):$(x)}function ze(x){return x===null||ne(x)?(e.exit("htmlFlowData"),ot(x)):(e.consume(x),ze)}function ot(x){return e.exit("htmlFlow"),t(x)}}function k8(e,t,a){let n=this;return r;function r(i){return ne(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 T8(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Tr,t,a)}}var wb,b8,S8,TD=L(()=>{"use strict";at();kD();Um();wb={concrete:!0,name:"htmlFlow",resolveTo:I8,tokenize:C8},b8={partial:!0,tokenize:T8},S8={partial:!0,tokenize:k8}});function L8(e,t,a){let n=this,r,o,i;return s;function s(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),l}function l(C){return C===33?(e.consume(C),u):C===47?(e.consume(C),E):C===63?(e.consume(C),g):sa(C)?(e.consume(C),O):a(C)}function u(C){return C===45?(e.consume(C),c):C===91?(e.consume(C),o=0,h):sa(C)?(e.consume(C),w):a(C)}function c(C){return C===45?(e.consume(C),m):a(C)}function d(C){return C===null?a(C):C===45?(e.consume(C),p):ne(C)?(i=d,P(C)):(e.consume(C),d)}function p(C){return C===45?(e.consume(C),m):d(C)}function m(C){return C===62?B(C):C===45?p(C):d(C)}function h(C){let ze="CDATA[";return C===ze.charCodeAt(o++)?(e.consume(C),o===ze.length?v:h):a(C)}function v(C){return C===null?a(C):C===93?(e.consume(C),I):ne(C)?(i=v,P(C)):(e.consume(C),v)}function I(C){return C===93?(e.consume(C),y):v(C)}function y(C){return C===62?B(C):C===93?(e.consume(C),y):v(C)}function w(C){return C===null||C===62?B(C):ne(C)?(i=w,P(C)):(e.consume(C),w)}function g(C){return C===null?a(C):C===63?(e.consume(C),S):ne(C)?(i=g,P(C)):(e.consume(C),g)}function S(C){return C===62?B(C):g(C)}function E(C){return sa(C)?(e.consume(C),T):a(C)}function T(C){return C===45||jt(C)?(e.consume(C),T):R(C)}function R(C){return ne(C)?(i=R,P(C)):ve(C)?(e.consume(C),R):B(C)}function O(C){return C===45||jt(C)?(e.consume(C),O):C===47||C===62||$e(C)?U(C):a(C)}function U(C){return C===47?(e.consume(C),B):C===58||C===95||sa(C)?(e.consume(C),A):ne(C)?(i=U,P(C)):ve(C)?(e.consume(C),U):B(C)}function A(C){return C===45||C===46||C===58||C===95||jt(C)?(e.consume(C),A):Q(C)}function Q(C){return C===61?(e.consume(C),$):ne(C)?(i=Q,P(C)):ve(C)?(e.consume(C),Q):U(C)}function $(C){return C===null||C===60||C===61||C===62||C===96?a(C):C===34||C===39?(e.consume(C),r=C,q):ne(C)?(i=$,P(C)):ve(C)?(e.consume(C),$):(e.consume(C),Z)}function q(C){return C===r?(e.consume(C),r=void 0,X):C===null?a(C):ne(C)?(i=q,P(C)):(e.consume(C),q)}function Z(C){return C===null||C===34||C===39||C===60||C===61||C===96?a(C):C===47||C===62||$e(C)?U(C):(e.consume(C),Z)}function X(C){return C===47||C===62||$e(C)?U(C):a(C)}function B(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):a(C)}function P(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),J}function J(C){return ve(C)?ye(e,ge,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):ge(C)}function ge(C){return e.enter("htmlTextData"),i(C)}}var vb,LD=L(()=>{"use strict";Jt();at();vb={name:"htmlText",tokenize:L8}});function R8(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&&Zt(e,0,e.length,a),e}function D8(e,t){let a=e.length,n=0,r,o,i,s;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 l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[o+n+2][1].end},end:{...e[i-2][1].start}};return s=[["enter",l,t],["enter",u,t]],s=Ba(s,e.slice(o+1,o+n+3)),s=Ba(s,[["enter",c,t]]),s=Ba(s,ai(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),s=Ba(s,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),s=Ba(s,e.slice(i+1)),s=Ba(s,[["exit",l,t]]),Zt(e,o,e.length,s),e}function _8(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 s;function s(p){return o?o._inactive?d(p):(i=n.parser.defined.includes(Aa(n.sliceSerialize({start:o.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):a(p)}function l(p){return p===40?e.attempt(E8,c,i?c:d)(p):p===91?e.attempt(A8,c,i?u:d)(p):i?c(p):d(p)}function u(p){return e.attempt(M8,c,d)(p)}function c(p){return t(p)}function d(p){return o._balanced=!0,a(p)}}function P8(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 $e(d)?ds(e,o)(d):o(d)}function o(d){return d===41?c(d):Vm(e,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return $e(d)?ds(e,l)(d):c(d)}function s(d){return a(d)}function l(d){return d===34||d===39||d===40?Wm(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return $e(d)?ds(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 O8(e,t,a){let n=this;return r;function r(s){return $m.call(n,e,o,i,"reference","referenceMarker","referenceString")(s)}function o(s){return n.parser.defined.includes(Aa(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(s):a(s)}function i(s){return a(s)}}function N8(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 fs,E8,A8,M8,Gm=L(()=>{"use strict";cb();db();fb();pb();at();no();Gl();gd();fs={name:"labelEnd",resolveAll:R8,resolveTo:D8,tokenize:_8},E8={tokenize:P8},A8={tokenize:O8},M8={tokenize:N8}});function U8(e,t,a){let n=this;return r;function r(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),i):a(s)}function i(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(s):t(s)}}var xb,ED=L(()=>{"use strict";Gm();xb={name:"labelStartImage",resolveAll:fs.resolveAll,tokenize:U8}});function B8(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 bb,AD=L(()=>{"use strict";Gm();bb={name:"labelStartLink",resolveAll:fs.resolveAll,tokenize:B8}});function z8(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ye(e,t,"linePrefix")}}var xd,MD=L(()=>{"use strict";Jt();xd={name:"lineEnding",tokenize:z8}});function F8(e,t,a){let n=0,r;return o;function o(u){return e.enter("thematicBreak"),i(u)}function i(u){return r=u,s(u)}function s(u){return u===r?(e.enter("thematicBreakSequence"),l(u)):n>=3&&(u===null||ne(u))?(e.exit("thematicBreak"),t(u)):a(u)}function l(u){return u===r?(e.consume(u),n++,l):(e.exit("thematicBreakSequence"),ve(u)?ye(e,s,"whitespace")(u):s(u))}}var ps,Sb=L(()=>{"use strict";Jt();at();ps={name:"thematicBreak",tokenize:F8}});function j8(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 s;function s(m){let h=n.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!n.containerState.marker||m===n.containerState.marker:md(m)){if(n.containerState.type||(n.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(ps,a,u)(m):u(m);if(!n.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return a(m)}function l(m){return md(m)&&++i<10?(e.consume(m),l):(!n.interrupt||i<2)&&(n.containerState.marker?m===n.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):a(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||m,e.check(Tr,n.interrupt?a:c,e.attempt(q8,p,d))}function c(m){return n.containerState.initialBlankLine=!0,o++,p(m)}function d(m){return ve(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):a(m)}function p(m){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function V8(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(Tr,r,o);function r(s){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ye(e,t,"listItemIndent",n.containerState.size+1)(s)}function o(s){return n.containerState.furtherBlankLines||!ve(s)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(s)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(H8,t,i)(s))}function i(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,ye(e,e.attempt(Ma,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function $8(e,t,a){let n=this;return ye(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 W8(e){e.exit(this.containerState.type)}function G8(e,t,a){let n=this;return ye(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!ve(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var Ma,q8,H8,RD=L(()=>{"use strict";Jt();at();Um();Sb();Ma={continuation:{tokenize:V8},exit:W8,name:"list",tokenize:j8},q8={partial:!0,tokenize:G8},H8={partial:!0,tokenize:$8}});function X8(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 K8(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"),s(u)}function s(u){return u===r?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ve(u)?ye(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ne(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var Xm,DD=L(()=>{"use strict";Jt();at();Xm={name:"setextUnderline",resolveTo:X8,tokenize:K8}});var Km=L(()=>{"use strict";cD();dD();Um();fD();pD();mD();gD();yD();wD();xD();bD();SD();ID();TD();LD();Gm();ED();AD();MD();RD();DD();Sb()});function Ib(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:e7,continuation:{tokenize:t7},exit:a7}},text:{91:{name:"gfmFootnoteCall",tokenize:Q8},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Z8,resolveTo:J8}}}}function Z8(e,t,a){let n=this,r=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),i;for(;r--;){let l=n.events[r][1];if(l.type==="labelImage"){i=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!i||!i._balanced)return a(l);let u=Aa(n.sliceSerialize({start:i.end,end:n.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?a(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function J8(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)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[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",s,t],["exit",s,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(a,e.length-a+1,...l),e}function Q8(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,i;return s;function s(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(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||$e(d))return a(d);if(d===93){e.exit("chunkString");let p=e.exit("gfmFootnoteCallString");return r.includes(Aa(n.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(d)}return $e(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 e7(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,i=0,s;return l;function l(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):a(h)}function c(h){if(i>999||h===93&&!s||h===null||h===91||$e(h))return a(h);if(h===93){e.exit("chunkString");let v=e.exit("gfmFootnoteDefinitionLabelString");return o=Aa(n.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return $e(h)||(s=!0),i++,e.consume(h),h===92?d:c}function d(h){return h===91||h===92||h===93?(e.consume(h),i++,c):c(h)}function p(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),r.includes(o)||r.push(o),ye(e,m,"gfmFootnoteDefinitionWhitespace")):a(h)}function m(h){return t(h)}}function t7(e,t,a){return e.check(Tr,t,e.attempt(Y8,t,a))}function a7(e){e.exit("gfmFootnoteDefinition")}function n7(e,t,a){let n=this;return ye(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 Y8,_D=L(()=>{"use strict";Km();Jt();at();Gl();Y8={tokenize:n7,partial:!0}});var PD=L(()=>{"use strict";_D()});function Cb(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,s){let l=-1;for(;++l<i.length;)if(i[l][0]==="enter"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._close){let u=l;for(;u--;)if(i[u][0]==="exit"&&i[u][1].type==="strikethroughSequenceTemporary"&&i[u][1]._open&&i[l][1].end.offset-i[l][1].start.offset===i[u][1].end.offset-i[u][1].start.offset){i[l][1].type="strikethroughSequence",i[u][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},i[u][1].start),end:Object.assign({},i[l][1].end)},d={type:"strikethroughText",start:Object.assign({},i[u][1].end),end:Object.assign({},i[l][1].start)},p=[["enter",c,s],["enter",i[u][1],s],["exit",i[u][1],s],["enter",d,s]],m=s.parser.constructs.insideSpan.null;m&&Zt(p,p.length,0,ai(m,i.slice(u+1,l),s)),Zt(p,p.length,0,[["exit",d,s],["enter",i[l][1],s],["exit",i[l][1],s],["exit",c,s]]),Zt(i,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<i.length;)i[l][1].type==="strikethroughSequenceTemporary"&&(i[l][1].type="data");return i}function o(i,s,l){let u=this.previous,c=this.events,d=0;return p;function p(h){return u===126&&c[c.length-1][1].type!=="characterEscape"?l(h):(i.enter("strikethroughSequenceTemporary"),m(h))}function m(h){let v=ao(u);if(h===126)return d>1?l(h):(i.consume(h),d++,m);if(d<2&&!a)return l(h);let I=i.exit("strikethroughSequenceTemporary"),y=ao(h);return I._open=!y||y===2&&!!v,I._close=!v||v===2&&!!y,s(h)}}}var OD=L(()=>{"use strict";no();Mm();gd()});var ND=L(()=>{"use strict";OD()});function r7(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 Ym,UD=L(()=>{"use strict";Ym=class{constructor(){this.map=[]}add(t,a,n){r7(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 BD(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 zD=L(()=>{"use strict"});function kb(){return{flow:{null:{name:"table",tokenize:o7,resolveAll:i7}}}}function o7(e,t,a){let n=this,r=0,o=0,i;return s;function s(A){let Q=n.events.length-1;for(;Q>-1;){let Z=n.events[Q][1].type;if(Z==="lineEnding"||Z==="linePrefix")Q--;else break}let $=Q>-1?n.events[Q][1].type:null,q=$==="tableHead"||$==="tableRow"?T:l;return q===T&&n.parser.lazy[n.now().line]?a(A):q(A)}function l(A){return e.enter("tableHead"),e.enter("tableRow"),u(A)}function u(A){return A===124||(i=!0,o+=1),c(A)}function c(A){return A===null?a(A):ne(A)?o>1?(o=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),m):a(A):ve(A)?ye(e,c,"whitespace")(A):(o+=1,i&&(i=!1,r+=1),A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),i=!0,c):(e.enter("data"),d(A)))}function d(A){return A===null||A===124||$e(A)?(e.exit("data"),c(A)):(e.consume(A),A===92?p:d)}function p(A){return A===92||A===124?(e.consume(A),d):d(A)}function m(A){return n.interrupt=!1,n.parser.lazy[n.now().line]?a(A):(e.enter("tableDelimiterRow"),i=!1,ve(A)?ye(e,h,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):h(A))}function h(A){return A===45||A===58?I(A):A===124?(i=!0,e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),v):E(A)}function v(A){return ve(A)?ye(e,I,"whitespace")(A):I(A)}function I(A){return A===58?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),y):A===45?(o+=1,y(A)):A===null||ne(A)?S(A):E(A)}function y(A){return A===45?(e.enter("tableDelimiterFiller"),w(A)):E(A)}function w(A){return A===45?(e.consume(A),w):A===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(A))}function g(A){return ve(A)?ye(e,S,"whitespace")(A):S(A)}function S(A){return A===124?h(A):A===null||ne(A)?!i||r!==o?E(A):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(A)):E(A)}function E(A){return a(A)}function T(A){return e.enter("tableRow"),R(A)}function R(A){return A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),R):A===null||ne(A)?(e.exit("tableRow"),t(A)):ve(A)?ye(e,R,"whitespace")(A):(e.enter("data"),O(A))}function O(A){return A===null||A===124||$e(A)?(e.exit("data"),R(A)):(e.consume(A),A===92?U:O)}function U(A){return A===92||A===124?(e.consume(A),O):O(A)}}function i7(e,t){let a=-1,n=!0,r=0,o=[0,0,0,0],i=[0,0,0,0],s=!1,l=0,u,c,d,p=new Ym;for(;++a<e.length;){let m=e[a],h=m[1];m[0]==="enter"?h.type==="tableHead"?(s=!1,l!==0&&(FD(p,t,l,u,c),c=void 0,l=0),u={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(a,0,[["enter",u,t]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(n=!0,d=void 0,o=[0,0,0,0],i=[0,a+1,0,0],s&&(s=!1,c={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(a,0,[["enter",c,t]])),r=h.type==="tableDelimiterRow"?2:c?3:1):r&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")?(n=!1,i[2]===0&&(o[1]!==0&&(i[0]=i[1],d=Zm(p,t,o,r,void 0,d),o=[0,0,0,0]),i[2]=a)):h.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(i[0]=i[1],d=Zm(p,t,o,r,void 0,d)),o=i,i=[o[1],a,0,0])):h.type==="tableHead"?(s=!0,l=a):h.type==="tableRow"||h.type==="tableDelimiterRow"?(l=a,o[1]!==0?(i[0]=i[1],d=Zm(p,t,o,r,a,d)):i[1]!==0&&(d=Zm(p,t,i,r,a,d)),r=0):r&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(i[3]=a)}for(l!==0&&FD(p,t,l,u,c),p.consume(t.events),a=-1;++a<t.events.length;){let m=t.events[a];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=BD(t.events,a))}return e}function Zm(e,t,a,n,r,o){let i=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",s="tableContent";a[0]!==0&&(o.end=Object.assign({},Jl(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));let l=Jl(t.events,a[1]);if(o={type:i,start:Object.assign({},l),end:Object.assign({},l)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){let u=Jl(t.events,a[2]),c=Jl(t.events,a[3]),d={type:s,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(a[2],0,[["enter",d,t]]),n!==2){let p=t.events[a[2]],m=t.events[a[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",a[3]>a[2]+1){let h=a[2]+1,v=a[3]-a[2]-1;e.add(h,v,[])}}e.add(a[3]+1,0,[["exit",d,t]])}return r!==void 0&&(o.end=Object.assign({},Jl(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function FD(e,t,a,n,r){let o=[],i=Jl(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 Jl(e,t){let a=e[t],n=a[0]==="enter"?"start":"end";return a[1][n]}var qD=L(()=>{"use strict";Jt();at();UD();zD()});var HD=L(()=>{"use strict";qD()});function Tb(){return{text:{91:s7}}}function l7(e,t,a){let n=this;return r;function r(l){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?a(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return $e(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),i):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),i):a(l)}function i(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):a(l)}function s(l){return ne(l)?t(l):ve(l)?e.check({tokenize:u7},t,a)(l):a(l)}}function u7(e,t,a){return ye(e,n,"whitespace");function n(r){return r===null?a(r):t(r)}}var s7,jD=L(()=>{"use strict";Jt();at();s7={name:"tasklistCheck",tokenize:l7}});var VD=L(()=>{"use strict";jD()});function $D(e){return Nm([rb(),Ib(),Cb(e),kb(),Tb()])}var WD=L(()=>{"use strict";ab();lD();PD();ND();HD();VD()});function Jm(e){let t=this,a=e||c7,n=t.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push($D(a)),o.push(eb()),i.push(tb(a))}var c7,GD=L(()=>{"use strict";Z2();WD();c7={}});var XD=L(()=>{"use strict";GD()});var d7,f7,p7,KD,m7,h7,YD,QD,e_,g7,y7,w7,v7,x7,b7,S7,ms,t_,I7,C7,k7,T7,L7,E7,ZD,ni,Ql,A7,a_,eh,M7,n_,Eb,R7,D7,r_,_7,P7,O7,N7,U7,B7,z7,F7,q7,o_,H7,j7,V7,$7,W7,G7,Qm,X7,K7,Y7,Z7,J7,Q7,eW,tW,aW,nW,JD,rW,i_,oW,iW,sW,lW,uW,cW,Lb,bn,dW,fW,pW,s_,l_=L(()=>{"use strict";d7=Object.defineProperty,f7=Object.defineProperties,p7=Object.getOwnPropertyDescriptors,KD=Object.getOwnPropertySymbols,m7=Object.prototype.hasOwnProperty,h7=Object.prototype.propertyIsEnumerable,YD=(e,t,a)=>t in e?d7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,QD=(e,t)=>{for(var a in t||(t={}))m7.call(t,a)&&YD(e,a,t[a]);if(KD)for(var a of KD(t))h7.call(t,a)&&YD(e,a,t[a]);return e},e_=(e,t)=>f7(e,p7(t)),g7=/(\*\*)([^*]*\*?)$/,y7=/(__)([^_]*?)$/,w7=/(\*\*\*)([^*]*?)$/,v7=/(\*)([^*]*?)$/,x7=/(_)([^_]*?)$/,b7=/(`)([^`]*?)$/,S7=/(~~)([^~]*?)$/,ms=/^[\s_~*`]*$/,t_=/^[\s]*[-*+][\s]+$/,I7=/[\p{L}\p{N}_]/u,C7=/^```[^`\n]*```?$/,k7=/^\*{4,}$/,T7=/(__)([^_]+)_$/,L7=/(~~)([^~]+)~$/,E7=/__/g,ZD=/~~/g,ni=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:I7.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},A7=(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},a_=(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},eh=(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},M7=(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},
|
|
24
|
+
`))}function l(m,h,v,I){let y=v.enter("tableCell"),w=v.enter("phrasing"),g=v.containerPhrasing(m,{...I,before:o,after:o});return w(),y(),g}function u(m,h){return NR(m,{align:h,alignDelimiters:n,padding:a,stringLength:r})}function c(m,h,v){let I=m.children,y=-1,w=[],g=h.enter("table");for(;++y<I.length;)w[y]=d(I[y],h,v);return g(),w}function d(m,h,v){let I=m.children,y=-1,w=[],g=h.enter("tableRow");for(;++y<I.length;)w[y]=l(I[y],m,h,v);return g(),w}function p(m,h,v){let I=gd.inlineCode(m,h,v);return v.stack.includes("tableCell")&&(I=I.replace(/\|/g,"\\$&")),I}}var G2=L(()=>{"use strict";UR();Yx()});var X2=L(()=>{"use strict";G2()});function eb(){return{exit:{taskListCheckValueChecked:K2,taskListCheckValueUnchecked:K2,paragraph:O$}}}function tb(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:N$}}}function K2(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function O$(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 s=r[o];if(s.type==="paragraph"){i=s;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 N$(e,t,a,n){let r=e.children[0],o=typeof e.checked=="boolean"&&r&&r.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",s=a.createTracker(n);o&&s.move(i);let l=gd.listItem(e,t,a,{...n,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+i}}var Y2=L(()=>{"use strict";Yx()});var Z2=L(()=>{"use strict";Y2()});function ab(){return[Mx(),Dx(),Px(),Jx(),eb()]}function nb(e){return{extensions:[Rx(),_x(e),Ox(),Qx(e),tb()]}}var J2=L(()=>{"use strict";LR();RR();PR();X2();Z2()});var Q2=L(()=>{"use strict";J2()});function Jt(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 za(e,t){return e.length>0?(Jt(e,e.length,0,t),e):t}var to=L(()=>{"use strict"});function Bm(e){let t={},a=-1;for(;++a<e.length;)U$(t,e[a]);return t}function U$(e,t){let a;for(a in t){let r=(eD.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){eD.call(r,i)||(r[i]=[]);let s=o[i];B$(r[i],Array.isArray(s)?s:s?[s]:[])}}}function B$(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);Jt(e,0,0,n)}var eD,rb=L(()=>{"use strict";to();eD={}.hasOwnProperty});function ib(){return{text:Ir}}function q$(e,t,a){let n=this,r,o;return i;function i(d){return!ob(d)||!lD.call(n,n.previous)||sb(n.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return ob(d)?(e.consume(d),s):d===64?(e.consume(d),l):a(d)}function l(d){return d===46?e.check(F$,c,u)(d):d===45||d===95||Vt(d)?(o=!0,e.consume(d),l):c(d)}function u(d){return e.consume(d),r=!0,l}function c(d){return o&&r&&la(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):a(d)}}function H$(e,t,a){let n=this;return r;function r(i){return i!==87&&i!==119||!iD.call(n,n.previous)||sb(n.events)?a(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(z$,e.attempt(tD,e.attempt(aD,o),a),a)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function j$(e,t,a){let n=this,r="",o=!1;return i;function i(d){return(d===72||d===104)&&sD.call(n,n.previous)&&!sb(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(d),e.consume(d),s):a(d)}function s(d){if(la(d)&&r.length<5)return r+=String.fromCodePoint(d),e.consume(d),s;if(d===58){let p=r.toLowerCase();if(p==="http"||p==="https")return e.consume(d),l}return a(d)}function l(d){return d===47?(e.consume(d),o?u:(o=!0,l)):a(d)}function u(d){return d===null||is(d)||$e(d)||Sr(d)||ss(d)?a(d):e.attempt(tD,e.attempt(aD,c),a)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function V$(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 $$(e,t,a){let n,r,o;return i;function i(u){return u===46||u===95?e.check(nD,l,s)(u):u===null||$e(u)||Sr(u)||u!==45&&ss(u)?l(u):(o=!0,e.consume(u),i)}function s(u){return u===95?n=!0:(r=n,n=void 0),e.consume(u),i}function l(u){return r||n||!o?a(u):t(u)}}function W$(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(nD,t,o)(i):i===null||$e(i)||Sr(i)?t(i):(e.consume(i),r)}function o(i){return i===41&&n++,e.consume(i),r}}function G$(e,t,a){return n;function n(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),n):s===38?(e.consume(s),o):s===93?(e.consume(s),r):s===60||s===null||$e(s)||Sr(s)?t(s):a(s)}function r(s){return s===null||s===40||s===91||$e(s)||Sr(s)?t(s):n(s)}function o(s){return la(s)?i(s):a(s)}function i(s){return s===59?(e.consume(s),n):la(s)?(e.consume(s),i):a(s)}}function X$(e,t,a){return n;function n(o){return e.consume(o),r}function r(o){return Vt(o)?a(o):t(o)}}function iD(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||$e(e)}function sD(e){return!la(e)}function lD(e){return!(e===47||ob(e))}function ob(e){return e===43||e===45||e===46||e===95||Vt(e)}function sb(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 z$,tD,aD,nD,F$,rD,oD,ao,Ir,us,uD=L(()=>{"use strict";at();z$={tokenize:V$,partial:!0},tD={tokenize:$$,partial:!0},aD={tokenize:W$,partial:!0},nD={tokenize:G$,partial:!0},F$={tokenize:X$,partial:!0},rD={name:"wwwAutolink",tokenize:H$,previous:iD},oD={name:"protocolAutolink",tokenize:j$,previous:sD},ao={name:"emailAutolink",tokenize:q$,previous:lD},Ir={};us=48;for(;us<123;)Ir[us]=ao,us++,us===58?us=65:us===91&&(us=97);Ir[43]=ao;Ir[45]=ao;Ir[46]=ao;Ir[95]=ao;Ir[72]=[ao,oD];Ir[104]=[ao,oD];Ir[87]=[ao,rD];Ir[119]=[ao,rD]});function Bn(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";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))||(i=String.fromCharCode(o));else if(o>55295&&o<57344){let s=e.charCodeAt(a+1);o<56320&&s>56319&&s<57344?(i=String.fromCharCode(o,s),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 cs=L(()=>{"use strict";at()});var cD=L(()=>{"use strict";uD()});function ai(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 yd=L(()=>{"use strict"});function K$(e,t){let a=-1,n,r,o,i,s,l,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;l=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},p={...e[a][1].start};dD(d,-l),dD(p,l),i={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[a][1].start}},r={type:l>1?"strong":"emphasis",start:{...i.start},end:{...s.end}},e[n][1].end={...i.start},e[a][1].start={...s.end},u=[],e[n][1].end.offset-e[n][1].start.offset&&(u=za(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=za(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=za(u,ai(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=za(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[a][1].end.offset-e[a][1].start.offset?(c=2,u=za(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,Jt(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 Y$(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=eo(n),o;return i;function i(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;let u=e.exit("attentionSequence"),c=eo(l),d=!c||c===2&&r||a.includes(l),p=!r||r===2&&c||a.includes(n);return u._open=!!(o===42?d:d&&(r||!p)),u._close=!!(o===42?p:p&&(c||!d)),t(l)}}function dD(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var wd,fD=L(()=>{"use strict";to();Dm();yd();wd={name:"attention",resolveAll:K$,tokenize:Y$}});function Z$(e,t,a){let n=0;return r;function r(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(m){return la(m)?(e.consume(m),i):m===64?a(m):u(m)}function i(m){return m===43||m===45||m===46||Vt(m)?(n=1,s(m)):u(m)}function s(m){return m===58?(e.consume(m),n=0,l):(m===43||m===45||m===46||Vt(m))&&n++<32?(e.consume(m),s):(n=0,u(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||is(m)?a(m):(e.consume(m),l)}function u(m){return m===64?(e.consume(m),c):vR(m)?(e.consume(m),u):a(m)}function c(m){return Vt(m)?d(m):a(m)}function d(m){return m===46?(e.consume(m),n=0,c):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||Vt(m))&&n++<63){let h=m===45?p:d;return e.consume(m),h}return a(m)}}var lb,pD=L(()=>{"use strict";at();lb={name:"autolink",tokenize:Z$}});function ye(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(l){return ve(l)?(e.enter(a),s(l)):t(l)}function s(l){return ve(l)&&o++<r?(e.consume(l),s):(e.exit(a),t(l))}}var Qt=L(()=>{"use strict";at()});function J$(e,t,a){return n;function n(o){return ve(o)?ye(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||ne(o)?t(o):a(o)}}var Cr,zm=L(()=>{"use strict";Qt();at();Cr={partial:!0,tokenize:J$}});function Q$(e,t,a){let n=this;return r;function r(i){if(i===62){let s=n.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),o}return a(i)}function o(i){return ve(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function e8(e,t,a){let n=this;return r;function r(i){return ve(i)?ye(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(Fm,t,a)(i)}}function t8(e){e.exit("blockQuote")}var Fm,mD=L(()=>{"use strict";Qt();at();Fm={continuation:{tokenize:e8},exit:t8,name:"blockQuote",tokenize:Q$}});function a8(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 bR(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var qm,hD=L(()=>{"use strict";at();qm={name:"characterEscape",tokenize:a8}});function n8(e,t,a){let n=this,r=0,o,i;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,i=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,i=xR,c):(e.enter("characterReferenceValue"),o=7,i=hd,c(d))}function c(d){if(d===59&&r){let p=e.exit("characterReferenceValue");return i===Vt&&!Zl(n.sliceSerialize(p))?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 Hm,gD=L(()=>{"use strict";Nm();at();Hm={name:"characterReference",tokenize:n8}});function r8(e,t,a){let n=this,r={partial:!0,tokenize:E},o=0,i=0,s;return l;function l(T){return u(T)}function u(T){let R=n.events[n.events.length-1];return o=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,s=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(T)}function c(T){return T===s?(i++,e.consume(T),c):i<3?a(T):(e.exit("codeFencedFenceSequence"),ve(T)?ye(e,d,"whitespace")(T):d(T))}function d(T){return T===null||ne(T)?(e.exit("codeFencedFence"),n.interrupt?t(T):e.check(yD,v,S)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(T))}function p(T){return T===null||ne(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(T)):ve(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ye(e,m,"whitespace")(T)):T===96&&T===s?a(T):(e.consume(T),p)}function m(T){return T===null||ne(T)?d(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===null||ne(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(T)):T===96&&T===s?a(T):(e.consume(T),h)}function v(T){return e.attempt(r,S,I)(T)}function I(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),y}function y(T){return o>0&&ve(T)?ye(e,w,"linePrefix",o+1)(T):w(T)}function w(T){return T===null||ne(T)?e.check(yD,v,S)(T):(e.enter("codeFlowValue"),g(T))}function g(T){return T===null||ne(T)?(e.exit("codeFlowValue"),w(T)):(e.consume(T),g)}function S(T){return e.exit("codeFenced"),t(T)}function E(T,R,O){let U=0;return A;function A(X){return T.enter("lineEnding"),T.consume(X),T.exit("lineEnding"),Q}function Q(X){return T.enter("codeFencedFence"),ve(X)?ye(T,$,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):$(X)}function $(X){return X===s?(T.enter("codeFencedFenceSequence"),H(X)):O(X)}function H(X){return X===s?(U++,T.consume(X),H):U>=i?(T.exit("codeFencedFenceSequence"),ve(X)?ye(T,Z,"whitespace")(X):Z(X)):O(X)}function Z(X){return X===null||ne(X)?(T.exit("codeFencedFence"),R(X)):O(X)}}}function o8(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 yD,jm,wD=L(()=>{"use strict";Qt();at();yD={partial:!0,tokenize:o8},jm={concrete:!0,name:"codeFenced",tokenize:r8}});function s8(e,t,a){let n=this;return r;function r(u){return e.enter("codeIndented"),ye(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?l(u):ne(u)?e.attempt(i8,i,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||ne(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function l8(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):ne(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):ye(e,o,"linePrefix",5)(i)}function o(i){let s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):ne(i)?r(i):a(i)}}var vd,i8,vD=L(()=>{"use strict";Qt();at();vd={name:"codeIndented",tokenize:s8},i8={partial:!0,tokenize:l8}});function u8(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 c8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function d8(e,t,a){let n=this,r=0,o,i;return s;function s(p){return e.enter("codeText"),e.enter("codeTextSequence"),l(p)}function l(p){return p===96?(e.consume(p),r++,l):(e.exit("codeTextSequence"),u(p))}function u(p){return p===null?a(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),u):p===96?(i=e.enter("codeTextSequence"),o=0,d(p)):ne(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||ne(p)?(e.exit("codeTextData"),u(p)):(e.consume(p),c)}function d(p){return p===96?(e.consume(p),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}var ub,xD=L(()=>{"use strict";at();ub={name:"codeText",previous:c8,resolve:u8,tokenize:d8}});function xd(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 Vm,bD=L(()=>{"use strict";Vm=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&&xd(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),xd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),xd(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);xd(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);xd(this.left,a.reverse())}}}});function $m(e){let t={},a=-1,n,r,o,i,s,l,u,c=new Vm(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"&&(l=n[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,f8(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},s=c.slice(r,a),s.unshift(n),c.splice(r,a-r+1,s))}}return Jt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function f8(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 s=i.events,l=[],u={},c,d,p=-1,m=a,h=0,v=0,I=[v];for(;m;){for(;e.get(++r)[1]!==m;);o.push(r),m._tokenizer||(c=n.sliceStream(m),m.next||c.push(null),d&&i.defineSkip(m.start),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=a;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(v=p+1,I.push(v),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(i.events=[],m?(m._tokenizer=void 0,m.previous=void 0):I.pop(),p=I.length;p--;){let y=s.slice(I[p],I[p+1]),w=o.pop();l.push([w,w+y.length-1]),e.splice(w,2,y)}for(l.reverse(),p=-1;++p<l.length;)u[h+l[p][0]]=h+l[p][1],h+=l[p][1]-l[p][0]-1;return u}var cb=L(()=>{"use strict";to();bD()});function m8(e){return $m(e),e}function h8(e,t){let a;return n;function n(s){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),r(s)}function r(s){return s===null?o(s):ne(s)?e.check(p8,i,o)(s):(e.consume(s),r)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function i(s){return e.consume(s),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,r}}function g8(e,t,a){let n=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),ye(e,o,"linePrefix")}function o(i){if(i===null||ne(i))return a(i);let s=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):e.interrupt(n.parser.constructs.flow,a,t)(i)}}var db,p8,SD=L(()=>{"use strict";Qt();at();cb();db={resolve:m8,tokenize:h8},p8={partial:!0,tokenize:g8}});function Wm(e,t,a,n,r,o,i,s,l){let u=l||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),p):y===null||y===32||y===41||is(y)?a(y):(e.enter(n),e.enter(i),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(s),p(y)):y===null||y===60||ne(y)?a(y):(e.consume(y),y===92?h:m)}function h(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function v(y){return!c&&(y===null||y===41||$e(y))?(e.exit("chunkString"),e.exit(s),e.exit(i),e.exit(n),t(y)):c<u&&y===40?(e.consume(y),c++,v):y===41?(e.consume(y),c--,v):y===null||y===32||y===40||is(y)?a(y):(e.consume(y),y===92?I:v)}function I(y){return y===40||y===41||y===92?(e.consume(y),v):v(y)}}var fb=L(()=>{"use strict";at()});function Gm(e,t,a,n,r,o){let i=this,s=0,l;return u;function u(m){return e.enter(n),e.enter(r),e.consume(m),e.exit(r),e.enter(o),c}function c(m){return s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?a(m):m===93?(e.exit(o),e.enter(r),e.consume(m),e.exit(r),e.exit(n),t):ne(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||ne(m)||s++>999?(e.exit("chunkString"),c(m)):(e.consume(m),l||(l=!ve(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}var pb=L(()=>{"use strict";at()});function Xm(e,t,a,n,r,o){let i;return s;function s(p){return p===34||p===39||p===40?(e.enter(n),e.enter(r),e.consume(p),e.exit(r),i=p===40?41:p,l):a(p)}function l(p){return p===i?(e.enter(r),e.consume(p),e.exit(r),e.exit(n),t):(e.enter(o),u(p))}function u(p){return p===i?(e.exit(o),l(i)):p===null?a(p):ne(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ye(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===i||p===null||ne(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:c)}function d(p){return p===i||p===92?(e.consume(p),c):c(p)}}var mb=L(()=>{"use strict";Qt();at()});function ds(e,t){let a;return n;function n(r){return ne(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):ve(r)?ye(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var hb=L(()=>{"use strict";Qt();at()});function w8(e,t,a){let n=this,r;return o;function o(m){return e.enter("definition"),i(m)}function i(m){return Gm.call(n,e,s,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return r=Ma(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):a(m)}function l(m){return $e(m)?ds(e,u)(m):u(m)}function u(m){return Wm(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function c(m){return e.attempt(y8,d,d)(m)}function d(m){return ve(m)?ye(e,p,"whitespace")(m):p(m)}function p(m){return m===null||ne(m)?(e.exit("definition"),n.parser.defined.push(r),t(m)):a(m)}}function v8(e,t,a){return n;function n(s){return $e(s)?ds(e,r)(s):a(s)}function r(s){return Xm(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ve(s)?ye(e,i,"whitespace")(s):i(s)}function i(s){return s===null||ne(s)?t(s):a(s)}}var gb,y8,ID=L(()=>{"use strict";fb();pb();Qt();mb();hb();at();Gl();gb={name:"definition",tokenize:w8},y8={partial:!0,tokenize:v8}});function x8(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return ne(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var yb,CD=L(()=>{"use strict";at();yb={name:"hardBreakEscape",tokenize:x8}});function b8(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"},Jt(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function S8(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||$e(c)?(e.exit("atxHeadingSequence"),s(c)):a(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||ne(c)?(e.exit("atxHeading"),t(c)):ve(c)?ye(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||$e(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}var wb,kD=L(()=>{"use strict";Qt();at();to();wb={name:"headingAtx",resolve:b8,tokenize:S8}});var TD,vb,LD=L(()=>{"use strict";TD=["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"],vb=["pre","script","style","textarea"]});function k8(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 T8(e,t,a){let n=this,r,o,i,s,l;return u;function u(x){return c(x)}function c(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),d}function d(x){return x===33?(e.consume(x),p):x===47?(e.consume(x),o=!0,v):x===63?(e.consume(x),r=3,n.interrupt?t:C):la(x)?(e.consume(x),i=String.fromCharCode(x),I):a(x)}function p(x){return x===45?(e.consume(x),r=2,m):x===91?(e.consume(x),r=5,s=0,h):la(x)?(e.consume(x),r=4,n.interrupt?t:C):a(x)}function m(x){return x===45?(e.consume(x),n.interrupt?t:C):a(x)}function h(x){let te="CDATA[";return x===te.charCodeAt(s++)?(e.consume(x),s===te.length?n.interrupt?t:$:h):a(x)}function v(x){return la(x)?(e.consume(x),i=String.fromCharCode(x),I):a(x)}function I(x){if(x===null||x===47||x===62||$e(x)){let te=x===47,re=i.toLowerCase();return!te&&!o&&vb.includes(re)?(r=1,n.interrupt?t(x):$(x)):TD.includes(i.toLowerCase())?(r=6,te?(e.consume(x),y):n.interrupt?t(x):$(x)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(x):o?w(x):g(x))}return x===45||Vt(x)?(e.consume(x),i+=String.fromCharCode(x),I):a(x)}function y(x){return x===62?(e.consume(x),n.interrupt?t:$):a(x)}function w(x){return ve(x)?(e.consume(x),w):A(x)}function g(x){return x===47?(e.consume(x),A):x===58||x===95||la(x)?(e.consume(x),S):ve(x)?(e.consume(x),g):A(x)}function S(x){return x===45||x===46||x===58||x===95||Vt(x)?(e.consume(x),S):E(x)}function E(x){return x===61?(e.consume(x),T):ve(x)?(e.consume(x),E):g(x)}function T(x){return x===null||x===60||x===61||x===62||x===96?a(x):x===34||x===39?(e.consume(x),l=x,R):ve(x)?(e.consume(x),T):O(x)}function R(x){return x===l?(e.consume(x),l=null,U):x===null||ne(x)?a(x):(e.consume(x),R)}function O(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||$e(x)?E(x):(e.consume(x),O)}function U(x){return x===47||x===62||ve(x)?g(x):a(x)}function A(x){return x===62?(e.consume(x),Q):a(x)}function Q(x){return x===null||ne(x)?$(x):ve(x)?(e.consume(x),Q):a(x)}function $(x){return x===45&&r===2?(e.consume(x),B):x===60&&r===1?(e.consume(x),P):x===62&&r===4?(e.consume(x),ze):x===63&&r===3?(e.consume(x),C):x===93&&r===5?(e.consume(x),ge):ne(x)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(I8,ot,H)(x)):x===null||ne(x)?(e.exit("htmlFlowData"),H(x)):(e.consume(x),$)}function H(x){return e.check(C8,Z,ot)(x)}function Z(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),X}function X(x){return x===null||ne(x)?H(x):(e.enter("htmlFlowData"),$(x))}function B(x){return x===45?(e.consume(x),C):$(x)}function P(x){return x===47?(e.consume(x),i="",J):$(x)}function J(x){if(x===62){let te=i.toLowerCase();return vb.includes(te)?(e.consume(x),ze):$(x)}return la(x)&&i.length<8?(e.consume(x),i+=String.fromCharCode(x),J):$(x)}function ge(x){return x===93?(e.consume(x),C):$(x)}function C(x){return x===62?(e.consume(x),ze):x===45&&r===2?(e.consume(x),C):$(x)}function ze(x){return x===null||ne(x)?(e.exit("htmlFlowData"),ot(x)):(e.consume(x),ze)}function ot(x){return e.exit("htmlFlow"),t(x)}}function L8(e,t,a){let n=this;return r;function r(i){return ne(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 E8(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Cr,t,a)}}var xb,I8,C8,ED=L(()=>{"use strict";at();LD();zm();xb={concrete:!0,name:"htmlFlow",resolveTo:k8,tokenize:T8},I8={partial:!0,tokenize:E8},C8={partial:!0,tokenize:L8}});function A8(e,t,a){let n=this,r,o,i;return s;function s(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),l}function l(C){return C===33?(e.consume(C),u):C===47?(e.consume(C),E):C===63?(e.consume(C),g):la(C)?(e.consume(C),O):a(C)}function u(C){return C===45?(e.consume(C),c):C===91?(e.consume(C),o=0,h):la(C)?(e.consume(C),w):a(C)}function c(C){return C===45?(e.consume(C),m):a(C)}function d(C){return C===null?a(C):C===45?(e.consume(C),p):ne(C)?(i=d,P(C)):(e.consume(C),d)}function p(C){return C===45?(e.consume(C),m):d(C)}function m(C){return C===62?B(C):C===45?p(C):d(C)}function h(C){let ze="CDATA[";return C===ze.charCodeAt(o++)?(e.consume(C),o===ze.length?v:h):a(C)}function v(C){return C===null?a(C):C===93?(e.consume(C),I):ne(C)?(i=v,P(C)):(e.consume(C),v)}function I(C){return C===93?(e.consume(C),y):v(C)}function y(C){return C===62?B(C):C===93?(e.consume(C),y):v(C)}function w(C){return C===null||C===62?B(C):ne(C)?(i=w,P(C)):(e.consume(C),w)}function g(C){return C===null?a(C):C===63?(e.consume(C),S):ne(C)?(i=g,P(C)):(e.consume(C),g)}function S(C){return C===62?B(C):g(C)}function E(C){return la(C)?(e.consume(C),T):a(C)}function T(C){return C===45||Vt(C)?(e.consume(C),T):R(C)}function R(C){return ne(C)?(i=R,P(C)):ve(C)?(e.consume(C),R):B(C)}function O(C){return C===45||Vt(C)?(e.consume(C),O):C===47||C===62||$e(C)?U(C):a(C)}function U(C){return C===47?(e.consume(C),B):C===58||C===95||la(C)?(e.consume(C),A):ne(C)?(i=U,P(C)):ve(C)?(e.consume(C),U):B(C)}function A(C){return C===45||C===46||C===58||C===95||Vt(C)?(e.consume(C),A):Q(C)}function Q(C){return C===61?(e.consume(C),$):ne(C)?(i=Q,P(C)):ve(C)?(e.consume(C),Q):U(C)}function $(C){return C===null||C===60||C===61||C===62||C===96?a(C):C===34||C===39?(e.consume(C),r=C,H):ne(C)?(i=$,P(C)):ve(C)?(e.consume(C),$):(e.consume(C),Z)}function H(C){return C===r?(e.consume(C),r=void 0,X):C===null?a(C):ne(C)?(i=H,P(C)):(e.consume(C),H)}function Z(C){return C===null||C===34||C===39||C===60||C===61||C===96?a(C):C===47||C===62||$e(C)?U(C):(e.consume(C),Z)}function X(C){return C===47||C===62||$e(C)?U(C):a(C)}function B(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):a(C)}function P(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),J}function J(C){return ve(C)?ye(e,ge,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):ge(C)}function ge(C){return e.enter("htmlTextData"),i(C)}}var bb,AD=L(()=>{"use strict";Qt();at();bb={name:"htmlText",tokenize:A8}});function _8(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&&Jt(e,0,e.length,a),e}function P8(e,t){let a=e.length,n=0,r,o,i,s;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 l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[o+n+2][1].end},end:{...e[i-2][1].start}};return s=[["enter",l,t],["enter",u,t]],s=za(s,e.slice(o+1,o+n+3)),s=za(s,[["enter",c,t]]),s=za(s,ai(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),s=za(s,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),s=za(s,e.slice(i+1)),s=za(s,[["exit",l,t]]),Jt(e,o,e.length,s),e}function O8(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 s;function s(p){return o?o._inactive?d(p):(i=n.parser.defined.includes(Ma(n.sliceSerialize({start:o.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):a(p)}function l(p){return p===40?e.attempt(M8,c,i?c:d)(p):p===91?e.attempt(R8,c,i?u:d)(p):i?c(p):d(p)}function u(p){return e.attempt(D8,c,d)(p)}function c(p){return t(p)}function d(p){return o._balanced=!0,a(p)}}function N8(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 $e(d)?ds(e,o)(d):o(d)}function o(d){return d===41?c(d):Wm(e,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return $e(d)?ds(e,l)(d):c(d)}function s(d){return a(d)}function l(d){return d===34||d===39||d===40?Xm(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return $e(d)?ds(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 U8(e,t,a){let n=this;return r;function r(s){return Gm.call(n,e,o,i,"reference","referenceMarker","referenceString")(s)}function o(s){return n.parser.defined.includes(Ma(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(s):a(s)}function i(s){return a(s)}}function B8(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 fs,M8,R8,D8,Km=L(()=>{"use strict";fb();pb();mb();hb();at();to();Gl();yd();fs={name:"labelEnd",resolveAll:_8,resolveTo:P8,tokenize:O8},M8={tokenize:N8},R8={tokenize:U8},D8={tokenize:B8}});function z8(e,t,a){let n=this;return r;function r(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),i):a(s)}function i(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(s):t(s)}}var Sb,MD=L(()=>{"use strict";Km();Sb={name:"labelStartImage",resolveAll:fs.resolveAll,tokenize:z8}});function F8(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 Ib,RD=L(()=>{"use strict";Km();Ib={name:"labelStartLink",resolveAll:fs.resolveAll,tokenize:F8}});function q8(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ye(e,t,"linePrefix")}}var bd,DD=L(()=>{"use strict";Qt();bd={name:"lineEnding",tokenize:q8}});function H8(e,t,a){let n=0,r;return o;function o(u){return e.enter("thematicBreak"),i(u)}function i(u){return r=u,s(u)}function s(u){return u===r?(e.enter("thematicBreakSequence"),l(u)):n>=3&&(u===null||ne(u))?(e.exit("thematicBreak"),t(u)):a(u)}function l(u){return u===r?(e.consume(u),n++,l):(e.exit("thematicBreakSequence"),ve(u)?ye(e,s,"whitespace")(u):s(u))}}var ps,Cb=L(()=>{"use strict";Qt();at();ps={name:"thematicBreak",tokenize:H8}});function $8(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 s;function s(m){let h=n.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!n.containerState.marker||m===n.containerState.marker:hd(m)){if(n.containerState.type||(n.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(ps,a,u)(m):u(m);if(!n.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return a(m)}function l(m){return hd(m)&&++i<10?(e.consume(m),l):(!n.interrupt||i<2)&&(n.containerState.marker?m===n.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):a(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||m,e.check(Cr,n.interrupt?a:c,e.attempt(j8,p,d))}function c(m){return n.containerState.initialBlankLine=!0,o++,p(m)}function d(m){return ve(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):a(m)}function p(m){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function W8(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(Cr,r,o);function r(s){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ye(e,t,"listItemIndent",n.containerState.size+1)(s)}function o(s){return n.containerState.furtherBlankLines||!ve(s)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(s)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(V8,t,i)(s))}function i(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,ye(e,e.attempt(Ra,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function G8(e,t,a){let n=this;return ye(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 X8(e){e.exit(this.containerState.type)}function K8(e,t,a){let n=this;return ye(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!ve(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var Ra,j8,V8,_D=L(()=>{"use strict";Qt();at();zm();Cb();Ra={continuation:{tokenize:W8},exit:X8,name:"list",tokenize:$8},j8={partial:!0,tokenize:K8},V8={partial:!0,tokenize:G8}});function Y8(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 Z8(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"),s(u)}function s(u){return u===r?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ve(u)?ye(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ne(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var Ym,PD=L(()=>{"use strict";Qt();at();Ym={name:"setextUnderline",resolveTo:Y8,tokenize:Z8}});var Zm=L(()=>{"use strict";fD();pD();zm();mD();hD();gD();wD();vD();xD();SD();ID();CD();kD();ED();AD();Km();MD();RD();DD();_D();PD();Cb()});function kb(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:a7,continuation:{tokenize:n7},exit:r7}},text:{91:{name:"gfmFootnoteCall",tokenize:t7},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Q8,resolveTo:e7}}}}function Q8(e,t,a){let n=this,r=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),i;for(;r--;){let l=n.events[r][1];if(l.type==="labelImage"){i=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!i||!i._balanced)return a(l);let u=Ma(n.sliceSerialize({start:i.end,end:n.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?a(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function e7(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)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[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",s,t],["exit",s,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(a,e.length-a+1,...l),e}function t7(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,i;return s;function s(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(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||$e(d))return a(d);if(d===93){e.exit("chunkString");let p=e.exit("gfmFootnoteCallString");return r.includes(Ma(n.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(d)}return $e(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 a7(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,i=0,s;return l;function l(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):a(h)}function c(h){if(i>999||h===93&&!s||h===null||h===91||$e(h))return a(h);if(h===93){e.exit("chunkString");let v=e.exit("gfmFootnoteDefinitionLabelString");return o=Ma(n.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return $e(h)||(s=!0),i++,e.consume(h),h===92?d:c}function d(h){return h===91||h===92||h===93?(e.consume(h),i++,c):c(h)}function p(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),r.includes(o)||r.push(o),ye(e,m,"gfmFootnoteDefinitionWhitespace")):a(h)}function m(h){return t(h)}}function n7(e,t,a){return e.check(Cr,t,e.attempt(J8,t,a))}function r7(e){e.exit("gfmFootnoteDefinition")}function o7(e,t,a){let n=this;return ye(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 J8,OD=L(()=>{"use strict";Zm();Qt();at();Gl();J8={tokenize:o7,partial:!0}});var ND=L(()=>{"use strict";OD()});function Tb(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,s){let l=-1;for(;++l<i.length;)if(i[l][0]==="enter"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._close){let u=l;for(;u--;)if(i[u][0]==="exit"&&i[u][1].type==="strikethroughSequenceTemporary"&&i[u][1]._open&&i[l][1].end.offset-i[l][1].start.offset===i[u][1].end.offset-i[u][1].start.offset){i[l][1].type="strikethroughSequence",i[u][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},i[u][1].start),end:Object.assign({},i[l][1].end)},d={type:"strikethroughText",start:Object.assign({},i[u][1].end),end:Object.assign({},i[l][1].start)},p=[["enter",c,s],["enter",i[u][1],s],["exit",i[u][1],s],["enter",d,s]],m=s.parser.constructs.insideSpan.null;m&&Jt(p,p.length,0,ai(m,i.slice(u+1,l),s)),Jt(p,p.length,0,[["exit",d,s],["enter",i[l][1],s],["exit",i[l][1],s],["exit",c,s]]),Jt(i,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<i.length;)i[l][1].type==="strikethroughSequenceTemporary"&&(i[l][1].type="data");return i}function o(i,s,l){let u=this.previous,c=this.events,d=0;return p;function p(h){return u===126&&c[c.length-1][1].type!=="characterEscape"?l(h):(i.enter("strikethroughSequenceTemporary"),m(h))}function m(h){let v=eo(u);if(h===126)return d>1?l(h):(i.consume(h),d++,m);if(d<2&&!a)return l(h);let I=i.exit("strikethroughSequenceTemporary"),y=eo(h);return I._open=!y||y===2&&!!v,I._close=!v||v===2&&!!y,s(h)}}}var UD=L(()=>{"use strict";to();Dm();yd()});var BD=L(()=>{"use strict";UD()});function i7(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 Jm,zD=L(()=>{"use strict";Jm=class{constructor(){this.map=[]}add(t,a,n){i7(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 FD(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 qD=L(()=>{"use strict"});function Lb(){return{flow:{null:{name:"table",tokenize:s7,resolveAll:l7}}}}function s7(e,t,a){let n=this,r=0,o=0,i;return s;function s(A){let Q=n.events.length-1;for(;Q>-1;){let Z=n.events[Q][1].type;if(Z==="lineEnding"||Z==="linePrefix")Q--;else break}let $=Q>-1?n.events[Q][1].type:null,H=$==="tableHead"||$==="tableRow"?T:l;return H===T&&n.parser.lazy[n.now().line]?a(A):H(A)}function l(A){return e.enter("tableHead"),e.enter("tableRow"),u(A)}function u(A){return A===124||(i=!0,o+=1),c(A)}function c(A){return A===null?a(A):ne(A)?o>1?(o=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),m):a(A):ve(A)?ye(e,c,"whitespace")(A):(o+=1,i&&(i=!1,r+=1),A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),i=!0,c):(e.enter("data"),d(A)))}function d(A){return A===null||A===124||$e(A)?(e.exit("data"),c(A)):(e.consume(A),A===92?p:d)}function p(A){return A===92||A===124?(e.consume(A),d):d(A)}function m(A){return n.interrupt=!1,n.parser.lazy[n.now().line]?a(A):(e.enter("tableDelimiterRow"),i=!1,ve(A)?ye(e,h,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):h(A))}function h(A){return A===45||A===58?I(A):A===124?(i=!0,e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),v):E(A)}function v(A){return ve(A)?ye(e,I,"whitespace")(A):I(A)}function I(A){return A===58?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),y):A===45?(o+=1,y(A)):A===null||ne(A)?S(A):E(A)}function y(A){return A===45?(e.enter("tableDelimiterFiller"),w(A)):E(A)}function w(A){return A===45?(e.consume(A),w):A===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(A))}function g(A){return ve(A)?ye(e,S,"whitespace")(A):S(A)}function S(A){return A===124?h(A):A===null||ne(A)?!i||r!==o?E(A):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(A)):E(A)}function E(A){return a(A)}function T(A){return e.enter("tableRow"),R(A)}function R(A){return A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),R):A===null||ne(A)?(e.exit("tableRow"),t(A)):ve(A)?ye(e,R,"whitespace")(A):(e.enter("data"),O(A))}function O(A){return A===null||A===124||$e(A)?(e.exit("data"),R(A)):(e.consume(A),A===92?U:O)}function U(A){return A===92||A===124?(e.consume(A),O):O(A)}}function l7(e,t){let a=-1,n=!0,r=0,o=[0,0,0,0],i=[0,0,0,0],s=!1,l=0,u,c,d,p=new Jm;for(;++a<e.length;){let m=e[a],h=m[1];m[0]==="enter"?h.type==="tableHead"?(s=!1,l!==0&&(HD(p,t,l,u,c),c=void 0,l=0),u={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(a,0,[["enter",u,t]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(n=!0,d=void 0,o=[0,0,0,0],i=[0,a+1,0,0],s&&(s=!1,c={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(a,0,[["enter",c,t]])),r=h.type==="tableDelimiterRow"?2:c?3:1):r&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")?(n=!1,i[2]===0&&(o[1]!==0&&(i[0]=i[1],d=Qm(p,t,o,r,void 0,d),o=[0,0,0,0]),i[2]=a)):h.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(i[0]=i[1],d=Qm(p,t,o,r,void 0,d)),o=i,i=[o[1],a,0,0])):h.type==="tableHead"?(s=!0,l=a):h.type==="tableRow"||h.type==="tableDelimiterRow"?(l=a,o[1]!==0?(i[0]=i[1],d=Qm(p,t,o,r,a,d)):i[1]!==0&&(d=Qm(p,t,i,r,a,d)),r=0):r&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(i[3]=a)}for(l!==0&&HD(p,t,l,u,c),p.consume(t.events),a=-1;++a<t.events.length;){let m=t.events[a];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=FD(t.events,a))}return e}function Qm(e,t,a,n,r,o){let i=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",s="tableContent";a[0]!==0&&(o.end=Object.assign({},Jl(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));let l=Jl(t.events,a[1]);if(o={type:i,start:Object.assign({},l),end:Object.assign({},l)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){let u=Jl(t.events,a[2]),c=Jl(t.events,a[3]),d={type:s,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(a[2],0,[["enter",d,t]]),n!==2){let p=t.events[a[2]],m=t.events[a[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",a[3]>a[2]+1){let h=a[2]+1,v=a[3]-a[2]-1;e.add(h,v,[])}}e.add(a[3]+1,0,[["exit",d,t]])}return r!==void 0&&(o.end=Object.assign({},Jl(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function HD(e,t,a,n,r){let o=[],i=Jl(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 Jl(e,t){let a=e[t],n=a[0]==="enter"?"start":"end";return a[1][n]}var jD=L(()=>{"use strict";Qt();at();zD();qD()});var VD=L(()=>{"use strict";jD()});function Eb(){return{text:{91:u7}}}function c7(e,t,a){let n=this;return r;function r(l){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?a(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return $e(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),i):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),i):a(l)}function i(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):a(l)}function s(l){return ne(l)?t(l):ve(l)?e.check({tokenize:d7},t,a)(l):a(l)}}function d7(e,t,a){return ye(e,n,"whitespace");function n(r){return r===null?a(r):t(r)}}var u7,$D=L(()=>{"use strict";Qt();at();u7={name:"tasklistCheck",tokenize:c7}});var WD=L(()=>{"use strict";$D()});function GD(e){return Bm([ib(),kb(),Tb(e),Lb(),Eb()])}var XD=L(()=>{"use strict";rb();cD();ND();BD();VD();WD()});function eh(e){let t=this,a=e||f7,n=t.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(GD(a)),o.push(ab()),i.push(nb(a))}var f7,KD=L(()=>{"use strict";Q2();XD();f7={}});var YD=L(()=>{"use strict";KD()});var p7,m7,h7,ZD,g7,y7,JD,t_,a_,w7,v7,x7,b7,S7,I7,C7,ms,n_,k7,T7,L7,E7,A7,M7,QD,ni,Ql,R7,r_,ah,D7,o_,Mb,_7,P7,i_,O7,N7,U7,B7,z7,F7,q7,H7,j7,s_,V7,$7,W7,G7,X7,K7,th,Y7,Z7,J7,Q7,eW,tW,aW,nW,rW,oW,e_,iW,l_,sW,lW,uW,cW,dW,fW,Ab,bn,pW,mW,hW,u_,c_=L(()=>{"use strict";p7=Object.defineProperty,m7=Object.defineProperties,h7=Object.getOwnPropertyDescriptors,ZD=Object.getOwnPropertySymbols,g7=Object.prototype.hasOwnProperty,y7=Object.prototype.propertyIsEnumerable,JD=(e,t,a)=>t in e?p7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,t_=(e,t)=>{for(var a in t||(t={}))g7.call(t,a)&&JD(e,a,t[a]);if(ZD)for(var a of ZD(t))y7.call(t,a)&&JD(e,a,t[a]);return e},a_=(e,t)=>m7(e,h7(t)),w7=/(\*\*)([^*]*\*?)$/,v7=/(__)([^_]*?)$/,x7=/(\*\*\*)([^*]*?)$/,b7=/(\*)([^*]*?)$/,S7=/(_)([^_]*?)$/,I7=/(`)([^`]*?)$/,C7=/(~~)([^~]*?)$/,ms=/^[\s_~*`]*$/,n_=/^[\s]*[-*+][\s]+$/,k7=/[\p{L}\p{N}_]/u,T7=/^```[^`\n]*```?$/,L7=/^\*{4,}$/,E7=/(__)([^_]+)_$/,A7=/(~~)([^~]+)~$/,M7=/__/g,QD=/~~/g,ni=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:k7.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},R7=(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},r_=(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},ah=(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},D7=(e,t)=>{for(let a=t;a<e.length;a+=1){if(e[a]===")")return!0;if(e[a]===`
|
|
25
|
+
`)return!1}return!1},o_=(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]==="]"?D7(e,t):!1;if(e[a]===`
|
|
26
|
+
`)return!1}return!1},Mb=(e,t,a)=>{let n=0;for(let l=t-1;l>=0;l-=1)if(e[l]===`
|
|
27
27
|
`){n=l+1;break}let r=e.length;for(let l=t;l<e.length;l+=1)if(e[l]===`
|
|
28
|
-
`){r=l;break}let o=e.substring(n,r),i=0,s=!1;for(let l of o)if(l===a)i+=1;else if(l!==" "&&l!==" "){s=!0;break}return i>=3&&!s},
|
|
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=l;break}let o=e.substring(n,r),i=0,s=!1;for(let l of o)if(l===a)i+=1;else if(l!==" "&&l!==" "){s=!0;break}return i>=3&&!s},_7=(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},P7=(e,t,a,n)=>a==="\\"||e.includes("$")&&ah(e,t)?!0:a!=="*"&&n==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(a==="*"||a&&n&&ni(a)&&ni(n)||_7(e,t,n)),i_=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]:"";P7(e,n,r,o)||(t+=1)}return t},O7=(e,t,a,n)=>!!(a==="\\"||e.includes("$")&&ah(e,t)||o_(e,t)||a==="_"||n==="_"||a&&n&&ni(a)&&ni(n)),N7=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]:"";O7(e,n,r,o)||(t+=1)}return t},U7=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},B7=(e,t,a)=>{if(!t||ms.test(t))return!0;let n=e.substring(0,a).lastIndexOf(`
|
|
30
|
+
`),r=n===-1?0:n+1,o=e.substring(r,a);return n_.test(o)&&t.includes(`
|
|
31
|
+
`)?!0:Mb(e,a,"*")},z7=e=>{let t=e.match(w7);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return Ql(e,n)||B7(e,a,n)?e:(e.match(/\*\*/g)||[]).length%2===1?a.endsWith("*")?`${e}*`:`${e}**`:e},F7=(e,t,a)=>{if(!t||ms.test(t))return!0;let n=e.substring(0,a).lastIndexOf(`
|
|
32
|
+
`),r=n===-1?0:n+1,o=e.substring(r,a);return n_.test(o)&&t.includes(`
|
|
33
|
+
`)?!0:Mb(e,a,"_")},q7=e=>{let t=e.match(v7);if(!t){let r=e.match(E7);if(r){let o=e.lastIndexOf(r[1]);if(!Ql(e,o)&&(e.match(M7)||[]).length%2===1)return`${e}_`}return e}let a=t[2],n=e.lastIndexOf(t[1]);return Ql(e,n)||F7(e,a,n)?e:(e.match(/__/g)||[]).length%2===1?`${e}__`:e},H7=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="*"&&e[t-1]!=="*"&&e[t+1]!=="*"&&e[t-1]!=="\\"&&!ah(e,t)){let a=t>0?e[t-1]:"",n=t<e.length-1?e[t+1]:"";if(a&&n&&ni(a)&&ni(n))continue;return t}return-1},j7=e=>{if(!e.match(b7))return e;let t=H7(e);if(t===-1||Ql(e,t))return e;let a=e.substring(t+1);return!a||ms.test(a)?e:i_(e)%2===1?`${e}*`:e},s_=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="_"&&e[t-1]!=="_"&&e[t+1]!=="_"&&e[t-1]!=="\\"&&!ah(e,t)&&!o_(e,t)){let a=t>0?e[t-1]:"",n=t<e.length-1?e[t+1]:"";if(a&&n&&ni(a)&&ni(n))continue;return t}return-1},V7=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}_`},$7=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=s_(t);return a!==-1&&n!==-1&&a<n?`${t}_**`:null},W7=e=>{if(!e.match(S7))return e;let t=s_(e);if(t===-1||Ql(e,t))return e;let a=e.substring(t+1);if(!a||ms.test(a))return e;if(N7(e)%2===1){let n=$7(e);return n!==null?n:V7(e)}return e},G7=e=>{let t=(e.match(/\*\*/g)||[]).length,a=i_(e);return t%2===0&&a%2===0},X7=(e,t,a)=>!t||ms.test(t)||Ql(e,a)?!0:Mb(e,a,"*"),K7=e=>{if(L7.test(e))return e;let t=e.match(x7);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return X7(e,a,n)?e:U7(e)%2===1?G7(e)?e:`${e}***`:e},th=(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},Y7=(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},Z7=e=>{let t=0;for(let a=0;a<e.length;a+=1)e[a]==="`"&&!Y7(e,a)&&(t+=1);return t},J7=e=>!e.match(T7)||e.includes(`
|
|
35
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,Q7=e=>(e.match(/```/g)||[]).length%2===1,eW=e=>{let t=J7(e);if(t!==null)return t;let a=e.match(I7);if(a&&!Q7(e)){let n=a[2];if(!n||ms.test(n))return e;if(Z7(e)%2===1)return`${e}\``}return e},tW=(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)==="```",aW=e=>{let t=0,a=!1;for(let n=0;n<e.length-1;n+=1)e[n]==="`"&&!tW(e,n)&&(a=!a),!a&&e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},nW=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},cW=e=>{let t=e.match(S7);if(t){let a=t[2];if(!a||ms.test(a))return e;if((e.match(ZD)||[]).length%2===1)return`${e}~~`}else if(e.match(L7)&&(e.match(ZD)||[]).length%2===1)return`${e}~`;return e},Lb=e=>e!==!1,bn={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},dW=[{handler:{name:"setextHeadings",handle:uW,priority:bn.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:i_,priority:bn.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:G7,priority:bn.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:U7,priority:bn.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:z7,priority:bn.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:q7,priority:bn.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:V7,priority:bn.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:J7,priority:bn.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:cW,priority:bn.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:aW,priority:bn.KATEX},optionKey:"katex"}],fW=e=>{var t;let a=(t=e?.linkMode)!=null?t:"protocol";return dW.filter(({handler:n,optionKey:r})=>n.name==="links"?Lb(e?.links)||Lb(e?.images):Lb(e?.[r])).map(({handler:n,earlyReturn:r})=>n.name==="links"?{handler:e_(QD({},n),{handle:o=>i_(o,a)}),earlyReturn:a==="protocol"?r:void 0}:{handler:n,earlyReturn:r})},pW=(e,t)=>{var a;if(!e||typeof e!="string")return e;let n=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,r=fW(t),o=((a=t?.handlers)!=null?a:[]).map(s=>{var l;return{handler:e_(QD({},s),{priority:(l=s.priority)!=null?l:bn.DEFAULT}),earlyReturn:void 0}}),i=[...r,...o].sort((s,l)=>{var u,c;return((u=s.handler.priority)!=null?u:bn.DEFAULT)-((c=l.handler.priority)!=null?c:bn.DEFAULT)});for(let{handler:s,earlyReturn:l}of i)if(n=s.handle(n),l!=null&&l(n))return n;return n},s_=pW});function u_(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var c_=L(()=>{"use strict"});function th(e,t){return((t||gW).jsx?hW:mW).test(e)}var mW,hW,gW,d_=L(()=>{"use strict";mW=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hW=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gW={}});var f_=L(()=>{"use strict";d_()});function Ab(e){return typeof e=="object"?e.type==="text"?p_(e.value):!1:p_(e)}function p_(e){return e.replace(yW,"")===""}var yW,m_=L(()=>{"use strict";yW=/[ \t\n\f\r]/g});var h_=L(()=>{"use strict";m_()});var oo,Mb=L(()=>{"use strict";oo=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};oo.prototype.normal={};oo.prototype.property={};oo.prototype.space=void 0});function Rb(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new oo(a,n,t)}var g_=L(()=>{"use strict";Mb()});function bd(e){return e.toLowerCase()}var Db=L(()=>{"use strict"});var ma,_b=L(()=>{"use strict";ma=class{constructor(t,a){this.attribute=a,this.property=t}};ma.prototype.attribute="";ma.prototype.booleanish=!1;ma.prototype.boolean=!1;ma.prototype.commaOrSpaceSeparated=!1;ma.prototype.commaSeparated=!1;ma.prototype.defined=!1;ma.prototype.mustUseProperty=!1;ma.prototype.number=!1;ma.prototype.overloadedBoolean=!1;ma.prototype.property="";ma.prototype.spaceSeparated=!1;ma.prototype.space=void 0});var Sd={};of(Sd,{boolean:()=>De,booleanish:()=>Vt,commaOrSpaceSeparated:()=>an,commaSeparated:()=>ri,number:()=>G,overloadedBoolean:()=>ah,spaceSeparated:()=>ht});function hs(){return 2**++wW}var wW,De,Vt,ah,G,ht,ri,an,Id=L(()=>{"use strict";wW=0,De=hs(),Vt=hs(),ah=hs(),G=hs(),ht=hs(),ri=hs(),an=hs()});function y_(e,t,a){a&&(e[t]=a)}var Pb,gs,Ob=L(()=>{"use strict";_b();Id();Pb=Object.keys(Sd),gs=class extends ma{constructor(t,a,n,r){let o=-1;if(super(t,a),y_(this,"space",r),typeof n=="number")for(;++o<Pb.length;){let i=Pb[o];y_(this,Pb[o],(n&Sd[i])===Sd[i])}}};gs.prototype.defined=!0});function qn(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new gs(n,e.transform(e.attributes||{},n),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,a[bd(n)]=n,a[bd(o.attribute)]=n}return new oo(t,a,e.space)}var ys=L(()=>{"use strict";Db();Ob();Mb()});var Nb,w_=L(()=>{"use strict";ys();Id();Nb=qn({properties:{ariaActiveDescendant:null,ariaAtomic:Vt,ariaAutoComplete:null,ariaBusy:Vt,ariaChecked:Vt,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:ht,ariaCurrent:null,ariaDescribedBy:ht,ariaDetails:null,ariaDisabled:Vt,ariaDropEffect:ht,ariaErrorMessage:null,ariaExpanded:Vt,ariaFlowTo:ht,ariaGrabbed:Vt,ariaHasPopup:null,ariaHidden:Vt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ht,ariaLevel:G,ariaLive:null,ariaModal:Vt,ariaMultiLine:Vt,ariaMultiSelectable:Vt,ariaOrientation:null,ariaOwns:ht,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:Vt,ariaReadOnly:Vt,ariaRelevant:null,ariaRequired:Vt,ariaRoleDescription:ht,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:Vt,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}})});function nh(e,t){return t in e?e[t]:t}var Ub=L(()=>{"use strict"});function rh(e,t){return nh(e,t.toLowerCase())}var Bb=L(()=>{"use strict";Ub()});var v_,x_=L(()=>{"use strict";Bb();ys();Id();v_=qn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ri,acceptCharset:ht,accessKey:ht,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:ht,autoFocus:De,autoPlay:De,blocking:ht,capture:null,charSet:null,checked:De,cite:null,className:ht,cols:G,colSpan:null,content:null,contentEditable:Vt,controls:De,controlsList:ht,coords:G|ri,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:ah,draggable:Vt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:ht,height:G,hidden:ah,high:G,href:null,hrefLang:null,htmlFor:ht,httpEquiv:ht,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:ht,itemRef:ht,itemScope:De,itemType:ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:G,pattern:null,ping:ht,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:ht,required:De,reversed:De,rows:G,rowSpan:G,sandbox:ht,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:Vt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:Vt,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ht,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:Vt,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:De,disableRemotePlayback:De,prefix:null,property:null,results:G,security:null,unselectable:null},space:"html",transform:rh})});var b_,S_=L(()=>{"use strict";Ub();ys();Id();b_=qn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:an,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:ht,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:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,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:ri,g2:ri,glyphName:ri,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:an,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,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:G,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:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:an,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:an,rev:an,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:an,requiredFeatures:an,requiredFonts:an,requiredFormats:an,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:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:an,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:an,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:an,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:nh})});var zb,I_=L(()=>{"use strict";ys();zb=qn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}})});var Fb,C_=L(()=>{"use strict";ys();Bb();Fb=qn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rh})});var qb,k_=L(()=>{"use strict";ys();qb=qn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var Hb,T_=L(()=>{"use strict";Hb={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 jb(e,t){let a=bd(t),n=t,r=ma;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&xW.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(L_,SW);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!L_.test(o)){let i=o.replace(vW,bW);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=gs}return new r(n,t)}function bW(e){return"-"+e.toLowerCase()}function SW(e){return e.charAt(1).toUpperCase()}var vW,L_,xW,E_=L(()=>{"use strict";Ob();_b();Db();vW=/[A-Z]/g,L_=/-[a-z]/g,xW=/^data[-\w.:]+$/i});var A_,oh,M_=L(()=>{"use strict";g_();w_();x_();S_();I_();C_();k_();T_();E_();A_=Rb([Nb,v_,zb,Fb,qb],"html"),oh=Rb([Nb,b_,zb,Fb,qb],"svg")});function R_(e){return e.join(" ").trim()}var D_=L(()=>{"use strict"});var B_=Ia((Fme,U_)=>{"use strict";var __=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,IW=/\n/g,CW=/^\s*/,kW=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,TW=/^:\s*/,LW=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,EW=/^[;\s]*/,AW=/^\s+|\s+$/g,MW=`
|
|
42
|
-
`,P_="/",O_="*",ws="",RW="comment",DW="declaration";function _W(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(h){var v=h.match(IW);v&&(a+=v.length);var I=h.lastIndexOf(MW);n=~I?h.length-I:n+h.length}function o(){var h={line:a,column:n};return function(v){return v.position=new i(h),u(),v}}function i(h){this.start=h,this.end={line:a,column:n},this.source=t.source}i.prototype.content=e;function s(h){var v=new Error(t.source+":"+a+":"+n+": "+h);if(v.reason=h,v.filename=t.source,v.line=a,v.column=n,v.source=e,!t.silent)throw v}function l(h){var v=h.exec(e);if(v){var I=v[0];return r(I),e=e.slice(I.length),v}}function u(){l(CW)}function c(h){var v;for(h=h||[];v=d();)v!==!1&&h.push(v);return h}function d(){var h=o();if(!(P_!=e.charAt(0)||O_!=e.charAt(1))){for(var v=2;ws!=e.charAt(v)&&(O_!=e.charAt(v)||P_!=e.charAt(v+1));)++v;if(v+=2,ws===e.charAt(v-1))return s("End of comment missing");var I=e.slice(2,v-2);return n+=2,r(I),e=e.slice(v),n+=2,h({type:RW,comment:I})}}function p(){var h=o(),v=l(kW);if(v){if(d(),!l(TW))return s("property missing ':'");var I=l(LW),y=h({type:DW,property:N_(v[0].replace(__,ws)),value:I?N_(I[0].replace(__,ws)):ws});return l(EW),y}}function m(){var h=[];c(h);for(var v;v=p();)v!==!1&&(h.push(v),c(h));return h}return u(),m()}function N_(e){return e?e.replace(AW,ws):ws}U_.exports=_W});var z_=Ia(Cd=>{"use strict";var PW=Cd&&Cd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cd,"__esModule",{value:!0});Cd.default=NW;var OW=PW(B_());function NW(e,t){let a=null;if(!e||typeof e!="string")return a;let n=(0,OW.default)(e),r=typeof t=="function";return n.forEach(o=>{if(o.type!=="declaration")return;let{property:i,value:s}=o;r?t(i,s,o):s&&(a=a||{},a[i]=s)}),a}});var q_=Ia(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.camelCase=void 0;var UW=/^--[a-zA-Z0-9_-]+$/,BW=/-([a-z])/g,zW=/^[^-]+$/,FW=/^-(webkit|moz|ms|o|khtml)-/,qW=/^-(ms)-/,HW=function(e){return!e||zW.test(e)||UW.test(e)},jW=function(e,t){return t.toUpperCase()},F_=function(e,t){return"".concat(t,"-")},VW=function(e,t){return t===void 0&&(t={}),HW(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(qW,F_):e=e.replace(FW,F_),e.replace(BW,jW))};ih.camelCase=VW});var j_=Ia(($b,H_)=>{"use strict";var $W=$b&&$b.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},WW=$W(z_()),GW=q_();function Vb(e,t){var a={};return!e||typeof e!="string"||(0,WW.default)(e,function(n,r){n&&r&&(a[(0,GW.camelCase)(n,t)]=r)}),a}Vb.default=Vb;H_.exports=Vb});function oi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?V_(e.position):"start"in e||"end"in e?V_(e):"line"in e||"column"in e?Wb(e):""}function Wb(e){return $_(e&&e.line)+":"+$_(e&&e.column)}function V_(e){return Wb(e&&e.start)+"-"+Wb(e&&e.end)}function $_(e){return e&&typeof e=="number"?e:1}var W_=L(()=>{"use strict"});var Gb=L(()=>{"use strict";W_()});var Qt,G_=L(()=>{"use strict";Gb();Qt=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 l=n.indexOf(":");l===-1?o.ruleId=n:(o.source=n.slice(0,l),o.ruleId=n.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){let l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}let s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=oi(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}};Qt.prototype.file="";Qt.prototype.name="";Qt.prototype.reason="";Qt.prototype.message="";Qt.prototype.stack="";Qt.prototype.column=void 0;Qt.prototype.line=void 0;Qt.prototype.ancestors=void 0;Qt.prototype.cause=void 0;Qt.prototype.fatal=void 0;Qt.prototype.place=void 0;Qt.prototype.ruleId=void 0;Qt.prototype.source=void 0});var Xb=L(()=>{"use strict";G_()});function Yb(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=oG(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=rG(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"?oh:A_,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Y_(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function Y_(e,t,a){if(t.type==="element")return JW(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QW(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return tG(e,t,a);if(t.type==="mdxjsEsm")return eG(e,t);if(t.type==="root")return aG(e,t,a);if(t.type==="text")return nG(e,t)}function JW(e,t,a){let n=e.schema,r=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=oh,e.schema=r),e.ancestors.push(t);let o=J_(e,t.tagName,!1),i=iG(e,t),s=Jb(e,t);return YW.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Ab(l):!0})),Z_(e,i,o,t),Zb(i,s),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function QW(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)}kd(e,t.position)}function eG(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);kd(e,t.position)}function tG(e,t,a){let n=e.schema,r=n;t.name==="svg"&&n.space==="html"&&(r=oh,e.schema=r),e.ancestors.push(t);let o=t.name===null?e.Fragment:J_(e,t.name,!0),i=sG(e,t),s=Jb(e,t);return Z_(e,i,o,t),Zb(i,s),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function aG(e,t,a){let n={};return Zb(n,Jb(e,t)),e.create(t,e.Fragment,n,a)}function nG(e,t){return t.value}function Z_(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function Zb(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function rG(e,t,a){return n;function n(r,o,i,s){let u=Array.isArray(i.children)?a:t;return s?u(o,i,s):u(o,i)}}function oG(e,t){return a;function a(n,r,o,i){let s=Array.isArray(o.children),l=Wl(n);return t(r,o,i,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function iG(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&Kb.call(t.properties,r)){let o=lG(e,r,t.properties[r]);if(o){let[i,s]=o;e.tableCellAlignToStyle&&i==="align"&&typeof s=="string"&&ZW.has(t.tagName)?n=s:a[i]=s}}if(n){let o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return a}function sG(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 s=i.properties[0];s.type,Object.assign(a,e.evaluater.evaluateExpression(s.argument))}else kd(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 s=n.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else kd(e,t.position);else o=n.value===null?!0:n.value;a[r]=o}return a}function Jb(e,t){let a=[],n=-1,r=e.passKeys?new Map:XW;for(;++n<t.children.length;){let o=t.children[n],i;if(e.passKeys){let l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){let u=r.get(l)||0;i=l+"-"+u,r.set(l,u+1)}}let s=Y_(e,o,i);s!==void 0&&a.push(s)}return a}function lG(e,t,a){let n=jb(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?u_(a):R_(a)),n.property==="style"){let r=typeof a=="object"?a:uG(e,String(a));return e.stylePropertyNameCase==="css"&&(r=cG(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?Hb[n.property]||n.property:n.attribute,a]}}function uG(e,t){try{return(0,X_.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new Qt("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=K_+"#cannot-parse-style-attribute",r}}function J_(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 s=th(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};i=i?{type:"MemberExpression",object:i,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}n=i}else n=th(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let r=n.value;return Kb.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(n);kd(e)}function kd(e,t){let a=new Qt("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=K_+"#cannot-handle-mdx-estrees-without-createevaluater",a}function cG(e){let t={},a;for(a in e)Kb.call(e,a)&&(t[dG(a)]=e[a]);return t}function dG(e){let t=e.replace(KW,fG);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function fG(e){return"-"+e.toLowerCase()}var X_,Kb,XW,KW,YW,ZW,K_,Q_=L(()=>{"use strict";c_();f_();h_();M_();D_();X_=j(j_(),1);fd();Xb();Kb={}.hasOwnProperty,XW=new Map,KW=/[A-Z]/g,YW=new Set(["table","tbody","thead","tfoot","tr"]),ZW=new Set(["td","th"]),K_="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var eP=L(()=>{"use strict";Q_()});function pG(e){let t=e.attempt(this.parser.constructs.contentInitial,n,r),a;return t;function n(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ye(e,t,"linePrefix")}function r(s){return e.enter("paragraph"),o(s)}function o(s){let l=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=l),a=l,i(s)}function i(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ne(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),i)}}var tP,aP=L(()=>{"use strict";Jt();at();tP={tokenize:pG}});function mG(e){let t=this,a=[],n=0,r,o,i;return s;function s(g){if(n<a.length){let S=a[n];return t.containerState=S[1],e.attempt(S[0].continuation,l,u)(g)}return u(g)}function l(g){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&w();let S=t.events.length,E=S,T;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){T=t.events[E][1].end;break}y(n);let R=S;for(;R<t.events.length;)t.events[R][1].end={...T},R++;return Zt(t.events,E+1,0,t.events.slice(S)),t.events.length=R,u(g)}return s(g)}function u(g){if(n===a.length){if(!r)return p(g);if(r.currentConstruct&&r.currentConstruct.concrete)return h(g);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(nP,c,d)(g)}function c(g){return r&&w(),y(n),p(g)}function d(g){return t.parser.lazy[t.now().line]=n!==a.length,i=t.now().offset,h(g)}function p(g){return t.containerState={},e.attempt(nP,m,h)(g)}function m(g){return n++,a.push([t.currentConstruct,t.containerState]),p(g)}function h(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}),v(g)}function v(g){if(g===null){I(e.exit("chunkFlow"),!0),y(0),e.consume(g);return}return ne(g)?(e.consume(g),I(e.exit("chunkFlow")),n=0,t.interrupt=void 0,s):(e.consume(g),v)}function I(g,S){let E=t.sliceStream(g);if(S&&E.push(null),g.previous=o,o&&(o.next=g),o=g,r.defineSkip(g.start),r.write(E),t.parser.lazy[g.start.line]){let T=r.events.length;for(;T--;)if(r.events[T][1].start.offset<i&&(!r.events[T][1].end||r.events[T][1].end.offset>i))return;let R=t.events.length,O=R,U,A;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(U){A=t.events[O][1].end;break}U=!0}for(y(n),T=R;T<t.events.length;)t.events[T][1].end={...A},T++;Zt(t.events,O+1,0,t.events.slice(R)),t.events.length=T}}function y(g){let S=a.length;for(;S-- >g;){let E=a[S];t.containerState=E[1],E[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 hG(e,t,a){return ye(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var rP,nP,oP=L(()=>{"use strict";Jt();at();no();rP={tokenize:mG},nP={tokenize:hG}});function gG(e){let t=this,a=e.attempt(Tr,n,e.attempt(this.parser.constructs.flowInitial,r,ye(e,e.attempt(this.parser.constructs.flow,r,e.attempt(ub,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 iP,sP=L(()=>{"use strict";Km();Jt();iP={tokenize:gG}});function dP(e){return{resolveAll:fP(e==="text"?yG:void 0),tokenize:t};function t(a){let n=this,r=this.parser.constructs[e],o=a.attempt(r,i,s);return i;function i(c){return u(c)?o(c):s(c)}function s(c){if(c===null){a.consume(c);return}return a.enter("data"),a.consume(c),l}function l(c){return u(c)?(a.exit("data"),o(c)):(a.consume(c),l)}function u(c){if(c===null)return!0;let d=r[c],p=-1;if(d)for(;++p<d.length;){let m=d[p];if(!m.previous||m.previous.call(n,n.previous))return!0}return!1}}}function fP(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 yG(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,s=0,l;for(;o--;){let u=r[o];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)s++,i--;if(i)break;i=-1}else if(u===-2)l=!0,s++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(s=0),s){let u={type:a===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?i:n.start._bufferIndex+i,_index:n.start._index+o,line:n.end.line,column:n.end.column-s,offset:n.end.offset-s},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 lP,uP,cP,Qb=L(()=>{"use strict";lP={resolveAll:fP()},uP=dP("string"),cP=dP("text")});var eS={};of(eS,{attentionMarkers:()=>kG,contentInitial:()=>vG,disable:()=>TG,document:()=>wG,flow:()=>bG,flowInitial:()=>xG,insideSpan:()=>CG,string:()=>SG,text:()=>IG});var wG,vG,xG,bG,SG,IG,CG,kG,TG,pP=L(()=>{"use strict";Km();Qb();wG={42:Ma,43:Ma,45:Ma,48:Ma,49:Ma,50:Ma,51:Ma,52:Ma,53:Ma,54:Ma,55:Ma,56:Ma,57:Ma,62:Bm},vG={91:mb},xG={[-2]:wd,[-1]:wd,32:wd},bG={35:gb,42:ps,45:[Xm,ps],60:wb,61:Xm,95:ps,96:qm,126:qm},SG={38:Fm,92:zm},IG={[-5]:xd,[-4]:xd,[-3]:xd,33:xb,38:Fm,42:yd,60:[ib,vb],91:bb,92:[hb,zm],93:fs,95:yd,96:sb},CG={null:[yd,lP]},kG={null:[42,95]},TG={null:[]}});function mP(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=[],s=[],l=!0,u={attempt:U(R),check:U(O),consume:S,enter:E,exit:T,interrupt:U(O,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:I,parser:e,previous:null,sliceSerialize:h,sliceStream:v,write:m},d=t.tokenize.call(c,u),p;return t.resolveAll&&o.push(t),c;function m(q){return i=Ba(i,q),w(),i[i.length-1]!==null?[]:(A(t,0),c.events=ai(o,c.events,c),c.events)}function h(q,Z){return EG(v(q),Z)}function v(q){return LG(i,q)}function I(){let{_bufferIndex:q,_index:Z,line:X,column:B,offset:P}=n;return{_bufferIndex:q,_index:Z,line:X,column:B,offset:P}}function y(q){r[q.line]=q.column,$()}function w(){let q;for(;n._index<i.length;){let Z=i[n._index];if(typeof Z=="string")for(q=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===q&&n._bufferIndex<Z.length;)g(Z.charCodeAt(n._bufferIndex));else g(Z)}}function g(q){l=void 0,p=q,d=d(q)}function S(q){ne(q)?(n.line++,n.column=1,n.offset+=q===-3?2:1,$()):q!==-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=q,l=!0}function E(q,Z){let X=Z||{};return X.type=q,X.start=I(),c.events.push(["enter",X,c]),s.push(X),X}function T(q){let Z=s.pop();return Z.end=I(),c.events.push(["exit",Z,c]),Z}function R(q,Z){A(q,Z.from)}function O(q,Z){Z.restore()}function U(q,Z){return X;function X(B,P,J){let ge,C,ze,ot;return Array.isArray(B)?ae(B):"tokenize"in B?ae([B]):x(B);function x(be){return Oe;function Oe(we){let ce=we!==null&&be[we],Le=we!==null&&be.null,ie=[...Array.isArray(ce)?ce:ce?[ce]:[],...Array.isArray(Le)?Le:Le?[Le]:[]];return ae(ie)(we)}}function ae(be){return ge=be,C=0,be.length===0?J:re(be[C])}function re(be){return Oe;function Oe(we){return ot=Q(),ze=be,be.partial||(c.currentConstruct=be),be.name&&c.parser.constructs.disable.null.includes(be.name)?We(we):be.tokenize.call(Z?Object.assign(Object.create(c),Z):c,u,Ce,We)(we)}}function Ce(be){return l=!0,q(ze,ot),P}function We(be){return l=!0,ot.restore(),++C<ge.length?re(ge[C]):J}}}function A(q,Z){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&Zt(c.events,Z,c.events.length-Z,q.resolve(c.events.slice(Z),c)),q.resolveTo&&(c.events=q.resolveTo(c.events,c))}function Q(){let q=I(),Z=c.previous,X=c.currentConstruct,B=c.events.length,P=Array.from(s);return{from:B,restore:J};function J(){n=q,c.previous=Z,c.currentConstruct=X,c.events.length=B,s=P,$()}}function $(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function LG(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 s=i[0];typeof s=="string"?i[0]=s.slice(n):i.shift()}o>0&&i.push(e[r].slice(0,o))}return i}function EG(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=`
|
|
38
|
+
$$`:`${e}$$`},rW=e=>aW(e)%2===0?e:nW(e),oW=(e,t,a)=>{if(e.substring(t+2).includes(")"))return null;let n=R7(e,t);if(n===-1||th(e,n))return null;let r=n>0&&e[n-1]==="!",o=r?n-1:n,i=e.substring(0,o);if(r)return i;let s=e.substring(n+1,t);return a==="text-only"?`${i}${s}`:`${i}[${s}](streamdown:incomplete-link)`},e_=(e,t)=>{for(let a=0;a<=t;a++)if(e[a]==="["&&!th(e,a)){if(a>0&&e[a-1]==="!")continue;let n=r_(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},iW=(e,t,a)=>{let n=t>0&&e[t-1]==="!",r=n?t-1:t,o=e.substring(t+1);if(!o.includes("]")){let i=e.substring(0,r);if(n)return i;if(a==="text-only"){let s=e_(e,t);return s!==-1?e.substring(0,s)+e.substring(s+1):`${i}${o}`}return`${e}](streamdown:incomplete-link)`}if(r_(e,t)===-1){let i=e.substring(0,r);if(n)return i;if(a==="text-only"){let s=e_(e,t);if(s!==-1)return e.substring(0,s)+e.substring(s+1);let l=e.substring(t+1);return`${i}${l}`}return`${e}](streamdown:incomplete-link)`}return null},l_=(e,t="protocol")=>{let a=e.lastIndexOf("](");if(a!==-1&&!th(e,a)){let n=oW(e,a,t);if(n!==null)return n}for(let n=e.length-1;n>=0;n-=1)if(e[n]==="["&&!th(e,n)){let r=iW(e,n,t);if(r!==null)return r}return e},sW=/^-{1,2}$/,lW=/^[\s]*-{1,2}[\s]+$/,uW=/^={1,2}$/,cW=/^[\s]*={1,2}[\s]+$/,dW=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(sW.test(r)&&!a.match(lW)){let o=n.split(`
|
|
40
|
+
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}if(uW.test(r)&&!a.match(cW)){let o=n.split(`
|
|
41
|
+
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}return e},fW=e=>{let t=e.match(C7);if(t){let a=t[2];if(!a||ms.test(a))return e;if((e.match(QD)||[]).length%2===1)return`${e}~~`}else if(e.match(A7)&&(e.match(QD)||[]).length%2===1)return`${e}~`;return e},Ab=e=>e!==!1,bn={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},pW=[{handler:{name:"setextHeadings",handle:dW,priority:bn.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:l_,priority:bn.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:K7,priority:bn.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:z7,priority:bn.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:q7,priority:bn.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:j7,priority:bn.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:W7,priority:bn.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:eW,priority:bn.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:fW,priority:bn.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:rW,priority:bn.KATEX},optionKey:"katex"}],mW=e=>{var t;let a=(t=e?.linkMode)!=null?t:"protocol";return pW.filter(({handler:n,optionKey:r})=>n.name==="links"?Ab(e?.links)||Ab(e?.images):Ab(e?.[r])).map(({handler:n,earlyReturn:r})=>n.name==="links"?{handler:a_(t_({},n),{handle:o=>l_(o,a)}),earlyReturn:a==="protocol"?r:void 0}:{handler:n,earlyReturn:r})},hW=(e,t)=>{var a;if(!e||typeof e!="string")return e;let n=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,r=mW(t),o=((a=t?.handlers)!=null?a:[]).map(s=>{var l;return{handler:a_(t_({},s),{priority:(l=s.priority)!=null?l:bn.DEFAULT}),earlyReturn:void 0}}),i=[...r,...o].sort((s,l)=>{var u,c;return((u=s.handler.priority)!=null?u:bn.DEFAULT)-((c=l.handler.priority)!=null?c:bn.DEFAULT)});for(let{handler:s,earlyReturn:l}of i)if(n=s.handle(n),l!=null&&l(n))return n;return n},u_=hW});function d_(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var f_=L(()=>{"use strict"});function nh(e,t){return((t||wW).jsx?yW:gW).test(e)}var gW,yW,wW,p_=L(()=>{"use strict";gW=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yW=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wW={}});var m_=L(()=>{"use strict";p_()});function Rb(e){return typeof e=="object"?e.type==="text"?h_(e.value):!1:h_(e)}function h_(e){return e.replace(vW,"")===""}var vW,g_=L(()=>{"use strict";vW=/[ \t\n\f\r]/g});var y_=L(()=>{"use strict";g_()});var no,Db=L(()=>{"use strict";no=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};no.prototype.normal={};no.prototype.property={};no.prototype.space=void 0});function _b(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new no(a,n,t)}var w_=L(()=>{"use strict";Db()});function Sd(e){return e.toLowerCase()}var Pb=L(()=>{"use strict"});var ga,Ob=L(()=>{"use strict";ga=class{constructor(t,a){this.attribute=a,this.property=t}};ga.prototype.attribute="";ga.prototype.booleanish=!1;ga.prototype.boolean=!1;ga.prototype.commaOrSpaceSeparated=!1;ga.prototype.commaSeparated=!1;ga.prototype.defined=!1;ga.prototype.mustUseProperty=!1;ga.prototype.number=!1;ga.prototype.overloadedBoolean=!1;ga.prototype.property="";ga.prototype.spaceSeparated=!1;ga.prototype.space=void 0});var Id={};lf(Id,{boolean:()=>De,booleanish:()=>$t,commaOrSpaceSeparated:()=>tn,commaSeparated:()=>ri,number:()=>G,overloadedBoolean:()=>rh,spaceSeparated:()=>ht});function hs(){return 2**++xW}var xW,De,$t,rh,G,ht,ri,tn,Cd=L(()=>{"use strict";xW=0,De=hs(),$t=hs(),rh=hs(),G=hs(),ht=hs(),ri=hs(),tn=hs()});function v_(e,t,a){a&&(e[t]=a)}var Nb,gs,Ub=L(()=>{"use strict";Ob();Cd();Nb=Object.keys(Id),gs=class extends ga{constructor(t,a,n,r){let o=-1;if(super(t,a),v_(this,"space",r),typeof n=="number")for(;++o<Nb.length;){let i=Nb[o];v_(this,Nb[o],(n&Id[i])===Id[i])}}};gs.prototype.defined=!0});function zn(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new gs(n,e.transform(e.attributes||{},n),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,a[Sd(n)]=n,a[Sd(o.attribute)]=n}return new no(t,a,e.space)}var ys=L(()=>{"use strict";Pb();Ub();Db()});var Bb,x_=L(()=>{"use strict";ys();Cd();Bb=zn({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:ht,ariaCurrent:null,ariaDescribedBy:ht,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:ht,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:ht,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ht,ariaLevel:G,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:ht,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:ht,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:$t,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}})});function oh(e,t){return t in e?e[t]:t}var zb=L(()=>{"use strict"});function ih(e,t){return oh(e,t.toLowerCase())}var Fb=L(()=>{"use strict";zb()});var b_,S_=L(()=>{"use strict";Fb();ys();Cd();b_=zn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ri,acceptCharset:ht,accessKey:ht,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:ht,autoFocus:De,autoPlay:De,blocking:ht,capture:null,charSet:null,checked:De,cite:null,className:ht,cols:G,colSpan:null,content:null,contentEditable:$t,controls:De,controlsList:ht,coords:G|ri,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:rh,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:ht,height:G,hidden:rh,high:G,href:null,hrefLang:null,htmlFor:ht,httpEquiv:ht,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:ht,itemRef:ht,itemScope:De,itemType:ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:G,pattern:null,ping:ht,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:ht,required:De,reversed:De,rows:G,rowSpan:G,sandbox:ht,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:$t,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ht,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:De,disableRemotePlayback:De,prefix:null,property:null,results:G,security:null,unselectable:null},space:"html",transform:ih})});var I_,C_=L(()=>{"use strict";zb();ys();Cd();I_=zn({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:tn,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:ht,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:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,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:ri,g2:ri,glyphName:ri,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:tn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,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:G,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:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:tn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:tn,rev:tn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:tn,requiredFeatures:tn,requiredFonts:tn,requiredFormats:tn,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:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:tn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:tn,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:tn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:oh})});var qb,k_=L(()=>{"use strict";ys();qb=zn({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 Hb,T_=L(()=>{"use strict";ys();Fb();Hb=zn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ih})});var jb,L_=L(()=>{"use strict";ys();jb=zn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var Vb,E_=L(()=>{"use strict";Vb={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 $b(e,t){let a=Sd(t),n=t,r=ga;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&SW.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(A_,CW);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!A_.test(o)){let i=o.replace(bW,IW);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=gs}return new r(n,t)}function IW(e){return"-"+e.toLowerCase()}function CW(e){return e.charAt(1).toUpperCase()}var bW,A_,SW,M_=L(()=>{"use strict";Ub();Ob();Pb();bW=/[A-Z]/g,A_=/-[a-z]/g,SW=/^data[-\w.:]+$/i});var R_,sh,D_=L(()=>{"use strict";w_();x_();S_();C_();k_();T_();L_();E_();M_();R_=_b([Bb,b_,qb,Hb,jb],"html"),sh=_b([Bb,I_,qb,Hb,jb],"svg")});function __(e){return e.join(" ").trim()}var P_=L(()=>{"use strict"});var F_=Ca((Hme,z_)=>{"use strict";var O_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,kW=/\n/g,TW=/^\s*/,LW=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,EW=/^:\s*/,AW=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,MW=/^[;\s]*/,RW=/^\s+|\s+$/g,DW=`
|
|
42
|
+
`,N_="/",U_="*",ws="",_W="comment",PW="declaration";function OW(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(h){var v=h.match(kW);v&&(a+=v.length);var I=h.lastIndexOf(DW);n=~I?h.length-I:n+h.length}function o(){var h={line:a,column:n};return function(v){return v.position=new i(h),u(),v}}function i(h){this.start=h,this.end={line:a,column:n},this.source=t.source}i.prototype.content=e;function s(h){var v=new Error(t.source+":"+a+":"+n+": "+h);if(v.reason=h,v.filename=t.source,v.line=a,v.column=n,v.source=e,!t.silent)throw v}function l(h){var v=h.exec(e);if(v){var I=v[0];return r(I),e=e.slice(I.length),v}}function u(){l(TW)}function c(h){var v;for(h=h||[];v=d();)v!==!1&&h.push(v);return h}function d(){var h=o();if(!(N_!=e.charAt(0)||U_!=e.charAt(1))){for(var v=2;ws!=e.charAt(v)&&(U_!=e.charAt(v)||N_!=e.charAt(v+1));)++v;if(v+=2,ws===e.charAt(v-1))return s("End of comment missing");var I=e.slice(2,v-2);return n+=2,r(I),e=e.slice(v),n+=2,h({type:_W,comment:I})}}function p(){var h=o(),v=l(LW);if(v){if(d(),!l(EW))return s("property missing ':'");var I=l(AW),y=h({type:PW,property:B_(v[0].replace(O_,ws)),value:I?B_(I[0].replace(O_,ws)):ws});return l(MW),y}}function m(){var h=[];c(h);for(var v;v=p();)v!==!1&&(h.push(v),c(h));return h}return u(),m()}function B_(e){return e?e.replace(RW,ws):ws}z_.exports=OW});var q_=Ca(kd=>{"use strict";var NW=kd&&kd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kd,"__esModule",{value:!0});kd.default=BW;var UW=NW(F_());function BW(e,t){let a=null;if(!e||typeof e!="string")return a;let n=(0,UW.default)(e),r=typeof t=="function";return n.forEach(o=>{if(o.type!=="declaration")return;let{property:i,value:s}=o;r?t(i,s,o):s&&(a=a||{},a[i]=s)}),a}});var j_=Ca(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.camelCase=void 0;var zW=/^--[a-zA-Z0-9_-]+$/,FW=/-([a-z])/g,qW=/^[^-]+$/,HW=/^-(webkit|moz|ms|o|khtml)-/,jW=/^-(ms)-/,VW=function(e){return!e||qW.test(e)||zW.test(e)},$W=function(e,t){return t.toUpperCase()},H_=function(e,t){return"".concat(t,"-")},WW=function(e,t){return t===void 0&&(t={}),VW(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(jW,H_):e=e.replace(HW,H_),e.replace(FW,$W))};lh.camelCase=WW});var $_=Ca((Gb,V_)=>{"use strict";var GW=Gb&&Gb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},XW=GW(q_()),KW=j_();function Wb(e,t){var a={};return!e||typeof e!="string"||(0,XW.default)(e,function(n,r){n&&r&&(a[(0,KW.camelCase)(n,t)]=r)}),a}Wb.default=Wb;V_.exports=Wb});function oi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?W_(e.position):"start"in e||"end"in e?W_(e):"line"in e||"column"in e?Xb(e):""}function Xb(e){return G_(e&&e.line)+":"+G_(e&&e.column)}function W_(e){return Xb(e&&e.start)+"-"+Xb(e&&e.end)}function G_(e){return e&&typeof e=="number"?e:1}var X_=L(()=>{"use strict"});var Kb=L(()=>{"use strict";X_()});var ea,K_=L(()=>{"use strict";Kb();ea=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 l=n.indexOf(":");l===-1?o.ruleId=n:(o.source=n.slice(0,l),o.ruleId=n.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){let l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}let s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=oi(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}};ea.prototype.file="";ea.prototype.name="";ea.prototype.reason="";ea.prototype.message="";ea.prototype.stack="";ea.prototype.column=void 0;ea.prototype.line=void 0;ea.prototype.ancestors=void 0;ea.prototype.cause=void 0;ea.prototype.fatal=void 0;ea.prototype.place=void 0;ea.prototype.ruleId=void 0;ea.prototype.source=void 0});var Yb=L(()=>{"use strict";K_()});function Jb(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=sG(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=iG(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"?sh:R_,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=J_(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function J_(e,t,a){if(t.type==="element")return eG(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tG(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return nG(e,t,a);if(t.type==="mdxjsEsm")return aG(e,t);if(t.type==="root")return rG(e,t,a);if(t.type==="text")return oG(e,t)}function eG(e,t,a){let n=e.schema,r=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=sh,e.schema=r),e.ancestors.push(t);let o=eP(e,t.tagName,!1),i=lG(e,t),s=eS(e,t);return JW.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Rb(l):!0})),Q_(e,i,o,t),Qb(i,s),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function tG(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)}Td(e,t.position)}function aG(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Td(e,t.position)}function nG(e,t,a){let n=e.schema,r=n;t.name==="svg"&&n.space==="html"&&(r=sh,e.schema=r),e.ancestors.push(t);let o=t.name===null?e.Fragment:eP(e,t.name,!0),i=uG(e,t),s=eS(e,t);return Q_(e,i,o,t),Qb(i,s),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function rG(e,t,a){let n={};return Qb(n,eS(e,t)),e.create(t,e.Fragment,n,a)}function oG(e,t){return t.value}function Q_(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function Qb(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function iG(e,t,a){return n;function n(r,o,i,s){let u=Array.isArray(i.children)?a:t;return s?u(o,i,s):u(o,i)}}function sG(e,t){return a;function a(n,r,o,i){let s=Array.isArray(o.children),l=Wl(n);return t(r,o,i,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function lG(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&Zb.call(t.properties,r)){let o=cG(e,r,t.properties[r]);if(o){let[i,s]=o;e.tableCellAlignToStyle&&i==="align"&&typeof s=="string"&&QW.has(t.tagName)?n=s:a[i]=s}}if(n){let o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return a}function uG(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 s=i.properties[0];s.type,Object.assign(a,e.evaluater.evaluateExpression(s.argument))}else Td(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 s=n.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Td(e,t.position);else o=n.value===null?!0:n.value;a[r]=o}return a}function eS(e,t){let a=[],n=-1,r=e.passKeys?new Map:YW;for(;++n<t.children.length;){let o=t.children[n],i;if(e.passKeys){let l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){let u=r.get(l)||0;i=l+"-"+u,r.set(l,u+1)}}let s=J_(e,o,i);s!==void 0&&a.push(s)}return a}function cG(e,t,a){let n=$b(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?d_(a):__(a)),n.property==="style"){let r=typeof a=="object"?a:dG(e,String(a));return e.stylePropertyNameCase==="css"&&(r=fG(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?Vb[n.property]||n.property:n.attribute,a]}}function dG(e,t){try{return(0,Y_.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new ea("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=Z_+"#cannot-parse-style-attribute",r}}function eP(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 s=nh(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};i=i?{type:"MemberExpression",object:i,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}n=i}else n=nh(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let r=n.value;return Zb.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(n);Td(e)}function Td(e,t){let a=new ea("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=Z_+"#cannot-handle-mdx-estrees-without-createevaluater",a}function fG(e){let t={},a;for(a in e)Zb.call(e,a)&&(t[pG(a)]=e[a]);return t}function pG(e){let t=e.replace(ZW,mG);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function mG(e){return"-"+e.toLowerCase()}var Y_,Zb,YW,ZW,JW,QW,Z_,tP=L(()=>{"use strict";f_();m_();y_();D_();P_();Y_=j($_(),1);pd();Yb();Zb={}.hasOwnProperty,YW=new Map,ZW=/[A-Z]/g,JW=new Set(["table","tbody","thead","tfoot","tr"]),QW=new Set(["td","th"]),Z_="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var aP=L(()=>{"use strict";tP()});function hG(e){let t=e.attempt(this.parser.constructs.contentInitial,n,r),a;return t;function n(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ye(e,t,"linePrefix")}function r(s){return e.enter("paragraph"),o(s)}function o(s){let l=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=l),a=l,i(s)}function i(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ne(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),i)}}var nP,rP=L(()=>{"use strict";Qt();at();nP={tokenize:hG}});function gG(e){let t=this,a=[],n=0,r,o,i;return s;function s(g){if(n<a.length){let S=a[n];return t.containerState=S[1],e.attempt(S[0].continuation,l,u)(g)}return u(g)}function l(g){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&w();let S=t.events.length,E=S,T;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){T=t.events[E][1].end;break}y(n);let R=S;for(;R<t.events.length;)t.events[R][1].end={...T},R++;return Jt(t.events,E+1,0,t.events.slice(S)),t.events.length=R,u(g)}return s(g)}function u(g){if(n===a.length){if(!r)return p(g);if(r.currentConstruct&&r.currentConstruct.concrete)return h(g);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(oP,c,d)(g)}function c(g){return r&&w(),y(n),p(g)}function d(g){return t.parser.lazy[t.now().line]=n!==a.length,i=t.now().offset,h(g)}function p(g){return t.containerState={},e.attempt(oP,m,h)(g)}function m(g){return n++,a.push([t.currentConstruct,t.containerState]),p(g)}function h(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}),v(g)}function v(g){if(g===null){I(e.exit("chunkFlow"),!0),y(0),e.consume(g);return}return ne(g)?(e.consume(g),I(e.exit("chunkFlow")),n=0,t.interrupt=void 0,s):(e.consume(g),v)}function I(g,S){let E=t.sliceStream(g);if(S&&E.push(null),g.previous=o,o&&(o.next=g),o=g,r.defineSkip(g.start),r.write(E),t.parser.lazy[g.start.line]){let T=r.events.length;for(;T--;)if(r.events[T][1].start.offset<i&&(!r.events[T][1].end||r.events[T][1].end.offset>i))return;let R=t.events.length,O=R,U,A;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(U){A=t.events[O][1].end;break}U=!0}for(y(n),T=R;T<t.events.length;)t.events[T][1].end={...A},T++;Jt(t.events,O+1,0,t.events.slice(R)),t.events.length=T}}function y(g){let S=a.length;for(;S-- >g;){let E=a[S];t.containerState=E[1],E[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 yG(e,t,a){return ye(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var iP,oP,sP=L(()=>{"use strict";Qt();at();to();iP={tokenize:gG},oP={tokenize:yG}});function wG(e){let t=this,a=e.attempt(Cr,n,e.attempt(this.parser.constructs.flowInitial,r,ye(e,e.attempt(this.parser.constructs.flow,r,e.attempt(db,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 lP,uP=L(()=>{"use strict";Zm();Qt();lP={tokenize:wG}});function pP(e){return{resolveAll:mP(e==="text"?vG:void 0),tokenize:t};function t(a){let n=this,r=this.parser.constructs[e],o=a.attempt(r,i,s);return i;function i(c){return u(c)?o(c):s(c)}function s(c){if(c===null){a.consume(c);return}return a.enter("data"),a.consume(c),l}function l(c){return u(c)?(a.exit("data"),o(c)):(a.consume(c),l)}function u(c){if(c===null)return!0;let d=r[c],p=-1;if(d)for(;++p<d.length;){let m=d[p];if(!m.previous||m.previous.call(n,n.previous))return!0}return!1}}}function mP(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 vG(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,s=0,l;for(;o--;){let u=r[o];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)s++,i--;if(i)break;i=-1}else if(u===-2)l=!0,s++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(s=0),s){let u={type:a===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?i:n.start._bufferIndex+i,_index:n.start._index+o,line:n.end.line,column:n.end.column-s,offset:n.end.offset-s},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 cP,dP,fP,tS=L(()=>{"use strict";cP={resolveAll:mP()},dP=pP("string"),fP=pP("text")});var aS={};lf(aS,{attentionMarkers:()=>LG,contentInitial:()=>bG,disable:()=>EG,document:()=>xG,flow:()=>IG,flowInitial:()=>SG,insideSpan:()=>TG,string:()=>CG,text:()=>kG});var xG,bG,SG,IG,CG,kG,TG,LG,EG,hP=L(()=>{"use strict";Zm();tS();xG={42:Ra,43:Ra,45:Ra,48:Ra,49:Ra,50:Ra,51:Ra,52:Ra,53:Ra,54:Ra,55:Ra,56:Ra,57:Ra,62:Fm},bG={91:gb},SG={[-2]:vd,[-1]:vd,32:vd},IG={35:wb,42:ps,45:[Ym,ps],60:xb,61:Ym,95:ps,96:jm,126:jm},CG={38:Hm,92:qm},kG={[-5]:bd,[-4]:bd,[-3]:bd,33:Sb,38:Hm,42:wd,60:[lb,bb],91:Ib,92:[yb,qm],93:fs,95:wd,96:ub},TG={null:[wd,cP]},LG={null:[42,95]},EG={null:[]}});function gP(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=[],s=[],l=!0,u={attempt:U(R),check:U(O),consume:S,enter:E,exit:T,interrupt:U(O,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:I,parser:e,previous:null,sliceSerialize:h,sliceStream:v,write:m},d=t.tokenize.call(c,u),p;return t.resolveAll&&o.push(t),c;function m(H){return i=za(i,H),w(),i[i.length-1]!==null?[]:(A(t,0),c.events=ai(o,c.events,c),c.events)}function h(H,Z){return MG(v(H),Z)}function v(H){return AG(i,H)}function I(){let{_bufferIndex:H,_index:Z,line:X,column:B,offset:P}=n;return{_bufferIndex:H,_index:Z,line:X,column:B,offset:P}}function y(H){r[H.line]=H.column,$()}function w(){let H;for(;n._index<i.length;){let Z=i[n._index];if(typeof Z=="string")for(H=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===H&&n._bufferIndex<Z.length;)g(Z.charCodeAt(n._bufferIndex));else g(Z)}}function g(H){l=void 0,p=H,d=d(H)}function S(H){ne(H)?(n.line++,n.column=1,n.offset+=H===-3?2:1,$()):H!==-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=H,l=!0}function E(H,Z){let X=Z||{};return X.type=H,X.start=I(),c.events.push(["enter",X,c]),s.push(X),X}function T(H){let Z=s.pop();return Z.end=I(),c.events.push(["exit",Z,c]),Z}function R(H,Z){A(H,Z.from)}function O(H,Z){Z.restore()}function U(H,Z){return X;function X(B,P,J){let ge,C,ze,ot;return Array.isArray(B)?te(B):"tokenize"in B?te([B]):x(B);function x(be){return Oe;function Oe(we){let ce=we!==null&&be[we],Le=we!==null&&be.null,ie=[...Array.isArray(ce)?ce:ce?[ce]:[],...Array.isArray(Le)?Le:Le?[Le]:[]];return te(ie)(we)}}function te(be){return ge=be,C=0,be.length===0?J:re(be[C])}function re(be){return Oe;function Oe(we){return ot=Q(),ze=be,be.partial||(c.currentConstruct=be),be.name&&c.parser.constructs.disable.null.includes(be.name)?We(we):be.tokenize.call(Z?Object.assign(Object.create(c),Z):c,u,ke,We)(we)}}function ke(be){return l=!0,H(ze,ot),P}function We(be){return l=!0,ot.restore(),++C<ge.length?re(ge[C]):J}}}function A(H,Z){H.resolveAll&&!o.includes(H)&&o.push(H),H.resolve&&Jt(c.events,Z,c.events.length-Z,H.resolve(c.events.slice(Z),c)),H.resolveTo&&(c.events=H.resolveTo(c.events,c))}function Q(){let H=I(),Z=c.previous,X=c.currentConstruct,B=c.events.length,P=Array.from(s);return{from:B,restore:J};function J(){n=H,c.previous=Z,c.currentConstruct=X,c.events.length=B,s=P,$()}}function $(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function AG(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 s=i[0];typeof s=="string"?i[0]=s.slice(n):i.shift()}o>0&&i.push(e[r].slice(0,o))}return i}function MG(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
43
|
`;break}case-3:{i=`\r
|
|
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 hP=L(()=>{"use strict";at();no();gd()});function tS(e){let n={constructs:Nm([eS,...(e||{}).extensions||[]]),content:r(tP),defined:[],document:r(rP),flow:r(iP),lazy:{},string:r(uP),text:r(cP)};return n;function r(o){return i;function i(s){return mP(n,o,s)}}}var gP=L(()=>{"use strict";ab();aP();oP();sP();Qb();pP();hP()});function aS(e){for(;!jm(e););return e}var yP=L(()=>{"use strict";lb()});function nS(){let e=1,t="",a=!0,n;return r;function r(o,i,s){let l=[],u,c,d,p,m;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(wP.lastIndex=d,u=wP.exec(o),p=u&&u.index!==void 0?u.index:o.length,m=o.charCodeAt(p),!u){t=o.slice(d);break}if(m===10&&d===p&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),d<p&&(l.push(o.slice(d,p)),e+=p-d),m){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:n=!0,e=1}d=p+1}return s&&(n&&l.push(-5),t&&l.push(t),l.push(null)),l}}var wP,vP=L(()=>{"use strict";wP=/[\0\t\n\r]/g});var xP=L(()=>{"use strict";gP();yP();vP()});function rS(e,t,a){return typeof t!="string"&&(a=t,t=void 0),AG(a)(aS(tS(a).document().write(nS()(e,t,!0))))}function AG(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(de),autolinkProtocol:U,autolinkEmail:U,atxHeading:o(Ne),blockQuote:o(we),characterEscape:U,characterReference:U,codeFenced:o(ce),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(ce,i),codeText:o(Le,i),codeTextData:U,data:U,codeFlowValue:U,definition:o(ie),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o(xe),hardBreakEscape:o(_e),hardBreakTrailing:o(_e),htmlFlow:o(Fe,i),htmlFlowData:U,htmlText:o(Fe,i),htmlTextData:U,image:o(Ae),label:i,link:o(de),listItem:o(ct),listItemValue:p,listOrdered:o(W,d),listUnordered:o(W),paragraph:o(le),reference:x,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(Ne),strong:o(oe),thematicBreak:o(ee)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:Oe,autolinkProtocol:be,blockQuote:l(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:Ce,characterReference:We,codeFenced:l(I),codeFencedFence:v,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:A,codeIndented:l(y),codeText:l(X),codeTextData:A,data:A,definition:l(),definitionDestinationString:S,definitionLabelString:w,definitionTitleString:g,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(q),htmlFlowData:A,htmlText:l(Z),htmlTextData:A,image:l(P),label:ge,labelText:J,lineEnding:Q,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ae,resourceDestinationString:C,resourceTitleString:ze,resource:ot,setextHeading:l(O),setextHeadingLineSequence:R,setextHeadingText:T,strong:l(),thematicBreak:l()}};IP(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(k){let D={type:"root",children:[]},H={stack:[D],tokenStack:[],config:t,enter:s,exit:u,buffer:i,resume:c,data:a},fe=[],qe=-1;for(;++qe<k.length;)if(k[qe][1].type==="listOrdered"||k[qe][1].type==="listUnordered")if(k[qe][0]==="enter")fe.push(qe);else{let gt=fe.pop();qe=r(k,gt,qe)}for(qe=-1;++qe<k.length;){let gt=t[k[qe][0]];SP.call(gt,k[qe][1].type)&>[k[qe][1].type].call(Object.assign({sliceSerialize:k[qe][2].sliceSerialize},H),k[qe][1])}if(H.tokenStack.length>0){let gt=H.tokenStack[H.tokenStack.length-1];(gt[1]||bP).call(H,void 0,gt[0])}for(D.position={start:ii(k.length>0?k[0][1].start:{line:1,column:1,offset:0}),end:ii(k.length>0?k[k.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<t.transforms.length;)D=t.transforms[qe](D)||D;return D}function r(k,D,H){let fe=D-1,qe=-1,gt=!1,In,Cn,Ha,sr;for(;++fe<=H;){let ha=k[fe];switch(ha[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ha[0]==="enter"?qe++:qe--,sr=void 0;break}case"lineEndingBlank":{ha[0]==="enter"&&(In&&!sr&&!qe&&!Ha&&(Ha=fe),sr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sr=void 0}if(!qe&&ha[0]==="enter"&&ha[1].type==="listItemPrefix"||qe===-1&&ha[0]==="exit"&&(ha[1].type==="listUnordered"||ha[1].type==="listOrdered")){if(In){let kn=fe;for(Cn=void 0;kn--;){let ja=k[kn];if(ja[1].type==="lineEnding"||ja[1].type==="lineEndingBlank"){if(ja[0]==="exit")continue;Cn&&(k[Cn][1].type="lineEndingBlank",gt=!0),ja[1].type="lineEnding",Cn=kn}else if(!(ja[1].type==="linePrefix"||ja[1].type==="blockQuotePrefix"||ja[1].type==="blockQuotePrefixWhitespace"||ja[1].type==="blockQuoteMarker"||ja[1].type==="listItemIndent"))break}Ha&&(!Cn||Ha<Cn)&&(In._spread=!0),In.end=Object.assign({},Cn?k[Cn][1].start:ha[1].end),k.splice(Cn||fe,0,["exit",In,ha[2]]),fe++,H++}if(ha[1].type==="listItemPrefix"){let kn={type:"listItem",_spread:!1,start:Object.assign({},ha[1].start),end:void 0};In=kn,k.splice(fe,0,["enter",kn,ha[2]]),fe++,H++,Ha=void 0,sr=!0}}}return k[D][1]._spread=gt,H}function o(k,D){return H;function H(fe){s.call(this,k(fe),fe),D&&D.call(this,fe)}}function i(){this.stack.push({type:"fragment",children:[]})}function s(k,D,H){this.stack[this.stack.length-1].children.push(k),this.stack.push(k),this.tokenStack.push([D,H||void 0]),k.position={start:ii(D.start),end:void 0}}function l(k){return D;function D(H){k&&k.call(this,H),u.call(this,H)}}function u(k,D){let H=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==k.type&&(D?D.call(this,k,fe[0]):(fe[1]||bP).call(this,k,fe[0]));else throw new Error("Cannot close `"+k.type+"` ("+oi({start:k.start,end:k.end})+"): it\u2019s not open");H.position.end=ii(k.end)}function c(){return ls(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(k){if(this.data.expectingFirstListItemValue){let D=this.stack[this.stack.length-2];D.start=Number.parseInt(this.sliceSerialize(k),10),this.data.expectingFirstListItemValue=void 0}}function m(){let k=this.resume(),D=this.stack[this.stack.length-1];D.lang=k}function h(){let k=this.resume(),D=this.stack[this.stack.length-1];D.meta=k}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function I(){let k=this.resume(),D=this.stack[this.stack.length-1];D.value=k.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){let k=this.resume(),D=this.stack[this.stack.length-1];D.value=k.replace(/(\r?\n|\r)$/g,"")}function w(k){let D=this.resume(),H=this.stack[this.stack.length-1];H.label=D,H.identifier=Aa(this.sliceSerialize(k)).toLowerCase()}function g(){let k=this.resume(),D=this.stack[this.stack.length-1];D.title=k}function S(){let k=this.resume(),D=this.stack[this.stack.length-1];D.url=k}function E(k){let D=this.stack[this.stack.length-1];if(!D.depth){let H=this.sliceSerialize(k).length;D.depth=H}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function R(k){let D=this.stack[this.stack.length-1];D.depth=this.sliceSerialize(k).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function U(k){let H=this.stack[this.stack.length-1].children,fe=H[H.length-1];(!fe||fe.type!=="text")&&(fe=ke(),fe.position={start:ii(k.start),end:void 0},H.push(fe)),this.stack.push(fe)}function A(k){let D=this.stack.pop();D.value+=this.sliceSerialize(k),D.position.end=ii(k.end)}function Q(k){let D=this.stack[this.stack.length-1];if(this.data.atHardBreak){let H=D.children[D.children.length-1];H.position.end=ii(k.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(D.type)&&(U.call(this,k),A.call(this,k))}function $(){this.data.atHardBreak=!0}function q(){let k=this.resume(),D=this.stack[this.stack.length-1];D.value=k}function Z(){let k=this.resume(),D=this.stack[this.stack.length-1];D.value=k}function X(){let k=this.resume(),D=this.stack[this.stack.length-1];D.value=k}function B(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let D=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=D,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function P(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let D=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=D,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function J(k){let D=this.sliceSerialize(k),H=this.stack[this.stack.length-2];H.label=H2(D),H.identifier=Aa(D).toLowerCase()}function ge(){let k=this.stack[this.stack.length-1],D=this.resume(),H=this.stack[this.stack.length-1];if(this.data.inReference=!0,H.type==="link"){let fe=k.children;H.children=fe}else H.alt=D}function C(){let k=this.resume(),D=this.stack[this.stack.length-1];D.url=k}function ze(){let k=this.resume(),D=this.stack[this.stack.length-1];D.title=k}function ot(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function ae(k){let D=this.resume(),H=this.stack[this.stack.length-1];H.label=D,H.identifier=Aa(this.sliceSerialize(k)).toLowerCase(),this.data.referenceType="full"}function re(k){this.data.characterReferenceType=k.type}function Ce(k){let D=this.sliceSerialize(k),H=this.data.characterReferenceType,fe;H?(fe=Om(D,H==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=Zl(D);let qe=this.stack[this.stack.length-1];qe.value+=fe}function We(k){let D=this.stack.pop();D.position.end=ii(k.end)}function be(k){A.call(this,k);let D=this.stack[this.stack.length-1];D.url=this.sliceSerialize(k)}function Oe(k){A.call(this,k);let D=this.stack[this.stack.length-1];D.url="mailto:"+this.sliceSerialize(k)}function we(){return{type:"blockquote",children:[]}}function ce(){return{type:"code",lang:null,meta:null,value:""}}function Le(){return{type:"inlineCode",value:""}}function ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function xe(){return{type:"emphasis",children:[]}}function Ne(){return{type:"heading",depth:0,children:[]}}function _e(){return{type:"break"}}function Fe(){return{type:"html",value:""}}function Ae(){return{type:"image",title:null,url:"",alt:null}}function de(){return{type:"link",title:null,url:"",children:[]}}function W(k){return{type:"list",ordered:k.type==="listOrdered",start:null,spread:k._spread,children:[]}}function ct(k){return{type:"listItem",spread:k._spread,checked:null,children:[]}}function le(){return{type:"paragraph",children:[]}}function oe(){return{type:"strong",children:[]}}function ke(){return{type:"text",value:""}}function ee(){return{type:"thematicBreak"}}}function ii(e){return{line:e.line,column:e.column,offset:e.offset}}function IP(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?IP(e,n):MG(e,n)}}function MG(e,t){let a;for(a in t)if(SP.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 bP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+oi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+oi({start:t.start,end:t.end})+") is still open")}var SP,CP=L(()=>{"use strict";Rm();xP();Gx();j2();Gl();Pm();Gb();SP={}.hasOwnProperty});var kP=L(()=>{"use strict";CP()});function sh(e){let t=this;t.parser=a;function a(n){return rS(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var TP=L(()=>{"use strict";kP()});var LP=L(()=>{"use strict";TP()});function EP(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 AP=L(()=>{"use strict"});function MP(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
|
|
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 yP=L(()=>{"use strict";at();to();yd()});function nS(e){let n={constructs:Bm([aS,...(e||{}).extensions||[]]),content:r(nP),defined:[],document:r(iP),flow:r(lP),lazy:{},string:r(dP),text:r(fP)};return n;function r(o){return i;function i(s){return gP(n,o,s)}}}var wP=L(()=>{"use strict";rb();rP();sP();uP();tS();hP();yP()});function rS(e){for(;!$m(e););return e}var vP=L(()=>{"use strict";cb()});function oS(){let e=1,t="",a=!0,n;return r;function r(o,i,s){let l=[],u,c,d,p,m;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(xP.lastIndex=d,u=xP.exec(o),p=u&&u.index!==void 0?u.index:o.length,m=o.charCodeAt(p),!u){t=o.slice(d);break}if(m===10&&d===p&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),d<p&&(l.push(o.slice(d,p)),e+=p-d),m){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:n=!0,e=1}d=p+1}return s&&(n&&l.push(-5),t&&l.push(t),l.push(null)),l}}var xP,bP=L(()=>{"use strict";xP=/[\0\t\n\r]/g});var SP=L(()=>{"use strict";wP();vP();bP()});function iS(e,t,a){return typeof t!="string"&&(a=t,t=void 0),RG(a)(rS(nS(a).document().write(oS()(e,t,!0))))}function RG(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(de),autolinkProtocol:U,autolinkEmail:U,atxHeading:o(Ne),blockQuote:o(we),characterEscape:U,characterReference:U,codeFenced:o(ce),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(ce,i),codeText:o(Le,i),codeTextData:U,data:U,codeFlowValue:U,definition:o(ie),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o(xe),hardBreakEscape:o(_e),hardBreakTrailing:o(_e),htmlFlow:o(Fe,i),htmlFlowData:U,htmlText:o(Fe,i),htmlTextData:U,image:o(Ae),label:i,link:o(de),listItem:o(ct),listItemValue:p,listOrdered:o(W,d),listUnordered:o(W),paragraph:o(le),reference:x,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(Ne),strong:o(oe),thematicBreak:o(ae)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:Oe,autolinkProtocol:be,blockQuote:l(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ke,characterReference:We,codeFenced:l(I),codeFencedFence:v,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:A,codeIndented:l(y),codeText:l(X),codeTextData:A,data:A,definition:l(),definitionDestinationString:S,definitionLabelString:w,definitionTitleString:g,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(H),htmlFlowData:A,htmlText:l(Z),htmlTextData:A,image:l(P),label:ge,labelText:J,lineEnding:Q,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:C,resourceTitleString:ze,resource:ot,setextHeading:l(O),setextHeadingLineSequence:R,setextHeadingText:T,strong:l(),thematicBreak:l()}};kP(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(k){let D={type:"root",children:[]},F={stack:[D],tokenStack:[],config:t,enter:s,exit:u,buffer:i,resume:c,data:a},fe=[],Ve=-1;for(;++Ve<k.length;)if(k[Ve][1].type==="listOrdered"||k[Ve][1].type==="listUnordered")if(k[Ve][0]==="enter")fe.push(Ve);else{let Ft=fe.pop();Ve=r(k,Ft,Ve)}for(Ve=-1;++Ve<k.length;){let Ft=t[k[Ve][0]];CP.call(Ft,k[Ve][1].type)&&Ft[k[Ve][1].type].call(Object.assign({sliceSerialize:k[Ve][2].sliceSerialize},F),k[Ve][1])}if(F.tokenStack.length>0){let Ft=F.tokenStack[F.tokenStack.length-1];(Ft[1]||IP).call(F,void 0,Ft[0])}for(D.position={start:ii(k.length>0?k[0][1].start:{line:1,column:1,offset:0}),end:ii(k.length>0?k[k.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)D=t.transforms[Ve](D)||D;return D}function r(k,D,F){let fe=D-1,Ve=-1,Ft=!1,In,ca,so,lo;for(;++fe<=F;){let qt=k[fe];switch(qt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{qt[0]==="enter"?Ve++:Ve--,lo=void 0;break}case"lineEndingBlank":{qt[0]==="enter"&&(In&&!lo&&!Ve&&!so&&(so=fe),lo=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:lo=void 0}if(!Ve&&qt[0]==="enter"&&qt[1].type==="listItemPrefix"||Ve===-1&&qt[0]==="exit"&&(qt[1].type==="listUnordered"||qt[1].type==="listOrdered")){if(In){let Vn=fe;for(ca=void 0;Vn--;){let on=k[Vn];if(on[1].type==="lineEnding"||on[1].type==="lineEndingBlank"){if(on[0]==="exit")continue;ca&&(k[ca][1].type="lineEndingBlank",Ft=!0),on[1].type="lineEnding",ca=Vn}else if(!(on[1].type==="linePrefix"||on[1].type==="blockQuotePrefix"||on[1].type==="blockQuotePrefixWhitespace"||on[1].type==="blockQuoteMarker"||on[1].type==="listItemIndent"))break}so&&(!ca||so<ca)&&(In._spread=!0),In.end=Object.assign({},ca?k[ca][1].start:qt[1].end),k.splice(ca||fe,0,["exit",In,qt[2]]),fe++,F++}if(qt[1].type==="listItemPrefix"){let Vn={type:"listItem",_spread:!1,start:Object.assign({},qt[1].start),end:void 0};In=Vn,k.splice(fe,0,["enter",Vn,qt[2]]),fe++,F++,so=void 0,lo=!0}}}return k[D][1]._spread=Ft,F}function o(k,D){return F;function F(fe){s.call(this,k(fe),fe),D&&D.call(this,fe)}}function i(){this.stack.push({type:"fragment",children:[]})}function s(k,D,F){this.stack[this.stack.length-1].children.push(k),this.stack.push(k),this.tokenStack.push([D,F||void 0]),k.position={start:ii(D.start),end:void 0}}function l(k){return D;function D(F){k&&k.call(this,F),u.call(this,F)}}function u(k,D){let F=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==k.type&&(D?D.call(this,k,fe[0]):(fe[1]||IP).call(this,k,fe[0]));else throw new Error("Cannot close `"+k.type+"` ("+oi({start:k.start,end:k.end})+"): it\u2019s not open");F.position.end=ii(k.end)}function c(){return ls(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(k){if(this.data.expectingFirstListItemValue){let D=this.stack[this.stack.length-2];D.start=Number.parseInt(this.sliceSerialize(k),10),this.data.expectingFirstListItemValue=void 0}}function m(){let k=this.resume(),D=this.stack[this.stack.length-1];D.lang=k}function h(){let k=this.resume(),D=this.stack[this.stack.length-1];D.meta=k}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function I(){let k=this.resume(),D=this.stack[this.stack.length-1];D.value=k.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){let k=this.resume(),D=this.stack[this.stack.length-1];D.value=k.replace(/(\r?\n|\r)$/g,"")}function w(k){let D=this.resume(),F=this.stack[this.stack.length-1];F.label=D,F.identifier=Ma(this.sliceSerialize(k)).toLowerCase()}function g(){let k=this.resume(),D=this.stack[this.stack.length-1];D.title=k}function S(){let k=this.resume(),D=this.stack[this.stack.length-1];D.url=k}function E(k){let D=this.stack[this.stack.length-1];if(!D.depth){let F=this.sliceSerialize(k).length;D.depth=F}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function R(k){let D=this.stack[this.stack.length-1];D.depth=this.sliceSerialize(k).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function U(k){let F=this.stack[this.stack.length-1].children,fe=F[F.length-1];(!fe||fe.type!=="text")&&(fe=Ie(),fe.position={start:ii(k.start),end:void 0},F.push(fe)),this.stack.push(fe)}function A(k){let D=this.stack.pop();D.value+=this.sliceSerialize(k),D.position.end=ii(k.end)}function Q(k){let D=this.stack[this.stack.length-1];if(this.data.atHardBreak){let F=D.children[D.children.length-1];F.position.end=ii(k.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(D.type)&&(U.call(this,k),A.call(this,k))}function $(){this.data.atHardBreak=!0}function H(){let k=this.resume(),D=this.stack[this.stack.length-1];D.value=k}function Z(){let k=this.resume(),D=this.stack[this.stack.length-1];D.value=k}function X(){let k=this.resume(),D=this.stack[this.stack.length-1];D.value=k}function B(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let D=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=D,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function P(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let D=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=D,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function J(k){let D=this.sliceSerialize(k),F=this.stack[this.stack.length-2];F.label=V2(D),F.identifier=Ma(D).toLowerCase()}function ge(){let k=this.stack[this.stack.length-1],D=this.resume(),F=this.stack[this.stack.length-1];if(this.data.inReference=!0,F.type==="link"){let fe=k.children;F.children=fe}else F.alt=D}function C(){let k=this.resume(),D=this.stack[this.stack.length-1];D.url=k}function ze(){let k=this.resume(),D=this.stack[this.stack.length-1];D.title=k}function ot(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function te(k){let D=this.resume(),F=this.stack[this.stack.length-1];F.label=D,F.identifier=Ma(this.sliceSerialize(k)).toLowerCase(),this.data.referenceType="full"}function re(k){this.data.characterReferenceType=k.type}function ke(k){let D=this.sliceSerialize(k),F=this.data.characterReferenceType,fe;F?(fe=Um(D,F==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=Zl(D);let Ve=this.stack[this.stack.length-1];Ve.value+=fe}function We(k){let D=this.stack.pop();D.position.end=ii(k.end)}function be(k){A.call(this,k);let D=this.stack[this.stack.length-1];D.url=this.sliceSerialize(k)}function Oe(k){A.call(this,k);let D=this.stack[this.stack.length-1];D.url="mailto:"+this.sliceSerialize(k)}function we(){return{type:"blockquote",children:[]}}function ce(){return{type:"code",lang:null,meta:null,value:""}}function Le(){return{type:"inlineCode",value:""}}function ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function xe(){return{type:"emphasis",children:[]}}function Ne(){return{type:"heading",depth:0,children:[]}}function _e(){return{type:"break"}}function Fe(){return{type:"html",value:""}}function Ae(){return{type:"image",title:null,url:"",alt:null}}function de(){return{type:"link",title:null,url:"",children:[]}}function W(k){return{type:"list",ordered:k.type==="listOrdered",start:null,spread:k._spread,children:[]}}function ct(k){return{type:"listItem",spread:k._spread,checked:null,children:[]}}function le(){return{type:"paragraph",children:[]}}function oe(){return{type:"strong",children:[]}}function Ie(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function ii(e){return{line:e.line,column:e.column,offset:e.offset}}function kP(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?kP(e,n):DG(e,n)}}function DG(e,t){let a;for(a in t)if(CP.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 IP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+oi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+oi({start:t.start,end:t.end})+") is still open")}var CP,TP=L(()=>{"use strict";_m();SP();Kx();$2();Gl();Nm();Kb();CP={}.hasOwnProperty});var LP=L(()=>{"use strict";TP()});function uh(e){let t=this;t.parser=a;function a(n){return iS(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var EP=L(()=>{"use strict";LP()});var AP=L(()=>{"use strict";EP()});function MP(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 RP=L(()=>{"use strict"});function DP(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
45
|
+
`}]}var _P=L(()=>{"use strict"});function PP(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 OP=L(()=>{"use strict"});function NP(e,t){let a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var UP=L(()=>{"use strict"});function BP(e,t){let a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var zP=L(()=>{"use strict"});function FP(e,t){let a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),r=Bn(n.toLowerCase()),o=e.footnoteOrder.indexOf(n),i,s=e.footnoteCounts.get(n);s===void 0?(s=0,e.footnoteOrder.push(n),i=e.footnoteOrder.length):i=o+1,s+=1,e.footnoteCounts.set(n,s);let l={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+r,id:a+"fnref-"+r+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,l);let u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}var qP=L(()=>{"use strict";cs()});function HP(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 jP=L(()=>{"use strict"});function VP(e,t){if(e.options.allowDangerousHtml){let a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}var $P=L(()=>{"use strict"});function ch(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 i=r[r.length-1];return i&&i.type==="text"?i.value+=n:r.push({type:"text",value:n}),r}var sS=L(()=>{"use strict"});function WP(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return ch(e,t);let r={src:Bn(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 GP=L(()=>{"use strict";cs();sS()});function XP(e,t){let a={src:Bn(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 KP=L(()=>{"use strict";cs()});function YP(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 ZP=L(()=>{"use strict"});function JP(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return ch(e,t);let r={href:Bn(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 QP=L(()=>{"use strict";cs();sS()});function eO(e,t){let a={href:Bn(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 tO=L(()=>{"use strict";cs()});function aO(e,t,a){let n=e.all(t),r=a?_G(a):nO(t),o={},i=[];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 s=-1;for(;++s<n.length;){let c=n[s];(r||s!==0||c.type!=="element"||c.tagName!=="p")&&i.push({type:"text",value:`
|
|
47
47
|
`}),c.type==="element"&&c.tagName==="p"&&!r?i.push(...c.children):i.push(c)}let l=n[n.length-1];l&&(r||l.type!=="element"||l.tagName!=="p")&&i.push({type:"text",value:`
|
|
48
|
-
`});let u={type:"element",tagName:"li",properties:o,children:i};return e.patch(t,u),e.applyData(t,u)}function
|
|
48
|
+
`});let u={type:"element",tagName:"li",properties:o,children:i};return e.patch(t,u),e.applyData(t,u)}function _G(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let a=e.children,n=-1;for(;!t&&++n<a.length;)t=nO(a[n])}return t}function nO(e){let t=e.spread;return t??e.children.length>1}var rO=L(()=>{"use strict"});function oO(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 i=n[r];if(i.type==="element"&&i.tagName==="li"&&i.properties&&Array.isArray(i.properties.className)&&i.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 iO=L(()=>{"use strict"});function sO(e,t){let a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var lO=L(()=>{"use strict"});function uO(e,t){let a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}var cO=L(()=>{"use strict"});function dO(e,t){let a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var fO=L(()=>{"use strict"});function pO(e,t){let a=e.all(t),n=a.shift(),r=[];if(n){let i={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],i),r.push(i)}if(a.length>0){let i={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},s=Wl(t.children[1]),l=Em(t.children[t.children.length-1]);s&&l&&(i.position={start:s,end:l}),r.push(i)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}var mO=L(()=>{"use strict";pd()});function hO(e,t,a){let n=a?a.children:void 0,o=(n?n.indexOf(t):1)===0?"th":"td",i=a&&a.type==="table"?a.align:void 0,s=i?i.length:t.children.length,l=-1,u=[];for(;++l<s;){let d=t.children[l],p={},m=i?i[l]:void 0;m&&(p.align=m);let h={type:"element",tagName:o,properties:p,children:[]};d&&(h.children=e.all(d),e.patch(d,h),h=e.applyData(d,h)),u.push(h)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}var gO=L(()=>{"use strict"});function yO(e,t){let a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var wO=L(()=>{"use strict"});function xO(e){let t=String(e),a=/\r?\n|\r/g,n=a.exec(t),r=0,o=[];for(;n;)o.push(vO(t.slice(r,n.index),r>0,!0),n[0]),r=n.index+n[0].length,n=a.exec(t);return o.push(vO(t.slice(r),r>0,!1)),o.join("")}function vO(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 bO=L(()=>{"use strict"});function SO(e,t){let a={type:"text",value:xO(String(t.value))};return e.patch(t,a),e.applyData(t,a)}var IO=L(()=>{"use strict";bO()});function CO(e,t){let a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}var kO=L(()=>{"use strict"});function dh(){}var TO,LO=L(()=>{"use strict";RP();_P();OP();UP();zP();qP();jP();$P();GP();KP();ZP();QP();tO();rO();iO();lO();cO();fO();mO();gO();wO();IO();kO();TO={blockquote:MP,break:DP,code:PP,delete:NP,emphasis:BP,footnoteReference:FP,heading:HP,html:VP,imageReference:WP,image:XP,inlineCode:YP,linkReference:JP,link:eO,listItem:aO,list:oO,paragraph:sO,root:uO,strong:dO,table:pO,tableCell:yO,tableRow:hO,text:SO,thematicBreak:CO,toml:dh,yaml:dh,definition:dh,footnoteDefinition:dh}});function PG(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 OG(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function EO(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||PG,n=e.options.footnoteBackLabel||OG,r=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[],l=-1;for(;++l<e.footnoteOrder.length;){let u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;let c=e.all(u),d=String(u.identifier).toUpperCase(),p=Bn(d.toLowerCase()),m=0,h=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++m<=v;){h.length>0&&h.push({type:"text",value:" "});let w=typeof a=="string"?a:a(l,m);typeof w=="string"&&(w={type:"text",value:w}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(l,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}let I=c[c.length-1];if(I&&I.type==="element"&&I.tagName==="p"){let w=I.children[I.children.length-1];w&&w.type==="text"?w.value+=" ":I.children.push({type:"text",value:" "}),I.children.push(...h)}else c.push(...h);let y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(c,!0)};e.patch(u,y),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Jo(i),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
|
|
49
49
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
|
|
50
|
-
`}]}}var
|
|
50
|
+
`}]}}var AO=L(()=>{"use strict";Lm();cs()});function RO(e,t){let a=t||NG,n=new Map,r=new Map,o=new Map,i={...TO,...a.handlers},s={all:u,applyData:BG,definitionById:n,footnoteById:r,footnoteCounts:o,footnoteOrder:[],handlers:i,one:l,options:a,patch:UG,wrap:FG};return Qr(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){let d=c.type==="definition"?n:r,p=String(c.identifier).toUpperCase();d.has(p)||d.set(p,c)}}),s;function l(c,d){let p=c.type,m=s.handlers[p];if(lS.call(s.handlers,p)&&m)return m(s,c,d);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in c){let{children:v,...I}=c,y=Jo(I);return y.children=s.all(c),y}return Jo(c)}return(s.options.unknownHandler||zG)(s,c,d)}function u(c){let d=[];if("children"in c){let p=c.children,m=-1;for(;++m<p.length;){let h=s.one(p[m],c);if(h){if(m&&p[m-1].type==="break"&&(!Array.isArray(h)&&h.type==="text"&&(h.value=MO(h.value)),!Array.isArray(h)&&h.type==="element")){let v=h.children[0];v&&v.type==="text"&&(v.value=MO(v.value))}Array.isArray(h)?d.push(...h):d.push(h)}}}return d}}function UG(e,t){e.position&&(t.position=fd(e))}function BG(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 i="children"in a?a.children:[a];a={type:"element",tagName:n,properties:{},children:i}}a.type==="element"&&o&&Object.assign(a.properties,Jo(o)),"children"in a&&a.children&&r!==null&&r!==void 0&&(a.children=r)}return a}function zG(e,t){let a=t.data||{},n="value"in t&&!(lS.call(a,"hProperties")||lS.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 FG(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 RO=L(()=>{"use strict";LO();MO()});var DO=L(()=>{"use strict";RO()});function dh(e,t){return e&&"run"in e?async function(a,n){let r=ch(a,{file:n,...t});await e.run(r,n)}:function(a,n){return ch(a,{file:n,...e||t})}}var _O=L(()=>{"use strict";DO()});var PO=L(()=>{"use strict";_O()});function sS(e){if(e)throw e}var OO=L(()=>{"use strict"});var VO=Ia((vye,jO)=>{"use strict";var fh=Object.prototype.hasOwnProperty,HO=Object.prototype.toString,NO=Object.defineProperty,UO=Object.getOwnPropertyDescriptor,BO=function(t){return typeof Array.isArray=="function"?Array.isArray(t):HO.call(t)==="[object Array]"},zO=function(t){if(!t||HO.call(t)!=="[object Object]")return!1;var a=fh.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&fh.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!n)return!1;var r;for(r in t);return typeof r>"u"||fh.call(t,r)},FO=function(t,a){NO&&a.name==="__proto__"?NO(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},qO=function(t,a){if(a==="__proto__")if(fh.call(t,a)){if(UO)return UO(t,a).value}else return;return t[a]};jO.exports=function e(){var t,a,n,r,o,i,s=arguments[0],l=1,u=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<u;++l)if(t=arguments[l],t!=null)for(a in t)n=qO(s,a),r=qO(t,a),s!==r&&(c&&r&&(zO(r)||(o=BO(r)))?(o?(o=!1,i=n&&BO(n)?n:[]):i=n&&zO(n)?n:{},FO(s,{name:a,newValue:e(c,i,r)})):typeof r<"u"&&FO(s,{name:a,newValue:r}));return s}});function Td(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 $O=L(()=>{"use strict"});function lS(){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);s(null,...r);function s(l,...u){let c=e[++o],d=-1;if(l){i(l);return}for(;++d<r.length;)(u[d]===null||u[d]===void 0)&&(u[d]=r[d]);r=u,c?WO(c,s)(...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 WO(e,t){let a;return n;function n(...i){let s=e.length>i.length,l;s&&i.push(r);try{l=e.apply(this,i)}catch(u){let c=u;if(s&&a)throw c;return r(c)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,r):l instanceof Error?r(l):o(l))}function r(i,...s){a||(a=!0,t(i,...s))}function o(i){r(null,i)}}var GO=L(()=>{"use strict"});var XO=L(()=>{"use strict";GO()});function zG(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ld(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,s=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else i<0&&(o=!0,i=r+1),s>-1&&(e.codePointAt(r)===t.codePointAt(s--)?s<0&&(n=r):(s=-1,n=i));return a===n?n=i:n<0&&(n=e.length),e.slice(a,n)}function FG(e){if(Ld(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 qG(e){Ld(e);let t=e.length,a=-1,n=0,r=-1,o=0,i;for(;t--;){let s=e.codePointAt(t);if(s===47){if(i){n=t+1;break}continue}a<0&&(i=!0,a=t+1),s===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 HG(...e){let t=-1,a;for(;++t<e.length;)Ld(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":jG(a)}function jG(e){Ld(e);let t=e.codePointAt(0)===47,a=VG(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function VG(e,t){let a="",n=0,r=-1,o=0,i=-1,s,l;for(;++i<=e.length;){if(i<e.length)s=e.codePointAt(i);else{if(s===47)break;s=47}if(s===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(l=a.lastIndexOf("/"),l!==a.length-1){l<0?(a="",n=0):(a=a.slice(0,l),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 s===46&&o>-1?o++:o=-1}return a}function Ld(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var nr,KO=L(()=>{"use strict";nr={basename:zG,dirname:FG,extname:qG,join:HG,sep:"/"}});function $G(){return"/"}var YO,ZO=L(()=>{"use strict";YO={cwd:$G}});function eu(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var uS=L(()=>{"use strict"});function JO(e){if(typeof e=="string")e=new URL(e);else if(!eu(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 WG(e)}function WG(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 QO=L(()=>{"use strict";uS();uS()});function dS(e,t){if(e&&e.includes(nr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+nr.sep+"`")}function fS(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function eN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function GG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var cS,Ed,tN=L(()=>{"use strict";Xb();KO();ZO();QO();cS=["history","path","basename","stem","extname","dirname"],Ed=class{constructor(t){let a;t?eu(t)?a={path:t}:typeof t=="string"||GG(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":YO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<cS.length;){let o=cS[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)cS.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?nr.basename(this.path):void 0}set basename(t){fS(t,"basename"),dS(t,"basename"),this.path=nr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?nr.dirname(this.path):void 0}set dirname(t){eN(this.basename,"dirname"),this.path=nr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?nr.extname(this.path):void 0}set extname(t){if(dS(t,"extname"),eN(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=nr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){eu(t)&&(t=JO(t)),fS(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?nr.basename(this.path,this.extname):void 0}set stem(t){fS(t,"stem"),dS(t,"stem"),this.path=nr.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 Qt(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 aN=L(()=>{"use strict";tN()});var nN,rN=L(()=>{"use strict";nN=(function(e){let n=this.constructor.prototype,r=n[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,n),o})});function pS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function mS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hS(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 oN(e){if(!Td(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function iN(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ph(e){return KG(e)?e:new Ed(e)}function KG(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function YG(e){return typeof e=="string"||ZG(e)}function ZG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var mh,XG,gS,yS,sN=L(()=>{"use strict";OO();mh=j(VO(),1);$O();XO();aN();rN();XG={}.hasOwnProperty,gS=class e extends nN{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=lS()}copy(){let t=new e,a=-1;for(;++a<this.attachers.length;){let n=this.attachers[a];t.use(...n)}return t.data((0,mh.default)(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(hS("data",this.frozen),this.namespace[t]=a,this):XG.call(this.namespace,t)&&this.namespace[t]||void 0:t?(hS("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=ph(t),n=this.parser||this.Parser;return pS("parse",n),n(String(a),a)}process(t,a){let n=this;return this.freeze(),pS("process",this.parser||this.Parser),mS("process",this.compiler||this.Compiler),a?r(void 0,a):new Promise(r);function r(o,i){let s=ph(t),l=n.parse(s);n.run(l,s,function(c,d,p){if(c||!d||!p)return u(c);let m=d,h=n.stringify(m,p);YG(h)?p.value=h:p.result=h,u(c,p)});function u(c,d){c||!d?i(c):o?o(d):a(void 0,d)}}}processSync(t){let a=!1,n;return this.freeze(),pS("processSync",this.parser||this.Parser),mS("processSync",this.compiler||this.Compiler),this.process(t,r),iN("processSync","process",a),n;function r(o,i){a=!0,sS(o),n=i}}run(t,a,n){oN(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,s){let l=ph(a);r.run(t,l,u);function u(c,d,p){let m=d||t;c?s(c):i?i(m):n(void 0,m,p)}}}runSync(t,a){let n=!1,r;return this.run(t,a,o),iN("runSync","run",n),r;function o(i,s){sS(i),r=s,n=!0}}stringify(t,a){this.freeze();let n=ph(a),r=this.compiler||this.Compiler;return mS("stringify",r),oN(t),r(t,n)}use(t,...a){let n=this.attachers,r=this.namespace;if(hS("use",this.frozen),t!=null)if(typeof t=="function")l(t,a);else if(typeof t=="object")Array.isArray(t)?s(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){let[c,...d]=u;l(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");s(u.plugins),u.settings&&(r.settings=(0,mh.default)(!0,r.settings,u.settings))}function s(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 l(u,c){let d=-1,p=-1;for(;++d<n.length;)if(n[d][0]===u){p=d;break}if(p===-1)n.push([u,...c]);else if(c.length>0){let[m,...h]=c,v=n[p][1];Td(v)&&Td(m)&&(m=(0,mh.default)(!0,v,m)),n[p]=[u,m,...h]}}}},yS=new gS().freeze()});var lN=L(()=>{"use strict";sN()});function bS(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function hN(e){xs=e}function it(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(za.caret,"$1"),a=a.replace(r,i),n},getRegex:()=>new RegExp(a,t)};return n}function io(e,t){if(t){if(za.escapeTest.test(e))return e.replace(za.escapeReplace,dN)}else if(za.escapeTestNoEncode.test(e))return e.replace(za.escapeReplaceNoEncode,dN);return e}function fN(e){try{e=encodeURI(e).replace(za.percentDecode,"%")}catch{return null}return e}function pN(e,t){let a=e.replace(za.findPipe,(o,i,s)=>{let l=!1,u=i;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),n=a.split(za.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(za.slashPipe,"|");return n}function Md(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 DX(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 mN(e,t,a,n,r){let o=t.href,i=t.title||null,s=e[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:a,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}function _X(e,t,a){let n=e.match(a.other.indentCodeCompensation);if(n===null)return t;let r=n[1];return t.split(`
|
|
53
|
+
`}),a}function MO(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}var lS,NG,DO=L(()=>{"use strict";Lm();Cm();pd();LO();lS={}.hasOwnProperty,NG={}});function fh(e,t){let a=RO(e,t),n=a.one(e,void 0),r=EO(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 _O=L(()=>{"use strict";AO();DO()});var PO=L(()=>{"use strict";_O()});function ph(e,t){return e&&"run"in e?async function(a,n){let r=fh(a,{file:n,...t});await e.run(r,n)}:function(a,n){return fh(a,{file:n,...e||t})}}var OO=L(()=>{"use strict";PO()});var NO=L(()=>{"use strict";OO()});function uS(e){if(e)throw e}var UO=L(()=>{"use strict"});var WO=Ca((bye,$O)=>{"use strict";var mh=Object.prototype.hasOwnProperty,VO=Object.prototype.toString,BO=Object.defineProperty,zO=Object.getOwnPropertyDescriptor,FO=function(t){return typeof Array.isArray=="function"?Array.isArray(t):VO.call(t)==="[object Array]"},qO=function(t){if(!t||VO.call(t)!=="[object Object]")return!1;var a=mh.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&mh.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!n)return!1;var r;for(r in t);return typeof r>"u"||mh.call(t,r)},HO=function(t,a){BO&&a.name==="__proto__"?BO(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},jO=function(t,a){if(a==="__proto__")if(mh.call(t,a)){if(zO)return zO(t,a).value}else return;return t[a]};$O.exports=function e(){var t,a,n,r,o,i,s=arguments[0],l=1,u=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<u;++l)if(t=arguments[l],t!=null)for(a in t)n=jO(s,a),r=jO(t,a),s!==r&&(c&&r&&(qO(r)||(o=FO(r)))?(o?(o=!1,i=n&&FO(n)?n:[]):i=n&&qO(n)?n:{},HO(s,{name:a,newValue:e(c,i,r)})):typeof r<"u"&&HO(s,{name:a,newValue:r}));return s}});function Ld(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 GO=L(()=>{"use strict"});function cS(){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);s(null,...r);function s(l,...u){let c=e[++o],d=-1;if(l){i(l);return}for(;++d<r.length;)(u[d]===null||u[d]===void 0)&&(u[d]=r[d]);r=u,c?XO(c,s)(...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 XO(e,t){let a;return n;function n(...i){let s=e.length>i.length,l;s&&i.push(r);try{l=e.apply(this,i)}catch(u){let c=u;if(s&&a)throw c;return r(c)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,r):l instanceof Error?r(l):o(l))}function r(i,...s){a||(a=!0,t(i,...s))}function o(i){r(null,i)}}var KO=L(()=>{"use strict"});var YO=L(()=>{"use strict";KO()});function qG(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ed(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,s=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else i<0&&(o=!0,i=r+1),s>-1&&(e.codePointAt(r)===t.codePointAt(s--)?s<0&&(n=r):(s=-1,n=i));return a===n?n=i:n<0&&(n=e.length),e.slice(a,n)}function HG(e){if(Ed(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 jG(e){Ed(e);let t=e.length,a=-1,n=0,r=-1,o=0,i;for(;t--;){let s=e.codePointAt(t);if(s===47){if(i){n=t+1;break}continue}a<0&&(i=!0,a=t+1),s===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 VG(...e){let t=-1,a;for(;++t<e.length;)Ed(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":$G(a)}function $G(e){Ed(e);let t=e.codePointAt(0)===47,a=WG(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function WG(e,t){let a="",n=0,r=-1,o=0,i=-1,s,l;for(;++i<=e.length;){if(i<e.length)s=e.codePointAt(i);else{if(s===47)break;s=47}if(s===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(l=a.lastIndexOf("/"),l!==a.length-1){l<0?(a="",n=0):(a=a.slice(0,l),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 s===46&&o>-1?o++:o=-1}return a}function Ed(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var ar,ZO=L(()=>{"use strict";ar={basename:qG,dirname:HG,extname:jG,join:VG,sep:"/"}});function GG(){return"/"}var JO,QO=L(()=>{"use strict";JO={cwd:GG}});function eu(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var dS=L(()=>{"use strict"});function eN(e){if(typeof e=="string")e=new URL(e);else if(!eu(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 XG(e)}function XG(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 tN=L(()=>{"use strict";dS();dS()});function pS(e,t){if(e&&e.includes(ar.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ar.sep+"`")}function mS(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function aN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function KG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var fS,Ad,nN=L(()=>{"use strict";Yb();ZO();QO();tN();fS=["history","path","basename","stem","extname","dirname"],Ad=class{constructor(t){let a;t?eu(t)?a={path:t}:typeof t=="string"||KG(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":JO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<fS.length;){let o=fS[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)fS.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?ar.basename(this.path):void 0}set basename(t){mS(t,"basename"),pS(t,"basename"),this.path=ar.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ar.dirname(this.path):void 0}set dirname(t){aN(this.basename,"dirname"),this.path=ar.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ar.extname(this.path):void 0}set extname(t){if(pS(t,"extname"),aN(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=ar.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){eu(t)&&(t=eN(t)),mS(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ar.basename(this.path,this.extname):void 0}set stem(t){mS(t,"stem"),pS(t,"stem"),this.path=ar.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 ea(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 rN=L(()=>{"use strict";nN()});var oN,iN=L(()=>{"use strict";oN=(function(e){let n=this.constructor.prototype,r=n[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,n),o})});function hS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function gS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function yS(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 sN(e){if(!Ld(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function lN(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hh(e){return ZG(e)?e:new Ad(e)}function ZG(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function JG(e){return typeof e=="string"||QG(e)}function QG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var gh,YG,wS,vS,uN=L(()=>{"use strict";UO();gh=j(WO(),1);GO();YO();rN();iN();YG={}.hasOwnProperty,wS=class e extends oN{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=cS()}copy(){let t=new e,a=-1;for(;++a<this.attachers.length;){let n=this.attachers[a];t.use(...n)}return t.data((0,gh.default)(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(yS("data",this.frozen),this.namespace[t]=a,this):YG.call(this.namespace,t)&&this.namespace[t]||void 0:t?(yS("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=hh(t),n=this.parser||this.Parser;return hS("parse",n),n(String(a),a)}process(t,a){let n=this;return this.freeze(),hS("process",this.parser||this.Parser),gS("process",this.compiler||this.Compiler),a?r(void 0,a):new Promise(r);function r(o,i){let s=hh(t),l=n.parse(s);n.run(l,s,function(c,d,p){if(c||!d||!p)return u(c);let m=d,h=n.stringify(m,p);JG(h)?p.value=h:p.result=h,u(c,p)});function u(c,d){c||!d?i(c):o?o(d):a(void 0,d)}}}processSync(t){let a=!1,n;return this.freeze(),hS("processSync",this.parser||this.Parser),gS("processSync",this.compiler||this.Compiler),this.process(t,r),lN("processSync","process",a),n;function r(o,i){a=!0,uS(o),n=i}}run(t,a,n){sN(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,s){let l=hh(a);r.run(t,l,u);function u(c,d,p){let m=d||t;c?s(c):i?i(m):n(void 0,m,p)}}}runSync(t,a){let n=!1,r;return this.run(t,a,o),lN("runSync","run",n),r;function o(i,s){uS(i),r=s,n=!0}}stringify(t,a){this.freeze();let n=hh(a),r=this.compiler||this.Compiler;return gS("stringify",r),sN(t),r(t,n)}use(t,...a){let n=this.attachers,r=this.namespace;if(yS("use",this.frozen),t!=null)if(typeof t=="function")l(t,a);else if(typeof t=="object")Array.isArray(t)?s(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){let[c,...d]=u;l(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");s(u.plugins),u.settings&&(r.settings=(0,gh.default)(!0,r.settings,u.settings))}function s(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 l(u,c){let d=-1,p=-1;for(;++d<n.length;)if(n[d][0]===u){p=d;break}if(p===-1)n.push([u,...c]);else if(c.length>0){let[m,...h]=c,v=n[p][1];Ld(v)&&Ld(m)&&(m=(0,gh.default)(!0,v,m)),n[p]=[u,m,...h]}}}},vS=new wS().freeze()});var cN=L(()=>{"use strict";uN()});function IS(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function yN(e){xs=e}function it(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(Fa.caret,"$1"),a=a.replace(r,i),n},getRegex:()=>new RegExp(a,t)};return n}function ro(e,t){if(t){if(Fa.escapeTest.test(e))return e.replace(Fa.escapeReplace,pN)}else if(Fa.escapeTestNoEncode.test(e))return e.replace(Fa.escapeReplaceNoEncode,pN);return e}function mN(e){try{e=encodeURI(e).replace(Fa.percentDecode,"%")}catch{return null}return e}function hN(e,t){let a=e.replace(Fa.findPipe,(o,i,s)=>{let l=!1,u=i;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),n=a.split(Fa.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(Fa.slashPipe,"|");return n}function Rd(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 PX(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 gN(e,t,a,n,r){let o=t.href,i=t.title||null,s=e[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:a,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}function OX(e,t,a){let n=e.match(a.other.indentCodeCompensation);if(n===null)return t;let r=n[1];return t.split(`
|
|
55
55
|
`).map(o=>{let i=o.match(a.other.beginningSpace);if(i===null)return o;let[s]=i;return s.length>=r.length?o.slice(r.length):o}).join(`
|
|
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=
|
|
56
|
+
`)}function wt(e,t){return vs.parse(e,t)}var xs,_d,eX,Fa,tX,aX,nX,Pd,rX,CS,wN,vN,oX,kS,iX,TS,sX,lX,Sh,LS,uX,xN,cX,ES,dN,dX,fX,pX,mX,bN,hX,Ih,AS,SN,gX,IN,yX,wX,vX,CN,xX,bX,kN,SX,IX,CX,kX,TX,LX,EX,vh,AX,TN,LN,MX,fN,MS,RX,xS,DX,yh,Md,_X,pN,xh,Sn,bh,RS,nr,wh,Dd,NX,vs,Xye,Kye,Yye,Zye,Jye,Qye,ewe,EN=L(()=>{"use strict";xs=IS();_d={exec:()=>null};eX=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Fa={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")},tX=/^(?:[ \t]*(?:\n|$))+/,aX=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,nX=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Pd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,rX=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,CS=/(?:[*+-]|\d{1,9}[.)])/,wN=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vN=it(wN).replace(/bull/g,CS).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(),oX=it(wN).replace(/bull/g,CS).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(),kS=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,iX=/^[^\n]+/,TS=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sX=it(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",TS).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),lX=it(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,CS).getRegex(),Sh="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",LS=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,uX=it("^ {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",LS).replace("tag",Sh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xN=it(kS).replace("hr",Pd).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",Sh).getRegex(),cX=it(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",xN).getRegex(),ES={blockquote:cX,code:aX,def:sX,fences:nX,heading:rX,hr:Pd,html:uX,lheading:vN,list:lX,newline:tX,paragraph:xN,table:_d,text:iX},dN=it("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Pd).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",Sh).getRegex(),dX={...ES,lheading:oX,table:dN,paragraph:it(kS).replace("hr",Pd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",dN).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",Sh).getRegex()},fX={...ES,html:it(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",LS).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:_d,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(kS).replace("hr",Pd).replace("heading",` *#{1,6} *[^
|
|
57
|
+
]`).replace("lheading",vN).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},pX=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,mX=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bN=/^( {2,}|\\)\n(?!\s*$)/,hX=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ih=/[\p{P}\p{S}]/u,AS=/[\s\p{P}\p{S}]/u,SN=/[^\s\p{P}\p{S}]/u,gX=it(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,AS).getRegex(),IN=/(?!~)[\p{P}\p{S}]/u,yX=/(?!~)[\s\p{P}\p{S}]/u,wX=/(?:[^\s\p{P}\p{S}]|~)/u,vX=it(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",eX?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),CN=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,xX=it(CN,"u").replace(/punct/g,Ih).getRegex(),bX=it(CN,"u").replace(/punct/g,IN).getRegex(),kN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",SX=it(kN,"gu").replace(/notPunctSpace/g,SN).replace(/punctSpace/g,AS).replace(/punct/g,Ih).getRegex(),IX=it(kN,"gu").replace(/notPunctSpace/g,wX).replace(/punctSpace/g,yX).replace(/punct/g,IN).getRegex(),CX=it("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,SN).replace(/punctSpace/g,AS).replace(/punct/g,Ih).getRegex(),kX=it(/\\(punct)/,"gu").replace(/punct/g,Ih).getRegex(),TX=it(/^<(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(),LX=it(LS).replace("(?:-->|$)","-->").getRegex(),EX=it("^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",LX).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,AX=it(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",vh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),TN=it(/^!?\[(label)\]\[(ref)\]/).replace("label",vh).replace("ref",TS).getRegex(),LN=it(/^!?\[(ref)\](?:\[\])?/).replace("ref",TS).getRegex(),MX=it("reflink|nolink(?!\\()","g").replace("reflink",TN).replace("nolink",LN).getRegex(),fN=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,MS={_backpedal:_d,anyPunctuation:kX,autolink:TX,blockSkip:vX,br:bN,code:mX,del:_d,emStrongLDelim:xX,emStrongRDelimAst:SX,emStrongRDelimUnd:CX,escape:pX,link:AX,nolink:LN,punctuation:gX,reflink:TN,reflinkSearch:MX,tag:EX,text:hX,url:_d},RX={...MS,link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",vh).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vh).getRegex()},xS={...MS,emStrongRDelimAst:IX,emStrongLDelim:bX,url:it(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",fN).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:it(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",fN).getRegex()},DX={...xS,br:it(bN).replace("{2,}","*").getRegex(),text:it(xS.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},yh={normal:ES,gfm:dX,pedantic:fX},Md={normal:MS,gfm:xS,breaks:DX,pedantic:RX},_X={"&":"&","<":"<",">":">",'"':""","'":"'"},pN=e=>_X[e];xh=class{constructor(e){K(this,"options");K(this,"rules");K(this,"lexer");this.options=e||xs}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:Rd(a,`
|
|
58
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let a=t[0],n=OX(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=Rd(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:Rd(t[0],`
|
|
59
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let a=Rd(t[0],`
|
|
60
60
|
`).split(`
|
|
61
61
|
`),n="",r="",o=[];for(;a.length>0;){let i=!1,s=[],l;for(l=0;l<a.length;l++)if(this.rules.other.blockquoteStart.test(a[l]))s.push(a[l]),i=!0;else if(!i)s.push(a[l]);else break;a=a.slice(l);let u=s.join(`
|
|
62
62
|
`),c=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -74,10 +74,10 @@ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
74
74
|
`,1)[0],E;if(p=S,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),E=p):E=p.replace(this.rules.other.tabCharGlobal," "),y.test(p)||w.test(p)||g.test(p)||v.test(p)||I.test(p))break;if(E.search(this.rules.other.nonSpaceChar)>=h||!p.trim())c+=`
|
|
75
75
|
`+E.slice(h);else{if(m||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(d)||w.test(d)||I.test(d))break;c+=`
|
|
76
76
|
`+p}!m&&!p.trim()&&(m=!0),u+=S+`
|
|
77
|
-
`,e=e.substring(S.length+1),d=E.slice(h)}}r.loose||(i?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!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 s=r.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.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(l.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};l.checked=c.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!r.loose){let u=l.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 l of r.items){l.loose=!0;for(let u of l.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=
|
|
78
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(a.length===n.length){for(let i of n)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<a.length;i++)o.header.push({text:a[i],tokens:this.lexer.inline(a[i]),header:!0,align:o.align[i]});for(let i of r)o.rows.push(
|
|
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(
|
|
77
|
+
`,e=e.substring(S.length+1),d=E.slice(h)}}r.loose||(i?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!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 s=r.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.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(l.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};l.checked=c.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!r.loose){let u=l.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 l of r.items){l.loose=!0;for(let u of l.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=hN(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 i of n)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<a.length;i++)o.header.push({text:a[i],tokens:this.lexer.inline(a[i]),header:!0,align:o.align[i]});for(let i of r)o.rows.push(hN(i,o.header.length).map((s,l)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:o.align[l]})));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=Rd(a.slice(0,-1),"\\");if((a.length-o.length)%2===0)return}else{let o=PX(t[2],"()");if(o===-2)return;if(o>-1){let i=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,i).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)),gN(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 gN(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,i,s=r,l=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(i=[...o].length,n[3]||n[4]){s+=i;continue}else if((n[5]||n[6])&&r%3&&!((r+i)%3)){l+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+l);let c=[...n[0]][0].length,d=e.slice(0,r+n.index+c+i);if(Math.min(r,i)%2){let m=d.slice(1,-1);return{type:"em",raw:d,text:m,tokens:this.lexer.inlineTokens(m)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}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}}}},Sn=class bS{constructor(t){K(this,"tokens");K(this,"options");K(this,"state");K(this,"inlineQueue");K(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||xs,this.options.tokenizer=this.options.tokenizer||new xh,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:Fa,block:yh.normal,inline:Md.normal};this.options.pedantic?(a.block=yh.pedantic,a.inline=Md.pedantic):this.options.gfm&&(a.block=yh.gfm,this.options.breaks?a.inline=Md.breaks:a.inline=Md.gfm),this.tokenizer.rules=a}static get rules(){return{block:yh,inline:Md}}static lex(t,a){return new bS(a).lex(t)}static lexInline(t,a){return new bS(a).inlineTokens(t)}lex(t){t=t.replace(Fa.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(Fa.tabCharGlobal," ").replace(Fa.spaceLine,""));t;){let r;if(this.options.extensions?.block?.some(i=>(r=i.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 i=a.at(-1);r.raw.length===1&&i!==void 0?i.raw+=`
|
|
81
81
|
`:a.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);let i=a.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
82
82
|
`)?"":`
|
|
83
83
|
`)+r.raw,i.text+=`
|
|
@@ -90,9 +90,9 @@ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
90
90
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.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 i=a.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
91
91
|
`)?"":`
|
|
92
92
|
`)+r.raw,i.text+=`
|
|
93
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(r);continue}if(t){let i="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}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 l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)l.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 i=!1,s="";for(;t;){i||(s=""),i=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},t,a))?(t=t.substring(l.raw.length),a.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let c=a.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):a.push(l);continue}if(l=this.tokenizer.emStrong(t,n,s)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),a.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),a.push(l);continue}let u=t;if(this.options.extensions?.startInline){let c=1/0,d=t.slice(1),p;this.options.extensions.startInline.forEach(m=>{p=m.call({lexer:this},d),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(u=t.substring(0,c+1))}if(l=this.tokenizer.inlineText(u)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(s=l.raw.slice(-1)),i=!0;let c=a.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):a.push(l);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}},
|
|
94
|
-
`;return n?'<pre><code class="language-'+
|
|
95
|
-
`:"<pre><code>"+(a?r:
|
|
93
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(r);continue}if(t){let i="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}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 l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)l.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 i=!1,s="";for(;t;){i||(s=""),i=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},t,a))?(t=t.substring(l.raw.length),a.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let c=a.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):a.push(l);continue}if(l=this.tokenizer.emStrong(t,n,s)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),a.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),a.push(l);continue}let u=t;if(this.options.extensions?.startInline){let c=1/0,d=t.slice(1),p;this.options.extensions.startInline.forEach(m=>{p=m.call({lexer:this},d),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(u=t.substring(0,c+1))}if(l=this.tokenizer.inlineText(u)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(s=l.raw.slice(-1)),i=!0;let c=a.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):a.push(l);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}},bh=class{constructor(e){K(this,"options");K(this,"parser");this.options=e||xs}space(e){return""}code({text:e,lang:t,escaped:a}){let n=(t||"").match(Fa.notSpaceStart)?.[0],r=e.replace(Fa.endingNewline,"")+`
|
|
94
|
+
`;return n?'<pre><code class="language-'+ro(n)+'">'+(a?r:ro(r,!0))+`</code></pre>
|
|
95
|
+
`:"<pre><code>"+(a?r:ro(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}>
|
|
@@ -108,41 +108,41 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
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]),[l,u]=(0,or.useState)(s);return(0,or.useEffect)(()=>{if(!i){u(s);return}let c=i.highlight({code:e,language:t,themes:o},d=>{u(d)});if(c){u(c);return}u(s)},[e,t,o,i,s]),(0,nn.jsx)(MS.Provider,{value:{code:e},children:(0,nn.jsxs)(UX,{language:t,children:[(0,nn.jsx)(BX,{language:t,children:n}),(0,nn.jsx)(NX,{className:a,language:t,result:l,...r})]})})}});var MN={};of(MN,{Mermaid:()=>RS});var RN=L(()=>{"use strict";"use client";Sh()});function jX(e={}){let{immediate:t=!1,debounceDelay:a=FX,rootMargin:n=qX,idleTimeout:r=HX}=e,[o,i]=(0,N.useState)(!1),s=(0,N.useRef)(null),l=(0,N.useRef)(null),u=(0,N.useRef)(null),c=(0,N.useMemo)(()=>m=>{let h=Date.now();return window.setTimeout(()=>{m({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-h))})},1)},[]),d=(0,N.useMemo)(()=>typeof window<"u"&&window.requestIdleCallback?(m,h)=>window.requestIdleCallback(m,h):c,[c]),p=(0,N.useMemo)(()=>typeof window<"u"&&window.cancelIdleCallback?m=>window.cancelIdleCallback(m):m=>{clearTimeout(m)},[]);return(0,N.useEffect)(()=>{if(t){i(!0);return}let m=s.current;if(!m)return;l.current&&(clearTimeout(l.current),l.current=null),u.current&&(p(u.current),u.current=null);let h=()=>{l.current&&(clearTimeout(l.current),l.current=null),u.current&&(p(u.current),u.current=null)},v=g=>{u.current=d(S=>{S.timeRemaining()>0||S.didTimeout?(i(!0),g.disconnect()):u.current=d(()=>{i(!0),g.disconnect()},{timeout:r/2})},{timeout:r})},I=g=>{h(),l.current=window.setTimeout(()=>{var S,E;let T=g.takeRecords();(T.length===0||(E=(S=T.at(-1))==null?void 0:S.isIntersecting)!=null&&E)&&v(g)},a)},y=(g,S)=>{g.isIntersecting?I(S):h()},w=new IntersectionObserver(g=>{for(let S of g)y(S,w)},{rootMargin:n,threshold:0});return w.observe(m),()=>{l.current&&clearTimeout(l.current),u.current&&p(u.current),w.disconnect()}},[t,a,n,r,p,d]),{shouldRender:o,containerRef:s}}function Th(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 $t(e,t){return e.className===t.className&&Th(e.node,t.node)}var N,M,FX,qX,HX,US,BS,kh,VX,$X,WX,zN,DN,GX,XX,Ie,tu,MS,FN,_N,PN,KX,ON,YX,ZX,Pd,JX,QX,eK,OS,qN,AN,zS,tK,aK,Od,nK,rK,oK,HN,jN,iK,DS,sK,lK,uK,cK,dK,fK,pK,NS,Ih,FS,VN,$N,WN,GN,mK,XN,KN,YN,ZN,JN,QN,eU,tU,aU,nU,rU,oU,iU,sU,lU,uU,cU,hK,dU,fU,pU,gK,NN,UN,Ch,yK,BN,mU,wK,vK,xK,bK,SK,IK,CK,_S,kK,PS,hU,gU,yU,TK,LK,EK,AK,Fa,qS,MK,au,RK,RS,Sh=L(()=>{"use strict";"use client";N=j(Ee(),1);XM();YM();hR();XD();l_();M=j(he(),1);Qw();tv();eP();LP();PO();lN();TN();FX=300,qX="300px",HX=500;US=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),BS=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),kh=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),VX=e=>(0,M.jsxs)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[(0,M.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),$X=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),WX=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),zN=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),DN=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),GX=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),XX=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),Ie=(...e)=>ev(Kp(e)),tu=(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)},MS=(0,N.createContext)({code:""}),FN=()=>(0,N.useContext)(MS),_N=({onCopy:e,onError:t,timeout:a=2e3,children:n,className:r,code:o,...i})=>{let[s,l]=(0,N.useState)(!1),u=(0,N.useRef)(0),{code:c}=FN(),{isAnimating:d}=(0,N.useContext)(Fa),p=o??c,m=async()=>{var v;if(typeof window>"u"||!((v=navigator?.clipboard)!=null&&v.writeText)){t?.(new Error("Clipboard API not available"));return}try{s||(await navigator.clipboard.writeText(p),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),a))}catch(I){t?.(I)}};(0,N.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let h=s?US:BS;return(0,M.jsx)("button",{className:Ie("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:m,title:"Copy Code",type:"button",...i,children:n??(0,M.jsx)(h,{size:14})})},PN={"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"},KX=({onDownload:e,onError:t,language:a,children:n,className:r,code:o,...i})=>{let{code:s}=FN(),{isAnimating:l}=(0,N.useContext)(Fa),u=o??s,c=`file.${a&&a in PN?PN[a]:"txt"}`,d="text/plain",p=()=>{try{tu(c,u,d),e?.()}catch(m){t?.(m)}};return(0,M.jsx)("button",{className:Ie("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:l,onClick:p,title:"Download file",type:"button",...i,children:n??(0,M.jsx)(kh,{size:14})})},ON=()=>(0,M.jsxs)("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[(0,M.jsx)("div",{className:"h-[46px] w-full bg-muted/80"}),(0,M.jsx)("div",{className:"flex w-full items-center justify-center p-4",children:(0,M.jsx)(VX,{className:"size-4 animate-spin"})})]}),YX=/\.[^/.]+$/,ZX=({node:e,className:t,src:a,alt:n,...r})=>{let o=async()=>{if(a)try{let i=await(await fetch(a)).blob(),s=new URL(a,window.location.origin).pathname.split("/").pop()||"",l=s.split(".").pop(),u=s.includes(".")&&l!==void 0&&l.length<=4,c="";if(u)c=s;else{let d=i.type,p="png";d.includes("jpeg")||d.includes("jpg")?p="jpg":d.includes("png")?p="png":d.includes("svg")?p="svg":d.includes("gif")?p="gif":d.includes("webp")&&(p="webp"),c=`${(n||s||"image").replace(YX,"")}.${p}`}tu(c,i,i.type)}catch{window.open(a,"_blank")}};return a?(0,M.jsxs)("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[(0,M.jsx)("img",{alt:n,className:Ie("max-w-full rounded-lg",t),"data-streamdown":"image",src:a,...r}),(0,M.jsx)("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),(0,M.jsx)("button",{className:Ie("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,M.jsx)(kh,{size:14})})]}):null},Pd=0,JX=()=>{Pd+=1,Pd===1&&(document.body.style.overflow="hidden")},QX=()=>{Pd=Math.max(0,Pd-1),Pd===0&&(document.body.style.overflow="")},eK=({url:e,isOpen:t,onClose:a,onConfirm:n})=>{let[r,o]=(0,N.useState)(!1),i=(0,N.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[e]),s=(0,N.useCallback)(()=>{n(),a()},[n,a]);return(0,N.useEffect)(()=>{if(t){JX();let l=u=>{u.key==="Escape"&&a()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l),QX()}}},[t,a]),t?(0,M.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:l=>{l.key==="Escape"&&a()},role:"button",tabIndex:0,children:(0,M.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:l=>l.stopPropagation(),onKeyDown:l=>l.stopPropagation(),role:"presentation",children:[(0,M.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,M.jsx)(zN,{size:16})}),(0,M.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,M.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[(0,M.jsx)(DN,{size:20}),(0,M.jsx)("span",{children:"Open external link?"})]}),(0,M.jsx)("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),(0,M.jsx)("div",{className:Ie("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),(0,M.jsxs)("div",{className:"flex gap-2",children:[(0,M.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,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(US,{size:14}),(0,M.jsx)("span",{children:"Copied"})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(BS,{size:14}),(0,M.jsx)("span",{children:"Copy link"})]})}),(0,M.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:s,type:"button",children:[(0,M.jsx)(DN,{size:14}),(0,M.jsx)("span",{children:"Open link"})]})]})]})}):null},OS=(0,N.createContext)(null),qN=()=>(0,N.useContext)(OS),AN=()=>{var e;let t=qN();return(e=t?.code)!=null?e:null},zS=()=>{var e;let t=qN();return(e=t?.mermaid)!=null?e:null},tK=(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))),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{let l=document.createElement("canvas"),u=s.width*n,c=s.height*n;l.width=u,l.height=c;let d=l.getContext("2d");if(!d){o(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(s,0,0,u,c),l.toBlob(p=>{if(!p){o(new Error("Failed to create PNG blob"));return}r(p)},"image/png")},s.onerror=()=>o(new Error("Failed to load SVG image")),s.src=i})},aK=({chart:e,children:t,className:a,onDownload:n,config:r,onError:o})=>{let[i,s]=(0,N.useState)(!1),l=(0,N.useRef)(null),{isAnimating:u}=(0,N.useContext)(Fa),c=zS(),d=async p=>{try{if(p==="mmd"){tu("diagram.mmd",e,"text/plain"),s(!1),n?.(p);return}if(!c){o?.(new Error("Mermaid plugin not available"));return}let m=c.getMermaid(r),h=e.split("").reduce((y,w)=>(y<<5)-y+w.charCodeAt(0)|0,0),v=`mermaid-${Math.abs(h)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:I}=await m.render(v,e);if(!I){o?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(p==="svg"){tu("diagram.svg",I,"image/svg+xml"),s(!1),n?.(p);return}if(p==="png"){let y=await tK(I);tu("diagram.png",y,"image/png"),n?.(p),s(!1);return}}catch(m){o?.(m)}};return(0,N.useEffect)(()=>{let p=m=>{let h=m.composedPath();l.current&&!h.includes(l.current)&&s(!1)};return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[]),(0,M.jsxs)("div",{className:"relative",ref:l,children:[(0,M.jsx)("button",{className:Ie("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:u,onClick:()=>s(!i),title:"Download diagram",type:"button",children:t??(0,M.jsx)(kh,{size:14})}),i?(0,M.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,M.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,M.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,M.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]})},Od=0,nK=()=>{Od+=1,Od===1&&(document.body.style.overflow="hidden")},rK=()=>{Od=Math.max(0,Od-1),Od===0&&(document.body.style.overflow="")},oK=({chart:e,config:t,onFullscreen:a,onExit:n,className:r,...o})=>{let[i,s]=(0,N.useState)(!1),{isAnimating:l,controls:u}=(0,N.useContext)(Fa),c=(()=>{if(typeof u=="boolean")return u;let p=u.mermaid;return p===!1?!1:p===!0||p===void 0?!0:p.panZoom!==!1})(),d=()=>{s(!i)};return(0,N.useEffect)(()=>{if(i){nK();let p=m=>{m.key==="Escape"&&s(!1)};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p),rK()}}},[i]),(0,N.useEffect)(()=>{i?a?.():n&&n()},[i,a,n]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("button",{className:Ie("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:l,onClick:d,title:"View fullscreen",type:"button",...o,children:(0,M.jsx)($X,{size:14})}),i?(0,M.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:d,onKeyDown:p=>{p.key==="Escape"&&d()},role:"button",tabIndex:0,children:[(0,M.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,M.jsx)(zN,{size:20})}),(0,M.jsx)("div",{className:"flex size-full items-center justify-center p-4",onClick:p=>p.stopPropagation(),onKeyDown:p=>p.stopPropagation(),role:"presentation",children:(0,M.jsx)(RS,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:c})})]}):null]})},HN=e=>{var t,a;let n=[],r=[],o=e.querySelectorAll("thead th");for(let s of o)n.push(((t=s.textContent)==null?void 0:t.trim())||"");let i=e.querySelectorAll("tbody tr");for(let s of i){let l=[],u=s.querySelectorAll("td");for(let c of u)l.push(((a=c.textContent)==null?void 0:a.trim())||"");r.push(l)}return{headers:n,rows:r}},jN=e=>{let{headers:t,rows:a}=e,n=s=>{let l=!1,u=!1;for(let c of s){if(c==='"'){l=!0,u=!0;break}(c===","||c===`
|
|
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>${ro(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=mN(e);if(r===null)return n;e=r;let o='<a href="'+e+'"';return t&&(o+=' title="'+ro(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=mN(e);if(r===null)return ro(a);e=r;let o=`<img src="${e}" alt="${a}"`;return t&&(o+=` title="${ro(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ro(e.text)}},RS=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}},nr=class SS{constructor(t){K(this,"options");K(this,"renderer");K(this,"textRenderer");this.options=t||xs,this.options.renderer=this.options.renderer||new bh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new RS}static parse(t,a){return new SS(a).parse(t)}static parseInline(t,a){return new SS(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 i=r,s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){a+=s||"";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 i='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}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 s=this.options.extensions.renderers[o.type].call({parser:this},o);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=s||"";continue}}let i=o;switch(i.type){case"escape":{n+=a.text(i);break}case"html":{n+=a.html(i);break}case"link":{n+=a.link(i);break}case"image":{n+=a.image(i);break}case"checkbox":{n+=a.checkbox(i);break}case"strong":{n+=a.strong(i);break}case"em":{n+=a.em(i);break}case"codespan":{n+=a.codespan(i);break}case"br":{n+=a.br(i);break}case"del":{n+=a.del(i);break}case"text":{n+=a.text(i);break}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}},Dd=(wh=class{constructor(e){K(this,"options");K(this,"block");this.options=e||xs}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Sn.lex:Sn.lexInline}provideParser(){return this.block?nr.parse:nr.parseInline}},K(wh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),K(wh,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),wh),NX=class{constructor(...e){K(this,"defaults",IS());K(this,"options",this.setOptions);K(this,"parse",this.parseMarkdown(!0));K(this,"parseInline",this.parseMarkdown(!1));K(this,"Parser",nr);K(this,"Renderer",bh);K(this,"TextRenderer",RS);K(this,"Lexer",Sn);K(this,"Tokenizer",xh);K(this,"Hooks",Dd);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 i of o)a=a.concat(this.walkTokens(i.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 i=r[o].flat(1/0);a=a.concat(this.walkTokens(i,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(...i){let s=r.renderer.apply(this,i);return s===!1&&(s=o.apply(this,i)),s}: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 bh(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 i=o,s=a.renderer[i],l=r[i];r[i]=(...u)=>{let c=s.apply(r,u);return c===!1&&(c=l.apply(r,u)),c||""}}n.renderer=r}if(a.tokenizer){let r=this.defaults.tokenizer||new xh(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 i=o,s=a.tokenizer[i],l=r[i];r[i]=(...u)=>{let c=s.apply(r,u);return c===!1&&(c=l.apply(r,u)),c}}n.tokenizer=r}if(a.hooks){let r=this.defaults.hooks||new Dd;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 i=o,s=a.hooks[i],l=r[i];Dd.passThroughHooks.has(o)?r[i]=u=>{if(this.defaults.async&&Dd.passThroughHooksRespectAsync.has(o))return(async()=>{let d=await s.call(r,u);return l.call(r,d)})();let c=s.call(r,u);return l.call(r,c)}:r[i]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await s.apply(r,u);return d===!1&&(d=await l.apply(r,u)),d})();let c=s.apply(r,u);return c===!1&&(c=l.apply(r,u)),c}}n.hooks=r}if(a.walkTokens){let r=this.defaults.walkTokens,o=a.walkTokens;n.walkTokens=function(i){let s=[];return s.push(o.call(this,i)),r&&(s=s.concat(r.call(this,i))),s}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Sn.lex(e,t??this.defaults)}parser(e,t){return nr.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 i=r.hooks?await r.hooks.preprocess(t):t,s=await(r.hooks?await r.hooks.provideLexer():e?Sn.lex:Sn.lexInline)(i,r),l=r.hooks?await r.hooks.processAllTokens(s):s;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let u=await(r.hooks?await r.hooks.provideParser():e?nr.parse:nr.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(u):u})().catch(o);try{r.hooks&&(t=r.hooks.preprocess(t));let i=(r.hooks?r.hooks.provideLexer():e?Sn.lex:Sn.lexInline)(t,r);r.hooks&&(i=r.hooks.processAllTokens(i)),r.walkTokens&&this.walkTokens(i,r.walkTokens);let s=(r.hooks?r.hooks.provideParser():e?nr.parse:nr.parseInline)(i,r);return r.hooks&&(s=r.hooks.postprocess(s)),s}catch(i){return o(i)}}}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>"+ro(a.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(a);throw a}}},vs=new NX;wt.options=wt.setOptions=function(e){return vs.setOptions(e),wt.defaults=vs.defaults,yN(wt.defaults),wt};wt.getDefaults=IS;wt.defaults=xs;wt.use=function(...e){return vs.use(...e),wt.defaults=vs.defaults,yN(wt.defaults),wt};wt.walkTokens=function(e,t){return vs.walkTokens(e,t)};wt.parseInline=vs.parseInline;wt.Parser=nr;wt.parser=nr.parse;wt.Renderer=bh;wt.TextRenderer=RS;wt.Lexer=Sn;wt.lexer=Sn.lex;wt.Tokenizer=xh;wt.Hooks=Dd;wt.parse=wt;Xye=wt.options,Kye=wt.setOptions,Yye=wt.use,Zye=wt.walkTokens,Jye=wt.parseInline,Qye=nr.parse,ewe=Sn.lex});var AN={};lf(AN,{CodeBlock:()=>qX});var rr,an,UX,BX,zX,FX,qX,MN=L(()=>{"use strict";"use client";Ch();rr=j(Ee(),1),an=j(me(),1),UX=Ce("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"),BX=(0,rr.memo)(({children:e,result:t,language:a,className:n,...r})=>{let o=(0,rr.useMemo)(()=>({backgroundColor:t.bg,color:t.fg}),[t.bg,t.fg]);return(0,an.jsx)("pre",{className:Ce(n,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":a,"data-streamdown":"code-block-body",style:o,...r,children:(0,an.jsx)("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:t.tokens.map((i,s)=>(0,an.jsx)("span",{className:UX,children:i.map((l,u)=>(0,an.jsx)("span",{className:"dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!",style:{color:l.color,backgroundColor:l.bgColor,...l.htmlStyle},...l.htmlAttrs,children:l.content},u))},s))})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className),zX=({className:e,language:t,style:a,...n})=>(0,an.jsx)("div",{className:Ce("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}),FX=({language:e,children:t})=>(0,an.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,an.jsx)("span",{className:"ml-1 font-mono lowercase",children:e}),(0,an.jsx)("div",{className:"flex items-center gap-2",children:t})]}),qX=({code:e,language:t,className:a,children:n,...r})=>{let{shikiTheme:o}=(0,rr.useContext)(qa),i=RN(),s=(0,rr.useMemo)(()=>({bg:"transparent",fg:"inherit",tokens:e.split(`
|
|
113
|
+
`).map(c=>[{content:c,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[e]),[l,u]=(0,rr.useState)(s);return(0,rr.useEffect)(()=>{if(!i){u(s);return}let c=i.highlight({code:e,language:t,themes:o},d=>{u(d)});if(c){u(c);return}u(s)},[e,t,o,i,s]),(0,an.jsx)(DS.Provider,{value:{code:e},children:(0,an.jsxs)(zX,{language:t,children:[(0,an.jsx)(FX,{language:t,children:n}),(0,an.jsx)(BX,{className:a,language:t,result:l,...r})]})})}});var DN={};lf(DN,{Mermaid:()=>_S});var _N=L(()=>{"use strict";"use client";Ch()});function $X(e={}){let{immediate:t=!1,debounceDelay:a=HX,rootMargin:n=jX,idleTimeout:r=VX}=e,[o,i]=(0,N.useState)(!1),s=(0,N.useRef)(null),l=(0,N.useRef)(null),u=(0,N.useRef)(null),c=(0,N.useMemo)(()=>m=>{let h=Date.now();return window.setTimeout(()=>{m({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-h))})},1)},[]),d=(0,N.useMemo)(()=>typeof window<"u"&&window.requestIdleCallback?(m,h)=>window.requestIdleCallback(m,h):c,[c]),p=(0,N.useMemo)(()=>typeof window<"u"&&window.cancelIdleCallback?m=>window.cancelIdleCallback(m):m=>{clearTimeout(m)},[]);return(0,N.useEffect)(()=>{if(t){i(!0);return}let m=s.current;if(!m)return;l.current&&(clearTimeout(l.current),l.current=null),u.current&&(p(u.current),u.current=null);let h=()=>{l.current&&(clearTimeout(l.current),l.current=null),u.current&&(p(u.current),u.current=null)},v=g=>{u.current=d(S=>{S.timeRemaining()>0||S.didTimeout?(i(!0),g.disconnect()):u.current=d(()=>{i(!0),g.disconnect()},{timeout:r/2})},{timeout:r})},I=g=>{h(),l.current=window.setTimeout(()=>{var S,E;let T=g.takeRecords();(T.length===0||(E=(S=T.at(-1))==null?void 0:S.isIntersecting)!=null&&E)&&v(g)},a)},y=(g,S)=>{g.isIntersecting?I(S):h()},w=new IntersectionObserver(g=>{for(let S of g)y(S,w)},{rootMargin:n,threshold:0});return w.observe(m),()=>{l.current&&clearTimeout(l.current),u.current&&p(u.current),w.disconnect()}},[t,a,n,r,p,d]),{shouldRender:o,containerRef:s}}function Eh(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 Wt(e,t){return e.className===t.className&&Eh(e.node,t.node)}var N,M,HX,jX,VX,zS,FS,Lh,WX,GX,XX,qN,PN,KX,YX,Ce,tu,DS,HN,ON,NN,ZX,UN,JX,QX,Od,eK,tK,aK,US,jN,RN,qS,nK,rK,Nd,oK,iK,sK,VN,$N,lK,PS,uK,cK,dK,fK,pK,mK,hK,BS,kh,HS,WN,GN,XN,KN,gK,YN,ZN,JN,QN,eU,tU,aU,nU,rU,oU,iU,sU,lU,uU,cU,dU,fU,yK,pU,mU,hU,wK,BN,zN,Th,vK,FN,gU,xK,bK,SK,IK,CK,kK,TK,OS,LK,NS,yU,wU,vU,EK,AK,MK,RK,qa,jS,DK,au,_K,_S,Ch=L(()=>{"use strict";"use client";N=j(Ee(),1);YM();JM();yR();YD();c_();M=j(me(),1);tv();nv();aP();AP();NO();cN();EN();HX=300,jX="300px",VX=500;zS=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),FS=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),Lh=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),WX=e=>(0,M.jsxs)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[(0,M.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,M.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),GX=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),XX=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),qN=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),PN=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),KX=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),YX=e=>(0,M.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,M.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"})}),Ce=(...e)=>av(Zp(e)),tu=(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)},DS=(0,N.createContext)({code:""}),HN=()=>(0,N.useContext)(DS),ON=({onCopy:e,onError:t,timeout:a=2e3,children:n,className:r,code:o,...i})=>{let[s,l]=(0,N.useState)(!1),u=(0,N.useRef)(0),{code:c}=HN(),{isAnimating:d}=(0,N.useContext)(qa),p=o??c,m=async()=>{var v;if(typeof window>"u"||!((v=navigator?.clipboard)!=null&&v.writeText)){t?.(new Error("Clipboard API not available"));return}try{s||(await navigator.clipboard.writeText(p),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),a))}catch(I){t?.(I)}};(0,N.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let h=s?zS:FS;return(0,M.jsx)("button",{className:Ce("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:m,title:"Copy Code",type:"button",...i,children:n??(0,M.jsx)(h,{size:14})})},NN={"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"},ZX=({onDownload:e,onError:t,language:a,children:n,className:r,code:o,...i})=>{let{code:s}=HN(),{isAnimating:l}=(0,N.useContext)(qa),u=o??s,c=`file.${a&&a in NN?NN[a]:"txt"}`,d="text/plain",p=()=>{try{tu(c,u,d),e?.()}catch(m){t?.(m)}};return(0,M.jsx)("button",{className:Ce("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:l,onClick:p,title:"Download file",type:"button",...i,children:n??(0,M.jsx)(Lh,{size:14})})},UN=()=>(0,M.jsxs)("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[(0,M.jsx)("div",{className:"h-[46px] w-full bg-muted/80"}),(0,M.jsx)("div",{className:"flex w-full items-center justify-center p-4",children:(0,M.jsx)(WX,{className:"size-4 animate-spin"})})]}),JX=/\.[^/.]+$/,QX=({node:e,className:t,src:a,alt:n,...r})=>{let o=async()=>{if(a)try{let i=await(await fetch(a)).blob(),s=new URL(a,window.location.origin).pathname.split("/").pop()||"",l=s.split(".").pop(),u=s.includes(".")&&l!==void 0&&l.length<=4,c="";if(u)c=s;else{let d=i.type,p="png";d.includes("jpeg")||d.includes("jpg")?p="jpg":d.includes("png")?p="png":d.includes("svg")?p="svg":d.includes("gif")?p="gif":d.includes("webp")&&(p="webp"),c=`${(n||s||"image").replace(JX,"")}.${p}`}tu(c,i,i.type)}catch{window.open(a,"_blank")}};return a?(0,M.jsxs)("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[(0,M.jsx)("img",{alt:n,className:Ce("max-w-full rounded-lg",t),"data-streamdown":"image",src:a,...r}),(0,M.jsx)("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),(0,M.jsx)("button",{className:Ce("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,M.jsx)(Lh,{size:14})})]}):null},Od=0,eK=()=>{Od+=1,Od===1&&(document.body.style.overflow="hidden")},tK=()=>{Od=Math.max(0,Od-1),Od===0&&(document.body.style.overflow="")},aK=({url:e,isOpen:t,onClose:a,onConfirm:n})=>{let[r,o]=(0,N.useState)(!1),i=(0,N.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[e]),s=(0,N.useCallback)(()=>{n(),a()},[n,a]);return(0,N.useEffect)(()=>{if(t){eK();let l=u=>{u.key==="Escape"&&a()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l),tK()}}},[t,a]),t?(0,M.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:l=>{l.key==="Escape"&&a()},role:"button",tabIndex:0,children:(0,M.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:l=>l.stopPropagation(),onKeyDown:l=>l.stopPropagation(),role:"presentation",children:[(0,M.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,M.jsx)(qN,{size:16})}),(0,M.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,M.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[(0,M.jsx)(PN,{size:20}),(0,M.jsx)("span",{children:"Open external link?"})]}),(0,M.jsx)("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),(0,M.jsx)("div",{className:Ce("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),(0,M.jsxs)("div",{className:"flex gap-2",children:[(0,M.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,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(zS,{size:14}),(0,M.jsx)("span",{children:"Copied"})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(FS,{size:14}),(0,M.jsx)("span",{children:"Copy link"})]})}),(0,M.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:s,type:"button",children:[(0,M.jsx)(PN,{size:14}),(0,M.jsx)("span",{children:"Open link"})]})]})]})}):null},US=(0,N.createContext)(null),jN=()=>(0,N.useContext)(US),RN=()=>{var e;let t=jN();return(e=t?.code)!=null?e:null},qS=()=>{var e;let t=jN();return(e=t?.mermaid)!=null?e:null},nK=(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))),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{let l=document.createElement("canvas"),u=s.width*n,c=s.height*n;l.width=u,l.height=c;let d=l.getContext("2d");if(!d){o(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(s,0,0,u,c),l.toBlob(p=>{if(!p){o(new Error("Failed to create PNG blob"));return}r(p)},"image/png")},s.onerror=()=>o(new Error("Failed to load SVG image")),s.src=i})},rK=({chart:e,children:t,className:a,onDownload:n,config:r,onError:o})=>{let[i,s]=(0,N.useState)(!1),l=(0,N.useRef)(null),{isAnimating:u}=(0,N.useContext)(qa),c=qS(),d=async p=>{try{if(p==="mmd"){tu("diagram.mmd",e,"text/plain"),s(!1),n?.(p);return}if(!c){o?.(new Error("Mermaid plugin not available"));return}let m=c.getMermaid(r),h=e.split("").reduce((y,w)=>(y<<5)-y+w.charCodeAt(0)|0,0),v=`mermaid-${Math.abs(h)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:I}=await m.render(v,e);if(!I){o?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(p==="svg"){tu("diagram.svg",I,"image/svg+xml"),s(!1),n?.(p);return}if(p==="png"){let y=await nK(I);tu("diagram.png",y,"image/png"),n?.(p),s(!1);return}}catch(m){o?.(m)}};return(0,N.useEffect)(()=>{let p=m=>{let h=m.composedPath();l.current&&!h.includes(l.current)&&s(!1)};return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[]),(0,M.jsxs)("div",{className:"relative",ref:l,children:[(0,M.jsx)("button",{className:Ce("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:u,onClick:()=>s(!i),title:"Download diagram",type:"button",children:t??(0,M.jsx)(Lh,{size:14})}),i?(0,M.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,M.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,M.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,M.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]})},Nd=0,oK=()=>{Nd+=1,Nd===1&&(document.body.style.overflow="hidden")},iK=()=>{Nd=Math.max(0,Nd-1),Nd===0&&(document.body.style.overflow="")},sK=({chart:e,config:t,onFullscreen:a,onExit:n,className:r,...o})=>{let[i,s]=(0,N.useState)(!1),{isAnimating:l,controls:u}=(0,N.useContext)(qa),c=(()=>{if(typeof u=="boolean")return u;let p=u.mermaid;return p===!1?!1:p===!0||p===void 0?!0:p.panZoom!==!1})(),d=()=>{s(!i)};return(0,N.useEffect)(()=>{if(i){oK();let p=m=>{m.key==="Escape"&&s(!1)};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p),iK()}}},[i]),(0,N.useEffect)(()=>{i?a?.():n&&n()},[i,a,n]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("button",{className:Ce("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:l,onClick:d,title:"View fullscreen",type:"button",...o,children:(0,M.jsx)(GX,{size:14})}),i?(0,M.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:d,onKeyDown:p=>{p.key==="Escape"&&d()},role:"button",tabIndex:0,children:[(0,M.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,M.jsx)(qN,{size:20})}),(0,M.jsx)("div",{className:"flex size-full items-center justify-center p-4",onClick:p=>p.stopPropagation(),onKeyDown:p=>p.stopPropagation(),role:"presentation",children:(0,M.jsx)(_S,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:c})})]}):null]})},VN=e=>{var t,a;let n=[],r=[],o=e.querySelectorAll("thead th");for(let s of o)n.push(((t=s.textContent)==null?void 0:t.trim())||"");let i=e.querySelectorAll("tbody tr");for(let s of i){let l=[],u=s.querySelectorAll("td");for(let c of u)l.push(((a=c.textContent)==null?void 0:a.trim())||"");r.push(l)}return{headers:n,rows:r}},$N=e=>{let{headers:t,rows:a}=e,n=s=>{let l=!1,u=!1;for(let c of s){if(c==='"'){l=!0,u=!0;break}(c===","||c===`
|
|
114
114
|
`)&&(l=!0)}return l?u?`"${s.replace(/"/g,'""')}"`:`"${s}"`:s},r=t.length>0?a.length+1:a.length,o=new Array(r),i=0;t.length>0&&(o[i]=t.map(n).join(","),i+=1);for(let s of a)o[i]=s.map(n).join(","),i+=1;return o.join(`
|
|
115
|
-
`)},
|
|
115
|
+
`)},lK=e=>{let{headers:t,rows:a}=e,n=s=>{let l=!1;for(let c of s)if(c===" "||c===`
|
|
116
116
|
`||c==="\r"){l=!0;break}if(!l)return s;let u=[];for(let c of s)c===" "?u.push("\\t"):c===`
|
|
117
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),i=0;t.length>0&&(o[i]=t.map(n).join(" "),i+=1);for(let s of a)o[i]=s.map(n).join(" "),i+=1;return o.join(`
|
|
118
|
-
`)},
|
|
119
|
-
`)},lK=({children:e,className:t,onCopy:a,onError:n,timeout:r=2e3})=>{let[o,i]=(0,N.useState)(!1),[s,l]=(0,N.useState)(!1),u=(0,N.useRef)(null),c=(0,N.useRef)(0),{isAnimating:d}=(0,N.useContext)(Fa),p=async h=>{var v,I;if(typeof window>"u"||!((v=navigator?.clipboard)!=null&&v.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=HN(w),S=h==="csv"?jN(g):iK(g),E=new ClipboardItem({"text/plain":new Blob([S],{type:"text/plain"}),"text/html":new Blob([w.outerHTML],{type:"text/html"})});await navigator.clipboard.write([E]),l(!0),i(!1),a?.(h),c.current=window.setTimeout(()=>l(!1),r)}catch(y){n?.(y)}};(0,N.useEffect)(()=>{let h=v=>{let I=v.composedPath();u.current&&!I.includes(u.current)&&i(!1)};return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h),window.clearTimeout(c.current)}},[]);let m=s?US:BS;return(0,M.jsxs)("div",{className:"relative",ref:u,children:[(0,M.jsx)("button",{className:Ie("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,M.jsx)(m,{size:14})}),o?(0,M.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,M.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>p("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),(0,M.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>p("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},uK=({children:e,className:t,onDownload:a,onError:n})=>{let[r,o]=(0,N.useState)(!1),i=(0,N.useRef)(null),{isAnimating:s}=(0,N.useContext)(Fa),l=u=>{var c;try{let d=(c=i.current)==null?void 0:c.closest('[data-streamdown="table-wrapper"]'),p=d?.querySelector("table");if(!p){n?.(new Error("Table not found"));return}let m=HN(p),h=u==="csv"?jN(m):sK(m);tu(`table.${u==="csv"?"csv":"md"}`,h,u==="csv"?"text/csv":"text/markdown"),o(!1),a?.(u)}catch(d){n?.(d)}};return(0,N.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,M.jsxs)("div",{className:"relative",ref:i,children:[(0,M.jsx)("button",{className:Ie("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:s,onClick:()=>o(!r),title:"Download table",type:"button",children:e??(0,M.jsx)(kh,{size:14})}),r?(0,M.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,M.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>l("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),(0,M.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>l("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},cK=({children:e,className:t,showControls:a,...n})=>(0,M.jsxs)("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[a?(0,M.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,M.jsx)(lK,{}),(0,M.jsx)(uK,{})]}):null,(0,M.jsx)("div",{className:"overflow-x-auto",children:(0,M.jsx)("table",{className:Ie("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]}),dK=(0,N.lazy)(()=>Promise.resolve().then(()=>(EN(),LN)).then(e=>({default:e.CodeBlock}))),fK=(0,N.lazy)(()=>Promise.resolve().then(()=>(RN(),MN)).then(e=>({default:e.Mermaid}))),pK=/language-([^\s]+)/;NS=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,Ih=(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},FS=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("ol",{className:Ie("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>$t(e,t));FS.displayName="MarkdownOl";VN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("li",{className:Ie("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&Th(e.node,t.node));VN.displayName="MarkdownLi";$N=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("ul",{className:Ie("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>$t(e,t));$N.displayName="MarkdownUl";WN=(0,N.memo)(({className:e,node:t,...a})=>(0,M.jsx)("hr",{className:Ie("my-6 border-border",e),"data-streamdown":"horizontal-rule",...a}),(e,t)=>$t(e,t));WN.displayName="MarkdownHr";GN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("span",{className:Ie("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>$t(e,t));GN.displayName="MarkdownStrong";mK=({children:e,className:t,href:a,node:n,...r})=>{let{linkSafety:o}=(0,N.useContext)(Fa),[i,s]=(0,N.useState)(!1),l=a==="streamdown:incomplete-link",u=(0,N.useCallback)(async m=>{if(!(!(o!=null&&o.enabled&&a)||l)){if(m.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(a)){window.open(a,"_blank","noreferrer");return}s(!0)}},[o,a,l]),c=(0,N.useCallback)(()=>{a&&window.open(a,"_blank","noreferrer")},[a]),d=(0,N.useCallback)(()=>{s(!1)},[]),p={url:a??"",isOpen:i,onClose:d,onConfirm:c};return o!=null&&o.enabled&&a?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("button",{className:Ie("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",onClick:u,type:"button",children:e}),o.renderModal?o.renderModal(p):(0,M.jsx)(eK,{...p})]}):(0,M.jsx)("a",{className:Ie("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",href:a,rel:"noreferrer",target:"_blank",...r,children:e})},XN=(0,N.memo)(mK,(e,t)=>$t(e,t)&&e.href===t.href);XN.displayName="MarkdownA";KN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h1",{className:Ie("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>$t(e,t));KN.displayName="MarkdownH1";YN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h2",{className:Ie("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>$t(e,t));YN.displayName="MarkdownH2";ZN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h3",{className:Ie("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>$t(e,t));ZN.displayName="MarkdownH3";JN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h4",{className:Ie("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>$t(e,t));JN.displayName="MarkdownH4";QN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h5",{className:Ie("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>$t(e,t));QN.displayName="MarkdownH5";eU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h6",{className:Ie("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>$t(e,t));eU.displayName="MarkdownH6";tU=(0,N.memo)(({children:e,className:t,node:a,...n})=>{let{controls:r}=(0,N.useContext)(Fa),o=NS(r,"table");return(0,M.jsx)(cK,{className:t,showControls:o,...n,children:e})},(e,t)=>$t(e,t));tU.displayName="MarkdownTable";aU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("thead",{className:Ie("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>$t(e,t));aU.displayName="MarkdownThead";nU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("tbody",{className:Ie("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>$t(e,t));nU.displayName="MarkdownTbody";rU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("tr",{className:Ie("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>$t(e,t));rU.displayName="MarkdownTr";oU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("th",{className:Ie("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e}),(e,t)=>$t(e,t));oU.displayName="MarkdownTh";iU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("td",{className:Ie("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>$t(e,t));iU.displayName="MarkdownTd";sU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("blockquote",{className:Ie("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e}),(e,t)=>$t(e,t));sU.displayName="MarkdownBlockquote";lU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("sup",{className:Ie("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>$t(e,t));lU.displayName="MarkdownSup";uU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("sub",{className:Ie("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>$t(e,t));uU.displayName="MarkdownSub";cU=(0,N.memo)(({children:e,className:t,node:a,...n})=>{if("data-footnotes"in n){let r=i=>{var s,l;if(!(0,N.isValidElement)(i))return!1;let u=Array.isArray(i.props.children)?i.props.children:[i.props.children],c=!1,d=!1;for(let p of u)if(p){if(typeof p=="string")p.trim()!==""&&(c=!0);else if((0,N.isValidElement)(p))if(((s=p.props)==null?void 0:s["data-footnote-backref"])!==void 0)d=!0;else{let m=Array.isArray(p.props.children)?p.props.children:[p.props.children];for(let h of m){if(typeof h=="string"&&h.trim()!==""){c=!0;break}if((0,N.isValidElement)(h)&&((l=h.props)==null?void 0:l["data-footnote-backref"])===void 0){c=!0;break}}}}return d&&!c},o=Array.isArray(e)?e.map(i=>{if(!(0,N.isValidElement)(i))return i;if(i.type===FS){let s=(Array.isArray(i.props.children)?i.props.children:[i.props.children]).filter(l=>!r(l));return s.length===0?null:{...i,props:{...i.props,children:s}}}return i}):e;return(Array.isArray(o)?o.some(i=>i!==null):o!==null)?(0,M.jsx)("section",{className:t,...n,children:o}):null}return(0,M.jsx)("section",{className:t,...n,children:e})},(e,t)=>$t(e,t));cU.displayName="MarkdownSection";hK=({node:e,className:t,children:a,...n})=>{var r,o,i;let s=((r=e?.position)==null?void 0:r.start.line)===((o=e?.position)==null?void 0:o.end.line),{mermaid:l,controls:u}=(0,N.useContext)(Fa),c=zS();if(s)return(0,M.jsx)("code",{className:Ie("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(pK),p=(i=d?.at(1))!=null?i:"",m="";if((0,N.isValidElement)(a)&&a.props&&typeof a.props=="object"&&"children"in a.props&&typeof a.props.children=="string"?m=a.props.children:typeof a=="string"&&(m=a),p==="mermaid"&&c){let v=NS(u,"mermaid"),I=Ih(u,"download"),y=Ih(u,"copy"),w=Ih(u,"fullscreen"),g=Ih(u,"panZoom"),S=v&&(I||y||w);return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(ON,{}),children:(0,M.jsxs)("div",{className:Ie("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[S?(0,M.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[I?(0,M.jsx)(aK,{chart:m,config:l?.config}):null,y?(0,M.jsx)(_N,{code:m}):null,w?(0,M.jsx)(oK,{chart:m,config:l?.config}):null]}):null,(0,M.jsx)(fK,{chart:m,config:l?.config,showControls:g})]})})}let h=NS(u,"code");return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(ON,{}),children:(0,M.jsx)(dK,{className:Ie("overflow-x-auto border-border border-t",t),code:m,language:p,children:h?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(KX,{code:m,language:p}),(0,M.jsx)(_N,{})]}):null})})},dU=(0,N.memo)(hK,(e,t)=>e.className===t.className&&Th(e.node,t.node));dU.displayName="MarkdownCode";fU=(0,N.memo)(ZX,(e,t)=>e.className===t.className&&Th(e.node,t.node));fU.displayName="MarkdownImg";pU=(0,N.memo)(({children:e,className:t,node:a,...n})=>{var r,o;let i=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");if(i.length===1&&(0,N.isValidElement)(i[0])){let s=i[0].props.node,l=s?.tagName;if(l==="img")return(0,M.jsx)(M.Fragment,{children:e});if(l==="code"&&((r=s?.position)==null?void 0:r.start.line)!==((o=s?.position)==null?void 0:o.end.line))return(0,M.jsx)(M.Fragment,{children:e})}return(0,M.jsx)("p",{className:t,...n,children:e})},(e,t)=>$t(e,t));pU.displayName="MarkdownParagraph";gK={ol:FS,li:VN,ul:$N,hr:WN,strong:GN,a:XN,h1:KN,h2:YN,h3:ZN,h4:JN,h5:QN,h6:eU,table:tU,thead:aU,tbody:nU,tr:rU,th:oU,td:iU,blockquote:sU,code:dU,img:fU,pre:({children:e})=>e,sup:lU,sub:uU,p:pU,section:cU},NN=[],UN={allowDangerousHtml:!0},Ch=new WeakMap,yK=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 p=0;p<c.length;p+=1){let m=c[p];if(p>0&&(d+=","),Array.isArray(m)){let[h,v]=m;if(typeof h=="function"){let I=Ch.get(h);I||(I=h.name,Ch.set(h,I)),d+=I}else d+=String(h);d+=":",d+=JSON.stringify(v)}else if(typeof m=="function"){let h=Ch.get(m);h||(h=m.name,Ch.set(m,h)),d+=h}else d+=String(m)}return d},i=o(a),s=o(n),l=r?JSON.stringify(r):"",u=`${s}::${i}::${l}`;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()}},BN=new yK,mU=e=>{let t=wK(e),a=e.children||"";return xK(t.runSync(t.parse(a),a),e)},wK=e=>{let t=BN.get(e);if(t)return t;let a=vK(e);return BN.set(e,a),a},vK=e=>{let t=e.rehypePlugins||NN,a=e.remarkPlugins||NN,n=e.remarkRehypeOptions?{...UN,...e.remarkRehypeOptions}:UN;return yS().use(sh).use(a).use(dh,n).use(t)},xK=(e,t)=>Yb(e,{Fragment:M.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:M.jsx,jsxs:M.jsxs,passKeys:!0,passNode:!0}),bK=/\[\^[^\]\s]{1,200}\](?!:)/,SK=/\[\^[^\]\s]{1,200}\]:/,IK=/<\/(\w+)>/,CK=/<(\w+)[\s>]/,_S=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]==="$"},PS=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},hU=e=>{let t=bK.test(e),a=SK.test(e);if(t||a)return[e];let n=Sn.lex(e,{gfm:!0}),r=[],o=[];for(let i of n){let s=i.raw,l=r.length;if(o.length>0){if(r[l-1]+=s,i.type==="html"){let u=s.match(IK);if(u){let c=u[1];o.at(-1)===c&&o.pop()}}continue}if(i.type==="html"&&i.block){let u=s.match(CK);if(u){let c=u[1];s.includes(`</${c}>`)||o.push(c)}}if(s.trim()==="$$"&&l>0){let u=r[l-1],c=_S(u),d=PS(u);if(c&&d%2===1){r[l-1]=u+s;continue}}if(l>0&&kK(s)){let u=r[l-1],c=_S(u),d=PS(u),p=PS(s);if(c&&d%2===1&&!_S(s)&&p===1){r[l-1]=u+s;continue}}r.push(s)}return r},gU={raw:KM,sanitize:[Lm,{}],harden:[GM,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},yU={gfm:[Jm,{}]},TK=Object.values(gU),LK=Object.values(yU),EK={block:" \u258B",circle:" \u25CF"},AK={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},Fa=(0,N.createContext)(AK),qS=(0,N.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:a,...n})=>(0,M.jsx)(mU,{...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)});qS.displayName="Block";MK=["github-light","github-dark"],au=(0,N.memo)(({children:e,mode:t="streaming",parseIncompleteMarkdown:a=!0,components:n,rehypePlugins:r=TK,remarkPlugins:o=LK,className:i,shikiTheme:s=MK,mermaid:l,controls:u=!0,isAnimating:c=!1,BlockComponent:d=qS,parseMarkdownIntoBlocksFn:p=hU,caret:m,plugins:h,remend:v,linkSafety:I={enabled:!0},...y})=>{let w=(0,N.useId)(),[g,S]=(0,N.useTransition)(),E=(0,N.useMemo)(()=>typeof e!="string"?"":t==="streaming"&&a?s_(e,v):e,[e,t,a,v]),T=(0,N.useMemo)(()=>p(E),[E,p]),[R,O]=(0,N.useState)(T);(0,N.useEffect)(()=>{t==="streaming"?S(()=>{O(T)}):O(T)},[T,t]);let U=t==="streaming"?R:T,A=(0,N.useMemo)(()=>U.map((B,P)=>`${w}-${P}`),[U.length,w]),Q=(0,N.useMemo)(()=>{var B,P;return{shikiTheme:(P=(B=h?.code)==null?void 0:B.getThemes())!=null?P:s,controls:u,isAnimating:c,mode:t,mermaid:l,linkSafety:I}},[s,u,c,t,l,I,h?.code]),$=(0,N.useMemo)(()=>({...gK,...n}),[n]),q=(0,N.useMemo)(()=>{let B=[];return h!=null&&h.cjk&&(B=[...B,...h.cjk.remarkPluginsBefore]),B=[...B,...o],h!=null&&h.cjk&&(B=[...B,...h.cjk.remarkPluginsAfter]),h!=null&&h.math&&(B=[...B,h.math.remarkPlugin]),B},[o,h?.math,h?.cjk]),Z=(0,N.useMemo)(()=>h!=null&&h.math?[...r,h.math.rehypePlugin]:r,[r,h?.math]),X=(0,N.useMemo)(()=>m&&c?{"--streamdown-caret":`"${EK[m]}"`}:void 0,[m,c]);return t==="static"?(0,M.jsx)(OS.Provider,{value:h??null,children:(0,M.jsx)(Fa.Provider,{value:Q,children:(0,M.jsx)("div",{className:Ie("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",i),children:(0,M.jsx)(mU,{components:$,rehypePlugins:Z,remarkPlugins:q,...y,children:e})})})}):(0,M.jsx)(OS.Provider,{value:h??null,children:(0,M.jsx)(Fa.Provider,{value:Q,children:(0,M.jsxs)("div",{className:Ie("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",m?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,i),style:X,children:[U.length===0&&m&&c&&(0,M.jsx)("span",{}),U.map((B,P)=>(0,M.jsx)(d,{components:$,content:B,index:P,rehypePlugins:Z,remarkPlugins:q,shouldParseIncompleteMarkdown:a,...y},A[P]))]})})})},(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);au.displayName="Streamdown";RK=({children:e,className:t,minZoom:a=.5,maxZoom:n=3,zoomStep:r=.1,showControls:o=!0,initialZoom:i=1,fullscreen:s=!1})=>{let l=(0,N.useRef)(null),u=(0,N.useRef)(null),[c,d]=(0,N.useState)(i),[p,m]=(0,N.useState)({x:0,y:0}),[h,v]=(0,N.useState)(!1),[I,y]=(0,N.useState)({x:0,y:0}),[w,g]=(0,N.useState)({x:0,y:0}),S=(0,N.useCallback)($=>{d(q=>Math.max(a,Math.min(n,q+$)))},[a,n]),E=(0,N.useCallback)(()=>{S(r)},[S,r]),T=(0,N.useCallback)(()=>{S(-r)},[S,r]),R=(0,N.useCallback)(()=>{d(i),m({x:0,y:0})},[i]),O=(0,N.useCallback)($=>{$.preventDefault();let q=$.deltaY>0?-r:r;S(q)},[S,r]),U=(0,N.useCallback)($=>{if($.button!==0||$.isPrimary===!1)return;v(!0),y({x:$.clientX,y:$.clientY}),g(p);let q=$.currentTarget;q instanceof HTMLElement&&q.setPointerCapture($.pointerId)},[p]),A=(0,N.useCallback)($=>{if(!h)return;$.preventDefault();let q=$.clientX-I.x,Z=$.clientY-I.y;m({x:w.x+q,y:w.y+Z})},[h,I,w]),Q=(0,N.useCallback)($=>{v(!1);let q=$.currentTarget;q instanceof HTMLElement&&q.releasePointerCapture($.pointerId)},[]);return(0,N.useEffect)(()=>{let $=l.current;if($)return $.addEventListener("wheel",O,{passive:!1}),()=>{$.removeEventListener("wheel",O)}},[O]),(0,N.useEffect)(()=>{let $=u.current;if($&&h)return document.body.style.userSelect="none",$.addEventListener("pointermove",A,{passive:!1}),$.addEventListener("pointerup",Q),$.addEventListener("pointercancel",Q),()=>{document.body.style.userSelect="",$.removeEventListener("pointermove",A),$.removeEventListener("pointerup",Q),$.removeEventListener("pointercancel",Q)}},[h,A,Q]),(0,M.jsxs)("div",{className:Ie("relative flex flex-col",s?"h-full w-full":"min-h-28 w-full",t),ref:l,style:{cursor:h?"grabbing":"grab"},children:[o?(0,M.jsxs)("div",{className:Ie("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",s?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,M.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:E,title:"Zoom in",type:"button",children:(0,M.jsx)(GX,{size:16})}),(0,M.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:T,title:"Zoom out",type:"button",children:(0,M.jsx)(XX,{size:16})}),(0,M.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:R,title:"Reset zoom and pan",type:"button",children:(0,M.jsx)(WX,{size:16})})]}):null,(0,M.jsx)("div",{className:Ie("flex-1 origin-center transition-transform duration-150 ease-out",s?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:U,ref:u,role:"application",style:{transform:`translate(${p.x}px, ${p.y}px) scale(${c})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},RS=({chart:e,className:t,config:a,fullscreen:n=!1,showControls:r=!0})=>{let[o,i]=(0,N.useState)(null),[s,l]=(0,N.useState)(!1),[u,c]=(0,N.useState)(""),[d,p]=(0,N.useState)(""),[m,h]=(0,N.useState)(0),{mermaid:v}=(0,N.useContext)(Fa),I=zS(),y=v?.errorComponent,{shouldRender:w,containerRef:g}=jX({immediate:n});if((0,N.useEffect)(()=>{if(w){if(!I){i("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{i(null),l(!0);let E=I.getMermaid(a),T=e.split("").reduce((U,A)=>(U<<5)-U+A.charCodeAt(0)|0,0),R=`mermaid-${Math.abs(T)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:O}=await E.render(R,e);c(O),p(O)}catch(E){if(!(d||u)){let T=E instanceof Error?E.message:"Failed to render Mermaid chart";i(T)}}finally{l(!1)}})()}},[e,a,m,w,I]),!(w||u||d))return(0,M.jsx)("div",{className:Ie("my-4 min-h-[200px]",t),ref:g});if(s&&!u&&!d)return(0,M.jsx)("div",{className:Ie("my-4 flex justify-center p-4",t),ref:g,children:(0,M.jsxs)("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[(0,M.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),(0,M.jsx)("span",{className:"text-sm",children:"Loading diagram..."})]})});if(o&&!u&&!d)return y?(0,M.jsx)("div",{ref:g,children:(0,M.jsx)(y,{chart:e,error:o,retry:()=>h(T=>T+1)})}):(0,M.jsxs)("div",{className:Ie("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:g,children:[(0,M.jsxs)("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",o]}),(0,M.jsxs)("details",{className:"mt-2",children:[(0,M.jsx)("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),(0,M.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]});let S=u||d;return(0,M.jsx)("div",{className:Ie("size-full",t),"data-streamdown":"mermaid",ref:g,children:(0,M.jsx)(RK,{className:Ie(n?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:n,maxZoom:3,minZoom:.5,showControls:r,zoomStep:.1,children:(0,M.jsx)("div",{"aria-label":"Mermaid chart",className:Ie("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:S},role:"img"})})})}});var iB=Ia(($ve,oB)=>{"use strict";function sY(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(),s=i-n,l=t-s;l<=0?(n=i,e.apply(this,o)):a=setTimeout(()=>{n=Date.now(),e.apply(this,o)},l)}}oB.exports=sY});var wI=typeof performance>"u"?0:performance.now(),vI=typeof window<"u"&&!!window.WaniWani?.chat;var Cs=j(Ee(),1),Kh=j(zw(),1);var Fw="waniwani/suggestions";function yl(e,t){for(let a of t){let n=e[a];if(typeof n=="string"&&n.length>0)return n}}var pq=["waniwani/sessionId","openai/sessionId","openai/session","sessionId","conversationId","mcp-session-id"],mq=["waniwani/requestId","openai/requestId","requestId","mcp/requestId"],hq=["waniwani/traceId","openai/traceId","traceId","mcp/traceId","openai/requestId","requestId"],gq=["waniwani/userId","openai/userId","externalUserId","userId","actorId"],yq=["waniwani/visitorId","visitorId"],wq=["correlationId","openai/requestId"];function l1(e){return e?yl(e,pq):void 0}function u1(e){return e?yl(e,mq):void 0}function c1(e){return e?yl(e,hq):void 0}function d1(e){return e?yl(e,gq):void 0}function f1(e){return e?yl(e,yq):void 0}function p1(e){return e?yl(e,wq):void 0}var vq=[{key:"openai/sessionId",source:"chatgpt"},{key:"openai/session",source:"chatgpt"}],xq=[{needle:"claude",source:"claude"},{needle:"chatgpt",source:"chatgpt"},{needle:"openai",source:"chatgpt"},{needle:"gemini",source:"gemini"}];function m1(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 vq){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 xq)if(n.includes(r))return o}}var bq="@waniwani/sdk";function h1(e,t={}){let a=t.now??(()=>new Date),n=t.generateId??Sq,r=kq(e),o=Up(e.meta),i=Up(e.metadata),s=Tq(e,o),l=Kn(e.eventId)??n(),u=Lq(e.timestamp,a),c=Kn(e.source)??m1(o)??t.source??bq,d=qw(e)?{...e}:void 0,p={...i};return Object.keys(o).length>0&&(p.meta=o),d&&(p.rawLegacy=d),{id:l,type:"mcp.event",name:r,source:c,timestamp:u,correlation:s,properties:Iq(e,r),metadata:p,rawLegacy:d}}function Sq(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`evt_${crypto.randomUUID()}`:`evt_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function Iq(e,t){if(!qw(e))return Up(e.properties);let a=Cq(e,t),n=Up(e.properties);return{...a,...n}}function Cq(e,t){switch(t){case"tool.called":{let a={};return Kn(e.toolName)&&(a.name=e.toolName),Kn(e.toolType)&&(a.type=e.toolType),a}case"link.clicked":{let a={};return Kn(e.linkUrl)&&(a.url=e.linkUrl),a}default:return{}}}function kq(e){return qw(e)?e.eventType:e.event}function Tq(e,t){let a=Kn(e.requestId)??u1(t),n=Kn(e.sessionId)??l1(t),r=Kn(e.traceId)??c1(t),o=Kn(e.externalUserId)??d1(t),i=Kn(e.visitorId)??f1(t),s=Kn(e.correlationId)??p1(t)??a,l={};return n&&(l.sessionId=n),r&&(l.traceId=r),a&&(l.requestId=a),s&&(l.correlationId=s),o&&(l.externalUserId=o),i&&(l.visitorId=i),l}function Lq(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 Up(e){return!e||typeof e!="object"||Array.isArray(e)?{}:e}function Kn(e){if(typeof e=="string"&&e.trim().length!==0)return e}function qw(e){return"eventType"in e}function g1(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 Eq="/api/mcp/events/v2/batch";var y1="@waniwani/sdk";var Aq=new Set([401,403]),Mq=new Set([408,425,429,500,502,503,504]),Rq=(e,t)=>globalThis.fetch(e,t);function w1(e){return new Hw(e)}var Hw=class{constructor(t){K(this,"endpointUrl");K(this,"flushIntervalMs");K(this,"maxBatchSize");K(this,"maxBufferSize");K(this,"maxRetries");K(this,"retryBaseDelayMs");K(this,"retryMaxDelayMs");K(this,"shutdownTimeoutMs");K(this,"sdkVersion");K(this,"fetchFn");K(this,"logger");K(this,"now");K(this,"sleep");K(this,"apiKey");K(this,"buffer",[]);K(this,"flushTimer");K(this,"flushScheduled",!1);K(this,"flushScheduledTimer");K(this,"flushInFlight");K(this,"inFlightCount",0);K(this,"isStopped",!1);K(this,"isShuttingDown",!1);this.endpointUrl=Pq(t.apiUrl,t.endpointPath??Eq),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??Rq,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":y1};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:Oq(o)}}if(Aq.has(a.status))return{kind:"auth",status:a.status};if(Mq.has(a.status))return{kind:"retryable",reason:`HTTP ${a.status}`};if(!a.ok)return{kind:"permanent",reason:`HTTP ${a.status}`};let n=await _q(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:y1,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 s=n.get(i.eventId);if(s){if(Dq(i)){r.push(s);continue}o.push(s)}}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 Dq(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 _q(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function Pq(e,t){let a=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${a}${n}`}function Oq(e){return e instanceof Error?e.message:String(e)}function v1(e){let{apiUrl:t,endpointPath:a}=Nq(e.endpoint),n=w1({apiUrl:t,apiKey:e.token,endpointPath:a,flushIntervalMs:e.flushIntervalMs}),r,o=s=>typeof s=="function"?s():s,i=async s=>{let l=e.identity?.()??{},u=o(e.channelId),c=u===void 0?s.properties:{channelId:u,...s.properties},d=h1({sessionId:l.sessionId,visitorId:l.visitorId,externalUserId:l.externalUserId??r,traceId:l.traceId,...s,properties:c,metadata:{...e.metadata,...s.metadata}},{source:o(e.source)});return n.enqueue(d),{eventId:d.id}};return{track:Object.assign(i,g1(i)),identify(s,l){return r=s,i({event:"user.identified",externalUserId:s,properties:l})},flush:()=>n.flush(),shutdown:s=>n.shutdown(s)}}function Nq(e){let t=new URL(e);return{apiUrl:t.origin,endpointPath:`${t.pathname}${t.search}`}}function Oa(e,t,a){let[n,r=""]=e.split("?"),o=n.replace(/\/$/,""),i=new URLSearchParams(r);if(a)for(let[l,u]of Object.entries(a))i.set(l,u);let s=i.toString();return`${o}${t}${s?`?${s}`:""}`}var Uq="/api/mcp/";function Bp(e,t){let[a=""]=e.split("?"),n="",r=a;try{let o=new URL(a);n=o.origin,r=o.pathname}catch{if(!a.startsWith("/"))return null}return r.startsWith(Uq)?`${n}${t}`:null}function Bq(){if(typeof window>"u")return!1;try{return window.WANIWANI_DEBUG?!0:!!window.localStorage?.getItem("WANIWANI_DEBUG")}catch{return!1}}function Na(...e){Bq()&&console.log("[Waniwani]",...e)}var jw="waniwani-visitor-id";function zq(){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 fa(){try{let t=localStorage.getItem(jw);if(t)return t}catch{}let e=zq();try{localStorage.setItem(jw,e)}catch{}return e}function wl(e){let t=typeof e=="string"?e.trim():"";if(!t)return fa();try{localStorage.setItem(jw,t)}catch{}return t}function Fq(e){return e!=null&&typeof e.then=="function"}function bc(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 Fq(n)?n.then(r=>{t||wl(r??"")},()=>{}):wl(n??""),a}var qq="waniwani-memory";var yn="threads",zp="by_memoryUserId",Hq="by_updatedAt";var b1="memoryUserId",x1="waniwani-memory-user-id",Vw=null;function $w(){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 jq(e,t){if(t<1&&(e.objectStoreNames.contains("ids")||e.createObjectStore("ids")),t<2&&!e.objectStoreNames.contains(yn)){let a=e.createObjectStore(yn,{keyPath:"threadId"});a.createIndex(zp,"memoryUserId",{unique:!1}),a.createIndex(Hq,"updatedAt",{unique:!1})}}async function Ww(){return new Promise((e,t)=>{let a=indexedDB.open(qq,2);a.onupgradeneeded=n=>{jq(a.result,n.oldVersion)},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)})}async function Vq(){return Ww()}async function $q(e){return new Promise((t,a)=>{let o=e.transaction("ids","readonly").objectStore("ids").get(b1);o.onsuccess=()=>t(typeof o.result=="string"?o.result:null),o.onerror=()=>a(o.error)})}async function Wq(e,t){return new Promise((a,n)=>{let i=e.transaction("ids","readwrite").objectStore("ids").put(t,b1);i.onsuccess=()=>a(),i.onerror=()=>n(i.error)})}async function Gq(){if(typeof indexedDB>"u")return null;try{let e=await Vq();try{let t=await $q(e);if(t)return t;let a=$w();return await Wq(e,a),a}finally{e.close()}}catch{return null}}function Xq(){try{let e=localStorage.getItem(x1);if(e)return e;let t=$w();return localStorage.setItem(x1,t),t}catch{return null}}async function S1(){let e=await Gq();if(e)return e;let t=Xq();return t||(Vw||(Vw=$w()),Vw)}function I1(e,t){return e.match(t)?.[1]??null}function Kq(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=I1(e,n);if(r)return{name:a,version:r}}return null}function Yq(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=I1(e,n);if(r)return{name:a,version:r.replace(/_/g,".")};if(a==="Linux"&&n.test(e))return{name:a,version:""}}return null}function Zq(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 Sc(){let e=navigator.userAgent,t=fa(),a=await S1();return{userAgent:e,browser:Kq(e),os:Yq(e),deviceType:Zq(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 Jq="0.22.0-beta.6",Qq=40,e4=10,t4=6e5;function Xw(){return typeof performance>"u"?0:performance.now()}function Kw(e,t){let a={};return{metrics:a,has:n=>n in a,set(n,r){a[n]=r},mark(n,r=Xw()){if(!(n in a)){a[n]=r-t;try{performance.mark(`waniwani:${e}:${n}`,{startTime:r})}catch{}}}}}function a4(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=Qq)break;if(!Number.isFinite(n))continue;let r=Math.round(n);r<0||r>t4||(t[a]=r)}return t}function n4(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=e4)break;(typeof n=="string"||typeof n=="boolean")&&(t[a]=n)}return t}function r4(){let e=navigator.connection;if(e)return{effectiveType:e.effectiveType,rtt:e.rtt,downlink:e.downlink,saveData:e.saveData}}function qp(e){let t=e?.Authorization;return typeof t=="string"&&t.startsWith("Bearer ")?t.slice(7):void 0}function o4(e,t,a,n){return{kind:e,sdkVersion:Jq,channelId:t.channelId||void 0,sessionId:e==="boot"?void 0:t.sessionId||void 0,visitorId:fa(),pageHost:window.location.hostname,connection:r4(),tags:n4(a),metrics:a4(n)}}var Gw,Fp=[];function Yw(e){let t=String(e?.chatTimingLogs).trim().toLowerCase()==="true";Gw=t;let a=Fp;if(Fp=[],t)for(let n of a)n()}function Hp(e,t,a,n){let{api:r,token:o}=t;if(!(typeof window>"u"||!r||!o||Gw===!1))try{let i=o4(e,t,a,n),s=()=>{Na("timing",i),fetch(Oa(r,"/timing"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify(i),keepalive:!0}).catch(()=>{})};Gw?s():Fp.length<20&&Fp.push(s)}catch{}}var Xr=Kw("boot",0),C1;function Di(e,t){Xr.mark(e,t)}function jp(e){C1??(C1=e)}var i4=/cdn\.jsdelivr\.net\/npm\/@waniwani\/sdk@[^/]+\/dist\/chat\/embed\.js/,s4=/\/embed\.js(\?|$)/;function l4(){if(typeof performance>"u")return;let e=performance.getEntriesByType("navigation")[0];e?.responseStart&&Xr.mark("navTtfb",e.responseStart),e?.domContentLoadedEventEnd&&Xr.mark("navDomContentLoaded",e.domContentLoadedEventEnd);let t=performance.getEntriesByType("resource");for(let a of t)i4.test(a.name)?(Xr.mark("bundleStart",a.startTime),Xr.mark("bundleEnd",a.responseEnd)):s4.test(a.name)&&(Xr.mark("loaderStart",a.startTime),Xr.mark("loaderEnd",a.responseEnd))}function u4(){if(vI)return!0;try{return document.querySelectorAll('script[src*="@waniwani/sdk"]').length>1}catch{return!1}}function k1(e){l4(),Xr.mark("bundleExecuted",wI),Hp("boot",e,{configSource:C1,mode:e.mode,secondSdk:u4()},Xr.metrics)}var c4=[["text-delta","firstText"],["tool-input-start","firstToolInput"],["tool-output-available","firstToolOutput"]];function T1(e){let t=Kw("turn",Xw());t.set("turnIndex",e);let a=!1;return{mark:n=>t.mark(n),instrument(n){if(!n.ok||!n.body||typeof TransformStream>"u")return n;try{let r=new TextDecoder,o=n.body.pipeThrough(new TransformStream({transform(i,s){t.mark("firstChunk");let l=r.decode(i,{stream:!0});for(let[u,c]of c4)!t.has(c)&&l.includes(u)&&t.mark(c);s.enqueue(i)}}));return new Response(o,{status:n.status,statusText:n.statusText,headers:n.headers})}catch{return n}},report(n,r){a||(a=!0,Hp("turn",n,r,t.metrics))}}}function d4(e){let t=e.indexOf("?");return t===-1?e:e.slice(0,t)}function L1(e,t){let a=Kw("widget",Xw()),n=!1;return{mark:r=>a.mark(r),has:r=>a.has(r),report(r,o){n||(n=!0,a.set("retries",o),t({widget:d4(e),outcome:r,metrics:a.metrics}))}}}var f4="/api/mcp/events/v2/batch",Zw=new Set;function p4(e,t,a){return`${e}|${t}|${a??""}`}function Ic(e){return Bp(e,f4)}async function E1(e){let{api:t,token:a,channelId:n,mode:r,source:o}=e;if(typeof window>"u"||!t||!a)return;let i=Ic(t);if(!i){Na("page.viewed skipped: the chat api is not a Waniwani endpoint");return}if(!n&&!o){Na("page.viewed skipped: no channelId or source to attribute it");return}let s=p4(t,a,n);if(!Zw.has(s)){Zw.add(s);try{let l=await Sc(),u=new Date().toISOString(),c=JSON.stringify({sentAt:u,source:{sdk:"@waniwani/sdk",version:"0.1.0"},events:[{id:crypto.randomUUID(),type:"mcp.event",name:"page.viewed",source:o,timestamp:u,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:{}}]}),d=fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:c,keepalive:!0});Di("pageViewSent"),await d}catch{Zw.delete(s)}}}function A1(e){let t=Ic(e.api);return t?v1({endpoint:t,token:e.token,channelId:e.channelId,source:e.getSource,identity:()=>({sessionId:e.getSessionId(),visitorId:fa()})}):Vp("the chat api does not point at a Waniwani event ingest")}function Vp(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 Wp=j(Ee());var $p=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var M1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var R1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var Jw=e=>{let t=R1(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Cc=j(Ee());var D1={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 _1=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var P1=(0,Cc.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...s},l)=>(0,Cc.createElement)("svg",{ref:l,...D1,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:$p("lucide",r),...!o&&!_1(s)&&{"aria-hidden":"true"},...s},[...i.map(([u,c])=>(0,Cc.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var tt=(e,t)=>{let a=(0,Wp.forwardRef)(({className:n,...r},o)=>(0,Wp.createElement)(P1,{ref:o,iconNode:t,className:$p(`lucide-${M1(Jw(e))}`,`lucide-${e}`,n),...r}));return a.displayName=Jw(e),a};var m4=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],kc=tt("arrow-down",m4);var h4=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],hr=tt("arrow-up",h4);var g4=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Tc=tt("check",g4);var y4=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zo=tt("chevron-down",y4);var w4=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Lc=tt("chevron-right",w4);var v4=[["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"}]],Ec=tt("clipboard-copy",v4);var x4=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Kr=tt("clock",x4);var b4=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ac=tt("file-text",b4);var S4=[["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"}]],vl=tt("file",S4);var I4=[["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"}]],Mc=tt("globe",I4);var C4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Rc=tt("image",C4);var k4=[["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"}]],Dc=tt("loader",k4);var T4=[["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"}]],xl=tt("paperclip",T4);var L4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],_c=tt("square",L4);var E4=[["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"}]],_i=tt("wrench",E4);var A4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wn=tt("x",A4);var M4=[["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"}]],Pc=tt("zap",M4);var rt=j(Ee(),1),zB=j(mg(),1);var bl=j(Ee(),1),Oc=j(he(),1);function _4(e){return 1-(1-e)**3}function P4({start:e=0,end:t=100,duration:a=1e3,delay:n=0,ease:r=_4,onUpdate:o,onEnd:i}){let s=performance.now()+n;function l(){let u=performance.now()-s,c=Math.min(u/a,1);o(e+(t-e)*r(c)),c<1?requestAnimationFrame(l):i&&i()}setTimeout(()=>requestAnimationFrame(l),n)}var O4=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],N4=[0,1,2,0,1,2,1];function U4(e){let t=[];for(let a=0;a<7;a++){let n=e[Math.min(N4[a],e.length-1)];t.push(`radial-gradient(at ${O4[a]}, ${n} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}var B4=({children:e,className:t="",style:a,edgeSensitivity:n=30,backgroundColor:r="#120F17",borderRadius:o=28,coneSpread:i=25,animated:s=!1,colors:l=["#c084fc","#f472b6","#38bdf8"]})=>{let[u,c]=(0,bl.useState)(110),[d,p]=(0,bl.useState)(0),[m,h]=(0,bl.useState)(!1);(0,bl.useEffect)(()=>{if(!s)return;let E=110;h(!0),c(E),P4({ease:T=>T,duration:2e3,onUpdate:T=>{let R=T/100;c(E+360*R);let O=Math.min(R/.1,1),U=R>.85?(1-R)/.15:1;p(Math.min(O,U))},onEnd:()=>h(!1)})},[s]);let v=n+20,I=m?Math.max(0,(d*100-v)/(100-v)):0,w=U4(l).map(E=>`${E} border-box`),S=`conic-gradient(from ${`${u.toFixed(3)}deg`} at center, black ${i}%, transparent ${i+15}%, transparent ${100-i-15}%, black ${100-i}%)`;return(0,Oc.jsxs)("div",{className:`ww:relative ww:grid ww:isolate ww:border ${t}`,style:{background:r,borderRadius:typeof o=="number"?`${o}px`:o,transform:"translate3d(0, 0, 0.01px)",...a},children:[(0,Oc.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:S,WebkitMaskImage:S,transition:m?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),(0,Oc.jsx)("div",{className:"ww:flex ww:flex-col ww:relative ww:overflow-auto ww:z-[1]",children:e})]})},Xp=B4;Qw();tv();var z4=z1({prefix:"ww"});function V(...e){return z4(Kp(e))}var Nc=j(he(),1);function Sl({suggestions:e,isLoading:t,onSelect:a,align:n="start",className:r,...o}){return e.length===0&&!t?null:(0,Nc.jsx)("div",{className:V("ww:px-4 ww:py-2",r),...o,children:(0,Nc.jsx)("div",{className:V("ww:mx-auto ww:w-full ww:max-w-3xl ww:flex ww:flex-wrap ww:gap-2",n==="center"&&"ww:justify-center"),children:t?[0,1,2].map(i=>(0,Nc.jsx)("div",{className:"ww:h-8 ww:rounded-full ww:bg-accent ww:animate-pulse",style:{width:`${60+i*20}px`}},i)):e.map((i,s)=>(0,Nc.jsx)("button",{type:"button",onClick:()=>a(i),className:V("ww:rounded-full ww:border ww:border-border ww:bg-accent ww:px-3.5 ww:py-1.5 ww:text-sm","ww:text-foreground ww:hover:bg-border 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:`${s*50}ms`},children:i},i))})})}var mm=j(Ee(),1);var mL="vercel.ai.error",F4=Symbol.for(mL),F1,q1,Je=class hL extends(q1=Error,F1=F4,q1){constructor({name:t,message:a,cause:n}){super(a),this[F1]=!0,this.name=t,this.cause=n}static isInstance(t){return hL.hasMarker(t,mL)}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}},gL="AI_APICallError",yL=`vercel.ai.error.${gL}`,q4=Symbol.for(yL),H1,j1,VQ=class extends(j1=Je,H1=q4,j1){constructor({message:e,url:t,requestBodyValues:a,statusCode:n,responseHeaders:r,responseBody:o,cause:i,isRetryable:s=n!=null&&(n===408||n===409||n===429||n>=500),data:l}){super({name:gL,message:e,cause:i}),this[H1]=!0,this.url=t,this.requestBodyValues=a,this.statusCode=n,this.responseHeaders=r,this.responseBody=o,this.isRetryable=s,this.data=l}static isInstance(e){return Je.hasMarker(e,yL)}},wL="AI_EmptyResponseBodyError",vL=`vercel.ai.error.${wL}`,H4=Symbol.for(vL),V1,$1,$Q=class extends($1=Je,V1=H4,$1){constructor({message:e="Empty response body"}={}){super({name:wL,message:e}),this[V1]=!0}static isInstance(e){return Je.hasMarker(e,vL)}};function xL(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var bL="AI_InvalidArgumentError",SL=`vercel.ai.error.${bL}`,j4=Symbol.for(SL),W1,G1,IL=class extends(G1=Je,W1=j4,G1){constructor({message:e,cause:t,argument:a}){super({name:bL,message:e,cause:t}),this[W1]=!0,this.argument=a}static isInstance(e){return Je.hasMarker(e,SL)}},CL="AI_InvalidPromptError",kL=`vercel.ai.error.${CL}`,V4=Symbol.for(kL),X1,K1,WQ=class extends(K1=Je,X1=V4,K1){constructor({prompt:e,message:t,cause:a}){super({name:CL,message:`Invalid prompt: ${t}`,cause:a}),this[X1]=!0,this.prompt=e}static isInstance(e){return Je.hasMarker(e,kL)}},TL="AI_InvalidResponseDataError",LL=`vercel.ai.error.${TL}`,$4=Symbol.for(LL),Y1,Z1,GQ=class extends(Z1=Je,Y1=$4,Z1){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:TL,message:t}),this[Y1]=!0,this.data=e}static isInstance(e){return Je.hasMarker(e,LL)}},EL="AI_JSONParseError",AL=`vercel.ai.error.${EL}`,W4=Symbol.for(AL),J1,Q1,nv=class extends(Q1=Je,J1=W4,Q1){constructor({text:e,cause:t}){super({name:EL,message:`JSON parsing failed: Text: ${e}.
|
|
122
|
-
Error message: ${
|
|
123
|
-
Error message: ${
|
|
124
|
-
`;break;case"id":s=I.includes("\0")?void 0:I;break;case"retry":/^\d+$/.test(I)?n(parseInt(I,10)):a(new
|
|
125
|
-
`)?l.slice(0,-1):l}),s=void 0,l="",u=""}function h(v={}){o&&v.consume&&d(o),i=!0,s=void 0,l="",u="",o=""}return{feed:c,reset:h}}function
|
|
118
|
+
`)},PS=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("")},uK=e=>{let{headers:t,rows:a}=e;if(t.length===0)return"";let n=new Array(a.length+2),r=0,o=t.map(s=>PS(s));n[r]=`| ${o.join(" | ")} |`,r+=1;let i=new Array(t.length);for(let s=0;s<t.length;s+=1)i[s]="---";n[r]=`| ${i.join(" | ")} |`,r+=1;for(let s of a)if(s.length<t.length){let l=new Array(t.length);for(let u=0;u<t.length;u+=1)l[u]=u<s.length?PS(s[u]):"";n[r]=`| ${l.join(" | ")} |`,r+=1}else{let l=s.map(u=>PS(u));n[r]=`| ${l.join(" | ")} |`,r+=1}return n.join(`
|
|
119
|
+
`)},cK=({children:e,className:t,onCopy:a,onError:n,timeout:r=2e3})=>{let[o,i]=(0,N.useState)(!1),[s,l]=(0,N.useState)(!1),u=(0,N.useRef)(null),c=(0,N.useRef)(0),{isAnimating:d}=(0,N.useContext)(qa),p=async h=>{var v,I;if(typeof window>"u"||!((v=navigator?.clipboard)!=null&&v.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=VN(w),S=h==="csv"?$N(g):lK(g),E=new ClipboardItem({"text/plain":new Blob([S],{type:"text/plain"}),"text/html":new Blob([w.outerHTML],{type:"text/html"})});await navigator.clipboard.write([E]),l(!0),i(!1),a?.(h),c.current=window.setTimeout(()=>l(!1),r)}catch(y){n?.(y)}};(0,N.useEffect)(()=>{let h=v=>{let I=v.composedPath();u.current&&!I.includes(u.current)&&i(!1)};return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h),window.clearTimeout(c.current)}},[]);let m=s?zS:FS;return(0,M.jsxs)("div",{className:"relative",ref:u,children:[(0,M.jsx)("button",{className:Ce("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,M.jsx)(m,{size:14})}),o?(0,M.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,M.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>p("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),(0,M.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>p("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},dK=({children:e,className:t,onDownload:a,onError:n})=>{let[r,o]=(0,N.useState)(!1),i=(0,N.useRef)(null),{isAnimating:s}=(0,N.useContext)(qa),l=u=>{var c;try{let d=(c=i.current)==null?void 0:c.closest('[data-streamdown="table-wrapper"]'),p=d?.querySelector("table");if(!p){n?.(new Error("Table not found"));return}let m=VN(p),h=u==="csv"?$N(m):uK(m);tu(`table.${u==="csv"?"csv":"md"}`,h,u==="csv"?"text/csv":"text/markdown"),o(!1),a?.(u)}catch(d){n?.(d)}};return(0,N.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,M.jsxs)("div",{className:"relative",ref:i,children:[(0,M.jsx)("button",{className:Ce("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:s,onClick:()=>o(!r),title:"Download table",type:"button",children:e??(0,M.jsx)(Lh,{size:14})}),r?(0,M.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,M.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>l("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),(0,M.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>l("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},fK=({children:e,className:t,showControls:a,...n})=>(0,M.jsxs)("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[a?(0,M.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,M.jsx)(cK,{}),(0,M.jsx)(dK,{})]}):null,(0,M.jsx)("div",{className:"overflow-x-auto",children:(0,M.jsx)("table",{className:Ce("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]}),pK=(0,N.lazy)(()=>Promise.resolve().then(()=>(MN(),AN)).then(e=>({default:e.CodeBlock}))),mK=(0,N.lazy)(()=>Promise.resolve().then(()=>(_N(),DN)).then(e=>({default:e.Mermaid}))),hK=/language-([^\s]+)/;BS=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,kh=(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},HS=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("ol",{className:Ce("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>Wt(e,t));HS.displayName="MarkdownOl";WN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("li",{className:Ce("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&Eh(e.node,t.node));WN.displayName="MarkdownLi";GN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("ul",{className:Ce("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>Wt(e,t));GN.displayName="MarkdownUl";XN=(0,N.memo)(({className:e,node:t,...a})=>(0,M.jsx)("hr",{className:Ce("my-6 border-border",e),"data-streamdown":"horizontal-rule",...a}),(e,t)=>Wt(e,t));XN.displayName="MarkdownHr";KN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("span",{className:Ce("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>Wt(e,t));KN.displayName="MarkdownStrong";gK=({children:e,className:t,href:a,node:n,...r})=>{let{linkSafety:o}=(0,N.useContext)(qa),[i,s]=(0,N.useState)(!1),l=a==="streamdown:incomplete-link",u=(0,N.useCallback)(async m=>{if(!(!(o!=null&&o.enabled&&a)||l)){if(m.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(a)){window.open(a,"_blank","noreferrer");return}s(!0)}},[o,a,l]),c=(0,N.useCallback)(()=>{a&&window.open(a,"_blank","noreferrer")},[a]),d=(0,N.useCallback)(()=>{s(!1)},[]),p={url:a??"",isOpen:i,onClose:d,onConfirm:c};return o!=null&&o.enabled&&a?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("button",{className:Ce("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",onClick:u,type:"button",children:e}),o.renderModal?o.renderModal(p):(0,M.jsx)(aK,{...p})]}):(0,M.jsx)("a",{className:Ce("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",href:a,rel:"noreferrer",target:"_blank",...r,children:e})},YN=(0,N.memo)(gK,(e,t)=>Wt(e,t)&&e.href===t.href);YN.displayName="MarkdownA";ZN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h1",{className:Ce("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>Wt(e,t));ZN.displayName="MarkdownH1";JN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h2",{className:Ce("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>Wt(e,t));JN.displayName="MarkdownH2";QN=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h3",{className:Ce("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>Wt(e,t));QN.displayName="MarkdownH3";eU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h4",{className:Ce("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>Wt(e,t));eU.displayName="MarkdownH4";tU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h5",{className:Ce("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>Wt(e,t));tU.displayName="MarkdownH5";aU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("h6",{className:Ce("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>Wt(e,t));aU.displayName="MarkdownH6";nU=(0,N.memo)(({children:e,className:t,node:a,...n})=>{let{controls:r}=(0,N.useContext)(qa),o=BS(r,"table");return(0,M.jsx)(fK,{className:t,showControls:o,...n,children:e})},(e,t)=>Wt(e,t));nU.displayName="MarkdownTable";rU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("thead",{className:Ce("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>Wt(e,t));rU.displayName="MarkdownThead";oU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("tbody",{className:Ce("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>Wt(e,t));oU.displayName="MarkdownTbody";iU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("tr",{className:Ce("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>Wt(e,t));iU.displayName="MarkdownTr";sU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("th",{className:Ce("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e}),(e,t)=>Wt(e,t));sU.displayName="MarkdownTh";lU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("td",{className:Ce("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>Wt(e,t));lU.displayName="MarkdownTd";uU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("blockquote",{className:Ce("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e}),(e,t)=>Wt(e,t));uU.displayName="MarkdownBlockquote";cU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("sup",{className:Ce("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>Wt(e,t));cU.displayName="MarkdownSup";dU=(0,N.memo)(({children:e,className:t,node:a,...n})=>(0,M.jsx)("sub",{className:Ce("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>Wt(e,t));dU.displayName="MarkdownSub";fU=(0,N.memo)(({children:e,className:t,node:a,...n})=>{if("data-footnotes"in n){let r=i=>{var s,l;if(!(0,N.isValidElement)(i))return!1;let u=Array.isArray(i.props.children)?i.props.children:[i.props.children],c=!1,d=!1;for(let p of u)if(p){if(typeof p=="string")p.trim()!==""&&(c=!0);else if((0,N.isValidElement)(p))if(((s=p.props)==null?void 0:s["data-footnote-backref"])!==void 0)d=!0;else{let m=Array.isArray(p.props.children)?p.props.children:[p.props.children];for(let h of m){if(typeof h=="string"&&h.trim()!==""){c=!0;break}if((0,N.isValidElement)(h)&&((l=h.props)==null?void 0:l["data-footnote-backref"])===void 0){c=!0;break}}}}return d&&!c},o=Array.isArray(e)?e.map(i=>{if(!(0,N.isValidElement)(i))return i;if(i.type===HS){let s=(Array.isArray(i.props.children)?i.props.children:[i.props.children]).filter(l=>!r(l));return s.length===0?null:{...i,props:{...i.props,children:s}}}return i}):e;return(Array.isArray(o)?o.some(i=>i!==null):o!==null)?(0,M.jsx)("section",{className:t,...n,children:o}):null}return(0,M.jsx)("section",{className:t,...n,children:e})},(e,t)=>Wt(e,t));fU.displayName="MarkdownSection";yK=({node:e,className:t,children:a,...n})=>{var r,o,i;let s=((r=e?.position)==null?void 0:r.start.line)===((o=e?.position)==null?void 0:o.end.line),{mermaid:l,controls:u}=(0,N.useContext)(qa),c=qS();if(s)return(0,M.jsx)("code",{className:Ce("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(hK),p=(i=d?.at(1))!=null?i:"",m="";if((0,N.isValidElement)(a)&&a.props&&typeof a.props=="object"&&"children"in a.props&&typeof a.props.children=="string"?m=a.props.children:typeof a=="string"&&(m=a),p==="mermaid"&&c){let v=BS(u,"mermaid"),I=kh(u,"download"),y=kh(u,"copy"),w=kh(u,"fullscreen"),g=kh(u,"panZoom"),S=v&&(I||y||w);return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(UN,{}),children:(0,M.jsxs)("div",{className:Ce("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[S?(0,M.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[I?(0,M.jsx)(rK,{chart:m,config:l?.config}):null,y?(0,M.jsx)(ON,{code:m}):null,w?(0,M.jsx)(sK,{chart:m,config:l?.config}):null]}):null,(0,M.jsx)(mK,{chart:m,config:l?.config,showControls:g})]})})}let h=BS(u,"code");return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(UN,{}),children:(0,M.jsx)(pK,{className:Ce("overflow-x-auto border-border border-t",t),code:m,language:p,children:h?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(ZX,{code:m,language:p}),(0,M.jsx)(ON,{})]}):null})})},pU=(0,N.memo)(yK,(e,t)=>e.className===t.className&&Eh(e.node,t.node));pU.displayName="MarkdownCode";mU=(0,N.memo)(QX,(e,t)=>e.className===t.className&&Eh(e.node,t.node));mU.displayName="MarkdownImg";hU=(0,N.memo)(({children:e,className:t,node:a,...n})=>{var r,o;let i=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");if(i.length===1&&(0,N.isValidElement)(i[0])){let s=i[0].props.node,l=s?.tagName;if(l==="img")return(0,M.jsx)(M.Fragment,{children:e});if(l==="code"&&((r=s?.position)==null?void 0:r.start.line)!==((o=s?.position)==null?void 0:o.end.line))return(0,M.jsx)(M.Fragment,{children:e})}return(0,M.jsx)("p",{className:t,...n,children:e})},(e,t)=>Wt(e,t));hU.displayName="MarkdownParagraph";wK={ol:HS,li:WN,ul:GN,hr:XN,strong:KN,a:YN,h1:ZN,h2:JN,h3:QN,h4:eU,h5:tU,h6:aU,table:nU,thead:rU,tbody:oU,tr:iU,th:sU,td:lU,blockquote:uU,code:pU,img:mU,pre:({children:e})=>e,sup:cU,sub:dU,p:hU,section:fU},BN=[],zN={allowDangerousHtml:!0},Th=new WeakMap,vK=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 p=0;p<c.length;p+=1){let m=c[p];if(p>0&&(d+=","),Array.isArray(m)){let[h,v]=m;if(typeof h=="function"){let I=Th.get(h);I||(I=h.name,Th.set(h,I)),d+=I}else d+=String(h);d+=":",d+=JSON.stringify(v)}else if(typeof m=="function"){let h=Th.get(m);h||(h=m.name,Th.set(m,h)),d+=h}else d+=String(m)}return d},i=o(a),s=o(n),l=r?JSON.stringify(r):"",u=`${s}::${i}::${l}`;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()}},FN=new vK,gU=e=>{let t=xK(e),a=e.children||"";return SK(t.runSync(t.parse(a),a),e)},xK=e=>{let t=FN.get(e);if(t)return t;let a=bK(e);return FN.set(e,a),a},bK=e=>{let t=e.rehypePlugins||BN,a=e.remarkPlugins||BN,n=e.remarkRehypeOptions?{...zN,...e.remarkRehypeOptions}:zN;return vS().use(uh).use(a).use(ph,n).use(t)},SK=(e,t)=>Jb(e,{Fragment:M.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:M.jsx,jsxs:M.jsxs,passKeys:!0,passNode:!0}),IK=/\[\^[^\]\s]{1,200}\](?!:)/,CK=/\[\^[^\]\s]{1,200}\]:/,kK=/<\/(\w+)>/,TK=/<(\w+)[\s>]/,OS=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]==="$"},LK=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]==="$"},NS=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},yU=e=>{let t=IK.test(e),a=CK.test(e);if(t||a)return[e];let n=Sn.lex(e,{gfm:!0}),r=[],o=[];for(let i of n){let s=i.raw,l=r.length;if(o.length>0){if(r[l-1]+=s,i.type==="html"){let u=s.match(kK);if(u){let c=u[1];o.at(-1)===c&&o.pop()}}continue}if(i.type==="html"&&i.block){let u=s.match(TK);if(u){let c=u[1];s.includes(`</${c}>`)||o.push(c)}}if(s.trim()==="$$"&&l>0){let u=r[l-1],c=OS(u),d=NS(u);if(c&&d%2===1){r[l-1]=u+s;continue}}if(l>0&&LK(s)){let u=r[l-1],c=OS(u),d=NS(u),p=NS(s);if(c&&d%2===1&&!OS(s)&&p===1){r[l-1]=u+s;continue}}r.push(s)}return r},wU={raw:ZM,sanitize:[Am,{}],harden:[KM,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},vU={gfm:[eh,{}]},EK=Object.values(wU),AK=Object.values(vU),MK={block:" \u258B",circle:" \u25CF"},RK={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},qa=(0,N.createContext)(RK),jS=(0,N.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:a,...n})=>(0,M.jsx)(gU,{...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)});jS.displayName="Block";DK=["github-light","github-dark"],au=(0,N.memo)(({children:e,mode:t="streaming",parseIncompleteMarkdown:a=!0,components:n,rehypePlugins:r=EK,remarkPlugins:o=AK,className:i,shikiTheme:s=DK,mermaid:l,controls:u=!0,isAnimating:c=!1,BlockComponent:d=jS,parseMarkdownIntoBlocksFn:p=yU,caret:m,plugins:h,remend:v,linkSafety:I={enabled:!0},...y})=>{let w=(0,N.useId)(),[g,S]=(0,N.useTransition)(),E=(0,N.useMemo)(()=>typeof e!="string"?"":t==="streaming"&&a?u_(e,v):e,[e,t,a,v]),T=(0,N.useMemo)(()=>p(E),[E,p]),[R,O]=(0,N.useState)(T);(0,N.useEffect)(()=>{t==="streaming"?S(()=>{O(T)}):O(T)},[T,t]);let U=t==="streaming"?R:T,A=(0,N.useMemo)(()=>U.map((B,P)=>`${w}-${P}`),[U.length,w]),Q=(0,N.useMemo)(()=>{var B,P;return{shikiTheme:(P=(B=h?.code)==null?void 0:B.getThemes())!=null?P:s,controls:u,isAnimating:c,mode:t,mermaid:l,linkSafety:I}},[s,u,c,t,l,I,h?.code]),$=(0,N.useMemo)(()=>({...wK,...n}),[n]),H=(0,N.useMemo)(()=>{let B=[];return h!=null&&h.cjk&&(B=[...B,...h.cjk.remarkPluginsBefore]),B=[...B,...o],h!=null&&h.cjk&&(B=[...B,...h.cjk.remarkPluginsAfter]),h!=null&&h.math&&(B=[...B,h.math.remarkPlugin]),B},[o,h?.math,h?.cjk]),Z=(0,N.useMemo)(()=>h!=null&&h.math?[...r,h.math.rehypePlugin]:r,[r,h?.math]),X=(0,N.useMemo)(()=>m&&c?{"--streamdown-caret":`"${MK[m]}"`}:void 0,[m,c]);return t==="static"?(0,M.jsx)(US.Provider,{value:h??null,children:(0,M.jsx)(qa.Provider,{value:Q,children:(0,M.jsx)("div",{className:Ce("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",i),children:(0,M.jsx)(gU,{components:$,rehypePlugins:Z,remarkPlugins:H,...y,children:e})})})}):(0,M.jsx)(US.Provider,{value:h??null,children:(0,M.jsx)(qa.Provider,{value:Q,children:(0,M.jsxs)("div",{className:Ce("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",m?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,i),style:X,children:[U.length===0&&m&&c&&(0,M.jsx)("span",{}),U.map((B,P)=>(0,M.jsx)(d,{components:$,content:B,index:P,rehypePlugins:Z,remarkPlugins:H,shouldParseIncompleteMarkdown:a,...y},A[P]))]})})})},(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);au.displayName="Streamdown";_K=({children:e,className:t,minZoom:a=.5,maxZoom:n=3,zoomStep:r=.1,showControls:o=!0,initialZoom:i=1,fullscreen:s=!1})=>{let l=(0,N.useRef)(null),u=(0,N.useRef)(null),[c,d]=(0,N.useState)(i),[p,m]=(0,N.useState)({x:0,y:0}),[h,v]=(0,N.useState)(!1),[I,y]=(0,N.useState)({x:0,y:0}),[w,g]=(0,N.useState)({x:0,y:0}),S=(0,N.useCallback)($=>{d(H=>Math.max(a,Math.min(n,H+$)))},[a,n]),E=(0,N.useCallback)(()=>{S(r)},[S,r]),T=(0,N.useCallback)(()=>{S(-r)},[S,r]),R=(0,N.useCallback)(()=>{d(i),m({x:0,y:0})},[i]),O=(0,N.useCallback)($=>{$.preventDefault();let H=$.deltaY>0?-r:r;S(H)},[S,r]),U=(0,N.useCallback)($=>{if($.button!==0||$.isPrimary===!1)return;v(!0),y({x:$.clientX,y:$.clientY}),g(p);let H=$.currentTarget;H instanceof HTMLElement&&H.setPointerCapture($.pointerId)},[p]),A=(0,N.useCallback)($=>{if(!h)return;$.preventDefault();let H=$.clientX-I.x,Z=$.clientY-I.y;m({x:w.x+H,y:w.y+Z})},[h,I,w]),Q=(0,N.useCallback)($=>{v(!1);let H=$.currentTarget;H instanceof HTMLElement&&H.releasePointerCapture($.pointerId)},[]);return(0,N.useEffect)(()=>{let $=l.current;if($)return $.addEventListener("wheel",O,{passive:!1}),()=>{$.removeEventListener("wheel",O)}},[O]),(0,N.useEffect)(()=>{let $=u.current;if($&&h)return document.body.style.userSelect="none",$.addEventListener("pointermove",A,{passive:!1}),$.addEventListener("pointerup",Q),$.addEventListener("pointercancel",Q),()=>{document.body.style.userSelect="",$.removeEventListener("pointermove",A),$.removeEventListener("pointerup",Q),$.removeEventListener("pointercancel",Q)}},[h,A,Q]),(0,M.jsxs)("div",{className:Ce("relative flex flex-col",s?"h-full w-full":"min-h-28 w-full",t),ref:l,style:{cursor:h?"grabbing":"grab"},children:[o?(0,M.jsxs)("div",{className:Ce("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",s?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,M.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:E,title:"Zoom in",type:"button",children:(0,M.jsx)(KX,{size:16})}),(0,M.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:T,title:"Zoom out",type:"button",children:(0,M.jsx)(YX,{size:16})}),(0,M.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:R,title:"Reset zoom and pan",type:"button",children:(0,M.jsx)(XX,{size:16})})]}):null,(0,M.jsx)("div",{className:Ce("flex-1 origin-center transition-transform duration-150 ease-out",s?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:U,ref:u,role:"application",style:{transform:`translate(${p.x}px, ${p.y}px) scale(${c})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},_S=({chart:e,className:t,config:a,fullscreen:n=!1,showControls:r=!0})=>{let[o,i]=(0,N.useState)(null),[s,l]=(0,N.useState)(!1),[u,c]=(0,N.useState)(""),[d,p]=(0,N.useState)(""),[m,h]=(0,N.useState)(0),{mermaid:v}=(0,N.useContext)(qa),I=qS(),y=v?.errorComponent,{shouldRender:w,containerRef:g}=$X({immediate:n});if((0,N.useEffect)(()=>{if(w){if(!I){i("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{i(null),l(!0);let E=I.getMermaid(a),T=e.split("").reduce((U,A)=>(U<<5)-U+A.charCodeAt(0)|0,0),R=`mermaid-${Math.abs(T)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:O}=await E.render(R,e);c(O),p(O)}catch(E){if(!(d||u)){let T=E instanceof Error?E.message:"Failed to render Mermaid chart";i(T)}}finally{l(!1)}})()}},[e,a,m,w,I]),!(w||u||d))return(0,M.jsx)("div",{className:Ce("my-4 min-h-[200px]",t),ref:g});if(s&&!u&&!d)return(0,M.jsx)("div",{className:Ce("my-4 flex justify-center p-4",t),ref:g,children:(0,M.jsxs)("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[(0,M.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),(0,M.jsx)("span",{className:"text-sm",children:"Loading diagram..."})]})});if(o&&!u&&!d)return y?(0,M.jsx)("div",{ref:g,children:(0,M.jsx)(y,{chart:e,error:o,retry:()=>h(T=>T+1)})}):(0,M.jsxs)("div",{className:Ce("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:g,children:[(0,M.jsxs)("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",o]}),(0,M.jsxs)("details",{className:"mt-2",children:[(0,M.jsx)("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),(0,M.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]});let S=u||d;return(0,M.jsx)("div",{className:Ce("size-full",t),"data-streamdown":"mermaid",ref:g,children:(0,M.jsx)(_K,{className:Ce(n?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:n,maxZoom:3,minZoom:.5,showControls:r,zoomStep:.1,children:(0,M.jsx)("div",{"aria-label":"Mermaid chart",className:Ce("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:S},role:"img"})})})}});var lB=Ca((Gve,sB)=>{"use strict";function uY(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(),s=i-n,l=t-s;l<=0?(n=i,e.apply(this,o)):a=setTimeout(()=>{n=Date.now(),e.apply(this,o)},l)}}sB.exports=uY});var x0=typeof performance>"u"?0:performance.now(),b0=typeof window<"u"&&!!window.WaniWani?.chat;var Cs=j(Ee(),1),Zh=j(qw(),1);var Hw="waniwani/suggestions";function yl(e,t){for(let a of t){let n=e[a];if(typeof n=="string"&&n.length>0)return n}}var hq=["waniwani/sessionId","openai/sessionId","openai/session","sessionId","conversationId","mcp-session-id"],gq=["waniwani/requestId","openai/requestId","requestId","mcp/requestId"],yq=["waniwani/traceId","openai/traceId","traceId","mcp/traceId","openai/requestId","requestId"],wq=["waniwani/userId","openai/userId","externalUserId","userId","actorId"],vq=["waniwani/visitorId","visitorId"],xq=["correlationId","openai/requestId"];function c1(e){return e?yl(e,hq):void 0}function d1(e){return e?yl(e,gq):void 0}function f1(e){return e?yl(e,yq):void 0}function p1(e){return e?yl(e,wq):void 0}function m1(e){return e?yl(e,vq):void 0}function h1(e){return e?yl(e,xq):void 0}var bq=[{key:"openai/sessionId",source:"chatgpt"},{key:"openai/session",source:"chatgpt"}],Sq=[{needle:"claude",source:"claude"},{needle:"chatgpt",source:"chatgpt"},{needle:"openai",source:"chatgpt"},{needle:"gemini",source:"gemini"}];function g1(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 bq){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 Sq)if(n.includes(r))return o}}var Iq="@waniwani/sdk";function y1(e,t={}){let a=t.now??(()=>new Date),n=t.generateId??Cq,r=Lq(e),o=zp(e.meta),i=zp(e.metadata),s=Eq(e,o),l=Xn(e.eventId)??n(),u=Aq(e.timestamp,a),c=Xn(e.source)??g1(o)??t.source??Iq,d=jw(e)?{...e}:void 0,p={...i};return Object.keys(o).length>0&&(p.meta=o),d&&(p.rawLegacy=d),{id:l,type:"mcp.event",name:r,source:c,timestamp:u,correlation:s,properties:kq(e,r),metadata:p,rawLegacy:d}}function Cq(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`evt_${crypto.randomUUID()}`:`evt_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function kq(e,t){if(!jw(e))return zp(e.properties);let a=Tq(e,t),n=zp(e.properties);return{...a,...n}}function Tq(e,t){switch(t){case"tool.called":{let a={};return Xn(e.toolName)&&(a.name=e.toolName),Xn(e.toolType)&&(a.type=e.toolType),a}case"link.clicked":{let a={};return Xn(e.linkUrl)&&(a.url=e.linkUrl),a}default:return{}}}function Lq(e){return jw(e)?e.eventType:e.event}function Eq(e,t){let a=Xn(e.requestId)??d1(t),n=Xn(e.sessionId)??c1(t),r=Xn(e.traceId)??f1(t),o=Xn(e.externalUserId)??p1(t),i=Xn(e.visitorId)??m1(t),s=Xn(e.correlationId)??h1(t)??a,l={};return n&&(l.sessionId=n),r&&(l.traceId=r),a&&(l.requestId=a),s&&(l.correlationId=s),o&&(l.externalUserId=o),i&&(l.visitorId=i),l}function Aq(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 zp(e){return!e||typeof e!="object"||Array.isArray(e)?{}:e}function Xn(e){if(typeof e=="string"&&e.trim().length!==0)return e}function jw(e){return"eventType"in e}function w1(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 Mq="/api/mcp/events/v2/batch";var v1="@waniwani/sdk";var Rq=new Set([401,403]),Dq=new Set([408,425,429,500,502,503,504]),_q=(e,t)=>globalThis.fetch(e,t);function x1(e){return new Vw(e)}var Vw=class{constructor(t){K(this,"endpointUrl");K(this,"flushIntervalMs");K(this,"maxBatchSize");K(this,"maxBufferSize");K(this,"maxRetries");K(this,"retryBaseDelayMs");K(this,"retryMaxDelayMs");K(this,"shutdownTimeoutMs");K(this,"sdkVersion");K(this,"fetchFn");K(this,"logger");K(this,"now");K(this,"sleep");K(this,"apiKey");K(this,"buffer",[]);K(this,"flushTimer");K(this,"flushScheduled",!1);K(this,"flushScheduledTimer");K(this,"flushInFlight");K(this,"inFlightCount",0);K(this,"isStopped",!1);K(this,"isShuttingDown",!1);this.endpointUrl=Nq(t.apiUrl,t.endpointPath??Mq),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??_q,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":v1};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:Uq(o)}}if(Rq.has(a.status))return{kind:"auth",status:a.status};if(Dq.has(a.status))return{kind:"retryable",reason:`HTTP ${a.status}`};if(!a.ok)return{kind:"permanent",reason:`HTTP ${a.status}`};let n=await Oq(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:v1,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 s=n.get(i.eventId);if(s){if(Pq(i)){r.push(s);continue}o.push(s)}}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 Pq(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 Oq(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function Nq(e,t){let a=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${a}${n}`}function Uq(e){return e instanceof Error?e.message:String(e)}function b1(e){let{apiUrl:t,endpointPath:a}=Bq(e.endpoint),n=x1({apiUrl:t,apiKey:e.token,endpointPath:a,flushIntervalMs:e.flushIntervalMs}),r,o=s=>typeof s=="function"?s():s,i=async s=>{let l=e.identity?.()??{},u=o(e.channelId),c=u===void 0?s.properties:{channelId:u,...s.properties},d=y1({sessionId:l.sessionId,visitorId:l.visitorId,externalUserId:l.externalUserId??r,traceId:l.traceId,...s,properties:c,metadata:{...e.metadata,...s.metadata}},{source:o(e.source)});return n.enqueue(d),{eventId:d.id}};return{track:Object.assign(i,w1(i)),identify(s,l){return r=s,i({event:"user.identified",externalUserId:s,properties:l})},flush:()=>n.flush(),shutdown:s=>n.shutdown(s)}}function Bq(e){let t=new URL(e);return{apiUrl:t.origin,endpointPath:`${t.pathname}${t.search}`}}function Na(e,t,a){let[n,r=""]=e.split("?"),o=n.replace(/\/$/,""),i=new URLSearchParams(r);if(a)for(let[l,u]of Object.entries(a))i.set(l,u);let s=i.toString();return`${o}${t}${s?`?${s}`:""}`}var zq="/api/mcp/";function Fp(e,t){let[a=""]=e.split("?"),n="",r=a;try{let o=new URL(a);n=o.origin,r=o.pathname}catch{if(!a.startsWith("/"))return null}return r.startsWith(zq)?`${n}${t}`:null}function Fq(){if(typeof window>"u")return!1;try{return window.WANIWANI_DEBUG?!0:!!window.localStorage?.getItem("WANIWANI_DEBUG")}catch{return!1}}function Ua(...e){Fq()&&console.log("[Waniwani]",...e)}var $w="waniwani-visitor-id";function qq(){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 ma(){try{let t=localStorage.getItem($w);if(t)return t}catch{}let e=qq();try{localStorage.setItem($w,e)}catch{}return e}function wl(e){let t=typeof e=="string"?e.trim():"";if(!t)return ma();try{localStorage.setItem($w,t)}catch{}return t}function Hq(e){return e!=null&&typeof e.then=="function"}function Sc(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 Hq(n)?n.then(r=>{t||wl(r??"")},()=>{}):wl(n??""),a}var jq="waniwani-memory";var yn="threads",qp="by_memoryUserId",Vq="by_updatedAt";var I1="memoryUserId",S1="waniwani-memory-user-id",Ww=null;function Gw(){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 $q(e,t){if(t<1&&(e.objectStoreNames.contains("ids")||e.createObjectStore("ids")),t<2&&!e.objectStoreNames.contains(yn)){let a=e.createObjectStore(yn,{keyPath:"threadId"});a.createIndex(qp,"memoryUserId",{unique:!1}),a.createIndex(Vq,"updatedAt",{unique:!1})}}async function Xw(){return new Promise((e,t)=>{let a=indexedDB.open(jq,2);a.onupgradeneeded=n=>{$q(a.result,n.oldVersion)},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)})}async function Wq(){return Xw()}async function Gq(e){return new Promise((t,a)=>{let o=e.transaction("ids","readonly").objectStore("ids").get(I1);o.onsuccess=()=>t(typeof o.result=="string"?o.result:null),o.onerror=()=>a(o.error)})}async function Xq(e,t){return new Promise((a,n)=>{let i=e.transaction("ids","readwrite").objectStore("ids").put(t,I1);i.onsuccess=()=>a(),i.onerror=()=>n(i.error)})}async function Kq(){if(typeof indexedDB>"u")return null;try{let e=await Wq();try{let t=await Gq(e);if(t)return t;let a=Gw();return await Xq(e,a),a}finally{e.close()}}catch{return null}}function Yq(){try{let e=localStorage.getItem(S1);if(e)return e;let t=Gw();return localStorage.setItem(S1,t),t}catch{return null}}async function C1(){let e=await Kq();if(e)return e;let t=Yq();return t||(Ww||(Ww=Gw()),Ww)}function k1(e,t){return e.match(t)?.[1]??null}function Zq(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=k1(e,n);if(r)return{name:a,version:r}}return null}function Jq(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=k1(e,n);if(r)return{name:a,version:r.replace(/_/g,".")};if(a==="Linux"&&n.test(e))return{name:a,version:""}}return null}function Qq(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 Ic(){let e=navigator.userAgent,t=ma(),a=await C1();return{userAgent:e,browser:Zq(e),os:Jq(e),deviceType:Qq(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 e4="0.22.0-beta.7",t4=40,a4=10,n4=6e5;function Yw(){return typeof performance>"u"?0:performance.now()}function Zw(e,t){let a={};return{metrics:a,has:n=>n in a,set(n,r){a[n]=r},mark(n,r=Yw()){if(!(n in a)){a[n]=r-t;try{performance.mark(`waniwani:${e}:${n}`,{startTime:r})}catch{}}}}}function r4(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=t4)break;if(!Number.isFinite(n))continue;let r=Math.round(n);r<0||r>n4||(t[a]=r)}return t}function o4(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=a4)break;(typeof n=="string"||typeof n=="boolean")&&(t[a]=n)}return t}function i4(){let e=navigator.connection;if(e)return{effectiveType:e.effectiveType,rtt:e.rtt,downlink:e.downlink,saveData:e.saveData}}function jp(e){let t=e?.Authorization;return typeof t=="string"&&t.startsWith("Bearer ")?t.slice(7):void 0}function s4(e,t,a,n){return{kind:e,sdkVersion:e4,channelId:t.channelId||void 0,sessionId:e==="boot"?void 0:t.sessionId||void 0,visitorId:ma(),pageHost:window.location.hostname,connection:i4(),tags:o4(a),metrics:r4(n)}}var Kw,Hp=[];function Jw(e){let t=String(e?.chatTimingLogs).trim().toLowerCase()==="true";Kw=t;let a=Hp;if(Hp=[],t)for(let n of a)n()}function Vp(e,t,a,n){let{api:r,token:o}=t;if(!(typeof window>"u"||!r||!o||Kw===!1))try{let i=s4(e,t,a,n),s=()=>{Ua("timing",i),fetch(Na(r,"/timing"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify(i),keepalive:!0}).catch(()=>{})};Kw?s():Hp.length<20&&Hp.push(s)}catch{}}var Wr=Zw("boot",0),T1;function Di(e,t){Wr.mark(e,t)}function $p(e){T1??(T1=e)}var l4=/cdn\.jsdelivr\.net\/npm\/@waniwani\/sdk@[^/]+\/dist\/chat\/embed\.js/,u4=/\/embed\.js(\?|$)/;function c4(){if(typeof performance>"u")return;let e=performance.getEntriesByType("navigation")[0];e?.responseStart&&Wr.mark("navTtfb",e.responseStart),e?.domContentLoadedEventEnd&&Wr.mark("navDomContentLoaded",e.domContentLoadedEventEnd);let t=performance.getEntriesByType("resource");for(let a of t)l4.test(a.name)?(Wr.mark("bundleStart",a.startTime),Wr.mark("bundleEnd",a.responseEnd)):u4.test(a.name)&&(Wr.mark("loaderStart",a.startTime),Wr.mark("loaderEnd",a.responseEnd))}function d4(){if(b0)return!0;try{return document.querySelectorAll('script[src*="@waniwani/sdk"]').length>1}catch{return!1}}function L1(e){c4(),Wr.mark("bundleExecuted",x0),Vp("boot",e,{configSource:T1,mode:e.mode,secondSdk:d4()},Wr.metrics)}var f4=[["text-delta","firstText"],["tool-input-start","firstToolInput"],["tool-output-available","firstToolOutput"]];function E1(e){let t=Zw("turn",Yw());t.set("turnIndex",e);let a=!1;return{mark:n=>t.mark(n),instrument(n){if(!n.ok||!n.body||typeof TransformStream>"u")return n;try{let r=new TextDecoder,o=n.body.pipeThrough(new TransformStream({transform(i,s){t.mark("firstChunk");let l=r.decode(i,{stream:!0});for(let[u,c]of f4)!t.has(c)&&l.includes(u)&&t.mark(c);s.enqueue(i)}}));return new Response(o,{status:n.status,statusText:n.statusText,headers:n.headers})}catch{return n}},report(n,r){a||(a=!0,Vp("turn",n,r,t.metrics))}}}function p4(e){let t=e.indexOf("?");return t===-1?e:e.slice(0,t)}function A1(e,t){let a=Zw("widget",Yw()),n=!1;return{mark:r=>a.mark(r),has:r=>a.has(r),report(r,o){n||(n=!0,a.set("retries",o),t({widget:p4(e),outcome:r,metrics:a.metrics}))}}}var m4="/api/mcp/events/v2/batch",Qw=new Set;function h4(e,t,a){return`${e}|${t}|${a??""}`}function Cc(e){return Fp(e,m4)}async function M1(e){let{api:t,token:a,channelId:n,mode:r,source:o}=e;if(typeof window>"u"||!t||!a)return;let i=Cc(t);if(!i){Ua("page.viewed skipped: the chat api is not a Waniwani endpoint");return}if(!n&&!o){Ua("page.viewed skipped: no channelId or source to attribute it");return}let s=h4(t,a,n);if(!Qw.has(s)){Qw.add(s);try{let l=await Ic(),u=new Date().toISOString(),c=JSON.stringify({sentAt:u,source:{sdk:"@waniwani/sdk",version:"0.1.0"},events:[{id:crypto.randomUUID(),type:"mcp.event",name:"page.viewed",source:o,timestamp:u,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:{}}]}),d=fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:c,keepalive:!0});Di("pageViewSent"),await d}catch{Qw.delete(s)}}}function R1(e){let t=Cc(e.api);return t?b1({endpoint:t,token:e.token,channelId:e.channelId,source:e.getSource,identity:()=>({sessionId:e.getSessionId(),visitorId:ma()})}):Wp("the chat api does not point at a Waniwani event ingest")}function Wp(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 Xp=j(Ee());var Gp=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var D1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var _1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var ev=e=>{let t=_1(e);return t.charAt(0).toUpperCase()+t.slice(1)};var kc=j(Ee());var P1={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 O1=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var N1=(0,kc.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...s},l)=>(0,kc.createElement)("svg",{ref:l,...P1,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:Gp("lucide",r),...!o&&!O1(s)&&{"aria-hidden":"true"},...s},[...i.map(([u,c])=>(0,kc.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var tt=(e,t)=>{let a=(0,Xp.forwardRef)(({className:n,...r},o)=>(0,Xp.createElement)(N1,{ref:o,iconNode:t,className:Gp(`lucide-${D1(ev(e))}`,`lucide-${e}`,n),...r}));return a.displayName=ev(e),a};var g4=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Tc=tt("arrow-down",g4);var y4=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],pr=tt("arrow-up",y4);var w4=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Lc=tt("check",w4);var v4=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zo=tt("chevron-down",v4);var x4=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ec=tt("chevron-right",x4);var b4=[["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"}]],Ac=tt("clipboard-copy",b4);var S4=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Gr=tt("clock",S4);var I4=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Mc=tt("file-text",I4);var C4=[["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"}]],vl=tt("file",C4);var k4=[["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"}]],Rc=tt("globe",k4);var T4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Dc=tt("image",T4);var L4=[["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"}]],_c=tt("loader",L4);var E4=[["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"}]],xl=tt("paperclip",E4);var A4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Pc=tt("square",A4);var M4=[["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"}]],_i=tt("wrench",M4);var R4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wn=tt("x",R4);var D4=[["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"}]],Oc=tt("zap",D4);var rt=j(Ee(),1),qB=j(gg(),1);var bl=j(Ee(),1),Nc=j(me(),1);function O4(e){return 1-(1-e)**3}function N4({start:e=0,end:t=100,duration:a=1e3,delay:n=0,ease:r=O4,onUpdate:o,onEnd:i}){let s=performance.now()+n;function l(){let u=performance.now()-s,c=Math.min(u/a,1);o(e+(t-e)*r(c)),c<1?requestAnimationFrame(l):i&&i()}setTimeout(()=>requestAnimationFrame(l),n)}var U4=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],B4=[0,1,2,0,1,2,1];function z4(e){let t=[];for(let a=0;a<7;a++){let n=e[Math.min(B4[a],e.length-1)];t.push(`radial-gradient(at ${U4[a]}, ${n} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}var F4=({children:e,className:t="",style:a,edgeSensitivity:n=30,backgroundColor:r="#120F17",borderRadius:o=28,coneSpread:i=25,animated:s=!1,colors:l=["#c084fc","#f472b6","#38bdf8"]})=>{let[u,c]=(0,bl.useState)(110),[d,p]=(0,bl.useState)(0),[m,h]=(0,bl.useState)(!1);(0,bl.useEffect)(()=>{if(!s)return;let E=110;h(!0),c(E),N4({ease:T=>T,duration:2e3,onUpdate:T=>{let R=T/100;c(E+360*R);let O=Math.min(R/.1,1),U=R>.85?(1-R)/.15:1;p(Math.min(O,U))},onEnd:()=>h(!1)})},[s]);let v=n+20,I=m?Math.max(0,(d*100-v)/(100-v)):0,w=z4(l).map(E=>`${E} border-box`),S=`conic-gradient(from ${`${u.toFixed(3)}deg`} at center, black ${i}%, transparent ${i+15}%, transparent ${100-i-15}%, black ${100-i}%)`;return(0,Nc.jsxs)("div",{className:`ww:relative ww:grid ww:isolate ww:border ${t}`,style:{background:r,borderRadius:typeof o=="number"?`${o}px`:o,transform:"translate3d(0, 0, 0.01px)",...a},children:[(0,Nc.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:S,WebkitMaskImage:S,transition:m?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),(0,Nc.jsx)("div",{className:"ww:flex ww:flex-col ww:relative ww:overflow-auto ww:z-[1]",children:e})]})},Yp=F4;tv();nv();var q4=q1({prefix:"ww"});function V(...e){return q4(Zp(e))}var Uc=j(me(),1);function Sl({suggestions:e,isLoading:t,onSelect:a,align:n="start",className:r,...o}){return e.length===0&&!t?null:(0,Uc.jsx)("div",{className:V("ww:px-4 ww:py-2",r),...o,children:(0,Uc.jsx)("div",{className:V("ww:mx-auto ww:w-full ww:max-w-3xl ww:flex ww:flex-wrap ww:gap-2",n==="center"&&"ww:justify-center"),children:t?[0,1,2].map(i=>(0,Uc.jsx)("div",{className:"ww:h-8 ww:rounded-full ww:bg-accent ww:animate-pulse",style:{width:`${60+i*20}px`}},i)):e.map((i,s)=>(0,Uc.jsx)("button",{type:"button",onClick:()=>a(i),className:V("ww:rounded-full ww:border ww:border-border ww:bg-accent ww:px-3.5 ww:py-1.5 ww:text-sm","ww:text-foreground ww:hover:bg-border 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:`${s*50}ms`},children:i},i))})})}var gm=j(Ee(),1);var gL="vercel.ai.error",H4=Symbol.for(gL),H1,j1,Je=class yL extends(j1=Error,H1=H4,j1){constructor({name:t,message:a,cause:n}){super(a),this[H1]=!0,this.name=t,this.cause=n}static isInstance(t){return yL.hasMarker(t,gL)}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}},wL="AI_APICallError",vL=`vercel.ai.error.${wL}`,j4=Symbol.for(vL),V1,$1,WQ=class extends($1=Je,V1=j4,$1){constructor({message:e,url:t,requestBodyValues:a,statusCode:n,responseHeaders:r,responseBody:o,cause:i,isRetryable:s=n!=null&&(n===408||n===409||n===429||n>=500),data:l}){super({name:wL,message:e,cause:i}),this[V1]=!0,this.url=t,this.requestBodyValues=a,this.statusCode=n,this.responseHeaders=r,this.responseBody=o,this.isRetryable=s,this.data=l}static isInstance(e){return Je.hasMarker(e,vL)}},xL="AI_EmptyResponseBodyError",bL=`vercel.ai.error.${xL}`,V4=Symbol.for(bL),W1,G1,GQ=class extends(G1=Je,W1=V4,G1){constructor({message:e="Empty response body"}={}){super({name:xL,message:e}),this[W1]=!0}static isInstance(e){return Je.hasMarker(e,bL)}};function SL(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var IL="AI_InvalidArgumentError",CL=`vercel.ai.error.${IL}`,$4=Symbol.for(CL),X1,K1,kL=class extends(K1=Je,X1=$4,K1){constructor({message:e,cause:t,argument:a}){super({name:IL,message:e,cause:t}),this[X1]=!0,this.argument=a}static isInstance(e){return Je.hasMarker(e,CL)}},TL="AI_InvalidPromptError",LL=`vercel.ai.error.${TL}`,W4=Symbol.for(LL),Y1,Z1,XQ=class extends(Z1=Je,Y1=W4,Z1){constructor({prompt:e,message:t,cause:a}){super({name:TL,message:`Invalid prompt: ${t}`,cause:a}),this[Y1]=!0,this.prompt=e}static isInstance(e){return Je.hasMarker(e,LL)}},EL="AI_InvalidResponseDataError",AL=`vercel.ai.error.${EL}`,G4=Symbol.for(AL),J1,Q1,KQ=class extends(Q1=Je,J1=G4,Q1){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:EL,message:t}),this[J1]=!0,this.data=e}static isInstance(e){return Je.hasMarker(e,AL)}},ML="AI_JSONParseError",RL=`vercel.ai.error.${ML}`,X4=Symbol.for(RL),eL,tL,ov=class extends(tL=Je,eL=X4,tL){constructor({text:e,cause:t}){super({name:ML,message:`JSON parsing failed: Text: ${e}.
|
|
122
|
+
Error message: ${SL(t)}`,cause:t}),this[eL]=!0,this.text=e}static isInstance(e){return Je.hasMarker(e,RL)}},DL="AI_LoadAPIKeyError",_L=`vercel.ai.error.${DL}`,K4=Symbol.for(_L),aL,nL,YQ=class extends(nL=Je,aL=K4,nL){constructor({message:e}){super({name:DL,message:e}),this[aL]=!0}static isInstance(e){return Je.hasMarker(e,_L)}},PL="AI_LoadSettingError",OL=`vercel.ai.error.${PL}`,Y4=Symbol.for(OL),rL,oL,ZQ=class extends(oL=Je,rL=Y4,oL){constructor({message:e}){super({name:PL,message:e}),this[rL]=!0}static isInstance(e){return Je.hasMarker(e,OL)}},NL="AI_NoContentGeneratedError",UL=`vercel.ai.error.${NL}`,Z4=Symbol.for(UL),iL,sL,JQ=class extends(sL=Je,iL=Z4,sL){constructor({message:e="No content generated."}={}){super({name:NL,message:e}),this[iL]=!0}static isInstance(e){return Je.hasMarker(e,UL)}},BL="AI_NoSuchModelError",zL=`vercel.ai.error.${BL}`,J4=Symbol.for(zL),lL,uL,QQ=class extends(uL=Je,lL=J4,uL){constructor({errorName:e=BL,modelId:t,modelType:a,message:n=`No such ${a}: ${t}`}){super({name:e,message:n}),this[lL]=!0,this.modelId=t,this.modelType=a}static isInstance(e){return Je.hasMarker(e,zL)}},FL="AI_TooManyEmbeddingValuesForCallError",qL=`vercel.ai.error.${FL}`,Q4=Symbol.for(qL),cL,dL,eee=class extends(dL=Je,cL=Q4,dL){constructor(e){super({name:FL,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[cL]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return Je.hasMarker(e,qL)}},HL="AI_TypeValidationError",jL=`vercel.ai.error.${HL}`,e5=Symbol.for(jL),fL,pL,Kn=class rv extends(pL=Je,fL=e5,pL){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:HL,message:`${r}: Value: ${JSON.stringify(t)}.
|
|
123
|
+
Error message: ${SL(a)}`,cause:a}),this[fL]=!0,this.value=t,this.context=n}static isInstance(t){return Je.hasMarker(t,jL)}static wrap({value:t,cause:a,context:n}){var r,o,i;return rv.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&&((i=a.context)==null?void 0:i.entityId)===n?.entityId?a:new rv({value:t,cause:a,context:n})}},VL="AI_UnsupportedFunctionalityError",$L=`vercel.ai.error.${VL}`,t5=Symbol.for($L),mL,hL,tee=class extends(hL=Je,mL=t5,hL){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:VL,message:t}),this[mL]=!0,this.functionality=e}static isInstance(e){return Je.hasMarker(e,$L)}};var Jp=()=>sv,sv=new Proxy(Jp,{get(e,t){return t==="parse"||t==="parseAsync"?a=>a:t==="safeParse"||t==="safeParseAsync"?a=>({success:!0,data:a}):t==="_def"?{}:t==="jsonSchema"?{}:Jp},apply(){return sv}}),iv=class extends Error{constructor(){super(...arguments);K(this,"issues",[])}},f=new Proxy(Jp,{get(e,t){return t==="ZodError"?iv:t==="NEVER"?Symbol("NEVER"):Jp},apply(){return sv}});var Me={};var Qp=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 lv(e){}function WL(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=lv,onError:a=lv,onRetry:n=lv,onComment:r}=e,o="",i=!0,s,l="",u="";function c(v){let I=i?v.replace(/^\xEF\xBB\xBF/,""):v,[y,w]=a5(`${o}${I}`);for(let g of y)d(g);o=w,i=!1}function d(v){if(v===""){m();return}if(v.startsWith(":")){r&&r(v.slice(v.startsWith(": ")?2:1));return}let I=v.indexOf(":");if(I!==-1){let y=v.slice(0,I),w=v[I+1]===" "?2:1,g=v.slice(I+w);p(y,g,v);return}p(v,"",v)}function p(v,I,y){switch(v){case"event":u=I;break;case"data":l=`${l}${I}
|
|
124
|
+
`;break;case"id":s=I.includes("\0")?void 0:I;break;case"retry":/^\d+$/.test(I)?n(parseInt(I,10)):a(new Qp(`Invalid \`retry\` value: "${I}"`,{type:"invalid-retry",value:I,line:y}));break;default:a(new Qp(`Unknown field "${v.length>20?`${v.slice(0,20)}\u2026`:v}"`,{type:"unknown-field",field:v,value:I,line:y}));break}}function m(){l.length>0&&t({id:s,event:u||void 0,data:l.endsWith(`
|
|
125
|
+
`)?l.slice(0,-1):l}),s=void 0,l="",u=""}function h(v={}){o&&v.consume&&d(o),i=!0,s=void 0,l="",u="",o=""}return{feed:c,reset:h}}function a5(e){let t=[],a="",n=0;for(;n<e.length;){let r=e.indexOf("\r",n),o=e.indexOf(`
|
|
126
126
|
`,n),i=-1;if(r!==-1&&o!==-1?i=Math.min(r,o):r!==-1?r===e.length-1?i=-1:i=r:o!==-1&&(i=o),i===-1){a=e.slice(n);break}else{let s=e.slice(n,i);t.push(s),n=i+1,e[n-1]==="\r"&&e[n]===`
|
|
127
|
-
`&&n++}}return[t,a]}var Jp=class extends TransformStream{constructor({onError:t,onRetry:a,onComment:n}={}){let r;super({start(o){r=VL({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:yee,atob:wee}=globalThis;var YL="AI_DownloadError",ZL=`vercel.ai.error.${YL}`,t5=Symbol.for(ZL),$L,WL,Un=class extends(WL=Je,$L=t5,WL){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:YL,message:r,cause:n}),this[$L]=!0,this.url=e,this.statusCode=t,this.statusText=a}static isInstance(e){return Je.hasMarker(e,ZL)}},fv=2*1024*1024*1024;async function JL({response:e,url:t,maxBytes:a=fv}){let n=e.headers.get("content-length");if(n!=null){let c=parseInt(n,10);if(!isNaN(c)&&c>a)throw new Un({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=[],s=0;try{for(;;){let{done:c,value:d}=await o.read();if(c)break;if(s+=d.length,s>a)throw new Un({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes.`});i.push(d)}}finally{try{await o.cancel()}finally{o.releaseLock()}}let l=new Uint8Array(s),u=0;for(let c of i)l.set(c,u),u+=c.length;return l}function pv(e){let t;try{t=new URL(e)}catch{throw new Un({url:e,message:`Invalid URL: ${e}`})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Un({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let a=t.hostname;if(!a)throw new Un({url:e,message:"URL must have a hostname"});if(a==="localhost"||a.endsWith(".local")||a.endsWith(".localhost"))throw new Un({url:e,message:`URL with hostname ${a} is not allowed`});if(a.startsWith("[")&&a.endsWith("]")){let n=a.slice(1,-1);if(a5(n))throw new Un({url:e,message:`URL with IPv6 address ${a} is not allowed`});return}if(QL(a)){if(uv(a))throw new Un({url:e,message:`URL with IP address ${a} is not allowed`});return}}function QL(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 uv(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 a5(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let a=t.slice(7);if(QL(a))return uv(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,s=r&255,l=o>>8&255,u=o&255;return uv(`${i}.${s}.${l}.${u}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}var gr=({prefix:e,size:t=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let r=()=>{let o=a.length,i=new Array(t);for(let s=0;s<t;s++)i[s]=a[Math.random()*o|0];return i.join("")};if(e==null)return r;if(a.includes(n))throw new IL({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${a}".`});return()=>`${e}${n}${r()}`},mv=gr();function eE(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 Fo(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 Qp(e,...t){let a=new Headers(Fo(e)),n=a.get("user-agent")||"";return a.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var n5=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,r5=/"(?: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 GL(e){let t=JSON.parse(e);return t===null||typeof t!="object"||n5.test(e)===!1&&r5.test(e)===!1?t:o5(t)}function o5(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 i5(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return GL(e)}try{return GL(e)}finally{Error.stackTraceLimit=t}}function hv(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]=Pi(a[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(Pi):Pi(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(Pi)),e.allOf!=null&&(e.allOf=e.allOf.map(Pi)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(Pi));let{definitions:t}=e;if(t!=null)for(let a of Object.keys(t))t[a]=Pi(t[a]);return e}function Pi(e){return typeof e=="boolean"?e:hv(e)}var s5=Symbol("Let zodToJsonSchema decide on which parser to use"),XL={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"},l5=e=>typeof e=="string"?{...XL,name:e}:{...XL,...e};function vn(){return{}}function u5(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)!==Me.ZodAny&&(o.items=pt(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 c5(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 d5(){return{type:"boolean"}}function tE(e,t){return pt(e.type._def,t)}var f5=(e,t)=>pt(e.innerType._def,t);function aE(e,t,a){let n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,o)=>aE(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 p5(e)}}var p5=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 m5(e,t){return{...pt(e.innerType._def,t),default:e.defaultValue()}}function h5(e,t){return t.effectStrategy==="input"?pt(e.schema._def,t):vn()}function g5(e){return{type:"string",enum:Array.from(e.values)}}var y5=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function w5(e,t){let a=[pt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),pt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),n=[];return a.forEach(r=>{if(y5(r))n.push(...r.allOf);else{let o=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:i,...s}=r;o=s}n.push(o)}}),n.length?{allOf:n}:void 0}function v5(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 sv=void 0,Zn={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:()=>(sv===void 0&&(sv=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),sv),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 nE(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":Jn(a,"email",n.message,t);break;case"format:idn-email":Jn(a,"idn-email",n.message,t);break;case"pattern:zod":Ua(a,Zn.email,n.message,t);break}break;case"url":Jn(a,"uri",n.message,t);break;case"uuid":Jn(a,"uuid",n.message,t);break;case"regex":Ua(a,n.regex,n.message,t);break;case"cuid":Ua(a,Zn.cuid,n.message,t);break;case"cuid2":Ua(a,Zn.cuid2,n.message,t);break;case"startsWith":Ua(a,RegExp(`^${lv(n.value,t)}`),n.message,t);break;case"endsWith":Ua(a,RegExp(`${lv(n.value,t)}$`),n.message,t);break;case"datetime":Jn(a,"date-time",n.message,t);break;case"date":Jn(a,"date",n.message,t);break;case"time":Jn(a,"time",n.message,t);break;case"duration":Jn(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":{Ua(a,RegExp(lv(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&Jn(a,"ipv4",n.message,t),n.version!=="v4"&&Jn(a,"ipv6",n.message,t);break}case"base64url":Ua(a,Zn.base64url,n.message,t);break;case"jwt":Ua(a,Zn.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&Ua(a,Zn.ipv4Cidr,n.message,t),n.version!=="v4"&&Ua(a,Zn.ipv6Cidr,n.message,t);break}case"emoji":Ua(a,Zn.emoji(),n.message,t);break;case"ulid":{Ua(a,Zn.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Jn(a,"binary",n.message,t);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{Ua(a,Zn.base64,n.message,t);break}}break}case"nanoid":Ua(a,Zn.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return a}function lv(e,t){return t.patternStrategy==="escape"?b5(e):e}var x5=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function b5(e){let t="";for(let a=0;a<e.length;a++)x5.has(e[a])||(t+="\\"),t+=e[a];return t}function Jn(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 Ua(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:KL(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):e.pattern=KL(t,n)}function KL(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,s=!1,l=!1;for(let u=0;u<r.length;u++){if(i){o+=r[u],i=!1;continue}if(n.i){if(s){if(r[u].match(/[a-z]/)){l?(o+=r[u],o+=`${r[u-2]}-${r[u]}`.toUpperCase(),l=!1):r[u+1]==="-"&&((a=r[u+2])!=null&&a.match(/[a-z]/))?(o+=r[u],l=!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
|
|
127
|
+
`&&n++}}return[t,a]}var em=class extends TransformStream{constructor({onError:t,onRetry:a,onComment:n}={}){let r;super({start(o){r=WL({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:vee,atob:xee}=globalThis;var JL="AI_DownloadError",QL=`vercel.ai.error.${JL}`,n5=Symbol.for(QL),GL,XL,On=class extends(XL=Je,GL=n5,XL){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:JL,message:r,cause:n}),this[GL]=!0,this.url=e,this.statusCode=t,this.statusText=a}static isInstance(e){return Je.hasMarker(e,QL)}},mv=2*1024*1024*1024;async function eE({response:e,url:t,maxBytes:a=mv}){let n=e.headers.get("content-length");if(n!=null){let c=parseInt(n,10);if(!isNaN(c)&&c>a)throw new On({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=[],s=0;try{for(;;){let{done:c,value:d}=await o.read();if(c)break;if(s+=d.length,s>a)throw new On({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes.`});i.push(d)}}finally{try{await o.cancel()}finally{o.releaseLock()}}let l=new Uint8Array(s),u=0;for(let c of i)l.set(c,u),u+=c.length;return l}function hv(e){let t;try{t=new URL(e)}catch{throw new On({url:e,message:`Invalid URL: ${e}`})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new On({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let a=t.hostname;if(!a)throw new On({url:e,message:"URL must have a hostname"});if(a==="localhost"||a.endsWith(".local")||a.endsWith(".localhost"))throw new On({url:e,message:`URL with hostname ${a} is not allowed`});if(a.startsWith("[")&&a.endsWith("]")){let n=a.slice(1,-1);if(r5(n))throw new On({url:e,message:`URL with IPv6 address ${a} is not allowed`});return}if(tE(a)){if(dv(a))throw new On({url:e,message:`URL with IP address ${a} is not allowed`});return}}function tE(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 dv(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 r5(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let a=t.slice(7);if(tE(a))return dv(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,s=r&255,l=o>>8&255,u=o&255;return dv(`${i}.${s}.${l}.${u}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}var mr=({prefix:e,size:t=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let r=()=>{let o=a.length,i=new Array(t);for(let s=0;s<t;s++)i[s]=a[Math.random()*o|0];return i.join("")};if(e==null)return r;if(a.includes(n))throw new kL({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${a}".`});return()=>`${e}${n}${r()}`},gv=mr();function aE(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 Fo(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 tm(e,...t){let a=new Headers(Fo(e)),n=a.get("user-agent")||"";return a.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var o5=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i5=/"(?: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 KL(e){let t=JSON.parse(e);return t===null||typeof t!="object"||o5.test(e)===!1&&i5.test(e)===!1?t:s5(t)}function s5(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 l5(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return KL(e)}try{return KL(e)}finally{Error.stackTraceLimit=t}}function yv(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]=Pi(a[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(Pi):Pi(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(Pi)),e.allOf!=null&&(e.allOf=e.allOf.map(Pi)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(Pi));let{definitions:t}=e;if(t!=null)for(let a of Object.keys(t))t[a]=Pi(t[a]);return e}function Pi(e){return typeof e=="boolean"?e:yv(e)}var u5=Symbol("Let zodToJsonSchema decide on which parser to use"),YL={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"},c5=e=>typeof e=="string"?{...YL,name:e}:{...YL,...e};function vn(){return{}}function d5(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)!==Me.ZodAny&&(o.items=pt(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 f5(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 p5(){return{type:"boolean"}}function nE(e,t){return pt(e.type._def,t)}var m5=(e,t)=>pt(e.innerType._def,t);function rE(e,t,a){let n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,o)=>rE(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 h5(e)}}var h5=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 g5(e,t){return{...pt(e.innerType._def,t),default:e.defaultValue()}}function y5(e,t){return t.effectStrategy==="input"?pt(e.schema._def,t):vn()}function w5(e){return{type:"string",enum:Array.from(e.values)}}var v5=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function x5(e,t){let a=[pt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),pt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),n=[];return a.forEach(r=>{if(v5(r))n.push(...r.allOf);else{let o=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:i,...s}=r;o=s}n.push(o)}}),n.length?{allOf:n}:void 0}function b5(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 uv=void 0,Yn={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:()=>(uv===void 0&&(uv=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),uv),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 oE(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":Zn(a,"email",n.message,t);break;case"format:idn-email":Zn(a,"idn-email",n.message,t);break;case"pattern:zod":Ba(a,Yn.email,n.message,t);break}break;case"url":Zn(a,"uri",n.message,t);break;case"uuid":Zn(a,"uuid",n.message,t);break;case"regex":Ba(a,n.regex,n.message,t);break;case"cuid":Ba(a,Yn.cuid,n.message,t);break;case"cuid2":Ba(a,Yn.cuid2,n.message,t);break;case"startsWith":Ba(a,RegExp(`^${cv(n.value,t)}`),n.message,t);break;case"endsWith":Ba(a,RegExp(`${cv(n.value,t)}$`),n.message,t);break;case"datetime":Zn(a,"date-time",n.message,t);break;case"date":Zn(a,"date",n.message,t);break;case"time":Zn(a,"time",n.message,t);break;case"duration":Zn(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":{Ba(a,RegExp(cv(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&Zn(a,"ipv4",n.message,t),n.version!=="v4"&&Zn(a,"ipv6",n.message,t);break}case"base64url":Ba(a,Yn.base64url,n.message,t);break;case"jwt":Ba(a,Yn.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&Ba(a,Yn.ipv4Cidr,n.message,t),n.version!=="v4"&&Ba(a,Yn.ipv6Cidr,n.message,t);break}case"emoji":Ba(a,Yn.emoji(),n.message,t);break;case"ulid":{Ba(a,Yn.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Zn(a,"binary",n.message,t);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{Ba(a,Yn.base64,n.message,t);break}}break}case"nanoid":Ba(a,Yn.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return a}function cv(e,t){return t.patternStrategy==="escape"?I5(e):e}var S5=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function I5(e){let t="";for(let a=0;a<e.length;a++)S5.has(e[a])||(t+="\\"),t+=e[a];return t}function Zn(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 Ba(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:ZL(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):e.pattern=ZL(t,n)}function ZL(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,s=!1,l=!1;for(let u=0;u<r.length;u++){if(i){o+=r[u],i=!1;continue}if(n.i){if(s){if(r[u].match(/[a-z]/)){l?(o+=r[u],o+=`${r[u-2]}-${r[u]}`.toUpperCase(),l=!1):r[u+1]==="-"&&((a=r[u+2])!=null&&a.match(/[a-z]/))?(o+=r[u],l=!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
|
|
128
128
|
]))`;continue}else if(r[u]==="$"){o+=`($|(?=[\r
|
|
129
129
|
]))`;continue}}if(n.s&&r[u]==="."){o+=s?`${r[u]}\r
|
|
130
130
|
`:`[${r[u]}\r
|
|
131
|
-
]`;continue}o+=r[u],r[u]==="\\"?i=!0:s&&r[u]==="]"?s=!1:!s&&r[u]==="["&&(s=!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 rE(e,t){var a,n,r,o,i,s;let l={type:"object",additionalProperties:(a=pt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?a:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===Me.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...c}=nE(e.keyType._def,t);return{...l,propertyNames:c}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===Me.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===Me.ZodBranded&&e.keyType._def.type._def.typeName===Me.ZodString&&((s=e.keyType._def.type._def.checks)!=null&&s.length)){let{type:u,...c}=tE(e.keyType._def,t);return{...l,propertyNames:c}}}return l}function S5(e,t){if(t.mapStrategy==="record")return rE(e,t);let a=pt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||vn(),n=pt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||vn();return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function I5(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 C5(){return{not:vn()}}function k5(){return{type:"null"}}var cv={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function T5(e,t){let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in cv&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let i=cv[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,s)=>s.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 L5(e,t)}var L5=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>pt(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 E5(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[cv[e.innerType._def.typeName],"null"]};let a=pt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function A5(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 M5(e,t){let a={type:"object",properties:{}},n=[],r=e.shape();for(let i in r){let s=r[i];if(s===void 0||s._def===void 0)continue;let l=D5(s),u=pt(s._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(a.properties[i]=u,l||n.push(i))}n.length&&(a.required=n);let o=R5(e,t);return o!==void 0&&(a.additionalProperties=o),a}function R5(e,t){if(e.catchall._def.typeName!=="ZodNever")return pt(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 D5(e){try{return e.isOptional()}catch{return!0}}var _5=(e,t)=>{var a;if(t.currentPath.toString()===((a=t.propertyPath)==null?void 0:a.toString()))return pt(e.innerType._def,t);let n=pt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:vn()},n]}:vn()},P5=(e,t)=>{if(t.pipeStrategy==="input")return pt(e.in._def,t);if(t.pipeStrategy==="output")return pt(e.out._def,t);let a=pt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=pt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function O5(e,t){return pt(e.type._def,t)}function N5(e,t){let n={type:"array",uniqueItems:!0,items:pt(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 U5(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>pt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:pt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>pt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function B5(){return{not:vn()}}function z5(){return vn()}var F5=(e,t)=>pt(e.innerType._def,t),q5=(e,t,a)=>{switch(t){case Me.ZodString:return nE(e,a);case Me.ZodNumber:return A5(e);case Me.ZodObject:return M5(e,a);case Me.ZodBigInt:return c5(e);case Me.ZodBoolean:return d5();case Me.ZodDate:return aE(e,a);case Me.ZodUndefined:return B5();case Me.ZodNull:return k5();case Me.ZodArray:return u5(e,a);case Me.ZodUnion:case Me.ZodDiscriminatedUnion:return T5(e,a);case Me.ZodIntersection:return w5(e,a);case Me.ZodTuple:return U5(e,a);case Me.ZodRecord:return rE(e,a);case Me.ZodLiteral:return v5(e);case Me.ZodEnum:return g5(e);case Me.ZodNativeEnum:return I5(e);case Me.ZodNullable:return E5(e,a);case Me.ZodOptional:return _5(e,a);case Me.ZodMap:return S5(e,a);case Me.ZodSet:return N5(e,a);case Me.ZodLazy:return()=>e.getter()._def;case Me.ZodPromise:return O5(e,a);case Me.ZodNaN:case Me.ZodNever:return C5();case Me.ZodEffects:return h5(e,a);case Me.ZodAny:return vn();case Me.ZodUnknown:return z5();case Me.ZodDefault:return m5(e,a);case Me.ZodBranded:return tE(e,a);case Me.ZodReadonly:return F5(e,a);case Me.ZodCatch:return f5(e,a);case Me.ZodPipeline:return P5(e,a);case Me.ZodFunction:case Me.ZodVoid:case Me.ZodSymbol:return;default:return(n=>{})(t)}},H5=(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 pt(e,t,a=!1){var n;let r=t.seen.get(e);if(t.override){let l=(n=t.override)==null?void 0:n.call(t,e,t,r,a);if(l!==s5)return l}if(r&&!a){let l=j5(r,t);if(l!==void 0)return l}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=q5(e,e.typeName,t),s=typeof i=="function"?pt(i(),t):i;if(s&&V5(e,t,s),t.postProcess){let l=t.postProcess(s,e,t);return o.jsonSchema=s,l}return o.jsonSchema=s,s}var j5=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:H5(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`),vn()):t.$refStrategy==="seen"?vn():void 0}},V5=(e,t,a)=>(e.description&&(a.description=e.description),a),$5=e=>{let t=l5(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}]))}},W5=(e,t)=>{var a;let n=$5(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[c,d])=>{var p;return{...u,[c]:(p=pt(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0))!=null?p:vn()}},{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(a=pt(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1))!=null?a:vn(),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(i.title=s);let l=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 l.$schema="http://json-schema.org/draft-07/schema#",l},dv=Symbol.for("vercel.ai.schema");function em(e){let t;return()=>(t==null&&(t=e()),t)}function Il(e,{validate:t}={}){return{[dv]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function G5(e){return typeof e=="object"&&e!==null&&dv in e&&e[dv]===!0&&"jsonSchema"in e&&"validate"in e}function Oi(e){return e==null?Il({properties:{},additionalProperties:!1}):G5(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?Cl(e):X5(e):e()}function X5(e){return Il(()=>hv(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 Yn({value:t,cause:a.issues})}}})}function K5(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Il(()=>W5(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 Y5(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Il(()=>hv((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 Z5(e){return"_zod"in e}function Cl(e,t){return Z5(e)?Y5(e,t):K5(e,t)}async function tm({value:e,schema:t,context:a}){let n=await kl({value:e,schema:t,context:a});if(!n.success)throw Yn.wrap({value:e,cause:n.error,context:a});return n.value}async function kl({value:e,schema:t,context:a}){let n=Oi(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:Yn.wrap({value:e,cause:r.error,context:a}),rawValue:e}}catch(r){return{success:!1,error:Yn.wrap({value:e,cause:r,context:a}),rawValue:e}}}async function Yr({text:e,schema:t}){try{let a=i5(e);return t==null?{success:!0,value:a,rawValue:a}:await kl({value:a,schema:t})}catch(a){return{success:!1,error:nv.isInstance(a)?a:new nv({text:e,cause:a}),rawValue:void 0}}}function gv({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Jp).pipeThrough(new TransformStream({async transform({data:a},n){a!=="[DONE]"&&n.enqueue(await Yr({text:a,schema:t}))}}))}async function yr(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var Q5=Object.defineProperty,eH=(e,t)=>{for(var a in t)Q5(e,a,{get:t[a],enumerable:!0})},tH="AI_InvalidArgumentError",aH=`vercel.ai.error.${tH}`,nH=Symbol.for(aH),rH;rH=nH;var oH="AI_InvalidStreamPartError",iH=`vercel.ai.error.${oH}`,sH=Symbol.for(iH),lH;lH=sH;var uH="AI_InvalidToolApprovalError",cH=`vercel.ai.error.${uH}`,dH=Symbol.for(cH),fH;fH=dH;var pH="AI_InvalidToolInputError",mH=`vercel.ai.error.${pH}`,hH=Symbol.for(mH),gH;gH=hH;var yH="AI_ToolCallNotFoundForApprovalError",wH=`vercel.ai.error.${yH}`,vH=Symbol.for(wH),xH;xH=vH;var bH="AI_MissingToolResultsError",SH=`vercel.ai.error.${bH}`,IH=Symbol.for(SH),CH;CH=IH;var kH="AI_NoImageGeneratedError",TH=`vercel.ai.error.${kH}`,LH=Symbol.for(TH),EH;EH=LH;var iE="AI_NoObjectGeneratedError",sE=`vercel.ai.error.${iE}`,AH=Symbol.for(sE),lE,qo=class extends Je{constructor({message:e="No object generated.",cause:t,text:a,response:n,usage:r,finishReason:o}){super({name:iE,message:e,cause:t}),this[lE]=!0,this.text=a,this.response=n,this.usage=r,this.finishReason=o}static isInstance(e){return Je.hasMarker(e,sE)}};lE=AH;var MH="AI_NoOutputGeneratedError",RH=`vercel.ai.error.${MH}`,DH=Symbol.for(RH),_H;_H=DH;var PH="AI_NoSpeechGeneratedError",OH=`vercel.ai.error.${PH}`,NH=Symbol.for(OH),UH;UH=NH;var BH="AI_NoTranscriptGeneratedError",zH=`vercel.ai.error.${BH}`,FH=Symbol.for(zH),qH;qH=FH;var HH="AI_NoVideoGeneratedError",jH=`vercel.ai.error.${HH}`,VH=Symbol.for(jH),$H;$H=VH;var WH="AI_NoSuchToolError",GH=`vercel.ai.error.${WH}`,XH=Symbol.for(GH),KH;KH=XH;var YH="AI_ToolCallRepairError",ZH=`vercel.ai.error.${YH}`,JH=Symbol.for(ZH),QH;QH=JH;var uE="AI_UIMessageStreamError",cE=`vercel.ai.error.${uE}`,e6=Symbol.for(cE),dE,Tl=class extends Je{constructor({chunkType:e,chunkId:t,message:a}){super({name:uE,message:a}),this[dE]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Je.hasMarker(e,cE)}};dE=e6;var t6="AI_InvalidDataContentError",a6=`vercel.ai.error.${t6}`,n6=Symbol.for(a6),r6;r6=n6;var o6="AI_InvalidMessageRoleError",i6=`vercel.ai.error.${o6}`,s6=Symbol.for(i6),l6;l6=s6;var u6="AI_MessageConversionError",c6=`vercel.ai.error.${u6}`,d6=Symbol.for(c6),f6;f6=d6;var p6="AI_RetryError",m6=`vercel.ai.error.${p6}`,h6=Symbol.for(m6),g6;g6=h6;var y6="6.0.141",w6=async({url:e,maxBytes:t,abortSignal:a})=>{var n;let r=e.toString();pv(r);try{let o=await fetch(r,{headers:Qp({},`ai-sdk/${y6}`,eE()),signal:a});if(o.redirected&&pv(o.url),!o.ok)throw new Un({url:r,statusCode:o.status,statusText:o.statusText});return{data:await JL({response:o,url:r,maxBytes:t??fv}),mediaType:(n=o.headers.get("content-type"))!=null?n:void 0}}catch(o){throw Un.isInstance(o)?o:new Un({url:r,cause:o})}};var fE=f.union([f.string(),f.instanceof(Uint8Array),f.instanceof(ArrayBuffer),f.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 Bc=f.lazy(()=>f.union([f.null(),f.string(),f.number(),f.boolean(),f.record(f.string(),Bc.optional()),f.array(Bc)])),me=f.record(f.string(),f.record(f.string(),Bc.optional())),pE=f.object({type:f.literal("text"),text:f.string(),providerOptions:me.optional()}),v6=f.object({type:f.literal("image"),image:f.union([fE,f.instanceof(URL)]),mediaType:f.string().optional(),providerOptions:me.optional()}),mE=f.object({type:f.literal("file"),data:f.union([fE,f.instanceof(URL)]),filename:f.string().optional(),mediaType:f.string(),providerOptions:me.optional()}),x6=f.object({type:f.literal("reasoning"),text:f.string(),providerOptions:me.optional()}),b6=f.object({type:f.literal("tool-call"),toolCallId:f.string(),toolName:f.string(),input:f.unknown(),providerOptions:me.optional(),providerExecuted:f.boolean().optional()}),S6=f.discriminatedUnion("type",[f.object({type:f.literal("text"),value:f.string(),providerOptions:me.optional()}),f.object({type:f.literal("json"),value:Bc,providerOptions:me.optional()}),f.object({type:f.literal("execution-denied"),reason:f.string().optional(),providerOptions:me.optional()}),f.object({type:f.literal("error-text"),value:f.string(),providerOptions:me.optional()}),f.object({type:f.literal("error-json"),value:Bc,providerOptions:me.optional()}),f.object({type:f.literal("content"),value:f.array(f.union([f.object({type:f.literal("text"),text:f.string(),providerOptions:me.optional()}),f.object({type:f.literal("media"),data:f.string(),mediaType:f.string()}),f.object({type:f.literal("file-data"),data:f.string(),mediaType:f.string(),filename:f.string().optional(),providerOptions:me.optional()}),f.object({type:f.literal("file-url"),url:f.string(),providerOptions:me.optional()}),f.object({type:f.literal("file-id"),fileId:f.union([f.string(),f.record(f.string(),f.string())]),providerOptions:me.optional()}),f.object({type:f.literal("image-data"),data:f.string(),mediaType:f.string(),providerOptions:me.optional()}),f.object({type:f.literal("image-url"),url:f.string(),providerOptions:me.optional()}),f.object({type:f.literal("image-file-id"),fileId:f.union([f.string(),f.record(f.string(),f.string())]),providerOptions:me.optional()}),f.object({type:f.literal("custom"),providerOptions:me.optional()})]))})]),hE=f.object({type:f.literal("tool-result"),toolCallId:f.string(),toolName:f.string(),output:S6,providerOptions:me.optional()}),I6=f.object({type:f.literal("tool-approval-request"),approvalId:f.string(),toolCallId:f.string()}),C6=f.object({type:f.literal("tool-approval-response"),approvalId:f.string(),approved:f.boolean(),reason:f.string().optional()}),k6=f.object({role:f.literal("system"),content:f.string(),providerOptions:me.optional()}),T6=f.object({role:f.literal("user"),content:f.union([f.string(),f.array(f.union([pE,v6,mE]))]),providerOptions:me.optional()}),L6=f.object({role:f.literal("assistant"),content:f.union([f.string(),f.array(f.union([pE,mE,x6,b6,hE,I6]))]),providerOptions:me.optional()}),E6=f.object({role:f.literal("tool"),content:f.array(f.union([hE,C6])),providerOptions:me.optional()}),Wee=f.union([k6,T6,L6,E6]);function gE(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),s=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);i&&s?a[n]=gE(o,r):a[n]=r}return a}var A6={};eH(A6,{array:()=>_6,choice:()=>P6,json:()=>O6,object:()=>D6,text:()=>R6});function M6(e){let t=["ROOT"],a=-1,n=null;function r(l,u,c){switch(l){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(l,u){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=u,t.pop();break}}}function i(l,u){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=u,t.pop();break}}}for(let l=0;l<e.length;l++){let u=e[l];switch(t[t.length-1]){case"ROOT":r(u,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{a=l,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,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(u,l);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),a=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:a=l}break}case"INSIDE_ARRAY_START":{u==="]"?(a=l,t.pop()):(a=l,r(u,l,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=l,t.pop();break}default:{a=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(u,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),a=l;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=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{let d=e.substring(n,l+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(u,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,l)):a=l;break}}}let s=e.slice(0,a+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{s+='"';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":{s+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{s+="]";break}case"INSIDE_LITERAL":{let c=e.substring(n,e.length);"true".startsWith(c)?s+="true".slice(c.length):"false".startsWith(c)?s+="false".slice(c.length):"null".startsWith(c)&&(s+="null".slice(c.length))}}return s}async function zc(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await Yr({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await Yr({text:M6(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var R6=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),D6=({schema:e,name:t,description:a})=>{let n=Oi(e);return{name:"object",responseFormat:yr(n.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){let i=await Yr({text:r});if(!i.success)throw new qo({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let s=await kl({value:i.value,schema:n});if(!s.success)throw new qo({message:"No object generated: response did not match schema.",cause:s.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});return s.value},async parsePartialOutput({text:r}){let o=await zc(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},_6=({element:e,name:t,description:a})=>{let n=Oi(e);return{name:"array",responseFormat:yr(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 Yr({text:r});if(!i.success)throw new qo({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let s=i.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))throw new qo({message:"No object generated: response did not match schema.",cause:new Yn({value:s,cause:"response must be an object with an elements array"}),text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});for(let l of s.elements){let u=await kl({value:l,schema:n});if(!u.success)throw new qo({message:"No object generated: response did not match schema.",cause:u.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason})}return s.elements},async parsePartialOutput({text:r}){let o=await zc(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 s=o.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,l=[];for(let u of s){let c=await kl({value:u,schema:n});c.success&&l.push(c.value)}return{partial:l}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:o},i){if(o!=null)for(;r<o.length;r++)i.enqueue(o[r])}})}}},P6=({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 Yr({text:n});if(!o.success)throw new qo({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 qo({message:"No object generated: response did not match schema.",cause:new Yn({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 zc(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(s=>s.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(){}}),O6=({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 Yr({text:a});if(!r.success)throw new qo({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 zc(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 Yee=gr({prefix:"aitxt",size:24});var Jee=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
|
|
131
|
+
]`;continue}o+=r[u],r[u]==="\\"?i=!0:s&&r[u]==="]"?s=!1:!s&&r[u]==="["&&(s=!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 iE(e,t){var a,n,r,o,i,s;let l={type:"object",additionalProperties:(a=pt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?a:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===Me.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...c}=oE(e.keyType._def,t);return{...l,propertyNames:c}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===Me.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===Me.ZodBranded&&e.keyType._def.type._def.typeName===Me.ZodString&&((s=e.keyType._def.type._def.checks)!=null&&s.length)){let{type:u,...c}=nE(e.keyType._def,t);return{...l,propertyNames:c}}}return l}function C5(e,t){if(t.mapStrategy==="record")return iE(e,t);let a=pt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||vn(),n=pt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||vn();return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function k5(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 T5(){return{not:vn()}}function L5(){return{type:"null"}}var fv={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function E5(e,t){let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in fv&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let i=fv[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,s)=>s.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 A5(e,t)}var A5=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>pt(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 M5(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[fv[e.innerType._def.typeName],"null"]};let a=pt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function R5(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 D5(e,t){let a={type:"object",properties:{}},n=[],r=e.shape();for(let i in r){let s=r[i];if(s===void 0||s._def===void 0)continue;let l=P5(s),u=pt(s._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(a.properties[i]=u,l||n.push(i))}n.length&&(a.required=n);let o=_5(e,t);return o!==void 0&&(a.additionalProperties=o),a}function _5(e,t){if(e.catchall._def.typeName!=="ZodNever")return pt(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 P5(e){try{return e.isOptional()}catch{return!0}}var O5=(e,t)=>{var a;if(t.currentPath.toString()===((a=t.propertyPath)==null?void 0:a.toString()))return pt(e.innerType._def,t);let n=pt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:vn()},n]}:vn()},N5=(e,t)=>{if(t.pipeStrategy==="input")return pt(e.in._def,t);if(t.pipeStrategy==="output")return pt(e.out._def,t);let a=pt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=pt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function U5(e,t){return pt(e.type._def,t)}function B5(e,t){let n={type:"array",uniqueItems:!0,items:pt(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 z5(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>pt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:pt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>pt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function F5(){return{not:vn()}}function q5(){return vn()}var H5=(e,t)=>pt(e.innerType._def,t),j5=(e,t,a)=>{switch(t){case Me.ZodString:return oE(e,a);case Me.ZodNumber:return R5(e);case Me.ZodObject:return D5(e,a);case Me.ZodBigInt:return f5(e);case Me.ZodBoolean:return p5();case Me.ZodDate:return rE(e,a);case Me.ZodUndefined:return F5();case Me.ZodNull:return L5();case Me.ZodArray:return d5(e,a);case Me.ZodUnion:case Me.ZodDiscriminatedUnion:return E5(e,a);case Me.ZodIntersection:return x5(e,a);case Me.ZodTuple:return z5(e,a);case Me.ZodRecord:return iE(e,a);case Me.ZodLiteral:return b5(e);case Me.ZodEnum:return w5(e);case Me.ZodNativeEnum:return k5(e);case Me.ZodNullable:return M5(e,a);case Me.ZodOptional:return O5(e,a);case Me.ZodMap:return C5(e,a);case Me.ZodSet:return B5(e,a);case Me.ZodLazy:return()=>e.getter()._def;case Me.ZodPromise:return U5(e,a);case Me.ZodNaN:case Me.ZodNever:return T5();case Me.ZodEffects:return y5(e,a);case Me.ZodAny:return vn();case Me.ZodUnknown:return q5();case Me.ZodDefault:return g5(e,a);case Me.ZodBranded:return nE(e,a);case Me.ZodReadonly:return H5(e,a);case Me.ZodCatch:return m5(e,a);case Me.ZodPipeline:return N5(e,a);case Me.ZodFunction:case Me.ZodVoid:case Me.ZodSymbol:return;default:return(n=>{})(t)}},V5=(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 pt(e,t,a=!1){var n;let r=t.seen.get(e);if(t.override){let l=(n=t.override)==null?void 0:n.call(t,e,t,r,a);if(l!==u5)return l}if(r&&!a){let l=$5(r,t);if(l!==void 0)return l}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=j5(e,e.typeName,t),s=typeof i=="function"?pt(i(),t):i;if(s&&W5(e,t,s),t.postProcess){let l=t.postProcess(s,e,t);return o.jsonSchema=s,l}return o.jsonSchema=s,s}var $5=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:V5(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`),vn()):t.$refStrategy==="seen"?vn():void 0}},W5=(e,t,a)=>(e.description&&(a.description=e.description),a),G5=e=>{let t=c5(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}]))}},X5=(e,t)=>{var a;let n=G5(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[c,d])=>{var p;return{...u,[c]:(p=pt(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0))!=null?p:vn()}},{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(a=pt(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1))!=null?a:vn(),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(i.title=s);let l=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 l.$schema="http://json-schema.org/draft-07/schema#",l},pv=Symbol.for("vercel.ai.schema");function am(e){let t;return()=>(t==null&&(t=e()),t)}function Il(e,{validate:t}={}){return{[pv]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function K5(e){return typeof e=="object"&&e!==null&&pv in e&&e[pv]===!0&&"jsonSchema"in e&&"validate"in e}function Oi(e){return e==null?Il({properties:{},additionalProperties:!1}):K5(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?Cl(e):Y5(e):e()}function Y5(e){return Il(()=>yv(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 Z5(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Il(()=>X5(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 J5(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Il(()=>yv((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 Q5(e){return"_zod"in e}function Cl(e,t){return Q5(e)?J5(e,t):Z5(e,t)}async function nm({value:e,schema:t,context:a}){let n=await kl({value:e,schema:t,context:a});if(!n.success)throw Kn.wrap({value:e,cause:n.error,context:a});return n.value}async function kl({value:e,schema:t,context:a}){let n=Oi(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 Xr({text:e,schema:t}){try{let a=l5(e);return t==null?{success:!0,value:a,rawValue:a}:await kl({value:a,schema:t})}catch(a){return{success:!1,error:ov.isInstance(a)?a:new ov({text:e,cause:a}),rawValue:void 0}}}function wv({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new em).pipeThrough(new TransformStream({async transform({data:a},n){a!=="[DONE]"&&n.enqueue(await Xr({text:a,schema:t}))}}))}async function hr(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var tH=Object.defineProperty,aH=(e,t)=>{for(var a in t)tH(e,a,{get:t[a],enumerable:!0})},nH="AI_InvalidArgumentError",rH=`vercel.ai.error.${nH}`,oH=Symbol.for(rH),iH;iH=oH;var sH="AI_InvalidStreamPartError",lH=`vercel.ai.error.${sH}`,uH=Symbol.for(lH),cH;cH=uH;var dH="AI_InvalidToolApprovalError",fH=`vercel.ai.error.${dH}`,pH=Symbol.for(fH),mH;mH=pH;var hH="AI_InvalidToolInputError",gH=`vercel.ai.error.${hH}`,yH=Symbol.for(gH),wH;wH=yH;var vH="AI_ToolCallNotFoundForApprovalError",xH=`vercel.ai.error.${vH}`,bH=Symbol.for(xH),SH;SH=bH;var IH="AI_MissingToolResultsError",CH=`vercel.ai.error.${IH}`,kH=Symbol.for(CH),TH;TH=kH;var LH="AI_NoImageGeneratedError",EH=`vercel.ai.error.${LH}`,AH=Symbol.for(EH),MH;MH=AH;var lE="AI_NoObjectGeneratedError",uE=`vercel.ai.error.${lE}`,RH=Symbol.for(uE),cE,qo=class extends Je{constructor({message:e="No object generated.",cause:t,text:a,response:n,usage:r,finishReason:o}){super({name:lE,message:e,cause:t}),this[cE]=!0,this.text=a,this.response=n,this.usage=r,this.finishReason=o}static isInstance(e){return Je.hasMarker(e,uE)}};cE=RH;var DH="AI_NoOutputGeneratedError",_H=`vercel.ai.error.${DH}`,PH=Symbol.for(_H),OH;OH=PH;var NH="AI_NoSpeechGeneratedError",UH=`vercel.ai.error.${NH}`,BH=Symbol.for(UH),zH;zH=BH;var FH="AI_NoTranscriptGeneratedError",qH=`vercel.ai.error.${FH}`,HH=Symbol.for(qH),jH;jH=HH;var VH="AI_NoVideoGeneratedError",$H=`vercel.ai.error.${VH}`,WH=Symbol.for($H),GH;GH=WH;var XH="AI_NoSuchToolError",KH=`vercel.ai.error.${XH}`,YH=Symbol.for(KH),ZH;ZH=YH;var JH="AI_ToolCallRepairError",QH=`vercel.ai.error.${JH}`,e6=Symbol.for(QH),t6;t6=e6;var dE="AI_UIMessageStreamError",fE=`vercel.ai.error.${dE}`,a6=Symbol.for(fE),pE,Tl=class extends Je{constructor({chunkType:e,chunkId:t,message:a}){super({name:dE,message:a}),this[pE]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Je.hasMarker(e,fE)}};pE=a6;var n6="AI_InvalidDataContentError",r6=`vercel.ai.error.${n6}`,o6=Symbol.for(r6),i6;i6=o6;var s6="AI_InvalidMessageRoleError",l6=`vercel.ai.error.${s6}`,u6=Symbol.for(l6),c6;c6=u6;var d6="AI_MessageConversionError",f6=`vercel.ai.error.${d6}`,p6=Symbol.for(f6),m6;m6=p6;var h6="AI_RetryError",g6=`vercel.ai.error.${h6}`,y6=Symbol.for(g6),w6;w6=y6;var v6="6.0.141",x6=async({url:e,maxBytes:t,abortSignal:a})=>{var n;let r=e.toString();hv(r);try{let o=await fetch(r,{headers:tm({},`ai-sdk/${v6}`,aE()),signal:a});if(o.redirected&&hv(o.url),!o.ok)throw new On({url:r,statusCode:o.status,statusText:o.statusText});return{data:await eE({response:o,url:r,maxBytes:t??mv}),mediaType:(n=o.headers.get("content-type"))!=null?n:void 0}}catch(o){throw On.isInstance(o)?o:new On({url:r,cause:o})}};var mE=f.union([f.string(),f.instanceof(Uint8Array),f.instanceof(ArrayBuffer),f.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 zc=f.lazy(()=>f.union([f.null(),f.string(),f.number(),f.boolean(),f.record(f.string(),zc.optional()),f.array(zc)])),pe=f.record(f.string(),f.record(f.string(),zc.optional())),hE=f.object({type:f.literal("text"),text:f.string(),providerOptions:pe.optional()}),b6=f.object({type:f.literal("image"),image:f.union([mE,f.instanceof(URL)]),mediaType:f.string().optional(),providerOptions:pe.optional()}),gE=f.object({type:f.literal("file"),data:f.union([mE,f.instanceof(URL)]),filename:f.string().optional(),mediaType:f.string(),providerOptions:pe.optional()}),S6=f.object({type:f.literal("reasoning"),text:f.string(),providerOptions:pe.optional()}),I6=f.object({type:f.literal("tool-call"),toolCallId:f.string(),toolName:f.string(),input:f.unknown(),providerOptions:pe.optional(),providerExecuted:f.boolean().optional()}),C6=f.discriminatedUnion("type",[f.object({type:f.literal("text"),value:f.string(),providerOptions:pe.optional()}),f.object({type:f.literal("json"),value:zc,providerOptions:pe.optional()}),f.object({type:f.literal("execution-denied"),reason:f.string().optional(),providerOptions:pe.optional()}),f.object({type:f.literal("error-text"),value:f.string(),providerOptions:pe.optional()}),f.object({type:f.literal("error-json"),value:zc,providerOptions:pe.optional()}),f.object({type:f.literal("content"),value:f.array(f.union([f.object({type:f.literal("text"),text:f.string(),providerOptions:pe.optional()}),f.object({type:f.literal("media"),data:f.string(),mediaType:f.string()}),f.object({type:f.literal("file-data"),data:f.string(),mediaType:f.string(),filename:f.string().optional(),providerOptions:pe.optional()}),f.object({type:f.literal("file-url"),url:f.string(),providerOptions:pe.optional()}),f.object({type:f.literal("file-id"),fileId:f.union([f.string(),f.record(f.string(),f.string())]),providerOptions:pe.optional()}),f.object({type:f.literal("image-data"),data:f.string(),mediaType:f.string(),providerOptions:pe.optional()}),f.object({type:f.literal("image-url"),url:f.string(),providerOptions:pe.optional()}),f.object({type:f.literal("image-file-id"),fileId:f.union([f.string(),f.record(f.string(),f.string())]),providerOptions:pe.optional()}),f.object({type:f.literal("custom"),providerOptions:pe.optional()})]))})]),yE=f.object({type:f.literal("tool-result"),toolCallId:f.string(),toolName:f.string(),output:C6,providerOptions:pe.optional()}),k6=f.object({type:f.literal("tool-approval-request"),approvalId:f.string(),toolCallId:f.string()}),T6=f.object({type:f.literal("tool-approval-response"),approvalId:f.string(),approved:f.boolean(),reason:f.string().optional()}),L6=f.object({role:f.literal("system"),content:f.string(),providerOptions:pe.optional()}),E6=f.object({role:f.literal("user"),content:f.union([f.string(),f.array(f.union([hE,b6,gE]))]),providerOptions:pe.optional()}),A6=f.object({role:f.literal("assistant"),content:f.union([f.string(),f.array(f.union([hE,gE,S6,I6,yE,k6]))]),providerOptions:pe.optional()}),M6=f.object({role:f.literal("tool"),content:f.array(f.union([yE,T6])),providerOptions:pe.optional()}),Xee=f.union([L6,E6,A6,M6]);function wE(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),s=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);i&&s?a[n]=wE(o,r):a[n]=r}return a}var R6={};aH(R6,{array:()=>O6,choice:()=>N6,json:()=>U6,object:()=>P6,text:()=>_6});function D6(e){let t=["ROOT"],a=-1,n=null;function r(l,u,c){switch(l){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(l,u){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=u,t.pop();break}}}function i(l,u){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=u,t.pop();break}}}for(let l=0;l<e.length;l++){let u=e[l];switch(t[t.length-1]){case"ROOT":r(u,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{a=l,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,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(u,l);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),a=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:a=l}break}case"INSIDE_ARRAY_START":{u==="]"?(a=l,t.pop()):(a=l,r(u,l,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=l,t.pop();break}default:{a=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(u,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),a=l;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=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{let d=e.substring(n,l+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(u,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,l)):a=l;break}}}let s=e.slice(0,a+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{s+='"';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":{s+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{s+="]";break}case"INSIDE_LITERAL":{let c=e.substring(n,e.length);"true".startsWith(c)?s+="true".slice(c.length):"false".startsWith(c)?s+="false".slice(c.length):"null".startsWith(c)&&(s+="null".slice(c.length))}}return s}async function Fc(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await Xr({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await Xr({text:D6(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var _6=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),P6=({schema:e,name:t,description:a})=>{let n=Oi(e);return{name:"object",responseFormat:hr(n.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){let i=await Xr({text:r});if(!i.success)throw new qo({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let s=await kl({value:i.value,schema:n});if(!s.success)throw new qo({message:"No object generated: response did not match schema.",cause:s.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});return s.value},async parsePartialOutput({text:r}){let o=await Fc(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},O6=({element:e,name:t,description:a})=>{let n=Oi(e);return{name:"array",responseFormat:hr(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 Xr({text:r});if(!i.success)throw new qo({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let s=i.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))throw new qo({message:"No object generated: response did not match schema.",cause:new Kn({value:s,cause:"response must be an object with an elements array"}),text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});for(let l of s.elements){let u=await kl({value:l,schema:n});if(!u.success)throw new qo({message:"No object generated: response did not match schema.",cause:u.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason})}return s.elements},async parsePartialOutput({text:r}){let o=await Fc(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 s=o.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,l=[];for(let u of s){let c=await kl({value:u,schema:n});c.success&&l.push(c.value)}return{partial:l}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:o},i){if(o!=null)for(;r<o.length;r++)i.enqueue(o[r])}})}}},N6=({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 Xr({text:n});if(!o.success)throw new qo({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 qo({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 Fc(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(s=>s.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(){}}),U6=({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 Xr({text:a});if(!r.success)throw new qo({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 Fc(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 Jee=mr({prefix:"aitxt",size:24});var ete=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
|
|
132
132
|
|
|
133
133
|
`)},flush(e){e.enqueue(`data: [DONE]
|
|
134
134
|
|
|
135
|
-
`)}})}};var wv=em(()=>Cl(f.union([f.strictObject({type:f.literal("text-start"),id:f.string(),providerMetadata:me.optional()}),f.strictObject({type:f.literal("text-delta"),id:f.string(),delta:f.string(),providerMetadata:me.optional()}),f.strictObject({type:f.literal("text-end"),id:f.string(),providerMetadata:me.optional()}),f.strictObject({type:f.literal("error"),errorText:f.string()}),f.strictObject({type:f.literal("tool-input-start"),toolCallId:f.string(),toolName:f.string(),providerExecuted:f.boolean().optional(),providerMetadata:me.optional(),dynamic:f.boolean().optional(),title:f.string().optional()}),f.strictObject({type:f.literal("tool-input-delta"),toolCallId:f.string(),inputTextDelta:f.string()}),f.strictObject({type:f.literal("tool-input-available"),toolCallId:f.string(),toolName:f.string(),input:f.unknown(),providerExecuted:f.boolean().optional(),providerMetadata:me.optional(),dynamic:f.boolean().optional(),title:f.string().optional()}),f.strictObject({type:f.literal("tool-input-error"),toolCallId:f.string(),toolName:f.string(),input:f.unknown(),providerExecuted:f.boolean().optional(),providerMetadata:me.optional(),dynamic:f.boolean().optional(),errorText:f.string(),title:f.string().optional()}),f.strictObject({type:f.literal("tool-approval-request"),approvalId:f.string(),toolCallId:f.string()}),f.strictObject({type:f.literal("tool-output-available"),toolCallId:f.string(),output:f.unknown(),providerExecuted:f.boolean().optional(),providerMetadata:me.optional(),dynamic:f.boolean().optional(),preliminary:f.boolean().optional()}),f.strictObject({type:f.literal("tool-output-error"),toolCallId:f.string(),errorText:f.string(),providerExecuted:f.boolean().optional(),providerMetadata:me.optional(),dynamic:f.boolean().optional()}),f.strictObject({type:f.literal("tool-output-denied"),toolCallId:f.string()}),f.strictObject({type:f.literal("reasoning-start"),id:f.string(),providerMetadata:me.optional()}),f.strictObject({type:f.literal("reasoning-delta"),id:f.string(),delta:f.string(),providerMetadata:me.optional()}),f.strictObject({type:f.literal("reasoning-end"),id:f.string(),providerMetadata:me.optional()}),f.strictObject({type:f.literal("source-url"),sourceId:f.string(),url:f.string(),title:f.string().optional(),providerMetadata:me.optional()}),f.strictObject({type:f.literal("source-document"),sourceId:f.string(),mediaType:f.string(),title:f.string(),filename:f.string().optional(),providerMetadata:me.optional()}),f.strictObject({type:f.literal("file"),url:f.string(),mediaType:f.string(),providerMetadata:me.optional()}),f.strictObject({type:f.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:f.string().optional(),data:f.unknown(),transient:f.boolean().optional()}),f.strictObject({type:f.literal("start-step")}),f.strictObject({type:f.literal("finish-step")}),f.strictObject({type:f.literal("start"),messageId:f.string().optional(),messageMetadata:f.unknown().optional()}),f.strictObject({type:f.literal("finish"),finishReason:f.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:f.unknown().optional()}),f.strictObject({type:f.literal("abort"),reason:f.string().optional()}),f.strictObject({type:f.literal("message-metadata"),messageMetadata:f.unknown()})])));function N6(e){return e.type.startsWith("data-")}function yv(e){return e.type.startsWith("tool-")}function U6(e){return e.type==="dynamic-tool"}function am(e){return yv(e)||U6(e)}function oE(e){return e.type.split("-").slice(1).join("-")}function yE({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function wE({stream:e,messageMetadataSchema:t,dataPartSchemas:a,runUpdateMessageJob:n,onError:r,onToolCall:o,onData:i}){return e.pipeThrough(new TransformStream({async transform(s,l){await n(async({state:u,write:c})=>{var d,p,m,h;function v(g){let E=u.message.parts.filter(am).find(T=>T.toolCallId===g);if(E==null)throw new Tl({chunkType:"tool-invocation",chunkId:g,message:`No tool invocation found for tool call ID "${g}".`});return E}function I(g){var S;let E=u.message.parts.find(O=>yv(O)&&O.toolCallId===g.toolCallId),T=g,R=E;if(E!=null){E.state=g.state,R.input=T.input,R.output=T.output,R.errorText=T.errorText,R.rawInput=T.rawInput,R.preliminary=T.preliminary,g.title!==void 0&&(R.title=g.title),R.providerExecuted=(S=T.providerExecuted)!=null?S:E.providerExecuted;let O=T.providerMetadata;if(O!=null)if(g.state==="output-available"||g.state==="output-error"){let U=E;U.resultProviderMetadata=O}else E.callProviderMetadata=O}else u.message.parts.push({type:`tool-${g.toolName}`,toolCallId:g.toolCallId,state:g.state,title:g.title,input:T.input,output:T.output,rawInput:T.rawInput,errorText:T.errorText,providerExecuted:T.providerExecuted,preliminary:T.preliminary,...T.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:T.providerMetadata}:{},...T.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:T.providerMetadata}:{}})}function y(g){var S,E;let T=u.message.parts.find(U=>U.type==="dynamic-tool"&&U.toolCallId===g.toolCallId),R=g,O=T;if(T!=null){T.state=g.state,O.toolName=g.toolName,O.input=R.input,O.output=R.output,O.errorText=R.errorText,O.rawInput=(S=R.rawInput)!=null?S:O.rawInput,O.preliminary=R.preliminary,g.title!==void 0&&(O.title=g.title),O.providerExecuted=(E=R.providerExecuted)!=null?E:T.providerExecuted;let U=R.providerMetadata;if(U!=null)if(g.state==="output-available"||g.state==="output-error"){let A=T;A.resultProviderMetadata=U}else T.callProviderMetadata=U}else u.message.parts.push({type:"dynamic-tool",toolName:g.toolName,toolCallId:g.toolCallId,state:g.state,input:R.input,output:R.output,errorText:R.errorText,preliminary:R.preliminary,providerExecuted:R.providerExecuted,title:g.title,...R.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:R.providerMetadata}:{},...R.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:R.providerMetadata}:{}})}async function w(g){if(g!=null){let S=u.message.metadata!=null?gE(u.message.metadata,g):g;t!=null&&await tm({value:S,schema:t,context:{field:"message.metadata",entityId:u.message.id}}),u.message.metadata=S}}switch(s.type){case"text-start":{let g={type:"text",text:"",providerMetadata:s.providerMetadata,state:"streaming"};u.activeTextParts[s.id]=g,u.message.parts.push(g),c();break}case"text-delta":{let g=u.activeTextParts[s.id];if(g==null)throw new Tl({chunkType:"text-delta",chunkId:s.id,message:`Received text-delta for missing text part with ID "${s.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});g.text+=s.delta,g.providerMetadata=(d=s.providerMetadata)!=null?d:g.providerMetadata,c();break}case"text-end":{let g=u.activeTextParts[s.id];if(g==null)throw new Tl({chunkType:"text-end",chunkId:s.id,message:`Received text-end for missing text part with ID "${s.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});g.state="done",g.providerMetadata=(p=s.providerMetadata)!=null?p:g.providerMetadata,delete u.activeTextParts[s.id],c();break}case"reasoning-start":{let g={type:"reasoning",text:"",providerMetadata:s.providerMetadata,state:"streaming"};u.activeReasoningParts[s.id]=g,u.message.parts.push(g),c();break}case"reasoning-delta":{let g=u.activeReasoningParts[s.id];if(g==null)throw new Tl({chunkType:"reasoning-delta",chunkId:s.id,message:`Received reasoning-delta for missing reasoning part with ID "${s.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});g.text+=s.delta,g.providerMetadata=(m=s.providerMetadata)!=null?m:g.providerMetadata,c();break}case"reasoning-end":{let g=u.activeReasoningParts[s.id];if(g==null)throw new Tl({chunkType:"reasoning-end",chunkId:s.id,message:`Received reasoning-end for missing reasoning part with ID "${s.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});g.providerMetadata=(h=s.providerMetadata)!=null?h:g.providerMetadata,g.state="done",delete u.activeReasoningParts[s.id],c();break}case"file":{u.message.parts.push({type:"file",mediaType:s.mediaType,url:s.url,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{}}),c();break}case"source-url":{u.message.parts.push({type:"source-url",sourceId:s.sourceId,url:s.url,title:s.title,providerMetadata:s.providerMetadata}),c();break}case"source-document":{u.message.parts.push({type:"source-document",sourceId:s.sourceId,mediaType:s.mediaType,title:s.title,filename:s.filename,providerMetadata:s.providerMetadata}),c();break}case"tool-input-start":{let g=u.message.parts.filter(yv);u.partialToolCalls[s.toolCallId]={text:"",toolName:s.toolName,index:g.length,dynamic:s.dynamic,title:s.title},s.dynamic?y({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,providerMetadata:s.providerMetadata}):I({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,providerMetadata:s.providerMetadata}),c();break}case"tool-input-delta":{let g=u.partialToolCalls[s.toolCallId];if(g==null)throw new Tl({chunkType:"tool-input-delta",chunkId:s.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${s.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});g.text+=s.inputTextDelta;let{value:S}=await zc(g.text);g.dynamic?y({toolCallId:s.toolCallId,toolName:g.toolName,state:"input-streaming",input:S,title:g.title}):I({toolCallId:s.toolCallId,toolName:g.toolName,state:"input-streaming",input:S,title:g.title}),c();break}case"tool-input-available":{s.dynamic?y({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title}):I({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title}),c(),o&&!s.providerExecuted&&await o({toolCall:s});break}case"tool-input-error":{let g=u.message.parts.filter(am).find(E=>E.toolCallId===s.toolCallId);(g!=null?g.type==="dynamic-tool":!!s.dynamic)?y({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata}):I({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:void 0,rawInput:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata}),c();break}case"tool-approval-request":{let g=v(s.toolCallId);g.state="approval-requested",g.approval={id:s.approvalId},c();break}case"tool-output-denied":{let g=v(s.toolCallId);g.state="output-denied",c();break}case"tool-output-available":{let g=v(s.toolCallId);g.type==="dynamic-tool"?y({toolCallId:s.toolCallId,toolName:g.toolName,state:"output-available",input:g.input,output:s.output,preliminary:s.preliminary,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:g.title}):I({toolCallId:s.toolCallId,toolName:oE(g),state:"output-available",input:g.input,output:s.output,providerExecuted:s.providerExecuted,preliminary:s.preliminary,providerMetadata:s.providerMetadata,title:g.title}),c();break}case"tool-output-error":{let g=v(s.toolCallId);g.type==="dynamic-tool"?y({toolCallId:s.toolCallId,toolName:g.toolName,state:"output-error",input:g.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:g.title}):I({toolCallId:s.toolCallId,toolName:oE(g),state:"output-error",input:g.input,rawInput:g.rawInput,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.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":{s.messageId!=null&&(u.message.id=s.messageId),await w(s.messageMetadata),(s.messageId!=null||s.messageMetadata!=null)&&c();break}case"finish":{s.finishReason!=null&&(u.finishReason=s.finishReason),await w(s.messageMetadata),s.messageMetadata!=null&&c();break}case"message-metadata":{await w(s.messageMetadata),s.messageMetadata!=null&&c();break}case"error":{r?.(new Error(s.errorText));break}default:if(N6(s)){if(a?.[s.type]!=null){let E=u.message.parts.findIndex(R=>"id"in R&&"data"in R&&R.id===s.id&&R.type===s.type),T=E>=0?E:u.message.parts.length;await tm({value:s.data,schema:a[s.type],context:{field:`message.parts[${T}].data`,entityName:s.type,entityId:s.id}})}let g=s;if(g.transient){i?.(g);break}let S=g.id!=null?u.message.parts.find(E=>g.type===E.type&&g.id===E.id):void 0;S!=null?S.data=g.data:u.message.parts.push(g),i?.(g),c()}}l.enqueue(s)})}}))}function B6(e){let t=e.pipeThrough(new TransformStream);return t[Symbol.asyncIterator]=function(){let a=this.getReader(),n=!1;async function r(o){var i;if(!n){n=!0;try{o&&await((i=a.cancel)==null?void 0:i.call(a))}finally{try{a.releaseLock()}catch{}}}}return{async next(){if(n)return{done:!0,value:void 0};let{done:o,value:i}=await a.read();return o?(await r(!0),{done:!0,value:void 0}):{done:!1,value:i}},async return(){return await r(!0),{done:!0,value:void 0}},async throw(o){throw await r(!0),o}}},t}async function vE({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 ate=gr({prefix:"aitxt",size:24});function xE({message:e,stream:t,onError:a,terminateOnError:n=!1}){var r;let o,i=!1,s=new ReadableStream({start(c){o=c}}),l=yE({messageId:(r=e?.id)!=null?r:"",lastMessage:e}),u=c=>{a?.(c),!i&&n&&(i=!0,o?.error(c))};return vE({stream:wE({stream:t,runUpdateMessageJob(c){return c({state:l,write:()=>{o?.enqueue(structuredClone(l.message))}})},onError:u}),onError:u}).finally(()=>{i||o?.close()}),B6(s)}var ote=em(()=>Cl(f.array(f.object({id:f.string(),role:f.enum(["system","user","assistant"]),metadata:f.unknown().optional(),parts:f.array(f.union([f.object({type:f.literal("text"),text:f.string(),state:f.enum(["streaming","done"]).optional(),providerMetadata:me.optional()}),f.object({type:f.literal("reasoning"),text:f.string(),state:f.enum(["streaming","done"]).optional(),providerMetadata:me.optional()}),f.object({type:f.literal("source-url"),sourceId:f.string(),url:f.string(),title:f.string().optional(),providerMetadata:me.optional()}),f.object({type:f.literal("source-document"),sourceId:f.string(),mediaType:f.string(),title:f.string(),filename:f.string().optional(),providerMetadata:me.optional()}),f.object({type:f.literal("file"),mediaType:f.string(),filename:f.string().optional(),url:f.string(),providerMetadata:me.optional()}),f.object({type:f.literal("step-start")}),f.object({type:f.string().startsWith("data-"),id:f.string().optional(),data:f.unknown()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("input-streaming"),input:f.unknown().optional(),providerExecuted:f.boolean().optional(),callProviderMetadata:me.optional(),output:f.never().optional(),errorText:f.never().optional(),approval:f.never().optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("input-available"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:me.optional(),approval:f.never().optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("approval-requested"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:me.optional(),approval:f.object({id:f.string(),approved:f.never().optional(),reason:f.never().optional()})}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("approval-responded"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:me.optional(),approval:f.object({id:f.string(),approved:f.boolean(),reason:f.string().optional()})}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("output-available"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.unknown(),errorText:f.never().optional(),callProviderMetadata:me.optional(),resultProviderMetadata:me.optional(),preliminary:f.boolean().optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional()}).optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("output-error"),input:f.unknown(),rawInput:f.unknown().optional(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.string(),callProviderMetadata:me.optional(),resultProviderMetadata:me.optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional()}).optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("output-denied"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:me.optional(),approval:f.object({id:f.string(),approved:f.literal(!1),reason:f.string().optional()})}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("input-streaming"),providerExecuted:f.boolean().optional(),callProviderMetadata:me.optional(),input:f.unknown().optional(),output:f.never().optional(),errorText:f.never().optional(),approval:f.never().optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("input-available"),providerExecuted:f.boolean().optional(),input:f.unknown(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:me.optional(),approval:f.never().optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("approval-requested"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:me.optional(),approval:f.object({id:f.string(),approved:f.never().optional(),reason:f.never().optional()})}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("approval-responded"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:me.optional(),approval:f.object({id:f.string(),approved:f.boolean(),reason:f.string().optional()})}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("output-available"),providerExecuted:f.boolean().optional(),input:f.unknown(),output:f.unknown(),errorText:f.never().optional(),callProviderMetadata:me.optional(),resultProviderMetadata:me.optional(),preliminary:f.boolean().optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional()}).optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("output-error"),providerExecuted:f.boolean().optional(),input:f.unknown(),rawInput:f.unknown().optional(),output:f.never().optional(),errorText:f.string(),callProviderMetadata:me.optional(),resultProviderMetadata:me.optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional()}).optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("output-denied"),providerExecuted:f.boolean().optional(),input:f.unknown(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:me.optional(),approval:f.object({id:f.string(),approved:f.literal(!1),reason:f.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var ste=gr({prefix:"aiobj",size:24});function bE(e){return({url:t,abortSignal:a})=>w6({url:t,maxBytes:e?.maxBytes,abortSignal:a})}var z6=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 ute=gr({prefix:"aiobj",size:24});var cte=bE();var F6="AI_NoSuchProviderError",q6=`vercel.ai.error.${F6}`,H6=Symbol.for(q6),j6;j6=H6;var dte=bE();async function V6(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 s=new FileReader;s.onload=l=>{var u;o((u=l.target)==null?void 0:u.result)},s.onerror=l=>i(l),s.readAsDataURL(t)});return{type:"file",mediaType:n,filename:a,url:r}}))}var $6=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 s=await yr(this.body),l=await yr(this.headers),u=await yr(this.credentials),c={...Fo(l),...Fo(t.headers)},d=await((a=this.prepareSendMessagesRequest)==null?void 0:a.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...s,...t.body},headers:c,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),p=(n=d?.api)!=null?n:this.api,m=d?.headers!==void 0?Fo(d.headers):c,h=d?.body!==void 0?d.body:{...s,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},v=(r=d?.credentials)!=null?r:u,y=await((o=this.fetch)!=null?o:globalThis.fetch)(p,{method:"POST",headers:{"Content-Type":"application/json",...m},body:JSON.stringify(h),credentials:v,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 yr(this.body),s=await yr(this.headers),l=await yr(this.credentials),u={...Fo(s),...Fo(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:l,requestMetadata:e.metadata})),d=(a=c?.api)!=null?a:`${this.api}/${e.chatId}/stream`,p=c?.headers!==void 0?Fo(c.headers):u,m=(n=c?.credentials)!=null?n:l,v=await((r=this.fetch)!=null?r:globalThis.fetch)(d,{method:"GET",headers:p,credentials:m});if(v.status===204)return null;if(!v.ok)throw new Error((o=await v.text())!=null?o:"Failed to fetch the chat response.");if(!v.body)throw new Error("The response body is empty.");return this.processResponseStream(v.body)}},vv=class extends $6{constructor(e={}){super(e)}processResponseStream(e){return gv({stream:e,schema:wv}).pipeThrough(new TransformStream({async transform(t,a){if(!t.success)throw t.error;a.enqueue(t.value)}}))}},SE=class{constructor({generateId:e=mv,id:t=e(),transport:a=new vv,messageMetadataSchema:n,dataPartSchemas:r,state:o,onError:i,onToolCall:s,onFinish:l,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new z6,this.sendMessage=async(d,p)=>{var m,h,v,I;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(m=this.lastMessage)==null?void 0:m.id,...p});return}let y;if("text"in d||"files"in d?y={parts:[...Array.isArray(d.files)?d.files:await V6(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:(h=y.role)!=null?h:"user",metadata:d.metadata})}else this.state.pushMessage({...y,id:(v=y.id)!=null?v:this.generateId(),role:(I=y.role)!=null?I:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,...p})},this.regenerate=async({messageId:d,...p}={})=>{let m=d==null?this.state.messages.length-1:this.state.messages.findIndex(h=>h.id===d);if(m===-1)throw new Error(`message ${d} not found`);this.state.messages=this.state.messages.slice(0,this.messages[m].role==="assistant"?m:m+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,...p})},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:p,reason:m,options:h})=>this.jobExecutor.run(async()=>{let v=this.state.messages,I=v[v.length-1],y=w=>am(w)&&w.state==="approval-requested"&&w.approval.id===d?{...w,state:"approval-responded",approval:{id:d,approved:p,reason:m}}:w;this.state.replaceMessage(v.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,...h})})}),this.addToolOutput=async({state:d="output-available",toolCallId:p,output:m,errorText:h,options:v})=>this.jobExecutor.run(async()=>{let I=this.state.messages,y=I[I.length-1],w=g=>am(g)&&g.toolCallId===p?{...g,state:d,output:m,errorText:h}: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 S;g&&this.makeRequest({trigger:"submit-message",messageId:(S=this.lastMessage)==null?void 0:S.id,...v})})}),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=s,this.onFinish=l,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,s;let l;if(e==="resume-stream")try{let m=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:a,body:n});if(m==null)return;l=m}catch(m){this.onError&&m instanceof Error&&this.onError(m),this.setStatus({status:"error",error:m});return}this.setStatus({status:"submitted",error:void 0});let u=this.lastMessage,c=!1,d=!1,p=!1;try{let m={state:yE({lastMessage:this.state.snapshot(u),messageId:this.generateId()}),abortController:new AbortController};m.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=m;let h;e==="resume-stream"?h=l:h=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:m.abortController.signal,metadata:t,headers:a,body:n,trigger:e,messageId:r});let v=I=>this.jobExecutor.run(()=>I({state:m.state,write:()=>{var y;this.setStatus({status:"streaming"}),m.state.message.id===((y=this.lastMessage)==null?void 0:y.id)?this.state.replaceMessage(this.state.messages.length-1,m.state.message):this.state.pushMessage(m.state.message)}}));await vE({stream:wE({stream:h,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:v,onError:I=>{throw I}}),onError:I=>{throw I}}),this.setStatus({status:"ready"})}catch(m){if(c||m.name==="AbortError")return c=!0,this.setStatus({status:"ready"}),null;p=!0,m instanceof TypeError&&(m.message.toLowerCase().includes("fetch")||m.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&m instanceof Error&&this.onError(m),this.setStatus({status:"error",error:m})}finally{try{(i=this.onFinish)==null||i.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:d,isError:p,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(m){console.error(m)}this.activeResponse=void 0}!p&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(s=this.lastMessage)==null?void 0:s.id,metadata:t,headers:a,body:n})}};function nm(){let e=new Set,t=new Map,a,n=0,r=!1,o=!1,i=c=>(a||(a=`text-${++n}`,c.enqueue({type:"text-start",id:a})),a),s=c=>{a&&(c.enqueue({type:"text-end",id:a}),a=void 0)},l=(c,d)=>{c.enqueue({type:"text-delta",id:i(c),delta:d})},u=(c,d,p)=>{e.has(d.callId)||(e.add(d.callId),c.enqueue({type:"tool-input-available",toolCallId:d.callId,toolName:d.toolName??d.kind,input:p,dynamic:!0}))};return new TransformStream({start(c){c.enqueue({type:"start",messageId:crypto.randomUUID()})},transform(c,d){switch(c.type){case"step.started":{t.set(c.data.stepIndex,c.data.modelId),d.enqueue({type:"start-step"}),r=!0;break}case"message.appended":{c.data.messageDelta&&l(d,c.data.messageDelta);break}case"message.completed":{!a&&c.data.message&&l(d,c.data.message),s(d);break}case"actions.requested":{s(d);for(let p of c.data.actions)u(d,p,p.input);break}case"action.result":{let{result:p,status:m,error:h}=c.data;if(p.kind!=="tool-result")break;if(u(d,p,{}),p.isError===!0||m!=="completed"){d.enqueue({type:"tool-output-error",toolCallId:p.callId,errorText:h?.message??"The tool call failed.",dynamic:!0});break}d.enqueue({type:"tool-output-available",toolCallId:p.callId,output:p.output,dynamic:!0});break}case"step.completed":{let{stepIndex:p,usage:m}=c.data;s(d),r&&(d.enqueue({type:"finish-step"}),r=!1),d.enqueue({type:"message-metadata",messageMetadata:{"waniwani/step":{stepIndex:p,modelId:t.get(p),usage:m}}});break}case"turn.failed":case"session.failed":{o=!0,d.enqueue({type:"error",errorText:c.data.message||"The agent could not answer."});break}}},flush(c){s(c),r&&c.enqueue({type:"finish-step"}),c.enqueue({type:"finish",finishReason:o?"error":"stop"})}})}async function W6(e){let t=new ReadableStream({start(n){for(let r of e)n.enqueue(r);n.close()}}).pipeThrough(nm()),a;for await(let n of xE({stream:t}))a=n;return a?.parts.length?a:void 0}async function IE(e){let t=[];for(let n of e){let r=n.type==="message.received"&&!n.data.kind?n.data.message:void 0;r!==void 0?t.push({visitor:{id:n.meta?.id??crypto.randomUUID(),role:"user",parts:[{type:"text",text:r}]},events:[]}):t.at(-1)?.events.push(n)}let a=[];for(let n of t){a.push(n.visitor);let r=await W6(n.events);r&&a.push(r)}return a}var Ni=Symbol("invalid-json-value-candidate");function bv(e){let t=xv(e);if(t===Ni)throw TypeError("Expected a JSON-serializable value.");return t}function Fc(e){let t=bv(e);if(!G6(t))throw TypeError("Expected a JSON-serializable object.");return t}function xv(e,t=new WeakSet){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number")return Number.isFinite(e)?e:Ni;if(Array.isArray(e)){let n=[];for(let r of e){let o=xv(r,t);if(o===Ni)return Ni;n.push(o)}return n}if(typeof e!="object"||e===void 0||!X6(e)||t.has(e))return Ni;t.add(e);let a={};for(let[n,r]of Object.entries(e)){if(r===void 0)continue;let o=xv(r,t);if(o===Ni)return Ni;a[n]=o}return t.delete(e),a}function G6(e){return e!==null&&!Array.isArray(e)&&typeof e=="object"}function X6(e){let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var qc=f.unknown().transform((e,t)=>{try{return bv(e)}catch(a){return t.addIssue({code:"custom",message:CE(a,"Expected a JSON-serializable value.")}),f.NEVER}}),Zr=f.unknown().transform((e,t)=>{try{return Fc(e)}catch(a){return t.addIssue({code:"custom",message:CE(a,"Expected a JSON-serializable object.")}),f.NEVER}});function CE(e,t){return e instanceof Error?e.message:t}var kE=f.object({callId:f.string(),input:Zr,kind:f.literal("tool-call"),toolName:f.string()}).strict();f.object({callId:f.string(),description:f.string(),input:Zr,kind:f.literal("subagent-call"),name:f.string(),nodeId:f.string(),subagentName:f.string()}).strict(),f.object({callId:f.string(),description:f.string(),input:Zr,kind:f.literal("remote-agent-call"),name:f.string(),nodeId:f.string(),remoteAgentName:f.string()}).strict(),f.object({callId:f.string(),input:Zr,kind:f.literal("workflow-tool-call"),toolName:f.string(),workflowId:f.string()}).strict(),f.object({callId:f.string(),description:f.string(),input:Zr,kind:f.literal("subagent-call"),name:f.string(),nodeId:f.string(),subagentName:f.string()}).strict();var _te=f.object({callId:f.string(),description:f.string(),input:Zr,kind:f.literal("remote-agent-call"),name:f.string(),nodeId:f.string(),remoteAgentName:f.string()}).strict(),Pte=f.object({callId:f.string(),executeInput:qc.optional(),input:Zr,kind:f.literal("workflow-task"),nodeId:f.string().optional(),toolName:f.string(),workflowId:f.string()}).strict();f.object({callId:f.string(),input:Zr,kind:f.literal("load-skill")}).strict();f.object({callId:f.string(),isError:f.boolean().optional(),kind:f.literal("tool-result"),output:qc,toolName:f.string()}).strict(),f.object({callId:f.string(),isError:f.literal(!0),kind:f.literal("subagent-result"),origin:f.literal("dispatch"),output:qc,subagentName:f.string()}).strict(),f.object({callId:f.string(),isError:f.boolean().optional(),kind:f.literal("load-skill-result"),output:qc,name:f.string().optional()}).strict();var K6=f.object({description:f.string().describe("Optional additional context for this option.").optional(),id:f.string().describe("Stable identifier for the option."),label:f.string().describe("User-facing label for the option."),style:f.enum(["primary","danger","default"]).describe("Visual treatment hint for the option.").optional()}).strict(),Y6=f.enum(["question","session-limit","tool-approval"]),Bte=f.object({action:kE,allowFreeform:f.boolean().describe("Whether the user may answer with freeform text instead of selecting one of the provided options.").optional(),display:f.enum(["confirmation","select","text"]).describe("Rendering hint: the channel uses this to pick a UX treatment.").optional(),kind:Y6.describe("Framework-owned request source used to resolve, route, and render the response."),options:f.array(K6).describe("Selectable answer options to present to the user.").optional(),prompt:f.string().describe("The prompt to present to the user."),requestId:f.string().describe("Stable identifier for this request.")}).strict(),zte=f.object({optionId:f.string().optional(),requestId:f.string(),text:f.string().optional()}).strict();var Za="/eve/v1",qte=`${Za}/cron/:token`,TE=`${Za}/health`,LE=`${Za}/info`,ka=`${Za}/session`,Hte=`${ka}/:sessionId`,jte=`${ka}/:sessionId/cancel`,Vte=`${ka}/:sessionId/compact`,$te=`${ka}/:sessionId/clear`,Wte=`${ka}/:sessionId/reset`,Gte=`${ka}/:sessionId/stream`,Xte=`${ka}/:parentSessionId/subagents/:callId/:childSessionId/stream`,Kte=`${Za}/dev/schedules/:scheduleId`,Sv=`${Za}/dev/runtime-artifacts`,Yte=`${Sv}/rebuild`,Zte=`${Sv}/suspend`,Jte=`${Sv}/resume`;var Qte=`${Za}/connections/:name/callback/:attemptId/:token`,eae=`${Za}/callback/:token`,tae=`${Za}/task-input/:token`,aae=`${Za}/activity/:token`;function EE(e){return`${ka}/${encodeURIComponent(e)}`}function AE(e){return`${ka}/${encodeURIComponent(e)}/cancel`}function ME(e){return`${ka}/${encodeURIComponent(e)}/compact`}function RE(e){return`${ka}/${encodeURIComponent(e)}/clear`}function DE(e){return`${ka}/${encodeURIComponent(e)}/reset`}function Iv(e){return`${ka}/${encodeURIComponent(e)}/stream`}function wr(e){return typeof e=="object"&&!!e&&!Array.isArray(e)}function Hc(e){return e instanceof Error?e.message:typeof e=="string"?e:e==null?String(e):wr(e)?typeof e.message=="string"&&e.message.length>0?e.message:Z6(e):String(e)}function Ui(e){if(e instanceof Error)return e;let t=Error(Hc(e));return wr(e)&&(typeof e.name=="string"&&e.name.length>0&&(t.name=e.name),typeof e.stack=="string"&&e.stack.length>0&&(t.stack=e.stack),"cause"in e&&e.cause!==void 0&&e.cause!==e&&(t.cause=e.cause)),t}function Z6(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}var PE="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function J6(){let e=-1,t=new Uint8Array(10);return function(){let a=Date.now();if(!Number.isInteger(a)||a<0||a>0xffffffffffff)throw Error(`Cannot mint a ULID: timestamp must be an integer from 0 to ${0xffffffffffff}.`);if(a>e)e=a,_E(t);else if(!a9(t)){if(e===0xffffffffffff)throw Error("Cannot mint a ULID: random component overflowed at the maximum timestamp.");e+=1,_E(t)}return`${e9(e)}${t9(t)}`}}var Q6=J6();function _E(e){let t=globalThis.crypto;if(typeof t?.getRandomValues!="function")throw Error("Cannot mint a ULID: globalThis.crypto.getRandomValues is unavailable.");t.getRandomValues(e)}function e9(e){let t=e,a="";for(let n=0;n<10;n+=1)a=PE[t%32]+a,t=Math.floor(t/32);return a}function t9(e){let t=0,a=0,n="";for(let r of e){for(t=t<<8|r,a+=8;a>=5;)a-=5,n+=PE[t>>>a&31];t&=(1<<a)-1}return n}function a9(e){for(let t=e.length-1;t>=0;--t){let a=e[t]??0;if(a<255)return e[t]=a+1,e.fill(0,t+1),!0}return!1}var OE="x-eve-session-id";var Cv="x-eve-stream-tail-index",kv="x-eve-stream-version";var NE="1",UE="streamControlVersion",Tv={$eve:"stream.lease-ended",version:1},Dae=new TextEncoder;function xn(e){return e.type==="session.completed"||e.type==="session.failed"||e.type==="session.waiting"}function Lv(e){return e.type==="session.failed"||e.type==="step.failed"||e.type==="turn.failed"}var rm=class extends Error{constructor(t=[]){let a=t.length===0?"":` (${t.join("; ")})`;super(`The server returned an unrecognized response from the eve agent info route.${a}`);K(this,"issues");this.name="AgentInfoResponseError",this.issues=t}};var om=class extends Error{constructor(t=[]){let a=t.length===0?"":` (${t.join("; ")})`;super(`The server returned an unrecognized eve health response.${a}`);K(this,"issues");this.name="HealthResponseError",this.issues=t}};var Ja=class extends Error{constructor(t,a,n){let r=Object.freeze(Object.fromEntries(new Headers(n).entries())),o=r["content-type"]?.toLowerCase(),i=a||`Server returned ${t}.`,s;try{let l=JSON.parse(a);wr(l)&&(typeof l.error=="string"&&(i=l.error),typeof l.code=="string"&&(s=l.code))}catch{o?.includes("text/html")&&(i=`Server returned ${t} with an HTML response. Check the eve route and development server configuration.`)}super(i);K(this,"code");K(this,"status");K(this,"body");K(this,"headers");this.name="ClientError",this.code=s,this.status=t,this.body=a,this.headers=r}};function BE(e){let t,a,n,r=[],o=new Map;for(let i of e)xn(i)&&(t=i),Lv(i)&&(a=i),n9(i)&&(n=i.data.message??void 0),i.type==="input.requested"&&r.push(...i.data.requests),i.type==="authorization.required"&&o.set(i.data.name,i.data),i.type==="authorization.completed"&&o.delete(i.data.name);return{boundary:t,failure:a,inputRequests:r,message:n,pendingAuthorizations:[...o.values()],status:t?.type==="session.waiting"?"waiting":t?.type==="session.failed"?"failed":"completed"}}function n9(e){return e.type==="message.completed"&&e.data.finishReason!=="tool-calls"}function Bi(e,t){t.type==="authorization.required"&&t.data.webhookUrl!==void 0?e.add(t.data.name):t.type==="authorization.completed"&&e.delete(t.data.name)}var r9=/^\/eve\/[a-z0-9][a-z0-9_-]*$/,o9=/^\/eve\/[a-z0-9][a-z0-9_-]*\/v1$/;function Ev(e,t){let a=i9(e),n=t.startsWith("/")?t:`/${t}`;if(n===Za||n.startsWith(`${Za}/`)){if(r9.test(a))return`${a}${n.slice(4)}`;if(o9.test(a))return`${a}${n.slice(Za.length)}`}return`${a}${n}`}function i9(e){return e==="/"?"":e.endsWith("/")?e.slice(0,-1):e}function vr(e,t,a){let n=t.indexOf("?"),r=n===-1?t:t.slice(0,n),o=n===-1?"":t.slice(n+1),i=r.startsWith("/")?r:`/${r}`;if(s9(e)){let u=new URL(e),c=FE(u.pathname);return u.pathname=Ev(c,i),zE(u.searchParams,o),qE(u.searchParams,a),u.hash="",u.toString()}let s=new URL(e,"http://eve.local"),l=FE(s.pathname);return zE(s.searchParams,o),qE(s.searchParams,a),`${Ev(l,i)}${l9(s.searchParams)}`}function zE(e,t){if(t.length!==0)for(let[a,n]of new URLSearchParams(t))e.append(a,n)}function s9(e){return/^[a-z][a-z\d+\-.]*:/i.test(e)}function FE(e){return e==="/"?"":e.endsWith("/")?e.slice(0,-1):e}function qE(e,t){if(t!==void 0)for(let[a,n]of Object.entries(t))e.set(a,n)}function l9(e){let t=e.toString();return t.length===0?"":`?${t}`}function HE(e){let t;for(let a of e)u9(a)&&(t=a.data.result);return t}function u9(e){return e.type==="result.completed"}var Av=Symbol("consumeMessageResponse"),Mv=Symbol("acceptedDeliveryId"),jE,jc,Ho,Vc,$c,Ll,zi,im,$E,VE,Rv=(VE=class{constructor(e){ue(this,im);K(this,"sessionId");K(this,jE);ue(this,jc);ue(this,Ho);ue(this,Vc,!1);ue(this,$c);ue(this,Ll,!1);ue(this,zi,Promise.withResolvers());F(this,jc,e.cancelTurn),this.sessionId=e.sessionId,this[Mv]=e.deliveryId,F(this,$c,e.createStream)}cancel(){if(b(this,Ll))return Promise.resolve({status:"no_active_turn"});if(b(this,Ho)!==void 0)return b(this,Ho);let e=b(this,zi).promise.then(t=>t===void 0?{status:"no_active_turn"}:b(this,jc).call(this,t));return F(this,Ho,e),e.catch(()=>{!b(this,Ll)&&b(this,Ho)===e&&F(this,Ho,void 0)}),e}async result(){let e=[];for await(let a of this)e.push(a);let t=BE(e);return{data:HE(e),events:e,inputRequests:t.inputRequests,message:t.message,sessionId:this.sessionId,status:t.status}}[(jE=Mv,Symbol.asyncIterator)](){return this[Av]()}[Av](e){if(b(this,Vc))throw Error("MessageResponse has already been consumed.");return F(this,Vc,!0),Y(this,im,$E).call(this,e)}},jc=new WeakMap,Ho=new WeakMap,Vc=new WeakMap,$c=new WeakMap,Ll=new WeakMap,zi=new WeakMap,im=new WeakSet,$E=async function*(e){try{for await(let t of b(this,$c).call(this,e))t.type==="turn.started"?b(this,zi).resolve(t.data.turnId):xn(t)&&(F(this,Ll,!0),b(this,zi).resolve(void 0)),yield t}finally{b(this,zi).resolve(void 0)}},VE);function Dv(e){return e[Mv]}function WE(e,t){return e[Av](t)}function XE(e,t){switch(e){case"21":case"22":case"23":case"24":return c9(e,t);case"25":return d9(t);default:return f9(e)}}function c9(e,t){if(t.type==="message.appended")return GE(t.data.messageSoFar,t.data.messageDelta,"message",e),{data:{messageDelta:t.data.messageDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,turnId:t.data.turnId},meta:t.meta,type:"message.appended"};if(t.type==="reasoning.appended")return GE(t.data.reasoningSoFar,t.data.reasoningDelta,"reasoning",e),{data:{reasoningDelta:t.data.reasoningDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,turnId:t.data.turnId},meta:t.meta,type:"reasoning.appended"};if(t.type==="action.input.appended"){if(e!==void 0&&e!=="24")throw TypeError(`Invalid action input append for stream version ${e}.`);return p9(t.data.inputTextOffset,e),{data:{callId:t.data.callId,inputTextDelta:t.data.inputTextDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,toolName:t.data.toolName,turnId:t.data.turnId},meta:t.meta,type:"action.input.appended"}}return t}function d9(e){return e.type==="message.appended"?(_v(e.data.messageDelta,"message"),Wc(e.data,"messageOffset","message"),Wc(e.data,"messageSoFar","message")):e.type==="reasoning.appended"?(_v(e.data.reasoningDelta,"reasoning"),Wc(e.data,"reasoningOffset","reasoning"),Wc(e.data,"reasoningSoFar","reasoning")):e.type==="action.input.appended"&&(_v(e.data.inputTextDelta,"action input"),Wc(e.data,"inputTextOffset","action input")),e}function _v(e,t){if(typeof e!="string")throw TypeError(`Invalid ${t} append delta for stream version 25.`)}function Wc(e,t,a){if(t in e)throw TypeError(`Invalid ${a} append shape for stream version 25.`)}function f9(e){throw TypeError(`Unsupported message stream version: ${String(e)}.`)}function p9(e,t){if(!Number.isSafeInteger(e)||e<0){let a=t===void 0?"persisted stream":`stream version ${t}`;throw TypeError(`Invalid action input append offset for ${a}.`)}}function GE(e,t,a,n){let r=e.length-t.length;if(r<0||e.slice(r)!==t){let o=n===void 0?"persisted stream":`stream version ${n}`;throw TypeError(`Invalid cumulative ${a} append for ${o}.`)}}function Pv(e){if(e instanceof DOMException)return e.name==="AbortError";if(!(e instanceof Error))return!1;let t="code"in e&&typeof e.code=="string"?e.code:void 0;return e.name==="AbortError"||e.message==="terminated"||t==="UND_ERR_SOCKET"||e instanceof TypeError&&/^(?:failed to fetch|fetch failed)$/i.test(e.message)||/abort|cancel|disconnect|premature close|socket|terminated/i.test(e.message)}async function*ZE(e,t){let a=e.getReader(),n=new TextDecoder,r="",o=!1,i=()=>{a.cancel().catch(()=>{})};t.signal?.addEventListener("abort",i,{once:!0});try{for(;;){t.signal?.throwIfAborted();let l=await m9(a,t?.idleTimeoutMs);if(t.signal?.throwIfAborted(),l.done){o=!0,r+=n.decode();break}l.value&&(r+=n.decode(l.value,{stream:!0}));let u=r.indexOf(`
|
|
136
|
-
`);for(;u!==-1;){let c=r.slice(0,u).trim();if(r=r.slice(u+1),c.length>0){let d=JSON.parse(c);t.controlVersion==="1"&&
|
|
137
|
-
`)}}let s=r.trim();if(s.length>0){let l=JSON.parse(s);t.controlVersion==="1"&&KE(l)?t.onLeaseEnded?.():yield YE(l,t.streamVersion)}}finally{t.signal?.removeEventListener("abort",i),o||a.cancel().catch(()=>{}),a.releaseLock()}}function KE(e){if(typeof e!="object"||!e)return!1;let t=e;return t.$eve===Tv.$eve&&t.version===Tv.version}function YE(e,t){return XE(t,e)}async function m9(e,t){let a;try{return t===void 0?await e.read():await Promise.race([e.read(),new Promise((n,r)=>{a=setTimeout(()=>r(new DOMException("Session stream was idle.","AbortError")),t)})])}catch(n){throw n instanceof TypeError?Error("Session stream disconnected.",{cause:n}):n}finally{a!==void 0&&clearTimeout(a)}}var h9={21:!0,22:!0,23:!0,24:!0,25:!0};function JE(e){let t=e.get(kv);if(t!==null&&Object.hasOwn(h9,t))return t;throw TypeError(t===null?`Missing ${kv} response header.`:`Unsupported message stream version: ${t}.`)}var Fi={retryableErrorStatuses:new Set([404,409,425,500,502,503,504]),streamIdleReconnectPolicy:{baseDelayMs:250,maxAttempts:5,maxDelayMs:4e3},streamOpenReconnectPolicy:{baseDelayMs:250,maxAttempts:12,maxDelayMs:5e3}},g9={...Fi,streamIdleReconnectPolicy:{...Fi.streamIdleReconnectPolicy,maxAttempts:0},streamOpenReconnectPolicy:{...Fi.streamOpenReconnectPolicy,maxAttempts:1}};function QE(e,t){return{...t,...e}}function eA(e,t=!1){if(e&&"reconnect"in e&&e.reconnect===!1)return g9;let a=e;return{retryableErrorStatuses:a?.retryableErrorStatuses?new Set(a.retryableErrorStatuses):Fi.retryableErrorStatuses,streamIdleReconnectPolicy:QE(a?.streamIdleReconnectPolicy,{...Fi.streamIdleReconnectPolicy,maxAttempts:t?1/0:Fi.streamIdleReconnectPolicy.maxAttempts}),streamOpenReconnectPolicy:QE(a?.streamOpenReconnectPolicy,Fi.streamOpenReconnectPolicy)}}async function*Ov(e){if(e.follow===!1&&e.startIndex<0)throw Error("stream({ follow: false }) requires a nonnegative startIndex; a tail-relative cursor cannot be bounded.");let t=()=>eA(e.resolveReconnectPolicy===void 0?e.streamReconnectPolicy:e.resolveReconnectPolicy(),e.keepAlive),a=t(),n=a.streamIdleReconnectPolicy,r=e.startIndex,o=n.baseDelayMs,i=0,s=!0,l,u=!1;for(;;){a=t(),n=a.streamIdleReconnectPolicy;let c;try{c=await y9({...e,retryPolicy:a,startIndex:r,requestTailIndex:(e.follow===!1||e.onCaughtUp!==void 0)&&l===void 0})}catch(m){if(e.signal?.aborted)return;throw m}if((e.follow===!1||e.onCaughtUp!==void 0)&&l===void 0&&(l=c.tailIndex,l===void 0))throw c.close(),Error(`stream({ follow: false }) requires the server to report the ${Cv} header. The agent may be running an older eve version.`);if(!u&&l!==void 0&&r>l&&(u=!0,e.onCaughtUp?.()),e.follow===!1&&l!==void 0&&r>l){c.close();return}let d=!1,p=!1;try{for await(let m of ZE(c.body,{signal:e.signal,controlVersion:c.controlVersion,idleTimeoutMs:e.streamReadIdleTimeoutMs??15e3,onLeaseEnded:()=>{p=!0},streamVersion:c.streamVersion}))if(r+=1,d=!0,o=n.baseDelayMs,i=0,yield m,!u&&l!==void 0&&r>l&&(u=!0,e.onCaughtUp?.()),e.follow===!1&&l!==void 0&&r>l)return}catch(m){if(!Pv(m))throw m}finally{c.close()}if(n=t().streamIdleReconnectPolicy,e.signal?.aborted||e.startIndex<0||n.maxAttempts===0)return;if(!p){if(!d&&!s&&(i+=1)>=n.maxAttempts||(s=!1,await Gc(o,e.signal),e.signal?.aborted))return;o=Math.min(o*2,n.maxDelayMs)}}}async function y9(e){let t=e.retryPolicy??eA(e.streamReconnectPolicy,e.keepAlive),a=t.streamOpenReconnectPolicy,n,r,o,i=a.baseDelayMs,s=e.startIndex>=0&&t.streamIdleReconnectPolicy.maxAttempts>0?NE:void 0,l={};s!==void 0&&(l[UE]=s),e.startIndex!==0&&(l.startIndex=String(e.startIndex)),e.requestTailIndex===!0&&(l.includeTailIndex="1");for(let u=0;u<a.maxAttempts;u+=1){e.signal?.throwIfAborted();let c=vr(e.host,e.path,Object.keys(l).length>0?l:void 0),d=await e.resolveHeaders();e.signal?.throwIfAborted();let p=new AbortController,m=e.signal?AbortSignal.any([e.signal,p.signal]):p.signal,h;try{h=await fetch(c,{cache:"no-store",headers:d,redirect:e.redirect,signal:m})}catch(v){if(e.signal?.aborted||!Pv(v)||u===a.maxAttempts-1)throw v;await Gc(i,e.signal),i=Math.min(i*2,a.maxDelayMs);continue}if(h.ok){if(!h.body)throw new Ja(h.status,"Response body is null.",h.headers);let v=!1;return{body:h.body,close:()=>{v||(v=!0,h.body?.cancel().catch(()=>{}),p.abort())},controlVersion:s,streamVersion:JE(h.headers),tailIndex:w9(h.headers)}}if(n=h.status,r=await h.text(),o=h.headers,!t.retryableErrorStatuses.has(h.status))throw new Ja(h.status,r,h.headers);u<a.maxAttempts-1&&(await Gc(i,e.signal),i=Math.min(i*2,a.maxDelayMs))}throw new Ja(n??0,r??"Failed to open message stream.",o)}function w9(e){let t=e.get(Cv);if(t===null||!/^-?\d+$/.test(t))return;let a=Number(t);return Number.isSafeInteger(a)?a:void 0}async function Gc(e,t){t?.aborted||await new Promise(a=>{let n=()=>{clearTimeout(r),a()},r=setTimeout(()=>{t?.removeEventListener("abort",n),a()},e);t?.addEventListener("abort",n,{once:!0})})}var tA=f.discriminatedUnion("status",[f.strictObject({ok:f.literal(!0),sessionId:f.string().min(1),status:f.literal("accepted")}),f.strictObject({ok:f.literal(!0),status:f.literal("no_active_turn")})]);var aA=f.discriminatedUnion("status",[f.object({ok:f.literal(!0),sessionId:f.string().min(1),status:f.literal("accepted")}),f.object({ok:f.literal(!0),status:f.literal("no_active_session")})]);var nA=f.discriminatedUnion("status",[f.object({ok:f.literal(!0),sessionId:f.string().min(1),status:f.literal("accepted")}),f.object({ok:f.literal(!0),status:f.literal("no_active_session")})]);var rA=f.discriminatedUnion("status",[f.object({ok:f.literal(!0),previousSessionId:f.string().min(1),status:f.literal("reset")}),f.object({ok:f.literal(!0),status:f.literal("no_active_session")})]);async function oA(e){let{signal:t,...a}=e.options??{},{payload:n,response:r}=await sm({body:a,context:e.context,operation:"Cancel",path:AE(e.sessionId),signal:t}),o=tA.safeParse(n);if(!o.success||o.data.status==="accepted"&&o.data.sessionId!==e.sessionId)throw Error(`Cancel route returned an invalid response (${r.status}).`);return o.data.status==="accepted"?{sessionId:o.data.sessionId,status:"accepted"}:{status:"no_active_turn"}}async function iA(e){let{payload:t}=await sm({context:e.context,operation:"Clear",path:RE(e.sessionId)}),a=aA.safeParse(t);if(!a.success||a.data.status==="accepted"&&a.data.sessionId!==e.sessionId)throw Error("Clear route returned an invalid response.");return a.data.status==="accepted"?{sessionId:a.data.sessionId,status:"accepted"}:{status:"no_active_session"}}async function sA(e){let{payload:t}=await sm({context:e.context,operation:"Compact",path:ME(e.sessionId)}),a=nA.safeParse(t);if(!a.success||a.data.status==="accepted"&&a.data.sessionId!==e.sessionId)throw Error("Compact route returned an invalid response.");return a.data.status==="accepted"?{sessionId:a.data.sessionId,status:"accepted"}:{status:"no_active_session"}}async function lA(e){let{signal:t,...a}=e.options??{},{payload:n}=await sm({body:a,context:e.context,operation:"Reset",path:DE(e.sessionId),signal:t}),r=rA.safeParse(n);if(!r.success||r.data.status==="reset"&&r.data.previousSessionId!==e.sessionId)throw Error("Reset route returned an invalid response.");return r.data.status==="reset"?{previousSessionId:r.data.previousSessionId,status:"reset"}:{status:"no_active_session"}}async function sm(e){let t=await e.context.resolveHeaders();t.set("content-type","application/json");let a=await fetch(vr(e.context.host,e.path),v9({body:e.body===void 0?void 0:JSON.stringify(e.body),headers:t,method:"POST",signal:e.signal},e.context.redirect)),n=await a.text();if(!a.ok)throw new Ja(a.status,n,a.headers);try{return{payload:JSON.parse(n),response:a}}catch{throw Error(`${e.operation} route returned invalid JSON (${a.status}).`)}}function v9(e,t){return t===void 0?e:{...e,redirect:t}}function Xc(e,t){let a=typeof e;if(a!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!Xc(e[r],t[r]))return!1;return!0}if(a==="object"){if(!e||!t)return e===t;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n)if(!Xc(e[o],t[o]))return!1;return!0}return e===t}function Qn(e){return encodeURI(x9(e))}function x9(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var b9={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},S9={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},I9={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},C9=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");function qi(e,t=Object.create(null),a=C9,n=""){if(e&&typeof e=="object"&&!Array.isArray(e)){let o=e.$id||e.id;if(o){let i=new URL(o,a.href);i.hash.length>1?t[i.href]=e:(i.hash="",n===""?a=i:qi(e,t,a))}}else if(e!==!0&&e!==!1)return t;let r=a.href+(n?"#"+n:"");if(t[r]!==void 0)throw Error(`Duplicate schema URI "${r}".`);if(t[r]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:r}),e.$ref&&e.__absolute_ref__===void 0){let o=new URL(e.$ref,a.href);o.hash=o.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:o.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let o=new URL(e.$recursiveRef,a.href);o.hash=o.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:o.href})}if(e.$anchor){let o=new URL("#"+e.$anchor,a.href);t[o.href]=e}for(let o in e){if(I9[o])continue;let i=`${n}/${Qn(o)}`,s=e[o];if(Array.isArray(s)){if(b9[o]){let l=s.length;for(let u=0;u<l;u++)qi(s[u],t,a,`${i}/${u}`)}}else if(S9[o])for(let l in s)qi(s[l],t,a,`${i}/${Qn(l)}`);else qi(s,t,a,i)}return t}var k9=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,T9=[0,31,28,31,30,31,30,31,31,30,31,30,31],L9=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,E9=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,A9=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,M9=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,R9=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,D9=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,_9=/^(?:\/(?:[^~/]|~0|~1)*)*$/,P9=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,O9=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,N9=e=>{if(e[0]==='"')return!1;let[t,a,...n]=e.split("@");return!t||!a||n.length!==0||t.length>64||a.length>253||t[0]==="."||t.endsWith(".")||t.includes("..")||!/^[a-z0-9.-]+$/i.test(a)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:a.split(".").every(r=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(r))},U9=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,B9=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,z9=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function xr(e){return e.test.bind(e)}var uA={date:cA,time:dA.bind(void 0,!1),"date-time":H9,duration:z9,uri:$9,"uri-reference":xr(A9),"uri-template":xr(M9),url:xr(R9),email:N9,hostname:xr(E9),ipv4:xr(U9),ipv6:xr(B9),regex:G9,uuid:xr(D9),"json-pointer":xr(_9),"json-pointer-uri-fragment":xr(P9),"relative-json-pointer":xr(O9)};function F9(e){return e%4==0&&(e%100!=0||e%400==0)}function cA(e){let t=e.match(k9);if(!t)return!1;let a=+t[1],n=+t[2],r=+t[3];return n>=1&&n<=12&&r>=1&&r<=(n==2&&F9(a)?29:T9[n])}function dA(e,t){let a=t.match(L9);if(!a)return!1;let n=+a[1],r=+a[2],o=+a[3],i=!!a[5];return(n<=23&&r<=59&&o<=59||n==23&&r==59&&o==60)&&(!e||i)}var q9=/t|\s/i;function H9(e){let t=e.split(q9);return t.length==2&&cA(t[0])&&dA(!0,t[1])}var j9=/\/|:/,V9=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function $9(e){return j9.test(e)&&V9.test(e)}var W9=/[^\\]\\Z/;function G9(e){if(W9.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var X9;(function(e){e[e.Flag=1]="Flag",e[e.Basic=2]="Basic",e[e.Detailed=4]="Detailed"})(X9||(X9={}));function K9(e){let t=0,a=e.length,n=0,r;for(;n<a;)t++,r=e.charCodeAt(n++),r>=55296&&r<=56319&&n<a&&(r=e.charCodeAt(n),(r&64512)==56320&&n++);return t}function Ut(e,t,a="2019-09",n=qi(t),r=!0,o=null,i="#",s="#",l=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:i,keyword:"false",keywordLocation:i,error:"False boolean schema."}]};let u=typeof e,c;switch(u){case"boolean":case"number":case"string":c=u;break;case"object":c=e===null?"null":Array.isArray(e)?"array":"object";break;default:throw Error(`Instances of "${u}" type are not supported.`)}let{$ref:d,$recursiveRef:p,$recursiveAnchor:m,type:h,const:v,enum:I,required:y,not:w,anyOf:g,allOf:S,oneOf:E,if:T,then:R,else:O,format:U,properties:A,patternProperties:Q,additionalProperties:$,unevaluatedProperties:q,minProperties:Z,maxProperties:X,propertyNames:B,dependentRequired:P,dependentSchemas:J,dependencies:ge,prefixItems:C,items:ze,additionalItems:ot,unevaluatedItems:x,contains:ae,minContains:re,maxContains:Ce,minItems:We,maxItems:be,uniqueItems:Oe,minimum:we,maximum:ce,exclusiveMinimum:Le,exclusiveMaximum:ie,multipleOf:xe,minLength:Ne,maxLength:_e,pattern:Fe,__absolute_ref__:Ae,__absolute_recursive_ref__:de}=t,W=[];if(m===!0&&o===null&&(o=t),p==="#"){let le=o===null?n[de]:o,oe=`${s}/$recursiveRef`,ke=Ut(e,o===null?t:o,a,n,r,le,i,oe,l);ke.valid||W.push({instanceLocation:i,keyword:"$recursiveRef",keywordLocation:oe,error:"A subschema had errors."},...ke.errors)}if(d!==void 0){let le=n[Ae||d];if(le===void 0){let ee=`Unresolved $ref "${d}".`;throw Ae&&Ae!==d&&(ee+=` Absolute URI "${Ae}".`),ee+=`
|
|
135
|
+
`)}})}};var xv=am(()=>Cl(f.union([f.strictObject({type:f.literal("text-start"),id:f.string(),providerMetadata:pe.optional()}),f.strictObject({type:f.literal("text-delta"),id:f.string(),delta:f.string(),providerMetadata:pe.optional()}),f.strictObject({type:f.literal("text-end"),id:f.string(),providerMetadata:pe.optional()}),f.strictObject({type:f.literal("error"),errorText:f.string()}),f.strictObject({type:f.literal("tool-input-start"),toolCallId:f.string(),toolName:f.string(),providerExecuted:f.boolean().optional(),providerMetadata:pe.optional(),dynamic:f.boolean().optional(),title:f.string().optional()}),f.strictObject({type:f.literal("tool-input-delta"),toolCallId:f.string(),inputTextDelta:f.string()}),f.strictObject({type:f.literal("tool-input-available"),toolCallId:f.string(),toolName:f.string(),input:f.unknown(),providerExecuted:f.boolean().optional(),providerMetadata:pe.optional(),dynamic:f.boolean().optional(),title:f.string().optional()}),f.strictObject({type:f.literal("tool-input-error"),toolCallId:f.string(),toolName:f.string(),input:f.unknown(),providerExecuted:f.boolean().optional(),providerMetadata:pe.optional(),dynamic:f.boolean().optional(),errorText:f.string(),title:f.string().optional()}),f.strictObject({type:f.literal("tool-approval-request"),approvalId:f.string(),toolCallId:f.string()}),f.strictObject({type:f.literal("tool-output-available"),toolCallId:f.string(),output:f.unknown(),providerExecuted:f.boolean().optional(),providerMetadata:pe.optional(),dynamic:f.boolean().optional(),preliminary:f.boolean().optional()}),f.strictObject({type:f.literal("tool-output-error"),toolCallId:f.string(),errorText:f.string(),providerExecuted:f.boolean().optional(),providerMetadata:pe.optional(),dynamic:f.boolean().optional()}),f.strictObject({type:f.literal("tool-output-denied"),toolCallId:f.string()}),f.strictObject({type:f.literal("reasoning-start"),id:f.string(),providerMetadata:pe.optional()}),f.strictObject({type:f.literal("reasoning-delta"),id:f.string(),delta:f.string(),providerMetadata:pe.optional()}),f.strictObject({type:f.literal("reasoning-end"),id:f.string(),providerMetadata:pe.optional()}),f.strictObject({type:f.literal("source-url"),sourceId:f.string(),url:f.string(),title:f.string().optional(),providerMetadata:pe.optional()}),f.strictObject({type:f.literal("source-document"),sourceId:f.string(),mediaType:f.string(),title:f.string(),filename:f.string().optional(),providerMetadata:pe.optional()}),f.strictObject({type:f.literal("file"),url:f.string(),mediaType:f.string(),providerMetadata:pe.optional()}),f.strictObject({type:f.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:f.string().optional(),data:f.unknown(),transient:f.boolean().optional()}),f.strictObject({type:f.literal("start-step")}),f.strictObject({type:f.literal("finish-step")}),f.strictObject({type:f.literal("start"),messageId:f.string().optional(),messageMetadata:f.unknown().optional()}),f.strictObject({type:f.literal("finish"),finishReason:f.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:f.unknown().optional()}),f.strictObject({type:f.literal("abort"),reason:f.string().optional()}),f.strictObject({type:f.literal("message-metadata"),messageMetadata:f.unknown()})])));function B6(e){return e.type.startsWith("data-")}function vv(e){return e.type.startsWith("tool-")}function z6(e){return e.type==="dynamic-tool"}function rm(e){return vv(e)||z6(e)}function sE(e){return e.type.split("-").slice(1).join("-")}function vE({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function xE({stream:e,messageMetadataSchema:t,dataPartSchemas:a,runUpdateMessageJob:n,onError:r,onToolCall:o,onData:i}){return e.pipeThrough(new TransformStream({async transform(s,l){await n(async({state:u,write:c})=>{var d,p,m,h;function v(g){let E=u.message.parts.filter(rm).find(T=>T.toolCallId===g);if(E==null)throw new Tl({chunkType:"tool-invocation",chunkId:g,message:`No tool invocation found for tool call ID "${g}".`});return E}function I(g){var S;let E=u.message.parts.find(O=>vv(O)&&O.toolCallId===g.toolCallId),T=g,R=E;if(E!=null){E.state=g.state,R.input=T.input,R.output=T.output,R.errorText=T.errorText,R.rawInput=T.rawInput,R.preliminary=T.preliminary,g.title!==void 0&&(R.title=g.title),R.providerExecuted=(S=T.providerExecuted)!=null?S:E.providerExecuted;let O=T.providerMetadata;if(O!=null)if(g.state==="output-available"||g.state==="output-error"){let U=E;U.resultProviderMetadata=O}else E.callProviderMetadata=O}else u.message.parts.push({type:`tool-${g.toolName}`,toolCallId:g.toolCallId,state:g.state,title:g.title,input:T.input,output:T.output,rawInput:T.rawInput,errorText:T.errorText,providerExecuted:T.providerExecuted,preliminary:T.preliminary,...T.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:T.providerMetadata}:{},...T.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:T.providerMetadata}:{}})}function y(g){var S,E;let T=u.message.parts.find(U=>U.type==="dynamic-tool"&&U.toolCallId===g.toolCallId),R=g,O=T;if(T!=null){T.state=g.state,O.toolName=g.toolName,O.input=R.input,O.output=R.output,O.errorText=R.errorText,O.rawInput=(S=R.rawInput)!=null?S:O.rawInput,O.preliminary=R.preliminary,g.title!==void 0&&(O.title=g.title),O.providerExecuted=(E=R.providerExecuted)!=null?E:T.providerExecuted;let U=R.providerMetadata;if(U!=null)if(g.state==="output-available"||g.state==="output-error"){let A=T;A.resultProviderMetadata=U}else T.callProviderMetadata=U}else u.message.parts.push({type:"dynamic-tool",toolName:g.toolName,toolCallId:g.toolCallId,state:g.state,input:R.input,output:R.output,errorText:R.errorText,preliminary:R.preliminary,providerExecuted:R.providerExecuted,title:g.title,...R.providerMetadata!=null&&(g.state==="output-available"||g.state==="output-error")?{resultProviderMetadata:R.providerMetadata}:{},...R.providerMetadata!=null&&!(g.state==="output-available"||g.state==="output-error")?{callProviderMetadata:R.providerMetadata}:{}})}async function w(g){if(g!=null){let S=u.message.metadata!=null?wE(u.message.metadata,g):g;t!=null&&await nm({value:S,schema:t,context:{field:"message.metadata",entityId:u.message.id}}),u.message.metadata=S}}switch(s.type){case"text-start":{let g={type:"text",text:"",providerMetadata:s.providerMetadata,state:"streaming"};u.activeTextParts[s.id]=g,u.message.parts.push(g),c();break}case"text-delta":{let g=u.activeTextParts[s.id];if(g==null)throw new Tl({chunkType:"text-delta",chunkId:s.id,message:`Received text-delta for missing text part with ID "${s.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});g.text+=s.delta,g.providerMetadata=(d=s.providerMetadata)!=null?d:g.providerMetadata,c();break}case"text-end":{let g=u.activeTextParts[s.id];if(g==null)throw new Tl({chunkType:"text-end",chunkId:s.id,message:`Received text-end for missing text part with ID "${s.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});g.state="done",g.providerMetadata=(p=s.providerMetadata)!=null?p:g.providerMetadata,delete u.activeTextParts[s.id],c();break}case"reasoning-start":{let g={type:"reasoning",text:"",providerMetadata:s.providerMetadata,state:"streaming"};u.activeReasoningParts[s.id]=g,u.message.parts.push(g),c();break}case"reasoning-delta":{let g=u.activeReasoningParts[s.id];if(g==null)throw new Tl({chunkType:"reasoning-delta",chunkId:s.id,message:`Received reasoning-delta for missing reasoning part with ID "${s.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});g.text+=s.delta,g.providerMetadata=(m=s.providerMetadata)!=null?m:g.providerMetadata,c();break}case"reasoning-end":{let g=u.activeReasoningParts[s.id];if(g==null)throw new Tl({chunkType:"reasoning-end",chunkId:s.id,message:`Received reasoning-end for missing reasoning part with ID "${s.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});g.providerMetadata=(h=s.providerMetadata)!=null?h:g.providerMetadata,g.state="done",delete u.activeReasoningParts[s.id],c();break}case"file":{u.message.parts.push({type:"file",mediaType:s.mediaType,url:s.url,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{}}),c();break}case"source-url":{u.message.parts.push({type:"source-url",sourceId:s.sourceId,url:s.url,title:s.title,providerMetadata:s.providerMetadata}),c();break}case"source-document":{u.message.parts.push({type:"source-document",sourceId:s.sourceId,mediaType:s.mediaType,title:s.title,filename:s.filename,providerMetadata:s.providerMetadata}),c();break}case"tool-input-start":{let g=u.message.parts.filter(vv);u.partialToolCalls[s.toolCallId]={text:"",toolName:s.toolName,index:g.length,dynamic:s.dynamic,title:s.title},s.dynamic?y({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,providerMetadata:s.providerMetadata}):I({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,providerMetadata:s.providerMetadata}),c();break}case"tool-input-delta":{let g=u.partialToolCalls[s.toolCallId];if(g==null)throw new Tl({chunkType:"tool-input-delta",chunkId:s.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${s.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});g.text+=s.inputTextDelta;let{value:S}=await Fc(g.text);g.dynamic?y({toolCallId:s.toolCallId,toolName:g.toolName,state:"input-streaming",input:S,title:g.title}):I({toolCallId:s.toolCallId,toolName:g.toolName,state:"input-streaming",input:S,title:g.title}),c();break}case"tool-input-available":{s.dynamic?y({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title}):I({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title}),c(),o&&!s.providerExecuted&&await o({toolCall:s});break}case"tool-input-error":{let g=u.message.parts.filter(rm).find(E=>E.toolCallId===s.toolCallId);(g!=null?g.type==="dynamic-tool":!!s.dynamic)?y({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata}):I({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:void 0,rawInput:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata}),c();break}case"tool-approval-request":{let g=v(s.toolCallId);g.state="approval-requested",g.approval={id:s.approvalId},c();break}case"tool-output-denied":{let g=v(s.toolCallId);g.state="output-denied",c();break}case"tool-output-available":{let g=v(s.toolCallId);g.type==="dynamic-tool"?y({toolCallId:s.toolCallId,toolName:g.toolName,state:"output-available",input:g.input,output:s.output,preliminary:s.preliminary,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:g.title}):I({toolCallId:s.toolCallId,toolName:sE(g),state:"output-available",input:g.input,output:s.output,providerExecuted:s.providerExecuted,preliminary:s.preliminary,providerMetadata:s.providerMetadata,title:g.title}),c();break}case"tool-output-error":{let g=v(s.toolCallId);g.type==="dynamic-tool"?y({toolCallId:s.toolCallId,toolName:g.toolName,state:"output-error",input:g.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:g.title}):I({toolCallId:s.toolCallId,toolName:sE(g),state:"output-error",input:g.input,rawInput:g.rawInput,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.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":{s.messageId!=null&&(u.message.id=s.messageId),await w(s.messageMetadata),(s.messageId!=null||s.messageMetadata!=null)&&c();break}case"finish":{s.finishReason!=null&&(u.finishReason=s.finishReason),await w(s.messageMetadata),s.messageMetadata!=null&&c();break}case"message-metadata":{await w(s.messageMetadata),s.messageMetadata!=null&&c();break}case"error":{r?.(new Error(s.errorText));break}default:if(B6(s)){if(a?.[s.type]!=null){let E=u.message.parts.findIndex(R=>"id"in R&&"data"in R&&R.id===s.id&&R.type===s.type),T=E>=0?E:u.message.parts.length;await nm({value:s.data,schema:a[s.type],context:{field:`message.parts[${T}].data`,entityName:s.type,entityId:s.id}})}let g=s;if(g.transient){i?.(g);break}let S=g.id!=null?u.message.parts.find(E=>g.type===E.type&&g.id===E.id):void 0;S!=null?S.data=g.data:u.message.parts.push(g),i?.(g),c()}}l.enqueue(s)})}}))}function F6(e){let t=e.pipeThrough(new TransformStream);return t[Symbol.asyncIterator]=function(){let a=this.getReader(),n=!1;async function r(o){var i;if(!n){n=!0;try{o&&await((i=a.cancel)==null?void 0:i.call(a))}finally{try{a.releaseLock()}catch{}}}}return{async next(){if(n)return{done:!0,value:void 0};let{done:o,value:i}=await a.read();return o?(await r(!0),{done:!0,value:void 0}):{done:!1,value:i}},async return(){return await r(!0),{done:!0,value:void 0}},async throw(o){throw await r(!0),o}}},t}async function bE({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 rte=mr({prefix:"aitxt",size:24});function SE({message:e,stream:t,onError:a,terminateOnError:n=!1}){var r;let o,i=!1,s=new ReadableStream({start(c){o=c}}),l=vE({messageId:(r=e?.id)!=null?r:"",lastMessage:e}),u=c=>{a?.(c),!i&&n&&(i=!0,o?.error(c))};return bE({stream:xE({stream:t,runUpdateMessageJob(c){return c({state:l,write:()=>{o?.enqueue(structuredClone(l.message))}})},onError:u}),onError:u}).finally(()=>{i||o?.close()}),F6(s)}var ste=am(()=>Cl(f.array(f.object({id:f.string(),role:f.enum(["system","user","assistant"]),metadata:f.unknown().optional(),parts:f.array(f.union([f.object({type:f.literal("text"),text:f.string(),state:f.enum(["streaming","done"]).optional(),providerMetadata:pe.optional()}),f.object({type:f.literal("reasoning"),text:f.string(),state:f.enum(["streaming","done"]).optional(),providerMetadata:pe.optional()}),f.object({type:f.literal("source-url"),sourceId:f.string(),url:f.string(),title:f.string().optional(),providerMetadata:pe.optional()}),f.object({type:f.literal("source-document"),sourceId:f.string(),mediaType:f.string(),title:f.string(),filename:f.string().optional(),providerMetadata:pe.optional()}),f.object({type:f.literal("file"),mediaType:f.string(),filename:f.string().optional(),url:f.string(),providerMetadata:pe.optional()}),f.object({type:f.literal("step-start")}),f.object({type:f.string().startsWith("data-"),id:f.string().optional(),data:f.unknown()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("input-streaming"),input:f.unknown().optional(),providerExecuted:f.boolean().optional(),callProviderMetadata:pe.optional(),output:f.never().optional(),errorText:f.never().optional(),approval:f.never().optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("input-available"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:pe.optional(),approval:f.never().optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("approval-requested"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:pe.optional(),approval:f.object({id:f.string(),approved:f.never().optional(),reason:f.never().optional()})}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("approval-responded"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:pe.optional(),approval:f.object({id:f.string(),approved:f.boolean(),reason:f.string().optional()})}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("output-available"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.unknown(),errorText:f.never().optional(),callProviderMetadata:pe.optional(),resultProviderMetadata:pe.optional(),preliminary:f.boolean().optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional()}).optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("output-error"),input:f.unknown(),rawInput:f.unknown().optional(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.string(),callProviderMetadata:pe.optional(),resultProviderMetadata:pe.optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional()}).optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),state:f.literal("output-denied"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:pe.optional(),approval:f.object({id:f.string(),approved:f.literal(!1),reason:f.string().optional()})}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("input-streaming"),providerExecuted:f.boolean().optional(),callProviderMetadata:pe.optional(),input:f.unknown().optional(),output:f.never().optional(),errorText:f.never().optional(),approval:f.never().optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("input-available"),providerExecuted:f.boolean().optional(),input:f.unknown(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:pe.optional(),approval:f.never().optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("approval-requested"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:pe.optional(),approval:f.object({id:f.string(),approved:f.never().optional(),reason:f.never().optional()})}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("approval-responded"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:pe.optional(),approval:f.object({id:f.string(),approved:f.boolean(),reason:f.string().optional()})}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("output-available"),providerExecuted:f.boolean().optional(),input:f.unknown(),output:f.unknown(),errorText:f.never().optional(),callProviderMetadata:pe.optional(),resultProviderMetadata:pe.optional(),preliminary:f.boolean().optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional()}).optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("output-error"),providerExecuted:f.boolean().optional(),input:f.unknown(),rawInput:f.unknown().optional(),output:f.never().optional(),errorText:f.string(),callProviderMetadata:pe.optional(),resultProviderMetadata:pe.optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional()}).optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),state:f.literal("output-denied"),providerExecuted:f.boolean().optional(),input:f.unknown(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:pe.optional(),approval:f.object({id:f.string(),approved:f.literal(!1),reason:f.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var ute=mr({prefix:"aiobj",size:24});function IE(e){return({url:t,abortSignal:a})=>x6({url:t,maxBytes:e?.maxBytes,abortSignal:a})}var q6=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 dte=mr({prefix:"aiobj",size:24});var fte=IE();var H6="AI_NoSuchProviderError",j6=`vercel.ai.error.${H6}`,V6=Symbol.for(j6),$6;$6=V6;var pte=IE();async function W6(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 s=new FileReader;s.onload=l=>{var u;o((u=l.target)==null?void 0:u.result)},s.onerror=l=>i(l),s.readAsDataURL(t)});return{type:"file",mediaType:n,filename:a,url:r}}))}var G6=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 s=await hr(this.body),l=await hr(this.headers),u=await hr(this.credentials),c={...Fo(l),...Fo(t.headers)},d=await((a=this.prepareSendMessagesRequest)==null?void 0:a.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...s,...t.body},headers:c,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),p=(n=d?.api)!=null?n:this.api,m=d?.headers!==void 0?Fo(d.headers):c,h=d?.body!==void 0?d.body:{...s,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},v=(r=d?.credentials)!=null?r:u,y=await((o=this.fetch)!=null?o:globalThis.fetch)(p,{method:"POST",headers:{"Content-Type":"application/json",...m},body:JSON.stringify(h),credentials:v,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 hr(this.body),s=await hr(this.headers),l=await hr(this.credentials),u={...Fo(s),...Fo(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:l,requestMetadata:e.metadata})),d=(a=c?.api)!=null?a:`${this.api}/${e.chatId}/stream`,p=c?.headers!==void 0?Fo(c.headers):u,m=(n=c?.credentials)!=null?n:l,v=await((r=this.fetch)!=null?r:globalThis.fetch)(d,{method:"GET",headers:p,credentials:m});if(v.status===204)return null;if(!v.ok)throw new Error((o=await v.text())!=null?o:"Failed to fetch the chat response.");if(!v.body)throw new Error("The response body is empty.");return this.processResponseStream(v.body)}},bv=class extends G6{constructor(e={}){super(e)}processResponseStream(e){return wv({stream:e,schema:xv}).pipeThrough(new TransformStream({async transform(t,a){if(!t.success)throw t.error;a.enqueue(t.value)}}))}},CE=class{constructor({generateId:e=gv,id:t=e(),transport:a=new bv,messageMetadataSchema:n,dataPartSchemas:r,state:o,onError:i,onToolCall:s,onFinish:l,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new q6,this.sendMessage=async(d,p)=>{var m,h,v,I;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(m=this.lastMessage)==null?void 0:m.id,...p});return}let y;if("text"in d||"files"in d?y={parts:[...Array.isArray(d.files)?d.files:await W6(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:(h=y.role)!=null?h:"user",metadata:d.metadata})}else this.state.pushMessage({...y,id:(v=y.id)!=null?v:this.generateId(),role:(I=y.role)!=null?I:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,...p})},this.regenerate=async({messageId:d,...p}={})=>{let m=d==null?this.state.messages.length-1:this.state.messages.findIndex(h=>h.id===d);if(m===-1)throw new Error(`message ${d} not found`);this.state.messages=this.state.messages.slice(0,this.messages[m].role==="assistant"?m:m+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,...p})},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:p,reason:m,options:h})=>this.jobExecutor.run(async()=>{let v=this.state.messages,I=v[v.length-1],y=w=>rm(w)&&w.state==="approval-requested"&&w.approval.id===d?{...w,state:"approval-responded",approval:{id:d,approved:p,reason:m}}:w;this.state.replaceMessage(v.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,...h})})}),this.addToolOutput=async({state:d="output-available",toolCallId:p,output:m,errorText:h,options:v})=>this.jobExecutor.run(async()=>{let I=this.state.messages,y=I[I.length-1],w=g=>rm(g)&&g.toolCallId===p?{...g,state:d,output:m,errorText:h}: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 S;g&&this.makeRequest({trigger:"submit-message",messageId:(S=this.lastMessage)==null?void 0:S.id,...v})})}),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=s,this.onFinish=l,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,s;let l;if(e==="resume-stream")try{let m=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:a,body:n});if(m==null)return;l=m}catch(m){this.onError&&m instanceof Error&&this.onError(m),this.setStatus({status:"error",error:m});return}this.setStatus({status:"submitted",error:void 0});let u=this.lastMessage,c=!1,d=!1,p=!1;try{let m={state:vE({lastMessage:this.state.snapshot(u),messageId:this.generateId()}),abortController:new AbortController};m.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=m;let h;e==="resume-stream"?h=l:h=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:m.abortController.signal,metadata:t,headers:a,body:n,trigger:e,messageId:r});let v=I=>this.jobExecutor.run(()=>I({state:m.state,write:()=>{var y;this.setStatus({status:"streaming"}),m.state.message.id===((y=this.lastMessage)==null?void 0:y.id)?this.state.replaceMessage(this.state.messages.length-1,m.state.message):this.state.pushMessage(m.state.message)}}));await bE({stream:xE({stream:h,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:v,onError:I=>{throw I}}),onError:I=>{throw I}}),this.setStatus({status:"ready"})}catch(m){if(c||m.name==="AbortError")return c=!0,this.setStatus({status:"ready"}),null;p=!0,m instanceof TypeError&&(m.message.toLowerCase().includes("fetch")||m.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&m instanceof Error&&this.onError(m),this.setStatus({status:"error",error:m})}finally{try{(i=this.onFinish)==null||i.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:d,isError:p,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(m){console.error(m)}this.activeResponse=void 0}!p&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(s=this.lastMessage)==null?void 0:s.id,metadata:t,headers:a,body:n})}};function om(){let e=new Set,t=new Map,a,n=0,r=!1,o=!1,i=c=>(a||(a=`text-${++n}`,c.enqueue({type:"text-start",id:a})),a),s=c=>{a&&(c.enqueue({type:"text-end",id:a}),a=void 0)},l=(c,d)=>{c.enqueue({type:"text-delta",id:i(c),delta:d})},u=(c,d,p)=>{e.has(d.callId)||(e.add(d.callId),c.enqueue({type:"tool-input-available",toolCallId:d.callId,toolName:d.toolName??d.kind,input:p,dynamic:!0}))};return new TransformStream({start(c){c.enqueue({type:"start",messageId:crypto.randomUUID()})},transform(c,d){switch(c.type){case"step.started":{t.set(c.data.stepIndex,c.data.modelId),d.enqueue({type:"start-step"}),r=!0;break}case"message.appended":{c.data.messageDelta&&l(d,c.data.messageDelta);break}case"message.completed":{!a&&c.data.message&&l(d,c.data.message),s(d);break}case"actions.requested":{s(d);for(let p of c.data.actions)u(d,p,p.input);break}case"action.result":{let{result:p,status:m,error:h}=c.data;if(p.kind!=="tool-result")break;if(u(d,p,{}),p.isError===!0||m!=="completed"){d.enqueue({type:"tool-output-error",toolCallId:p.callId,errorText:h?.message??"The tool call failed.",dynamic:!0});break}d.enqueue({type:"tool-output-available",toolCallId:p.callId,output:p.output,dynamic:!0});break}case"step.completed":{let{stepIndex:p,usage:m}=c.data;s(d),r&&(d.enqueue({type:"finish-step"}),r=!1),d.enqueue({type:"message-metadata",messageMetadata:{"waniwani/step":{stepIndex:p,modelId:t.get(p),usage:m}}});break}case"turn.failed":case"session.failed":{o=!0,d.enqueue({type:"error",errorText:c.data.message||"The agent could not answer."});break}}},flush(c){s(c),r&&c.enqueue({type:"finish-step"}),c.enqueue({type:"finish",finishReason:o?"error":"stop"})}})}async function X6(e){let t=new ReadableStream({start(n){for(let r of e)n.enqueue(r);n.close()}}).pipeThrough(om()),a;for await(let n of SE({stream:t}))a=n;return a?.parts.length?a:void 0}async function kE(e){let t=[];for(let n of e){let r=n.type==="message.received"&&!n.data.kind?n.data.message:void 0;r!==void 0?t.push({visitor:{id:n.meta?.id??crypto.randomUUID(),role:"user",parts:[{type:"text",text:r}]},events:[]}):t.at(-1)?.events.push(n)}let a=[];for(let n of t){a.push(n.visitor);let r=await X6(n.events);r&&a.push(r)}return a}var Ni=Symbol("invalid-json-value-candidate");function Iv(e){let t=Sv(e);if(t===Ni)throw TypeError("Expected a JSON-serializable value.");return t}function qc(e){let t=Iv(e);if(!K6(t))throw TypeError("Expected a JSON-serializable object.");return t}function Sv(e,t=new WeakSet){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number")return Number.isFinite(e)?e:Ni;if(Array.isArray(e)){let n=[];for(let r of e){let o=Sv(r,t);if(o===Ni)return Ni;n.push(o)}return n}if(typeof e!="object"||e===void 0||!Y6(e)||t.has(e))return Ni;t.add(e);let a={};for(let[n,r]of Object.entries(e)){if(r===void 0)continue;let o=Sv(r,t);if(o===Ni)return Ni;a[n]=o}return t.delete(e),a}function K6(e){return e!==null&&!Array.isArray(e)&&typeof e=="object"}function Y6(e){let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var Hc=f.unknown().transform((e,t)=>{try{return Iv(e)}catch(a){return t.addIssue({code:"custom",message:TE(a,"Expected a JSON-serializable value.")}),f.NEVER}}),Kr=f.unknown().transform((e,t)=>{try{return qc(e)}catch(a){return t.addIssue({code:"custom",message:TE(a,"Expected a JSON-serializable object.")}),f.NEVER}});function TE(e,t){return e instanceof Error?e.message:t}var LE=f.object({callId:f.string(),input:Kr,kind:f.literal("tool-call"),toolName:f.string()}).strict();f.object({callId:f.string(),description:f.string(),input:Kr,kind:f.literal("subagent-call"),name:f.string(),nodeId:f.string(),subagentName:f.string()}).strict(),f.object({callId:f.string(),description:f.string(),input:Kr,kind:f.literal("remote-agent-call"),name:f.string(),nodeId:f.string(),remoteAgentName:f.string()}).strict(),f.object({callId:f.string(),input:Kr,kind:f.literal("workflow-tool-call"),toolName:f.string(),workflowId:f.string()}).strict(),f.object({callId:f.string(),description:f.string(),input:Kr,kind:f.literal("subagent-call"),name:f.string(),nodeId:f.string(),subagentName:f.string()}).strict();var Ote=f.object({callId:f.string(),description:f.string(),input:Kr,kind:f.literal("remote-agent-call"),name:f.string(),nodeId:f.string(),remoteAgentName:f.string()}).strict(),Nte=f.object({callId:f.string(),executeInput:Hc.optional(),input:Kr,kind:f.literal("workflow-task"),nodeId:f.string().optional(),toolName:f.string(),workflowId:f.string()}).strict();f.object({callId:f.string(),input:Kr,kind:f.literal("load-skill")}).strict();f.object({callId:f.string(),isError:f.boolean().optional(),kind:f.literal("tool-result"),output:Hc,toolName:f.string()}).strict(),f.object({callId:f.string(),isError:f.literal(!0),kind:f.literal("subagent-result"),origin:f.literal("dispatch"),output:Hc,subagentName:f.string()}).strict(),f.object({callId:f.string(),isError:f.boolean().optional(),kind:f.literal("load-skill-result"),output:Hc,name:f.string().optional()}).strict();var Z6=f.object({description:f.string().describe("Optional additional context for this option.").optional(),id:f.string().describe("Stable identifier for the option."),label:f.string().describe("User-facing label for the option."),style:f.enum(["primary","danger","default"]).describe("Visual treatment hint for the option.").optional()}).strict(),J6=f.enum(["question","session-limit","tool-approval"]),Fte=f.object({action:LE,allowFreeform:f.boolean().describe("Whether the user may answer with freeform text instead of selecting one of the provided options.").optional(),display:f.enum(["confirmation","select","text"]).describe("Rendering hint: the channel uses this to pick a UX treatment.").optional(),kind:J6.describe("Framework-owned request source used to resolve, route, and render the response."),options:f.array(Z6).describe("Selectable answer options to present to the user.").optional(),prompt:f.string().describe("The prompt to present to the user."),requestId:f.string().describe("Stable identifier for this request.")}).strict(),qte=f.object({optionId:f.string().optional(),requestId:f.string(),text:f.string().optional()}).strict();var Ya="/eve/v1",jte=`${Ya}/cron/:token`,EE=`${Ya}/health`,AE=`${Ya}/info`,Ta=`${Ya}/session`,Vte=`${Ta}/:sessionId`,$te=`${Ta}/:sessionId/cancel`,Wte=`${Ta}/:sessionId/compact`,Gte=`${Ta}/:sessionId/clear`,Xte=`${Ta}/:sessionId/reset`,Kte=`${Ta}/:sessionId/stream`,Yte=`${Ta}/:parentSessionId/subagents/:callId/:childSessionId/stream`,Zte=`${Ya}/dev/schedules/:scheduleId`,Cv=`${Ya}/dev/runtime-artifacts`,Jte=`${Cv}/rebuild`,Qte=`${Cv}/suspend`,eae=`${Cv}/resume`;var tae=`${Ya}/connections/:name/callback/:attemptId/:token`,aae=`${Ya}/callback/:token`,nae=`${Ya}/task-input/:token`,rae=`${Ya}/activity/:token`;function ME(e){return`${Ta}/${encodeURIComponent(e)}`}function RE(e){return`${Ta}/${encodeURIComponent(e)}/cancel`}function DE(e){return`${Ta}/${encodeURIComponent(e)}/compact`}function _E(e){return`${Ta}/${encodeURIComponent(e)}/clear`}function PE(e){return`${Ta}/${encodeURIComponent(e)}/reset`}function kv(e){return`${Ta}/${encodeURIComponent(e)}/stream`}function gr(e){return typeof e=="object"&&!!e&&!Array.isArray(e)}function jc(e){return e instanceof Error?e.message:typeof e=="string"?e:e==null?String(e):gr(e)?typeof e.message=="string"&&e.message.length>0?e.message:Q6(e):String(e)}function Ui(e){if(e instanceof Error)return e;let t=Error(jc(e));return gr(e)&&(typeof e.name=="string"&&e.name.length>0&&(t.name=e.name),typeof e.stack=="string"&&e.stack.length>0&&(t.stack=e.stack),"cause"in e&&e.cause!==void 0&&e.cause!==e&&(t.cause=e.cause)),t}function Q6(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}var NE="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function e9(){let e=-1,t=new Uint8Array(10);return function(){let a=Date.now();if(!Number.isInteger(a)||a<0||a>0xffffffffffff)throw Error(`Cannot mint a ULID: timestamp must be an integer from 0 to ${0xffffffffffff}.`);if(a>e)e=a,OE(t);else if(!r9(t)){if(e===0xffffffffffff)throw Error("Cannot mint a ULID: random component overflowed at the maximum timestamp.");e+=1,OE(t)}return`${a9(e)}${n9(t)}`}}var t9=e9();function OE(e){let t=globalThis.crypto;if(typeof t?.getRandomValues!="function")throw Error("Cannot mint a ULID: globalThis.crypto.getRandomValues is unavailable.");t.getRandomValues(e)}function a9(e){let t=e,a="";for(let n=0;n<10;n+=1)a=NE[t%32]+a,t=Math.floor(t/32);return a}function n9(e){let t=0,a=0,n="";for(let r of e){for(t=t<<8|r,a+=8;a>=5;)a-=5,n+=NE[t>>>a&31];t&=(1<<a)-1}return n}function r9(e){for(let t=e.length-1;t>=0;--t){let a=e[t]??0;if(a<255)return e[t]=a+1,e.fill(0,t+1),!0}return!1}var UE="x-eve-session-id";var Tv="x-eve-stream-tail-index",Lv="x-eve-stream-version";var BE="1",zE="streamControlVersion",Ev={$eve:"stream.lease-ended",version:1},Pae=new TextEncoder;function xn(e){return e.type==="session.completed"||e.type==="session.failed"||e.type==="session.waiting"}function Av(e){return e.type==="session.failed"||e.type==="step.failed"||e.type==="turn.failed"}var im=class extends Error{constructor(t=[]){let a=t.length===0?"":` (${t.join("; ")})`;super(`The server returned an unrecognized response from the eve agent info route.${a}`);K(this,"issues");this.name="AgentInfoResponseError",this.issues=t}};var sm=class extends Error{constructor(t=[]){let a=t.length===0?"":` (${t.join("; ")})`;super(`The server returned an unrecognized eve health response.${a}`);K(this,"issues");this.name="HealthResponseError",this.issues=t}};var Za=class extends Error{constructor(t,a,n){let r=Object.freeze(Object.fromEntries(new Headers(n).entries())),o=r["content-type"]?.toLowerCase(),i=a||`Server returned ${t}.`,s;try{let l=JSON.parse(a);gr(l)&&(typeof l.error=="string"&&(i=l.error),typeof l.code=="string"&&(s=l.code))}catch{o?.includes("text/html")&&(i=`Server returned ${t} with an HTML response. Check the eve route and development server configuration.`)}super(i);K(this,"code");K(this,"status");K(this,"body");K(this,"headers");this.name="ClientError",this.code=s,this.status=t,this.body=a,this.headers=r}};function FE(e){let t,a,n,r=[],o=new Map;for(let i of e)xn(i)&&(t=i),Av(i)&&(a=i),o9(i)&&(n=i.data.message??void 0),i.type==="input.requested"&&r.push(...i.data.requests),i.type==="authorization.required"&&o.set(i.data.name,i.data),i.type==="authorization.completed"&&o.delete(i.data.name);return{boundary:t,failure:a,inputRequests:r,message:n,pendingAuthorizations:[...o.values()],status:t?.type==="session.waiting"?"waiting":t?.type==="session.failed"?"failed":"completed"}}function o9(e){return e.type==="message.completed"&&e.data.finishReason!=="tool-calls"}function Bi(e,t){t.type==="authorization.required"&&t.data.webhookUrl!==void 0?e.add(t.data.name):t.type==="authorization.completed"&&e.delete(t.data.name)}var i9=/^\/eve\/[a-z0-9][a-z0-9_-]*$/,s9=/^\/eve\/[a-z0-9][a-z0-9_-]*\/v1$/;function Mv(e,t){let a=l9(e),n=t.startsWith("/")?t:`/${t}`;if(n===Ya||n.startsWith(`${Ya}/`)){if(i9.test(a))return`${a}${n.slice(4)}`;if(s9.test(a))return`${a}${n.slice(Ya.length)}`}return`${a}${n}`}function l9(e){return e==="/"?"":e.endsWith("/")?e.slice(0,-1):e}function yr(e,t,a){let n=t.indexOf("?"),r=n===-1?t:t.slice(0,n),o=n===-1?"":t.slice(n+1),i=r.startsWith("/")?r:`/${r}`;if(u9(e)){let u=new URL(e),c=HE(u.pathname);return u.pathname=Mv(c,i),qE(u.searchParams,o),jE(u.searchParams,a),u.hash="",u.toString()}let s=new URL(e,"http://eve.local"),l=HE(s.pathname);return qE(s.searchParams,o),jE(s.searchParams,a),`${Mv(l,i)}${c9(s.searchParams)}`}function qE(e,t){if(t.length!==0)for(let[a,n]of new URLSearchParams(t))e.append(a,n)}function u9(e){return/^[a-z][a-z\d+\-.]*:/i.test(e)}function HE(e){return e==="/"?"":e.endsWith("/")?e.slice(0,-1):e}function jE(e,t){if(t!==void 0)for(let[a,n]of Object.entries(t))e.set(a,n)}function c9(e){let t=e.toString();return t.length===0?"":`?${t}`}function VE(e){let t;for(let a of e)d9(a)&&(t=a.data.result);return t}function d9(e){return e.type==="result.completed"}var Rv=Symbol("consumeMessageResponse"),Dv=Symbol("acceptedDeliveryId"),$E,Vc,Ho,$c,Wc,Ll,zi,lm,GE,WE,_v=(WE=class{constructor(e){ue(this,lm);K(this,"sessionId");K(this,$E);ue(this,Vc);ue(this,Ho);ue(this,$c,!1);ue(this,Wc);ue(this,Ll,!1);ue(this,zi,Promise.withResolvers());q(this,Vc,e.cancelTurn),this.sessionId=e.sessionId,this[Dv]=e.deliveryId,q(this,Wc,e.createStream)}cancel(){if(b(this,Ll))return Promise.resolve({status:"no_active_turn"});if(b(this,Ho)!==void 0)return b(this,Ho);let e=b(this,zi).promise.then(t=>t===void 0?{status:"no_active_turn"}:b(this,Vc).call(this,t));return q(this,Ho,e),e.catch(()=>{!b(this,Ll)&&b(this,Ho)===e&&q(this,Ho,void 0)}),e}async result(){let e=[];for await(let a of this)e.push(a);let t=FE(e);return{data:VE(e),events:e,inputRequests:t.inputRequests,message:t.message,sessionId:this.sessionId,status:t.status}}[($E=Dv,Symbol.asyncIterator)](){return this[Rv]()}[Rv](e){if(b(this,$c))throw Error("MessageResponse has already been consumed.");return q(this,$c,!0),Y(this,lm,GE).call(this,e)}},Vc=new WeakMap,Ho=new WeakMap,$c=new WeakMap,Wc=new WeakMap,Ll=new WeakMap,zi=new WeakMap,lm=new WeakSet,GE=async function*(e){try{for await(let t of b(this,Wc).call(this,e))t.type==="turn.started"?b(this,zi).resolve(t.data.turnId):xn(t)&&(q(this,Ll,!0),b(this,zi).resolve(void 0)),yield t}finally{b(this,zi).resolve(void 0)}},WE);function Pv(e){return e[Dv]}function XE(e,t){return e[Rv](t)}function YE(e,t){switch(e){case"21":case"22":case"23":case"24":return f9(e,t);case"25":return p9(t);default:return m9(e)}}function f9(e,t){if(t.type==="message.appended")return KE(t.data.messageSoFar,t.data.messageDelta,"message",e),{data:{messageDelta:t.data.messageDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,turnId:t.data.turnId},meta:t.meta,type:"message.appended"};if(t.type==="reasoning.appended")return KE(t.data.reasoningSoFar,t.data.reasoningDelta,"reasoning",e),{data:{reasoningDelta:t.data.reasoningDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,turnId:t.data.turnId},meta:t.meta,type:"reasoning.appended"};if(t.type==="action.input.appended"){if(e!==void 0&&e!=="24")throw TypeError(`Invalid action input append for stream version ${e}.`);return h9(t.data.inputTextOffset,e),{data:{callId:t.data.callId,inputTextDelta:t.data.inputTextDelta,sequence:t.data.sequence,stepIndex:t.data.stepIndex,toolName:t.data.toolName,turnId:t.data.turnId},meta:t.meta,type:"action.input.appended"}}return t}function p9(e){return e.type==="message.appended"?(Ov(e.data.messageDelta,"message"),Gc(e.data,"messageOffset","message"),Gc(e.data,"messageSoFar","message")):e.type==="reasoning.appended"?(Ov(e.data.reasoningDelta,"reasoning"),Gc(e.data,"reasoningOffset","reasoning"),Gc(e.data,"reasoningSoFar","reasoning")):e.type==="action.input.appended"&&(Ov(e.data.inputTextDelta,"action input"),Gc(e.data,"inputTextOffset","action input")),e}function Ov(e,t){if(typeof e!="string")throw TypeError(`Invalid ${t} append delta for stream version 25.`)}function Gc(e,t,a){if(t in e)throw TypeError(`Invalid ${a} append shape for stream version 25.`)}function m9(e){throw TypeError(`Unsupported message stream version: ${String(e)}.`)}function h9(e,t){if(!Number.isSafeInteger(e)||e<0){let a=t===void 0?"persisted stream":`stream version ${t}`;throw TypeError(`Invalid action input append offset for ${a}.`)}}function KE(e,t,a,n){let r=e.length-t.length;if(r<0||e.slice(r)!==t){let o=n===void 0?"persisted stream":`stream version ${n}`;throw TypeError(`Invalid cumulative ${a} append for ${o}.`)}}function Nv(e){if(e instanceof DOMException)return e.name==="AbortError";if(!(e instanceof Error))return!1;let t="code"in e&&typeof e.code=="string"?e.code:void 0;return e.name==="AbortError"||e.message==="terminated"||t==="UND_ERR_SOCKET"||e instanceof TypeError&&/^(?:failed to fetch|fetch failed)$/i.test(e.message)||/abort|cancel|disconnect|premature close|socket|terminated/i.test(e.message)}async function*QE(e,t){let a=e.getReader(),n=new TextDecoder,r="",o=!1,i=()=>{a.cancel().catch(()=>{})};t.signal?.addEventListener("abort",i,{once:!0});try{for(;;){t.signal?.throwIfAborted();let l=await g9(a,t?.idleTimeoutMs);if(t.signal?.throwIfAborted(),l.done){o=!0,r+=n.decode();break}l.value&&(r+=n.decode(l.value,{stream:!0}));let u=r.indexOf(`
|
|
136
|
+
`);for(;u!==-1;){let c=r.slice(0,u).trim();if(r=r.slice(u+1),c.length>0){let d=JSON.parse(c);t.controlVersion==="1"&&ZE(d)?t.onLeaseEnded?.():yield JE(d,t.streamVersion)}u=r.indexOf(`
|
|
137
|
+
`)}}let s=r.trim();if(s.length>0){let l=JSON.parse(s);t.controlVersion==="1"&&ZE(l)?t.onLeaseEnded?.():yield JE(l,t.streamVersion)}}finally{t.signal?.removeEventListener("abort",i),o||a.cancel().catch(()=>{}),a.releaseLock()}}function ZE(e){if(typeof e!="object"||!e)return!1;let t=e;return t.$eve===Ev.$eve&&t.version===Ev.version}function JE(e,t){return YE(t,e)}async function g9(e,t){let a;try{return t===void 0?await e.read():await Promise.race([e.read(),new Promise((n,r)=>{a=setTimeout(()=>r(new DOMException("Session stream was idle.","AbortError")),t)})])}catch(n){throw n instanceof TypeError?Error("Session stream disconnected.",{cause:n}):n}finally{a!==void 0&&clearTimeout(a)}}var y9={21:!0,22:!0,23:!0,24:!0,25:!0};function eA(e){let t=e.get(Lv);if(t!==null&&Object.hasOwn(y9,t))return t;throw TypeError(t===null?`Missing ${Lv} response header.`:`Unsupported message stream version: ${t}.`)}var Fi={retryableErrorStatuses:new Set([404,409,425,500,502,503,504]),streamIdleReconnectPolicy:{baseDelayMs:250,maxAttempts:5,maxDelayMs:4e3},streamOpenReconnectPolicy:{baseDelayMs:250,maxAttempts:12,maxDelayMs:5e3}},w9={...Fi,streamIdleReconnectPolicy:{...Fi.streamIdleReconnectPolicy,maxAttempts:0},streamOpenReconnectPolicy:{...Fi.streamOpenReconnectPolicy,maxAttempts:1}};function tA(e,t){return{...t,...e}}function aA(e,t=!1){if(e&&"reconnect"in e&&e.reconnect===!1)return w9;let a=e;return{retryableErrorStatuses:a?.retryableErrorStatuses?new Set(a.retryableErrorStatuses):Fi.retryableErrorStatuses,streamIdleReconnectPolicy:tA(a?.streamIdleReconnectPolicy,{...Fi.streamIdleReconnectPolicy,maxAttempts:t?1/0:Fi.streamIdleReconnectPolicy.maxAttempts}),streamOpenReconnectPolicy:tA(a?.streamOpenReconnectPolicy,Fi.streamOpenReconnectPolicy)}}async function*Uv(e){if(e.follow===!1&&e.startIndex<0)throw Error("stream({ follow: false }) requires a nonnegative startIndex; a tail-relative cursor cannot be bounded.");let t=()=>aA(e.resolveReconnectPolicy===void 0?e.streamReconnectPolicy:e.resolveReconnectPolicy(),e.keepAlive),a=t(),n=a.streamIdleReconnectPolicy,r=e.startIndex,o=n.baseDelayMs,i=0,s=!0,l,u=!1;for(;;){a=t(),n=a.streamIdleReconnectPolicy;let c;try{c=await v9({...e,retryPolicy:a,startIndex:r,requestTailIndex:(e.follow===!1||e.onCaughtUp!==void 0)&&l===void 0})}catch(m){if(e.signal?.aborted)return;throw m}if((e.follow===!1||e.onCaughtUp!==void 0)&&l===void 0&&(l=c.tailIndex,l===void 0))throw c.close(),Error(`stream({ follow: false }) requires the server to report the ${Tv} header. The agent may be running an older eve version.`);if(!u&&l!==void 0&&r>l&&(u=!0,e.onCaughtUp?.()),e.follow===!1&&l!==void 0&&r>l){c.close();return}let d=!1,p=!1;try{for await(let m of QE(c.body,{signal:e.signal,controlVersion:c.controlVersion,idleTimeoutMs:e.streamReadIdleTimeoutMs??15e3,onLeaseEnded:()=>{p=!0},streamVersion:c.streamVersion}))if(r+=1,d=!0,o=n.baseDelayMs,i=0,yield m,!u&&l!==void 0&&r>l&&(u=!0,e.onCaughtUp?.()),e.follow===!1&&l!==void 0&&r>l)return}catch(m){if(!Nv(m))throw m}finally{c.close()}if(n=t().streamIdleReconnectPolicy,e.signal?.aborted||e.startIndex<0||n.maxAttempts===0)return;if(!p){if(!d&&!s&&(i+=1)>=n.maxAttempts||(s=!1,await Xc(o,e.signal),e.signal?.aborted))return;o=Math.min(o*2,n.maxDelayMs)}}}async function v9(e){let t=e.retryPolicy??aA(e.streamReconnectPolicy,e.keepAlive),a=t.streamOpenReconnectPolicy,n,r,o,i=a.baseDelayMs,s=e.startIndex>=0&&t.streamIdleReconnectPolicy.maxAttempts>0?BE:void 0,l={};s!==void 0&&(l[zE]=s),e.startIndex!==0&&(l.startIndex=String(e.startIndex)),e.requestTailIndex===!0&&(l.includeTailIndex="1");for(let u=0;u<a.maxAttempts;u+=1){e.signal?.throwIfAborted();let c=yr(e.host,e.path,Object.keys(l).length>0?l:void 0),d=await e.resolveHeaders();e.signal?.throwIfAborted();let p=new AbortController,m=e.signal?AbortSignal.any([e.signal,p.signal]):p.signal,h;try{h=await fetch(c,{cache:"no-store",headers:d,redirect:e.redirect,signal:m})}catch(v){if(e.signal?.aborted||!Nv(v)||u===a.maxAttempts-1)throw v;await Xc(i,e.signal),i=Math.min(i*2,a.maxDelayMs);continue}if(h.ok){if(!h.body)throw new Za(h.status,"Response body is null.",h.headers);let v=!1;return{body:h.body,close:()=>{v||(v=!0,h.body?.cancel().catch(()=>{}),p.abort())},controlVersion:s,streamVersion:eA(h.headers),tailIndex:x9(h.headers)}}if(n=h.status,r=await h.text(),o=h.headers,!t.retryableErrorStatuses.has(h.status))throw new Za(h.status,r,h.headers);u<a.maxAttempts-1&&(await Xc(i,e.signal),i=Math.min(i*2,a.maxDelayMs))}throw new Za(n??0,r??"Failed to open message stream.",o)}function x9(e){let t=e.get(Tv);if(t===null||!/^-?\d+$/.test(t))return;let a=Number(t);return Number.isSafeInteger(a)?a:void 0}async function Xc(e,t){t?.aborted||await new Promise(a=>{let n=()=>{clearTimeout(r),a()},r=setTimeout(()=>{t?.removeEventListener("abort",n),a()},e);t?.addEventListener("abort",n,{once:!0})})}var nA=f.discriminatedUnion("status",[f.strictObject({ok:f.literal(!0),sessionId:f.string().min(1),status:f.literal("accepted")}),f.strictObject({ok:f.literal(!0),status:f.literal("no_active_turn")})]);var rA=f.discriminatedUnion("status",[f.object({ok:f.literal(!0),sessionId:f.string().min(1),status:f.literal("accepted")}),f.object({ok:f.literal(!0),status:f.literal("no_active_session")})]);var oA=f.discriminatedUnion("status",[f.object({ok:f.literal(!0),sessionId:f.string().min(1),status:f.literal("accepted")}),f.object({ok:f.literal(!0),status:f.literal("no_active_session")})]);var iA=f.discriminatedUnion("status",[f.object({ok:f.literal(!0),previousSessionId:f.string().min(1),status:f.literal("reset")}),f.object({ok:f.literal(!0),status:f.literal("no_active_session")})]);async function sA(e){let{signal:t,...a}=e.options??{},{payload:n,response:r}=await um({body:a,context:e.context,operation:"Cancel",path:RE(e.sessionId),signal:t}),o=nA.safeParse(n);if(!o.success||o.data.status==="accepted"&&o.data.sessionId!==e.sessionId)throw Error(`Cancel route returned an invalid response (${r.status}).`);return o.data.status==="accepted"?{sessionId:o.data.sessionId,status:"accepted"}:{status:"no_active_turn"}}async function lA(e){let{payload:t}=await um({context:e.context,operation:"Clear",path:_E(e.sessionId)}),a=rA.safeParse(t);if(!a.success||a.data.status==="accepted"&&a.data.sessionId!==e.sessionId)throw Error("Clear route returned an invalid response.");return a.data.status==="accepted"?{sessionId:a.data.sessionId,status:"accepted"}:{status:"no_active_session"}}async function uA(e){let{payload:t}=await um({context:e.context,operation:"Compact",path:DE(e.sessionId)}),a=oA.safeParse(t);if(!a.success||a.data.status==="accepted"&&a.data.sessionId!==e.sessionId)throw Error("Compact route returned an invalid response.");return a.data.status==="accepted"?{sessionId:a.data.sessionId,status:"accepted"}:{status:"no_active_session"}}async function cA(e){let{signal:t,...a}=e.options??{},{payload:n}=await um({body:a,context:e.context,operation:"Reset",path:PE(e.sessionId),signal:t}),r=iA.safeParse(n);if(!r.success||r.data.status==="reset"&&r.data.previousSessionId!==e.sessionId)throw Error("Reset route returned an invalid response.");return r.data.status==="reset"?{previousSessionId:r.data.previousSessionId,status:"reset"}:{status:"no_active_session"}}async function um(e){let t=await e.context.resolveHeaders();t.set("content-type","application/json");let a=await fetch(yr(e.context.host,e.path),b9({body:e.body===void 0?void 0:JSON.stringify(e.body),headers:t,method:"POST",signal:e.signal},e.context.redirect)),n=await a.text();if(!a.ok)throw new Za(a.status,n,a.headers);try{return{payload:JSON.parse(n),response:a}}catch{throw Error(`${e.operation} route returned invalid JSON (${a.status}).`)}}function b9(e,t){return t===void 0?e:{...e,redirect:t}}function Kc(e,t){let a=typeof e;if(a!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!Kc(e[r],t[r]))return!1;return!0}if(a==="object"){if(!e||!t)return e===t;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n)if(!Kc(e[o],t[o]))return!1;return!0}return e===t}function Jn(e){return encodeURI(S9(e))}function S9(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var I9={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},C9={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},k9={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},T9=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");function qi(e,t=Object.create(null),a=T9,n=""){if(e&&typeof e=="object"&&!Array.isArray(e)){let o=e.$id||e.id;if(o){let i=new URL(o,a.href);i.hash.length>1?t[i.href]=e:(i.hash="",n===""?a=i:qi(e,t,a))}}else if(e!==!0&&e!==!1)return t;let r=a.href+(n?"#"+n:"");if(t[r]!==void 0)throw Error(`Duplicate schema URI "${r}".`);if(t[r]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:r}),e.$ref&&e.__absolute_ref__===void 0){let o=new URL(e.$ref,a.href);o.hash=o.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:o.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let o=new URL(e.$recursiveRef,a.href);o.hash=o.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:o.href})}if(e.$anchor){let o=new URL("#"+e.$anchor,a.href);t[o.href]=e}for(let o in e){if(k9[o])continue;let i=`${n}/${Jn(o)}`,s=e[o];if(Array.isArray(s)){if(I9[o]){let l=s.length;for(let u=0;u<l;u++)qi(s[u],t,a,`${i}/${u}`)}}else if(C9[o])for(let l in s)qi(s[l],t,a,`${i}/${Jn(l)}`);else qi(s,t,a,i)}return t}var L9=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,E9=[0,31,28,31,30,31,30,31,31,30,31,30,31],A9=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,M9=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,R9=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,D9=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,_9=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,P9=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,O9=/^(?:\/(?:[^~/]|~0|~1)*)*$/,N9=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,U9=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,B9=e=>{if(e[0]==='"')return!1;let[t,a,...n]=e.split("@");return!t||!a||n.length!==0||t.length>64||a.length>253||t[0]==="."||t.endsWith(".")||t.includes("..")||!/^[a-z0-9.-]+$/i.test(a)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:a.split(".").every(r=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(r))},z9=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,F9=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,q9=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function wr(e){return e.test.bind(e)}var dA={date:fA,time:pA.bind(void 0,!1),"date-time":V9,duration:q9,uri:G9,"uri-reference":wr(R9),"uri-template":wr(D9),url:wr(_9),email:B9,hostname:wr(M9),ipv4:wr(z9),ipv6:wr(F9),regex:K9,uuid:wr(P9),"json-pointer":wr(O9),"json-pointer-uri-fragment":wr(N9),"relative-json-pointer":wr(U9)};function H9(e){return e%4==0&&(e%100!=0||e%400==0)}function fA(e){let t=e.match(L9);if(!t)return!1;let a=+t[1],n=+t[2],r=+t[3];return n>=1&&n<=12&&r>=1&&r<=(n==2&&H9(a)?29:E9[n])}function pA(e,t){let a=t.match(A9);if(!a)return!1;let n=+a[1],r=+a[2],o=+a[3],i=!!a[5];return(n<=23&&r<=59&&o<=59||n==23&&r==59&&o==60)&&(!e||i)}var j9=/t|\s/i;function V9(e){let t=e.split(j9);return t.length==2&&fA(t[0])&&pA(!0,t[1])}var $9=/\/|:/,W9=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function G9(e){return $9.test(e)&&W9.test(e)}var X9=/[^\\]\\Z/;function K9(e){if(X9.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var Y9;(function(e){e[e.Flag=1]="Flag",e[e.Basic=2]="Basic",e[e.Detailed=4]="Detailed"})(Y9||(Y9={}));function Z9(e){let t=0,a=e.length,n=0,r;for(;n<a;)t++,r=e.charCodeAt(n++),r>=55296&&r<=56319&&n<a&&(r=e.charCodeAt(n),(r&64512)==56320&&n++);return t}function Nt(e,t,a="2019-09",n=qi(t),r=!0,o=null,i="#",s="#",l=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:i,keyword:"false",keywordLocation:i,error:"False boolean schema."}]};let u=typeof e,c;switch(u){case"boolean":case"number":case"string":c=u;break;case"object":c=e===null?"null":Array.isArray(e)?"array":"object";break;default:throw Error(`Instances of "${u}" type are not supported.`)}let{$ref:d,$recursiveRef:p,$recursiveAnchor:m,type:h,const:v,enum:I,required:y,not:w,anyOf:g,allOf:S,oneOf:E,if:T,then:R,else:O,format:U,properties:A,patternProperties:Q,additionalProperties:$,unevaluatedProperties:H,minProperties:Z,maxProperties:X,propertyNames:B,dependentRequired:P,dependentSchemas:J,dependencies:ge,prefixItems:C,items:ze,additionalItems:ot,unevaluatedItems:x,contains:te,minContains:re,maxContains:ke,minItems:We,maxItems:be,uniqueItems:Oe,minimum:we,maximum:ce,exclusiveMinimum:Le,exclusiveMaximum:ie,multipleOf:xe,minLength:Ne,maxLength:_e,pattern:Fe,__absolute_ref__:Ae,__absolute_recursive_ref__:de}=t,W=[];if(m===!0&&o===null&&(o=t),p==="#"){let le=o===null?n[de]:o,oe=`${s}/$recursiveRef`,Ie=Nt(e,o===null?t:o,a,n,r,le,i,oe,l);Ie.valid||W.push({instanceLocation:i,keyword:"$recursiveRef",keywordLocation:oe,error:"A subschema had errors."},...Ie.errors)}if(d!==void 0){let le=n[Ae||d];if(le===void 0){let ae=`Unresolved $ref "${d}".`;throw Ae&&Ae!==d&&(ae+=` Absolute URI "${Ae}".`),ae+=`
|
|
138
138
|
Known schemas:
|
|
139
139
|
- ${Object.keys(n).join(`
|
|
140
|
-
- `)}`,Error(ee)}let oe=`${s}/$ref`,ke=Ut(e,le,a,n,r,o,i,oe,l);if(ke.valid||W.push({instanceLocation:i,keyword:"$ref",keywordLocation:oe,error:"A subschema had errors."},...ke.errors),a==="4"||a==="7")return{valid:W.length===0,errors:W}}if(Array.isArray(h)){let le=h.length,oe=!1;for(let ke=0;ke<le;ke++)if(c===h[ke]||h[ke]==="integer"&&c==="number"&&e%1==0&&e===e){oe=!0;break}oe||W.push({instanceLocation:i,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${c}" is invalid. Expected "${h.join('", "')}".`})}else h==="integer"?(c!=="number"||e%1||e!==e)&&W.push({instanceLocation:i,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${c}" is invalid. Expected "${h}".`}):h!==void 0&&c!==h&&W.push({instanceLocation:i,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${c}" is invalid. Expected "${h}".`});if(v!==void 0&&(c==="object"||c==="array"?Xc(e,v)||W.push({instanceLocation:i,keyword:"const",keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(v)}.`}):e!==v&&W.push({instanceLocation:i,keyword:"const",keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(v)}.`})),I!==void 0&&(c==="object"||c==="array"?I.some(le=>Xc(e,le))||W.push({instanceLocation:i,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(I)}.`}):I.some(le=>e===le)||W.push({instanceLocation:i,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(I)}.`})),w!==void 0){let le=`${s}/not`;Ut(e,w,a,n,r,o,i,le).valid&&W.push({instanceLocation:i,keyword:"not",keywordLocation:le,error:'Instance matched "not" schema.'})}let ct=[];if(g!==void 0){let le=`${s}/anyOf`,oe=W.length,ke=!1;for(let ee=0;ee<g.length;ee++){let k=g[ee],D=Object.create(l),H=Ut(e,k,a,n,r,m===!0?o:null,i,`${le}/${ee}`,D);W.push(...H.errors),ke||(ke=H.valid),H.valid&&ct.push(D)}ke?W.length=oe:W.splice(oe,0,{instanceLocation:i,keyword:"anyOf",keywordLocation:le,error:"Instance does not match any subschemas."})}if(S!==void 0){let le=`${s}/allOf`,oe=W.length,ke=!0;for(let ee=0;ee<S.length;ee++){let k=S[ee],D=Object.create(l),H=Ut(e,k,a,n,r,m===!0?o:null,i,`${le}/${ee}`,D);W.push(...H.errors),ke&&(ke=H.valid),H.valid&&ct.push(D)}ke?W.length=oe:W.splice(oe,0,{instanceLocation:i,keyword:"allOf",keywordLocation:le,error:"Instance does not match every subschema."})}if(E!==void 0){let le=`${s}/oneOf`,oe=W.length,ke=E.filter((ee,k)=>{let D=Object.create(l),H=Ut(e,ee,a,n,r,m===!0?o:null,i,`${le}/${k}`,D);return W.push(...H.errors),H.valid&&ct.push(D),H.valid}).length;ke===1?W.length=oe:W.splice(oe,0,{instanceLocation:i,keyword:"oneOf",keywordLocation:le,error:`Instance does not match exactly one subschema (${ke} matches).`})}if((c==="object"||c==="array")&&Object.assign(l,...ct),T!==void 0){let le=`${s}/if`;if(Ut(e,T,a,n,r,o,i,le,l).valid){if(R!==void 0){let oe=Ut(e,R,a,n,r,o,i,`${s}/then`,l);oe.valid||W.push({instanceLocation:i,keyword:"if",keywordLocation:le,error:'Instance does not match "then" schema.'},...oe.errors)}}else if(O!==void 0){let oe=Ut(e,O,a,n,r,o,i,`${s}/else`,l);oe.valid||W.push({instanceLocation:i,keyword:"if",keywordLocation:le,error:'Instance does not match "else" schema.'},...oe.errors)}}if(c==="object"){if(y!==void 0)for(let ee of y)ee in e||W.push({instanceLocation:i,keyword:"required",keywordLocation:`${s}/required`,error:`Instance does not have required property "${ee}".`});let le=Object.keys(e);if(Z!==void 0&&le.length<Z&&W.push({instanceLocation:i,keyword:"minProperties",keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${Z} properties.`}),X!==void 0&&le.length>X&&W.push({instanceLocation:i,keyword:"maxProperties",keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${X} properties.`}),B!==void 0){let ee=`${s}/propertyNames`;for(let k in e){let D=`${i}/${Qn(k)}`,H=Ut(k,B,a,n,r,o,D,ee);H.valid||W.push({instanceLocation:i,keyword:"propertyNames",keywordLocation:ee,error:`Property name "${k}" does not match schema.`},...H.errors)}}if(P!==void 0){let ee=`${s}/dependantRequired`;for(let k in P)if(k in e){let D=P[k];for(let H of D)H in e||W.push({instanceLocation:i,keyword:"dependentRequired",keywordLocation:ee,error:`Instance has "${k}" but does not have "${H}".`})}}if(J!==void 0)for(let ee in J){let k=`${s}/dependentSchemas`;if(ee in e){let D=Ut(e,J[ee],a,n,r,o,i,`${k}/${Qn(ee)}`,l);D.valid||W.push({instanceLocation:i,keyword:"dependentSchemas",keywordLocation:k,error:`Instance has "${ee}" but does not match dependant schema.`},...D.errors)}}if(ge!==void 0){let ee=`${s}/dependencies`;for(let k in ge)if(k in e){let D=ge[k];if(Array.isArray(D))for(let H of D)H in e||W.push({instanceLocation:i,keyword:"dependencies",keywordLocation:ee,error:`Instance has "${k}" but does not have "${H}".`});else{let H=Ut(e,D,a,n,r,o,i,`${ee}/${Qn(k)}`);H.valid||W.push({instanceLocation:i,keyword:"dependencies",keywordLocation:ee,error:`Instance has "${k}" but does not match dependant schema.`},...H.errors)}}}let oe=Object.create(null),ke=!1;if(A!==void 0){let ee=`${s}/properties`;for(let k in A){if(!(k in e))continue;let D=`${i}/${Qn(k)}`,H=Ut(e[k],A[k],a,n,r,o,D,`${ee}/${Qn(k)}`);if(H.valid)l[k]=oe[k]=!0;else if(ke=r,W.push({instanceLocation:i,keyword:"properties",keywordLocation:ee,error:`Property "${k}" does not match schema.`},...H.errors),ke)break}}if(!ke&&Q!==void 0){let ee=`${s}/patternProperties`;for(let k in Q){let D=new RegExp(k,"u"),H=Q[k];for(let fe in e){if(!D.test(fe))continue;let qe=`${i}/${Qn(fe)}`,gt=Ut(e[fe],H,a,n,r,o,qe,`${ee}/${Qn(k)}`);gt.valid?l[fe]=oe[fe]=!0:(ke=r,W.push({instanceLocation:i,keyword:"patternProperties",keywordLocation:ee,error:`Property "${fe}" matches pattern "${k}" but does not match associated schema.`},...gt.errors))}}}if(!ke&&$!==void 0){let ee=`${s}/additionalProperties`;for(let k in e){if(oe[k])continue;let D=`${i}/${Qn(k)}`,H=Ut(e[k],$,a,n,r,o,D,ee);H.valid?l[k]=!0:(ke=r,W.push({instanceLocation:i,keyword:"additionalProperties",keywordLocation:ee,error:`Property "${k}" does not match additional properties schema.`},...H.errors))}}else if(!ke&&q!==void 0){let ee=`${s}/unevaluatedProperties`;for(let k in e)if(!l[k]){let D=`${i}/${Qn(k)}`,H=Ut(e[k],q,a,n,r,o,D,ee);H.valid?l[k]=!0:W.push({instanceLocation:i,keyword:"unevaluatedProperties",keywordLocation:ee,error:`Property "${k}" does not match unevaluated properties schema.`},...H.errors)}}}else if(c==="array"){be!==void 0&&e.length>be&&W.push({instanceLocation:i,keyword:"maxItems",keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${be}).`}),We!==void 0&&e.length<We&&W.push({instanceLocation:i,keyword:"minItems",keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${We}).`});let le=e.length,oe=0,ke=!1;if(C!==void 0){let ee=`${s}/prefixItems`,k=Math.min(C.length,le);for(;oe<k;oe++){let D=Ut(e[oe],C[oe],a,n,r,o,`${i}/${oe}`,`${ee}/${oe}`);if(l[oe]=!0,!D.valid&&(ke=r,W.push({instanceLocation:i,keyword:"prefixItems",keywordLocation:ee,error:"Items did not match schema."},...D.errors),ke))break}}if(ze!==void 0){let ee=`${s}/items`;if(Array.isArray(ze)){let k=Math.min(ze.length,le);for(;oe<k;oe++){let D=Ut(e[oe],ze[oe],a,n,r,o,`${i}/${oe}`,`${ee}/${oe}`);if(l[oe]=!0,!D.valid&&(ke=r,W.push({instanceLocation:i,keyword:"items",keywordLocation:ee,error:"Items did not match schema."},...D.errors),ke))break}}else for(;oe<le;oe++){let k=Ut(e[oe],ze,a,n,r,o,`${i}/${oe}`,ee);if(l[oe]=!0,!k.valid&&(ke=r,W.push({instanceLocation:i,keyword:"items",keywordLocation:ee,error:"Items did not match schema."},...k.errors),ke))break}if(!ke&&ot!==void 0){let k=`${s}/additionalItems`;for(;oe<le;oe++){let D=Ut(e[oe],ot,a,n,r,o,`${i}/${oe}`,k);l[oe]=!0,D.valid||(ke=r,W.push({instanceLocation:i,keyword:"additionalItems",keywordLocation:k,error:"Items did not match additional items schema."},...D.errors))}}}if(ae!==void 0)if(le===0&&re===void 0)W.push({instanceLocation:i,keyword:"contains",keywordLocation:`${s}/contains`,error:"Array is empty. It must contain at least one item matching the schema."});else if(re!==void 0&&le<re)W.push({instanceLocation:i,keyword:"minContains",keywordLocation:`${s}/minContains`,error:`Array has less items (${le}) than minContains (${re}).`});else{let ee=`${s}/contains`,k=W.length,D=0;for(let H=0;H<le;H++){let fe=Ut(e[H],ae,a,n,r,o,`${i}/${H}`,ee);fe.valid?(l[H]=!0,D++):W.push(...fe.errors)}D>=(re||0)&&(W.length=k),re===void 0&&Ce===void 0&&D===0?W.splice(k,0,{instanceLocation:i,keyword:"contains",keywordLocation:ee,error:"Array does not contain item matching schema."}):re!==void 0&&D<re?W.push({instanceLocation:i,keyword:"minContains",keywordLocation:`${s}/minContains`,error:`Array must contain at least ${re} items matching schema. Only ${D} items were found.`}):Ce!==void 0&&D>Ce&&W.push({instanceLocation:i,keyword:"maxContains",keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${Ce} items matching schema. ${D} items were found.`})}if(!ke&&x!==void 0){let ee=`${s}/unevaluatedItems`;for(;oe<le;oe++){if(l[oe])continue;let k=Ut(e[oe],x,a,n,r,o,`${i}/${oe}`,ee);l[oe]=!0,k.valid||W.push({instanceLocation:i,keyword:"unevaluatedItems",keywordLocation:ee,error:"Items did not match unevaluated items schema."},...k.errors)}}if(Oe)for(let ee=0;ee<le;ee++){let k=e[ee],D=typeof k=="object"&&!!k;for(let H=0;H<le;H++){if(ee===H)continue;let fe=e[H];(k===fe||D&&typeof fe=="object"&&fe&&Xc(k,fe))&&(W.push({instanceLocation:i,keyword:"uniqueItems",keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${ee} and ${H}.`}),ee=2**53-1,H=2**53-1)}}}else if(c==="number"){if(a==="4"?(we!==void 0&&(Le===!0&&e<=we||e<we)&&W.push({instanceLocation:i,keyword:"minimum",keywordLocation:`${s}/minimum`,error:`${e} is less than ${Le?"or equal to ":""} ${we}.`}),ce!==void 0&&(ie===!0&&e>=ce||e>ce)&&W.push({instanceLocation:i,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ie?"or equal to ":""} ${ce}.`})):(we!==void 0&&e<we&&W.push({instanceLocation:i,keyword:"minimum",keywordLocation:`${s}/minimum`,error:`${e} is less than ${we}.`}),ce!==void 0&&e>ce&&W.push({instanceLocation:i,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ce}.`}),Le!==void 0&&e<=Le&&W.push({instanceLocation:i,keyword:"exclusiveMinimum",keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${Le}.`}),ie!==void 0&&e>=ie&&W.push({instanceLocation:i,keyword:"exclusiveMaximum",keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${ie}.`})),xe!==void 0){let le=e%xe;Math.abs(0-le)>=11920929e-14&&Math.abs(xe-le)>=11920929e-14&&W.push({instanceLocation:i,keyword:"multipleOf",keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${xe}.`})}}else if(c==="string"){let le=Ne===void 0&&_e===void 0?0:K9(e);Ne!==void 0&&le<Ne&&W.push({instanceLocation:i,keyword:"minLength",keywordLocation:`${s}/minLength`,error:`String is too short (${le} < ${Ne}).`}),_e!==void 0&&le>_e&&W.push({instanceLocation:i,keyword:"maxLength",keywordLocation:`${s}/maxLength`,error:`String is too long (${le} > ${_e}).`}),Fe!==void 0&&!new RegExp(Fe,"u").test(e)&&W.push({instanceLocation:i,keyword:"pattern",keywordLocation:`${s}/pattern`,error:"String does not match pattern."}),U!==void 0&&uA[U]&&!uA[U](e)&&W.push({instanceLocation:i,keyword:"format",keywordLocation:`${s}/format`,error:`String does not match format "${U}".`})}return{valid:W.length===0,errors:W}}var fA=class{constructor(e,t="2019-09",a=!0){K(this,"schema");K(this,"draft");K(this,"shortCircuit");K(this,"lookup");this.schema=e,this.draft=t,this.shortCircuit=a,this.lookup=qi(e)}validate(e){return Ut(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),qi(e,this.lookup)}};function hA(e){return J9(e,"output")}function Y9(e,t){let a=()=>structuredClone(e),n={"~standard":{version:1,vendor:"eve",validate:tj(e,t),jsonSchema:{input:a,output:a}}};return Z9.add(n),n}var Z9=new WeakSet,qne=Y9({});function J9(e,t){return e==null?e:Q9(e,t)}function Q9(e,t){let a=ej(e),n=a?.jsonSchema,r=typeof n=="object"&&n?n[t]:void 0,o=typeof a?.vendor=="string"?a.vendor:"unknown";if(a!==void 0&&typeof r!="function"&&o==="zod"){if(t==="input"){let l=Oi(e),{$schema:u,...c}=Fc(l.jsonSchema);return c}throw Error("Zod 3 cannot emit an output JSON Schema. Upgrade to Zod 4 or provide a plain JSON Schema object.")}if(a!==void 0&&typeof r!="function")throw Error(`Standard Schema vendor "${o}" does not support JSON Schema conversion. Provide a Standard Schema implementation with JSON Schema conversion or a plain JSON Schema object.`);let{$schema:i,...s}=Fc(a===void 0?e:r({target:"draft-07"}));return s}function ej(e){if(typeof e!="object"||!e||!("~standard"in e))return;let t=e["~standard"];return typeof t=="object"&&t?t:void 0}function tj(e,t){let a,n=!1,r=(o,i)=>(n||(n=!0,console.warn(`[eve] Tool schema cannot validate values locally; passing them through unvalidated: ${i}`)),{value:o});return o=>{if(a===void 0){let u=oj(e);if(typeof u=="string")return a=null,r(o,u);a=u}if(a===null)return{value:o};let i;try{i=a.validate(o)}catch(u){return o===void 0?{issues:[{message:"Expected a JSON value."}]}:r(o,Hc(u))}if(!i.valid)return{issues:fj(i.errors)};let s=Uv(e,e,o),l=t?.(s);return l===void 0?{value:s}:{issues:[{message:l}]}}}function Uv(e,t,a){let n=a;for(let r of gA(e,t)){let{items:o,properties:i}=r;if(wr(n)&&wr(i))n=aj(e,i,n);else if(Array.isArray(n)&&wr(o)){let s=n,l=s.map(u=>Uv(e,o,u));l.some((u,c)=>u!==s[c])&&(n=l)}}return n}function aj(e,t,a){let n=a;for(let[r,o]of Object.entries(t)){let i=Object.hasOwn(a,r)?a[r]:void 0,s=i===void 0?nj(e,o):Uv(e,o,i);s!==i&&(n===a&&(n={...a}),n[r]=s)}return n}function nj(e,t){for(let a of gA(e,t))if("default"in a)return structuredClone(a.default)}function*gA(e,t){let a=new Set,n=t;for(;wr(n)&&!a.has(n);)a.add(n),yield n,n=rj(e,n.$ref)}function rj(e,t){if(typeof t!="string"||t!=="#"&&!t.startsWith("#/"))return;let a=e;for(let n of Nv(t)){if(typeof a!="object"||!a||!Object.hasOwn(a,n))return;a=a[n]}return a}function oj(e){try{let t=structuredClone(e);return Kc(t)??new fA(t,"2020-12",!1)}catch(t){return Hc(t)}}var ij=new Set(["array","boolean","integer","null","number","object","string"]),sj=[["exclusiveMinimum","minimum"],["exclusiveMaximum","maximum"]],lj=["additionalItems","additionalProperties","contains","else","if","not","propertyNames","then","unevaluatedItems","unevaluatedProperties"],uj=["allOf","anyOf","oneOf","prefixItems"],cj=["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"];function Kc(e){if(typeof e=="boolean")return;if(typeof e!="object"||!e||Array.isArray(e))return"a subschema is neither an object nor a boolean";let t=e;delete t.format;for(let[s,l]of sj)typeof t[s]=="boolean"&&(t[s]&&typeof t[l]=="number"?(t[s]=t[l],delete t[l]):delete t[s]);let{enum:a,pattern:n,required:r,type:o}=t;if(o!==void 0&&!(Array.isArray(o)?o.every(pA):pA(o)))return`unsupported type ${JSON.stringify(o)}`;if(a!==void 0&&!Array.isArray(a))return"`enum` is not an array";if(r!==void 0&&!(Array.isArray(r)&&r.every(s=>typeof s=="string")))return"`required` is not an array of strings";if(n!==void 0&&!mA(n))return`invalid pattern ${JSON.stringify(n)}`;for(let s of lj)if(s in t){let l=Kc(t[s]);if(l!==void 0)return l}let i=t.items;for(let s of Array.isArray(i)?i:i===void 0?[]:[i]){let l=Kc(s);if(l!==void 0)return l}for(let s of uj){let l=t[s];if(l!==void 0){if(!Array.isArray(l))return`\`${s}\` is not an array`;for(let u of l){let c=Kc(u);if(c!==void 0)return c}}}for(let s of cj){let l=t[s];if(l!==void 0){if(typeof l!="object"||!l||Array.isArray(l))return`\`${s}\` is not an object`;for(let[u,c]of Object.entries(l)){if(s==="patternProperties"&&!mA(u))return`invalid pattern ${JSON.stringify(u)}`;if(s==="dependencies"&&Array.isArray(c))continue;let d=Kc(c);if(d!==void 0)return d}}}}function pA(e){return typeof e=="string"&&ij.has(e)}function mA(e){if(typeof e!="string")return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var dj=/\/(?:additional|unevaluated)Properties$/;function fj(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],o=e[n+1];if(dj.test(r.keywordLocation)&&o?.keyword==="false"){let i=Nv(o.instanceLocation).at(-1);t.push({keyword:"false",location:o.instanceLocation,message:`Unrecognized key: ${JSON.stringify(i)}`,object:r.instanceLocation}),n++}else t.push({keyword:r.keyword,location:r.instanceLocation,message:r.error})}let a=t.filter(n=>n.object===void 0||!t.some(r=>r.object===void 0&&(r.location===n.location||r.location.startsWith(`${n.location}/`))));return a.filter((n,r)=>{let o=a[r+1];return o===void 0?!0:o.location.startsWith(`${n.location}/`)?!1:n.keyword!=="$ref"||o.location!==n.location}).map(({location:n,message:r,object:o})=>{let i=Nv(o??n);return i.length===0?{message:r}:{message:r,path:i}})}function Nv(e){return e.split("/").slice(1).map(t=>{let a=t;try{a=decodeURIComponent(t)}catch{}return a.replaceAll("~1","/").replaceAll("~0","~")})}var yA=Symbol("followClientSession"),Ta,Bt,ra,zv,Fv,wA,qv,Hv,lm,Hi,Yc=(Hi=class{constructor(t,a){ue(this,ra);ue(this,Ta);ue(this,Bt);F(this,Ta,t),F(this,Bt,a)}static async create(t,a){var i;let n=await jv(t,ka,a,!0),{sessionId:r}=await Bv(n),o=new Hi(t,{sessionId:r,streamIndex:0});return{response:Y(i=o,ra,Fv).call(i,n,a,0),session:o}}static async prewarm(t,a={}){let{sessionId:n}=await Bv(await mj(t,a));return new Hi(t,{sessionId:n,streamIndex:0})}get state(){return b(this,Bt)}async snapshot(t){t?.signal?.throwIfAborted();let a=[];for await(let n of Y(this,ra,lm).call(this,{follow:!1,signal:t?.signal,startIndex:0}))a.push(n);return t?.signal?.throwIfAborted(),{events:a,session:{sessionId:b(this,Bt).sessionId,streamIndex:a.length}}}async send(t,a={}){return await Y(this,ra,zv).call(this,{...a,message:t},!0)}async respond(t,a={}){if(t.length===0)throw Error("ClientSession.respond() requires at least one input response.");return await Y(this,ra,zv).call(this,{...a,inputResponses:t},!1)}async cancel(t){return await oA({context:b(this,Ta),options:t,sessionId:b(this,Bt).sessionId})}async clear(){return await iA({context:b(this,Ta),sessionId:b(this,Bt).sessionId})}async compact(){return await sA({context:b(this,Ta),sessionId:b(this,Bt).sessionId})}async reset(t){return await lA({context:b(this,Ta),options:t,sessionId:b(this,Bt).sessionId})}stream(t){if(t?.follow===!1&&(t.startIndex??b(this,Bt).streamIndex)<0)throw Error("stream({ follow: false }) requires a nonnegative startIndex; a tail-relative cursor cannot be bounded.");return Y(this,ra,qv).call(this,t)}streamSubagent(t,a){if(t.data.sessionId!==b(this,Bt).sessionId)throw Error(`streamSubagent() requires a subagent.called event from session ${b(this,Bt).sessionId}, but it came from session ${t.data.sessionId}.`);if(typeof t.data.childStreamPath!="string")throw Error(`streamSubagent() requires a subagent.called event with childStreamPath, but call ${t.data.callId} has none. The event was recorded by an older eve version.`);let n=a?.startIndex??0;if(a?.follow===!1&&n<0)throw Error("streamSubagent({ follow: false }) requires a nonnegative startIndex; a tail-relative cursor cannot be bounded.");return Ov({follow:a?.follow,host:b(this,Ta).host,path:t.data.childStreamPath,redirect:b(this,Ta).redirect,resolveHeaders:()=>b(this,Ta).resolveHeaders(),signal:a?.signal,startIndex:n,streamReconnectPolicy:a?.streamReconnectPolicy})}[yA](t){return Y(this,ra,qv).call(this,{...t,keepAlive:!0})}},Ta=new WeakMap,Bt=new WeakMap,ra=new WeakSet,zv=async function(t,a){let n=b(this,Bt).streamIndex,r=EE(b(this,Bt).sessionId),o=a?await pj(b(this,Ta),r,t):await jv(b(this,Ta),r,t,!1),{sessionId:i,deliveryId:s}=await Bv(o,b(this,Bt).sessionId);if(i!==b(this,Bt).sessionId)throw Error("Message route returned a different session id.");if(t.message!==void 0&&s===void 0)throw Error("Message route did not return a delivery id. Update the server before sending with this client.");return Y(this,ra,Fv).call(this,o,t,n,t.message===void 0?void 0:s)},Fv=function(t,a,n,r){return t.body?.cancel().catch(()=>{}),new Rv({cancelTurn:async o=>await this.cancel({turnId:o}),createStream:o=>Y(this,ra,wA).call(this,n,a,r,o),deliveryId:r,sessionId:b(this,Bt).sessionId})},wA=async function*(t,a,n,r){let o=0,i=n===void 0,s=!1,l=new Set;try{for await(let u of r??Y(this,ra,lm).call(this,{headers:a.headers,keepAlive:!0,signal:a.signal,startIndex:t,streamReconnectPolicy:a.streamReconnectPolicy})){if(o+=1,n!==void 0){let c=u.meta?.deliveryIds?.includes(n)===!0,d=u.type==="session.failed"||u.type==="session.completed";if(!c&&d&&(!i||u.type==="session.completed"))throw Error("The session ended before the accepted message reached its turn boundary.");if(!i&&!c||!d&&u.meta?.deliveryIds!==void 0&&!c)continue;i=!0}if(Bi(l,u),s=xn(u)&&(u.type!=="session.waiting"||l.size===0),yield u,s)break}if(n!==void 0&&!s&&!a.signal?.aborted)throw Error("The response stream ended before the accepted message reached its turn boundary.")}finally{Y(this,ra,Hv).call(this,t+o)}},qv=async function*(t){let a=t?.startIndex??b(this,Bt).streamIndex,n=0;for await(let r of Y(this,ra,lm).call(this,{follow:t?.follow,headers:t?.headers,keepAlive:t?.keepAlive,onCaughtUp:t?.onCaughtUp,resolveHeaders:t?.resolveHeaders,resolveReconnectPolicy:t?.resolveReconnectPolicy,signal:t?.signal,startIndex:a,streamReconnectPolicy:t?.streamReconnectPolicy}))n+=1,a>=0&&Y(this,ra,Hv).call(this,a+n),yield r},Hv=function(t){F(this,Bt,{sessionId:b(this,Bt).sessionId,streamIndex:Math.max(b(this,Bt).streamIndex,t)})},lm=function(t){return Ov({onCaughtUp:t.onCaughtUp,follow:t.follow,host:b(this,Ta).host,keepAlive:t.keepAlive,resolveHeaders:()=>b(this,Ta).resolveHeaders(t.resolveHeaders?.()??t.headers),path:Iv(b(this,Bt).sessionId),redirect:b(this,Ta).redirect,signal:t.signal,startIndex:t.startIndex,streamReconnectPolicy:t.streamReconnectPolicy,resolveReconnectPolicy:t.resolveReconnectPolicy})},Hi);function vA(e,t){return e[yA](t)}async function pj(e,t,a){let n=Date.now()+2e4,r=250;for(;;){try{return await jv(e,t,a,!1)}catch(o){if(!hj(o))throw o;let i=n-Date.now();if(i<=0)throw o;await Gc(Math.min(r,i),a.signal)}a.signal?.throwIfAborted(),r=Math.min(r*2,2e3)}}async function mj(e,t){let a=await e.resolveHeaders(t.headers),n=await fetch(vr(e.host,ka),{headers:a,method:"POST",redirect:e.redirect,signal:t.signal??null});if(!n.ok){let r=await n.text();throw new Ja(n.status,r,n.headers)}return n}function hj(e){return e instanceof Ja&&e.status===409&&e.code==="session_not_ready"}async function jv(e,t,a,n){let r=gj(a,n);if(r===null)throw Error(n?"Creating a session requires a non-empty message.":"A session turn requires a non-empty message or inputResponses.");let o=await e.resolveHeaders(a.headers);o.set("content-type","application/json");let i=await fetch(vr(e.host,t),{body:JSON.stringify(r),headers:o,method:"POST",redirect:e.redirect,signal:a.signal??null});if(!i.ok){let s=await i.text();throw new Ja(i.status,s,i.headers)}return i}async function Bv(e,t){let a=await e.json(),n=(typeof a.sessionId=="string"?a.sessionId:void 0)??e.headers.get(OE)?.trim()??t;if(!n)throw Error("Message route did not return a session id.");return{sessionId:n,deliveryId:typeof a.deliveryId=="string"&&a.deliveryId.length>0?a.deliveryId:void 0}}function gj(e,t){let a={};e.message!==void 0&&(a.message=e.message),e.inputResponses!==void 0&&e.inputResponses.length>0&&(a.inputResponses=e.inputResponses),!t&&e.message!==void 0&&e.turnPolicy!==void 0&&(a.turnPolicy=e.turnPolicy),e.message!==void 0&&e.taskDeliveryPolicy!==void 0&&(a.taskDeliveryPolicy=e.taskDeliveryPolicy),e.clientContext!==void 0&&(a.clientContext=e.clientContext);let n=hA(e.outputSchema);return n!==void 0&&(a.outputSchema=n),t&&a.message===void 0||a.message===void 0&&a.inputResponses===void 0?null:a}var ji,xA,Vv=(xA=class{constructor(e){ue(this,ji);F(this,ji,e)}async create(e={}){return"message"in e?await Yc.create(b(this,ji),e):{session:await Yc.prewarm(b(this,ji),e)}}attach(e,t){if(e.length===0)throw Error("sessionId must be a non-empty string.");return new Yc(b(this,ji),{sessionId:e,streamIndex:t?.streamIndex??0})}},ji=new WeakMap,xA);function bA(e,t){let a=new TextEncoder().encode(`${e}:${t}`),n=Array.from(a,r=>String.fromCodePoint(r)).join("");return btoa(n)}var SA=f.object({ok:f.literal(!0),status:f.literal("ready"),workflowId:f.string().min(1)}).strict();var um=f.discriminatedUnion("kind",[f.object({kind:f.literal("application")}).strict(),f.object({feature:f.string(),kind:f.literal("framework")}).strict(),f.object({kind:f.literal("extension"),namespace:f.string(),packageName:f.string()}).strict()]),kA=f.discriminatedUnion("kind",[f.object({externalDependencies:f.array(f.string()),extensionScope:f.object({namespace:f.string(),sourceRoot:f.string()}).strict().optional(),kind:f.literal("filesystem"),sourcePath:f.string()}).strict(),f.object({dependencies:f.record(f.string(),f.string()).optional(),kind:f.literal("programmatic"),moduleId:f.string(),parameters:f.record(f.string(),f.unknown()).optional(),registryId:f.string(),revision:f.string(),semanticRevision:f.string().optional()}).strict()]),TA=f.object({backing:kA,logicalPath:f.string(),owner:um}).strict(),Jr=f.object({binding:TA.optional(),exportName:f.string().optional(),logicalPath:f.string(),owner:um,sourceId:f.string(),sourceKind:f.enum(["markdown","module","skill-package"])}).strict(),Vi=Jr.extend({name:f.string()}).strict(),Zc=Jr.extend({eventNames:f.array(f.string()),slug:f.string()}).strict(),yj=f.discriminatedUnion("kind",[f.object({kind:f.literal("gateway"),target:f.string(),byok:f.string().optional()}).strict(),f.object({kind:f.literal("external"),provider:f.string()}).strict()]),wj=f.union([f.object({kind:f.literal("external"),provider:f.string()}).strict(),f.object({kind:f.literal("chatgpt"),state:f.enum(["checking","ready","signed-out","reauth-required","unavailable"]),accountLabel:f.string().optional()}).strict(),f.object({kind:f.literal("gateway"),connected:f.literal(!0),credential:f.enum(["api-key","oidc","oauth"]),team:f.optional(f.string())}).strict(),f.object({kind:f.literal("gateway"),connected:f.literal(!1)}).strict()]),IA={contextWindowTokens:f.number().optional(),providerOptions:f.unknown().optional(),reasoning:f.enum(["provider-default","none","minimal","low","medium","high","xhigh"]).optional().catch(void 0),source:Jr.optional()},vj=f.union([f.object({...IA,endpoint:wj.optional(),id:f.string(),routing:yj}).strict(),f.object({...IA,endpoint:f.never().optional(),id:f.never().optional(),routing:f.object({kind:f.literal("dynamic"),resolver:Zc}).strict()}).strict()]),xj=Vi.extend({description:f.string(),hasAuth:f.boolean(),hasExecute:f.boolean(),hasModelOutputProjection:f.boolean(),hasOutputSchema:f.boolean(),inputSchema:f.unknown(),outputSchema:f.unknown().optional(),requiresApproval:f.boolean()}).strict(),bj=Vi.extend({description:f.string(),license:f.string().optional(),markdown:f.string(),metadata:f.record(f.string(),f.string()).optional()}).strict(),Sj=Vi.extend({content:f.string(),role:f.enum(["system","user"])}).strict(),Ij=Vi.extend({cron:f.string(),hasRun:f.boolean(),markdown:f.string().optional()}).strict(),LA=f.enum(["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS","WEBSOCKET"]),Cj=Vi.extend({adapterKind:f.string().optional(),method:LA,urlPath:f.string()}).strict(),kj=f.object({backing:f.union([kA,f.object({kind:f.literal("resource"),sourcePath:f.string()}).strict()]),form:f.enum(["derived","direct"]),layer:f.enum(["framework-default","extension-package","extension-override","application"]),logicalPath:f.string(),owner:um,sourceId:f.string()}).strict(),Tj=f.object({method:LA,source:kj,urlPath:f.string(),winnerSourceId:f.string()}).strict(),Lj=Jr.extend({connectionName:f.string(),description:f.string(),hasApproval:f.boolean(),hasAuthorization:f.boolean(),hasHeaders:f.boolean(),protocol:f.string(),toolFilter:f.unknown().optional(),url:f.string()}).strict(),Ej=Jr.extend({eventNames:f.array(f.string()),slug:f.string()}).strict(),Aj=Jr.extend({description:f.string().optional(),slot:f.string(),visibility:f.enum(["scope","session"])}).strict(),Mj=Jr.extend({provider:f.string().optional(),environmentExportName:f.string().optional(),revisionHash:f.string()}).strict(),Rj=Vi.extend({configResolver:Zc.optional(),description:f.string().optional(),entryPath:f.string(),nodeId:f.string(),parentNodeId:f.string(),rootPath:f.string(),summary:f.object({channels:f.number(),connections:f.number(),hooks:f.number(),instructions:f.number(),memories:f.number(),schedules:f.number(),skills:f.number(),tools:f.number()}).strict()}).strict(),Dj=Vi.extend({description:f.string(),nodeId:f.string(),parentNodeId:f.string(),url:f.string().optional()}).strict(),_j=f.object({action:f.enum(["subagent-call","task-cancel","workflow-tool-call"]).optional(),audience:f.array(f.enum(["root-session","delegated-task-child"])),kind:f.enum(["dispatch","provider-tool"]),sourceId:f.string()}).strict(),CA=f.object({kind:f.enum(["disabled","shadowed"]),logicalPath:f.string(),owner:um,sourceId:f.string(),winnerSourceId:f.string().optional()}).strict(),EA=f.object({agent:f.object({agentRoot:f.string(),appRoot:f.string(),config:Jr.extend({binding:TA}).strict(),description:f.string().optional(),model:vj,name:f.string(),nodeId:f.string(),outputSchema:f.unknown().optional()}).strict(),capabilities:f.object({devRoutes:f.boolean()}).strict(),channels:f.object({routes:f.array(Cj),shadowed:f.array(Tj)}).strict(),composition:f.object({disabled:f.array(CA),shadowed:f.array(CA)}).strict(),connections:f.array(Lj),diagnostics:f.object({discoveryErrors:f.number(),discoveryWarnings:f.number()}).strict(),hooks:f.array(Ej),instructions:f.object({dynamic:f.array(Zc),static:f.array(Sj)}).strict(),instrumentation:Jr.optional(),kernelEffects:f.array(_j),kind:f.literal("eve-agent-info"),memories:f.array(Aj),mode:f.enum(["development","production"]),remoteAgents:f.object({entries:f.array(Dj),total:f.number()}).strict(),sandbox:Mj,schedules:f.array(Ij),skills:f.object({dynamic:f.array(Zc),static:f.array(bj)}).strict(),subagents:f.object({local:f.array(Rj),total:f.number()}).strict(),tools:f.object({dynamic:f.array(Zc),static:f.array(xj)}).strict(),version:f.literal(5),workspace:f.object({resourceRoot:f.unknown(),rootEntries:f.array(f.string())}).strict()}).strict().superRefine((e,t)=>{let a=(o,i,s)=>{let l=new Set;o.forEach((u,c)=>{let d=i(u);l.has(d)&&t.addIssue({code:"custom",message:`Duplicate public identity "${d}".`,path:[...s,c]}),l.add(d)})},n=(o,i,s)=>{(!Number.isSafeInteger(o)||o<0||o!==i.length)&&t.addIssue({code:"custom",message:`Expected total ${i.length}, received ${o}.`,path:[...s]})};a(e.tools.static,o=>o.name,["tools","static"]),a(e.tools.dynamic,o=>o.slug,["tools","dynamic"]),a(e.skills.static,o=>o.name,["skills","static"]),a(e.skills.dynamic,o=>o.slug,["skills","dynamic"]),a(e.instructions.static,o=>o.name,["instructions","static"]),a(e.instructions.dynamic,o=>o.slug,["instructions","dynamic"]),a(e.schedules,o=>o.name,["schedules"]),a(e.connections,o=>o.connectionName,["connections"]),a(e.hooks,o=>o.slug,["hooks"]),a(e.memories,o=>o.slot,["memories"]),a(e.channels.routes,o=>`${o.method} ${Pj(o.urlPath)}`,["channels","routes"]),a(e.subagents.local,o=>o.nodeId,["subagents","local"]),a(e.remoteAgents.entries,o=>o.nodeId,["remoteAgents","entries"]),n(e.subagents.total,e.subagents.local,["subagents","total"]),n(e.remoteAgents.total,e.remoteAgents.entries,["remoteAgents","total"]);let r=[[e.agent.config,["agent","config"]],...e.agent.model.source===void 0?[]:[[e.agent.model.source,["agent","model","source"]]],...e.agent.model.routing.kind==="dynamic"?[[e.agent.model.routing.resolver,["agent","model","routing","resolver"]]]:[],...e.channels.routes.map((o,i)=>[o,["channels","routes",i]]),...e.connections.map((o,i)=>[o,["connections",i]]),...e.hooks.map((o,i)=>[o,["hooks",i]]),...e.instructions.dynamic.map((o,i)=>[o,["instructions","dynamic",i]]),...e.instructions.static.map((o,i)=>[o,["instructions","static",i]]),...e.memories.map((o,i)=>[o,["memories",i]]),...e.instrumentation===void 0?[]:[[e.instrumentation,["instrumentation"]]],...e.remoteAgents.entries.map((o,i)=>[o,["remoteAgents","entries",i]]),...e.schedules.map((o,i)=>[o,["schedules",i]]),...e.skills.dynamic.map((o,i)=>[o,["skills","dynamic",i]]),...e.skills.static.map((o,i)=>[o,["skills","static",i]]),...e.subagents.local.flatMap((o,i)=>o.configResolver===void 0?[]:[[o.configResolver,["subagents","local",i,"configResolver"]]]),...e.tools.dynamic.map((o,i)=>[o,["tools","dynamic",i]]),...e.tools.static.map((o,i)=>[o,["tools","static",i]]),[e.sandbox,["sandbox"]]];for(let[o,i]of r){if(o.sourceKind==="module"&&o.binding===void 0){t.addIssue({code:"custom",message:"Module source is missing its compiled binding.",path:[...i,"binding"]});continue}if(o.sourceKind!=="module"&&o.binding!==void 0){t.addIssue({code:"custom",message:`${o.sourceKind} source cannot carry a module binding.`,path:[...i,"binding"]});continue}o.binding!==void 0&&(o.binding.logicalPath!==o.logicalPath&&t.addIssue({code:"custom",message:"Source and binding logical paths do not match.",path:[...i,"binding","logicalPath"]}),JSON.stringify(o.binding.owner)!==JSON.stringify(o.owner)&&t.addIssue({code:"custom",message:"Source and binding owners do not match.",path:[...i,"binding","owner"]}))}});function Pj(e){return e.replace(/^\/+|\/+$/g,"").split("/").map(t=>t.startsWith(":")||/^\[[^\]]+\]$/.test(t)?":":t).join("/")}var AA="x-vercel-trusted-oidc-idp-token";var Jc,Qc,$i,Wi,jo,cm,DA,RA,Wv=(RA=class{constructor(e){ue(this,jo);ue(this,Jc);ue(this,Qc);ue(this,$i);ue(this,Wi);K(this,"sessions");F(this,$i,e.host),F(this,Jc,e.auth),F(this,Qc,e.headers),F(this,Wi,e.redirect),this.sessions=new Vv({host:b(this,$i),redirect:b(this,Wi),resolveHeaders:t=>Y(this,jo,cm).call(this,t)})}async health(){let e=vr(b(this,$i),TE),t=await Y(this,jo,cm).call(this),a=await fetch(e,MA({headers:t},b(this,Wi)));if(!a.ok){let o=await a.text();throw new Ja(a.status,o,a.headers)}let n;try{n=await a.json()}catch{throw new om}let r=SA.safeParse(n);if(!r.success)throw new om(r.error.issues.slice(0,5).map(o=>{let i=o.path.join(".");return i.length===0?o.message:`${i}: ${o.message}`}));return r.data}async info(e={}){let t=await this.fetch(LE,e);if(!t.ok){let r=await t.text();throw new Ja(t.status,r,t.headers)}let a;try{a=await t.json()}catch{throw new rm}let n=EA.safeParse(a);if(!n.success)throw new rm(n.error.issues.slice(0,5).map(r=>{let o=r.path.join(".");return o.length===0?r.message:`${o}: ${r.message}`}));return n.data}async fetch(e,t={}){let a=vr(b(this,$i),e),n=await Y(this,jo,cm).call(this,Nj(t.headers));return await fetch(a,MA({...t,headers:n},b(this,Wi)))}},Jc=new WeakMap,Qc=new WeakMap,$i=new WeakMap,Wi=new WeakMap,jo=new WeakSet,cm=async function(e){let t=new Headers,[a,n]=await Promise.all([Oj(b(this,Qc)),Y(this,jo,DA).call(this)]);for(let[r,o]of Object.entries(a))t.set(r,o);for(let[r,o]of Object.entries(n))t.set(r,o);if(e)for(let[r,o]of Object.entries(e))t.set(r,o);return t},DA=async function(){let e=b(this,Jc);if(!e)return{};if("vercelOidc"in e){let t=(await $v(e.vercelOidc.token)).trim();return t.length===0?{}:{authorization:`Bearer ${t}`,[AA]:t}}if("bearer"in e){let t=(await $v(e.bearer)).trim();return t.length===0?{}:{authorization:`Bearer ${t}`}}if("basic"in e){let t=await $v(e.basic.password);return{authorization:`Basic ${bA(e.basic.username,t)}`}}return{}},RA);async function $v(e){return typeof e=="function"?e():e}async function Oj(e){return e===void 0?{}:typeof e=="function"?await e():e}function Nj(e){return e===void 0?{}:Object.fromEntries(new Headers(e).entries())}function MA(e,t){return t===void 0?e:{...e,redirect:t}}function Gv(){let e=new Set;return{admit(t){let a=t.meta?.id;return a===void 0||!e.has(a)&&(e.add(a),!0)},get size(){return e.size}}}var Gi,Xi,Qr,Ki,ed,td,ad,El,dm,_A,OA=(_A=class{constructor(e,t){ue(this,El);ue(this,Gi,new AbortController);ue(this,Xi,new Set);ue(this,Qr,Promise.withResolvers());K(this,"caughtUp",b(this,Qr).promise);ue(this,Ki,!1);ue(this,ed);ue(this,td);ue(this,ad);this.setOptions(t),this.caughtUp.catch(()=>{}),t.catchUp||b(this,Qr).resolve(),(async()=>{try{for await(let a of vA(e,{signal:b(this,Gi).signal,resolveHeaders:()=>b(this,td),resolveReconnectPolicy:()=>b(this,ad),startIndex:t.startIndex,onCaughtUp:t.catchUp?()=>b(this,Qr).resolve():void 0})){if(b(this,Gi).signal.aborted)return;t.onEvent(a);for(let n of b(this,Xi))n.push(a);if(a.type==="session.completed"||a.type==="session.failed")break}b(this,Qr).resolve(),Y(this,El,dm).call(this)}catch(a){b(this,Qr).reject(a),Y(this,El,dm).call(this,a),b(this,Gi).signal.aborted||t.onError(a)}})()}subscribe(e){let t=new Uj(()=>b(this,Xi).delete(t),e);return b(this,Ki)?t.end(b(this,ed)):b(this,Xi).add(t),t}get ended(){return b(this,Ki)}setOptions(e){"headers"in e&&F(this,td,e.headers),"streamReconnectPolicy"in e&&F(this,ad,e.streamReconnectPolicy)}close(){let e=new DOMException("Session stream was detached.","AbortError");b(this,Gi).abort(e),b(this,Qr).reject(e),Y(this,El,dm).call(this,e)}},Gi=new WeakMap,Xi=new WeakMap,Qr=new WeakMap,Ki=new WeakMap,ed=new WeakMap,td=new WeakMap,ad=new WeakMap,El=new WeakSet,dm=function(e){if(!b(this,Ki)){F(this,Ki,!0),F(this,ed,e);for(let t of b(this,Xi))t.end(e)}},_A),Vo,Yi,Zi,Al,nd,PA,Uj=(PA=class{constructor(e,t){ue(this,Vo,[]);ue(this,Yi,Promise.withResolvers());ue(this,Zi,!1);ue(this,Al);ue(this,nd);let a=()=>this.end(t?.reason);t?.addEventListener("abort",a,{once:!0}),F(this,nd,()=>{t?.removeEventListener("abort",a),e()}),t?.aborted&&a()}push(e){b(this,Zi)||(b(this,Vo).push(e),b(this,Yi).resolve())}end(e){b(this,Zi)||(F(this,Zi,!0),F(this,Al,e),b(this,Yi).resolve())}[Symbol.dispose](){this.end(),F(this,Vo,[]),b(this,nd).call(this)}discard(){F(this,Vo,[])}async*[Symbol.asyncIterator](){for(;;){for(;b(this,Vo).length>0;)yield b(this,Vo).shift();if(b(this,Zi)){if(b(this,Al)!==void 0)throw b(this,Al);return}F(this,Yi,Promise.withResolvers()),await b(this,Yi).promise}}},Vo=new WeakMap,Yi=new WeakMap,Zi=new WeakMap,Al=new WeakMap,nd=new WeakMap,PA);var $o,Qa,br,Ml,fm,NA,UA=(NA=class{constructor(e,t){ue(this,Ml);ue(this,$o);ue(this,Qa);ue(this,br);F(this,$o,e),F(this,Qa,t),F(this,br,Y(this,Ml,fm).call(this))}get data(){return b(this,br)}reset(){F(this,Qa,[]),F(this,br,b(this,$o).initial())}append(e){F(this,Qa,[...b(this,Qa),e]),F(this,br,b(this,$o).reduce(b(this,br),e))}remove(e){F(this,Qa,b(this,Qa).filter(t=>!e(t))),F(this,br,Y(this,Ml,fm).call(this))}replace(e,t){let a=b(this,Qa).findIndex(e);F(this,Qa,a===-1?[...b(this,Qa),t]:b(this,Qa).map((n,r)=>r===a?t:n)),F(this,br,Y(this,Ml,fm).call(this))}},$o=new WeakMap,Qa=new WeakMap,br=new WeakMap,Ml=new WeakSet,fm=function(){let e=b(this,$o).initial();for(let t of b(this,Qa))e=b(this,$o).reduce(e,t);return e},NA);function zA(e){let t=e.at(-1);return t!==void 0&&xn(t)&&(t.type!=="session.waiting"||Bj(e).size===0)}function Bj(e){let t=new Set;for(let a of e)Bi(t,a);return t}function Xv(e){if(e.message!==void 0==(e.inputResponses!==void 0))throw Error("A turn requires exactly one of message or inputResponses.")}var BA=0;function FA(){let e=globalThis.crypto?.randomUUID;return e===void 0?(BA+=1,`submission_${BA.toString()}`):e.call(globalThis.crypto)}function rd(e,t){return e?AbortSignal.any([e,t]):t}function qA(e){if(typeof e=="string")return e;let t=[];for(let a of e)a.type==="text"?t.push(a.text):a.type==="file"&&t.push(a.filename?`[file: ${a.filename}]`:"[file]");return t.join(`
|
|
141
|
-
`)}function Kv(e){return e instanceof Error&&e.name==="AbortError"}function HA(e){if(e.type!=="session.failed")return;let t=Error(e.data.message);return t.name=e.data.code,t}function Yv(e){let t=Promise.withResolvers(),a=Promise.withResolvers(),n={abortController:new AbortController,acceptedFollowUps:0,cancel:()=>e(n),completion:a.promise,followUpDispatches:new Set,receivedFollowUps:0,receivedFollowUpEvents:new Map,followUpSubmissionIds:new Set,resolveCompletion:a.resolve,response:t.promise,resolveResponse:t.resolve};return n}async function Zv(e,t,a){for(;e.followUpDispatches.size>0;)await Promise.allSettled(e.followUpDispatches);if(!(e.receivedFollowUps>=e.acceptedFollowUps))for await(let n of t){if(!a())return;if(e.receivedFollowUps+=e.receivedFollowUpEvents.get(n)??0,e.receivedFollowUpEvents.delete(n),xn(n)){for(;e.followUpDispatches.size>0;)await Promise.allSettled(e.followUpDispatches);if(e.receivedFollowUps>=e.acceptedFollowUps)return}}}async function od(e,t){if(t===void 0)return await e;let a=Promise.withResolvers(),n=()=>a.reject(t.reason);t.addEventListener("abort",n,{once:!0}),t.aborted&&n();try{return await Promise.race([a.promise,e])}finally{t.removeEventListener("abort",n)}}var id,er,ba,Wo,Jv,Qv,jA,VA=(jA=class{constructor(e,t){ue(this,Wo);ue(this,id);ue(this,er);ue(this,ba,[]);F(this,er,e),F(this,id,t)}reset(){F(this,ba,[])}submit(e,t){if(e.message===void 0)return;let a={createdAt:Date.now(),eventStartIndex:t,id:FA(),message:qA(e.message),requiresDeliveryId:!0};return F(this,ba,[...b(this,ba),a]),b(this,id)&&b(this,er).append({data:{createdAt:a.createdAt,message:a.message,submissionId:a.id},type:"client.message.submitted"}),a.id}apply(e){if(e.type!=="message.received"){b(this,er).append(e);return}if(e.data.kind==="execution.background_task"){b(this,er).append(e);return}let t=Y(this,Wo,Jv).call(this,e);if(t.length===0){b(this,er).append(e);return}return Y(this,Wo,Qv).call(this,t,e,!1)}correlate(e,t,a){if(e===void 0)return;F(this,ba,b(this,ba).map(r=>r.id===e?{...r,deliveryId:t,requiresDeliveryId:t!==void 0}:r));let n=b(this,ba).find(r=>r.id===e);if(n!==void 0)for(let r of a.slice(n.eventStartIndex)){if(r.type!=="message.received"||r.data.kind==="execution.background_task")continue;let o=Y(this,Wo,Jv).call(this,r);if(o.some(i=>i.id===e))return Y(this,Wo,Qv).call(this,o,r,!0)}}fail(e,t){let a=t===void 0?b(this,ba)[0]:b(this,ba).find(n=>n.id===t);a!==void 0&&(F(this,ba,b(this,ba).filter(n=>n.id!==a.id)),b(this,er).replace(n=>n.type==="client.message.submitted"&&n.data.submissionId===a.id,{data:{createdAt:a.createdAt,error:{message:e.message},message:a.message,submissionId:a.id},type:"client.message.failed"}))}failAll(e){for(let t of b(this,ba))this.fail(e,t.id)}},id=new WeakMap,er=new WeakMap,ba=new WeakMap,Wo=new WeakSet,Jv=function(e){return b(this,ba).filter(t=>t.deliveryId===void 0?!t.requiresDeliveryId:e.meta.deliveryIds?.includes(t.deliveryId)===!0)},Qv=function(e,t,a){let n=e.map(o=>o.id),r=new Set(n);return F(this,ba,b(this,ba).filter(o=>!r.has(o.id))),a||b(this,er).replace(o=>o.type==="client.message.submitted"&&o.data.submissionId===n[0],t),b(this,er).remove(o=>o.type==="client.message.submitted"&&r.has(o.data.submissionId)),{alreadyProjected:a,event:t,ids:n}},jA);var zj=Symbol("detachEveAgentStore"),Fj=Symbol("attachEveAgentStore"),Go,Dl,_l,en,Xo,Ji,sd,Ko,Pl,Ol,Pt,pa,Ct,Ea,tn,Bn,tr,Qi,Sr,bt,Yo,mt,se,ex,WA,GA,XA,Rl,tx,ax,Sa,KA,YA,pm,nx,rx,La,$A,ox=($A=class{constructor(e){ue(this,se);ue(this,Go);ue(this,Dl);ue(this,_l,!1);ue(this,en);ue(this,Xo,new Set);ue(this,Ji);ue(this,sd);ue(this,Ko);ue(this,Pl,new Set);ue(this,Ol,Gv());ue(this,Pt);ue(this,pa,{});ue(this,Ct);ue(this,Ea);ue(this,tn);ue(this,Bn,0);ue(this,tr);ue(this,Qi);ue(this,Sr);ue(this,bt);ue(this,Yo);ue(this,mt,"ready");F(this,Dl,e.prewarm??!1),F(this,Ji,e.session!==void 0),F(this,Go,b(this,Ji)?void 0:new Wv({auth:e.auth,headers:e.headers,host:e.host??""}));let t=[];for(let a of e.initialEvents??[])b(this,Ol).admit(a)&&t.push(a),Bi(b(this,Xo),a);F(this,Ea,t),F(this,Ko,new UA(e.reducer,b(this,Ea))),F(this,sd,e.optimistic??!0),F(this,tn,new VA(b(this,Ko),b(this,sd))),F(this,bt,e.session??(e.initialSession===void 0?void 0:b(this,Go)?.sessions.attach(e.initialSession.sessionId,{streamIndex:e.initialSession.streamIndex}))),F(this,Yo,Y(this,se,rx).call(this))}get snapshot(){return b(this,Yo)}setCallbacks(e){F(this,pa,e)}subscribe(e){return b(this,Pl).add(e),()=>{b(this,Pl).delete(e)}}prewarm(){if(b(this,tr)!==void 0)return b(this,tr);if(b(this,bt)!==void 0||b(this,Ji))return Promise.resolve();if(b(this,Pt)!==void 0)return b(this,Pt).response.then(o=>{if(o===void 0)throw b(this,Ct)??new DOMException("Session creation was aborted.","AbortError")});let e=b(this,Go);if(e===void 0)return Promise.reject(Error("This eve agent store does not own a session client."));let t=b(this,Bn),a=new AbortController;F(this,Qi,a);let n=(async()=>{try{let o=await e.sessions.create({signal:a.signal});if(t!==b(this,Bn))return;F(this,bt,o.session),F(this,Ct,void 0),b(this,mt)==="error"&&F(this,mt,"ready"),b(this,pa).onSessionChange?.(o.session.state),Y(this,se,La).call(this),Y(this,se,Rl).call(this)}catch(o){throw t===b(this,Bn)&&b(this,Pt)===void 0&&b(this,Ct)===void 0&&(F(this,Ct,Ui(o)),F(this,mt,"error"),b(this,pa).onError?.(b(this,Ct)),Y(this,se,La).call(this)),o}})();F(this,tr,n);let r=()=>{b(this,tr)===n&&(F(this,tr,void 0),F(this,Qi,void 0))};return n.then(r,r),n}async send(e){return await Y(this,se,ex).call(this,e,b(this,pa).prepareSend)}resume(){if(b(this,Sr)!==void 0)return b(this,Sr);let e=Y(this,se,WA).call(this);F(this,Sr,e);let t=()=>{b(this,Sr)===e&&F(this,Sr,void 0)};return e.then(t,t),e}cancel(){let e=b(this,Pt);return e===void 0?b(this,mt)==="streaming"&&b(this,bt)!==void 0?b(this,bt).cancel():Promise.resolve({status:"no_active_turn"}):e.cancel()}[Fj](){F(this,_l,!0),b(this,Dl)&&b(this,bt)===void 0&&this.prewarm().catch(()=>{})}[zj](){F(this,_l,!1),b(this,en)?.close(),F(this,en,void 0),b(this,Pt)?.abortController.abort(),Y(this,se,tx).call(this),F(this,Sr,void 0)}reset(){b(this,en)?.close(),F(this,en,void 0),b(this,Xo).clear();let e=b(this,Pt);F(this,Pt,void 0),e?.resolveResponse(void 0),e?.resolveCompletion(),e?.abortController.abort(),Y(this,se,tx).call(this),F(this,Sr,void 0),b(this,Ji)||F(this,bt,void 0),F(this,Ea,[]),F(this,Ol,Gv()),b(this,tn).reset(),b(this,Ko).reset(),F(this,Ct,void 0),F(this,mt,"ready"),b(this,pa).onSessionChange?.(b(this,bt)?.state),Y(this,se,La).call(this),b(this,Dl)&&b(this,_l)&&this.prewarm().catch(()=>{})}},Go=new WeakMap,Dl=new WeakMap,_l=new WeakMap,en=new WeakMap,Xo=new WeakMap,Ji=new WeakMap,sd=new WeakMap,Ko=new WeakMap,Pl=new WeakMap,Ol=new WeakMap,Pt=new WeakMap,pa=new WeakMap,Ct=new WeakMap,Ea=new WeakMap,tn=new WeakMap,Bn=new WeakMap,tr=new WeakMap,Qi=new WeakMap,Sr=new WeakMap,bt=new WeakMap,Yo=new WeakMap,mt=new WeakMap,se=new WeakSet,ex=async function(e,t){if(b(this,Pt)!==void 0){if(b(this,mt)==="resuming")throw Error("eve session is resuming.");return await Y(this,se,GA).call(this,b(this,Pt),e,t)}let a=Yv(r=>r.acceptedFollowUps>0&&b(this,bt)!==void 0?b(this,bt).cancel():r.response.then(o=>o===void 0?{status:"no_active_turn"}:o.cancel()));F(this,Pt,a),F(this,Ct,void 0),F(this,mt,"submitted"),Y(this,se,La).call(this);let n;try{let r=await(t===void 0?e:od(Promise.resolve(t(e)),rd(e.signal,a.abortController.signal)));if(Xv(r),!Y(this,se,Sa).call(this,a))return;let o=b(this,tn).submit(r,b(this,Ea).length);Y(this,se,KA).call(this,r),Y(this,se,La).call(this);let i={...r,signal:rd(r.signal,a.abortController.signal)},s=await Y(this,se,XA).call(this,i),l=s.response;if(n=s.reader,!Y(this,se,Sa).call(this,a))return;a.resolveResponse(l),Y(this,se,pm).call(this,b(this,tn).correlate(o,Dv(l),b(this,Ea)))&&Y(this,se,La).call(this);for await(let u of WE(l,n)){if(!Y(this,se,Sa).call(this,a))return;a.receivedFollowUps+=a.receivedFollowUpEvents.get(u)??0,a.receivedFollowUpEvents.delete(u)}if(!Y(this,se,Sa).call(this,a)||(await Zv(a,n,()=>Y(this,se,Sa).call(this,a)),!Y(this,se,Sa).call(this,a)))return;F(this,mt,b(this,Ct)===void 0?"ready":"error")}catch(r){if(!Y(this,se,Sa).call(this,a))return;if(Kv(r))F(this,mt,"ready"),b(this,tn).fail(Ui(r));else{let o=b(this,Ct)!==void 0;b(this,Ct)??F(this,Ct,Ui(r)),F(this,mt,"error"),b(this,tn).fail(b(this,Ct)),o||b(this,pa).onError?.(b(this,Ct))}}finally{n?.[Symbol.dispose](),Y(this,se,ax).call(this,a)}},WA=async function(){if(b(this,mt)==="resuming"||b(this,mt)==="streaming"||b(this,mt)==="submitted")throw Error("eve session is already processing a turn.");if(b(this,bt)===void 0)throw Error("An eve session is required before resuming.");let e=b(this,bt),t=Yv(()=>e.cancel());F(this,Pt,t),t.resolveResponse(void 0),F(this,Ct,void 0),F(this,mt,"resuming"),Y(this,se,La).call(this);let a;try{let n=Y(this,se,Rl).call(this,{catchUp:!0,startIndex:b(this,Ea).length===e.state.streamIndex?e.state.streamIndex:0});if(a=n.subscribe(t.abortController.signal),await n.caughtUp,!Y(this,se,Sa).call(this,t))return;a.discard();let r=b(this,Ea).at(-1);if(r!==void 0&&Y(this,se,nx).call(this,r),r!==void 0&&b(this,Ct)===void 0&&!zA(b(this,Ea))){F(this,mt,"streaming"),Y(this,se,La).call(this);for await(let o of a){if(!Y(this,se,Sa).call(this,t))return;if(t.receivedFollowUps+=t.receivedFollowUpEvents.get(o)??0,t.receivedFollowUpEvents.delete(o),xn(o)&&b(this,Xo).size===0)break}}await Zv(t,a,()=>Y(this,se,Sa).call(this,t)),Y(this,se,Sa).call(this,t)&&F(this,mt,b(this,Ct)===void 0?"ready":"error")}catch(n){if(!Y(this,se,Sa).call(this,t))return;Kv(n)?F(this,mt,"ready"):(F(this,Ct,Ui(n)),F(this,mt,"error"),b(this,pa).onError?.(b(this,Ct)))}finally{a?.[Symbol.dispose](),Y(this,se,ax).call(this,t)}},GA=async function(e,t,a){if(t.message===void 0||t.turnPolicy!=="steer")throw Error('eve session is already processing a turn. Send a message with turnPolicy: "steer" to guide it at the next boundary.');let n=b(this,Bn),r=rd(t.signal,e.abortController.signal),o=await od(Promise.resolve(a?.(t)),r)??t;if(n!==b(this,Bn))return;if(Xv(o),o.message===void 0||o.turnPolicy!=="steer")throw Error('An in-flight follow-up requires a message with turnPolicy: "steer".');if(!Y(this,se,Sa).call(this,e))return await Y(this,se,ex).call(this,o);let i=b(this,tn).submit(o,b(this,Ea).length);i!==void 0&&e.followUpSubmissionIds.add(i),Y(this,se,La).call(this),Y(this,se,Rl).call(this,{headers:o.headers,streamReconnectPolicy:o.streamReconnectPolicy});let s;s=(async()=>{try{let l=rd(o.signal,e.abortController.signal);if(await od(e.response,l),!Y(this,se,Sa).call(this,e)||b(this,bt)===void 0)throw Error("The active eve turn ended before the follow-up could be sent.");let{message:u,...c}=o,d=await b(this,bt).send(u,{...c,signal:l});e.acceptedFollowUps+=1,Y(this,se,pm).call(this,b(this,tn).correlate(i,Dv(d),b(this,Ea)))&&Y(this,se,La).call(this)}catch(l){throw Y(this,se,Sa).call(this,e)&&(b(this,tn).fail(Ui(l),i),Y(this,se,La).call(this)),l}finally{e.followUpDispatches.delete(s)}})(),e.followUpDispatches.add(s),await s,await e.completion},XA=async function(e){let t={headers:e.headers,streamReconnectPolicy:e.streamReconnectPolicy};if(b(this,tr)!==void 0&&(await od(b(this,tr).catch(n=>{if(b(this,bt)!==void 0)throw n}),e.signal),e.signal?.throwIfAborted()),b(this,bt)===void 0){if(b(this,Go)===void 0)throw Error("An external eve session is required before sending.");if(e.message===void 0)throw Error("Cannot answer an input request before the session starts.");let n=await b(this,Go).sessions.create({...e,message:e.message});return e.signal?.throwIfAborted(),F(this,bt,n.session),b(this,pa).onSessionChange?.(n.session.state),Y(this,se,La).call(this),{response:n.response,reader:Y(this,se,Rl).call(this,t).subscribe(e.signal)}}let a=Y(this,se,Rl).call(this,t).subscribe(e.signal);try{if(e.inputResponses===void 0){let{message:o,...i}=e;return{response:await b(this,bt).send(o,i),reader:a}}let{inputResponses:n,...r}=e;return{response:await b(this,bt).respond(n,r),reader:a}}catch(n){throw a[Symbol.dispose](),n}},Rl=function(e={}){if(b(this,en)!==void 0&&!b(this,en).ended)return b(this,en).setOptions(e),b(this,en);if(b(this,bt)===void 0)throw Error("A session is required before opening its stream.");let t=b(this,bt),a=b(this,Bn);return F(this,en,new OA(t,{...e,onEvent:n=>{a===b(this,Bn)&&Y(this,se,YA).call(this,n)},onError:n=>{a===b(this,Bn)&&(F(this,en,void 0),b(this,Pt)===void 0&&(F(this,Ct,Ui(n)),F(this,mt,"error"),b(this,pa).onError?.(b(this,Ct)),Y(this,se,La).call(this)))}})),b(this,en)},tx=function(){F(this,Bn,b(this,Bn)+1),b(this,Qi)?.abort(),F(this,Qi,void 0),F(this,tr,void 0)},ax=function(e){if(Y(this,se,Sa).call(this,e)){e.resolveResponse(void 0),F(this,Pt,void 0);try{b(this,pa).onSessionChange?.(b(this,bt)?.state),Y(this,se,La).call(this),b(this,pa).onFinish?.(b(this,Yo))}finally{e.resolveCompletion()}}},Sa=function(e){return b(this,Pt)===e},KA=function(e){e.inputResponses!==void 0&&e.inputResponses.length!==0&&b(this,Ko).append({data:{createdAt:Date.now(),responses:e.inputResponses},type:"client.input.responded"})},YA=function(e){if(!b(this,Ol).admit(e))return;let t=b(this,mt)==="streaming";Bi(b(this,Xo),e),F(this,Ea,[...b(this,Ea),e]),Y(this,se,pm).call(this,b(this,tn).apply(e)),b(this,pa).onEvent?.(e),Y(this,se,nx).call(this,e);let a=xn(e)&&b(this,Xo).size===0;b(this,mt)!=="resuming"&&b(this,Ct)===void 0&&("data"in e&&"turnId"in e.data&&F(this,mt,"streaming"),b(this,Pt)===void 0&&a&&F(this,mt,"ready")),b(this,pa).onSessionChange?.(b(this,bt)?.state),b(this,mt)!=="resuming"&&Y(this,se,La).call(this),b(this,Pt)===void 0&&t&&a&&b(this,pa).onFinish?.(b(this,Yo))},pm=function(e){if(e===void 0)return!1;let t=0;for(let a of e.ids)b(this,Pt)?.followUpSubmissionIds.delete(a)&&(t+=1);if(t>0&&b(this,Pt)!==void 0)if(e.alreadyProjected)b(this,Pt).receivedFollowUps+=t;else{let a=b(this,Pt).receivedFollowUpEvents.get(e.event)??0;b(this,Pt).receivedFollowUpEvents.set(e.event,a+t)}return!0},nx=function(e){let t=HA(e);t!==void 0&&(F(this,mt,"error"),b(this,tn).failAll(t),b(this,Ct)===void 0&&(F(this,Ct,t),b(this,pa).onError?.(t)))},rx=function(){return{data:b(this,Ko).data,error:b(this,Ct),events:b(this,Ea),session:b(this,bt)?.state,status:b(this,mt)}},La=function(){F(this,Yo,Y(this,se,rx).call(this));for(let e of b(this,Pl))e()},$A);function qj(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Hj(e){let t=new AbortController;for(let a of e){if(a.aborted)return t.abort(a.reason),t.signal;a.addEventListener("abort",()=>t.abort(a.reason),{once:!0,signal:t.signal})}return t.signal}function ZA(){"withResolvers"in Promise||Object.defineProperty(Promise,"withResolvers",{value:qj,configurable:!0,writable:!0}),"any"in AbortSignal||Object.defineProperty(AbortSignal,"any",{value:Hj,configurable:!0,writable:!0})}var jj=3e4;function Vj(){let e=crypto.getRandomValues(new Uint8Array(32));return btoa(String.fromCharCode(...e)).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function sx(e){let t=e.channelId??"";return e.threadId===void 0?t:`${t}:${e.threadId}`}function ix(e){return`waniwani:eve-conversation:${e}`}function lx(e){try{let t=JSON.parse(localStorage.getItem(ix(e))??"null");return typeof t=="object"&&t!==null&&"conversationId"in t&&typeof t.conversationId=="string"&&"ownerSecret"in t&&typeof t.ownerSecret=="string"?{conversationId:t.conversationId,ownerSecret:t.ownerSecret}:null}catch{return null}}function Ul(e,t){try{t?localStorage.setItem(ix(e),JSON.stringify(t)):localStorage.removeItem(ix(e))}catch{}}function JA(e){return JSON.stringify(e).replace(/[\u007f-\uffff]/g,t=>`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`)}function $j(e){return{...e.documents?.length?{"x-waniwani-documents":JA(e.documents)}:{},...e.extra&&Object.keys(e.extra).length>0?{"x-waniwani-extra":JA(e.extra)}:{}}}var Wj={initial:()=>{},reduce:()=>{}},Nl=class e{constructor(t,a,n){this.open=t;this.secret=a;K(this,"grant");K(this,"refreshing",null);K(this,"store");K(this,"forward");K(this,"caughtUp");K(this,"used",!1);this.grant=n,ZA(),this.store=new ox({host:n.eveHost,auth:{bearer:()=>this.bearer()},initialSession:{sessionId:n.sessionId,streamIndex:0},optimistic:!1,reducer:Wj}),this.store.setCallbacks({onEvent:r=>this.forward?.(r)}),this.caughtUp=this.store.resume().catch(()=>{})}static async create(t){let a=Vj(),n=await t.open({operation:"create",requestId:crypto.randomUUID(),ownerSecret:a,channelId:t.channelId,visitorId:t.visitorId});return n?await new e(t.open,a,n).reachable():null}static async resume(t){let a=await t.open({operation:"resume",...t.saved});return a?await new e(t.open,t.saved.ownerSecret,a).reachable():null}async reachable(){return await this.caughtUp,this.store.snapshot.error===void 0?this:(this.close(),null)}get sessionId(){return this.grant.sessionId}get saved(){return{conversationId:this.grant.conversationId,ownerSecret:this.secret}}get followups(){return this.grant.followups}async history(){await this.caughtUp;let{events:t}=this.store.snapshot;return this.used||(this.used=t.some(a=>a.type==="message.received")),t}async bearer(){return this.grant.expiresAt-jj>Date.now()?this.grant.accessToken:(this.refreshing??(this.refreshing=this.open({operation:"refresh",conversationId:this.grant.conversationId,ownerSecret:this.secret}).then(t=>{if(!t)throw new Error("The conversation left the direct runtime");return this.grant=t,t.accessToken}).finally(()=>{this.refreshing=null})),await this.refreshing)}turn(t,a,n){this.used=!0;let r=()=>{this.store.cancel()};return n?.addEventListener("abort",r,{once:!0}),new ReadableStream({start:async i=>{let s=!1;this.forward=u=>{s||(s=u.type==="turn.failed"||u.type==="session.failed"),i.enqueue(u)},await this.caughtUp;let l=await this.store.send({message:t,signal:n,headers:$j(a)}).then(()=>this.store.snapshot.error,u=>u instanceof Error?u:new Error(String(u)));this.forward=void 0,n?.removeEventListener("abort",r),l&&!s&&!n?.aborted&&i.enqueue({type:"session.failed",data:{code:"transport_failed",message:l.message,sessionId:this.sessionId}}),i.close()}}).pipeThrough(nm())}close(){this.forward=void 0,this.store.reset()}};function Bl(e,t){let a=e[t];return typeof a=="string"&&a?a:void 0}function Gj(e){let t=e.visitor;return typeof t=="object"&&t!==null&&"id"in t&&typeof t.id=="string"?t.id:void 0}function Xj(e){return e.filter(t=>t.role==="user").map(t=>t.parts.flatMap(a=>a.type==="text"?[a.text]:[]).join(`
|
|
142
|
-
`))}function QA(e){return fetch(new URL(e.path,new URL(e.sessionApi,location.href)),{method:"POST",headers:{...e.headers(),"content-type":"application/json"},body:JSON.stringify(e.body),cache:"no-store",signal:e.signal})}function Kj(e){return async t=>{let a=await QA({...e,path:"followups",body:t,signal:AbortSignal.timeout(8e3)}),n=a.ok?await a.json():null,r=typeof n=="object"&&n!==null&&"data"in n?n.data:null,o=typeof r=="object"&&r!==null&&"suggestions"in r?r.suggestions:null;return Array.isArray(o)?o.filter(i=>typeof i=="string"):[]}}function Yj(e){let t="",a=!1,n=new Set;return new TransformStream({async transform(r,o){if(r.type==="text-delta"&&(t+=r.delta),r.type==="tool-input-available"&&n.add(r.toolName),r.type==="error"&&(a=!0),r.type==="finish"&&!a&&!e.signal?.aborted&&t.trim()){let i=await e.suggest(t,[...n]).catch(()=>[]);i.length>0&&o.enqueue({type:"data-suggestions",data:{suggestions:i}})}o.enqueue(r)}})}function Zj(e){return async t=>{let a=await QA({...e,path:e.sessionApi,body:t});if(!a.ok)throw new Error(`Opening the chat failed (${a.status})`);let n=await a.json(),r=typeof n=="object"&&n!==null&&"data"in n?n.data:null;if(typeof r!="object"||r===null||!("transport"in r))throw new Error("The session route answered no transport");if(r.transport!=="eve-native")return null;let o={...r},i=o.session,s=typeof i=="object"&&i!==null&&"sessionId"in i?i.sessionId:void 0,l=Bl(o,"conversationId"),u=Bl(o,"eveHost"),c=Bl(o,"accessToken"),d=Date.parse(Bl(o,"expiresAt")??"");if(!l||!u||!c||typeof s!="string"||Number.isNaN(d))throw new Error("The session route answered an incomplete session");return{conversationId:l,eveHost:u,sessionId:s,accessToken:c,expiresAt:d,followups:o.followups===!0}}}function Jj(e){let t=e.extra;return typeof t=="object"&&t!==null&&!Array.isArray(t)?Object.fromEntries(Object.entries(t)):void 0}var ux=class{constructor(t){this.options=t;K(this,"pending");K(this,"threadOnFallback",!1);K(this,"generation",0)}get channelId(){return Bl(this.options.body(),"channelId")}key(){return sx({channelId:this.channelId,threadId:this.options.threadId()})}keepsSession(){return this.options.open!==void 0}prepare(){this.open(this.options.hasMessages())}open(t){this.options.open&&(this.pending??(this.pending=this.start(this.options.open,t)))}async restore(){let{open:t}=this.options;if(!t||this.options.threadHistory())return[];let a=this.key(),n=lx(a);if(!n)return[];let r=this.generation,o=Nl.resume({open:t,saved:n}).catch(()=>null).then(s=>this.kept(s,r));this.pending=o;let i=await o;return i?await IE(await i.history()):(Ul(a,null),this.pending===o&&(this.pending=void 0),[])}reset(){Ul(this.key(),null),this.dispose()}forget(t){Ul(sx({channelId:this.channelId,threadId:t}),null)}dispose(){this.generation+=1,this.threadOnFallback=!1,this.pending?.then(t=>t?.close()).catch(()=>{}),this.pending=void 0}async start(t,a){let n=this.generation,r=this.key(),o=lx(r);if(o){let u=await Nl.resume({open:t,saved:o}).catch(()=>null);return!u&&n===this.generation&&Ul(r,null),this.kept(u,n)}if(a)return null;let i=this.options.body(),s=await Nl.create({open:t,channelId:Bl(i,"channelId"),visitorId:Gj(i)}),l=this.kept(s,n);return n===this.generation&&Ul(r,l?.saved??null),l}kept(t,a){return t&&a!==this.generation?(t.close(),null):t}async sendMessages(t){let a=t.messages.filter(m=>m.role==="user").length<=1;a&&(this.threadOnFallback=!1);let r=[...t.messages].reverse().find(m=>m.role==="user")?.parts.some(m=>m.type==="file")??!1;if(this.threadOnFallback||r||!this.options.open)return this.threadOnFallback=!0,await this.options.fallback.sendMessages(t);this.open(!a);let o=await this.pending?.catch(()=>null);if(o?.used&&a&&(this.reset(),this.open(!1),o=await this.pending?.catch(()=>null)),!o)return this.threadOnFallback=!0,await this.options.fallback.sendMessages(t);this.options.onSession(o.sessionId);let{documents:i}=this.options.takeTurnInput(),s=Xj(t.messages),l=s.at(-1)??"",u=l.trim()?l:i?.map(m=>m.filename).join(", ")??l,c=o.turn(u,{documents:i,extra:Jj(this.options.body())},t.abortSignal),{suggest:d}=this.options;if(!o.followups||!d)return c;let{saved:p}=o;return c.pipeThrough(Yj({suggest:(m,h)=>d({...p,answerText:m.slice(-8e3),recentUserMessages:s.slice(-3).map(v=>v.slice(-2e3)),toolNames:h.slice(0,20)}),signal:t.abortSignal}))}async reconnectToStream(t){return await this.pending?.catch(()=>null)?null:await this.options.fallback.reconnectToStream(t)}};function eM(e){let t=typeof e=="string"?()=>e:e;return a=>{let n=r=>{let o=t();return o?r(o):void 0};return new ux({...a,get open(){return n(r=>Zj({sessionApi:r,headers:a.headers}))},get suggest(){return n(r=>Kj({sessionApi:r,headers:a.headers}))}})}}function zl(e){let t=(0,mm.useRef)(e);t.current=e;let[a]=(0,mm.useState)(()=>eM(()=>t.current));return a}var tM=j(Ee(),1),aM="(max-width: 639px)";function Qj(e){let t=window.matchMedia(aM);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function eV(){return window.matchMedia(aM).matches}function tV(){return!1}function nM(){return(0,tM.useSyncExternalStore)(Qj,eV,tV)}var hm=j(Ee(),1);function cx(e,t){return e.find(a=>a.text===t)?.id??null}async function rM(e){let{api:t,token:a,name:n,source:r,sessionId:o,properties:i}=e;if(typeof window>"u"||!t||!a)return;let s=Ic(t);if(s)try{let l=new Date().toISOString(),u=JSON.stringify({sentAt:l,source:{sdk:"@waniwani/sdk",version:"0.1.0"},events:[{id:crypto.randomUUID(),type:"mcp.event",name:n,source:r,timestamp:l,correlation:{visitorId:fa(),sessionId:o},properties:{...i,url:window.location.href},metadata:{}}]});await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:u,keepalive:!0})}catch{}}async function oM(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,promptId:s,origin:l,text:u,index:c}=e;await rM({api:t,token:a,name:"suggestion.clicked",source:o,sessionId:i,properties:{promptId:s,origin:l,text:u,index:c,channelId:n,mode:r}})}function iM(e,t){return t.map(a=>({id:cx(e,a),text:a}))}async function sM(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,prompts:s,origin:l}=e;s.length!==0&&await rM({api:t,token:a,name:"suggestion.shown",source:o,sessionId:i,properties:{prompts:s,count:s.length,origin:l,channelId:n,mode:r}})}function Fl(e){let{widgetEvents:t,api:a,token:n,channelId:r,source:o,mode:i,pagePrompts:s}=e,l=(0,hm.useRef)(e.getSessionId);l.current=e.getSessionId,(0,hm.useEffect)(()=>{if(!(!a||!n))return t.subscribe(u=>{if(u.name==="suggestion.clicked"){let{text:c,origin:d,index:p}=u.properties;oM({api:a,token:n,channelId:r,mode:i,source:o,sessionId:l.current(),promptId:cx(s??[],c),origin:d,text:c,index:p});return}if(u.name==="suggestions.shown"){let{texts:c,origin:d}=u.properties;sM({api:a,token:n,channelId:r,mode:i,source:o,sessionId:l.current(),prompts:iM(s??[],c),origin:d})}})},[t,a,n,r,o,i,s])}var ql=j(Ee(),1),aV=80,nV=50,rV=15e3,lM=500;function Hl(e,t=!0){let[a,n]=(0,ql.useState)(""),r=(0,ql.useRef)(void 0);return(0,ql.useEffect)(()=>{if(!t){n("");return}let o=0,i=!1,s=!1,l=()=>{s||(i?(o--,n(e.slice(0,o)),o<=0?(i=!1,r.current=setTimeout(l,lM)):r.current=setTimeout(l,nV)):(o++,n(e.slice(0,o)),o>=e.length?(i=!0,r.current=setTimeout(l,rV)):r.current=setTimeout(l,aV)))};return r.current=setTimeout(l,lM),()=>{s=!0,clearTimeout(r.current)}},[e,t]),a}var ar=j(Ee(),1);var uM=["en","fr","es"];function jl(e){return uM.includes(e)}function dx(e){if(e&&jl(e))return e;if(e){let a=e.split("-")[0]?.toLowerCase();if(a&&jl(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(jl(n))return n;let r=n.split("-")[0];if(r&&jl(r))return r}return"en"}var gm={promptInput:{placeholder:"What would you like to know?",uploadFiles:"Upload files",uploadFilesUpTo:"Upload a document, up to {limit}",uploadFilesUpToWithPages:"Upload a document, up to {limit} and {pages} pages",stop:"Stop",submit:"Submit",removeAttachments:"Remove all attachments",removeAttachment:"Remove attachment",uploading:"Uploading\u2026",retry:"Retry",retryUpload:"Retry the upload",uploadFailed:"The upload did not finish.",dropToAttach:"Drop to attach",errorAccept:"{name} is not a file type this chat accepts.",errorTooLarge:"{name} is larger than {limit}.",errorTooMany:"You can attach up to {limit} files."},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",kindPdf:"PDF",kindImage:"Image",kindFile:"File",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 cM={promptInput:{placeholder:"\xBFQu\xE9 te gustar\xEDa saber?",uploadFiles:"Subir archivos",uploadFilesUpTo:"Subir un documento, hasta {limit}",uploadFilesUpToWithPages:"Subir un documento, hasta {limit} y {pages} p\xE1ginas",stop:"Detener",submit:"Enviar",removeAttachments:"Eliminar todos los archivos adjuntos",removeAttachment:"Quitar archivo",uploading:"Subiendo\u2026",retry:"Reintentar",retryUpload:"Reintentar la subida",uploadFailed:"La subida no se complet\xF3.",dropToAttach:"Suelta para adjuntar",errorAccept:"{name} no es un tipo de archivo que acepte este chat.",errorTooLarge:"{name} supera {limit}.",errorTooMany:"Puedes adjuntar hasta {limit} archivos."},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",kindPdf:"PDF",kindImage:"Imagen",kindFile:"Archivo",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 dM={promptInput:{placeholder:"Que souhaitez-vous savoir ?",uploadFiles:"Importer des fichiers",uploadFilesUpTo:"Joindre un document, jusqu'\xE0 {limit}",uploadFilesUpToWithPages:"Envoyer un document, jusqu'\xE0 {limit} et {pages} pages",stop:"Arr\xEAter",submit:"Envoyer",removeAttachments:"Supprimer toutes les pi\xE8ces jointes",removeAttachment:"Retirer la pi\xE8ce jointe",uploading:"Envoi en cours\u2026",retry:"R\xE9essayer",retryUpload:"R\xE9essayer l'envoi",uploadFailed:"L'envoi ne s'est pas termin\xE9.",dropToAttach:"D\xE9posez pour joindre",errorAccept:"{name} n'est pas un type de fichier accept\xE9 par ce chat.",errorTooLarge:"{name} d\xE9passe {limit}.",errorTooMany:"Vous pouvez joindre jusqu'\xE0 {limit} fichiers."},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",kindPdf:"PDF",kindImage:"Image",kindFile:"Fichier",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 fx={en:gm,fr:dM,es:cM};var pM=j(he(),1),fM=(0,ar.createContext)(null);function oV(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 es({children:e,locale:t,messages:a}){let n=!!(t&&iV(t)),r=n?t:"en",[o,i]=(0,ar.useState)(r),[s,l]=(0,ar.useState)(n);(0,ar.useEffect)(()=>{i(dx(t)),l(!0)},[t]);let u=(0,ar.useMemo)(()=>{let c=fx[o]??fx["en"];return{locale:o,t:oV(c,a),ready:s}},[o,a,s]);return(0,pM.jsx)(fM.Provider,{value:u,children:e})}function iV(e){return e==="en"||e==="fr"||e==="es"}function Ue(){let e=(0,ar.useContext)(fM);return e||{locale:"en",t:gm,ready:!0}}function px(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 Qe=j(Ee(),1);var ld=(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 Be=j(Ee(),1);var ts=new Map;function mM(e,t){if(ts.has(e)){URL.revokeObjectURL(t);return}for(ts.set(e,t);ts.size>20;){let a=ts.keys().next();if(a.done)return;let n=ts.get(a.value);ts.delete(a.value),n&&URL.revokeObjectURL(n)}}function hM(e){return ts.get(e)}var gM=j(he(),1),Ir=({className:e,variant:t="default",size:a="default",type:n="button",...r})=>(0,gM.jsx)("button",{type:n,className:V("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 yM=j(Ee(),1);var zt=j(he(),1),wM=({files:e,className:t,...a})=>e.length===0?null:(0,zt.jsx)("div",{className:V("ww:flex ww:flex-wrap ww:gap-1.5",t),...a,children:e.map((n,r)=>(0,zt.jsx)(sV,{file:n},r))});function sV({file:e}){let{t}=Ue();return e.mediaType?.startsWith("image/")&&e.url?(0,zt.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,zt.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,zt.jsx)(vl,{className:"ww:size-3 ww:shrink-0"}),(0,zt.jsx)("span",{className:"ww:max-w-24 ww:truncate",children:e.filename??t.attachments.fileFallback})]})}function vM(e,t){return e.startsWith("image/")?t.attachments.kindImage:e==="application/pdf"?t.attachments.kindPdf:t.attachments.kindFile}function lV({mediaType:e}){return e.startsWith("image/")?(0,zt.jsx)(Rc,{className:"ww:size-5 ww:text-muted-foreground"}):e==="application/pdf"?(0,zt.jsx)(Ac,{className:"ww:size-5 ww:text-muted-foreground"}):(0,zt.jsx)(vl,{className:"ww:size-5 ww:text-muted-foreground"})}function mx({filename:e,mediaType:t,previewUrl:a,subtitle:n,tone:r="default",children:o,className:i}){let{t:s}=Ue(),l=vM(t,s);return(0,zt.jsxs)("li",{"aria-label":`${e}, ${l}`,className:V("ww:relative ww:flex ww:w-60 ww:max-w-full ww:cursor-default ww:items-center ww:gap-2.5 ww:overflow-hidden ww:rounded-xl ww:border ww:bg-background ww:p-2.5",r==="error"?"ww:border-destructive/50":"ww:border-border",i),children:[(0,zt.jsx)("span",{className:"ww:flex ww:size-10 ww:shrink-0 ww:items-center ww:justify-center ww:overflow-hidden ww:rounded-xl ww:bg-muted",children:a?(0,zt.jsx)("img",{alt:"",className:"ww:size-full ww:object-cover ww:object-center",src:a}):(0,zt.jsx)(lV,{mediaType:t})}),(0,zt.jsxs)("span",{className:"ww:flex ww:min-w-0 ww:flex-col",children:[(0,zt.jsx)("span",{className:"ww:truncate ww:font-medium ww:text-sm",title:e,children:e}),(0,zt.jsx)("span",{className:V("ww:truncate ww:text-xs",r==="error"?"ww:text-destructive":"ww:text-muted-foreground"),children:n??l})]}),o]})}function xM(e){if(typeof e!="object"||e===null)return[];let t=e.documents;return Array.isArray(t)?t.filter(a=>typeof a=="object"&&a!==null&&typeof a.documentId=="string"&&typeof a.filename=="string"&&typeof a.mediaType=="string"):[]}var bM=({documents:e,className:t,...a})=>e.length===0?null:(0,zt.jsx)("ul",{className:V("ww:flex ww:list-none ww:flex-wrap ww:items-end ww:justify-end ww:gap-2 ww:p-0",t),...a,children:e.map((n,r)=>(0,zt.jsx)(uV,{document:n},`${n.documentId}-${r}`))});function uV({document:e}){let{t}=Ue(),[a,n]=(0,yM.useState)(!1),r=e.mediaType.startsWith("image/")?hM(e.documentId):void 0;return r&&!a?(0,zt.jsx)("li",{children:(0,zt.jsx)("img",{alt:`${e.filename}, ${vM(e.mediaType,t)}`,className:"ww:max-h-80 ww:max-w-72 ww:rounded-xl ww:border ww:border-border ww:object-contain",onError:()=>n(!0),src:r,title:e.filename})}):(0,zt.jsx)(mx,{filename:e.filename,mediaType:e.mediaType})}var At=j(he(),1),cV=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}},dV=(e,t)=>{if(!t)return!0;let a=t.split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(a.length===0)return!0;let n=e.type.toLowerCase(),r=e.name.toLowerCase();return a.some(o=>o.startsWith(".")?r.endsWith(o):o.endsWith("/*")?n.startsWith(o.slice(0,-1)):n===o)},IM=(0,Be.createContext)(null),ym=()=>{let e=(0,Be.useContext)(IM);if(!e)throw new Error("usePromptInputAttachments must be used within a PromptInput");return e},CM=({className:e,accept:t,multiple:a,globalDrop:n,maxFiles:r,maxFileSize:o,maxPdfPages:i,attachmentsEnabled:s=!0,upload:l,onDiscard:u,onError:c,onSubmit:d,children:p,...m})=>{let{t:h,locale:v}=Ue(),I=(0,Be.useRef)(null),y=(0,Be.useRef)(null),[w,g]=(0,Be.useState)([]),S=(0,Be.useRef)(w),E=(0,Be.useRef)(new Map),T=(0,Be.useRef)(l),R=(0,Be.useRef)(c),O=(0,Be.useRef)(u);(0,Be.useEffect)(()=>{T.current=l,R.current=c,O.current=u},[l,c,u]);let U=(0,Be.useCallback)(x=>{S.current=x,g(x)},[]),A=(0,Be.useCallback)(()=>{I.current?.click()},[]),Q=(0,Be.useCallback)((x,ae)=>{U(S.current.map(re=>re.id===x?{...re,...ae}:re))},[U]),$=(0,Be.useCallback)((x,ae)=>{let re=T.current;if(!re)return;let Ce=new AbortController,We=re(ae,Ce.signal,be=>{Q(x,{progress:be})}).then(be=>(Q(x,{status:"ready",progress:1,documentId:be.documentId,error:void 0}),be)).catch(be=>{if(Ce.signal.aborted)return null;let Oe=be instanceof Error?be.message:h.promptInput.uploadFailed;return Q(x,{status:"failed",error:Oe}),R.current?.({code:"upload_failed",message:Oe}),null});E.current.set(x,{file:ae,controller:Ce,done:We})},[Q,h]),q=(0,Be.useCallback)(x=>{let ae=[...x];if(!s||ae.length===0)return;let re=(ce,Le)=>R.current?.({code:ce,message:Le}),Ce=[];for(let ce of ae){if(!dV(ce,t)){re("accept",h.promptInput.errorAccept.replace("{name}",ce.name));continue}if(o&&ce.size>o){re("max_file_size",h.promptInput.errorTooLarge.replace("{name}",ce.name).replace("{limit}",kM(o,v)));continue}Ce.push(ce)}if(Ce.length===0)return;let We=typeof r=="number"?Math.max(0,r-S.current.length):void 0,be=typeof We=="number"?Ce.slice(0,We):Ce;if(be.length<Ce.length&&re("max_files",h.promptInput.errorTooMany.replace("{limit}",String(r))),be.length===0)return;let Oe=!!T.current,we=be.map(ce=>({file:ce,item:{filename:ce.name,id:ld(),mediaType:ce.type,type:"file",url:URL.createObjectURL(ce),status:Oe?"uploading":"ready",progress:0}}));U([...S.current,...we.map(ce=>ce.item)]);for(let ce of we)$(ce.item.id,ce.file)},[r,o,t,s,$,U,h,v]),Z=(0,Be.useCallback)(x=>{let ae=E.current.get(x);ae&&(Q(x,{status:"uploading",progress:0,error:void 0}),$(x,ae.file))},[Q,$]),X=(0,Be.useCallback)((x,ae)=>{E.current.get(x.id)?.controller.abort(),E.current.delete(x.id),x.url&&(!ae&&!!x.documentId&&!!x.mediaType?.startsWith("image/")&&x.documentId?mM(x.documentId,x.url):URL.revokeObjectURL(x.url)),ae&&x.documentId&&O.current?.({documentId:x.documentId,filename:x.filename??"",mediaType:x.mediaType??""})},[]),B=(0,Be.useCallback)(x=>{let ae=S.current.find(re=>re.id===x);ae&&X(ae,!0),U(S.current.filter(re=>re.id!==x))},[X,U]),P=(0,Be.useCallback)(()=>{for(let x of S.current)X(x,!0);U([])},[X,U]),J=(0,Be.useRef)(s);(0,Be.useEffect)(()=>{let x=J.current;J.current=s,x&&!s&&P()},[s,P]);let ge=(0,Be.useCallback)(()=>{for(let x of S.current)X(x,!1);U([])},[X,U]);(0,Be.useEffect)(()=>()=>{for(let x of S.current)E.current.get(x.id)?.controller.abort(),x.url&&URL.revokeObjectURL(x.url)},[]);let C=(0,Be.useCallback)(x=>{x.currentTarget.files&&q(x.currentTarget.files),x.currentTarget.value=""},[q]);(0,Be.useEffect)(()=>{if(!n)return;let x=re=>{re.dataTransfer?.types?.includes("Files")&&re.preventDefault()},ae=re=>{re.dataTransfer?.types?.includes("Files")&&re.preventDefault(),re.dataTransfer?.files&&re.dataTransfer.files.length>0&&q(re.dataTransfer.files)};return document.addEventListener("dragover",x),document.addEventListener("drop",ae),()=>{document.removeEventListener("dragover",x),document.removeEventListener("drop",ae)}},[q,n]);let ze=(0,Be.useCallback)(async x=>{x.preventDefault();let ae=x.currentTarget,re=new FormData(ae).get("message")||"",Ce=new Map;for(;Ce.size<E.current.size;)await Promise.all([...E.current.entries()].filter(([we])=>!Ce.has(we)).map(async([we,ce])=>{Ce.set(we,await ce.done)}));for(let we of Ce.keys())E.current.has(we)||Ce.delete(we);if([...Ce.values()].some(we=>we===null)){R.current?.({code:"upload_failed",message:h.promptInput.uploadFailed});return}let We=[...Ce.values()].filter(we=>we!==null),be=T.current?[]:S.current,Oe=await Promise.all(be.map(async({id:we,status:ce,progress:Le,error:ie,...xe})=>{if(xe.url?.startsWith("blob:")){let Ne=await cV(xe.url);return{...xe,url:Ne??xe.url}}return xe}));try{let we=d({documents:We,files:Oe,text:re},x);we instanceof Promise&&await we,ae.reset(),ge()}catch{}},[d,ge,h]),ot=(0,Be.useMemo)(()=>({add:q,clear:P,files:w,openFileDialog:A,remove:B,retry:Z,maxFileSize:o,maxPdfPages:i}),[w,q,B,Z,P,A,o,i]);return(0,At.jsxs)(IM.Provider,{value:ot,children:[(0,At.jsx)("input",{accept:t,"aria-label":h.promptInput.uploadFiles,className:"ww:hidden",multiple:a,onChange:C,ref:I,title:h.promptInput.uploadFiles,type:"file"}),(0,At.jsx)("form",{className:V("ww:relative ww:flex ww:w-full ww:flex-col ww:rounded-lg ww:border ww:border-border ww:bg-background",e),onSubmit:ze,ref:y,...m,children:p})]})},SM=1024*1024;function kM(e,t){let a=e>=SM;return new Intl.NumberFormat(t,{style:"unit",unit:a?"megabyte":"kilobyte",maximumFractionDigits:0}).format(a?e/SM:Math.max(1,e/1024))}var TM=({onChange:e,onKeyDown:t,className:a,placeholder:n,...r})=>{let{t:o}=Ue(),i=ym(),[s,l]=(0,Be.useState)(!1),u=n??o.promptInput.placeholder,c=(0,Be.useCallback)(p=>{if(t?.(p),!p.defaultPrevented){if(p.key==="Enter"){if(s||p.nativeEvent.isComposing||p.shiftKey)return;p.preventDefault();let{form:m}=p.currentTarget;if(m?.querySelector('[data-submit-blocked="true"]')||m?.querySelector('button[type="submit"]')?.disabled)return;m?.requestSubmit()}if(p.key==="Backspace"&&p.currentTarget.value===""&&i.files.length>0){p.preventDefault();let m=i.files.at(-1);m&&i.remove(m.id)}}},[t,s,i]),d=(0,Be.useCallback)(p=>{let m=p.clipboardData?.items;if(!m)return;let h=[];for(let v of m)if(v.kind==="file"){let I=v.getAsFile();I&&h.push(I)}h.length>0&&(p.preventDefault(),i.add(h))},[i]);return(0,At.jsx)("textarea",{className:V("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:()=>l(!1),onCompositionStart:()=>l(!0),onKeyDown:c,onPaste:d,placeholder:u,onChange:e,...r})},LM=({className:e,status:t,onStop:a,onClick:n,children:r,disabled:o,...i})=>{let{t:s}=Ue(),l=t==="submitted"||t==="streaming",u=l&&a!==void 0,c=(0,At.jsx)(hr,{className:"ww:size-4"});t==="submitted"?c=(0,At.jsx)(Dc,{className:"ww:size-4 ww:animate-spin"}):t==="streaming"&&(c=(0,At.jsx)(_c,{className:"ww:size-4"}));let d=(0,Be.useCallback)(p=>{if(l&&a){p.preventDefault(),a();return}n?.(p)},[l,a,n]);return(0,At.jsx)(Ir,{"aria-label":l?s.promptInput.stop:s.promptInput.submit,className:V("ww:bg-foreground ww:text-background ww:hover:bg-foreground ww:rounded-full",e),"data-submit-blocked":o?"true":void 0,disabled:u?!1:o,onClick:d,size:"icon-sm",type:u?"button":"submit",variant:"ghost",...i,children:r??c})},EM=({className:e,children:t,...a})=>{let{t:n,locale:r}=Ue(),o=ym();if(o.files.length>0)return(0,At.jsxs)(Ir,{className:V("ww:group ww:relative",e),onClick:()=>o.clear(),size:"icon-sm",type:"button",variant:"ghost","aria-label":n.promptInput.removeAttachments,...a,children:[(0,At.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:o.files.length}),(0,At.jsx)(wn,{className:"ww:absolute ww:size-4 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100"})]});let s=o.maxFileSize?(o.maxPdfPages?n.promptInput.uploadFilesUpToWithPages.replace("{pages}",String(o.maxPdfPages)):n.promptInput.uploadFilesUpTo).replace("{limit}",kM(o.maxFileSize,r)):n.promptInput.uploadFiles;return(0,At.jsx)(Ir,{"aria-label":s,className:V(e),title:s,onClick:()=>o.openFileDialog(),size:"icon-sm",type:"button",variant:"ghost",...a,children:t??(0,At.jsx)(xl,{className:"ww:size-4"})})},AM=({className:e,...t})=>{let a=ym();return a.files.length===0?null:(0,At.jsx)("ul",{className:V("ww:flex ww:list-none ww:flex-wrap ww:gap-2 ww:p-0",e),...t,children:a.files.map(n=>(0,At.jsx)(fV,{file:n},n.id))})};function fV({file:e}){let{t}=Ue(),a=ym(),n=e.status==="failed",r=e.status==="uploading";return(0,At.jsxs)(mx,{filename:e.filename??t.attachments.fileFallback,mediaType:e.mediaType??"",previewUrl:e.mediaType?.startsWith("image/")?e.url:void 0,subtitle:n?e.error:r?t.promptInput.uploading:void 0,tone:n?"error":"default",children:[n?(0,At.jsx)("button",{"aria-label":t.promptInput.retryUpload,className:"ww:ml-auto ww:shrink-0 ww:text-destructive ww:text-xs ww:underline ww:underline-offset-2",onClick:()=>a.retry(e.id),type:"button",children:t.promptInput.retry}):null,(0,At.jsx)("button",{"aria-label":t.promptInput.removeAttachment,className:V("ww:shrink-0 ww:rounded-full ww:p-1 ww:opacity-60 ww:transition-opacity hover:ww:bg-muted hover:ww:opacity-100",n?null:"ww:ml-auto"),onClick:()=>a.remove(e.id),type:"button",children:(0,At.jsx)(wn,{className:"ww:size-3.5"})}),r?(0,At.jsx)("span",{"aria-hidden":!0,className:"ww:absolute ww:bottom-0 ww:left-0 ww:h-0.5 ww:bg-primary ww:transition-[width] ww:duration-200",style:{width:`${Math.round(e.progress*100)}%`}}):null]})}var MM=({enabled:e=!0})=>{let{t}=Ue(),[a,n]=(0,Be.useState)(!1);return(0,Be.useEffect)(()=>{if(!e)return;let r=0,o=u=>!!u.dataTransfer?.types?.includes("Files"),i=u=>{o(u)&&(r+=1,n(!0))},s=u=>{o(u)&&(r=Math.max(0,r-1),r===0&&n(!1))},l=()=>{r=0,n(!1)};return document.addEventListener("dragenter",i),document.addEventListener("dragleave",s),document.addEventListener("drop",l),()=>{document.removeEventListener("dragenter",i),document.removeEventListener("dragleave",s),document.removeEventListener("drop",l)}},[e]),e&&a?(0,At.jsx)("div",{className:"ww:pointer-events-none ww:absolute ww:inset-0 ww:z-50 ww:flex ww:items-center ww:justify-center ww:rounded-2xl ww:border-2 ww:border-primary ww:border-dashed ww:bg-background/85",children:(0,At.jsxs)("span",{className:"ww:flex ww:items-center ww:gap-2 ww:text-sm ww:font-medium",children:[(0,At.jsx)(xl,{className:"ww:size-4"}),t.promptInput.dropToAttach]})}):null};var DM=j(he(),1);function RM({text:e}){let{t}=Ue();return e===!1?null:(0,DM.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 wm=j(Ee(),1);var as=j(he(),1),_M=({className:e,...t})=>(0,as.jsx)("div",{className:V("ww:flex ww:flex-col ww:gap-1 ww:px-3 ww:py-2",e),...t}),PM=({className:e,...t})=>(0,as.jsx)("li",{className:V("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}),OM=({className:e,...t})=>(0,as.jsx)("span",{className:V("ww:inline-block ww:size-2 ww:shrink-0 ww:rounded-full ww:border ww:border-muted-foreground/50",e),...t}),NM=({className:e,...t})=>(0,as.jsx)("span",{className:V("ww:line-clamp-1 ww:grow ww:break-words ww:text-muted-foreground",e),...t}),UM=({className:e,...t})=>(0,as.jsx)("div",{className:V("ww:flex ww:shrink-0 ww:gap-1 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100",e),...t}),BM=({className:e,...t})=>(0,as.jsx)(Ir,{className:V("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 zn=j(he(),1),zM=(0,wm.memo)(({message:e,onRemove:t})=>{let{t:a}=Ue(),n=(0,wm.useCallback)(()=>t(e.id),[t,e.id]);return(0,zn.jsxs)(PM,{children:[(0,zn.jsx)(OM,{}),(0,zn.jsx)(NM,{children:e.text||a.chatQueue.attachmentFallback}),(0,zn.jsx)(UM,{children:(0,zn.jsx)(BM,{"aria-label":a.chatQueue.removeFromQueue,onClick:n,children:(0,zn.jsx)(wn,{className:"ww:size-3"})})})]})});zM.displayName="ChatQueueItem";function FM({queuedMessages:e,onRemove:t,className:a}){let{t:n}=Ue();return e.length===0?null:(0,zn.jsxs)(_M,{className:V("ww:border-t ww:border-border",a),children:[(0,zn.jsx)("div",{className:"ww:text-[11px] ww:font-medium ww:text-muted-foreground ww:px-2",children:n.chatQueue.queued(e.length)}),(0,zn.jsx)("ul",{children:e.map(r=>(0,zn.jsx)(zM,{message:r,onRemove:t},r.id))})]})}var rn=j(Ee(),1);var Ft=j(Ee(),1);Sh();var wU=j(Ee(),1);var vU=j(he(),1),DK=({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,vU.jsx)(e,{"data-waniwani-shimmer":"",className:V("ww:inline-block",t),style:i,...o,children:r})},ir=(0,wU.memo)(DK);ir.displayName="Shimmer";var Ra=j(he(),1),xU=(0,Ft.createContext)(null);function bU(){let e=(0,Ft.useContext)(xU);if(!e)throw new Error("Reasoning components must be used within <Reasoning>");return e}var _K=1e3,PK=1e3,Nd=(0,Ft.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:n,onOpenChange:r,duration:o,children:i,...s})=>{let l=n??t,u=n===!1,c=a!==void 0,[d,p]=(0,Ft.useState)(l),m=c?a:d,h=(0,Ft.useCallback)(R=>{c||p(R),r?.(R)},[c,r]),[v,I]=(0,Ft.useState)(void 0),y=o??v,w=(0,Ft.useRef)(t),[g,S]=(0,Ft.useState)(!1),E=(0,Ft.useRef)(null);(0,Ft.useEffect)(()=>{t?(w.current=!0,E.current===null&&(E.current=Date.now())):E.current!==null&&(I(Math.ceil((Date.now()-E.current)/PK)),E.current=null)},[t]),(0,Ft.useEffect)(()=>{t&&!m&&!u&&h(!0)},[t,m,u,h]),(0,Ft.useEffect)(()=>{if(w.current&&!t&&m&&!g){let R=setTimeout(()=>{h(!1),S(!0)},_K);return()=>clearTimeout(R)}},[t,m,g,h]);let T=(0,Ft.useMemo)(()=>({isStreaming:t,isOpen:m,setIsOpen:h,duration:y}),[t,m,h,y]);return(0,Ra.jsx)(xU.Provider,{value:T,children:(0,Ra.jsx)("div",{className:V("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":m?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...s,children:i})})});Nd.displayName="Reasoning";var Ud=(0,Ft.memo)(({className:e,children:t,getThinkingMessage:a,hideIcon:n=!1,onClick:r,...o})=>{let{t:i}=Ue(),{isStreaming:s,isOpen:l,duration:u,setIsOpen:c}=bU(),p=a??((m,h)=>m||h===0?(0,Ra.jsx)(ir,{duration:1.6,children:i.reasoning.thinking}):h===void 0?(0,Ra.jsx)("span",{children:i.reasoning.thoughtBrief}):(0,Ra.jsx)("span",{children:i.reasoning.thoughtForSeconds(h)}));return(0,Ra.jsx)("button",{type:"button","aria-expanded":l,onClick:m=>{c(!l),r?.(m)},className:V("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,Ra.jsxs)(Ra.Fragment,{children:[!n&&(0,Ra.jsx)(Kr,{className:"ww:size-4 ww:shrink-0"}),p(s,u)]})})});Ud.displayName="ReasoningTrigger";var Bd=(0,Ft.memo)(({className:e,children:t,...a})=>{let{isOpen:n}=bU();return(0,Ra.jsx)("div",{className:V("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,Ra.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ra.jsx)("div",{className:V("ww:text-sm ww:text-muted-foreground",e),...a,children:(0,Ra.jsx)(au,{children:t})})})})});Bd.displayName="ReasoningContent";var Ye=j(he(),1),OK=500,SU=(0,rn.createContext)(null);function IU(){let e=(0,rn.useContext)(SU);if(!e)throw new Error("ChainOfThought components must be used within <ChainOfThought>");return e}function CU({className:e,isWorking:t=!1,activeStep:a,open:n,defaultOpen:r=!1,onOpenChange:o,children:i,...s}){let l=n!==void 0,[u,c]=(0,rn.useState)(r),d=l?n:u,p=(0,rn.useCallback)(I=>{l||c(I),o?.(I)},[l,o]),[m,h]=(0,rn.useState)(!t);(0,rn.useEffect)(()=>{if(t){h(!1);return}let I=setTimeout(()=>h(!0),OK);return()=>clearTimeout(I)},[t]);let v=(0,rn.useMemo)(()=>({open:d,setOpen:p,isWorking:t,settled:m,activeStep:a}),[d,p,t,m,a]);return(0,Ye.jsx)(SU.Provider,{value:v,children:(0,Ye.jsx)("div",{className:V("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"},...s,children:i})})}function kU({className:e,label:t,workingLabel:a,children:n,...r}){let{open:o,setOpen:i,isWorking:s,settled:l,activeStep:u}=IU();if(!l){let c=u?.icon,d=u?.label??a??t??"";return(0,Ye.jsx)("div",{className:V("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,Ye.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,Ye.jsx)(c,{className:V("ww:size-4 ww:shrink-0",s&&"ww:animate-pulse")}),(0,Ye.jsx)("span",{className:"ww:truncate",children:s?(0,Ye.jsx)(ir,{duration:2.6,children:d}):d})]},d)})}return(0,Ye.jsxs)("button",{type:"button",onClick:()=>i(!o),"aria-expanded":o,className:V("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,Ye.jsx)("span",{className:"ww:truncate",children:n??t}),(0,Ye.jsx)(zo,{className:V("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",o&&"ww:rotate-180")})]})}function TU({className:e,children:t,...a}){let{open:n}=IU();return(0,Ye.jsx)("div",{className:V("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,Ye.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ye.jsx)("div",{className:V("ww:flex ww:flex-col",e),...a,children:t})})})}function LU({icon:e,isLast:t,running:a,error:n}){return(0,Ye.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:self-stretch",children:[(0,Ye.jsx)("span",{className:"ww:flex ww:h-5 ww:items-center",children:(0,Ye.jsx)(e,{className:V("ww:size-4 ww:shrink-0",n?"ww:text-destructive":a?"ww:animate-pulse ww:text-foreground":"ww:text-muted-foreground")})}),!t&&(0,Ye.jsx)("span",{className:"ww:w-px ww:flex-1 ww:bg-border"})]})}function HS({className:e,icon:t,title:a,state:n,isLast:r=!1,children:o,...i}){let s=n==="input-available"||n==="input-streaming",l=n==="output-error",u=o!=null,[c,d]=(0,rn.useState)(!1),p=a??"",m=s?(0,Ye.jsx)(ir,{duration:1.6,children:p}):(0,Ye.jsx)("span",{className:"ww:truncate",children:p});return(0,Ye.jsxs)("div",{className:V("ww:flex ww:gap-2",e),...i,children:[(0,Ye.jsx)(LU,{icon:t,isLast:r,running:s,error:l}),(0,Ye.jsxs)("div",{className:V("ww:min-w-0 ww:flex-1",!r&&"ww:pb-3"),children:[u?(0,Ye.jsxs)("button",{type:"button",onClick:()=>d(h=>!h),"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:[m,(0,Ye.jsx)(zo,{className:V("ww:size-3.5 ww:shrink-0 ww:transition-transform ww:duration-200",c&&"ww:rotate-180")})]}):(0,Ye.jsx)("div",{className:"ww:flex ww:items-center ww:text-sm ww:text-muted-foreground",children:m}),u&&(0,Ye.jsx)("div",{className:V("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,Ye.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ye.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 EU({isStreaming:e=!1,isLast:t=!1,children:a}){return(0,Ye.jsxs)("div",{className:"ww:flex ww:gap-2",children:[(0,Ye.jsx)(LU,{icon:Kr,isLast:t,running:e}),(0,Ye.jsx)("div",{className:V("ww:min-w-0 ww:flex-1",!t&&"ww:pb-3"),children:(0,Ye.jsxs)(Nd,{isStreaming:e,className:"ww:mb-0",children:[(0,Ye.jsx)(Ud,{hideIcon:!0}),(0,Ye.jsx)(Bd,{children:a})]})})]})}var jS={name:"cjk-noop",type:"cjk",remarkPluginsBefore:[],remarkPluginsAfter:[],remarkPlugins:[]};var AU={name:"shiki-noop",type:"code-highlighter",supportsLanguage:()=>!1,getSupportedLanguages:()=>[],getThemes:()=>["github-light","github-dark"],highlight:()=>null};var DU=j(Ee(),1);var so=j(Ee(),1),NK=5,MU=400;function RU(e,t,a={}){let{msPerChar:n=NK}=a,[r,o]=(0,so.useState)(t?"":e),i=(0,so.useRef)(e),s=(0,so.useRef)(t?0:e.length),l=(0,so.useRef)(0),u=(0,so.useRef)(null);return(e.length<s.current||!e.startsWith(r.slice(0,s.current)))&&(s.current=t?0:e.length),i.current=e,(0,so.useEffect)(()=>{if(!t){u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),s.current=e.length,o(e);return}if(i.current.length-s.current>MU&&(s.current=i.current.length-MU),u.current!==null)return;let d=p=>{let m=i.current;if(s.current>=m.length){u.current=null;return}l.current===0&&(l.current=p);let h=p-l.current;if(h>=n){let v=Math.min(Math.floor(h/n),m.length-s.current);s.current+=v,o(m.slice(0,s.current)),l.current=p}u.current=requestAnimationFrame(d)};return u.current=requestAnimationFrame(d),()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}},[e,t,n]),r}var zd=j(he(),1),VS=({className:e,from:t,children:a,...n})=>(0,zd.jsx)("div",{className:V("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,zd.jsx)("div",{className:V("ww:flex ww:min-w-0 ww:flex-col ww:gap-2","ww:w-full"),children:a})}),$S=({children:e,className:t,...a})=>(0,zd.jsx)("div",{className:V("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}),UK={cjk:jS,code:AU},BK={cjk:jS},zK={enabled:!1};function FK({className:e,linkSafety:t,isStreaming:a,children:n,...r}){let i=RU(typeof n=="string"?n:"",!!a),s=typeof n=="string"?i:n;return(0,zd.jsx)(au,{className:V("ww:size-full ww:[&>*:first-child]:mt-0 ww:[&>*:last-child]:mb-0",e),linkSafety:t??zK,plugins:a?BK:UK,...r,children:s})}var Lh=(0,DU.memo)(FK,(e,t)=>e.children===t.children&&e.isStreaming===t.isStreaming);Lh.displayName="MessageResponse";var la=j(Ee(),1);function WS(e){if(!(typeof e!="object"||e===null))return e}function _U(e){return WS(e?.ui)}function GS(e){if(!e)return;let t=_U(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 Fd(e){return _U(e)?.autoHeight===!0}function XS(e){return WS(WS(e)?._meta)}var He=j(he(),1);function qK(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,s]of n){if(o<=8)break;let l=i.length>4?`${i.slice(0,4)}\u2026`:i,u;typeof s=="string"?u=s.length>2?`'${s.slice(0,1)}\u2026`:`'${s}'`:Array.isArray(s)?u=`Array(${s.length})`:typeof s=="object"&&s!==null?u="{\u2026}":u=String(s);let c=`${l}\u2009${u}`;r.push(c),o-=c.length+3}return`{${r.join(", ")}}`}function HK({text:e,className:t}){let{t:a}=Ue(),[n,r]=(0,la.useState)(!1),o=(0,la.useRef)(null);(0,la.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let i=(0,la.useCallback)(async s=>{s.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>r(!1),2e3)}catch{}},[e]);return(0,He.jsx)(Ir,{variant:"ghost",size:"sm",onClick:i,className:V("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,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Tc,{className:"ww:size-3.5"}),(0,He.jsx)("span",{children:a.tool.copied})]}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Ec,{className:"ww:size-3.5"}),(0,He.jsx)("span",{children:a.tool.copy})]})})}function PU({data:e,label:t,className:a,...n}){let[r,o]=(0,la.useState)(!1),i=(0,la.useMemo)(()=>JSON.stringify(e,null,2),[e]),s=qK(e);return(0,He.jsxs)("div",{className:V("ww:rounded-lg ww:bg-tool-card",a),...n,children:[(0,He.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:px-3 ww:pt-2.5 ww:pb-1.5",children:[(0,He.jsx)("span",{className:"ww:text-xs ww:font-medium ww:text-muted-foreground",children:t}),(0,He.jsx)(HK,{text:i})]}),(0,He.jsxs)("button",{type:"button",onClick:()=>o(l=>!l),className:"ww:flex ww:w-full ww:items-start ww:gap-2 ww:px-3 ww:pb-3 ww:text-left",children:[(0,He.jsx)(Lc,{className:V("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,He.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,He.jsx)("code",{children:i})}):(0,He.jsx)("span",{className:"ww:truncate ww:text-xs ww:font-mono ww:text-foreground/80",children:s})]})]})}var KS=(0,la.createContext)({open:!1,toggle:()=>{}});function OU({className:e,defaultOpen:t=!1,children:a,...n}){let[r,o]=(0,la.useState)(t);return(0,He.jsx)(KS.Provider,{value:{open:r,toggle:()=>o(i=>!i)},children:(0,He.jsx)("div",{className:V("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 NU({className:e,title:t,state:a,...n}){let{open:r,toggle:o}=(0,la.useContext)(KS),i=a==="input-available"||a==="input-streaming",s=t??"";return(0,He.jsxs)("button",{type:"button",onClick:o,className:V("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,He.jsx)(_i,{className:"ww:size-4 ww:shrink-0"}),(0,He.jsx)("span",{className:"ww:truncate",children:i?(0,He.jsx)(ir,{duration:1.6,children:s}):s}),(0,He.jsx)(zo,{className:V("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",r&&"ww:rotate-180")})]})}function UU({className:e,title:t,state:a,...n}){let r=a==="input-available"||a==="input-streaming",o=t??"";return(0,He.jsx)("div",{className:V("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,He.jsx)("span",{className:"ww:truncate",children:r?(0,He.jsx)(ir,{duration:1.6,children:o}):o})})}function BU({className:e,children:t,...a}){let{open:n}=(0,la.useContext)(KS);return(0,He.jsx)("div",{className:V("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,He.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,He.jsx)("div",{className:V("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 YS({className:e,input:t,debug:a,...n}){let{t:r}=Ue(),o=(0,la.useMemo)(()=>{if(!a&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:i,...s}=t;return s}return t},[t,a]);return(0,He.jsx)(PU,{data:o,label:r.tool.request,className:e,...n})}function qd(e,t,a){if(e){let n=GS(a?.[e]?._meta);if(n)return n}return GS(XS(t))}function zU(e,t,a){return e&&Fd(a?.[e]?._meta)?!0:Fd(XS(t))}function ZS({className:e,output:t,errorText:a,debug:n,...r}){let{t:o}=Ue(),i=(0,la.useMemo)(()=>{if(!n&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:s,...l}=t;return l}return t},[t,n]);return t||a?a?(0,He.jsxs)("div",{className:V("ww:space-y-2",e),...r,children:[(0,He.jsx)("h4",{className:"ww:text-xs ww:font-medium ww:uppercase ww:tracking-wide ww:text-muted-foreground",children:o.tool.error}),(0,He.jsx)("div",{className:"ww:rounded-lg ww:bg-destructive/10 ww:p-3 ww:text-xs ww:text-destructive",children:a})]}):(0,He.jsx)(PU,{data:i,label:o.tool.response,className:e,...r}):null}var Hd=j(he(),1);function FU(e){return e.type==="text"||e.type==="reasoning"||e.type==="file"||"toolCallId"in e}function qU(e){return e.parts.some(FU)}function HU(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=>!(!FU(o)||a?.ignoreToolParts&&"toolCallId"in o||a?.ignoreReasoningParts&&o.type==="reasoning"))}function jU({className:e,...t}){let{t:a}=Ue();return(0,Hd.jsxs)("div",{"aria-live":"polite",className:V("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,Hd.jsx)(Pc,{className:"ww:size-4 ww:shrink-0"}),(0,Hd.jsx)(ir,{duration:1.6,children:a.workingIndicator.default})]})}var ut=j(Ee(),1);function nu(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 VU(e,t){return!nu(e)&&!nu(t)?null:nu(e)?nu(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 lo=j(Ee(),1);var $U=(0,lo.createContext)(()=>{});function WU(){return(0,lo.useContext)($U)}var GU=$U.Provider;function jK(e){let t=window.requestIdleCallback;typeof t=="function"?t(e):setTimeout(e,500)}function ru(e){let t=(0,lo.useRef)(e);t.current=e;let a=(0,lo.useRef)(!1);(0,lo.useEffect)(()=>{if(!e.painted||a.current)return;a.current=!0;let n=requestAnimationFrame(()=>{let r=t.current;Di(r.paintMark),jK(()=>k1(r))});return()=>cancelAnimationFrame(n)},[e.painted])}var XU=j(he(),1),VK="/api/mcp/resource",$K=500,WK=0,GK=16,XK="2026-01-26",KK=300,YK=3e3,ZK=3,JK=2e3;function QK(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function eY(e,t,a){return qd(e,t,a)?!1:t._meta?.["waniwani/autoInjectResultText"]!==!1}function Eh({resourceUri:e,toolInput:t,toolResult:a,resourceEndpoint:n=VK,chatSessionId:r,isDark:o=!1,className:i,autoHeight:s=!1,onOpenLink:l,onFollowUp:u,onCallTool:c,onDisplayModeChange:d,isFullscreen:p=!1,toolDefinitions:m}){let h=(0,ut.useRef)(null),v=(0,ut.useRef)(t),I=(0,ut.useRef)(a),y=(0,ut.useRef)({width:0,height:0}),w=(0,ut.useRef)(null),g=(0,ut.useRef)(!1),S=(0,ut.useRef)(0),E=(0,ut.useRef)("inline"),[T,R]=(0,ut.useState)(WK),[O,U]=(0,ut.useState)(void 0),A=(0,ut.useRef)(l),Q=(0,ut.useRef)(u),$=(0,ut.useRef)(c),q=(0,ut.useRef)(d),Z=(0,ut.useRef)(r),X=(0,ut.useRef)(m);v.current=t,I.current=a,A.current=l,Q.current=u,$.current=c,q.current=d,Z.current=r,X.current=m;let B=(0,ut.useCallback)(x=>s?Math.max(x+GK,0):Math.min(Math.max(x,50),$K),[s]),P=(0,ut.useMemo)(()=>{let x=n.includes("?")?"&":"?";return`${n}${x}uri=${encodeURIComponent(e)}`},[n,e]),J=WU(),ge=(0,ut.useRef)(null),C=(0,ut.useRef)(void 0);(0,ut.useEffect)(()=>{let x=L1(e,J);return ge.current=x,()=>{clearTimeout(C.current),x.has("initialized")||x.report("timeout",S.current),ge.current=null}},[e,J]);let ze=(0,ut.useRef)(o);ze.current=o;let ot=(0,ut.useRef)(p);return(0,ut.useEffect)(()=>{ot.current=p,y.current.height=-1,w.current&&(w.current.cancel(),w.current=null)},[p]),(0,ut.useEffect)(()=>{if(!g.current)return;let x=h.current;x?.contentWindow&&x.contentWindow.postMessage({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{theme:o?"dark":"light"}},"*")},[o]),(0,ut.useEffect)(()=>{let x=h.current;if(!x)return;let ae=!1,re=!1,Ce=null,We=null,be=setTimeout(()=>{if(ae||re||S.current>=ZK)return;S.current+=1;let ce=new URL(x.src);ce.searchParams.set("_retry",String(S.current)),x.src=ce.toString()},YK),Oe=ce=>{x.contentWindow?.postMessage(ce,"*")},we=ce=>{if(ae||ce.source!==x.contentWindow)return;let Le=ce.data;if(!Le||typeof Le!="object"||Le.jsonrpc!=="2.0")return;let ie=Le.method,xe=Le.id;if(ie==="ui/initialize"&&xe!=null){re=!0,ge.current?.mark("initialize"),clearTimeout(be),Oe({jsonrpc:"2.0",id:xe,result:{protocolVersion:Le.params?.protocolVersion??XK,hostInfo:{name:"Waniwani Chat",version:"1.0.0"},hostCapabilities:{openLinks:{},message:{text:{}},tools:{},updateModelContext:{text:{},structuredContent:{}}},hostContext:{theme:ze.current?"dark":"light",displayMode:E.current}}});return}if(ie==="ui/notifications/initialized"){g.current=!0,ge.current?.mark("initialized"),C.current=setTimeout(()=>ge.current?.report("ok",S.current),JK);let Ne=v.current,_e=I.current,Fe=_e._meta&&typeof _e._meta=="object"?_e._meta:null,Ae=QK(Z.current),de=Fe&&typeof Fe.waniwani=="object"&&Fe.waniwani!==null?Fe.waniwani:null,W=de||Ae?{...de??{},...Ae?{sessionId:Ae}:{}}:void 0,ct=Fe||W?{...Fe??{},...W?{waniwani:W}:{}}:void 0;Oe({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:Ne}});let le=_e.content??[{type:"text",text:JSON.stringify(_e)}];Oe({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:{content:le,structuredContent:_e.structuredContent,_meta:ct,meta:ct}});return}if(ie==="ui/notifications/size-changed"){clearTimeout(C.current),ge.current?.mark("firstSize"),ge.current?.report("ok",S.current);let Ne=Le.params,_e=typeof Ne?.height=="number"?Ne.height:void 0,Fe=typeof Ne?.width=="number"?Ne.width:void 0,Ae=y.current,de=_e!==void 0&&_e!==Ae.height,W=Fe!==void 0&&Fe!==Ae.width;if(!de&&!W)return;if(de&&_e!==void 0){if(Ae.height=_e,ot.current)return;let ct=B(_e),le=x.getBoundingClientRect().height;if(w.current&&(w.current.cancel(),w.current=null),R(ct),x.animate&&Math.abs(le-ct)>2){let oe=x.animate([{height:`${le}px`},{height:`${ct}px`}],{duration:KK,easing:"ease-out",fill:"forwards"});w.current=oe,oe.onfinish=()=>{w.current===oe&&(oe.cancel(),w.current=null)}}}W&&s&&Fe!==void 0&&(Ae.width=Fe,U(Fe));return}if(ie==="ui/open-link"&&xe!=null){let Ne=Le.params?.url;typeof Ne=="string"&&(A.current?A.current(Ne):window.open(Ne,"_blank","noopener,noreferrer")),Oe({jsonrpc:"2.0",id:xe,result:{}});return}if(ie==="ui/message"&&xe!=null){if(Q.current&&Le.params){let Ne=Le.params,_e=Ce;if(Ce=null,We){clearTimeout(We.timer);let Fe=We.text;We=null;let Ae=(Ne.content??[]).map(de=>de.text??"").join("").trim();Ne={...Ne,content:[{type:"text",text:`${Ae}
|
|
140
|
+
- `)}`,Error(ae)}let oe=`${s}/$ref`,Ie=Nt(e,le,a,n,r,o,i,oe,l);if(Ie.valid||W.push({instanceLocation:i,keyword:"$ref",keywordLocation:oe,error:"A subschema had errors."},...Ie.errors),a==="4"||a==="7")return{valid:W.length===0,errors:W}}if(Array.isArray(h)){let le=h.length,oe=!1;for(let Ie=0;Ie<le;Ie++)if(c===h[Ie]||h[Ie]==="integer"&&c==="number"&&e%1==0&&e===e){oe=!0;break}oe||W.push({instanceLocation:i,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${c}" is invalid. Expected "${h.join('", "')}".`})}else h==="integer"?(c!=="number"||e%1||e!==e)&&W.push({instanceLocation:i,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${c}" is invalid. Expected "${h}".`}):h!==void 0&&c!==h&&W.push({instanceLocation:i,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${c}" is invalid. Expected "${h}".`});if(v!==void 0&&(c==="object"||c==="array"?Kc(e,v)||W.push({instanceLocation:i,keyword:"const",keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(v)}.`}):e!==v&&W.push({instanceLocation:i,keyword:"const",keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(v)}.`})),I!==void 0&&(c==="object"||c==="array"?I.some(le=>Kc(e,le))||W.push({instanceLocation:i,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(I)}.`}):I.some(le=>e===le)||W.push({instanceLocation:i,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(I)}.`})),w!==void 0){let le=`${s}/not`;Nt(e,w,a,n,r,o,i,le).valid&&W.push({instanceLocation:i,keyword:"not",keywordLocation:le,error:'Instance matched "not" schema.'})}let ct=[];if(g!==void 0){let le=`${s}/anyOf`,oe=W.length,Ie=!1;for(let ae=0;ae<g.length;ae++){let k=g[ae],D=Object.create(l),F=Nt(e,k,a,n,r,m===!0?o:null,i,`${le}/${ae}`,D);W.push(...F.errors),Ie||(Ie=F.valid),F.valid&&ct.push(D)}Ie?W.length=oe:W.splice(oe,0,{instanceLocation:i,keyword:"anyOf",keywordLocation:le,error:"Instance does not match any subschemas."})}if(S!==void 0){let le=`${s}/allOf`,oe=W.length,Ie=!0;for(let ae=0;ae<S.length;ae++){let k=S[ae],D=Object.create(l),F=Nt(e,k,a,n,r,m===!0?o:null,i,`${le}/${ae}`,D);W.push(...F.errors),Ie&&(Ie=F.valid),F.valid&&ct.push(D)}Ie?W.length=oe:W.splice(oe,0,{instanceLocation:i,keyword:"allOf",keywordLocation:le,error:"Instance does not match every subschema."})}if(E!==void 0){let le=`${s}/oneOf`,oe=W.length,Ie=E.filter((ae,k)=>{let D=Object.create(l),F=Nt(e,ae,a,n,r,m===!0?o:null,i,`${le}/${k}`,D);return W.push(...F.errors),F.valid&&ct.push(D),F.valid}).length;Ie===1?W.length=oe:W.splice(oe,0,{instanceLocation:i,keyword:"oneOf",keywordLocation:le,error:`Instance does not match exactly one subschema (${Ie} matches).`})}if((c==="object"||c==="array")&&Object.assign(l,...ct),T!==void 0){let le=`${s}/if`;if(Nt(e,T,a,n,r,o,i,le,l).valid){if(R!==void 0){let oe=Nt(e,R,a,n,r,o,i,`${s}/then`,l);oe.valid||W.push({instanceLocation:i,keyword:"if",keywordLocation:le,error:'Instance does not match "then" schema.'},...oe.errors)}}else if(O!==void 0){let oe=Nt(e,O,a,n,r,o,i,`${s}/else`,l);oe.valid||W.push({instanceLocation:i,keyword:"if",keywordLocation:le,error:'Instance does not match "else" schema.'},...oe.errors)}}if(c==="object"){if(y!==void 0)for(let ae of y)ae in e||W.push({instanceLocation:i,keyword:"required",keywordLocation:`${s}/required`,error:`Instance does not have required property "${ae}".`});let le=Object.keys(e);if(Z!==void 0&&le.length<Z&&W.push({instanceLocation:i,keyword:"minProperties",keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${Z} properties.`}),X!==void 0&&le.length>X&&W.push({instanceLocation:i,keyword:"maxProperties",keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${X} properties.`}),B!==void 0){let ae=`${s}/propertyNames`;for(let k in e){let D=`${i}/${Jn(k)}`,F=Nt(k,B,a,n,r,o,D,ae);F.valid||W.push({instanceLocation:i,keyword:"propertyNames",keywordLocation:ae,error:`Property name "${k}" does not match schema.`},...F.errors)}}if(P!==void 0){let ae=`${s}/dependantRequired`;for(let k in P)if(k in e){let D=P[k];for(let F of D)F in e||W.push({instanceLocation:i,keyword:"dependentRequired",keywordLocation:ae,error:`Instance has "${k}" but does not have "${F}".`})}}if(J!==void 0)for(let ae in J){let k=`${s}/dependentSchemas`;if(ae in e){let D=Nt(e,J[ae],a,n,r,o,i,`${k}/${Jn(ae)}`,l);D.valid||W.push({instanceLocation:i,keyword:"dependentSchemas",keywordLocation:k,error:`Instance has "${ae}" but does not match dependant schema.`},...D.errors)}}if(ge!==void 0){let ae=`${s}/dependencies`;for(let k in ge)if(k in e){let D=ge[k];if(Array.isArray(D))for(let F of D)F in e||W.push({instanceLocation:i,keyword:"dependencies",keywordLocation:ae,error:`Instance has "${k}" but does not have "${F}".`});else{let F=Nt(e,D,a,n,r,o,i,`${ae}/${Jn(k)}`);F.valid||W.push({instanceLocation:i,keyword:"dependencies",keywordLocation:ae,error:`Instance has "${k}" but does not match dependant schema.`},...F.errors)}}}let oe=Object.create(null),Ie=!1;if(A!==void 0){let ae=`${s}/properties`;for(let k in A){if(!(k in e))continue;let D=`${i}/${Jn(k)}`,F=Nt(e[k],A[k],a,n,r,o,D,`${ae}/${Jn(k)}`);if(F.valid)l[k]=oe[k]=!0;else if(Ie=r,W.push({instanceLocation:i,keyword:"properties",keywordLocation:ae,error:`Property "${k}" does not match schema.`},...F.errors),Ie)break}}if(!Ie&&Q!==void 0){let ae=`${s}/patternProperties`;for(let k in Q){let D=new RegExp(k,"u"),F=Q[k];for(let fe in e){if(!D.test(fe))continue;let Ve=`${i}/${Jn(fe)}`,Ft=Nt(e[fe],F,a,n,r,o,Ve,`${ae}/${Jn(k)}`);Ft.valid?l[fe]=oe[fe]=!0:(Ie=r,W.push({instanceLocation:i,keyword:"patternProperties",keywordLocation:ae,error:`Property "${fe}" matches pattern "${k}" but does not match associated schema.`},...Ft.errors))}}}if(!Ie&&$!==void 0){let ae=`${s}/additionalProperties`;for(let k in e){if(oe[k])continue;let D=`${i}/${Jn(k)}`,F=Nt(e[k],$,a,n,r,o,D,ae);F.valid?l[k]=!0:(Ie=r,W.push({instanceLocation:i,keyword:"additionalProperties",keywordLocation:ae,error:`Property "${k}" does not match additional properties schema.`},...F.errors))}}else if(!Ie&&H!==void 0){let ae=`${s}/unevaluatedProperties`;for(let k in e)if(!l[k]){let D=`${i}/${Jn(k)}`,F=Nt(e[k],H,a,n,r,o,D,ae);F.valid?l[k]=!0:W.push({instanceLocation:i,keyword:"unevaluatedProperties",keywordLocation:ae,error:`Property "${k}" does not match unevaluated properties schema.`},...F.errors)}}}else if(c==="array"){be!==void 0&&e.length>be&&W.push({instanceLocation:i,keyword:"maxItems",keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${be}).`}),We!==void 0&&e.length<We&&W.push({instanceLocation:i,keyword:"minItems",keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${We}).`});let le=e.length,oe=0,Ie=!1;if(C!==void 0){let ae=`${s}/prefixItems`,k=Math.min(C.length,le);for(;oe<k;oe++){let D=Nt(e[oe],C[oe],a,n,r,o,`${i}/${oe}`,`${ae}/${oe}`);if(l[oe]=!0,!D.valid&&(Ie=r,W.push({instanceLocation:i,keyword:"prefixItems",keywordLocation:ae,error:"Items did not match schema."},...D.errors),Ie))break}}if(ze!==void 0){let ae=`${s}/items`;if(Array.isArray(ze)){let k=Math.min(ze.length,le);for(;oe<k;oe++){let D=Nt(e[oe],ze[oe],a,n,r,o,`${i}/${oe}`,`${ae}/${oe}`);if(l[oe]=!0,!D.valid&&(Ie=r,W.push({instanceLocation:i,keyword:"items",keywordLocation:ae,error:"Items did not match schema."},...D.errors),Ie))break}}else for(;oe<le;oe++){let k=Nt(e[oe],ze,a,n,r,o,`${i}/${oe}`,ae);if(l[oe]=!0,!k.valid&&(Ie=r,W.push({instanceLocation:i,keyword:"items",keywordLocation:ae,error:"Items did not match schema."},...k.errors),Ie))break}if(!Ie&&ot!==void 0){let k=`${s}/additionalItems`;for(;oe<le;oe++){let D=Nt(e[oe],ot,a,n,r,o,`${i}/${oe}`,k);l[oe]=!0,D.valid||(Ie=r,W.push({instanceLocation:i,keyword:"additionalItems",keywordLocation:k,error:"Items did not match additional items schema."},...D.errors))}}}if(te!==void 0)if(le===0&&re===void 0)W.push({instanceLocation:i,keyword:"contains",keywordLocation:`${s}/contains`,error:"Array is empty. It must contain at least one item matching the schema."});else if(re!==void 0&&le<re)W.push({instanceLocation:i,keyword:"minContains",keywordLocation:`${s}/minContains`,error:`Array has less items (${le}) than minContains (${re}).`});else{let ae=`${s}/contains`,k=W.length,D=0;for(let F=0;F<le;F++){let fe=Nt(e[F],te,a,n,r,o,`${i}/${F}`,ae);fe.valid?(l[F]=!0,D++):W.push(...fe.errors)}D>=(re||0)&&(W.length=k),re===void 0&&ke===void 0&&D===0?W.splice(k,0,{instanceLocation:i,keyword:"contains",keywordLocation:ae,error:"Array does not contain item matching schema."}):re!==void 0&&D<re?W.push({instanceLocation:i,keyword:"minContains",keywordLocation:`${s}/minContains`,error:`Array must contain at least ${re} items matching schema. Only ${D} items were found.`}):ke!==void 0&&D>ke&&W.push({instanceLocation:i,keyword:"maxContains",keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${ke} items matching schema. ${D} items were found.`})}if(!Ie&&x!==void 0){let ae=`${s}/unevaluatedItems`;for(;oe<le;oe++){if(l[oe])continue;let k=Nt(e[oe],x,a,n,r,o,`${i}/${oe}`,ae);l[oe]=!0,k.valid||W.push({instanceLocation:i,keyword:"unevaluatedItems",keywordLocation:ae,error:"Items did not match unevaluated items schema."},...k.errors)}}if(Oe)for(let ae=0;ae<le;ae++){let k=e[ae],D=typeof k=="object"&&!!k;for(let F=0;F<le;F++){if(ae===F)continue;let fe=e[F];(k===fe||D&&typeof fe=="object"&&fe&&Kc(k,fe))&&(W.push({instanceLocation:i,keyword:"uniqueItems",keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${ae} and ${F}.`}),ae=2**53-1,F=2**53-1)}}}else if(c==="number"){if(a==="4"?(we!==void 0&&(Le===!0&&e<=we||e<we)&&W.push({instanceLocation:i,keyword:"minimum",keywordLocation:`${s}/minimum`,error:`${e} is less than ${Le?"or equal to ":""} ${we}.`}),ce!==void 0&&(ie===!0&&e>=ce||e>ce)&&W.push({instanceLocation:i,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ie?"or equal to ":""} ${ce}.`})):(we!==void 0&&e<we&&W.push({instanceLocation:i,keyword:"minimum",keywordLocation:`${s}/minimum`,error:`${e} is less than ${we}.`}),ce!==void 0&&e>ce&&W.push({instanceLocation:i,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ce}.`}),Le!==void 0&&e<=Le&&W.push({instanceLocation:i,keyword:"exclusiveMinimum",keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${Le}.`}),ie!==void 0&&e>=ie&&W.push({instanceLocation:i,keyword:"exclusiveMaximum",keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${ie}.`})),xe!==void 0){let le=e%xe;Math.abs(0-le)>=11920929e-14&&Math.abs(xe-le)>=11920929e-14&&W.push({instanceLocation:i,keyword:"multipleOf",keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${xe}.`})}}else if(c==="string"){let le=Ne===void 0&&_e===void 0?0:Z9(e);Ne!==void 0&&le<Ne&&W.push({instanceLocation:i,keyword:"minLength",keywordLocation:`${s}/minLength`,error:`String is too short (${le} < ${Ne}).`}),_e!==void 0&&le>_e&&W.push({instanceLocation:i,keyword:"maxLength",keywordLocation:`${s}/maxLength`,error:`String is too long (${le} > ${_e}).`}),Fe!==void 0&&!new RegExp(Fe,"u").test(e)&&W.push({instanceLocation:i,keyword:"pattern",keywordLocation:`${s}/pattern`,error:"String does not match pattern."}),U!==void 0&&dA[U]&&!dA[U](e)&&W.push({instanceLocation:i,keyword:"format",keywordLocation:`${s}/format`,error:`String does not match format "${U}".`})}return{valid:W.length===0,errors:W}}var mA=class{constructor(e,t="2019-09",a=!0){K(this,"schema");K(this,"draft");K(this,"shortCircuit");K(this,"lookup");this.schema=e,this.draft=t,this.shortCircuit=a,this.lookup=qi(e)}validate(e){return Nt(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),qi(e,this.lookup)}};function yA(e){return ej(e,"output")}function J9(e,t){let a=()=>structuredClone(e),n={"~standard":{version:1,vendor:"eve",validate:nj(e,t),jsonSchema:{input:a,output:a}}};return Q9.add(n),n}var Q9=new WeakSet,jne=J9({});function ej(e,t){return e==null?e:tj(e,t)}function tj(e,t){let a=aj(e),n=a?.jsonSchema,r=typeof n=="object"&&n?n[t]:void 0,o=typeof a?.vendor=="string"?a.vendor:"unknown";if(a!==void 0&&typeof r!="function"&&o==="zod"){if(t==="input"){let l=Oi(e),{$schema:u,...c}=qc(l.jsonSchema);return c}throw Error("Zod 3 cannot emit an output JSON Schema. Upgrade to Zod 4 or provide a plain JSON Schema object.")}if(a!==void 0&&typeof r!="function")throw Error(`Standard Schema vendor "${o}" does not support JSON Schema conversion. Provide a Standard Schema implementation with JSON Schema conversion or a plain JSON Schema object.`);let{$schema:i,...s}=qc(a===void 0?e:r({target:"draft-07"}));return s}function aj(e){if(typeof e!="object"||!e||!("~standard"in e))return;let t=e["~standard"];return typeof t=="object"&&t?t:void 0}function nj(e,t){let a,n=!1,r=(o,i)=>(n||(n=!0,console.warn(`[eve] Tool schema cannot validate values locally; passing them through unvalidated: ${i}`)),{value:o});return o=>{if(a===void 0){let u=sj(e);if(typeof u=="string")return a=null,r(o,u);a=u}if(a===null)return{value:o};let i;try{i=a.validate(o)}catch(u){return o===void 0?{issues:[{message:"Expected a JSON value."}]}:r(o,jc(u))}if(!i.valid)return{issues:mj(i.errors)};let s=zv(e,e,o),l=t?.(s);return l===void 0?{value:s}:{issues:[{message:l}]}}}function zv(e,t,a){let n=a;for(let r of wA(e,t)){let{items:o,properties:i}=r;if(gr(n)&&gr(i))n=rj(e,i,n);else if(Array.isArray(n)&&gr(o)){let s=n,l=s.map(u=>zv(e,o,u));l.some((u,c)=>u!==s[c])&&(n=l)}}return n}function rj(e,t,a){let n=a;for(let[r,o]of Object.entries(t)){let i=Object.hasOwn(a,r)?a[r]:void 0,s=i===void 0?oj(e,o):zv(e,o,i);s!==i&&(n===a&&(n={...a}),n[r]=s)}return n}function oj(e,t){for(let a of wA(e,t))if("default"in a)return structuredClone(a.default)}function*wA(e,t){let a=new Set,n=t;for(;gr(n)&&!a.has(n);)a.add(n),yield n,n=ij(e,n.$ref)}function ij(e,t){if(typeof t!="string"||t!=="#"&&!t.startsWith("#/"))return;let a=e;for(let n of Bv(t)){if(typeof a!="object"||!a||!Object.hasOwn(a,n))return;a=a[n]}return a}function sj(e){try{let t=structuredClone(e);return Yc(t)??new mA(t,"2020-12",!1)}catch(t){return jc(t)}}var lj=new Set(["array","boolean","integer","null","number","object","string"]),uj=[["exclusiveMinimum","minimum"],["exclusiveMaximum","maximum"]],cj=["additionalItems","additionalProperties","contains","else","if","not","propertyNames","then","unevaluatedItems","unevaluatedProperties"],dj=["allOf","anyOf","oneOf","prefixItems"],fj=["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"];function Yc(e){if(typeof e=="boolean")return;if(typeof e!="object"||!e||Array.isArray(e))return"a subschema is neither an object nor a boolean";let t=e;delete t.format;for(let[s,l]of uj)typeof t[s]=="boolean"&&(t[s]&&typeof t[l]=="number"?(t[s]=t[l],delete t[l]):delete t[s]);let{enum:a,pattern:n,required:r,type:o}=t;if(o!==void 0&&!(Array.isArray(o)?o.every(hA):hA(o)))return`unsupported type ${JSON.stringify(o)}`;if(a!==void 0&&!Array.isArray(a))return"`enum` is not an array";if(r!==void 0&&!(Array.isArray(r)&&r.every(s=>typeof s=="string")))return"`required` is not an array of strings";if(n!==void 0&&!gA(n))return`invalid pattern ${JSON.stringify(n)}`;for(let s of cj)if(s in t){let l=Yc(t[s]);if(l!==void 0)return l}let i=t.items;for(let s of Array.isArray(i)?i:i===void 0?[]:[i]){let l=Yc(s);if(l!==void 0)return l}for(let s of dj){let l=t[s];if(l!==void 0){if(!Array.isArray(l))return`\`${s}\` is not an array`;for(let u of l){let c=Yc(u);if(c!==void 0)return c}}}for(let s of fj){let l=t[s];if(l!==void 0){if(typeof l!="object"||!l||Array.isArray(l))return`\`${s}\` is not an object`;for(let[u,c]of Object.entries(l)){if(s==="patternProperties"&&!gA(u))return`invalid pattern ${JSON.stringify(u)}`;if(s==="dependencies"&&Array.isArray(c))continue;let d=Yc(c);if(d!==void 0)return d}}}}function hA(e){return typeof e=="string"&&lj.has(e)}function gA(e){if(typeof e!="string")return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var pj=/\/(?:additional|unevaluated)Properties$/;function mj(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],o=e[n+1];if(pj.test(r.keywordLocation)&&o?.keyword==="false"){let i=Bv(o.instanceLocation).at(-1);t.push({keyword:"false",location:o.instanceLocation,message:`Unrecognized key: ${JSON.stringify(i)}`,object:r.instanceLocation}),n++}else t.push({keyword:r.keyword,location:r.instanceLocation,message:r.error})}let a=t.filter(n=>n.object===void 0||!t.some(r=>r.object===void 0&&(r.location===n.location||r.location.startsWith(`${n.location}/`))));return a.filter((n,r)=>{let o=a[r+1];return o===void 0?!0:o.location.startsWith(`${n.location}/`)?!1:n.keyword!=="$ref"||o.location!==n.location}).map(({location:n,message:r,object:o})=>{let i=Bv(o??n);return i.length===0?{message:r}:{message:r,path:i}})}function Bv(e){return e.split("/").slice(1).map(t=>{let a=t;try{a=decodeURIComponent(t)}catch{}return a.replaceAll("~1","/").replaceAll("~0","~")})}var vA=Symbol("followClientSession"),La,Ut,oa,qv,Hv,xA,jv,Vv,cm,Hi,Zc=(Hi=class{constructor(t,a){ue(this,oa);ue(this,La);ue(this,Ut);q(this,La,t),q(this,Ut,a)}static async create(t,a){var i;let n=await $v(t,Ta,a,!0),{sessionId:r}=await Fv(n),o=new Hi(t,{sessionId:r,streamIndex:0});return{response:Y(i=o,oa,Hv).call(i,n,a,0),session:o}}static async prewarm(t,a={}){let{sessionId:n}=await Fv(await gj(t,a));return new Hi(t,{sessionId:n,streamIndex:0})}get state(){return b(this,Ut)}async snapshot(t){t?.signal?.throwIfAborted();let a=[];for await(let n of Y(this,oa,cm).call(this,{follow:!1,signal:t?.signal,startIndex:0}))a.push(n);return t?.signal?.throwIfAborted(),{events:a,session:{sessionId:b(this,Ut).sessionId,streamIndex:a.length}}}async send(t,a={}){return await Y(this,oa,qv).call(this,{...a,message:t},!0)}async respond(t,a={}){if(t.length===0)throw Error("ClientSession.respond() requires at least one input response.");return await Y(this,oa,qv).call(this,{...a,inputResponses:t},!1)}async cancel(t){return await sA({context:b(this,La),options:t,sessionId:b(this,Ut).sessionId})}async clear(){return await lA({context:b(this,La),sessionId:b(this,Ut).sessionId})}async compact(){return await uA({context:b(this,La),sessionId:b(this,Ut).sessionId})}async reset(t){return await cA({context:b(this,La),options:t,sessionId:b(this,Ut).sessionId})}stream(t){if(t?.follow===!1&&(t.startIndex??b(this,Ut).streamIndex)<0)throw Error("stream({ follow: false }) requires a nonnegative startIndex; a tail-relative cursor cannot be bounded.");return Y(this,oa,jv).call(this,t)}streamSubagent(t,a){if(t.data.sessionId!==b(this,Ut).sessionId)throw Error(`streamSubagent() requires a subagent.called event from session ${b(this,Ut).sessionId}, but it came from session ${t.data.sessionId}.`);if(typeof t.data.childStreamPath!="string")throw Error(`streamSubagent() requires a subagent.called event with childStreamPath, but call ${t.data.callId} has none. The event was recorded by an older eve version.`);let n=a?.startIndex??0;if(a?.follow===!1&&n<0)throw Error("streamSubagent({ follow: false }) requires a nonnegative startIndex; a tail-relative cursor cannot be bounded.");return Uv({follow:a?.follow,host:b(this,La).host,path:t.data.childStreamPath,redirect:b(this,La).redirect,resolveHeaders:()=>b(this,La).resolveHeaders(),signal:a?.signal,startIndex:n,streamReconnectPolicy:a?.streamReconnectPolicy})}[vA](t){return Y(this,oa,jv).call(this,{...t,keepAlive:!0})}},La=new WeakMap,Ut=new WeakMap,oa=new WeakSet,qv=async function(t,a){let n=b(this,Ut).streamIndex,r=ME(b(this,Ut).sessionId),o=a?await hj(b(this,La),r,t):await $v(b(this,La),r,t,!1),{sessionId:i,deliveryId:s}=await Fv(o,b(this,Ut).sessionId);if(i!==b(this,Ut).sessionId)throw Error("Message route returned a different session id.");if(t.message!==void 0&&s===void 0)throw Error("Message route did not return a delivery id. Update the server before sending with this client.");return Y(this,oa,Hv).call(this,o,t,n,t.message===void 0?void 0:s)},Hv=function(t,a,n,r){return t.body?.cancel().catch(()=>{}),new _v({cancelTurn:async o=>await this.cancel({turnId:o}),createStream:o=>Y(this,oa,xA).call(this,n,a,r,o),deliveryId:r,sessionId:b(this,Ut).sessionId})},xA=async function*(t,a,n,r){let o=0,i=n===void 0,s=!1,l=new Set;try{for await(let u of r??Y(this,oa,cm).call(this,{headers:a.headers,keepAlive:!0,signal:a.signal,startIndex:t,streamReconnectPolicy:a.streamReconnectPolicy})){if(o+=1,n!==void 0){let c=u.meta?.deliveryIds?.includes(n)===!0,d=u.type==="session.failed"||u.type==="session.completed";if(!c&&d&&(!i||u.type==="session.completed"))throw Error("The session ended before the accepted message reached its turn boundary.");if(!i&&!c||!d&&u.meta?.deliveryIds!==void 0&&!c)continue;i=!0}if(Bi(l,u),s=xn(u)&&(u.type!=="session.waiting"||l.size===0),yield u,s)break}if(n!==void 0&&!s&&!a.signal?.aborted)throw Error("The response stream ended before the accepted message reached its turn boundary.")}finally{Y(this,oa,Vv).call(this,t+o)}},jv=async function*(t){let a=t?.startIndex??b(this,Ut).streamIndex,n=0;for await(let r of Y(this,oa,cm).call(this,{follow:t?.follow,headers:t?.headers,keepAlive:t?.keepAlive,onCaughtUp:t?.onCaughtUp,resolveHeaders:t?.resolveHeaders,resolveReconnectPolicy:t?.resolveReconnectPolicy,signal:t?.signal,startIndex:a,streamReconnectPolicy:t?.streamReconnectPolicy}))n+=1,a>=0&&Y(this,oa,Vv).call(this,a+n),yield r},Vv=function(t){q(this,Ut,{sessionId:b(this,Ut).sessionId,streamIndex:Math.max(b(this,Ut).streamIndex,t)})},cm=function(t){return Uv({onCaughtUp:t.onCaughtUp,follow:t.follow,host:b(this,La).host,keepAlive:t.keepAlive,resolveHeaders:()=>b(this,La).resolveHeaders(t.resolveHeaders?.()??t.headers),path:kv(b(this,Ut).sessionId),redirect:b(this,La).redirect,signal:t.signal,startIndex:t.startIndex,streamReconnectPolicy:t.streamReconnectPolicy,resolveReconnectPolicy:t.resolveReconnectPolicy})},Hi);function bA(e,t){return e[vA](t)}async function hj(e,t,a){let n=Date.now()+2e4,r=250;for(;;){try{return await $v(e,t,a,!1)}catch(o){if(!yj(o))throw o;let i=n-Date.now();if(i<=0)throw o;await Xc(Math.min(r,i),a.signal)}a.signal?.throwIfAborted(),r=Math.min(r*2,2e3)}}async function gj(e,t){let a=await e.resolveHeaders(t.headers),n=await fetch(yr(e.host,Ta),{headers:a,method:"POST",redirect:e.redirect,signal:t.signal??null});if(!n.ok){let r=await n.text();throw new Za(n.status,r,n.headers)}return n}function yj(e){return e instanceof Za&&e.status===409&&e.code==="session_not_ready"}async function $v(e,t,a,n){let r=wj(a,n);if(r===null)throw Error(n?"Creating a session requires a non-empty message.":"A session turn requires a non-empty message or inputResponses.");let o=await e.resolveHeaders(a.headers);o.set("content-type","application/json");let i=await fetch(yr(e.host,t),{body:JSON.stringify(r),headers:o,method:"POST",redirect:e.redirect,signal:a.signal??null});if(!i.ok){let s=await i.text();throw new Za(i.status,s,i.headers)}return i}async function Fv(e,t){let a=await e.json(),n=(typeof a.sessionId=="string"?a.sessionId:void 0)??e.headers.get(UE)?.trim()??t;if(!n)throw Error("Message route did not return a session id.");return{sessionId:n,deliveryId:typeof a.deliveryId=="string"&&a.deliveryId.length>0?a.deliveryId:void 0}}function wj(e,t){let a={};e.message!==void 0&&(a.message=e.message),e.inputResponses!==void 0&&e.inputResponses.length>0&&(a.inputResponses=e.inputResponses),!t&&e.message!==void 0&&e.turnPolicy!==void 0&&(a.turnPolicy=e.turnPolicy),e.message!==void 0&&e.taskDeliveryPolicy!==void 0&&(a.taskDeliveryPolicy=e.taskDeliveryPolicy),e.clientContext!==void 0&&(a.clientContext=e.clientContext);let n=yA(e.outputSchema);return n!==void 0&&(a.outputSchema=n),t&&a.message===void 0||a.message===void 0&&a.inputResponses===void 0?null:a}var ji,SA,Wv=(SA=class{constructor(e){ue(this,ji);q(this,ji,e)}async create(e={}){return"message"in e?await Zc.create(b(this,ji),e):{session:await Zc.prewarm(b(this,ji),e)}}attach(e,t){if(e.length===0)throw Error("sessionId must be a non-empty string.");return new Zc(b(this,ji),{sessionId:e,streamIndex:t?.streamIndex??0})}},ji=new WeakMap,SA);function IA(e,t){let a=new TextEncoder().encode(`${e}:${t}`),n=Array.from(a,r=>String.fromCodePoint(r)).join("");return btoa(n)}var CA=f.object({ok:f.literal(!0),status:f.literal("ready"),workflowId:f.string().min(1)}).strict();var dm=f.discriminatedUnion("kind",[f.object({kind:f.literal("application")}).strict(),f.object({feature:f.string(),kind:f.literal("framework")}).strict(),f.object({kind:f.literal("extension"),namespace:f.string(),packageName:f.string()}).strict()]),LA=f.discriminatedUnion("kind",[f.object({externalDependencies:f.array(f.string()),extensionScope:f.object({namespace:f.string(),sourceRoot:f.string()}).strict().optional(),kind:f.literal("filesystem"),sourcePath:f.string()}).strict(),f.object({dependencies:f.record(f.string(),f.string()).optional(),kind:f.literal("programmatic"),moduleId:f.string(),parameters:f.record(f.string(),f.unknown()).optional(),registryId:f.string(),revision:f.string(),semanticRevision:f.string().optional()}).strict()]),EA=f.object({backing:LA,logicalPath:f.string(),owner:dm}).strict(),Yr=f.object({binding:EA.optional(),exportName:f.string().optional(),logicalPath:f.string(),owner:dm,sourceId:f.string(),sourceKind:f.enum(["markdown","module","skill-package"])}).strict(),Vi=Yr.extend({name:f.string()}).strict(),Jc=Yr.extend({eventNames:f.array(f.string()),slug:f.string()}).strict(),vj=f.discriminatedUnion("kind",[f.object({kind:f.literal("gateway"),target:f.string(),byok:f.string().optional()}).strict(),f.object({kind:f.literal("external"),provider:f.string()}).strict()]),xj=f.union([f.object({kind:f.literal("external"),provider:f.string()}).strict(),f.object({kind:f.literal("chatgpt"),state:f.enum(["checking","ready","signed-out","reauth-required","unavailable"]),accountLabel:f.string().optional()}).strict(),f.object({kind:f.literal("gateway"),connected:f.literal(!0),credential:f.enum(["api-key","oidc","oauth"]),team:f.optional(f.string())}).strict(),f.object({kind:f.literal("gateway"),connected:f.literal(!1)}).strict()]),kA={contextWindowTokens:f.number().optional(),providerOptions:f.unknown().optional(),reasoning:f.enum(["provider-default","none","minimal","low","medium","high","xhigh"]).optional().catch(void 0),source:Yr.optional()},bj=f.union([f.object({...kA,endpoint:xj.optional(),id:f.string(),routing:vj}).strict(),f.object({...kA,endpoint:f.never().optional(),id:f.never().optional(),routing:f.object({kind:f.literal("dynamic"),resolver:Jc}).strict()}).strict()]),Sj=Vi.extend({description:f.string(),hasAuth:f.boolean(),hasExecute:f.boolean(),hasModelOutputProjection:f.boolean(),hasOutputSchema:f.boolean(),inputSchema:f.unknown(),outputSchema:f.unknown().optional(),requiresApproval:f.boolean()}).strict(),Ij=Vi.extend({description:f.string(),license:f.string().optional(),markdown:f.string(),metadata:f.record(f.string(),f.string()).optional()}).strict(),Cj=Vi.extend({content:f.string(),role:f.enum(["system","user"])}).strict(),kj=Vi.extend({cron:f.string(),hasRun:f.boolean(),markdown:f.string().optional()}).strict(),AA=f.enum(["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS","WEBSOCKET"]),Tj=Vi.extend({adapterKind:f.string().optional(),method:AA,urlPath:f.string()}).strict(),Lj=f.object({backing:f.union([LA,f.object({kind:f.literal("resource"),sourcePath:f.string()}).strict()]),form:f.enum(["derived","direct"]),layer:f.enum(["framework-default","extension-package","extension-override","application"]),logicalPath:f.string(),owner:dm,sourceId:f.string()}).strict(),Ej=f.object({method:AA,source:Lj,urlPath:f.string(),winnerSourceId:f.string()}).strict(),Aj=Yr.extend({connectionName:f.string(),description:f.string(),hasApproval:f.boolean(),hasAuthorization:f.boolean(),hasHeaders:f.boolean(),protocol:f.string(),toolFilter:f.unknown().optional(),url:f.string()}).strict(),Mj=Yr.extend({eventNames:f.array(f.string()),slug:f.string()}).strict(),Rj=Yr.extend({description:f.string().optional(),slot:f.string(),visibility:f.enum(["scope","session"])}).strict(),Dj=Yr.extend({provider:f.string().optional(),environmentExportName:f.string().optional(),revisionHash:f.string()}).strict(),_j=Vi.extend({configResolver:Jc.optional(),description:f.string().optional(),entryPath:f.string(),nodeId:f.string(),parentNodeId:f.string(),rootPath:f.string(),summary:f.object({channels:f.number(),connections:f.number(),hooks:f.number(),instructions:f.number(),memories:f.number(),schedules:f.number(),skills:f.number(),tools:f.number()}).strict()}).strict(),Pj=Vi.extend({description:f.string(),nodeId:f.string(),parentNodeId:f.string(),url:f.string().optional()}).strict(),Oj=f.object({action:f.enum(["subagent-call","task-cancel","workflow-tool-call"]).optional(),audience:f.array(f.enum(["root-session","delegated-task-child"])),kind:f.enum(["dispatch","provider-tool"]),sourceId:f.string()}).strict(),TA=f.object({kind:f.enum(["disabled","shadowed"]),logicalPath:f.string(),owner:dm,sourceId:f.string(),winnerSourceId:f.string().optional()}).strict(),MA=f.object({agent:f.object({agentRoot:f.string(),appRoot:f.string(),config:Yr.extend({binding:EA}).strict(),description:f.string().optional(),model:bj,name:f.string(),nodeId:f.string(),outputSchema:f.unknown().optional()}).strict(),capabilities:f.object({devRoutes:f.boolean()}).strict(),channels:f.object({routes:f.array(Tj),shadowed:f.array(Ej)}).strict(),composition:f.object({disabled:f.array(TA),shadowed:f.array(TA)}).strict(),connections:f.array(Aj),diagnostics:f.object({discoveryErrors:f.number(),discoveryWarnings:f.number()}).strict(),hooks:f.array(Mj),instructions:f.object({dynamic:f.array(Jc),static:f.array(Cj)}).strict(),instrumentation:Yr.optional(),kernelEffects:f.array(Oj),kind:f.literal("eve-agent-info"),memories:f.array(Rj),mode:f.enum(["development","production"]),remoteAgents:f.object({entries:f.array(Pj),total:f.number()}).strict(),sandbox:Dj,schedules:f.array(kj),skills:f.object({dynamic:f.array(Jc),static:f.array(Ij)}).strict(),subagents:f.object({local:f.array(_j),total:f.number()}).strict(),tools:f.object({dynamic:f.array(Jc),static:f.array(Sj)}).strict(),version:f.literal(5),workspace:f.object({resourceRoot:f.unknown(),rootEntries:f.array(f.string())}).strict()}).strict().superRefine((e,t)=>{let a=(o,i,s)=>{let l=new Set;o.forEach((u,c)=>{let d=i(u);l.has(d)&&t.addIssue({code:"custom",message:`Duplicate public identity "${d}".`,path:[...s,c]}),l.add(d)})},n=(o,i,s)=>{(!Number.isSafeInteger(o)||o<0||o!==i.length)&&t.addIssue({code:"custom",message:`Expected total ${i.length}, received ${o}.`,path:[...s]})};a(e.tools.static,o=>o.name,["tools","static"]),a(e.tools.dynamic,o=>o.slug,["tools","dynamic"]),a(e.skills.static,o=>o.name,["skills","static"]),a(e.skills.dynamic,o=>o.slug,["skills","dynamic"]),a(e.instructions.static,o=>o.name,["instructions","static"]),a(e.instructions.dynamic,o=>o.slug,["instructions","dynamic"]),a(e.schedules,o=>o.name,["schedules"]),a(e.connections,o=>o.connectionName,["connections"]),a(e.hooks,o=>o.slug,["hooks"]),a(e.memories,o=>o.slot,["memories"]),a(e.channels.routes,o=>`${o.method} ${Nj(o.urlPath)}`,["channels","routes"]),a(e.subagents.local,o=>o.nodeId,["subagents","local"]),a(e.remoteAgents.entries,o=>o.nodeId,["remoteAgents","entries"]),n(e.subagents.total,e.subagents.local,["subagents","total"]),n(e.remoteAgents.total,e.remoteAgents.entries,["remoteAgents","total"]);let r=[[e.agent.config,["agent","config"]],...e.agent.model.source===void 0?[]:[[e.agent.model.source,["agent","model","source"]]],...e.agent.model.routing.kind==="dynamic"?[[e.agent.model.routing.resolver,["agent","model","routing","resolver"]]]:[],...e.channels.routes.map((o,i)=>[o,["channels","routes",i]]),...e.connections.map((o,i)=>[o,["connections",i]]),...e.hooks.map((o,i)=>[o,["hooks",i]]),...e.instructions.dynamic.map((o,i)=>[o,["instructions","dynamic",i]]),...e.instructions.static.map((o,i)=>[o,["instructions","static",i]]),...e.memories.map((o,i)=>[o,["memories",i]]),...e.instrumentation===void 0?[]:[[e.instrumentation,["instrumentation"]]],...e.remoteAgents.entries.map((o,i)=>[o,["remoteAgents","entries",i]]),...e.schedules.map((o,i)=>[o,["schedules",i]]),...e.skills.dynamic.map((o,i)=>[o,["skills","dynamic",i]]),...e.skills.static.map((o,i)=>[o,["skills","static",i]]),...e.subagents.local.flatMap((o,i)=>o.configResolver===void 0?[]:[[o.configResolver,["subagents","local",i,"configResolver"]]]),...e.tools.dynamic.map((o,i)=>[o,["tools","dynamic",i]]),...e.tools.static.map((o,i)=>[o,["tools","static",i]]),[e.sandbox,["sandbox"]]];for(let[o,i]of r){if(o.sourceKind==="module"&&o.binding===void 0){t.addIssue({code:"custom",message:"Module source is missing its compiled binding.",path:[...i,"binding"]});continue}if(o.sourceKind!=="module"&&o.binding!==void 0){t.addIssue({code:"custom",message:`${o.sourceKind} source cannot carry a module binding.`,path:[...i,"binding"]});continue}o.binding!==void 0&&(o.binding.logicalPath!==o.logicalPath&&t.addIssue({code:"custom",message:"Source and binding logical paths do not match.",path:[...i,"binding","logicalPath"]}),JSON.stringify(o.binding.owner)!==JSON.stringify(o.owner)&&t.addIssue({code:"custom",message:"Source and binding owners do not match.",path:[...i,"binding","owner"]}))}});function Nj(e){return e.replace(/^\/+|\/+$/g,"").split("/").map(t=>t.startsWith(":")||/^\[[^\]]+\]$/.test(t)?":":t).join("/")}var RA="x-vercel-trusted-oidc-idp-token";var Qc,ed,$i,Wi,jo,fm,PA,_A,Xv=(_A=class{constructor(e){ue(this,jo);ue(this,Qc);ue(this,ed);ue(this,$i);ue(this,Wi);K(this,"sessions");q(this,$i,e.host),q(this,Qc,e.auth),q(this,ed,e.headers),q(this,Wi,e.redirect),this.sessions=new Wv({host:b(this,$i),redirect:b(this,Wi),resolveHeaders:t=>Y(this,jo,fm).call(this,t)})}async health(){let e=yr(b(this,$i),EE),t=await Y(this,jo,fm).call(this),a=await fetch(e,DA({headers:t},b(this,Wi)));if(!a.ok){let o=await a.text();throw new Za(a.status,o,a.headers)}let n;try{n=await a.json()}catch{throw new sm}let r=CA.safeParse(n);if(!r.success)throw new sm(r.error.issues.slice(0,5).map(o=>{let i=o.path.join(".");return i.length===0?o.message:`${i}: ${o.message}`}));return r.data}async info(e={}){let t=await this.fetch(AE,e);if(!t.ok){let r=await t.text();throw new Za(t.status,r,t.headers)}let a;try{a=await t.json()}catch{throw new im}let n=MA.safeParse(a);if(!n.success)throw new im(n.error.issues.slice(0,5).map(r=>{let o=r.path.join(".");return o.length===0?r.message:`${o}: ${r.message}`}));return n.data}async fetch(e,t={}){let a=yr(b(this,$i),e),n=await Y(this,jo,fm).call(this,Bj(t.headers));return await fetch(a,DA({...t,headers:n},b(this,Wi)))}},Qc=new WeakMap,ed=new WeakMap,$i=new WeakMap,Wi=new WeakMap,jo=new WeakSet,fm=async function(e){let t=new Headers,[a,n]=await Promise.all([Uj(b(this,ed)),Y(this,jo,PA).call(this)]);for(let[r,o]of Object.entries(a))t.set(r,o);for(let[r,o]of Object.entries(n))t.set(r,o);if(e)for(let[r,o]of Object.entries(e))t.set(r,o);return t},PA=async function(){let e=b(this,Qc);if(!e)return{};if("vercelOidc"in e){let t=(await Gv(e.vercelOidc.token)).trim();return t.length===0?{}:{authorization:`Bearer ${t}`,[RA]:t}}if("bearer"in e){let t=(await Gv(e.bearer)).trim();return t.length===0?{}:{authorization:`Bearer ${t}`}}if("basic"in e){let t=await Gv(e.basic.password);return{authorization:`Basic ${IA(e.basic.username,t)}`}}return{}},_A);async function Gv(e){return typeof e=="function"?e():e}async function Uj(e){return e===void 0?{}:typeof e=="function"?await e():e}function Bj(e){return e===void 0?{}:Object.fromEntries(new Headers(e).entries())}function DA(e,t){return t===void 0?e:{...e,redirect:t}}function Kv(){let e=new Set;return{admit(t){let a=t.meta?.id;return a===void 0||!e.has(a)&&(e.add(a),!0)},get size(){return e.size}}}var Gi,Xi,Zr,Ki,td,ad,nd,El,pm,OA,UA=(OA=class{constructor(e,t){ue(this,El);ue(this,Gi,new AbortController);ue(this,Xi,new Set);ue(this,Zr,Promise.withResolvers());K(this,"caughtUp",b(this,Zr).promise);ue(this,Ki,!1);ue(this,td);ue(this,ad);ue(this,nd);this.setOptions(t),this.caughtUp.catch(()=>{}),t.catchUp||b(this,Zr).resolve(),(async()=>{try{for await(let a of bA(e,{signal:b(this,Gi).signal,resolveHeaders:()=>b(this,ad),resolveReconnectPolicy:()=>b(this,nd),startIndex:t.startIndex,onCaughtUp:t.catchUp?()=>b(this,Zr).resolve():void 0})){if(b(this,Gi).signal.aborted)return;t.onEvent(a);for(let n of b(this,Xi))n.push(a);if(a.type==="session.completed"||a.type==="session.failed")break}b(this,Zr).resolve(),Y(this,El,pm).call(this)}catch(a){b(this,Zr).reject(a),Y(this,El,pm).call(this,a),b(this,Gi).signal.aborted||t.onError(a)}})()}subscribe(e){let t=new zj(()=>b(this,Xi).delete(t),e);return b(this,Ki)?t.end(b(this,td)):b(this,Xi).add(t),t}get ended(){return b(this,Ki)}setOptions(e){"headers"in e&&q(this,ad,e.headers),"streamReconnectPolicy"in e&&q(this,nd,e.streamReconnectPolicy)}close(){let e=new DOMException("Session stream was detached.","AbortError");b(this,Gi).abort(e),b(this,Zr).reject(e),Y(this,El,pm).call(this,e)}},Gi=new WeakMap,Xi=new WeakMap,Zr=new WeakMap,Ki=new WeakMap,td=new WeakMap,ad=new WeakMap,nd=new WeakMap,El=new WeakSet,pm=function(e){if(!b(this,Ki)){q(this,Ki,!0),q(this,td,e);for(let t of b(this,Xi))t.end(e)}},OA),Vo,Yi,Zi,Al,rd,NA,zj=(NA=class{constructor(e,t){ue(this,Vo,[]);ue(this,Yi,Promise.withResolvers());ue(this,Zi,!1);ue(this,Al);ue(this,rd);let a=()=>this.end(t?.reason);t?.addEventListener("abort",a,{once:!0}),q(this,rd,()=>{t?.removeEventListener("abort",a),e()}),t?.aborted&&a()}push(e){b(this,Zi)||(b(this,Vo).push(e),b(this,Yi).resolve())}end(e){b(this,Zi)||(q(this,Zi,!0),q(this,Al,e),b(this,Yi).resolve())}[Symbol.dispose](){this.end(),q(this,Vo,[]),b(this,rd).call(this)}discard(){q(this,Vo,[])}async*[Symbol.asyncIterator](){for(;;){for(;b(this,Vo).length>0;)yield b(this,Vo).shift();if(b(this,Zi)){if(b(this,Al)!==void 0)throw b(this,Al);return}q(this,Yi,Promise.withResolvers()),await b(this,Yi).promise}}},Vo=new WeakMap,Yi=new WeakMap,Zi=new WeakMap,Al=new WeakMap,rd=new WeakMap,NA);var $o,Ja,vr,Ml,mm,BA,zA=(BA=class{constructor(e,t){ue(this,Ml);ue(this,$o);ue(this,Ja);ue(this,vr);q(this,$o,e),q(this,Ja,t),q(this,vr,Y(this,Ml,mm).call(this))}get data(){return b(this,vr)}reset(){q(this,Ja,[]),q(this,vr,b(this,$o).initial())}append(e){q(this,Ja,[...b(this,Ja),e]),q(this,vr,b(this,$o).reduce(b(this,vr),e))}remove(e){q(this,Ja,b(this,Ja).filter(t=>!e(t))),q(this,vr,Y(this,Ml,mm).call(this))}replace(e,t){let a=b(this,Ja).findIndex(e);q(this,Ja,a===-1?[...b(this,Ja),t]:b(this,Ja).map((n,r)=>r===a?t:n)),q(this,vr,Y(this,Ml,mm).call(this))}},$o=new WeakMap,Ja=new WeakMap,vr=new WeakMap,Ml=new WeakSet,mm=function(){let e=b(this,$o).initial();for(let t of b(this,Ja))e=b(this,$o).reduce(e,t);return e},BA);function qA(e){let t=e.at(-1);return t!==void 0&&xn(t)&&(t.type!=="session.waiting"||Fj(e).size===0)}function Fj(e){let t=new Set;for(let a of e)Bi(t,a);return t}function Yv(e){if(e.message!==void 0==(e.inputResponses!==void 0))throw Error("A turn requires exactly one of message or inputResponses.")}var FA=0;function HA(){let e=globalThis.crypto?.randomUUID;return e===void 0?(FA+=1,`submission_${FA.toString()}`):e.call(globalThis.crypto)}function od(e,t){return e?AbortSignal.any([e,t]):t}function jA(e){if(typeof e=="string")return e;let t=[];for(let a of e)a.type==="text"?t.push(a.text):a.type==="file"&&t.push(a.filename?`[file: ${a.filename}]`:"[file]");return t.join(`
|
|
141
|
+
`)}function Zv(e){return e instanceof Error&&e.name==="AbortError"}function VA(e){if(e.type!=="session.failed")return;let t=Error(e.data.message);return t.name=e.data.code,t}function Jv(e){let t=Promise.withResolvers(),a=Promise.withResolvers(),n={abortController:new AbortController,acceptedFollowUps:0,cancel:()=>e(n),completion:a.promise,followUpDispatches:new Set,receivedFollowUps:0,receivedFollowUpEvents:new Map,followUpSubmissionIds:new Set,resolveCompletion:a.resolve,response:t.promise,resolveResponse:t.resolve};return n}async function Qv(e,t,a){for(;e.followUpDispatches.size>0;)await Promise.allSettled(e.followUpDispatches);if(!(e.receivedFollowUps>=e.acceptedFollowUps))for await(let n of t){if(!a())return;if(e.receivedFollowUps+=e.receivedFollowUpEvents.get(n)??0,e.receivedFollowUpEvents.delete(n),xn(n)){for(;e.followUpDispatches.size>0;)await Promise.allSettled(e.followUpDispatches);if(e.receivedFollowUps>=e.acceptedFollowUps)return}}}async function id(e,t){if(t===void 0)return await e;let a=Promise.withResolvers(),n=()=>a.reject(t.reason);t.addEventListener("abort",n,{once:!0}),t.aborted&&n();try{return await Promise.race([a.promise,e])}finally{t.removeEventListener("abort",n)}}var sd,Qn,Sa,Wo,ex,tx,$A,WA=($A=class{constructor(e,t){ue(this,Wo);ue(this,sd);ue(this,Qn);ue(this,Sa,[]);q(this,Qn,e),q(this,sd,t)}reset(){q(this,Sa,[])}submit(e,t){if(e.message===void 0)return;let a={createdAt:Date.now(),eventStartIndex:t,id:HA(),message:jA(e.message),requiresDeliveryId:!0};return q(this,Sa,[...b(this,Sa),a]),b(this,sd)&&b(this,Qn).append({data:{createdAt:a.createdAt,message:a.message,submissionId:a.id},type:"client.message.submitted"}),a.id}apply(e){if(e.type!=="message.received"){b(this,Qn).append(e);return}if(e.data.kind==="execution.background_task"){b(this,Qn).append(e);return}let t=Y(this,Wo,ex).call(this,e);if(t.length===0){b(this,Qn).append(e);return}return Y(this,Wo,tx).call(this,t,e,!1)}correlate(e,t,a){if(e===void 0)return;q(this,Sa,b(this,Sa).map(r=>r.id===e?{...r,deliveryId:t,requiresDeliveryId:t!==void 0}:r));let n=b(this,Sa).find(r=>r.id===e);if(n!==void 0)for(let r of a.slice(n.eventStartIndex)){if(r.type!=="message.received"||r.data.kind==="execution.background_task")continue;let o=Y(this,Wo,ex).call(this,r);if(o.some(i=>i.id===e))return Y(this,Wo,tx).call(this,o,r,!0)}}fail(e,t){let a=t===void 0?b(this,Sa)[0]:b(this,Sa).find(n=>n.id===t);a!==void 0&&(q(this,Sa,b(this,Sa).filter(n=>n.id!==a.id)),b(this,Qn).replace(n=>n.type==="client.message.submitted"&&n.data.submissionId===a.id,{data:{createdAt:a.createdAt,error:{message:e.message},message:a.message,submissionId:a.id},type:"client.message.failed"}))}failAll(e){for(let t of b(this,Sa))this.fail(e,t.id)}},sd=new WeakMap,Qn=new WeakMap,Sa=new WeakMap,Wo=new WeakSet,ex=function(e){return b(this,Sa).filter(t=>t.deliveryId===void 0?!t.requiresDeliveryId:e.meta.deliveryIds?.includes(t.deliveryId)===!0)},tx=function(e,t,a){let n=e.map(o=>o.id),r=new Set(n);return q(this,Sa,b(this,Sa).filter(o=>!r.has(o.id))),a||b(this,Qn).replace(o=>o.type==="client.message.submitted"&&o.data.submissionId===n[0],t),b(this,Qn).remove(o=>o.type==="client.message.submitted"&&r.has(o.data.submissionId)),{alreadyProjected:a,event:t,ids:n}},$A);var qj=Symbol("detachEveAgentStore"),Hj=Symbol("attachEveAgentStore"),Go,Dl,_l,Qa,Xo,Ji,ld,Ko,Pl,Ol,_t,ha,It,Aa,en,Nn,er,Qi,xr,xt,Yo,mt,se,ax,XA,KA,YA,Rl,nx,rx,Ia,ZA,JA,hm,ox,ix,Ea,GA,sx=(GA=class{constructor(e){ue(this,se);ue(this,Go);ue(this,Dl);ue(this,_l,!1);ue(this,Qa);ue(this,Xo,new Set);ue(this,Ji);ue(this,ld);ue(this,Ko);ue(this,Pl,new Set);ue(this,Ol,Kv());ue(this,_t);ue(this,ha,{});ue(this,It);ue(this,Aa);ue(this,en);ue(this,Nn,0);ue(this,er);ue(this,Qi);ue(this,xr);ue(this,xt);ue(this,Yo);ue(this,mt,"ready");q(this,Dl,e.prewarm??!1),q(this,Ji,e.session!==void 0),q(this,Go,b(this,Ji)?void 0:new Xv({auth:e.auth,headers:e.headers,host:e.host??""}));let t=[];for(let a of e.initialEvents??[])b(this,Ol).admit(a)&&t.push(a),Bi(b(this,Xo),a);q(this,Aa,t),q(this,Ko,new zA(e.reducer,b(this,Aa))),q(this,ld,e.optimistic??!0),q(this,en,new WA(b(this,Ko),b(this,ld))),q(this,xt,e.session??(e.initialSession===void 0?void 0:b(this,Go)?.sessions.attach(e.initialSession.sessionId,{streamIndex:e.initialSession.streamIndex}))),q(this,Yo,Y(this,se,ix).call(this))}get snapshot(){return b(this,Yo)}setCallbacks(e){q(this,ha,e)}subscribe(e){return b(this,Pl).add(e),()=>{b(this,Pl).delete(e)}}prewarm(){if(b(this,er)!==void 0)return b(this,er);if(b(this,xt)!==void 0||b(this,Ji))return Promise.resolve();if(b(this,_t)!==void 0)return b(this,_t).response.then(o=>{if(o===void 0)throw b(this,It)??new DOMException("Session creation was aborted.","AbortError")});let e=b(this,Go);if(e===void 0)return Promise.reject(Error("This eve agent store does not own a session client."));let t=b(this,Nn),a=new AbortController;q(this,Qi,a);let n=(async()=>{try{let o=await e.sessions.create({signal:a.signal});if(t!==b(this,Nn))return;q(this,xt,o.session),q(this,It,void 0),b(this,mt)==="error"&&q(this,mt,"ready"),b(this,ha).onSessionChange?.(o.session.state),Y(this,se,Ea).call(this),Y(this,se,Rl).call(this)}catch(o){throw t===b(this,Nn)&&b(this,_t)===void 0&&b(this,It)===void 0&&(q(this,It,Ui(o)),q(this,mt,"error"),b(this,ha).onError?.(b(this,It)),Y(this,se,Ea).call(this)),o}})();q(this,er,n);let r=()=>{b(this,er)===n&&(q(this,er,void 0),q(this,Qi,void 0))};return n.then(r,r),n}async send(e){return await Y(this,se,ax).call(this,e,b(this,ha).prepareSend)}resume(){if(b(this,xr)!==void 0)return b(this,xr);let e=Y(this,se,XA).call(this);q(this,xr,e);let t=()=>{b(this,xr)===e&&q(this,xr,void 0)};return e.then(t,t),e}cancel(){let e=b(this,_t);return e===void 0?b(this,mt)==="streaming"&&b(this,xt)!==void 0?b(this,xt).cancel():Promise.resolve({status:"no_active_turn"}):e.cancel()}[Hj](){q(this,_l,!0),b(this,Dl)&&b(this,xt)===void 0&&this.prewarm().catch(()=>{})}[qj](){q(this,_l,!1),b(this,Qa)?.close(),q(this,Qa,void 0),b(this,_t)?.abortController.abort(),Y(this,se,nx).call(this),q(this,xr,void 0)}reset(){b(this,Qa)?.close(),q(this,Qa,void 0),b(this,Xo).clear();let e=b(this,_t);q(this,_t,void 0),e?.resolveResponse(void 0),e?.resolveCompletion(),e?.abortController.abort(),Y(this,se,nx).call(this),q(this,xr,void 0),b(this,Ji)||q(this,xt,void 0),q(this,Aa,[]),q(this,Ol,Kv()),b(this,en).reset(),b(this,Ko).reset(),q(this,It,void 0),q(this,mt,"ready"),b(this,ha).onSessionChange?.(b(this,xt)?.state),Y(this,se,Ea).call(this),b(this,Dl)&&b(this,_l)&&this.prewarm().catch(()=>{})}},Go=new WeakMap,Dl=new WeakMap,_l=new WeakMap,Qa=new WeakMap,Xo=new WeakMap,Ji=new WeakMap,ld=new WeakMap,Ko=new WeakMap,Pl=new WeakMap,Ol=new WeakMap,_t=new WeakMap,ha=new WeakMap,It=new WeakMap,Aa=new WeakMap,en=new WeakMap,Nn=new WeakMap,er=new WeakMap,Qi=new WeakMap,xr=new WeakMap,xt=new WeakMap,Yo=new WeakMap,mt=new WeakMap,se=new WeakSet,ax=async function(e,t){if(b(this,_t)!==void 0){if(b(this,mt)==="resuming")throw Error("eve session is resuming.");return await Y(this,se,KA).call(this,b(this,_t),e,t)}let a=Jv(r=>r.acceptedFollowUps>0&&b(this,xt)!==void 0?b(this,xt).cancel():r.response.then(o=>o===void 0?{status:"no_active_turn"}:o.cancel()));q(this,_t,a),q(this,It,void 0),q(this,mt,"submitted"),Y(this,se,Ea).call(this);let n;try{let r=await(t===void 0?e:id(Promise.resolve(t(e)),od(e.signal,a.abortController.signal)));if(Yv(r),!Y(this,se,Ia).call(this,a))return;let o=b(this,en).submit(r,b(this,Aa).length);Y(this,se,ZA).call(this,r),Y(this,se,Ea).call(this);let i={...r,signal:od(r.signal,a.abortController.signal)},s=await Y(this,se,YA).call(this,i),l=s.response;if(n=s.reader,!Y(this,se,Ia).call(this,a))return;a.resolveResponse(l),Y(this,se,hm).call(this,b(this,en).correlate(o,Pv(l),b(this,Aa)))&&Y(this,se,Ea).call(this);for await(let u of XE(l,n)){if(!Y(this,se,Ia).call(this,a))return;a.receivedFollowUps+=a.receivedFollowUpEvents.get(u)??0,a.receivedFollowUpEvents.delete(u)}if(!Y(this,se,Ia).call(this,a)||(await Qv(a,n,()=>Y(this,se,Ia).call(this,a)),!Y(this,se,Ia).call(this,a)))return;q(this,mt,b(this,It)===void 0?"ready":"error")}catch(r){if(!Y(this,se,Ia).call(this,a))return;if(Zv(r))q(this,mt,"ready"),b(this,en).fail(Ui(r));else{let o=b(this,It)!==void 0;b(this,It)??q(this,It,Ui(r)),q(this,mt,"error"),b(this,en).fail(b(this,It)),o||b(this,ha).onError?.(b(this,It))}}finally{n?.[Symbol.dispose](),Y(this,se,rx).call(this,a)}},XA=async function(){if(b(this,mt)==="resuming"||b(this,mt)==="streaming"||b(this,mt)==="submitted")throw Error("eve session is already processing a turn.");if(b(this,xt)===void 0)throw Error("An eve session is required before resuming.");let e=b(this,xt),t=Jv(()=>e.cancel());q(this,_t,t),t.resolveResponse(void 0),q(this,It,void 0),q(this,mt,"resuming"),Y(this,se,Ea).call(this);let a;try{let n=Y(this,se,Rl).call(this,{catchUp:!0,startIndex:b(this,Aa).length===e.state.streamIndex?e.state.streamIndex:0});if(a=n.subscribe(t.abortController.signal),await n.caughtUp,!Y(this,se,Ia).call(this,t))return;a.discard();let r=b(this,Aa).at(-1);if(r!==void 0&&Y(this,se,ox).call(this,r),r!==void 0&&b(this,It)===void 0&&!qA(b(this,Aa))){q(this,mt,"streaming"),Y(this,se,Ea).call(this);for await(let o of a){if(!Y(this,se,Ia).call(this,t))return;if(t.receivedFollowUps+=t.receivedFollowUpEvents.get(o)??0,t.receivedFollowUpEvents.delete(o),xn(o)&&b(this,Xo).size===0)break}}await Qv(t,a,()=>Y(this,se,Ia).call(this,t)),Y(this,se,Ia).call(this,t)&&q(this,mt,b(this,It)===void 0?"ready":"error")}catch(n){if(!Y(this,se,Ia).call(this,t))return;Zv(n)?q(this,mt,"ready"):(q(this,It,Ui(n)),q(this,mt,"error"),b(this,ha).onError?.(b(this,It)))}finally{a?.[Symbol.dispose](),Y(this,se,rx).call(this,t)}},KA=async function(e,t,a){if(t.message===void 0||t.turnPolicy!=="steer")throw Error('eve session is already processing a turn. Send a message with turnPolicy: "steer" to guide it at the next boundary.');let n=b(this,Nn),r=od(t.signal,e.abortController.signal),o=await id(Promise.resolve(a?.(t)),r)??t;if(n!==b(this,Nn))return;if(Yv(o),o.message===void 0||o.turnPolicy!=="steer")throw Error('An in-flight follow-up requires a message with turnPolicy: "steer".');if(!Y(this,se,Ia).call(this,e))return await Y(this,se,ax).call(this,o);let i=b(this,en).submit(o,b(this,Aa).length);i!==void 0&&e.followUpSubmissionIds.add(i),Y(this,se,Ea).call(this),Y(this,se,Rl).call(this,{headers:o.headers,streamReconnectPolicy:o.streamReconnectPolicy});let s;s=(async()=>{try{let l=od(o.signal,e.abortController.signal);if(await id(e.response,l),!Y(this,se,Ia).call(this,e)||b(this,xt)===void 0)throw Error("The active eve turn ended before the follow-up could be sent.");let{message:u,...c}=o,d=await b(this,xt).send(u,{...c,signal:l});e.acceptedFollowUps+=1,Y(this,se,hm).call(this,b(this,en).correlate(i,Pv(d),b(this,Aa)))&&Y(this,se,Ea).call(this)}catch(l){throw Y(this,se,Ia).call(this,e)&&(b(this,en).fail(Ui(l),i),Y(this,se,Ea).call(this)),l}finally{e.followUpDispatches.delete(s)}})(),e.followUpDispatches.add(s),await s,await e.completion},YA=async function(e){let t={headers:e.headers,streamReconnectPolicy:e.streamReconnectPolicy};if(b(this,er)!==void 0&&(await id(b(this,er).catch(n=>{if(b(this,xt)!==void 0)throw n}),e.signal),e.signal?.throwIfAborted()),b(this,xt)===void 0){if(b(this,Go)===void 0)throw Error("An external eve session is required before sending.");if(e.message===void 0)throw Error("Cannot answer an input request before the session starts.");let n=await b(this,Go).sessions.create({...e,message:e.message});return e.signal?.throwIfAborted(),q(this,xt,n.session),b(this,ha).onSessionChange?.(n.session.state),Y(this,se,Ea).call(this),{response:n.response,reader:Y(this,se,Rl).call(this,t).subscribe(e.signal)}}let a=Y(this,se,Rl).call(this,t).subscribe(e.signal);try{if(e.inputResponses===void 0){let{message:o,...i}=e;return{response:await b(this,xt).send(o,i),reader:a}}let{inputResponses:n,...r}=e;return{response:await b(this,xt).respond(n,r),reader:a}}catch(n){throw a[Symbol.dispose](),n}},Rl=function(e={}){if(b(this,Qa)!==void 0&&!b(this,Qa).ended)return b(this,Qa).setOptions(e),b(this,Qa);if(b(this,xt)===void 0)throw Error("A session is required before opening its stream.");let t=b(this,xt),a=b(this,Nn);return q(this,Qa,new UA(t,{...e,onEvent:n=>{a===b(this,Nn)&&Y(this,se,JA).call(this,n)},onError:n=>{a===b(this,Nn)&&(q(this,Qa,void 0),b(this,_t)===void 0&&(q(this,It,Ui(n)),q(this,mt,"error"),b(this,ha).onError?.(b(this,It)),Y(this,se,Ea).call(this)))}})),b(this,Qa)},nx=function(){q(this,Nn,b(this,Nn)+1),b(this,Qi)?.abort(),q(this,Qi,void 0),q(this,er,void 0)},rx=function(e){if(Y(this,se,Ia).call(this,e)){e.resolveResponse(void 0),q(this,_t,void 0);try{b(this,ha).onSessionChange?.(b(this,xt)?.state),Y(this,se,Ea).call(this),b(this,ha).onFinish?.(b(this,Yo))}finally{e.resolveCompletion()}}},Ia=function(e){return b(this,_t)===e},ZA=function(e){e.inputResponses!==void 0&&e.inputResponses.length!==0&&b(this,Ko).append({data:{createdAt:Date.now(),responses:e.inputResponses},type:"client.input.responded"})},JA=function(e){if(!b(this,Ol).admit(e))return;let t=b(this,mt)==="streaming";Bi(b(this,Xo),e),q(this,Aa,[...b(this,Aa),e]),Y(this,se,hm).call(this,b(this,en).apply(e)),b(this,ha).onEvent?.(e),Y(this,se,ox).call(this,e);let a=xn(e)&&b(this,Xo).size===0;b(this,mt)!=="resuming"&&b(this,It)===void 0&&("data"in e&&"turnId"in e.data&&q(this,mt,"streaming"),b(this,_t)===void 0&&a&&q(this,mt,"ready")),b(this,ha).onSessionChange?.(b(this,xt)?.state),b(this,mt)!=="resuming"&&Y(this,se,Ea).call(this),b(this,_t)===void 0&&t&&a&&b(this,ha).onFinish?.(b(this,Yo))},hm=function(e){if(e===void 0)return!1;let t=0;for(let a of e.ids)b(this,_t)?.followUpSubmissionIds.delete(a)&&(t+=1);if(t>0&&b(this,_t)!==void 0)if(e.alreadyProjected)b(this,_t).receivedFollowUps+=t;else{let a=b(this,_t).receivedFollowUpEvents.get(e.event)??0;b(this,_t).receivedFollowUpEvents.set(e.event,a+t)}return!0},ox=function(e){let t=VA(e);t!==void 0&&(q(this,mt,"error"),b(this,en).failAll(t),b(this,It)===void 0&&(q(this,It,t),b(this,ha).onError?.(t)))},ix=function(){return{data:b(this,Ko).data,error:b(this,It),events:b(this,Aa),session:b(this,xt)?.state,status:b(this,mt)}},Ea=function(){q(this,Yo,Y(this,se,ix).call(this));for(let e of b(this,Pl))e()},GA);function jj(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Vj(e){let t=new AbortController;for(let a of e){if(a.aborted)return t.abort(a.reason),t.signal;a.addEventListener("abort",()=>t.abort(a.reason),{once:!0,signal:t.signal})}return t.signal}function QA(){"withResolvers"in Promise||Object.defineProperty(Promise,"withResolvers",{value:jj,configurable:!0,writable:!0}),"any"in AbortSignal||Object.defineProperty(AbortSignal,"any",{value:Vj,configurable:!0,writable:!0})}var $j=3e4;function Wj(){let e=crypto.getRandomValues(new Uint8Array(32));return btoa(String.fromCharCode(...e)).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function ux(e){let t=e.channelId??"";return e.threadId===void 0?t:`${t}:${e.threadId}`}function lx(e){return`waniwani:eve-conversation:${e}`}function cx(e){try{let t=JSON.parse(localStorage.getItem(lx(e))??"null");return typeof t=="object"&&t!==null&&"conversationId"in t&&typeof t.conversationId=="string"&&"ownerSecret"in t&&typeof t.ownerSecret=="string"?{conversationId:t.conversationId,ownerSecret:t.ownerSecret}:null}catch{return null}}function Ul(e,t){try{t?localStorage.setItem(lx(e),JSON.stringify(t)):localStorage.removeItem(lx(e))}catch{}}function eM(e){return JSON.stringify(e).replace(/[\u007f-\uffff]/g,t=>`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`)}function Gj(e){return{...e.documents?.length?{"x-waniwani-documents":eM(e.documents)}:{},...e.extra&&Object.keys(e.extra).length>0?{"x-waniwani-extra":eM(e.extra)}:{}}}var Xj={initial:()=>{},reduce:()=>{}},Nl=class e{constructor(t,a,n){this.open=t;this.secret=a;K(this,"grant");K(this,"refreshing",null);K(this,"store");K(this,"forward");K(this,"caughtUp");K(this,"used",!1);this.grant=n,QA(),this.store=new sx({host:n.eveHost,auth:{bearer:()=>this.bearer()},initialSession:{sessionId:n.sessionId,streamIndex:0},optimistic:!1,reducer:Xj}),this.store.setCallbacks({onEvent:r=>this.forward?.(r)}),this.caughtUp=this.store.resume().catch(()=>{})}static async create(t){let a=Wj(),n=await t.open({operation:"create",requestId:crypto.randomUUID(),ownerSecret:a,channelId:t.channelId,visitorId:t.visitorId});return n?await new e(t.open,a,n).reachable():null}static async resume(t){let a=await t.open({operation:"resume",...t.saved});return a?await new e(t.open,t.saved.ownerSecret,a).reachable():null}async reachable(){return await this.caughtUp,this.store.snapshot.error===void 0?this:(this.close(),null)}get sessionId(){return this.grant.sessionId}get saved(){return{conversationId:this.grant.conversationId,ownerSecret:this.secret}}get followups(){return this.grant.followups}async history(){await this.caughtUp;let{events:t}=this.store.snapshot;return this.used||(this.used=t.some(a=>a.type==="message.received")),t}async bearer(){return this.grant.expiresAt-$j>Date.now()?this.grant.accessToken:(this.refreshing??(this.refreshing=this.open({operation:"refresh",conversationId:this.grant.conversationId,ownerSecret:this.secret}).then(t=>{if(!t)throw new Error("The conversation left the direct runtime");return this.grant=t,t.accessToken}).finally(()=>{this.refreshing=null})),await this.refreshing)}turn(t,a,n){this.used=!0;let r=()=>{this.store.cancel()};return n?.addEventListener("abort",r,{once:!0}),new ReadableStream({start:async i=>{let s=!1;this.forward=u=>{s||(s=u.type==="turn.failed"||u.type==="session.failed"),i.enqueue(u)},await this.caughtUp;let l=await this.store.send({message:t,signal:n,headers:Gj(a)}).then(()=>this.store.snapshot.error,u=>u instanceof Error?u:new Error(String(u)));this.forward=void 0,n?.removeEventListener("abort",r),l&&!s&&!n?.aborted&&i.enqueue({type:"session.failed",data:{code:"transport_failed",message:l.message,sessionId:this.sessionId}}),i.close()}}).pipeThrough(om())}close(){this.forward=void 0,this.store.reset()}};function Bl(e,t){let a=e[t];return typeof a=="string"&&a?a:void 0}function Kj(e){let t=e.visitor;return typeof t=="object"&&t!==null&&"id"in t&&typeof t.id=="string"?t.id:void 0}function Yj(e){return e.filter(t=>t.role==="user").map(t=>t.parts.flatMap(a=>a.type==="text"?[a.text]:[]).join(`
|
|
142
|
+
`))}function tM(e){return fetch(new URL(e.path,new URL(e.sessionApi,location.href)),{method:"POST",headers:{...e.headers(),"content-type":"application/json"},body:JSON.stringify(e.body),cache:"no-store",signal:e.signal})}function Zj(e){return async t=>{let a=await tM({...e,path:"followups",body:t,signal:AbortSignal.timeout(8e3)}),n=a.ok?await a.json():null,r=typeof n=="object"&&n!==null&&"data"in n?n.data:null,o=typeof r=="object"&&r!==null&&"suggestions"in r?r.suggestions:null;return Array.isArray(o)?o.filter(i=>typeof i=="string"):[]}}function Jj(e){let t="",a=!1,n=new Set;return new TransformStream({async transform(r,o){if(r.type==="text-delta"&&(t+=r.delta),r.type==="tool-input-available"&&n.add(r.toolName),r.type==="error"&&(a=!0),r.type==="finish"&&!a&&!e.signal?.aborted&&t.trim()){let i=await e.suggest(t,[...n]).catch(()=>[]);i.length>0&&o.enqueue({type:"data-suggestions",data:{suggestions:i}})}o.enqueue(r)}})}function Qj(e){return async t=>{let a=await tM({...e,path:e.sessionApi,body:t});if(!a.ok)throw new Error(`Opening the chat failed (${a.status})`);let n=await a.json(),r=typeof n=="object"&&n!==null&&"data"in n?n.data:null;if(typeof r!="object"||r===null||!("transport"in r))throw new Error("The session route answered no transport");if(r.transport!=="eve-native")return null;let o={...r},i=o.session,s=typeof i=="object"&&i!==null&&"sessionId"in i?i.sessionId:void 0,l=Bl(o,"conversationId"),u=Bl(o,"eveHost"),c=Bl(o,"accessToken"),d=Date.parse(Bl(o,"expiresAt")??"");if(!l||!u||!c||typeof s!="string"||Number.isNaN(d))throw new Error("The session route answered an incomplete session");return{conversationId:l,eveHost:u,sessionId:s,accessToken:c,expiresAt:d,followups:o.followups===!0}}}function eV(e){let t=e.extra;return typeof t=="object"&&t!==null&&!Array.isArray(t)?Object.fromEntries(Object.entries(t)):void 0}var dx=class{constructor(t){this.options=t;K(this,"pending");K(this,"threadOnFallback",!1);K(this,"generation",0)}get channelId(){return Bl(this.options.body(),"channelId")}key(){return ux({channelId:this.channelId,threadId:this.options.threadId()})}keepsSession(){return this.options.open!==void 0}prepare(){this.open(this.options.hasMessages())}open(t){this.options.open&&(this.pending??(this.pending=this.start(this.options.open,t)))}async restore(){let{open:t}=this.options;if(!t||this.options.threadHistory())return[];let a=this.key(),n=cx(a);if(!n)return[];let r=this.generation,o=Nl.resume({open:t,saved:n}).catch(()=>null).then(s=>this.kept(s,r));this.pending=o;let i=await o;return i?await kE(await i.history()):(Ul(a,null),this.pending===o&&(this.pending=void 0),[])}reset(){Ul(this.key(),null),this.dispose()}forget(t){Ul(ux({channelId:this.channelId,threadId:t}),null)}dispose(){this.generation+=1,this.threadOnFallback=!1,this.pending?.then(t=>t?.close()).catch(()=>{}),this.pending=void 0}async start(t,a){let n=this.generation,r=this.key(),o=cx(r);if(o){let u=await Nl.resume({open:t,saved:o}).catch(()=>null);return!u&&n===this.generation&&Ul(r,null),this.kept(u,n)}if(a)return null;let i=this.options.body(),s=await Nl.create({open:t,channelId:Bl(i,"channelId"),visitorId:Kj(i)}),l=this.kept(s,n);return n===this.generation&&Ul(r,l?.saved??null),l}kept(t,a){return t&&a!==this.generation?(t.close(),null):t}async sendMessages(t){let a=t.messages.filter(m=>m.role==="user").length<=1;a&&(this.threadOnFallback=!1);let r=[...t.messages].reverse().find(m=>m.role==="user")?.parts.some(m=>m.type==="file")??!1;if(this.threadOnFallback||r||!this.options.open)return this.threadOnFallback=!0,await this.options.fallback.sendMessages(t);this.open(!a);let o=await this.pending?.catch(()=>null);if(o?.used&&a&&(this.reset(),this.open(!1),o=await this.pending?.catch(()=>null)),!o)return this.threadOnFallback=!0,await this.options.fallback.sendMessages(t);this.options.onSession(o.sessionId);let{documents:i}=this.options.takeTurnInput(),s=Yj(t.messages),l=s.at(-1)??"",u=l.trim()?l:i?.map(m=>m.filename).join(", ")??l,c=o.turn(u,{documents:i,extra:eV(this.options.body())},t.abortSignal),{suggest:d}=this.options;if(!o.followups||!d)return c;let{saved:p}=o;return c.pipeThrough(Jj({suggest:(m,h)=>d({...p,answerText:m.slice(-8e3),recentUserMessages:s.slice(-3).map(v=>v.slice(-2e3)),toolNames:h.slice(0,20)}),signal:t.abortSignal}))}async reconnectToStream(t){return await this.pending?.catch(()=>null)?null:await this.options.fallback.reconnectToStream(t)}};function aM(e){let t=typeof e=="string"?()=>e:e;return a=>{let n=r=>{let o=t();return o?r(o):void 0};return new dx({...a,get open(){return n(r=>Qj({sessionApi:r,headers:a.headers}))},get suggest(){return n(r=>Zj({sessionApi:r,headers:a.headers}))}})}}function zl(e){let t=(0,gm.useRef)(e);t.current=e;let[a]=(0,gm.useState)(()=>aM(()=>t.current));return a}var nM=j(Ee(),1),rM="(max-width: 639px)";function tV(e){let t=window.matchMedia(rM);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function aV(){return window.matchMedia(rM).matches}function nV(){return!1}function oM(){return(0,nM.useSyncExternalStore)(tV,aV,nV)}var ym=j(Ee(),1);function fx(e,t){return e.find(a=>a.text===t)?.id??null}async function iM(e){let{api:t,token:a,name:n,source:r,sessionId:o,properties:i}=e;if(typeof window>"u"||!t||!a)return;let s=Cc(t);if(s)try{let l=new Date().toISOString(),u=JSON.stringify({sentAt:l,source:{sdk:"@waniwani/sdk",version:"0.1.0"},events:[{id:crypto.randomUUID(),type:"mcp.event",name:n,source:r,timestamp:l,correlation:{visitorId:ma(),sessionId:o},properties:{...i,url:window.location.href},metadata:{}}]});await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:u,keepalive:!0})}catch{}}async function sM(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,promptId:s,origin:l,text:u,index:c}=e;await iM({api:t,token:a,name:"suggestion.clicked",source:o,sessionId:i,properties:{promptId:s,origin:l,text:u,index:c,channelId:n,mode:r}})}function lM(e,t){return t.map(a=>({id:fx(e,a),text:a}))}async function uM(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,prompts:s,origin:l}=e;s.length!==0&&await iM({api:t,token:a,name:"suggestion.shown",source:o,sessionId:i,properties:{prompts:s,count:s.length,origin:l,channelId:n,mode:r}})}function Fl(e){let{widgetEvents:t,api:a,token:n,channelId:r,source:o,mode:i,pagePrompts:s}=e,l=(0,ym.useRef)(e.getSessionId);l.current=e.getSessionId,(0,ym.useEffect)(()=>{if(!(!a||!n))return t.subscribe(u=>{if(u.name==="suggestion.clicked"){let{text:c,origin:d,index:p}=u.properties;sM({api:a,token:n,channelId:r,mode:i,source:o,sessionId:l.current(),promptId:fx(s??[],c),origin:d,text:c,index:p});return}if(u.name==="suggestions.shown"){let{texts:c,origin:d}=u.properties;uM({api:a,token:n,channelId:r,mode:i,source:o,sessionId:l.current(),prompts:lM(s??[],c),origin:d})}})},[t,a,n,r,o,i,s])}var ql=j(Ee(),1),rV=80,oV=50,iV=15e3,cM=500;function Hl(e,t=!0){let[a,n]=(0,ql.useState)(""),r=(0,ql.useRef)(void 0);return(0,ql.useEffect)(()=>{if(!t){n("");return}let o=0,i=!1,s=!1,l=()=>{s||(i?(o--,n(e.slice(0,o)),o<=0?(i=!1,r.current=setTimeout(l,cM)):r.current=setTimeout(l,oV)):(o++,n(e.slice(0,o)),o>=e.length?(i=!0,r.current=setTimeout(l,iV)):r.current=setTimeout(l,rV)))};return r.current=setTimeout(l,cM),()=>{s=!0,clearTimeout(r.current)}},[e,t]),a}var tr=j(Ee(),1);var dM=["en","fr","es"];function jl(e){return dM.includes(e)}function px(e){if(e&&jl(e))return e;if(e){let a=e.split("-")[0]?.toLowerCase();if(a&&jl(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(jl(n))return n;let r=n.split("-")[0];if(r&&jl(r))return r}return"en"}var wm={promptInput:{placeholder:"What would you like to know?",uploadFiles:"Upload files",uploadFilesUpTo:"Upload a document, up to {limit}",uploadFilesUpToWithPages:"Upload a document, up to {limit} and {pages} pages",stop:"Stop",submit:"Submit",removeAttachments:"Remove all attachments",removeAttachment:"Remove attachment",uploading:"Uploading\u2026",retry:"Retry",retryUpload:"Retry the upload",uploadFailed:"The upload did not finish.",dropToAttach:"Drop to attach",errorAccept:"{name} is not a file type this chat accepts.",errorTooLarge:"{name} is larger than {limit}.",errorTooMany:"You can attach up to {limit} files."},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",kindPdf:"PDF",kindImage:"Image",kindFile:"File",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 fM={promptInput:{placeholder:"\xBFQu\xE9 te gustar\xEDa saber?",uploadFiles:"Subir archivos",uploadFilesUpTo:"Subir un documento, hasta {limit}",uploadFilesUpToWithPages:"Subir un documento, hasta {limit} y {pages} p\xE1ginas",stop:"Detener",submit:"Enviar",removeAttachments:"Eliminar todos los archivos adjuntos",removeAttachment:"Quitar archivo",uploading:"Subiendo\u2026",retry:"Reintentar",retryUpload:"Reintentar la subida",uploadFailed:"La subida no se complet\xF3.",dropToAttach:"Suelta para adjuntar",errorAccept:"{name} no es un tipo de archivo que acepte este chat.",errorTooLarge:"{name} supera {limit}.",errorTooMany:"Puedes adjuntar hasta {limit} archivos."},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",kindPdf:"PDF",kindImage:"Imagen",kindFile:"Archivo",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 pM={promptInput:{placeholder:"Que souhaitez-vous savoir ?",uploadFiles:"Importer des fichiers",uploadFilesUpTo:"Joindre un document, jusqu'\xE0 {limit}",uploadFilesUpToWithPages:"Envoyer un document, jusqu'\xE0 {limit} et {pages} pages",stop:"Arr\xEAter",submit:"Envoyer",removeAttachments:"Supprimer toutes les pi\xE8ces jointes",removeAttachment:"Retirer la pi\xE8ce jointe",uploading:"Envoi en cours\u2026",retry:"R\xE9essayer",retryUpload:"R\xE9essayer l'envoi",uploadFailed:"L'envoi ne s'est pas termin\xE9.",dropToAttach:"D\xE9posez pour joindre",errorAccept:"{name} n'est pas un type de fichier accept\xE9 par ce chat.",errorTooLarge:"{name} d\xE9passe {limit}.",errorTooMany:"Vous pouvez joindre jusqu'\xE0 {limit} fichiers."},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",kindPdf:"PDF",kindImage:"Image",kindFile:"Fichier",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 mx={en:wm,fr:pM,es:fM};var hM=j(me(),1),mM=(0,tr.createContext)(null);function sV(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 es({children:e,locale:t,messages:a}){let n=!!(t&&lV(t)),r=n?t:"en",[o,i]=(0,tr.useState)(r),[s,l]=(0,tr.useState)(n);(0,tr.useEffect)(()=>{i(px(t)),l(!0)},[t]);let u=(0,tr.useMemo)(()=>{let c=mx[o]??mx["en"];return{locale:o,t:sV(c,a),ready:s}},[o,a,s]);return(0,hM.jsx)(mM.Provider,{value:u,children:e})}function lV(e){return e==="en"||e==="fr"||e==="es"}function Ue(){let e=(0,tr.useContext)(mM);return e||{locale:"en",t:wm,ready:!0}}function hx(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 Qe=j(Ee(),1);var ud=(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 Be=j(Ee(),1);var ts=new Map;function gM(e,t){if(ts.has(e)){URL.revokeObjectURL(t);return}for(ts.set(e,t);ts.size>20;){let a=ts.keys().next();if(a.done)return;let n=ts.get(a.value);ts.delete(a.value),n&&URL.revokeObjectURL(n)}}function yM(e){return ts.get(e)}var wM=j(me(),1),br=({className:e,variant:t="default",size:a="default",type:n="button",...r})=>(0,wM.jsx)("button",{type:n,className:V("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 vM=j(Ee(),1);var Bt=j(me(),1),xM=({files:e,className:t,...a})=>e.length===0?null:(0,Bt.jsx)("div",{className:V("ww:flex ww:flex-wrap ww:gap-1.5",t),...a,children:e.map((n,r)=>(0,Bt.jsx)(uV,{file:n},r))});function uV({file:e}){let{t}=Ue();return e.mediaType?.startsWith("image/")&&e.url?(0,Bt.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,Bt.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,Bt.jsx)(vl,{className:"ww:size-3 ww:shrink-0"}),(0,Bt.jsx)("span",{className:"ww:max-w-24 ww:truncate",children:e.filename??t.attachments.fileFallback})]})}function bM(e,t){return e.startsWith("image/")?t.attachments.kindImage:e==="application/pdf"?t.attachments.kindPdf:t.attachments.kindFile}function cV({mediaType:e}){return e.startsWith("image/")?(0,Bt.jsx)(Dc,{className:"ww:size-5 ww:text-muted-foreground"}):e==="application/pdf"?(0,Bt.jsx)(Mc,{className:"ww:size-5 ww:text-muted-foreground"}):(0,Bt.jsx)(vl,{className:"ww:size-5 ww:text-muted-foreground"})}function gx({filename:e,mediaType:t,previewUrl:a,subtitle:n,tone:r="default",children:o,className:i}){let{t:s}=Ue(),l=bM(t,s);return(0,Bt.jsxs)("li",{"aria-label":`${e}, ${l}`,className:V("ww:relative ww:flex ww:w-60 ww:max-w-full ww:cursor-default ww:items-center ww:gap-2.5 ww:overflow-hidden ww:rounded-xl ww:border ww:bg-background ww:p-2.5",r==="error"?"ww:border-destructive/50":"ww:border-border",i),children:[(0,Bt.jsx)("span",{className:"ww:flex ww:size-10 ww:shrink-0 ww:items-center ww:justify-center ww:overflow-hidden ww:rounded-xl ww:bg-muted",children:a?(0,Bt.jsx)("img",{alt:"",className:"ww:size-full ww:object-cover ww:object-center",src:a}):(0,Bt.jsx)(cV,{mediaType:t})}),(0,Bt.jsxs)("span",{className:"ww:flex ww:min-w-0 ww:flex-col",children:[(0,Bt.jsx)("span",{className:"ww:truncate ww:font-medium ww:text-sm",title:e,children:e}),(0,Bt.jsx)("span",{className:V("ww:truncate ww:text-xs",r==="error"?"ww:text-destructive":"ww:text-muted-foreground"),children:n??l})]}),o]})}function SM(e){if(typeof e!="object"||e===null)return[];let t=e.documents;return Array.isArray(t)?t.filter(a=>typeof a=="object"&&a!==null&&typeof a.documentId=="string"&&typeof a.filename=="string"&&typeof a.mediaType=="string"):[]}var IM=({documents:e,className:t,...a})=>e.length===0?null:(0,Bt.jsx)("ul",{className:V("ww:flex ww:list-none ww:flex-wrap ww:items-end ww:justify-end ww:gap-2 ww:p-0",t),...a,children:e.map((n,r)=>(0,Bt.jsx)(dV,{document:n},`${n.documentId}-${r}`))});function dV({document:e}){let{t}=Ue(),[a,n]=(0,vM.useState)(!1),r=e.mediaType.startsWith("image/")?yM(e.documentId):void 0;return r&&!a?(0,Bt.jsx)("li",{children:(0,Bt.jsx)("img",{alt:`${e.filename}, ${bM(e.mediaType,t)}`,className:"ww:max-h-80 ww:max-w-72 ww:rounded-xl ww:border ww:border-border ww:object-contain",onError:()=>n(!0),src:r,title:e.filename})}):(0,Bt.jsx)(gx,{filename:e.filename,mediaType:e.mediaType})}var Et=j(me(),1),fV=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}},pV=(e,t)=>{if(!t)return!0;let a=t.split(",").map(o=>o.trim().toLowerCase()).filter(Boolean);if(a.length===0)return!0;let n=e.type.toLowerCase(),r=e.name.toLowerCase();return a.some(o=>o.startsWith(".")?r.endsWith(o):o.endsWith("/*")?n.startsWith(o.slice(0,-1)):n===o)},kM=(0,Be.createContext)(null),vm=()=>{let e=(0,Be.useContext)(kM);if(!e)throw new Error("usePromptInputAttachments must be used within a PromptInput");return e},TM=({className:e,accept:t,multiple:a,globalDrop:n,maxFiles:r,maxFileSize:o,maxPdfPages:i,attachmentsEnabled:s=!0,upload:l,onDiscard:u,onError:c,onSubmit:d,children:p,...m})=>{let{t:h,locale:v}=Ue(),I=(0,Be.useRef)(null),y=(0,Be.useRef)(null),[w,g]=(0,Be.useState)([]),S=(0,Be.useRef)(w),E=(0,Be.useRef)(new Map),T=(0,Be.useRef)(l),R=(0,Be.useRef)(c),O=(0,Be.useRef)(u);(0,Be.useEffect)(()=>{T.current=l,R.current=c,O.current=u},[l,c,u]);let U=(0,Be.useCallback)(x=>{S.current=x,g(x)},[]),A=(0,Be.useCallback)(()=>{I.current?.click()},[]),Q=(0,Be.useCallback)((x,te)=>{U(S.current.map(re=>re.id===x?{...re,...te}:re))},[U]),$=(0,Be.useCallback)((x,te)=>{let re=T.current;if(!re)return;let ke=new AbortController,We=re(te,ke.signal,be=>{Q(x,{progress:be})}).then(be=>(Q(x,{status:"ready",progress:1,documentId:be.documentId,error:void 0}),be)).catch(be=>{if(ke.signal.aborted)return null;let Oe=be instanceof Error?be.message:h.promptInput.uploadFailed;return Q(x,{status:"failed",error:Oe}),R.current?.({code:"upload_failed",message:Oe}),null});E.current.set(x,{file:te,controller:ke,done:We})},[Q,h]),H=(0,Be.useCallback)(x=>{let te=[...x];if(!s||te.length===0)return;let re=(ce,Le)=>R.current?.({code:ce,message:Le}),ke=[];for(let ce of te){if(!pV(ce,t)){re("accept",h.promptInput.errorAccept.replace("{name}",ce.name));continue}if(o&&ce.size>o){re("max_file_size",h.promptInput.errorTooLarge.replace("{name}",ce.name).replace("{limit}",LM(o,v)));continue}ke.push(ce)}if(ke.length===0)return;let We=typeof r=="number"?Math.max(0,r-S.current.length):void 0,be=typeof We=="number"?ke.slice(0,We):ke;if(be.length<ke.length&&re("max_files",h.promptInput.errorTooMany.replace("{limit}",String(r))),be.length===0)return;let Oe=!!T.current,we=be.map(ce=>({file:ce,item:{filename:ce.name,id:ud(),mediaType:ce.type,type:"file",url:URL.createObjectURL(ce),status:Oe?"uploading":"ready",progress:0}}));U([...S.current,...we.map(ce=>ce.item)]);for(let ce of we)$(ce.item.id,ce.file)},[r,o,t,s,$,U,h,v]),Z=(0,Be.useCallback)(x=>{let te=E.current.get(x);te&&(Q(x,{status:"uploading",progress:0,error:void 0}),$(x,te.file))},[Q,$]),X=(0,Be.useCallback)((x,te)=>{E.current.get(x.id)?.controller.abort(),E.current.delete(x.id),x.url&&(!te&&!!x.documentId&&!!x.mediaType?.startsWith("image/")&&x.documentId?gM(x.documentId,x.url):URL.revokeObjectURL(x.url)),te&&x.documentId&&O.current?.({documentId:x.documentId,filename:x.filename??"",mediaType:x.mediaType??""})},[]),B=(0,Be.useCallback)(x=>{let te=S.current.find(re=>re.id===x);te&&X(te,!0),U(S.current.filter(re=>re.id!==x))},[X,U]),P=(0,Be.useCallback)(()=>{for(let x of S.current)X(x,!0);U([])},[X,U]),J=(0,Be.useRef)(s);(0,Be.useEffect)(()=>{let x=J.current;J.current=s,x&&!s&&P()},[s,P]);let ge=(0,Be.useCallback)(()=>{for(let x of S.current)X(x,!1);U([])},[X,U]);(0,Be.useEffect)(()=>()=>{for(let x of S.current)E.current.get(x.id)?.controller.abort(),x.url&&URL.revokeObjectURL(x.url)},[]);let C=(0,Be.useCallback)(x=>{x.currentTarget.files&&H(x.currentTarget.files),x.currentTarget.value=""},[H]);(0,Be.useEffect)(()=>{if(!n)return;let x=re=>{re.dataTransfer?.types?.includes("Files")&&re.preventDefault()},te=re=>{re.dataTransfer?.types?.includes("Files")&&re.preventDefault(),re.dataTransfer?.files&&re.dataTransfer.files.length>0&&H(re.dataTransfer.files)};return document.addEventListener("dragover",x),document.addEventListener("drop",te),()=>{document.removeEventListener("dragover",x),document.removeEventListener("drop",te)}},[H,n]);let ze=(0,Be.useCallback)(async x=>{x.preventDefault();let te=x.currentTarget,re=new FormData(te).get("message")||"",ke=new Map;for(;ke.size<E.current.size;)await Promise.all([...E.current.entries()].filter(([we])=>!ke.has(we)).map(async([we,ce])=>{ke.set(we,await ce.done)}));for(let we of ke.keys())E.current.has(we)||ke.delete(we);if([...ke.values()].some(we=>we===null)){R.current?.({code:"upload_failed",message:h.promptInput.uploadFailed});return}let We=[...ke.values()].filter(we=>we!==null),be=T.current?[]:S.current,Oe=await Promise.all(be.map(async({id:we,status:ce,progress:Le,error:ie,...xe})=>{if(xe.url?.startsWith("blob:")){let Ne=await fV(xe.url);return{...xe,url:Ne??xe.url}}return xe}));try{let we=d({documents:We,files:Oe,text:re},x);we instanceof Promise&&await we,te.reset(),ge()}catch{}},[d,ge,h]),ot=(0,Be.useMemo)(()=>({add:H,clear:P,files:w,openFileDialog:A,remove:B,retry:Z,maxFileSize:o,maxPdfPages:i}),[w,H,B,Z,P,A,o,i]);return(0,Et.jsxs)(kM.Provider,{value:ot,children:[(0,Et.jsx)("input",{accept:t,"aria-label":h.promptInput.uploadFiles,className:"ww:hidden",multiple:a,onChange:C,ref:I,title:h.promptInput.uploadFiles,type:"file"}),(0,Et.jsx)("form",{className:V("ww:relative ww:flex ww:w-full ww:flex-col ww:rounded-lg ww:border ww:border-border ww:bg-background",e),onSubmit:ze,ref:y,...m,children:p})]})},CM=1024*1024;function LM(e,t){let a=e>=CM;return new Intl.NumberFormat(t,{style:"unit",unit:a?"megabyte":"kilobyte",maximumFractionDigits:0}).format(a?e/CM:Math.max(1,e/1024))}var EM=({onChange:e,onKeyDown:t,className:a,placeholder:n,...r})=>{let{t:o}=Ue(),i=vm(),[s,l]=(0,Be.useState)(!1),u=n??o.promptInput.placeholder,c=(0,Be.useCallback)(p=>{if(t?.(p),!p.defaultPrevented){if(p.key==="Enter"){if(s||p.nativeEvent.isComposing||p.shiftKey)return;p.preventDefault();let{form:m}=p.currentTarget;if(m?.querySelector('[data-submit-blocked="true"]')||m?.querySelector('button[type="submit"]')?.disabled)return;m?.requestSubmit()}if(p.key==="Backspace"&&p.currentTarget.value===""&&i.files.length>0){p.preventDefault();let m=i.files.at(-1);m&&i.remove(m.id)}}},[t,s,i]),d=(0,Be.useCallback)(p=>{let m=p.clipboardData?.items;if(!m)return;let h=[];for(let v of m)if(v.kind==="file"){let I=v.getAsFile();I&&h.push(I)}h.length>0&&(p.preventDefault(),i.add(h))},[i]);return(0,Et.jsx)("textarea",{className:V("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:()=>l(!1),onCompositionStart:()=>l(!0),onKeyDown:c,onPaste:d,placeholder:u,onChange:e,...r})},AM=({className:e,status:t,onStop:a,onClick:n,children:r,disabled:o,...i})=>{let{t:s}=Ue(),l=t==="submitted"||t==="streaming",u=l&&a!==void 0,c=(0,Et.jsx)(pr,{className:"ww:size-4"});t==="submitted"?c=(0,Et.jsx)(_c,{className:"ww:size-4 ww:animate-spin"}):t==="streaming"&&(c=(0,Et.jsx)(Pc,{className:"ww:size-4"}));let d=(0,Be.useCallback)(p=>{if(l&&a){p.preventDefault(),a();return}n?.(p)},[l,a,n]);return(0,Et.jsx)(br,{"aria-label":l?s.promptInput.stop:s.promptInput.submit,className:V("ww:bg-foreground ww:text-background ww:hover:bg-foreground ww:rounded-full",e),"data-submit-blocked":o?"true":void 0,disabled:u?!1:o,onClick:d,size:"icon-sm",type:u?"button":"submit",variant:"ghost",...i,children:r??c})},MM=({className:e,children:t,...a})=>{let{t:n,locale:r}=Ue(),o=vm();if(o.files.length>0)return(0,Et.jsxs)(br,{className:V("ww:group ww:relative",e),onClick:()=>o.clear(),size:"icon-sm",type:"button",variant:"ghost","aria-label":n.promptInput.removeAttachments,...a,children:[(0,Et.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:o.files.length}),(0,Et.jsx)(wn,{className:"ww:absolute ww:size-4 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100"})]});let s=o.maxFileSize?(o.maxPdfPages?n.promptInput.uploadFilesUpToWithPages.replace("{pages}",String(o.maxPdfPages)):n.promptInput.uploadFilesUpTo).replace("{limit}",LM(o.maxFileSize,r)):n.promptInput.uploadFiles;return(0,Et.jsx)(br,{"aria-label":s,className:V(e),title:s,onClick:()=>o.openFileDialog(),size:"icon-sm",type:"button",variant:"ghost",...a,children:t??(0,Et.jsx)(xl,{className:"ww:size-4"})})},RM=({className:e,...t})=>{let a=vm();return a.files.length===0?null:(0,Et.jsx)("ul",{className:V("ww:flex ww:list-none ww:flex-wrap ww:gap-2 ww:p-0",e),...t,children:a.files.map(n=>(0,Et.jsx)(mV,{file:n},n.id))})};function mV({file:e}){let{t}=Ue(),a=vm(),n=e.status==="failed",r=e.status==="uploading";return(0,Et.jsxs)(gx,{filename:e.filename??t.attachments.fileFallback,mediaType:e.mediaType??"",previewUrl:e.mediaType?.startsWith("image/")?e.url:void 0,subtitle:n?e.error:r?t.promptInput.uploading:void 0,tone:n?"error":"default",children:[n?(0,Et.jsx)("button",{"aria-label":t.promptInput.retryUpload,className:"ww:ml-auto ww:shrink-0 ww:text-destructive ww:text-xs ww:underline ww:underline-offset-2",onClick:()=>a.retry(e.id),type:"button",children:t.promptInput.retry}):null,(0,Et.jsx)("button",{"aria-label":t.promptInput.removeAttachment,className:V("ww:shrink-0 ww:rounded-full ww:p-1 ww:opacity-60 ww:transition-opacity hover:ww:bg-muted hover:ww:opacity-100",n?null:"ww:ml-auto"),onClick:()=>a.remove(e.id),type:"button",children:(0,Et.jsx)(wn,{className:"ww:size-3.5"})}),r?(0,Et.jsx)("span",{"aria-hidden":!0,className:"ww:absolute ww:bottom-0 ww:left-0 ww:h-0.5 ww:bg-primary ww:transition-[width] ww:duration-200",style:{width:`${Math.round(e.progress*100)}%`}}):null]})}var DM=({enabled:e=!0})=>{let{t}=Ue(),[a,n]=(0,Be.useState)(!1);return(0,Be.useEffect)(()=>{if(!e)return;let r=0,o=u=>!!u.dataTransfer?.types?.includes("Files"),i=u=>{o(u)&&(r+=1,n(!0))},s=u=>{o(u)&&(r=Math.max(0,r-1),r===0&&n(!1))},l=()=>{r=0,n(!1)};return document.addEventListener("dragenter",i),document.addEventListener("dragleave",s),document.addEventListener("drop",l),()=>{document.removeEventListener("dragenter",i),document.removeEventListener("dragleave",s),document.removeEventListener("drop",l)}},[e]),e&&a?(0,Et.jsx)("div",{className:"ww:pointer-events-none ww:absolute ww:inset-0 ww:z-50 ww:flex ww:items-center ww:justify-center ww:rounded-2xl ww:border-2 ww:border-primary ww:border-dashed ww:bg-background/85",children:(0,Et.jsxs)("span",{className:"ww:flex ww:items-center ww:gap-2 ww:text-sm ww:font-medium",children:[(0,Et.jsx)(xl,{className:"ww:size-4"}),t.promptInput.dropToAttach]})}):null};var PM=j(me(),1);function _M({text:e}){let{t}=Ue();return e===!1?null:(0,PM.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 xm=j(Ee(),1);var as=j(me(),1),OM=({className:e,...t})=>(0,as.jsx)("div",{className:V("ww:flex ww:flex-col ww:gap-1 ww:px-3 ww:py-2",e),...t}),NM=({className:e,...t})=>(0,as.jsx)("li",{className:V("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}),UM=({className:e,...t})=>(0,as.jsx)("span",{className:V("ww:inline-block ww:size-2 ww:shrink-0 ww:rounded-full ww:border ww:border-muted-foreground/50",e),...t}),BM=({className:e,...t})=>(0,as.jsx)("span",{className:V("ww:line-clamp-1 ww:grow ww:break-words ww:text-muted-foreground",e),...t}),zM=({className:e,...t})=>(0,as.jsx)("div",{className:V("ww:flex ww:shrink-0 ww:gap-1 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100",e),...t}),FM=({className:e,...t})=>(0,as.jsx)(br,{className:V("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 Un=j(me(),1),qM=(0,xm.memo)(({message:e,onRemove:t})=>{let{t:a}=Ue(),n=(0,xm.useCallback)(()=>t(e.id),[t,e.id]);return(0,Un.jsxs)(NM,{children:[(0,Un.jsx)(UM,{}),(0,Un.jsx)(BM,{children:e.text||a.chatQueue.attachmentFallback}),(0,Un.jsx)(zM,{children:(0,Un.jsx)(FM,{"aria-label":a.chatQueue.removeFromQueue,onClick:n,children:(0,Un.jsx)(wn,{className:"ww:size-3"})})})]})});qM.displayName="ChatQueueItem";function HM({queuedMessages:e,onRemove:t,className:a}){let{t:n}=Ue();return e.length===0?null:(0,Un.jsxs)(OM,{className:V("ww:border-t ww:border-border",a),children:[(0,Un.jsx)("div",{className:"ww:text-[11px] ww:font-medium ww:text-muted-foreground ww:px-2",children:n.chatQueue.queued(e.length)}),(0,Un.jsx)("ul",{children:e.map(r=>(0,Un.jsx)(qM,{message:r,onRemove:t},r.id))})]})}var nn=j(Ee(),1);var zt=j(Ee(),1);Ch();var xU=j(Ee(),1);var bU=j(me(),1),PK=({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,bU.jsx)(e,{"data-waniwani-shimmer":"",className:V("ww:inline-block",t),style:i,...o,children:r})},or=(0,xU.memo)(PK);or.displayName="Shimmer";var Da=j(me(),1),SU=(0,zt.createContext)(null);function IU(){let e=(0,zt.useContext)(SU);if(!e)throw new Error("Reasoning components must be used within <Reasoning>");return e}var OK=1e3,NK=1e3,Ud=(0,zt.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:n,onOpenChange:r,duration:o,children:i,...s})=>{let l=n??t,u=n===!1,c=a!==void 0,[d,p]=(0,zt.useState)(l),m=c?a:d,h=(0,zt.useCallback)(R=>{c||p(R),r?.(R)},[c,r]),[v,I]=(0,zt.useState)(void 0),y=o??v,w=(0,zt.useRef)(t),[g,S]=(0,zt.useState)(!1),E=(0,zt.useRef)(null);(0,zt.useEffect)(()=>{t?(w.current=!0,E.current===null&&(E.current=Date.now())):E.current!==null&&(I(Math.ceil((Date.now()-E.current)/NK)),E.current=null)},[t]),(0,zt.useEffect)(()=>{t&&!m&&!u&&h(!0)},[t,m,u,h]),(0,zt.useEffect)(()=>{if(w.current&&!t&&m&&!g){let R=setTimeout(()=>{h(!1),S(!0)},OK);return()=>clearTimeout(R)}},[t,m,g,h]);let T=(0,zt.useMemo)(()=>({isStreaming:t,isOpen:m,setIsOpen:h,duration:y}),[t,m,h,y]);return(0,Da.jsx)(SU.Provider,{value:T,children:(0,Da.jsx)("div",{className:V("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":m?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...s,children:i})})});Ud.displayName="Reasoning";var Bd=(0,zt.memo)(({className:e,children:t,getThinkingMessage:a,hideIcon:n=!1,onClick:r,...o})=>{let{t:i}=Ue(),{isStreaming:s,isOpen:l,duration:u,setIsOpen:c}=IU(),p=a??((m,h)=>m||h===0?(0,Da.jsx)(or,{duration:1.6,children:i.reasoning.thinking}):h===void 0?(0,Da.jsx)("span",{children:i.reasoning.thoughtBrief}):(0,Da.jsx)("span",{children:i.reasoning.thoughtForSeconds(h)}));return(0,Da.jsx)("button",{type:"button","aria-expanded":l,onClick:m=>{c(!l),r?.(m)},className:V("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,Da.jsxs)(Da.Fragment,{children:[!n&&(0,Da.jsx)(Gr,{className:"ww:size-4 ww:shrink-0"}),p(s,u)]})})});Bd.displayName="ReasoningTrigger";var zd=(0,zt.memo)(({className:e,children:t,...a})=>{let{isOpen:n}=IU();return(0,Da.jsx)("div",{className:V("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,Da.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Da.jsx)("div",{className:V("ww:text-sm ww:text-muted-foreground",e),...a,children:(0,Da.jsx)(au,{children:t})})})})});zd.displayName="ReasoningContent";var Ye=j(me(),1),UK=500,CU=(0,nn.createContext)(null);function kU(){let e=(0,nn.useContext)(CU);if(!e)throw new Error("ChainOfThought components must be used within <ChainOfThought>");return e}function TU({className:e,isWorking:t=!1,activeStep:a,open:n,defaultOpen:r=!1,onOpenChange:o,children:i,...s}){let l=n!==void 0,[u,c]=(0,nn.useState)(r),d=l?n:u,p=(0,nn.useCallback)(I=>{l||c(I),o?.(I)},[l,o]),[m,h]=(0,nn.useState)(!t);(0,nn.useEffect)(()=>{if(t){h(!1);return}let I=setTimeout(()=>h(!0),UK);return()=>clearTimeout(I)},[t]);let v=(0,nn.useMemo)(()=>({open:d,setOpen:p,isWorking:t,settled:m,activeStep:a}),[d,p,t,m,a]);return(0,Ye.jsx)(CU.Provider,{value:v,children:(0,Ye.jsx)("div",{className:V("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"},...s,children:i})})}function LU({className:e,label:t,workingLabel:a,children:n,...r}){let{open:o,setOpen:i,isWorking:s,settled:l,activeStep:u}=kU();if(!l){let c=u?.icon,d=u?.label??a??t??"";return(0,Ye.jsx)("div",{className:V("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,Ye.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,Ye.jsx)(c,{className:V("ww:size-4 ww:shrink-0",s&&"ww:animate-pulse")}),(0,Ye.jsx)("span",{className:"ww:truncate",children:s?(0,Ye.jsx)(or,{duration:2.6,children:d}):d})]},d)})}return(0,Ye.jsxs)("button",{type:"button",onClick:()=>i(!o),"aria-expanded":o,className:V("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,Ye.jsx)("span",{className:"ww:truncate",children:n??t}),(0,Ye.jsx)(zo,{className:V("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",o&&"ww:rotate-180")})]})}function EU({className:e,children:t,...a}){let{open:n}=kU();return(0,Ye.jsx)("div",{className:V("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,Ye.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ye.jsx)("div",{className:V("ww:flex ww:flex-col",e),...a,children:t})})})}function AU({icon:e,isLast:t,running:a,error:n}){return(0,Ye.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:self-stretch",children:[(0,Ye.jsx)("span",{className:"ww:flex ww:h-5 ww:items-center",children:(0,Ye.jsx)(e,{className:V("ww:size-4 ww:shrink-0",n?"ww:text-destructive":a?"ww:animate-pulse ww:text-foreground":"ww:text-muted-foreground")})}),!t&&(0,Ye.jsx)("span",{className:"ww:w-px ww:flex-1 ww:bg-border"})]})}function VS({className:e,icon:t,title:a,state:n,isLast:r=!1,children:o,...i}){let s=n==="input-available"||n==="input-streaming",l=n==="output-error",u=o!=null,[c,d]=(0,nn.useState)(!1),p=a??"",m=s?(0,Ye.jsx)(or,{duration:1.6,children:p}):(0,Ye.jsx)("span",{className:"ww:truncate",children:p});return(0,Ye.jsxs)("div",{className:V("ww:flex ww:gap-2",e),...i,children:[(0,Ye.jsx)(AU,{icon:t,isLast:r,running:s,error:l}),(0,Ye.jsxs)("div",{className:V("ww:min-w-0 ww:flex-1",!r&&"ww:pb-3"),children:[u?(0,Ye.jsxs)("button",{type:"button",onClick:()=>d(h=>!h),"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:[m,(0,Ye.jsx)(zo,{className:V("ww:size-3.5 ww:shrink-0 ww:transition-transform ww:duration-200",c&&"ww:rotate-180")})]}):(0,Ye.jsx)("div",{className:"ww:flex ww:items-center ww:text-sm ww:text-muted-foreground",children:m}),u&&(0,Ye.jsx)("div",{className:V("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,Ye.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ye.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 MU({isStreaming:e=!1,isLast:t=!1,children:a}){return(0,Ye.jsxs)("div",{className:"ww:flex ww:gap-2",children:[(0,Ye.jsx)(AU,{icon:Gr,isLast:t,running:e}),(0,Ye.jsx)("div",{className:V("ww:min-w-0 ww:flex-1",!t&&"ww:pb-3"),children:(0,Ye.jsxs)(Ud,{isStreaming:e,className:"ww:mb-0",children:[(0,Ye.jsx)(Bd,{hideIcon:!0}),(0,Ye.jsx)(zd,{children:a})]})})]})}var $S={name:"cjk-noop",type:"cjk",remarkPluginsBefore:[],remarkPluginsAfter:[],remarkPlugins:[]};var RU={name:"shiki-noop",type:"code-highlighter",supportsLanguage:()=>!1,getSupportedLanguages:()=>[],getThemes:()=>["github-light","github-dark"],highlight:()=>null};var PU=j(Ee(),1);var oo=j(Ee(),1),BK=5,DU=400;function _U(e,t,a={}){let{msPerChar:n=BK}=a,[r,o]=(0,oo.useState)(t?"":e),i=(0,oo.useRef)(e),s=(0,oo.useRef)(t?0:e.length),l=(0,oo.useRef)(0),u=(0,oo.useRef)(null);return(e.length<s.current||!e.startsWith(r.slice(0,s.current)))&&(s.current=t?0:e.length),i.current=e,(0,oo.useEffect)(()=>{if(!t){u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),s.current=e.length,o(e);return}if(i.current.length-s.current>DU&&(s.current=i.current.length-DU),u.current!==null)return;let d=p=>{let m=i.current;if(s.current>=m.length){u.current=null;return}l.current===0&&(l.current=p);let h=p-l.current;if(h>=n){let v=Math.min(Math.floor(h/n),m.length-s.current);s.current+=v,o(m.slice(0,s.current)),l.current=p}u.current=requestAnimationFrame(d)};return u.current=requestAnimationFrame(d),()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}},[e,t,n]),r}var Fd=j(me(),1),WS=({className:e,from:t,children:a,...n})=>(0,Fd.jsx)("div",{className:V("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,Fd.jsx)("div",{className:V("ww:flex ww:min-w-0 ww:flex-col ww:gap-2","ww:w-full"),children:a})}),GS=({children:e,className:t,...a})=>(0,Fd.jsx)("div",{className:V("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}),zK={cjk:$S,code:RU},FK={cjk:$S},qK={enabled:!1};function HK({className:e,linkSafety:t,isStreaming:a,children:n,...r}){let i=_U(typeof n=="string"?n:"",!!a),s=typeof n=="string"?i:n;return(0,Fd.jsx)(au,{className:V("ww:size-full ww:[&>*:first-child]:mt-0 ww:[&>*:last-child]:mb-0",e),linkSafety:t??qK,plugins:a?FK:zK,...r,children:s})}var Ah=(0,PU.memo)(HK,(e,t)=>e.children===t.children&&e.isStreaming===t.isStreaming);Ah.displayName="MessageResponse";var ua=j(Ee(),1);function XS(e){if(!(typeof e!="object"||e===null))return e}function OU(e){return XS(e?.ui)}function KS(e){if(!e)return;let t=OU(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 qd(e){return OU(e)?.autoHeight===!0}function YS(e){return XS(XS(e)?._meta)}var qe=j(me(),1);function jK(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,s]of n){if(o<=8)break;let l=i.length>4?`${i.slice(0,4)}\u2026`:i,u;typeof s=="string"?u=s.length>2?`'${s.slice(0,1)}\u2026`:`'${s}'`:Array.isArray(s)?u=`Array(${s.length})`:typeof s=="object"&&s!==null?u="{\u2026}":u=String(s);let c=`${l}\u2009${u}`;r.push(c),o-=c.length+3}return`{${r.join(", ")}}`}function VK({text:e,className:t}){let{t:a}=Ue(),[n,r]=(0,ua.useState)(!1),o=(0,ua.useRef)(null);(0,ua.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let i=(0,ua.useCallback)(async s=>{s.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>r(!1),2e3)}catch{}},[e]);return(0,qe.jsx)(br,{variant:"ghost",size:"sm",onClick:i,className:V("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,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(Lc,{className:"ww:size-3.5"}),(0,qe.jsx)("span",{children:a.tool.copied})]}):(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(Ac,{className:"ww:size-3.5"}),(0,qe.jsx)("span",{children:a.tool.copy})]})})}function NU({data:e,label:t,className:a,...n}){let[r,o]=(0,ua.useState)(!1),i=(0,ua.useMemo)(()=>JSON.stringify(e,null,2),[e]),s=jK(e);return(0,qe.jsxs)("div",{className:V("ww:rounded-lg ww:bg-tool-card",a),...n,children:[(0,qe.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:px-3 ww:pt-2.5 ww:pb-1.5",children:[(0,qe.jsx)("span",{className:"ww:text-xs ww:font-medium ww:text-muted-foreground",children:t}),(0,qe.jsx)(VK,{text:i})]}),(0,qe.jsxs)("button",{type:"button",onClick:()=>o(l=>!l),className:"ww:flex ww:w-full ww:items-start ww:gap-2 ww:px-3 ww:pb-3 ww:text-left",children:[(0,qe.jsx)(Ec,{className:V("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,qe.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,qe.jsx)("code",{children:i})}):(0,qe.jsx)("span",{className:"ww:truncate ww:text-xs ww:font-mono ww:text-foreground/80",children:s})]})]})}var ZS=(0,ua.createContext)({open:!1,toggle:()=>{}});function UU({className:e,defaultOpen:t=!1,children:a,...n}){let[r,o]=(0,ua.useState)(t);return(0,qe.jsx)(ZS.Provider,{value:{open:r,toggle:()=>o(i=>!i)},children:(0,qe.jsx)("div",{className:V("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 BU({className:e,title:t,state:a,...n}){let{open:r,toggle:o}=(0,ua.useContext)(ZS),i=a==="input-available"||a==="input-streaming",s=t??"";return(0,qe.jsxs)("button",{type:"button",onClick:o,className:V("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,qe.jsx)(_i,{className:"ww:size-4 ww:shrink-0"}),(0,qe.jsx)("span",{className:"ww:truncate",children:i?(0,qe.jsx)(or,{duration:1.6,children:s}):s}),(0,qe.jsx)(zo,{className:V("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",r&&"ww:rotate-180")})]})}function zU({className:e,title:t,state:a,...n}){let r=a==="input-available"||a==="input-streaming",o=t??"";return(0,qe.jsx)("div",{className:V("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,qe.jsx)("span",{className:"ww:truncate",children:r?(0,qe.jsx)(or,{duration:1.6,children:o}):o})})}function FU({className:e,children:t,...a}){let{open:n}=(0,ua.useContext)(ZS);return(0,qe.jsx)("div",{className:V("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,qe.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,qe.jsx)("div",{className:V("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 JS({className:e,input:t,debug:a,...n}){let{t:r}=Ue(),o=(0,ua.useMemo)(()=>{if(!a&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:i,...s}=t;return s}return t},[t,a]);return(0,qe.jsx)(NU,{data:o,label:r.tool.request,className:e,...n})}function Hd(e,t,a){if(e){let n=KS(a?.[e]?._meta);if(n)return n}return KS(YS(t))}function qU(e,t,a){return e&&qd(a?.[e]?._meta)?!0:qd(YS(t))}function QS({className:e,output:t,errorText:a,debug:n,...r}){let{t:o}=Ue(),i=(0,ua.useMemo)(()=>{if(!n&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:s,...l}=t;return l}return t},[t,n]);return t||a?a?(0,qe.jsxs)("div",{className:V("ww:space-y-2",e),...r,children:[(0,qe.jsx)("h4",{className:"ww:text-xs ww:font-medium ww:uppercase ww:tracking-wide ww:text-muted-foreground",children:o.tool.error}),(0,qe.jsx)("div",{className:"ww:rounded-lg ww:bg-destructive/10 ww:p-3 ww:text-xs ww:text-destructive",children:a})]}):(0,qe.jsx)(NU,{data:i,label:o.tool.response,className:e,...r}):null}var jd=j(me(),1);function HU(e){return e.type==="text"||e.type==="reasoning"||e.type==="file"||"toolCallId"in e}function jU(e){return e.parts.some(HU)}function VU(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=>!(!HU(o)||a?.ignoreToolParts&&"toolCallId"in o||a?.ignoreReasoningParts&&o.type==="reasoning"))}function $U({className:e,...t}){let{t:a}=Ue();return(0,jd.jsxs)("div",{"aria-live":"polite",className:V("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,jd.jsx)(Oc,{className:"ww:size-4 ww:shrink-0"}),(0,jd.jsx)(or,{duration:1.6,children:a.workingIndicator.default})]})}var ut=j(Ee(),1);function nu(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 WU(e,t){return!nu(e)&&!nu(t)?null:nu(e)?nu(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 io=j(Ee(),1);var GU=(0,io.createContext)(()=>{});function XU(){return(0,io.useContext)(GU)}var KU=GU.Provider;function $K(e){let t=window.requestIdleCallback;typeof t=="function"?t(e):setTimeout(e,500)}function ru(e){let t=(0,io.useRef)(e);t.current=e;let a=(0,io.useRef)(!1);(0,io.useEffect)(()=>{if(!e.painted||a.current)return;a.current=!0;let n=requestAnimationFrame(()=>{let r=t.current;Di(r.paintMark),$K(()=>L1(r))});return()=>cancelAnimationFrame(n)},[e.painted])}var YU=j(me(),1),WK="/api/mcp/resource",GK=500,XK=0,KK=16,YK="2026-01-26",ZK=300,JK=3e3,QK=3,eY=2e3;function tY(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function aY(e,t,a){return Hd(e,t,a)?!1:t._meta?.["waniwani/autoInjectResultText"]!==!1}function Mh({resourceUri:e,toolInput:t,toolResult:a,resourceEndpoint:n=WK,chatSessionId:r,isDark:o=!1,className:i,autoHeight:s=!1,onOpenLink:l,onFollowUp:u,onCallTool:c,onDisplayModeChange:d,isFullscreen:p=!1,toolDefinitions:m}){let h=(0,ut.useRef)(null),v=(0,ut.useRef)(t),I=(0,ut.useRef)(a),y=(0,ut.useRef)({width:0,height:0}),w=(0,ut.useRef)(null),g=(0,ut.useRef)(!1),S=(0,ut.useRef)(0),E=(0,ut.useRef)("inline"),[T,R]=(0,ut.useState)(XK),[O,U]=(0,ut.useState)(void 0),A=(0,ut.useRef)(l),Q=(0,ut.useRef)(u),$=(0,ut.useRef)(c),H=(0,ut.useRef)(d),Z=(0,ut.useRef)(r),X=(0,ut.useRef)(m);v.current=t,I.current=a,A.current=l,Q.current=u,$.current=c,H.current=d,Z.current=r,X.current=m;let B=(0,ut.useCallback)(x=>s?Math.max(x+KK,0):Math.min(Math.max(x,50),GK),[s]),P=(0,ut.useMemo)(()=>{let x=n.includes("?")?"&":"?";return`${n}${x}uri=${encodeURIComponent(e)}`},[n,e]),J=XU(),ge=(0,ut.useRef)(null),C=(0,ut.useRef)(void 0);(0,ut.useEffect)(()=>{let x=A1(e,J);return ge.current=x,()=>{clearTimeout(C.current),x.has("initialized")||x.report("timeout",S.current),ge.current=null}},[e,J]);let ze=(0,ut.useRef)(o);ze.current=o;let ot=(0,ut.useRef)(p);return(0,ut.useEffect)(()=>{ot.current=p,y.current.height=-1,w.current&&(w.current.cancel(),w.current=null)},[p]),(0,ut.useEffect)(()=>{if(!g.current)return;let x=h.current;x?.contentWindow&&x.contentWindow.postMessage({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{theme:o?"dark":"light"}},"*")},[o]),(0,ut.useEffect)(()=>{let x=h.current;if(!x)return;let te=!1,re=!1,ke=null,We=null,be=setTimeout(()=>{if(te||re||S.current>=QK)return;S.current+=1;let ce=new URL(x.src);ce.searchParams.set("_retry",String(S.current)),x.src=ce.toString()},JK),Oe=ce=>{x.contentWindow?.postMessage(ce,"*")},we=ce=>{if(te||ce.source!==x.contentWindow)return;let Le=ce.data;if(!Le||typeof Le!="object"||Le.jsonrpc!=="2.0")return;let ie=Le.method,xe=Le.id;if(ie==="ui/initialize"&&xe!=null){re=!0,ge.current?.mark("initialize"),clearTimeout(be),Oe({jsonrpc:"2.0",id:xe,result:{protocolVersion:Le.params?.protocolVersion??YK,hostInfo:{name:"Waniwani Chat",version:"1.0.0"},hostCapabilities:{openLinks:{},message:{text:{}},tools:{},updateModelContext:{text:{},structuredContent:{}}},hostContext:{theme:ze.current?"dark":"light",displayMode:E.current}}});return}if(ie==="ui/notifications/initialized"){g.current=!0,ge.current?.mark("initialized"),C.current=setTimeout(()=>ge.current?.report("ok",S.current),eY);let Ne=v.current,_e=I.current,Fe=_e._meta&&typeof _e._meta=="object"?_e._meta:null,Ae=tY(Z.current),de=Fe&&typeof Fe.waniwani=="object"&&Fe.waniwani!==null?Fe.waniwani:null,W=de||Ae?{...de??{},...Ae?{sessionId:Ae}:{}}:void 0,ct=Fe||W?{...Fe??{},...W?{waniwani:W}:{}}:void 0;Oe({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:Ne}});let le=_e.content??[{type:"text",text:JSON.stringify(_e)}];Oe({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:{content:le,structuredContent:_e.structuredContent,_meta:ct,meta:ct}});return}if(ie==="ui/notifications/size-changed"){clearTimeout(C.current),ge.current?.mark("firstSize"),ge.current?.report("ok",S.current);let Ne=Le.params,_e=typeof Ne?.height=="number"?Ne.height:void 0,Fe=typeof Ne?.width=="number"?Ne.width:void 0,Ae=y.current,de=_e!==void 0&&_e!==Ae.height,W=Fe!==void 0&&Fe!==Ae.width;if(!de&&!W)return;if(de&&_e!==void 0){if(Ae.height=_e,ot.current)return;let ct=B(_e),le=x.getBoundingClientRect().height;if(w.current&&(w.current.cancel(),w.current=null),R(ct),x.animate&&Math.abs(le-ct)>2){let oe=x.animate([{height:`${le}px`},{height:`${ct}px`}],{duration:ZK,easing:"ease-out",fill:"forwards"});w.current=oe,oe.onfinish=()=>{w.current===oe&&(oe.cancel(),w.current=null)}}}W&&s&&Fe!==void 0&&(Ae.width=Fe,U(Fe));return}if(ie==="ui/open-link"&&xe!=null){let Ne=Le.params?.url;typeof Ne=="string"&&(A.current?A.current(Ne):window.open(Ne,"_blank","noopener,noreferrer")),Oe({jsonrpc:"2.0",id:xe,result:{}});return}if(ie==="ui/message"&&xe!=null){if(Q.current&&Le.params){let Ne=Le.params,_e=ke;if(ke=null,We){clearTimeout(We.timer);let Fe=We.text;We=null;let Ae=(Ne.content??[]).map(de=>de.text??"").join("").trim();Ne={...Ne,content:[{type:"text",text:`${Ae}
|
|
143
143
|
|
|
144
|
-
${Fe}`}]}}Q.current({...Ne,..._e?{modelContext:_e}:{}})}Oe({jsonrpc:"2.0",id:xe,result:{}});return}if(ie==="ui/update-model-context"&&xe!=null){Ce=VU(Ce,Le.params),Oe({jsonrpc:"2.0",id:xe,result:{}});return}if(ie==="tools/call"&&xe!=null){let Ne=$.current;if(!Ne){Oe({jsonrpc:"2.0",id:xe,error:{code:-32601,message:"tools/call not supported"}});return}let _e=Le.params?.name;Ne({name:_e,arguments:Le.params?.arguments??{}}).then(Fe=>{Oe({jsonrpc:"2.0",id:xe,result:Fe});let Ae=Fe.content?.map(de=>de.text??"").join("").trim();Ae&&eY(_e,Fe,X.current)&&(We&&clearTimeout(We.timer),We={text:Ae,timer:setTimeout(()=>{if(ae)return;let de=Ce;Ce=null,We=null,Q.current?.({role:"user",content:[{type:"text",text:Ae}],...de?{modelContext:de}:{}})},500)})}).catch(Fe=>{let Ae=Fe instanceof Error?Fe.message:"Tool call failed";Oe({jsonrpc:"2.0",id:xe,error:{code:-32e3,message:Ae}})});return}if(ie==="ui/request-display-mode"&&xe!=null){let Ne=Le.params?.mode,_e=Ne==="fullscreen"||Ne==="inline"||Ne==="pip"?Ne:"inline";E.current=_e,Oe({jsonrpc:"2.0",id:xe,result:{mode:_e}}),Oe({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{displayMode:_e}}),q.current?.(_e);return}if(ie==="ui/resource-teardown"&&xe!=null){Oe({jsonrpc:"2.0",id:xe,result:{}});return}ie==="ping"&&xe!=null&&Oe({jsonrpc:"2.0",id:xe,result:{}})};return window.addEventListener("message",we),()=>{ae=!0,clearTimeout(be),We&&clearTimeout(We.timer),window.removeEventListener("message",we)}},[s,B]),(0,XU.jsx)("iframe",{ref:h,src:P,onLoad:()=>ge.current?.mark("iframeLoad"),sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox",className:V(!p&&"ww:rounded-md ww:border ww:border-border",i),style:{height:p?"100%":T,minWidth:p||!O?void 0:`min(${O}px, 100%)`,width:"100%",border:"none",colorScheme:o?"dark":"auto"},title:"MCP App"})}var si=j(he(),1);function KU({icon:e,title:t,description:a,suggestions:n,onSuggestionSelect:r}){return(0,si.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,si.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,si.jsx)("h2",{className:"ww:text-lg ww:font-semibold ww:text-foreground",children:t}),a&&(0,si.jsx)("p",{className:"ww:mt-1 ww:text-sm ww:text-muted-foreground ww:max-w-sm",children:a}),n&&n.length>0&&(0,si.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,si.jsx)("button",{type:"button",onClick:()=>r?.(o),className:V("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 YU=j(Ee(),1);var ou=j(he(),1);function tY({onRetry:e}){let{t}=Ue();return(0,ou.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,ou.jsx)("span",{children:t.widgetErrorBoundary.failedToLoad}),(0,ou.jsx)("button",{type:"button",onClick:e,className:"ww:text-xs ww:font-medium ww:text-primary ww:hover:underline",children:t.widgetErrorBoundary.retry})]})}var Ah=class extends YU.Component{constructor(){super(...arguments);K(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,ou.jsx)(tY,{onRetry:()=>this.setState({hasError:!1})}):this.props.children}};var je=j(he(),1);function JS(e){return e?e.replace(/[-_]/g," ").replace(/^\w/,t=>t.toUpperCase()):"Tool"}function ZU(e){return e&&/search|find|lookup|query|web|browse|google/i.test(e)?Mc:_i}function JU({messages:e,status:t,welcomeMessage:a,welcome:n,onSuggestionSelect:r,resourceEndpoint:o,chatSessionId:i,isDark:s,onFollowUp:l,onCallTool:u,onWidgetDisplayModeChange:c,fullscreenToolCallId:d,debug:p,showToolCalls:m=!0,toolDefinitions:h,messageClassNames:v}){let{t:I}=Ue(),y=e[e.length-1],w=e.length>0,g=d!=null,S=!g&&HU(e,t,{ignoreToolParts:m===!1,ignoreReasoningParts:m===!1});return(0,je.jsxs)(je.Fragment,{children:[!g&&(!w&&n?(0,je.jsx)(KU,{...n,onSuggestionSelect:r}):a&&(0,je.jsx)(VS,{from:"assistant",children:(0,je.jsx)($S,{children:(0,je.jsx)(Lh,{children:a})})})),e.map(E=>{let T=E.parts.filter(B=>B.type==="text"),R=E.parts.filter(B=>B.type==="reasoning"),O=E.parts.filter(B=>B.type==="file"),U=xM(E.metadata),A=E.parts.filter(B=>"toolCallId"in B),Q=E.parts.filter(B=>B.type==="reasoning"||"toolCallId"in B),$=E===y&&E.role==="assistant",q=T.length>0,Z=g?A.some(B=>B.toolCallId===d):!1,X=m!==!1&&!Z&&Q.length>=2;return g&&!Z?(0,je.jsx)("div",{style:{display:"none"}},E.id):E.role==="assistant"&&!qU(E)?(0,je.jsx)("div",{style:{display:"none"}},E.id):m===!1&&E.role==="assistant"&&!q&&O.length===0&&A.every(B=>{let P="output"in B?B.output:void 0;return P===void 0||!o||!qd(B.toolName,P,h)})?(0,je.jsx)("div",{style:{display:"none"}},E.id):(0,je.jsxs)(VS,{from:E.role,className:v?.message,children:[m!==!1&&!Z&&!X&&R.map((B,P)=>(0,je.jsxs)(Nd,{isStreaming:B.state==="streaming",children:[(0,je.jsx)(Ud,{}),(0,je.jsx)(Bd,{children:B.text})]},`reasoning-${E.id}-${P}`)),X&&(()=>{let B=Q[Q.length-1],P=B.type==="reasoning"?{icon:Kr,label:I.reasoning.thinking}:{icon:ZU(B.toolName),label:B.title??JS(B.toolName)};return(0,je.jsxs)(CU,{isWorking:$&&(t==="streaming"||t==="submitted"),activeStep:P,children:[(0,je.jsx)(kU,{workingLabel:I.chainOfThought.working,label:I.chainOfThought.done}),(0,je.jsx)(TU,{children:Q.map((J,ge)=>{let C=ge===Q.length-1;if(J.type==="reasoning")return(0,je.jsx)(EU,{isStreaming:J.state==="streaming",isLast:C,children:J.text},`reasoning-${E.id}-${ge}`);let ze=J.title??JS(J.toolName),ot=ZU(J.toolName);if(m==="titles-only")return(0,je.jsx)(HS,{icon:ot,title:ze,state:J.state,isLast:C},J.toolCallId);let x="output"in J?J.output:void 0;return(0,je.jsxs)(HS,{icon:ot,title:ze,state:J.state,isLast:C,children:[(0,je.jsx)(YS,{input:J.input,debug:p}),x!==void 0&&(0,je.jsx)(ZS,{output:x,errorText:"errorText"in J?J.errorText:void 0,debug:p})]},J.toolCallId)})})]})})(),m!==!1&&!Z&&!X&&A.length===1&&(()=>{let B=A[0],P=B.title??JS(B.toolName);if(m==="titles-only")return(0,je.jsx)(UU,{title:P,state:B.state});let J="output"in B?B.output:void 0;return(0,je.jsxs)(OU,{children:[(0,je.jsx)(NU,{title:P,state:B.state}),(0,je.jsxs)(BU,{children:[(0,je.jsx)(YS,{input:B.input,debug:p}),J!==void 0&&(0,je.jsx)(ZS,{output:J,errorText:"errorText"in B?B.errorText:void 0,debug:p})]})]})})(),A.map(B=>{let P="output"in B?B.output:void 0,J=qd(B.toolName,P,h),ge=zU(B.toolName,P,h),C=B.toolCallId===d;return J&&o&&P!==void 0?(0,je.jsx)("div",{style:C?{position:"absolute",inset:0,zIndex:10,display:"flex",flexDirection:"column",overflow:"hidden",background:"var(--ww-color-background)"}:void 0,children:J&&o&&P!==void 0&&(0,je.jsx)(Ah,{children:(0,je.jsx)(Eh,{isFullscreen:C,resourceUri:J,toolInput:B.input??{},toolResult:{content:P.content,structuredContent:P.structuredContent,_meta:P._meta},resourceEndpoint:o,chatSessionId:i,isDark:s,autoHeight:ge,toolDefinitions:h,onFollowUp:l,onCallTool:u,onDisplayModeChange:c?ze=>c(ze,{toolCallId:B.toolCallId,resourceUri:J,toolInput:B.input??{},toolResult:{content:P.content,structuredContent:P.structuredContent,_meta:P._meta},autoHeight:ge}):void 0})})},B.toolCallId):null}),!Z&&U.length>0&&(0,je.jsx)(bM,{documents:U}),!Z&&(0,je.jsx)("div",{children:(0,je.jsxs)($S,{className:V(E.role==="user"?v?.userBubble:v?.assistantBubble),children:[O.length>0&&(0,je.jsx)(wM,{files:O}),q?T.map((B,P)=>{let J=$&&t==="streaming"&&P===T.length-1;return(0,je.jsx)(Lh,{isStreaming:J,children:B.type==="text"?B.text:""},`${E.id}-${P}`)}):null]})})]},E.id)}),S&&(0,je.jsx)(jU,{})]})}var li=j(he(),1);function aY({label:e}){return(0,li.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,li.jsx)("title",{children:e}),(0,li.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,li.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function Mh({onClick:e}){let{t}=Ue();return(0,li.jsx)("button",{type:"button",onClick:e,title:t.threadMenu.newChat,"aria-label":t.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,li.jsx)(aY,{label:t.threadMenu.newChat})})}var jd=j(he(),1),nY="https://app.waniwani.ai/assets/waniwani-logo.svg",rY="https://waniwani.ai";function QU(){let{t:e}=Ue();return(0,jd.jsxs)("a",{href:rY,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,jd.jsx)("span",{children:e.poweredBy.label}),(0,jd.jsx)("img",{src:nY,alt:"Waniwani",width:72,height:10,"data-waniwani-logo":"",className:"ww:h-2.5 ww:w-auto"})]})}var iu=j(Ee(),1);var St=j(he(),1),eB=20;function oY({label:e}){return(0,St.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,St.jsx)("title",{children:e}),(0,St.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,St.jsx)("polyline",{points:"3 4 3 9 8 9"}),(0,St.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"12"}),(0,St.jsx)("line",{x1:"12",y1:"12",x2:"15",y2:"14"})]})}function iY({label:e}){return(0,St.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,St.jsx)("title",{children:e}),(0,St.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,St.jsx)("path",{d:"M19 6l-2 14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L5 6"}),(0,St.jsx)("path",{d:"M10 11v6"}),(0,St.jsx)("path",{d:"M14 11v6"})]})}function tB({threads:e,activeThreadId:t,onNewThread:a,onSelectThread:n,onDeleteThread:r}){let{locale:o,t:i}=Ue(),[s,l]=(0,iu.useState)(!1),u=(0,iu.useRef)(null);(0,iu.useEffect)(()=>{if(!s)return;let p=m=>{let h=u.current;h&&(m.composedPath().includes(h)||l(!1))};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[s]);let c=e.slice(0,eB),d=Math.max(0,e.length-eB);return(0,St.jsxs)("div",{ref:u,className:"ww:relative ww:flex ww:items-center ww:gap-1",children:[(0,St.jsx)(Mh,{onClick:a}),(0,St.jsx)("button",{type:"button",onClick:()=>l(p=>!p),title:i.threadMenu.threadHistory,"aria-label":i.threadMenu.threadHistory,"aria-expanded":s,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,St.jsx)(oY,{label:i.threadMenu.threadHistory})}),s&&(0,St.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,St.jsx)("div",{className:"ww:px-3 ww:py-3 ww:text-xs ww:text-muted-foreground",children:i.threadMenu.noPreviousChats}),c.map(p=>{let m=p.threadId===t,h=Date.parse(p.updatedAt);return(0,St.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 ${m?"ww:bg-foreground/5":""}`,children:[(0,St.jsxs)("button",{type:"button",onClick:()=>{n(p.threadId),l(!1)},className:"ww:flex-1 ww:min-w-0 ww:text-left ww:cursor-pointer",children:[(0,St.jsx)("div",{className:"ww:truncate ww:text-foreground ww:font-medium",children:p.title}),(0,St.jsx)("div",{className:"ww:text-[10px] ww:text-muted-foreground",children:Number.isNaN(h)?"":px(h,o)})]}),(0,St.jsx)("button",{type:"button",onClick:v=>{v.stopPropagation(),r(p.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,St.jsx)(iY,{label:i.threadMenu.deleteThread})})]},p.threadId)}),d>0&&(0,St.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 Rh=j(Ee(),1);function su(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 s of[...t])try{s(i)}catch(l){console.warn("[Waniwani] onEvent subscriber threw:",l)}}}}function aB(){return{subscribe(){return()=>{}},emit(){}}}var nB=(0,Rh.createContext)(aB());function Dh(){return(0,Rh.useContext)(nB)}var lu=nB.Provider;var _h=j(Ee(),1);function rB(e){let t=(0,_h.useRef)(e);return t.current=e,(0,_h.useCallback)(async a=>{let{api:n,headers:r,onCallTool:o,sessionId:i}=t.current;if(o)return o(a);let s=Oa(n??"/api/waniwani","/tool"),l=typeof i=="string"&&i.trim().length>0?i.trim():void 0,u=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",...l?{"X-Session-Id":l}:{},...r},body:JSON.stringify(a)});if(!u.ok)throw new Error(`Tool call failed: ${u.status} ${u.statusText}`);return u.json()},[])}var jn=j(Ee(),1);var uB=j(iB(),1);var Gd=j(Ee(),1);var Nh=j(Ee(),1);var lB=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},Mt=(e,t,a)=>(lB(e,t,"read from private field"),a?a.call(e):t.get(e)),Lr=(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)},ui=(e,t,a,n)=>(lB(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);function lY(e,t){return t!=null?(0,uB.default)(e,t):e}var Hn,Ph,Oh,Vd,$d,Wd,uu,QS,eI,uY=class{constructor(e=[]){Lr(this,Hn,void 0),Lr(this,Ph,"ready"),Lr(this,Oh,void 0),Lr(this,Vd,new Set),Lr(this,$d,new Set),Lr(this,Wd,new Set),this.pushMessage=t=>{ui(this,Hn,Mt(this,Hn).concat(t)),Mt(this,uu).call(this)},this.popMessage=()=>{ui(this,Hn,Mt(this,Hn).slice(0,-1)),Mt(this,uu).call(this)},this.replaceMessage=(t,a)=>{ui(this,Hn,[...Mt(this,Hn).slice(0,t),this.snapshot(a),...Mt(this,Hn).slice(t+1)]),Mt(this,uu).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,a)=>{let n=a?lY(t,a):t;return Mt(this,Vd).add(n),()=>{Mt(this,Vd).delete(n)}},this["~registerStatusCallback"]=t=>(Mt(this,$d).add(t),()=>{Mt(this,$d).delete(t)}),this["~registerErrorCallback"]=t=>(Mt(this,Wd).add(t),()=>{Mt(this,Wd).delete(t)}),Lr(this,uu,()=>{Mt(this,Vd).forEach(t=>t())}),Lr(this,QS,()=>{Mt(this,$d).forEach(t=>t())}),Lr(this,eI,()=>{Mt(this,Wd).forEach(t=>t())}),ui(this,Hn,e)}get status(){return Mt(this,Ph)}set status(e){ui(this,Ph,e),Mt(this,QS).call(this)}get error(){return Mt(this,Oh)}set error(e){ui(this,Oh,e),Mt(this,eI).call(this)}get messages(){return Mt(this,Hn)}set messages(e){ui(this,Hn,[...e]),Mt(this,uu).call(this)}};Hn=new WeakMap;Ph=new WeakMap;Oh=new WeakMap;Vd=new WeakMap;$d=new WeakMap;Wd=new WeakMap;uu=new WeakMap;QS=new WeakMap;eI=new WeakMap;var cu,sB=class extends SE{constructor({messages:e,...t}){let a=new uY(e);super({...t,state:a}),Lr(this,cu,void 0),this["~registerMessagesCallback"]=(n,r)=>Mt(this,cu)["~registerMessagesCallback"](n,r),this["~registerStatusCallback"]=n=>Mt(this,cu)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>Mt(this,cu)["~registerErrorCallback"](n),ui(this,cu,a)}};cu=new WeakMap;function cB({experimental_throttle:e,resume:t=!1,...a}={}){let n=(0,jn.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:p=>{var m,h;return(h=(m=n.current).onToolCall)==null?void 0:h.call(m,p)},onData:p=>{var m,h;return(h=(m=n.current).onData)==null?void 0:h.call(m,p)},onFinish:p=>{var m,h;return(h=(m=n.current).onFinish)==null?void 0:h.call(m,p)},onError:p=>{var m,h;return(h=(m=n.current).onError)==null?void 0:h.call(m,p)},sendAutomaticallyWhen:p=>{var m,h,v;return(v=(h=(m=n.current).sendAutomaticallyWhen)==null?void 0:h.call(m,p))!=null?v:!1}},o=(0,jn.useRef)("chat"in a?a.chat:new sB(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new sB(r));let s=(0,jn.useCallback)(p=>o.current["~registerMessagesCallback"](p,e),[e,o.current.id]),l=(0,jn.useSyncExternalStore)(s,()=>o.current.messages,()=>o.current.messages),u=(0,jn.useSyncExternalStore)(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),c=(0,jn.useSyncExternalStore)(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),d=(0,jn.useCallback)(p=>{typeof p=="function"&&(p=p(o.current.messages)),o.current.messages=p},[o]);return(0,jn.useEffect)(()=>{t&&o.current.resumeStream()},[t,o]),{id:o.current.id,messages:l,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 te=j(Ee(),1);var cY="/api/mcp/modules/documents",dY=2e4,fY=3e5,Vn=class extends Error{constructor(a,n){super(n);K(this,"code");this.name="DocumentUploadError",this.code=a}};function dB(e,t){return Bp(e,`${cY}${t}`)}function pY(e){return dB(e,"/upload-url")}function fB(e,t){let a=new Headers(e);return new Headers(t).forEach((n,r)=>{a.set(r,n)}),a}function mY(e){let t=e?.data;if(typeof t?.documentId!="string"||typeof t.uploadUrl!="string"||!(t.documentId&&t.uploadUrl))return null;let a={};for(let[n,r]of Object.entries(t.headers??{}))typeof r=="string"&&(a[n]=r);return{documentId:t.documentId,uploadUrl:t.uploadUrl,headers:a}}function hY(e){return e===403?new Vn("upload_disabled","This agent does not accept document uploads."):e===413?new Vn("max_file_size","That file is too large."):e===422||e===400?new Vn("accept","That file type is not accepted."):new Vn("upload_failed",`The upload could not be started (${e}).`)}function gY(e){return new Promise((t,a)=>{let n=new XMLHttpRequest;n.open("PUT",e.url,!0);for(let[i,s]of Object.entries(e.headers))n.setRequestHeader(i,s);n.timeout=fY;let r=()=>n.abort();e.signal.addEventListener("abort",r,{once:!0});let o=()=>e.signal.removeEventListener("abort",r);n.upload.onprogress=i=>{i.lengthComputable&&i.total>0&&e.onProgress?.(i.loaded/i.total)},n.onload=()=>{if(o(),n.status>=200&&n.status<300||n.status===412){e.onProgress?.(1),t();return}a(new Vn("upload_failed",`The upload was rejected (${n.status}).`))},n.onerror=()=>{o(),a(new Vn("upload_failed","The upload could not be completed."))},n.ontimeout=()=>{o(),a(new Vn("upload_failed","The upload timed out."))},n.onabort=()=>{o(),a(e.signal.reason instanceof Error?e.signal.reason:new Error("aborted"))},n.send(e.file)})}async function Uh(e){let t=dB(e.api,`/${e.documentId}`);if(t)try{await fetch(t,{method:"DELETE",headers:fB(e.headers,e.uploadHeaders)})}catch{}}async function pB(e){e.signal.throwIfAborted();let t=pY(e.api);if(!t)throw new Vn("upload_disabled","This agent does not accept document uploads.");let a=new AbortController,n=setTimeout(()=>a.abort(),dY),r=()=>a.abort(e.signal.reason);e.signal.addEventListener("abort",r,{once:!0});let o;try{let s=fB(e.headers,e.uploadHeaders);s.set("Content-Type","application/json"),o=await fetch(t,{method:"POST",headers:s,signal:a.signal,body:JSON.stringify({filename:e.file.name,contentType:e.file.type,byteSize:e.file.size,...e.sessionId?{sessionId:e.sessionId}:{}})})}catch(s){throw e.signal.aborted?s:new Vn("upload_failed","The upload could not be started.")}finally{clearTimeout(n),e.signal.removeEventListener("abort",r)}if(!o.ok)throw hY(o.status);let i=mY(await o.json().catch(()=>null));if(e.signal.throwIfAborted(),!i)throw new Vn("upload_failed","The upload could not be started.");return await gY({url:i.uploadUrl,headers:i.headers,file:e.file,signal:e.signal,onProgress:e.onProgress}),{documentId:i.documentId,filename:e.file.name,mediaType:e.file.type}}function yY(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(s=>(s.code==="invalid_value"||s.code==="invalid_literal")&&s.path?.[0]==="type"))continue;let i=r.filter(s=>s.code==="unrecognized_keys").flatMap(s=>s.keys??[]);if(i.length>0)return i}return null}var Bh=class extends vv{processResponseStream(t){let a="",n=wv(),r=n.validate?.bind(n);return t.pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({async transform(o,i){a+=o;let s=a.split(`
|
|
145
|
-
`);a=s.pop()??"";for(let l of s){let u=l.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 p=await r(d);if(p.success){i.enqueue(p.value);continue}let m=yY(p.error);if(m?.length){let h={...d};for(let I of m)delete h[I];let v=await r(h);v.success&&i.enqueue(v.value)}}catch{}}}}))}};var mB=50,hB=1e3;function zh(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 Fh(e){if(typeof indexedDB>"u")return null;let t=null;try{return t=await Ww(),await e(t)}catch{return null}finally{try{t?.close()}catch{}}}function tI(e){return new Promise((t,a)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}async function aI(e){return await Fh(async a=>{let o=a.transaction(yn,"readonly").objectStore(yn).index(zp),s=(await tI(o.getAll(e))??[]).filter(zh);return s.sort((l,u)=>l.updatedAt<u.updatedAt?1:-1),s})??[]}async function qh(e){return await Fh(async a=>{let r=a.transaction(yn,"readonly").objectStore(yn),o=await tI(r.get(e));return zh(o)?o:null})??null}async function nI(e){if(!zh(e))return;let t=e.messages.length>hB?{...e,messages:e.messages.slice(e.messages.length-hB)}:e;await Fh(async a=>{await new Promise((l,u)=>{let c=a.transaction(yn,"readwrite");c.oncomplete=()=>l(),c.onerror=()=>u(c.error),c.onabort=()=>u(c.error),c.objectStore(yn).put(t)});let n=a.transaction(yn,"readwrite"),r=n.objectStore(yn),o=r.index(zp),s=(await tI(o.getAll(t.memoryUserId))??[]).filter(zh);if(s.length>mB){s.sort((u,c)=>u.updatedAt<c.updatedAt?-1:1);let l=s.slice(0,s.length-mB);for(let u of l)r.delete(u.threadId)}return await new Promise((l,u)=>{n.oncomplete=()=>l(),n.onerror=()=>u(n.error),n.onabort=()=>u(n.error)}),null})}async function gB(e){await Fh(async t=>(await new Promise((a,n)=>{let r=t.transaction(yn,"readwrite");r.oncomplete=()=>a(),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error),r.objectStore(yn).delete(e)}),null))}async function rI(e){return(await aI(e))[0]?.threadId??null}function yB(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 wY="x-session-id",vY=250,xY=200;function wB(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():ld()}function Hh(){return new Date().toISOString()}function vB(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}async function bY(e,t){let a=Oa(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 xB(e){let{api:t="/api/waniwani",headers:a,uploadHeaders:n,body:r,onMessageSent:o,onResponseReceived:i,enableThreadHistory:s=!1,activeThreadId:l,onThreadChange:u}=e,c=e.visitorId;(0,te.useEffect)(()=>bc(c),[c]);let d=Dh(),p=(0,te.useRef)(a),m=(0,te.useRef)(n),h=(0,te.useRef)(r),v=(0,te.useRef)(s);(0,te.useEffect)(()=>{v.current=s},[s]);let I=(0,te.useRef)(void 0),y=(0,te.useRef)(void 0),w=(0,te.useRef)(null),[g,S]=(0,te.useState)(void 0),E=(0,te.useRef)(g),[T,R]=(0,te.useState)(l),O=(0,te.useRef)(T),[U,A]=(0,te.useState)([]),[Q,$]=(0,te.useState)(!s),q=(0,te.useRef)(void 0),Z=(0,te.useRef)(void 0),X=(0,te.useRef)(void 0),B=(0,te.useRef)(void 0),P=(0,te.useRef)(0),J=(0,te.useRef)(u);(0,te.useEffect)(()=>{J.current=u},[u]);let ge=(0,te.useCallback)(_=>{O.current=_,R(_),_&&(J.current?.(_),d.emit({name:"thread.changed",sessionId:E.current,properties:{threadId:_}}))},[d]),C=(0,te.useCallback)(async()=>{if(!s)return;let _=w.current?.memoryUserId;if(!_)return;let pe=await aI(_);A(pe)},[s]),ze=(0,te.useCallback)(()=>E.current,[]),ot=(0,te.useCallback)(_=>{let pe=vB(_);if(!pe||E.current===pe)return;let Se=E.current===void 0;E.current=pe,S(pe),Se&&d.emit({name:"session.started",properties:{sessionId:pe}})},[d]),x=(0,te.useCallback)(()=>{E.current=void 0,S(void 0)},[]);(0,te.useEffect)(()=>{p.current=a,m.current=n},[a,n]),(0,te.useEffect)(()=>{h.current=r},[r]),(0,te.useEffect)(()=>{let _=!1,pe=P.current;return(async()=>{try{let et=await Sc();if(_)return;w.current=et}catch{}if(!s)return;let Se=w.current?.memoryUserId;if(!Se){$(!0);return}try{let et=l??await rI(Se);if(_||pe!==P.current)return;if(et){let Nt=await qh(et);if(_||pe!==P.current)return;Nt&&Nt.memoryUserId===Se&&(O.current=Nt.threadId,R(Nt.threadId),q.current=Nt.createdAt,Z.current=Nt.title,Nt.sessionId&&(E.current=Nt.sessionId,S(Nt.sessionId)),ct(Nt.messages))}await C()}finally{_||$(!0)}})(),()=>{_=!0}},[]);let ae=(0,te.useRef)(null),re=(0,te.useCallback)(_=>{let pe=h.current?.[_];return typeof pe=="string"?pe:void 0},[]),Ce=(0,te.useCallback)(()=>({api:t,token:qp(p.current),channelId:re("channelId"),sessionId:E.current}),[t,re]),We=(0,te.useCallback)(_=>{let pe=ae.current;ae.current=null,pe?.report(Ce(),{mode:re("mode"),outcome:_})},[Ce,re]),be=(0,te.useCallback)(_=>{let pe=typeof _=="object"&&_!==null&&!Array.isArray(_)?_:void 0,Se=w.current?.memoryUserId,et=w.current?.language,Nt={};return Se&&(Nt.memoryUserId=Se),et&&(Nt.locale=et),Object.keys(Nt).length>0||pe?{...Nt,...pe??{}}:void 0},[]),Oe=(0,te.useCallback)(()=>{let _=O.current;return _||(_=wB(),q.current=Hh(),Z.current=void 0,ge(_)),_},[ge]),we=(0,te.useRef)(new Bh({api:t,headers:()=>({...p.current}),body:()=>{let _={...h.current??{}},pe=Object.hasOwn(_,"sessionId"),Se=vB(_.sessionId);if(Se)ot(Se),_.sessionId=Se;else if(pe)x(),delete _.sessionId;else{let Zh=ze();Zh&&(_.sessionId=Zh)}nu(I.current)&&(_.modelContext=I.current),y.current?.length&&(_.documents=y.current);let et=w.current,Nt=fa();et&&(_.visitorContext={timezone:et.timezone,language:et.language,languages:et.languages,deviceType:et.deviceType,referrer:et.referrer,visitorId:Nt});let Xt=typeof _.visitor=="object"&&_.visitor!==null?_.visitor:{},m3=typeof Xt.client=="object"&&Xt.client!==null?Xt.client:{};_.visitor={...Xt,id:Nt,client:{...m3,...et&&{memoryUserId:et.memoryUserId}}};let gI=be(_.extra);return gI&&(_.extra=gI),v.current&&(Object.hasOwn(_,"threadId")?typeof _.threadId=="string"&&(O.current=_.threadId):_.threadId=Oe()),_},fetch:(async(_,pe)=>{let Se=ae.current;Se?.mark("requestStart");try{let et=await fetch(_,pe);return I.current=void 0,ot(et.headers.get(wY)),Se?Se.instrument(et):et}finally{y.current=void 0}})})),ce=(0,te.useRef)(e.transport?.({fallback:we.current,headers:()=>p.current,body:()=>{let _=be(h.current?.extra);return{channelId:re("channelId"),visitor:{id:fa()},..._?{extra:_}:{}}},threadHistory:()=>v.current,threadId:()=>v.current?Oe():void 0,hasMessages:()=>ke.current.length>0,takeTurnInput:()=>{let _=y.current;return y.current=void 0,I.current=void 0,_?.length?{documents:_}:{}},onSession:ot})??we.current),Le=(0,te.useRef)(null),ie=(0,te.useRef)(null),xe=(0,te.useRef)({}),[Ne,_e]=(0,te.useState)(0),Fe=e.skipRemoteConfig===!0,Ae=(0,te.useCallback)(async()=>{if(!Fe)try{let _=await bY(t,p.current);xe.current=_,_e(pe=>pe+1)}catch(_){console.warn("[Waniwani] Failed to fetch tool definitions:",_ instanceof Error?_.message:_)}},[t,Fe]);(0,te.useEffect)(()=>{Ae()},[Ae]);let{messages:de,sendMessage:W,setMessages:ct,status:le,stop:oe}=cB({messages:e.initialMessages,transport:ce.current,onFinish({message:_,isAbort:pe,isDisconnect:Se,isError:et}){ae.current?.mark("streamEnd"),We(pe||Se||et?"error":"ok"),i?.(),!pe&&!Se&&!et&&d.emit({name:"message.received"}),Le.current&&(ie.current=_)},onError(_){We("error"),console.warn("[Waniwani] Chat error:",_.message),d.emit({name:"chat.error",properties:{message:_.message.slice(0,xY)}}),Le.current&&(Le.current.reject(_),Le.current=null)}}),ke=(0,te.useRef)(de);(0,te.useEffect)(()=>{ke.current=de},[de]),(0,te.useEffect)(()=>{let _=ce.current;return _.restore?.().then(pe=>{pe.length>0&&ke.current.length===0&&ct(pe)}).catch(()=>{}),()=>_.dispose?.()},[]);let ee=(0,te.useCallback)(()=>{ae.current=T1(ke.current.filter(_=>_.role==="user").length+1)},[]),[k,D]=(0,te.useState)(!1),H=(0,te.useCallback)(async()=>{D(!0);try{await oe();let _=E.current;if(!_)return;await fetch(Oa(t,"/cancel"),{method:"POST",headers:{"Content-Type":"application/json",...p.current},body:JSON.stringify({sessionId:_})})}catch{}finally{D(!1)}},[t,oe]),fe=(0,te.useRef)(s);(0,te.useEffect)(()=>{if(!s||fe.current||(fe.current=!0,ke.current.length>0))return;let _=!1,pe=P.current;return $(!1),(async()=>{try{let Se=w.current;if(!Se)try{Se=await Sc(),w.current=Se}catch{}let et=Se?.memoryUserId;if(!et||_||pe!==P.current){_||$(!0);return}let Nt=l??await rI(et);if(_||pe!==P.current)return;if(Nt){let Xt=await qh(Nt);if(_||pe!==P.current)return;Xt&&Xt.memoryUserId===et&&(O.current=Xt.threadId,R(Xt.threadId),q.current=Xt.createdAt,Z.current=Xt.title,Xt.sessionId&&(E.current=Xt.sessionId,S(Xt.sessionId)),ct(Xt.messages))}await C()}finally{_||$(!0)}})(),()=>{_=!0}},[s]),(0,te.useEffect)(()=>{if(le==="ready"&&Le.current&&ie.current){let _=Le.current,pe=ie.current;Le.current=null,ie.current=null,_.resolve(pe)}},[le]);let[qe,gt]=(0,te.useState)(""),In=typeof c!="function",Cn=qe.length>0;(0,te.useEffect)(()=>{In&&Cn&&ce.current.prepare?.()},[In,Cn]);let[Ha,sr]=(0,te.useState)([]),ha=(0,te.useRef)([]);ha.current=Ha;let kn=le==="submitted"||le==="streaming",ja=(0,te.useCallback)(_=>{for(let pe of _)for(let Se of pe.documents??[])Uh({documentId:Se.documentId,api:t,headers:p.current,uploadHeaders:m.current})},[t]),uo=(0,te.useCallback)(()=>{ja(ha.current),sr([])},[ja]),r3=(0,te.useCallback)(_=>{let pe=ha.current.find(Se=>Se.id===_);pe&&ja([pe]),sr(Se=>Se.filter(et=>et.id!==_))},[ja]),o3=kn&&Ha.length>0,i3=(0,te.useCallback)(_=>{let pe=!!_.text?.trim(),Se=!!(_.files?.length||_.documents?.length);if(pe||Se){if(kn){if(Ha.length>0)return;sr(et=>[...et,{id:ld(),text:_.text||"",files:_.files??[],documents:_.documents??[],modelContext:_.modelContext}]),gt("");return}ee(),I.current=_.modelContext,y.current=_.documents,W({text:_.text||"",files:_.files,..._.documents?.length&&{metadata:{documents:_.documents}}}),o?.(_.text||""),d.emit({name:"message.sent"}),gt("")}},[W,o,kn,Ha.length,d,ee]),s3=(0,te.useCallback)(_=>new Promise((pe,Se)=>{Le.current={resolve:pe,reject:Se},ee(),W({text:_}),o?.(_),d.emit({name:"message.sent"})}),[W,o,d,ee]);(0,te.useEffect)(()=>{if(le!=="ready"||k||Ha.length===0)return;let[_,...pe]=Ha;sr(pe),ee(),I.current=_.modelContext,y.current=_.documents,W({text:_.text,files:_.files.length>0?_.files:void 0,..._.documents.length>0&&{metadata:{documents:_.documents}}}),o?.(_.text),d.emit({name:"message.sent"})},[le,k,W,o,Ha,d,ee]);let l3=(0,te.useCallback)(()=>{ce.current.reset?.(),ct([]),uo(),x(),gt(""),xe.current={},_e(_=>_+1),Ae()},[ct,x,Ae,uo]),af=(0,te.useCallback)(()=>{if(!v.current)return;let _=w.current?.memoryUserId,pe=O.current,Se=ke.current;if(!(!_||!pe||Se.length===0)){if(q.current||(q.current=Hh()),!Z.current){let et=Se.find(Xt=>Xt.role==="user"),Nt=et?et.parts.map(Xt=>"text"in Xt&&typeof Xt.text=="string"?Xt.text:"").join(" "):"";Z.current=yB(Nt)}return{threadId:pe,memoryUserId:_,title:Z.current,messages:Se,sessionId:E.current,createdAt:q.current,updatedAt:Hh()}}},[]),pI=(0,te.useCallback)(async()=>{let _=af();_&&(await nI(_),await C())},[af,C]);(0,te.useEffect)(()=>{if(s&&Q&&!(le==="submitted"||le==="streaming")&&de.length!==0)return X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{X.current=void 0;let _=pI().finally(()=>{B.current===_&&(B.current=void 0)});B.current=_},vY),()=>{X.current&&clearTimeout(X.current)}},[s,Q,de,le,pI]);let nf=(0,te.useCallback)(()=>{let _=B.current,pe=X.current,Se=pe?af():void 0;return pe&&(clearTimeout(pe),X.current=void 0),(async()=>{_&&await _,Se&&(await nI(Se),await C())})()},[af,C]),u3=(0,te.useCallback)(()=>{P.current+=1,nf(),ce.current.dispose?.(),ct([]),uo(),x(),gt("");let _=wB();return q.current=Hh(),Z.current=void 0,ge(_),C(),_},[ct,x,ge,C,nf,uo]),Yh=(0,te.useCallback)(async _=>{P.current+=1;let pe=P.current;if(await nf(),pe!==P.current)return;let Se=await qh(_);pe===P.current&&Se&&(ce.current.dispose?.(),Se.sessionId?(E.current=Se.sessionId,S(Se.sessionId)):x(),ge(Se.threadId),q.current=Se.createdAt,Z.current=Se.title,ct(Se.messages),uo(),gt(""))},[ct,x,ge,nf,uo]),c3=(0,te.useCallback)(async _=>{if(O.current===_){P.current+=1,X.current&&(clearTimeout(X.current),X.current=void 0);let pe=B.current;pe&&await pe}await gB(_),ce.current.forget?.(_),await C(),O.current===_&&(ce.current.dispose?.(),ct([]),uo(),x(),gt(""),O.current=void 0,R(void 0),q.current=void 0,Z.current=void 0)},[ct,x,C,uo]);(0,te.useEffect)(()=>{s&&Q&&l!==void 0&&l!==O.current&&Yh(l)},[l,s,Q,Yh]);let d3=(0,te.useCallback)(_=>{gt(_.target.value)},[]),mI=de[de.length-1],hI=de.length>0,f3=kn&&(!hI||mI.role==="user"),p3=xe.current;return{messages:de,status:le,text:qe,setText:gt,handleSubmit:i3,handleTextChange:d3,isLoading:kn,showLoaderBubble:f3,lastMessage:mI,hasMessages:hI,sendMessage:W,sendMessageAndWait:s3,stop:H,reset:l3,queuedMessages:Ha,queueFull:o3,removeQueuedMessage:r3,sessionId:g,toolDefinitions:p3,refreshToolDefinitions:Ae,threads:U,activeThreadId:T,isThreadHistoryReady:Q,startNewThread:u3,switchThread:Yh,deleteThread:c3,keepsSession:ce.current.keepsSession?.()??!1}}var bs=j(Ee(),1);var SY=6e3;function bB(e){let{api:t,headers:a,uploadHeaders:n,sessionId:r,documentUpload:o,allowAttachments:i}=e,[s,l]=(0,bs.useState)(null),u=(0,bs.useCallback)((p,m,h)=>pB({file:p,api:t,headers:a,uploadHeaders:n,sessionId:r,signal:m,onProgress:h}),[t,a,n,r]),c=(0,bs.useCallback)(p=>{Uh({documentId:p.documentId,api:t,headers:a,uploadHeaders:n})},[t,a,n]);(0,bs.useEffect)(()=>{if(!s)return;let p=setTimeout(()=>l(null),SY);return()=>clearTimeout(p)},[s]);let d=o?.enabled??!1;return{enabled:o?o.enabled:!!i,accept:o?.accept.join(","),maxFileSize:o?.maxBytes,maxPdfPages:o?.maxPdfPages,maxFiles:o?.maxFiles,upload:d?u:void 0,onDiscard:d?c:void 0,error:s,reportError:l}}var qa=j(Ee(),1);function du(e){return e.map(t=>({id:null,text:t}))}function Ss(e){let{flow:t,followup:a,page:n,channel:r}=e;return t!==null?{origin:"flow",suggestions:t}:a?.length?{origin:"followup",suggestions:a}:n?.length?{origin:"page",suggestions:n}:r?.length?{origin:"channel",suggestions:r}:null}function fu(e){return typeof e=="object"&&e!==null}function SB(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function IY(e){if(!fu(e)||!("toolCallId"in e)||!("output"in e))return null;let t=e.output;if(!fu(t)||!fu(t._meta))return null;let a=t._meta[Fw];return!fu(a)||!SB(a.suggestions)?null:a.suggestions}function IB(e){let t=null;for(let a of e.parts){let n=IY(a);n!==null&&(t=n)}return t}function CB(e){for(let t of e.parts){if(!fu(t)||t.type!=="data-suggestions")continue;let a=t.data;if(fu(a)&&SB(a.suggestions)&&a.suggestions.length>0)return a.suggestions}return null}function CY(e){return"page"in e||"channel"in e}function kY(e){return typeof e!="object"||e===null?{}:CY(e)?{rungs:e}:{initial:e.initial}}function kB(e){let{messages:t,status:a,suggestions:n}=e,r=n!==!1,{rungs:o,initial:i}=kY(n),s=(0,qa.useMemo)(()=>({page:null,channel:du(i??[])}),[i]),l=o??s,u=(0,qa.useMemo)(()=>r?Ss({flow:null,followup:null,...l}):null,[r,l]),c=(0,qa.useMemo)(()=>u?.suggestions.map(g=>g.text)??[],[u]),[d,p]=(0,qa.useState)(c),[m,h]=(0,qa.useState)(u?.origin??"channel"),v=(0,qa.useRef)(a),I=(0,qa.useCallback)(()=>{p([])},[]),y=t.length>0;(0,qa.useEffect)(()=>{y||(p(c),h(u?.origin??"channel"))},[c,u,y]);let w=t[t.length-1];return(0,qa.useEffect)(()=>{w?.role==="user"&&I()},[w,I]),(0,qa.useEffect)(()=>{let g=v.current;if(v.current=a,g!=="streaming"||a!=="ready"||!r)return;let S=[...t].reverse().find(O=>O.role==="assistant");if(!S)return;let E=IB(S),T=CB(S),R=Ss({flow:E===null?null:du(E),followup:T===null?null:du(T),page:null,channel:null});p(R?R.suggestions.map(O=>O.text):[]),h(R?.origin??"channel")},[a,r,t]),{suggestions:d,source:m,isLoading:!1,clear:I}}function TB(e,t){let a=t?.Authorization,n=typeof a=="string"&&a.startsWith("Bearer ")?a.slice(7):null;return Oa(e,"/resource",n?{token:n}:void 0)}var TY={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"],glassTint:["--ww-glass-tint"],glassTintStrength:["--ww-glass-tint-opacity"]};function pu(e){let t={};for(let[a,n]of Object.entries(TY)){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 nt=j(he(),1),mu=(0,Qe.forwardRef)(function(t,a){let{locale:n,messages:r}=t;return(0,nt.jsx)(es,{locale:n,messages:r,children:(0,nt.jsx)(LY,{...t,ref:a})})}),LY=(0,Qe.forwardRef)(function(t,a){let{t:n,ready:r}=Ue(),{appearance:o,className:i,classNames:s,allowAttachments:l=!1,documentUpload:u,welcomeMessage:c,welcome:d,placeholder:p=n.promptInput.placeholder,triggerEvent:m="triggerDemoRequest",api:h,mcp:v,debug:I=!1,readOnly:y=!1,title:w,headerActions:g,hideHeader:S=!1,enableThreadHistory:E=!1,showToolCalls:T=!0,initializing:R=!1,onScreen:O=!0,disclaimer:U}=t,A=o?.theme,Q=o?.variables,$=o?.assistantBubble??!1,q=Q?pu(Q):{},[Z,X]=(0,Qe.useState)(!1);(0,Qe.useEffect)(()=>{if(A!=="auto"||typeof window>"u")return;let k=window.matchMedia("(prefers-color-scheme: dark)");X(k.matches);let D=()=>X(k.matches);return k.addEventListener("change",D),()=>k.removeEventListener("change",D)},[A]);let B=A==="dark"||A==="auto"&&Z,P=xB({...t,api:h}),J=Dh(),ge=rB({...t,api:h,sessionId:P.sessionId,onCallTool:v?.onCallTool}),C=v?.resourceEndpoint??TB(h,t.headers),ze=(0,Qe.useRef)({});ze.current={api:h,token:qp(t.headers),channelId:typeof t.body?.channelId=="string"?t.body.channelId:void 0,sessionId:P.sessionId};let ot=(0,Qe.useCallback)(k=>{Hp("widget",ze.current,{widget:k.widget,outcome:k.outcome},k.metrics)},[]),x=Hl(p,!P.text),ae=bB({api:h,headers:t.headers,uploadHeaders:t.uploadHeaders,sessionId:P.sessionId,documentUpload:u,allowAttachments:l}),[re,Ce]=(0,Qe.useState)(null),[We,be]=(0,Qe.useState)(null),Oe=(0,Qe.useRef)(null),we=(0,Qe.useRef)(null),ce=(0,Qe.useRef)(null),Le=(0,Qe.useRef)(null),[ie,xe]=(0,Qe.useState)(!0),Ne=(0,Qe.useRef)(ie);Ne.current=ie;let _e=(0,Qe.useCallback)(()=>{let k=Oe.current;if(!k)return;let D=k.querySelector("textarea");D&&D.focus()},[]),Fe=(0,Qe.useCallback)((k="smooth")=>{let D=we.current;D&&D.scrollTo({top:D.scrollHeight,behavior:k})},[]);(0,Qe.useEffect)(()=>{let k=Le.current,D=we.current;if(!k||!D)return;let H=new IntersectionObserver(([fe])=>xe(fe.isIntersecting),{root:D,rootMargin:"0px 0px 200px 0px",threshold:0});return H.observe(k),()=>H.disconnect()},[]),(0,Qe.useEffect)(()=>{let k=we.current;if(!k)return;let D=H=>{let qe=(H.target instanceof Element?H.target:null)?.closest("a");qe?.href&&J.emit({name:"link.clicked",properties:{url:qe.href}})};return k.addEventListener("click",D),()=>k.removeEventListener("click",D)},[J]),(0,Qe.useEffect)(()=>{(P.messages[P.messages.length-1]?.role==="user"||Ne.current)&&Fe("smooth")},[P.messages.length,P.messages[P.messages.length-1]]),(0,Qe.useEffect)(()=>{Fe("auto")},[Fe]),(0,Qe.useEffect)(()=>{if(typeof ResizeObserver>"u")return;let k=we.current,D=ce.current;if(!k&&!D)return;let H=k?.scrollHeight??0,fe=k?.clientHeight??0,qe=new ResizeObserver(()=>{let gt=we.current;if(!gt)return;let In=gt.scrollTop+fe>=H-5;H=gt.scrollHeight,fe=gt.clientHeight,In&&Fe("auto")});return k&&qe.observe(k),D&&qe.observe(D),()=>qe.disconnect()},[Fe]);let Ae=kB({messages:P.messages,status:P.status,suggestions:t.suggestions}),de=(0,Qe.useRef)(null);(0,Qe.useEffect)(()=>{let k=Ae.suggestions;!O||k.length===0||de.current===k||(de.current=k,J.emit({name:"suggestions.shown",properties:{texts:k,origin:Ae.source}}))},[Ae.suggestions,Ae.source,J,O]);let W=d?.suggestions,ct=(0,Qe.useRef)(null);(0,Qe.useEffect)(()=>{!O||P.messages.length>0||!W?.length||ct.current===W||(ct.current=W,J.emit({name:"suggestions.shown",properties:{texts:W,origin:"channel"}}))},[W,P.messages.length,J,O]);let le=(0,Qe.useCallback)(k=>{let D=k.content.map(H=>H.text??"").join("").trim();D&&P.handleSubmit({text:D,files:[],modelContext:k.modelContext})},[P.handleSubmit]),oe=(0,Qe.useCallback)(k=>{let D=Ae.suggestions.indexOf(k),H=D>=0?D:d?.suggestions?.indexOf(k)??-1,fe=D>=0?Ae.source:"channel";J.emit({name:"suggestion.clicked",properties:{text:k,index:H,origin:fe}}),Ae.clear(),P.handleSubmit({text:k,files:[]})},[Ae.suggestions,Ae.source,Ae.clear,P.handleSubmit,d,J]);(0,Qe.useImperativeHandle)(a,()=>({sendMessage:k=>{P.handleSubmit({text:k,files:[]}),_e()},sendMessageAndWait:k=>P.sendMessageAndWait(k),reset:P.reset,focus:_e,get messages(){return P.messages},get sessionId(){return P.sessionId}}),[P.handleSubmit,P.sendMessageAndWait,P.reset,P.messages,P.sessionId,_e]),(0,Qe.useEffect)(()=>{if(!m)return;let k=D=>{let H=D.detail,fe=typeof H?.message=="string"?H.message:void 0;fe&&P.handleSubmit({text:fe,files:[]}),_e()};return window.addEventListener(m,k),()=>window.removeEventListener(m,k)},[m,P.handleSubmit,_e]);let ke=!S&&!!(w||E||P.keepsSession||g),ee=R||!r;return(0,nt.jsxs)("div",{ref:Oe,style:{...q,maxHeight:"inherit",...re&&We?{height:We}:{},opacity:ee?0:1,transition:"opacity 220ms ease-out"},"data-waniwani-chat":"","data-waniwani-layout":"embed","data-assistant-bubble":$?"true":void 0,"data-color-scheme":A==="auto"?"auto":void 0,...ee?{"data-waniwani-initializing":""}:{},...B?{"data-waniwani-dark":""}:{},className:V("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",A==="dark"&&"dark",i,s?.root),children:[ke&&(0,nt.jsxs)("div",{className:V("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",s?.header),style:{backgroundColor:"var(--ww-color-card-header)",color:"var(--ww-color-card-header-foreground)"},children:[w&&(0,nt.jsx)("div",{className:"ww:text-sm ww:font-semibold ww:truncate ww:flex-1 ww:min-w-0",children:w}),!w&&(0,nt.jsx)("div",{className:"ww:flex-1"}),!E&&P.keepsSession&&(0,nt.jsx)(Mh,{onClick:P.reset}),E&&(0,nt.jsx)(tB,{threads:P.threads,activeThreadId:P.activeThreadId,onNewThread:P.startNewThread,onSelectThread:k=>{P.switchThread(k)},onDeleteThread:k=>{P.deleteThread(k)}}),g]}),(0,nt.jsxs)("div",{ref:we,className:V("ww:relative ww:flex-1 ww:min-h-0",re?"ww:overflow-hidden":"ww:overflow-y-auto"),children:[(0,nt.jsxs)("div",{ref:ce,className:V("ww:mx-auto ww:w-full ww:max-w-3xl ww:px-4 ww:py-6 ww:flex ww:flex-col ww:gap-6",re&&"ww:!py-0"),children:[(0,nt.jsx)(GU,{value:ot,children:(0,nt.jsx)(JU,{messages:P.messages,status:P.status,welcomeMessage:c,welcome:d,onSuggestionSelect:oe,resourceEndpoint:C,chatSessionId:P.sessionId,isDark:B,onFollowUp:le,onCallTool:ge,fullscreenToolCallId:re,debug:I,showToolCalls:T,toolDefinitions:P.toolDefinitions,messageClassNames:{message:s?.message,userBubble:s?.userBubble,assistantBubble:s?.assistantBubble},onWidgetDisplayModeChange:(k,D)=>{if(k==="fullscreen"){let H=Oe.current?.getBoundingClientRect().height??0;be(H>0?H:null),Ce(D.toolCallId)}else be(null),Ce(null)}})}),(0,nt.jsx)("div",{ref:Le,"aria-hidden":!0,style:{height:1}})]}),!ie&&!re&&(0,nt.jsx)("div",{className:"ww:sticky ww:bottom-2 ww:flex ww:justify-center ww:pointer-events-none",children:(0,nt.jsx)(Ir,{type:"button",onClick:()=>Fe("smooth"),size:"icon",variant:"outline",className:"ww:rounded-full ww:shadow ww:pointer-events-auto","aria-label":"Scroll to latest",children:(0,nt.jsx)(kc,{className:"ww:size-4"})})})]}),!y&&(0,nt.jsxs)("div",{className:"ww:shrink-0 ww:bg-background",style:re?{display:"none"}:void 0,children:[(0,nt.jsx)(Sl,{suggestions:Ae.suggestions,isLoading:Ae.isLoading,onSelect:oe}),(0,nt.jsx)(FM,{queuedMessages:P.queuedMessages,onRemove:P.removeQueuedMessage}),(0,nt.jsx)("div",{className:"ww:px-4 ww:pb-2 ww:pt-2",children:(0,nt.jsxs)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl",children:[(0,nt.jsxs)(CM,{onSubmit:P.handleSubmit,attachmentsEnabled:ae.enabled,globalDrop:ae.enabled,multiple:ae.enabled,accept:ae.accept,maxFileSize:ae.maxFileSize,maxPdfPages:ae.maxPdfPages,maxFiles:ae.maxFiles,upload:ae.upload,onDiscard:ae.onDiscard,onError:ae.reportError,className:V("ww-input ww:rounded-2xl ww:border-border ww:bg-input",s?.input),children:[(0,nt.jsx)(MM,{enabled:ae.enabled}),ae.enabled&&(0,nt.jsx)(AM,{className:"ww:px-4 ww:pt-3"}),(0,nt.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-4 ww:pr-3 ww:py-2.5",children:[ae.enabled&&(0,nt.jsx)(EM,{}),(0,nt.jsx)(TM,{onChange:P.handleTextChange,value:P.text,placeholder:x,className:"ww:min-h-0 ww:py-1 ww:px-0"}),(0,nt.jsx)(LM,{status:P.status,disabled:P.queueFull,onStop:P.stop})]})]}),ae.error&&(0,nt.jsx)("output",{className:"ww:block ww:pt-1.5 ww:text-center ww:text-destructive ww:text-xs",children:ae.error.message}),(0,nt.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,nt.jsx)(QU,{}),(0,nt.jsx)(RM,{text:U})]})]})})]})]})});var Jd=j(Ee(),1);var LB="500px",EY="https://app.waniwani.ai/api/mcp/chat",AY={api:EY};function oI(){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 jh(){let e=oI();if(!e)return{};let t=J=>e.getAttribute(J)??void 0,a=J=>{let ge=e.getAttribute(J);if(ge==null)return;let C=ge.trim().toLowerCase();if(C==="true"||C==="1"||C==="")return!0;if(C==="false"||C==="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 s=t("data-title");s&&(n.title=s);let l=t("data-welcome-message");l&&(n.welcomeMessage=l);let u=t("data-placeholder");u&&(n.placeholder=u);let c=t("data-mcp-server-url");c&&(n.mcpServerUrl=c);let d=t("data-webmcp");d&&(n.webmcp={enabled:d!=="false"&&d!=="off"});let p=t("data-channel-id");if(p&&(n.channelId=p),t("data-show-tool-calls")?.trim().toLowerCase()==="titles-only")n.showToolCalls="titles-only";else{let J=a("data-show-tool-calls");J!==void 0&&(n.showToolCalls=J)}let h=t("data-css");h&&(n.css=h);let v=t("data-suggestions");v&&(n.suggestions=v.split(",").map(J=>J.trim()).filter(Boolean));let I=a("data-enable-thread-history");I!==void 0&&(n.enableThreadHistory=I);let y=a("data-disable-page-view");y!==void 0&&(n.disablePageView=y);let w=a("data-hide-header");w!==void 0&&(n.hideHeader=w);let g=t("data-theme");(g==="light"||g==="dark"||g==="auto")&&(n.appearance={...n.appearance,theme:g});let S=a("data-assistant-bubble");S!==void 0&&(n.appearance={...n.appearance,assistantBubble:S});let E=t("data-locale");(E==="en"||E==="fr"||E==="es")&&(n.locale=E);let T=t("data-mode");(T==="inline"||T==="floating"||T==="composer"||T==="off")&&(n.mode=T);let R={},O=t("data-composer-variant")?.trim().toLowerCase();(O==="glow"||O==="outline")&&(R.variant=O);let U=t("data-composer-size")?.trim().toLowerCase();(U==="sm"||U==="md"||U==="lg")&&(R.size=U);let A=a("data-composer-suggestions");A!==void 0&&(R.showSuggestions=A);let Q=t("data-composer-align")?.trim().toLowerCase();(Q==="start"||Q==="center")&&(R.align=Q);let $=a("data-composer-trigger");$!==void 0&&(R.trigger=$);let q=a("data-composer-mobile-trigger");q!==void 0&&(R.mobileTrigger=q),Object.keys(R).length>0&&(n.composer=R);let Z=t("data-height");Z&&(n.height=Z);let X=t("data-launcher-text");X&&(n.launcherText=X);let B=t("data-appear-delay");if(B!==void 0){let J=Number.parseInt(B.trim(),10);Number.isFinite(J)&&J>=0&&(n.appearDelay=J)}let P=t("data-disclaimer");if(P!==void 0){let J=P.trim(),ge=J.toLowerCase();ge==="false"||ge==="0"?n.disclaimer=!1:J&&(n.disclaimer=J)}return n}function Xd(e){if(!e)return{};let t={};for(let a in e)e[a]!==void 0&&(t[a]=e[a]);return t}function Kd(e,t,a){let n=a??jh(),r=MY(t,n,e),o={...t?.composer??{},...Xd(n.composer),...Xd(e?.composer)},i=Object.keys(o).length>0,s={token:"",...AY,...Xd(t),...Xd(n),...Xd(e),...r?{appearance:r}:{},...i?{composer:o}:{}};if(!s.token)throw new Error("[Waniwani] Missing required config: `token`. Set data-token on the script tag or pass it to Waniwani.chat.init().");return s}function MY(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 s={};return n&&(s.theme=n),o&&(s.variables=r),i!==void 0&&(s.assistantBubble=i),s}var _B=j(Ee(),1);var Vh=j(Ee(),1);function RY(e){return e?.patterns??e?.rules??[]}var EB="\0\0";function DY(e){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*\\\*/g,EB).replace(/\\\*/g,"[^/]*").split(EB).join(".*");return new RegExp(`^${a}$`)}function AB(e,t){try{return DY(e).test(t)}catch{return!1}}function Yd(e,t){if(!e)return!0;let a=!1;for(let n of RY(e))if(AB(n.glob,t)){if(n.action==="hide")return!1;a=!0}return a?!0:(e.default??"show")!=="hide"}function MB(e,t){for(let a of e?.appearRules??[])if(AB(a.glob,t))return a.appearAfter;return null}var iI="waniwani:locationchange",RB=!1;function _Y(){if(!(RB||typeof history>"u")){RB=!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(iI)),r}}}}function PY(e){return _Y(),window.addEventListener(iI,e),window.addEventListener("popstate",e),()=>{window.removeEventListener(iI,e),window.removeEventListener("popstate",e)}}function OY(){return window.location.pathname}function NY(){return"/"}function Zd(){return(0,Vh.useSyncExternalStore)(PY,OY,NY)}function hu(e,t){let a=Zd(),n=t&&Yd(e,a);return(0,Vh.useEffect)(()=>{Na("visibility gate",{pathname:a,ready:t,visible:n,rules:e})},[a,t,n]),n}var UY=3,BY=["low","medium","high"];function sI(e){if(e.length===0)return;let t=Math.floor(Math.random()*e.length),[a]=e.splice(t,1);return a}function zY(e){let t=new Map,a=[];for(let o of e)if(o.tier){let i=t.get(o.tier)??[];i.push(o),t.set(o.tier,i)}else a.push(o);let n=[];for(let o of BY){let i=sI(t.get(o)??[])??sI(a);i&&n.push(i)}let r=[...t.values()].flat().concat(a);for(;n.length<Math.min(UY,e.length);){let o=sI(r);if(!o)break;n.push(o)}return n}function DB(e){let t;try{t=new URL(e,"http://localhost").pathname}catch{t="/"}let a=t.replace(/\/+$/,"");return(a===""?"/":a).toLowerCase()}function PB(e){return Array.isArray(e)?e.flatMap(t=>{let a=t;if(typeof a?.url!="string"||a.url.length===0||!Array.isArray(a.prompts))return[];let n=a.prompts.flatMap(r=>{let o=r;return typeof o?.text!="string"||o.text.length===0?[]:[{id:typeof o.id=="string"?o.id:null,text:o.text,tier:o.tier==="low"||o.tier==="medium"||o.tier==="high"?o.tier:void 0}]});return n.length>0?[{url:a.url,prompts:n}]:[]}):[]}function gu(e){let{pageSuggestions:t,suggestions:a}=e,n=Zd();return(0,_B.useMemo)(()=>{let r=DB(n),o=t?.find(s=>DB(s.url)===r),i=o?zY(o.prompts).map(({id:s,text:l})=>({id:s,text:l})):null;return Na("configured suggestions resolve",{pathname:r,matched:!!o,count:i?.length??0}),{page:i,channel:du(a??[])}},[n,t,a])}var FY="waniwani:config:";function OB(e,t,a){return`${FY}${e}|${t}|${a??""}`}function ci(e,t,a){if(typeof window>"u")return null;try{let n=window.sessionStorage.getItem(OB(e,t,a));if(!n)return null;let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function qY(e,t,a,n){if(!(typeof window>"u"))try{window.sessionStorage.setItem(OB(e,t,a),JSON.stringify(n))}catch{}}var HY=600;function jY(e){if(typeof e!="object"||e===null||typeof e.enabled!="boolean")return null;let t=Array.isArray(e.accept)?e.accept.filter(n=>typeof n=="string"):[],a=n=>typeof n=="number"&&Number.isFinite(n)&&n>0;return e.enabled?a(e.maxBytes)&&a(e.maxPdfPages)&&a(e.maxFiles)&&t.length>0?{enabled:!0,maxBytes:e.maxBytes,maxPdfPages:e.maxPdfPages,maxFiles:e.maxFiles,accept:t}:null:{enabled:!1,maxBytes:0,maxPdfPages:0,maxFiles:0,accept:t}}async function VY(e,t,a,n){Di("configStart");let r=await $Y(e,t,a,n);return Di("configEnd"),a?.aborted||Yw(r.metadata),r}async function $Y(e,t,a,n){try{let r=Oa(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(),s=i&&typeof i=="object"&&"data"in i&&i.data?i.data:i;return s?WY(s):{}}catch{return{}}}function WY(e){let t={};e.source!=null&&(t.source=e.source),e.channelId!=null&&(t.channelId=e.channelId),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);let a=PB(e.pageSuggestions);a.length>0&&(t.pageSuggestions=a),typeof e.enableThreadHistory=="boolean"&&(t.enableThreadHistory=e.enableThreadHistory),typeof e.sessionApi=="string"&&e.sessionApi&&(t.sessionApi=e.sessionApi),typeof e.webmcp?.enabled=="boolean"&&(t.webmcp={enabled:e.webmcp.enabled}),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);let n=jY(e.documentUpload);return n&&(t.documentUpload=n),e.metadata&&typeof e.metadata=="object"&&(t.metadata=e.metadata),t}function yu(e,t,a){let[n,r]=(0,Jd.useState)(e),[o,i]=(0,Jd.useState)(!1);return(0,Jd.useEffect)(()=>{let s=e.api,l=e.token,u=e.channelId;if(!s||!l){i(!0);return}let c=h=>{e.disablePageView||E1({api:s,token:l,channelId:u??h.channelId,mode:e.mode==="off"?void 0:e.mode,source:h.source})},d=ci(s,l,u);if(d)try{let h=Kd(t,d,a);r(h),jp("cache"),Yw(d.metadata),i(!0),Na("config resolved (sessionStorage cache)",{config:h,visibility:h.visibility}),c(d)}catch{}let p=new AbortController,m=setTimeout(()=>{jp("timeout"),i(!0)},HY);return VY(s,l,p.signal,u).then(h=>{if(!p.signal.aborted){if(Na("remote /config response",h),Object.keys(h).length>0){qY(s,l,u,h);try{let v=Kd(t,h,a);r(v),Na("config resolved (remote)",{config:v,visibility:v.visibility})}catch(v){console.error("[Waniwani] Failed to apply remote config:",v)}}jp("remote"),i(!0),c(h)}}).catch(h=>{console.error("[Waniwani] Remote config fetch failed:",h),i(!0)}).finally(()=>clearTimeout(m)),()=>{p.abort(),clearTimeout(m)}},[e.api,e.token,e.channelId]),{config:n,ready:o}}var Wt=j(he(),1),GY={sm:{row:"ww:gap-1 ww:pl-3 ww:pr-1 ww:py-1",field:"ww:py-1 ww:text-base ww:sm:text-sm",send:"ww:size-7",sendIcon:"ww:size-3.5",radius:12},md:{row:"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",field:"ww:py-1.5 ww:text-base ww:sm:text-sm",send:"ww:size-8",sendIcon:"ww:size-4",radius:16},lg:{row:"ww:gap-2 ww:pl-5 ww:pr-2 ww:py-2.5 ww:sm:pl-6 ww:sm:pr-2.5 ww:sm:py-3",field:"ww:py-2 ww:text-base",send:"ww:size-10",sendIcon:"ww:size-5",radius:20}},NB="var(--ww-composer-bg, var(--ww-color-input))",XY="var(--ww-composer-border-color, var(--ww-color-border))",KY="var(--ww-composer-border-width, 1px)",UB="var(--ww-composer-send-bg, var(--ww-color-foreground))",BB="var(--ww-composer-send-fg, var(--ww-color-background))",FB=(0,rt.forwardRef)(function(t,a){return(0,Wt.jsx)(es,{locale:t.config.locale,children:(0,Wt.jsx)(YY,{...t,ref:a})})}),YY=(0,rt.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,panelContainer:r,onVisibilityChange:o},i){let{t:s}=Ue(),{config:l,ready:u}=yu(t,a,n),c=hu(l.visibility,u);(0,rt.useEffect)(()=>{o?.(c)},[c,o]),ru({api:l.api,token:l.token,channelId:l.channelId,mode:"composer",paintMark:"chatVisible",painted:u});let d=(0,rt.useRef)(null),p=(0,rt.useMemo)(()=>su({mode:"composer",getSessionId:()=>d.current?.sessionId}),[]),m=l.onEvent;(0,rt.useEffect)(()=>{if(m)return p.subscribe(m)},[m,p]);let h=(0,rt.useRef)(null),v=(0,rt.useRef)(null),[I,y]=(0,rt.useState)(!1),[w,g]=(0,rt.useState)(""),[S,E]=(0,rt.useState)(0),T=l.appearance?.theme,R=l.appearance?.variables,O=(0,rt.useMemo)(()=>R?pu(R):{},[R]),U=gu(l),A=(0,rt.useMemo)(()=>Ss({flow:null,followup:null,...U}),[U]),Q=(0,rt.useMemo)(()=>A?.suggestions.map(de=>de.text)??[],[A]);Fl({widgetEvents:p,api:l.api,token:l.token,channelId:l.channelId,source:l.source,mode:"composer",pagePrompts:U.page,getSessionId:()=>d.current?.sessionId});let $=(0,rt.useRef)(null);(0,rt.useEffect)(()=>{!c||!A||$.current!==A&&($.current=A,p.emit({name:"suggestions.shown",properties:{texts:Q,origin:A.origin}}))},[c,A,Q,p]);let q=l.composer??{},Z=q.variant??"glow",X=GY[q.size??"md"],B=q.showSuggestions??!0,P=q.align==="center",J=nM(),ge=(q.trigger??!1)||J&&(q.mobileTrigger??!0),C=l.launcherText??l.placeholder??s.launcher.prompt,ze=Hl(C,!ge&&w.length===0),ot="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,rt.useEffect)(()=>{let de=h.current;if(de){if(!w){de.style.height="";return}de.style.height="auto",de.style.height=`${de.scrollHeight}px`}},[w]),(0,rt.useEffect)(()=>{S>0&&I&&d.current?.focus()},[S,I]);let x=(0,rt.useRef)(!1);(0,rt.useEffect)(()=>{u&&!x.current&&(x.current=!0,p.emit({name:"chat.ready"}))},[u,p]);let ae=(0,rt.useRef)(!1);(0,rt.useEffect)(()=>{let de=c&&I;de!==ae.current&&(ae.current=de,p.emit({name:de?"chat.opened":"chat.closed"}))},[c,I,p]);let re=(0,rt.useCallback)(de=>{y(!0),E(ct=>ct+1);let W=de.trim();W&&d.current?.sendMessage(W)},[]);(0,rt.useImperativeHandle)(i,()=>({open:()=>y(!0),close:()=>y(!1),toggle:()=>y(de=>!de),sendMessage:de=>re(de),sendMessageAndWait:async de=>{y(!0);let W=d.current;if(W)return await W.sendMessageAndWait(de)},reset:()=>d.current?.reset(),focus:()=>{I?E(de=>de+1):(h.current??v.current)?.focus()},getMessages:()=>d.current?.messages??[],getSessionId:()=>d.current?.sessionId}),[re,I]);let Ce=(0,rt.useCallback)(()=>{w.trim()&&(re(w),g(""))},[w,re]),We=(0,rt.useCallback)(()=>{(d.current?.messages.length??0)>0&&(y(!0),E(de=>de+1))},[]),be={mode:"composer"},Oe=zl(l.sessionApi);l.mcpServerUrl&&(be.mcpServerUrl=l.mcpServerUrl),l.channelId&&(be.channelId=l.channelId);let we=(0,Wt.jsx)("button",{type:"button",onClick:()=>y(!1),"aria-label":s.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,Wt.jsx)(wn,{className:"ww:size-4"})}),ce=(0,Wt.jsxs)("div",{className:V("ww:flex ww:items-end",X.row),children:[(0,Wt.jsx)("textarea",{ref:h,rows:1,value:w,placeholder:ze,onChange:de=>g(de.target.value),onFocus:We,onKeyDown:de=>{de.key==="Enter"&&!de.shiftKey&&(de.preventDefault(),Ce())},className:V("ww:min-w-0 ww:flex-1 ww:resize-none ww:bg-transparent ww:max-h-36 ww:text-foreground ww:outline-none ww:placeholder:text-muted-foreground",X.field,!w&&"ww:overflow-hidden ww:whitespace-nowrap ww:text-ellipsis ww:placeholder:overflow-hidden ww:placeholder:text-ellipsis")}),(0,Wt.jsx)("button",{type:"button",onClick:Ce,disabled:!w.trim(),"aria-label":s.promptInput.submit,className:V("ww:relative ww:flex ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full ww:transition-opacity hover:ww:opacity-90 disabled:ww:opacity-40",X.send),style:{background:UB,color:BB},children:(0,Wt.jsx)(hr,{className:X.sendIcon})})]}),Le=(0,Wt.jsxs)("button",{ref:v,type:"button",onClick:()=>re(""),className:V("ww:flex ww:w-full ww:items-center ww:text-left ww:cursor-pointer",X.row,P&&"ww:justify-center"),children:[(0,Wt.jsx)("span",{className:V("ww:min-w-0 ww:flex-1 ww:truncate ww:text-muted-foreground",X.field,P&&"ww:flex-none"),children:C}),(0,Wt.jsx)("span",{"aria-hidden":!0,className:V("ww:flex ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full",X.send,P&&"ww:ml-3"),style:{background:UB,color:BB},children:(0,Wt.jsx)(hr,{className:X.sendIcon})})]}),ie=ge?Le:ce,xe=`var(--ww-composer-radius, ${X.radius}px)`,Ne={borderRadius:xe,background:NB,borderColor:XY,borderWidth:KY,borderStyle:"solid",boxShadow:`var(--ww-composer-shadow, ${ot})`},_e=Z==="glow"?(0,Wt.jsx)(Xp,{animated:u,backgroundColor:NB,borderRadius:xe,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],style:Ne,children:ie}):(0,Wt.jsx)("div",{className:V(ge&&"ww:transition-colors hover:ww:border-primary/40"),style:Ne,children:ie}),Fe=(0,Wt.jsxs)("div",{"data-waniwani-chat":"","data-color-scheme":T==="auto"?"auto":void 0,"data-waniwani-composer":"input","data-composer-variant":Z,inert:I,className:V("ww:w-full ww:font-[family-name:var(--ww-font-sans)]",T==="dark"&&"dark"),style:O,children:[_e,B&&Q.length>0&&(0,Wt.jsx)(Sl,{suggestions:Q,onSelect:de=>{p.emit({name:"suggestion.clicked",properties:{text:de,index:Q.indexOf(de),origin:A?.origin??"channel"}}),re(de)},align:P?"center":"start",className:"ww:px-0.5 ww:pt-2.5 ww:pb-0"})]}),Ae=(0,Wt.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":T==="auto"?"auto":void 0,className:V("ww:contents ww:font-[family-name:var(--ww-font-sans)]",T==="dark"&&"dark"),style:O,children:(0,Wt.jsx)("div",{role:"dialog","aria-label":l.title??C,"data-waniwani-floating":"panel","data-state":c&&I?"shown":"hidden",style:{boxShadow:ot},className:V("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,Wt.jsx)(mu,{transport:Oe,ref:d,api:l.api??"",headers:{Authorization:`Bearer ${l.token}`},skipRemoteConfig:!0,body:be,appearance:l.appearance,title:l.title,headerActions:we,hideHeader:!1,onScreen:I,welcomeMessage:l.welcomeMessage,placeholder:l.placeholder,suggestions:U,enableThreadHistory:l.enableThreadHistory,documentUpload:l.documentUpload,showToolCalls:l.showToolCalls,locale:l.locale,initializing:!u})})});return(0,Wt.jsxs)(lu,{value:p,children:[Fe,(0,zB.createPortal)(Ae,r)]})});var lI="/*! 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-black:#000;--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-md:12px;--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\\: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-0{bottom:calc(var(--ww-spacing)*0)}.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-\\[2147483000\\]{z-index:2147483000}.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-3{margin-left:calc(var(--ww-spacing)*3)}.ww\\:ml-auto{margin-left:auto}.ww\\:line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ww\\:block{display:block}.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-10{width:calc(var(--ww-spacing)*10);height:calc(var(--ww-spacing)*10)}.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-0\\.5{height:calc(var(--ww-spacing)*.5)}.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-36{max-height:calc(var(--ww-spacing)*36)}.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-60{width:calc(var(--ww-spacing)*60)}.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-72{max-width:calc(var(--ww-spacing)*72)}.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\\:flex-none{flex:none}.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-default{cursor:default}.ww\\:cursor-pointer{cursor:pointer}.ww\\:resize-none{resize:none}.ww\\:list-none{list-style-type: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\\:justify-end{justify-content:flex-end}.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-2\\.5{gap:calc(var(--ww-spacing)*2.5)}.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-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-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-2{border-style:var(--tw-border-style);border-width:2px}.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-dashed{--tw-border-style:dashed;border-style:dashed}.ww\\:border-none{--tw-border-style:none;border-style:none}.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-primary{border-color:var(--ww-color-primary,#6366f1)}.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-background\\/85{background-color:var(--ww-color-background,#fff)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-background\\/85{background-color:color-mix(in oklab,var(--ww-color-background,#fff)85%,transparent)}}.ww\\:bg-black\\/45{background-color:var(--ww-color-black)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-black\\/45{background-color:color-mix(in oklab,var(--ww-color-black)45%,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-contain{object-fit:contain}.ww\\:object-cover{object-fit:cover}.ww\\:object-center{object-position:center}.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-2\\.5{padding:calc(var(--ww-spacing)*2.5)}.ww\\:p-3{padding:calc(var(--ww-spacing)*3)}.ww\\:px-0{padding-inline:calc(var(--ww-spacing)*0)}.ww\\:px-0\\.5{padding-inline:calc(var(--ww-spacing)*.5)}.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-1\\.5{padding-top:calc(var(--ww-spacing)*1.5)}.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{padding-right:calc(var(--ww-spacing)*1)}.ww\\:pr-1\\.5{padding-right:calc(var(--ww-spacing)*1.5)}.ww\\:pr-2{padding-right:calc(var(--ww-spacing)*2)}.ww\\:pr-3{padding-right:calc(var(--ww-spacing)*3)}.ww\\:pr-9{padding-right:calc(var(--ww-spacing)*9)}.ww\\:pb-0{padding-bottom:calc(var(--ww-spacing)*0)}.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\\:pl-1{padding-left:calc(var(--ww-spacing)*1)}.ww\\:pl-3{padding-left:calc(var(--ww-spacing)*3)}.ww\\:pl-3\\.5{padding-left:calc(var(--ww-spacing)*3.5)}.ww\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:pl-5{padding-left:calc(var(--ww-spacing)*5)}.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\\:text-ellipsis{text-overflow:ellipsis}.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\\:underline{text-decoration-line:underline}.ww\\:underline-offset-2{text-underline-offset:2px}.ww\\:opacity-0{opacity:0}.ww\\:opacity-60{opacity:.6}.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-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);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\\: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\\:backdrop-blur-md{--tw-backdrop-blur:blur(var(--ww-blur-md));-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-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-\\[width\\]{transition-property: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\\:overflow-hidden::placeholder{overflow:hidden}.ww\\:placeholder\\:text-ellipsis::placeholder{text-overflow:ellipsis}.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-border:hover{background-color:var(--ww-color-border,#e5e7eb)}.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\\:py-3{padding-block:calc(var(--ww-spacing)*3)}.ww\\:sm\\:pr-2{padding-right:calc(var(--ww-spacing)*2)}.ww\\:sm\\:pr-2\\.5{padding-right:calc(var(--ww-spacing)*2.5)}.ww\\:sm\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:sm\\:pl-6{padding-left:calc(var(--ww-spacing)*6)}.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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat]{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#eceef499)}}[data-waniwani-chat]{--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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){.dark [data-waniwani-chat],[data-waniwani-chat].dark{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#282a3480)}}.dark [data-waniwani-chat],[data-waniwani-chat].dark{--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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat][data-color-scheme=auto]{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#282a3480)}}[data-waniwani-chat][data-color-scheme=auto]{--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}}";function ZY(e){return e.startsWith("__WANIWANI")}function $h(e){if(!lI||ZY(lI))return;let t=document.createElement("style");t.textContent=lI,e.appendChild(t)}var Ve=j(Ee(),1);var Wh=j(Ee(),1),JY=3e3,QY=120,eZ=24;function qB(e){let[t,a]=(0,Wh.useState)(!1);return(0,Wh.useEffect)(()=>{if(!e||typeof document>"u"){a(!1);return}let n=!1,r=null,o=null,i=null,s=u=>{r=new IntersectionObserver(c=>{let d=c[0];d&&a(!d.isIntersecting&&d.boundingClientRect.bottom<=0)},{rootMargin:`0px 0px -${eZ}px 0px`,threshold:0}),r.observe(u)},l=()=>{if(n)return;let u=null;try{u=document.querySelector(e)}catch{a(!0);return}if(u){s(u);return}o=setTimeout(l,QY)};return l(),i=setTimeout(()=>{n||r||(o&&clearTimeout(o),a(!0))},JY),()=>{n=!0,r?.disconnect(),o&&clearTimeout(o),i&&clearTimeout(i)}},[e]),t}var Rt=j(he(),1),tZ=2e3,aZ=90,nZ=1e3,HB=(0,Ve.forwardRef)(function(t,a){return(0,Rt.jsx)(es,{locale:t.config.locale,children:(0,Rt.jsx)(rZ,{...t,ref:a})})}),rZ=(0,Ve.forwardRef)(function({config:t,programmatic:a,scriptConfig:n},r){let{t:o}=Ue(),{config:i,ready:s}=yu(t,a,n),l=hu(i.visibility,s),u=Zd(),c=l?MB(i.visibility,u):null,d=qB(c),p=(0,Ve.useRef)(null),m=(0,Ve.useMemo)(()=>su({mode:"floating",getSessionId:()=>p.current?.sessionId}),[]),h=i.onEvent;(0,Ve.useEffect)(()=>{if(h)return m.subscribe(h)},[h,m]);let v=(0,Ve.useRef)(null),I=(0,Ve.useRef)(null),y=(0,Ve.useRef)(!1),[w,g]=(0,Ve.useState)("input"),[S,E]=(0,Ve.useState)(""),[T,R]=(0,Ve.useState)(!1),[O,U]=(0,Ve.useState)(!1),[A,Q]=(0,Ve.useState)(0),$=i.appearance?.theme,q=i.appearance?.variables,Z=(0,Ve.useMemo)(()=>q?pu(q):{},[q]),X=gu(i),B=(0,Ve.useMemo)(()=>Ss({flow:null,followup:null,...X}),[X]),P=(0,Ve.useMemo)(()=>B?.suggestions.map(ie=>ie.text)??[],[B]);Fl({widgetEvents:m,api:i.api,token:i.token,channelId:i.channelId,source:i.source,mode:"floating",pagePrompts:X.page,getSessionId:()=>p.current?.sessionId});let J=(0,Ve.useRef)(null);(0,Ve.useEffect)(()=>{!O||!B||J.current!==B&&(J.current=B,m.emit({name:"suggestions.shown",properties:{texts:P,origin:B.origin}}))},[O,B,P,m]);let ge=i.launcherText??i.placeholder??o.launcher.prompt,C=Hl(ge,S.length===0),ze="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,Ve.useEffect)(()=>{if(!l){R(!1);return}if(c){R(d);return}let ie=i.appearDelay??tZ,xe=setTimeout(()=>R(!0),Math.max(0,ie));return()=>clearTimeout(xe)},[l,i.appearDelay,c,d]),(0,Ve.useEffect)(()=>{if(!T||P.length===0)return;let ie=setTimeout(()=>{y.current||g(xe=>xe==="input"?"expanded":xe)},nZ);return()=>clearTimeout(ie)},[T,P.length]),(0,Ve.useEffect)(()=>{A>0&&w==="open"&&p.current?.focus()},[A,w]);let ot=(0,Ve.useRef)(!1);(0,Ve.useEffect)(()=>{s&&!ot.current&&(ot.current=!0,m.emit({name:"chat.ready"}))},[s,m]),ru({api:i.api,token:i.token,channelId:i.channelId,mode:"floating",paintMark:"launcherPainted",painted:s&&l});let x=(0,Ve.useRef)(!1);(0,Ve.useEffect)(()=>{let ie=l&&w==="open";ie!==x.current&&(x.current=ie,m.emit({name:ie?"chat.opened":"chat.closed"}))},[l,w,m]);let ae=(0,Ve.useCallback)(()=>{g("open")},[]),re=(0,Ve.useCallback)(()=>{y.current=!0,g("input")},[]);(0,Ve.useEffect)(()=>{if(w!=="expanded"){U(!1);return}let ie=setTimeout(()=>U(!0),aZ);return()=>clearTimeout(ie)},[w]);let Ce=(0,Ve.useCallback)(ie=>{ae();let xe=ie.trim();xe&&p.current?.sendMessage(xe)},[ae]);(0,Ve.useImperativeHandle)(r,()=>({open:()=>ae(),close:()=>re(),toggle:()=>{g(ie=>ie==="open"?"input":"open")},sendMessage:ie=>Ce(ie),sendMessageAndWait:async ie=>{ae();let xe=p.current;if(xe)return await xe.sendMessageAndWait(ie)},reset:()=>p.current?.reset(),focus:()=>{ae(),Q(ie=>ie+1)},getMessages:()=>p.current?.messages??[],getSessionId:()=>p.current?.sessionId}),[Ce,ae,re]);let We=(0,Ve.useCallback)(()=>{S.trim()&&(Ce(S),E(""))},[S,Ce]),be=(0,Ve.useCallback)(()=>{(p.current?.messages.length??0)>0?(g("open"),Q(ie=>ie+1)):(y.current=!1,g(ie=>ie==="input"?"expanded":ie))},[]),Oe={mode:"floating"},we=zl(i.sessionApi);i.mcpServerUrl&&(Oe.mcpServerUrl=i.mcpServerUrl),i.channelId&&(Oe.channelId=i.channelId);let ce=P.length>0&&w!=="input",Le=(0,Rt.jsx)("button",{type:"button",onClick:re,"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,Rt.jsx)(wn,{className:"ww:size-4"})});return(0,Rt.jsx)(lu,{value:m,children:(0,Rt.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":$==="auto"?"auto":void 0,className:V("ww:contents ww:font-[family-name:var(--ww-font-sans)]",$==="dark"&&"dark"),style:Z,children:l&&(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)("div",{ref:I,"data-waniwani-floating":"dock","data-state":w==="open"?"hidden":"shown","data-appeared":T?"true":"false",className:V("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",ce?"ww:max-w-[720px]":"ww:max-w-[440px]"),children:(0,Rt.jsxs)("div",{className:V("ww:relative ww:flex ww:flex-col ww:rounded-[20px] ww:border ww:transition-all ww:duration-300 ww:ease-out",ce?"ww:p-2 ww:backdrop-blur-xl ww:backdrop-saturate-150":"ww:border-transparent ww:p-0"),style:ce?{boxShadow:ze,backgroundColor:"var(--ww-glass)",borderColor:"var(--ww-glass-border)"}:void 0,children:[ce&&w!=="open"&&(0,Rt.jsx)("button",{type:"button",onClick:re,"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,Rt.jsx)(wn,{className:"ww:size-4"})}),P.length>0&&(0,Rt.jsx)("div",{className:V("ww:grid ww:transition-all ww:duration-300 ww:ease-out",O?"ww:grid-rows-[1fr] ww:opacity-100":"ww:pointer-events-none ww:grid-rows-[0fr] ww:opacity-0"),children:(0,Rt.jsx)("div",{className:"ww:overflow-hidden",children:(0,Rt.jsx)(Sl,{suggestions:P,onSelect:ie=>{m.emit({name:"suggestion.clicked",properties:{text:ie,index:P.indexOf(ie),origin:B?.origin??"channel"}}),Ce(ie)},className:"ww:pl-1 ww:pr-9 ww:pt-1 ww:pb-2.5"})})}),(0,Rt.jsx)(Xp,{animated:T,backgroundColor:"var(--ww-color-input)",borderRadius:16,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],className:"ww:border-border",style:{boxShadow:ze},children:(0,Rt.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,Rt.jsx)("input",{ref:v,type:"text",value:S,placeholder:C,onChange:ie=>E(ie.target.value),onFocus:be,onKeyDown:ie=>{ie.key==="Enter"&&!ie.shiftKey&&(ie.preventDefault(),We())},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,Rt.jsx)("button",{type:"button",onClick:We,disabled:!S.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,Rt.jsx)(hr,{className:"ww:size-4"})})]})})]})}),(0,Rt.jsx)("div",{role:"dialog","aria-label":i.title??ge,"data-waniwani-floating":"panel","data-state":w==="open"?"shown":"hidden",style:{boxShadow:ze},className:V("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,Rt.jsx)(mu,{transport:we,ref:p,api:i.api??"",headers:{Authorization:`Bearer ${i.token}`},skipRemoteConfig:!0,body:Oe,appearance:i.appearance,title:i.title,headerActions:Le,hideHeader:!1,onScreen:w==="open",welcomeMessage:i.welcomeMessage,placeholder:i.placeholder,suggestions:X,enableThreadHistory:i.enableThreadHistory,documentUpload:i.documentUpload,showToolCalls:i.showToolCalls,locale:i.locale,initializing:!s})})]})})})});var on=j(Ee(),1);var uI=j(he(),1),jB=(0,on.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,onReady:r,onVisibilityChange:o},i){let{config:s,ready:l}=yu(t,a,n),u=(0,on.useRef)(null),c=(0,on.useMemo)(()=>su({mode:"inline",getSessionId:()=>u.current?.sessionId}),[]),d=s.onEvent;(0,on.useEffect)(()=>{if(d)return c.subscribe(d)},[d,c]);let p=(0,on.useRef)(!1);(0,on.useEffect)(()=>{l&&!p.current&&(p.current=!0,c.emit({name:"chat.ready"}))},[l,c]),(0,on.useEffect)(()=>{r?.()},[]);let m=hu(s.visibility,l);(0,on.useEffect)(()=>{o?.(m)},[m,o]),ru({api:s.api,token:s.token,channelId:s.channelId,mode:"inline",paintMark:"chatVisible",painted:l}),(0,on.useImperativeHandle)(i,()=>({get chat(){return u.current}}),[]);let h=gu(s);Fl({widgetEvents:c,api:s.api,token:s.token,channelId:s.channelId,source:s.source,mode:"inline",pagePrompts:h.page,getSessionId:()=>u.current?.sessionId});let v={mode:"inline"},I=zl(s.sessionApi);return s.mcpServerUrl&&(v.mcpServerUrl=s.mcpServerUrl),s.channelId&&(v.channelId=s.channelId),(0,uI.jsx)(lu,{value:c,children:(0,uI.jsx)(mu,{transport:I,ref:u,api:s.api??"",headers:{Authorization:`Bearer ${s.token}`},skipRemoteConfig:!0,body:v,appearance:s.appearance,title:s.title,hideHeader:s.hideHeader,welcomeMessage:s.welcomeMessage,placeholder:s.placeholder,suggestions:h,enableThreadHistory:s.enableThreadHistory,documentUpload:s.documentUpload,showToolCalls:s.showToolCalls,locale:s.locale,initializing:!l})})});var Qd=j(Ee(),1),YB=j(zw(),1);function VB(){if(typeof document>"u"&&typeof navigator>"u")return null;let e=(typeof document<"u"?document.modelContext:void 0)??(typeof navigator<"u"?navigator.modelContext:void 0);return e&&typeof e.registerTool=="function"?e:null}function cI(){return VB()!==null}function oZ(){return{url:location.href,title:document.title}}async function dI(e){let{endpoint:t,listEndpoint:a,headers:n,sessionId:r,visitorId:o,channelId:i,onWidget:s}=e,l=e.logger??console,u=VB();if(!u)return null;let c=new AbortController,d=()=>c.abort();window.addEventListener("pagehide",d);let p=!1,m=()=>{p||(p=!0,window.removeEventListener("pagehide",d),c.abort())};function h(){return{sessionId:r,visitorId:o,channelId:i,page:oZ()}}async function v(g,S){let E=await fetch(t,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify(g),...S?{signal:S}:{}});if(!E.ok)throw new Error(`webmcp ${g.action} failed: ${E.status}`);return await E.json()}async function I(){if(a)try{let g=await fetch(a);if(g.ok)return await g.json();l.info(`[webmcp] list GET answered ${g.status}, using POST`)}catch(g){l.info("[webmcp] list GET failed, using POST",g)}return v({...h(),action:"list"})}let y=[];try{let g=await I();y=Array.isArray(g?.tools)?g.tools:[]}catch(g){return l.error("[webmcp] could not list site tools",g),m(),null}let w=[];return await Promise.all(y.map(async g=>{try{await u.registerTool({name:g.name,description:g.description??"",...g.inputSchema?{inputSchema:g.inputSchema}:{},...g.annotations?{annotations:g.annotations}:{},execute:async(S,E)=>{let T=await v({...h(),action:"call",name:g.name,arguments:S??{}},E?.signal);return T?.widget&&s?.(T.widget),{content:T?.content??[]}}},{signal:c.signal}),w.push(g)}catch(S){l.error(`[webmcp] could not register ${g.name}`,S)}})),l.info(`[webmcp] registered ${w.length} site tool(s)`),{get tools(){return w},callTool:({name:g,arguments:S})=>v({...h(),action:"call",name:g,arguments:S??{}}),dispose:m}}function $B(e,t,a){if(e.webmcp?.enabled===!1||t===!1)return null;let n=e.api??"";if(!e.token)return null;let r=e.mcpServerUrl?{mcpServerUrl:e.mcpServerUrl}:void 0,o=e.channelId??a;return{toolsEndpoint:Oa(n,"/webmcp",r),listEndpoint:Oa(n,"/webmcp/tools",{token:e.token,...o&&{channel:o},...r}),...o&&{channelId:o},headers:{Authorization:`Bearer ${e.token}`},resourceEndpoint:Oa(n,"/resource",{token:e.token,...r})}}var di=j(Ee(),1);var wu=j(he(),1),WB=672,GB=32;function XB({widget:e,onCallTool:t,toolsEndpoint:a,headers:n,resourceEndpoint:r,onClose:o,isDark:i=!1}){let[s,l]=(0,di.useState)(null);(0,di.useEffect)(()=>{let m=()=>l({width:window.innerWidth,height:window.innerHeight});return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);let u=e?.preview===!0;(0,di.useEffect)(()=>{if(!e||!u)return;let m=h=>{h.key==="Escape"&&o()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[e,u,o]),(0,di.useEffect)(()=>{if(!e)return;let m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}},[e]);let c=(0,di.useCallback)(async m=>{if(t)return t(m);if(!a)throw new Error("webmcp overlay needs onCallTool");let h=await fetch(a,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify({action:"call",...m})});if(!h.ok)throw new Error(`webmcp tool call failed: ${h.status}`);return await h.json()},[t,a,n]);if(!e)return null;let d=s?Math.min(WB,s.width-GB):WB,p=s?s.height-GB:void 0;return(0,wu.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Waniwani",className:V("ww:fixed ww:inset-0 ww:z-[2147483000] ww:flex ww:items-center ww:justify-center ww:bg-black/45 ww:backdrop-blur-md",i&&"dark"),children:[u&&(0,wu.jsx)("button",{type:"button","aria-label":"Close",onClick:o,className:"ww:absolute ww:inset-0 ww:h-full ww:w-full ww:cursor-pointer ww:border-none ww:bg-transparent ww:p-0"}),(0,wu.jsx)("div",{className:"ww:relative ww:overflow-auto ww:rounded-2xl ww:bg-background ww:shadow-2xl",style:{width:d,maxHeight:p},children:(0,wu.jsx)(Eh,{resourceUri:e.viewUri,resourceEndpoint:r,toolInput:e.data,toolResult:e.result,autoHeight:Fd(e.result._meta),isDark:i,onCallTool:c,onOpenLink:m=>window.open(m,"_blank","noopener")},`${r}|${e.viewUri}`)})]})}var fI=j(he(),1),KB="waniwani:webmcp:session";function iZ(){try{let e=sessionStorage.getItem(KB);if(e)return e;let t=crypto.randomUUID();return sessionStorage.setItem(KB,t),t}catch{return`s-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}}function sZ(e){let t=e.token?ci(e.api??"",e.token,e.channelId):null,a=$B(e,t?.webmcp?.enabled,t?.channelId);return a||Na("[webmcp] not publishing site tools: switched off, or no token"),a}function lZ(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}}function uZ(){let e=null,t=null;return{emit(a){e?e(a):t=a},subscribe(a){return e=a,t&&(a(t),t=null),()=>{e===a&&(e=null)}}}}function cZ({resourceEndpoint:e,subscribe:t,callTool:a}){let[n,r]=Qd.default.useState(null),[o,i]=Qd.default.useState(lZ);return Qd.default.useEffect(()=>t(r),[t]),Qd.default.useEffect(()=>{let s;try{s=window.matchMedia("(prefers-color-scheme: dark)")}catch{return}let l=()=>i(s.matches);return s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[]),(0,fI.jsx)(XB,{widget:n,onCallTool:a,resourceEndpoint:e,isDark:o,onClose:()=>r(null)})}function ZB(e){if(!cI())return null;let t=sZ(e);if(!t)return null;let a=document.createElement("div");a.setAttribute("data-waniwani-webmcp",""),a.style.cssText="position:relative;z-index:2147483001;",document.body.appendChild(a);let n=a.attachShadow({mode:"open"});$h(n);let r=document.createElement("div");n.appendChild(r);let o=uZ(),i=null,s=!1;dI({endpoint:t.toolsEndpoint,listEndpoint:t.listEndpoint,headers:t.headers,channelId:t.channelId,sessionId:iZ(),visitorId:fa(),onWidget:o.emit}).then(c=>{if(s){c?.dispose();return}i=c}).catch(c=>{console.error("[webmcp] could not publish site tools",c)});let l=async c=>{if(!i)throw new Error("webmcp bridge is not registered");let d=await i.callTool(c);return d.widget?.interactive&&o.emit(d.widget),d},u=YB.default.createRoot(r);return u.render((0,fI.jsx)(cZ,{resourceEndpoint:t.resourceEndpoint,subscribe:o.subscribe,callTool:l})),{getTools:()=>(i?.tools??[]).map(c=>c.name),destroy:()=>{s=!0,i?.dispose(),u.unmount(),a.remove()}}}var Ot=null,$n=null,Gt=null,Is=null,Gh=null,dZ="waniwani-chat-sizing",fZ="waniwani-chat-defaults",pZ="waniwani-chat-chrome",mZ="waniwani-chat-auto-card",hZ=`:where([data-waniwani-embed]){height:${LB}}`,gZ=":where([data-waniwani-embed]){border-radius:16px;overflow:hidden}",yZ=":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)}",wZ=":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))}",vZ="waniwani-chat-composer-auto",xZ=":where([data-waniwani-embed][data-waniwani-auto]){width:100%;max-width:40rem;margin-inline:auto}";function ef(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 e3(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 Xh(e,t){$h(e);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 JB="data-waniwani-embed",tf="data-waniwani-auto";function t3(e){let t=document.querySelector(`[${JB}]`);if(t)return t;let a=document.createElement("div");a.setAttribute(JB,""),a.setAttribute(tf,"");let n=e?!!document.head?.contains(e):!1;return e?.parentNode&&!n?e.parentNode.insertBefore(a,e):document.body.appendChild(a),a}function bZ(e){return/^\d+$/.test(e.trim())?`${e.trim()}px`:e.trim()}function SZ(e,t,a,n){let r=t3(n);ef(dZ,hZ),e.height&&r instanceof HTMLElement&&(r.style.height=bZ(e.height)),e.appearance?.theme&&ef(fZ,gZ),ef(pZ,yZ),r.hasAttribute(tf)&&ef(mZ,wZ),e3(r,e),Gt=document.createElement("div"),Gt.id="waniwani-chat-embed",Gt.style.cssText="width:100%;height:100%;max-height:inherit;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;",r.appendChild(Gt);let o=Gt,i=()=>{let d=getComputedStyle(r);if(!d.maxHeight.endsWith("px")){o.style.removeProperty("max-height");return}let p=Number.parseFloat(d.maxHeight);if(!Number.isFinite(p)){o.style.removeProperty("max-height");return}let m=p;d.boxSizing==="border-box"&&(m-=(Number.parseFloat(d.paddingTop)||0)+(Number.parseFloat(d.paddingBottom)||0)+(Number.parseFloat(d.borderTopWidth)||0)+(Number.parseFloat(d.borderBottomWidth)||0)),m>0?o.style.maxHeight=`${m}px`:o.style.removeProperty("max-height")};i(),Gh=new ResizeObserver(i),Gh.observe(r);let s=Gt.attachShadow({mode:"open"});Xh(s,e);let l=document.createElement("div");l.className="ww:contents",s.appendChild(l);let u=Cs.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=ci(e.api??"",e.token,e.channelId);d?.visibility&&!Yd(d.visibility,window.location.pathname)&&c(!1)}return $n=Kh.default.createRoot(l),$n.render(Cs.default.createElement(jB,{ref:u,config:e,programmatic:t,scriptConfig:a,onVisibilityChange:c})),{destroy:()=>{Gh?.disconnect(),Gh=null,$n?.unmount(),$n=null,Gt?.remove(),Gt=null,r.hasAttribute(tf)&&r.remove(),Ot=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:d=>u.current?.chat?.sendMessage(d),sendMessageAndWait:async d=>{let p=u.current?.chat;if(p)return await p.sendMessageAndWait(d)},reset:()=>u.current?.chat?.reset(),focus:()=>u.current?.chat?.focus(),getMessages:()=>u.current?.chat?.messages??[],getSessionId:()=>u.current?.chat?.sessionId}}function IZ(e,t,a){Gt=document.createElement("div"),Gt.id="waniwani-chat-embed",Gt.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(Gt);let n=Gt.attachShadow({mode:"open"});Xh(n,e);let r=document.createElement("div");r.className="ww:contents",n.appendChild(r);let o=Cs.default.createRef();return $n=Kh.default.createRoot(r),$n.render(Cs.default.createElement(HB,{ref:o,config:e,programmatic:t,scriptConfig:a})),{destroy:()=>{$n?.unmount(),$n=null,Gt?.remove(),Gt=null,Ot=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 CZ(){return{destroy:()=>{Ot=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:()=>{},sendMessageAndWait:async()=>{},reset:()=>{},focus:()=>{},getMessages:()=>[],getSessionId:()=>{}}}function kZ(e,t,a,n){let r=t3(n);r.hasAttribute(tf)&&ef(vZ,xZ),e3(r,e),Gt=document.createElement("div"),Gt.id="waniwani-chat-embed",Gt.style.cssText="display:block;width:100%;",r.appendChild(Gt);let o=Gt.attachShadow({mode:"open"});Xh(o,e);let i=document.createElement("div");i.className="ww:contents",o.appendChild(i),Is=document.createElement("div"),Is.id="waniwani-chat-panel",Is.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(Is);let s=Is.attachShadow({mode:"open"});Xh(s,e);let l=document.createElement("div");l.className="ww:contents",s.appendChild(l);let u=Cs.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=ci(e.api??"",e.token,e.channelId);d?.visibility&&!Yd(d.visibility,window.location.pathname)&&c(!1)}return $n=Kh.default.createRoot(i),$n.render(Cs.default.createElement(FB,{ref:u,config:e,programmatic:t,scriptConfig:a,panelContainer:l,onVisibilityChange:c})),{destroy:()=>{$n?.unmount(),$n=null,Gt?.remove(),Gt=null,Is?.remove(),Is=null,r.hasAttribute(tf)&&r.remove(),Ot=null},open:()=>u.current?.open(),close:()=>u.current?.close(),toggle:()=>u.current?.toggle(),sendMessage:d=>u.current?.sendMessage(d),sendMessageAndWait:async d=>{if(u.current)return u.current.sendMessageAndWait(d)},reset:()=>u.current?.reset(),focus:()=>u.current?.focus(),getMessages:()=>u.current?.getMessages()??[],getSessionId:()=>u.current?.getSessionId()}}function a3(e){if(Ot)return console.warn("[Waniwani] Chat widget is already initialized. Call destroy() first to re-initialize."),Ot;let t=oI(),a=jh(),n=Kd(e,void 0,a);bc(n.visitorId);let r=null;try{r=ZB(n)}catch(l){console.error("[Waniwani] WebMCP setup failed",l)}let o;n.mode==="off"?o=CZ():n.mode==="floating"?o=IZ(n,e,a):n.mode==="composer"?o=kZ(n,e,a,t):o=SZ(n,e,a,t);let i=n.api??"",s=n.token?A1({api:i,token:n.token,channelId:()=>n.channelId??ci(i,n.token,n.channelId)?.channelId,getSource:()=>ci(i,n.token,n.channelId)?.source??void 0,getSessionId:()=>o.getSessionId()}):Vp("no public token configured (set data-token or pass token to init())");return Ot={...o,track:s.track,identify:(l,u)=>s.identify(l,u),setVisitorId:l=>wl(l),getVisitorId:()=>fa(),destroy:()=>{s.shutdown(),r?.destroy(),o.destroy()}},Ot}function TZ(){Ot&&Ot.destroy()}var n3=Vp("chat widget is not initialized (call WaniWani.chat.init() first)"),vu=()=>Ot?Ot.track:n3.track;window.WaniWani=window.WaniWani||{};window.WaniWani.chat={init:a3,destroy:TZ,open:()=>Ot?.open(),close:()=>Ot?.close(),toggle:()=>Ot?.toggle(),sendMessage:e=>Ot?.sendMessage(e),sendMessageAndWait:async e=>{if(Ot)return Ot.sendMessageAndWait(e)},reset:()=>Ot?.reset(),focus:()=>Ot?.focus(),getMessages:()=>Ot?.getMessages()??[],getSessionId:()=>Ot?.getSessionId(),track:Object.assign(e=>vu()(e),{priceShown:e=>vu().priceShown(e),pricesCompared:e=>vu().pricesCompared(e),optionSelected:e=>vu().optionSelected(e),leadQualified:e=>vu().leadQualified(e),converted:e=>vu().converted(e)}),identify:(e,t)=>Ot?Ot.identify(e,t):n3.identify(e,t),setVisitorId:e=>wl(e),getVisitorId:()=>fa()};function QB(){if(jh().token)try{a3()}catch(t){console.error("[Waniwani] Auto-initialization failed:",t)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",QB):QB();})();
|
|
144
|
+
${Fe}`}]}}Q.current({...Ne,..._e?{modelContext:_e}:{}})}Oe({jsonrpc:"2.0",id:xe,result:{}});return}if(ie==="ui/update-model-context"&&xe!=null){ke=WU(ke,Le.params),Oe({jsonrpc:"2.0",id:xe,result:{}});return}if(ie==="tools/call"&&xe!=null){let Ne=$.current;if(!Ne){Oe({jsonrpc:"2.0",id:xe,error:{code:-32601,message:"tools/call not supported"}});return}let _e=Le.params?.name;Ne({name:_e,arguments:Le.params?.arguments??{}}).then(Fe=>{Oe({jsonrpc:"2.0",id:xe,result:Fe});let Ae=Fe.content?.map(de=>de.text??"").join("").trim();Ae&&aY(_e,Fe,X.current)&&(We&&clearTimeout(We.timer),We={text:Ae,timer:setTimeout(()=>{if(te)return;let de=ke;ke=null,We=null,Q.current?.({role:"user",content:[{type:"text",text:Ae}],...de?{modelContext:de}:{}})},500)})}).catch(Fe=>{let Ae=Fe instanceof Error?Fe.message:"Tool call failed";Oe({jsonrpc:"2.0",id:xe,error:{code:-32e3,message:Ae}})});return}if(ie==="ui/request-display-mode"&&xe!=null){let Ne=Le.params?.mode,_e=Ne==="fullscreen"||Ne==="inline"||Ne==="pip"?Ne:"inline";E.current=_e,Oe({jsonrpc:"2.0",id:xe,result:{mode:_e}}),Oe({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{displayMode:_e}}),H.current?.(_e);return}if(ie==="ui/resource-teardown"&&xe!=null){Oe({jsonrpc:"2.0",id:xe,result:{}});return}ie==="ping"&&xe!=null&&Oe({jsonrpc:"2.0",id:xe,result:{}})};return window.addEventListener("message",we),()=>{te=!0,clearTimeout(be),We&&clearTimeout(We.timer),window.removeEventListener("message",we)}},[s,B]),(0,YU.jsx)("iframe",{ref:h,src:P,onLoad:()=>ge.current?.mark("iframeLoad"),sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox",className:V(!p&&"ww:rounded-md ww:border ww:border-border",i),style:{height:p?"100%":T,minWidth:p||!O?void 0:`min(${O}px, 100%)`,width:"100%",border:"none",colorScheme:o?"dark":"auto"},title:"MCP App"})}var si=j(me(),1);function ZU({icon:e,title:t,description:a,suggestions:n,onSuggestionSelect:r}){return(0,si.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,si.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,si.jsx)("h2",{className:"ww:text-lg ww:font-semibold ww:text-foreground",children:t}),a&&(0,si.jsx)("p",{className:"ww:mt-1 ww:text-sm ww:text-muted-foreground ww:max-w-sm",children:a}),n&&n.length>0&&(0,si.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,si.jsx)("button",{type:"button",onClick:()=>r?.(o),className:V("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 JU=j(Ee(),1);var ou=j(me(),1);function nY({onRetry:e}){let{t}=Ue();return(0,ou.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,ou.jsx)("span",{children:t.widgetErrorBoundary.failedToLoad}),(0,ou.jsx)("button",{type:"button",onClick:e,className:"ww:text-xs ww:font-medium ww:text-primary ww:hover:underline",children:t.widgetErrorBoundary.retry})]})}var Rh=class extends JU.Component{constructor(){super(...arguments);K(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,ou.jsx)(nY,{onRetry:()=>this.setState({hasError:!1})}):this.props.children}};var He=j(me(),1);function e0(e){return e?e.replace(/[-_]/g," ").replace(/^\w/,t=>t.toUpperCase()):"Tool"}function QU(e){return e&&/search|find|lookup|query|web|browse|google/i.test(e)?Rc:_i}function eB({messages:e,status:t,welcomeMessage:a,welcome:n,onSuggestionSelect:r,resourceEndpoint:o,chatSessionId:i,isDark:s,onFollowUp:l,onCallTool:u,onWidgetDisplayModeChange:c,fullscreenToolCallId:d,debug:p,showToolCalls:m=!0,toolDefinitions:h,messageClassNames:v}){let{t:I}=Ue(),y=e[e.length-1],w=e.length>0,g=d!=null,S=!g&&VU(e,t,{ignoreToolParts:m===!1,ignoreReasoningParts:m===!1});return(0,He.jsxs)(He.Fragment,{children:[!g&&(!w&&n?(0,He.jsx)(ZU,{...n,onSuggestionSelect:r}):a&&(0,He.jsx)(WS,{from:"assistant",children:(0,He.jsx)(GS,{children:(0,He.jsx)(Ah,{children:a})})})),e.map(E=>{let T=E.parts.filter(B=>B.type==="text"),R=E.parts.filter(B=>B.type==="reasoning"),O=E.parts.filter(B=>B.type==="file"),U=SM(E.metadata),A=E.parts.filter(B=>"toolCallId"in B),Q=E.parts.filter(B=>B.type==="reasoning"||"toolCallId"in B),$=E===y&&E.role==="assistant",H=T.length>0,Z=g?A.some(B=>B.toolCallId===d):!1,X=m!==!1&&!Z&&Q.length>=2;return g&&!Z?(0,He.jsx)("div",{style:{display:"none"}},E.id):E.role==="assistant"&&!jU(E)?(0,He.jsx)("div",{style:{display:"none"}},E.id):m===!1&&E.role==="assistant"&&!H&&O.length===0&&A.every(B=>{let P="output"in B?B.output:void 0;return P===void 0||!o||!Hd(B.toolName,P,h)})?(0,He.jsx)("div",{style:{display:"none"}},E.id):(0,He.jsxs)(WS,{from:E.role,className:v?.message,children:[m!==!1&&!Z&&!X&&R.map((B,P)=>(0,He.jsxs)(Ud,{isStreaming:B.state==="streaming",children:[(0,He.jsx)(Bd,{}),(0,He.jsx)(zd,{children:B.text})]},`reasoning-${E.id}-${P}`)),X&&(()=>{let B=Q[Q.length-1],P=B.type==="reasoning"?{icon:Gr,label:I.reasoning.thinking}:{icon:QU(B.toolName),label:B.title??e0(B.toolName)};return(0,He.jsxs)(TU,{isWorking:$&&(t==="streaming"||t==="submitted"),activeStep:P,children:[(0,He.jsx)(LU,{workingLabel:I.chainOfThought.working,label:I.chainOfThought.done}),(0,He.jsx)(EU,{children:Q.map((J,ge)=>{let C=ge===Q.length-1;if(J.type==="reasoning")return(0,He.jsx)(MU,{isStreaming:J.state==="streaming",isLast:C,children:J.text},`reasoning-${E.id}-${ge}`);let ze=J.title??e0(J.toolName),ot=QU(J.toolName);if(m==="titles-only")return(0,He.jsx)(VS,{icon:ot,title:ze,state:J.state,isLast:C},J.toolCallId);let x="output"in J?J.output:void 0;return(0,He.jsxs)(VS,{icon:ot,title:ze,state:J.state,isLast:C,children:[(0,He.jsx)(JS,{input:J.input,debug:p}),x!==void 0&&(0,He.jsx)(QS,{output:x,errorText:"errorText"in J?J.errorText:void 0,debug:p})]},J.toolCallId)})})]})})(),m!==!1&&!Z&&!X&&A.length===1&&(()=>{let B=A[0],P=B.title??e0(B.toolName);if(m==="titles-only")return(0,He.jsx)(zU,{title:P,state:B.state});let J="output"in B?B.output:void 0;return(0,He.jsxs)(UU,{children:[(0,He.jsx)(BU,{title:P,state:B.state}),(0,He.jsxs)(FU,{children:[(0,He.jsx)(JS,{input:B.input,debug:p}),J!==void 0&&(0,He.jsx)(QS,{output:J,errorText:"errorText"in B?B.errorText:void 0,debug:p})]})]})})(),A.map(B=>{let P="output"in B?B.output:void 0,J=Hd(B.toolName,P,h),ge=qU(B.toolName,P,h),C=B.toolCallId===d;return J&&o&&P!==void 0?(0,He.jsx)("div",{style:C?{position:"absolute",inset:0,zIndex:10,display:"flex",flexDirection:"column",overflow:"hidden",background:"var(--ww-color-background)"}:void 0,children:J&&o&&P!==void 0&&(0,He.jsx)(Rh,{children:(0,He.jsx)(Mh,{isFullscreen:C,resourceUri:J,toolInput:B.input??{},toolResult:{content:P.content,structuredContent:P.structuredContent,_meta:P._meta},resourceEndpoint:o,chatSessionId:i,isDark:s,autoHeight:ge,toolDefinitions:h,onFollowUp:l,onCallTool:u,onDisplayModeChange:c?ze=>c(ze,{toolCallId:B.toolCallId,resourceUri:J,toolInput:B.input??{},toolResult:{content:P.content,structuredContent:P.structuredContent,_meta:P._meta},autoHeight:ge}):void 0})})},B.toolCallId):null}),!Z&&U.length>0&&(0,He.jsx)(IM,{documents:U}),!Z&&(0,He.jsx)("div",{children:(0,He.jsxs)(GS,{className:V(E.role==="user"?v?.userBubble:v?.assistantBubble),children:[O.length>0&&(0,He.jsx)(xM,{files:O}),H?T.map((B,P)=>{let J=$&&t==="streaming"&&P===T.length-1;return(0,He.jsx)(Ah,{isStreaming:J,children:B.type==="text"?B.text:""},`${E.id}-${P}`)}):null]})})]},E.id)}),S&&(0,He.jsx)($U,{})]})}var li=j(me(),1);function rY({label:e}){return(0,li.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,li.jsx)("title",{children:e}),(0,li.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,li.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function Dh({onClick:e}){let{t}=Ue();return(0,li.jsx)("button",{type:"button",onClick:e,title:t.threadMenu.newChat,"aria-label":t.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,li.jsx)(rY,{label:t.threadMenu.newChat})})}var Vd=j(me(),1),oY="https://app.waniwani.ai/assets/waniwani-logo.svg",iY="https://waniwani.ai";function tB(){let{t:e}=Ue();return(0,Vd.jsxs)("a",{href:iY,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,Vd.jsx)("span",{children:e.poweredBy.label}),(0,Vd.jsx)("img",{src:oY,alt:"Waniwani",width:72,height:10,"data-waniwani-logo":"",className:"ww:h-2.5 ww:w-auto"})]})}var iu=j(Ee(),1);var bt=j(me(),1),aB=20;function sY({label:e}){return(0,bt.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,bt.jsx)("title",{children:e}),(0,bt.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,bt.jsx)("polyline",{points:"3 4 3 9 8 9"}),(0,bt.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"12"}),(0,bt.jsx)("line",{x1:"12",y1:"12",x2:"15",y2:"14"})]})}function lY({label:e}){return(0,bt.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,bt.jsx)("title",{children:e}),(0,bt.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,bt.jsx)("path",{d:"M19 6l-2 14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L5 6"}),(0,bt.jsx)("path",{d:"M10 11v6"}),(0,bt.jsx)("path",{d:"M14 11v6"})]})}function nB({threads:e,activeThreadId:t,onNewThread:a,onSelectThread:n,onDeleteThread:r}){let{locale:o,t:i}=Ue(),[s,l]=(0,iu.useState)(!1),u=(0,iu.useRef)(null);(0,iu.useEffect)(()=>{if(!s)return;let p=m=>{let h=u.current;h&&(m.composedPath().includes(h)||l(!1))};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[s]);let c=e.slice(0,aB),d=Math.max(0,e.length-aB);return(0,bt.jsxs)("div",{ref:u,className:"ww:relative ww:flex ww:items-center ww:gap-1",children:[(0,bt.jsx)(Dh,{onClick:a}),(0,bt.jsx)("button",{type:"button",onClick:()=>l(p=>!p),title:i.threadMenu.threadHistory,"aria-label":i.threadMenu.threadHistory,"aria-expanded":s,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,bt.jsx)(sY,{label:i.threadMenu.threadHistory})}),s&&(0,bt.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,bt.jsx)("div",{className:"ww:px-3 ww:py-3 ww:text-xs ww:text-muted-foreground",children:i.threadMenu.noPreviousChats}),c.map(p=>{let m=p.threadId===t,h=Date.parse(p.updatedAt);return(0,bt.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 ${m?"ww:bg-foreground/5":""}`,children:[(0,bt.jsxs)("button",{type:"button",onClick:()=>{n(p.threadId),l(!1)},className:"ww:flex-1 ww:min-w-0 ww:text-left ww:cursor-pointer",children:[(0,bt.jsx)("div",{className:"ww:truncate ww:text-foreground ww:font-medium",children:p.title}),(0,bt.jsx)("div",{className:"ww:text-[10px] ww:text-muted-foreground",children:Number.isNaN(h)?"":hx(h,o)})]}),(0,bt.jsx)("button",{type:"button",onClick:v=>{v.stopPropagation(),r(p.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,bt.jsx)(lY,{label:i.threadMenu.deleteThread})})]},p.threadId)}),d>0&&(0,bt.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 _h=j(Ee(),1);function su(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 s of[...t])try{s(i)}catch(l){console.warn("[Waniwani] onEvent subscriber threw:",l)}}}}function rB(){return{subscribe(){return()=>{}},emit(){}}}var oB=(0,_h.createContext)(rB());function Ph(){return(0,_h.useContext)(oB)}var lu=oB.Provider;var Oh=j(Ee(),1);function iB(e){let t=(0,Oh.useRef)(e);return t.current=e,(0,Oh.useCallback)(async a=>{let{api:n,headers:r,onCallTool:o,sessionId:i}=t.current;if(o)return o(a);let s=Na(n??"/api/waniwani","/tool"),l=typeof i=="string"&&i.trim().length>0?i.trim():void 0,u=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",...l?{"X-Session-Id":l}:{},...r},body:JSON.stringify(a)});if(!u.ok)throw new Error(`Tool call failed: ${u.status} ${u.statusText}`);return u.json()},[])}var qn=j(Ee(),1);var dB=j(lB(),1);var Xd=j(Ee(),1);var Bh=j(Ee(),1);var cB=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},At=(e,t,a)=>(cB(e,t,"read from private field"),a?a.call(e):t.get(e)),kr=(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)},ui=(e,t,a,n)=>(cB(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);function cY(e,t){return t!=null?(0,dB.default)(e,t):e}var Fn,Nh,Uh,$d,Wd,Gd,uu,t0,a0,dY=class{constructor(e=[]){kr(this,Fn,void 0),kr(this,Nh,"ready"),kr(this,Uh,void 0),kr(this,$d,new Set),kr(this,Wd,new Set),kr(this,Gd,new Set),this.pushMessage=t=>{ui(this,Fn,At(this,Fn).concat(t)),At(this,uu).call(this)},this.popMessage=()=>{ui(this,Fn,At(this,Fn).slice(0,-1)),At(this,uu).call(this)},this.replaceMessage=(t,a)=>{ui(this,Fn,[...At(this,Fn).slice(0,t),this.snapshot(a),...At(this,Fn).slice(t+1)]),At(this,uu).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,a)=>{let n=a?cY(t,a):t;return At(this,$d).add(n),()=>{At(this,$d).delete(n)}},this["~registerStatusCallback"]=t=>(At(this,Wd).add(t),()=>{At(this,Wd).delete(t)}),this["~registerErrorCallback"]=t=>(At(this,Gd).add(t),()=>{At(this,Gd).delete(t)}),kr(this,uu,()=>{At(this,$d).forEach(t=>t())}),kr(this,t0,()=>{At(this,Wd).forEach(t=>t())}),kr(this,a0,()=>{At(this,Gd).forEach(t=>t())}),ui(this,Fn,e)}get status(){return At(this,Nh)}set status(e){ui(this,Nh,e),At(this,t0).call(this)}get error(){return At(this,Uh)}set error(e){ui(this,Uh,e),At(this,a0).call(this)}get messages(){return At(this,Fn)}set messages(e){ui(this,Fn,[...e]),At(this,uu).call(this)}};Fn=new WeakMap;Nh=new WeakMap;Uh=new WeakMap;$d=new WeakMap;Wd=new WeakMap;Gd=new WeakMap;uu=new WeakMap;t0=new WeakMap;a0=new WeakMap;var cu,uB=class extends CE{constructor({messages:e,...t}){let a=new dY(e);super({...t,state:a}),kr(this,cu,void 0),this["~registerMessagesCallback"]=(n,r)=>At(this,cu)["~registerMessagesCallback"](n,r),this["~registerStatusCallback"]=n=>At(this,cu)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>At(this,cu)["~registerErrorCallback"](n),ui(this,cu,a)}};cu=new WeakMap;function fB({experimental_throttle:e,resume:t=!1,...a}={}){let n=(0,qn.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:p=>{var m,h;return(h=(m=n.current).onToolCall)==null?void 0:h.call(m,p)},onData:p=>{var m,h;return(h=(m=n.current).onData)==null?void 0:h.call(m,p)},onFinish:p=>{var m,h;return(h=(m=n.current).onFinish)==null?void 0:h.call(m,p)},onError:p=>{var m,h;return(h=(m=n.current).onError)==null?void 0:h.call(m,p)},sendAutomaticallyWhen:p=>{var m,h,v;return(v=(h=(m=n.current).sendAutomaticallyWhen)==null?void 0:h.call(m,p))!=null?v:!1}},o=(0,qn.useRef)("chat"in a?a.chat:new uB(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new uB(r));let s=(0,qn.useCallback)(p=>o.current["~registerMessagesCallback"](p,e),[e,o.current.id]),l=(0,qn.useSyncExternalStore)(s,()=>o.current.messages,()=>o.current.messages),u=(0,qn.useSyncExternalStore)(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),c=(0,qn.useSyncExternalStore)(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),d=(0,qn.useCallback)(p=>{typeof p=="function"&&(p=p(o.current.messages)),o.current.messages=p},[o]);return(0,qn.useEffect)(()=>{t&&o.current.resumeStream()},[t,o]),{id:o.current.id,messages:l,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 ee=j(Ee(),1);var fY="/api/mcp/modules/documents",pY=2e4,mY=3e5,Hn=class extends Error{constructor(a,n){super(n);K(this,"code");this.name="DocumentUploadError",this.code=a}};function pB(e,t){return Fp(e,`${fY}${t}`)}function hY(e){return pB(e,"/upload-url")}function mB(e,t){let a=new Headers(e);return new Headers(t).forEach((n,r)=>{a.set(r,n)}),a}function gY(e){let t=e?.data;if(typeof t?.documentId!="string"||typeof t.uploadUrl!="string"||!(t.documentId&&t.uploadUrl))return null;let a={};for(let[n,r]of Object.entries(t.headers??{}))typeof r=="string"&&(a[n]=r);return{documentId:t.documentId,uploadUrl:t.uploadUrl,headers:a}}function yY(e){return e===403?new Hn("upload_disabled","This agent does not accept document uploads."):e===413?new Hn("max_file_size","That file is too large."):e===422||e===400?new Hn("accept","That file type is not accepted."):new Hn("upload_failed",`The upload could not be started (${e}).`)}function wY(e){return new Promise((t,a)=>{let n=new XMLHttpRequest;n.open("PUT",e.url,!0);for(let[i,s]of Object.entries(e.headers))n.setRequestHeader(i,s);n.timeout=mY;let r=()=>n.abort();e.signal.addEventListener("abort",r,{once:!0});let o=()=>e.signal.removeEventListener("abort",r);n.upload.onprogress=i=>{i.lengthComputable&&i.total>0&&e.onProgress?.(i.loaded/i.total)},n.onload=()=>{if(o(),n.status>=200&&n.status<300||n.status===412){e.onProgress?.(1),t();return}a(new Hn("upload_failed",`The upload was rejected (${n.status}).`))},n.onerror=()=>{o(),a(new Hn("upload_failed","The upload could not be completed."))},n.ontimeout=()=>{o(),a(new Hn("upload_failed","The upload timed out."))},n.onabort=()=>{o(),a(e.signal.reason instanceof Error?e.signal.reason:new Error("aborted"))},n.send(e.file)})}async function zh(e){let t=pB(e.api,`/${e.documentId}`);if(t)try{await fetch(t,{method:"DELETE",headers:mB(e.headers,e.uploadHeaders)})}catch{}}async function hB(e){e.signal.throwIfAborted();let t=hY(e.api);if(!t)throw new Hn("upload_disabled","This agent does not accept document uploads.");let a=new AbortController,n=setTimeout(()=>a.abort(),pY),r=()=>a.abort(e.signal.reason);e.signal.addEventListener("abort",r,{once:!0});let o;try{let s=mB(e.headers,e.uploadHeaders);s.set("Content-Type","application/json"),o=await fetch(t,{method:"POST",headers:s,signal:a.signal,body:JSON.stringify({filename:e.file.name,contentType:e.file.type,byteSize:e.file.size,...e.sessionId?{sessionId:e.sessionId}:{}})})}catch(s){throw e.signal.aborted?s:new Hn("upload_failed","The upload could not be started.")}finally{clearTimeout(n),e.signal.removeEventListener("abort",r)}if(!o.ok)throw yY(o.status);let i=gY(await o.json().catch(()=>null));if(e.signal.throwIfAborted(),!i)throw new Hn("upload_failed","The upload could not be started.");return await wY({url:i.uploadUrl,headers:i.headers,file:e.file,signal:e.signal,onProgress:e.onProgress}),{documentId:i.documentId,filename:e.file.name,mediaType:e.file.type}}function vY(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(s=>(s.code==="invalid_value"||s.code==="invalid_literal")&&s.path?.[0]==="type"))continue;let i=r.filter(s=>s.code==="unrecognized_keys").flatMap(s=>s.keys??[]);if(i.length>0)return i}return null}var Fh=class extends bv{processResponseStream(t){let a="",n=xv(),r=n.validate?.bind(n);return t.pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({async transform(o,i){a+=o;let s=a.split(`
|
|
145
|
+
`);a=s.pop()??"";for(let l of s){let u=l.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 p=await r(d);if(p.success){i.enqueue(p.value);continue}let m=vY(p.error);if(m?.length){let h={...d};for(let I of m)delete h[I];let v=await r(h);v.success&&i.enqueue(v.value)}}catch{}}}}))}};var gB=50,yB=1e3;function qh(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 Hh(e){if(typeof indexedDB>"u")return null;let t=null;try{return t=await Xw(),await e(t)}catch{return null}finally{try{t?.close()}catch{}}}function n0(e){return new Promise((t,a)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}async function r0(e){return await Hh(async a=>{let o=a.transaction(yn,"readonly").objectStore(yn).index(qp),s=(await n0(o.getAll(e))??[]).filter(qh);return s.sort((l,u)=>l.updatedAt<u.updatedAt?1:-1),s})??[]}async function jh(e){return await Hh(async a=>{let r=a.transaction(yn,"readonly").objectStore(yn),o=await n0(r.get(e));return qh(o)?o:null})??null}async function o0(e){if(!qh(e))return;let t=e.messages.length>yB?{...e,messages:e.messages.slice(e.messages.length-yB)}:e;await Hh(async a=>{await new Promise((l,u)=>{let c=a.transaction(yn,"readwrite");c.oncomplete=()=>l(),c.onerror=()=>u(c.error),c.onabort=()=>u(c.error),c.objectStore(yn).put(t)});let n=a.transaction(yn,"readwrite"),r=n.objectStore(yn),o=r.index(qp),s=(await n0(o.getAll(t.memoryUserId))??[]).filter(qh);if(s.length>gB){s.sort((u,c)=>u.updatedAt<c.updatedAt?-1:1);let l=s.slice(0,s.length-gB);for(let u of l)r.delete(u.threadId)}return await new Promise((l,u)=>{n.oncomplete=()=>l(),n.onerror=()=>u(n.error),n.onabort=()=>u(n.error)}),null})}async function wB(e){await Hh(async t=>(await new Promise((a,n)=>{let r=t.transaction(yn,"readwrite");r.oncomplete=()=>a(),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error),r.objectStore(yn).delete(e)}),null))}async function i0(e){return(await r0(e))[0]?.threadId??null}function vB(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 xY="x-session-id",bY=250,SY=200;function xB(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():ud()}function Vh(){return new Date().toISOString()}function bB(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}async function IY(e,t){let a=Na(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 SB(e){let{api:t="/api/waniwani",headers:a,uploadHeaders:n,body:r,onMessageSent:o,onResponseReceived:i,enableThreadHistory:s=!1,activeThreadId:l,onThreadChange:u}=e,c=e.visitorId;(0,ee.useEffect)(()=>Sc(c),[c]);let d=Ph(),p=(0,ee.useRef)(a),m=(0,ee.useRef)(n),h=(0,ee.useRef)(r),v=(0,ee.useRef)(s);(0,ee.useEffect)(()=>{v.current=s},[s]);let I=(0,ee.useRef)(void 0),y=(0,ee.useRef)(void 0),w=(0,ee.useRef)(null),[g,S]=(0,ee.useState)(void 0),E=(0,ee.useRef)(g),[T,R]=(0,ee.useState)(l),O=(0,ee.useRef)(T),[U,A]=(0,ee.useState)([]),[Q,$]=(0,ee.useState)(!s),H=(0,ee.useRef)(void 0),Z=(0,ee.useRef)(void 0),X=(0,ee.useRef)(void 0),B=(0,ee.useRef)(void 0),P=(0,ee.useRef)(0),J=(0,ee.useRef)(u);(0,ee.useEffect)(()=>{J.current=u},[u]);let ge=(0,ee.useCallback)(_=>{O.current=_,R(_),_&&(J.current?.(_),d.emit({name:"thread.changed",sessionId:E.current,properties:{threadId:_}}))},[d]),C=(0,ee.useCallback)(async()=>{if(!s)return;let _=w.current?.memoryUserId;if(!_)return;let he=await r0(_);A(he)},[s]),ze=(0,ee.useCallback)(()=>E.current,[]),ot=(0,ee.useCallback)(_=>{let he=bB(_);if(!he||E.current===he)return;let Se=E.current===void 0;E.current=he,S(he),Se&&d.emit({name:"session.started",properties:{sessionId:he}})},[d]),x=(0,ee.useCallback)(()=>{E.current=void 0,S(void 0)},[]);(0,ee.useEffect)(()=>{p.current=a,m.current=n},[a,n]),(0,ee.useEffect)(()=>{h.current=r},[r]),(0,ee.useEffect)(()=>{let _=!1,he=P.current;return(async()=>{try{let et=await Ic();if(_)return;w.current=et}catch{}if(!s)return;let Se=w.current?.memoryUserId;if(!Se){$(!0);return}try{let et=l??await i0(Se);if(_||he!==P.current)return;if(et){let Ot=await jh(et);if(_||he!==P.current)return;Ot&&Ot.memoryUserId===Se&&(O.current=Ot.threadId,R(Ot.threadId),H.current=Ot.createdAt,Z.current=Ot.title,Ot.sessionId&&(E.current=Ot.sessionId,S(Ot.sessionId)),ct(Ot.messages))}await C()}finally{_||$(!0)}})(),()=>{_=!0}},[]);let te=(0,ee.useRef)(null),re=(0,ee.useCallback)(_=>{let he=h.current?.[_];return typeof he=="string"?he:void 0},[]),ke=(0,ee.useCallback)(()=>({api:t,token:jp(p.current),channelId:re("channelId"),sessionId:E.current}),[t,re]),We=(0,ee.useCallback)(_=>{let he=te.current;te.current=null,he?.report(ke(),{mode:re("mode"),outcome:_})},[ke,re]),be=(0,ee.useCallback)(_=>{let he=typeof _=="object"&&_!==null&&!Array.isArray(_)?_:void 0,Se=w.current?.memoryUserId,et=w.current?.language,Ot={};return Se&&(Ot.memoryUserId=Se),et&&(Ot.locale=et),Object.keys(Ot).length>0||he?{...Ot,...he??{}}:void 0},[]),Oe=(0,ee.useCallback)(()=>{let _=O.current;return _||(_=xB(),H.current=Vh(),Z.current=void 0,ge(_)),_},[ge]),we=(0,ee.useRef)(new Fh({api:t,headers:()=>({...p.current}),body:()=>{let _={...h.current??{}},he=Object.hasOwn(_,"sessionId"),Se=bB(_.sessionId);if(Se)ot(Se),_.sessionId=Se;else if(he)x(),delete _.sessionId;else{let Qh=ze();Qh&&(_.sessionId=Qh)}nu(I.current)&&(_.modelContext=I.current),y.current?.length&&(_.documents=y.current);let et=w.current,Ot=ma();et&&(_.visitorContext={timezone:et.timezone,language:et.language,languages:et.languages,deviceType:et.deviceType,referrer:et.referrer,visitorId:Ot});let Kt=typeof _.visitor=="object"&&_.visitor!==null?_.visitor:{},g3=typeof Kt.client=="object"&&Kt.client!==null?Kt.client:{};_.visitor={...Kt,id:Ot,client:{...g3,...et&&{memoryUserId:et.memoryUserId}}};let w0=be(_.extra);return w0&&(_.extra=w0),v.current&&(Object.hasOwn(_,"threadId")?typeof _.threadId=="string"&&(O.current=_.threadId):_.threadId=Oe()),_},fetch:(async(_,he)=>{let Se=te.current;Se?.mark("requestStart");try{let et=await fetch(_,he);return I.current=void 0,ot(et.headers.get(xY)),Se?Se.instrument(et):et}finally{y.current=void 0}})})),ce=(0,ee.useRef)(e.transport?.({fallback:we.current,headers:()=>p.current,body:()=>{let _=be(h.current?.extra);return{channelId:re("channelId"),visitor:{id:ma()},..._?{extra:_}:{}}},threadHistory:()=>v.current,threadId:()=>v.current?Oe():void 0,hasMessages:()=>Ie.current.length>0,takeTurnInput:()=>{let _=y.current;return y.current=void 0,I.current=void 0,_?.length?{documents:_}:{}},onSession:ot})??we.current),Le=(0,ee.useRef)(null),ie=(0,ee.useRef)(null),xe=(0,ee.useRef)({}),[Ne,_e]=(0,ee.useState)(0),Fe=e.skipRemoteConfig===!0,Ae=(0,ee.useCallback)(async()=>{if(!Fe)try{let _=await IY(t,p.current);xe.current=_,_e(he=>he+1)}catch(_){console.warn("[Waniwani] Failed to fetch tool definitions:",_ instanceof Error?_.message:_)}},[t,Fe]);(0,ee.useEffect)(()=>{Ae()},[Ae]);let{messages:de,sendMessage:W,setMessages:ct,status:le,stop:oe}=fB({messages:e.initialMessages,transport:ce.current,onFinish({message:_,isAbort:he,isDisconnect:Se,isError:et}){te.current?.mark("streamEnd"),We(he||Se||et?"error":"ok"),i?.(),!he&&!Se&&!et&&d.emit({name:"message.received"}),Le.current&&(ie.current=_)},onError(_){We("error"),console.warn("[Waniwani] Chat error:",_.message),d.emit({name:"chat.error",properties:{message:_.message.slice(0,SY)}}),Le.current&&(Le.current.reject(_),Le.current=null)}}),Ie=(0,ee.useRef)(de);(0,ee.useEffect)(()=>{Ie.current=de},[de]);let ae=ce.current.keepsSession?.()??!1,k=(0,ee.useRef)(!1);(0,ee.useEffect)(()=>{!ae||k.current||Ie.current.length>0||(k.current=!0,ce.current.restore?.().then(_=>{_.length>0&&Ie.current.length===0&&ct(_)}).catch(()=>{}))},[ae]),(0,ee.useEffect)(()=>{let _=ce.current;return()=>_.dispose?.()},[]);let D=(0,ee.useCallback)(()=>{te.current=E1(Ie.current.filter(_=>_.role==="user").length+1)},[]),[F,fe]=(0,ee.useState)(!1),Ve=(0,ee.useCallback)(async()=>{fe(!0);try{await oe();let _=E.current;if(!_)return;await fetch(Na(t,"/cancel"),{method:"POST",headers:{"Content-Type":"application/json",...p.current},body:JSON.stringify({sessionId:_})})}catch{}finally{fe(!1)}},[t,oe]),Ft=(0,ee.useRef)(s);(0,ee.useEffect)(()=>{if(!s||Ft.current||(Ft.current=!0,Ie.current.length>0))return;let _=!1,he=P.current;return $(!1),(async()=>{try{let Se=w.current;if(!Se)try{Se=await Ic(),w.current=Se}catch{}let et=Se?.memoryUserId;if(!et||_||he!==P.current){_||$(!0);return}let Ot=l??await i0(et);if(_||he!==P.current)return;if(Ot){let Kt=await jh(Ot);if(_||he!==P.current)return;Kt&&Kt.memoryUserId===et&&(O.current=Kt.threadId,R(Kt.threadId),H.current=Kt.createdAt,Z.current=Kt.title,Kt.sessionId&&(E.current=Kt.sessionId,S(Kt.sessionId)),ct(Kt.messages))}await C()}finally{_||$(!0)}})(),()=>{_=!0}},[s]),(0,ee.useEffect)(()=>{if(le==="ready"&&Le.current&&ie.current){let _=Le.current,he=ie.current;Le.current=null,ie.current=null,_.resolve(he)}},[le]);let[In,ca]=(0,ee.useState)(""),so=typeof c!="function",lo=In.length>0;(0,ee.useEffect)(()=>{so&&lo&&ce.current.prepare?.()},[so,lo]);let[qt,Vn]=(0,ee.useState)([]),on=(0,ee.useRef)([]);on.current=qt;let xu=le==="submitted"||le==="streaming",nf=(0,ee.useCallback)(_=>{for(let he of _)for(let Se of he.documents??[])zh({documentId:Se.documentId,api:t,headers:p.current,uploadHeaders:m.current})},[t]),uo=(0,ee.useCallback)(()=>{nf(on.current),Vn([])},[nf]),i3=(0,ee.useCallback)(_=>{let he=on.current.find(Se=>Se.id===_);he&&nf([he]),Vn(Se=>Se.filter(et=>et.id!==_))},[nf]),s3=xu&&qt.length>0,l3=(0,ee.useCallback)(_=>{let he=!!_.text?.trim(),Se=!!(_.files?.length||_.documents?.length);if(he||Se){if(xu){if(qt.length>0)return;Vn(et=>[...et,{id:ud(),text:_.text||"",files:_.files??[],documents:_.documents??[],modelContext:_.modelContext}]),ca("");return}D(),I.current=_.modelContext,y.current=_.documents,W({text:_.text||"",files:_.files,..._.documents?.length&&{metadata:{documents:_.documents}}}),o?.(_.text||""),d.emit({name:"message.sent"}),ca("")}},[W,o,xu,qt.length,d,D]),u3=(0,ee.useCallback)(_=>new Promise((he,Se)=>{Le.current={resolve:he,reject:Se},D(),W({text:_}),o?.(_),d.emit({name:"message.sent"})}),[W,o,d,D]);(0,ee.useEffect)(()=>{if(le!=="ready"||F||qt.length===0)return;let[_,...he]=qt;Vn(he),D(),I.current=_.modelContext,y.current=_.documents,W({text:_.text,files:_.files.length>0?_.files:void 0,..._.documents.length>0&&{metadata:{documents:_.documents}}}),o?.(_.text),d.emit({name:"message.sent"})},[le,F,W,o,qt,d,D]);let c3=(0,ee.useCallback)(()=>{ce.current.reset?.(),ct([]),uo(),x(),ca(""),xe.current={},_e(_=>_+1),Ae()},[ct,x,Ae,uo]),rf=(0,ee.useCallback)(()=>{if(!v.current)return;let _=w.current?.memoryUserId,he=O.current,Se=Ie.current;if(!(!_||!he||Se.length===0)){if(H.current||(H.current=Vh()),!Z.current){let et=Se.find(Kt=>Kt.role==="user"),Ot=et?et.parts.map(Kt=>"text"in Kt&&typeof Kt.text=="string"?Kt.text:"").join(" "):"";Z.current=vB(Ot)}return{threadId:he,memoryUserId:_,title:Z.current,messages:Se,sessionId:E.current,createdAt:H.current,updatedAt:Vh()}}},[]),h0=(0,ee.useCallback)(async()=>{let _=rf();_&&(await o0(_),await C())},[rf,C]);(0,ee.useEffect)(()=>{if(s&&Q&&!(le==="submitted"||le==="streaming")&&de.length!==0)return X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{X.current=void 0;let _=h0().finally(()=>{B.current===_&&(B.current=void 0)});B.current=_},bY),()=>{X.current&&clearTimeout(X.current)}},[s,Q,de,le,h0]);let of=(0,ee.useCallback)(()=>{let _=B.current,he=X.current,Se=he?rf():void 0;return he&&(clearTimeout(he),X.current=void 0),(async()=>{_&&await _,Se&&(await o0(Se),await C())})()},[rf,C]),d3=(0,ee.useCallback)(()=>{P.current+=1,of(),ce.current.dispose?.(),ct([]),uo(),x(),ca("");let _=xB();return H.current=Vh(),Z.current=void 0,ge(_),C(),_},[ct,x,ge,C,of,uo]),Jh=(0,ee.useCallback)(async _=>{P.current+=1;let he=P.current;if(await of(),he!==P.current)return;let Se=await jh(_);he===P.current&&Se&&(ce.current.dispose?.(),Se.sessionId?(E.current=Se.sessionId,S(Se.sessionId)):x(),ge(Se.threadId),H.current=Se.createdAt,Z.current=Se.title,ct(Se.messages),uo(),ca(""))},[ct,x,ge,of,uo]),f3=(0,ee.useCallback)(async _=>{if(O.current===_){P.current+=1,X.current&&(clearTimeout(X.current),X.current=void 0);let he=B.current;he&&await he}await wB(_),ce.current.forget?.(_),await C(),O.current===_&&(ce.current.dispose?.(),ct([]),uo(),x(),ca(""),O.current=void 0,R(void 0),H.current=void 0,Z.current=void 0)},[ct,x,C,uo]);(0,ee.useEffect)(()=>{s&&Q&&l!==void 0&&l!==O.current&&Jh(l)},[l,s,Q,Jh]);let p3=(0,ee.useCallback)(_=>{ca(_.target.value)},[]),g0=de[de.length-1],y0=de.length>0,m3=xu&&(!y0||g0.role==="user"),h3=xe.current;return{messages:de,status:le,text:In,setText:ca,handleSubmit:l3,handleTextChange:p3,isLoading:xu,showLoaderBubble:m3,lastMessage:g0,hasMessages:y0,sendMessage:W,sendMessageAndWait:u3,stop:Ve,reset:c3,queuedMessages:qt,queueFull:s3,removeQueuedMessage:i3,sessionId:g,toolDefinitions:h3,refreshToolDefinitions:Ae,threads:U,activeThreadId:T,isThreadHistoryReady:Q,startNewThread:d3,switchThread:Jh,deleteThread:f3,keepsSession:ae}}var bs=j(Ee(),1);var CY=6e3;function IB(e){let{api:t,headers:a,uploadHeaders:n,sessionId:r,documentUpload:o,allowAttachments:i}=e,[s,l]=(0,bs.useState)(null),u=(0,bs.useCallback)((p,m,h)=>hB({file:p,api:t,headers:a,uploadHeaders:n,sessionId:r,signal:m,onProgress:h}),[t,a,n,r]),c=(0,bs.useCallback)(p=>{zh({documentId:p.documentId,api:t,headers:a,uploadHeaders:n})},[t,a,n]);(0,bs.useEffect)(()=>{if(!s)return;let p=setTimeout(()=>l(null),CY);return()=>clearTimeout(p)},[s]);let d=o?.enabled??!1;return{enabled:o?o.enabled:!!i,accept:o?.accept.join(","),maxFileSize:o?.maxBytes,maxPdfPages:o?.maxPdfPages,maxFiles:o?.maxFiles,upload:d?u:void 0,onDiscard:d?c:void 0,error:s,reportError:l}}var Ha=j(Ee(),1);function du(e){return e.map(t=>({id:null,text:t}))}function Ss(e){let{flow:t,followup:a,page:n,channel:r}=e;return t!==null?{origin:"flow",suggestions:t}:a?.length?{origin:"followup",suggestions:a}:n?.length?{origin:"page",suggestions:n}:r?.length?{origin:"channel",suggestions:r}:null}function fu(e){return typeof e=="object"&&e!==null}function CB(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function kY(e){if(!fu(e)||!("toolCallId"in e)||!("output"in e))return null;let t=e.output;if(!fu(t)||!fu(t._meta))return null;let a=t._meta[Hw];return!fu(a)||!CB(a.suggestions)?null:a.suggestions}function kB(e){let t=null;for(let a of e.parts){let n=kY(a);n!==null&&(t=n)}return t}function TB(e){for(let t of e.parts){if(!fu(t)||t.type!=="data-suggestions")continue;let a=t.data;if(fu(a)&&CB(a.suggestions)&&a.suggestions.length>0)return a.suggestions}return null}function TY(e){return"page"in e||"channel"in e}function LY(e){return typeof e!="object"||e===null?{}:TY(e)?{rungs:e}:{initial:e.initial}}function LB(e){let{messages:t,status:a,suggestions:n}=e,r=n!==!1,{rungs:o,initial:i}=LY(n),s=(0,Ha.useMemo)(()=>({page:null,channel:du(i??[])}),[i]),l=o??s,u=(0,Ha.useMemo)(()=>r?Ss({flow:null,followup:null,...l}):null,[r,l]),c=(0,Ha.useMemo)(()=>u?.suggestions.map(g=>g.text)??[],[u]),[d,p]=(0,Ha.useState)(c),[m,h]=(0,Ha.useState)(u?.origin??"channel"),v=(0,Ha.useRef)(a),I=(0,Ha.useCallback)(()=>{p([])},[]),y=t.length>0;(0,Ha.useEffect)(()=>{y||(p(c),h(u?.origin??"channel"))},[c,u,y]);let w=t[t.length-1];return(0,Ha.useEffect)(()=>{w?.role==="user"&&I()},[w,I]),(0,Ha.useEffect)(()=>{let g=v.current;if(v.current=a,g!=="streaming"||a!=="ready"||!r)return;let S=[...t].reverse().find(O=>O.role==="assistant");if(!S)return;let E=kB(S),T=TB(S),R=Ss({flow:E===null?null:du(E),followup:T===null?null:du(T),page:null,channel:null});p(R?R.suggestions.map(O=>O.text):[]),h(R?.origin??"channel")},[a,r,t]),{suggestions:d,source:m,isLoading:!1,clear:I}}function EB(e,t){let a=t?.Authorization,n=typeof a=="string"&&a.startsWith("Bearer ")?a.slice(7):null;return Na(e,"/resource",n?{token:n}:void 0)}var EY={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"],glassTint:["--ww-glass-tint"],glassTintStrength:["--ww-glass-tint-opacity"]};function pu(e){let t={};for(let[a,n]of Object.entries(EY)){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 nt=j(me(),1),mu=(0,Qe.forwardRef)(function(t,a){let{locale:n,messages:r}=t;return(0,nt.jsx)(es,{locale:n,messages:r,children:(0,nt.jsx)(AY,{...t,ref:a})})}),AY=(0,Qe.forwardRef)(function(t,a){let{t:n,ready:r}=Ue(),{appearance:o,className:i,classNames:s,allowAttachments:l=!1,documentUpload:u,welcomeMessage:c,welcome:d,placeholder:p=n.promptInput.placeholder,triggerEvent:m="triggerDemoRequest",api:h,mcp:v,debug:I=!1,readOnly:y=!1,title:w,headerActions:g,hideHeader:S=!1,enableThreadHistory:E=!1,showToolCalls:T=!0,initializing:R=!1,onScreen:O=!0,disclaimer:U}=t,A=o?.theme,Q=o?.variables,$=o?.assistantBubble??!1,H=Q?pu(Q):{},[Z,X]=(0,Qe.useState)(!1);(0,Qe.useEffect)(()=>{if(A!=="auto"||typeof window>"u")return;let k=window.matchMedia("(prefers-color-scheme: dark)");X(k.matches);let D=()=>X(k.matches);return k.addEventListener("change",D),()=>k.removeEventListener("change",D)},[A]);let B=A==="dark"||A==="auto"&&Z,P=SB({...t,api:h}),J=Ph(),ge=iB({...t,api:h,sessionId:P.sessionId,onCallTool:v?.onCallTool}),C=v?.resourceEndpoint??EB(h,t.headers),ze=(0,Qe.useRef)({});ze.current={api:h,token:jp(t.headers),channelId:typeof t.body?.channelId=="string"?t.body.channelId:void 0,sessionId:P.sessionId};let ot=(0,Qe.useCallback)(k=>{Vp("widget",ze.current,{widget:k.widget,outcome:k.outcome},k.metrics)},[]),x=Hl(p,!P.text),te=IB({api:h,headers:t.headers,uploadHeaders:t.uploadHeaders,sessionId:P.sessionId,documentUpload:u,allowAttachments:l}),[re,ke]=(0,Qe.useState)(null),[We,be]=(0,Qe.useState)(null),Oe=(0,Qe.useRef)(null),we=(0,Qe.useRef)(null),ce=(0,Qe.useRef)(null),Le=(0,Qe.useRef)(null),[ie,xe]=(0,Qe.useState)(!0),Ne=(0,Qe.useRef)(ie);Ne.current=ie;let _e=(0,Qe.useCallback)(()=>{let k=Oe.current;if(!k)return;let D=k.querySelector("textarea");D&&D.focus()},[]),Fe=(0,Qe.useCallback)((k="smooth")=>{let D=we.current;D&&D.scrollTo({top:D.scrollHeight,behavior:k})},[]);(0,Qe.useEffect)(()=>{let k=Le.current,D=we.current;if(!k||!D)return;let F=new IntersectionObserver(([fe])=>xe(fe.isIntersecting),{root:D,rootMargin:"0px 0px 200px 0px",threshold:0});return F.observe(k),()=>F.disconnect()},[]),(0,Qe.useEffect)(()=>{let k=we.current;if(!k)return;let D=F=>{let Ve=(F.target instanceof Element?F.target:null)?.closest("a");Ve?.href&&J.emit({name:"link.clicked",properties:{url:Ve.href}})};return k.addEventListener("click",D),()=>k.removeEventListener("click",D)},[J]),(0,Qe.useEffect)(()=>{(P.messages[P.messages.length-1]?.role==="user"||Ne.current)&&Fe("smooth")},[P.messages.length,P.messages[P.messages.length-1]]),(0,Qe.useEffect)(()=>{Fe("auto")},[Fe]),(0,Qe.useEffect)(()=>{if(typeof ResizeObserver>"u")return;let k=we.current,D=ce.current;if(!k&&!D)return;let F=k?.scrollHeight??0,fe=k?.clientHeight??0,Ve=new ResizeObserver(()=>{let Ft=we.current;if(!Ft)return;let In=Ft.scrollTop+fe>=F-5;F=Ft.scrollHeight,fe=Ft.clientHeight,In&&Fe("auto")});return k&&Ve.observe(k),D&&Ve.observe(D),()=>Ve.disconnect()},[Fe]);let Ae=LB({messages:P.messages,status:P.status,suggestions:t.suggestions}),de=(0,Qe.useRef)(null);(0,Qe.useEffect)(()=>{let k=Ae.suggestions;!O||k.length===0||de.current===k||(de.current=k,J.emit({name:"suggestions.shown",properties:{texts:k,origin:Ae.source}}))},[Ae.suggestions,Ae.source,J,O]);let W=d?.suggestions,ct=(0,Qe.useRef)(null);(0,Qe.useEffect)(()=>{!O||P.messages.length>0||!W?.length||ct.current===W||(ct.current=W,J.emit({name:"suggestions.shown",properties:{texts:W,origin:"channel"}}))},[W,P.messages.length,J,O]);let le=(0,Qe.useCallback)(k=>{let D=k.content.map(F=>F.text??"").join("").trim();D&&P.handleSubmit({text:D,files:[],modelContext:k.modelContext})},[P.handleSubmit]),oe=(0,Qe.useCallback)(k=>{let D=Ae.suggestions.indexOf(k),F=D>=0?D:d?.suggestions?.indexOf(k)??-1,fe=D>=0?Ae.source:"channel";J.emit({name:"suggestion.clicked",properties:{text:k,index:F,origin:fe}}),Ae.clear(),P.handleSubmit({text:k,files:[]})},[Ae.suggestions,Ae.source,Ae.clear,P.handleSubmit,d,J]);(0,Qe.useImperativeHandle)(a,()=>({sendMessage:k=>{P.handleSubmit({text:k,files:[]}),_e()},sendMessageAndWait:k=>P.sendMessageAndWait(k),reset:P.reset,focus:_e,get messages(){return P.messages},get sessionId(){return P.sessionId}}),[P.handleSubmit,P.sendMessageAndWait,P.reset,P.messages,P.sessionId,_e]),(0,Qe.useEffect)(()=>{if(!m)return;let k=D=>{let F=D.detail,fe=typeof F?.message=="string"?F.message:void 0;fe&&P.handleSubmit({text:fe,files:[]}),_e()};return window.addEventListener(m,k),()=>window.removeEventListener(m,k)},[m,P.handleSubmit,_e]);let Ie=!S&&!!(w||E||P.keepsSession||g),ae=R||!r;return(0,nt.jsxs)("div",{ref:Oe,style:{...H,maxHeight:"inherit",...re&&We?{height:We}:{},opacity:ae?0:1,transition:"opacity 220ms ease-out"},"data-waniwani-chat":"","data-waniwani-layout":"embed","data-assistant-bubble":$?"true":void 0,"data-color-scheme":A==="auto"?"auto":void 0,...ae?{"data-waniwani-initializing":""}:{},...B?{"data-waniwani-dark":""}:{},className:V("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",A==="dark"&&"dark",i,s?.root),children:[Ie&&(0,nt.jsxs)("div",{className:V("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",s?.header),style:{backgroundColor:"var(--ww-color-card-header)",color:"var(--ww-color-card-header-foreground)"},children:[w&&(0,nt.jsx)("div",{className:"ww:text-sm ww:font-semibold ww:truncate ww:flex-1 ww:min-w-0",children:w}),!w&&(0,nt.jsx)("div",{className:"ww:flex-1"}),!E&&P.keepsSession&&(0,nt.jsx)(Dh,{onClick:P.reset}),E&&(0,nt.jsx)(nB,{threads:P.threads,activeThreadId:P.activeThreadId,onNewThread:P.startNewThread,onSelectThread:k=>{P.switchThread(k)},onDeleteThread:k=>{P.deleteThread(k)}}),g]}),(0,nt.jsxs)("div",{ref:we,className:V("ww:relative ww:flex-1 ww:min-h-0",re?"ww:overflow-hidden":"ww:overflow-y-auto"),children:[(0,nt.jsxs)("div",{ref:ce,className:V("ww:mx-auto ww:w-full ww:max-w-3xl ww:px-4 ww:py-6 ww:flex ww:flex-col ww:gap-6",re&&"ww:!py-0"),children:[(0,nt.jsx)(KU,{value:ot,children:(0,nt.jsx)(eB,{messages:P.messages,status:P.status,welcomeMessage:c,welcome:d,onSuggestionSelect:oe,resourceEndpoint:C,chatSessionId:P.sessionId,isDark:B,onFollowUp:le,onCallTool:ge,fullscreenToolCallId:re,debug:I,showToolCalls:T,toolDefinitions:P.toolDefinitions,messageClassNames:{message:s?.message,userBubble:s?.userBubble,assistantBubble:s?.assistantBubble},onWidgetDisplayModeChange:(k,D)=>{if(k==="fullscreen"){let F=Oe.current?.getBoundingClientRect().height??0;be(F>0?F:null),ke(D.toolCallId)}else be(null),ke(null)}})}),(0,nt.jsx)("div",{ref:Le,"aria-hidden":!0,style:{height:1}})]}),!ie&&!re&&(0,nt.jsx)("div",{className:"ww:sticky ww:bottom-2 ww:flex ww:justify-center ww:pointer-events-none",children:(0,nt.jsx)(br,{type:"button",onClick:()=>Fe("smooth"),size:"icon",variant:"outline",className:"ww:rounded-full ww:shadow ww:pointer-events-auto","aria-label":"Scroll to latest",children:(0,nt.jsx)(Tc,{className:"ww:size-4"})})})]}),!y&&(0,nt.jsxs)("div",{className:"ww:shrink-0 ww:bg-background",style:re?{display:"none"}:void 0,children:[(0,nt.jsx)(Sl,{suggestions:Ae.suggestions,isLoading:Ae.isLoading,onSelect:oe}),(0,nt.jsx)(HM,{queuedMessages:P.queuedMessages,onRemove:P.removeQueuedMessage}),(0,nt.jsx)("div",{className:"ww:px-4 ww:pb-2 ww:pt-2",children:(0,nt.jsxs)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl",children:[(0,nt.jsxs)(TM,{onSubmit:P.handleSubmit,attachmentsEnabled:te.enabled,globalDrop:te.enabled,multiple:te.enabled,accept:te.accept,maxFileSize:te.maxFileSize,maxPdfPages:te.maxPdfPages,maxFiles:te.maxFiles,upload:te.upload,onDiscard:te.onDiscard,onError:te.reportError,className:V("ww-input ww:rounded-2xl ww:border-border ww:bg-input",s?.input),children:[(0,nt.jsx)(DM,{enabled:te.enabled}),te.enabled&&(0,nt.jsx)(RM,{className:"ww:px-4 ww:pt-3"}),(0,nt.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-4 ww:pr-3 ww:py-2.5",children:[te.enabled&&(0,nt.jsx)(MM,{}),(0,nt.jsx)(EM,{onChange:P.handleTextChange,value:P.text,placeholder:x,className:"ww:min-h-0 ww:py-1 ww:px-0"}),(0,nt.jsx)(AM,{status:P.status,disabled:P.queueFull,onStop:P.stop})]})]}),te.error&&(0,nt.jsx)("output",{className:"ww:block ww:pt-1.5 ww:text-center ww:text-destructive ww:text-xs",children:te.error.message}),(0,nt.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,nt.jsx)(tB,{}),(0,nt.jsx)(_M,{text:U})]})]})})]})]})});var Qd=j(Ee(),1);var AB="500px",MY="https://app.waniwani.ai/api/mcp/chat",RY={api:MY};function s0(){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 $h(){let e=s0();if(!e)return{};let t=J=>e.getAttribute(J)??void 0,a=J=>{let ge=e.getAttribute(J);if(ge==null)return;let C=ge.trim().toLowerCase();if(C==="true"||C==="1"||C==="")return!0;if(C==="false"||C==="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 s=t("data-title");s&&(n.title=s);let l=t("data-welcome-message");l&&(n.welcomeMessage=l);let u=t("data-placeholder");u&&(n.placeholder=u);let c=t("data-mcp-server-url");c&&(n.mcpServerUrl=c);let d=t("data-webmcp");d&&(n.webmcp={enabled:d!=="false"&&d!=="off"});let p=t("data-channel-id");if(p&&(n.channelId=p),t("data-show-tool-calls")?.trim().toLowerCase()==="titles-only")n.showToolCalls="titles-only";else{let J=a("data-show-tool-calls");J!==void 0&&(n.showToolCalls=J)}let h=t("data-css");h&&(n.css=h);let v=t("data-suggestions");v&&(n.suggestions=v.split(",").map(J=>J.trim()).filter(Boolean));let I=a("data-enable-thread-history");I!==void 0&&(n.enableThreadHistory=I);let y=a("data-disable-page-view");y!==void 0&&(n.disablePageView=y);let w=a("data-hide-header");w!==void 0&&(n.hideHeader=w);let g=t("data-theme");(g==="light"||g==="dark"||g==="auto")&&(n.appearance={...n.appearance,theme:g});let S=a("data-assistant-bubble");S!==void 0&&(n.appearance={...n.appearance,assistantBubble:S});let E=t("data-locale");(E==="en"||E==="fr"||E==="es")&&(n.locale=E);let T=t("data-mode");(T==="inline"||T==="floating"||T==="composer"||T==="off")&&(n.mode=T);let R={},O=t("data-composer-variant")?.trim().toLowerCase();(O==="glow"||O==="outline")&&(R.variant=O);let U=t("data-composer-size")?.trim().toLowerCase();(U==="sm"||U==="md"||U==="lg")&&(R.size=U);let A=a("data-composer-suggestions");A!==void 0&&(R.showSuggestions=A);let Q=t("data-composer-align")?.trim().toLowerCase();(Q==="start"||Q==="center")&&(R.align=Q);let $=a("data-composer-trigger");$!==void 0&&(R.trigger=$);let H=a("data-composer-mobile-trigger");H!==void 0&&(R.mobileTrigger=H),Object.keys(R).length>0&&(n.composer=R);let Z=t("data-height");Z&&(n.height=Z);let X=t("data-launcher-text");X&&(n.launcherText=X);let B=t("data-appear-delay");if(B!==void 0){let J=Number.parseInt(B.trim(),10);Number.isFinite(J)&&J>=0&&(n.appearDelay=J)}let P=t("data-disclaimer");if(P!==void 0){let J=P.trim(),ge=J.toLowerCase();ge==="false"||ge==="0"?n.disclaimer=!1:J&&(n.disclaimer=J)}return n}function Kd(e){if(!e)return{};let t={};for(let a in e)e[a]!==void 0&&(t[a]=e[a]);return t}function Yd(e,t,a){let n=a??$h(),r=DY(t,n,e),o={...t?.composer??{},...Kd(n.composer),...Kd(e?.composer)},i=Object.keys(o).length>0,s={token:"",...RY,...Kd(t),...Kd(n),...Kd(e),...r?{appearance:r}:{},...i?{composer:o}:{}};if(!s.token)throw new Error("[Waniwani] Missing required config: `token`. Set data-token on the script tag or pass it to Waniwani.chat.init().");return s}function DY(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 s={};return n&&(s.theme=n),o&&(s.variables=r),i!==void 0&&(s.assistantBubble=i),s}var OB=j(Ee(),1);var Wh=j(Ee(),1);function _Y(e){return e?.patterns??e?.rules??[]}var MB="\0\0";function PY(e){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*\\\*/g,MB).replace(/\\\*/g,"[^/]*").split(MB).join(".*");return new RegExp(`^${a}$`)}function RB(e,t){try{return PY(e).test(t)}catch{return!1}}function Zd(e,t){if(!e)return!0;let a=!1;for(let n of _Y(e))if(RB(n.glob,t)){if(n.action==="hide")return!1;a=!0}return a?!0:(e.default??"show")!=="hide"}function DB(e,t){for(let a of e?.appearRules??[])if(RB(a.glob,t))return a.appearAfter;return null}var l0="waniwani:locationchange",_B=!1;function OY(){if(!(_B||typeof history>"u")){_B=!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(l0)),r}}}}function NY(e){return OY(),window.addEventListener(l0,e),window.addEventListener("popstate",e),()=>{window.removeEventListener(l0,e),window.removeEventListener("popstate",e)}}function UY(){return window.location.pathname}function BY(){return"/"}function Jd(){return(0,Wh.useSyncExternalStore)(NY,UY,BY)}function hu(e,t){let a=Jd(),n=t&&Zd(e,a);return(0,Wh.useEffect)(()=>{Ua("visibility gate",{pathname:a,ready:t,visible:n,rules:e})},[a,t,n]),n}var zY=3,FY=["low","medium","high"];function u0(e){if(e.length===0)return;let t=Math.floor(Math.random()*e.length),[a]=e.splice(t,1);return a}function qY(e){let t=new Map,a=[];for(let o of e)if(o.tier){let i=t.get(o.tier)??[];i.push(o),t.set(o.tier,i)}else a.push(o);let n=[];for(let o of FY){let i=u0(t.get(o)??[])??u0(a);i&&n.push(i)}let r=[...t.values()].flat().concat(a);for(;n.length<Math.min(zY,e.length);){let o=u0(r);if(!o)break;n.push(o)}return n}function PB(e){let t;try{t=new URL(e,"http://localhost").pathname}catch{t="/"}let a=t.replace(/\/+$/,"");return(a===""?"/":a).toLowerCase()}function NB(e){return Array.isArray(e)?e.flatMap(t=>{let a=t;if(typeof a?.url!="string"||a.url.length===0||!Array.isArray(a.prompts))return[];let n=a.prompts.flatMap(r=>{let o=r;return typeof o?.text!="string"||o.text.length===0?[]:[{id:typeof o.id=="string"?o.id:null,text:o.text,tier:o.tier==="low"||o.tier==="medium"||o.tier==="high"?o.tier:void 0}]});return n.length>0?[{url:a.url,prompts:n}]:[]}):[]}function gu(e){let{pageSuggestions:t,suggestions:a}=e,n=Jd();return(0,OB.useMemo)(()=>{let r=PB(n),o=t?.find(s=>PB(s.url)===r),i=o?qY(o.prompts).map(({id:s,text:l})=>({id:s,text:l})):null;return Ua("configured suggestions resolve",{pathname:r,matched:!!o,count:i?.length??0}),{page:i,channel:du(a??[])}},[n,t,a])}var HY="waniwani:config:";function UB(e,t,a){return`${HY}${e}|${t}|${a??""}`}function ci(e,t,a){if(typeof window>"u")return null;try{let n=window.sessionStorage.getItem(UB(e,t,a));if(!n)return null;let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function jY(e,t,a,n){if(!(typeof window>"u"))try{window.sessionStorage.setItem(UB(e,t,a),JSON.stringify(n))}catch{}}var VY=600;function $Y(e){if(typeof e!="object"||e===null||typeof e.enabled!="boolean")return null;let t=Array.isArray(e.accept)?e.accept.filter(n=>typeof n=="string"):[],a=n=>typeof n=="number"&&Number.isFinite(n)&&n>0;return e.enabled?a(e.maxBytes)&&a(e.maxPdfPages)&&a(e.maxFiles)&&t.length>0?{enabled:!0,maxBytes:e.maxBytes,maxPdfPages:e.maxPdfPages,maxFiles:e.maxFiles,accept:t}:null:{enabled:!1,maxBytes:0,maxPdfPages:0,maxFiles:0,accept:t}}async function WY(e,t,a,n){Di("configStart");let r=await GY(e,t,a,n);return Di("configEnd"),a?.aborted||Jw(r.metadata),r}async function GY(e,t,a,n){try{let r=Na(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(),s=i&&typeof i=="object"&&"data"in i&&i.data?i.data:i;return s?XY(s):{}}catch{return{}}}function XY(e){let t={};e.source!=null&&(t.source=e.source),e.channelId!=null&&(t.channelId=e.channelId),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);let a=NB(e.pageSuggestions);a.length>0&&(t.pageSuggestions=a),typeof e.enableThreadHistory=="boolean"&&(t.enableThreadHistory=e.enableThreadHistory),typeof e.sessionApi=="string"&&e.sessionApi&&(t.sessionApi=e.sessionApi),typeof e.webmcp?.enabled=="boolean"&&(t.webmcp={enabled:e.webmcp.enabled}),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);let n=$Y(e.documentUpload);return n&&(t.documentUpload=n),e.metadata&&typeof e.metadata=="object"&&(t.metadata=e.metadata),t}function yu(e,t,a){let[n,r]=(0,Qd.useState)(e),[o,i]=(0,Qd.useState)(!1);return(0,Qd.useEffect)(()=>{let s=e.api,l=e.token,u=e.channelId;if(!s||!l){i(!0);return}let c=h=>{e.disablePageView||M1({api:s,token:l,channelId:u??h.channelId,mode:e.mode==="off"?void 0:e.mode,source:h.source})},d=ci(s,l,u);if(d)try{let h=Yd(t,d,a);r(h),$p("cache"),Jw(d.metadata),i(!0),Ua("config resolved (sessionStorage cache)",{config:h,visibility:h.visibility}),c(d)}catch{}let p=new AbortController,m=setTimeout(()=>{$p("timeout"),i(!0)},VY);return WY(s,l,p.signal,u).then(h=>{if(!p.signal.aborted){if(Ua("remote /config response",h),Object.keys(h).length>0){jY(s,l,u,h);try{let v=Yd(t,h,a);r(v),Ua("config resolved (remote)",{config:v,visibility:v.visibility})}catch(v){console.error("[Waniwani] Failed to apply remote config:",v)}}$p("remote"),i(!0),c(h)}}).catch(h=>{console.error("[Waniwani] Remote config fetch failed:",h),i(!0)}).finally(()=>clearTimeout(m)),()=>{p.abort(),clearTimeout(m)}},[e.api,e.token,e.channelId]),{config:n,ready:o}}var Gt=j(me(),1),KY={sm:{row:"ww:gap-1 ww:pl-3 ww:pr-1 ww:py-1",field:"ww:py-1 ww:text-base ww:sm:text-sm",send:"ww:size-7",sendIcon:"ww:size-3.5",radius:12},md:{row:"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",field:"ww:py-1.5 ww:text-base ww:sm:text-sm",send:"ww:size-8",sendIcon:"ww:size-4",radius:16},lg:{row:"ww:gap-2 ww:pl-5 ww:pr-2 ww:py-2.5 ww:sm:pl-6 ww:sm:pr-2.5 ww:sm:py-3",field:"ww:py-2 ww:text-base",send:"ww:size-10",sendIcon:"ww:size-5",radius:20}},BB="var(--ww-composer-bg, var(--ww-color-input))",YY="var(--ww-composer-border-color, var(--ww-color-border))",ZY="var(--ww-composer-border-width, 1px)",zB="var(--ww-composer-send-bg, var(--ww-color-foreground))",FB="var(--ww-composer-send-fg, var(--ww-color-background))",HB=(0,rt.forwardRef)(function(t,a){return(0,Gt.jsx)(es,{locale:t.config.locale,children:(0,Gt.jsx)(JY,{...t,ref:a})})}),JY=(0,rt.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,panelContainer:r,onVisibilityChange:o},i){let{t:s}=Ue(),{config:l,ready:u}=yu(t,a,n),c=hu(l.visibility,u);(0,rt.useEffect)(()=>{o?.(c)},[c,o]),ru({api:l.api,token:l.token,channelId:l.channelId,mode:"composer",paintMark:"chatVisible",painted:u});let d=(0,rt.useRef)(null),p=(0,rt.useMemo)(()=>su({mode:"composer",getSessionId:()=>d.current?.sessionId}),[]),m=l.onEvent;(0,rt.useEffect)(()=>{if(m)return p.subscribe(m)},[m,p]);let h=(0,rt.useRef)(null),v=(0,rt.useRef)(null),[I,y]=(0,rt.useState)(!1),[w,g]=(0,rt.useState)(""),[S,E]=(0,rt.useState)(0),T=l.appearance?.theme,R=l.appearance?.variables,O=(0,rt.useMemo)(()=>R?pu(R):{},[R]),U=gu(l),A=(0,rt.useMemo)(()=>Ss({flow:null,followup:null,...U}),[U]),Q=(0,rt.useMemo)(()=>A?.suggestions.map(de=>de.text)??[],[A]);Fl({widgetEvents:p,api:l.api,token:l.token,channelId:l.channelId,source:l.source,mode:"composer",pagePrompts:U.page,getSessionId:()=>d.current?.sessionId});let $=(0,rt.useRef)(null);(0,rt.useEffect)(()=>{!c||!A||$.current!==A&&($.current=A,p.emit({name:"suggestions.shown",properties:{texts:Q,origin:A.origin}}))},[c,A,Q,p]);let H=l.composer??{},Z=H.variant??"glow",X=KY[H.size??"md"],B=H.showSuggestions??!0,P=H.align==="center",J=oM(),ge=(H.trigger??!1)||J&&(H.mobileTrigger??!0),C=l.launcherText??l.placeholder??s.launcher.prompt,ze=Hl(C,!ge&&w.length===0),ot="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,rt.useEffect)(()=>{let de=h.current;if(de){if(!w){de.style.height="";return}de.style.height="auto",de.style.height=`${de.scrollHeight}px`}},[w]),(0,rt.useEffect)(()=>{S>0&&I&&d.current?.focus()},[S,I]);let x=(0,rt.useRef)(!1);(0,rt.useEffect)(()=>{u&&!x.current&&(x.current=!0,p.emit({name:"chat.ready"}))},[u,p]);let te=(0,rt.useRef)(!1);(0,rt.useEffect)(()=>{let de=c&&I;de!==te.current&&(te.current=de,p.emit({name:de?"chat.opened":"chat.closed"}))},[c,I,p]);let re=(0,rt.useCallback)(de=>{y(!0),E(ct=>ct+1);let W=de.trim();W&&d.current?.sendMessage(W)},[]);(0,rt.useImperativeHandle)(i,()=>({open:()=>y(!0),close:()=>y(!1),toggle:()=>y(de=>!de),sendMessage:de=>re(de),sendMessageAndWait:async de=>{y(!0);let W=d.current;if(W)return await W.sendMessageAndWait(de)},reset:()=>d.current?.reset(),focus:()=>{I?E(de=>de+1):(h.current??v.current)?.focus()},getMessages:()=>d.current?.messages??[],getSessionId:()=>d.current?.sessionId}),[re,I]);let ke=(0,rt.useCallback)(()=>{w.trim()&&(re(w),g(""))},[w,re]),We=(0,rt.useCallback)(()=>{(d.current?.messages.length??0)>0&&(y(!0),E(de=>de+1))},[]),be={mode:"composer"},Oe=zl(l.sessionApi);l.mcpServerUrl&&(be.mcpServerUrl=l.mcpServerUrl),l.channelId&&(be.channelId=l.channelId);let we=(0,Gt.jsx)("button",{type:"button",onClick:()=>y(!1),"aria-label":s.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,Gt.jsx)(wn,{className:"ww:size-4"})}),ce=(0,Gt.jsxs)("div",{className:V("ww:flex ww:items-end",X.row),children:[(0,Gt.jsx)("textarea",{ref:h,rows:1,value:w,placeholder:ze,onChange:de=>g(de.target.value),onFocus:We,onKeyDown:de=>{de.key==="Enter"&&!de.shiftKey&&(de.preventDefault(),ke())},className:V("ww:min-w-0 ww:flex-1 ww:resize-none ww:bg-transparent ww:max-h-36 ww:text-foreground ww:outline-none ww:placeholder:text-muted-foreground",X.field,!w&&"ww:overflow-hidden ww:whitespace-nowrap ww:text-ellipsis ww:placeholder:overflow-hidden ww:placeholder:text-ellipsis")}),(0,Gt.jsx)("button",{type:"button",onClick:ke,disabled:!w.trim(),"aria-label":s.promptInput.submit,className:V("ww:relative ww:flex ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full ww:transition-opacity hover:ww:opacity-90 disabled:ww:opacity-40",X.send),style:{background:zB,color:FB},children:(0,Gt.jsx)(pr,{className:X.sendIcon})})]}),Le=(0,Gt.jsxs)("button",{ref:v,type:"button",onClick:()=>re(""),className:V("ww:flex ww:w-full ww:items-center ww:text-left ww:cursor-pointer",X.row,P&&"ww:justify-center"),children:[(0,Gt.jsx)("span",{className:V("ww:min-w-0 ww:flex-1 ww:truncate ww:text-muted-foreground",X.field,P&&"ww:flex-none"),children:C}),(0,Gt.jsx)("span",{"aria-hidden":!0,className:V("ww:flex ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full",X.send,P&&"ww:ml-3"),style:{background:zB,color:FB},children:(0,Gt.jsx)(pr,{className:X.sendIcon})})]}),ie=ge?Le:ce,xe=`var(--ww-composer-radius, ${X.radius}px)`,Ne={borderRadius:xe,background:BB,borderColor:YY,borderWidth:ZY,borderStyle:"solid",boxShadow:`var(--ww-composer-shadow, ${ot})`},_e=Z==="glow"?(0,Gt.jsx)(Yp,{animated:u,backgroundColor:BB,borderRadius:xe,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],style:Ne,children:ie}):(0,Gt.jsx)("div",{className:V(ge&&"ww:transition-colors hover:ww:border-primary/40"),style:Ne,children:ie}),Fe=(0,Gt.jsxs)("div",{"data-waniwani-chat":"","data-color-scheme":T==="auto"?"auto":void 0,"data-waniwani-composer":"input","data-composer-variant":Z,inert:I,className:V("ww:w-full ww:font-[family-name:var(--ww-font-sans)]",T==="dark"&&"dark"),style:O,children:[_e,B&&Q.length>0&&(0,Gt.jsx)(Sl,{suggestions:Q,onSelect:de=>{p.emit({name:"suggestion.clicked",properties:{text:de,index:Q.indexOf(de),origin:A?.origin??"channel"}}),re(de)},align:P?"center":"start",className:"ww:px-0.5 ww:pt-2.5 ww:pb-0"})]}),Ae=(0,Gt.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":T==="auto"?"auto":void 0,className:V("ww:contents ww:font-[family-name:var(--ww-font-sans)]",T==="dark"&&"dark"),style:O,children:(0,Gt.jsx)("div",{role:"dialog","aria-label":l.title??C,"data-waniwani-floating":"panel","data-state":c&&I?"shown":"hidden",style:{boxShadow:ot},className:V("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,Gt.jsx)(mu,{transport:Oe,ref:d,api:l.api??"",headers:{Authorization:`Bearer ${l.token}`},skipRemoteConfig:!0,body:be,appearance:l.appearance,title:l.title,headerActions:we,hideHeader:!1,onScreen:I,welcomeMessage:l.welcomeMessage,placeholder:l.placeholder,suggestions:U,enableThreadHistory:l.enableThreadHistory,documentUpload:l.documentUpload,showToolCalls:l.showToolCalls,locale:l.locale,initializing:!u})})});return(0,Gt.jsxs)(lu,{value:p,children:[Fe,(0,qB.createPortal)(Ae,r)]})});var c0="/*! 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-black:#000;--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-md:12px;--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\\: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-0{bottom:calc(var(--ww-spacing)*0)}.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-\\[2147483000\\]{z-index:2147483000}.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-3{margin-left:calc(var(--ww-spacing)*3)}.ww\\:ml-auto{margin-left:auto}.ww\\:line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ww\\:block{display:block}.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-10{width:calc(var(--ww-spacing)*10);height:calc(var(--ww-spacing)*10)}.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-0\\.5{height:calc(var(--ww-spacing)*.5)}.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-36{max-height:calc(var(--ww-spacing)*36)}.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-60{width:calc(var(--ww-spacing)*60)}.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-72{max-width:calc(var(--ww-spacing)*72)}.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\\:flex-none{flex:none}.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-default{cursor:default}.ww\\:cursor-pointer{cursor:pointer}.ww\\:resize-none{resize:none}.ww\\:list-none{list-style-type: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\\:justify-end{justify-content:flex-end}.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-2\\.5{gap:calc(var(--ww-spacing)*2.5)}.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-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-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-2{border-style:var(--tw-border-style);border-width:2px}.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-dashed{--tw-border-style:dashed;border-style:dashed}.ww\\:border-none{--tw-border-style:none;border-style:none}.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-primary{border-color:var(--ww-color-primary,#6366f1)}.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-background\\/85{background-color:var(--ww-color-background,#fff)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-background\\/85{background-color:color-mix(in oklab,var(--ww-color-background,#fff)85%,transparent)}}.ww\\:bg-black\\/45{background-color:var(--ww-color-black)}@supports (color:color-mix(in lab, red, red)){.ww\\:bg-black\\/45{background-color:color-mix(in oklab,var(--ww-color-black)45%,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-contain{object-fit:contain}.ww\\:object-cover{object-fit:cover}.ww\\:object-center{object-position:center}.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-2\\.5{padding:calc(var(--ww-spacing)*2.5)}.ww\\:p-3{padding:calc(var(--ww-spacing)*3)}.ww\\:px-0{padding-inline:calc(var(--ww-spacing)*0)}.ww\\:px-0\\.5{padding-inline:calc(var(--ww-spacing)*.5)}.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-1\\.5{padding-top:calc(var(--ww-spacing)*1.5)}.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{padding-right:calc(var(--ww-spacing)*1)}.ww\\:pr-1\\.5{padding-right:calc(var(--ww-spacing)*1.5)}.ww\\:pr-2{padding-right:calc(var(--ww-spacing)*2)}.ww\\:pr-3{padding-right:calc(var(--ww-spacing)*3)}.ww\\:pr-9{padding-right:calc(var(--ww-spacing)*9)}.ww\\:pb-0{padding-bottom:calc(var(--ww-spacing)*0)}.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\\:pl-1{padding-left:calc(var(--ww-spacing)*1)}.ww\\:pl-3{padding-left:calc(var(--ww-spacing)*3)}.ww\\:pl-3\\.5{padding-left:calc(var(--ww-spacing)*3.5)}.ww\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:pl-5{padding-left:calc(var(--ww-spacing)*5)}.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\\:text-ellipsis{text-overflow:ellipsis}.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\\:underline{text-decoration-line:underline}.ww\\:underline-offset-2{text-underline-offset:2px}.ww\\:opacity-0{opacity:0}.ww\\:opacity-60{opacity:.6}.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-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);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\\: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\\:backdrop-blur-md{--tw-backdrop-blur:blur(var(--ww-blur-md));-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-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-\\[width\\]{transition-property: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\\:overflow-hidden::placeholder{overflow:hidden}.ww\\:placeholder\\:text-ellipsis::placeholder{text-overflow:ellipsis}.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-border:hover{background-color:var(--ww-color-border,#e5e7eb)}.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\\:py-3{padding-block:calc(var(--ww-spacing)*3)}.ww\\:sm\\:pr-2{padding-right:calc(var(--ww-spacing)*2)}.ww\\:sm\\:pr-2\\.5{padding-right:calc(var(--ww-spacing)*2.5)}.ww\\:sm\\:pl-4{padding-left:calc(var(--ww-spacing)*4)}.ww\\:sm\\:pl-6{padding-left:calc(var(--ww-spacing)*6)}.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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat]{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#eceef499)}}[data-waniwani-chat]{--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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){.dark [data-waniwani-chat],[data-waniwani-chat].dark{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#282a3480)}}.dark [data-waniwani-chat],[data-waniwani-chat].dark{--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:var(--ww-glass-tint,transparent)}@supports (color:color-mix(in lab, red, red)){[data-waniwani-chat][data-color-scheme=auto]{--ww-glass:color-mix(in srgb,var(--ww-glass-tint,transparent)calc(var(--ww-glass-tint-opacity,0)*100%),#282a3480)}}[data-waniwani-chat][data-color-scheme=auto]{--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}}";function QY(e){return e.startsWith("__WANIWANI")}function Gh(e){if(!c0||QY(c0))return;let t=document.createElement("style");t.textContent=c0,e.appendChild(t)}var je=j(Ee(),1);var Xh=j(Ee(),1),eZ=3e3,tZ=120,aZ=24;function jB(e){let[t,a]=(0,Xh.useState)(!1);return(0,Xh.useEffect)(()=>{if(!e||typeof document>"u"){a(!1);return}let n=!1,r=null,o=null,i=null,s=u=>{r=new IntersectionObserver(c=>{let d=c[0];d&&a(!d.isIntersecting&&d.boundingClientRect.bottom<=0)},{rootMargin:`0px 0px -${aZ}px 0px`,threshold:0}),r.observe(u)},l=()=>{if(n)return;let u=null;try{u=document.querySelector(e)}catch{a(!0);return}if(u){s(u);return}o=setTimeout(l,tZ)};return l(),i=setTimeout(()=>{n||r||(o&&clearTimeout(o),a(!0))},eZ),()=>{n=!0,r?.disconnect(),o&&clearTimeout(o),i&&clearTimeout(i)}},[e]),t}var Mt=j(me(),1),nZ=2e3,rZ=90,oZ=1e3,VB=(0,je.forwardRef)(function(t,a){return(0,Mt.jsx)(es,{locale:t.config.locale,children:(0,Mt.jsx)(iZ,{...t,ref:a})})}),iZ=(0,je.forwardRef)(function({config:t,programmatic:a,scriptConfig:n},r){let{t:o}=Ue(),{config:i,ready:s}=yu(t,a,n),l=hu(i.visibility,s),u=Jd(),c=l?DB(i.visibility,u):null,d=jB(c),p=(0,je.useRef)(null),m=(0,je.useMemo)(()=>su({mode:"floating",getSessionId:()=>p.current?.sessionId}),[]),h=i.onEvent;(0,je.useEffect)(()=>{if(h)return m.subscribe(h)},[h,m]);let v=(0,je.useRef)(null),I=(0,je.useRef)(null),y=(0,je.useRef)(!1),[w,g]=(0,je.useState)("input"),[S,E]=(0,je.useState)(""),[T,R]=(0,je.useState)(!1),[O,U]=(0,je.useState)(!1),[A,Q]=(0,je.useState)(0),$=i.appearance?.theme,H=i.appearance?.variables,Z=(0,je.useMemo)(()=>H?pu(H):{},[H]),X=gu(i),B=(0,je.useMemo)(()=>Ss({flow:null,followup:null,...X}),[X]),P=(0,je.useMemo)(()=>B?.suggestions.map(ie=>ie.text)??[],[B]);Fl({widgetEvents:m,api:i.api,token:i.token,channelId:i.channelId,source:i.source,mode:"floating",pagePrompts:X.page,getSessionId:()=>p.current?.sessionId});let J=(0,je.useRef)(null);(0,je.useEffect)(()=>{!O||!B||J.current!==B&&(J.current=B,m.emit({name:"suggestions.shown",properties:{texts:P,origin:B.origin}}))},[O,B,P,m]);let ge=i.launcherText??i.placeholder??o.launcher.prompt,C=Hl(ge,S.length===0),ze="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,je.useEffect)(()=>{if(!l){R(!1);return}if(c){R(d);return}let ie=i.appearDelay??nZ,xe=setTimeout(()=>R(!0),Math.max(0,ie));return()=>clearTimeout(xe)},[l,i.appearDelay,c,d]),(0,je.useEffect)(()=>{if(!T||P.length===0)return;let ie=setTimeout(()=>{y.current||g(xe=>xe==="input"?"expanded":xe)},oZ);return()=>clearTimeout(ie)},[T,P.length]),(0,je.useEffect)(()=>{A>0&&w==="open"&&p.current?.focus()},[A,w]);let ot=(0,je.useRef)(!1);(0,je.useEffect)(()=>{s&&!ot.current&&(ot.current=!0,m.emit({name:"chat.ready"}))},[s,m]),ru({api:i.api,token:i.token,channelId:i.channelId,mode:"floating",paintMark:"launcherPainted",painted:s&&l});let x=(0,je.useRef)(!1);(0,je.useEffect)(()=>{let ie=l&&w==="open";ie!==x.current&&(x.current=ie,m.emit({name:ie?"chat.opened":"chat.closed"}))},[l,w,m]);let te=(0,je.useCallback)(()=>{g("open")},[]),re=(0,je.useCallback)(()=>{y.current=!0,g("input")},[]);(0,je.useEffect)(()=>{if(w!=="expanded"){U(!1);return}let ie=setTimeout(()=>U(!0),rZ);return()=>clearTimeout(ie)},[w]);let ke=(0,je.useCallback)(ie=>{te();let xe=ie.trim();xe&&p.current?.sendMessage(xe)},[te]);(0,je.useImperativeHandle)(r,()=>({open:()=>te(),close:()=>re(),toggle:()=>{g(ie=>ie==="open"?"input":"open")},sendMessage:ie=>ke(ie),sendMessageAndWait:async ie=>{te();let xe=p.current;if(xe)return await xe.sendMessageAndWait(ie)},reset:()=>p.current?.reset(),focus:()=>{te(),Q(ie=>ie+1)},getMessages:()=>p.current?.messages??[],getSessionId:()=>p.current?.sessionId}),[ke,te,re]);let We=(0,je.useCallback)(()=>{S.trim()&&(ke(S),E(""))},[S,ke]),be=(0,je.useCallback)(()=>{(p.current?.messages.length??0)>0?(g("open"),Q(ie=>ie+1)):(y.current=!1,g(ie=>ie==="input"?"expanded":ie))},[]),Oe={mode:"floating"},we=zl(i.sessionApi);i.mcpServerUrl&&(Oe.mcpServerUrl=i.mcpServerUrl),i.channelId&&(Oe.channelId=i.channelId);let ce=P.length>0&&w!=="input",Le=(0,Mt.jsx)("button",{type:"button",onClick:re,"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)(wn,{className:"ww:size-4"})});return(0,Mt.jsx)(lu,{value:m,children:(0,Mt.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":$==="auto"?"auto":void 0,className:V("ww:contents ww:font-[family-name:var(--ww-font-sans)]",$==="dark"&&"dark"),style:Z,children:l&&(0,Mt.jsxs)(Mt.Fragment,{children:[(0,Mt.jsx)("div",{ref:I,"data-waniwani-floating":"dock","data-state":w==="open"?"hidden":"shown","data-appeared":T?"true":"false",className:V("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",ce?"ww:max-w-[720px]":"ww:max-w-[440px]"),children:(0,Mt.jsxs)("div",{className:V("ww:relative ww:flex ww:flex-col ww:rounded-[20px] ww:border ww:transition-all ww:duration-300 ww:ease-out",ce?"ww:p-2 ww:backdrop-blur-xl ww:backdrop-saturate-150":"ww:border-transparent ww:p-0"),style:ce?{boxShadow:ze,backgroundColor:"var(--ww-glass)",borderColor:"var(--ww-glass-border)"}:void 0,children:[ce&&w!=="open"&&(0,Mt.jsx)("button",{type:"button",onClick:re,"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)(wn,{className:"ww:size-4"})}),P.length>0&&(0,Mt.jsx)("div",{className:V("ww:grid ww:transition-all ww:duration-300 ww:ease-out",O?"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)(Sl,{suggestions:P,onSelect:ie=>{m.emit({name:"suggestion.clicked",properties:{text:ie,index:P.indexOf(ie),origin:B?.origin??"channel"}}),ke(ie)},className:"ww:pl-1 ww:pr-9 ww:pt-1 ww:pb-2.5"})})}),(0,Mt.jsx)(Yp,{animated:T,backgroundColor:"var(--ww-color-input)",borderRadius:16,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],className:"ww:border-border",style:{boxShadow:ze},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:v,type:"text",value:S,placeholder:C,onChange:ie=>E(ie.target.value),onFocus:be,onKeyDown:ie=>{ie.key==="Enter"&&!ie.shiftKey&&(ie.preventDefault(),We())},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:We,disabled:!S.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)(pr,{className:"ww:size-4"})})]})})]})}),(0,Mt.jsx)("div",{role:"dialog","aria-label":i.title??ge,"data-waniwani-floating":"panel","data-state":w==="open"?"shown":"hidden",style:{boxShadow:ze},className:V("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)(mu,{transport:we,ref:p,api:i.api??"",headers:{Authorization:`Bearer ${i.token}`},skipRemoteConfig:!0,body:Oe,appearance:i.appearance,title:i.title,headerActions:Le,hideHeader:!1,onScreen:w==="open",welcomeMessage:i.welcomeMessage,placeholder:i.placeholder,suggestions:X,enableThreadHistory:i.enableThreadHistory,documentUpload:i.documentUpload,showToolCalls:i.showToolCalls,locale:i.locale,initializing:!s})})]})})})});var rn=j(Ee(),1);var d0=j(me(),1),$B=(0,rn.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,onReady:r,onVisibilityChange:o},i){let{config:s,ready:l}=yu(t,a,n),u=(0,rn.useRef)(null),c=(0,rn.useMemo)(()=>su({mode:"inline",getSessionId:()=>u.current?.sessionId}),[]),d=s.onEvent;(0,rn.useEffect)(()=>{if(d)return c.subscribe(d)},[d,c]);let p=(0,rn.useRef)(!1);(0,rn.useEffect)(()=>{l&&!p.current&&(p.current=!0,c.emit({name:"chat.ready"}))},[l,c]),(0,rn.useEffect)(()=>{r?.()},[]);let m=hu(s.visibility,l);(0,rn.useEffect)(()=>{o?.(m)},[m,o]),ru({api:s.api,token:s.token,channelId:s.channelId,mode:"inline",paintMark:"chatVisible",painted:l}),(0,rn.useImperativeHandle)(i,()=>({get chat(){return u.current}}),[]);let h=gu(s);Fl({widgetEvents:c,api:s.api,token:s.token,channelId:s.channelId,source:s.source,mode:"inline",pagePrompts:h.page,getSessionId:()=>u.current?.sessionId});let v={mode:"inline"},I=zl(s.sessionApi);return s.mcpServerUrl&&(v.mcpServerUrl=s.mcpServerUrl),s.channelId&&(v.channelId=s.channelId),(0,d0.jsx)(lu,{value:c,children:(0,d0.jsx)(mu,{transport:I,ref:u,api:s.api??"",headers:{Authorization:`Bearer ${s.token}`},skipRemoteConfig:!0,body:v,appearance:s.appearance,title:s.title,hideHeader:s.hideHeader,welcomeMessage:s.welcomeMessage,placeholder:s.placeholder,suggestions:h,enableThreadHistory:s.enableThreadHistory,documentUpload:s.documentUpload,showToolCalls:s.showToolCalls,locale:s.locale,initializing:!l})})});var ef=j(Ee(),1),JB=j(qw(),1);function WB(){if(typeof document>"u"&&typeof navigator>"u")return null;let e=(typeof document<"u"?document.modelContext:void 0)??(typeof navigator<"u"?navigator.modelContext:void 0);return e&&typeof e.registerTool=="function"?e:null}function f0(){return WB()!==null}function sZ(){return{url:location.href,title:document.title}}async function p0(e){let{endpoint:t,listEndpoint:a,headers:n,sessionId:r,visitorId:o,channelId:i,onWidget:s}=e,l=e.logger??console,u=WB();if(!u)return null;let c=new AbortController,d=()=>c.abort();window.addEventListener("pagehide",d);let p=!1,m=()=>{p||(p=!0,window.removeEventListener("pagehide",d),c.abort())};function h(){return{sessionId:r,visitorId:o,channelId:i,page:sZ()}}async function v(g,S){let E=await fetch(t,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify(g),...S?{signal:S}:{}});if(!E.ok)throw new Error(`webmcp ${g.action} failed: ${E.status}`);return await E.json()}async function I(){if(a)try{let g=await fetch(a);if(g.ok)return await g.json();l.info(`[webmcp] list GET answered ${g.status}, using POST`)}catch(g){l.info("[webmcp] list GET failed, using POST",g)}return v({...h(),action:"list"})}let y=[];try{let g=await I();y=Array.isArray(g?.tools)?g.tools:[]}catch(g){return l.error("[webmcp] could not list site tools",g),m(),null}let w=[];return await Promise.all(y.map(async g=>{try{await u.registerTool({name:g.name,description:g.description??"",...g.inputSchema?{inputSchema:g.inputSchema}:{},...g.annotations?{annotations:g.annotations}:{},execute:async(S,E)=>{let T=await v({...h(),action:"call",name:g.name,arguments:S??{}},E?.signal);return T?.widget&&s?.(T.widget),{content:T?.content??[]}}},{signal:c.signal}),w.push(g)}catch(S){l.error(`[webmcp] could not register ${g.name}`,S)}})),l.info(`[webmcp] registered ${w.length} site tool(s)`),{get tools(){return w},callTool:({name:g,arguments:S})=>v({...h(),action:"call",name:g,arguments:S??{}}),dispose:m}}function GB(e,t,a){if(e.webmcp?.enabled===!1||t===!1)return null;let n=e.api??"";if(!e.token)return null;let r=e.mcpServerUrl?{mcpServerUrl:e.mcpServerUrl}:void 0,o=e.channelId??a;return{toolsEndpoint:Na(n,"/webmcp",r),listEndpoint:Na(n,"/webmcp/tools",{token:e.token,...o&&{channel:o},...r}),...o&&{channelId:o},headers:{Authorization:`Bearer ${e.token}`},resourceEndpoint:Na(n,"/resource",{token:e.token,...r})}}var di=j(Ee(),1);var wu=j(me(),1),XB=672,KB=32;function YB({widget:e,onCallTool:t,toolsEndpoint:a,headers:n,resourceEndpoint:r,onClose:o,isDark:i=!1}){let[s,l]=(0,di.useState)(null);(0,di.useEffect)(()=>{let m=()=>l({width:window.innerWidth,height:window.innerHeight});return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);let u=e?.preview===!0;(0,di.useEffect)(()=>{if(!e||!u)return;let m=h=>{h.key==="Escape"&&o()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[e,u,o]),(0,di.useEffect)(()=>{if(!e)return;let m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}},[e]);let c=(0,di.useCallback)(async m=>{if(t)return t(m);if(!a)throw new Error("webmcp overlay needs onCallTool");let h=await fetch(a,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify({action:"call",...m})});if(!h.ok)throw new Error(`webmcp tool call failed: ${h.status}`);return await h.json()},[t,a,n]);if(!e)return null;let d=s?Math.min(XB,s.width-KB):XB,p=s?s.height-KB:void 0;return(0,wu.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Waniwani",className:V("ww:fixed ww:inset-0 ww:z-[2147483000] ww:flex ww:items-center ww:justify-center ww:bg-black/45 ww:backdrop-blur-md",i&&"dark"),children:[u&&(0,wu.jsx)("button",{type:"button","aria-label":"Close",onClick:o,className:"ww:absolute ww:inset-0 ww:h-full ww:w-full ww:cursor-pointer ww:border-none ww:bg-transparent ww:p-0"}),(0,wu.jsx)("div",{className:"ww:relative ww:overflow-auto ww:rounded-2xl ww:bg-background ww:shadow-2xl",style:{width:d,maxHeight:p},children:(0,wu.jsx)(Mh,{resourceUri:e.viewUri,resourceEndpoint:r,toolInput:e.data,toolResult:e.result,autoHeight:qd(e.result._meta),isDark:i,onCallTool:c,onOpenLink:m=>window.open(m,"_blank","noopener")},`${r}|${e.viewUri}`)})]})}var m0=j(me(),1),ZB="waniwani:webmcp:session";function lZ(){try{let e=sessionStorage.getItem(ZB);if(e)return e;let t=crypto.randomUUID();return sessionStorage.setItem(ZB,t),t}catch{return`s-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}}function uZ(e){let t=e.token?ci(e.api??"",e.token,e.channelId):null,a=GB(e,t?.webmcp?.enabled,t?.channelId);return a||Ua("[webmcp] not publishing site tools: switched off, or no token"),a}function cZ(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}}function dZ(){let e=null,t=null;return{emit(a){e?e(a):t=a},subscribe(a){return e=a,t&&(a(t),t=null),()=>{e===a&&(e=null)}}}}function fZ({resourceEndpoint:e,subscribe:t,callTool:a}){let[n,r]=ef.default.useState(null),[o,i]=ef.default.useState(cZ);return ef.default.useEffect(()=>t(r),[t]),ef.default.useEffect(()=>{let s;try{s=window.matchMedia("(prefers-color-scheme: dark)")}catch{return}let l=()=>i(s.matches);return s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[]),(0,m0.jsx)(YB,{widget:n,onCallTool:a,resourceEndpoint:e,isDark:o,onClose:()=>r(null)})}function QB(e){if(!f0())return null;let t=uZ(e);if(!t)return null;let a=document.createElement("div");a.setAttribute("data-waniwani-webmcp",""),a.style.cssText="position:relative;z-index:2147483001;",document.body.appendChild(a);let n=a.attachShadow({mode:"open"});Gh(n);let r=document.createElement("div");n.appendChild(r);let o=dZ(),i=null,s=!1;p0({endpoint:t.toolsEndpoint,listEndpoint:t.listEndpoint,headers:t.headers,channelId:t.channelId,sessionId:lZ(),visitorId:ma(),onWidget:o.emit}).then(c=>{if(s){c?.dispose();return}i=c}).catch(c=>{console.error("[webmcp] could not publish site tools",c)});let l=async c=>{if(!i)throw new Error("webmcp bridge is not registered");let d=await i.callTool(c);return d.widget?.interactive&&o.emit(d.widget),d},u=JB.default.createRoot(r);return u.render((0,m0.jsx)(fZ,{resourceEndpoint:t.resourceEndpoint,subscribe:o.subscribe,callTool:l})),{getTools:()=>(i?.tools??[]).map(c=>c.name),destroy:()=>{s=!0,i?.dispose(),u.unmount(),a.remove()}}}var Pt=null,jn=null,Xt=null,Is=null,Kh=null,pZ="waniwani-chat-sizing",mZ="waniwani-chat-defaults",hZ="waniwani-chat-chrome",gZ="waniwani-chat-auto-card",yZ=`:where([data-waniwani-embed]){height:${AB}}`,wZ=":where([data-waniwani-embed]){border-radius:16px;overflow:hidden}",vZ=":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)}",xZ=":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))}",bZ="waniwani-chat-composer-auto",SZ=":where([data-waniwani-embed][data-waniwani-auto]){width:100%;max-width:40rem;margin-inline:auto}";function tf(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 a3(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 Yh(e,t){Gh(e);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 e3="data-waniwani-embed",af="data-waniwani-auto";function n3(e){let t=document.querySelector(`[${e3}]`);if(t)return t;let a=document.createElement("div");a.setAttribute(e3,""),a.setAttribute(af,"");let n=e?!!document.head?.contains(e):!1;return e?.parentNode&&!n?e.parentNode.insertBefore(a,e):document.body.appendChild(a),a}function IZ(e){return/^\d+$/.test(e.trim())?`${e.trim()}px`:e.trim()}function CZ(e,t,a,n){let r=n3(n);tf(pZ,yZ),e.height&&r instanceof HTMLElement&&(r.style.height=IZ(e.height)),e.appearance?.theme&&tf(mZ,wZ),tf(hZ,vZ),r.hasAttribute(af)&&tf(gZ,xZ),a3(r,e),Xt=document.createElement("div"),Xt.id="waniwani-chat-embed",Xt.style.cssText="width:100%;height:100%;max-height:inherit;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;",r.appendChild(Xt);let o=Xt,i=()=>{let d=getComputedStyle(r);if(!d.maxHeight.endsWith("px")){o.style.removeProperty("max-height");return}let p=Number.parseFloat(d.maxHeight);if(!Number.isFinite(p)){o.style.removeProperty("max-height");return}let m=p;d.boxSizing==="border-box"&&(m-=(Number.parseFloat(d.paddingTop)||0)+(Number.parseFloat(d.paddingBottom)||0)+(Number.parseFloat(d.borderTopWidth)||0)+(Number.parseFloat(d.borderBottomWidth)||0)),m>0?o.style.maxHeight=`${m}px`:o.style.removeProperty("max-height")};i(),Kh=new ResizeObserver(i),Kh.observe(r);let s=Xt.attachShadow({mode:"open"});Yh(s,e);let l=document.createElement("div");l.className="ww:contents",s.appendChild(l);let u=Cs.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=ci(e.api??"",e.token,e.channelId);d?.visibility&&!Zd(d.visibility,window.location.pathname)&&c(!1)}return jn=Zh.default.createRoot(l),jn.render(Cs.default.createElement($B,{ref:u,config:e,programmatic:t,scriptConfig:a,onVisibilityChange:c})),{destroy:()=>{Kh?.disconnect(),Kh=null,jn?.unmount(),jn=null,Xt?.remove(),Xt=null,r.hasAttribute(af)&&r.remove(),Pt=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:d=>u.current?.chat?.sendMessage(d),sendMessageAndWait:async d=>{let p=u.current?.chat;if(p)return await p.sendMessageAndWait(d)},reset:()=>u.current?.chat?.reset(),focus:()=>u.current?.chat?.focus(),getMessages:()=>u.current?.chat?.messages??[],getSessionId:()=>u.current?.chat?.sessionId}}function kZ(e,t,a){Xt=document.createElement("div"),Xt.id="waniwani-chat-embed",Xt.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(Xt);let n=Xt.attachShadow({mode:"open"});Yh(n,e);let r=document.createElement("div");r.className="ww:contents",n.appendChild(r);let o=Cs.default.createRef();return jn=Zh.default.createRoot(r),jn.render(Cs.default.createElement(VB,{ref:o,config:e,programmatic:t,scriptConfig:a})),{destroy:()=>{jn?.unmount(),jn=null,Xt?.remove(),Xt=null,Pt=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 TZ(){return{destroy:()=>{Pt=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:()=>{},sendMessageAndWait:async()=>{},reset:()=>{},focus:()=>{},getMessages:()=>[],getSessionId:()=>{}}}function LZ(e,t,a,n){let r=n3(n);r.hasAttribute(af)&&tf(bZ,SZ),a3(r,e),Xt=document.createElement("div"),Xt.id="waniwani-chat-embed",Xt.style.cssText="display:block;width:100%;",r.appendChild(Xt);let o=Xt.attachShadow({mode:"open"});Yh(o,e);let i=document.createElement("div");i.className="ww:contents",o.appendChild(i),Is=document.createElement("div"),Is.id="waniwani-chat-panel",Is.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(Is);let s=Is.attachShadow({mode:"open"});Yh(s,e);let l=document.createElement("div");l.className="ww:contents",s.appendChild(l);let u=Cs.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=ci(e.api??"",e.token,e.channelId);d?.visibility&&!Zd(d.visibility,window.location.pathname)&&c(!1)}return jn=Zh.default.createRoot(i),jn.render(Cs.default.createElement(HB,{ref:u,config:e,programmatic:t,scriptConfig:a,panelContainer:l,onVisibilityChange:c})),{destroy:()=>{jn?.unmount(),jn=null,Xt?.remove(),Xt=null,Is?.remove(),Is=null,r.hasAttribute(af)&&r.remove(),Pt=null},open:()=>u.current?.open(),close:()=>u.current?.close(),toggle:()=>u.current?.toggle(),sendMessage:d=>u.current?.sendMessage(d),sendMessageAndWait:async d=>{if(u.current)return u.current.sendMessageAndWait(d)},reset:()=>u.current?.reset(),focus:()=>u.current?.focus(),getMessages:()=>u.current?.getMessages()??[],getSessionId:()=>u.current?.getSessionId()}}function r3(e){if(Pt)return console.warn("[Waniwani] Chat widget is already initialized. Call destroy() first to re-initialize."),Pt;let t=s0(),a=$h(),n=Yd(e,void 0,a);Sc(n.visitorId);let r=null;try{r=QB(n)}catch(l){console.error("[Waniwani] WebMCP setup failed",l)}let o;n.mode==="off"?o=TZ():n.mode==="floating"?o=kZ(n,e,a):n.mode==="composer"?o=LZ(n,e,a,t):o=CZ(n,e,a,t);let i=n.api??"",s=n.token?R1({api:i,token:n.token,channelId:()=>n.channelId??ci(i,n.token,n.channelId)?.channelId,getSource:()=>ci(i,n.token,n.channelId)?.source??void 0,getSessionId:()=>o.getSessionId()}):Wp("no public token configured (set data-token or pass token to init())");return Pt={...o,track:s.track,identify:(l,u)=>s.identify(l,u),setVisitorId:l=>wl(l),getVisitorId:()=>ma(),destroy:()=>{s.shutdown(),r?.destroy(),o.destroy()}},Pt}function EZ(){Pt&&Pt.destroy()}var o3=Wp("chat widget is not initialized (call WaniWani.chat.init() first)"),vu=()=>Pt?Pt.track:o3.track;window.WaniWani=window.WaniWani||{};window.WaniWani.chat={init:r3,destroy:EZ,open:()=>Pt?.open(),close:()=>Pt?.close(),toggle:()=>Pt?.toggle(),sendMessage:e=>Pt?.sendMessage(e),sendMessageAndWait:async e=>{if(Pt)return Pt.sendMessageAndWait(e)},reset:()=>Pt?.reset(),focus:()=>Pt?.focus(),getMessages:()=>Pt?.getMessages()??[],getSessionId:()=>Pt?.getSessionId(),track:Object.assign(e=>vu()(e),{priceShown:e=>vu().priceShown(e),pricesCompared:e=>vu().pricesCompared(e),optionSelected:e=>vu().optionSelected(e),leadQualified:e=>vu().leadQualified(e),converted:e=>vu().converted(e)}),identify:(e,t)=>Pt?Pt.identify(e,t):o3.identify(e,t),setVisitorId:e=>wl(e),getVisitorId:()=>ma()};function t3(){if($h().token)try{r3()}catch(t){console.error("[Waniwani] Auto-initialization failed:",t)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t3):t3();})();
|
|
146
146
|
/*! Bundled license information:
|
|
147
147
|
|
|
148
148
|
react/cjs/react.production.js:
|