@waniwani/sdk 0.22.0-beta.4 → 0.22.0-beta.6
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 +101 -94
- package/dist/chat/embed.js.map +1 -1
- package/dist/chat/index.d.ts +25 -3
- 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,103 +1,103 @@
|
|
|
1
|
-
"use strict";var WaniWaniChatEmbed=(()=>{var zO=Object.create;var fc=Object.defineProperty;var qO=Object.getOwnPropertyDescriptor;var HO=Object.getOwnPropertyNames;var jO=Object.getPrototypeOf,VO=Object.prototype.hasOwnProperty;var WO=(e,t,a)=>t in e?fc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var k=(e,t)=>()=>(e&&(t=e(e=0)),t);var oa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),pc=(e,t)=>{for(var a in t)fc(e,a,{get:t[a],enumerable:!0})},GO=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of HO(t))!VO.call(e,r)&&r!==a&&fc(e,r,{get:()=>t[r],enumerable:!(n=qO(t,r))||n.enumerable});return e};var z=(e,t,a)=>(a=e!=null?zO(jO(e)):{},GO(t||!e||!e.__esModule?fc(a,"default",{value:e,enumerable:!0}):a,e));var re=(e,t,a)=>WO(e,typeof t!="symbol"?t+"":t,a);var Nv=oa(ve=>{"use strict";var Qp=Symbol.for("react.transitional.element"),$O=Symbol.for("react.portal"),XO=Symbol.for("react.fragment"),KO=Symbol.for("react.strict_mode"),YO=Symbol.for("react.profiler"),ZO=Symbol.for("react.consumer"),QO=Symbol.for("react.context"),JO=Symbol.for("react.forward_ref"),eP=Symbol.for("react.suspense"),tP=Symbol.for("react.memo"),Av=Symbol.for("react.lazy"),aP=Symbol.for("react.activity"),Tv=Symbol.iterator;function nP(e){return e===null||typeof e!="object"?null:(e=Tv&&e[Tv]||e["@@iterator"],typeof e=="function"?e:null)}var Rv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dv=Object.assign,_v={};function hi(e,t,a){this.props=e,this.context=t,this.refs=_v,this.updater=a||Rv}hi.prototype.isReactComponent={};hi.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")};hi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ov(){}Ov.prototype=hi.prototype;function Jp(e,t,a){this.props=e,this.context=t,this.refs=_v,this.updater=a||Rv}var em=Jp.prototype=new Ov;em.constructor=Jp;Dv(em,hi.prototype);em.isPureReactComponent=!0;var Lv=Array.isArray;function Zp(){}var dt={H:null,A:null,T:null,S:null},Pv=Object.prototype.hasOwnProperty;function tm(e,t,a){var n=a.ref;return{$$typeof:Qp,type:e,key:t,ref:n!==void 0?n:null,props:a}}function rP(e,t){return tm(e.type,t,e.props)}function am(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qp}function oP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Ev=/\/+/g;function Yp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?oP(""+e.key):t.toString(36)}function iP(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Zp,Zp):(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 mi(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 Qp:case $O:i=!0;break;case Av:return i=e._init,mi(i(e._payload),t,a,n,r)}}if(i)return r=r(e),i=n===""?"."+Yp(e,0):n,Lv(r)?(a="",i!=null&&(a=i.replace(Ev,"$&/")+"/"),mi(r,t,a,"",function(u){return u})):r!=null&&(am(r)&&(r=rP(r,a+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Ev,"$&/")+"/")+i)),t.push(r)),1;i=0;var l=n===""?".":n+":";if(Lv(e))for(var s=0;s<e.length;s++)n=e[s],o=l+Yp(n,s),i+=mi(n,t,a,o,r);else if(s=nP(e),typeof s=="function")for(e=s.call(e),s=0;!(n=e.next()).done;)n=n.value,o=l+Yp(n,s++),i+=mi(n,t,a,o,r);else if(o==="object"){if(typeof e.then=="function")return mi(iP(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 mc(e,t,a){if(e==null)return e;var n=[],r=0;return mi(e,n,"","",function(o){return t.call(a,o,r++)}),n}function lP(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 Mv=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)},sP={map:mc,forEach:function(e,t,a){mc(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return mc(e,function(){t++}),t},toArray:function(e){return mc(e,function(t){return t})||[]},only:function(e){if(!am(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ve.Activity=aP;ve.Children=sP;ve.Component=hi;ve.Fragment=XO;ve.Profiler=YO;ve.PureComponent=Jp;ve.StrictMode=KO;ve.Suspense=eP;ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=dt;ve.__COMPILER_RUNTIME={__proto__:null,c:function(e){return dt.H.useMemoCache(e)}};ve.cache=function(e){return function(){return e.apply(null,arguments)}};ve.cacheSignal=function(){return null};ve.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=Dv({},e.props),r=e.key;if(t!=null)for(o in t.key!==void 0&&(r=""+t.key),t)!Pv.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(n[o]=t[o]);var o=arguments.length-2;if(o===1)n.children=a;else if(1<o){for(var i=Array(o),l=0;l<o;l++)i[l]=arguments[l+2];n.children=i}return tm(e.type,r,n)};ve.createContext=function(e){return e={$$typeof:QO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:ZO,_context:e},e};ve.createElement=function(e,t,a){var n,r={},o=null;if(t!=null)for(n in t.key!==void 0&&(o=""+t.key),t)Pv.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(r[n]=t[n]);var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){for(var l=Array(i),s=0;s<i;s++)l[s]=arguments[s+2];r.children=l}if(e&&e.defaultProps)for(n in i=e.defaultProps,i)r[n]===void 0&&(r[n]=i[n]);return tm(e,o,r)};ve.createRef=function(){return{current:null}};ve.forwardRef=function(e){return{$$typeof:JO,render:e}};ve.isValidElement=am;ve.lazy=function(e){return{$$typeof:Av,_payload:{_status:-1,_result:e},_init:lP}};ve.memo=function(e,t){return{$$typeof:tP,type:e,compare:t===void 0?null:t}};ve.startTransition=function(e){var t=dt.T,a={};dt.T=a;try{var n=e(),r=dt.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(Zp,Mv)}catch(o){Mv(o)}finally{t!==null&&a.types!==null&&(t.types=a.types),dt.T=t}};ve.unstable_useCacheRefresh=function(){return dt.H.useCacheRefresh()};ve.use=function(e){return dt.H.use(e)};ve.useActionState=function(e,t,a){return dt.H.useActionState(e,t,a)};ve.useCallback=function(e,t){return dt.H.useCallback(e,t)};ve.useContext=function(e){return dt.H.useContext(e)};ve.useDebugValue=function(){};ve.useDeferredValue=function(e,t){return dt.H.useDeferredValue(e,t)};ve.useEffect=function(e,t){return dt.H.useEffect(e,t)};ve.useEffectEvent=function(e){return dt.H.useEffectEvent(e)};ve.useId=function(){return dt.H.useId()};ve.useImperativeHandle=function(e,t,a){return dt.H.useImperativeHandle(e,t,a)};ve.useInsertionEffect=function(e,t){return dt.H.useInsertionEffect(e,t)};ve.useLayoutEffect=function(e,t){return dt.H.useLayoutEffect(e,t)};ve.useMemo=function(e,t){return dt.H.useMemo(e,t)};ve.useOptimistic=function(e,t){return dt.H.useOptimistic(e,t)};ve.useReducer=function(e,t,a){return dt.H.useReducer(e,t,a)};ve.useRef=function(e){return dt.H.useRef(e)};ve.useState=function(e){return dt.H.useState(e)};ve.useSyncExternalStore=function(e,t,a){return dt.H.useSyncExternalStore(e,t,a)};ve.useTransition=function(){return dt.H.useTransition()};ve.version="19.2.4"});var he=oa((Y7,Bv)=>{"use strict";Bv.exports=Nv()});var $v=oa(yt=>{"use strict";function im(e,t){var a=e.length;e.push(t);e:for(;0<a;){var n=a-1>>>1,r=e[n];if(0<hc(r,t))e[n]=t,e[a]=r,a=n;else break e}}function Mn(e){return e.length===0?null:e[0]}function wc(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var n=0,r=e.length,o=r>>>1;n<o;){var i=2*(n+1)-1,l=e[i],s=i+1,u=e[s];if(0>hc(l,a))s<r&&0>hc(u,l)?(e[n]=u,e[s]=a,n=s):(e[n]=l,e[i]=a,n=i);else if(s<r&&0>hc(u,a))e[n]=u,e[s]=a,n=s;else break e}}return t}function hc(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}yt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Uv=performance,yt.unstable_now=function(){return Uv.now()}):(nm=Date,Fv=nm.now(),yt.unstable_now=function(){return nm.now()-Fv});var Uv,nm,Fv,Wn=[],Cr=[],uP=1,Ya=null,ia=3,lm=!1,$l=!1,Xl=!1,sm=!1,Hv=typeof setTimeout=="function"?setTimeout:null,jv=typeof clearTimeout=="function"?clearTimeout:null,zv=typeof setImmediate<"u"?setImmediate:null;function gc(e){for(var t=Mn(Cr);t!==null;){if(t.callback===null)wc(Cr);else if(t.startTime<=e)wc(Cr),t.sortIndex=t.expirationTime,im(Wn,t);else break;t=Mn(Cr)}}function um(e){if(Xl=!1,gc(e),!$l)if(Mn(Wn)!==null)$l=!0,wi||(wi=!0,gi());else{var t=Mn(Cr);t!==null&&cm(um,t.startTime-e)}}var wi=!1,Kl=-1,Vv=5,Wv=-1;function Gv(){return sm?!0:!(yt.unstable_now()-Wv<Vv)}function rm(){if(sm=!1,wi){var e=yt.unstable_now();Wv=e;var t=!0;try{e:{$l=!1,Xl&&(Xl=!1,jv(Kl),Kl=-1),lm=!0;var a=ia;try{t:{for(gc(e),Ya=Mn(Wn);Ya!==null&&!(Ya.expirationTime>e&&Gv());){var n=Ya.callback;if(typeof n=="function"){Ya.callback=null,ia=Ya.priorityLevel;var r=n(Ya.expirationTime<=e);if(e=yt.unstable_now(),typeof r=="function"){Ya.callback=r,gc(e),t=!0;break t}Ya===Mn(Wn)&&wc(Wn),gc(e)}else wc(Wn);Ya=Mn(Wn)}if(Ya!==null)t=!0;else{var o=Mn(Cr);o!==null&&cm(um,o.startTime-e),t=!1}}break e}finally{Ya=null,ia=a,lm=!1}t=void 0}}finally{t?gi():wi=!1}}}var gi;typeof zv=="function"?gi=function(){zv(rm)}:typeof MessageChannel<"u"?(om=new MessageChannel,qv=om.port2,om.port1.onmessage=rm,gi=function(){qv.postMessage(null)}):gi=function(){Hv(rm,0)};var om,qv;function cm(e,t){Kl=Hv(function(){e(yt.unstable_now())},t)}yt.unstable_IdlePriority=5;yt.unstable_ImmediatePriority=1;yt.unstable_LowPriority=4;yt.unstable_NormalPriority=3;yt.unstable_Profiling=null;yt.unstable_UserBlockingPriority=2;yt.unstable_cancelCallback=function(e){e.callback=null};yt.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"):Vv=0<e?Math.floor(1e3/e):5};yt.unstable_getCurrentPriorityLevel=function(){return ia};yt.unstable_next=function(e){switch(ia){case 1:case 2:case 3:var t=3;break;default:t=ia}var a=ia;ia=t;try{return e()}finally{ia=a}};yt.unstable_requestPaint=function(){sm=!0};yt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=ia;ia=e;try{return t()}finally{ia=a}};yt.unstable_scheduleCallback=function(e,t,a){var n=yt.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:uP++,callback:t,priorityLevel:e,startTime:a,expirationTime:r,sortIndex:-1},a>n?(e.sortIndex=a,im(Cr,e),Mn(Wn)===null&&e===Mn(Cr)&&(Xl?(jv(Kl),Kl=-1):Xl=!0,cm(um,a-n))):(e.sortIndex=r,im(Wn,e),$l||lm||($l=!0,wi||(wi=!0,gi()))),e};yt.unstable_shouldYield=Gv;yt.unstable_wrapCallback=function(e){var t=ia;return function(){var a=ia;ia=t;try{return e.apply(this,arguments)}finally{ia=a}}}});var Kv=oa((Q7,Xv)=>{"use strict";Xv.exports=$v()});var Zv=oa(fa=>{"use strict";var cP=he();function Yv(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 kr(){}var da={d:{f:kr,r:function(){throw Error(Yv(522))},D:kr,C:kr,L:kr,m:kr,X:kr,S:kr,M:kr},p:0,findDOMNode:null},dP=Symbol.for("react.portal");function fP(e,t,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:dP,key:n==null?null:""+n,children:e,containerInfo:t,implementation:a}}var Yl=cP.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function yc(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}fa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=da;fa.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(Yv(299));return fP(e,t,null,a)};fa.flushSync=function(e){var t=Yl.T,a=da.p;try{if(Yl.T=null,da.p=2,e)return e()}finally{Yl.T=t,da.p=a,da.d.f()}};fa.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))};fa.prefetchDNS=function(e){typeof e=="string"&&da.d.D(e)};fa.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,n=yc(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})}};fa.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=yc(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)};fa.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,n=yc(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})}};fa.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=yc(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)};fa.requestFormReset=function(e){da.d.r(e)};fa.unstable_batchedUpdates=function(e,t){return e(t)};fa.useFormState=function(e,t,a){return Yl.H.useFormState(e,t,a)};fa.useFormStatus=function(){return Yl.H.useHostTransitionStatus()};fa.version="19.2.4"});var dm=oa((eW,Jv)=>{"use strict";function Qv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qv)}catch(e){console.error(e)}}Qv(),Jv.exports=Zv()});var dC=oa(jd=>{"use strict";var Ht=Kv(),kS=he(),pP=dm();function B(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 TS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ns(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 LS(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 ES(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 eb(e){if(Ns(e)!==e)throw Error(B(188))}function mP(e){var t=e.alternate;if(!t){if(t=Ns(e),t===null)throw Error(B(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 eb(r),e;if(o===n)return eb(r),t;o=o.sibling}throw Error(B(188))}if(a.return!==n.return)a=r,n=o;else{for(var i=!1,l=r.child;l;){if(l===a){i=!0,a=r,n=o;break}if(l===n){i=!0,n=r,a=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===a){i=!0,a=o,n=r;break}if(l===n){i=!0,n=o,a=r;break}l=l.sibling}if(!i)throw Error(B(189))}}if(a.alternate!==n)throw Error(B(190))}if(a.tag!==3)throw Error(B(188));return a.stateNode.current===a?e:t}function MS(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=MS(e),t!==null)return t;e=e.sibling}return null}var mt=Object.assign,hP=Symbol.for("react.element"),xc=Symbol.for("react.transitional.element"),rs=Symbol.for("react.portal"),Ii=Symbol.for("react.fragment"),AS=Symbol.for("react.strict_mode"),Wm=Symbol.for("react.profiler"),RS=Symbol.for("react.consumer"),Jn=Symbol.for("react.context"),zh=Symbol.for("react.forward_ref"),Gm=Symbol.for("react.suspense"),$m=Symbol.for("react.suspense_list"),qh=Symbol.for("react.memo"),Tr=Symbol.for("react.lazy"),Xm=Symbol.for("react.activity"),gP=Symbol.for("react.memo_cache_sentinel"),tb=Symbol.iterator;function Zl(e){return e===null||typeof e!="object"?null:(e=tb&&e[tb]||e["@@iterator"],typeof e=="function"?e:null)}var wP=Symbol.for("react.client.reference");function Km(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===wP?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ii:return"Fragment";case Wm:return"Profiler";case AS:return"StrictMode";case Gm:return"Suspense";case $m:return"SuspenseList";case Xm:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case rs:return"Portal";case Jn:return e.displayName||"Context";case RS:return(e._context.displayName||"Context")+".Consumer";case zh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qh:return t=e.displayName||null,t!==null?t:Km(e.type)||"Memo";case Tr:t=e._payload,e=e._init;try{return Km(e(t))}catch{}}return null}var os=Array.isArray,fe=kS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ze=pP.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Io={pending:!1,data:null,method:null,action:null},Ym=[],Ci=-1;function On(e){return{current:e}}function Yt(e){0>Ci||(e.current=Ym[Ci],Ym[Ci]=null,Ci--)}function ct(e,t){Ci++,Ym[Ci]=e.current,e.current=t}var _n=On(null),Ss=On(null),Br=On(null),Qc=On(null);function Jc(e,t){switch(ct(Br,t),ct(Ss,e),ct(_n,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sS(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sS(t),e=Z0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Yt(_n),ct(_n,e)}function Hi(){Yt(_n),Yt(Ss),Yt(Br)}function Zm(e){e.memoizedState!==null&&ct(Qc,e);var t=_n.current,a=Z0(t,e.type);t!==a&&(ct(Ss,e),ct(_n,a))}function ed(e){Ss.current===e&&(Yt(_n),Yt(Ss)),Qc.current===e&&(Yt(Qc),_s._currentValue=Io)}var fm,ab;function xo(e){if(fm===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);fm=t&&t[1]||"",ab=-1<a.stack.indexOf(`
|
|
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(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
4
|
-
`),u=
|
|
5
|
-
`);for(r=n=0;n<
|
|
6
|
-
`+
|
|
3
|
+
`+hg+e+YI}var gg=!1;function yg(e,t){if(!e||gg)return"";gg=!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
|
+
`),u=s.split(`
|
|
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{gg=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?pi(a):""}function G3(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 yg(e.type,!1);case 11:return yg(e.type.render,!1);case 1:return yg(e.type,!0);case 31:return pi("Activity");default:return""}}function ZI(e){try{var t="",a=null;do t+=G3(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 Qm=Object.prototype.hasOwnProperty,Hh=Ht.unstable_scheduleCallback,hm=Ht.unstable_cancelCallback,xP=Ht.unstable_shouldYield,vP=Ht.unstable_requestPaint,Fa=Ht.unstable_now,bP=Ht.unstable_getCurrentPriorityLevel,DS=Ht.unstable_ImmediatePriority,_S=Ht.unstable_UserBlockingPriority,td=Ht.unstable_NormalPriority,SP=Ht.unstable_LowPriority,OS=Ht.unstable_IdlePriority,IP=Ht.log,CP=Ht.unstable_setDisableYieldValue,Bs=null,za=null;function Dr(e){if(typeof IP=="function"&&CP(e),za&&typeof za.setStrictMode=="function")try{za.setStrictMode(Bs,e)}catch{}}var qa=Math.clz32?Math.clz32:LP,kP=Math.log,TP=Math.LN2;function LP(e){return e>>>=0,e===0?32:31-(kP(e)/TP|0)|0}var vc=256,bc=262144,Sc=4194304;function vo(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 Ld(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var l=n&134217727;return l!==0?(n=l&~o,n!==0?r=vo(n):(i&=l,i!==0?r=vo(i):a||(a=l&~e,a!==0&&(r=vo(a))))):(l=n&~o,l!==0?r=vo(l):i!==0?r=vo(i):a||(a=n&~e,a!==0&&(r=vo(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 Us(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function EP(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 PS(){var e=Sc;return Sc<<=1,(Sc&62914560)===0&&(Sc=4194304),e}function gm(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Fs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function MP(e,t,a,n,r,o){var i=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,s=e.expirationTimes,u=e.hiddenUpdates;for(a=i&~a;0<a;){var c=31-qa(a),d=1<<c;l[c]=0,s[c]=-1;var f=u[c];if(f!==null)for(u[c]=null,c=0;c<f.length;c++){var p=f[c];p!==null&&(p.lane&=-536870913)}a&=~d}n!==0&&NS(e,n,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function NS(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-qa(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function BS(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-qa(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function US(e,t){var a=t&-t;return a=(a&42)!==0?1:jh(a),(a&(e.suspendedLanes|t))!==0?0:a}function jh(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 Vh(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function FS(){var e=Ze.p;return e!==0?e:(e=window.event,e===void 0?32:sC(e.type))}function rb(e,t){var a=Ze.p;try{return Ze.p=e,t()}finally{Ze.p=a}}var Yr=Math.random().toString(36).slice(2),ea="__reactFiber$"+Yr,Ma="__reactProps$"+Yr,Ji="__reactContainer$"+Yr,Jm="__reactEvents$"+Yr,AP="__reactListeners$"+Yr,RP="__reactHandles$"+Yr,ob="__reactResources$"+Yr,zs="__reactMarker$"+Yr;function Wh(e){delete e[ea],delete e[Ma],delete e[Jm],delete e[AP],delete e[RP]}function ki(e){var t=e[ea];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Ji]||a[ea]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=pS(e);e!==null;){if(a=e[ea])return a;e=pS(e)}return t}e=a,a=e.parentNode}return null}function el(e){if(e=e[ea]||e[Ji]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function is(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(B(33))}function Pi(e){var t=e[ob];return t||(t=e[ob]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Kt(e){e[zs]=!0}var zS=new Set,qS={};function _o(e,t){ji(e,t),ji(e+"Capture",t)}function ji(e,t){for(qS[e]=t,e=0;e<t.length;e++)zS.add(t[e])}var DP=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]*$"),ib={},lb={};function _P(e){return Qm.call(lb,e)?!0:Qm.call(ib,e)?!1:DP.test(e)?lb[e]=!0:(ib[e]=!0,!1)}function Bc(e,t,a){if(_P(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 Ic(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 Gn(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 Qa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function HS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OP(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 eh(e){if(!e._valueTracker){var t=HS(e)?"checked":"value";e._valueTracker=OP(e,t,""+e[t])}}function jS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=HS(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function ad(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 PP=/[\n"\\]/g;function tn(e){return e.replace(PP,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function th(e,t,a,n,r,o,i,l){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Qa(t)):e.value!==""+Qa(t)&&(e.value=""+Qa(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?ah(e,i,Qa(t)):a!=null?ah(e,i,Qa(a)):n!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Qa(l):e.removeAttribute("name")}function VS(e,t,a,n,r,o,i,l){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){eh(e);return}a=a!=null?""+Qa(a):"",t=t!=null?""+Qa(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=l?e.checked:!!n,e.defaultChecked=!!n,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),eh(e)}function ah(e,t,a){t==="number"&&ad(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Ni(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=""+Qa(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 WS(e,t,a){if(t!=null&&(t=""+Qa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Qa(a):""}function GS(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(B(92));if(os(n)){if(1<n.length)throw Error(B(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Qa(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),eh(e)}function Vi(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var NP=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 sb(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||NP.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function $S(e,t,a){if(t!=null&&typeof t!="object")throw Error(B(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&&sb(e,r,n)}else for(var o in t)t.hasOwnProperty(o)&&sb(e,o,t[o])}function Gh(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 BP=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"]]),UP=/^[\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 Uc(e){return UP.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function er(){}var nh=null;function $h(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ti=null,Bi=null;function ub(e){var t=el(e);if(t&&(e=t.stateNode)){var a=e[Ma]||null;e:switch(e=t.stateNode,t.type){case"input":if(th(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="'+tn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[Ma]||null;if(!r)throw Error(B(90));th(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&&jS(n)}break e;case"textarea":WS(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Ni(e,!!a.multiple,t,!1)}}}var wm=!1;function XS(e,t,a){if(wm)return e(t,a);wm=!0;try{var n=e(t);return n}finally{if(wm=!1,(Ti!==null||Bi!==null)&&(Fd(),Ti&&(t=Ti,e=Bi,Bi=Ti=null,ub(t),e)))for(t=0;t<e.length;t++)ub(e[t])}}function Is(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Ma]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(B(231,t,typeof a));return a}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rh=!1;if(or)try{yi={},Object.defineProperty(yi,"passive",{get:function(){rh=!0}}),window.addEventListener("test",yi,yi),window.removeEventListener("test",yi,yi)}catch{rh=!1}var yi,_r=null,Xh=null,Fc=null;function KS(){if(Fc)return Fc;var e,t=Xh,a=t.length,n,r="value"in _r?_r.value:_r.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 Fc=r.slice(e,1<n?1-n:void 0)}function zc(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 Cc(){return!0}function cb(){return!1}function Aa(e){function t(a,n,r,o,i){this._reactName=a,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Cc:cb,this.isPropagationStopped=cb,this}return mt(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=Cc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Cc)},persist:function(){},isPersistent:Cc}),t}var Oo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ed=Aa(Oo),qs=mt({},Oo,{view:0,detail:0}),FP=Aa(qs),ym,xm,Ql,Md=mt({},qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kh,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!==Ql&&(Ql&&e.type==="mousemove"?(ym=e.screenX-Ql.screenX,xm=e.screenY-Ql.screenY):xm=ym=0,Ql=e),ym)},movementY:function(e){return"movementY"in e?e.movementY:xm}}),db=Aa(Md),zP=mt({},Md,{dataTransfer:0}),qP=Aa(zP),HP=mt({},qs,{relatedTarget:0}),vm=Aa(HP),jP=mt({},Oo,{animationName:0,elapsedTime:0,pseudoElement:0}),VP=Aa(jP),WP=mt({},Oo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),GP=Aa(WP),$P=mt({},Oo,{data:0}),fb=Aa($P),XP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},KP={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"},YP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=YP[e])?!!t[e]:!1}function Kh(){return ZP}var QP=mt({},qs,{key:function(e){if(e.key){var t=XP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?KP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kh,charCode:function(e){return e.type==="keypress"?zc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),JP=Aa(QP),eN=mt({},Md,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pb=Aa(eN),tN=mt({},qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kh}),aN=Aa(tN),nN=mt({},Oo,{propertyName:0,elapsedTime:0,pseudoElement:0}),rN=Aa(nN),oN=mt({},Md,{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}),iN=Aa(oN),lN=mt({},Oo,{newState:0,oldState:0}),sN=Aa(lN),uN=[9,13,27,32],Yh=or&&"CompositionEvent"in window,us=null;or&&"documentMode"in document&&(us=document.documentMode);var cN=or&&"TextEvent"in window&&!us,YS=or&&(!Yh||us&&8<us&&11>=us),mb=" ",hb=!1;function ZS(e,t){switch(e){case"keyup":return uN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function QS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Li=!1;function dN(e,t){switch(e){case"compositionend":return QS(t);case"keypress":return t.which!==32?null:(hb=!0,mb);case"textInput":return e=t.data,e===mb&&hb?null:e;default:return null}}function fN(e,t){if(Li)return e==="compositionend"||!Yh&&ZS(e,t)?(e=KS(),Fc=Xh=_r=null,Li=!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 YS&&t.locale!=="ko"?null:t.data;default:return null}}var pN={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 gb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pN[e.type]:t==="textarea"}function JS(e,t,a,n){Ti?Bi?Bi.push(n):Bi=[n]:Ti=n,t=vd(t,"onChange"),0<t.length&&(a=new Ed("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var cs=null,Cs=null;function mN(e){X0(e,0)}function Ad(e){var t=is(e);if(jS(t))return e}function wb(e,t){if(e==="change")return t}var eI=!1;or&&(or?(Tc="oninput"in document,Tc||(bm=document.createElement("div"),bm.setAttribute("oninput","return;"),Tc=typeof bm.oninput=="function"),kc=Tc):kc=!1,eI=kc&&(!document.documentMode||9<document.documentMode));var kc,Tc,bm;function yb(){cs&&(cs.detachEvent("onpropertychange",tI),Cs=cs=null)}function tI(e){if(e.propertyName==="value"&&Ad(Cs)){var t=[];JS(t,Cs,e,$h(e)),XS(mN,t)}}function hN(e,t,a){e==="focusin"?(yb(),cs=t,Cs=a,cs.attachEvent("onpropertychange",tI)):e==="focusout"&&yb()}function gN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ad(Cs)}function wN(e,t){if(e==="click")return Ad(t)}function yN(e,t){if(e==="input"||e==="change")return Ad(t)}function xN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ja=typeof Object.is=="function"?Object.is:xN;function ks(e,t){if(ja(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(!Qm.call(t,r)||!ja(e[r],t[r]))return!1}return!0}function xb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vb(e,t){var a=xb(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=xb(a)}}function aI(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?aI(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nI(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ad(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=ad(e.document)}return t}function Zh(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 vN=or&&"documentMode"in document&&11>=document.documentMode,Ei=null,oh=null,ds=null,ih=!1;function bb(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ih||Ei==null||Ei!==ad(n)||(n=Ei,"selectionStart"in n&&Zh(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}),ds&&ks(ds,n)||(ds=n,n=vd(oh,"onSelect"),0<n.length&&(t=new Ed("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Ei)))}function yo(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Mi={animationend:yo("Animation","AnimationEnd"),animationiteration:yo("Animation","AnimationIteration"),animationstart:yo("Animation","AnimationStart"),transitionrun:yo("Transition","TransitionRun"),transitionstart:yo("Transition","TransitionStart"),transitioncancel:yo("Transition","TransitionCancel"),transitionend:yo("Transition","TransitionEnd")},Sm={},rI={};or&&(rI=document.createElement("div").style,"AnimationEvent"in window||(delete Mi.animationend.animation,delete Mi.animationiteration.animation,delete Mi.animationstart.animation),"TransitionEvent"in window||delete Mi.transitionend.transition);function Po(e){if(Sm[e])return Sm[e];if(!Mi[e])return e;var t=Mi[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in rI)return Sm[e]=t[a];return e}var oI=Po("animationend"),iI=Po("animationiteration"),lI=Po("animationstart"),bN=Po("transitionrun"),SN=Po("transitionstart"),IN=Po("transitioncancel"),sI=Po("transitionend"),uI=new Map,lh="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(" ");lh.push("scrollEnd");function vn(e,t){uI.set(e,t),_o(t,[e])}var nd=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)},Za=[],Ai=0,Qh=0;function Rd(){for(var e=Ai,t=Qh=Ai=0;t<e;){var a=Za[t];Za[t++]=null;var n=Za[t];Za[t++]=null;var r=Za[t];Za[t++]=null;var o=Za[t];if(Za[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&&cI(a,r,o)}}function Dd(e,t,a,n){Za[Ai++]=e,Za[Ai++]=t,Za[Ai++]=a,Za[Ai++]=n,Qh|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Jh(e,t,a,n){return Dd(e,t,a,n),rd(e)}function No(e,t){return Dd(e,null,null,t),rd(e)}function cI(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-qa(a),e=o.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),o):null}function rd(e){if(50<vs)throw vs=0,Eh=null,Error(B(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ri={};function CN(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 Ba(e,t,a,n){return new CN(e,t,a,n)}function eg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ar(e,t){var a=e.alternate;return a===null?(a=Ba(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 dI(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 qc(e,t,a,n,r,o){var i=0;if(n=e,typeof e=="function")eg(e)&&(i=1);else if(typeof e=="string")i=LB(e,a,_n.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Xm:return e=Ba(31,a,t,r),e.elementType=Xm,e.lanes=o,e;case Ii:return Co(a.children,r,o,t);case AS:i=8,r|=24;break;case Wm:return e=Ba(12,a,t,r|2),e.elementType=Wm,e.lanes=o,e;case Gm:return e=Ba(13,a,t,r),e.elementType=Gm,e.lanes=o,e;case $m:return e=Ba(19,a,t,r),e.elementType=$m,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Jn:i=10;break e;case RS:i=9;break e;case zh:i=11;break e;case qh:i=14;break e;case Tr:i=16,n=null;break e}i=29,a=Error(B(130,e===null?"null":typeof e,"")),n=null}return t=Ba(i,a,t,r),t.elementType=e,t.type=n,t.lanes=o,t}function Co(e,t,a,n){return e=Ba(7,e,n,t),e.lanes=a,e}function Im(e,t,a){return e=Ba(6,e,null,t),e.lanes=a,e}function fI(e){var t=Ba(18,null,null,0);return t.stateNode=e,t}function Cm(e,t,a){return t=Ba(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Sb=new WeakMap;function an(e,t){if(typeof e=="object"&&e!==null){var a=Sb.get(e);return a!==void 0?a:(t={value:e,source:t,stack:nb(t)},Sb.set(e,t),t)}return{value:e,source:t,stack:nb(t)}}var Di=[],_i=0,od=null,Ts=0,Ja=[],en=0,Gr=null,An=1,Rn="";function Zn(e,t){Di[_i++]=Ts,Di[_i++]=od,od=e,Ts=t}function pI(e,t,a){Ja[en++]=An,Ja[en++]=Rn,Ja[en++]=Gr,Gr=e;var n=An;e=Rn;var r=32-qa(n)-1;n&=~(1<<r),a+=1;var o=32-qa(t)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,An=1<<32-qa(t)+r|a<<r|n,Rn=o+e}else An=1<<o|a<<r|n,Rn=e}function tg(e){e.return!==null&&(Zn(e,1),pI(e,1,0))}function ag(e){for(;e===od;)od=Di[--_i],Di[_i]=null,Ts=Di[--_i],Di[_i]=null;for(;e===Gr;)Gr=Ja[--en],Ja[en]=null,Rn=Ja[--en],Ja[en]=null,An=Ja[--en],Ja[en]=null}function mI(e,t){Ja[en++]=An,Ja[en++]=Rn,Ja[en++]=Gr,An=t.id,Rn=t.overflow,Gr=e}var ta=null,pt=null,Ue=!1,Ur=null,nn=!1,sh=Error(B(519));function $r(e){var t=Error(B(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ls(an(t,e)),sh}function Ib(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[ea]=e,t[Ma]=n,a){case"dialog":Re("cancel",t),Re("close",t);break;case"iframe":case"object":case"embed":Re("load",t);break;case"video":case"audio":for(a=0;a<Rs.length;a++)Re(Rs[a],t);break;case"source":Re("error",t);break;case"img":case"image":case"link":Re("error",t),Re("load",t);break;case"details":Re("toggle",t);break;case"input":Re("invalid",t),VS(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Re("invalid",t);break;case"textarea":Re("invalid",t),GS(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||Y0(t.textContent,a)?(n.popover!=null&&(Re("beforetoggle",t),Re("toggle",t)),n.onScroll!=null&&Re("scroll",t),n.onScrollEnd!=null&&Re("scrollend",t),n.onClick!=null&&(t.onclick=er),t=!0):t=!1,t||$r(e,!0)}function Cb(e){for(ta=e.return;ta;)switch(ta.tag){case 5:case 31:case 13:nn=!1;return;case 27:case 3:nn=!0;return;default:ta=ta.return}}function xi(e){if(e!==ta)return!1;if(!Ue)return Cb(e),Ue=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||_h(e.type,e.memoizedProps)),a=!a),a&&pt&&$r(e),Cb(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));pt=fS(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));pt=fS(e)}else t===27?(t=pt,Zr(e.type)?(e=Bh,Bh=null,pt=e):pt=t):pt=ta?on(e.stateNode.nextSibling):null;return!0}function Eo(){pt=ta=null,Ue=!1}function km(){var e=Ur;return e!==null&&(La===null?La=e:La.push.apply(La,e),Ur=null),e}function Ls(e){Ur===null?Ur=[e]:Ur.push(e)}var uh=On(null),Bo=null,tr=null;function Er(e,t,a){ct(uh,t._currentValue),t._currentValue=a}function nr(e){e._currentValue=uh.current,Yt(uh)}function ch(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 dh(e,t,a,n){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var o=r.dependencies;if(o!==null){var i=r.child;o=o.firstContext;e:for(;o!==null;){var l=o;o=r;for(var s=0;s<t.length;s++)if(l.context===t[s]){o.lanes|=a,l=o.alternate,l!==null&&(l.lanes|=a),ch(o.return,a,e),n||(i=null);break e}o=l.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(B(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),ch(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 tl(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(B(387));if(i=i.memoizedProps,i!==null){var l=r.type;ja(r.pendingProps.value,i.value)||(e!==null?e.push(l):e=[l])}}else if(r===Qc.current){if(i=r.alternate,i===null)throw Error(B(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(_s):e=[_s])}r=r.return}e!==null&&dh(t,e,a,n),t.flags|=262144}function id(e){for(e=e.firstContext;e!==null;){if(!ja(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Mo(e){Bo=e,tr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function aa(e){return hI(Bo,e)}function Lc(e,t){return Bo===null&&Mo(e),hI(e,t)}function hI(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},tr===null){if(e===null)throw Error(B(308));tr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else tr=tr.next=t;return a}var kN=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()})}},TN=Ht.unstable_scheduleCallback,LN=Ht.unstable_NormalPriority,Ut={$$typeof:Jn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ng(){return{controller:new kN,data:new Map,refCount:0}}function Hs(e){e.refCount--,e.refCount===0&&TN(LN,function(){e.controller.abort()})}var fs=null,fh=0,Wi=0,Ui=null;function EN(e,t){if(fs===null){var a=fs=[];fh=0,Wi=Eg(),Ui={status:"pending",value:void 0,then:function(n){a.push(n)}}}return fh++,t.then(kb,kb),t}function kb(){if(--fh===0&&fs!==null){Ui!==null&&(Ui.status="fulfilled");var e=fs;fs=null,Wi=0,Ui=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function MN(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 Tb=fe.S;fe.S=function(e,t){M0=Fa(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&EN(e,t),Tb!==null&&Tb(e,t)};var ko=On(null);function rg(){var e=ko.current;return e!==null?e:st.pooledCache}function Hc(e,t){t===null?ct(ko,ko.current):ct(ko,t.pool)}function gI(){var e=rg();return e===null?null:{parent:Ut._currentValue,pool:e}}var al=Error(B(460)),og=Error(B(474)),_d=Error(B(542)),ld={then:function(){}};function Lb(e){return e=e.status,e==="fulfilled"||e==="rejected"}function wI(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(er,er),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mb(e),e;default:if(typeof t.status=="string")t.then(er,er);else{if(e=st,e!==null&&100<e.shellSuspendCounter)throw Error(B(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,Mb(e),e}throw To=t,al}}function bo(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(To=a,al):a}}var To=null;function Eb(){if(To===null)throw Error(B(459));var e=To;return To=null,e}function Mb(e){if(e===al||e===_d)throw Error(B(483))}var Fi=null,Es=0;function Ec(e){var t=Es;return Es+=1,Fi===null&&(Fi=[]),wI(Fi,e,t)}function Jl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Mc(e,t){throw t.$$typeof===hP?Error(B(525)):(e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function yI(e){function t(w,y){if(e){var h=w.deletions;h===null?(w.deletions=[y],w.flags|=16):h.push(y)}}function a(w,y){if(!e)return null;for(;y!==null;)t(w,y),y=y.sibling;return null}function n(w){for(var y=new Map;w!==null;)w.key!==null?y.set(w.key,w):y.set(w.index,w),w=w.sibling;return y}function r(w,y){return w=ar(w,y),w.index=0,w.sibling=null,w}function o(w,y,h){return w.index=h,e?(h=w.alternate,h!==null?(h=h.index,h<y?(w.flags|=67108866,y):h):(w.flags|=67108866,y)):(w.flags|=1048576,y)}function i(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function l(w,y,h,b){return y===null||y.tag!==6?(y=Im(h,w.mode,b),y.return=w,y):(y=r(y,h),y.return=w,y)}function s(w,y,h,b){var T=h.type;return T===Ii?c(w,y,h.props.children,b,h.key):y!==null&&(y.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Tr&&bo(T)===y.type)?(y=r(y,h.props),Jl(y,h),y.return=w,y):(y=qc(h.type,h.key,h.props,null,w.mode,b),Jl(y,h),y.return=w,y)}function u(w,y,h,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==h.containerInfo||y.stateNode.implementation!==h.implementation?(y=Cm(h,w.mode,b),y.return=w,y):(y=r(y,h.children||[]),y.return=w,y)}function c(w,y,h,b,T){return y===null||y.tag!==7?(y=Co(h,w.mode,b,T),y.return=w,y):(y=r(y,h),y.return=w,y)}function d(w,y,h){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=Im(""+y,w.mode,h),y.return=w,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case xc:return h=qc(y.type,y.key,y.props,null,w.mode,h),Jl(h,y),h.return=w,h;case rs:return y=Cm(y,w.mode,h),y.return=w,y;case Tr:return y=bo(y),d(w,y,h)}if(os(y)||Zl(y))return y=Co(y,w.mode,h,null),y.return=w,y;if(typeof y.then=="function")return d(w,Ec(y),h);if(y.$$typeof===Jn)return d(w,Lc(w,y),h);Mc(w,y)}return null}function f(w,y,h,b){var T=y!==null?y.key:null;if(typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint")return T!==null?null:l(w,y,""+h,b);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case xc:return h.key===T?s(w,y,h,b):null;case rs:return h.key===T?u(w,y,h,b):null;case Tr:return h=bo(h),f(w,y,h,b)}if(os(h)||Zl(h))return T!==null?null:c(w,y,h,b,null);if(typeof h.then=="function")return f(w,y,Ec(h),b);if(h.$$typeof===Jn)return f(w,y,Lc(w,h),b);Mc(w,h)}return null}function p(w,y,h,b,T){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return w=w.get(h)||null,l(y,w,""+b,T);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case xc:return w=w.get(b.key===null?h:b.key)||null,s(y,w,b,T);case rs:return w=w.get(b.key===null?h:b.key)||null,u(y,w,b,T);case Tr:return b=bo(b),p(w,y,h,b,T)}if(os(b)||Zl(b))return w=w.get(h)||null,c(y,w,b,T,null);if(typeof b.then=="function")return p(w,y,h,Ec(b),T);if(b.$$typeof===Jn)return p(w,y,h,Lc(y,b),T);Mc(y,b)}return null}function m(w,y,h,b){for(var T=null,C=null,M=y,D=y=0,P=null;M!==null&&D<h.length;D++){M.index>D?(P=M,M=null):P=M.sibling;var L=f(w,M,h[D],b);if(L===null){M===null&&(M=P);break}e&&M&&L.alternate===null&&t(w,M),y=o(L,y,D),C===null?T=L:C.sibling=L,C=L,M=P}if(D===h.length)return a(w,M),Ue&&Zn(w,D),T;if(M===null){for(;D<h.length;D++)M=d(w,h[D],b),M!==null&&(y=o(M,y,D),C===null?T=M:C.sibling=M,C=M);return Ue&&Zn(w,D),T}for(M=n(M);D<h.length;D++)P=p(M,w,D,h[D],b),P!==null&&(e&&P.alternate!==null&&M.delete(P.key===null?D:P.key),y=o(P,y,D),C===null?T=P:C.sibling=P,C=P);return e&&M.forEach(function($){return t(w,$)}),Ue&&Zn(w,D),T}function x(w,y,h,b){if(h==null)throw Error(B(151));for(var T=null,C=null,M=y,D=y=0,P=null,L=h.next();M!==null&&!L.done;D++,L=h.next()){M.index>D?(P=M,M=null):P=M.sibling;var $=f(w,M,L.value,b);if($===null){M===null&&(M=P);break}e&&M&&$.alternate===null&&t(w,M),y=o($,y,D),C===null?T=$:C.sibling=$,C=$,M=P}if(L.done)return a(w,M),Ue&&Zn(w,D),T;if(M===null){for(;!L.done;D++,L=h.next())L=d(w,L.value,b),L!==null&&(y=o(L,y,D),C===null?T=L:C.sibling=L,C=L);return Ue&&Zn(w,D),T}for(M=n(M);!L.done;D++,L=h.next())L=p(M,w,D,L.value,b),L!==null&&(e&&L.alternate!==null&&M.delete(L.key===null?D:L.key),y=o(L,y,D),C===null?T=L:C.sibling=L,C=L);return e&&M.forEach(function(H){return t(w,H)}),Ue&&Zn(w,D),T}function S(w,y,h,b){if(typeof h=="object"&&h!==null&&h.type===Ii&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case xc:e:{for(var T=h.key;y!==null;){if(y.key===T){if(T=h.type,T===Ii){if(y.tag===7){a(w,y.sibling),b=r(y,h.props.children),b.return=w,w=b;break e}}else if(y.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Tr&&bo(T)===y.type){a(w,y.sibling),b=r(y,h.props),Jl(b,h),b.return=w,w=b;break e}a(w,y);break}else t(w,y);y=y.sibling}h.type===Ii?(b=Co(h.props.children,w.mode,b,h.key),b.return=w,w=b):(b=qc(h.type,h.key,h.props,null,w.mode,b),Jl(b,h),b.return=w,w=b)}return i(w);case rs:e:{for(T=h.key;y!==null;){if(y.key===T)if(y.tag===4&&y.stateNode.containerInfo===h.containerInfo&&y.stateNode.implementation===h.implementation){a(w,y.sibling),b=r(y,h.children||[]),b.return=w,w=b;break e}else{a(w,y);break}else t(w,y);y=y.sibling}b=Cm(h,w.mode,b),b.return=w,w=b}return i(w);case Tr:return h=bo(h),S(w,y,h,b)}if(os(h))return m(w,y,h,b);if(Zl(h)){if(T=Zl(h),typeof T!="function")throw Error(B(150));return h=T.call(h),x(w,y,h,b)}if(typeof h.then=="function")return S(w,y,Ec(h),b);if(h.$$typeof===Jn)return S(w,y,Lc(w,h),b);Mc(w,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,y!==null&&y.tag===6?(a(w,y.sibling),b=r(y,h),b.return=w,w=b):(a(w,y),b=Im(h,w.mode,b),b.return=w,w=b),i(w)):a(w,y)}return function(w,y,h,b){try{Es=0;var T=S(w,y,h,b);return Fi=null,T}catch(M){if(M===al||M===_d)throw M;var C=Ba(29,M,null,w.mode);return C.lanes=b,C.return=w,C}}}var Ao=yI(!0),xI=yI(!1),Lr=!1;function ig(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ph(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 Fr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function zr(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ye&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=rd(e),cI(e,null,a),t}return Dd(e,n,t,a),rd(e)}function ps(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,BS(e,a)}}function Tm(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 mh=!1;function ms(){if(mh){var e=Ui;if(e!==null)throw e}}function hs(e,t,a,n){mh=!1;var r=e.updateQueue;Lr=!1;var o=r.firstBaseUpdate,i=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var s=l,u=s.next;s.next=null,i===null?o=u:i.next=u,i=s;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==i&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=s))}if(o!==null){var d=r.baseState;i=0,c=u=s=null,l=o;do{var f=l.lane&-536870913,p=f!==l.lane;if(p?(Pe&f)===f:(n&f)===f){f!==0&&f===Wi&&(mh=!0),c!==null&&(c=c.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=e,x=l;f=t;var S=a;switch(x.tag){case 1:if(m=x.payload,typeof m=="function"){d=m.call(S,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=x.payload,f=typeof m=="function"?m.call(S,d,f):m,f==null)break e;d=mt({},d,f);break e;case 2:Lr=!0}}f=l.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[f]:p.push(f))}else p={lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=p,s=d):c=c.next=p,i|=f;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;p=l,l=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);c===null&&(s=d),r.baseState=s,r.firstBaseUpdate=u,r.lastBaseUpdate=c,o===null&&(r.shared.lanes=0),Kr|=i,e.lanes=i,e.memoizedState=d}}function vI(e,t){if(typeof e!="function")throw Error(B(191,e));e.call(t)}function bI(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)vI(a[e],t)}var Gi=On(null),sd=On(0);function Ab(e,t){e=ur,ct(sd,e),ct(Gi,t),ur=e|t.baseLanes}function hh(){ct(sd,ur),ct(Gi,Gi.current)}function lg(){ur=sd.current,Yt(Gi),Yt(sd)}var Va=On(null),rn=null;function Mr(e){var t=e.alternate;ct(Rt,Rt.current&1),ct(Va,e),rn===null&&(t===null||Gi.current!==null||t.memoizedState!==null)&&(rn=e)}function gh(e){ct(Rt,Rt.current),ct(Va,e),rn===null&&(rn=e)}function SI(e){e.tag===22?(ct(Rt,Rt.current),ct(Va,e),rn===null&&(rn=e)):Ar(e)}function Ar(){ct(Rt,Rt.current),ct(Va,Va.current)}function Na(e){Yt(Va),rn===e&&(rn=null),Yt(Rt)}var Rt=On(0);function ud(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Ph(a)||Nh(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 ir=0,Se=null,it=null,Nt=null,cd=!1,zi=!1,Ro=!1,dd=0,Ms=0,qi=null,AN=0;function It(){throw Error(B(321))}function sg(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ja(e[a],t[a]))return!1;return!0}function ug(e,t,a,n,r,o){return ir=o,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fe.H=e===null||e.memoizedState===null?JI:vg,Ro=!1,o=a(n,r),Ro=!1,zi&&(o=CI(t,a,n,r)),II(e),o}function II(e){fe.H=As;var t=it!==null&&it.next!==null;if(ir=0,Nt=it=Se=null,cd=!1,Ms=0,qi=null,t)throw Error(B(300));e===null||Ft||(e=e.dependencies,e!==null&&id(e)&&(Ft=!0))}function CI(e,t,a,n){Se=e;var r=0;do{if(zi&&(qi=null),Ms=0,zi=!1,25<=r)throw Error(B(301));if(r+=1,Nt=it=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}fe.H=e0,o=t(a,n)}while(zi);return o}function RN(){var e=fe.H,t=e.useState()[0];return t=typeof t.then=="function"?js(t):t,e=e.useState()[0],(it!==null?it.memoizedState:null)!==e&&(Se.flags|=1024),t}function cg(){var e=dd!==0;return dd=0,e}function dg(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function fg(e){if(cd){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}cd=!1}ir=0,Nt=it=Se=null,zi=!1,Ms=dd=0,qi=null}function pa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?Se.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function Dt(){if(it===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=Nt===null?Se.memoizedState:Nt.next;if(t!==null)Nt=t,it=e;else{if(e===null)throw Se.alternate===null?Error(B(467)):Error(B(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Nt===null?Se.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function Od(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function js(e){var t=Ms;return Ms+=1,qi===null&&(qi=[]),e=wI(qi,e,t),t=Se,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,fe.H=t===null||t.memoizedState===null?JI:vg),e}function Pd(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return js(e);if(e.$$typeof===Jn)return aa(e)}throw Error(B(438,String(e)))}function pg(e){var t=null,a=Se.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Se.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=Od(),Se.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]=gP;return t.index++,a}function lr(e,t){return typeof t=="function"?t(e):t}function jc(e){var t=Dt();return mg(t,it,e)}function mg(e,t,a){var n=e.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=a;var r=e.baseQueue,o=n.pending;if(o!==null){if(r!==null){var i=r.next;r.next=o.next,o.next=i}t.baseQueue=r=o,n.pending=null}if(o=e.baseState,r===null)e.memoizedState=o;else{t=r.next;var l=i=null,s=null,u=t,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Pe&d)===d:(ir&d)===d){var f=u.revertLane;if(f===0)s!==null&&(s=s.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===Wi&&(c=!0);else if((ir&f)===f){u=u.next,f===Wi&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(l=s=d,i=o):s=s.next=d,Se.lanes|=f,Kr|=f;d=u.action,Ro&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else f={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(l=s=f,i=o):s=s.next=f,Se.lanes|=d,Kr|=d;u=u.next}while(u!==null&&u!==t);if(s===null?i=o:s.next=l,!ja(o,e.memoizedState)&&(Ft=!0,c&&(a=Ui,a!==null)))throw a;e.memoizedState=o,e.baseState=i,e.baseQueue=s,n.lastRenderedState=o}return r===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Lm(e){var t=Dt(),a=t.queue;if(a===null)throw Error(B(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);ja(o,t.memoizedState)||(Ft=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function kI(e,t,a){var n=Se,r=Dt(),o=Ue;if(o){if(a===void 0)throw Error(B(407));a=a()}else a=t();var i=!ja((it||r).memoizedState,a);if(i&&(r.memoizedState=a,Ft=!0),r=r.queue,hg(EI.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Nt!==null&&Nt.memoizedState.tag&1){if(n.flags|=2048,$i(9,{destroy:void 0},LI.bind(null,n,r,a,t),null),st===null)throw Error(B(349));o||(ir&127)!==0||TI(n,t,a)}return a}function TI(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Se.updateQueue,t===null?(t=Od(),Se.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function LI(e,t,a,n){t.value=a,t.getSnapshot=n,MI(t)&&AI(e)}function EI(e,t,a){return a(function(){MI(t)&&AI(e)})}function MI(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ja(e,a)}catch{return!0}}function AI(e){var t=No(e,2);t!==null&&Ea(t,e,2)}function wh(e){var t=pa();if(typeof e=="function"){var a=e;if(e=a(),Ro){Dr(!0);try{a()}finally{Dr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:e},t}function RI(e,t,a,n){return e.baseState=a,mg(e,it,typeof n=="function"?n:lr)}function DN(e,t,a,n,r){if(Bd(e))throw Error(B(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)}};fe.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,DI(t,o)):(o.next=a.next,t.pending=a.next=o)}}function DI(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var o=fe.T,i={};fe.T=i;try{var l=a(r,n),s=fe.S;s!==null&&s(i,l),Rb(e,t,l)}catch(u){yh(e,t,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),fe.T=o}}else try{o=a(r,n),Rb(e,t,o)}catch(u){yh(e,t,u)}}function Rb(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Db(e,t,n)},function(n){return yh(e,t,n)}):Db(e,t,a)}function Db(e,t,a){t.status="fulfilled",t.value=a,_I(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,DI(e,a)))}function yh(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,_I(t),t=t.next;while(t!==n)}e.action=null}function _I(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function OI(e,t){return t}function _b(e,t){if(Ue){var a=st.formState;if(a!==null){e:{var n=Se;if(Ue){if(pt){t:{for(var r=pt,o=nn;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){pt=on(r.nextSibling),n=r.data==="F!";break e}}$r(n)}n=!1}n&&(t=a[0])}}return a=pa(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:OI,lastRenderedState:t},a.queue=n,a=YI.bind(null,Se,n),n.dispatch=a,n=wh(!1),o=xg.bind(null,Se,!1,n.queue),n=pa(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=DN.bind(null,Se,r,o,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function Ob(e){var t=Dt();return PI(t,it,e)}function PI(e,t,a){if(t=mg(e,t,OI)[0],e=jc(lr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=js(t)}catch(i){throw i===al?_d:i}else n=t;t=Dt();var r=t.queue,o=r.dispatch;return a!==t.memoizedState&&(Se.flags|=2048,$i(9,{destroy:void 0},_N.bind(null,r,a),null)),[n,o,e]}function _N(e,t){e.action=t}function Pb(e){var t=Dt(),a=it;if(a!==null)return PI(t,a,e);Dt(),t=t.memoizedState,a=Dt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function $i(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Se.updateQueue,t===null&&(t=Od(),Se.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 NI(){return Dt().memoizedState}function Vc(e,t,a,n){var r=pa();Se.flags|=e,r.memoizedState=$i(1|t,{destroy:void 0},a,n===void 0?null:n)}function Nd(e,t,a,n){var r=Dt();n=n===void 0?null:n;var o=r.memoizedState.inst;it!==null&&n!==null&&sg(n,it.memoizedState.deps)?r.memoizedState=$i(t,o,a,n):(Se.flags|=e,r.memoizedState=$i(1|t,o,a,n))}function Nb(e,t){Vc(8390656,8,e,t)}function hg(e,t){Nd(2048,8,e,t)}function ON(e){Se.flags|=4;var t=Se.updateQueue;if(t===null)t=Od(),Se.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function BI(e){var t=Dt().memoizedState;return ON({ref:t,nextImpl:e}),function(){if((Ye&2)!==0)throw Error(B(440));return t.impl.apply(void 0,arguments)}}function UI(e,t){return Nd(4,2,e,t)}function FI(e,t){return Nd(4,4,e,t)}function zI(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 qI(e,t,a){a=a!=null?a.concat([e]):null,Nd(4,4,zI.bind(null,t,e),a)}function gg(){}function HI(e,t){var a=Dt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&sg(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function jI(e,t){var a=Dt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&sg(t,n[1]))return n[0];if(n=e(),Ro){Dr(!0);try{e()}finally{Dr(!1)}}return a.memoizedState=[n,t],n}function wg(e,t,a){return a===void 0||(ir&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=R0(),Se.lanes|=e,Kr|=e,a)}function VI(e,t,a,n){return ja(a,t)?a:Gi.current!==null?(e=wg(e,a,n),ja(e,t)||(Ft=!0),e):(ir&42)===0||(ir&1073741824)!==0&&(Pe&261930)===0?(Ft=!0,e.memoizedState=a):(e=R0(),Se.lanes|=e,Kr|=e,t)}function WI(e,t,a,n,r){var o=Ze.p;Ze.p=o!==0&&8>o?o:8;var i=fe.T,l={};fe.T=l,xg(e,!1,t,a);try{var s=r(),u=fe.S;if(u!==null&&u(l,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=MN(s,n);gs(e,t,c,Ha(e))}else gs(e,t,n,Ha(e))}catch(d){gs(e,t,{then:function(){},status:"rejected",reason:d},Ha())}finally{Ze.p=o,i!==null&&l.types!==null&&(i.types=l.types),fe.T=i}}function PN(){}function xh(e,t,a,n){if(e.tag!==5)throw Error(B(476));var r=GI(e).queue;WI(e,r,t,Io,a===null?PN:function(){return $I(e),a(n)})}function GI(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Io,baseState:Io,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:Io},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $I(e){var t=GI(e);t.next===null&&(t=e.alternate.memoizedState),gs(e,t.next.queue,{},Ha())}function yg(){return aa(_s)}function XI(){return Dt().memoizedState}function KI(){return Dt().memoizedState}function NN(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ha();e=Fr(a);var n=zr(t,e,a);n!==null&&(Ea(n,t,a),ps(n,t,a)),t={cache:ng()},e.payload=t;return}t=t.return}}function BN(e,t,a){var n=Ha();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Bd(e)?ZI(t,a):(a=Jh(e,t,a,n),a!==null&&(Ea(a,e,n),QI(a,t,n)))}function YI(e,t,a){var n=Ha();gs(e,t,a,n)}function gs(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Bd(e))ZI(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,a);if(r.hasEagerState=!0,r.eagerState=l,ja(l,i))return Dd(e,t,r,0),st===null&&Rd(),!1}catch{}if(a=Jh(e,t,r,n),a!==null)return Ea(a,e,n),QI(a,t,n),!0}return!1}function xg(e,t,a,n){if(n={lane:2,revertLane:Eg(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bd(e)){if(t)throw Error(B(479))}else t=Jh(e,a,n,2),t!==null&&Ea(t,e,2)}function Bd(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function ZI(e,t){zi=cd=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function QI(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,BS(e,a)}}var As={readContext:aa,use:Pd,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};As.useEffectEvent=It;var JI={readContext:aa,use:Pd,useCallback:function(e,t){return pa().memoizedState=[e,t===void 0?null:t],e},useContext:aa,useEffect:Nb,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Vc(4194308,4,zI.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Vc(4194308,4,e,t)},useInsertionEffect:function(e,t){Vc(4,2,e,t)},useMemo:function(e,t){var a=pa();t=t===void 0?null:t;var n=e();if(Ro){Dr(!0);try{e()}finally{Dr(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=pa();if(a!==void 0){var r=a(t);if(Ro){Dr(!0);try{a(t)}finally{Dr(!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=BN.bind(null,Se,e),[n.memoizedState,e]},useRef:function(e){var t=pa();return e={current:e},t.memoizedState=e},useState:function(e){e=wh(e);var t=e.queue,a=YI.bind(null,Se,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:gg,useDeferredValue:function(e,t){var a=pa();return wg(a,e,t)},useTransition:function(){var e=wh(!1);return e=WI.bind(null,Se,e.queue,!0,!1),pa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Se,r=pa();if(Ue){if(a===void 0)throw Error(B(407));a=a()}else{if(a=t(),st===null)throw Error(B(349));(Pe&127)!==0||TI(n,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Nb(EI.bind(null,n,o,e),[e]),n.flags|=2048,$i(9,{destroy:void 0},LI.bind(null,n,o,a,t),null),a},useId:function(){var e=pa(),t=st.identifierPrefix;if(Ue){var a=Rn,n=An;a=(n&~(1<<32-qa(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=dd++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=AN++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:yg,useFormState:_b,useActionState:_b,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=xg.bind(null,Se,!0,a),a.dispatch=t,[e,t]},useMemoCache:pg,useCacheRefresh:function(){return pa().memoizedState=NN.bind(null,Se)},useEffectEvent:function(e){var t=pa(),a={impl:e};return t.memoizedState=a,function(){if((Ye&2)!==0)throw Error(B(440));return a.impl.apply(void 0,arguments)}}},vg={readContext:aa,use:Pd,useCallback:HI,useContext:aa,useEffect:hg,useImperativeHandle:qI,useInsertionEffect:UI,useLayoutEffect:FI,useMemo:jI,useReducer:jc,useRef:NI,useState:function(){return jc(lr)},useDebugValue:gg,useDeferredValue:function(e,t){var a=Dt();return VI(a,it.memoizedState,e,t)},useTransition:function(){var e=jc(lr)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:js(e),t]},useSyncExternalStore:kI,useId:XI,useHostTransitionStatus:yg,useFormState:Ob,useActionState:Ob,useOptimistic:function(e,t){var a=Dt();return RI(a,it,e,t)},useMemoCache:pg,useCacheRefresh:KI};vg.useEffectEvent=BI;var e0={readContext:aa,use:Pd,useCallback:HI,useContext:aa,useEffect:hg,useImperativeHandle:qI,useInsertionEffect:UI,useLayoutEffect:FI,useMemo:jI,useReducer:Lm,useRef:NI,useState:function(){return Lm(lr)},useDebugValue:gg,useDeferredValue:function(e,t){var a=Dt();return it===null?wg(a,e,t):VI(a,it.memoizedState,e,t)},useTransition:function(){var e=Lm(lr)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:js(e),t]},useSyncExternalStore:kI,useId:XI,useHostTransitionStatus:yg,useFormState:Pb,useActionState:Pb,useOptimistic:function(e,t){var a=Dt();return it!==null?RI(a,it,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:pg,useCacheRefresh:KI};e0.useEffectEvent=BI;function Em(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:mt({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var vh={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Ha(),r=Fr(n);r.payload=t,a!=null&&(r.callback=a),t=zr(e,r,n),t!==null&&(Ea(t,e,n),ps(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Ha(),r=Fr(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=zr(e,r,n),t!==null&&(Ea(t,e,n),ps(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ha(),n=Fr(a);n.tag=2,t!=null&&(n.callback=t),t=zr(e,n,a),t!==null&&(Ea(t,e,a),ps(t,e,a))}};function Bb(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?!ks(a,n)||!ks(r,o):!0}function Ub(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&&vh.enqueueReplaceState(t,t.state,null)}function Do(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=mt({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function t0(e){nd(e)}function a0(e){console.error(e)}function n0(e){nd(e)}function fd(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Fb(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 bh(e,t,a){return a=Fr(a),a.tag=3,a.payload={element:null},a.callback=function(){fd(e,t)},a}function r0(e){return e=Fr(e),e.tag=3,e}function o0(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(){Fb(t,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Fb(t,a,n),typeof r!="function"&&(qr===null?qr=new Set([this]):qr.add(this));var l=n.stack;this.componentDidCatch(n.value,{componentStack:l!==null?l:""})})}function UN(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&tl(t,a,r,!0),a=Va.current,a!==null){switch(a.tag){case 31:case 13:return rn===null?wd():a.alternate===null&&Ct===0&&(Ct=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===ld?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Fm(e,n,r)),!1;case 22:return a.flags|=65536,n===ld?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)),Fm(e,n,r)),!1}throw Error(B(435,a.tag))}return Fm(e,n,r),wd(),!1}if(Ue)return t=Va.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==sh&&(e=Error(B(422),{cause:n}),Ls(an(e,a)))):(n!==sh&&(t=Error(B(423),{cause:n}),Ls(an(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=an(n,a),r=bh(e.stateNode,n,r),Tm(e,r),Ct!==4&&(Ct=2)),!1;var o=Error(B(520),{cause:n});if(o=an(o,a),xs===null?xs=[o]:xs.push(o),Ct!==4&&(Ct=2),t===null)return!0;n=an(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=bh(a.stateNode,n,e),Tm(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"&&(qr===null||!qr.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=r0(r),o0(r,e,a,n),Tm(a,r),!1}a=a.return}while(a!==null);return!1}var bg=Error(B(461)),Ft=!1;function Jt(e,t,a,n){t.child=e===null?xI(t,null,a,n):Ao(t,e.child,a,n)}function zb(e,t,a,n,r){a=a.render;var o=t.ref;if("ref"in n){var i={};for(var l in n)l!=="ref"&&(i[l]=n[l])}else i=n;return Mo(t),n=ug(e,t,a,i,o,r),l=cg(),e!==null&&!Ft?(dg(e,t,r),sr(e,t,r)):(Ue&&l&&tg(t),t.flags|=1,Jt(e,t,n,r),t.child)}function qb(e,t,a,n,r){if(e===null){var o=a.type;return typeof o=="function"&&!eg(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,i0(e,t,o,n,r)):(e=qc(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Sg(e,r)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:ks,a(i,n)&&e.ref===t.ref)return sr(e,t,r)}return t.flags|=1,e=ar(o,n),e.ref=t.ref,e.return=t,t.child=e}function i0(e,t,a,n,r){if(e!==null){var o=e.memoizedProps;if(ks(o,n)&&e.ref===t.ref)if(Ft=!1,t.pendingProps=n=o,Sg(e,r))(e.flags&131072)!==0&&(Ft=!0);else return t.lanes=e.lanes,sr(e,t,r)}return Sh(e,t,a,n,r)}function l0(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 Hb(e,t,o,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Hc(t,o!==null?o.cachePool:null),o!==null?Ab(t,o):hh(),SI(t);else return n=t.lanes=536870912,Hb(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(Hc(t,o.cachePool),Ab(t,o),Ar(t),t.memoizedState=null):(e!==null&&Hc(t,null),hh(),Ar(t));return Jt(e,t,r,a),t.child}function ls(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hb(e,t,a,n,r){var o=rg();return o=o===null?null:{parent:Ut._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&Hc(t,null),hh(),SI(t),e!==null&&tl(e,t,n,!0),t.childLanes=r,null}function Wc(e,t){return t=pd({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function jb(e,t,a){return Ao(t,e.child,null,a),e=Wc(t,t.pendingProps),e.flags|=2,Na(t),t.memoizedState=null,e}function FN(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(n.mode==="hidden")return e=Wc(t,n),t.lanes=536870912,ls(null,e);if(gh(t),(e=pt)?(e=J0(e,nn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gr!==null?{id:An,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},a=fI(e),a.return=t,t.child=a,ta=t,pt=null)):e=null,e===null)throw $r(t);return t.lanes=536870912,null}return Wc(t,n)}var o=e.memoizedState;if(o!==null){var i=o.dehydrated;if(gh(t),r)if(t.flags&256)t.flags&=-257,t=jb(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(B(558));else if(Ft||tl(e,t,a,!1),r=(a&e.childLanes)!==0,Ft||r){if(n=st,n!==null&&(i=US(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,No(e,i),Ea(n,e,i),bg;wd(),t=jb(e,t,a)}else e=o.treeContext,pt=on(i.nextSibling),ta=t,Ue=!0,Ur=null,nn=!1,e!==null&&mI(t,e),t=Wc(t,n),t.flags|=4096;return t}return e=ar(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(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(B(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Sh(e,t,a,n,r){return Mo(t),a=ug(e,t,a,n,void 0,r),n=cg(),e!==null&&!Ft?(dg(e,t,r),sr(e,t,r)):(Ue&&n&&tg(t),t.flags|=1,Jt(e,t,a,r),t.child)}function Vb(e,t,a,n,r,o){return Mo(t),t.updateQueue=null,a=CI(t,n,a,r),II(e),n=cg(),e!==null&&!Ft?(dg(e,t,o),sr(e,t,o)):(Ue&&n&&tg(t),t.flags|=1,Jt(e,t,a,o),t.child)}function Wb(e,t,a,n,r){if(Mo(t),t.stateNode===null){var o=Ri,i=a.contextType;typeof i=="object"&&i!==null&&(o=aa(i)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=vh,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},ig(t),i=a.contextType,o.context=typeof i=="object"&&i!==null?aa(i):Ri,o.state=t.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(Em(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&&vh.enqueueReplaceState(o,o.state,null),hs(t,n,o,r),ms(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){o=t.stateNode;var l=t.memoizedProps,s=Do(a,l);o.props=s;var u=o.context,c=a.contextType;i=Ri,typeof c=="object"&&c!==null&&(i=aa(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l||u!==i)&&Ub(t,o,n,i),Lr=!1;var f=t.memoizedState;o.state=f,hs(t,n,o,r),ms(),u=t.memoizedState,l||f!==u||Lr?(typeof d=="function"&&(Em(t,a,d,n),u=t.memoizedState),(s=Lr||Bb(t,a,s,n,f,u,i))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=i,n=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,ph(e,t),i=t.memoizedProps,c=Do(a,i),o.props=c,d=t.pendingProps,f=o.context,u=a.contextType,s=Ri,typeof u=="object"&&u!==null&&(s=aa(u)),l=a.getDerivedStateFromProps,(u=typeof l=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||f!==s)&&Ub(t,o,n,s),Lr=!1,f=t.memoizedState,o.state=f,hs(t,n,o,r),ms();var p=t.memoizedState;i!==d||f!==p||Lr||e!==null&&e.dependencies!==null&&id(e.dependencies)?(typeof l=="function"&&(Em(t,a,l,n),p=t.memoizedState),(c=Lr||Bb(t,a,c,n,f,p,s)||e!==null&&e.dependencies!==null&&id(e.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,p,s),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,p,s)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=p),o.props=n,o.state=p,o.context=s,n=c):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return o=n,Gc(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=Ao(t,e.child,null,r),t.child=Ao(t,null,a,r)):Jt(e,t,a,r),t.memoizedState=o.state,e=t.child):e=sr(e,t,r),e}function Gb(e,t,a,n){return Eo(),t.flags|=256,Jt(e,t,a,n),t.child}var Mm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Am(e){return{baseLanes:e,cachePool:gI()}}function Rm(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ua),e}function s0(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:(Rt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(r?Mr(t):Ar(t),(e=pt)?(e=J0(e,nn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gr!==null?{id:An,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},a=fI(e),a.return=t,t.child=a,ta=t,pt=null)):e=null,e===null)throw $r(t);return Nh(e)?t.lanes=32:t.lanes=536870912,null}var l=n.children;return n=n.fallback,r?(Ar(t),r=t.mode,l=pd({mode:"hidden",children:l},r),n=Co(n,r,a,null),l.return=t,n.return=t,l.sibling=n,t.child=l,n=t.child,n.memoizedState=Am(a),n.childLanes=Rm(e,i,a),t.memoizedState=Mm,ls(null,n)):(Mr(t),Ih(t,l))}var s=e.memoizedState;if(s!==null&&(l=s.dehydrated,l!==null)){if(o)t.flags&256?(Mr(t),t.flags&=-257,t=Dm(e,t,a)):t.memoizedState!==null?(Ar(t),t.child=e.child,t.flags|=128,t=null):(Ar(t),l=n.fallback,r=t.mode,n=pd({mode:"visible",children:n.children},r),l=Co(l,r,a,null),l.flags|=2,n.return=t,l.return=t,n.sibling=l,t.child=n,Ao(t,e.child,null,a),n=t.child,n.memoizedState=Am(a),n.childLanes=Rm(e,i,a),t.memoizedState=Mm,t=ls(null,n));else if(Mr(t),Nh(l)){if(i=l.nextSibling&&l.nextSibling.dataset,i)var u=i.dgst;i=u,n=Error(B(419)),n.stack="",n.digest=i,Ls({value:n,source:null,stack:null}),t=Dm(e,t,a)}else if(Ft||tl(e,t,a,!1),i=(a&e.childLanes)!==0,Ft||i){if(i=st,i!==null&&(n=US(i,a),n!==0&&n!==s.retryLane))throw s.retryLane=n,No(e,n),Ea(i,e,n),bg;Ph(l)||wd(),t=Dm(e,t,a)}else Ph(l)?(t.flags|=192,t.child=e.child,t=null):(e=s.treeContext,pt=on(l.nextSibling),ta=t,Ue=!0,Ur=null,nn=!1,e!==null&&mI(t,e),t=Ih(t,n.children),t.flags|=4096);return t}return r?(Ar(t),l=n.fallback,r=t.mode,s=e.child,u=s.sibling,n=ar(s,{mode:"hidden",children:n.children}),n.subtreeFlags=s.subtreeFlags&65011712,u!==null?l=ar(u,l):(l=Co(l,r,a,null),l.flags|=2),l.return=t,n.return=t,n.sibling=l,t.child=n,ls(null,n),n=t.child,l=e.child.memoizedState,l===null?l=Am(a):(r=l.cachePool,r!==null?(s=Ut._currentValue,r=r.parent!==s?{parent:s,pool:s}:r):r=gI(),l={baseLanes:l.baseLanes|a,cachePool:r}),n.memoizedState=l,n.childLanes=Rm(e,i,a),t.memoizedState=Mm,ls(e.child,n)):(Mr(t),a=e.child,e=a.sibling,a=ar(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 Ih(e,t){return t=pd({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function pd(e,t){return e=Ba(22,e,null,t),e.lanes=0,e}function Dm(e,t,a){return Ao(t,e.child,null,a),e=Ih(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $b(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ch(e.return,t,a)}function _m(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 u0(e,t,a){var n=t.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=Rt.current,l=(i&2)!==0;if(l?(i=i&1|2,t.flags|=128):i&=1,ct(Rt,i),Jt(e,t,n,a),n=Ue?Ts:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$b(e,a,t);else if(e.tag===19)$b(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&&ud(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),_m(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&&ud(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}_m(t,!0,a,null,o,n);break;case"together":_m(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function sr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Kr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(tl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,a=ar(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ar(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Sg(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&id(e)))}function zN(e,t,a){switch(t.tag){case 3:Jc(t,t.stateNode.containerInfo),Er(t,Ut,e.memoizedState.cache),Eo();break;case 27:case 5:Zm(t);break;case 4:Jc(t,t.stateNode.containerInfo);break;case 10:Er(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,gh(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Mr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?s0(e,t,a):(Mr(t),e=sr(e,t,a),e!==null?e.sibling:null);Mr(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(tl(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return u0(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ct(Rt,Rt.current),n)break;return null;case 22:return t.lanes=0,l0(e,t,a,t.pendingProps);case 24:Er(t,Ut,e.memoizedState.cache)}return sr(e,t,a)}function c0(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ft=!0;else{if(!Sg(e,a)&&(t.flags&128)===0)return Ft=!1,zN(e,t,a);Ft=(e.flags&131072)!==0}else Ft=!1,Ue&&(t.flags&1048576)!==0&&pI(t,Ts,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=bo(t.elementType),t.type=e,typeof e=="function")eg(e)?(n=Do(e,n),t.tag=1,t=Wb(null,t,e,n,a)):(t.tag=0,t=Sh(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===zh){t.tag=11,t=zb(null,t,e,n,a);break e}else if(r===qh){t.tag=14,t=qb(null,t,e,n,a);break e}}throw t=Km(e)||e,Error(B(306,t,""))}}return t;case 0:return Sh(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=Do(n,t.pendingProps),Wb(e,t,n,r,a);case 3:e:{if(Jc(t,t.stateNode.containerInfo),e===null)throw Error(B(387));n=t.pendingProps;var o=t.memoizedState;r=o.element,ph(e,t),hs(t,n,null,a);var i=t.memoizedState;if(n=i.cache,Er(t,Ut,n),n!==o.cache&&dh(t,[Ut],a,!0),ms(),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=Gb(e,t,n,a);break e}else if(n!==r){r=an(Error(B(424)),t),Ls(r),t=Gb(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,pt=on(e.firstChild),ta=t,Ue=!0,Ur=null,nn=!0,a=xI(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Eo(),n===r){t=sr(e,t,a);break e}Jt(e,t,n,a)}t=t.child}return t;case 26:return Gc(e,t),e===null?(a=hS(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ue||(a=t.type,e=t.pendingProps,n=bd(Br.current).createElement(a),n[ea]=t,n[Ma]=e,na(n,a,e),Kt(n),t.stateNode=n):t.memoizedState=hS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Zm(t),e===null&&Ue&&(n=t.stateNode=eC(t.type,t.pendingProps,Br.current),ta=t,nn=!0,r=pt,Zr(t.type)?(Bh=r,pt=on(n.firstChild)):pt=r),Jt(e,t,t.pendingProps.children,a),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((r=n=pt)&&(n=mB(n,t.type,t.pendingProps,nn),n!==null?(t.stateNode=n,ta=t,pt=on(n.firstChild),nn=!1,r=!0):r=!1),r||$r(t)),Zm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,n=o.children,_h(r,o)?n=null:i!==null&&_h(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=ug(e,t,RN,null,null,a),_s._currentValue=r),Gc(e,t),Jt(e,t,n,a),t.child;case 6:return e===null&&Ue&&((e=a=pt)&&(a=hB(a,t.pendingProps,nn),a!==null?(t.stateNode=a,ta=t,pt=null,e=!0):e=!1),e||$r(t)),null;case 13:return s0(e,t,a);case 4:return Jc(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ao(t,null,n,a):Jt(e,t,n,a),t.child;case 11:return zb(e,t,t.type,t.pendingProps,a);case 7:return Jt(e,t,t.pendingProps,a),t.child;case 8:return Jt(e,t,t.pendingProps.children,a),t.child;case 12:return Jt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Er(t,t.type,n.value),Jt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,Mo(t),r=aa(r),n=n(r),t.flags|=1,Jt(e,t,n,a),t.child;case 14:return qb(e,t,t.type,t.pendingProps,a);case 15:return i0(e,t,t.type,t.pendingProps,a);case 19:return u0(e,t,a);case 31:return FN(e,t,a);case 22:return l0(e,t,a,t.pendingProps);case 24:return Mo(t),n=aa(Ut),e===null?(r=rg(),r===null&&(r=st,o=ng(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:n,cache:r},ig(t),Er(t,Ut,r)):((e.lanes&a)!==0&&(ph(e,t),hs(t,null,null,a),ms()),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),Er(t,Ut,n)):(n=o.cache,Er(t,Ut,n),n!==r.cache&&dh(t,[Ut],a,!0))),Jt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(B(156,t.tag))}function $n(e){e.flags|=4}function Om(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(O0())e.flags|=8192;else throw To=ld,og}else e.flags&=-16777217}function Xb(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!nC(t))if(O0())e.flags|=8192;else throw To=ld,og}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?PS():536870912,e.lanes|=t,Xi|=t)}function es(e,t){if(!Ue)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 ft(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 qN(e,t,a){var n=t.pendingProps;switch(ag(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return ft(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),nr(Ut),Hi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(xi(t)?$n(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,km())),ft(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?($n(t),o!==null?(ft(t),Xb(t,o)):(ft(t),Om(t,r,null,n,a))):o?o!==e.memoizedState?($n(t),ft(t),Xb(t,o)):(ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&$n(t),ft(t),Om(t,r,e,n,a)),null;case 27:if(ed(t),a=Br.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$n(t);else{if(!n){if(t.stateNode===null)throw Error(B(166));return ft(t),null}e=_n.current,xi(t)?Ib(t,e):(e=eC(r,n,a),t.stateNode=e,$n(t))}return ft(t),null;case 5:if(ed(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$n(t);else{if(!n){if(t.stateNode===null)throw Error(B(166));return ft(t),null}if(o=_n.current,xi(t))Ib(t,o);else{var i=bd(Br.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[ea]=t,o[Ma]=n;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=o;e:switch(na(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&&$n(t)}}return ft(t),Om(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&$n(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(B(166));if(e=Br.current,xi(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=ta,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[ea]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Y0(e.nodeValue,a)),e||$r(t,!0)}else e=bd(e).createTextNode(n),e[ea]=t,t.stateNode=e}return ft(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=xi(t),a!==null){if(e===null){if(!n)throw Error(B(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(557));e[ea]=t}else Eo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),e=!1}else a=km(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Na(t),t):(Na(t),null);if((t.flags&128)!==0)throw Error(B(558))}return ft(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=xi(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(B(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(B(317));r[ea]=t}else Eo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),r=!1}else r=km(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Na(t),t):(Na(t),null)}return Na(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),Ac(t,t.updateQueue),ft(t),null);case 4:return Hi(),e===null&&Mg(t.stateNode.containerInfo),ft(t),null;case 10:return nr(t.type),ft(t),null;case 19:if(Yt(Rt),n=t.memoizedState,n===null)return ft(t),null;if(r=(t.flags&128)!==0,o=n.rendering,o===null)if(r)es(n,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=ud(e),o!==null){for(t.flags|=128,es(n,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)dI(a,e),a=a.sibling;return ct(Rt,Rt.current&1|2),Ue&&Zn(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Fa()>hd&&(t.flags|=128,r=!0,es(n,!1),t.lanes=4194304)}else{if(!r)if(e=ud(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),es(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!Ue)return ft(t),null}else 2*Fa()-n.renderingStartTime>hd&&a!==536870912&&(t.flags|=128,r=!0,es(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=Fa(),e.sibling=null,a=Rt.current,ct(Rt,r?a&1|2:a&1),Ue&&Zn(t,n.treeForkCount),e):(ft(t),null);case 22:case 23:return Na(t),lg(),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&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),a=t.updateQueue,a!==null&&Ac(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&&Yt(ko),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),nr(Ut),ft(t),null;case 25:return null;case 30:return null}throw Error(B(156,t.tag))}function HN(e,t){switch(ag(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nr(Ut),Hi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ed(t),null;case 31:if(t.memoizedState!==null){if(Na(t),t.alternate===null)throw Error(B(340));Eo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Na(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Eo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yt(Rt),null;case 4:return Hi(),null;case 10:return nr(t.type),null;case 22:case 23:return Na(t),lg(),e!==null&&Yt(ko),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return nr(Ut),null;case 25:return null;default:return null}}function d0(e,t){switch(ag(t),t.tag){case 3:nr(Ut),Hi();break;case 26:case 27:case 5:ed(t);break;case 4:Hi();break;case 31:t.memoizedState!==null&&Na(t);break;case 13:Na(t);break;case 19:Yt(Rt);break;case 10:nr(t.type);break;case 22:case 23:Na(t),lg(),e!==null&&Yt(ko);break;case 24:nr(Ut)}}function Vs(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&e)===e){n=void 0;var o=a.create,i=a.inst;n=o(),i.destroy=n}a=a.next}while(a!==r)}}catch(l){tt(t,t.return,l)}}function Xr(e,t,a){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&e)===e){var i=n.inst,l=i.destroy;if(l!==void 0){i.destroy=void 0,r=t;var s=a,u=l;try{u()}catch(c){tt(r,s,c)}}}n=n.next}while(n!==o)}}catch(c){tt(t,t.return,c)}}function f0(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{bI(t,a)}catch(n){tt(e,e.return,n)}}}function p0(e,t,a){a.props=Do(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){tt(e,t,n)}}function ws(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){tt(e,t,r)}}function Dn(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){tt(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){tt(e,t,r)}else a.current=null}function m0(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){tt(e,e.return,r)}}function Pm(e,t,a){try{var n=e.stateNode;sB(n,e.type,a,t),n[Ma]=t}catch(r){tt(e,e.return,r)}}function h0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zr(e.type)||e.tag===4}function Nm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||h0(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&&Zr(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 Ch(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=er));else if(n!==4&&(n===27&&Zr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Ch(e,t,a),e=e.sibling;e!==null;)Ch(e,t,a),e=e.sibling}function md(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&&Zr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(md(e,t,a),e=e.sibling;e!==null;)md(e,t,a),e=e.sibling}function g0(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);na(t,n,a),t[ea]=e,t[Ma]=a}catch(o){tt(e,e.return,o)}}var Qn=!1,Bt=!1,Bm=!1,Kb=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function jN(e,t){if(e=e.containerInfo,Rh=kd,e=nI(e),Zh(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var i=0,l=-1,s=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==a||r!==0&&d.nodeType!==3||(l=i+r),d!==o||n!==0&&d.nodeType!==3||(s=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===a&&++u===r&&(l=i),f===o&&++c===n&&(s=i),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}a=l===-1||s===-1?null:{start:l,end:s}}else a=null}a=a||{start:0,end:0}}else a=null;for(Dh={focusedElem:e,selectionRange:a},kd=!1,Xt=t;Xt!==null;)if(t=Xt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Xt=e;else for(;Xt!==null;){switch(t=Xt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)r=e[a],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,r=o.memoizedProps,o=o.memoizedState,n=a.stateNode;try{var m=Do(a.type,r);e=n.getSnapshotBeforeUpdate(m,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(x){tt(a,a.return,x)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Oh(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Oh(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(B(163))}if(e=t.sibling,e!==null){e.return=t.return,Xt=e;break}Xt=t.return}}function w0(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Kn(e,a),n&4&&Vs(5,a);break;case 1:if(Kn(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(i){tt(a,a.return,i)}else{var r=Do(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){tt(a,a.return,i)}}n&64&&f0(a),n&512&&ws(a,a.return);break;case 3:if(Kn(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{bI(e,t)}catch(i){tt(a,a.return,i)}}break;case 27:t===null&&n&4&&g0(a);case 26:case 5:Kn(e,a),t===null&&n&4&&m0(a),n&512&&ws(a,a.return);break;case 12:Kn(e,a);break;case 31:Kn(e,a),n&4&&v0(e,a);break;case 13:Kn(e,a),n&4&&b0(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=QN.bind(null,a),gB(e,a))));break;case 22:if(n=a.memoizedState!==null||Qn,!n){t=t!==null&&t.memoizedState!==null||Bt,r=Qn;var o=Bt;Qn=n,(Bt=t)&&!o?Yn(e,a,(a.subtreeFlags&8772)!==0):Kn(e,a),Qn=r,Bt=o}break;case 30:break;default:Kn(e,a)}}function y0(e){var t=e.alternate;t!==null&&(e.alternate=null,y0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Wh(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 xt=null,Ta=!1;function Xn(e,t,a){for(a=a.child;a!==null;)x0(e,t,a),a=a.sibling}function x0(e,t,a){if(za&&typeof za.onCommitFiberUnmount=="function")try{za.onCommitFiberUnmount(Bs,a)}catch{}switch(a.tag){case 26:Bt||Dn(a,t),Xn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Bt||Dn(a,t);var n=xt,r=Ta;Zr(a.type)&&(xt=a.stateNode,Ta=!1),Xn(e,t,a),bs(a.stateNode),xt=n,Ta=r;break;case 5:Bt||Dn(a,t);case 6:if(n=xt,r=Ta,xt=null,Xn(e,t,a),xt=n,Ta=r,xt!==null)if(Ta)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(a.stateNode)}catch(o){tt(a,t,o)}else try{xt.removeChild(a.stateNode)}catch(o){tt(a,t,o)}break;case 18:xt!==null&&(Ta?(e=xt,cS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Qi(e)):cS(xt,a.stateNode));break;case 4:n=xt,r=Ta,xt=a.stateNode.containerInfo,Ta=!0,Xn(e,t,a),xt=n,Ta=r;break;case 0:case 11:case 14:case 15:Xr(2,a,t),Bt||Xr(4,a,t),Xn(e,t,a);break;case 1:Bt||(Dn(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&p0(a,t,n)),Xn(e,t,a);break;case 21:Xn(e,t,a);break;case 22:Bt=(n=Bt)||a.memoizedState!==null,Xn(e,t,a),Bt=n;break;default:Xn(e,t,a)}}function v0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qi(e)}catch(a){tt(t,t.return,a)}}}function b0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qi(e)}catch(a){tt(t,t.return,a)}}function VN(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Kb),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Kb),t;default:throw Error(B(435,e.tag))}}function Rc(e,t){var a=VN(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=JN.bind(null,e,n);n.then(r,r)}})}function Ca(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 27:if(Zr(l.type)){xt=l.stateNode,Ta=!1;break e}break;case 5:xt=l.stateNode,Ta=!1;break e;case 3:case 4:xt=l.stateNode.containerInfo,Ta=!0;break e}l=l.return}if(xt===null)throw Error(B(160));x0(o,i,r),xt=null,Ta=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)S0(t,e),t=t.sibling}var xn=null;function S0(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ca(t,e),ka(e),n&4&&(Xr(3,e,e.return),Vs(3,e),Xr(5,e,e.return));break;case 1:Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(a,a.return)),n&64&&Qn&&(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=xn;if(Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(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[zs]||o[ea]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),na(o,n,a),o[ea]=e,Kt(o),n=o;break e;case"link":var i=wS("link","href",r).get(n+(a.href||""));if(i){for(var l=0;l<i.length;l++)if(o=i[l],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){i.splice(l,1);break t}}o=r.createElement(n),na(o,n,a),r.head.appendChild(o);break;case"meta":if(i=wS("meta","content",r).get(n+(a.content||""))){for(l=0;l<i.length;l++)if(o=i[l],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){i.splice(l,1);break t}}o=r.createElement(n),na(o,n,a),r.head.appendChild(o);break;default:throw Error(B(468,n))}o[ea]=e,Kt(o),n=o}e.stateNode=n}else yS(r,e.type,e.stateNode);else e.stateNode=gS(r,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?yS(r,e.type,e.stateNode):gS(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Pm(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(a,a.return)),a!==null&&n&4&&Pm(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ca(t,e),ka(e),n&512&&(Bt||a===null||Dn(a,a.return)),e.flags&32){r=e.stateNode;try{Vi(r,"")}catch(m){tt(e,e.return,m)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,Pm(e,r,a!==null?a.memoizedProps:r)),n&1024&&(Bm=!0);break;case 6:if(Ca(t,e),ka(e),n&4){if(e.stateNode===null)throw Error(B(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(m){tt(e,e.return,m)}}break;case 3:if(Kc=null,r=xn,xn=Sd(t.containerInfo),Ca(t,e),xn=r,ka(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Qi(t.containerInfo)}catch(m){tt(e,e.return,m)}Bm&&(Bm=!1,I0(e));break;case 4:n=xn,xn=Sd(e.stateNode.containerInfo),Ca(t,e),ka(e),xn=n;break;case 12:Ca(t,e),ka(e);break;case 31:Ca(t,e),ka(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Rc(e,n)));break;case 13:Ca(t,e),ka(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ud=Fa()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Rc(e,n)));break;case 22:r=e.memoizedState!==null;var s=a!==null&&a.memoizedState!==null,u=Qn,c=Bt;if(Qn=u||r,Bt=c||s,Ca(t,e),Bt=c,Qn=u,ka(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||s||Qn||Bt||So(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){s=a=t;try{if(o=s.stateNode,r)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{l=s.stateNode;var d=s.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;l.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(m){tt(s,s.return,m)}}}else if(t.tag===6){if(a===null){s=t;try{s.stateNode.nodeValue=r?"":s.memoizedProps}catch(m){tt(s,s.return,m)}}}else if(t.tag===18){if(a===null){s=t;try{var p=s.stateNode;r?dS(p,!0):dS(s.stateNode,!1)}catch(m){tt(s,s.return,m)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,Rc(e,a))));break;case 19:Ca(t,e),ka(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Rc(e,n)));break;case 30:break;case 21:break;default:Ca(t,e),ka(e)}}function ka(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(h0(n)){a=n;break}n=n.return}if(a==null)throw Error(B(160));switch(a.tag){case 27:var r=a.stateNode,o=Nm(e);md(e,o,r);break;case 5:var i=a.stateNode;a.flags&32&&(Vi(i,""),a.flags&=-33);var l=Nm(e);md(e,l,i);break;case 3:case 4:var s=a.stateNode.containerInfo,u=Nm(e);Ch(e,u,s);break;default:throw Error(B(161))}}catch(c){tt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function I0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;I0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Kn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)w0(e,t.alternate,t),t=t.sibling}function So(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Xr(4,t,t.return),So(t);break;case 1:Dn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&p0(t,t.return,a),So(t);break;case 27:bs(t.stateNode);case 26:case 5:Dn(t,t.return),So(t);break;case 22:t.memoizedState===null&&So(t);break;case 30:So(t);break;default:So(t)}e=e.sibling}}function Yn(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:Yn(r,o,a),Vs(4,o);break;case 1:if(Yn(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){tt(n,n.return,u)}if(n=o,r=n.updateQueue,r!==null){var l=n.stateNode;try{var s=r.shared.hiddenCallbacks;if(s!==null)for(r.shared.hiddenCallbacks=null,r=0;r<s.length;r++)vI(s[r],l)}catch(u){tt(n,n.return,u)}}a&&i&64&&f0(o),ws(o,o.return);break;case 27:g0(o);case 26:case 5:Yn(r,o,a),a&&n===null&&i&4&&m0(o),ws(o,o.return);break;case 12:Yn(r,o,a);break;case 31:Yn(r,o,a),a&&i&4&&v0(r,o);break;case 13:Yn(r,o,a),a&&i&4&&b0(r,o);break;case 22:o.memoizedState===null&&Yn(r,o,a),ws(o,o.return);break;case 30:break;default:Yn(r,o,a)}t=t.sibling}}function Ig(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&&Hs(a))}function Cg(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Hs(e))}function yn(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)C0(e,t,a,n),t=t.sibling}function C0(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:yn(e,t,a,n),r&2048&&Vs(9,t);break;case 1:yn(e,t,a,n);break;case 3:yn(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&&Hs(e)));break;case 12:if(r&2048){yn(e,t,a,n),e=t.stateNode;try{var o=t.memoizedProps,i=o.id,l=o.onPostCommit;typeof l=="function"&&l(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(s){tt(t,t.return,s)}}else yn(e,t,a,n);break;case 31:yn(e,t,a,n);break;case 13:yn(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,i=t.alternate,t.memoizedState!==null?o._visibility&2?yn(e,t,a,n):ys(e,t):o._visibility&2?yn(e,t,a,n):(o._visibility|=2,bi(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Ig(i,t);break;case 24:yn(e,t,a,n),r&2048&&Cg(t.alternate,t);break;default:yn(e,t,a,n)}}function bi(e,t,a,n,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,i=t,l=a,s=n,u=i.flags;switch(i.tag){case 0:case 11:case 15:bi(o,i,l,s,r),Vs(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?bi(o,i,l,s,r):ys(o,i):(c._visibility|=2,bi(o,i,l,s,r)),r&&u&2048&&Ig(i.alternate,i);break;case 24:bi(o,i,l,s,r),r&&u&2048&&Cg(i.alternate,i);break;default:bi(o,i,l,s,r)}t=t.sibling}}function ys(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:ys(a,n),r&2048&&Ig(n.alternate,n);break;case 24:ys(a,n),r&2048&&Cg(n.alternate,n);break;default:ys(a,n)}t=t.sibling}}var ss=8192;function vi(e,t,a){if(e.subtreeFlags&ss)for(e=e.child;e!==null;)k0(e,t,a),e=e.sibling}function k0(e,t,a){switch(e.tag){case 26:vi(e,t,a),e.flags&ss&&e.memoizedState!==null&&EB(a,xn,e.memoizedState,e.memoizedProps);break;case 5:vi(e,t,a);break;case 3:case 4:var n=xn;xn=Sd(e.stateNode.containerInfo),vi(e,t,a),xn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=ss,ss=16777216,vi(e,t,a),ss=n):vi(e,t,a));break;default:vi(e,t,a)}}function T0(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 ts(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];Xt=n,E0(n,e)}T0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)L0(e),e=e.sibling}function L0(e){switch(e.tag){case 0:case 11:case 15:ts(e),e.flags&2048&&Xr(9,e,e.return);break;case 3:ts(e);break;case 12:ts(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$c(e)):ts(e);break;default:ts(e)}}function $c(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];Xt=n,E0(n,e)}T0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Xr(8,t,t.return),$c(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,$c(t));break;default:$c(t)}e=e.sibling}}function E0(e,t){for(;Xt!==null;){var a=Xt;switch(a.tag){case 0:case 11:case 15:Xr(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:Hs(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Xt=n;else e:for(a=e;Xt!==null;){n=Xt;var r=n.sibling,o=n.return;if(y0(n),n===a){Xt=null;break e}if(r!==null){r.return=o,Xt=r;break e}Xt=o}}}var WN={getCacheForType:function(e){var t=aa(Ut),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return aa(Ut).controller.signal}},GN=typeof WeakMap=="function"?WeakMap:Map,Ye=0,st=null,De=null,Pe=0,et=0,Pa=null,Or=!1,nl=!1,kg=!1,ur=0,Ct=0,Kr=0,Lo=0,Tg=0,Ua=0,Xi=0,xs=null,La=null,kh=!1,Ud=0,M0=0,hd=1/0,gd=null,qr=null,qt=0,Hr=null,Ki=null,rr=0,Th=0,Lh=null,A0=null,vs=0,Eh=null;function Ha(){return(Ye&2)!==0&&Pe!==0?Pe&-Pe:fe.T!==null?Eg():FS()}function R0(){if(Ua===0)if((Pe&536870912)===0||Ue){var e=bc;bc<<=1,(bc&3932160)===0&&(bc=262144),Ua=e}else Ua=536870912;return e=Va.current,e!==null&&(e.flags|=32),Ua}function Ea(e,t,a){(e===st&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(Yi(e,0),Pr(e,Pe,Ua,!1)),Fs(e,a),((Ye&2)===0||e!==st)&&(e===st&&((Ye&2)===0&&(Lo|=a),Ct===4&&Pr(e,Pe,Ua,!1)),Pn(e))}function D0(e,t,a){if((Ye&6)!==0)throw Error(B(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Us(e,t),r=n?KN(e,t):Um(e,t,!0),o=n;do{if(r===0){nl&&!n&&Pr(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!$N(a)){r=Um(e,t,!1),o=!1;continue}if(r===2){if(o=t,e.errorRecoveryDisabledLanes&o)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var l=e;r=xs;var s=l.current.memoizedState.isDehydrated;if(s&&(Yi(l,i).flags|=256),i=Um(l,i,!1),i!==2){if(kg&&!s){l.errorRecoveryDisabledLanes|=o,Lo|=o,r=4;break e}o=La,La=r,o!==null&&(La===null?La=o:La.push.apply(La,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){Yi(e,0),Pr(e,t,0,!0);break}e:{switch(n=e,o=r,o){case 0:case 1:throw Error(B(345));case 4:if((t&4194048)!==t)break;case 6:Pr(n,t,Ua,!Or);break e;case 2:La=null;break;case 3:case 5:break;default:throw Error(B(329))}if((t&62914560)===t&&(r=Ud+300-Fa(),10<r)){if(Pr(n,t,Ua,!Or),Ld(n,0,!0)!==0)break e;rr=t,n.timeoutHandle=Q0(Yb.bind(null,n,a,La,gd,kh,t,Ua,Lo,Xi,Or,o,"Throttled",-0,0),r);break e}Yb(n,a,La,gd,kh,t,Ua,Lo,Xi,Or,o,null,-0,0)}}break}while(!0);Pn(e)}function Yb(e,t,a,n,r,o,i,l,s,u,c,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:er},k0(t,o,d);var m=(o&62914560)===o?Ud-Fa():(o&4194048)===o?M0-Fa():0;if(m=MB(d,m),m!==null){rr=o,e.cancelPendingCommit=m(Qb.bind(null,e,t,o,a,n,r,i,l,s,c,d,null,f,p)),Pr(e,o,i,!u);return}}Qb(e,t,o,a,n,r,i,l,s)}function $N(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(!ja(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 Pr(e,t,a,n){t&=~Tg,t&=~Lo,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var o=31-qa(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&NS(e,a,t)}function Fd(){return(Ye&6)===0?(Ws(0,!1),!1):!0}function Lg(){if(De!==null){if(et===0)var e=De.return;else e=De,tr=Bo=null,fg(e),Fi=null,Es=0,e=De;for(;e!==null;)d0(e.alternate,e),e=e.return;De=null}}function Yi(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,dB(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),rr=0,Lg(),st=e,De=a=ar(e.current,null),Pe=t,et=0,Pa=null,Or=!1,nl=Us(e,t),kg=!1,Xi=Ua=Tg=Lo=Kr=Ct=0,La=xs=null,kh=!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-qa(n),o=1<<r;t|=e[r],n&=~o}return ur=t,Rd(),a}function _0(e,t){Se=null,fe.H=As,t===al||t===_d?(t=Eb(),et=3):t===og?(t=Eb(),et=4):et=t===bg?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Pa=t,De===null&&(Ct=1,fd(e,an(t,e.current)))}function O0(){var e=Va.current;return e===null?!0:(Pe&4194048)===Pe?rn===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===rn:!1}function P0(){var e=fe.H;return fe.H=As,e===null?As:e}function N0(){var e=fe.A;return fe.A=WN,e}function wd(){Ct=4,Or||(Pe&4194048)!==Pe&&Va.current!==null||(nl=!0),(Kr&134217727)===0&&(Lo&134217727)===0||st===null||Pr(st,Pe,Ua,!1)}function Um(e,t,a){var n=Ye;Ye|=2;var r=P0(),o=N0();(st!==e||Pe!==t)&&(gd=null,Yi(e,t)),t=!1;var i=Ct;e:do try{if(et!==0&&De!==null){var l=De,s=Pa;switch(et){case 8:Lg(),i=6;break e;case 3:case 2:case 9:case 6:Va.current===null&&(t=!0);var u=et;if(et=0,Pa=null,Oi(e,l,s,u),a&&nl){i=0;break e}break;default:u=et,et=0,Pa=null,Oi(e,l,s,u)}}XN(),i=Ct;break}catch(c){_0(e,c)}while(!0);return t&&e.shellSuspendCounter++,tr=Bo=null,Ye=n,fe.H=r,fe.A=o,De===null&&(st=null,Pe=0,Rd()),i}function XN(){for(;De!==null;)B0(De)}function KN(e,t){var a=Ye;Ye|=2;var n=P0(),r=N0();st!==e||Pe!==t?(gd=null,hd=Fa()+500,Yi(e,t)):nl=Us(e,t);e:do try{if(et!==0&&De!==null){t=De;var o=Pa;t:switch(et){case 1:et=0,Pa=null,Oi(e,t,o,1);break;case 2:case 9:if(Lb(o)){et=0,Pa=null,Zb(t);break}t=function(){et!==2&&et!==9||st!==e||(et=7),Pn(e)},o.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Lb(o)?(et=0,Pa=null,Zb(t)):(et=0,Pa=null,Oi(e,t,o,7));break;case 5:var i=null;switch(De.tag){case 26:i=De.memoizedState;case 5:case 27:var l=De;if(i?nC(i):l.stateNode.complete){et=0,Pa=null;var s=l.sibling;if(s!==null)De=s;else{var u=l.return;u!==null?(De=u,zd(u)):De=null}break t}}et=0,Pa=null,Oi(e,t,o,5);break;case 6:et=0,Pa=null,Oi(e,t,o,6);break;case 8:Lg(),Ct=6;break e;default:throw Error(B(462))}}YN();break}catch(c){_0(e,c)}while(!0);return tr=Bo=null,fe.H=n,fe.A=r,Ye=a,De!==null?0:(st=null,Pe=0,Rd(),Ct)}function YN(){for(;De!==null&&!xP();)B0(De)}function B0(e){var t=c0(e.alternate,e,ur);e.memoizedProps=e.pendingProps,t===null?zd(e):De=t}function Zb(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Vb(a,t,t.pendingProps,t.type,void 0,Pe);break;case 11:t=Vb(a,t,t.pendingProps,t.type.render,t.ref,Pe);break;case 5:fg(t);default:d0(a,t),t=De=dI(t,ur),t=c0(a,t,ur)}e.memoizedProps=e.pendingProps,t===null?zd(e):De=t}function Oi(e,t,a,n){tr=Bo=null,fg(t),Fi=null,Es=0;var r=t.return;try{if(UN(e,r,t,a,Pe)){Ct=1,fd(e,an(a,e.current)),De=null;return}}catch(o){if(r!==null)throw De=r,o;Ct=1,fd(e,an(a,e.current)),De=null;return}t.flags&32768?(Ue||n===1?e=!0:nl||(Pe&536870912)!==0?e=!1:(Or=e=!0,(n===2||n===9||n===3||n===6)&&(n=Va.current,n!==null&&n.tag===13&&(n.flags|=16384))),U0(t,e)):zd(t)}function zd(e){var t=e;do{if((t.flags&32768)!==0){U0(t,Or);return}e=t.return;var a=qN(t.alternate,t,ur);if(a!==null){De=a;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Ct===0&&(Ct=5)}function U0(e,t){do{var a=HN(e.alternate,e);if(a!==null){a.flags&=32767,De=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){De=e;return}De=e=a}while(e!==null);Ct=6,De=null}function Qb(e,t,a,n,r,o,i,l,s){e.cancelPendingCommit=null;do qd();while(qt!==0);if((Ye&6)!==0)throw Error(B(327));if(t!==null){if(t===e.current)throw Error(B(177));if(o=t.lanes|t.childLanes,o|=Qh,MP(e,a,o,i,l,s),e===st&&(De=st=null,Pe=0),Ki=t,Hr=e,rr=a,Th=o,Lh=r,A0=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,eB(td,function(){return j0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=fe.T,fe.T=null,r=Ze.p,Ze.p=2,i=Ye,Ye|=4;try{jN(e,t,a)}finally{Ye=i,Ze.p=r,fe.T=n}}qt=1,F0(),z0(),q0()}}function F0(){if(qt===1){qt=0;var e=Hr,t=Ki,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=fe.T,fe.T=null;var n=Ze.p;Ze.p=2;var r=Ye;Ye|=4;try{S0(t,e);var o=Dh,i=nI(e.containerInfo),l=o.focusedElem,s=o.selectionRange;if(i!==l&&l&&l.ownerDocument&&aI(l.ownerDocument.documentElement,l)){if(s!==null&&Zh(l)){var u=s.start,c=s.end;if(c===void 0&&(c=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(c,l.value.length);else{var d=l.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=l.textContent.length,x=Math.min(s.start,m),S=s.end===void 0?x:Math.min(s.end,m);!p.extend&&x>S&&(i=S,S=x,x=i);var w=vb(l,x),y=vb(l,S);if(w&&y&&(p.rangeCount!==1||p.anchorNode!==w.node||p.anchorOffset!==w.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var h=d.createRange();h.setStart(w.node,w.offset),p.removeAllRanges(),x>S?(p.addRange(h),p.extend(y.node,y.offset)):(h.setEnd(y.node,y.offset),p.addRange(h))}}}}for(d=[],p=l;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<d.length;l++){var b=d[l];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}kd=!!Rh,Dh=Rh=null}finally{Ye=r,Ze.p=n,fe.T=a}}e.current=t,qt=2}}function z0(){if(qt===2){qt=0;var e=Hr,t=Ki,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=fe.T,fe.T=null;var n=Ze.p;Ze.p=2;var r=Ye;Ye|=4;try{w0(e,t.alternate,t)}finally{Ye=r,Ze.p=n,fe.T=a}}qt=3}}function q0(){if(qt===4||qt===3){qt=0,vP();var e=Hr,t=Ki,a=rr,n=A0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?qt=5:(qt=0,Ki=Hr=null,H0(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(qr=null),Vh(a),t=t.stateNode,za&&typeof za.onCommitFiberRoot=="function")try{za.onCommitFiberRoot(Bs,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=fe.T,r=Ze.p,Ze.p=2,fe.T=null;try{for(var o=e.onRecoverableError,i=0;i<n.length;i++){var l=n[i];o(l.value,{componentStack:l.stack})}}finally{fe.T=t,Ze.p=r}}(rr&3)!==0&&qd(),Pn(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===Eh?vs++:(vs=0,Eh=e):vs=0,Ws(0,!1)}}function H0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Hs(t)))}function qd(){return F0(),z0(),q0(),j0()}function j0(){if(qt!==5)return!1;var e=Hr,t=Th;Th=0;var a=Vh(rr),n=fe.T,r=Ze.p;try{Ze.p=32>a?32:a,fe.T=null,a=Lh,Lh=null;var o=Hr,i=rr;if(qt=0,Ki=Hr=null,rr=0,(Ye&6)!==0)throw Error(B(331));var l=Ye;if(Ye|=4,L0(o.current),C0(o,o.current,i,a),Ye=l,Ws(0,!1),za&&typeof za.onPostCommitFiberRoot=="function")try{za.onPostCommitFiberRoot(Bs,o)}catch{}return!0}finally{Ze.p=r,fe.T=n,H0(e,t)}}function Jb(e,t,a){t=an(a,t),t=bh(e.stateNode,t,2),e=zr(e,t,2),e!==null&&(Fs(e,2),Pn(e))}function tt(e,t,a){if(e.tag===3)Jb(e,e,a);else for(;t!==null;){if(t.tag===3){Jb(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(qr===null||!qr.has(n))){e=an(a,e),a=r0(2),n=zr(t,a,2),n!==null&&(o0(a,n,t,e),Fs(n,2),Pn(n));break}}t=t.return}}function Fm(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new GN;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)||(kg=!0,r.add(a),e=ZN.bind(null,e,t,a),t.then(e,e))}function ZN(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,st===e&&(Pe&a)===a&&(Ct===4||Ct===3&&(Pe&62914560)===Pe&&300>Fa()-Ud?(Ye&2)===0&&Yi(e,0):Tg|=a,Xi===Pe&&(Xi=0)),Pn(e)}function V0(e,t){t===0&&(t=PS()),e=No(e,t),e!==null&&(Fs(e,t),Pn(e))}function QN(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),V0(e,a)}function JN(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(B(314))}n!==null&&n.delete(t),V0(e,a)}function eB(e,t){return Hh(e,t)}var yd=null,Si=null,Mh=!1,xd=!1,zm=!1,Nr=0;function Pn(e){e!==Si&&e.next===null&&(Si===null?yd=Si=e:Si=Si.next=e),xd=!0,Mh||(Mh=!0,aB())}function Ws(e,t){if(!zm&&xd){zm=!0;do for(var a=!1,n=yd;n!==null;){if(!t)if(e!==0){var r=n.pendingLanes;if(r===0)var o=0;else{var i=n.suspendedLanes,l=n.pingedLanes;o=(1<<31-qa(42|e)+1)-1,o&=r&~(i&~l),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,eS(n,o))}else o=Pe,o=Ld(n,n===st?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||Us(n,o)||(a=!0,eS(n,o));n=n.next}while(a);zm=!1}}function tB(){W0()}function W0(){xd=Mh=!1;var e=0;Nr!==0&&cB()&&(e=Nr);for(var t=Fa(),a=null,n=yd;n!==null;){var r=n.next,o=G0(n,t);o===0?(n.next=null,a===null?yd=r:a.next=r,r===null&&(Si=a)):(a=n,(e!==0||(o&3)!==0)&&(xd=!0)),n=r}qt!==0&&qt!==5||Ws(e,!1),Nr!==0&&(Nr=0)}function G0(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var i=31-qa(o),l=1<<i,s=r[i];s===-1?((l&a)===0||(l&n)!==0)&&(r[i]=EP(l,t)):s<=t&&(e.expiredLanes|=l),o&=~l}if(t=st,a=Pe,a=Ld(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(et===2||et===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&hm(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Us(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&hm(n),Vh(a)){case 2:case 8:a=_S;break;case 32:a=td;break;case 268435456:a=OS;break;default:a=td}return n=$0.bind(null,e),a=Hh(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&hm(n),e.callbackPriority=2,e.callbackNode=null,2}function $0(e,t){if(qt!==0&&qt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(qd()&&e.callbackNode!==a)return null;var n=Pe;return n=Ld(e,e===st?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(D0(e,n,t),G0(e,Fa()),e.callbackNode!=null&&e.callbackNode===a?$0.bind(null,e):null)}function eS(e,t){if(qd())return null;D0(e,t,!0)}function aB(){fB(function(){(Ye&6)!==0?Hh(DS,tB):W0()})}function Eg(){if(Nr===0){var e=Wi;e===0&&(e=vc,vc<<=1,(vc&261888)===0&&(vc=256)),Nr=e}return Nr}function tS(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Uc(""+e)}function aS(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 nB(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var o=tS((r[Ma]||null).action),i=n.submitter;i&&(t=(t=i[Ma]||null)?tS(t.formAction):i.getAttribute("formAction"),t!==null&&(o=t,i=null));var l=new Ed("action","action",null,n,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Nr!==0){var s=i?aS(r,i):new FormData(r);xh(a,{pending:!0,data:s,method:r.method,action:o},null,s)}}else typeof o=="function"&&(l.preventDefault(),s=i?aS(r,i):new FormData(r),xh(a,{pending:!0,data:s,method:r.method,action:o},o,s))},currentTarget:r}]})}}for(Dc=0;Dc<lh.length;Dc++)_c=lh[Dc],nS=_c.toLowerCase(),rS=_c[0].toUpperCase()+_c.slice(1),vn(nS,"on"+rS);var _c,nS,rS,Dc;vn(oI,"onAnimationEnd");vn(iI,"onAnimationIteration");vn(lI,"onAnimationStart");vn("dblclick","onDoubleClick");vn("focusin","onFocus");vn("focusout","onBlur");vn(bN,"onTransitionRun");vn(SN,"onTransitionStart");vn(IN,"onTransitionCancel");vn(sI,"onTransitionEnd");ji("onMouseEnter",["mouseout","mouseover"]);ji("onMouseLeave",["mouseout","mouseover"]);ji("onPointerEnter",["pointerout","pointerover"]);ji("onPointerLeave",["pointerout","pointerover"]);_o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));_o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));_o("onBeforeInput",["compositionend","keypress","textInput","paste"]);_o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));_o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));_o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rs="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(" "),rB=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rs));function X0(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],r=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var i=n.length-1;0<=i;i--){var l=n[i],s=l.instance,u=l.currentTarget;if(l=l.listener,s!==o&&r.isPropagationStopped())break e;o=l,r.currentTarget=u;try{o(r)}catch(c){nd(c)}r.currentTarget=null,o=s}else for(i=0;i<n.length;i++){if(l=n[i],s=l.instance,u=l.currentTarget,l=l.listener,s!==o&&r.isPropagationStopped())break e;o=l,r.currentTarget=u;try{o(r)}catch(c){nd(c)}r.currentTarget=null,o=s}}}}function Re(e,t){var a=t[Jm];a===void 0&&(a=t[Jm]=new Set);var n=e+"__bubble";a.has(n)||(K0(t,e,2,!1),a.add(n))}function qm(e,t,a){var n=0;t&&(n|=4),K0(a,e,n,t)}var Oc="_reactListening"+Math.random().toString(36).slice(2);function Mg(e){if(!e[Oc]){e[Oc]=!0,zS.forEach(function(a){a!=="selectionchange"&&(rB.has(a)||qm(a,!1,e),qm(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Oc]||(t[Oc]=!0,qm("selectionchange",!1,t))}}function K0(e,t,a,n){switch(sC(t)){case 2:var r=DB;break;case 8:r=_B;break;default:r=_g}a=r.bind(null,t,a,e),r=void 0,!rh||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 Hm(e,t,a,n,r){var o=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var i=n.tag;if(i===3||i===4){var l=n.stateNode.containerInfo;if(l===r)break;if(i===4)for(i=n.return;i!==null;){var s=i.tag;if((s===3||s===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;l!==null;){if(i=ki(l),i===null)return;if(s=i.tag,s===5||s===6||s===26||s===27){n=o=i;continue e}l=l.parentNode}}n=n.return}XS(function(){var u=o,c=$h(a),d=[];e:{var f=uI.get(e);if(f!==void 0){var p=Ed,m=e;switch(e){case"keypress":if(zc(a)===0)break e;case"keydown":case"keyup":p=JP;break;case"focusin":m="focus",p=vm;break;case"focusout":m="blur",p=vm;break;case"beforeblur":case"afterblur":p=vm;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=db;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=qP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=aN;break;case oI:case iI:case lI:p=VP;break;case sI:p=rN;break;case"scroll":case"scrollend":p=FP;break;case"wheel":p=iN;break;case"copy":case"cut":case"paste":p=GP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=pb;break;case"toggle":case"beforetoggle":p=sN}var x=(t&4)!==0,S=!x&&(e==="scroll"||e==="scrollend"),w=x?f!==null?f+"Capture":null:f;x=[];for(var y=u,h;y!==null;){var b=y;if(h=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||h===null||w===null||(b=Is(y,w),b!=null&&x.push(Ds(y,b,h))),S)break;y=y.return}0<x.length&&(f=new p(f,m,null,a,c),d.push({event:f,listeners:x}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&a!==nh&&(m=a.relatedTarget||a.fromElement)&&(ki(m)||m[Ji]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=a.relatedTarget||a.toElement,p=u,m=m?ki(m):null,m!==null&&(S=Ns(m),x=m.tag,m!==S||x!==5&&x!==27&&x!==6)&&(m=null)):(p=null,m=u),p!==m)){if(x=db,b="onMouseLeave",w="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=pb,b="onPointerLeave",w="onPointerEnter",y="pointer"),S=p==null?f:is(p),h=m==null?f:is(m),f=new x(b,y+"leave",p,a,c),f.target=S,f.relatedTarget=h,b=null,ki(c)===u&&(x=new x(w,y+"enter",m,a,c),x.target=h,x.relatedTarget=S,b=x),S=b,p&&m)t:{for(x=oB,w=p,y=m,h=0,b=w;b;b=x(b))h++;b=0;for(var T=y;T;T=x(T))b++;for(;0<h-b;)w=x(w),h--;for(;0<b-h;)y=x(y),b--;for(;h--;){if(w===y||y!==null&&w===y.alternate){x=w;break t}w=x(w),y=x(y)}x=null}else x=null;p!==null&&oS(d,f,p,x,!1),m!==null&&S!==null&&oS(d,S,m,x,!0)}}e:{if(f=u?is(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var C=wb;else if(gb(f))if(eI)C=yN;else{C=gN;var M=hN}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Gh(u.elementType)&&(C=wb):C=wN;if(C&&(C=C(e,u))){JS(d,C,a,c);break e}M&&M(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&ah(f,"number",f.value)}switch(M=u?is(u):window,e){case"focusin":(gb(M)||M.contentEditable==="true")&&(Ei=M,oh=u,ds=null);break;case"focusout":ds=oh=Ei=null;break;case"mousedown":ih=!0;break;case"contextmenu":case"mouseup":case"dragend":ih=!1,bb(d,a,c);break;case"selectionchange":if(vN)break;case"keydown":case"keyup":bb(d,a,c)}var D;if(Yh)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Li?ZS(e,a)&&(P="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(P="onCompositionStart");P&&(YS&&a.locale!=="ko"&&(Li||P!=="onCompositionStart"?P==="onCompositionEnd"&&Li&&(D=KS()):(_r=c,Xh="value"in _r?_r.value:_r.textContent,Li=!0)),M=vd(u,P),0<M.length&&(P=new fb(P,e,null,a,c),d.push({event:P,listeners:M}),D?P.data=D:(D=QS(a),D!==null&&(P.data=D)))),(D=cN?dN(e,a):fN(e,a))&&(P=vd(u,"onBeforeInput"),0<P.length&&(M=new fb("onBeforeInput","beforeinput",null,a,c),d.push({event:M,listeners:P}),M.data=D)),nB(d,e,u,a,c)}X0(d,t)})}function Ds(e,t,a){return{instance:e,listener:t,currentTarget:a}}function vd(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=Is(e,a),r!=null&&n.unshift(Ds(e,r,o)),r=Is(e,t),r!=null&&n.push(Ds(e,r,o))),e.tag===3)return n;e=e.return}return[]}function oB(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function oS(e,t,a,n,r){for(var o=t._reactName,i=[];a!==null&&a!==n;){var l=a,s=l.alternate,u=l.stateNode;if(l=l.tag,s!==null&&s===n)break;l!==5&&l!==26&&l!==27||u===null||(s=u,r?(u=Is(a,o),u!=null&&i.unshift(Ds(a,u,s))):r||(u=Is(a,o),u!=null&&i.push(Ds(a,u,s)))),a=a.return}i.length!==0&&e.push({event:t,listeners:i})}var iB=/\r\n?/g,lB=/\u0000|\uFFFD/g;function iS(e){return(typeof e=="string"?e:""+e).replace(iB,`
|
|
9
|
-
`).replace(lB,"")}function Y0(e,t){return t=iS(t),iS(e)===t}function ot(e,t,a,n,r,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Vi(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Vi(e,""+n);break;case"className":Ic(e,"class",n);break;case"tabIndex":Ic(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Ic(e,a,n);break;case"style":$S(e,n,o);break;case"data":if(t!=="object"){Ic(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=Uc(""+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"&&ot(e,t,"name",r.name,r,null),ot(e,t,"formEncType",r.formEncType,r,null),ot(e,t,"formMethod",r.formMethod,r,null),ot(e,t,"formTarget",r.formTarget,r,null)):(ot(e,t,"encType",r.encType,r,null),ot(e,t,"method",r.method,r,null),ot(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Uc(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=er);break;case"onScroll":n!=null&&Re("scroll",e);break;case"onScrollEnd":n!=null&&Re("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(B(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(B(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=Uc(""+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":Re("beforetoggle",e),Re("toggle",e),Bc(e,"popover",n);break;case"xlinkActuate":Gn(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Gn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Gn(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Gn(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Gn(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Gn(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Bc(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=BP.get(a)||a,Bc(e,a,n))}}function Ah(e,t,a,n,r,o){switch(a){case"style":$S(e,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(B(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(B(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Vi(e,n):(typeof n=="number"||typeof n=="bigint")&&Vi(e,""+n);break;case"onScroll":n!=null&&Re("scroll",e);break;case"onScrollEnd":n!=null&&Re("scrollend",e);break;case"onClick":n!=null&&(e.onclick=er);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qS.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),o=e[Ma]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,r),typeof n=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,r);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Bc(e,a,n)}}}function na(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",e),Re("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(B(137,t));default:ot(e,t,o,i,a,null)}}r&&ot(e,t,"srcSet",a.srcSet,a,null),n&&ot(e,t,"src",a.src,a,null);return;case"input":Re("invalid",e);var l=o=i=r=null,s=null,u=null;for(n in a)if(a.hasOwnProperty(n)){var c=a[n];if(c!=null)switch(n){case"name":r=c;break;case"type":i=c;break;case"checked":s=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":l=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(B(137,t));break;default:ot(e,t,n,c,a,null)}}VS(e,o,l,s,u,i,r,!1);return;case"select":Re("invalid",e),n=i=o=null;for(r in a)if(a.hasOwnProperty(r)&&(l=a[r],l!=null))switch(r){case"value":o=l;break;case"defaultValue":i=l;break;case"multiple":n=l;default:ot(e,t,r,l,a,null)}t=o,a=i,e.multiple=!!n,t!=null?Ni(e,!!n,t,!1):a!=null&&Ni(e,!!n,a,!0);return;case"textarea":Re("invalid",e),o=r=n=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":n=l;break;case"defaultValue":r=l;break;case"children":o=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(B(91));break;default:ot(e,t,i,l,a,null)}GS(e,n,r,o);return;case"option":for(s in a)a.hasOwnProperty(s)&&(n=a[s],n!=null)&&(s==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":ot(e,t,s,n,a,null));return;case"dialog":Re("beforetoggle",e),Re("toggle",e),Re("cancel",e),Re("close",e);break;case"iframe":case"object":Re("load",e);break;case"video":case"audio":for(n=0;n<Rs.length;n++)Re(Rs[n],e);break;case"image":Re("error",e),Re("load",e);break;case"details":Re("toggle",e);break;case"embed":case"source":case"link":Re("error",e),Re("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(B(137,t));default:ot(e,t,u,n,a,null)}return;default:if(Gh(t)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Ah(e,t,c,n,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(n=a[l],n!=null&&ot(e,t,l,n,a,null))}function sB(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,i=null,l=null,s=null,u=null,c=null;for(p in a){var d=a[p];if(a.hasOwnProperty(p)&&d!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":s=d;default:n.hasOwnProperty(p)||ot(e,t,p,null,n,d)}}for(var f in n){var p=n[f];if(d=a[f],n.hasOwnProperty(f)&&(p!=null||d!=null))switch(f){case"type":o=p;break;case"name":r=p;break;case"checked":u=p;break;case"defaultChecked":c=p;break;case"value":i=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(B(137,t));break;default:p!==d&&ot(e,t,f,p,n,d)}}th(e,i,l,s,u,c,o,r);return;case"select":p=i=l=f=null;for(o in a)if(s=a[o],a.hasOwnProperty(o)&&s!=null)switch(o){case"value":break;case"multiple":p=s;default:n.hasOwnProperty(o)||ot(e,t,o,null,n,s)}for(r in n)if(o=n[r],s=a[r],n.hasOwnProperty(r)&&(o!=null||s!=null))switch(r){case"value":f=o;break;case"defaultValue":l=o;break;case"multiple":i=o;default:o!==s&&ot(e,t,r,o,n,s)}t=l,a=i,n=p,f!=null?Ni(e,!!a,f,!1):!!n!=!!a&&(t!=null?Ni(e,!!a,t,!0):Ni(e,!!a,a?[]:"",!1));return;case"textarea":p=f=null;for(l in a)if(r=a[l],a.hasOwnProperty(l)&&r!=null&&!n.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:ot(e,t,l,null,n,r)}for(i in n)if(r=n[i],o=a[i],n.hasOwnProperty(i)&&(r!=null||o!=null))switch(i){case"value":f=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(B(91));break;default:r!==o&&ot(e,t,i,r,n,o)}WS(e,f,p);return;case"option":for(var m in a)f=a[m],a.hasOwnProperty(m)&&f!=null&&!n.hasOwnProperty(m)&&(m==="selected"?e.selected=!1:ot(e,t,m,null,n,f));for(s in n)f=n[s],p=a[s],n.hasOwnProperty(s)&&f!==p&&(f!=null||p!=null)&&(s==="selected"?e.selected=f&&typeof f!="function"&&typeof f!="symbol":ot(e,t,s,f,n,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var x in a)f=a[x],a.hasOwnProperty(x)&&f!=null&&!n.hasOwnProperty(x)&&ot(e,t,x,null,n,f);for(u in n)if(f=n[u],p=a[u],n.hasOwnProperty(u)&&f!==p&&(f!=null||p!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(B(137,t));break;default:ot(e,t,u,f,n,p)}return;default:if(Gh(t)){for(var S in a)f=a[S],a.hasOwnProperty(S)&&f!==void 0&&!n.hasOwnProperty(S)&&Ah(e,t,S,void 0,n,f);for(c in n)f=n[c],p=a[c],!n.hasOwnProperty(c)||f===p||f===void 0&&p===void 0||Ah(e,t,c,f,n,p);return}}for(var w in a)f=a[w],a.hasOwnProperty(w)&&f!=null&&!n.hasOwnProperty(w)&&ot(e,t,w,null,n,f);for(d in n)f=n[d],p=a[d],!n.hasOwnProperty(d)||f===p||f==null&&p==null||ot(e,t,d,f,n,p)}function lS(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uB(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var r=a[n],o=r.transferSize,i=r.initiatorType,l=r.duration;if(o&&l&&lS(i)){for(i=0,l=r.responseEnd,n+=1;n<a.length;n++){var s=a[n],u=s.startTime;if(u>l)break;var c=s.transferSize,d=s.initiatorType;c&&lS(d)&&(s=s.responseEnd,i+=c*(s<l?1:(l-u)/(s-u)))}if(--n,t+=8*(o+i)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Rh=null,Dh=null;function bd(e){return e.nodeType===9?e:e.ownerDocument}function sS(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 Z0(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 _h(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 jm=null;function cB(){var e=window.event;return e&&e.type==="popstate"?e===jm?!1:(jm=e,!0):(jm=null,!1)}var Q0=typeof setTimeout=="function"?setTimeout:void 0,dB=typeof clearTimeout=="function"?clearTimeout:void 0,uS=typeof Promise=="function"?Promise:void 0,fB=typeof queueMicrotask=="function"?queueMicrotask:typeof uS<"u"?function(e){return uS.resolve(null).then(e).catch(pB)}:Q0;function pB(e){setTimeout(function(){throw e})}function Zr(e){return e==="head"}function cS(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),Qi(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")bs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,bs(a);for(var o=a.firstChild;o;){var i=o.nextSibling,l=o.nodeName;o[zs]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&bs(e.ownerDocument.body);a=r}while(a);Qi(t)}function dS(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 Oh(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":Oh(a),Wh(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function mB(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[zs])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 hB(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 J0(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 Ph(e){return e.data==="$?"||e.data==="$~"}function Nh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function gB(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 Bh=null;function fS(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 pS(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 eC(e,t,a){switch(t=bd(a),e){case"html":if(e=t.documentElement,!e)throw Error(B(452));return e;case"head":if(e=t.head,!e)throw Error(B(453));return e;case"body":if(e=t.body,!e)throw Error(B(454));return e;default:throw Error(B(451))}}function bs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Wh(e)}var ln=new Map,mS=new Set;function Sd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var cr=Ze.d;Ze.d={f:wB,r:yB,D:xB,C:vB,L:bB,m:SB,X:CB,S:IB,M:kB};function wB(){var e=cr.f(),t=Fd();return e||t}function yB(e){var t=el(e);t!==null&&t.tag===5&&t.type==="form"?$I(t):cr.r(e)}var rl=typeof document>"u"?null:document;function tC(e,t,a){var n=rl;if(n&&typeof t=="string"&&t){var r=tn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),mS.has(r)||(mS.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),na(t,"link",e),Kt(t),n.head.appendChild(t)))}}function xB(e){cr.D(e),tC("dns-prefetch",e,null)}function vB(e,t){cr.C(e,t),tC("preconnect",e,t)}function bB(e,t,a){cr.L(e,t,a);var n=rl;if(n&&e&&t){var r='link[rel="preload"][as="'+tn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+tn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+tn(a.imageSizes)+'"]')):r+='[href="'+tn(e)+'"]';var o=r;switch(t){case"style":o=Zi(e);break;case"script":o=ol(e)}ln.has(o)||(e=mt({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ln.set(o,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(Gs(o))||t==="script"&&n.querySelector($s(o))||(t=n.createElement("link"),na(t,"link",e),Kt(t),n.head.appendChild(t)))}}function SB(e,t){cr.m(e,t);var a=rl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+tn(n)+'"][href="'+tn(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ol(e)}if(!ln.has(o)&&(e=mt({rel:"modulepreload",href:e},t),ln.set(o,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($s(o)))return}n=a.createElement("link"),na(n,"link",e),Kt(n),a.head.appendChild(n)}}}function IB(e,t,a){cr.S(e,t,a);var n=rl;if(n&&e){var r=Pi(n).hoistableStyles,o=Zi(e);t=t||"default";var i=r.get(o);if(!i){var l={loading:0,preload:null};if(i=n.querySelector(Gs(o)))l.loading=5;else{e=mt({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ln.get(o))&&Ag(e,a);var s=i=n.createElement("link");Kt(s),na(s,"link",e),s._p=new Promise(function(u,c){s.onload=u,s.onerror=c}),s.addEventListener("load",function(){l.loading|=1}),s.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Xc(i,t,n)}i={type:"stylesheet",instance:i,count:1,state:l},r.set(o,i)}}}function CB(e,t){cr.X(e,t);var a=rl;if(a&&e){var n=Pi(a).hoistableScripts,r=ol(e),o=n.get(r);o||(o=a.querySelector($s(r)),o||(e=mt({src:e,async:!0},t),(t=ln.get(r))&&Rg(e,t),o=a.createElement("script"),Kt(o),na(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function kB(e,t){cr.M(e,t);var a=rl;if(a&&e){var n=Pi(a).hoistableScripts,r=ol(e),o=n.get(r);o||(o=a.querySelector($s(r)),o||(e=mt({src:e,async:!0,type:"module"},t),(t=ln.get(r))&&Rg(e,t),o=a.createElement("script"),Kt(o),na(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function hS(e,t,a,n){var r=(r=Br.current)?Sd(r):null;if(!r)throw Error(B(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Zi(a.href),a=Pi(r).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Zi(a.href);var o=Pi(r).hoistableStyles,i=o.get(e);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,i),(o=r.querySelector(Gs(e)))&&!o._p&&(i.instance=o,i.state.loading=5),ln.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},ln.set(e,a),o||TB(r,e,a,i.state))),t&&n===null)throw Error(B(528,""));return i}if(t&&n!==null)throw Error(B(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ol(a),a=Pi(r).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(B(444,e))}}function Zi(e){return'href="'+tn(e)+'"'}function Gs(e){return'link[rel="stylesheet"]['+e+"]"}function aC(e){return mt({},e,{"data-precedence":e.precedence,precedence:null})}function TB(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}),na(t,"link",a),Kt(t),e.head.appendChild(t))}function ol(e){return'[src="'+tn(e)+'"]'}function $s(e){return"script[async]"+e}function gS(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+tn(a.href)+'"]');if(n)return t.instance=n,Kt(n),n;var r=mt({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Kt(n),na(n,"style",r),Xc(n,a.precedence,e),t.instance=n;case"stylesheet":r=Zi(a.href);var o=e.querySelector(Gs(r));if(o)return t.state.loading|=4,t.instance=o,Kt(o),o;n=aC(a),(r=ln.get(r))&&Ag(n,r),o=(e.ownerDocument||e).createElement("link"),Kt(o);var i=o;return i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),na(o,"link",n),t.state.loading|=4,Xc(o,a.precedence,e),t.instance=o;case"script":return o=ol(a.src),(r=e.querySelector($s(o)))?(t.instance=r,Kt(r),r):(n=a,(r=ln.get(o))&&(n=mt({},a),Rg(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),Kt(r),na(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(B(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Xc(n,a.precedence,e));return t.instance}function Xc(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,o=r,i=0;i<n.length;i++){var l=n[i];if(l.dataset.precedence===t)o=l;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Ag(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Rg(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Kc=null;function wS(e,t,a){if(Kc===null){var n=new Map,r=Kc=new Map;r.set(a,n)}else r=Kc,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[zs]||o[ea]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(t)||"";i=e+i;var l=n.get(i);l?l.push(o):n.set(i,[o])}}return n}function yS(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function LB(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 nC(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function EB(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=Zi(n.href),o=t.querySelector(Gs(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Id.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,Kt(o);return}o=t.ownerDocument||t,n=aC(n),(r=ln.get(r))&&Ag(n,r),o=o.createElement("link"),Kt(o);var i=o;i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),na(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=Id.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Vm=0;function MB(e,t){return e.stylesheets&&e.count===0&&Yc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&Yc(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Vm===0&&(Vm=62500*uB());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Yc(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Vm?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function Id(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Cd=null;function Yc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Cd=new Map,t.forEach(AB,e),Cd=null,Id.call(e))}function AB(e,t){if(!(t.state.loading&4)){var a=Cd.get(e);if(a)var n=a.get(null);else{a=new Map,Cd.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=Id.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 _s={$$typeof:Jn,Provider:null,Consumer:null,_currentValue:Io,_currentValue2:Io,_threadCount:0};function RB(e,t,a,n,r,o,i,l,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=gm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gm(0),this.hiddenUpdates=gm(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function rC(e,t,a,n,r,o,i,l,s,u,c,d){return e=new RB(e,t,a,i,s,u,c,d,l),t=1,o===!0&&(t|=24),o=Ba(3,null,null,t),e.current=o,o.stateNode=e,t=ng(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},ig(o),e}function oC(e){return e?(e=Ri,e):Ri}function iC(e,t,a,n,r,o){r=oC(r),n.context===null?n.context=r:n.pendingContext=r,n=Fr(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=zr(e,n,t),a!==null&&(Ea(a,e,t),ps(a,e,t))}function xS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Dg(e,t){xS(e,t),(e=e.alternate)&&xS(e,t)}function lC(e){if(e.tag===13||e.tag===31){var t=No(e,67108864);t!==null&&Ea(t,e,67108864),Dg(e,67108864)}}function vS(e){if(e.tag===13||e.tag===31){var t=Ha();t=jh(t);var a=No(e,t);a!==null&&Ea(a,e,t),Dg(e,t)}}var kd=!0;function DB(e,t,a,n){var r=fe.T;fe.T=null;var o=Ze.p;try{Ze.p=2,_g(e,t,a,n)}finally{Ze.p=o,fe.T=r}}function _B(e,t,a,n){var r=fe.T;fe.T=null;var o=Ze.p;try{Ze.p=8,_g(e,t,a,n)}finally{Ze.p=o,fe.T=r}}function _g(e,t,a,n){if(kd){var r=Uh(n);if(r===null)Hm(e,t,n,Td,a),bS(e,n);else if(PB(r,e,t,a,n))n.stopPropagation();else if(bS(e,n),t&4&&-1<OB.indexOf(e)){for(;r!==null;){var o=el(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=vo(o.pendingLanes);if(i!==0){var l=o;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var s=1<<31-qa(i);l.entanglements[1]|=s,i&=~s}Pn(o),(Ye&6)===0&&(hd=Fa()+500,Ws(0,!1))}}break;case 31:case 13:l=No(o,2),l!==null&&Ea(l,o,2),Fd(),Dg(o,2)}if(o=Uh(n),o===null&&Hm(e,t,n,Td,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else Hm(e,t,n,null,a)}}function Uh(e){return e=$h(e),Og(e)}var Td=null;function Og(e){if(Td=null,e=ki(e),e!==null){var t=Ns(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=LS(t),e!==null)return e;e=null}else if(a===31){if(e=ES(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 Td=e,null}function sC(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(bP()){case DS:return 2;case _S:return 8;case td:case SP:return 32;case OS:return 268435456;default:return 32}default:return 32}}var Fh=!1,jr=null,Vr=null,Wr=null,Os=new Map,Ps=new Map,Rr=[],OB="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 bS(e,t){switch(e){case"focusin":case"focusout":jr=null;break;case"dragenter":case"dragleave":Vr=null;break;case"mouseover":case"mouseout":Wr=null;break;case"pointerover":case"pointerout":Os.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ps.delete(t.pointerId)}}function as(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=el(t),t!==null&&lC(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function PB(e,t,a,n,r){switch(t){case"focusin":return jr=as(jr,e,t,a,n,r),!0;case"dragenter":return Vr=as(Vr,e,t,a,n,r),!0;case"mouseover":return Wr=as(Wr,e,t,a,n,r),!0;case"pointerover":var o=r.pointerId;return Os.set(o,as(Os.get(o)||null,e,t,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,Ps.set(o,as(Ps.get(o)||null,e,t,a,n,r)),!0}return!1}function uC(e){var t=ki(e.target);if(t!==null){var a=Ns(t);if(a!==null){if(t=a.tag,t===13){if(t=LS(a),t!==null){e.blockedOn=t,rb(e.priority,function(){vS(a)});return}}else if(t===31){if(t=ES(a),t!==null){e.blockedOn=t,rb(e.priority,function(){vS(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 Zc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Uh(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);nh=n,a.target.dispatchEvent(n),nh=null}else return t=el(a),t!==null&&lC(t),e.blockedOn=a,!1;t.shift()}return!0}function SS(e,t,a){Zc(e)&&a.delete(t)}function NB(){Fh=!1,jr!==null&&Zc(jr)&&(jr=null),Vr!==null&&Zc(Vr)&&(Vr=null),Wr!==null&&Zc(Wr)&&(Wr=null),Os.forEach(SS),Ps.forEach(SS)}function Pc(e,t){e.blockedOn===t&&(e.blockedOn=null,Fh||(Fh=!0,Ht.unstable_scheduleCallback(Ht.unstable_NormalPriority,NB)))}var Nc=null;function IS(e){Nc!==e&&(Nc=e,Ht.unstable_scheduleCallback(Ht.unstable_NormalPriority,function(){Nc===e&&(Nc=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(Og(n||a)===null)continue;break}var o=el(a);o!==null&&(e.splice(t,3),t-=3,xh(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function Qi(e){function t(s){return Pc(s,e)}jr!==null&&Pc(jr,e),Vr!==null&&Pc(Vr,e),Wr!==null&&Pc(Wr,e),Os.forEach(t),Ps.forEach(t);for(var a=0;a<Rr.length;a++){var n=Rr[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Rr.length&&(a=Rr[0],a.blockedOn===null);)uC(a),a.blockedOn===null&&Rr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],o=a[n+1],i=r[Ma]||null;if(typeof o=="function")i||IS(a);else if(i){var l=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[Ma]||null)l=i.formAction;else if(Og(r)!==null)continue}else l=i.action;typeof l=="function"?a[n+1]=l:(a.splice(n,3),n-=3),IS(a)}}}function cC(){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 Pg(e){this._internalRoot=e}Hd.prototype.render=Pg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));var a=t.current,n=Ha();iC(a,n,e,t,null,null)};Hd.prototype.unmount=Pg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;iC(e.current,2,null,e,null,null),Fd(),t[Ji]=null}};function Hd(e){this._internalRoot=e}Hd.prototype.unstable_scheduleHydration=function(e){if(e){var t=FS();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Rr.length&&t!==0&&t<Rr[a].priority;a++);Rr.splice(a,0,e),a===0&&uC(e)}};var CS=kS.version;if(CS!=="19.2.4")throw Error(B(527,CS,"19.2.4"));Ze.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=mP(t),e=e!==null?MS(e):null,e=e===null?null:e.stateNode,e};var BB={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:fe,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ns=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ns.isDisabled&&ns.supportsFiber))try{Bs=ns.inject(BB),za=ns}catch{}var ns;jd.createRoot=function(e,t){if(!TS(e))throw Error(B(299));var a=!1,n="",r=t0,o=a0,i=n0;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=rC(e,1,!1,null,null,a,n,null,r,o,i,cC),e[Ji]=t.current,Mg(e),new Pg(t)};jd.hydrateRoot=function(e,t,a){if(!TS(e))throw Error(B(299));var n=!1,r="",o=t0,i=a0,l=n0,s=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(i=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(s=a.formState)),t=rC(e,1,!0,t,a??null,n,r,s,o,i,l,cC),t.context=oC(null),a=t.current,n=Ha(),n=jh(n),r=Fr(n),r.callback=null,zr(a,r,n),a=n,t.current.lanes=a,Fs(t,a),Pn(t),e[Ji]=t.current,Mg(e),new Hd(t)};jd.version="19.2.4"});var Ng=oa((aW,pC)=>{"use strict";function fC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fC)}catch(e){console.error(e)}}fC(),pC.exports=dC()});var HC=oa(ef=>{"use strict";var a3=Symbol.for("react.transitional.element"),n3=Symbol.for("react.fragment");function qC(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:a3,type:e,key:n,ref:t!==void 0?t:null,props:a}}ef.Fragment=n3;ef.jsx=qC;ef.jsxs=qC});var ae=oa((t$,jC)=>{"use strict";jC.exports=HC()});function VC(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=VC(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function af(){for(var e,t,a=0,n="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=VC(e))&&(n&&(n+=" "),n+=t);return n}var Yg=k(()=>{"use strict"});function Zg(...e){return e.filter(Boolean).join(" ")}function WC(){return Zg}var Qg=k(()=>{"use strict"});function k3(e){let t=[],a=-1;for(;++a<e.length;)t[a]=Jr(e[a]);return sf(n);function n(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function T3(e){let t=e;return sf(a);function a(n){let r=n,o;for(o in e)if(r[o]!==t[o])return!1;return!0}}function L3(e){return sf(t);function t(a){return a&&a.type===e}}function sf(e){return t;function t(a,n,r){return!!(M3(a)&&e.call(this,a,typeof n=="number"?n:void 0,r||void 0))}}function E3(){return!0}function M3(e){return e!==null&&typeof e=="object"&&"type"in e}var Jr,Dk=k(()=>{"use strict";Jr=(function(e){if(e==null)return E3;if(typeof e=="function")return sf(e);if(typeof e=="object")return Array.isArray(e)?k3(e):T3(e);if(typeof e=="string")return L3(e);throw new Error("Expected function, string, or object as test")})});var uf=k(()=>{"use strict";Dk()});function du(e,t,a,n){let r;typeof t=="function"&&typeof a!="function"?(n=a,a=t):r=t;let o=Jr(r),i=n?-1:1;l(e,void 0,[])();function l(s,u,c){let d=s&&typeof s=="object"?s:{};if(typeof d.type=="string"){let p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(s.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=_k,m,x,S;if((!t||o(s,u,c[c.length-1]||void 0))&&(p=A3(a(s,c)),p[0]===jo))return p;if("children"in s&&s.children){let w=s;if(w.children&&p[0]!==Vo)for(x=(n?w.children.length:-1)+i,S=c.concat(w);x>-1&&x<w.children.length;){let y=w.children[x];if(m=l(y,x,S)(),m[0]===jo)return m;x=typeof m[1]=="number"?m[1]:x+i}}return p}}}function A3(e){return Array.isArray(e)?e:typeof e=="number"?[pr,e]:e==null?_k:[e]}var _k,pr,jo,Vo,Ok=k(()=>{"use strict";uf();_k=[],pr=!0,jo=!1,Vo="skip"});var cf=k(()=>{"use strict";Ok()});function mr(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),du(e,o,l,r);function l(s,u){let c=u[u.length-1],d=c?c.children.indexOf(s):void 0;return i(s,d,c)}}var Pk=k(()=>{"use strict";cf();cf()});var df=k(()=>{"use strict";Pk()});function Uk({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:a=[],allowDataImages:n=!1,allowedProtocols:r=[],blockedImageClass:o="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:i="text-gray-500"}){let l=t.length&&!t.every(u=>u==="*"),s=a.length&&!a.every(u=>u==="*");if(!e&&(l||s))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return u=>{let c=O3(e,t,a,n,r,o,i);mr(u,c)}}function Nk(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 R3(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function Bk(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=Nk(e,a);if(!i||_3.has(i.protocol)||!(D3.has(i.protocol)||o.includes(i.protocol)||o.includes("*")))return null;if(i.protocol==="mailto:"||!i.protocol.match(/^https?:$/))return i.href;let s=R3(e);return i&&t.some(u=>{let c=Nk(u,a);return!c||c.origin!==i.origin?!1:i.href.startsWith(c.href)})?s?i.pathname+i.search+i.hash:i.href:t.includes("*")?i.protocol!=="https:"&&i.protocol!=="http:"?null:s?i.pathname+i.search+i.hash:i.href:null}var D3,_3,rw,O3,Fk=k(()=>{"use strict";df();D3=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),_3=new Set(["javascript:","data:","file:","vbscript:"]);rw=Symbol("node-seen"),O3=(e,t,a,n,r,o,i)=>{let l=(s,u,c)=>{if(s.type!=="element"||s[rw])return pr;if(s.tagName==="a"){let d=Bk(s.properties.href,t,e,!1,!1,r);return d===null?(s[rw]=!0,mr(s,l),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(s.properties.href),class:i},children:[...s.children,{type:"text",value:" [blocked]"}]}),Vo):(s.properties.href=d,s.properties.target="_blank",s.properties.rel="noopener noreferrer",pr)}if(s.tagName==="img"){let d=Bk(s.properties.src,a,e,n,!0,r);return d===null?(s[rw]=!0,mr(s,l),c&&typeof u=="number"&&(c.children[u]={type:"element",tagName:"span",properties:{class:o},children:[{type:"text",value:"[Image blocked: "+String(s.properties.alt||"No description")+"]"}]}),Vo):(s.properties.src=d,pr)}return pr};return l}});function P3(){return e=>e}var zk,qk=k(()=>{"use strict";zk=P3});var Hk,F3,lw,$k=k(()=>{"use strict";Hk=typeof self=="object"?self:globalThis,F3=(e,t)=>{let a=(r,o)=>(e.set(o,r),r),n=r=>{if(e.has(r))return e.get(r);let[o,i]=t[r];switch(o){case 0:case-1:return a(i,r);case 1:{let l=a([],r);for(let s of i)l.push(n(s));return l}case 2:{let l=a({},r);for(let[s,u]of i)l[n(s)]=n(u);return l}case 3:return a(new Date(i),r);case 4:{let{source:l,flags:s}=i;return a(new RegExp(l,s),r)}case 5:{let l=a(new Map,r);for(let[s,u]of i)l.set(n(s),n(u));return l}case 6:{let l=a(new Set,r);for(let s of i)l.add(n(s));return l}case 7:{let{name:l,message:s}=i;return a(new Hk[l](s),r)}case 8:return a(BigInt(i),r);case"BigInt":return a(Object(BigInt(i)),r);case"ArrayBuffer":return a(new Uint8Array(i).buffer,i);case"DataView":{let{buffer:l}=new Uint8Array(i);return a(new DataView(l),i)}}return a(new Hk[o](i),r)};return n},lw=e=>F3(new Map,e)(0)});var wl,z3,q3,fu,pf,H3,sw,Xk=k(()=>{"use strict";wl="",{toString:z3}={},{keys:q3}=Object,fu=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let a=z3.call(e).slice(8,-1);switch(a){case"Array":return[1,wl];case"Object":return[2,wl];case"Date":return[3,wl];case"RegExp":return[4,wl];case"Map":return[5,wl];case"Set":return[6,wl];case"DataView":return[1,a]}return a.includes("Array")?[1,a]:a.includes("Error")?[7,a]:[2,a]},pf=([e,t])=>e===0&&(t==="function"||t==="symbol"),H3=(e,t,a,n)=>{let r=(i,l)=>{let s=n.push(i)-1;return a.set(l,s),s},o=i=>{if(a.has(i))return a.get(i);let[l,s]=fu(i);switch(l){case 0:{let c=i;switch(s){case"bigint":l=8,c=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);c=null;break;case"undefined":return r([-1],i)}return r([l,c],i)}case 1:{if(s){let f=i;return s==="DataView"?f=new Uint8Array(i.buffer):s==="ArrayBuffer"&&(f=new Uint8Array(i)),r([s,[...f]],i)}let c=[],d=r([l,c],i);for(let f of i)c.push(o(f));return d}case 2:{if(s)switch(s){case"BigInt":return r([s,i.toString()],i);case"Boolean":case"Number":case"String":return r([s,i.valueOf()],i)}if(t&&"toJSON"in i)return o(i.toJSON());let c=[],d=r([l,c],i);for(let f of q3(i))(e||!pf(fu(i[f])))&&c.push([o(f),o(i[f])]);return d}case 3:return r([l,i.toISOString()],i);case 4:{let{source:c,flags:d}=i;return r([l,{source:c,flags:d}],i)}case 5:{let c=[],d=r([l,c],i);for(let[f,p]of i)(e||!(pf(fu(f))||pf(fu(p))))&&c.push([o(f),o(p)]);return d}case 6:{let c=[],d=r([l,c],i);for(let f of i)(e||!pf(fu(f)))&&c.push(o(f));return d}}let{message:u}=i;return r([l,{name:s,message:u}],i)};return o},sw=(e,{json:t,lossy:a}={})=>{let n=[];return H3(!(t||a),!!t,new Map,n)(e),n}});var eo,mf=k(()=>{"use strict";$k();Xk();eo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?lw(sw(e,t)):structuredClone(e):(e,t)=>lw(sw(e,t))});function Kk(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 pu(e){let t=yl(e),a=hf(e);if(t&&a)return{start:t,end:a}}var hf,yl,Yk=k(()=>{"use strict";hf=Kk("end"),yl=Kk("start")});var mu=k(()=>{"use strict";Yk()});var Wo,uw,Zk=k(()=>{"use strict";Wo=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],uw={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Wo,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Wo],h2:[["className","sr-only"]],img:[...Wo,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Wo,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Wo],table:[...Wo],ul:[...Wo,["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 cw(e,t){let a={type:"root",children:[]},n={schema:t?{...uw,...t}:uw,stack:[]},r=eT(n,e);return r&&(Array.isArray(r)?r.length===1?a=r[0]:a.children=r:a=r),a}function eT(e,t){if(t&&typeof t=="object"){let a=t;switch(typeof a.type=="string"?a.type:""){case"comment":return j3(e,a);case"doctype":return V3(e,a);case"element":return W3(e,a);case"root":return G3(e,a);case"text":return $3(e,a);default:}}}function j3(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 hu(o,t),o}}function V3(e,t){if(e.schema.allowDoctypes){let a={type:"doctype"};return hu(a,t),a}}function W3(e,t){let a=typeof t.tagName=="string"?t.tagName:"";e.stack.push(a);let n=tT(e,t.children),r=X3(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&&to.call(e.schema.ancestors,a))){let l=e.schema.ancestors[a],s=-1;for(o=!1;++s<l.length;)e.stack.includes(l[s])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(a)?n:void 0;let i={type:"element",tagName:a,properties:r,children:n};return hu(i,t),i}function G3(e,t){let n={type:"root",children:tT(e,t.children)};return hu(n,t),n}function $3(e,t){let n={type:"text",value:typeof t.value=="string"?t.value:""};return hu(n,t),n}function tT(e,t){let a=[];if(Array.isArray(t)){let n=t,r=-1;for(;++r<n.length;){let o=eT(e,n[r]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function X3(e,t){let a=e.stack[e.stack.length-1],n=e.schema.attributes,r=e.schema.required,o=n&&to.call(n,a)?n[a]:void 0,i=n&&to.call(n,"*")?n["*"]:void 0,l=t&&typeof t=="object"?t:{},s={},u;for(u in l)if(to.call(l,u)){let c=l[u],d=Qk(e,Jk(o,u),u,c);d==null&&(d=Qk(e,Jk(i,u),u,c)),d!=null&&(s[u]=d)}if(r&&to.call(r,a)){let c=r[a];for(u in c)to.call(c,u)&&!to.call(s,u)&&(s[u]=c[u])}return s}function Qk(e,t,a,n){return t?Array.isArray(n)?K3(e,t,a,n):aT(e,t,a,n):void 0}function K3(e,t,a,n){let r=-1,o=[];for(;++r<n.length;){let i=aT(e,t,a,n[r]);(typeof i=="number"||typeof i=="string")&&o.push(i)}return o}function aT(e,t,a,n){if(!(typeof n!="boolean"&&typeof n!="number"&&typeof n!="string")&&Y3(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 Y3(e,t,a){let n=e.schema.protocols&&to.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!n||n.length===0)return!0;let r=String(a),o=r.indexOf(":"),i=r.indexOf("?"),l=r.indexOf("#"),s=r.indexOf("/");if(o<0||s>-1&&o>s||i>-1&&o>i||l>-1&&o>l)return!0;let u=-1;for(;++u<n.length;){let c=n[u];if(o===c.length&&r.slice(0,c.length)===c)return!0}return!1}function hu(e,t){let a=pu(t);t.data&&(e.data=eo(t.data)),a&&(e.position=a)}function Jk(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 to,nT=k(()=>{"use strict";mf();mu();Zk();to={}.hasOwnProperty});var rT=k(()=>{"use strict";nT()});function gf(e){return function(t){return cw(t,e)}}var oT=k(()=>{"use strict";rT()});var iT=k(()=>{"use strict";oT()});function dw(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 lT=k(()=>{"use strict"});function Go(e){return e!==null&&(e<32||e===127)}function Z(e){return e!==null&&e<-2}function Me(e){return e!==null&&(e<0||e===32)}function se(e){return e===-2||e===-1||e===32}function ao(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}var jt,kt,sT,gu,uT,cT,$o,Un,je=k(()=>{"use strict";jt=ao(/[A-Za-z]/),kt=ao(/[\dA-Za-z]/),sT=ao(/[#-'*+\--9=?A-Z^-~]/);gu=ao(/\d/),uT=ao(/[\dA-Fa-f]/),cT=ao(/[!-/:-@[-`{-~]/);$o=ao(/\p{P}|\p{S}/u),Un=ao(/\s/)});function fw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var dT=k(()=>{"use strict"});function pw(e,t,a){let r=Jr((a||{}).ignore||[]),o=Z3(t),i=-1;for(;++i<o.length;)du(e,"text",l);function l(u,c){let d=-1,f;for(;++d<c.length;){let p=c[d],m=f?f.children:void 0;if(r(p,m?m.indexOf(p):void 0,f))return;f=p}if(f)return s(u,c)}function s(u,c){let d=c[c.length-1],f=o[i][0],p=o[i][1],m=0,S=d.children.indexOf(u),w=!1,y=[];f.lastIndex=0;let h=f.exec(u.value);for(;h;){let b=h.index,T={index:h.index,input:h.input,stack:[...c,u]},C=p(...h,T);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?f.lastIndex=b+1:(m!==b&&y.push({type:"text",value:u.value.slice(m,b)}),Array.isArray(C)?y.push(...C):C&&y.push(C),m=b+h[0].length,w=!0),!f.global)break;h=f.exec(u.value)}return w?(m<u.value.length&&y.push({type:"text",value:u.value.slice(m)}),d.children.splice(S,1,...y)):y=[u],S+y.length}}function Z3(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([Q3(r[0]),J3(r[1])])}return t}function Q3(e){return typeof e=="string"?new RegExp(fw(e),"g"):e}function J3(e){return typeof e=="function"?e:function(){return e}}var fT=k(()=>{"use strict";dT();cf();uf()});var pT=k(()=>{"use strict";fT()});function ww(){return{transforms:[oF],enter:{literalAutolink:eF,literalAutolinkEmail:gw,literalAutolinkHttp:gw,literalAutolinkWww:gw},exit:{literalAutolink:rF,literalAutolinkEmail:nF,literalAutolinkHttp:tF,literalAutolinkWww:aF}}}function yw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mw,notInConstruct:hw},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mw,notInConstruct:hw},{character:":",before:"[ps]",after:"\\/",inConstruct:mw,notInConstruct:hw}]}}function eF(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gw(e){this.config.enter.autolinkProtocol.call(this,e)}function tF(e){this.config.exit.autolinkProtocol.call(this,e)}function aF(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 nF(e){this.config.exit.autolinkEmail.call(this,e)}function rF(e){this.exit(e)}function oF(e){pw(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,iF],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,lF]],{ignore:["link","linkReference"]})}function iF(e,t,a,n,r){let o="";if(!mT(r)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!sF(a)))return!1;let i=uF(a+n);if(!i[0])return!1;let l={type:"link",title:null,url:o+t+i[0],children:[{type:"text",value:t+i[0]}]};return i[1]?[l,{type:"text",value:i[1]}]:l}function lF(e,t,a,n){return!mT(n,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function sF(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 uF(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=dw(e,"("),o=dw(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 mT(e,t){let a=e.input.charCodeAt(e.index-1);return(e.index===0||Un(a)||$o(a))&&(!t||a!==47)}var mw,hw,hT=k(()=>{"use strict";lT();je();pT();mw="phrasing",hw=["autolink","link","image","label"]});var gT=k(()=>{"use strict";hT()});function la(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var xl=k(()=>{"use strict"});function cF(){this.buffer()}function dF(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fF(){this.buffer()}function pF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mF(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=la(this.sliceSerialize(e)).toLowerCase(),a.label=t}function hF(e){this.exit(e)}function gF(e){let t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=la(this.sliceSerialize(e)).toLowerCase(),a.label=t}function wF(e){this.exit(e)}function yF(){return"["}function wT(e,t,a,n){let r=a.createTracker(n),o=r.move("[^"),i=a.enter("footnoteReference"),l=a.enter("reference");return o+=r.move(a.safe(a.associationId(e),{after:"]",before:o})),l(),i(),o+=r.move("]"),o}function xw(){return{enter:{gfmFootnoteCallString:cF,gfmFootnoteCall:dF,gfmFootnoteDefinitionLabelString:fF,gfmFootnoteDefinition:pF},exit:{gfmFootnoteCallString:mF,gfmFootnoteCall:hF,gfmFootnoteDefinitionLabelString:gF,gfmFootnoteDefinition:wF}}}function vw(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:wT},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(n,r,o,i){let l=o.createTracker(i),s=l.move("[^"),u=o.enter("footnoteDefinition"),c=o.enter("label");return s+=l.move(o.safe(o.associationId(n),{before:s,after:"]"})),c(),s+=l.move("]:"),n.children&&n.children.length>0&&(l.shift(4),s+=l.move((t?`
|
|
10
|
-
`:" ")+o.indentLines(o.containerFlow(n,
|
|
11
|
-
`)}function
|
|
12
|
-
`&&
|
|
13
|
-
`}var
|
|
14
|
-
`,encode:["`"],...
|
|
15
|
-
`),o&&(c+=
|
|
16
|
-
`)),c+=
|
|
17
|
-
`,...
|
|
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?LR:s$))),u(),l}}function s$(e,t,a){return t===0?e:LR(e,t,a)}function LR(e,t,a){return(a?"":" ")+e}var ER=L(()=>{"use strict";Gl();TR.peek=i$});var AR=L(()=>{"use strict";ER()});function Dx(){return{canContainEols:["delete"],enter:{strikethrough:u$},exit:{strikethrough:c$}}}function _x(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:l$}],handlers:{delete:MR}}}function u$(e){this.enter({type:"delete",children:[]},e)}function c$(e){this.exit(e)}function MR(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 d$(){return"~"}var l$,RR=L(()=>{"use strict";l$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];MR.peek=d$});var DR=L(()=>{"use strict";RR()});function f$(e){return e.length}function PR(e,t){let a=t||{},n=(a.align||[]).concat(),r=a.stringLength||f$,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=p$(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]=_R(n[d]);else{let v=_R(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 p$(e){return e==null?"":String(e)}function _R(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 OR=L(()=>{"use strict"});function NR(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()),m$);return r(),i}function m$(e,t,a){return">"+(a?"":" ")+e}var UR=L(()=>{"use strict"});function zR(e,t){return BR(e,t.inConstruct,!0)&&!BR(e,t.notInConstruct,!1)}function BR(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 FR=L(()=>{"use strict"});function Px(e,t,a,n){let r=-1;for(;++r<a.unsafe.length;)if(a.unsafe[r].character===`
|
|
12
|
+
`&&zR(a.stack,a.unsafe[r]))return/[ \t]/.test(n.before)?"":" ";return`\\
|
|
13
|
+
`}var qR=L(()=>{"use strict";FR()});function HR(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 jR=L(()=>{"use strict"});function VR(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 $R=L(()=>{"use strict"});function WR(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 GR=L(()=>{"use strict"});function XR(e,t,a,n){let r=WR(a),o=e.value||"",i=r==="`"?"GraveAccent":"Tilde";if(VR(e,a)){let d=a.enter("codeIndented"),p=a.indentLines(o,h$);return d(),p}let s=a.createTracker(n),l=r.repeat(Math.max(HR(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
|
+
`,encode:["`"],...s.current()})),d()}return c+=s.move(`
|
|
15
|
+
`),o&&(c+=s.move(o+`
|
|
16
|
+
`)),c+=s.move(l),u(),c}function h$(e,t,a){return(a?"":" ")+e}var KR=L(()=>{"use strict";jR();$R();GR()});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 Em=L(()=>{"use strict"});function YR(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 ZR=L(()=>{"use strict";Em()});function JR(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 QR=L(()=>{"use strict"});function ti(e){return"&#x"+e.toString(16).toUpperCase()+";"}var Am=L(()=>{"use strict"});function ao(e){if(e===null||$e(e)||Cr(e))return 1;if(ss(e))return 2}var Mm=L(()=>{"use strict";at()});function Kl(e,t,a){let n=ao(e),r=ao(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 Ox=L(()=>{"use strict";Mm()});function Nx(e,t,a,n){let r=JR(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 g$(e,t,a){return a.options.emphasis||"*"}var e2=L(()=>{"use strict";QR();Am();Ox();Nx.peek=g$});function ls(e,t){let a=t||y$,n=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,r=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return a2(e,n,r)}function a2(e,t,a){if(w$(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 t2(e.children,t,a)}return Array.isArray(e)?t2(e,t,a):""}function t2(e,t,a){let n=[],r=-1;for(;++r<e.length;)n[r]=a2(e[r],t,a);return n.join("")}function w$(e){return!!(e&&typeof e=="object")}var y$,n2=L(()=>{"use strict";y$={}});var Rm=L(()=>{"use strict";n2()});function r2(e,t){let a=!1;return to(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 o2=L(()=>{"use strict";Sm();Rm()});function i2(e,t,a,n){let r=Math.max(Math.min(6,e.depth||1),1),o=a.createTracker(n);if(r2(e,a)){let c=a.enter("headingSetext"),d=a.enter("phrasing"),p=a.containerPhrasing(e,{...o.current(),before:`
|
|
18
18
|
`,after:`
|
|
19
|
-
`});return d(),c(),
|
|
20
|
-
`+(r===1?"=":"-").repeat(
|
|
21
|
-
`))+1))}let i="#".repeat(r),
|
|
22
|
-
`,...o.current()});return/^[\t ]/.test(u)&&(u=no(u.charCodeAt(0))+u.slice(1)),u=u?i+" "+u:i,a.options.closeAtx&&(u+=" "+i),s(),l(),u}var QT=k(()=>{"use strict";yf();YT()});function Tw(e){return e.value||""}function RF(){return"<"}var JT=k(()=>{"use strict";Tw.peek=RF});function Lw(e,t,a,n){let r=vl(a),o=r==='"'?"Quote":"Apostrophe",i=a.enter("image"),l=a.enter("label"),s=a.createTracker(n),u=s.move("![");return u+=s.move(a.safe(e.alt,{before:u,after:"]",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=a.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(a.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=a.enter("destinationRaw"),u+=s.move(a.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=a.enter(`title${o}`),u+=s.move(" "+r),u+=s.move(a.safe(e.title,{before:u,after:r,...s.current()})),u+=s.move(r),l()),u+=s.move(")"),i(),u}function DF(){return"!"}var e1=k(()=>{"use strict";wf();Lw.peek=DF});function Ew(e,t,a,n){let r=e.referenceType,o=a.enter("imageReference"),i=a.enter("label"),l=a.createTracker(n),s=l.move("!["),u=a.safe(e.alt,{before:s,after:"]",...l.current()});s+=l.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:s,after:"]",...l.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?s+=l.move(d+"]"):r==="shortcut"?s=s.slice(0,-1):s+=l.move("]"),s}function _F(){return"!"}var t1=k(()=>{"use strict";Ew.peek=_F});function Mw(e,t,a){let n=e.value||"",r="`",o=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(n);)r+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<a.unsafe.length;){let i=a.unsafe[o],l=a.compilePattern(i),s;if(i.atBreak)for(;s=l.exec(n);){let u=s.index;n.charCodeAt(u)===10&&n.charCodeAt(u-1)===13&&u--,n=n.slice(0,u)+" "+n.slice(s.index+1)}}return r+n+r}function OF(){return"`"}var a1=k(()=>{"use strict";Mw.peek=OF});function Aw(e,t){let a=Xo(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 n1=k(()=>{"use strict";vf()});function Rw(e,t,a,n){let r=vl(a),o=r==='"'?"Quote":"Apostrophe",i=a.createTracker(n),l,s;if(Aw(e,a)){let c=a.stack;a.stack=[],l=a.enter("autolink");let d=i.move("<");return d+=i.move(a.containerPhrasing(e,{before:d,after:">",...i.current()})),d+=i.move(">"),l(),a.stack=c,d}l=a.enter("link"),s=a.enter("label");let u=i.move("[");return u+=i.move(a.containerPhrasing(e,{before:u,after:"](",...i.current()})),u+=i.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=a.enter("destinationLiteral"),u+=i.move("<"),u+=i.move(a.safe(e.url,{before:u,after:">",...i.current()})),u+=i.move(">")):(s=a.enter("destinationRaw"),u+=i.move(a.safe(e.url,{before:u,after:e.title?" ":")",...i.current()}))),s(),e.title&&(s=a.enter(`title${o}`),u+=i.move(" "+r),u+=i.move(a.safe(e.title,{before:u,after:r,...i.current()})),u+=i.move(r),s()),u+=i.move(")"),l(),u}function PF(e,t,a){return Aw(e,a)?"<":"["}var r1=k(()=>{"use strict";wf();n1();Rw.peek=PF});function Dw(e,t,a,n){let r=e.referenceType,o=a.enter("linkReference"),i=a.enter("label"),l=a.createTracker(n),s=l.move("["),u=a.containerPhrasing(e,{before:s,after:"]",...l.current()});s+=l.move(u+"]["),i();let c=a.stack;a.stack=[],i=a.enter("reference");let d=a.safe(a.associationId(e),{before:s,after:"]",...l.current()});return i(),a.stack=c,o(),r==="full"||!u||u!==d?s+=l.move(d+"]"):r==="shortcut"?s=s.slice(0,-1):s+=l.move("]"),s}function NF(){return"["}var o1=k(()=>{"use strict";Dw.peek=NF});function Sl(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 bf=k(()=>{"use strict"});function i1(e){let t=Sl(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 l1=k(()=>{"use strict";bf()});function s1(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 u1=k(()=>{"use strict"});function Sf(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 _w=k(()=>{"use strict"});function c1(e,t,a,n){let r=a.enter("list"),o=a.bulletCurrent,i=e.ordered?s1(a):Sl(a),l=e.ordered?i==="."?")":".":i1(a),s=t&&a.bulletLastUsed?i===a.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((i==="*"||i==="-")&&c&&(!c.children||!c.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(s=!0),Sf(a)===i&&c){let d=-1;for(;++d<e.children.length;){let f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){s=!0;break}}}}s&&(i=l),a.bulletCurrent=i;let u=a.containerFlow(e,n);return a.bulletLastUsed=i,a.bulletCurrent=o,r(),u}var d1=k(()=>{"use strict";bf();l1();u1();_w()});function f1(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 p1=k(()=>{"use strict"});function m1(e,t,a,n){let r=f1(a),o=a.bulletCurrent||Sl(a);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let i=o.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(i=Math.ceil(i/4)*4);let l=a.createTracker(n);l.move(o+" ".repeat(i-o.length)),l.shift(i);let s=a.enter("listItem"),u=a.indentLines(a.containerFlow(e,l.current()),c);return s(),u;function c(d,f,p){return f?(p?"":" ".repeat(i))+d:(p?o:o+" ".repeat(i-o.length))+d}}var h1=k(()=>{"use strict";bf();p1()});function g1(e,t,a,n){let r=a.enter("paragraph"),o=a.enter("phrasing"),i=a.containerPhrasing(e,n);return o(),r(),i}var w1=k(()=>{"use strict"});var Ow,y1=k(()=>{"use strict";uf();Ow=Jr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var x1=k(()=>{"use strict";y1()});function v1(e,t,a,n){return(e.children.some(function(i){return Ow(i)})?a.containerPhrasing:a.containerFlow).call(a,e,n)}var b1=k(()=>{"use strict";x1()});function S1(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 I1=k(()=>{"use strict"});function Pw(e,t,a,n){let r=S1(a),o=a.enter("strong"),i=a.createTracker(n),l=i.move(r+r),s=i.move(a.containerPhrasing(e,{after:r,before:l,...i.current()})),u=s.charCodeAt(0),c=bl(n.before.charCodeAt(n.before.length-1),u,r);c.inside&&(s=no(u)+s.slice(1));let d=s.charCodeAt(s.length-1),f=bl(n.after.charCodeAt(0),d,r);f.inside&&(s=s.slice(0,-1)+no(d));let p=i.move(r+r);return o(),a.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},l+s+p}function BF(e,t,a){return a.options.strong||"*"}var C1=k(()=>{"use strict";I1();yf();Cw();Pw.peek=BF});function k1(e,t,a,n){return a.safe(e.value,n)}var T1=k(()=>{"use strict"});function L1(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 E1=k(()=>{"use strict"});function M1(e,t,a){let n=(Sf(a)+(a.options.ruleSpaces?" ":"")).repeat(L1(a));return a.options.ruleSpaces?n.slice(0,-1):n}var A1=k(()=>{"use strict";E1();_w()});var wu,R1=k(()=>{"use strict";ET();DT();zT();HT();WT();QT();JT();e1();t1();a1();r1();o1();d1();h1();w1();b1();C1();T1();A1();wu={blockquote:LT,break:Iw,code:FT,definition:qT,emphasis:kw,hardBreak:Iw,heading:ZT,html:Tw,image:Lw,imageReference:Ew,inlineCode:Mw,link:Rw,linkReference:Dw,list:c1,listItem:m1,paragraph:g1,root:v1,strong:Pw,text:k1,thematicBreak:M1}});function Il(e){let t="&"+e+";";D1.innerHTML=t;let a=D1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}var D1,If=k(()=>{"use strict";D1=document.createElement("i")});function Cf(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 Nw=k(()=>{"use strict"});function _1(e){return e.replace(UF,FF)}function FF(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let r=a.charCodeAt(1),o=r===120||r===88;return Cf(a.slice(o?2:1),o?16:10)}return Il(a)||e}var UF,O1=k(()=>{"use strict";If();Nw();UF=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});var Bw=k(()=>{"use strict";R1()});function Fw(){return{enter:{table:zF,tableData:P1,tableHeader:P1,tableRow:HF},exit:{codeText:jF,table:qF,tableData:Uw,tableHeader:Uw,tableRow:Uw}}}function zF(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 qF(e){this.exit(e),this.data.inTable=void 0}function HF(e){this.enter({type:"tableRow",children:[]},e)}function Uw(e){this.exit(e)}function P1(e){this.enter({type:"tableCell",children:[]},e)}function jF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,VF));let a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function VF(e,t){return t==="|"?t:e}function zw(e){let t=e||{},a=t.tableCellPadding,n=t.tablePipeAlign,r=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
23
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:
|
|
24
|
-
`))}function s(p,m,x,S){let w=x.enter("tableCell"),y=x.enter("phrasing"),h=x.containerPhrasing(p,{...S,before:o,after:o});return y(),w(),h}function u(p,m){return kT(p,{align:m,alignDelimiters:n,padding:a,stringLength:r})}function c(p,m,x){let S=p.children,w=-1,y=[],h=m.enter("table");for(;++w<S.length;)y[w]=d(S[w],m,x);return h(),y}function d(p,m,x){let S=p.children,w=-1,y=[],h=m.enter("tableRow");for(;++w<S.length;)y[w]=s(S[w],p,m,x);return h(),y}function f(p,m,x){let S=wu.inlineCode(p,m,x);return x.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}var N1=k(()=>{"use strict";TT();Bw()});var B1=k(()=>{"use strict";N1()});function qw(){return{exit:{taskListCheckValueChecked:U1,taskListCheckValueUnchecked:U1,paragraph:WF}}}function Hw(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:GF}}}function U1(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function WF(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let a=this.stack[this.stack.length-1];a.type;let n=a.children[0];if(n&&n.type==="text"){let r=t.children,o=-1,i;for(;++o<r.length;){let l=r[o];if(l.type==="paragraph"){i=l;break}}i===a&&(n.value=n.value.slice(1),n.value.length===0?a.children.shift():a.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,a.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function GF(e,t,a,n){let r=e.children[0],o=typeof e.checked=="boolean"&&r&&r.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",l=a.createTracker(n);o&&l.move(i);let s=wu.listItem(e,t,a,{...n,...l.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(c){return c+i}}var F1=k(()=>{"use strict";Bw()});var z1=k(()=>{"use strict";F1()});function jw(){return[ww(),xw(),bw(),Fw(),qw()]}function Vw(e){return{extensions:[yw(),vw(e),Sw(),zw(e),Hw()]}}var q1=k(()=>{"use strict";gT();vT();IT();B1();z1()});var H1=k(()=>{"use strict";q1()});function _t(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 ga(e,t){return e.length>0?(_t(e,e.length,0,t),e):t}var gr=k(()=>{"use strict"});function kf(e){let t={},a=-1;for(;++a<e.length;)$F(t,e[a]);return t}function $F(e,t){let a;for(a in t){let r=(j1.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){j1.call(r,i)||(r[i]=[]);let l=o[i];XF(r[i],Array.isArray(l)?l:l?[l]:[])}}}function XF(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);_t(e,0,0,n)}var j1,Ww=k(()=>{"use strict";gr();j1={}.hasOwnProperty});function $w(){return{text:Fn}}function ZF(e,t,a){let n=this,r,o;return i;function i(d){return!Gw(d)||!Z1.call(n,n.previous)||Xw(n.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return Gw(d)?(e.consume(d),l):d===64?(e.consume(d),s):a(d)}function s(d){return d===46?e.check(YF,c,u)(d):d===45||d===95||kt(d)?(o=!0,e.consume(d),s):c(d)}function u(d){return e.consume(d),r=!0,s}function c(d){return o&&r&&jt(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):a(d)}}function QF(e,t,a){let n=this;return r;function r(i){return i!==87&&i!==119||!K1.call(n,n.previous)||Xw(n.events)?a(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(KF,e.attempt(V1,e.attempt(W1,o),a),a)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function JF(e,t,a){let n=this,r="",o=!1;return i;function i(d){return(d===72||d===104)&&Y1.call(n,n.previous)&&!Xw(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(d),e.consume(d),l):a(d)}function l(d){if(jt(d)&&r.length<5)return r+=String.fromCodePoint(d),e.consume(d),l;if(d===58){let f=r.toLowerCase();if(f==="http"||f==="https")return e.consume(d),s}return a(d)}function s(d){return d===47?(e.consume(d),o?u:(o=!0,s)):a(d)}function u(d){return d===null||Go(d)||Me(d)||Un(d)||$o(d)?a(d):e.attempt(V1,e.attempt(W1,c),a)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function ez(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 tz(e,t,a){let n,r,o;return i;function i(u){return u===46||u===95?e.check(G1,s,l)(u):u===null||Me(u)||Un(u)||u!==45&&$o(u)?s(u):(o=!0,e.consume(u),i)}function l(u){return u===95?n=!0:(r=n,n=void 0),e.consume(u),i}function s(u){return r||n||!o?a(u):t(u)}}function az(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(G1,t,o)(i):i===null||Me(i)||Un(i)?t(i):(e.consume(i),r)}function o(i){return i===41&&n++,e.consume(i),r}}function nz(e,t,a){return n;function n(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),n):l===38?(e.consume(l),o):l===93?(e.consume(l),r):l===60||l===null||Me(l)||Un(l)?t(l):a(l)}function r(l){return l===null||l===40||l===91||Me(l)||Un(l)?t(l):n(l)}function o(l){return jt(l)?i(l):a(l)}function i(l){return l===59?(e.consume(l),n):jt(l)?(e.consume(l),i):a(l)}}function rz(e,t,a){return n;function n(o){return e.consume(o),r}function r(o){return kt(o)?a(o):t(o)}}function K1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Me(e)}function Y1(e){return!jt(e)}function Z1(e){return!(e===47||Gw(e))}function Gw(e){return e===43||e===45||e===46||e===95||kt(e)}function Xw(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 KF,V1,W1,G1,YF,$1,X1,wr,Fn,Ko,Q1=k(()=>{"use strict";je();KF={tokenize:ez,partial:!0},V1={tokenize:tz,partial:!0},W1={tokenize:az,partial:!0},G1={tokenize:nz,partial:!0},YF={tokenize:rz,partial:!0},$1={name:"wwwAutolink",tokenize:QF,previous:K1},X1={name:"protocolAutolink",tokenize:JF,previous:Y1},wr={name:"emailAutolink",tokenize:ZF,previous:Z1},Fn={};Ko=48;for(;Ko<123;)Fn[Ko]=wr,Ko++,Ko===58?Ko=65:Ko===91&&(Ko=97);Fn[43]=wr;Fn[45]=wr;Fn[46]=wr;Fn[95]=wr;Fn[72]=[wr,X1];Fn[104]=[wr,X1];Fn[87]=[wr,$1];Fn[119]=[wr,$1]});function un(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";if(o===37&&kt(e.charCodeAt(a+1))&&kt(e.charCodeAt(a+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(i=String.fromCharCode(o));else if(o>55295&&o<57344){let l=e.charCodeAt(a+1);o<56320&&l>56319&&l<57344?(i=String.fromCharCode(o,l),r=1):i="\uFFFD"}else i=String.fromCharCode(o);i&&(t.push(e.slice(n,a),encodeURIComponent(i)),n=a+r+1,i=""),r&&(a+=r,r=0)}return t.join("")+e.slice(n)}var Yo=k(()=>{"use strict";je()});var J1=k(()=>{"use strict";Q1()});function ro(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 yu=k(()=>{"use strict"});function oz(e,t){let a=-1,n,r,o,i,l,s,u,c;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(n=a;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[n][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;let d={...e[n][1].end},f={...e[a][1].start};eL(d,-s),eL(f,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:f},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[a][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[a][1].start={...l.end},u=[],e[n][1].end.offset-e[n][1].start.offset&&(u=ga(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=ga(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=ga(u,ro(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=ga(u,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[a][1].end.offset-e[a][1].start.offset?(c=2,u=ga(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,_t(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 iz(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=hr(n),o;return i;function i(s){return o=s,e.enter("attentionSequence"),l(s)}function l(s){if(s===o)return e.consume(s),l;let u=e.exit("attentionSequence"),c=hr(s),d=!c||c===2&&r||a.includes(s),f=!r||r===2&&c||a.includes(n);return u._open=!!(o===42?d:d&&(r||!f)),u._close=!!(o===42?f:f&&(c||!d)),t(s)}}function eL(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var xu,tL=k(()=>{"use strict";gr();xf();yu();xu={name:"attention",resolveAll:oz,tokenize:iz}});function lz(e,t,a){let n=0;return r;function r(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return jt(p)?(e.consume(p),i):p===64?a(p):u(p)}function i(p){return p===43||p===45||p===46||kt(p)?(n=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),n=0,s):(p===43||p===45||p===46||kt(p))&&n++<32?(e.consume(p),l):(n=0,u(p))}function s(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Go(p)?a(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),c):sT(p)?(e.consume(p),u):a(p)}function c(p){return kt(p)?d(p):a(p)}function d(p){return p===46?(e.consume(p),n=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||kt(p))&&n++<63){let m=p===45?f:d;return e.consume(p),m}return a(p)}}var Kw,aL=k(()=>{"use strict";je();Kw={name:"autolink",tokenize:lz}});function ie(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(s){return se(s)?(e.enter(a),l(s)):t(s)}function l(s){return se(s)&&o++<r?(e.consume(s),l):(e.exit(a),t(s))}}var Ot=k(()=>{"use strict";je()});function sz(e,t,a){return n;function n(o){return se(o)?ie(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||Z(o)?t(o):a(o)}}var zn,Tf=k(()=>{"use strict";Ot();je();zn={partial:!0,tokenize:sz}});function uz(e,t,a){let n=this;return r;function r(i){if(i===62){let l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),o}return a(i)}function o(i){return se(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function cz(e,t,a){let n=this;return r;function r(i){return se(i)?ie(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(Lf,t,a)(i)}}function dz(e){e.exit("blockQuote")}var Lf,nL=k(()=>{"use strict";Ot();je();Lf={continuation:{tokenize:cz},exit:dz,name:"blockQuote",tokenize:uz}});function fz(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 cT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var Ef,rL=k(()=>{"use strict";je();Ef={name:"characterEscape",tokenize:fz}});function pz(e,t,a){let n=this,r=0,o,i;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),s}function s(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,i=kt,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=uT,c):(e.enter("characterReferenceValue"),o=7,i=gu,c(d))}function c(d){if(d===59&&r){let f=e.exit("characterReferenceValue");return i===kt&&!Il(n.sliceSerialize(f))?a(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(d)&&r++<o?(e.consume(d),c):a(d)}}var Mf,oL=k(()=>{"use strict";If();je();Mf={name:"characterReference",tokenize:pz}});function mz(e,t,a){let n=this,r={partial:!0,tokenize:T},o=0,i=0,l;return s;function s(C){return u(C)}function u(C){let M=n.events[n.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,l=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(C)}function c(C){return C===l?(i++,e.consume(C),c):i<3?a(C):(e.exit("codeFencedFenceSequence"),se(C)?ie(e,d,"whitespace")(C):d(C))}function d(C){return C===null||Z(C)?(e.exit("codeFencedFence"),n.interrupt?t(C):e.check(iL,x,b)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||Z(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):se(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ie(e,p,"whitespace")(C)):C===96&&C===l?a(C):(e.consume(C),f)}function p(C){return C===null||Z(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||Z(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===l?a(C):(e.consume(C),m)}function x(C){return e.attempt(r,b,S)(C)}function S(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),w}function w(C){return o>0&&se(C)?ie(e,y,"linePrefix",o+1)(C):y(C)}function y(C){return C===null||Z(C)?e.check(iL,x,b)(C):(e.enter("codeFlowValue"),h(C))}function h(C){return C===null||Z(C)?(e.exit("codeFlowValue"),y(C)):(e.consume(C),h)}function b(C){return e.exit("codeFenced"),t(C)}function T(C,M,D){let P=0;return L;function L(V){return C.enter("lineEnding"),C.consume(V),C.exit("lineEnding"),$}function $(V){return C.enter("codeFencedFence"),se(V)?ie(C,H,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):H(V)}function H(V){return V===l?(C.enter("codeFencedFenceSequence"),F(V)):D(V)}function F(V){return V===l?(P++,C.consume(V),F):P>=i?(C.exit("codeFencedFenceSequence"),se(V)?ie(C,W,"whitespace")(V):W(V)):D(V)}function W(V){return V===null||Z(V)?(C.exit("codeFencedFence"),M(V)):D(V)}}}function hz(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 iL,Af,lL=k(()=>{"use strict";Ot();je();iL={partial:!0,tokenize:hz},Af={concrete:!0,name:"codeFenced",tokenize:mz}});function wz(e,t,a){let n=this;return r;function r(u){return e.enter("codeIndented"),ie(e,o,"linePrefix",5)(u)}function o(u){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?i(u):a(u)}function i(u){return u===null?s(u):Z(u)?e.attempt(gz,i,s)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Z(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),l)}function s(u){return e.exit("codeIndented"),t(u)}}function yz(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):Z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):ie(e,o,"linePrefix",5)(i)}function o(i){let l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):Z(i)?r(i):a(i)}}var vu,gz,sL=k(()=>{"use strict";Ot();je();vu={name:"codeIndented",tokenize:wz},gz={partial:!0,tokenize:yz}});function xz(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 vz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bz(e,t,a){let n=this,r=0,o,i;return l;function l(f){return e.enter("codeText"),e.enter("codeTextSequence"),s(f)}function s(f){return f===96?(e.consume(f),r++,s):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?a(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(i=e.enter("codeTextSequence"),o=0,d(f)):Z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Z(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}var Yw,uL=k(()=>{"use strict";je();Yw={name:"codeText",previous:vz,resolve:xz,tokenize:bz}});function bu(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 Rf,cL=k(()=>{"use strict";Rf=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&&bu(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),bu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),bu(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);bu(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);bu(this.left,a.reverse())}}}});function Df(e){let t={},a=-1,n,r,o,i,l,s,u,c=new Rf(e);for(;++a<c.length;){for(;a in t;)a=t[a];if(n=c.get(a),a&&n[1].type==="chunkFlow"&&c.get(a-1)[1].type==="listItemPrefix"&&(s=n[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,Sz(c,a)),a=t[a],u=!0);else if(n[1]._container){for(o=a,r=void 0;o--;)if(i=c.get(o),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;r&&(n[1].end={...c.get(r)[1].start},l=c.slice(r,a),l.unshift(n),c.splice(r,a-r+1,l))}}return _t(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function Sz(e,t){let a=e.get(t)[1],n=e.get(t)[2],r=t-1,o=[],i=a._tokenizer;i||(i=n.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let l=i.events,s=[],u={},c,d,f=-1,p=a,m=0,x=0,S=[x];for(;p;){for(;e.get(++r)[1]!==p;);o.push(r),p._tokenizer||(c=n.sliceStream(p),p.next||c.push(null),d&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=a;++f<l.length;)l[f][0]==="exit"&&l[f-1][0]==="enter"&&l[f][1].type===l[f-1][1].type&&l[f][1].start.line!==l[f][1].end.line&&(x=f+1,S.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):S.pop(),f=S.length;f--;){let w=l.slice(S[f],S[f+1]),y=o.pop();s.push([y,y+w.length-1]),e.splice(y,2,w)}for(s.reverse(),f=-1;++f<s.length;)u[m+s[f][0]]=m+s[f][1],m+=s[f][1]-s[f][0]-1;return u}var Zw=k(()=>{"use strict";gr();cL()});function Cz(e){return Df(e),e}function kz(e,t){let a;return n;function n(l){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),r(l)}function r(l){return l===null?o(l):Z(l)?e.check(Iz,i,o)(l):(e.consume(l),r)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function i(l){return e.consume(l),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,r}}function Tz(e,t,a){let n=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),ie(e,o,"linePrefix")}function o(i){if(i===null||Z(i))return a(i);let l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):e.interrupt(n.parser.constructs.flow,a,t)(i)}}var Qw,Iz,dL=k(()=>{"use strict";Ot();je();Zw();Qw={resolve:Cz,tokenize:kz},Iz={partial:!0,tokenize:Tz}});function _f(e,t,a,n,r,o,i,l,s){let u=s||Number.POSITIVE_INFINITY,c=0;return d;function d(w){return w===60?(e.enter(n),e.enter(r),e.enter(o),e.consume(w),e.exit(o),f):w===null||w===32||w===41||Go(w)?a(w):(e.enter(n),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(w))}function f(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(r),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(l),f(w)):w===null||w===60||Z(w)?a(w):(e.consume(w),w===92?m:p)}function m(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function x(w){return!c&&(w===null||w===41||Me(w))?(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(n),t(w)):c<u&&w===40?(e.consume(w),c++,x):w===41?(e.consume(w),c--,x):w===null||w===32||w===40||Go(w)?a(w):(e.consume(w),w===92?S:x)}function S(w){return w===40||w===41||w===92?(e.consume(w),x):x(w)}}var Jw=k(()=>{"use strict";je()});function Of(e,t,a,n,r,o){let i=this,l=0,s;return u;function u(p){return e.enter(n),e.enter(r),e.consume(p),e.exit(r),e.enter(o),c}function c(p){return l>999||p===null||p===91||p===93&&!s||p===94&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?a(p):p===93?(e.exit(o),e.enter(r),e.consume(p),e.exit(r),e.exit(n),t):Z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||Z(p)||l++>999?(e.exit("chunkString"),c(p)):(e.consume(p),s||(s=!se(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}var ey=k(()=>{"use strict";je()});function Pf(e,t,a,n,r,o){let i;return l;function l(f){return f===34||f===39||f===40?(e.enter(n),e.enter(r),e.consume(f),e.exit(r),i=f===40?41:f,s):a(f)}function s(f){return f===i?(e.enter(r),e.consume(f),e.exit(r),e.exit(n),t):(e.enter(o),u(f))}function u(f){return f===i?(e.exit(o),s(i)):f===null?a(f):Z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ie(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===i||f===null||Z(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===i||f===92?(e.consume(f),c):c(f)}}var ty=k(()=>{"use strict";Ot();je()});function Zo(e,t){let a;return n;function n(r){return Z(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):se(r)?ie(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var ay=k(()=>{"use strict";Ot();je()});function Ez(e,t,a){let n=this,r;return o;function o(p){return e.enter("definition"),i(p)}function i(p){return Of.call(n,e,l,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return r=la(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),s):a(p)}function s(p){return Me(p)?Zo(e,u)(p):u(p)}function u(p){return _f(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(Lz,d,d)(p)}function d(p){return se(p)?ie(e,f,"whitespace")(p):f(p)}function f(p){return p===null||Z(p)?(e.exit("definition"),n.parser.defined.push(r),t(p)):a(p)}}function Mz(e,t,a){return n;function n(l){return Me(l)?Zo(e,r)(l):a(l)}function r(l){return Pf(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return se(l)?ie(e,i,"whitespace")(l):i(l)}function i(l){return l===null||Z(l)?t(l):a(l)}}var ny,Lz,fL=k(()=>{"use strict";Jw();ey();Ot();ty();ay();je();xl();ny={name:"definition",tokenize:Ez},Lz={partial:!0,tokenize:Mz}});function Az(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return Z(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var ry,pL=k(()=>{"use strict";je();ry={name:"hardBreakEscape",tokenize:Az}});function Rz(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"},_t(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function Dz(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||Me(c)?(e.exit("atxHeadingSequence"),l(c)):a(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||Z(c)?(e.exit("atxHeading"),t(c)):se(c)?ie(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function s(c){return c===35?(e.consume(c),s):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||Me(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}var oy,mL=k(()=>{"use strict";Ot();je();gr();oy={name:"headingAtx",resolve:Rz,tokenize:Dz}});var hL,iy,gL=k(()=>{"use strict";hL=["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"],iy=["pre","script","style","textarea"]});function Pz(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 Nz(e,t,a){let n=this,r,o,i,l,s;return u;function u(v){return c(v)}function c(v){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(v),d}function d(v){return v===33?(e.consume(v),f):v===47?(e.consume(v),o=!0,x):v===63?(e.consume(v),r=3,n.interrupt?t:I):jt(v)?(e.consume(v),i=String.fromCharCode(v),S):a(v)}function f(v){return v===45?(e.consume(v),r=2,p):v===91?(e.consume(v),r=5,l=0,m):jt(v)?(e.consume(v),r=4,n.interrupt?t:I):a(v)}function p(v){return v===45?(e.consume(v),n.interrupt?t:I):a(v)}function m(v){let K="CDATA[";return v===K.charCodeAt(l++)?(e.consume(v),l===K.length?n.interrupt?t:H:m):a(v)}function x(v){return jt(v)?(e.consume(v),i=String.fromCharCode(v),S):a(v)}function S(v){if(v===null||v===47||v===62||Me(v)){let K=v===47,ee=i.toLowerCase();return!K&&!o&&iy.includes(ee)?(r=1,n.interrupt?t(v):H(v)):hL.includes(i.toLowerCase())?(r=6,K?(e.consume(v),w):n.interrupt?t(v):H(v)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(v):o?y(v):h(v))}return v===45||kt(v)?(e.consume(v),i+=String.fromCharCode(v),S):a(v)}function w(v){return v===62?(e.consume(v),n.interrupt?t:H):a(v)}function y(v){return se(v)?(e.consume(v),y):L(v)}function h(v){return v===47?(e.consume(v),L):v===58||v===95||jt(v)?(e.consume(v),b):se(v)?(e.consume(v),h):L(v)}function b(v){return v===45||v===46||v===58||v===95||kt(v)?(e.consume(v),b):T(v)}function T(v){return v===61?(e.consume(v),C):se(v)?(e.consume(v),T):h(v)}function C(v){return v===null||v===60||v===61||v===62||v===96?a(v):v===34||v===39?(e.consume(v),s=v,M):se(v)?(e.consume(v),C):D(v)}function M(v){return v===s?(e.consume(v),s=null,P):v===null||Z(v)?a(v):(e.consume(v),M)}function D(v){return v===null||v===34||v===39||v===47||v===60||v===61||v===62||v===96||Me(v)?T(v):(e.consume(v),D)}function P(v){return v===47||v===62||se(v)?h(v):a(v)}function L(v){return v===62?(e.consume(v),$):a(v)}function $(v){return v===null||Z(v)?H(v):se(v)?(e.consume(v),$):a(v)}function H(v){return v===45&&r===2?(e.consume(v),N):v===60&&r===1?(e.consume(v),R):v===62&&r===4?(e.consume(v),We):v===63&&r===3?(e.consume(v),I):v===93&&r===5?(e.consume(v),ue):Z(v)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(_z,Je,F)(v)):v===null||Z(v)?(e.exit("htmlFlowData"),F(v)):(e.consume(v),H)}function F(v){return e.check(Oz,W,Je)(v)}function W(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),V}function V(v){return v===null||Z(v)?F(v):(e.enter("htmlFlowData"),H(v))}function N(v){return v===45?(e.consume(v),I):H(v)}function R(v){return v===47?(e.consume(v),i="",G):H(v)}function G(v){if(v===62){let K=i.toLowerCase();return iy.includes(K)?(e.consume(v),We):H(v)}return jt(v)&&i.length<8?(e.consume(v),i+=String.fromCharCode(v),G):H(v)}function ue(v){return v===93?(e.consume(v),I):H(v)}function I(v){return v===62?(e.consume(v),We):v===45&&r===2?(e.consume(v),I):H(v)}function We(v){return v===null||Z(v)?(e.exit("htmlFlowData"),Je(v)):(e.consume(v),We)}function Je(v){return e.exit("htmlFlow"),t(v)}}function Bz(e,t,a){let n=this;return r;function r(i){return Z(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 Uz(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(zn,t,a)}}var ly,_z,Oz,wL=k(()=>{"use strict";je();gL();Tf();ly={concrete:!0,name:"htmlFlow",resolveTo:Pz,tokenize:Nz},_z={partial:!0,tokenize:Uz},Oz={partial:!0,tokenize:Bz}});function Fz(e,t,a){let n=this,r,o,i;return l;function l(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),s}function s(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),T):I===63?(e.consume(I),h):jt(I)?(e.consume(I),D):a(I)}function u(I){return I===45?(e.consume(I),c):I===91?(e.consume(I),o=0,m):jt(I)?(e.consume(I),y):a(I)}function c(I){return I===45?(e.consume(I),p):a(I)}function d(I){return I===null?a(I):I===45?(e.consume(I),f):Z(I)?(i=d,R(I)):(e.consume(I),d)}function f(I){return I===45?(e.consume(I),p):d(I)}function p(I){return I===62?N(I):I===45?f(I):d(I)}function m(I){let We="CDATA[";return I===We.charCodeAt(o++)?(e.consume(I),o===We.length?x:m):a(I)}function x(I){return I===null?a(I):I===93?(e.consume(I),S):Z(I)?(i=x,R(I)):(e.consume(I),x)}function S(I){return I===93?(e.consume(I),w):x(I)}function w(I){return I===62?N(I):I===93?(e.consume(I),w):x(I)}function y(I){return I===null||I===62?N(I):Z(I)?(i=y,R(I)):(e.consume(I),y)}function h(I){return I===null?a(I):I===63?(e.consume(I),b):Z(I)?(i=h,R(I)):(e.consume(I),h)}function b(I){return I===62?N(I):h(I)}function T(I){return jt(I)?(e.consume(I),C):a(I)}function C(I){return I===45||kt(I)?(e.consume(I),C):M(I)}function M(I){return Z(I)?(i=M,R(I)):se(I)?(e.consume(I),M):N(I)}function D(I){return I===45||kt(I)?(e.consume(I),D):I===47||I===62||Me(I)?P(I):a(I)}function P(I){return I===47?(e.consume(I),N):I===58||I===95||jt(I)?(e.consume(I),L):Z(I)?(i=P,R(I)):se(I)?(e.consume(I),P):N(I)}function L(I){return I===45||I===46||I===58||I===95||kt(I)?(e.consume(I),L):$(I)}function $(I){return I===61?(e.consume(I),H):Z(I)?(i=$,R(I)):se(I)?(e.consume(I),$):P(I)}function H(I){return I===null||I===60||I===61||I===62||I===96?a(I):I===34||I===39?(e.consume(I),r=I,F):Z(I)?(i=H,R(I)):se(I)?(e.consume(I),H):(e.consume(I),W)}function F(I){return I===r?(e.consume(I),r=void 0,V):I===null?a(I):Z(I)?(i=F,R(I)):(e.consume(I),F)}function W(I){return I===null||I===34||I===39||I===60||I===61||I===96?a(I):I===47||I===62||Me(I)?P(I):(e.consume(I),W)}function V(I){return I===47||I===62||Me(I)?P(I):a(I)}function N(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):a(I)}function R(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),G}function G(I){return se(I)?ie(e,ue,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):ue(I)}function ue(I){return e.enter("htmlTextData"),i(I)}}var sy,yL=k(()=>{"use strict";Ot();je();sy={name:"htmlText",tokenize:Fz}});function jz(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&&_t(e,0,e.length,a),e}function Vz(e,t){let a=e.length,n=0,r,o,i,l;for(;a--;)if(r=e[a][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[a][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(i){if(e[a][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=a,r.type!=="labelLink")){n=2;break}}else r.type==="labelEnd"&&(i=a);let s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[o+n+2][1].end},end:{...e[i-2][1].start}};return l=[["enter",s,t],["enter",u,t]],l=ga(l,e.slice(o+1,o+n+3)),l=ga(l,[["enter",c,t]]),l=ga(l,ro(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),l=ga(l,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),l=ga(l,e.slice(i+1)),l=ga(l,[["exit",s,t]]),_t(e,o,e.length,l),e}function Wz(e,t,a){let n=this,r=n.events.length,o,i;for(;r--;)if((n.events[r][1].type==="labelImage"||n.events[r][1].type==="labelLink")&&!n.events[r][1]._balanced){o=n.events[r][1];break}return l;function l(f){return o?o._inactive?d(f):(i=n.parser.defined.includes(la(n.sliceSerialize({start:o.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),s):a(f)}function s(f){return f===40?e.attempt(zz,c,i?c:d)(f):f===91?e.attempt(qz,c,i?u:d)(f):i?c(f):d(f)}function u(f){return e.attempt(Hz,c,d)(f)}function c(f){return t(f)}function d(f){return o._balanced=!0,a(f)}}function Gz(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 Me(d)?Zo(e,o)(d):o(d)}function o(d){return d===41?c(d):_f(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return Me(d)?Zo(e,s)(d):c(d)}function l(d){return a(d)}function s(d){return d===34||d===39||d===40?Pf(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return Me(d)?Zo(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 $z(e,t,a){let n=this;return r;function r(l){return Of.call(n,e,o,i,"reference","referenceMarker","referenceString")(l)}function o(l){return n.parser.defined.includes(la(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):a(l)}function i(l){return a(l)}}function Xz(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 Qo,zz,qz,Hz,Nf=k(()=>{"use strict";Jw();ey();ty();ay();je();gr();xl();yu();Qo={name:"labelEnd",resolveAll:jz,resolveTo:Vz,tokenize:Wz},zz={tokenize:Gz},qz={tokenize:$z},Hz={tokenize:Xz}});function Kz(e,t,a){let n=this;return r;function r(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),i):a(l)}function i(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(l):t(l)}}var uy,xL=k(()=>{"use strict";Nf();uy={name:"labelStartImage",resolveAll:Qo.resolveAll,tokenize:Kz}});function Yz(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 cy,vL=k(()=>{"use strict";Nf();cy={name:"labelStartLink",resolveAll:Qo.resolveAll,tokenize:Yz}});function Zz(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ie(e,t,"linePrefix")}}var Su,bL=k(()=>{"use strict";Ot();Su={name:"lineEnding",tokenize:Zz}});function Qz(e,t,a){let n=0,r;return o;function o(u){return e.enter("thematicBreak"),i(u)}function i(u){return r=u,l(u)}function l(u){return u===r?(e.enter("thematicBreakSequence"),s(u)):n>=3&&(u===null||Z(u))?(e.exit("thematicBreak"),t(u)):a(u)}function s(u){return u===r?(e.consume(u),n++,s):(e.exit("thematicBreakSequence"),se(u)?ie(e,l,"whitespace")(u):l(u))}}var Jo,dy=k(()=>{"use strict";Ot();je();Jo={name:"thematicBreak",tokenize:Qz}});function t4(e,t,a){let n=this,r=n.events[n.events.length-1],o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,i=0;return l;function l(p){let m=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:gu(p)){if(n.containerState.type||(n.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Jo,a,u)(p):u(p);if(!n.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(p)}return a(p)}function s(p){return gu(p)&&++i<10?(e.consume(p),s):(!n.interrupt||i<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):a(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,e.check(zn,n.interrupt?a:c,e.attempt(Jz,f,d))}function c(p){return n.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return se(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):a(p)}function f(p){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function a4(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(zn,r,o);function r(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ie(e,t,"listItemIndent",n.containerState.size+1)(l)}function o(l){return n.containerState.furtherBlankLines||!se(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(e4,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,ie(e,e.attempt(sa,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function n4(e,t,a){let n=this;return ie(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 r4(e){e.exit(this.containerState.type)}function o4(e,t,a){let n=this;return ie(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!se(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var sa,Jz,e4,SL=k(()=>{"use strict";Ot();je();Tf();dy();sa={continuation:{tokenize:a4},exit:r4,name:"list",tokenize:t4},Jz={partial:!0,tokenize:o4},e4={partial:!0,tokenize:n4}});function i4(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 l4(e,t,a){let n=this,r;return o;function o(u){let c=n.events.length,d;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){d=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),r=u,i(u)):a(u)}function i(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),se(u)?ie(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||Z(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var Bf,IL=k(()=>{"use strict";Ot();je();Bf={name:"setextUnderline",resolveTo:i4,tokenize:l4}});var Uf=k(()=>{"use strict";tL();aL();Tf();nL();rL();oL();lL();sL();uL();dL();fL();pL();mL();wL();yL();Nf();xL();vL();bL();SL();IL();dy()});function fy(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:f4,continuation:{tokenize:p4},exit:m4}},text:{91:{name:"gfmFootnoteCall",tokenize:d4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:u4,resolveTo:c4}}}}function u4(e,t,a){let n=this,r=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),i;for(;r--;){let s=n.events[r][1];if(s.type==="labelImage"){i=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return l;function l(s){if(!i||!i._balanced)return a(s);let u=la(n.sliceSerialize({start:i.end,end:n.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?a(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),t(s))}}function c4(e,t){let a=e.length,n;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){n=e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[a+1],e[a+2],["enter",r,t],e[a+3],e[a+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(a,e.length-a+1,...s),e}function d4(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,i;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),s}function s(d){return d!==94?a(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(o>999||d===93&&!i||d===null||d===91||Me(d))return a(d);if(d===93){e.exit("chunkString");let f=e.exit("gfmFootnoteCallString");return r.includes(la(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(d)}return Me(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 f4(e,t,a){let n=this,r=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,i=0,l;return s;function s(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):a(m)}function c(m){if(i>999||m===93&&!l||m===null||m===91||Me(m))return a(m);if(m===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=la(n.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Me(m)||(l=!0),i++,e.consume(m),m===92?d:c}function d(m){return m===91||m===92||m===93?(e.consume(m),i++,c):c(m)}function f(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),r.includes(o)||r.push(o),ie(e,p,"gfmFootnoteDefinitionWhitespace")):a(m)}function p(m){return t(m)}}function p4(e,t,a){return e.check(zn,t,e.attempt(s4,t,a))}function m4(e){e.exit("gfmFootnoteDefinition")}function h4(e,t,a){let n=this;return ie(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 s4,CL=k(()=>{"use strict";Uf();Ot();je();xl();s4={tokenize:h4,partial:!0}});var kL=k(()=>{"use strict";CL()});function py(e){let a=(e||{}).singleTilde,n={name:"strikethrough",tokenize:o,resolveAll:r};return a==null&&(a=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(i,l){let s=-1;for(;++s<i.length;)if(i[s][0]==="enter"&&i[s][1].type==="strikethroughSequenceTemporary"&&i[s][1]._close){let u=s;for(;u--;)if(i[u][0]==="exit"&&i[u][1].type==="strikethroughSequenceTemporary"&&i[u][1]._open&&i[s][1].end.offset-i[s][1].start.offset===i[u][1].end.offset-i[u][1].start.offset){i[s][1].type="strikethroughSequence",i[u][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},i[u][1].start),end:Object.assign({},i[s][1].end)},d={type:"strikethroughText",start:Object.assign({},i[u][1].end),end:Object.assign({},i[s][1].start)},f=[["enter",c,l],["enter",i[u][1],l],["exit",i[u][1],l],["enter",d,l]],p=l.parser.constructs.insideSpan.null;p&&_t(f,f.length,0,ro(p,i.slice(u+1,s),l)),_t(f,f.length,0,[["exit",d,l],["enter",i[s][1],l],["exit",i[s][1],l],["exit",c,l]]),_t(i,u-1,s-u+3,f),s=u+f.length-2;break}}for(s=-1;++s<i.length;)i[s][1].type==="strikethroughSequenceTemporary"&&(i[s][1].type="data");return i}function o(i,l,s){let u=this.previous,c=this.events,d=0;return f;function f(m){return u===126&&c[c.length-1][1].type!=="characterEscape"?s(m):(i.enter("strikethroughSequenceTemporary"),p(m))}function p(m){let x=hr(u);if(m===126)return d>1?s(m):(i.consume(m),d++,p);if(d<2&&!a)return s(m);let S=i.exit("strikethroughSequenceTemporary"),w=hr(m);return S._open=!w||w===2&&!!x,S._close=!x||x===2&&!!w,l(m)}}}var TL=k(()=>{"use strict";gr();xf();yu()});var LL=k(()=>{"use strict";TL()});function g4(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 Ff,EL=k(()=>{"use strict";Ff=class{constructor(){this.map=[]}add(t,a,n){g4(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 ML(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 AL=k(()=>{"use strict"});function my(){return{flow:{null:{name:"table",tokenize:w4,resolveAll:y4}}}}function w4(e,t,a){let n=this,r=0,o=0,i;return l;function l(L){let $=n.events.length-1;for(;$>-1;){let W=n.events[$][1].type;if(W==="lineEnding"||W==="linePrefix")$--;else break}let H=$>-1?n.events[$][1].type:null,F=H==="tableHead"||H==="tableRow"?C:s;return F===C&&n.parser.lazy[n.now().line]?a(L):F(L)}function s(L){return e.enter("tableHead"),e.enter("tableRow"),u(L)}function u(L){return L===124||(i=!0,o+=1),c(L)}function c(L){return L===null?a(L):Z(L)?o>1?(o=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),p):a(L):se(L)?ie(e,c,"whitespace")(L):(o+=1,i&&(i=!1,r+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),i=!0,c):(e.enter("data"),d(L)))}function d(L){return L===null||L===124||Me(L)?(e.exit("data"),c(L)):(e.consume(L),L===92?f:d)}function f(L){return L===92||L===124?(e.consume(L),d):d(L)}function p(L){return n.interrupt=!1,n.parser.lazy[n.now().line]?a(L):(e.enter("tableDelimiterRow"),i=!1,se(L)?ie(e,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):m(L))}function m(L){return L===45||L===58?S(L):L===124?(i=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),x):T(L)}function x(L){return se(L)?ie(e,S,"whitespace")(L):S(L)}function S(L){return L===58?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),w):L===45?(o+=1,w(L)):L===null||Z(L)?b(L):T(L)}function w(L){return L===45?(e.enter("tableDelimiterFiller"),y(L)):T(L)}function y(L){return L===45?(e.consume(L),y):L===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),h):(e.exit("tableDelimiterFiller"),h(L))}function h(L){return se(L)?ie(e,b,"whitespace")(L):b(L)}function b(L){return L===124?m(L):L===null||Z(L)?!i||r!==o?T(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):T(L)}function T(L){return a(L)}function C(L){return e.enter("tableRow"),M(L)}function M(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),M):L===null||Z(L)?(e.exit("tableRow"),t(L)):se(L)?ie(e,M,"whitespace")(L):(e.enter("data"),D(L))}function D(L){return L===null||L===124||Me(L)?(e.exit("data"),M(L)):(e.consume(L),L===92?P:D)}function P(L){return L===92||L===124?(e.consume(L),D):D(L)}}function y4(e,t){let a=-1,n=!0,r=0,o=[0,0,0,0],i=[0,0,0,0],l=!1,s=0,u,c,d,f=new Ff;for(;++a<e.length;){let p=e[a],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,s!==0&&(RL(f,t,s,u,c),c=void 0,s=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(a,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,d=void 0,o=[0,0,0,0],i=[0,a+1,0,0],l&&(l=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(a,0,[["enter",c,t]])),r=m.type==="tableDelimiterRow"?2:c?3:1):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,i[2]===0&&(o[1]!==0&&(i[0]=i[1],d=zf(f,t,o,r,void 0,d),o=[0,0,0,0]),i[2]=a)):m.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(i[0]=i[1],d=zf(f,t,o,r,void 0,d)),o=i,i=[o[1],a,0,0])):m.type==="tableHead"?(l=!0,s=a):m.type==="tableRow"||m.type==="tableDelimiterRow"?(s=a,o[1]!==0?(i[0]=i[1],d=zf(f,t,o,r,a,d)):i[1]!==0&&(d=zf(f,t,i,r,a,d)),r=0):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(i[3]=a)}for(s!==0&&RL(f,t,s,u,c),f.consume(t.events),a=-1;++a<t.events.length;){let p=t.events[a];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=ML(t.events,a))}return e}function zf(e,t,a,n,r,o){let i=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",l="tableContent";a[0]!==0&&(o.end=Object.assign({},Cl(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));let s=Cl(t.events,a[1]);if(o={type:i,start:Object.assign({},s),end:Object.assign({},s)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){let u=Cl(t.events,a[2]),c=Cl(t.events,a[3]),d={type:l,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(a[2],0,[["enter",d,t]]),n!==2){let f=t.events[a[2]],p=t.events[a[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",a[3]>a[2]+1){let m=a[2]+1,x=a[3]-a[2]-1;e.add(m,x,[])}}e.add(a[3]+1,0,[["exit",d,t]])}return r!==void 0&&(o.end=Object.assign({},Cl(t.events,r)),e.add(r,0,[["exit",o,t]]),o=void 0),o}function RL(e,t,a,n,r){let o=[],i=Cl(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 Cl(e,t){let a=e[t],n=a[0]==="enter"?"start":"end";return a[1][n]}var DL=k(()=>{"use strict";Ot();je();EL();AL()});var _L=k(()=>{"use strict";DL()});function hy(){return{text:{91:x4}}}function v4(e,t,a){let n=this;return r;function r(s){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?a(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return Me(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),i):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),i):a(s)}function i(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):a(s)}function l(s){return Z(s)?t(s):se(s)?e.check({tokenize:b4},t,a)(s):a(s)}}function b4(e,t,a){return ie(e,n,"whitespace");function n(r){return r===null?a(r):t(r)}}var x4,OL=k(()=>{"use strict";Ot();je();x4={name:"tasklistCheck",tokenize:v4}});var PL=k(()=>{"use strict";OL()});function NL(e){return kf([$w(),fy(),py(e),my(),hy()])}var BL=k(()=>{"use strict";Ww();J1();kL();LL();_L();PL()});function qf(e){let t=this,a=e||S4,n=t.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(NL(a)),o.push(jw()),i.push(Vw(a))}var S4,UL=k(()=>{"use strict";H1();BL();S4={}});var FL=k(()=>{"use strict";UL()});var I4,C4,k4,zL,T4,L4,qL,VL,WL,E4,M4,A4,R4,D4,_4,O4,ei,GL,P4,N4,B4,U4,F4,z4,HL,oo,kl,q4,$L,jf,H4,XL,wy,j4,V4,KL,W4,G4,$4,X4,K4,Y4,Z4,Q4,J4,YL,eq,tq,aq,nq,rq,oq,Hf,iq,lq,sq,uq,cq,dq,fq,pq,mq,hq,jL,gq,ZL,wq,yq,xq,vq,bq,Sq,gy,$a,Iq,Cq,kq,QL,JL=k(()=>{"use strict";I4=Object.defineProperty,C4=Object.defineProperties,k4=Object.getOwnPropertyDescriptors,zL=Object.getOwnPropertySymbols,T4=Object.prototype.hasOwnProperty,L4=Object.prototype.propertyIsEnumerable,qL=(e,t,a)=>t in e?I4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,VL=(e,t)=>{for(var a in t||(t={}))T4.call(t,a)&&qL(e,a,t[a]);if(zL)for(var a of zL(t))L4.call(t,a)&&qL(e,a,t[a]);return e},WL=(e,t)=>C4(e,k4(t)),E4=/(\*\*)([^*]*\*?)$/,M4=/(__)([^_]*?)$/,A4=/(\*\*\*)([^*]*?)$/,R4=/(\*)([^*]*?)$/,D4=/(_)([^_]*?)$/,_4=/(`)([^`]*?)$/,O4=/(~~)([^~]*?)$/,ei=/^[\s_~*`]*$/,GL=/^[\s]*[-*+][\s]+$/,P4=/[\p{L}\p{N}_]/u,N4=/^```[^`\n]*```?$/,B4=/^\*{4,}$/,U4=/(__)([^_]+)_$/,F4=/(~~)([^~]+)~$/,z4=/__/g,HL=/~~/g,oo=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:P4.test(e)},kl=(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},q4=(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},$L=(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},jf=(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},H4=(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},
|
|
27
|
-
`){n=
|
|
28
|
-
`){r=
|
|
29
|
-
`){n=r+1;break}for(let r=n;r<t;r+=1)if(e[r]!==" "&&e[r]!==" ")return!1;return!0},
|
|
30
|
-
`),r=n===-1?0:n+1,o=e.substring(r,a);return
|
|
31
|
-
`)?!0:
|
|
32
|
-
`),r=n===-1?0:n+1,o=e.substring(r,a);return
|
|
33
|
-
`)?!0:
|
|
34
|
-
`;)t-=1;if(t<e.length){let a=e.slice(0,t),n=e.slice(t);return`${a}_${n}`}return`${e}_`},
|
|
35
|
-
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,
|
|
19
|
+
`});return d(),c(),p+`
|
|
20
|
+
`+(r===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
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:`
|
|
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},n_=(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]==="]"?M7(e,t):!1;if(e[a]===`
|
|
26
|
+
`)return!1}return!1},Eb=(e,t,a)=>{let n=0;for(let l=t-1;l>=0;l-=1)if(e[l]===`
|
|
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},R7=(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},D7=(e,t,a,n)=>a==="\\"||e.includes("$")&&eh(e,t)?!0:a!=="*"&&n==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(a==="*"||a&&n&&ni(a)&&ni(n)||R7(e,t,n)),r_=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]:"";D7(e,n,r,o)||(t+=1)}return t},_7=(e,t,a,n)=>!!(a==="\\"||e.includes("$")&&eh(e,t)||n_(e,t)||a==="_"||n==="_"||a&&n&&ni(a)&&ni(n)),P7=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]:"";_7(e,n,r,o)||(t+=1)}return t},O7=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},N7=(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 t_.test(o)&&t.includes(`
|
|
31
|
+
`)?!0:Eb(e,a,"*")},U7=e=>{let t=e.match(g7);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return Ql(e,n)||N7(e,a,n)?e:(e.match(/\*\*/g)||[]).length%2===1?a.endsWith("*")?`${e}*`:`${e}**`:e},B7=(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 t_.test(o)&&t.includes(`
|
|
33
|
+
`)?!0:Eb(e,a,"_")},z7=e=>{let t=e.match(y7);if(!t){let r=e.match(T7);if(r){let o=e.lastIndexOf(r[1]);if(!Ql(e,o)&&(e.match(E7)||[]).length%2===1)return`${e}_`}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?`${e}__`:e},F7=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="*"&&e[t-1]!=="*"&&e[t+1]!=="*"&&e[t-1]!=="\\"&&!eh(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},q7=e=>{if(!e.match(v7))return e;let t=F7(e);if(t===-1||Ql(e,t))return e;let a=e.substring(t+1);return!a||ms.test(a)?e:r_(e)%2===1?`${e}*`:e},o_=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="_"&&e[t-1]!=="_"&&e[t+1]!=="_"&&e[t-1]!=="\\"&&!eh(e,t)&&!n_(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},H7=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}_`},j7=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=o_(t);return a!==-1&&n!==-1&&a<n?`${t}_**`:null},V7=e=>{if(!e.match(x7))return e;let t=o_(e);if(t===-1||Ql(e,t))return e;let a=e.substring(t+1);if(!a||ms.test(a))return e;if(P7(e)%2===1){let n=j7(e);return n!==null?n:H7(e)}return e},$7=e=>{let t=(e.match(/\*\*/g)||[]).length,a=r_(e);return t%2===0&&a%2===0},W7=(e,t,a)=>!t||ms.test(t)||Ql(e,a)?!0:Eb(e,a,"*"),G7=e=>{if(k7.test(e))return e;let t=e.match(w7);if(!t)return e;let a=t[2],n=e.lastIndexOf(t[1]);return W7(e,a,n)?e:O7(e)%2===1?$7(e)?e:`${e}***`:e},Qm=(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},X7=(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},K7=e=>{let t=0;for(let a=0;a<e.length;a+=1)e[a]==="`"&&!X7(e,a)&&(t+=1);return t},Y7=e=>!e.match(C7)||e.includes(`
|
|
35
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,Z7=e=>(e.match(/```/g)||[]).length%2===1,J7=e=>{let t=Y7(e);if(t!==null)return t;let a=e.match(b7);if(a&&!Z7(e)){let n=a[2];if(!n||ms.test(n))return e;if(K7(e)%2===1)return`${e}\``}return e},Q7=(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)==="```",eW=e=>{let t=0,a=!1;for(let n=0;n<e.length-1;n+=1)e[n]==="`"&&!Q7(e,n)&&(a=!a),!a&&e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},tW=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},Sq=e=>{let t=e.match(O4);if(t){let a=t[2];if(!a||ei.test(a))return e;if((e.match(HL)||[]).length%2===1)return`${e}~~`}else if(e.match(F4)&&(e.match(HL)||[]).length%2===1)return`${e}~`;return e},gy=e=>e!==!1,$a={SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},Iq=[{handler:{name:"setextHeadings",handle:bq,priority:$a.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:ZL,priority:$a.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:oq,priority:$a.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:K4,priority:$a.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:Z4,priority:$a.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:J4,priority:$a.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:aq,priority:$a.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:cq,priority:$a.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:Sq,priority:$a.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:mq,priority:$a.KATEX},optionKey:"katex"}],Cq=e=>{var t;let a=(t=e?.linkMode)!=null?t:"protocol";return Iq.filter(({handler:n,optionKey:r})=>n.name==="links"?gy(e?.links)||gy(e?.images):gy(e?.[r])).map(({handler:n,earlyReturn:r})=>n.name==="links"?{handler:WL(VL({},n),{handle:o=>ZL(o,a)}),earlyReturn:a==="protocol"?r:void 0}:{handler:n,earlyReturn:r})},kq=(e,t)=>{var a;if(!e||typeof e!="string")return e;let n=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,r=Cq(t),o=((a=t?.handlers)!=null?a:[]).map(l=>{var s;return{handler:WL(VL({},l),{priority:(s=l.priority)!=null?s:$a.DEFAULT}),earlyReturn:void 0}}),i=[...r,...o].sort((l,s)=>{var u,c;return((u=l.handler.priority)!=null?u:$a.DEFAULT)-((c=s.handler.priority)!=null?c:$a.DEFAULT)});for(let{handler:l,earlyReturn:s}of i)if(n=l.handle(n),s!=null&&s(n))return n;return n},QL=kq});function eE(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var tE=k(()=>{"use strict"});function Vf(e,t){return((t||Eq).jsx?Lq:Tq).test(e)}var Tq,Lq,Eq,aE=k(()=>{"use strict";Tq=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Eq={}});var nE=k(()=>{"use strict";aE()});function yy(e){return typeof e=="object"?e.type==="text"?rE(e.value):!1:rE(e)}function rE(e){return e.replace(Mq,"")===""}var Mq,oE=k(()=>{"use strict";Mq=/[ \t\n\f\r]/g});var iE=k(()=>{"use strict";oE()});var yr,xy=k(()=>{"use strict";yr=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};yr.prototype.normal={};yr.prototype.property={};yr.prototype.space=void 0});function vy(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new yr(a,n,t)}var lE=k(()=>{"use strict";xy()});function Iu(e){return e.toLowerCase()}var by=k(()=>{"use strict"});var Qt,Sy=k(()=>{"use strict";Qt=class{constructor(t,a){this.attribute=a,this.property=t}};Qt.prototype.attribute="";Qt.prototype.booleanish=!1;Qt.prototype.boolean=!1;Qt.prototype.commaOrSpaceSeparated=!1;Qt.prototype.commaSeparated=!1;Qt.prototype.defined=!1;Qt.prototype.mustUseProperty=!1;Qt.prototype.number=!1;Qt.prototype.overloadedBoolean=!1;Qt.prototype.property="";Qt.prototype.spaceSeparated=!1;Qt.prototype.space=void 0});var Cu={};pc(Cu,{boolean:()=>be,booleanish:()=>Tt,commaOrSpaceSeparated:()=>Ra,commaSeparated:()=>io,number:()=>j,overloadedBoolean:()=>Wf,spaceSeparated:()=>at});function ti(){return 2**++Aq}var Aq,be,Tt,Wf,j,at,io,Ra,ku=k(()=>{"use strict";Aq=0,be=ti(),Tt=ti(),Wf=ti(),j=ti(),at=ti(),io=ti(),Ra=ti()});function sE(e,t,a){a&&(e[t]=a)}var Iy,ai,Cy=k(()=>{"use strict";Sy();ku();Iy=Object.keys(Cu),ai=class extends Qt{constructor(t,a,n,r){let o=-1;if(super(t,a),sE(this,"space",r),typeof n=="number")for(;++o<Iy.length;){let i=Iy[o];sE(this,Iy[o],(n&Cu[i])===Cu[i])}}};ai.prototype.defined=!0});function cn(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new ai(n,e.transform(e.attributes||{},n),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,a[Iu(n)]=n,a[Iu(o.attribute)]=n}return new yr(t,a,e.space)}var ni=k(()=>{"use strict";by();Cy();xy()});var ky,uE=k(()=>{"use strict";ni();ku();ky=cn({properties:{ariaActiveDescendant:null,ariaAtomic:Tt,ariaAutoComplete:null,ariaBusy:Tt,ariaChecked:Tt,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:Tt,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:Tt,ariaFlowTo:at,ariaGrabbed:Tt,ariaHasPopup:null,ariaHidden:Tt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:j,ariaLive:null,ariaModal:Tt,ariaMultiLine:Tt,ariaMultiSelectable:Tt,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:Tt,ariaReadOnly:Tt,ariaRelevant:null,ariaRequired:Tt,ariaRoleDescription:at,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:Tt,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}})});function Gf(e,t){return t in e?e[t]:t}var Ty=k(()=>{"use strict"});function $f(e,t){return Gf(e,t.toLowerCase())}var Ly=k(()=>{"use strict";Ty()});var cE,dE=k(()=>{"use strict";Ly();ni();ku();cE=cn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:io,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:at,autoFocus:be,autoPlay:be,blocking:at,capture:null,charSet:null,checked:be,cite:null,className:at,cols:j,colSpan:null,content:null,contentEditable:Tt,controls:be,controlsList:at,coords:j|io,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:Wf,draggable:Tt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:at,height:j,hidden:Wf,high:j,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:at,itemRef:at,itemScope:be,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:j,manifest:null,max:null,maxLength:j,media:null,method:null,min:null,minLength:j,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,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:be,optimum:j,pattern:null,ping:at,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:at,required:be,reversed:be,rows:j,rowSpan:j,sandbox:at,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shape:null,size:j,sizes:null,slot:null,span:j,spellCheck:Tt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:j,step:null,style:null,tabIndex:j,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:Tt,width:j,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:j,borderColor:null,bottomMargin:j,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:j,leftMargin:j,link:null,longDesc:null,lowSrc:null,marginHeight:j,marginWidth:j,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:j,rules:null,scheme:null,scrolling:Tt,standby:null,summary:null,text:null,topMargin:j,valueType:null,version:null,vAlign:null,vLink:null,vSpace:j,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:be,disableRemotePlayback:be,prefix:null,property:null,results:j,security:null,unselectable:null},space:"html",transform:$f})});var fE,pE=k(()=>{"use strict";Ty();ni();ku();fE=cn({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:Ra,accentHeight:j,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:j,amplitude:j,arabicForm:null,ascent:j,attributeName:null,attributeType:null,azimuth:j,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:j,by:null,calcMode:null,capHeight:j,className:at,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:j,diffuseConstant:j,direction:null,display:null,dur:null,divisor:j,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:j,enableBackground:null,end:null,event:null,exponent:j,externalResourcesRequired:null,fill:null,fillOpacity:j,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:io,g2:io,glyphName:io,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:j,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:j,horizOriginX:j,horizOriginY:j,id:null,ideographic:j,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:j,k:j,k1:j,k2:j,k3:j,k4:j,kernelMatrix:Ra,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:j,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:j,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:j,overlineThickness:j,paintOrder:null,panose1:null,path:null,pathLength:j,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:j,pointsAtY:j,pointsAtZ:j,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ra,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ra,rev:Ra,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ra,requiredFeatures:Ra,requiredFonts:Ra,requiredFormats:Ra,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:j,specularExponent:j,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:j,strikethroughThickness:j,string:null,stroke:null,strokeDashArray:Ra,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:j,strokeOpacity:j,strokeWidth:null,style:null,surfaceScale:j,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ra,tabIndex:j,tableValues:null,target:null,targetX:j,targetY:j,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ra,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:j,underlineThickness:j,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:j,values:null,vAlphabetic:j,vMathematical:j,vectorEffect:null,vHanging:j,vIdeographic:j,version:null,vertAdvY:j,vertOriginX:j,vertOriginY:j,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:j,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Gf})});var Ey,mE=k(()=>{"use strict";ni();Ey=cn({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 My,hE=k(()=>{"use strict";ni();Ly();My=cn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$f})});var Ay,gE=k(()=>{"use strict";ni();Ay=cn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var Ry,wE=k(()=>{"use strict";Ry={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 Dy(e,t){let a=Iu(t),n=t,r=Qt;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&Dq.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(yE,Oq);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!yE.test(o)){let i=o.replace(Rq,_q);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=ai}return new r(n,t)}function _q(e){return"-"+e.toLowerCase()}function Oq(e){return e.charAt(1).toUpperCase()}var Rq,yE,Dq,xE=k(()=>{"use strict";Cy();Sy();by();Rq=/[A-Z]/g,yE=/-[a-z]/g,Dq=/^data[-\w.:]+$/i});var vE,Xf,bE=k(()=>{"use strict";lE();uE();dE();pE();mE();hE();gE();wE();xE();vE=vy([ky,cE,Ey,My,Ay],"html"),Xf=vy([ky,fE,Ey,My,Ay],"svg")});function SE(e){return e.join(" ").trim()}var IE=k(()=>{"use strict"});var ME=oa((Vte,EE)=>{"use strict";var CE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Pq=/\n/g,Nq=/^\s*/,Bq=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Uq=/^:\s*/,Fq=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,zq=/^[;\s]*/,qq=/^\s+|\s+$/g,Hq=`
|
|
42
|
-
`,kE="/",TE="*",ri="",jq="comment",Vq="declaration";function Wq(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var a=1,n=1;function r(m){var x=m.match(Pq);x&&(a+=x.length);var S=m.lastIndexOf(Hq);n=~S?m.length-S:n+m.length}function o(){var m={line:a,column:n};return function(x){return x.position=new i(m),u(),x}}function i(m){this.start=m,this.end={line:a,column:n},this.source=t.source}i.prototype.content=e;function l(m){var x=new Error(t.source+":"+a+":"+n+": "+m);if(x.reason=m,x.filename=t.source,x.line=a,x.column=n,x.source=e,!t.silent)throw x}function s(m){var x=m.exec(e);if(x){var S=x[0];return r(S),e=e.slice(S.length),x}}function u(){s(Nq)}function c(m){var x;for(m=m||[];x=d();)x!==!1&&m.push(x);return m}function d(){var m=o();if(!(kE!=e.charAt(0)||TE!=e.charAt(1))){for(var x=2;ri!=e.charAt(x)&&(TE!=e.charAt(x)||kE!=e.charAt(x+1));)++x;if(x+=2,ri===e.charAt(x-1))return l("End of comment missing");var S=e.slice(2,x-2);return n+=2,r(S),e=e.slice(x),n+=2,m({type:jq,comment:S})}}function f(){var m=o(),x=s(Bq);if(x){if(d(),!s(Uq))return l("property missing ':'");var S=s(Fq),w=m({type:Vq,property:LE(x[0].replace(CE,ri)),value:S?LE(S[0].replace(CE,ri)):ri});return s(zq),w}}function p(){var m=[];c(m);for(var x;x=f();)x!==!1&&(m.push(x),c(m));return m}return u(),p()}function LE(e){return e?e.replace(qq,ri):ri}EE.exports=Wq});var AE=oa(Tu=>{"use strict";var Gq=Tu&&Tu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tu,"__esModule",{value:!0});Tu.default=Xq;var $q=Gq(ME());function Xq(e,t){let a=null;if(!e||typeof e!="string")return a;let n=(0,$q.default)(e),r=typeof t=="function";return n.forEach(o=>{if(o.type!=="declaration")return;let{property:i,value:l}=o;r?t(i,l,o):l&&(a=a||{},a[i]=l)}),a}});var DE=oa(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.camelCase=void 0;var Kq=/^--[a-zA-Z0-9_-]+$/,Yq=/-([a-z])/g,Zq=/^[^-]+$/,Qq=/^-(webkit|moz|ms|o|khtml)-/,Jq=/^-(ms)-/,e5=function(e){return!e||Zq.test(e)||Kq.test(e)},t5=function(e,t){return t.toUpperCase()},RE=function(e,t){return"".concat(t,"-")},a5=function(e,t){return t===void 0&&(t={}),e5(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Jq,RE):e=e.replace(Qq,RE),e.replace(Yq,t5))};Kf.camelCase=a5});var OE=oa((Oy,_E)=>{"use strict";var n5=Oy&&Oy.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},r5=n5(AE()),o5=DE();function _y(e,t){var a={};return!e||typeof e!="string"||(0,r5.default)(e,function(n,r){n&&r&&(a[(0,o5.camelCase)(n,t)]=r)}),a}_y.default=_y;_E.exports=_y});function lo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?PE(e.position):"start"in e||"end"in e?PE(e):"line"in e||"column"in e?Py(e):""}function Py(e){return NE(e&&e.line)+":"+NE(e&&e.column)}function PE(e){return Py(e&&e.start)+"-"+Py(e&&e.end)}function NE(e){return e&&typeof e=="number"?e:1}var BE=k(()=>{"use strict"});var Ny=k(()=>{"use strict";BE()});var Pt,UE=k(()=>{"use strict";Ny();Pt=class extends Error{constructor(t,a,n){super(),typeof a=="string"&&(n=a,a=void 0);let r="",o={},i=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof t=="string"?r=t:!o.cause&&t&&(i=!0,r=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof n=="string"){let s=n.indexOf(":");s===-1?o.ruleId=n:(o.source=n.slice(0,s),o.ruleId=n.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){let s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}let l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=lo(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}};Pt.prototype.file="";Pt.prototype.name="";Pt.prototype.reason="";Pt.prototype.message="";Pt.prototype.stack="";Pt.prototype.column=void 0;Pt.prototype.line=void 0;Pt.prototype.ancestors=void 0;Pt.prototype.cause=void 0;Pt.prototype.fatal=void 0;Pt.prototype.place=void 0;Pt.prototype.ruleId=void 0;Pt.prototype.source=void 0});var By=k(()=>{"use strict";UE()});function Fy(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=w5(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=g5(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"?Xf:vE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=qE(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function qE(e,t,a){if(t.type==="element")return c5(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return d5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return p5(e,t,a);if(t.type==="mdxjsEsm")return f5(e,t);if(t.type==="root")return m5(e,t,a);if(t.type==="text")return h5(e,t)}function c5(e,t,a){let n=e.schema,r=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Xf,e.schema=r),e.ancestors.push(t);let o=jE(e,t.tagName,!1),i=y5(e,t),l=qy(e,t);return s5.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!yy(s):!0})),HE(e,i,o,t),zy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function d5(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)}Lu(e,t.position)}function f5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lu(e,t.position)}function p5(e,t,a){let n=e.schema,r=n;t.name==="svg"&&n.space==="html"&&(r=Xf,e.schema=r),e.ancestors.push(t);let o=t.name===null?e.Fragment:jE(e,t.name,!0),i=x5(e,t),l=qy(e,t);return HE(e,i,o,t),zy(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function m5(e,t,a){let n={};return zy(n,qy(e,t)),e.create(t,e.Fragment,n,a)}function h5(e,t){return t.value}function HE(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function zy(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function g5(e,t,a){return n;function n(r,o,i,l){let u=Array.isArray(i.children)?a:t;return l?u(o,i,l):u(o,i)}}function w5(e,t){return a;function a(n,r,o,i){let l=Array.isArray(o.children),s=yl(n);return t(r,o,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function y5(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&Uy.call(t.properties,r)){let o=v5(e,r,t.properties[r]);if(o){let[i,l]=o;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&u5.has(t.tagName)?n=l:a[i]=l}}if(n){let o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return a}function x5(e,t){let a={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let o=n.data.estree.body[0];o.type;let i=o.expression;i.type;let l=i.properties[0];l.type,Object.assign(a,e.evaluater.evaluateExpression(l.argument))}else Lu(e,t.position);else{let r=n.name,o;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let l=n.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Lu(e,t.position);else o=n.value===null?!0:n.value;a[r]=o}return a}function qy(e,t){let a=[],n=-1,r=e.passKeys?new Map:i5;for(;++n<t.children.length;){let o=t.children[n],i;if(e.passKeys){let s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){let u=r.get(s)||0;i=s+"-"+u,r.set(s,u+1)}}let l=qE(e,o,i);l!==void 0&&a.push(l)}return a}function v5(e,t,a){let n=Dy(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?eE(a):SE(a)),n.property==="style"){let r=typeof a=="object"?a:b5(e,String(a));return e.stylePropertyNameCase==="css"&&(r=S5(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?Ry[n.property]||n.property:n.attribute,a]}}function b5(e,t){try{return(0,FE.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new Pt("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=zE+"#cannot-parse-style-attribute",r}}function jE(e,t,a){let n;if(!a)n={type:"Literal",value:t};else if(t.includes(".")){let r=t.split("."),o=-1,i;for(;++o<r.length;){let l=Vf(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};i=i?{type:"MemberExpression",object:i,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}n=i}else n=Vf(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let r=n.value;return Uy.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(n);Lu(e)}function Lu(e,t){let a=new Pt("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=zE+"#cannot-handle-mdx-estrees-without-createevaluater",a}function S5(e){let t={},a;for(a in e)Uy.call(e,a)&&(t[I5(a)]=e[a]);return t}function I5(e){let t=e.replace(l5,C5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function C5(e){return"-"+e.toLowerCase()}var FE,Uy,i5,l5,s5,u5,zE,VE=k(()=>{"use strict";tE();nE();iE();bE();IE();FE=z(OE(),1);mu();By();Uy={}.hasOwnProperty,i5=new Map,l5=/[A-Z]/g,s5=new Set(["table","tbody","thead","tfoot","tr"]),u5=new Set(["td","th"]),zE="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var WE=k(()=>{"use strict";VE()});function k5(e){let t=e.attempt(this.parser.constructs.contentInitial,n,r),a;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ie(e,t,"linePrefix")}function r(l){return e.enter("paragraph"),o(l)}function o(l){let s=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=s),a=s,i(l)}function i(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Z(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),i)}}var GE,$E=k(()=>{"use strict";Ot();je();GE={tokenize:k5}});function T5(e){let t=this,a=[],n=0,r,o,i;return l;function l(h){if(n<a.length){let b=a[n];return t.containerState=b[1],e.attempt(b[0].continuation,s,u)(h)}return u(h)}function s(h){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();let b=t.events.length,T=b,C;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){C=t.events[T][1].end;break}w(n);let M=b;for(;M<t.events.length;)t.events[M][1].end={...C},M++;return _t(t.events,T+1,0,t.events.slice(b)),t.events.length=M,u(h)}return l(h)}function u(h){if(n===a.length){if(!r)return f(h);if(r.currentConstruct&&r.currentConstruct.concrete)return m(h);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(XE,c,d)(h)}function c(h){return r&&y(),w(n),f(h)}function d(h){return t.parser.lazy[t.now().line]=n!==a.length,i=t.now().offset,m(h)}function f(h){return t.containerState={},e.attempt(XE,p,m)(h)}function p(h){return n++,a.push([t.currentConstruct,t.containerState]),f(h)}function m(h){if(h===null){r&&y(),w(0),e.consume(h);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),x(h)}function x(h){if(h===null){S(e.exit("chunkFlow"),!0),w(0),e.consume(h);return}return Z(h)?(e.consume(h),S(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(h),x)}function S(h,b){let T=t.sliceStream(h);if(b&&T.push(null),h.previous=o,o&&(o.next=h),o=h,r.defineSkip(h.start),r.write(T),t.parser.lazy[h.start.line]){let C=r.events.length;for(;C--;)if(r.events[C][1].start.offset<i&&(!r.events[C][1].end||r.events[C][1].end.offset>i))return;let M=t.events.length,D=M,P,L;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(P){L=t.events[D][1].end;break}P=!0}for(w(n),C=M;C<t.events.length;)t.events[C][1].end={...L},C++;_t(t.events,D+1,0,t.events.slice(M)),t.events.length=C}}function w(h){let b=a.length;for(;b-- >h;){let T=a[b];t.containerState=T[1],T[0].exit.call(t,e)}a.length=h}function y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function L5(e,t,a){return ie(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var KE,XE,YE=k(()=>{"use strict";Ot();je();gr();KE={tokenize:T5},XE={tokenize:L5}});function E5(e){let t=this,a=e.attempt(zn,n,e.attempt(this.parser.constructs.flowInitial,r,ie(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Qw,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 ZE,QE=k(()=>{"use strict";Uf();Ot();ZE={tokenize:E5}});function aM(e){return{resolveAll:nM(e==="text"?M5:void 0),tokenize:t};function t(a){let n=this,r=this.parser.constructs[e],o=a.attempt(r,i,l);return i;function i(c){return u(c)?o(c):l(c)}function l(c){if(c===null){a.consume(c);return}return a.enter("data"),a.consume(c),s}function s(c){return u(c)?(a.exit("data"),o(c)):(a.consume(c),s)}function u(c){if(c===null)return!0;let d=r[c],f=-1;if(d)for(;++f<d.length;){let p=d[f];if(!p.previous||p.previous.call(n,n.previous))return!0}return!1}}}function nM(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 M5(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){let n=e[a-1][1],r=t.sliceStream(n),o=r.length,i=-1,l=0,s;for(;o--;){let u=r[o];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)l++,i--;if(i)break;i=-1}else if(u===-2)s=!0,l++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(l=0),l){let u={type:a===e.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?i:n.start._bufferIndex+i,_index:n.start._index+o,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(e.splice(a,0,["enter",u,t],["exit",u,t]),a+=2)}a++}return e}var JE,eM,tM,Hy=k(()=>{"use strict";JE={resolveAll:nM()},eM=aM("string"),tM=aM("text")});var jy={};pc(jy,{attentionMarkers:()=>B5,contentInitial:()=>R5,disable:()=>U5,document:()=>A5,flow:()=>_5,flowInitial:()=>D5,insideSpan:()=>N5,string:()=>O5,text:()=>P5});var A5,R5,D5,_5,O5,P5,N5,B5,U5,rM=k(()=>{"use strict";Uf();Hy();A5={42:sa,43:sa,45:sa,48:sa,49:sa,50:sa,51:sa,52:sa,53:sa,54:sa,55:sa,56:sa,57:sa,62:Lf},R5={91:ny},D5={[-2]:vu,[-1]:vu,32:vu},_5={35:oy,42:Jo,45:[Bf,Jo],60:ly,61:Bf,95:Jo,96:Af,126:Af},O5={38:Mf,92:Ef},P5={[-5]:Su,[-4]:Su,[-3]:Su,33:uy,38:Mf,42:xu,60:[Kw,sy],91:cy,92:[ry,Ef],93:Qo,95:xu,96:Yw},N5={null:[xu,JE]},B5={null:[42,95]},U5={null:[]}});function oM(e,t,a){let n={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0},r={},o=[],i=[],l=[],s=!0,u={attempt:P(M),check:P(D),consume:b,enter:T,exit:C,interrupt:P(D,{interrupt:!0})},c={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:m,sliceStream:x,write:p},d=t.tokenize.call(c,u),f;return t.resolveAll&&o.push(t),c;function p(F){return i=ga(i,F),y(),i[i.length-1]!==null?[]:(L(t,0),c.events=ro(o,c.events,c),c.events)}function m(F,W){return z5(x(F),W)}function x(F){return F5(i,F)}function S(){let{_bufferIndex:F,_index:W,line:V,column:N,offset:R}=n;return{_bufferIndex:F,_index:W,line:V,column:N,offset:R}}function w(F){r[F.line]=F.column,H()}function y(){let F;for(;n._index<i.length;){let W=i[n._index];if(typeof W=="string")for(F=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===F&&n._bufferIndex<W.length;)h(W.charCodeAt(n._bufferIndex));else h(W)}}function h(F){s=void 0,f=F,d=d(F)}function b(F){Z(F)?(n.line++,n.column=1,n.offset+=F===-3?2:1,H()):F!==-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=F,s=!0}function T(F,W){let V=W||{};return V.type=F,V.start=S(),c.events.push(["enter",V,c]),l.push(V),V}function C(F){let W=l.pop();return W.end=S(),c.events.push(["exit",W,c]),W}function M(F,W){L(F,W.from)}function D(F,W){W.restore()}function P(F,W){return V;function V(N,R,G){let ue,I,We,Je;return Array.isArray(N)?K(N):"tokenize"in N?K([N]):v(N);function v(me){return ye;function ye(le){let de=le!==null&&me[le],Q=le!==null&&me.null,Be=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(Q)?Q:Q?[Q]:[]];return K(Be)(le)}}function K(me){return ue=me,I=0,me.length===0?G:ee(me[I])}function ee(me){return ye;function ye(le){return Je=$(),We=me,me.partial||(c.currentConstruct=me),me.name&&c.parser.constructs.disable.null.includes(me.name)?Ge(le):me.tokenize.call(W?Object.assign(Object.create(c),W):c,u,we,Ge)(le)}}function we(me){return s=!0,F(We,Je),R}function Ge(me){return s=!0,Je.restore(),++I<ue.length?ee(ue[I]):G}}}function L(F,W){F.resolveAll&&!o.includes(F)&&o.push(F),F.resolve&&_t(c.events,W,c.events.length-W,F.resolve(c.events.slice(W),c)),F.resolveTo&&(c.events=F.resolveTo(c.events,c))}function $(){let F=S(),W=c.previous,V=c.currentConstruct,N=c.events.length,R=Array.from(l);return{from:N,restore:G};function G(){n=F,c.previous=W,c.currentConstruct=V,c.events.length=N,l=R,H()}}function H(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function F5(e,t){let a=t.start._index,n=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex,i;if(a===r)i=[e[a].slice(n,o)];else{if(i=e.slice(a,r),n>-1){let l=i[0];typeof l=="string"?i[0]=l.slice(n):i.shift()}o>0&&i.push(e[r].slice(0,o))}return i}function z5(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}$$`},aW=e=>eW(e)%2===0?e:tW(e),nW=(e,t,a)=>{if(e.substring(t+2).includes(")"))return null;let n=A7(e,t);if(n===-1||Qm(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)`},JD=(e,t)=>{for(let a=0;a<=t;a++)if(e[a]==="["&&!Qm(e,a)){if(a>0&&e[a-1]==="!")continue;let n=a_(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},rW=(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=JD(e,t);return s!==-1?e.substring(0,s)+e.substring(s+1):`${i}${o}`}return`${e}](streamdown:incomplete-link)`}if(a_(e,t)===-1){let i=e.substring(0,r);if(n)return i;if(a==="text-only"){let s=JD(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},i_=(e,t="protocol")=>{let a=e.lastIndexOf("](");if(a!==-1&&!Qm(e,a)){let n=nW(e,a,t);if(n!==null)return n}for(let n=e.length-1;n>=0;n-=1)if(e[n]==="["&&!Qm(e,n)){let r=rW(e,n,t);if(r!==null)return r}return e},oW=/^-{1,2}$/,iW=/^[\s]*-{1,2}[\s]+$/,sW=/^={1,2}$/,lW=/^[\s]*={1,2}[\s]+$/,uW=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(oW.test(r)&&!a.match(iW)){let o=n.split(`
|
|
40
|
+
`).at(-1);if(o&&o.trim().length>0)return`${e}\u200B`}if(sW.test(r)&&!a.match(lW)){let o=n.split(`
|
|
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=`
|
|
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 iM=k(()=>{"use strict";je();gr();yu()});function Vy(e){let n={constructs:kf([jy,...(e||{}).extensions||[]]),content:r(GE),defined:[],document:r(KE),flow:r(ZE),lazy:{},string:r(eM),text:r(tM)};return n;function r(o){return i;function i(l){return oM(n,o,l)}}}var lM=k(()=>{"use strict";Ww();$E();YE();QE();Hy();rM();iM()});function Wy(e){for(;!Df(e););return e}var sM=k(()=>{"use strict";Zw()});function Gy(){let e=1,t="",a=!0,n;return r;function r(o,i,l){let s=[],u,c,d,f,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(i||void 0).decode(o)),d=0,t="",a&&(o.charCodeAt(0)===65279&&d++,a=void 0);d<o.length;){if(uM.lastIndex=d,u=uM.exec(o),f=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(f),!u){t=o.slice(d);break}if(p===10&&d===f&&n)s.push(-3),n=void 0;else switch(n&&(s.push(-5),n=void 0),d<f&&(s.push(o.slice(d,f)),e+=f-d),p){case 0:{s.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,s.push(-2);e++<c;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:n=!0,e=1}d=f+1}return l&&(n&&s.push(-5),t&&s.push(t),s.push(null)),s}}var uM,cM=k(()=>{"use strict";uM=/[\0\t\n\r]/g});var dM=k(()=>{"use strict";lM();sM();cM()});function $y(e,t,a){return typeof t!="string"&&(a=t,t=void 0),q5(a)(Wy(Vy(a).document().write(Gy()(e,t,!0))))}function q5(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Oe),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(_e),blockQuote:o(le),characterEscape:P,characterReference:P,codeFenced:o(de),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(de,i),codeText:o(Q,i),codeTextData:P,data:P,codeFlowValue:P,definition:o(Be),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o(qe),hardBreakEscape:o(ke),hardBreakTrailing:o(ke),htmlFlow:o(xe,i),htmlFlowData:P,htmlText:o(xe,i),htmlTextData:P,image:o(Y),label:i,link:o(Oe),listItem:o(ba),listItemValue:f,listOrdered:o(rt,d),listUnordered:o(rt),paragraph:o(Sa),reference:v,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(_e),strong:o(ra),thematicBreak:o(wo)},exit:{atxHeading:s(),atxHeadingSequence:T,autolink:s(),autolinkEmail:ye,autolinkProtocol:me,blockQuote:s(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:we,characterReference:Ge,codeFenced:s(S),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:L,codeIndented:s(w),codeText:s(V),codeTextData:L,data:L,definition:s(),definitionDestinationString:b,definitionLabelString:y,definitionTitleString:h,emphasis:s(),hardBreakEscape:s(H),hardBreakTrailing:s(H),htmlFlow:s(F),htmlFlowData:L,htmlText:s(W),htmlTextData:L,image:s(R),label:ue,labelText:G,lineEnding:$,link:s(N),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:K,resourceDestinationString:I,resourceTitleString:We,resource:Je,setextHeading:s(D),setextHeadingLineSequence:M,setextHeadingText:C,strong:s(),thematicBreak:s()}};mM(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(A){let U={type:"root",children:[]},J={stack:[U],tokenStack:[],config:t,enter:l,exit:u,buffer:i,resume:c,data:a},oe=[],Ae=-1;for(;++Ae<A.length;)if(A[Ae][1].type==="listOrdered"||A[Ae][1].type==="listUnordered")if(A[Ae][0]==="enter")oe.push(Ae);else{let zt=oe.pop();Ae=r(A,zt,Ae)}for(Ae=-1;++Ae<A.length;){let zt=t[A[Ae][0]];pM.call(zt,A[Ae][1].type)&&zt[A[Ae][1].type].call(Object.assign({sliceSerialize:A[Ae][2].sliceSerialize},J),A[Ae][1])}if(J.tokenStack.length>0){let zt=J.tokenStack[J.tokenStack.length-1];(zt[1]||fM).call(J,void 0,zt[0])}for(U.position={start:so(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:so(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae<t.transforms.length;)U=t.transforms[Ae](U)||U;return U}function r(A,U,J){let oe=U-1,Ae=-1,zt=!1,Wt,Ia,Vn,gn;for(;++oe<=J;){let Gt=A[oe];switch(Gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Gt[0]==="enter"?Ae++:Ae--,gn=void 0;break}case"lineEndingBlank":{Gt[0]==="enter"&&(Wt&&!gn&&!Ae&&!Vn&&(Vn=oe),gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:gn=void 0}if(!Ae&&Gt[0]==="enter"&&Gt[1].type==="listItemPrefix"||Ae===-1&&Gt[0]==="exit"&&(Gt[1].type==="listUnordered"||Gt[1].type==="listOrdered")){if(Wt){let ca=oe;for(Ia=void 0;ca--;){let wn=A[ca];if(wn[1].type==="lineEnding"||wn[1].type==="lineEndingBlank"){if(wn[0]==="exit")continue;Ia&&(A[Ia][1].type="lineEndingBlank",zt=!0),wn[1].type="lineEnding",Ia=ca}else if(!(wn[1].type==="linePrefix"||wn[1].type==="blockQuotePrefix"||wn[1].type==="blockQuotePrefixWhitespace"||wn[1].type==="blockQuoteMarker"||wn[1].type==="listItemIndent"))break}Vn&&(!Ia||Vn<Ia)&&(Wt._spread=!0),Wt.end=Object.assign({},Ia?A[Ia][1].start:Gt[1].end),A.splice(Ia||oe,0,["exit",Wt,Gt[2]]),oe++,J++}if(Gt[1].type==="listItemPrefix"){let ca={type:"listItem",_spread:!1,start:Object.assign({},Gt[1].start),end:void 0};Wt=ca,A.splice(oe,0,["enter",ca,Gt[2]]),oe++,J++,Vn=void 0,gn=!0}}}return A[U][1]._spread=zt,J}function o(A,U){return J;function J(oe){l.call(this,A(oe),oe),U&&U.call(this,oe)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(A,U,J){this.stack[this.stack.length-1].children.push(A),this.stack.push(A),this.tokenStack.push([U,J||void 0]),A.position={start:so(U.start),end:void 0}}function s(A){return U;function U(J){A&&A.call(this,J),u.call(this,J)}}function u(A,U){let J=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==A.type&&(U?U.call(this,A,oe[0]):(oe[1]||fM).call(this,A,oe[0]));else throw new Error("Cannot close `"+A.type+"` ("+lo({start:A.start,end:A.end})+"): it\u2019s not open");J.position.end=so(A.end)}function c(){return Xo(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(A){if(this.data.expectingFirstListItemValue){let U=this.stack[this.stack.length-2];U.start=Number.parseInt(this.sliceSerialize(A),10),this.data.expectingFirstListItemValue=void 0}}function p(){let A=this.resume(),U=this.stack[this.stack.length-1];U.lang=A}function m(){let A=this.resume(),U=this.stack[this.stack.length-1];U.meta=A}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){let A=this.resume(),U=this.stack[this.stack.length-1];U.value=A.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){let A=this.resume(),U=this.stack[this.stack.length-1];U.value=A.replace(/(\r?\n|\r)$/g,"")}function y(A){let U=this.resume(),J=this.stack[this.stack.length-1];J.label=U,J.identifier=la(this.sliceSerialize(A)).toLowerCase()}function h(){let A=this.resume(),U=this.stack[this.stack.length-1];U.title=A}function b(){let A=this.resume(),U=this.stack[this.stack.length-1];U.url=A}function T(A){let U=this.stack[this.stack.length-1];if(!U.depth){let J=this.sliceSerialize(A).length;U.depth=J}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function M(A){let U=this.stack[this.stack.length-1];U.depth=this.sliceSerialize(A).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function P(A){let J=this.stack[this.stack.length-1].children,oe=J[J.length-1];(!oe||oe.type!=="text")&&(oe=pi(),oe.position={start:so(A.start),end:void 0},J.push(oe)),this.stack.push(oe)}function L(A){let U=this.stack.pop();U.value+=this.sliceSerialize(A),U.position.end=so(A.end)}function $(A){let U=this.stack[this.stack.length-1];if(this.data.atHardBreak){let J=U.children[U.children.length-1];J.position.end=so(A.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(U.type)&&(P.call(this,A),L.call(this,A))}function H(){this.data.atHardBreak=!0}function F(){let A=this.resume(),U=this.stack[this.stack.length-1];U.value=A}function W(){let A=this.resume(),U=this.stack[this.stack.length-1];U.value=A}function V(){let A=this.resume(),U=this.stack[this.stack.length-1];U.value=A}function N(){let A=this.stack[this.stack.length-1];if(this.data.inReference){let U=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=U,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function R(){let A=this.stack[this.stack.length-1];if(this.data.inReference){let U=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=U,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function G(A){let U=this.sliceSerialize(A),J=this.stack[this.stack.length-2];J.label=_1(U),J.identifier=la(U).toLowerCase()}function ue(){let A=this.stack[this.stack.length-1],U=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){let oe=A.children;J.children=oe}else J.alt=U}function I(){let A=this.resume(),U=this.stack[this.stack.length-1];U.url=A}function We(){let A=this.resume(),U=this.stack[this.stack.length-1];U.title=A}function Je(){this.data.inReference=void 0}function v(){this.data.referenceType="collapsed"}function K(A){let U=this.resume(),J=this.stack[this.stack.length-1];J.label=U,J.identifier=la(this.sliceSerialize(A)).toLowerCase(),this.data.referenceType="full"}function ee(A){this.data.characterReferenceType=A.type}function we(A){let U=this.sliceSerialize(A),J=this.data.characterReferenceType,oe;J?(oe=Cf(U,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=Il(U);let Ae=this.stack[this.stack.length-1];Ae.value+=oe}function Ge(A){let U=this.stack.pop();U.position.end=so(A.end)}function me(A){L.call(this,A);let U=this.stack[this.stack.length-1];U.url=this.sliceSerialize(A)}function ye(A){L.call(this,A);let U=this.stack[this.stack.length-1];U.url="mailto:"+this.sliceSerialize(A)}function le(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function Q(){return{type:"inlineCode",value:""}}function Be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qe(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function ke(){return{type:"break"}}function xe(){return{type:"html",value:""}}function Y(){return{type:"image",title:null,url:"",alt:null}}function Oe(){return{type:"link",title:null,url:"",children:[]}}function rt(A){return{type:"list",ordered:A.type==="listOrdered",start:null,spread:A._spread,children:[]}}function ba(A){return{type:"listItem",spread:A._spread,checked:null,children:[]}}function Sa(){return{type:"paragraph",children:[]}}function ra(){return{type:"strong",children:[]}}function pi(){return{type:"text",value:""}}function wo(){return{type:"thematicBreak"}}}function so(e){return{line:e.line,column:e.column,offset:e.offset}}function mM(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?mM(e,n):H5(e,n)}}function H5(e,t){let a;for(a in t)if(pM.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 fM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+lo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+lo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+lo({start:t.start,end:t.end})+") is still open")}var pM,hM=k(()=>{"use strict";vf();dM();Nw();O1();xl();If();Ny();pM={}.hasOwnProperty});var gM=k(()=>{"use strict";hM()});function Yf(e){let t=this;t.parser=a;function a(n){return $y(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var wM=k(()=>{"use strict";gM()});var yM=k(()=>{"use strict";wM()});function xM(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 vM=k(()=>{"use strict"});function bM(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
45
|
-
`}]}var
|
|
46
|
-
`:"",n={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(n.className=["language-"+r[0]]);let o={type:"element",tagName:"code",properties:n,children:[{type:"text",value:a}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}var
|
|
47
|
-
`}),c.type==="element"&&c.tagName==="p"&&!r?i.push(...c.children):i.push(c)}let
|
|
48
|
-
`});let u={type:"element",tagName:"li",properties:o,children:i};return e.patch(t,u),e.applyData(t,u)}function
|
|
49
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(
|
|
50
|
-
`}]}}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 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 RP=L(()=>{"use strict"});function DP(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 _P=L(()=>{"use strict"});function PP(e,t){let a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var OP=L(()=>{"use strict"});function NP(e,t){let a={type:"element",tagName:"em",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=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),r=Fn(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 zP=L(()=>{"use strict";cs()});function FP(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 qP=L(()=>{"use strict"});function HP(e,t){if(e.options.allowDangerousHtml){let a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}var jP=L(()=>{"use strict"});function lh(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 oS=L(()=>{"use strict"});function VP(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return lh(e,t);let r={src:Fn(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 $P=L(()=>{"use strict";cs();oS()});function WP(e,t){let a={src:Fn(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 GP=L(()=>{"use strict";cs()});function XP(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 KP=L(()=>{"use strict"});function YP(e,t){let a=String(t.identifier).toUpperCase(),n=e.definitionById.get(a);if(!n)return lh(e,t);let r={href:Fn(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 ZP=L(()=>{"use strict";cs();oS()});function JP(e,t){let a={href:Fn(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 QP=L(()=>{"use strict";cs()});function eO(e,t,a){let n=e.all(t),r=a?RG(a):tO(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
|
+
`}),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 RG(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let a=e.children,n=-1;for(;!t&&++n<a.length;)t=tO(a[n])}return t}function tO(e){let t=e.spread;return t??e.children.length>1}var aO=L(()=>{"use strict"});function nO(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 rO=L(()=>{"use strict"});function oO(e,t){let a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var iO=L(()=>{"use strict"});function sO(e,t){let a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}var lO=L(()=>{"use strict"});function uO(e,t){let a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var cO=L(()=>{"use strict"});function dO(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=Tm(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 fO=L(()=>{"use strict";fd()});function pO(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 mO=L(()=>{"use strict"});function hO(e,t){let a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var gO=L(()=>{"use strict"});function wO(e){let t=String(e),a=/\r?\n|\r/g,n=a.exec(t),r=0,o=[];for(;n;)o.push(yO(t.slice(r,n.index),r>0,!0),n[0]),r=n.index+n[0].length,n=a.exec(t);return o.push(yO(t.slice(r),r>0,!1)),o.join("")}function yO(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 vO=L(()=>{"use strict"});function xO(e,t){let a={type:"text",value:wO(String(t.value))};return e.patch(t,a),e.applyData(t,a)}var bO=L(()=>{"use strict";vO()});function SO(e,t){let a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}var IO=L(()=>{"use strict"});function uh(){}var CO,kO=L(()=>{"use strict";AP();RP();_P();OP();UP();zP();qP();jP();$P();GP();KP();ZP();QP();aO();rO();iO();lO();cO();fO();mO();gO();bO();IO();CO={blockquote:EP,break:MP,code:DP,delete:PP,emphasis:NP,footnoteReference:BP,heading:FP,html:HP,imageReference:VP,image:WP,inlineCode:XP,linkReference:YP,link:JP,listItem:eO,list:nO,paragraph:oO,root:sO,strong:uO,table:dO,tableCell:hO,tableRow:pO,text:xO,thematicBreak:SO,toml:uh,yaml:uh,definition:uh,footnoteDefinition:uh}});function DG(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 _G(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function TO(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||DG,n=e.options.footnoteBackLabel||_G,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=Fn(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
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
|
|
50
|
+
`}]}}var LO=L(()=>{"use strict";km();cs()});function AO(e,t){let a=t||PG,n=new Map,r=new Map,o=new Map,i={...CO,...a.handlers},s={all:u,applyData:NG,definitionById:n,footnoteById:r,footnoteCounts:o,footnoteOrder:[],handlers:i,one:l,options:a,patch:OG,wrap:BG};return to(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(iS.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||UG)(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=EO(h.value)),!Array.isArray(h)&&h.type==="element")){let v=h.children[0];v&&v.type==="text"&&(v.value=EO(v.value))}Array.isArray(h)?d.push(...h):d.push(h)}}}return d}}function OG(e,t){e.position&&(t.position=dd(e))}function NG(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 UG(e,t){let a=t.data||{},n="value"in t&&!(iS.call(a,"hProperties")||iS.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 BG(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 SA=k(()=>{"use strict";yA();bA()});var IA=k(()=>{"use strict";SA()});function ep(e,t){return e&&"run"in e?async function(a,n){let r=Jf(a,{file:n,...t});await e.run(r,n)}:function(a,n){return Jf(a,{file:n,...e||t})}}var CA=k(()=>{"use strict";IA()});var kA=k(()=>{"use strict";CA()});function Yy(e){if(e)throw e}var TA=k(()=>{"use strict"});var PA=oa((Ire,OA)=>{"use strict";var tp=Object.prototype.hasOwnProperty,_A=Object.prototype.toString,LA=Object.defineProperty,EA=Object.getOwnPropertyDescriptor,MA=function(t){return typeof Array.isArray=="function"?Array.isArray(t):_A.call(t)==="[object Array]"},AA=function(t){if(!t||_A.call(t)!=="[object Object]")return!1;var a=tp.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&tp.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!a&&!n)return!1;var r;for(r in t);return typeof r>"u"||tp.call(t,r)},RA=function(t,a){LA&&a.name==="__proto__"?LA(t,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):t[a.name]=a.newValue},DA=function(t,a){if(a==="__proto__")if(tp.call(t,a)){if(EA)return EA(t,a).value}else return;return t[a]};OA.exports=function e(){var t,a,n,r,o,i,l=arguments[0],s=1,u=arguments.length,c=!1;for(typeof l=="boolean"&&(c=l,l=arguments[1]||{},s=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});s<u;++s)if(t=arguments[s],t!=null)for(a in t)n=DA(l,a),r=DA(t,a),l!==r&&(c&&r&&(AA(r)||(o=MA(r)))?(o?(o=!1,i=n&&MA(n)?n:[]):i=n&&AA(n)?n:{},RA(l,{name:a,newValue:e(c,i,r)})):typeof r<"u"&&RA(l,{name:a,newValue:r}));return l}});function Eu(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 NA=k(()=>{"use strict"});function Zy(){let e=[],t={run:a,use:n};return t;function a(...r){let o=-1,i=r.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);l(null,...r);function l(s,...u){let c=e[++o],d=-1;if(s){i(s);return}for(;++d<r.length;)(u[d]===null||u[d]===void 0)&&(u[d]=r[d]);r=u,c?BA(c,l)(...u):i(null,...u)}}function n(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function BA(e,t){let a;return n;function n(...i){let l=e.length>i.length,s;l&&i.push(r);try{s=e.apply(this,i)}catch(u){let c=u;if(l&&a)throw c;return r(c)}l||(s&&s.then&&typeof s.then=="function"?s.then(o,r):s instanceof Error?r(s):o(s))}function r(i,...l){a||(a=!0,t(i,...l))}function o(i){r(null,i)}}var UA=k(()=>{"use strict"});var FA=k(()=>{"use strict";UA()});function Z5(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mu(e);let a=0,n=-1,r=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else n<0&&(o=!0,n=r+1);return n<0?"":e.slice(a,n)}if(t===e)return"";let i=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(o){a=r+1;break}}else i<0&&(o=!0,i=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(n=r):(l=-1,n=i));return a===n?n=i:n<0&&(n=e.length),e.slice(a,n)}function Q5(e){if(Mu(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 J5(e){Mu(e);let t=e.length,a=-1,n=0,r=-1,o=0,i;for(;t--;){let l=e.codePointAt(t);if(l===47){if(i){n=t+1;break}continue}a<0&&(i=!0,a=t+1),l===46?r<0?r=t:o!==1&&(o=1):r>-1&&(o=-1)}return r<0||a<0||o===0||o===1&&r===a-1&&r===n+1?"":e.slice(r,a)}function eH(...e){let t=-1,a;for(;++t<e.length;)Mu(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":tH(a)}function tH(e){Mu(e);let t=e.codePointAt(0)===47,a=aH(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function aH(e,t){let a="",n=0,r=-1,o=0,i=-1,l,s;for(;++i<=e.length;){if(i<e.length)l=e.codePointAt(i);else{if(l===47)break;l=47}if(l===47){if(!(r===i-1||o===1))if(r!==i-1&&o===2){if(a.length<2||n!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(s=a.lastIndexOf("/"),s!==a.length-1){s<0?(a="",n=0):(a=a.slice(0,s),n=a.length-1-a.lastIndexOf("/")),r=i,o=0;continue}}else if(a.length>0){a="",n=0,r=i,o=0;continue}}t&&(a=a.length>0?a+"/..":"..",n=2)}else a.length>0?a+="/"+e.slice(r+1,i):a=e.slice(r+1,i),n=i-r-1;r=i,o=0}else l===46&&o>-1?o++:o=-1}return a}function Mu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var In,zA=k(()=>{"use strict";In={basename:Z5,dirname:Q5,extname:J5,join:eH,sep:"/"}});function nH(){return"/"}var qA,HA=k(()=>{"use strict";qA={cwd:nH}});function Tl(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var Qy=k(()=>{"use strict"});function jA(e){if(typeof e=="string")e=new URL(e);else if(!Tl(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 rH(e)}function rH(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 VA=k(()=>{"use strict";Qy();Qy()});function ex(e,t){if(e&&e.includes(In.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+In.sep+"`")}function tx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function WA(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function oH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Jy,Au,GA=k(()=>{"use strict";By();zA();HA();VA();Jy=["history","path","basename","stem","extname","dirname"],Au=class{constructor(t){let a;t?Tl(t)?a={path:t}:typeof t=="string"||oH(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":qA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Jy.length;){let o=Jy[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)Jy.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?In.basename(this.path):void 0}set basename(t){tx(t,"basename"),ex(t,"basename"),this.path=In.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?In.dirname(this.path):void 0}set dirname(t){WA(this.basename,"dirname"),this.path=In.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?In.extname(this.path):void 0}set extname(t){if(ex(t,"extname"),WA(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=In.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Tl(t)&&(t=jA(t)),tx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?In.basename(this.path,this.extname):void 0}set stem(t){tx(t,"stem"),ex(t,"stem"),this.path=In.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 Pt(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 $A=k(()=>{"use strict";GA()});var XA,KA=k(()=>{"use strict";XA=(function(e){let n=this.constructor.prototype,r=n[e],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,n),o})});function ax(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function nx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function rx(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 YA(e){if(!Eu(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ZA(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ap(e){return lH(e)?e:new Au(e)}function lH(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function sH(e){return typeof e=="string"||uH(e)}function uH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var np,iH,ox,ix,QA=k(()=>{"use strict";TA();np=z(PA(),1);NA();FA();$A();KA();iH={}.hasOwnProperty,ox=class e extends XA{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=Zy()}copy(){let t=new e,a=-1;for(;++a<this.attachers.length;){let n=this.attachers[a];t.use(...n)}return t.data((0,np.default)(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(rx("data",this.frozen),this.namespace[t]=a,this):iH.call(this.namespace,t)&&this.namespace[t]||void 0:t?(rx("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=ap(t),n=this.parser||this.Parser;return ax("parse",n),n(String(a),a)}process(t,a){let n=this;return this.freeze(),ax("process",this.parser||this.Parser),nx("process",this.compiler||this.Compiler),a?r(void 0,a):new Promise(r);function r(o,i){let l=ap(t),s=n.parse(l);n.run(s,l,function(c,d,f){if(c||!d||!f)return u(c);let p=d,m=n.stringify(p,f);sH(m)?f.value=m:f.result=m,u(c,f)});function u(c,d){c||!d?i(c):o?o(d):a(void 0,d)}}}processSync(t){let a=!1,n;return this.freeze(),ax("processSync",this.parser||this.Parser),nx("processSync",this.compiler||this.Compiler),this.process(t,r),ZA("processSync","process",a),n;function r(o,i){a=!0,Yy(o),n=i}}run(t,a,n){YA(t),this.freeze();let r=this.transformers;return!n&&typeof a=="function"&&(n=a,a=void 0),n?o(void 0,n):new Promise(o);function o(i,l){let s=ap(a);r.run(t,s,u);function u(c,d,f){let p=d||t;c?l(c):i?i(p):n(void 0,p,f)}}}runSync(t,a){let n=!1,r;return this.run(t,a,o),ZA("runSync","run",n),r;function o(i,l){Yy(i),r=l,n=!0}}stringify(t,a){this.freeze();let n=ap(a),r=this.compiler||this.Compiler;return nx("stringify",r),YA(t),r(t,n)}use(t,...a){let n=this.attachers,r=this.namespace;if(rx("use",this.frozen),t!=null)if(typeof t=="function")s(t,a);else if(typeof t=="object")Array.isArray(t)?l(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")s(u,[]);else if(typeof u=="object")if(Array.isArray(u)){let[c,...d]=u;s(c,d)}else i(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function i(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(r.settings=(0,np.default)(!0,r.settings,u.settings))}function l(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){let d=u[c];o(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function s(u,c){let d=-1,f=-1;for(;++d<n.length;)if(n[d][0]===u){f=d;break}if(f===-1)n.push([u,...c]);else if(c.length>0){let[p,...m]=c,x=n[f][1];Eu(x)&&Eu(p)&&(p=(0,np.default)(!0,x,p)),n[f]=[u,p,...m]}}}},ix=new ox().freeze()});var JA=k(()=>{"use strict";QA()});function cx(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function iR(e){ii=e}function Xe(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(wa.caret,"$1"),a=a.replace(r,i),n},getRegex:()=>new RegExp(a,t)};return n}function xr(e,t){if(t){if(wa.escapeTest.test(e))return e.replace(wa.escapeReplace,aR)}else if(wa.escapeTestNoEncode.test(e))return e.replace(wa.escapeReplaceNoEncode,aR);return e}function nR(e){try{e=encodeURI(e).replace(wa.percentDecode,"%")}catch{return null}return e}function rR(e,t){let a=e.replace(wa.findPipe,(o,i,l)=>{let s=!1,u=i;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),n=a.split(wa.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(wa.slashPipe,"|");return n}function Du(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 VH(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 oR(e,t,a,n,r){let o=t.href,i=t.title||null,l=e[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let s={type:e[0].charAt(0)==="!"?"image":"link",raw:a,href:o,title:i,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,s}function WH(e,t,a){let n=e.match(a.other.indentCodeCompensation);if(n===null)return t;let r=n[1];return t.split(`
|
|
55
|
-
`).map(o=>{let i=o.match(a.other.beginningSpace);if(i===null)return o;let[
|
|
56
|
-
`)}function
|
|
57
|
-
]`).replace("lheading",
|
|
58
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let a=t[0],n=
|
|
59
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let a=
|
|
53
|
+
`}),a}function EO(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}var iS,PG,MO=L(()=>{"use strict";km();Sm();fd();kO();iS={}.hasOwnProperty,PG={}});function ch(e,t){let a=AO(e,t),n=a.one(e,void 0),r=TO(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 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(`
|
|
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 vt(e,t){return vs.parse(e,t)}var xs,Dd,JG,za,QG,eX,tX,_d,aX,SS,gN,yN,nX,IS,rX,CS,oX,iX,xh,kS,sX,wN,lX,TS,uN,uX,cX,dX,fX,vN,pX,bh,LS,xN,mX,bN,hX,gX,yX,SN,wX,vX,IN,xX,bX,SX,IX,CX,kX,TX,yh,LX,CN,kN,EX,cN,ES,AX,wS,MX,hh,Ad,RX,dN,wh,Sn,vh,AS,rr,gh,Rd,PX,vs,Wye,Gye,Xye,Kye,Yye,Zye,Jye,TN=L(()=>{"use strict";xs=bS();Dd={exec:()=>null};JG=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),za={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")},QG=/^(?:[ \t]*(?:\n|$))+/,eX=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,tX=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_d=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,aX=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,SS=/(?:[*+-]|\d{1,9}[.)])/,gN=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yN=it(gN).replace(/bull/g,SS).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(),nX=it(gN).replace(/bull/g,SS).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(),IS=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rX=/^[^\n]+/,CS=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,oX=it(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",CS).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),iX=it(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,SS).getRegex(),xh="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",kS=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sX=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",kS).replace("tag",xh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wN=it(IS).replace("hr",_d).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",xh).getRegex(),lX=it(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",wN).getRegex(),TS={blockquote:lX,code:eX,def:oX,fences:tX,heading:aX,hr:_d,html:sX,lheading:yN,list:iX,newline:QG,paragraph:wN,table:Dd,text:rX},uN=it("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_d).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",xh).getRegex(),uX={...TS,lheading:nX,table:uN,paragraph:it(IS).replace("hr",_d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",uN).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",xh).getRegex()},cX={...TS,html:it(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",kS).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:Dd,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(IS).replace("hr",_d).replace("heading",` *#{1,6} *[^
|
|
57
|
+
]`).replace("lheading",yN).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},dX=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fX=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,vN=/^( {2,}|\\)\n(?!\s*$)/,pX=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bh=/[\p{P}\p{S}]/u,LS=/[\s\p{P}\p{S}]/u,xN=/[^\s\p{P}\p{S}]/u,mX=it(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,LS).getRegex(),bN=/(?!~)[\p{P}\p{S}]/u,hX=/(?!~)[\s\p{P}\p{S}]/u,gX=/(?:[^\s\p{P}\p{S}]|~)/u,yX=it(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",JG?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),SN=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,wX=it(SN,"u").replace(/punct/g,bh).getRegex(),vX=it(SN,"u").replace(/punct/g,bN).getRegex(),IN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xX=it(IN,"gu").replace(/notPunctSpace/g,xN).replace(/punctSpace/g,LS).replace(/punct/g,bh).getRegex(),bX=it(IN,"gu").replace(/notPunctSpace/g,gX).replace(/punctSpace/g,hX).replace(/punct/g,bN).getRegex(),SX=it("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,xN).replace(/punctSpace/g,LS).replace(/punct/g,bh).getRegex(),IX=it(/\\(punct)/,"gu").replace(/punct/g,bh).getRegex(),CX=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(),kX=it(kS).replace("(?:-->|$)","-->").getRegex(),TX=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",kX).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,LX=it(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",yh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),CN=it(/^!?\[(label)\]\[(ref)\]/).replace("label",yh).replace("ref",CS).getRegex(),kN=it(/^!?\[(ref)\](?:\[\])?/).replace("ref",CS).getRegex(),EX=it("reflink|nolink(?!\\()","g").replace("reflink",CN).replace("nolink",kN).getRegex(),cN=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ES={_backpedal:Dd,anyPunctuation:IX,autolink:CX,blockSkip:yX,br:vN,code:fX,del:Dd,emStrongLDelim:wX,emStrongRDelimAst:xX,emStrongRDelimUnd:SX,escape:dX,link:LX,nolink:kN,punctuation:mX,reflink:CN,reflinkSearch:EX,tag:TX,text:pX,url:Dd},AX={...ES,link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",yh).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yh).getRegex()},wS={...ES,emStrongRDelimAst:bX,emStrongLDelim:vX,url:it(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",cN).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",cN).getRegex()},MX={...wS,br:it(vN).replace("{2,}","*").getRegex(),text:it(wS.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},hh={normal:TS,gfm:uX,pedantic:cX},Ad={normal:ES,gfm:wS,breaks:MX,pedantic:AX},RX={"&":"&","<":"<",">":">",'"':""","'":"'"},dN=e=>RX[e];wh=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:Md(a,`
|
|
58
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let a=t[0],n=_X(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=Md(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:Md(t[0],`
|
|
59
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let a=Md(t[0],`
|
|
60
60
|
`).split(`
|
|
61
|
-
`),n="",r="",o=[];for(;a.length>0;){let i=!1,
|
|
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,`
|
|
63
63
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
64
64
|
${u}`:u,r=r?`${r}
|
|
65
|
-
${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,o,!0),this.lexer.state.top=d,a.length===0)break;let
|
|
65
|
+
${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,o,!0),this.lexer.state.top=d,a.length===0)break;let p=o.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let m=p,h=m.raw+`
|
|
66
66
|
`+a.join(`
|
|
67
|
-
`),
|
|
67
|
+
`),v=this.blockquote(h);o[o.length-1]=v,n=n.substring(0,n.length-m.raw.length)+v.raw,r=r.substring(0,r.length-m.text.length)+v.text;break}else if(p?.type==="list"){let m=p,h=m.raw+`
|
|
68
68
|
`+a.join(`
|
|
69
|
-
`),
|
|
70
|
-
`);continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let a=t[1].trim(),n=a.length>1,r={type:"list",raw:"",ordered:n,start:n?+a.slice(0,-1):"",loose:!1,items:[]};a=n?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=n?a:"[*+-]");let o=this.rules.other.listItemRegex(a),i=!1;for(;e;){let
|
|
71
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
72
|
-
`,1)[0],
|
|
73
|
-
`,e=e.substring(
|
|
74
|
-
`,1)[0],
|
|
75
|
-
`+
|
|
76
|
-
`+
|
|
77
|
-
`,e=e.substring(
|
|
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(
|
|
69
|
+
`),v=this.list(h);o[o.length-1]=v,n=n.substring(0,n.length-p.raw.length)+v.raw,r=r.substring(0,r.length-m.raw.length)+v.raw,a=h.substring(o.at(-1).raw.length).split(`
|
|
70
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let a=t[1].trim(),n=a.length>1,r={type:"list",raw:"",ordered:n,start:n?+a.slice(0,-1):"",loose:!1,items:[]};a=n?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=n?a:"[*+-]");let o=this.rules.other.listItemRegex(a),i=!1;for(;e;){let l=!1,u="",c="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let d=t[2].split(`
|
|
71
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),p=e.split(`
|
|
72
|
+
`,1)[0],m=!d.trim(),h=0;if(this.options.pedantic?(h=2,c=d.trimStart()):m?h=t[1].length+1:(h=t[2].search(this.rules.other.nonSpaceChar),h=h>4?1:h,c=d.slice(h),h+=t[1].length),m&&this.rules.other.blankLine.test(p)&&(u+=p+`
|
|
73
|
+
`,e=e.substring(p.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(h),I=this.rules.other.hrRegex(h),y=this.rules.other.fencesBeginRegex(h),w=this.rules.other.headingBeginRegex(h),g=this.rules.other.htmlBeginRegex(h);for(;e;){let S=e.split(`
|
|
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
|
+
`+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
|
+
`+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=pN(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(pN(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=Md(a.slice(0,-1),"\\");if((a.length-o.length)%2===0)return}else{let o=DX(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)),mN(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 mN(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 vS{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 wh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let a={other:za,block:hh.normal,inline:Ad.normal};this.options.pedantic?(a.block=hh.pedantic,a.inline=Ad.pedantic):this.options.gfm&&(a.block=hh.gfm,this.options.breaks?a.inline=Ad.breaks:a.inline=Ad.gfm),this.tokenizer.rules=a}static get rules(){return{block:hh,inline:Ad}}static lex(t,a){return new vS(a).lex(t)}static lexInline(t,a){return new vS(a).inlineTokens(t)}lex(t){t=t.replace(za.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(za.tabCharGlobal," ").replace(za.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+=`
|
|
84
84
|
`+r.text,this.inlineQueue.at(-1).src=i.text):a.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length);let i=a.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
85
85
|
`)?"":`
|
|
86
86
|
`)+r.raw,i.text+=`
|
|
87
|
-
`+r.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},a.push(r));continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),a.push(r);continue}let o=t;if(this.options.extensions?.startBlock){let i=1/0,
|
|
87
|
+
`+r.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},a.push(r));continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),a.push(r);continue}let o=t;if(this.options.extensions?.startBlock){let i=1/0,s=t.slice(1),l;this.options.extensions.startBlock.forEach(u=>{l=u.call({lexer:this},s),typeof l=="number"&&l>=0&&(i=Math.min(i,l))}),i<1/0&&i>=0&&(o=t.substring(0,i+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){let i=a.at(-1);n&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
|
|
88
88
|
`)?"":`
|
|
89
89
|
`)+r.raw,i.text+=`
|
|
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
|
|
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}},vh=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(za.notSpaceStart)?.[0],r=e.replace(za.endingNewline,"")+`
|
|
94
|
+
`;return n?'<pre><code class="language-'+io(n)+'">'+(a?r:io(r,!0))+`</code></pre>
|
|
95
|
+
`:"<pre><code>"+(a?r:io(r,!0))+`</code></pre>
|
|
96
96
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
97
97
|
${this.parser.parse(e)}</blockquote>
|
|
98
98
|
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
99
99
|
`}hr(e){return`<hr>
|
|
100
|
-
`}list(e){let t=e.ordered,a=e.start,n="";for(let i=0;i<e.items.length;i++){let
|
|
100
|
+
`}list(e){let t=e.ordered,a=e.start,n="";for(let i=0;i<e.items.length;i++){let s=e.items[i];n+=this.listitem(s)}let r=t?"ol":"ul",o=t&&a!==1?' start="'+a+'"':"";return"<"+r+o+`>
|
|
101
101
|
`+n+"</"+r+`>
|
|
102
102
|
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
103
103
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
@@ -108,34 +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]),[s,u]=(0,kn.useState)(l);return(0,kn.useEffect)(()=>{if(!i){u(l);return}let c=i.highlight({code:e,language:t,themes:o},d=>{u(d)});if(c){u(c);return}u(l)},[e,t,o,i,l]),(0,Da.jsx)(xx.Provider,{value:{code:e},children:(0,Da.jsxs)(KH,{language:t,children:[(0,Da.jsx)(YH,{language:t,children:n}),(0,Da.jsx)(XH,{className:a,language:t,result:s,...r})]})})}});var bR={};pc(bR,{Mermaid:()=>vx});var SR=k(()=>{"use strict";"use client";dp()});function t6(e={}){let{immediate:t=!1,debounceDelay:a=QH,rootMargin:n=JH,idleTimeout:r=e6}=e,[o,i]=(0,_.useState)(!1),l=(0,_.useRef)(null),s=(0,_.useRef)(null),u=(0,_.useRef)(null),c=(0,_.useMemo)(()=>p=>{let m=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),d=(0,_.useMemo)(()=>typeof window<"u"&&window.requestIdleCallback?(p,m)=>window.requestIdleCallback(p,m):c,[c]),f=(0,_.useMemo)(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return(0,_.useEffect)(()=>{if(t){i(!0);return}let p=l.current;if(!p)return;s.current&&(clearTimeout(s.current),s.current=null),u.current&&(f(u.current),u.current=null);let m=()=>{s.current&&(clearTimeout(s.current),s.current=null),u.current&&(f(u.current),u.current=null)},x=h=>{u.current=d(b=>{b.timeRemaining()>0||b.didTimeout?(i(!0),h.disconnect()):u.current=d(()=>{i(!0),h.disconnect()},{timeout:r/2})},{timeout:r})},S=h=>{m(),s.current=window.setTimeout(()=>{var b,T;let C=h.takeRecords();(C.length===0||(T=(b=C.at(-1))==null?void 0:b.isIntersecting)!=null&&T)&&x(h)},a)},w=(h,b)=>{h.isIntersecting?S(b):m()},y=new IntersectionObserver(h=>{for(let b of h)w(b,y)},{rootMargin:n,threshold:0});return y.observe(p),()=>{s.current&&clearTimeout(s.current),u.current&&f(u.current),y.disconnect()}},[t,a,n,r,f,d]),{shouldRender:o,containerRef:l}}function hp(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 Lt(e,t){return e.className===t.className&&hp(e.node,t.node)}var _,E,QH,JH,e6,Tx,Lx,mp,a6,n6,r6,AR,IR,o6,i6,ce,Ll,xx,RR,CR,kR,l6,TR,s6,u6,Nu,c6,d6,f6,Cx,DR,vR,Ex,p6,m6,Bu,h6,g6,w6,_R,OR,y6,bx,x6,v6,b6,S6,I6,C6,k6,kx,fp,Mx,PR,NR,BR,UR,T6,FR,zR,qR,HR,jR,VR,WR,GR,$R,XR,KR,YR,ZR,QR,JR,e2,t2,L6,a2,n2,r2,E6,LR,ER,pp,M6,MR,o2,A6,R6,D6,_6,O6,P6,N6,Sx,B6,Ix,i2,l2,s2,U6,F6,z6,q6,ya,Ax,H6,El,j6,vx,dp=k(()=>{"use strict";"use client";_=z(he(),1);Fk();qk();iT();FL();JL();E=z(ae(),1);Yg();Qg();WE();yM();kA();JA();wR();QH=300,JH="300px",e6=500;Tx=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),Lx=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),mp=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),a6=e=>(0,E.jsxs)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[(0,E.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,E.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),n6=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),r6=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),AR=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),IR=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),o6=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),i6=e=>(0,E.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,E.jsx)("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),ce=(...e)=>Zg(af(e)),Ll=(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)},xx=(0,_.createContext)({code:""}),RR=()=>(0,_.useContext)(xx),CR=({onCopy:e,onError:t,timeout:a=2e3,children:n,className:r,code:o,...i})=>{let[l,s]=(0,_.useState)(!1),u=(0,_.useRef)(0),{code:c}=RR(),{isAnimating:d}=(0,_.useContext)(ya),f=o??c,p=async()=>{var x;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.writeText)){t?.(new Error("Clipboard API not available"));return}try{l||(await navigator.clipboard.writeText(f),s(!0),e?.(),u.current=window.setTimeout(()=>s(!1),a))}catch(S){t?.(S)}};(0,_.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let m=l?Tx:Lx;return(0,E.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:p,title:"Copy Code",type:"button",...i,children:n??(0,E.jsx)(m,{size:14})})},kR={"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"},l6=({onDownload:e,onError:t,language:a,children:n,className:r,code:o,...i})=>{let{code:l}=RR(),{isAnimating:s}=(0,_.useContext)(ya),u=o??l,c=`file.${a&&a in kR?kR[a]:"txt"}`,d="text/plain",f=()=>{try{Ll(c,u,d),e?.()}catch(p){t?.(p)}};return(0,E.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:s,onClick:f,title:"Download file",type:"button",...i,children:n??(0,E.jsx)(mp,{size:14})})},TR=()=>(0,E.jsxs)("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[(0,E.jsx)("div",{className:"h-[46px] w-full bg-muted/80"}),(0,E.jsx)("div",{className:"flex w-full items-center justify-center p-4",children:(0,E.jsx)(a6,{className:"size-4 animate-spin"})})]}),s6=/\.[^/.]+$/,u6=({node:e,className:t,src:a,alt:n,...r})=>{let o=async()=>{if(a)try{let i=await(await fetch(a)).blob(),l=new URL(a,window.location.origin).pathname.split("/").pop()||"",s=l.split(".").pop(),u=l.includes(".")&&s!==void 0&&s.length<=4,c="";if(u)c=l;else{let d=i.type,f="png";d.includes("jpeg")||d.includes("jpg")?f="jpg":d.includes("png")?f="png":d.includes("svg")?f="svg":d.includes("gif")?f="gif":d.includes("webp")&&(f="webp"),c=`${(n||l||"image").replace(s6,"")}.${f}`}Ll(c,i,i.type)}catch{window.open(a,"_blank")}};return a?(0,E.jsxs)("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[(0,E.jsx)("img",{alt:n,className:ce("max-w-full rounded-lg",t),"data-streamdown":"image",src:a,...r}),(0,E.jsx)("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),(0,E.jsx)("button",{className: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,E.jsx)(mp,{size:14})})]}):null},Nu=0,c6=()=>{Nu+=1,Nu===1&&(document.body.style.overflow="hidden")},d6=()=>{Nu=Math.max(0,Nu-1),Nu===0&&(document.body.style.overflow="")},f6=({url:e,isOpen:t,onClose:a,onConfirm:n})=>{let[r,o]=(0,_.useState)(!1),i=(0,_.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[e]),l=(0,_.useCallback)(()=>{n(),a()},[n,a]);return(0,_.useEffect)(()=>{if(t){c6();let s=u=>{u.key==="Escape"&&a()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),d6()}}},[t,a]),t?(0,E.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm","data-streamdown":"link-safety-modal",onClick:a,onKeyDown:s=>{s.key==="Escape"&&a()},role:"button",tabIndex:0,children:(0,E.jsxs)("div",{className:"relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg",onClick:s=>s.stopPropagation(),onKeyDown:s=>s.stopPropagation(),role:"presentation",children:[(0,E.jsx)("button",{className:"absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:a,title:"Close",type:"button",children:(0,E.jsx)(AR,{size:16})}),(0,E.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,E.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[(0,E.jsx)(IR,{size:20}),(0,E.jsx)("span",{children:"Open external link?"})]}),(0,E.jsx)("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),(0,E.jsx)("div",{className: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,E.jsxs)("div",{className:"flex gap-2",children:[(0,E.jsx)("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted",onClick:i,type:"button",children:r?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Tx,{size:14}),(0,E.jsx)("span",{children:"Copied"})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Lx,{size:14}),(0,E.jsx)("span",{children:"Copy link"})]})}),(0,E.jsxs)("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90",onClick:l,type:"button",children:[(0,E.jsx)(IR,{size:14}),(0,E.jsx)("span",{children:"Open link"})]})]})]})}):null},Cx=(0,_.createContext)(null),DR=()=>(0,_.useContext)(Cx),vR=()=>{var e;let t=DR();return(e=t?.code)!=null?e:null},Ex=()=>{var e;let t=DR();return(e=t?.mermaid)!=null?e:null},p6=(e,t)=>{var a;let n=(a=void 0)!=null?a:5;return new Promise((r,o)=>{let i="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),l=new Image;l.crossOrigin="anonymous",l.onload=()=>{let s=document.createElement("canvas"),u=l.width*n,c=l.height*n;s.width=u,s.height=c;let d=s.getContext("2d");if(!d){o(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(l,0,0,u,c),s.toBlob(f=>{if(!f){o(new Error("Failed to create PNG blob"));return}r(f)},"image/png")},l.onerror=()=>o(new Error("Failed to load SVG image")),l.src=i})},m6=({chart:e,children:t,className:a,onDownload:n,config:r,onError:o})=>{let[i,l]=(0,_.useState)(!1),s=(0,_.useRef)(null),{isAnimating:u}=(0,_.useContext)(ya),c=Ex(),d=async f=>{try{if(f==="mmd"){Ll("diagram.mmd",e,"text/plain"),l(!1),n?.(f);return}if(!c){o?.(new Error("Mermaid plugin not available"));return}let p=c.getMermaid(r),m=e.split("").reduce((w,y)=>(w<<5)-w+y.charCodeAt(0)|0,0),x=`mermaid-${Math.abs(m)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:S}=await p.render(x,e);if(!S){o?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(f==="svg"){Ll("diagram.svg",S,"image/svg+xml"),l(!1),n?.(f);return}if(f==="png"){let w=await p6(S);Ll("diagram.png",w,"image/png"),n?.(f),l(!1);return}}catch(p){o?.(p)}};return(0,_.useEffect)(()=>{let f=p=>{let m=p.composedPath();s.current&&!m.includes(s.current)&&l(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),(0,E.jsxs)("div",{className:"relative",ref:s,children:[(0,E.jsx)("button",{className:ce("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:u,onClick:()=>l(!i),title:"Download diagram",type:"button",children:t??(0,E.jsx)(mp,{size:14})}),i?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("svg"),title:"Download diagram as SVG",type:"button",children:"SVG"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("png"),title:"Download diagram as PNG",type:"button",children:"PNG"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("mmd"),title:"Download diagram as MMD",type:"button",children:"MMD"})]}):null]})},Bu=0,h6=()=>{Bu+=1,Bu===1&&(document.body.style.overflow="hidden")},g6=()=>{Bu=Math.max(0,Bu-1),Bu===0&&(document.body.style.overflow="")},w6=({chart:e,config:t,onFullscreen:a,onExit:n,className:r,...o})=>{let[i,l]=(0,_.useState)(!1),{isAnimating:s,controls:u}=(0,_.useContext)(ya),c=(()=>{if(typeof u=="boolean")return u;let f=u.mermaid;return f===!1?!1:f===!0||f===void 0?!0:f.panZoom!==!1})(),d=()=>{l(!i)};return(0,_.useEffect)(()=>{if(i){h6();let f=p=>{p.key==="Escape"&&l(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),g6()}}},[i]),(0,_.useEffect)(()=>{i?a?.():n&&n()},[i,a,n]),(0,E.jsxs)(E.Fragment,{children:[(0,E.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:s,onClick:d,title:"View fullscreen",type:"button",...o,children:(0,E.jsx)(n6,{size:14})}),i?(0,E.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:d,onKeyDown:f=>{f.key==="Escape"&&d()},role:"button",tabIndex:0,children:[(0,E.jsx)("button",{className:"absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:d,title:"Exit fullscreen",type:"button",children:(0,E.jsx)(AR,{size:20})}),(0,E.jsx)("div",{className:"flex size-full items-center justify-center p-4",onClick:f=>f.stopPropagation(),onKeyDown:f=>f.stopPropagation(),role:"presentation",children:(0,E.jsx)(vx,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:c})})]}):null]})},_R=e=>{var t,a;let n=[],r=[],o=e.querySelectorAll("thead th");for(let l of o)n.push(((t=l.textContent)==null?void 0:t.trim())||"");let i=e.querySelectorAll("tbody tr");for(let l of i){let s=[],u=l.querySelectorAll("td");for(let c of u)s.push(((a=c.textContent)==null?void 0:a.trim())||"");r.push(s)}return{headers:n,rows:r}},OR=e=>{let{headers:t,rows:a}=e,n=l=>{let s=!1,u=!1;for(let c of l){if(c==='"'){s=!0,u=!0;break}(c===","||c===`
|
|
114
|
-
`)&&(
|
|
115
|
-
`)},
|
|
116
|
-
`||c==="\r"){
|
|
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
|
|
118
|
-
`)},
|
|
119
|
-
`)},v6=({children:e,className:t,onCopy:a,onError:n,timeout:r=2e3})=>{let[o,i]=(0,_.useState)(!1),[l,s]=(0,_.useState)(!1),u=(0,_.useRef)(null),c=(0,_.useRef)(0),{isAnimating:d}=(0,_.useContext)(ya),f=async m=>{var x,S;if(typeof window>"u"||!((x=navigator?.clipboard)!=null&&x.write)){n?.(new Error("Clipboard API not available"));return}try{let w=(S=u.current)==null?void 0:S.closest('[data-streamdown="table-wrapper"]'),y=w?.querySelector("table");if(!y){n?.(new Error("Table not found"));return}let h=_R(y),b=m==="csv"?OR(h):y6(h),T=new ClipboardItem({"text/plain":new Blob([b],{type:"text/plain"}),"text/html":new Blob([y.outerHTML],{type:"text/html"})});await navigator.clipboard.write([T]),s(!0),i(!1),a?.(m),c.current=window.setTimeout(()=>s(!1),r)}catch(w){n?.(w)}};(0,_.useEffect)(()=>{let m=x=>{let S=x.composedPath();u.current&&!S.includes(u.current)&&i(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m),window.clearTimeout(c.current)}},[]);let p=l?Tx:Lx;return(0,E.jsxs)("div",{className:"relative",ref:u,children:[(0,E.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,E.jsx)(p,{size:14})}),o?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},b6=({children:e,className:t,onDownload:a,onError:n})=>{let[r,o]=(0,_.useState)(!1),i=(0,_.useRef)(null),{isAnimating:l}=(0,_.useContext)(ya),s=u=>{var c;try{let d=(c=i.current)==null?void 0:c.closest('[data-streamdown="table-wrapper"]'),f=d?.querySelector("table");if(!f){n?.(new Error("Table not found"));return}let p=_R(f),m=u==="csv"?OR(p):x6(p);Ll(`table.${u==="csv"?"csv":"md"}`,m,u==="csv"?"text/csv":"text/markdown"),o(!1),a?.(u)}catch(d){n?.(d)}};return(0,_.useEffect)(()=>{let u=c=>{let d=c.composedPath();i.current&&!d.includes(i.current)&&o(!1)};return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[]),(0,E.jsxs)("div",{className:"relative",ref:i,children:[(0,E.jsx)("button",{className:ce("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:()=>o(!r),title:"Download table",type:"button",children:e??(0,E.jsx)(mp,{size:14})}),r?(0,E.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>s("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),(0,E.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>s("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},S6=({children:e,className:t,showControls:a,...n})=>(0,E.jsxs)("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[a?(0,E.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,E.jsx)(v6,{}),(0,E.jsx)(b6,{})]}):null,(0,E.jsx)("div",{className:"overflow-x-auto",children:(0,E.jsx)("table",{className:ce("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]}),I6=(0,_.lazy)(()=>Promise.resolve().then(()=>(xR(),yR)).then(e=>({default:e.CodeBlock}))),C6=(0,_.lazy)(()=>Promise.resolve().then(()=>(SR(),bR)).then(e=>({default:e.Mermaid}))),k6=/language-([^\s]+)/;kx=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,fp=(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},Mx=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ol",{className:ce("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>Lt(e,t));Mx.displayName="MarkdownOl";PR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("li",{className:ce("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&hp(e.node,t.node));PR.displayName="MarkdownLi";NR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("ul",{className:ce("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>Lt(e,t));NR.displayName="MarkdownUl";BR=(0,_.memo)(({className:e,node:t,...a})=>(0,E.jsx)("hr",{className:ce("my-6 border-border",e),"data-streamdown":"horizontal-rule",...a}),(e,t)=>Lt(e,t));BR.displayName="MarkdownHr";UR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("span",{className:ce("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>Lt(e,t));UR.displayName="MarkdownStrong";T6=({children:e,className:t,href:a,node:n,...r})=>{let{linkSafety:o}=(0,_.useContext)(ya),[i,l]=(0,_.useState)(!1),s=a==="streamdown:incomplete-link",u=(0,_.useCallback)(async p=>{if(!(!(o!=null&&o.enabled&&a)||s)){if(p.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(a)){window.open(a,"_blank","noreferrer");return}l(!0)}},[o,a,s]),c=(0,_.useCallback)(()=>{a&&window.open(a,"_blank","noreferrer")},[a]),d=(0,_.useCallback)(()=>{l(!1)},[]),f={url:a??"",isOpen:i,onClose:d,onConfirm:c};return o!=null&&o.enabled&&a?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{className:ce("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",onClick:u,type:"button",children:e}),o.renderModal?o.renderModal(f):(0,E.jsx)(f6,{...f})]}):(0,E.jsx)("a",{className:ce("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":s,"data-streamdown":"link",href:a,rel:"noreferrer",target:"_blank",...r,children:e})},FR=(0,_.memo)(T6,(e,t)=>Lt(e,t)&&e.href===t.href);FR.displayName="MarkdownA";zR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h1",{className:ce("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>Lt(e,t));zR.displayName="MarkdownH1";qR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h2",{className:ce("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>Lt(e,t));qR.displayName="MarkdownH2";HR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h3",{className:ce("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>Lt(e,t));HR.displayName="MarkdownH3";jR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h4",{className:ce("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>Lt(e,t));jR.displayName="MarkdownH4";VR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h5",{className:ce("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>Lt(e,t));VR.displayName="MarkdownH5";WR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("h6",{className:ce("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>Lt(e,t));WR.displayName="MarkdownH6";GR=(0,_.memo)(({children:e,className:t,node:a,...n})=>{let{controls:r}=(0,_.useContext)(ya),o=kx(r,"table");return(0,E.jsx)(S6,{className:t,showControls:o,...n,children:e})},(e,t)=>Lt(e,t));GR.displayName="MarkdownTable";$R=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("thead",{className:ce("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>Lt(e,t));$R.displayName="MarkdownThead";XR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tbody",{className:ce("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>Lt(e,t));XR.displayName="MarkdownTbody";KR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("tr",{className:ce("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>Lt(e,t));KR.displayName="MarkdownTr";YR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.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)=>Lt(e,t));YR.displayName="MarkdownTh";ZR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("td",{className:ce("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>Lt(e,t));ZR.displayName="MarkdownTd";QR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.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)=>Lt(e,t));QR.displayName="MarkdownBlockquote";JR=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sup",{className:ce("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>Lt(e,t));JR.displayName="MarkdownSup";e2=(0,_.memo)(({children:e,className:t,node:a,...n})=>(0,E.jsx)("sub",{className:ce("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>Lt(e,t));e2.displayName="MarkdownSub";t2=(0,_.memo)(({children:e,className:t,node:a,...n})=>{if("data-footnotes"in n){let r=i=>{var l,s;if(!(0,_.isValidElement)(i))return!1;let u=Array.isArray(i.props.children)?i.props.children:[i.props.children],c=!1,d=!1;for(let f of u)if(f){if(typeof f=="string")f.trim()!==""&&(c=!0);else if((0,_.isValidElement)(f))if(((l=f.props)==null?void 0:l["data-footnote-backref"])!==void 0)d=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let m of p){if(typeof m=="string"&&m.trim()!==""){c=!0;break}if((0,_.isValidElement)(m)&&((s=m.props)==null?void 0:s["data-footnote-backref"])===void 0){c=!0;break}}}}return d&&!c},o=Array.isArray(e)?e.map(i=>{if(!(0,_.isValidElement)(i))return i;if(i.type===Mx){let l=(Array.isArray(i.props.children)?i.props.children:[i.props.children]).filter(s=>!r(s));return l.length===0?null:{...i,props:{...i.props,children:l}}}return i}):e;return(Array.isArray(o)?o.some(i=>i!==null):o!==null)?(0,E.jsx)("section",{className:t,...n,children:o}):null}return(0,E.jsx)("section",{className:t,...n,children:e})},(e,t)=>Lt(e,t));t2.displayName="MarkdownSection";L6=({node:e,className:t,children:a,...n})=>{var r,o,i;let l=((r=e?.position)==null?void 0:r.start.line)===((o=e?.position)==null?void 0:o.end.line),{mermaid:s,controls:u}=(0,_.useContext)(ya),c=Ex();if(l)return(0,E.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(k6),f=(i=d?.at(1))!=null?i:"",p="";if((0,_.isValidElement)(a)&&a.props&&typeof a.props=="object"&&"children"in a.props&&typeof a.props.children=="string"?p=a.props.children:typeof a=="string"&&(p=a),f==="mermaid"&&c){let x=kx(u,"mermaid"),S=fp(u,"download"),w=fp(u,"copy"),y=fp(u,"fullscreen"),h=fp(u,"panZoom"),b=x&&(S||w||y);return(0,E.jsx)(_.Suspense,{fallback:(0,E.jsx)(TR,{}),children:(0,E.jsxs)("div",{className:ce("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[b?(0,E.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[S?(0,E.jsx)(m6,{chart:p,config:s?.config}):null,w?(0,E.jsx)(CR,{code:p}):null,y?(0,E.jsx)(w6,{chart:p,config:s?.config}):null]}):null,(0,E.jsx)(C6,{chart:p,config:s?.config,showControls:h})]})})}let m=kx(u,"code");return(0,E.jsx)(_.Suspense,{fallback:(0,E.jsx)(TR,{}),children:(0,E.jsx)(I6,{className:ce("overflow-x-auto border-border border-t",t),code:p,language:f,children:m?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(l6,{code:p,language:f}),(0,E.jsx)(CR,{})]}):null})})},a2=(0,_.memo)(L6,(e,t)=>e.className===t.className&&hp(e.node,t.node));a2.displayName="MarkdownCode";n2=(0,_.memo)(u6,(e,t)=>e.className===t.className&&hp(e.node,t.node));n2.displayName="MarkdownImg";r2=(0,_.memo)(({children:e,className:t,node:a,...n})=>{var r,o;let i=(Array.isArray(e)?e:[e]).filter(l=>l!=null&&l!=="");if(i.length===1&&(0,_.isValidElement)(i[0])){let l=i[0].props.node,s=l?.tagName;if(s==="img")return(0,E.jsx)(E.Fragment,{children:e});if(s==="code"&&((r=l?.position)==null?void 0:r.start.line)!==((o=l?.position)==null?void 0:o.end.line))return(0,E.jsx)(E.Fragment,{children:e})}return(0,E.jsx)("p",{className:t,...n,children:e})},(e,t)=>Lt(e,t));r2.displayName="MarkdownParagraph";E6={ol:Mx,li:PR,ul:NR,hr:BR,strong:UR,a:FR,h1:zR,h2:qR,h3:HR,h4:jR,h5:VR,h6:WR,table:GR,thead:$R,tbody:XR,tr:KR,th:YR,td:ZR,blockquote:QR,code:a2,img:n2,pre:({children:e})=>e,sup:JR,sub:e2,p:r2,section:t2},LR=[],ER={allowDangerousHtml:!0},pp=new WeakMap,M6=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let a=e.rehypePlugins,n=e.remarkPlugins,r=e.remarkRehypeOptions;if(!(a||n||r)){let c="default";return this.keyCache.set(e,c),c}let o=c=>{if(!c||c.length===0)return"";let d="";for(let f=0;f<c.length;f+=1){let p=c[f];if(f>0&&(d+=","),Array.isArray(p)){let[m,x]=p;if(typeof m=="function"){let S=pp.get(m);S||(S=m.name,pp.set(m,S)),d+=S}else d+=String(m);d+=":",d+=JSON.stringify(x)}else if(typeof p=="function"){let m=pp.get(p);m||(m=p.name,pp.set(p,m)),d+=m}else d+=String(p)}return d},i=o(a),l=o(n),s=r?JSON.stringify(r):"",u=`${l}::${i}::${s}`;return this.keyCache.set(e,u),u}get(e){let t=this.generateCacheKey(e),a=this.cache.get(t);return a&&(this.cache.delete(t),this.cache.set(t,a)),a}set(e,t){let a=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(a,t)}clear(){this.cache.clear()}},MR=new M6,o2=e=>{let t=A6(e),a=e.children||"";return D6(t.runSync(t.parse(a),a),e)},A6=e=>{let t=MR.get(e);if(t)return t;let a=R6(e);return MR.set(e,a),a},R6=e=>{let t=e.rehypePlugins||LR,a=e.remarkPlugins||LR,n=e.remarkRehypeOptions?{...ER,...e.remarkRehypeOptions}:ER;return ix().use(Yf).use(a).use(ep,n).use(t)},D6=(e,t)=>Fy(e,{Fragment:E.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0}),_6=/\[\^[^\]\s]{1,200}\](?!:)/,O6=/\[\^[^\]\s]{1,200}\]:/,P6=/<\/(\w+)>/,N6=/<(\w+)[\s>]/,Sx=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]==="$"},Ix=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},i2=e=>{let t=_6.test(e),a=O6.test(e);if(t||a)return[e];let n=Xa.lex(e,{gfm:!0}),r=[],o=[];for(let i of n){let l=i.raw,s=r.length;if(o.length>0){if(r[s-1]+=l,i.type==="html"){let u=l.match(P6);if(u){let c=u[1];o.at(-1)===c&&o.pop()}}continue}if(i.type==="html"&&i.block){let u=l.match(N6);if(u){let c=u[1];l.includes(`</${c}>`)||o.push(c)}}if(l.trim()==="$$"&&s>0){let u=r[s-1],c=Sx(u),d=Ix(u);if(c&&d%2===1){r[s-1]=u+l;continue}}if(s>0&&B6(l)){let u=r[s-1],c=Sx(u),d=Ix(u),f=Ix(l);if(c&&d%2===1&&!Sx(l)&&f===1){r[s-1]=u+l;continue}}r.push(l)}return r},l2={raw:zk,sanitize:[gf,{}],harden:[Uk,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},s2={gfm:[qf,{}]},U6=Object.values(l2),F6=Object.values(s2),z6={block:" \u258B",circle:" \u25CF"},q6={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},ya=(0,_.createContext)(q6),Ax=(0,_.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:a,...n})=>(0,E.jsx)(o2,{...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)});Ax.displayName="Block";H6=["github-light","github-dark"],El=(0,_.memo)(({children:e,mode:t="streaming",parseIncompleteMarkdown:a=!0,components:n,rehypePlugins:r=U6,remarkPlugins:o=F6,className:i,shikiTheme:l=H6,mermaid:s,controls:u=!0,isAnimating:c=!1,BlockComponent:d=Ax,parseMarkdownIntoBlocksFn:f=i2,caret:p,plugins:m,remend:x,linkSafety:S={enabled:!0},...w})=>{let y=(0,_.useId)(),[h,b]=(0,_.useTransition)(),T=(0,_.useMemo)(()=>typeof e!="string"?"":t==="streaming"&&a?QL(e,x):e,[e,t,a,x]),C=(0,_.useMemo)(()=>f(T),[T,f]),[M,D]=(0,_.useState)(C);(0,_.useEffect)(()=>{t==="streaming"?b(()=>{D(C)}):D(C)},[C,t]);let P=t==="streaming"?M:C,L=(0,_.useMemo)(()=>P.map((N,R)=>`${y}-${R}`),[P.length,y]),$=(0,_.useMemo)(()=>{var N,R;return{shikiTheme:(R=(N=m?.code)==null?void 0:N.getThemes())!=null?R:l,controls:u,isAnimating:c,mode:t,mermaid:s,linkSafety:S}},[l,u,c,t,s,S,m?.code]),H=(0,_.useMemo)(()=>({...E6,...n}),[n]),F=(0,_.useMemo)(()=>{let N=[];return m!=null&&m.cjk&&(N=[...N,...m.cjk.remarkPluginsBefore]),N=[...N,...o],m!=null&&m.cjk&&(N=[...N,...m.cjk.remarkPluginsAfter]),m!=null&&m.math&&(N=[...N,m.math.remarkPlugin]),N},[o,m?.math,m?.cjk]),W=(0,_.useMemo)(()=>m!=null&&m.math?[...r,m.math.rehypePlugin]:r,[r,m?.math]),V=(0,_.useMemo)(()=>p&&c?{"--streamdown-caret":`"${z6[p]}"`}:void 0,[p,c]);return t==="static"?(0,E.jsx)(Cx.Provider,{value:m??null,children:(0,E.jsx)(ya.Provider,{value:$,children:(0,E.jsx)("div",{className:ce("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",i),children:(0,E.jsx)(o2,{components:H,rehypePlugins:W,remarkPlugins:F,...w,children:e})})})}):(0,E.jsx)(Cx.Provider,{value:m??null,children:(0,E.jsx)(ya.Provider,{value:$,children:(0,E.jsxs)("div",{className:ce("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",p?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,i),style:V,children:[P.length===0&&p&&c&&(0,E.jsx)("span",{}),P.map((N,R)=>(0,E.jsx)(d,{components:H,content:N,index:R,rehypePlugins:W,remarkPlugins:F,shouldParseIncompleteMarkdown:a,...w},L[R]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);El.displayName="Streamdown";j6=({children:e,className:t,minZoom:a=.5,maxZoom:n=3,zoomStep:r=.1,showControls:o=!0,initialZoom:i=1,fullscreen:l=!1})=>{let s=(0,_.useRef)(null),u=(0,_.useRef)(null),[c,d]=(0,_.useState)(i),[f,p]=(0,_.useState)({x:0,y:0}),[m,x]=(0,_.useState)(!1),[S,w]=(0,_.useState)({x:0,y:0}),[y,h]=(0,_.useState)({x:0,y:0}),b=(0,_.useCallback)(H=>{d(F=>Math.max(a,Math.min(n,F+H)))},[a,n]),T=(0,_.useCallback)(()=>{b(r)},[b,r]),C=(0,_.useCallback)(()=>{b(-r)},[b,r]),M=(0,_.useCallback)(()=>{d(i),p({x:0,y:0})},[i]),D=(0,_.useCallback)(H=>{H.preventDefault();let F=H.deltaY>0?-r:r;b(F)},[b,r]),P=(0,_.useCallback)(H=>{if(H.button!==0||H.isPrimary===!1)return;x(!0),w({x:H.clientX,y:H.clientY}),h(f);let F=H.currentTarget;F instanceof HTMLElement&&F.setPointerCapture(H.pointerId)},[f]),L=(0,_.useCallback)(H=>{if(!m)return;H.preventDefault();let F=H.clientX-S.x,W=H.clientY-S.y;p({x:y.x+F,y:y.y+W})},[m,S,y]),$=(0,_.useCallback)(H=>{x(!1);let F=H.currentTarget;F instanceof HTMLElement&&F.releasePointerCapture(H.pointerId)},[]);return(0,_.useEffect)(()=>{let H=s.current;if(H)return H.addEventListener("wheel",D,{passive:!1}),()=>{H.removeEventListener("wheel",D)}},[D]),(0,_.useEffect)(()=>{let H=u.current;if(H&&m)return document.body.style.userSelect="none",H.addEventListener("pointermove",L,{passive:!1}),H.addEventListener("pointerup",$),H.addEventListener("pointercancel",$),()=>{document.body.style.userSelect="",H.removeEventListener("pointermove",L),H.removeEventListener("pointerup",$),H.removeEventListener("pointercancel",$)}},[m,L,$]),(0,E.jsxs)("div",{className:ce("relative flex flex-col",l?"h-full w-full":"min-h-28 w-full",t),ref:s,style:{cursor:m?"grabbing":"grab"},children:[o?(0,E.jsxs)("div",{className:ce("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",l?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,E.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:c>=n,onClick:T,title:"Zoom in",type:"button",children:(0,E.jsx)(o6,{size:16})}),(0,E.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:c<=a,onClick:C,title:"Zoom out",type:"button",children:(0,E.jsx)(i6,{size:16})}),(0,E.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:M,title:"Reset zoom and pan",type:"button",children:(0,E.jsx)(r6,{size:16})})]}):null,(0,E.jsx)("div",{className:ce("flex-1 origin-center transition-transform duration-150 ease-out",l?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:P,ref:u,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${c})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},vx=({chart:e,className:t,config:a,fullscreen:n=!1,showControls:r=!0})=>{let[o,i]=(0,_.useState)(null),[l,s]=(0,_.useState)(!1),[u,c]=(0,_.useState)(""),[d,f]=(0,_.useState)(""),[p,m]=(0,_.useState)(0),{mermaid:x}=(0,_.useContext)(ya),S=Ex(),w=x?.errorComponent,{shouldRender:y,containerRef:h}=t6({immediate:n});if((0,_.useEffect)(()=>{if(y){if(!S){i("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{i(null),s(!0);let T=S.getMermaid(a),C=e.split("").reduce((P,L)=>(P<<5)-P+L.charCodeAt(0)|0,0),M=`mermaid-${Math.abs(C)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:D}=await T.render(M,e);c(D),f(D)}catch(T){if(!(d||u)){let C=T instanceof Error?T.message:"Failed to render Mermaid chart";i(C)}}finally{s(!1)}})()}},[e,a,p,y,S]),!(y||u||d))return(0,E.jsx)("div",{className:ce("my-4 min-h-[200px]",t),ref:h});if(l&&!u&&!d)return(0,E.jsx)("div",{className:ce("my-4 flex justify-center p-4",t),ref:h,children:(0,E.jsxs)("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[(0,E.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),(0,E.jsx)("span",{className:"text-sm",children:"Loading diagram..."})]})});if(o&&!u&&!d)return w?(0,E.jsx)("div",{ref:h,children:(0,E.jsx)(w,{chart:e,error:o,retry:()=>m(C=>C+1)})}):(0,E.jsxs)("div",{className:ce("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:h,children:[(0,E.jsxs)("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",o]}),(0,E.jsxs)("details",{className:"mt-2",children:[(0,E.jsx)("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),(0,E.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]});let b=u||d;return(0,E.jsx)("div",{className:ce("size-full",t),"data-streamdown":"mermaid",ref:h,children:(0,E.jsx)(j6,{className:ce(n?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:n,maxZoom:3,minZoom:.5,showControls:r,zoomStep:.1,children:(0,E.jsx)("div",{"aria-label":"Mermaid chart",className:ce("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:b},role:"img"})})})}});var D_=oa((kse,R_)=>{"use strict";function LV(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let a,n=0;return function(...o){clearTimeout(a);let i=Date.now(),l=i-n,s=t-l;s<=0?(n=i,e.apply(this,o)):a=setTimeout(()=>{n=Date.now(),e.apply(this,o)},s)}}R_.exports=LV});var Cv=typeof performance>"u"?0:performance.now(),kv=typeof window<"u"&&!!window.WaniWani?.chat;var fi=z(he(),1),$p=z(Ng(),1);var Bg="waniwani/suggestions";function il(e,t){for(let a of t){let n=e[a];if(typeof n=="string"&&n.length>0)return n}}var UB=["waniwani/sessionId","openai/sessionId","openai/session","sessionId","conversationId","mcp-session-id"],FB=["waniwani/requestId","openai/requestId","requestId","mcp/requestId"],zB=["waniwani/traceId","openai/traceId","traceId","mcp/traceId","openai/requestId","requestId"],qB=["waniwani/userId","openai/userId","externalUserId","userId","actorId"],HB=["waniwani/visitorId","visitorId"],jB=["correlationId","openai/requestId"];function mC(e){return e?il(e,UB):void 0}function hC(e){return e?il(e,FB):void 0}function gC(e){return e?il(e,zB):void 0}function wC(e){return e?il(e,qB):void 0}function yC(e){return e?il(e,HB):void 0}function xC(e){return e?il(e,jB):void 0}var VB=[{key:"openai/sessionId",source:"chatgpt"},{key:"openai/session",source:"chatgpt"}],WB=[{needle:"claude",source:"claude"},{needle:"chatgpt",source:"chatgpt"},{needle:"openai",source:"chatgpt"},{needle:"gemini",source:"gemini"}];function vC(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 VB){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 WB)if(n.includes(r))return o}}var GB="@waniwani/sdk";function bC(e,t={}){let a=t.now??(()=>new Date),n=t.generateId??$B,r=YB(e),o=Vd(e.meta),i=Vd(e.metadata),l=ZB(e,o),s=bn(e.eventId)??n(),u=QB(e.timestamp,a),c=bn(e.source)??vC(o)??t.source??GB,d=Ug(e)?{...e}:void 0,f={...i};return Object.keys(o).length>0&&(f.meta=o),d&&(f.rawLegacy=d),{id:s,type:"mcp.event",name:r,source:c,timestamp:u,correlation:l,properties:XB(e,r),metadata:f,rawLegacy:d}}function $B(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`evt_${crypto.randomUUID()}`:`evt_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function XB(e,t){if(!Ug(e))return Vd(e.properties);let a=KB(e,t),n=Vd(e.properties);return{...a,...n}}function KB(e,t){switch(t){case"tool.called":{let a={};return bn(e.toolName)&&(a.name=e.toolName),bn(e.toolType)&&(a.type=e.toolType),a}case"link.clicked":{let a={};return bn(e.linkUrl)&&(a.url=e.linkUrl),a}default:return{}}}function YB(e){return Ug(e)?e.eventType:e.event}function ZB(e,t){let a=bn(e.requestId)??hC(t),n=bn(e.sessionId)??mC(t),r=bn(e.traceId)??gC(t),o=bn(e.externalUserId)??wC(t),i=bn(e.visitorId)??yC(t),l=bn(e.correlationId)??xC(t)??a,s={};return n&&(s.sessionId=n),r&&(s.traceId=r),a&&(s.requestId=a),l&&(s.correlationId=l),o&&(s.externalUserId=o),i&&(s.visitorId=i),s}function QB(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 Vd(e){return!e||typeof e!="object"||Array.isArray(e)?{}:e}function bn(e){if(typeof e=="string"&&e.trim().length!==0)return e}function Ug(e){return"eventType"in e}function SC(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 JB="/api/mcp/events/v2/batch";var IC="@waniwani/sdk";var eU=new Set([401,403]),tU=new Set([408,425,429,500,502,503,504]),aU=(e,t)=>globalThis.fetch(e,t);function CC(e){return new Fg(e)}var Fg=class{constructor(t){re(this,"endpointUrl");re(this,"flushIntervalMs");re(this,"maxBatchSize");re(this,"maxBufferSize");re(this,"maxRetries");re(this,"retryBaseDelayMs");re(this,"retryMaxDelayMs");re(this,"shutdownTimeoutMs");re(this,"sdkVersion");re(this,"fetchFn");re(this,"logger");re(this,"now");re(this,"sleep");re(this,"apiKey");re(this,"buffer",[]);re(this,"flushTimer");re(this,"flushScheduled",!1);re(this,"flushScheduledTimer");re(this,"flushInFlight");re(this,"inFlightCount",0);re(this,"isStopped",!1);re(this,"isShuttingDown",!1);this.endpointUrl=oU(t.apiUrl,t.endpointPath??JB),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??aU,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":IC};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:iU(o)}}if(eU.has(a.status))return{kind:"auth",status:a.status};if(tU.has(a.status))return{kind:"retryable",reason:`HTTP ${a.status}`};if(!a.ok)return{kind:"permanent",reason:`HTTP ${a.status}`};let n=await rU(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:IC,version:this.sdkVersion??"0.0.0"},events:t}}classifyRejectedEvents(t,a){let n=new Map(t.map(i=>[i.id,i])),r=[],o=[];for(let i of a){let l=n.get(i.eventId);if(l){if(nU(i)){r.push(l);continue}o.push(l)}}return{retryable:r,permanent:o}}backoffDelayMs(t){let a=this.retryBaseDelayMs*2**t;return Math.min(a,this.retryMaxDelayMs)}stopTransportForAuthFailure(t,a){this.isStopped=!0;let n=this.buffer.length;this.buffer.splice(0,n),this.logger.error("[Waniwani] Auth failure (HTTP %d). Stopping tracking transport and dropping %d queued event(s)",t,a+n)}};function nU(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 rU(e){let t=await e.text();if(t)try{return JSON.parse(t)}catch{return}}function oU(e,t){let a=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${a}${n}`}function iU(e){return e instanceof Error?e.message:String(e)}function kC(e){let{apiUrl:t,endpointPath:a}=lU(e.endpoint),n=CC({apiUrl:t,apiKey:e.token,endpointPath:a,flushIntervalMs:e.flushIntervalMs}),r,o=l=>typeof l=="function"?l():l,i=async l=>{let s=e.identity?.()??{},u=o(e.channelId),c=u===void 0?l.properties:{channelId:u,...l.properties},d=bC({sessionId:s.sessionId,visitorId:s.visitorId,externalUserId:s.externalUserId??r,traceId:s.traceId,...l,properties:c,metadata:{...e.metadata,...l.metadata}},{source:o(e.source)});return n.enqueue(d),{eventId:d.id}};return{track:Object.assign(i,SC(i)),identify(l,s){return r=l,i({event:"user.identified",externalUserId:l,properties:s})},flush:()=>n.flush(),shutdown:l=>n.shutdown(l)}}function lU(e){let t=new URL(e);return{apiUrl:t.origin,endpointPath:`${t.pathname}${t.search}`}}function ma(e,t,a){let[n,r=""]=e.split("?"),o=n.replace(/\/$/,""),i=new URLSearchParams(r);if(a)for(let[s,u]of Object.entries(a))i.set(s,u);let l=i.toString();return`${o}${t}${l?`?${l}`:""}`}var sU="/api/mcp/";function Wd(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(sU)?`${n}${t}`:null}function uU(){if(typeof window>"u")return!1;try{return window.WANIWANI_DEBUG?!0:!!window.localStorage?.getItem("WANIWANI_DEBUG")}catch{return!1}}function ha(...e){uU()&&console.log("[Waniwani]",...e)}var zg="waniwani-visitor-id";function cU(){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 Zt(){try{let t=localStorage.getItem(zg);if(t)return t}catch{}let e=cU();try{localStorage.setItem(zg,e)}catch{}return e}function ll(e){let t=typeof e=="string"?e.trim():"";if(!t)return Zt();try{localStorage.setItem(zg,t)}catch{}return t}function dU(e){return e!=null&&typeof e.then=="function"}function Xs(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 dU(n)?n.then(r=>{t||ll(r??"")},()=>{}):ll(n??""),a}var fU="waniwani-memory";var Wa="threads",Gd="by_memoryUserId",pU="by_updatedAt";var LC="memoryUserId",TC="waniwani-memory-user-id",qg=null;function Hg(){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 mU(e,t){if(t<1&&(e.objectStoreNames.contains("ids")||e.createObjectStore("ids")),t<2&&!e.objectStoreNames.contains(Wa)){let a=e.createObjectStore(Wa,{keyPath:"threadId"});a.createIndex(Gd,"memoryUserId",{unique:!1}),a.createIndex(pU,"updatedAt",{unique:!1})}}async function jg(){return new Promise((e,t)=>{let a=indexedDB.open(fU,2);a.onupgradeneeded=n=>{mU(a.result,n.oldVersion)},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)})}async function hU(){return jg()}async function gU(e){return new Promise((t,a)=>{let o=e.transaction("ids","readonly").objectStore("ids").get(LC);o.onsuccess=()=>t(typeof o.result=="string"?o.result:null),o.onerror=()=>a(o.error)})}async function wU(e,t){return new Promise((a,n)=>{let i=e.transaction("ids","readwrite").objectStore("ids").put(t,LC);i.onsuccess=()=>a(),i.onerror=()=>n(i.error)})}async function yU(){if(typeof indexedDB>"u")return null;try{let e=await hU();try{let t=await gU(e);if(t)return t;let a=Hg();return await wU(e,a),a}finally{e.close()}}catch{return null}}function xU(){try{let e=localStorage.getItem(TC);if(e)return e;let t=Hg();return localStorage.setItem(TC,t),t}catch{return null}}async function EC(){let e=await yU();if(e)return e;let t=xU();return t||(qg||(qg=Hg()),qg)}function MC(e,t){return e.match(t)?.[1]??null}function vU(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=MC(e,n);if(r)return{name:a,version:r}}return null}function bU(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=MC(e,n);if(r)return{name:a,version:r.replace(/_/g,".")};if(a==="Linux"&&n.test(e))return{name:a,version:""}}return null}function SU(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 Ks(){let e=navigator.userAgent,t=Zt(),a=await EC();return{userAgent:e,browser:vU(e),os:bU(e),deviceType:SU(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 IU="0.22.0-beta.4",CU=40,kU=10,TU=6e5;function Wg(){return typeof performance>"u"?0:performance.now()}function Gg(e,t){let a={};return{metrics:a,has:n=>n in a,set(n,r){a[n]=r},mark(n,r=Wg()){if(!(n in a)){a[n]=r-t;try{performance.mark(`waniwani:${e}:${n}`,{startTime:r})}catch{}}}}}function LU(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=CU)break;if(!Number.isFinite(n))continue;let r=Math.round(n);r<0||r>TU||(t[a]=r)}return t}function EU(e){let t={};for(let[a,n]of Object.entries(e)){if(Object.keys(t).length>=kU)break;(typeof n=="string"||typeof n=="boolean")&&(t[a]=n)}return t}function MU(){let e=navigator.connection;if(e)return{effectiveType:e.effectiveType,rtt:e.rtt,downlink:e.downlink,saveData:e.saveData}}function Xd(e){let t=e?.Authorization;return typeof t=="string"&&t.startsWith("Bearer ")?t.slice(7):void 0}function AU(e,t,a,n){return{kind:e,sdkVersion:IU,channelId:t.channelId||void 0,sessionId:e==="boot"?void 0:t.sessionId||void 0,visitorId:Zt(),pageHost:window.location.hostname,connection:MU(),tags:EU(a),metrics:LU(n)}}var Vg,$d=[];function $g(e){let t=String(e?.chatTimingLogs).trim().toLowerCase()==="true";Vg=t;let a=$d;if($d=[],t)for(let n of a)n()}function Kd(e,t,a,n){let{api:r,token:o}=t;if(!(typeof window>"u"||!r||!o||Vg===!1))try{let i=AU(e,t,a,n),l=()=>{ha("timing",i),fetch(ma(r,"/timing"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify(i),keepalive:!0}).catch(()=>{})};Vg?l():$d.length<20&&$d.push(l)}catch{}}var dr=Gg("boot",0),AC;function Uo(e,t){dr.mark(e,t)}function Yd(e){AC??(AC=e)}var RU=/cdn\.jsdelivr\.net\/npm\/@waniwani\/sdk@[^/]+\/dist\/chat\/embed\.js/,DU=/\/embed\.js(\?|$)/;function _U(){if(typeof performance>"u")return;let e=performance.getEntriesByType("navigation")[0];e?.responseStart&&dr.mark("navTtfb",e.responseStart),e?.domContentLoadedEventEnd&&dr.mark("navDomContentLoaded",e.domContentLoadedEventEnd);let t=performance.getEntriesByType("resource");for(let a of t)RU.test(a.name)?(dr.mark("bundleStart",a.startTime),dr.mark("bundleEnd",a.responseEnd)):DU.test(a.name)&&(dr.mark("loaderStart",a.startTime),dr.mark("loaderEnd",a.responseEnd))}function OU(){if(kv)return!0;try{return document.querySelectorAll('script[src*="@waniwani/sdk"]').length>1}catch{return!1}}function RC(e){_U(),dr.mark("bundleExecuted",Cv),Kd("boot",e,{configSource:AC,mode:e.mode,secondSdk:OU()},dr.metrics)}var PU=[["text-delta","firstText"],["tool-input-start","firstToolInput"],["tool-output-available","firstToolOutput"]];function DC(e){let t=Gg("turn",Wg());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,l){t.mark("firstChunk");let s=r.decode(i,{stream:!0});for(let[u,c]of PU)!t.has(c)&&s.includes(u)&&t.mark(c);l.enqueue(i)}}));return new Response(o,{status:n.status,statusText:n.statusText,headers:n.headers})}catch{return n}},report(n,r){a||(a=!0,Kd("turn",n,r,t.metrics))}}}function NU(e){let t=e.indexOf("?");return t===-1?e:e.slice(0,t)}function _C(e,t){let a=Gg("widget",Wg()),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:NU(e),outcome:r,metrics:a.metrics}))}}}var BU="/api/mcp/events/v2/batch",Xg=new Set;function UU(e,t,a){return`${e}|${t}|${a??""}`}function Ys(e){return Wd(e,BU)}async function OC(e){let{api:t,token:a,channelId:n,mode:r,source:o}=e;if(typeof window>"u"||!t||!a)return;let i=Ys(t);if(!i){ha("page.viewed skipped: the chat api is not a Waniwani endpoint");return}if(!n&&!o){ha("page.viewed skipped: no channelId or source to attribute it");return}let l=UU(t,a,n);if(!Xg.has(l)){Xg.add(l);try{let s=await Ks(),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:s.visitorId},properties:{channelId:n,mode:r,url:window.location.href,referrer:s.referrer,deviceType:s.deviceType,language:s.language,timezone:s.timezone},metadata:{}}]}),d=fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:c,keepalive:!0});Uo("pageViewSent"),await d}catch{Xg.delete(l)}}}function PC(e){let t=Ys(e.api);return t?kC({endpoint:t,token:e.token,channelId:e.channelId,source:e.getSource,identity:()=>({sessionId:e.getSessionId(),visitorId:Zt()})}):Zd("the chat api does not point at a Waniwani event ingest")}function Zd(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 Jd=z(he());var Qd=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var NC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var BC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var Kg=e=>{let t=BC(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Zs=z(he());var UC={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 FC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var zC=(0,Zs.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...l},s)=>(0,Zs.createElement)("svg",{ref:s,...UC,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:Qd("lucide",r),...!o&&!FC(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,c])=>(0,Zs.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var He=(e,t)=>{let a=(0,Jd.forwardRef)(({className:n,...r},o)=>(0,Jd.createElement)(zC,{ref:o,iconNode:t,className:Qd(`lucide-${NC(Kg(e))}`,`lucide-${e}`,n),...r}));return a.displayName=Kg(e),a};var FU=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Qs=He("arrow-down",FU);var zU=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Nn=He("arrow-up",zU);var qU=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Js=He("check",qU);var HU=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Qr=He("chevron-down",HU);var jU=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],eu=He("chevron-right",jU);var VU=[["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"}]],tu=He("clipboard-copy",VU);var WU=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fr=He("clock",WU);var GU=[["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"}]],au=He("file-text",GU);var $U=[["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"}]],sl=He("file",$U);var XU=[["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"}]],nu=He("globe",XU);var KU=[["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"}]],ru=He("image",KU);var YU=[["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"}]],ou=He("loader",YU);var ZU=[["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"}]],ul=He("paperclip",ZU);var QU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],iu=He("square",QU);var JU=[["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"}]],Fo=He("wrench",JU);var e3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ga=He("x",e3);var t3=[["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"}]],lu=He("zap",t3);var $e=z(he(),1),dO=z(dm(),1);var cl=z(he(),1),su=z(ae(),1);function r3(e){return 1-(1-e)**3}function o3({start:e=0,end:t=100,duration:a=1e3,delay:n=0,ease:r=r3,onUpdate:o,onEnd:i}){let l=performance.now()+n;function s(){let u=performance.now()-l,c=Math.min(u/a,1);o(e+(t-e)*r(c)),c<1?requestAnimationFrame(s):i&&i()}setTimeout(()=>requestAnimationFrame(s),n)}var i3=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],l3=[0,1,2,0,1,2,1];function s3(e){let t=[];for(let a=0;a<7;a++){let n=e[Math.min(l3[a],e.length-1)];t.push(`radial-gradient(at ${i3[a]}, ${n} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}var u3=({children:e,className:t="",style:a,edgeSensitivity:n=30,backgroundColor:r="#120F17",borderRadius:o=28,coneSpread:i=25,animated:l=!1,colors:s=["#c084fc","#f472b6","#38bdf8"]})=>{let[u,c]=(0,cl.useState)(110),[d,f]=(0,cl.useState)(0),[p,m]=(0,cl.useState)(!1);(0,cl.useEffect)(()=>{if(!l)return;let T=110;m(!0),c(T),o3({ease:C=>C,duration:2e3,onUpdate:C=>{let M=C/100;c(T+360*M);let D=Math.min(M/.1,1),P=M>.85?(1-M)/.15:1;f(Math.min(D,P))},onEnd:()=>m(!1)})},[l]);let x=n+20,S=p?Math.max(0,(d*100-x)/(100-x)):0,y=s3(s).map(T=>`${T} border-box`),b=`conic-gradient(from ${`${u.toFixed(3)}deg`} at center, black ${i}%, transparent ${i+15}%, transparent ${100-i-15}%, black ${100-i}%)`;return(0,su.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,su.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",...y].join(", "),opacity:S,maskImage:b,WebkitMaskImage:b,transition:p?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),(0,su.jsx)("div",{className:"ww:flex ww:flex-col ww:relative ww:overflow-auto ww:z-[1]",children:e})]})},tf=u3;Yg();Qg();var c3=WC({prefix:"ww"});function q(...e){return c3(af(e))}var uu=z(ae(),1);function dl({suggestions:e,isLoading:t,onSelect:a,align:n="start",className:r,...o}){return e.length===0&&!t?null:(0,uu.jsx)("div",{className:q("ww:px-4 ww:py-2",r),...o,children:(0,uu.jsx)("div",{className:q("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,uu.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,l)=>(0,uu.jsx)("button",{type:"button",onClick:()=>a(i),className:q("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:`${l*50}ms`},children:i},i))})})}var GC=z(he(),1),$C="(max-width: 639px)";function d3(e){let t=window.matchMedia($C);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function f3(){return window.matchMedia($C).matches}function p3(){return!1}function XC(){return(0,GC.useSyncExternalStore)(d3,f3,p3)}var nf=z(he(),1);function Jg(e,t){return e.find(a=>a.text===t)?.id??null}async function KC(e){let{api:t,token:a,name:n,source:r,sessionId:o,properties:i}=e;if(typeof window>"u"||!t||!a)return;let l=Ys(t);if(l)try{let s=new Date().toISOString(),u=JSON.stringify({sentAt:s,source:{sdk:"@waniwani/sdk",version:"0.1.0"},events:[{id:crypto.randomUUID(),type:"mcp.event",name:n,source:r,timestamp:s,correlation:{visitorId:Zt(),sessionId:o},properties:{...i,url:window.location.href},metadata:{}}]});await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:u,keepalive:!0})}catch{}}async function YC(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,promptId:l,origin:s,text:u,index:c}=e;await KC({api:t,token:a,name:"suggestion.clicked",source:o,sessionId:i,properties:{promptId:l,origin:s,text:u,index:c,channelId:n,mode:r}})}function ZC(e,t){return t.map(a=>({id:Jg(e,a),text:a}))}async function QC(e){let{api:t,token:a,channelId:n,mode:r,source:o,sessionId:i,prompts:l,origin:s}=e;l.length!==0&&await KC({api:t,token:a,name:"suggestion.shown",source:o,sessionId:i,properties:{prompts:l,count:l.length,origin:s,channelId:n,mode:r}})}function fl(e){let{widgetEvents:t,api:a,token:n,channelId:r,source:o,mode:i,pagePrompts:l}=e,s=(0,nf.useRef)(e.getSessionId);s.current=e.getSessionId,(0,nf.useEffect)(()=>{if(!(!a||!n))return t.subscribe(u=>{if(u.name==="suggestion.clicked"){let{text:c,origin:d,index:f}=u.properties;YC({api:a,token:n,channelId:r,mode:i,source:o,sessionId:s.current(),promptId:Jg(l??[],c),origin:d,text:c,index:f});return}if(u.name==="suggestions.shown"){let{texts:c,origin:d}=u.properties;QC({api:a,token:n,channelId:r,mode:i,source:o,sessionId:s.current(),prompts:ZC(l??[],c),origin:d})}})},[t,a,n,r,o,i,l])}var pl=z(he(),1),m3=80,h3=50,g3=15e3,JC=500;function ml(e,t=!0){let[a,n]=(0,pl.useState)(""),r=(0,pl.useRef)(void 0);return(0,pl.useEffect)(()=>{if(!t){n("");return}let o=0,i=!1,l=!1,s=()=>{l||(i?(o--,n(e.slice(0,o)),o<=0?(i=!1,r.current=setTimeout(s,JC)):r.current=setTimeout(s,h3)):(o++,n(e.slice(0,o)),o>=e.length?(i=!0,r.current=setTimeout(s,g3)):r.current=setTimeout(s,m3)))};return r.current=setTimeout(s,JC),()=>{l=!0,clearTimeout(r.current)}},[e,t]),a}var Sn=z(he(),1);var ek=["en","fr","es"];function hl(e){return ek.includes(e)}function ew(e){if(e&&hl(e))return e;if(e){let a=e.split("-")[0]?.toLowerCase();if(a&&hl(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(hl(n))return n;let r=n.split("-")[0];if(r&&hl(r))return r}return"en"}var rf={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 tk={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 ak={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 tw={en:rf,fr:ak,es:tk};var rk=z(ae(),1),nk=(0,Sn.createContext)(null);function w3(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 zo({children:e,locale:t,messages:a}){let n=!!(t&&y3(t)),r=n?t:"en",[o,i]=(0,Sn.useState)(r),[l,s]=(0,Sn.useState)(n);(0,Sn.useEffect)(()=>{i(ew(t)),s(!0)},[t]);let u=(0,Sn.useMemo)(()=>{let c=tw[o]??tw["en"];return{locale:o,t:w3(c,a),ready:l}},[o,a,l]);return(0,rk.jsx)(nk.Provider,{value:u,children:e})}function y3(e){return e==="en"||e==="fr"||e==="es"}function Ie(){let e=(0,Sn.useContext)(nk);return e||{locale:"en",t:rf,ready:!0}}function aw(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 ze=z(he(),1);var cu=(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 Ce=z(he(),1);var qo=new Map;function ok(e,t){if(qo.has(e)){URL.revokeObjectURL(t);return}for(qo.set(e,t);qo.size>20;){let a=qo.keys().next();if(a.done)return;let n=qo.get(a.value);qo.delete(a.value),n&&URL.revokeObjectURL(n)}}function ik(e){return qo.get(e)}var lk=z(ae(),1),Bn=({className:e,variant:t="default",size:a="default",type:n="button",...r})=>(0,lk.jsx)("button",{type:n,className:q("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 sk=z(he(),1);var bt=z(ae(),1),uk=({files:e,className:t,...a})=>e.length===0?null:(0,bt.jsx)("div",{className:q("ww:flex ww:flex-wrap ww:gap-1.5",t),...a,children:e.map((n,r)=>(0,bt.jsx)(x3,{file:n},r))});function x3({file:e}){let{t}=Ie();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)(sl,{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 ck(e,t){return e.startsWith("image/")?t.attachments.kindImage:e==="application/pdf"?t.attachments.kindPdf:t.attachments.kindFile}function v3({mediaType:e}){return e.startsWith("image/")?(0,bt.jsx)(ru,{className:"ww:size-5 ww:text-muted-foreground"}):e==="application/pdf"?(0,bt.jsx)(au,{className:"ww:size-5 ww:text-muted-foreground"}):(0,bt.jsx)(sl,{className:"ww:size-5 ww:text-muted-foreground"})}function nw({filename:e,mediaType:t,previewUrl:a,subtitle:n,tone:r="default",children:o,className:i}){let{t:l}=Ie(),s=ck(t,l);return(0,bt.jsxs)("li",{"aria-label":`${e}, ${s}`,className:q("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)(v3,{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:q("ww:truncate ww:text-xs",r==="error"?"ww:text-destructive":"ww:text-muted-foreground"),children:n??s})]}),o]})}function dk(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 fk=({documents:e,className:t,...a})=>e.length===0?null:(0,bt.jsx)("ul",{className:q("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)(b3,{document:n},`${n.documentId}-${r}`))});function b3({document:e}){let{t}=Ie(),[a,n]=(0,sk.useState)(!1),r=e.mediaType.startsWith("image/")?ik(e.documentId):void 0;return r&&!a?(0,bt.jsx)("li",{children:(0,bt.jsx)("img",{alt:`${e.filename}, ${ck(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)(nw,{filename:e.filename,mediaType:e.mediaType})}var ht=z(ae(),1),S3=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}},I3=(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)},mk=(0,Ce.createContext)(null),of=()=>{let e=(0,Ce.useContext)(mk);if(!e)throw new Error("usePromptInputAttachments must be used within a PromptInput");return e},hk=({className:e,accept:t,multiple:a,globalDrop:n,maxFiles:r,maxFileSize:o,maxPdfPages:i,attachmentsEnabled:l=!0,upload:s,onDiscard:u,onError:c,onSubmit:d,children:f,...p})=>{let{t:m,locale:x}=Ie(),S=(0,Ce.useRef)(null),w=(0,Ce.useRef)(null),[y,h]=(0,Ce.useState)([]),b=(0,Ce.useRef)(y),T=(0,Ce.useRef)(new Map),C=(0,Ce.useRef)(s),M=(0,Ce.useRef)(c),D=(0,Ce.useRef)(u);(0,Ce.useEffect)(()=>{C.current=s,M.current=c,D.current=u},[s,c,u]);let P=(0,Ce.useCallback)(v=>{b.current=v,h(v)},[]),L=(0,Ce.useCallback)(()=>{S.current?.click()},[]),$=(0,Ce.useCallback)((v,K)=>{P(b.current.map(ee=>ee.id===v?{...ee,...K}:ee))},[P]),H=(0,Ce.useCallback)((v,K)=>{let ee=C.current;if(!ee)return;let we=new AbortController,Ge=ee(K,we.signal,me=>{$(v,{progress:me})}).then(me=>($(v,{status:"ready",progress:1,documentId:me.documentId,error:void 0}),me)).catch(me=>{if(we.signal.aborted)return null;let ye=me instanceof Error?me.message:m.promptInput.uploadFailed;return $(v,{status:"failed",error:ye}),M.current?.({code:"upload_failed",message:ye}),null});T.current.set(v,{file:K,controller:we,done:Ge})},[$,m]),F=(0,Ce.useCallback)(v=>{let K=[...v];if(!l||K.length===0)return;let ee=(de,Q)=>M.current?.({code:de,message:Q}),we=[];for(let de of K){if(!I3(de,t)){ee("accept",m.promptInput.errorAccept.replace("{name}",de.name));continue}if(o&&de.size>o){ee("max_file_size",m.promptInput.errorTooLarge.replace("{name}",de.name).replace("{limit}",gk(o,x)));continue}we.push(de)}if(we.length===0)return;let Ge=typeof r=="number"?Math.max(0,r-b.current.length):void 0,me=typeof Ge=="number"?we.slice(0,Ge):we;if(me.length<we.length&&ee("max_files",m.promptInput.errorTooMany.replace("{limit}",String(r))),me.length===0)return;let ye=!!C.current,le=me.map(de=>({file:de,item:{filename:de.name,id:cu(),mediaType:de.type,type:"file",url:URL.createObjectURL(de),status:ye?"uploading":"ready",progress:0}}));P([...b.current,...le.map(de=>de.item)]);for(let de of le)H(de.item.id,de.file)},[r,o,t,l,H,P,m,x]),W=(0,Ce.useCallback)(v=>{let K=T.current.get(v);K&&($(v,{status:"uploading",progress:0,error:void 0}),H(v,K.file))},[$,H]),V=(0,Ce.useCallback)((v,K)=>{T.current.get(v.id)?.controller.abort(),T.current.delete(v.id),v.url&&(!K&&!!v.documentId&&!!v.mediaType?.startsWith("image/")&&v.documentId?ok(v.documentId,v.url):URL.revokeObjectURL(v.url)),K&&v.documentId&&D.current?.({documentId:v.documentId,filename:v.filename??"",mediaType:v.mediaType??""})},[]),N=(0,Ce.useCallback)(v=>{let K=b.current.find(ee=>ee.id===v);K&&V(K,!0),P(b.current.filter(ee=>ee.id!==v))},[V,P]),R=(0,Ce.useCallback)(()=>{for(let v of b.current)V(v,!0);P([])},[V,P]),G=(0,Ce.useRef)(l);(0,Ce.useEffect)(()=>{let v=G.current;G.current=l,v&&!l&&R()},[l,R]);let ue=(0,Ce.useCallback)(()=>{for(let v of b.current)V(v,!1);P([])},[V,P]);(0,Ce.useEffect)(()=>()=>{for(let v of b.current)T.current.get(v.id)?.controller.abort(),v.url&&URL.revokeObjectURL(v.url)},[]);let I=(0,Ce.useCallback)(v=>{v.currentTarget.files&&F(v.currentTarget.files),v.currentTarget.value=""},[F]);(0,Ce.useEffect)(()=>{if(!n)return;let v=ee=>{ee.dataTransfer?.types?.includes("Files")&&ee.preventDefault()},K=ee=>{ee.dataTransfer?.types?.includes("Files")&&ee.preventDefault(),ee.dataTransfer?.files&&ee.dataTransfer.files.length>0&&F(ee.dataTransfer.files)};return document.addEventListener("dragover",v),document.addEventListener("drop",K),()=>{document.removeEventListener("dragover",v),document.removeEventListener("drop",K)}},[F,n]);let We=(0,Ce.useCallback)(async v=>{v.preventDefault();let K=v.currentTarget,ee=new FormData(K).get("message")||"",we=new Map;for(;we.size<T.current.size;)await Promise.all([...T.current.entries()].filter(([le])=>!we.has(le)).map(async([le,de])=>{we.set(le,await de.done)}));for(let le of we.keys())T.current.has(le)||we.delete(le);if([...we.values()].some(le=>le===null)){M.current?.({code:"upload_failed",message:m.promptInput.uploadFailed});return}let Ge=[...we.values()].filter(le=>le!==null),me=C.current?[]:b.current,ye=await Promise.all(me.map(async({id:le,status:de,progress:Q,error:Be,...qe})=>{if(qe.url?.startsWith("blob:")){let _e=await S3(qe.url);return{...qe,url:_e??qe.url}}return qe}));try{let le=d({documents:Ge,files:ye,text:ee},v);le instanceof Promise&&await le,K.reset(),ue()}catch{}},[d,ue,m]),Je=(0,Ce.useMemo)(()=>({add:F,clear:R,files:y,openFileDialog:L,remove:N,retry:W,maxFileSize:o,maxPdfPages:i}),[y,F,N,W,R,L,o,i]);return(0,ht.jsxs)(mk.Provider,{value:Je,children:[(0,ht.jsx)("input",{accept:t,"aria-label":m.promptInput.uploadFiles,className:"ww:hidden",multiple:a,onChange:I,ref:S,title:m.promptInput.uploadFiles,type:"file"}),(0,ht.jsx)("form",{className:q("ww:relative ww:flex ww:w-full ww:flex-col ww:rounded-lg ww:border ww:border-border ww:bg-background",e),onSubmit:We,ref:w,...p,children:f})]})},pk=1024*1024;function gk(e,t){let a=e>=pk;return new Intl.NumberFormat(t,{style:"unit",unit:a?"megabyte":"kilobyte",maximumFractionDigits:0}).format(a?e/pk:Math.max(1,e/1024))}var wk=({onChange:e,onKeyDown:t,className:a,placeholder:n,...r})=>{let{t:o}=Ie(),i=of(),[l,s]=(0,Ce.useState)(!1),u=n??o.promptInput.placeholder,c=(0,Ce.useCallback)(f=>{if(t?.(f),!f.defaultPrevented){if(f.key==="Enter"){if(l||f.nativeEvent.isComposing||f.shiftKey)return;f.preventDefault();let{form:p}=f.currentTarget;if(p?.querySelector('[data-submit-blocked="true"]')||p?.querySelector('button[type="submit"]')?.disabled)return;p?.requestSubmit()}if(f.key==="Backspace"&&f.currentTarget.value===""&&i.files.length>0){f.preventDefault();let p=i.files.at(-1);p&&i.remove(p.id)}}},[t,l,i]),d=(0,Ce.useCallback)(f=>{let p=f.clipboardData?.items;if(!p)return;let m=[];for(let x of p)if(x.kind==="file"){let S=x.getAsFile();S&&m.push(S)}m.length>0&&(f.preventDefault(),i.add(m))},[i]);return(0,ht.jsx)("textarea",{className:q("ww:field-sizing-content ww:max-h-48 ww:min-h-0 ww:w-full ww:resize-none ww:border-0 ww:bg-transparent ww:px-3 ww:py-2 ww:text-base ww:sm:text-sm ww:outline-none ww:placeholder:text-muted-foreground",a),name:"message",onCompositionEnd:()=>s(!1),onCompositionStart:()=>s(!0),onKeyDown:c,onPaste:d,placeholder:u,onChange:e,...r})},yk=({className:e,status:t,onStop:a,onClick:n,children:r,disabled:o,...i})=>{let{t:l}=Ie(),s=t==="submitted"||t==="streaming",u=s&&a!==void 0,c=(0,ht.jsx)(Nn,{className:"ww:size-4"});t==="submitted"?c=(0,ht.jsx)(ou,{className:"ww:size-4 ww:animate-spin"}):t==="streaming"&&(c=(0,ht.jsx)(iu,{className:"ww:size-4"}));let d=(0,Ce.useCallback)(f=>{if(s&&a){f.preventDefault(),a();return}n?.(f)},[s,a,n]);return(0,ht.jsx)(Bn,{"aria-label":s?l.promptInput.stop:l.promptInput.submit,className:q("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})},xk=({className:e,children:t,...a})=>{let{t:n,locale:r}=Ie(),o=of();if(o.files.length>0)return(0,ht.jsxs)(Bn,{className:q("ww:group ww:relative",e),onClick:()=>o.clear(),size:"icon-sm",type:"button",variant:"ghost","aria-label":n.promptInput.removeAttachments,...a,children:[(0,ht.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,ht.jsx)(Ga,{className:"ww:absolute ww:size-4 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100"})]});let l=o.maxFileSize?(o.maxPdfPages?n.promptInput.uploadFilesUpToWithPages.replace("{pages}",String(o.maxPdfPages)):n.promptInput.uploadFilesUpTo).replace("{limit}",gk(o.maxFileSize,r)):n.promptInput.uploadFiles;return(0,ht.jsx)(Bn,{"aria-label":l,className:q(e),title:l,onClick:()=>o.openFileDialog(),size:"icon-sm",type:"button",variant:"ghost",...a,children:t??(0,ht.jsx)(ul,{className:"ww:size-4"})})},vk=({className:e,...t})=>{let a=of();return a.files.length===0?null:(0,ht.jsx)("ul",{className:q("ww:flex ww:list-none ww:flex-wrap ww:gap-2 ww:p-0",e),...t,children:a.files.map(n=>(0,ht.jsx)(C3,{file:n},n.id))})};function C3({file:e}){let{t}=Ie(),a=of(),n=e.status==="failed",r=e.status==="uploading";return(0,ht.jsxs)(nw,{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,ht.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,ht.jsx)("button",{"aria-label":t.promptInput.removeAttachment,className:q("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,ht.jsx)(Ga,{className:"ww:size-3.5"})}),r?(0,ht.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 bk=({enabled:e=!0})=>{let{t}=Ie(),[a,n]=(0,Ce.useState)(!1);return(0,Ce.useEffect)(()=>{if(!e)return;let r=0,o=u=>!!u.dataTransfer?.types?.includes("Files"),i=u=>{o(u)&&(r+=1,n(!0))},l=u=>{o(u)&&(r=Math.max(0,r-1),r===0&&n(!1))},s=()=>{r=0,n(!1)};return document.addEventListener("dragenter",i),document.addEventListener("dragleave",l),document.addEventListener("drop",s),()=>{document.removeEventListener("dragenter",i),document.removeEventListener("dragleave",l),document.removeEventListener("drop",s)}},[e]),e&&a?(0,ht.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,ht.jsxs)("span",{className:"ww:flex ww:items-center ww:gap-2 ww:text-sm ww:font-medium",children:[(0,ht.jsx)(ul,{className:"ww:size-4"}),t.promptInput.dropToAttach]})}):null};var Ik=z(ae(),1);function Sk({text:e}){let{t}=Ie();return e===!1?null:(0,Ik.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 lf=z(he(),1);var Ho=z(ae(),1),Ck=({className:e,...t})=>(0,Ho.jsx)("div",{className:q("ww:flex ww:flex-col ww:gap-1 ww:px-3 ww:py-2",e),...t}),kk=({className:e,...t})=>(0,Ho.jsx)("li",{className:q("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}),Tk=({className:e,...t})=>(0,Ho.jsx)("span",{className:q("ww:inline-block ww:size-2 ww:shrink-0 ww:rounded-full ww:border ww:border-muted-foreground/50",e),...t}),Lk=({className:e,...t})=>(0,Ho.jsx)("span",{className:q("ww:line-clamp-1 ww:grow ww:break-words ww:text-muted-foreground",e),...t}),Ek=({className:e,...t})=>(0,Ho.jsx)("div",{className:q("ww:flex ww:shrink-0 ww:gap-1 ww:opacity-0 ww:transition-opacity ww:group-hover:opacity-100",e),...t}),Mk=({className:e,...t})=>(0,Ho.jsx)(Bn,{className:q("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 sn=z(ae(),1),Ak=(0,lf.memo)(({message:e,onRemove:t})=>{let{t:a}=Ie(),n=(0,lf.useCallback)(()=>t(e.id),[t,e.id]);return(0,sn.jsxs)(kk,{children:[(0,sn.jsx)(Tk,{}),(0,sn.jsx)(Lk,{children:e.text||a.chatQueue.attachmentFallback}),(0,sn.jsx)(Ek,{children:(0,sn.jsx)(Mk,{"aria-label":a.chatQueue.removeFromQueue,onClick:n,children:(0,sn.jsx)(Ga,{className:"ww:size-3"})})})]})});Ak.displayName="ChatQueueItem";function Rk({queuedMessages:e,onRemove:t,className:a}){let{t:n}=Ie();return e.length===0?null:(0,sn.jsxs)(Ck,{className:q("ww:border-t ww:border-border",a),children:[(0,sn.jsx)("div",{className:"ww:text-[11px] ww:font-medium ww:text-muted-foreground ww:px-2",children:n.chatQueue.queued(e.length)}),(0,sn.jsx)("ul",{children:e.map(r=>(0,sn.jsx)(Ak,{message:r,onRemove:t},r.id))})]})}var _a=z(he(),1);var St=z(he(),1);dp();var u2=z(he(),1);var c2=z(ae(),1),V6=({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,c2.jsx)(e,{"data-waniwani-shimmer":"",className:q("ww:inline-block",t),style:i,...o,children:r})},Tn=(0,u2.memo)(V6);Tn.displayName="Shimmer";var ua=z(ae(),1),d2=(0,St.createContext)(null);function f2(){let e=(0,St.useContext)(d2);if(!e)throw new Error("Reasoning components must be used within <Reasoning>");return e}var W6=1e3,G6=1e3,Uu=(0,St.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:n,onOpenChange:r,duration:o,children:i,...l})=>{let s=n??t,u=n===!1,c=a!==void 0,[d,f]=(0,St.useState)(s),p=c?a:d,m=(0,St.useCallback)(M=>{c||f(M),r?.(M)},[c,r]),[x,S]=(0,St.useState)(void 0),w=o??x,y=(0,St.useRef)(t),[h,b]=(0,St.useState)(!1),T=(0,St.useRef)(null);(0,St.useEffect)(()=>{t?(y.current=!0,T.current===null&&(T.current=Date.now())):T.current!==null&&(S(Math.ceil((Date.now()-T.current)/G6)),T.current=null)},[t]),(0,St.useEffect)(()=>{t&&!p&&!u&&m(!0)},[t,p,u,m]),(0,St.useEffect)(()=>{if(y.current&&!t&&p&&!h){let M=setTimeout(()=>{m(!1),b(!0)},W6);return()=>clearTimeout(M)}},[t,p,h,m]);let C=(0,St.useMemo)(()=>({isStreaming:t,isOpen:p,setIsOpen:m,duration:w}),[t,p,m,w]);return(0,ua.jsx)(d2.Provider,{value:C,children:(0,ua.jsx)("div",{className:q("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":p?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...l,children:i})})});Uu.displayName="Reasoning";var Fu=(0,St.memo)(({className:e,children:t,getThinkingMessage:a,hideIcon:n=!1,onClick:r,...o})=>{let{t:i}=Ie(),{isStreaming:l,isOpen:s,duration:u,setIsOpen:c}=f2(),f=a??((p,m)=>p||m===0?(0,ua.jsx)(Tn,{duration:1.6,children:i.reasoning.thinking}):m===void 0?(0,ua.jsx)("span",{children:i.reasoning.thoughtBrief}):(0,ua.jsx)("span",{children:i.reasoning.thoughtForSeconds(m)}));return(0,ua.jsx)("button",{type:"button","aria-expanded":s,onClick:p=>{c(!s),r?.(p)},className:q("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,ua.jsxs)(ua.Fragment,{children:[!n&&(0,ua.jsx)(fr,{className:"ww:size-4 ww:shrink-0"}),f(l,u)]})})});Fu.displayName="ReasoningTrigger";var zu=(0,St.memo)(({className:e,children:t,...a})=>{let{isOpen:n}=f2();return(0,ua.jsx)("div",{className:q("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,ua.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,ua.jsx)("div",{className:q("ww:text-sm ww:text-muted-foreground",e),...a,children:(0,ua.jsx)(El,{children:t})})})})});zu.displayName="ReasoningContent";var Ne=z(ae(),1),$6=500,p2=(0,_a.createContext)(null);function m2(){let e=(0,_a.useContext)(p2);if(!e)throw new Error("ChainOfThought components must be used within <ChainOfThought>");return e}function h2({className:e,isWorking:t=!1,activeStep:a,open:n,defaultOpen:r=!1,onOpenChange:o,children:i,...l}){let s=n!==void 0,[u,c]=(0,_a.useState)(r),d=s?n:u,f=(0,_a.useCallback)(S=>{s||c(S),o?.(S)},[s,o]),[p,m]=(0,_a.useState)(!t);(0,_a.useEffect)(()=>{if(t){m(!1);return}let S=setTimeout(()=>m(!0),$6);return()=>clearTimeout(S)},[t]);let x=(0,_a.useMemo)(()=>({open:d,setOpen:f,isWorking:t,settled:p,activeStep:a}),[d,f,t,p,a]);return(0,Ne.jsx)(p2.Provider,{value:x,children:(0,Ne.jsx)("div",{className:q("ww:mb-4 ww:flex ww:flex-col ww:gap-2",e),"data-state":d?"open":"closed",style:{animation:"ww-fade-in 0.2s ease-out"},...l,children:i})})}function g2({className:e,label:t,workingLabel:a,children:n,...r}){let{open:o,setOpen:i,isWorking:l,settled:s,activeStep:u}=m2();if(!s){let c=u?.icon,d=u?.label??a??t??"";return(0,Ne.jsx)("div",{className:q("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,Ne.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,Ne.jsx)(c,{className:q("ww:size-4 ww:shrink-0",l&&"ww:animate-pulse")}),(0,Ne.jsx)("span",{className:"ww:truncate",children:l?(0,Ne.jsx)(Tn,{duration:2.6,children:d}):d})]},d)})}return(0,Ne.jsxs)("button",{type:"button",onClick:()=>i(!o),"aria-expanded":o,className:q("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,Ne.jsx)("span",{className:"ww:truncate",children:n??t}),(0,Ne.jsx)(Qr,{className:q("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",o&&"ww:rotate-180")})]})}function w2({className:e,children:t,...a}){let{open:n}=m2();return(0,Ne.jsx)("div",{className:q("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,Ne.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ne.jsx)("div",{className:q("ww:flex ww:flex-col",e),...a,children:t})})})}function y2({icon:e,isLast:t,running:a,error:n}){return(0,Ne.jsxs)("div",{className:"ww:flex ww:flex-col ww:items-center ww:self-stretch",children:[(0,Ne.jsx)("span",{className:"ww:flex ww:h-5 ww:items-center",children:(0,Ne.jsx)(e,{className:q("ww:size-4 ww:shrink-0",n?"ww:text-destructive":a?"ww:animate-pulse ww:text-foreground":"ww:text-muted-foreground")})}),!t&&(0,Ne.jsx)("span",{className:"ww:w-px ww:flex-1 ww:bg-border"})]})}function Rx({className:e,icon:t,title:a,state:n,isLast:r=!1,children:o,...i}){let l=n==="input-available"||n==="input-streaming",s=n==="output-error",u=o!=null,[c,d]=(0,_a.useState)(!1),f=a??"",p=l?(0,Ne.jsx)(Tn,{duration:1.6,children:f}):(0,Ne.jsx)("span",{className:"ww:truncate",children:f});return(0,Ne.jsxs)("div",{className:q("ww:flex ww:gap-2",e),...i,children:[(0,Ne.jsx)(y2,{icon:t,isLast:r,running:l,error:s}),(0,Ne.jsxs)("div",{className:q("ww:min-w-0 ww:flex-1",!r&&"ww:pb-3"),children:[u?(0,Ne.jsxs)("button",{type:"button",onClick:()=>d(m=>!m),"aria-expanded":c,className:"ww:flex ww:w-full ww:items-center ww:gap-1.5 ww:text-left ww:text-sm ww:text-muted-foreground ww:transition-colors ww:hover:text-foreground",children:[p,(0,Ne.jsx)(Qr,{className:q("ww:size-3.5 ww:shrink-0 ww:transition-transform ww:duration-200",c&&"ww:rotate-180")})]}):(0,Ne.jsx)("div",{className:"ww:flex ww:items-center ww:text-sm ww:text-muted-foreground",children:p}),u&&(0,Ne.jsx)("div",{className:q("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,Ne.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Ne.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 x2({isStreaming:e=!1,isLast:t=!1,children:a}){return(0,Ne.jsxs)("div",{className:"ww:flex ww:gap-2",children:[(0,Ne.jsx)(y2,{icon:fr,isLast:t,running:e}),(0,Ne.jsx)("div",{className:q("ww:min-w-0 ww:flex-1",!t&&"ww:pb-3"),children:(0,Ne.jsxs)(Uu,{isStreaming:e,className:"ww:mb-0",children:[(0,Ne.jsx)(Fu,{hideIcon:!0}),(0,Ne.jsx)(zu,{children:a})]})})]})}var Dx={name:"cjk-noop",type:"cjk",remarkPluginsBefore:[],remarkPluginsAfter:[],remarkPlugins:[]};var v2={name:"shiki-noop",type:"code-highlighter",supportsLanguage:()=>!1,getSupportedLanguages:()=>[],getThemes:()=>["github-light","github-dark"],highlight:()=>null};var I2=z(he(),1);var vr=z(he(),1),X6=5,b2=400;function S2(e,t,a={}){let{msPerChar:n=X6}=a,[r,o]=(0,vr.useState)(t?"":e),i=(0,vr.useRef)(e),l=(0,vr.useRef)(t?0:e.length),s=(0,vr.useRef)(0),u=(0,vr.useRef)(null);return(e.length<l.current||!e.startsWith(r.slice(0,l.current)))&&(l.current=t?0:e.length),i.current=e,(0,vr.useEffect)(()=>{if(!t){u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),l.current=e.length,o(e);return}if(i.current.length-l.current>b2&&(l.current=i.current.length-b2),u.current!==null)return;let d=f=>{let p=i.current;if(l.current>=p.length){u.current=null;return}s.current===0&&(s.current=f);let m=f-s.current;if(m>=n){let x=Math.min(Math.floor(m/n),p.length-l.current);l.current+=x,o(p.slice(0,l.current)),s.current=f}u.current=requestAnimationFrame(d)};return u.current=requestAnimationFrame(d),()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}},[e,t,n]),r}var qu=z(ae(),1),_x=({className:e,from:t,children:a,...n})=>(0,qu.jsx)("div",{className:q("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,qu.jsx)("div",{className:q("ww:flex ww:min-w-0 ww:flex-col ww:gap-2","ww:w-full"),children:a})}),Ox=({children:e,className:t,...a})=>(0,qu.jsx)("div",{className:q("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}),K6={cjk:Dx,code:v2},Y6={cjk:Dx},Z6={enabled:!1};function Q6({className:e,linkSafety:t,isStreaming:a,children:n,...r}){let i=S2(typeof n=="string"?n:"",!!a),l=typeof n=="string"?i:n;return(0,qu.jsx)(El,{className:q("ww:size-full ww:[&>*:first-child]:mt-0 ww:[&>*:last-child]:mb-0",e),linkSafety:t??Z6,plugins:a?Y6:K6,...r,children:l})}var gp=(0,I2.memo)(Q6,(e,t)=>e.children===t.children&&e.isStreaming===t.isStreaming);gp.displayName="MessageResponse";var Vt=z(he(),1);function Px(e){if(!(typeof e!="object"||e===null))return e}function C2(e){return Px(e?.ui)}function Nx(e){if(!e)return;let t=C2(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 Hu(e){return C2(e)?.autoHeight===!0}function Bx(e){return Px(Px(e)?._meta)}var Te=z(ae(),1);function J6(e,t=80){if(e==null)return String(e);if(typeof e!="object")return String(e).slice(0,t);if(Array.isArray(e))return`Array(${e.length})`;let a=JSON.stringify(e);if(a.length<=t)return a;let n=Object.entries(e),r=[],o=t-2;for(let[i,l]of n){if(o<=8)break;let s=i.length>4?`${i.slice(0,4)}\u2026`:i,u;typeof l=="string"?u=l.length>2?`'${l.slice(0,1)}\u2026`:`'${l}'`:Array.isArray(l)?u=`Array(${l.length})`:typeof l=="object"&&l!==null?u="{\u2026}":u=String(l);let c=`${s}\u2009${u}`;r.push(c),o-=c.length+3}return`{${r.join(", ")}}`}function e9({text:e,className:t}){let{t:a}=Ie(),[n,r]=(0,Vt.useState)(!1),o=(0,Vt.useRef)(null);(0,Vt.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let i=(0,Vt.useCallback)(async l=>{l.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>r(!1),2e3)}catch{}},[e]);return(0,Te.jsx)(Bn,{variant:"ghost",size:"sm",onClick:i,className:q("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,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(Js,{className:"ww:size-3.5"}),(0,Te.jsx)("span",{children:a.tool.copied})]}):(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(tu,{className:"ww:size-3.5"}),(0,Te.jsx)("span",{children:a.tool.copy})]})})}function k2({data:e,label:t,className:a,...n}){let[r,o]=(0,Vt.useState)(!1),i=(0,Vt.useMemo)(()=>JSON.stringify(e,null,2),[e]),l=J6(e);return(0,Te.jsxs)("div",{className:q("ww:rounded-lg ww:bg-tool-card",a),...n,children:[(0,Te.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:px-3 ww:pt-2.5 ww:pb-1.5",children:[(0,Te.jsx)("span",{className:"ww:text-xs ww:font-medium ww:text-muted-foreground",children:t}),(0,Te.jsx)(e9,{text:i})]}),(0,Te.jsxs)("button",{type:"button",onClick:()=>o(s=>!s),className:"ww:flex ww:w-full ww:items-start ww:gap-2 ww:px-3 ww:pb-3 ww:text-left",children:[(0,Te.jsx)(eu,{className:q("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,Te.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,Te.jsx)("code",{children:i})}):(0,Te.jsx)("span",{className:"ww:truncate ww:text-xs ww:font-mono ww:text-foreground/80",children:l})]})]})}var Ux=(0,Vt.createContext)({open:!1,toggle:()=>{}});function T2({className:e,defaultOpen:t=!1,children:a,...n}){let[r,o]=(0,Vt.useState)(t);return(0,Te.jsx)(Ux.Provider,{value:{open:r,toggle:()=>o(i=>!i)},children:(0,Te.jsx)("div",{className:q("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 L2({className:e,title:t,state:a,...n}){let{open:r,toggle:o}=(0,Vt.useContext)(Ux),i=a==="input-available"||a==="input-streaming",l=t??"";return(0,Te.jsxs)("button",{type:"button",onClick:o,className:q("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,Te.jsx)(Fo,{className:"ww:size-4 ww:shrink-0"}),(0,Te.jsx)("span",{className:"ww:truncate",children:i?(0,Te.jsx)(Tn,{duration:1.6,children:l}):l}),(0,Te.jsx)(Qr,{className:q("ww:size-4 ww:shrink-0 ww:transition-transform ww:duration-200",r&&"ww:rotate-180")})]})}function E2({className:e,title:t,state:a,...n}){let r=a==="input-available"||a==="input-streaming",o=t??"";return(0,Te.jsx)("div",{className:q("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,Te.jsx)("span",{className:"ww:truncate",children:r?(0,Te.jsx)(Tn,{duration:1.6,children:o}):o})})}function M2({className:e,children:t,...a}){let{open:n}=(0,Vt.useContext)(Ux);return(0,Te.jsx)("div",{className:q("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,Te.jsx)("div",{className:"ww:min-h-0 ww:overflow-hidden",children:(0,Te.jsx)("div",{className:q("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 Fx({className:e,input:t,debug:a,...n}){let{t:r}=Ie(),o=(0,Vt.useMemo)(()=>{if(!a&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:i,...l}=t;return l}return t},[t,a]);return(0,Te.jsx)(k2,{data:o,label:r.tool.request,className:e,...n})}function ju(e,t,a){if(e){let n=Nx(a?.[e]?._meta);if(n)return n}return Nx(Bx(t))}function A2(e,t,a){return e&&Hu(a?.[e]?._meta)?!0:Hu(Bx(t))}function zx({className:e,output:t,errorText:a,debug:n,...r}){let{t:o}=Ie(),i=(0,Vt.useMemo)(()=>{if(!n&&typeof t=="object"&&t!==null&&!Array.isArray(t)){let{_meta:l,...s}=t;return s}return t},[t,n]);return t||a?a?(0,Te.jsxs)("div",{className:q("ww:space-y-2",e),...r,children:[(0,Te.jsx)("h4",{className:"ww:text-xs ww:font-medium ww:uppercase ww:tracking-wide ww:text-muted-foreground",children:o.tool.error}),(0,Te.jsx)("div",{className:"ww:rounded-lg ww:bg-destructive/10 ww:p-3 ww:text-xs ww:text-destructive",children:a})]}):(0,Te.jsx)(k2,{data:i,label:o.tool.response,className:e,...r}):null}var Vu=z(ae(),1);function R2(e){return e.type==="text"||e.type==="reasoning"||e.type==="file"||"toolCallId"in e}function D2(e){return e.parts.some(R2)}function _2(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=>!(!R2(o)||a?.ignoreToolParts&&"toolCallId"in o||a?.ignoreReasoningParts&&o.type==="reasoning"))}function O2({className:e,...t}){let{t:a}=Ie();return(0,Vu.jsxs)("div",{"aria-live":"polite",className:q("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,Vu.jsx)(lu,{className:"ww:size-4 ww:shrink-0"}),(0,Vu.jsx)(Tn,{duration:1.6,children:a.workingIndicator.default})]})}var Qe=z(he(),1);function li(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 P2(e,t){return!li(e)&&!li(t)?null:li(e)?li(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 br=z(he(),1);var N2=(0,br.createContext)(()=>{});function B2(){return(0,br.useContext)(N2)}var U2=N2.Provider;function t9(e){let t=window.requestIdleCallback;typeof t=="function"?t(e):setTimeout(e,500)}function Ml(e){let t=(0,br.useRef)(e);t.current=e;let a=(0,br.useRef)(!1);(0,br.useEffect)(()=>{if(!e.painted||a.current)return;a.current=!0;let n=requestAnimationFrame(()=>{let r=t.current;Uo(r.paintMark),t9(()=>RC(r))});return()=>cancelAnimationFrame(n)},[e.painted])}var F2=z(ae(),1),a9="/api/mcp/resource",n9=500,r9=0,o9=16,i9="2026-01-26",l9=300,s9=3e3,u9=3,c9=2e3;function d9(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function f9(e,t,a){return ju(e,t,a)?!1:t._meta?.["waniwani/autoInjectResultText"]!==!1}function wp({resourceUri:e,toolInput:t,toolResult:a,resourceEndpoint:n=a9,chatSessionId:r,isDark:o=!1,className:i,autoHeight:l=!1,onOpenLink:s,onFollowUp:u,onCallTool:c,onDisplayModeChange:d,isFullscreen:f=!1,toolDefinitions:p}){let m=(0,Qe.useRef)(null),x=(0,Qe.useRef)(t),S=(0,Qe.useRef)(a),w=(0,Qe.useRef)({width:0,height:0}),y=(0,Qe.useRef)(null),h=(0,Qe.useRef)(!1),b=(0,Qe.useRef)(0),T=(0,Qe.useRef)("inline"),[C,M]=(0,Qe.useState)(r9),[D,P]=(0,Qe.useState)(void 0),L=(0,Qe.useRef)(s),$=(0,Qe.useRef)(u),H=(0,Qe.useRef)(c),F=(0,Qe.useRef)(d),W=(0,Qe.useRef)(r),V=(0,Qe.useRef)(p);x.current=t,S.current=a,L.current=s,$.current=u,H.current=c,F.current=d,W.current=r,V.current=p;let N=(0,Qe.useCallback)(v=>l?Math.max(v+o9,0):Math.min(Math.max(v,50),n9),[l]),R=(0,Qe.useMemo)(()=>{let v=n.includes("?")?"&":"?";return`${n}${v}uri=${encodeURIComponent(e)}`},[n,e]),G=B2(),ue=(0,Qe.useRef)(null),I=(0,Qe.useRef)(void 0);(0,Qe.useEffect)(()=>{let v=_C(e,G);return ue.current=v,()=>{clearTimeout(I.current),v.has("initialized")||v.report("timeout",b.current),ue.current=null}},[e,G]);let We=(0,Qe.useRef)(o);We.current=o;let Je=(0,Qe.useRef)(f);return(0,Qe.useEffect)(()=>{Je.current=f,w.current.height=-1,y.current&&(y.current.cancel(),y.current=null)},[f]),(0,Qe.useEffect)(()=>{if(!h.current)return;let v=m.current;v?.contentWindow&&v.contentWindow.postMessage({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{theme:o?"dark":"light"}},"*")},[o]),(0,Qe.useEffect)(()=>{let v=m.current;if(!v)return;let K=!1,ee=!1,we=null,Ge=null,me=setTimeout(()=>{if(K||ee||b.current>=u9)return;b.current+=1;let de=new URL(v.src);de.searchParams.set("_retry",String(b.current)),v.src=de.toString()},s9),ye=de=>{v.contentWindow?.postMessage(de,"*")},le=de=>{if(K||de.source!==v.contentWindow)return;let Q=de.data;if(!Q||typeof Q!="object"||Q.jsonrpc!=="2.0")return;let Be=Q.method,qe=Q.id;if(Be==="ui/initialize"&&qe!=null){ee=!0,ue.current?.mark("initialize"),clearTimeout(me),ye({jsonrpc:"2.0",id:qe,result:{protocolVersion:Q.params?.protocolVersion??i9,hostInfo:{name:"Waniwani Chat",version:"1.0.0"},hostCapabilities:{openLinks:{},message:{text:{}},tools:{},updateModelContext:{text:{},structuredContent:{}}},hostContext:{theme:We.current?"dark":"light",displayMode:T.current}}});return}if(Be==="ui/notifications/initialized"){h.current=!0,ue.current?.mark("initialized"),I.current=setTimeout(()=>ue.current?.report("ok",b.current),c9);let _e=x.current,ke=S.current,xe=ke._meta&&typeof ke._meta=="object"?ke._meta:null,Y=d9(W.current),Oe=xe&&typeof xe.waniwani=="object"&&xe.waniwani!==null?xe.waniwani:null,rt=Oe||Y?{...Oe??{},...Y?{sessionId:Y}:{}}:void 0,ba=xe||rt?{...xe??{},...rt?{waniwani:rt}:{}}:void 0;ye({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:_e}});let Sa=ke.content??[{type:"text",text:JSON.stringify(ke)}];ye({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:{content:Sa,structuredContent:ke.structuredContent,_meta:ba,meta:ba}});return}if(Be==="ui/notifications/size-changed"){clearTimeout(I.current),ue.current?.mark("firstSize"),ue.current?.report("ok",b.current);let _e=Q.params,ke=typeof _e?.height=="number"?_e.height:void 0,xe=typeof _e?.width=="number"?_e.width:void 0,Y=w.current,Oe=ke!==void 0&&ke!==Y.height,rt=xe!==void 0&&xe!==Y.width;if(!Oe&&!rt)return;if(Oe&&ke!==void 0){if(Y.height=ke,Je.current)return;let ba=N(ke),Sa=v.getBoundingClientRect().height;if(y.current&&(y.current.cancel(),y.current=null),M(ba),v.animate&&Math.abs(Sa-ba)>2){let ra=v.animate([{height:`${Sa}px`},{height:`${ba}px`}],{duration:l9,easing:"ease-out",fill:"forwards"});y.current=ra,ra.onfinish=()=>{y.current===ra&&(ra.cancel(),y.current=null)}}}rt&&l&&xe!==void 0&&(Y.width=xe,P(xe));return}if(Be==="ui/open-link"&&qe!=null){let _e=Q.params?.url;typeof _e=="string"&&(L.current?L.current(_e):window.open(_e,"_blank","noopener,noreferrer")),ye({jsonrpc:"2.0",id:qe,result:{}});return}if(Be==="ui/message"&&qe!=null){if($.current&&Q.params){let _e=Q.params,ke=we;if(we=null,Ge){clearTimeout(Ge.timer);let xe=Ge.text;Ge=null;let Y=(_e.content??[]).map(Oe=>Oe.text??"").join("").trim();_e={..._e,content:[{type:"text",text:`${Y}
|
|
122
|
-
|
|
123
|
-
${xe}`}]}}$.current({..._e,...ke?{modelContext:ke}:{}})}ye({jsonrpc:"2.0",id:qe,result:{}});return}if(Be==="ui/update-model-context"&&qe!=null){we=P2(we,Q.params),ye({jsonrpc:"2.0",id:qe,result:{}});return}if(Be==="tools/call"&&qe!=null){let _e=H.current;if(!_e){ye({jsonrpc:"2.0",id:qe,error:{code:-32601,message:"tools/call not supported"}});return}let ke=Q.params?.name;_e({name:ke,arguments:Q.params?.arguments??{}}).then(xe=>{ye({jsonrpc:"2.0",id:qe,result:xe});let Y=xe.content?.map(Oe=>Oe.text??"").join("").trim();Y&&f9(ke,xe,V.current)&&(Ge&&clearTimeout(Ge.timer),Ge={text:Y,timer:setTimeout(()=>{if(K)return;let Oe=we;we=null,Ge=null,$.current?.({role:"user",content:[{type:"text",text:Y}],...Oe?{modelContext:Oe}:{}})},500)})}).catch(xe=>{let Y=xe instanceof Error?xe.message:"Tool call failed";ye({jsonrpc:"2.0",id:qe,error:{code:-32e3,message:Y}})});return}if(Be==="ui/request-display-mode"&&qe!=null){let _e=Q.params?.mode,ke=_e==="fullscreen"||_e==="inline"||_e==="pip"?_e:"inline";T.current=ke,ye({jsonrpc:"2.0",id:qe,result:{mode:ke}}),ye({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:{displayMode:ke}}),F.current?.(ke);return}if(Be==="ui/resource-teardown"&&qe!=null){ye({jsonrpc:"2.0",id:qe,result:{}});return}Be==="ping"&&qe!=null&&ye({jsonrpc:"2.0",id:qe,result:{}})};return window.addEventListener("message",le),()=>{K=!0,clearTimeout(me),Ge&&clearTimeout(Ge.timer),window.removeEventListener("message",le)}},[l,N]),(0,F2.jsx)("iframe",{ref:m,src:R,onLoad:()=>ue.current?.mark("iframeLoad"),sandbox:"allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox",className:q(!f&&"ww:rounded-md ww:border ww:border-border",i),style:{height:f?"100%":C,minWidth:f||!D?void 0:`min(${D}px, 100%)`,width:"100%",border:"none",colorScheme:o?"dark":"auto"},title:"MCP App"})}var uo=z(ae(),1);function z2({icon:e,title:t,description:a,suggestions:n,onSuggestionSelect:r}){return(0,uo.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,uo.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,uo.jsx)("h2",{className:"ww:text-lg ww:font-semibold ww:text-foreground",children:t}),a&&(0,uo.jsx)("p",{className:"ww:mt-1 ww:text-sm ww:text-muted-foreground ww:max-w-sm",children:a}),n&&n.length>0&&(0,uo.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,uo.jsx)("button",{type:"button",onClick:()=>r?.(o),className:q("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 q2=z(he(),1);var Al=z(ae(),1);function p9({onRetry:e}){let{t}=Ie();return(0,Al.jsxs)("div",{className:"ww:flex ww:items-center ww:justify-between ww:rounded-md ww:border ww:border-border ww:bg-muted/50 ww:px-4 ww:py-3 ww:text-sm ww:text-muted-foreground",children:[(0,Al.jsx)("span",{children:t.widgetErrorBoundary.failedToLoad}),(0,Al.jsx)("button",{type:"button",onClick:e,className:"ww:text-xs ww:font-medium ww:text-primary ww:hover:underline",children:t.widgetErrorBoundary.retry})]})}var yp=class extends q2.Component{constructor(){super(...arguments);re(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a){console.warn("[Waniwani] Widget failed to render:",a.message)}render(){return this.state.hasError?(0,Al.jsx)(p9,{onRetry:()=>this.setState({hasError:!1})}):this.props.children}};var Le=z(ae(),1);function qx(e){return e?e.replace(/[-_]/g," ").replace(/^\w/,t=>t.toUpperCase()):"Tool"}function H2(e){return e&&/search|find|lookup|query|web|browse|google/i.test(e)?nu:Fo}function j2({messages:e,status:t,welcomeMessage:a,welcome:n,onSuggestionSelect:r,resourceEndpoint:o,chatSessionId:i,isDark:l,onFollowUp:s,onCallTool:u,onWidgetDisplayModeChange:c,fullscreenToolCallId:d,debug:f,showToolCalls:p=!0,toolDefinitions:m,messageClassNames:x}){let{t:S}=Ie(),w=e[e.length-1],y=e.length>0,h=d!=null,b=!h&&_2(e,t,{ignoreToolParts:p===!1,ignoreReasoningParts:p===!1});return(0,Le.jsxs)(Le.Fragment,{children:[!h&&(!y&&n?(0,Le.jsx)(z2,{...n,onSuggestionSelect:r}):a&&(0,Le.jsx)(_x,{from:"assistant",children:(0,Le.jsx)(Ox,{children:(0,Le.jsx)(gp,{children:a})})})),e.map(T=>{let C=T.parts.filter(N=>N.type==="text"),M=T.parts.filter(N=>N.type==="reasoning"),D=T.parts.filter(N=>N.type==="file"),P=dk(T.metadata),L=T.parts.filter(N=>"toolCallId"in N),$=T.parts.filter(N=>N.type==="reasoning"||"toolCallId"in N),H=T===w&&T.role==="assistant",F=C.length>0,W=h?L.some(N=>N.toolCallId===d):!1,V=p!==!1&&!W&&$.length>=2;return h&&!W?(0,Le.jsx)("div",{style:{display:"none"}},T.id):T.role==="assistant"&&!D2(T)?(0,Le.jsx)("div",{style:{display:"none"}},T.id):p===!1&&T.role==="assistant"&&!F&&D.length===0&&L.every(N=>{let R="output"in N?N.output:void 0;return R===void 0||!o||!ju(N.toolName,R,m)})?(0,Le.jsx)("div",{style:{display:"none"}},T.id):(0,Le.jsxs)(_x,{from:T.role,className:x?.message,children:[p!==!1&&!W&&!V&&M.map((N,R)=>(0,Le.jsxs)(Uu,{isStreaming:N.state==="streaming",children:[(0,Le.jsx)(Fu,{}),(0,Le.jsx)(zu,{children:N.text})]},`reasoning-${T.id}-${R}`)),V&&(()=>{let N=$[$.length-1],R=N.type==="reasoning"?{icon:fr,label:S.reasoning.thinking}:{icon:H2(N.toolName),label:N.title??qx(N.toolName)};return(0,Le.jsxs)(h2,{isWorking:H&&(t==="streaming"||t==="submitted"),activeStep:R,children:[(0,Le.jsx)(g2,{workingLabel:S.chainOfThought.working,label:S.chainOfThought.done}),(0,Le.jsx)(w2,{children:$.map((G,ue)=>{let I=ue===$.length-1;if(G.type==="reasoning")return(0,Le.jsx)(x2,{isStreaming:G.state==="streaming",isLast:I,children:G.text},`reasoning-${T.id}-${ue}`);let We=G.title??qx(G.toolName),Je=H2(G.toolName);if(p==="titles-only")return(0,Le.jsx)(Rx,{icon:Je,title:We,state:G.state,isLast:I},G.toolCallId);let v="output"in G?G.output:void 0;return(0,Le.jsxs)(Rx,{icon:Je,title:We,state:G.state,isLast:I,children:[(0,Le.jsx)(Fx,{input:G.input,debug:f}),v!==void 0&&(0,Le.jsx)(zx,{output:v,errorText:"errorText"in G?G.errorText:void 0,debug:f})]},G.toolCallId)})})]})})(),p!==!1&&!W&&!V&&L.length===1&&(()=>{let N=L[0],R=N.title??qx(N.toolName);if(p==="titles-only")return(0,Le.jsx)(E2,{title:R,state:N.state});let G="output"in N?N.output:void 0;return(0,Le.jsxs)(T2,{children:[(0,Le.jsx)(L2,{title:R,state:N.state}),(0,Le.jsxs)(M2,{children:[(0,Le.jsx)(Fx,{input:N.input,debug:f}),G!==void 0&&(0,Le.jsx)(zx,{output:G,errorText:"errorText"in N?N.errorText:void 0,debug:f})]})]})})(),L.map(N=>{let R="output"in N?N.output:void 0,G=ju(N.toolName,R,m),ue=A2(N.toolName,R,m),I=N.toolCallId===d;return G&&o&&R!==void 0?(0,Le.jsx)("div",{style:I?{position:"absolute",inset:0,zIndex:10,display:"flex",flexDirection:"column",overflow:"hidden",background:"var(--ww-color-background)"}:void 0,children:G&&o&&R!==void 0&&(0,Le.jsx)(yp,{children:(0,Le.jsx)(wp,{isFullscreen:I,resourceUri:G,toolInput:N.input??{},toolResult:{content:R.content,structuredContent:R.structuredContent,_meta:R._meta},resourceEndpoint:o,chatSessionId:i,isDark:l,autoHeight:ue,toolDefinitions:m,onFollowUp:s,onCallTool:u,onDisplayModeChange:c?We=>c(We,{toolCallId:N.toolCallId,resourceUri:G,toolInput:N.input??{},toolResult:{content:R.content,structuredContent:R.structuredContent,_meta:R._meta},autoHeight:ue}):void 0})})},N.toolCallId):null}),!W&&P.length>0&&(0,Le.jsx)(fk,{documents:P}),!W&&(0,Le.jsx)("div",{children:(0,Le.jsxs)(Ox,{className:q(T.role==="user"?x?.userBubble:x?.assistantBubble),children:[D.length>0&&(0,Le.jsx)(uk,{files:D}),F?C.map((N,R)=>{let G=H&&t==="streaming"&&R===C.length-1;return(0,Le.jsx)(gp,{isStreaming:G,children:N.type==="text"?N.text:""},`${T.id}-${R}`)}):null]})})]},T.id)}),b&&(0,Le.jsx)(O2,{})]})}var co=z(ae(),1);function m9({label:e}){return(0,co.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,co.jsx)("title",{children:e}),(0,co.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,co.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function xp({onClick:e}){let{t}=Ie();return(0,co.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,co.jsx)(m9,{label:t.threadMenu.newChat})})}var Wu=z(ae(),1),h9="https://app.waniwani.ai/assets/waniwani-logo.svg",g9="https://waniwani.ai";function V2(){let{t:e}=Ie();return(0,Wu.jsxs)("a",{href:g9,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,Wu.jsx)("span",{children:e.poweredBy.label}),(0,Wu.jsx)("img",{src:h9,alt:"Waniwani",width:72,height:10,"data-waniwani-logo":"",className:"ww:h-2.5 ww:w-auto"})]})}var Rl=z(he(),1);var ut=z(ae(),1),W2=20;function w9({label:e}){return(0,ut.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,ut.jsx)("title",{children:e}),(0,ut.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,ut.jsx)("polyline",{points:"3 4 3 9 8 9"}),(0,ut.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"12"}),(0,ut.jsx)("line",{x1:"12",y1:"12",x2:"15",y2:"14"})]})}function y9({label:e}){return(0,ut.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,ut.jsx)("title",{children:e}),(0,ut.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,ut.jsx)("path",{d:"M19 6l-2 14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L5 6"}),(0,ut.jsx)("path",{d:"M10 11v6"}),(0,ut.jsx)("path",{d:"M14 11v6"})]})}function G2({threads:e,activeThreadId:t,onNewThread:a,onSelectThread:n,onDeleteThread:r}){let{locale:o,t:i}=Ie(),[l,s]=(0,Rl.useState)(!1),u=(0,Rl.useRef)(null);(0,Rl.useEffect)(()=>{if(!l)return;let f=p=>{let m=u.current;m&&(p.composedPath().includes(m)||s(!1))};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[l]);let c=e.slice(0,W2),d=Math.max(0,e.length-W2);return(0,ut.jsxs)("div",{ref:u,className:"ww:relative ww:flex ww:items-center ww:gap-1",children:[(0,ut.jsx)(xp,{onClick:a}),(0,ut.jsx)("button",{type:"button",onClick:()=>s(f=>!f),title:i.threadMenu.threadHistory,"aria-label":i.threadMenu.threadHistory,"aria-expanded":l,className:"ww:p-1.5 ww:rounded-md ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/5 ww:transition-colors ww:cursor-pointer",children:(0,ut.jsx)(w9,{label:i.threadMenu.threadHistory})}),l&&(0,ut.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,ut.jsx)("div",{className:"ww:px-3 ww:py-3 ww:text-xs ww:text-muted-foreground",children:i.threadMenu.noPreviousChats}),c.map(f=>{let p=f.threadId===t,m=Date.parse(f.updatedAt);return(0,ut.jsxs)("div",{className:`ww:flex ww:items-center ww:gap-2 ww:px-3 ww:py-2 ww:text-xs hover:ww:bg-foreground/5 ${p?"ww:bg-foreground/5":""}`,children:[(0,ut.jsxs)("button",{type:"button",onClick:()=>{n(f.threadId),s(!1)},className:"ww:flex-1 ww:min-w-0 ww:text-left ww:cursor-pointer",children:[(0,ut.jsx)("div",{className:"ww:truncate ww:text-foreground ww:font-medium",children:f.title}),(0,ut.jsx)("div",{className:"ww:text-[10px] ww:text-muted-foreground",children:Number.isNaN(m)?"":aw(m,o)})]}),(0,ut.jsx)("button",{type:"button",onClick:x=>{x.stopPropagation(),r(f.threadId)},title:i.threadMenu.deleteThread,"aria-label":i.threadMenu.deleteThread,className:"ww:p-1 ww:rounded ww:text-muted-foreground hover:ww:text-foreground hover:ww:bg-foreground/10 ww:transition-colors ww:cursor-pointer",children:(0,ut.jsx)(y9,{label:i.threadMenu.deleteThread})})]},f.threadId)}),d>0&&(0,ut.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 vp=z(he(),1);function Dl(e){let t=new Set;return{subscribe(a){return t.add(a),()=>{t.delete(a)}},emit(a){let{sessionId:n,...r}=a,o=a.name==="session.started"?a.properties.sessionId:void 0,i={...r,mode:e.mode,sessionId:Object.hasOwn(a,"sessionId")?n:o??e.getSessionId?.(),timestamp:Date.now()};for(let l of[...t])try{l(i)}catch(s){console.warn("[Waniwani] onEvent subscriber threw:",s)}}}}function $2(){return{subscribe(){return()=>{}},emit(){}}}var X2=(0,vp.createContext)($2());function bp(){return(0,vp.useContext)(X2)}var _l=X2.Provider;var Sp=z(he(),1);function K2(e){let t=(0,Sp.useRef)(e);return t.current=e,(0,Sp.useCallback)(async a=>{let{api:n,headers:r,onCallTool:o,sessionId:i}=t.current;if(o)return o(a);let l=ma(n??"/api/waniwani","/tool"),s=typeof i=="string"&&i.trim().length>0?i.trim():void 0,u=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",...s?{"X-Session-Id":s}:{},...r},body:JSON.stringify(a)});if(!u.ok)throw new Error(`Tool call failed: ${u.status} ${u.statusText}`);return u.json()},[])}var pn=z(he(),1);var CD="vercel.ai.error",x9=Symbol.for(CD),Y2,Z2,Fe=class kD extends(Z2=Error,Y2=x9,Z2){constructor({name:t,message:a,cause:n}){super(a),this[Y2]=!0,this.name=t,this.cause=n}static isInstance(t){return kD.hasMarker(t,CD)}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}},TD="AI_APICallError",LD=`vercel.ai.error.${TD}`,v9=Symbol.for(LD),Q2,J2,Kie=class extends(J2=Fe,Q2=v9,J2){constructor({message:e,url:t,requestBodyValues:a,statusCode:n,responseHeaders:r,responseBody:o,cause:i,isRetryable:l=n!=null&&(n===408||n===409||n===429||n>=500),data:s}){super({name:TD,message:e,cause:i}),this[Q2]=!0,this.url=t,this.requestBodyValues=a,this.statusCode=n,this.responseHeaders=r,this.responseBody=o,this.isRetryable=l,this.data=s}static isInstance(e){return Fe.hasMarker(e,LD)}},ED="AI_EmptyResponseBodyError",MD=`vercel.ai.error.${ED}`,b9=Symbol.for(MD),eD,tD,Yie=class extends(tD=Fe,eD=b9,tD){constructor({message:e="Empty response body"}={}){super({name:ED,message:e}),this[eD]=!0}static isInstance(e){return Fe.hasMarker(e,MD)}};function AD(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var RD="AI_InvalidArgumentError",DD=`vercel.ai.error.${RD}`,S9=Symbol.for(DD),aD,nD,_D=class extends(nD=Fe,aD=S9,nD){constructor({message:e,cause:t,argument:a}){super({name:RD,message:e,cause:t}),this[aD]=!0,this.argument=a}static isInstance(e){return Fe.hasMarker(e,DD)}},OD="AI_InvalidPromptError",PD=`vercel.ai.error.${OD}`,I9=Symbol.for(PD),rD,oD,Zie=class extends(oD=Fe,rD=I9,oD){constructor({prompt:e,message:t,cause:a}){super({name:OD,message:`Invalid prompt: ${t}`,cause:a}),this[rD]=!0,this.prompt=e}static isInstance(e){return Fe.hasMarker(e,PD)}},ND="AI_InvalidResponseDataError",BD=`vercel.ai.error.${ND}`,C9=Symbol.for(BD),iD,lD,Qie=class extends(lD=Fe,iD=C9,lD){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:ND,message:t}),this[iD]=!0,this.data=e}static isInstance(e){return Fe.hasMarker(e,BD)}},UD="AI_JSONParseError",FD=`vercel.ai.error.${UD}`,k9=Symbol.for(FD),sD,uD,jx=class extends(uD=Fe,sD=k9,uD){constructor({text:e,cause:t}){super({name:UD,message:`JSON parsing failed: Text: ${e}.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
`)?s.slice(0,-1):s}),l=void 0,s="",u=""}function m(x={}){o&&x.consume&&d(o),i=!0,l=void 0,s="",u="",o=""}return{feed:c,reset:m}}function _9(e){let t=[],a="",n=0;for(;n<e.length;){let r=e.indexOf("\r",n),o=e.indexOf(`
|
|
128
|
-
`,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 l=e.slice(n,i);t.push(l),n=i+1,e[n-1]==="\r"&&e[n]===`
|
|
129
|
-
`&&n++}}return[t,a]}var kp=class extends TransformStream{constructor({onError:t,onRetry:a,onComment:n}={}){let r;super({start(o){r=e_({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:Sle,atob:Ile}=globalThis;var i_="AI_DownloadError",l_=`vercel.ai.error.${i_}`,O9=Symbol.for(l_),t_,a_,dn=class extends(a_=Fe,t_=O9,a_){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:i_,message:r,cause:n}),this[t_]=!0,this.url=e,this.statusCode=t,this.statusText=a}static isInstance(e){return Fe.hasMarker(e,l_)}},Qx=2*1024*1024*1024;async function s_({response:e,url:t,maxBytes:a=Qx}){let n=e.headers.get("content-length");if(n!=null){let c=parseInt(n,10);if(!isNaN(c)&&c>a)throw new dn({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes (Content-Length: ${c}).`})}let r=e.body;if(r==null)return new Uint8Array(0);let o=r.getReader(),i=[],l=0;try{for(;;){let{done:c,value:d}=await o.read();if(c)break;if(l+=d.length,l>a)throw new dn({url:t,message:`Download of ${t} exceeded maximum size of ${a} bytes.`});i.push(d)}}finally{try{await o.cancel()}finally{o.releaseLock()}}let s=new Uint8Array(l),u=0;for(let c of i)s.set(c,u),u+=c.length;return s}function Jx(e){let t;try{t=new URL(e)}catch{throw new dn({url:e,message:`Invalid URL: ${e}`})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new dn({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let a=t.hostname;if(!a)throw new dn({url:e,message:"URL must have a hostname"});if(a==="localhost"||a.endsWith(".local")||a.endsWith(".localhost"))throw new dn({url:e,message:`URL with hostname ${a} is not allowed`});if(a.startsWith("[")&&a.endsWith("]")){let n=a.slice(1,-1);if(P9(n))throw new dn({url:e,message:`URL with IPv6 address ${a} is not allowed`});return}if(u_(a)){if(Kx(a))throw new dn({url:e,message:`URL with IP address ${a} is not allowed`});return}}function u_(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 Kx(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 P9(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let a=t.slice(7);if(u_(a))return Kx(a);let n=a.split(":");if(n.length===2){let r=parseInt(n[0],16),o=parseInt(n[1],16);if(!isNaN(r)&&!isNaN(o)){let i=r>>8&255,l=r&255,s=o>>8&255,u=o&255;return Kx(`${i}.${l}.${s}.${u}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}var Sr=({prefix:e,size:t=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let r=()=>{let o=a.length,i=new Array(t);for(let l=0;l<t;l++)i[l]=a[Math.random()*o|0];return i.join("")};if(e==null)return r;if(a.includes(n))throw new _D({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${a}".`});return()=>`${e}${n}${r()}`},c_=Sr();function d_(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 Tp(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 N9=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,B9=/"(?: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 n_(e){let t=JSON.parse(e);return t===null||typeof t!="object"||N9.test(e)===!1&&B9.test(e)===!1?t:U9(t)}function U9(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 F9(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return n_(e)}try{return n_(e)}finally{Error.stackTraceLimit=t}}function ev(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]=si(a[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(si):si(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(si)),e.allOf!=null&&(e.allOf=e.allOf.map(si)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(si));let{definitions:t}=e;if(t!=null)for(let a of Object.keys(t))t[a]=si(t[a]);return e}function si(e){return typeof e=="boolean"?e:ev(e)}var z9=Symbol("Let zodToJsonSchema decide on which parser to use"),r_={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"},q9=e=>typeof e=="string"?{...r_,name:e}:{...r_,...e};function Ka(){return{}}function H9(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)!==ge.ZodAny&&(o.items=nt(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 j9(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 V9(){return{type:"boolean"}}function f_(e,t){return nt(e.type._def,t)}var W9=(e,t)=>nt(e.innerType._def,t);function p_(e,t,a){let n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,o)=>p_(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 G9(e)}}var G9=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 $9(e,t){return{...nt(e.innerType._def,t),default:e.defaultValue()}}function X9(e,t){return t.effectStrategy==="input"?nt(e.schema._def,t):Ka()}function K9(e){return{type:"string",enum:Array.from(e.values)}}var Y9=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Z9(e,t){let a=[nt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),nt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),n=[];return a.forEach(r=>{if(Y9(r))n.push(...r.allOf);else{let o=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:i,...l}=r;o=l}n.push(o)}}),n.length?{allOf:n}:void 0}function Q9(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 $x=void 0,Ln={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:()=>($x===void 0&&($x=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),$x),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 m_(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":En(a,"email",n.message,t);break;case"format:idn-email":En(a,"idn-email",n.message,t);break;case"pattern:zod":xa(a,Ln.email,n.message,t);break}break;case"url":En(a,"uri",n.message,t);break;case"uuid":En(a,"uuid",n.message,t);break;case"regex":xa(a,n.regex,n.message,t);break;case"cuid":xa(a,Ln.cuid,n.message,t);break;case"cuid2":xa(a,Ln.cuid2,n.message,t);break;case"startsWith":xa(a,RegExp(`^${Xx(n.value,t)}`),n.message,t);break;case"endsWith":xa(a,RegExp(`${Xx(n.value,t)}$`),n.message,t);break;case"datetime":En(a,"date-time",n.message,t);break;case"date":En(a,"date",n.message,t);break;case"time":En(a,"time",n.message,t);break;case"duration":En(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":{xa(a,RegExp(Xx(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&En(a,"ipv4",n.message,t),n.version!=="v4"&&En(a,"ipv6",n.message,t);break}case"base64url":xa(a,Ln.base64url,n.message,t);break;case"jwt":xa(a,Ln.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&xa(a,Ln.ipv4Cidr,n.message,t),n.version!=="v4"&&xa(a,Ln.ipv6Cidr,n.message,t);break}case"emoji":xa(a,Ln.emoji(),n.message,t);break;case"ulid":{xa(a,Ln.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{En(a,"binary",n.message,t);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{xa(a,Ln.base64,n.message,t);break}}break}case"nanoid":xa(a,Ln.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return a}function Xx(e,t){return t.patternStrategy==="escape"?ej(e):e}var J9=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ej(e){let t="";for(let a=0;a<e.length;a++)J9.has(e[a])||(t+="\\"),t+=e[a];return t}function En(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 xa(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:o_(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):e.pattern=o_(t,n)}function o_(e,t){var a;if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=n.i?e.source.toLowerCase():e.source,o="",i=!1,l=!1,s=!1;for(let u=0;u<r.length;u++){if(i){o+=r[u],i=!1;continue}if(n.i){if(l){if(r[u].match(/[a-z]/)){s?(o+=r[u],o+=`${r[u-2]}-${r[u]}`.toUpperCase(),s=!1):r[u+1]==="-"&&((a=r[u+2])!=null&&a.match(/[a-z]/))?(o+=r[u],s=!0):o+=`${r[u]}${r[u].toUpperCase()}`;continue}}else if(r[u].match(/[a-z]/)){o+=`[${r[u]}${r[u].toUpperCase()}]`;continue}}if(n.m){if(r[u]==="^"){o+=`(^|(?<=[\r
|
|
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>${io(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=fN(e);if(r===null)return n;e=r;let o='<a href="'+e+'"';return t&&(o+=' title="'+io(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=fN(e);if(r===null)return io(a);e=r;let o=`<img src="${e}" alt="${a}"`;return t&&(o+=` title="${io(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:io(e.text)}},AS=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}},rr=class xS{constructor(t){K(this,"options");K(this,"renderer");K(this,"textRenderer");this.options=t||xs,this.options.renderer=this.options.renderer||new vh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new AS}static parse(t,a){return new xS(a).parse(t)}static parseInline(t,a){return new xS(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}},Rd=(gh=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?rr.parse:rr.parseInline}},K(gh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),K(gh,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),gh),PX=class{constructor(...e){K(this,"defaults",bS());K(this,"options",this.setOptions);K(this,"parse",this.parseMarkdown(!0));K(this,"parseInline",this.parseMarkdown(!1));K(this,"Parser",rr);K(this,"Renderer",vh);K(this,"TextRenderer",AS);K(this,"Lexer",Sn);K(this,"Tokenizer",wh);K(this,"Hooks",Rd);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 vh(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 wh(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 Rd;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];Rd.passThroughHooks.has(o)?r[i]=u=>{if(this.defaults.async&&Rd.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 rr.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?rr.parse:rr.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?rr.parse:rr.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>"+io(a.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(a);throw a}}},vs=new PX;vt.options=vt.setOptions=function(e){return vs.setOptions(e),vt.defaults=vs.defaults,hN(vt.defaults),vt};vt.getDefaults=bS;vt.defaults=xs;vt.use=function(...e){return vs.use(...e),vt.defaults=vs.defaults,hN(vt.defaults),vt};vt.walkTokens=function(e,t){return vs.walkTokens(e,t)};vt.parseInline=vs.parseInline;vt.Parser=rr;vt.parser=rr.parse;vt.Renderer=vh;vt.TextRenderer=AS;vt.Lexer=Sn;vt.lexer=Sn.lex;vt.Tokenizer=wh;vt.Hooks=Rd;vt.parse=vt;Wye=vt.options,Gye=vt.setOptions,Xye=vt.use,Kye=vt.walkTokens,Yye=vt.parseInline,Zye=rr.parse,Jye=Sn.lex});var LN={};of(LN,{CodeBlock:()=>zX});var or,nn,OX,NX,UX,BX,zX,EN=L(()=>{"use strict";"use client";Sh();or=j(Ee(),1),nn=j(he(),1),OX=Ie("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"),NX=(0,or.memo)(({children:e,result:t,language:a,className:n,...r})=>{let o=(0,or.useMemo)(()=>({backgroundColor:t.bg,color:t.fg}),[t.bg,t.fg]);return(0,nn.jsx)("pre",{className:Ie(n,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":a,"data-streamdown":"code-block-body",style:o,...r,children:(0,nn.jsx)("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:t.tokens.map((i,s)=>(0,nn.jsx)("span",{className:OX,children:i.map((l,u)=>(0,nn.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),UX=({className:e,language:t,style:a,...n})=>(0,nn.jsx)("div",{className:Ie("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}),BX=({language:e,children:t})=>(0,nn.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,nn.jsx)("span",{className:"ml-1 font-mono lowercase",children:e}),(0,nn.jsx)("div",{className:"flex items-center gap-2",children:t})]}),zX=({code:e,language:t,className:a,children:n,...r})=>{let{shikiTheme:o}=(0,or.useContext)(Fa),i=AN(),s=(0,or.useMemo)(()=>({bg:"transparent",fg:"inherit",tokens:e.split(`
|
|
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===`
|
|
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
|
+
`)},iK=e=>{let{headers:t,rows:a}=e,n=s=>{let l=!1;for(let c of s)if(c===" "||c===`
|
|
116
|
+
`||c==="\r"){l=!0;break}if(!l)return s;let u=[];for(let c of s)c===" "?u.push("\\t"):c===`
|
|
117
|
+
`?u.push("\\n"):c==="\r"?u.push("\\r"):u.push(c);return u.join("")},r=t.length>0?a.length+1:a.length,o=new Array(r),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
|
+
`)},DS=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("")},sK=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=>DS(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?DS(s[u]):"";n[r]=`| ${l.join(" | ")} |`,r+=1}else{let l=s.map(u=>DS(u));n[r]=`| ${l.join(" | ")} |`,r+=1}return n.join(`
|
|
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]==="$"},kK=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]==="$"},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: ${xL(t)}`,cause:t}),this[J1]=!0,this.text=e}static isInstance(e){return Je.hasMarker(e,AL)}},ML="AI_LoadAPIKeyError",RL=`vercel.ai.error.${ML}`,G4=Symbol.for(RL),eL,tL,XQ=class extends(tL=Je,eL=G4,tL){constructor({message:e}){super({name:ML,message:e}),this[eL]=!0}static isInstance(e){return Je.hasMarker(e,RL)}},DL="AI_LoadSettingError",_L=`vercel.ai.error.${DL}`,X4=Symbol.for(_L),aL,nL,KQ=class extends(nL=Je,aL=X4,nL){constructor({message:e}){super({name:DL,message:e}),this[aL]=!0}static isInstance(e){return Je.hasMarker(e,_L)}},PL="AI_NoContentGeneratedError",OL=`vercel.ai.error.${PL}`,K4=Symbol.for(OL),rL,oL,YQ=class extends(oL=Je,rL=K4,oL){constructor({message:e="No content generated."}={}){super({name:PL,message:e}),this[rL]=!0}static isInstance(e){return Je.hasMarker(e,OL)}},NL="AI_NoSuchModelError",UL=`vercel.ai.error.${NL}`,Y4=Symbol.for(UL),iL,sL,ZQ=class extends(sL=Je,iL=Y4,sL){constructor({errorName:e=NL,modelId:t,modelType:a,message:n=`No such ${a}: ${t}`}){super({name:e,message:n}),this[iL]=!0,this.modelId=t,this.modelType=a}static isInstance(e){return Je.hasMarker(e,UL)}},BL="AI_TooManyEmbeddingValuesForCallError",zL=`vercel.ai.error.${BL}`,Z4=Symbol.for(zL),lL,uL,JQ=class extends(uL=Je,lL=Z4,uL){constructor(e){super({name:BL,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[lL]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return Je.hasMarker(e,zL)}},FL="AI_TypeValidationError",qL=`vercel.ai.error.${FL}`,J4=Symbol.for(qL),cL,dL,Yn=class av extends(dL=Je,cL=J4,dL){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:FL,message:`${r}: Value: ${JSON.stringify(t)}.
|
|
123
|
+
Error message: ${xL(a)}`,cause:a}),this[cL]=!0,this.value=t,this.context=n}static isInstance(t){return Je.hasMarker(t,qL)}static wrap({value:t,cause:a,context:n}){var r,o,i;return av.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 av({value:t,cause:a,context:n})}},HL="AI_UnsupportedFunctionalityError",jL=`vercel.ai.error.${HL}`,Q4=Symbol.for(jL),fL,pL,QQ=class extends(pL=Je,fL=Q4,pL){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:HL,message:t}),this[fL]=!0,this.functionality=e}static isInstance(e){return Je.hasMarker(e,jL)}};var Yp=()=>ov,ov=new Proxy(Yp,{get(e,t){return t==="parse"||t==="parseAsync"?a=>a:t==="safeParse"||t==="safeParseAsync"?a=>({success:!0,data:a}):t==="_def"?{}:t==="jsonSchema"?{}:Yp},apply(){return ov}}),rv=class extends Error{constructor(){super(...arguments);K(this,"issues",[])}},f=new Proxy(Yp,{get(e,t){return t==="ZodError"?rv:t==="NEVER"?Symbol("NEVER"):Yp},apply(){return ov}});var Me={};var Zp=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 iv(e){}function VL(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=iv,onError:a=iv,onRetry:n=iv,onComment:r}=e,o="",i=!0,s,l="",u="";function c(v){let I=i?v.replace(/^\xEF\xBB\xBF/,""):v,[y,w]=e5(`${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 Zp(`Invalid \`retry\` value: "${I}"`,{type:"invalid-retry",value:I,line:y}));break;default:a(new Zp(`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 e5(e){let t=[],a="",n=0;for(;n<e.length;){let r=e.indexOf("\r",n),o=e.indexOf(`
|
|
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
|
|
130
128
|
]))`;continue}else if(r[u]==="$"){o+=`($|(?=[\r
|
|
131
|
-
]))`;continue}}if(n.s&&r[u]==="."){o+=
|
|
129
|
+
]))`;continue}}if(n.s&&r[u]==="."){o+=s?`${r[u]}\r
|
|
132
130
|
`:`[${r[u]}\r
|
|
133
|
-
]`;continue}o+=r[u],r[u]==="\\"?i=!0:l&&r[u]==="]"?l=!1:!l&&r[u]==="["&&(l=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function h_(e,t){var a,n,r,o,i,l;let s={type:"object",additionalProperties:(a=nt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?a:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===ge.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...c}=m_(e.keyType._def,t);return{...s,propertyNames:c}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===ge.ZodEnum)return{...s,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===ge.ZodBranded&&e.keyType._def.type._def.typeName===ge.ZodString&&((l=e.keyType._def.type._def.checks)!=null&&l.length)){let{type:u,...c}=f_(e.keyType._def,t);return{...s,propertyNames:c}}}return s}function tj(e,t){if(t.mapStrategy==="record")return h_(e,t);let a=nt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Ka(),n=nt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Ka();return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function aj(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 nj(){return{not:Ka()}}function rj(){return{type:"null"}}var Yx={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function oj(e,t){let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in Yx&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let i=Yx[o._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:n.length>1?n:n[0]}}else if(a.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=a.reduce((r,o)=>{let i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(n.length===a.length){let r=n.filter((o,i,l)=>l.indexOf(o)===i);return{type:r.length>1?r:r[0],enum:a.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(a.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((n,r)=>[...n,...r._def.values.filter(o=>!n.includes(o))],[])};return ij(e,t)}var ij=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>nt(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 lj(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Yx[e.innerType._def.typeName],"null"]};let a=nt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function sj(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 uj(e,t){let a={type:"object",properties:{}},n=[],r=e.shape();for(let i in r){let l=r[i];if(l===void 0||l._def===void 0)continue;let s=dj(l),u=nt(l._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(a.properties[i]=u,s||n.push(i))}n.length&&(a.required=n);let o=cj(e,t);return o!==void 0&&(a.additionalProperties=o),a}function cj(e,t){if(e.catchall._def.typeName!=="ZodNever")return nt(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 dj(e){try{return e.isOptional()}catch{return!0}}var fj=(e,t)=>{var a;if(t.currentPath.toString()===((a=t.propertyPath)==null?void 0:a.toString()))return nt(e.innerType._def,t);let n=nt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Ka()},n]}:Ka()},pj=(e,t)=>{if(t.pipeStrategy==="input")return nt(e.in._def,t);if(t.pipeStrategy==="output")return nt(e.out._def,t);let a=nt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=nt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function mj(e,t){return nt(e.type._def,t)}function hj(e,t){let n={type:"array",uniqueItems:!0,items:nt(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 gj(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>nt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:nt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>nt(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function wj(){return{not:Ka()}}function yj(){return Ka()}var xj=(e,t)=>nt(e.innerType._def,t),vj=(e,t,a)=>{switch(t){case ge.ZodString:return m_(e,a);case ge.ZodNumber:return sj(e);case ge.ZodObject:return uj(e,a);case ge.ZodBigInt:return j9(e);case ge.ZodBoolean:return V9();case ge.ZodDate:return p_(e,a);case ge.ZodUndefined:return wj();case ge.ZodNull:return rj();case ge.ZodArray:return H9(e,a);case ge.ZodUnion:case ge.ZodDiscriminatedUnion:return oj(e,a);case ge.ZodIntersection:return Z9(e,a);case ge.ZodTuple:return gj(e,a);case ge.ZodRecord:return h_(e,a);case ge.ZodLiteral:return Q9(e);case ge.ZodEnum:return K9(e);case ge.ZodNativeEnum:return aj(e);case ge.ZodNullable:return lj(e,a);case ge.ZodOptional:return fj(e,a);case ge.ZodMap:return tj(e,a);case ge.ZodSet:return hj(e,a);case ge.ZodLazy:return()=>e.getter()._def;case ge.ZodPromise:return mj(e,a);case ge.ZodNaN:case ge.ZodNever:return nj();case ge.ZodEffects:return X9(e,a);case ge.ZodAny:return Ka();case ge.ZodUnknown:return yj();case ge.ZodDefault:return $9(e,a);case ge.ZodBranded:return f_(e,a);case ge.ZodReadonly:return xj(e,a);case ge.ZodCatch:return W9(e,a);case ge.ZodPipeline:return pj(e,a);case ge.ZodFunction:case ge.ZodVoid:case ge.ZodSymbol:return;default:return(n=>{})(t)}},bj=(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 nt(e,t,a=!1){var n;let r=t.seen.get(e);if(t.override){let s=(n=t.override)==null?void 0:n.call(t,e,t,r,a);if(s!==z9)return s}if(r&&!a){let s=Sj(r,t);if(s!==void 0)return s}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=vj(e,e.typeName,t),l=typeof i=="function"?nt(i(),t):i;if(l&&Ij(e,t,l),t.postProcess){let s=t.postProcess(l,e,t);return o.jsonSchema=l,s}return o.jsonSchema=l,l}var Sj=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:bj(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`),Ka()):t.$refStrategy==="seen"?Ka():void 0}},Ij=(e,t,a)=>(e.description&&(a.description=e.description),a),Cj=e=>{let t=q9(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}]))}},kj=(e,t)=>{var a;let n=Cj(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[c,d])=>{var f;return{...u,[c]:(f=nt(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0))!=null?f:Ka()}},{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(a=nt(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1))!=null?a:Ka(),l=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;l!==void 0&&(i.title=l);let s=o===void 0?r?{...i,[n.definitionPath]:r}:i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,o].join("/"),[n.definitionPath]:{...r,[o]:i}};return s.$schema="http://json-schema.org/draft-07/schema#",s},Zx=Symbol.for("vercel.ai.schema");function Lp(e){let t;return()=>(t==null&&(t=e()),t)}function Ep(e,{validate:t}={}){return{[Zx]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function Tj(e){return typeof e=="object"&&e!==null&&Zx in e&&e[Zx]===!0&&"jsonSchema"in e&&"validate"in e}function Mp(e){return e==null?Ep({properties:{},additionalProperties:!1}):Tj(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?$u(e):Lj(e):e()}function Lj(e){return Ep(()=>ev(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 qn({value:t,cause:a.issues})}}})}function Ej(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Ep(()=>kj(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 Mj(e,t){var a;let n=(a=t?.useReferences)!=null?a:!1;return Ep(()=>ev((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 Aj(e){return"_zod"in e}function $u(e,t){return Aj(e)?Mj(e,t):Ej(e,t)}async function Ap({value:e,schema:t,context:a}){let n=await Ol({value:e,schema:t,context:a});if(!n.success)throw qn.wrap({value:e,cause:n.error,context:a});return n.value}async function Ol({value:e,schema:t,context:a}){let n=Mp(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:qn.wrap({value:e,cause:r.error,context:a}),rawValue:e}}catch(r){return{success:!1,error:qn.wrap({value:e,cause:r,context:a}),rawValue:e}}}async function Ir({text:e,schema:t}){try{let a=F9(e);return t==null?{success:!0,value:a,rawValue:a}:await Ol({value:a,schema:t})}catch(a){return{success:!1,error:jx.isInstance(a)?a:new jx({text:e,cause:a}),rawValue:void 0}}}function g_({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new kp).pipeThrough(new TransformStream({async transform({data:a},n){a!=="[DONE]"&&n.enqueue(await Ir({text:a,schema:t}))}}))}async function Hn(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var Dj=Object.defineProperty,_j=(e,t)=>{for(var a in t)Dj(e,a,{get:t[a],enumerable:!0})},Oj="AI_InvalidArgumentError",Pj=`vercel.ai.error.${Oj}`,Nj=Symbol.for(Pj),Bj;Bj=Nj;var Uj="AI_InvalidStreamPartError",Fj=`vercel.ai.error.${Uj}`,zj=Symbol.for(Fj),qj;qj=zj;var Hj="AI_InvalidToolApprovalError",jj=`vercel.ai.error.${Hj}`,Vj=Symbol.for(jj),Wj;Wj=Vj;var Gj="AI_InvalidToolInputError",$j=`vercel.ai.error.${Gj}`,Xj=Symbol.for($j),Kj;Kj=Xj;var Yj="AI_ToolCallNotFoundForApprovalError",Zj=`vercel.ai.error.${Yj}`,Qj=Symbol.for(Zj),Jj;Jj=Qj;var e8="AI_MissingToolResultsError",t8=`vercel.ai.error.${e8}`,a8=Symbol.for(t8),n8;n8=a8;var r8="AI_NoImageGeneratedError",o8=`vercel.ai.error.${r8}`,i8=Symbol.for(o8),l8;l8=i8;var y_="AI_NoObjectGeneratedError",x_=`vercel.ai.error.${y_}`,s8=Symbol.for(x_),v_,po=class extends Fe{constructor({message:e="No object generated.",cause:t,text:a,response:n,usage:r,finishReason:o}){super({name:y_,message:e,cause:t}),this[v_]=!0,this.text=a,this.response=n,this.usage=r,this.finishReason=o}static isInstance(e){return Fe.hasMarker(e,x_)}};v_=s8;var u8="AI_NoOutputGeneratedError",c8=`vercel.ai.error.${u8}`,d8=Symbol.for(c8),f8;f8=d8;var p8="AI_NoSpeechGeneratedError",m8=`vercel.ai.error.${p8}`,h8=Symbol.for(m8),g8;g8=h8;var w8="AI_NoTranscriptGeneratedError",y8=`vercel.ai.error.${w8}`,x8=Symbol.for(y8),v8;v8=x8;var b8="AI_NoVideoGeneratedError",S8=`vercel.ai.error.${b8}`,I8=Symbol.for(S8),C8;C8=I8;var k8="AI_NoSuchToolError",T8=`vercel.ai.error.${k8}`,L8=Symbol.for(T8),E8;E8=L8;var M8="AI_ToolCallRepairError",A8=`vercel.ai.error.${M8}`,R8=Symbol.for(A8),D8;D8=R8;var b_="AI_UIMessageStreamError",S_=`vercel.ai.error.${b_}`,_8=Symbol.for(S_),I_,Pl=class extends Fe{constructor({chunkType:e,chunkId:t,message:a}){super({name:b_,message:a}),this[I_]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Fe.hasMarker(e,S_)}};I_=_8;var O8="AI_InvalidDataContentError",P8=`vercel.ai.error.${O8}`,N8=Symbol.for(P8),B8;B8=N8;var U8="AI_InvalidMessageRoleError",F8=`vercel.ai.error.${U8}`,z8=Symbol.for(F8),q8;q8=z8;var H8="AI_MessageConversionError",j8=`vercel.ai.error.${H8}`,V8=Symbol.for(j8),W8;W8=V8;var G8="AI_RetryError",$8=`vercel.ai.error.${G8}`,X8=Symbol.for($8),K8;K8=X8;var Y8="6.0.141",Z8=async({url:e,maxBytes:t,abortSignal:a})=>{var n;let r=e.toString();Jx(r);try{let o=await fetch(r,{headers:Tp({},`ai-sdk/${Y8}`,d_()),signal:a});if(o.redirected&&Jx(o.url),!o.ok)throw new dn({url:r,statusCode:o.status,statusText:o.statusText});return{data:await s_({response:o,url:r,maxBytes:t??Qx}),mediaType:(n=o.headers.get("content-type"))!=null?n:void 0}}catch(o){throw dn.isInstance(o)?o:new dn({url:r,cause:o})}};var C_=g.union([g.string(),g.instanceof(Uint8Array),g.instanceof(ArrayBuffer),g.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 Xu=g.lazy(()=>g.union([g.null(),g.string(),g.number(),g.boolean(),g.record(g.string(),Xu.optional()),g.array(Xu)])),te=g.record(g.string(),g.record(g.string(),Xu.optional())),k_=g.object({type:g.literal("text"),text:g.string(),providerOptions:te.optional()}),Q8=g.object({type:g.literal("image"),image:g.union([C_,g.instanceof(URL)]),mediaType:g.string().optional(),providerOptions:te.optional()}),T_=g.object({type:g.literal("file"),data:g.union([C_,g.instanceof(URL)]),filename:g.string().optional(),mediaType:g.string(),providerOptions:te.optional()}),J8=g.object({type:g.literal("reasoning"),text:g.string(),providerOptions:te.optional()}),eV=g.object({type:g.literal("tool-call"),toolCallId:g.string(),toolName:g.string(),input:g.unknown(),providerOptions:te.optional(),providerExecuted:g.boolean().optional()}),tV=g.discriminatedUnion("type",[g.object({type:g.literal("text"),value:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("json"),value:Xu,providerOptions:te.optional()}),g.object({type:g.literal("execution-denied"),reason:g.string().optional(),providerOptions:te.optional()}),g.object({type:g.literal("error-text"),value:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("error-json"),value:Xu,providerOptions:te.optional()}),g.object({type:g.literal("content"),value:g.array(g.union([g.object({type:g.literal("text"),text:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("media"),data:g.string(),mediaType:g.string()}),g.object({type:g.literal("file-data"),data:g.string(),mediaType:g.string(),filename:g.string().optional(),providerOptions:te.optional()}),g.object({type:g.literal("file-url"),url:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("file-id"),fileId:g.union([g.string(),g.record(g.string(),g.string())]),providerOptions:te.optional()}),g.object({type:g.literal("image-data"),data:g.string(),mediaType:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("image-url"),url:g.string(),providerOptions:te.optional()}),g.object({type:g.literal("image-file-id"),fileId:g.union([g.string(),g.record(g.string(),g.string())]),providerOptions:te.optional()}),g.object({type:g.literal("custom"),providerOptions:te.optional()})]))})]),L_=g.object({type:g.literal("tool-result"),toolCallId:g.string(),toolName:g.string(),output:tV,providerOptions:te.optional()}),aV=g.object({type:g.literal("tool-approval-request"),approvalId:g.string(),toolCallId:g.string()}),nV=g.object({type:g.literal("tool-approval-response"),approvalId:g.string(),approved:g.boolean(),reason:g.string().optional()}),rV=g.object({role:g.literal("system"),content:g.string(),providerOptions:te.optional()}),oV=g.object({role:g.literal("user"),content:g.union([g.string(),g.array(g.union([k_,Q8,T_]))]),providerOptions:te.optional()}),iV=g.object({role:g.literal("assistant"),content:g.union([g.string(),g.array(g.union([k_,T_,J8,eV,L_,aV]))]),providerOptions:te.optional()}),lV=g.object({role:g.literal("tool"),content:g.array(g.union([L_,nV])),providerOptions:te.optional()}),Xle=g.union([rV,oV,iV,lV]);function E_(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let a={...e};for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n];if(r===void 0)continue;let o=n in e?e[n]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),l=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);i&&l?a[n]=E_(o,r):a[n]=r}return a}var sV={};_j(sV,{array:()=>fV,choice:()=>pV,json:()=>mV,object:()=>dV,text:()=>cV});function uV(e){let t=["ROOT"],a=-1,n=null;function r(s,u,c){switch(s){case'"':{a=u,t.pop(),t.push(c),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=u,n=u,t.pop(),t.push(c),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=u,t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"{":{a=u,t.pop(),t.push(c),t.push("INSIDE_OBJECT_START");break}case"[":{a=u,t.pop(),t.push(c),t.push("INSIDE_ARRAY_START");break}}}function o(s,u){switch(s){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=u,t.pop();break}}}function i(s,u){switch(s){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=u,t.pop();break}}}for(let s=0;s<e.length;s++){let u=e[s];switch(t[t.length-1]){case"ROOT":r(u,s,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{a=s,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{u===":"&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(u,s,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(u,s);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),a=s;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:a=s}break}case"INSIDE_ARRAY_START":{u==="]"?(a=s,t.pop()):(a=s,r(u,s,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=s,t.pop();break}default:{a=s;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(u,s,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),a=s;break}case"INSIDE_NUMBER":{switch(u){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=s;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,s);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(u,s);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{let d=e.substring(n,s+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(u,s):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,s)):a=s;break}}}let l=e.slice(0,a+1);for(let s=t.length-1;s>=0;s--)switch(t[s]){case"INSIDE_STRING":{l+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{l+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{l+="]";break}case"INSIDE_LITERAL":{let c=e.substring(n,e.length);"true".startsWith(c)?l+="true".slice(c.length):"false".startsWith(c)?l+="false".slice(c.length):"null".startsWith(c)&&(l+="null".slice(c.length))}}return l}async function Ku(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await Ir({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await Ir({text:uV(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var cV=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),dV=({schema:e,name:t,description:a})=>{let n=Mp(e);return{name:"object",responseFormat:Hn(n.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){let i=await Ir({text:r});if(!i.success)throw new po({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let l=await Ol({value:i.value,schema:n});if(!l.success)throw new po({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});return l.value},async parsePartialOutput({text:r}){let o=await Ku(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},fV=({element:e,name:t,description:a})=>{let n=Mp(e);return{name:"array",responseFormat:Hn(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 Ir({text:r});if(!i.success)throw new po({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});let l=i.value;if(l==null||typeof l!="object"||!("elements"in l)||!Array.isArray(l.elements))throw new po({message:"No object generated: response did not match schema.",cause:new qn({value:l,cause:"response must be an object with an elements array"}),text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});for(let s of l.elements){let u=await Ol({value:s,schema:n});if(!u.success)throw new po({message:"No object generated: response did not match schema.",cause:u.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason})}return l.elements},async parsePartialOutput({text:r}){let o=await Ku(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let i=o.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;let l=o.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,s=[];for(let u of l){let c=await Ol({value:u,schema:n});c.success&&s.push(c.value)}return{partial:s}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:o},i){if(o!=null)for(;r<o.length;r++)i.enqueue(o[r])}})}}},pV=({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 Ir({text:n});if(!o.success)throw new po({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 po({message:"No object generated: response did not match schema.",cause:new qn({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 Ku(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let o=r.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;let i=e.filter(l=>l.startsWith(o.result));return r.state==="successful-parse"?i.includes(o.result)?{partial:o.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),mV=({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 Ir({text:a});if(!r.success)throw new po({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 Ku(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 Qle=Sr({prefix:"aitxt",size:24});var ese=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 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)}
|
|
134
132
|
|
|
135
133
|
`)},flush(e){e.enqueue(`data: [DONE]
|
|
136
134
|
|
|
137
|
-
`)}})}};var av=Lp(()=>$u(g.union([g.strictObject({type:g.literal("text-start"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("text-delta"),id:g.string(),delta:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("text-end"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("error"),errorText:g.string()}),g.strictObject({type:g.literal("tool-input-start"),toolCallId:g.string(),toolName:g.string(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),title:g.string().optional()}),g.strictObject({type:g.literal("tool-input-delta"),toolCallId:g.string(),inputTextDelta:g.string()}),g.strictObject({type:g.literal("tool-input-available"),toolCallId:g.string(),toolName:g.string(),input:g.unknown(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),title:g.string().optional()}),g.strictObject({type:g.literal("tool-input-error"),toolCallId:g.string(),toolName:g.string(),input:g.unknown(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),errorText:g.string(),title:g.string().optional()}),g.strictObject({type:g.literal("tool-approval-request"),approvalId:g.string(),toolCallId:g.string()}),g.strictObject({type:g.literal("tool-output-available"),toolCallId:g.string(),output:g.unknown(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional(),preliminary:g.boolean().optional()}),g.strictObject({type:g.literal("tool-output-error"),toolCallId:g.string(),errorText:g.string(),providerExecuted:g.boolean().optional(),providerMetadata:te.optional(),dynamic:g.boolean().optional()}),g.strictObject({type:g.literal("tool-output-denied"),toolCallId:g.string()}),g.strictObject({type:g.literal("reasoning-start"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("reasoning-delta"),id:g.string(),delta:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("reasoning-end"),id:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("source-url"),sourceId:g.string(),url:g.string(),title:g.string().optional(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("source-document"),sourceId:g.string(),mediaType:g.string(),title:g.string(),filename:g.string().optional(),providerMetadata:te.optional()}),g.strictObject({type:g.literal("file"),url:g.string(),mediaType:g.string(),providerMetadata:te.optional()}),g.strictObject({type:g.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:g.string().optional(),data:g.unknown(),transient:g.boolean().optional()}),g.strictObject({type:g.literal("start-step")}),g.strictObject({type:g.literal("finish-step")}),g.strictObject({type:g.literal("start"),messageId:g.string().optional(),messageMetadata:g.unknown().optional()}),g.strictObject({type:g.literal("finish"),finishReason:g.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:g.unknown().optional()}),g.strictObject({type:g.literal("abort"),reason:g.string().optional()}),g.strictObject({type:g.literal("message-metadata"),messageMetadata:g.unknown()})])));function hV(e){return e.type.startsWith("data-")}function tv(e){return e.type.startsWith("tool-")}function gV(e){return e.type==="dynamic-tool"}function Rp(e){return tv(e)||gV(e)}function w_(e){return e.type.split("-").slice(1).join("-")}function wV({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function yV({stream:e,messageMetadataSchema:t,dataPartSchemas:a,runUpdateMessageJob:n,onError:r,onToolCall:o,onData:i}){return e.pipeThrough(new TransformStream({async transform(l,s){await n(async({state:u,write:c})=>{var d,f,p,m;function x(h){let T=u.message.parts.filter(Rp).find(C=>C.toolCallId===h);if(T==null)throw new Pl({chunkType:"tool-invocation",chunkId:h,message:`No tool invocation found for tool call ID "${h}".`});return T}function S(h){var b;let T=u.message.parts.find(D=>tv(D)&&D.toolCallId===h.toolCallId),C=h,M=T;if(T!=null){T.state=h.state,M.input=C.input,M.output=C.output,M.errorText=C.errorText,M.rawInput=C.rawInput,M.preliminary=C.preliminary,h.title!==void 0&&(M.title=h.title),M.providerExecuted=(b=C.providerExecuted)!=null?b:T.providerExecuted;let D=C.providerMetadata;if(D!=null)if(h.state==="output-available"||h.state==="output-error"){let P=T;P.resultProviderMetadata=D}else T.callProviderMetadata=D}else u.message.parts.push({type:`tool-${h.toolName}`,toolCallId:h.toolCallId,state:h.state,title:h.title,input:C.input,output:C.output,rawInput:C.rawInput,errorText:C.errorText,providerExecuted:C.providerExecuted,preliminary:C.preliminary,...C.providerMetadata!=null&&(h.state==="output-available"||h.state==="output-error")?{resultProviderMetadata:C.providerMetadata}:{},...C.providerMetadata!=null&&!(h.state==="output-available"||h.state==="output-error")?{callProviderMetadata:C.providerMetadata}:{}})}function w(h){var b,T;let C=u.message.parts.find(P=>P.type==="dynamic-tool"&&P.toolCallId===h.toolCallId),M=h,D=C;if(C!=null){C.state=h.state,D.toolName=h.toolName,D.input=M.input,D.output=M.output,D.errorText=M.errorText,D.rawInput=(b=M.rawInput)!=null?b:D.rawInput,D.preliminary=M.preliminary,h.title!==void 0&&(D.title=h.title),D.providerExecuted=(T=M.providerExecuted)!=null?T:C.providerExecuted;let P=M.providerMetadata;if(P!=null)if(h.state==="output-available"||h.state==="output-error"){let L=C;L.resultProviderMetadata=P}else C.callProviderMetadata=P}else u.message.parts.push({type:"dynamic-tool",toolName:h.toolName,toolCallId:h.toolCallId,state:h.state,input:M.input,output:M.output,errorText:M.errorText,preliminary:M.preliminary,providerExecuted:M.providerExecuted,title:h.title,...M.providerMetadata!=null&&(h.state==="output-available"||h.state==="output-error")?{resultProviderMetadata:M.providerMetadata}:{},...M.providerMetadata!=null&&!(h.state==="output-available"||h.state==="output-error")?{callProviderMetadata:M.providerMetadata}:{}})}async function y(h){if(h!=null){let b=u.message.metadata!=null?E_(u.message.metadata,h):h;t!=null&&await Ap({value:b,schema:t,context:{field:"message.metadata",entityId:u.message.id}}),u.message.metadata=b}}switch(l.type){case"text-start":{let h={type:"text",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeTextParts[l.id]=h,u.message.parts.push(h),c();break}case"text-delta":{let h=u.activeTextParts[l.id];if(h==null)throw new Pl({chunkType:"text-delta",chunkId:l.id,message:`Received text-delta for missing text part with ID "${l.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});h.text+=l.delta,h.providerMetadata=(d=l.providerMetadata)!=null?d:h.providerMetadata,c();break}case"text-end":{let h=u.activeTextParts[l.id];if(h==null)throw new Pl({chunkType:"text-end",chunkId:l.id,message:`Received text-end for missing text part with ID "${l.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});h.state="done",h.providerMetadata=(f=l.providerMetadata)!=null?f:h.providerMetadata,delete u.activeTextParts[l.id],c();break}case"reasoning-start":{let h={type:"reasoning",text:"",providerMetadata:l.providerMetadata,state:"streaming"};u.activeReasoningParts[l.id]=h,u.message.parts.push(h),c();break}case"reasoning-delta":{let h=u.activeReasoningParts[l.id];if(h==null)throw new Pl({chunkType:"reasoning-delta",chunkId:l.id,message:`Received reasoning-delta for missing reasoning part with ID "${l.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});h.text+=l.delta,h.providerMetadata=(p=l.providerMetadata)!=null?p:h.providerMetadata,c();break}case"reasoning-end":{let h=u.activeReasoningParts[l.id];if(h==null)throw new Pl({chunkType:"reasoning-end",chunkId:l.id,message:`Received reasoning-end for missing reasoning part with ID "${l.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});h.providerMetadata=(m=l.providerMetadata)!=null?m:h.providerMetadata,h.state="done",delete u.activeReasoningParts[l.id],c();break}case"file":{u.message.parts.push({type:"file",mediaType:l.mediaType,url:l.url,...l.providerMetadata!=null?{providerMetadata:l.providerMetadata}:{}}),c();break}case"source-url":{u.message.parts.push({type:"source-url",sourceId:l.sourceId,url:l.url,title:l.title,providerMetadata:l.providerMetadata}),c();break}case"source-document":{u.message.parts.push({type:"source-document",sourceId:l.sourceId,mediaType:l.mediaType,title:l.title,filename:l.filename,providerMetadata:l.providerMetadata}),c();break}case"tool-input-start":{let h=u.message.parts.filter(tv);u.partialToolCalls[l.toolCallId]={text:"",toolName:l.toolName,index:h.length,dynamic:l.dynamic,title:l.title},l.dynamic?w({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted,title:l.title,providerMetadata:l.providerMetadata}):S({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted,title:l.title,providerMetadata:l.providerMetadata}),c();break}case"tool-input-delta":{let h=u.partialToolCalls[l.toolCallId];if(h==null)throw new Pl({chunkType:"tool-input-delta",chunkId:l.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${l.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});h.text+=l.inputTextDelta;let{value:b}=await Ku(h.text);h.dynamic?w({toolCallId:l.toolCallId,toolName:h.toolName,state:"input-streaming",input:b,title:h.title}):S({toolCallId:l.toolCallId,toolName:h.toolName,state:"input-streaming",input:b,title:h.title}),c();break}case"tool-input-available":{l.dynamic?w({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:l.title}):S({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:l.title}),c(),o&&!l.providerExecuted&&await o({toolCall:l});break}case"tool-input-error":{let h=u.message.parts.filter(Rp).find(T=>T.toolCallId===l.toolCallId);(h!=null?h.type==="dynamic-tool":!!l.dynamic)?w({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}):S({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:void 0,rawInput:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}),c();break}case"tool-approval-request":{let h=x(l.toolCallId);h.state="approval-requested",h.approval={id:l.approvalId},c();break}case"tool-output-denied":{let h=x(l.toolCallId);h.state="output-denied",c();break}case"tool-output-available":{let h=x(l.toolCallId);h.type==="dynamic-tool"?w({toolCallId:l.toolCallId,toolName:h.toolName,state:"output-available",input:h.input,output:l.output,preliminary:l.preliminary,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:h.title}):S({toolCallId:l.toolCallId,toolName:w_(h),state:"output-available",input:h.input,output:l.output,providerExecuted:l.providerExecuted,preliminary:l.preliminary,providerMetadata:l.providerMetadata,title:h.title}),c();break}case"tool-output-error":{let h=x(l.toolCallId);h.type==="dynamic-tool"?w({toolCallId:l.toolCallId,toolName:h.toolName,state:"output-error",input:h.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:h.title}):S({toolCallId:l.toolCallId,toolName:w_(h),state:"output-error",input:h.input,rawInput:h.rawInput,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata,title:h.title}),c();break}case"start-step":{u.message.parts.push({type:"step-start"});break}case"finish-step":{u.activeTextParts={},u.activeReasoningParts={};break}case"start":{l.messageId!=null&&(u.message.id=l.messageId),await y(l.messageMetadata),(l.messageId!=null||l.messageMetadata!=null)&&c();break}case"finish":{l.finishReason!=null&&(u.finishReason=l.finishReason),await y(l.messageMetadata),l.messageMetadata!=null&&c();break}case"message-metadata":{await y(l.messageMetadata),l.messageMetadata!=null&&c();break}case"error":{r?.(new Error(l.errorText));break}default:if(hV(l)){if(a?.[l.type]!=null){let T=u.message.parts.findIndex(M=>"id"in M&&"data"in M&&M.id===l.id&&M.type===l.type),C=T>=0?T:u.message.parts.length;await Ap({value:l.data,schema:a[l.type],context:{field:`message.parts[${C}].data`,entityName:l.type,entityId:l.id}})}let h=l;if(h.transient){i?.(h);break}let b=h.id!=null?u.message.parts.find(T=>h.type===T.type&&h.id===T.id):void 0;b!=null?b.data=h.data:u.message.parts.push(h),i?.(h),c()}}s.enqueue(l)})}}))}async function xV({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 rse=Sr({prefix:"aitxt",size:24});var lse=Lp(()=>$u(g.array(g.object({id:g.string(),role:g.enum(["system","user","assistant"]),metadata:g.unknown().optional(),parts:g.array(g.union([g.object({type:g.literal("text"),text:g.string(),state:g.enum(["streaming","done"]).optional(),providerMetadata:te.optional()}),g.object({type:g.literal("reasoning"),text:g.string(),state:g.enum(["streaming","done"]).optional(),providerMetadata:te.optional()}),g.object({type:g.literal("source-url"),sourceId:g.string(),url:g.string(),title:g.string().optional(),providerMetadata:te.optional()}),g.object({type:g.literal("source-document"),sourceId:g.string(),mediaType:g.string(),title:g.string(),filename:g.string().optional(),providerMetadata:te.optional()}),g.object({type:g.literal("file"),mediaType:g.string(),filename:g.string().optional(),url:g.string(),providerMetadata:te.optional()}),g.object({type:g.literal("step-start")}),g.object({type:g.string().startsWith("data-"),id:g.string().optional(),data:g.unknown()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("input-streaming"),input:g.unknown().optional(),providerExecuted:g.boolean().optional(),callProviderMetadata:te.optional(),output:g.never().optional(),errorText:g.never().optional(),approval:g.never().optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("input-available"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.never().optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("approval-requested"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.never().optional(),reason:g.never().optional()})}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("approval-responded"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.boolean(),reason:g.string().optional()})}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("output-available"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.unknown(),errorText:g.never().optional(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),preliminary:g.boolean().optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("output-error"),input:g.unknown(),rawInput:g.unknown().optional(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.string(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.literal("dynamic-tool"),toolName:g.string(),toolCallId:g.string(),state:g.literal("output-denied"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!1),reason:g.string().optional()})}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("input-streaming"),providerExecuted:g.boolean().optional(),callProviderMetadata:te.optional(),input:g.unknown().optional(),output:g.never().optional(),errorText:g.never().optional(),approval:g.never().optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("input-available"),providerExecuted:g.boolean().optional(),input:g.unknown(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.never().optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("approval-requested"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.never().optional(),reason:g.never().optional()})}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("approval-responded"),input:g.unknown(),providerExecuted:g.boolean().optional(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.boolean(),reason:g.string().optional()})}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("output-available"),providerExecuted:g.boolean().optional(),input:g.unknown(),output:g.unknown(),errorText:g.never().optional(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),preliminary:g.boolean().optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("output-error"),providerExecuted:g.boolean().optional(),input:g.unknown(),rawInput:g.unknown().optional(),output:g.never().optional(),errorText:g.string(),callProviderMetadata:te.optional(),resultProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!0),reason:g.string().optional()}).optional()}),g.object({type:g.string().startsWith("tool-"),toolCallId:g.string(),state:g.literal("output-denied"),providerExecuted:g.boolean().optional(),input:g.unknown(),output:g.never().optional(),errorText:g.never().optional(),callProviderMetadata:te.optional(),approval:g.object({id:g.string(),approved:g.literal(!1),reason:g.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var use=Sr({prefix:"aiobj",size:24});function M_(e){return({url:t,abortSignal:a})=>Z8({url:t,maxBytes:e?.maxBytes,abortSignal:a})}var vV=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 dse=Sr({prefix:"aiobj",size:24});var fse=M_();var bV="AI_NoSuchProviderError",SV=`vercel.ai.error.${bV}`,IV=Symbol.for(SV),CV;CV=IV;var pse=M_();async function kV(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{let{name:a,type:n}=t,r=await new Promise((o,i)=>{let l=new FileReader;l.onload=s=>{var u;o((u=s.target)==null?void 0:u.result)},l.onerror=s=>i(s),l.readAsDataURL(t)});return{type:"file",mediaType:n,filename:a,url:r}}))}var TV=class{constructor({api:e="/api/chat",credentials:t,headers:a,body:n,fetch:r,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:i}){this.api=e,this.credentials=t,this.headers=a,this.body=n,this.fetch=r,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:e,...t}){var a,n,r,o,i;let l=await Hn(this.body),s=await Hn(this.headers),u=await Hn(this.credentials),c={...fo(s),...fo(t.headers)},d=await((a=this.prepareSendMessagesRequest)==null?void 0:a.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...l,...t.body},headers:c,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),f=(n=d?.api)!=null?n:this.api,p=d?.headers!==void 0?fo(d.headers):c,m=d?.body!==void 0?d.body:{...l,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},x=(r=d?.credentials)!=null?r:u,w=await((o=this.fetch)!=null?o:globalThis.fetch)(f,{method:"POST",headers:{"Content-Type":"application/json",...p},body:JSON.stringify(m),credentials:x,signal:e});if(!w.ok)throw new Error((i=await w.text())!=null?i:"Failed to fetch the chat response.");if(!w.body)throw new Error("The response body is empty.");return this.processResponseStream(w.body)}async reconnectToStream(e){var t,a,n,r,o;let i=await Hn(this.body),l=await Hn(this.headers),s=await Hn(this.credentials),u={...fo(l),...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:s,requestMetadata:e.metadata})),d=(a=c?.api)!=null?a:`${this.api}/${e.chatId}/stream`,f=c?.headers!==void 0?fo(c.headers):u,p=(n=c?.credentials)!=null?n:s,x=await((r=this.fetch)!=null?r:globalThis.fetch)(d,{method:"GET",headers:f,credentials:p});if(x.status===204)return null;if(!x.ok)throw new Error((o=await x.text())!=null?o:"Failed to fetch the chat response.");if(!x.body)throw new Error("The response body is empty.");return this.processResponseStream(x.body)}},nv=class extends TV{constructor(e={}){super(e)}processResponseStream(e){return g_({stream:e,schema:av}).pipeThrough(new TransformStream({async transform(t,a){if(!t.success)throw t.error;a.enqueue(t.value)}}))}},A_=class{constructor({generateId:e=c_,id:t=e(),transport:a=new nv,messageMetadataSchema:n,dataPartSchemas:r,state:o,onError:i,onToolCall:l,onFinish:s,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new vV,this.sendMessage=async(d,f)=>{var p,m,x,S;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(p=this.lastMessage)==null?void 0:p.id,...f});return}let w;if("text"in d||"files"in d?w={parts:[...Array.isArray(d.files)?d.files:await kV(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:w=d,d.messageId!=null){let y=this.state.messages.findIndex(h=>h.id===d.messageId);if(y===-1)throw new Error(`message with id ${d.messageId} not found`);if(this.state.messages[y].role!=="user")throw new Error(`message with id ${d.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,y+1),this.state.replaceMessage(y,{...w,id:d.messageId,role:(m=w.role)!=null?m:"user",metadata:d.metadata})}else this.state.pushMessage({...w,id:(x=w.id)!=null?x:this.generateId(),role:(S=w.role)!=null?S:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,...f})},this.regenerate=async({messageId:d,...f}={})=>{let p=d==null?this.state.messages.length-1:this.state.messages.findIndex(m=>m.id===d);if(p===-1)throw new Error(`message ${d} not found`);this.state.messages=this.state.messages.slice(0,this.messages[p].role==="assistant"?p:p+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,...f})},this.resumeStream=async(d={})=>{await this.makeRequest({trigger:"resume-stream",...d})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:d,approved:f,reason:p,options:m})=>this.jobExecutor.run(async()=>{let x=this.state.messages,S=x[x.length-1],w=y=>Rp(y)&&y.state==="approval-requested"&&y.approval.id===d?{...y,state:"approval-responded",approval:{id:d,approved:f,reason:p}}:y;this.state.replaceMessage(x.length-1,{...S,parts:S.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(y=>{var h;y&&this.makeRequest({trigger:"submit-message",messageId:(h=this.lastMessage)==null?void 0:h.id,...m})})}),this.addToolOutput=async({state:d="output-available",toolCallId:f,output:p,errorText:m,options:x})=>this.jobExecutor.run(async()=>{let S=this.state.messages,w=S[S.length-1],y=h=>Rp(h)&&h.toolCallId===f?{...h,state:d,output:p,errorText:m}:h;this.state.replaceMessage(S.length-1,{...w,parts:w.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(h=>{var b;h&&this.makeRequest({trigger:"submit-message",messageId:(b=this.lastMessage)==null?void 0:b.id,...x})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var d;this.status!=="streaming"&&this.status!=="submitted"||(d=this.activeResponse)!=null&&d.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=a,this.generateId=e,this.messageMetadataSchema=n,this.dataPartSchemas=r,this.state=o,this.onError=i,this.onToolCall=l,this.onFinish=s,this.onData=u,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:a,body:n,messageId:r}){var o,i,l;let s;if(e==="resume-stream")try{let p=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:a,body:n});if(p==null)return;s=p}catch(p){this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p});return}this.setStatus({status:"submitted",error:void 0});let u=this.lastMessage,c=!1,d=!1,f=!1;try{let p={state:wV({lastMessage:this.state.snapshot(u),messageId:this.generateId()}),abortController:new AbortController};p.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=p;let m;e==="resume-stream"?m=s:m=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:p.abortController.signal,metadata:t,headers:a,body:n,trigger:e,messageId:r});let x=S=>this.jobExecutor.run(()=>S({state:p.state,write:()=>{var w;this.setStatus({status:"streaming"}),p.state.message.id===((w=this.lastMessage)==null?void 0:w.id)?this.state.replaceMessage(this.state.messages.length-1,p.state.message):this.state.pushMessage(p.state.message)}}));await xV({stream:yV({stream:m,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:x,onError:S=>{throw S}}),onError:S=>{throw S}}),this.setStatus({status:"ready"})}catch(p){if(c||p.name==="AbortError")return c=!0,this.setStatus({status:"ready"}),null;f=!0,p instanceof TypeError&&(p.message.toLowerCase().includes("fetch")||p.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p})}finally{try{(i=this.onFinish)==null||i.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:d,isError:f,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(p){console.error(p)}this.activeResponse=void 0}!f&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(l=this.lastMessage)==null?void 0:l.id,metadata:t,headers:a,body:n})}};var P_=z(D_(),1);var Ju=z(he(),1);var Op=z(he(),1);var O_=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},gt=(e,t,a)=>(O_(e,t,"read from private field"),a?a.call(e):t.get(e)),jn=(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)},mo=(e,t,a,n)=>(O_(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);function EV(e,t){return t!=null?(0,P_.default)(e,t):e}var fn,Dp,_p,Yu,Zu,Qu,Nl,rv,ov,MV=class{constructor(e=[]){jn(this,fn,void 0),jn(this,Dp,"ready"),jn(this,_p,void 0),jn(this,Yu,new Set),jn(this,Zu,new Set),jn(this,Qu,new Set),this.pushMessage=t=>{mo(this,fn,gt(this,fn).concat(t)),gt(this,Nl).call(this)},this.popMessage=()=>{mo(this,fn,gt(this,fn).slice(0,-1)),gt(this,Nl).call(this)},this.replaceMessage=(t,a)=>{mo(this,fn,[...gt(this,fn).slice(0,t),this.snapshot(a),...gt(this,fn).slice(t+1)]),gt(this,Nl).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,a)=>{let n=a?EV(t,a):t;return gt(this,Yu).add(n),()=>{gt(this,Yu).delete(n)}},this["~registerStatusCallback"]=t=>(gt(this,Zu).add(t),()=>{gt(this,Zu).delete(t)}),this["~registerErrorCallback"]=t=>(gt(this,Qu).add(t),()=>{gt(this,Qu).delete(t)}),jn(this,Nl,()=>{gt(this,Yu).forEach(t=>t())}),jn(this,rv,()=>{gt(this,Zu).forEach(t=>t())}),jn(this,ov,()=>{gt(this,Qu).forEach(t=>t())}),mo(this,fn,e)}get status(){return gt(this,Dp)}set status(e){mo(this,Dp,e),gt(this,rv).call(this)}get error(){return gt(this,_p)}set error(e){mo(this,_p,e),gt(this,ov).call(this)}get messages(){return gt(this,fn)}set messages(e){mo(this,fn,[...e]),gt(this,Nl).call(this)}};fn=new WeakMap;Dp=new WeakMap;_p=new WeakMap;Yu=new WeakMap;Zu=new WeakMap;Qu=new WeakMap;Nl=new WeakMap;rv=new WeakMap;ov=new WeakMap;var Bl,__=class extends A_{constructor({messages:e,...t}){let a=new MV(e);super({...t,state:a}),jn(this,Bl,void 0),this["~registerMessagesCallback"]=(n,r)=>gt(this,Bl)["~registerMessagesCallback"](n,r),this["~registerStatusCallback"]=n=>gt(this,Bl)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>gt(this,Bl)["~registerErrorCallback"](n),mo(this,Bl,a)}};Bl=new WeakMap;function N_({experimental_throttle:e,resume:t=!1,...a}={}){let n=(0,pn.useRef)("chat"in a?{}:{onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});"chat"in a||(n.current={onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});let r={...a,onToolCall:f=>{var p,m;return(m=(p=n.current).onToolCall)==null?void 0:m.call(p,f)},onData:f=>{var p,m;return(m=(p=n.current).onData)==null?void 0:m.call(p,f)},onFinish:f=>{var p,m;return(m=(p=n.current).onFinish)==null?void 0:m.call(p,f)},onError:f=>{var p,m;return(m=(p=n.current).onError)==null?void 0:m.call(p,f)},sendAutomaticallyWhen:f=>{var p,m,x;return(x=(m=(p=n.current).sendAutomaticallyWhen)==null?void 0:m.call(p,f))!=null?x:!1}},o=(0,pn.useRef)("chat"in a?a.chat:new __(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new __(r));let l=(0,pn.useCallback)(f=>o.current["~registerMessagesCallback"](f,e),[e,o.current.id]),s=(0,pn.useSyncExternalStore)(l,()=>o.current.messages,()=>o.current.messages),u=(0,pn.useSyncExternalStore)(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),c=(0,pn.useSyncExternalStore)(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),d=(0,pn.useCallback)(f=>{typeof f=="function"&&(f=f(o.current.messages)),o.current.messages=f},[o]);return(0,pn.useEffect)(()=>{t&&o.current.resumeStream()},[t,o]),{id:o.current.id,messages:s,setMessages:d,sendMessage:o.current.sendMessage,regenerate:o.current.regenerate,clearError:o.current.clearError,stop:o.current.stop,error:c,resumeStream:o.current.resumeStream,status:u,addToolResult:o.current.addToolOutput,addToolOutput:o.current.addToolOutput,addToolApprovalResponse:o.current.addToolApprovalResponse}}var X=z(he(),1);var AV="/api/mcp/modules/documents",RV=2e4,DV=3e5,mn=class extends Error{constructor(a,n){super(n);re(this,"code");this.name="DocumentUploadError",this.code=a}};function B_(e,t){return Wd(e,`${AV}${t}`)}function _V(e){return B_(e,"/upload-url")}function U_(e,t){let a=new Headers(e);return new Headers(t).forEach((n,r)=>{a.set(r,n)}),a}function OV(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 PV(e){return e===403?new mn("upload_disabled","This agent does not accept document uploads."):e===413?new mn("max_file_size","That file is too large."):e===422||e===400?new mn("accept","That file type is not accepted."):new mn("upload_failed",`The upload could not be started (${e}).`)}function NV(e){return new Promise((t,a)=>{let n=new XMLHttpRequest;n.open("PUT",e.url,!0);for(let[i,l]of Object.entries(e.headers))n.setRequestHeader(i,l);n.timeout=DV;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 mn("upload_failed",`The upload was rejected (${n.status}).`))},n.onerror=()=>{o(),a(new mn("upload_failed","The upload could not be completed."))},n.ontimeout=()=>{o(),a(new mn("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 Pp(e){let t=B_(e.api,`/${e.documentId}`);if(t)try{await fetch(t,{method:"DELETE",headers:U_(e.headers,e.uploadHeaders)})}catch{}}async function F_(e){e.signal.throwIfAborted();let t=_V(e.api);if(!t)throw new mn("upload_disabled","This agent does not accept document uploads.");let a=new AbortController,n=setTimeout(()=>a.abort(),RV),r=()=>a.abort(e.signal.reason);e.signal.addEventListener("abort",r,{once:!0});let o;try{let l=U_(e.headers,e.uploadHeaders);l.set("Content-Type","application/json"),o=await fetch(t,{method:"POST",headers:l,signal:a.signal,body:JSON.stringify({filename:e.file.name,contentType:e.file.type,byteSize:e.file.size,...e.sessionId?{sessionId:e.sessionId}:{}})})}catch(l){throw e.signal.aborted?l:new mn("upload_failed","The upload could not be started.")}finally{clearTimeout(n),e.signal.removeEventListener("abort",r)}if(!o.ok)throw PV(o.status);let i=OV(await o.json().catch(()=>null));if(e.signal.throwIfAborted(),!i)throw new mn("upload_failed","The upload could not be started.");return await NV({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 BV(e){let t=e?.cause,a=t?.issues??t?.errors;if(!Array.isArray(a))return null;let n=a.find(r=>r.code==="invalid_union");if(!n?.errors)return null;for(let r of n.errors){if(!Array.isArray(r)||r.some(l=>(l.code==="invalid_value"||l.code==="invalid_literal")&&l.path?.[0]==="type"))continue;let i=r.filter(l=>l.code==="unrecognized_keys").flatMap(l=>l.keys??[]);if(i.length>0)return i}return null}var Np=class extends nv{processResponseStream(t){let a="",n=av(),r=n.validate?.bind(n);return t.pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({async transform(o,i){a+=o;let l=a.split(`
|
|
138
|
-
`);a=l.pop()??"";for(let s of l){let u=s.trim();if(!u.startsWith("data:"))continue;let c=u.slice(5).trim();if(c!=="[DONE]")try{let d=JSON.parse(c);if(!r){i.enqueue(d);continue}let f=await r(d);if(f.success){i.enqueue(f.value);continue}let p=BV(f.error);if(p?.length){let m={...d};for(let S of p)delete m[S];let x=await r(m);x.success&&i.enqueue(x.value)}}catch{}}}}))}};var z_=50,q_=1e3;function Bp(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 Up(e){if(typeof indexedDB>"u")return null;let t=null;try{return t=await jg(),await e(t)}catch{return null}finally{try{t?.close()}catch{}}}function iv(e){return new Promise((t,a)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}async function lv(e){return await Up(async a=>{let o=a.transaction(Wa,"readonly").objectStore(Wa).index(Gd),l=(await iv(o.getAll(e))??[]).filter(Bp);return l.sort((s,u)=>s.updatedAt<u.updatedAt?1:-1),l})??[]}async function Fp(e){return await Up(async a=>{let r=a.transaction(Wa,"readonly").objectStore(Wa),o=await iv(r.get(e));return Bp(o)?o:null})??null}async function sv(e){if(!Bp(e))return;let t=e.messages.length>q_?{...e,messages:e.messages.slice(e.messages.length-q_)}:e;await Up(async a=>{await new Promise((s,u)=>{let c=a.transaction(Wa,"readwrite");c.oncomplete=()=>s(),c.onerror=()=>u(c.error),c.onabort=()=>u(c.error),c.objectStore(Wa).put(t)});let n=a.transaction(Wa,"readwrite"),r=n.objectStore(Wa),o=r.index(Gd),l=(await iv(o.getAll(t.memoryUserId))??[]).filter(Bp);if(l.length>z_){l.sort((u,c)=>u.updatedAt<c.updatedAt?-1:1);let s=l.slice(0,l.length-z_);for(let u of s)r.delete(u.threadId)}return await new Promise((s,u)=>{n.oncomplete=()=>s(),n.onerror=()=>u(n.error),n.onabort=()=>u(n.error)}),null})}async function H_(e){await Up(async t=>(await new Promise((a,n)=>{let r=t.transaction(Wa,"readwrite");r.oncomplete=()=>a(),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error),r.objectStore(Wa).delete(e)}),null))}async function uv(e){return(await lv(e))[0]?.threadId??null}function j_(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 UV="x-session-id",FV=250,zV=200;function V_(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():cu()}function zp(){return new Date().toISOString()}function W_(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}async function qV(e,t){let a=ma(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 G_(e){let{api:t="/api/waniwani",headers:a,uploadHeaders:n,body:r,onMessageSent:o,onResponseReceived:i,enableThreadHistory:l=!1,activeThreadId:s,onThreadChange:u}=e,c=e.visitorId;(0,X.useEffect)(()=>Xs(c),[c]);let d=bp(),f=(0,X.useRef)(a),p=(0,X.useRef)(n),m=(0,X.useRef)(r),x=(0,X.useRef)(l);(0,X.useEffect)(()=>{x.current=l},[l]);let S=(0,X.useRef)(void 0),w=(0,X.useRef)(void 0),y=(0,X.useRef)(null),[h,b]=(0,X.useState)(void 0),T=(0,X.useRef)(h),[C,M]=(0,X.useState)(s),D=(0,X.useRef)(C),[P,L]=(0,X.useState)([]),[$,H]=(0,X.useState)(!l),F=(0,X.useRef)(void 0),W=(0,X.useRef)(void 0),V=(0,X.useRef)(void 0),N=(0,X.useRef)(void 0),R=(0,X.useRef)(0),G=(0,X.useRef)(u);(0,X.useEffect)(()=>{G.current=u},[u]);let ue=(0,X.useCallback)(O=>{D.current=O,M(O),O&&(G.current?.(O),d.emit({name:"thread.changed",sessionId:T.current,properties:{threadId:O}}))},[d]),I=(0,X.useCallback)(async()=>{if(!l)return;let O=y.current?.memoryUserId;if(!O)return;let ne=await lv(O);L(ne)},[l]),We=(0,X.useCallback)(()=>T.current,[]),Je=(0,X.useCallback)(O=>{let ne=W_(O);if(!ne||T.current===ne)return;let pe=T.current===void 0;T.current=ne,b(ne),pe&&d.emit({name:"session.started",properties:{sessionId:ne}})},[d]),v=(0,X.useCallback)(()=>{T.current=void 0,b(void 0)},[]);(0,X.useEffect)(()=>{f.current=a,p.current=n},[a,n]),(0,X.useEffect)(()=>{m.current=r},[r]),(0,X.useEffect)(()=>{let O=!1,ne=R.current;return(async()=>{try{let Ke=await Ks();if(O)return;y.current=Ke}catch{}if(!l)return;let pe=y.current?.memoryUserId;if(!pe){H(!0);return}try{let Ke=s??await uv(pe);if(O||ne!==R.current)return;if(Ke){let $t=await Fp(Ke);if(O||ne!==R.current)return;$t&&$t.memoryUserId===pe&&(D.current=$t.threadId,M($t.threadId),F.current=$t.createdAt,W.current=$t.title,$t.sessionId&&(T.current=$t.sessionId,b($t.sessionId)),Oe($t.messages))}await I()}finally{O||H(!0)}})(),()=>{O=!0}},[]);let K=(0,X.useRef)(null),ee=(0,X.useCallback)(O=>{let ne=m.current?.[O];return typeof ne=="string"?ne:void 0},[]),we=(0,X.useCallback)(()=>({api:t,token:Xd(f.current),channelId:ee("channelId"),sessionId:T.current}),[t,ee]),Ge=(0,X.useCallback)(O=>{let ne=K.current;K.current=null,ne?.report(we(),{mode:ee("mode"),outcome:O})},[we,ee]),me=(0,X.useRef)(new Np({api:t,headers:()=>({...f.current}),body:()=>{let O={...m.current??{}},ne=Object.hasOwn(O,"sessionId"),pe=W_(O.sessionId);if(pe)Je(pe),O.sessionId=pe;else if(ne)v(),delete O.sessionId;else{let Kp=We();Kp&&(O.sessionId=Kp)}li(S.current)&&(O.modelContext=S.current),w.current?.length&&(O.documents=w.current);let Ke=y.current,$t=Zt();Ke&&(O.visitorContext={timezone:Ke.timezone,language:Ke.language,languages:Ke.languages,deviceType:Ke.deviceType,referrer:Ke.referrer,visitorId:$t});let At=typeof O.visitor=="object"&&O.visitor!==null?O.visitor:{},FO=typeof At.client=="object"&&At.client!==null?At.client:{};O.visitor={...At,id:$t,client:{...FO,...Ke&&{memoryUserId:Ke.memoryUserId}}};let bv=typeof O.extra=="object"&&O.extra!==null&&!Array.isArray(O.extra)?O.extra:void 0,Sv=y.current?.memoryUserId,Iv=y.current?.language,cc={};if(Sv&&(cc.memoryUserId=Sv),Iv&&(cc.locale=Iv),(Object.keys(cc).length>0||bv)&&(O.extra={...cc,...bv??{}}),x.current)if(Object.hasOwn(O,"threadId"))typeof O.threadId=="string"&&(D.current=O.threadId);else{let dc=D.current;dc||(dc=V_(),F.current=zp(),W.current=void 0,ue(dc)),O.threadId=dc}return O},fetch:(async(O,ne)=>{let pe=K.current;pe?.mark("requestStart");try{let Ke=await fetch(O,ne);return S.current=void 0,Je(Ke.headers.get(UV)),pe?pe.instrument(Ke):Ke}finally{w.current=void 0}})})),ye=(0,X.useRef)(e.transport?.({fallback:me.current,headers:()=>f.current,body:()=>({channelId:ee("channelId"),visitor:{id:Zt()}}),needsFallback:()=>x.current||!!w.current?.length||li(S.current),onSession:Je})??me.current),le=(0,X.useRef)(null),de=(0,X.useRef)(null),Q=(0,X.useRef)({}),[Be,qe]=(0,X.useState)(0),_e=e.skipRemoteConfig===!0,ke=(0,X.useCallback)(async()=>{if(!_e)try{let O=await qV(t,f.current);Q.current=O,qe(ne=>ne+1)}catch(O){console.warn("[Waniwani] Failed to fetch tool definitions:",O instanceof Error?O.message:O)}},[t,_e]);(0,X.useEffect)(()=>{ke()},[ke]);let{messages:xe,sendMessage:Y,setMessages:Oe,status:rt,stop:ba}=N_({messages:e.initialMessages,transport:ye.current,onFinish({message:O,isAbort:ne,isDisconnect:pe,isError:Ke}){K.current?.mark("streamEnd"),Ge(ne||pe||Ke?"error":"ok"),i?.(),!ne&&!pe&&!Ke&&d.emit({name:"message.received"}),le.current&&(de.current=O)},onError(O){Ge("error"),console.warn("[Waniwani] Chat error:",O.message),d.emit({name:"chat.error",properties:{message:O.message.slice(0,zV)}}),le.current&&(le.current.reject(O),le.current=null)}}),Sa=(0,X.useRef)(xe);(0,X.useEffect)(()=>{Sa.current=xe},[xe]),(0,X.useEffect)(()=>{let O=ye.current;return O.restore?.().then(ne=>{ne.length>0&&Sa.current.length===0&&Oe(ne)}).catch(()=>{}),()=>O.dispose?.()},[]);let ra=(0,X.useCallback)(()=>{K.current=DC(Sa.current.filter(O=>O.role==="user").length+1)},[]),[pi,wo]=(0,X.useState)(!1),A=(0,X.useCallback)(async()=>{wo(!0);try{await ba();let O=T.current;if(!O)return;await fetch(ma(t,"/cancel"),{method:"POST",headers:{"Content-Type":"application/json",...f.current},body:JSON.stringify({sessionId:O})})}catch{}finally{wo(!1)}},[t,ba]),U=(0,X.useRef)(l);(0,X.useEffect)(()=>{if(!l||U.current||(U.current=!0,Sa.current.length>0))return;let O=!1,ne=R.current;return H(!1),(async()=>{try{let pe=y.current;if(!pe)try{pe=await Ks(),y.current=pe}catch{}let Ke=pe?.memoryUserId;if(!Ke||O||ne!==R.current){O||H(!0);return}let $t=s??await uv(Ke);if(O||ne!==R.current)return;if($t){let At=await Fp($t);if(O||ne!==R.current)return;At&&At.memoryUserId===Ke&&(D.current=At.threadId,M(At.threadId),F.current=At.createdAt,W.current=At.title,At.sessionId&&(T.current=At.sessionId,b(At.sessionId)),Oe(At.messages))}await I()}finally{O||H(!0)}})(),()=>{O=!0}},[l]),(0,X.useEffect)(()=>{if(rt==="ready"&&le.current&&de.current){let O=le.current,ne=de.current;le.current=null,de.current=null,O.resolve(ne)}},[rt]);let[J,oe]=(0,X.useState)(""),Ae=typeof c!="function",zt=J.length>0;(0,X.useEffect)(()=>{Ae&&zt&&ye.current.prepare?.()},[Ae,zt]);let[Wt,Ia]=(0,X.useState)([]),Vn=(0,X.useRef)([]);Vn.current=Wt;let gn=rt==="submitted"||rt==="streaming",Gt=(0,X.useCallback)(O=>{for(let ne of O)for(let pe of ne.documents??[])Pp({documentId:pe.documentId,api:t,headers:f.current,uploadHeaders:p.current})},[t]),ca=(0,X.useCallback)(()=>{Gt(Vn.current),Ia([])},[Gt]),wn=(0,X.useCallback)(O=>{let ne=Vn.current.find(pe=>pe.id===O);ne&&Gt([ne]),Ia(pe=>pe.filter(Ke=>Ke.id!==O))},[Gt]),AO=gn&&Wt.length>0,RO=(0,X.useCallback)(O=>{let ne=!!O.text?.trim(),pe=!!(O.files?.length||O.documents?.length);if(ne||pe){if(gn){if(Wt.length>0)return;Ia(Ke=>[...Ke,{id:cu(),text:O.text||"",files:O.files??[],documents:O.documents??[],modelContext:O.modelContext}]),oe("");return}ra(),S.current=O.modelContext,w.current=O.documents,Y({text:O.text||"",files:O.files,...O.documents?.length&&{metadata:{documents:O.documents}}}),o?.(O.text||""),d.emit({name:"message.sent"}),oe("")}},[Y,o,gn,Wt.length,d,ra]),DO=(0,X.useCallback)(O=>new Promise((ne,pe)=>{le.current={resolve:ne,reject:pe},ra(),Y({text:O}),o?.(O),d.emit({name:"message.sent"})}),[Y,o,d,ra]);(0,X.useEffect)(()=>{if(rt!=="ready"||pi||Wt.length===0)return;let[O,...ne]=Wt;Ia(ne),ra(),S.current=O.modelContext,w.current=O.documents,Y({text:O.text,files:O.files.length>0?O.files:void 0,...O.documents.length>0&&{metadata:{documents:O.documents}}}),o?.(O.text),d.emit({name:"message.sent"})},[rt,pi,Y,o,Wt,d,ra]);let _O=(0,X.useCallback)(()=>{ye.current.reset?.(),Oe([]),ca(),v(),oe(""),Q.current={},qe(O=>O+1),ke()},[Oe,v,ke,ca]),sc=(0,X.useCallback)(()=>{if(!x.current)return;let O=y.current?.memoryUserId,ne=D.current,pe=Sa.current;if(!(!O||!ne||pe.length===0)){if(F.current||(F.current=zp()),!W.current){let Ke=pe.find(At=>At.role==="user"),$t=Ke?Ke.parts.map(At=>"text"in At&&typeof At.text=="string"?At.text:"").join(" "):"";W.current=j_($t)}return{threadId:ne,memoryUserId:O,title:W.current,messages:pe,sessionId:T.current,createdAt:F.current,updatedAt:zp()}}},[]),yv=(0,X.useCallback)(async()=>{let O=sc();O&&(await sv(O),await I())},[sc,I]);(0,X.useEffect)(()=>{if(l&&$&&!(rt==="submitted"||rt==="streaming")&&xe.length!==0)return V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{V.current=void 0;let O=yv().finally(()=>{N.current===O&&(N.current=void 0)});N.current=O},FV),()=>{V.current&&clearTimeout(V.current)}},[l,$,xe,rt,yv]);let uc=(0,X.useCallback)(()=>{let O=N.current,ne=V.current,pe=ne?sc():void 0;return ne&&(clearTimeout(ne),V.current=void 0),(async()=>{O&&await O,pe&&(await sv(pe),await I())})()},[sc,I]),OO=(0,X.useCallback)(()=>{R.current+=1,uc(),ye.current.reset?.(),Oe([]),ca(),v(),oe("");let O=V_();return F.current=zp(),W.current=void 0,ue(O),I(),O},[Oe,v,ue,I,uc,ca]),Xp=(0,X.useCallback)(async O=>{R.current+=1;let ne=R.current;if(await uc(),ne!==R.current)return;let pe=await Fp(O);ne===R.current&&pe&&(pe.sessionId?(T.current=pe.sessionId,b(pe.sessionId)):v(),ue(pe.threadId),F.current=pe.createdAt,W.current=pe.title,Oe(pe.messages),ca(),oe(""))},[Oe,v,ue,uc,ca]),PO=(0,X.useCallback)(async O=>{if(D.current===O){R.current+=1,V.current&&(clearTimeout(V.current),V.current=void 0);let ne=N.current;ne&&await ne}await H_(O),await I(),D.current===O&&(Oe([]),ca(),v(),oe(""),D.current=void 0,M(void 0),F.current=void 0,W.current=void 0)},[Oe,v,I,ca]);(0,X.useEffect)(()=>{l&&$&&s!==void 0&&s!==D.current&&Xp(s)},[s,l,$,Xp]);let NO=(0,X.useCallback)(O=>{oe(O.target.value)},[]),xv=xe[xe.length-1],vv=xe.length>0,BO=gn&&(!vv||xv.role==="user"),UO=Q.current;return{messages:xe,status:rt,text:J,setText:oe,handleSubmit:RO,handleTextChange:NO,isLoading:gn,showLoaderBubble:BO,lastMessage:xv,hasMessages:vv,sendMessage:Y,sendMessageAndWait:DO,stop:A,reset:_O,queuedMessages:Wt,queueFull:AO,removeQueuedMessage:wn,sessionId:h,toolDefinitions:UO,refreshToolDefinitions:ke,threads:P,activeThreadId:C,isThreadHistoryReady:$,startNewThread:OO,switchThread:Xp,deleteThread:PO,keepsConversation:!!ye.current.restore}}var ui=z(he(),1);var HV=6e3;function $_(e){let{api:t,headers:a,uploadHeaders:n,sessionId:r,documentUpload:o,allowAttachments:i}=e,[l,s]=(0,ui.useState)(null),u=(0,ui.useCallback)((f,p,m)=>F_({file:f,api:t,headers:a,uploadHeaders:n,sessionId:r,signal:p,onProgress:m}),[t,a,n,r]),c=(0,ui.useCallback)(f=>{Pp({documentId:f.documentId,api:t,headers:a,uploadHeaders:n})},[t,a,n]);(0,ui.useEffect)(()=>{if(!l)return;let f=setTimeout(()=>s(null),HV);return()=>clearTimeout(f)},[l]);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:l,reportError:s}}var va=z(he(),1);function Ul(e){return e.map(t=>({id:null,text:t}))}function ci(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 Fl(e){return typeof e=="object"&&e!==null}function X_(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function jV(e){if(!Fl(e)||!("toolCallId"in e)||!("output"in e))return null;let t=e.output;if(!Fl(t)||!Fl(t._meta))return null;let a=t._meta[Bg];return!Fl(a)||!X_(a.suggestions)?null:a.suggestions}function K_(e){let t=null;for(let a of e.parts){let n=jV(a);n!==null&&(t=n)}return t}function Y_(e){for(let t of e.parts){if(!Fl(t)||t.type!=="data-suggestions")continue;let a=t.data;if(Fl(a)&&X_(a.suggestions)&&a.suggestions.length>0)return a.suggestions}return null}function VV(e){return"page"in e||"channel"in e}function WV(e){return typeof e!="object"||e===null?{}:VV(e)?{rungs:e}:{initial:e.initial}}function Z_(e){let{messages:t,status:a,suggestions:n}=e,r=n!==!1,{rungs:o,initial:i}=WV(n),l=(0,va.useMemo)(()=>({page:null,channel:Ul(i??[])}),[i]),s=o??l,u=(0,va.useMemo)(()=>r?ci({flow:null,followup:null,...s}):null,[r,s]),c=(0,va.useMemo)(()=>u?.suggestions.map(h=>h.text)??[],[u]),[d,f]=(0,va.useState)(c),[p,m]=(0,va.useState)(u?.origin??"channel"),x=(0,va.useRef)(a),S=(0,va.useCallback)(()=>{f([])},[]),w=t.length>0;(0,va.useEffect)(()=>{w||(f(c),m(u?.origin??"channel"))},[c,u,w]);let y=t[t.length-1];return(0,va.useEffect)(()=>{y?.role==="user"&&S()},[y,S]),(0,va.useEffect)(()=>{let h=x.current;if(x.current=a,h!=="streaming"||a!=="ready"||!r)return;let b=[...t].reverse().find(D=>D.role==="assistant");if(!b)return;let T=K_(b),C=Y_(b),M=ci({flow:T===null?null:Ul(T),followup:C===null?null:Ul(C),page:null,channel:null});f(M?M.suggestions.map(D=>D.text):[]),m(M?.origin??"channel")},[a,r,t]),{suggestions:d,source:p,isLoading:!1,clear:S}}function Q_(e,t){let a=t?.Authorization,n=typeof a=="string"&&a.startsWith("Bearer ")?a.slice(7):null;return ma(e,"/resource",n?{token:n}:void 0)}var GV={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 zl(e){let t={};for(let[a,n]of Object.entries(GV)){let r=e[a];if(r===void 0)continue;let o=typeof r=="number"?`${r}px`:String(r);for(let i of n)t[i]=o}return t}var Ve=z(ae(),1),ql=(0,ze.forwardRef)(function(t,a){let{locale:n,messages:r}=t;return(0,Ve.jsx)(zo,{locale:n,messages:r,children:(0,Ve.jsx)($V,{...t,ref:a})})}),$V=(0,ze.forwardRef)(function(t,a){let{t:n,ready:r}=Ie(),{appearance:o,className:i,classNames:l,allowAttachments:s=!1,documentUpload:u,welcomeMessage:c,welcome:d,placeholder:f=n.promptInput.placeholder,triggerEvent:p="triggerDemoRequest",api:m,mcp:x,debug:S=!1,readOnly:w=!1,title:y,headerActions:h,hideHeader:b=!1,enableThreadHistory:T=!1,showToolCalls:C=!0,initializing:M=!1,onScreen:D=!0,disclaimer:P}=t,L=o?.theme,$=o?.variables,H=o?.assistantBubble??!1,F=$?zl($):{},[W,V]=(0,ze.useState)(!1);(0,ze.useEffect)(()=>{if(L!=="auto"||typeof window>"u")return;let A=window.matchMedia("(prefers-color-scheme: dark)");V(A.matches);let U=()=>V(A.matches);return A.addEventListener("change",U),()=>A.removeEventListener("change",U)},[L]);let N=L==="dark"||L==="auto"&&W,R=G_({...t,api:m}),G=bp(),ue=K2({...t,api:m,sessionId:R.sessionId,onCallTool:x?.onCallTool}),I=x?.resourceEndpoint??Q_(m,t.headers),We=(0,ze.useRef)({});We.current={api:m,token:Xd(t.headers),channelId:typeof t.body?.channelId=="string"?t.body.channelId:void 0,sessionId:R.sessionId};let Je=(0,ze.useCallback)(A=>{Kd("widget",We.current,{widget:A.widget,outcome:A.outcome},A.metrics)},[]),v=ml(f,!R.text),K=$_({api:m,headers:t.headers,uploadHeaders:t.uploadHeaders,sessionId:R.sessionId,documentUpload:u,allowAttachments:s}),[ee,we]=(0,ze.useState)(null),[Ge,me]=(0,ze.useState)(null),ye=(0,ze.useRef)(null),le=(0,ze.useRef)(null),de=(0,ze.useRef)(null),Q=(0,ze.useRef)(null),[Be,qe]=(0,ze.useState)(!0),_e=(0,ze.useRef)(Be);_e.current=Be;let ke=(0,ze.useCallback)(()=>{let A=ye.current;if(!A)return;let U=A.querySelector("textarea");U&&U.focus()},[]),xe=(0,ze.useCallback)((A="smooth")=>{let U=le.current;U&&U.scrollTo({top:U.scrollHeight,behavior:A})},[]);(0,ze.useEffect)(()=>{let A=Q.current,U=le.current;if(!A||!U)return;let J=new IntersectionObserver(([oe])=>qe(oe.isIntersecting),{root:U,rootMargin:"0px 0px 200px 0px",threshold:0});return J.observe(A),()=>J.disconnect()},[]),(0,ze.useEffect)(()=>{let A=le.current;if(!A)return;let U=J=>{let Ae=(J.target instanceof Element?J.target:null)?.closest("a");Ae?.href&&G.emit({name:"link.clicked",properties:{url:Ae.href}})};return A.addEventListener("click",U),()=>A.removeEventListener("click",U)},[G]),(0,ze.useEffect)(()=>{(R.messages[R.messages.length-1]?.role==="user"||_e.current)&&xe("smooth")},[R.messages.length,R.messages[R.messages.length-1]]),(0,ze.useEffect)(()=>{xe("auto")},[xe]),(0,ze.useEffect)(()=>{if(typeof ResizeObserver>"u")return;let A=le.current,U=de.current;if(!A&&!U)return;let J=A?.scrollHeight??0,oe=A?.clientHeight??0,Ae=new ResizeObserver(()=>{let zt=le.current;if(!zt)return;let Wt=zt.scrollTop+oe>=J-5;J=zt.scrollHeight,oe=zt.clientHeight,Wt&&xe("auto")});return A&&Ae.observe(A),U&&Ae.observe(U),()=>Ae.disconnect()},[xe]);let Y=Z_({messages:R.messages,status:R.status,suggestions:t.suggestions}),Oe=(0,ze.useRef)(null);(0,ze.useEffect)(()=>{let A=Y.suggestions;!D||A.length===0||Oe.current===A||(Oe.current=A,G.emit({name:"suggestions.shown",properties:{texts:A,origin:Y.source}}))},[Y.suggestions,Y.source,G,D]);let rt=d?.suggestions,ba=(0,ze.useRef)(null);(0,ze.useEffect)(()=>{!D||R.messages.length>0||!rt?.length||ba.current===rt||(ba.current=rt,G.emit({name:"suggestions.shown",properties:{texts:rt,origin:"channel"}}))},[rt,R.messages.length,G,D]);let Sa=(0,ze.useCallback)(A=>{let U=A.content.map(J=>J.text??"").join("").trim();U&&R.handleSubmit({text:U,files:[],modelContext:A.modelContext})},[R.handleSubmit]),ra=(0,ze.useCallback)(A=>{let U=Y.suggestions.indexOf(A),J=U>=0?U:d?.suggestions?.indexOf(A)??-1,oe=U>=0?Y.source:"channel";G.emit({name:"suggestion.clicked",properties:{text:A,index:J,origin:oe}}),Y.clear(),R.handleSubmit({text:A,files:[]})},[Y.suggestions,Y.source,Y.clear,R.handleSubmit,d,G]);(0,ze.useImperativeHandle)(a,()=>({sendMessage:A=>{R.handleSubmit({text:A,files:[]}),ke()},sendMessageAndWait:A=>R.sendMessageAndWait(A),reset:R.reset,focus:ke,get messages(){return R.messages},get sessionId(){return R.sessionId}}),[R.handleSubmit,R.sendMessageAndWait,R.reset,R.messages,R.sessionId,ke]),(0,ze.useEffect)(()=>{if(!p)return;let A=U=>{let J=U.detail,oe=typeof J?.message=="string"?J.message:void 0;oe&&R.handleSubmit({text:oe,files:[]}),ke()};return window.addEventListener(p,A),()=>window.removeEventListener(p,A)},[p,R.handleSubmit,ke]);let pi=!b&&!!(y||T||R.keepsConversation||h),wo=M||!r;return(0,Ve.jsxs)("div",{ref:ye,style:{...F,maxHeight:"inherit",...ee&&Ge?{height:Ge}:{},opacity:wo?0:1,transition:"opacity 220ms ease-out"},"data-waniwani-chat":"","data-waniwani-layout":"embed","data-assistant-bubble":H?"true":void 0,"data-color-scheme":L==="auto"?"auto":void 0,...wo?{"data-waniwani-initializing":""}:{},...N?{"data-waniwani-dark":""}:{},className:q("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",L==="dark"&&"dark",i,l?.root),children:[pi&&(0,Ve.jsxs)("div",{className:q("ww-header ww:shrink-0 ww:flex ww:items-center ww:gap-2 ww:pl-4 ww:pr-3 ww:py-3 ww:border-b ww:border-border",l?.header),style:{backgroundColor:"var(--ww-color-card-header)",color:"var(--ww-color-card-header-foreground)"},children:[y&&(0,Ve.jsx)("div",{className:"ww:text-sm ww:font-semibold ww:truncate ww:flex-1 ww:min-w-0",children:y}),!y&&(0,Ve.jsx)("div",{className:"ww:flex-1"}),!T&&R.keepsConversation&&(0,Ve.jsx)(xp,{onClick:R.reset}),T&&(0,Ve.jsx)(G2,{threads:R.threads,activeThreadId:R.activeThreadId,onNewThread:R.startNewThread,onSelectThread:A=>{R.switchThread(A)},onDeleteThread:A=>{R.deleteThread(A)}}),h]}),(0,Ve.jsxs)("div",{ref:le,className:q("ww:relative ww:flex-1 ww:min-h-0",ee?"ww:overflow-hidden":"ww:overflow-y-auto"),children:[(0,Ve.jsxs)("div",{ref:de,className:q("ww:mx-auto ww:w-full ww:max-w-3xl ww:px-4 ww:py-6 ww:flex ww:flex-col ww:gap-6",ee&&"ww:!py-0"),children:[(0,Ve.jsx)(U2,{value:Je,children:(0,Ve.jsx)(j2,{messages:R.messages,status:R.status,welcomeMessage:c,welcome:d,onSuggestionSelect:ra,resourceEndpoint:I,chatSessionId:R.sessionId,isDark:N,onFollowUp:Sa,onCallTool:ue,fullscreenToolCallId:ee,debug:S,showToolCalls:C,toolDefinitions:R.toolDefinitions,messageClassNames:{message:l?.message,userBubble:l?.userBubble,assistantBubble:l?.assistantBubble},onWidgetDisplayModeChange:(A,U)=>{if(A==="fullscreen"){let J=ye.current?.getBoundingClientRect().height??0;me(J>0?J:null),we(U.toolCallId)}else me(null),we(null)}})}),(0,Ve.jsx)("div",{ref:Q,"aria-hidden":!0,style:{height:1}})]}),!Be&&!ee&&(0,Ve.jsx)("div",{className:"ww:sticky ww:bottom-2 ww:flex ww:justify-center ww:pointer-events-none",children:(0,Ve.jsx)(Bn,{type:"button",onClick:()=>xe("smooth"),size:"icon",variant:"outline",className:"ww:rounded-full ww:shadow ww:pointer-events-auto","aria-label":"Scroll to latest",children:(0,Ve.jsx)(Qs,{className:"ww:size-4"})})})]}),!w&&(0,Ve.jsxs)("div",{className:"ww:shrink-0 ww:bg-background",style:ee?{display:"none"}:void 0,children:[(0,Ve.jsx)(dl,{suggestions:Y.suggestions,isLoading:Y.isLoading,onSelect:ra}),(0,Ve.jsx)(Rk,{queuedMessages:R.queuedMessages,onRemove:R.removeQueuedMessage}),(0,Ve.jsx)("div",{className:"ww:px-4 ww:pb-2 ww:pt-2",children:(0,Ve.jsxs)("div",{className:"ww:mx-auto ww:w-full ww:max-w-3xl",children:[(0,Ve.jsxs)(hk,{onSubmit:R.handleSubmit,attachmentsEnabled:K.enabled,globalDrop:K.enabled,multiple:K.enabled,accept:K.accept,maxFileSize:K.maxFileSize,maxPdfPages:K.maxPdfPages,maxFiles:K.maxFiles,upload:K.upload,onDiscard:K.onDiscard,onError:K.reportError,className:q("ww-input ww:rounded-2xl ww:border-border ww:bg-input",l?.input),children:[(0,Ve.jsx)(bk,{enabled:K.enabled}),K.enabled&&(0,Ve.jsx)(vk,{className:"ww:px-4 ww:pt-3"}),(0,Ve.jsxs)("div",{className:"ww:flex ww:items-center ww:gap-1 ww:pl-4 ww:pr-3 ww:py-2.5",children:[K.enabled&&(0,Ve.jsx)(xk,{}),(0,Ve.jsx)(wk,{onChange:R.handleTextChange,value:R.text,placeholder:v,className:"ww:min-h-0 ww:py-1 ww:px-0"}),(0,Ve.jsx)(yk,{status:R.status,disabled:R.queueFull,onStop:R.stop})]})]}),K.error&&(0,Ve.jsx)("output",{className:"ww:block ww:pt-1.5 ww:text-center ww:text-destructive ww:text-xs",children:K.error.message}),(0,Ve.jsxs)("div",{className:"ww:pt-2 ww:pb-1 ww:flex ww:flex-nowrap ww:justify-center ww:items-center ww:gap-1.5",children:[(0,Ve.jsx)(V2,{}),(0,Ve.jsx)(Sk,{text:P})]})]})})]})]})});var rc=z(he(),1);var J_="500px",XV="https://app.waniwani.ai/api/mcp/chat",KV={api:XV};function cv(){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 qp(){let e=cv();if(!e)return{};let t=G=>e.getAttribute(G)??void 0,a=G=>{let ue=e.getAttribute(G);if(ue==null)return;let I=ue.trim().toLowerCase();if(I==="true"||I==="1"||I==="")return!0;if(I==="false"||I==="0")return!1},n={},r=t("data-api");r&&(n.api=r);let o=t("data-token");o&&(n.token=o);let i=t("data-visitor-id");i&&(n.visitorId=i);let l=t("data-title");l&&(n.title=l);let s=t("data-welcome-message");s&&(n.welcomeMessage=s);let u=t("data-placeholder");u&&(n.placeholder=u);let c=t("data-mcp-server-url");c&&(n.mcpServerUrl=c);let d=t("data-webmcp");d&&(n.webmcp={enabled:d!=="false"&&d!=="off"});let f=t("data-channel-id");if(f&&(n.channelId=f),t("data-show-tool-calls")?.trim().toLowerCase()==="titles-only")n.showToolCalls="titles-only";else{let G=a("data-show-tool-calls");G!==void 0&&(n.showToolCalls=G)}let m=t("data-css");m&&(n.css=m);let x=t("data-suggestions");x&&(n.suggestions=x.split(",").map(G=>G.trim()).filter(Boolean));let S=a("data-enable-thread-history");S!==void 0&&(n.enableThreadHistory=S);let w=a("data-disable-page-view");w!==void 0&&(n.disablePageView=w);let y=a("data-hide-header");y!==void 0&&(n.hideHeader=y);let h=t("data-theme");(h==="light"||h==="dark"||h==="auto")&&(n.appearance={...n.appearance,theme:h});let b=a("data-assistant-bubble");b!==void 0&&(n.appearance={...n.appearance,assistantBubble:b});let T=t("data-locale");(T==="en"||T==="fr"||T==="es")&&(n.locale=T);let C=t("data-mode");(C==="inline"||C==="floating"||C==="composer"||C==="off")&&(n.mode=C);let M={},D=t("data-composer-variant")?.trim().toLowerCase();(D==="glow"||D==="outline")&&(M.variant=D);let P=t("data-composer-size")?.trim().toLowerCase();(P==="sm"||P==="md"||P==="lg")&&(M.size=P);let L=a("data-composer-suggestions");L!==void 0&&(M.showSuggestions=L);let $=t("data-composer-align")?.trim().toLowerCase();($==="start"||$==="center")&&(M.align=$);let H=a("data-composer-trigger");H!==void 0&&(M.trigger=H);let F=a("data-composer-mobile-trigger");F!==void 0&&(M.mobileTrigger=F),Object.keys(M).length>0&&(n.composer=M);let W=t("data-height");W&&(n.height=W);let V=t("data-launcher-text");V&&(n.launcherText=V);let N=t("data-appear-delay");if(N!==void 0){let G=Number.parseInt(N.trim(),10);Number.isFinite(G)&&G>=0&&(n.appearDelay=G)}let R=t("data-disclaimer");if(R!==void 0){let G=R.trim(),ue=G.toLowerCase();ue==="false"||ue==="0"?n.disclaimer=!1:G&&(n.disclaimer=G)}return n}function ec(e){if(!e)return{};let t={};for(let a in e)e[a]!==void 0&&(t[a]=e[a]);return t}function tc(e,t,a){let n=a??qp(),r=YV(t,n,e),o={...t?.composer??{},...ec(n.composer),...ec(e?.composer)},i=Object.keys(o).length>0,l={token:"",...KV,...ec(t),...ec(n),...ec(e),...r?{appearance:r}:{},...i?{composer:o}:{}};if(!l.token)throw new Error("[Waniwani] Missing required config: `token`. Set data-token on the script tag or pass it to Waniwani.chat.init().");return l}function YV(e,t,a){let n=a?.appearance?.theme??t.appearance?.theme??e?.appearance?.theme,r={...e?.appearance?.variables??{},...t.appearance?.variables??{},...a?.appearance?.variables??{}},o=Object.keys(r).length>0,i=a?.appearance?.assistantBubble??t.appearance?.assistantBubble??e?.appearance?.assistantBubble;if(!n&&!o&&i===void 0)return;let l={};return n&&(l.theme=n),o&&(l.variables=r),i!==void 0&&(l.assistantBubble=i),l}var oO=z(he(),1);var Hp=z(he(),1);function ZV(e){return e?.patterns??e?.rules??[]}var eO="\0\0";function QV(e){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*\\\*/g,eO).replace(/\\\*/g,"[^/]*").split(eO).join(".*");return new RegExp(`^${a}$`)}function tO(e,t){try{return QV(e).test(t)}catch{return!1}}function ac(e,t){if(!e)return!0;let a=!1;for(let n of ZV(e))if(tO(n.glob,t)){if(n.action==="hide")return!1;a=!0}return a?!0:(e.default??"show")!=="hide"}function aO(e,t){for(let a of e?.appearRules??[])if(tO(a.glob,t))return a.appearAfter;return null}var dv="waniwani:locationchange",nO=!1;function JV(){if(!(nO||typeof history>"u")){nO=!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(dv)),r}}}}function e7(e){return JV(),window.addEventListener(dv,e),window.addEventListener("popstate",e),()=>{window.removeEventListener(dv,e),window.removeEventListener("popstate",e)}}function t7(){return window.location.pathname}function a7(){return"/"}function nc(){return(0,Hp.useSyncExternalStore)(e7,t7,a7)}function Hl(e,t){let a=nc(),n=t&&ac(e,a);return(0,Hp.useEffect)(()=>{ha("visibility gate",{pathname:a,ready:t,visible:n,rules:e})},[a,t,n]),n}var n7=3,r7=["low","medium","high"];function fv(e){if(e.length===0)return;let t=Math.floor(Math.random()*e.length),[a]=e.splice(t,1);return a}function o7(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 r7){let i=fv(t.get(o)??[])??fv(a);i&&n.push(i)}let r=[...t.values()].flat().concat(a);for(;n.length<Math.min(n7,e.length);){let o=fv(r);if(!o)break;n.push(o)}return n}function rO(e){let t;try{t=new URL(e,"http://localhost").pathname}catch{t="/"}let a=t.replace(/\/+$/,"");return(a===""?"/":a).toLowerCase()}function iO(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 jl(e){let{pageSuggestions:t,suggestions:a}=e,n=nc();return(0,oO.useMemo)(()=>{let r=rO(n),o=t?.find(l=>rO(l.url)===r),i=o?o7(o.prompts).map(({id:l,text:s})=>({id:l,text:s})):null;return ha("configured suggestions resolve",{pathname:r,matched:!!o,count:i?.length??0}),{page:i,channel:Ul(a??[])}},[n,t,a])}var i7="waniwani:config:";function lO(e,t,a){return`${i7}${e}|${t}|${a??""}`}function ho(e,t,a){if(typeof window>"u")return null;try{let n=window.sessionStorage.getItem(lO(e,t,a));if(!n)return null;let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function l7(e,t,a,n){if(!(typeof window>"u"))try{window.sessionStorage.setItem(lO(e,t,a),JSON.stringify(n))}catch{}}var s7=600;function u7(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 c7(e,t,a,n){Uo("configStart");let r=await d7(e,t,a,n);return Uo("configEnd"),a?.aborted||$g(r.metadata),r}async function d7(e,t,a,n){try{let r=ma(e,"/config",n?{channel:n}:void 0),o=await fetch(r,{method:"GET",headers:{Authorization:`Bearer ${t}`},signal:a});if(!o.ok)return{};let i=await o.json(),l=i&&typeof i=="object"&&"data"in i&&i.data?i.data:i;return l?f7(l):{}}catch{return{}}}function f7(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=iO(e.pageSuggestions);a.length>0&&(t.pageSuggestions=a),typeof e.enableThreadHistory=="boolean"&&(t.enableThreadHistory=e.enableThreadHistory),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=u7(e.documentUpload);return n&&(t.documentUpload=n),e.metadata&&typeof e.metadata=="object"&&(t.metadata=e.metadata),t}function Vl(e,t,a){let[n,r]=(0,rc.useState)(e),[o,i]=(0,rc.useState)(!1);return(0,rc.useEffect)(()=>{let l=e.api,s=e.token,u=e.channelId;if(!l||!s){i(!0);return}let c=m=>{e.disablePageView||OC({api:l,token:s,channelId:u??m.channelId,mode:e.mode==="off"?void 0:e.mode,source:m.source})},d=ho(l,s,u);if(d)try{let m=tc(t,d,a);r(m),Yd("cache"),$g(d.metadata),i(!0),ha("config resolved (sessionStorage cache)",{config:m,visibility:m.visibility}),c(d)}catch{}let f=new AbortController,p=setTimeout(()=>{Yd("timeout"),i(!0)},s7);return c7(l,s,f.signal,u).then(m=>{if(!f.signal.aborted){if(ha("remote /config response",m),Object.keys(m).length>0){l7(l,s,u,m);try{let x=tc(t,m,a);r(x),ha("config resolved (remote)",{config:x,visibility:x.visibility})}catch(x){console.error("[Waniwani] Failed to apply remote config:",x)}}Yd("remote"),i(!0),c(m)}}).catch(m=>{console.error("[Waniwani] Remote config fetch failed:",m),i(!0)}).finally(()=>clearTimeout(p)),()=>{f.abort(),clearTimeout(p)}},[e.api,e.token,e.channelId]),{config:n,ready:o}}var Et=z(ae(),1),p7={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}},sO="var(--ww-composer-bg, var(--ww-color-input))",m7="var(--ww-composer-border-color, var(--ww-color-border))",h7="var(--ww-composer-border-width, 1px)",uO="var(--ww-composer-send-bg, var(--ww-color-foreground))",cO="var(--ww-composer-send-fg, var(--ww-color-background))",fO=(0,$e.forwardRef)(function(t,a){return(0,Et.jsx)(zo,{locale:t.config.locale,children:(0,Et.jsx)(g7,{...t,ref:a})})}),g7=(0,$e.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,panelContainer:r,onVisibilityChange:o},i){let{t:l}=Ie(),{config:s,ready:u}=Vl(t,a,n),c=Hl(s.visibility,u);(0,$e.useEffect)(()=>{o?.(c)},[c,o]),Ml({api:s.api,token:s.token,channelId:s.channelId,mode:"composer",paintMark:"chatVisible",painted:u});let d=(0,$e.useRef)(null),f=(0,$e.useMemo)(()=>Dl({mode:"composer",getSessionId:()=>d.current?.sessionId}),[]),p=s.onEvent;(0,$e.useEffect)(()=>{if(p)return f.subscribe(p)},[p,f]);let m=(0,$e.useRef)(null),x=(0,$e.useRef)(null),[S,w]=(0,$e.useState)(!1),[y,h]=(0,$e.useState)(""),[b,T]=(0,$e.useState)(0),C=s.appearance?.theme,M=s.appearance?.variables,D=(0,$e.useMemo)(()=>M?zl(M):{},[M]),P=jl(s),L=(0,$e.useMemo)(()=>ci({flow:null,followup:null,...P}),[P]),$=(0,$e.useMemo)(()=>L?.suggestions.map(Y=>Y.text)??[],[L]);fl({widgetEvents:f,api:s.api,token:s.token,channelId:s.channelId,source:s.source,mode:"composer",pagePrompts:P.page,getSessionId:()=>d.current?.sessionId});let H=(0,$e.useRef)(null);(0,$e.useEffect)(()=>{!c||!L||H.current!==L&&(H.current=L,f.emit({name:"suggestions.shown",properties:{texts:$,origin:L.origin}}))},[c,L,$,f]);let F=s.composer??{},W=F.variant??"glow",V=p7[F.size??"md"],N=F.showSuggestions??!0,R=F.align==="center",G=XC(),ue=(F.trigger??!1)||G&&(F.mobileTrigger??!0),I=s.launcherText??s.placeholder??l.launcher.prompt,We=ml(I,!ue&&y.length===0),Je="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,$e.useEffect)(()=>{let Y=m.current;if(Y){if(!y){Y.style.height="";return}Y.style.height="auto",Y.style.height=`${Y.scrollHeight}px`}},[y]),(0,$e.useEffect)(()=>{b>0&&S&&d.current?.focus()},[b,S]);let v=(0,$e.useRef)(!1);(0,$e.useEffect)(()=>{u&&!v.current&&(v.current=!0,f.emit({name:"chat.ready"}))},[u,f]);let K=(0,$e.useRef)(!1);(0,$e.useEffect)(()=>{let Y=c&&S;Y!==K.current&&(K.current=Y,f.emit({name:Y?"chat.opened":"chat.closed"}))},[c,S,f]);let ee=(0,$e.useCallback)(Y=>{w(!0),T(rt=>rt+1);let Oe=Y.trim();Oe&&d.current?.sendMessage(Oe)},[]);(0,$e.useImperativeHandle)(i,()=>({open:()=>w(!0),close:()=>w(!1),toggle:()=>w(Y=>!Y),sendMessage:Y=>ee(Y),sendMessageAndWait:async Y=>{w(!0);let Oe=d.current;if(Oe)return await Oe.sendMessageAndWait(Y)},reset:()=>d.current?.reset(),focus:()=>{S?T(Y=>Y+1):(m.current??x.current)?.focus()},getMessages:()=>d.current?.messages??[],getSessionId:()=>d.current?.sessionId}),[ee,S]);let we=(0,$e.useCallback)(()=>{y.trim()&&(ee(y),h(""))},[y,ee]),Ge=(0,$e.useCallback)(()=>{(d.current?.messages.length??0)>0&&(w(!0),T(Y=>Y+1))},[]),me={mode:"composer"};s.mcpServerUrl&&(me.mcpServerUrl=s.mcpServerUrl),s.channelId&&(me.channelId=s.channelId);let ye=(0,Et.jsx)("button",{type:"button",onClick:()=>w(!1),"aria-label":l.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,Et.jsx)(Ga,{className:"ww:size-4"})}),le=(0,Et.jsxs)("div",{className:q("ww:flex ww:items-end",V.row),children:[(0,Et.jsx)("textarea",{ref:m,rows:1,value:y,placeholder:We,onChange:Y=>h(Y.target.value),onFocus:Ge,onKeyDown:Y=>{Y.key==="Enter"&&!Y.shiftKey&&(Y.preventDefault(),we())},className:q("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",V.field,!y&&"ww:overflow-hidden ww:whitespace-nowrap ww:text-ellipsis ww:placeholder:overflow-hidden ww:placeholder:text-ellipsis")}),(0,Et.jsx)("button",{type:"button",onClick:we,disabled:!y.trim(),"aria-label":l.promptInput.submit,className:q("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",V.send),style:{background:uO,color:cO},children:(0,Et.jsx)(Nn,{className:V.sendIcon})})]}),de=(0,Et.jsxs)("button",{ref:x,type:"button",onClick:()=>ee(""),className:q("ww:flex ww:w-full ww:items-center ww:text-left ww:cursor-pointer",V.row,R&&"ww:justify-center"),children:[(0,Et.jsx)("span",{className:q("ww:min-w-0 ww:flex-1 ww:truncate ww:text-muted-foreground",V.field,R&&"ww:flex-none"),children:I}),(0,Et.jsx)("span",{"aria-hidden":!0,className:q("ww:flex ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full",V.send,R&&"ww:ml-3"),style:{background:uO,color:cO},children:(0,Et.jsx)(Nn,{className:V.sendIcon})})]}),Q=ue?de:le,Be=`var(--ww-composer-radius, ${V.radius}px)`,qe={borderRadius:Be,background:sO,borderColor:m7,borderWidth:h7,borderStyle:"solid",boxShadow:`var(--ww-composer-shadow, ${Je})`},_e=W==="glow"?(0,Et.jsx)(tf,{animated:u,backgroundColor:sO,borderRadius:Be,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],style:qe,children:Q}):(0,Et.jsx)("div",{className:q(ue&&"ww:transition-colors hover:ww:border-primary/40"),style:qe,children:Q}),ke=(0,Et.jsxs)("div",{"data-waniwani-chat":"","data-color-scheme":C==="auto"?"auto":void 0,"data-waniwani-composer":"input","data-composer-variant":W,inert:S,className:q("ww:w-full ww:font-[family-name:var(--ww-font-sans)]",C==="dark"&&"dark"),style:D,children:[_e,N&&$.length>0&&(0,Et.jsx)(dl,{suggestions:$,onSelect:Y=>{f.emit({name:"suggestion.clicked",properties:{text:Y,index:$.indexOf(Y),origin:L?.origin??"channel"}}),ee(Y)},align:R?"center":"start",className:"ww:px-0.5 ww:pt-2.5 ww:pb-0"})]}),xe=(0,Et.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":C==="auto"?"auto":void 0,className:q("ww:contents ww:font-[family-name:var(--ww-font-sans)]",C==="dark"&&"dark"),style:D,children:(0,Et.jsx)("div",{role:"dialog","aria-label":s.title??I,"data-waniwani-floating":"panel","data-state":c&&S?"shown":"hidden",style:{boxShadow:Je},className:q("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,Et.jsx)(ql,{ref:d,api:s.api??"",headers:{Authorization:`Bearer ${s.token}`},skipRemoteConfig:!0,body:me,appearance:s.appearance,title:s.title,headerActions:ye,hideHeader:!1,onScreen:S,welcomeMessage:s.welcomeMessage,placeholder:s.placeholder,suggestions:P,enableThreadHistory:s.enableThreadHistory,documentUpload:s.documentUpload,showToolCalls:s.showToolCalls,locale:s.locale,initializing:!u})})});return(0,Et.jsxs)(_l,{value:f,children:[ke,(0,dO.createPortal)(xe,r)]})});var pv="/*! 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 w7(e){return e.startsWith("__WANIWANI")}function jp(e){if(!pv||w7(pv))return;let t=document.createElement("style");t.textContent=pv,e.appendChild(t)}var Ee=z(he(),1);var Vp=z(he(),1),y7=3e3,x7=120,v7=24;function pO(e){let[t,a]=(0,Vp.useState)(!1);return(0,Vp.useEffect)(()=>{if(!e||typeof document>"u"){a(!1);return}let n=!1,r=null,o=null,i=null,l=u=>{r=new IntersectionObserver(c=>{let d=c[0];d&&a(!d.isIntersecting&&d.boundingClientRect.bottom<=0)},{rootMargin:`0px 0px -${v7}px 0px`,threshold:0}),r.observe(u)},s=()=>{if(n)return;let u=null;try{u=document.querySelector(e)}catch{a(!0);return}if(u){l(u);return}o=setTimeout(s,x7)};return s(),i=setTimeout(()=>{n||r||(o&&clearTimeout(o),a(!0))},y7),()=>{n=!0,r?.disconnect(),o&&clearTimeout(o),i&&clearTimeout(i)}},[e]),t}var wt=z(ae(),1),b7=2e3,S7=90,I7=1e3,mO=(0,Ee.forwardRef)(function(t,a){return(0,wt.jsx)(zo,{locale:t.config.locale,children:(0,wt.jsx)(C7,{...t,ref:a})})}),C7=(0,Ee.forwardRef)(function({config:t,programmatic:a,scriptConfig:n},r){let{t:o}=Ie(),{config:i,ready:l}=Vl(t,a,n),s=Hl(i.visibility,l),u=nc(),c=s?aO(i.visibility,u):null,d=pO(c),f=(0,Ee.useRef)(null),p=(0,Ee.useMemo)(()=>Dl({mode:"floating",getSessionId:()=>f.current?.sessionId}),[]),m=i.onEvent;(0,Ee.useEffect)(()=>{if(m)return p.subscribe(m)},[m,p]);let x=(0,Ee.useRef)(null),S=(0,Ee.useRef)(null),w=(0,Ee.useRef)(!1),[y,h]=(0,Ee.useState)("input"),[b,T]=(0,Ee.useState)(""),[C,M]=(0,Ee.useState)(!1),[D,P]=(0,Ee.useState)(!1),[L,$]=(0,Ee.useState)(0),H=i.appearance?.theme,F=i.appearance?.variables,W=(0,Ee.useMemo)(()=>F?zl(F):{},[F]),V=jl(i),N=(0,Ee.useMemo)(()=>ci({flow:null,followup:null,...V}),[V]),R=(0,Ee.useMemo)(()=>N?.suggestions.map(Q=>Q.text)??[],[N]);fl({widgetEvents:p,api:i.api,token:i.token,channelId:i.channelId,source:i.source,mode:"floating",pagePrompts:V.page,getSessionId:()=>f.current?.sessionId});let G=(0,Ee.useRef)(null);(0,Ee.useEffect)(()=>{!D||!N||G.current!==N&&(G.current=N,p.emit({name:"suggestions.shown",properties:{texts:R,origin:N.origin}}))},[D,N,R,p]);let ue=i.launcherText??i.placeholder??o.launcher.prompt,I=ml(ue,b.length===0),We="var(--ww-shadow, 0 10px 30px rgba(0, 0, 0, 0.08))";(0,Ee.useEffect)(()=>{if(!s){M(!1);return}if(c){M(d);return}let Q=i.appearDelay??b7,Be=setTimeout(()=>M(!0),Math.max(0,Q));return()=>clearTimeout(Be)},[s,i.appearDelay,c,d]),(0,Ee.useEffect)(()=>{if(!C||R.length===0)return;let Q=setTimeout(()=>{w.current||h(Be=>Be==="input"?"expanded":Be)},I7);return()=>clearTimeout(Q)},[C,R.length]),(0,Ee.useEffect)(()=>{L>0&&y==="open"&&f.current?.focus()},[L,y]);let Je=(0,Ee.useRef)(!1);(0,Ee.useEffect)(()=>{l&&!Je.current&&(Je.current=!0,p.emit({name:"chat.ready"}))},[l,p]),Ml({api:i.api,token:i.token,channelId:i.channelId,mode:"floating",paintMark:"launcherPainted",painted:l&&s});let v=(0,Ee.useRef)(!1);(0,Ee.useEffect)(()=>{let Q=s&&y==="open";Q!==v.current&&(v.current=Q,p.emit({name:Q?"chat.opened":"chat.closed"}))},[s,y,p]);let K=(0,Ee.useCallback)(()=>{h("open")},[]),ee=(0,Ee.useCallback)(()=>{w.current=!0,h("input")},[]);(0,Ee.useEffect)(()=>{if(y!=="expanded"){P(!1);return}let Q=setTimeout(()=>P(!0),S7);return()=>clearTimeout(Q)},[y]);let we=(0,Ee.useCallback)(Q=>{K();let Be=Q.trim();Be&&f.current?.sendMessage(Be)},[K]);(0,Ee.useImperativeHandle)(r,()=>({open:()=>K(),close:()=>ee(),toggle:()=>{h(Q=>Q==="open"?"input":"open")},sendMessage:Q=>we(Q),sendMessageAndWait:async Q=>{K();let Be=f.current;if(Be)return await Be.sendMessageAndWait(Q)},reset:()=>f.current?.reset(),focus:()=>{K(),$(Q=>Q+1)},getMessages:()=>f.current?.messages??[],getSessionId:()=>f.current?.sessionId}),[we,K,ee]);let Ge=(0,Ee.useCallback)(()=>{b.trim()&&(we(b),T(""))},[b,we]),me=(0,Ee.useCallback)(()=>{(f.current?.messages.length??0)>0?(h("open"),$(Q=>Q+1)):(w.current=!1,h(Q=>Q==="input"?"expanded":Q))},[]),ye={mode:"floating"};i.mcpServerUrl&&(ye.mcpServerUrl=i.mcpServerUrl),i.channelId&&(ye.channelId=i.channelId);let le=R.length>0&&y!=="input",de=(0,wt.jsx)("button",{type:"button",onClick:ee,"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,wt.jsx)(Ga,{className:"ww:size-4"})});return(0,wt.jsx)(_l,{value:p,children:(0,wt.jsx)("div",{"data-waniwani-chat":"","data-color-scheme":H==="auto"?"auto":void 0,className:q("ww:contents ww:font-[family-name:var(--ww-font-sans)]",H==="dark"&&"dark"),style:W,children:s&&(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)("div",{ref:S,"data-waniwani-floating":"dock","data-state":y==="open"?"hidden":"shown","data-appeared":C?"true":"false",className:q("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",le?"ww:max-w-[720px]":"ww:max-w-[440px]"),children:(0,wt.jsxs)("div",{className:q("ww:relative ww:flex ww:flex-col ww:rounded-[20px] ww:border ww:transition-all ww:duration-300 ww:ease-out",le?"ww:p-2 ww:backdrop-blur-xl ww:backdrop-saturate-150":"ww:border-transparent ww:p-0"),style:le?{boxShadow:We,backgroundColor:"var(--ww-glass)",borderColor:"var(--ww-glass-border)"}:void 0,children:[le&&y!=="open"&&(0,wt.jsx)("button",{type:"button",onClick:ee,"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,wt.jsx)(Ga,{className:"ww:size-4"})}),R.length>0&&(0,wt.jsx)("div",{className:q("ww:grid ww:transition-all ww:duration-300 ww:ease-out",D?"ww:grid-rows-[1fr] ww:opacity-100":"ww:pointer-events-none ww:grid-rows-[0fr] ww:opacity-0"),children:(0,wt.jsx)("div",{className:"ww:overflow-hidden",children:(0,wt.jsx)(dl,{suggestions:R,onSelect:Q=>{p.emit({name:"suggestion.clicked",properties:{text:Q,index:R.indexOf(Q),origin:N?.origin??"channel"}}),we(Q)},className:"ww:pl-1 ww:pr-9 ww:pt-1 ww:pb-2.5"})})}),(0,wt.jsx)(tf,{animated:C,backgroundColor:"var(--ww-color-input)",borderRadius:16,edgeSensitivity:30,coneSpread:25,colors:["#c084fc","#f472b6","#38bdf8"],className:"ww:border-border",style:{boxShadow:We},children:(0,wt.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,wt.jsx)("input",{ref:x,type:"text",value:b,placeholder:I,onChange:Q=>T(Q.target.value),onFocus:me,onKeyDown:Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),Ge())},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,wt.jsx)("button",{type:"button",onClick:Ge,disabled:!b.trim(),"aria-label":o.promptInput.submit,className:"ww:relative ww:flex ww:size-8 ww:shrink-0 ww:items-center ww:justify-center ww:rounded-full ww:bg-foreground ww:text-background ww:transition-opacity hover:ww:opacity-90 disabled:ww:opacity-40",children:(0,wt.jsx)(Nn,{className:"ww:size-4"})})]})})]})}),(0,wt.jsx)("div",{role:"dialog","aria-label":i.title??ue,"data-waniwani-floating":"panel","data-state":y==="open"?"shown":"hidden",style:{boxShadow:We},className:q("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)(ql,{ref:f,api:i.api??"",headers:{Authorization:`Bearer ${i.token}`},skipRemoteConfig:!0,body:ye,appearance:i.appearance,title:i.title,headerActions:de,hideHeader:!1,onScreen:y==="open",welcomeMessage:i.welcomeMessage,placeholder:i.placeholder,suggestions:V,enableThreadHistory:i.enableThreadHistory,documentUpload:i.documentUpload,showToolCalls:i.showToolCalls,locale:i.locale,initializing:!l})})]})})})});var Oa=z(he(),1);var mv=z(ae(),1),hO=(0,Oa.forwardRef)(function({config:t,programmatic:a,scriptConfig:n,onReady:r,onVisibilityChange:o},i){let{config:l,ready:s}=Vl(t,a,n),u=(0,Oa.useRef)(null),c=(0,Oa.useMemo)(()=>Dl({mode:"inline",getSessionId:()=>u.current?.sessionId}),[]),d=l.onEvent;(0,Oa.useEffect)(()=>{if(d)return c.subscribe(d)},[d,c]);let f=(0,Oa.useRef)(!1);(0,Oa.useEffect)(()=>{s&&!f.current&&(f.current=!0,c.emit({name:"chat.ready"}))},[s,c]),(0,Oa.useEffect)(()=>{r?.()},[]);let p=Hl(l.visibility,s);(0,Oa.useEffect)(()=>{o?.(p)},[p,o]),Ml({api:l.api,token:l.token,channelId:l.channelId,mode:"inline",paintMark:"chatVisible",painted:s}),(0,Oa.useImperativeHandle)(i,()=>({get chat(){return u.current}}),[]);let m=jl(l);fl({widgetEvents:c,api:l.api,token:l.token,channelId:l.channelId,source:l.source,mode:"inline",pagePrompts:m.page,getSessionId:()=>u.current?.sessionId});let x={mode:"inline"};return l.mcpServerUrl&&(x.mcpServerUrl=l.mcpServerUrl),l.channelId&&(x.channelId=l.channelId),(0,mv.jsx)(_l,{value:c,children:(0,mv.jsx)(ql,{ref:u,api:l.api??"",headers:{Authorization:`Bearer ${l.token}`},skipRemoteConfig:!0,body:x,appearance:l.appearance,title:l.title,hideHeader:l.hideHeader,welcomeMessage:l.welcomeMessage,placeholder:l.placeholder,suggestions:m,enableThreadHistory:l.enableThreadHistory,documentUpload:l.documentUpload,showToolCalls:l.showToolCalls,locale:l.locale,initializing:!s})})});var oc=z(he(),1),SO=z(Ng(),1);function gO(){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 hv(){return gO()!==null}function k7(){return{url:location.href,title:document.title}}async function gv(e){let{endpoint:t,listEndpoint:a,headers:n,sessionId:r,visitorId:o,channelId:i,onWidget:l}=e,s=e.logger??console,u=gO();if(!u)return null;let c=new AbortController,d=()=>c.abort();window.addEventListener("pagehide",d);let f=!1,p=()=>{f||(f=!0,window.removeEventListener("pagehide",d),c.abort())};function m(){return{sessionId:r,visitorId:o,channelId:i,page:k7()}}async function x(h,b){let T=await fetch(t,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify(h),...b?{signal:b}:{}});if(!T.ok)throw new Error(`webmcp ${h.action} failed: ${T.status}`);return await T.json()}async function S(){if(a)try{let h=await fetch(a);if(h.ok)return await h.json();s.info(`[webmcp] list GET answered ${h.status}, using POST`)}catch(h){s.info("[webmcp] list GET failed, using POST",h)}return x({...m(),action:"list"})}let w=[];try{let h=await S();w=Array.isArray(h?.tools)?h.tools:[]}catch(h){return s.error("[webmcp] could not list site tools",h),p(),null}let y=[];return await Promise.all(w.map(async h=>{try{await u.registerTool({name:h.name,description:h.description??"",...h.inputSchema?{inputSchema:h.inputSchema}:{},...h.annotations?{annotations:h.annotations}:{},execute:async(b,T)=>{let C=await x({...m(),action:"call",name:h.name,arguments:b??{}},T?.signal);return C?.widget&&l?.(C.widget),{content:C?.content??[]}}},{signal:c.signal}),y.push(h)}catch(b){s.error(`[webmcp] could not register ${h.name}`,b)}})),s.info(`[webmcp] registered ${y.length} site tool(s)`),{get tools(){return y},callTool:({name:h,arguments:b})=>x({...m(),action:"call",name:h,arguments:b??{}}),dispose:p}}function wO(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:ma(n,"/webmcp",r),listEndpoint:ma(n,"/webmcp/tools",{token:e.token,...o&&{channel:o},...r}),...o&&{channelId:o},headers:{Authorization:`Bearer ${e.token}`},resourceEndpoint:ma(n,"/resource",{token:e.token,...r})}}var go=z(he(),1);var Wl=z(ae(),1),yO=672,xO=32;function vO({widget:e,onCallTool:t,toolsEndpoint:a,headers:n,resourceEndpoint:r,onClose:o,isDark:i=!1}){let[l,s]=(0,go.useState)(null);(0,go.useEffect)(()=>{let p=()=>s({width:window.innerWidth,height:window.innerHeight});return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);let u=e?.preview===!0;(0,go.useEffect)(()=>{if(!e||!u)return;let p=m=>{m.key==="Escape"&&o()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[e,u,o]),(0,go.useEffect)(()=>{if(!e)return;let p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[e]);let c=(0,go.useCallback)(async p=>{if(t)return t(p);if(!a)throw new Error("webmcp overlay needs onCallTool");let m=await fetch(a,{method:"POST",headers:{"content-type":"application/json",...n},body:JSON.stringify({action:"call",...p})});if(!m.ok)throw new Error(`webmcp tool call failed: ${m.status}`);return await m.json()},[t,a,n]);if(!e)return null;let d=l?Math.min(yO,l.width-xO):yO,f=l?l.height-xO:void 0;return(0,Wl.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Waniwani",className:q("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,Wl.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,Wl.jsx)("div",{className:"ww:relative ww:overflow-auto ww:rounded-2xl ww:bg-background ww:shadow-2xl",style:{width:d,maxHeight:f},children:(0,Wl.jsx)(wp,{resourceUri:e.viewUri,resourceEndpoint:r,toolInput:e.data,toolResult:e.result,autoHeight:Hu(e.result._meta),isDark:i,onCallTool:c,onOpenLink:p=>window.open(p,"_blank","noopener")},`${r}|${e.viewUri}`)})]})}var wv=z(ae(),1),bO="waniwani:webmcp:session";function T7(){try{let e=sessionStorage.getItem(bO);if(e)return e;let t=crypto.randomUUID();return sessionStorage.setItem(bO,t),t}catch{return`s-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}}function L7(e){let t=e.token?ho(e.api??"",e.token,e.channelId):null,a=wO(e,t?.webmcp?.enabled,t?.channelId);return a||ha("[webmcp] not publishing site tools: switched off, or no token"),a}function E7(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}}function M7(){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 A7({resourceEndpoint:e,subscribe:t,callTool:a}){let[n,r]=oc.default.useState(null),[o,i]=oc.default.useState(E7);return oc.default.useEffect(()=>t(r),[t]),oc.default.useEffect(()=>{let l;try{l=window.matchMedia("(prefers-color-scheme: dark)")}catch{return}let s=()=>i(l.matches);return l.addEventListener("change",s),()=>l.removeEventListener("change",s)},[]),(0,wv.jsx)(vO,{widget:n,onCallTool:a,resourceEndpoint:e,isDark:o,onClose:()=>r(null)})}function IO(e){if(!hv())return null;let t=L7(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"});jp(n);let r=document.createElement("div");n.appendChild(r);let o=M7(),i=null,l=!1;gv({endpoint:t.toolsEndpoint,listEndpoint:t.listEndpoint,headers:t.headers,channelId:t.channelId,sessionId:T7(),visitorId:Zt(),onWidget:o.emit}).then(c=>{if(l){c?.dispose();return}i=c}).catch(c=>{console.error("[webmcp] could not publish site tools",c)});let s=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=SO.default.createRoot(r);return u.render((0,wv.jsx)(A7,{resourceEndpoint:t.resourceEndpoint,subscribe:o.subscribe,callTool:s})),{getTools:()=>(i?.tools??[]).map(c=>c.name),destroy:()=>{l=!0,i?.dispose(),u.unmount(),a.remove()}}}var vt=null,hn=null,Mt=null,di=null,Wp=null,R7="waniwani-chat-sizing",D7="waniwani-chat-defaults",_7="waniwani-chat-chrome",O7="waniwani-chat-auto-card",P7=`:where([data-waniwani-embed]){height:${J_}}`,N7=":where([data-waniwani-embed]){border-radius:16px;overflow:hidden}",B7=":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)}",U7=":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))}",F7="waniwani-chat-composer-auto",z7=":where([data-waniwani-embed][data-waniwani-auto]){width:100%;max-width:40rem;margin-inline:auto}";function ic(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 TO(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 Gp(e,t){jp(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 CO="data-waniwani-embed",lc="data-waniwani-auto";function LO(e){let t=document.querySelector(`[${CO}]`);if(t)return t;let a=document.createElement("div");a.setAttribute(CO,""),a.setAttribute(lc,"");let n=e?!!document.head?.contains(e):!1;return e?.parentNode&&!n?e.parentNode.insertBefore(a,e):document.body.appendChild(a),a}function q7(e){return/^\d+$/.test(e.trim())?`${e.trim()}px`:e.trim()}function H7(e,t,a,n){let r=LO(n);ic(R7,P7),e.height&&r instanceof HTMLElement&&(r.style.height=q7(e.height)),e.appearance?.theme&&ic(D7,N7),ic(_7,B7),r.hasAttribute(lc)&&ic(O7,U7),TO(r,e),Mt=document.createElement("div"),Mt.id="waniwani-chat-embed",Mt.style.cssText="width:100%;height:100%;max-height:inherit;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;",r.appendChild(Mt);let o=Mt,i=()=>{let d=getComputedStyle(r);if(!d.maxHeight.endsWith("px")){o.style.removeProperty("max-height");return}let f=Number.parseFloat(d.maxHeight);if(!Number.isFinite(f)){o.style.removeProperty("max-height");return}let p=f;d.boxSizing==="border-box"&&(p-=(Number.parseFloat(d.paddingTop)||0)+(Number.parseFloat(d.paddingBottom)||0)+(Number.parseFloat(d.borderTopWidth)||0)+(Number.parseFloat(d.borderBottomWidth)||0)),p>0?o.style.maxHeight=`${p}px`:o.style.removeProperty("max-height")};i(),Wp=new ResizeObserver(i),Wp.observe(r);let l=Mt.attachShadow({mode:"open"});Gp(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=fi.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=ho(e.api??"",e.token,e.channelId);d?.visibility&&!ac(d.visibility,window.location.pathname)&&c(!1)}return hn=$p.default.createRoot(s),hn.render(fi.default.createElement(hO,{ref:u,config:e,programmatic:t,scriptConfig:a,onVisibilityChange:c})),{destroy:()=>{Wp?.disconnect(),Wp=null,hn?.unmount(),hn=null,Mt?.remove(),Mt=null,r.hasAttribute(lc)&&r.remove(),vt=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:d=>u.current?.chat?.sendMessage(d),sendMessageAndWait:async d=>{let f=u.current?.chat;if(f)return await f.sendMessageAndWait(d)},reset:()=>u.current?.chat?.reset(),focus:()=>u.current?.chat?.focus(),getMessages:()=>u.current?.chat?.messages??[],getSessionId:()=>u.current?.chat?.sessionId}}function j7(e,t,a){Mt=document.createElement("div"),Mt.id="waniwani-chat-embed",Mt.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(Mt);let n=Mt.attachShadow({mode:"open"});Gp(n,e);let r=document.createElement("div");r.className="ww:contents",n.appendChild(r);let o=fi.default.createRef();return hn=$p.default.createRoot(r),hn.render(fi.default.createElement(mO,{ref:o,config:e,programmatic:t,scriptConfig:a})),{destroy:()=>{hn?.unmount(),hn=null,Mt?.remove(),Mt=null,vt=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 V7(){return{destroy:()=>{vt=null},open:()=>{},close:()=>{},toggle:()=>{},sendMessage:()=>{},sendMessageAndWait:async()=>{},reset:()=>{},focus:()=>{},getMessages:()=>[],getSessionId:()=>{}}}function W7(e,t,a,n){let r=LO(n);r.hasAttribute(lc)&&ic(F7,z7),TO(r,e),Mt=document.createElement("div"),Mt.id="waniwani-chat-embed",Mt.style.cssText="display:block;width:100%;",r.appendChild(Mt);let o=Mt.attachShadow({mode:"open"});Gp(o,e);let i=document.createElement("div");i.className="ww:contents",o.appendChild(i),di=document.createElement("div"),di.id="waniwani-chat-panel",di.style.cssText="position:fixed;inset:0;z-index:2147483000;pointer-events:none;",document.body.appendChild(di);let l=di.attachShadow({mode:"open"});Gp(l,e);let s=document.createElement("div");s.className="ww:contents",l.appendChild(s);let u=fi.default.createRef(),c=d=>{r instanceof HTMLElement&&(r.style.display=d?"":"none")};if(e.token){let d=ho(e.api??"",e.token,e.channelId);d?.visibility&&!ac(d.visibility,window.location.pathname)&&c(!1)}return hn=$p.default.createRoot(i),hn.render(fi.default.createElement(fO,{ref:u,config:e,programmatic:t,scriptConfig:a,panelContainer:s,onVisibilityChange:c})),{destroy:()=>{hn?.unmount(),hn=null,Mt?.remove(),Mt=null,di?.remove(),di=null,r.hasAttribute(lc)&&r.remove(),vt=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 EO(e){if(vt)return console.warn("[Waniwani] Chat widget is already initialized. Call destroy() first to re-initialize."),vt;let t=cv(),a=qp(),n=tc(e,void 0,a);Xs(n.visitorId);let r=null;try{r=IO(n)}catch(s){console.error("[Waniwani] WebMCP setup failed",s)}let o;n.mode==="off"?o=V7():n.mode==="floating"?o=j7(n,e,a):n.mode==="composer"?o=W7(n,e,a,t):o=H7(n,e,a,t);let i=n.api??"",l=n.token?PC({api:i,token:n.token,channelId:()=>n.channelId??ho(i,n.token,n.channelId)?.channelId,getSource:()=>ho(i,n.token,n.channelId)?.source??void 0,getSessionId:()=>o.getSessionId()}):Zd("no public token configured (set data-token or pass token to init())");return vt={...o,track:l.track,identify:(s,u)=>l.identify(s,u),setVisitorId:s=>ll(s),getVisitorId:()=>Zt(),destroy:()=>{l.shutdown(),r?.destroy(),o.destroy()}},vt}function G7(){vt&&vt.destroy()}var MO=Zd("chat widget is not initialized (call WaniWani.chat.init() first)"),Gl=()=>vt?vt.track:MO.track;window.WaniWani=window.WaniWani||{};window.WaniWani.chat={init:EO,destroy:G7,open:()=>vt?.open(),close:()=>vt?.close(),toggle:()=>vt?.toggle(),sendMessage:e=>vt?.sendMessage(e),sendMessageAndWait:async e=>{if(vt)return vt.sendMessageAndWait(e)},reset:()=>vt?.reset(),focus:()=>vt?.focus(),getMessages:()=>vt?.getMessages()??[],getSessionId:()=>vt?.getSessionId(),track:Object.assign(e=>Gl()(e),{priceShown:e=>Gl().priceShown(e),pricesCompared:e=>Gl().pricesCompared(e),optionSelected:e=>Gl().optionSelected(e),leadQualified:e=>Gl().leadQualified(e),converted:e=>Gl().converted(e)}),identify:(e,t)=>vt?vt.identify(e,t):MO.identify(e,t),setVisitorId:e=>ll(e),getVisitorId:()=>Zt()};function kO(){if(qp().token)try{EO()}catch(t){console.error("[Waniwani] Auto-initialization failed:",t)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",kO):kO();})();
|
|
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"&&KE(d)?t.onLeaseEnded?.():yield YE(d,t.streamVersion)}u=r.indexOf(`
|
|
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+=`
|
|
138
|
+
Known schemas:
|
|
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}
|
|
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();})();
|
|
139
146
|
/*! Bundled license information:
|
|
140
147
|
|
|
141
148
|
react/cjs/react.production.js:
|