@mastra/deployer-cloud 1.9.0-alpha.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/studio/assets/{chunk-REDZDNFN-5Tj-trdT.js → chunk-REDZDNFN-DBtAJyUR.js} +1 -1
- package/dist/studio/assets/{index-DhD27KDZ.js → index-1CIfQRPa.js} +1 -1
- package/dist/studio/assets/{index-r9pq8NPk.js → index-AYBaNmoq.js} +1 -1
- package/dist/studio/assets/{index-DHKhLHm8.js → index-B8WLnubh.js} +1 -1
- package/dist/studio/assets/{index-DU4KNmGl.js → index-B9lWwBXQ.js} +1 -1
- package/dist/studio/assets/{index-DEpD2Jfv.js → index-BJ47Zsb5.js} +1 -1
- package/dist/studio/assets/{index-EuikVAsT.js → index-BbrxUzO8.js} +1 -1
- package/dist/studio/assets/{index-Blz1NRPV.js → index-Bk2cWYRn.js} +1 -1
- package/dist/studio/assets/{index-CK-Rhk5D.js → index-C3zH8UNH.js} +1 -1
- package/dist/studio/assets/{index-D0q761D_.js → index-C5Gn56O1.js} +1 -1
- package/dist/studio/assets/{index-BmlTAJsW.js → index-CWOzX6bp.js} +1 -1
- package/dist/studio/assets/{index-C7caMlfs.js → index-CoMhsst-.js} +1 -1
- package/dist/studio/assets/{index-CxDXyU75.js → index-CoORZRmo.js} +1 -1
- package/dist/studio/assets/{index-Dn7Rt2wz.js → index-DJtMwJXc.js} +1 -1
- package/dist/studio/assets/{index-CAa0LkPQ.js → index-DVi3DnAy.js} +1 -1
- package/dist/studio/assets/{index-CRkty_QZ.js → index-DXQLCSe-.js} +1 -1
- package/dist/studio/assets/{index-C1ViNSxz.js → index-DbViMdCi.js} +1 -1
- package/dist/studio/assets/{index-DzGV1Iz6.js → index-De8FQYWG.js} +1 -1
- package/dist/studio/assets/{index-PaoSb2RY.js → index-Do6PzU9v.js} +1 -1
- package/dist/studio/assets/{main-CZUlzyAB.js → main-l-GkLRbZ.js} +6 -6
- package/dist/studio/assets/{token-6GSAFR2W-XRCSVUPZ-Br966x8T.js → token-6GSAFR2W-XRCSVUPZ-CJKKY7Xw.js} +1 -1
- package/dist/studio/assets/token-util-NEHG7TUY-U7CX7GS4-CvzVQPbB.js +1 -0
- package/dist/studio/index.html +1 -1
- package/package.json +7 -7
- package/versions.json +1 -1
- package/dist/studio/assets/token-util-NEHG7TUY-U7CX7GS4-CqTMHVgX.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{_ as Ge}from"./index-CRkty_QZ.js";function gMe(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var X$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g7={exports:{}},E_={};var yye;function _vt(){if(yye)return E_;yye=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:a}}return E_.Fragment=t,E_.jsx=r,E_.jsxs=r,E_}var bye;function Cvt(){return bye||(bye=1,g7.exports=_vt()),g7.exports}var c=Cvt(),y7={exports:{}},yn={},vye;function Tvt(){if(vye)return yn;vye=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),h=Symbol.iterator;function m(U){return U===null||typeof U!="object"?null:(U=h&&U[h]||U["@@iterator"],typeof U=="function"?U:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,v={};function S(U,I,H){this.props=U,this.context=I,this.refs=v,this.updater=H||y}S.prototype.isReactComponent={},S.prototype.setState=function(U,I){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,I,"setState")},S.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function w(){}w.prototype=S.prototype;function k(U,I,H){this.props=U,this.context=I,this.refs=v,this.updater=H||y}var _=k.prototype=new w;_.constructor=k,b(_,S.prototype),_.isPureReactComponent=!0;var C=Array.isArray;function T(){}var A={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function j(U,I,H){var G=H.ref;return{$$typeof:t,type:U,key:I,ref:G!==void 0?G:null,props:H}}function R(U,I){return j(U.type,I,U.props)}function L(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function F(U){var I={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(H){return I[H]})}var M=/\/+/g;function z(U,I){return typeof U=="object"&&U!==null&&U.key!=null?F(""+U.key):I.toString(36)}function q(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(T,T):(U.status="pending",U.then(function(I){U.status==="pending"&&(U.status="fulfilled",U.value=I)},function(I){U.status==="pending"&&(U.status="rejected",U.reason=I)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function Q(U,I,H,G,J){var ee=typeof U;(ee==="undefined"||ee==="boolean")&&(U=null);var te=!1;if(U===null)te=!0;else switch(ee){case"bigint":case"string":case"number":te=!0;break;case"object":switch(U.$$typeof){case t:case r:te=!0;break;case p:return te=U._init,Q(te(U._payload),I,H,G,J)}}if(te)return J=J(U),te=G===""?"."+z(U,0):G,C(J)?(H="",te!=null&&(H=te.replace(M,"$&/")+"/"),Q(J,I,H,"",function(Se){return Se})):J!=null&&(L(J)&&(J=R(J,H+(J.key==null||U&&U.key===J.key?"":(""+J.key).replace(M,"$&/")+"/")+te)),I.push(J)),1;te=0;var se=G===""?".":G+":";if(C(U))for(var ce=0;ce<U.length;ce++)G=U[ce],ee=se+z(G,ce),te+=Q(G,I,H,ee,J);else if(ce=m(U),typeof ce=="function")for(U=ce.call(U),ce=0;!(G=U.next()).done;)G=G.value,ee=se+z(G,ce++),te+=Q(G,I,H,ee,J);else if(ee==="object"){if(typeof U.then=="function")return Q(q(U),I,H,G,J);throw I=String(U),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return te}function V(U,I,H){if(U==null)return U;var G=[],J=0;return Q(U,G,"","",function(ee){return I.call(H,ee,J++)}),G}function Z(U){if(U._status===-1){var I=U._result;I=I(),I.then(function(H){(U._status===0||U._status===-1)&&(U._status=1,U._result=H)},function(H){(U._status===0||U._status===-1)&&(U._status=2,U._result=H)}),U._status===-1&&(U._status=0,U._result=I)}if(U._status===1)return U._result.default;throw U._result}var $=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(I))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",U);return}console.error(U)},X={map:V,forEach:function(U,I,H){V(U,function(){I.apply(this,arguments)},H)},count:function(U){var I=0;return V(U,function(){I++}),I},toArray:function(U){return V(U,function(I){return I})||[]},only:function(U){if(!L(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return yn.Activity=f,yn.Children=X,yn.Component=S,yn.Fragment=n,yn.Profiler=a,yn.PureComponent=k,yn.StrictMode=s,yn.Suspense=u,yn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,yn.__COMPILER_RUNTIME={__proto__:null,c:function(U){return A.H.useMemoCache(U)}},yn.cache=function(U){return function(){return U.apply(null,arguments)}},yn.cacheSignal=function(){return null},yn.cloneElement=function(U,I,H){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var G=b({},U.props),J=U.key;if(I!=null)for(ee in I.key!==void 0&&(J=""+I.key),I)!N.call(I,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&I.ref===void 0||(G[ee]=I[ee]);var ee=arguments.length-2;if(ee===1)G.children=H;else if(1<ee){for(var te=Array(ee),se=0;se<ee;se++)te[se]=arguments[se+2];G.children=te}return j(U.type,J,G)},yn.createContext=function(U){return U={$$typeof:o,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:i,_context:U},U},yn.createElement=function(U,I,H){var G,J={},ee=null;if(I!=null)for(G in I.key!==void 0&&(ee=""+I.key),I)N.call(I,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=I[G]);var te=arguments.length-2;if(te===1)J.children=H;else if(1<te){for(var se=Array(te),ce=0;ce<te;ce++)se[ce]=arguments[ce+2];J.children=se}if(U&&U.defaultProps)for(G in te=U.defaultProps,te)J[G]===void 0&&(J[G]=te[G]);return j(U,ee,J)},yn.createRef=function(){return{current:null}},yn.forwardRef=function(U){return{$$typeof:l,render:U}},yn.isValidElement=L,yn.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:Z}},yn.memo=function(U,I){return{$$typeof:d,type:U,compare:I===void 0?null:I}},yn.startTransition=function(U){var I=A.T,H={};A.T=H;try{var G=U(),J=A.S;J!==null&&J(H,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,$)}catch(ee){$(ee)}finally{I!==null&&H.types!==null&&(I.types=H.types),A.T=I}},yn.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},yn.use=function(U){return A.H.use(U)},yn.useActionState=function(U,I,H){return A.H.useActionState(U,I,H)},yn.useCallback=function(U,I){return A.H.useCallback(U,I)},yn.useContext=function(U){return A.H.useContext(U)},yn.useDebugValue=function(){},yn.useDeferredValue=function(U,I){return A.H.useDeferredValue(U,I)},yn.useEffect=function(U,I){return A.H.useEffect(U,I)},yn.useEffectEvent=function(U){return A.H.useEffectEvent(U)},yn.useId=function(){return A.H.useId()},yn.useImperativeHandle=function(U,I,H){return A.H.useImperativeHandle(U,I,H)},yn.useInsertionEffect=function(U,I){return A.H.useInsertionEffect(U,I)},yn.useLayoutEffect=function(U,I){return A.H.useLayoutEffect(U,I)},yn.useMemo=function(U,I){return A.H.useMemo(U,I)},yn.useOptimistic=function(U,I){return A.H.useOptimistic(U,I)},yn.useReducer=function(U,I,H){return A.H.useReducer(U,I,H)},yn.useRef=function(U){return A.H.useRef(U)},yn.useState=function(U){return A.H.useState(U)},yn.useSyncExternalStore=function(U,I,H){return A.H.useSyncExternalStore(U,I,H)},yn.useTransition=function(){return A.H.useTransition()},yn.version="19.2.3",yn}var xye;function Vk(){return xye||(xye=1,y7.exports=Tvt()),y7.exports}var E=Vk();const Ee=Td(E),qk=gMe({__proto__:null,default:Ee},[E]);var b7={exports:{}},k_={},v7={exports:{}},x7={};var Sye;function Avt(){return Sye||(Sye=1,(function(e){function t(q,Q){var V=q.length;q.push(Q);e:for(;0<V;){var Z=V-1>>>1,$=q[Z];if(0<s($,Q))q[Z]=Q,q[V]=$,V=Z;else break e}}function r(q){return q.length===0?null:q[0]}function n(q){if(q.length===0)return null;var Q=q[0],V=q.pop();if(V!==Q){q[0]=V;e:for(var Z=0,$=q.length,X=$>>>1;Z<X;){var U=2*(Z+1)-1,I=q[U],H=U+1,G=q[H];if(0>s(I,V))H<$&&0>s(G,I)?(q[Z]=G,q[H]=V,Z=H):(q[Z]=I,q[U]=V,Z=U);else if(H<$&&0>s(G,V))q[Z]=G,q[H]=V,Z=H;else break e}}return Q}function s(q,Q){var V=q.sortIndex-Q.sortIndex;return V!==0?V:q.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var l=[],u=[],d=1,p=null,f=3,h=!1,m=!1,y=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function k(q){for(var Q=r(u);Q!==null;){if(Q.callback===null)n(u);else if(Q.startTime<=q)n(u),Q.sortIndex=Q.expirationTime,t(l,Q);else break;Q=r(u)}}function _(q){if(y=!1,k(q),!m)if(r(l)!==null)m=!0,C||(C=!0,L());else{var Q=r(u);Q!==null&&z(_,Q.startTime-q)}}var C=!1,T=-1,A=5,N=-1;function j(){return b?!0:!(e.unstable_now()-N<A)}function R(){if(b=!1,C){var q=e.unstable_now();N=q;var Q=!0;try{e:{m=!1,y&&(y=!1,S(T),T=-1),h=!0;var V=f;try{t:{for(k(q),p=r(l);p!==null&&!(p.expirationTime>q&&j());){var Z=p.callback;if(typeof Z=="function"){p.callback=null,f=p.priorityLevel;var $=Z(p.expirationTime<=q);if(q=e.unstable_now(),typeof $=="function"){p.callback=$,k(q),Q=!0;break t}p===r(l)&&n(l),k(q)}else n(l);p=r(l)}if(p!==null)Q=!0;else{var X=r(u);X!==null&&z(_,X.startTime-q),Q=!1}}break e}finally{p=null,f=V,h=!1}Q=void 0}}finally{Q?L():C=!1}}}var L;if(typeof w=="function")L=function(){w(R)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,M=F.port2;F.port1.onmessage=R,L=function(){M.postMessage(null)}}else L=function(){v(R,0)};function z(q,Q){T=v(function(){q(e.unstable_now())},Q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(q){switch(f){case 1:case 2:case 3:var Q=3;break;default:Q=f}var V=f;f=Q;try{return q()}finally{f=V}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(q,Q){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var V=f;f=q;try{return Q()}finally{f=V}},e.unstable_scheduleCallback=function(q,Q,V){var Z=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?Z+V:Z):V=Z,q){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=V+$,q={id:d++,callback:Q,priorityLevel:q,startTime:V,expirationTime:$,sortIndex:-1},V>Z?(q.sortIndex=V,t(u,q),r(l)===null&&q===r(u)&&(y?(S(T),T=-1):y=!0,z(_,V-Z))):(q.sortIndex=$,t(l,q),m||h||(m=!0,C||(C=!0,L()))),q},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(q){var Q=f;return function(){var V=f;f=Q;try{return q.apply(this,arguments)}finally{f=V}}}})(x7)),x7}var wye;function Dvt(){return wye||(wye=1,v7.exports=Avt()),v7.exports}var S7={exports:{}},Il={};var Eye;function Nvt(){if(Eye)return Il;Eye=1;var e=Vk();function t(l){var u="https://react.dev/errors/"+l;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(l,u,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:l,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(l,u){if(l==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Il.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Il.createPortal=function(l,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return a(l,u,null,d)},Il.flushSync=function(l){var u=i.T,d=n.p;try{if(i.T=null,n.p=2,l)return l()}finally{i.T=u,n.p=d,n.d.f()}},Il.preconnect=function(l,u){typeof l=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(l,u))},Il.prefetchDNS=function(l){typeof l=="string"&&n.d.D(l)},Il.preinit=function(l,u){if(typeof l=="string"&&u&&typeof u.as=="string"){var d=u.as,p=o(d,u.crossOrigin),f=typeof u.integrity=="string"?u.integrity:void 0,h=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?n.d.S(l,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:p,integrity:f,fetchPriority:h}):d==="script"&&n.d.X(l,{crossOrigin:p,integrity:f,fetchPriority:h,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Il.preinitModule=function(l,u){if(typeof l=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=o(u.as,u.crossOrigin);n.d.M(l,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(l)},Il.preload=function(l,u){if(typeof l=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,p=o(d,u.crossOrigin);n.d.L(l,d,{crossOrigin:p,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Il.preloadModule=function(l,u){if(typeof l=="string")if(u){var d=o(u.as,u.crossOrigin);n.d.m(l,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(l)},Il.requestFormReset=function(l){n.d.r(l)},Il.unstable_batchedUpdates=function(l,u){return l(u)},Il.useFormState=function(l,u,d){return i.H.useFormState(l,u,d)},Il.useFormStatus=function(){return i.H.useHostTransitionStatus()},Il.version="19.2.3",Il}var kye;function yMe(){if(kye)return S7.exports;kye=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),S7.exports=Nvt(),S7.exports}var Oye;function Ivt(){if(Oye)return k_;Oye=1;var e={env:{}};var t=Dvt(),r=Vk(),n=yMe();function s(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var O=2;O<arguments.length;O++)x+="&args[]="+encodeURIComponent(arguments[O])}return"Minified React error #"+g+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(g){return!(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)}function i(g){var x=g,O=g;if(g.alternate)for(;x.return;)x=x.return;else{g=x;do x=g,(x.flags&4098)!==0&&(O=x.return),g=x.return;while(g)}return x.tag===3?O:null}function o(g){if(g.tag===13){var x=g.memoizedState;if(x===null&&(g=g.alternate,g!==null&&(x=g.memoizedState)),x!==null)return x.dehydrated}return null}function l(g){if(g.tag===31){var x=g.memoizedState;if(x===null&&(g=g.alternate,g!==null&&(x=g.memoizedState)),x!==null)return x.dehydrated}return null}function u(g){if(i(g)!==g)throw Error(s(188))}function d(g){var x=g.alternate;if(!x){if(x=i(g),x===null)throw Error(s(188));return x!==g?null:g}for(var O=g,D=x;;){var P=O.return;if(P===null)break;var B=P.alternate;if(B===null){if(D=P.return,D!==null){O=D;continue}break}if(P.child===B.child){for(B=P.child;B;){if(B===O)return u(P),g;if(B===D)return u(P),x;B=B.sibling}throw Error(s(188))}if(O.return!==D.return)O=P,D=B;else{for(var Y=!1,ie=P.child;ie;){if(ie===O){Y=!0,O=P,D=B;break}if(ie===D){Y=!0,D=P,O=B;break}ie=ie.sibling}if(!Y){for(ie=B.child;ie;){if(ie===O){Y=!0,O=B,D=P;break}if(ie===D){Y=!0,D=B,O=P;break}ie=ie.sibling}if(!Y)throw Error(s(189))}}if(O.alternate!==D)throw Error(s(190))}if(O.tag!==3)throw Error(s(188));return O.stateNode.current===O?g:x}function p(g){var x=g.tag;if(x===5||x===26||x===27||x===6)return g;for(g=g.child;g!==null;){if(x=p(g),x!==null)return x;g=g.sibling}return null}var f=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),k=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),R=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function F(g){return g===null||typeof g!="object"?null:(g=L&&g[L]||g["@@iterator"],typeof g=="function"?g:null)}var M=Symbol.for("react.client.reference");function z(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===M?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case b:return"Fragment";case S:return"Profiler";case v:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList";case j:return"Activity"}if(typeof g=="object")switch(g.$$typeof){case y:return"Portal";case k:return g.displayName||"Context";case w:return(g._context.displayName||"Context")+".Consumer";case _:var x=g.render;return g=g.displayName,g||(g=x.displayName||x.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case A:return x=g.displayName||null,x!==null?x:z(g.type)||"Memo";case N:x=g._payload,g=g._init;try{return z(g(x))}catch{}}return null}var q=Array.isArray,Q=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},$=[],X=-1;function U(g){return{current:g}}function I(g){0>X||(g.current=$[X],$[X]=null,X--)}function H(g,x){X++,$[X]=g.current,g.current=x}var G=U(null),J=U(null),ee=U(null),te=U(null);function se(g,x){switch(H(ee,x),H(J,g),H(G,null),x.nodeType){case 9:case 11:g=(g=x.documentElement)&&(g=g.namespaceURI)?Bge(g):0;break;default:if(g=x.tagName,x=x.namespaceURI)x=Bge(x),g=zge(x,g);else switch(g){case"svg":g=1;break;case"math":g=2;break;default:g=0}}I(G),H(G,g)}function ce(){I(G),I(J),I(ee)}function Se(g){g.memoizedState!==null&&H(te,g);var x=G.current,O=zge(x,g.type);x!==O&&(H(J,g),H(G,O))}function W(g){J.current===g&&(I(G),I(J)),te.current===g&&(I(te),v_._currentValue=Z)}var ne,ae;function ge(g){if(ne===void 0)try{throw Error()}catch(O){var x=O.stack.trim().match(/\n( *(at )?)/);ne=x&&x[1]||"",ae=-1<O.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-C5Gn56O1.js","./index-DXQLCSe-.js","./index-BJ47Zsb5.js","./index-DVi3DnAy.js","./index-C3zH8UNH.js","./index-B9lWwBXQ.js","./index-Bk2cWYRn.js","./index-BbrxUzO8.js","./index-CoORZRmo.js","./index-1CIfQRPa.js","./index-DbViMdCi.js","./index-CWOzX6bp.js","./index-B8WLnubh.js","./index-DJtMwJXc.js","./index-De8FQYWG.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-Do6PzU9v.js","./index-CoMhsst-.js","./token-util-NEHG7TUY-U7CX7GS4-CvzVQPbB.js","./chunk-REDZDNFN-DBtAJyUR.js","./token-6GSAFR2W-XRCSVUPZ-CJKKY7Xw.js","./index-AYBaNmoq.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Ge}from"./index-DXQLCSe-.js";function gMe(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var X$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g7={exports:{}},E_={};var yye;function _vt(){if(yye)return E_;yye=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:a}}return E_.Fragment=t,E_.jsx=r,E_.jsxs=r,E_}var bye;function Cvt(){return bye||(bye=1,g7.exports=_vt()),g7.exports}var c=Cvt(),y7={exports:{}},yn={},vye;function Tvt(){if(vye)return yn;vye=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),h=Symbol.iterator;function m(U){return U===null||typeof U!="object"?null:(U=h&&U[h]||U["@@iterator"],typeof U=="function"?U:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,v={};function S(U,I,H){this.props=U,this.context=I,this.refs=v,this.updater=H||y}S.prototype.isReactComponent={},S.prototype.setState=function(U,I){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,I,"setState")},S.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function w(){}w.prototype=S.prototype;function k(U,I,H){this.props=U,this.context=I,this.refs=v,this.updater=H||y}var _=k.prototype=new w;_.constructor=k,b(_,S.prototype),_.isPureReactComponent=!0;var C=Array.isArray;function T(){}var A={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function j(U,I,H){var G=H.ref;return{$$typeof:t,type:U,key:I,ref:G!==void 0?G:null,props:H}}function R(U,I){return j(U.type,I,U.props)}function L(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function F(U){var I={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(H){return I[H]})}var M=/\/+/g;function z(U,I){return typeof U=="object"&&U!==null&&U.key!=null?F(""+U.key):I.toString(36)}function q(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(T,T):(U.status="pending",U.then(function(I){U.status==="pending"&&(U.status="fulfilled",U.value=I)},function(I){U.status==="pending"&&(U.status="rejected",U.reason=I)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function Q(U,I,H,G,J){var ee=typeof U;(ee==="undefined"||ee==="boolean")&&(U=null);var te=!1;if(U===null)te=!0;else switch(ee){case"bigint":case"string":case"number":te=!0;break;case"object":switch(U.$$typeof){case t:case r:te=!0;break;case p:return te=U._init,Q(te(U._payload),I,H,G,J)}}if(te)return J=J(U),te=G===""?"."+z(U,0):G,C(J)?(H="",te!=null&&(H=te.replace(M,"$&/")+"/"),Q(J,I,H,"",function(Se){return Se})):J!=null&&(L(J)&&(J=R(J,H+(J.key==null||U&&U.key===J.key?"":(""+J.key).replace(M,"$&/")+"/")+te)),I.push(J)),1;te=0;var se=G===""?".":G+":";if(C(U))for(var ce=0;ce<U.length;ce++)G=U[ce],ee=se+z(G,ce),te+=Q(G,I,H,ee,J);else if(ce=m(U),typeof ce=="function")for(U=ce.call(U),ce=0;!(G=U.next()).done;)G=G.value,ee=se+z(G,ce++),te+=Q(G,I,H,ee,J);else if(ee==="object"){if(typeof U.then=="function")return Q(q(U),I,H,G,J);throw I=String(U),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return te}function V(U,I,H){if(U==null)return U;var G=[],J=0;return Q(U,G,"","",function(ee){return I.call(H,ee,J++)}),G}function Z(U){if(U._status===-1){var I=U._result;I=I(),I.then(function(H){(U._status===0||U._status===-1)&&(U._status=1,U._result=H)},function(H){(U._status===0||U._status===-1)&&(U._status=2,U._result=H)}),U._status===-1&&(U._status=0,U._result=I)}if(U._status===1)return U._result.default;throw U._result}var $=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(I))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",U);return}console.error(U)},X={map:V,forEach:function(U,I,H){V(U,function(){I.apply(this,arguments)},H)},count:function(U){var I=0;return V(U,function(){I++}),I},toArray:function(U){return V(U,function(I){return I})||[]},only:function(U){if(!L(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return yn.Activity=f,yn.Children=X,yn.Component=S,yn.Fragment=n,yn.Profiler=a,yn.PureComponent=k,yn.StrictMode=s,yn.Suspense=u,yn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,yn.__COMPILER_RUNTIME={__proto__:null,c:function(U){return A.H.useMemoCache(U)}},yn.cache=function(U){return function(){return U.apply(null,arguments)}},yn.cacheSignal=function(){return null},yn.cloneElement=function(U,I,H){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var G=b({},U.props),J=U.key;if(I!=null)for(ee in I.key!==void 0&&(J=""+I.key),I)!N.call(I,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&I.ref===void 0||(G[ee]=I[ee]);var ee=arguments.length-2;if(ee===1)G.children=H;else if(1<ee){for(var te=Array(ee),se=0;se<ee;se++)te[se]=arguments[se+2];G.children=te}return j(U.type,J,G)},yn.createContext=function(U){return U={$$typeof:o,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:i,_context:U},U},yn.createElement=function(U,I,H){var G,J={},ee=null;if(I!=null)for(G in I.key!==void 0&&(ee=""+I.key),I)N.call(I,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=I[G]);var te=arguments.length-2;if(te===1)J.children=H;else if(1<te){for(var se=Array(te),ce=0;ce<te;ce++)se[ce]=arguments[ce+2];J.children=se}if(U&&U.defaultProps)for(G in te=U.defaultProps,te)J[G]===void 0&&(J[G]=te[G]);return j(U,ee,J)},yn.createRef=function(){return{current:null}},yn.forwardRef=function(U){return{$$typeof:l,render:U}},yn.isValidElement=L,yn.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:Z}},yn.memo=function(U,I){return{$$typeof:d,type:U,compare:I===void 0?null:I}},yn.startTransition=function(U){var I=A.T,H={};A.T=H;try{var G=U(),J=A.S;J!==null&&J(H,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,$)}catch(ee){$(ee)}finally{I!==null&&H.types!==null&&(I.types=H.types),A.T=I}},yn.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},yn.use=function(U){return A.H.use(U)},yn.useActionState=function(U,I,H){return A.H.useActionState(U,I,H)},yn.useCallback=function(U,I){return A.H.useCallback(U,I)},yn.useContext=function(U){return A.H.useContext(U)},yn.useDebugValue=function(){},yn.useDeferredValue=function(U,I){return A.H.useDeferredValue(U,I)},yn.useEffect=function(U,I){return A.H.useEffect(U,I)},yn.useEffectEvent=function(U){return A.H.useEffectEvent(U)},yn.useId=function(){return A.H.useId()},yn.useImperativeHandle=function(U,I,H){return A.H.useImperativeHandle(U,I,H)},yn.useInsertionEffect=function(U,I){return A.H.useInsertionEffect(U,I)},yn.useLayoutEffect=function(U,I){return A.H.useLayoutEffect(U,I)},yn.useMemo=function(U,I){return A.H.useMemo(U,I)},yn.useOptimistic=function(U,I){return A.H.useOptimistic(U,I)},yn.useReducer=function(U,I,H){return A.H.useReducer(U,I,H)},yn.useRef=function(U){return A.H.useRef(U)},yn.useState=function(U){return A.H.useState(U)},yn.useSyncExternalStore=function(U,I,H){return A.H.useSyncExternalStore(U,I,H)},yn.useTransition=function(){return A.H.useTransition()},yn.version="19.2.3",yn}var xye;function Vk(){return xye||(xye=1,y7.exports=Tvt()),y7.exports}var E=Vk();const Ee=Td(E),qk=gMe({__proto__:null,default:Ee},[E]);var b7={exports:{}},k_={},v7={exports:{}},x7={};var Sye;function Avt(){return Sye||(Sye=1,(function(e){function t(q,Q){var V=q.length;q.push(Q);e:for(;0<V;){var Z=V-1>>>1,$=q[Z];if(0<s($,Q))q[Z]=Q,q[V]=$,V=Z;else break e}}function r(q){return q.length===0?null:q[0]}function n(q){if(q.length===0)return null;var Q=q[0],V=q.pop();if(V!==Q){q[0]=V;e:for(var Z=0,$=q.length,X=$>>>1;Z<X;){var U=2*(Z+1)-1,I=q[U],H=U+1,G=q[H];if(0>s(I,V))H<$&&0>s(G,I)?(q[Z]=G,q[H]=V,Z=H):(q[Z]=I,q[U]=V,Z=U);else if(H<$&&0>s(G,V))q[Z]=G,q[H]=V,Z=H;else break e}}return Q}function s(q,Q){var V=q.sortIndex-Q.sortIndex;return V!==0?V:q.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var l=[],u=[],d=1,p=null,f=3,h=!1,m=!1,y=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function k(q){for(var Q=r(u);Q!==null;){if(Q.callback===null)n(u);else if(Q.startTime<=q)n(u),Q.sortIndex=Q.expirationTime,t(l,Q);else break;Q=r(u)}}function _(q){if(y=!1,k(q),!m)if(r(l)!==null)m=!0,C||(C=!0,L());else{var Q=r(u);Q!==null&&z(_,Q.startTime-q)}}var C=!1,T=-1,A=5,N=-1;function j(){return b?!0:!(e.unstable_now()-N<A)}function R(){if(b=!1,C){var q=e.unstable_now();N=q;var Q=!0;try{e:{m=!1,y&&(y=!1,S(T),T=-1),h=!0;var V=f;try{t:{for(k(q),p=r(l);p!==null&&!(p.expirationTime>q&&j());){var Z=p.callback;if(typeof Z=="function"){p.callback=null,f=p.priorityLevel;var $=Z(p.expirationTime<=q);if(q=e.unstable_now(),typeof $=="function"){p.callback=$,k(q),Q=!0;break t}p===r(l)&&n(l),k(q)}else n(l);p=r(l)}if(p!==null)Q=!0;else{var X=r(u);X!==null&&z(_,X.startTime-q),Q=!1}}break e}finally{p=null,f=V,h=!1}Q=void 0}}finally{Q?L():C=!1}}}var L;if(typeof w=="function")L=function(){w(R)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,M=F.port2;F.port1.onmessage=R,L=function(){M.postMessage(null)}}else L=function(){v(R,0)};function z(q,Q){T=v(function(){q(e.unstable_now())},Q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(q){switch(f){case 1:case 2:case 3:var Q=3;break;default:Q=f}var V=f;f=Q;try{return q()}finally{f=V}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(q,Q){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var V=f;f=q;try{return Q()}finally{f=V}},e.unstable_scheduleCallback=function(q,Q,V){var Z=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?Z+V:Z):V=Z,q){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=V+$,q={id:d++,callback:Q,priorityLevel:q,startTime:V,expirationTime:$,sortIndex:-1},V>Z?(q.sortIndex=V,t(u,q),r(l)===null&&q===r(u)&&(y?(S(T),T=-1):y=!0,z(_,V-Z))):(q.sortIndex=$,t(l,q),m||h||(m=!0,C||(C=!0,L()))),q},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(q){var Q=f;return function(){var V=f;f=Q;try{return q.apply(this,arguments)}finally{f=V}}}})(x7)),x7}var wye;function Dvt(){return wye||(wye=1,v7.exports=Avt()),v7.exports}var S7={exports:{}},Il={};var Eye;function Nvt(){if(Eye)return Il;Eye=1;var e=Vk();function t(l){var u="https://react.dev/errors/"+l;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(l,u,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:l,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(l,u){if(l==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Il.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Il.createPortal=function(l,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return a(l,u,null,d)},Il.flushSync=function(l){var u=i.T,d=n.p;try{if(i.T=null,n.p=2,l)return l()}finally{i.T=u,n.p=d,n.d.f()}},Il.preconnect=function(l,u){typeof l=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(l,u))},Il.prefetchDNS=function(l){typeof l=="string"&&n.d.D(l)},Il.preinit=function(l,u){if(typeof l=="string"&&u&&typeof u.as=="string"){var d=u.as,p=o(d,u.crossOrigin),f=typeof u.integrity=="string"?u.integrity:void 0,h=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?n.d.S(l,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:p,integrity:f,fetchPriority:h}):d==="script"&&n.d.X(l,{crossOrigin:p,integrity:f,fetchPriority:h,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Il.preinitModule=function(l,u){if(typeof l=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=o(u.as,u.crossOrigin);n.d.M(l,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(l)},Il.preload=function(l,u){if(typeof l=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,p=o(d,u.crossOrigin);n.d.L(l,d,{crossOrigin:p,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Il.preloadModule=function(l,u){if(typeof l=="string")if(u){var d=o(u.as,u.crossOrigin);n.d.m(l,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(l)},Il.requestFormReset=function(l){n.d.r(l)},Il.unstable_batchedUpdates=function(l,u){return l(u)},Il.useFormState=function(l,u,d){return i.H.useFormState(l,u,d)},Il.useFormStatus=function(){return i.H.useHostTransitionStatus()},Il.version="19.2.3",Il}var kye;function yMe(){if(kye)return S7.exports;kye=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),S7.exports=Nvt(),S7.exports}var Oye;function Ivt(){if(Oye)return k_;Oye=1;var e={env:{}};var t=Dvt(),r=Vk(),n=yMe();function s(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var O=2;O<arguments.length;O++)x+="&args[]="+encodeURIComponent(arguments[O])}return"Minified React error #"+g+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(g){return!(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)}function i(g){var x=g,O=g;if(g.alternate)for(;x.return;)x=x.return;else{g=x;do x=g,(x.flags&4098)!==0&&(O=x.return),g=x.return;while(g)}return x.tag===3?O:null}function o(g){if(g.tag===13){var x=g.memoizedState;if(x===null&&(g=g.alternate,g!==null&&(x=g.memoizedState)),x!==null)return x.dehydrated}return null}function l(g){if(g.tag===31){var x=g.memoizedState;if(x===null&&(g=g.alternate,g!==null&&(x=g.memoizedState)),x!==null)return x.dehydrated}return null}function u(g){if(i(g)!==g)throw Error(s(188))}function d(g){var x=g.alternate;if(!x){if(x=i(g),x===null)throw Error(s(188));return x!==g?null:g}for(var O=g,D=x;;){var P=O.return;if(P===null)break;var B=P.alternate;if(B===null){if(D=P.return,D!==null){O=D;continue}break}if(P.child===B.child){for(B=P.child;B;){if(B===O)return u(P),g;if(B===D)return u(P),x;B=B.sibling}throw Error(s(188))}if(O.return!==D.return)O=P,D=B;else{for(var Y=!1,ie=P.child;ie;){if(ie===O){Y=!0,O=P,D=B;break}if(ie===D){Y=!0,D=P,O=B;break}ie=ie.sibling}if(!Y){for(ie=B.child;ie;){if(ie===O){Y=!0,O=B,D=P;break}if(ie===D){Y=!0,D=B,O=P;break}ie=ie.sibling}if(!Y)throw Error(s(189))}}if(O.alternate!==D)throw Error(s(190))}if(O.tag!==3)throw Error(s(188));return O.stateNode.current===O?g:x}function p(g){var x=g.tag;if(x===5||x===26||x===27||x===6)return g;for(g=g.child;g!==null;){if(x=p(g),x!==null)return x;g=g.sibling}return null}var f=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),k=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),R=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function F(g){return g===null||typeof g!="object"?null:(g=L&&g[L]||g["@@iterator"],typeof g=="function"?g:null)}var M=Symbol.for("react.client.reference");function z(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===M?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case b:return"Fragment";case S:return"Profiler";case v:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList";case j:return"Activity"}if(typeof g=="object")switch(g.$$typeof){case y:return"Portal";case k:return g.displayName||"Context";case w:return(g._context.displayName||"Context")+".Consumer";case _:var x=g.render;return g=g.displayName,g||(g=x.displayName||x.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case A:return x=g.displayName||null,x!==null?x:z(g.type)||"Memo";case N:x=g._payload,g=g._init;try{return z(g(x))}catch{}}return null}var q=Array.isArray,Q=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},$=[],X=-1;function U(g){return{current:g}}function I(g){0>X||(g.current=$[X],$[X]=null,X--)}function H(g,x){X++,$[X]=g.current,g.current=x}var G=U(null),J=U(null),ee=U(null),te=U(null);function se(g,x){switch(H(ee,x),H(J,g),H(G,null),x.nodeType){case 9:case 11:g=(g=x.documentElement)&&(g=g.namespaceURI)?Bge(g):0;break;default:if(g=x.tagName,x=x.namespaceURI)x=Bge(x),g=zge(x,g);else switch(g){case"svg":g=1;break;case"math":g=2;break;default:g=0}}I(G),H(G,g)}function ce(){I(G),I(J),I(ee)}function Se(g){g.memoizedState!==null&&H(te,g);var x=G.current,O=zge(x,g.type);x!==O&&(H(J,g),H(G,O))}function W(g){J.current===g&&(I(G),I(J)),te.current===g&&(I(te),v_._currentValue=Z)}var ne,ae;function ge(g){if(ne===void 0)try{throw Error()}catch(O){var x=O.stack.trim().match(/\n( *(at )?)/);ne=x&&x[1]||"",ae=-1<O.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<O.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+ne+g+ae}var le=!1;function xe(g,x){if(!g||le)return"";le=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var D={DetermineComponentFrameRoot:function(){try{if(x){var at=function(){throw Error()};if(Object.defineProperty(at.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(at,[])}catch(Qe){var Ue=Qe}Reflect.construct(g,[],at)}else{try{at.call()}catch(Qe){Ue=Qe}g.call(at.prototype)}}else{try{throw Error()}catch(Qe){Ue=Qe}(at=g())&&typeof at.catch=="function"&&at.catch(function(){})}}catch(Qe){if(Qe&&Ue&&typeof Qe.stack=="string")return[Qe.stack,Ue.stack]}return[null,null]}};D.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var P=Object.getOwnPropertyDescriptor(D.DetermineComponentFrameRoot,"name");P&&P.configurable&&Object.defineProperty(D.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var B=D.DetermineComponentFrameRoot(),Y=B[0],ie=B[1];if(Y&&ie){var be=Y.split(`
|
|
5
5
|
`),Fe=ie.split(`
|
|
@@ -157,7 +157,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
157
157
|
constructor(\${params}) {
|
|
158
158
|
\${}
|
|
159
159
|
}
|
|
160
|
-
}`,{label:"class",detail:"definition",type:"keyword"}),Zc('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Zc('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],eQe=Uoe.concat([Zc("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Zc("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Zc("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),__e=new nVe,tQe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function P_(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const QZt=["FunctionDeclaration"],GZt={FunctionDeclaration:P_("function"),ClassDeclaration:P_("class"),ClassExpression:()=>!0,EnumDeclaration:P_("constant"),TypeAliasDeclaration:P_("type"),NamespaceDeclaration:P_("namespace"),VariableDefinition(e,t){e.matchContext(QZt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function rQe(e,t){let r=__e.get(t);if(r)return r;let n=[],s=!0;function a(i,o){let l=e.sliceString(i.from,i.to);n.push({label:l,type:o})}return t.cursor(Js.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let o=GZt[i.name];if(o&&o(i,a)||tQe.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of rQe(e,i.node))n.push(o);return!1}}),__e.set(t,n),n}const q3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Voe=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function nQe(e){let t=ba(e.state).resolveInner(e.pos,-1);if(Voe.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&q3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)tQe.has(s.name)&&(n=n.concat(rQe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:q3}}function pG(e,t,r){var n;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:r};if(a?.name=="MemberExpression"&&((n=i=a.lastChild)===null||n===void 0?void 0:n.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function sQe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=ba(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?pG(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?pG(t,r.parent,""):Voe.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&q3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?pG(t,r,""):e.explicit?{path:[],name:""}:null}function ZZt(e,t){let r=[],n=new Set;for(let s=0;;s++){for(let i of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(i)||n.has(i))continue;n.add(i);let o;try{o=e[i]}catch{continue}r.push({label:i,type:typeof o=="function"?/^[A-Z]/.test(i)?"class":t?"function":"method":t?"variable":"property",boost:-s})}let a=Object.getPrototypeOf(e);if(!a)return r;e=a}}function WZt(e){let t=new Map;return r=>{let n=sQe(r);if(!n)return null;let s=e;for(let i of n.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=ZZt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:q3}}}const vp=Q0.define({name:"javascript",parser:HZt.configure({props:[$1.add({IfStatement:iE({except:/^\s*({|else\b)/}),TryStatement:iE({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Hqt,SwitchBody:e=>{let t=e.textAfter,r=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(r?0:n?1:2)*e.unit},Block:qqt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":iE({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),M1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Soe,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),aQe={test:e=>/^JSX/.test(e.name),facet:UL({commentTokens:{block:{open:"{/*",close:"*/}"}}})},qoe=vp.configure({dialect:"ts"},"typescript"),Hoe=vp.configure({dialect:"jsx",props:[boe.add(e=>e.isTop?[aQe]:void 0)]}),Qoe=vp.configure({dialect:"jsx ts",props:[boe.add(e=>e.isTop?[aQe]:void 0)]},"typescript");let iQe=e=>({label:e,type:"keyword"});const oQe="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(iQe),XZt=oQe.concat(["declare","implements","private","protected","public"].map(iQe));function H3(e={}){let t=e.jsx?e.typescript?Qoe:Hoe:e.typescript?qoe:vp,r=e.typescript?eQe.concat(XZt):Uoe.concat(oQe);return new Z0(t,[vp.data.of({autocomplete:DHt(Voe,tHe(r))}),vp.data.of({autocomplete:nQe}),e.jsx?lQe:[]])}function YZt(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function C_e(e,t,r=e.length){for(let n=t?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return e.sliceString(n.from,Math.min(n.to,r));return""}const KZt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),lQe=mt.inputHandler.of((e,t,r,n,s)=>{if((KZt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!vp.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(l=>{var u;let{head:d}=l,p=ba(i).resolveInner(d-1,-1),f;if(p.name=="JSXStartTag"&&(p=p.parent),!(i.doc.sliceString(d-1,d)!=n||p.name=="JSXAttributeValue"&&p.to>d)){if(n==">"&&p.name=="JSXFragmentTag")return{range:l,changes:{from:d,insert:"</>"}};if(n=="/"&&p.name=="JSXStartCloseTag"){let h=p.parent,m=h.parent;if(m&&h.from==d-2&&((f=C_e(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let y=`${f}>`;return{range:Je.cursor(d+y.length,-1),changes:{from:d,insert:y}}}}else if(n==">"){let h=YZt(p);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(f=C_e(i.doc,h,d)))return{range:l,changes:{from:d,insert:`</${f}>`}}}}return{range:l}});return o.changes.empty?!1:(e.dispatch([a,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function JZt(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((r,n)=>{var s;!((s=r.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[n]=2)})),r=>{let{state:n}=r,s=[];for(let{from:a,to:i}of vp.findRegions(n)){let o=n.doc.lineAt(a),l={line:o.number-1,col:a-o.from,pos:a};for(let u of e.verify(n.sliceDoc(a,i),t))s.push(eWt(u,n.doc,l))}return s}}function T_e(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function eWt(e,t,r){let n=T_e(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?T_e(e.endLine,e.endColumn,t,r):n,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:a,text:i}=e.fix,o=a[0]+r.pos-n,l=a[1]+r.pos-n;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+o,to:d+l,insert:i},scrollIntoView:!0})}}]}return s}const y2=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:lQe,completionPath:sQe,esLint:JZt,javascript:H3,javascriptLanguage:vp,jsxLanguage:Hoe,localCompletionSource:nQe,scopeCompletionSource:WZt,snippets:Uoe,tsxLanguage:Qoe,typescriptLanguage:qoe,typescriptSnippets:eQe},Symbol.toStringTag,{value:"Module"})),$_=["_blank","_self","_top","_parent"],fG=["ascii","utf-8","utf-16","latin1","latin1"],hG=["get","post","put","delete"],mG=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Vu=["true","false"],Dr={},tWt={a:{attrs:{href:null,ping:null,type:null,media:null,target:$_,hreflang:null}},abbr:Dr,address:Dr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Dr,aside:Dr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Dr,base:{attrs:{href:null,target:$_}},bdi:Dr,bdo:Dr,blockquote:{attrs:{cite:null}},body:Dr,br:Dr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:mG,formmethod:hG,formnovalidate:["novalidate"],formtarget:$_,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Dr,center:Dr,cite:Dr,code:Dr,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Dr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Dr,div:Dr,dl:Dr,dt:Dr,em:Dr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Dr,figure:Dr,footer:Dr,form:{attrs:{action:null,name:null,"accept-charset":fG,autocomplete:["on","off"],enctype:mG,method:hG,novalidate:["novalidate"],target:$_}},h1:Dr,h2:Dr,h3:Dr,h4:Dr,h5:Dr,h6:Dr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Dr,hgroup:Dr,hr:Dr,html:{attrs:{manifest:null}},i:Dr,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:mG,formmethod:hG,formnovalidate:["novalidate"],formtarget:$_,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Dr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Dr,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Dr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:fG,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Dr,noscript:Dr,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Dr,param:{attrs:{name:null,value:null}},pre:Dr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Dr,rt:Dr,ruby:Dr,samp:Dr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:fG}},section:Dr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Dr,source:{attrs:{src:null,type:null,media:null}},span:Dr,strong:Dr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Dr,summary:Dr,sup:Dr,table:Dr,tbody:Dr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Dr,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Dr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Dr,time:{attrs:{datetime:null}},title:Dr,tr:Dr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Dr,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Dr},cQe={accesskey:null,class:null,contenteditable:Vu,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Vu,autocorrect:Vu,autocapitalize:Vu,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Vu,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Vu,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Vu,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Vu,"aria-hidden":Vu,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Vu,"aria-multiselectable":Vu,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Vu,"aria-relevant":null,"aria-required":Vu,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},uQe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of uQe)cQe[e]=null;let FA=class{constructor(t,r){this.tags={...tWt,...t},this.globalAttrs={...cQe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};FA.default=new FA;function WE(e,t,r=e.length){if(!t)return"";let n=t.firstChild,s=n&&n.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,r)):""}function XE(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function dQe(e,t,r){let n=r.tags[WE(e,XE(t))];return n?.children||r.allTags}function Goe(e,t){let r=[];for(let n=XE(t);n&&!n.type.isTop;n=XE(n.parent)){let s=WE(e,n);if(s&&n.lastChild.name=="CloseTag")break;s&&r.indexOf(s)<0&&(t.name=="EndTag"||t.from>=n.firstChild.to)&&r.push(s)}return r}const pQe=/^[:\-\.\w\u00b7-\uffff]*$/;function A_e(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=XE(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:dQe(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(Goe(e.doc,r).map((o,l)=>({label:"/"+o,apply:"/"+o+a,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function D_e(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Goe(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:pQe}}function rWt(e,t,r,n){let s=[],a=0;for(let i of dQe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Goe(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function nWt(e,t,r,n,s){let a=XE(r),i=a?t.tags[WE(e.doc,a)]:null,o=i&&i.attrs?Object.keys(i.attrs):[],l=i&&i.globalAttrs===!1?o:o.length?o.concat(t.globalAttrNames):t.globalAttrNames;return{from:n,to:s,options:l.map(u=>({label:u,type:"property"})),validFor:pQe}}function sWt(e,t,r,n,s){var a;let i=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),o=[],l;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let p=XE(r),f=p?t.tags[WE(e.doc,p)]:null;d=f?.attrs&&f.attrs[u]}if(d){let p=e.sliceDoc(n,s).toLowerCase(),f='"',h='"';/^['"]/.test(p)?(l=p[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",h=e.sliceDoc(s,s+1)==p[0]?"":p[0],p=p.slice(1),n++):l=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:f+m+h,type:"constant"})}}return{from:n,to:s,options:o,validFor:l}}function fQe(e,t){let{state:r,pos:n}=t,s=ba(r).resolveInner(n,-1),a=s.resolve(n);for(let i=n,o;a==s&&(o=s.childBefore(i));){let l=o.lastChild;if(!l||!l.type.isError||l.from<l.to)break;a=s=o,i=l.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?D_e(r,s,s.from,n):A_e(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?A_e(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?D_e(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?nWt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?sWt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?rWt(r,e,s,n):null}function hQe(e){return fQe(FA.default,e)}function mQe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new FA(t,r):FA.default;return s=>fQe(n,s)}const aWt=vp.parser.configure({top:"SingleExpression"}),gQe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:qoe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Hoe.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Qoe.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:aWt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:vp.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:LA.parser}],yQe=[{name:"style",parser:LA.parser.configure({top:"Styles"})}].concat(uQe.map(e=>({name:e,parser:vp.parser}))),bQe=Q0.define({name:"html",parser:RGt.configure({props:[$1.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,r;for(let n=e.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;t=n=s}return t&&!((r=t.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),M1.add({Element(e){let t=e.firstChild,r=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:r.name=="CloseTag"?r.from:e.to}}}),Zqe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),vT=bQe.configure({wrap:qHe(gQe,yQe)});function vQe(e={}){let t="",r;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=qHe((e.nestedLanguages||[]).concat(gQe),(e.nestedAttributes||[]).concat(yQe)));let n=r?bQe.configure({wrap:r,dialect:t}):t?vT.configure({dialect:t}):vT;return new Z0(n,[vT.data.of({autocomplete:mQe(e)}),e.autoCloseTags!==!1?xQe:[],H3().support,KHe().support])}const N_e=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),xQe=mt.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!vT.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(l=>{var u,d,p;let f=i.doc.sliceString(l.from-1,l.to)==n,{head:h}=l,m=ba(i).resolveInner(h,-1),y;if(f&&n==">"&&m.name=="EndTag"){let b=m.parent;if(((d=(u=b.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(y=WE(i.doc,b.parent,h))&&!N_e.has(y)){let v=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`</${y}>`;return{range:l,changes:{from:h,to:v,insert:S}}}}else if(f&&n=="/"&&m.name=="IncompleteCloseTag"){let b=m.parent;if(m.from==h-2&&((p=b.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(y=WE(i.doc,b,h))&&!N_e.has(y)){let v=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`${y}>`;return{range:Je.cursor(h+S.length,-1),changes:{from:h,to:v,insert:S}}}}return{range:l}});return o.changes.empty?!1:(e.dispatch([a,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),iWt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:xQe,html:vQe,htmlCompletionSource:hQe,htmlCompletionSourceWith:mQe,htmlLanguage:vT},Symbol.toStringTag,{value:"Module"})),SQe=UL({commentTokens:{block:{open:"<!--",close:"-->"}}}),wQe=new fn,EQe=$Qt.configure({props:[M1.add(e=>!e.is("Block")||e.is("Document")||qJ(e)!=null||oWt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),wQe.add(qJ),$1.add({Document:()=>null}),Pb.add({Document:SQe})]});function qJ(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function oWt(e){return e.name=="OrderedList"||e.name=="BulletList"}function lWt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=qJ(n.type))!=null&&s<=t)break;r=n}return r.to}const cWt=$qe.of((e,t,r)=>{for(let n=ba(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(wQe);if(s==null)continue;let a=lWt(n,s);if(a>r)return{from:r,to:a}}return null});function Zoe(e){return new ad(SQe,e,[],"markdown")}const kQe=Zoe(EQe),uWt=EQe.configure([GQt,WQt,ZQt,XQt,{props:[M1.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),Y0=Zoe(uWt);function dWt(e,t){return r=>{if(r&&e){let n=null;if(r=/\S*/.exec(r)[0],typeof e=="function"?n=e(r):n=He.matchLanguageName(e,r,!0),n instanceof He)return n.support?n.support.language.parser:G0.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class gG{constructor(t,r,n,s,a,i,o){this.node=t,this.from=r,this.to=n,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=o}blank(t,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;n.length<t;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(t,r){let n=this.node.name=="OrderedList"?String(+_Qe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function OQe(e,t){let r=[],n=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&r.push(s)}for(let s=r.length-1;s>=0;s--){let a=r[s],i,o=t.lineAt(a.from),l=a.from-o.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(o.text.slice(l))))n.push(new gG(a,l,l+i[0].length,"",i[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(o.text.slice(l)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new gG(a.parent,l,l+d,i[1],u,i[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(l)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let p=i[2];i[3]&&(p+=i[3].replace(/[xX]/," ")),n.push(new gG(a.parent,l,l+d,i[1],u,p,a))}}return n}function _Qe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function yG(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let o=_Qe(a,t),l=+o[2];if(s>=0){if(l!=s+1)return;r.push({from:a.from+o[1].length,to:a.from+o[0].length,insert:String(s+2+n)})}s=l}let i=a.nextSibling;if(!i)break;a=i}}function Woe(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(nO)!=" ")return e;let n=Mf(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const CQe=(e={})=>({state:t,dispatch:r})=>{let n=ba(t),{doc:s}=t,a=null,i=t.changeByRange(o=>{if(!o.empty||!Y0.isActiveAt(t,o.from,-1)&&!Y0.isActiveAt(t,o.from,1))return a={range:o};let l=o.from,u=s.lineAt(l),d=OQe(n.resolveInner(l,-1),s);for(;d.length&&d[d.length-1].from>l-u.from;)d.pop();if(!d.length)return a={range:o};let p=d[d.length-1];if(p.to-p.spaceAfter.length>l-u.from)return a={range:o};let f=l>=p.to-p.spaceAfter.length&&!/\S/.test(u.text.slice(p.to));if(p.item&&f){let v=p.node.firstChild,S=p.node.getChild("ListItem","ListItem");if(v.to>=l||S&&S.to<l||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||e.nonTightLists===!1){let w=d.length>1?d[d.length-2]:null,k,_="";w&&w.item?(k=u.from+w.from,_=w.marker(s,1)):k=u.from+(w?w.to:0);let C=[{from:k,to:l,insert:_}];return p.node.name=="OrderedList"&&yG(p.item,s,C,-2),w&&w.node.name=="OrderedList"&&yG(w.item,s,C),{range:Je.cursor(k+_.length),changes:C}}else{let w=j_e(d,t,u);return{range:Je.cursor(l+w.length+1),changes:{from:u.from,insert:w+t.lineBreak}}}}if(p.node.name=="Blockquote"&&f&&u.from){let v=s.lineAt(u.from-1),S=/>\s*$/.exec(v.text);if(S&&S.index==p.from){let w=t.changes([{from:v.from+S.index,to:v.to},{from:u.from+p.from,to:u.to}]);return{range:o.map(w),changes:w}}}let h=[];p.node.name=="OrderedList"&&yG(p.item,s,h);let m=p.item&&p.item.from<u.from,y="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=p.to)for(let v=0,S=d.length-1;v<=S;v++)y+=v==S&&!m?d[v].marker(s,1):d[v].blank(v<S?Mf(u.text,4,d[v+1].from)-y.length:null);let b=l;for(;b>u.from&&/\s/.test(u.text.charAt(b-u.from-1));)b--;return y=Woe(y,t),pWt(p.node,t.doc)&&(y=j_e(d,t,u)+t.lineBreak+y),h.push({from:b,to:l,insert:t.lineBreak+y}),{range:Je.cursor(b+y.length+1),changes:h}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},TQe=CQe();function I_e(e){return e.name=="QuoteMark"||e.name=="ListMark"}function pWt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let r=e.firstChild,n=e.getChild("ListItem","ListItem");if(!n)return!1;let s=t.lineAt(r.to),a=t.lineAt(n.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function j_e(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Mf(r.text,4,e[s+1].from)-n.length:null,s<a);return Woe(n,t)}function fWt(e,t){let r=e.resolveInner(t,-1),n=t;I_e(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(I_e(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const AQe=({state:e,dispatch:t})=>{let r=ba(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:o}=e;if(a.empty&&Y0.isActiveAt(e,a.from)){let l=o.lineAt(i),u=OQe(fWt(r,i),o);if(u.length){let d=u[u.length-1],p=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-l.from>p&&!/\S/.test(l.text.slice(p,i-l.from)))return{range:Je.cursor(l.from+p),changes:{from:l.from+p,to:i}};if(i-l.from==p&&(!d.item||l.from<=d.item.from||!/\S/.test(l.text.slice(0,d.to)))){let f=l.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(l.text.slice(d.from,d.to))){let h=d.blank(Mf(l.text,4,d.to)-Mf(l.text,4,d.from));return f==l.from&&(h=Woe(h,e)),{range:Je.cursor(f+h.length),changes:{from:f,to:l.from+d.to,insert:h}}}if(f<i)return{range:Je.cursor(f),changes:{from:f,to:i}}}}}return n={range:a}});return n?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},DQe=[{key:"Enter",run:TQe},{key:"Backspace",run:AQe}],NQe=vQe({matchClosingTags:!1});function Xoe(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=kQe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=NQe}=e;if(!(s instanceof QL))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=e.extensions?[e.extensions]:[],u=[o.support,cWt],d;i&&u.push(IQe),r instanceof Z0?(u.push(r.support),d=r.language):r&&(d=r);let p=t||d?dWt(t,d):void 0;l.push(LQt({codeParser:p,htmlParser:o.language.parser})),n&&u.push(Wf.high(rO.of(DQe)));let f=Zoe(s.configure(l));return a&&u.push(f.data.of({autocomplete:hWt})),new Z0(f,u)}function hWt(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=ba(t).resolveInner(r,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:r-n[0].length,to:r,options:mWt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let bG=null;function mWt(){if(bG)return bG;let e=hQe(new Coe(Zn.create({extensions:NQe}),0,!0));return bG=e?e.options:[]}const gWt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,IQe=mt.domEventHandlers({paste:(e,t)=>{var r;let{main:n}=t.state.selection;if(n.empty)return!1;let s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!Y0.isActiveAt(t.state,n.from,1)))return!1;let a=ba(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:o=>{(o.from>n.from||gWt.test(o.name))&&(i=!0)},leave:o=>{o.to<n.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),yWt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:kQe,deleteMarkupBackward:AQe,insertNewlineContinueMarkup:TQe,insertNewlineContinueMarkupCommand:CQe,markdown:Xoe,markdownKeymap:DQe,markdownLanguage:Y0,pasteURLAsLink:IQe},Symbol.toStringTag,{value:"Module"}));function ct(e){return new Z0(Eoe.define(e))}function tb(e){return Ge(()=>import("./index-D0q761D_.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const jQe=[He.of({name:"C",extensions:["c","h","ino"],load(){return Ge(()=>import("./index-DEpD2Jfv.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),He.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ge(()=>import("./index-DEpD2Jfv.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),He.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return tb("Cassandra")}}),He.of({name:"CSS",extensions:["css"],load(){return Ge(()=>Promise.resolve().then(()=>hZt),void 0,import.meta.url).then(e=>e.css())}}),He.of({name:"Go",extensions:["go"],load(){return Ge(()=>import("./index-CAa0LkPQ.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),He.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ge(()=>Promise.resolve().then(()=>iWt),void 0,import.meta.url).then(e=>e.html())}}),He.of({name:"Java",extensions:["java"],load(){return Ge(()=>import("./index-CK-Rhk5D.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),He.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ge(()=>Promise.resolve().then(()=>y2),void 0,import.meta.url).then(e=>e.javascript())}}),He.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ge(()=>import("./index-DU4KNmGl.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),He.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ge(()=>Promise.resolve().then(()=>THt),void 0,import.meta.url).then(e=>e.json())}}),He.of({name:"JSX",extensions:["jsx"],load(){return Ge(()=>Promise.resolve().then(()=>y2),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),He.of({name:"LESS",extensions:["less"],load(){return Ge(()=>import("./index-Blz1NRPV.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),He.of({name:"Liquid",extensions:["liquid"],load(){return Ge(()=>import("./index-EuikVAsT.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),He.of({name:"MariaDB SQL",load(){return tb("MariaSQL")}}),He.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ge(()=>Promise.resolve().then(()=>yWt),void 0,import.meta.url).then(e=>e.markdown())}}),He.of({name:"MS SQL",load(){return tb("MSSQL")}}),He.of({name:"MySQL",load(){return tb("MySQL")}}),He.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ge(()=>import("./index-CxDXyU75.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),He.of({name:"PLSQL",extensions:["pls"],load(){return tb("PLSQL")}}),He.of({name:"PostgreSQL",load(){return tb("PostgreSQL")}}),He.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ge(()=>import("./index-DhD27KDZ.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),He.of({name:"Rust",extensions:["rs"],load(){return Ge(()=>import("./index-C1ViNSxz.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),He.of({name:"Sass",extensions:["sass"],load(){return Ge(()=>import("./index-BmlTAJsW.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),He.of({name:"SCSS",extensions:["scss"],load(){return Ge(()=>import("./index-BmlTAJsW.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),He.of({name:"SQL",extensions:["sql"],load(){return tb("StandardSQL")}}),He.of({name:"SQLite",load(){return tb("SQLite")}}),He.of({name:"TSX",extensions:["tsx"],load(){return Ge(()=>Promise.resolve().then(()=>y2),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),He.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ge(()=>Promise.resolve().then(()=>y2),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),He.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ge(()=>import("./index-DHKhLHm8.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),He.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ge(()=>import("./index-Dn7Rt2wz.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),He.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ge(()=>import("./index-DzGV1Iz6.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),He.of({name:"APL",extensions:["dyalog","apl"],load(){return Ge(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>ct(e.apl))}}),He.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ge(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>ct(e.asciiArmor))}}),He.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ge(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>ct(e.asn1({})))}}),He.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ge(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>ct(e.asterisk))}}),He.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ge(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>ct(e.brainfuck))}}),He.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ge(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>ct(e.cobol))}}),He.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.csharp))}}),He.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"ClojureScript",extensions:["cljs"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ge(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>ct(e.gss))}}),He.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ge(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>ct(e.cmake))}}),He.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ge(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>ct(e.coffeeScript))}}),He.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ge(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>ct(e.commonLisp))}}),He.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ge(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>ct(e.cypher))}}),He.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ge(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>ct(e.cython))}}),He.of({name:"Crystal",extensions:["cr"],load(){return Ge(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>ct(e.crystal))}}),He.of({name:"D",extensions:["d"],load(){return Ge(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>ct(e.d))}}),He.of({name:"Dart",extensions:["dart"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.dart))}}),He.of({name:"diff",extensions:["diff","patch"],load(){return Ge(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>ct(e.diff))}}),He.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ge(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>ct(e.dockerFile))}}),He.of({name:"DTD",extensions:["dtd"],load(){return Ge(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>ct(e.dtd))}}),He.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ge(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>ct(e.dylan))}}),He.of({name:"EBNF",load(){return Ge(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>ct(e.ebnf))}}),He.of({name:"ECL",extensions:["ecl"],load(){return Ge(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>ct(e.ecl))}}),He.of({name:"edn",extensions:["edn"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"Eiffel",extensions:["e"],load(){return Ge(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>ct(e.eiffel))}}),He.of({name:"Elm",extensions:["elm"],load(){return Ge(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>ct(e.elm))}}),He.of({name:"Erlang",extensions:["erl"],load(){return Ge(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>ct(e.erlang))}}),He.of({name:"Esper",load(){return Ge(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>ct(e.esper))}}),He.of({name:"Factor",extensions:["factor"],load(){return Ge(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>ct(e.factor))}}),He.of({name:"FCL",load(){return Ge(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>ct(e.fcl))}}),He.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ge(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>ct(e.forth))}}),He.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ge(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>ct(e.fortran))}}),He.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.fSharp))}}),He.of({name:"Gas",extensions:["s"],load(){return Ge(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>ct(e.gas))}}),He.of({name:"Gherkin",extensions:["feature"],load(){return Ge(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>ct(e.gherkin))}}),He.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ge(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>ct(e.groovy))}}),He.of({name:"Haskell",extensions:["hs"],load(){return Ge(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>ct(e.haskell))}}),He.of({name:"Haxe",extensions:["hx"],load(){return Ge(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.haxe))}}),He.of({name:"HXML",extensions:["hxml"],load(){return Ge(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.hxml))}}),He.of({name:"HTTP",load(){return Ge(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>ct(e.http))}}),He.of({name:"IDL",extensions:["pro"],load(){return Ge(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>ct(e.idl))}}),He.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ge(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>ct(e.jsonld))}}),He.of({name:"Julia",extensions:["jl"],load(){return Ge(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>ct(e.julia))}}),He.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.kotlin))}}),He.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ge(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>ct(e.liveScript))}}),He.of({name:"Lua",extensions:["lua"],load(){return Ge(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>ct(e.lua))}}),He.of({name:"mIRC",extensions:["mrc"],load(){return Ge(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>ct(e.mirc))}}),He.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ge(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>ct(e.mathematica))}}),He.of({name:"Modelica",extensions:["mo"],load(){return Ge(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>ct(e.modelica))}}),He.of({name:"MUMPS",extensions:["mps"],load(){return Ge(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>ct(e.mumps))}}),He.of({name:"Mbox",extensions:["mbox"],load(){return Ge(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>ct(e.mbox))}}),He.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ge(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>ct(e.nginx))}}),He.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ge(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>ct(e.nsis))}}),He.of({name:"NTriples",extensions:["nt","nq"],load(){return Ge(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>ct(e.ntriples))}}),He.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.objectiveC))}}),He.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.objectiveCpp))}}),He.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.oCaml))}}),He.of({name:"Octave",extensions:["m"],load(){return Ge(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>ct(e.octave))}}),He.of({name:"Oz",extensions:["oz"],load(){return Ge(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>ct(e.oz))}}),He.of({name:"Pascal",extensions:["p","pas"],load(){return Ge(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>ct(e.pascal))}}),He.of({name:"Perl",extensions:["pl","pm"],load(){return Ge(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>ct(e.perl))}}),He.of({name:"Pig",extensions:["pig"],load(){return Ge(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>ct(e.pig))}}),He.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ge(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>ct(e.powerShell))}}),He.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ge(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>ct(e.properties))}}),He.of({name:"ProtoBuf",extensions:["proto"],load(){return Ge(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>ct(e.protobuf))}}),He.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ge(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>ct(e.pug))}}),He.of({name:"Puppet",extensions:["pp"],load(){return Ge(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>ct(e.puppet))}}),He.of({name:"Q",extensions:["q"],load(){return Ge(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>ct(e.q))}}),He.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ge(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>ct(e.r))}}),He.of({name:"RPM Changes",load(){return Ge(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ct(e.rpmChanges))}}),He.of({name:"RPM Spec",extensions:["spec"],load(){return Ge(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ct(e.rpmSpec))}}),He.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ge(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>ct(e.ruby))}}),He.of({name:"SAS",extensions:["sas"],load(){return Ge(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>ct(e.sas))}}),He.of({name:"Scala",extensions:["scala"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.scala))}}),He.of({name:"Scheme",extensions:["scm","ss"],load(){return Ge(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>ct(e.scheme))}}),He.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ge(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>ct(e.shell))}}),He.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ge(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>ct(e.sieve))}}),He.of({name:"Smalltalk",extensions:["st"],load(){return Ge(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>ct(e.smalltalk))}}),He.of({name:"Solr",load(){return Ge(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>ct(e.solr))}}),He.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.sml))}}),He.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ge(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>ct(e.sparql))}}),He.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ge(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>ct(e.spreadsheet))}}),He.of({name:"Squirrel",extensions:["nut"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.squirrel))}}),He.of({name:"Stylus",extensions:["styl"],load(){return Ge(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>ct(e.stylus))}}),He.of({name:"Swift",extensions:["swift"],load(){return Ge(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>ct(e.swift))}}),He.of({name:"sTeX",load(){return Ge(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),He.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ge(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),He.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ge(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),He.of({name:"Tcl",extensions:["tcl"],load(){return Ge(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>ct(e.tcl))}}),He.of({name:"Textile",extensions:["textile"],load(){return Ge(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>ct(e.textile))}}),He.of({name:"TiddlyWiki",load(){return Ge(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>ct(e.tiddlyWiki))}}),He.of({name:"Tiki wiki",load(){return Ge(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>ct(e.tiki))}}),He.of({name:"TOML",extensions:["toml"],load(){return Ge(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>ct(e.toml))}}),He.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ge(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>ct(e.troff))}}),He.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ge(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>ct(e.ttcn))}}),He.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ge(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>ct(e.ttcnCfg))}}),He.of({name:"Turtle",extensions:["ttl"],load(){return Ge(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>ct(e.turtle))}}),He.of({name:"Web IDL",extensions:["webidl"],load(){return Ge(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>ct(e.webIDL))}}),He.of({name:"VB.NET",extensions:["vb"],load(){return Ge(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>ct(e.vb))}}),He.of({name:"VBScript",extensions:["vbs"],load(){return Ge(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>ct(e.vbScript))}}),He.of({name:"Velocity",extensions:["vtl"],load(){return Ge(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>ct(e.velocity))}}),He.of({name:"Verilog",extensions:["v"],load(){return Ge(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),He.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ge(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>ct(e.vhdl))}}),He.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ge(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>ct(e.xQuery))}}),He.of({name:"Yacas",extensions:["ys"],load(){return Ge(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>ct(e.yacas))}}),He.of({name:"Z80",extensions:["z80"],load(){return Ge(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>ct(e.z80))}}),He.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.mscgen))}}),He.of({name:"Xù",extensions:["xu"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.xu))}}),He.of({name:"MsGenny",extensions:["msgenny"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.msgenny))}}),He.of({name:"Vue",extensions:["vue"],load(){return Ge(()=>import("./index-PaoSb2RY.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),He.of({name:"Angular Template",load(){return Ge(()=>import("./index-C7caMlfs.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];var Yoe=e=>{var{theme:t,settings:r={},styles:n=[]}=e,s={".cm-gutters":{}},a={};r.background&&(a.backgroundColor=r.background),r.backgroundImage&&(a.backgroundImage=r.backgroundImage),r.foreground&&(a.color=r.foreground),r.fontSize&&(a.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=a),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var i={};r.gutterActiveForeground&&(i.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},i.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=i,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var o=mt.theme(s,{dark:t==="dark"}),l=sO.define(n),u=[o,woe(l)];return u},bWt={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},vWt=[{tag:re.comment,color:"#6272a4"},{tag:re.string,color:"#f1fa8c"},{tag:re.atom,color:"#bd93f9"},{tag:re.meta,color:"#f8f8f2"},{tag:[re.keyword,re.operator,re.tagName],color:"#ff79c6"},{tag:[re.function(re.propertyName),re.propertyName],color:"#66d9ef"},{tag:[re.definition(re.variableName),re.function(re.variableName),re.className,re.attributeName],color:"#50fa7b"},{tag:re.atom,color:"#bd93f9"}],GL=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return Yoe({theme:t,settings:lm({},bWt,r),styles:[...vWt,...n]})};GL();const xWt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Joe(e.state,r.from);return n.line?SWt(e):n.block?EWt(e):!1};function Koe(e,t){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let s=e(t,r);return s?(n(r.update(s)),!0):!1}}const SWt=Koe(_Wt,0),wWt=Koe(RQe,0),EWt=Koe((e,t)=>RQe(e,t,OWt(t)),0);function Joe(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const M_=50;function kWt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-M_,n),i=e.sliceDoc(s,s+M_),o=/\s*$/.exec(a)[0].length,l=/^\s*/.exec(i)[0].length,u=a.length-o;if(a.slice(u-t.length,u)==t&&i.slice(l,l+r.length)==r)return{open:{pos:n-o,margin:o&&1},close:{pos:s+l,margin:l&&1}};let d,p;s-n<=2*M_?d=p=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+M_),p=e.sliceDoc(s-M_,s));let f=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(p)[0].length,m=p.length-h-r.length;return d.slice(f,f+t.length)==t&&p.slice(m,m+r.length)==r?{open:{pos:n+f+t.length,margin:/\s/.test(d.charAt(f+t.length))?1:0},close:{pos:s-h-r.length,margin:/\s/.test(p.charAt(m-1))?1:0}}:null}function OWt(e){let t=[];for(let r of e.selection.ranges){let n=e.doc.lineAt(r.from),s=r.to<=n.to?n:e.doc.lineAt(r.to);s.from>n.from&&s.from==r.to&&(s=r.to==n.to+1?n:e.doc.lineAt(r.to-1));let a=t.length-1;a>=0&&t[a].to>n.from?t[a].to=s.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return t}function RQe(e,t,r=t.selection.ranges){let n=r.map(a=>Joe(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>kWt(t,n[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(r.map((a,i)=>s[i]?[]:[{from:a.from,insert:n[i].open+" "},{from:a.to,insert:" "+n[i].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let i=0,o;i<s.length;i++)if(o=s[i]){let l=n[i],{open:u,close:d}=o;a.push({from:u.pos-l.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+l.close.length})}return{changes:a}}return null}function _Wt(e,t,r=t.selection.ranges){let n=[],s=-1;for(let{from:a,to:i}of r){let o=n.length,l=1e9,u=Joe(t,a).line;if(u){for(let d=a;d<=i;){let p=t.doc.lineAt(d);if(p.from>s&&(a==i||i>p.from)){s=p.from;let f=/^\s*/.exec(p.text)[0].length,h=f==p.length,m=p.text.slice(f,f+u.length)==u?f:-1;f<p.text.length&&f<l&&(l=f),n.push({line:p,comment:m,token:u,indent:f,empty:h,single:!1})}d=p.to+1}if(l<1e9)for(let d=o;d<n.length;d++)n[d].indent<n[d].line.text.length&&(n[d].indent=l);n.length==o+1&&(n[o].single=!0)}}if(e!=2&&n.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:o,token:l,indent:u,empty:d,single:p}of n)(p||!d)&&a.push({from:o.from+u,insert:l+" "});let i=t.changes(a);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:o,token:l}of n)if(o>=0){let u=i.from+o,d=u+l.length;i.text[d-i.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const HJ=Tm.define(),CWt=Tm.define(),TWt=Xt.define(),PQe=Xt.define({combine(e){return Am(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,r)=>(n,s)=>t(n,s)||r(n,s)})}}),$Qe=Ki.define({create(){return zh.empty},update(e,t){let r=t.state.facet(PQe),n=t.annotation(HJ);if(n){let l=cu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return l?d=Q3(d,d.length,r.minDepth,l):d=FQe(d,t.startState.selection),new zh(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(CWt);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(uo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=cu.fromTransaction(t),i=t.annotation(uo.time),o=t.annotation(uo.userEvent);return a?e=e.addChanges(a,i,o,r,t):t.selection&&(e=e.addSelection(t.startState.selection,i,o,r.newGroupDelay)),(s=="full"||s=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new zh(e.done.map(cu.fromJSON),e.undone.map(cu.fromJSON))}});function AWt(e={}){return[$Qe,PQe.of(e),mt.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?MQe:t.inputType=="historyRedo"?QJ:null;return n?(t.preventDefault(),n(r)):!1}})]}function ZL(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field($Qe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const MQe=ZL(0,!1),QJ=ZL(1,!1),DWt=ZL(0,!0),NWt=ZL(1,!0);class cu{constructor(t,r,n,s,a){this.changes=t,this.effects=r,this.mapped=n,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new cu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,r,n;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new cu(t.changes&&ao.fromJSON(t.changes),[],t.mapped&&Yh.fromJSON(t.mapped),t.startSelection&&Je.fromJSON(t.startSelection),t.selectionsAfter.map(Je.fromJSON))}static fromTransaction(t,r){let n=fp;for(let s of t.startState.facet(TWt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new cu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,fp)}static selection(t){return new cu(void 0,fp,void 0,void 0,t)}}function Q3(e,t,r,n){let s=t+1>r+20?t-r-1:0,a=e.slice(s,t);return a.push(n),a}function IWt(e,t){let r=[],n=!1;return e.iterChangedRanges((s,a)=>r.push(s,a)),t.iterChangedRanges((s,a,i,o)=>{for(let l=0;l<r.length;){let u=r[l++],d=r[l++];o>=u&&i<=d&&(n=!0)}}),n}function jWt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function LQe(e,t){return e.length?t.length?e.concat(t):e:t}const fp=[],RWt=200;function FQe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-RWt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),Q3(e,e.length-1,1e9,r.setSelAfter(n)))}else return[cu.selection([t])]}function PWt(e){let t=e[e.length-1],r=e.slice();return r[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),r}function vG(e,t){if(!e.length)return e;let r=e.length,n=fp;for(;r;){let s=$Wt(e[r-1],t,n);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,r);return a[r-1]=s,a}else t=s.mapped,r--,n=s.selectionsAfter}return n.length?[cu.selection(n)]:fp}function $Wt(e,t,r){let n=LQe(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):fp,r);if(!e.changes)return cu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new cu(s,en.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const MWt=/^(input\.type|delete)($|\.)/;class zh{constructor(t,r,n=0,s=void 0){this.done=t,this.undone=r,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new zh(this.done,this.undone):this}addChanges(t,r,n,s,a){let i=this.done,o=i[i.length-1];return o&&o.changes&&!o.changes.empty&&t.changes&&(!n||MWt.test(n))&&(!o.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,IWt(o.changes,t.changes))||n=="input.type.compose")?i=Q3(i,i.length-1,s.minDepth,new cu(t.changes.compose(o.changes),LQe(en.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,fp)):i=Q3(i,i.length,s.minDepth,t),new zh(i,fp,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:fp;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&jWt(a[a.length-1],t)?this:new zh(FQe(this.done,t),this.undone,r,n)}addMapping(t){return new zh(vG(this.done,t),vG(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,r,n){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],i=a.selectionsAfter[0]||r.selection;if(n&&a.selectionsAfter.length)return r.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:HJ.of({side:t,rest:PWt(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let o=s.length==1?fp:s.slice(0,s.length-1);return a.mapped&&(o=vG(o,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:HJ.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}zh.empty=new zh(fp,fp);const LWt=[{key:"Mod-z",run:MQe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:QJ,preventDefault:!0},{linux:"Ctrl-Shift-z",run:QJ,preventDefault:!0},{key:"Mod-u",run:DWt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:NWt,preventDefault:!0}];function iO(e,t){return Je.create(e.ranges.map(t),e.mainIndex)}function Xf(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Yf({state:e,dispatch:t},r){let n=iO(e.selection,r);return n.eq(e.selection,!0)?!1:(t(Xf(e,n)),!0)}function WL(e,t){return Je.cursor(t?e.to:e.from)}function BQe(e,t){return Yf(e,r=>r.empty?e.moveByChar(r,t):WL(r,t))}function rc(e){return e.textDirectionAt(e.state.selection.main.head)==Oa.LTR}const zQe=e=>BQe(e,!rc(e)),UQe=e=>BQe(e,rc(e));function VQe(e,t){return Yf(e,r=>r.empty?e.moveByGroup(r,t):WL(r,t))}const FWt=e=>VQe(e,!rc(e)),BWt=e=>VQe(e,rc(e));function zWt(e,t,r){if(t.type.prop(r))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function XL(e,t,r){let n=ba(e).resolveInner(t.head),s=r?fn.closedBy:fn.openedBy;for(let l=t.head;;){let u=r?n.childAfter(l):n.childBefore(l);if(!u)break;zWt(e,u,s)?n=u:l=r?u.to:u.from}let a=n.type.prop(s),i,o;return a&&(i=r?Bh(e,n.from,1):Bh(e,n.to,-1))&&i.matched?o=r?i.end.to:i.end.from:o=r?n.to:n.from,Je.cursor(o,r?-1:1)}const UWt=e=>Yf(e,t=>XL(e.state,t,!rc(e))),VWt=e=>Yf(e,t=>XL(e.state,t,rc(e)));function qQe(e,t){return Yf(e,r=>{if(!r.empty)return WL(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const HQe=e=>qQe(e,!1),QQe=e=>qQe(e,!0);function GQe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,s;if(t){for(let a of e.state.facet(mt.scrollMargins)){let i=a(e);i?.top&&(r=Math.max(i?.top,r)),i?.bottom&&(n=Math.max(i?.bottom,n))}s=e.scrollDOM.clientHeight-r-n}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function ZQe(e,t){let r=GQe(e),{state:n}=e,s=iO(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):WL(i,t));if(s.eq(n.selection))return!1;let a;if(r.selfScroll){let i=e.coordsAtPos(n.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),l=o.top+r.marginTop,u=o.bottom-r.marginBottom;i&&i.top>l&&i.bottom<u&&(a=mt.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-l}))}return e.dispatch(Xf(n,s),{effects:a}),!0}const R_e=e=>ZQe(e,!1),GJ=e=>ZQe(e,!0);function Uv(e,t,r){let n=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,r);if(s.head==t.head&&s.head!=(r?n.to:n.from)&&(s=e.moveToLineBoundary(t,r,!1)),!r&&s.head==n.from&&n.length){let a=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;a&&t.head!=n.from+a&&(s=Je.cursor(n.from+a))}return s}const qWt=e=>Yf(e,t=>Uv(e,t,!0)),HWt=e=>Yf(e,t=>Uv(e,t,!1)),QWt=e=>Yf(e,t=>Uv(e,t,!rc(e))),GWt=e=>Yf(e,t=>Uv(e,t,rc(e))),ZWt=e=>Yf(e,t=>Je.cursor(e.lineBlockAt(t.head).from,1)),WWt=e=>Yf(e,t=>Je.cursor(e.lineBlockAt(t.head).to,-1));function XWt(e,t,r){let n=!1,s=iO(e.selection,a=>{let i=Bh(e,a.head,-1)||Bh(e,a.head,1)||a.head>0&&Bh(e,a.head-1,1)||a.head<e.doc.length&&Bh(e,a.head+1,-1);if(!i||!i.end)return a;n=!0;let o=i.start.from==a.head?i.end.to:i.end.from;return Je.cursor(o)});return n?(t(Xf(e,s)),!0):!1}const YWt=({state:e,dispatch:t})=>XWt(e,t);function zp(e,t){let r=iO(e.state.selection,n=>{let s=t(n);return Je.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return r.eq(e.state.selection)?!1:(e.dispatch(Xf(e.state,r)),!0)}function WQe(e,t){return zp(e,r=>e.moveByChar(r,t))}const XQe=e=>WQe(e,!rc(e)),YQe=e=>WQe(e,rc(e));function KQe(e,t){return zp(e,r=>e.moveByGroup(r,t))}const KWt=e=>KQe(e,!rc(e)),JWt=e=>KQe(e,rc(e)),eXt=e=>zp(e,t=>XL(e.state,t,!rc(e))),tXt=e=>zp(e,t=>XL(e.state,t,rc(e)));function JQe(e,t){return zp(e,r=>e.moveVertically(r,t))}const eGe=e=>JQe(e,!1),tGe=e=>JQe(e,!0);function rGe(e,t){return zp(e,r=>e.moveVertically(r,t,GQe(e).height))}const P_e=e=>rGe(e,!1),$_e=e=>rGe(e,!0),rXt=e=>zp(e,t=>Uv(e,t,!0)),nXt=e=>zp(e,t=>Uv(e,t,!1)),sXt=e=>zp(e,t=>Uv(e,t,!rc(e))),aXt=e=>zp(e,t=>Uv(e,t,rc(e))),iXt=e=>zp(e,t=>Je.cursor(e.lineBlockAt(t.head).from)),oXt=e=>zp(e,t=>Je.cursor(e.lineBlockAt(t.head).to)),M_e=({state:e,dispatch:t})=>(t(Xf(e,{anchor:0})),!0),L_e=({state:e,dispatch:t})=>(t(Xf(e,{anchor:e.doc.length})),!0),F_e=({state:e,dispatch:t})=>(t(Xf(e,{anchor:e.selection.main.anchor,head:0})),!0),B_e=({state:e,dispatch:t})=>(t(Xf(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),lXt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),cXt=({state:e,dispatch:t})=>{let r=YL(e).map(({from:n,to:s})=>Je.range(n,Math.min(s+1,e.doc.length)));return t(e.update({selection:Je.create(r),userEvent:"select"})),!0},uXt=({state:e,dispatch:t})=>{let r=iO(e.selection,n=>{let s=ba(e),a=s.resolveStack(n.from,1);if(n.empty){let i=s.resolveStack(n.from,-1);i.node.from>=a.node.from&&i.node.to<=a.node.to&&(a=i)}for(let i=a;i;i=i.next){let{node:o}=i;if((o.from<n.from&&o.to>=n.to||o.to>n.to&&o.from<=n.from)&&i.next)return Je.range(o.to,o.from)}return n});return r.eq(e.selection)?!1:(t(Xf(e,r)),!0)};function nGe(e,t){let{state:r}=e,n=r.selection,s=r.selection.ranges.slice();for(let a of r.selection.ranges){let i=r.doc.lineAt(a.head);if(t?i.to<e.state.doc.length:i.from>0)for(let o=a;;){let l=e.moveVertically(o,t);if(l.head<i.from||l.head>i.to){s.some(u=>u.head==l.head)||s.push(l);break}else{if(l.head==o.head)break;o=l}}}return s.length==n.ranges.length?!1:(e.dispatch(Xf(r,Je.create(s,s.length-1))),!0)}const dXt=e=>nGe(e,!1),pXt=e=>nGe(e,!0),fXt=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=Je.create([r.main]):r.main.empty||(n=Je.create([Je.cursor(r.main.head)])),n?(t(Xf(e,n)),!0):!1};function gI(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,s=n.changeByRange(a=>{let{from:i,to:o}=a;if(i==o){let l=t(a);l<i?(r="delete.backward",l=b2(e,l,!1)):l>i&&(r="delete.forward",l=b2(e,l,!0)),i=Math.min(i,l),o=Math.max(o,l)}else i=b2(e,i,!1),o=b2(e,o,!0);return i==o?{range:a}:{changes:{from:i,to:o},range:Je.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(n.update(s,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?mt.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function b2(e,t,r){if(e instanceof mt)for(let n of e.state.facet(mt.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const sGe=(e,t,r)=>gI(e,n=>{let s=n.from,{state:a}=e,i=a.doc.lineAt(s),o,l;if(r&&!t&&s>i.from&&s<i.from+200&&!/[^ \t]/.test(o=i.text.slice(0,s-i.from))){if(o[o.length-1]==" ")return s-1;let u=Mf(o,a.tabSize),d=u%W0(a)||W0(a);for(let p=0;p<d&&o[o.length-1-p]==" ";p++)s--;l=s}else l=Qo(i.text,s-i.from,t,t)+i.from,l==s&&i.number!=(t?a.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(l-i.from,s-i.from))&&(l=Qo(i.text,l-i.from,!1,!1)+i.from);return l}),ZJ=e=>sGe(e,!1,!0),aGe=e=>sGe(e,!0,!1),iGe=(e,t)=>gI(e,r=>{let n=r.head,{state:s}=e,a=s.doc.lineAt(n),i=s.charCategorizer(n);for(let o=null;;){if(n==(t?a.to:a.from)){n==r.head&&a.number!=(t?s.doc.lines:1)&&(n+=t?1:-1);break}let l=Qo(a.text,n-a.from,t)+a.from,u=a.text.slice(Math.min(n,l)-a.from,Math.max(n,l)-a.from),d=i(u);if(o!=null&&d!=o)break;(u!=" "||n!=r.head)&&(o=d),n=l}return n}),oGe=e=>iGe(e,!1),hXt=e=>iGe(e,!0),mXt=e=>gI(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),gXt=e=>gI(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),yXt=e=>gI(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),bXt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:ws.of(["",""])},range:Je.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},vXt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let s=n.from,a=e.doc.lineAt(s),i=s==a.from?s-1:Qo(a.text,s-a.from,!1)+a.from,o=s==a.to?s+1:Qo(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:o,insert:e.doc.slice(s,o).append(e.doc.slice(i,s))},range:Je.cursor(o)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function YL(e){let t=[],r=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.from),a=e.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=e.doc.lineAt(n.to-1)),r>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(n)}else t.push({from:s.from,to:a.to,ranges:[n]});r=a.number+1}return t}function lGe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of YL(e)){if(r?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(r?a.to+1:a.from-1),o=i.length+1;if(r){n.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let l of a.ranges)s.push(Je.range(Math.min(e.doc.length,l.anchor+o),Math.min(e.doc.length,l.head+o)))}else{n.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let l of a.ranges)s.push(Je.range(l.anchor-o,l.head-o))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:Je.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const xXt=({state:e,dispatch:t})=>lGe(e,t,!1),SXt=({state:e,dispatch:t})=>lGe(e,t,!0);function cGe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of YL(e))r?n.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):n.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(n);return t(e.update({changes:s,selection:e.selection.map(s,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const wXt=({state:e,dispatch:t})=>cGe(e,t,!1),EXt=({state:e,dispatch:t})=>cGe(e,t,!0),kXt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(YL(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=iO(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),o=e.coordsAtPos(s.head,s.assoc||1);o&&(a=i.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function OXt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=ba(e).resolveInner(t),n=r.childBefore(t),s=r.childAfter(t),a;return n&&s&&n.to<=t&&s.from>=t&&(a=n.type.prop(fn.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(n.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}const z_e=uGe(!1),_Xt=uGe(!0);function uGe(e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=t.changeByRange(s=>{let{from:a,to:i}=s,o=t.doc.lineAt(a),l=!e&&a==i&&OXt(t,a);e&&(a=i=(i<=o.to?o:t.doc.lineAt(i)).to);let u=new VL(t,{simulateBreak:a,simulateDoubleBreak:!!l}),d=voe(u,a);for(d==null&&(d=Mf(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;l?{from:a,to:i}=l:a>o.from&&a<o.from+100&&!/\S/.test(o.text.slice(0,a))&&(a=o.from);let p=["",DA(t,d)];return l&&p.push(DA(t,u.lineIndent(o.from,-1))),{changes:{from:a,to:i,insert:ws.of(p)},range:Je.cursor(a+1+p[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function ele(e,t){let r=-1;return e.changeByRange(n=>{let s=[];for(let i=n.from;i<=n.to;){let o=e.doc.lineAt(i);o.number>r&&(n.empty||n.to>o.from)&&(t(o,s,n),r=o.number),i=o.to+1}let a=e.changes(s);return{changes:s,range:Je.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const CXt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new VL(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=ele(e,(a,i,o)=>{let l=voe(n,a.from);if(l==null)return;/\S/.test(a.text)||(l=0);let u=/^\s*/.exec(a.text)[0],d=DA(e,l);(u!=d||o.from<a.from+u.length)&&(r[a.from]=l,i.push({from:a.from,to:a.from+u.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},dGe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ele(e,(r,n)=>{n.push({from:r.from,insert:e.facet(nO)})}),{userEvent:"input.indent"})),!0),pGe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ele(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Mf(s,e.tabSize),i=0,o=DA(e,Math.max(0,a-W0(e)));for(;i<s.length&&i<o.length&&s.charCodeAt(i)==o.charCodeAt(i);)i++;n.push({from:r.from+i,to:r.from+s.length,insert:o.slice(i)})}),{userEvent:"delete.dedent"})),!0),TXt=e=>(e.setTabFocusMode(),!0),AXt=[{key:"Ctrl-b",run:zQe,shift:XQe,preventDefault:!0},{key:"Ctrl-f",run:UQe,shift:YQe},{key:"Ctrl-p",run:HQe,shift:eGe},{key:"Ctrl-n",run:QQe,shift:tGe},{key:"Ctrl-a",run:ZWt,shift:iXt},{key:"Ctrl-e",run:WWt,shift:oXt},{key:"Ctrl-d",run:aGe},{key:"Ctrl-h",run:ZJ},{key:"Ctrl-k",run:mXt},{key:"Ctrl-Alt-h",run:oGe},{key:"Ctrl-o",run:bXt},{key:"Ctrl-t",run:vXt},{key:"Ctrl-v",run:GJ}],DXt=[{key:"ArrowLeft",run:zQe,shift:XQe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:FWt,shift:KWt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:QWt,shift:sXt,preventDefault:!0},{key:"ArrowRight",run:UQe,shift:YQe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:BWt,shift:JWt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:GWt,shift:aXt,preventDefault:!0},{key:"ArrowUp",run:HQe,shift:eGe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:M_e,shift:F_e},{mac:"Ctrl-ArrowUp",run:R_e,shift:P_e},{key:"ArrowDown",run:QQe,shift:tGe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:L_e,shift:B_e},{mac:"Ctrl-ArrowDown",run:GJ,shift:$_e},{key:"PageUp",run:R_e,shift:P_e},{key:"PageDown",run:GJ,shift:$_e},{key:"Home",run:HWt,shift:nXt,preventDefault:!0},{key:"Mod-Home",run:M_e,shift:F_e},{key:"End",run:qWt,shift:rXt,preventDefault:!0},{key:"Mod-End",run:L_e,shift:B_e},{key:"Enter",run:z_e,shift:z_e},{key:"Mod-a",run:lXt},{key:"Backspace",run:ZJ,shift:ZJ,preventDefault:!0},{key:"Delete",run:aGe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:oGe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:hXt,preventDefault:!0},{mac:"Mod-Backspace",run:gXt,preventDefault:!0},{mac:"Mod-Delete",run:yXt,preventDefault:!0}].concat(AXt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),NXt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:UWt,shift:eXt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:VWt,shift:tXt},{key:"Alt-ArrowUp",run:xXt},{key:"Shift-Alt-ArrowUp",run:wXt},{key:"Alt-ArrowDown",run:SXt},{key:"Shift-Alt-ArrowDown",run:EXt},{key:"Mod-Alt-ArrowUp",run:dXt},{key:"Mod-Alt-ArrowDown",run:pXt},{key:"Escape",run:fXt},{key:"Mod-Enter",run:_Xt},{key:"Alt-l",mac:"Ctrl-l",run:cXt},{key:"Mod-i",run:uXt,preventDefault:!0},{key:"Mod-[",run:pGe},{key:"Mod-]",run:dGe},{key:"Mod-Alt-\\",run:CXt},{key:"Shift-Mod-k",run:kXt},{key:"Shift-Mod-\\",run:YWt},{key:"Mod-/",run:xWt},{key:"Alt-A",run:wWt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:TXt}].concat(DXt),IXt={key:"Tab",run:dGe,shift:pGe},U_e=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class YE{constructor(t,r,n=0,s=t.length,a,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,s),this.bufferStart=n,this.normalize=a?o=>a(U_e(o)):U_e,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return tu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=toe(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=Dh(t);let s=this.normalize(r);if(s.length)for(let a=0,i=n;;a++){let o=s.charCodeAt(a),l=this.match(o,i,this.bufferPos+this.bufferStart);if(a==s.length-1){if(l)return this.value=l,this;break}i==n&&a<r.length&&r.charCodeAt(a)==o&&i++}}}match(t,r,n){let s=null;for(let a=0;a<this.matches.length;a+=2){let i=this.matches[a],o=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?s={from:this.matches[a+1],to:n}:(this.matches[a]++,o=!0)),o||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:r,to:n}:this.matches.push(1,r)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(YE.prototype[Symbol.iterator]=function(){return this});const fGe={from:-1,to:-1,match:/.*/.exec("")},tle="gm"+(/x/.unicode==null?"":"u");class hGe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=fGe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new mGe(t,r,n,s,a);this.re=new RegExp(r,tle+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=G3(t,s),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=G3(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<s||n>this.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const xG=new WeakMap;class lE{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=xG.get(t);if(!s||s.from>=n||s.to<=r){let o=new lE(r,t.sliceString(r,n));return xG.set(t,o),o}if(s.from==r&&s.to==n)return s;let{text:a,from:i}=s;return i>r&&(a=t.sliceString(r,i)+a,i=r),s.to<n&&(a+=t.sliceString(s.to,n)),xG.set(t,new lE(i,a)),new lE(r,a.slice(r-i,n-i))}}class mGe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=fGe,this.matchPos=G3(t,s),this.re=new RegExp(r,tle+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=lE.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=G3(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=lE.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(hGe.prototype[Symbol.iterator]=mGe.prototype[Symbol.iterator]=function(){return this});function jXt(e){try{return new RegExp(e,tle),!0}catch{return!1}}function G3(e,t){if(t>=e.length)return t;let r=e.lineAt(t),n;for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}function WJ(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),r=wa("input",{class:"cm-textfield",name:"line",value:t}),n=wa("form",{class:"cm-gotoLine",onkeydown:a=>{a.keyCode==27?(a.preventDefault(),e.dispatch({effects:xT.of(!1)}),e.focus()):a.keyCode==13&&(a.preventDefault(),s())},onsubmit:a=>{a.preventDefault(),s()}},wa("label",e.state.phrase("Go to line"),": ",r)," ",wa("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),wa("button",{name:"close",onclick:()=>{e.dispatch({effects:xT.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function s(){let a=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.value);if(!a)return;let{state:i}=e,o=i.doc.lineAt(i.selection.main.head),[,l,u,d,p]=a,f=d?+d.slice(1):0,h=u?+u:o.number;if(u&&p){let b=h/100;l&&(b=b*(l=="-"?-1:1)+o.number/i.doc.lines),h=Math.round(i.doc.lines*b)}else u&&l&&(h=h*(l=="-"?-1:1)+o.number);let m=i.doc.line(Math.max(1,Math.min(i.doc.lines,h))),y=Je.cursor(m.from+Math.max(0,Math.min(f,m.length)));e.dispatch({effects:[xT.of(!1),mt.scrollIntoView(y.from,{y:"center"})],selection:y}),e.focus()}return{dom:n}}const xT=en.define(),V_e=Ki.define({create(){return!0},update(e,t){for(let r of t.effects)r.is(xT)&&(e=r.value);return e},provide:e=>AA.from(e,t=>t?WJ:null)}),RXt=e=>{let t=TA(e,WJ);if(!t){let r=[xT.of(!0)];e.state.field(V_e,!1)==null&&r.push(en.appendConfig.of([V_e,PXt])),e.dispatch({effects:r}),t=TA(e,WJ)}return t&&t.dom.querySelector("input").select(),!0},PXt=mt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),$Xt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},MXt=Xt.define({combine(e){return Am(e,$Xt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function LXt(e){return[VXt,UXt]}const FXt=rr.mark({class:"cm-selectionMatch"}),BXt=rr.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function q_e(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=li.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=li.Word)}function zXt(e,t,r,n){return e(t.sliceDoc(r,r+1))==li.Word&&e(t.sliceDoc(n-1,n))==li.Word}const UXt=xi.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(MXt),{state:r}=e,n=r.selection;if(n.ranges.length>1)return rr.none;let s=n.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return rr.none;let l=r.wordAt(s.head);if(!l)return rr.none;i=r.charCategorizer(s.head),a=r.sliceDoc(l.from,l.to)}else{let l=s.to-s.from;if(l<t.minSelectionLength||l>200)return rr.none;if(t.wholeWords){if(a=r.sliceDoc(s.from,s.to),i=r.charCategorizer(s.head),!(q_e(i,r,s.from,s.to)&&zXt(i,r,s.from,s.to)))return rr.none}else if(a=r.sliceDoc(s.from,s.to),!a)return rr.none}let o=[];for(let l of e.visibleRanges){let u=new YE(r.doc,a,l.from,l.to);for(;!u.next().done;){let{from:d,to:p}=u.value;if((!i||q_e(i,r,d,p))&&(s.empty&&d<=s.from&&p>=s.to?o.push(BXt.range(d,p)):(d>=s.to||p<=s.from)&&o.push(FXt.range(d,p)),o.length>t.maxMatches))return rr.none}}return rr.set(o)}},{decorations:e=>e.decorations}),VXt=mt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),qXt=({state:e,dispatch:t})=>{let{selection:r}=e,n=Je.create(r.ranges.map(s=>e.wordAt(s.head)||Je.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function HXt(e,t){let{main:r,ranges:n}=e.selection,s=e.wordAt(r.head),a=s&&s.from==r.from&&s.to==r.to;for(let i=!1,o=new YE(e.doc,t,n[n.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new YE(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),i=!0}else{if(i&&n.some(l=>l.from==o.value.from))continue;if(a){let l=e.wordAt(o.value.from);if(!l||l.from!=o.value.from||l.to!=o.value.to)continue}return o.value}}const QXt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return qXt({state:e,dispatch:t});let n=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=n))return!1;let s=HXt(e,n);return s?(t(e.update({selection:e.selection.addRange(Je.range(s.from,s.to),!1),effects:mt.scrollIntoView(s.to)})),!0):!1},oO=Xt.define({combine(e){return Am(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new sYt(t),scrollToMatch:t=>mt.scrollIntoView(t)})}});class gGe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||jXt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
|
|
160
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),Zc('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Zc('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],eQe=Uoe.concat([Zc("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Zc("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Zc("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),__e=new nVe,tQe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function P_(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const QZt=["FunctionDeclaration"],GZt={FunctionDeclaration:P_("function"),ClassDeclaration:P_("class"),ClassExpression:()=>!0,EnumDeclaration:P_("constant"),TypeAliasDeclaration:P_("type"),NamespaceDeclaration:P_("namespace"),VariableDefinition(e,t){e.matchContext(QZt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function rQe(e,t){let r=__e.get(t);if(r)return r;let n=[],s=!0;function a(i,o){let l=e.sliceString(i.from,i.to);n.push({label:l,type:o})}return t.cursor(Js.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let o=GZt[i.name];if(o&&o(i,a)||tQe.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of rQe(e,i.node))n.push(o);return!1}}),__e.set(t,n),n}const q3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Voe=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function nQe(e){let t=ba(e.state).resolveInner(e.pos,-1);if(Voe.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&q3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)tQe.has(s.name)&&(n=n.concat(rQe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:q3}}function pG(e,t,r){var n;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:r};if(a?.name=="MemberExpression"&&((n=i=a.lastChild)===null||n===void 0?void 0:n.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function sQe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=ba(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?pG(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?pG(t,r.parent,""):Voe.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&q3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?pG(t,r,""):e.explicit?{path:[],name:""}:null}function ZZt(e,t){let r=[],n=new Set;for(let s=0;;s++){for(let i of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(i)||n.has(i))continue;n.add(i);let o;try{o=e[i]}catch{continue}r.push({label:i,type:typeof o=="function"?/^[A-Z]/.test(i)?"class":t?"function":"method":t?"variable":"property",boost:-s})}let a=Object.getPrototypeOf(e);if(!a)return r;e=a}}function WZt(e){let t=new Map;return r=>{let n=sQe(r);if(!n)return null;let s=e;for(let i of n.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=ZZt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:q3}}}const vp=Q0.define({name:"javascript",parser:HZt.configure({props:[$1.add({IfStatement:iE({except:/^\s*({|else\b)/}),TryStatement:iE({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Hqt,SwitchBody:e=>{let t=e.textAfter,r=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(r?0:n?1:2)*e.unit},Block:qqt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":iE({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),M1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Soe,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),aQe={test:e=>/^JSX/.test(e.name),facet:UL({commentTokens:{block:{open:"{/*",close:"*/}"}}})},qoe=vp.configure({dialect:"ts"},"typescript"),Hoe=vp.configure({dialect:"jsx",props:[boe.add(e=>e.isTop?[aQe]:void 0)]}),Qoe=vp.configure({dialect:"jsx ts",props:[boe.add(e=>e.isTop?[aQe]:void 0)]},"typescript");let iQe=e=>({label:e,type:"keyword"});const oQe="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(iQe),XZt=oQe.concat(["declare","implements","private","protected","public"].map(iQe));function H3(e={}){let t=e.jsx?e.typescript?Qoe:Hoe:e.typescript?qoe:vp,r=e.typescript?eQe.concat(XZt):Uoe.concat(oQe);return new Z0(t,[vp.data.of({autocomplete:DHt(Voe,tHe(r))}),vp.data.of({autocomplete:nQe}),e.jsx?lQe:[]])}function YZt(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function C_e(e,t,r=e.length){for(let n=t?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return e.sliceString(n.from,Math.min(n.to,r));return""}const KZt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),lQe=mt.inputHandler.of((e,t,r,n,s)=>{if((KZt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!vp.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(l=>{var u;let{head:d}=l,p=ba(i).resolveInner(d-1,-1),f;if(p.name=="JSXStartTag"&&(p=p.parent),!(i.doc.sliceString(d-1,d)!=n||p.name=="JSXAttributeValue"&&p.to>d)){if(n==">"&&p.name=="JSXFragmentTag")return{range:l,changes:{from:d,insert:"</>"}};if(n=="/"&&p.name=="JSXStartCloseTag"){let h=p.parent,m=h.parent;if(m&&h.from==d-2&&((f=C_e(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let y=`${f}>`;return{range:Je.cursor(d+y.length,-1),changes:{from:d,insert:y}}}}else if(n==">"){let h=YZt(p);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(f=C_e(i.doc,h,d)))return{range:l,changes:{from:d,insert:`</${f}>`}}}}return{range:l}});return o.changes.empty?!1:(e.dispatch([a,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function JZt(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((r,n)=>{var s;!((s=r.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[n]=2)})),r=>{let{state:n}=r,s=[];for(let{from:a,to:i}of vp.findRegions(n)){let o=n.doc.lineAt(a),l={line:o.number-1,col:a-o.from,pos:a};for(let u of e.verify(n.sliceDoc(a,i),t))s.push(eWt(u,n.doc,l))}return s}}function T_e(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function eWt(e,t,r){let n=T_e(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?T_e(e.endLine,e.endColumn,t,r):n,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:a,text:i}=e.fix,o=a[0]+r.pos-n,l=a[1]+r.pos-n;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+o,to:d+l,insert:i},scrollIntoView:!0})}}]}return s}const y2=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:lQe,completionPath:sQe,esLint:JZt,javascript:H3,javascriptLanguage:vp,jsxLanguage:Hoe,localCompletionSource:nQe,scopeCompletionSource:WZt,snippets:Uoe,tsxLanguage:Qoe,typescriptLanguage:qoe,typescriptSnippets:eQe},Symbol.toStringTag,{value:"Module"})),$_=["_blank","_self","_top","_parent"],fG=["ascii","utf-8","utf-16","latin1","latin1"],hG=["get","post","put","delete"],mG=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Vu=["true","false"],Dr={},tWt={a:{attrs:{href:null,ping:null,type:null,media:null,target:$_,hreflang:null}},abbr:Dr,address:Dr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Dr,aside:Dr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Dr,base:{attrs:{href:null,target:$_}},bdi:Dr,bdo:Dr,blockquote:{attrs:{cite:null}},body:Dr,br:Dr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:mG,formmethod:hG,formnovalidate:["novalidate"],formtarget:$_,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Dr,center:Dr,cite:Dr,code:Dr,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Dr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Dr,div:Dr,dl:Dr,dt:Dr,em:Dr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Dr,figure:Dr,footer:Dr,form:{attrs:{action:null,name:null,"accept-charset":fG,autocomplete:["on","off"],enctype:mG,method:hG,novalidate:["novalidate"],target:$_}},h1:Dr,h2:Dr,h3:Dr,h4:Dr,h5:Dr,h6:Dr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Dr,hgroup:Dr,hr:Dr,html:{attrs:{manifest:null}},i:Dr,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:mG,formmethod:hG,formnovalidate:["novalidate"],formtarget:$_,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Dr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Dr,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Dr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:fG,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Dr,noscript:Dr,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Dr,param:{attrs:{name:null,value:null}},pre:Dr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Dr,rt:Dr,ruby:Dr,samp:Dr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:fG}},section:Dr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Dr,source:{attrs:{src:null,type:null,media:null}},span:Dr,strong:Dr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Dr,summary:Dr,sup:Dr,table:Dr,tbody:Dr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Dr,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Dr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Dr,time:{attrs:{datetime:null}},title:Dr,tr:Dr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Dr,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Dr},cQe={accesskey:null,class:null,contenteditable:Vu,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Vu,autocorrect:Vu,autocapitalize:Vu,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Vu,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Vu,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Vu,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Vu,"aria-hidden":Vu,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Vu,"aria-multiselectable":Vu,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Vu,"aria-relevant":null,"aria-required":Vu,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},uQe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of uQe)cQe[e]=null;let FA=class{constructor(t,r){this.tags={...tWt,...t},this.globalAttrs={...cQe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};FA.default=new FA;function WE(e,t,r=e.length){if(!t)return"";let n=t.firstChild,s=n&&n.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,r)):""}function XE(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function dQe(e,t,r){let n=r.tags[WE(e,XE(t))];return n?.children||r.allTags}function Goe(e,t){let r=[];for(let n=XE(t);n&&!n.type.isTop;n=XE(n.parent)){let s=WE(e,n);if(s&&n.lastChild.name=="CloseTag")break;s&&r.indexOf(s)<0&&(t.name=="EndTag"||t.from>=n.firstChild.to)&&r.push(s)}return r}const pQe=/^[:\-\.\w\u00b7-\uffff]*$/;function A_e(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=XE(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:dQe(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(Goe(e.doc,r).map((o,l)=>({label:"/"+o,apply:"/"+o+a,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function D_e(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Goe(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:pQe}}function rWt(e,t,r,n){let s=[],a=0;for(let i of dQe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Goe(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function nWt(e,t,r,n,s){let a=XE(r),i=a?t.tags[WE(e.doc,a)]:null,o=i&&i.attrs?Object.keys(i.attrs):[],l=i&&i.globalAttrs===!1?o:o.length?o.concat(t.globalAttrNames):t.globalAttrNames;return{from:n,to:s,options:l.map(u=>({label:u,type:"property"})),validFor:pQe}}function sWt(e,t,r,n,s){var a;let i=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),o=[],l;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let p=XE(r),f=p?t.tags[WE(e.doc,p)]:null;d=f?.attrs&&f.attrs[u]}if(d){let p=e.sliceDoc(n,s).toLowerCase(),f='"',h='"';/^['"]/.test(p)?(l=p[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",h=e.sliceDoc(s,s+1)==p[0]?"":p[0],p=p.slice(1),n++):l=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:f+m+h,type:"constant"})}}return{from:n,to:s,options:o,validFor:l}}function fQe(e,t){let{state:r,pos:n}=t,s=ba(r).resolveInner(n,-1),a=s.resolve(n);for(let i=n,o;a==s&&(o=s.childBefore(i));){let l=o.lastChild;if(!l||!l.type.isError||l.from<l.to)break;a=s=o,i=l.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?D_e(r,s,s.from,n):A_e(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?A_e(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?D_e(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?nWt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?sWt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?rWt(r,e,s,n):null}function hQe(e){return fQe(FA.default,e)}function mQe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new FA(t,r):FA.default;return s=>fQe(n,s)}const aWt=vp.parser.configure({top:"SingleExpression"}),gQe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:qoe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Hoe.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Qoe.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:aWt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:vp.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:LA.parser}],yQe=[{name:"style",parser:LA.parser.configure({top:"Styles"})}].concat(uQe.map(e=>({name:e,parser:vp.parser}))),bQe=Q0.define({name:"html",parser:RGt.configure({props:[$1.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,r;for(let n=e.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;t=n=s}return t&&!((r=t.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),M1.add({Element(e){let t=e.firstChild,r=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:r.name=="CloseTag"?r.from:e.to}}}),Zqe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),vT=bQe.configure({wrap:qHe(gQe,yQe)});function vQe(e={}){let t="",r;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=qHe((e.nestedLanguages||[]).concat(gQe),(e.nestedAttributes||[]).concat(yQe)));let n=r?bQe.configure({wrap:r,dialect:t}):t?vT.configure({dialect:t}):vT;return new Z0(n,[vT.data.of({autocomplete:mQe(e)}),e.autoCloseTags!==!1?xQe:[],H3().support,KHe().support])}const N_e=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),xQe=mt.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!vT.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(l=>{var u,d,p;let f=i.doc.sliceString(l.from-1,l.to)==n,{head:h}=l,m=ba(i).resolveInner(h,-1),y;if(f&&n==">"&&m.name=="EndTag"){let b=m.parent;if(((d=(u=b.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(y=WE(i.doc,b.parent,h))&&!N_e.has(y)){let v=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`</${y}>`;return{range:l,changes:{from:h,to:v,insert:S}}}}else if(f&&n=="/"&&m.name=="IncompleteCloseTag"){let b=m.parent;if(m.from==h-2&&((p=b.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(y=WE(i.doc,b,h))&&!N_e.has(y)){let v=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`${y}>`;return{range:Je.cursor(h+S.length,-1),changes:{from:h,to:v,insert:S}}}}return{range:l}});return o.changes.empty?!1:(e.dispatch([a,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),iWt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:xQe,html:vQe,htmlCompletionSource:hQe,htmlCompletionSourceWith:mQe,htmlLanguage:vT},Symbol.toStringTag,{value:"Module"})),SQe=UL({commentTokens:{block:{open:"<!--",close:"-->"}}}),wQe=new fn,EQe=$Qt.configure({props:[M1.add(e=>!e.is("Block")||e.is("Document")||qJ(e)!=null||oWt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),wQe.add(qJ),$1.add({Document:()=>null}),Pb.add({Document:SQe})]});function qJ(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function oWt(e){return e.name=="OrderedList"||e.name=="BulletList"}function lWt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=qJ(n.type))!=null&&s<=t)break;r=n}return r.to}const cWt=$qe.of((e,t,r)=>{for(let n=ba(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(wQe);if(s==null)continue;let a=lWt(n,s);if(a>r)return{from:r,to:a}}return null});function Zoe(e){return new ad(SQe,e,[],"markdown")}const kQe=Zoe(EQe),uWt=EQe.configure([GQt,WQt,ZQt,XQt,{props:[M1.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),Y0=Zoe(uWt);function dWt(e,t){return r=>{if(r&&e){let n=null;if(r=/\S*/.exec(r)[0],typeof e=="function"?n=e(r):n=He.matchLanguageName(e,r,!0),n instanceof He)return n.support?n.support.language.parser:G0.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class gG{constructor(t,r,n,s,a,i,o){this.node=t,this.from=r,this.to=n,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=o}blank(t,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;n.length<t;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(t,r){let n=this.node.name=="OrderedList"?String(+_Qe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function OQe(e,t){let r=[],n=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&r.push(s)}for(let s=r.length-1;s>=0;s--){let a=r[s],i,o=t.lineAt(a.from),l=a.from-o.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(o.text.slice(l))))n.push(new gG(a,l,l+i[0].length,"",i[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(o.text.slice(l)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new gG(a.parent,l,l+d,i[1],u,i[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(l)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let p=i[2];i[3]&&(p+=i[3].replace(/[xX]/," ")),n.push(new gG(a.parent,l,l+d,i[1],u,p,a))}}return n}function _Qe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function yG(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let o=_Qe(a,t),l=+o[2];if(s>=0){if(l!=s+1)return;r.push({from:a.from+o[1].length,to:a.from+o[0].length,insert:String(s+2+n)})}s=l}let i=a.nextSibling;if(!i)break;a=i}}function Woe(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(nO)!=" ")return e;let n=Mf(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const CQe=(e={})=>({state:t,dispatch:r})=>{let n=ba(t),{doc:s}=t,a=null,i=t.changeByRange(o=>{if(!o.empty||!Y0.isActiveAt(t,o.from,-1)&&!Y0.isActiveAt(t,o.from,1))return a={range:o};let l=o.from,u=s.lineAt(l),d=OQe(n.resolveInner(l,-1),s);for(;d.length&&d[d.length-1].from>l-u.from;)d.pop();if(!d.length)return a={range:o};let p=d[d.length-1];if(p.to-p.spaceAfter.length>l-u.from)return a={range:o};let f=l>=p.to-p.spaceAfter.length&&!/\S/.test(u.text.slice(p.to));if(p.item&&f){let v=p.node.firstChild,S=p.node.getChild("ListItem","ListItem");if(v.to>=l||S&&S.to<l||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||e.nonTightLists===!1){let w=d.length>1?d[d.length-2]:null,k,_="";w&&w.item?(k=u.from+w.from,_=w.marker(s,1)):k=u.from+(w?w.to:0);let C=[{from:k,to:l,insert:_}];return p.node.name=="OrderedList"&&yG(p.item,s,C,-2),w&&w.node.name=="OrderedList"&&yG(w.item,s,C),{range:Je.cursor(k+_.length),changes:C}}else{let w=j_e(d,t,u);return{range:Je.cursor(l+w.length+1),changes:{from:u.from,insert:w+t.lineBreak}}}}if(p.node.name=="Blockquote"&&f&&u.from){let v=s.lineAt(u.from-1),S=/>\s*$/.exec(v.text);if(S&&S.index==p.from){let w=t.changes([{from:v.from+S.index,to:v.to},{from:u.from+p.from,to:u.to}]);return{range:o.map(w),changes:w}}}let h=[];p.node.name=="OrderedList"&&yG(p.item,s,h);let m=p.item&&p.item.from<u.from,y="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=p.to)for(let v=0,S=d.length-1;v<=S;v++)y+=v==S&&!m?d[v].marker(s,1):d[v].blank(v<S?Mf(u.text,4,d[v+1].from)-y.length:null);let b=l;for(;b>u.from&&/\s/.test(u.text.charAt(b-u.from-1));)b--;return y=Woe(y,t),pWt(p.node,t.doc)&&(y=j_e(d,t,u)+t.lineBreak+y),h.push({from:b,to:l,insert:t.lineBreak+y}),{range:Je.cursor(b+y.length+1),changes:h}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},TQe=CQe();function I_e(e){return e.name=="QuoteMark"||e.name=="ListMark"}function pWt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let r=e.firstChild,n=e.getChild("ListItem","ListItem");if(!n)return!1;let s=t.lineAt(r.to),a=t.lineAt(n.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function j_e(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Mf(r.text,4,e[s+1].from)-n.length:null,s<a);return Woe(n,t)}function fWt(e,t){let r=e.resolveInner(t,-1),n=t;I_e(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(I_e(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const AQe=({state:e,dispatch:t})=>{let r=ba(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:o}=e;if(a.empty&&Y0.isActiveAt(e,a.from)){let l=o.lineAt(i),u=OQe(fWt(r,i),o);if(u.length){let d=u[u.length-1],p=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-l.from>p&&!/\S/.test(l.text.slice(p,i-l.from)))return{range:Je.cursor(l.from+p),changes:{from:l.from+p,to:i}};if(i-l.from==p&&(!d.item||l.from<=d.item.from||!/\S/.test(l.text.slice(0,d.to)))){let f=l.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(l.text.slice(d.from,d.to))){let h=d.blank(Mf(l.text,4,d.to)-Mf(l.text,4,d.from));return f==l.from&&(h=Woe(h,e)),{range:Je.cursor(f+h.length),changes:{from:f,to:l.from+d.to,insert:h}}}if(f<i)return{range:Je.cursor(f),changes:{from:f,to:i}}}}}return n={range:a}});return n?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},DQe=[{key:"Enter",run:TQe},{key:"Backspace",run:AQe}],NQe=vQe({matchClosingTags:!1});function Xoe(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=kQe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=NQe}=e;if(!(s instanceof QL))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=e.extensions?[e.extensions]:[],u=[o.support,cWt],d;i&&u.push(IQe),r instanceof Z0?(u.push(r.support),d=r.language):r&&(d=r);let p=t||d?dWt(t,d):void 0;l.push(LQt({codeParser:p,htmlParser:o.language.parser})),n&&u.push(Wf.high(rO.of(DQe)));let f=Zoe(s.configure(l));return a&&u.push(f.data.of({autocomplete:hWt})),new Z0(f,u)}function hWt(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=ba(t).resolveInner(r,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:r-n[0].length,to:r,options:mWt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let bG=null;function mWt(){if(bG)return bG;let e=hQe(new Coe(Zn.create({extensions:NQe}),0,!0));return bG=e?e.options:[]}const gWt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,IQe=mt.domEventHandlers({paste:(e,t)=>{var r;let{main:n}=t.state.selection;if(n.empty)return!1;let s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!Y0.isActiveAt(t.state,n.from,1)))return!1;let a=ba(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:o=>{(o.from>n.from||gWt.test(o.name))&&(i=!0)},leave:o=>{o.to<n.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),yWt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:kQe,deleteMarkupBackward:AQe,insertNewlineContinueMarkup:TQe,insertNewlineContinueMarkupCommand:CQe,markdown:Xoe,markdownKeymap:DQe,markdownLanguage:Y0,pasteURLAsLink:IQe},Symbol.toStringTag,{value:"Module"}));function ct(e){return new Z0(Eoe.define(e))}function tb(e){return Ge(()=>import("./index-C5Gn56O1.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const jQe=[He.of({name:"C",extensions:["c","h","ino"],load(){return Ge(()=>import("./index-BJ47Zsb5.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),He.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ge(()=>import("./index-BJ47Zsb5.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),He.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return tb("Cassandra")}}),He.of({name:"CSS",extensions:["css"],load(){return Ge(()=>Promise.resolve().then(()=>hZt),void 0,import.meta.url).then(e=>e.css())}}),He.of({name:"Go",extensions:["go"],load(){return Ge(()=>import("./index-DVi3DnAy.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),He.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ge(()=>Promise.resolve().then(()=>iWt),void 0,import.meta.url).then(e=>e.html())}}),He.of({name:"Java",extensions:["java"],load(){return Ge(()=>import("./index-C3zH8UNH.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),He.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ge(()=>Promise.resolve().then(()=>y2),void 0,import.meta.url).then(e=>e.javascript())}}),He.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ge(()=>import("./index-B9lWwBXQ.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),He.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ge(()=>Promise.resolve().then(()=>THt),void 0,import.meta.url).then(e=>e.json())}}),He.of({name:"JSX",extensions:["jsx"],load(){return Ge(()=>Promise.resolve().then(()=>y2),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),He.of({name:"LESS",extensions:["less"],load(){return Ge(()=>import("./index-Bk2cWYRn.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),He.of({name:"Liquid",extensions:["liquid"],load(){return Ge(()=>import("./index-BbrxUzO8.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),He.of({name:"MariaDB SQL",load(){return tb("MariaSQL")}}),He.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ge(()=>Promise.resolve().then(()=>yWt),void 0,import.meta.url).then(e=>e.markdown())}}),He.of({name:"MS SQL",load(){return tb("MSSQL")}}),He.of({name:"MySQL",load(){return tb("MySQL")}}),He.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ge(()=>import("./index-CoORZRmo.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),He.of({name:"PLSQL",extensions:["pls"],load(){return tb("PLSQL")}}),He.of({name:"PostgreSQL",load(){return tb("PostgreSQL")}}),He.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ge(()=>import("./index-1CIfQRPa.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),He.of({name:"Rust",extensions:["rs"],load(){return Ge(()=>import("./index-DbViMdCi.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),He.of({name:"Sass",extensions:["sass"],load(){return Ge(()=>import("./index-CWOzX6bp.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),He.of({name:"SCSS",extensions:["scss"],load(){return Ge(()=>import("./index-CWOzX6bp.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),He.of({name:"SQL",extensions:["sql"],load(){return tb("StandardSQL")}}),He.of({name:"SQLite",load(){return tb("SQLite")}}),He.of({name:"TSX",extensions:["tsx"],load(){return Ge(()=>Promise.resolve().then(()=>y2),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),He.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ge(()=>Promise.resolve().then(()=>y2),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),He.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ge(()=>import("./index-B8WLnubh.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),He.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ge(()=>import("./index-DJtMwJXc.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),He.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ge(()=>import("./index-De8FQYWG.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),He.of({name:"APL",extensions:["dyalog","apl"],load(){return Ge(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>ct(e.apl))}}),He.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ge(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>ct(e.asciiArmor))}}),He.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ge(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>ct(e.asn1({})))}}),He.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ge(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>ct(e.asterisk))}}),He.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ge(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>ct(e.brainfuck))}}),He.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ge(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>ct(e.cobol))}}),He.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.csharp))}}),He.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"ClojureScript",extensions:["cljs"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ge(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>ct(e.gss))}}),He.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ge(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>ct(e.cmake))}}),He.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ge(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>ct(e.coffeeScript))}}),He.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ge(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>ct(e.commonLisp))}}),He.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ge(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>ct(e.cypher))}}),He.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ge(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>ct(e.cython))}}),He.of({name:"Crystal",extensions:["cr"],load(){return Ge(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>ct(e.crystal))}}),He.of({name:"D",extensions:["d"],load(){return Ge(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>ct(e.d))}}),He.of({name:"Dart",extensions:["dart"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.dart))}}),He.of({name:"diff",extensions:["diff","patch"],load(){return Ge(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>ct(e.diff))}}),He.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ge(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>ct(e.dockerFile))}}),He.of({name:"DTD",extensions:["dtd"],load(){return Ge(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>ct(e.dtd))}}),He.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ge(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>ct(e.dylan))}}),He.of({name:"EBNF",load(){return Ge(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>ct(e.ebnf))}}),He.of({name:"ECL",extensions:["ecl"],load(){return Ge(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>ct(e.ecl))}}),He.of({name:"edn",extensions:["edn"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"Eiffel",extensions:["e"],load(){return Ge(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>ct(e.eiffel))}}),He.of({name:"Elm",extensions:["elm"],load(){return Ge(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>ct(e.elm))}}),He.of({name:"Erlang",extensions:["erl"],load(){return Ge(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>ct(e.erlang))}}),He.of({name:"Esper",load(){return Ge(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>ct(e.esper))}}),He.of({name:"Factor",extensions:["factor"],load(){return Ge(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>ct(e.factor))}}),He.of({name:"FCL",load(){return Ge(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>ct(e.fcl))}}),He.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ge(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>ct(e.forth))}}),He.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ge(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>ct(e.fortran))}}),He.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.fSharp))}}),He.of({name:"Gas",extensions:["s"],load(){return Ge(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>ct(e.gas))}}),He.of({name:"Gherkin",extensions:["feature"],load(){return Ge(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>ct(e.gherkin))}}),He.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ge(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>ct(e.groovy))}}),He.of({name:"Haskell",extensions:["hs"],load(){return Ge(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>ct(e.haskell))}}),He.of({name:"Haxe",extensions:["hx"],load(){return Ge(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.haxe))}}),He.of({name:"HXML",extensions:["hxml"],load(){return Ge(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.hxml))}}),He.of({name:"HTTP",load(){return Ge(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>ct(e.http))}}),He.of({name:"IDL",extensions:["pro"],load(){return Ge(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>ct(e.idl))}}),He.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ge(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>ct(e.jsonld))}}),He.of({name:"Julia",extensions:["jl"],load(){return Ge(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>ct(e.julia))}}),He.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.kotlin))}}),He.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ge(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>ct(e.liveScript))}}),He.of({name:"Lua",extensions:["lua"],load(){return Ge(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>ct(e.lua))}}),He.of({name:"mIRC",extensions:["mrc"],load(){return Ge(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>ct(e.mirc))}}),He.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ge(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>ct(e.mathematica))}}),He.of({name:"Modelica",extensions:["mo"],load(){return Ge(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>ct(e.modelica))}}),He.of({name:"MUMPS",extensions:["mps"],load(){return Ge(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>ct(e.mumps))}}),He.of({name:"Mbox",extensions:["mbox"],load(){return Ge(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>ct(e.mbox))}}),He.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ge(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>ct(e.nginx))}}),He.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ge(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>ct(e.nsis))}}),He.of({name:"NTriples",extensions:["nt","nq"],load(){return Ge(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>ct(e.ntriples))}}),He.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.objectiveC))}}),He.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.objectiveCpp))}}),He.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.oCaml))}}),He.of({name:"Octave",extensions:["m"],load(){return Ge(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>ct(e.octave))}}),He.of({name:"Oz",extensions:["oz"],load(){return Ge(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>ct(e.oz))}}),He.of({name:"Pascal",extensions:["p","pas"],load(){return Ge(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>ct(e.pascal))}}),He.of({name:"Perl",extensions:["pl","pm"],load(){return Ge(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>ct(e.perl))}}),He.of({name:"Pig",extensions:["pig"],load(){return Ge(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>ct(e.pig))}}),He.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ge(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>ct(e.powerShell))}}),He.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ge(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>ct(e.properties))}}),He.of({name:"ProtoBuf",extensions:["proto"],load(){return Ge(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>ct(e.protobuf))}}),He.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ge(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>ct(e.pug))}}),He.of({name:"Puppet",extensions:["pp"],load(){return Ge(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>ct(e.puppet))}}),He.of({name:"Q",extensions:["q"],load(){return Ge(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>ct(e.q))}}),He.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ge(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>ct(e.r))}}),He.of({name:"RPM Changes",load(){return Ge(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ct(e.rpmChanges))}}),He.of({name:"RPM Spec",extensions:["spec"],load(){return Ge(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ct(e.rpmSpec))}}),He.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ge(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>ct(e.ruby))}}),He.of({name:"SAS",extensions:["sas"],load(){return Ge(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>ct(e.sas))}}),He.of({name:"Scala",extensions:["scala"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.scala))}}),He.of({name:"Scheme",extensions:["scm","ss"],load(){return Ge(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>ct(e.scheme))}}),He.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ge(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>ct(e.shell))}}),He.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ge(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>ct(e.sieve))}}),He.of({name:"Smalltalk",extensions:["st"],load(){return Ge(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>ct(e.smalltalk))}}),He.of({name:"Solr",load(){return Ge(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>ct(e.solr))}}),He.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.sml))}}),He.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ge(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>ct(e.sparql))}}),He.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ge(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>ct(e.spreadsheet))}}),He.of({name:"Squirrel",extensions:["nut"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.squirrel))}}),He.of({name:"Stylus",extensions:["styl"],load(){return Ge(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>ct(e.stylus))}}),He.of({name:"Swift",extensions:["swift"],load(){return Ge(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>ct(e.swift))}}),He.of({name:"sTeX",load(){return Ge(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),He.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ge(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),He.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ge(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),He.of({name:"Tcl",extensions:["tcl"],load(){return Ge(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>ct(e.tcl))}}),He.of({name:"Textile",extensions:["textile"],load(){return Ge(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>ct(e.textile))}}),He.of({name:"TiddlyWiki",load(){return Ge(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>ct(e.tiddlyWiki))}}),He.of({name:"Tiki wiki",load(){return Ge(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>ct(e.tiki))}}),He.of({name:"TOML",extensions:["toml"],load(){return Ge(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>ct(e.toml))}}),He.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ge(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>ct(e.troff))}}),He.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ge(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>ct(e.ttcn))}}),He.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ge(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>ct(e.ttcnCfg))}}),He.of({name:"Turtle",extensions:["ttl"],load(){return Ge(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>ct(e.turtle))}}),He.of({name:"Web IDL",extensions:["webidl"],load(){return Ge(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>ct(e.webIDL))}}),He.of({name:"VB.NET",extensions:["vb"],load(){return Ge(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>ct(e.vb))}}),He.of({name:"VBScript",extensions:["vbs"],load(){return Ge(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>ct(e.vbScript))}}),He.of({name:"Velocity",extensions:["vtl"],load(){return Ge(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>ct(e.velocity))}}),He.of({name:"Verilog",extensions:["v"],load(){return Ge(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),He.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ge(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>ct(e.vhdl))}}),He.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ge(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>ct(e.xQuery))}}),He.of({name:"Yacas",extensions:["ys"],load(){return Ge(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>ct(e.yacas))}}),He.of({name:"Z80",extensions:["z80"],load(){return Ge(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>ct(e.z80))}}),He.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.mscgen))}}),He.of({name:"Xù",extensions:["xu"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.xu))}}),He.of({name:"MsGenny",extensions:["msgenny"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.msgenny))}}),He.of({name:"Vue",extensions:["vue"],load(){return Ge(()=>import("./index-Do6PzU9v.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),He.of({name:"Angular Template",load(){return Ge(()=>import("./index-CoMhsst-.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];var Yoe=e=>{var{theme:t,settings:r={},styles:n=[]}=e,s={".cm-gutters":{}},a={};r.background&&(a.backgroundColor=r.background),r.backgroundImage&&(a.backgroundImage=r.backgroundImage),r.foreground&&(a.color=r.foreground),r.fontSize&&(a.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=a),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var i={};r.gutterActiveForeground&&(i.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},i.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=i,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var o=mt.theme(s,{dark:t==="dark"}),l=sO.define(n),u=[o,woe(l)];return u},bWt={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},vWt=[{tag:re.comment,color:"#6272a4"},{tag:re.string,color:"#f1fa8c"},{tag:re.atom,color:"#bd93f9"},{tag:re.meta,color:"#f8f8f2"},{tag:[re.keyword,re.operator,re.tagName],color:"#ff79c6"},{tag:[re.function(re.propertyName),re.propertyName],color:"#66d9ef"},{tag:[re.definition(re.variableName),re.function(re.variableName),re.className,re.attributeName],color:"#50fa7b"},{tag:re.atom,color:"#bd93f9"}],GL=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return Yoe({theme:t,settings:lm({},bWt,r),styles:[...vWt,...n]})};GL();const xWt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Joe(e.state,r.from);return n.line?SWt(e):n.block?EWt(e):!1};function Koe(e,t){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let s=e(t,r);return s?(n(r.update(s)),!0):!1}}const SWt=Koe(_Wt,0),wWt=Koe(RQe,0),EWt=Koe((e,t)=>RQe(e,t,OWt(t)),0);function Joe(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const M_=50;function kWt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-M_,n),i=e.sliceDoc(s,s+M_),o=/\s*$/.exec(a)[0].length,l=/^\s*/.exec(i)[0].length,u=a.length-o;if(a.slice(u-t.length,u)==t&&i.slice(l,l+r.length)==r)return{open:{pos:n-o,margin:o&&1},close:{pos:s+l,margin:l&&1}};let d,p;s-n<=2*M_?d=p=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+M_),p=e.sliceDoc(s-M_,s));let f=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(p)[0].length,m=p.length-h-r.length;return d.slice(f,f+t.length)==t&&p.slice(m,m+r.length)==r?{open:{pos:n+f+t.length,margin:/\s/.test(d.charAt(f+t.length))?1:0},close:{pos:s-h-r.length,margin:/\s/.test(p.charAt(m-1))?1:0}}:null}function OWt(e){let t=[];for(let r of e.selection.ranges){let n=e.doc.lineAt(r.from),s=r.to<=n.to?n:e.doc.lineAt(r.to);s.from>n.from&&s.from==r.to&&(s=r.to==n.to+1?n:e.doc.lineAt(r.to-1));let a=t.length-1;a>=0&&t[a].to>n.from?t[a].to=s.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return t}function RQe(e,t,r=t.selection.ranges){let n=r.map(a=>Joe(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>kWt(t,n[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(r.map((a,i)=>s[i]?[]:[{from:a.from,insert:n[i].open+" "},{from:a.to,insert:" "+n[i].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let i=0,o;i<s.length;i++)if(o=s[i]){let l=n[i],{open:u,close:d}=o;a.push({from:u.pos-l.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+l.close.length})}return{changes:a}}return null}function _Wt(e,t,r=t.selection.ranges){let n=[],s=-1;for(let{from:a,to:i}of r){let o=n.length,l=1e9,u=Joe(t,a).line;if(u){for(let d=a;d<=i;){let p=t.doc.lineAt(d);if(p.from>s&&(a==i||i>p.from)){s=p.from;let f=/^\s*/.exec(p.text)[0].length,h=f==p.length,m=p.text.slice(f,f+u.length)==u?f:-1;f<p.text.length&&f<l&&(l=f),n.push({line:p,comment:m,token:u,indent:f,empty:h,single:!1})}d=p.to+1}if(l<1e9)for(let d=o;d<n.length;d++)n[d].indent<n[d].line.text.length&&(n[d].indent=l);n.length==o+1&&(n[o].single=!0)}}if(e!=2&&n.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:o,token:l,indent:u,empty:d,single:p}of n)(p||!d)&&a.push({from:o.from+u,insert:l+" "});let i=t.changes(a);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:o,token:l}of n)if(o>=0){let u=i.from+o,d=u+l.length;i.text[d-i.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const HJ=Tm.define(),CWt=Tm.define(),TWt=Xt.define(),PQe=Xt.define({combine(e){return Am(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,r)=>(n,s)=>t(n,s)||r(n,s)})}}),$Qe=Ki.define({create(){return zh.empty},update(e,t){let r=t.state.facet(PQe),n=t.annotation(HJ);if(n){let l=cu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return l?d=Q3(d,d.length,r.minDepth,l):d=FQe(d,t.startState.selection),new zh(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(CWt);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(uo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=cu.fromTransaction(t),i=t.annotation(uo.time),o=t.annotation(uo.userEvent);return a?e=e.addChanges(a,i,o,r,t):t.selection&&(e=e.addSelection(t.startState.selection,i,o,r.newGroupDelay)),(s=="full"||s=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new zh(e.done.map(cu.fromJSON),e.undone.map(cu.fromJSON))}});function AWt(e={}){return[$Qe,PQe.of(e),mt.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?MQe:t.inputType=="historyRedo"?QJ:null;return n?(t.preventDefault(),n(r)):!1}})]}function ZL(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field($Qe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const MQe=ZL(0,!1),QJ=ZL(1,!1),DWt=ZL(0,!0),NWt=ZL(1,!0);class cu{constructor(t,r,n,s,a){this.changes=t,this.effects=r,this.mapped=n,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new cu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,r,n;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new cu(t.changes&&ao.fromJSON(t.changes),[],t.mapped&&Yh.fromJSON(t.mapped),t.startSelection&&Je.fromJSON(t.startSelection),t.selectionsAfter.map(Je.fromJSON))}static fromTransaction(t,r){let n=fp;for(let s of t.startState.facet(TWt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new cu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,fp)}static selection(t){return new cu(void 0,fp,void 0,void 0,t)}}function Q3(e,t,r,n){let s=t+1>r+20?t-r-1:0,a=e.slice(s,t);return a.push(n),a}function IWt(e,t){let r=[],n=!1;return e.iterChangedRanges((s,a)=>r.push(s,a)),t.iterChangedRanges((s,a,i,o)=>{for(let l=0;l<r.length;){let u=r[l++],d=r[l++];o>=u&&i<=d&&(n=!0)}}),n}function jWt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function LQe(e,t){return e.length?t.length?e.concat(t):e:t}const fp=[],RWt=200;function FQe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-RWt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),Q3(e,e.length-1,1e9,r.setSelAfter(n)))}else return[cu.selection([t])]}function PWt(e){let t=e[e.length-1],r=e.slice();return r[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),r}function vG(e,t){if(!e.length)return e;let r=e.length,n=fp;for(;r;){let s=$Wt(e[r-1],t,n);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,r);return a[r-1]=s,a}else t=s.mapped,r--,n=s.selectionsAfter}return n.length?[cu.selection(n)]:fp}function $Wt(e,t,r){let n=LQe(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):fp,r);if(!e.changes)return cu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new cu(s,en.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const MWt=/^(input\.type|delete)($|\.)/;class zh{constructor(t,r,n=0,s=void 0){this.done=t,this.undone=r,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new zh(this.done,this.undone):this}addChanges(t,r,n,s,a){let i=this.done,o=i[i.length-1];return o&&o.changes&&!o.changes.empty&&t.changes&&(!n||MWt.test(n))&&(!o.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,IWt(o.changes,t.changes))||n=="input.type.compose")?i=Q3(i,i.length-1,s.minDepth,new cu(t.changes.compose(o.changes),LQe(en.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,fp)):i=Q3(i,i.length,s.minDepth,t),new zh(i,fp,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:fp;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&jWt(a[a.length-1],t)?this:new zh(FQe(this.done,t),this.undone,r,n)}addMapping(t){return new zh(vG(this.done,t),vG(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,r,n){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],i=a.selectionsAfter[0]||r.selection;if(n&&a.selectionsAfter.length)return r.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:HJ.of({side:t,rest:PWt(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let o=s.length==1?fp:s.slice(0,s.length-1);return a.mapped&&(o=vG(o,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:HJ.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}zh.empty=new zh(fp,fp);const LWt=[{key:"Mod-z",run:MQe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:QJ,preventDefault:!0},{linux:"Ctrl-Shift-z",run:QJ,preventDefault:!0},{key:"Mod-u",run:DWt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:NWt,preventDefault:!0}];function iO(e,t){return Je.create(e.ranges.map(t),e.mainIndex)}function Xf(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Yf({state:e,dispatch:t},r){let n=iO(e.selection,r);return n.eq(e.selection,!0)?!1:(t(Xf(e,n)),!0)}function WL(e,t){return Je.cursor(t?e.to:e.from)}function BQe(e,t){return Yf(e,r=>r.empty?e.moveByChar(r,t):WL(r,t))}function rc(e){return e.textDirectionAt(e.state.selection.main.head)==Oa.LTR}const zQe=e=>BQe(e,!rc(e)),UQe=e=>BQe(e,rc(e));function VQe(e,t){return Yf(e,r=>r.empty?e.moveByGroup(r,t):WL(r,t))}const FWt=e=>VQe(e,!rc(e)),BWt=e=>VQe(e,rc(e));function zWt(e,t,r){if(t.type.prop(r))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function XL(e,t,r){let n=ba(e).resolveInner(t.head),s=r?fn.closedBy:fn.openedBy;for(let l=t.head;;){let u=r?n.childAfter(l):n.childBefore(l);if(!u)break;zWt(e,u,s)?n=u:l=r?u.to:u.from}let a=n.type.prop(s),i,o;return a&&(i=r?Bh(e,n.from,1):Bh(e,n.to,-1))&&i.matched?o=r?i.end.to:i.end.from:o=r?n.to:n.from,Je.cursor(o,r?-1:1)}const UWt=e=>Yf(e,t=>XL(e.state,t,!rc(e))),VWt=e=>Yf(e,t=>XL(e.state,t,rc(e)));function qQe(e,t){return Yf(e,r=>{if(!r.empty)return WL(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const HQe=e=>qQe(e,!1),QQe=e=>qQe(e,!0);function GQe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,s;if(t){for(let a of e.state.facet(mt.scrollMargins)){let i=a(e);i?.top&&(r=Math.max(i?.top,r)),i?.bottom&&(n=Math.max(i?.bottom,n))}s=e.scrollDOM.clientHeight-r-n}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function ZQe(e,t){let r=GQe(e),{state:n}=e,s=iO(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):WL(i,t));if(s.eq(n.selection))return!1;let a;if(r.selfScroll){let i=e.coordsAtPos(n.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),l=o.top+r.marginTop,u=o.bottom-r.marginBottom;i&&i.top>l&&i.bottom<u&&(a=mt.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-l}))}return e.dispatch(Xf(n,s),{effects:a}),!0}const R_e=e=>ZQe(e,!1),GJ=e=>ZQe(e,!0);function Uv(e,t,r){let n=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,r);if(s.head==t.head&&s.head!=(r?n.to:n.from)&&(s=e.moveToLineBoundary(t,r,!1)),!r&&s.head==n.from&&n.length){let a=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;a&&t.head!=n.from+a&&(s=Je.cursor(n.from+a))}return s}const qWt=e=>Yf(e,t=>Uv(e,t,!0)),HWt=e=>Yf(e,t=>Uv(e,t,!1)),QWt=e=>Yf(e,t=>Uv(e,t,!rc(e))),GWt=e=>Yf(e,t=>Uv(e,t,rc(e))),ZWt=e=>Yf(e,t=>Je.cursor(e.lineBlockAt(t.head).from,1)),WWt=e=>Yf(e,t=>Je.cursor(e.lineBlockAt(t.head).to,-1));function XWt(e,t,r){let n=!1,s=iO(e.selection,a=>{let i=Bh(e,a.head,-1)||Bh(e,a.head,1)||a.head>0&&Bh(e,a.head-1,1)||a.head<e.doc.length&&Bh(e,a.head+1,-1);if(!i||!i.end)return a;n=!0;let o=i.start.from==a.head?i.end.to:i.end.from;return Je.cursor(o)});return n?(t(Xf(e,s)),!0):!1}const YWt=({state:e,dispatch:t})=>XWt(e,t);function zp(e,t){let r=iO(e.state.selection,n=>{let s=t(n);return Je.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return r.eq(e.state.selection)?!1:(e.dispatch(Xf(e.state,r)),!0)}function WQe(e,t){return zp(e,r=>e.moveByChar(r,t))}const XQe=e=>WQe(e,!rc(e)),YQe=e=>WQe(e,rc(e));function KQe(e,t){return zp(e,r=>e.moveByGroup(r,t))}const KWt=e=>KQe(e,!rc(e)),JWt=e=>KQe(e,rc(e)),eXt=e=>zp(e,t=>XL(e.state,t,!rc(e))),tXt=e=>zp(e,t=>XL(e.state,t,rc(e)));function JQe(e,t){return zp(e,r=>e.moveVertically(r,t))}const eGe=e=>JQe(e,!1),tGe=e=>JQe(e,!0);function rGe(e,t){return zp(e,r=>e.moveVertically(r,t,GQe(e).height))}const P_e=e=>rGe(e,!1),$_e=e=>rGe(e,!0),rXt=e=>zp(e,t=>Uv(e,t,!0)),nXt=e=>zp(e,t=>Uv(e,t,!1)),sXt=e=>zp(e,t=>Uv(e,t,!rc(e))),aXt=e=>zp(e,t=>Uv(e,t,rc(e))),iXt=e=>zp(e,t=>Je.cursor(e.lineBlockAt(t.head).from)),oXt=e=>zp(e,t=>Je.cursor(e.lineBlockAt(t.head).to)),M_e=({state:e,dispatch:t})=>(t(Xf(e,{anchor:0})),!0),L_e=({state:e,dispatch:t})=>(t(Xf(e,{anchor:e.doc.length})),!0),F_e=({state:e,dispatch:t})=>(t(Xf(e,{anchor:e.selection.main.anchor,head:0})),!0),B_e=({state:e,dispatch:t})=>(t(Xf(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),lXt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),cXt=({state:e,dispatch:t})=>{let r=YL(e).map(({from:n,to:s})=>Je.range(n,Math.min(s+1,e.doc.length)));return t(e.update({selection:Je.create(r),userEvent:"select"})),!0},uXt=({state:e,dispatch:t})=>{let r=iO(e.selection,n=>{let s=ba(e),a=s.resolveStack(n.from,1);if(n.empty){let i=s.resolveStack(n.from,-1);i.node.from>=a.node.from&&i.node.to<=a.node.to&&(a=i)}for(let i=a;i;i=i.next){let{node:o}=i;if((o.from<n.from&&o.to>=n.to||o.to>n.to&&o.from<=n.from)&&i.next)return Je.range(o.to,o.from)}return n});return r.eq(e.selection)?!1:(t(Xf(e,r)),!0)};function nGe(e,t){let{state:r}=e,n=r.selection,s=r.selection.ranges.slice();for(let a of r.selection.ranges){let i=r.doc.lineAt(a.head);if(t?i.to<e.state.doc.length:i.from>0)for(let o=a;;){let l=e.moveVertically(o,t);if(l.head<i.from||l.head>i.to){s.some(u=>u.head==l.head)||s.push(l);break}else{if(l.head==o.head)break;o=l}}}return s.length==n.ranges.length?!1:(e.dispatch(Xf(r,Je.create(s,s.length-1))),!0)}const dXt=e=>nGe(e,!1),pXt=e=>nGe(e,!0),fXt=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=Je.create([r.main]):r.main.empty||(n=Je.create([Je.cursor(r.main.head)])),n?(t(Xf(e,n)),!0):!1};function gI(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,s=n.changeByRange(a=>{let{from:i,to:o}=a;if(i==o){let l=t(a);l<i?(r="delete.backward",l=b2(e,l,!1)):l>i&&(r="delete.forward",l=b2(e,l,!0)),i=Math.min(i,l),o=Math.max(o,l)}else i=b2(e,i,!1),o=b2(e,o,!0);return i==o?{range:a}:{changes:{from:i,to:o},range:Je.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(n.update(s,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?mt.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function b2(e,t,r){if(e instanceof mt)for(let n of e.state.facet(mt.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const sGe=(e,t,r)=>gI(e,n=>{let s=n.from,{state:a}=e,i=a.doc.lineAt(s),o,l;if(r&&!t&&s>i.from&&s<i.from+200&&!/[^ \t]/.test(o=i.text.slice(0,s-i.from))){if(o[o.length-1]==" ")return s-1;let u=Mf(o,a.tabSize),d=u%W0(a)||W0(a);for(let p=0;p<d&&o[o.length-1-p]==" ";p++)s--;l=s}else l=Qo(i.text,s-i.from,t,t)+i.from,l==s&&i.number!=(t?a.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(l-i.from,s-i.from))&&(l=Qo(i.text,l-i.from,!1,!1)+i.from);return l}),ZJ=e=>sGe(e,!1,!0),aGe=e=>sGe(e,!0,!1),iGe=(e,t)=>gI(e,r=>{let n=r.head,{state:s}=e,a=s.doc.lineAt(n),i=s.charCategorizer(n);for(let o=null;;){if(n==(t?a.to:a.from)){n==r.head&&a.number!=(t?s.doc.lines:1)&&(n+=t?1:-1);break}let l=Qo(a.text,n-a.from,t)+a.from,u=a.text.slice(Math.min(n,l)-a.from,Math.max(n,l)-a.from),d=i(u);if(o!=null&&d!=o)break;(u!=" "||n!=r.head)&&(o=d),n=l}return n}),oGe=e=>iGe(e,!1),hXt=e=>iGe(e,!0),mXt=e=>gI(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),gXt=e=>gI(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),yXt=e=>gI(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),bXt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:ws.of(["",""])},range:Je.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},vXt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let s=n.from,a=e.doc.lineAt(s),i=s==a.from?s-1:Qo(a.text,s-a.from,!1)+a.from,o=s==a.to?s+1:Qo(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:o,insert:e.doc.slice(s,o).append(e.doc.slice(i,s))},range:Je.cursor(o)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function YL(e){let t=[],r=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.from),a=e.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=e.doc.lineAt(n.to-1)),r>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(n)}else t.push({from:s.from,to:a.to,ranges:[n]});r=a.number+1}return t}function lGe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of YL(e)){if(r?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(r?a.to+1:a.from-1),o=i.length+1;if(r){n.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let l of a.ranges)s.push(Je.range(Math.min(e.doc.length,l.anchor+o),Math.min(e.doc.length,l.head+o)))}else{n.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let l of a.ranges)s.push(Je.range(l.anchor-o,l.head-o))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:Je.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const xXt=({state:e,dispatch:t})=>lGe(e,t,!1),SXt=({state:e,dispatch:t})=>lGe(e,t,!0);function cGe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of YL(e))r?n.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):n.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(n);return t(e.update({changes:s,selection:e.selection.map(s,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const wXt=({state:e,dispatch:t})=>cGe(e,t,!1),EXt=({state:e,dispatch:t})=>cGe(e,t,!0),kXt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(YL(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=iO(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),o=e.coordsAtPos(s.head,s.assoc||1);o&&(a=i.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function OXt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=ba(e).resolveInner(t),n=r.childBefore(t),s=r.childAfter(t),a;return n&&s&&n.to<=t&&s.from>=t&&(a=n.type.prop(fn.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(n.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}const z_e=uGe(!1),_Xt=uGe(!0);function uGe(e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=t.changeByRange(s=>{let{from:a,to:i}=s,o=t.doc.lineAt(a),l=!e&&a==i&&OXt(t,a);e&&(a=i=(i<=o.to?o:t.doc.lineAt(i)).to);let u=new VL(t,{simulateBreak:a,simulateDoubleBreak:!!l}),d=voe(u,a);for(d==null&&(d=Mf(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;l?{from:a,to:i}=l:a>o.from&&a<o.from+100&&!/\S/.test(o.text.slice(0,a))&&(a=o.from);let p=["",DA(t,d)];return l&&p.push(DA(t,u.lineIndent(o.from,-1))),{changes:{from:a,to:i,insert:ws.of(p)},range:Je.cursor(a+1+p[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function ele(e,t){let r=-1;return e.changeByRange(n=>{let s=[];for(let i=n.from;i<=n.to;){let o=e.doc.lineAt(i);o.number>r&&(n.empty||n.to>o.from)&&(t(o,s,n),r=o.number),i=o.to+1}let a=e.changes(s);return{changes:s,range:Je.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const CXt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new VL(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=ele(e,(a,i,o)=>{let l=voe(n,a.from);if(l==null)return;/\S/.test(a.text)||(l=0);let u=/^\s*/.exec(a.text)[0],d=DA(e,l);(u!=d||o.from<a.from+u.length)&&(r[a.from]=l,i.push({from:a.from,to:a.from+u.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},dGe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ele(e,(r,n)=>{n.push({from:r.from,insert:e.facet(nO)})}),{userEvent:"input.indent"})),!0),pGe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ele(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Mf(s,e.tabSize),i=0,o=DA(e,Math.max(0,a-W0(e)));for(;i<s.length&&i<o.length&&s.charCodeAt(i)==o.charCodeAt(i);)i++;n.push({from:r.from+i,to:r.from+s.length,insert:o.slice(i)})}),{userEvent:"delete.dedent"})),!0),TXt=e=>(e.setTabFocusMode(),!0),AXt=[{key:"Ctrl-b",run:zQe,shift:XQe,preventDefault:!0},{key:"Ctrl-f",run:UQe,shift:YQe},{key:"Ctrl-p",run:HQe,shift:eGe},{key:"Ctrl-n",run:QQe,shift:tGe},{key:"Ctrl-a",run:ZWt,shift:iXt},{key:"Ctrl-e",run:WWt,shift:oXt},{key:"Ctrl-d",run:aGe},{key:"Ctrl-h",run:ZJ},{key:"Ctrl-k",run:mXt},{key:"Ctrl-Alt-h",run:oGe},{key:"Ctrl-o",run:bXt},{key:"Ctrl-t",run:vXt},{key:"Ctrl-v",run:GJ}],DXt=[{key:"ArrowLeft",run:zQe,shift:XQe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:FWt,shift:KWt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:QWt,shift:sXt,preventDefault:!0},{key:"ArrowRight",run:UQe,shift:YQe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:BWt,shift:JWt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:GWt,shift:aXt,preventDefault:!0},{key:"ArrowUp",run:HQe,shift:eGe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:M_e,shift:F_e},{mac:"Ctrl-ArrowUp",run:R_e,shift:P_e},{key:"ArrowDown",run:QQe,shift:tGe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:L_e,shift:B_e},{mac:"Ctrl-ArrowDown",run:GJ,shift:$_e},{key:"PageUp",run:R_e,shift:P_e},{key:"PageDown",run:GJ,shift:$_e},{key:"Home",run:HWt,shift:nXt,preventDefault:!0},{key:"Mod-Home",run:M_e,shift:F_e},{key:"End",run:qWt,shift:rXt,preventDefault:!0},{key:"Mod-End",run:L_e,shift:B_e},{key:"Enter",run:z_e,shift:z_e},{key:"Mod-a",run:lXt},{key:"Backspace",run:ZJ,shift:ZJ,preventDefault:!0},{key:"Delete",run:aGe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:oGe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:hXt,preventDefault:!0},{mac:"Mod-Backspace",run:gXt,preventDefault:!0},{mac:"Mod-Delete",run:yXt,preventDefault:!0}].concat(AXt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),NXt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:UWt,shift:eXt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:VWt,shift:tXt},{key:"Alt-ArrowUp",run:xXt},{key:"Shift-Alt-ArrowUp",run:wXt},{key:"Alt-ArrowDown",run:SXt},{key:"Shift-Alt-ArrowDown",run:EXt},{key:"Mod-Alt-ArrowUp",run:dXt},{key:"Mod-Alt-ArrowDown",run:pXt},{key:"Escape",run:fXt},{key:"Mod-Enter",run:_Xt},{key:"Alt-l",mac:"Ctrl-l",run:cXt},{key:"Mod-i",run:uXt,preventDefault:!0},{key:"Mod-[",run:pGe},{key:"Mod-]",run:dGe},{key:"Mod-Alt-\\",run:CXt},{key:"Shift-Mod-k",run:kXt},{key:"Shift-Mod-\\",run:YWt},{key:"Mod-/",run:xWt},{key:"Alt-A",run:wWt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:TXt}].concat(DXt),IXt={key:"Tab",run:dGe,shift:pGe},U_e=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class YE{constructor(t,r,n=0,s=t.length,a,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,s),this.bufferStart=n,this.normalize=a?o=>a(U_e(o)):U_e,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return tu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=toe(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=Dh(t);let s=this.normalize(r);if(s.length)for(let a=0,i=n;;a++){let o=s.charCodeAt(a),l=this.match(o,i,this.bufferPos+this.bufferStart);if(a==s.length-1){if(l)return this.value=l,this;break}i==n&&a<r.length&&r.charCodeAt(a)==o&&i++}}}match(t,r,n){let s=null;for(let a=0;a<this.matches.length;a+=2){let i=this.matches[a],o=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?s={from:this.matches[a+1],to:n}:(this.matches[a]++,o=!0)),o||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:r,to:n}:this.matches.push(1,r)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(YE.prototype[Symbol.iterator]=function(){return this});const fGe={from:-1,to:-1,match:/.*/.exec("")},tle="gm"+(/x/.unicode==null?"":"u");class hGe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=fGe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new mGe(t,r,n,s,a);this.re=new RegExp(r,tle+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=G3(t,s),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=G3(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<s||n>this.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const xG=new WeakMap;class lE{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=xG.get(t);if(!s||s.from>=n||s.to<=r){let o=new lE(r,t.sliceString(r,n));return xG.set(t,o),o}if(s.from==r&&s.to==n)return s;let{text:a,from:i}=s;return i>r&&(a=t.sliceString(r,i)+a,i=r),s.to<n&&(a+=t.sliceString(s.to,n)),xG.set(t,new lE(i,a)),new lE(r,a.slice(r-i,n-i))}}class mGe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=fGe,this.matchPos=G3(t,s),this.re=new RegExp(r,tle+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=lE.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=G3(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=lE.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(hGe.prototype[Symbol.iterator]=mGe.prototype[Symbol.iterator]=function(){return this});function jXt(e){try{return new RegExp(e,tle),!0}catch{return!1}}function G3(e,t){if(t>=e.length)return t;let r=e.lineAt(t),n;for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}function WJ(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),r=wa("input",{class:"cm-textfield",name:"line",value:t}),n=wa("form",{class:"cm-gotoLine",onkeydown:a=>{a.keyCode==27?(a.preventDefault(),e.dispatch({effects:xT.of(!1)}),e.focus()):a.keyCode==13&&(a.preventDefault(),s())},onsubmit:a=>{a.preventDefault(),s()}},wa("label",e.state.phrase("Go to line"),": ",r)," ",wa("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),wa("button",{name:"close",onclick:()=>{e.dispatch({effects:xT.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function s(){let a=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.value);if(!a)return;let{state:i}=e,o=i.doc.lineAt(i.selection.main.head),[,l,u,d,p]=a,f=d?+d.slice(1):0,h=u?+u:o.number;if(u&&p){let b=h/100;l&&(b=b*(l=="-"?-1:1)+o.number/i.doc.lines),h=Math.round(i.doc.lines*b)}else u&&l&&(h=h*(l=="-"?-1:1)+o.number);let m=i.doc.line(Math.max(1,Math.min(i.doc.lines,h))),y=Je.cursor(m.from+Math.max(0,Math.min(f,m.length)));e.dispatch({effects:[xT.of(!1),mt.scrollIntoView(y.from,{y:"center"})],selection:y}),e.focus()}return{dom:n}}const xT=en.define(),V_e=Ki.define({create(){return!0},update(e,t){for(let r of t.effects)r.is(xT)&&(e=r.value);return e},provide:e=>AA.from(e,t=>t?WJ:null)}),RXt=e=>{let t=TA(e,WJ);if(!t){let r=[xT.of(!0)];e.state.field(V_e,!1)==null&&r.push(en.appendConfig.of([V_e,PXt])),e.dispatch({effects:r}),t=TA(e,WJ)}return t&&t.dom.querySelector("input").select(),!0},PXt=mt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),$Xt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},MXt=Xt.define({combine(e){return Am(e,$Xt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function LXt(e){return[VXt,UXt]}const FXt=rr.mark({class:"cm-selectionMatch"}),BXt=rr.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function q_e(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=li.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=li.Word)}function zXt(e,t,r,n){return e(t.sliceDoc(r,r+1))==li.Word&&e(t.sliceDoc(n-1,n))==li.Word}const UXt=xi.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(MXt),{state:r}=e,n=r.selection;if(n.ranges.length>1)return rr.none;let s=n.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return rr.none;let l=r.wordAt(s.head);if(!l)return rr.none;i=r.charCategorizer(s.head),a=r.sliceDoc(l.from,l.to)}else{let l=s.to-s.from;if(l<t.minSelectionLength||l>200)return rr.none;if(t.wholeWords){if(a=r.sliceDoc(s.from,s.to),i=r.charCategorizer(s.head),!(q_e(i,r,s.from,s.to)&&zXt(i,r,s.from,s.to)))return rr.none}else if(a=r.sliceDoc(s.from,s.to),!a)return rr.none}let o=[];for(let l of e.visibleRanges){let u=new YE(r.doc,a,l.from,l.to);for(;!u.next().done;){let{from:d,to:p}=u.value;if((!i||q_e(i,r,d,p))&&(s.empty&&d<=s.from&&p>=s.to?o.push(BXt.range(d,p)):(d>=s.to||p<=s.from)&&o.push(FXt.range(d,p)),o.length>t.maxMatches))return rr.none}}return rr.set(o)}},{decorations:e=>e.decorations}),VXt=mt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),qXt=({state:e,dispatch:t})=>{let{selection:r}=e,n=Je.create(r.ranges.map(s=>e.wordAt(s.head)||Je.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function HXt(e,t){let{main:r,ranges:n}=e.selection,s=e.wordAt(r.head),a=s&&s.from==r.from&&s.to==r.to;for(let i=!1,o=new YE(e.doc,t,n[n.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new YE(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),i=!0}else{if(i&&n.some(l=>l.from==o.value.from))continue;if(a){let l=e.wordAt(o.value.from);if(!l||l.from!=o.value.from||l.to!=o.value.to)continue}return o.value}}const QXt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return qXt({state:e,dispatch:t});let n=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=n))return!1;let s=HXt(e,n);return s?(t(e.update({selection:e.selection.addRange(Je.range(s.from,s.to),!1),effects:mt.scrollIntoView(s.to)})),!0):!1},oO=Xt.define({combine(e){return Am(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new sYt(t),scrollToMatch:t=>mt.scrollIntoView(t)})}});class gGe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||jXt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
|
|
161
161
|
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new XXt(this):new ZXt(this)}getCursor(t,r=0,n){let s=t.doc?t:Zn.create({doc:t});return n==null&&(n=s.doc.length),this.regexp?gw(this,s,r,n):mw(this,s,r,n)}}class yGe{constructor(t){this.spec=t}}function mw(e,t,r,n){return new YE(t.doc,e.unquoted,r,n,e.caseSensitive?void 0:s=>s.toLowerCase(),e.wholeWord?GXt(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function GXt(e,t){return(r,n,s,a)=>((a>r||a+s.length<n)&&(a=Math.max(0,r-2),s=e.sliceString(a,Math.min(e.length,n+2))),(t(Z3(s,r-a))!=li.Word||t(W3(s,r-a))!=li.Word)&&(t(W3(s,n-a))!=li.Word||t(Z3(s,n-a))!=li.Word))}class ZXt extends yGe{constructor(t){super(t)}nextMatch(t,r,n){let s=mw(this.spec,t,n,t.doc.length).nextOverlapping();if(s.done){let a=Math.min(t.doc.length,r+this.spec.unquoted.length);s=mw(this.spec,t,0,a).nextOverlapping()}return s.done||s.value.from==r&&s.value.to==n?null:s.value}prevMatchInRange(t,r,n){for(let s=n;;){let a=Math.max(r,s-1e4-this.spec.unquoted.length),i=mw(this.spec,t,a,s),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(a==r)return null;s-=1e4}}prevMatch(t,r,n){let s=this.prevMatchInRange(t,0,r);return s||(s=this.prevMatchInRange(t,Math.max(0,n-this.spec.unquoted.length),t.doc.length)),s&&(s.from!=r||s.to!=n)?s:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,r){let n=mw(this.spec,t,0,t.doc.length),s=[];for(;!n.next().done;){if(s.length>=r)return null;s.push(n.value)}return s}highlight(t,r,n,s){let a=mw(this.spec,t,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}function gw(e,t,r,n){return new hGe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?WXt(t.charCategorizer(t.selection.main.head)):void 0},r,n)}function Z3(e,t){return e.slice(Qo(e,t,!1),t)}function W3(e,t){return e.slice(t,Qo(e,t))}function WXt(e){return(t,r,n)=>!n[0].length||(e(Z3(n.input,n.index))!=li.Word||e(W3(n.input,n.index))!=li.Word)&&(e(W3(n.input,n.index+n[0].length))!=li.Word||e(Z3(n.input,n.index+n[0].length))!=li.Word)}class XXt extends yGe{nextMatch(t,r,n){let s=gw(this.spec,t,n,t.doc.length).next();return s.done&&(s=gw(this.spec,t,0,r).next()),s.done?null:s.value}prevMatchInRange(t,r,n){for(let s=1;;s++){let a=Math.max(r,n-s*1e4),i=gw(this.spec,t,a,n),o=null;for(;!i.next().done;)o=i.value;if(o&&(a==r||o.from>a+10))return o;if(a==r)return null}}prevMatch(t,r,n){return this.prevMatchInRange(t,0,r)||this.prevMatchInRange(t,n,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return t.match[0];if(n=="$")return"$";for(let s=n.length;s>0;s--){let a=+n.slice(0,s);if(a>0&&a<t.match.length)return t.match[a]+n.slice(s)}return r})}matchAll(t,r){let n=gw(this.spec,t,0,t.doc.length),s=[];for(;!n.next().done;){if(s.length>=r)return null;s.push(n.value)}return s}highlight(t,r,n,s){let a=gw(this.spec,t,Math.max(0,r-250),Math.min(n+250,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}const BA=en.define(),rle=en.define(),Hb=Ki.define({create(e){return new SG(XJ(e).create(),null)},update(e,t){for(let r of t.effects)r.is(BA)?e=new SG(r.value.create(),e.panel):r.is(rle)&&(e=new SG(e.query,r.value?nle:null));return e},provide:e=>AA.from(e,t=>t.panel)});class SG{constructor(t,r){this.query=t,this.panel=r}}const YXt=rr.mark({class:"cm-searchMatch"}),KXt=rr.mark({class:"cm-searchMatch cm-searchMatch-selected"}),JXt=xi.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Hb))}update(e){let t=e.state.field(Hb);(t!=e.startState.field(Hb)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return rr.none;let{view:r}=this,n=new yu;for(let s=0,a=r.visibleRanges,i=a.length;s<i;s++){let{from:o,to:l}=a[s];for(;s<i-1&&l>a[s+1].from-500;)l=a[++s].to;e.highlight(r.state,o,l,(u,d)=>{let p=r.state.selection.ranges.some(f=>f.from==u&&f.to==d);n.add(u,d,p?KXt:YXt)})}return n.finish()}},{decorations:e=>e.decorations});function yI(e){return t=>{let r=t.state.field(Hb,!1);return r&&r.query.spec.valid?e(t,r):xGe(t)}}const X3=yI((e,{query:t})=>{let{to:r}=e.state.selection.main,n=t.nextMatch(e.state,r,r);if(!n)return!1;let s=Je.single(n.from,n.to),a=e.state.facet(oO);return e.dispatch({selection:s,effects:[sle(e,n),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),vGe(e),!0}),Y3=yI((e,{query:t})=>{let{state:r}=e,{from:n}=r.selection.main,s=t.prevMatch(r,n,n);if(!s)return!1;let a=Je.single(s.from,s.to),i=e.state.facet(oO);return e.dispatch({selection:a,effects:[sle(e,s),i.scrollToMatch(a.main,e)],userEvent:"select.search"}),vGe(e),!0}),eYt=yI((e,{query:t})=>{let r=t.matchAll(e.state,1e3);return!r||!r.length?!1:(e.dispatch({selection:Je.create(r.map(n=>Je.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),tYt=({state:e,dispatch:t})=>{let r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:s}=r.main,a=[],i=0;for(let o=new YE(e.doc,e.sliceDoc(n,s));!o.next().done;){if(a.length>1e3)return!1;o.value.from==n&&(i=a.length),a.push(Je.range(o.value.from,o.value.to))}return t(e.update({selection:Je.create(a,i),userEvent:"select.search.matches"})),!0},H_e=yI((e,{query:t})=>{let{state:r}=e,{from:n,to:s}=r.selection.main;if(r.readOnly)return!1;let a=t.nextMatch(r,n,n);if(!a)return!1;let i=a,o=[],l,u,d=[];i.from==n&&i.to==s&&(u=r.toText(t.getReplacement(i)),o.push({from:i.from,to:i.to,insert:u}),i=t.nextMatch(r,i.from,i.to),d.push(mt.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+".")));let p=e.state.changes(o);return i&&(l=Je.single(i.from,i.to).map(p),d.push(sle(e,i)),d.push(r.facet(oO).scrollToMatch(l.main,e))),e.dispatch({changes:p,selection:l,effects:d,userEvent:"input.replace"}),!0}),rYt=yI((e,{query:t})=>{if(e.state.readOnly)return!1;let r=t.matchAll(e.state,1e9).map(s=>{let{from:a,to:i}=s;return{from:a,to:i,insert:t.getReplacement(s)}});if(!r.length)return!1;let n=e.state.phrase("replaced $ matches",r.length)+".";return e.dispatch({changes:r,effects:mt.announce.of(n),userEvent:"input.replace.all"}),!0});function nle(e){return e.state.facet(oO).createPanel(e)}function XJ(e,t){var r,n,s,a,i;let o=e.selection.main,l=o.empty||o.to>o.from+100?"":e.sliceDoc(o.from,o.to);if(t&&!l)return t;let u=e.facet(oO);return new gGe({search:((r=t?.literal)!==null&&r!==void 0?r:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=t?.caseSensitive)!==null&&n!==void 0?n:u.caseSensitive,literal:(s=t?.literal)!==null&&s!==void 0?s:u.literal,regexp:(a=t?.regexp)!==null&&a!==void 0?a:u.regexp,wholeWord:(i=t?.wholeWord)!==null&&i!==void 0?i:u.wholeWord})}function bGe(e){let t=TA(e,nle);return t&&t.dom.querySelector("[main-field]")}function vGe(e){let t=bGe(e);t&&t==e.root.activeElement&&t.select()}const xGe=e=>{let t=e.state.field(Hb,!1);if(t&&t.panel){let r=bGe(e);if(r&&r!=e.root.activeElement){let n=XJ(e.state,t.query.spec);n.valid&&e.dispatch({effects:BA.of(n)}),r.focus(),r.select()}}else e.dispatch({effects:[rle.of(!0),t?BA.of(XJ(e.state,t.query.spec)):en.appendConfig.of(iYt)]});return!0},SGe=e=>{let t=e.state.field(Hb,!1);if(!t||!t.panel)return!1;let r=TA(e,nle);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:rle.of(!1)}),!0},nYt=[{key:"Mod-f",run:xGe,scope:"editor search-panel"},{key:"F3",run:X3,shift:Y3,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:X3,shift:Y3,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:SGe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:tYt},{key:"Mod-Alt-g",run:RXt},{key:"Mod-d",run:QXt,preventDefault:!0}];class sYt{constructor(t){this.view=t;let r=this.query=t.state.field(Hb).query.spec;this.commit=this.commit.bind(this),this.searchField=wa("input",{value:r.search,placeholder:qu(t,"Find"),"aria-label":qu(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=wa("input",{value:r.replace,placeholder:qu(t,"Replace"),"aria-label":qu(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=wa("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=wa("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=wa("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(s,a,i){return wa("button",{class:"cm-button",name:s,onclick:a,type:"button"},i)}this.dom=wa("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>X3(t),[qu(t,"next")]),n("prev",()=>Y3(t),[qu(t,"previous")]),n("select",()=>eYt(t),[qu(t,"all")]),wa("label",null,[this.caseField,qu(t,"match case")]),wa("label",null,[this.reField,qu(t,"regexp")]),wa("label",null,[this.wordField,qu(t,"by word")]),...t.state.readOnly?[]:[wa("br"),this.replaceField,n("replace",()=>H_e(t),[qu(t,"replace")]),n("replaceAll",()=>rYt(t),[qu(t,"replace all")])],wa("button",{name:"close",onclick:()=>SGe(t),"aria-label":qu(t,"close"),type:"button"},["×"])])}commit(){let t=new gGe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:BA.of(t)}))}keydown(t){RVt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Y3:X3)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),H_e(this.view))}update(t){for(let r of t.transactions)for(let n of r.effects)n.is(BA)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(oO).top}}function qu(e,t){return e.state.phrase(t)}const v2=30,x2=/[\s\.,:;?!]/;function sle(e,{from:t,to:r}){let n=e.state.doc.lineAt(t),s=e.state.doc.lineAt(r).to,a=Math.max(n.from,t-v2),i=Math.min(s,r+v2),o=e.state.sliceDoc(a,i);if(a!=n.from){for(let l=0;l<v2;l++)if(!x2.test(o[l+1])&&x2.test(o[l])){o=o.slice(l);break}}if(i!=s){for(let l=o.length-1;l>o.length-v2;l--)if(!x2.test(o[l-1])&&x2.test(o[l])){o=o.slice(0,l);break}}return mt.announce.of(`${e.state.phrase("current match")}. ${o} ${e.state.phrase("on line")} ${n.number}.`)}const aYt=mt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),iYt=[Hb,Wf.low(JXt),aYt];class Q_e{constructor(t,r,n){this.from=t,this.to=r,this.diagnostic=n}}class t0{constructor(t,r,n){this.diagnostics=t,this.panel=r,this.selected=n}static init(t,r,n){let s=n.facet(zA).markerFilter;s&&(t=s(t,n));let a=t.slice().sort((d,p)=>d.from-p.from||d.to-p.to),i=new yu,o=[],l=0;for(let d=0;;){let p=d==a.length?null:a[d];if(!p&&!o.length)break;let f,h;for(o.length?(f=l,h=o.reduce((y,b)=>Math.min(y,b.to),p&&p.from>f?p.from:1e8)):(f=p.from,h=p.to,o.push(p),d++);d<a.length;){let y=a[d];if(y.from==f&&(y.to>y.from||y.to==f))o.push(y),d++,h=Math.min(y.to,h);else{h=Math.min(y.from,h);break}}let m=vYt(o);if(o.some(y=>y.from==y.to||y.from==y.to-1&&n.doc.lineAt(y.from).to==y.from))i.add(f,f,rr.widget({widget:new mYt(m),diagnostics:o.slice()}));else{let y=o.reduce((b,v)=>v.markClass?b+" "+v.markClass:b,"");i.add(f,h,rr.mark({class:"cm-lintRange cm-lintRange-"+m+y,diagnostics:o.slice(),inclusiveEnd:o.some(b=>b.to>h)}))}l=h;for(let y=0;y<o.length;y++)o[y].to<=l&&o.splice(y--,1)}let u=i.finish();return new t0(u,r,KE(u))}}function KE(e,t=null,r=0){let n=null;return e.between(r,1e9,(s,a,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!n)n=new Q_e(s,a,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new Q_e(n.from,a,n.diagnostic)}}),n}function oYt(e,t){let r=t.pos,n=t.end||r,s=e.state.facet(zA).hideOn(e,r,n);if(s!=null)return s;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(wGe))||e.changes.touchesRange(a.from,Math.max(a.to,n)))}function lYt(e,t){return e.field(id,!1)?t:t.concat(en.appendConfig.of(xYt))}const wGe=en.define(),ale=en.define(),EGe=en.define(),id=Ki.define({create(){return new t0(rr.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let r=e.diagnostics.map(t.changes),n=null,s=e.panel;if(e.selected){let a=t.changes.mapPos(e.selected.from,1);n=KE(r,e.selected.diagnostic,a)||KE(r,null,a)}!r.size&&s&&t.state.facet(zA).autoPanel&&(s=null),e=new t0(r,s,n)}for(let r of t.effects)if(r.is(wGe)){let n=t.state.facet(zA).autoPanel?r.value.length?UA.open:null:e.panel;e=t0.init(r.value,n,t.state)}else r.is(ale)?e=new t0(e.diagnostics,r.value?UA.open:null,e.selected):r.is(EGe)&&(e=new t0(e.diagnostics,e.panel,r.value));return e},provide:e=>[AA.from(e,t=>t.panel),mt.decorations.from(e,t=>t.diagnostics)]}),cYt=rr.mark({class:"cm-lintRange cm-lintRange-active"});function uYt(e,t,r){let{diagnostics:n}=e.state.field(id),s,a=-1,i=-1;n.between(t-(r<0?1:0),t+(r>0?1:0),(l,u,{spec:d})=>{if(t>=l&&t<=u&&(l==u||(t>l||r>0)&&(t<u||r<0)))return s=d.diagnostics,a=l,i=u,!1});let o=e.state.facet(zA).tooltipFilter;return s&&o&&(s=o(s,e.state)),s?{pos:a,end:i,above:e.state.doc.lineAt(a).to<i,create(){return{dom:dYt(e,s)}}}:null}function dYt(e,t){return wa("ul",{class:"cm-tooltip-lint"},t.map(r=>OGe(e,r,!1)))}const pYt=e=>{let t=e.state.field(id,!1);(!t||!t.panel)&&e.dispatch({effects:lYt(e.state,[ale.of(!0)])});let r=TA(e,UA.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},G_e=e=>{let t=e.state.field(id,!1);return!t||!t.panel?!1:(e.dispatch({effects:ale.of(!1)}),!0)},fYt=e=>{let t=e.state.field(id,!1);if(!t)return!1;let r=e.state.selection.main,n=t.diagnostics.iter(r.to+1);return!n.value&&(n=t.diagnostics.iter(0),!n.value||n.from==r.from&&n.to==r.to)?!1:(e.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},hYt=[{key:"Mod-Shift-m",run:pYt,preventDefault:!0},{key:"F8",run:fYt}],zA=Xt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Am(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Z_e,tooltipFilter:Z_e,needsRefresh:(t,r)=>t?r?n=>t(n)||r(n):t:r,hideOn:(t,r)=>t?r?(n,s,a)=>t(n,s,a)||r(n,s,a):t:r,autoPanel:(t,r)=>t||r})}}});function Z_e(e,t){return e?t?(r,n)=>t(e(r,n),n):e:t}function kGe(e){let t=[];if(e)e:for(let{name:r}of e){for(let n=0;n<r.length;n++){let s=r[n];if(/[a-zA-Z]/.test(s)&&!t.some(a=>a.toLowerCase()==s.toLowerCase())){t.push(s);continue e}}t.push("")}return t}function OGe(e,t,r){var n;let s=r?kGe(t.actions):[];return wa("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},wa("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(n=t.actions)===null||n===void 0?void 0:n.map((a,i)=>{let o=!1,l=h=>{if(h.preventDefault(),o)return;o=!0;let m=KE(e.state.field(id).diagnostics,t);m&&a.apply(e,m.from,m.to)},{name:u}=a,d=s[i]?u.indexOf(s[i]):-1,p=d<0?u:[u.slice(0,d),wa("u",u.slice(d,d+1)),u.slice(d+1)],f=a.markClass?" "+a.markClass:"";return wa("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[i]})"`}.`},p)}),t.source&&wa("div",{class:"cm-diagnosticSource"},t.source))}class mYt extends Rd{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return wa("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class W_e{constructor(t,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=OGe(t,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class UA{constructor(t){this.view=t,this.items=[];let r=s=>{if(s.keyCode==27)G_e(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],i=kGe(a.actions);for(let o=0;o<i.length;o++)if(i[o].toUpperCase().charCodeAt(0)==s.keyCode){let l=KE(this.view.state.field(id).diagnostics,a);l&&a.actions[o].apply(t,l.from,l.to)}}else return;s.preventDefault()},n=s=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(s.target)&&this.moveSelection(a)};this.list=wa("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:r,onclick:n}),this.dom=wa("div",{class:"cm-panel-lint"},this.list,wa("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>G_e(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(id).selected;if(!t)return-1;for(let r=0;r<this.items.length;r++)if(this.items[r].diagnostic==t.diagnostic)return r;return-1}update(){let{diagnostics:t,selected:r}=this.view.state.field(id),n=0,s=!1,a=null,i=new Set;for(t.between(0,this.view.state.doc.length,(o,l,{spec:u})=>{for(let d of u.diagnostics){if(i.has(d))continue;i.add(d);let p=-1,f;for(let h=n;h<this.items.length;h++)if(this.items[h].diagnostic==d){p=h;break}p<0?(f=new W_e(this.view,d),this.items.splice(n,0,f),s=!0):(f=this.items[p],p>n&&(this.items.splice(n,p-n),s=!0)),r&&f.diagnostic==r.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),a=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new W_e(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),a?(this.list.setAttribute("aria-activedescendant",a.id),this.view.requestMeasure({key:this,read:()=>({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:l})=>{let u=l.height/this.list.offsetHeight;o.top<l.top?this.list.scrollTop-=(l.top-o.top)/u:o.bottom>l.bottom&&(this.list.scrollTop+=(o.bottom-l.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let t=this.list.firstChild;function r(){let n=t;t=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;t!=n.dom;)r();t=n.dom.nextSibling}else this.list.insertBefore(n.dom,t);for(;t;)r()}moveSelection(t){if(this.selectedIndex<0)return;let r=this.view.state.field(id),n=KE(r.diagnostics,this.items[t].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:EGe.of(n)})}static open(t){return new UA(t)}}function gYt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function S2(e){return gYt(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const yYt=mt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:S2("#d11")},".cm-lintRange-warning":{backgroundImage:S2("orange")},".cm-lintRange-info":{backgroundImage:S2("#999")},".cm-lintRange-hint":{backgroundImage:S2("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function bYt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function vYt(e){let t="hint",r=1;for(let n of e){let s=bYt(n.severity);s>r&&(r=s,t=n.severity)}return t}const xYt=[id,mt.decorations.compute([id],e=>{let{selected:t,panel:r}=e.field(id);return!t||!r||t.from==t.to?rr.none:rr.set([cYt.range(t.from,t.to)])}),Sqt(uYt,{hideOn:oYt}),yYt];var X_e=function(t){t===void 0&&(t={});var{crosshairCursor:r=!1}=t,n=[];t.closeBracketsKeymap!==!1&&(n=n.concat(gQt)),t.defaultKeymap!==!1&&(n=n.concat(NXt)),t.searchKeymap!==!1&&(n=n.concat(nYt)),t.historyKeymap!==!1&&(n=n.concat(LWt)),t.foldKeymap!==!1&&(n=n.concat(tHt)),t.completionKeymap!==!1&&(n=n.concat(pHe)),t.lintKeymap!==!1&&(n=n.concat(hYt));var s=[];return t.lineNumbers!==!1&&s.push(Nqt()),t.highlightActiveLineGutter!==!1&&s.push(Rqt()),t.highlightSpecialChars!==!1&&s.push(XVt()),t.history!==!1&&s.push(AWt()),t.foldGutter!==!1&&s.push(aHt()),t.drawSelection!==!1&&s.push(BVt()),t.dropCursor!==!1&&s.push(HVt()),t.allowMultipleSelections!==!1&&s.push(Zn.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&s.push(Gqt()),t.syntaxHighlighting!==!1&&s.push(woe(cHt,{fallback:!0})),t.bracketMatching!==!1&&s.push(gHt()),t.closeBrackets!==!1&&s.push(pQt()),t.autocompletion!==!1&&s.push(dHe()),t.rectangularSelection!==!1&&s.push(uqt()),r!==!1&&s.push(fqt()),t.highlightActiveLine!==!1&&s.push(rqt()),t.highlightSelectionMatches!==!1&&s.push(LXt()),t.tabSize&&typeof t.tabSize=="number"&&s.push(nO.of(" ".repeat(t.tabSize))),s.concat([rO.of(n.flat())]).filter(Boolean)};const SYt="#e5c07b",Y_e="#e06c75",wYt="#56b6c2",EYt="#ffffff",p$="#abb2bf",YJ="#7d8799",kYt="#61afef",OYt="#98c379",K_e="#d19a66",_Yt="#c678dd",CYt="#21252b",J_e="#2c313a",eCe="#282c34",wG="#353a42",TYt="#3E4451",tCe="#528bff",AYt=mt.theme({"&":{color:p$,backgroundColor:eCe},".cm-content":{caretColor:tCe},".cm-cursor, .cm-dropCursor":{borderLeftColor:tCe},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:TYt},".cm-panels":{backgroundColor:CYt,color:p$},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:eCe,color:YJ,border:"none"},".cm-activeLineGutter":{backgroundColor:J_e},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:wG},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:wG,borderBottomColor:wG},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:J_e,color:p$}}},{dark:!0}),DYt=sO.define([{tag:re.keyword,color:_Yt},{tag:[re.name,re.deleted,re.character,re.propertyName,re.macroName],color:Y_e},{tag:[re.function(re.variableName),re.labelName],color:kYt},{tag:[re.color,re.constant(re.name),re.standard(re.name)],color:K_e},{tag:[re.definition(re.name),re.separator],color:p$},{tag:[re.typeName,re.className,re.number,re.changed,re.annotation,re.modifier,re.self,re.namespace],color:SYt},{tag:[re.operator,re.operatorKeyword,re.url,re.escape,re.regexp,re.link,re.special(re.string)],color:wYt},{tag:[re.meta,re.comment],color:YJ},{tag:re.strong,fontWeight:"bold"},{tag:re.emphasis,fontStyle:"italic"},{tag:re.strikethrough,textDecoration:"line-through"},{tag:re.link,color:YJ,textDecoration:"underline"},{tag:re.heading,fontWeight:"bold",color:Y_e},{tag:[re.atom,re.bool,re.special(re.variableName)],color:K_e},{tag:[re.processingInstruction,re.string,re.inserted],color:OYt},{tag:re.invalid,color:EYt}]),NYt=[AYt,woe(DYt)];var IYt=mt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),jYt=function(t){t===void 0&&(t={});var{indentWithTab:r=!0,editable:n=!0,readOnly:s=!1,theme:a="light",placeholder:i="",basicSetup:o=!0}=t,l=[];switch(r&&l.unshift(rO.of([IXt])),o&&(typeof o=="boolean"?l.unshift(X_e()):l.unshift(X_e(o))),i&&l.unshift(iqt(i)),a){case"light":l.push(IYt);break;case"dark":l.push(NYt);break;case"none":break;default:l.push(a);break}return n===!1&&l.push(mt.editable.of(!1)),s&&l.push(Zn.readOnly.of(!0)),[...l]},RYt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class PYt{constructor(t,r){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=r,this.timeoutMS=r,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(r=>{try{r()}catch(n){console.error("TimeoutLatch callback error:",n)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}let rCe=class{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}};var EG=null,$Yt=()=>typeof window>"u"?new rCe:(EG||(EG=new rCe),EG),nCe=Tm.define(),MYt=200,LYt=[];function FYt(e){var{value:t,selection:r,onChange:n,onStatistics:s,onCreateEditor:a,onUpdate:i,extensions:o=LYt,autoFocus:l,theme:u="light",height:d=null,minHeight:p=null,maxHeight:f=null,width:h=null,minWidth:m=null,maxWidth:y=null,placeholder:b="",editable:v=!0,readOnly:S=!1,indentWithTab:w=!0,basicSetup:k=!0,root:_,initialState:C}=e,[T,A]=E.useState(),[N,j]=E.useState(),[R,L]=E.useState(),F=E.useState(()=>({current:null}))[0],M=E.useState(()=>({current:null}))[0],z=mt.theme({"&":{height:d,minHeight:p,maxHeight:f,width:h,minWidth:m,maxWidth:y},"& .cm-scroller":{height:"100% !important"}}),q=mt.updateListener.of(Z=>{if(Z.docChanged&&typeof n=="function"&&!Z.transactions.some(U=>U.annotation(nCe))){F.current?F.current.reset():(F.current=new PYt(()=>{if(M.current){var U=M.current;M.current=null,U()}F.current=null},MYt),$Yt().add(F.current));var $=Z.state.doc,X=$.toString();n(X,Z)}s&&s(RYt(Z))}),Q=jYt({theme:u,editable:v,readOnly:S,placeholder:b,indentWithTab:w,basicSetup:k}),V=[q,z,...Q];return i&&typeof i=="function"&&V.push(mt.updateListener.of(i)),V=V.concat(o),E.useLayoutEffect(()=>{if(T&&!R){var Z={doc:t,selection:r,extensions:V},$=C?Zn.fromJSON(C.json,Z,C.fields):Zn.create(Z);if(L($),!N){var X=new mt({state:$,parent:T,root:_});j(X),a&&a(X,$)}}return()=>{N&&(L(void 0),j(void 0))}},[T,R]),E.useEffect(()=>{e.container&&A(e.container)},[e.container]),E.useEffect(()=>()=>{N&&(N.destroy(),j(void 0)),F.current&&(F.current.cancel(),F.current=null)},[N]),E.useEffect(()=>{l&&N&&N.focus()},[l,N]),E.useEffect(()=>{N&&N.dispatch({effects:en.reconfigure.of(V)})},[u,o,d,p,f,h,m,y,b,v,S,w,k,n,i]),E.useEffect(()=>{if(t!==void 0){var Z=N?N.state.doc.toString():"";if(N&&t!==Z){var $=F.current&&!F.current.isDone,X=()=>{N&&t!==N.state.doc.toString()&&N.dispatch({changes:{from:0,to:N.state.doc.toString().length,insert:t||""},annotations:[nCe.of(!0)]})};$?M.current=X:X()}}},[t,N]),{state:R,setState:L,view:N,setView:j,container:T,setContainer:A}}var BYt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],vd=E.forwardRef((e,t)=>{var{className:r,value:n="",selection:s,extensions:a=[],onChange:i,onStatistics:o,onCreateEditor:l,onUpdate:u,autoFocus:d,theme:p="light",height:f,minHeight:h,maxHeight:m,width:y,minWidth:b,maxWidth:v,basicSetup:S,placeholder:w,indentWithTab:k,editable:_,readOnly:C,root:T,initialState:A}=e,N=tie(e,BYt),j=E.useRef(null),{state:R,view:L,container:F,setContainer:M}=FYt({root:T,value:n,autoFocus:d,theme:p,height:f,minHeight:h,maxHeight:m,width:y,minWidth:b,maxWidth:v,basicSetup:S,placeholder:w,indentWithTab:k,editable:_,readOnly:C,selection:s,onChange:i,onStatistics:o,onCreateEditor:l,onUpdate:u,extensions:a,initialState:A});E.useImperativeHandle(t,()=>({editor:j.current,state:R,view:L}),[j,F,R,L]);var z=E.useCallback(Q=>{j.current=Q,M(Q)},[M]);if(typeof n!="string")throw new Error("value must be typeof string but got "+typeof n);var q=typeof p=="string"?"cm-theme-"+p:"cm-theme";return c.jsx("div",lm({ref:z,className:""+q+(r?" "+r:"")},N))});vd.displayName="CodeMirror";function zYt(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const UYt=e=>{switch(e){case"success":return HYt;case"info":return GYt;case"warning":return QYt;case"error":return ZYt;default:return null}},VYt=Array(12).fill(0),qYt=({visible:e,className:t})=>Ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ee.createElement("div",{className:"sonner-spinner"},VYt.map((r,n)=>Ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),HYt=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),QYt=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),GYt=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ZYt=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),WYt=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),XYt=()=>{const[e,t]=Ee.useState(document.hidden);return Ee.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let KJ=1;class YYt{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,a=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:KJ++,i=this.toasts.find(l=>l.id===a),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...t,id:a,title:n}),{...l,...t,id:a,dismissible:o,title:n}):l):this.addToast({title:n,...s,dismissible:o,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const o=s.then(async u=>{if(i=["resolve",u],Ee.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(JYt(u)&&!u.ok){a=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,f=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,m=typeof p=="object"&&!Ee.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:f,...m})}else if(u instanceof Error){a=!1;const p=typeof r.error=="function"?await r.error(u):r.error,f=typeof r.description=="function"?await r.description(u):r.description,m=typeof p=="object"&&!Ee.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:f,...m})}else if(r.success!==void 0){a=!1;const p=typeof r.success=="function"?await r.success(u):r.success,f=typeof r.description=="function"?await r.description(u):r.description,m=typeof p=="object"&&!Ee.isValidElement(p)?p:{message:p};this.create({id:n,type:"success",description:f,...m})}}).catch(async u=>{if(i=["reject",u],r.error!==void 0){a=!1;const d=typeof r.error=="function"?await r.error(u):r.error,p=typeof r.description=="function"?await r.description(u):r.description,h=typeof d=="object"&&!Ee.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:p,...h})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),l=()=>new Promise((u,d)=>o.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(t,r)=>{const n=r?.id||KJ++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Yc=new YYt,KYt=(e,t)=>{const r=t?.id||KJ++;return Yc.addToast({title:e,...t,id:r}),r},JYt=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",eKt=KYt,tKt=()=>Yc.toasts,rKt=()=>Yc.getActiveToasts(),Vl=Object.assign(eKt,{success:Yc.success,info:Yc.info,warning:Yc.warning,error:Yc.error,custom:Yc.custom,message:Yc.message,promise:Yc.promise,dismiss:Yc.dismiss,loading:Yc.loading},{getHistory:tKt,getToasts:rKt});zYt("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function w2(e){return e.label!==void 0}const nKt=3,sKt="24px",aKt="16px",sCe=4e3,iKt=356,oKt=14,lKt=45,cKt=200;function hh(...e){return e.filter(Boolean).join(" ")}function uKt(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const dKt=e=>{var t,r,n,s,a,i,o,l,u;const{invert:d,toast:p,unstyled:f,interacting:h,setHeights:m,visibleToasts:y,heights:b,index:v,toasts:S,expanded:w,removeToast:k,defaultRichColors:_,closeButton:C,style:T,cancelButtonStyle:A,actionButtonStyle:N,className:j="",descriptionClassName:R="",duration:L,position:F,gap:M,expandByDefault:z,classNames:q,icons:Q,closeButtonAriaLabel:V="Close toast"}=e,[Z,$]=Ee.useState(null),[X,U]=Ee.useState(null),[I,H]=Ee.useState(!1),[G,J]=Ee.useState(!1),[ee,te]=Ee.useState(!1),[se,ce]=Ee.useState(!1),[Se,W]=Ee.useState(!1),[ne,ae]=Ee.useState(0),[ge,le]=Ee.useState(0),xe=Ee.useRef(p.duration||L||sCe),Ie=Ee.useRef(null),Ce=Ee.useRef(null),oe=v===0,de=v+1<=y,fe=p.type,Ne=p.dismissible!==!1,Te=p.className||"",we=p.descriptionClassName||"",ue=Ee.useMemo(()=>b.findIndex(ht=>ht.toastId===p.id)||0,[b,p.id]),De=Ee.useMemo(()=>{var ht;return(ht=p.closeButton)!=null?ht:C},[p.closeButton,C]),Le=Ee.useMemo(()=>p.duration||L||sCe,[p.duration,L]),rt=Ee.useRef(0),Ot=Ee.useRef(0),$t=Ee.useRef(0),ut=Ee.useRef(null),[or,Br]=F.split("-"),Et=Ee.useMemo(()=>b.reduce((ht,Ar,vr)=>vr>=ue?ht:ht+Ar.height,0),[b,ue]),Dt=XYt(),xt=p.invert||d,je=fe==="loading";Ot.current=Ee.useMemo(()=>ue*M+Et,[ue,Et]),Ee.useEffect(()=>{xe.current=Le},[Le]),Ee.useEffect(()=>{H(!0)},[]),Ee.useEffect(()=>{const ht=Ce.current;if(ht){const Ar=ht.getBoundingClientRect().height;return le(Ar),m(vr=>[{toastId:p.id,height:Ar,position:p.position},...vr]),()=>m(vr=>vr.filter(zr=>zr.toastId!==p.id))}},[m,p.id]),Ee.useLayoutEffect(()=>{if(!I)return;const ht=Ce.current,Ar=ht.style.height;ht.style.height="auto";const vr=ht.getBoundingClientRect().height;ht.style.height=Ar,le(vr),m(zr=>zr.find($r=>$r.toastId===p.id)?zr.map($r=>$r.toastId===p.id?{...$r,height:vr}:$r):[{toastId:p.id,height:vr,position:p.position},...zr])},[I,p.title,p.description,m,p.id,p.jsx,p.action,p.cancel]);const St=Ee.useCallback(()=>{J(!0),ae(Ot.current),m(ht=>ht.filter(Ar=>Ar.toastId!==p.id)),setTimeout(()=>{k(p)},cKt)},[p,k,m,Ot]);Ee.useEffect(()=>{if(p.promise&&fe==="loading"||p.duration===1/0||p.type==="loading")return;let ht;return w||h||Dt?(()=>{if($t.current<rt.current){const zr=new Date().getTime()-rt.current;xe.current=xe.current-zr}$t.current=new Date().getTime()})():xe.current!==1/0&&(rt.current=new Date().getTime(),ht=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),St()},xe.current)),()=>clearTimeout(ht)},[w,h,p,fe,Dt,St]),Ee.useEffect(()=>{p.delete&&(St(),p.onDismiss==null||p.onDismiss.call(p,p))},[St,p.delete]);function sr(){var ht;if(Q?.loading){var Ar;return Ee.createElement("div",{className:hh(q?.loader,p==null||(Ar=p.classNames)==null?void 0:Ar.loader,"sonner-loader"),"data-visible":fe==="loading"},Q.loading)}return Ee.createElement(qYt,{className:hh(q?.loader,p==null||(ht=p.classNames)==null?void 0:ht.loader),visible:fe==="loading"})}const En=p.icon||Q?.[fe]||UYt(fe);var gt,Sn;return Ee.createElement("li",{tabIndex:0,ref:Ce,className:hh(j,Te,q?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,q?.default,q?.[fe],p==null||(r=p.classNames)==null?void 0:r[fe]),"data-sonner-toast":"","data-rich-colors":(gt=p.richColors)!=null?gt:_,"data-styled":!(p.jsx||p.unstyled||f),"data-mounted":I,"data-promise":!!p.promise,"data-swiped":Se,"data-removed":G,"data-visible":de,"data-y-position":or,"data-x-position":Br,"data-index":v,"data-front":oe,"data-swiping":ee,"data-dismissible":Ne,"data-type":fe,"data-invert":xt,"data-swipe-out":se,"data-swipe-direction":X,"data-expanded":!!(w||z&&I),"data-testid":p.testId,style:{"--index":v,"--toasts-before":v,"--z-index":S.length-v,"--offset":`${G?ne:Ot.current}px`,"--initial-height":z?"auto":`${ge}px`,...T,...p.style},onDragEnd:()=>{te(!1),$(null),ut.current=null},onPointerDown:ht=>{ht.button!==2&&(je||!Ne||(Ie.current=new Date,ae(Ot.current),ht.target.setPointerCapture(ht.pointerId),ht.target.tagName!=="BUTTON"&&(te(!0),ut.current={x:ht.clientX,y:ht.clientY})))},onPointerUp:()=>{var ht,Ar,vr;if(se||!Ne)return;ut.current=null;const zr=Number(((ht=Ce.current)==null?void 0:ht.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),pr=Number(((Ar=Ce.current)==null?void 0:Ar.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),$r=new Date().getTime()-((vr=Ie.current)==null?void 0:vr.getTime()),Jt=Z==="x"?zr:pr,Ka=Math.abs(Jt)/$r;if(Math.abs(Jt)>=lKt||Ka>.11){ae(Ot.current),p.onDismiss==null||p.onDismiss.call(p,p),U(Z==="x"?zr>0?"right":"left":pr>0?"down":"up"),St(),ce(!0);return}else{var pe,_e;(pe=Ce.current)==null||pe.style.setProperty("--swipe-amount-x","0px"),(_e=Ce.current)==null||_e.style.setProperty("--swipe-amount-y","0px")}W(!1),te(!1),$(null)},onPointerMove:ht=>{var Ar,vr,zr;if(!ut.current||!Ne||((Ar=window.getSelection())==null?void 0:Ar.toString().length)>0)return;const $r=ht.clientY-ut.current.y,Jt=ht.clientX-ut.current.x;var Ka;const pe=(Ka=e.swipeDirections)!=null?Ka:uKt(F);!Z&&(Math.abs(Jt)>1||Math.abs($r)>1)&&$(Math.abs(Jt)>Math.abs($r)?"x":"y");let _e={x:0,y:0};const Re=qe=>1/(1.5+Math.abs(qe)/20);if(Z==="y"){if(pe.includes("top")||pe.includes("bottom"))if(pe.includes("top")&&$r<0||pe.includes("bottom")&&$r>0)_e.y=$r;else{const qe=$r*Re($r);_e.y=Math.abs(qe)<Math.abs($r)?qe:$r}}else if(Z==="x"&&(pe.includes("left")||pe.includes("right")))if(pe.includes("left")&&Jt<0||pe.includes("right")&&Jt>0)_e.x=Jt;else{const qe=Jt*Re(Jt);_e.x=Math.abs(qe)<Math.abs(Jt)?qe:Jt}(Math.abs(_e.x)>0||Math.abs(_e.y)>0)&&W(!0),(vr=Ce.current)==null||vr.style.setProperty("--swipe-amount-x",`${_e.x}px`),(zr=Ce.current)==null||zr.style.setProperty("--swipe-amount-y",`${_e.y}px`)}},De&&!p.jsx&&fe!=="loading"?Ee.createElement("button",{"aria-label":V,"data-disabled":je,"data-close-button":!0,onClick:je||!Ne?()=>{}:()=>{St(),p.onDismiss==null||p.onDismiss.call(p,p)},className:hh(q?.closeButton,p==null||(n=p.classNames)==null?void 0:n.closeButton)},(Sn=Q?.close)!=null?Sn:WYt):null,(fe||p.icon||p.promise)&&p.icon!==null&&(Q?.[fe]!==null||p.icon)?Ee.createElement("div",{"data-icon":"",className:hh(q?.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||sr():null,p.type!=="loading"?En:null):null,Ee.createElement("div",{"data-content":"",className:hh(q?.content,p==null||(a=p.classNames)==null?void 0:a.content)},Ee.createElement("div",{"data-title":"",className:hh(q?.title,p==null||(i=p.classNames)==null?void 0:i.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?Ee.createElement("div",{"data-description":"",className:hh(R,we,q?.description,p==null||(o=p.classNames)==null?void 0:o.description)},typeof p.description=="function"?p.description():p.description):null),Ee.isValidElement(p.cancel)?p.cancel:p.cancel&&w2(p.cancel)?Ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:ht=>{w2(p.cancel)&&Ne&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,ht),St())},className:hh(q?.cancelButton,p==null||(l=p.classNames)==null?void 0:l.cancelButton)},p.cancel.label):null,Ee.isValidElement(p.action)?p.action:p.action&&w2(p.action)?Ee.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||N,onClick:ht=>{w2(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,ht),!ht.defaultPrevented&&St())},className:hh(q?.actionButton,p==null||(u=p.classNames)==null?void 0:u.actionButton)},p.action.label):null)};function aCe(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function pKt(e,t){const r={};return[e,t].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",o=a?aKt:sKt;function l(u){["top","right","bottom","left"].forEach(d=>{r[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=o:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(o)}),r}const fKt=Ee.forwardRef(function(t,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:d,mobileOffset:p,theme:f="light",richColors:h,duration:m,style:y,visibleToasts:b=nKt,toastOptions:v,dir:S=aCe(),gap:w=oKt,icons:k,containerAriaLabel:_="Notifications"}=t,[C,T]=Ee.useState([]),A=Ee.useMemo(()=>n?C.filter(I=>I.toasterId===n):C.filter(I=>!I.toasterId),[C,n]),N=Ee.useMemo(()=>Array.from(new Set([a].concat(A.filter(I=>I.position).map(I=>I.position)))),[A,a]),[j,R]=Ee.useState([]),[L,F]=Ee.useState(!1),[M,z]=Ee.useState(!1),[q,Q]=Ee.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=Ee.useRef(null),Z=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=Ee.useRef(null),X=Ee.useRef(!1),U=Ee.useCallback(I=>{T(H=>{var G;return(G=H.find(J=>J.id===I.id))!=null&&G.delete||Yc.dismiss(I.id),H.filter(({id:J})=>J!==I.id)})},[]);return Ee.useEffect(()=>Yc.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{T(H=>H.map(G=>G.id===I.id?{...G,delete:!0}:G))});return}setTimeout(()=>{Iae.flushSync(()=>{T(H=>{const G=H.findIndex(J=>J.id===I.id);return G!==-1?[...H.slice(0,G),{...H[G],...I},...H.slice(G+1)]:[I,...H]})})})}),[C]),Ee.useEffect(()=>{if(f!=="system"){Q(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Q("dark"):Q("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:H})=>{Q(H?"dark":"light")})}catch{I.addListener(({matches:G})=>{try{Q(G?"dark":"light")}catch(J){console.error(J)}})}},[f]),Ee.useEffect(()=>{C.length<=1&&F(!1)},[C]),Ee.useEffect(()=>{const I=H=>{var G;if(i.every(te=>H[te]||H.code===te)){var ee;F(!0),(ee=V.current)==null||ee.focus()}H.code==="Escape"&&(document.activeElement===V.current||(G=V.current)!=null&&G.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[i]),Ee.useEffect(()=>{if(V.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,X.current=!1)}},[V.current]),Ee.createElement("section",{ref:r,"aria-label":`${_} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((I,H)=>{var G;const[J,ee]=I.split("-");return A.length?Ee.createElement("ol",{key:I,dir:S==="auto"?aCe():S,tabIndex:-1,ref:V,className:u,"data-sonner-toaster":!0,"data-sonner-theme":q,"data-y-position":J,"data-x-position":ee,style:{"--front-toast-height":`${((G=j[0])==null?void 0:G.height)||0}px`,"--width":`${iKt}px`,"--gap":`${w}px`,...y,...pKt(d,p)},onBlur:te=>{X.current&&!te.currentTarget.contains(te.relatedTarget)&&(X.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||X.current||(X.current=!0,$.current=te.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{M||F(!1)},onDragEnd:()=>F(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},A.filter(te=>!te.position&&H===0||te.position===I).map((te,se)=>{var ce,Se;return Ee.createElement(dKt,{key:te.id,icons:k,index:se,toast:te,defaultRichColors:h,duration:(ce=v?.duration)!=null?ce:m,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:s,visibleToasts:b,closeButton:(Se=v?.closeButton)!=null?Se:l,interacting:M,position:I,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:U,toasts:A.filter(W=>W.position==te.position),heights:j.filter(W=>W.position==te.position),setHeights:R,expandByDefault:o,gap:w,expanded:L,swipeDirections:t.swipeDirections})})):null}))});var KL="Dialog",[_Ge,CGe]=$o(KL),[hKt,Kf]=_Ge(KL),TGe=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,o=E.useRef(null),l=E.useRef(null),[u,d]=Rc({prop:n,defaultProp:s??!1,onChange:a,caller:KL});return c.jsx(hKt,{scope:t,triggerRef:o,contentRef:l,contentId:Wi(),titleId:Wi(),descriptionId:Wi(),open:u,onOpenChange:d,onOpenToggle:E.useCallback(()=>d(p=>!p),[d]),modal:i,children:r})};TGe.displayName=KL;var AGe="DialogTrigger",DGe=E.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Kf(AGe,r),a=Pr(t,s.triggerRef);return c.jsx(gr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":lle(s.open),...n,ref:a,onClick:dt(e.onClick,s.onOpenToggle)})});DGe.displayName=AGe;var ile="DialogPortal",[mKt,NGe]=_Ge(ile,{forceMount:void 0}),IGe=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,a=Kf(ile,t);return c.jsx(mKt,{scope:t,forceMount:r,children:E.Children.map(n,i=>c.jsx(Mi,{present:r||a.open,children:c.jsx(A1,{asChild:!0,container:s,children:i})}))})};IGe.displayName=ile;var K3="DialogOverlay",jGe=E.forwardRef((e,t)=>{const r=NGe(K3,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,a=Kf(K3,e.__scopeDialog);return a.modal?c.jsx(Mi,{present:n||a.open,children:c.jsx(yKt,{...s,ref:t})}):null});jGe.displayName=K3;var gKt=M0("DialogOverlay.RemoveScroll"),yKt=E.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Kf(K3,r);return c.jsx(GN,{as:gKt,allowPinchZoom:!0,shards:[s.contentRef],children:c.jsx(gr.div,{"data-state":lle(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),K0="DialogContent",RGe=E.forwardRef((e,t)=>{const r=NGe(K0,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,a=Kf(K0,e.__scopeDialog);return c.jsx(Mi,{present:n||a.open,children:a.modal?c.jsx(bKt,{...s,ref:t}):c.jsx(vKt,{...s,ref:t})})});RGe.displayName=K0;var bKt=E.forwardRef((e,t)=>{const r=Kf(K0,e.__scopeDialog),n=E.useRef(null),s=Pr(t,r.contentRef,n);return E.useEffect(()=>{const a=n.current;if(a)return iL(a)},[]),c.jsx(PGe,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:dt(e.onCloseAutoFocus,a=>{a.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:dt(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,o=i.button===0&&i.ctrlKey===!0;(i.button===2||o)&&a.preventDefault()}),onFocusOutside:dt(e.onFocusOutside,a=>a.preventDefault())})}),vKt=E.forwardRef((e,t)=>{const r=Kf(K0,e.__scopeDialog),n=E.useRef(!1),s=E.useRef(!1);return c.jsx(PGe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||r.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;r.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),PGe=E.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,...i}=e,o=Kf(K0,r),l=E.useRef(null),u=Pr(t,l);return K5(),c.jsxs(c.Fragment,{children:[c.jsx(UN,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:c.jsx(C1,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":lle(o.open),...i,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(SKt,{titleId:o.titleId}),c.jsx(EKt,{contentRef:l,descriptionId:o.descriptionId})]})]})}),ole="DialogTitle",$Ge=E.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Kf(ole,r);return c.jsx(gr.h2,{id:s.titleId,...n,ref:t})});$Ge.displayName=ole;var MGe="DialogDescription",LGe=E.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Kf(MGe,r);return c.jsx(gr.p,{id:s.descriptionId,...n,ref:t})});LGe.displayName=MGe;var FGe="DialogClose",BGe=E.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Kf(FGe,r);return c.jsx(gr.button,{type:"button",...n,ref:t,onClick:dt(e.onClick,()=>s.onOpenChange(!1))})});BGe.displayName=FGe;function lle(e){return e?"open":"closed"}var zGe="DialogTitleWarning",[xKt,UGe]=hkt(zGe,{contentName:K0,titleName:ole,docsSlug:"dialog"}),SKt=({titleId:e})=>{const t=UGe(zGe),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
162
162
|
|
|
163
163
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
@@ -229,7 +229,7 @@ Error message: ${xle(r)}`,cause:r}),this[wWe]=!0,this.value=t}static isInstance(
|
|
|
229
229
|
]))`;continue}else if(s[u]==="$"){a+=`($|(?=[\r
|
|
230
230
|
]))`;continue}}if(n.s&&s[u]==="."){a+=o?`${s[u]}\r
|
|
231
231
|
`:`[${s[u]}\r
|
|
232
|
-
]`;continue}a+=s[u],s[u]==="\\"?i=!0:o&&s[u]==="]"?o=!1:!o&&s[u]==="["&&(o=!0)}return a}function DWe(e,t){var r,n,s,a,i,o;const l={type:"object",additionalProperties:(r=ia(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?r:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===Oe.ZodString&&((s=e.keyType._def.checks)!=null&&s.length)){const{type:u,...d}=AWe(e.keyType._def,t);return{...l,propertyNames:d}}else{if(((a=e.keyType)==null?void 0:a._def.typeName)===Oe.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===Oe.ZodBranded&&e.keyType._def.type._def.typeName===Oe.ZodString&&((o=e.keyType._def.type._def.checks)!=null&&o.length)){const{type:u,...d}=CWe(e.keyType._def,t);return{...l,propertyNames:d}}}return l}function qir(e,t){if(t.mapStrategy==="record")return DWe(e,t);const r=ia(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Sd(),n=ia(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Sd();return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function Hir(e){const t=e.values,n=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),s=Array.from(new Set(n.map(a=>typeof a)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:n}}function Qir(){return{not:Sd()}}function Gir(){return{type:"null"}}var mee={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Zir(e,t){const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in mee&&(!n._def.checks||!n._def.checks.length))){const n=r.reduce((s,a)=>{const i=mee[a._def.typeName];return i&&!s.includes(i)?[...s,i]:s},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){const n=r.reduce((s,a)=>{const i=typeof a._def.value;switch(i){case"string":case"number":case"boolean":return[...s,i];case"bigint":return[...s,"integer"];case"object":if(a._def.value===null)return[...s,"null"];default:return s}},[]);if(n.length===r.length){const s=n.filter((a,i,o)=>o.indexOf(a)===i);return{type:s.length>1?s:s[0],enum:r.reduce((a,i)=>a.includes(i._def.value)?a:[...a,i._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,s)=>[...n,...s._def.values.filter(a=>!n.includes(a))],[])};return Wir(e,t)}var Wir=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,s)=>ia(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function Xir(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[mee[e.innerType._def.typeName],"null"]};const r=ia(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function Yir(e){const t={type:"number"};if(!e.checks)return t;for(const r of e.checks)switch(r.kind){case"int":t.type="integer";break;case"min":r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value;break;case"max":r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value;break;case"multipleOf":t.multipleOf=r.value;break}return t}function Kir(e,t){const r={type:"object",properties:{}},n=[],s=e.shape();for(const i in s){let o=s[i];if(o===void 0||o._def===void 0)continue;const l=eor(o),u=ia(o._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(r.properties[i]=u,l||n.push(i))}n.length&&(r.required=n);const a=Jir(e,t);return a!==void 0&&(r.additionalProperties=a),r}function Jir(e,t){if(e.catchall._def.typeName!=="ZodNever")return ia(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 eor(e){try{return e.isOptional()}catch{return!0}}var tor=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return ia(e.innerType._def,t);const n=ia(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Sd()},n]}:Sd()},ror=(e,t)=>{if(t.pipeStrategy==="input")return ia(e.in._def,t);if(t.pipeStrategy==="output")return ia(e.out._def,t);const r=ia(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=ia(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(s=>s!==void 0)}};function nor(e,t){return ia(e.type._def,t)}function sor(e,t){const n={type:"array",uniqueItems:!0,items:ia(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 aor(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>ia(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:ia(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>ia(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function ior(){return{not:Sd()}}function oor(){return Sd()}var lor=(e,t)=>ia(e.innerType._def,t),cor=(e,t,r)=>{switch(t){case Oe.ZodString:return AWe(e,r);case Oe.ZodNumber:return Yir(e);case Oe.ZodObject:return Kir(e,r);case Oe.ZodBigInt:return Iir(e);case Oe.ZodBoolean:return jir();case Oe.ZodDate:return TWe(e,r);case Oe.ZodUndefined:return ior();case Oe.ZodNull:return Gir();case Oe.ZodArray:return Nir(e,r);case Oe.ZodUnion:case Oe.ZodDiscriminatedUnion:return Zir(e,r);case Oe.ZodIntersection:return Bir(e,r);case Oe.ZodTuple:return aor(e,r);case Oe.ZodRecord:return DWe(e,r);case Oe.ZodLiteral:return zir(e);case Oe.ZodEnum:return Lir(e);case Oe.ZodNativeEnum:return Hir(e);case Oe.ZodNullable:return Xir(e,r);case Oe.ZodOptional:return tor(e,r);case Oe.ZodMap:return qir(e,r);case Oe.ZodSet:return sor(e,r);case Oe.ZodLazy:return()=>e.getter()._def;case Oe.ZodPromise:return nor(e,r);case Oe.ZodNaN:case Oe.ZodNever:return Qir();case Oe.ZodEffects:return Mir(e,r);case Oe.ZodAny:return Sd();case Oe.ZodUnknown:return oor();case Oe.ZodDefault:return $ir(e,r);case Oe.ZodBranded:return CWe(e,r);case Oe.ZodReadonly:return lor(e,r);case Oe.ZodCatch:return Rir(e,r);case Oe.ZodPipeline:return ror(e,r);case Oe.ZodFunction:case Oe.ZodVoid:case Oe.ZodSymbol:return;default:return(n=>{})()}};function ia(e,t,r=!1){var n;const s=t.seen.get(e);if(t.override){const l=(n=t.override)==null?void 0:n.call(t,e,t,s,r);if(l!==Air)return l}if(s&&!r){const l=uor(s,t);if(l!==void 0)return l}const a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);const i=cor(e,e.typeName,t),o=typeof i=="function"?ia(i(),t):i;if(o&&dor(e,t,o),t.postProcess){const l=t.postProcess(o,e,t);return a.jsonSchema=o,l}return a.jsonSchema=o,o}var uor=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Tir(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Sd()):t.$refStrategy==="seen"?Sd():void 0}},dor=(e,t,r)=>(e.description&&(r.description=e.description),r),por=e=>{const t=Dir(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},hor=(e,t)=>{var r;const n=por(t);let s=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[d,p])=>{var f;return{...u,[d]:(f=ia(p._def,{...n,currentPath:[...n.basePath,n.definitionPath,d]},!0))!=null?f:Sd()}},{}):void 0;const a=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(r=ia(e._def,a===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,a]},!1))!=null?r:Sd(),o=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;o!==void 0&&(i.title=o);const l=a===void 0?s?{...i,[n.definitionPath]:s}:i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,a].join("/"),[n.definitionPath]:{...s,[a]:i}};return l.$schema="http://json-schema.org/draft-07/schema#",l},mor=hor;function gor(e,t){var r;const n=(r=void 0)!=null?r:!1;return wle(()=>mor(e,{$refStrategy:n?"root":"none"}),{validate:async s=>{const a=await e.safeParseAsync(s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function yor(e,t){var r;const n=(r=void 0)!=null?r:!1;return wle(()=>pZe(e,{target:"draft-7",io:"output",reused:n?"ref":"inline"}),{validate:async s=>{const a=await fZe(e,s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function bor(e){return"_zod"in e}function F1(e,t){return bor(e)?yor(e):gor(e)}var gee=Symbol.for("vercel.ai.schema");function wle(e,{validate:t}={}){return{[gee]:!0,_type:void 0,[hM]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function vor(e){return typeof e=="object"&&e!==null&&gee in e&&e[gee]===!0&&"jsonSchema"in e&&"validate"in e}function xor(e){return e==null?wle({properties:{},additionalProperties:!1}):vor(e)?e:typeof e=="function"?e():F1(e)}function Sor(e){return e?.replace(/\/$/,"")}var wor={},NWe=uF({"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-context.js"(e,t){var r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i=(f,h)=>{for(var m in h)r(f,m,{get:h[m],enumerable:!0})},o=(f,h,m,y)=>{if(h&&typeof h=="object"||typeof h=="function")for(let b of s(h))!a.call(f,b)&&b!==m&&r(f,b,{get:()=>h[b],enumerable:!(y=n(h,b))||y.enumerable});return f},l=f=>o(r({},"__esModule",{value:!0}),f),u={};i(u,{SYMBOL_FOR_REQ_CONTEXT:()=>d,getContext:()=>p}),t.exports=l(u);var d=Symbol.for("@vercel/request-context");function p(){return globalThis[d]?.get?.()??{}}}}),Eor=uF({"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(e,t){var r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i=(m,y)=>{for(var b in y)r(m,b,{get:y[b],enumerable:!0})},o=(m,y,b,v)=>{if(y&&typeof y=="object"||typeof y=="function")for(let S of s(y))!a.call(m,S)&&S!==b&&r(m,S,{get:()=>y[S],enumerable:!(v=n(y,S))||v.enumerable});return m},l=m=>o(r({},"__esModule",{value:!0}),m),u={};i(u,{getVercelOidcToken:()=>f,getVercelOidcTokenSync:()=>h}),t.exports=l(u);var d=NWe(),p=Xar();async function f(){let m="",y;try{m=h()}catch(b){y=b}try{const[{getTokenPayload:b,isExpired:v},{refreshToken:S}]=await Promise.all([await Ge(()=>import("./token-util-NEHG7TUY-U7CX7GS4-CqTMHVgX.js"),__vite__mapDeps([23,24,1]),import.meta.url),await Ge(()=>import("./token-6GSAFR2W-XRCSVUPZ-Br966x8T.js"),__vite__mapDeps([25,24,1]),import.meta.url)]);(!m||v(b(m)))&&(await S(),m=h())}catch(b){throw y?.message&&b instanceof Error&&(b.message=`${y.message}
|
|
232
|
+
]`;continue}a+=s[u],s[u]==="\\"?i=!0:o&&s[u]==="]"?o=!1:!o&&s[u]==="["&&(o=!0)}return a}function DWe(e,t){var r,n,s,a,i,o;const l={type:"object",additionalProperties:(r=ia(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?r:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===Oe.ZodString&&((s=e.keyType._def.checks)!=null&&s.length)){const{type:u,...d}=AWe(e.keyType._def,t);return{...l,propertyNames:d}}else{if(((a=e.keyType)==null?void 0:a._def.typeName)===Oe.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===Oe.ZodBranded&&e.keyType._def.type._def.typeName===Oe.ZodString&&((o=e.keyType._def.type._def.checks)!=null&&o.length)){const{type:u,...d}=CWe(e.keyType._def,t);return{...l,propertyNames:d}}}return l}function qir(e,t){if(t.mapStrategy==="record")return DWe(e,t);const r=ia(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Sd(),n=ia(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Sd();return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function Hir(e){const t=e.values,n=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),s=Array.from(new Set(n.map(a=>typeof a)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:n}}function Qir(){return{not:Sd()}}function Gir(){return{type:"null"}}var mee={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Zir(e,t){const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in mee&&(!n._def.checks||!n._def.checks.length))){const n=r.reduce((s,a)=>{const i=mee[a._def.typeName];return i&&!s.includes(i)?[...s,i]:s},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){const n=r.reduce((s,a)=>{const i=typeof a._def.value;switch(i){case"string":case"number":case"boolean":return[...s,i];case"bigint":return[...s,"integer"];case"object":if(a._def.value===null)return[...s,"null"];default:return s}},[]);if(n.length===r.length){const s=n.filter((a,i,o)=>o.indexOf(a)===i);return{type:s.length>1?s:s[0],enum:r.reduce((a,i)=>a.includes(i._def.value)?a:[...a,i._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,s)=>[...n,...s._def.values.filter(a=>!n.includes(a))],[])};return Wir(e,t)}var Wir=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,s)=>ia(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function Xir(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[mee[e.innerType._def.typeName],"null"]};const r=ia(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function Yir(e){const t={type:"number"};if(!e.checks)return t;for(const r of e.checks)switch(r.kind){case"int":t.type="integer";break;case"min":r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value;break;case"max":r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value;break;case"multipleOf":t.multipleOf=r.value;break}return t}function Kir(e,t){const r={type:"object",properties:{}},n=[],s=e.shape();for(const i in s){let o=s[i];if(o===void 0||o._def===void 0)continue;const l=eor(o),u=ia(o._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(r.properties[i]=u,l||n.push(i))}n.length&&(r.required=n);const a=Jir(e,t);return a!==void 0&&(r.additionalProperties=a),r}function Jir(e,t){if(e.catchall._def.typeName!=="ZodNever")return ia(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 eor(e){try{return e.isOptional()}catch{return!0}}var tor=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return ia(e.innerType._def,t);const n=ia(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Sd()},n]}:Sd()},ror=(e,t)=>{if(t.pipeStrategy==="input")return ia(e.in._def,t);if(t.pipeStrategy==="output")return ia(e.out._def,t);const r=ia(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=ia(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(s=>s!==void 0)}};function nor(e,t){return ia(e.type._def,t)}function sor(e,t){const n={type:"array",uniqueItems:!0,items:ia(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 aor(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>ia(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:ia(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>ia(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function ior(){return{not:Sd()}}function oor(){return Sd()}var lor=(e,t)=>ia(e.innerType._def,t),cor=(e,t,r)=>{switch(t){case Oe.ZodString:return AWe(e,r);case Oe.ZodNumber:return Yir(e);case Oe.ZodObject:return Kir(e,r);case Oe.ZodBigInt:return Iir(e);case Oe.ZodBoolean:return jir();case Oe.ZodDate:return TWe(e,r);case Oe.ZodUndefined:return ior();case Oe.ZodNull:return Gir();case Oe.ZodArray:return Nir(e,r);case Oe.ZodUnion:case Oe.ZodDiscriminatedUnion:return Zir(e,r);case Oe.ZodIntersection:return Bir(e,r);case Oe.ZodTuple:return aor(e,r);case Oe.ZodRecord:return DWe(e,r);case Oe.ZodLiteral:return zir(e);case Oe.ZodEnum:return Lir(e);case Oe.ZodNativeEnum:return Hir(e);case Oe.ZodNullable:return Xir(e,r);case Oe.ZodOptional:return tor(e,r);case Oe.ZodMap:return qir(e,r);case Oe.ZodSet:return sor(e,r);case Oe.ZodLazy:return()=>e.getter()._def;case Oe.ZodPromise:return nor(e,r);case Oe.ZodNaN:case Oe.ZodNever:return Qir();case Oe.ZodEffects:return Mir(e,r);case Oe.ZodAny:return Sd();case Oe.ZodUnknown:return oor();case Oe.ZodDefault:return $ir(e,r);case Oe.ZodBranded:return CWe(e,r);case Oe.ZodReadonly:return lor(e,r);case Oe.ZodCatch:return Rir(e,r);case Oe.ZodPipeline:return ror(e,r);case Oe.ZodFunction:case Oe.ZodVoid:case Oe.ZodSymbol:return;default:return(n=>{})()}};function ia(e,t,r=!1){var n;const s=t.seen.get(e);if(t.override){const l=(n=t.override)==null?void 0:n.call(t,e,t,s,r);if(l!==Air)return l}if(s&&!r){const l=uor(s,t);if(l!==void 0)return l}const a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);const i=cor(e,e.typeName,t),o=typeof i=="function"?ia(i(),t):i;if(o&&dor(e,t,o),t.postProcess){const l=t.postProcess(o,e,t);return a.jsonSchema=o,l}return a.jsonSchema=o,o}var uor=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Tir(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Sd()):t.$refStrategy==="seen"?Sd():void 0}},dor=(e,t,r)=>(e.description&&(r.description=e.description),r),por=e=>{const t=Dir(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},hor=(e,t)=>{var r;const n=por(t);let s=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[d,p])=>{var f;return{...u,[d]:(f=ia(p._def,{...n,currentPath:[...n.basePath,n.definitionPath,d]},!0))!=null?f:Sd()}},{}):void 0;const a=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(r=ia(e._def,a===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,a]},!1))!=null?r:Sd(),o=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;o!==void 0&&(i.title=o);const l=a===void 0?s?{...i,[n.definitionPath]:s}:i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,a].join("/"),[n.definitionPath]:{...s,[a]:i}};return l.$schema="http://json-schema.org/draft-07/schema#",l},mor=hor;function gor(e,t){var r;const n=(r=void 0)!=null?r:!1;return wle(()=>mor(e,{$refStrategy:n?"root":"none"}),{validate:async s=>{const a=await e.safeParseAsync(s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function yor(e,t){var r;const n=(r=void 0)!=null?r:!1;return wle(()=>pZe(e,{target:"draft-7",io:"output",reused:n?"ref":"inline"}),{validate:async s=>{const a=await fZe(e,s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function bor(e){return"_zod"in e}function F1(e,t){return bor(e)?yor(e):gor(e)}var gee=Symbol.for("vercel.ai.schema");function wle(e,{validate:t}={}){return{[gee]:!0,_type:void 0,[hM]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function vor(e){return typeof e=="object"&&e!==null&&gee in e&&e[gee]===!0&&"jsonSchema"in e&&"validate"in e}function xor(e){return e==null?wle({properties:{},additionalProperties:!1}):vor(e)?e:typeof e=="function"?e():F1(e)}function Sor(e){return e?.replace(/\/$/,"")}var wor={},NWe=uF({"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-context.js"(e,t){var r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i=(f,h)=>{for(var m in h)r(f,m,{get:h[m],enumerable:!0})},o=(f,h,m,y)=>{if(h&&typeof h=="object"||typeof h=="function")for(let b of s(h))!a.call(f,b)&&b!==m&&r(f,b,{get:()=>h[b],enumerable:!(y=n(h,b))||y.enumerable});return f},l=f=>o(r({},"__esModule",{value:!0}),f),u={};i(u,{SYMBOL_FOR_REQ_CONTEXT:()=>d,getContext:()=>p}),t.exports=l(u);var d=Symbol.for("@vercel/request-context");function p(){return globalThis[d]?.get?.()??{}}}}),Eor=uF({"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(e,t){var r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i=(m,y)=>{for(var b in y)r(m,b,{get:y[b],enumerable:!0})},o=(m,y,b,v)=>{if(y&&typeof y=="object"||typeof y=="function")for(let S of s(y))!a.call(m,S)&&S!==b&&r(m,S,{get:()=>y[S],enumerable:!(v=n(y,S))||v.enumerable});return m},l=m=>o(r({},"__esModule",{value:!0}),m),u={};i(u,{getVercelOidcToken:()=>f,getVercelOidcTokenSync:()=>h}),t.exports=l(u);var d=NWe(),p=Xar();async function f(){let m="",y;try{m=h()}catch(b){y=b}try{const[{getTokenPayload:b,isExpired:v},{refreshToken:S}]=await Promise.all([await Ge(()=>import("./token-util-NEHG7TUY-U7CX7GS4-CvzVQPbB.js"),__vite__mapDeps([23,24,1]),import.meta.url),await Ge(()=>import("./token-6GSAFR2W-XRCSVUPZ-CJKKY7Xw.js"),__vite__mapDeps([25,24,1]),import.meta.url)]);(!m||v(b(m)))&&(await S(),m=h())}catch(b){throw y?.message&&b instanceof Error&&(b.message=`${y.message}
|
|
233
233
|
${b.message}`),new p.VercelOidcTokenError("Failed to refresh OIDC token",b)}return m}function h(){const m=(0,d.getContext)().headers?.["x-vercel-oidc-token"]??wor.VERCEL_OIDC_TOKEN;if(!m)throw new Error("The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?");return m}}}),IWe=uF({"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/index.js"(e,t){var r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i=(f,h)=>{for(var m in h)r(f,m,{get:h[m],enumerable:!0})},o=(f,h,m,y)=>{if(h&&typeof h=="object"||typeof h=="function")for(let b of s(h))!a.call(f,b)&&b!==m&&r(f,b,{get:()=>h[b],enumerable:!(y=n(h,b))||y.enumerable});return f},l=f=>o(r({},"__esModule",{value:!0}),f),u={};i(u,{getContext:()=>p.getContext,getVercelOidcToken:()=>d.getVercelOidcToken,getVercelOidcTokenSync:()=>d.getVercelOidcTokenSync}),t.exports=l(u);var d=Eor(),p=NWe()}}),kor=sWe(IWe()),Oor=sWe(IWe()),_or="vercel.ai.gateway.error",jG=Symbol.for(_or),WCe,XCe,wd=class jWe extends(XCe=Error,WCe=jG,XCe){constructor({message:t,statusCode:r=500,cause:n}){super(t),this[WCe]=!0,this.statusCode=r,this.cause=n}static isInstance(t){return jWe.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&jG in t&&t[jG]===!0}},RWe="GatewayAuthenticationError",Cor=`vercel.ai.gateway.error.${RWe}`,YCe=Symbol.for(Cor),KCe,JCe,PWe=class $We extends(JCe=wd,KCe=YCe,JCe){constructor({message:t="Authentication failed",statusCode:r=401,cause:n}={}){super({message:t,statusCode:r,cause:n}),this[KCe]=!0,this.name=RWe,this.type="authentication_error"}static isInstance(t){return wd.hasMarker(t)&&YCe in t}static createContextualError({apiKeyProvided:t,oidcTokenProvided:r,message:n="Authentication failed",statusCode:s=401,cause:a}){let i;return t?i=`AI Gateway authentication failed: Invalid API key.
|
|
234
234
|
|
|
235
235
|
Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
|
|
@@ -564,7 +564,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
564
564
|
`&&(j=`
|
|
565
565
|
`);var Z=0,$=!1;this.parse=function(X,U,I){if(typeof X!="string")throw new Error("Input must be a string");var H=X.length,G=N.length,J=j.length,ee=R.length,te=T(L),se=[],ce=[],Se=[],W=Z=0;if(!X)return Te();if(M||M!==!1&&X.indexOf(Q)===-1){for(var ne=X.split(j),ae=0;ae<ne.length;ae++){if(Se=ne[ae],Z+=Se.length,ae!==ne.length-1)Z+=j.length;else if(I)return Te();if(!R||Se.substring(0,ee)!==R){if(te){if(se=[],oe(Se.split(N)),we(),$)return Te()}else oe(Se.split(N));if(F&&F<=ae)return se=se.slice(0,F),Te(!0)}}return Te()}for(var ge=X.indexOf(N,Z),le=X.indexOf(j,Z),xe=new RegExp(b(V)+b(Q),"g"),Ie=X.indexOf(Q,Z);;)if(X[Z]===Q)for(Ie=Z,Z++;;){if((Ie=X.indexOf(Q,Ie+1))===-1)return I||ce.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:se.length,index:Z}),fe();if(Ie===H-1)return fe(X.substring(Z,Ie).replace(xe,Q));if(Q===V&&X[Ie+1]===V)Ie++;else if(Q===V||Ie===0||X[Ie-1]!==V){ge!==-1&&ge<Ie+1&&(ge=X.indexOf(N,Ie+1));var Ce=de((le=le!==-1&&le<Ie+1?X.indexOf(j,Ie+1):le)===-1?ge:Math.min(ge,le));if(X.substr(Ie+1+Ce,G)===N){Se.push(X.substring(Z,Ie).replace(xe,Q)),X[Z=Ie+1+Ce+G]!==Q&&(Ie=X.indexOf(Q,Z)),ge=X.indexOf(N,Z),le=X.indexOf(j,Z);break}if(Ce=de(le),X.substring(Ie+1+Ce,Ie+1+Ce+J)===j){if(Se.push(X.substring(Z,Ie).replace(xe,Q)),Ne(Ie+1+Ce+J),ge=X.indexOf(N,Z),Ie=X.indexOf(Q,Z),te&&(we(),$))return Te();if(F&&se.length>=F)return Te(!0);break}ce.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:se.length,index:Z}),Ie++}}else if(R&&Se.length===0&&X.substring(Z,Z+ee)===R){if(le===-1)return Te();Z=le+J,le=X.indexOf(j,Z),ge=X.indexOf(N,Z)}else if(ge!==-1&&(ge<le||le===-1))Se.push(X.substring(Z,ge)),Z=ge+G,ge=X.indexOf(N,Z);else{if(le===-1)break;if(Se.push(X.substring(Z,le)),Ne(le+J),te&&(we(),$))return Te();if(F&&se.length>=F)return Te(!0)}return fe();function oe(ue){se.push(ue),W=Z}function de(ue){var De=0;return De=ue!==-1&&(ue=X.substring(Ie+1,ue))&&ue.trim()===""?ue.length:De}function fe(ue){return I||(ue===void 0&&(ue=X.substring(Z)),Se.push(ue),Z=H,oe(Se),te&&we()),Te()}function Ne(ue){Z=ue,oe(Se),Se=[],le=X.indexOf(j,Z)}function Te(ue){if(A.header&&!U&&se.length&&!q){var De=se[0],Le=Object.create(null),rt=new Set(De);let Ot=!1;for(let $t=0;$t<De.length;$t++){let ut=De[$t];if(Le[ut=T(A.transformHeader)?A.transformHeader(ut,$t):ut]){let or,Br=Le[ut];for(;or=ut+"_"+Br,Br++,rt.has(or););rt.add(or),De[$t]=or,Le[ut]++,Ot=!0,(z=z===null?{}:z)[or]=ut}else Le[ut]=1,De[$t]=ut;rt.add(ut)}Ot&&console.warn("Duplicate headers found and renamed."),q=!0}return{data:se,errors:ce,meta:{delimiter:N,linebreak:j,aborted:$,truncated:!!ue,cursor:W+(U||0),renamedHeaders:z}}}function we(){L(Te()),se=[],ce=[]}},this.abort=function(){$=!0},this.getCharIndex=function(){return Z}}function S(A){var N=A.data,j=o[N.workerId],R=!1;if(N.error)j.userError(N.error,N.file);else if(N.results&&N.results.data){var L={abort:function(){R=!0,w(N.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(T(j.userStep)){for(var F=0;F<N.results.data.length&&(j.userStep({data:N.results.data[F],errors:N.results.errors,meta:N.results.meta},L),!R);F++);delete N.results}else T(j.userChunk)&&(j.userChunk(N.results,L,N.file),delete N.results)}N.finished&&!R&&w(N.workerId,N.results)}function w(A,N){var j=o[A];T(j.userComplete)&&j.userComplete(N),j.terminate(),delete o[A]}function k(){throw new Error("Not implemented.")}function _(A){if(typeof A!="object"||A===null)return A;var N,j=Array.isArray(A)?[]:{};for(N in A)j[N]=_(A[N]);return j}function C(A,N){return function(){A.apply(N,arguments)}}function T(A){return typeof A=="function"}return u.parse=function(A,N){var j=(N=N||{}).dynamicTyping||!1;if(T(j)&&(N.dynamicTypingFunction=j,j={}),N.dynamicTyping=j,N.transform=!!T(N.transform)&&N.transform,!N.worker||!u.WORKERS_SUPPORTED)return j=null,u.NODE_STREAM_INPUT,typeof A=="string"?(A=(R=>R.charCodeAt(0)!==65279?R:R.slice(1))(A),j=new(N.download?p:h)(N)):A.readable===!0&&T(A.read)&&T(A.on)?j=new m(N):(n.File&&A instanceof File||A instanceof Object)&&(j=new f(N)),j.stream(A);(j=(()=>{var R;return!!u.WORKERS_SUPPORTED&&(R=(()=>{var L=n.URL||n.webkitURL||null,F=r.toString();return u.BLOB_URL||(u.BLOB_URL=L.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",F,")();"],{type:"text/javascript"})))})(),(R=new n.Worker(R)).onmessage=S,R.id=l++,o[R.id]=R)})()).userStep=N.step,j.userChunk=N.chunk,j.userComplete=N.complete,j.userError=N.error,N.step=T(N.step),N.chunk=T(N.chunk),N.complete=T(N.complete),N.error=T(N.error),delete N.worker,j.postMessage({input:A,config:N,workerId:j.id})},u.unparse=function(A,N){var j=!1,R=!0,L=",",F=`\r
|
|
566
566
|
`,M='"',z=M+M,q=!1,Q=null,V=!1,Z=((()=>{if(typeof N=="object"){if(typeof N.delimiter!="string"||u.BAD_DELIMITERS.filter(function(U){return N.delimiter.indexOf(U)!==-1}).length||(L=N.delimiter),typeof N.quotes!="boolean"&&typeof N.quotes!="function"&&!Array.isArray(N.quotes)||(j=N.quotes),typeof N.skipEmptyLines!="boolean"&&typeof N.skipEmptyLines!="string"||(q=N.skipEmptyLines),typeof N.newline=="string"&&(F=N.newline),typeof N.quoteChar=="string"&&(M=N.quoteChar),typeof N.header=="boolean"&&(R=N.header),Array.isArray(N.columns)){if(N.columns.length===0)throw new Error("Option columns is empty");Q=N.columns}N.escapeChar!==void 0&&(z=N.escapeChar+M),N.escapeFormulae instanceof RegExp?V=N.escapeFormulae:typeof N.escapeFormulae=="boolean"&&N.escapeFormulae&&(V=/^[=+\-@\t\r].*$/)}})(),new RegExp(b(M),"g"));if(typeof A=="string"&&(A=JSON.parse(A)),Array.isArray(A)){if(!A.length||Array.isArray(A[0]))return $(null,A,q);if(typeof A[0]=="object")return $(Q||Object.keys(A[0]),A,q)}else if(typeof A=="object")return typeof A.data=="string"&&(A.data=JSON.parse(A.data)),Array.isArray(A.data)&&(A.fields||(A.fields=A.meta&&A.meta.fields||Q),A.fields||(A.fields=Array.isArray(A.data[0])?A.fields:typeof A.data[0]=="object"?Object.keys(A.data[0]):[]),Array.isArray(A.data[0])||typeof A.data[0]=="object"||(A.data=[A.data])),$(A.fields||[],A.data||[],q);throw new Error("Unable to serialize unrecognized input");function $(U,I,H){var G="",J=(typeof U=="string"&&(U=JSON.parse(U)),typeof I=="string"&&(I=JSON.parse(I)),Array.isArray(U)&&0<U.length),ee=!Array.isArray(I[0]);if(J&&R){for(var te=0;te<U.length;te++)0<te&&(G+=L),G+=X(U[te],te);0<I.length&&(G+=F)}for(var se=0;se<I.length;se++){var ce=(J?U:I[se]).length,Se=!1,W=J?Object.keys(I[se]).length===0:I[se].length===0;if(H&&!J&&(Se=H==="greedy"?I[se].join("").trim()==="":I[se].length===1&&I[se][0].length===0),H==="greedy"&&J){for(var ne=[],ae=0;ae<ce;ae++){var ge=ee?U[ae]:ae;ne.push(I[se][ge])}Se=ne.join("").trim()===""}if(!Se){for(var le=0;le<ce;le++){0<le&&!W&&(G+=L);var xe=J&&ee?U[le]:le;G+=X(I[se][xe],le)}se<I.length-1&&(!H||0<ce&&!W)&&(G+=F)}}return G}function X(U,I){var H,G;return U==null?"":U.constructor===Date?JSON.stringify(U).slice(1,25):(G=!1,V&&typeof U=="string"&&V.test(U)&&(U="'"+U,G=!0),H=U.toString().replace(Z,z),(G=G||j===!0||typeof j=="function"&&j(U,I)||Array.isArray(j)&&j[I]||((J,ee)=>{for(var te=0;te<ee.length;te++)if(-1<J.indexOf(ee[te]))return!0;return!1})(H,u.BAD_DELIMITERS)||-1<H.indexOf(L)||H.charAt(0)===" "||H.charAt(H.length-1)===" ")?M+H+M:H)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
|
|
567
|
-
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!a&&!!n.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=v,u.ParserHandle=y,u.NetworkStreamer=p,u.FileStreamer=f,u.StringStreamer=h,u.ReadableStreamStreamer=m,n.jQuery&&((s=n.jQuery).fn.parse=function(A){var N=A.config||{},j=[];return this.each(function(F){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&n.FileReader)||!this.files||this.files.length===0)return!0;for(var M=0;M<this.files.length;M++)j.push({file:this.files[M],inputElem:this,instanceConfig:s.extend({},N)})}),R(),this;function R(){if(j.length===0)T(A.complete)&&A.complete();else{var F,M,z,q,Q=j[0];if(T(A.before)){var V=A.before(Q.file,Q.inputElem);if(typeof V=="object"){if(V.action==="abort")return F="AbortError",M=Q.file,z=Q.inputElem,q=V.reason,void(T(A.error)&&A.error({name:F},M,z,q));if(V.action==="skip")return void L();typeof V.config=="object"&&(Q.instanceConfig=s.extend(Q.instanceConfig,V.config))}else if(V==="skip")return void L()}var Z=Q.instanceConfig.complete;Q.instanceConfig.complete=function($){T(Z)&&Z($,Q.file,Q.inputElem),L()},u.parse(Q.file,Q.instanceConfig)}}function L(){j.splice(0,1),R()}}),i&&(n.onmessage=function(A){A=A.data,u.WORKER_ID===void 0&&A&&(u.WORKER_ID=A.workerId),typeof A.input=="string"?n.postMessage({workerId:u.WORKER_ID,results:u.parse(A.input,A.config),finished:!0}):(n.File&&A.input instanceof File||A.input instanceof Object)&&(A=u.parse(A.input,A.config))&&n.postMessage({workerId:u.WORKER_ID,results:A,finished:!0})}),(p.prototype=Object.create(d.prototype)).constructor=p,(f.prototype=Object.create(d.prototype)).constructor=f,(h.prototype=Object.create(h.prototype)).constructor=h,(m.prototype=Object.create(d.prototype)).constructor=m,u})})(B$)),B$.exports}var zXr=BXr();const Sdt=Td(zXr);var sPe=1,UXr=.9,VXr=.8,qXr=.17,vY=.1,xY=.999,HXr=.9999,QXr=.99,GXr=/[\\\/_+.#"@\[\(\{&]/,ZXr=/[\\\/_+.#"@\[\(\{&]/g,WXr=/[\s-]/,wdt=/[\s-]/g;function wre(e,t,r,n,s,a,i){if(a===t.length)return s===e.length?sPe:QXr;var o=`${s},${a}`;if(i[o]!==void 0)return i[o];for(var l=n.charAt(a),u=r.indexOf(l,s),d=0,p,f,h,m;u>=0;)p=wre(e,t,r,n,u+1,a+1,i),p>d&&(u===s?p*=sPe:GXr.test(e.charAt(u-1))?(p*=VXr,h=e.slice(s,u-1).match(ZXr),h&&s>0&&(p*=Math.pow(xY,h.length))):WXr.test(e.charAt(u-1))?(p*=UXr,m=e.slice(s,u-1).match(wdt),m&&s>0&&(p*=Math.pow(xY,m.length))):(p*=qXr,s>0&&(p*=Math.pow(xY,u-s))),e.charAt(u)!==t.charAt(a)&&(p*=HXr)),(p<vY&&r.charAt(u-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(u-1)!==n.charAt(a))&&(f=wre(e,t,r,n,u+1,a+2,i),f*vY>p&&(p=f*vY)),p>d&&(d=p),u=r.indexOf(l,u+1);return i[o]=d,d}function aPe(e){return e.toLowerCase().replace(wdt," ")}function XXr(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,wre(e,t,aPe(e),aPe(t),0,0,{})}var uC='[cmdk-group=""]',SY='[cmdk-group-items=""]',YXr='[cmdk-group-heading=""]',Edt='[cmdk-item=""]',iPe=`${Edt}:not([aria-disabled="true"])`,Ere="cmdk-item-select",ww="data-value",KXr=(e,t,r)=>XXr(e,t,r),kdt=E.createContext(void 0),sj=()=>E.useContext(kdt),Odt=E.createContext(void 0),Ape=()=>E.useContext(Odt),_dt=E.createContext(void 0),Cdt=E.forwardRef((e,t)=>{let r=Ew(()=>{var U,I;return{search:"",value:(I=(U=e.value)!=null?U:e.defaultValue)!=null?I:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=Ew(()=>new Set),s=Ew(()=>new Map),a=Ew(()=>new Map),i=Ew(()=>new Set),o=Tdt(e),{label:l,children:u,value:d,onValueChange:p,filter:f,shouldFilter:h,loop:m,disablePointerSelection:y=!1,vimBindings:b=!0,...v}=e,S=Wi(),w=Wi(),k=Wi(),_=E.useRef(null),C=cYr();b1(()=>{if(d!==void 0){let U=d.trim();r.current.value=U,T.emit()}},[d]),b1(()=>{C(6,F)},[]);let T=E.useMemo(()=>({subscribe:U=>(i.current.add(U),()=>i.current.delete(U)),snapshot:()=>r.current,setState:(U,I,H)=>{var G,J,ee,te;if(!Object.is(r.current[U],I)){if(r.current[U]=I,U==="search")L(),j(),C(1,R);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(k);se?se.focus():(G=document.getElementById(S))==null||G.focus()}if(C(7,()=>{var se;r.current.selectedItemId=(se=M())==null?void 0:se.id,T.emit()}),H||C(5,F),((J=o.current)==null?void 0:J.value)!==void 0){let se=I??"";(te=(ee=o.current).onValueChange)==null||te.call(ee,se);return}}T.emit()}},emit:()=>{i.current.forEach(U=>U())}}),[]),A=E.useMemo(()=>({value:(U,I,H)=>{var G;I!==((G=a.current.get(U))==null?void 0:G.value)&&(a.current.set(U,{value:I,keywords:H}),r.current.filtered.items.set(U,N(I,H)),C(2,()=>{j(),T.emit()}))},item:(U,I)=>(n.current.add(U),I&&(s.current.has(I)?s.current.get(I).add(U):s.current.set(I,new Set([U]))),C(3,()=>{L(),j(),r.current.value||R(),T.emit()}),()=>{a.current.delete(U),n.current.delete(U),r.current.filtered.items.delete(U);let H=M();C(4,()=>{L(),H?.getAttribute("id")===U&&R(),T.emit()})}),group:U=>(s.current.has(U)||s.current.set(U,new Set),()=>{a.current.delete(U),s.current.delete(U)}),filter:()=>o.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:S,inputId:k,labelId:w,listInnerRef:_}),[]);function N(U,I){var H,G;let J=(G=(H=o.current)==null?void 0:H.filter)!=null?G:KXr;return U?J(U,r.current.search,I):0}function j(){if(!r.current.search||o.current.shouldFilter===!1)return;let U=r.current.filtered.items,I=[];r.current.filtered.groups.forEach(G=>{let J=s.current.get(G),ee=0;J.forEach(te=>{let se=U.get(te);ee=Math.max(se,ee)}),I.push([G,ee])});let H=_.current;z().sort((G,J)=>{var ee,te;let se=G.getAttribute("id"),ce=J.getAttribute("id");return((ee=U.get(ce))!=null?ee:0)-((te=U.get(se))!=null?te:0)}).forEach(G=>{let J=G.closest(SY);J?J.appendChild(G.parentElement===J?G:G.closest(`${SY} > *`)):H.appendChild(G.parentElement===H?G:G.closest(`${SY} > *`))}),I.sort((G,J)=>J[1]-G[1]).forEach(G=>{var J;let ee=(J=_.current)==null?void 0:J.querySelector(`${uC}[${ww}="${encodeURIComponent(G[0])}"]`);ee?.parentElement.appendChild(ee)})}function R(){let U=z().find(H=>H.getAttribute("aria-disabled")!=="true"),I=U?.getAttribute(ww);T.setState("value",I||void 0)}function L(){var U,I,H,G;if(!r.current.search||o.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let J=0;for(let ee of n.current){let te=(I=(U=a.current.get(ee))==null?void 0:U.value)!=null?I:"",se=(G=(H=a.current.get(ee))==null?void 0:H.keywords)!=null?G:[],ce=N(te,se);r.current.filtered.items.set(ee,ce),ce>0&&J++}for(let[ee,te]of s.current)for(let se of te)if(r.current.filtered.items.get(se)>0){r.current.filtered.groups.add(ee);break}r.current.filtered.count=J}function F(){var U,I,H;let G=M();G&&(((U=G.parentElement)==null?void 0:U.firstChild)===G&&((H=(I=G.closest(uC))==null?void 0:I.querySelector(YXr))==null||H.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function M(){var U;return(U=_.current)==null?void 0:U.querySelector(`${Edt}[aria-selected="true"]`)}function z(){var U;return Array.from(((U=_.current)==null?void 0:U.querySelectorAll(iPe))||[])}function q(U){let I=z()[U];I&&T.setState("value",I.getAttribute(ww))}function Q(U){var I;let H=M(),G=z(),J=G.findIndex(te=>te===H),ee=G[J+U];(I=o.current)!=null&&I.loop&&(ee=J+U<0?G[G.length-1]:J+U===G.length?G[0]:G[J+U]),ee&&T.setState("value",ee.getAttribute(ww))}function V(U){let I=M(),H=I?.closest(uC),G;for(;H&&!G;)H=U>0?oYr(H,uC):lYr(H,uC),G=H?.querySelector(iPe);G?T.setState("value",G.getAttribute(ww)):Q(U)}let Z=()=>q(z().length-1),$=U=>{U.preventDefault(),U.metaKey?Z():U.altKey?V(1):Q(1)},X=U=>{U.preventDefault(),U.metaKey?q(0):U.altKey?V(-1):Q(-1)};return E.createElement(rl.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:U=>{var I;(I=v.onKeyDown)==null||I.call(v,U);let H=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||H))switch(U.key){case"n":case"j":{b&&U.ctrlKey&&$(U);break}case"ArrowDown":{$(U);break}case"p":case"k":{b&&U.ctrlKey&&X(U);break}case"ArrowUp":{X(U);break}case"Home":{U.preventDefault(),q(0);break}case"End":{U.preventDefault(),Z();break}case"Enter":{U.preventDefault();let G=M();if(G){let J=new Event(Ere);G.dispatchEvent(J)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:dYr},l),B6(e,U=>E.createElement(Odt.Provider,{value:T},E.createElement(kdt.Provider,{value:A},U))))}),JXr=E.forwardRef((e,t)=>{var r,n;let s=Wi(),a=E.useRef(null),i=E.useContext(_dt),o=sj(),l=Tdt(e),u=(n=(r=l.current)==null?void 0:r.forceMount)!=null?n:i?.forceMount;b1(()=>{if(!u)return o.item(s,i?.id)},[u]);let d=Adt(s,a,[e.value,e.children,a],e.keywords),p=Ape(),f=jv(C=>C.value&&C.value===d.current),h=jv(C=>u||o.filter()===!1?!0:C.search?C.filtered.items.get(s)>0:!0);E.useEffect(()=>{let C=a.current;if(!(!C||e.disabled))return C.addEventListener(Ere,m),()=>C.removeEventListener(Ere,m)},[h,e.onSelect,e.disabled]);function m(){var C,T;y(),(T=(C=l.current).onSelect)==null||T.call(C,d.current)}function y(){p.setState("value",d.current,!0)}if(!h)return null;let{disabled:b,value:v,onSelect:S,forceMount:w,keywords:k,..._}=e;return E.createElement(rl.div,{ref:am(a,t),..._,id:s,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!f,"data-disabled":!!b,"data-selected":!!f,onPointerMove:b||o.getDisablePointerSelection()?void 0:y,onClick:b?void 0:m},e.children)}),eYr=E.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...a}=e,i=Wi(),o=E.useRef(null),l=E.useRef(null),u=Wi(),d=sj(),p=jv(h=>s||d.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);b1(()=>d.group(i),[]),Adt(i,o,[e.value,e.heading,l]);let f=E.useMemo(()=>({id:i,forceMount:s}),[s]);return E.createElement(rl.div,{ref:am(o,t),...a,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},r&&E.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),B6(e,h=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},E.createElement(_dt.Provider,{value:f},h))))}),tYr=E.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=E.useRef(null),a=jv(i=>!i.search);return!r&&!a?null:E.createElement(rl.div,{ref:am(s,t),...n,"cmdk-separator":"",role:"separator"})}),rYr=E.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,a=Ape(),i=jv(u=>u.search),o=jv(u=>u.selectedItemId),l=sj();return E.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),E.createElement(rl.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":o,id:l.inputId,type:"text",value:s?e.value:i,onChange:u=>{s||a.setState("search",u.target.value),r?.(u.target.value)}})}),nYr=E.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,a=E.useRef(null),i=E.useRef(null),o=jv(u=>u.selectedItemId),l=sj();return E.useEffect(()=>{if(i.current&&a.current){let u=i.current,d=a.current,p,f=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let h=u.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(p),f.unobserve(u)}}},[]),E.createElement(rl.div,{ref:am(a,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":n,id:l.listId},B6(e,u=>E.createElement("div",{ref:am(i,l.listInnerRef),"cmdk-list-sizer":""},u)))}),sYr=E.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:a,container:i,...o}=e;return E.createElement(JL,{open:r,onOpenChange:n},E.createElement(eF,{container:i},E.createElement(bI,{"cmdk-overlay":"",className:s}),E.createElement(vI,{"aria-label":e.label,"cmdk-dialog":"",className:a},E.createElement(Cdt,{ref:t,...o}))))}),aYr=E.forwardRef((e,t)=>jv(r=>r.filtered.count===0)?E.createElement(rl.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),iYr=E.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...a}=e;return E.createElement(rl.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},B6(e,i=>E.createElement("div",{"aria-hidden":!0},i)))}),Du=Object.assign(Cdt,{List:nYr,Item:JXr,Input:rYr,Group:eYr,Separator:tYr,Dialog:sYr,Empty:aYr,Loading:iYr});function oYr(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function lYr(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Tdt(e){let t=E.useRef(e);return b1(()=>{t.current=e}),t}var b1=typeof window>"u"?E.useEffect:E.useLayoutEffect;function Ew(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function jv(e){let t=Ape(),r=()=>e(t.snapshot());return E.useSyncExternalStore(t.subscribe,r,r)}function Adt(e,t,r,n=[]){let s=E.useRef(),a=sj();return b1(()=>{var i;let o=(()=>{var u;for(let d of r){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():s.current}})(),l=n.map(u=>u.trim());a.value(e,o,l),(i=t.current)==null||i.setAttribute(ww,o),s.current=o}),s}var cYr=()=>{let[e,t]=E.useState(),r=Ew(()=>new Map);return b1(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function uYr(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function B6({asChild:e,children:t},r){return e&&E.isValidElement(t)?E.cloneElement(uYr(t),{ref:t.ref},r(t.props.children)):r(t)}var dYr={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};class oo{constructor(t,r,n,s){this.fromA=t,this.toA=r,this.fromB=n,this.toB=s}offset(t,r=t){return new oo(this.fromA+t,this.toA+t,this.fromB+r,this.toB+r)}}function v1(e,t,r,n,s,a){if(e==n)return[];let i=Npe(e,t,r,n,s,a),o=Ipe(e,t+i,r,n,s+i,a);t+=i,r-=o,s+=i,a-=o;let l=r-t,u=a-s;if(!l||!u)return[new oo(t,r,s,a)];if(l>u){let p=e.slice(t,r).indexOf(n.slice(s,a));if(p>-1)return[new oo(t,t+p,s,s),new oo(t+p+u,r,a,a)]}else if(u>l){let p=n.slice(s,a).indexOf(e.slice(t,r));if(p>-1)return[new oo(t,t,s,s+p),new oo(r,r,s+p+l,a)]}if(l==1||u==1)return[new oo(t,r,s,a)];let d=Idt(e,t,r,n,s,a);if(d){let[p,f,h]=d;return v1(e,t,p,n,s,f).concat(v1(e,p+h,r,n,f+h,a))}return pYr(e,t,r,n,s,a)}let qC=1e9,HC=0,Dpe=!1;function pYr(e,t,r,n,s,a){let i=r-t,o=a-s;if(qC<1e9&&Math.min(i,o)>qC*16||HC>0&&Date.now()>HC)return Math.min(i,o)>qC*64?[new oo(t,r,s,a)]:oPe(e,t,r,n,s,a);let l=Math.ceil((i+o)/2);wY.reset(l),EY.reset(l);let u=(h,m)=>e.charCodeAt(t+h)==n.charCodeAt(s+m),d=(h,m)=>e.charCodeAt(r-h-1)==n.charCodeAt(a-m-1),p=(i-o)%2!=0?EY:null,f=p?null:wY;for(let h=0;h<l;h++){if(h>qC||HC>0&&!(h&63)&&Date.now()>HC)return oPe(e,t,r,n,s,a);let m=wY.advance(h,i,o,l,p,!1,u)||EY.advance(h,i,o,l,f,!0,d);if(m)return fYr(e,t,r,t+m[0],n,s,a,s+m[1])}return[new oo(t,r,s,a)]}class Ddt{constructor(){this.vec=[]}reset(t){this.len=t<<1;for(let r=0;r<this.len;r++)this.vec[r]=-1;this.vec[t+1]=0,this.start=this.end=0}advance(t,r,n,s,a,i,o){for(let l=-t+this.start;l<=t-this.end;l+=2){let u=s+l,d=l==-t||l!=t&&this.vec[u-1]<this.vec[u+1]?this.vec[u+1]:this.vec[u-1]+1,p=d-l;for(;d<r&&p<n&&o(d,p);)d++,p++;if(this.vec[u]=d,d>r)this.end+=2;else if(p>n)this.start+=2;else if(a){let f=s+(r-n)-l;if(f>=0&&f<this.len&&a.vec[f]!=-1)if(i){let h=a.vec[f];if(h>=r-d)return[h,s+h-f]}else{let h=r-a.vec[f];if(d>=h)return[d,p]}}}return null}}const wY=new Ddt,EY=new Ddt;function fYr(e,t,r,n,s,a,i,o){let l=!1;return!Pk(e,n)&&++n==r&&(l=!0),!Pk(s,o)&&++o==i&&(l=!0),l?[new oo(t,r,a,i)]:v1(e,t,n,s,a,o).concat(v1(e,n,r,s,o,i))}function Ndt(e,t){let r=1,n=Math.min(e,t);for(;r<n;)r=r<<1;return r}function Npe(e,t,r,n,s,a){if(t==r||t==a||e.charCodeAt(t)!=n.charCodeAt(s))return 0;let i=Ndt(r-t,a-s);for(let o=t,l=s;;){let u=o+i,d=l+i;if(u>r||d>a||e.slice(o,u)!=n.slice(l,d)){if(i==1)return o-t-(Pk(e,o)?0:1);i=i>>1}else{if(u==r||d==a)return u-t;o=u,l=d}}}function Ipe(e,t,r,n,s,a){if(t==r||s==a||e.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let i=Ndt(r-t,a-s);for(let o=r,l=a;;){let u=o-i,d=l-i;if(u<t||d<s||e.slice(u,o)!=n.slice(d,l)){if(i==1)return r-o-(Pk(e,o)?0:1);i=i>>1}else{if(u==t||d==s)return r-u;o=u,l=d}}}function kre(e,t,r,n,s,a,i,o){let l=n.slice(s,a),u=null;for(;;){if(u||i<o)return u;for(let d=t+i;;){Pk(e,d)||d++;let p=d+i;if(Pk(e,p)||(p+=p==d+1?1:-1),p>=r)break;let f=e.slice(d,p),h=-1;for(;(h=l.indexOf(f,h+1))!=-1;){let m=Npe(e,p,r,n,s+h+f.length,a),y=Ipe(e,t,d,n,s,s+h),b=f.length+m+y;(!u||u[2]<b)&&(u=[d-y,s+h-y,b])}d=p}if(o<0)return u;i=i>>1}}function Idt(e,t,r,n,s,a){let i=r-t,o=a-s;if(i<o){let l=Idt(n,s,a,e,t,r);return l&&[l[1],l[0],l[2]]}return i<4||o*2<i?null:kre(e,t,r,n,s,a,Math.floor(i/4),-1)}function oPe(e,t,r,n,s,a){Dpe=!0;let i=r-t,o=a-s,l;if(i<o){let f=kre(n,s,a,e,t,r,Math.floor(i/6),50);l=f&&[f[1],f[0],f[2]]}else l=kre(e,t,r,n,s,a,Math.floor(o/6),50);if(!l)return[new oo(t,r,s,a)];let[u,d,p]=l;return v1(e,t,u,n,s,d).concat(v1(e,u+p,r,n,d+p,a))}function jdt(e,t){for(let r=1;r<e.length;r++){let n=e[r-1],s=e[r];n.toA>s.fromA-t&&n.toB>s.fromB-t&&(e[r-1]=new oo(n.fromA,s.toA,n.fromB,s.toB),e.splice(r--,1))}}function hYr(e,t,r){for(;;){jdt(r,1);let n=!1;for(let s=0;s<r.length;s++){let a=r[s],i,o;(i=Npe(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=r[s]=new oo(a.fromA+i,a.toA,a.fromB+i,a.toB)),(o=Ipe(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=r[s]=new oo(a.fromA,a.toA-o,a.fromB,a.toB-o));let l=a.toA-a.fromA,u=a.toB-a.fromB;if(l&&u)continue;let d=a.fromA-(s?r[s-1].toA:0),p=(s<r.length-1?r[s+1].fromA:e.length)-a.toA;if(!d||!p)continue;let f=l?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);d<=f.length&&e.slice(a.fromA-d,a.fromA)==f.slice(f.length-d)?(r[s]=new oo(a.fromA-d,a.toA-d,a.fromB-d,a.toB-d),n=!0):p<=f.length&&e.slice(a.toA,a.toA+p)==f.slice(0,p)&&(r[s]=new oo(a.fromA+p,a.toA+p,a.fromB+p,a.toB+p),n=!0)}if(!n)break}return r}function mYr(e,t,r){for(let n=0,s=0;s<e.length;s++){let a=e[s],i=a.toA-a.fromA,o=a.toB-a.fromB;if(i&&o||i>3||o>3){let l=s==e.length-1?t.length:e[s+1].fromA,u=a.fromA-n,d=l-a.toA,p=cPe(t,a.fromA,u),f=lPe(t,a.toA,d),h=a.fromA-p,m=f-a.toA;if((!i||!o)&&h&&m){let y=Math.max(i,o),[b,v,S]=i?[t,a.fromA,a.toA]:[r,a.fromB,a.toB];y>h&&t.slice(p,a.fromA)==b.slice(S-h,S)?(a=e[s]=new oo(p,p+i,a.fromB-h,a.toB-h),p=a.fromA,f=lPe(t,a.toA,l-a.toA)):y>m&&t.slice(a.toA,f)==b.slice(v,v+m)&&(a=e[s]=new oo(f-i,f,a.fromB+m,a.toB+m),f=a.toA,p=cPe(t,a.fromA,a.fromA-n)),h=a.fromA-p,m=f-a.toA}if(h||m)a=e[s]=new oo(a.fromA-h,a.toA+m,a.fromB-h,a.toB+m);else if(i){if(!o){let y=dPe(t,a.fromA,a.toA),b,v=y<0?-1:uPe(t,a.toA,a.fromA);y>-1&&(b=y-a.fromA)<=d&&t.slice(a.fromA,y)==t.slice(a.toA,a.toA+b)?a=e[s]=a.offset(b):v>-1&&(b=a.toA-v)<=u&&t.slice(a.fromA-b,a.fromA)==t.slice(v,a.toA)&&(a=e[s]=a.offset(-b))}}else{let y=dPe(r,a.fromB,a.toB),b,v=y<0?-1:uPe(r,a.toB,a.fromB);y>-1&&(b=y-a.fromB)<=d&&r.slice(a.fromB,y)==r.slice(a.toB,a.toB+b)?a=e[s]=a.offset(b):v>-1&&(b=a.toB-v)<=u&&r.slice(a.fromB-b,a.fromB)==r.slice(v,a.toB)&&(a=e[s]=a.offset(-b))}}n=a.toA}return jdt(e,3),e}let D0;try{D0=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Rdt(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Pdt(e,t){if(t==e.length)return 0;let r=e.charCodeAt(t);return r<192?Rdt(r)?1:0:D0?!Ldt(r)||t==e.length-1?D0.test(String.fromCharCode(r))?1:0:D0.test(e.slice(t,t+2))?2:0:0}function $dt(e,t){if(!t)return 0;let r=e.charCodeAt(t-1);return r<192?Rdt(r)?1:0:D0?!Fdt(r)||t==1?D0.test(String.fromCharCode(r))?1:0:D0.test(e.slice(t-2,t))?2:0:0}const Mdt=8;function lPe(e,t,r){if(t==e.length||!$dt(e,t))return t;for(let n=t,s=t+r,a=0;a<Mdt;a++){let i=Pdt(e,n);if(!i||n+i>s)return n;n+=i}return t}function cPe(e,t,r){if(!t||!Pdt(e,t))return t;for(let n=t,s=t-r,a=0;a<Mdt;a++){let i=$dt(e,n);if(!i||n-i<s)return n;n-=i}return t}function uPe(e,t,r){for(;t!=r;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function dPe(e,t,r){for(;t!=r;t++)if(e.charCodeAt(t)==10)return t;return-1}const Ldt=e=>e>=55296&&e<=56319,Fdt=e=>e>=56320&&e<=57343;function Pk(e,t){return!t||t==e.length||!Ldt(e.charCodeAt(t-1))||!Fdt(e.charCodeAt(t))}function gYr(e,t,r){var n;let s=r?.override;return s?s(e,t):(qC=((n=r?.scanLimit)!==null&&n!==void 0?n:1e9)>>1,HC=r?.timeout?Date.now()+r.timeout:0,Dpe=!1,hYr(e,t,v1(e,0,e.length,t,0,t.length)))}function Bdt(){return!Dpe}function zdt(e,t,r){return mYr(gYr(e,t,r),e,t)}const Ph=Xt.define({combine:e=>e[0]}),Ore=en.define(),yYr=Xt.define(),$k=Ki.define({create(e){return null},update(e,t){for(let r of t.effects)r.is(Ore)&&(e=r.value);for(let r of t.state.facet(yYr))e=r(e,t);return e}});class xE{constructor(t,r,n,s,a,i=!0){this.changes=t,this.fromA=r,this.toA=n,this.fromB=s,this.toB=a,this.precise=i}offset(t,r){return t||r?new xE(this.changes,this.fromA+t,this.toA+t,this.fromB+r,this.toB+r,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(t,r,n){let s=zdt(t.toString(),r.toString(),n);return Udt(s,t,r,0,0,Bdt())}static updateA(t,r,n,s,a){return gPe(mPe(t,s,!0,n.length),t,r,n,a)}static updateB(t,r,n,s,a){return gPe(mPe(t,s,!1,r.length),t,r,n,a)}}function pPe(e,t,r,n){let s=r.lineAt(e),a=n.lineAt(t);return s.to==e&&a.to==t&&e<r.length&&t<n.length?[e+1,t+1]:[s.from,a.from]}function fPe(e,t,r,n){let s=r.lineAt(e),a=n.lineAt(t);return s.from==e&&a.from==t?[e,t]:[s.to+1,a.to+1]}function Udt(e,t,r,n,s,a){let i=[];for(let o=0;o<e.length;o++){let l=e[o],[u,d]=pPe(l.fromA+n,l.fromB+s,t,r),[p,f]=fPe(l.toA+n,l.toB+s,t,r),h=[l.offset(-u+n,-d+s)];for(;o<e.length-1;){let m=e[o+1],[y,b]=pPe(m.fromA+n,m.fromB+s,t,r);if(y>p+1&&b>f+1)break;h.push(m.offset(-u+n,-d+s)),[p,f]=fPe(m.toA+n,m.toB+s,t,r),o++}i.push(new xE(h,u,Math.max(u,p),d,Math.max(d,f),a))}return i}const vP=1e3;function hPe(e,t,r,n){let s=0,a=e.length;for(;;){if(s==a){let d=0,p=0;s&&({toA:d,toB:p}=e[s-1]);let f=t-(r?d:p);return[d+f,p+f]}let i=s+a>>1,o=e[i],[l,u]=r?[o.fromA,o.toA]:[o.fromB,o.toB];if(l>t)a=i;else if(u<=t)s=i+1;else return n?[o.fromA,o.fromB]:[o.toA,o.toB]}}function mPe(e,t,r,n){let s=[];return t.iterChangedRanges((a,i,o,l)=>{let u=0,d=r?t.length:n,p=0,f=r?n:t.length;a>vP&&([u,p]=hPe(e,a-vP,r,!0)),i<t.length-vP&&([d,f]=hPe(e,i+vP,r,!1));let h=l-o-(i-a),m,[y,b]=r?[h,0]:[0,h];s.length&&(m=s[s.length-1]).toA>=u?s[s.length-1]={fromA:m.fromA,fromB:m.fromB,toA:d,toB:f,diffA:m.diffA+y,diffB:m.diffB+b}:s.push({fromA:u,toA:d,fromB:p,toB:f,diffA:y,diffB:b})}),s}function gPe(e,t,r,n,s){if(!e.length)return t;let a=[];for(let i=0,o=0,l=0,u=0;;i++){let d=i==e.length?null:e[i],p=d?d.fromA+o:r.length,f=d?d.fromB+l:n.length;for(;u<t.length;){let b=t[u];if(b.endA+o>p||b.endB+l>f)break;a.push(b.offset(o,l)),u++}if(!d)break;let h=d.toA+o+d.diffA,m=d.toB+l+d.diffB,y=zdt(r.sliceString(p,h),n.sliceString(f,m),s);for(let b of Udt(y,r,n,p,f,Bdt()))a.push(b);for(o+=d.diffA,l+=d.diffB;u<t.length;){let b=t[u];if(b.fromA+o>h&&b.fromB+l>m)break;u++}}return a}const bYr={scanLimit:500},Vdt=xi.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=vPe(e))}update(e){(e.docChanged||e.viewportChanged||vYr(e.startState,e.state)||xYr(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=vPe(e.view))}},{decorations:e=>e.deco}),xP=Wf.low(Dqe({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(Vdt))===null||t===void 0?void 0:t.gutter)||Yn.empty}}));function vYr(e,t){return e.field($k,!1)!=t.field($k,!1)}function xYr(e,t){return e.facet(Ph)!=t.facet(Ph)}const yPe=rr.line({class:"cm-changedLine"}),SYr=rr.mark({class:"cm-changedText"}),wYr=rr.mark({tagName:"ins",class:"cm-insertedLine"}),EYr=rr.mark({tagName:"del",class:"cm-deletedLine"}),bPe=new class extends cm{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function kYr(e,t,r,n,s,a){let i=r?e.fromA:e.fromB,o=r?e.toA:e.toB,l=0;if(i!=o){s.add(i,i,yPe),s.add(i,o,r?EYr:wYr),a&&a.add(i,i,bPe);for(let u=t.iterRange(i,o-1),d=i;!u.next().done;){if(u.lineBreak){d++,s.add(d,d,yPe),a&&a.add(d,d,bPe);continue}let p=d+u.value.length;if(n)for(;l<e.changes.length;){let f=e.changes[l],h=i+(r?f.fromA:f.fromB),m=i+(r?f.toA:f.toB),y=Math.max(d,h),b=Math.min(p,m);if(y<b&&s.add(y,b,SYr),m<p)l++;else break}d=p}}}function vPe(e){let t=e.state.field($k),{side:r,highlightChanges:n,markGutter:s,overrideChunk:a}=e.state.facet(Ph),i=r=="a",o=new yu,l=s?new yu:null,{from:u,to:d}=e.viewport;for(let p of t){if((i?p.fromA:p.fromB)>=d)break;(i?p.toA:p.toB)>u&&(!a||!a(e.state,p,o,l))&&kYr(p,e.state.doc,i,n,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}class SP extends Rd{constructor(t){super(),this.height=t}eq(t){return this.height==t.height}toDOM(){let t=document.createElement("div");return t.className="cm-mergeSpacer",t.style.height=this.height+"px",t}updateDOM(t){return t.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const E4=en.define({map:(e,t)=>e.map(t)}),QC=Ki.define({create:()=>rr.none,update:(e,t)=>{for(let r of t.effects)if(r.is(E4))return r.value;return e.map(t.changes)},provide:e=>mt.decorations.from(e)}),wP=.01;function xPe(e,t){if(e.size!=t.size)return!1;let r=e.iter(),n=t.iter();for(;r.value;){if(r.from!=n.from||Math.abs(r.value.spec.widget.height-n.value.spec.widget.height)>1)return!1;r.next(),n.next()}return!0}function OYr(e,t,r){let n=new yu,s=new yu,a=e.state.field(QC).iter(),i=t.state.field(QC).iter(),o=0,l=0,u=0,d=0,p=e.viewport,f=t.viewport;for(let b=0;;b++){let v=b<r.length?r[b]:null,S=v?v.fromA:e.state.doc.length,w=v?v.fromB:t.state.doc.length;if(o<S){let k=e.lineBlockAt(o).top+u,_=t.lineBlockAt(l).top+d,C=k-_;C<-wP?(u-=C,n.add(o,o,rr.widget({widget:new SP(-C),block:!0,side:-1}))):C>wP&&(d+=C,s.add(l,l,rr.widget({widget:new SP(C),block:!0,side:-1})))}if(S>o+1e3&&o<p.from&&S>p.from&&l<f.from&&w>f.from){let k=Math.min(p.from-o,f.from-l);o+=k,l+=k,b--}else if(v)o=v.toA,l=v.toB;else break;for(;a.value&&a.from<o;)u-=a.value.spec.widget.height,a.next();for(;i.value&&i.from<l;)d-=i.value.spec.widget.height,i.next()}for(;a.value;)u-=a.value.spec.widget.height,a.next();for(;i.value;)d-=i.value.spec.widget.height,i.next();let h=e.contentHeight+u-(t.contentHeight+d);h<wP?n.add(e.state.doc.length,e.state.doc.length,rr.widget({widget:new SP(-h),block:!0,side:1})):h>wP&&s.add(t.state.doc.length,t.state.doc.length,rr.widget({widget:new SP(h),block:!0,side:1}));let m=n.finish(),y=s.finish();xPe(m,e.state.field(QC))||e.dispatch({effects:E4.of(m)}),xPe(y,t.state.field(QC))||t.dispatch({effects:E4.of(y)})}const _re=en.define({map:(e,t)=>t.mapPos(e)});class _Yr extends Rd{constructor(t){super(),this.lines=t}eq(t){return this.lines==t.lines}toDOM(t){let r=document.createElement("div");return r.className="cm-collapsedLines",r.textContent=t.state.phrase("$ unchanged lines",this.lines),r.addEventListener("click",n=>{let s=t.posAtDOM(n.target);t.dispatch({effects:_re.of(s)});let{side:a,sibling:i}=t.state.facet(Ph);i&&i().dispatch({effects:_re.of(CYr(s,t.state.field($k),a=="a"))})}),r}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function CYr(e,t,r){let n=0,s=0;for(let a=0;;a++){let i=a<t.length?t[a]:null;if(!i||(r?i.fromA:i.fromB)>=e)return s+(e-n);[n,s]=r?[i.toA,i.toB]:[i.toB,i.toA]}}const TYr=Ki.define({create(e){return rr.none},update(e,t){e=e.map(t.changes);for(let r of t.effects)r.is(_re)&&(e=e.update({filter:n=>n!=r.value}));return e},provide:e=>mt.decorations.from(e)});function SPe({margin:e=3,minSize:t=4}){return TYr.init(r=>AYr(r,e,t))}function AYr(e,t,r){let n=new yu,s=e.facet(Ph).side=="a",a=e.field($k),i=1;for(let o=0;;o++){let l=o<a.length?a[o]:null,u=o?i+t:1,d=l?e.doc.lineAt(s?l.fromA:l.fromB).number-1-t:e.doc.lines,p=d-u+1;if(p>=r&&n.add(e.doc.line(u).from,e.doc.line(d).to,rr.replace({widget:new _Yr(p),block:!0})),!l)break;i=e.doc.lineAt(Math.min(e.doc.length,s?l.toA:l.toB)).number}return n.finish()}const DYr=mt.styleModule.of(new Zg({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),NYr=mt.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),wPe=new tO,EP=new tO;class IYr{constructor(t){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=t.diffConfig||bYr;let r=[Wf.low(Vdt),NYr,DYr,QC,mt.updateListener.of(p=>{this.measuring<0&&(p.heightChanged||p.viewportChanged)&&!p.transactions.some(f=>f.effects.some(h=>h.is(E4)))&&this.measure()})],n=[Ph.of({side:"a",sibling:()=>this.b,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&n.push(xP);let s=Zn.create({doc:t.a.doc,selection:t.a.selection,extensions:[t.a.extensions||[],mt.editorAttributes.of({class:"cm-merge-a"}),EP.of(n),r]}),a=[Ph.of({side:"b",sibling:()=>this.a,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&a.push(xP);let i=Zn.create({doc:t.b.doc,selection:t.b.selection,extensions:[t.b.extensions||[],mt.editorAttributes.of({class:"cm-merge-b"}),EP.of(a),r]});this.chunks=xE.build(s.doc,i.doc,this.diffConf);let o=[$k.init(()=>this.chunks),wPe.of(t.collapseUnchanged?SPe(t.collapseUnchanged):[])];s=s.update({effects:en.appendConfig.of(o)}).state,i=i.update({effects:en.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let l=t.orientation||"a-b",u=document.createElement("div");u.className="cm-mergeViewEditor";let d=document.createElement("div");d.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?u:d),this.editorDOM.appendChild(l=="a-b"?d:u),this.a=new mt({state:s,parent:u,root:t.root,dispatchTransactions:p=>this.dispatch(p,this.a)}),this.b=new mt({state:i,parent:d,root:t.root,dispatchTransactions:p=>this.dispatch(p,this.b)}),this.setupRevertControls(!!t.revertControls,t.revertControls=="b-to-a",t.renderRevertControl),t.parent&&t.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(t,r){if(t.some(n=>n.docChanged)){let n=t[t.length-1],s=t.reduce((i,o)=>i.compose(o.changes),ao.empty(t[0].startState.doc.length));this.chunks=r==this.a?xE.updateA(this.chunks,n.newDoc,this.b.state.doc,s,this.diffConf):xE.updateB(this.chunks,this.a.state.doc,n.newDoc,s,this.diffConf),r.update([...t,n.state.update({effects:Ore.of(this.chunks)})]);let a=r==this.a?this.b:this.a;a.update([a.state.update({effects:Ore.of(this.chunks)})]),this.scheduleMeasure()}else r.update(t)}reconfigure(t){if("diffConfig"in t&&(this.diffConf=t.diffConfig),"orientation"in t){let a=t.orientation!="b-a";if(a!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let i=this.a.dom.parentNode,o=this.b.dom.parentNode;i.remove(),o.remove(),this.editorDOM.insertBefore(a?i:o,this.editorDOM.firstChild),this.editorDOM.appendChild(a?o:i),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in t||"renderRevertControl"in t){let a=!!this.revertDOM,i=this.revertToA,o=this.renderRevert;"revertControls"in t&&(a=!!t.revertControls,i=t.revertControls=="b-to-a"),"renderRevertControl"in t&&(o=t.renderRevertControl),this.setupRevertControls(a,i,o)}let r="highlightChanges"in t,n="gutter"in t,s="collapseUnchanged"in t;if(r||n||s){let a=[],i=[];if(r||n){let o=this.a.state.facet(Ph),l=n?t.gutter!==!1:o.markGutter,u=r?t.highlightChanges!==!1:o.highlightChanges;a.push(EP.reconfigure([Ph.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:l}),l?xP:[]])),i.push(EP.reconfigure([Ph.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:l}),l?xP:[]]))}if(s){let o=wPe.reconfigure(t.collapseUnchanged?SPe(t.collapseUnchanged):[]);a.push(o),i.push(o)}this.a.dispatch({effects:a}),this.b.dispatch({effects:i})}this.scheduleMeasure()}setupRevertControls(t,r,n){this.revertToA=r,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!t&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):t&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",s=>this.revertClicked(s)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let t=this.dom.ownerDocument.defaultView||window;this.measuring=t.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){OYr(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let t=this.revertDOM,r=t.firstChild,n=this.a.viewport,s=this.b.viewport;for(let a=0;a<this.chunks.length;a++){let i=this.chunks[a];if(i.fromA>n.to||i.fromB>s.to)break;if(i.fromA<n.from||i.fromB<s.from)continue;let o=this.a.lineBlockAt(i.fromA).top+"px";for(;r&&+r.dataset.chunk<a;)r=EPe(r);r&&r.dataset.chunk==String(a)?(r.style.top!=o&&(r.style.top=o),r=r.nextSibling):t.insertBefore(this.renderRevertButton(o,a),r)}for(;r;)r=EPe(r)}renderRevertButton(t,r){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement("button");let s=this.a.state.phrase("Revert this chunk");n.setAttribute("aria-label",s),n.setAttribute("title",s),n.textContent=this.revertToLeft?"⇜":"⇝"}return n.style.top=t,n.setAttribute("data-chunk",String(r)),n}revertClicked(t){let r=t.target,n;for(;r&&r.parentNode!=this.revertDOM;)r=r.parentNode;if(r&&(n=this.chunks[r.dataset.chunk])){let[s,a,i,o,l,u]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],d=s.state.sliceDoc(i,Math.max(i,o-1));i!=o&&u<=a.state.doc.length&&(d+=s.state.lineBreak),a.dispatch({changes:{from:l,to:Math.min(a.state.doc.length,u),insert:d},userEvent:"revert"}),t.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function EPe(e){let t=e.nextSibling;return e.remove(),t}function qdt(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=qdt(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Hdt(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=qdt(e))&&(n&&(n+=" "),n+=t);return n}const jYr=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},RYr=(e,t)=>({classGroupId:e,validator:t}),Qdt=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),k4="-",kPe=[],PYr="arbitrary..",$Yr=e=>{const t=LYr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return MYr(i);const o=i.split(k4),l=o[0]===""&&o.length>1?1:0;return Gdt(o,l,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const l=n[i],u=r[i];return l?u?jYr(u,l):l:u||kPe}return r[i]||kPe}}},Gdt=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=Gdt(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const o=t===0?e.join(k4):e.slice(t).join(k4),l=i.length;for(let u=0;u<l;u++){const d=i[u];if(d.validator(o))return d.classGroupId}},MYr=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?PYr+n:void 0})(),LYr=e=>{const{theme:t,classGroups:r}=e;return FYr(r,t)},FYr=(e,t)=>{const r=Qdt();for(const n in e){const s=e[n];jpe(s,r,n,t)}return r},jpe=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];BYr(i,t,r,n)}},BYr=(e,t,r,n)=>{if(typeof e=="string"){zYr(e,t,r);return}if(typeof e=="function"){UYr(e,t,r,n);return}VYr(e,t,r,n)},zYr=(e,t,r)=>{const n=e===""?t:Zdt(t,e);n.classGroupId=r},UYr=(e,t,r,n)=>{if(qYr(e)){jpe(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(RYr(r,e))},VYr=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[o,l]=s[i];jpe(l,Zdt(t,o),r,n)}},Zdt=(e,t)=>{let r=e;const n=t.split(k4),s=n.length;for(let a=0;a<s;a++){const i=n[a];let o=r.nextPart.get(i);o||(o=Qdt(),r.nextPart.set(i,o)),r=o}return r},qYr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,HYr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=n[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},Cre="!",OPe=":",QYr=[],_Pe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),GYr=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,o=0,l=0,u;const d=s.length;for(let y=0;y<d;y++){const b=s[y];if(i===0&&o===0){if(b===OPe){a.push(s.slice(l,y)),l=y+1;continue}if(b==="/"){u=y;continue}}b==="["?i++:b==="]"?i--:b==="("?o++:b===")"&&o--}const p=a.length===0?s:s.slice(l);let f=p,h=!1;p.endsWith(Cre)?(f=p.slice(0,-1),h=!0):p.startsWith(Cre)&&(f=p.slice(1),h=!0);const m=u&&u>l?u-l:void 0;return _Pe(a,h,f,m)};if(t){const s=t+OPe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):_Pe(QYr,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},ZYr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],o=i[0]==="[",l=t.has(i);o||l?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},WYr=e=>({cache:HYr(e.cacheSize),parseClassName:GYr(e),sortModifiers:ZYr(e),...$Yr(e)}),XYr=/\s+/,YYr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],o=e.trim().split(XYr);let l="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{isExternal:p,modifiers:f,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:y}=r(d);if(p){l=d+(l.length>0?" "+l:l);continue}let b=!!y,v=n(b?m.substring(0,y):m);if(!v){if(!b){l=d+(l.length>0?" "+l:l);continue}if(v=n(m),!v){l=d+(l.length>0?" "+l:l);continue}b=!1}const S=f.length===0?"":f.length===1?f[0]:a(f).join(":"),w=h?S+Cre:S,k=w+v;if(i.indexOf(k)>-1)continue;i.push(k);const _=s(v,b);for(let C=0;C<_.length;++C){const T=_[C];i.push(w+T)}l=d+(l.length>0?" "+l:l)}return l},KYr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=Wdt(r))&&(s&&(s+=" "),s+=n);return s},Wdt=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Wdt(e[n]))&&(r&&(r+=" "),r+=t);return r},CPe=(e,...t)=>{let r,n,s,a;const i=l=>{const u=t.reduce((d,p)=>p(d),e());return r=WYr(u),n=r.cache.get,s=r.cache.set,a=o,o(l)},o=l=>{const u=n(l);if(u)return u;const d=YYr(l,r);return s(l,d),d};return a=i,(...l)=>a(KYr(...l))},JYr=[],Eo=e=>{const t=r=>r[e]||JYr;return t.isThemeGetter=!0,t},Xdt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ydt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,eKr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,tKr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rKr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nKr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sKr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aKr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pb=e=>eKr.test(e),Qn=e=>!!e&&!Number.isNaN(Number(e)),fb=e=>!!e&&Number.isInteger(Number(e)),kY=e=>e.endsWith("%")&&Qn(e.slice(0,-1)),fg=e=>tKr.test(e),Kdt=()=>!0,iKr=e=>rKr.test(e)&&!nKr.test(e),Rpe=()=>!1,oKr=e=>sKr.test(e),lKr=e=>aKr.test(e),cKr=e=>!br(e)&&!wr(e),uKr=e=>nx(e,tpt,Rpe),br=e=>Xdt.test(e),Bx=e=>nx(e,rpt,iKr),TPe=e=>nx(e,bKr,Qn),dKr=e=>nx(e,spt,Kdt),pKr=e=>nx(e,npt,Rpe),APe=e=>nx(e,Jdt,Rpe),fKr=e=>nx(e,ept,lKr),kP=e=>nx(e,apt,oKr),wr=e=>Ydt.test(e),dC=e=>iS(e,rpt),hKr=e=>iS(e,npt),DPe=e=>iS(e,Jdt),mKr=e=>iS(e,tpt),gKr=e=>iS(e,ept),OP=e=>iS(e,apt,!0),yKr=e=>iS(e,spt,!0),nx=(e,t,r)=>{const n=Xdt.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},iS=(e,t,r=!1)=>{const n=Ydt.exec(e);return n?n[1]?t(n[1]):r:!1},Jdt=e=>e==="position"||e==="percentage",ept=e=>e==="image"||e==="url",tpt=e=>e==="length"||e==="size"||e==="bg-size",rpt=e=>e==="length",bKr=e=>e==="number",npt=e=>e==="family-name",spt=e=>e==="number"||e==="weight",apt=e=>e==="shadow",NPe=()=>{const e=Eo("color"),t=Eo("font"),r=Eo("text"),n=Eo("font-weight"),s=Eo("tracking"),a=Eo("leading"),i=Eo("breakpoint"),o=Eo("container"),l=Eo("spacing"),u=Eo("radius"),d=Eo("shadow"),p=Eo("inset-shadow"),f=Eo("text-shadow"),h=Eo("drop-shadow"),m=Eo("blur"),y=Eo("perspective"),b=Eo("aspect"),v=Eo("ease"),S=Eo("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...k(),wr,br],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],A=()=>[wr,br,l],N=()=>[pb,"full","auto",...A()],j=()=>[fb,"none","subgrid",wr,br],R=()=>["auto",{span:["full",fb,wr,br]},fb,wr,br],L=()=>[fb,"auto",wr,br],F=()=>["auto","min","max","fr",wr,br],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...A()],Q=()=>[pb,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],V=()=>[pb,"screen","full","dvw","lvw","svw","min","max","fit",...A()],Z=()=>[pb,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],$=()=>[e,wr,br],X=()=>[...k(),DPe,APe,{position:[wr,br]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",mKr,uKr,{size:[wr,br]}],H=()=>[kY,dC,Bx],G=()=>["","none","full",u,wr,br],J=()=>["",Qn,dC,Bx],ee=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Qn,kY,DPe,APe],ce=()=>["","none",m,wr,br],Se=()=>["none",Qn,wr,br],W=()=>["none",Qn,wr,br],ne=()=>[Qn,wr,br],ae=()=>[pb,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fg],breakpoint:[fg],color:[Kdt],container:[fg],"drop-shadow":[fg],ease:["in","out","in-out"],font:[cKr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fg],shadow:[fg],spacing:["px",Qn],text:[fg],"text-shadow":[fg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pb,br,wr,b]}],container:["container"],columns:[{columns:[Qn,br,wr,o]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[fb,"auto",wr,br]}],basis:[{basis:[pb,"full","auto",o,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qn,pb,"auto","initial","none",br]}],grow:[{grow:["",Qn,wr,br]}],shrink:[{shrink:["",Qn,wr,br]}],order:[{order:[fb,"first","last","none",wr,br]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[o,"screen",...Q()]}],"min-w":[{"min-w":[o,"screen","none",...Q()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",r,dC,Bx]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,yKr,dKr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",kY,br]}],"font-family":[{font:[hKr,pKr,t]}],"font-features":[{"font-features":[br]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,wr,br]}],"line-clamp":[{"line-clamp":[Qn,"none",wr,TPe]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",wr,br]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",wr,br]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qn,"from-font","auto",wr,Bx]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Qn,"auto",wr,br]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",wr,br]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",wr,br]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},fb,wr,br],radial:["",wr,br],conic:[fb,wr,br]},gKr,fKr]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-bs":[{"border-bs":$()}],"border-color-be":[{"border-be":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qn,wr,br]}],"outline-w":[{outline:["",Qn,dC,Bx]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",d,OP,kP]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",p,OP,kP]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Qn,Bx]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",f,OP,kP]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Qn,wr,br]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qn]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[wr,br]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Qn]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",wr,br]}],filter:[{filter:["","none",wr,br]}],blur:[{blur:ce()}],brightness:[{brightness:[Qn,wr,br]}],contrast:[{contrast:[Qn,wr,br]}],"drop-shadow":[{"drop-shadow":["","none",h,OP,kP]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Qn,wr,br]}],"hue-rotate":[{"hue-rotate":[Qn,wr,br]}],invert:[{invert:["",Qn,wr,br]}],saturate:[{saturate:[Qn,wr,br]}],sepia:[{sepia:["",Qn,wr,br]}],"backdrop-filter":[{"backdrop-filter":["","none",wr,br]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Qn,wr,br]}],"backdrop-contrast":[{"backdrop-contrast":[Qn,wr,br]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qn,wr,br]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qn,wr,br]}],"backdrop-invert":[{"backdrop-invert":["",Qn,wr,br]}],"backdrop-opacity":[{"backdrop-opacity":[Qn,wr,br]}],"backdrop-saturate":[{"backdrop-saturate":[Qn,wr,br]}],"backdrop-sepia":[{"backdrop-sepia":["",Qn,wr,br]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",wr,br]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qn,"initial",wr,br]}],ease:[{ease:["linear","initial",v,wr,br]}],delay:[{delay:[Qn,wr,br]}],animate:[{animate:["none",S,wr,br]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,wr,br]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[wr,br,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",wr,br]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",wr,br]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Qn,dC,Bx,TPe]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},vKr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(GC(e,"cacheSize",t),GC(e,"prefix",r),GC(e,"experimentalParseClassName",n),_P(e.theme,a.theme),_P(e.classGroups,a.classGroups),_P(e.conflictingClassGroups,a.conflictingClassGroups),_P(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),GC(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),CP(e.theme,s.theme),CP(e.classGroups,s.classGroups),CP(e.conflictingClassGroups,s.conflictingClassGroups),CP(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),ipt(e,s,"orderSensitiveModifiers"),e),GC=(e,t,r)=>{r!==void 0&&(e[t]=r)},_P=(e,t)=>{if(t)for(const r in t)GC(e,r,t[r])},CP=(e,t)=>{if(t)for(const r in t)ipt(e,t,r)},ipt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},xKr=(e,...t)=>typeof e=="function"?CPe(NPe,e,...t):CPe(()=>vKr(NPe(),e),...t),SKr=Object.keys({...lze,...ojt}),wKr=Object.keys(fjt),EKr=Object.keys(ljt),kKr=Object.keys(cjt),OKr=Object.keys(ijt),zx=Object.keys(pjt),_Kr=Object.keys(ujt).concat(Object.keys(djt)),CKr=xKr({extend:{theme:{color:SKr,spacing:wKr,radius:OKr,leading:kKr,shadow:_Kr},classGroups:{"font-size":[{text:EKr}],h:[{h:zx}],w:[{w:zx}],size:[{size:zx}],"min-h":[{"min-h":zx}],"min-w":[{"min-w":zx}],"max-h":[{"max-h":zx}],"max-w":[{"max-w":zx}]}}});function K(...e){return CKr(Hdt(e))}const oi={sm:"h-form-sm",md:"h-form-md",lg:"h-form-lg",default:"h-form-default"},sh="focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",TKr="focus-within:outline-none focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",aj="rounded-md",AKr={sm:"[&>svg]:h-icon-sm [&>svg]:w-icon-sm",default:"[&>svg]:h-icon-default [&>svg]:w-icon-default",lg:"[&>svg]:h-icon-lg [&>svg]:w-icon-lg"},ve=({children:e,className:t,size:r="default",...n})=>c.jsx("span",{className:K("block",AKr[r],t),...n,children:e}),nc=Djt,dn=Njt,pn=Ijt,sn=E.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>c.jsx(jjt,{children:c.jsxs(vze,{ref:s,sideOffset:t,className:K("z-50 overflow-hidden rounded-md bg-surface6 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n,children:[r,c.jsx(Rjt,{className:"fill-surface6"})]})}));sn.displayName=vze.displayName;const DKr={sm:`${oi.sm} w-form-sm`,md:`${oi.md} w-form-md`,lg:`${oi.lg} w-form-lg`,default:`${oi.default}`},NKr={sm:"sm",md:"default",lg:"lg",default:"default"},IKr={default:"bg-surface2 hover:bg-surface4 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",light:"bg-surface3 hover:bg-surface5 text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",outline:"bg-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",ghost:"bg-transparent border-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",primary:"bg-accent1 hover:bg-accent1/90 text-surface1 font-medium hover:shadow-glow-accent1 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none"},jKr="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",oa=Ee.forwardRef(({className:e,children:t,tooltip:r,size:n="md",variant:s="default",disabled:a,...i},o)=>c.jsxs(dn,{children:[c.jsx(pn,{asChild:!0,children:c.jsx("button",{ref:o,disabled:a,"aria-label":typeof r=="string"?r:void 0,className:K(jKr,sh,IKr[s],DKr[n],a&&"active:scale-100",e),...i,children:c.jsx(ve,{size:NKr[n],children:t})})}),c.jsx(sn,{children:r})]}));oa.displayName="IconButton";const RKr={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-sm":"text-header-sm leading-header-sm","header-md":"text-header-md leading-header-md","header-lg":"text-header-lg leading-header-lg","header-xl":"text-header-xl leading-header-xl"},PKr={mono:"font-mono"},ze=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>c.jsx(e,{className:K(RKr[r],n&&PKr[n],t),...s}),Wr={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom",allSlow:"transition-all duration-slow ease-out-custom"},sx={visible:"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},$Kr={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},opt=({src:e,name:t,size:r="sm",interactive:n=!1})=>c.jsx("div",{className:K($Kr[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",Wr.all,n&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?c.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):c.jsx(ze,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),z6=({copiedDuration:e=1500}={})=>{const[t,r]=E.useState(!1);return{isCopied:t,copyToClipboard:s=>{s&&navigator.clipboard.writeText(s).then(()=>{r(!0),setTimeout(()=>r(!1),e)})}}},MKr=GBt({style:Fie.coldarkDark,customStyle:{margin:0,backgroundColor:"black"}}),LKr=()=>c.jsx(d3t,{remarkPlugins:[NUe],className:"aui-md",components:zKr}),IPe=E.memo(LKr),FKr=({language:e,code:t})=>{const{isCopied:r,copyToClipboard:n}=z6(),s=()=>{!t||r||n(t)};return c.jsxs("div",{style:{background:"hsl(0 0% 100% / 0.06)",borderTopRightRadius:"0.5rem",borderTopLeftRadius:"0.5rem",marginTop:"0.5rem",border:"1px solid hsl(0 0% 20.4%)",borderBottom:"none"},className:"flex items-center justify-between gap-4 px-4 py-2 text-sm font-semibold text-white",children:[c.jsx("span",{className:"lowercase [&>span]:text-xs",children:e}),c.jsx(oa,{variant:"light",size:"md",tooltip:"Copy",onClick:s,children:c.jsxs("span",{className:"grid",children:[c.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",r?"scale-100":"scale-0"),children:c.jsx(ya,{size:14})},"checkmark"),c.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",r?"scale-0":"scale-100"),children:c.jsx(Ql,{size:14})},"copy")]})})]})},BKr=({alt:e,src:t,...r})=>{const[n,s]=E.useState(!1);return E.useEffect(()=>{s(!1)},[t]),n||!t?c.jsxs("div",{children:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",width:"150",height:"150",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})}),c.jsx("p",{className:"text-xs italic text-neutral3 -mt-2.5 mb-2.5",children:"Image link is broken"})]}):c.jsx("img",{src:t,alt:e,...r,onError:()=>{s(!0)}})},zKr=W$t({h1:({className:e,...t})=>c.jsx("h1",{className:K("mb-8 scroll-m-20 text-4xl font-extrabold tracking-tight last:mb-0",e),...t,style:{marginBottom:"2rem"}}),h2:({className:e,...t})=>c.jsx("h2",{className:K("mb-4 mt-8 scroll-m-20 text-3xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"2rem"}}),h3:({className:e,...t})=>c.jsx("h3",{className:K("scroll-m-20 text-2xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1.5rem"}}),h4:({className:e,...t})=>c.jsx("h4",{className:K("scroll-m-20 text-xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1.5rem"}}),h5:({className:e,...t})=>c.jsx("h5",{className:K("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),h6:({className:e,...t})=>c.jsx("h6",{className:K("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),p:({className:e,...t})=>c.jsx("p",{className:K("leading-7 first:mt-0 last:mb-0",e),...t}),a:({className:e,...t})=>c.jsx("a",{className:K("text-neutral6 font-medium underline underline-offset-4",e),...t}),blockquote:({className:e,...t})=>c.jsx("blockquote",{className:K("border-l-2 pl-6 italic",e),...t}),ul:({className:e,...t})=>c.jsx("ul",{className:K("my-5 ml-6 list-disc [&>li]:mt-2",e),...t}),ol:({className:e,...t})=>c.jsx("ol",{className:K("my-5 ml-6 list-decimal [&>li]:mt-2",e),...t}),hr:({className:e,...t})=>c.jsx("hr",{className:K("my-5 border-b",e),...t}),table:({className:e,...t})=>c.jsx("table",{className:K("my-5 w-full border-separate border-spacing-0 overflow-y-auto",e),...t}),th:({className:e,...t})=>c.jsx("th",{className:K("bg-surface4 px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [&[align=center]]:text-center [&[align=right]]:text-right",e),...t}),td:({className:e,...t})=>c.jsx("td",{className:K("border-b border-l px-4 py-2 text-left last:border-r [&[align=center]]:text-center [&[align=right]]:text-right",e),...t}),tr:({className:e,...t})=>c.jsx("tr",{className:K("m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",e),...t}),sup:({className:e,...t})=>c.jsx("sup",{className:K("[&>a]:text-xs [&>a]:no-underline",e),...t}),pre:({className:e,...t})=>c.jsx("pre",{...t,style:{borderBottomRightRadius:"0.5rem",borderBottomLeftRadius:"0.5rem",background:"transparent",fontSize:"0.875rem",marginBottom:"0.5rem",border:"1px solid hsl(0 0% 20.4%)"},className:K("overflow-x-auto p-4 text-white",e)}),code:function({className:t,...r}){const n=aUe();return c.jsxs("pre",{style:{fontSize:"0.875rem",display:"inline"},children:[c.jsx("code",{className:K(!n&&"bg-surface4 rounded border font-semibold",t),...r,style:{fontWeight:"400",paddingBlock:n?0:"0.1em",paddingInline:n?0:"0.3em"}})," "]})},CodeHeader:FKr,SyntaxHighlighter:MKr,img:BKr}),UKr=({reason:e,tripwire:t})=>{const[r,n]=E.useState(!1),s=t&&(t.retry!==void 0||t.tripwirePayload||t.processorId);return c.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-950/20 overflow-hidden",children:[c.jsxs("div",{className:"flex items-start gap-3 p-4",children:[c.jsx(sI,{className:"w-5 h-5 text-amber-400 mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-sm font-medium text-amber-200 mb-1",children:"Content Blocked"}),c.jsx("p",{className:"text-sm text-amber-300/90",children:e})]})]}),s&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:()=>n(!r),className:"w-full flex items-center gap-2 px-4 py-2 text-xs text-amber-400/70 hover:text-amber-400 hover:bg-amber-900/20 transition-colors border-t border-amber-500/20",children:[r?c.jsx($a,{className:"w-3.5 h-3.5"}):c.jsx(qi,{className:"w-3.5 h-3.5"}),c.jsx("span",{children:"Details"})]}),r&&c.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-amber-500/20 bg-amber-950/10",children:[t.retry!==void 0&&c.jsxs("div",{className:"flex items-center gap-2 pt-3",children:[c.jsx(nI,{className:"w-3.5 h-3.5 text-amber-400/60"}),c.jsxs("span",{className:"text-xs text-amber-300/70",children:["Retry:"," ",t.retry?c.jsx("span",{className:"text-green-400",children:"Allowed"}):c.jsx("span",{className:"text-red-400",children:"Not allowed"})]})]}),t.processorId&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(fie,{className:"w-3.5 h-3.5 text-amber-400/60"}),c.jsxs("span",{className:"text-xs text-amber-300/70",children:["Processor:"," ",c.jsx("code",{className:"px-1.5 py-0.5 rounded bg-amber-900/30 text-amber-200 font-mono",children:t.processorId})]})]}),t.tripwirePayload!==void 0&&t.tripwirePayload!==null&&c.jsxs("div",{className:"pt-1",children:[c.jsx("p",{className:"text-xs text-amber-400/60 mb-1.5",children:"Metadata:"}),c.jsx("pre",{className:"text-xs text-amber-200/80 bg-amber-900/30 rounded p-2 overflow-x-auto font-mono",children:String(JSON.stringify(t.tripwirePayload,null,2))})]})]})]})]})},$i=e=>c.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 15C10.3565 15 12.137 14.2625 13.4497 12.9497C14.7625 11.637 15.5 9.85652 15.5 8C15.5 6.14348 14.7625 4.36301 13.4497 3.05025C12.137 1.7375 10.3565 1 8.5 1C6.64348 1 4.86301 1.7375 3.55025 3.05025C2.2375 4.36301 1.5 6.14348 1.5 8C1.5 9.85652 2.2375 11.637 3.55025 12.9497C4.86301 14.2625 6.64348 15 8.5 15ZM5.621 10.879L4.611 11.889C3.84179 11.1198 3.31794 10.1398 3.1057 9.07291C2.89346 8.00601 3.00236 6.90013 3.41864 5.89512C3.83491 4.89012 4.53986 4.03112 5.44434 3.42676C6.34881 2.8224 7.41219 2.49983 8.5 2.49983C9.58781 2.49983 10.6512 2.8224 11.5557 3.42676C12.4601 4.03112 13.1651 4.89012 13.5814 5.89512C13.9976 6.90013 14.1065 8.00601 13.8943 9.07291C13.6821 10.1398 13.1582 11.1198 12.389 11.889L11.379 10.879C11.1004 10.6003 10.7696 10.3792 10.4055 10.2284C10.0414 10.0776 9.6511 9.99995 9.257 10H7.743C7.3489 9.99995 6.95865 10.0776 6.59455 10.2284C6.23045 10.3792 5.89963 10.6003 5.621 10.879Z",fill:"currentColor"}),c.jsx("path",{d:"M8.5 4C7.96957 4 7.46086 4.21071 7.08579 4.58579C6.71071 4.96086 6.5 5.46957 6.5 6V6.5C6.5 7.03043 6.71071 7.53914 7.08579 7.91421C7.46086 8.28929 7.96957 8.5 8.5 8.5C9.03043 8.5 9.53914 8.28929 9.91421 7.91421C10.2893 7.53914 10.5 7.03043 10.5 6.5V6C10.5 5.46957 10.2893 4.96086 9.91421 4.58579C9.53914 4.21071 9.03043 4 8.5 4Z",fill:"currentColor"})]}),lpt=e=>c.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M63.0002 0.968262C28.5152 0.968262 0.55957 15.6484 0.55957 33.7573V51.2428C0.55957 69.3517 28.5152 84.0319 63.0002 84.0319C97.4853 84.0319 125.441 69.3517 125.441 51.2428V33.7573C125.441 15.6484 97.4853 0.968262 63.0002 0.968262Z",stroke:"#707070"}),c.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636V49.8363C6.67773 65.0322 31.894 77.351 62.9998 77.351C94.1055 77.351 119.322 65.0322 119.322 49.8363V35.1636Z",fill:"#2E2E2E",fillOpacity:"0.9"}),c.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636M119.322 35.1636C119.322 19.9677 94.1055 7.64893 62.9998 7.64893C31.894 7.64893 6.67773 19.9677 6.67773 35.1636M119.322 35.1636V49.8363C119.322 65.0322 94.1055 77.351 62.9998 77.351C31.894 77.351 6.67773 65.0322 6.67773 49.8363V35.1636",stroke:"#424242"}),c.jsxs("g",{clipPath:"url(#clip0_21421_19519)",children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.5383 47.0955C45.0714 50.3122 53.9322 52.1193 63.1714 52.1193C72.4106 52.1193 81.2714 50.3122 87.8045 47.0955C94.3376 43.8787 98.0078 39.5159 98.0078 34.9668C98.0078 30.4177 94.3376 26.0549 87.8045 22.8381C81.2714 19.6214 72.4106 17.8143 63.1714 17.8143C53.9322 17.8143 45.0714 19.6214 38.5383 22.8381C32.0052 26.0549 28.3349 30.4177 28.3349 34.9668C28.3349 39.5159 32.0052 43.8787 38.5383 47.0955ZM42.9089 34.9668L35.8005 34.9668C35.8004 32.3013 37.4056 29.6956 40.4132 27.4793C43.4207 25.263 47.6956 23.5355 52.6971 22.5154C57.6986 21.4954 63.2022 21.2285 68.5118 21.7485C73.8214 22.2685 78.6986 23.552 82.5266 25.4368C86.3546 27.3216 88.9615 29.723 90.0176 32.3373C91.0737 34.9517 90.5316 37.6614 88.4599 40.1241C86.3881 42.5867 82.8797 44.6915 78.3784 46.1723C73.8771 47.6532 68.585 48.4435 63.1714 48.4435V44.9435C63.1717 43.9778 62.7855 43.0215 62.035 42.1293C61.2845 41.2372 60.1843 40.4265 58.7973 39.7438L53.4695 37.1205C52.0828 36.4376 50.4364 35.8959 48.6244 35.5263C46.8124 35.1568 44.8702 34.9667 42.9089 34.9668Z",fill:"#A9A9A9"}),c.jsx("path",{d:"M77.2474 28.0361C75.3808 27.1171 72.8492 26.6007 70.2094 26.6007C67.5696 26.6007 65.038 27.1171 63.1714 28.0361L61.4119 28.9025C59.5453 29.8215 58.4966 31.068 58.4966 32.3678C58.4966 33.6676 59.5453 34.9141 61.4119 35.8331C63.2785 36.7522 65.8101 37.2685 68.4499 37.2685C71.0897 37.2685 73.6213 36.7522 75.4879 35.8331L77.2474 34.9668C79.114 34.0477 80.1627 32.8012 80.1627 31.5015C80.1627 30.2017 79.114 28.9552 77.2474 28.0361Z",fill:"#A9A9A9"})]}),c.jsx("defs",{children:c.jsx("clipPath",{id:"clip0_21421_19519",children:c.jsx("rect",{width:"62.7591",height:"62.7591",fill:"white",transform:"matrix(0.897148 0.441731 -0.897148 0.441731 63.1714 7.24365)"})})})]}),VKr=e=>c.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M11.0313 7.97578C11.0313 9.34436 9.92183 10.4538 8.55324 10.4538C7.18466 10.4538 6.0752 9.34436 6.0752 7.97578C6.0752 6.60719 7.18466 5.49773 8.55324 5.49773C9.92183 5.49773 11.0313 6.60719 11.0313 7.97578ZM11.0313 7.97578H14.573",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),c.jsx("path",{d:"M12.967 4.46154C11.9273 3.14431 10.3165 2.29883 8.50814 2.29883C5.37277 2.29883 2.83105 4.84055 2.83105 7.97591C2.83105 11.1113 5.37277 13.653 8.50814 13.653C10.3165 13.653 11.9273 12.8075 12.967 11.4903",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),Ppe=e=>c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.97865 4.57004C8.22604 4.75795 8.27426 5.11082 8.08635 5.35821L6.05486 8.03279C5.94873 8.17251 5.78348 8.25471 5.60803 8.25505C5.43257 8.2554 5.267 8.17385 5.16032 8.03454L3.80937 6.27034C3.6205 6.02369 3.66733 5.67063 3.91398 5.48176C4.16063 5.29288 4.51369 5.33972 4.70257 5.58637L5.6051 6.76498L7.19048 4.67774C7.37839 4.43036 7.73126 4.38213 7.97865 4.57004Z",fill:"currentColor"})]}),$pe=e=>c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.89741 4.10293C8.11707 4.32261 8.11706 4.67877 7.89738 4.89843L6.79517 6.00058L7.8962 7.10155C8.11588 7.32122 8.11589 7.67737 7.89623 7.89705C7.67656 8.11673 7.32041 8.11674 7.10073 7.89707L5.99965 6.79605L4.89856 7.89707C4.67889 8.11673 4.32273 8.11672 4.10307 7.89704C3.88341 7.67737 3.88342 7.32121 4.10309 7.10155L5.20413 6.00058L4.10191 4.89843C3.88224 4.67877 3.88223 4.32262 4.10189 4.10294C4.32155 3.88326 4.67771 3.88325 4.89738 4.10292L5.99965 5.20511L7.10191 4.10291C7.32159 3.88325 7.67774 3.88326 7.89741 4.10293Z",fill:"currentColor"})]}),ai=e=>c.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1747 3.18598L7.02554 1.95209C7.11557 1.89207 7.31087 1.87106 7.41016 1.90924L12.4139 3.83377C12.4683 3.85467 12.546 3.96798 12.546 4.03118V13.0167C12.546 13.265 12.7473 13.4663 12.9956 13.4663C13.2439 13.4663 13.4452 13.265 13.4452 13.0167V4.03118C13.4452 3.59605 13.1384 3.14906 12.7367 2.99456L7.73293 1.07004C7.36225 0.927472 6.86056 0.981451 6.52679 1.20396L4.20445 2.75219L3.90419 2.95236L3.90647 2.95824C3.69329 3.05449 3.55469 3.27599 3.55469 3.57581V11.7119C3.55469 12.2084 3.93067 12.7499 4.39251 12.9206L9.89804 14.955C10.3608 15.126 10.7359 14.8596 10.7359 14.3659V5.83295C10.7359 5.33662 10.3498 4.81289 9.88389 4.66643L5.1747 3.18598Z",fill:"currentColor"})}),Mpe=e=>c.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:c.jsx("path",{d:"M7.5 0.75C3.6325 0.75 0.5 3.8825 0.5 7.75C0.5 10.8475 2.50375 13.4637 5.28625 14.3912C5.63625 14.4525 5.7675 14.2425 5.7675 14.0587C5.7675 13.8925 5.75875 13.3412 5.75875 12.755C4 13.0787 3.545 12.3262 3.405 11.9325C3.32625 11.7312 2.985 11.11 2.6875 10.9437C2.4425 10.8125 2.0925 10.4887 2.67875 10.48C3.23 10.4712 3.62375 10.9875 3.755 11.1975C4.385 12.2562 5.39125 11.9587 5.79375 11.775C5.855 11.32 6.03875 11.0137 6.24 10.8387C4.6825 10.6637 3.055 10.06 3.055 7.3825C3.055 6.62125 3.32625 5.99125 3.7725 5.50125C3.7025 5.32625 3.4575 4.60875 3.8425 3.64625C3.8425 3.64625 4.42875 3.4625 5.7675 4.36375C6.3275 4.20625 6.9225 4.1275 7.5175 4.1275C8.1125 4.1275 8.7075 4.20625 9.2675 4.36375C10.6062 3.45375 11.1925 3.64625 11.1925 3.64625C11.5775 4.60875 11.3325 5.32625 11.2625 5.50125C11.7087 5.99125 11.98 6.6125 11.98 7.3825C11.98 10.0687 10.3438 10.6637 8.78625 10.8387C9.04 11.0575 9.25875 11.4775 9.25875 12.1337C9.25875 13.07 9.25 13.8225 9.25 14.0587C9.25 14.2425 9.38125 14.4612 9.73125 14.3912C11.1209 13.9221 12.3284 13.029 13.1839 11.8377C14.0393 10.6463 14.4996 9.21668 14.5 7.75C14.5 3.8825 11.3675 0.75 7.5 0.75Z",fill:"currentColor"})}),c.jsx("defs",{children:c.jsx("clipPath",{id:"clip0_21999_22095",children:c.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),cpt=e=>c.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[c.jsx("path",{d:"M13.5037 7.54867C13.5037 7.1144 13.4648 6.69683 13.3924 6.29596H7.62436V8.66776H10.9204C10.7756 9.43052 10.3413 10.0764 9.68994 10.5106V12.0529H11.6776C12.8356 10.9839 13.5037 9.41382 13.5037 7.54867Z",fill:"white"}),c.jsx("path",{d:"M7.62415 13.5339C9.27773 13.5339 10.6643 12.9882 11.6776 12.0529L9.68994 10.5106C9.14431 10.8781 8.44816 11.1009 7.62415 11.1009C6.03182 11.1009 4.67889 10.0263 4.19451 8.57877H2.15677V10.16C3.1645 12.1587 5.23008 13.5339 7.62415 13.5339Z",fill:"white"}),c.jsx("path",{d:"M4.19472 8.57315C4.07223 8.20569 3.99985 7.81595 3.99985 7.40952C3.99985 7.00308 4.07223 6.61335 4.19472 6.24589V4.66469H2.15698C1.73941 5.4887 1.5 6.41849 1.5 7.40952C1.5 8.40055 1.73941 9.33034 2.15698 10.1543L3.74374 8.91834L4.19472 8.57315Z",fill:"white"}),c.jsx("path",{d:"M7.62415 3.72376C8.5261 3.72376 9.32783 4.03555 9.96811 4.63685L11.7219 2.88306C10.6585 1.89202 9.27773 1.28516 7.62415 1.28516C5.23008 1.28516 3.16471 2.66036 2.15698 4.66469L4.19472 6.24589C4.6791 4.79832 6.03182 3.72376 7.62415 3.72376Z",fill:"white"})]}),c.jsx("defs",{children:c.jsx("clipPath",{id:"clip0_21999_20513",children:c.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),qKr=e=>c.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M4.31445 3.16083C3.78402 3.16083 3.27531 3.37154 2.90024 3.74661C2.52517 4.12169 2.31445 4.63039 2.31445 5.16083V5.66083C2.31445 6.19126 2.52517 6.69997 2.90024 7.07504C3.27531 7.45011 3.78402 7.66083 4.31445 7.66083C4.84489 7.66083 5.35359 7.45011 5.72867 7.07504C6.10374 6.69997 6.31445 6.19126 6.31445 5.66083V5.16083C6.31445 4.63039 6.10374 4.12169 5.72867 3.74661C5.35359 3.37154 4.84489 3.16083 4.31445 3.16083Z",fill:"currentColor"}),c.jsx("path",{d:"M6.76666 9.50235C6.57678 9.28532 6.30244 9.16083 6.01407 9.16083H4.50201C4.10791 9.16078 3.71766 9.23838 3.35356 9.38921C3.11733 9.48706 2.8951 9.6145 2.69205 9.76806C2.48056 9.928 2.38001 10.1888 2.38001 10.454V13.0642C2.38001 13.6165 2.82773 14.0642 3.38001 14.0642H8.55436C9.4135 14.0642 9.87269 13.0523 9.30695 12.4057L6.76666 9.50235Z",fill:"currentColor"}),c.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),c.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),c.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),upt=e=>c.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{d:"M3.8674 9.19968L4.14554 10.8649C4.23965 11.4283 4.75254 11.8237 5.32137 11.7713L5.58252 11.7472C6.56555 11.6567 7.43309 12.3868 7.51181 13.3708L7.59308 14.3867C7.60422 14.5259 7.71868 14.6342 7.85825 14.6376L9.91053 14.6876C10.1066 14.6924 10.2434 14.4948 10.17 14.3129L8.90452 11.1782C8.80956 10.9429 8.65085 10.7389 8.44626 10.5889L7.90134 10.1895C7.70604 10.0464 7.55223 9.85411 7.45759 9.63124C7.15011 8.90712 6.6579 7.71234 6.37054 6.88944C6.19204 6.3783 5.79931 6.29158 5.45492 6.21553C4.98179 6.11106 4.5999 6.02673 4.99001 4.88985C5.66408 2.92541 8.06015 2.07904 10.6601 3.33088C12.6488 4.2884 13.1187 6.35416 13.0328 7.58237C13.0297 7.62768 13.0214 7.67186 13.0094 7.71566C12.8829 8.17534 12.368 8.40491 11.9415 8.19169L10.3022 7.37201C10.2069 7.32439 10.0927 7.33657 10.0096 7.40322L8.64809 8.49559C8.55405 8.57104 8.52072 8.69931 8.56615 8.811L10.8995 14.5478C10.9404 14.6483 11.0369 14.715 11.1454 14.7177L12.0572 14.7399C12.2581 14.7448 12.3951 14.5382 12.3124 14.3551L11.8681 13.3706C11.4211 12.3803 11.6047 11.2192 12.3354 10.4151L13.4616 9.17575C13.7473 8.86125 13.9224 8.46187 13.9599 8.03858L13.9763 7.85359C14.2866 4.35298 11.377 1.41272 7.87336 1.68639C6.03919 1.82965 4.45399 3.02228 3.80807 4.74492L3.70275 5.02579C3.5828 5.34571 3.62741 5.70411 3.82213 5.98485L3.88946 6.08192C4.12183 6.41695 4.0958 6.86726 3.82637 7.17328L3.06705 8.03572C2.96261 8.15435 2.98058 8.33664 3.10617 8.43259L3.66059 8.85617C3.77064 8.94026 3.84458 9.06307 3.8674 9.19968Z",fill:"currentColor"})}),HKr=e=>c.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{d:"M10.1266 5.67745C10.3409 5.0225 10.2695 4.2961 9.92413 3.70069C9.40017 2.78376 8.34034 2.31934 7.30433 2.53369C6.85182 2.02164 6.18496 1.73584 5.49428 1.73584C4.43445 1.73584 3.50561 2.41461 3.17218 3.4149C2.49342 3.55779 1.90992 3.97458 1.56458 4.5819C1.04062 5.49883 1.1597 6.64202 1.86228 7.42796C1.64793 8.09482 1.73129 8.80931 2.07663 9.40472C2.60059 10.3217 3.66042 10.798 4.69643 10.5717C5.16085 11.0838 5.8158 11.3815 6.50648 11.3815C7.56631 11.3815 8.49515 10.7027 8.82858 9.70243C9.50735 9.55953 10.0908 9.14274 10.4362 8.53542C10.9601 7.61849 10.8411 6.46339 10.1266 5.67745ZM6.50648 10.7503C6.07778 10.7503 5.67291 10.6074 5.35138 10.3336C5.36329 10.3217 5.39902 10.3097 5.41093 10.2978L7.32815 9.19037C7.42341 9.13083 7.48295 9.03557 7.48295 8.91648V6.21332L8.29271 6.67774C8.30462 6.67774 8.30462 6.68965 8.30462 6.70156V8.9403C8.31653 9.94059 7.50677 10.7503 6.50648 10.7503ZM2.62441 9.09511C2.41006 8.72595 2.33861 8.29726 2.41006 7.88047C2.42197 7.89238 2.44578 7.90429 2.4696 7.91619L4.38682 9.02366C4.48209 9.0832 4.60117 9.0832 4.69643 9.02366L7.04235 7.66612V8.60687C7.04235 8.61878 7.04235 8.63069 7.03044 8.63069L5.0894 9.75006C4.23201 10.2502 3.12455 9.9525 2.62441 9.09511ZM2.12426 4.90342C2.33861 4.53427 2.67204 4.26038 3.06501 4.10557V6.39195C3.06501 6.49912 3.12455 6.60629 3.21982 6.66583L5.56573 8.02337L4.75597 8.48779C4.74407 8.48779 4.73216 8.4997 4.73216 8.48779L2.79112 7.36842C1.90992 6.86827 1.62412 5.76081 2.12426 4.90342ZM8.79285 6.45149L6.44694 5.09395L7.2567 4.62953C7.2686 4.62953 7.28051 4.61762 7.28051 4.62953L9.22155 5.7489C10.0908 6.24905 10.3766 7.35651 9.8765 8.2139C9.66215 8.58305 9.32872 8.85694 8.93575 8.99984V6.72538C8.94766 6.6182 8.88812 6.51103 8.79285 6.45149ZM9.5907 5.23685C9.5788 5.22494 9.55498 5.21303 9.53116 5.20113L7.61394 4.09366C7.51868 4.03412 7.39959 4.03412 7.30433 4.09366L4.95841 5.4512V4.51045C4.95841 4.49854 4.95841 4.48663 4.97032 4.48663L6.91136 3.36726C7.78066 2.86712 8.87621 3.16482 9.37636 4.03412C9.5907 4.39137 9.66215 4.82006 9.5907 5.23685ZM4.51781 6.904L3.70805 6.43958C3.69615 6.43958 3.69615 6.42767 3.69615 6.41576V4.17702C3.69615 3.17673 4.5059 2.36697 5.50619 2.36697C5.93489 2.36697 6.33977 2.50987 6.66129 2.78376C6.64938 2.79567 6.62556 2.80758 6.60175 2.81949L4.68453 3.92695C4.58926 3.98649 4.52972 4.08176 4.52972 4.20084V6.904H4.51781ZM4.95841 5.95134L6.00634 5.34402L7.05426 5.95134V7.15407L6.00634 7.76139L4.95841 7.15407V5.95134Z",fill:"currentColor"})}),Lpe=e=>c.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.40864 11.9983C7.58064 11.9733 6.84164 11.6153 6.31564 11.0563C6.31464 11.0563 6.31464 11.0553 6.31464 11.0553C5.78864 10.4963 5.47564 9.73633 5.50064 8.90833C5.52564 8.08033 5.88464 7.34133 6.44364 6.81533C7.00264 6.28833 7.76264 5.97633 8.59064 6.00133C9.41864 6.02633 10.1576 6.38433 10.6836 6.94333H10.6846C11.2106 7.50333 11.5236 8.26233 11.4986 9.09033C11.4726 9.91833 11.1146 10.6583 10.5556 11.1843C9.99664 11.7103 9.23664 12.0233 8.40864 11.9983ZM16.1266 8.15033L14.3606 7.74033C14.2316 7.14133 14.0146 6.57633 13.7216 6.05733L14.7726 4.57933C14.9116 4.38533 14.8926 4.12033 14.7296 3.94633L13.9206 3.08733C13.7576 2.91333 13.4946 2.87933 13.2916 3.00533L11.7526 3.96533C11.2526 3.64133 10.7016 3.39033 10.1116 3.22633L9.80964 1.43833C9.76964 1.20333 9.56964 1.02833 9.33164 1.02133L8.15264 0.985326C7.91364 0.978326 7.70364 1.14033 7.64964 1.37233L7.24064 3.13933C6.64164 3.26733 6.07664 3.48433 5.55664 3.77733L4.07864 2.72633C3.88464 2.58833 3.61964 2.60633 3.44664 2.76933L2.58664 3.57833C2.41364 3.74133 2.37964 4.00533 2.50564 4.20733L3.46564 5.74633C3.14164 6.24633 2.89064 6.79833 2.72564 7.38833L0.937635 7.68933C0.702635 7.72933 0.528635 7.92933 0.520635 8.16733L0.485635 9.34733C0.477635 9.58533 0.639635 9.79533 0.872635 9.84933L2.63864 10.2583C2.76764 10.8573 2.98464 11.4233 3.27764 11.9423L2.22564 13.4203C2.08764 13.6143 2.10564 13.8793 2.26964 14.0523L3.07864 14.9123C3.24164 15.0853 3.50464 15.1203 3.70664 14.9933L5.24564 14.0333C5.74663 14.3583 6.29764 14.6093 6.88764 14.7733L7.18964 16.5613C7.22864 16.7963 7.42864 16.9713 7.66764 16.9783L8.84663 17.0143C9.08564 17.0213 9.29564 16.8593 9.34964 16.6273L9.75864 14.8603C10.3576 14.7323 10.9226 14.5153 11.4416 14.2213L12.9206 15.2733C13.1146 15.4113 13.3786 15.3933 13.5526 15.2293L14.4116 14.4213C14.5856 14.2573 14.6196 13.9943 14.4936 13.7923L13.5336 12.2533C13.8576 11.7523 14.1086 11.2013 14.2726 10.6113L16.0616 10.3103C16.2966 10.2703 16.4706 10.0703 16.4776 9.83233L16.5136 8.65233C16.5206 8.41433 16.3586 8.20433 16.1266 8.15033Z",fill:"currentColor"})}),QKr=e=>c.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),tl=e=>c.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5605 1.42351C8.0791 0.904904 8.92215 0.906157 9.4395 1.42351L10.6922 2.67617C11.2108 3.19477 11.2095 4.03782 10.6922 4.55517L9.4395 5.80783C8.9209 6.32643 8.07785 6.32518 7.5605 5.80783L6.30784 4.55517C5.78923 4.03656 5.79049 3.19352 6.30784 2.67617L7.5605 1.42351ZM3.17618 5.80783C3.69478 5.28923 4.53782 5.29048 5.05517 5.80783L6.30784 7.0605C6.82644 7.5791 6.82519 8.42214 6.30784 8.93949L5.05517 10.1922C4.53657 10.7108 3.69353 10.7095 3.17618 10.1922L1.92351 8.93949C1.40491 8.42089 1.40616 7.57785 1.92351 7.0605L3.17618 5.80783ZM11.9448 5.80783C12.4634 5.28923 13.3065 5.29048 13.8238 5.80783L15.0765 7.0605C15.5951 7.5791 15.5938 8.42214 15.0765 8.93949L13.8238 10.1922C13.3052 10.7108 12.4622 10.7095 11.9448 10.1922L10.6922 8.93949C10.1736 8.42089 10.1748 7.57785 10.6922 7.0605L11.9448 5.80783ZM7.5605 10.1922C8.0791 9.67355 8.92215 9.67481 9.4395 10.1922L10.6922 11.4448C11.2108 11.9634 11.2095 12.8065 10.6922 13.3238L9.4395 14.5765C8.9209 15.0951 8.07785 15.0938 7.5605 14.5765L6.30784 13.3238C5.78923 12.8052 5.79049 11.9622 6.30784 11.4448L7.5605 10.1922Z",fill:"currentColor"})}),_O=e=>c.jsx(tjt,{...e}),Yl=e=>c.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),GKr=e=>c.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636V49.8363C6.67773 65.0322 31.894 77.351 62.9998 77.351C94.1055 77.351 119.322 65.0322 119.322 49.8363V35.1636Z",fill:"#2E2E2E",fillOpacity:"0.9"}),c.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636M119.322 35.1636C119.322 19.9677 94.1055 7.64893 62.9998 7.64893C31.894 7.64893 6.67773 19.9677 6.67773 35.1636M119.322 35.1636V49.8363C119.322 65.0322 94.1055 77.351 62.9998 77.351C31.894 77.351 6.67773 65.0322 6.67773 49.8363V35.1636",stroke:"#424242"}),c.jsx("path",{d:"M63.0002 0.968262C28.5152 0.968262 0.55957 15.6484 0.55957 33.7573V51.2428C0.55957 69.3517 28.5152 84.0319 63.0002 84.0319C97.4853 84.0319 125.441 69.3517 125.441 51.2428V33.7573C125.441 15.6484 97.4853 0.968262 63.0002 0.968262Z",stroke:"#707070"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M74.9374 21.357C76.2127 20.7291 78.2804 20.7291 79.5557 21.357L90.8129 26.8997C92.0882 27.5276 92.0882 28.5458 90.8129 29.1737L83.1638 32.9399C81.8885 33.5678 79.8207 33.5678 78.5454 32.9399L75.8033 31.5898L68.3324 35.2682L64.1502 39.696C63.8908 39.481 63.6138 39.2568 63.3231 39.0227L63.1495 38.883C62.2893 38.1914 61.2677 37.3701 60.6254 36.6376C60.5446 36.5456 60.4618 36.4463 60.3812 36.3407C60.1669 36.3011 59.9652 36.2603 59.7782 36.2205C58.2906 35.9043 56.6225 35.4013 55.2179 34.9777L54.9342 34.8922C54.4589 34.7491 54.0034 34.6127 53.5666 34.4849L62.5594 32.4258L70.0304 28.7473L67.2882 27.3972C66.0129 26.7692 66.0129 25.7512 67.2882 25.1232L74.9374 21.357ZM53.5666 34.4849C53.5666 34.4849 53.5666 34.4849 53.5666 34.4849L46.1603 36.1808L47.516 36.8483C48.7913 37.4762 48.7912 38.4943 47.516 39.1222L39.8668 42.8884C38.5916 43.5163 36.5238 43.5164 35.2485 42.8884L23.9913 37.3457C22.7159 36.7177 22.716 35.6996 23.9913 35.0717L31.6404 31.3055C32.9156 30.6776 34.9834 30.6776 36.2587 31.3055L38.5358 32.4267C39.6899 31.9483 40.9309 31.4611 42.153 31.0313C43.6354 30.5099 45.4001 29.9605 47.091 29.683C49.7278 29.2502 52.3729 29.7072 53.9892 30.0537C55.8019 30.4425 57.6745 31.0055 59.1934 31.4628C60.6081 31.8887 61.6949 32.2154 62.5594 32.4258L53.5666 34.4849ZM46.1603 36.1808L53.5666 34.4849C52.5189 34.1784 51.5786 33.9213 50.7293 33.7392C49.9958 33.5819 49.6114 33.5441 49.4794 33.5326C48.964 33.6384 48.0924 33.8823 46.8983 34.3023C46.0703 34.5936 45.1981 34.9293 44.3325 35.2808L46.1603 36.1808ZM64.1502 39.696L68.3324 35.2682C68.7598 35.6939 69.4232 36.229 70.2883 36.9256C71.2171 37.6735 72.3605 38.5954 73.15 39.488C73.8539 40.2838 74.7818 41.5862 73.9029 42.8844C73.3394 43.717 72.2235 44.5859 71.1648 45.3159C70.2916 45.9175 69.3021 46.5286 68.3305 47.0968L70.6077 48.218C71.8829 48.8459 71.8829 49.864 70.6077 50.4919L62.9585 54.2582C61.6833 54.8861 59.6154 54.8861 58.3402 54.2582L47.083 48.7154C45.8077 48.0875 45.8077 47.0694 47.083 46.4415L54.7321 42.6752C56.0074 42.0474 58.0751 42.0473 59.3505 42.6752L60.7062 43.3428L64.1502 39.696ZM64.1502 39.696L60.7062 43.3428L62.5339 44.2427C63.2478 43.8165 63.9298 43.3871 64.5213 42.9794C65.3742 42.3914 65.8695 41.9622 66.0846 41.7085C66.0613 41.6436 65.9844 41.4543 65.6649 41.0931C65.295 40.6749 64.773 40.212 64.1502 39.696Z",fill:"#A9A9A9"})]}),Gf=e=>c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),c.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),ZKr=e=>c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{d:"M1.5 8.5V8C1.5 7.60218 1.65804 7.22064 1.93934 6.93934C2.22064 6.65804 2.60218 6.5 3 6.5H13C13.3978 6.5 13.7794 6.65804 14.0607 6.93934C14.342 7.22064 14.5 7.60218 14.5 8V8.5M8.70667 4.20667L7.29333 2.79333C7.20048 2.70037 7.09022 2.62661 6.96886 2.57628C6.84749 2.52595 6.71739 2.50003 6.586 2.5H3C2.60218 2.5 2.22064 2.65804 1.93934 2.93934C1.65804 3.22064 1.5 3.60218 1.5 4V12C1.5 12.3978 1.65804 12.7794 1.93934 13.0607C2.22064 13.342 2.60218 13.5 3 13.5H13C13.3978 13.5 13.7794 13.342 14.0607 13.0607C14.342 12.7794 14.5 12.3978 14.5 12V6C14.5 5.60218 14.342 5.22064 14.0607 4.93934C13.7794 4.65804 13.3978 4.5 13 4.5H9.414C9.14887 4.49977 8.89402 4.39426 8.70667 4.20667Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),WKr=e=>c.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641V49.8368C6.67773 65.0327 31.894 77.3514 62.9998 77.3514C94.1055 77.3514 119.322 65.0327 119.322 49.8368V35.1641Z",fill:"#2E2E2E",fillOpacity:"0.9"}),c.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641M119.322 35.1641C119.322 19.9681 94.1055 7.64941 62.9998 7.64941C31.894 7.64941 6.67773 19.9681 6.67773 35.1641M119.322 35.1641V49.8368C119.322 65.0327 94.1055 77.3514 62.9998 77.3514C31.894 77.3514 6.67773 65.0327 6.67773 49.8368V35.1641",stroke:"#424242"}),c.jsx("path",{d:"M63.0002 0.96875C28.5152 0.96875 0.55957 15.6489 0.55957 33.7578V51.2433C0.55957 69.3522 28.5152 84.0323 63.0002 84.0323C97.4853 84.0323 125.441 69.3522 125.441 51.2433V33.7578C125.441 15.6489 97.4853 0.96875 63.0002 0.96875Z",stroke:"#707070"}),c.jsx("path",{d:"M51.5215 39.9726C50.5464 40.4477 48.9738 40.4435 48.009 39.9634C47.0442 39.4833 47.0526 38.709 48.0277 38.2339L69.7191 27.6672C72.7243 26.2032 72.7347 23.8181 69.7605 22.3476L69.6898 22.313C66.6927 20.8686 61.8895 20.8864 58.9368 22.3528L30.3946 36.5278C29.4288 37.0074 27.8561 37.0107 26.882 36.5352C25.9078 36.0597 25.901 35.2853 26.8668 34.8057L55.4092 20.6308C60.2847 18.2094 68.2157 18.1801 73.1645 20.5651L73.2814 20.6222C76.1808 22.0558 77.3624 24.0157 76.8227 25.8782C80.6339 25.5828 84.6694 26.1476 87.6364 27.5775C92.6525 29.9949 92.7059 33.962 87.7554 36.4119L61.5441 49.3836C61.282 49.5133 61.281 49.7227 61.5417 49.853L67.0252 52.5932C67.988 53.0743 67.9763 53.8486 66.9992 54.3226C66.0221 54.7966 64.4495 54.7909 63.4867 54.3098L58.0033 51.5695C55.8306 50.4838 55.8392 48.7391 58.0226 47.6585L84.2339 34.6868C87.2382 33.2 87.2058 30.7925 84.1617 29.3254C81.1488 27.8734 76.1811 27.9317 73.2127 29.4058L51.5215 39.9726Z",fill:"#A9A9A9"}),c.jsx("path",{d:"M63.0028 23.8809C64.0019 23.4098 65.5873 23.4146 66.5747 23.8972C67.562 24.3798 67.5831 25.1603 66.6338 25.6556L66.5879 25.679L45.1511 36.3113C42.2204 37.7649 42.2292 40.1117 45.1707 41.56C48.1228 43.0135 52.91 43.0118 55.8578 41.5563L76.8564 31.1875L76.9037 31.1648C77.9049 30.6949 79.4903 30.7013 80.4755 31.185C81.4763 31.6764 81.4785 32.4741 80.4806 32.9669L59.4821 43.3356C54.5363 45.7777 46.5044 45.7806 41.5516 43.342C36.6166 40.9121 36.602 36.9747 41.519 34.5359L62.9558 23.9037L63.0028 23.8809Z",fill:"#A9A9A9"})]}),XKr=e=>c.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641V49.8368C6.67773 65.0327 31.894 77.3514 62.9998 77.3514C94.1055 77.3514 119.322 65.0327 119.322 49.8368V35.1641Z",fill:"#2E2E2E",fillOpacity:"0.9"}),c.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641M119.322 35.1641C119.322 19.9681 94.1055 7.64941 62.9998 7.64941C31.894 7.64941 6.67773 19.9681 6.67773 35.1641M119.322 35.1641V49.8368C119.322 65.0327 94.1055 77.3514 62.9998 77.3514C31.894 77.3514 6.67773 65.0327 6.67773 49.8368V35.1641",stroke:"#424242"}),c.jsx("path",{d:"M63.0002 0.96875C28.5152 0.96875 0.55957 15.6489 0.55957 33.7578V51.2433C0.55957 69.3522 28.5152 84.0323 63.0002 84.0323C97.4853 84.0323 125.441 69.3522 125.441 51.2433V33.7578C125.441 15.6489 97.4853 0.96875 63.0002 0.96875Z",stroke:"#707070"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M95.8997 32.6647C98.4806 33.9355 98.4744 36.0012 95.8997 37.2689L89.6657 40.3384C87.0848 41.6091 82.8892 41.6061 80.3146 40.3384L74.0805 37.2689C71.4996 35.9981 71.5059 33.9324 74.0805 32.6647L80.3146 29.5952C82.8955 28.3244 87.091 28.3275 89.6657 29.5952L95.8997 32.6647ZM74.0805 21.9215C76.6614 23.1923 76.6552 25.258 74.0805 26.5257L67.8465 29.5952C65.2656 30.866 61.0701 30.8629 58.4954 29.5952L52.2613 26.5257C49.6804 25.255 49.6867 23.1892 52.2613 21.9215L58.4954 18.852C61.0763 17.5813 65.2718 17.5843 67.8465 18.852L74.0805 21.9215ZM74.0805 43.4079C76.6614 44.6786 76.6552 46.7444 74.0805 48.0121L67.8465 51.0816C65.2656 52.3523 61.0701 52.3493 58.4954 51.0816L52.2613 48.0121C49.6804 46.7413 49.6867 44.6756 52.2613 43.4079L58.4954 40.3384C61.0763 39.0676 65.2718 39.0707 67.8465 40.3384L74.0805 43.4079ZM52.2613 32.6647C54.8422 33.9355 54.836 36.0012 52.2613 37.2689L46.0273 40.3384C43.4464 41.6091 39.2509 41.6061 36.6762 40.3384L30.4422 37.2689C27.8613 35.9981 27.8675 33.9324 30.4422 32.6647L36.6762 29.5952C39.2571 28.3244 43.4526 28.3275 46.0273 29.5952L52.2613 32.6647Z",fill:"#A9A9A9"})]});function N0(e){return c.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),c.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),c.jsx("path",{d:"M15 2v2"}),c.jsx("path",{d:"M15 20v2"}),c.jsx("path",{d:"M2 15h2"}),c.jsx("path",{d:"M2 9h2"}),c.jsx("path",{d:"M20 15h2"}),c.jsx("path",{d:"M20 9h2"}),c.jsx("path",{d:"M9 2v2"}),c.jsx("path",{d:"M9 20v2"})]})}const YKr={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},KKr={warning:Pc,destructive:Xh,info:Ac},Ep=({children:e,variant:t="destructive",className:r})=>{const n=KKr[t];return c.jsx("div",{className:K(YKr[t],"p-3 rounded-md border shadow-sm",Wr.all,"animate-in fade-in-0 slide-in-from-top-2 duration-200",r),children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(ve,{className:"mt-0.5 flex-shrink-0",children:c.jsx(n,{})}),c.jsx("div",{className:"text-neutral4",children:e})]})})},kp=({children:e,as:t="h5"})=>c.jsx(ze,{as:t,variant:"ui-md",className:"font-semibold",children:e}),ny=({children:e,as:t="p"})=>c.jsx(ze,{as:t,variant:"ui-sm",children:e}),JKr={default:"text-neutral3 bg-surface4",success:"text-accent1 bg-accent1Dark",error:"text-accent2 bg-accent2Dark",info:"text-accent5 bg-accent5Dark",warning:"text-accent6 bg-accent6Dark"},eJr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},Ft=({icon:e,variant:t="default",className:r,children:n,...s})=>c.jsxs("div",{className:K("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",Wr.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":JKr[t],r),...s,children:[e&&c.jsx("span",{className:eJr[t],children:c.jsx(ve,{children:e})}),n]}),tJr=()=>{const e=jn(({part:i})=>i),[t,r]=E.useState(!1),n=e.text||"",s=e.metadata||{};if(s?.status==="tripwire")return c.jsx(UKr,{reason:n,tripwire:s.tripwire});if(s?.status==="warning")return c.jsxs(Ep,{variant:"warning",children:[c.jsx(kp,{as:"h5",children:"Warning"}),c.jsx(ny,{as:"p",children:n})]});if(s?.status==="error")return c.jsxs(Ep,{variant:"destructive",children:[c.jsx(kp,{as:"h5",children:"Error"}),c.jsx(ny,{as:"p",children:n})]});const a=s?.completionResult;if(a)return c.jsxs("div",{className:"mb-2 space-y-2",children:[c.jsxs("button",{onClick:()=>r(i=>!i),className:"flex items-center gap-2",children:[c.jsx(ve,{children:c.jsx(N1,{className:K("transition-all",t?"rotate-90":"rotate-180")})}),c.jsxs(Ft,{variant:"info",icon:c.jsx(zBe,{}),children:[t?"Show":"Hide"," completion check"]})]}),!t&&c.jsxs(Ep,{variant:"info",children:[c.jsx(kp,{as:"h5",children:a?.passed?"Complete":"Not Complete"}),c.jsx(IPe,{})]})]});try{const i=n.trim();if(i.startsWith("__ERROR__:")){const o=i.substring(10);return c.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[c.jsx(Xh,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),c.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:o})]})]})}else if(i.startsWith("Error:")){const o=i.substring(6).trim();return c.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[c.jsx(Xh,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),c.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:o})]})]})}return c.jsx(IPe,{})}catch{return c.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[c.jsx(Xh,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),c.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:String(n)})]})]})}},Zu="mastra_workspace",Ch={FILESYSTEM:{READ_FILE:`${Zu}_read_file`,WRITE_FILE:`${Zu}_write_file`,EDIT_FILE:`${Zu}_edit_file`,LIST_FILES:`${Zu}_list_files`,DELETE:`${Zu}_delete`,FILE_STAT:`${Zu}_file_stat`,MKDIR:`${Zu}_mkdir`},SANDBOX:{EXECUTE_COMMAND:`${Zu}_execute_command`,GET_PROCESS_OUTPUT:`${Zu}_get_process_output`,KILL_PROCESS:`${Zu}_kill_process`},SEARCH:{SEARCH:`${Zu}_search`,INDEX:`${Zu}_index`}},rJr={duration:5e3,cancel:{label:c.jsx(ve,{children:c.jsx(Os,{})}),onClick:()=>{}},unstyled:!0,classNames:{toast:"bg-surface3 w-full h-auto rounded-lg gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card [&>[data-content]]:flex-1",title:"text-xs font-medium text-neutral5",description:"text-xs text-neutral3",cancelButton:"!bg-transparent hover:!bg-surface2 !border-none !rounded-md !p-1.5 !m-0 !text-neutral3 hover:!text-neutral6 shrink-0 transition-all",actionButton:"!bg-white flex items-center justify-center font-medium !text-black order-last hover:opacity-80"}};function yd(e){const{classNames:t,...r}=rJr,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:K(t?.title,n?.title),toast:K(t?.toast,n?.toast),cancelButton:K(t?.cancelButton,n?.cancelButton),actionButton:K(t?.actionButton,n?.actionButton),description:K(t?.description,n?.description)},...s}}const We=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>Vl(r,yd(t)));if(Ee.isValidElement(e))return Vl(e,yd(t));if(typeof e=="string")return Vl(e,yd(t));throw new Error("Invalid message type")};We.success=(e,t={})=>{const r={...t,icon:c.jsx(ve,{className:"text-accent1 shrink-0",children:c.jsx(UBe,{})}),classNames:{...t.classNames,toast:K("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Vl.success(e,yd(r));case"object":return e.forEach(n=>Vl.success(n,yd(r)))}};We.error=(e,t={})=>{const r={...t,icon:c.jsx(ve,{className:"text-accent2 shrink-0",children:c.jsx(dA,{})}),classNames:{...t.classNames,toast:K("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Vl.error(e,yd(r));case"object":return e.forEach(n=>Vl.error(n,yd(r)))}};We.warning=(e,t={})=>{const r={...t,icon:c.jsx(ve,{className:"text-accent6 shrink-0",children:c.jsx(Xh,{})}),classNames:{...t.classNames,toast:K("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Vl.warning(e,yd(r));case"object":return e.forEach(n=>Vl.warning(n,yd(r)))}};We.info=(e,t={})=>{const r={...t,icon:c.jsx(ve,{className:"text-accent3 shrink-0",children:c.jsx(Ac,{})}),classNames:{...t.classNames,toast:K("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Vl.info(e,yd(r));case"object":return e.forEach(n=>Vl.info(n,yd(r)))}};We.custom=(e,t={})=>Vl(e,yd(t));We.dismiss=e=>{e&&Vl.dismiss(e)};We.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>Vl.promise(e,{loading:t??"Loading...",success:o=>(s?.(o),r),error:o=>(a?.(o),n||o?.message||"Error..."),...yd(i)});function Zf({text:e,copyMessage:t="Copied to clipboard!"}){const[r,n]=E.useState(!1),s=E.useRef(null),a=E.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{We.success(t),n(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{n(!1)},2e3)}).catch(()=>{We.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:r,handleCopy:a}}const dpt={sm:`${oi.sm} gap-1 text-ui-sm`,md:`${oi.md} gap-1`,lg:`${oi.lg} gap-2`,default:`${oi.default} text-ui-md`,large:`${oi.lg} text-ui-lg`},ppt={default:"bg-surface2 hover:bg-surface4 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",light:"bg-surface3 hover:bg-surface5 text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",outline:"bg-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",ghost:"bg-transparent border-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",primary:"bg-accent1 hover:bg-accent1/90 text-surface1 font-medium hover:shadow-glow-accent1 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none",cta:"bg-white/20 border-2 border-transparent hover:text-white hover:bg-white/25 disabled:opacity-50 disabled:cursor-not-allowed active:bg-white/30 text-neutral5",standard:"bg-white/10 border-2 border-transparent hover:text-white hover:bg-white/15 disabled:opacity-50 disabled:cursor-not-allowed active:bg-white/20 text-neutral4"},fpt="border border-border1 px-2 text-ui-md inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",nJr=K("flex items-center justify-center rounded-lg gap-[.75em] px-[1em] leading-0 transition-colors duration-200 ease-out-custom","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em]","[&:hover>svg]:opacity-100"),sJr="focus-visible:outline-none focus-visible:border-accent1/50";function U6(e){const t=e?.variant||"default",r=e?.size||"md";return K(fpt,sh,ppt[t],dpt[r])}const ye=Ee.forwardRef(({className:e,as:t,size:r="md",variant:n="default",disabled:s,...a},i)=>{const o=t||"button",l=["cta","standard"].includes(n);return c.jsx(o,{ref:i,disabled:s,className:K(l?nJr:fpt,l?sJr:sh,ppt[n],dpt[r],s&&"active:scale-100",e),...a})});ye.displayName="Button";const sN=Ee.forwardRef(({tooltipContent:e,...t},r)=>c.jsxs(dn,{children:[c.jsx(pn,{asChild:!0,children:c.jsx(ye,{ref:r,...t})}),e&&c.jsx(sn,{children:e})]}));sN.displayName="ButtonWithTooltip";function ql({content:e,copyMessage:t,tooltip:r="Copy to clipboard",iconSize:n="default",className:s,size:a="sm"}){const[i,o]=E.useState(!1),{handleCopy:l}=Zf({text:e,copyMessage:t}),u=()=>{l(),o(!0),setTimeout(()=>o(!1),2e3)};return c.jsxs(dn,{children:[c.jsx(pn,{asChild:!0,children:c.jsx(ye,{onClick:u,type:"button",size:a,variant:"standard",children:i?c.jsx(ya,{}):c.jsx(Ql,{})})}),c.jsx(sn,{children:i?"Copied!":r})]})}const aJr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,iJr=rr.mark({class:"cm-variable-highlight"}),jPe=new _qe({regexp:aJr,decoration:()=>iJr}),oJr=xi.fromClass(class{decorations;constructor(e){this.decorations=jPe.createDeco(e)}update(e){this.decorations=jPe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),lJr=oJr;function cJr(e,t=5){if(!e?.properties)return[];const r=[];function n(s,a,i){if(i>t)return;const o=Array.isArray(s.type)?s.type.join(" | "):s.type;if(r.push({path:a,label:a,description:s.description??s.title,type:o}),s.properties)for(const[l,u]of Object.entries(s.properties))n(u,`${a}.${l}`,i+1);if(s.items?.properties)for(const[l,u]of Object.entries(s.items.properties))n(u,`${a}[].${l}`,i+1)}for(const[s,a]of Object.entries(e.properties))n(a,s,1);return r}function uJr(e){const t=cJr(e);return dHe({override:[dJr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function dJr(e){return t=>{const n=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!n)return null;const s=n[1]??"",a=t.pos-s.length,i=s?e.filter(l=>l.path.toLowerCase().startsWith(s.toLowerCase())):e;if(i.length===0)return null;const o=i.map(l=>({label:l.path,displayLabel:l.path,detail:l.type,info:l.description,apply:(u,d,p,f)=>{const y=u.state.sliceDoc(f,f+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:p,to:f,insert:y},selection:{anchor:p+y.length}})}}));return{from:a,options:o,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const ax=()=>E.useMemo(()=>{const e=GL({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#939393",background:"transparent"},styles:[{tag:[re.className,re.propertyName]},{tag:re.heading,color:"#ff79c6",fontWeight:"bold"},{tag:[re.heading1,re.heading2,re.heading3,re.heading4,re.heading5,re.heading6],color:"#ff79c6",fontWeight:"bold"},{tag:re.emphasis,fontStyle:"italic",color:"#f8f8f2"},{tag:re.strong,fontWeight:"bold",color:"#f8f8f2"},{tag:re.link,color:"#8be9fd",textDecoration:"underline"},{tag:re.url,color:"#8be9fd"},{tag:re.monospace,color:"#f1fa8c"},{tag:re.strikethrough,textDecoration:"line-through"},{tag:re.quote,fontStyle:"italic",color:"#6272a4"}]}),t=mt.theme({".cm-editor":{colorScheme:"dark",backgroundColor:"transparent"},".cm-lineNumbers .cm-gutterElement":{color:"#939393"},".cm-tooltip-autocomplete":{backgroundColor:"#282a36",border:"1px solid #44475a",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.4)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"#f8f8f2"},".cm-completionDetail":{color:"#A1A1AA",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"#282a36",border:"1px solid #44475a",color:"#6272a4",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"#44475a",color:"#f8f8f2"},".cm-line .cm-variable-highlight":{color:"#F59E0B !important",fontWeight:"500"}});return[e,t]},[]),Wa=E.forwardRef(({data:e,value:t,onChange:r,showCopyButton:n=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:o,wordWrap:l=!1,schema:u,autoFocus:d,...p},f)=>{const h=ax(),m=e?JSON.stringify(e,null,2):t??"",y=E.useMemo(()=>{const b=[];return a==="json"?b.push(fd):a==="markdown"&&(b.push(Xoe({base:Y0,codeLanguages:jQe})),b.push(mt.lineWrapping)),i&&a==="markdown"&&b.push(lJr),u&&a==="markdown"&&b.push(uJr(u)),b},[a,i,u]);return c.jsxs("div",{className:K("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...p,children:[n&&c.jsx(ql,{content:m,className:"absolute top-2 right-2 z-20"}),c.jsx(vd,{ref:f,value:m,theme:h,extensions:y,onChange:r,"aria-label":"Code editor",placeholder:o,height:"100%",style:{height:"100%"},autoFocus:d})]})});async function pJr(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ge(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-r9pq8NPk.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([26,1]),import.meta.url);if(!(t in n))return null;const{tokens:s}=await r(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}const V6=({children:e,initialCollapsed:t=!0,icon:r,title:n,collapsible:s=!0,extraInfo:a,"data-testid":i})=>{const[o,l]=E.useState(t);return E.useEffect(()=>{l(t)},[t]),c.jsxs("div",{className:"mb-4","data-testid":i,children:[c.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between",children:[c.jsxs("button",{onClick:s?()=>l(u=>!u):void 0,className:"flex items-center gap-2 disabled:cursor-not-allowed",disabled:!s,type:"button",children:[c.jsx(ve,{children:c.jsx(N1,{className:K("transition-all",o?"rotate-90":"rotate-180")})}),c.jsx(Ft,{icon:r,children:n})]}),a]}),!o&&c.jsx("div",{className:"pt-2",children:c.jsx("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:e})})]})},ea=JL,hpt=VGe,fJr=eF,mpt=E.forwardRef(({className:e,...t},r)=>c.jsx(bI,{ref:r,className:K("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));mpt.displayName=bI.displayName;const Ls=E.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(fJr,{children:[c.jsx(mpt,{}),c.jsxs(vI,{ref:n,className:K("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%]","gap-4 border border-border1 bg-surface3 py-6 shadow-dialog rounded-lg","duration-slow","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",e),...r,children:[t,c.jsxs(nF,{className:K("absolute right-4 top-4 rounded-md p-1","text-neutral3 hover:text-neutral6 hover:bg-surface4","transition-all duration-normal ease-out-custom","focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","disabled:pointer-events-none"),children:[c.jsx(Os,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ls.displayName=vI.displayName;const ta=({className:e,...t})=>c.jsx("div",{className:K("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});ta.displayName="DialogHeader";const q6=({className:e,...t})=>c.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});q6.displayName="DialogFooter";const ra=({className:e,...t})=>c.jsx("div",{className:K("overflow-y-auto px-6 max-h-[50vh]",e),...t});ra.displayName="DialogBody";const Fs=E.forwardRef(({className:e,...t},r)=>c.jsx(tF,{ref:r,className:K("text-ui-md font-medium",e),...t}));Fs.displayName=tF.displayName;const ni=E.forwardRef(({className:e,...t},r)=>c.jsx(rF,{ref:r,className:K("sr-only",e),...t}));ni.displayName=rF.displayName;const hJr=({selectionReason:e,open:t,onOpenChange:r,input:n})=>{let s=null;if(n)try{s=typeof n=="object"?c.jsx(Wa,{data:n}):c.jsx(Wa,{data:JSON.parse(n)})}catch{s=c.jsx("pre",{className:"whitespace-pre-wrap",children:n})}return c.jsx(ea,{open:t,onOpenChange:r,children:c.jsxs(Ls,{children:[c.jsxs(ta,{children:[c.jsx(Fs,{children:"Agent Network Metadata"}),c.jsx(ni,{children:"View the metadata of the agent's network choice."})]}),c.jsxs(ra,{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ze,{className:"text-neutral3",children:"Selection Reason"}),c.jsx("div",{className:"text-neutral6 text-ui-md",children:e})]}),s&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(ze,{className:"text-neutral3",children:"Input"}),c.jsx("div",{className:"text-neutral6 text-ui-md",children:s})]})]})]})})},Fpe=({selectionReason:e,input:t})=>{const[r,n]=E.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsx(oa,{variant:"light",size:"md",tooltip:"Show selection reason",onClick:()=>n(s=>!s),children:c.jsx(NIt,{className:"text-neutral3 size-5"})}),c.jsx(hJr,{selectionReason:e||"",open:r,onOpenChange:n,input:t})]})},gpt=E.createContext(void 0);function mJr({children:e,approveToolcall:t,declineToolcall:r,approveToolcallGenerate:n,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:l,networkToolCallApprovals:u}){return c.jsx(gpt.Provider,{value:{approveToolcall:t,declineToolcall:r,approveToolcallGenerate:n,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:l,networkToolCallApprovals:u},children:e})}function gJr(){const e=E.useContext(gpt);if(!e)throw new Error("useToolCall must be used within a ToolCallProvider");return e}const ij=({toolCalled:e,toolCallId:t,toolApprovalMetadata:r,toolName:n,isNetwork:s,isGenerateMode:a})=>{const{approveToolcall:i,declineToolcall:o,approveToolcallGenerate:l,declineToolcallGenerate:u,isRunning:d,toolCallApprovals:p,approveNetworkToolcall:f,declineNetworkToolcall:h,networkToolCallApprovals:m}=gJr(),y=()=>{s?f(n,r?.runId):a?l(t):i(t)},b=()=>{s?h(n,r?.runId):a?u(t):o(t)},v=s?m?.[r?.runId?`${r.runId}-${n}`:n]?.status:p?.[t]?.status;return r&&!e?c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Approval required"}),c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsxs(ye,{onClick:y,disabled:d||!!v,className:v==="approved"?"!text-accent1":"",children:[c.jsx(ve,{children:c.jsx(ya,{})}),"Approve"]}),c.jsxs(ye,{onClick:b,disabled:d||!!v,className:v==="declined"?"!text-accent2":"",children:[c.jsx(ve,{children:c.jsx(Os,{})}),"Decline"]})]})]}):null},yJr=({toolName:e,args:t,result:r,metadata:n,toolOutput:s,toolCallId:a,toolApprovalMetadata:i,suspendPayload:o,isNetwork:l,toolCalled:u})=>{let d=null;try{const{__mastraMetadata:b,...v}=typeof t=="object"?t:JSON.parse(t);d=c.jsx(Wa,{data:v,"data-testid":"tool-args"})}catch{d=c.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:t})}let p=typeof r=="string"?c.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:r}):c.jsx(Wa,{data:r,"data-testid":"tool-result"}),f=typeof o=="string"?c.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:o}):c.jsx(Wa,{data:o,"data-testid":"tool-suspend-payload"});const h=n?.mode==="network"?n.selectionReason:void 0,m=n?.mode==="network"?n.agentInput:void 0,y=u??(r||s.length>0);return c.jsx(V6,{"data-testid":"tool-badge",icon:c.jsx(tl,{className:"text-accent6"}),title:e,extraInfo:n?.mode==="network"&&c.jsx(Fpe,{selectionReason:h||"",input:m}),initialCollapsed:!(i??o),children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Tool arguments"}),d]}),f!==void 0&&o&&c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Tool suspend payload"}),f]}),p!==void 0&&r&&c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Tool result"}),p]}),s.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Tool output"}),c.jsx("div",{className:"h-40 overflow-y-auto",children:c.jsx(Wa,{data:s,"data-testid":"tool-output"})})]}),c.jsx(ij,{toolCalled:y,toolCallId:a,toolApprovalMetadata:i,toolName:e,isNetwork:l,isGenerateMode:n?.mode==="generate"})]})})},ypt=E.createContext({Link:E.forwardRef(()=>null),navigate:()=>{},paths:{agentLink:()=>"",agentsLink:()=>"",agentToolLink:()=>"",agentSkillLink:()=>"",agentThreadLink:()=>"",agentNewThreadLink:()=>"",workflowsLink:()=>"",workflowLink:()=>"",networkLink:()=>"",networkNewThreadLink:()=>"",networkThreadLink:()=>"",scorerLink:()=>"",cmsScorersCreateLink:()=>"",cmsScorerEditLink:()=>"",cmsAgentCreateLink:()=>"",cmsAgentEditLink:()=>"",promptBlockLink:()=>"",promptBlocksLink:()=>"",cmsPromptBlockCreateLink:()=>"",cmsPromptBlockEditLink:()=>"",toolLink:()=>"",skillLink:()=>"",workspacesLink:()=>"",workspaceLink:()=>"",workspaceSkillLink:()=>"",processorsLink:()=>"",processorLink:()=>"",mcpServerLink:()=>"",mcpServerToolLink:()=>"",workflowRunLink:()=>"",datasetLink:()=>"",datasetItemLink:()=>"",datasetExperimentLink:()=>""}}),bJr=({children:e,Link:t,navigate:r,paths:n})=>c.jsx(ypt.Provider,{value:{Link:t,navigate:r,paths:n},children:e}),Yt=()=>{const e=E.useContext(ypt);if(!e)throw new Error("useLinkComponent must be used within a LinkComponentProvider");return e},vJr=e=>{switch(e){case"running":return"bg-green-500";case"starting":case"initializing":return"bg-yellow-500";case"stopped":case"paused":return"bg-gray-500";case"error":case"failed":return"bg-red-500";default:return"bg-accent6"}},xJr=(e,t)=>{const[r,n]=E.useState(0),s=E.useRef(null);return E.useEffect(()=>{if(e){n(0),s.current=t||Date.now();const a=setInterval(()=>{s.current&&n(Date.now()-s.current)},100);return()=>clearInterval(a)}else s.current=null},[e,t]),r},SJr=({command:e,content:t,maxHeight:r="20rem",onCopy:n,isCopied:s})=>{const a=E.useRef(null);return E.useEffect(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},[t]),c.jsxs("div",{className:"rounded-md border border-border1 overflow-hidden",children:[e&&c.jsxs("div",{className:"px-3 py-2 bg-surface3 border-b border-border1 flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("span",{className:"text-neutral6 text-xs shrink-0",children:"$"}),c.jsx("code",{className:"text-xs text-neutral-300 font-mono truncate",children:e})]}),n&&c.jsx(oa,{variant:"light",size:"sm",tooltip:"Copy output",onClick:n,className:"shrink-0",children:c.jsxs("span",{className:"grid",children:[c.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",s?"scale-100":"scale-0"),children:c.jsx(ya,{size:14})}),c.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",s?"scale-0":"scale-100"),children:c.jsx(Ql,{size:14})})]})})]}),c.jsx("pre",{ref:a,style:{maxHeight:r},className:"overflow-x-auto overflow-y-auto p-3 text-sm text-neutral-300 font-mono whitespace-pre-wrap bg-black",children:t||c.jsx("span",{className:"text-neutral6 italic",children:"No output"})})]})},wJr=({toolName:e,args:t,result:r,metadata:n,toolCallId:s,toolApprovalMetadata:a,isNetwork:i,toolCalled:o})=>{const l=jn(Z=>Z.message),u=E.useMemo(()=>l.content.filter($=>$.type==="data"),[l.content]),[d,p]=E.useState(!1),{isCopied:f,copyToClipboard:h}=z6(),{Link:m}=Yt(),y=u.find(Z=>Z.name==="sandbox-command"&&Z.data?.toolCallId===s);let b="";try{const Z=typeof t=="object"?t:JSON.parse(t);e===Ch.SANDBOX.EXECUTE_COMMAND?b=Z.command||"":(e===Ch.SANDBOX.GET_PROCESS_OUTPUT||e===Ch.SANDBOX.KILL_PROCESS)&&(b=y?.data?.command||`PID ${Z.pid}`)}catch{b=e}const v=u.filter(Z=>(Z.name==="sandbox-stdout"||Z.name==="sandbox-stderr")&&Z.data?.toolCallId===s),S=u.find(Z=>Z.name==="workspace-metadata"&&Z.data?.toolCallId===s),w=S?.data,k=u.find(Z=>Z.name==="sandbox-exit"&&Z.data?.toolCallId===s),_=!!k||typeof r=="string",C=!!S,T=C&&!_,A=o??(_||C),N=k?.data?.exitCode,j=k?.data?.success,R=k?.data?.executionTimeMs,L=k?.data?.killed,F=v.map(Z=>Z.data?.output||"").join(""),M=typeof r=="string"?r:F,z=e===Ch.SANDBOX.EXECUTE_COMMAND?"Execute Command":e===Ch.SANDBOX.GET_PROCESS_OUTPUT?"Get Process Output":e===Ch.SANDBOX.KILL_PROCESS?"Kill Process":e,q=v[0]?.data?.timestamp,Q=xJr(T,q),V=()=>{!M||f||h(M)};return c.jsxs("div",{className:"mb-4","data-testid":"sandbox-execution-badge",children:[c.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[c.jsxs("button",{onClick:()=>p(Z=>!Z),className:"flex items-center gap-2 min-w-0",type:"button",children:[c.jsx(ve,{children:c.jsx(N1,{className:K("transition-all",d?"rotate-90":"rotate-180")})}),c.jsx(Ft,{icon:c.jsx(LIt,{className:"text-accent6",size:16}),children:z}),w?.sandbox&&c.jsxs(m,{href:w.id?`/workspaces/${w.id}`:"/workspaces",className:"flex items-center gap-1.5 text-xs text-neutral6 px-1.5 py-0.5 rounded bg-surface3 border border-border1 hover:bg-surface4 hover:border-border2 transition-colors",onClick:Z=>Z.stopPropagation(),children:[c.jsx("span",{className:K("w-1.5 h-1.5 rounded-full",vJr(w.sandbox.status))}),c.jsx("span",{children:w.sandbox.name||w.sandbox.provider})]})]}),c.jsx("div",{className:"flex items-center gap-2",children:T?c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-accent6",children:[c.jsx("span",{className:"w-1.5 h-1.5 bg-accent6 rounded-full animate-pulse"}),c.jsx("span",{className:"animate-pulse",children:"running"})]}),c.jsxs("span",{className:"text-neutral6 text-xs tabular-nums",children:[Q,"ms"]})]}):c.jsxs(c.Fragment,{children:[N!==void 0&&(j?c.jsx(ya,{className:"text-green-400",size:14}):L?c.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-orange-500/20 text-orange-400",children:"killed"}):c.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-500/20 text-red-400",children:["exit ",N]})),R!==void 0&&c.jsxs("span",{className:"text-neutral6 text-xs",children:[R,"ms"]})]})})]}),!d&&c.jsxs("div",{className:"pt-2",children:[(M||b)&&c.jsx(SJr,{command:b,content:M,onCopy:M?V:void 0,isCopied:f}),c.jsx(ij,{toolCalled:A,toolCallId:s,toolApprovalMetadata:a,toolName:e,isNetwork:i,isGenerateMode:n?.mode==="generate"})]})]})},EJr=({toolName:e,args:t,result:r,toolCallId:n,toolApprovalMetadata:s,isNetwork:a,toolCalled:i})=>{const[o,l]=E.useState(!s),{isCopied:u,copyToClipboard:d}=z6();E.useEffect(()=>{l(!s)},[s]);const{Link:p}=Yt();let f={path:"/"};try{f=typeof t=="object"?t:JSON.parse(t)}catch{}const{path:h="/",maxDepth:m,showHidden:y,dirsOnly:b,exclude:v,extension:S}=f,w=[];m!==void 0&&m!==3&&w.push(`depth: ${m}`),y&&w.push("hidden"),b&&w.push("dirs only"),v&&w.push(`exclude: ${v}`),S&&w.push(`ext: ${S}`);let k="",_="";if(typeof r=="string"&&r){const L=r.lastIndexOf(`
|
|
567
|
+
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!a&&!!n.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=v,u.ParserHandle=y,u.NetworkStreamer=p,u.FileStreamer=f,u.StringStreamer=h,u.ReadableStreamStreamer=m,n.jQuery&&((s=n.jQuery).fn.parse=function(A){var N=A.config||{},j=[];return this.each(function(F){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&n.FileReader)||!this.files||this.files.length===0)return!0;for(var M=0;M<this.files.length;M++)j.push({file:this.files[M],inputElem:this,instanceConfig:s.extend({},N)})}),R(),this;function R(){if(j.length===0)T(A.complete)&&A.complete();else{var F,M,z,q,Q=j[0];if(T(A.before)){var V=A.before(Q.file,Q.inputElem);if(typeof V=="object"){if(V.action==="abort")return F="AbortError",M=Q.file,z=Q.inputElem,q=V.reason,void(T(A.error)&&A.error({name:F},M,z,q));if(V.action==="skip")return void L();typeof V.config=="object"&&(Q.instanceConfig=s.extend(Q.instanceConfig,V.config))}else if(V==="skip")return void L()}var Z=Q.instanceConfig.complete;Q.instanceConfig.complete=function($){T(Z)&&Z($,Q.file,Q.inputElem),L()},u.parse(Q.file,Q.instanceConfig)}}function L(){j.splice(0,1),R()}}),i&&(n.onmessage=function(A){A=A.data,u.WORKER_ID===void 0&&A&&(u.WORKER_ID=A.workerId),typeof A.input=="string"?n.postMessage({workerId:u.WORKER_ID,results:u.parse(A.input,A.config),finished:!0}):(n.File&&A.input instanceof File||A.input instanceof Object)&&(A=u.parse(A.input,A.config))&&n.postMessage({workerId:u.WORKER_ID,results:A,finished:!0})}),(p.prototype=Object.create(d.prototype)).constructor=p,(f.prototype=Object.create(d.prototype)).constructor=f,(h.prototype=Object.create(h.prototype)).constructor=h,(m.prototype=Object.create(d.prototype)).constructor=m,u})})(B$)),B$.exports}var zXr=BXr();const Sdt=Td(zXr);var sPe=1,UXr=.9,VXr=.8,qXr=.17,vY=.1,xY=.999,HXr=.9999,QXr=.99,GXr=/[\\\/_+.#"@\[\(\{&]/,ZXr=/[\\\/_+.#"@\[\(\{&]/g,WXr=/[\s-]/,wdt=/[\s-]/g;function wre(e,t,r,n,s,a,i){if(a===t.length)return s===e.length?sPe:QXr;var o=`${s},${a}`;if(i[o]!==void 0)return i[o];for(var l=n.charAt(a),u=r.indexOf(l,s),d=0,p,f,h,m;u>=0;)p=wre(e,t,r,n,u+1,a+1,i),p>d&&(u===s?p*=sPe:GXr.test(e.charAt(u-1))?(p*=VXr,h=e.slice(s,u-1).match(ZXr),h&&s>0&&(p*=Math.pow(xY,h.length))):WXr.test(e.charAt(u-1))?(p*=UXr,m=e.slice(s,u-1).match(wdt),m&&s>0&&(p*=Math.pow(xY,m.length))):(p*=qXr,s>0&&(p*=Math.pow(xY,u-s))),e.charAt(u)!==t.charAt(a)&&(p*=HXr)),(p<vY&&r.charAt(u-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(u-1)!==n.charAt(a))&&(f=wre(e,t,r,n,u+1,a+2,i),f*vY>p&&(p=f*vY)),p>d&&(d=p),u=r.indexOf(l,u+1);return i[o]=d,d}function aPe(e){return e.toLowerCase().replace(wdt," ")}function XXr(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,wre(e,t,aPe(e),aPe(t),0,0,{})}var uC='[cmdk-group=""]',SY='[cmdk-group-items=""]',YXr='[cmdk-group-heading=""]',Edt='[cmdk-item=""]',iPe=`${Edt}:not([aria-disabled="true"])`,Ere="cmdk-item-select",ww="data-value",KXr=(e,t,r)=>XXr(e,t,r),kdt=E.createContext(void 0),sj=()=>E.useContext(kdt),Odt=E.createContext(void 0),Ape=()=>E.useContext(Odt),_dt=E.createContext(void 0),Cdt=E.forwardRef((e,t)=>{let r=Ew(()=>{var U,I;return{search:"",value:(I=(U=e.value)!=null?U:e.defaultValue)!=null?I:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=Ew(()=>new Set),s=Ew(()=>new Map),a=Ew(()=>new Map),i=Ew(()=>new Set),o=Tdt(e),{label:l,children:u,value:d,onValueChange:p,filter:f,shouldFilter:h,loop:m,disablePointerSelection:y=!1,vimBindings:b=!0,...v}=e,S=Wi(),w=Wi(),k=Wi(),_=E.useRef(null),C=cYr();b1(()=>{if(d!==void 0){let U=d.trim();r.current.value=U,T.emit()}},[d]),b1(()=>{C(6,F)},[]);let T=E.useMemo(()=>({subscribe:U=>(i.current.add(U),()=>i.current.delete(U)),snapshot:()=>r.current,setState:(U,I,H)=>{var G,J,ee,te;if(!Object.is(r.current[U],I)){if(r.current[U]=I,U==="search")L(),j(),C(1,R);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(k);se?se.focus():(G=document.getElementById(S))==null||G.focus()}if(C(7,()=>{var se;r.current.selectedItemId=(se=M())==null?void 0:se.id,T.emit()}),H||C(5,F),((J=o.current)==null?void 0:J.value)!==void 0){let se=I??"";(te=(ee=o.current).onValueChange)==null||te.call(ee,se);return}}T.emit()}},emit:()=>{i.current.forEach(U=>U())}}),[]),A=E.useMemo(()=>({value:(U,I,H)=>{var G;I!==((G=a.current.get(U))==null?void 0:G.value)&&(a.current.set(U,{value:I,keywords:H}),r.current.filtered.items.set(U,N(I,H)),C(2,()=>{j(),T.emit()}))},item:(U,I)=>(n.current.add(U),I&&(s.current.has(I)?s.current.get(I).add(U):s.current.set(I,new Set([U]))),C(3,()=>{L(),j(),r.current.value||R(),T.emit()}),()=>{a.current.delete(U),n.current.delete(U),r.current.filtered.items.delete(U);let H=M();C(4,()=>{L(),H?.getAttribute("id")===U&&R(),T.emit()})}),group:U=>(s.current.has(U)||s.current.set(U,new Set),()=>{a.current.delete(U),s.current.delete(U)}),filter:()=>o.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:S,inputId:k,labelId:w,listInnerRef:_}),[]);function N(U,I){var H,G;let J=(G=(H=o.current)==null?void 0:H.filter)!=null?G:KXr;return U?J(U,r.current.search,I):0}function j(){if(!r.current.search||o.current.shouldFilter===!1)return;let U=r.current.filtered.items,I=[];r.current.filtered.groups.forEach(G=>{let J=s.current.get(G),ee=0;J.forEach(te=>{let se=U.get(te);ee=Math.max(se,ee)}),I.push([G,ee])});let H=_.current;z().sort((G,J)=>{var ee,te;let se=G.getAttribute("id"),ce=J.getAttribute("id");return((ee=U.get(ce))!=null?ee:0)-((te=U.get(se))!=null?te:0)}).forEach(G=>{let J=G.closest(SY);J?J.appendChild(G.parentElement===J?G:G.closest(`${SY} > *`)):H.appendChild(G.parentElement===H?G:G.closest(`${SY} > *`))}),I.sort((G,J)=>J[1]-G[1]).forEach(G=>{var J;let ee=(J=_.current)==null?void 0:J.querySelector(`${uC}[${ww}="${encodeURIComponent(G[0])}"]`);ee?.parentElement.appendChild(ee)})}function R(){let U=z().find(H=>H.getAttribute("aria-disabled")!=="true"),I=U?.getAttribute(ww);T.setState("value",I||void 0)}function L(){var U,I,H,G;if(!r.current.search||o.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let J=0;for(let ee of n.current){let te=(I=(U=a.current.get(ee))==null?void 0:U.value)!=null?I:"",se=(G=(H=a.current.get(ee))==null?void 0:H.keywords)!=null?G:[],ce=N(te,se);r.current.filtered.items.set(ee,ce),ce>0&&J++}for(let[ee,te]of s.current)for(let se of te)if(r.current.filtered.items.get(se)>0){r.current.filtered.groups.add(ee);break}r.current.filtered.count=J}function F(){var U,I,H;let G=M();G&&(((U=G.parentElement)==null?void 0:U.firstChild)===G&&((H=(I=G.closest(uC))==null?void 0:I.querySelector(YXr))==null||H.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function M(){var U;return(U=_.current)==null?void 0:U.querySelector(`${Edt}[aria-selected="true"]`)}function z(){var U;return Array.from(((U=_.current)==null?void 0:U.querySelectorAll(iPe))||[])}function q(U){let I=z()[U];I&&T.setState("value",I.getAttribute(ww))}function Q(U){var I;let H=M(),G=z(),J=G.findIndex(te=>te===H),ee=G[J+U];(I=o.current)!=null&&I.loop&&(ee=J+U<0?G[G.length-1]:J+U===G.length?G[0]:G[J+U]),ee&&T.setState("value",ee.getAttribute(ww))}function V(U){let I=M(),H=I?.closest(uC),G;for(;H&&!G;)H=U>0?oYr(H,uC):lYr(H,uC),G=H?.querySelector(iPe);G?T.setState("value",G.getAttribute(ww)):Q(U)}let Z=()=>q(z().length-1),$=U=>{U.preventDefault(),U.metaKey?Z():U.altKey?V(1):Q(1)},X=U=>{U.preventDefault(),U.metaKey?q(0):U.altKey?V(-1):Q(-1)};return E.createElement(rl.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:U=>{var I;(I=v.onKeyDown)==null||I.call(v,U);let H=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||H))switch(U.key){case"n":case"j":{b&&U.ctrlKey&&$(U);break}case"ArrowDown":{$(U);break}case"p":case"k":{b&&U.ctrlKey&&X(U);break}case"ArrowUp":{X(U);break}case"Home":{U.preventDefault(),q(0);break}case"End":{U.preventDefault(),Z();break}case"Enter":{U.preventDefault();let G=M();if(G){let J=new Event(Ere);G.dispatchEvent(J)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:dYr},l),B6(e,U=>E.createElement(Odt.Provider,{value:T},E.createElement(kdt.Provider,{value:A},U))))}),JXr=E.forwardRef((e,t)=>{var r,n;let s=Wi(),a=E.useRef(null),i=E.useContext(_dt),o=sj(),l=Tdt(e),u=(n=(r=l.current)==null?void 0:r.forceMount)!=null?n:i?.forceMount;b1(()=>{if(!u)return o.item(s,i?.id)},[u]);let d=Adt(s,a,[e.value,e.children,a],e.keywords),p=Ape(),f=jv(C=>C.value&&C.value===d.current),h=jv(C=>u||o.filter()===!1?!0:C.search?C.filtered.items.get(s)>0:!0);E.useEffect(()=>{let C=a.current;if(!(!C||e.disabled))return C.addEventListener(Ere,m),()=>C.removeEventListener(Ere,m)},[h,e.onSelect,e.disabled]);function m(){var C,T;y(),(T=(C=l.current).onSelect)==null||T.call(C,d.current)}function y(){p.setState("value",d.current,!0)}if(!h)return null;let{disabled:b,value:v,onSelect:S,forceMount:w,keywords:k,..._}=e;return E.createElement(rl.div,{ref:am(a,t),..._,id:s,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!f,"data-disabled":!!b,"data-selected":!!f,onPointerMove:b||o.getDisablePointerSelection()?void 0:y,onClick:b?void 0:m},e.children)}),eYr=E.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...a}=e,i=Wi(),o=E.useRef(null),l=E.useRef(null),u=Wi(),d=sj(),p=jv(h=>s||d.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);b1(()=>d.group(i),[]),Adt(i,o,[e.value,e.heading,l]);let f=E.useMemo(()=>({id:i,forceMount:s}),[s]);return E.createElement(rl.div,{ref:am(o,t),...a,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},r&&E.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),B6(e,h=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},E.createElement(_dt.Provider,{value:f},h))))}),tYr=E.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=E.useRef(null),a=jv(i=>!i.search);return!r&&!a?null:E.createElement(rl.div,{ref:am(s,t),...n,"cmdk-separator":"",role:"separator"})}),rYr=E.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,a=Ape(),i=jv(u=>u.search),o=jv(u=>u.selectedItemId),l=sj();return E.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),E.createElement(rl.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":o,id:l.inputId,type:"text",value:s?e.value:i,onChange:u=>{s||a.setState("search",u.target.value),r?.(u.target.value)}})}),nYr=E.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,a=E.useRef(null),i=E.useRef(null),o=jv(u=>u.selectedItemId),l=sj();return E.useEffect(()=>{if(i.current&&a.current){let u=i.current,d=a.current,p,f=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let h=u.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(p),f.unobserve(u)}}},[]),E.createElement(rl.div,{ref:am(a,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":n,id:l.listId},B6(e,u=>E.createElement("div",{ref:am(i,l.listInnerRef),"cmdk-list-sizer":""},u)))}),sYr=E.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:a,container:i,...o}=e;return E.createElement(JL,{open:r,onOpenChange:n},E.createElement(eF,{container:i},E.createElement(bI,{"cmdk-overlay":"",className:s}),E.createElement(vI,{"aria-label":e.label,"cmdk-dialog":"",className:a},E.createElement(Cdt,{ref:t,...o}))))}),aYr=E.forwardRef((e,t)=>jv(r=>r.filtered.count===0)?E.createElement(rl.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),iYr=E.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...a}=e;return E.createElement(rl.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},B6(e,i=>E.createElement("div",{"aria-hidden":!0},i)))}),Du=Object.assign(Cdt,{List:nYr,Item:JXr,Input:rYr,Group:eYr,Separator:tYr,Dialog:sYr,Empty:aYr,Loading:iYr});function oYr(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function lYr(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Tdt(e){let t=E.useRef(e);return b1(()=>{t.current=e}),t}var b1=typeof window>"u"?E.useEffect:E.useLayoutEffect;function Ew(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function jv(e){let t=Ape(),r=()=>e(t.snapshot());return E.useSyncExternalStore(t.subscribe,r,r)}function Adt(e,t,r,n=[]){let s=E.useRef(),a=sj();return b1(()=>{var i;let o=(()=>{var u;for(let d of r){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():s.current}})(),l=n.map(u=>u.trim());a.value(e,o,l),(i=t.current)==null||i.setAttribute(ww,o),s.current=o}),s}var cYr=()=>{let[e,t]=E.useState(),r=Ew(()=>new Map);return b1(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function uYr(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function B6({asChild:e,children:t},r){return e&&E.isValidElement(t)?E.cloneElement(uYr(t),{ref:t.ref},r(t.props.children)):r(t)}var dYr={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};class oo{constructor(t,r,n,s){this.fromA=t,this.toA=r,this.fromB=n,this.toB=s}offset(t,r=t){return new oo(this.fromA+t,this.toA+t,this.fromB+r,this.toB+r)}}function v1(e,t,r,n,s,a){if(e==n)return[];let i=Npe(e,t,r,n,s,a),o=Ipe(e,t+i,r,n,s+i,a);t+=i,r-=o,s+=i,a-=o;let l=r-t,u=a-s;if(!l||!u)return[new oo(t,r,s,a)];if(l>u){let p=e.slice(t,r).indexOf(n.slice(s,a));if(p>-1)return[new oo(t,t+p,s,s),new oo(t+p+u,r,a,a)]}else if(u>l){let p=n.slice(s,a).indexOf(e.slice(t,r));if(p>-1)return[new oo(t,t,s,s+p),new oo(r,r,s+p+l,a)]}if(l==1||u==1)return[new oo(t,r,s,a)];let d=Idt(e,t,r,n,s,a);if(d){let[p,f,h]=d;return v1(e,t,p,n,s,f).concat(v1(e,p+h,r,n,f+h,a))}return pYr(e,t,r,n,s,a)}let qC=1e9,HC=0,Dpe=!1;function pYr(e,t,r,n,s,a){let i=r-t,o=a-s;if(qC<1e9&&Math.min(i,o)>qC*16||HC>0&&Date.now()>HC)return Math.min(i,o)>qC*64?[new oo(t,r,s,a)]:oPe(e,t,r,n,s,a);let l=Math.ceil((i+o)/2);wY.reset(l),EY.reset(l);let u=(h,m)=>e.charCodeAt(t+h)==n.charCodeAt(s+m),d=(h,m)=>e.charCodeAt(r-h-1)==n.charCodeAt(a-m-1),p=(i-o)%2!=0?EY:null,f=p?null:wY;for(let h=0;h<l;h++){if(h>qC||HC>0&&!(h&63)&&Date.now()>HC)return oPe(e,t,r,n,s,a);let m=wY.advance(h,i,o,l,p,!1,u)||EY.advance(h,i,o,l,f,!0,d);if(m)return fYr(e,t,r,t+m[0],n,s,a,s+m[1])}return[new oo(t,r,s,a)]}class Ddt{constructor(){this.vec=[]}reset(t){this.len=t<<1;for(let r=0;r<this.len;r++)this.vec[r]=-1;this.vec[t+1]=0,this.start=this.end=0}advance(t,r,n,s,a,i,o){for(let l=-t+this.start;l<=t-this.end;l+=2){let u=s+l,d=l==-t||l!=t&&this.vec[u-1]<this.vec[u+1]?this.vec[u+1]:this.vec[u-1]+1,p=d-l;for(;d<r&&p<n&&o(d,p);)d++,p++;if(this.vec[u]=d,d>r)this.end+=2;else if(p>n)this.start+=2;else if(a){let f=s+(r-n)-l;if(f>=0&&f<this.len&&a.vec[f]!=-1)if(i){let h=a.vec[f];if(h>=r-d)return[h,s+h-f]}else{let h=r-a.vec[f];if(d>=h)return[d,p]}}}return null}}const wY=new Ddt,EY=new Ddt;function fYr(e,t,r,n,s,a,i,o){let l=!1;return!Pk(e,n)&&++n==r&&(l=!0),!Pk(s,o)&&++o==i&&(l=!0),l?[new oo(t,r,a,i)]:v1(e,t,n,s,a,o).concat(v1(e,n,r,s,o,i))}function Ndt(e,t){let r=1,n=Math.min(e,t);for(;r<n;)r=r<<1;return r}function Npe(e,t,r,n,s,a){if(t==r||t==a||e.charCodeAt(t)!=n.charCodeAt(s))return 0;let i=Ndt(r-t,a-s);for(let o=t,l=s;;){let u=o+i,d=l+i;if(u>r||d>a||e.slice(o,u)!=n.slice(l,d)){if(i==1)return o-t-(Pk(e,o)?0:1);i=i>>1}else{if(u==r||d==a)return u-t;o=u,l=d}}}function Ipe(e,t,r,n,s,a){if(t==r||s==a||e.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let i=Ndt(r-t,a-s);for(let o=r,l=a;;){let u=o-i,d=l-i;if(u<t||d<s||e.slice(u,o)!=n.slice(d,l)){if(i==1)return r-o-(Pk(e,o)?0:1);i=i>>1}else{if(u==t||d==s)return r-u;o=u,l=d}}}function kre(e,t,r,n,s,a,i,o){let l=n.slice(s,a),u=null;for(;;){if(u||i<o)return u;for(let d=t+i;;){Pk(e,d)||d++;let p=d+i;if(Pk(e,p)||(p+=p==d+1?1:-1),p>=r)break;let f=e.slice(d,p),h=-1;for(;(h=l.indexOf(f,h+1))!=-1;){let m=Npe(e,p,r,n,s+h+f.length,a),y=Ipe(e,t,d,n,s,s+h),b=f.length+m+y;(!u||u[2]<b)&&(u=[d-y,s+h-y,b])}d=p}if(o<0)return u;i=i>>1}}function Idt(e,t,r,n,s,a){let i=r-t,o=a-s;if(i<o){let l=Idt(n,s,a,e,t,r);return l&&[l[1],l[0],l[2]]}return i<4||o*2<i?null:kre(e,t,r,n,s,a,Math.floor(i/4),-1)}function oPe(e,t,r,n,s,a){Dpe=!0;let i=r-t,o=a-s,l;if(i<o){let f=kre(n,s,a,e,t,r,Math.floor(i/6),50);l=f&&[f[1],f[0],f[2]]}else l=kre(e,t,r,n,s,a,Math.floor(o/6),50);if(!l)return[new oo(t,r,s,a)];let[u,d,p]=l;return v1(e,t,u,n,s,d).concat(v1(e,u+p,r,n,d+p,a))}function jdt(e,t){for(let r=1;r<e.length;r++){let n=e[r-1],s=e[r];n.toA>s.fromA-t&&n.toB>s.fromB-t&&(e[r-1]=new oo(n.fromA,s.toA,n.fromB,s.toB),e.splice(r--,1))}}function hYr(e,t,r){for(;;){jdt(r,1);let n=!1;for(let s=0;s<r.length;s++){let a=r[s],i,o;(i=Npe(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=r[s]=new oo(a.fromA+i,a.toA,a.fromB+i,a.toB)),(o=Ipe(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=r[s]=new oo(a.fromA,a.toA-o,a.fromB,a.toB-o));let l=a.toA-a.fromA,u=a.toB-a.fromB;if(l&&u)continue;let d=a.fromA-(s?r[s-1].toA:0),p=(s<r.length-1?r[s+1].fromA:e.length)-a.toA;if(!d||!p)continue;let f=l?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);d<=f.length&&e.slice(a.fromA-d,a.fromA)==f.slice(f.length-d)?(r[s]=new oo(a.fromA-d,a.toA-d,a.fromB-d,a.toB-d),n=!0):p<=f.length&&e.slice(a.toA,a.toA+p)==f.slice(0,p)&&(r[s]=new oo(a.fromA+p,a.toA+p,a.fromB+p,a.toB+p),n=!0)}if(!n)break}return r}function mYr(e,t,r){for(let n=0,s=0;s<e.length;s++){let a=e[s],i=a.toA-a.fromA,o=a.toB-a.fromB;if(i&&o||i>3||o>3){let l=s==e.length-1?t.length:e[s+1].fromA,u=a.fromA-n,d=l-a.toA,p=cPe(t,a.fromA,u),f=lPe(t,a.toA,d),h=a.fromA-p,m=f-a.toA;if((!i||!o)&&h&&m){let y=Math.max(i,o),[b,v,S]=i?[t,a.fromA,a.toA]:[r,a.fromB,a.toB];y>h&&t.slice(p,a.fromA)==b.slice(S-h,S)?(a=e[s]=new oo(p,p+i,a.fromB-h,a.toB-h),p=a.fromA,f=lPe(t,a.toA,l-a.toA)):y>m&&t.slice(a.toA,f)==b.slice(v,v+m)&&(a=e[s]=new oo(f-i,f,a.fromB+m,a.toB+m),f=a.toA,p=cPe(t,a.fromA,a.fromA-n)),h=a.fromA-p,m=f-a.toA}if(h||m)a=e[s]=new oo(a.fromA-h,a.toA+m,a.fromB-h,a.toB+m);else if(i){if(!o){let y=dPe(t,a.fromA,a.toA),b,v=y<0?-1:uPe(t,a.toA,a.fromA);y>-1&&(b=y-a.fromA)<=d&&t.slice(a.fromA,y)==t.slice(a.toA,a.toA+b)?a=e[s]=a.offset(b):v>-1&&(b=a.toA-v)<=u&&t.slice(a.fromA-b,a.fromA)==t.slice(v,a.toA)&&(a=e[s]=a.offset(-b))}}else{let y=dPe(r,a.fromB,a.toB),b,v=y<0?-1:uPe(r,a.toB,a.fromB);y>-1&&(b=y-a.fromB)<=d&&r.slice(a.fromB,y)==r.slice(a.toB,a.toB+b)?a=e[s]=a.offset(b):v>-1&&(b=a.toB-v)<=u&&r.slice(a.fromB-b,a.fromB)==r.slice(v,a.toB)&&(a=e[s]=a.offset(-b))}}n=a.toA}return jdt(e,3),e}let D0;try{D0=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Rdt(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Pdt(e,t){if(t==e.length)return 0;let r=e.charCodeAt(t);return r<192?Rdt(r)?1:0:D0?!Ldt(r)||t==e.length-1?D0.test(String.fromCharCode(r))?1:0:D0.test(e.slice(t,t+2))?2:0:0}function $dt(e,t){if(!t)return 0;let r=e.charCodeAt(t-1);return r<192?Rdt(r)?1:0:D0?!Fdt(r)||t==1?D0.test(String.fromCharCode(r))?1:0:D0.test(e.slice(t-2,t))?2:0:0}const Mdt=8;function lPe(e,t,r){if(t==e.length||!$dt(e,t))return t;for(let n=t,s=t+r,a=0;a<Mdt;a++){let i=Pdt(e,n);if(!i||n+i>s)return n;n+=i}return t}function cPe(e,t,r){if(!t||!Pdt(e,t))return t;for(let n=t,s=t-r,a=0;a<Mdt;a++){let i=$dt(e,n);if(!i||n-i<s)return n;n-=i}return t}function uPe(e,t,r){for(;t!=r;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function dPe(e,t,r){for(;t!=r;t++)if(e.charCodeAt(t)==10)return t;return-1}const Ldt=e=>e>=55296&&e<=56319,Fdt=e=>e>=56320&&e<=57343;function Pk(e,t){return!t||t==e.length||!Ldt(e.charCodeAt(t-1))||!Fdt(e.charCodeAt(t))}function gYr(e,t,r){var n;let s=r?.override;return s?s(e,t):(qC=((n=r?.scanLimit)!==null&&n!==void 0?n:1e9)>>1,HC=r?.timeout?Date.now()+r.timeout:0,Dpe=!1,hYr(e,t,v1(e,0,e.length,t,0,t.length)))}function Bdt(){return!Dpe}function zdt(e,t,r){return mYr(gYr(e,t,r),e,t)}const Ph=Xt.define({combine:e=>e[0]}),Ore=en.define(),yYr=Xt.define(),$k=Ki.define({create(e){return null},update(e,t){for(let r of t.effects)r.is(Ore)&&(e=r.value);for(let r of t.state.facet(yYr))e=r(e,t);return e}});class xE{constructor(t,r,n,s,a,i=!0){this.changes=t,this.fromA=r,this.toA=n,this.fromB=s,this.toB=a,this.precise=i}offset(t,r){return t||r?new xE(this.changes,this.fromA+t,this.toA+t,this.fromB+r,this.toB+r,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(t,r,n){let s=zdt(t.toString(),r.toString(),n);return Udt(s,t,r,0,0,Bdt())}static updateA(t,r,n,s,a){return gPe(mPe(t,s,!0,n.length),t,r,n,a)}static updateB(t,r,n,s,a){return gPe(mPe(t,s,!1,r.length),t,r,n,a)}}function pPe(e,t,r,n){let s=r.lineAt(e),a=n.lineAt(t);return s.to==e&&a.to==t&&e<r.length&&t<n.length?[e+1,t+1]:[s.from,a.from]}function fPe(e,t,r,n){let s=r.lineAt(e),a=n.lineAt(t);return s.from==e&&a.from==t?[e,t]:[s.to+1,a.to+1]}function Udt(e,t,r,n,s,a){let i=[];for(let o=0;o<e.length;o++){let l=e[o],[u,d]=pPe(l.fromA+n,l.fromB+s,t,r),[p,f]=fPe(l.toA+n,l.toB+s,t,r),h=[l.offset(-u+n,-d+s)];for(;o<e.length-1;){let m=e[o+1],[y,b]=pPe(m.fromA+n,m.fromB+s,t,r);if(y>p+1&&b>f+1)break;h.push(m.offset(-u+n,-d+s)),[p,f]=fPe(m.toA+n,m.toB+s,t,r),o++}i.push(new xE(h,u,Math.max(u,p),d,Math.max(d,f),a))}return i}const vP=1e3;function hPe(e,t,r,n){let s=0,a=e.length;for(;;){if(s==a){let d=0,p=0;s&&({toA:d,toB:p}=e[s-1]);let f=t-(r?d:p);return[d+f,p+f]}let i=s+a>>1,o=e[i],[l,u]=r?[o.fromA,o.toA]:[o.fromB,o.toB];if(l>t)a=i;else if(u<=t)s=i+1;else return n?[o.fromA,o.fromB]:[o.toA,o.toB]}}function mPe(e,t,r,n){let s=[];return t.iterChangedRanges((a,i,o,l)=>{let u=0,d=r?t.length:n,p=0,f=r?n:t.length;a>vP&&([u,p]=hPe(e,a-vP,r,!0)),i<t.length-vP&&([d,f]=hPe(e,i+vP,r,!1));let h=l-o-(i-a),m,[y,b]=r?[h,0]:[0,h];s.length&&(m=s[s.length-1]).toA>=u?s[s.length-1]={fromA:m.fromA,fromB:m.fromB,toA:d,toB:f,diffA:m.diffA+y,diffB:m.diffB+b}:s.push({fromA:u,toA:d,fromB:p,toB:f,diffA:y,diffB:b})}),s}function gPe(e,t,r,n,s){if(!e.length)return t;let a=[];for(let i=0,o=0,l=0,u=0;;i++){let d=i==e.length?null:e[i],p=d?d.fromA+o:r.length,f=d?d.fromB+l:n.length;for(;u<t.length;){let b=t[u];if(b.endA+o>p||b.endB+l>f)break;a.push(b.offset(o,l)),u++}if(!d)break;let h=d.toA+o+d.diffA,m=d.toB+l+d.diffB,y=zdt(r.sliceString(p,h),n.sliceString(f,m),s);for(let b of Udt(y,r,n,p,f,Bdt()))a.push(b);for(o+=d.diffA,l+=d.diffB;u<t.length;){let b=t[u];if(b.fromA+o>h&&b.fromB+l>m)break;u++}}return a}const bYr={scanLimit:500},Vdt=xi.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=vPe(e))}update(e){(e.docChanged||e.viewportChanged||vYr(e.startState,e.state)||xYr(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=vPe(e.view))}},{decorations:e=>e.deco}),xP=Wf.low(Dqe({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(Vdt))===null||t===void 0?void 0:t.gutter)||Yn.empty}}));function vYr(e,t){return e.field($k,!1)!=t.field($k,!1)}function xYr(e,t){return e.facet(Ph)!=t.facet(Ph)}const yPe=rr.line({class:"cm-changedLine"}),SYr=rr.mark({class:"cm-changedText"}),wYr=rr.mark({tagName:"ins",class:"cm-insertedLine"}),EYr=rr.mark({tagName:"del",class:"cm-deletedLine"}),bPe=new class extends cm{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function kYr(e,t,r,n,s,a){let i=r?e.fromA:e.fromB,o=r?e.toA:e.toB,l=0;if(i!=o){s.add(i,i,yPe),s.add(i,o,r?EYr:wYr),a&&a.add(i,i,bPe);for(let u=t.iterRange(i,o-1),d=i;!u.next().done;){if(u.lineBreak){d++,s.add(d,d,yPe),a&&a.add(d,d,bPe);continue}let p=d+u.value.length;if(n)for(;l<e.changes.length;){let f=e.changes[l],h=i+(r?f.fromA:f.fromB),m=i+(r?f.toA:f.toB),y=Math.max(d,h),b=Math.min(p,m);if(y<b&&s.add(y,b,SYr),m<p)l++;else break}d=p}}}function vPe(e){let t=e.state.field($k),{side:r,highlightChanges:n,markGutter:s,overrideChunk:a}=e.state.facet(Ph),i=r=="a",o=new yu,l=s?new yu:null,{from:u,to:d}=e.viewport;for(let p of t){if((i?p.fromA:p.fromB)>=d)break;(i?p.toA:p.toB)>u&&(!a||!a(e.state,p,o,l))&&kYr(p,e.state.doc,i,n,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}class SP extends Rd{constructor(t){super(),this.height=t}eq(t){return this.height==t.height}toDOM(){let t=document.createElement("div");return t.className="cm-mergeSpacer",t.style.height=this.height+"px",t}updateDOM(t){return t.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const E4=en.define({map:(e,t)=>e.map(t)}),QC=Ki.define({create:()=>rr.none,update:(e,t)=>{for(let r of t.effects)if(r.is(E4))return r.value;return e.map(t.changes)},provide:e=>mt.decorations.from(e)}),wP=.01;function xPe(e,t){if(e.size!=t.size)return!1;let r=e.iter(),n=t.iter();for(;r.value;){if(r.from!=n.from||Math.abs(r.value.spec.widget.height-n.value.spec.widget.height)>1)return!1;r.next(),n.next()}return!0}function OYr(e,t,r){let n=new yu,s=new yu,a=e.state.field(QC).iter(),i=t.state.field(QC).iter(),o=0,l=0,u=0,d=0,p=e.viewport,f=t.viewport;for(let b=0;;b++){let v=b<r.length?r[b]:null,S=v?v.fromA:e.state.doc.length,w=v?v.fromB:t.state.doc.length;if(o<S){let k=e.lineBlockAt(o).top+u,_=t.lineBlockAt(l).top+d,C=k-_;C<-wP?(u-=C,n.add(o,o,rr.widget({widget:new SP(-C),block:!0,side:-1}))):C>wP&&(d+=C,s.add(l,l,rr.widget({widget:new SP(C),block:!0,side:-1})))}if(S>o+1e3&&o<p.from&&S>p.from&&l<f.from&&w>f.from){let k=Math.min(p.from-o,f.from-l);o+=k,l+=k,b--}else if(v)o=v.toA,l=v.toB;else break;for(;a.value&&a.from<o;)u-=a.value.spec.widget.height,a.next();for(;i.value&&i.from<l;)d-=i.value.spec.widget.height,i.next()}for(;a.value;)u-=a.value.spec.widget.height,a.next();for(;i.value;)d-=i.value.spec.widget.height,i.next();let h=e.contentHeight+u-(t.contentHeight+d);h<wP?n.add(e.state.doc.length,e.state.doc.length,rr.widget({widget:new SP(-h),block:!0,side:1})):h>wP&&s.add(t.state.doc.length,t.state.doc.length,rr.widget({widget:new SP(h),block:!0,side:1}));let m=n.finish(),y=s.finish();xPe(m,e.state.field(QC))||e.dispatch({effects:E4.of(m)}),xPe(y,t.state.field(QC))||t.dispatch({effects:E4.of(y)})}const _re=en.define({map:(e,t)=>t.mapPos(e)});class _Yr extends Rd{constructor(t){super(),this.lines=t}eq(t){return this.lines==t.lines}toDOM(t){let r=document.createElement("div");return r.className="cm-collapsedLines",r.textContent=t.state.phrase("$ unchanged lines",this.lines),r.addEventListener("click",n=>{let s=t.posAtDOM(n.target);t.dispatch({effects:_re.of(s)});let{side:a,sibling:i}=t.state.facet(Ph);i&&i().dispatch({effects:_re.of(CYr(s,t.state.field($k),a=="a"))})}),r}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function CYr(e,t,r){let n=0,s=0;for(let a=0;;a++){let i=a<t.length?t[a]:null;if(!i||(r?i.fromA:i.fromB)>=e)return s+(e-n);[n,s]=r?[i.toA,i.toB]:[i.toB,i.toA]}}const TYr=Ki.define({create(e){return rr.none},update(e,t){e=e.map(t.changes);for(let r of t.effects)r.is(_re)&&(e=e.update({filter:n=>n!=r.value}));return e},provide:e=>mt.decorations.from(e)});function SPe({margin:e=3,minSize:t=4}){return TYr.init(r=>AYr(r,e,t))}function AYr(e,t,r){let n=new yu,s=e.facet(Ph).side=="a",a=e.field($k),i=1;for(let o=0;;o++){let l=o<a.length?a[o]:null,u=o?i+t:1,d=l?e.doc.lineAt(s?l.fromA:l.fromB).number-1-t:e.doc.lines,p=d-u+1;if(p>=r&&n.add(e.doc.line(u).from,e.doc.line(d).to,rr.replace({widget:new _Yr(p),block:!0})),!l)break;i=e.doc.lineAt(Math.min(e.doc.length,s?l.toA:l.toB)).number}return n.finish()}const DYr=mt.styleModule.of(new Zg({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),NYr=mt.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),wPe=new tO,EP=new tO;class IYr{constructor(t){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=t.diffConfig||bYr;let r=[Wf.low(Vdt),NYr,DYr,QC,mt.updateListener.of(p=>{this.measuring<0&&(p.heightChanged||p.viewportChanged)&&!p.transactions.some(f=>f.effects.some(h=>h.is(E4)))&&this.measure()})],n=[Ph.of({side:"a",sibling:()=>this.b,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&n.push(xP);let s=Zn.create({doc:t.a.doc,selection:t.a.selection,extensions:[t.a.extensions||[],mt.editorAttributes.of({class:"cm-merge-a"}),EP.of(n),r]}),a=[Ph.of({side:"b",sibling:()=>this.a,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&a.push(xP);let i=Zn.create({doc:t.b.doc,selection:t.b.selection,extensions:[t.b.extensions||[],mt.editorAttributes.of({class:"cm-merge-b"}),EP.of(a),r]});this.chunks=xE.build(s.doc,i.doc,this.diffConf);let o=[$k.init(()=>this.chunks),wPe.of(t.collapseUnchanged?SPe(t.collapseUnchanged):[])];s=s.update({effects:en.appendConfig.of(o)}).state,i=i.update({effects:en.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let l=t.orientation||"a-b",u=document.createElement("div");u.className="cm-mergeViewEditor";let d=document.createElement("div");d.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?u:d),this.editorDOM.appendChild(l=="a-b"?d:u),this.a=new mt({state:s,parent:u,root:t.root,dispatchTransactions:p=>this.dispatch(p,this.a)}),this.b=new mt({state:i,parent:d,root:t.root,dispatchTransactions:p=>this.dispatch(p,this.b)}),this.setupRevertControls(!!t.revertControls,t.revertControls=="b-to-a",t.renderRevertControl),t.parent&&t.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(t,r){if(t.some(n=>n.docChanged)){let n=t[t.length-1],s=t.reduce((i,o)=>i.compose(o.changes),ao.empty(t[0].startState.doc.length));this.chunks=r==this.a?xE.updateA(this.chunks,n.newDoc,this.b.state.doc,s,this.diffConf):xE.updateB(this.chunks,this.a.state.doc,n.newDoc,s,this.diffConf),r.update([...t,n.state.update({effects:Ore.of(this.chunks)})]);let a=r==this.a?this.b:this.a;a.update([a.state.update({effects:Ore.of(this.chunks)})]),this.scheduleMeasure()}else r.update(t)}reconfigure(t){if("diffConfig"in t&&(this.diffConf=t.diffConfig),"orientation"in t){let a=t.orientation!="b-a";if(a!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let i=this.a.dom.parentNode,o=this.b.dom.parentNode;i.remove(),o.remove(),this.editorDOM.insertBefore(a?i:o,this.editorDOM.firstChild),this.editorDOM.appendChild(a?o:i),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in t||"renderRevertControl"in t){let a=!!this.revertDOM,i=this.revertToA,o=this.renderRevert;"revertControls"in t&&(a=!!t.revertControls,i=t.revertControls=="b-to-a"),"renderRevertControl"in t&&(o=t.renderRevertControl),this.setupRevertControls(a,i,o)}let r="highlightChanges"in t,n="gutter"in t,s="collapseUnchanged"in t;if(r||n||s){let a=[],i=[];if(r||n){let o=this.a.state.facet(Ph),l=n?t.gutter!==!1:o.markGutter,u=r?t.highlightChanges!==!1:o.highlightChanges;a.push(EP.reconfigure([Ph.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:l}),l?xP:[]])),i.push(EP.reconfigure([Ph.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:l}),l?xP:[]]))}if(s){let o=wPe.reconfigure(t.collapseUnchanged?SPe(t.collapseUnchanged):[]);a.push(o),i.push(o)}this.a.dispatch({effects:a}),this.b.dispatch({effects:i})}this.scheduleMeasure()}setupRevertControls(t,r,n){this.revertToA=r,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!t&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):t&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",s=>this.revertClicked(s)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let t=this.dom.ownerDocument.defaultView||window;this.measuring=t.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){OYr(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let t=this.revertDOM,r=t.firstChild,n=this.a.viewport,s=this.b.viewport;for(let a=0;a<this.chunks.length;a++){let i=this.chunks[a];if(i.fromA>n.to||i.fromB>s.to)break;if(i.fromA<n.from||i.fromB<s.from)continue;let o=this.a.lineBlockAt(i.fromA).top+"px";for(;r&&+r.dataset.chunk<a;)r=EPe(r);r&&r.dataset.chunk==String(a)?(r.style.top!=o&&(r.style.top=o),r=r.nextSibling):t.insertBefore(this.renderRevertButton(o,a),r)}for(;r;)r=EPe(r)}renderRevertButton(t,r){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement("button");let s=this.a.state.phrase("Revert this chunk");n.setAttribute("aria-label",s),n.setAttribute("title",s),n.textContent=this.revertToLeft?"⇜":"⇝"}return n.style.top=t,n.setAttribute("data-chunk",String(r)),n}revertClicked(t){let r=t.target,n;for(;r&&r.parentNode!=this.revertDOM;)r=r.parentNode;if(r&&(n=this.chunks[r.dataset.chunk])){let[s,a,i,o,l,u]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],d=s.state.sliceDoc(i,Math.max(i,o-1));i!=o&&u<=a.state.doc.length&&(d+=s.state.lineBreak),a.dispatch({changes:{from:l,to:Math.min(a.state.doc.length,u),insert:d},userEvent:"revert"}),t.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function EPe(e){let t=e.nextSibling;return e.remove(),t}function qdt(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=qdt(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Hdt(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=qdt(e))&&(n&&(n+=" "),n+=t);return n}const jYr=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},RYr=(e,t)=>({classGroupId:e,validator:t}),Qdt=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),k4="-",kPe=[],PYr="arbitrary..",$Yr=e=>{const t=LYr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return MYr(i);const o=i.split(k4),l=o[0]===""&&o.length>1?1:0;return Gdt(o,l,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const l=n[i],u=r[i];return l?u?jYr(u,l):l:u||kPe}return r[i]||kPe}}},Gdt=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=Gdt(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const o=t===0?e.join(k4):e.slice(t).join(k4),l=i.length;for(let u=0;u<l;u++){const d=i[u];if(d.validator(o))return d.classGroupId}},MYr=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?PYr+n:void 0})(),LYr=e=>{const{theme:t,classGroups:r}=e;return FYr(r,t)},FYr=(e,t)=>{const r=Qdt();for(const n in e){const s=e[n];jpe(s,r,n,t)}return r},jpe=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];BYr(i,t,r,n)}},BYr=(e,t,r,n)=>{if(typeof e=="string"){zYr(e,t,r);return}if(typeof e=="function"){UYr(e,t,r,n);return}VYr(e,t,r,n)},zYr=(e,t,r)=>{const n=e===""?t:Zdt(t,e);n.classGroupId=r},UYr=(e,t,r,n)=>{if(qYr(e)){jpe(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(RYr(r,e))},VYr=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[o,l]=s[i];jpe(l,Zdt(t,o),r,n)}},Zdt=(e,t)=>{let r=e;const n=t.split(k4),s=n.length;for(let a=0;a<s;a++){const i=n[a];let o=r.nextPart.get(i);o||(o=Qdt(),r.nextPart.set(i,o)),r=o}return r},qYr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,HYr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=n[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},Cre="!",OPe=":",QYr=[],_Pe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),GYr=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,o=0,l=0,u;const d=s.length;for(let y=0;y<d;y++){const b=s[y];if(i===0&&o===0){if(b===OPe){a.push(s.slice(l,y)),l=y+1;continue}if(b==="/"){u=y;continue}}b==="["?i++:b==="]"?i--:b==="("?o++:b===")"&&o--}const p=a.length===0?s:s.slice(l);let f=p,h=!1;p.endsWith(Cre)?(f=p.slice(0,-1),h=!0):p.startsWith(Cre)&&(f=p.slice(1),h=!0);const m=u&&u>l?u-l:void 0;return _Pe(a,h,f,m)};if(t){const s=t+OPe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):_Pe(QYr,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},ZYr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],o=i[0]==="[",l=t.has(i);o||l?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},WYr=e=>({cache:HYr(e.cacheSize),parseClassName:GYr(e),sortModifiers:ZYr(e),...$Yr(e)}),XYr=/\s+/,YYr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],o=e.trim().split(XYr);let l="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{isExternal:p,modifiers:f,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:y}=r(d);if(p){l=d+(l.length>0?" "+l:l);continue}let b=!!y,v=n(b?m.substring(0,y):m);if(!v){if(!b){l=d+(l.length>0?" "+l:l);continue}if(v=n(m),!v){l=d+(l.length>0?" "+l:l);continue}b=!1}const S=f.length===0?"":f.length===1?f[0]:a(f).join(":"),w=h?S+Cre:S,k=w+v;if(i.indexOf(k)>-1)continue;i.push(k);const _=s(v,b);for(let C=0;C<_.length;++C){const T=_[C];i.push(w+T)}l=d+(l.length>0?" "+l:l)}return l},KYr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=Wdt(r))&&(s&&(s+=" "),s+=n);return s},Wdt=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Wdt(e[n]))&&(r&&(r+=" "),r+=t);return r},CPe=(e,...t)=>{let r,n,s,a;const i=l=>{const u=t.reduce((d,p)=>p(d),e());return r=WYr(u),n=r.cache.get,s=r.cache.set,a=o,o(l)},o=l=>{const u=n(l);if(u)return u;const d=YYr(l,r);return s(l,d),d};return a=i,(...l)=>a(KYr(...l))},JYr=[],Eo=e=>{const t=r=>r[e]||JYr;return t.isThemeGetter=!0,t},Xdt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ydt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,eKr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,tKr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rKr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nKr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sKr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aKr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pb=e=>eKr.test(e),Qn=e=>!!e&&!Number.isNaN(Number(e)),fb=e=>!!e&&Number.isInteger(Number(e)),kY=e=>e.endsWith("%")&&Qn(e.slice(0,-1)),fg=e=>tKr.test(e),Kdt=()=>!0,iKr=e=>rKr.test(e)&&!nKr.test(e),Rpe=()=>!1,oKr=e=>sKr.test(e),lKr=e=>aKr.test(e),cKr=e=>!br(e)&&!wr(e),uKr=e=>nx(e,tpt,Rpe),br=e=>Xdt.test(e),Bx=e=>nx(e,rpt,iKr),TPe=e=>nx(e,bKr,Qn),dKr=e=>nx(e,spt,Kdt),pKr=e=>nx(e,npt,Rpe),APe=e=>nx(e,Jdt,Rpe),fKr=e=>nx(e,ept,lKr),kP=e=>nx(e,apt,oKr),wr=e=>Ydt.test(e),dC=e=>iS(e,rpt),hKr=e=>iS(e,npt),DPe=e=>iS(e,Jdt),mKr=e=>iS(e,tpt),gKr=e=>iS(e,ept),OP=e=>iS(e,apt,!0),yKr=e=>iS(e,spt,!0),nx=(e,t,r)=>{const n=Xdt.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},iS=(e,t,r=!1)=>{const n=Ydt.exec(e);return n?n[1]?t(n[1]):r:!1},Jdt=e=>e==="position"||e==="percentage",ept=e=>e==="image"||e==="url",tpt=e=>e==="length"||e==="size"||e==="bg-size",rpt=e=>e==="length",bKr=e=>e==="number",npt=e=>e==="family-name",spt=e=>e==="number"||e==="weight",apt=e=>e==="shadow",NPe=()=>{const e=Eo("color"),t=Eo("font"),r=Eo("text"),n=Eo("font-weight"),s=Eo("tracking"),a=Eo("leading"),i=Eo("breakpoint"),o=Eo("container"),l=Eo("spacing"),u=Eo("radius"),d=Eo("shadow"),p=Eo("inset-shadow"),f=Eo("text-shadow"),h=Eo("drop-shadow"),m=Eo("blur"),y=Eo("perspective"),b=Eo("aspect"),v=Eo("ease"),S=Eo("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...k(),wr,br],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],A=()=>[wr,br,l],N=()=>[pb,"full","auto",...A()],j=()=>[fb,"none","subgrid",wr,br],R=()=>["auto",{span:["full",fb,wr,br]},fb,wr,br],L=()=>[fb,"auto",wr,br],F=()=>["auto","min","max","fr",wr,br],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...A()],Q=()=>[pb,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],V=()=>[pb,"screen","full","dvw","lvw","svw","min","max","fit",...A()],Z=()=>[pb,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],$=()=>[e,wr,br],X=()=>[...k(),DPe,APe,{position:[wr,br]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",mKr,uKr,{size:[wr,br]}],H=()=>[kY,dC,Bx],G=()=>["","none","full",u,wr,br],J=()=>["",Qn,dC,Bx],ee=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Qn,kY,DPe,APe],ce=()=>["","none",m,wr,br],Se=()=>["none",Qn,wr,br],W=()=>["none",Qn,wr,br],ne=()=>[Qn,wr,br],ae=()=>[pb,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fg],breakpoint:[fg],color:[Kdt],container:[fg],"drop-shadow":[fg],ease:["in","out","in-out"],font:[cKr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fg],shadow:[fg],spacing:["px",Qn],text:[fg],"text-shadow":[fg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pb,br,wr,b]}],container:["container"],columns:[{columns:[Qn,br,wr,o]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[fb,"auto",wr,br]}],basis:[{basis:[pb,"full","auto",o,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qn,pb,"auto","initial","none",br]}],grow:[{grow:["",Qn,wr,br]}],shrink:[{shrink:["",Qn,wr,br]}],order:[{order:[fb,"first","last","none",wr,br]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[o,"screen",...Q()]}],"min-w":[{"min-w":[o,"screen","none",...Q()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",r,dC,Bx]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,yKr,dKr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",kY,br]}],"font-family":[{font:[hKr,pKr,t]}],"font-features":[{"font-features":[br]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,wr,br]}],"line-clamp":[{"line-clamp":[Qn,"none",wr,TPe]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",wr,br]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",wr,br]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qn,"from-font","auto",wr,Bx]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Qn,"auto",wr,br]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",wr,br]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",wr,br]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},fb,wr,br],radial:["",wr,br],conic:[fb,wr,br]},gKr,fKr]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-bs":[{"border-bs":$()}],"border-color-be":[{"border-be":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qn,wr,br]}],"outline-w":[{outline:["",Qn,dC,Bx]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",d,OP,kP]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",p,OP,kP]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Qn,Bx]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",f,OP,kP]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Qn,wr,br]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qn]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[wr,br]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Qn]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",wr,br]}],filter:[{filter:["","none",wr,br]}],blur:[{blur:ce()}],brightness:[{brightness:[Qn,wr,br]}],contrast:[{contrast:[Qn,wr,br]}],"drop-shadow":[{"drop-shadow":["","none",h,OP,kP]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Qn,wr,br]}],"hue-rotate":[{"hue-rotate":[Qn,wr,br]}],invert:[{invert:["",Qn,wr,br]}],saturate:[{saturate:[Qn,wr,br]}],sepia:[{sepia:["",Qn,wr,br]}],"backdrop-filter":[{"backdrop-filter":["","none",wr,br]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Qn,wr,br]}],"backdrop-contrast":[{"backdrop-contrast":[Qn,wr,br]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qn,wr,br]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qn,wr,br]}],"backdrop-invert":[{"backdrop-invert":["",Qn,wr,br]}],"backdrop-opacity":[{"backdrop-opacity":[Qn,wr,br]}],"backdrop-saturate":[{"backdrop-saturate":[Qn,wr,br]}],"backdrop-sepia":[{"backdrop-sepia":["",Qn,wr,br]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",wr,br]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qn,"initial",wr,br]}],ease:[{ease:["linear","initial",v,wr,br]}],delay:[{delay:[Qn,wr,br]}],animate:[{animate:["none",S,wr,br]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,wr,br]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[wr,br,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",wr,br]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",wr,br]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Qn,dC,Bx,TPe]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},vKr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(GC(e,"cacheSize",t),GC(e,"prefix",r),GC(e,"experimentalParseClassName",n),_P(e.theme,a.theme),_P(e.classGroups,a.classGroups),_P(e.conflictingClassGroups,a.conflictingClassGroups),_P(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),GC(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),CP(e.theme,s.theme),CP(e.classGroups,s.classGroups),CP(e.conflictingClassGroups,s.conflictingClassGroups),CP(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),ipt(e,s,"orderSensitiveModifiers"),e),GC=(e,t,r)=>{r!==void 0&&(e[t]=r)},_P=(e,t)=>{if(t)for(const r in t)GC(e,r,t[r])},CP=(e,t)=>{if(t)for(const r in t)ipt(e,t,r)},ipt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},xKr=(e,...t)=>typeof e=="function"?CPe(NPe,e,...t):CPe(()=>vKr(NPe(),e),...t),SKr=Object.keys({...lze,...ojt}),wKr=Object.keys(fjt),EKr=Object.keys(ljt),kKr=Object.keys(cjt),OKr=Object.keys(ijt),zx=Object.keys(pjt),_Kr=Object.keys(ujt).concat(Object.keys(djt)),CKr=xKr({extend:{theme:{color:SKr,spacing:wKr,radius:OKr,leading:kKr,shadow:_Kr},classGroups:{"font-size":[{text:EKr}],h:[{h:zx}],w:[{w:zx}],size:[{size:zx}],"min-h":[{"min-h":zx}],"min-w":[{"min-w":zx}],"max-h":[{"max-h":zx}],"max-w":[{"max-w":zx}]}}});function K(...e){return CKr(Hdt(e))}const oi={sm:"h-form-sm",md:"h-form-md",lg:"h-form-lg",default:"h-form-default"},sh="focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",TKr="focus-within:outline-none focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",aj="rounded-md",AKr={sm:"[&>svg]:h-icon-sm [&>svg]:w-icon-sm",default:"[&>svg]:h-icon-default [&>svg]:w-icon-default",lg:"[&>svg]:h-icon-lg [&>svg]:w-icon-lg"},ve=({children:e,className:t,size:r="default",...n})=>c.jsx("span",{className:K("block",AKr[r],t),...n,children:e}),nc=Djt,dn=Njt,pn=Ijt,sn=E.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>c.jsx(jjt,{children:c.jsxs(vze,{ref:s,sideOffset:t,className:K("z-50 overflow-hidden rounded-md bg-surface6 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n,children:[r,c.jsx(Rjt,{className:"fill-surface6"})]})}));sn.displayName=vze.displayName;const DKr={sm:`${oi.sm} w-form-sm`,md:`${oi.md} w-form-md`,lg:`${oi.lg} w-form-lg`,default:`${oi.default}`},NKr={sm:"sm",md:"default",lg:"lg",default:"default"},IKr={default:"bg-surface2 hover:bg-surface4 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",light:"bg-surface3 hover:bg-surface5 text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",outline:"bg-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",ghost:"bg-transparent border-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",primary:"bg-accent1 hover:bg-accent1/90 text-surface1 font-medium hover:shadow-glow-accent1 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none"},jKr="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",oa=Ee.forwardRef(({className:e,children:t,tooltip:r,size:n="md",variant:s="default",disabled:a,...i},o)=>c.jsxs(dn,{children:[c.jsx(pn,{asChild:!0,children:c.jsx("button",{ref:o,disabled:a,"aria-label":typeof r=="string"?r:void 0,className:K(jKr,sh,IKr[s],DKr[n],a&&"active:scale-100",e),...i,children:c.jsx(ve,{size:NKr[n],children:t})})}),c.jsx(sn,{children:r})]}));oa.displayName="IconButton";const RKr={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-sm":"text-header-sm leading-header-sm","header-md":"text-header-md leading-header-md","header-lg":"text-header-lg leading-header-lg","header-xl":"text-header-xl leading-header-xl"},PKr={mono:"font-mono"},ze=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>c.jsx(e,{className:K(RKr[r],n&&PKr[n],t),...s}),Wr={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom",allSlow:"transition-all duration-slow ease-out-custom"},sx={visible:"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},$Kr={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},opt=({src:e,name:t,size:r="sm",interactive:n=!1})=>c.jsx("div",{className:K($Kr[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",Wr.all,n&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?c.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):c.jsx(ze,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),z6=({copiedDuration:e=1500}={})=>{const[t,r]=E.useState(!1);return{isCopied:t,copyToClipboard:s=>{s&&navigator.clipboard.writeText(s).then(()=>{r(!0),setTimeout(()=>r(!1),e)})}}},MKr=GBt({style:Fie.coldarkDark,customStyle:{margin:0,backgroundColor:"black"}}),LKr=()=>c.jsx(d3t,{remarkPlugins:[NUe],className:"aui-md",components:zKr}),IPe=E.memo(LKr),FKr=({language:e,code:t})=>{const{isCopied:r,copyToClipboard:n}=z6(),s=()=>{!t||r||n(t)};return c.jsxs("div",{style:{background:"hsl(0 0% 100% / 0.06)",borderTopRightRadius:"0.5rem",borderTopLeftRadius:"0.5rem",marginTop:"0.5rem",border:"1px solid hsl(0 0% 20.4%)",borderBottom:"none"},className:"flex items-center justify-between gap-4 px-4 py-2 text-sm font-semibold text-white",children:[c.jsx("span",{className:"lowercase [&>span]:text-xs",children:e}),c.jsx(oa,{variant:"light",size:"md",tooltip:"Copy",onClick:s,children:c.jsxs("span",{className:"grid",children:[c.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",r?"scale-100":"scale-0"),children:c.jsx(ya,{size:14})},"checkmark"),c.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",r?"scale-0":"scale-100"),children:c.jsx(Ql,{size:14})},"copy")]})})]})},BKr=({alt:e,src:t,...r})=>{const[n,s]=E.useState(!1);return E.useEffect(()=>{s(!1)},[t]),n||!t?c.jsxs("div",{children:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",width:"150",height:"150",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})}),c.jsx("p",{className:"text-xs italic text-neutral3 -mt-2.5 mb-2.5",children:"Image link is broken"})]}):c.jsx("img",{src:t,alt:e,...r,onError:()=>{s(!0)}})},zKr=W$t({h1:({className:e,...t})=>c.jsx("h1",{className:K("mb-8 scroll-m-20 text-4xl font-extrabold tracking-tight last:mb-0",e),...t,style:{marginBottom:"2rem"}}),h2:({className:e,...t})=>c.jsx("h2",{className:K("mb-4 mt-8 scroll-m-20 text-3xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"2rem"}}),h3:({className:e,...t})=>c.jsx("h3",{className:K("scroll-m-20 text-2xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1.5rem"}}),h4:({className:e,...t})=>c.jsx("h4",{className:K("scroll-m-20 text-xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1.5rem"}}),h5:({className:e,...t})=>c.jsx("h5",{className:K("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),h6:({className:e,...t})=>c.jsx("h6",{className:K("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),p:({className:e,...t})=>c.jsx("p",{className:K("leading-7 first:mt-0 last:mb-0",e),...t}),a:({className:e,...t})=>c.jsx("a",{className:K("text-neutral6 font-medium underline underline-offset-4",e),...t}),blockquote:({className:e,...t})=>c.jsx("blockquote",{className:K("border-l-2 pl-6 italic",e),...t}),ul:({className:e,...t})=>c.jsx("ul",{className:K("my-5 ml-6 list-disc [&>li]:mt-2",e),...t}),ol:({className:e,...t})=>c.jsx("ol",{className:K("my-5 ml-6 list-decimal [&>li]:mt-2",e),...t}),hr:({className:e,...t})=>c.jsx("hr",{className:K("my-5 border-b",e),...t}),table:({className:e,...t})=>c.jsx("table",{className:K("my-5 w-full border-separate border-spacing-0 overflow-y-auto",e),...t}),th:({className:e,...t})=>c.jsx("th",{className:K("bg-surface4 px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [&[align=center]]:text-center [&[align=right]]:text-right",e),...t}),td:({className:e,...t})=>c.jsx("td",{className:K("border-b border-l px-4 py-2 text-left last:border-r [&[align=center]]:text-center [&[align=right]]:text-right",e),...t}),tr:({className:e,...t})=>c.jsx("tr",{className:K("m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",e),...t}),sup:({className:e,...t})=>c.jsx("sup",{className:K("[&>a]:text-xs [&>a]:no-underline",e),...t}),pre:({className:e,...t})=>c.jsx("pre",{...t,style:{borderBottomRightRadius:"0.5rem",borderBottomLeftRadius:"0.5rem",background:"transparent",fontSize:"0.875rem",marginBottom:"0.5rem",border:"1px solid hsl(0 0% 20.4%)"},className:K("overflow-x-auto p-4 text-white",e)}),code:function({className:t,...r}){const n=aUe();return c.jsxs("pre",{style:{fontSize:"0.875rem",display:"inline"},children:[c.jsx("code",{className:K(!n&&"bg-surface4 rounded border font-semibold",t),...r,style:{fontWeight:"400",paddingBlock:n?0:"0.1em",paddingInline:n?0:"0.3em"}})," "]})},CodeHeader:FKr,SyntaxHighlighter:MKr,img:BKr}),UKr=({reason:e,tripwire:t})=>{const[r,n]=E.useState(!1),s=t&&(t.retry!==void 0||t.tripwirePayload||t.processorId);return c.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-950/20 overflow-hidden",children:[c.jsxs("div",{className:"flex items-start gap-3 p-4",children:[c.jsx(sI,{className:"w-5 h-5 text-amber-400 mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-sm font-medium text-amber-200 mb-1",children:"Content Blocked"}),c.jsx("p",{className:"text-sm text-amber-300/90",children:e})]})]}),s&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:()=>n(!r),className:"w-full flex items-center gap-2 px-4 py-2 text-xs text-amber-400/70 hover:text-amber-400 hover:bg-amber-900/20 transition-colors border-t border-amber-500/20",children:[r?c.jsx($a,{className:"w-3.5 h-3.5"}):c.jsx(qi,{className:"w-3.5 h-3.5"}),c.jsx("span",{children:"Details"})]}),r&&c.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-amber-500/20 bg-amber-950/10",children:[t.retry!==void 0&&c.jsxs("div",{className:"flex items-center gap-2 pt-3",children:[c.jsx(nI,{className:"w-3.5 h-3.5 text-amber-400/60"}),c.jsxs("span",{className:"text-xs text-amber-300/70",children:["Retry:"," ",t.retry?c.jsx("span",{className:"text-green-400",children:"Allowed"}):c.jsx("span",{className:"text-red-400",children:"Not allowed"})]})]}),t.processorId&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(fie,{className:"w-3.5 h-3.5 text-amber-400/60"}),c.jsxs("span",{className:"text-xs text-amber-300/70",children:["Processor:"," ",c.jsx("code",{className:"px-1.5 py-0.5 rounded bg-amber-900/30 text-amber-200 font-mono",children:t.processorId})]})]}),t.tripwirePayload!==void 0&&t.tripwirePayload!==null&&c.jsxs("div",{className:"pt-1",children:[c.jsx("p",{className:"text-xs text-amber-400/60 mb-1.5",children:"Metadata:"}),c.jsx("pre",{className:"text-xs text-amber-200/80 bg-amber-900/30 rounded p-2 overflow-x-auto font-mono",children:String(JSON.stringify(t.tripwirePayload,null,2))})]})]})]})]})},$i=e=>c.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 15C10.3565 15 12.137 14.2625 13.4497 12.9497C14.7625 11.637 15.5 9.85652 15.5 8C15.5 6.14348 14.7625 4.36301 13.4497 3.05025C12.137 1.7375 10.3565 1 8.5 1C6.64348 1 4.86301 1.7375 3.55025 3.05025C2.2375 4.36301 1.5 6.14348 1.5 8C1.5 9.85652 2.2375 11.637 3.55025 12.9497C4.86301 14.2625 6.64348 15 8.5 15ZM5.621 10.879L4.611 11.889C3.84179 11.1198 3.31794 10.1398 3.1057 9.07291C2.89346 8.00601 3.00236 6.90013 3.41864 5.89512C3.83491 4.89012 4.53986 4.03112 5.44434 3.42676C6.34881 2.8224 7.41219 2.49983 8.5 2.49983C9.58781 2.49983 10.6512 2.8224 11.5557 3.42676C12.4601 4.03112 13.1651 4.89012 13.5814 5.89512C13.9976 6.90013 14.1065 8.00601 13.8943 9.07291C13.6821 10.1398 13.1582 11.1198 12.389 11.889L11.379 10.879C11.1004 10.6003 10.7696 10.3792 10.4055 10.2284C10.0414 10.0776 9.6511 9.99995 9.257 10H7.743C7.3489 9.99995 6.95865 10.0776 6.59455 10.2284C6.23045 10.3792 5.89963 10.6003 5.621 10.879Z",fill:"currentColor"}),c.jsx("path",{d:"M8.5 4C7.96957 4 7.46086 4.21071 7.08579 4.58579C6.71071 4.96086 6.5 5.46957 6.5 6V6.5C6.5 7.03043 6.71071 7.53914 7.08579 7.91421C7.46086 8.28929 7.96957 8.5 8.5 8.5C9.03043 8.5 9.53914 8.28929 9.91421 7.91421C10.2893 7.53914 10.5 7.03043 10.5 6.5V6C10.5 5.46957 10.2893 4.96086 9.91421 4.58579C9.53914 4.21071 9.03043 4 8.5 4Z",fill:"currentColor"})]}),lpt=e=>c.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M63.0002 0.968262C28.5152 0.968262 0.55957 15.6484 0.55957 33.7573V51.2428C0.55957 69.3517 28.5152 84.0319 63.0002 84.0319C97.4853 84.0319 125.441 69.3517 125.441 51.2428V33.7573C125.441 15.6484 97.4853 0.968262 63.0002 0.968262Z",stroke:"#707070"}),c.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636V49.8363C6.67773 65.0322 31.894 77.351 62.9998 77.351C94.1055 77.351 119.322 65.0322 119.322 49.8363V35.1636Z",fill:"#2E2E2E",fillOpacity:"0.9"}),c.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636M119.322 35.1636C119.322 19.9677 94.1055 7.64893 62.9998 7.64893C31.894 7.64893 6.67773 19.9677 6.67773 35.1636M119.322 35.1636V49.8363C119.322 65.0322 94.1055 77.351 62.9998 77.351C31.894 77.351 6.67773 65.0322 6.67773 49.8363V35.1636",stroke:"#424242"}),c.jsxs("g",{clipPath:"url(#clip0_21421_19519)",children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.5383 47.0955C45.0714 50.3122 53.9322 52.1193 63.1714 52.1193C72.4106 52.1193 81.2714 50.3122 87.8045 47.0955C94.3376 43.8787 98.0078 39.5159 98.0078 34.9668C98.0078 30.4177 94.3376 26.0549 87.8045 22.8381C81.2714 19.6214 72.4106 17.8143 63.1714 17.8143C53.9322 17.8143 45.0714 19.6214 38.5383 22.8381C32.0052 26.0549 28.3349 30.4177 28.3349 34.9668C28.3349 39.5159 32.0052 43.8787 38.5383 47.0955ZM42.9089 34.9668L35.8005 34.9668C35.8004 32.3013 37.4056 29.6956 40.4132 27.4793C43.4207 25.263 47.6956 23.5355 52.6971 22.5154C57.6986 21.4954 63.2022 21.2285 68.5118 21.7485C73.8214 22.2685 78.6986 23.552 82.5266 25.4368C86.3546 27.3216 88.9615 29.723 90.0176 32.3373C91.0737 34.9517 90.5316 37.6614 88.4599 40.1241C86.3881 42.5867 82.8797 44.6915 78.3784 46.1723C73.8771 47.6532 68.585 48.4435 63.1714 48.4435V44.9435C63.1717 43.9778 62.7855 43.0215 62.035 42.1293C61.2845 41.2372 60.1843 40.4265 58.7973 39.7438L53.4695 37.1205C52.0828 36.4376 50.4364 35.8959 48.6244 35.5263C46.8124 35.1568 44.8702 34.9667 42.9089 34.9668Z",fill:"#A9A9A9"}),c.jsx("path",{d:"M77.2474 28.0361C75.3808 27.1171 72.8492 26.6007 70.2094 26.6007C67.5696 26.6007 65.038 27.1171 63.1714 28.0361L61.4119 28.9025C59.5453 29.8215 58.4966 31.068 58.4966 32.3678C58.4966 33.6676 59.5453 34.9141 61.4119 35.8331C63.2785 36.7522 65.8101 37.2685 68.4499 37.2685C71.0897 37.2685 73.6213 36.7522 75.4879 35.8331L77.2474 34.9668C79.114 34.0477 80.1627 32.8012 80.1627 31.5015C80.1627 30.2017 79.114 28.9552 77.2474 28.0361Z",fill:"#A9A9A9"})]}),c.jsx("defs",{children:c.jsx("clipPath",{id:"clip0_21421_19519",children:c.jsx("rect",{width:"62.7591",height:"62.7591",fill:"white",transform:"matrix(0.897148 0.441731 -0.897148 0.441731 63.1714 7.24365)"})})})]}),VKr=e=>c.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M11.0313 7.97578C11.0313 9.34436 9.92183 10.4538 8.55324 10.4538C7.18466 10.4538 6.0752 9.34436 6.0752 7.97578C6.0752 6.60719 7.18466 5.49773 8.55324 5.49773C9.92183 5.49773 11.0313 6.60719 11.0313 7.97578ZM11.0313 7.97578H14.573",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),c.jsx("path",{d:"M12.967 4.46154C11.9273 3.14431 10.3165 2.29883 8.50814 2.29883C5.37277 2.29883 2.83105 4.84055 2.83105 7.97591C2.83105 11.1113 5.37277 13.653 8.50814 13.653C10.3165 13.653 11.9273 12.8075 12.967 11.4903",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),Ppe=e=>c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.97865 4.57004C8.22604 4.75795 8.27426 5.11082 8.08635 5.35821L6.05486 8.03279C5.94873 8.17251 5.78348 8.25471 5.60803 8.25505C5.43257 8.2554 5.267 8.17385 5.16032 8.03454L3.80937 6.27034C3.6205 6.02369 3.66733 5.67063 3.91398 5.48176C4.16063 5.29288 4.51369 5.33972 4.70257 5.58637L5.6051 6.76498L7.19048 4.67774C7.37839 4.43036 7.73126 4.38213 7.97865 4.57004Z",fill:"currentColor"})]}),$pe=e=>c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.89741 4.10293C8.11707 4.32261 8.11706 4.67877 7.89738 4.89843L6.79517 6.00058L7.8962 7.10155C8.11588 7.32122 8.11589 7.67737 7.89623 7.89705C7.67656 8.11673 7.32041 8.11674 7.10073 7.89707L5.99965 6.79605L4.89856 7.89707C4.67889 8.11673 4.32273 8.11672 4.10307 7.89704C3.88341 7.67737 3.88342 7.32121 4.10309 7.10155L5.20413 6.00058L4.10191 4.89843C3.88224 4.67877 3.88223 4.32262 4.10189 4.10294C4.32155 3.88326 4.67771 3.88325 4.89738 4.10292L5.99965 5.20511L7.10191 4.10291C7.32159 3.88325 7.67774 3.88326 7.89741 4.10293Z",fill:"currentColor"})]}),ai=e=>c.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1747 3.18598L7.02554 1.95209C7.11557 1.89207 7.31087 1.87106 7.41016 1.90924L12.4139 3.83377C12.4683 3.85467 12.546 3.96798 12.546 4.03118V13.0167C12.546 13.265 12.7473 13.4663 12.9956 13.4663C13.2439 13.4663 13.4452 13.265 13.4452 13.0167V4.03118C13.4452 3.59605 13.1384 3.14906 12.7367 2.99456L7.73293 1.07004C7.36225 0.927472 6.86056 0.981451 6.52679 1.20396L4.20445 2.75219L3.90419 2.95236L3.90647 2.95824C3.69329 3.05449 3.55469 3.27599 3.55469 3.57581V11.7119C3.55469 12.2084 3.93067 12.7499 4.39251 12.9206L9.89804 14.955C10.3608 15.126 10.7359 14.8596 10.7359 14.3659V5.83295C10.7359 5.33662 10.3498 4.81289 9.88389 4.66643L5.1747 3.18598Z",fill:"currentColor"})}),Mpe=e=>c.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:c.jsx("path",{d:"M7.5 0.75C3.6325 0.75 0.5 3.8825 0.5 7.75C0.5 10.8475 2.50375 13.4637 5.28625 14.3912C5.63625 14.4525 5.7675 14.2425 5.7675 14.0587C5.7675 13.8925 5.75875 13.3412 5.75875 12.755C4 13.0787 3.545 12.3262 3.405 11.9325C3.32625 11.7312 2.985 11.11 2.6875 10.9437C2.4425 10.8125 2.0925 10.4887 2.67875 10.48C3.23 10.4712 3.62375 10.9875 3.755 11.1975C4.385 12.2562 5.39125 11.9587 5.79375 11.775C5.855 11.32 6.03875 11.0137 6.24 10.8387C4.6825 10.6637 3.055 10.06 3.055 7.3825C3.055 6.62125 3.32625 5.99125 3.7725 5.50125C3.7025 5.32625 3.4575 4.60875 3.8425 3.64625C3.8425 3.64625 4.42875 3.4625 5.7675 4.36375C6.3275 4.20625 6.9225 4.1275 7.5175 4.1275C8.1125 4.1275 8.7075 4.20625 9.2675 4.36375C10.6062 3.45375 11.1925 3.64625 11.1925 3.64625C11.5775 4.60875 11.3325 5.32625 11.2625 5.50125C11.7087 5.99125 11.98 6.6125 11.98 7.3825C11.98 10.0687 10.3438 10.6637 8.78625 10.8387C9.04 11.0575 9.25875 11.4775 9.25875 12.1337C9.25875 13.07 9.25 13.8225 9.25 14.0587C9.25 14.2425 9.38125 14.4612 9.73125 14.3912C11.1209 13.9221 12.3284 13.029 13.1839 11.8377C14.0393 10.6463 14.4996 9.21668 14.5 7.75C14.5 3.8825 11.3675 0.75 7.5 0.75Z",fill:"currentColor"})}),c.jsx("defs",{children:c.jsx("clipPath",{id:"clip0_21999_22095",children:c.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),cpt=e=>c.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[c.jsx("path",{d:"M13.5037 7.54867C13.5037 7.1144 13.4648 6.69683 13.3924 6.29596H7.62436V8.66776H10.9204C10.7756 9.43052 10.3413 10.0764 9.68994 10.5106V12.0529H11.6776C12.8356 10.9839 13.5037 9.41382 13.5037 7.54867Z",fill:"white"}),c.jsx("path",{d:"M7.62415 13.5339C9.27773 13.5339 10.6643 12.9882 11.6776 12.0529L9.68994 10.5106C9.14431 10.8781 8.44816 11.1009 7.62415 11.1009C6.03182 11.1009 4.67889 10.0263 4.19451 8.57877H2.15677V10.16C3.1645 12.1587 5.23008 13.5339 7.62415 13.5339Z",fill:"white"}),c.jsx("path",{d:"M4.19472 8.57315C4.07223 8.20569 3.99985 7.81595 3.99985 7.40952C3.99985 7.00308 4.07223 6.61335 4.19472 6.24589V4.66469H2.15698C1.73941 5.4887 1.5 6.41849 1.5 7.40952C1.5 8.40055 1.73941 9.33034 2.15698 10.1543L3.74374 8.91834L4.19472 8.57315Z",fill:"white"}),c.jsx("path",{d:"M7.62415 3.72376C8.5261 3.72376 9.32783 4.03555 9.96811 4.63685L11.7219 2.88306C10.6585 1.89202 9.27773 1.28516 7.62415 1.28516C5.23008 1.28516 3.16471 2.66036 2.15698 4.66469L4.19472 6.24589C4.6791 4.79832 6.03182 3.72376 7.62415 3.72376Z",fill:"white"})]}),c.jsx("defs",{children:c.jsx("clipPath",{id:"clip0_21999_20513",children:c.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),qKr=e=>c.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M4.31445 3.16083C3.78402 3.16083 3.27531 3.37154 2.90024 3.74661C2.52517 4.12169 2.31445 4.63039 2.31445 5.16083V5.66083C2.31445 6.19126 2.52517 6.69997 2.90024 7.07504C3.27531 7.45011 3.78402 7.66083 4.31445 7.66083C4.84489 7.66083 5.35359 7.45011 5.72867 7.07504C6.10374 6.69997 6.31445 6.19126 6.31445 5.66083V5.16083C6.31445 4.63039 6.10374 4.12169 5.72867 3.74661C5.35359 3.37154 4.84489 3.16083 4.31445 3.16083Z",fill:"currentColor"}),c.jsx("path",{d:"M6.76666 9.50235C6.57678 9.28532 6.30244 9.16083 6.01407 9.16083H4.50201C4.10791 9.16078 3.71766 9.23838 3.35356 9.38921C3.11733 9.48706 2.8951 9.6145 2.69205 9.76806C2.48056 9.928 2.38001 10.1888 2.38001 10.454V13.0642C2.38001 13.6165 2.82773 14.0642 3.38001 14.0642H8.55436C9.4135 14.0642 9.87269 13.0523 9.30695 12.4057L6.76666 9.50235Z",fill:"currentColor"}),c.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),c.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),c.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),upt=e=>c.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{d:"M3.8674 9.19968L4.14554 10.8649C4.23965 11.4283 4.75254 11.8237 5.32137 11.7713L5.58252 11.7472C6.56555 11.6567 7.43309 12.3868 7.51181 13.3708L7.59308 14.3867C7.60422 14.5259 7.71868 14.6342 7.85825 14.6376L9.91053 14.6876C10.1066 14.6924 10.2434 14.4948 10.17 14.3129L8.90452 11.1782C8.80956 10.9429 8.65085 10.7389 8.44626 10.5889L7.90134 10.1895C7.70604 10.0464 7.55223 9.85411 7.45759 9.63124C7.15011 8.90712 6.6579 7.71234 6.37054 6.88944C6.19204 6.3783 5.79931 6.29158 5.45492 6.21553C4.98179 6.11106 4.5999 6.02673 4.99001 4.88985C5.66408 2.92541 8.06015 2.07904 10.6601 3.33088C12.6488 4.2884 13.1187 6.35416 13.0328 7.58237C13.0297 7.62768 13.0214 7.67186 13.0094 7.71566C12.8829 8.17534 12.368 8.40491 11.9415 8.19169L10.3022 7.37201C10.2069 7.32439 10.0927 7.33657 10.0096 7.40322L8.64809 8.49559C8.55405 8.57104 8.52072 8.69931 8.56615 8.811L10.8995 14.5478C10.9404 14.6483 11.0369 14.715 11.1454 14.7177L12.0572 14.7399C12.2581 14.7448 12.3951 14.5382 12.3124 14.3551L11.8681 13.3706C11.4211 12.3803 11.6047 11.2192 12.3354 10.4151L13.4616 9.17575C13.7473 8.86125 13.9224 8.46187 13.9599 8.03858L13.9763 7.85359C14.2866 4.35298 11.377 1.41272 7.87336 1.68639C6.03919 1.82965 4.45399 3.02228 3.80807 4.74492L3.70275 5.02579C3.5828 5.34571 3.62741 5.70411 3.82213 5.98485L3.88946 6.08192C4.12183 6.41695 4.0958 6.86726 3.82637 7.17328L3.06705 8.03572C2.96261 8.15435 2.98058 8.33664 3.10617 8.43259L3.66059 8.85617C3.77064 8.94026 3.84458 9.06307 3.8674 9.19968Z",fill:"currentColor"})}),HKr=e=>c.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{d:"M10.1266 5.67745C10.3409 5.0225 10.2695 4.2961 9.92413 3.70069C9.40017 2.78376 8.34034 2.31934 7.30433 2.53369C6.85182 2.02164 6.18496 1.73584 5.49428 1.73584C4.43445 1.73584 3.50561 2.41461 3.17218 3.4149C2.49342 3.55779 1.90992 3.97458 1.56458 4.5819C1.04062 5.49883 1.1597 6.64202 1.86228 7.42796C1.64793 8.09482 1.73129 8.80931 2.07663 9.40472C2.60059 10.3217 3.66042 10.798 4.69643 10.5717C5.16085 11.0838 5.8158 11.3815 6.50648 11.3815C7.56631 11.3815 8.49515 10.7027 8.82858 9.70243C9.50735 9.55953 10.0908 9.14274 10.4362 8.53542C10.9601 7.61849 10.8411 6.46339 10.1266 5.67745ZM6.50648 10.7503C6.07778 10.7503 5.67291 10.6074 5.35138 10.3336C5.36329 10.3217 5.39902 10.3097 5.41093 10.2978L7.32815 9.19037C7.42341 9.13083 7.48295 9.03557 7.48295 8.91648V6.21332L8.29271 6.67774C8.30462 6.67774 8.30462 6.68965 8.30462 6.70156V8.9403C8.31653 9.94059 7.50677 10.7503 6.50648 10.7503ZM2.62441 9.09511C2.41006 8.72595 2.33861 8.29726 2.41006 7.88047C2.42197 7.89238 2.44578 7.90429 2.4696 7.91619L4.38682 9.02366C4.48209 9.0832 4.60117 9.0832 4.69643 9.02366L7.04235 7.66612V8.60687C7.04235 8.61878 7.04235 8.63069 7.03044 8.63069L5.0894 9.75006C4.23201 10.2502 3.12455 9.9525 2.62441 9.09511ZM2.12426 4.90342C2.33861 4.53427 2.67204 4.26038 3.06501 4.10557V6.39195C3.06501 6.49912 3.12455 6.60629 3.21982 6.66583L5.56573 8.02337L4.75597 8.48779C4.74407 8.48779 4.73216 8.4997 4.73216 8.48779L2.79112 7.36842C1.90992 6.86827 1.62412 5.76081 2.12426 4.90342ZM8.79285 6.45149L6.44694 5.09395L7.2567 4.62953C7.2686 4.62953 7.28051 4.61762 7.28051 4.62953L9.22155 5.7489C10.0908 6.24905 10.3766 7.35651 9.8765 8.2139C9.66215 8.58305 9.32872 8.85694 8.93575 8.99984V6.72538C8.94766 6.6182 8.88812 6.51103 8.79285 6.45149ZM9.5907 5.23685C9.5788 5.22494 9.55498 5.21303 9.53116 5.20113L7.61394 4.09366C7.51868 4.03412 7.39959 4.03412 7.30433 4.09366L4.95841 5.4512V4.51045C4.95841 4.49854 4.95841 4.48663 4.97032 4.48663L6.91136 3.36726C7.78066 2.86712 8.87621 3.16482 9.37636 4.03412C9.5907 4.39137 9.66215 4.82006 9.5907 5.23685ZM4.51781 6.904L3.70805 6.43958C3.69615 6.43958 3.69615 6.42767 3.69615 6.41576V4.17702C3.69615 3.17673 4.5059 2.36697 5.50619 2.36697C5.93489 2.36697 6.33977 2.50987 6.66129 2.78376C6.64938 2.79567 6.62556 2.80758 6.60175 2.81949L4.68453 3.92695C4.58926 3.98649 4.52972 4.08176 4.52972 4.20084V6.904H4.51781ZM4.95841 5.95134L6.00634 5.34402L7.05426 5.95134V7.15407L6.00634 7.76139L4.95841 7.15407V5.95134Z",fill:"currentColor"})}),Lpe=e=>c.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.40864 11.9983C7.58064 11.9733 6.84164 11.6153 6.31564 11.0563C6.31464 11.0563 6.31464 11.0553 6.31464 11.0553C5.78864 10.4963 5.47564 9.73633 5.50064 8.90833C5.52564 8.08033 5.88464 7.34133 6.44364 6.81533C7.00264 6.28833 7.76264 5.97633 8.59064 6.00133C9.41864 6.02633 10.1576 6.38433 10.6836 6.94333H10.6846C11.2106 7.50333 11.5236 8.26233 11.4986 9.09033C11.4726 9.91833 11.1146 10.6583 10.5556 11.1843C9.99664 11.7103 9.23664 12.0233 8.40864 11.9983ZM16.1266 8.15033L14.3606 7.74033C14.2316 7.14133 14.0146 6.57633 13.7216 6.05733L14.7726 4.57933C14.9116 4.38533 14.8926 4.12033 14.7296 3.94633L13.9206 3.08733C13.7576 2.91333 13.4946 2.87933 13.2916 3.00533L11.7526 3.96533C11.2526 3.64133 10.7016 3.39033 10.1116 3.22633L9.80964 1.43833C9.76964 1.20333 9.56964 1.02833 9.33164 1.02133L8.15264 0.985326C7.91364 0.978326 7.70364 1.14033 7.64964 1.37233L7.24064 3.13933C6.64164 3.26733 6.07664 3.48433 5.55664 3.77733L4.07864 2.72633C3.88464 2.58833 3.61964 2.60633 3.44664 2.76933L2.58664 3.57833C2.41364 3.74133 2.37964 4.00533 2.50564 4.20733L3.46564 5.74633C3.14164 6.24633 2.89064 6.79833 2.72564 7.38833L0.937635 7.68933C0.702635 7.72933 0.528635 7.92933 0.520635 8.16733L0.485635 9.34733C0.477635 9.58533 0.639635 9.79533 0.872635 9.84933L2.63864 10.2583C2.76764 10.8573 2.98464 11.4233 3.27764 11.9423L2.22564 13.4203C2.08764 13.6143 2.10564 13.8793 2.26964 14.0523L3.07864 14.9123C3.24164 15.0853 3.50464 15.1203 3.70664 14.9933L5.24564 14.0333C5.74663 14.3583 6.29764 14.6093 6.88764 14.7733L7.18964 16.5613C7.22864 16.7963 7.42864 16.9713 7.66764 16.9783L8.84663 17.0143C9.08564 17.0213 9.29564 16.8593 9.34964 16.6273L9.75864 14.8603C10.3576 14.7323 10.9226 14.5153 11.4416 14.2213L12.9206 15.2733C13.1146 15.4113 13.3786 15.3933 13.5526 15.2293L14.4116 14.4213C14.5856 14.2573 14.6196 13.9943 14.4936 13.7923L13.5336 12.2533C13.8576 11.7523 14.1086 11.2013 14.2726 10.6113L16.0616 10.3103C16.2966 10.2703 16.4706 10.0703 16.4776 9.83233L16.5136 8.65233C16.5206 8.41433 16.3586 8.20433 16.1266 8.15033Z",fill:"currentColor"})}),QKr=e=>c.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),tl=e=>c.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5605 1.42351C8.0791 0.904904 8.92215 0.906157 9.4395 1.42351L10.6922 2.67617C11.2108 3.19477 11.2095 4.03782 10.6922 4.55517L9.4395 5.80783C8.9209 6.32643 8.07785 6.32518 7.5605 5.80783L6.30784 4.55517C5.78923 4.03656 5.79049 3.19352 6.30784 2.67617L7.5605 1.42351ZM3.17618 5.80783C3.69478 5.28923 4.53782 5.29048 5.05517 5.80783L6.30784 7.0605C6.82644 7.5791 6.82519 8.42214 6.30784 8.93949L5.05517 10.1922C4.53657 10.7108 3.69353 10.7095 3.17618 10.1922L1.92351 8.93949C1.40491 8.42089 1.40616 7.57785 1.92351 7.0605L3.17618 5.80783ZM11.9448 5.80783C12.4634 5.28923 13.3065 5.29048 13.8238 5.80783L15.0765 7.0605C15.5951 7.5791 15.5938 8.42214 15.0765 8.93949L13.8238 10.1922C13.3052 10.7108 12.4622 10.7095 11.9448 10.1922L10.6922 8.93949C10.1736 8.42089 10.1748 7.57785 10.6922 7.0605L11.9448 5.80783ZM7.5605 10.1922C8.0791 9.67355 8.92215 9.67481 9.4395 10.1922L10.6922 11.4448C11.2108 11.9634 11.2095 12.8065 10.6922 13.3238L9.4395 14.5765C8.9209 15.0951 8.07785 15.0938 7.5605 14.5765L6.30784 13.3238C5.78923 12.8052 5.79049 11.9622 6.30784 11.4448L7.5605 10.1922Z",fill:"currentColor"})}),_O=e=>c.jsx(tjt,{...e}),Yl=e=>c.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),GKr=e=>c.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636V49.8363C6.67773 65.0322 31.894 77.351 62.9998 77.351C94.1055 77.351 119.322 65.0322 119.322 49.8363V35.1636Z",fill:"#2E2E2E",fillOpacity:"0.9"}),c.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636M119.322 35.1636C119.322 19.9677 94.1055 7.64893 62.9998 7.64893C31.894 7.64893 6.67773 19.9677 6.67773 35.1636M119.322 35.1636V49.8363C119.322 65.0322 94.1055 77.351 62.9998 77.351C31.894 77.351 6.67773 65.0322 6.67773 49.8363V35.1636",stroke:"#424242"}),c.jsx("path",{d:"M63.0002 0.968262C28.5152 0.968262 0.55957 15.6484 0.55957 33.7573V51.2428C0.55957 69.3517 28.5152 84.0319 63.0002 84.0319C97.4853 84.0319 125.441 69.3517 125.441 51.2428V33.7573C125.441 15.6484 97.4853 0.968262 63.0002 0.968262Z",stroke:"#707070"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M74.9374 21.357C76.2127 20.7291 78.2804 20.7291 79.5557 21.357L90.8129 26.8997C92.0882 27.5276 92.0882 28.5458 90.8129 29.1737L83.1638 32.9399C81.8885 33.5678 79.8207 33.5678 78.5454 32.9399L75.8033 31.5898L68.3324 35.2682L64.1502 39.696C63.8908 39.481 63.6138 39.2568 63.3231 39.0227L63.1495 38.883C62.2893 38.1914 61.2677 37.3701 60.6254 36.6376C60.5446 36.5456 60.4618 36.4463 60.3812 36.3407C60.1669 36.3011 59.9652 36.2603 59.7782 36.2205C58.2906 35.9043 56.6225 35.4013 55.2179 34.9777L54.9342 34.8922C54.4589 34.7491 54.0034 34.6127 53.5666 34.4849L62.5594 32.4258L70.0304 28.7473L67.2882 27.3972C66.0129 26.7692 66.0129 25.7512 67.2882 25.1232L74.9374 21.357ZM53.5666 34.4849C53.5666 34.4849 53.5666 34.4849 53.5666 34.4849L46.1603 36.1808L47.516 36.8483C48.7913 37.4762 48.7912 38.4943 47.516 39.1222L39.8668 42.8884C38.5916 43.5163 36.5238 43.5164 35.2485 42.8884L23.9913 37.3457C22.7159 36.7177 22.716 35.6996 23.9913 35.0717L31.6404 31.3055C32.9156 30.6776 34.9834 30.6776 36.2587 31.3055L38.5358 32.4267C39.6899 31.9483 40.9309 31.4611 42.153 31.0313C43.6354 30.5099 45.4001 29.9605 47.091 29.683C49.7278 29.2502 52.3729 29.7072 53.9892 30.0537C55.8019 30.4425 57.6745 31.0055 59.1934 31.4628C60.6081 31.8887 61.6949 32.2154 62.5594 32.4258L53.5666 34.4849ZM46.1603 36.1808L53.5666 34.4849C52.5189 34.1784 51.5786 33.9213 50.7293 33.7392C49.9958 33.5819 49.6114 33.5441 49.4794 33.5326C48.964 33.6384 48.0924 33.8823 46.8983 34.3023C46.0703 34.5936 45.1981 34.9293 44.3325 35.2808L46.1603 36.1808ZM64.1502 39.696L68.3324 35.2682C68.7598 35.6939 69.4232 36.229 70.2883 36.9256C71.2171 37.6735 72.3605 38.5954 73.15 39.488C73.8539 40.2838 74.7818 41.5862 73.9029 42.8844C73.3394 43.717 72.2235 44.5859 71.1648 45.3159C70.2916 45.9175 69.3021 46.5286 68.3305 47.0968L70.6077 48.218C71.8829 48.8459 71.8829 49.864 70.6077 50.4919L62.9585 54.2582C61.6833 54.8861 59.6154 54.8861 58.3402 54.2582L47.083 48.7154C45.8077 48.0875 45.8077 47.0694 47.083 46.4415L54.7321 42.6752C56.0074 42.0474 58.0751 42.0473 59.3505 42.6752L60.7062 43.3428L64.1502 39.696ZM64.1502 39.696L60.7062 43.3428L62.5339 44.2427C63.2478 43.8165 63.9298 43.3871 64.5213 42.9794C65.3742 42.3914 65.8695 41.9622 66.0846 41.7085C66.0613 41.6436 65.9844 41.4543 65.6649 41.0931C65.295 40.6749 64.773 40.212 64.1502 39.696Z",fill:"#A9A9A9"})]}),Gf=e=>c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),c.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),ZKr=e=>c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:c.jsx("path",{d:"M1.5 8.5V8C1.5 7.60218 1.65804 7.22064 1.93934 6.93934C2.22064 6.65804 2.60218 6.5 3 6.5H13C13.3978 6.5 13.7794 6.65804 14.0607 6.93934C14.342 7.22064 14.5 7.60218 14.5 8V8.5M8.70667 4.20667L7.29333 2.79333C7.20048 2.70037 7.09022 2.62661 6.96886 2.57628C6.84749 2.52595 6.71739 2.50003 6.586 2.5H3C2.60218 2.5 2.22064 2.65804 1.93934 2.93934C1.65804 3.22064 1.5 3.60218 1.5 4V12C1.5 12.3978 1.65804 12.7794 1.93934 13.0607C2.22064 13.342 2.60218 13.5 3 13.5H13C13.3978 13.5 13.7794 13.342 14.0607 13.0607C14.342 12.7794 14.5 12.3978 14.5 12V6C14.5 5.60218 14.342 5.22064 14.0607 4.93934C13.7794 4.65804 13.3978 4.5 13 4.5H9.414C9.14887 4.49977 8.89402 4.39426 8.70667 4.20667Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),WKr=e=>c.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641V49.8368C6.67773 65.0327 31.894 77.3514 62.9998 77.3514C94.1055 77.3514 119.322 65.0327 119.322 49.8368V35.1641Z",fill:"#2E2E2E",fillOpacity:"0.9"}),c.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641M119.322 35.1641C119.322 19.9681 94.1055 7.64941 62.9998 7.64941C31.894 7.64941 6.67773 19.9681 6.67773 35.1641M119.322 35.1641V49.8368C119.322 65.0327 94.1055 77.3514 62.9998 77.3514C31.894 77.3514 6.67773 65.0327 6.67773 49.8368V35.1641",stroke:"#424242"}),c.jsx("path",{d:"M63.0002 0.96875C28.5152 0.96875 0.55957 15.6489 0.55957 33.7578V51.2433C0.55957 69.3522 28.5152 84.0323 63.0002 84.0323C97.4853 84.0323 125.441 69.3522 125.441 51.2433V33.7578C125.441 15.6489 97.4853 0.96875 63.0002 0.96875Z",stroke:"#707070"}),c.jsx("path",{d:"M51.5215 39.9726C50.5464 40.4477 48.9738 40.4435 48.009 39.9634C47.0442 39.4833 47.0526 38.709 48.0277 38.2339L69.7191 27.6672C72.7243 26.2032 72.7347 23.8181 69.7605 22.3476L69.6898 22.313C66.6927 20.8686 61.8895 20.8864 58.9368 22.3528L30.3946 36.5278C29.4288 37.0074 27.8561 37.0107 26.882 36.5352C25.9078 36.0597 25.901 35.2853 26.8668 34.8057L55.4092 20.6308C60.2847 18.2094 68.2157 18.1801 73.1645 20.5651L73.2814 20.6222C76.1808 22.0558 77.3624 24.0157 76.8227 25.8782C80.6339 25.5828 84.6694 26.1476 87.6364 27.5775C92.6525 29.9949 92.7059 33.962 87.7554 36.4119L61.5441 49.3836C61.282 49.5133 61.281 49.7227 61.5417 49.853L67.0252 52.5932C67.988 53.0743 67.9763 53.8486 66.9992 54.3226C66.0221 54.7966 64.4495 54.7909 63.4867 54.3098L58.0033 51.5695C55.8306 50.4838 55.8392 48.7391 58.0226 47.6585L84.2339 34.6868C87.2382 33.2 87.2058 30.7925 84.1617 29.3254C81.1488 27.8734 76.1811 27.9317 73.2127 29.4058L51.5215 39.9726Z",fill:"#A9A9A9"}),c.jsx("path",{d:"M63.0028 23.8809C64.0019 23.4098 65.5873 23.4146 66.5747 23.8972C67.562 24.3798 67.5831 25.1603 66.6338 25.6556L66.5879 25.679L45.1511 36.3113C42.2204 37.7649 42.2292 40.1117 45.1707 41.56C48.1228 43.0135 52.91 43.0118 55.8578 41.5563L76.8564 31.1875L76.9037 31.1648C77.9049 30.6949 79.4903 30.7013 80.4755 31.185C81.4763 31.6764 81.4785 32.4741 80.4806 32.9669L59.4821 43.3356C54.5363 45.7777 46.5044 45.7806 41.5516 43.342C36.6166 40.9121 36.602 36.9747 41.519 34.5359L62.9558 23.9037L63.0028 23.8809Z",fill:"#A9A9A9"})]}),XKr=e=>c.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641V49.8368C6.67773 65.0327 31.894 77.3514 62.9998 77.3514C94.1055 77.3514 119.322 65.0327 119.322 49.8368V35.1641Z",fill:"#2E2E2E",fillOpacity:"0.9"}),c.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641M119.322 35.1641C119.322 19.9681 94.1055 7.64941 62.9998 7.64941C31.894 7.64941 6.67773 19.9681 6.67773 35.1641M119.322 35.1641V49.8368C119.322 65.0327 94.1055 77.3514 62.9998 77.3514C31.894 77.3514 6.67773 65.0327 6.67773 49.8368V35.1641",stroke:"#424242"}),c.jsx("path",{d:"M63.0002 0.96875C28.5152 0.96875 0.55957 15.6489 0.55957 33.7578V51.2433C0.55957 69.3522 28.5152 84.0323 63.0002 84.0323C97.4853 84.0323 125.441 69.3522 125.441 51.2433V33.7578C125.441 15.6489 97.4853 0.96875 63.0002 0.96875Z",stroke:"#707070"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M95.8997 32.6647C98.4806 33.9355 98.4744 36.0012 95.8997 37.2689L89.6657 40.3384C87.0848 41.6091 82.8892 41.6061 80.3146 40.3384L74.0805 37.2689C71.4996 35.9981 71.5059 33.9324 74.0805 32.6647L80.3146 29.5952C82.8955 28.3244 87.091 28.3275 89.6657 29.5952L95.8997 32.6647ZM74.0805 21.9215C76.6614 23.1923 76.6552 25.258 74.0805 26.5257L67.8465 29.5952C65.2656 30.866 61.0701 30.8629 58.4954 29.5952L52.2613 26.5257C49.6804 25.255 49.6867 23.1892 52.2613 21.9215L58.4954 18.852C61.0763 17.5813 65.2718 17.5843 67.8465 18.852L74.0805 21.9215ZM74.0805 43.4079C76.6614 44.6786 76.6552 46.7444 74.0805 48.0121L67.8465 51.0816C65.2656 52.3523 61.0701 52.3493 58.4954 51.0816L52.2613 48.0121C49.6804 46.7413 49.6867 44.6756 52.2613 43.4079L58.4954 40.3384C61.0763 39.0676 65.2718 39.0707 67.8465 40.3384L74.0805 43.4079ZM52.2613 32.6647C54.8422 33.9355 54.836 36.0012 52.2613 37.2689L46.0273 40.3384C43.4464 41.6091 39.2509 41.6061 36.6762 40.3384L30.4422 37.2689C27.8613 35.9981 27.8675 33.9324 30.4422 32.6647L36.6762 29.5952C39.2571 28.3244 43.4526 28.3275 46.0273 29.5952L52.2613 32.6647Z",fill:"#A9A9A9"})]});function N0(e){return c.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),c.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),c.jsx("path",{d:"M15 2v2"}),c.jsx("path",{d:"M15 20v2"}),c.jsx("path",{d:"M2 15h2"}),c.jsx("path",{d:"M2 9h2"}),c.jsx("path",{d:"M20 15h2"}),c.jsx("path",{d:"M20 9h2"}),c.jsx("path",{d:"M9 2v2"}),c.jsx("path",{d:"M9 20v2"})]})}const YKr={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},KKr={warning:Pc,destructive:Xh,info:Ac},Ep=({children:e,variant:t="destructive",className:r})=>{const n=KKr[t];return c.jsx("div",{className:K(YKr[t],"p-3 rounded-md border shadow-sm",Wr.all,"animate-in fade-in-0 slide-in-from-top-2 duration-200",r),children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(ve,{className:"mt-0.5 flex-shrink-0",children:c.jsx(n,{})}),c.jsx("div",{className:"text-neutral4",children:e})]})})},kp=({children:e,as:t="h5"})=>c.jsx(ze,{as:t,variant:"ui-md",className:"font-semibold",children:e}),ny=({children:e,as:t="p"})=>c.jsx(ze,{as:t,variant:"ui-sm",children:e}),JKr={default:"text-neutral3 bg-surface4",success:"text-accent1 bg-accent1Dark",error:"text-accent2 bg-accent2Dark",info:"text-accent5 bg-accent5Dark",warning:"text-accent6 bg-accent6Dark"},eJr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},Ft=({icon:e,variant:t="default",className:r,children:n,...s})=>c.jsxs("div",{className:K("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",Wr.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":JKr[t],r),...s,children:[e&&c.jsx("span",{className:eJr[t],children:c.jsx(ve,{children:e})}),n]}),tJr=()=>{const e=jn(({part:i})=>i),[t,r]=E.useState(!1),n=e.text||"",s=e.metadata||{};if(s?.status==="tripwire")return c.jsx(UKr,{reason:n,tripwire:s.tripwire});if(s?.status==="warning")return c.jsxs(Ep,{variant:"warning",children:[c.jsx(kp,{as:"h5",children:"Warning"}),c.jsx(ny,{as:"p",children:n})]});if(s?.status==="error")return c.jsxs(Ep,{variant:"destructive",children:[c.jsx(kp,{as:"h5",children:"Error"}),c.jsx(ny,{as:"p",children:n})]});const a=s?.completionResult;if(a)return c.jsxs("div",{className:"mb-2 space-y-2",children:[c.jsxs("button",{onClick:()=>r(i=>!i),className:"flex items-center gap-2",children:[c.jsx(ve,{children:c.jsx(N1,{className:K("transition-all",t?"rotate-90":"rotate-180")})}),c.jsxs(Ft,{variant:"info",icon:c.jsx(zBe,{}),children:[t?"Show":"Hide"," completion check"]})]}),!t&&c.jsxs(Ep,{variant:"info",children:[c.jsx(kp,{as:"h5",children:a?.passed?"Complete":"Not Complete"}),c.jsx(IPe,{})]})]});try{const i=n.trim();if(i.startsWith("__ERROR__:")){const o=i.substring(10);return c.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[c.jsx(Xh,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),c.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:o})]})]})}else if(i.startsWith("Error:")){const o=i.substring(6).trim();return c.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[c.jsx(Xh,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),c.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:o})]})]})}return c.jsx(IPe,{})}catch{return c.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[c.jsx(Xh,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),c.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:String(n)})]})]})}},Zu="mastra_workspace",Ch={FILESYSTEM:{READ_FILE:`${Zu}_read_file`,WRITE_FILE:`${Zu}_write_file`,EDIT_FILE:`${Zu}_edit_file`,LIST_FILES:`${Zu}_list_files`,DELETE:`${Zu}_delete`,FILE_STAT:`${Zu}_file_stat`,MKDIR:`${Zu}_mkdir`},SANDBOX:{EXECUTE_COMMAND:`${Zu}_execute_command`,GET_PROCESS_OUTPUT:`${Zu}_get_process_output`,KILL_PROCESS:`${Zu}_kill_process`},SEARCH:{SEARCH:`${Zu}_search`,INDEX:`${Zu}_index`}},rJr={duration:5e3,cancel:{label:c.jsx(ve,{children:c.jsx(Os,{})}),onClick:()=>{}},unstyled:!0,classNames:{toast:"bg-surface3 w-full h-auto rounded-lg gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card [&>[data-content]]:flex-1",title:"text-xs font-medium text-neutral5",description:"text-xs text-neutral3",cancelButton:"!bg-transparent hover:!bg-surface2 !border-none !rounded-md !p-1.5 !m-0 !text-neutral3 hover:!text-neutral6 shrink-0 transition-all",actionButton:"!bg-white flex items-center justify-center font-medium !text-black order-last hover:opacity-80"}};function yd(e){const{classNames:t,...r}=rJr,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:K(t?.title,n?.title),toast:K(t?.toast,n?.toast),cancelButton:K(t?.cancelButton,n?.cancelButton),actionButton:K(t?.actionButton,n?.actionButton),description:K(t?.description,n?.description)},...s}}const We=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>Vl(r,yd(t)));if(Ee.isValidElement(e))return Vl(e,yd(t));if(typeof e=="string")return Vl(e,yd(t));throw new Error("Invalid message type")};We.success=(e,t={})=>{const r={...t,icon:c.jsx(ve,{className:"text-accent1 shrink-0",children:c.jsx(UBe,{})}),classNames:{...t.classNames,toast:K("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Vl.success(e,yd(r));case"object":return e.forEach(n=>Vl.success(n,yd(r)))}};We.error=(e,t={})=>{const r={...t,icon:c.jsx(ve,{className:"text-accent2 shrink-0",children:c.jsx(dA,{})}),classNames:{...t.classNames,toast:K("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Vl.error(e,yd(r));case"object":return e.forEach(n=>Vl.error(n,yd(r)))}};We.warning=(e,t={})=>{const r={...t,icon:c.jsx(ve,{className:"text-accent6 shrink-0",children:c.jsx(Xh,{})}),classNames:{...t.classNames,toast:K("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Vl.warning(e,yd(r));case"object":return e.forEach(n=>Vl.warning(n,yd(r)))}};We.info=(e,t={})=>{const r={...t,icon:c.jsx(ve,{className:"text-accent3 shrink-0",children:c.jsx(Ac,{})}),classNames:{...t.classNames,toast:K("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Vl.info(e,yd(r));case"object":return e.forEach(n=>Vl.info(n,yd(r)))}};We.custom=(e,t={})=>Vl(e,yd(t));We.dismiss=e=>{e&&Vl.dismiss(e)};We.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>Vl.promise(e,{loading:t??"Loading...",success:o=>(s?.(o),r),error:o=>(a?.(o),n||o?.message||"Error..."),...yd(i)});function Zf({text:e,copyMessage:t="Copied to clipboard!"}){const[r,n]=E.useState(!1),s=E.useRef(null),a=E.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{We.success(t),n(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{n(!1)},2e3)}).catch(()=>{We.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:r,handleCopy:a}}const dpt={sm:`${oi.sm} gap-1 text-ui-sm`,md:`${oi.md} gap-1`,lg:`${oi.lg} gap-2`,default:`${oi.default} text-ui-md`,large:`${oi.lg} text-ui-lg`},ppt={default:"bg-surface2 hover:bg-surface4 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",light:"bg-surface3 hover:bg-surface5 text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",outline:"bg-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",ghost:"bg-transparent border-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",primary:"bg-accent1 hover:bg-accent1/90 text-surface1 font-medium hover:shadow-glow-accent1 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none",cta:"bg-white/20 border-2 border-transparent hover:text-white hover:bg-white/25 disabled:opacity-50 disabled:cursor-not-allowed active:bg-white/30 text-neutral5",standard:"bg-white/10 border-2 border-transparent hover:text-white hover:bg-white/15 disabled:opacity-50 disabled:cursor-not-allowed active:bg-white/20 text-neutral4"},fpt="border border-border1 px-2 text-ui-md inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",nJr=K("flex items-center justify-center rounded-lg gap-[.75em] px-[1em] leading-0 transition-colors duration-200 ease-out-custom","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em]","[&:hover>svg]:opacity-100"),sJr="focus-visible:outline-none focus-visible:border-accent1/50";function U6(e){const t=e?.variant||"default",r=e?.size||"md";return K(fpt,sh,ppt[t],dpt[r])}const ye=Ee.forwardRef(({className:e,as:t,size:r="md",variant:n="default",disabled:s,...a},i)=>{const o=t||"button",l=["cta","standard"].includes(n);return c.jsx(o,{ref:i,disabled:s,className:K(l?nJr:fpt,l?sJr:sh,ppt[n],dpt[r],s&&"active:scale-100",e),...a})});ye.displayName="Button";const sN=Ee.forwardRef(({tooltipContent:e,...t},r)=>c.jsxs(dn,{children:[c.jsx(pn,{asChild:!0,children:c.jsx(ye,{ref:r,...t})}),e&&c.jsx(sn,{children:e})]}));sN.displayName="ButtonWithTooltip";function ql({content:e,copyMessage:t,tooltip:r="Copy to clipboard",iconSize:n="default",className:s,size:a="sm"}){const[i,o]=E.useState(!1),{handleCopy:l}=Zf({text:e,copyMessage:t}),u=()=>{l(),o(!0),setTimeout(()=>o(!1),2e3)};return c.jsxs(dn,{children:[c.jsx(pn,{asChild:!0,children:c.jsx(ye,{onClick:u,type:"button",size:a,variant:"standard",children:i?c.jsx(ya,{}):c.jsx(Ql,{})})}),c.jsx(sn,{children:i?"Copied!":r})]})}const aJr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,iJr=rr.mark({class:"cm-variable-highlight"}),jPe=new _qe({regexp:aJr,decoration:()=>iJr}),oJr=xi.fromClass(class{decorations;constructor(e){this.decorations=jPe.createDeco(e)}update(e){this.decorations=jPe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),lJr=oJr;function cJr(e,t=5){if(!e?.properties)return[];const r=[];function n(s,a,i){if(i>t)return;const o=Array.isArray(s.type)?s.type.join(" | "):s.type;if(r.push({path:a,label:a,description:s.description??s.title,type:o}),s.properties)for(const[l,u]of Object.entries(s.properties))n(u,`${a}.${l}`,i+1);if(s.items?.properties)for(const[l,u]of Object.entries(s.items.properties))n(u,`${a}[].${l}`,i+1)}for(const[s,a]of Object.entries(e.properties))n(a,s,1);return r}function uJr(e){const t=cJr(e);return dHe({override:[dJr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function dJr(e){return t=>{const n=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!n)return null;const s=n[1]??"",a=t.pos-s.length,i=s?e.filter(l=>l.path.toLowerCase().startsWith(s.toLowerCase())):e;if(i.length===0)return null;const o=i.map(l=>({label:l.path,displayLabel:l.path,detail:l.type,info:l.description,apply:(u,d,p,f)=>{const y=u.state.sliceDoc(f,f+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:p,to:f,insert:y},selection:{anchor:p+y.length}})}}));return{from:a,options:o,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const ax=()=>E.useMemo(()=>{const e=GL({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#939393",background:"transparent"},styles:[{tag:[re.className,re.propertyName]},{tag:re.heading,color:"#ff79c6",fontWeight:"bold"},{tag:[re.heading1,re.heading2,re.heading3,re.heading4,re.heading5,re.heading6],color:"#ff79c6",fontWeight:"bold"},{tag:re.emphasis,fontStyle:"italic",color:"#f8f8f2"},{tag:re.strong,fontWeight:"bold",color:"#f8f8f2"},{tag:re.link,color:"#8be9fd",textDecoration:"underline"},{tag:re.url,color:"#8be9fd"},{tag:re.monospace,color:"#f1fa8c"},{tag:re.strikethrough,textDecoration:"line-through"},{tag:re.quote,fontStyle:"italic",color:"#6272a4"}]}),t=mt.theme({".cm-editor":{colorScheme:"dark",backgroundColor:"transparent"},".cm-lineNumbers .cm-gutterElement":{color:"#939393"},".cm-tooltip-autocomplete":{backgroundColor:"#282a36",border:"1px solid #44475a",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.4)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"#f8f8f2"},".cm-completionDetail":{color:"#A1A1AA",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"#282a36",border:"1px solid #44475a",color:"#6272a4",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"#44475a",color:"#f8f8f2"},".cm-line .cm-variable-highlight":{color:"#F59E0B !important",fontWeight:"500"}});return[e,t]},[]),Wa=E.forwardRef(({data:e,value:t,onChange:r,showCopyButton:n=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:o,wordWrap:l=!1,schema:u,autoFocus:d,...p},f)=>{const h=ax(),m=e?JSON.stringify(e,null,2):t??"",y=E.useMemo(()=>{const b=[];return a==="json"?b.push(fd):a==="markdown"&&(b.push(Xoe({base:Y0,codeLanguages:jQe})),b.push(mt.lineWrapping)),i&&a==="markdown"&&b.push(lJr),u&&a==="markdown"&&b.push(uJr(u)),b},[a,i,u]);return c.jsxs("div",{className:K("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...p,children:[n&&c.jsx(ql,{content:m,className:"absolute top-2 right-2 z-20"}),c.jsx(vd,{ref:f,value:m,theme:h,extensions:y,onChange:r,"aria-label":"Code editor",placeholder:o,height:"100%",style:{height:"100%"},autoFocus:d})]})});async function pJr(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ge(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-AYBaNmoq.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([26,1]),import.meta.url);if(!(t in n))return null;const{tokens:s}=await r(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}const V6=({children:e,initialCollapsed:t=!0,icon:r,title:n,collapsible:s=!0,extraInfo:a,"data-testid":i})=>{const[o,l]=E.useState(t);return E.useEffect(()=>{l(t)},[t]),c.jsxs("div",{className:"mb-4","data-testid":i,children:[c.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between",children:[c.jsxs("button",{onClick:s?()=>l(u=>!u):void 0,className:"flex items-center gap-2 disabled:cursor-not-allowed",disabled:!s,type:"button",children:[c.jsx(ve,{children:c.jsx(N1,{className:K("transition-all",o?"rotate-90":"rotate-180")})}),c.jsx(Ft,{icon:r,children:n})]}),a]}),!o&&c.jsx("div",{className:"pt-2",children:c.jsx("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:e})})]})},ea=JL,hpt=VGe,fJr=eF,mpt=E.forwardRef(({className:e,...t},r)=>c.jsx(bI,{ref:r,className:K("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));mpt.displayName=bI.displayName;const Ls=E.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(fJr,{children:[c.jsx(mpt,{}),c.jsxs(vI,{ref:n,className:K("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%]","gap-4 border border-border1 bg-surface3 py-6 shadow-dialog rounded-lg","duration-slow","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",e),...r,children:[t,c.jsxs(nF,{className:K("absolute right-4 top-4 rounded-md p-1","text-neutral3 hover:text-neutral6 hover:bg-surface4","transition-all duration-normal ease-out-custom","focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","disabled:pointer-events-none"),children:[c.jsx(Os,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ls.displayName=vI.displayName;const ta=({className:e,...t})=>c.jsx("div",{className:K("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});ta.displayName="DialogHeader";const q6=({className:e,...t})=>c.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});q6.displayName="DialogFooter";const ra=({className:e,...t})=>c.jsx("div",{className:K("overflow-y-auto px-6 max-h-[50vh]",e),...t});ra.displayName="DialogBody";const Fs=E.forwardRef(({className:e,...t},r)=>c.jsx(tF,{ref:r,className:K("text-ui-md font-medium",e),...t}));Fs.displayName=tF.displayName;const ni=E.forwardRef(({className:e,...t},r)=>c.jsx(rF,{ref:r,className:K("sr-only",e),...t}));ni.displayName=rF.displayName;const hJr=({selectionReason:e,open:t,onOpenChange:r,input:n})=>{let s=null;if(n)try{s=typeof n=="object"?c.jsx(Wa,{data:n}):c.jsx(Wa,{data:JSON.parse(n)})}catch{s=c.jsx("pre",{className:"whitespace-pre-wrap",children:n})}return c.jsx(ea,{open:t,onOpenChange:r,children:c.jsxs(Ls,{children:[c.jsxs(ta,{children:[c.jsx(Fs,{children:"Agent Network Metadata"}),c.jsx(ni,{children:"View the metadata of the agent's network choice."})]}),c.jsxs(ra,{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ze,{className:"text-neutral3",children:"Selection Reason"}),c.jsx("div",{className:"text-neutral6 text-ui-md",children:e})]}),s&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(ze,{className:"text-neutral3",children:"Input"}),c.jsx("div",{className:"text-neutral6 text-ui-md",children:s})]})]})]})})},Fpe=({selectionReason:e,input:t})=>{const[r,n]=E.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsx(oa,{variant:"light",size:"md",tooltip:"Show selection reason",onClick:()=>n(s=>!s),children:c.jsx(NIt,{className:"text-neutral3 size-5"})}),c.jsx(hJr,{selectionReason:e||"",open:r,onOpenChange:n,input:t})]})},gpt=E.createContext(void 0);function mJr({children:e,approveToolcall:t,declineToolcall:r,approveToolcallGenerate:n,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:l,networkToolCallApprovals:u}){return c.jsx(gpt.Provider,{value:{approveToolcall:t,declineToolcall:r,approveToolcallGenerate:n,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:l,networkToolCallApprovals:u},children:e})}function gJr(){const e=E.useContext(gpt);if(!e)throw new Error("useToolCall must be used within a ToolCallProvider");return e}const ij=({toolCalled:e,toolCallId:t,toolApprovalMetadata:r,toolName:n,isNetwork:s,isGenerateMode:a})=>{const{approveToolcall:i,declineToolcall:o,approveToolcallGenerate:l,declineToolcallGenerate:u,isRunning:d,toolCallApprovals:p,approveNetworkToolcall:f,declineNetworkToolcall:h,networkToolCallApprovals:m}=gJr(),y=()=>{s?f(n,r?.runId):a?l(t):i(t)},b=()=>{s?h(n,r?.runId):a?u(t):o(t)},v=s?m?.[r?.runId?`${r.runId}-${n}`:n]?.status:p?.[t]?.status;return r&&!e?c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Approval required"}),c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsxs(ye,{onClick:y,disabled:d||!!v,className:v==="approved"?"!text-accent1":"",children:[c.jsx(ve,{children:c.jsx(ya,{})}),"Approve"]}),c.jsxs(ye,{onClick:b,disabled:d||!!v,className:v==="declined"?"!text-accent2":"",children:[c.jsx(ve,{children:c.jsx(Os,{})}),"Decline"]})]})]}):null},yJr=({toolName:e,args:t,result:r,metadata:n,toolOutput:s,toolCallId:a,toolApprovalMetadata:i,suspendPayload:o,isNetwork:l,toolCalled:u})=>{let d=null;try{const{__mastraMetadata:b,...v}=typeof t=="object"?t:JSON.parse(t);d=c.jsx(Wa,{data:v,"data-testid":"tool-args"})}catch{d=c.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:t})}let p=typeof r=="string"?c.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:r}):c.jsx(Wa,{data:r,"data-testid":"tool-result"}),f=typeof o=="string"?c.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:o}):c.jsx(Wa,{data:o,"data-testid":"tool-suspend-payload"});const h=n?.mode==="network"?n.selectionReason:void 0,m=n?.mode==="network"?n.agentInput:void 0,y=u??(r||s.length>0);return c.jsx(V6,{"data-testid":"tool-badge",icon:c.jsx(tl,{className:"text-accent6"}),title:e,extraInfo:n?.mode==="network"&&c.jsx(Fpe,{selectionReason:h||"",input:m}),initialCollapsed:!(i??o),children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Tool arguments"}),d]}),f!==void 0&&o&&c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Tool suspend payload"}),f]}),p!==void 0&&r&&c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Tool result"}),p]}),s.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Tool output"}),c.jsx("div",{className:"h-40 overflow-y-auto",children:c.jsx(Wa,{data:s,"data-testid":"tool-output"})})]}),c.jsx(ij,{toolCalled:y,toolCallId:a,toolApprovalMetadata:i,toolName:e,isNetwork:l,isGenerateMode:n?.mode==="generate"})]})})},ypt=E.createContext({Link:E.forwardRef(()=>null),navigate:()=>{},paths:{agentLink:()=>"",agentsLink:()=>"",agentToolLink:()=>"",agentSkillLink:()=>"",agentThreadLink:()=>"",agentNewThreadLink:()=>"",workflowsLink:()=>"",workflowLink:()=>"",networkLink:()=>"",networkNewThreadLink:()=>"",networkThreadLink:()=>"",scorerLink:()=>"",cmsScorersCreateLink:()=>"",cmsScorerEditLink:()=>"",cmsAgentCreateLink:()=>"",cmsAgentEditLink:()=>"",promptBlockLink:()=>"",promptBlocksLink:()=>"",cmsPromptBlockCreateLink:()=>"",cmsPromptBlockEditLink:()=>"",toolLink:()=>"",skillLink:()=>"",workspacesLink:()=>"",workspaceLink:()=>"",workspaceSkillLink:()=>"",processorsLink:()=>"",processorLink:()=>"",mcpServerLink:()=>"",mcpServerToolLink:()=>"",workflowRunLink:()=>"",datasetLink:()=>"",datasetItemLink:()=>"",datasetExperimentLink:()=>""}}),bJr=({children:e,Link:t,navigate:r,paths:n})=>c.jsx(ypt.Provider,{value:{Link:t,navigate:r,paths:n},children:e}),Yt=()=>{const e=E.useContext(ypt);if(!e)throw new Error("useLinkComponent must be used within a LinkComponentProvider");return e},vJr=e=>{switch(e){case"running":return"bg-green-500";case"starting":case"initializing":return"bg-yellow-500";case"stopped":case"paused":return"bg-gray-500";case"error":case"failed":return"bg-red-500";default:return"bg-accent6"}},xJr=(e,t)=>{const[r,n]=E.useState(0),s=E.useRef(null);return E.useEffect(()=>{if(e){n(0),s.current=t||Date.now();const a=setInterval(()=>{s.current&&n(Date.now()-s.current)},100);return()=>clearInterval(a)}else s.current=null},[e,t]),r},SJr=({command:e,content:t,maxHeight:r="20rem",onCopy:n,isCopied:s})=>{const a=E.useRef(null);return E.useEffect(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},[t]),c.jsxs("div",{className:"rounded-md border border-border1 overflow-hidden",children:[e&&c.jsxs("div",{className:"px-3 py-2 bg-surface3 border-b border-border1 flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("span",{className:"text-neutral6 text-xs shrink-0",children:"$"}),c.jsx("code",{className:"text-xs text-neutral-300 font-mono truncate",children:e})]}),n&&c.jsx(oa,{variant:"light",size:"sm",tooltip:"Copy output",onClick:n,className:"shrink-0",children:c.jsxs("span",{className:"grid",children:[c.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",s?"scale-100":"scale-0"),children:c.jsx(ya,{size:14})}),c.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",s?"scale-0":"scale-100"),children:c.jsx(Ql,{size:14})})]})})]}),c.jsx("pre",{ref:a,style:{maxHeight:r},className:"overflow-x-auto overflow-y-auto p-3 text-sm text-neutral-300 font-mono whitespace-pre-wrap bg-black",children:t||c.jsx("span",{className:"text-neutral6 italic",children:"No output"})})]})},wJr=({toolName:e,args:t,result:r,metadata:n,toolCallId:s,toolApprovalMetadata:a,isNetwork:i,toolCalled:o})=>{const l=jn(Z=>Z.message),u=E.useMemo(()=>l.content.filter($=>$.type==="data"),[l.content]),[d,p]=E.useState(!1),{isCopied:f,copyToClipboard:h}=z6(),{Link:m}=Yt(),y=u.find(Z=>Z.name==="sandbox-command"&&Z.data?.toolCallId===s);let b="";try{const Z=typeof t=="object"?t:JSON.parse(t);e===Ch.SANDBOX.EXECUTE_COMMAND?b=Z.command||"":(e===Ch.SANDBOX.GET_PROCESS_OUTPUT||e===Ch.SANDBOX.KILL_PROCESS)&&(b=y?.data?.command||`PID ${Z.pid}`)}catch{b=e}const v=u.filter(Z=>(Z.name==="sandbox-stdout"||Z.name==="sandbox-stderr")&&Z.data?.toolCallId===s),S=u.find(Z=>Z.name==="workspace-metadata"&&Z.data?.toolCallId===s),w=S?.data,k=u.find(Z=>Z.name==="sandbox-exit"&&Z.data?.toolCallId===s),_=!!k||typeof r=="string",C=!!S,T=C&&!_,A=o??(_||C),N=k?.data?.exitCode,j=k?.data?.success,R=k?.data?.executionTimeMs,L=k?.data?.killed,F=v.map(Z=>Z.data?.output||"").join(""),M=typeof r=="string"?r:F,z=e===Ch.SANDBOX.EXECUTE_COMMAND?"Execute Command":e===Ch.SANDBOX.GET_PROCESS_OUTPUT?"Get Process Output":e===Ch.SANDBOX.KILL_PROCESS?"Kill Process":e,q=v[0]?.data?.timestamp,Q=xJr(T,q),V=()=>{!M||f||h(M)};return c.jsxs("div",{className:"mb-4","data-testid":"sandbox-execution-badge",children:[c.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[c.jsxs("button",{onClick:()=>p(Z=>!Z),className:"flex items-center gap-2 min-w-0",type:"button",children:[c.jsx(ve,{children:c.jsx(N1,{className:K("transition-all",d?"rotate-90":"rotate-180")})}),c.jsx(Ft,{icon:c.jsx(LIt,{className:"text-accent6",size:16}),children:z}),w?.sandbox&&c.jsxs(m,{href:w.id?`/workspaces/${w.id}`:"/workspaces",className:"flex items-center gap-1.5 text-xs text-neutral6 px-1.5 py-0.5 rounded bg-surface3 border border-border1 hover:bg-surface4 hover:border-border2 transition-colors",onClick:Z=>Z.stopPropagation(),children:[c.jsx("span",{className:K("w-1.5 h-1.5 rounded-full",vJr(w.sandbox.status))}),c.jsx("span",{children:w.sandbox.name||w.sandbox.provider})]})]}),c.jsx("div",{className:"flex items-center gap-2",children:T?c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-accent6",children:[c.jsx("span",{className:"w-1.5 h-1.5 bg-accent6 rounded-full animate-pulse"}),c.jsx("span",{className:"animate-pulse",children:"running"})]}),c.jsxs("span",{className:"text-neutral6 text-xs tabular-nums",children:[Q,"ms"]})]}):c.jsxs(c.Fragment,{children:[N!==void 0&&(j?c.jsx(ya,{className:"text-green-400",size:14}):L?c.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-orange-500/20 text-orange-400",children:"killed"}):c.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-500/20 text-red-400",children:["exit ",N]})),R!==void 0&&c.jsxs("span",{className:"text-neutral6 text-xs",children:[R,"ms"]})]})})]}),!d&&c.jsxs("div",{className:"pt-2",children:[(M||b)&&c.jsx(SJr,{command:b,content:M,onCopy:M?V:void 0,isCopied:f}),c.jsx(ij,{toolCalled:A,toolCallId:s,toolApprovalMetadata:a,toolName:e,isNetwork:i,isGenerateMode:n?.mode==="generate"})]})]})},EJr=({toolName:e,args:t,result:r,toolCallId:n,toolApprovalMetadata:s,isNetwork:a,toolCalled:i})=>{const[o,l]=E.useState(!s),{isCopied:u,copyToClipboard:d}=z6();E.useEffect(()=>{l(!s)},[s]);const{Link:p}=Yt();let f={path:"/"};try{f=typeof t=="object"?t:JSON.parse(t)}catch{}const{path:h="/",maxDepth:m,showHidden:y,dirsOnly:b,exclude:v,extension:S}=f,w=[];m!==void 0&&m!==3&&w.push(`depth: ${m}`),y&&w.push("hidden"),b&&w.push("dirs only"),v&&w.push(`exclude: ${v}`),S&&w.push(`ext: ${S}`);let k="",_="";if(typeof r=="string"&&r){const L=r.lastIndexOf(`
|
|
568
568
|
|
|
569
569
|
`);L!==-1?(k=r.slice(0,L),_=r.slice(L+2)):k=r}const C=!!k,T=i??C,A=jn(L=>L.message),j=E.useMemo(()=>A.content.find(F=>F.type==="data"&&F.name==="workspace-metadata"&&F.data?.toolCallId===n),[A.content,n])?.data,R=()=>{!k||u||d(k)};return c.jsxs("div",{className:"mb-4","data-testid":"file-tree-badge",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsxs("button",{onClick:()=>l(L=>!L),className:"flex items-center gap-2 min-w-0",type:"button",children:[c.jsx(ve,{children:c.jsx(N1,{className:K("transition-all",o?"rotate-90":"rotate-180")})}),c.jsxs(Ft,{icon:c.jsx(lNt,{className:"text-accent6",size:16}),children:["List Files ",c.jsx("span",{className:"text-neutral6 font-normal ml-1",children:h}),w.length>0&&c.jsxs("span",{className:"text-neutral4 font-normal ml-1",children:["(",w.join(", "),")"]})]})]}),j?.filesystem&&c.jsxs(p,{href:j.id?`/workspaces/${j.id}?path=${encodeURIComponent(h)}`:"/workspaces",className:"flex items-center gap-1.5 text-xs text-neutral6 px-1.5 py-0.5 rounded bg-surface3 border border-border1 hover:bg-surface4 hover:border-border2 transition-colors",children:[c.jsx(DK,{className:"size-3"}),c.jsx("span",{children:j.name||j.filesystem.name})]}),o&&C&&_&&c.jsx("span",{className:"text-neutral6 text-xs",children:_})]}),!o&&c.jsxs("div",{className:"pt-2",children:[s&&!T&&c.jsxs("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Tool arguments"}),c.jsx(Wa,{data:f,"data-testid":"tool-args"})]}),c.jsx(ij,{toolCalled:T,toolCallId:n,toolApprovalMetadata:s,toolName:e,isNetwork:a})]}),T&&k&&c.jsxs("div",{className:"rounded-md border border-border1 bg-surface2 overflow-hidden",children:[c.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border1 bg-surface3",children:[_&&c.jsx("span",{className:"text-neutral6 text-xs",children:_}),c.jsx(oa,{variant:"light",size:"sm",tooltip:"Copy tree",onClick:R,disabled:!k,children:c.jsxs("span",{className:"grid",children:[c.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",u?"scale-100":"scale-0"),children:c.jsx(ya,{size:14})}),c.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",u?"scale-0":"scale-100"),children:c.jsx(Ql,{size:14})})]})})]}),c.jsx("pre",{className:"p-3 text-xs font-mono text-mastra-el-6 overflow-x-auto whitespace-pre max-h-[300px] overflow-y-auto",children:k})]}),T&&!C&&c.jsx("div",{className:"rounded-md border border-border1 bg-surface2 px-3 py-2",children:c.jsx("span",{className:"text-xs text-neutral6",children:"Loading..."})})]})]})};function Tre(e){const t={},r=e.context||{};Object.entries(r).forEach(([i,o])=>{if(i!=="input"&&"status"in o){const l=o,u=l.status==="failed"&&l.tripwire!==void 0;t[i]={status:l.status,output:"output"in l?l.output:void 0,payload:"payload"in l?l.payload:void 0,suspendPayload:"suspendPayload"in l?l.suspendPayload:void 0,suspendOutput:"suspendOutput"in l?l.suspendOutput:void 0,resumePayload:"resumePayload"in l?l.resumePayload:void 0,error:u?void 0:"error"in l?l.error:void 0,tripwire:u?l.tripwire:void 0,startedAt:"startedAt"in l?l.startedAt:Date.now(),endedAt:"endedAt"in l?l.endedAt:void 0,suspendedAt:"suspendedAt"in l?l.suspendedAt:void 0,resumedAt:"resumedAt"in l?l.resumedAt:void 0}}});const n=Object.entries(t).flatMap(([i,o])=>{if(o?.status==="suspended"){const l=o?.suspendPayload?.__workflow_meta?.path;return l?[[i,...l]]:[[i]]}return[]}),s=n?.[0]?.[0],a=s?t[s]?.suspendPayload:void 0;return{input:r.input,steps:t,status:e.status,...e.status==="success"?{result:e.result}:{},...e.status==="failed"?{error:e.error}:{},...e.status==="suspended"?{suspended:n,suspendPayload:a}:{},...e.status==="tripwire"&&e.tripwire?{tripwire:{reason:e.tripwire.reason,retry:e.tripwire.retry,metadata:e.tripwire.metadata,processorId:e.tripwire.processorId}}:{}}}const Bpe=()=>{const[e,t]=E.useState(!1),r=E.useCallback(n=>{if(n){const s=new IntersectionObserver(([a])=>{t(a.isIntersecting)});return s.observe(n),()=>s.disconnect()}},[]);return{inView:e,setRef:r}},vs=Fne()(fxr(e=>({requestContext:{},setRequestContext:t=>e({requestContext:t})}),{name:"mastra-playground-store"})),oj=e=>{const t=st(),{requestContext:r}=vs();return ur({queryKey:["workflow",e],queryFn:()=>e?t.getWorkflow(e).details(r):null,enabled:!!e,retry:!1,refetchOnWindowFocus:!1,throwOnError:!1})},Are=20;function kJr(e,t,r){if(!(e.runs.length<Are))return r+1}function OJr(e){const t=new Set;return e.pages.flatMap(r=>r.runs).filter(r=>t.has(r.runId)?!1:(t.add(r.runId),!0))}const bpt=(e,{enabled:t=!0}={})=>{const r=st(),{inView:n,setRef:s}=Bpe(),a=EF({queryKey:["workflow-runs",e],queryFn:({pageParam:u})=>r.getWorkflow(e).runs({limit:Are,offset:u*Are}),initialPageParam:0,getNextPageParam:kJr,select:OJr,retry:!1,enabled:t,refetchInterval:5e3}),{hasNextPage:i,isFetchingNextPage:o,fetchNextPage:l}=a;return E.useEffect(()=>{n&&i&&!o&&l()},[n,i,o,l]),{...a,setEndOfListElement:s}},vpt=(e,t,r)=>{const n=st();return ur({queryKey:["workflow-run",e,t],queryFn:()=>n.getWorkflow(e).runById(t),enabled:!!(e&&t),gcTime:0,staleTime:0,refetchInterval:r})},_Jr=e=>{const t=st(),r=va();return Kr({mutationFn:({runId:n})=>t.getWorkflow(e).deleteRunById(n),onSuccess:()=>{r.invalidateQueries({queryKey:["workflow-runs",e]}),We.success("Workflow run deleted successfully")},onError:()=>{We.error("Failed to delete workflow run")}})},xpt=E.createContext(null);function H6(){const e=E.useContext(xpt);if(!e)throw new Error("useWorkflowStepDetail must be used within WorkflowStepDetailProvider");return e}function CJr({children:e}){const[t,r]=E.useState(null),n=E.useCallback(({stepName:i,stepId:o,mapConfig:l})=>{r({type:"map-config",stepName:i,stepId:o,mapConfig:l})},[]),s=E.useCallback(({label:i,stepGraph:o,fullStep:l})=>{r({type:"nested-graph",stepName:i,nestedGraph:{label:i,stepGraph:o,fullStep:l}})},[]),a=E.useCallback(()=>{r(null)},[]);return c.jsx(xpt.Provider,{value:{stepDetail:t,showMapConfig:n,showNestedGraph:s,closeStepDetail:a},children:e})}function TJr({entityId:e,entityType:t}){const[r,n]=E.useState(void 0),s=`tracing-options-${t}:${e}`;return E.useEffect(()=>{try{const o=localStorage.getItem(s);if(o){const l=JSON.parse(o);n(l||void 0)}}catch(o){console.error(o)}},[s]),{settings:r,setSettings:o=>{n(l=>({...l,...o})),localStorage.setItem(s,JSON.stringify({...o,entityId:e,entityType:t}))},resetAll:()=>{n(void 0),localStorage.removeItem(s)},entityType:t}}const Spt=E.createContext({setSettings:()=>{},resetAll:()=>{},settings:void 0,entityType:void 0}),wpt=({children:e,entityId:t,entityType:r})=>{const n=TJr({entityId:t,entityType:r});return c.jsx(Spt.Provider,{value:n,children:e})},zpe=()=>E.useContext(Spt),Fm=E.createContext({});function Upe({children:e,snapshot:t,workflowId:r,initialRunId:n,withoutTimeTravel:s=!1}){const[a,i]=E.useState(()=>t?Tre(t):null),[o,l]=E.useState(()=>t?.context?.input??null),[u,d]=E.useState(()=>n??""),[p,f]=E.useState(!1),[h,m]=E.useState(!1),y=p||["success","failed","canceled","bailed"].includes(a?.status??"")?void 0:5e3,{isLoading:b,data:v}=vpt(r,n??"",y),S=E.useMemo(()=>v&&n?{context:{input:v?.payload,...v?.steps},status:v?.status,result:v?.result,error:v?.error,runId:n,serializedStepGraph:v?.serializedStepGraph,value:v?.initialState}:void 0,[v,n]),{data:w,isLoading:k,error:_}=oj(r),{settings:C}=zpe(),T=cxr(),{streamWorkflow:A,streamResult:N,isStreaming:j,observeWorkflowStream:R,closeStreamsAndReset:L,resumeWorkflowStream:F,timeTravelWorkflowStream:M}=lxr({debugMode:h,tracingOptions:C?.tracingOptions,onError:Q=>We.error(Q.message)}),z=uxr(),q=()=>{i(null),l(null)};return E.useEffect(()=>{f(!1)},[n]),E.useEffect(()=>{S?.runId&&(i(Tre(S)),S.value&&Object.keys(S.value).length>0?l({initialState:S.value,inputData:S.context?.input}):l(S.context?.input),d(S.runId))},[S]),c.jsx(Fm.Provider,{value:{workflowId:r,result:a,setResult:i,payload:o,setPayload:l,clearData:q,snapshot:t,runId:u,setRunId:d,workflowError:_??null,workflow:w??void 0,isLoading:k,createWorkflowRun:T.mutateAsync,streamWorkflow:Q=>(f(!0),A.mutateAsync(Q)),resumeWorkflow:Q=>(f(!0),F.mutateAsync(Q)),streamResult:N,isStreamingWorkflow:j,isCancellingWorkflowRun:z.isPending,cancelWorkflowRun:z.mutateAsync,observeWorkflowStream:Q=>(f(!0),R.mutate(Q)),closeStreamsAndReset:L,timeTravelWorkflowStream:Q=>(f(!0),M.mutateAsync(Q)),runSnapshot:S,isLoadingRunExecutionResult:b,withoutTimeTravel:s,debugMode:h,setDebugMode:m},children:c.jsx(CJr,{children:e})})}function Nr({className:e,...t}){return c.jsx("div",{className:K("rounded-md bg-surface4 relative overflow-hidden","before:absolute before:inset-0","before:translate-x-[-100%]","before:animate-[shimmer_2s_infinite]","before:bg-gradient-to-r before:from-transparent before:via-surface5/20 before:to-transparent",e),...t})}const AJr=e=>e.replace(/[-_\s]+(.)?/g,(r,n)=>n?n.toUpperCase():"").replace(/^(.)/,r=>r.toLowerCase()).replace(/([A-Z])/g," $1").replace(/^./,r=>r.toUpperCase()).trim(),DJr=(e,t,r)=>{if(!e.startsWith("mapping_"))return e;const n=l=>l.split(" ").map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join(" "),s=l=>{const u=l.replace(/Step$/,"").replace(/[-_]/g," ").trim();return n(u)},a=(l,u)=>l.length===0?u?"End":"Start":l.length===1?s(l[0]):`${l.length} Steps`,i=a(t,!1),o=a(r,!0);return`${i} → ${o} Map`},NJr=(e,t)=>{const r=new CNe.graphlib.Graph().setDefaultEdgeLabel(()=>({}));r.setGraph({rankdir:"TB"}),t.forEach(a=>r.setEdge(a.source,a.target)),e.forEach(a=>r.setNode(a.id,{...a,width:a.measured?.width??274,height:a.measured?.height??(a?.data?.isLarge?260:100)})),CNe.layout(r);const n=r.graph()?.width?r.graph().width/2:0,s=r.graph()?.height?r.graph().height/2:0;return{nodes:e.map(a=>{const i=r.node(a.id),o=i.x-(a.measured?.width??274)/2,l=i.y-(a.measured?.height??(a?.data?.isLarge?260:100))/2;return{...a,position:{x:o,y:l}}}),edges:t,fullWidth:n,fullHeight:s}},of={animated:!0,markerEnd:{type:ND.ArrowClosed,width:20,height:20,color:"#8e8e8e"}},Dre=({stepFlow:e,xIndex:t,yIndex:r,prevNodeIds:n,prevStepIds:s,nextStepFlow:a,condition:i,allPrevNodeIds:o})=>{let l=[],u=[];if((a?.type==="step"||a?.type==="foreach"||a?.type==="loop")&&(l=[o?.includes(a.step.id)?`${a.step.id}-${r+1}`:a.step.id],u=[a.step.id]),(a?.type==="sleep"||a?.type==="sleepUntil")&&(l=[o?.includes(a.id)?`${a.id}-${r+1}`:a.id],u=[a.id]),a?.type==="parallel"&&(l=a?.steps.map(d=>{const p=d.step.id;return o?.includes(p)?`${p}-${r+1}`:p})||[],u=a?.steps.map(d=>d.step.id)||[]),a?.type==="conditional"&&(l=a?.serializedConditions.map(d=>d.id)||[],u=a?.steps?.map(d=>d.step.id)||[]),e.type==="step"||e.type==="foreach"){const d=e.step.component==="WORKFLOW",p=o?.includes(e.step.id)?`${e.step.id}-${r}`:e.step.id,f=[...i?[{id:i.id,position:{x:t*300,y:r*100},type:"condition-node",data:{label:i.id,previousStepId:s[s.length-1],nextStepId:e.step.id,withoutTopHandle:!n.length,withoutBottomHandle:!l.length,isLarge:!0,conditions:[{type:"when",fnString:i.fn}]}}]:[],{id:p,position:{x:t*300,y:(r+(i?1:0))*100},type:d?"nested-node":"default-node",data:{label:DJr(e.step.id,s,u),stepId:e.step.id,description:e.step.description,withoutTopHandle:i?!1:!n.length,withoutBottomHandle:!l.length,stepGraph:d?e.step.serializedStepFlow:void 0,mapConfig:e.step.mapConfig,canSuspend:e.step.canSuspend,isForEach:e.type==="foreach",metadata:e.step.metadata}}],h=[...i?[...(n||[]).map((m,y)=>({id:`e${m}-${i.id}`,source:m,data:{previousStepId:s[y],nextStepId:e.step.id},target:i.id,...of})),{id:`e${i.id}-${p}`,source:i.id,data:{previousStepId:s[s.length-1],nextStepId:e.step.id,conditionNode:!0},target:p,...of}]:(n||[]).map((m,y)=>({id:`e${m}-${p}`,source:m,data:{previousStepId:s[y],nextStepId:e.step.id},target:p,...of})),...(l||[]).map((m,y)=>({id:`e${p}-${m}`,source:p,data:{previousStepId:e.step.id,nextStepId:u[y]},target:m,...of}))];return{nodes:f,edges:h,nextPrevNodeIds:[p],nextPrevStepIds:[e.step.id]}}if(e.type==="sleep"||e.type==="sleepUntil"){const d=o?.includes(e.id)?`${e.id}-${r}`:e.id,p=[...i?[{id:i.id,position:{x:t*300,y:r*100},type:"condition-node",data:{label:i.id,previousStepId:s[s.length-1],nextStepId:e.id,withoutTopHandle:!1,withoutBottomHandle:!l.length,isLarge:!0,conditions:[{type:"when",fnString:i.fn}]}}]:[],{id:d,position:{x:t*300,y:(r+(i?1:0))*100},type:"default-node",data:{label:e.id,withoutTopHandle:i?!1:!n.length,withoutBottomHandle:!l.length,...e.type==="sleepUntil"?{date:e.date}:{duration:e.duration}}}],f=[...n.length?i?[...n.map((h,m)=>({id:`e${h}-${i.id}`,source:h,data:{previousStepId:s[m],nextStepId:e.id},target:i.id,...of})),{id:`e${i.id}-${d}`,source:i.id,data:{previousStepId:s[s.length-1],nextStepId:e.id},target:d,...of}]:n.map((h,m)=>({id:`e${h}-${d}`,source:h,data:{previousStepId:s[m],nextStepId:e.id},target:d,...of})):[],...l.length?l.map((h,m)=>({id:`e${d}-${h}`,source:d,data:{previousStepId:e.id,nextStepId:u[m]},target:h,...of})):[]];return{nodes:p,edges:f,nextPrevNodeIds:[d],nextPrevStepIds:[e.id]}}if(e.type==="loop"){const{step:d,serializedCondition:p,loopType:f}=e,h=d.component==="WORKFLOW",m=[{id:d.id,position:{x:t*300,y:r*100},type:h?"nested-node":"default-node",data:{label:d.id,description:d.description,withoutTopHandle:!n.length,withoutBottomHandle:!1,stepGraph:h?d.serializedStepFlow:void 0,canSuspend:d.canSuspend,metadata:d.metadata}},{id:p.id,position:{x:t*300,y:(r+1)*100},type:"condition-node",data:{label:p.id,previousStepId:d.id,nextStepId:u[0],withoutTopHandle:!1,withoutBottomHandle:!l.length,isLarge:!0,conditions:[{type:f,fnString:p.fn}]}}],y=[...n.length?n.map((b,v)=>({id:`e${b}-${d.id}`,source:b,data:{previousStepId:s[v],nextStepId:d.id},target:d.id,...of})):[],{id:`e${d.id}-${p.id}`,source:d.id,data:{previousStepId:d.id,nextStepId:u[0]},target:p.id,...of},...l.length?l.map((b,v)=>({id:`e${p.id}-${b}`,source:p.id,data:{previousStepId:d.id,nextStepId:u[v]},target:b,...of})):[]];return{nodes:m,edges:y,nextPrevNodeIds:[p.id],nextPrevStepIds:[d.id]}}if(e.type==="parallel"){let d=[],p=[],f=[];return e.steps.forEach((h,m)=>{const{nodes:y,edges:b,nextPrevStepIds:v}=Dre({stepFlow:h,xIndex:m,yIndex:r,prevNodeIds:n,prevStepIds:s,nextStepFlow:a,allPrevNodeIds:o}),S=y.map(w=>({...w,data:{...w.data,isParallel:!0}}));d.push(...S),p.push(...b),f.push(...v)}),{nodes:d,edges:p,nextPrevNodeIds:d.map(h=>h.id),nextPrevStepIds:f}}if(e.type==="conditional"){let d=[],p=[],f=[];return e.steps.forEach((h,m)=>{const{nodes:y,edges:b,nextPrevStepIds:v}=Dre({stepFlow:h,xIndex:m,yIndex:r,prevNodeIds:n,prevStepIds:s,nextStepFlow:a,condition:e.serializedConditions[m],allPrevNodeIds:o});d.push(...y),p.push(...b),f.push(...v)}),{nodes:d,edges:p,nextPrevNodeIds:d.filter(({type:h})=>h!=="condition-node").map(h=>h.id),nextPrevStepIds:f}}return{nodes:[],edges:[],nextPrevNodeIds:[],nextPrevStepIds:[]}},Ept=({stepGraph:e})=>{if(!e)return{nodes:[],edges:[]};if(e.length===0)return{nodes:[],edges:[]};let t=[],r=[],n=[],s=[],a=[];for(let l=0;l<e.length;l++){const{nodes:u,edges:d,nextPrevNodeIds:p,nextPrevStepIds:f}=Dre({stepFlow:e[l],xIndex:l,yIndex:l,prevNodeIds:n,prevStepIds:s,nextStepFlow:l===e.length-1?void 0:e[l+1],allPrevNodeIds:a});t.push(...u),r.push(...d),n=p,s=f,a.push(...n)}const{nodes:i,edges:o}=NJr(t,r);return{nodes:i,edges:o}},CO=$Cr,oS=Ee.forwardRef(({className:e,children:t,...r},n)=>c.jsx(jce,{ref:n,className:K("-outline-offset-2",Wr.colors,sx.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...r,children:t}));oS.displayName=jce.displayName;const lS=Ee.forwardRef(({className:e,children:t,...r},n)=>c.jsx(Pce,{ref:n,className:K("overflow-hidden","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-1","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-1","duration-normal ease-out-custom",e),...r,children:t}));lS.displayName=Pce.displayName;const Gi={sleep:"#A855F7",forEach:"#F97316",map:"#F97316",parallel:"#3B82F6",suspend:"#EC4899",after:"#14B8A6",workflow:"#8B5CF6",when:"#ECB047",dountil:"#8B5CF6",dowhile:"#06B6D4",until:"#F59E0B",while:"#10B981",if:"#3B82F6",else:"#6B7280"},Ao={sleep:y3,sleepUntil:$At,forEach:BE,map:BE,parallel:oze,suspend:QBe,after:fL,workflow:JBe,when:tze,dountil:vIt,dowhile:SIt,until:y3,while:nI,if:KBe,else:jDt},RPe=e=>{switch(e){case"when":return{icon:Ao.when,color:Gi.when};case"dountil":return{icon:Ao.dountil,color:Gi.dountil};case"dowhile":return{icon:Ao.dowhile,color:Gi.dowhile};case"until":return{icon:Ao.until,color:Gi.until};case"while":return{icon:Ao.while,color:Gi.while};case"if":return{icon:Ao.if,color:Gi.if};case"else":return{icon:Ao.else,color:Gi.else};default:return{icon:void 0,color:void 0}}},kpt=e=>{const t=!!(e.duration||e.date),r=!!e.isForEach,n=!!(e.mapConfig&&!e.isForEach),s=!!e.stepGraph,a=t||e.canSuspend||e.isParallel||r||n||s;return{isSleepNode:t,isForEachNode:r,isMapNode:n,isNestedWorkflow:s,hasSpecialBadge:a}},Opt=(e,{enabled:t=!0})=>{const r=E.useRef(t);Ee.useEffect(()=>{if(!t||!e?.current)return;const n=e.current,s=new MutationObserver(()=>{r.current&&n.scrollTo({top:n.scrollHeight,behavior:"smooth"})});s.observe(n,{childList:!0,subtree:!0,characterData:!0});const a=i=>{const o=i.target,l=o.scrollTop+o.clientHeight,u=o.scrollHeight;l>=u-1?r.current=!0:r.current=!1};return n.addEventListener("scroll",a),()=>{n.removeEventListener("scroll",a),s.disconnect()}},[t,e])},pi=E.forwardRef(({className:e,children:t,viewPortClassName:r,maxHeight:n,autoScroll:s=!1,...a},i)=>{const o=E.useRef(null);return Opt(o,{enabled:s}),c.jsxs(utt,{ref:i,className:K("relative overflow-hidden",e),...a,children:[c.jsx(ZCr,{ref:o,className:K("h-full w-full rounded-[inherit] [&>div]:!block",r),style:n?{maxHeight:n}:void 0,children:t}),c.jsx(_pt,{}),c.jsx(WCr,{})]})});pi.displayName=utt.displayName;const _pt=E.forwardRef(({className:e,orientation:t="vertical",...r},n)=>c.jsx(Lce,{ref:n,orientation:t,className:K("flex touch-none select-none transition-all duration-normal ease-out-custom","opacity-0 hover:opacity-100 data-[state=visible]:opacity-100",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...r,children:c.jsx(att,{className:"relative flex-1 rounded-full bg-neutral2 hover:bg-neutral3 transition-colors duration-normal"})}));_pt.displayName=Lce.displayName;const lj=()=>{const e=E.useContext(Fm),t=e.result?.steps??{};return{steps:Object.entries(t).reduce((n,[s,a])=>{const i="tripwire"in a&&a.tripwire;return{...n,[s]:{error:i?void 0:"error"in a?a.error:void 0,tripwire:i?a.tripwire:void 0,startedAt:a.startedAt,endedAt:"endedAt"in a?a.endedAt:void 0,status:a.status,output:"output"in a?a.output:void 0,input:a.payload,resumeData:"resumePayload"in a?a.resumePayload:void 0,suspendOutput:"suspendOutput"in a?a.suspendOutput:void 0,suspendPayload:"suspendPayload"in a?a.suspendPayload:void 0,foreachProgress:"foreachProgress"in a?a.foreachProgress:void 0}}},{}),runId:e.runId}},kw=({data:e,language:t="auto"})=>{const r=ax(),n=i=>{if(t==="javascript")return[H3(),mt.lineWrapping];if(t==="json")return[fd,mt.lineWrapping];try{return JSON.parse(i),[fd,mt.lineWrapping]}catch{return i.includes("=>")||i.includes("function")||i.includes("const ")||i.includes("return ")?[H3(),mt.lineWrapping]:[mt.lineWrapping]}};if(typeof e!="string"){const i=JSON.stringify(e,null,2);return c.jsxs("div",{className:"max-h-[500px] overflow-auto relative",children:[c.jsx("div",{className:"absolute right-2 top-2 bg-surface4 rounded-full z-10",children:c.jsx(ql,{content:i})}),c.jsx("div",{className:"bg-surface4 rounded-lg p-4",children:c.jsx(vd,{value:i,theme:r,extensions:[fd,mt.lineWrapping]})})]})}const s=n(e);let a=e;try{const i=JSON.parse(e);a=JSON.stringify(i,null,2)}catch{}return c.jsxs("div",{className:"max-h-[500px] overflow-auto relative",children:[c.jsx("div",{className:"absolute right-2 top-2 bg-surface4 rounded-full z-10",children:c.jsx(ql,{content:e})}),c.jsx("div",{className:"bg-surface4 rounded-lg p-4",children:c.jsx(vd,{value:a,theme:r,extensions:s})})]})},IJr=Ee.forwardRef(({children:e,...t},r)=>c.jsx("form",{ref:r,className:"space-y-4",...t,children:e})),jJr=["boolean","object","array"],RJr=({label:e,children:t,id:r,field:n,error:s})=>{const a=jJr.includes(n.type);return c.jsxs("div",{className:"pb-4 last:pb-0",children:[!a&&c.jsxs(ze,{as:"label",variant:"ui-sm",className:"text-neutral3 pb-1 block",htmlFor:r,children:[e,n.required&&c.jsx("span",{className:"text-accent2",children:" *"})]}),t,n.fieldConfig?.description&&c.jsx(ze,{as:"p",variant:"ui-sm",className:"text-neutral6",children:n.fieldConfig.description}),s&&c.jsx(ze,{as:"p",variant:"ui-sm",className:"text-accent2",children:s})]})},PJr=({error:e})=>c.jsx(Ep,{variant:"destructive",children:c.jsx(kp,{children:e})}),$Jr=({children:e})=>c.jsx(ye,{type:"submit",children:e}),PPe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,$Pe=Hdt,Vpe=(e,t)=>r=>{var n;if(t?.variants==null)return $Pe(e,r?.class,r?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(u=>{const d=r?.[u],p=a?.[u];if(d===null)return null;const f=PPe(d)||PPe(p);return s[u][f]}),o=r&&Object.entries(r).reduce((u,d)=>{let[p,f]=d;return f===void 0||(u[p]=f),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:p,className:f,...h}=d;return Object.entries(h).every(m=>{let[y,b]=m;return Array.isArray(b)?b.includes({...a,...o}[y]):{...a,...o}[y]===b})?[...u,p,f]:u},[]);return $Pe(e,i,l,r?.class,r?.className)},MJr=Vpe(K("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70",aj,sh),{variants:{variant:{default:"border border-border1 hover:border-border2",filled:"border bg-surface2 border-border1 hover:border-border2",unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${oi.sm} px-2 text-ui-sm`,md:`${oi.md} px-3 text-ui-sm`,lg:`${oi.lg} px-4 text-ui-sm`}},defaultVariants:{variant:"default",size:"md"}}),qr=E.forwardRef(({className:e,size:t,testId:r,variant:n,type:s,error:a,...i},o)=>c.jsx("input",{type:s,className:K(MJr({variant:n,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:o,"aria-invalid":a,...i}));qr.displayName="Input";const LJr=({inputProps:e,error:t,field:r,id:n})=>{const{key:s,...a}=e;return c.jsx(qr,{id:n,className:t?"border-accent2":"",...a,defaultValue:r.default})},FJr=({inputProps:e,error:t,field:r,id:n})=>{const{key:s,...a}=e;return c.jsx(qr,{id:n,type:"number",className:t?"border-accent2":"",...a,defaultValue:r.default!==void 0?Number(r.default):void 0,onChange:i=>{const o=i.target.value;o!==""&&!isNaN(Number(o))&&a.onChange({target:{value:o,name:e.name}})},onBlur:i=>{const o=i.target.value;o!==""&&!isNaN(Number(o))&&a.onChange({target:{value:Number(o),name:e.name}})}})},Mp=E.forwardRef(({className:e,...t},r)=>c.jsx(Uce,{ref:r,className:K("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",Wr.all,"hover:border-neutral5 hover:shadow-md",sh,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:bg-accent1 data-[state=checked]:border-accent1 data-[state=checked]:text-surface1","data-[state=checked]:shadow-glow-accent1",e),...t,children:c.jsx(htt,{className:K("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:c.jsx(ya,{className:"h-3.5 w-3.5 stroke-[3]"})})}));Mp.displayName=Uce.displayName;const BJr=({field:e,label:t,id:r,inputProps:n,value:s})=>c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(Mp,{id:r,onCheckedChange:a=>{const i={target:{name:n.name,value:a}};n.onChange(i)},defaultChecked:e.default,disabled:n.disabled||n.readOnly}),c.jsxs(ze,{as:"label",variant:"ui-sm",className:"text-neutral3",htmlFor:r,children:[t,e.required&&c.jsx("span",{className:"text-accent2",children:" *"})]})]});function Cpt({className:e,classNames:t,showOutsideDays:r=!0,...n}){return c.jsx(BDr,{showOutsideDays:r,className:K("p-3",e),classNames:{months:"flex flex-col space-y-4 sm:space-y-0 ",month:"space-y-4 text-ui-sm ",caption:"flex justify-between pt-1 items-center pl-2",caption_label:"text-text font-medium ",nav:"flex items-center",nav_button_previous:K("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_next:K("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),dropdown_month:"w-full border-collapse space-y-1",weeknumber:"flex",day:K("relative p-0 text-center focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-surface5 [&:has([aria-selected].day-outside)]:bg-surface5/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md","h-8 w-8 p-0 hover:bg-lightGray-7/50 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"!bg-neutral6/50 !text-surface2 hover:bg-neutral6 rounded-md hover:text-surface2 focus:bg-neutral6 focus:text-surface2",day_today:"bg-neutral6/10 text-neutral5",day_outside:"day-outside text-neutral3 opacity-50 aria-selected:bg-surface5/50 aria-selected:text-neutral3 aria-selected:opacity-30",day_disabled:"text-neutral3 opacity-50",day_range_middle:"aria-selected:bg-surface5 aria-selected:text-neutral5",day_hidden:"invisible",head_cell:"text-ui-xs text-neutral3",...t},...n})}const qpe=gTt,Hpe=yTt,Q6=E.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>c.jsx(bTt,{children:c.jsx(dBe,{ref:s,align:t,sideOffset:r,className:K("z-50 w-72 rounded-md border border-border1 bg-surface3 text-neutral5 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e&&/\bp-\S+/.test(e)?!1:"p-4",e),...n})}));Q6.displayName=dBe.displayName;const Ro=pNr,Po=fNr,zJr={sm:`${oi.sm} px-2 text-ui-sm`,md:`${oi.md} px-3 text-ui-sm`,lg:`${oi.lg} px-3 text-ui-sm`,default:`${oi.default} text-ui-md`},go=E.forwardRef(({className:e,children:t,size:r="md",variant:n="default",...s},a)=>{const i=["experimental"].includes(n);return c.jsxs(urt,{ref:a,className:K("flex w-full items-center justify-between placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50",i?"bg-white/5 gap-[1em] text-white/70 ring-2 pl-[1.2em] pr-[.8em] ring-inset ring-white/10 font-light":"border border-border1 bg-transparent py-2 shadow-sm",i?"rounded":aj,i?"":sh,Wr.all,i?"":"hover:border-neutral2",zJr[r],e),...s,children:[t,c.jsx(hNr,{asChild:!0,children:c.jsx($a,{className:K("h-4 w-4 text-neutral3",Wr.colors)})})]})});go.displayName=urt.displayName;const yo=E.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>c.jsx(mNr,{children:c.jsx(drt,{ref:s,className:K("relative z-50 min-w-[8rem] max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-md border border-border1 bg-surface3 text-neutral5 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:c.jsx(gNr,{className:K("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));yo.displayName=drt.displayName;const Ms=E.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(prt,{ref:n,className:K("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",Wr.colors,"hover:bg-surface5 hover:text-neutral5","focus:bg-surface5 focus:text-neutral5","data-[state=checked]:bg-accent1Dark data-[state=checked]:text-accent1","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[c.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(bNr,{children:c.jsx(ya,{className:"h-4 w-4 text-accent1"})})}),c.jsx(yNr,{children:t})]}));Ms.displayName=prt.displayName;function OY({name:e,onChange:t,value:r,options:n,placeholder:s}){return c.jsxs(Ro,{name:e,onValueChange:t,value:r,children:[c.jsx(go,{children:c.jsx(Po,{placeholder:s||"Select..."})}),c.jsx(yo,{children:(n||[]).map((a,i)=>c.jsx(Ms,{value:`${i}`,children:c.jsx("div",{className:"flex items-center gap-2 [&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:text-neutral3",children:a})},a))})]})}const _Y=["12","1","2","3","4","5","6","7","8","9","10","11"],TP=["00","15","30","45","59"],AP=["AM","PM"];function UJr({defaultValue:e,onValueChange:t,className:r}){const[n,s]=E.useState("12"),[a,i]=E.useState("00"),[o,l]=E.useState("AM");E.useEffect(()=>{if(e){const f=/^(\d{1,2}):(\d{2})(?::\d{2})?\s*(AM|PM|am|pm)?$/,h=e.match(f);if(h){let m=parseInt(h[1],10);const y=parseInt(h[2],10),b=h[3]?.toUpperCase();m>=1&&m<=12&&y>=0&&y<=59&&(s(m.toString()),i(y===0?"00":y.toString()),l(b||"AM"))}}},[e]);const u=f=>{s(f),t(`${_Y[+f]}:${a} ${o}`.trim())},d=f=>{i(TP[+f]),t(`${n}:${TP[+f]} ${o}`.trim())},p=f=>{l(AP[+f]),t(`${n}:${a} ${AP[+f]}`.trim())};return c.jsxs("div",{className:K("flex gap-2 items-center",r),children:[c.jsx(OY,{name:"hour",value:_Y.indexOf(n).toString(),onChange:u,options:_Y}),":",c.jsx(OY,{name:"minute",value:TP.indexOf(a).toString(),onChange:d,options:TP}),c.jsx(OY,{name:"period",value:AP.indexOf(o).toString(),onChange:p,options:AP})]})}const VJr={sm:`${oi.sm} px-2`,md:`${oi.md} px-3`,lg:`${oi.lg} px-3 py-2`,default:`${oi.default} px-3`};function sy({name:e,value:t,label:r,labelIsHidden:n=!1,className:s,testId:a,required:i,disabled:o,helpMsg:l,error:u,errorMsg:d,size:p="lg",variant:f="default",...h}){const m=({children:b})=>n?c.jsx(Np,{children:b}):b,y=f==="experimental";return c.jsxs("div",{className:K("grid gap-2 text-neutral4",{"grid-rows-[auto_1fr]":!n&&!l,"grid-rows-[auto_1fr_auto]":!n&&l},s),children:[c.jsx(m,{children:c.jsxs("label",{htmlFor:`input-${e}`,className:K("text-ui-sm text-neutral3 flex justify-between items-center"),children:[r,i&&c.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}),c.jsx("input",{id:`input-${e}`,name:e,value:t,autoComplete:"off",className:K("flex grow items-center cursor-pointer text-ui-md leading-none",VJr[p],y?"text-neutral4 leading-[10] ring-2 ring-inset ring-white/20 bg-surface2 hover:ring-white/30 focus-visible:ring-accent1/60 px-[1em] rounded-lg transition-colors duration-200 ease-out-custom [&:-webkit-autofill]:bg-surface2":"text-neutral5 border border-border1 bg-transparent w-full",y?"focus-visible:outline-none":sh,y?"":aj,y?"placeholder:text-neutral2":"placeholder:text-neutral3 placeholder:text-ui-sm",{"cursor-not-allowed opacity-50":o,"border-red-800 focus:border-border1":!y&&(u||d)}),"data-testid":a,...h}),l&&c.jsx("p",{className:"text-neutral3 text-ui-sm",children:l}),d&&c.jsxs("p",{className:K("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[c.jsx(Pc,{})," ",d]})]})}function aN({onReset:e,variant:t,...r}){return c.jsxs("div",{className:K("relative group"),children:[c.jsx(sy,{labelIsHidden:!0,...r,className:K("[&>input]:pl-10 relative",{}),variant:t}),c.jsx(_m,{"aria-hidden":"true",className:"text-neutral4 opacity-50 group-has-[:focus]:opacity-100 absolute top-2 left-3 w-5 h-5"}),e&&r.value&&c.jsx(c.Fragment,{children:t==="experimental"?c.jsx(ye,{type:"button",onClick:e,variant:"standard",size:"sm",className:"absolute top-[50%] translate-y-[-50%] rounded-none right-[2px] w-[2rem] h-[calc(100%-4px)] px-0","aria-label":"Clear",children:c.jsx(Os,{})}):c.jsx("button",{type:"button",onClick:e,className:K("absolute top-1/2 right-2 -translate-y-1/2 p-1 rounded",Wr.all,"hover:bg-surface4","[&>svg]:transition-colors [&>svg]:duration-normal","[&:hover>svg]:text-neutral5"),children:c.jsx(Os,{className:"text-neutral3 w-[1rem] h-[1rem]"})})})]})}function jc({name:e,value:t,label:r,labelIsHidden:n=!1,className:s,required:a,disabled:i,helpMsg:o,options:l,onValueChange:u,placeholder:d="Select an option",size:p="lg",variant:f="default"}){const h=({children:m})=>n?c.jsx(Np,{children:m}):m;return c.jsxs("div",{className:K("flex gap-2 items-center",{"grid-rows-[auto_1fr]":r,"grid-rows-[auto_1fr_auto]":o},s),children:[c.jsx(h,{children:c.jsxs("label",{className:K("text-ui-sm text-neutral3 flex justify-between items-center shrink-0"),children:[r,a&&c.jsx("i",{className:"text-neutral2",children:"(required)"})]})}),c.jsxs(Ro,{name:e,value:t,onValueChange:u,disabled:i,children:[c.jsx(go,{id:`select-${e}`,size:p,variant:f,className:"grid grid-cols-[1fr_auto] [&>span]:truncate",children:c.jsx(Po,{placeholder:d})}),c.jsx(yo,{children:l.map(m=>c.jsx(Ms,{value:m.value,disabled:m.disabled,children:c.jsxs("span",{className:"whitespace-nowrap truncate flex items-center gap-2",children:[m.icon,m.label]})},m.value))})]}),o&&c.jsx("p",{className:"text-neutral3 text-ui-sm",children:o})]})}const MPe=({value:e,minValue:t,maxValue:r,defaultTimeStrValue:n,onValueChange:s,children:a,className:i,placeholder:o,...l})=>{const[u,d]=E.useState(!1);return c.jsxs(qpe,{open:u,onOpenChange:d,children:[c.jsx(Hpe,{asChild:!0,children:a||c.jsx(HJr,{value:e,placeholder:o,className:i,"data-testid":"datepicker-button"})}),c.jsx(Q6,{className:"backdrop-blur-4xl w-auto !p-0 bg-surface4 max-w-[16.5rem]",align:"start","data-testid":"datepicker-calendar",children:c.jsx(qJr,{value:e,minValue:t,maxValue:r,onValueChange:s,setOpenPopover:d,defaultTimeStrValue:n,...l})})]})};function DP({date:e,timeStr:t=""}){if(!Lb(e))return null;if(t){const r=vn(e,"yyyy-MM-dd"),n=new Date(`${r} ${t}`);if(Lb(n))return n}return e}const qJr=({value:e,minValue:t,maxValue:r,onValueChange:n,setOpenPopover:s,placeholder:a,className:i,defaultTimeStrValue:o,...l})=>{const[u,d]=E.useState(null),[p,f]=E.useState(e?vn(DP({date:e,timeStr:o})||"","PP p"):""),[h,m]=E.useState(o||""),[y,b]=E.useState(e?new Date(e):void 0),v=$I(F=>{Lb(F)&&(b(F),n?.(F),s?.(!1))},500),S=F=>{f(F.currentTarget.value);const M=new Date(F.currentTarget.value);v(M)},w=F=>{Lb(F)?r&&F>r?(d(`The selected date should be before ${vn(r,"PP p")}`),f("")):t&&F<t?(d(`The selected date should be after ${vn(t,"PP p")}`),f("")):(f(vn(F,"PP p")),d("")):(f(""),d(""))},k=new Date(p),_=Lb(k),C=_&&k.getTime()!==e?.getTime(),T=F=>{if(b(F),F){const M=DP({date:F,timeStr:h});w(M||"")}else w("")},A=F=>{if(b(F),F){const M=DP({date:F,timeStr:h});w(M||"")}else w("")},N=F=>{if(m(F),_){const M=DP({date:k,timeStr:F});w(M||"")}},j=()=>{s?.(!1)},R=()=>{Lb(k)&&n(k),s?.(!1)},L=()=>{n(void 0),b(void 0),f(""),m(""),s?.(!1)};return c.jsxs("div",{"aria-label":"Choose date",className:K("relative flex flex-col",i),onKeyDown:F=>{F.stopPropagation(),F.key==="Escape"&&s?.(!1)},children:[c.jsx(sy,{type:"text",value:p,onChange:S,placeholder:a,className:"m-4 mb-0 !w-auto"}),u&&c.jsxs("div",{className:K("text-ui-md m-4 mb-0 text-neutral3","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mt-0.5 [&>svg]:text-red-500 [&>svg]:float-left [&>svg]:mr-2"),children:[c.jsx(Xh,{})," ",u]}),c.jsx(Cpt,{mode:"single",month:y,selected:y,onMonthChange:A,onSelect:T,...l}),c.jsx(UJr,{onValueChange:N,className:"m-4 mt-0 w-auto",defaultValue:e?vn(new Date(e),"hh:mm a"):o}),c.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-2 m-4 mt-0",children:[c.jsx(ye,{variant:"light",size:"lg",tabIndex:0,onClick:()=>{_?R():j()},children:C?"Apply":"Cancel"}),C&&c.jsx(ye,{tabIndex:0,onClick:L,children:"Clear"})]})]})},HJr=E.forwardRef(({value:e,placeholder:t,className:r,...n},s)=>c.jsxs(ye,{ref:s,className:K("justify-start",r),variant:"light",size:"lg",...n,children:[c.jsx(oie,{className:"h-4 w-4"}),e?c.jsx("span",{className:"text-white",children:vn(e,"PP p")}):c.jsx("span",{className:"text-gray",children:t??"Pick a date"})]})),QJr=({inputProps:e,field:t,error:r,id:n})=>{const{key:s,...a}=e,[i,o]=E.useState(void 0),[l,u]=E.useState(!1);E.useEffect(()=>{if(t.default){const f=new Date(t.default);Lb(f)&&o(f)}},[t]);const d=f=>{o(f),f&&a.onChange({target:{value:f.toISOString(),name:e.name}}),u(!1)},p=()=>{o(void 0),a.onChange({target:{value:"",name:e.name}}),u(!1)};return c.jsxs(qpe,{open:l,onOpenChange:u,children:[c.jsx(Hpe,{asChild:!0,children:c.jsxs(ye,{id:n,variant:"light",size:"lg",className:K("w-full",r?"border-accent2":""),children:[c.jsx(oie,{className:"h-4 w-4"}),i?c.jsx("span",{className:"text-white",children:vn(i,"PPP")}):c.jsx("span",{className:"text-gray",children:"Pick a date"})]})}),c.jsxs(Q6,{className:"w-auto p-0 bg-surface4",align:"start",children:[c.jsx(Cpt,{mode:"single",selected:i,onSelect:d,month:i,onMonthChange:o}),i&&c.jsx("div",{className:"p-3 pt-0",children:c.jsx(ye,{variant:"light",size:"lg",className:"w-full",onClick:p,children:"Clear"})})]})]})},GJr=({field:e,inputProps:t,error:r,id:n,value:s})=>{const{key:a,...i}=t;return c.jsxs(Ro,{...i,value:s,onValueChange:o=>{const l={target:{value:o,name:t.name}};i.onChange(l)},children:[c.jsx(go,{id:n,className:r?"border-accent2":"",children:c.jsx(Po,{placeholder:"Select an option"})}),c.jsx(yo,{children:(e.options||[]).map(([o,l])=>c.jsx(Ms,{value:o,children:l},o))})]})},ZJr=({label:e,children:t})=>{const r=e!==""&&e!=="",[n,s]=E.useState(!1);return c.jsxs("div",{className:"",children:[c.jsxs("div",{className:"flex items-center",children:[r&&c.jsxs(ze,{as:"h3",variant:"ui-sm",className:"text-neutral3 flex items-center gap-1 pb-2",children:[c.jsx(ve,{size:"sm",children:c.jsx(Dp,{})}),e]}),c.jsx(ye,{onClick:()=>s(!n),type:"button",className:"ml-auto px-1",size:"sm",children:c.jsx(ve,{size:"sm",children:c.jsx($a,{className:K("transition-all",n?"rotate-180":"rotate-0")})})})]}),n&&c.jsx("div",{className:r?"flex flex-col gap-1 [&>*]:border-dashed [&>*]:border-l [&>*]:border-l-border1 [&>*]:pl-4":"",children:t})]})},WJr=({label:e,children:t,onAddItem:r})=>c.jsxs("div",{children:[c.jsxs("div",{className:"flex gap-2 justify-between",children:[c.jsxs(ze,{as:"h3",variant:"ui-sm",className:"text-neutral3 pb-2 flex items-center gap-1",children:[c.jsx(ve,{size:"sm",children:c.jsx(NAt,{})}),e]}),c.jsx(nc,{children:c.jsxs(dn,{delayDuration:0,children:[c.jsx(pn,{asChild:!0,children:c.jsx("button",{onClick:r,type:"button",className:"text-neutral3 bg-surface3 rounded-md p-1 hover:bg-surface4 hover:text-neutral6 h-icon-sm w-icon-sm",children:c.jsx(ve,{size:"sm",children:c.jsx(Qs,{})})})}),c.jsx(sn,{children:"Add item"})]})})]}),c.jsx("div",{className:"flex flex-col gap-1",children:t})]}),XJr=({children:e,onRemove:t})=>c.jsxs("div",{className:"pl-4 border-l border-border1",children:[e,c.jsxs(ye,{onClick:t,type:"button",children:[c.jsx(ve,{size:"sm",children:c.jsx(mie,{})}),"Delete"]})]}),YJr=({inputProps:e,field:t,error:r,id:n})=>{const{key:s,onChange:a,...i}=e,[o,l]=E.useState(()=>Object.entries(t.default||{}).map(([m,y])=>({id:m||No(),key:m,value:y})));E.useEffect(()=>{o.length===0&&l([{id:No(),key:"",value:""}])},[o]);const u=E.useCallback(m=>{const y=m.reduce((b,v)=>(v.key&&(b[v.key]=v.value),b),{});a?.({target:{value:y,name:e.name}})},[a,e.name]),d=(m,y,b)=>{l(v=>v.map(S=>S.id===m?{...S,[y]:b}:S))},p=()=>{u(o)},f=()=>{const m=[...o,{id:No(),key:"",value:""}];l(m),u(m)},h=m=>{const y=o.filter(b=>b.id!==m);y.length===0&&y.push({id:No(),key:"",value:""}),l(y),u(y)};return c.jsxs("div",{className:"space-y-3",children:[o.map(m=>c.jsxs("div",{className:"relative space-y-2 rounded-lg border p-4",children:[c.jsx(ye,{type:"button",className:"absolute right-2 top-2",onClick:()=>h(m.id),children:c.jsx(mie,{className:"h-4 w-4"})}),c.jsxs("div",{className:"space-y-2 pt-6",children:[c.jsx(qr,{placeholder:"Key",value:m.key,onChange:y=>d(m.id,"key",y.target.value),onBlur:p}),c.jsx(qr,{placeholder:"Value",value:m.value,onChange:y=>d(m.id,"value",y.target.value),onBlur:p})]})]},m.id)),c.jsxs(ye,{type:"button",className:"w-full",onClick:f,children:[c.jsx(Qs,{className:"mr-2 h-4 w-4"}),"Add Key-Value Pair"]})]})},KJr=({field:e,path:t})=>{const{uiComponents:r}=cue();return c.jsx(r.ObjectWrapper,{label:YM(e),field:e,children:Object.entries(e.schema).map(([n,s])=>c.jsx(I0,{field:s,path:[...t,s.key]},`${t.join(".")}.${s.key}`))})},JJr=({field:e,path:t})=>{const{uiComponents:r}=cue(),{control:n}=H1(),{fields:s,append:a,remove:i}=FNr({control:n,name:t.join(".")}),o=e.schema?.[0]?.type;let l;return o==="object"?l={}:o==="array"?l=[]:l=null,c.jsx(r.ArrayWrapper,{label:YM(e),field:e,onAddItem:()=>a(l),children:s.map((u,d)=>c.jsx(r.ArrayElementWrapper,{onRemove:()=>i(d),index:d,children:c.jsx(I0,{field:e.schema[0],path:[...t,d.toString()]})},u.id))})},I0=({field:e,path:t})=>{const{formComponents:r,uiComponents:n}=cue(),{register:s,formState:{errors:a},getValues:i}=H1(),o=t.join("."),l=bIr(a,t)?.message,u=i(o),d=e.fieldConfig?.fieldWrapper||n.FieldWrapper;let p=()=>c.jsx(n.ErrorMessage,{error:`[AutoForm Configuration Error] No component found for type "${e.type}" nor a fallback`});return e.type==="array"?p=JJr:e.type==="object"?p=KJr:e.type in r?p=r[e.type]:"fallback"in r&&(p=r.fallback),c.jsx(d,{label:YM(e),error:l,id:o,field:e,children:c.jsx(p,{label:YM(e),field:e,value:u,error:l,id:o,path:t,inputProps:{required:e.required,error:l,key:`${o}-input`,...e.fieldConfig?.inputProps,...s(o)}},o)})},een=({field:e,inputProps:t})=>{const r=t.name?.split(".")??[];return e.schema?.map((n,s)=>c.jsxs("div",{children:[c.jsx(I0,{field:n,path:r},r.join(".")),s<(e.schema?.length??0)-1&&c.jsx(ze,{variant:"ui-xs",className:"text-center",children:"OR"})]},n.key))},ten=({field:e,path:t})=>{const{watch:r}=H1(),n=t.join("."),s=r(n),i=(e.schema?.flatMap(f=>f.schema||[])||[])?.filter(f=>f.fieldConfig?.customData?.isLiteral)||[],o=i[0],l=i?.reduce((f,h)=>{const m=(h.fieldConfig?.customData?.literalValues??[]).map(y=>[y,y]);return f.options?.push(...m),f},{key:o.key,required:o.required,type:"select",default:o.default,description:o.description,options:[],fieldConfig:o.fieldConfig}),u=e.schema?.reduce((f,h)=>{const m=h.schema?.find(v=>v.fieldConfig?.customData?.isLiteral),y=m?.fieldConfig?.customData?.literalValues?.[0],b=h.schema?.filter(v=>v.key!==m?.key)??[];return y&&(f[y]=b),f},{}),d=e.schema?.filter(f=>!f.schema?.find(m=>m.fieldConfig?.customData?.isLiteral)),p=s?.[l.key];return c.jsxs("div",{children:[c.jsx(I0,{field:l,path:[...t,l.key]},`${n}.${l.key}`),p&&u?.[p]&&u[p].map(f=>c.jsx(I0,{field:f,path:[...t,f.key]},`${n}.${f.key}`)),d&&d.map(f=>c.jsx(I0,{field:f,path:[...t,f.key]},`${n}.${f.key}`))]},e.key)};function O4(e){const t={};for(const r in e){const n=e[r];if(![null,void 0,"",[],{}].includes(n))if(Array.isArray(n)){const a=n.map(i=>{if(typeof i=="object"){const o=O4(i);return Object.keys(o).length>0?o:null}return i}).filter(i=>i!==null);a.length>0&&(t[r]=a)}else if(typeof n=="object"){const s=O4(n);Object.keys(s).length>0&&(t[r]=s)}else t[r]=n}return t}function vm(e){return Function("z",`"use strict";return (${e});`)($Et)}function ren({schema:e,onSubmit:t=()=>{},defaultValues:r,values:n,children:s,uiComponents:a,formComponents:i,withSubmit:o=!1,onFormInit:l=()=>{},formProps:u={}}){const d=E.useMemo(()=>zNr(e),[e]),p=zI({defaultValues:{...UNr(e),...r},values:n});E.useEffect(()=>{l&&l(p)},[l,p]);const f=E.useCallback(async m=>{const y=O4(m),b=e.validateSchema(y);if(b.success)await t(b.data,p);else{p.clearErrors();let v=!1;b.errors?.forEach(S=>{const w=S.path.join(".");p.setError(w,{type:"custom",message:S.message},{shouldFocus:!v}),v=!0;const k=S.path?.slice?.(0,-1);k?.length>0&&p.setError(k.join("."),{type:"custom",message:S.message})})}},[e,t,p]),h=E.useMemo(()=>({schema:d,uiComponents:a,formComponents:i}),[d,a,i]);return c.jsx(SNr,{...p,children:c.jsx(YNr,{value:h,children:c.jsxs(a.Form,{onSubmit:p.handleSubmit(f),...u,children:[d.fields.map(m=>c.jsx(I0,{field:m,path:[m.key]},m.key)),s,o&&c.jsx(a.SubmitButton,{children:"Submit"})]})})})}const nen={Form:IJr,FieldWrapper:RJr,ErrorMessage:PJr,SubmitButton:$Jr,ObjectWrapper:ZJr,ArrayWrapper:WJr,ArrayElementWrapper:XJr};function sen({uiComponents:e,formComponents:t,readOnly:r,...n}){const s=E.useMemo(()=>({...nen,...e}),[e]),a=E.useMemo(()=>{const i=o=>r===void 0?o:{...o,readOnly:r};return{string:o=>c.jsx(LJr,{...o,inputProps:i(o.inputProps)}),number:o=>c.jsx(FJr,{...o,inputProps:i(o.inputProps)}),boolean:o=>c.jsx(BJr,{...o,inputProps:i(o.inputProps)}),date:o=>c.jsx(QJr,{...o,inputProps:i(o.inputProps)}),select:o=>c.jsx(GJr,{...o,inputProps:i(o.inputProps)}),record:o=>c.jsx(YJr,{...o,inputProps:i(o.inputProps)}),union:o=>c.jsx(een,{...o,inputProps:i(o.inputProps)}),"discriminated-union":o=>c.jsx(ten,{...o,inputProps:i(o.inputProps)}),...t}},[r,t]);return c.jsx(ren,{...n,uiComponents:s,formComponents:a})}const aen=Vpe("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Bt=E.forwardRef(({className:e,...t},r)=>c.jsx(Urt,{ref:r,className:K(aen(),e),...t}));Bt.displayName=Urt.displayName;function Tpt(e){return e!=null&&typeof e=="object"&&"_zod"in e}function Kl(e){if(!(e==null||typeof e!="object"))return Tpt(e)?e._zod.def:e._def}function ien(e){return typeof e.isOptional=="function"?e.isOptional():typeof e.safeParse=="function"?e.safeParse(void 0).success:!1}function Rf(e){if(e.shape&&typeof e.shape=="object")return e.shape;const t=Kl(e);if(t?.shape)return typeof t.shape=="function"?t.shape():t.shape}function Nre(e){const t=Kl(e);return t?"innerType"in t?Nre(t.innerType):"schema"in t?Nre(t.schema):e:e}function oen(e){const t=Kl(e);if(t?.entries)return t.entries;if(t?.values)return t.values}function len(e){const t=Kl(e);return t?.element??t?.type}function Apt(e){const t=Kl(e);if(t?.values!==void 0)return Array.isArray(t.values)?t.values[0]:t.values;if(t?.value!==void 0)return t.value}function cen(e){const t=Kl(e);if(t?.values!==void 0)return t.values;if(t?.value!==void 0)return[t.value]}function uen(e){const t=Kl(e);if(t?.defaultValue!==void 0)return typeof t.defaultValue=="function"?t.defaultValue():t.defaultValue}function Dpt(e){return Kl(e)?.options}function Ire(e){const t=Kl(e);if(t?.left&&t?.right)return{left:t.left,right:t.right};if(e.def?.left&&e.def?.right)return{left:e.def.left,right:e.def.right}}function den(e){return Kl(e)?.checks??[]}function pen(e){return e.some(t=>{if(Tpt(t)){const r=Kl(t);return r?.check==="string_format"&&r?.format==="datetime"}return t.kind==="datetime"})}function fen(e,t){if(t?.fieldType)return t.fieldType;const r=e?.constructor?.name?.slice(1),n=Kl(e),s=typeof n?.type=="string"?`Zod${n.type.charAt(0).toUpperCase()}${n.type.slice(1)}`:void 0,a=n?.typeName??s??r;if(a==="ZodObject"||a==="ZodIntersection")return"object";if(a==="ZodNumber")return"number";if(a==="ZodBoolean")return"boolean";if(a==="ZodString"){const i=den(e);return pen(i)?"date":"string"}if(a==="ZodEnum"||a==="ZodNativeEnum")return"select";if(a==="ZodArray")return"array";if(a==="ZodRecord")return"record";if(a==="ZodUnion"){const i=Dpt(e);return i&&i.every(l=>{const u=Rf(l);return u?Object.values(u).some(d=>{const p=d?.constructor?.name?.slice(1),f=Kl(d);return p==="ZodLiteral"||f?.typeName==="ZodLiteral"||f?.type==="literal"}):!1})?"discriminated-union":"union"}if(a==="ZodDiscriminatedUnion")return"discriminated-union";if(a==="ZodLiteral"){const i=Apt(e);return typeof i=="number"?"number":typeof i=="boolean"?"boolean":"string"}return"string"}function Uw(e){const t=Kl(e);if(!t)return;const r=uen(e);if(r!==void 0)return r;const n=Apt(e);if(n!==void 0&&(t.typeName==="ZodLiteral"||t.type==="literal"||e?.constructor?.name?.slice(1)==="ZodLiteral"))return n;if("innerType"in t)return Uw(t.innerType);if("schema"in t)return Uw(t.schema);if(Rf(e)&&!("left"in t))return z$(e);if("left"in t&&"right"in t){const a=Rf(t.left),i=Rf(t.right),o=a?z$(t.left):Uw(t.left),l=i?z$(t.right):Uw(t.right);return{...o,...l}}}function z$(e){const t=Rf(e);if(!t)return{};const r={};for(const[n,s]of Object.entries(t)){const a=Uw(s);a!==void 0&&(r[n]=a)}return r}function jre(e){const t=Kl(e);if(t){if(t.typeName==="ZodEffects"&&t.effect?.type==="refinement"){const r=t.effect?.refinement;if(r){const n=Object.getOwnPropertySymbols(r);for(const s of n){const a=r[s];if(a&&typeof a=="object")return a}}}if("innerType"in t)return jre(t.innerType);if("schema"in t)return jre(t.schema)}}function vb(e,t){const r=Nre(t),n=jre(t);let s=fen(r,n);const a=Uw(t),i=oen(r);let o=[];i&&(Array.isArray(i)?o=i.map(v=>[v,v]):o=Object.entries(i));let l=[];const u=Rf(r);u&&!Ire(r)&&(l=Object.entries(u).map(([v,S])=>vb(v,S)));const d=Dpt(r),p=r?.constructor?.name?.slice(1),h=Kl(r)?.typeName??p;(h==="ZodUnion"||h==="ZodDiscriminatedUnion")&&d&&(l=Object.entries(d).map(([v,S])=>vb(v,S)));const m=Ire(r);if(m){const{left:v,right:S}=m;let w=[],k=[];const _=Rf(v);if(_)w=Object.entries(_).map(([T,A])=>vb(T,A));else{const T=vb(e,v);w=T.schema??[T],s=T.type}const C=Rf(S);if(C)k=Object.entries(C).map(([T,A])=>vb(T,A));else{const T=vb(e,S);k=T.schema??[T],s=T.type}l=[...w,...k]}if(h==="ZodArray"){const v=len(r);v&&(l=[vb("0",v)])}const y=h==="ZodLiteral",b=y?cen(r):void 0;return{key:e,type:s,required:!ien(t),default:a,description:r.description,fieldConfig:y||Object.keys(n??{})?.length>0?{...n,customData:{...n?.customData??{},...y?{isLiteral:y,literalValues:b}:{}}}:void 0,options:o,schema:l}}function hen(e){const t=Rf(e);return t?{fields:Object.entries(t).map(([n,s])=>vb(n,s))}:{fields:[]}}class men{_schema;constructor(t){if(!t)throw new Error("CustomZodProvider: schema is required");this._schema=t}getDefaultValues(){return z$(this._schema)}validateSchema(t){const r=O4(t);try{const n=this._schema.safeParse(r);if(n.success)return{success:!0,data:n.data};{const s=n.error;return{success:!1,errors:(s.issues??s.errors??[]).map(i=>({path:i.path,message:i.message}))}}}catch(n){throw n}}parseSchema(){return hen(this._schema)}}function Rre(e){const t=Rf(e);if(t)return Object.keys(t).length===0;const r=Ire(e);return r?Rre(r.left)&&Rre(r.right):!1}function gen(e){return Rf(e)!==void 0}function Qpe({schema:e,onSubmit:t,onValuesChange:r,defaultValues:n,isSubmitLoading:s,submitButtonLabel:a,className:i,readOnly:o,children:l}){const u=E.useRef(null),d=!gen(e),p=E.useRef(r);E.useEffect(()=>{p.current=r},[r]),E.useEffect(()=>()=>{u.current?.unsubscribe()},[]);const f=E.useCallback(w=>{u.current?.unsubscribe(),p.current&&(u.current=w.watch(k=>{const _=d?k&&Object.prototype.hasOwnProperty.call(k,"")?k[""]:{}:k;p.current?.(_)}))},[d]),h=E.useMemo(()=>{if(!e)return null;const w=k=>Rre(k)?Fn({}):d?Fn({"":k}):k;return new men(w(e))},[e,d]),m=E.useMemo(()=>({SubmitButton:({children:w})=>t?c.jsx(ye,{variant:"light",className:"w-full",size:"md",disabled:s,children:s?c.jsx(ve,{children:c.jsx(Ii,{className:"animate-spin"})}):a||w}):null}),[t,s,a]),y=E.useMemo(()=>({Label:({value:w})=>c.jsx(Bt,{className:"text-sm font-normal",children:w})}),[]),b=E.useMemo(()=>({className:i,noValidate:!0}),[i]),v=E.useMemo(()=>d?n===void 0?void 0:{"":n}:n,[d,n]),S=E.useCallback(async w=>{const k=d?w&&Object.prototype.hasOwnProperty.call(w,"")?w[""]:{}:w;await t?.(k)},[t,d]);return h?c.jsx(sen,{schema:h,onSubmit:S,onFormInit:f,defaultValues:v,formProps:b,uiComponents:m,formComponents:y,withSubmit:!0,readOnly:o,children:l}):(console.error("no form schema found"),null)}const cj=E.forwardRef(({className:e,...t},r)=>c.jsx(tnt,{className:K("grid gap-2",e),...t,ref:r}));cj.displayName=tnt.displayName;const ld=E.forwardRef(({className:e,...t},r)=>c.jsx(rnt,{ref:r,className:K("aspect-square h-4 w-4 rounded-full border border-neutral3 text-neutral6","shadow-sm",Wr.all,"hover:border-neutral5 hover:shadow-md",sh,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:border-accent1 data-[state=checked]:shadow-glow-accent1",e),...t,children:c.jsx(AIr,{className:K("flex items-center justify-center","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:c.jsx(ZBe,{className:"h-2 w-2 fill-accent1 text-accent1"})})}));ld.displayName=rnt.displayName;const Gpe=({schema:e,defaultValues:t,withoutSubmit:r,isSubmitLoading:n,submitButtonLabel:s,onSubmit:a,children:i,isProcessorWorkflow:o})=>{const[l,u]=E.useState(o?"simple":"form"),[d,p]=E.useState(!1);return E.useEffect(()=>{p(!0)},[]),d?c.jsxs("div",{children:[c.jsx(cj,{disabled:n,value:l,onValueChange:f=>u(f),className:"pb-4",children:c.jsxs("div",{className:"flex flex-row gap-4",children:[o&&c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(ld,{value:"simple",id:"simple"}),c.jsx(Bt,{htmlFor:"simple",className:"!text-neutral3 text-ui-sm",children:"Simple"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(ld,{value:"form",id:"form"}),c.jsx(Bt,{htmlFor:"form",className:"!text-neutral3 text-ui-sm",children:"Form"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(ld,{value:"json",id:"json"}),c.jsx(Bt,{htmlFor:"json",className:"!text-neutral3 text-ui-sm",children:"JSON"})]})]})}),c.jsx("div",{className:K({"opacity-50 pointer-events-none":n}),children:l==="simple"&&o?c.jsx(ben,{schema:e,defaultValues:t,isSubmitLoading:n,submitButtonLabel:s,onSubmit:a,withoutSubmit:r,children:i}):l==="form"?c.jsx(Qpe,{schema:e,defaultValues:t,isSubmitLoading:n,submitButtonLabel:s,onSubmit:r?void 0:a,children:i}):c.jsx(yen,{schema:e,defaultValues:t,isSubmitLoading:n,submitButtonLabel:s,onSubmit:a,withoutSubmit:r,children:i})})]}):null},yen=({schema:e,defaultValues:t,isSubmitLoading:r,submitButtonLabel:n,onSubmit:s,withoutSubmit:a,children:i})=>{const[o,l]=E.useState([]),[u,d]=E.useState(()=>JSON.stringify(t??{},null,2)),p=()=>{l([]);try{const h=e.safeParse(JSON.parse(u));h.success?s(h.data):l(h.error.issues.map(m=>`[${m.path.join(".")}] ${m.message}`))}catch{l(["Invalid JSON provided"])}};let f={};try{f=JSON.parse(u)}catch{f={}}return c.jsxs("div",{className:"flex flex-col gap-4",children:[o.length>0&&c.jsxs("div",{className:"border border-accent2 rounded-lg p-2",children:[c.jsxs(ze,{as:"p",variant:"ui-md",className:"text-accent2 font-semibold",children:[o.length," errors found"]}),c.jsx("ul",{className:"list-disc list-inside",children:o.map((h,m)=>c.jsx("li",{className:"text-ui-sm text-accent2",children:h},m))})]}),c.jsx(Wa,{data:f,onChange:d}),i,a?null:c.jsx(ye,{variant:"light",onClick:p,className:"w-full",size:"lg",children:r?c.jsx(Ii,{className:"animate-spin"}):n})]})},LPe=[{value:"input",label:"Input - Process input messages before LLM"},{value:"inputStep",label:"Input Step - Process at each agentic loop step"},{value:"outputStream",label:"Output Stream - Process streaming chunks"},{value:"outputResult",label:"Output Result - Process complete output"},{value:"outputStep",label:"Output Step - Process after each LLM response"}],ben=({schema:e,defaultValues:t,isSubmitLoading:r,submitButtonLabel:n,onSubmit:s,withoutSubmit:a,children:i})=>{const[o,l]=E.useState("Hello, this is a test message."),[u,d]=E.useState("input"),[p,f]=E.useState([]),h=()=>{f([]);const y=u==="outputStep"||u==="outputResult"?"assistant":"user",b={messages:[{id:crypto.randomUUID(),role:y,createdAt:new Date().toISOString(),content:{format:2,parts:[{type:"text",text:o}]}}],phase:u};try{const v=e.safeParse(b);v.success?s(v.data):f(v.error.issues.map(S=>`[${S.path.join(".")}] ${S.message}`))}catch{f(["Error processing input"])}};return c.jsxs("div",{className:"flex flex-col gap-4",children:[p.length>0&&c.jsxs("div",{className:"border border-accent2 rounded-lg p-2",children:[c.jsxs(ze,{as:"p",variant:"ui-md",className:"text-accent2 font-semibold",children:[p.length," errors found"]}),c.jsx("ul",{className:"list-disc list-inside",children:p.map((m,y)=>c.jsx("li",{className:"text-ui-sm text-accent2",children:m},y))})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ze,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Phase"}),c.jsxs(Ro,{value:u,onValueChange:d,children:[c.jsx(go,{className:"w-full",children:c.jsx(Po,{placeholder:"Select phase"})}),c.jsx(yo,{children:LPe.map(m=>c.jsx(Ms,{value:m.value,children:m.value},m.value))})]}),c.jsx(ze,{variant:"ui-xs",className:"text-neutral4",children:LPe.find(m=>m.value===u)?.label})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ze,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Test Message"}),c.jsx("textarea",{value:o,onChange:m=>l(m.target.value),placeholder:"Enter a test message...",rows:4,className:"w-full bg-transparent border border-border1 rounded-md p-3 text-ui-sm text-neutral6 placeholder:text-neutral3 focus:outline-none focus:ring-2 focus:ring-accent1"})]}),i,a?null:c.jsx(ye,{variant:"light",onClick:h,className:"w-full",size:"lg",children:r?c.jsx(Ii,{className:"animate-spin"}):n})]})},SE=async e=>await nnt.format(e,{semi:!1,parser:"json",printWidth:80,tabWidth:2,plugins:[sst,Bst]}),iN=e=>{try{const t=JSON.parse(e);return!!t&&typeof t=="object"}catch{return!1}},Zpe=E.createContext(null);function Wpe({children:e}){const{requestContext:t}=vs(),[r,n]=E.useState(t),s=i=>n(i),a=()=>{n({})};return c.jsx(Zpe.Provider,{value:{schemaValues:r,setSchemaValues:s,clearSchemaValues:a},children:e})}function Npt(){const e=E.useContext(Zpe);if(!e)throw new Error("useSchemaRequestContext must be used within a SchemaRequestContextProvider");return e}function Fc(){const{requestContext:e}=vs(),r=E.useContext(Zpe)?.schemaValues??{};return{...e??{},...r}}const pC="text-neutral3 hover:text-neutral6",FPe=e=>{try{return e==null?"{}":JSON.stringify(e,null,2)}catch{return"{}"}},CY=({label:e,value:t,onChange:r,helperText:n,exampleCode:s})=>{const a=ax(),{handleCopy:i}=Zf({text:t}),{handleCopy:o}=Zf({text:s??"{}"}),[l,u]=E.useState(null),[d,p]=E.useState(!1),[f,h]=E.useState(!1),m=async()=>{if(u(null),!t.trim()){r("{}");return}if(!iN(t)){u("Invalid JSON");return}try{const y=await SE(t);r(y)}catch{u("Unable to format JSON")}};return c.jsxs(c.Fragment,{children:[f&&c.jsxs("div",{className:"border border-border1 rounded-lg bg-surface3 p-3 space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(ze,{as:"p",variant:"ui-sm",className:"text-neutral3",children:["Example ",e]}),c.jsxs(dn,{children:[c.jsx(pn,{asChild:!0,children:c.jsx("button",{type:"button",onClick:o,className:pC,"aria-label":"Copy example JSON",children:c.jsx(ve,{children:c.jsx(Ql,{})})})}),c.jsx(sn,{children:"Copy example JSON"})]})]}),c.jsx(vd,{value:s,theme:a,extensions:[fd],className:"h-[150px] w-full overflow-y-scroll bg-surface3 rounded-lg overflow-scroll p-3"})]}),c.jsxs(CO,{className:"border border-border1 rounded-lg bg-surface3",open:d,onOpenChange:p,children:[c.jsxs("div",{className:"flex items-center justify-between w-full px-3",children:[c.jsxs("div",{children:[c.jsx(ze,{as:"label",variant:"ui-md",className:"text-neutral3",children:e}),n&&c.jsx(ze,{variant:"ui-xs",className:"text-neutral3",children:n})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(dn,{children:[c.jsx(pn,{asChild:!0,children:c.jsx("button",{type:"button",onClick:m,className:pC,"aria-label":"Format JSON",children:c.jsx(ve,{children:c.jsx(Dp,{})})})}),c.jsx(sn,{children:"Format JSON"})]}),c.jsxs(dn,{children:[c.jsx(pn,{asChild:!0,children:c.jsx("button",{type:"button",onClick:i,className:pC,"aria-label":"Copy JSON",children:c.jsx(ve,{children:c.jsx(Ql,{})})})}),c.jsx(sn,{children:"Copy JSON"})]}),s&&c.jsxs(dn,{children:[c.jsx(pn,{asChild:!0,children:c.jsx("button",{type:"button",onClick:()=>h(!f),className:pC,"aria-label":f?"Hide example JSON":"View example JSON",children:c.jsx(ve,{children:f?c.jsx(GDt,{}):c.jsx(bp,{})})})}),c.jsx(sn,{children:"View example JSON"})]}),c.jsx(oS,{asChild:!0,children:c.jsx("button",{type:"button",className:pC,"aria-label":d?`Collapse ${e}`:`Expand ${e}`,children:c.jsx(ve,{className:K("transition-transform",d?"rotate-0":"-rotate-90"),children:c.jsx($a,{})})})})]})]}),c.jsxs(lS,{className:"space-y-2",children:[c.jsx(vd,{value:t,onChange:r,theme:a,extensions:[fd],className:"h-[260px] overflow-y-scroll bg-surface3 rounded-lg overflow-hidden p-3"}),l&&c.jsx(ze,{variant:"ui-sm",className:"text-accent2",children:l})]})]})]})},TY=({stepKey:e,closeModal:t,isPerStepRun:r,isContinueRun:n,buttonText:s="Start time travel",inputData:a})=>{const{result:i,workflow:o,timeTravelWorkflowStream:l,runId:u,workflowId:d,setDebugMode:p}=E.useContext(Fm),f=Fc(),h=a?{payload:a}:i?.steps?.[e],[m,y]=E.useState(()=>"{}"),[b,v]=E.useState(()=>"{}"),[S,w]=E.useState(()=>"{}"),[k,_]=E.useState(null),[C,T]=E.useState(!1),A=o?.allSteps?.[e],{schema:N}=E.useMemo(()=>{if(!A?.inputSchema)return{schema:vc(Tr(),$0())};try{const R=Dv(A.inputSchema),L=o?.stateSchema?vm(fm(Dv(o.stateSchema))):null,F=vm(fm(R));return{schema:L?Fn({inputData:F,initialState:L.optional()}):F,schemaError:null}}catch(R){return console.error("Failed to parse step schema",R),{schema:vc(Tr(),$0())}}},[A?.inputSchema,o?.stateSchema]),j=async R=>{_(null),T(!0);try{const L=m.trim()?JSON.parse(m):{},F=b.trim()?JSON.parse(b):{},M=S.trim()?JSON.parse(S):{},{initialState:z,inputData:q}=R??{},Q=o?.stateSchema?q:R,V={runId:u,workflowId:d,step:e,inputData:Q,initialState:z,resumeData:Object.keys(L)?.length>0?L:void 0,context:Object.keys(F)?.length>0?F:void 0,nestedStepsContext:Object.keys(M)?.length>0?M:void 0,requestContext:f,...n?{perStep:!1}:{}};n&&p(!1),l(V),t()}catch(L){console.error("Invalid JSON provided",L),_(L instanceof Error?L.message:"Error time traveling workflow")}finally{T(!1)}};return c.jsx(nc,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(ze,{as:"p",variant:"ui-lg",className:"text-neutral3",children:"Input data"}),c.jsxs(ze,{variant:"ui-xs",className:"text-neutral3",children:["Step: ",e]})]}),c.jsx(Gpe,{schema:N,defaultValues:h?.payload,isSubmitLoading:C,submitButtonLabel:s,onSubmit:j,children:c.jsxs("div",{className:"space-y-4 pb-4",children:[r||n?null:c.jsxs(c.Fragment,{children:[c.jsx(CY,{label:"Resume Data (JSON)",value:m,onChange:y,helperText:"Provide any resume payloads that should be passed to the step."}),c.jsx(CY,{label:"Context (JSON)",value:b,onChange:v,helperText:"Only include top level steps (no nested workflow steps) that are required in the time travel execution.",exampleCode:FPe({stepId:{status:"success",payload:{value:"test value"},output:{value:"test output"}}})}),c.jsx(CY,{label:"Nested Step Context (JSON)",value:S,onChange:w,helperText:"Includes nested workflow steps that are required in the time travel execution.",exampleCode:FPe({nestedWorkflowId:{stepId:{status:"success",payload:{value:"test value"},output:{value:"test output"}}}})})]}),k&&c.jsx(ze,{variant:"ui-sm",className:"text-accent2",children:k})]})})]})})},Xpe=({input:e,output:t,resumeData:r,suspendOutput:n,error:s,tripwire:a,mapConfig:i,stepName:o,stepId:l,onShowNestedGraph:u,status:d,stepKey:p,stepsFlow:f})=>{const[h,m]=E.useState(!1),[y,b]=E.useState(!1),[v,S]=E.useState(!1),[w,k]=E.useState(!1),[_,C]=E.useState(!1),[T,A]=E.useState(!1),[N,j]=E.useState(!1),[R,L]=E.useState(!1),{withoutTimeTravel:F,debugMode:M,result:z,runSnapshot:q,timeTravelWorkflowStream:Q,runId:V,workflowId:Z,setDebugMode:$}=E.useContext(Fm),{showMapConfig:X,stepDetail:U,closeStepDetail:I}=H6(),H=Fc(),G=z?.status??q?.status,J="max-w-4xl w-full",ee=!F&&p&&!i&&G!=="running"&&G!=="paused",te=p&&M&&G==="paused",se=E.useMemo(()=>{if(!p||!te)return;const xe=f?.[p]??[];if(xe.length===0)return;if(xe.length>1)return{hasMultiSteps:!0,input:xe.reduce((Ce,oe)=>(z?.steps?.[oe]?.status==="success"&&(Ce[oe]=z?.steps?.[oe].output),Ce),{})};const Ie=xe[0];if(z?.steps?.[Ie]?.status==="success")return{hasMultiSteps:!1,input:z?.steps?.[Ie].output}},[p,f,te,z]),ce=te&&se&&!z?.steps[p],Se=U?.type==="map-config"&&U?.stepName===o,W=U?.type==="nested-graph"&&U?.stepName===o,ne="ring-2 ring-accent1 ring-offset-1 ring-offset-transparent",ae=()=>{Se?I():X({stepName:o,stepId:l,mapConfig:i})},ge=()=>{W?I():u?.()},le=xe=>{const Ie={runId:V,workflowId:Z,step:p,inputData:se?.hasMultiSteps?void 0:se?.input,requestContext:H,...xe?{perStep:!1}:{},...se?.hasMultiSteps?{context:Object.keys(se.input)?.reduce((Ce,oe)=>(Ce[oe]={output:se.input[oe]},Ce),{})}:{}};xe&&$(!1),Q(Ie)};return c.jsx(c.Fragment,{children:(e||t||s||a||i||r||u||ee||ce)&&c.jsxs("div",{className:K("flex flex-wrap items-center bg-surface4 border-t border-border1 px-2 py-1 gap-2 rounded-b-lg",d==="success"&&"bg-accent1Dark",d==="failed"&&"bg-accent2Dark",d==="tripwire"&&"bg-amber-900/40 border-amber-500/20",d==="suspended"&&"bg-accent3Dark",d==="waiting"&&"bg-accent5Dark",d==="running"&&"bg-accent6Dark"),children:[u&&c.jsx(ye,{onClick:ge,className:K(W&&ne),size:"sm",children:"View nested graph"}),ee&&c.jsxs(c.Fragment,{children:[c.jsx(ye,{onClick:()=>A(!0),size:"sm",children:"Time travel"}),c.jsx(ea,{open:T,onOpenChange:A,children:c.jsxs(Ls,{className:J,children:[c.jsxs(ta,{children:[c.jsxs(Fs,{children:["Time travel to ",p]}),c.jsx(ni,{children:"Time travel to a specific workflow step"})]}),c.jsx(ra,{className:"max-h-[600px]",children:c.jsx(TY,{stepKey:p,closeModal:()=>A(!1)})})]})})]}),ce&&c.jsxs(c.Fragment,{children:[c.jsx(ye,{onClick:()=>{i?le():L(!0)},size:"sm",children:"Run step"}),c.jsx(ea,{open:R,onOpenChange:L,children:c.jsxs(Ls,{className:J,children:[c.jsxs(ta,{children:[c.jsxs(Fs,{children:["Run step ",p]}),c.jsx(ni,{children:"Run a specific workflow step"})]}),c.jsx(ra,{className:"max-h-[600px]",children:c.jsx(TY,{stepKey:p,closeModal:()=>L(!1),isPerStepRun:!0,buttonText:"Run step",inputData:se?.input})})]})}),c.jsx(ye,{onClick:()=>{i?le(!0):j(!0)},size:"sm",children:"Continue run"}),c.jsx(ea,{open:N,onOpenChange:j,children:c.jsxs(Ls,{className:J,children:[c.jsxs(ta,{children:[c.jsxs(Fs,{children:["Continue run ",p]}),c.jsx(ni,{children:"Continue the workflow run from this step"})]}),c.jsx(ra,{className:"max-h-[600px]",children:c.jsx(TY,{stepKey:p,closeModal:()=>j(!1),isContinueRun:!0,buttonText:"Continue run",inputData:se?.input})})]})})]}),i&&c.jsx(ye,{onClick:ae,className:K(Se&&ne),size:"sm",children:"Map config"}),e&&c.jsxs(c.Fragment,{children:[c.jsx(ye,{onClick:()=>m(!0),size:"sm",children:"Input"}),c.jsx(ea,{open:h,onOpenChange:m,children:c.jsxs(Ls,{className:J,children:[c.jsxs(ta,{children:[c.jsxs(Fs,{children:[o," input"]}),c.jsx(ni,{children:"View the input data for this step"})]}),c.jsx(ra,{children:c.jsx(kw,{data:e})})]})})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx(ye,{onClick:()=>S(!0),size:"sm",children:"Resume data"}),c.jsx(ea,{open:v,onOpenChange:S,children:c.jsxs(Ls,{className:J,children:[c.jsxs(ta,{children:[c.jsxs(Fs,{children:[o," resume data"]}),c.jsx(ni,{children:"View the resume data for this step"})]}),c.jsx(ra,{children:c.jsx(kw,{data:r})})]})})]}),(t??n)&&c.jsxs(c.Fragment,{children:[c.jsx(ye,{onClick:()=>b(!0),size:"sm",children:"Output"}),c.jsx(ea,{open:y,onOpenChange:b,children:c.jsxs(Ls,{className:J,children:[c.jsxs(ta,{children:[c.jsxs(Fs,{children:[o," output"]}),c.jsx(ni,{children:"View the output data for this step"})]}),c.jsx(ra,{children:c.jsx(kw,{data:t??n})})]})})]}),s&&c.jsxs(c.Fragment,{children:[c.jsx(ye,{onClick:()=>k(!0),size:"sm",children:"Error"}),c.jsx(ea,{open:w,onOpenChange:k,children:c.jsxs(Ls,{className:J,children:[c.jsxs(ta,{children:[c.jsxs(Fs,{children:[o," error"]}),c.jsx(ni,{children:"View the error details for this step"})]}),c.jsx(ra,{children:c.jsx(kw,{data:s})})]})})]}),a&&c.jsxs(c.Fragment,{children:[c.jsx(ye,{onClick:()=>C(!0),className:"text-amber-400 hover:text-amber-300",size:"sm",children:"Tripwire"}),c.jsx(ea,{open:_,onOpenChange:C,children:c.jsxs(Ls,{className:J,children:[c.jsxs(ta,{children:[c.jsxs(Fs,{children:[o," tripwire"]}),c.jsx(ni,{children:"View the tripwire details for this step"})]}),c.jsx(ra,{children:c.jsx(kw,{data:{reason:a.reason,retry:a.retry,metadata:a.metadata,processorId:a.processorId}})})]})})]})]})})};function Ipt({data:e}){const{conditions:t,previousStepId:r,nextStepId:n,withoutTopHandle:s}=e,[a,i]=E.useState(!0),[o,l]=E.useState(!1),u=t[0]?.type,d=(t.some(S=>S.fnString)||t?.length>1)&&u!=="else",{steps:p}=lj(),f=p[r],h=p[n],m=f?.status==="failed"&&f?.tripwire!==void 0,y=m?"tripwire":f?.status,{icon:b,color:v}=RPe(u);return c.jsxs(c.Fragment,{children:[!s&&c.jsx(Eu,{type:"target",position:Er.Top,style:{visibility:"hidden"}}),c.jsxs("div",{"data-workflow-node":!0,"data-workflow-step-status":y,"data-testid":"workflow-condition-node",className:K("bg-surface3 rounded-lg w-[300px] border border-border1",y==="success"&&h&&"bg-accent1Darker",y==="failed"&&h&&"bg-accent2Darker",y==="tripwire"&&h&&"bg-amber-950/40 border-amber-500/30",!f&&!!h?.status&&"bg-accent1Darker"),children:[c.jsxs(CO,{open:d?a:!0,onOpenChange:S=>{d&&i(S)},children:[c.jsxs(oS,{className:"flex items-center justify-between w-full px-3 py-2",children:[c.jsx(Ft,{icon:b?c.jsx(b,{className:"text-current",...v?{style:{color:v}}:{}}):null,children:u?.toUpperCase()}),d&&c.jsx(ve,{children:c.jsx($a,{className:K("transition-transform text-neutral3",{"transform rotate-180":a})})})]}),u==="else"?null:c.jsx(lS,{className:"flex flex-col gap-2 pb-2",children:t.map((S,w)=>{const k=S.conj||u,{icon:_,color:C}=RPe(k),T=w===0?null:c.jsx(Ft,{icon:_?c.jsx(_,{className:"text-current",...C?{style:{color:C}}:{}}):null,children:S.conj?.toLocaleUpperCase()||"WHEN"});return S.fnString?c.jsxs("div",{className:"px-3",children:[c.jsx(INe,{theme:ste.oneDark,code:String(S.fnString).trim(),language:"javascript",children:({className:A,style:N,tokens:j,getLineProps:R,getTokenProps:L})=>c.jsx("pre",{className:K("relative font-mono p-3 w-full cursor-pointer rounded-lg text-xs !bg-surface4 whitespace-pre-wrap break-words",A,y==="success"&&h&&"!bg-accent1Dark",y==="failed"&&h&&"!bg-accent2Dark",y==="tripwire"&&h&&"!bg-amber-900/40"),onClick:()=>l(!0),style:N,children:j.map((F,M)=>c.jsxs("div",{...R({line:F}),children:[c.jsx("span",{className:"inline-block mr-2 text-neutral3",children:M+1}),F.map((z,q)=>c.jsx("span",{...L({token:z})},q))]},M))})}),c.jsx(ea,{open:o,onOpenChange:l,children:c.jsxs(Ls,{className:"max-w-[30rem]",children:[c.jsxs(ta,{children:[c.jsx(Fs,{className:"sr-only",children:"Condition Function"}),c.jsx(ni,{children:"View the condition function code"})]}),c.jsx(ra,{children:c.jsx(pi,{className:"w-full",maxHeight:"400px",children:c.jsx(INe,{theme:ste.oneDark,code:String(S.fnString).trim(),language:"javascript",children:({className:A,style:N,tokens:j,getLineProps:R,getTokenProps:L})=>c.jsx("pre",{className:`${A} relative font-mono text-sm overflow-x-auto p-3 w-full rounded-lg mt-2 dark:bg-zinc-800`,style:{...N,backgroundColor:"#121212",padding:"0 0.75rem 0 0"},children:j.map((F,M)=>c.jsxs("div",{...R({line:F}),children:[c.jsx("span",{className:"inline-block mr-2 text-neutral3",children:M+1}),F.map((z,q)=>c.jsx("span",{...L({token:z})},q))]},M))})})})})]})})]},`${S.fnString}-${w}`):c.jsx(E.Fragment,{children:S.ref?.step?c.jsxs("div",{className:"flex items-center gap-1",children:[T,c.jsxs(ze,{variant:"ui-xs",className:" text-neutral3 flex-1",children:[S.ref.step.id||S.ref.step,"'s ",S.ref.path," ",Object.entries(S.query).map(([A,N])=>`${A} ${String(N)}`)]})]}):null},`${S.ref?.path}-${w}`)})})]}),c.jsx(Xpe,{stepName:n,input:f?.output,mapConfig:e.mapConfig,tripwire:m?f?.tripwire:void 0,status:h?y:void 0})]}),c.jsx(Eu,{type:"source",position:Er.Bottom,style:{visibility:"hidden"}})]})}const ven=(e,t)=>Number(e.toPrecision(t)),jpt=({startedAt:e,endedAt:t})=>{const[r,n]=E.useState(e);E.useEffect(()=>{const a=setInterval(()=>{n(Date.now())},100);return()=>clearInterval(a)},[e]);const s=t?t-e:r-e;return c.jsxs("span",{className:"text-xs text-neutral3",children:[ven(s,3),"ms"]})};function Rpt({data:e,parentWorkflowName:t,stepsFlow:r}){const{steps:n}=lj(),{label:s,stepId:a,description:i,withoutTopHandle:o,withoutBottomHandle:l,mapConfig:u,duration:d,date:p,isParallel:f,canSuspend:h,isForEach:m}=e,y=t?`${t}.${a||s}`:a||s,b=n[y],v=b?.status==="failed"&&b?.tripwire!==void 0,S=v?"tripwire":b?.status,{isSleepNode:w,isForEachNode:k,isMapNode:_,hasSpecialBadge:C}=kpt({duration:d,date:p,isForEach:m,mapConfig:u,canSuspend:h,isParallel:f});return c.jsxs(c.Fragment,{children:[!o&&c.jsx(Eu,{type:"target",position:Er.Top,style:{visibility:"hidden"}}),c.jsxs("div",{"data-workflow-node":!0,"data-workflow-step-status":S??"idle","data-testid":"workflow-default-node",className:K("bg-surface3 rounded-lg w-[274px] border border-border1",C?"pt-0":"pt-2",S==="success"&&"bg-accent1Darker",S==="failed"&&"bg-accent2Darker",S==="tripwire"&&"bg-amber-950/40 border-amber-500/30",S==="suspended"&&"bg-accent3Darker",S==="waiting"&&"bg-accent5Darker",S==="running"&&"bg-accent6Darker"),children:[C&&c.jsxs("div",{className:"px-3 pt-2 pb-1 flex gap-1.5 flex-wrap",children:[w&&c.jsx(Ft,{icon:p?c.jsx(Ao.sleepUntil,{className:"text-current",style:{color:Gi.sleep}}):c.jsx(Ao.sleep,{className:"text-current",style:{color:Gi.sleep}}),children:p?"SLEEP UNTIL":"SLEEP"}),h&&c.jsx(Ft,{icon:c.jsx(Ao.suspend,{className:"text-current",style:{color:Gi.suspend}}),children:"SUSPEND/RESUME"}),f&&c.jsx(Ft,{icon:c.jsx(Ao.parallel,{className:"text-current",style:{color:Gi.parallel}}),children:"PARALLEL"}),k&&c.jsx(Ft,{icon:c.jsx(Ao.forEach,{className:"text-current",style:{color:Gi.forEach}}),children:"FOREACH"}),_&&c.jsx(Ft,{icon:c.jsx(Ao.map,{className:"text-current",style:{color:Gi.map}}),children:"MAP"})]}),c.jsxs("div",{className:K("flex items-center gap-2 px-3",!i&&"pb-2"),children:[c.jsxs(ve,{children:[S==="tripwire"&&c.jsx(sI,{className:"text-amber-400"}),S==="failed"&&c.jsx($pe,{className:"text-accent2"}),S==="success"&&c.jsx(Ppe,{className:"text-accent1"}),S==="suspended"&&c.jsx(aze,{className:"text-accent3"}),S==="waiting"&&c.jsx(cie,{className:"text-accent5"}),S==="running"&&c.jsx(Ii,{className:"text-accent6 animate-spin"}),!b&&c.jsx(pL,{className:"text-neutral2"})]}),c.jsxs(ze,{variant:"ui-lg",className:"text-neutral6 font-medium inline-flex items-center gap-1 justify-between w-full",children:[s," ",b?.startedAt&&c.jsx(jpt,{startedAt:b.startedAt,endedAt:b.endedAt})]})]}),i&&c.jsx(ze,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:i}),k&&b?.foreachProgress&&c.jsxs("div",{className:"px-3 pb-2 flex items-center gap-2",children:[c.jsx("div",{className:"flex-1 h-1.5 bg-surface1 rounded-full overflow-hidden",children:c.jsx("div",{className:K("h-full rounded-full transition-all duration-300",b.foreachProgress.iterationStatus==="failed"?"bg-accent2":"bg-accent1"),style:{width:`${b.foreachProgress.totalCount>0?b.foreachProgress.completedCount/b.foreachProgress.totalCount*100:0}%`}})}),c.jsxs(ze,{variant:"ui-xs",className:"text-neutral3 whitespace-nowrap",children:[b.foreachProgress.completedCount," / ",b.foreachProgress.totalCount]})]}),d&&c.jsxs(ze,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:["sleeps for ",c.jsxs("strong",{children:[d,"ms"]})]}),p&&c.jsxs(ze,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:["sleeps until ",c.jsx("strong",{children:new Date(p).toLocaleString()})]}),c.jsx(Xpe,{stepName:s,stepId:a,input:b?.input,resumeData:b?.resumeData,output:b?.output,suspendOutput:b?.suspendOutput,error:v?void 0:b?.error,tripwire:v?b?.tripwire:void 0,mapConfig:u,status:S,stepKey:y,stepsFlow:r})]}),!l&&c.jsx(Eu,{type:"source",position:Er.Bottom,style:{visibility:"hidden",color:"red"}})]})}function Ppt({data:e}){const{steps:t}=e,[r,n]=E.useState(!0);return c.jsxs(CO,{open:r,onOpenChange:n,className:K("bg-surface4 rounded-md w-[274px] flex flex-col p-2 gap-2"),children:[c.jsx(Eu,{type:"target",position:Er.Top,style:{visibility:"hidden"}}),c.jsxs(oS,{className:"flex items-center justify-between w-full",children:[c.jsx(Ft,{icon:c.jsx(Ao.after,{className:"text-current",style:{color:Gi.after}}),children:"AFTER"}),c.jsx(ve,{children:c.jsx($a,{className:K("transition-transform text-neutral3",{"transform rotate-180":r})})})]}),c.jsx(lS,{className:"flex flex-col gap-2",children:t.map(s=>c.jsxs("div",{className:"text-sm bg-surface5 flex items-center gap-1.5 rounded-sm p-2",children:[c.jsx(YBe,{className:"text-current w-4 h-4"}),c.jsx(ze,{variant:"ui-xs",className:"text-neutral6 capitalize",children:s})]},s))}),c.jsx(Eu,{type:"source",position:Er.Bottom,style:{visibility:"hidden"}})]})}function $pt({data:e}){const{result:t}=e;return c.jsxs("div",{"data-testid":"workflow-loop-result-node","data-workflow-step-status":t?"success":"failed",className:K("bg-surface4 rounded-md w-[274px]"),"data-workflow-node":!0,children:[c.jsx(Eu,{type:"target",position:Er.Top,style:{visibility:"hidden"}}),c.jsx("div",{className:"p-2",children:c.jsxs("div",{className:"text-sm bg-surface5 flex items-center gap-1.5 rounded-sm p-2",children:[t?c.jsx(UBe,{className:"text-current w-4 h-4"}):c.jsx(dA,{className:"text-current w-4 h-4"}),c.jsx(ze,{variant:"ui-xs",className:"text-neutral6 capitalize",children:String(t)})]})}),c.jsx(Eu,{type:"source",position:Er.Bottom,style:{visibility:"hidden"}})]})}function Mpt({data:e,parentWorkflowName:t,stepsFlow:r}){const{steps:n}=lj(),{showNestedGraph:s}=H6(),{label:a,stepId:i,description:o,withoutTopHandle:l,withoutBottomHandle:u,stepGraph:d,mapConfig:p,isParallel:f,canSuspend:h,isForEach:m}=e,y=t?`${t}.${a}`:a,b=t?`${t}.${i||a}`:i||a,v=n[b],S=v?.status==="failed"&&v?.tripwire!==void 0,w=S?"tripwire":v?.status,{isForEachNode:k,isMapNode:_,isNestedWorkflow:C,hasSpecialBadge:T}=kpt({isForEach:m,mapConfig:p,canSuspend:h,isParallel:f,stepGraph:d});return c.jsxs(c.Fragment,{children:[!l&&c.jsx(Eu,{type:"target",position:Er.Top,style:{visibility:"hidden"}}),c.jsxs("div",{"data-testid":"workflow-nested-node","data-workflow-node":!0,"data-workflow-step-status":w,className:K("bg-surface3 rounded-lg w-[274px] border border-border1",T?"pt-0":"pt-2",w==="success"&&"bg-accent1Darker",w==="failed"&&"bg-accent2Darker",w==="tripwire"&&"bg-amber-950/40 border-amber-500/30",w==="suspended"&&"bg-accent3Darker",w==="waiting"&&"bg-accent5Darker",w==="running"&&"bg-accent6Darker"),children:[T&&c.jsxs("div",{className:"px-3 pt-2 pb-1 flex gap-1.5 flex-wrap",children:[h&&c.jsx(Ft,{icon:c.jsx(Ao.suspend,{className:"text-current",style:{color:Gi.suspend}}),children:"SUSPEND/RESUME"}),f&&c.jsx(Ft,{icon:c.jsx(Ao.parallel,{className:"text-current",style:{color:Gi.parallel}}),children:"PARALLEL"}),C&&c.jsx(Ft,{icon:c.jsx(Ao.workflow,{className:"text-current",style:{color:Gi.workflow}}),children:"WORKFLOW"}),k&&c.jsx(Ft,{icon:c.jsx(Ao.forEach,{className:"text-current",style:{color:Gi.forEach}}),children:"FOREACH"}),_&&c.jsx(Ft,{icon:c.jsx(Ao.map,{className:"text-current",style:{color:Gi.map}}),children:"MAP"})]}),c.jsxs("div",{className:K("flex items-center gap-2 px-3",!o&&"pb-2"),children:[c.jsxs(ve,{children:[w==="failed"&&c.jsx($pe,{className:"text-accent2"}),w==="success"&&c.jsx(Ppe,{className:"text-accent1"}),w==="tripwire"&&c.jsx(sI,{className:"text-amber-400"}),w==="suspended"&&c.jsx(aze,{className:"text-accent3"}),w==="waiting"&&c.jsx(cie,{className:"text-accent5"}),w==="running"&&c.jsx(Ii,{className:"text-accent6 animate-spin"}),!v&&c.jsx(pL,{className:"text-neutral2"})]}),c.jsxs(ze,{variant:"ui-lg",className:"text-neutral6 font-medium inline-flex items-center gap-1 justify-between w-full",children:[a," ",v?.startedAt&&c.jsx(jpt,{startedAt:v.startedAt,endedAt:v.endedAt})]})]}),o&&c.jsx(ze,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:o}),k&&v?.foreachProgress&&c.jsxs("div",{className:"px-3 pb-2 flex items-center gap-2",children:[c.jsx("div",{className:"flex-1 h-1.5 bg-surface1 rounded-full overflow-hidden",children:c.jsx("div",{className:K("h-full rounded-full transition-all duration-300",v.foreachProgress.iterationStatus==="failed"?"bg-accent2":"bg-accent1"),style:{width:`${v.foreachProgress.totalCount>0?v.foreachProgress.completedCount/v.foreachProgress.totalCount*100:0}%`}})}),c.jsxs(ze,{variant:"ui-xs",className:"text-neutral3 whitespace-nowrap",children:[v.foreachProgress.completedCount," / ",v.foreachProgress.totalCount]})]}),c.jsx(Xpe,{stepName:a,stepId:i,input:v?.input,resumeData:v?.resumeData,output:v?.output,suspendOutput:v?.suspendOutput,error:v?.error,tripwire:S?v?.tripwire:void 0,mapConfig:p,onShowNestedGraph:()=>s({label:a,fullStep:y,stepGraph:d}),status:w,stepKey:b,stepsFlow:r})]}),!u&&c.jsx(Eu,{type:"source",position:Er.Bottom,style:{visibility:"hidden"}})]})}const _4=E.forwardRef(({className:e,...t},r)=>c.jsxs(Eot,{ref:r,className:K("relative flex w-full touch-none select-none items-center group",e),...t,children:[c.jsx(x7r,{className:K("relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral2",Wr.colors),children:c.jsx(S7r,{className:K("absolute h-full bg-accent1",Wr.all)})}),c.jsx(w7r,{className:K("block h-4 w-4 rounded-full border-2 border-accent1 bg-white shadow-md","transition-all duration-normal ease-out-custom",sh,"hover:scale-110 hover:shadow-lg","active:scale-95","disabled:pointer-events-none disabled:opacity-50")})]}));_4.displayName=Eot.displayName;const Ype=E.forwardRef(({className:e,...t})=>{const{zoom:r}=xOr(),{zoomTo:n,zoomIn:s,zoomOut:a,fitView:i}=jF();return c.jsxs(jI,{className:K("flex gap-1 rounded-md bg-surface2 p-1 text-neutral6",e),...t,children:[c.jsx(ye,{onClick:()=>a({duration:300}),children:c.jsx(HNt,{className:"h-4 w-4"})}),c.jsx(_4,{className:"w-[140px]",value:[r],min:.01,max:1,step:.01,onValueChange:o=>{n(o[0])}}),c.jsx(ye,{onClick:()=>s({duration:300}),children:c.jsx(Qs,{className:"h-4 w-4"})}),c.jsxs(ye,{className:"min-w-20 tabular-nums",onClick:()=>n(1,{duration:300}),children:[(100*r).toFixed(0),"%"]}),c.jsx(ye,{onClick:()=>i({duration:300,maxZoom:1}),children:c.jsx(zNt,{className:"h-4 w-4"})})]})});Ype.displayName="ZoomSlider";function xen({workflow:e}){const{nodes:t,edges:r}=Ept(e),[n,s,a]=Iet(t),[i]=jet(r),{steps:o}=lj(),l=E.useMemo(()=>r.reduce((d,p)=>{if(p.data){const f=p.data.nextStepId,h=p.data.previousStepId;return{...d,[f]:[...new Set([...d[f]||[],h])]}}return d},{}),[r]),u={"default-node":d=>c.jsx(Rpt,{...d,stepsFlow:l}),"condition-node":Ipt,"after-node":Ppt,"loop-result-node":$pt,"nested-node":d=>c.jsx(Mpt,{...d,stepsFlow:l})};return c.jsx("div",{className:"w-full h-full bg-surface1",children:c.jsxs(Net,{nodes:n,edges:i.map(d=>({...d,style:{...d.style,stroke:o[d.data?.previousStepId]?.status==="success"&&o[d.data?.nextStepId]||d.data?.conditionNode&&!o[d.data?.previousStepId]&&o[d.data?.nextStepId]?.status?"#22c55e":void 0}})),nodeTypes:u,onNodesChange:a,fitView:!0,fitViewOptions:{maxZoom:1},minZoom:.01,maxZoom:1,children:[c.jsx(Ype,{position:"bottom-left"}),c.jsx(Pet,{variant:em.Dots,gap:12,size:.5})]})})}function Lpt({workflowId:e,workflow:t,isLoading:r}){const{snapshot:n}=E.useContext(Fm);return r?c.jsx("div",{className:"p-4",children:c.jsx(Nr,{className:"h-full"})}):t?c.jsx(Ace,{children:c.jsx(xen,{workflow:n?.serializedStepGraph?{stepGraph:n?.serializedStepGraph}:t})}):c.jsx("div",{className:"grid h-full place-items-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-2",children:[c.jsx(Xh,{}),c.jsxs("div",{children:["We couldn't find ",AJr(e)," workflow."]})]})})}const Sen=e=>e&&Object.keys(e).length===0&&e.constructor===Object;function uj(){const e=st();return ur({queryKey:["auth","capabilities"],queryFn:async()=>{const t=await fetch(`${e.options?.baseUrl||""}/api/auth/capabilities`,{credentials:"include",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error(`Failed to fetch auth capabilities: ${t.status}`);return t.json()},staleTime:60*1e3,retry:!1})}function G6(e){return"user"in e&&e.user!==void 0}function wen(e,t){if(e==="*")return!0;const r=e.split(":"),n=t.split(":");if(r.length<2||n.length<2)return e===t;const[s,a,i]=r,[o,l,u]=n;return s==="*"?a==="*"?!0:a!==l?!1:i===void 0?!0:i===u:s!==o?!1:a==="*"?i===void 0?!0:i===u:a!==l?!1:i===void 0?!0:i===u}function AY(e,t){return e.some(r=>wen(r,t))}function Bm(){const{data:e,isLoading:t}=uj(),r=e&&G6(e),n=r?e.access:null,s=r?e.capabilities.rbac:!1,a=n?.roles??[],i=n?.permissions??[],o=l=>s?AY(i,l):!0;return{roles:a,permissions:i,isLoading:t,isAuthenticated:!!r,rbacEnabled:s,hasPermission:l=>o(l),hasAllPermissions:l=>s?l.every(u=>AY(i,u)):!0,hasAnyPermission:l=>s?l.some(u=>AY(i,u)):!0,hasRole:l=>s?a.includes(l):!0,canEdit:l=>o(`${l}:write`),canDelete:l=>o(`${l}:delete`),canExecute:l=>o(`${l}:execute`)}}function Een(e,t){return E.useMemo(()=>Object.entries(e?.steps||{}).filter(([r,{status:n}])=>n==="suspended").map(([r,{suspendPayload:n}])=>({stepId:r,runId:t,suspendPayload:n,isLoading:!1})),[e?.steps,t])}function ken(e){return E.useMemo(()=>{const t=e?.inputSchema,r=e?.stateSchema,n=t?vm(fm(Dv(t))):null,s=r?vm(fm(Dv(r))):null;return{zodSchemaToUse:s?Fn({inputData:n,initialState:s.optional()}):n,hasStateSchema:!!r}},[e?.inputSchema,e?.stateSchema])}function Oen({zodSchema:e,isStreaming:t,onExecute:r,defaultValues:n,isViewingRun:s,isProcessorWorkflow:a}){return e?c.jsx(Gpe,{schema:e,defaultValues:n,isSubmitLoading:t,submitButtonLabel:"Run",onSubmit:r,withoutSubmit:s,isProcessorWorkflow:a}):s?null:c.jsx(ye,{className:"w-full",variant:"light",disabled:t,onClick:()=>r(null),children:t?c.jsx(ve,{children:c.jsx(Ii,{className:"animate-spin"})}):"Trigger"})}function _en({suspendedSteps:e,workflow:t,isStreaming:r,onResume:n}){return r||e.length===0?null:c.jsx(c.Fragment,{children:e.map(s=>{const a=t.allSteps[s.stepId];if(!a||a.isWorkflow)return null;const i=a?.resumeSchema?vm(fm(Dv(a.resumeSchema))):vc(Tr(),$0());return c.jsxs("div",{className:"flex flex-col px-4",children:[c.jsx(ze,{variant:"ui-xs",className:"text-neutral3",children:s.stepId}),s.suspendPayload&&c.jsx("div",{"data-testid":"suspended-payload",children:c.jsx(Wa,{data:s.suspendPayload,className:"w-full overflow-x-auto p-2",showCopyButton:!1})}),c.jsx(Gpe,{schema:i,isSubmitLoading:r,submitButtonLabel:"Resume workflow",onSubmit:o=>{const l=s.stepId?.split(".");n({stepId:l,runId:s.runId,suspendPayload:s.suspendPayload,resumeData:o,isLoading:!1})}})]},s.stepId)})})}const Cen=["success","failed","canceled","tripwire"];function Ten({status:e,cancelMessage:t,isCancelling:r,onCancel:n}){return e!=="running"?null:c.jsxs(ye,{variant:"light",className:"w-full",onClick:n,disabled:!!t||r||e&&Cen.includes(e),children:[r?c.jsx(ve,{children:c.jsx(Ii,{className:"animate-spin"})}):c.jsx(ve,{children:c.jsx(GBe,{})}),t||"Cancel Workflow Run"]})}const Aen=({header:e,children:t,footer:r})=>{const[n,s]=E.useState(!1);return c.jsxs("div",{className:"rounded-lg border border-border1 bg-surface4",children:[c.jsxs("button",{className:"py-1 px-2 flex items-center gap-3 justify-between w-full",onClick:()=>s(a=>!a),children:[c.jsx("div",{className:"w-full",children:e}),c.jsx(ve,{children:c.jsx($a,{className:K("text-neutral3 transition-transform -rotate-90",n&&"rotate-0")})})]}),t&&n&&c.jsx("div",{className:"border-t border-border1 max-h-[400px] overflow-y-auto",children:t}),r&&c.jsx("div",{className:"py-1 px-2 border-t border-border1",children:r})]})},Den=({stepId:e,status:t,result:r,tripwire:n})=>{const[s,a]=E.useState(!1),i=t==="tripwire",o=!!(n&&(n.retry!==void 0||n.metadata!==void 0||n.processorId!==void 0));return c.jsx(Aen,{header:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs(ve,{children:[t==="success"&&c.jsx(Ppe,{className:"text-accent1"}),t==="failed"&&c.jsx($pe,{className:"text-accent2"}),t==="tripwire"&&c.jsx(sI,{className:"text-amber-400"}),t==="suspended"&&c.jsx(HBe,{className:"text-accent3"}),t==="waiting"&&c.jsx(cie,{className:"text-accent5"}),t==="running"&&c.jsx(Ii,{className:"text-accent6 animate-spin"})]}),c.jsx(ze,{as:"span",variant:"ui-lg",className:"text-neutral6 font-medium",children:e.charAt(0).toUpperCase()+e.slice(1)})]}),children:i&&n?c.jsx(Nen,{tripwire:n,isExpanded:s,onToggleExpand:()=>a(!s),hasMetadata:o}):c.jsx(Wa,{data:r})})},Nen=({tripwire:e,isExpanded:t,onToggleExpand:r,hasMetadata:n})=>c.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-950/20 overflow-hidden",children:[c.jsxs("div",{className:"flex items-start gap-3 p-4",children:[c.jsx(sI,{className:"w-5 h-5 text-amber-400 mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-sm font-medium text-amber-200 mb-1",children:"Content Blocked"}),c.jsx("p",{className:"text-sm text-amber-300/90",children:e.reason||"Tripwire triggered"})]})]}),n&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:r,className:"w-full flex items-center gap-2 px-4 py-2 text-xs text-amber-400/70 hover:text-amber-400 hover:bg-amber-900/20 transition-colors border-t border-amber-500/20",children:[t?c.jsx($a,{className:"w-3.5 h-3.5"}):c.jsx(qi,{className:"w-3.5 h-3.5"}),c.jsx("span",{children:"Details"})]}),t&&c.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-amber-500/20 bg-amber-950/10",children:[e.retry!==void 0&&c.jsxs("div",{className:"flex items-center gap-2 pt-3",children:[c.jsx(nI,{className:"w-3.5 h-3.5 text-amber-400/60"}),c.jsxs("span",{className:"text-xs text-amber-300/70",children:["Retry:"," ",e.retry?c.jsx("span",{className:"text-green-400",children:"Allowed"}):c.jsx("span",{className:"text-red-400",children:"Not allowed"})]})]}),e.processorId&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(fie,{className:"w-3.5 h-3.5 text-amber-400/60"}),c.jsxs("span",{className:"text-xs text-amber-300/70",children:["Processor:"," ",c.jsx("code",{className:"px-1.5 py-0.5 rounded bg-amber-900/30 text-amber-200 font-mono",children:e.processorId})]})]}),e.metadata!==void 0&&e.metadata!==null&&c.jsxs("div",{className:"pt-1",children:[c.jsx("p",{className:"text-xs text-amber-400/60 mb-1.5",children:"Metadata:"}),c.jsx("pre",{className:"text-xs text-amber-200/80 bg-amber-900/30 rounded p-2 overflow-x-auto font-mono",children:String(JSON.stringify(e.metadata,null,2))})]})]})]})]});function Ien({steps:e,workflowResult:t}){const r=Object.entries(e).filter(([n,s])=>n!=="input"&&!n.endsWith(".input"));return r.length===0?null:c.jsxs("div",{className:"flex flex-col gap-2 pt-5 border-t border-border1",children:[c.jsx(ze,{variant:"ui-xs",className:"text-neutral3",children:"Status"}),c.jsx("div",{className:"flex flex-col gap-4",children:r.map(([n,s])=>{const{status:a}=s;let i,o,l;s.status==="suspended"&&(o=s.suspendOutput),s.status==="success"&&(i=s.output),s.status==="failed"&&(l=s.error);const u=s.status==="failed"&&s.tripwire?s.tripwire:t?.status==="tripwire"?{reason:t?.tripwire?.reason,retry:t?.tripwire?.retry,metadata:t?.tripwire?.metadata,processorId:t?.tripwire?.processorId}:void 0,d=s.status==="failed"&&s.tripwire?"tripwire":a;return c.jsx(Den,{stepId:n,status:d,result:i??o??l??{},tripwire:u},n)})})]})}function Fpt({workflowId:e,paramsRunId:t,setRunId:r,workflow:n,isLoading:s,createWorkflowRun:a,resumeWorkflow:i,streamWorkflow:o,observeWorkflowStream:l,isStreamingWorkflow:u,streamResult:d,isCancellingWorkflowRun:p,cancelWorkflowRun:f}){const h=Fc(),{result:m,setResult:y,payload:b,setPayload:v,setRunId:S}=E.useContext(Fm),{canExecute:w}=Bm(),k=w("workflows"),[_,C]=E.useState(""),[T,A]=E.useState(null),N=m??d,j=Een(N,_),{zodSchemaToUse:R,hasStateSchema:L}=ken(n),F=async Z=>{try{if(!n)return;A(null),y(null);const $=await a({workflowId:e});r?.($.runId),C($.runId),S($.runId);const{initialState:X,inputData:U}=Z??{},I=L?U:Z;o({workflowId:e,runId:$.runId,inputData:I,initialState:X,requestContext:h})}catch{We.error("Error executing workflow")}},M=async Z=>{if(!n)return;A(null);const{stepId:$,runId:X,resumeData:U}=Z,I=await a({workflowId:e,prevRunId:X});await i({step:$,runId:I.runId,resumeData:U,workflowId:e,requestContext:h})},z=async()=>{const Z=await f({workflowId:e,runId:_});A(Z)};if(E.useEffect(()=>{t&&l&&(l({workflowId:e,runId:t}),C(t),S(t))},[t]),E.useEffect(()=>{d&&y(d)},[d]),s)return c.jsx(pi,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:c.jsxs("div",{className:"space-y-4",children:[c.jsx(Nr,{className:"h-10"}),c.jsx(Nr,{className:"h-10"})]})});if(!n)return null;const q=j.length>0,Q=N?.steps??{},V=Object.values(Q).length>0;return c.jsxs("div",{className:"h-full pt-3 overflow-y-auto",children:[c.jsxs("div",{className:"space-y-4 px-5 pb-5 border-b border-border1",children:[q&&u&&c.jsxs("div",{className:"py-2 px-5 flex items-center gap-2 bg-surface5 -mx-5 -mt-5 border-b border-border1",children:[c.jsx(ve,{children:c.jsx(Ii,{className:"animate-spin text-neutral6"})}),c.jsx(ze,{children:"Resuming workflow"})]}),!q&&k&&c.jsx(Oen,{zodSchema:R,defaultValues:b,isStreaming:u,onExecute:Z=>{v(Z),F(Z)},isViewingRun:!!t,isProcessorWorkflow:n?.isProcessorWorkflow}),!q&&!k&&c.jsx(ze,{variant:"ui-sm",className:"text-neutral3 py-2",children:"You don't have permission to execute workflows."}),c.jsx(_en,{suspendedSteps:j,workflow:n,isStreaming:u,onResume:M}),c.jsx(Ten,{status:m?.status,cancelMessage:T?.message??null,isCancelling:p,onCancel:z}),V&&c.jsx(Ien,{steps:Q,workflowResult:N})]}),m&&!Sen(m)&&c.jsx("div",{className:"p-5 border-b border-border1",children:c.jsx(jen,{result:m})})]})}const jen=({result:e})=>{const[t,r]=E.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsxs(ye,{variant:"light",onClick:()=>r(!0),className:"w-full truncate",children:[c.jsx(ve,{children:c.jsx(Dp,{className:"text-neutral3"})}),"Open Workflow Execution (JSON)"]}),c.jsx(ea,{open:t,onOpenChange:r,children:c.jsxs(Ls,{className:"max-w-6xl",children:[c.jsxs(ta,{children:[c.jsx(Fs,{children:"Workflow Execution (JSON)"}),c.jsx(ni,{children:"JSON view of the workflow execution result"})]}),c.jsx(ra,{className:"max-h-[90vh]",children:c.jsx(Wa,{data:e,className:"p-4"})})]})})]})},Ren=({workflowId:e,runId:t,observeWorkflowStream:r,...n})=>{const{runSnapshot:s,isLoadingRunExecutionResult:a}=E.useContext(Fm);if(a)return c.jsx("div",{className:"p-4",children:c.jsx(Nr,{className:"h-[600px]"})});if(!s||!t)return c.jsx("div",{className:"p-4",children:c.jsx(ze,{variant:"ui-md",className:"text-neutral6 text-center",children:"No previous run"})});const i=Tre(s),o=i?.status;if(t)return c.jsx("div",{className:"h-full grid grid-rows-[1fr_auto]",children:c.jsx(Fpt,{...n,paramsRunId:t,workflowId:e,observeWorkflowStream:()=>{o!=="success"&&o!=="failed"&&o!=="canceled"&&r?.({workflowId:e,runId:t,storeRunResult:i})}})})};function Nu({iconSlot:e,titleSlot:t,descriptionSlot:r,actionSlot:n,className:s,as:a="h3"}){return c.jsxs("div",{className:K("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&c.jsx("div",{className:"mb-4",children:e}),c.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),r&&c.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:r}),n&&c.jsx("div",{className:"mt-5",children:n})]})}function $d({resource:e,title:t,description:r,actionSlot:n,className:s}){const a="Permission Denied",i=e?`You don't have permission to access ${e}. Contact your administrator for access.`:"You don't have permission to access this resource. Contact your administrator for access.";return c.jsx(Nu,{className:s,iconSlot:c.jsx(ve,{size:"lg",className:"text-neutral3",children:c.jsx(RIt,{})}),titleSlot:t??a,descriptionSlot:r??i,actionSlot:n})}const Pen={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},Tl=({className:e,children:t,size:r="default",style:n})=>c.jsx("table",{className:K("w-full",Pen[r],e),style:n,children:t}),Al=({className:e,children:t})=>c.jsx("thead",{children:c.jsx("tr",{className:K("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),Aa=({className:e,children:t,...r})=>c.jsx("th",{className:K("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...r,children:t}),Dl=({className:e,children:t,...r})=>c.jsx("tbody",{className:K("",e),...r,children:t}),Nl=E.forwardRef(({className:e,children:t,selected:r=!1,style:n,onClick:s,isActive:a=!1,...i},o)=>{const l=E.useRef(null);E.useEffect(()=>{o&&(typeof o=="function"?o(l.current):o.current=l.current)},[o]),E.useEffect(()=>{a&&l.current&&(l.current.focus(),l.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return c.jsx("tr",{className:K("border-b border-border1","transition-colors duration-normal ease-out-custom","hover:bg-surface3","focus:bg-surface3 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-accent1/50",r&&"bg-surface4",s&&"cursor-pointer",e),style:n,onClick:s,ref:l,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...i,children:t})}),Hs=({className:e,children:t,...r})=>c.jsx("td",{className:K("text-neutral5 first:pl-3 last:pr-3",e),...r,children:c.jsx("div",{className:K("flex h-full w-full shrink-0 items-center"),children:t})}),ix=({name:e,description:t,icon:r,meta:n,...s})=>c.jsx(Hs,{...s,children:c.jsxs("div",{className:"flex items-center gap-3.5",children:[r&&c.jsx(ve,{size:"lg",className:"text-neutral5",children:r}),c.jsxs("div",{className:"flex flex-col gap-0",children:[c.jsx(ze,{as:"span",variant:"ui-md",className:"text-neutral6 !leading-tight",children:e}),t&&c.jsx(ze,{as:"span",variant:"ui-xs",className:"text-neutral3 w-full max-w-[300px] truncate !leading-tight pt-1",children:t})]}),n]})});function cS({itemCount:e,initialIndex:t=-1,wrap:r=!1,onSelect:n,global:s=!1}){const[a,i]=E.useState(t),o=E.useCallback(u=>{if(e!==0)switch(u.key){case"ArrowDown":{u.preventDefault(),i(d=>d===-1?0:d>=e-1?r?0:e-1:d+1);break}case"ArrowUp":{u.preventDefault(),i(d=>d===-1?e-1:d<=0?r?e-1:0:d-1);break}case"Home":{u.preventDefault(),i(0);break}case"End":{u.preventDefault(),i(e-1);break}case"Enter":{a>=0&&n&&(u.preventDefault(),n(a));break}}},[e,r,a,n]);E.useEffect(()=>{if(s)return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o)}},[s,o]);const l=E.useCallback(()=>s?null:{onKeyDown:o,tabIndex:0},[s,o]);return{activeIndex:a,setActiveIndex:i,getKeyboardProps:l}}const BPe=40,NP=150,zPe=10,ox=({className:e,children:t,scrollSpeed:r=100,scrollIntervalTime:n=20})=>{const s=E.useRef(null),a=E.useRef(null),[i,o]=E.useState(0),[l,u]=E.useState(0),[d,p]=E.useState(0),[f,h]=E.useState(0),[m,y]=E.useState(!1),[b,v]=E.useState(!1);E.useEffect(()=>{const _=()=>{if(!s.current)return;const N=s.current.scrollLeft<s.current.scrollWidth-s.current.clientWidth;y(N),o(s.current.clientHeight);const j=s.current.getBoundingClientRect();u(j.right),h(j.left),p(j.top)};_();const C=new ResizeObserver(_);s.current&&C.observe(s.current);const T=()=>{if(!s.current)return;const N=s.current.scrollLeft>0,j=s.current.scrollLeft<s.current.scrollWidth-s.current.clientWidth;v(N),y(j),_()};s?.current?.addEventListener("scroll",T);const A=s.current;return()=>{A&&(C.unobserve(A),A.removeEventListener("scroll",T))}},[]);const S=({isVisible:_,position:C,containerHeight:T,containerTop:A,containerRight:N,onStartScrolling:j,onStopScrolling:R})=>{if(!_)return null;const L={top:T<NP?A:A+(T-NP)/2,width:BPe,height:T<NP?`${T}px`:`${NP}px`};return c.jsxs("button",{onMouseDown:j,onTouchStart:j,onMouseUp:R,onTouchEnd:R,onTouchCancel:R,className:"bg-surface4 text-neutral3 border-surface5 hover:border-neutral3 fixed z-10 flex items-center justify-center rounded-lg border text-2xl hover:text-white",style:{...L,left:C==="left"?f+zPe:N-BPe-zPe},children:[" ",C==="left"?"«":"»"]})},w=E.useCallback((_,C)=>{C?.preventDefault(),C?.stopPropagation(),a.current&&(clearInterval(a.current),a.current=null),s.current&&s.current.scrollBy({left:_==="right"?r*2:-r*2,behavior:"smooth"}),a.current=setInterval(()=>{s.current&&s.current.scrollBy({left:_==="right"?r:-r,behavior:"smooth"})},n)},[r,n]),k=E.useCallback(()=>{a.current&&(clearInterval(a.current),a.current=null)},[]);return c.jsxs("div",{ref:s,className:K("relative max-h-full overflow-auto",e),children:[t,c.jsx(S,{isVisible:b,position:"left",containerHeight:i,containerTop:d,containerRight:l,onStartScrolling:_=>w("left",_),onStopScrolling:k}),c.jsx(S,{isVisible:m,position:"right",containerHeight:i,containerTop:d,containerRight:l,onStartScrolling:_=>w("right",_),onStopScrolling:k})]})},$en=[{id:"name",header:"Name",cell:({row:e})=>{const{Link:t,paths:r}=Yt(),n=e.original;return c.jsx(ix,{name:c.jsx(t,{href:r.workflowLink(e.original.id),children:e.original.name}),description:n.description,meta:void 0})},meta:{width:"auto"}},{id:"stepsCount",header:"Steps",size:300,cell:({row:e})=>{const t=e.original,r=Object.keys(t.steps??{}).length;return c.jsx(Hs,{children:c.jsx("div",{className:"flex justify-end items-center gap-2",children:c.jsxs(Ft,{icon:c.jsx(YBe,{}),className:"!h-form-sm",children:[r," step",r>1?"s":""]})})})}}],UPe={sm:oi.sm,md:oi.md,lg:oi.lg,default:oi.default},Iu=({onSearch:e,label:t,placeholder:r,debounceMs:n=300,size:s="md"})=>{const a=E.useId(),i=E.useRef(null),o=$I(u=>{e(u)},n);E.useEffect(()=>()=>{o.cancel()},[o]),E.useEffect(()=>{const u=i.current;if(!u)return;const d=p=>{p.key.toLowerCase()==="f"&&p.shiftKey&&(p.ctrlKey||p.metaKey)&&(p.preventDefault(),u.focus())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[]);const l=u=>{o(u.target.value)};return c.jsxs("div",{className:K("border border-border1 flex w-full items-center gap-2 overflow-hidden pl-2 pr-1",aj,TKr,Wr.all,"hover:border-neutral2",UPe[s]),children:[c.jsx(_m,{className:K("text-neutral3 h-4 w-4",Wr.colors)}),c.jsxs("div",{className:"flex-1",children:[c.jsx("label",{htmlFor:a,className:"sr-only",children:t}),c.jsx("input",{id:a,type:"text",placeholder:r,className:K("bg-transparent text-ui-md placeholder:text-neutral3 block w-full px-2 outline-none",UPe[s]),name:a,ref:i,onChange:l})]})]})},xy=({children:e})=>c.jsx("div",{className:"px-3 py-2.5 border-b border-border1",children:e});function Men({workflows:e,isLoading:t,error:r}){const[n,s]=E.useState(""),{navigate:a,paths:i}=Yt(),o=E.useMemo(()=>Object.keys(e??{}).map(m=>{const y=e[m];return{id:m,...y}}),[e]),l=E.useMemo(()=>o.filter(h=>h.name.toLowerCase().includes(n.toLowerCase())),[o,n]),{activeIndex:u}=cS({itemCount:l.length,global:!0,onSelect:h=>{const m=l[h];m&&a(i.workflowLink(m.id))}}),d=tx({data:l,columns:$en,getCoreRowModel:ex()}),p=d.getHeaderGroups()[0],f=d.getRowModel().rows;return r&&Mc(r)?c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"workflows"})}):o.length===0&&!t?c.jsx(Fen,{}):c.jsxs("div",{children:[c.jsx(xy,{children:c.jsx(Iu,{onSearch:s,label:"Search workflows",placeholder:"Search workflows"})}),t?c.jsx(Len,{}):c.jsx(ox,{children:c.jsxs(Tl,{children:[c.jsx(Al,{className:"sticky top-0",children:p.headers.map(h=>c.jsx(Aa,{style:{width:h.index===0?"auto":h.column.getSize()},children:Xl(h.column.columnDef.header,h.getContext())},h.id))}),c.jsx(Dl,{children:f.map((h,m)=>c.jsx(Nl,{isActive:m===u,onClick:()=>a(i.workflowLink(h.original.id)),children:h.getVisibleCells().map(y=>c.jsx(Ee.Fragment,{children:Xl(y.column.columnDef.cell,y.getContext())},y.id))},h.id))})]})})]})}const Len=()=>c.jsxs(Tl,{children:[c.jsxs(Al,{children:[c.jsx(Aa,{children:"Name"}),c.jsx(Aa,{width:300,children:"Steps"})]}),c.jsx(Dl,{children:Array.from({length:3}).map((e,t)=>c.jsxs(Nl,{children:[c.jsx(Hs,{children:c.jsx(Nr,{className:"h-4 w-1/2"})}),c.jsx(Hs,{width:300,children:c.jsx(Nr,{className:"h-4 w-1/2"})})]},t))})]}),Fen=()=>c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx(Nu,{iconSlot:c.jsx(GKr,{}),titleSlot:"Configure Workflows",descriptionSlot:"Mastra workflows are not configured yet. You can find more information in the documentation.",actionSlot:c.jsxs(ye,{size:"lg",className:"w-full",variant:"light",as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(Yl,{})}),"Docs"]})})}),Bpt=({icon:e,title:t,isLoading:r,children:n})=>c.jsxs("div",{className:"p-5 w-full overflow-x-hidden",children:[c.jsxs("div",{className:"text-neutral6 flex items-center gap-2",children:[c.jsx(ve,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),r?c.jsx(Nr,{className:"h-3 w-1/3"}):c.jsx("div",{className:"flex min-w-0 items-center gap-4",children:c.jsx(ze,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),n&&c.jsx("div",{className:"pt-2",children:n})]}),TO=({children:e,defaultTab:t,value:r,onValueChange:n,className:s})=>{const[a,i]=E.useState(t),o=r!==void 0&&n!==void 0,l=o?r:a,u=d=>{const p=d;o?n(p):i(p)};return c.jsx(hBr,{value:l,onValueChange:u,className:K("overflow-y-auto",s),children:e})},AO=({children:e,variant:t="default",className:r})=>c.jsx("div",{className:K("w-full overflow-x-auto",r),children:c.jsx(mBr,{className:K("flex items-center relative",{"text-ui-lg":t==="default","[&>button]:py-2 [&>button]:px-6 [&>button]:font-normal [&>button]:text-neutral3 [&>button]:flex-1 [&>button]:border-b [&>button]:border-border1":t==="default",[`[&>button]:${Wr.colors} [&>button]:hover:text-neutral4`]:t==="default","[&>button[data-state=active]]:text-neutral5 [&>button[data-state=active]]:border-white/50":t==="default","border border-border1 flex justify-stretch rounded-md overflow-hidden text-ui-md min-h-[2.5rem]":t==="buttons",[`[&>button]:flex-1 [&>button]:py-2 [&>button]:px-4 [&>button]:text-neutral3 [&>button]:${Wr.all}`]:t==="buttons","[&>button]:hover:text-neutral4 [&>button]:hover:bg-surface3":t==="buttons","[&>button[data-state=active]]:text-neutral5 [&>button[data-state=active]]:bg-surface4 [&>button[data-state=active]]:shadow-inner":t==="buttons"},r),children:e})}),gl=({children:e,value:t,onClick:r,onClose:n,className:s})=>c.jsxs(gBr,{value:t,className:K("text-sm p-3 text-neutral3 whitespace-nowrap flex-shrink-0 flex items-center justify-center gap-1.5",Wr.all,sx.visible,"hover:text-neutral4","data-[state=active]:text-neutral5 data-[state=active]:border-b-2 data-[state=active]:border-accent1",s),onClick:r,children:[e,n&&c.jsx("button",{onClick:a=>{a.stopPropagation(),n()},className:K("p-0.5 hover:bg-surface4 rounded",Wr.colors,"hover:text-neutral5"),"aria-label":"Close tab",children:c.jsx(Os,{className:"w-3 h-3"})})]}),Tc=({children:e,value:t,className:r})=>c.jsx(yBr,{value:t,className:K("grid py-3 overflow-y-auto ring-offset-background",sx.visible,r),children:e}),Ben=()=>{const{debugMode:e,setDebugMode:t}=E.useContext(Fm);return c.jsxs(c.Fragment,{children:[c.jsx(ze,{as:"h3",variant:"ui-md",className:"text-neutral3",children:"Debug Mode"}),c.jsx(Mp,{checked:e,onCheckedChange:r=>t(r)})]})},zpt=()=>{const e=ax(),{settings:t,setSettings:r,entityType:n}=zpe(),s=i=>{if(!i)return r({...t,tracingOptions:void 0});try{const o=JSON.parse(i);typeof o=="object"&&o!==null&&r({...t,tracingOptions:o})}catch{}};let a="{}";try{a=JSON.stringify(t?.tracingOptions,null,2)}catch{}return c.jsxs("div",{className:"space-y-2 px-5 py-2",children:[c.jsx(ze,{as:"h3",variant:"ui-md",className:"text-neutral3",children:"Tracing Options"}),c.jsx(vd,{value:a,onChange:s,theme:e,extensions:[fd],className:"h-[400px] overflow-y-scroll bg-surface3 rounded-lg overflow-hidden p-3"}),n==="workflow"&&c.jsx(Ben,{})]})},zen={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function Cn({color:e,className:t,size:r="md"}){return c.jsx("svg",{className:K("animate-spin",zen[r],t),style:{animationDuration:"800ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)"},xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:e||"currentColor",className:"text-accent1"})})}function Uen({stepGraph:e,open:t,workflowName:r}){const{nodes:n,edges:s}=Ept({stepGraph:e}),[a,i]=E.useState(!1),[o,l,u]=Iet(n),[d]=jet(s),{steps:p}=lj(),f=E.useMemo(()=>s.reduce((m,y)=>{if(y.data){const b=y.data.nextStepId,v=y.data.previousStepId;return{...m,[b]:[...new Set([...m[b]||[],v])]}}return m},{}),[s]),h={"default-node":m=>c.jsx(Rpt,{parentWorkflowName:r,...m,stepsFlow:f}),"condition-node":Ipt,"after-node":Ppt,"loop-result-node":$pt,"nested-node":m=>c.jsx(Mpt,{parentWorkflowName:r,...m,stepsFlow:f})};return E.useEffect(()=>{t&&setTimeout(()=>{i(!0)},500)},[t]),c.jsx("div",{className:"w-full h-full relative bg-surface1",children:a?c.jsxs(Net,{nodes:o,edges:d.map(m=>({...m,style:{...m.style,stroke:p[`${r}.${m.data?.previousStepId}`]?.status==="success"&&p[`${r}.${m.data?.nextStepId}`]||m.data?.conditionNode&&!p[`${r}.${m.data?.previousStepId}`]&&p[`${r}.${m.data?.nextStepId}`]?.status?"#22c55e":void 0}})),fitView:!0,fitViewOptions:{maxZoom:1},minZoom:.01,maxZoom:1,nodeTypes:h,onNodesChange:u,children:[c.jsx(Ype,{position:"bottom-left"}),c.jsx(Pet,{variant:em.Lines,gap:12,size:.5})]}):c.jsx("div",{className:"w-full h-full flex items-center justify-center",children:c.jsx(Cn,{})})})}function Ven(){const{stepDetail:e,closeStepDetail:t}=H6();return e?c.jsxs("div",{className:"flex flex-col h-full",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border1 bg-surface1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[e.type==="map-config"&&c.jsx(BE,{className:"w-4 h-4",style:{color:Gi.map}}),e.type==="nested-graph"&&c.jsx(Yl,{className:"w-4 h-4",style:{color:Gi.workflow}}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx(ze,{variant:"ui-md",className:"text-neutral6 font-medium",children:e.type==="map-config"?`${e.stepName} Config`:`${e.stepName} Workflow`}),e.type==="map-config"&&e.stepId&&e.stepId!==e.stepName&&c.jsx(ze,{variant:"ui-xs",className:"text-neutral3",children:e.stepId})]})]}),c.jsx("button",{onClick:t,className:"p-1 hover:bg-surface3 rounded transition-colors","aria-label":"Close",children:c.jsx(Os,{className:"w-4 h-4 text-neutral3"})})]}),c.jsxs("div",{className:"flex-1 overflow-auto",children:[e.type==="map-config"&&e.mapConfig&&c.jsx(kw,{data:e.mapConfig}),e.type==="nested-graph"&&e.nestedGraph&&c.jsx("div",{className:"h-full min-h-[400px]",children:c.jsx(Ace,{children:c.jsx(Uen,{stepGraph:e.nestedGraph.stepGraph,open:!0,workflowName:e.nestedGraph.fullStep})},e.nestedGraph.fullStep)})]})]}):null}const Kpe=({requestContextSchema:e})=>{const{setSchemaValues:t,schemaValues:r}=Npt(),n=JSON.stringify(r),s=E.useMemo(()=>{try{const a=Dv(e);return vm(fm(a))}catch(a){return console.error("Failed to parse requestContextSchema:",a),null}},[e]);return s?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(ze,{as:"span",variant:"ui-md",className:"text-neutral3",children:"Request Context"}),c.jsx(ql,{content:n})]}),c.jsx(Qpe,{schema:s,onSubmit:t,submitButtonLabel:"Save",defaultValues:r})]}):c.jsx("div",{className:"text-neutral3",children:c.jsx(ze,{variant:"ui-sm",children:"Failed to parse request context schema"})})};function qen(){return E.useMemo(()=>{const e=typeof window<"u"?window.MASTRA_REQUEST_CONTEXT_PRESETS:void 0;if(!e||e==="%%MASTRA_REQUEST_CONTEXT_PRESETS%%")return null;try{const t=JSON.parse(e);if(typeof t=="object"&&t!==null&&!Array.isArray(t))return t}catch{console.warn("Failed to parse request context presets")}return null},[])}function Hen({workflowId:e,initialRunId:t}){const{data:r,isLoading:n,error:s}=oj(e),{createWorkflowRun:a,streamWorkflow:i,streamResult:o,isStreamingWorkflow:l,observeWorkflowStream:u,closeStreamsAndReset:d,resumeWorkflow:p,cancelWorkflowRun:f,isCancellingWorkflowRun:h}=E.useContext(Fm),{stepDetail:m,closeStepDetail:y}=H6(),[b,v]=E.useState("current-run"),[S,w]=E.useState(""),{handleCopy:k}=Zf({text:e}),_=Object.keys(r?.steps??{}).length,C=E.useMemo(()=>m?m.type==="map-config"?"Map Config":m.type==="nested-graph"?"Nested Workflow":"Node":null,[m]);E.useEffect(()=>{!S&&!t&&d()},[S,t]),E.useEffect(()=>{if(s){const A=s instanceof Error?s.message:"Failed to load workflow";We.error(`Error loading workflow: ${A}`)}},[s]),E.useEffect(()=>{m?v("node-details"):b==="node-details"&&v("current-run")},[m]);const T=A=>{b==="node-details"&&A!=="node-details"&&y(),v(A)};return s?null:c.jsxs("div",{className:"grid grid-rows-[auto_1fr] h-full overflow-y-auto",children:[c.jsx(Bpt,{icon:c.jsx(Yl,{}),title:r?.name||"",isLoading:n,children:c.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[c.jsxs(dn,{children:[c.jsx(pn,{asChild:!0,children:c.jsx("button",{onClick:k,className:"h-badge-default",children:c.jsx(Ft,{icon:c.jsx(Ql,{}),variant:"default",children:e})})}),c.jsx(sn,{children:"Copy Workflow ID for use in code"})]}),c.jsxs(Ft,{children:[_," step",_>1?"s":""]}),r?.isProcessorWorkflow&&c.jsx(Ft,{icon:c.jsx(pA,{className:"h-3 w-3"}),className:"bg-violet-500/20 text-violet-400",children:"Processor"})]})}),c.jsx("div",{className:"flex-1 overflow-auto border-t border-border1 flex flex-col",children:c.jsxs(TO,{defaultTab:"current-run",value:b,onValueChange:T,className:"h-full",children:[c.jsxs(AO,{children:[c.jsx(gl,{value:"current-run",children:"Current Run"}),r?.requestContextSchema&&c.jsx(gl,{value:"request-context",children:"Request Context"}),c.jsx(gl,{value:"run-options",children:"Run Options"}),m&&C&&c.jsxs(gl,{value:"node-details",onClose:()=>{y(),v("current-run")},children:[C," Details"]})]}),c.jsx(Tc,{value:"current-run",children:e?t?c.jsx(Ren,{workflowId:e,runId:t,setRunId:w,workflow:r??void 0,isLoading:n,createWorkflowRun:a,streamWorkflow:i,resumeWorkflow:p,streamResult:o,isStreamingWorkflow:l,isCancellingWorkflowRun:h,cancelWorkflowRun:f,observeWorkflowStream:u}):c.jsx(Fpt,{workflowId:e,setRunId:w,workflow:r??void 0,isLoading:n,createWorkflowRun:a,streamWorkflow:i,resumeWorkflow:p,streamResult:o,isStreamingWorkflow:l,isCancellingWorkflowRun:h,cancelWorkflowRun:f}):null}),r?.requestContextSchema&&c.jsx(Tc,{value:"request-context",children:c.jsx("div",{className:"p-5",children:c.jsx(Kpe,{requestContextSchema:r.requestContextSchema})})}),c.jsx(Tc,{value:"run-options",children:c.jsx(zpt,{})}),m&&c.jsx(Tc,{value:"node-details",children:c.jsx(Ven,{})})]})})]})}const bn={root:"flex flex-col gap-1.5",trigger:"w-full min-w-32 justify-between",triggerError:"border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 opacity-50",placeholder:"text-neutral3",popup:K("min-w-[var(--anchor-width)] w-max max-w-[500px] rounded-md bg-surface3 text-neutral5","shadow-elevated","origin-[var(--transform-origin)]","transition-[transform,scale,opacity] duration-150 ease-out","data-[starting-style]:scale-95 data-[starting-style]:opacity-0","data-[ending-style]:scale-95 data-[ending-style]:opacity-0"),positioner:"z-[100]",searchContainer:K("flex items-center border-b border-border1 px-3 py-2",Wr.colors),searchIcon:K("mr-2 h-4 w-4 shrink-0 text-neutral3",Wr.colors),searchInput:K("flex h-8 w-full rounded-md bg-transparent py-1 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-none",Wr.colors),empty:"[&:not(:empty)]:block hidden py-6 text-center text-sm text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:K("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",Wr.colors,"data-[highlighted]:bg-surface5 data-[highlighted]:text-neutral5"),itemSelected:"data-[selected]:bg-accent1Dark data-[selected]:text-accent1",checkContainer:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center",checkIcon:K("h-4 w-4 text-accent1",Wr.opacity),checkbox:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center rounded border",checkboxSelected:"bg-accent1 border-accent1",checkboxUnselected:"border-border1",checkboxIcon:"h-3 w-3 text-white",optionContent:"flex items-center gap-2 w-full min-w-0",optionText:"flex flex-col gap-0.5 min-w-0",optionLabel:"truncate",optionDescription:"text-xs text-neutral3 truncate",optionEnd:"ml-auto",error:"text-xs text-accent2"};function Ou({options:e,value:t,onValueChange:r,placeholder:n="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:o=!1,variant:l="default",size:u="md",open:d,onOpenChange:p,container:f,error:h}){const m=e.find(b=>b.value===t)??null,y=b=>{b&&r?.(b.value)};return c.jsxs("div",{className:bn.root,children:[c.jsxs($lt,{items:e,value:m,onValueChange:y,disabled:o,open:d,onOpenChange:p,children:[c.jsxs(Vlt,{className:K(U6({variant:l,size:u}),bn.trigger,h&&bn.triggerError,i),children:[c.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,c.jsx(BUr,{placeholder:n})]}),c.jsx(FBe,{className:bn.chevron})]}),c.jsx(Glt,{container:f,children:c.jsx(Wlt,{align:"start",sideOffset:4,className:bn.positioner,children:c.jsxs(Xlt,{className:bn.popup,children:[c.jsxs("div",{className:bn.searchContainer,children:[c.jsx(_m,{className:bn.searchIcon}),c.jsx(zlt,{className:bn.searchInput,placeholder:s})]}),c.jsx(tct,{className:bn.empty,children:a}),c.jsx(Hlt,{className:bn.list,children:b=>c.jsxs(ect,{value:b,className:K(bn.item,bn.itemSelected),children:[c.jsx("span",{className:bn.checkContainer,children:c.jsx(TVr,{children:c.jsx(ya,{className:bn.checkIcon})})}),c.jsxs("span",{className:bn.optionContent,children:[b.start,c.jsxs("span",{className:bn.optionText,children:[c.jsx("span",{className:bn.optionLabel,children:b.label}),b.description&&c.jsx("span",{className:bn.optionDescription,children:b.description})]}),b.end?c.jsx("div",{className:bn.optionEnd,children:b.end}):null]})]},b.value)})]})})})]}),h&&c.jsx("span",{className:bn.error,children:h})]})}function Qen({options:e,value:t=[],onValueChange:r,placeholder:n="Select options...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:o=!1,variant:l="default",size:u="md",open:d,onOpenChange:p,container:f,error:h}){const m=e.filter(v=>t.includes(v.value)),y=v=>{v&&r?.(v.map(S=>S.value))},b=m.length===0?n:`${m.length} selected`;return c.jsxs("div",{className:bn.root,children:[c.jsxs($lt,{multiple:!0,items:e,value:m,onValueChange:y,disabled:o,open:d,onOpenChange:p,children:[c.jsxs(Vlt,{className:K(U6({variant:l,size:u}),bn.trigger,h&&bn.triggerError,i),children:[c.jsx("span",{className:K("truncate",m.length===0&&bn.placeholder),children:b}),c.jsx(FBe,{className:bn.chevron})]}),c.jsx(Glt,{container:f,children:c.jsx(Wlt,{align:"start",sideOffset:4,className:bn.positioner,children:c.jsxs(Xlt,{className:bn.popup,children:[c.jsxs("div",{className:bn.searchContainer,children:[c.jsx(_m,{className:bn.searchIcon}),c.jsx(zlt,{className:bn.searchInput,placeholder:s})]}),c.jsx(tct,{className:bn.empty,children:a}),c.jsx(Hlt,{className:bn.list,children:v=>{const S=t.includes(v.value);return c.jsxs(ect,{value:v,className:bn.item,children:[c.jsx("span",{className:K(bn.checkbox,S?bn.checkboxSelected:bn.checkboxUnselected),children:S&&c.jsx(ya,{className:bn.checkboxIcon})}),c.jsxs("span",{className:bn.optionContent,children:[v.start,c.jsxs("span",{className:bn.optionText,children:[c.jsx("span",{className:bn.optionLabel,children:v.label}),v.description&&c.jsx("span",{className:bn.optionDescription,children:v.description})]}),v.end?c.jsx("div",{className:bn.optionEnd,children:v.end}):null]})]},v.value)}})]})})})]}),h&&c.jsx("span",{className:bn.error,children:h})]})}const Sy=()=>{const e=st(),{requestContext:t}=vs();return ur({queryKey:["workflows",t],queryFn:async()=>{const r=await e.listWorkflows(t);return Object.fromEntries(Object.entries(r).filter(([n,s])=>!s.isProcessorWorkflow))}})};function Gen({value:e,onValueChange:t,placeholder:r="Select a workflow...",searchPlaceholder:n="Search workflows...",emptyText:s="No workflows found.",className:a,disabled:i=!1,variant:o="default"}){const{data:l={},isLoading:u,isError:d,error:p}=Sy(),{navigate:f,paths:h}=Yt();E.useEffect(()=>{if(d){const b=p instanceof Error?p.message:"Failed to load workflows";We.error(`Error loading workflows: ${b}`)}},[d,p]);const m=Object.keys(l).map(b=>({label:l[b]?.name||b,value:b})),y=b=>{t?t(b):b&&b!==e&&f(h.workflowLink(b))};return c.jsx(Ou,{options:m,value:e,onValueChange:y,placeholder:u?"Loading workflows...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||u||d,variant:o})}function Hr({children:e,className:t,style:r}){const n=Upt("MainContentLayout");return c.jsx("main",{className:K("grid grid-rows-[auto_1fr] h-full items-start content-start",t),style:{...r,...n?{border:"3px dotted red"}:{}},children:e})}function Si({children:e,className:t,isCentered:r=!1,isDivided:n=!1,hasLeftServiceColumn:s=!1,style:a}){const i=Upt("MainContentContent"),o=Jpe({isCentered:r,isDivided:n,hasLeftServiceColumn:s,className:t});return c.jsx("div",{className:o,style:{...a,...i?{border:"3px dotted orange"}:{}},children:e})}const Jpe=({isCentered:e,isDivided:t,hasLeftServiceColumn:r,className:n})=>K("grid overflow-y-auto h-full ","overflow-x-auto min-w-[min-content]",{"items-start content-start":!e&&!t&&!r,"grid place-items-center":e,"grid-cols-[1fr_1fr]":t&&!r,"grid-cols-[12rem_1fr_1fr]":t&&r,"grid-cols-[auto_1fr]":!t&&r},n);function Upt(e){try{const t=localStorage.getItem("add-dev-style-to-components");return t?t.split(",").map(n=>n.trim()).filter(Boolean).includes(e):!1}catch(t){return console.error("Error reading or parsing localStorage:",t),!1}}const C4=()=>c.jsx(dqr,{className:K("w-1.5 bg-surface3","[&[data-separator='hover']]:!bg-surface4","[&[data-separator='active']]:!bg-surface5","focus:outline-none")}),T4=({collapsedSize:e,children:t,direction:r,...n})=>{const[s,a]=E.useState(!1),i=cqr(),o=()=>{i.current&&i.current.expand()};return c.jsx(Xde,{panelRef:i,collapsedSize:e,...n,onResize:l=>{e&&typeof e=="number"&&(l.inPixels<=e?a(!0):s&&a(!1))},children:s?c.jsxs(dn,{children:[c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx(pn,{asChild:!0,children:c.jsx(ye,{onClick:o,className:"!h-48 border-none",children:c.jsx(ve,{children:r==="left"?c.jsx(Wh,{}):c.jsx(JN,{})})})})}),c.jsx(sn,{children:"Expand"})]}):t})},Zen=({workflowId:e,children:t,leftSlot:r,rightSlot:n})=>{const{defaultLayout:s,onLayoutChange:a}=bct({id:`workflow-layout-${e}`,storage:localStorage}),i=Jpe({isCentered:!1,isDivided:!0,hasLeftServiceColumn:!!r});return c.jsxs(yct,{className:i,defaultLayout:s,onLayoutChange:a,children:[r&&c.jsxs(c.Fragment,{children:[c.jsx(T4,{direction:"left",id:"left-slot",minSize:200,maxSize:"30%",defaultSize:200,collapsedSize:60,collapsible:!0,children:r}),c.jsx(C4,{})]}),c.jsx(Xde,{id:"main-slot",children:t}),n&&c.jsxs(c.Fragment,{children:[c.jsx(C4,{}),c.jsx(T4,{direction:"right",id:"right-slot",minSize:300,maxSize:"50%",defaultSize:300,collapsedSize:60,collapsible:!0,children:n})]})]})},efe=()=>c.jsx(V6,{icon:c.jsx(Cn,{color:lze.neutral3}),title:c.jsx(Nr,{className:"ml-2 w-12 h-2"}),collapsible:!1}),Wen=({result:e,workflowId:t,isStreaming:r,metadata:n,toolCallId:s,toolApprovalMetadata:a,suspendPayload:i,toolName:o,isNetwork:l,toolCalled:u})=>{const{runId:d,status:p}=e||{},{data:f,isLoading:h}=oj(t),{data:m,isLoading:y}=bpt(t,{enabled:!!d&&!r}),b=m?.find(C=>C.runId===d),v=y||!b,S=typeof b?.snapshot=="object"?b?.snapshot:void 0,w=n?.mode==="network"?n.selectionReason:void 0,k=n?.mode==="network"?n.agentInput:void 0;let _=typeof i=="string"?c.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:i}):c.jsx(Wa,{data:i,"data-testid":"tool-suspend-payload"});return h||!f?c.jsx(efe,{}):c.jsxs(V6,{"data-testid":"workflow-badge",icon:c.jsx(Yl,{className:"text-accent3"}),title:f.name,initialCollapsed:!1,extraInfo:n?.mode==="network"&&c.jsx(Fpe,{selectionReason:w??"",input:k}),children:[!r&&!v&&c.jsx(Upe,{snapshot:S,workflowId:t,initialRunId:d,withoutTimeTravel:!0,children:c.jsx(VPe,{workflowId:t,workflow:f,runId:d})}),r&&c.jsx(VPe,{workflowId:t,workflow:f,runId:d}),_!==void 0&&i&&c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Workflow suspend payload"}),_]}),c.jsx(ij,{toolCalled:u??!!p,toolCallId:s,toolApprovalMetadata:a,toolName:o,isNetwork:l,isGenerateMode:n?.mode==="generate"})]})},VPe=({workflowId:e,workflow:t,runId:r})=>{const{Link:n}=Yt();return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-2 pb-2",children:[c.jsx(ye,{as:n,href:`/workflows/${e}/graph`,children:"Go to workflow"}),r&&c.jsx(ye,{as:n,href:`/workflows/${e}/graph/${r}`,children:"See run"})]}),c.jsx("div",{className:"rounded-md overflow-hidden h-[60vh] w-full",children:c.jsx(Lpt,{workflowId:e,workflow:t})})]})},Xen=e=>{const{setResult:t}=E.useContext(Fm);E.useEffect(()=>{e&&t(e)},[e])},Yen=({agentId:e,messages:t=[],metadata:r,toolCallId:n,toolApprovalMetadata:s,toolName:a,isNetwork:i,suspendPayload:o,toolCalled:l,isComplete:u=!1})=>{const d=r?.mode==="network"?r.selectionReason:void 0,p=r?.mode==="network"?r.agentInput:void 0;let f=t.length>0;i&&(f=l??t.every(m=>m.type==="text"?!0:!!m.toolOutput));let h=typeof o=="string"?c.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:o}):c.jsx(Wa,{data:o,"data-testid":"tool-suspend-payload"});return c.jsxs(V6,{"data-testid":"agent-badge",icon:c.jsx($i,{className:"text-accent1"}),title:e,initialCollapsed:u,extraInfo:r?.mode==="network"&&c.jsx(Fpe,{selectionReason:d??"",input:p}),children:[t.map((m,y)=>{if(m.type==="text")return c.jsx(xct,{children:m.content},y);let b;try{b=typeof m.toolOutput=="string"?JSON.parse(m.toolOutput):m.toolOutput}catch{b=m.toolOutput}return c.jsx(Ee.Fragment,{children:c.jsx(Zpt,{toolName:m.toolName,argsText:typeof m.args=="string"?m.args:JSON.stringify(m.args),result:b,args:m.args,status:{type:"complete"},type:"tool-call",toolCallId:m.toolCallId,addResult:()=>{},resume:()=>{},metadata:{mode:"stream"}})},y)}),h!==void 0&&o&&c.jsxs("div",{children:[c.jsx("p",{className:"font-medium pb-2",children:"Agent suspend payload"}),h]}),c.jsx(ij,{toolCalled:f,toolCallId:n,toolApprovalMetadata:s,toolName:a,isNetwork:i,isGenerateMode:r?.mode==="generate"})]})},Vpt=({threadId:e,agentId:t,memory:r})=>{const n=st(),{requestContext:s}=vs();return ur({queryKey:["memory","messages",e,t,"requestContext"],queryFn:async()=>e?await n.listThreadMessages(e,{agentId:t,requestContext:s}):null,enabled:r&&!!e,staleTime:0,gcTime:0,retry:!1,refetchOnWindowFocus:!1})},Ken=({agentId:e,result:t,metadata:r,toolCallId:n,toolApprovalMetadata:s,toolName:a,isNetwork:i,suspendPayload:o,toolCalled:l,isComplete:u})=>{const{data:d,isLoading:p}=Vpt({threadId:t?.subAgentThreadId,agentId:e,memory:!0});if(p)return c.jsx(efe,{});const f=d?.messages?vct(d.messages):[],h=t?.childMessages??nxr(f);return c.jsx(Yen,{agentId:e,messages:h,metadata:r,toolCallId:n,toolApprovalMetadata:s,toolName:a,isNetwork:i,suspendPayload:o,toolCalled:l,isComplete:u})};function Mk({children:e}){const t=e.replace(/\\n/g,`
|
|
570
570
|
`);return c.jsx(xct,{remarkPlugins:[NUe],components:etn,className:"space-y-3",children:t})}const qpt=Ee.memo(({children:e,language:t,...r})=>{const[n,s]=E.useState([]);return E.useEffect(()=>{pJr(e,t).then(a=>{a&&s(a)})},[e,t]),n.length?c.jsx("pre",{...r,children:c.jsx("code",{children:n.map((a,i)=>c.jsxs(c.Fragment,{children:[c.jsx("span",{children:a.map((o,l)=>{const u=typeof o.htmlStyle=="string"?void 0:o.htmlStyle;return c.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",style:u,children:o.content},l)})},i),i!==n.length-1&&`
|
|
@@ -612,4 +612,4 @@ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}
|
|
|
612
612
|
`),l=a;l<o.length;l++){var u=o[l];if(!(u.length>1024)){var d=h3e.test(u)?u.replace(h3e,"$1"):u;if(!d.match(/\S*Error: /)){for(var p of r){var f=p(d,e);if(f){i.push(f);break}}if(i.length>=m3e)break}}}return(function(h){if(!h.length)return[];var m=Array.from(h);return m.reverse(),m.slice(0,m3e).map((y=>{return dr({},y,{filename:y.filename||(b=m,b[b.length-1]||{}).filename,function:y.function||Bk});var b}))})(i)}}class imn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,r){var n=Do(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?r.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var r=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?r+": "+t.message:r}isDOMException(t){return M4(t,"DOMException")}isDOMError(t){return M4(t,"DOMError")}}class omn{match(t){return(r=>r instanceof Error)(t)}coerce(t,r){return{type:this.getType(t),value:this.getMessage(t,r),stack:this.getStack(t),cause:t.cause?r.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,r){var n=t.message;return n.error&&typeof n.error.message=="string"?String(n.error.message):String(n)}getStack(t){return t.stacktrace||t.stack||void 0}}class lmn{constructor(){}match(t){return M4(t,"ErrorEvent")&&t.error!=null}coerce(t,r){var n,s=r.apply(t.error);return s||{type:"ErrorEvent",value:t.message,stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}}var cmn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class umn{match(t){return typeof t=="string"}coerce(t,r){var n,[s,a]=this.getInfos(t);return{type:s??"Error",value:a??t,stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}getInfos(t){var r="Error",n=t,s=t.match(cmn);return s&&(r=s[1],n=s[2]),[r,n]}}var dmn=["fatal","error","warning","log","info","debug"];function ygt(e,t){t===void 0&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var s=r.slice(0,n).join(", ");if(!(s.length>t))return n===r.length||s.length<=t?s:s.slice(0,t)+"..."}return""}class pmn{match(t){return typeof t=="object"&&t!==null}coerce(t,r){var n,s=this.getErrorPropertyFromObject(t);return s?r.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(n=r.syntheticException)==null?void 0:n.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return mgt(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var r="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(r+=" with message: '"+t.message+"'"),r}if("message"in t&&typeof t.message=="string")return t.message;var n=this.getObjectClassName(t);return(n&&n!=="Object"?"'"+n+"'":"Object")+" captured as exception with keys: "+ygt(t)}isSeverityLevel(t){return Do(t)&&!nne(t)&&dmn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=t[r];if(Whn(n))return n}}getObjectClassName(t){try{var r=Object.getPrototypeOf(t);return r?r.constructor.name:void 0}catch{return}}}class fmn{match(t){return mgt(t)}coerce(t,r){var n,s=t.constructor.name;return{type:s,value:s+" captured as exception with keys: "+ygt(t),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}}class hmn{match(t){return sne(t)}coerce(t,r){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}}class mmn{match(t){return M4(t,"PromiseRejectionEvent")}coerce(t,r){var n,s=this.getUnhandledRejectionReason(t);return sne(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}:r.apply(s)}getUnhandledRejectionReason(t){if(sne(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var bgt=function(e,t){var{debugEnabled:r}=t===void 0?{}:t,n={k:function(s){if(Ze&&(kg.DEBUG||un.POSTHOG_DEBUG||r)&&!Ht(Ze.console)&&Ze.console){for(var a=("__rrweb_original__"in Ze.console[s])?Ze.console[s].__rrweb_original__:Ze.console[s],i=arguments.length,o=new Array(i>1?i-1:0),l=1;l<i;l++)o[l-1]=arguments[l];a(e,...o)}},info:function(){for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];n.k("log",...a)},warn:function(){for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];n.k("warn",...a)},error:function(){for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];n.k("error",...a)},critical:function(){for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];console.error(e,...a)},uninitializedWarning:s=>{n.error("You must initialize PostHog before calling "+s)},createLogger:(s,a)=>bgt(e+" "+s,a)};return n},Kt=bgt("[PostHog.js]"),Lo=Kt.createLogger,gmn=Lo("[ExternalScriptsLoader]"),g3e=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return gmn.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var n=Wt?.querySelectorAll("script");if(n){for(var s,a=function(){if(n[i].src===t){var l=n[i];return l.__posthog_loading_callback_fired?{v:r()}:(l.addEventListener("load",(u=>{l.__posthog_loading_callback_fired=!0,r(void 0,u)})),l.onerror=u=>r(u),{v:void 0})}},i=0;i<n.length;i++)if(s=a())return s.v}var o=()=>{if(!Wt)return r("document not found");var l=Wt.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=t,l.onload=p=>{l.__posthog_loading_callback_fired=!0,r(void 0,p)},l.onerror=p=>r(p),e.config.prepare_external_dependency_script&&(l=e.config.prepare_external_dependency_script(l)),!l)return r("prepare_external_dependency_script returned null");var u,d=Wt.querySelectorAll("body > script");d.length>0?(u=d[0].parentNode)==null||u.insertBefore(l,d[0]):Wt.body.appendChild(l)};Wt!=null&&Wt.body?o():Wt?.addEventListener("DOMContentLoaded",o)};un.__PosthogExtensions__=un.__PosthogExtensions__||{},un.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{var n="/static/"+t+".js?v="+e.version;if(t==="remote-config"&&(n="/array/"+e.config.token+"/config.js"),t==="toolbar"){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}var a=e.requestRouter.endpointFor("assets",n);g3e(e,a,r)},un.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var n=e.requestRouter.endpointFor("api",t);g3e(e,n,r)};var L4={};function sv(e,t,r){if(ka(e)){if(o3e&&e.forEach===o3e)e.forEach(t,r);else if("length"in e&&e.length===+e.length){for(var n=0,s=e.length;n<s;n++)if(n in e&&t.call(r,e[n],n)===L4)return}}}function La(e,t,r){if(!ma(e)){if(ka(e))return sv(e,t,r);if(qhn(e)){for(var n of e.entries())if(t.call(r,n[1],n[0])===L4)return}else for(var s in e)if(hgt.call(e,s)&&t.call(r,e[s],s)===L4)return}}var Zi=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return sv(r,(function(s){for(var a in s)s[a]!==void 0&&(e[a]=s[a])})),e},jO=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return sv(r,(function(s){sv(s,(function(a){e.push(a)}))})),e};function G$(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}var y3e=function(e){try{return e()}catch{return}},ymn=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.apply(this,r)}catch(s){Kt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Kt.critical(s)}}},Tfe=function(e){var t={};return La(e,(function(r,n){(Do(r)&&r.length>0||Sm(r))&&(t[n]=r)})),t};function bmn(e,t){return r=e,n=a=>Do(a)&&!Oy(t)?a.slice(0,t):a,s=new Set,(function a(i,o){return i!==Object(i)?n?n(i,o):i:s.has(i)?void 0:(s.add(i),ka(i)?(l=[],sv(i,(u=>{l.push(a(u))}))):(l={},La(i,((u,d)=>{s.has(u)||(l[d]=a(u,d))}))),l);var l})(r);var r,n,s}var vmn=["herokuapp.com","vercel.app","netlify.app"];function xmn(e){var t=e?.hostname;if(!Do(t))return!1;var r=t.split(".").slice(-2).join(".");for(var n of vmn)if(r===n)return!1;return!0}function vgt(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function co(e,t,r,n){var{capture:s=!1,passive:a=!0}=n??{};e?.addEventListener(t,r,{capture:s,passive:a})}var xgt="$people_distinct_id",YC="__alias",KC="__timers",b3e="$autocapture_disabled_server_side",ine="$heatmaps_enabled_server_side",v3e="$exception_capture_enabled_server_side",one="$error_tracking_suppression_rules",x3e="$error_tracking_capture_extension_exceptions",S3e="$web_vitals_enabled_server_side",Sgt="$dead_clicks_enabled_server_side",w3e="$web_vitals_allowed_metrics",XY="$session_recording_remote_config",F4="$sesid",wgt="$session_is_sampled",Qw="$enabled_feature_flags",JC="$early_access_features",lne="$feature_flag_details",eT="$stored_person_properties",Jx="$stored_group_properties",cne="$surveys",zP="$surveys_activated",B4="$flag_call_reported",Og="$user_state",une="$client_session_props",dne="$capture_rate_limit",pne="$initial_campaign_params",fne="$initial_referrer_info",z4="$initial_person_info",U4="$epp",Egt="__POSTHOG_TOOLBAR__",yC="$posthog_cookieless",Smn=[xgt,YC,"__cmpns",KC,"$session_recording_enabled_server_side",ine,F4,Qw,one,Og,JC,lne,Jx,eT,cne,B4,une,dne,pne,fne,U4,z4];function E3e(e){return e instanceof Element&&(e.id===Egt||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function p8(e){return!!e&&e.nodeType===1}function av(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function kgt(e){return!!e&&e.nodeType===3}function Ogt(e){return!!e&&e.nodeType===11}function Afe(e){return e?u8(e).split(/\s+/):[]}function k3e(e){var t=Ze?.location.href;return!!(t&&e&&e.some((r=>t.match(r))))}function V4(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Afe(t)}function _gt(e){return ma(e)?null:u8(e).split(/(\s+)/).filter((t=>pN(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function bj(e){var t="";return hne(e)&&!Ngt(e)&&e.childNodes&&e.childNodes.length&&La(e.childNodes,(function(r){var n;kgt(r)&&r.textContent&&(t+=(n=_gt(r.textContent))!==null&&n!==void 0?n:"")})),u8(t)}function Cgt(e){return Ht(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Dfe=["a","button","form","input","select","textarea","label"];function Tgt(e,t){if(Ht(t))return!0;var r,n=function(a){if(t.some((i=>a.matches(i))))return{v:!0}};for(var s of e)if(r=n(s))return r.v;return!1}function Agt(e){var t=e.parentNode;return!(!t||!p8(t))&&t}var wmn=["next","previous","prev",">","<"],O3e=10,_3e=[".ph-no-rageclick",".ph-no-capture"];function Emn(e,t){if(!Ze||Nfe(e))return!1;var r,n,s;if(nv(t)?(r=!!t&&_3e,n=void 0):(r=(s=t?.css_selector_ignorelist)!==null&&s!==void 0?s:_3e,n=t?.content_ignorelist),r===!1)return!1;var{targetElementList:a}=Dgt(e,!1);return!(function(i,o){if(i===!1||Ht(i))return!1;var l;if(i===!0)l=wmn;else{if(!ka(i))return!1;if(i.length>O3e)return Kt.error("[PostHog] content_ignorelist array cannot exceed "+O3e+" items. Use css_selector_ignorelist for more complex matching."),!1;l=i.map((u=>u.toLowerCase()))}return o.some((u=>{var{safeText:d,ariaLabel:p}=u;return l.some((f=>d.includes(f)||p.includes(f)))}))})(n,a.map((i=>{var o;return{safeText:bj(i).toLowerCase(),ariaLabel:((o=i.getAttribute("aria-label"))==null?void 0:o.toLowerCase().trim())||""}})))&&!Tgt(a,r)}var Nfe=e=>!e||av(e,"html")||!p8(e),Dgt=(e,t)=>{if(!Ze||Nfe(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],s=e;s.parentNode&&!av(s,"body");)if(Ogt(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var a=Agt(s);if(!a)break;if(t||Dfe.indexOf(a.tagName.toLowerCase())>-1)r=!0;else{var i=Ze.getComputedStyle(a);i&&i.getPropertyValue("cursor")==="pointer"&&(r=!0)}n.push(a),s=a}return{parentIsUsefulElement:r,targetElementList:n}};function kmn(e,t,r,n,s){var a,i,o,l;if(r===void 0&&(r=void 0),!Ze||Nfe(e)||(a=r)!=null&&a.url_allowlist&&!k3e(r.url_allowlist)||(i=r)!=null&&i.url_ignorelist&&k3e(r.url_ignorelist))return!1;if((o=r)!=null&&o.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((m=>t.type===m)))return!1}var{parentIsUsefulElement:d,targetElementList:p}=Dgt(e,n);if(!(function(m,y){var b=y?.element_allowlist;if(Ht(b))return!0;var v,S=function(k){if(b.some((_=>k.tagName.toLowerCase()===_)))return{v:!0}};for(var w of m)if(v=S(w))return v.v;return!1})(p,r)||!Tgt(p,(l=r)==null?void 0:l.css_selector_allowlist))return!1;var f=Ze.getComputedStyle(e);if(f&&f.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(s||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(t.type)>=0;default:return d?(s||["click"]).indexOf(t.type)>=0:(s||["click"]).indexOf(t.type)>=0&&(Dfe.indexOf(h)>-1||e.getAttribute("contenteditable")==="true")}}function hne(e){for(var t=e;t.parentNode&&!av(t,"body");t=t.parentNode){var r=V4(t);if(rs(r,"ph-sensitive")||rs(r,"ph-no-capture"))return!1}if(rs(V4(e),"ph-include"))return!0;var n=e.type||"";if(Do(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!(Do(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function Ngt(e){return!!(av(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||av(e,"select")||av(e,"textarea")||e.getAttribute("contenteditable")==="true")}var Igt="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Omn=new RegExp("^(?:"+Igt+")$"),_mn=new RegExp(Igt),jgt="\\d{3}-?\\d{2}-?\\d{4}",Cmn=new RegExp("^("+jgt+")$"),Tmn=new RegExp("("+jgt+")");function pN(e,t){return t===void 0&&(t=!0),!(ma(e)||Do(e)&&(e=u8(e),(t?Omn:_mn).test((e||"").replace(/[- ]/g,""))||(t?Cmn:Tmn).test(e)))}function Rgt(e){var t=bj(e);return pN(t=(t+" "+Pgt(e)).trim())?t:""}function Pgt(e){var t="";return e&&e.childNodes&&e.childNodes.length&&La(e.childNodes,(function(r){var n;if(r&&((n=r.tagName)==null?void 0:n.toLowerCase())==="span")try{var s=bj(r);t=(t+" "+s).trim(),r.childNodes&&r.childNodes.length&&(t=(t+" "+Pgt(r)).trim())}catch(a){Kt.error("[AutoCapture]",a)}})),t}function Amn(e){return(function(t){var r=t.map((n=>{var s,a,i="";if(n.tag_name&&(i+=n.tag_name),n.attr_class)for(var o of(n.attr_class.sort(),n.attr_class))i+="."+o.replace(/"/g,"");var l=dr({},n.text?{text:n.text}:{},{"nth-child":(s=n.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(a=n.nth_of_type)!==null&&a!==void 0?a:0},n.href?{href:n.href}:{},n.attr_id?{attr_id:n.attr_id}:{},n.attributes),u={};return G$(l).sort(((d,p)=>{var[f]=d,[h]=p;return f.localeCompare(h)})).forEach((d=>{var[p,f]=d;return u[C3e(p.toString())]=C3e(f.toString())})),i+=":",i+=G$(u).map((d=>{var[p,f]=d;return p+'="'+f+'"'})).join("")}));return r.join(";")})((function(t){return t.map((r=>{var n,s,a={text:(n=r.$el_text)==null?void 0:n.slice(0,400),tag_name:r.tag_name,href:(s=r.attr__href)==null?void 0:s.slice(0,2048),attr_class:Dmn(r),attr_id:r.attr__id,nth_child:r.nth_child,nth_of_type:r.nth_of_type,attributes:{}};return G$(r).filter((i=>{var[o]=i;return o.indexOf("attr__")===0})).forEach((i=>{var[o,l]=i;return a.attributes[o]=l})),a}))})(e))}function C3e(e){return e.replace(/"|\\"/g,'\\"')}function Dmn(e){var t=e.attr__class;return t?ka(t)?t:Afe(t):void 0}class $gt{constructor(t){this.disabled=t===!1;var r=qo(t)?t:{};this.thresholdPx=r.threshold_px||30,this.timeoutMs=r.timeout_ms||1e3,this.clickCount=r.click_count||3,this.clicks=[]}isRageClick(t,r,n){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(t-s.x)+Math.abs(r-s.y)<this.thresholdPx&&n-s.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:r,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:r,timestamp:n}];return!1}}var YY="$copy_autocapture",jg=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({}),q4=e=>{var t=Wt?.createElement("a");return Ht(t)?null:(t.href=e,t)},Nmn=function(e,t){var r,n;t===void 0&&(t="&");var s=[];return La(e,(function(a,i){Ht(a)||Ht(i)||i==="undefined"||(r=encodeURIComponent((o=>o instanceof File)(a)?a.name:a.toString()),n=encodeURIComponent(i),s[s.length]=n+"="+r)})),s.join(t)},H4=function(e,t){for(var r,n=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<n.length;s++){var a=n[s].split("=");if(a[0]===t){r=a;break}}if(!ka(r)||r.length<2)return"";var i=r[1];try{i=decodeURIComponent(i)}catch{Kt.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},vj=function(e,t,r){if(!e||!t||!t.length)return e;for(var n=e.split("#"),s=n[0]||"",a=n[1],i=s.split("?"),o=i[1],l=i[0],u=(o||"").split("&"),d=[],p=0;p<u.length;p++){var f=u[p].split("=");ka(f)&&(t.includes(f[0])?d.push(f[0]+"="+r):d.push(u[p]))}var h=l;return o!=null&&(h+="?"+d.join("&")),a!=null&&(h+="#"+a),h},Q4=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},T3e=Lo("[AutoCapture]");function KY(e,t){return t.length>e?t.slice(0,e)+"...":t}function Imn(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!p8(t));return t}function jmn(e,t,r,n){var s=e.tagName.toLowerCase(),a={tag_name:s};Dfe.indexOf(s)>-1&&!r&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?a.$el_text=KY(1024,Rgt(e)):a.$el_text=KY(1024,bj(e)));var i=V4(e);i.length>0&&(a.classes=i.filter((function(d){return d!==""}))),La(e.attributes,(function(d){var p;if((!Ngt(e)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(n==null||!n.includes(d.name))&&!t&&pN(d.value)&&(p=d.name,!Do(p)||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")){var f=d.value;d.name==="class"&&(f=Afe(f).join(" ")),a["attr__"+d.name]=KY(1024,f)}}));for(var o=1,l=1,u=e;u=Imn(u);)o++,u.tagName===e.tagName&&l++;return a.nth_child=o,a.nth_of_type=l,a}function Rmn(e,t){for(var r,n,{e:s,maskAllElementAttributes:a,maskAllText:i,elementAttributeIgnoreList:o,elementsChainAsString:l}=t,u=[e],d=e;d.parentNode&&!av(d,"body");)Ogt(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var p,f=[],h={},m=!1,y=!1;if(La(u,(k=>{var _=hne(k);k.tagName.toLowerCase()==="a"&&(m=k.getAttribute("href"),m=_&&m&&pN(m)&&m),rs(V4(k),"ph-no-capture")&&(y=!0),f.push(jmn(k,a,i,o));var C=(function(T){if(!hne(T))return{};var A={};return La(T.attributes,(function(N){if(N.name&&N.name.indexOf("data-ph-capture-attribute")===0){var j=N.name.replace("data-ph-capture-attribute-",""),R=N.value;j&&R&&pN(R)&&(A[j]=R)}})),A})(k);Zi(h,C)})),y)return{props:{},explicitNoCapture:y};if(i||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?f[0].$el_text=Rgt(e):f[0].$el_text=bj(e)),m){var b,v;f[0].attr__href=m;var S=(b=q4(m))==null?void 0:b.host,w=Ze==null||(v=Ze.location)==null?void 0:v.host;S&&w&&S!==w&&(p=m)}return{props:Zi({$event_type:s.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:Amn(f)},(r=f[0])!=null&&r.$el_text?{$el_text:(n=f[0])==null?void 0:n.$el_text}:{},p&&s.type==="click"?{$external_click_url:p}:{},h)}}class Pmn{constructor(t){this.P=!1,this.T=null,this.R=!1,this.instance=t,this.rageclicks=new $gt(t.config.rageclick),this.I=null}get F(){var t,r,n=qo(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map((s=>new RegExp(s))),n.url_ignorelist=(r=n.url_ignorelist)==null?void 0:r.map((s=>new RegExp(s))),n}C(){if(this.isBrowserSupported()){if(Ze&&Wt){var t=n=>{n=n||Ze?.event;try{this.M(n)}catch(s){T3e.error("Failed to capture event",s)}};if(co(Wt,"submit",t,{capture:!0}),co(Wt,"change",t,{capture:!0}),co(Wt,"click",t,{capture:!0}),this.F.capture_copied_text){var r=n=>{n=n||Ze?.event,this.M(n,YY)};co(Wt,"copy",r,{capture:!0}),co(Wt,"cut",r,{capture:!0})}}}else T3e.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.C(),this.P=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.R=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[b3e]:!!t.autocapture_opt_out}),this.T=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.I=t}getElementSelectors(t){var r,n=[];return(r=this.I)==null||r.forEach((s=>{var a=Wt?.querySelectorAll(s);a?.forEach((i=>{t===i&&n.push(s)}))})),n}get isEnabled(){var t,r,n=(t=this.instance.persistence)==null?void 0:t.props[b3e],s=this.T;if(Oy(s)&&!nv(n)&&!this.instance.O())return!1;var a=(r=this.T)!==null&&r!==void 0?r:!!n;return!!this.instance.config.autocapture&&!a}M(t,r){if(r===void 0&&(r="$autocapture"),this.isEnabled){var n,s=Cgt(t);kgt(s)&&(s=s.parentNode||null),r==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&Emn(s,this.instance.config.rageclick)&&this.M(t,"$rageclick");var a=r===YY;if(s&&kmn(s,t,this.F,a,a?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:o}=Rmn(s,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(o)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(i.$element_selectors=l),r===YY){var u,d=_gt(Ze==null||(u=Ze.getSelection())==null?void 0:u.toString()),p=t.type||"clipboard";if(!d)return!1;i.$selected_content=d,i.$copy_type=p}return this.instance.capture(r,i),!0}}}isBrowserSupported(){return rv(Wt?.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Sm(e)&&isFinite(e)&&Math.floor(e)===e});var A3e="0123456789abcdef";class G4{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,r,n,s){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(s)||t<0||r<0||n<0||s<0||t>0xffffffffffff||r>4095||n>1073741823||s>4294967295)throw new RangeError("invalid field value");var a=new Uint8Array(16);return a[0]=t/Math.pow(2,40),a[1]=t/Math.pow(2,32),a[2]=t/Math.pow(2,24),a[3]=t/Math.pow(2,16),a[4]=t/Math.pow(2,8),a[5]=t,a[6]=112|r>>>8,a[7]=r,a[8]=128|n>>>24,a[9]=n>>>16,a[10]=n>>>8,a[11]=n,a[12]=s>>>24,a[13]=s>>>16,a[14]=s>>>8,a[15]=s,new G4(a)}toString(){for(var t="",r=0;r<this.bytes.length;r++)t=t+A3e.charAt(this.bytes[r]>>>4)+A3e.charAt(15&this.bytes[r]),r!==3&&r!==5&&r!==7&&r!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new G4(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var r=0;r<16;r++){var n=this.bytes[r]-t.bytes[r];if(n!==0)return Math.sign(n)}return 0}}class $mn{constructor(){this.A=0,this.D=0,this.j=new Mmn}generate(){var t=this.generateOrAbort();if(Ht(t)){this.A=0;var r=this.generateOrAbort();if(Ht(r))throw new Error("Could not generate UUID after timestamp reset");return r}return t}generateOrAbort(){var t=Date.now();if(t>this.A)this.A=t,this.L();else{if(!(t+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return G4.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var D3e,Mgt=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Ze&&!Ht(Ze.crypto)&&crypto.getRandomValues&&(Mgt=e=>crypto.getRandomValues(e));class Mmn{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(Mgt(this.N),this.U=0),this.N[this.U++]}}var Ub=()=>Lmn().toString(),Lmn=()=>(D3e||(D3e=new $mn)).generate(),bC="",Fmn=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Bmn(e,t){if(t){var r=(function(s,a){if(a===void 0&&(a=Wt),bC)return bC;if(!a||["localhost","127.0.0.1"].includes(s))return"";for(var i=s.split("."),o=Math.min(i.length,8),l="dmn_chk_"+Ub();!bC&&o--;){var u=i.slice(o).join("."),d=l+"=1;domain=."+u+";path=/";a.cookie=d+";max-age=3",a.cookie.includes(l)&&(a.cookie=d+";max-age=0",bC=u)}return bC})(e);if(!r){var n=(s=>{var a=s.match(Fmn);return a?a[0]:""})(e);n!==r&&Kt.info("Warning: cookie subdomain discovery mismatch",n,r),r=n}return r?"; domain=."+r:""}return""}var sm={H:()=>!!Wt,B:function(e){Kt.error("cookieStore error: "+e)},q:function(e){if(Wt){try{for(var t=e+"=",r=Wt.cookie.split(";").filter((a=>a.length)),n=0;n<r.length;n++){for(var s=r[n];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return decodeURIComponent(s.substring(t.length,s.length))}}catch{}return null}},W:function(e){var t;try{t=JSON.parse(sm.q(e))||{}}catch{}return t},G:function(e,t,r,n,s){if(Wt)try{var a="",i="",o=Bmn(Wt.location.hostname,n);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),a="; expires="+l.toUTCString()}s&&(i="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+a+"; SameSite=Lax; path=/"+o+i;return u.length>3686.4&&Kt.warn("cookieStore warning: large cookie, len="+u.length),Wt.cookie=u,u}catch{return}},V:function(e,t){if(Wt!=null&&Wt.cookie)try{sm.G(e,"",-1,t)}catch{return}}},JY=null,bi={H:function(){if(!Oy(JY))return JY;var e=!0;if(Ht(Ze))e=!1;else try{var t="__mplssupport__";bi.G(t,"xyz"),bi.q(t)!=='"xyz"'&&(e=!1),bi.V(t)}catch{e=!1}return e||Kt.error("localStorage unsupported; falling back to cookie store"),JY=e,e},B:function(e){Kt.error("localStorage error: "+e)},q:function(e){try{return Ze?.localStorage.getItem(e)}catch(t){bi.B(t)}return null},W:function(e){try{return JSON.parse(bi.q(e))||{}}catch{}return null},G:function(e,t){try{Ze?.localStorage.setItem(e,JSON.stringify(t))}catch(r){bi.B(r)}},V:function(e){try{Ze?.localStorage.removeItem(e)}catch(t){bi.B(t)}}},zmn=["distinct_id",F4,wgt,U4,z4],UP=dr({},bi,{W:function(e){try{var t={};try{t=sm.W(e)||{}}catch{}var r=Zi(t,JSON.parse(bi.q(e)||"{}"));return bi.G(e,r),r}catch{}return null},G:function(e,t,r,n,s,a){try{bi.G(e,t,void 0,void 0,a);var i={};zmn.forEach((o=>{t[o]&&(i[o]=t[o])})),Object.keys(i).length&&sm.G(e,i,r,n,s,a)}catch(o){bi.B(o)}},V:function(e,t){try{Ze?.localStorage.removeItem(e),sm.V(e,t)}catch(r){bi.B(r)}}}),VP={},Umn={H:function(){return!0},B:function(e){Kt.error("memoryStorage error: "+e)},q:function(e){return VP[e]||null},W:function(e){return VP[e]||null},G:function(e,t){VP[e]=t},V:function(e){delete VP[e]}},qx=null,fl={H:function(){if(!Oy(qx))return qx;if(qx=!0,Ht(Ze))qx=!1;else try{var e="__support__";fl.G(e,"xyz"),fl.q(e)!=='"xyz"'&&(qx=!1),fl.V(e)}catch{qx=!1}return qx},B:function(e){Kt.error("sessionStorage error: ",e)},q:function(e){try{return Ze?.sessionStorage.getItem(e)}catch(t){fl.B(t)}return null},W:function(e){try{return JSON.parse(fl.q(e))||null}catch{}return null},G:function(e,t){try{Ze?.sessionStorage.setItem(e,JSON.stringify(t))}catch(r){fl.B(r)}},V:function(e){try{Ze?.sessionStorage.removeItem(e)}catch(t){fl.B(t)}}},_g=(function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e})({});class Vmn{constructor(t){this._instance=t}get F(){return this._instance.config}get consent(){return this.J()?_g.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===_g.DENIED||this.consent===_g.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===_g.DENIED}optInOut(t){this.Y.G(this.X,t?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:t,opt_out_capturing_cookie_prefix:r,consent_persistence_name:n}=this._instance.config;return n||(r?r+t:"__ph_opt_in_out_"+t)}get K(){var t=this.Y.q(this.X);return ZY(t)?_g.GRANTED:rs(Ghn,t)?_g.DENIED:_g.PENDING}get Y(){if(!this.Z){var t=this.F.opt_out_capturing_persistence_type;this.Z=t==="localStorage"?bi:sm;var r=t==="localStorage"?sm:bi;r.q(this.X)&&(this.Z.q(this.X)||this.optInOut(ZY(r.q(this.X))),r.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!vgt([cd?.doNotTrack,cd?.msDoNotTrack,un.doNotTrack],(t=>ZY(t)))}}var qP=Lo("[Dead Clicks]"),qmn=()=>!0,Hmn=e=>{var t,r=!((t=e.instance.persistence)==null||!t.get_property(Sgt)),n=e.instance.config.capture_dead_clicks;return nv(n)?n:!!qo(n)||r};class Lgt{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(t,r,n){this.instance=t,this.isEnabled=r,this.onCapture=n,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[Sgt]:t?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(t){var r,n;(r=un.__PosthogExtensions__)!=null&&r.initDeadClicksAutocapture&&t(),(n=un.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?qP.error("failed to load script",s):t()}))}et(){var t;if(Wt){if(!this.tt&&(t=un.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var r=qo(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};r.__onCapture=this.onCapture,this.tt=un.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,r),this.tt.start(Wt),qP.info("starting...")}}else qP.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,qP.info("stopping..."))}}var vC=Lo("[ExceptionAutocapture]");class Qmn{constructor(t){var r,n,s;this.rt=()=>{var a;if(Ze&&this.isEnabled&&(a=un.__PosthogExtensions__)!=null&&a.errorWrappingFunctions){var i=un.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=un.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=un.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=i(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=o(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(u){vC.error("failed to start",u),this.lt()}}},this._instance=t,this.ut=!((r=this._instance.persistence)==null||!r.props[v3e]),this.F=this.ht(),this.vt=new Zhn({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10,refillInterval:1e4,h:vC}),this.startIfEnabled()}ht(){var t=this._instance.config.capture_exceptions,r={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return qo(t)?r=dr({},r,t):(Ht(t)?this.ut:t)&&(r=dr({},r,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),r}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(vC.info("enabled"),this.it(this.rt))}it(t){var r,n;(r=un.__PosthogExtensions__)!=null&&r.errorWrappingFunctions&&t(),(n=un.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(s=>{if(s)return vC.error("failed to load script",s);t()}))}lt(){var t,r,n;(t=this.st)==null||t.call(this),this.st=void 0,(r=this.nt)==null||r.call(this),this.nt=void 0,(n=this.ot)==null||n.call(this),this.ot=void 0}onRemoteConfig(t){var r=t.autocaptureExceptions;this.ut=!!r||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[v3e]:this.ut}),this.startIfEnabled()}captureException(t){var r,n,s=(r=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&r!==void 0?r:"Exception";this.vt.consumeRateLimit(s)?vC.info("Skipping exception capture because of client rate limiting.",{exception:s}):this._instance.exceptions.sendExceptionEvent(t)}}function N3e(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],s=r(n);return rv(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}class Gmn{constructor(t){var r;this._instance=t,this.dt=(Ze==null||(r=Ze.location)==null?void 0:r.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(Kt.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,Kt.info("History API monitoring stopped")}monitorHistoryChanges(){var t,r;if(Ze&&Ze.history){var n=this;(t=Ze.history.pushState)!=null&&t.__posthog_wrapped__||N3e(Ze.history,"pushState",(s=>function(a,i,o){s.call(this,a,i,o),n.ft("pushState")})),(r=Ze.history.replaceState)!=null&&r.__posthog_wrapped__||N3e(Ze.history,"replaceState",(s=>function(a,i,o){s.call(this,a,i,o),n.ft("replaceState")})),this.gt()}}ft(t){try{var r,n=Ze==null||(r=Ze.location)==null?void 0:r.pathname;if(!n)return;n!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.dt=n}catch(s){Kt.error("Error capturing "+t+" pageview",s)}}gt(){if(!this.ct){var t=()=>{this.ft("popstate")};co(Ze,"popstate",t),this.ct=()=>{Ze&&Ze.removeEventListener("popstate",t)}}}}var eK=Lo("[SegmentIntegration]");function Zmn(e,t){var r=e.config.segment;if(!r)return t();(function(n,s){var a=n.config.segment;if(!a)return s();var i=l=>{var u=()=>l.anonymousId()||Ub();n.config.get_device_id=u,l.id()&&(n.register({distinct_id:l.id(),$device_id:u()}),n.persistence.set_property(Og,"identified")),s()},o=a.user();"then"in o&&rv(o.then)?o.then((l=>i(l))):i(o)})(e,(()=>{r.register((n=>{Promise&&Promise.resolve||eK.warn("This browser does not have Promise support, and can not use the segment integration");var s=(a,i)=>{if(!i)return a;a.event.userId||a.event.anonymousId===n.get_distinct_id()||(eK.info("No userId set, resetting PostHog"),n.reset()),a.event.userId&&a.event.userId!==n.get_distinct_id()&&(eK.info("UserId set, identifying with PostHog"),n.identify(a.event.userId));var o=n.calculateEventProperties(i,a.event.properties);return a.event.properties=Object.assign({},o,a.event.properties),a};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:a=>s(a,a.event.event),page:a=>s(a,"$pageview"),identify:a=>s(a,"$identify"),screen:a=>s(a,"$screen")}})(e)).then((()=>{t()}))}))}var Fgt="posthog-js";function Bgt(e,t){var{organization:r,projectId:n,prefix:s,severityAllowList:a=["error"],sendExceptionsToPostHog:i=!0}=t===void 0?{}:t;return o=>{var l,u,d,p,f;if(!(a==="*"||a.includes(o.level))||!e.__loaded)return o;o.tags||(o.tags={});var h=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());o.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var m=((l=o.exception)==null?void 0:l.values)||[],y=m.map((v=>dr({},v,{stacktrace:v.stacktrace?dr({},v.stacktrace,{type:"raw",frames:(v.stacktrace.frames||[]).map((S=>dr({},S,{platform:"web:javascript"})))}):void 0}))),b={$exception_message:((u=m[0])==null?void 0:u.value)||o.message,$exception_type:(d=m[0])==null?void 0:d.type,$exception_level:o.level,$exception_list:y,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((p=m[0])==null?void 0:p.value)||o.message,$sentry_exception_type:(f=m[0])==null?void 0:f.type,$sentry_tags:o.tags};return r&&n&&(b.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+o.event_id),i&&e.exceptions.sendExceptionEvent(b),o}}class Wmn{constructor(t,r,n,s,a,i){this.name=Fgt,this.setupOnce=function(o){o(Bgt(t,{organization:r,projectId:n,prefix:s,severityAllowList:a,sendExceptionsToPostHog:i==null||i}))}}}var Xmn=Ze!=null&&Ze.location?Q4(Ze.location.hash,"__posthog")||Q4(location.hash,"state"):null,I3e="_postHogToolbarParams",j3e=Lo("[Toolbar]"),Sb=(function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e})(Sb||{});class Ymn{constructor(t){this.instance=t}_t(t){un.ph_toolbar_state=t}yt(){var t;return(t=un.ph_toolbar_state)!==null&&t!==void 0?t:Sb.UNINITIALIZED}maybeLoadToolbar(t,r,n){if(t===void 0&&(t=void 0),r===void 0&&(r=void 0),n===void 0&&(n=void 0),!Ze||!Wt)return!1;t=t??Ze.location,n=n??Ze.history;try{if(!r){try{Ze.localStorage.setItem("test","test"),Ze.localStorage.removeItem("test")}catch{return!1}r=Ze?.localStorage}var s,a=Xmn||Q4(t.hash,"__posthog")||Q4(t.hash,"state"),i=a?y3e((()=>JSON.parse(atob(decodeURIComponent(a)))))||y3e((()=>JSON.parse(decodeURIComponent(a)))):null;return i&&i.action==="ph_authorize"?((s=i).source="url",s&&Object.keys(s).length>0&&(i.desiredHash?t.hash=i.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((s=JSON.parse(r.getItem(I3e)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}bt(t){var r=un.ph_load_toolbar||un.ph_load_editor;!ma(r)&&rv(r)?r(t,this.instance):j3e.warn("No toolbar load function found")}loadToolbar(t){var r=!(Wt==null||!Wt.getElementById(Egt));if(!Ze||r)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=dr({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(Ze.localStorage.setItem(I3e,JSON.stringify(dr({},s,{source:void 0}))),this.yt()===Sb.LOADED)this.bt(s);else if(this.yt()===Sb.UNINITIALIZED){var a;this._t(Sb.LOADING),(a=un.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return j3e.error("[Toolbar] Failed to load",i),void this._t(Sb.UNINITIALIZED);this._t(Sb.LOADED),this.bt(s)})),co(Ze,"turbolinks:load",(()=>{this._t(Sb.UNINITIALIZED),this.loadToolbar(s)}))}return!0}wt(t){return this.loadToolbar(t)}maybeLoadEditor(t,r,n){return t===void 0&&(t=void 0),r===void 0&&(r=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,r,n)}}var Kmn=Lo("[TracingHeaders]");class Jmn{constructor(t){this.xt=void 0,this.St=void 0,this.rt=()=>{var r,n;Ht(this.xt)&&((r=un.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),Ht(this.St)&&((n=un.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}it(t){var r,n;(r=un.__PosthogExtensions__)!=null&&r.tracingHeadersPatchFns&&t(),(n=un.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(s=>{if(s)return Kmn.error("failed to load script",s);t()}))}startIfEnabledOrStop(){var t,r;this._instance.config.__add_tracing_headers?this.it(this.rt):((t=this.xt)==null||t.call(this),(r=this.St)==null||r.call(this),this.xt=void 0,this.St=void 0)}}var Cp="Mobile",Z4="iOS",Qh="Android",fN="Tablet",zgt=Qh+" "+fN,Ugt="iPad",Vgt="Apple",qgt=Vgt+" Watch",hN="Safari",zk="BlackBerry",Hgt="Samsung",Qgt=Hgt+"Browser",Ggt=Hgt+" Internet",S1="Chrome",egn=S1+" OS",Zgt=S1+" "+Z4,Ife="Internet Explorer",Wgt=Ife+" "+Cp,jfe="Opera",tgn=jfe+" Mini",Rfe="Edge",Xgt="Microsoft "+Rfe,kE="Firefox",Ygt=kE+" "+Z4,mN="Nintendo",gN="PlayStation",OE="Xbox",Kgt=Qh+" "+Cp,Jgt=Cp+" "+hN,tT="Windows",mne=tT+" Phone",R3e="Nokia",gne="Ouya",eyt="Generic",rgn=eyt+" "+Cp.toLowerCase(),tyt=eyt+" "+fN.toLowerCase(),yne="Konqueror",gc="(\\d+(\\.\\d+)?)",tK=new RegExp("Version/"+gc),ngn=new RegExp(OE,"i"),sgn=new RegExp(gN+" \\w+","i"),agn=new RegExp(mN+" \\w+","i"),Pfe=new RegExp(zk+"|PlayBook|BB10","i"),ign={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},ogn=(e,t)=>t&&rs(t,Vgt)||(function(r){return rs(r,hN)&&!rs(r,S1)&&!rs(r,Qh)})(e),ryt=function(e,t){return t=t||"",rs(e," OPR/")&&rs(e,"Mini")?tgn:rs(e," OPR/")?jfe:Pfe.test(e)?zk:rs(e,"IE"+Cp)||rs(e,"WPDesktop")?Wgt:rs(e,Qgt)?Ggt:rs(e,Rfe)||rs(e,"Edg/")?Xgt:rs(e,"FBIOS")?"Facebook "+Cp:rs(e,"UCWEB")||rs(e,"UCBrowser")?"UC Browser":rs(e,"CriOS")?Zgt:rs(e,"CrMo")||rs(e,S1)?S1:rs(e,Qh)&&rs(e,hN)?Kgt:rs(e,"FxiOS")?Ygt:rs(e.toLowerCase(),yne.toLowerCase())?yne:ogn(e,t)?rs(e,Cp)?Jgt:hN:rs(e,kE)?kE:rs(e,"MSIE")||rs(e,"Trident/")?Ife:rs(e,"Gecko")?kE:""},lgn={[Wgt]:[new RegExp("rv:"+gc)],[Xgt]:[new RegExp(Rfe+"?\\/"+gc)],[S1]:[new RegExp("("+S1+"|CrMo)\\/"+gc)],[Zgt]:[new RegExp("CriOS\\/"+gc)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+gc)],[hN]:[tK],[Jgt]:[tK],[jfe]:[new RegExp("(Opera|OPR)\\/"+gc)],[kE]:[new RegExp(kE+"\\/"+gc)],[Ygt]:[new RegExp("FxiOS\\/"+gc)],[yne]:[new RegExp("Konqueror[:/]?"+gc,"i")],[zk]:[new RegExp(zk+" "+gc),tK],[Kgt]:[new RegExp("android\\s"+gc,"i")],[Ggt]:[new RegExp(Qgt+"\\/"+gc)],[Ife]:[new RegExp("(rv:|MSIE )"+gc)],Mozilla:[new RegExp("rv:"+gc)]},cgn=function(e,t){var r=ryt(e,t),n=lgn[r];if(Ht(n))return null;for(var s=0;s<n.length;s++){var a=n[s],i=e.match(a);if(i)return parseFloat(i[i.length-2])}return null},P3e=[[new RegExp(OE+"; "+OE+" (.*?)[);]","i"),e=>[OE,e&&e[1]||""]],[new RegExp(mN,"i"),[mN,""]],[new RegExp(gN,"i"),[gN,""]],[Pfe,[zk,""]],[new RegExp(tT,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[mne,""];if(new RegExp(Cp).test(t)&&!/IEMobile\b/.test(t))return[tT+" "+Cp,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var n=r[1],s=ign[n]||"";return/arm/i.test(t)&&(s="RT"),[tT,s]}return[tT,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Z4,t.join(".")]}return[Z4,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Ht(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Qh+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Qh+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Qh,t.join(".")]}return[Qh,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[egn,""]],[/Linux|debian/i,["Linux",""]]],$3e=function(e){return agn.test(e)?mN:sgn.test(e)?gN:ngn.test(e)?OE:new RegExp(gne,"i").test(e)?gne:new RegExp("("+mne+"|WPDesktop)","i").test(e)?mne:/iPad/.test(e)?Ugt:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?qgt:Pfe.test(e)?zk:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(R3e,"i").test(e)?R3e:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Cp).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Qh:zgt:Qh:new RegExp("(pda|"+Cp+")","i").test(e)?rgn:new RegExp(fN,"i").test(e)&&!new RegExp(fN+" pc","i").test(e)?tyt:""},HP="https?://(.*)",RO=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ugn=jO(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],RO),xj="<masked>",dgn=["li_fat_id"];function nyt(e,t,r){if(!Wt)return{};var n,s=t?jO([],RO,r||[]):[],a=syt(vj(Wt.URL,s,xj),e),i=(n={},La(dgn,(function(o){var l=sm.q(o);n[o]=l||null})),n);return Zi(i,a)}function syt(e,t){var r=ugn.concat(t||[]),n={};return La(r,(function(s){var a=H4(e,s);n[s]=a||null})),n}function ayt(e){var t=(function(a){return a?a.search(HP+"google.([^/?]*)")===0?"google":a.search(HP+"bing.com")===0?"bing":a.search(HP+"yahoo.com")===0?"yahoo":a.search(HP+"duckduckgo.com")===0?"duckduckgo":null:null})(e),r=t!="yahoo"?"q":"p",n={};if(!Oy(t)){n.$search_engine=t;var s=Wt?H4(Wt.referrer,r):"";s.length&&(n.ph_keyword=s)}return n}function M3e(){return navigator.language||navigator.userLanguage}function iyt(){return Wt?.referrer||"$direct"}function oyt(e,t){var r=e?jO([],RO,t||[]):[],n=su?.href.substring(0,1e3);return{r:iyt().substring(0,1e3),u:n?vj(n,r,xj):void 0}}function lyt(e){var t,{r,u:n}=e,s={$referrer:r,$referring_domain:r==null?void 0:r=="$direct"?"$direct":(t=q4(r))==null?void 0:t.host};if(n){s.$current_url=n;var a=q4(n);s.$host=a?.host,s.$pathname=a?.pathname;var i=syt(n);Zi(s,i)}if(r){var o=ayt(r);Zi(s,o)}return s}function cyt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function pgn(){try{return new Date().getTimezoneOffset()}catch{return}}function fgn(e,t){if(!Kc)return{};var r,n,s,a=e?jO([],RO,t||[]):[],[i,o]=(function(l){for(var u=0;u<P3e.length;u++){var[d,p]=P3e[u],f=d.exec(l),h=f&&(rv(p)?p(f,l):p);if(h)return h}return["",""]})(Kc);return Zi(Tfe({$os:i,$os_version:o,$browser:ryt(Kc,navigator.vendor),$device:$3e(Kc),$device_type:(n=Kc,s=$3e(n),s===Ugt||s===zgt||s==="Kobo"||s==="Kindle Fire"||s===tyt?fN:s===mN||s===OE||s===gN||s===gne?"Console":s===qgt?"Wearable":s?Cp:"Desktop"),$timezone:cyt(),$timezone_offset:pgn()}),{$current_url:vj(su?.href,a,xj),$host:su?.host,$pathname:su?.pathname,$raw_user_agent:Kc.length>1e3?Kc.substring(0,997)+"...":Kc,$browser_version:cgn(Kc,navigator.vendor),$browser_language:M3e(),$browser_language_prefix:(r=M3e(),typeof r=="string"?r.split("-")[0]:void 0),$screen_height:Ze?.screen.height,$screen_width:Ze?.screen.width,$viewport_height:Ze?.innerHeight,$viewport_width:Ze?.innerWidth,$lib:"web",$lib_version:kg.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var hb=Lo("[Web Vitals]"),L3e=9e5;class hgn{constructor(t){var r;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((n,s)=>dr({},n,{["$web_vitals_"+s.name+"_event"]:dr({},s),["$web_vitals_"+s.name+"_value"]:s.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=n=>{var s,a=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0);if(Ht(a))hb.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Tt();Ht(i)||(ma(n?.name)||ma(n?.value)?hb.error("Invalid metric received",n):this.Rt&&n.value>=this.Rt?hb.error("Ignoring metric with value >= "+this.Rt,n):(this.N.url!==i&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),Ht(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=Ht(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.N.metrics.push(dr({},n,{$current_url:i,$session_id:a.sessionId,$window_id:a.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var n,s,a,i,o=un.__PosthogExtensions__;Ht(o)||Ht(o.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:s,onFCP:a,onINP:i}=o.postHogWebVitalsCallbacks),n&&s&&a&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&a(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Pt.bind(this)),this.P=!0):hb.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.Et=!((r=this._instance.persistence)==null||!r.props[S3e]),this.startIfEnabled()}get allowedMetrics(){var t,r,n=qo(this._instance.config.capture_performance)?(t=this._instance.config.capture_performance)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Ht(n)?((r=this._instance.persistence)==null?void 0:r.props[w3e])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(qo(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var t=qo(this._instance.config.capture_performance)&&Sm(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:L3e;return 0<t&&t<=6e4?L3e:t}get isEnabled(){var t=su?.protocol;if(t!=="http:"&&t!=="https:")return hb.info("Web Vitals are disabled on non-http/https protocols"),!1;var r=qo(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:nv(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return nv(r)?r:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(hb.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(t){var r=qo(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=qo(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[S3e]:r}),this._instance.persistence.register({[w3e]:n})),this.Et=r,this.startIfEnabled()}it(t){var r,n;(r=un.__PosthogExtensions__)!=null&&r.postHogWebVitalsCallbacks&&t(),(n=un.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"web-vitals",(s=>{s?hb.error("failed to load script",s):t()}))}Tt(){var t=Ze?Ze.location.href:void 0;if(t){var r=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,s=r?jO([],RO,n||[]):[];return vj(t,s,xj)}hb.error("Could not determine current URL")}}var mgn=Lo("[Heatmaps]");function F3e(e){return qo(e)&&"clientX"in e&&"clientY"in e&&Sm(e.clientX)&&Sm(e.clientY)}class ggn{constructor(t){var r;this.Et=!1,this.P=!1,this.It=null,this.instance=t,this.Et=!((r=this.instance.persistence)==null||!r.props[ine]),this.rageclicks=new $gt(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return qo(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Ht(this.instance.config.capture_heatmaps)?Ht(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;mgn.info("starting..."),this.Ft(),this.Ct()}else{var t;clearInterval((t=this.It)!==null&&t!==void 0?t:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(t){var r=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ine]:r}),this.Et=r,this.startIfEnabled()}getAndClearBuffer(){var t=this.N;return this.N=void 0,t}Ot(t){this.At(t.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(t){return t?.visibilityState==="visible"})(Wt)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){Ze&&Wt&&(this.jt=this.Dt.bind(this),co(Ze,"beforeunload",this.jt),this.Lt=t=>this.At(t||Ze?.event),co(Wt,"click",this.Lt,{capture:!0}),this.Nt=t=>this.Ut(t||Ze?.event),co(Wt,"mousemove",this.Nt,{capture:!0}),this.zt=new Lgt(this.instance,qmn,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),co(Wt,"visibilitychange",this.Ht),this.P=!0)}Mt(){var t;Ze&&Wt&&(this.jt&&Ze.removeEventListener("beforeunload",this.jt),this.Lt&&Wt.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&Wt.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&Wt.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(t=this.zt)==null||t.stop(),this.P=!1)}qt(t,r){var n=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),i=(function(o,l,u){for(var d=o;d&&p8(d)&&!av(d,"body");){if(d===u)return!1;if(rs(l,Ze?.getComputedStyle(d).position))return!0;d=Agt(d)}return!1})(Cgt(t),["fixed","sticky"],a);return{x:t.clientX+(i?0:s),y:t.clientY+(i?0:n),target_fixed:i,type:r}}At(t,r){var n;if(r===void 0&&(r="click"),!E3e(t.target)&&F3e(t)){var s=this.qt(t,r);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this.Wt(dr({},s,{type:"rageclick"})),this.Wt(s)}}Ut(t){!E3e(t.target)&&F3e(t)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(t,"mousemove"))}),500))}Wt(t){if(Ze){var r=Ze.location.href,n=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,a=n?jO([],RO,s||[]):[],i=vj(r,a,xj);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(t)}}Dt(){this.N&&!Hw(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class ygn{constructor(t){this._instance=t}doPageView(t,r){var n,s=this.Gt(t,r);return this.Vt={pathname:(n=Ze?.location.pathname)!==null&&n!==void 0?n:"",pageViewId:r,timestamp:t},this._instance.scrollManager.resetContext(),s}doPageLeave(t){var r;return this.Gt(t,(r=this.Vt)==null?void 0:r.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Vt)==null?void 0:t.pageViewId}}Gt(t,r){var n=this.Vt;if(!n)return{$pageview_id:r};var s={$pageview_id:r,$prev_pageview_id:n.pageViewId},a=this._instance.scrollManager.getContext();if(a&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:i,lastScrollY:o,maxScrollY:l,maxContentHeight:u,lastContentY:d,maxContentY:p}=a;if(!(Ht(i)||Ht(o)||Ht(l)||Ht(u)||Ht(d)||Ht(p))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),p=Math.ceil(p);var f=i<=1?1:Hh(o/i,0,1,Kt),h=i<=1?1:Hh(l/i,0,1,Kt),m=u<=1?1:Hh(d/u,0,1,Kt),y=u<=1?1:Hh(p/u,0,1,Kt);s=Zi(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:m,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:y})}}return n.pathname&&(s.$prev_pageview_pathname=n.pathname),n.timestamp&&(s.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),s}}var Tp=Uint8Array,fu=Uint16Array,Uk=Uint32Array,$fe=new Tp([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Mfe=new Tp([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),B3e=new Tp([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),uyt=function(e,t){for(var r=new fu(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new Uk(r[30]);for(n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)s[a]=a-r[n]<<5|n;return[r,s]},dyt=uyt($fe,2),bgn=dyt[0],bne=dyt[1];bgn[28]=258,bne[258]=28;for(var z3e=uyt(Mfe,0)[1],pyt=new fu(32768),Za=0;Za<32768;++Za){var Hx=(43690&Za)>>>1|(21845&Za)<<1;Hx=(61680&(Hx=(52428&Hx)>>>2|(13107&Hx)<<2))>>>4|(3855&Hx)<<4,pyt[Za]=((65280&Hx)>>>8|(255&Hx)<<8)>>>1}var XT=function(e,t,r){for(var n=e.length,s=0,a=new fu(t);s<n;++s)++a[e[s]-1];var i,o=new fu(t);for(s=0;s<t;++s)o[s]=o[s-1]+a[s-1]<<1;for(i=new fu(n),s=0;s<n;++s)i[s]=pyt[o[e[s]-1]++]>>>15-e[s];return i},w1=new Tp(288);for(Za=0;Za<144;++Za)w1[Za]=8;for(Za=144;Za<256;++Za)w1[Za]=9;for(Za=256;Za<280;++Za)w1[Za]=7;for(Za=280;Za<288;++Za)w1[Za]=8;var W4=new Tp(32);for(Za=0;Za<32;++Za)W4[Za]=5;var vgn=XT(w1,9),xgn=XT(W4,5),fyt=function(e){return(e/8>>0)+(7&e&&1)},hyt=function(e,t,r){(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof fu?fu:e instanceof Uk?Uk:Tp)(r-t);return n.set(e.subarray(t,r)),n},hg=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},xC=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},rK=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var s=r.length,a=r.slice();if(!s)return[new Tp(0),0];if(s==1){var i=new Tp(r[0].s+1);return i[r[0].s]=1,[i,1]}r.sort((function(_,C){return _.f-C.f})),r.push({s:-1,f:25001});var o=r[0],l=r[1],u=0,d=1,p=2;for(r[0]={s:-1,f:o.f+l.f,l:o,r:l};d!=s-1;)o=r[r[u].f<r[p].f?u++:p++],l=r[u!=d&&r[u].f<r[p].f?u++:p++],r[d++]={s:-1,f:o.f+l.f,l:o,r:l};var f=a[0].s;for(n=1;n<s;++n)a[n].s>f&&(f=a[n].s);var h=new fu(f+1),m=vne(r[d-1],h,0);if(m>t){n=0;var y=0,b=m-t,v=1<<b;for(a.sort((function(_,C){return h[C.s]-h[_.s]||_.f-C.f}));n<s;++n){var S=a[n].s;if(!(h[S]>t))break;y+=v-(1<<m-h[S]),h[S]=t}for(y>>>=b;y>0;){var w=a[n].s;h[w]<t?y-=1<<t-h[w]++-1:++n}for(;n>=0&&y;--n){var k=a[n].s;h[k]==t&&(--h[k],++y)}m=t}return[new Tp(h),m]},vne=function(e,t,r){return e.s==-1?Math.max(vne(e.l,t,r+1),vne(e.r,t,r+1)):t[e.s]=r},U3e=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new fu(++t),n=0,s=e[0],a=1,i=function(l){r[n++]=l},o=1;o<=t;++o)if(e[o]==s&&o!=t)++a;else{if(!s&&a>2){for(;a>138;a-=138)i(32754);a>2&&(i(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(i(s),--a;a>6;a-=6)i(8304);a>2&&(i(a-3<<5|8208),a=0)}for(;a--;)i(s);a=1,s=e[o]}return[r.subarray(0,n),t]},SC=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},xne=function(e,t,r){var n=r.length,s=fyt(t+2);e[s]=255&n,e[s+1]=n>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a<n;++a)e[s+a+4]=r[a];return 8*(s+4+n)},V3e=function(e,t,r,n,s,a,i,o,l,u,d){hg(t,d++,r),++s[256];for(var p=rK(s,15),f=p[0],h=p[1],m=rK(a,15),y=m[0],b=m[1],v=U3e(f),S=v[0],w=v[1],k=U3e(y),_=k[0],C=k[1],T=new fu(19),A=0;A<S.length;++A)T[31&S[A]]++;for(A=0;A<_.length;++A)T[31&_[A]]++;for(var N=rK(T,7),j=N[0],R=N[1],L=19;L>4&&!j[B3e[L-1]];--L);var F,M,z,q,Q=u+5<<3,V=SC(s,w1)+SC(a,W4)+i,Z=SC(s,f)+SC(a,y)+i+14+3*L+SC(T,j)+(2*T[16]+3*T[17]+7*T[18]);if(Q<=V&&Q<=Z)return xne(t,d,e.subarray(l,l+u));if(hg(t,d,1+(Z<V)),d+=2,Z<V){F=XT(f,h),M=f,z=XT(y,b),q=y;var $=XT(j,R);for(hg(t,d,w-257),hg(t,d+5,C-1),hg(t,d+10,L-4),d+=14,A=0;A<L;++A)hg(t,d+3*A,j[B3e[A]]);d+=3*L;for(var X=[S,_],U=0;U<2;++U){var I=X[U];for(A=0;A<I.length;++A){var H=31&I[A];hg(t,d,$[H]),d+=j[H],H>15&&(hg(t,d,I[A]>>>5&127),d+=I[A]>>>12)}}}else F=vgn,M=w1,z=xgn,q=W4;for(A=0;A<o;++A)if(n[A]>255){H=n[A]>>>18&31,xC(t,d,F[H+257]),d+=M[H+257],H>7&&(hg(t,d,n[A]>>>23&31),d+=$fe[H]);var G=31&n[A];xC(t,d,z[G]),d+=q[G],G>3&&(xC(t,d,n[A]>>>5&8191),d+=Mfe[G])}else xC(t,d,F[n[A]]),d+=M[n[A]];return xC(t,d,F[256]),d+M[256]},Sgn=new Uk([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),wgn=(function(){for(var e=new Uk(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e})(),Egn=function(e,t,r,n,s){return(function(a,i,o,l,u,d){var p=a.length,f=new Tp(l+p+5*(1+Math.floor(p/7e3))+u),h=f.subarray(l,f.length-u),m=0;if(!i||p<8)for(var y=0;y<=p;y+=65535){var b=y+65535;b<p?m=xne(h,m,a.subarray(y,b)):(h[y]=d,m=xne(h,m,a.subarray(y,p)))}else{for(var v=Sgn[i-1],S=v>>>13,w=8191&v,k=(1<<o)-1,_=new fu(32768),C=new fu(k+1),T=Math.ceil(o/3),A=2*T,N=function(xe){return(a[xe]^a[xe+1]<<T^a[xe+2]<<A)&k},j=new Uk(25e3),R=new fu(288),L=new fu(32),F=0,M=0,z=(y=0,0),q=0,Q=0;y<p;++y){var V=N(y),Z=32767&y,$=C[V];if(_[Z]=$,C[V]=Z,q<=y){var X=p-y;if((F>7e3||z>24576)&&X>423){m=V3e(a,h,0,j,R,L,M,z,Q,y-Q,m),z=F=M=0,Q=y;for(var U=0;U<286;++U)R[U]=0;for(U=0;U<30;++U)L[U]=0}var I=2,H=0,G=w,J=Z-$&32767;if(X>2&&V==N(y-J))for(var ee=Math.min(S,X)-1,te=Math.min(32767,y),se=Math.min(258,X);J<=te&&--G&&Z!=$;){if(a[y+I]==a[y+I-J]){for(var ce=0;ce<se&&a[y+ce]==a[y+ce-J];++ce);if(ce>I){if(I=ce,H=J,ce>ee)break;var Se=Math.min(J,ce-2),W=0;for(U=0;U<Se;++U){var ne=y-J+U+32768&32767,ae=ne-_[ne]+32768&32767;ae>W&&(W=ae,$=ne)}}}J+=(Z=$)-($=_[Z])+32768&32767}if(H){j[z++]=268435456|bne[I]<<18|z3e[H];var ge=31&bne[I],le=31&z3e[H];M+=$fe[ge]+Mfe[le],++R[257+ge],++L[le],q=y+I,++F}else j[z++]=a[y],++R[a[y]]}}m=V3e(a,h,d,j,R,L,M,z,Q,y-Q,m)}return hyt(f,0,l+fyt(m)+u)})(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!0)},nK=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function kgn(e,t){t===void 0&&(t={});var r=(function(){var o=4294967295;return{p:function(l){for(var u=o,d=0;d<l.length;++d)u=wgn[255&u^l[d]]^u>>>8;o=u},d:function(){return 4294967295^o}}})(),n=e.length;r.p(e);var s,a=Egn(e,t,10+((s=t).filename&&s.filename.length+1||0),8),i=a.length;return(function(o,l){var u=l.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=l.level<2?4:l.level==9?2:0,o[9]=3,l.mtime!=0&&nK(o,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){o[3]=8;for(var d=0;d<=u.length;++d)o[d+10]=u.charCodeAt(d)}})(a,t),nK(a,i-8,r.d()),nK(a,i-4,n),a}var Ogn=function(e){var t,r,n,s,a="";for(t=r=0,n=(e=(e+"").replace(/\r\n/g,`
|
|
613
613
|
`).replace(/\r/g,`
|
|
614
614
|
`)).length,s=0;s<n;s++){var i=e.charCodeAt(s),o=null;i<128?r++:o=i>127&&i<2048?String.fromCharCode(i>>6|192,63&i|128):String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128),Oy(o)||(r>t&&(a+=e.substring(t,r)),a+=o,t=r=s+1)}return r>t&&(a+=e.substring(t,e.length)),a},_gn=!!tne||!!ene,q3e="text/plain",X4=function(e,t,r){var n;r===void 0&&(r=!0);var[s,a]=e.split("?"),i=dr({},t),o=(n=a?.split("&").map((u=>{var d,[p,f]=u.split("="),h=r&&(d=i[p])!==null&&d!==void 0?d:f;return delete i[p],p+"="+h})))!==null&&n!==void 0?n:[],l=Nmn(i);return l&&o.push(l),s+"?"+o.join("&")},rT=(e,t)=>JSON.stringify(e,((r,n)=>typeof n=="bigint"?n.toString():n),t),sK=e=>{var{data:t,compression:r}=e;if(t){if(r===jg.GZipJS){var n=kgn((function(l,u){var d=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var p=new Tp(l.length+(l.length>>>1)),f=0,h=function(v){p[f++]=v},m=0;m<d;++m){if(f+5>p.length){var y=new Tp(f+8+(d-m<<1));y.set(p),p=y}var b=l.charCodeAt(m);b<128||u?h(b):b<2048?(h(192|b>>>6),h(128|63&b)):b>55295&&b<57344?(h(240|(b=65536+(1047552&b)|1023&l.charCodeAt(++m))>>>18),h(128|b>>>12&63),h(128|b>>>6&63),h(128|63&b)):(h(224|b>>>12),h(128|b>>>6&63),h(128|63&b))}return hyt(p,0,f)})(rT(t)),{mtime:0}),s=new Blob([n],{type:q3e});return{contentType:q3e,body:s,estimatedSize:s.size}}if(r===jg.Base64){var a=(function(l){var u,d,p,f,h,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",y=0,b=0,v="",S=[];if(!l)return l;l=Ogn(l);do u=(h=l.charCodeAt(y++)<<16|l.charCodeAt(y++)<<8|l.charCodeAt(y++))>>18&63,d=h>>12&63,p=h>>6&63,f=63&h,S[b++]=m.charAt(u)+m.charAt(d)+m.charAt(p)+m.charAt(f);while(y<l.length);switch(v=S.join(""),l.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"="}return v})(rT(t)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:rT(l)))(a);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var o=rT(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Z$=[];ene&&Z$.push({transport:"fetch",method:e=>{var t,r,{contentType:n,body:s,estimatedSize:a}=(t=sK(e))!==null&&t!==void 0?t:{},i=new Headers;La(e.headers,(function(d,p){i.append(p,d)})),n&&i.append("Content-Type",n);var o=e.url,l=null;if(c3e){var u=new c3e;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}ene(o,dr({method:e?.method||"GET",headers:i,keepalive:e.method==="POST"&&(a||0)<52428.8,body:s,signal:(r=l)==null?void 0:r.signal},e.fetchOptions)).then((d=>d.text().then((p=>{var f={statusCode:d.status,text:p};if(d.status===200)try{f.json=JSON.parse(p)}catch(h){Kt.error(h)}e.callback==null||e.callback(f)})))).catch((d=>{Kt.error(d),e.callback==null||e.callback({statusCode:0,text:d})})).finally((()=>l?clearTimeout(l.timeout):null))}}),tne&&Z$.push({transport:"XHR",method:e=>{var t,r=new tne;r.open(e.method||"GET",e.url,!0);var{contentType:n,body:s}=(t=sK(e))!==null&&t!==void 0?t:{};La(e.headers,(function(a,i){r.setRequestHeader(i,a)})),n&&r.setRequestHeader("Content-Type",n),e.timeout&&(r.timeout=e.timeout),e.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(r.readyState===4){var a={statusCode:r.status,text:r.responseText};if(r.status===200)try{a.json=JSON.parse(r.responseText)}catch{}e.callback==null||e.callback(a)}},r.send(s)}}),cd!=null&&cd.sendBeacon&&Z$.push({transport:"sendBeacon",method:e=>{var t=X4(e.url,{beacon:"1"});try{var r,{contentType:n,body:s}=(r=sK(e))!==null&&r!==void 0?r:{},a=typeof s=="string"?new Blob([s],{type:n}):s;cd.sendBeacon(t,a)}catch{}}});var Y4=function(e,t){if(!(function(r){try{new RegExp(r)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function H3e(e,t,r){return rT({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var myt={exact:(e,t)=>t.some((r=>e.some((n=>r===n)))),is_not:(e,t)=>t.every((r=>e.every((n=>r!==n)))),regex:(e,t)=>t.some((r=>e.some((n=>Y4(r,n))))),not_regex:(e,t)=>t.every((r=>e.every((n=>!Y4(r,n))))),icontains:(e,t)=>t.map(QP).some((r=>e.map(QP).some((n=>r.includes(n))))),not_icontains:(e,t)=>t.map(QP).every((r=>e.map(QP).every((n=>!r.includes(n)))))},QP=e=>e.toLowerCase();function gyt(e,t){return!e||Object.entries(e).every((r=>{var[n,s]=r,a=t?.[n];if(Ht(a)||Oy(a))return!1;var i=[String(a)],o=myt[s.operator];return!!o&&o(s.values,i)}))}var aK=Lo("[Error tracking]");class Cgn{constructor(t){var r,n;this.Jt=[],this.Kt=new Yhn([new imn,new mmn,new lmn,new omn,new fmn,new pmn,new umn,new hmn],amn("web:javascript",tmn,smn)),this._instance=t,this.Jt=(r=(n=this._instance.persistence)==null?void 0:n.get_property(one))!==null&&r!==void 0?r:[]}onRemoteConfig(t){var r,n,s,a=(r=(n=t.errorTracking)==null?void 0:n.suppressionRules)!==null&&r!==void 0?r:[],i=(s=t.errorTracking)==null?void 0:s.captureExtensionExceptions;this.Jt=a,this._instance.persistence&&this._instance.persistence.register({[one]:this.Jt,[x3e]:i})}get Yt(){var t,r=!!this._instance.get_property(x3e),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??r)!==null&&t!==void 0&&t}buildProperties(t,r){return this.Kt.buildFromUnknown(t,{syntheticException:r?.syntheticException,mechanism:{handled:r?.handled}})}sendExceptionEvent(t){var r=t.$exception_list;if(this.Xt(r)){if(this.Qt(r))return void aK.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(r))return void aK.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(r))return void aK.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(t){if(t.length===0)return!1;var r=t.reduce(((n,s)=>{var{type:a,value:i}=s;return Do(a)&&a.length>0&&n.$exception_types.push(a),Do(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.Jt.some((n=>{var s=n.values.map((a=>{var i,o=myt[a.operator],l=ka(a.value)?a.value:[a.value],u=(i=r[a.key])!==null&&i!==void 0?i:[];return l.length>0&&o(l,u)}));return n.type==="OR"?s.some(Boolean):s.every(Boolean)}))}Zt(t){return t.flatMap((r=>{var n,s;return(n=(s=r.stacktrace)==null?void 0:s.frames)!==null&&n!==void 0?n:[]})).some((r=>r.filename&&r.filename.startsWith("chrome-extension://")))}ti(t){if(t.length>0){var r,n,s,a,i=(r=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&r!==void 0?r:[],o=i[i.length-1];return(s=o==null||(a=o.filename)==null?void 0:a.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}Xt(t){return!ma(t)&&ka(t)}}var cf=Lo("[FeatureFlags]"),wC=Lo("[FeatureFlags]",{debugEnabled:!0}),iK="$active_feature_flags",uw="$override_feature_flags",Q3e="$feature_flag_payloads",EC="$override_feature_flag_payloads",G3e="$feature_flag_request_id",Z3e="$feature_flag_evaluated_at",W3e=e=>{var t={};for(var[r,n]of G$(e||{}))n&&(t[r]=n);return t},Tgn=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((r=>{var n;return[r,(n=t[r].variant)!==null&&n!==void 0?n:t[r].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((r=>t[r].enabled)).filter((r=>{var n;return(n=t[r].metadata)==null?void 0:n.payload})).map((r=>{var n;return[r,(n=t[r].metadata)==null?void 0:n.payload]})))):cf.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},Agn=(function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e})({});class Dgn{constructor(t){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=t,this.featureFlagEventHandlers=[]}li(){var t=this._instance.config.evaluation_environments;return t!=null&&t.length?t.filter((r=>{var n=r&&typeof r=="string"&&r.trim().length>0;return n||cf.error("Invalid evaluation environment found:",r,"Expected non-empty string"),n})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var t=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:t})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(lne),r=this._instance.get_property(uw),n=this._instance.get_property(EC);if(!n&&!r)return t||{};var s=Zi({},t||{}),a=[...new Set([...Object.keys(n||{}),...Object.keys(r||{})])];for(var i of a){var o,l,u=s[i],d=r?.[i],p=Ht(d)?(o=u?.enabled)!==null&&o!==void 0&&o:!!d,f=Ht(d)?u.variant:typeof d=="string"?d:void 0,h=n?.[i],m=dr({},u,{enabled:p,variant:p?f??u?.variant:void 0});p!==u?.enabled&&(m.original_enabled=u?.enabled),f!==u?.variant&&(m.original_variant=u?.variant),h&&(m.metadata=dr({},u?.metadata,{payload:h,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),s[i]=m}return this.ii||(cf.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:s}),this.ii=!0),s}getFlagVariants(){var t=this._instance.get_property(Qw),r=this._instance.get_property(uw);if(!r)return t||{};for(var n=Zi({},t),s=Object.keys(r),a=0;a<s.length;a++)n[s[a]]=r[s[a]];return this.ii||(cf.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:r,finalFlags:n}),this.ii=!0),n}getFlagPayloads(){var t=this._instance.get_property(Q3e),r=this._instance.get_property(EC);if(!r)return t||{};for(var n=Zi({},t||{}),s=Object.keys(r),a=0;a<s.length;a++)n[s[a]]=r[s[a]];return this.ii||(cf.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:r,finalPayloads:n}),this.ii=!0),n}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.si=t}vi(t){var r;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var n={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:dr({},((r=this._instance.persistence)==null?void 0:r.get_initial_props())||{},this._instance.get_property(eT)||{}),group_properties:this._instance.get_property(Jx)};(t!=null&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0),this.ui()&&(n.evaluation_environments=this.li());var s=this._instance.config.__preview_remote_config,a=s?"/flags/?v=2":"/flags/?v=2&config=true",i=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags",a+i);s&&(n.timezone=cyt()),this.ri=!0,this._instance.ci({method:"POST",url:o,data:n,compression:this._instance.config.disable_compression?void 0:jg.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,d,p=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),p=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((d=l.json)!==null&&d!==void 0?d:{})),!n.disable_flags||this.ni)if(this.ai=!p,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(Agn.FeatureFlags))cf.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var f;n.disable_flags||this.receivedFeatureFlags((f=l.json)!==null&&f!==void 0?f:{},p),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(t,r){if(r===void 0&&(r={}),this.ei||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[t],s=""+n,a=this._instance.get_property(G3e)||void 0,i=this._instance.get_property(Z3e)||void 0,o=this._instance.get_property(B4)||{};if((r.send_event||!("send_event"in r))&&(!(t in o)||!o[t].includes(s))){var l,u,d,p,f,h,m,y,b;ka(o[t])?o[t].push(s):o[t]=[s],(l=this._instance.persistence)==null||l.register({[B4]:o});var v=this.getFeatureFlagDetails(t),S={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:i,$feature_flag_bootstrapped_response:((u=this._instance.config.bootstrap)==null||(u=u.featureFlags)==null?void 0:u[t])||null,$feature_flag_bootstrapped_payload:((d=this._instance.config.bootstrap)==null||(d=d.featureFlagPayloads)==null?void 0:d[t])||null,$used_bootstrap_value:!this.ai};Ht(v==null||(p=v.metadata)==null?void 0:p.version)||(S.$feature_flag_version=v.metadata.version);var w,k=(f=v==null||(h=v.reason)==null?void 0:h.description)!==null&&f!==void 0?f:v==null||(m=v.reason)==null?void 0:m.code;k&&(S.$feature_flag_reason=k),v!=null&&(y=v.metadata)!=null&&y.id&&(S.$feature_flag_id=v.metadata.id),Ht(v?.original_variant)&&Ht(v?.original_enabled)||(S.$feature_flag_original_response=Ht(v.original_variant)?v.original_enabled:v.original_variant),v!=null&&(b=v.metadata)!=null&&b.original_payload&&(S.$feature_flag_original_payload=v==null||(w=v.metadata)==null?void 0:w.original_payload),this._instance.capture("$feature_flag_called",S)}return n}cf.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,r){var n=this._instance.config.token,s={distinct_id:this._instance.get_distinct_id(),token:n};this.ui()&&(s.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:s,compression:this._instance.config.disable_compression?void 0:jg.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:a=>{var i,o=(i=a.json)==null?void 0:i.featureFlagPayloads;r(o?.[t]||void 0)}})}isFeatureEnabled(t,r){if(r===void 0&&(r={}),this.ei||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(t,r);return Ht(n)?void 0:!!n}cf.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((r=>r!==t))}receivedFeatureFlags(t,r){if(this._instance.persistence){this.ei=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(i,o,l,u,d){l===void 0&&(l={}),u===void 0&&(u={}),d===void 0&&(d={});var p=Tgn(i),f=p.flags,h=p.featureFlags,m=p.featureFlagPayloads;if(h){var y=i.requestId,b=i.evaluatedAt;if(ka(h)){cf.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(h)for(var S=0;S<h.length;S++)v[h[S]]=!0;o&&o.register({[iK]:h,[Qw]:v})}else{var w=h,k=m,_=f;i.errorsWhileComputingFlags&&(w=dr({},l,w),k=dr({},u,k),_=dr({},d,_)),o&&o.register(dr({[iK]:Object.keys(W3e(w)),[Qw]:w||{},[Q3e]:k||{},[lne]:_||{}},y?{[G3e]:y}:{},b?{[Z3e]:b}:{}))}}})(t,this._instance.persistence,n,s,a),this.pi(r)}}override(t,r){r===void 0&&(r=!1),cf.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:r})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return cf.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this._instance.persistence.unregister(uw),this._instance.persistence.unregister(EC),this.pi(),wC.info("All overrides cleared");if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var r,n=t;if(this.ii=!!((r=n.suppressWarning)!==null&&r!==void 0&&r),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(uw),wC.info("Flag overrides cleared");else if(n.flags){if(ka(n.flags)){for(var s={},a=0;a<n.flags.length;a++)s[n.flags[a]]=!0;this._instance.persistence.register({[uw]:s})}else this._instance.persistence.register({[uw]:n.flags});wC.info("Flag overrides set",{flags:n.flags})}}return"payloads"in n&&(n.payloads===!1?(this._instance.persistence.unregister(EC),wC.info("Payload overrides cleared")):n.payloads&&(this._instance.persistence.register({[EC]:n.payloads}),wC.info("Payload overrides set",{payloads:n.payloads}))),void this.pi()}this.pi()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ei){var{flags:r,flagVariants:n}=this.gi();t(r,n)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,r,n){var s,a=(this._instance.get_property(JC)||[]).find((u=>u.flagKey===t)),i={["$feature_enrollment/"+t]:r},o={$feature_flag:t,$feature_enrollment:r,$set:i};a&&(o.$early_access_feature_name=a.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(i,!1);var l=dr({},this.getFlagVariants(),{[t]:r});(s=this._instance.persistence)==null||s.register({[iK]:Object.keys(W3e(l)),[Qw]:l}),this.pi()}getEarlyAccessFeatures(t,r,n){r===void 0&&(r=!1);var s=this._instance.get_property(JC),a=n?"&"+n.map((i=>"stage="+i)).join("&"):"";if(s&&!r)return t(s);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+a),method:"GET",callback:i=>{var o,l;if(i.json){var u=i.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(JC),(l=this._instance.persistence)==null||l.register({[JC]:u}),t(u)}}})}gi(){var t=this.getFlags(),r=this.getFlagVariants();return{flags:t.filter((n=>r[n])),flagVariants:Object.keys(r).filter((n=>r[n])).reduce(((n,s)=>(n[s]=r[s],n)),{})}}pi(t){var{flags:r,flagVariants:n}=this.gi();this.featureFlagEventHandlers.forEach((s=>s(r,n,{errorsLoading:t})))}setPersonPropertiesForFlags(t,r){r===void 0&&(r=!0);var n=this._instance.get_property(eT)||{};this._instance.register({[eT]:dr({},n,t)}),r&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(eT)}setGroupPropertiesForFlags(t,r){r===void 0&&(r=!0);var n=this._instance.get_property(Jx)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((s=>{n[s]=dr({},n[s],t[s]),delete t[s]})),this._instance.register({[Jx]:dr({},n,t)}),r&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var r=this._instance.get_property(Jx)||{};this._instance.register({[Jx]:dr({},r,{[t]:{}})})}else this._instance.unregister(Jx)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.di(),this.ii=!1}}var Ngn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class oK{constructor(t,r){this.F=t,this.props={},this.mi=!1,this.yi=(n=>{var s="";return n.token&&(s=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+s+"_posthog"})(t),this.Y=this.bi(t),this.load(),t.debug&&Kt.info("Persistence loaded",t.persistence,dr({},this.props)),this.update_config(t,t,r),this.save()}isDisabled(){return!!this.wi}bi(t){Ngn.indexOf(t.persistence.toLowerCase())===-1&&(Kt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var r=t.persistence.toLowerCase();return r==="localstorage"&&bi.H()?bi:r==="localstorage+cookie"&&UP.H()?UP:r==="sessionstorage"&&fl.H()?fl:r==="memory"?Umn:r==="cookie"?sm:UP.H()?UP:sm}properties(){var t={};return La(this.props,(function(r,n){if(n===Qw&&qo(r))for(var s=Object.keys(r),a=0;a<s.length;a++)t["$feature/"+s[a]]=r[s[a]];else o=n,l=!1,(Oy(i=Smn)?l:l3e&&i.indexOf===l3e?i.indexOf(o)!=-1:(La(i,(function(u){if(l||(l=u===o))return L4})),l))||(t[n]=r);var i,o,l})),t}load(){if(!this.wi){var t=this.Y.W(this.yi);t&&(this.props=Zi({},t))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(t,r,n){if(qo(t)){Ht(r)&&(r="None"),this.xi=Ht(n)?this.$i:n;var s=!1;if(La(t,((a,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==r||(this.props[i]=a,s=!0)})),s)return this.save(),!0}return!1}register(t,r){if(qo(t)){this.xi=Ht(r)?this.$i:r;var n=!1;if(La(t,((s,a)=>{t.hasOwnProperty(a)&&this.props[a]!==s&&(this.props[a]=s,n=!0)})),n)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.mi){var t=nyt(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Hw(Tfe(t))||this.register(t),this.mi=!0}}update_search_keyword(){var t;this.register((t=Wt?.referrer)?ayt(t):{})}update_referrer_info(){var t;this.register_once({$referrer:iyt(),$referring_domain:Wt!=null&&Wt.referrer&&((t=q4(Wt.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[pne]||this.props[fne]||this.register_once({[z4]:oyt(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};La([fne,pne],(i=>{var o=this.props[i];o&&La(o,(function(l,u){t["$initial_"+rne(u)]=l}))}));var r,n,s=this.props[z4];if(s){var a=(r=lyt(s),n={},La(r,(function(i,o){n["$initial_"+rne(o)]=i})),n);Zi(t,a)}return t}safe_merge(t){return La(this.props,(function(r,n){n in t||(t[n]=r)})),t}update_config(t,r,n){if(this.$i=this.xi=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!n),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==r.persistence){var s=this.bi(t),a=this.props;this.clear(),this.Y=s,this.props=a,this.save()}}set_disabled(t){this.wi=t,this.wi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Si&&(this.Si=t,this.remove(),this.save())}set_secure(t){t!==this.Ei&&(this.Ei=t,this.remove(),this.save())}set_event_timer(t,r){var n=this.props[KC]||{};n[t]=r,this.props[KC]=n,this.save()}remove_event_timer(t){var r=(this.props[KC]||{})[t];return Ht(r)||(delete this.props[KC][t],this.save()),r}get_property(t){return this.props[t]}set_property(t,r){this.props[t]=r,this.save()}}var kC=(function(e){return e.Activation="events",e.Cancellation="cancelEvents",e})({});(function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e})({});(function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e})({});(function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e})({});var lK=(function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e})({});(function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e})({});(function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e})({});(function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e})({});var W$=(function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e})({}),X3e=(function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e})({}),yyt=(function(e){return e.Popover="popover",e.Inline="inline",e})({});class Lfe{constructor(){this.ki={},this.ki={}}on(t,r){return this.ki[t]||(this.ki[t]=[]),this.ki[t].push(r),()=>{this.ki[t]=this.ki[t].filter((n=>n!==r))}}emit(t,r){for(var n of this.ki[t]||[])n(r);for(var s of this.ki["*"]||[])s(t,r)}}function dw(e,t,r){if(ma(e))return!1;switch(r){case"exact":return e===t;case"contains":var n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class Ign{constructor(t){this.Pi=new Lfe,this.Ti=(r,n)=>this.Ri(r,n)&&this.Ii(r,n)&&this.Fi(r,n)&&this.Ci(r,n),this.Ri=(r,n)=>n==null||!n.event||r?.event===n?.event,this._instance=t,this.Mi=new Set,this.Oi=new Set}init(){var t;if(!Ht((t=this._instance)==null?void 0:t.Ai)){var r;(r=this._instance)==null||r.Ai(((n,s)=>{this.on(n,s)}))}}register(t){var r,n;if(!Ht((r=this._instance)==null?void 0:r.Ai)&&(t.forEach((i=>{var o,l;(o=this.Oi)==null||o.add(i),(l=i.steps)==null||l.forEach((u=>{var d;(d=this.Mi)==null||d.add(u?.event||"")}))})),(n=this._instance)!=null&&n.autocapture)){var s,a=new Set;t.forEach((i=>{var o;(o=i.steps)==null||o.forEach((l=>{l!=null&&l.selector&&a.add(l?.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(a)}}on(t,r){var n;r!=null&&t.length!=0&&(this.Mi.has(t)||this.Mi.has(r?.event))&&this.Oi&&((n=this.Oi)==null?void 0:n.size)>0&&this.Oi.forEach((s=>{this.Di(r,s)&&this.Pi.emit("actionCaptured",s.name)}))}ji(t){this.onAction("actionCaptured",(r=>t(r)))}Di(t,r){if(r?.steps==null)return!1;for(var n of r.steps)if(this.Ti(t,n))return!0;return!1}onAction(t,r){return this.Pi.on(t,r)}Ii(t,r){if(r!=null&&r.url){var n,s=t==null||(n=t.properties)==null?void 0:n.$current_url;if(!s||typeof s!="string"||!dw(s,r.url,r.url_matching||"contains"))return!1}return!0}Fi(t,r){return!!this.Li(t,r)&&!!this.Ni(t,r)&&!!this.Ui(t,r)}Li(t,r){var n;if(r==null||!r.href)return!0;var s=this.zi(t);if(s.length>0)return s.some((o=>dw(o.href,r.href,r.href_matching||"exact")));var a,i=(t==null||(n=t.properties)==null?void 0:n.$elements_chain)||"";return!!i&&dw((a=i.match(/(?::|")href="(.*?)"/))?a[1]:"",r.href,r.href_matching||"exact")}Ni(t,r){var n;if(r==null||!r.text)return!0;var s=this.zi(t);if(s.length>0)return s.some((u=>dw(u.text,r.text,r.text_matching||"exact")||dw(u.$el_text,r.text,r.text_matching||"exact")));var a,i,o,l=(t==null||(n=t.properties)==null?void 0:n.$elements_chain)||"";return!!l&&(a=(function(u){for(var d,p=[],f=/(?::|")text="(.*?)"/g;!ma(d=f.exec(u));)p.includes(d[1])||p.push(d[1]);return p})(l),i=r.text,o=r.text_matching||"exact",a.some((u=>dw(u,i,o))))}Ui(t,r){var n,s;if(r==null||!r.selector)return!0;var a=t==null||(n=t.properties)==null?void 0:n.$element_selectors;if(a!=null&&a.includes(r.selector))return!0;var i=(t==null||(s=t.properties)==null?void 0:s.$elements_chain)||"";if(r.selector_regex&&i)try{return new RegExp(r.selector_regex).test(i)}catch{return!1}return!1}zi(t){var r;return(t==null||(r=t.properties)==null?void 0:r.$elements)==null?[]:t?.properties.$elements}Ci(t,r){return r==null||!r.properties||r.properties.length===0||gyt(r.properties.reduce(((n,s)=>{var a=ka(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return n[s.key]={values:a,operator:s.operator||"exact"},n}),{}),t?.properties)}}var Xs=Lo("[Surveys]"),Sne="seenSurvey_",jgn=(e,t)=>{var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r},Y3e=e=>{var t=""+Sne+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Sne+e.id+"_"+e.current_iteration),t},Rgn=[lK.Popover,lK.Widget,lK.API],Pgn={ignoreConditions:!1,ignoreDelay:!1,displayType:yyt.Popover};class $gn{constructor(t){this._instance=t,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(t,r){return!!t&&gyt(t.propertyFilters,r?.properties)}Gi(t,r){var n=new Map;return t.forEach((s=>{var a;(a=s.conditions)==null||(a=a[r])==null||(a=a.values)==null||a.forEach((i=>{if(i!=null&&i.name){var o=n.get(i.name)||[];o.push(s.id),n.set(i.name,o)}}))})),n}Vi(t,r,n){var s,a=(n===kC.Activation?this.Hi:this.Bi).get(t),i=[];return(s=this._instance)==null||s.getSurveys((o=>{i=o.filter((l=>a?.includes(l.id)))})),i.filter((o=>{var l,u=(l=o.conditions)==null||(l=l[n])==null||(l=l.values)==null?void 0:l.find((d=>d.name===t));return this.Wi(u,r)}))}register(t){var r;Ht((r=this._instance)==null?void 0:r.Ai)||(this.Ji(t),this.Ki(t))}Ki(t){var r=t.filter((n=>{var s,a;return((s=n.conditions)==null?void 0:s.actions)&&((a=n.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0}));r.length!==0&&(this.Yi==null&&(this.Yi=new Ign(this._instance),this.Yi.init(),this.Yi.ji((n=>{this.onAction(n)}))),r.forEach((n=>{var s,a,i,o,l;n.conditions&&(s=n.conditions)!=null&&s.actions&&(a=n.conditions)!=null&&(a=a.actions)!=null&&a.values&&((i=n.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((o=this.Yi)==null||o.register(n.conditions.actions.values),(l=n.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((u=>{if(u&&u.name){var d=this.qi.get(u.name);d&&d.push(n.id),this.qi.set(u.name,d||[n.id])}})))})))}Ji(t){var r,n=t.filter((a=>{var i,o;return((i=a.conditions)==null?void 0:i.events)&&((o=a.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0})),s=t.filter((a=>{var i,o;return((i=a.conditions)==null?void 0:i.cancelEvents)&&((o=a.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0}));(n.length!==0||s.length!==0)&&((r=this._instance)==null||r.Ai(((a,i)=>{this.onEvent(a,i)})),this.Hi=this.Gi(t,kC.Activation),this.Bi=this.Gi(t,kC.Cancellation))}onEvent(t,r){var n,s=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[zP])||[];if(W$.SHOWN===t&&r&&s.length>0){var a;Xs.info("survey event matched, removing survey from activated surveys",{event:t,eventPayload:r,existingActivatedSurveys:s});var i=r==null||(a=r.properties)==null?void 0:a.$survey_id;if(i){var o=s.indexOf(i);o>=0&&(s.splice(o,1),this.Xi(s))}}else{if(this.Bi.has(t)){var l=this.Vi(t,r,kC.Cancellation);l.length>0&&(Xs.info("cancel event matched, cancelling surveys",{event:t,surveysToCancel:l.map((d=>d.id))}),l.forEach((d=>{var p,f=s.indexOf(d.id);f>=0&&s.splice(f,1),(p=this._instance)==null||p.cancelPendingSurvey(d.id)})),this.Xi(s))}if(this.Hi.has(t)){Xs.info("survey event name matched",{event:t,eventPayload:r,surveys:this.Hi.get(t)});var u=this.Vi(t,r,kC.Activation);this.Xi(s.concat(u.map((d=>d.id))||[]))}}}onAction(t){var r,n=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[zP])||[];this.qi.has(t)&&this.Xi(n.concat(this.qi.get(t)||[]))}Xi(t){var r;Xs.info("updating activated surveys",{activatedSurveys:t}),(r=this._instance)==null||(r=r.persistence)==null||r.register({[zP]:[...new Set(t)]})}getSurveys(){var t,r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[zP];return r||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}}class Mgn{constructor(t){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var r=t.surveys;if(ma(r))return Xs.warn("Flags not loaded yet. Not loading surveys.");var n=ka(r);this.Zi=n?r.length>0:r,Xs.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);(n!=null&&n.startsWith(Sne)||n!=null&&n.startsWith("inProgressSurvey_"))&&t.push(n)}t.forEach((s=>localStorage.removeItem(s)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)Xs.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Xs.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Xs.info("Not loading surveys in cookieless mode without consent.");else{var t=un?.__PosthogExtensions__;if(t){if(!Ht(this.Zi)||this._instance.config.advanced_enable_surveys){var r=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var n=t.generateSurveys;if(n)return void this.re(n,r);var s=t.loadExternalDependency;if(!s)return void this.se("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",(a=>{a||!t.generateSurveys?this.se("Could not load surveys script",a):this.re(t.generateSurveys,r)}))}catch(a){throw this.se("Error initializing surveys",a),a}finally{this.ie=!1}}}else Xs.error("PostHog Extensions not found.")}}re(t,r){this._surveyManager=t(this._instance,r),this._surveyEventReceiver=new $gn(this._instance),Xs.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(t,r){Xs.error(t,r),this.ne({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.ee.push(t),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((r=>r!==t))}}getSurveys(t,r){if(r===void 0&&(r=!1),this._instance.config.disable_surveys)return Xs.info("Disabled. Not loading surveys."),t([]);var n=this._instance.get_property(cne);if(n&&!r)return t(n,{isLoaded:!0});if(this.te)return t([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:s=>{var a;this.te=!1;var i=s.statusCode;if(i!==200||!s.json){var o="Surveys API could not be loaded, status: "+i;return Xs.error(o),t([],{isLoaded:!1,error:o})}var l,u=s.json.surveys||[],d=u.filter((p=>(function(f){return!(!f.start_date||f.end_date)})(p)&&((function(f){var h;return!((h=f.conditions)==null||(h=h.events)==null||(h=h.values)==null||!h.length)})(p)||(function(f){var h;return!((h=f.conditions)==null||(h=h.actions)==null||(h=h.values)==null||!h.length)})(p))));return d.length>0&&((l=this._surveyEventReceiver)==null||l.register(d)),(a=this._instance.persistence)==null||a.register({[cne]:u}),t(u,{isLoaded:!0})}})}catch(s){throw this.te=!1,s}}ne(t){for(var r of this.ee)try{if(!t.isLoaded)return r([],t);this.getSurveys(r)}catch(n){Xs.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,r){if(r===void 0&&(r=!1),!ma(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,r);Xs.warn("init was not called")}oe(t){var r=null;return this.getSurveys((n=>{var s;r=(s=n.find((a=>a.id===t)))!==null&&s!==void 0?s:null})),r}ae(t){if(ma(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var r=typeof t=="string"?this.oe(t):t;return r?this._surveyManager.checkSurveyEligibility(r):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(ma(this._surveyManager))return Xs.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var r=this.ae(t);return{visible:r.eligible,disabledReason:r.reason}}canRenderSurveyAsync(t,r){return ma(this._surveyManager)?(Xs.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((n=>{this.getSurveys((s=>{var a,i=(a=s.find((l=>l.id===t)))!==null&&a!==void 0?a:null;if(i){var o=this.ae(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),r)}))}renderSurvey(t,r){var n;if(ma(this._surveyManager))Xs.warn("init was not called");else{var s=typeof t=="string"?this.oe(t):t;if(s!=null&&s.id)if(Rgn.includes(s.type)){var a=Wt?.querySelector(r);if(a)return(n=s.appearance)!=null&&n.surveyPopupDelaySeconds?(Xs.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,o;Xs.info("Rendering survey "+s.id+" with delay of "+((i=s.appearance)==null?void 0:i.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(s,a),Xs.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,a);Xs.warn("Survey element not found")}else Xs.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Xs.warn("Survey not found")}}displaySurvey(t,r){var n;if(ma(this._surveyManager))Xs.warn("init was not called");else{var s=this.oe(t);if(s){var a=s;if((n=s.appearance)!=null&&n.surveyPopupDelaySeconds&&r.ignoreDelay&&(a=dr({},s,{appearance:dr({},s.appearance,{surveyPopupDelaySeconds:0})})),r.ignoreConditions===!1){var i=this.canRenderSurvey(s);if(!i.visible)return void Xs.warn("Survey is not eligible to be displayed: ",i.disabledReason)}r.displayType!==yyt.Inline?this._surveyManager.handlePopoverSurvey(a):this.renderSurvey(a,r.selector)}else Xs.warn("Survey not found")}}cancelPendingSurvey(t){ma(this._surveyManager)?Xs.warn("init was not called"):this._surveyManager.cancelSurvey(t)}}var K3e=Lo("[RateLimiter]");class Lgn{constructor(t){var r,n;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=s=>{var a=s.text;if(a&&a.length)try{(JSON.parse(a).quota_limited||[]).forEach((i=>{K3e.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void K3e.warn('could not rate limit - continuing. Error: "'+i?.message+'"',{text:a})}},this.instance=t,this.captureEventsPerSecond=((r=t.config.rate_limiting)==null?void 0:r.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((n=t.config.rate_limiting)==null?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(t){var r,n,s;t===void 0&&(t=!1);var a=new Date().getTime(),i=(r=(n=this.instance.persistence)==null?void 0:n.get_property(dne))!==null&&r!==void 0?r:{tokens:this.captureEventsBurstLimit,last:a};i.tokens+=(a-i.last)/1e3*this.captureEventsPerSecond,i.last=a,i.tokens>this.captureEventsBurstLimit&&(i.tokens=this.captureEventsBurstLimit);var o=i.tokens<1;return o||t||(i.tokens=Math.max(0,i.tokens-1)),!o||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(s=this.instance.persistence)==null||s.set_property(dne,i),{isRateLimited:o,remainingTokens:i.tokens}}isServerRateLimited(t){var r=this.serverLimits[t||"events"]||!1;return r!==!1&&new Date().getTime()<r}}var Qx=Lo("[RemoteConfig]");class Fgn{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=un._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}le(t){var r,n;(r=un.__PosthogExtensions__)!=null&&r.loadExternalDependency?(n=un.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(Qx.error("PostHog Extensions not found. Cannot load remote config."),t())}ue(t){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:r=>{t(r.json)}})}load(){try{if(this.remoteConfig)return Qx.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void Qx.warn("Remote config is disabled. Falling back to local config.");this.le((t=>{if(!t)return Qx.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((r=>{this.fi(r)}));this.fi(t)}))}catch(t){Qx.error("Error loading remote config",t)}}fi(t){t?this._instance.config.__preview_remote_config?(this._instance.fi(t),t.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):Qx.info("__preview_remote_config is disabled. Logging config instead",t):Qx.error("Failed to fetch remote config from PostHog.")}}var wne=3e3;class Bgn{constructor(t,r){this.he=!0,this.ve=[],this.de=Hh(r?.flush_interval_ms||wne,250,5e3,Kt.createLogger("flush interval"),wne),this.ce=t}enqueue(t){this.ve.push(t),this.fe||this.pe()}unload(){this.ge();var t=this.ve.length>0?this._e():{},r=Object.values(t);[...r.filter((n=>n.url.indexOf("/e")===0)),...r.filter((n=>n.url.indexOf("/e")!==0))].map((n=>{this.ce(dr({},n,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var t=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var r=this._e(),n=function(){var a=r[s],i=new Date().getTime();a.data&&ka(a.data)&&La(a.data,(o=>{o.offset=Math.abs(o.timestamp-i),delete o.timestamp})),t.ce(a)};for(var s in r)n()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var t={};return La(this.ve,(r=>{var n,s=r,a=(s?s.batchKey:null)||s.url;Ht(t[a])&&(t[a]=dr({},s,{data:[]})),(n=t[a].data)==null||n.push(s.data)})),this.ve=[],t}}var zgn=["retriesPerformedSoFar"];class Ugn{constructor(t){this.me=!1,this.ye=3e3,this.ve=[],this._instance=t,this.ve=[],this.be=!0,!Ht(Ze)&&"onLine"in Ze.navigator&&(this.be=Ze.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},co(Ze,"online",this.we),co(Ze,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(t){var{retriesPerformedSoFar:r}=t,n=pgt(t,zgn);Sm(r)&&r>0&&(n.url=X4(n.url,{retry_count:r})),this._instance.ci(dr({},n,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(r??0)<10?this.Se(dr({retriesPerformedSoFar:r},n)):n.callback==null||n.callback(s)}}))}Se(t){var r=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=r+1;var n=(function(i){var o=3e3*Math.pow(2,i),l=o/2,u=Math.min(18e5,o),d=(Math.random()-.5)*(u-l);return Math.ceil(u+d)})(r),s=Date.now()+n;this.ve.push({retryAt:s,requestOptions:t});var a="Enqueued failed request for retry in "+n;navigator.onLine||(a+=" (Browser is offline)"),Kt.warn(a),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var t=Date.now(),r=[],n=this.ve.filter((a=>a.retryAt<t||(r.push(a),!1)));if(this.ve=r,n.length>0)for(var{requestOptions:s}of n)this.retriableRequest(s)}unload(){for(var{requestOptions:t}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,Ht(Ze)||(this.we&&(Ze.removeEventListener("online",this.we),this.we=void 0),this.xe&&(Ze.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(dr({},t,{transport:"sendBeacon"}))}catch(r){Kt.error(r)}this.ve=[]}}class Vgn{constructor(t){this.ke=()=>{var r,n,s,a;this.Pe||(this.Pe={});var i=this.scrollElement(),o=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=o+(i?.clientHeight||0),d=i?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(o),this.Pe.maxScrollY=Math.max(o,(r=this.Pe.maxScrollY)!==null&&r!==void 0?r:0),this.Pe.maxScrollHeight=Math.max(l,(n=this.Pe.maxScrollHeight)!==null&&n!==void 0?n:0),this.Pe.lastContentY=u,this.Pe.maxContentY=Math.max(u,(s=this.Pe.maxContentY)!==null&&s!==void 0?s:0),this.Pe.maxContentHeight=Math.max(d,(a=this.Pe.maxContentHeight)!==null&&a!==void 0?a:0)},this._instance=t}getContext(){return this.Pe}resetContext(){var t=this.Pe;return setTimeout(this.ke,0),t}startMeasuringScrollPosition(){co(Ze,"scroll",this.ke,{capture:!0}),co(Ze,"scrollend",this.ke,{capture:!0}),co(Ze,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return Ze?.document.documentElement;var t=ka(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var r of t){var n=Ze?.document.querySelector(r);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Ze&&(Ze.scrollY||Ze.pageYOffset||Ze.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Ze&&(Ze.scrollX||Ze.pageXOffset||Ze.document.documentElement.scrollLeft)||0}}var qgn=e=>oyt(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties);class J3e{constructor(t,r,n,s){this.Te=a=>{var i=this.Re();if(!i||i.sessionId!==a){var o={sessionId:a,props:this.Ie(this._instance)};this.Fe.register({[une]:o})}},this._instance=t,this.Ce=r,this.Fe=n,this.Ie=s||qgn,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[une]}getSetOnceProps(){var t,r=(t=this.Re())==null?void 0:t.props;return r?"r"in r?lyt(r):{$referring_domain:r.referringDomain,$pathname:r.initialPathName,utm_source:r.utm_source,utm_campaign:r.utm_campaign,utm_medium:r.utm_medium,utm_content:r.utm_content,utm_term:r.utm_term}:{}}getSessionProps(){var t={};return La(Tfe(this.getSetOnceProps()),((r,n)=>{n==="$current_url"&&(n="url"),t["$session_entry_"+rne(n)]=r})),t}}var cK=Lo("[SessionId]");class eMe{on(t,r){return this.Me.on(t,r)}constructor(t,r,n){var s;if(this.Oe=[],this.Ae=void 0,this.Me=new Lfe,this.De=(d,p)=>Math.abs(d-p)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.F=t.config,this.Fe=t.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=r||Ub,this.Ue=n||Ub;var a=this.F.persistence_name||this.F.token,i=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Hh(i,60,36e3,cK.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+a+"_window_id",this.Be="ph_"+a+"_primary_window_exists",this.qe()){var o=fl.W(this.He),l=fl.W(this.Be);o&&!l?this.je=o:fl.V(this.He),fl.G(this.Be,!0)}if((s=this.F.bootstrap)!=null&&s.sessionID)try{var u=(d=>{var p=d.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),u)}catch(d){cK.error("Invalid sessionID in bootstrap",d)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ht(this.Oe)&&(this.Oe=[]),this.Oe.push(t),this.Le&&t(this.Le,this.je),()=>{this.Oe=this.Oe.filter((r=>r!==t))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&fl.H()}Ve(t){t!==this.je&&(this.je=t,this.qe()&&fl.G(this.He,t))}Je(){return this.je?this.je:this.qe()?fl.W(this.He):null}We(t,r,n){t===this.Le&&r===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=r,this.Le=t,this.Fe.register({[F4]:[r,t,n]}))}Ke(){var t=this.Fe.props[F4];return ka(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.We(null,null,null)}destroy(){clearTimeout(this.Ye),this.Ye=void 0,this.Ae&&Ze&&(Ze.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&fl.V(this.Be)},co(Ze,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(t,r){if(t===void 0&&(t=!1),r===void 0&&(r=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var n=r||new Date().getTime(),[s,a,i]=this.Ke(),o=this.Je(),l=Sm(i)&&i>0&&Math.abs(n-i)>864e5,u=!1,d=!a,p=!d&&!t&&this.De(n,s);d||p||l?(a=this.Ne(),o=this.Ue(),cK.info("new session ID generated",{sessionId:a,windowId:o,changeReason:{noSessionId:d,activityTimeout:p,sessionPastMaximumLength:l}}),i=n,u=!0):o||(o=this.Ue(),u=!0);var f=s===0||!t||l?n:s,h=i===0?new Date().getTime():i;return this.Ve(o),this.We(a,f,h),t||this.ze(),u&&this.Oe.forEach((m=>m(a,o,u?{noSessionId:d,activityTimeout:p,sessionPastMaximumLength:l}:void 0))),{sessionId:a,windowId:o,sessionStartTimestamp:h,changeReason:u?{noSessionId:d,activityTimeout:p,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[t]=this.Ke();if(this.De(new Date().getTime(),t)){var r=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:r})}}),1.1*this.sessionTimeoutMs)}}var Hgn=["$set_once","$set"],mb=Lo("[SiteApps]");class Qgn{constructor(t){this._instance=t,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(t,r){if(r){var n=this.globalsForEvent(r);this.Xe.push(n),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var t;return(t=un._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{t(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(t){var r,n,s,a,i,o,l;if(!t)throw new Error("Event payload is required");var u={},d=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(var[f,h]of Object.entries(p))u[f]={id:d[f],type:f,properties:h};var{$set_once:m,$set:y}=t;return{event:dr({},pgt(t,Hgn),{properties:dr({},t.properties,y?{$set:dr({},(r=(n=t.properties)==null?void 0:n.$set)!==null&&r!==void 0?r:{},y)}:{},m?{$set_once:dr({},(s=(a=t.properties)==null?void 0:a.$set_once)!==null&&s!==void 0?s:{},m)}:{}),elements_chain:(i=(o=t.properties)==null?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(t){var r=this.apps[t.id],n=()=>{var o;!r.errored&&this.Xe.length&&(mb.info("Processing "+this.Xe.length+" events for site app with id "+t.id),this.Xe.forEach((l=>r.processEvent==null?void 0:r.processEvent(l))),r.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((o=this.Ze)==null||o.call(this))},s=!1,a=o=>{r.errored=!o,r.loaded=!0,mb.info("Site app with id "+t.id+" "+(o?"loaded":"errored")),s&&n()};try{var{processEvent:i}=t.init({posthog:this._instance,callback:o=>{a(o)}});i&&(r.processEvent=i),s=!0}catch(o){mb.error("Error while initializing PostHog app with config id "+t.id,o),a(!1)}if(s&&r.loaded)try{n()}catch(o){mb.error("Error while processing buffered events PostHog app with config id "+t.id,o),r.errored=!0}}tr(){var t=this.siteAppLoaders||[];for(var r of t)this.apps[r.id]={id:r.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}ir(t){if(Object.keys(this.apps).length!==0){var r=this.globalsForEvent(t);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(r)}catch(s){mb.error("Error while processing event "+t.event+" for site app "+n.id,s)}}}onRemoteConfig(t){var r,n,s,a=this;if((r=this.siteAppLoaders)!=null&&r.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(u=>this.ir(u)))):void mb.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Ze)==null||n.call(this),(s=t.siteApps)!=null&&s.length)if(this.isEnabled){var i=function(u){var d;un["__$$ph_site_app_"+u]=a._instance,(d=un.__PosthogExtensions__)==null||d.loadSiteApp==null||d.loadSiteApp(a._instance,l,(p=>{if(p)return mb.error("Error while initializing PostHog app with config id "+u,p)}))};for(var{id:o,url:l}of t.siteApps)i(o)}else mb.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var byt=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&p3e(r,t))return!0;try{var n=e?.userAgentData;if(n!=null&&n.brands&&n.brands.some((s=>p3e(s?.brand,t))))return!0}catch{}return!!e.webdriver},nT=(function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e})({}),tMe="i.posthog.com";class Ggn{constructor(t){this.er={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,r=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return r||(r=this.apiHost.replace("."+tMe,".posthog.com")),r==="https://app.posthog.com"?"https://us.posthog.com":r}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=nT.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=nT.EU:this.er[this.apiHost]=nT.CUSTOM),this.er[this.apiHost]}endpointFor(t,r){if(r===void 0&&(r=""),r&&(r=r[0]==="/"?r:"/"+r),t==="ui")return this.uiHost+r;if(t==="flags")return this.flagsApiHost+r;if(this.region===nT.CUSTOM)return this.apiHost+r;var n=tMe+r;switch(t){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}}var Zgn={icontains:(e,t)=>!!Ze&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Ze&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!Ze&&Y4(t.href,e),not_regex:(e,t)=>!!Ze&&!Y4(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Rl{constructor(t){var r=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),r.getWebExperiments((s=>{Rl.rr("retrieved web experiments from the server"),r.sr=new Map,s.forEach((a=>{if(a.feature_flag_key){var i;r.sr&&(Rl.rr("setting flag key ",a.feature_flag_key," to web experiment ",a),(i=r.sr)==null||i.set(a.feature_flag_key,a));var o=r._instance.getFeatureFlag(a.feature_flag_key);Do(o)&&a.variants[o]&&r.nr(a.name,o,a.variants[o].transforms)}else if(a.variants)for(var l in a.variants){var u=a.variants[l];Rl.ar(u)&&r.nr(a.name,l,u.transforms)}}))}),n)},this._instance=t,this._instance.onFeatureFlags((n=>{this.onFeatureFlags(n)}))}onFeatureFlags(t){if(this._is_bot())Rl.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ma(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Rl.rr("applying feature flags",t),t.forEach((r=>{var n;if(this.sr&&(n=this.sr)!=null&&n.has(r)){var s,a=this._instance.getFeatureFlag(r),i=(s=this.sr)==null?void 0:s.get(r);a&&i!=null&&i.variants[a]&&this.nr(i.name,a,i.variants[a].transforms)}}))}}previewWebExperiment(){var t=Rl.getWindowLocation();if(t!=null&&t.search){var r=H4(t?.search,"__experiment_id"),n=H4(t?.search,"__experiment_variant");r&&n&&(Rl.rr("previewing web experiments "+r+" && "+n),this.getWebExperiments((s=>{this.lr(parseInt(r),n,s)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,r,n){if(this._instance.config.disable_web_experiments&&!n)return t([]);var s=this._instance.get_property("$web_experiments");if(s&&!r)return t(s);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:a=>{if(a.statusCode!==200||!a.json)return t([]);var i=a.json.experiments||[];return t(i)}})}lr(t,r,n){var s=n.filter((a=>a.id===t));s&&s.length>0&&(Rl.rr("Previewing web experiment ["+s[0].name+"] with variant ["+r+"]"),this.nr(s[0].name,r,s[0].variants[r].transforms))}static ar(t){return!ma(t.conditions)&&Rl.ur(t)&&Rl.hr(t)}static ur(t){var r;if(ma(t.conditions)||ma((r=t.conditions)==null?void 0:r.url))return!0;var n,s,a,i=Rl.getWindowLocation();return!!i&&((n=t.conditions)==null||!n.url||Zgn[(s=(a=t.conditions)==null?void 0:a.urlMatchType)!==null&&s!==void 0?s:"icontains"](t.conditions.url,i))}static getWindowLocation(){return Ze?.location}static hr(t){var r;if(ma(t.conditions)||ma((r=t.conditions)==null?void 0:r.utm))return!0;var n=nyt();if(n.utm_source){var s,a,i,o,l,u,d,p,f=(s=t.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((a=t.conditions)==null||(a=a.utm)==null?void 0:a.utm_campaign)==n.utm_campaign,h=(i=t.conditions)==null||(i=i.utm)==null||!i.utm_source||((o=t.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==n.utm_source,m=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=t.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==n.utm_medium,y=(d=t.conditions)==null||(d=d.utm)==null||!d.utm_term||((p=t.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==n.utm_term;return f&&m&&y&&h}return!1}static rr(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];Kt.info("[WebExperiments] "+t,n)}nr(t,r,n){this._is_bot()?Rl.rr("Refusing to render web experiment since the viewer is a likely bot"):r!=="control"?n.forEach((s=>{if(s.selector){var a;Rl.rr("applying transform of variant "+r+" for experiment "+t+" ",s);var i=(a=document)==null?void 0:a.querySelectorAll(s.selector);i?.forEach((o=>{var l=o;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)}))}})):Rl.rr("Control variants leave the page unmodified.")}_is_bot(){return cd&&this._instance?byt(cd,this._instance.config.custom_blocked_useragents):void 0}}var Wgn=Lo("[PostHog ExternalIntegrations]"),Xgn={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Ygn{constructor(t){this._instance=t}it(t,r){var n;(n=un.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,t,(s=>{if(s)return Wgn.error("failed to load script",s);r()}))}startIfEnabledOrStop(){var t=this,r=function(i){var o,l,u;!s||(o=un.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[i]||t.it(Xgn[i],(()=>{var d;(d=un.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[i])==null||d.start(t._instance)})),!s&&(l=un.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((u=un.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[i])==null||u.stop())};for(var[n,s]of Object.entries((a=this._instance.config.integrations)!==null&&a!==void 0?a:{})){var a;r(n)}}}var Ene="[SessionRecording]",OC=Lo(Ene);class rMe{get started(){var t;return!((t=this.vr)==null||!t.isStarted)}get status(){return this.vr?this.vr.status:this.dr&&!this.cr?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.dr=!1,this.pr=void 0,this._instance=t,!this._instance.sessionManager)throw OC.error("started without valid sessionManager"),new Error(Ene+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Ene+' cannot be used with cookieless_mode="always"')}get cr(){var t,r=!((t=this._instance.get_property(XY))==null||!t.enabled),n=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Ze&&r&&n&&!s}startIfEnabledOrStop(t){var r;if(!this.cr||(r=this.vr)==null||!r.isStarted){var n=!Ht(Object.assign)&&!Ht(Array.from);this.cr&&n?(this.gr(t),OC.info("starting")):this.stopRecording()}}gr(t){var r,n,s;this.cr&&(un!=null&&(r=un.__PosthogExtensions__)!=null&&(r=r.rrweb)!=null&&r.record&&(n=un.__PosthogExtensions__)!=null&&n.initSessionRecording?this._r(t):(s=un.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,this.mr,(a=>{if(a)return OC.error("could not load recorder",a);this._r(t)})))}stopRecording(){var t,r;(t=this.pr)==null||t.call(this),this.pr=void 0,(r=this.vr)==null||r.stop()}yr(){var t;(t=this._instance.persistence)==null||t.unregister(wgt)}br(t){if(this._instance.persistence){var r,n,s=this._instance.persistence,a=()=>{var i=t.sessionRecording===!1?void 0:t.sessionRecording,o=i?.sampleRate,l=ma(o)?null:parseFloat(o);ma(l)&&this.yr();var u=i?.minimumDurationMilliseconds;s.register({[XY]:dr({enabled:!!i},i,{networkPayloadCapture:dr({capturePerformance:t.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:Ht(u)?null:u,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};a(),(r=this.pr)==null||r.call(this),this.pr=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(a)}}onRemoteConfig(t){"sessionRecording"in t?t.sessionRecording!==!1?(this.br(t),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:OC.info("skipping remote config with no sessionRecording",t)}log(t,r){var n;r===void 0&&(r="log"),(n=this.vr)!=null&&n.log?this.vr.log(t,r):OC.warn("log called before recorder was ready")}get mr(){var t,r,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(XY);return(n==null||(r=n.scriptConfig)==null?void 0:r.script)||"lazy-recorder"}_r(t){var r,n;if((r=un.__PosthogExtensions__)==null||!r.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(n=un.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(t)}onRRwebEmit(t){var r;(r=this.vr)==null||r.onRRwebEmit==null||r.onRRwebEmit(t)}overrideLinkedFlag(){var t,r;this.vr||(r=this._instance.persistence)==null||r.register({$replay_override_linked_flag:!0}),(t=this.vr)==null||t.overrideLinkedFlag()}overrideSampling(){var t,r;this.vr||(r=this._instance.persistence)==null||r.register({$replay_override_sampling:!0}),(t=this.vr)==null||t.overrideSampling()}overrideTrigger(t){var r,n;this.vr||(n=this._instance.persistence)==null||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(r=this.vr)==null||r.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.vr)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,r){var n;return!((n=this.vr)==null||!n.tryAddCustomEvent(t,r))}}var YT={},kne=()=>{},_w="posthog",vyt=!_gn&&Kc?.indexOf("MSIE")===-1&&Kc?.indexOf("Mozilla")===-1,nMe=e=>{var t;return dr({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:xmn(Wt?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:kne,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,debug:su&&Do(su?.search)&&su.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(Ze==null||(t=Ze.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:r=>{var n="Bad HTTP status: "+r.statusCode+" "+r.text;Kt.error(n)},get_device_id:r=>r,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:wne},error_tracking:{},_onCapture:kne,__preview_eager_load_replay:!1},(r=>({rageclick:!(r&&r>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(r&&r>="2025-05-24")||"history_change",session_recording:r&&r>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(e))},sMe=e=>{var t={};Ht(e.process_person)||(t.person_profiles=e.process_person),Ht(e.xhr_headers)||(t.request_headers=e.xhr_headers),Ht(e.cookie_name)||(t.persistence_name=e.cookie_name),Ht(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),Ht(e.store_google)||(t.save_campaign_params=e.store_google),Ht(e.verbose)||(t.debug=e.verbose);var r=Zi({},t,e);return ka(e.property_blacklist)&&(Ht(e.property_denylist)?r.property_denylist=e.property_blacklist:ka(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:Kt.error("Invalid value for property_denylist config: "+e.property_denylist)),r};class Kgn{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(t){Kt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class f8{get decideEndpointWasHit(){var t,r;return(t=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,r;return(t=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){this.webPerformance=new Kgn,this.Sr=!1,this.version=kg.LIB_VERSION,this.Er=new Lfe,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=nMe(),this.SentryIntegration=Wmn,this.sentryIntegration=t=>(function(r,n){var s=Bgt(r,n);return{name:Fgt,processEvent:a=>s(a)}})(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new Dgn(this),this.toolbar=new Ymn(this),this.scrollManager=new Vgn(this),this.pageViewManager=new ygn(this),this.surveys=new Mgn(this),this.experiments=new Rl(this),this.exceptions=new Cgn(this),this.rateLimiter=new Lgn(this),this.requestRouter=new Ggn(this),this.consent=new Vmn(this),this.externalIntegrations=new Ygn(this),this.people={set:(t,r,n)=>{var s=Do(t)?{[t]:r}:t;this.setPersonProperties(s),n?.({})},set_once:(t,r,n)=>{var s=Do(t)?{[t]:r}:t;this.setPersonProperties(void 0,s),n?.({})}},this.on("eventCaptured",(t=>Kt.info('send "'+t?.event+'"',t)))}init(t,r,n){if(n&&n!==_w){var s,a=(s=YT[n])!==null&&s!==void 0?s:new f8;return a._init(t,r,n),YT[n]=a,YT[_w][n]=a,a}return this._init(t,r,n)}_init(t,r,n){var s;if(r===void 0&&(r={}),Ht(t)||nne(t))return Kt.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},r.debug=this.Rr(r.debug),this.Ir=r,this.Fr=[],r.person_profiles&&(this.Pr=r.person_profiles),this.set_config(Zi({},nMe(r.defaults),sMe(r),{name:n,token:t})),this.config.on_xhr_error&&Kt.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=r.disable_compression?void 0:jg.GZipJS;var a=this.Cr();this.persistence=new oK(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new oK(dr({},this.config,{persistence:"sessionStorage"}),a);var i=dr({},this.persistence.props),o=dr({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Bgn((S=>this.Or(S)),this.config.request_queue_config),this.Ar=new Ugn(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new eMe(this),this.sessionPropsManager=new J3e(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Kt.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(Kt.info("Initializing extensions synchronously"),this.Dr(l)),kg.DEBUG=kg.DEBUG||this.config.debug,kg.DEBUG&&Kt.info("Starting in debug mode",{this:this,config:r,thisC:dr({},this.config),p:i,s:o}),((s=r.bootstrap)==null?void 0:s.distinctID)!==void 0){var u,d,p=this.config.get_device_id(Ub()),f=(u=r.bootstrap)!=null&&u.isIdentifiedID?p:r.bootstrap.distinctID;this.persistence.set_property(Og,(d=r.bootstrap)!=null&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.bootstrap.distinctID,$device_id:f})}if(this.jr()){var h,m,y=Object.keys(((h=r.bootstrap)==null?void 0:h.featureFlags)||{}).filter((S=>{var w;return!((w=r.bootstrap)==null||(w=w.featureFlags)==null||!w[S])})).reduce(((S,w)=>{var k;return S[w]=((k=r.bootstrap)==null||(k=k.featureFlags)==null?void 0:k[w])||!1,S}),{}),b=Object.keys(((m=r.bootstrap)==null?void 0:m.featureFlagPayloads)||{}).filter((S=>y[S])).reduce(((S,w)=>{var k,_;return(k=r.bootstrap)!=null&&(k=k.featureFlagPayloads)!=null&&k[w]&&(S[w]=(_=r.bootstrap)==null||(_=_.featureFlagPayloads)==null?void 0:_[w]),S}),{});this.featureFlags.receivedFeatureFlags({featureFlags:y,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:yC,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(Ub());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(Og,"anonymous")}return co(Ze,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),r.segment?Zmn(this,(()=>this.Lr())):this.Lr(),rv(this.config._onCapture)&&this.config._onCapture!==kne&&(Kt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(S=>this.config._onCapture(S.event,S)))),this.config.ip&&Kt.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(t){var r=performance.now();this.historyAutocapture=new Gmn(this),this.historyAutocapture.startIfEnabled();var n=[];n.push((()=>{new Jmn(this).startIfEnabledOrStop()})),n.push((()=>{var s;this.siteApps=new Qgn(this),(s=this.siteApps)==null||s.init()})),t||n.push((()=>{this.sessionRecording=new rMe(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||n.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),n.push((()=>{this.autocapture=new Pmn(this),this.autocapture.startIfEnabled()})),n.push((()=>{this.surveys.loadIfEnabled()})),n.push((()=>{this.heatmaps=new ggn(this),this.heatmaps.startIfEnabled()})),n.push((()=>{this.webVitalsAutocapture=new hgn(this)})),n.push((()=>{this.exceptionObserver=new Qmn(this),this.exceptionObserver.startIfEnabled()})),n.push((()=>{this.deadClicksAutocapture=new Lgt(this,Hmn),this.deadClicksAutocapture.startIfEnabled()})),n.push((()=>{if(this.Nr){var s=this.Nr;this.Nr=void 0,this.fi(s)}})),this.Ur(n,r)}Ur(t,r){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-r>=30&&t.length>0)return void setTimeout((()=>{this.Ur(t,r)}),0);var n=t.shift();if(n)try{n()}catch(a){Kt.error("Error initializing extension:",a)}}var s=Math.round(performance.now()-r);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:s}),this.config.__preview_deferred_init_extensions&&Kt.info("PostHog extensions initialized ("+s+"ms)")}fi(t){var r,n,s,a,i,o,l,u;if(!Wt||!Wt.body)return Kt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=rs(t.supportedCompression,jg.GZipJS)?jg.GZipJS:rs(t.supportedCompression,jg.Base64)?jg.Base64:void 0),(r=t.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(n=this.siteApps)==null||n.onRemoteConfig(t),(s=this.sessionRecording)==null||s.onRemoteConfig(t),(a=this.autocapture)==null||a.onRemoteConfig(t),(i=this.heatmaps)==null||i.onRemoteConfig(t),this.surveys.onRemoteConfig(t),(o=this.webVitalsAutocapture)==null||o.onRemoteConfig(t),(l=this.exceptionObserver)==null||l.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),(u=this.deadClicksAutocapture)==null||u.onRemoteConfig(t)}Lr(){try{this.config.loaded(this)}catch(t){Kt.critical("`loaded` function failed",t)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Fgn(this).load(),this.featureFlags.flags()}zr(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Mr)==null||t.enable())}_dom_loaded(){this.is_capturing()&&sv(this.__request_queue,(t=>this.Or(t))),this.__request_queue=[],this.zr()}_handle_unload(){var t,r;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(t=this.Mr)==null||t.unload(),(r=this.Ar)==null||r.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(t){this.__loaded&&(vyt?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=X4(t.url,{ip:this.config.ip?1:0}),t.headers=dr({},this.config.request_headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(r=>{var n,s,a,i=dr({},r);i.timeout=i.timeout||6e4,i.url=X4(i.url,{_:new Date().getTime().toString(),ver:kg.LIB_VERSION,compression:i.compression});var o=(n=i.transport)!==null&&n!==void 0?n:"fetch",l=Z$.filter((d=>!i.disableTransport||!d.transport||!i.disableTransport.includes(d.transport))),u=(s=(a=vgt(l,(d=>d.transport===o)))==null?void 0:a.method)!==null&&s!==void 0?s:l[0].method;if(!u)throw new Error("No available transport method");u(i)})(dr({},t,{callback:r=>{var n,s;this.rateLimiter.checkForLimiting(r),r.statusCode>=400&&((n=(s=this.config).on_request_error)==null||n.call(s,r)),t.callback==null||t.callback(r)}}))))}Or(t){this.Ar?this.Ar.retriableRequest(t):this.ci(t)}_execute_array(t){var r,n=[],s=[],a=[];sv(t,(o=>{o&&(r=o[0],ka(r)?a.push(o):rv(o)?o.call(this):ka(o)&&r==="alias"?n.push(o):ka(o)&&r.indexOf("capture")!==-1&&rv(this[r])?a.push(o):s.push(o))}));var i=function(o,l){sv(o,(function(u){if(ka(u[0])){var d=l;La(u,(function(p){d=d[p[0]].apply(d,p.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),l)};i(n,this),i(s,this),i(a,this)}jr(){var t,r;return((t=this.config.bootstrap)==null?void 0:t.featureFlags)&&Object.keys((r=this.config.bootstrap)==null?void 0:r.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,r,n){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!Ht(t)&&Do(t)){var a=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(a&&!this.config.__preview_capture_bot_pageviews)){var i=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){r!=null&&r.$current_url&&!Do(r?.$current_url)&&(Kt.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),r==null||delete r.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,l=n?.timestamp||o,u=Ub(),d={uuid:u,event:t,properties:this.calculateEventProperties(t,r||{},l,u)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&a&&(d.event="$bot_pageview",d.properties.$browser_type="bot"),i&&(d.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),n?.$set&&(d.$set=n?.$set);var p,f=this.qr(n?.$set_once);if(f&&(d.$set_once=f),(d=bmn(d,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,Ht(n?.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=o),t===W$.DISMISSED||t===W$.SENT){var h=r?.[X3e.SURVEY_ID],m=r?.[X3e.SURVEY_ITERATION];p={id:h,current_iteration:m},localStorage.getItem(Y3e(p))||localStorage.setItem(Y3e(p),"true"),d.$set=dr({},d.$set,{[jgn({id:h,current_iteration:m},t===W$.SENT?"responded":"dismissed")]:!0})}var y=dr({},d.properties.$set,d.$set);if(Hw(y)||this.setPersonPropertiesForFlags(y),!ma(this.config.before_send)){var b=this.Wr(d);if(!b)return;d=b}this.Er.emit("eventCaptured",d);var v={method:"POST",url:(s=n?._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:d,compression:"best-available",batchKey:n?._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Or(v):this.Mr.enqueue(v),d}Kt.critical("This capture call is ignored due to client rate limiting.")}}else Kt.error("No event name provided to posthog.capture")}else Kt.uninitializedWarning("posthog.capture")}Ai(t){return this.on("eventCaptured",(r=>t(r.event,r)))}calculateEventProperties(t,r,n,s,a){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return r;var i=a?void 0:this.persistence.remove_event_timer(t),o=dr({},r);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),t==="$snapshot"){var l=dr({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!Do(o.distinct_id)&&!Sm(o.distinct_id)||nne(o.distinct_id))&&Kt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,d=fgn(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:p,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(a,n.getTime());o.$session_id=p,o.$window_id=f}this.sessionPropsManager&&Zi(o,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&Zi(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(h=this.Ar)==null?void 0:h.length}catch(v){o.$sdk_debug_error_capturing_properties=String(v)}if(this.requestRouter.region===nT.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),u=t!=="$pageview"||a?t!=="$pageleave"||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,s),o=Zi(o,u),t==="$pageview"&&Wt&&(o.title=Wt.title),!Ht(i)){var m=n.getTime()-i;o.$duration=parseFloat((m/1e3).toFixed(3))}Kc&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=Zi({},d,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),ka(this.config.property_denylist)?La(this.config.property_denylist,(function(v){delete o[v]})):Kt.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(Kt.error("sanitize_properties is deprecated. Use before_send instead"),o=y(o,t));var b=this.Gr();return o.$process_person_profile=b,b&&!a&&this.Vr("_calculate_event_properties"),o}qr(t){var r;if(!this.persistence||!this.Gr()||this.Sr)return t;var n=this.persistence.get_initial_props(),s=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),a=Zi({},n,s||{},t||{}),i=this.config.sanitize_properties;return i&&(Kt.error("sanitize_properties is deprecated. Use before_send instead"),a=i(a,"$set_once")),this.Sr=!0,Hw(a)?void 0:a}register(t,r){var n;(n=this.persistence)==null||n.register(t,r)}register_once(t,r,n){var s;(s=this.persistence)==null||s.register_once(t,r,n)}register_for_session(t){var r;(r=this.sessionPersistence)==null||r.register(t)}unregister(t){var r;(r=this.persistence)==null||r.unregister(t)}unregister_for_session(t){var r;(r=this.sessionPersistence)==null||r.unregister(t)}Jr(t,r){this.register({[t]:r})}getFeatureFlag(t,r){return this.featureFlags.getFeatureFlag(t,r)}getFeatureFlagPayload(t){var r=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(r)}catch{return r}}isFeatureEnabled(t,r){return this.featureFlags.isFeatureEnabled(t,r)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(t,r,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,r,n)}getEarlyAccessFeatures(t,r,n){return r===void 0&&(r=!1),this.featureFlags.getEarlyAccessFeatures(t,r,n)}on(t,r){return this.Er.on(t,r)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var r,n;return(r=(n=this.sessionManager)==null?void 0:n.onSessionId(t))!==null&&r!==void 0?r:()=>{}}getSurveys(t,r){r===void 0&&(r=!1),this.surveys.getSurveys(t,r)}getActiveMatchingSurveys(t,r){r===void 0&&(r=!1),this.surveys.getActiveMatchingSurveys(t,r)}renderSurvey(t,r){this.surveys.renderSurvey(t,r)}displaySurvey(t,r){r===void 0&&(r=Pgn),this.surveys.displaySurvey(t,r)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,r){return r===void 0&&(r=!1),this.surveys.canRenderSurveyAsync(t,r)}identify(t,r,n){if(!this.__loaded||!this.persistence)return Kt.uninitializedWarning("posthog.identify");if(Sm(t)&&(t=t.toString(),Kt.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))Kt.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==yC){if(this.Vr("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var a=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:a},"")}t!==s&&t!==this.get_property(YC)&&(this.unregister(YC),this.register({distinct_id:t}));var i=(this.persistence.get_property(Og)||"anonymous")==="anonymous";t!==s&&i?(this.persistence.set_property(Og,"identified"),this.setPersonPropertiesForFlags(dr({},n||{},r||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:s},{$set:r||{},$set_once:n||{}}),this.Tr=H3e(t,r,n),this.featureFlags.setAnonymousDistinctId(s)):(r||n)&&this.setPersonProperties(r,n),t!==s&&(this.reloadFeatureFlags(),this.unregister(B4))}}else Kt.critical('The string "'+yC+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Kt.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,r){if((t||r)&&this.Vr("posthog.setPersonProperties")){var n=H3e(this.get_distinct_id(),t,r);this.Tr!==n?(this.setPersonPropertiesForFlags(dr({},r||{},t||{})),this.capture("$set",{$set:t||{},$set_once:r||{}}),this.Tr=n):Kt.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,r,n){if(t&&r){if(this.Vr("posthog.group")){var s=this.getGroups();s[t]!==r&&this.resetGroupPropertiesForFlags(t),this.register({$groups:dr({},s,{[t]:r})}),n&&(this.capture("$groupidentify",{$group_type:t,$group_key:r,$group_set:n}),this.setGroupPropertiesForFlags({[t]:n})),s[t]===r||n||this.reloadFeatureFlags()}}else Kt.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,r){r===void 0&&(r=!0),this.featureFlags.setPersonPropertiesForFlags(t,r)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,r){r===void 0&&(r=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,r)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var r,n,s,a;if(Kt.info("reset"),!this.__loaded)return Kt.uninitializedWarning("posthog.reset");var i=this.get_property("$device_id");if(this.consent.reset(),(r=this.persistence)==null||r.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),this.featureFlags.reset(),(s=this.persistence)==null||s.set_property(Og,"anonymous"),(a=this.sessionManager)==null||a.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:yC,$device_id:null},"");else{var o=this.config.get_device_id(Ub());this.register_once({distinct_id:o,$device_id:t?o:i},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,r;return(t=(r=this.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:r,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+r);if(t!=null&&t.withTimestamp&&n){var a,i=(a=t.timestampLookBack)!==null&&a!==void 0?a:10;if(!n)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return s}alias(t,r){return t===this.get_property(xgt)?(Kt.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(Ht(r)&&(r=this.get_distinct_id()),t!==r?(this.Jr(YC,t),this.capture("$create_alias",{alias:t,distinct_id:r})):(Kt.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var r=dr({},this.config);if(qo(t)){var n,s,a,i,o;Zi(this.config,sMe(t));var l=this.Cr();(n=this.persistence)==null||n.update_config(this.config,r,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new oK(dr({},this.config,{persistence:"sessionStorage"}),l);var u=this.Rr(this.config.debug);nv(u)&&(this.config.debug=u),nv(this.config.debug)&&(this.config.debug?(kg.DEBUG=!0,bi.H()&&bi.G("ph_debug","true"),Kt.info("set_config",{config:t,oldConfig:r,newConfig:dr({},this.config)})):(kg.DEBUG=!1,bi.H()&&bi.V("ph_debug"))),(s=this.sessionRecording)==null||s.startIfEnabledOrStop(),(a=this.autocapture)==null||a.startIfEnabled(),(i=this.heatmaps)==null||i.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(o=this.externalIntegrations)==null||o.startIfEnabledOrStop()}}startSessionRecording(t){var r=t===!0,n={sampling:r||!(t==null||!t.sampling),linked_flag:r||!(t==null||!t.linked_flag),url_trigger:r||!(t==null||!t.url_trigger),event_trigger:r||!(t==null||!t.event_trigger)};if(Object.values(n).some(Boolean)){var s,a,i,o,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),n.sampling&&((a=this.sessionRecording)==null||a.overrideSampling()),n.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),n.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),n.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,r){var n=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(t,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(dr({},s,r))}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var r;return(r=this.persistence)==null?void 0:r.props[t]}getSessionProperty(t){var r;return(r=this.sessionPersistence)==null?void 0:r.props[t]}toString(){var t,r=(t=this.config.name)!==null&&t!==void 0?t:_w;return r!==_w&&(r=_w+"."+r),r}_isIdentified(){var t,r;return((t=this.persistence)==null?void 0:t.get_property(Og))==="identified"||((r=this.sessionPersistence)==null?void 0:r.get_property(Og))==="identified"}Gr(){var t,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Hw(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[YC])&&((r=this.persistence)==null||(r=r.props)==null||!r[U4]))}Br(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Vr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Vr(t){return this.config.person_profiles==="never"?(Kt.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(U4,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut(),r=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||t&&!!r}Kr(){var t,r,n,s,a=this.Cr();return((t=this.persistence)==null?void 0:t.wi)!==a&&((n=this.persistence)==null||n.set_disabled(a)),((r=this.sessionPersistence)==null?void 0:r.wi)!==a&&((s=this.sessionPersistence)==null||s.set_disabled(a)),a}opt_in_capturing(t){var r;if(this.config.cookieless_mode!=="always"){var n,s;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(n=this.sessionManager)==null||n.destroy(),this.sessionManager=new eMe(this),this.persistence&&(this.sessionPropsManager=new J3e(this,this.sessionManager,this.persistence)),this.sessionRecording=new rMe(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(Ht(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((s=t?.captureEventName)!==null&&s!==void 0?s:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else Kt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:yC,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.Hr())):Kt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===_g.GRANTED?"granted":t===_g.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return cd?byt(cd,this.config.custom_blocked_useragents):void 0}Hr(){Wt&&(Wt.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:Wt.title},{send_instantly:!0}),this.kr&&(Wt.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),co(Wt,"visibilitychange",this.kr)))}debug(t){t===!1?(Ze?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(Ze?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var t,r,n,s,a,i,o,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Kt.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(n="advanced_disable_decide",s=!1,a=Kt,i=(r="advanced_disable_flags")in(t=l)&&!Ht(t[r]),o=n in t&&!Ht(t[n]),i?t[r]:o?(a&&a.warn("Config field '"+n+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),t[n]):s)}Wr(t){if(ma(this.config.before_send))return t;var r=ka(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r){if(n=s(n),ma(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return Hhn(t.event)?Kt.warn(a+". This can cause unexpected behavior."):Kt.info(a),null}n.properties&&!Hw(n.properties)||Kt.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var t;return(t=this.pageViewManager.Vt)==null?void 0:t.pageViewId}captureTraceFeedback(t,r){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:r})}captureTraceMetric(t,r,n){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:r,$ai_metric_value:String(n)})}Rr(t){var r=nv(t)&&!t,n=bi.H()&&bi.q("ph_debug")==="true";return!r&&(!!n||t)}}(function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=ymn(e.prototype[t[r]])})(f8,["identify"]);var aMe,Rg=(aMe=YT[_w]=new f8,(function(){function e(){e.done||(e.done=!0,vyt=!1,La(YT,(function(t){t._dom_loaded()})))}Wt!=null&&Wt.addEventListener?Wt.readyState==="complete"?e():co(Wt,"DOMContentLoaded",e,{capture:!1}):Ze&&Kt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),aMe),xyt=E.createContext({client:Rg,bootstrap:void 0});function Syt(e,t,r){if(r===void 0&&(r=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(r.has(e)&&r.get(e)===t)return!0;r.set(e,t);var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(var a=0,i=n;a<i.length;a++){var o=i[a];if(!s.includes(o)||!Syt(e[o],t[o],r))return!1}return!0}function Jgn(e){var t,r,n=e.children,s=e.client,a=e.apiKey,i=e.options,o=E.useRef(null),l=E.useMemo(function(){return s?(a&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),i&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s):(a||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),Rg)},[s,a,JSON.stringify(i)]);return E.useEffect(function(){if(!s){var u=o.current;u?(a!==u.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),i&&!Syt(i,u.options)&&Rg.set_config(i),o.current={apiKey:a,options:i??{}}):(Rg.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),Rg.init(a,i),o.current={apiKey:a,options:i??{}})}},[s,a,JSON.stringify(i)]),Ee.createElement(xyt.Provider,{value:{client:l,bootstrap:(t=i?.bootstrap)!==null&&t!==void 0?t:(r=s?.config)===null||r===void 0?void 0:r.bootstrap}},n)}var uK=function(e){return typeof e=="function"},One=function(e,t){return One=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},One(e,t)};function eyn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");One(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var tyn={componentStack:null,exceptionEvent:null,error:null},ryn={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){eyn(t,e);function t(r){var n=e.call(this,r)||this;return n.state=tyn,n}return t.prototype.componentDidCatch=function(r,n){var s=this.props.additionalProperties,a;uK(s)?a=s(r):typeof s=="object"&&(a=s);var i=this.context.client,o=i.captureException(r,a),l=n.componentStack;this.setState({error:r,componentStack:l,exceptionEvent:o})},t.prototype.render=function(){var r=this.props,n=r.children,s=r.fallback,a=this.state;if(a.componentStack==null)return uK(n)?n():n;var i=uK(s)?Ee.createElement(s,{error:a.error,componentStack:a.componentStack,exceptionEvent:a.exceptionEvent}):s;return Ee.isValidElement(i)?i:(console.warn(ryn.INVALID_FALLBACK),Ee.createElement(Ee.Fragment,null))},t.contextType=xyt,t})(Ee.Component);function nyn({children:e}){return E.useEffect(()=>{if("brave"in navigator){console.info("[Analytics]: Telemetry is disabled for browser constraints.");return}if(window.MASTRA_TELEMETRY_DISABLED){console.info("[Analytics]: Telemetry is disabled.");return}Rg.init("phc_SBLpZVAB6jmHOct9CABq3PF0Yn5FU3G2FgT4xUr2XrT",{api_host:"https://us.posthog.com"}),Rg.register({mastraSource:"playground"})},[]),c.jsx(Jgn,{client:Rg,children:e})}const syn=["/swagger-ui","/openapi.json"],ayn=E.forwardRef(({children:e,href:t,...r},n)=>t&&syn.some(a=>t.startsWith(a))?c.jsx("a",{ref:n,href:t,...r,children:e}):c.jsx(Pt,{ref:n,to:t,viewTransition:!0,...r,children:e}));function iyn(){const{Link:e,navigate:t}=Yt(),{data:r={},isLoading:n,error:s}=ah(),{isCmsAvailable:a}=pS(),{canEdit:i}=Bm(),o=a&&i("stored-agents"),l=()=>{t("/cms/agents/create")};return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx($i,{})}),"Agents"]}),c.jsxs(Vs,{children:[o&&c.jsxs(ye,{variant:"light",as:e,to:"/cms/agents/create",children:[c.jsx(ve,{children:c.jsx(SF,{})}),"Create an agent"]}),c.jsxs(ye,{variant:"outline",as:e,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Agents documentation"]})]})]}),c.jsx(Si,{isCentered:!n&&Object.keys(r||{}).length===0,children:c.jsx(wnn,{agents:r,isLoading:n,error:s,onCreateClick:o?l:void 0})})]})}function oyn({agentId:e,threadId:t,threads:r,isLoading:n}){const{mutateAsync:s}=Srn(),{paths:a,navigate:i}=Yt(),o=async l=>{await s({threadId:l,agentId:e}),l===t&&i(a.agentNewThreadLink(e))};return c.jsx(Rsn,{resourceId:e,resourceType:"agent",threads:r||[],isLoading:n,threadId:t,onDelete:o})}function iMe(){const{agentId:e,threadId:t}=Ei(),[r]=sc(),{data:n,isLoading:s,error:a}=lx(e),{data:i}=X6(e),o=Hp(),l=t==="new",u=E.useMemo(()=>No(),[t]),d=!!i?.result,{data:p,isLoading:f,refetch:h}=xrn({agentId:e,isMemoryEnabled:d}),{data:m}=dft({threadId:t,agentId:e}),y=m?.resourceId??e;E.useEffect(()=>{d&&(t||o(`/agents/${e}/chat/new`))},[d,t,e,o]);const b=r.get("messageId")??void 0,v=E.useMemo(()=>{if(!n)return{modelSettings:{}};const k=n.defaultOptions,{maxOutputTokens:_,...C}=k?.modelSettings??{};return{modelSettings:{...C,..._!==void 0&&{maxTokens:_},...k?.maxSteps!==void 0&&{maxSteps:k.maxSteps},...k?.providerOptions!==void 0&&{providerOptions:k.providerOptions}}}},[n]);if(a&&Mc(a))return c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"agents"})});if(s)return null;if(!n)return c.jsx("div",{className:"text-center py-4",children:"Agent not found"});const S=l?u:t,w=async()=>{await h(),l&&o(`/agents/${e}/chat/${u}`)};return c.jsx(wpt,{entityId:e,entityType:"agent",children:c.jsx(yrn,{agentId:e,defaultSettings:v,children:c.jsx(Wpe,{children:c.jsx(drn,{agentId:e,threadId:S,resourceId:y,children:c.jsx(Vtn,{children:c.jsx(brn,{children:c.jsx(ctn,{children:c.jsx(ian,{agentId:e,leftSlot:d&&c.jsx(oyn,{agentId:e,threadId:S,threads:p||[],isLoading:f}),rightSlot:c.jsx(ran,{agentId:e,threadId:S}),children:c.jsx(Nrn,{agentId:e,agentName:n?.name,modelVersion:n?.modelVersion,threadId:S,memory:d,refreshThreadList:w,modelList:n?.modelList,messageId:b,isNewThread:l},S)})})})})})})})})}function lyn(){return c.jsx(Nin,{})}function cyn(){const{navigate:e,paths:t}=Yt(),r=qp(),{form:n,handlePublish:s,isSubmitting:a,canPublish:i}=nmt({mode:"create",onSuccess:o=>e(t.agentLink(o))});return c.jsxs(Hr,{children:[c.jsxs(Fr,{className:"bg-surface1",children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx($i,{})}),"Create an agent"]}),c.jsx(Vs,{children:c.jsx(ye,{variant:"primary",onClick:s,disabled:a||!i,className:"w-full",children:a?c.jsxs(c.Fragment,{children:[c.jsx(Cn,{className:"h-4 w-4"}),"Creating..."]}):c.jsxs(c.Fragment,{children:[c.jsx(ve,{children:c.jsx(cKe,{})}),"Create agent"]})})})]}),c.jsx(smt,{form:n,mode:"create",isSubmitting:a,handlePublish:s,basePath:"/cms/agents/create",currentPath:r.pathname,children:c.jsx(dN,{})})]})}function oMe({agentId:e,selectedVersionId:t,versionData:r,readOnly:n=!1,form:s,handlePublish:a,handleSaveDraft:i,isSubmitting:o,isSavingDraft:l,onVersionSelect:u,activeVersionId:d,latestVersionId:p}){const[,f]=sc(),h=qp(),b=!!t&&!!r&&t!==p?c.jsxs(Ep,{variant:"info",className:"mb-4",children:[c.jsx(kp,{children:"This is a previous version"}),c.jsx(ny,{as:"p",children:"You are seeing a specific version of the agent."}),c.jsx("div",{className:"pt-2",children:c.jsx(ye,{type:"button",variant:"light",size:"sm",onClick:()=>f({}),children:"View latest version"})})]}):void 0,v=c.jsx(Ion,{agentId:e,selectedVersionId:t??void 0,onVersionSelect:u,activeVersionId:d});return c.jsx(smt,{form:s,mode:"edit",agentId:e,isSubmitting:o,isSavingDraft:l,handlePublish:a,handleSaveDraft:i,readOnly:n,basePath:`/cms/agents/${e}/edit`,currentPath:h.pathname,banner:b,versionId:t??void 0,rightPanel:v,children:c.jsx(dN,{})})}function uyn(){const{agentId:e}=Ei(),{navigate:t,paths:r}=Yt(),[n,s]=sc(),a=n.get("versionId"),{data:i,isLoading:o}=Usn(e,{status:"draft"}),{data:l}=Vsn({agentId:e??"",versionId:a??""}),{data:u}=Yft({agentId:e??"",params:{sortDirection:"DESC"}}),d=i?.activeVersionId,p=u?.versions?.[0],f=!!(p&&p.id!==d),h=!!a&&!!l,m=E.useMemo(()=>h&&l?l:i||{},[h,l,i]),{form:y,handlePublish:b,handleSaveDraft:v,isSubmitting:S,isSavingDraft:w,isDirty:k}=nmt({mode:"edit",agentId:e??"",dataSource:m,onSuccess:A=>t(r.agentLink(A))}),_=E.useCallback(A=>{s(A?{versionId:A}:{})},[s]),C=!o&&(!i||!e),T=!o&&!!i&&!!e;return c.jsxs(Hr,{children:[c.jsxs(Fr,{className:"bg-surface1",children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx($i,{})}),o&&c.jsx(Nr,{className:"h-6 w-[200px]"}),C&&"Agent not found",T&&`Edit agent: ${i.name}`,T&&f&&c.jsx(Ft,{variant:"info",children:"Unpublished changes"})]}),T&&c.jsxs(Vs,{children:[c.jsx(ye,{variant:"outline",onClick:v,disabled:!k||w||S,children:w?c.jsxs(c.Fragment,{children:[c.jsx(Cn,{className:"h-4 w-4"}),"Saving..."]}):c.jsxs(c.Fragment,{children:[c.jsx(ve,{children:c.jsx(Gbr,{})}),"Save"]})}),c.jsx(ye,{variant:"primary",onClick:b,disabled:!f&&!k||S||w,children:S?c.jsxs(c.Fragment,{children:[c.jsx(Cn,{className:"h-4 w-4"}),"Publishing..."]}):c.jsxs(c.Fragment,{children:[c.jsx(ve,{children:c.jsx(cKe,{})}),"Publish"]})})]})]}),C?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Agent not found"}),c.jsx("div",{className:"hidden",children:c.jsx(oMe,{agentId:e??"",selectedVersionId:a,versionData:l,readOnly:!0,form:y,handlePublish:b,handleSaveDraft:v,isSubmitting:S,isSavingDraft:w,onVersionSelect:_,activeVersionId:d,latestVersionId:p?.id})})]}):c.jsx(oMe,{agentId:e??"",selectedVersionId:a,versionData:l,form:y,handlePublish:b,handleSaveDraft:v,isSubmitting:S,isSavingDraft:w,onVersionSelect:_,activeVersionId:d,latestVersionId:p?.id})]})}function dyn(){return c.jsx(pin,{})}function pyn(){return c.jsx(fin,{})}function fyn(){return c.jsx(Pin,{})}function hyn(){return c.jsx(Iin,{})}function myn(){return c.jsx(von,{})}function gyn(){return c.jsx(Din,{})}function yyn(){return c.jsx(Vin,{})}function byn(){return c.jsx(Rin,{})}function vyn(){const{navigate:e,paths:t}=Yt();return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(_T,{})}),"Create a prompt block"]})}),c.jsx(Can,{onSuccess:r=>e(t.cmsPromptBlockEditLink(r.id))})]})}function lMe(e){return{name:e.name,description:e.description||void 0,content:e.content,rules:e.rules||void 0,requestContextSchema:e.variables||void 0}}function xyn({block:e,blockId:t,selectedVersionId:r,hasDraft:n}){const s=st(),a=va(),{navigate:i,paths:o}=Yt(),{updateStoredPromptBlock:l}=mht(t),[u,d]=E.useState(!1),[p,f]=E.useState(!1),{data:h}=jan({blockId:t,versionId:r??""}),m=!!r&&!!h,y=m?h:e,b=E.useMemo(()=>({name:y.name||"",description:y.description||"",content:y.content||"",rules:y.rules,variables:y.requestContextSchema}),[y]),{form:v}=pht({initialValues:b}),[S,w]=E.useState(0);E.useEffect(()=>{b&&!v.formState.isDirty&&(v.reset(b),w(C=>C+1))},[b,v]);const k=E.useCallback(async()=>{if(!await v.trigger()){We.error("Please fill in all required fields");return}f(!0);try{const T=lMe(v.getValues());await l.mutateAsync(T),v.reset(v.getValues()),We.success("Draft saved")}catch(T){We.error(`Failed to save draft: ${T instanceof Error?T.message:"Unknown error"}`)}finally{f(!1)}},[v,l]),_=E.useCallback(async()=>{if(!await v.trigger()){We.error("Please fill in all required fields");return}d(!0);try{const T=lMe(v.getValues());await l.mutateAsync(T);const N=(await s.getStoredPromptBlock(t).listVersions({sortDirection:"DESC",perPage:1})).versions[0];if(!N)throw new Error("No version found to publish");await s.getStoredPromptBlock(t).activateVersion(N.id),a.invalidateQueries({queryKey:["stored-prompt-blocks"]}),a.invalidateQueries({queryKey:["stored-prompt-block"]}),a.invalidateQueries({queryKey:["prompt-block-versions",t]}),We.success("Prompt block published"),i(o.promptBlocksLink())}catch(T){We.error(`Failed to publish: ${T instanceof Error?T.message:"Unknown error"}`)}finally{d(!1)}},[v,l,s,t,i,o,a]);return c.jsxs(Pv,{leftSlot:c.jsx(uht,{form:v,onPublish:_,onSaveDraft:k,isSubmitting:u,isSavingDraft:p,isDirty:v.formState.isDirty,hasDraft:n,formResetKey:S,mode:"edit"}),children:[m&&c.jsxs(Ep,{variant:"info",className:"m-4 mb-0",children:[c.jsx(kp,{children:"This is a previous version"}),c.jsx(ny,{as:"p",children:"You are seeing a specific version of the prompt block."})]}),c.jsx("form",{className:"h-full",children:c.jsx(dht,{form:v})})]})}function Syn(){const{promptBlockId:e}=Ei(),[t,r]=sc(),n=t.get("versionId"),{data:s,isLoading:a}=hht(e,{status:"draft"}),{data:i}=ght({blockId:e??"",params:{sortDirection:"DESC"}}),o=s?.activeVersionId,l=i?.versions?.[0],u=!!(l&&(!o||l.id!==o)),d=E.useCallback(p=>{r(p?{versionId:p}:{})},[r]);return a?c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(_T,{})}),c.jsx(Nr,{className:"h-6 w-[200px]"})]})}),c.jsx(Pv,{leftSlot:c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx(Cn,{className:"h-8 w-8"})}),children:c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx(Cn,{className:"h-8 w-8"})})})]}):!s||!e?c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(_T,{})}),"Prompt block not found"]})}),c.jsx(Pv,{leftSlot:c.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Prompt block not found"}),children:c.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Prompt block not found"})})]}):c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(_T,{})}),"Edit prompt block: ",s.name,u&&c.jsx(Ft,{variant:"info",children:"Unpublished changes"})]}),c.jsx(Vs,{children:c.jsx(Pan,{blockId:e,value:n??"",onValueChange:d,variant:"outline",activeVersionId:o})})]}),c.jsx(xyn,{block:s,blockId:e,selectedVersionId:n,hasDraft:u})]})}function wyn(){const{navigate:e,paths:t}=Yt();return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(Bg,{})}),"Create a scorer"]})}),c.jsx(osn,{onSuccess:r=>e(t.scorerLink(r.id))})]})}function cMe(e){return{name:e.name,description:e.description||void 0,type:e.type,model:e.model,instructions:e.instructions||void 0,scoreRange:e.scoreRange,defaultSampling:e.defaultSampling?.type==="ratio"&&typeof e.defaultSampling.rate=="number"?e.defaultSampling:{type:"none"}}}function Eyn({scorer:e,scorerId:t,selectedVersionId:r}){const n=st(),s=va(),{navigate:a,paths:i}=Yt(),{updateStoredScorer:o}=jft(t),[l,u]=E.useState(!1),[d,p]=E.useState(!1),f=E.useRef(null),{data:h}=csn({scorerId:t,versionId:r??""}),m=!!r&&!!h,y=m?h:e,b=E.useMemo(()=>({name:y.name||"",description:y.description||"",type:"llm-judge",model:{provider:y.model?.provider||"",name:y.model?.name||""},instructions:y.instructions||"",scoreRange:{min:y.scoreRange?.min??0,max:y.scoreRange?.max??1},defaultSampling:y.defaultSampling}),[y]),{form:v}=Ift({initialValues:b});E.useEffect(()=>{b&&v.reset(b)},[b,v]);const S=E.useCallback(async()=>{if(!await v.trigger()){We.error("Please fill in all required fields");return}p(!0);try{const _=cMe(v.getValues());await o.mutateAsync(_),We.success("Draft saved")}catch(_){We.error(`Failed to save draft: ${_ instanceof Error?_.message:"Unknown error"}`)}finally{p(!1)}},[v,o]),w=E.useCallback(async()=>{if(!await v.trigger()){We.error("Please fill in all required fields");return}u(!0);try{const _=cMe(v.getValues());await o.mutateAsync(_);const T=(await n.getStoredScorer(t).listVersions({sortDirection:"DESC",perPage:1})).versions[0];T&&await n.getStoredScorer(t).activateVersion(T.id),s.invalidateQueries({queryKey:["scorers"]}),s.invalidateQueries({queryKey:["stored-scorers"]}),We.success("Scorer published"),a(i.scorerLink(t))}catch(_){We.error(`Failed to publish scorer: ${_ instanceof Error?_.message:"Unknown error"}`)}finally{u(!1)}},[v,o,n,t,a,i,s]);return c.jsxs(Pv,{leftSlot:c.jsx(Dft,{form:v,onPublish:w,onSaveDraft:S,isSubmitting:l,isSavingDraft:d,formRef:f,mode:"edit"}),children:[m&&c.jsxs(Ep,{variant:"info",className:"m-4 mb-0",children:[c.jsx(kp,{children:"This is a previous version"}),c.jsx(ny,{as:"p",children:"You are seeing a specific version of the scorer."})]}),c.jsx("form",{ref:f,className:"h-full",children:c.jsx(Nft,{form:v})})]})}function kyn(){const{scorerId:e}=Ei(),[t,r]=sc(),n=t.get("versionId"),{data:s,isLoading:a}=isn(e,{status:"draft"}),{data:i}=Rft({scorerId:e??"",params:{sortDirection:"DESC"}}),o=s?.activeVersionId,l=i?.versions?.[0],u=!!(l&&o&&l.id!==o),d=E.useCallback(p=>{r(p?{versionId:p}:{})},[r]);return a?c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(Bg,{})}),c.jsx(Nr,{className:"h-6 w-[200px]"})]})}),c.jsx(Pv,{leftSlot:c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx(Cn,{className:"h-8 w-8"})}),children:c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx(Cn,{className:"h-8 w-8"})})})]}):!s||!e?c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(Bg,{})}),"Scorer not found"]})}),c.jsx(Pv,{leftSlot:c.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Scorer not found"}),children:c.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Scorer not found"})})]}):c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(Bg,{})}),"Edit scorer: ",s.name,u&&c.jsx(Ft,{variant:"info",children:"Unpublished changes"})]}),c.jsx(Vs,{children:c.jsx(dsn,{scorerId:e,value:n??"",onValueChange:d,variant:"outline",activeVersionId:o})})]}),c.jsx(Eyn,{scorer:s,scorerId:e,selectedVersionId:n})]})}function Oyn(){const[e,t]=E.useState(!1),{navigate:r,paths:n}=Yt(),{data:s,isLoading:a}=n8(),i=s?.datasets??[],o=l=>{t(!1),r(n.datasetLink(l))};return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsx(Vs,{children:c.jsxs(ye,{variant:"light",onClick:()=>t(!0),children:[c.jsx(ve,{children:c.jsx(SF,{})}),"Create Dataset"]})})]}),c.jsx(Si,{isCentered:!a&&i.length===0,children:c.jsx(Jln,{datasets:i,isLoading:a,onCreateClick:()=>t(!0)})}),c.jsx(dcn,{open:e,onOpenChange:t,onSuccess:o})]})}function _yn(){const{datasetId:e}=Ei(),t=Hp(),[r,n]=E.useState(!1),[s,a]=E.useState(!1),[i,o]=E.useState(!1),[l,u]=E.useState(!1),[d,p]=E.useState(null),{data:f}=ky(e??"");if(!e)return c.jsx(Hr,{children:c.jsx(Si,{children:c.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});const h=b=>{t(`/datasets/${e}/experiments/${b}`)},m=()=>{t("/datasets")},y=b=>{p(b?.version??null)};return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/datasets",children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:c.jsx(ycn,{value:e,variant:"ghost"})})]})}),c.jsxs(Si,{className:"content-stretch",children:[c.jsx(Tun,{datasetId:e,onAddItemClick:()=>a(!0),onEditClick:()=>o(!0),onDeleteClick:()=>u(!0),activeDatasetVersion:d,onVersionSelect:y,experimentTriggerSlot:c.jsxs(ye,{variant:"cta",size:"default",onClick:()=>n(!0),children:[c.jsx(qbr,{}),d!=null?`Run on v${d}`:"Run Experiment"]})}),c.jsx(Run,{datasetId:e,version:d??void 0,open:r,onOpenChange:n,onSuccess:h}),c.jsx(Dun,{datasetId:e,open:s,onOpenChange:a}),f&&c.jsx(mcn,{open:i,onOpenChange:o,dataset:{id:f.id,name:f.name,description:f?.description||"",inputSchema:f.inputSchema,groundTruthSchema:f.groundTruthSchema}}),f&&c.jsx(gcn,{open:l,onOpenChange:u,datasetId:f.id,datasetName:f.name,onSuccess:m})]})]})}function Cyn(){const{datasetId:e,experimentId:t}=Ei(),{data:r}=ky(e??""),{data:n,isLoading:s,error:a}=Gre(e,t),{data:i,isLoading:o}=$ln({datasetId:e,experimentId:t,experimentStatus:n?.status});if(!e||!t)return null;if(s)return c.jsx(Hr,{children:c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx(Cn,{})})});if(a||!n)return c.jsx(Hr,{children:c.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})});const l=i?.results??[];return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/datasets",children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsx(Or,{as:Pt,to:`/datasets/${e}`,children:r?.name}),c.jsx(Or,{isCurrent:!0,as:"span",children:"Experiment"})]})}),c.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:c.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[c.jsx(tdn,{experimentId:t,experiment:n}),c.jsx(Kun,{experimentId:t,results:l,isLoading:o})]})})]})}function Tyn(){const{datasetId:e}=Ei(),[t,r]=sc(),{data:n}=ky(e??""),s=t.get("baseline")??"",a=t.get("contender")??"";return!e||!s||!a?c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/datasets",children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsxs(Or,{isCurrent:!0,as:"span",children:[c.jsx(ve,{children:c.jsx(CT,{})}),"Compare Experiments"]})]})}),c.jsx(Si,{children:c.jsxs("div",{className:"text-neutral4 text-center py-8",children:[c.jsx("p",{children:"Select two experiments to compare."}),c.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/experiments?baseline=","{experimentIdA}","&contender=","{experimentIdB}"]})]})})]}):c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/datasets",children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsx(Or,{as:Pt,to:`/datasets/${e}`,children:n?.name??e?.slice(0,8)}),c.jsxs(Or,{isCurrent:!0,as:"span",children:[c.jsx(ve,{children:c.jsx(CT,{})}),"Experiments Comparison"]})]})}),c.jsx(Si,{children:c.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[c.jsxs(Rr,{children:[c.jsxs(Rr.Column,{children:[c.jsxs(Rr.Title,{children:[c.jsx(CT,{})," Dataset Experiments Comparison"]}),c.jsxs(Rr.Description,{children:["Comparing"," ",c.jsx(Pt,{to:`/datasets/${e}/experiments/${s}`,children:s.slice(0,8)})," vs"," ",c.jsx(Pt,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})]})]}),c.jsx(Rr.Column,{children:c.jsxs(ye,{as:Pt,to:`/datasets/${e}`,variant:"standard",size:"default",children:[c.jsx(lk,{}),"Back to Dataset"]})})]}),c.jsx(adn,{datasetId:e,experimentIdA:s,experimentIdB:a,onSwap:()=>{r({baseline:a,contender:s})}})]})})]})}function Ayn(){const{datasetId:e,itemId:t}=Ei(),{Link:r}=Yt(),n=Hp(),{data:s,isLoading:a}=pfe(e??"",t??""),{updateItem:i,deleteItem:o}=ju(),{data:l}=ky(e??""),u=s?.[0]??null,d=u?.isDeleted??!1,[p,f]=E.useState(null),h=E.useMemo(()=>!u||d?{input:"",groundTruth:"",metadata:""}:{input:JSON.stringify(u.input,null,2),groundTruth:u.groundTruth?JSON.stringify(u.groundTruth,null,2):"",metadata:u.metadata?JSON.stringify(u.metadata,null,2):""},[u,d]),m=u?.datasetVersion??0,[y,b]=E.useState(!1),[v,S]=E.useState(h.input),[w,k]=E.useState(h.groundTruth),[_,C]=E.useState(h.metadata),[T,A]=E.useState(m);m!==T&&(A(m),S(h.input),k(h.groundTruth),C(h.metadata));const[N,j]=E.useState(!1),R=X=>{f(d?X:X.isLatest?null:X)},L=()=>{f(null)},F=!d&&p!=null,M=()=>{F||b(!0)},z=()=>{F||j(!0)},q=async()=>{if(!e||!t)return;let X;try{X=JSON.parse(v)}catch{We.error("Input must be valid JSON");return}let U;if(w.trim())try{U=JSON.parse(w)}catch{We.error("Ground Truth must be valid JSON");return}let I;if(_.trim())try{I=JSON.parse(_)}catch{We.error("Metadata must be valid JSON");return}try{await i.mutateAsync({datasetId:e,itemId:t,input:X,groundTruth:U,metadata:I}),We.success("Item updated successfully"),b(!1)}catch(H){We.error(`Failed to update item: ${H instanceof Error?H.message:"Unknown error"}`)}},Q=()=>{u&&(S(JSON.stringify(u.input,null,2)),k(u.groundTruth?JSON.stringify(u.groundTruth,null,2):""),C(u.metadata?JSON.stringify(u.metadata,null,2):"")),b(!1)},V=async()=>{if(!(!e||!t))try{await o.mutateAsync({datasetId:e,itemId:t}),We.success("Item deleted successfully"),j(!1),n(`/datasets/${e}`)}catch(X){We.error(`Failed to delete item: ${X instanceof Error?X.message:"Unknown error"}`)}},Z=p??u,$=Z?{id:t??"",datasetId:e??"",datasetVersion:Z.datasetVersion,input:Z.input,groundTruth:Z.groundTruth,metadata:Z.metadata,createdAt:Z.createdAt,updatedAt:Z.updatedAt}:null;return a?null:!e||!t||!s||s.length===0?c.jsx(Hr,{children:c.jsx(Si,{children:c.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):c.jsxs(c.Fragment,{children:[c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/datasets",children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsx(Or,{as:Pt,to:`/datasets/${e}`,children:l?.name}),c.jsx(Or,{isCurrent:!0,as:"span",children:"Item"})]})}),c.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:c.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[c.jsxs(Rr,{children:[c.jsxs(Rr.Column,{children:[c.jsxs(Rr.Title,{children:[c.jsx(Cbr,{}),t," ",c.jsx(ql,{content:t})]}),c.jsx(Rr.Description,{children:c.jsxs(Es,{children:["Item of ",c.jsx(wu,{})," ",l?.name]})}),c.jsxs(Rr.Description,{children:[c.jsxs(Es,{children:[c.jsx(dbr,{})," Created at"," ",u?.createdAt?vn(new Date(u.createdAt),"MMM d, yyyy"):""]}),c.jsxs(Es,{children:[c.jsx(xF,{})," Latest version v",u?.datasetVersion??""]})]})]}),c.jsx(Rr.Column,{children:!y&&!d&&c.jsxs(Xo,{children:[c.jsxs(ye,{variant:"cta",size:"default",onClick:M,disabled:F,title:F?"Return to latest version to edit":void 0,children:[c.jsx(Bbr,{})," Edit"]}),c.jsxs(ye,{variant:"cta",size:"default",onClick:z,disabled:F,title:F?"Return to latest version to delete":void 0,children:[c.jsx(tvr,{})," Delete"]})]})})]}),c.jsxs(cx,{className:y?"grid-cols-1":"grid-cols-[1fr_auto]",children:[c.jsxs(Un,{withRightSeparator:!y,children:[d&&u&&c.jsxs(Vo,{variant:"destructive",children:[c.jsx(Iee,{}),c.jsxs(Vo.Message,{children:["This item was deleted at version v",u.datasetVersion]})]}),!d&&F&&p&&c.jsx(c.Fragment,{children:c.jsxs(Vo,{variant:"warning",children:[c.jsx(Iee,{}),c.jsxs(Vo.Message,{children:["Viewing version v",p.datasetVersion]}),c.jsxs(Vo.Button,{onClick:L,children:[c.jsx(abr,{})," Return to the latest version"]})]})}),y?c.jsx(mmt,{inputValue:v,setInputValue:S,groundTruthValue:w,setGroundTruthValue:k,metadataValue:_,setMetadataValue:C,validationErrors:null,onSave:q,onCancel:Q,isSaving:i.isPending}):$?c.jsx(s8,{item:$,Link:r}):c.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!y&&c.jsx(Un,{children:c.jsx(idn,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:X=>{n(`/datasets/${e}/items/${t}/versions?ids=${X.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})]}),c.jsx(qt,{open:N,onOpenChange:j,children:c.jsxs(qt.Content,{children:[c.jsxs(qt.Header,{children:[c.jsx(qt.Title,{children:"Delete Item"}),c.jsx(qt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),c.jsxs(qt.Footer,{children:[c.jsx(qt.Cancel,{children:"Cancel"}),c.jsx(qt.Action,{onClick:V,children:o.isPending?"Deleting...":"Delete"})]})]})})]})}function uMe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function Dyn(){const{datasetId:e}=Ei(),[t,r]=sc(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s}=ky(e??""),{Link:a}=Yt(),[i,o]=E.useState(!1),{data:l}=Hre(e??"",n[0]??""),{data:u}=Hre(e??"",n[1]??"");return!e||n.length<2?c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/datasets",children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsx(Or,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),c.jsx(Si,{children:c.jsx("div",{className:"text-neutral4 text-center py-8",children:c.jsx("p",{children:"Select at least two items to compare."})})})]}):c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/datasets",children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsx(Or,{as:Pt,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),c.jsx(Or,{isCurrent:!0,as:"span",children:"Compare Items"})]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:`/datasets/${e}`,variant:"outline",children:[c.jsx(ve,{children:c.jsx(lk,{})}),"Back to Dataset"]})})]}),c.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:c.jsxs("div",{className:K("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":i}),children:[c.jsxs(Rr,{children:[c.jsxs(Rr.Column,{children:[c.jsxs(Rr.Title,{children:[c.jsx(CT,{}),"Compare Dataset Items"]}),c.jsx(Rr.Description,{children:c.jsxs(Es,{children:["Comparing ",n.length," items of"," ",c.jsx(Pt,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),c.jsx(Rr.Column,{children:c.jsxs(Xo,{children:[c.jsxs(ye,{as:Pt,to:`/datasets/${e}`,variant:"standard",size:"default",children:[c.jsx(lk,{}),"Back to Dataset"]}),c.jsx(ye,{variant:"cta",size:"default",onClick:()=>o(d=>!d),children:i?c.jsxs(c.Fragment,{children:[c.jsx(uKe,{})," Default View"]}):c.jsxs(c.Fragment,{children:[c.jsx(wbr,{})," Diff View"]})})]})})]}),c.jsx(cx,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((d,p)=>c.jsxs(E.Fragment,{children:[c.jsx(Nyn,{datasetId:e,itemId:d,Link:a,idx:p,itemIds:n,showContent:!i,onItemChange:f=>{const h=[...n];h[p]=f,r({items:h.join(",")})}}),p==0&&c.jsx("div",{className:K("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},d))}),i&&l&&u&&c.jsx(Cmt,{codeA:uMe(l),codeB:uMe(u)})]})})]})}function Nyn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:o,isLoading:l}=Hre(e,t),{data:u}=P4(e),d=new Set(s.filter((f,h)=>h!==n)),p=(u??[]).map(f=>({value:f.id,label:f.id,disabled:d.has(f.id)}));return c.jsxs(Un,{children:[c.jsxs(Un.Toolbar,{className:"flex gap-4",children:[c.jsx(jc,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:p,placeholder:"Select item",variant:"experimental",size:"default",labelIsHidden:!0}),c.jsxs(ye,{as:r,to:`/datasets/${e}/items/${t}`,variant:"standard",size:"default",children:[c.jsx(xF,{}),"Versions"]})]}),i&&c.jsx(Un.Content,{children:l?c.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):o?c.jsxs(c.Fragment,{children:[c.jsx(hmt,{item:o}),c.jsx(s8,{item:o,Link:r})]}):c.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function dMe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function Iyn(){const{datasetId:e,itemId:t}=Ei(),[r,n]=sc(),[s,a]=E.useState(!1),i=r.get("ids")?.split(",").map(Number).filter(f=>!isNaN(f)&&f>0)??[],{data:o}=ky(e??""),{Link:l}=Yt(),{data:u}=pfe(e??"",t??""),{data:d}=Qre(e??"",t??"",i[0]??0,o?.version),{data:p}=Qre(e??"",t??"",i[1]??0,o?.version);return!e||!t||i.length<2?c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/datasets",children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsx(Or,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),c.jsx(Si,{children:c.jsx("div",{className:"text-neutral4 text-center py-8",children:c.jsx("p",{children:"Select at least two versions to compare."})})})]}):c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/datasets",children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsx(Or,{as:Pt,to:`/datasets/${e}`,children:o?.name}),c.jsx(Or,{as:Pt,to:`/datasets/${e}/items/${t}`,children:"Item"}),c.jsx(Or,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[c.jsx(ve,{children:c.jsx(lk,{})}),"Back to Item"]})})]}),c.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:c.jsxs("div",{className:K("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[c.jsxs(Rr,{children:[c.jsxs(Rr.Column,{children:[c.jsxs(Rr.Title,{children:[c.jsx(CT,{}),"Compare Dataset Item Versions"]}),c.jsx(Rr.Description,{children:c.jsxs(Es,{children:["Comparing ",i.length," versions of"," ",c.jsx(Pt,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),c.jsx(Rr.Column,{children:c.jsxs(Xo,{children:[c.jsxs(ye,{as:Pt,to:`/datasets/${e}/items/${t}`,variant:"standard",size:"default",children:[c.jsx(lk,{}),"Back to Item"]}),c.jsx(ye,{variant:"cta",size:"default",onClick:()=>a(f=>!f),children:s?c.jsxs(c.Fragment,{children:[c.jsx(uKe,{})," Default View"]}):c.jsxs(c.Fragment,{children:[c.jsx(Ibr,{})," Diff View"]})})]})})]}),c.jsx(cx,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((f,h)=>c.jsxs(E.Fragment,{children:[c.jsx(jyn,{datasetId:e,itemId:t,datasetVersion:f,latestVersion:o?.version,allVersions:u??[],versionNumbers:i,Link:l,idx:h,showContent:!s,onVersionChange:m=>{const y=[...i];y[h]=m,n({ids:y.join(",")})}}),h===0&&c.jsx("div",{className:K("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),s&&d&&p&&c.jsx(Cmt,{codeA:dMe(d),codeB:dMe(p)})]})})]})}function jyn({datasetId:e,itemId:t,datasetVersion:r,latestVersion:n,allVersions:s,versionNumbers:a,Link:i,idx:o,showContent:l=!0,onVersionChange:u}){const{data:d,isLoading:p}=Qre(e,t,r,n),f=new Set(a.filter((y,b)=>b!==o)),h=s.map(y=>{const b=typeof y.updatedAt=="string"?new Date(y.updatedAt):y.updatedAt;return{value:String(y.datasetVersion),label:c.jsxs(c.Fragment,{children:[c.jsxs("b",{children:["v. ",y.datasetVersion]})," - ",vn(b,"MMM d, yyyy h:mm a"),y.isLatest?c.jsx(po,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:f.has(y.datasetVersion)}}),m=d?{id:d.id,datasetId:e,datasetVersion:d.datasetVersion,input:d.input,groundTruth:d.groundTruth,metadata:d.metadata,createdAt:d.createdAt,updatedAt:d.updatedAt}:null;return c.jsxs(Un,{children:[c.jsxs(Un.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[c.jsx(xF,{className:"w-6 h-6 opacity-50"}),c.jsx(jc,{label:"Version",name:`compare-version-${o}`,value:String(r),onValueChange:y=>u(Number(y)),options:h,placeholder:"Select version",variant:"experimental",size:"default",labelIsHidden:!0,className:"w-full"})]}),l&&c.jsx(Un.Content,{children:p?c.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?c.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",r," not found"]}):c.jsx(s8,{item:m,Link:i})})]})}function Ryn(){const{datasetId:e}=Ei(),[t]=sc(),r=t.get("ids")?.split(",").map(Number).filter(m=>!isNaN(m)&&m>0)??[],n=Hp(),{data:s}=ky(e??""),a=P4(e??"",void 0,r[0]??null),i=P4(e??"",void 0,r[1]??null),o=E.useMemo(()=>a.data??[],[a.data]),l=E.useMemo(()=>i.data??[],[i.data]),u=E.useMemo(()=>{const m=new Map;for(const y of[...o,...l])m.has(y.id)||m.set(y.id,{id:y.id,createdAt:new Date(y.createdAt)});return[...m.values()].sort((y,b)=>b.createdAt.getTime()-y.createdAt.getTime())},[o,l]),d=E.useMemo(()=>new Map(o.map(m=>[m.id,m])),[o]),p=E.useMemo(()=>new Map(l.map(m=>[m.id,m])),[l]);if(!e||r.length<2)return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/datasets",children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsx(Or,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),c.jsx(Si,{children:c.jsx("div",{className:"text-neutral4 text-center py-8",children:c.jsx("p",{children:"Select at least two versions to compare."})})})]});const f=(m,y,b)=>{n(`/datasets/${e}/items/${m}/versions?ids=${y?.datasetVersion??""},${b?.datasetVersion??""}`)},h=(m,y)=>{n(`/datasets/${e}/versions?ids=${m},${y}`,{replace:!0})};return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/datasets",children:[c.jsx(ve,{children:c.jsx(wu,{})}),"Datasets"]}),c.jsx(Or,{as:Pt,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),c.jsxs(Or,{isCurrent:!0,as:"span",children:[c.jsx(ve,{children:c.jsx(pAe,{})}),"Compare Versions"]})]})}),c.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:c.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[c.jsxs(Rr,{children:[c.jsxs(Rr.Column,{children:[c.jsxs(Rr.Title,{children:[c.jsx(pAe,{})," Compare Dataset Versions"]}),c.jsx(Rr.Description,{children:c.jsxs(Es,{children:[c.jsx(xF,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),c.jsx(Rr.Column,{children:c.jsxs(ye,{as:Pt,to:`/datasets/${e}`,variant:"standard",size:"default",children:[c.jsx(lk,{}),"Back to Dataset"]})})]}),c.jsx(cx,{children:c.jsxs(Un,{children:[c.jsx(cdn,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:h}),c.jsx(fdn,{datasetId:e,versionA:r[0],versionB:r[1],allItems:u,itemsAMap:d,itemsBMap:p,onItemClick:f})]})})]})})]})}function Pyn(){const[e]=sc(),t=Hp(),r=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,i=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return c.jsx(Fft,{redirectUri:r,onSuccess:i,initialMode:s,errorMessage:a})}const $yn=()=>{const{data:e=[],isLoading:t,error:r}=pj(),n=!t&&e.length===0;return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(Gf,{})}),"MCP Servers"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"MCP documentation"]})})]}),c.jsx(Si,{isCentered:n,children:c.jsx(Rdn,{mcpServers:e,isLoading:t,error:r})})]})},Myn=()=>{const{serverId:e}=Ei(),{data:t=[],isLoading:r}=pj(),n=t.find(s=>s.id===e);return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/mcps",children:[c.jsx(ve,{children:c.jsx(Gf,{})}),"MCP Servers"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:c.jsx(Iht,{value:e,variant:"ghost"})})]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"MCP documentation"]})})]}),c.jsx(Fdn,{isLoading:r,server:n})]})},Lyn=()=>{const{data:e}=pj(),{serverId:t,toolId:r}=Ei(),{data:n,isLoading:s}=Amt(t,r),a=e?.find(l=>l.id===t),i=n?.name,o=a?.name||"";return s||!n?null:c.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-hidden",children:[c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/mcps",children:[c.jsx(ve,{children:c.jsx(Gf,{})}),"MCP Servers"]}),c.jsx(Or,{as:Pt,to:`/mcps/${t}`,children:o}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:i})]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"MCP documentation"]})})]}),c.jsx(Ldn,{toolId:r,serverId:t})]})},Fyn=(e,t)=>{const r=st();return ur({queryKey:["trace",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return await r.getTrace(e)},enabled:!!e,refetchInterval:3e3,...t})},Byn=async({client:e,page:t,perPage:r,filters:n})=>e.listTraces({pagination:{page:t,perPage:r},filters:n}),zyn=25;function Uyn(e,t,r){if(e?.pagination?.hasMore)return r+1}function Vyn(e){const t=new Set;return e.pages.flatMap(r=>r.spans??[]).filter(r=>t.has(r.traceId)?!1:(t.add(r.traceId),!0))}const qyn=({filters:e})=>{const t=st(),{inView:r,setRef:n}=Bpe(),s=EF({queryKey:["traces",e],queryFn:({pageParam:l})=>Byn({client:t,page:l,perPage:zyn,filters:e}),initialPageParam:0,getNextPageParam:Uyn,select:Vyn,retry:!1,refetchInterval:l=>Mc(l.state.error)?!1:3e3}),{hasNextPage:a,isFetchingNextPage:i,fetchNextPage:o}=s;return E.useEffect(()=>{r&&a&&!i&&o()},[r,a,i,o]),{...s,setEndOfListElement:n}};function Hyn(){const e=Hp(),[t,r]=sc(),[n,s]=E.useState(),[a,i]=E.useState({value:"all",label:"All",type:"all"}),[o,l]=E.useState(void 0),[u,d]=E.useState(void 0),[p,f]=E.useState(!1),{data:h={},isLoading:m}=ah(),{data:y,isLoading:b}=Sy(),{data:v={},isLoading:S}=Ey(),{data:w,isLoading:k}=Fyn(n,{enabled:!!n}),_=t.get("traceId"),C=t.get("spanId"),T=t.get("tab"),A=t.get("scoreId"),{data:N=[],isLoading:j,isFetchingNextPage:R,hasNextPage:L,setEndOfListElement:F,error:M,isError:z}=qyn({filters:{...a?.type!=="all"&&{entityId:a?.value,entityType:a?.type},...o&&{startedAt:{start:o}},...u&&{endedAt:{end:u}}}});_&&_!==n&&(s(_),f(!0));const q=E.useMemo(()=>(Object.entries(h)||[]).map(([se,ce])=>({value:ce.id,label:ce.name,type:yD.AGENT})),[h]),Q=E.useMemo(()=>(Object.entries(y||{})||[]).map(([,se])=>({value:se.name,label:se.name,type:yD.WORKFLOW_RUN})),[y]),V=E.useMemo(()=>[{value:"all",label:"All",type:"all"},...q,...Q],[q,Q]),Z=t.get("entity"),$=V.find(se=>se.value===Z);$&&$.value!==a?.value&&i($);const X=()=>{s(void 0),r({entity:"all",traceId:""}),f(!1),l(void 0),d(void 0)},U=(se,ce)=>{if(ce==="from")return l(se);d(se)},I=se=>{se?.value&&r({entity:se.value})},H=se=>{if(se===n)return s(void 0);s(se),f(!0)},G=z?Tdn(M):void 0;if(M&&Mc(M))return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(uE,{})}),"Observability"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Observability documentation"]})})]}),c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"traces"})})]});const J=a?.value!=="all"||o||u,ee=afe({entries:N.map(se=>({id:se.traceId})),id:n,update:s}),te=ife({entries:N.map(se=>({id:se.traceId})),id:n,update:s});return c.jsxs(c.Fragment,{children:[c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(uE,{})}),"Observability"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Observability documentation"]})})]}),c.jsx("div",{className:K("grid overflow-y-auto h-full"),children:c.jsxs("div",{className:K("max-w-[100rem] px-12 mx-auto grid content-start gap-8 h-full"),children:[c.jsx(ZT,{title:"Observability",description:"Explore observability traces for your entities",icon:c.jsx(uE,{})}),c.jsx(Nln,{onEntityChange:I,onReset:X,selectedEntity:a,entityOptions:V,onDateChange:U,selectedDateFrom:o,selectedDateTo:u,isLoading:j||m||b}),j?c.jsx(Cft,{columns:V$}):c.jsx(Iln,{traces:N,selectedTraceId:n,onTraceClick:H,errorMsg:G?.error,setEndOfListElement:F,filtersApplied:!!J,isFetchingNextPage:R,hasNextPage:L})]})})]}),c.jsx(Dln,{traceSpans:w?.spans,traceId:n,initialSpanId:C||void 0,initialSpanTab:T==="scores"?"scores":"details",initialScoreId:A||void 0,traceDetails:N.find(se=>se.traceId===n),isOpen:p,onClose:()=>{e("/observability"),f(!1)},onNext:ee,onPrevious:te,isLoadingSpans:k,computeTraceLink:(se,ce)=>`/observability?traceId=${se}${ce?`&spanId=${ce}`:""}`,scorers:v,isLoadingScorers:S})]})}function Qyn(){const{Link:e,paths:t}=Yt(),{data:r,isLoading:n}=fht(),{isCmsAvailable:s}=pS(),a=r?.promptBlocks??[];return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(vF,{})}),"Prompts"]}),c.jsxs(Vs,{children:[s&&c.jsxs(ye,{variant:"light",as:e,to:t.cmsPromptBlockCreateLink(),children:[c.jsx(ve,{children:c.jsx(SF,{})}),"Create a prompt block"]}),c.jsxs(ye,{variant:"outline",as:Pt,to:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})]})]}),c.jsx(Si,{isCentered:!n&&a.length===0,children:c.jsx(Dan,{isLoading:n,promptBlocks:a})})]})}function Gyn(){return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(dKe,{})}),"Request Context"]})}),c.jsx(Si,{children:c.jsx(_nn,{children:c.jsx(Onn,{})})})]})}function Zyn(){const{Link:e}=Yt(),{data:t={},isLoading:r,error:n}=Ey(),{isCmsAvailable:s}=pS();return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(Bg,{})}),"Scorers"]}),c.jsxs(Vs,{children:[s&&c.jsxs(ye,{variant:"light",as:e,to:"/cms/scorers/create",children:[c.jsx(ve,{children:c.jsx(SF,{})}),"Create a scorer"]}),c.jsxs(ye,{variant:"outline",as:Pt,to:"https://mastra.ai/en/docs/evals/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Scorers documentation"]})]})]}),c.jsx(Si,{isCentered:!r&&Object.keys(t||{}).length===0,children:c.jsx(esn,{isLoading:r,scorers:t,error:n})})]})}function Wyn(){const{scorerId:e}=Ei(),[t,r]=sc(),[n,s]=E.useState(),[a,i]=E.useState(0),[o,l]=E.useState(!1),[u,d]=E.useState({value:"all",label:"All",type:"ALL"}),{scorer:p,isLoading:f,error:h}=Xnn(e),{data:m={},isLoading:y,error:b}=ah(),{data:v,isLoading:S,error:w}=Sy(),{data:k,isLoading:_,error:C}=Wnn({scorerId:e,page:a,entityId:u?.value==="all"?void 0:u?.value,entityType:u?.type==="ALL"?void 0:u?.type}),T=E.useMemo(()=>p?.agentIds?.filter(U=>m[U]).map(U=>({value:U,label:m[U].name,type:"AGENT"}))||[],[p?.agentIds,m]),A=E.useMemo(()=>p?.workflowIds?.map(U=>({value:U,label:U,type:"WORKFLOW"}))||[],[p?.workflowIds]),N=E.useMemo(()=>[{value:"all",label:"All",type:"ALL"},...T,...A],[T,A]),j=t.get("entity"),R=N.find(U=>U.value===j);if(R&&R.value!==u?.value&&d(R),E.useEffect(()=>{if(h){const U=h instanceof Error?h.message:"Failed to load scorer";We.error(`Error loading scorer: ${U}`)}},[h]),E.useEffect(()=>{if(b){const U=b instanceof Error?b.message:"Failed to load agents";We.error(`Error loading agents: ${U}`)}},[b]),E.useEffect(()=>{if(w){const U=w instanceof Error?w.message:"Failed to load workflows";We.error(`Error loading workflows: ${U}`)}},[w]),h&&Mc(h))return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/scorers",children:[c.jsx(ve,{children:c.jsx(Bg,{})}),"Scorers"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:e})]})}),c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"scorers"})})]});if(f||h||b||w)return null;const L=p?.agentIds?.map(U=>({name:U,id:Object.entries(m).find(([,I])=>I.name===U)?.[0]}))||[],F=p?.workflowIds?.map(U=>({name:U,id:Object.entries(v||{}).find(([,I])=>I.name===U)?.[0]}))||[],z=[{key:"entities",label:"Entities",value:([...L.map(U=>({id:U.id,name:U.name,type:"AGENT"})),...F.map(U=>({id:U.id,name:U.name,type:"WORKFLOW"}))]||[]).map(U=>({id:U.id,name:U.name||U.id,path:`${U.type==="AGENT"?"/agents":"/workflows"}/${U.name}`}))}],q=U=>{U?.value&&r({entity:U.value})},Q=k?.scores||[],V=k?.pagination,Z=U=>{s(U),l(!0)},$=afe({entries:Q,id:n,update:s}),X=ife({entries:Q,id:n,update:s});return c.jsxs(c.Fragment,{children:[c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/scorers",children:[c.jsx(ve,{children:c.jsx(Bg,{})}),"Scorers"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:c.jsx(Ynn,{value:e,variant:"ghost"})})]}),c.jsxs(Vs,{children:[p?.scorer?.source==="stored"&&c.jsxs(ye,{variant:"light",as:Pt,to:`/cms/scorers/${e}/edit`,children:[c.jsx(ve,{children:c.jsx(Ubr,{})}),"Edit"]}),c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/evals/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Scorers documentation"]})]})]}),c.jsx("div",{className:K("grid overflow-y-auto h-full"),children:c.jsxs("div",{className:K("max-w-[100rem] w-full px-12 mx-auto grid content-start gap-8 h-full"),children:[c.jsx(ZT,{title:p?.scorer?.config?.name||"loading",description:p?.scorer?.config?.description||"loading",icon:c.jsx(Bg,{})}),c.jsx(gS,{data:z,LinkComponent:Pt,isLoading:y||S}),c.jsx(Znn,{selectedEntity:u,entityOptions:N,onEntityChange:q,onReset:()=>r({entity:"all"}),isLoading:_||y||S}),_?c.jsx("div",{className:"h-full w-full flex items-center justify-center",children:c.jsx(Cn,{})}):c.jsx(Pnn,{scores:Q,selectedScoreId:n,pagination:{total:V?.total||0,hasMore:V?.hasMore||!1,perPage:V?.perPage||0,page:V?.page||0},onScoreClick:Z,onPageChange:i,errorMsg:C?.message})]})})]}),c.jsx(Aft,{scorerName:p?.scorer?.config?.name,score:Xyn(Q.find(U=>U.id===n)),isOpen:o,onClose:()=>l(!1),onNext:$,onPrevious:X,computeTraceLink:(U,I)=>`/observability?traceId=${U}${I?`&spanId=${I}`:""}`})]})}const Xyn=e=>{if(e)return{...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt)}},Yyn=()=>{const{baseUrl:e,headers:t}=sfe();return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(Lpe,{})}),"Settings"]})}),c.jsx(Si,{children:c.jsx("div",{className:"p-5",children:c.jsx("div",{className:"max-w-2xl p-5 w-full bg-surface3 border border-border1 rounded-lg",children:c.jsx(xft,{initialConfig:{baseUrl:e,headers:t}})})})})]})};function Kyn(){const[e]=sc(),t=Hp(),r=e.get("redirect")||"/",n=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return c.jsx(Fft,{redirectUri:r,onSuccess:n,initialMode:"signup"})}async function wyt(){const e=await fetch("https://mastra.ai/api/templates.json");if(!e.ok)throw new Error(`Failed to fetch templates: ${e.statusText}`);const t=await e.json(),r=[{title:"Weather Agent",slug:"weather-agent",githubUrl:"https://github.com/mastra-ai/weather-agent",description:"Get weather information of any city.",longDescription:"One Agent, one Workflow and one Tool to bring you the weather in your city.",imageURL:"",tags:["Agent","Workflow","Tool"],useCase:"",supportedProviders:["openai","anthropic","google","groq"],agents:["weatherAgent"],tools:["weatherTool"],workflows:["weatherWorkflow"]},...t],n=Array.from(new Set(r.flatMap(a=>a.tags))),s=Array.from(new Set(r.flatMap(a=>a.supportedProviders)));return{templates:r,tags:n,providers:s}}async function Jyn({repo:e,owner:t}){const r=await fetch(`https://api.github.com/repos/${t}/${e}`);if(!r.ok)throw new Error(`Failed to fetch template: ${r.statusText}`);const n=await r.json();if(!n.is_template)throw new Error("Repo is not a template, please update the repo settings to make it a template");return{title:n.name,slug:n.name,description:n.description??"",imageURL:"",tags:[],useCase:"",longDescription:n.description??"",githubUrl:n.html_url,supportedProviders:[]}}async function ebn({repoOrSlug:e,owner:t}){const{templates:r}=await wyt(),n=r.find(s=>s.slug===e);if(!n){if(e.startsWith("template-")){const a=r.find(i=>`template-${i.slug}`===e);if(a)return a}const s=await Jyn({repo:e,owner:t});if(s)return s;throw new Error(`Template ${e} not found`)}return n}async function tbn({repo:e,owner:t,branch:r}){const n=`https://raw.githubusercontent.com/${t}/${e}/${r}/.env.example`,s=await fetch(n);return s.ok?(await s.text()).split(`
|
|
615
|
-
`).reduce((o,l)=>{if(!l||l.startsWith("#"))return o;const[u,d]=l.split("=");return u&&(o[u]=d?.split("")?.every(p=>p==="*")?"":d?.replaceAll('"',"")),o},{}):{}}const rbn=()=>ur({queryKey:["mastra-templates"],queryFn:wyt}),nbn=({repoOrSlug:e,owner:t})=>ur({queryKey:["template-repo",e,t],queryFn:()=>ebn({repoOrSlug:e,owner:t})}),sbn=({repo:e,owner:t,branch:r})=>ur({queryKey:["template-repo-env-vars",e,t,r],queryFn:()=>tbn({repo:e,owner:t,branch:r})}),abn=()=>{const e=st();return ur({queryKey:["agent-builder-workflow"],queryFn:async()=>await e.getAgentBuilderAction("merge-template").details()})},ibn=()=>{const e=st();return Kr({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").createRun({runId:t})})},obn=()=>{const e=st();return Kr({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").runById(t)})},pMe=(e,t,r)=>{let n={...t};if(!(n.payload?.workflowState?.steps&&Object.keys(n.payload.workflowState.steps).length>0)&&r?.allSteps&&(n.payload={...n.payload,workflowState:{...n.payload?.workflowState,steps:Object.keys(r.allSteps).reduce((a,i)=>(a[i]={id:i,description:r.allSteps[i].description,status:"pending"},a),{})}}),e.type==="start"||e.type==="workflow-start"){const a={};r?.allSteps&&Object.entries(r.allSteps).forEach(([o,l])=>{a[o]={id:l.id,description:l.description,status:"pending"}});const i=e.runId||e.payload?.runId;n={...n,runId:i,eventTimestamp:new Date().toISOString(),status:"running",phase:"initializing",payload:{workflowState:{status:"running",steps:a},currentStep:null}}}if(e.type==="step-start"||e.type==="workflow-step-start"){const a=e.payload.id;n={...n,phase:"processing",payload:{...n.payload,currentStep:{id:a,status:"running",startTime:new Date,...e.payload},workflowState:{...n.payload.workflowState,steps:{...n.payload.workflowState.steps,[a]:{...n.payload.workflowState.steps[a],status:"running",startTime:new Date,...e.payload}}}}}}if(e.type==="step-result"||e.type==="workflow-step-result"){const a=e.payload.id,i=e.payload.status,o=e.payload.error;n={...n,payload:{...n.payload,currentStep:{...n.payload.currentStep,status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date},workflowState:{...n.payload.workflowState,steps:{...n.payload.workflowState.steps,[a]:{...n.payload.workflowState.steps[a],status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date}}}}},i==="failed"&&o&&(n={...n,status:"failed",error:o,phase:"error",failedStep:{id:a,error:o,description:e.payload.description||a},payload:{...n.payload,workflowState:{...n.payload.workflowState,status:"failed"}},errorTimestamp:new Date})}return(e.type==="step-finish"||e.type==="workflow-step-finish")&&(n={...n,payload:{...n.payload,currentStep:null}}),(e.type==="finish"||e.type==="workflow-finish")&&(n.phase==="error"||n.status==="failed"?n={...n,completedAt:new Date}:n={...n,status:e.payload.status||"completed",phase:"completed",payload:{...n.payload,currentStep:null,workflowState:{...n.payload.workflowState,status:e.payload.status||"completed"}},completedAt:new Date}),e.type==="error"&&(n={...n,status:"failed",error:e.payload.error,phase:"error",payload:{...n.payload,workflowState:{...n.payload.workflowState,status:"failed"}},errorTimestamp:new Date}),{newState:n}},lbn=(e,t)=>{try{localStorage.setItem(`template-install-${e}`,JSON.stringify({state:t,timestamp:Date.now()}))}catch(r){console.warn("Failed to save template state to localStorage:",r)}},Eyt=(e,t)=>{const[r,n]=E.useState({}),[s,a]=E.useState(!1);return{streamResult:r,isStreaming:s,processStream:async(o,l)=>{if(a(!0),n({}),!o)throw new Error("No stream returned");const u=o.getReader();let d={runId:l||t,eventTimestamp:new Date().toISOString(),phase:"running",payload:{workflowState:{steps:{}},currentStep:null}};try{for(;;){const{done:p,value:f}=await u.read();if(p)break;const{newState:h}=pMe(f,d,e);if(d=h,n(h),f.runId||l||t){const m=f.runId||l||t;lbn(m,h)}}}catch(p){console.error("💥 [processStream] Error processing template installation stream:",p);const{newState:f}=pMe({type:"error",payload:{error:p instanceof Error?p.message:"Unknown error"}},d,e);n(f)}finally{a(!1),u.releaseLock()}}}},cbn=e=>{const t=st(),{streamResult:r,isStreaming:n,processStream:s}=Eyt(e);return{streamInstall:Kr({mutationFn:async({inputData:i,selectedModel:o,runId:l})=>{for(let d=1;d<=3;d++)try{const p=t.getAgentBuilderAction("merge-template"),f=new hp;f.set("selectedModel",o);const h=await p.stream({inputData:i,requestContext:f},l);await s(h,l);return}catch(p){console.error(`💥 [streamInstall] Attempt ${d} failed:`,p);const f=p?.message?.includes("Failed to fetch")||p?.message?.includes("NetworkError")||p?.message?.includes("network error")||p?.message?.includes("fetch")||p?.code==="NETWORK_ERROR"||p?.name==="TypeError";if(console.warn(`Stream attempt ${d}/3 failed:`,p),f){const h=l?`Network error during template installation (likely hot reload). Please refresh the page to resume from where you left off using runId: ${l}`:"Network error during template installation (likely hot reload). Please try again.";throw console.error("🔌 Stream network error:",h),new Error(h)}throw console.error("❌ [streamInstall] Non-network error or max retries reached, throwing:",p),p}}}),streamResult:r,isStreaming:n}},ubn=e=>{const t=st(),{streamResult:r,isStreaming:n,processStream:s}=Eyt(e);return{observeInstall:Kr({mutationFn:async({runId:i})=>{for(let u=1;u<=3;u++)try{const p=await t.getAgentBuilderAction("merge-template").observeStream({runId:i});await s(p,i);return}catch(d){console.error(`💥 [observeInstall] Attempt ${u} failed:`,d);const p=d?.message?.includes("Failed to fetch")||d?.message?.includes("NetworkError")||d?.message?.includes("network error")||d?.message?.includes("fetch")||d?.code==="NETWORK_ERROR"||d?.name==="TypeError";if(console.warn(`ObserveStream attempt ${u}/3 failed:`,d),p&&u<3){console.info(`🔄 ObserveStream network error detected (likely hot reload), retrying in 2000ms... (attempt ${u+1}/3)`),await new Promise(f=>setTimeout(f,2e3));continue}throw console.error("❌ [observeInstall] Non-network error or max retries reached, throwing:",d),d}}}),streamResult:r,isStreaming:n}};function dbn(){const{data:e,isLoading:t}=rbn(),{templates:r,tags:n,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=E.useState("all"),[o,l]=E.useState("all"),[u,d]=E.useState(""),p=[{value:"all",label:"All"}];(n||[]).forEach(S=>{p.push({value:S,label:S})});const f=[{value:"all",label:"All"}];(s||[]).forEach(S=>{f.push({value:S,label:S})});const h=(S,w)=>{w==="tag"?i(S):w==="provider"&&l(S)},m=S=>{d(S)},y=()=>{i("all"),l("all"),d("")},b=r.filter(S=>!(u&&!S.title.toLowerCase().includes(u)&&!S.description.toLowerCase().includes(u)||a!=="all"&&!S.tags.includes(a)||o!=="all"&&!S.supportedProviders.includes(o))),v=u||a!=="all"||o!=="all";return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(sce,{})}),"Templates"]})}),c.jsxs("div",{className:K("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[c.jsx(tln,{selectedTag:a,onTagChange:S=>h(S,"tag"),tagOptions:p,selectedProvider:o,onProviderChange:S=>h(S,"provider"),providerOptions:f,searchTerm:u,onSearchChange:m,onReset:v?y:void 0,className:"max-w-[80rem]",isLoading:t}),c.jsx(nln,{templates:b,linkComponent:Pt,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const pbn="1.9.0-alpha.0";function fbn(){const{templateSlug:e}=Ei(),[t,r]=sc(),[n,s]=E.useState(""),[a,i]=E.useState(""),[o,l]=E.useState(""),[u,d]=E.useState({}),[p,f]=E.useState([]),[h,m]=E.useState(null),[y,b]=E.useState(!1),[v,S]=E.useState(""),[w,k]=E.useState(!1),[_,C]=E.useState(!1),[T,A]=E.useState([]),{data:N,isLoading:j}=nbn({repoOrSlug:e,owner:"mastra-ai"}),L=pbn?.includes("beta")??!1?"beta":"main",{data:F,isLoading:M}=sbn({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:L}),{data:z,isLoading:q}=abn(),{mutateAsync:Q,isPending:V}=ibn(),{mutateAsync:Z}=obn(),{streamInstall:$,streamResult:X,isStreaming:U}=cbn(z),{observeInstall:I,streamResult:H,isStreaming:G}=ubn(z);E.useEffect(()=>{const ne=t.get("runId");ne&&!y&&!h&&!U&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:ne}),S(ne),Z({runId:ne}).then(ae=>{const ge=ae.snapshot;if(ge?.status==="success"&&ge?.result?.success)b(!0);else if(ge?.result?.success===!1)if(ge?.result?.validationResults&&!ge?.result?.validationResults?.valid&&ge?.result?.validationResults?.remainingErrors>0){const{remainingErrors:xe,errors:Ie}=ge.result.validationResults,Ce=`Template installation completed but ${xe} validation issue${xe>1?"s":""} remain unresolved.`;m(Ce),A(Ie||[])}else m(ge?.result?.message||ge?.result?.error||"Template installation failed")}).catch(ae=>{console.error("❌ Failed to fetch run details:",ae),m("Failed to retrieve installation status after reload")}))},[t,y,h,U,G,Z]),E.useEffect(()=>{const ne=t.get("runId"),ae=t.get("resume"),ge=t.get("provider");if(ne&&ae==="true"&&ge&&!U&&!G&&!w&&!_&&z){S(ne),k(!0);try{Z({runId:ne}).then(le=>{if(le.snapshot?.status==="running")return I.mutateAsync({runId:ne})}).then(()=>{r(le=>{const xe=new URLSearchParams(le);return xe.delete("resume"),xe})}).catch(le=>{console.error("❌ Failed to resume template installation:",le),le.message?.includes("404")||le.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(le){console.error("❌ Auto-resume failed with error:",le),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,U,G,w,_,z,Z,I,r]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ee=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(ne=>ne).join(", "):"n/a",icon:c.jsx(tl,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(ne=>ne).join(", "):"n/a",icon:c.jsx($i,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(ne=>ne).join(", "):"n/a",icon:c.jsx(avr,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:c.jsx(cbr,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:c.jsx(Jbr,{})}],te=[{...ee[0]},{...ee[1]},{...ee[2]}].filter(ne=>ne.value!=="n/a");E.useEffect(()=>{F&&d(F)},[F]),E.useEffect(()=>{const ne=X||H;ne?.phase==="error"&&ne?.error&&m(ne.error)},[X?.phase,X?.error,H?.phase,H?.error]);const se=ne=>{s(ne)},ce=async ne=>(i(ne.provider),l(ne.modelId),{message:"Model updated successfully"}),Se=async()=>{const ne=Object.entries(u).reduce((ae,[ge,le])=>(le===""&&ae.push(ge),ae),[]);if(ne.length>0){f(ne);return}if(N){m(null),b(!1),S(""),C(!0);try{const ge={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:L,slug:N.slug,variables:u},{runId:le}=await Q({});S(le),r(xe=>{const Ie=new URLSearchParams(xe);return Ie.set("runId",le),Ie.set("resume","true"),Ie.set("provider",n||"openai"),Ie}),await $.mutateAsync({inputData:ge,selectedModel:{provider:a,modelId:o},runId:le})}catch(ae){C(!1),m(ae?.message||"Template installation failed"),console.error("Template installation failed",ae)}}},W=ne=>{const{name:ae,value:ge}=ne.target;ge.trim()===""?f(le=>[...le,ae]):f(le=>le.filter(xe=>xe!==ae)),d(le=>({...le,[ae]:ge}))};return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/templates",children:[c.jsx(ve,{children:c.jsx(sce,{})}),"Templates"]}),c.jsx(Or,{as:Pt,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),c.jsx("div",{className:K("w-full lg:px-12 h-full overflow-y-scroll"),children:c.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[c.jsx(sln,{isLoading:j,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ee,templateSlug:e}),N&&c.jsxs(c.Fragment,{children:[(U||G)&&c.jsx(uln,{name:N.title,streamResult:G?H:X,runId:v,workflowInfo:z}),y&&c.jsx(dln,{name:N.title,installedEntities:te,linkComponent:Pt}),h&&c.jsx(pln,{errorMsg:h,validationErrors:T.length>0?T:X?.validationResults?.errors||H?.validationResults?.errors}),!U&&!G&&!y&&!h&&c.jsx(aln,{providerOptions:J,selectedProvider:n,onProviderChange:se,variables:u,setVariables:d,errors:p,setErrors:f,handleInstallTemplate:Se,handleVariableChange:W,isLoadingEnvVars:M||q,isInstalling:V,defaultModelProvider:a,defaultModelId:o,onModelUpdate:ce})]})]})})]})}const hbn=()=>{const{toolId:e,agentId:t}=Ei();return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/agents",children:[c.jsx(ve,{children:c.jsx($i,{})}),"Agents"]}),c.jsx(Or,{as:Pt,to:`/agents/${t}/chat`,children:t}),c.jsx(Or,{as:Pt,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Tools documentation"]})})]}),c.jsx(Qsn,{toolId:e,agentId:t})]})},mbn=()=>{const{toolId:e}=Ei();return c.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/tools",children:[c.jsx(ve,{children:c.jsx(tl,{})}),"Tools"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:c.jsx(eln,{value:e,variant:"ghost"})})]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Tools documentation"]})})]}),c.jsx(Jon,{toolId:e})]})};function gbn(){const{data:e,isLoading:t,error:r}=Sy(),n=!t&&Object.keys(e||{}).length===0;return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(Yl,{})}),"Workflows"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Workflows documentation"]})})]}),c.jsx(Si,{isCentered:n,children:c.jsx(Men,{workflows:e||{},isLoading:t,error:r})})]})}const fMe=()=>{const{workflowId:e}=Ei(),{data:t,isLoading:r,error:n}=oj(e);return n&&Mc(n)?c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"workflows"})}):c.jsx(Lpt,{workflowId:e,workflow:t??void 0,isLoading:r})};function hMe(){const{workspaceId:e}=Ei(),[t,r]=sc(),n=Hp(),[s,a]=E.useState(!1),[i,o]=E.useState(!1),[l,u]=E.useState(!1),[d,p]=E.useState(null),[f,h]=E.useState(null),[m,y]=E.useState(!1),b=t.get("file"),v=t.get("tab"),{data:S,error:w,isLoading:k}=Rht(),_=S?.workspaces??[],C=e??_[0]?.id,{data:T,isLoading:A,error:N}=Hin(C),j=Mc(w)||Mc(N),R=T?.filesystem?.metadata,L=R?.contained===!1&&typeof R?.basePath=="string"?R.basePath:"/",F=t.get("path")||L,M=fre(w)||fre(N),z=C?_.find(je=>je.id===C):void 0,q=je=>{const St=new URLSearchParams(t);for(const[sr,En]of Object.entries(je))En===null?St.delete(sr):St.set(sr,En);r(St)},Q=je=>{y(!1),a(!1),n(`/workspaces/${je}`)},V=je=>{q({path:je,file:null})},Z=je=>{q({file:je})},$=je=>{q({tab:je})},X=F,U=b,{data:I,isLoading:H,error:G,refetch:J}=Qin(X,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:C}),ee=Zin(),te=Win(),{data:se,isLoading:ce}=Pht(U??"",{enabled:!!U,workspaceId:C}),{data:Se,isLoading:W,refetch:ne}=Yin({workspaceId:C}),ae=son(),ge=aon(),le=ion(),xe=T?.isWorkspaceConfigured??!1,Ie=T?.capabilities?.hasFilesystem??!1,Ce=T?.capabilities?.hasSkills??!1,oe=T?.capabilities?.canBM25??!1,de=T?.capabilities?.canVector??!1,fe=z?.safety?.readOnly??!1,Ne=Ie&&!fe,Te=T?.mounts,we=Te?.filter(je=>!je.readOnly).map(je=>({path:je.path,displayName:je.displayName,icon:je.icon,provider:je.provider,name:je.name})),ue=Te&&Te.length>1?Te.map(je=>je.path):void 0,De=E.useCallback(je=>{C&&ae.mutate({...je,workspaceId:C},{onSuccess:async St=>{if(St.success){u(!1);const{data:sr,error:En}=await ne();if(En||!sr){We.success(`Skill "${St.skillName}" installed successfully (${St.filesWritten} files)`);return}sr.skills.some(Sn=>Sn.name===St.skillName)?We.success(`Skill "${St.skillName}" installed successfully (${St.filesWritten} files)`):(y(!0),We.warning(`Skill "${St.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else We.error("Failed to install skill")},onError:St=>{We.error(`Failed to install skill: ${St instanceof Error?St.message:"Unknown error"}`)}})},[C,ae,ne]),Le=E.useCallback(je=>{C&&(h(je),ge.mutate({workspaceId:C,skillName:je},{onSuccess:St=>{if(h(null),St.updated.length>0){const sr=St.updated[0];sr.success?(We.success(`Skill "${je}" updated successfully (${sr.filesWritten} files)`),ne()):We.error(`Failed to update skill: ${sr.error??"Unknown error"}`)}else We.error("Failed to update skill: No update result returned")},onError:St=>{h(null),We.error(`Failed to update skill: ${St instanceof Error?St.message:"Unknown error"}`)}}))},[C,ge,ne]),rt=E.useCallback(je=>{C&&(p(je),le.mutate({workspaceId:C,skillName:je},{onSuccess:St=>{p(null),St.success?(We.success(`Skill "${St.skillName}" removed successfully`),ne()):We.error(`Failed to remove skill "${St.skillName}"`)},onError:St=>{p(null),We.error(`Failed to remove skill: ${St instanceof Error?St.message:"Unknown error"}`)}}))},[C,le,ne]),$t=v==="files"&&Ie?"files":v==="skills"&&Ce?"skills":Ie?"files":Ce?"skills":"files",ut=Se?.skills??[],or=Se?.isSkillsConfigured??!1,Br=I?.entries??[],Et=Ie&&(oe||de),Dt=Ce&&or&&ut.length>0,xt=Et||Dt;return j?c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})})]}),c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"workspaces"})})]}):M?c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})})]}),c.jsx("div",{className:"grid overflow-y-auto h-full",children:c.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[c.jsx(ZT,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:c.jsx(wh,{})}),c.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[c.jsx("div",{className:"flex items-center justify-center w-16 h-16 rounded-full bg-amber-500/10 mb-6",children:c.jsx(Iee,{className:"h-8 w-8 text-amber-500"})}),c.jsx("h2",{className:"text-xl font-semibold text-neutral6 mb-2",children:"Workspace Not Supported"}),c.jsxs("p",{className:"text-neutral4 max-w-md mb-6",children:["The workspace feature requires a newer version of ",c.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),". Please upgrade your dependencies to enable workspace functionality."]}),c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Learn More"]})]})]})})]}):k?c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})})]}),c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx(Cn,{})})]}):!A&&!k&&!xe?c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})})]}),c.jsx("div",{className:"grid overflow-y-auto h-full",children:c.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[c.jsx(ZT,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:c.jsx(wh,{})}),c.jsx(Wdn,{})]})})]}):c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsxs(Vs,{children:[xt&&c.jsxs(ye,{variant:"light",onClick:()=>a(!s),children:[c.jsx(ve,{children:c.jsx(Xbr,{className:"h-4 w-4"})}),"Search"]}),c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})]})]}),c.jsx("div",{className:"grid overflow-y-auto h-full",children:c.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start gap-6 h-full w-full",children:[c.jsx(ZT,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:c.jsx(wh,{})}),_.length>1&&c.jsxs("div",{className:"relative",children:[c.jsxs("button",{onClick:()=>o(!i),className:"flex items-center gap-2 px-3 py-2 text-sm border border-border1 rounded-lg bg-surface2 hover:bg-surface3 transition-colors w-full max-w-md",children:[z?.source==="agent"?c.jsx(y$,{className:"h-4 w-4 text-accent1"}):c.jsx(JG,{className:"h-4 w-4 text-neutral4"}),c.jsxs("span",{className:"flex-1 text-left truncate",children:[z?.name??"Select workspace",z?.source==="agent"&&z.agentName&&c.jsxs("span",{className:"text-neutral4 ml-1",children:["(",z.agentName,")"]})]}),c.jsx(hbr,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&c.jsx("div",{className:"absolute z-50 mt-1 w-full max-w-md bg-surface2 border border-border1 rounded-lg shadow-lg overflow-hidden",children:_.map(je=>c.jsxs("button",{onClick:()=>{Q(je.id),o(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${z?.id===je.id?"bg-surface3":""}`,children:[je.source==="agent"?c.jsx(y$,{className:"h-4 w-4 text-accent1 flex-shrink-0"}):c.jsx(JG,{className:"h-4 w-4 text-neutral4 flex-shrink-0"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:je.name}),c.jsx("div",{className:"text-xs text-neutral4 truncate",children:je.source==="agent"?`Agent: ${je.agentName}`:"Global workspace"})]}),c.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[je.safety?.readOnly&&c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"}),je.capabilities.hasFilesystem&&c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),je.capabilities.hasSandbox&&c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),je.capabilities.hasSkills&&c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},je.id))})]}),_.length===1&&z&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[z.source==="agent"?c.jsx(y$,{className:"h-4 w-4 text-accent1"}):c.jsx(JG,{className:"h-4 w-4"}),c.jsx("span",{children:z.name}),z.source==="agent"&&z.agentName&&c.jsxs("span",{className:"text-neutral3",children:["(",z.agentName,")"]}),fe&&c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),s&&xt&&C&&c.jsx(ybn,{workspaceId:C,canSearchFiles:Et,canSearchSkills:Dt,canBM25:oe,canVector:de,showInitWarning:!A&&T?.status!=="ready",onViewFileResult:je=>{q({file:je,tab:"files"})},onViewSkillResult:je=>{C&&n(`/workspaces/${C}/skills/${encodeURIComponent(je)}`)}},C),c.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[Ie&&c.jsxs("button",{onClick:()=>$("files"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${$t==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[c.jsx(vF,{className:"h-4 w-4"}),"Files"]}),Ce&&c.jsxs("button",{onClick:()=>$("skills"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${$t==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[c.jsx(CM,{className:"h-4 w-4"}),"Skills",or&&ut.length>0&&c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:ut.length})]})]}),c.jsxs("div",{className:"pb-8",children:[$t==="files"&&Ie&&c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[c.jsx(Hdn,{entries:Br,currentPath:X,isLoading:H,error:G,onNavigate:V,onFileSelect:Z,onRefresh:()=>J(),onCreateDirectory:fe?void 0:je=>te.mutate({path:je,workspaceId:C}),onDelete:fe?void 0:je=>ee.mutate({path:je,recursive:!0,force:!0,workspaceId:C})}),U&&c.jsx(Zdn,{path:U,content:se?.content??"",isLoading:ce,mimeType:se?.mimeType,onClose:()=>Z(null)})]})}),$t==="skills"&&Ce&&c.jsx(spn,{skills:ut,isLoading:W,isSkillsConfigured:or,hasUndiscoveredAgentSkills:m,basePath:C?`/workspaces/${C}/skills`:"/workspaces",onAddSkill:Ne?()=>u(!0):void 0,onUpdateSkill:Ne?Le:void 0,onRemoveSkill:Ne?rt:void 0,updatingSkillName:f??void 0,removingSkillName:d??void 0,mountPaths:ue}),!Ie&&!Ce&&c.jsx("div",{className:"py-12 text-center text-neutral4",children:c.jsx("p",{children:"No workspace capabilities are configured."})})]})]})}),C&&Ne&&c.jsx(upn,{open:l,onOpenChange:u,workspaceId:C,onInstall:De,isInstalling:ae.isPending,installedSkillIds:ut.filter(je=>je.skillsShSource).map(je=>`${je.skillsShSource.owner}/${je.skillsShSource.repo}/${je.name}`),installedSkillNames:ut.filter(je=>!je.skillsShSource).map(je=>je.name),writableMounts:we,installedSkillPaths:Object.fromEntries(ut.filter(je=>je.path).map(je=>[je.name,je.path]))})]})}function ybn({workspaceId:e,canSearchFiles:t,canSearchSkills:r,canBM25:n,canVector:s,showInitWarning:a,onViewFileResult:i,onViewSkillResult:o}){const l=Xin(),u=eon();return c.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[t&&c.jsxs("div",{children:[c.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[c.jsx(vF,{className:"h-4 w-4"}),"Search Indexed Files"]}),a&&c.jsxs("p",{className:"text-xs text-amber-400 mb-3",children:["File search requires ",c.jsx("code",{className:"text-amber-300",children:"workspace.init()"})," to index files from your configured ",c.jsx("code",{className:"text-amber-300",children:"autoIndexPaths"}),"."]}),c.jsx(Xdn,{onSearch:d=>l.mutate({...d,workspaceId:e}),isSearching:l.isPending,searchResults:l.data?{...l.data,results:l.data.results.filter(d=>!d.id.startsWith("skill:"))}:void 0,canBM25:n,canVector:s,onViewResult:i})]}),r&&c.jsxs("div",{children:[c.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[c.jsx(CM,{className:"h-4 w-4"}),"Search Skills"]}),c.jsx(Kdn,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>o(d.skillName)})]})]})}function bbn(){const{skillName:e,workspaceId:t}=Ei(),[r]=sc(),n=e?decodeURIComponent(e):"",s=r.get("agentId"),a=s?decodeURIComponent(s):null,i=a?`/agents/${a}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[o,l]=E.useState(null),{data:u,isLoading:d,error:p}=Kin(n,{workspaceId:t}),{data:f}=Pht(u?.path?`${u.path}/SKILL.md`:"",{enabled:!!u?.path,workspaceId:t}),{data:h,isLoading:m}=Jin(n,o??"",{enabled:!!o,workspaceId:t}),y=b=>a?c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:i,children:[c.jsx(ve,{children:c.jsx(y$,{className:"h-4 w-4"})}),a]}),c.jsxs(Or,{as:"span",to:"",isCurrent:!0,children:[c.jsx(ve,{children:c.jsx(CM,{className:"h-4 w-4"})}),b]})]}):c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:i,children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsxs(Or,{as:Pt,to:i,children:[c.jsx(ve,{children:c.jsx(CM,{className:"h-4 w-4"})}),"Skills"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:b})]});return d?c.jsxs(Hr,{children:[c.jsx(Fr,{children:y("Loading...")}),c.jsx("div",{className:"grid place-items-center h-full",children:c.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):p&&Mc(p)?c.jsxs(Hr,{children:[c.jsx(Fr,{children:y("Permission Denied")}),c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"workspaces"})})]}):p||!u?c.jsxs(Hr,{children:[c.jsx(Fr,{children:y("Error")}),c.jsx("div",{className:"grid place-items-center h-full",children:c.jsxs("div",{className:"text-center",children:[c.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),c.jsx("p",{className:"text-sm text-neutral3",children:p?.message??"Skill not found"})]})})]}):c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[y(n),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})})]}),c.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:c.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:c.jsx(lpn,{skill:u,rawSkillMd:f?.content,onReferenceClick:l})})}),c.jsx(cpn,{open:!!o,onOpenChange:b=>!b&&l(null),skillName:n,referencePath:o??"",content:h?.content,isLoading:m})]})}const vbn=[{key:"main",links:[{name:"Agents",url:"/agents",icon:c.jsx($i,{}),isOnMastraPlatform:!0},{name:"Prompts",url:"/prompts",icon:c.jsx(vF,{}),isOnMastraPlatform:!0},{name:"Workflows",url:"/workflows",icon:c.jsx(Yl,{}),isOnMastraPlatform:!0},{name:"Processors",url:"/processors",icon:c.jsx(vbr,{}),isOnMastraPlatform:!1},{name:"MCP Servers",url:"/mcps",icon:c.jsx(Gf,{}),isOnMastraPlatform:!0},{name:"Tools",url:"/tools",icon:c.jsx(tl,{}),isOnMastraPlatform:!0},{name:"Scorers",url:"/scorers",icon:c.jsx(Bg,{}),isOnMastraPlatform:!0},{name:"Workspaces",url:"/workspaces",icon:c.jsx(wh,{})},{name:"Request Context",url:"/request-context",icon:c.jsx(dKe,{}),isOnMastraPlatform:!0}]},{key:"observability",separator:!0,links:[{name:"Observability",url:"/observability",icon:c.jsx(uE,{}),isOnMastraPlatform:!0},{name:"Datasets",url:"/datasets",icon:c.jsx(wu,{}),isOnMastraPlatform:!1}]},{key:"Templates",separator:!0,links:[{name:"Templates",url:"/templates",icon:c.jsx(sce,{}),isOnMastraPlatform:!1}]},{key:"Settings",separator:!0,links:[{name:"Settings",url:"/settings",icon:c.jsx(Lpe,{}),isOnMastraPlatform:!1}]}],xbn={links:[{name:"Mastra APIs",url:"/swagger-ui",icon:c.jsx(kbr,{}),isOnMastraPlatform:!1},{name:"Documentation",url:"https://mastra.ai/en/docs",icon:c.jsx(_T,{}),isOnMastraPlatform:!0},{name:"Github",url:"https://github.com/mastra-ai/mastra",icon:c.jsx(Mpe,{}),isOnMastraPlatform:!0},{name:"Community",url:"https://discord.gg/BTYqqHKUrf",icon:c.jsx(Mbr,{}),isOnMastraPlatform:!0}]};function Sbn(){const{state:e}=_mt(),r=qp().pathname,n=window?.MASTRA_HIDE_CLOUD_CTA==="true",{isMastraPlatform:s}=Rmt(),{data:a}=uj(),{isCmsAvailable:i,isLoading:o}=pS(),l=a&&G6(a),u=new Set(["/prompts"]),d=p=>u.has(p.url)&&!i&&!o?!1:s?p.isOnMastraPlatform:!0;return c.jsxs(hc,{children:[c.jsx("div",{className:"pt-3 mb-4 -ml-0.5 sticky top-0 bg-surface1 z-10",children:e==="collapsed"?c.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[c.jsx(j0,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),l&&c.jsx(e$e,{})]}):l?c.jsxs("span",{className:"flex items-center justify-between pl-3 pr-2",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(j0,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),c.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),c.jsx(e$e,{})]}):c.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[c.jsx(j0,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),c.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),c.jsx(hc.Nav,{children:vbn.map(p=>{const f=p.links.filter(d),h=f.length>0&&p?.separator;return c.jsxs(hc.NavSection,{children:[p?.title?c.jsx(hc.NavHeader,{state:e,children:p.title}):c.jsx(c.Fragment,{children:h&&c.jsx(hc.NavSeparator,{})}),c.jsx(hc.NavList,{children:f.map(m=>{const y=r.startsWith(m.url);return c.jsx(hc.NavLink,{state:e,link:m,isActive:y},m.name)})})]},p.key)})}),c.jsxs(hc.Bottom,{children:[c.jsx(hc.Nav,{children:c.jsxs(hc.NavSection,{children:[c.jsx(hc.NavSeparator,{}),c.jsxs(hc.NavList,{children:[xbn.links.filter(d).map(p=>c.jsx(hc.NavLink,{link:p,state:e},p.name)),!n&&!s?c.jsx(hc.NavLink,{link:{name:"Share",url:"https://mastra.ai/cloud",icon:c.jsx(gbr,{}),variant:"featured",tooltipMsg:"You're running Mastra Studio locally. Want your team to collaborate?",isOnMastraPlatform:!1},state:e}):null]})]})}),e!=="collapsed"&&c.jsxs(c.Fragment,{children:[c.jsx(hc.NavSeparator,{}),c.jsx(bnn,{collapsed:!1})]})]})]})}const wbn=E.createContext({theme:"system",setTheme:()=>null});function Ebn({children:e,defaultTheme:t="system"}){const[r,n]=E.useState(t);return E.useEffect(()=>{const s=window.document.documentElement;if(s.classList.remove("light","dark"),r==="system"){const a=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";s.classList.add(a);return}s.classList.add(r)},[r]),c.jsx(wbn.Provider,{value:{theme:r,setTheme:n},children:e})}const kbn=({children:e})=>c.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[c.jsx(fKt,{position:"bottom-right"}),c.jsx(Ebn,{defaultTheme:"dark",attribute:"class",children:c.jsx(nc,{delayDuration:0,children:c.jsxs(ydn,{children:[c.jsx(ppn,{}),c.jsxs("div",{className:"grid grid-cols-[auto_1fr] h-full",children:[c.jsx(Sbn,{}),c.jsx("div",{className:"bg-surface2 my-3 mr-3 rounded-lg border border-border1 overflow-y-auto",children:c.jsx(Dsn,{children:e})})]})]})})})]});function Obn({agentId:e}){const{isCmsAvailable:t}=pS();return c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/agents",children:[c.jsx(ve,{children:c.jsx($i,{})}),"Agents"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:c.jsx(Bsn,{value:e,variant:"ghost",showSourceIcon:t})})]}),c.jsx(vmt,{children:c.jsxs(ye,{as:Pt,to:`/observability?entity=${e}`,children:[c.jsx(ve,{children:c.jsx(uE,{})}),"Traces"]})}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Agents documentation"]})})]})}const _bn=({children:e})=>{const{agentId:t}=Ei();return c.jsxs(Hr,{children:[c.jsx(Obn,{agentId:t}),e]})};function Cbn(){const{data:e={},isLoading:t,error:r}=dfe(),n=!t&&Object.keys(e).length===0;return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(N0,{})}),"Processors"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Processors documentation"]})})]}),c.jsx(Si,{isCentered:n,children:c.jsx(Mon,{processors:e,isLoading:t,error:r})})]})}function Tbn(){const{processorId:e}=Ei(),{data:t,isLoading:r,error:n}=amt(e);return n&&Mc(n)?c.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/processors",children:[c.jsx(ve,{children:c.jsx(N0,{})}),"Processors"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:e})]})}),c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"processors"})})]}):!r&&t?.isWorkflow?c.jsx(thn,{to:`/workflows/${e}/graph`,replace:!0}):r?c.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/processors",children:[c.jsx(ve,{children:c.jsx(N0,{})}),"Processors"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:c.jsx(Nr,{className:"h-6 w-32"})})]})}),c.jsxs("div",{className:"p-6",children:[c.jsx(Nr,{className:"h-8 w-48 mb-4"}),c.jsx(Nr,{className:"h-32 w-full"})]})]}):c.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/processors",children:[c.jsx(ve,{children:c.jsx(N0,{})}),"Processors"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:c.jsx(Hon,{value:e,variant:"ghost"})})]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Processors documentation"]})})]}),c.jsx(Uon,{processorId:e})]})}function Abn(){const{data:e={},isLoading:t}=ah(),{data:r={},isLoading:n,error:s}=e8(),a=Object.keys(r).length>0,i=Object.values(e).some(l=>l.tools&&Object.keys(l.tools).length>0),o=!n&&!t&&!a&&!i;return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(tl,{})}),"Tools"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Tools documentation"]})})]}),c.jsx(Si,{isCentered:o,children:c.jsx(Won,{tools:r,agents:e,isLoading:t||n,error:s})})]})}const Dbn={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,r)=>r?`/workspaces/${r}/skills/${t}?agentId=${encodeURIComponent(e)}`:"/workspaces",agentsLink:()=>"/agents",agentNewThreadLink:e=>`/agents/${e}/chat/new`,agentThreadLink:(e,t,r)=>r?`/agents/${e}/chat/${t}?messageId=${r}`:`/agents/${e}/chat/${t}`,workflowsLink:()=>"/workflows",workflowLink:e=>`/workflows/${e}`,networkLink:e=>`/networks/v-next/${e}/chat`,networkNewThreadLink:e=>`/networks/v-next/${e}/chat/${No()}`,networkThreadLink:(e,t)=>`/networks/v-next/${e}/chat/${t}`,scorerLink:e=>`/scorers/${e}`,cmsScorersCreateLink:()=>"/cms/scorers/create",cmsScorerEditLink:e=>`/cms/scorers/${e}/edit`,cmsAgentCreateLink:()=>"/cms/agents/create",cmsAgentEditLink:e=>`/cms/agents/${e}/edit`,promptBlockLink:e=>`/prompts/${e}`,promptBlocksLink:()=>"/prompts",cmsPromptBlockCreateLink:()=>"/cms/prompts/create",cmsPromptBlockEditLink:e=>`/cms/prompts/${e}/edit`,toolLink:e=>`/tools/${e}`,skillLink:(e,t)=>t?`/workspaces/${t}/skills/${e}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t)=>t?`/workspaces/${t}/skills/${e}`:"/workspaces",workspacesLink:()=>"/workspaces",processorsLink:()=>"/processors",processorLink:e=>`/processors/${e}`,mcpServerLink:e=>`/mcps/${e}`,mcpServerToolLink:(e,t)=>`/mcps/${e}/tools/${t}`,workflowRunLink:(e,t)=>`/workflows/${e}/graph/${t}`,datasetLink:e=>`/datasets/${e}`,datasetItemLink:(e,t)=>`/datasets/${e}/items/${t}`,datasetExperimentLink:(e,t)=>`/datasets/${e}/experiments/${t}`},Nbn=()=>{const e=Hp(),t=r=>e(r,{viewTransition:!0});return c.jsx(bJr,{Link:ayn,navigate:t,paths:Dbn,children:c.jsx(kbn,{children:c.jsx(dN,{})})})},Ibn=!!window.MASTRA_CLOUD_API_ENDPOINT,jbn=bMe.has("datasets"),mMe=[{index:!0,element:c.jsx(dyn,{})},{path:"instruction-blocks",element:c.jsx(pyn,{})},{path:"tools",element:c.jsx(gyn,{})},{path:"agents",element:c.jsx(lyn,{})},{path:"scorers",element:c.jsx(hyn,{})},{path:"workflows",element:c.jsx(byn,{})},{path:"skills",element:c.jsx(myn,{})},{path:"memory",element:c.jsx(fyn,{})},{path:"variables",element:c.jsx(yyn,{})}],Rbn=[{path:"/login",element:c.jsx(Pyn,{})},{path:"/signup",element:c.jsx(Kyn,{})},{element:c.jsx(Nbn,{}),children:[...Ibn?[]:[{path:"/settings",element:c.jsx(Yyn,{})},{path:"/templates",element:c.jsx(dbn,{})},{path:"/templates/:templateSlug",element:c.jsx(fbn,{})}],{path:"/scorers",element:c.jsx(Zyn,{})},{path:"/scorers/:scorerId",element:c.jsx(Wyn,{})},{path:"/observability",element:c.jsx(Hyn,{})},{path:"/agents",element:c.jsx(iyn,{})},{path:"/cms/agents/create",element:c.jsx(cyn,{}),children:mMe},{path:"/cms/agents/:agentId/edit",element:c.jsx(uyn,{}),children:mMe},{path:"/cms/scorers/create",element:c.jsx(wyn,{})},{path:"/cms/scorers/:scorerId/edit",element:c.jsx(kyn,{})},{path:"/prompts",element:c.jsx(Qyn,{})},{path:"/cms/prompts/create",element:c.jsx(vyn,{})},{path:"/cms/prompts/:promptBlockId/edit",element:c.jsx(Syn,{})},{path:"/agents/:agentId/tools/:toolId",element:c.jsx(hbn,{})},{path:"/agents/:agentId",element:c.jsx(_bn,{children:c.jsx(dN,{})}),children:[{index:!0,loader:({params:e})=>VY(`/agents/${e.agentId}/chat`)},{path:"chat",element:c.jsx(iMe,{})},{path:"chat/:threadId",element:c.jsx(iMe,{})}]},{path:"/tools",element:c.jsx(Abn,{})},{path:"/tools/:toolId",element:c.jsx(mbn,{})},{path:"/processors",element:c.jsx(Cbn,{})},{path:"/processors/:processorId",element:c.jsx(Tbn,{})},{path:"/mcps",element:c.jsx($yn,{})},{path:"/mcps/:serverId",element:c.jsx(Myn,{})},{path:"/mcps/:serverId/tools/:toolId",element:c.jsx(Lyn,{})},{path:"/workspaces",element:c.jsx(hMe,{})},{path:"/workspaces/:workspaceId",element:c.jsx(hMe,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:c.jsx(bbn,{})},{path:"/workflows",element:c.jsx(gbn,{})},{path:"/workflows/:workflowId",element:c.jsx(Bhn,{children:c.jsx(dN,{})}),children:[{index:!0,loader:({params:e})=>VY(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:c.jsx(fMe,{})},{path:"graph/:runId",element:c.jsx(fMe,{})}]},...jbn?[{path:"/datasets",element:c.jsx(Oyn,{})},{path:"/datasets/:datasetId",element:c.jsx(_yn,{})},{path:"/datasets/:datasetId/items/:itemId",element:c.jsx(Ayn,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:c.jsx(Iyn,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:c.jsx(Cyn,{})},{path:"/datasets/:datasetId/experiments",element:c.jsx(Tyn,{})},{path:"/datasets/:datasetId/items",element:c.jsx(Dyn,{})},{path:"/datasets/:datasetId/versions",element:c.jsx(Ryn,{})}]:[],{index:!0,loader:()=>VY("/agents")},{path:"/request-context",element:c.jsx(Gyn,{})}]}];function Pbn(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:r,apiPrefix:n,isLoading:s}=sfe();if(s)return null;if(!t)return c.jsx(Snn,{});const a=Chn(Rbn,{basename:e});return c.jsx(Jvr,{baseUrl:t,headers:r,apiPrefix:n,children:c.jsx(nyn,{children:c.jsx(Kfn,{router:a})})})}function $bn(){const e=window.MASTRA_SERVER_PROTOCOL||"http",t=window.MASTRA_SERVER_HOST||"localhost",r=window.MASTRA_SERVER_PORT||4111,n=window.MASTRA_API_PREFIX||"/api",s=window.MASTRA_CLOUD_API_ENDPOINT||"",a=window.MASTRA_AUTO_DETECT_URL==="true",i=s||(a?window.location.origin:`${e}://${t}:${r}`);return c.jsx(Cdn,{children:c.jsx(pnn,{endpoint:i,defaultApiPrefix:n,children:c.jsx(Pbn,{})})})}Rvt.createRoot(document.getElementById("root")).render(c.jsx(E.StrictMode,{children:c.jsx($bn,{})}));const xxn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{sVe as A,XHe as B,iVe as C,Zqe as D,jd as E,vp as F,hvn as G,Xar as H,Js as I,xxn as J,Q0 as L,nVe as N,uF as _,Pjt as a,Yjt as b,qbn as c,jve as d,U0 as e,Gjt as f,Z0 as g,Xjt as h,$1 as i,M1 as j,P1 as k,iE as l,DHt as m,tHe as n,ba as o,qqt as p,Hqt as q,Soe as r,xie as s,re as t,O3 as u,Zc as v,Bjt as w,mt as x,Je as y,vQe as z};
|
|
615
|
+
`).reduce((o,l)=>{if(!l||l.startsWith("#"))return o;const[u,d]=l.split("=");return u&&(o[u]=d?.split("")?.every(p=>p==="*")?"":d?.replaceAll('"',"")),o},{}):{}}const rbn=()=>ur({queryKey:["mastra-templates"],queryFn:wyt}),nbn=({repoOrSlug:e,owner:t})=>ur({queryKey:["template-repo",e,t],queryFn:()=>ebn({repoOrSlug:e,owner:t})}),sbn=({repo:e,owner:t,branch:r})=>ur({queryKey:["template-repo-env-vars",e,t,r],queryFn:()=>tbn({repo:e,owner:t,branch:r})}),abn=()=>{const e=st();return ur({queryKey:["agent-builder-workflow"],queryFn:async()=>await e.getAgentBuilderAction("merge-template").details()})},ibn=()=>{const e=st();return Kr({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").createRun({runId:t})})},obn=()=>{const e=st();return Kr({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").runById(t)})},pMe=(e,t,r)=>{let n={...t};if(!(n.payload?.workflowState?.steps&&Object.keys(n.payload.workflowState.steps).length>0)&&r?.allSteps&&(n.payload={...n.payload,workflowState:{...n.payload?.workflowState,steps:Object.keys(r.allSteps).reduce((a,i)=>(a[i]={id:i,description:r.allSteps[i].description,status:"pending"},a),{})}}),e.type==="start"||e.type==="workflow-start"){const a={};r?.allSteps&&Object.entries(r.allSteps).forEach(([o,l])=>{a[o]={id:l.id,description:l.description,status:"pending"}});const i=e.runId||e.payload?.runId;n={...n,runId:i,eventTimestamp:new Date().toISOString(),status:"running",phase:"initializing",payload:{workflowState:{status:"running",steps:a},currentStep:null}}}if(e.type==="step-start"||e.type==="workflow-step-start"){const a=e.payload.id;n={...n,phase:"processing",payload:{...n.payload,currentStep:{id:a,status:"running",startTime:new Date,...e.payload},workflowState:{...n.payload.workflowState,steps:{...n.payload.workflowState.steps,[a]:{...n.payload.workflowState.steps[a],status:"running",startTime:new Date,...e.payload}}}}}}if(e.type==="step-result"||e.type==="workflow-step-result"){const a=e.payload.id,i=e.payload.status,o=e.payload.error;n={...n,payload:{...n.payload,currentStep:{...n.payload.currentStep,status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date},workflowState:{...n.payload.workflowState,steps:{...n.payload.workflowState.steps,[a]:{...n.payload.workflowState.steps[a],status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date}}}}},i==="failed"&&o&&(n={...n,status:"failed",error:o,phase:"error",failedStep:{id:a,error:o,description:e.payload.description||a},payload:{...n.payload,workflowState:{...n.payload.workflowState,status:"failed"}},errorTimestamp:new Date})}return(e.type==="step-finish"||e.type==="workflow-step-finish")&&(n={...n,payload:{...n.payload,currentStep:null}}),(e.type==="finish"||e.type==="workflow-finish")&&(n.phase==="error"||n.status==="failed"?n={...n,completedAt:new Date}:n={...n,status:e.payload.status||"completed",phase:"completed",payload:{...n.payload,currentStep:null,workflowState:{...n.payload.workflowState,status:e.payload.status||"completed"}},completedAt:new Date}),e.type==="error"&&(n={...n,status:"failed",error:e.payload.error,phase:"error",payload:{...n.payload,workflowState:{...n.payload.workflowState,status:"failed"}},errorTimestamp:new Date}),{newState:n}},lbn=(e,t)=>{try{localStorage.setItem(`template-install-${e}`,JSON.stringify({state:t,timestamp:Date.now()}))}catch(r){console.warn("Failed to save template state to localStorage:",r)}},Eyt=(e,t)=>{const[r,n]=E.useState({}),[s,a]=E.useState(!1);return{streamResult:r,isStreaming:s,processStream:async(o,l)=>{if(a(!0),n({}),!o)throw new Error("No stream returned");const u=o.getReader();let d={runId:l||t,eventTimestamp:new Date().toISOString(),phase:"running",payload:{workflowState:{steps:{}},currentStep:null}};try{for(;;){const{done:p,value:f}=await u.read();if(p)break;const{newState:h}=pMe(f,d,e);if(d=h,n(h),f.runId||l||t){const m=f.runId||l||t;lbn(m,h)}}}catch(p){console.error("💥 [processStream] Error processing template installation stream:",p);const{newState:f}=pMe({type:"error",payload:{error:p instanceof Error?p.message:"Unknown error"}},d,e);n(f)}finally{a(!1),u.releaseLock()}}}},cbn=e=>{const t=st(),{streamResult:r,isStreaming:n,processStream:s}=Eyt(e);return{streamInstall:Kr({mutationFn:async({inputData:i,selectedModel:o,runId:l})=>{for(let d=1;d<=3;d++)try{const p=t.getAgentBuilderAction("merge-template"),f=new hp;f.set("selectedModel",o);const h=await p.stream({inputData:i,requestContext:f},l);await s(h,l);return}catch(p){console.error(`💥 [streamInstall] Attempt ${d} failed:`,p);const f=p?.message?.includes("Failed to fetch")||p?.message?.includes("NetworkError")||p?.message?.includes("network error")||p?.message?.includes("fetch")||p?.code==="NETWORK_ERROR"||p?.name==="TypeError";if(console.warn(`Stream attempt ${d}/3 failed:`,p),f){const h=l?`Network error during template installation (likely hot reload). Please refresh the page to resume from where you left off using runId: ${l}`:"Network error during template installation (likely hot reload). Please try again.";throw console.error("🔌 Stream network error:",h),new Error(h)}throw console.error("❌ [streamInstall] Non-network error or max retries reached, throwing:",p),p}}}),streamResult:r,isStreaming:n}},ubn=e=>{const t=st(),{streamResult:r,isStreaming:n,processStream:s}=Eyt(e);return{observeInstall:Kr({mutationFn:async({runId:i})=>{for(let u=1;u<=3;u++)try{const p=await t.getAgentBuilderAction("merge-template").observeStream({runId:i});await s(p,i);return}catch(d){console.error(`💥 [observeInstall] Attempt ${u} failed:`,d);const p=d?.message?.includes("Failed to fetch")||d?.message?.includes("NetworkError")||d?.message?.includes("network error")||d?.message?.includes("fetch")||d?.code==="NETWORK_ERROR"||d?.name==="TypeError";if(console.warn(`ObserveStream attempt ${u}/3 failed:`,d),p&&u<3){console.info(`🔄 ObserveStream network error detected (likely hot reload), retrying in 2000ms... (attempt ${u+1}/3)`),await new Promise(f=>setTimeout(f,2e3));continue}throw console.error("❌ [observeInstall] Non-network error or max retries reached, throwing:",d),d}}}),streamResult:r,isStreaming:n}};function dbn(){const{data:e,isLoading:t}=rbn(),{templates:r,tags:n,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=E.useState("all"),[o,l]=E.useState("all"),[u,d]=E.useState(""),p=[{value:"all",label:"All"}];(n||[]).forEach(S=>{p.push({value:S,label:S})});const f=[{value:"all",label:"All"}];(s||[]).forEach(S=>{f.push({value:S,label:S})});const h=(S,w)=>{w==="tag"?i(S):w==="provider"&&l(S)},m=S=>{d(S)},y=()=>{i("all"),l("all"),d("")},b=r.filter(S=>!(u&&!S.title.toLowerCase().includes(u)&&!S.description.toLowerCase().includes(u)||a!=="all"&&!S.tags.includes(a)||o!=="all"&&!S.supportedProviders.includes(o))),v=u||a!=="all"||o!=="all";return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(sce,{})}),"Templates"]})}),c.jsxs("div",{className:K("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[c.jsx(tln,{selectedTag:a,onTagChange:S=>h(S,"tag"),tagOptions:p,selectedProvider:o,onProviderChange:S=>h(S,"provider"),providerOptions:f,searchTerm:u,onSearchChange:m,onReset:v?y:void 0,className:"max-w-[80rem]",isLoading:t}),c.jsx(nln,{templates:b,linkComponent:Pt,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const pbn="1.9.0";function fbn(){const{templateSlug:e}=Ei(),[t,r]=sc(),[n,s]=E.useState(""),[a,i]=E.useState(""),[o,l]=E.useState(""),[u,d]=E.useState({}),[p,f]=E.useState([]),[h,m]=E.useState(null),[y,b]=E.useState(!1),[v,S]=E.useState(""),[w,k]=E.useState(!1),[_,C]=E.useState(!1),[T,A]=E.useState([]),{data:N,isLoading:j}=nbn({repoOrSlug:e,owner:"mastra-ai"}),L=pbn?.includes("beta")??!1?"beta":"main",{data:F,isLoading:M}=sbn({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:L}),{data:z,isLoading:q}=abn(),{mutateAsync:Q,isPending:V}=ibn(),{mutateAsync:Z}=obn(),{streamInstall:$,streamResult:X,isStreaming:U}=cbn(z),{observeInstall:I,streamResult:H,isStreaming:G}=ubn(z);E.useEffect(()=>{const ne=t.get("runId");ne&&!y&&!h&&!U&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:ne}),S(ne),Z({runId:ne}).then(ae=>{const ge=ae.snapshot;if(ge?.status==="success"&&ge?.result?.success)b(!0);else if(ge?.result?.success===!1)if(ge?.result?.validationResults&&!ge?.result?.validationResults?.valid&&ge?.result?.validationResults?.remainingErrors>0){const{remainingErrors:xe,errors:Ie}=ge.result.validationResults,Ce=`Template installation completed but ${xe} validation issue${xe>1?"s":""} remain unresolved.`;m(Ce),A(Ie||[])}else m(ge?.result?.message||ge?.result?.error||"Template installation failed")}).catch(ae=>{console.error("❌ Failed to fetch run details:",ae),m("Failed to retrieve installation status after reload")}))},[t,y,h,U,G,Z]),E.useEffect(()=>{const ne=t.get("runId"),ae=t.get("resume"),ge=t.get("provider");if(ne&&ae==="true"&&ge&&!U&&!G&&!w&&!_&&z){S(ne),k(!0);try{Z({runId:ne}).then(le=>{if(le.snapshot?.status==="running")return I.mutateAsync({runId:ne})}).then(()=>{r(le=>{const xe=new URLSearchParams(le);return xe.delete("resume"),xe})}).catch(le=>{console.error("❌ Failed to resume template installation:",le),le.message?.includes("404")||le.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(le){console.error("❌ Auto-resume failed with error:",le),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,U,G,w,_,z,Z,I,r]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ee=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(ne=>ne).join(", "):"n/a",icon:c.jsx(tl,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(ne=>ne).join(", "):"n/a",icon:c.jsx($i,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(ne=>ne).join(", "):"n/a",icon:c.jsx(avr,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:c.jsx(cbr,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:c.jsx(Jbr,{})}],te=[{...ee[0]},{...ee[1]},{...ee[2]}].filter(ne=>ne.value!=="n/a");E.useEffect(()=>{F&&d(F)},[F]),E.useEffect(()=>{const ne=X||H;ne?.phase==="error"&&ne?.error&&m(ne.error)},[X?.phase,X?.error,H?.phase,H?.error]);const se=ne=>{s(ne)},ce=async ne=>(i(ne.provider),l(ne.modelId),{message:"Model updated successfully"}),Se=async()=>{const ne=Object.entries(u).reduce((ae,[ge,le])=>(le===""&&ae.push(ge),ae),[]);if(ne.length>0){f(ne);return}if(N){m(null),b(!1),S(""),C(!0);try{const ge={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:L,slug:N.slug,variables:u},{runId:le}=await Q({});S(le),r(xe=>{const Ie=new URLSearchParams(xe);return Ie.set("runId",le),Ie.set("resume","true"),Ie.set("provider",n||"openai"),Ie}),await $.mutateAsync({inputData:ge,selectedModel:{provider:a,modelId:o},runId:le})}catch(ae){C(!1),m(ae?.message||"Template installation failed"),console.error("Template installation failed",ae)}}},W=ne=>{const{name:ae,value:ge}=ne.target;ge.trim()===""?f(le=>[...le,ae]):f(le=>le.filter(xe=>xe!==ae)),d(le=>({...le,[ae]:ge}))};return c.jsxs(Hr,{children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/templates",children:[c.jsx(ve,{children:c.jsx(sce,{})}),"Templates"]}),c.jsx(Or,{as:Pt,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),c.jsx("div",{className:K("w-full lg:px-12 h-full overflow-y-scroll"),children:c.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[c.jsx(sln,{isLoading:j,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ee,templateSlug:e}),N&&c.jsxs(c.Fragment,{children:[(U||G)&&c.jsx(uln,{name:N.title,streamResult:G?H:X,runId:v,workflowInfo:z}),y&&c.jsx(dln,{name:N.title,installedEntities:te,linkComponent:Pt}),h&&c.jsx(pln,{errorMsg:h,validationErrors:T.length>0?T:X?.validationResults?.errors||H?.validationResults?.errors}),!U&&!G&&!y&&!h&&c.jsx(aln,{providerOptions:J,selectedProvider:n,onProviderChange:se,variables:u,setVariables:d,errors:p,setErrors:f,handleInstallTemplate:Se,handleVariableChange:W,isLoadingEnvVars:M||q,isInstalling:V,defaultModelProvider:a,defaultModelId:o,onModelUpdate:ce})]})]})})]})}const hbn=()=>{const{toolId:e,agentId:t}=Ei();return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/agents",children:[c.jsx(ve,{children:c.jsx($i,{})}),"Agents"]}),c.jsx(Or,{as:Pt,to:`/agents/${t}/chat`,children:t}),c.jsx(Or,{as:Pt,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Tools documentation"]})})]}),c.jsx(Qsn,{toolId:e,agentId:t})]})},mbn=()=>{const{toolId:e}=Ei();return c.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/tools",children:[c.jsx(ve,{children:c.jsx(tl,{})}),"Tools"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:c.jsx(eln,{value:e,variant:"ghost"})})]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Tools documentation"]})})]}),c.jsx(Jon,{toolId:e})]})};function gbn(){const{data:e,isLoading:t,error:r}=Sy(),n=!t&&Object.keys(e||{}).length===0;return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(Yl,{})}),"Workflows"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Workflows documentation"]})})]}),c.jsx(Si,{isCentered:n,children:c.jsx(Men,{workflows:e||{},isLoading:t,error:r})})]})}const fMe=()=>{const{workflowId:e}=Ei(),{data:t,isLoading:r,error:n}=oj(e);return n&&Mc(n)?c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"workflows"})}):c.jsx(Lpt,{workflowId:e,workflow:t??void 0,isLoading:r})};function hMe(){const{workspaceId:e}=Ei(),[t,r]=sc(),n=Hp(),[s,a]=E.useState(!1),[i,o]=E.useState(!1),[l,u]=E.useState(!1),[d,p]=E.useState(null),[f,h]=E.useState(null),[m,y]=E.useState(!1),b=t.get("file"),v=t.get("tab"),{data:S,error:w,isLoading:k}=Rht(),_=S?.workspaces??[],C=e??_[0]?.id,{data:T,isLoading:A,error:N}=Hin(C),j=Mc(w)||Mc(N),R=T?.filesystem?.metadata,L=R?.contained===!1&&typeof R?.basePath=="string"?R.basePath:"/",F=t.get("path")||L,M=fre(w)||fre(N),z=C?_.find(je=>je.id===C):void 0,q=je=>{const St=new URLSearchParams(t);for(const[sr,En]of Object.entries(je))En===null?St.delete(sr):St.set(sr,En);r(St)},Q=je=>{y(!1),a(!1),n(`/workspaces/${je}`)},V=je=>{q({path:je,file:null})},Z=je=>{q({file:je})},$=je=>{q({tab:je})},X=F,U=b,{data:I,isLoading:H,error:G,refetch:J}=Qin(X,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:C}),ee=Zin(),te=Win(),{data:se,isLoading:ce}=Pht(U??"",{enabled:!!U,workspaceId:C}),{data:Se,isLoading:W,refetch:ne}=Yin({workspaceId:C}),ae=son(),ge=aon(),le=ion(),xe=T?.isWorkspaceConfigured??!1,Ie=T?.capabilities?.hasFilesystem??!1,Ce=T?.capabilities?.hasSkills??!1,oe=T?.capabilities?.canBM25??!1,de=T?.capabilities?.canVector??!1,fe=z?.safety?.readOnly??!1,Ne=Ie&&!fe,Te=T?.mounts,we=Te?.filter(je=>!je.readOnly).map(je=>({path:je.path,displayName:je.displayName,icon:je.icon,provider:je.provider,name:je.name})),ue=Te&&Te.length>1?Te.map(je=>je.path):void 0,De=E.useCallback(je=>{C&&ae.mutate({...je,workspaceId:C},{onSuccess:async St=>{if(St.success){u(!1);const{data:sr,error:En}=await ne();if(En||!sr){We.success(`Skill "${St.skillName}" installed successfully (${St.filesWritten} files)`);return}sr.skills.some(Sn=>Sn.name===St.skillName)?We.success(`Skill "${St.skillName}" installed successfully (${St.filesWritten} files)`):(y(!0),We.warning(`Skill "${St.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else We.error("Failed to install skill")},onError:St=>{We.error(`Failed to install skill: ${St instanceof Error?St.message:"Unknown error"}`)}})},[C,ae,ne]),Le=E.useCallback(je=>{C&&(h(je),ge.mutate({workspaceId:C,skillName:je},{onSuccess:St=>{if(h(null),St.updated.length>0){const sr=St.updated[0];sr.success?(We.success(`Skill "${je}" updated successfully (${sr.filesWritten} files)`),ne()):We.error(`Failed to update skill: ${sr.error??"Unknown error"}`)}else We.error("Failed to update skill: No update result returned")},onError:St=>{h(null),We.error(`Failed to update skill: ${St instanceof Error?St.message:"Unknown error"}`)}}))},[C,ge,ne]),rt=E.useCallback(je=>{C&&(p(je),le.mutate({workspaceId:C,skillName:je},{onSuccess:St=>{p(null),St.success?(We.success(`Skill "${St.skillName}" removed successfully`),ne()):We.error(`Failed to remove skill "${St.skillName}"`)},onError:St=>{p(null),We.error(`Failed to remove skill: ${St instanceof Error?St.message:"Unknown error"}`)}}))},[C,le,ne]),$t=v==="files"&&Ie?"files":v==="skills"&&Ce?"skills":Ie?"files":Ce?"skills":"files",ut=Se?.skills??[],or=Se?.isSkillsConfigured??!1,Br=I?.entries??[],Et=Ie&&(oe||de),Dt=Ce&&or&&ut.length>0,xt=Et||Dt;return j?c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})})]}),c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"workspaces"})})]}):M?c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})})]}),c.jsx("div",{className:"grid overflow-y-auto h-full",children:c.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[c.jsx(ZT,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:c.jsx(wh,{})}),c.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[c.jsx("div",{className:"flex items-center justify-center w-16 h-16 rounded-full bg-amber-500/10 mb-6",children:c.jsx(Iee,{className:"h-8 w-8 text-amber-500"})}),c.jsx("h2",{className:"text-xl font-semibold text-neutral6 mb-2",children:"Workspace Not Supported"}),c.jsxs("p",{className:"text-neutral4 max-w-md mb-6",children:["The workspace feature requires a newer version of ",c.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),". Please upgrade your dependencies to enable workspace functionality."]}),c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Learn More"]})]})]})})]}):k?c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})})]}),c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx(Cn,{})})]}):!A&&!k&&!xe?c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})})]}),c.jsx("div",{className:"grid overflow-y-auto h-full",children:c.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[c.jsx(ZT,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:c.jsx(wh,{})}),c.jsx(Wdn,{})]})})]}):c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsxs(Vs,{children:[xt&&c.jsxs(ye,{variant:"light",onClick:()=>a(!s),children:[c.jsx(ve,{children:c.jsx(Xbr,{className:"h-4 w-4"})}),"Search"]}),c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})]})]}),c.jsx("div",{className:"grid overflow-y-auto h-full",children:c.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start gap-6 h-full w-full",children:[c.jsx(ZT,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:c.jsx(wh,{})}),_.length>1&&c.jsxs("div",{className:"relative",children:[c.jsxs("button",{onClick:()=>o(!i),className:"flex items-center gap-2 px-3 py-2 text-sm border border-border1 rounded-lg bg-surface2 hover:bg-surface3 transition-colors w-full max-w-md",children:[z?.source==="agent"?c.jsx(y$,{className:"h-4 w-4 text-accent1"}):c.jsx(JG,{className:"h-4 w-4 text-neutral4"}),c.jsxs("span",{className:"flex-1 text-left truncate",children:[z?.name??"Select workspace",z?.source==="agent"&&z.agentName&&c.jsxs("span",{className:"text-neutral4 ml-1",children:["(",z.agentName,")"]})]}),c.jsx(hbr,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&c.jsx("div",{className:"absolute z-50 mt-1 w-full max-w-md bg-surface2 border border-border1 rounded-lg shadow-lg overflow-hidden",children:_.map(je=>c.jsxs("button",{onClick:()=>{Q(je.id),o(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${z?.id===je.id?"bg-surface3":""}`,children:[je.source==="agent"?c.jsx(y$,{className:"h-4 w-4 text-accent1 flex-shrink-0"}):c.jsx(JG,{className:"h-4 w-4 text-neutral4 flex-shrink-0"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:je.name}),c.jsx("div",{className:"text-xs text-neutral4 truncate",children:je.source==="agent"?`Agent: ${je.agentName}`:"Global workspace"})]}),c.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[je.safety?.readOnly&&c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"}),je.capabilities.hasFilesystem&&c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),je.capabilities.hasSandbox&&c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),je.capabilities.hasSkills&&c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},je.id))})]}),_.length===1&&z&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[z.source==="agent"?c.jsx(y$,{className:"h-4 w-4 text-accent1"}):c.jsx(JG,{className:"h-4 w-4"}),c.jsx("span",{children:z.name}),z.source==="agent"&&z.agentName&&c.jsxs("span",{className:"text-neutral3",children:["(",z.agentName,")"]}),fe&&c.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),s&&xt&&C&&c.jsx(ybn,{workspaceId:C,canSearchFiles:Et,canSearchSkills:Dt,canBM25:oe,canVector:de,showInitWarning:!A&&T?.status!=="ready",onViewFileResult:je=>{q({file:je,tab:"files"})},onViewSkillResult:je=>{C&&n(`/workspaces/${C}/skills/${encodeURIComponent(je)}`)}},C),c.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[Ie&&c.jsxs("button",{onClick:()=>$("files"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${$t==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[c.jsx(vF,{className:"h-4 w-4"}),"Files"]}),Ce&&c.jsxs("button",{onClick:()=>$("skills"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${$t==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[c.jsx(CM,{className:"h-4 w-4"}),"Skills",or&&ut.length>0&&c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:ut.length})]})]}),c.jsxs("div",{className:"pb-8",children:[$t==="files"&&Ie&&c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[c.jsx(Hdn,{entries:Br,currentPath:X,isLoading:H,error:G,onNavigate:V,onFileSelect:Z,onRefresh:()=>J(),onCreateDirectory:fe?void 0:je=>te.mutate({path:je,workspaceId:C}),onDelete:fe?void 0:je=>ee.mutate({path:je,recursive:!0,force:!0,workspaceId:C})}),U&&c.jsx(Zdn,{path:U,content:se?.content??"",isLoading:ce,mimeType:se?.mimeType,onClose:()=>Z(null)})]})}),$t==="skills"&&Ce&&c.jsx(spn,{skills:ut,isLoading:W,isSkillsConfigured:or,hasUndiscoveredAgentSkills:m,basePath:C?`/workspaces/${C}/skills`:"/workspaces",onAddSkill:Ne?()=>u(!0):void 0,onUpdateSkill:Ne?Le:void 0,onRemoveSkill:Ne?rt:void 0,updatingSkillName:f??void 0,removingSkillName:d??void 0,mountPaths:ue}),!Ie&&!Ce&&c.jsx("div",{className:"py-12 text-center text-neutral4",children:c.jsx("p",{children:"No workspace capabilities are configured."})})]})]})}),C&&Ne&&c.jsx(upn,{open:l,onOpenChange:u,workspaceId:C,onInstall:De,isInstalling:ae.isPending,installedSkillIds:ut.filter(je=>je.skillsShSource).map(je=>`${je.skillsShSource.owner}/${je.skillsShSource.repo}/${je.name}`),installedSkillNames:ut.filter(je=>!je.skillsShSource).map(je=>je.name),writableMounts:we,installedSkillPaths:Object.fromEntries(ut.filter(je=>je.path).map(je=>[je.name,je.path]))})]})}function ybn({workspaceId:e,canSearchFiles:t,canSearchSkills:r,canBM25:n,canVector:s,showInitWarning:a,onViewFileResult:i,onViewSkillResult:o}){const l=Xin(),u=eon();return c.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[t&&c.jsxs("div",{children:[c.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[c.jsx(vF,{className:"h-4 w-4"}),"Search Indexed Files"]}),a&&c.jsxs("p",{className:"text-xs text-amber-400 mb-3",children:["File search requires ",c.jsx("code",{className:"text-amber-300",children:"workspace.init()"})," to index files from your configured ",c.jsx("code",{className:"text-amber-300",children:"autoIndexPaths"}),"."]}),c.jsx(Xdn,{onSearch:d=>l.mutate({...d,workspaceId:e}),isSearching:l.isPending,searchResults:l.data?{...l.data,results:l.data.results.filter(d=>!d.id.startsWith("skill:"))}:void 0,canBM25:n,canVector:s,onViewResult:i})]}),r&&c.jsxs("div",{children:[c.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[c.jsx(CM,{className:"h-4 w-4"}),"Search Skills"]}),c.jsx(Kdn,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>o(d.skillName)})]})]})}function bbn(){const{skillName:e,workspaceId:t}=Ei(),[r]=sc(),n=e?decodeURIComponent(e):"",s=r.get("agentId"),a=s?decodeURIComponent(s):null,i=a?`/agents/${a}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[o,l]=E.useState(null),{data:u,isLoading:d,error:p}=Kin(n,{workspaceId:t}),{data:f}=Pht(u?.path?`${u.path}/SKILL.md`:"",{enabled:!!u?.path,workspaceId:t}),{data:h,isLoading:m}=Jin(n,o??"",{enabled:!!o,workspaceId:t}),y=b=>a?c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:i,children:[c.jsx(ve,{children:c.jsx(y$,{className:"h-4 w-4"})}),a]}),c.jsxs(Or,{as:"span",to:"",isCurrent:!0,children:[c.jsx(ve,{children:c.jsx(CM,{className:"h-4 w-4"})}),b]})]}):c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:i,children:[c.jsx(ve,{children:c.jsx(wh,{className:"h-4 w-4"})}),"Workspace"]}),c.jsxs(Or,{as:Pt,to:i,children:[c.jsx(ve,{children:c.jsx(CM,{className:"h-4 w-4"})}),"Skills"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:b})]});return d?c.jsxs(Hr,{children:[c.jsx(Fr,{children:y("Loading...")}),c.jsx("div",{className:"grid place-items-center h-full",children:c.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):p&&Mc(p)?c.jsxs(Hr,{children:[c.jsx(Fr,{children:y("Permission Denied")}),c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"workspaces"})})]}):p||!u?c.jsxs(Hr,{children:[c.jsx(Fr,{children:y("Error")}),c.jsx("div",{className:"grid place-items-center h-full",children:c.jsxs("div",{className:"text-center",children:[c.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),c.jsx("p",{className:"text-sm text-neutral3",children:p?.message??"Skill not found"})]})})]}):c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[y(n),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Documentation"]})})]}),c.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:c.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:c.jsx(lpn,{skill:u,rawSkillMd:f?.content,onReferenceClick:l})})}),c.jsx(cpn,{open:!!o,onOpenChange:b=>!b&&l(null),skillName:n,referencePath:o??"",content:h?.content,isLoading:m})]})}const vbn=[{key:"main",links:[{name:"Agents",url:"/agents",icon:c.jsx($i,{}),isOnMastraPlatform:!0},{name:"Prompts",url:"/prompts",icon:c.jsx(vF,{}),isOnMastraPlatform:!0},{name:"Workflows",url:"/workflows",icon:c.jsx(Yl,{}),isOnMastraPlatform:!0},{name:"Processors",url:"/processors",icon:c.jsx(vbr,{}),isOnMastraPlatform:!1},{name:"MCP Servers",url:"/mcps",icon:c.jsx(Gf,{}),isOnMastraPlatform:!0},{name:"Tools",url:"/tools",icon:c.jsx(tl,{}),isOnMastraPlatform:!0},{name:"Scorers",url:"/scorers",icon:c.jsx(Bg,{}),isOnMastraPlatform:!0},{name:"Workspaces",url:"/workspaces",icon:c.jsx(wh,{})},{name:"Request Context",url:"/request-context",icon:c.jsx(dKe,{}),isOnMastraPlatform:!0}]},{key:"observability",separator:!0,links:[{name:"Observability",url:"/observability",icon:c.jsx(uE,{}),isOnMastraPlatform:!0},{name:"Datasets",url:"/datasets",icon:c.jsx(wu,{}),isOnMastraPlatform:!1}]},{key:"Templates",separator:!0,links:[{name:"Templates",url:"/templates",icon:c.jsx(sce,{}),isOnMastraPlatform:!1}]},{key:"Settings",separator:!0,links:[{name:"Settings",url:"/settings",icon:c.jsx(Lpe,{}),isOnMastraPlatform:!1}]}],xbn={links:[{name:"Mastra APIs",url:"/swagger-ui",icon:c.jsx(kbr,{}),isOnMastraPlatform:!1},{name:"Documentation",url:"https://mastra.ai/en/docs",icon:c.jsx(_T,{}),isOnMastraPlatform:!0},{name:"Github",url:"https://github.com/mastra-ai/mastra",icon:c.jsx(Mpe,{}),isOnMastraPlatform:!0},{name:"Community",url:"https://discord.gg/BTYqqHKUrf",icon:c.jsx(Mbr,{}),isOnMastraPlatform:!0}]};function Sbn(){const{state:e}=_mt(),r=qp().pathname,n=window?.MASTRA_HIDE_CLOUD_CTA==="true",{isMastraPlatform:s}=Rmt(),{data:a}=uj(),{isCmsAvailable:i,isLoading:o}=pS(),l=a&&G6(a),u=new Set(["/prompts"]),d=p=>u.has(p.url)&&!i&&!o?!1:s?p.isOnMastraPlatform:!0;return c.jsxs(hc,{children:[c.jsx("div",{className:"pt-3 mb-4 -ml-0.5 sticky top-0 bg-surface1 z-10",children:e==="collapsed"?c.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[c.jsx(j0,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),l&&c.jsx(e$e,{})]}):l?c.jsxs("span",{className:"flex items-center justify-between pl-3 pr-2",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(j0,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),c.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),c.jsx(e$e,{})]}):c.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[c.jsx(j0,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),c.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),c.jsx(hc.Nav,{children:vbn.map(p=>{const f=p.links.filter(d),h=f.length>0&&p?.separator;return c.jsxs(hc.NavSection,{children:[p?.title?c.jsx(hc.NavHeader,{state:e,children:p.title}):c.jsx(c.Fragment,{children:h&&c.jsx(hc.NavSeparator,{})}),c.jsx(hc.NavList,{children:f.map(m=>{const y=r.startsWith(m.url);return c.jsx(hc.NavLink,{state:e,link:m,isActive:y},m.name)})})]},p.key)})}),c.jsxs(hc.Bottom,{children:[c.jsx(hc.Nav,{children:c.jsxs(hc.NavSection,{children:[c.jsx(hc.NavSeparator,{}),c.jsxs(hc.NavList,{children:[xbn.links.filter(d).map(p=>c.jsx(hc.NavLink,{link:p,state:e},p.name)),!n&&!s?c.jsx(hc.NavLink,{link:{name:"Share",url:"https://mastra.ai/cloud",icon:c.jsx(gbr,{}),variant:"featured",tooltipMsg:"You're running Mastra Studio locally. Want your team to collaborate?",isOnMastraPlatform:!1},state:e}):null]})]})}),e!=="collapsed"&&c.jsxs(c.Fragment,{children:[c.jsx(hc.NavSeparator,{}),c.jsx(bnn,{collapsed:!1})]})]})]})}const wbn=E.createContext({theme:"system",setTheme:()=>null});function Ebn({children:e,defaultTheme:t="system"}){const[r,n]=E.useState(t);return E.useEffect(()=>{const s=window.document.documentElement;if(s.classList.remove("light","dark"),r==="system"){const a=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";s.classList.add(a);return}s.classList.add(r)},[r]),c.jsx(wbn.Provider,{value:{theme:r,setTheme:n},children:e})}const kbn=({children:e})=>c.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[c.jsx(fKt,{position:"bottom-right"}),c.jsx(Ebn,{defaultTheme:"dark",attribute:"class",children:c.jsx(nc,{delayDuration:0,children:c.jsxs(ydn,{children:[c.jsx(ppn,{}),c.jsxs("div",{className:"grid grid-cols-[auto_1fr] h-full",children:[c.jsx(Sbn,{}),c.jsx("div",{className:"bg-surface2 my-3 mr-3 rounded-lg border border-border1 overflow-y-auto",children:c.jsx(Dsn,{children:e})})]})]})})})]});function Obn({agentId:e}){const{isCmsAvailable:t}=pS();return c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/agents",children:[c.jsx(ve,{children:c.jsx($i,{})}),"Agents"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:c.jsx(Bsn,{value:e,variant:"ghost",showSourceIcon:t})})]}),c.jsx(vmt,{children:c.jsxs(ye,{as:Pt,to:`/observability?entity=${e}`,children:[c.jsx(ve,{children:c.jsx(uE,{})}),"Traces"]})}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Agents documentation"]})})]})}const _bn=({children:e})=>{const{agentId:t}=Ei();return c.jsxs(Hr,{children:[c.jsx(Obn,{agentId:t}),e]})};function Cbn(){const{data:e={},isLoading:t,error:r}=dfe(),n=!t&&Object.keys(e).length===0;return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(N0,{})}),"Processors"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Processors documentation"]})})]}),c.jsx(Si,{isCentered:n,children:c.jsx(Mon,{processors:e,isLoading:t,error:r})})]})}function Tbn(){const{processorId:e}=Ei(),{data:t,isLoading:r,error:n}=amt(e);return n&&Mc(n)?c.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/processors",children:[c.jsx(ve,{children:c.jsx(N0,{})}),"Processors"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:e})]})}),c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx($d,{resource:"processors"})})]}):!r&&t?.isWorkflow?c.jsx(thn,{to:`/workflows/${e}/graph`,replace:!0}):r?c.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[c.jsx(Fr,{children:c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/processors",children:[c.jsx(ve,{children:c.jsx(N0,{})}),"Processors"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:c.jsx(Nr,{className:"h-6 w-32"})})]})}),c.jsxs("div",{className:"p-6",children:[c.jsx(Nr,{className:"h-8 w-48 mb-4"}),c.jsx(Nr,{className:"h-32 w-full"})]})]}):c.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[c.jsxs(Fr,{children:[c.jsxs(Xa,{children:[c.jsxs(Or,{as:Pt,to:"/processors",children:[c.jsx(ve,{children:c.jsx(N0,{})}),"Processors"]}),c.jsx(Or,{as:"span",to:"",isCurrent:!0,children:c.jsx(Hon,{value:e,variant:"ghost"})})]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Processors documentation"]})})]}),c.jsx(Uon,{processorId:e})]})}function Abn(){const{data:e={},isLoading:t}=ah(),{data:r={},isLoading:n,error:s}=e8(),a=Object.keys(r).length>0,i=Object.values(e).some(l=>l.tools&&Object.keys(l.tools).length>0),o=!n&&!t&&!a&&!i;return c.jsxs(Hr,{children:[c.jsxs(Fr,{children:[c.jsxs(Us,{children:[c.jsx(ve,{children:c.jsx(tl,{})}),"Tools"]}),c.jsx(Vs,{children:c.jsxs(ye,{as:Pt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[c.jsx(ve,{children:c.jsx(ai,{})}),"Tools documentation"]})})]}),c.jsx(Si,{isCentered:o,children:c.jsx(Won,{tools:r,agents:e,isLoading:t||n,error:s})})]})}const Dbn={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,r)=>r?`/workspaces/${r}/skills/${t}?agentId=${encodeURIComponent(e)}`:"/workspaces",agentsLink:()=>"/agents",agentNewThreadLink:e=>`/agents/${e}/chat/new`,agentThreadLink:(e,t,r)=>r?`/agents/${e}/chat/${t}?messageId=${r}`:`/agents/${e}/chat/${t}`,workflowsLink:()=>"/workflows",workflowLink:e=>`/workflows/${e}`,networkLink:e=>`/networks/v-next/${e}/chat`,networkNewThreadLink:e=>`/networks/v-next/${e}/chat/${No()}`,networkThreadLink:(e,t)=>`/networks/v-next/${e}/chat/${t}`,scorerLink:e=>`/scorers/${e}`,cmsScorersCreateLink:()=>"/cms/scorers/create",cmsScorerEditLink:e=>`/cms/scorers/${e}/edit`,cmsAgentCreateLink:()=>"/cms/agents/create",cmsAgentEditLink:e=>`/cms/agents/${e}/edit`,promptBlockLink:e=>`/prompts/${e}`,promptBlocksLink:()=>"/prompts",cmsPromptBlockCreateLink:()=>"/cms/prompts/create",cmsPromptBlockEditLink:e=>`/cms/prompts/${e}/edit`,toolLink:e=>`/tools/${e}`,skillLink:(e,t)=>t?`/workspaces/${t}/skills/${e}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t)=>t?`/workspaces/${t}/skills/${e}`:"/workspaces",workspacesLink:()=>"/workspaces",processorsLink:()=>"/processors",processorLink:e=>`/processors/${e}`,mcpServerLink:e=>`/mcps/${e}`,mcpServerToolLink:(e,t)=>`/mcps/${e}/tools/${t}`,workflowRunLink:(e,t)=>`/workflows/${e}/graph/${t}`,datasetLink:e=>`/datasets/${e}`,datasetItemLink:(e,t)=>`/datasets/${e}/items/${t}`,datasetExperimentLink:(e,t)=>`/datasets/${e}/experiments/${t}`},Nbn=()=>{const e=Hp(),t=r=>e(r,{viewTransition:!0});return c.jsx(bJr,{Link:ayn,navigate:t,paths:Dbn,children:c.jsx(kbn,{children:c.jsx(dN,{})})})},Ibn=!!window.MASTRA_CLOUD_API_ENDPOINT,jbn=bMe.has("datasets"),mMe=[{index:!0,element:c.jsx(dyn,{})},{path:"instruction-blocks",element:c.jsx(pyn,{})},{path:"tools",element:c.jsx(gyn,{})},{path:"agents",element:c.jsx(lyn,{})},{path:"scorers",element:c.jsx(hyn,{})},{path:"workflows",element:c.jsx(byn,{})},{path:"skills",element:c.jsx(myn,{})},{path:"memory",element:c.jsx(fyn,{})},{path:"variables",element:c.jsx(yyn,{})}],Rbn=[{path:"/login",element:c.jsx(Pyn,{})},{path:"/signup",element:c.jsx(Kyn,{})},{element:c.jsx(Nbn,{}),children:[...Ibn?[]:[{path:"/settings",element:c.jsx(Yyn,{})},{path:"/templates",element:c.jsx(dbn,{})},{path:"/templates/:templateSlug",element:c.jsx(fbn,{})}],{path:"/scorers",element:c.jsx(Zyn,{})},{path:"/scorers/:scorerId",element:c.jsx(Wyn,{})},{path:"/observability",element:c.jsx(Hyn,{})},{path:"/agents",element:c.jsx(iyn,{})},{path:"/cms/agents/create",element:c.jsx(cyn,{}),children:mMe},{path:"/cms/agents/:agentId/edit",element:c.jsx(uyn,{}),children:mMe},{path:"/cms/scorers/create",element:c.jsx(wyn,{})},{path:"/cms/scorers/:scorerId/edit",element:c.jsx(kyn,{})},{path:"/prompts",element:c.jsx(Qyn,{})},{path:"/cms/prompts/create",element:c.jsx(vyn,{})},{path:"/cms/prompts/:promptBlockId/edit",element:c.jsx(Syn,{})},{path:"/agents/:agentId/tools/:toolId",element:c.jsx(hbn,{})},{path:"/agents/:agentId",element:c.jsx(_bn,{children:c.jsx(dN,{})}),children:[{index:!0,loader:({params:e})=>VY(`/agents/${e.agentId}/chat`)},{path:"chat",element:c.jsx(iMe,{})},{path:"chat/:threadId",element:c.jsx(iMe,{})}]},{path:"/tools",element:c.jsx(Abn,{})},{path:"/tools/:toolId",element:c.jsx(mbn,{})},{path:"/processors",element:c.jsx(Cbn,{})},{path:"/processors/:processorId",element:c.jsx(Tbn,{})},{path:"/mcps",element:c.jsx($yn,{})},{path:"/mcps/:serverId",element:c.jsx(Myn,{})},{path:"/mcps/:serverId/tools/:toolId",element:c.jsx(Lyn,{})},{path:"/workspaces",element:c.jsx(hMe,{})},{path:"/workspaces/:workspaceId",element:c.jsx(hMe,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:c.jsx(bbn,{})},{path:"/workflows",element:c.jsx(gbn,{})},{path:"/workflows/:workflowId",element:c.jsx(Bhn,{children:c.jsx(dN,{})}),children:[{index:!0,loader:({params:e})=>VY(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:c.jsx(fMe,{})},{path:"graph/:runId",element:c.jsx(fMe,{})}]},...jbn?[{path:"/datasets",element:c.jsx(Oyn,{})},{path:"/datasets/:datasetId",element:c.jsx(_yn,{})},{path:"/datasets/:datasetId/items/:itemId",element:c.jsx(Ayn,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:c.jsx(Iyn,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:c.jsx(Cyn,{})},{path:"/datasets/:datasetId/experiments",element:c.jsx(Tyn,{})},{path:"/datasets/:datasetId/items",element:c.jsx(Dyn,{})},{path:"/datasets/:datasetId/versions",element:c.jsx(Ryn,{})}]:[],{index:!0,loader:()=>VY("/agents")},{path:"/request-context",element:c.jsx(Gyn,{})}]}];function Pbn(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:r,apiPrefix:n,isLoading:s}=sfe();if(s)return null;if(!t)return c.jsx(Snn,{});const a=Chn(Rbn,{basename:e});return c.jsx(Jvr,{baseUrl:t,headers:r,apiPrefix:n,children:c.jsx(nyn,{children:c.jsx(Kfn,{router:a})})})}function $bn(){const e=window.MASTRA_SERVER_PROTOCOL||"http",t=window.MASTRA_SERVER_HOST||"localhost",r=window.MASTRA_SERVER_PORT||4111,n=window.MASTRA_API_PREFIX||"/api",s=window.MASTRA_CLOUD_API_ENDPOINT||"",a=window.MASTRA_AUTO_DETECT_URL==="true",i=s||(a?window.location.origin:`${e}://${t}:${r}`);return c.jsx(Cdn,{children:c.jsx(pnn,{endpoint:i,defaultApiPrefix:n,children:c.jsx(Pbn,{})})})}Rvt.createRoot(document.getElementById("root")).render(c.jsx(E.StrictMode,{children:c.jsx($bn,{})}));const xxn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{sVe as A,XHe as B,iVe as C,Zqe as D,jd as E,vp as F,hvn as G,Xar as H,Js as I,xxn as J,Q0 as L,nVe as N,uF as _,Pjt as a,Yjt as b,qbn as c,jve as d,U0 as e,Gjt as f,Z0 as g,Xjt as h,$1 as i,M1 as j,P1 as k,iE as l,DHt as m,tHe as n,ba as o,qqt as p,Hqt as q,Soe as r,xie as s,re as t,O3 as u,Zc as v,Bjt as w,mt as x,Je as y,vQe as z};
|