@mastra/deployer-cloud 1.6.0-alpha.0 → 1.6.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 +8 -0
- package/dist/studio/assets/{chunk-REDZDNFN-CnBZrJgU.js → chunk-REDZDNFN-DWLxgtan.js} +1 -1
- package/dist/studio/assets/{chunk-REDZDNFN-TfJ4yMVk-Cyysf1x_.js → chunk-REDZDNFN-TfJ4yMVk-CU645_ff.js} +1 -1
- package/dist/studio/assets/{index-4_Ik85Ht.js → index-BE7o3PiB.js} +1 -1
- package/dist/studio/assets/{index-D_16bAj5.js → index-BUqHnGfn.js} +1 -1
- package/dist/studio/assets/{index-KHDMp_I1.js → index-BZ2guaof.js} +1 -1
- package/dist/studio/assets/{index-LXhqob7C.js → index-Bkm8qH7s.js} +1 -1
- package/dist/studio/assets/{index-DwEamA0U.js → index-C7IsJnvT.js} +1 -1
- package/dist/studio/assets/{index-Bc9rX-7c.js → index-C7berX13.js} +1 -1
- package/dist/studio/assets/{index-D5uCDzsS.js → index-CDqcm89i.js} +1 -1
- package/dist/studio/assets/{index-PU4ugcf9.js → index-CJR663RP.js} +1 -1
- package/dist/studio/assets/{index-COoGgUOZ.js → index-CPbIKl2O.js} +1 -1
- package/dist/studio/assets/{index-CIn1DToR.js → index-CwtzGcX6.js} +1 -1
- package/dist/studio/assets/{index-CPMi1jKv.js → index-DMWDu6p5.js} +1 -1
- package/dist/studio/assets/{index-DGluHyCE.js → index-DO5-7i6U.js} +1 -1
- package/dist/studio/assets/{index-OAeTVwC0.js → index-DP7rC8MQ.js} +1 -1
- package/dist/studio/assets/{index-D5ulcR11.js → index-DXcOHFrD.js} +1 -1
- package/dist/studio/assets/{index-DJx1oNAb.js → index-DZfU8Y2-.js} +1 -1
- package/dist/studio/assets/{index-DX5sDTqD.js → index-MdSpMKbY.js} +1 -1
- package/dist/studio/assets/{index-CMVJaqiP.js → index-pgqit8rD.js} +1 -1
- package/dist/studio/assets/{index-BxIhR0sk.js → index-qMPnG_n4.js} +1 -1
- package/dist/studio/assets/{main-D5pkQoxh.js → main-CQxK--X8.js} +7 -7
- package/dist/studio/assets/{token-6GSAFR2W-XRCSVUPZ-Dnx2wjug.js → token-6GSAFR2W-XRCSVUPZ-B4Fg5eyh.js} +1 -1
- package/dist/studio/assets/{token-6GSAFR2W-XRCSVUPZ-Cgcu7avO-AoVeMya1.js → token-6GSAFR2W-XRCSVUPZ-Cgcu7avO-D6Vznyz8.js} +1 -1
- package/dist/studio/assets/token-util-NEHG7TUY-U7CX7GS4-BB_HxchF.js +1 -0
- package/dist/studio/assets/token-util-NEHG7TUY-U7CX7GS4-jJSXEovt-CDa3jFU6.js +1 -0
- package/dist/studio/index.html +1 -1
- package/package.json +9 -9
- package/versions.json +1 -1
- package/dist/studio/assets/token-util-NEHG7TUY-U7CX7GS4-cB-RmVGp.js +0 -1
- package/dist/studio/assets/token-util-NEHG7TUY-U7CX7GS4-jJSXEovt-01TIrA_-.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{_ as Ze}from"./index-CMVJaqiP.js";function DFe(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 A3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cz={exports:{}},_C={};var mxe;function kEt(){if(mxe)return _C;mxe=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 _C.Fragment=t,_C.jsx=r,_C.jsxs=r,_C}var gxe;function OEt(){return gxe||(gxe=1,cz.exports=kEt()),cz.exports}var u=OEt(),uz={exports:{}},xn={},yxe;function CEt(){if(yxe)return xn;yxe=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"),c=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 g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,v={};function w(U,N,Z){this.props=U,this.context=N,this.refs=v,this.updater=Z||g}w.prototype.isReactComponent={},w.prototype.setState=function(U,N){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,N,"setState")},w.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function S(){}S.prototype=w.prototype;function _(U,N,Z){this.props=U,this.context=N,this.refs=v,this.updater=Z||g}var O=_.prototype=new S;O.constructor=_,b(O,w.prototype),O.isPureReactComponent=!0;var C=Array.isArray;function T(){}var A={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function R(U,N,Z){var G=Z.ref;return{$$typeof:t,type:U,key:N,ref:G!==void 0?G:null,props:Z}}function P(U,N){return R(U.type,N,U.props)}function L(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function B(U){var N={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(Z){return N[Z]})}var M=/\/+/g;function z(U,N){return typeof U=="object"&&U!==null&&U.key!=null?B(""+U.key):N.toString(36)}function H(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(N){U.status==="pending"&&(U.status="fulfilled",U.value=N)},function(N){U.status==="pending"&&(U.status="rejected",U.reason=N)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function q(U,N,Z,G,K){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),N,Z,G,K)}}if(te)return K=K(U),te=G===""?"."+z(U,0):G,C(K)?(Z="",te!=null&&(Z=te.replace(M,"$&/")+"/"),q(K,N,Z,"",function(xe){return xe})):K!=null&&(L(K)&&(K=P(K,Z+(K.key==null||U&&U.key===K.key?"":(""+K.key).replace(M,"$&/")+"/")+te)),N.push(K)),1;te=0;var se=G===""?".":G+":";if(C(U))for(var ue=0;ue<U.length;ue++)G=U[ue],ee=se+z(G,ue),te+=q(G,N,Z,ee,K);else if(ue=m(U),typeof ue=="function")for(U=ue.call(U),ue=0;!(G=U.next()).done;)G=G.value,ee=se+z(G,ue++),te+=q(G,N,Z,ee,K);else if(ee==="object"){if(typeof U.then=="function")return q(H(U),N,Z,G,K);throw N=String(U),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.")}return te}function V(U,N,Z){if(U==null)return U;var G=[],K=0;return q(U,G,"","",function(ee){return N.call(Z,ee,K++)}),G}function Q(U){if(U._status===-1){var N=U._result;N=N(),N.then(function(Z){(U._status===0||U._status===-1)&&(U._status=1,U._result=Z)},function(Z){(U._status===0||U._status===-1)&&(U._status=2,U._result=Z)}),U._status===-1&&(U._status=0,U._result=N)}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 N=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(N))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",U);return}console.error(U)},X={map:V,forEach:function(U,N,Z){V(U,function(){N.apply(this,arguments)},Z)},count:function(U){var N=0;return V(U,function(){N++}),N},toArray:function(U){return V(U,function(N){return N})||[]},only:function(U){if(!L(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return xn.Activity=f,xn.Children=X,xn.Component=w,xn.Fragment=n,xn.Profiler=a,xn.PureComponent=_,xn.StrictMode=s,xn.Suspense=c,xn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,xn.__COMPILER_RUNTIME={__proto__:null,c:function(U){return A.H.useMemoCache(U)}},xn.cache=function(U){return function(){return U.apply(null,arguments)}},xn.cacheSignal=function(){return null},xn.cloneElement=function(U,N,Z){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var G=b({},U.props),K=U.key;if(N!=null)for(ee in N.key!==void 0&&(K=""+N.key),N)!I.call(N,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&N.ref===void 0||(G[ee]=N[ee]);var ee=arguments.length-2;if(ee===1)G.children=Z;else if(1<ee){for(var te=Array(ee),se=0;se<ee;se++)te[se]=arguments[se+2];G.children=te}return R(U.type,K,G)},xn.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},xn.createElement=function(U,N,Z){var G,K={},ee=null;if(N!=null)for(G in N.key!==void 0&&(ee=""+N.key),N)I.call(N,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(K[G]=N[G]);var te=arguments.length-2;if(te===1)K.children=Z;else if(1<te){for(var se=Array(te),ue=0;ue<te;ue++)se[ue]=arguments[ue+2];K.children=se}if(U&&U.defaultProps)for(G in te=U.defaultProps,te)K[G]===void 0&&(K[G]=te[G]);return R(U,ee,K)},xn.createRef=function(){return{current:null}},xn.forwardRef=function(U){return{$$typeof:l,render:U}},xn.isValidElement=L,xn.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:Q}},xn.memo=function(U,N){return{$$typeof:d,type:U,compare:N===void 0?null:N}},xn.startTransition=function(U){var N=A.T,Z={};A.T=Z;try{var G=U(),K=A.S;K!==null&&K(Z,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,$)}catch(ee){$(ee)}finally{N!==null&&Z.types!==null&&(N.types=Z.types),A.T=N}},xn.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},xn.use=function(U){return A.H.use(U)},xn.useActionState=function(U,N,Z){return A.H.useActionState(U,N,Z)},xn.useCallback=function(U,N){return A.H.useCallback(U,N)},xn.useContext=function(U){return A.H.useContext(U)},xn.useDebugValue=function(){},xn.useDeferredValue=function(U,N){return A.H.useDeferredValue(U,N)},xn.useEffect=function(U,N){return A.H.useEffect(U,N)},xn.useEffectEvent=function(U){return A.H.useEffectEvent(U)},xn.useId=function(){return A.H.useId()},xn.useImperativeHandle=function(U,N,Z){return A.H.useImperativeHandle(U,N,Z)},xn.useInsertionEffect=function(U,N){return A.H.useInsertionEffect(U,N)},xn.useLayoutEffect=function(U,N){return A.H.useLayoutEffect(U,N)},xn.useMemo=function(U,N){return A.H.useMemo(U,N)},xn.useOptimistic=function(U,N){return A.H.useOptimistic(U,N)},xn.useReducer=function(U,N,Z){return A.H.useReducer(U,N,Z)},xn.useRef=function(U){return A.H.useRef(U)},xn.useState=function(U){return A.H.useState(U)},xn.useSyncExternalStore=function(U,N,Z){return A.H.useSyncExternalStore(U,N,Z)},xn.useTransition=function(){return A.H.useTransition()},xn.version="19.2.3",xn}var bxe;function zk(){return bxe||(bxe=1,uz.exports=CEt()),uz.exports}var E=zk();const Ee=cf(E),Uk=DFe({__proto__:null,default:Ee},[E]);var dz={exports:{}},kC={},pz={exports:{}},fz={};var vxe;function TEt(){return vxe||(vxe=1,(function(e){function t(H,q){var V=H.length;H.push(q);e:for(;0<V;){var Q=V-1>>>1,$=H[Q];if(0<s($,q))H[Q]=q,H[V]=$,V=Q;else break e}}function r(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var q=H[0],V=H.pop();if(V!==q){H[0]=V;e:for(var Q=0,$=H.length,X=$>>>1;Q<X;){var U=2*(Q+1)-1,N=H[U],Z=U+1,G=H[Z];if(0>s(N,V))Z<$&&0>s(G,N)?(H[Q]=G,H[Z]=V,Q=Z):(H[Q]=N,H[U]=V,Q=U);else if(Z<$&&0>s(G,V))H[Q]=G,H[Z]=V,Q=Z;else break e}}return q}function s(H,q){var V=H.sortIndex-q.sortIndex;return V!==0?V:H.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=[],c=[],d=1,p=null,f=3,h=!1,m=!1,g=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function _(H){for(var q=r(c);q!==null;){if(q.callback===null)n(c);else if(q.startTime<=H)n(c),q.sortIndex=q.expirationTime,t(l,q);else break;q=r(c)}}function O(H){if(g=!1,_(H),!m)if(r(l)!==null)m=!0,C||(C=!0,L());else{var q=r(c);q!==null&&z(O,q.startTime-H)}}var C=!1,T=-1,A=5,I=-1;function R(){return b?!0:!(e.unstable_now()-I<A)}function P(){if(b=!1,C){var H=e.unstable_now();I=H;var q=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),h=!0;var V=f;try{t:{for(_(H),p=r(l);p!==null&&!(p.expirationTime>H&&R());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,f=p.priorityLevel;var $=Q(p.expirationTime<=H);if(H=e.unstable_now(),typeof $=="function"){p.callback=$,_(H),q=!0;break t}p===r(l)&&n(l),_(H)}else n(l);p=r(l)}if(p!==null)q=!0;else{var X=r(c);X!==null&&z(O,X.startTime-H),q=!1}}break e}finally{p=null,f=V,h=!1}q=void 0}}finally{q?L():C=!1}}}var L;if(typeof S=="function")L=function(){S(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,M=B.port2;B.port1.onmessage=P,L=function(){M.postMessage(null)}}else L=function(){v(P,0)};function z(H,q){T=v(function(){H(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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(H){switch(f){case 1:case 2:case 3:var q=3;break;default:q=f}var V=f;f=q;try{return H()}finally{f=V}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(H,q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var V=f;f=H;try{return q()}finally{f=V}},e.unstable_scheduleCallback=function(H,q,V){var Q=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?Q+V:Q):V=Q,H){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=V+$,H={id:d++,callback:q,priorityLevel:H,startTime:V,expirationTime:$,sortIndex:-1},V>Q?(H.sortIndex=V,t(c,H),r(l)===null&&H===r(c)&&(g?(w(T),T=-1):g=!0,z(O,V-Q))):(H.sortIndex=$,t(l,H),m||h||(m=!0,C||(C=!0,L()))),H},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(H){var q=f;return function(){var V=f;f=q;try{return H.apply(this,arguments)}finally{f=V}}}})(fz)),fz}var xxe;function AEt(){return xxe||(xxe=1,pz.exports=TEt()),pz.exports}var hz={exports:{}},Gl={};var wxe;function DEt(){if(wxe)return Gl;wxe=1;var e=zk();function t(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+l+"; visit "+c+" 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,c,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:l,containerInfo:c,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(l,c){if(l==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return Gl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Gl.createPortal=function(l,c){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(t(299));return a(l,c,null,d)},Gl.flushSync=function(l){var c=i.T,d=n.p;try{if(i.T=null,n.p=2,l)return l()}finally{i.T=c,n.p=d,n.d.f()}},Gl.preconnect=function(l,c){typeof l=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,n.d.C(l,c))},Gl.prefetchDNS=function(l){typeof l=="string"&&n.d.D(l)},Gl.preinit=function(l,c){if(typeof l=="string"&&c&&typeof c.as=="string"){var d=c.as,p=o(d,c.crossOrigin),f=typeof c.integrity=="string"?c.integrity:void 0,h=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;d==="style"?n.d.S(l,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:p,integrity:f,fetchPriority:h}):d==="script"&&n.d.X(l,{crossOrigin:p,integrity:f,fetchPriority:h,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},Gl.preinitModule=function(l,c){if(typeof l=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var d=o(c.as,c.crossOrigin);n.d.M(l,{crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&n.d.M(l)},Gl.preload=function(l,c){if(typeof l=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var d=c.as,p=o(d,c.crossOrigin);n.d.L(l,d,{crossOrigin:p,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},Gl.preloadModule=function(l,c){if(typeof l=="string")if(c){var d=o(c.as,c.crossOrigin);n.d.m(l,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else n.d.m(l)},Gl.requestFormReset=function(l){n.d.r(l)},Gl.unstable_batchedUpdates=function(l,c){return l(c)},Gl.useFormState=function(l,c,d){return i.H.useFormState(l,c,d)},Gl.useFormStatus=function(){return i.H.useHostTransitionStatus()},Gl.version="19.2.3",Gl}var Sxe;function IFe(){if(Sxe)return hz.exports;Sxe=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(),hz.exports=DEt(),hz.exports}var Exe;function IEt(){if(Exe)return kC;Exe=1;var e={env:{}};var t=AEt(),r=zk(),n=IFe();function s(y){var x="https://react.dev/errors/"+y;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)x+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+y+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(y){return!(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)}function i(y){var x=y,k=y;if(y.alternate)for(;x.return;)x=x.return;else{y=x;do x=y,(x.flags&4098)!==0&&(k=x.return),y=x.return;while(y)}return x.tag===3?k:null}function o(y){if(y.tag===13){var x=y.memoizedState;if(x===null&&(y=y.alternate,y!==null&&(x=y.memoizedState)),x!==null)return x.dehydrated}return null}function l(y){if(y.tag===31){var x=y.memoizedState;if(x===null&&(y=y.alternate,y!==null&&(x=y.memoizedState)),x!==null)return x.dehydrated}return null}function c(y){if(i(y)!==y)throw Error(s(188))}function d(y){var x=y.alternate;if(!x){if(x=i(y),x===null)throw Error(s(188));return x!==y?null:y}for(var k=y,D=x;;){var j=k.return;if(j===null)break;var F=j.alternate;if(F===null){if(D=j.return,D!==null){k=D;continue}break}if(j.child===F.child){for(F=j.child;F;){if(F===k)return c(j),y;if(F===D)return c(j),x;F=F.sibling}throw Error(s(188))}if(k.return!==D.return)k=j,D=F;else{for(var Y=!1,ie=j.child;ie;){if(ie===k){Y=!0,k=j,D=F;break}if(ie===D){Y=!0,D=j,k=F;break}ie=ie.sibling}if(!Y){for(ie=F.child;ie;){if(ie===k){Y=!0,k=F,D=j;break}if(ie===D){Y=!0,D=F,k=j;break}ie=ie.sibling}if(!Y)throw Error(s(189))}}if(k.alternate!==D)throw Error(s(190))}if(k.tag!==3)throw Error(s(188));return k.stateNode.current===k?y:x}function p(y){var x=y.tag;if(x===5||x===26||x===27||x===6)return y;for(y=y.child;y!==null;){if(x=p(y),x!==null)return x;y=y.sibling}return null}var f=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),_=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function B(y){return y===null||typeof y!="object"?null:(y=L&&y[L]||y["@@iterator"],typeof y=="function"?y:null)}var M=Symbol.for("react.client.reference");function z(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===M?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case b:return"Fragment";case w:return"Profiler";case v:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList";case R:return"Activity"}if(typeof y=="object")switch(y.$$typeof){case g:return"Portal";case _:return y.displayName||"Context";case S:return(y._context.displayName||"Context")+".Consumer";case O:var x=y.render;return y=y.displayName,y||(y=x.displayName||x.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case A:return x=y.displayName||null,x!==null?x:z(y.type)||"Memo";case I:x=y._payload,y=y._init;try{return z(y(x))}catch{}}return null}var H=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,Q={pending:!1,data:null,method:null,action:null},$=[],X=-1;function U(y){return{current:y}}function N(y){0>X||(y.current=$[X],$[X]=null,X--)}function Z(y,x){X++,$[X]=y.current,y.current=x}var G=U(null),K=U(null),ee=U(null),te=U(null);function se(y,x){switch(Z(ee,x),Z(K,y),Z(G,null),x.nodeType){case 9:case 11:y=(y=x.documentElement)&&(y=y.namespaceURI)?Lve(y):0;break;default:if(y=x.tagName,x=x.namespaceURI)x=Lve(x),y=Fve(x,y);else switch(y){case"svg":y=1;break;case"math":y=2;break;default:y=0}}N(G),Z(G,y)}function ue(){N(G),N(K),N(ee)}function xe(y){y.memoizedState!==null&&Z(te,y);var x=G.current,k=Fve(x,y.type);x!==k&&(Z(K,y),Z(G,k))}function W(y){K.current===y&&(N(G),N(K)),te.current===y&&(N(te),xC._currentValue=Q)}var ae,ne;function ye(y){if(ae===void 0)try{throw Error()}catch(k){var x=k.stack.trim().match(/\n( *(at )?)/);ae=x&&x[1]||"",ne=-1<k.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CDqcm89i.js","./index-pgqit8rD.js","./index-MdSpMKbY.js","./index-BE7o3PiB.js","./index-DMWDu6p5.js","./index-Bkm8qH7s.js","./index-qMPnG_n4.js","./index-DP7rC8MQ.js","./index-CPbIKl2O.js","./index-C7IsJnvT.js","./index-CwtzGcX6.js","./index-DZfU8Y2-.js","./index-DO5-7i6U.js","./index-C7berX13.js","./index-BUqHnGfn.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-BZ2guaof.js","./index-DXcOHFrD.js","./token-util-NEHG7TUY-U7CX7GS4-jJSXEovt-CDa3jFU6.js","./chunk-REDZDNFN-TfJ4yMVk-CU645_ff.js","./token-6GSAFR2W-XRCSVUPZ-Cgcu7avO-D6Vznyz8.js","./token-util-NEHG7TUY-U7CX7GS4-BB_HxchF.js","./chunk-REDZDNFN-DWLxgtan.js","./token-6GSAFR2W-XRCSVUPZ-B4Fg5eyh.js","./index-CJR663RP.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Ze}from"./index-pgqit8rD.js";function DFe(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 A3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cz={exports:{}},_C={};var mxe;function kEt(){if(mxe)return _C;mxe=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 _C.Fragment=t,_C.jsx=r,_C.jsxs=r,_C}var gxe;function OEt(){return gxe||(gxe=1,cz.exports=kEt()),cz.exports}var u=OEt(),uz={exports:{}},xn={},yxe;function CEt(){if(yxe)return xn;yxe=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"),c=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 g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,v={};function w(U,N,Z){this.props=U,this.context=N,this.refs=v,this.updater=Z||g}w.prototype.isReactComponent={},w.prototype.setState=function(U,N){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,N,"setState")},w.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function S(){}S.prototype=w.prototype;function _(U,N,Z){this.props=U,this.context=N,this.refs=v,this.updater=Z||g}var O=_.prototype=new S;O.constructor=_,b(O,w.prototype),O.isPureReactComponent=!0;var C=Array.isArray;function T(){}var A={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function R(U,N,Z){var G=Z.ref;return{$$typeof:t,type:U,key:N,ref:G!==void 0?G:null,props:Z}}function P(U,N){return R(U.type,N,U.props)}function L(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function B(U){var N={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(Z){return N[Z]})}var M=/\/+/g;function z(U,N){return typeof U=="object"&&U!==null&&U.key!=null?B(""+U.key):N.toString(36)}function H(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(N){U.status==="pending"&&(U.status="fulfilled",U.value=N)},function(N){U.status==="pending"&&(U.status="rejected",U.reason=N)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function q(U,N,Z,G,K){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),N,Z,G,K)}}if(te)return K=K(U),te=G===""?"."+z(U,0):G,C(K)?(Z="",te!=null&&(Z=te.replace(M,"$&/")+"/"),q(K,N,Z,"",function(xe){return xe})):K!=null&&(L(K)&&(K=P(K,Z+(K.key==null||U&&U.key===K.key?"":(""+K.key).replace(M,"$&/")+"/")+te)),N.push(K)),1;te=0;var se=G===""?".":G+":";if(C(U))for(var ue=0;ue<U.length;ue++)G=U[ue],ee=se+z(G,ue),te+=q(G,N,Z,ee,K);else if(ue=m(U),typeof ue=="function")for(U=ue.call(U),ue=0;!(G=U.next()).done;)G=G.value,ee=se+z(G,ue++),te+=q(G,N,Z,ee,K);else if(ee==="object"){if(typeof U.then=="function")return q(H(U),N,Z,G,K);throw N=String(U),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.")}return te}function V(U,N,Z){if(U==null)return U;var G=[],K=0;return q(U,G,"","",function(ee){return N.call(Z,ee,K++)}),G}function Q(U){if(U._status===-1){var N=U._result;N=N(),N.then(function(Z){(U._status===0||U._status===-1)&&(U._status=1,U._result=Z)},function(Z){(U._status===0||U._status===-1)&&(U._status=2,U._result=Z)}),U._status===-1&&(U._status=0,U._result=N)}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 N=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(N))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",U);return}console.error(U)},X={map:V,forEach:function(U,N,Z){V(U,function(){N.apply(this,arguments)},Z)},count:function(U){var N=0;return V(U,function(){N++}),N},toArray:function(U){return V(U,function(N){return N})||[]},only:function(U){if(!L(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return xn.Activity=f,xn.Children=X,xn.Component=w,xn.Fragment=n,xn.Profiler=a,xn.PureComponent=_,xn.StrictMode=s,xn.Suspense=c,xn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,xn.__COMPILER_RUNTIME={__proto__:null,c:function(U){return A.H.useMemoCache(U)}},xn.cache=function(U){return function(){return U.apply(null,arguments)}},xn.cacheSignal=function(){return null},xn.cloneElement=function(U,N,Z){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var G=b({},U.props),K=U.key;if(N!=null)for(ee in N.key!==void 0&&(K=""+N.key),N)!I.call(N,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&N.ref===void 0||(G[ee]=N[ee]);var ee=arguments.length-2;if(ee===1)G.children=Z;else if(1<ee){for(var te=Array(ee),se=0;se<ee;se++)te[se]=arguments[se+2];G.children=te}return R(U.type,K,G)},xn.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},xn.createElement=function(U,N,Z){var G,K={},ee=null;if(N!=null)for(G in N.key!==void 0&&(ee=""+N.key),N)I.call(N,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(K[G]=N[G]);var te=arguments.length-2;if(te===1)K.children=Z;else if(1<te){for(var se=Array(te),ue=0;ue<te;ue++)se[ue]=arguments[ue+2];K.children=se}if(U&&U.defaultProps)for(G in te=U.defaultProps,te)K[G]===void 0&&(K[G]=te[G]);return R(U,ee,K)},xn.createRef=function(){return{current:null}},xn.forwardRef=function(U){return{$$typeof:l,render:U}},xn.isValidElement=L,xn.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:Q}},xn.memo=function(U,N){return{$$typeof:d,type:U,compare:N===void 0?null:N}},xn.startTransition=function(U){var N=A.T,Z={};A.T=Z;try{var G=U(),K=A.S;K!==null&&K(Z,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,$)}catch(ee){$(ee)}finally{N!==null&&Z.types!==null&&(N.types=Z.types),A.T=N}},xn.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},xn.use=function(U){return A.H.use(U)},xn.useActionState=function(U,N,Z){return A.H.useActionState(U,N,Z)},xn.useCallback=function(U,N){return A.H.useCallback(U,N)},xn.useContext=function(U){return A.H.useContext(U)},xn.useDebugValue=function(){},xn.useDeferredValue=function(U,N){return A.H.useDeferredValue(U,N)},xn.useEffect=function(U,N){return A.H.useEffect(U,N)},xn.useEffectEvent=function(U){return A.H.useEffectEvent(U)},xn.useId=function(){return A.H.useId()},xn.useImperativeHandle=function(U,N,Z){return A.H.useImperativeHandle(U,N,Z)},xn.useInsertionEffect=function(U,N){return A.H.useInsertionEffect(U,N)},xn.useLayoutEffect=function(U,N){return A.H.useLayoutEffect(U,N)},xn.useMemo=function(U,N){return A.H.useMemo(U,N)},xn.useOptimistic=function(U,N){return A.H.useOptimistic(U,N)},xn.useReducer=function(U,N,Z){return A.H.useReducer(U,N,Z)},xn.useRef=function(U){return A.H.useRef(U)},xn.useState=function(U){return A.H.useState(U)},xn.useSyncExternalStore=function(U,N,Z){return A.H.useSyncExternalStore(U,N,Z)},xn.useTransition=function(){return A.H.useTransition()},xn.version="19.2.3",xn}var bxe;function zk(){return bxe||(bxe=1,uz.exports=CEt()),uz.exports}var E=zk();const Ee=cf(E),Uk=DFe({__proto__:null,default:Ee},[E]);var dz={exports:{}},kC={},pz={exports:{}},fz={};var vxe;function TEt(){return vxe||(vxe=1,(function(e){function t(H,q){var V=H.length;H.push(q);e:for(;0<V;){var Q=V-1>>>1,$=H[Q];if(0<s($,q))H[Q]=q,H[V]=$,V=Q;else break e}}function r(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var q=H[0],V=H.pop();if(V!==q){H[0]=V;e:for(var Q=0,$=H.length,X=$>>>1;Q<X;){var U=2*(Q+1)-1,N=H[U],Z=U+1,G=H[Z];if(0>s(N,V))Z<$&&0>s(G,N)?(H[Q]=G,H[Z]=V,Q=Z):(H[Q]=N,H[U]=V,Q=U);else if(Z<$&&0>s(G,V))H[Q]=G,H[Z]=V,Q=Z;else break e}}return q}function s(H,q){var V=H.sortIndex-q.sortIndex;return V!==0?V:H.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=[],c=[],d=1,p=null,f=3,h=!1,m=!1,g=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function _(H){for(var q=r(c);q!==null;){if(q.callback===null)n(c);else if(q.startTime<=H)n(c),q.sortIndex=q.expirationTime,t(l,q);else break;q=r(c)}}function O(H){if(g=!1,_(H),!m)if(r(l)!==null)m=!0,C||(C=!0,L());else{var q=r(c);q!==null&&z(O,q.startTime-H)}}var C=!1,T=-1,A=5,I=-1;function R(){return b?!0:!(e.unstable_now()-I<A)}function P(){if(b=!1,C){var H=e.unstable_now();I=H;var q=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),h=!0;var V=f;try{t:{for(_(H),p=r(l);p!==null&&!(p.expirationTime>H&&R());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,f=p.priorityLevel;var $=Q(p.expirationTime<=H);if(H=e.unstable_now(),typeof $=="function"){p.callback=$,_(H),q=!0;break t}p===r(l)&&n(l),_(H)}else n(l);p=r(l)}if(p!==null)q=!0;else{var X=r(c);X!==null&&z(O,X.startTime-H),q=!1}}break e}finally{p=null,f=V,h=!1}q=void 0}}finally{q?L():C=!1}}}var L;if(typeof S=="function")L=function(){S(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,M=B.port2;B.port1.onmessage=P,L=function(){M.postMessage(null)}}else L=function(){v(P,0)};function z(H,q){T=v(function(){H(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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(H){switch(f){case 1:case 2:case 3:var q=3;break;default:q=f}var V=f;f=q;try{return H()}finally{f=V}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(H,q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var V=f;f=H;try{return q()}finally{f=V}},e.unstable_scheduleCallback=function(H,q,V){var Q=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?Q+V:Q):V=Q,H){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=V+$,H={id:d++,callback:q,priorityLevel:H,startTime:V,expirationTime:$,sortIndex:-1},V>Q?(H.sortIndex=V,t(c,H),r(l)===null&&H===r(c)&&(g?(w(T),T=-1):g=!0,z(O,V-Q))):(H.sortIndex=$,t(l,H),m||h||(m=!0,C||(C=!0,L()))),H},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(H){var q=f;return function(){var V=f;f=q;try{return H.apply(this,arguments)}finally{f=V}}}})(fz)),fz}var xxe;function AEt(){return xxe||(xxe=1,pz.exports=TEt()),pz.exports}var hz={exports:{}},Gl={};var wxe;function DEt(){if(wxe)return Gl;wxe=1;var e=zk();function t(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+l+"; visit "+c+" 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,c,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:l,containerInfo:c,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(l,c){if(l==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return Gl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Gl.createPortal=function(l,c){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(t(299));return a(l,c,null,d)},Gl.flushSync=function(l){var c=i.T,d=n.p;try{if(i.T=null,n.p=2,l)return l()}finally{i.T=c,n.p=d,n.d.f()}},Gl.preconnect=function(l,c){typeof l=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,n.d.C(l,c))},Gl.prefetchDNS=function(l){typeof l=="string"&&n.d.D(l)},Gl.preinit=function(l,c){if(typeof l=="string"&&c&&typeof c.as=="string"){var d=c.as,p=o(d,c.crossOrigin),f=typeof c.integrity=="string"?c.integrity:void 0,h=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;d==="style"?n.d.S(l,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:p,integrity:f,fetchPriority:h}):d==="script"&&n.d.X(l,{crossOrigin:p,integrity:f,fetchPriority:h,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},Gl.preinitModule=function(l,c){if(typeof l=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var d=o(c.as,c.crossOrigin);n.d.M(l,{crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&n.d.M(l)},Gl.preload=function(l,c){if(typeof l=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var d=c.as,p=o(d,c.crossOrigin);n.d.L(l,d,{crossOrigin:p,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},Gl.preloadModule=function(l,c){if(typeof l=="string")if(c){var d=o(c.as,c.crossOrigin);n.d.m(l,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else n.d.m(l)},Gl.requestFormReset=function(l){n.d.r(l)},Gl.unstable_batchedUpdates=function(l,c){return l(c)},Gl.useFormState=function(l,c,d){return i.H.useFormState(l,c,d)},Gl.useFormStatus=function(){return i.H.useHostTransitionStatus()},Gl.version="19.2.3",Gl}var Sxe;function IFe(){if(Sxe)return hz.exports;Sxe=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(),hz.exports=DEt(),hz.exports}var Exe;function IEt(){if(Exe)return kC;Exe=1;var e={env:{}};var t=AEt(),r=zk(),n=IFe();function s(y){var x="https://react.dev/errors/"+y;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)x+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+y+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(y){return!(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)}function i(y){var x=y,k=y;if(y.alternate)for(;x.return;)x=x.return;else{y=x;do x=y,(x.flags&4098)!==0&&(k=x.return),y=x.return;while(y)}return x.tag===3?k:null}function o(y){if(y.tag===13){var x=y.memoizedState;if(x===null&&(y=y.alternate,y!==null&&(x=y.memoizedState)),x!==null)return x.dehydrated}return null}function l(y){if(y.tag===31){var x=y.memoizedState;if(x===null&&(y=y.alternate,y!==null&&(x=y.memoizedState)),x!==null)return x.dehydrated}return null}function c(y){if(i(y)!==y)throw Error(s(188))}function d(y){var x=y.alternate;if(!x){if(x=i(y),x===null)throw Error(s(188));return x!==y?null:y}for(var k=y,D=x;;){var j=k.return;if(j===null)break;var F=j.alternate;if(F===null){if(D=j.return,D!==null){k=D;continue}break}if(j.child===F.child){for(F=j.child;F;){if(F===k)return c(j),y;if(F===D)return c(j),x;F=F.sibling}throw Error(s(188))}if(k.return!==D.return)k=j,D=F;else{for(var Y=!1,ie=j.child;ie;){if(ie===k){Y=!0,k=j,D=F;break}if(ie===D){Y=!0,D=j,k=F;break}ie=ie.sibling}if(!Y){for(ie=F.child;ie;){if(ie===k){Y=!0,k=F,D=j;break}if(ie===D){Y=!0,D=F,k=j;break}ie=ie.sibling}if(!Y)throw Error(s(189))}}if(k.alternate!==D)throw Error(s(190))}if(k.tag!==3)throw Error(s(188));return k.stateNode.current===k?y:x}function p(y){var x=y.tag;if(x===5||x===26||x===27||x===6)return y;for(y=y.child;y!==null;){if(x=p(y),x!==null)return x;y=y.sibling}return null}var f=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),_=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function B(y){return y===null||typeof y!="object"?null:(y=L&&y[L]||y["@@iterator"],typeof y=="function"?y:null)}var M=Symbol.for("react.client.reference");function z(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===M?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case b:return"Fragment";case w:return"Profiler";case v:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList";case R:return"Activity"}if(typeof y=="object")switch(y.$$typeof){case g:return"Portal";case _:return y.displayName||"Context";case S:return(y._context.displayName||"Context")+".Consumer";case O:var x=y.render;return y=y.displayName,y||(y=x.displayName||x.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case A:return x=y.displayName||null,x!==null?x:z(y.type)||"Memo";case I:x=y._payload,y=y._init;try{return z(y(x))}catch{}}return null}var H=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,Q={pending:!1,data:null,method:null,action:null},$=[],X=-1;function U(y){return{current:y}}function N(y){0>X||(y.current=$[X],$[X]=null,X--)}function Z(y,x){X++,$[X]=y.current,y.current=x}var G=U(null),K=U(null),ee=U(null),te=U(null);function se(y,x){switch(Z(ee,x),Z(K,y),Z(G,null),x.nodeType){case 9:case 11:y=(y=x.documentElement)&&(y=y.namespaceURI)?Lve(y):0;break;default:if(y=x.tagName,x=x.namespaceURI)x=Lve(x),y=Fve(x,y);else switch(y){case"svg":y=1;break;case"math":y=2;break;default:y=0}}N(G),Z(G,y)}function ue(){N(G),N(K),N(ee)}function xe(y){y.memoizedState!==null&&Z(te,y);var x=G.current,k=Fve(x,y.type);x!==k&&(Z(K,y),Z(G,k))}function W(y){K.current===y&&(N(G),N(K)),te.current===y&&(N(te),xC._currentValue=Q)}var ae,ne;function ye(y){if(ae===void 0)try{throw Error()}catch(k){var x=k.stack.trim().match(/\n( *(at )?)/);ae=x&&x[1]||"",ne=-1<k.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<k.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+ae+y+ne}var le=!1;function be(y,x){if(!y||le)return"";le=!0;var k=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(Ge){var Ue=Ge}Reflect.construct(y,[],at)}else{try{at.call()}catch(Ge){Ue=Ge}y.call(at.prototype)}}else{try{throw Error()}catch(Ge){Ue=Ge}(at=y())&&typeof at.catch=="function"&&at.catch(function(){})}}catch(Ge){if(Ge&&Ue&&typeof Ge.stack=="string")return[Ge.stack,Ue.stack]}return[null,null]}};D.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var j=Object.getOwnPropertyDescriptor(D.DetermineComponentFrameRoot,"name");j&&j.configurable&&Object.defineProperty(D.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var F=D.DetermineComponentFrameRoot(),Y=F[0],ie=F[1];if(Y&&ie){var ve=Y.split(`
|
|
5
5
|
`),Fe=ie.split(`
|
|
@@ -160,7 +160,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
160
160
|
constructor(\${params}) {
|
|
161
161
|
\${}
|
|
162
162
|
}
|
|
163
|
-
}`,{label:"class",detail:"definition",type:"keyword"}),au('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),au('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],QXe=Aue.concat([au("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),au("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),au("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),tDe=new YGe,WXe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function FC(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const Ssr=["FunctionDeclaration"],Esr={FunctionDeclaration:FC("function"),ClassDeclaration:FC("class"),ClassExpression:()=>!0,EnumDeclaration:FC("constant"),TypeAliasDeclaration:FC("type"),NamespaceDeclaration:FC("namespace"),VariableDefinition(e,t){e.matchContext(Ssr)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function XXe(e,t){let r=tDe.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(na.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let o=Esr[i.name];if(o&&o(i,a)||WXe.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of XXe(e,i.node))n.push(o);return!1}}),tDe.set(t,n),n}const O4=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Due=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function YXe(e){let t=Ca(e.state).resolveInner(e.pos,-1);if(Due.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&O4.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)WXe.has(s.name)&&(n=n.concat(XXe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:O4}}function fW(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 KXe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Ca(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?fW(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?fW(t,r.parent,""):Due.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&O4.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?fW(t,r,""):e.explicit?{path:[],name:""}:null}function _sr(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 ksr(e){let t=new Map;return r=>{let n=KXe(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=_sr(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:O4}}}const Up=k1.define({name:"javascript",parser:wsr.configure({props:[vw.add({IfStatement:QE({except:/^\s*({|else\b)/}),TryStatement:QE({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:wer,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:xer({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":QE({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}}),xw.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":lue,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),JXe={test:e=>/^JSX/.test(e.name),facet:B6({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Iue=Up.configure({dialect:"ts"},"typescript"),Nue=Up.configure({dialect:"jsx",props:[aue.add(e=>e.isTop?[JXe]:void 0)]}),Rue=Up.configure({dialect:"jsx ts",props:[aue.add(e=>e.isTop?[JXe]:void 0)]},"typescript");let eYe=e=>({label:e,type:"keyword"});const tYe="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(eYe),Osr=tYe.concat(["declare","implements","private","protected","public"].map(eYe));function C4(e={}){let t=e.jsx?e.typescript?Rue:Nue:e.typescript?Iue:Up,r=e.typescript?QXe.concat(Osr):Aue.concat(tYe);return new C1(t,[Up.data.of({autocomplete:itr(Due,WWe(r))}),Up.data.of({autocomplete:YXe}),e.jsx?rYe:[]])}function Csr(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 rDe(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 Tsr=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),rYe=gt.inputHandler.of((e,t,r,n,s)=>{if((Tsr?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!Up.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(l=>{var c;let{head:d}=l,p=Ca(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=rDe(i.doc,m.firstChild,d))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let g=`${f}>`;return{range:Ke.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(n==">"){let h=Csr(p);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(f=rDe(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 Asr(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 Up.findRegions(n)){let o=n.doc.lineAt(a),l={line:o.number-1,col:a-o.from,pos:a};for(let c of e.verify(n.sliceDoc(a,i),t))s.push(Dsr(c,n.doc,l))}return s}}function nDe(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function Dsr(e,t,r){let n=nDe(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?nDe(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(c,d){c.dispatch({changes:{from:d+o,to:d+l,insert:i},scrollIntoView:!0})}}]}return s}const Wj=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:rYe,completionPath:KXe,esLint:Asr,javascript:C4,javascriptLanguage:Up,jsxLanguage:Nue,localCompletionSource:YXe,scopeCompletionSource:ksr,snippets:Aue,tsxLanguage:Rue,typescriptLanguage:Iue,typescriptSnippets:QXe},Symbol.toStringTag,{value:"Module"})),BC=["_blank","_self","_top","_parent"],hW=["ascii","utf-8","utf-16","latin1","latin1"],mW=["get","post","put","delete"],gW=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ad=["true","false"],Nr={},Isr={a:{attrs:{href:null,ping:null,type:null,media:null,target:BC,hreflang:null}},abbr:Nr,address:Nr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Nr,aside:Nr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Nr,base:{attrs:{href:null,target:BC}},bdi:Nr,bdo:Nr,blockquote:{attrs:{cite:null}},body:Nr,br:Nr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:gW,formmethod:mW,formnovalidate:["novalidate"],formtarget:BC,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Nr,center:Nr,cite:Nr,code:Nr,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:Nr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Nr,div:Nr,dl:Nr,dt:Nr,em:Nr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Nr,figure:Nr,footer:Nr,form:{attrs:{action:null,name:null,"accept-charset":hW,autocomplete:["on","off"],enctype:gW,method:mW,novalidate:["novalidate"],target:BC}},h1:Nr,h2:Nr,h3:Nr,h4:Nr,h5:Nr,h6:Nr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Nr,hgroup:Nr,hr:Nr,html:{attrs:{manifest:null}},i:Nr,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:gW,formmethod:mW,formnovalidate:["novalidate"],formtarget:BC,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:Nr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Nr,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:Nr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:hW,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:Nr,noscript:Nr,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:Nr,param:{attrs:{name:null,value:null}},pre:Nr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Nr,rt:Nr,ruby:Nr,samp:Nr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:hW}},section:Nr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Nr,source:{attrs:{src:null,type:null,media:null}},span:Nr,strong:Nr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Nr,summary:Nr,sup:Nr,table:Nr,tbody:Nr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Nr,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:Nr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Nr,time:{attrs:{datetime:null}},title:Nr,tr:Nr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Nr,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:Nr},nYe={accesskey:null,class:null,contenteditable:ad,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:ad,autocorrect:ad,autocapitalize:ad,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":ad,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ad,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ad,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ad,"aria-hidden":ad,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ad,"aria-multiselectable":ad,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ad,"aria-relevant":null,"aria-required":ad,"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},sYe="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 sYe)nYe[e]=null;let KD=class{constructor(t,r){this.tags={...Isr,...t},this.globalAttrs={...nYe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};KD.default=new KD;function B_(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 z_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function aYe(e,t,r){let n=r.tags[B_(e,z_(t))];return n?.children||r.allTags}function Pue(e,t){let r=[];for(let n=z_(t);n&&!n.type.isTop;n=z_(n.parent)){let s=B_(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 iYe=/^[:\-\.\w\u00b7-\uffff]*$/;function sDe(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=z_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:aYe(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(Pue(e.doc,r).map((o,l)=>({label:"/"+o,apply:"/"+o+a,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function aDe(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Pue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:iYe}}function Nsr(e,t,r,n){let s=[],a=0;for(let i of aYe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Pue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Rsr(e,t,r,n,s){let a=z_(r),i=a?t.tags[B_(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(c=>({label:c,type:"property"})),validFor:iYe}}function Psr(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 c=e.sliceDoc(i.from,i.to),d=t.globalAttrs[c];if(!d){let p=z_(r),f=p?t.tags[B_(e.doc,p)]:null;d=f?.attrs&&f.attrs[c]}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 oYe(e,t){let{state:r,pos:n}=t,s=Ca(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)?aDe(r,s,s.from,n):sDe(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?sDe(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?aDe(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?Rsr(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?Psr(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?Nsr(r,e,s,n):null}function lYe(e){return oYe(KD.default,e)}function cYe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new KD(t,r):KD.default;return s=>oYe(n,s)}const jsr=Up.parser.configure({top:"SingleExpression"}),uYe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Iue.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Nue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Rue.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:jsr},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:Up.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:YD.parser}],dYe=[{name:"style",parser:YD.parser.configure({top:"Styles"})}].concat(sYe.map(e=>({name:e,parser:Up.parser}))),pYe=k1.define({name:"html",parser:unr.configure({props:[vw.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}}),xw.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}}}),UWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),OA=pYe.configure({wrap:LXe(uYe,dYe)});function fYe(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=LXe((e.nestedLanguages||[]).concat(uYe),(e.nestedAttributes||[]).concat(dYe)));let n=r?pYe.configure({wrap:r,dialect:t}):t?OA.configure({dialect:t}):OA;return new C1(n,[OA.data.of({autocomplete:cYe(e)}),e.autoCloseTags!==!1?hYe:[],C4().support,ZXe().support])}const iDe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),hYe=gt.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!OA.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(l=>{var c,d,p;let f=i.doc.sliceString(l.from-1,l.to)==n,{head:h}=l,m=Ca(i).resolveInner(h,-1),g;if(f&&n==">"&&m.name=="EndTag"){let b=m.parent;if(((d=(c=b.parent)===null||c===void 0?void 0:c.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=B_(i.doc,b.parent,h))&&!iDe.has(g)){let v=h+(i.doc.sliceString(h,h+1)===">"?1:0),w=`</${g}>`;return{range:l,changes:{from:h,to:v,insert:w}}}}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"&&(g=B_(i.doc,b,h))&&!iDe.has(g)){let v=h+(i.doc.sliceString(h,h+1)===">"?1:0),w=`${g}>`;return{range:Ke.cursor(h+w.length,-1),changes:{from:h,to:v,insert:w}}}}return{range:l}});return o.changes.empty?!1:(e.dispatch([a,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),$sr=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:hYe,html:fYe,htmlCompletionSource:lYe,htmlCompletionSourceWith:cYe,htmlLanguage:OA},Symbol.toStringTag,{value:"Module"})),mYe=B6({commentTokens:{block:{open:"<!--",close:"-->"}}}),gYe=new fn,yYe=prr.configure({props:[xw.add(e=>!e.is("Block")||e.is("Document")||cre(e)!=null||Msr(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),gYe.add(cre),vw.add({Document:()=>null}),mv.add({Document:mYe})]});function cre(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Msr(e){return e.name=="OrderedList"||e.name=="BulletList"}function Lsr(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=cre(n.type))!=null&&s<=t)break;r=n}return r.to}const Fsr=DWe.of((e,t,r)=>{for(let n=Ca(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(gYe);if(s==null)continue;let a=Lsr(n,s);if(a>r)return{from:r,to:a}}return null});function jue(e){return new _d(mYe,e,[],"markdown")}const bYe=jue(yYe),Bsr=yYe.configure([Err,krr,_rr,Orr,{props:[xw.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),D1=jue(Bsr);function zsr(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:O1.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class yW{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(+xYe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function vYe(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 yW(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 c=i[3],d=i[0].length;c.length>=4&&(c=c.slice(0,c.length-4),d-=4),n.push(new yW(a.parent,l,l+d,i[1],c,i[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(l)))){let c=i[4],d=i[0].length;c.length>4&&(c=c.slice(0,c.length-4),d-=4);let p=i[2];i[3]&&(p+=i[3].replace(/[xX]/," ")),n.push(new yW(a.parent,l,l+d,i[1],c,p,a))}}return n}function xYe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function bW(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let o=xYe(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 $ue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(aO)!=" ")return e;let n=hh(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const wYe=(e={})=>({state:t,dispatch:r})=>{let n=Ca(t),{doc:s}=t,a=null,i=t.changeByRange(o=>{if(!o.empty||!D1.isActiveAt(t,o.from,-1)&&!D1.isActiveAt(t,o.from,1))return a={range:o};let l=o.from,c=s.lineAt(l),d=vYe(n.resolveInner(l,-1),s);for(;d.length&&d[d.length-1].from>l-c.from;)d.pop();if(!d.length)return a={range:o};let p=d[d.length-1];if(p.to-p.spaceAfter.length>l-c.from)return a={range:o};let f=l>=p.to-p.spaceAfter.length&&!/\S/.test(c.text.slice(p.to));if(p.item&&f){let v=p.node.firstChild,w=p.node.getChild("ListItem","ListItem");if(v.to>=l||w&&w.to<l||c.from>0&&!/[^\s>]/.test(s.lineAt(c.from-1).text)||e.nonTightLists===!1){let S=d.length>1?d[d.length-2]:null,_,O="";S&&S.item?(_=c.from+S.from,O=S.marker(s,1)):_=c.from+(S?S.to:0);let C=[{from:_,to:l,insert:O}];return p.node.name=="OrderedList"&&bW(p.item,s,C,-2),S&&S.node.name=="OrderedList"&&bW(S.item,s,C),{range:Ke.cursor(_+O.length),changes:C}}else{let S=lDe(d,t,c);return{range:Ke.cursor(l+S.length+1),changes:{from:c.from,insert:S+t.lineBreak}}}}if(p.node.name=="Blockquote"&&f&&c.from){let v=s.lineAt(c.from-1),w=/>\s*$/.exec(v.text);if(w&&w.index==p.from){let S=t.changes([{from:v.from+w.index,to:v.to},{from:c.from+p.from,to:c.to}]);return{range:o.map(S),changes:S}}}let h=[];p.node.name=="OrderedList"&&bW(p.item,s,h);let m=p.item&&p.item.from<c.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=p.to)for(let v=0,w=d.length-1;v<=w;v++)g+=v==w&&!m?d[v].marker(s,1):d[v].blank(v<w?hh(c.text,4,d[v+1].from)-g.length:null);let b=l;for(;b>c.from&&/\s/.test(c.text.charAt(b-c.from-1));)b--;return g=$ue(g,t),Usr(p.node,t.doc)&&(g=lDe(d,t,c)+t.lineBreak+g),h.push({from:b,to:l,insert:t.lineBreak+g}),{range:Ke.cursor(b+g.length+1),changes:h}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},SYe=wYe();function oDe(e){return e.name=="QuoteMark"||e.name=="ListMark"}function Usr(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 lDe(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?hh(r.text,4,e[s+1].from)-n.length:null,s<a);return $ue(n,t)}function Vsr(e,t){let r=e.resolveInner(t,-1),n=t;oDe(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(oDe(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const EYe=({state:e,dispatch:t})=>{let r=Ca(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:o}=e;if(a.empty&&D1.isActiveAt(e,a.from)){let l=o.lineAt(i),c=vYe(Vsr(r,i),o);if(c.length){let d=c[c.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:Ke.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(hh(l.text,4,d.to)-hh(l.text,4,d.from));return f==l.from&&(h=$ue(h,e)),{range:Ke.cursor(f+h.length),changes:{from:f,to:l.from+d.to,insert:h}}}if(f<i)return{range:Ke.cursor(f),changes:{from:f,to:i}}}}}return n={range:a}});return n?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},_Ye=[{key:"Enter",run:SYe},{key:"Backspace",run:EYe}],kYe=fYe({matchClosingTags:!1});function Mue(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=bYe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=kYe}=e;if(!(s instanceof q6))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=e.extensions?[e.extensions]:[],c=[o.support,Fsr],d;i&&c.push(OYe),r instanceof C1?(c.push(r.support),d=r.language):r&&(d=r);let p=t||d?zsr(t,d):void 0;l.push(hrr({codeParser:p,htmlParser:o.language.parser})),n&&c.push(Ch.high(sO.of(_Ye)));let f=jue(s.configure(l));return a&&c.push(f.data.of({autocomplete:qsr})),new C1(f,c)}function qsr(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=Ca(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:Hsr(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let vW=null;function Hsr(){if(vW)return vW;let e=lYe(new hue(Wn.create({extensions:kYe}),0,!0));return vW=e?e.options:[]}const Zsr=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,OYe=gt.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),!D1.isActiveAt(t.state,n.from,1)))return!1;let a=Ca(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:o=>{(o.from>n.from||Zsr.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)}}),Gsr=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:bYe,deleteMarkupBackward:EYe,insertNewlineContinueMarkup:SYe,insertNewlineContinueMarkupCommand:wYe,markdown:Mue,markdownKeymap:_Ye,markdownLanguage:D1,pasteURLAsLink:OYe},Symbol.toStringTag,{value:"Module"}));function ct(e){return new C1(uue.define(e))}function Rb(e){return Ze(()=>import("./index-D5uCDzsS.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const CYe=[He.of({name:"C",extensions:["c","h","ino"],load(){return Ze(()=>import("./index-DX5sDTqD.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 Ze(()=>import("./index-DX5sDTqD.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),He.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Rb("Cassandra")}}),He.of({name:"CSS",extensions:["css"],load(){return Ze(()=>Promise.resolve().then(()=>qnr),void 0,import.meta.url).then(e=>e.css())}}),He.of({name:"Go",extensions:["go"],load(){return Ze(()=>import("./index-4_Ik85Ht.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 Ze(()=>Promise.resolve().then(()=>$sr),void 0,import.meta.url).then(e=>e.html())}}),He.of({name:"Java",extensions:["java"],load(){return Ze(()=>import("./index-CPMi1jKv.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 Ze(()=>Promise.resolve().then(()=>Wj),void 0,import.meta.url).then(e=>e.javascript())}}),He.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ze(()=>import("./index-LXhqob7C.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),He.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ze(()=>Promise.resolve().then(()=>str),void 0,import.meta.url).then(e=>e.json())}}),He.of({name:"JSX",extensions:["jsx"],load(){return Ze(()=>Promise.resolve().then(()=>Wj),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),He.of({name:"LESS",extensions:["less"],load(){return Ze(()=>import("./index-BxIhR0sk.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),He.of({name:"Liquid",extensions:["liquid"],load(){return Ze(()=>import("./index-OAeTVwC0.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),He.of({name:"MariaDB SQL",load(){return Rb("MariaSQL")}}),He.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ze(()=>Promise.resolve().then(()=>Gsr),void 0,import.meta.url).then(e=>e.markdown())}}),He.of({name:"MS SQL",load(){return Rb("MSSQL")}}),He.of({name:"MySQL",load(){return Rb("MySQL")}}),He.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ze(()=>import("./index-COoGgUOZ.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),He.of({name:"PLSQL",extensions:["pls"],load(){return Rb("PLSQL")}}),He.of({name:"PostgreSQL",load(){return Rb("PostgreSQL")}}),He.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ze(()=>import("./index-DwEamA0U.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),He.of({name:"Rust",extensions:["rs"],load(){return Ze(()=>import("./index-CIn1DToR.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),He.of({name:"Sass",extensions:["sass"],load(){return Ze(()=>import("./index-DJx1oNAb.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),He.of({name:"SCSS",extensions:["scss"],load(){return Ze(()=>import("./index-DJx1oNAb.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),He.of({name:"SQL",extensions:["sql"],load(){return Rb("StandardSQL")}}),He.of({name:"SQLite",load(){return Rb("SQLite")}}),He.of({name:"TSX",extensions:["tsx"],load(){return Ze(()=>Promise.resolve().then(()=>Wj),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 Ze(()=>Promise.resolve().then(()=>Wj),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),He.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ze(()=>import("./index-DGluHyCE.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 Ze(()=>import("./index-Bc9rX-7c.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),He.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ze(()=>import("./index-D_16bAj5.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),He.of({name:"APL",extensions:["dyalog","apl"],load(){return Ze(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>ct(e.apl))}}),He.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ze(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>ct(e.asciiArmor))}}),He.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ze(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>ct(e.asn1({})))}}),He.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ze(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>ct(e.asterisk))}}),He.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ze(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>ct(e.brainfuck))}}),He.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ze(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>ct(e.cobol))}}),He.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.csharp))}}),He.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ze(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"ClojureScript",extensions:["cljs"],load(){return Ze(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ze(()=>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 Ze(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>ct(e.cmake))}}),He.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ze(()=>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 Ze(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>ct(e.commonLisp))}}),He.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ze(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>ct(e.cypher))}}),He.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ze(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>ct(e.cython))}}),He.of({name:"Crystal",extensions:["cr"],load(){return Ze(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>ct(e.crystal))}}),He.of({name:"D",extensions:["d"],load(){return Ze(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>ct(e.d))}}),He.of({name:"Dart",extensions:["dart"],load(){return Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.dart))}}),He.of({name:"diff",extensions:["diff","patch"],load(){return Ze(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>ct(e.diff))}}),He.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ze(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>ct(e.dockerFile))}}),He.of({name:"DTD",extensions:["dtd"],load(){return Ze(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>ct(e.dtd))}}),He.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ze(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>ct(e.dylan))}}),He.of({name:"EBNF",load(){return Ze(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>ct(e.ebnf))}}),He.of({name:"ECL",extensions:["ecl"],load(){return Ze(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>ct(e.ecl))}}),He.of({name:"edn",extensions:["edn"],load(){return Ze(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"Eiffel",extensions:["e"],load(){return Ze(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>ct(e.eiffel))}}),He.of({name:"Elm",extensions:["elm"],load(){return Ze(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>ct(e.elm))}}),He.of({name:"Erlang",extensions:["erl"],load(){return Ze(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>ct(e.erlang))}}),He.of({name:"Esper",load(){return Ze(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>ct(e.esper))}}),He.of({name:"Factor",extensions:["factor"],load(){return Ze(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>ct(e.factor))}}),He.of({name:"FCL",load(){return Ze(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>ct(e.fcl))}}),He.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ze(()=>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 Ze(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>ct(e.fortran))}}),He.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ze(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.fSharp))}}),He.of({name:"Gas",extensions:["s"],load(){return Ze(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>ct(e.gas))}}),He.of({name:"Gherkin",extensions:["feature"],load(){return Ze(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>ct(e.gherkin))}}),He.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ze(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>ct(e.groovy))}}),He.of({name:"Haskell",extensions:["hs"],load(){return Ze(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>ct(e.haskell))}}),He.of({name:"Haxe",extensions:["hx"],load(){return Ze(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.haxe))}}),He.of({name:"HXML",extensions:["hxml"],load(){return Ze(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.hxml))}}),He.of({name:"HTTP",load(){return Ze(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>ct(e.http))}}),He.of({name:"IDL",extensions:["pro"],load(){return Ze(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>ct(e.idl))}}),He.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ze(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>ct(e.jsonld))}}),He.of({name:"Julia",extensions:["jl"],load(){return Ze(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>ct(e.julia))}}),He.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.kotlin))}}),He.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ze(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>ct(e.liveScript))}}),He.of({name:"Lua",extensions:["lua"],load(){return Ze(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>ct(e.lua))}}),He.of({name:"mIRC",extensions:["mrc"],load(){return Ze(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>ct(e.mirc))}}),He.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ze(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>ct(e.mathematica))}}),He.of({name:"Modelica",extensions:["mo"],load(){return Ze(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>ct(e.modelica))}}),He.of({name:"MUMPS",extensions:["mps"],load(){return Ze(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>ct(e.mumps))}}),He.of({name:"Mbox",extensions:["mbox"],load(){return Ze(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>ct(e.mbox))}}),He.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ze(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>ct(e.nginx))}}),He.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ze(()=>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 Ze(()=>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 Ze(()=>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 Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.objectiveCpp))}}),He.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ze(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.oCaml))}}),He.of({name:"Octave",extensions:["m"],load(){return Ze(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>ct(e.octave))}}),He.of({name:"Oz",extensions:["oz"],load(){return Ze(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>ct(e.oz))}}),He.of({name:"Pascal",extensions:["p","pas"],load(){return Ze(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>ct(e.pascal))}}),He.of({name:"Perl",extensions:["pl","pm"],load(){return Ze(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>ct(e.perl))}}),He.of({name:"Pig",extensions:["pig"],load(){return Ze(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>ct(e.pig))}}),He.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ze(()=>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 Ze(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>ct(e.properties))}}),He.of({name:"ProtoBuf",extensions:["proto"],load(){return Ze(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>ct(e.protobuf))}}),He.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ze(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>ct(e.pug))}}),He.of({name:"Puppet",extensions:["pp"],load(){return Ze(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>ct(e.puppet))}}),He.of({name:"Q",extensions:["q"],load(){return Ze(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>ct(e.q))}}),He.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ze(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>ct(e.r))}}),He.of({name:"RPM Changes",load(){return Ze(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ct(e.rpmChanges))}}),He.of({name:"RPM Spec",extensions:["spec"],load(){return Ze(()=>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 Ze(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>ct(e.ruby))}}),He.of({name:"SAS",extensions:["sas"],load(){return Ze(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>ct(e.sas))}}),He.of({name:"Scala",extensions:["scala"],load(){return Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.scala))}}),He.of({name:"Scheme",extensions:["scm","ss"],load(){return Ze(()=>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 Ze(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>ct(e.shell))}}),He.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ze(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>ct(e.sieve))}}),He.of({name:"Smalltalk",extensions:["st"],load(){return Ze(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>ct(e.smalltalk))}}),He.of({name:"Solr",load(){return Ze(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>ct(e.solr))}}),He.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ze(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.sml))}}),He.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ze(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>ct(e.sparql))}}),He.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ze(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>ct(e.spreadsheet))}}),He.of({name:"Squirrel",extensions:["nut"],load(){return Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.squirrel))}}),He.of({name:"Stylus",extensions:["styl"],load(){return Ze(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>ct(e.stylus))}}),He.of({name:"Swift",extensions:["swift"],load(){return Ze(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>ct(e.swift))}}),He.of({name:"sTeX",load(){return Ze(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),He.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ze(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),He.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ze(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),He.of({name:"Tcl",extensions:["tcl"],load(){return Ze(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>ct(e.tcl))}}),He.of({name:"Textile",extensions:["textile"],load(){return Ze(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>ct(e.textile))}}),He.of({name:"TiddlyWiki",load(){return Ze(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>ct(e.tiddlyWiki))}}),He.of({name:"Tiki wiki",load(){return Ze(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>ct(e.tiki))}}),He.of({name:"TOML",extensions:["toml"],load(){return Ze(()=>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 Ze(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>ct(e.troff))}}),He.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ze(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>ct(e.ttcn))}}),He.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ze(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>ct(e.ttcnCfg))}}),He.of({name:"Turtle",extensions:["ttl"],load(){return Ze(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>ct(e.turtle))}}),He.of({name:"Web IDL",extensions:["webidl"],load(){return Ze(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>ct(e.webIDL))}}),He.of({name:"VB.NET",extensions:["vb"],load(){return Ze(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>ct(e.vb))}}),He.of({name:"VBScript",extensions:["vbs"],load(){return Ze(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>ct(e.vbScript))}}),He.of({name:"Velocity",extensions:["vtl"],load(){return Ze(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>ct(e.velocity))}}),He.of({name:"Verilog",extensions:["v"],load(){return Ze(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),He.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ze(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>ct(e.vhdl))}}),He.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ze(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>ct(e.xQuery))}}),He.of({name:"Yacas",extensions:["ys"],load(){return Ze(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>ct(e.yacas))}}),He.of({name:"Z80",extensions:["z80"],load(){return Ze(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>ct(e.z80))}}),He.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ze(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.mscgen))}}),He.of({name:"Xù",extensions:["xu"],load(){return Ze(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.xu))}}),He.of({name:"MsGenny",extensions:["msgenny"],load(){return Ze(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.msgenny))}}),He.of({name:"Vue",extensions:["vue"],load(){return Ze(()=>import("./index-KHDMp_I1.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),He.of({name:"Angular Template",load(){return Ze(()=>import("./index-D5ulcR11.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];var Lue=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=gt.theme(s,{dark:t==="dark"}),l=iO.define(n),c=[o,cue(l)];return c},Qsr={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)"},Wsr=[{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"}],H6=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return Lue({theme:t,settings:Bm({},Qsr,r),styles:[...Wsr,...n]})};H6();const Xsr=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Bue(e.state,r.from);return n.line?Ysr(e):n.block?Jsr(e):!1};function Fue(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 Ysr=Fue(rar,0),Ksr=Fue(TYe,0),Jsr=Fue((e,t)=>TYe(e,t,tar(t)),0);function Bue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const zC=50;function ear(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-zC,n),i=e.sliceDoc(s,s+zC),o=/\s*$/.exec(a)[0].length,l=/^\s*/.exec(i)[0].length,c=a.length-o;if(a.slice(c-t.length,c)==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*zC?d=p=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+zC),p=e.sliceDoc(s-zC,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 tar(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 TYe(e,t,r=t.selection.ranges){let n=r.map(a=>Bue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>ear(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:c,close:d}=o;a.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:d.pos-d.margin,to:d.pos+l.close.length})}return{changes:a}}return null}function rar(e,t,r=t.selection.ranges){let n=[],s=-1;for(let{from:a,to:i}of r){let o=n.length,l=1e9,c=Bue(t,a).line;if(c){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+c.length)==c?f:-1;f<p.text.length&&f<l&&(l=f),n.push({line:p,comment:m,token:c,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:c,empty:d,single:p}of n)(p||!d)&&a.push({from:o.from+c,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 c=i.from+o,d=c+l.length;i.text[d-i.from]==" "&&d++,a.push({from:c,to:d})}return{changes:a}}return null}const ure=ig.define(),nar=ig.define(),sar=Yt.define(),AYe=Yt.define({combine(e){return og(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)})}}),DYe=go.define({create(){return bm.empty},update(e,t){let r=t.state.facet(AYe),n=t.annotation(ure);if(n){let l=xu.fromTransaction(t,n.selection),c=n.side,d=c==0?e.undone:e.done;return l?d=T4(d,d.length,r.minDepth,l):d=RYe(d,t.startState.selection),new bm(c==0?n.rest:d,c==0?d:n.rest)}let s=t.annotation(nar);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(Do.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=xu.fromTransaction(t),i=t.annotation(Do.time),o=t.annotation(Do.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 bm(e.done.map(xu.fromJSON),e.undone.map(xu.fromJSON))}});function aar(e={}){return[DYe,AYe.of(e),gt.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?IYe:t.inputType=="historyRedo"?dre:null;return n?(t.preventDefault(),n(r)):!1}})]}function Z6(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(DYe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const IYe=Z6(0,!1),dre=Z6(1,!1),iar=Z6(0,!0),oar=Z6(1,!0);class xu{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 xu(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 xu(t.changes&&ko.fromJSON(t.changes),[],t.mapped&&Dm.fromJSON(t.mapped),t.startSelection&&Ke.fromJSON(t.startSelection),t.selectionsAfter.map(Ke.fromJSON))}static fromTransaction(t,r){let n=Mp;for(let s of t.startState.facet(sar)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new xu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,Mp)}static selection(t){return new xu(void 0,Mp,void 0,void 0,t)}}function T4(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 lar(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 c=r[l++],d=r[l++];o>=c&&i<=d&&(n=!0)}}),n}function car(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function NYe(e,t){return e.length?t.length?e.concat(t):e:t}const Mp=[],uar=200;function RYe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-uar));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),T4(e,e.length-1,1e9,r.setSelAfter(n)))}else return[xu.selection([t])]}function dar(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 xW(e,t){if(!e.length)return e;let r=e.length,n=Mp;for(;r;){let s=par(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?[xu.selection(n)]:Mp}function par(e,t,r){let n=NYe(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):Mp,r);if(!e.changes)return xu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new xu(s,sn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const far=/^(input\.type|delete)($|\.)/;class bm{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 bm(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||far.test(n))&&(!o.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,lar(o.changes,t.changes))||n=="input.type.compose")?i=T4(i,i.length-1,s.minDepth,new xu(t.changes.compose(o.changes),NYe(sn.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,Mp)):i=T4(i,i.length,s.minDepth,t),new bm(i,Mp,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Mp;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&car(a[a.length-1],t)?this:new bm(RYe(this.done,t),this.undone,r,n)}addMapping(t){return new bm(xW(this.done,t),xW(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:ure.of({side:t,rest:dar(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let o=s.length==1?Mp:s.slice(0,s.length-1);return a.mapped&&(o=xW(o,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:ure.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}bm.empty=new bm(Mp,Mp);const har=[{key:"Mod-z",run:IYe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:dre,preventDefault:!0},{linux:"Ctrl-Shift-z",run:dre,preventDefault:!0},{key:"Mod-u",run:iar,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:oar,preventDefault:!0}];function lO(e,t){return Ke.create(e.ranges.map(t),e.mainIndex)}function Th(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Ah({state:e,dispatch:t},r){let n=lO(e.selection,r);return n.eq(e.selection,!0)?!1:(t(Th(e,n)),!0)}function G6(e,t){return Ke.cursor(t?e.to:e.from)}function PYe(e,t){return Ah(e,r=>r.empty?e.moveByChar(r,t):G6(r,t))}function mc(e){return e.textDirectionAt(e.state.selection.main.head)==Ra.LTR}const jYe=e=>PYe(e,!mc(e)),$Ye=e=>PYe(e,mc(e));function MYe(e,t){return Ah(e,r=>r.empty?e.moveByGroup(r,t):G6(r,t))}const mar=e=>MYe(e,!mc(e)),gar=e=>MYe(e,mc(e));function yar(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 Q6(e,t,r){let n=Ca(e).resolveInner(t.head),s=r?fn.closedBy:fn.openedBy;for(let l=t.head;;){let c=r?n.childAfter(l):n.childBefore(l);if(!c)break;yar(e,c,s)?n=c:l=r?c.to:c.from}let a=n.type.prop(s),i,o;return a&&(i=r?ym(e,n.from,1):ym(e,n.to,-1))&&i.matched?o=r?i.end.to:i.end.from:o=r?n.to:n.from,Ke.cursor(o,r?-1:1)}const bar=e=>Ah(e,t=>Q6(e.state,t,!mc(e))),xar=e=>Ah(e,t=>Q6(e.state,t,mc(e)));function LYe(e,t){return Ah(e,r=>{if(!r.empty)return G6(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const FYe=e=>LYe(e,!1),BYe=e=>LYe(e,!0);function zYe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,s;if(t){for(let a of e.state.facet(gt.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 UYe(e,t){let r=zYe(e),{state:n}=e,s=lO(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):G6(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,c=o.bottom-r.marginBottom;i&&i.top>l&&i.bottom<c&&(a=gt.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-l}))}return e.dispatch(Th(n,s),{effects:a}),!0}const cDe=e=>UYe(e,!1),pre=e=>UYe(e,!0);function Tx(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=Ke.cursor(n.from+a))}return s}const war=e=>Ah(e,t=>Tx(e,t,!0)),Sar=e=>Ah(e,t=>Tx(e,t,!1)),Ear=e=>Ah(e,t=>Tx(e,t,!mc(e))),_ar=e=>Ah(e,t=>Tx(e,t,mc(e))),kar=e=>Ah(e,t=>Ke.cursor(e.lineBlockAt(t.head).from,1)),Oar=e=>Ah(e,t=>Ke.cursor(e.lineBlockAt(t.head).to,-1));function Car(e,t,r){let n=!1,s=lO(e.selection,a=>{let i=ym(e,a.head,-1)||ym(e,a.head,1)||a.head>0&&ym(e,a.head-1,1)||a.head<e.doc.length&&ym(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 Ke.cursor(o)});return n?(t(Th(e,s)),!0):!1}const Tar=({state:e,dispatch:t})=>Car(e,t);function hf(e,t){let r=lO(e.state.selection,n=>{let s=t(n);return Ke.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return r.eq(e.state.selection)?!1:(e.dispatch(Th(e.state,r)),!0)}function VYe(e,t){return hf(e,r=>e.moveByChar(r,t))}const qYe=e=>VYe(e,!mc(e)),HYe=e=>VYe(e,mc(e));function ZYe(e,t){return hf(e,r=>e.moveByGroup(r,t))}const Aar=e=>ZYe(e,!mc(e)),Dar=e=>ZYe(e,mc(e)),Iar=e=>hf(e,t=>Q6(e.state,t,!mc(e))),Nar=e=>hf(e,t=>Q6(e.state,t,mc(e)));function GYe(e,t){return hf(e,r=>e.moveVertically(r,t))}const QYe=e=>GYe(e,!1),WYe=e=>GYe(e,!0);function XYe(e,t){return hf(e,r=>e.moveVertically(r,t,zYe(e).height))}const uDe=e=>XYe(e,!1),dDe=e=>XYe(e,!0),Rar=e=>hf(e,t=>Tx(e,t,!0)),Par=e=>hf(e,t=>Tx(e,t,!1)),jar=e=>hf(e,t=>Tx(e,t,!mc(e))),$ar=e=>hf(e,t=>Tx(e,t,mc(e))),Mar=e=>hf(e,t=>Ke.cursor(e.lineBlockAt(t.head).from)),Lar=e=>hf(e,t=>Ke.cursor(e.lineBlockAt(t.head).to)),pDe=({state:e,dispatch:t})=>(t(Th(e,{anchor:0})),!0),fDe=({state:e,dispatch:t})=>(t(Th(e,{anchor:e.doc.length})),!0),hDe=({state:e,dispatch:t})=>(t(Th(e,{anchor:e.selection.main.anchor,head:0})),!0),mDe=({state:e,dispatch:t})=>(t(Th(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Far=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Bar=({state:e,dispatch:t})=>{let r=W6(e).map(({from:n,to:s})=>Ke.range(n,Math.min(s+1,e.doc.length)));return t(e.update({selection:Ke.create(r),userEvent:"select"})),!0},zar=({state:e,dispatch:t})=>{let r=lO(e.selection,n=>{let s=Ca(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 Ke.range(o.to,o.from)}return n});return r.eq(e.selection)?!1:(t(Th(e,r)),!0)};function YYe(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(c=>c.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(Th(r,Ke.create(s,s.length-1))),!0)}const Uar=e=>YYe(e,!1),Var=e=>YYe(e,!0),qar=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=Ke.create([r.main]):r.main.empty||(n=Ke.create([Ke.cursor(r.main.head)])),n?(t(Th(e,n)),!0):!1};function qR(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=Xj(e,l,!1)):l>i&&(r="delete.forward",l=Xj(e,l,!0)),i=Math.min(i,l),o=Math.max(o,l)}else i=Xj(e,i,!1),o=Xj(e,o,!0);return i==o?{range:a}:{changes:{from:i,to:o},range:Ke.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"?gt.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function Xj(e,t,r){if(e instanceof gt)for(let n of e.state.facet(gt.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const KYe=(e,t,r)=>qR(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 c=hh(o,a.tabSize),d=c%T1(a)||T1(a);for(let p=0;p<d&&o[o.length-1-p]==" ";p++)s--;l=s}else l=ul(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=ul(i.text,l-i.from,!1,!1)+i.from);return l}),fre=e=>KYe(e,!1,!0),JYe=e=>KYe(e,!0,!1),eKe=(e,t)=>qR(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=ul(a.text,n-a.from,t)+a.from,c=a.text.slice(Math.min(n,l)-a.from,Math.max(n,l)-a.from),d=i(c);if(o!=null&&d!=o)break;(c!=" "||n!=r.head)&&(o=d),n=l}return n}),tKe=e=>eKe(e,!1),Har=e=>eKe(e,!0),Zar=e=>qR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),Gar=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),Qar=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),War=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Ts.of(["",""])},range:Ke.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},Xar=({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:ul(a.text,s-a.from,!1)+a.from,o=s==a.to?s+1:ul(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:Ke.cursor(o)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function W6(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 rKe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of W6(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(Ke.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(Ke.range(l.anchor-o,l.head-o))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:Ke.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Yar=({state:e,dispatch:t})=>rKe(e,t,!1),Kar=({state:e,dispatch:t})=>rKe(e,t,!0);function nKe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of W6(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 Jar=({state:e,dispatch:t})=>nKe(e,t,!1),eir=({state:e,dispatch:t})=>nKe(e,t,!0),tir=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(W6(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=lO(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 rir(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=Ca(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 gDe=sKe(!1),nir=sKe(!0);function sKe(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&&rir(t,a);e&&(a=i=(i<=o.to?o:t.doc.lineAt(i)).to);let c=new z6(t,{simulateBreak:a,simulateDoubleBreak:!!l}),d=iue(c,a);for(d==null&&(d=hh(/^\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=["",VD(t,d)];return l&&p.push(VD(t,c.lineIndent(o.from,-1))),{changes:{from:a,to:i,insert:Ts.of(p)},range:Ke.cursor(a+1+p[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function zue(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:Ke.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const sir=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new z6(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=zue(e,(a,i,o)=>{let l=iue(n,a.from);if(l==null)return;/\S/.test(a.text)||(l=0);let c=/^\s*/.exec(a.text)[0],d=VD(e,l);(c!=d||o.from<a.from+c.length)&&(r[a.from]=l,i.push({from:a.from,to:a.from+c.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},aKe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(zue(e,(r,n)=>{n.push({from:r.from,insert:e.facet(aO)})}),{userEvent:"input.indent"})),!0),iKe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(zue(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=hh(s,e.tabSize),i=0,o=VD(e,Math.max(0,a-T1(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),air=e=>(e.setTabFocusMode(),!0),iir=[{key:"Ctrl-b",run:jYe,shift:qYe,preventDefault:!0},{key:"Ctrl-f",run:$Ye,shift:HYe},{key:"Ctrl-p",run:FYe,shift:QYe},{key:"Ctrl-n",run:BYe,shift:WYe},{key:"Ctrl-a",run:kar,shift:Mar},{key:"Ctrl-e",run:Oar,shift:Lar},{key:"Ctrl-d",run:JYe},{key:"Ctrl-h",run:fre},{key:"Ctrl-k",run:Zar},{key:"Ctrl-Alt-h",run:tKe},{key:"Ctrl-o",run:War},{key:"Ctrl-t",run:Xar},{key:"Ctrl-v",run:pre}],oir=[{key:"ArrowLeft",run:jYe,shift:qYe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:mar,shift:Aar,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Ear,shift:jar,preventDefault:!0},{key:"ArrowRight",run:$Ye,shift:HYe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:gar,shift:Dar,preventDefault:!0},{mac:"Cmd-ArrowRight",run:_ar,shift:$ar,preventDefault:!0},{key:"ArrowUp",run:FYe,shift:QYe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:pDe,shift:hDe},{mac:"Ctrl-ArrowUp",run:cDe,shift:uDe},{key:"ArrowDown",run:BYe,shift:WYe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:fDe,shift:mDe},{mac:"Ctrl-ArrowDown",run:pre,shift:dDe},{key:"PageUp",run:cDe,shift:uDe},{key:"PageDown",run:pre,shift:dDe},{key:"Home",run:Sar,shift:Par,preventDefault:!0},{key:"Mod-Home",run:pDe,shift:hDe},{key:"End",run:war,shift:Rar,preventDefault:!0},{key:"Mod-End",run:fDe,shift:mDe},{key:"Enter",run:gDe,shift:gDe},{key:"Mod-a",run:Far},{key:"Backspace",run:fre,shift:fre,preventDefault:!0},{key:"Delete",run:JYe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:tKe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Har,preventDefault:!0},{mac:"Mod-Backspace",run:Gar,preventDefault:!0},{mac:"Mod-Delete",run:Qar,preventDefault:!0}].concat(iir.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),lir=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:bar,shift:Iar},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:xar,shift:Nar},{key:"Alt-ArrowUp",run:Yar},{key:"Shift-Alt-ArrowUp",run:Jar},{key:"Alt-ArrowDown",run:Kar},{key:"Shift-Alt-ArrowDown",run:eir},{key:"Mod-Alt-ArrowUp",run:Uar},{key:"Mod-Alt-ArrowDown",run:Var},{key:"Escape",run:qar},{key:"Mod-Enter",run:nir},{key:"Alt-l",mac:"Ctrl-l",run:Bar},{key:"Mod-i",run:zar,preventDefault:!0},{key:"Mod-[",run:iKe},{key:"Mod-]",run:aKe},{key:"Mod-Alt-\\",run:sir},{key:"Shift-Mod-k",run:tir},{key:"Shift-Mod-\\",run:Tar},{key:"Mod-/",run:Xsr},{key:"Alt-A",run:Ksr},{key:"Ctrl-m",mac:"Shift-Alt-m",run:air}].concat(oir),cir={key:"Tab",run:aKe,shift:iKe},yDe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class U_{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(yDe(o)):yDe,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 pu(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=Uce(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=om(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"&&(U_.prototype[Symbol.iterator]=function(){return this});const oKe={from:-1,to:-1,match:/.*/.exec("")},Uue="gm"+(/x/.unicode==null?"":"u");class lKe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=oKe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new cKe(t,r,n,s,a);this.re=new RegExp(r,Uue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=A4(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=A4(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 wW=new WeakMap;class XE{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=wW.get(t);if(!s||s.from>=n||s.to<=r){let o=new XE(r,t.sliceString(r,n));return wW.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)),wW.set(t,new XE(i,a)),new XE(r,a.slice(r-i,n-i))}}class cKe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=oKe,this.matchPos=A4(t,s),this.re=new RegExp(r,Uue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=XE.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=A4(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=XE.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(lKe.prototype[Symbol.iterator]=cKe.prototype[Symbol.iterator]=function(){return this});function uir(e){try{return new RegExp(e,Uue),!0}catch{return!1}}function A4(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 hre(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),r=Da("input",{class:"cm-textfield",name:"line",value:t}),n=Da("form",{class:"cm-gotoLine",onkeydown:a=>{a.keyCode==27?(a.preventDefault(),e.dispatch({effects:CA.of(!1)}),e.focus()):a.keyCode==13&&(a.preventDefault(),s())},onsubmit:a=>{a.preventDefault(),s()}},Da("label",e.state.phrase("Go to line"),": ",r)," ",Da("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),Da("button",{name:"close",onclick:()=>{e.dispatch({effects:CA.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,c,d,p]=a,f=d?+d.slice(1):0,h=c?+c:o.number;if(c&&p){let b=h/100;l&&(b=b*(l=="-"?-1:1)+o.number/i.doc.lines),h=Math.round(i.doc.lines*b)}else c&&l&&(h=h*(l=="-"?-1:1)+o.number);let m=i.doc.line(Math.max(1,Math.min(i.doc.lines,h))),g=Ke.cursor(m.from+Math.max(0,Math.min(f,m.length)));e.dispatch({effects:[CA.of(!1),gt.scrollIntoView(g.from,{y:"center"})],selection:g}),e.focus()}return{dom:n}}const CA=sn.define(),bDe=go.define({create(){return!0},update(e,t){for(let r of t.effects)r.is(CA)&&(e=r.value);return e},provide:e=>UD.from(e,t=>t?hre:null)}),dir=e=>{let t=zD(e,hre);if(!t){let r=[CA.of(!0)];e.state.field(bDe,!1)==null&&r.push(sn.appendConfig.of([bDe,pir])),e.dispatch({effects:r}),t=zD(e,hre)}return t&&t.dom.querySelector("input").select(),!0},pir=gt.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"}}}),fir={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},hir=Yt.define({combine(e){return og(e,fir,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function mir(e){return[xir,vir]}const gir=nr.mark({class:"cm-selectionMatch"}),yir=nr.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function vDe(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=hi.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=hi.Word)}function bir(e,t,r,n){return e(t.sliceDoc(r,r+1))==hi.Word&&e(t.sliceDoc(n-1,n))==hi.Word}const vir=Ci.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(hir),{state:r}=e,n=r.selection;if(n.ranges.length>1)return nr.none;let s=n.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return nr.none;let l=r.wordAt(s.head);if(!l)return nr.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 nr.none;if(t.wholeWords){if(a=r.sliceDoc(s.from,s.to),i=r.charCategorizer(s.head),!(vDe(i,r,s.from,s.to)&&bir(i,r,s.from,s.to)))return nr.none}else if(a=r.sliceDoc(s.from,s.to),!a)return nr.none}let o=[];for(let l of e.visibleRanges){let c=new U_(r.doc,a,l.from,l.to);for(;!c.next().done;){let{from:d,to:p}=c.value;if((!i||vDe(i,r,d,p))&&(s.empty&&d<=s.from&&p>=s.to?o.push(yir.range(d,p)):(d>=s.to||p<=s.from)&&o.push(gir.range(d,p)),o.length>t.maxMatches))return nr.none}}return nr.set(o)}},{decorations:e=>e.decorations}),xir=gt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),wir=({state:e,dispatch:t})=>{let{selection:r}=e,n=Ke.create(r.ranges.map(s=>e.wordAt(s.head)||Ke.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function Sir(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 U_(e.doc,t,n[n.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new U_(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 Eir=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return wir({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=Sir(e,n);return s?(t(e.update({selection:e.selection.addRange(Ke.range(s.from,s.to),!1),effects:gt.scrollIntoView(s.to)})),!0):!1},cO=Yt.define({combine(e){return og(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new jir(t),scrollToMatch:t=>gt.scrollIntoView(t)})}});class uKe{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||uir(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"?`
|
|
163
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),au('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),au('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],QXe=Aue.concat([au("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),au("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),au("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),tDe=new YGe,WXe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function FC(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const Ssr=["FunctionDeclaration"],Esr={FunctionDeclaration:FC("function"),ClassDeclaration:FC("class"),ClassExpression:()=>!0,EnumDeclaration:FC("constant"),TypeAliasDeclaration:FC("type"),NamespaceDeclaration:FC("namespace"),VariableDefinition(e,t){e.matchContext(Ssr)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function XXe(e,t){let r=tDe.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(na.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let o=Esr[i.name];if(o&&o(i,a)||WXe.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of XXe(e,i.node))n.push(o);return!1}}),tDe.set(t,n),n}const O4=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Due=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function YXe(e){let t=Ca(e.state).resolveInner(e.pos,-1);if(Due.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&O4.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)WXe.has(s.name)&&(n=n.concat(XXe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:O4}}function fW(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 KXe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Ca(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?fW(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?fW(t,r.parent,""):Due.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&O4.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?fW(t,r,""):e.explicit?{path:[],name:""}:null}function _sr(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 ksr(e){let t=new Map;return r=>{let n=KXe(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=_sr(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:O4}}}const Up=k1.define({name:"javascript",parser:wsr.configure({props:[vw.add({IfStatement:QE({except:/^\s*({|else\b)/}),TryStatement:QE({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:wer,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:xer({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":QE({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}}),xw.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":lue,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),JXe={test:e=>/^JSX/.test(e.name),facet:B6({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Iue=Up.configure({dialect:"ts"},"typescript"),Nue=Up.configure({dialect:"jsx",props:[aue.add(e=>e.isTop?[JXe]:void 0)]}),Rue=Up.configure({dialect:"jsx ts",props:[aue.add(e=>e.isTop?[JXe]:void 0)]},"typescript");let eYe=e=>({label:e,type:"keyword"});const tYe="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(eYe),Osr=tYe.concat(["declare","implements","private","protected","public"].map(eYe));function C4(e={}){let t=e.jsx?e.typescript?Rue:Nue:e.typescript?Iue:Up,r=e.typescript?QXe.concat(Osr):Aue.concat(tYe);return new C1(t,[Up.data.of({autocomplete:itr(Due,WWe(r))}),Up.data.of({autocomplete:YXe}),e.jsx?rYe:[]])}function Csr(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 rDe(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 Tsr=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),rYe=gt.inputHandler.of((e,t,r,n,s)=>{if((Tsr?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!Up.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(l=>{var c;let{head:d}=l,p=Ca(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=rDe(i.doc,m.firstChild,d))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let g=`${f}>`;return{range:Ke.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(n==">"){let h=Csr(p);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(f=rDe(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 Asr(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 Up.findRegions(n)){let o=n.doc.lineAt(a),l={line:o.number-1,col:a-o.from,pos:a};for(let c of e.verify(n.sliceDoc(a,i),t))s.push(Dsr(c,n.doc,l))}return s}}function nDe(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function Dsr(e,t,r){let n=nDe(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?nDe(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(c,d){c.dispatch({changes:{from:d+o,to:d+l,insert:i},scrollIntoView:!0})}}]}return s}const Wj=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:rYe,completionPath:KXe,esLint:Asr,javascript:C4,javascriptLanguage:Up,jsxLanguage:Nue,localCompletionSource:YXe,scopeCompletionSource:ksr,snippets:Aue,tsxLanguage:Rue,typescriptLanguage:Iue,typescriptSnippets:QXe},Symbol.toStringTag,{value:"Module"})),BC=["_blank","_self","_top","_parent"],hW=["ascii","utf-8","utf-16","latin1","latin1"],mW=["get","post","put","delete"],gW=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ad=["true","false"],Nr={},Isr={a:{attrs:{href:null,ping:null,type:null,media:null,target:BC,hreflang:null}},abbr:Nr,address:Nr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Nr,aside:Nr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Nr,base:{attrs:{href:null,target:BC}},bdi:Nr,bdo:Nr,blockquote:{attrs:{cite:null}},body:Nr,br:Nr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:gW,formmethod:mW,formnovalidate:["novalidate"],formtarget:BC,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Nr,center:Nr,cite:Nr,code:Nr,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:Nr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Nr,div:Nr,dl:Nr,dt:Nr,em:Nr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Nr,figure:Nr,footer:Nr,form:{attrs:{action:null,name:null,"accept-charset":hW,autocomplete:["on","off"],enctype:gW,method:mW,novalidate:["novalidate"],target:BC}},h1:Nr,h2:Nr,h3:Nr,h4:Nr,h5:Nr,h6:Nr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Nr,hgroup:Nr,hr:Nr,html:{attrs:{manifest:null}},i:Nr,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:gW,formmethod:mW,formnovalidate:["novalidate"],formtarget:BC,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:Nr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Nr,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:Nr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:hW,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:Nr,noscript:Nr,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:Nr,param:{attrs:{name:null,value:null}},pre:Nr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Nr,rt:Nr,ruby:Nr,samp:Nr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:hW}},section:Nr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Nr,source:{attrs:{src:null,type:null,media:null}},span:Nr,strong:Nr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Nr,summary:Nr,sup:Nr,table:Nr,tbody:Nr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Nr,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:Nr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Nr,time:{attrs:{datetime:null}},title:Nr,tr:Nr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Nr,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:Nr},nYe={accesskey:null,class:null,contenteditable:ad,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:ad,autocorrect:ad,autocapitalize:ad,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":ad,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ad,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ad,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ad,"aria-hidden":ad,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ad,"aria-multiselectable":ad,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ad,"aria-relevant":null,"aria-required":ad,"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},sYe="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 sYe)nYe[e]=null;let KD=class{constructor(t,r){this.tags={...Isr,...t},this.globalAttrs={...nYe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};KD.default=new KD;function B_(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 z_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function aYe(e,t,r){let n=r.tags[B_(e,z_(t))];return n?.children||r.allTags}function Pue(e,t){let r=[];for(let n=z_(t);n&&!n.type.isTop;n=z_(n.parent)){let s=B_(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 iYe=/^[:\-\.\w\u00b7-\uffff]*$/;function sDe(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=z_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:aYe(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(Pue(e.doc,r).map((o,l)=>({label:"/"+o,apply:"/"+o+a,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function aDe(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Pue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:iYe}}function Nsr(e,t,r,n){let s=[],a=0;for(let i of aYe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Pue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Rsr(e,t,r,n,s){let a=z_(r),i=a?t.tags[B_(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(c=>({label:c,type:"property"})),validFor:iYe}}function Psr(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 c=e.sliceDoc(i.from,i.to),d=t.globalAttrs[c];if(!d){let p=z_(r),f=p?t.tags[B_(e.doc,p)]:null;d=f?.attrs&&f.attrs[c]}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 oYe(e,t){let{state:r,pos:n}=t,s=Ca(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)?aDe(r,s,s.from,n):sDe(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?sDe(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?aDe(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?Rsr(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?Psr(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?Nsr(r,e,s,n):null}function lYe(e){return oYe(KD.default,e)}function cYe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new KD(t,r):KD.default;return s=>oYe(n,s)}const jsr=Up.parser.configure({top:"SingleExpression"}),uYe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Iue.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Nue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Rue.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:jsr},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:Up.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:YD.parser}],dYe=[{name:"style",parser:YD.parser.configure({top:"Styles"})}].concat(sYe.map(e=>({name:e,parser:Up.parser}))),pYe=k1.define({name:"html",parser:unr.configure({props:[vw.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}}),xw.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}}}),UWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),OA=pYe.configure({wrap:LXe(uYe,dYe)});function fYe(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=LXe((e.nestedLanguages||[]).concat(uYe),(e.nestedAttributes||[]).concat(dYe)));let n=r?pYe.configure({wrap:r,dialect:t}):t?OA.configure({dialect:t}):OA;return new C1(n,[OA.data.of({autocomplete:cYe(e)}),e.autoCloseTags!==!1?hYe:[],C4().support,ZXe().support])}const iDe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),hYe=gt.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!OA.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(l=>{var c,d,p;let f=i.doc.sliceString(l.from-1,l.to)==n,{head:h}=l,m=Ca(i).resolveInner(h,-1),g;if(f&&n==">"&&m.name=="EndTag"){let b=m.parent;if(((d=(c=b.parent)===null||c===void 0?void 0:c.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=B_(i.doc,b.parent,h))&&!iDe.has(g)){let v=h+(i.doc.sliceString(h,h+1)===">"?1:0),w=`</${g}>`;return{range:l,changes:{from:h,to:v,insert:w}}}}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"&&(g=B_(i.doc,b,h))&&!iDe.has(g)){let v=h+(i.doc.sliceString(h,h+1)===">"?1:0),w=`${g}>`;return{range:Ke.cursor(h+w.length,-1),changes:{from:h,to:v,insert:w}}}}return{range:l}});return o.changes.empty?!1:(e.dispatch([a,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),$sr=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:hYe,html:fYe,htmlCompletionSource:lYe,htmlCompletionSourceWith:cYe,htmlLanguage:OA},Symbol.toStringTag,{value:"Module"})),mYe=B6({commentTokens:{block:{open:"<!--",close:"-->"}}}),gYe=new fn,yYe=prr.configure({props:[xw.add(e=>!e.is("Block")||e.is("Document")||cre(e)!=null||Msr(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),gYe.add(cre),vw.add({Document:()=>null}),mv.add({Document:mYe})]});function cre(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Msr(e){return e.name=="OrderedList"||e.name=="BulletList"}function Lsr(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=cre(n.type))!=null&&s<=t)break;r=n}return r.to}const Fsr=DWe.of((e,t,r)=>{for(let n=Ca(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(gYe);if(s==null)continue;let a=Lsr(n,s);if(a>r)return{from:r,to:a}}return null});function jue(e){return new _d(mYe,e,[],"markdown")}const bYe=jue(yYe),Bsr=yYe.configure([Err,krr,_rr,Orr,{props:[xw.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),D1=jue(Bsr);function zsr(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:O1.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class yW{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(+xYe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function vYe(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 yW(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 c=i[3],d=i[0].length;c.length>=4&&(c=c.slice(0,c.length-4),d-=4),n.push(new yW(a.parent,l,l+d,i[1],c,i[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(l)))){let c=i[4],d=i[0].length;c.length>4&&(c=c.slice(0,c.length-4),d-=4);let p=i[2];i[3]&&(p+=i[3].replace(/[xX]/," ")),n.push(new yW(a.parent,l,l+d,i[1],c,p,a))}}return n}function xYe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function bW(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let o=xYe(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 $ue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(aO)!=" ")return e;let n=hh(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const wYe=(e={})=>({state:t,dispatch:r})=>{let n=Ca(t),{doc:s}=t,a=null,i=t.changeByRange(o=>{if(!o.empty||!D1.isActiveAt(t,o.from,-1)&&!D1.isActiveAt(t,o.from,1))return a={range:o};let l=o.from,c=s.lineAt(l),d=vYe(n.resolveInner(l,-1),s);for(;d.length&&d[d.length-1].from>l-c.from;)d.pop();if(!d.length)return a={range:o};let p=d[d.length-1];if(p.to-p.spaceAfter.length>l-c.from)return a={range:o};let f=l>=p.to-p.spaceAfter.length&&!/\S/.test(c.text.slice(p.to));if(p.item&&f){let v=p.node.firstChild,w=p.node.getChild("ListItem","ListItem");if(v.to>=l||w&&w.to<l||c.from>0&&!/[^\s>]/.test(s.lineAt(c.from-1).text)||e.nonTightLists===!1){let S=d.length>1?d[d.length-2]:null,_,O="";S&&S.item?(_=c.from+S.from,O=S.marker(s,1)):_=c.from+(S?S.to:0);let C=[{from:_,to:l,insert:O}];return p.node.name=="OrderedList"&&bW(p.item,s,C,-2),S&&S.node.name=="OrderedList"&&bW(S.item,s,C),{range:Ke.cursor(_+O.length),changes:C}}else{let S=lDe(d,t,c);return{range:Ke.cursor(l+S.length+1),changes:{from:c.from,insert:S+t.lineBreak}}}}if(p.node.name=="Blockquote"&&f&&c.from){let v=s.lineAt(c.from-1),w=/>\s*$/.exec(v.text);if(w&&w.index==p.from){let S=t.changes([{from:v.from+w.index,to:v.to},{from:c.from+p.from,to:c.to}]);return{range:o.map(S),changes:S}}}let h=[];p.node.name=="OrderedList"&&bW(p.item,s,h);let m=p.item&&p.item.from<c.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=p.to)for(let v=0,w=d.length-1;v<=w;v++)g+=v==w&&!m?d[v].marker(s,1):d[v].blank(v<w?hh(c.text,4,d[v+1].from)-g.length:null);let b=l;for(;b>c.from&&/\s/.test(c.text.charAt(b-c.from-1));)b--;return g=$ue(g,t),Usr(p.node,t.doc)&&(g=lDe(d,t,c)+t.lineBreak+g),h.push({from:b,to:l,insert:t.lineBreak+g}),{range:Ke.cursor(b+g.length+1),changes:h}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},SYe=wYe();function oDe(e){return e.name=="QuoteMark"||e.name=="ListMark"}function Usr(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 lDe(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?hh(r.text,4,e[s+1].from)-n.length:null,s<a);return $ue(n,t)}function Vsr(e,t){let r=e.resolveInner(t,-1),n=t;oDe(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(oDe(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const EYe=({state:e,dispatch:t})=>{let r=Ca(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:o}=e;if(a.empty&&D1.isActiveAt(e,a.from)){let l=o.lineAt(i),c=vYe(Vsr(r,i),o);if(c.length){let d=c[c.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:Ke.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(hh(l.text,4,d.to)-hh(l.text,4,d.from));return f==l.from&&(h=$ue(h,e)),{range:Ke.cursor(f+h.length),changes:{from:f,to:l.from+d.to,insert:h}}}if(f<i)return{range:Ke.cursor(f),changes:{from:f,to:i}}}}}return n={range:a}});return n?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},_Ye=[{key:"Enter",run:SYe},{key:"Backspace",run:EYe}],kYe=fYe({matchClosingTags:!1});function Mue(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=bYe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=kYe}=e;if(!(s instanceof q6))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=e.extensions?[e.extensions]:[],c=[o.support,Fsr],d;i&&c.push(OYe),r instanceof C1?(c.push(r.support),d=r.language):r&&(d=r);let p=t||d?zsr(t,d):void 0;l.push(hrr({codeParser:p,htmlParser:o.language.parser})),n&&c.push(Ch.high(sO.of(_Ye)));let f=jue(s.configure(l));return a&&c.push(f.data.of({autocomplete:qsr})),new C1(f,c)}function qsr(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=Ca(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:Hsr(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let vW=null;function Hsr(){if(vW)return vW;let e=lYe(new hue(Wn.create({extensions:kYe}),0,!0));return vW=e?e.options:[]}const Zsr=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,OYe=gt.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),!D1.isActiveAt(t.state,n.from,1)))return!1;let a=Ca(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:o=>{(o.from>n.from||Zsr.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)}}),Gsr=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:bYe,deleteMarkupBackward:EYe,insertNewlineContinueMarkup:SYe,insertNewlineContinueMarkupCommand:wYe,markdown:Mue,markdownKeymap:_Ye,markdownLanguage:D1,pasteURLAsLink:OYe},Symbol.toStringTag,{value:"Module"}));function ct(e){return new C1(uue.define(e))}function Rb(e){return Ze(()=>import("./index-CDqcm89i.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const CYe=[He.of({name:"C",extensions:["c","h","ino"],load(){return Ze(()=>import("./index-MdSpMKbY.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 Ze(()=>import("./index-MdSpMKbY.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),He.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Rb("Cassandra")}}),He.of({name:"CSS",extensions:["css"],load(){return Ze(()=>Promise.resolve().then(()=>qnr),void 0,import.meta.url).then(e=>e.css())}}),He.of({name:"Go",extensions:["go"],load(){return Ze(()=>import("./index-BE7o3PiB.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 Ze(()=>Promise.resolve().then(()=>$sr),void 0,import.meta.url).then(e=>e.html())}}),He.of({name:"Java",extensions:["java"],load(){return Ze(()=>import("./index-DMWDu6p5.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 Ze(()=>Promise.resolve().then(()=>Wj),void 0,import.meta.url).then(e=>e.javascript())}}),He.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ze(()=>import("./index-Bkm8qH7s.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),He.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ze(()=>Promise.resolve().then(()=>str),void 0,import.meta.url).then(e=>e.json())}}),He.of({name:"JSX",extensions:["jsx"],load(){return Ze(()=>Promise.resolve().then(()=>Wj),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),He.of({name:"LESS",extensions:["less"],load(){return Ze(()=>import("./index-qMPnG_n4.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),He.of({name:"Liquid",extensions:["liquid"],load(){return Ze(()=>import("./index-DP7rC8MQ.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),He.of({name:"MariaDB SQL",load(){return Rb("MariaSQL")}}),He.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ze(()=>Promise.resolve().then(()=>Gsr),void 0,import.meta.url).then(e=>e.markdown())}}),He.of({name:"MS SQL",load(){return Rb("MSSQL")}}),He.of({name:"MySQL",load(){return Rb("MySQL")}}),He.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ze(()=>import("./index-CPbIKl2O.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),He.of({name:"PLSQL",extensions:["pls"],load(){return Rb("PLSQL")}}),He.of({name:"PostgreSQL",load(){return Rb("PostgreSQL")}}),He.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ze(()=>import("./index-C7IsJnvT.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),He.of({name:"Rust",extensions:["rs"],load(){return Ze(()=>import("./index-CwtzGcX6.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),He.of({name:"Sass",extensions:["sass"],load(){return Ze(()=>import("./index-DZfU8Y2-.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),He.of({name:"SCSS",extensions:["scss"],load(){return Ze(()=>import("./index-DZfU8Y2-.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),He.of({name:"SQL",extensions:["sql"],load(){return Rb("StandardSQL")}}),He.of({name:"SQLite",load(){return Rb("SQLite")}}),He.of({name:"TSX",extensions:["tsx"],load(){return Ze(()=>Promise.resolve().then(()=>Wj),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 Ze(()=>Promise.resolve().then(()=>Wj),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),He.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ze(()=>import("./index-DO5-7i6U.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 Ze(()=>import("./index-C7berX13.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),He.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ze(()=>import("./index-BUqHnGfn.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),He.of({name:"APL",extensions:["dyalog","apl"],load(){return Ze(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>ct(e.apl))}}),He.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ze(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>ct(e.asciiArmor))}}),He.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ze(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>ct(e.asn1({})))}}),He.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ze(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>ct(e.asterisk))}}),He.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ze(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>ct(e.brainfuck))}}),He.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ze(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>ct(e.cobol))}}),He.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.csharp))}}),He.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ze(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"ClojureScript",extensions:["cljs"],load(){return Ze(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ze(()=>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 Ze(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>ct(e.cmake))}}),He.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ze(()=>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 Ze(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>ct(e.commonLisp))}}),He.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ze(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>ct(e.cypher))}}),He.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ze(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>ct(e.cython))}}),He.of({name:"Crystal",extensions:["cr"],load(){return Ze(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>ct(e.crystal))}}),He.of({name:"D",extensions:["d"],load(){return Ze(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>ct(e.d))}}),He.of({name:"Dart",extensions:["dart"],load(){return Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.dart))}}),He.of({name:"diff",extensions:["diff","patch"],load(){return Ze(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>ct(e.diff))}}),He.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ze(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>ct(e.dockerFile))}}),He.of({name:"DTD",extensions:["dtd"],load(){return Ze(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>ct(e.dtd))}}),He.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ze(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>ct(e.dylan))}}),He.of({name:"EBNF",load(){return Ze(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>ct(e.ebnf))}}),He.of({name:"ECL",extensions:["ecl"],load(){return Ze(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>ct(e.ecl))}}),He.of({name:"edn",extensions:["edn"],load(){return Ze(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),He.of({name:"Eiffel",extensions:["e"],load(){return Ze(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>ct(e.eiffel))}}),He.of({name:"Elm",extensions:["elm"],load(){return Ze(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>ct(e.elm))}}),He.of({name:"Erlang",extensions:["erl"],load(){return Ze(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>ct(e.erlang))}}),He.of({name:"Esper",load(){return Ze(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>ct(e.esper))}}),He.of({name:"Factor",extensions:["factor"],load(){return Ze(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>ct(e.factor))}}),He.of({name:"FCL",load(){return Ze(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>ct(e.fcl))}}),He.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ze(()=>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 Ze(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>ct(e.fortran))}}),He.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ze(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.fSharp))}}),He.of({name:"Gas",extensions:["s"],load(){return Ze(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>ct(e.gas))}}),He.of({name:"Gherkin",extensions:["feature"],load(){return Ze(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>ct(e.gherkin))}}),He.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ze(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>ct(e.groovy))}}),He.of({name:"Haskell",extensions:["hs"],load(){return Ze(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>ct(e.haskell))}}),He.of({name:"Haxe",extensions:["hx"],load(){return Ze(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.haxe))}}),He.of({name:"HXML",extensions:["hxml"],load(){return Ze(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.hxml))}}),He.of({name:"HTTP",load(){return Ze(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>ct(e.http))}}),He.of({name:"IDL",extensions:["pro"],load(){return Ze(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>ct(e.idl))}}),He.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ze(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>ct(e.jsonld))}}),He.of({name:"Julia",extensions:["jl"],load(){return Ze(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>ct(e.julia))}}),He.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.kotlin))}}),He.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ze(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>ct(e.liveScript))}}),He.of({name:"Lua",extensions:["lua"],load(){return Ze(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>ct(e.lua))}}),He.of({name:"mIRC",extensions:["mrc"],load(){return Ze(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>ct(e.mirc))}}),He.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ze(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>ct(e.mathematica))}}),He.of({name:"Modelica",extensions:["mo"],load(){return Ze(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>ct(e.modelica))}}),He.of({name:"MUMPS",extensions:["mps"],load(){return Ze(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>ct(e.mumps))}}),He.of({name:"Mbox",extensions:["mbox"],load(){return Ze(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>ct(e.mbox))}}),He.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ze(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>ct(e.nginx))}}),He.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ze(()=>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 Ze(()=>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 Ze(()=>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 Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.objectiveCpp))}}),He.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ze(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.oCaml))}}),He.of({name:"Octave",extensions:["m"],load(){return Ze(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>ct(e.octave))}}),He.of({name:"Oz",extensions:["oz"],load(){return Ze(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>ct(e.oz))}}),He.of({name:"Pascal",extensions:["p","pas"],load(){return Ze(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>ct(e.pascal))}}),He.of({name:"Perl",extensions:["pl","pm"],load(){return Ze(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>ct(e.perl))}}),He.of({name:"Pig",extensions:["pig"],load(){return Ze(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>ct(e.pig))}}),He.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ze(()=>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 Ze(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>ct(e.properties))}}),He.of({name:"ProtoBuf",extensions:["proto"],load(){return Ze(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>ct(e.protobuf))}}),He.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ze(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>ct(e.pug))}}),He.of({name:"Puppet",extensions:["pp"],load(){return Ze(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>ct(e.puppet))}}),He.of({name:"Q",extensions:["q"],load(){return Ze(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>ct(e.q))}}),He.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ze(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>ct(e.r))}}),He.of({name:"RPM Changes",load(){return Ze(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ct(e.rpmChanges))}}),He.of({name:"RPM Spec",extensions:["spec"],load(){return Ze(()=>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 Ze(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>ct(e.ruby))}}),He.of({name:"SAS",extensions:["sas"],load(){return Ze(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>ct(e.sas))}}),He.of({name:"Scala",extensions:["scala"],load(){return Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.scala))}}),He.of({name:"Scheme",extensions:["scm","ss"],load(){return Ze(()=>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 Ze(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>ct(e.shell))}}),He.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ze(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>ct(e.sieve))}}),He.of({name:"Smalltalk",extensions:["st"],load(){return Ze(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>ct(e.smalltalk))}}),He.of({name:"Solr",load(){return Ze(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>ct(e.solr))}}),He.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ze(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.sml))}}),He.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ze(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>ct(e.sparql))}}),He.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ze(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>ct(e.spreadsheet))}}),He.of({name:"Squirrel",extensions:["nut"],load(){return Ze(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.squirrel))}}),He.of({name:"Stylus",extensions:["styl"],load(){return Ze(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>ct(e.stylus))}}),He.of({name:"Swift",extensions:["swift"],load(){return Ze(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>ct(e.swift))}}),He.of({name:"sTeX",load(){return Ze(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),He.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ze(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),He.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ze(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),He.of({name:"Tcl",extensions:["tcl"],load(){return Ze(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>ct(e.tcl))}}),He.of({name:"Textile",extensions:["textile"],load(){return Ze(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>ct(e.textile))}}),He.of({name:"TiddlyWiki",load(){return Ze(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>ct(e.tiddlyWiki))}}),He.of({name:"Tiki wiki",load(){return Ze(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>ct(e.tiki))}}),He.of({name:"TOML",extensions:["toml"],load(){return Ze(()=>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 Ze(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>ct(e.troff))}}),He.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ze(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>ct(e.ttcn))}}),He.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ze(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>ct(e.ttcnCfg))}}),He.of({name:"Turtle",extensions:["ttl"],load(){return Ze(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>ct(e.turtle))}}),He.of({name:"Web IDL",extensions:["webidl"],load(){return Ze(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>ct(e.webIDL))}}),He.of({name:"VB.NET",extensions:["vb"],load(){return Ze(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>ct(e.vb))}}),He.of({name:"VBScript",extensions:["vbs"],load(){return Ze(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>ct(e.vbScript))}}),He.of({name:"Velocity",extensions:["vtl"],load(){return Ze(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>ct(e.velocity))}}),He.of({name:"Verilog",extensions:["v"],load(){return Ze(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),He.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ze(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>ct(e.vhdl))}}),He.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ze(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>ct(e.xQuery))}}),He.of({name:"Yacas",extensions:["ys"],load(){return Ze(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>ct(e.yacas))}}),He.of({name:"Z80",extensions:["z80"],load(){return Ze(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>ct(e.z80))}}),He.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ze(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.mscgen))}}),He.of({name:"Xù",extensions:["xu"],load(){return Ze(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.xu))}}),He.of({name:"MsGenny",extensions:["msgenny"],load(){return Ze(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.msgenny))}}),He.of({name:"Vue",extensions:["vue"],load(){return Ze(()=>import("./index-BZ2guaof.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),He.of({name:"Angular Template",load(){return Ze(()=>import("./index-DXcOHFrD.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];var Lue=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=gt.theme(s,{dark:t==="dark"}),l=iO.define(n),c=[o,cue(l)];return c},Qsr={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)"},Wsr=[{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"}],H6=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return Lue({theme:t,settings:Bm({},Qsr,r),styles:[...Wsr,...n]})};H6();const Xsr=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Bue(e.state,r.from);return n.line?Ysr(e):n.block?Jsr(e):!1};function Fue(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 Ysr=Fue(rar,0),Ksr=Fue(TYe,0),Jsr=Fue((e,t)=>TYe(e,t,tar(t)),0);function Bue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const zC=50;function ear(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-zC,n),i=e.sliceDoc(s,s+zC),o=/\s*$/.exec(a)[0].length,l=/^\s*/.exec(i)[0].length,c=a.length-o;if(a.slice(c-t.length,c)==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*zC?d=p=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+zC),p=e.sliceDoc(s-zC,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 tar(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 TYe(e,t,r=t.selection.ranges){let n=r.map(a=>Bue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>ear(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:c,close:d}=o;a.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:d.pos-d.margin,to:d.pos+l.close.length})}return{changes:a}}return null}function rar(e,t,r=t.selection.ranges){let n=[],s=-1;for(let{from:a,to:i}of r){let o=n.length,l=1e9,c=Bue(t,a).line;if(c){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+c.length)==c?f:-1;f<p.text.length&&f<l&&(l=f),n.push({line:p,comment:m,token:c,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:c,empty:d,single:p}of n)(p||!d)&&a.push({from:o.from+c,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 c=i.from+o,d=c+l.length;i.text[d-i.from]==" "&&d++,a.push({from:c,to:d})}return{changes:a}}return null}const ure=ig.define(),nar=ig.define(),sar=Yt.define(),AYe=Yt.define({combine(e){return og(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)})}}),DYe=go.define({create(){return bm.empty},update(e,t){let r=t.state.facet(AYe),n=t.annotation(ure);if(n){let l=xu.fromTransaction(t,n.selection),c=n.side,d=c==0?e.undone:e.done;return l?d=T4(d,d.length,r.minDepth,l):d=RYe(d,t.startState.selection),new bm(c==0?n.rest:d,c==0?d:n.rest)}let s=t.annotation(nar);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(Do.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=xu.fromTransaction(t),i=t.annotation(Do.time),o=t.annotation(Do.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 bm(e.done.map(xu.fromJSON),e.undone.map(xu.fromJSON))}});function aar(e={}){return[DYe,AYe.of(e),gt.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?IYe:t.inputType=="historyRedo"?dre:null;return n?(t.preventDefault(),n(r)):!1}})]}function Z6(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(DYe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const IYe=Z6(0,!1),dre=Z6(1,!1),iar=Z6(0,!0),oar=Z6(1,!0);class xu{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 xu(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 xu(t.changes&&ko.fromJSON(t.changes),[],t.mapped&&Dm.fromJSON(t.mapped),t.startSelection&&Ke.fromJSON(t.startSelection),t.selectionsAfter.map(Ke.fromJSON))}static fromTransaction(t,r){let n=Mp;for(let s of t.startState.facet(sar)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new xu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,Mp)}static selection(t){return new xu(void 0,Mp,void 0,void 0,t)}}function T4(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 lar(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 c=r[l++],d=r[l++];o>=c&&i<=d&&(n=!0)}}),n}function car(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function NYe(e,t){return e.length?t.length?e.concat(t):e:t}const Mp=[],uar=200;function RYe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-uar));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),T4(e,e.length-1,1e9,r.setSelAfter(n)))}else return[xu.selection([t])]}function dar(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 xW(e,t){if(!e.length)return e;let r=e.length,n=Mp;for(;r;){let s=par(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?[xu.selection(n)]:Mp}function par(e,t,r){let n=NYe(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):Mp,r);if(!e.changes)return xu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new xu(s,sn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const far=/^(input\.type|delete)($|\.)/;class bm{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 bm(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||far.test(n))&&(!o.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,lar(o.changes,t.changes))||n=="input.type.compose")?i=T4(i,i.length-1,s.minDepth,new xu(t.changes.compose(o.changes),NYe(sn.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,Mp)):i=T4(i,i.length,s.minDepth,t),new bm(i,Mp,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Mp;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&car(a[a.length-1],t)?this:new bm(RYe(this.done,t),this.undone,r,n)}addMapping(t){return new bm(xW(this.done,t),xW(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:ure.of({side:t,rest:dar(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let o=s.length==1?Mp:s.slice(0,s.length-1);return a.mapped&&(o=xW(o,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:ure.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}bm.empty=new bm(Mp,Mp);const har=[{key:"Mod-z",run:IYe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:dre,preventDefault:!0},{linux:"Ctrl-Shift-z",run:dre,preventDefault:!0},{key:"Mod-u",run:iar,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:oar,preventDefault:!0}];function lO(e,t){return Ke.create(e.ranges.map(t),e.mainIndex)}function Th(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Ah({state:e,dispatch:t},r){let n=lO(e.selection,r);return n.eq(e.selection,!0)?!1:(t(Th(e,n)),!0)}function G6(e,t){return Ke.cursor(t?e.to:e.from)}function PYe(e,t){return Ah(e,r=>r.empty?e.moveByChar(r,t):G6(r,t))}function mc(e){return e.textDirectionAt(e.state.selection.main.head)==Ra.LTR}const jYe=e=>PYe(e,!mc(e)),$Ye=e=>PYe(e,mc(e));function MYe(e,t){return Ah(e,r=>r.empty?e.moveByGroup(r,t):G6(r,t))}const mar=e=>MYe(e,!mc(e)),gar=e=>MYe(e,mc(e));function yar(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 Q6(e,t,r){let n=Ca(e).resolveInner(t.head),s=r?fn.closedBy:fn.openedBy;for(let l=t.head;;){let c=r?n.childAfter(l):n.childBefore(l);if(!c)break;yar(e,c,s)?n=c:l=r?c.to:c.from}let a=n.type.prop(s),i,o;return a&&(i=r?ym(e,n.from,1):ym(e,n.to,-1))&&i.matched?o=r?i.end.to:i.end.from:o=r?n.to:n.from,Ke.cursor(o,r?-1:1)}const bar=e=>Ah(e,t=>Q6(e.state,t,!mc(e))),xar=e=>Ah(e,t=>Q6(e.state,t,mc(e)));function LYe(e,t){return Ah(e,r=>{if(!r.empty)return G6(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const FYe=e=>LYe(e,!1),BYe=e=>LYe(e,!0);function zYe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,s;if(t){for(let a of e.state.facet(gt.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 UYe(e,t){let r=zYe(e),{state:n}=e,s=lO(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):G6(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,c=o.bottom-r.marginBottom;i&&i.top>l&&i.bottom<c&&(a=gt.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-l}))}return e.dispatch(Th(n,s),{effects:a}),!0}const cDe=e=>UYe(e,!1),pre=e=>UYe(e,!0);function Tx(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=Ke.cursor(n.from+a))}return s}const war=e=>Ah(e,t=>Tx(e,t,!0)),Sar=e=>Ah(e,t=>Tx(e,t,!1)),Ear=e=>Ah(e,t=>Tx(e,t,!mc(e))),_ar=e=>Ah(e,t=>Tx(e,t,mc(e))),kar=e=>Ah(e,t=>Ke.cursor(e.lineBlockAt(t.head).from,1)),Oar=e=>Ah(e,t=>Ke.cursor(e.lineBlockAt(t.head).to,-1));function Car(e,t,r){let n=!1,s=lO(e.selection,a=>{let i=ym(e,a.head,-1)||ym(e,a.head,1)||a.head>0&&ym(e,a.head-1,1)||a.head<e.doc.length&&ym(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 Ke.cursor(o)});return n?(t(Th(e,s)),!0):!1}const Tar=({state:e,dispatch:t})=>Car(e,t);function hf(e,t){let r=lO(e.state.selection,n=>{let s=t(n);return Ke.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return r.eq(e.state.selection)?!1:(e.dispatch(Th(e.state,r)),!0)}function VYe(e,t){return hf(e,r=>e.moveByChar(r,t))}const qYe=e=>VYe(e,!mc(e)),HYe=e=>VYe(e,mc(e));function ZYe(e,t){return hf(e,r=>e.moveByGroup(r,t))}const Aar=e=>ZYe(e,!mc(e)),Dar=e=>ZYe(e,mc(e)),Iar=e=>hf(e,t=>Q6(e.state,t,!mc(e))),Nar=e=>hf(e,t=>Q6(e.state,t,mc(e)));function GYe(e,t){return hf(e,r=>e.moveVertically(r,t))}const QYe=e=>GYe(e,!1),WYe=e=>GYe(e,!0);function XYe(e,t){return hf(e,r=>e.moveVertically(r,t,zYe(e).height))}const uDe=e=>XYe(e,!1),dDe=e=>XYe(e,!0),Rar=e=>hf(e,t=>Tx(e,t,!0)),Par=e=>hf(e,t=>Tx(e,t,!1)),jar=e=>hf(e,t=>Tx(e,t,!mc(e))),$ar=e=>hf(e,t=>Tx(e,t,mc(e))),Mar=e=>hf(e,t=>Ke.cursor(e.lineBlockAt(t.head).from)),Lar=e=>hf(e,t=>Ke.cursor(e.lineBlockAt(t.head).to)),pDe=({state:e,dispatch:t})=>(t(Th(e,{anchor:0})),!0),fDe=({state:e,dispatch:t})=>(t(Th(e,{anchor:e.doc.length})),!0),hDe=({state:e,dispatch:t})=>(t(Th(e,{anchor:e.selection.main.anchor,head:0})),!0),mDe=({state:e,dispatch:t})=>(t(Th(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Far=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Bar=({state:e,dispatch:t})=>{let r=W6(e).map(({from:n,to:s})=>Ke.range(n,Math.min(s+1,e.doc.length)));return t(e.update({selection:Ke.create(r),userEvent:"select"})),!0},zar=({state:e,dispatch:t})=>{let r=lO(e.selection,n=>{let s=Ca(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 Ke.range(o.to,o.from)}return n});return r.eq(e.selection)?!1:(t(Th(e,r)),!0)};function YYe(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(c=>c.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(Th(r,Ke.create(s,s.length-1))),!0)}const Uar=e=>YYe(e,!1),Var=e=>YYe(e,!0),qar=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=Ke.create([r.main]):r.main.empty||(n=Ke.create([Ke.cursor(r.main.head)])),n?(t(Th(e,n)),!0):!1};function qR(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=Xj(e,l,!1)):l>i&&(r="delete.forward",l=Xj(e,l,!0)),i=Math.min(i,l),o=Math.max(o,l)}else i=Xj(e,i,!1),o=Xj(e,o,!0);return i==o?{range:a}:{changes:{from:i,to:o},range:Ke.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"?gt.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function Xj(e,t,r){if(e instanceof gt)for(let n of e.state.facet(gt.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const KYe=(e,t,r)=>qR(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 c=hh(o,a.tabSize),d=c%T1(a)||T1(a);for(let p=0;p<d&&o[o.length-1-p]==" ";p++)s--;l=s}else l=ul(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=ul(i.text,l-i.from,!1,!1)+i.from);return l}),fre=e=>KYe(e,!1,!0),JYe=e=>KYe(e,!0,!1),eKe=(e,t)=>qR(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=ul(a.text,n-a.from,t)+a.from,c=a.text.slice(Math.min(n,l)-a.from,Math.max(n,l)-a.from),d=i(c);if(o!=null&&d!=o)break;(c!=" "||n!=r.head)&&(o=d),n=l}return n}),tKe=e=>eKe(e,!1),Har=e=>eKe(e,!0),Zar=e=>qR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),Gar=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),Qar=e=>qR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),War=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Ts.of(["",""])},range:Ke.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},Xar=({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:ul(a.text,s-a.from,!1)+a.from,o=s==a.to?s+1:ul(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:Ke.cursor(o)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function W6(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 rKe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of W6(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(Ke.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(Ke.range(l.anchor-o,l.head-o))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:Ke.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Yar=({state:e,dispatch:t})=>rKe(e,t,!1),Kar=({state:e,dispatch:t})=>rKe(e,t,!0);function nKe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of W6(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 Jar=({state:e,dispatch:t})=>nKe(e,t,!1),eir=({state:e,dispatch:t})=>nKe(e,t,!0),tir=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(W6(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=lO(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 rir(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=Ca(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 gDe=sKe(!1),nir=sKe(!0);function sKe(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&&rir(t,a);e&&(a=i=(i<=o.to?o:t.doc.lineAt(i)).to);let c=new z6(t,{simulateBreak:a,simulateDoubleBreak:!!l}),d=iue(c,a);for(d==null&&(d=hh(/^\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=["",VD(t,d)];return l&&p.push(VD(t,c.lineIndent(o.from,-1))),{changes:{from:a,to:i,insert:Ts.of(p)},range:Ke.cursor(a+1+p[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function zue(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:Ke.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const sir=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new z6(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=zue(e,(a,i,o)=>{let l=iue(n,a.from);if(l==null)return;/\S/.test(a.text)||(l=0);let c=/^\s*/.exec(a.text)[0],d=VD(e,l);(c!=d||o.from<a.from+c.length)&&(r[a.from]=l,i.push({from:a.from,to:a.from+c.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},aKe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(zue(e,(r,n)=>{n.push({from:r.from,insert:e.facet(aO)})}),{userEvent:"input.indent"})),!0),iKe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(zue(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=hh(s,e.tabSize),i=0,o=VD(e,Math.max(0,a-T1(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),air=e=>(e.setTabFocusMode(),!0),iir=[{key:"Ctrl-b",run:jYe,shift:qYe,preventDefault:!0},{key:"Ctrl-f",run:$Ye,shift:HYe},{key:"Ctrl-p",run:FYe,shift:QYe},{key:"Ctrl-n",run:BYe,shift:WYe},{key:"Ctrl-a",run:kar,shift:Mar},{key:"Ctrl-e",run:Oar,shift:Lar},{key:"Ctrl-d",run:JYe},{key:"Ctrl-h",run:fre},{key:"Ctrl-k",run:Zar},{key:"Ctrl-Alt-h",run:tKe},{key:"Ctrl-o",run:War},{key:"Ctrl-t",run:Xar},{key:"Ctrl-v",run:pre}],oir=[{key:"ArrowLeft",run:jYe,shift:qYe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:mar,shift:Aar,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Ear,shift:jar,preventDefault:!0},{key:"ArrowRight",run:$Ye,shift:HYe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:gar,shift:Dar,preventDefault:!0},{mac:"Cmd-ArrowRight",run:_ar,shift:$ar,preventDefault:!0},{key:"ArrowUp",run:FYe,shift:QYe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:pDe,shift:hDe},{mac:"Ctrl-ArrowUp",run:cDe,shift:uDe},{key:"ArrowDown",run:BYe,shift:WYe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:fDe,shift:mDe},{mac:"Ctrl-ArrowDown",run:pre,shift:dDe},{key:"PageUp",run:cDe,shift:uDe},{key:"PageDown",run:pre,shift:dDe},{key:"Home",run:Sar,shift:Par,preventDefault:!0},{key:"Mod-Home",run:pDe,shift:hDe},{key:"End",run:war,shift:Rar,preventDefault:!0},{key:"Mod-End",run:fDe,shift:mDe},{key:"Enter",run:gDe,shift:gDe},{key:"Mod-a",run:Far},{key:"Backspace",run:fre,shift:fre,preventDefault:!0},{key:"Delete",run:JYe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:tKe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Har,preventDefault:!0},{mac:"Mod-Backspace",run:Gar,preventDefault:!0},{mac:"Mod-Delete",run:Qar,preventDefault:!0}].concat(iir.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),lir=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:bar,shift:Iar},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:xar,shift:Nar},{key:"Alt-ArrowUp",run:Yar},{key:"Shift-Alt-ArrowUp",run:Jar},{key:"Alt-ArrowDown",run:Kar},{key:"Shift-Alt-ArrowDown",run:eir},{key:"Mod-Alt-ArrowUp",run:Uar},{key:"Mod-Alt-ArrowDown",run:Var},{key:"Escape",run:qar},{key:"Mod-Enter",run:nir},{key:"Alt-l",mac:"Ctrl-l",run:Bar},{key:"Mod-i",run:zar,preventDefault:!0},{key:"Mod-[",run:iKe},{key:"Mod-]",run:aKe},{key:"Mod-Alt-\\",run:sir},{key:"Shift-Mod-k",run:tir},{key:"Shift-Mod-\\",run:Tar},{key:"Mod-/",run:Xsr},{key:"Alt-A",run:Ksr},{key:"Ctrl-m",mac:"Shift-Alt-m",run:air}].concat(oir),cir={key:"Tab",run:aKe,shift:iKe},yDe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class U_{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(yDe(o)):yDe,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 pu(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=Uce(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=om(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"&&(U_.prototype[Symbol.iterator]=function(){return this});const oKe={from:-1,to:-1,match:/.*/.exec("")},Uue="gm"+(/x/.unicode==null?"":"u");class lKe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=oKe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new cKe(t,r,n,s,a);this.re=new RegExp(r,Uue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=A4(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=A4(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 wW=new WeakMap;class XE{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=wW.get(t);if(!s||s.from>=n||s.to<=r){let o=new XE(r,t.sliceString(r,n));return wW.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)),wW.set(t,new XE(i,a)),new XE(r,a.slice(r-i,n-i))}}class cKe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=oKe,this.matchPos=A4(t,s),this.re=new RegExp(r,Uue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=XE.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=A4(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=XE.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(lKe.prototype[Symbol.iterator]=cKe.prototype[Symbol.iterator]=function(){return this});function uir(e){try{return new RegExp(e,Uue),!0}catch{return!1}}function A4(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 hre(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),r=Da("input",{class:"cm-textfield",name:"line",value:t}),n=Da("form",{class:"cm-gotoLine",onkeydown:a=>{a.keyCode==27?(a.preventDefault(),e.dispatch({effects:CA.of(!1)}),e.focus()):a.keyCode==13&&(a.preventDefault(),s())},onsubmit:a=>{a.preventDefault(),s()}},Da("label",e.state.phrase("Go to line"),": ",r)," ",Da("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),Da("button",{name:"close",onclick:()=>{e.dispatch({effects:CA.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,c,d,p]=a,f=d?+d.slice(1):0,h=c?+c:o.number;if(c&&p){let b=h/100;l&&(b=b*(l=="-"?-1:1)+o.number/i.doc.lines),h=Math.round(i.doc.lines*b)}else c&&l&&(h=h*(l=="-"?-1:1)+o.number);let m=i.doc.line(Math.max(1,Math.min(i.doc.lines,h))),g=Ke.cursor(m.from+Math.max(0,Math.min(f,m.length)));e.dispatch({effects:[CA.of(!1),gt.scrollIntoView(g.from,{y:"center"})],selection:g}),e.focus()}return{dom:n}}const CA=sn.define(),bDe=go.define({create(){return!0},update(e,t){for(let r of t.effects)r.is(CA)&&(e=r.value);return e},provide:e=>UD.from(e,t=>t?hre:null)}),dir=e=>{let t=zD(e,hre);if(!t){let r=[CA.of(!0)];e.state.field(bDe,!1)==null&&r.push(sn.appendConfig.of([bDe,pir])),e.dispatch({effects:r}),t=zD(e,hre)}return t&&t.dom.querySelector("input").select(),!0},pir=gt.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"}}}),fir={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},hir=Yt.define({combine(e){return og(e,fir,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function mir(e){return[xir,vir]}const gir=nr.mark({class:"cm-selectionMatch"}),yir=nr.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function vDe(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=hi.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=hi.Word)}function bir(e,t,r,n){return e(t.sliceDoc(r,r+1))==hi.Word&&e(t.sliceDoc(n-1,n))==hi.Word}const vir=Ci.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(hir),{state:r}=e,n=r.selection;if(n.ranges.length>1)return nr.none;let s=n.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return nr.none;let l=r.wordAt(s.head);if(!l)return nr.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 nr.none;if(t.wholeWords){if(a=r.sliceDoc(s.from,s.to),i=r.charCategorizer(s.head),!(vDe(i,r,s.from,s.to)&&bir(i,r,s.from,s.to)))return nr.none}else if(a=r.sliceDoc(s.from,s.to),!a)return nr.none}let o=[];for(let l of e.visibleRanges){let c=new U_(r.doc,a,l.from,l.to);for(;!c.next().done;){let{from:d,to:p}=c.value;if((!i||vDe(i,r,d,p))&&(s.empty&&d<=s.from&&p>=s.to?o.push(yir.range(d,p)):(d>=s.to||p<=s.from)&&o.push(gir.range(d,p)),o.length>t.maxMatches))return nr.none}}return nr.set(o)}},{decorations:e=>e.decorations}),xir=gt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),wir=({state:e,dispatch:t})=>{let{selection:r}=e,n=Ke.create(r.ranges.map(s=>e.wordAt(s.head)||Ke.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function Sir(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 U_(e.doc,t,n[n.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new U_(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 Eir=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return wir({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=Sir(e,n);return s?(t(e.update({selection:e.selection.addRange(Ke.range(s.from,s.to),!1),effects:gt.scrollIntoView(s.to)})),!0):!1},cO=Yt.define({combine(e){return og(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new jir(t),scrollToMatch:t=>gt.scrollIntoView(t)})}});class uKe{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||uir(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"?`
|
|
164
164
|
`: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 Cir(this):new kir(this)}getCursor(t,r=0,n){let s=t.doc?t:Wn.create({doc:t});return n==null&&(n=s.doc.length),this.regexp?aE(this,s,r,n):sE(this,s,r,n)}}class dKe{constructor(t){this.spec=t}}function sE(e,t,r,n){return new U_(t.doc,e.unquoted,r,n,e.caseSensitive?void 0:s=>s.toLowerCase(),e.wholeWord?_ir(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function _ir(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(D4(s,r-a))!=hi.Word||t(I4(s,r-a))!=hi.Word)&&(t(I4(s,n-a))!=hi.Word||t(D4(s,n-a))!=hi.Word))}class kir extends dKe{constructor(t){super(t)}nextMatch(t,r,n){let s=sE(this.spec,t,n,t.doc.length).nextOverlapping();if(s.done){let a=Math.min(t.doc.length,r+this.spec.unquoted.length);s=sE(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=sE(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=sE(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=sE(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 aE(e,t,r,n){return new lKe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?Oir(t.charCategorizer(t.selection.main.head)):void 0},r,n)}function D4(e,t){return e.slice(ul(e,t,!1),t)}function I4(e,t){return e.slice(t,ul(e,t))}function Oir(e){return(t,r,n)=>!n[0].length||(e(D4(n.input,n.index))!=hi.Word||e(I4(n.input,n.index))!=hi.Word)&&(e(I4(n.input,n.index+n[0].length))!=hi.Word||e(D4(n.input,n.index+n[0].length))!=hi.Word)}class Cir extends dKe{nextMatch(t,r,n){let s=aE(this.spec,t,n,t.doc.length).next();return s.done&&(s=aE(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=aE(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=aE(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=aE(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 JD=sn.define(),Vue=sn.define(),_v=go.define({create(e){return new SW(mre(e).create(),null)},update(e,t){for(let r of t.effects)r.is(JD)?e=new SW(r.value.create(),e.panel):r.is(Vue)&&(e=new SW(e.query,r.value?que:null));return e},provide:e=>UD.from(e,t=>t.panel)});class SW{constructor(t,r){this.query=t,this.panel=r}}const Tir=nr.mark({class:"cm-searchMatch"}),Air=nr.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Dir=Ci.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(_v))}update(e){let t=e.state.field(_v);(t!=e.startState.field(_v)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return nr.none;let{view:r}=this,n=new Nu;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,(c,d)=>{let p=r.state.selection.ranges.some(f=>f.from==c&&f.to==d);n.add(c,d,p?Air:Tir)})}return n.finish()}},{decorations:e=>e.decorations});function HR(e){return t=>{let r=t.state.field(_v,!1);return r&&r.query.spec.valid?e(t,r):hKe(t)}}const N4=HR((e,{query:t})=>{let{to:r}=e.state.selection.main,n=t.nextMatch(e.state,r,r);if(!n)return!1;let s=Ke.single(n.from,n.to),a=e.state.facet(cO);return e.dispatch({selection:s,effects:[Hue(e,n),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),fKe(e),!0}),R4=HR((e,{query:t})=>{let{state:r}=e,{from:n}=r.selection.main,s=t.prevMatch(r,n,n);if(!s)return!1;let a=Ke.single(s.from,s.to),i=e.state.facet(cO);return e.dispatch({selection:a,effects:[Hue(e,s),i.scrollToMatch(a.main,e)],userEvent:"select.search"}),fKe(e),!0}),Iir=HR((e,{query:t})=>{let r=t.matchAll(e.state,1e3);return!r||!r.length?!1:(e.dispatch({selection:Ke.create(r.map(n=>Ke.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),Nir=({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 U_(e.doc,e.sliceDoc(n,s));!o.next().done;){if(a.length>1e3)return!1;o.value.from==n&&(i=a.length),a.push(Ke.range(o.value.from,o.value.to))}return t(e.update({selection:Ke.create(a,i),userEvent:"select.search.matches"})),!0},xDe=HR((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,c,d=[];i.from==n&&i.to==s&&(c=r.toText(t.getReplacement(i)),o.push({from:i.from,to:i.to,insert:c}),i=t.nextMatch(r,i.from,i.to),d.push(gt.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+".")));let p=e.state.changes(o);return i&&(l=Ke.single(i.from,i.to).map(p),d.push(Hue(e,i)),d.push(r.facet(cO).scrollToMatch(l.main,e))),e.dispatch({changes:p,selection:l,effects:d,userEvent:"input.replace"}),!0}),Rir=HR((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:gt.announce.of(n),userEvent:"input.replace.all"}),!0});function que(e){return e.state.facet(cO).createPanel(e)}function mre(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 c=e.facet(cO);return new uKe({search:((r=t?.literal)!==null&&r!==void 0?r:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=t?.caseSensitive)!==null&&n!==void 0?n:c.caseSensitive,literal:(s=t?.literal)!==null&&s!==void 0?s:c.literal,regexp:(a=t?.regexp)!==null&&a!==void 0?a:c.regexp,wholeWord:(i=t?.wholeWord)!==null&&i!==void 0?i:c.wholeWord})}function pKe(e){let t=zD(e,que);return t&&t.dom.querySelector("[main-field]")}function fKe(e){let t=pKe(e);t&&t==e.root.activeElement&&t.select()}const hKe=e=>{let t=e.state.field(_v,!1);if(t&&t.panel){let r=pKe(e);if(r&&r!=e.root.activeElement){let n=mre(e.state,t.query.spec);n.valid&&e.dispatch({effects:JD.of(n)}),r.focus(),r.select()}}else e.dispatch({effects:[Vue.of(!0),t?JD.of(mre(e.state,t.query.spec)):sn.appendConfig.of(Mir)]});return!0},mKe=e=>{let t=e.state.field(_v,!1);if(!t||!t.panel)return!1;let r=zD(e,que);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Vue.of(!1)}),!0},Pir=[{key:"Mod-f",run:hKe,scope:"editor search-panel"},{key:"F3",run:N4,shift:R4,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:N4,shift:R4,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:mKe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Nir},{key:"Mod-Alt-g",run:dir},{key:"Mod-d",run:Eir,preventDefault:!0}];class jir{constructor(t){this.view=t;let r=this.query=t.state.field(_v).query.spec;this.commit=this.commit.bind(this),this.searchField=Da("input",{value:r.search,placeholder:id(t,"Find"),"aria-label":id(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Da("input",{value:r.replace,placeholder:id(t,"Replace"),"aria-label":id(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Da("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=Da("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=Da("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(s,a,i){return Da("button",{class:"cm-button",name:s,onclick:a,type:"button"},i)}this.dom=Da("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>N4(t),[id(t,"next")]),n("prev",()=>R4(t),[id(t,"previous")]),n("select",()=>Iir(t),[id(t,"all")]),Da("label",null,[this.caseField,id(t,"match case")]),Da("label",null,[this.reField,id(t,"regexp")]),Da("label",null,[this.wordField,id(t,"by word")]),...t.state.readOnly?[]:[Da("br"),this.replaceField,n("replace",()=>xDe(t),[id(t,"replace")]),n("replaceAll",()=>Rir(t),[id(t,"replace all")])],Da("button",{name:"close",onclick:()=>mKe(t),"aria-label":id(t,"close"),type:"button"},["×"])])}commit(){let t=new uKe({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:JD.of(t)}))}keydown(t){uJt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?R4:N4)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),xDe(this.view))}update(t){for(let r of t.transactions)for(let n of r.effects)n.is(JD)&&!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(cO).top}}function id(e,t){return e.state.phrase(t)}const Yj=30,Kj=/[\s\.,:;?!]/;function Hue(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-Yj),i=Math.min(s,r+Yj),o=e.state.sliceDoc(a,i);if(a!=n.from){for(let l=0;l<Yj;l++)if(!Kj.test(o[l+1])&&Kj.test(o[l])){o=o.slice(l);break}}if(i!=s){for(let l=o.length-1;l>o.length-Yj;l--)if(!Kj.test(o[l-1])&&Kj.test(o[l])){o=o.slice(0,l);break}}return gt.announce.of(`${e.state.phrase("current match")}. ${o} ${e.state.phrase("on line")} ${n.number}.`)}const $ir=gt.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"}}),Mir=[_v,Ch.low(Dir),$ir];class wDe{constructor(t,r,n){this.from=t,this.to=r,this.diagnostic=n}}class j0{constructor(t,r,n){this.diagnostics=t,this.panel=r,this.selected=n}static init(t,r,n){let s=n.facet(eI).markerFilter;s&&(t=s(t,n));let a=t.slice().sort((d,p)=>d.from-p.from||d.to-p.to),i=new Nu,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((g,b)=>Math.min(g,b.to),p&&p.from>f?p.from:1e8)):(f=p.from,h=p.to,o.push(p),d++);d<a.length;){let g=a[d];if(g.from==f&&(g.to>g.from||g.to==f))o.push(g),d++,h=Math.min(g.to,h);else{h=Math.min(g.from,h);break}}let m=Xir(o);if(o.some(g=>g.from==g.to||g.from==g.to-1&&n.doc.lineAt(g.from).to==g.from))i.add(f,f,nr.widget({widget:new Zir(m),diagnostics:o.slice()}));else{let g=o.reduce((b,v)=>v.markClass?b+" "+v.markClass:b,"");i.add(f,h,nr.mark({class:"cm-lintRange cm-lintRange-"+m+g,diagnostics:o.slice(),inclusiveEnd:o.some(b=>b.to>h)}))}l=h;for(let g=0;g<o.length;g++)o[g].to<=l&&o.splice(g--,1)}let c=i.finish();return new j0(c,r,V_(c))}}function V_(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 wDe(s,a,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new wDe(n.from,a,n.diagnostic)}}),n}function Lir(e,t){let r=t.pos,n=t.end||r,s=e.state.facet(eI).hideOn(e,r,n);if(s!=null)return s;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(gKe))||e.changes.touchesRange(a.from,Math.max(a.to,n)))}function Fir(e,t){return e.field(kd,!1)?t:t.concat(sn.appendConfig.of(Yir))}const gKe=sn.define(),Zue=sn.define(),yKe=sn.define(),kd=go.define({create(){return new j0(nr.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=V_(r,e.selected.diagnostic,a)||V_(r,null,a)}!r.size&&s&&t.state.facet(eI).autoPanel&&(s=null),e=new j0(r,s,n)}for(let r of t.effects)if(r.is(gKe)){let n=t.state.facet(eI).autoPanel?r.value.length?tI.open:null:e.panel;e=j0.init(r.value,n,t.state)}else r.is(Zue)?e=new j0(e.diagnostics,r.value?tI.open:null,e.selected):r.is(yKe)&&(e=new j0(e.diagnostics,e.panel,r.value));return e},provide:e=>[UD.from(e,t=>t.panel),gt.decorations.from(e,t=>t.diagnostics)]}),Bir=nr.mark({class:"cm-lintRange cm-lintRange-active"});function zir(e,t,r){let{diagnostics:n}=e.state.field(kd),s,a=-1,i=-1;n.between(t-(r<0?1:0),t+(r>0?1:0),(l,c,{spec:d})=>{if(t>=l&&t<=c&&(l==c||(t>l||r>0)&&(t<c||r<0)))return s=d.diagnostics,a=l,i=c,!1});let o=e.state.facet(eI).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:Uir(e,s)}}}:null}function Uir(e,t){return Da("ul",{class:"cm-tooltip-lint"},t.map(r=>vKe(e,r,!1)))}const Vir=e=>{let t=e.state.field(kd,!1);(!t||!t.panel)&&e.dispatch({effects:Fir(e.state,[Zue.of(!0)])});let r=zD(e,tI.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},SDe=e=>{let t=e.state.field(kd,!1);return!t||!t.panel?!1:(e.dispatch({effects:Zue.of(!1)}),!0)},qir=e=>{let t=e.state.field(kd,!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)},Hir=[{key:"Mod-Shift-m",run:Vir,preventDefault:!0},{key:"F8",run:qir}],eI=Yt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...og(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:EDe,tooltipFilter:EDe,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 EDe(e,t){return e?t?(r,n)=>t(e(r,n),n):e:t}function bKe(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 vKe(e,t,r){var n;let s=r?bKe(t.actions):[];return Da("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Da("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=V_(e.state.field(kd).diagnostics,t);m&&a.apply(e,m.from,m.to)},{name:c}=a,d=s[i]?c.indexOf(s[i]):-1,p=d<0?c:[c.slice(0,d),Da("u",c.slice(d,d+1)),c.slice(d+1)],f=a.markClass?" "+a.markClass:"";return Da("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:l,onmousedown:l,"aria-label":` Action: ${c}${d<0?"":` (access key "${s[i]})"`}.`},p)}),t.source&&Da("div",{class:"cm-diagnosticSource"},t.source))}class Zir extends np{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Da("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class _De{constructor(t,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=vKe(t,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class tI{constructor(t){this.view=t,this.items=[];let r=s=>{if(s.keyCode==27)SDe(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=bKe(a.actions);for(let o=0;o<i.length;o++)if(i[o].toUpperCase().charCodeAt(0)==s.keyCode){let l=V_(this.view.state.field(kd).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=Da("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:r,onclick:n}),this.dom=Da("div",{class:"cm-panel-lint"},this.list,Da("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>SDe(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(kd).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(kd),n=0,s=!1,a=null,i=new Set;for(t.between(0,this.view.state.doc.length,(o,l,{spec:c})=>{for(let d of c.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 _De(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 _De(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 c=l.height/this.list.offsetHeight;o.top<l.top?this.list.scrollTop-=(l.top-o.top)/c:o.bottom>l.bottom&&(this.list.scrollTop+=(o.bottom-l.bottom)/c)}})):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(kd),n=V_(r.diagnostics,this.items[t].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:yKe.of(n)})}static open(t){return new tI(t)}}function Gir(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 Jj(e){return Gir(`<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 Qir=gt.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:Jj("#d11")},".cm-lintRange-warning":{backgroundImage:Jj("orange")},".cm-lintRange-info":{backgroundImage:Jj("#999")},".cm-lintRange-hint":{backgroundImage:Jj("#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 Wir(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function Xir(e){let t="hint",r=1;for(let n of e){let s=Wir(n.severity);s>r&&(r=s,t=n.severity)}return t}const Yir=[kd,gt.decorations.compute([kd],e=>{let{selected:t,panel:r}=e.field(kd);return!t||!r||t.from==t.to?nr.none:nr.set([Bir.range(t.from,t.to)])}),YJt(zir,{hideOn:Lir}),Qir];var kDe=function(t){t===void 0&&(t={});var{crosshairCursor:r=!1}=t,n=[];t.closeBracketsKeymap!==!1&&(n=n.concat(Ztr)),t.defaultKeymap!==!1&&(n=n.concat(lir)),t.searchKeymap!==!1&&(n=n.concat(Pir)),t.historyKeymap!==!1&&(n=n.concat(har)),t.foldKeymap!==!1&&(n=n.concat(Ier)),t.completionKeymap!==!1&&(n=n.concat(iXe)),t.lintKeymap!==!1&&(n=n.concat(Hir));var s=[];return t.lineNumbers!==!1&&s.push(oer()),t.highlightActiveLineGutter!==!1&&s.push(uer()),t.highlightSpecialChars!==!1&&s.push(OJt()),t.history!==!1&&s.push(aar()),t.foldGutter!==!1&&s.push(jer()),t.drawSelection!==!1&&s.push(gJt()),t.dropCursor!==!1&&s.push(wJt()),t.allowMultipleSelections!==!1&&s.push(Wn.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&s.push(Eer()),t.syntaxHighlighting!==!1&&s.push(cue(Fer,{fallback:!0})),t.bracketMatching!==!1&&s.push(Zer()),t.closeBrackets!==!1&&s.push(Utr()),t.autocompletion!==!1&&s.push(aXe()),t.rectangularSelection!==!1&&s.push(BJt()),r!==!1&&s.push(VJt()),t.highlightActiveLine!==!1&&s.push(NJt()),t.highlightSelectionMatches!==!1&&s.push(mir()),t.tabSize&&typeof t.tabSize=="number"&&s.push(aO.of(" ".repeat(t.tabSize))),s.concat([sO.of(n.flat())]).filter(Boolean)};const Kir="#e5c07b",ODe="#e06c75",Jir="#56b6c2",eor="#ffffff",GM="#abb2bf",gre="#7d8799",tor="#61afef",ror="#98c379",CDe="#d19a66",nor="#c678dd",sor="#21252b",TDe="#2c313a",ADe="#282c34",EW="#353a42",aor="#3E4451",DDe="#528bff",ior=gt.theme({"&":{color:GM,backgroundColor:ADe},".cm-content":{caretColor:DDe},".cm-cursor, .cm-dropCursor":{borderLeftColor:DDe},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:aor},".cm-panels":{backgroundColor:sor,color:GM},".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:ADe,color:gre,border:"none"},".cm-activeLineGutter":{backgroundColor:TDe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:EW},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:EW,borderBottomColor:EW},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:TDe,color:GM}}},{dark:!0}),oor=iO.define([{tag:re.keyword,color:nor},{tag:[re.name,re.deleted,re.character,re.propertyName,re.macroName],color:ODe},{tag:[re.function(re.variableName),re.labelName],color:tor},{tag:[re.color,re.constant(re.name),re.standard(re.name)],color:CDe},{tag:[re.definition(re.name),re.separator],color:GM},{tag:[re.typeName,re.className,re.number,re.changed,re.annotation,re.modifier,re.self,re.namespace],color:Kir},{tag:[re.operator,re.operatorKeyword,re.url,re.escape,re.regexp,re.link,re.special(re.string)],color:Jir},{tag:[re.meta,re.comment],color:gre},{tag:re.strong,fontWeight:"bold"},{tag:re.emphasis,fontStyle:"italic"},{tag:re.strikethrough,textDecoration:"line-through"},{tag:re.link,color:gre,textDecoration:"underline"},{tag:re.heading,fontWeight:"bold",color:ODe},{tag:[re.atom,re.bool,re.special(re.variableName)],color:CDe},{tag:[re.processingInstruction,re.string,re.inserted],color:ror},{tag:re.invalid,color:eor}]),lor=[ior,cue(oor)];var cor=gt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),uor=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(sO.of([cir])),o&&(typeof o=="boolean"?l.unshift(kDe()):l.unshift(kDe(o))),i&&l.unshift($Jt(i)),a){case"light":l.push(cor);break;case"dark":l.push(lor);break;case"none":break;default:l.push(a);break}return n===!1&&l.push(gt.editable.of(!1)),s&&l.push(Wn.readOnly.of(!0)),[...l]},dor=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 por{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 IDe=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 _W=null,hor=()=>typeof window>"u"?new IDe:(_W||(_W=new IDe),_W),NDe=ig.define(),mor=200,gor=[];function yor(e){var{value:t,selection:r,onChange:n,onStatistics:s,onCreateEditor:a,onUpdate:i,extensions:o=gor,autoFocus:l,theme:c="light",height:d=null,minHeight:p=null,maxHeight:f=null,width:h=null,minWidth:m=null,maxWidth:g=null,placeholder:b="",editable:v=!0,readOnly:w=!1,indentWithTab:S=!0,basicSetup:_=!0,root:O,initialState:C}=e,[T,A]=E.useState(),[I,R]=E.useState(),[P,L]=E.useState(),B=E.useState(()=>({current:null}))[0],M=E.useState(()=>({current:null}))[0],z=gt.theme({"&":{height:d,minHeight:p,maxHeight:f,width:h,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),H=gt.updateListener.of(Q=>{if(Q.docChanged&&typeof n=="function"&&!Q.transactions.some(U=>U.annotation(NDe))){B.current?B.current.reset():(B.current=new por(()=>{if(M.current){var U=M.current;M.current=null,U()}B.current=null},mor),hor().add(B.current));var $=Q.state.doc,X=$.toString();n(X,Q)}s&&s(dor(Q))}),q=uor({theme:c,editable:v,readOnly:w,placeholder:b,indentWithTab:S,basicSetup:_}),V=[H,z,...q];return i&&typeof i=="function"&&V.push(gt.updateListener.of(i)),V=V.concat(o),E.useLayoutEffect(()=>{if(T&&!P){var Q={doc:t,selection:r,extensions:V},$=C?Wn.fromJSON(C.json,Q,C.fields):Wn.create(Q);if(L($),!I){var X=new gt({state:$,parent:T,root:O});R(X),a&&a(X,$)}}return()=>{I&&(L(void 0),R(void 0))}},[T,P]),E.useEffect(()=>{e.container&&A(e.container)},[e.container]),E.useEffect(()=>()=>{I&&(I.destroy(),R(void 0)),B.current&&(B.current.cancel(),B.current=null)},[I]),E.useEffect(()=>{l&&I&&I.focus()},[l,I]),E.useEffect(()=>{I&&I.dispatch({effects:sn.reconfigure.of(V)})},[c,o,d,p,f,h,m,g,b,v,w,S,_,n,i]),E.useEffect(()=>{if(t!==void 0){var Q=I?I.state.doc.toString():"";if(I&&t!==Q){var $=B.current&&!B.current.isDone,X=()=>{I&&t!==I.state.doc.toString()&&I.dispatch({changes:{from:0,to:I.state.doc.toString().length,insert:t||""},annotations:[NDe.of(!0)]})};$?M.current=X:X()}}},[t,I]),{state:P,setState:L,view:I,setView:R,container:T,setContainer:A}}var bor=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Ld=E.forwardRef((e,t)=>{var{className:r,value:n="",selection:s,extensions:a=[],onChange:i,onStatistics:o,onCreateEditor:l,onUpdate:c,autoFocus:d,theme:p="light",height:f,minHeight:h,maxHeight:m,width:g,minWidth:b,maxWidth:v,basicSetup:w,placeholder:S,indentWithTab:_,editable:O,readOnly:C,root:T,initialState:A}=e,I=zle(e,bor),R=E.useRef(null),{state:P,view:L,container:B,setContainer:M}=yor({root:T,value:n,autoFocus:d,theme:p,height:f,minHeight:h,maxHeight:m,width:g,minWidth:b,maxWidth:v,basicSetup:w,placeholder:S,indentWithTab:_,editable:O,readOnly:C,selection:s,onChange:i,onStatistics:o,onCreateEditor:l,onUpdate:c,extensions:a,initialState:A});E.useImperativeHandle(t,()=>({editor:R.current,state:P,view:L}),[R,B,P,L]);var z=E.useCallback(q=>{R.current=q,M(q)},[M]);if(typeof n!="string")throw new Error("value must be typeof string but got "+typeof n);var H=typeof p=="string"?"cm-theme-"+p:"cm-theme";return u.jsx("div",Bm({ref:z,className:""+H+(r?" "+r:"")},I))});Ld.displayName="CodeMirror";function vor(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 xor=e=>{switch(e){case"success":return Eor;case"info":return kor;case"warning":return _or;case"error":return Oor;default:return null}},wor=Array(12).fill(0),Sor=({visible:e,className:t})=>Ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ee.createElement("div",{className:"sonner-spinner"},wor.map((r,n)=>Ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Eor=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"})),_or=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"})),kor=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"})),Oor=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"})),Cor=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"})),Tor=()=>{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 yre=1;class Aor{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:yre++,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 c=>{if(i=["resolve",c],Ee.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(Ior(c)&&!c.ok){a=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${c.status}`):r.error,f=typeof r.description=="function"?await r.description(`HTTP error! status: ${c.status}`):r.description,m=typeof p=="object"&&!Ee.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:f,...m})}else if(c instanceof Error){a=!1;const p=typeof r.error=="function"?await r.error(c):r.error,f=typeof r.description=="function"?await r.description(c):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(c):r.success,f=typeof r.description=="function"?await r.description(c):r.description,m=typeof p=="object"&&!Ee.isValidElement(p)?p:{message:p};this.create({id:n,type:"success",description:f,...m})}}).catch(async c=>{if(i=["reject",c],r.error!==void 0){a=!1;const d=typeof r.error=="function"?await r.error(c):r.error,p=typeof r.description=="function"?await r.description(c):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((c,d)=>o.then(()=>i[0]==="reject"?d(i[1]):c(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||yre++;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 lu=new Aor,Dor=(e,t)=>{const r=t?.id||yre++;return lu.addToast({title:e,...t,id:r}),r},Ior=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Nor=Dor,Ror=()=>lu.toasts,Por=()=>lu.getActiveToasts(),ic=Object.assign(Nor,{success:lu.success,info:lu.info,warning:lu.warning,error:lu.error,custom:lu.custom,message:lu.message,promise:lu.promise,dismiss:lu.dismiss,loading:lu.loading},{getHistory:Ror,getToasts:Por});vor("[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 e$(e){return e.label!==void 0}const jor=3,$or="24px",Mor="16px",RDe=4e3,Lor=356,For=14,Bor=45,zor=200;function Gh(...e){return e.filter(Boolean).join(" ")}function Uor(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const Vor=e=>{var t,r,n,s,a,i,o,l,c;const{invert:d,toast:p,unstyled:f,interacting:h,setHeights:m,visibleToasts:g,heights:b,index:v,toasts:w,expanded:S,removeToast:_,defaultRichColors:O,closeButton:C,style:T,cancelButtonStyle:A,actionButtonStyle:I,className:R="",descriptionClassName:P="",duration:L,position:B,gap:M,expandByDefault:z,classNames:H,icons:q,closeButtonAriaLabel:V="Close toast"}=e,[Q,$]=Ee.useState(null),[X,U]=Ee.useState(null),[N,Z]=Ee.useState(!1),[G,K]=Ee.useState(!1),[ee,te]=Ee.useState(!1),[se,ue]=Ee.useState(!1),[xe,W]=Ee.useState(!1),[ae,ne]=Ee.useState(0),[ye,le]=Ee.useState(0),be=Ee.useRef(p.duration||L||RDe),Ne=Ee.useRef(null),ke=Ee.useRef(null),oe=v===0,pe=v+1<=g,he=p.type,Ie=p.dismissible!==!1,Te=p.className||"",we=p.descriptionClassName||"",de=Ee.useMemo(()=>b.findIndex(mt=>mt.toastId===p.id)||0,[b,p.id]),De=Ee.useMemo(()=>{var mt;return(mt=p.closeButton)!=null?mt:C},[p.closeButton,C]),Le=Ee.useMemo(()=>p.duration||L||RDe,[p.duration,L]),rt=Ee.useRef(0),Ot=Ee.useRef(0),Mt=Ee.useRef(0),ut=Ee.useRef(null),[or,Hr]=B.split("-"),ze=Ee.useMemo(()=>b.reduce((mt,Ir,vr)=>vr>=de?mt:mt+Ir.height,0),[b,de]),pt=Tor(),bt=p.invert||d,nt=he==="loading";Ot.current=Ee.useMemo(()=>de*M+ze,[de,ze]),Ee.useEffect(()=>{be.current=Le},[Le]),Ee.useEffect(()=>{Z(!0)},[]),Ee.useEffect(()=>{const mt=ke.current;if(mt){const Ir=mt.getBoundingClientRect().height;return le(Ir),m(vr=>[{toastId:p.id,height:Ir,position:p.position},...vr]),()=>m(vr=>vr.filter(Zr=>Zr.toastId!==p.id))}},[m,p.id]),Ee.useLayoutEffect(()=>{if(!N)return;const mt=ke.current,Ir=mt.style.height;mt.style.height="auto";const vr=mt.getBoundingClientRect().height;mt.style.height=Ir,le(vr),m(Zr=>Zr.find(Br=>Br.toastId===p.id)?Zr.map(Br=>Br.toastId===p.id?{...Br,height:vr}:Br):[{toastId:p.id,height:vr,position:p.position},...Zr])},[N,p.title,p.description,m,p.id,p.jsx,p.action,p.cancel]);const dr=Ee.useCallback(()=>{K(!0),ne(Ot.current),m(mt=>mt.filter(Ir=>Ir.toastId!==p.id)),setTimeout(()=>{_(p)},zor)},[p,_,m,Ot]);Ee.useEffect(()=>{if(p.promise&&he==="loading"||p.duration===1/0||p.type==="loading")return;let mt;return S||h||pt?(()=>{if(Mt.current<rt.current){const Zr=new Date().getTime()-rt.current;be.current=be.current-Zr}Mt.current=new Date().getTime()})():be.current!==1/0&&(rt.current=new Date().getTime(),mt=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),dr()},be.current)),()=>clearTimeout(mt)},[S,h,p,he,pt,dr]),Ee.useEffect(()=>{p.delete&&(dr(),p.onDismiss==null||p.onDismiss.call(p,p))},[dr,p.delete]);function kr(){var mt;if(q?.loading){var Ir;return Ee.createElement("div",{className:Gh(H?.loader,p==null||(Ir=p.classNames)==null?void 0:Ir.loader,"sonner-loader"),"data-visible":he==="loading"},q.loading)}return Ee.createElement(Sor,{className:Gh(H?.loader,p==null||(mt=p.classNames)==null?void 0:mt.loader),visible:he==="loading"})}const ns=p.icon||q?.[he]||xor(he);var yt,In;return Ee.createElement("li",{tabIndex:0,ref:ke,className:Gh(R,Te,H?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,H?.default,H?.[he],p==null||(r=p.classNames)==null?void 0:r[he]),"data-sonner-toast":"","data-rich-colors":(yt=p.richColors)!=null?yt:O,"data-styled":!(p.jsx||p.unstyled||f),"data-mounted":N,"data-promise":!!p.promise,"data-swiped":xe,"data-removed":G,"data-visible":pe,"data-y-position":or,"data-x-position":Hr,"data-index":v,"data-front":oe,"data-swiping":ee,"data-dismissible":Ie,"data-type":he,"data-invert":bt,"data-swipe-out":se,"data-swipe-direction":X,"data-expanded":!!(S||z&&N),"data-testid":p.testId,style:{"--index":v,"--toasts-before":v,"--z-index":w.length-v,"--offset":`${G?ae:Ot.current}px`,"--initial-height":z?"auto":`${ye}px`,...T,...p.style},onDragEnd:()=>{te(!1),$(null),ut.current=null},onPointerDown:mt=>{mt.button!==2&&(nt||!Ie||(Ne.current=new Date,ne(Ot.current),mt.target.setPointerCapture(mt.pointerId),mt.target.tagName!=="BUTTON"&&(te(!0),ut.current={x:mt.clientX,y:mt.clientY})))},onPointerUp:()=>{var mt,Ir,vr;if(se||!Ie)return;ut.current=null;const Zr=Number(((mt=ke.current)==null?void 0:mt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),pr=Number(((Ir=ke.current)==null?void 0:Ir.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Br=new Date().getTime()-((vr=Ne.current)==null?void 0:vr.getTime()),Jt=Q==="x"?Zr:pr,oi=Math.abs(Jt)/Br;if(Math.abs(Jt)>=Bor||oi>.11){ne(Ot.current),p.onDismiss==null||p.onDismiss.call(p,p),U(Q==="x"?Zr>0?"right":"left":pr>0?"down":"up"),dr(),ue(!0);return}else{var fe,Oe;(fe=ke.current)==null||fe.style.setProperty("--swipe-amount-x","0px"),(Oe=ke.current)==null||Oe.style.setProperty("--swipe-amount-y","0px")}W(!1),te(!1),$(null)},onPointerMove:mt=>{var Ir,vr,Zr;if(!ut.current||!Ie||((Ir=window.getSelection())==null?void 0:Ir.toString().length)>0)return;const Br=mt.clientY-ut.current.y,Jt=mt.clientX-ut.current.x;var oi;const fe=(oi=e.swipeDirections)!=null?oi:Uor(B);!Q&&(Math.abs(Jt)>1||Math.abs(Br)>1)&&$(Math.abs(Jt)>Math.abs(Br)?"x":"y");let Oe={x:0,y:0};const Re=Ve=>1/(1.5+Math.abs(Ve)/20);if(Q==="y"){if(fe.includes("top")||fe.includes("bottom"))if(fe.includes("top")&&Br<0||fe.includes("bottom")&&Br>0)Oe.y=Br;else{const Ve=Br*Re(Br);Oe.y=Math.abs(Ve)<Math.abs(Br)?Ve:Br}}else if(Q==="x"&&(fe.includes("left")||fe.includes("right")))if(fe.includes("left")&&Jt<0||fe.includes("right")&&Jt>0)Oe.x=Jt;else{const Ve=Jt*Re(Jt);Oe.x=Math.abs(Ve)<Math.abs(Jt)?Ve:Jt}(Math.abs(Oe.x)>0||Math.abs(Oe.y)>0)&&W(!0),(vr=ke.current)==null||vr.style.setProperty("--swipe-amount-x",`${Oe.x}px`),(Zr=ke.current)==null||Zr.style.setProperty("--swipe-amount-y",`${Oe.y}px`)}},De&&!p.jsx&&he!=="loading"?Ee.createElement("button",{"aria-label":V,"data-disabled":nt,"data-close-button":!0,onClick:nt||!Ie?()=>{}:()=>{dr(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Gh(H?.closeButton,p==null||(n=p.classNames)==null?void 0:n.closeButton)},(In=q?.close)!=null?In:Cor):null,(he||p.icon||p.promise)&&p.icon!==null&&(q?.[he]!==null||p.icon)?Ee.createElement("div",{"data-icon":"",className:Gh(H?.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||kr():null,p.type!=="loading"?ns:null):null,Ee.createElement("div",{"data-content":"",className:Gh(H?.content,p==null||(a=p.classNames)==null?void 0:a.content)},Ee.createElement("div",{"data-title":"",className:Gh(H?.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:Gh(P,we,H?.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&&e$(p.cancel)?Ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:mt=>{e$(p.cancel)&&Ie&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,mt),dr())},className:Gh(H?.cancelButton,p==null||(l=p.classNames)==null?void 0:l.cancelButton)},p.cancel.label):null,Ee.isValidElement(p.action)?p.action:p.action&&e$(p.action)?Ee.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||I,onClick:mt=>{e$(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,mt),!mt.defaultPrevented&&dr())},className:Gh(H?.actionButton,p==null||(c=p.classNames)==null?void 0:c.actionButton)},p.action.label):null)};function PDe(){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 qor(e,t){const r={};return[e,t].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",o=a?Mor:$or;function l(c){["top","right","bottom","left"].forEach(d=>{r[`${i}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?r[`${i}-${c}`]=o:r[`${i}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):l(o)}),r}const Hor=Ee.forwardRef(function(t,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:l,className:c,offset:d,mobileOffset:p,theme:f="light",richColors:h,duration:m,style:g,visibleToasts:b=jor,toastOptions:v,dir:w=PDe(),gap:S=For,icons:_,containerAriaLabel:O="Notifications"}=t,[C,T]=Ee.useState([]),A=Ee.useMemo(()=>n?C.filter(N=>N.toasterId===n):C.filter(N=>!N.toasterId),[C,n]),I=Ee.useMemo(()=>Array.from(new Set([a].concat(A.filter(N=>N.position).map(N=>N.position)))),[A,a]),[R,P]=Ee.useState([]),[L,B]=Ee.useState(!1),[M,z]=Ee.useState(!1),[H,q]=Ee.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=Ee.useRef(null),Q=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=Ee.useRef(null),X=Ee.useRef(!1),U=Ee.useCallback(N=>{T(Z=>{var G;return(G=Z.find(K=>K.id===N.id))!=null&&G.delete||lu.dismiss(N.id),Z.filter(({id:K})=>K!==N.id)})},[]);return Ee.useEffect(()=>lu.subscribe(N=>{if(N.dismiss){requestAnimationFrame(()=>{T(Z=>Z.map(G=>G.id===N.id?{...G,delete:!0}:G))});return}setTimeout(()=>{ble.flushSync(()=>{T(Z=>{const G=Z.findIndex(K=>K.id===N.id);return G!==-1?[...Z.slice(0,G),{...Z[G],...N},...Z.slice(G+1)]:[N,...Z]})})})}),[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 N=window.matchMedia("(prefers-color-scheme: dark)");try{N.addEventListener("change",({matches:Z})=>{q(Z?"dark":"light")})}catch{N.addListener(({matches:G})=>{try{q(G?"dark":"light")}catch(K){console.error(K)}})}},[f]),Ee.useEffect(()=>{C.length<=1&&B(!1)},[C]),Ee.useEffect(()=>{const N=Z=>{var G;if(i.every(te=>Z[te]||Z.code===te)){var ee;B(!0),(ee=V.current)==null||ee.focus()}Z.code==="Escape"&&(document.activeElement===V.current||(G=V.current)!=null&&G.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[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":`${O} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((N,Z)=>{var G;const[K,ee]=N.split("-");return A.length?Ee.createElement("ol",{key:N,dir:w==="auto"?PDe():w,tabIndex:-1,ref:V,className:c,"data-sonner-toaster":!0,"data-sonner-theme":H,"data-y-position":K,"data-x-position":ee,style:{"--front-toast-height":`${((G=R[0])==null?void 0:G.height)||0}px`,"--width":`${Lor}px`,"--gap":`${S}px`,...g,...qor(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:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{M||B(!1)},onDragEnd:()=>B(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},A.filter(te=>!te.position&&Z===0||te.position===N).map((te,se)=>{var ue,xe;return Ee.createElement(Vor,{key:te.id,icons:_,index:se,toast:te,defaultRichColors:h,duration:(ue=v?.duration)!=null?ue:m,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:s,visibleToasts:b,closeButton:(xe=v?.closeButton)!=null?xe:l,interacting:M,position:N,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:R.filter(W=>W.position==te.position),setHeights:P,expandByDefault:o,gap:S,expanded:L,swipeDirections:t.swipeDirections})})):null}))});var X6="Dialog",[xKe,wKe]=el(X6),[Zor,Dh]=xKe(X6),SKe=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,o=E.useRef(null),l=E.useRef(null),[c,d]=Gc({prop:n,defaultProp:s??!1,onChange:a,caller:X6});return u.jsx(Zor,{scope:t,triggerRef:o,contentRef:l,contentId:ho(),titleId:ho(),descriptionId:ho(),open:c,onOpenChange:d,onOpenToggle:E.useCallback(()=>d(p=>!p),[d]),modal:i,children:r})};SKe.displayName=X6;var EKe="DialogTrigger",_Ke=E.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Dh(EKe,r),a=Fr(t,s.triggerRef);return u.jsx(gr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Wue(s.open),...n,ref:a,onClick:dt(e.onClick,s.onOpenToggle)})});_Ke.displayName=EKe;var Gue="DialogPortal",[Gor,kKe]=xKe(Gue,{forceMount:void 0}),OKe=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,a=Dh(Gue,t);return u.jsx(Gor,{scope:t,forceMount:r,children:E.Children.map(n,i=>u.jsx(ro,{present:r||a.open,children:u.jsx(dw,{asChild:!0,container:s,children:i})}))})};OKe.displayName=Gue;var P4="DialogOverlay",CKe=E.forwardRef((e,t)=>{const r=kKe(P4,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,a=Dh(P4,e.__scopeDialog);return a.modal?u.jsx(ro,{present:n||a.open,children:u.jsx(Wor,{...s,ref:t})}):null});CKe.displayName=P4;var Qor=y1("DialogOverlay.RemoveScroll"),Wor=E.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Dh(P4,r);return u.jsx(SR,{as:Qor,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(gr.div,{"data-state":Wue(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),I1="DialogContent",TKe=E.forwardRef((e,t)=>{const r=kKe(I1,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,a=Dh(I1,e.__scopeDialog);return u.jsx(ro,{present:n||a.open,children:a.modal?u.jsx(Xor,{...s,ref:t}):u.jsx(Yor,{...s,ref:t})})});TKe.displayName=I1;var Xor=E.forwardRef((e,t)=>{const r=Dh(I1,e.__scopeDialog),n=E.useRef(null),s=Fr(t,r.contentRef,n);return E.useEffect(()=>{const a=n.current;if(a)return o6(a)},[]),u.jsx(AKe,{...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())})}),Yor=E.forwardRef((e,t)=>{const r=Dh(I1,e.__scopeDialog),n=E.useRef(!1),s=E.useRef(!1);return u.jsx(AKe,{...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()}})}),AKe=E.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,...i}=e,o=Dh(I1,r),l=E.useRef(null),c=Fr(t,l);return JF(),u.jsxs(u.Fragment,{children:[u.jsx(yR,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:u.jsx(cw,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":Wue(o.open),...i,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(Jor,{titleId:o.titleId}),u.jsx(tlr,{contentRef:l,descriptionId:o.descriptionId})]})]})}),Que="DialogTitle",DKe=E.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Dh(Que,r);return u.jsx(gr.h2,{id:s.titleId,...n,ref:t})});DKe.displayName=Que;var IKe="DialogDescription",NKe=E.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Dh(IKe,r);return u.jsx(gr.p,{id:s.descriptionId,...n,ref:t})});NKe.displayName=IKe;var RKe="DialogClose",PKe=E.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Dh(RKe,r);return u.jsx(gr.button,{type:"button",...n,ref:t,onClick:dt(e.onClick,()=>s.onOpenChange(!1))})});PKe.displayName=RKe;function Wue(e){return e?"open":"closed"}var jKe="DialogTitleWarning",[Kor,$Ke]=ZRt(jKe,{contentName:I1,titleName:Que,docsSlug:"dialog"}),Jor=({titleId:e})=>{const t=$Ke(jKe),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
165
165
|
|
|
166
166
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
@@ -232,7 +232,7 @@ Error message: ${dde(r)}`,cause:r}),this[Let]=!0,this.value=t}static isInstance(
|
|
|
232
232
|
]))`;continue}else if(s[c]==="$"){a+=`($|(?=[\r
|
|
233
233
|
]))`;continue}}if(n.s&&s[c]==="."){a+=o?`${s[c]}\r
|
|
234
234
|
`:`[${s[c]}\r
|
|
235
|
-
]`;continue}a+=s[c],s[c]==="\\"?i=!0:o&&s[c]==="]"?o=!1:!o&&s[c]==="["&&(o=!0)}return a}function Zet(e,t){var r,n,s,a,i,o;const l={type:"object",additionalProperties:(r=ua(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?r:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===ce.ZodString&&((s=e.keyType._def.checks)!=null&&s.length)){const{type:c,...d}=Het(e.keyType._def,t);return{...l,propertyNames:d}}else{if(((a=e.keyType)==null?void 0:a._def.typeName)===ce.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===ce.ZodBranded&&e.keyType._def.type._def.typeName===ce.ZodString&&((o=e.keyType._def.type._def.checks)!=null&&o.length)){const{type:c,...d}=Vet(e.keyType._def,t);return{...l,propertyNames:d}}}return l}function cyr(e,t){if(t.mapStrategy==="record")return Zet(e,t);const r=ua(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Fd(),n=ua(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Fd();return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function uyr(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 dyr(){return{not:Fd()}}function pyr(){return{type:"null"}}var Fre={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function fyr(e,t){const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in Fre&&(!n._def.checks||!n._def.checks.length))){const n=r.reduce((s,a)=>{const i=Fre[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 hyr(e,t)}var hyr=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,s)=>ua(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 myr(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Fre[e.innerType._def.typeName],"null"]};const r=ua(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function gyr(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 yyr(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=vyr(o),c=ua(o._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});c!==void 0&&(r.properties[i]=c,l||n.push(i))}n.length&&(r.required=n);const a=byr(e,t);return a!==void 0&&(r.additionalProperties=a),r}function byr(e,t){if(e.catchall._def.typeName!=="ZodNever")return ua(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 vyr(e){try{return e.isOptional()}catch{return!0}}var xyr=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return ua(e.innerType._def,t);const n=ua(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Fd()},n]}:Fd()},wyr=(e,t)=>{if(t.pipeStrategy==="input")return ua(e.in._def,t);if(t.pipeStrategy==="output")return ua(e.out._def,t);const r=ua(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=ua(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(s=>s!==void 0)}};function Syr(e,t){return ua(e.type._def,t)}function Eyr(e,t){const n={type:"array",uniqueItems:!0,items:ua(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 _yr(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>ua(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:ua(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>ua(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function kyr(){return{not:Fd()}}function Oyr(){return Fd()}var Cyr=(e,t)=>ua(e.innerType._def,t),Tyr=(e,t,r)=>{switch(t){case ce.ZodString:return Het(e,r);case ce.ZodNumber:return gyr(e);case ce.ZodObject:return yyr(e,r);case ce.ZodBigInt:return Ygr(e);case ce.ZodBoolean:return Kgr();case ce.ZodDate:return qet(e,r);case ce.ZodUndefined:return kyr();case ce.ZodNull:return pyr();case ce.ZodArray:return Xgr(e,r);case ce.ZodUnion:case ce.ZodDiscriminatedUnion:return fyr(e,r);case ce.ZodIntersection:return ayr(e,r);case ce.ZodTuple:return _yr(e,r);case ce.ZodRecord:return Zet(e,r);case ce.ZodLiteral:return iyr(e);case ce.ZodEnum:return nyr(e);case ce.ZodNativeEnum:return uyr(e);case ce.ZodNullable:return myr(e,r);case ce.ZodOptional:return xyr(e,r);case ce.ZodMap:return cyr(e,r);case ce.ZodSet:return Eyr(e,r);case ce.ZodLazy:return()=>e.getter()._def;case ce.ZodPromise:return Syr(e,r);case ce.ZodNaN:case ce.ZodNever:return dyr();case ce.ZodEffects:return ryr(e,r);case ce.ZodAny:return Fd();case ce.ZodUnknown:return Oyr();case ce.ZodDefault:return tyr(e,r);case ce.ZodBranded:return Vet(e,r);case ce.ZodReadonly:return Cyr(e,r);case ce.ZodCatch:return Jgr(e,r);case ce.ZodPipeline:return wyr(e,r);case ce.ZodFunction:case ce.ZodVoid:case ce.ZodSymbol:return;default:return(n=>{})()}};function ua(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!==Qgr)return l}if(s&&!r){const l=Ayr(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=Tyr(e,e.typeName,t),o=typeof i=="function"?ua(i(),t):i;if(o&&Dyr(e,t,o),t.postProcess){const l=t.postProcess(o,e,t);return a.jsonSchema=o,l}return a.jsonSchema=o,o}var Ayr=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Ggr(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`),Fd()):t.$refStrategy==="seen"?Fd():void 0}},Dyr=(e,t,r)=>(e.description&&(r.description=e.description),r),Iyr=e=>{const t=Wgr(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}]))}},Nyr=(e,t)=>{var r;const n=Iyr(t);let s=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[d,p])=>{var f;return{...c,[d]:(f=ua(p._def,{...n,currentPath:[...n.basePath,n.definitionPath,d]},!0))!=null?f:Fd()}},{}):void 0;const a=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(r=ua(e._def,a===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,a]},!1))!=null?r:Fd(),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},Ryr=Nyr;function Pyr(e,t){var r;const n=(r=void 0)!=null?r:!1;return fde(()=>Ryr(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 jyr(e,t){var r;const n=(r=void 0)!=null?r:!1;return fde(()=>rde(e,{target:"draft-7",io:"output",reused:n?"ref":"inline"}),{validate:async s=>{const a=await nde(e,s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function $yr(e){return"_zod"in e}function _w(e,t){return $yr(e)?jyr(e):Pyr(e)}var Bre=Symbol.for("vercel.ai.schema");function fde(e,{validate:t}={}){return{[Bre]:!0,_type:void 0,[X4]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function Myr(e){return typeof e=="object"&&e!==null&&Bre in e&&e[Bre]===!0&&"jsonSchema"in e&&"validate"in e}function Lyr(e){return e==null?fde({properties:{},additionalProperties:!1}):Myr(e)?e:typeof e=="function"?e():_w(e)}function Fyr(e){return e?.replace(/\/$/,"")}var Get=d9({"../../../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,g)=>{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:!(g=n(h,b))||g.enumerable});return f},l=f=>o(r({},"__esModule",{value:!0}),f),c={};i(c,{SYMBOL_FOR_REQ_CONTEXT:()=>d,getContext:()=>p}),t.exports=l(c);var d=Symbol.for("@vercel/request-context");function p(){return globalThis[d]?.get?.()??{}}}}),Byr=d9({"../../../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,g)=>{for(var b in g)r(m,b,{get:g[b],enumerable:!0})},o=(m,g,b,v)=>{if(g&&typeof g=="object"||typeof g=="function")for(let w of s(g))!a.call(m,w)&&w!==b&&r(m,w,{get:()=>g[w],enumerable:!(v=n(g,w))||v.enumerable});return m},l=m=>o(r({},"__esModule",{value:!0}),m),c={};i(c,{getVercelOidcToken:()=>f,getVercelOidcTokenSync:()=>h}),t.exports=l(c);var d=Get(),p=ygr();async function f(){let m="",g;try{m=h()}catch(b){g=b}try{const[{getTokenPayload:b,isExpired:v},{refreshToken:w}]=await Promise.all([await Ze(()=>import("./token-util-NEHG7TUY-U7CX7GS4-jJSXEovt-01TIrA_-.js"),__vite__mapDeps([23,24,1]),import.meta.url),await Ze(()=>import("./token-6GSAFR2W-XRCSVUPZ-Cgcu7avO-AoVeMya1.js"),__vite__mapDeps([25,24,1]),import.meta.url)]);(!m||v(b(m)))&&(await w(),m=h())}catch(b){throw g?.message&&b instanceof Error&&(b.message=`${g.message}
|
|
235
|
+
]`;continue}a+=s[c],s[c]==="\\"?i=!0:o&&s[c]==="]"?o=!1:!o&&s[c]==="["&&(o=!0)}return a}function Zet(e,t){var r,n,s,a,i,o;const l={type:"object",additionalProperties:(r=ua(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?r:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===ce.ZodString&&((s=e.keyType._def.checks)!=null&&s.length)){const{type:c,...d}=Het(e.keyType._def,t);return{...l,propertyNames:d}}else{if(((a=e.keyType)==null?void 0:a._def.typeName)===ce.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===ce.ZodBranded&&e.keyType._def.type._def.typeName===ce.ZodString&&((o=e.keyType._def.type._def.checks)!=null&&o.length)){const{type:c,...d}=Vet(e.keyType._def,t);return{...l,propertyNames:d}}}return l}function cyr(e,t){if(t.mapStrategy==="record")return Zet(e,t);const r=ua(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Fd(),n=ua(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Fd();return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function uyr(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 dyr(){return{not:Fd()}}function pyr(){return{type:"null"}}var Fre={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function fyr(e,t){const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in Fre&&(!n._def.checks||!n._def.checks.length))){const n=r.reduce((s,a)=>{const i=Fre[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 hyr(e,t)}var hyr=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,s)=>ua(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 myr(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Fre[e.innerType._def.typeName],"null"]};const r=ua(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function gyr(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 yyr(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=vyr(o),c=ua(o._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});c!==void 0&&(r.properties[i]=c,l||n.push(i))}n.length&&(r.required=n);const a=byr(e,t);return a!==void 0&&(r.additionalProperties=a),r}function byr(e,t){if(e.catchall._def.typeName!=="ZodNever")return ua(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 vyr(e){try{return e.isOptional()}catch{return!0}}var xyr=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return ua(e.innerType._def,t);const n=ua(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Fd()},n]}:Fd()},wyr=(e,t)=>{if(t.pipeStrategy==="input")return ua(e.in._def,t);if(t.pipeStrategy==="output")return ua(e.out._def,t);const r=ua(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=ua(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(s=>s!==void 0)}};function Syr(e,t){return ua(e.type._def,t)}function Eyr(e,t){const n={type:"array",uniqueItems:!0,items:ua(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 _yr(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>ua(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:ua(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>ua(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function kyr(){return{not:Fd()}}function Oyr(){return Fd()}var Cyr=(e,t)=>ua(e.innerType._def,t),Tyr=(e,t,r)=>{switch(t){case ce.ZodString:return Het(e,r);case ce.ZodNumber:return gyr(e);case ce.ZodObject:return yyr(e,r);case ce.ZodBigInt:return Ygr(e);case ce.ZodBoolean:return Kgr();case ce.ZodDate:return qet(e,r);case ce.ZodUndefined:return kyr();case ce.ZodNull:return pyr();case ce.ZodArray:return Xgr(e,r);case ce.ZodUnion:case ce.ZodDiscriminatedUnion:return fyr(e,r);case ce.ZodIntersection:return ayr(e,r);case ce.ZodTuple:return _yr(e,r);case ce.ZodRecord:return Zet(e,r);case ce.ZodLiteral:return iyr(e);case ce.ZodEnum:return nyr(e);case ce.ZodNativeEnum:return uyr(e);case ce.ZodNullable:return myr(e,r);case ce.ZodOptional:return xyr(e,r);case ce.ZodMap:return cyr(e,r);case ce.ZodSet:return Eyr(e,r);case ce.ZodLazy:return()=>e.getter()._def;case ce.ZodPromise:return Syr(e,r);case ce.ZodNaN:case ce.ZodNever:return dyr();case ce.ZodEffects:return ryr(e,r);case ce.ZodAny:return Fd();case ce.ZodUnknown:return Oyr();case ce.ZodDefault:return tyr(e,r);case ce.ZodBranded:return Vet(e,r);case ce.ZodReadonly:return Cyr(e,r);case ce.ZodCatch:return Jgr(e,r);case ce.ZodPipeline:return wyr(e,r);case ce.ZodFunction:case ce.ZodVoid:case ce.ZodSymbol:return;default:return(n=>{})()}};function ua(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!==Qgr)return l}if(s&&!r){const l=Ayr(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=Tyr(e,e.typeName,t),o=typeof i=="function"?ua(i(),t):i;if(o&&Dyr(e,t,o),t.postProcess){const l=t.postProcess(o,e,t);return a.jsonSchema=o,l}return a.jsonSchema=o,o}var Ayr=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Ggr(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`),Fd()):t.$refStrategy==="seen"?Fd():void 0}},Dyr=(e,t,r)=>(e.description&&(r.description=e.description),r),Iyr=e=>{const t=Wgr(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}]))}},Nyr=(e,t)=>{var r;const n=Iyr(t);let s=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[d,p])=>{var f;return{...c,[d]:(f=ua(p._def,{...n,currentPath:[...n.basePath,n.definitionPath,d]},!0))!=null?f:Fd()}},{}):void 0;const a=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(r=ua(e._def,a===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,a]},!1))!=null?r:Fd(),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},Ryr=Nyr;function Pyr(e,t){var r;const n=(r=void 0)!=null?r:!1;return fde(()=>Ryr(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 jyr(e,t){var r;const n=(r=void 0)!=null?r:!1;return fde(()=>rde(e,{target:"draft-7",io:"output",reused:n?"ref":"inline"}),{validate:async s=>{const a=await nde(e,s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function $yr(e){return"_zod"in e}function _w(e,t){return $yr(e)?jyr(e):Pyr(e)}var Bre=Symbol.for("vercel.ai.schema");function fde(e,{validate:t}={}){return{[Bre]:!0,_type:void 0,[X4]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function Myr(e){return typeof e=="object"&&e!==null&&Bre in e&&e[Bre]===!0&&"jsonSchema"in e&&"validate"in e}function Lyr(e){return e==null?fde({properties:{},additionalProperties:!1}):Myr(e)?e:typeof e=="function"?e():_w(e)}function Fyr(e){return e?.replace(/\/$/,"")}var Get=d9({"../../../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,g)=>{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:!(g=n(h,b))||g.enumerable});return f},l=f=>o(r({},"__esModule",{value:!0}),f),c={};i(c,{SYMBOL_FOR_REQ_CONTEXT:()=>d,getContext:()=>p}),t.exports=l(c);var d=Symbol.for("@vercel/request-context");function p(){return globalThis[d]?.get?.()??{}}}}),Byr=d9({"../../../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,g)=>{for(var b in g)r(m,b,{get:g[b],enumerable:!0})},o=(m,g,b,v)=>{if(g&&typeof g=="object"||typeof g=="function")for(let w of s(g))!a.call(m,w)&&w!==b&&r(m,w,{get:()=>g[w],enumerable:!(v=n(g,w))||v.enumerable});return m},l=m=>o(r({},"__esModule",{value:!0}),m),c={};i(c,{getVercelOidcToken:()=>f,getVercelOidcTokenSync:()=>h}),t.exports=l(c);var d=Get(),p=ygr();async function f(){let m="",g;try{m=h()}catch(b){g=b}try{const[{getTokenPayload:b,isExpired:v},{refreshToken:w}]=await Promise.all([await Ze(()=>import("./token-util-NEHG7TUY-U7CX7GS4-jJSXEovt-CDa3jFU6.js"),__vite__mapDeps([23,24,1]),import.meta.url),await Ze(()=>import("./token-6GSAFR2W-XRCSVUPZ-Cgcu7avO-D6Vznyz8.js"),__vite__mapDeps([25,24,1]),import.meta.url)]);(!m||v(b(m)))&&(await w(),m=h())}catch(b){throw g?.message&&b instanceof Error&&(b.message=`${g.message}
|
|
236
236
|
${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"]??pet.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}}}),Qet=d9({"../../../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,g)=>{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:!(g=n(h,b))||g.enumerable});return f},l=f=>o(r({},"__esModule",{value:!0}),f),c={};i(c,{getContext:()=>p.getContext,getVercelOidcToken:()=>d.getVercelOidcToken,getVercelOidcTokenSync:()=>d.getVercelOidcTokenSync}),t.exports=l(c);var d=Byr(),p=Get()}}),zyr=vet(Qet()),Uyr=vet(Qet()),Vyr="vercel.ai.gateway.error",$W=Symbol.for(Vyr),DIe,IIe,Bd=class Wet extends(IIe=Error,DIe=$W,IIe){constructor({message:t,statusCode:r=500,cause:n}){super(t),this[DIe]=!0,this.statusCode=r,this.cause=n}static isInstance(t){return Wet.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&$W in t&&t[$W]===!0}},Xet="GatewayAuthenticationError",qyr=`vercel.ai.gateway.error.${Xet}`,NIe=Symbol.for(qyr),RIe,PIe,Yet=class Ket extends(PIe=Bd,RIe=NIe,PIe){constructor({message:t="Authentication failed",statusCode:r=401,cause:n}={}){super({message:t,statusCode:r,cause:n}),this[RIe]=!0,this.name=Xet,this.type="authentication_error"}static isInstance(t){return Bd.hasMarker(t)&&NIe 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.
|
|
237
237
|
|
|
238
238
|
Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
|
|
@@ -504,7 +504,7 @@ Error message: ${Fhe(r)}`,cause:r}),this[Dht]=!0,this.value=t}static isInstance(
|
|
|
504
504
|
]))`;continue}else if(s[c]==="$"){a+=`($|(?=[\r
|
|
505
505
|
]))`;continue}}if(n.s&&s[c]==="."){a+=o?`${s[c]}\r
|
|
506
506
|
`:`[${s[c]}\r
|
|
507
|
-
]`;continue}a+=s[c],s[c]==="\\"?i=!0:o&&s[c]==="]"?o=!1:!o&&s[c]==="["&&(o=!0)}return a}function Lht(e,t){var r,n,s,a,i,o;const l={type:"object",additionalProperties:(r=da(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?r:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===ce.ZodString&&((s=e.keyType._def.checks)!=null&&s.length)){const{type:c,...d}=Mht(e.keyType._def,t);return{...l,propertyNames:d}}else{if(((a=e.keyType)==null?void 0:a._def.typeName)===ce.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===ce.ZodBranded&&e.keyType._def.type._def.typeName===ce.ZodString&&((o=e.keyType._def.type._def.checks)!=null&&o.length)){const{type:c,...d}=jht(e.keyType._def,t);return{...l,propertyNames:d}}}return l}function uen(e,t){if(t.mapStrategy==="record")return Lht(e,t);const r=da(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Gd(),n=da(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Gd();return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function den(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 pen(){return{not:Gd()}}function fen(){return{type:"null"}}var qse={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function hen(e,t){const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in qse&&(!n._def.checks||!n._def.checks.length))){const n=r.reduce((s,a)=>{const i=qse[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 men(e,t)}var men=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,s)=>da(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 gen(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[qse[e.innerType._def.typeName],"null"]};const r=da(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function yen(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 ben(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=xen(o),c=da(o._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});c!==void 0&&(r.properties[i]=c,l||n.push(i))}n.length&&(r.required=n);const a=ven(e,t);return a!==void 0&&(r.additionalProperties=a),r}function ven(e,t){if(e.catchall._def.typeName!=="ZodNever")return da(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 xen(e){try{return e.isOptional()}catch{return!0}}var wen=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return da(e.innerType._def,t);const n=da(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Gd()},n]}:Gd()},Sen=(e,t)=>{if(t.pipeStrategy==="input")return da(e.in._def,t);if(t.pipeStrategy==="output")return da(e.out._def,t);const r=da(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=da(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(s=>s!==void 0)}};function Een(e,t){return da(e.type._def,t)}function _en(e,t){const n={type:"array",uniqueItems:!0,items:da(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 ken(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>da(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:da(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>da(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function Oen(){return{not:Gd()}}function Cen(){return Gd()}var Ten=(e,t)=>da(e.innerType._def,t),Aen=(e,t,r)=>{switch(t){case ce.ZodString:return Mht(e,r);case ce.ZodNumber:return yen(e);case ce.ZodObject:return ben(e,r);case ce.ZodBigInt:return KJr(e);case ce.ZodBoolean:return JJr();case ce.ZodDate:return $ht(e,r);case ce.ZodUndefined:return Oen();case ce.ZodNull:return fen();case ce.ZodArray:return YJr(e,r);case ce.ZodUnion:case ce.ZodDiscriminatedUnion:return hen(e,r);case ce.ZodIntersection:return ien(e,r);case ce.ZodTuple:return ken(e,r);case ce.ZodRecord:return Lht(e,r);case ce.ZodLiteral:return oen(e);case ce.ZodEnum:return sen(e);case ce.ZodNativeEnum:return den(e);case ce.ZodNullable:return gen(e,r);case ce.ZodOptional:return wen(e,r);case ce.ZodMap:return uen(e,r);case ce.ZodSet:return _en(e,r);case ce.ZodLazy:return()=>e.getter()._def;case ce.ZodPromise:return Een(e,r);case ce.ZodNaN:case ce.ZodNever:return pen();case ce.ZodEffects:return nen(e,r);case ce.ZodAny:return Gd();case ce.ZodUnknown:return Cen();case ce.ZodDefault:return ren(e,r);case ce.ZodBranded:return jht(e,r);case ce.ZodReadonly:return Ten(e,r);case ce.ZodCatch:return een(e,r);case ce.ZodPipeline:return Sen(e,r);case ce.ZodFunction:case ce.ZodVoid:case ce.ZodSymbol:return;default:return(n=>{})()}};function da(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!==WJr)return l}if(s&&!r){const l=Den(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=Aen(e,e.typeName,t),o=typeof i=="function"?da(i(),t):i;if(o&&Ien(e,t,o),t.postProcess){const l=t.postProcess(o,e,t);return a.jsonSchema=o,l}return a.jsonSchema=o,o}var Den=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:QJr(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`),Gd()):t.$refStrategy==="seen"?Gd():void 0}},Ien=(e,t,r)=>(e.description&&(r.description=e.description),r),Nen=e=>{const t=XJr(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}]))}},Ren=(e,t)=>{var r;const n=Nen(t);let s=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[d,p])=>{var f;return{...c,[d]:(f=da(p._def,{...n,currentPath:[...n.basePath,n.definitionPath,d]},!0))!=null?f:Gd()}},{}):void 0;const a=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(r=da(e._def,a===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,a]},!1))!=null?r:Gd(),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},Pen=Ren;function jen(e,t){var r;const n=(r=void 0)!=null?r:!1;return zhe(()=>Pen(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 $en(e,t){var r;const n=(r=void 0)!=null?r:!1;return zhe(()=>rde(e,{target:"draft-7",io:"output",reused:n?"ref":"inline"}),{validate:async s=>{const a=await nde(e,s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function Men(e){return"_zod"in e}function qw(e,t){return Men(e)?$en(e):jen(e)}var Hse=Symbol.for("vercel.ai.schema");function zhe(e,{validate:t}={}){return{[Hse]:!0,_type:void 0,[K5]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function Len(e){return typeof e=="object"&&e!==null&&Hse in e&&e[Hse]===!0&&"jsonSchema"in e&&"validate"in e}function Fen(e){return e==null?zhe({properties:{},additionalProperties:!1}):Len(e)?e:typeof e=="function"?e():qw(e)}function Ben(e){return e?.replace(/\/$/,"")}var zen={},Fht=E8({"../../../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,g)=>{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:!(g=n(h,b))||g.enumerable});return f},l=f=>o(r({},"__esModule",{value:!0}),f),c={};i(c,{SYMBOL_FOR_REQ_CONTEXT:()=>d,getContext:()=>p}),t.exports=l(c);var d=Symbol.for("@vercel/request-context");function p(){return globalThis[d]?.get?.()??{}}}}),Uen=E8({"../../../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,g)=>{for(var b in g)r(m,b,{get:g[b],enumerable:!0})},o=(m,g,b,v)=>{if(g&&typeof g=="object"||typeof g=="function")for(let w of s(g))!a.call(m,w)&&w!==b&&r(m,w,{get:()=>g[w],enumerable:!(v=n(g,w))||v.enumerable});return m},l=m=>o(r({},"__esModule",{value:!0}),m),c={};i(c,{getVercelOidcToken:()=>f,getVercelOidcTokenSync:()=>h}),t.exports=l(c);var d=Fht(),p=gJr();async function f(){let m="",g;try{m=h()}catch(b){g=b}try{const[{getTokenPayload:b,isExpired:v},{refreshToken:w}]=await Promise.all([await Ze(()=>import("./token-util-NEHG7TUY-U7CX7GS4-cB-RmVGp.js"),__vite__mapDeps([26,27,1]),import.meta.url),await Ze(()=>import("./token-6GSAFR2W-XRCSVUPZ-Dnx2wjug.js"),__vite__mapDeps([28,27,1]),import.meta.url)]);(!m||v(b(m)))&&(await w(),m=h())}catch(b){throw g?.message&&b instanceof Error&&(b.message=`${g.message}
|
|
507
|
+
]`;continue}a+=s[c],s[c]==="\\"?i=!0:o&&s[c]==="]"?o=!1:!o&&s[c]==="["&&(o=!0)}return a}function Lht(e,t){var r,n,s,a,i,o;const l={type:"object",additionalProperties:(r=da(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?r:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===ce.ZodString&&((s=e.keyType._def.checks)!=null&&s.length)){const{type:c,...d}=Mht(e.keyType._def,t);return{...l,propertyNames:d}}else{if(((a=e.keyType)==null?void 0:a._def.typeName)===ce.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===ce.ZodBranded&&e.keyType._def.type._def.typeName===ce.ZodString&&((o=e.keyType._def.type._def.checks)!=null&&o.length)){const{type:c,...d}=jht(e.keyType._def,t);return{...l,propertyNames:d}}}return l}function uen(e,t){if(t.mapStrategy==="record")return Lht(e,t);const r=da(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Gd(),n=da(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Gd();return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function den(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 pen(){return{not:Gd()}}function fen(){return{type:"null"}}var qse={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function hen(e,t){const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in qse&&(!n._def.checks||!n._def.checks.length))){const n=r.reduce((s,a)=>{const i=qse[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 men(e,t)}var men=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,s)=>da(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 gen(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[qse[e.innerType._def.typeName],"null"]};const r=da(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function yen(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 ben(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=xen(o),c=da(o._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});c!==void 0&&(r.properties[i]=c,l||n.push(i))}n.length&&(r.required=n);const a=ven(e,t);return a!==void 0&&(r.additionalProperties=a),r}function ven(e,t){if(e.catchall._def.typeName!=="ZodNever")return da(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 xen(e){try{return e.isOptional()}catch{return!0}}var wen=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return da(e.innerType._def,t);const n=da(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Gd()},n]}:Gd()},Sen=(e,t)=>{if(t.pipeStrategy==="input")return da(e.in._def,t);if(t.pipeStrategy==="output")return da(e.out._def,t);const r=da(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=da(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(s=>s!==void 0)}};function Een(e,t){return da(e.type._def,t)}function _en(e,t){const n={type:"array",uniqueItems:!0,items:da(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 ken(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>da(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:da(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>da(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function Oen(){return{not:Gd()}}function Cen(){return Gd()}var Ten=(e,t)=>da(e.innerType._def,t),Aen=(e,t,r)=>{switch(t){case ce.ZodString:return Mht(e,r);case ce.ZodNumber:return yen(e);case ce.ZodObject:return ben(e,r);case ce.ZodBigInt:return KJr(e);case ce.ZodBoolean:return JJr();case ce.ZodDate:return $ht(e,r);case ce.ZodUndefined:return Oen();case ce.ZodNull:return fen();case ce.ZodArray:return YJr(e,r);case ce.ZodUnion:case ce.ZodDiscriminatedUnion:return hen(e,r);case ce.ZodIntersection:return ien(e,r);case ce.ZodTuple:return ken(e,r);case ce.ZodRecord:return Lht(e,r);case ce.ZodLiteral:return oen(e);case ce.ZodEnum:return sen(e);case ce.ZodNativeEnum:return den(e);case ce.ZodNullable:return gen(e,r);case ce.ZodOptional:return wen(e,r);case ce.ZodMap:return uen(e,r);case ce.ZodSet:return _en(e,r);case ce.ZodLazy:return()=>e.getter()._def;case ce.ZodPromise:return Een(e,r);case ce.ZodNaN:case ce.ZodNever:return pen();case ce.ZodEffects:return nen(e,r);case ce.ZodAny:return Gd();case ce.ZodUnknown:return Cen();case ce.ZodDefault:return ren(e,r);case ce.ZodBranded:return jht(e,r);case ce.ZodReadonly:return Ten(e,r);case ce.ZodCatch:return een(e,r);case ce.ZodPipeline:return Sen(e,r);case ce.ZodFunction:case ce.ZodVoid:case ce.ZodSymbol:return;default:return(n=>{})()}};function da(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!==WJr)return l}if(s&&!r){const l=Den(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=Aen(e,e.typeName,t),o=typeof i=="function"?da(i(),t):i;if(o&&Ien(e,t,o),t.postProcess){const l=t.postProcess(o,e,t);return a.jsonSchema=o,l}return a.jsonSchema=o,o}var Den=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:QJr(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`),Gd()):t.$refStrategy==="seen"?Gd():void 0}},Ien=(e,t,r)=>(e.description&&(r.description=e.description),r),Nen=e=>{const t=XJr(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}]))}},Ren=(e,t)=>{var r;const n=Nen(t);let s=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[d,p])=>{var f;return{...c,[d]:(f=da(p._def,{...n,currentPath:[...n.basePath,n.definitionPath,d]},!0))!=null?f:Gd()}},{}):void 0;const a=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(r=da(e._def,a===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,a]},!1))!=null?r:Gd(),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},Pen=Ren;function jen(e,t){var r;const n=(r=void 0)!=null?r:!1;return zhe(()=>Pen(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 $en(e,t){var r;const n=(r=void 0)!=null?r:!1;return zhe(()=>rde(e,{target:"draft-7",io:"output",reused:n?"ref":"inline"}),{validate:async s=>{const a=await nde(e,s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function Men(e){return"_zod"in e}function qw(e,t){return Men(e)?$en(e):jen(e)}var Hse=Symbol.for("vercel.ai.schema");function zhe(e,{validate:t}={}){return{[Hse]:!0,_type:void 0,[K5]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function Len(e){return typeof e=="object"&&e!==null&&Hse in e&&e[Hse]===!0&&"jsonSchema"in e&&"validate"in e}function Fen(e){return e==null?zhe({properties:{},additionalProperties:!1}):Len(e)?e:typeof e=="function"?e():qw(e)}function Ben(e){return e?.replace(/\/$/,"")}var zen={},Fht=E8({"../../../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,g)=>{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:!(g=n(h,b))||g.enumerable});return f},l=f=>o(r({},"__esModule",{value:!0}),f),c={};i(c,{SYMBOL_FOR_REQ_CONTEXT:()=>d,getContext:()=>p}),t.exports=l(c);var d=Symbol.for("@vercel/request-context");function p(){return globalThis[d]?.get?.()??{}}}}),Uen=E8({"../../../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,g)=>{for(var b in g)r(m,b,{get:g[b],enumerable:!0})},o=(m,g,b,v)=>{if(g&&typeof g=="object"||typeof g=="function")for(let w of s(g))!a.call(m,w)&&w!==b&&r(m,w,{get:()=>g[w],enumerable:!(v=n(g,w))||v.enumerable});return m},l=m=>o(r({},"__esModule",{value:!0}),m),c={};i(c,{getVercelOidcToken:()=>f,getVercelOidcTokenSync:()=>h}),t.exports=l(c);var d=Fht(),p=gJr();async function f(){let m="",g;try{m=h()}catch(b){g=b}try{const[{getTokenPayload:b,isExpired:v},{refreshToken:w}]=await Promise.all([await Ze(()=>import("./token-util-NEHG7TUY-U7CX7GS4-BB_HxchF.js"),__vite__mapDeps([26,27,1]),import.meta.url),await Ze(()=>import("./token-6GSAFR2W-XRCSVUPZ-B4Fg5eyh.js"),__vite__mapDeps([28,27,1]),import.meta.url)]);(!m||v(b(m)))&&(await w(),m=h())}catch(b){throw g?.message&&b instanceof Error&&(b.message=`${g.message}
|
|
508
508
|
${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"]??zen.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}}}),Bht=E8({"../../../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,g)=>{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:!(g=n(h,b))||g.enumerable});return f},l=f=>o(r({},"__esModule",{value:!0}),f),c={};i(c,{getContext:()=>p.getContext,getVercelOidcToken:()=>d.getVercelOidcToken,getVercelOidcTokenSync:()=>d.getVercelOidcTokenSync}),t.exports=l(c);var d=Uen(),p=Fht()}}),Ven=pht(Bht()),qen=pht(Bht()),Hen="vercel.ai.gateway.error",xK=Symbol.for(Hen),yMe,bMe,Qd=class zht extends(bMe=Error,yMe=xK,bMe){constructor({message:t,statusCode:r=500,cause:n}){super(t),this[yMe]=!0,this.statusCode=r,this.cause=n}static isInstance(t){return zht.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&xK in t&&t[xK]===!0}},Uht="GatewayAuthenticationError",Zen=`vercel.ai.gateway.error.${Uht}`,vMe=Symbol.for(Zen),xMe,wMe,Vht=class qht extends(wMe=Qd,xMe=vMe,wMe){constructor({message:t="Authentication failed",statusCode:r=401,cause:n}={}){super({message:t,statusCode:r,cause:n}),this[xMe]=!0,this.name=Uht,this.type="authentication_error"}static isInstance(t){return Qd.hasMarker(t)&&vMe 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.
|
|
509
509
|
|
|
510
510
|
Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
|
|
@@ -603,7 +603,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
603
603
|
`&&(R=`
|
|
604
604
|
`);var Q=0,$=!1;this.parse=function(X,U,N){if(typeof X!="string")throw new Error("Input must be a string");var Z=X.length,G=I.length,K=R.length,ee=P.length,te=T(L),se=[],ue=[],xe=[],W=Q=0;if(!X)return Te();if(M||M!==!1&&X.indexOf(q)===-1){for(var ae=X.split(R),ne=0;ne<ae.length;ne++){if(xe=ae[ne],Q+=xe.length,ne!==ae.length-1)Q+=R.length;else if(N)return Te();if(!P||xe.substring(0,ee)!==P){if(te){if(se=[],oe(xe.split(I)),we(),$)return Te()}else oe(xe.split(I));if(B&&B<=ne)return se=se.slice(0,B),Te(!0)}}return Te()}for(var ye=X.indexOf(I,Q),le=X.indexOf(R,Q),be=new RegExp(b(V)+b(q),"g"),Ne=X.indexOf(q,Q);;)if(X[Q]===q)for(Ne=Q,Q++;;){if((Ne=X.indexOf(q,Ne+1))===-1)return N||ue.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:se.length,index:Q}),he();if(Ne===Z-1)return he(X.substring(Q,Ne).replace(be,q));if(q===V&&X[Ne+1]===V)Ne++;else if(q===V||Ne===0||X[Ne-1]!==V){ye!==-1&&ye<Ne+1&&(ye=X.indexOf(I,Ne+1));var ke=pe((le=le!==-1&&le<Ne+1?X.indexOf(R,Ne+1):le)===-1?ye:Math.min(ye,le));if(X.substr(Ne+1+ke,G)===I){xe.push(X.substring(Q,Ne).replace(be,q)),X[Q=Ne+1+ke+G]!==q&&(Ne=X.indexOf(q,Q)),ye=X.indexOf(I,Q),le=X.indexOf(R,Q);break}if(ke=pe(le),X.substring(Ne+1+ke,Ne+1+ke+K)===R){if(xe.push(X.substring(Q,Ne).replace(be,q)),Ie(Ne+1+ke+K),ye=X.indexOf(I,Q),Ne=X.indexOf(q,Q),te&&(we(),$))return Te();if(B&&se.length>=B)return Te(!0);break}ue.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:se.length,index:Q}),Ne++}}else if(P&&xe.length===0&&X.substring(Q,Q+ee)===P){if(le===-1)return Te();Q=le+K,le=X.indexOf(R,Q),ye=X.indexOf(I,Q)}else if(ye!==-1&&(ye<le||le===-1))xe.push(X.substring(Q,ye)),Q=ye+G,ye=X.indexOf(I,Q);else{if(le===-1)break;if(xe.push(X.substring(Q,le)),Ie(le+K),te&&(we(),$))return Te();if(B&&se.length>=B)return Te(!0)}return he();function oe(de){se.push(de),W=Q}function pe(de){var De=0;return De=de!==-1&&(de=X.substring(Ne+1,de))&&de.trim()===""?de.length:De}function he(de){return N||(de===void 0&&(de=X.substring(Q)),xe.push(de),Q=Z,oe(xe),te&&we()),Te()}function Ie(de){Q=de,oe(xe),xe=[],le=X.indexOf(R,Q)}function Te(de){if(A.header&&!U&&se.length&&!H){var De=se[0],Le=Object.create(null),rt=new Set(De);let Ot=!1;for(let Mt=0;Mt<De.length;Mt++){let ut=De[Mt];if(Le[ut=T(A.transformHeader)?A.transformHeader(ut,Mt):ut]){let or,Hr=Le[ut];for(;or=ut+"_"+Hr,Hr++,rt.has(or););rt.add(or),De[Mt]=or,Le[ut]++,Ot=!0,(z=z===null?{}:z)[or]=ut}else Le[ut]=1,De[Mt]=ut;rt.add(ut)}Ot&&console.warn("Duplicate headers found and renamed."),H=!0}return{data:se,errors:ue,meta:{delimiter:I,linebreak:R,aborted:$,truncated:!!de,cursor:W+(U||0),renamedHeaders:z}}}function we(){L(Te()),se=[],ue=[]}},this.abort=function(){$=!0},this.getCharIndex=function(){return Q}}function w(A){var I=A.data,R=o[I.workerId],P=!1;if(I.error)R.userError(I.error,I.file);else if(I.results&&I.results.data){var L={abort:function(){P=!0,S(I.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:_,resume:_};if(T(R.userStep)){for(var B=0;B<I.results.data.length&&(R.userStep({data:I.results.data[B],errors:I.results.errors,meta:I.results.meta},L),!P);B++);delete I.results}else T(R.userChunk)&&(R.userChunk(I.results,L,I.file),delete I.results)}I.finished&&!P&&S(I.workerId,I.results)}function S(A,I){var R=o[A];T(R.userComplete)&&R.userComplete(I),R.terminate(),delete o[A]}function _(){throw new Error("Not implemented.")}function O(A){if(typeof A!="object"||A===null)return A;var I,R=Array.isArray(A)?[]:{};for(I in A)R[I]=O(A[I]);return R}function C(A,I){return function(){A.apply(I,arguments)}}function T(A){return typeof A=="function"}return c.parse=function(A,I){var R=(I=I||{}).dynamicTyping||!1;if(T(R)&&(I.dynamicTypingFunction=R,R={}),I.dynamicTyping=R,I.transform=!!T(I.transform)&&I.transform,!I.worker||!c.WORKERS_SUPPORTED)return R=null,c.NODE_STREAM_INPUT,typeof A=="string"?(A=(P=>P.charCodeAt(0)!==65279?P:P.slice(1))(A),R=new(I.download?p:h)(I)):A.readable===!0&&T(A.read)&&T(A.on)?R=new m(I):(n.File&&A instanceof File||A instanceof Object)&&(R=new f(I)),R.stream(A);(R=(()=>{var P;return!!c.WORKERS_SUPPORTED&&(P=(()=>{var L=n.URL||n.webkitURL||null,B=r.toString();return c.BLOB_URL||(c.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; ","(",B,")();"],{type:"text/javascript"})))})(),(P=new n.Worker(P)).onmessage=w,P.id=l++,o[P.id]=P)})()).userStep=I.step,R.userChunk=I.chunk,R.userComplete=I.complete,R.userError=I.error,I.step=T(I.step),I.chunk=T(I.chunk),I.complete=T(I.complete),I.error=T(I.error),delete I.worker,R.postMessage({input:A,config:I,workerId:R.id})},c.unparse=function(A,I){var R=!1,P=!0,L=",",B=`\r
|
|
605
605
|
`,M='"',z=M+M,H=!1,q=null,V=!1,Q=((()=>{if(typeof I=="object"){if(typeof I.delimiter!="string"||c.BAD_DELIMITERS.filter(function(U){return I.delimiter.indexOf(U)!==-1}).length||(L=I.delimiter),typeof I.quotes!="boolean"&&typeof I.quotes!="function"&&!Array.isArray(I.quotes)||(R=I.quotes),typeof I.skipEmptyLines!="boolean"&&typeof I.skipEmptyLines!="string"||(H=I.skipEmptyLines),typeof I.newline=="string"&&(B=I.newline),typeof I.quoteChar=="string"&&(M=I.quoteChar),typeof I.header=="boolean"&&(P=I.header),Array.isArray(I.columns)){if(I.columns.length===0)throw new Error("Option columns is empty");q=I.columns}I.escapeChar!==void 0&&(z=I.escapeChar+M),I.escapeFormulae instanceof RegExp?V=I.escapeFormulae:typeof I.escapeFormulae=="boolean"&&I.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,H);if(typeof A[0]=="object")return $(q||Object.keys(A[0]),A,H)}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||[],H);throw new Error("Unable to serialize unrecognized input");function $(U,N,Z){var G="",K=(typeof U=="string"&&(U=JSON.parse(U)),typeof N=="string"&&(N=JSON.parse(N)),Array.isArray(U)&&0<U.length),ee=!Array.isArray(N[0]);if(K&&P){for(var te=0;te<U.length;te++)0<te&&(G+=L),G+=X(U[te],te);0<N.length&&(G+=B)}for(var se=0;se<N.length;se++){var ue=(K?U:N[se]).length,xe=!1,W=K?Object.keys(N[se]).length===0:N[se].length===0;if(Z&&!K&&(xe=Z==="greedy"?N[se].join("").trim()==="":N[se].length===1&&N[se][0].length===0),Z==="greedy"&&K){for(var ae=[],ne=0;ne<ue;ne++){var ye=ee?U[ne]:ne;ae.push(N[se][ye])}xe=ae.join("").trim()===""}if(!xe){for(var le=0;le<ue;le++){0<le&&!W&&(G+=L);var be=K&&ee?U[le]:le;G+=X(N[se][be],le)}se<N.length-1&&(!Z||0<ue&&!W)&&(G+=B)}}return G}function X(U,N){var Z,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),Z=U.toString().replace(Q,z),(G=G||R===!0||typeof R=="function"&&R(U,N)||Array.isArray(R)&&R[N]||((K,ee)=>{for(var te=0;te<ee.length;te++)if(-1<K.indexOf(ee[te]))return!0;return!1})(Z,c.BAD_DELIMITERS)||-1<Z.indexOf(L)||Z.charAt(0)===" "||Z.charAt(Z.length-1)===" ")?M+Z+M:Z)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
|
|
606
|
-
`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!a&&!!n.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=v,c.ParserHandle=g,c.NetworkStreamer=p,c.FileStreamer=f,c.StringStreamer=h,c.ReadableStreamStreamer=m,n.jQuery&&((s=n.jQuery).fn.parse=function(A){var I=A.config||{},R=[];return this.each(function(B){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++)R.push({file:this.files[M],inputElem:this,instanceConfig:s.extend({},I)})}),P(),this;function P(){if(R.length===0)T(A.complete)&&A.complete();else{var B,M,z,H,q=R[0];if(T(A.before)){var V=A.before(q.file,q.inputElem);if(typeof V=="object"){if(V.action==="abort")return B="AbortError",M=q.file,z=q.inputElem,H=V.reason,void(T(A.error)&&A.error({name:B},M,z,H));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 Q=q.instanceConfig.complete;q.instanceConfig.complete=function($){T(Q)&&Q($,q.file,q.inputElem),L()},c.parse(q.file,q.instanceConfig)}}function L(){R.splice(0,1),P()}}),i&&(n.onmessage=function(A){A=A.data,c.WORKER_ID===void 0&&A&&(c.WORKER_ID=A.workerId),typeof A.input=="string"?n.postMessage({workerId:c.WORKER_ID,results:c.parse(A.input,A.config),finished:!0}):(n.File&&A.input instanceof File||A.input instanceof Object)&&(A=c.parse(A.input,A.config))&&n.postMessage({workerId:c.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,c})})(E3)),E3.exports}var Rpn=Npn();const fbt=cf(Rpn);var K4e=1,Ppn=.9,jpn=.8,$pn=.17,LJ=.1,FJ=.999,Mpn=.9999,Lpn=.99,Fpn=/[\\\/_+.#"@\[\(\{&]/,Bpn=/[\\\/_+.#"@\[\(\{&]/g,zpn=/[\s-]/,hbt=/[\s-]/g;function lae(e,t,r,n,s,a,i){if(a===t.length)return s===e.length?K4e:Lpn;var o=`${s},${a}`;if(i[o]!==void 0)return i[o];for(var l=n.charAt(a),c=r.indexOf(l,s),d=0,p,f,h,m;c>=0;)p=lae(e,t,r,n,c+1,a+1,i),p>d&&(c===s?p*=K4e:Fpn.test(e.charAt(c-1))?(p*=jpn,h=e.slice(s,c-1).match(Bpn),h&&s>0&&(p*=Math.pow(FJ,h.length))):zpn.test(e.charAt(c-1))?(p*=Ppn,m=e.slice(s,c-1).match(hbt),m&&s>0&&(p*=Math.pow(FJ,m.length))):(p*=$pn,s>0&&(p*=Math.pow(FJ,c-s))),e.charAt(c)!==t.charAt(a)&&(p*=Mpn)),(p<LJ&&r.charAt(c-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(c-1)!==n.charAt(a))&&(f=lae(e,t,r,n,c+1,a+2,i),f*LJ>p&&(p=f*LJ)),p>d&&(d=p),c=r.indexOf(l,c+1);return i[o]=d,d}function J4e(e){return e.toLowerCase().replace(hbt," ")}function Upn(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,lae(e,t,J4e(e),J4e(t),0,0,{})}var mT='[cmdk-group=""]',BJ='[cmdk-group-items=""]',Vpn='[cmdk-group-heading=""]',mbt='[cmdk-item=""]',e5e=`${mbt}:not([aria-disabled="true"])`,cae="cmdk-item-select",pE="data-value",qpn=(e,t,r)=>Upn(e,t,r),gbt=E.createContext(void 0),RP=()=>E.useContext(gbt),ybt=E.createContext(void 0),Mme=()=>E.useContext(ybt),bbt=E.createContext(void 0),vbt=E.forwardRef((e,t)=>{let r=fE(()=>{var U,N;return{search:"",value:(N=(U=e.value)!=null?U:e.defaultValue)!=null?N:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=fE(()=>new Set),s=fE(()=>new Map),a=fE(()=>new Map),i=fE(()=>new Set),o=xbt(e),{label:l,children:c,value:d,onValueChange:p,filter:f,shouldFilter:h,loop:m,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,w=ho(),S=ho(),_=ho(),O=E.useRef(null),C=tfn();W1(()=>{if(d!==void 0){let U=d.trim();r.current.value=U,T.emit()}},[d]),W1(()=>{C(6,B)},[]);let T=E.useMemo(()=>({subscribe:U=>(i.current.add(U),()=>i.current.delete(U)),snapshot:()=>r.current,setState:(U,N,Z)=>{var G,K,ee,te;if(!Object.is(r.current[U],N)){if(r.current[U]=N,U==="search")L(),R(),C(1,P);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(_);se?se.focus():(G=document.getElementById(w))==null||G.focus()}if(C(7,()=>{var se;r.current.selectedItemId=(se=M())==null?void 0:se.id,T.emit()}),Z||C(5,B),((K=o.current)==null?void 0:K.value)!==void 0){let se=N??"";(te=(ee=o.current).onValueChange)==null||te.call(ee,se);return}}T.emit()}},emit:()=>{i.current.forEach(U=>U())}}),[]),A=E.useMemo(()=>({value:(U,N,Z)=>{var G;N!==((G=a.current.get(U))==null?void 0:G.value)&&(a.current.set(U,{value:N,keywords:Z}),r.current.filtered.items.set(U,I(N,Z)),C(2,()=>{R(),T.emit()}))},item:(U,N)=>(n.current.add(U),N&&(s.current.has(N)?s.current.get(N).add(U):s.current.set(N,new Set([U]))),C(3,()=>{L(),R(),r.current.value||P(),T.emit()}),()=>{a.current.delete(U),n.current.delete(U),r.current.filtered.items.delete(U);let Z=M();C(4,()=>{L(),Z?.getAttribute("id")===U&&P(),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:w,inputId:_,labelId:S,listInnerRef:O}),[]);function I(U,N){var Z,G;let K=(G=(Z=o.current)==null?void 0:Z.filter)!=null?G:qpn;return U?K(U,r.current.search,N):0}function R(){if(!r.current.search||o.current.shouldFilter===!1)return;let U=r.current.filtered.items,N=[];r.current.filtered.groups.forEach(G=>{let K=s.current.get(G),ee=0;K.forEach(te=>{let se=U.get(te);ee=Math.max(se,ee)}),N.push([G,ee])});let Z=O.current;z().sort((G,K)=>{var ee,te;let se=G.getAttribute("id"),ue=K.getAttribute("id");return((ee=U.get(ue))!=null?ee:0)-((te=U.get(se))!=null?te:0)}).forEach(G=>{let K=G.closest(BJ);K?K.appendChild(G.parentElement===K?G:G.closest(`${BJ} > *`)):Z.appendChild(G.parentElement===Z?G:G.closest(`${BJ} > *`))}),N.sort((G,K)=>K[1]-G[1]).forEach(G=>{var K;let ee=(K=O.current)==null?void 0:K.querySelector(`${mT}[${pE}="${encodeURIComponent(G[0])}"]`);ee?.parentElement.appendChild(ee)})}function P(){let U=z().find(Z=>Z.getAttribute("aria-disabled")!=="true"),N=U?.getAttribute(pE);T.setState("value",N||void 0)}function L(){var U,N,Z,G;if(!r.current.search||o.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let K=0;for(let ee of n.current){let te=(N=(U=a.current.get(ee))==null?void 0:U.value)!=null?N:"",se=(G=(Z=a.current.get(ee))==null?void 0:Z.keywords)!=null?G:[],ue=I(te,se);r.current.filtered.items.set(ee,ue),ue>0&&K++}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=K}function B(){var U,N,Z;let G=M();G&&(((U=G.parentElement)==null?void 0:U.firstChild)===G&&((Z=(N=G.closest(mT))==null?void 0:N.querySelector(Vpn))==null||Z.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function M(){var U;return(U=O.current)==null?void 0:U.querySelector(`${mbt}[aria-selected="true"]`)}function z(){var U;return Array.from(((U=O.current)==null?void 0:U.querySelectorAll(e5e))||[])}function H(U){let N=z()[U];N&&T.setState("value",N.getAttribute(pE))}function q(U){var N;let Z=M(),G=z(),K=G.findIndex(te=>te===Z),ee=G[K+U];(N=o.current)!=null&&N.loop&&(ee=K+U<0?G[G.length-1]:K+U===G.length?G[0]:G[K+U]),ee&&T.setState("value",ee.getAttribute(pE))}function V(U){let N=M(),Z=N?.closest(mT),G;for(;Z&&!G;)Z=U>0?Jpn(Z,mT):efn(Z,mT),G=Z?.querySelector(e5e);G?T.setState("value",G.getAttribute(pE)):q(U)}let Q=()=>H(z().length-1),$=U=>{U.preventDefault(),U.metaKey?Q():U.altKey?V(1):q(1)},X=U=>{U.preventDefault(),U.metaKey?H(0):U.altKey?V(-1):q(-1)};return E.createElement(xl.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:U=>{var N;(N=v.onKeyDown)==null||N.call(v,U);let Z=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||Z))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(),H(0);break}case"End":{U.preventDefault(),Q();break}case"Enter":{U.preventDefault();let G=M();if(G){let K=new Event(cae);G.dispatchEvent(K)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:nfn},l),U8(e,U=>E.createElement(ybt.Provider,{value:T},E.createElement(gbt.Provider,{value:A},U))))}),Hpn=E.forwardRef((e,t)=>{var r,n;let s=ho(),a=E.useRef(null),i=E.useContext(bbt),o=RP(),l=xbt(e),c=(n=(r=l.current)==null?void 0:r.forceMount)!=null?n:i?.forceMount;W1(()=>{if(!c)return o.item(s,i?.id)},[c]);let d=wbt(s,a,[e.value,e.children,a],e.keywords),p=Mme(),f=bx(C=>C.value&&C.value===d.current),h=bx(C=>c||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(cae,m),()=>C.removeEventListener(cae,m)},[h,e.onSelect,e.disabled]);function m(){var C,T;g(),(T=(C=l.current).onSelect)==null||T.call(C,d.current)}function g(){p.setState("value",d.current,!0)}if(!h)return null;let{disabled:b,value:v,onSelect:w,forceMount:S,keywords:_,...O}=e;return E.createElement(xl.div,{ref:Lm(a,t),...O,id:s,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!f,"data-disabled":!!b,"data-selected":!!f,onPointerMove:b||o.getDisablePointerSelection()?void 0:g,onClick:b?void 0:m},e.children)}),Zpn=E.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...a}=e,i=ho(),o=E.useRef(null),l=E.useRef(null),c=ho(),d=RP(),p=bx(h=>s||d.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);W1(()=>d.group(i),[]),wbt(i,o,[e.value,e.heading,l]);let f=E.useMemo(()=>({id:i,forceMount:s}),[s]);return E.createElement(xl.div,{ref:Lm(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:c},r),U8(e,h=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},E.createElement(bbt.Provider,{value:f},h))))}),Gpn=E.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=E.useRef(null),a=bx(i=>!i.search);return!r&&!a?null:E.createElement(xl.div,{ref:Lm(s,t),...n,"cmdk-separator":"",role:"separator"})}),Qpn=E.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,a=Mme(),i=bx(c=>c.search),o=bx(c=>c.selectedItemId),l=RP();return E.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),E.createElement(xl.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:c=>{s||a.setState("search",c.target.value),r?.(c.target.value)}})}),Wpn=E.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,a=E.useRef(null),i=E.useRef(null),o=bx(c=>c.selectedItemId),l=RP();return E.useEffect(()=>{if(i.current&&a.current){let c=i.current,d=a.current,p,f=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let h=c.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(p),f.unobserve(c)}}},[]),E.createElement(xl.div,{ref:Lm(a,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":n,id:l.listId},U8(e,c=>E.createElement("div",{ref:Lm(i,l.listInnerRef),"cmdk-list-sizer":""},c)))}),Xpn=E.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:a,container:i,...o}=e;return E.createElement(Y6,{open:r,onOpenChange:n},E.createElement(K6,{container:i},E.createElement(ZR,{"cmdk-overlay":"",className:s}),E.createElement(GR,{"aria-label":e.label,"cmdk-dialog":"",className:a},E.createElement(vbt,{ref:t,...o}))))}),Ypn=E.forwardRef((e,t)=>bx(r=>r.filtered.count===0)?E.createElement(xl.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Kpn=E.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...a}=e;return E.createElement(xl.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},U8(e,i=>E.createElement("div",{"aria-hidden":!0},i)))}),Gu=Object.assign(vbt,{List:Wpn,Item:Hpn,Input:Qpn,Group:Zpn,Separator:Gpn,Dialog:Xpn,Empty:Ypn,Loading:Kpn});function Jpn(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function efn(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function xbt(e){let t=E.useRef(e);return W1(()=>{t.current=e}),t}var W1=typeof window>"u"?E.useEffect:E.useLayoutEffect;function fE(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function bx(e){let t=Mme(),r=()=>e(t.snapshot());return E.useSyncExternalStore(t.subscribe,r,r)}function wbt(e,t,r,n=[]){let s=E.useRef(),a=RP();return W1(()=>{var i;let o=(()=>{var c;for(let d of r){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(c=d.current.textContent)==null?void 0:c.trim():s.current}})(),l=n.map(c=>c.trim());a.value(e,o,l),(i=t.current)==null||i.setAttribute(pE,o),s.current=o}),s}var tfn=()=>{let[e,t]=E.useState(),r=fE(()=>new Map);return W1(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function rfn(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function U8({asChild:e,children:t},r){return e&&E.isValidElement(t)?E.cloneElement(rfn(t),{ref:t.ref},r(t.props.children)):r(t)}var nfn={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 X1(e,t,r,n,s,a){if(e==n)return[];let i=Fme(e,t,r,n,s,a),o=Bme(e,t+i,r,n,s+i,a);t+=i,r-=o,s+=i,a-=o;let l=r-t,c=a-s;if(!l||!c)return[new Oo(t,r,s,a)];if(l>c){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+c,r,a,a)]}else if(c>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||c==1)return[new Oo(t,r,s,a)];let d=_bt(e,t,r,n,s,a);if(d){let[p,f,h]=d;return X1(e,t,p,n,s,f).concat(X1(e,p+h,r,n,f+h,a))}return sfn(e,t,r,n,s,a)}let YT=1e9,KT=0,Lme=!1;function sfn(e,t,r,n,s,a){let i=r-t,o=a-s;if(YT<1e9&&Math.min(i,o)>YT*16||KT>0&&Date.now()>KT)return Math.min(i,o)>YT*64?[new Oo(t,r,s,a)]:t5e(e,t,r,n,s,a);let l=Math.ceil((i+o)/2);zJ.reset(l),UJ.reset(l);let c=(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?UJ:null,f=p?null:zJ;for(let h=0;h<l;h++){if(h>YT||KT>0&&!(h&63)&&Date.now()>KT)return t5e(e,t,r,n,s,a);let m=zJ.advance(h,i,o,l,p,!1,c)||UJ.advance(h,i,o,l,f,!0,d);if(m)return afn(e,t,r,t+m[0],n,s,a,s+m[1])}return[new Oo(t,r,s,a)]}class Sbt{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 c=s+l,d=l==-t||l!=t&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,p=d-l;for(;d<r&&p<n&&o(d,p);)d++,p++;if(this.vec[c]=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 zJ=new Sbt,UJ=new Sbt;function afn(e,t,r,n,s,a,i,o){let l=!1;return!Rk(e,n)&&++n==r&&(l=!0),!Rk(s,o)&&++o==i&&(l=!0),l?[new Oo(t,r,a,i)]:X1(e,t,n,s,a,o).concat(X1(e,n,r,s,o,i))}function Ebt(e,t){let r=1,n=Math.min(e,t);for(;r<n;)r=r<<1;return r}function Fme(e,t,r,n,s,a){if(t==r||t==a||e.charCodeAt(t)!=n.charCodeAt(s))return 0;let i=Ebt(r-t,a-s);for(let o=t,l=s;;){let c=o+i,d=l+i;if(c>r||d>a||e.slice(o,c)!=n.slice(l,d)){if(i==1)return o-t-(Rk(e,o)?0:1);i=i>>1}else{if(c==r||d==a)return c-t;o=c,l=d}}}function Bme(e,t,r,n,s,a){if(t==r||s==a||e.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let i=Ebt(r-t,a-s);for(let o=r,l=a;;){let c=o-i,d=l-i;if(c<t||d<s||e.slice(c,o)!=n.slice(d,l)){if(i==1)return r-o-(Rk(e,o)?0:1);i=i>>1}else{if(c==t||d==s)return r-c;o=c,l=d}}}function uae(e,t,r,n,s,a,i,o){let l=n.slice(s,a),c=null;for(;;){if(c||i<o)return c;for(let d=t+i;;){Rk(e,d)||d++;let p=d+i;if(Rk(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=Fme(e,p,r,n,s+h+f.length,a),g=Bme(e,t,d,n,s,s+h),b=f.length+m+g;(!c||c[2]<b)&&(c=[d-g,s+h-g,b])}d=p}if(o<0)return c;i=i>>1}}function _bt(e,t,r,n,s,a){let i=r-t,o=a-s;if(i<o){let l=_bt(n,s,a,e,t,r);return l&&[l[1],l[0],l[2]]}return i<4||o*2<i?null:uae(e,t,r,n,s,a,Math.floor(i/4),-1)}function t5e(e,t,r,n,s,a){Lme=!0;let i=r-t,o=a-s,l;if(i<o){let f=uae(n,s,a,e,t,r,Math.floor(i/6),50);l=f&&[f[1],f[0],f[2]]}else l=uae(e,t,r,n,s,a,Math.floor(o/6),50);if(!l)return[new Oo(t,r,s,a)];let[c,d,p]=l;return X1(e,t,c,n,s,d).concat(X1(e,c+p,r,n,d+p,a))}function kbt(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 ifn(e,t,r){for(;;){kbt(r,1);let n=!1;for(let s=0;s<r.length;s++){let a=r[s],i,o;(i=Fme(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=Bme(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,c=a.toB-a.fromB;if(l&&c)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 ofn(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,c=a.fromA-n,d=l-a.toA,p=n5e(t,a.fromA,c),f=r5e(t,a.toA,d),h=a.fromA-p,m=f-a.toA;if((!i||!o)&&h&&m){let g=Math.max(i,o),[b,v,w]=i?[t,a.fromA,a.toA]:[r,a.fromB,a.toB];g>h&&t.slice(p,a.fromA)==b.slice(w-h,w)?(a=e[s]=new Oo(p,p+i,a.fromB-h,a.toB-h),p=a.fromA,f=r5e(t,a.toA,l-a.toA)):g>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=n5e(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 g=a5e(t,a.fromA,a.toA),b,v=g<0?-1:s5e(t,a.toA,a.fromA);g>-1&&(b=g-a.fromA)<=d&&t.slice(a.fromA,g)==t.slice(a.toA,a.toA+b)?a=e[s]=a.offset(b):v>-1&&(b=a.toA-v)<=c&&t.slice(a.fromA-b,a.fromA)==t.slice(v,a.toA)&&(a=e[s]=a.offset(-b))}}else{let g=a5e(r,a.fromB,a.toB),b,v=g<0?-1:s5e(r,a.toB,a.fromB);g>-1&&(b=g-a.fromB)<=d&&r.slice(a.fromB,g)==r.slice(a.toB,a.toB+b)?a=e[s]=a.offset(b):v>-1&&(b=a.toB-v)<=c&&r.slice(a.fromB-b,a.fromB)==r.slice(v,a.toB)&&(a=e[s]=a.offset(-b))}}n=a.toA}return kbt(e,3),e}let f1;try{f1=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Obt(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Cbt(e,t){if(t==e.length)return 0;let r=e.charCodeAt(t);return r<192?Obt(r)?1:0:f1?!Dbt(r)||t==e.length-1?f1.test(String.fromCharCode(r))?1:0:f1.test(e.slice(t,t+2))?2:0:0}function Tbt(e,t){if(!t)return 0;let r=e.charCodeAt(t-1);return r<192?Obt(r)?1:0:f1?!Ibt(r)||t==1?f1.test(String.fromCharCode(r))?1:0:f1.test(e.slice(t-2,t))?2:0:0}const Abt=8;function r5e(e,t,r){if(t==e.length||!Tbt(e,t))return t;for(let n=t,s=t+r,a=0;a<Abt;a++){let i=Cbt(e,n);if(!i||n+i>s)return n;n+=i}return t}function n5e(e,t,r){if(!t||!Cbt(e,t))return t;for(let n=t,s=t-r,a=0;a<Abt;a++){let i=Tbt(e,n);if(!i||n-i<s)return n;n-=i}return t}function s5e(e,t,r){for(;t!=r;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function a5e(e,t,r){for(;t!=r;t++)if(e.charCodeAt(t)==10)return t;return-1}const Dbt=e=>e>=55296&&e<=56319,Ibt=e=>e>=56320&&e<=57343;function Rk(e,t){return!t||t==e.length||!Dbt(e.charCodeAt(t-1))||!Ibt(e.charCodeAt(t))}function lfn(e,t,r){var n;let s=r?.override;return s?s(e,t):(YT=((n=r?.scanLimit)!==null&&n!==void 0?n:1e9)>>1,KT=r?.timeout?Date.now()+r.timeout:0,Lme=!1,ifn(e,t,X1(e,0,e.length,t,0,t.length)))}function Nbt(){return!Lme}function Rbt(e,t,r){return ofn(lfn(e,t,r),e,t)}const pm=Yt.define({combine:e=>e[0]}),dae=sn.define(),cfn=Yt.define(),Pk=go.define({create(e){return null},update(e,t){for(let r of t.effects)r.is(dae)&&(e=r.value);for(let r of t.state.facet(cfn))e=r(e,t);return e}});class o_{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 o_(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=Rbt(t.toString(),r.toString(),n);return Pbt(s,t,r,0,0,Nbt())}static updateA(t,r,n,s,a){return u5e(c5e(t,s,!0,n.length),t,r,n,a)}static updateB(t,r,n,s,a){return u5e(c5e(t,s,!1,r.length),t,r,n,a)}}function i5e(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 o5e(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 Pbt(e,t,r,n,s,a){let i=[];for(let o=0;o<e.length;o++){let l=e[o],[c,d]=i5e(l.fromA+n,l.fromB+s,t,r),[p,f]=o5e(l.toA+n,l.toB+s,t,r),h=[l.offset(-c+n,-d+s)];for(;o<e.length-1;){let m=e[o+1],[g,b]=i5e(m.fromA+n,m.fromB+s,t,r);if(g>p+1&&b>f+1)break;h.push(m.offset(-c+n,-d+s)),[p,f]=o5e(m.toA+n,m.toB+s,t,r),o++}i.push(new o_(h,c,Math.max(c,p),d,Math.max(d,f),a))}return i}const K$=1e3;function l5e(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,c]=r?[o.fromA,o.toA]:[o.fromB,o.toB];if(l>t)a=i;else if(c<=t)s=i+1;else return n?[o.fromA,o.fromB]:[o.toA,o.toB]}}function c5e(e,t,r,n){let s=[];return t.iterChangedRanges((a,i,o,l)=>{let c=0,d=r?t.length:n,p=0,f=r?n:t.length;a>K$&&([c,p]=l5e(e,a-K$,r,!0)),i<t.length-K$&&([d,f]=l5e(e,i+K$,r,!1));let h=l-o-(i-a),m,[g,b]=r?[h,0]:[0,h];s.length&&(m=s[s.length-1]).toA>=c?s[s.length-1]={fromA:m.fromA,fromB:m.fromB,toA:d,toB:f,diffA:m.diffA+g,diffB:m.diffB+b}:s.push({fromA:c,toA:d,fromB:p,toB:f,diffA:g,diffB:b})}),s}function u5e(e,t,r,n,s){if(!e.length)return t;let a=[];for(let i=0,o=0,l=0,c=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(;c<t.length;){let b=t[c];if(b.endA+o>p||b.endB+l>f)break;a.push(b.offset(o,l)),c++}if(!d)break;let h=d.toA+o+d.diffA,m=d.toB+l+d.diffB,g=Rbt(r.sliceString(p,h),n.sliceString(f,m),s);for(let b of Pbt(g,r,n,p,f,Nbt()))a.push(b);for(o+=d.diffA,l+=d.diffB;c<t.length;){let b=t[c];if(b.fromA+o>h&&b.fromB+l>m)break;c++}}return a}const ufn={scanLimit:500},jbt=Ci.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=f5e(e))}update(e){(e.docChanged||e.viewportChanged||dfn(e.startState,e.state)||pfn(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=f5e(e.view))}},{decorations:e=>e.deco}),J$=Ch.low(_We({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(jbt))===null||t===void 0?void 0:t.gutter)||Jn.empty}}));function dfn(e,t){return e.field(Pk,!1)!=t.field(Pk,!1)}function pfn(e,t){return e.facet(pm)!=t.facet(pm)}const d5e=nr.line({class:"cm-changedLine"}),ffn=nr.mark({class:"cm-changedText"}),hfn=nr.mark({tagName:"ins",class:"cm-insertedLine"}),mfn=nr.mark({tagName:"del",class:"cm-deletedLine"}),p5e=new class extends Um{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function gfn(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,d5e),s.add(i,o,r?mfn:hfn),a&&a.add(i,i,p5e);for(let c=t.iterRange(i,o-1),d=i;!c.next().done;){if(c.lineBreak){d++,s.add(d,d,d5e),a&&a.add(d,d,p5e);continue}let p=d+c.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),g=Math.max(d,h),b=Math.min(p,m);if(g<b&&s.add(g,b,ffn),m<p)l++;else break}d=p}}}function f5e(e){let t=e.state.field(Pk),{side:r,highlightChanges:n,markGutter:s,overrideChunk:a}=e.state.facet(pm),i=r=="a",o=new Nu,l=s?new Nu:null,{from:c,to:d}=e.viewport;for(let p of t){if((i?p.fromA:p.fromB)>=d)break;(i?p.toA:p.toB)>c&&(!a||!a(e.state,p,o,l))&&gfn(p,e.state.doc,i,n,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}class eM extends np{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 mL=sn.define({map:(e,t)=>e.map(t)}),JT=go.define({create:()=>nr.none,update:(e,t)=>{for(let r of t.effects)if(r.is(mL))return r.value;return e.map(t.changes)},provide:e=>gt.decorations.from(e)}),tM=.01;function h5e(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 yfn(e,t,r){let n=new Nu,s=new Nu,a=e.state.field(JT).iter(),i=t.state.field(JT).iter(),o=0,l=0,c=0,d=0,p=e.viewport,f=t.viewport;for(let b=0;;b++){let v=b<r.length?r[b]:null,w=v?v.fromA:e.state.doc.length,S=v?v.fromB:t.state.doc.length;if(o<w){let _=e.lineBlockAt(o).top+c,O=t.lineBlockAt(l).top+d,C=_-O;C<-tM?(c-=C,n.add(o,o,nr.widget({widget:new eM(-C),block:!0,side:-1}))):C>tM&&(d+=C,s.add(l,l,nr.widget({widget:new eM(C),block:!0,side:-1})))}if(w>o+1e3&&o<p.from&&w>p.from&&l<f.from&&S>f.from){let _=Math.min(p.from-o,f.from-l);o+=_,l+=_,b--}else if(v)o=v.toA,l=v.toB;else break;for(;a.value&&a.from<o;)c-=a.value.spec.widget.height,a.next();for(;i.value&&i.from<l;)d-=i.value.spec.widget.height,i.next()}for(;a.value;)c-=a.value.spec.widget.height,a.next();for(;i.value;)d-=i.value.spec.widget.height,i.next();let h=e.contentHeight+c-(t.contentHeight+d);h<tM?n.add(e.state.doc.length,e.state.doc.length,nr.widget({widget:new eM(-h),block:!0,side:1})):h>tM&&s.add(t.state.doc.length,t.state.doc.length,nr.widget({widget:new eM(h),block:!0,side:1}));let m=n.finish(),g=s.finish();h5e(m,e.state.field(JT))||e.dispatch({effects:mL.of(m)}),h5e(g,t.state.field(JT))||t.dispatch({effects:mL.of(g)})}const pae=sn.define({map:(e,t)=>t.mapPos(e)});class bfn extends np{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:pae.of(s)});let{side:a,sibling:i}=t.state.facet(pm);i&&i().dispatch({effects:pae.of(vfn(s,t.state.field(Pk),a=="a"))})}),r}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function vfn(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 xfn=go.define({create(e){return nr.none},update(e,t){e=e.map(t.changes);for(let r of t.effects)r.is(pae)&&(e=e.update({filter:n=>n!=r.value}));return e},provide:e=>gt.decorations.from(e)});function m5e({margin:e=3,minSize:t=4}){return xfn.init(r=>wfn(r,e,t))}function wfn(e,t,r){let n=new Nu,s=e.facet(pm).side=="a",a=e.field(Pk),i=1;for(let o=0;;o++){let l=o<a.length?a[o]:null,c=o?i+t:1,d=l?e.doc.lineAt(s?l.fromA:l.fromB).number-1-t:e.doc.lines,p=d-c+1;if(p>=r&&n.add(e.doc.line(c).from,e.doc.line(d).to,nr.replace({widget:new bfn(p),block:!0})),!l)break;i=e.doc.lineAt(Math.min(e.doc.length,s?l.toA:l.toB)).number}return n.finish()}const Sfn=gt.styleModule.of(new Cy({".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"}})),Efn=gt.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"}}),g5e=new nO,rM=new nO;class _fn{constructor(t){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=t.diffConfig||ufn;let r=[Ch.low(jbt),Efn,Sfn,JT,gt.updateListener.of(p=>{this.measuring<0&&(p.heightChanged||p.viewportChanged)&&!p.transactions.some(f=>f.effects.some(h=>h.is(mL)))&&this.measure()})],n=[pm.of({side:"a",sibling:()=>this.b,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&n.push(J$);let s=Wn.create({doc:t.a.doc,selection:t.a.selection,extensions:[t.a.extensions||[],gt.editorAttributes.of({class:"cm-merge-a"}),rM.of(n),r]}),a=[pm.of({side:"b",sibling:()=>this.a,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&a.push(J$);let i=Wn.create({doc:t.b.doc,selection:t.b.selection,extensions:[t.b.extensions||[],gt.editorAttributes.of({class:"cm-merge-b"}),rM.of(a),r]});this.chunks=o_.build(s.doc,i.doc,this.diffConf);let o=[Pk.init(()=>this.chunks),g5e.of(t.collapseUnchanged?m5e(t.collapseUnchanged):[])];s=s.update({effects:sn.appendConfig.of(o)}).state,i=i.update({effects:sn.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",c=document.createElement("div");c.className="cm-mergeViewEditor";let d=document.createElement("div");d.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?c:d),this.editorDOM.appendChild(l=="a-b"?d:c),this.a=new gt({state:s,parent:c,root:t.root,dispatchTransactions:p=>this.dispatch(p,this.a)}),this.b=new gt({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),ko.empty(t[0].startState.doc.length));this.chunks=r==this.a?o_.updateA(this.chunks,n.newDoc,this.b.state.doc,s,this.diffConf):o_.updateB(this.chunks,this.a.state.doc,n.newDoc,s,this.diffConf),r.update([...t,n.state.update({effects:dae.of(this.chunks)})]);let a=r==this.a?this.b:this.a;a.update([a.state.update({effects:dae.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(pm),l=n?t.gutter!==!1:o.markGutter,c=r?t.highlightChanges!==!1:o.highlightChanges;a.push(rM.reconfigure([pm.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:l}),l?J$:[]])),i.push(rM.reconfigure([pm.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:l}),l?J$:[]]))}if(s){let o=g5e.reconfigure(t.collapseUnchanged?m5e(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(){yfn(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=y5e(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=y5e(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,c]=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&&c<=a.state.doc.length&&(d+=s.state.lineBreak),a.dispatch({changes:{from:l,to:Math.min(a.state.doc.length,c),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 y5e(e){let t=e.nextSibling;return e.remove(),t}function kfn(e,t){return t in e&&typeof e[t]=="function"}const bl=e=>{const t=["listWorkspaces","getWorkspace"],r=NFe.has("workspaces-v1"),n=t.every(s=>kfn(e,s));return r&&n},$bt=e=>{if(!(!e||typeof e!="object")){if("status"in e&&typeof e.status=="number")return e.status;if("statusCode"in e&&typeof e.statusCode=="number")return e.statusCode}},Ofn=(e,t)=>$bt(e)===t,Cfn=e=>{const t=$bt(e);return t!==void 0&&t>=400&&t<500},fae=e=>{if(Ofn(e,501))return!0;if(e&&typeof e=="object"&&"message"in e){const t=e.message;return t.includes("Workspace v1 not supported")||t.includes("501")}return!1},Zw=(e,t)=>Cfn(t)||fae(t)?!1:e<3;function Mbt(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=Mbt(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Lbt(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Mbt(e))&&(n&&(n+=" "),n+=t);return n}const Tfn=(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},Afn=(e,t)=>({classGroupId:e,validator:t}),Fbt=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),gL="-",b5e=[],Dfn="arbitrary..",Ifn=e=>{const t=Rfn(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Nfn(i);const o=i.split(gL),l=o[0]===""&&o.length>1?1:0;return Bbt(o,l,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const l=n[i],c=r[i];return l?c?Tfn(c,l):l:c||b5e}return r[i]||b5e}}},Bbt=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const c=Bbt(e,t+1,a);if(c)return c}const i=r.validators;if(i===null)return;const o=t===0?e.join(gL):e.slice(t).join(gL),l=i.length;for(let c=0;c<l;c++){const d=i[c];if(d.validator(o))return d.classGroupId}},Nfn=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?Dfn+n:void 0})(),Rfn=e=>{const{theme:t,classGroups:r}=e;return Pfn(r,t)},Pfn=(e,t)=>{const r=Fbt();for(const n in e){const s=e[n];zme(s,r,n,t)}return r},zme=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];jfn(i,t,r,n)}},jfn=(e,t,r,n)=>{if(typeof e=="string"){$fn(e,t,r);return}if(typeof e=="function"){Mfn(e,t,r,n);return}Lfn(e,t,r,n)},$fn=(e,t,r)=>{const n=e===""?t:zbt(t,e);n.classGroupId=r},Mfn=(e,t,r,n)=>{if(Ffn(e)){zme(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Afn(r,e))},Lfn=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[o,l]=s[i];zme(l,zbt(t,o),r,n)}},zbt=(e,t)=>{let r=e;const n=t.split(gL),s=n.length;for(let a=0;a<s;a++){const i=n[a];let o=r.nextPart.get(i);o||(o=Fbt(),r.nextPart.set(i,o)),r=o}return r},Ffn=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Bfn=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)}}},hae="!",v5e=":",zfn=[],x5e=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),Ufn=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,o=0,l=0,c;const d=s.length;for(let g=0;g<d;g++){const b=s[g];if(i===0&&o===0){if(b===v5e){a.push(s.slice(l,g)),l=g+1;continue}if(b==="/"){c=g;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(hae)?(f=p.slice(0,-1),h=!0):p.startsWith(hae)&&(f=p.slice(1),h=!0);const m=c&&c>l?c-l:void 0;return x5e(a,h,f,m)};if(t){const s=t+v5e,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):x5e(zfn,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},Vfn=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}},qfn=e=>({cache:Bfn(e.cacheSize),parseClassName:Ufn(e),sortModifiers:Vfn(e),...Ifn(e)}),Hfn=/\s+/,Zfn=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],o=e.trim().split(Hfn);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{isExternal:p,modifiers:f,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=r(d);if(p){l=d+(l.length>0?" "+l:l);continue}let b=!!g,v=n(b?m.substring(0,g):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 w=f.length===0?"":f.length===1?f[0]:a(f).join(":"),S=h?w+hae:w,_=S+v;if(i.indexOf(_)>-1)continue;i.push(_);const O=s(v,b);for(let C=0;C<O.length;++C){const T=O[C];i.push(S+T)}l=d+(l.length>0?" "+l:l)}return l},Gfn=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=Ubt(r))&&(s&&(s+=" "),s+=n);return s},Ubt=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ubt(e[n]))&&(r&&(r+=" "),r+=t);return r},w5e=(e,...t)=>{let r,n,s,a;const i=l=>{const c=t.reduce((d,p)=>p(d),e());return r=qfn(c),n=r.cache.get,s=r.cache.set,a=o,o(l)},o=l=>{const c=n(l);if(c)return c;const d=Zfn(l,r);return s(l,d),d};return a=i,(...l)=>a(Gfn(...l))},Qfn=[],Vo=e=>{const t=r=>r[e]||Qfn;return t.isThemeGetter=!0,t},Vbt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qbt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Wfn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Xfn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Yfn=/\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$/,Kfn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Jfn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ehn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qb=e=>Wfn.test(e),Gn=e=>!!e&&!Number.isNaN(Number(e)),Hb=e=>!!e&&Number.isInteger(Number(e)),VJ=e=>e.endsWith("%")&&Gn(e.slice(0,-1)),Hg=e=>Xfn.test(e),Hbt=()=>!0,thn=e=>Yfn.test(e)&&!Kfn.test(e),Ume=()=>!1,rhn=e=>Jfn.test(e),nhn=e=>ehn.test(e),shn=e=>!br(e)&&!Sr(e),ahn=e=>zx(e,Qbt,Ume),br=e=>Vbt.test(e),w0=e=>zx(e,Wbt,thn),S5e=e=>zx(e,fhn,Gn),ihn=e=>zx(e,Ybt,Hbt),ohn=e=>zx(e,Xbt,Ume),E5e=e=>zx(e,Zbt,Ume),lhn=e=>zx(e,Gbt,nhn),nM=e=>zx(e,Kbt,rhn),Sr=e=>qbt.test(e),gT=e=>Gw(e,Wbt),chn=e=>Gw(e,Xbt),_5e=e=>Gw(e,Zbt),uhn=e=>Gw(e,Qbt),dhn=e=>Gw(e,Gbt),sM=e=>Gw(e,Kbt,!0),phn=e=>Gw(e,Ybt,!0),zx=(e,t,r)=>{const n=Vbt.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Gw=(e,t,r=!1)=>{const n=qbt.exec(e);return n?n[1]?t(n[1]):r:!1},Zbt=e=>e==="position"||e==="percentage",Gbt=e=>e==="image"||e==="url",Qbt=e=>e==="length"||e==="size"||e==="bg-size",Wbt=e=>e==="length",fhn=e=>e==="number",Xbt=e=>e==="family-name",Ybt=e=>e==="number"||e==="weight",Kbt=e=>e==="shadow",k5e=()=>{const e=Vo("color"),t=Vo("font"),r=Vo("text"),n=Vo("font-weight"),s=Vo("tracking"),a=Vo("leading"),i=Vo("breakpoint"),o=Vo("container"),l=Vo("spacing"),c=Vo("radius"),d=Vo("shadow"),p=Vo("inset-shadow"),f=Vo("text-shadow"),h=Vo("drop-shadow"),m=Vo("blur"),g=Vo("perspective"),b=Vo("aspect"),v=Vo("ease"),w=Vo("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[..._(),Sr,br],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],A=()=>[Sr,br,l],I=()=>[qb,"full","auto",...A()],R=()=>[Hb,"none","subgrid",Sr,br],P=()=>["auto",{span:["full",Hb,Sr,br]},Hb,Sr,br],L=()=>[Hb,"auto",Sr,br],B=()=>["auto","min","max","fr",Sr,br],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...A()],q=()=>[qb,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],V=()=>[qb,"screen","full","dvw","lvw","svw","min","max","fit",...A()],Q=()=>[qb,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],$=()=>[e,Sr,br],X=()=>[..._(),_5e,E5e,{position:[Sr,br]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",uhn,ahn,{size:[Sr,br]}],Z=()=>[VJ,gT,w0],G=()=>["","none","full",c,Sr,br],K=()=>["",Gn,gT,w0],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=()=>[Gn,VJ,_5e,E5e],ue=()=>["","none",m,Sr,br],xe=()=>["none",Gn,Sr,br],W=()=>["none",Gn,Sr,br],ae=()=>[Gn,Sr,br],ne=()=>[qb,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hg],breakpoint:[Hg],color:[Hbt],container:[Hg],"drop-shadow":[Hg],ease:["in","out","in-out"],font:[shn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hg],shadow:[Hg],spacing:["px",Gn],text:[Hg],"text-shadow":[Hg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qb,br,Sr,b]}],container:["container"],columns:[{columns:[Gn,br,Sr,o]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:O()}],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:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Hb,"auto",Sr,br]}],basis:[{basis:[qb,"full","auto",o,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Gn,qb,"auto","initial","none",br]}],grow:[{grow:["",Gn,Sr,br]}],shrink:[{shrink:["",Gn,Sr,br]}],order:[{order:[Hb,"first","last","none",Sr,br]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:P()}],"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":B()}],"auto-rows":[{"auto-rows":B()}],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:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":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",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],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,gT,w0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,phn,ihn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",VJ,br]}],"font-family":[{font:[chn,ohn,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,Sr,br]}],"line-clamp":[{"line-clamp":[Gn,"none",Sr,S5e]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",Sr,br]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Sr,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:[Gn,"from-font","auto",Sr,w0]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Gn,"auto",Sr,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",Sr,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",Sr,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:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hb,Sr,br],radial:["",Sr,br],conic:[Hb,Sr,br]},dhn,lhn]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"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:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-bs":[{"border-bs":K()}],"border-w-be":[{"border-be":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"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":[Gn,Sr,br]}],"outline-w":[{outline:["",Gn,gT,w0]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",d,sM,nM]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",p,sM,nM]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Gn,w0]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",f,sM,nM]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Gn,Sr,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":[Gn]}],"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":[Sr,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":_()}],"mask-image-conic-pos":[{"mask-conic":[Gn]}],"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:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Sr,br]}],filter:[{filter:["","none",Sr,br]}],blur:[{blur:ue()}],brightness:[{brightness:[Gn,Sr,br]}],contrast:[{contrast:[Gn,Sr,br]}],"drop-shadow":[{"drop-shadow":["","none",h,sM,nM]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Gn,Sr,br]}],"hue-rotate":[{"hue-rotate":[Gn,Sr,br]}],invert:[{invert:["",Gn,Sr,br]}],saturate:[{saturate:[Gn,Sr,br]}],sepia:[{sepia:["",Gn,Sr,br]}],"backdrop-filter":[{"backdrop-filter":["","none",Sr,br]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Gn,Sr,br]}],"backdrop-contrast":[{"backdrop-contrast":[Gn,Sr,br]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Gn,Sr,br]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Gn,Sr,br]}],"backdrop-invert":[{"backdrop-invert":["",Gn,Sr,br]}],"backdrop-opacity":[{"backdrop-opacity":[Gn,Sr,br]}],"backdrop-saturate":[{"backdrop-saturate":[Gn,Sr,br]}],"backdrop-sepia":[{"backdrop-sepia":["",Gn,Sr,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",Sr,br]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Gn,"initial",Sr,br]}],ease:[{ease:["linear","initial",v,Sr,br]}],delay:[{delay:[Gn,Sr,br]}],animate:[{animate:["none",w,Sr,br]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Sr,br]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[Sr,br,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"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",Sr,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",Sr,br]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Gn,gT,w0,S5e]}],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"]}},hhn=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(eA(e,"cacheSize",t),eA(e,"prefix",r),eA(e,"experimentalParseClassName",n),aM(e.theme,a.theme),aM(e.classGroups,a.classGroups),aM(e.conflictingClassGroups,a.conflictingClassGroups),aM(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),eA(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),iM(e.theme,s.theme),iM(e.classGroups,s.classGroups),iM(e.conflictingClassGroups,s.conflictingClassGroups),iM(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Jbt(e,s,"orderSensitiveModifiers"),e),eA=(e,t,r)=>{r!==void 0&&(e[t]=r)},aM=(e,t)=>{if(t)for(const r in t)eA(e,r,t[r])},iM=(e,t)=>{if(t)for(const r in t)Jbt(e,t,r)},Jbt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},mhn=(e,...t)=>typeof e=="function"?w5e(k5e,e,...t):w5e(()=>hhn(k5e(),e),...t),ghn=Object.keys({...rZe,...MLt}),yhn=Object.keys(VLt),bhn=Object.keys(LLt),vhn=Object.keys(FLt),xhn=Object.keys($Lt),S0=Object.keys(ULt),whn=Object.keys(BLt).concat(Object.keys(zLt)),Shn=mhn({extend:{theme:{color:ghn,spacing:yhn,radius:xhn,leading:vhn,shadow:whn},classGroups:{"font-size":[{text:bhn}],h:[{h:S0}],w:[{w:S0}],size:[{size:S0}],"min-h":[{"min-h":S0}],"min-w":[{"min-w":S0}],"max-h":[{"max-h":S0}],"max-w":[{"max-w":S0}]}}});function J(...e){return Shn(Lbt(e))}const fi={sm:"h-form-sm",md:"h-form-md",lg:"h-form-lg",default:"h-form-default"},$h="focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",Ehn="focus-within:outline-none focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",PP="rounded-md",_hn={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"},Ce=({children:e,className:t,size:r="default",...n})=>u.jsx("span",{className:J("block",_hn[r],t),...n,children:e}),gc=iFt,Yn=oFt,Kn=lFt,Vn=E.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>u.jsx(cFt,{children:u.jsxs(fZe,{ref:s,sideOffset:t,className:J("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,u.jsx(uFt,{className:"fill-surface6"})]})}));Vn.displayName=fZe.displayName;const khn={sm:`${fi.sm} w-form-sm`,md:`${fi.md} w-form-md`,lg:`${fi.lg} w-form-lg`,default:`${fi.default}`},Ohn={sm:"sm",md:"default",lg:"lg",default:"default"},Chn={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"},Thn="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",Zi=Ee.forwardRef(({className:e,children:t,tooltip:r,size:n="md",variant:s="default",disabled:a,...i},o)=>u.jsxs(Yn,{children:[u.jsx(Kn,{asChild:!0,children:u.jsx("button",{ref:o,disabled:a,"aria-label":typeof r=="string"?r:void 0,className:J(Thn,$h,Chn[s],khn[n],a&&"active:scale-100",e),...i,children:u.jsx(Ce,{size:Ohn[n],children:t})})}),u.jsx(Vn,{children:r})]}));Zi.displayName="IconButton";const Ahn={"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"},Dhn={mono:"font-mono"},We=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>u.jsx(e,{className:J(Ahn[r],n&&Dhn[n],t),...s}),Jr={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"},Qw={visible:"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},Ihn={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},Nhn=({src:e,name:t,size:r="sm",interactive:n=!1})=>u.jsx("div",{className:J(Ihn[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",Jr.all,n&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?u.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):u.jsx(We,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),V8=({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)})}}},Rhn=EXt({style:Oce.coldarkDark,customStyle:{margin:0,backgroundColor:"black"}}),Phn=()=>u.jsx(z7t,{remarkPlugins:[kGe],className:"aui-md",components:Mhn}),O5e=E.memo(Phn),jhn=({language:e,code:t})=>{const{isCopied:r,copyToClipboard:n}=V8(),s=()=>{!t||r||n(t)};return u.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:[u.jsx("span",{className:"lowercase [&>span]:text-xs",children:e}),u.jsx(Zi,{variant:"light",size:"md",tooltip:"Copy",onClick:s,children:u.jsxs("span",{className:"grid",children:[u.jsx("span",{style:{gridArea:"1/1"},className:J("transition-transform",r?"scale-100":"scale-0"),children:u.jsx(ni,{size:14})},"checkmark"),u.jsx("span",{style:{gridArea:"1/1"},className:J("transition-transform",r?"scale-0":"scale-100"),children:u.jsx(cc,{size:14})},"copy")]})})]})},$hn=({alt:e,src:t,...r})=>{const[n,s]=E.useState(!1);return E.useEffect(()=>{s(!1)},[t]),n||!t?u.jsxs("div",{children:[u.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:u.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"})}),u.jsx("p",{className:"text-xs italic text-neutral3 -mt-2.5 mb-2.5",children:"Image link is broken"})]}):u.jsx("img",{src:t,alt:e,...r,onError:()=>{s(!0)}})},Mhn=k7t({h1:({className:e,...t})=>u.jsx("h1",{className:J("mb-8 scroll-m-20 text-4xl font-extrabold tracking-tight last:mb-0",e),...t,style:{marginBottom:"2rem"}}),h2:({className:e,...t})=>u.jsx("h2",{className:J("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})=>u.jsx("h3",{className:J("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})=>u.jsx("h4",{className:J("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})=>u.jsx("h5",{className:J("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),h6:({className:e,...t})=>u.jsx("h6",{className:J("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),p:({className:e,...t})=>u.jsx("p",{className:J("leading-7 first:mt-0 last:mb-0",e),...t}),a:({className:e,...t})=>u.jsx("a",{className:J("text-neutral6 font-medium underline underline-offset-4",e),...t}),blockquote:({className:e,...t})=>u.jsx("blockquote",{className:J("border-l-2 pl-6 italic",e),...t}),ul:({className:e,...t})=>u.jsx("ul",{className:J("my-5 ml-6 list-disc [&>li]:mt-2",e),...t}),ol:({className:e,...t})=>u.jsx("ol",{className:J("my-5 ml-6 list-decimal [&>li]:mt-2",e),...t}),hr:({className:e,...t})=>u.jsx("hr",{className:J("my-5 border-b",e),...t}),table:({className:e,...t})=>u.jsx("table",{className:J("my-5 w-full border-separate border-spacing-0 overflow-y-auto",e),...t}),th:({className:e,...t})=>u.jsx("th",{className:J("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})=>u.jsx("td",{className:J("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})=>u.jsx("tr",{className:J("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})=>u.jsx("sup",{className:J("[&>a]:text-xs [&>a]:no-underline",e),...t}),pre:({className:e,...t})=>u.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:J("overflow-x-auto p-4 text-white",e)}),code:function({className:t,...r}){const n=JZe();return u.jsxs("pre",{style:{fontSize:"0.875rem",display:"inline"},children:[u.jsx("code",{className:J(!n&&"bg-surface4 rounded border font-semibold",t),...r,style:{fontWeight:"400",paddingBlock:n?0:"0.1em",paddingInline:n?0:"0.3em"}})," "]})},CodeHeader:jhn,SyntaxHighlighter:Rhn,img:$hn}),Lhn=({reason:e,tripwire:t})=>{const[r,n]=E.useState(!1),s=t&&(t.retry!==void 0||t.tripwirePayload||t.processorId);return u.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-950/20 overflow-hidden",children:[u.jsxs("div",{className:"flex items-start gap-3 p-4",children:[u.jsx(NR,{className:"w-5 h-5 text-amber-400 mt-0.5 flex-shrink-0"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-amber-200 mb-1",children:"Content Blocked"}),u.jsx("p",{className:"text-sm text-amber-300/90",children:e})]})]}),s&&u.jsxs(u.Fragment,{children:[u.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?u.jsx(Ua,{className:"w-3.5 h-3.5"}):u.jsx(co,{className:"w-3.5 h-3.5"}),u.jsx("span",{children:"Details"})]}),r&&u.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&&u.jsxs("div",{className:"flex items-center gap-2 pt-3",children:[u.jsx(IR,{className:"w-3.5 h-3.5 text-amber-400/60"}),u.jsxs("span",{className:"text-xs text-amber-300/70",children:["Retry:"," ",t.retry?u.jsx("span",{className:"text-green-400",children:"Allowed"}):u.jsx("span",{className:"text-red-400",children:"Not allowed"})]})]}),t.processorId&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ece,{className:"w-3.5 h-3.5 text-amber-400/60"}),u.jsxs("span",{className:"text-xs text-amber-300/70",children:["Processor:"," ",u.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&&u.jsxs("div",{className:"pt-1",children:[u.jsx("p",{className:"text-xs text-amber-400/60 mb-1.5",children:"Metadata:"}),u.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))})]})]})]})]})},Ji=e=>u.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"})]}),evt=e=>u.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"}),u.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"}),u.jsxs("g",{clipPath:"url(#clip0_21421_19519)",children:[u.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"}),u.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"})]}),u.jsx("defs",{children:u.jsx("clipPath",{id:"clip0_21421_19519",children:u.jsx("rect",{width:"62.7591",height:"62.7591",fill:"white",transform:"matrix(0.897148 0.441731 -0.897148 0.441731 63.1714 7.24365)"})})})]}),Fhn=e=>u.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"})]}),Vme=e=>u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"})]}),qme=e=>u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"})]}),Io=e=>u.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),Hme=e=>u.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:u.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"})}),u.jsx("defs",{children:u.jsx("clipPath",{id:"clip0_21999_22095",children:u.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),tvt=e=>u.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[u.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"}),u.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"}),u.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"}),u.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"})]}),u.jsx("defs",{children:u.jsx("clipPath",{id:"clip0_21999_20513",children:u.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),Bhn=e=>u.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"}),u.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),u.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),u.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),rvt=e=>u.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),zhn=e=>u.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),Zme=e=>u.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),Uhn=e=>u.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),vl=e=>u.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),AO=e=>u.jsx(ILt,{...e}),dc=e=>u.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),Vhn=e=>u.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"}),u.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"}),u.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"})]}),_h=e=>u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"})]}),qhn=e=>u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),Hhn=e=>u.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"}),u.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"}),u.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"}),u.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"})]}),Zhn=e=>u.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"}),u.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"}),u.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 jk(e){return u.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:[u.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),u.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),u.jsx("path",{d:"M15 2v2"}),u.jsx("path",{d:"M15 20v2"}),u.jsx("path",{d:"M2 15h2"}),u.jsx("path",{d:"M2 9h2"}),u.jsx("path",{d:"M20 15h2"}),u.jsx("path",{d:"M20 9h2"}),u.jsx("path",{d:"M9 2v2"}),u.jsx("path",{d:"M9 20v2"})]})}const Ghn={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},Qhn={warning:Iu,destructive:Am,info:Vc},uh=({children:e,variant:t="destructive",className:r})=>{const n=Qhn[t];return u.jsx("div",{className:J(Ghn[t],"p-3 rounded-md border shadow-sm",Jr.all,"animate-in fade-in-0 slide-in-from-top-2 duration-200",r),children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(Ce,{className:"mt-0.5 flex-shrink-0",children:u.jsx(n,{})}),u.jsx("div",{className:"text-neutral4",children:e})]})})},dh=({children:e,as:t="h5"})=>u.jsx(We,{as:t,variant:"ui-md",className:"font-semibold",children:e}),vx=({children:e,as:t="p"})=>u.jsx(We,{as:t,variant:"ui-sm",children:e}),Whn={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"},Xhn={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},Gt=({icon:e,variant:t="default",className:r,children:n,...s})=>u.jsxs("div",{className:J("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",Jr.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":Whn[t],r),...s,children:[e&&u.jsx("span",{className:Xhn[t],children:u.jsx(Ce,{children:e})}),n]}),Yhn=()=>{const e=jn(({part:a})=>a),[t,r]=E.useState(!1),n=e.text||"",s=e.metadata||{};if(s?.status==="tripwire")return u.jsx(Lhn,{reason:n,tripwire:s.tripwire});if(s?.status==="warning")return u.jsxs(uh,{variant:"warning",children:[u.jsx(dh,{as:"h5",children:"Warning"}),u.jsx(vx,{as:"p",children:n})]});if(s?.status==="error")return u.jsxs(uh,{variant:"destructive",children:[u.jsx(dh,{as:"h5",children:"Error"}),u.jsx(vx,{as:"p",children:n})]});if(s?.mode==="network"&&s?.completionResult)return u.jsxs("div",{className:"mb-2 space-y-2",children:[u.jsxs("button",{onClick:()=>r(a=>!a),className:"flex items-center gap-2",children:[u.jsx(Ce,{children:u.jsx(fw,{className:J("transition-all",t?"rotate-90":"rotate-180")})}),u.jsxs(Gt,{variant:"info",icon:u.jsx(MHe,{}),children:[t?"Show":"Hide"," completion check"]})]}),!t&&u.jsxs(uh,{variant:"info",children:[u.jsx(dh,{as:"h5",children:s.completionResult?.passed?"Complete":"Not Complete"}),u.jsx(O5e,{})]})]});try{const a=n.trim();if(a.startsWith("__ERROR__:")){const i=a.substring(10);return u.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:[u.jsx(Am,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),u.jsxs("div",{className:"flex-1",children:[u.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),u.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:i})]})]})}else if(a.startsWith("Error:")){const i=a.substring(6).trim();return u.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:[u.jsx(Am,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),u.jsxs("div",{className:"flex-1",children:[u.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),u.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:i})]})]})}return u.jsx(O5e,{})}catch{return u.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:[u.jsx(Am,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),u.jsxs("div",{className:"flex-1",children:[u.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),u.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:String(n)})]})]})}},Ff="mastra_workspace",yL={FILESYSTEM:{READ_FILE:`${Ff}_read_file`,WRITE_FILE:`${Ff}_write_file`,EDIT_FILE:`${Ff}_edit_file`,LIST_FILES:`${Ff}_list_files`,DELETE:`${Ff}_delete`,FILE_STAT:`${Ff}_file_stat`,MKDIR:`${Ff}_mkdir`},SANDBOX:{EXECUTE_COMMAND:`${Ff}_execute_command`},SEARCH:{SEARCH:`${Ff}_search`,INDEX:`${Ff}_index`}},Khn={duration:5e3,cancel:{label:u.jsx(Ce,{children:u.jsx(Oa,{})}),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 $d(e){const{classNames:t,...r}=Khn,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:J(t?.title,n?.title),toast:J(t?.toast,n?.toast),cancelButton:J(t?.cancelButton,n?.cancelButton),actionButton:J(t?.actionButton,n?.actionButton),description:J(t?.description,n?.description)},...s}}const Je=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>ic(r,$d(t)));if(Ee.isValidElement(e))return ic(e,$d(t));if(typeof e=="string")return ic(e,$d(t));throw new Error("Invalid message type")};Je.success=(e,t={})=>{const r={...t,icon:u.jsx(Ce,{className:"text-accent1 shrink-0",children:u.jsx(LHe,{})}),classNames:{...t.classNames,toast:J("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:J("text-xs text-neutral5",t.classNames?.title),description:J("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return ic.success(e,$d(r));case"object":return e.forEach(n=>ic.success(n,$d(r)))}};Je.error=(e,t={})=>{const r={...t,icon:u.jsx(Ce,{className:"text-accent2 shrink-0",children:u.jsx(_D,{})}),classNames:{...t.classNames,toast:J("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:J("text-xs text-neutral5",t.classNames?.title),description:J("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return ic.error(e,$d(r));case"object":return e.forEach(n=>ic.error(n,$d(r)))}};Je.warning=(e,t={})=>{const r={...t,icon:u.jsx(Ce,{className:"text-accent6 shrink-0",children:u.jsx(Am,{})}),classNames:{...t.classNames,toast:J("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:J("text-xs text-neutral5",t.classNames?.title),description:J("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return ic.warning(e,$d(r));case"object":return e.forEach(n=>ic.warning(n,$d(r)))}};Je.info=(e,t={})=>{const r={...t,icon:u.jsx(Ce,{className:"text-accent3 shrink-0",children:u.jsx(Vc,{})}),classNames:{...t.classNames,toast:J("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:J("text-xs text-neutral5",t.classNames?.title),description:J("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return ic.info(e,$d(r));case"object":return e.forEach(n=>ic.info(n,$d(r)))}};Je.custom=(e,t={})=>ic(e,$d(t));Je.dismiss=e=>{e&&ic.dismiss(e)};Je.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>ic.promise(e,{loading:t??"Loading...",success:o=>(s?.(o),r),error:o=>(a?.(o),n||o?.message||"Error..."),...$d(i)});function kh({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(()=>{Je.success(t),n(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{n(!1)},2e3)}).catch(()=>{Je.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:r,handleCopy:a}}const nvt={sm:`${fi.sm} gap-1 text-ui-sm`,md:`${fi.md} gap-1`,lg:`${fi.lg} gap-2`,default:`${fi.default} text-ui-md`,large:`${fi.lg} text-ui-lg`},svt={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"},avt="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]",Jhn=J("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"),emn="focus-visible:outline-none focus-visible:border-accent1/50";function Gme(e){const t=e?.variant||"default",r=e?.size||"md";return J(avt,$h,svt[t],nvt[r])}const Se=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 u.jsx(o,{ref:i,disabled:s,className:J(l?Jhn:avt,l?emn:$h,svt[n],nvt[r],s&&"active:scale-100",e),...a})});Se.displayName="Button";const jP=Ee.forwardRef(({tooltipContent:e,...t},r)=>u.jsxs(Yn,{children:[u.jsx(Kn,{asChild:!0,children:u.jsx(Se,{ref:r,...t})}),e&&u.jsx(Vn,{children:e})]}));jP.displayName="ButtonWithTooltip";function oc({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}=kh({text:e,copyMessage:t}),c=()=>{l(),o(!0),setTimeout(()=>o(!1),2e3)};return u.jsxs(Yn,{children:[u.jsx(Kn,{asChild:!0,children:u.jsx(Se,{onClick:c,type:"button",size:a,variant:"standard",children:i?u.jsx(ni,{}):u.jsx(cc,{})})}),u.jsx(Vn,{children:i?"Copied!":r})]})}const tmn=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,rmn=nr.mark({class:"cm-variable-highlight"}),C5e=new xWe({regexp:tmn,decoration:()=>rmn}),nmn=Ci.fromClass(class{decorations;constructor(e){this.decorations=C5e.createDeco(e)}update(e){this.decorations=C5e.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),smn=nmn;function amn(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,c]of Object.entries(s.properties))n(c,`${a}.${l}`,i+1);if(s.items?.properties)for(const[l,c]of Object.entries(s.items.properties))n(c,`${a}[].${l}`,i+1)}for(const[s,a]of Object.entries(e.properties))n(a,s,1);return r}function imn(e){const t=amn(e);return aXe({override:[omn(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function omn(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:(c,d,p,f)=>{const g=c.state.sliceDoc(f,f+2)==="}}"?d.label:`${d.label}}}`;c.dispatch({changes:{from:p,to:f,insert:g},selection:{anchor:p+g.length}})}}));return{from:a,options:o,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const Ux=()=>E.useMemo(()=>{const e=H6({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=gt.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]},[]),mi=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:c,autoFocus:d,...p},f)=>{const h=Ux(),m=e?JSON.stringify(e,null,2):t??"",g=E.useMemo(()=>{const b=[];return a==="json"?b.push(Nd):a==="markdown"&&(b.push(Mue({base:D1,codeLanguages:CYe})),b.push(gt.lineWrapping)),i&&a==="markdown"&&b.push(smn),c&&a==="markdown"&&b.push(imn(c)),b},[a,i,c]);return u.jsxs("div",{className:J("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...p,children:[n&&u.jsx(oc,{content:m,className:"absolute top-2 right-2 z-20"}),u.jsx(Ld,{ref:f,value:m,theme:h,extensions:g,onChange:r,"aria-label":"Code editor",placeholder:o,height:"100%",style:{height:"100%"},autoFocus:d})]})});async function lmn(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ze(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-PU4ugcf9.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([29,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 q8=({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]),u.jsxs("div",{className:"mb-4","data-testid":i,children:[u.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between",children:[u.jsxs("button",{onClick:s?()=>l(c=>!c):void 0,className:"flex items-center gap-2 disabled:cursor-not-allowed",disabled:!s,type:"button",children:[u.jsx(Ce,{children:u.jsx(fw,{className:J("transition-all",o?"rotate-90":"rotate-180")})}),u.jsx(Gt,{icon:r,children:n})]}),a]}),!o&&u.jsx("div",{className:"pt-2",children:u.jsx("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:e})})]})},wa=Y6,ivt=MKe,cmn=K6,ovt=E.forwardRef(({className:e,...t},r)=>u.jsx(ZR,{ref:r,className:J("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}));ovt.displayName=ZR.displayName;const sa=E.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(cmn,{children:[u.jsx(ovt,{}),u.jsxs(GR,{ref:n,className:J("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,u.jsxs(t9,{className:J("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:[u.jsx(Oa,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));sa.displayName=GR.displayName;const Sa=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});Sa.displayName="DialogHeader";const H8=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});H8.displayName="DialogFooter";const Ea=({className:e,...t})=>u.jsx("div",{className:J("overflow-y-auto px-6 max-h-[50vh]",e),...t});Ea.displayName="DialogBody";const aa=E.forwardRef(({className:e,...t},r)=>u.jsx(J6,{ref:r,className:J("text-ui-md font-medium",e),...t}));aa.displayName=J6.displayName;const Ei=E.forwardRef(({className:e,...t},r)=>u.jsx(e9,{ref:r,className:J("sr-only",e),...t}));Ei.displayName=e9.displayName;const umn=({selectionReason:e,open:t,onOpenChange:r,input:n})=>{let s=null;if(n)try{s=typeof n=="object"?u.jsx(mi,{data:n}):u.jsx(mi,{data:JSON.parse(n)})}catch{s=u.jsx("pre",{className:"whitespace-pre-wrap",children:n})}return u.jsx(wa,{open:t,onOpenChange:r,children:u.jsxs(sa,{children:[u.jsxs(Sa,{children:[u.jsx(aa,{children:"Agent Network Metadata"}),u.jsx(Ei,{children:"View the metadata of the agent's network choice."})]}),u.jsxs(Ea,{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(We,{className:"text-neutral3",children:"Selection Reason"}),u.jsx("div",{className:"text-neutral6 text-ui-md",children:e})]}),s&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(We,{className:"text-neutral3",children:"Input"}),u.jsx("div",{className:"text-neutral6 text-ui-md",children:s})]})]})]})})},Qme=({selectionReason:e,input:t})=>{const[r,n]=E.useState(!1);return u.jsxs(u.Fragment,{children:[u.jsx(Zi,{variant:"light",size:"md",tooltip:"Show selection reason",onClick:()=>n(s=>!s),children:u.jsx(uLt,{className:"text-neutral3 size-5"})}),u.jsx(umn,{selectionReason:e||"",open:r,onOpenChange:n,input:t})]})},lvt=E.createContext(void 0);function dmn({children:e,approveToolcall:t,declineToolcall:r,approveToolcallGenerate:n,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:l,networkToolCallApprovals:c}){return u.jsx(lvt.Provider,{value:{approveToolcall:t,declineToolcall:r,approveToolcallGenerate:n,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:l,networkToolCallApprovals:c},children:e})}function pmn(){const e=E.useContext(lvt);if(!e)throw new Error("useToolCall must be used within a ToolCallProvider");return e}const $P=({toolCalled:e,toolCallId:t,toolApprovalMetadata:r,toolName:n,isNetwork:s,isGenerateMode:a})=>{const{approveToolcall:i,declineToolcall:o,approveToolcallGenerate:l,declineToolcallGenerate:c,isRunning:d,toolCallApprovals:p,approveNetworkToolcall:f,declineNetworkToolcall:h,networkToolCallApprovals:m}=pmn(),g=()=>{s?f(n,r?.runId):a?l(t):i(t)},b=()=>{s?h(n,r?.runId):a?c(t):o(t)},v=s?m?.[r?.runId?`${r.runId}-${n}`:n]?.status:p?.[t]?.status;return r&&!e?u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Approval required"}),u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsxs(Se,{onClick:g,disabled:d||!!v,className:v==="approved"?"!text-accent1":"",children:[u.jsx(Ce,{children:u.jsx(ni,{})}),"Approve"]}),u.jsxs(Se,{onClick:b,disabled:d||!!v,className:v==="declined"?"!text-accent2":"",children:[u.jsx(Ce,{children:u.jsx(Oa,{})}),"Decline"]})]})]}):null},fmn=({toolName:e,args:t,result:r,metadata:n,toolOutput:s,toolCallId:a,toolApprovalMetadata:i,suspendPayload:o,isNetwork:l,toolCalled:c})=>{let d=null;try{const{__mastraMetadata:b,...v}=typeof t=="object"?t:JSON.parse(t);d=u.jsx(mi,{data:v,"data-testid":"tool-args"})}catch{d=u.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:t})}let p=typeof r=="string"?u.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:r}):u.jsx(mi,{data:r,"data-testid":"tool-result"}),f=typeof o=="string"?u.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:o}):u.jsx(mi,{data:o,"data-testid":"tool-suspend-payload"});const h=n?.mode==="network"?n.selectionReason:void 0,m=n?.mode==="network"?n.agentInput:void 0,g=c??(r||s.length>0);return u.jsx(q8,{"data-testid":"tool-badge",icon:u.jsx(vl,{className:"text-accent6"}),title:e,extraInfo:n?.mode==="network"&&u.jsx(Qme,{selectionReason:h||"",input:m}),initialCollapsed:!(i??o),children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Tool arguments"}),d]}),f!==void 0&&o&&u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Tool suspend payload"}),f]}),p!==void 0&&r&&u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Tool result"}),p]}),s.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Tool output"}),u.jsx("div",{className:"h-40 overflow-y-auto",children:u.jsx(mi,{data:s,"data-testid":"tool-output"})})]}),u.jsx($P,{toolCalled:g,toolCallId:a,toolApprovalMetadata:i,toolName:e,isNetwork:l,isGenerateMode:n?.mode==="generate"})]})})},cvt=E.createContext({Link:E.forwardRef(()=>null),navigate:()=>{},paths:{agentLink:()=>"",agentsLink:()=>"",agentToolLink:()=>"",agentSkillLink:()=>"",agentThreadLink:()=>"",agentNewThreadLink:()=>"",workflowsLink:()=>"",workflowLink:()=>"",networkLink:()=>"",networkNewThreadLink:()=>"",networkThreadLink:()=>"",scorerLink:()=>"",cmsScorersCreateLink:()=>"",cmsScorerEditLink:()=>"",cmsAgentCreateLink:()=>"",cmsAgentEditLink:()=>"",toolLink:()=>"",skillLink:()=>"",workspacesLink:()=>"",workspaceLink:()=>"",workspaceSkillLink:()=>"",processorsLink:()=>"",processorLink:()=>"",mcpServerLink:()=>"",mcpServerToolLink:()=>"",workflowRunLink:()=>"",datasetLink:()=>"",datasetItemLink:()=>"",datasetExperimentLink:()=>""}}),hmn=({children:e,Link:t,navigate:r,paths:n})=>u.jsx(cvt.Provider,{value:{Link:t,navigate:r,paths:n},children:e}),ur=()=>{const e=E.useContext(cvt);if(!e)throw new Error("useLinkComponent must be used within a LinkComponentProvider");return e},mmn=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"}},gmn=(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},ymn=({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]),u.jsxs("div",{className:"rounded-md border border-border1 overflow-hidden",children:[e&&u.jsxs("div",{className:"px-3 py-2 bg-surface3 border-b border-border1 flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx("span",{className:"text-neutral6 text-xs shrink-0",children:"$"}),u.jsx("code",{className:"text-xs text-neutral-300 font-mono truncate",children:e})]}),n&&u.jsx(Zi,{variant:"light",size:"sm",tooltip:"Copy output",onClick:n,className:"shrink-0",children:u.jsxs("span",{className:"grid",children:[u.jsx("span",{style:{gridArea:"1/1"},className:J("transition-transform",s?"scale-100":"scale-0"),children:u.jsx(ni,{size:14})}),u.jsx("span",{style:{gridArea:"1/1"},className:J("transition-transform",s?"scale-0":"scale-100"),children:u.jsx(cc,{size:14})})]})})]}),u.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||u.jsx("span",{className:"text-neutral6 italic",children:"No output"})})]})},bmn=({toolName:e,args:t,result:r,metadata:n,toolCallId:s,toolApprovalMetadata:a,isNetwork:i,toolCalled:o})=>{const l=jn(q=>q.message),c=E.useMemo(()=>l.content.filter(V=>V.type==="data"),[l.content]),[d,p]=E.useState(!1),{isCopied:f,copyToClipboard:h}=V8(),{Link:m}=ur();let g="";try{const q=typeof t=="object"?t:JSON.parse(t);if(e===yL.SANDBOX.EXECUTE_COMMAND){const V=q.command||"",Q=q.args?.join(" ")||"";g=`${V} ${Q}`.trim()}}catch{g=e}const b=c.filter(q=>(q.name==="sandbox-stdout"||q.name==="sandbox-stderr")&&q.data?.toolCallId===s),v=c.find(q=>q.name==="workspace-metadata"&&q.data?.toolCallId===s),w=v?.data,S=c.find(q=>q.name==="sandbox-exit"&&q.data?.toolCallId===s),_=!!S||typeof r=="string",O=!!v,C=O&&!_,T=o??(_||O),A=S?.data?.exitCode,I=S?.data?.success,R=S?.data?.executionTimeMs,P=b.map(q=>q.data?.output||"").join(""),L=typeof r=="string"?r:P,B=e===yL.SANDBOX.EXECUTE_COMMAND?"Execute Command":e,M=b[0]?.data?.timestamp,z=gmn(C,M),H=()=>{!L||f||h(L)};return u.jsxs("div",{className:"mb-4","data-testid":"sandbox-execution-badge",children:[u.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[u.jsxs("button",{onClick:()=>p(q=>!q),className:"flex items-center gap-2 min-w-0",type:"button",children:[u.jsx(Ce,{children:u.jsx(fw,{className:J("transition-all",d?"rotate-90":"rotate-180")})}),u.jsx(Gt,{icon:u.jsx(mLt,{className:"text-accent6",size:16}),children:B}),w?.sandbox&&u.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:q=>q.stopPropagation(),children:[u.jsx("span",{className:J("w-1.5 h-1.5 rounded-full",mmn(w.sandbox.status))}),u.jsx("span",{children:w.sandbox.name||w.sandbox.provider})]})]}),u.jsx("div",{className:"flex items-center gap-2",children:C?u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-accent6",children:[u.jsx("span",{className:"w-1.5 h-1.5 bg-accent6 rounded-full animate-pulse"}),u.jsx("span",{className:"animate-pulse",children:"running"})]}),u.jsxs("span",{className:"text-neutral6 text-xs tabular-nums",children:[z,"ms"]})]}):u.jsxs(u.Fragment,{children:[A!==void 0&&(I?u.jsx(ni,{className:"text-green-400",size:14}):u.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-500/20 text-red-400",children:["exit ",A]})),R!==void 0&&u.jsxs("span",{className:"text-neutral6 text-xs",children:[R,"ms"]})]})})]}),!d&&u.jsxs("div",{className:"pt-2",children:[(L||g)&&u.jsx(ymn,{command:g,content:L,onCopy:L?H:void 0,isCopied:f}),u.jsx($P,{toolCalled:T,toolCallId:s,toolApprovalMetadata:a,toolName:e,isNetwork:i,isGenerateMode:n?.mode==="generate"})]})]})},vmn=({toolName:e,args:t,result:r,toolCallId:n,toolApprovalMetadata:s,isNetwork:a,toolCalled:i})=>{const[o,l]=E.useState(!s),{isCopied:c,copyToClipboard:d}=V8();E.useEffect(()=>{l(!s)},[s]);const{Link:p}=ur();let f={path:"/"};try{f=typeof t=="object"?t:JSON.parse(t)}catch{}const{path:h="/",maxDepth:m,showHidden:g,dirsOnly:b,exclude:v,extension:w}=f,S=[];m!==void 0&&m!==3&&S.push(`depth: ${m}`),g&&S.push("hidden"),b&&S.push("dirs only"),v&&S.push(`exclude: ${v}`),w&&S.push(`ext: ${w}`);let _="",O="";if(typeof r=="string"&&r){const L=r.lastIndexOf(`
|
|
606
|
+
`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!a&&!!n.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=v,c.ParserHandle=g,c.NetworkStreamer=p,c.FileStreamer=f,c.StringStreamer=h,c.ReadableStreamStreamer=m,n.jQuery&&((s=n.jQuery).fn.parse=function(A){var I=A.config||{},R=[];return this.each(function(B){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++)R.push({file:this.files[M],inputElem:this,instanceConfig:s.extend({},I)})}),P(),this;function P(){if(R.length===0)T(A.complete)&&A.complete();else{var B,M,z,H,q=R[0];if(T(A.before)){var V=A.before(q.file,q.inputElem);if(typeof V=="object"){if(V.action==="abort")return B="AbortError",M=q.file,z=q.inputElem,H=V.reason,void(T(A.error)&&A.error({name:B},M,z,H));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 Q=q.instanceConfig.complete;q.instanceConfig.complete=function($){T(Q)&&Q($,q.file,q.inputElem),L()},c.parse(q.file,q.instanceConfig)}}function L(){R.splice(0,1),P()}}),i&&(n.onmessage=function(A){A=A.data,c.WORKER_ID===void 0&&A&&(c.WORKER_ID=A.workerId),typeof A.input=="string"?n.postMessage({workerId:c.WORKER_ID,results:c.parse(A.input,A.config),finished:!0}):(n.File&&A.input instanceof File||A.input instanceof Object)&&(A=c.parse(A.input,A.config))&&n.postMessage({workerId:c.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,c})})(E3)),E3.exports}var Rpn=Npn();const fbt=cf(Rpn);var K4e=1,Ppn=.9,jpn=.8,$pn=.17,LJ=.1,FJ=.999,Mpn=.9999,Lpn=.99,Fpn=/[\\\/_+.#"@\[\(\{&]/,Bpn=/[\\\/_+.#"@\[\(\{&]/g,zpn=/[\s-]/,hbt=/[\s-]/g;function lae(e,t,r,n,s,a,i){if(a===t.length)return s===e.length?K4e:Lpn;var o=`${s},${a}`;if(i[o]!==void 0)return i[o];for(var l=n.charAt(a),c=r.indexOf(l,s),d=0,p,f,h,m;c>=0;)p=lae(e,t,r,n,c+1,a+1,i),p>d&&(c===s?p*=K4e:Fpn.test(e.charAt(c-1))?(p*=jpn,h=e.slice(s,c-1).match(Bpn),h&&s>0&&(p*=Math.pow(FJ,h.length))):zpn.test(e.charAt(c-1))?(p*=Ppn,m=e.slice(s,c-1).match(hbt),m&&s>0&&(p*=Math.pow(FJ,m.length))):(p*=$pn,s>0&&(p*=Math.pow(FJ,c-s))),e.charAt(c)!==t.charAt(a)&&(p*=Mpn)),(p<LJ&&r.charAt(c-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(c-1)!==n.charAt(a))&&(f=lae(e,t,r,n,c+1,a+2,i),f*LJ>p&&(p=f*LJ)),p>d&&(d=p),c=r.indexOf(l,c+1);return i[o]=d,d}function J4e(e){return e.toLowerCase().replace(hbt," ")}function Upn(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,lae(e,t,J4e(e),J4e(t),0,0,{})}var mT='[cmdk-group=""]',BJ='[cmdk-group-items=""]',Vpn='[cmdk-group-heading=""]',mbt='[cmdk-item=""]',e5e=`${mbt}:not([aria-disabled="true"])`,cae="cmdk-item-select",pE="data-value",qpn=(e,t,r)=>Upn(e,t,r),gbt=E.createContext(void 0),RP=()=>E.useContext(gbt),ybt=E.createContext(void 0),Mme=()=>E.useContext(ybt),bbt=E.createContext(void 0),vbt=E.forwardRef((e,t)=>{let r=fE(()=>{var U,N;return{search:"",value:(N=(U=e.value)!=null?U:e.defaultValue)!=null?N:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=fE(()=>new Set),s=fE(()=>new Map),a=fE(()=>new Map),i=fE(()=>new Set),o=xbt(e),{label:l,children:c,value:d,onValueChange:p,filter:f,shouldFilter:h,loop:m,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,w=ho(),S=ho(),_=ho(),O=E.useRef(null),C=tfn();W1(()=>{if(d!==void 0){let U=d.trim();r.current.value=U,T.emit()}},[d]),W1(()=>{C(6,B)},[]);let T=E.useMemo(()=>({subscribe:U=>(i.current.add(U),()=>i.current.delete(U)),snapshot:()=>r.current,setState:(U,N,Z)=>{var G,K,ee,te;if(!Object.is(r.current[U],N)){if(r.current[U]=N,U==="search")L(),R(),C(1,P);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(_);se?se.focus():(G=document.getElementById(w))==null||G.focus()}if(C(7,()=>{var se;r.current.selectedItemId=(se=M())==null?void 0:se.id,T.emit()}),Z||C(5,B),((K=o.current)==null?void 0:K.value)!==void 0){let se=N??"";(te=(ee=o.current).onValueChange)==null||te.call(ee,se);return}}T.emit()}},emit:()=>{i.current.forEach(U=>U())}}),[]),A=E.useMemo(()=>({value:(U,N,Z)=>{var G;N!==((G=a.current.get(U))==null?void 0:G.value)&&(a.current.set(U,{value:N,keywords:Z}),r.current.filtered.items.set(U,I(N,Z)),C(2,()=>{R(),T.emit()}))},item:(U,N)=>(n.current.add(U),N&&(s.current.has(N)?s.current.get(N).add(U):s.current.set(N,new Set([U]))),C(3,()=>{L(),R(),r.current.value||P(),T.emit()}),()=>{a.current.delete(U),n.current.delete(U),r.current.filtered.items.delete(U);let Z=M();C(4,()=>{L(),Z?.getAttribute("id")===U&&P(),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:w,inputId:_,labelId:S,listInnerRef:O}),[]);function I(U,N){var Z,G;let K=(G=(Z=o.current)==null?void 0:Z.filter)!=null?G:qpn;return U?K(U,r.current.search,N):0}function R(){if(!r.current.search||o.current.shouldFilter===!1)return;let U=r.current.filtered.items,N=[];r.current.filtered.groups.forEach(G=>{let K=s.current.get(G),ee=0;K.forEach(te=>{let se=U.get(te);ee=Math.max(se,ee)}),N.push([G,ee])});let Z=O.current;z().sort((G,K)=>{var ee,te;let se=G.getAttribute("id"),ue=K.getAttribute("id");return((ee=U.get(ue))!=null?ee:0)-((te=U.get(se))!=null?te:0)}).forEach(G=>{let K=G.closest(BJ);K?K.appendChild(G.parentElement===K?G:G.closest(`${BJ} > *`)):Z.appendChild(G.parentElement===Z?G:G.closest(`${BJ} > *`))}),N.sort((G,K)=>K[1]-G[1]).forEach(G=>{var K;let ee=(K=O.current)==null?void 0:K.querySelector(`${mT}[${pE}="${encodeURIComponent(G[0])}"]`);ee?.parentElement.appendChild(ee)})}function P(){let U=z().find(Z=>Z.getAttribute("aria-disabled")!=="true"),N=U?.getAttribute(pE);T.setState("value",N||void 0)}function L(){var U,N,Z,G;if(!r.current.search||o.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let K=0;for(let ee of n.current){let te=(N=(U=a.current.get(ee))==null?void 0:U.value)!=null?N:"",se=(G=(Z=a.current.get(ee))==null?void 0:Z.keywords)!=null?G:[],ue=I(te,se);r.current.filtered.items.set(ee,ue),ue>0&&K++}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=K}function B(){var U,N,Z;let G=M();G&&(((U=G.parentElement)==null?void 0:U.firstChild)===G&&((Z=(N=G.closest(mT))==null?void 0:N.querySelector(Vpn))==null||Z.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function M(){var U;return(U=O.current)==null?void 0:U.querySelector(`${mbt}[aria-selected="true"]`)}function z(){var U;return Array.from(((U=O.current)==null?void 0:U.querySelectorAll(e5e))||[])}function H(U){let N=z()[U];N&&T.setState("value",N.getAttribute(pE))}function q(U){var N;let Z=M(),G=z(),K=G.findIndex(te=>te===Z),ee=G[K+U];(N=o.current)!=null&&N.loop&&(ee=K+U<0?G[G.length-1]:K+U===G.length?G[0]:G[K+U]),ee&&T.setState("value",ee.getAttribute(pE))}function V(U){let N=M(),Z=N?.closest(mT),G;for(;Z&&!G;)Z=U>0?Jpn(Z,mT):efn(Z,mT),G=Z?.querySelector(e5e);G?T.setState("value",G.getAttribute(pE)):q(U)}let Q=()=>H(z().length-1),$=U=>{U.preventDefault(),U.metaKey?Q():U.altKey?V(1):q(1)},X=U=>{U.preventDefault(),U.metaKey?H(0):U.altKey?V(-1):q(-1)};return E.createElement(xl.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:U=>{var N;(N=v.onKeyDown)==null||N.call(v,U);let Z=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||Z))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(),H(0);break}case"End":{U.preventDefault(),Q();break}case"Enter":{U.preventDefault();let G=M();if(G){let K=new Event(cae);G.dispatchEvent(K)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:nfn},l),U8(e,U=>E.createElement(ybt.Provider,{value:T},E.createElement(gbt.Provider,{value:A},U))))}),Hpn=E.forwardRef((e,t)=>{var r,n;let s=ho(),a=E.useRef(null),i=E.useContext(bbt),o=RP(),l=xbt(e),c=(n=(r=l.current)==null?void 0:r.forceMount)!=null?n:i?.forceMount;W1(()=>{if(!c)return o.item(s,i?.id)},[c]);let d=wbt(s,a,[e.value,e.children,a],e.keywords),p=Mme(),f=bx(C=>C.value&&C.value===d.current),h=bx(C=>c||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(cae,m),()=>C.removeEventListener(cae,m)},[h,e.onSelect,e.disabled]);function m(){var C,T;g(),(T=(C=l.current).onSelect)==null||T.call(C,d.current)}function g(){p.setState("value",d.current,!0)}if(!h)return null;let{disabled:b,value:v,onSelect:w,forceMount:S,keywords:_,...O}=e;return E.createElement(xl.div,{ref:Lm(a,t),...O,id:s,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!f,"data-disabled":!!b,"data-selected":!!f,onPointerMove:b||o.getDisablePointerSelection()?void 0:g,onClick:b?void 0:m},e.children)}),Zpn=E.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...a}=e,i=ho(),o=E.useRef(null),l=E.useRef(null),c=ho(),d=RP(),p=bx(h=>s||d.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);W1(()=>d.group(i),[]),wbt(i,o,[e.value,e.heading,l]);let f=E.useMemo(()=>({id:i,forceMount:s}),[s]);return E.createElement(xl.div,{ref:Lm(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:c},r),U8(e,h=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},E.createElement(bbt.Provider,{value:f},h))))}),Gpn=E.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=E.useRef(null),a=bx(i=>!i.search);return!r&&!a?null:E.createElement(xl.div,{ref:Lm(s,t),...n,"cmdk-separator":"",role:"separator"})}),Qpn=E.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,a=Mme(),i=bx(c=>c.search),o=bx(c=>c.selectedItemId),l=RP();return E.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),E.createElement(xl.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:c=>{s||a.setState("search",c.target.value),r?.(c.target.value)}})}),Wpn=E.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,a=E.useRef(null),i=E.useRef(null),o=bx(c=>c.selectedItemId),l=RP();return E.useEffect(()=>{if(i.current&&a.current){let c=i.current,d=a.current,p,f=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let h=c.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(p),f.unobserve(c)}}},[]),E.createElement(xl.div,{ref:Lm(a,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":n,id:l.listId},U8(e,c=>E.createElement("div",{ref:Lm(i,l.listInnerRef),"cmdk-list-sizer":""},c)))}),Xpn=E.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:a,container:i,...o}=e;return E.createElement(Y6,{open:r,onOpenChange:n},E.createElement(K6,{container:i},E.createElement(ZR,{"cmdk-overlay":"",className:s}),E.createElement(GR,{"aria-label":e.label,"cmdk-dialog":"",className:a},E.createElement(vbt,{ref:t,...o}))))}),Ypn=E.forwardRef((e,t)=>bx(r=>r.filtered.count===0)?E.createElement(xl.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Kpn=E.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...a}=e;return E.createElement(xl.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},U8(e,i=>E.createElement("div",{"aria-hidden":!0},i)))}),Gu=Object.assign(vbt,{List:Wpn,Item:Hpn,Input:Qpn,Group:Zpn,Separator:Gpn,Dialog:Xpn,Empty:Ypn,Loading:Kpn});function Jpn(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function efn(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function xbt(e){let t=E.useRef(e);return W1(()=>{t.current=e}),t}var W1=typeof window>"u"?E.useEffect:E.useLayoutEffect;function fE(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function bx(e){let t=Mme(),r=()=>e(t.snapshot());return E.useSyncExternalStore(t.subscribe,r,r)}function wbt(e,t,r,n=[]){let s=E.useRef(),a=RP();return W1(()=>{var i;let o=(()=>{var c;for(let d of r){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(c=d.current.textContent)==null?void 0:c.trim():s.current}})(),l=n.map(c=>c.trim());a.value(e,o,l),(i=t.current)==null||i.setAttribute(pE,o),s.current=o}),s}var tfn=()=>{let[e,t]=E.useState(),r=fE(()=>new Map);return W1(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function rfn(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function U8({asChild:e,children:t},r){return e&&E.isValidElement(t)?E.cloneElement(rfn(t),{ref:t.ref},r(t.props.children)):r(t)}var nfn={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 X1(e,t,r,n,s,a){if(e==n)return[];let i=Fme(e,t,r,n,s,a),o=Bme(e,t+i,r,n,s+i,a);t+=i,r-=o,s+=i,a-=o;let l=r-t,c=a-s;if(!l||!c)return[new Oo(t,r,s,a)];if(l>c){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+c,r,a,a)]}else if(c>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||c==1)return[new Oo(t,r,s,a)];let d=_bt(e,t,r,n,s,a);if(d){let[p,f,h]=d;return X1(e,t,p,n,s,f).concat(X1(e,p+h,r,n,f+h,a))}return sfn(e,t,r,n,s,a)}let YT=1e9,KT=0,Lme=!1;function sfn(e,t,r,n,s,a){let i=r-t,o=a-s;if(YT<1e9&&Math.min(i,o)>YT*16||KT>0&&Date.now()>KT)return Math.min(i,o)>YT*64?[new Oo(t,r,s,a)]:t5e(e,t,r,n,s,a);let l=Math.ceil((i+o)/2);zJ.reset(l),UJ.reset(l);let c=(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?UJ:null,f=p?null:zJ;for(let h=0;h<l;h++){if(h>YT||KT>0&&!(h&63)&&Date.now()>KT)return t5e(e,t,r,n,s,a);let m=zJ.advance(h,i,o,l,p,!1,c)||UJ.advance(h,i,o,l,f,!0,d);if(m)return afn(e,t,r,t+m[0],n,s,a,s+m[1])}return[new Oo(t,r,s,a)]}class Sbt{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 c=s+l,d=l==-t||l!=t&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,p=d-l;for(;d<r&&p<n&&o(d,p);)d++,p++;if(this.vec[c]=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 zJ=new Sbt,UJ=new Sbt;function afn(e,t,r,n,s,a,i,o){let l=!1;return!Rk(e,n)&&++n==r&&(l=!0),!Rk(s,o)&&++o==i&&(l=!0),l?[new Oo(t,r,a,i)]:X1(e,t,n,s,a,o).concat(X1(e,n,r,s,o,i))}function Ebt(e,t){let r=1,n=Math.min(e,t);for(;r<n;)r=r<<1;return r}function Fme(e,t,r,n,s,a){if(t==r||t==a||e.charCodeAt(t)!=n.charCodeAt(s))return 0;let i=Ebt(r-t,a-s);for(let o=t,l=s;;){let c=o+i,d=l+i;if(c>r||d>a||e.slice(o,c)!=n.slice(l,d)){if(i==1)return o-t-(Rk(e,o)?0:1);i=i>>1}else{if(c==r||d==a)return c-t;o=c,l=d}}}function Bme(e,t,r,n,s,a){if(t==r||s==a||e.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let i=Ebt(r-t,a-s);for(let o=r,l=a;;){let c=o-i,d=l-i;if(c<t||d<s||e.slice(c,o)!=n.slice(d,l)){if(i==1)return r-o-(Rk(e,o)?0:1);i=i>>1}else{if(c==t||d==s)return r-c;o=c,l=d}}}function uae(e,t,r,n,s,a,i,o){let l=n.slice(s,a),c=null;for(;;){if(c||i<o)return c;for(let d=t+i;;){Rk(e,d)||d++;let p=d+i;if(Rk(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=Fme(e,p,r,n,s+h+f.length,a),g=Bme(e,t,d,n,s,s+h),b=f.length+m+g;(!c||c[2]<b)&&(c=[d-g,s+h-g,b])}d=p}if(o<0)return c;i=i>>1}}function _bt(e,t,r,n,s,a){let i=r-t,o=a-s;if(i<o){let l=_bt(n,s,a,e,t,r);return l&&[l[1],l[0],l[2]]}return i<4||o*2<i?null:uae(e,t,r,n,s,a,Math.floor(i/4),-1)}function t5e(e,t,r,n,s,a){Lme=!0;let i=r-t,o=a-s,l;if(i<o){let f=uae(n,s,a,e,t,r,Math.floor(i/6),50);l=f&&[f[1],f[0],f[2]]}else l=uae(e,t,r,n,s,a,Math.floor(o/6),50);if(!l)return[new Oo(t,r,s,a)];let[c,d,p]=l;return X1(e,t,c,n,s,d).concat(X1(e,c+p,r,n,d+p,a))}function kbt(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 ifn(e,t,r){for(;;){kbt(r,1);let n=!1;for(let s=0;s<r.length;s++){let a=r[s],i,o;(i=Fme(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=Bme(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,c=a.toB-a.fromB;if(l&&c)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 ofn(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,c=a.fromA-n,d=l-a.toA,p=n5e(t,a.fromA,c),f=r5e(t,a.toA,d),h=a.fromA-p,m=f-a.toA;if((!i||!o)&&h&&m){let g=Math.max(i,o),[b,v,w]=i?[t,a.fromA,a.toA]:[r,a.fromB,a.toB];g>h&&t.slice(p,a.fromA)==b.slice(w-h,w)?(a=e[s]=new Oo(p,p+i,a.fromB-h,a.toB-h),p=a.fromA,f=r5e(t,a.toA,l-a.toA)):g>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=n5e(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 g=a5e(t,a.fromA,a.toA),b,v=g<0?-1:s5e(t,a.toA,a.fromA);g>-1&&(b=g-a.fromA)<=d&&t.slice(a.fromA,g)==t.slice(a.toA,a.toA+b)?a=e[s]=a.offset(b):v>-1&&(b=a.toA-v)<=c&&t.slice(a.fromA-b,a.fromA)==t.slice(v,a.toA)&&(a=e[s]=a.offset(-b))}}else{let g=a5e(r,a.fromB,a.toB),b,v=g<0?-1:s5e(r,a.toB,a.fromB);g>-1&&(b=g-a.fromB)<=d&&r.slice(a.fromB,g)==r.slice(a.toB,a.toB+b)?a=e[s]=a.offset(b):v>-1&&(b=a.toB-v)<=c&&r.slice(a.fromB-b,a.fromB)==r.slice(v,a.toB)&&(a=e[s]=a.offset(-b))}}n=a.toA}return kbt(e,3),e}let f1;try{f1=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Obt(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Cbt(e,t){if(t==e.length)return 0;let r=e.charCodeAt(t);return r<192?Obt(r)?1:0:f1?!Dbt(r)||t==e.length-1?f1.test(String.fromCharCode(r))?1:0:f1.test(e.slice(t,t+2))?2:0:0}function Tbt(e,t){if(!t)return 0;let r=e.charCodeAt(t-1);return r<192?Obt(r)?1:0:f1?!Ibt(r)||t==1?f1.test(String.fromCharCode(r))?1:0:f1.test(e.slice(t-2,t))?2:0:0}const Abt=8;function r5e(e,t,r){if(t==e.length||!Tbt(e,t))return t;for(let n=t,s=t+r,a=0;a<Abt;a++){let i=Cbt(e,n);if(!i||n+i>s)return n;n+=i}return t}function n5e(e,t,r){if(!t||!Cbt(e,t))return t;for(let n=t,s=t-r,a=0;a<Abt;a++){let i=Tbt(e,n);if(!i||n-i<s)return n;n-=i}return t}function s5e(e,t,r){for(;t!=r;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function a5e(e,t,r){for(;t!=r;t++)if(e.charCodeAt(t)==10)return t;return-1}const Dbt=e=>e>=55296&&e<=56319,Ibt=e=>e>=56320&&e<=57343;function Rk(e,t){return!t||t==e.length||!Dbt(e.charCodeAt(t-1))||!Ibt(e.charCodeAt(t))}function lfn(e,t,r){var n;let s=r?.override;return s?s(e,t):(YT=((n=r?.scanLimit)!==null&&n!==void 0?n:1e9)>>1,KT=r?.timeout?Date.now()+r.timeout:0,Lme=!1,ifn(e,t,X1(e,0,e.length,t,0,t.length)))}function Nbt(){return!Lme}function Rbt(e,t,r){return ofn(lfn(e,t,r),e,t)}const pm=Yt.define({combine:e=>e[0]}),dae=sn.define(),cfn=Yt.define(),Pk=go.define({create(e){return null},update(e,t){for(let r of t.effects)r.is(dae)&&(e=r.value);for(let r of t.state.facet(cfn))e=r(e,t);return e}});class o_{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 o_(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=Rbt(t.toString(),r.toString(),n);return Pbt(s,t,r,0,0,Nbt())}static updateA(t,r,n,s,a){return u5e(c5e(t,s,!0,n.length),t,r,n,a)}static updateB(t,r,n,s,a){return u5e(c5e(t,s,!1,r.length),t,r,n,a)}}function i5e(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 o5e(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 Pbt(e,t,r,n,s,a){let i=[];for(let o=0;o<e.length;o++){let l=e[o],[c,d]=i5e(l.fromA+n,l.fromB+s,t,r),[p,f]=o5e(l.toA+n,l.toB+s,t,r),h=[l.offset(-c+n,-d+s)];for(;o<e.length-1;){let m=e[o+1],[g,b]=i5e(m.fromA+n,m.fromB+s,t,r);if(g>p+1&&b>f+1)break;h.push(m.offset(-c+n,-d+s)),[p,f]=o5e(m.toA+n,m.toB+s,t,r),o++}i.push(new o_(h,c,Math.max(c,p),d,Math.max(d,f),a))}return i}const K$=1e3;function l5e(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,c]=r?[o.fromA,o.toA]:[o.fromB,o.toB];if(l>t)a=i;else if(c<=t)s=i+1;else return n?[o.fromA,o.fromB]:[o.toA,o.toB]}}function c5e(e,t,r,n){let s=[];return t.iterChangedRanges((a,i,o,l)=>{let c=0,d=r?t.length:n,p=0,f=r?n:t.length;a>K$&&([c,p]=l5e(e,a-K$,r,!0)),i<t.length-K$&&([d,f]=l5e(e,i+K$,r,!1));let h=l-o-(i-a),m,[g,b]=r?[h,0]:[0,h];s.length&&(m=s[s.length-1]).toA>=c?s[s.length-1]={fromA:m.fromA,fromB:m.fromB,toA:d,toB:f,diffA:m.diffA+g,diffB:m.diffB+b}:s.push({fromA:c,toA:d,fromB:p,toB:f,diffA:g,diffB:b})}),s}function u5e(e,t,r,n,s){if(!e.length)return t;let a=[];for(let i=0,o=0,l=0,c=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(;c<t.length;){let b=t[c];if(b.endA+o>p||b.endB+l>f)break;a.push(b.offset(o,l)),c++}if(!d)break;let h=d.toA+o+d.diffA,m=d.toB+l+d.diffB,g=Rbt(r.sliceString(p,h),n.sliceString(f,m),s);for(let b of Pbt(g,r,n,p,f,Nbt()))a.push(b);for(o+=d.diffA,l+=d.diffB;c<t.length;){let b=t[c];if(b.fromA+o>h&&b.fromB+l>m)break;c++}}return a}const ufn={scanLimit:500},jbt=Ci.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=f5e(e))}update(e){(e.docChanged||e.viewportChanged||dfn(e.startState,e.state)||pfn(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=f5e(e.view))}},{decorations:e=>e.deco}),J$=Ch.low(_We({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(jbt))===null||t===void 0?void 0:t.gutter)||Jn.empty}}));function dfn(e,t){return e.field(Pk,!1)!=t.field(Pk,!1)}function pfn(e,t){return e.facet(pm)!=t.facet(pm)}const d5e=nr.line({class:"cm-changedLine"}),ffn=nr.mark({class:"cm-changedText"}),hfn=nr.mark({tagName:"ins",class:"cm-insertedLine"}),mfn=nr.mark({tagName:"del",class:"cm-deletedLine"}),p5e=new class extends Um{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function gfn(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,d5e),s.add(i,o,r?mfn:hfn),a&&a.add(i,i,p5e);for(let c=t.iterRange(i,o-1),d=i;!c.next().done;){if(c.lineBreak){d++,s.add(d,d,d5e),a&&a.add(d,d,p5e);continue}let p=d+c.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),g=Math.max(d,h),b=Math.min(p,m);if(g<b&&s.add(g,b,ffn),m<p)l++;else break}d=p}}}function f5e(e){let t=e.state.field(Pk),{side:r,highlightChanges:n,markGutter:s,overrideChunk:a}=e.state.facet(pm),i=r=="a",o=new Nu,l=s?new Nu:null,{from:c,to:d}=e.viewport;for(let p of t){if((i?p.fromA:p.fromB)>=d)break;(i?p.toA:p.toB)>c&&(!a||!a(e.state,p,o,l))&&gfn(p,e.state.doc,i,n,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}class eM extends np{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 mL=sn.define({map:(e,t)=>e.map(t)}),JT=go.define({create:()=>nr.none,update:(e,t)=>{for(let r of t.effects)if(r.is(mL))return r.value;return e.map(t.changes)},provide:e=>gt.decorations.from(e)}),tM=.01;function h5e(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 yfn(e,t,r){let n=new Nu,s=new Nu,a=e.state.field(JT).iter(),i=t.state.field(JT).iter(),o=0,l=0,c=0,d=0,p=e.viewport,f=t.viewport;for(let b=0;;b++){let v=b<r.length?r[b]:null,w=v?v.fromA:e.state.doc.length,S=v?v.fromB:t.state.doc.length;if(o<w){let _=e.lineBlockAt(o).top+c,O=t.lineBlockAt(l).top+d,C=_-O;C<-tM?(c-=C,n.add(o,o,nr.widget({widget:new eM(-C),block:!0,side:-1}))):C>tM&&(d+=C,s.add(l,l,nr.widget({widget:new eM(C),block:!0,side:-1})))}if(w>o+1e3&&o<p.from&&w>p.from&&l<f.from&&S>f.from){let _=Math.min(p.from-o,f.from-l);o+=_,l+=_,b--}else if(v)o=v.toA,l=v.toB;else break;for(;a.value&&a.from<o;)c-=a.value.spec.widget.height,a.next();for(;i.value&&i.from<l;)d-=i.value.spec.widget.height,i.next()}for(;a.value;)c-=a.value.spec.widget.height,a.next();for(;i.value;)d-=i.value.spec.widget.height,i.next();let h=e.contentHeight+c-(t.contentHeight+d);h<tM?n.add(e.state.doc.length,e.state.doc.length,nr.widget({widget:new eM(-h),block:!0,side:1})):h>tM&&s.add(t.state.doc.length,t.state.doc.length,nr.widget({widget:new eM(h),block:!0,side:1}));let m=n.finish(),g=s.finish();h5e(m,e.state.field(JT))||e.dispatch({effects:mL.of(m)}),h5e(g,t.state.field(JT))||t.dispatch({effects:mL.of(g)})}const pae=sn.define({map:(e,t)=>t.mapPos(e)});class bfn extends np{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:pae.of(s)});let{side:a,sibling:i}=t.state.facet(pm);i&&i().dispatch({effects:pae.of(vfn(s,t.state.field(Pk),a=="a"))})}),r}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function vfn(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 xfn=go.define({create(e){return nr.none},update(e,t){e=e.map(t.changes);for(let r of t.effects)r.is(pae)&&(e=e.update({filter:n=>n!=r.value}));return e},provide:e=>gt.decorations.from(e)});function m5e({margin:e=3,minSize:t=4}){return xfn.init(r=>wfn(r,e,t))}function wfn(e,t,r){let n=new Nu,s=e.facet(pm).side=="a",a=e.field(Pk),i=1;for(let o=0;;o++){let l=o<a.length?a[o]:null,c=o?i+t:1,d=l?e.doc.lineAt(s?l.fromA:l.fromB).number-1-t:e.doc.lines,p=d-c+1;if(p>=r&&n.add(e.doc.line(c).from,e.doc.line(d).to,nr.replace({widget:new bfn(p),block:!0})),!l)break;i=e.doc.lineAt(Math.min(e.doc.length,s?l.toA:l.toB)).number}return n.finish()}const Sfn=gt.styleModule.of(new Cy({".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"}})),Efn=gt.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"}}),g5e=new nO,rM=new nO;class _fn{constructor(t){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=t.diffConfig||ufn;let r=[Ch.low(jbt),Efn,Sfn,JT,gt.updateListener.of(p=>{this.measuring<0&&(p.heightChanged||p.viewportChanged)&&!p.transactions.some(f=>f.effects.some(h=>h.is(mL)))&&this.measure()})],n=[pm.of({side:"a",sibling:()=>this.b,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&n.push(J$);let s=Wn.create({doc:t.a.doc,selection:t.a.selection,extensions:[t.a.extensions||[],gt.editorAttributes.of({class:"cm-merge-a"}),rM.of(n),r]}),a=[pm.of({side:"b",sibling:()=>this.a,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&a.push(J$);let i=Wn.create({doc:t.b.doc,selection:t.b.selection,extensions:[t.b.extensions||[],gt.editorAttributes.of({class:"cm-merge-b"}),rM.of(a),r]});this.chunks=o_.build(s.doc,i.doc,this.diffConf);let o=[Pk.init(()=>this.chunks),g5e.of(t.collapseUnchanged?m5e(t.collapseUnchanged):[])];s=s.update({effects:sn.appendConfig.of(o)}).state,i=i.update({effects:sn.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",c=document.createElement("div");c.className="cm-mergeViewEditor";let d=document.createElement("div");d.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?c:d),this.editorDOM.appendChild(l=="a-b"?d:c),this.a=new gt({state:s,parent:c,root:t.root,dispatchTransactions:p=>this.dispatch(p,this.a)}),this.b=new gt({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),ko.empty(t[0].startState.doc.length));this.chunks=r==this.a?o_.updateA(this.chunks,n.newDoc,this.b.state.doc,s,this.diffConf):o_.updateB(this.chunks,this.a.state.doc,n.newDoc,s,this.diffConf),r.update([...t,n.state.update({effects:dae.of(this.chunks)})]);let a=r==this.a?this.b:this.a;a.update([a.state.update({effects:dae.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(pm),l=n?t.gutter!==!1:o.markGutter,c=r?t.highlightChanges!==!1:o.highlightChanges;a.push(rM.reconfigure([pm.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:l}),l?J$:[]])),i.push(rM.reconfigure([pm.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:l}),l?J$:[]]))}if(s){let o=g5e.reconfigure(t.collapseUnchanged?m5e(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(){yfn(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=y5e(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=y5e(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,c]=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&&c<=a.state.doc.length&&(d+=s.state.lineBreak),a.dispatch({changes:{from:l,to:Math.min(a.state.doc.length,c),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 y5e(e){let t=e.nextSibling;return e.remove(),t}function kfn(e,t){return t in e&&typeof e[t]=="function"}const bl=e=>{const t=["listWorkspaces","getWorkspace"],r=NFe.has("workspaces-v1"),n=t.every(s=>kfn(e,s));return r&&n},$bt=e=>{if(!(!e||typeof e!="object")){if("status"in e&&typeof e.status=="number")return e.status;if("statusCode"in e&&typeof e.statusCode=="number")return e.statusCode}},Ofn=(e,t)=>$bt(e)===t,Cfn=e=>{const t=$bt(e);return t!==void 0&&t>=400&&t<500},fae=e=>{if(Ofn(e,501))return!0;if(e&&typeof e=="object"&&"message"in e){const t=e.message;return t.includes("Workspace v1 not supported")||t.includes("501")}return!1},Zw=(e,t)=>Cfn(t)||fae(t)?!1:e<3;function Mbt(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=Mbt(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Lbt(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Mbt(e))&&(n&&(n+=" "),n+=t);return n}const Tfn=(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},Afn=(e,t)=>({classGroupId:e,validator:t}),Fbt=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),gL="-",b5e=[],Dfn="arbitrary..",Ifn=e=>{const t=Rfn(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Nfn(i);const o=i.split(gL),l=o[0]===""&&o.length>1?1:0;return Bbt(o,l,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const l=n[i],c=r[i];return l?c?Tfn(c,l):l:c||b5e}return r[i]||b5e}}},Bbt=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const c=Bbt(e,t+1,a);if(c)return c}const i=r.validators;if(i===null)return;const o=t===0?e.join(gL):e.slice(t).join(gL),l=i.length;for(let c=0;c<l;c++){const d=i[c];if(d.validator(o))return d.classGroupId}},Nfn=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?Dfn+n:void 0})(),Rfn=e=>{const{theme:t,classGroups:r}=e;return Pfn(r,t)},Pfn=(e,t)=>{const r=Fbt();for(const n in e){const s=e[n];zme(s,r,n,t)}return r},zme=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];jfn(i,t,r,n)}},jfn=(e,t,r,n)=>{if(typeof e=="string"){$fn(e,t,r);return}if(typeof e=="function"){Mfn(e,t,r,n);return}Lfn(e,t,r,n)},$fn=(e,t,r)=>{const n=e===""?t:zbt(t,e);n.classGroupId=r},Mfn=(e,t,r,n)=>{if(Ffn(e)){zme(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Afn(r,e))},Lfn=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[o,l]=s[i];zme(l,zbt(t,o),r,n)}},zbt=(e,t)=>{let r=e;const n=t.split(gL),s=n.length;for(let a=0;a<s;a++){const i=n[a];let o=r.nextPart.get(i);o||(o=Fbt(),r.nextPart.set(i,o)),r=o}return r},Ffn=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Bfn=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)}}},hae="!",v5e=":",zfn=[],x5e=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),Ufn=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,o=0,l=0,c;const d=s.length;for(let g=0;g<d;g++){const b=s[g];if(i===0&&o===0){if(b===v5e){a.push(s.slice(l,g)),l=g+1;continue}if(b==="/"){c=g;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(hae)?(f=p.slice(0,-1),h=!0):p.startsWith(hae)&&(f=p.slice(1),h=!0);const m=c&&c>l?c-l:void 0;return x5e(a,h,f,m)};if(t){const s=t+v5e,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):x5e(zfn,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},Vfn=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}},qfn=e=>({cache:Bfn(e.cacheSize),parseClassName:Ufn(e),sortModifiers:Vfn(e),...Ifn(e)}),Hfn=/\s+/,Zfn=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],o=e.trim().split(Hfn);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{isExternal:p,modifiers:f,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=r(d);if(p){l=d+(l.length>0?" "+l:l);continue}let b=!!g,v=n(b?m.substring(0,g):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 w=f.length===0?"":f.length===1?f[0]:a(f).join(":"),S=h?w+hae:w,_=S+v;if(i.indexOf(_)>-1)continue;i.push(_);const O=s(v,b);for(let C=0;C<O.length;++C){const T=O[C];i.push(S+T)}l=d+(l.length>0?" "+l:l)}return l},Gfn=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=Ubt(r))&&(s&&(s+=" "),s+=n);return s},Ubt=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ubt(e[n]))&&(r&&(r+=" "),r+=t);return r},w5e=(e,...t)=>{let r,n,s,a;const i=l=>{const c=t.reduce((d,p)=>p(d),e());return r=qfn(c),n=r.cache.get,s=r.cache.set,a=o,o(l)},o=l=>{const c=n(l);if(c)return c;const d=Zfn(l,r);return s(l,d),d};return a=i,(...l)=>a(Gfn(...l))},Qfn=[],Vo=e=>{const t=r=>r[e]||Qfn;return t.isThemeGetter=!0,t},Vbt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qbt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Wfn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Xfn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Yfn=/\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$/,Kfn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Jfn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ehn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qb=e=>Wfn.test(e),Gn=e=>!!e&&!Number.isNaN(Number(e)),Hb=e=>!!e&&Number.isInteger(Number(e)),VJ=e=>e.endsWith("%")&&Gn(e.slice(0,-1)),Hg=e=>Xfn.test(e),Hbt=()=>!0,thn=e=>Yfn.test(e)&&!Kfn.test(e),Ume=()=>!1,rhn=e=>Jfn.test(e),nhn=e=>ehn.test(e),shn=e=>!br(e)&&!Sr(e),ahn=e=>zx(e,Qbt,Ume),br=e=>Vbt.test(e),w0=e=>zx(e,Wbt,thn),S5e=e=>zx(e,fhn,Gn),ihn=e=>zx(e,Ybt,Hbt),ohn=e=>zx(e,Xbt,Ume),E5e=e=>zx(e,Zbt,Ume),lhn=e=>zx(e,Gbt,nhn),nM=e=>zx(e,Kbt,rhn),Sr=e=>qbt.test(e),gT=e=>Gw(e,Wbt),chn=e=>Gw(e,Xbt),_5e=e=>Gw(e,Zbt),uhn=e=>Gw(e,Qbt),dhn=e=>Gw(e,Gbt),sM=e=>Gw(e,Kbt,!0),phn=e=>Gw(e,Ybt,!0),zx=(e,t,r)=>{const n=Vbt.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Gw=(e,t,r=!1)=>{const n=qbt.exec(e);return n?n[1]?t(n[1]):r:!1},Zbt=e=>e==="position"||e==="percentage",Gbt=e=>e==="image"||e==="url",Qbt=e=>e==="length"||e==="size"||e==="bg-size",Wbt=e=>e==="length",fhn=e=>e==="number",Xbt=e=>e==="family-name",Ybt=e=>e==="number"||e==="weight",Kbt=e=>e==="shadow",k5e=()=>{const e=Vo("color"),t=Vo("font"),r=Vo("text"),n=Vo("font-weight"),s=Vo("tracking"),a=Vo("leading"),i=Vo("breakpoint"),o=Vo("container"),l=Vo("spacing"),c=Vo("radius"),d=Vo("shadow"),p=Vo("inset-shadow"),f=Vo("text-shadow"),h=Vo("drop-shadow"),m=Vo("blur"),g=Vo("perspective"),b=Vo("aspect"),v=Vo("ease"),w=Vo("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[..._(),Sr,br],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],A=()=>[Sr,br,l],I=()=>[qb,"full","auto",...A()],R=()=>[Hb,"none","subgrid",Sr,br],P=()=>["auto",{span:["full",Hb,Sr,br]},Hb,Sr,br],L=()=>[Hb,"auto",Sr,br],B=()=>["auto","min","max","fr",Sr,br],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...A()],q=()=>[qb,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],V=()=>[qb,"screen","full","dvw","lvw","svw","min","max","fit",...A()],Q=()=>[qb,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],$=()=>[e,Sr,br],X=()=>[..._(),_5e,E5e,{position:[Sr,br]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",uhn,ahn,{size:[Sr,br]}],Z=()=>[VJ,gT,w0],G=()=>["","none","full",c,Sr,br],K=()=>["",Gn,gT,w0],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=()=>[Gn,VJ,_5e,E5e],ue=()=>["","none",m,Sr,br],xe=()=>["none",Gn,Sr,br],W=()=>["none",Gn,Sr,br],ae=()=>[Gn,Sr,br],ne=()=>[qb,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hg],breakpoint:[Hg],color:[Hbt],container:[Hg],"drop-shadow":[Hg],ease:["in","out","in-out"],font:[shn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hg],shadow:[Hg],spacing:["px",Gn],text:[Hg],"text-shadow":[Hg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qb,br,Sr,b]}],container:["container"],columns:[{columns:[Gn,br,Sr,o]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:O()}],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:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Hb,"auto",Sr,br]}],basis:[{basis:[qb,"full","auto",o,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Gn,qb,"auto","initial","none",br]}],grow:[{grow:["",Gn,Sr,br]}],shrink:[{shrink:["",Gn,Sr,br]}],order:[{order:[Hb,"first","last","none",Sr,br]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:P()}],"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":B()}],"auto-rows":[{"auto-rows":B()}],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:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":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",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],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,gT,w0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,phn,ihn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",VJ,br]}],"font-family":[{font:[chn,ohn,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,Sr,br]}],"line-clamp":[{"line-clamp":[Gn,"none",Sr,S5e]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",Sr,br]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Sr,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:[Gn,"from-font","auto",Sr,w0]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Gn,"auto",Sr,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",Sr,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",Sr,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:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hb,Sr,br],radial:["",Sr,br],conic:[Hb,Sr,br]},dhn,lhn]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"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:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-bs":[{"border-bs":K()}],"border-w-be":[{"border-be":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"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":[Gn,Sr,br]}],"outline-w":[{outline:["",Gn,gT,w0]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",d,sM,nM]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",p,sM,nM]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Gn,w0]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",f,sM,nM]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Gn,Sr,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":[Gn]}],"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":[Sr,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":_()}],"mask-image-conic-pos":[{"mask-conic":[Gn]}],"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:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Sr,br]}],filter:[{filter:["","none",Sr,br]}],blur:[{blur:ue()}],brightness:[{brightness:[Gn,Sr,br]}],contrast:[{contrast:[Gn,Sr,br]}],"drop-shadow":[{"drop-shadow":["","none",h,sM,nM]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Gn,Sr,br]}],"hue-rotate":[{"hue-rotate":[Gn,Sr,br]}],invert:[{invert:["",Gn,Sr,br]}],saturate:[{saturate:[Gn,Sr,br]}],sepia:[{sepia:["",Gn,Sr,br]}],"backdrop-filter":[{"backdrop-filter":["","none",Sr,br]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Gn,Sr,br]}],"backdrop-contrast":[{"backdrop-contrast":[Gn,Sr,br]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Gn,Sr,br]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Gn,Sr,br]}],"backdrop-invert":[{"backdrop-invert":["",Gn,Sr,br]}],"backdrop-opacity":[{"backdrop-opacity":[Gn,Sr,br]}],"backdrop-saturate":[{"backdrop-saturate":[Gn,Sr,br]}],"backdrop-sepia":[{"backdrop-sepia":["",Gn,Sr,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",Sr,br]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Gn,"initial",Sr,br]}],ease:[{ease:["linear","initial",v,Sr,br]}],delay:[{delay:[Gn,Sr,br]}],animate:[{animate:["none",w,Sr,br]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Sr,br]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[Sr,br,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"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",Sr,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",Sr,br]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Gn,gT,w0,S5e]}],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"]}},hhn=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(eA(e,"cacheSize",t),eA(e,"prefix",r),eA(e,"experimentalParseClassName",n),aM(e.theme,a.theme),aM(e.classGroups,a.classGroups),aM(e.conflictingClassGroups,a.conflictingClassGroups),aM(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),eA(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),iM(e.theme,s.theme),iM(e.classGroups,s.classGroups),iM(e.conflictingClassGroups,s.conflictingClassGroups),iM(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Jbt(e,s,"orderSensitiveModifiers"),e),eA=(e,t,r)=>{r!==void 0&&(e[t]=r)},aM=(e,t)=>{if(t)for(const r in t)eA(e,r,t[r])},iM=(e,t)=>{if(t)for(const r in t)Jbt(e,t,r)},Jbt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},mhn=(e,...t)=>typeof e=="function"?w5e(k5e,e,...t):w5e(()=>hhn(k5e(),e),...t),ghn=Object.keys({...rZe,...MLt}),yhn=Object.keys(VLt),bhn=Object.keys(LLt),vhn=Object.keys(FLt),xhn=Object.keys($Lt),S0=Object.keys(ULt),whn=Object.keys(BLt).concat(Object.keys(zLt)),Shn=mhn({extend:{theme:{color:ghn,spacing:yhn,radius:xhn,leading:vhn,shadow:whn},classGroups:{"font-size":[{text:bhn}],h:[{h:S0}],w:[{w:S0}],size:[{size:S0}],"min-h":[{"min-h":S0}],"min-w":[{"min-w":S0}],"max-h":[{"max-h":S0}],"max-w":[{"max-w":S0}]}}});function J(...e){return Shn(Lbt(e))}const fi={sm:"h-form-sm",md:"h-form-md",lg:"h-form-lg",default:"h-form-default"},$h="focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",Ehn="focus-within:outline-none focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",PP="rounded-md",_hn={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"},Ce=({children:e,className:t,size:r="default",...n})=>u.jsx("span",{className:J("block",_hn[r],t),...n,children:e}),gc=iFt,Yn=oFt,Kn=lFt,Vn=E.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>u.jsx(cFt,{children:u.jsxs(fZe,{ref:s,sideOffset:t,className:J("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,u.jsx(uFt,{className:"fill-surface6"})]})}));Vn.displayName=fZe.displayName;const khn={sm:`${fi.sm} w-form-sm`,md:`${fi.md} w-form-md`,lg:`${fi.lg} w-form-lg`,default:`${fi.default}`},Ohn={sm:"sm",md:"default",lg:"lg",default:"default"},Chn={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"},Thn="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",Zi=Ee.forwardRef(({className:e,children:t,tooltip:r,size:n="md",variant:s="default",disabled:a,...i},o)=>u.jsxs(Yn,{children:[u.jsx(Kn,{asChild:!0,children:u.jsx("button",{ref:o,disabled:a,"aria-label":typeof r=="string"?r:void 0,className:J(Thn,$h,Chn[s],khn[n],a&&"active:scale-100",e),...i,children:u.jsx(Ce,{size:Ohn[n],children:t})})}),u.jsx(Vn,{children:r})]}));Zi.displayName="IconButton";const Ahn={"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"},Dhn={mono:"font-mono"},We=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>u.jsx(e,{className:J(Ahn[r],n&&Dhn[n],t),...s}),Jr={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"},Qw={visible:"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},Ihn={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},Nhn=({src:e,name:t,size:r="sm",interactive:n=!1})=>u.jsx("div",{className:J(Ihn[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",Jr.all,n&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?u.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):u.jsx(We,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),V8=({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)})}}},Rhn=EXt({style:Oce.coldarkDark,customStyle:{margin:0,backgroundColor:"black"}}),Phn=()=>u.jsx(z7t,{remarkPlugins:[kGe],className:"aui-md",components:Mhn}),O5e=E.memo(Phn),jhn=({language:e,code:t})=>{const{isCopied:r,copyToClipboard:n}=V8(),s=()=>{!t||r||n(t)};return u.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:[u.jsx("span",{className:"lowercase [&>span]:text-xs",children:e}),u.jsx(Zi,{variant:"light",size:"md",tooltip:"Copy",onClick:s,children:u.jsxs("span",{className:"grid",children:[u.jsx("span",{style:{gridArea:"1/1"},className:J("transition-transform",r?"scale-100":"scale-0"),children:u.jsx(ni,{size:14})},"checkmark"),u.jsx("span",{style:{gridArea:"1/1"},className:J("transition-transform",r?"scale-0":"scale-100"),children:u.jsx(cc,{size:14})},"copy")]})})]})},$hn=({alt:e,src:t,...r})=>{const[n,s]=E.useState(!1);return E.useEffect(()=>{s(!1)},[t]),n||!t?u.jsxs("div",{children:[u.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:u.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"})}),u.jsx("p",{className:"text-xs italic text-neutral3 -mt-2.5 mb-2.5",children:"Image link is broken"})]}):u.jsx("img",{src:t,alt:e,...r,onError:()=>{s(!0)}})},Mhn=k7t({h1:({className:e,...t})=>u.jsx("h1",{className:J("mb-8 scroll-m-20 text-4xl font-extrabold tracking-tight last:mb-0",e),...t,style:{marginBottom:"2rem"}}),h2:({className:e,...t})=>u.jsx("h2",{className:J("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})=>u.jsx("h3",{className:J("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})=>u.jsx("h4",{className:J("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})=>u.jsx("h5",{className:J("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),h6:({className:e,...t})=>u.jsx("h6",{className:J("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),p:({className:e,...t})=>u.jsx("p",{className:J("leading-7 first:mt-0 last:mb-0",e),...t}),a:({className:e,...t})=>u.jsx("a",{className:J("text-neutral6 font-medium underline underline-offset-4",e),...t}),blockquote:({className:e,...t})=>u.jsx("blockquote",{className:J("border-l-2 pl-6 italic",e),...t}),ul:({className:e,...t})=>u.jsx("ul",{className:J("my-5 ml-6 list-disc [&>li]:mt-2",e),...t}),ol:({className:e,...t})=>u.jsx("ol",{className:J("my-5 ml-6 list-decimal [&>li]:mt-2",e),...t}),hr:({className:e,...t})=>u.jsx("hr",{className:J("my-5 border-b",e),...t}),table:({className:e,...t})=>u.jsx("table",{className:J("my-5 w-full border-separate border-spacing-0 overflow-y-auto",e),...t}),th:({className:e,...t})=>u.jsx("th",{className:J("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})=>u.jsx("td",{className:J("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})=>u.jsx("tr",{className:J("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})=>u.jsx("sup",{className:J("[&>a]:text-xs [&>a]:no-underline",e),...t}),pre:({className:e,...t})=>u.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:J("overflow-x-auto p-4 text-white",e)}),code:function({className:t,...r}){const n=JZe();return u.jsxs("pre",{style:{fontSize:"0.875rem",display:"inline"},children:[u.jsx("code",{className:J(!n&&"bg-surface4 rounded border font-semibold",t),...r,style:{fontWeight:"400",paddingBlock:n?0:"0.1em",paddingInline:n?0:"0.3em"}})," "]})},CodeHeader:jhn,SyntaxHighlighter:Rhn,img:$hn}),Lhn=({reason:e,tripwire:t})=>{const[r,n]=E.useState(!1),s=t&&(t.retry!==void 0||t.tripwirePayload||t.processorId);return u.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-950/20 overflow-hidden",children:[u.jsxs("div",{className:"flex items-start gap-3 p-4",children:[u.jsx(NR,{className:"w-5 h-5 text-amber-400 mt-0.5 flex-shrink-0"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-amber-200 mb-1",children:"Content Blocked"}),u.jsx("p",{className:"text-sm text-amber-300/90",children:e})]})]}),s&&u.jsxs(u.Fragment,{children:[u.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?u.jsx(Ua,{className:"w-3.5 h-3.5"}):u.jsx(co,{className:"w-3.5 h-3.5"}),u.jsx("span",{children:"Details"})]}),r&&u.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&&u.jsxs("div",{className:"flex items-center gap-2 pt-3",children:[u.jsx(IR,{className:"w-3.5 h-3.5 text-amber-400/60"}),u.jsxs("span",{className:"text-xs text-amber-300/70",children:["Retry:"," ",t.retry?u.jsx("span",{className:"text-green-400",children:"Allowed"}):u.jsx("span",{className:"text-red-400",children:"Not allowed"})]})]}),t.processorId&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ece,{className:"w-3.5 h-3.5 text-amber-400/60"}),u.jsxs("span",{className:"text-xs text-amber-300/70",children:["Processor:"," ",u.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&&u.jsxs("div",{className:"pt-1",children:[u.jsx("p",{className:"text-xs text-amber-400/60 mb-1.5",children:"Metadata:"}),u.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))})]})]})]})]})},Ji=e=>u.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"})]}),evt=e=>u.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"}),u.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"}),u.jsxs("g",{clipPath:"url(#clip0_21421_19519)",children:[u.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"}),u.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"})]}),u.jsx("defs",{children:u.jsx("clipPath",{id:"clip0_21421_19519",children:u.jsx("rect",{width:"62.7591",height:"62.7591",fill:"white",transform:"matrix(0.897148 0.441731 -0.897148 0.441731 63.1714 7.24365)"})})})]}),Fhn=e=>u.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"})]}),Vme=e=>u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"})]}),qme=e=>u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"})]}),Io=e=>u.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),Hme=e=>u.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:u.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"})}),u.jsx("defs",{children:u.jsx("clipPath",{id:"clip0_21999_22095",children:u.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),tvt=e=>u.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[u.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"}),u.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"}),u.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"}),u.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"})]}),u.jsx("defs",{children:u.jsx("clipPath",{id:"clip0_21999_20513",children:u.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),Bhn=e=>u.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"}),u.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),u.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),u.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),rvt=e=>u.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),zhn=e=>u.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),Zme=e=>u.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),Uhn=e=>u.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),vl=e=>u.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),AO=e=>u.jsx(ILt,{...e}),dc=e=>u.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),Vhn=e=>u.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"}),u.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"}),u.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"})]}),_h=e=>u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"})]}),qhn=e=>u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),Hhn=e=>u.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"}),u.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"}),u.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"}),u.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"})]}),Zhn=e=>u.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"}),u.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"}),u.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 jk(e){return u.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:[u.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),u.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),u.jsx("path",{d:"M15 2v2"}),u.jsx("path",{d:"M15 20v2"}),u.jsx("path",{d:"M2 15h2"}),u.jsx("path",{d:"M2 9h2"}),u.jsx("path",{d:"M20 15h2"}),u.jsx("path",{d:"M20 9h2"}),u.jsx("path",{d:"M9 2v2"}),u.jsx("path",{d:"M9 20v2"})]})}const Ghn={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},Qhn={warning:Iu,destructive:Am,info:Vc},uh=({children:e,variant:t="destructive",className:r})=>{const n=Qhn[t];return u.jsx("div",{className:J(Ghn[t],"p-3 rounded-md border shadow-sm",Jr.all,"animate-in fade-in-0 slide-in-from-top-2 duration-200",r),children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(Ce,{className:"mt-0.5 flex-shrink-0",children:u.jsx(n,{})}),u.jsx("div",{className:"text-neutral4",children:e})]})})},dh=({children:e,as:t="h5"})=>u.jsx(We,{as:t,variant:"ui-md",className:"font-semibold",children:e}),vx=({children:e,as:t="p"})=>u.jsx(We,{as:t,variant:"ui-sm",children:e}),Whn={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"},Xhn={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},Gt=({icon:e,variant:t="default",className:r,children:n,...s})=>u.jsxs("div",{className:J("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",Jr.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":Whn[t],r),...s,children:[e&&u.jsx("span",{className:Xhn[t],children:u.jsx(Ce,{children:e})}),n]}),Yhn=()=>{const e=jn(({part:a})=>a),[t,r]=E.useState(!1),n=e.text||"",s=e.metadata||{};if(s?.status==="tripwire")return u.jsx(Lhn,{reason:n,tripwire:s.tripwire});if(s?.status==="warning")return u.jsxs(uh,{variant:"warning",children:[u.jsx(dh,{as:"h5",children:"Warning"}),u.jsx(vx,{as:"p",children:n})]});if(s?.status==="error")return u.jsxs(uh,{variant:"destructive",children:[u.jsx(dh,{as:"h5",children:"Error"}),u.jsx(vx,{as:"p",children:n})]});if(s?.mode==="network"&&s?.completionResult)return u.jsxs("div",{className:"mb-2 space-y-2",children:[u.jsxs("button",{onClick:()=>r(a=>!a),className:"flex items-center gap-2",children:[u.jsx(Ce,{children:u.jsx(fw,{className:J("transition-all",t?"rotate-90":"rotate-180")})}),u.jsxs(Gt,{variant:"info",icon:u.jsx(MHe,{}),children:[t?"Show":"Hide"," completion check"]})]}),!t&&u.jsxs(uh,{variant:"info",children:[u.jsx(dh,{as:"h5",children:s.completionResult?.passed?"Complete":"Not Complete"}),u.jsx(O5e,{})]})]});try{const a=n.trim();if(a.startsWith("__ERROR__:")){const i=a.substring(10);return u.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:[u.jsx(Am,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),u.jsxs("div",{className:"flex-1",children:[u.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),u.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:i})]})]})}else if(a.startsWith("Error:")){const i=a.substring(6).trim();return u.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:[u.jsx(Am,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),u.jsxs("div",{className:"flex-1",children:[u.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),u.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:i})]})]})}return u.jsx(O5e,{})}catch{return u.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:[u.jsx(Am,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),u.jsxs("div",{className:"flex-1",children:[u.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),u.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:String(n)})]})]})}},Ff="mastra_workspace",yL={FILESYSTEM:{READ_FILE:`${Ff}_read_file`,WRITE_FILE:`${Ff}_write_file`,EDIT_FILE:`${Ff}_edit_file`,LIST_FILES:`${Ff}_list_files`,DELETE:`${Ff}_delete`,FILE_STAT:`${Ff}_file_stat`,MKDIR:`${Ff}_mkdir`},SANDBOX:{EXECUTE_COMMAND:`${Ff}_execute_command`},SEARCH:{SEARCH:`${Ff}_search`,INDEX:`${Ff}_index`}},Khn={duration:5e3,cancel:{label:u.jsx(Ce,{children:u.jsx(Oa,{})}),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 $d(e){const{classNames:t,...r}=Khn,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:J(t?.title,n?.title),toast:J(t?.toast,n?.toast),cancelButton:J(t?.cancelButton,n?.cancelButton),actionButton:J(t?.actionButton,n?.actionButton),description:J(t?.description,n?.description)},...s}}const Je=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>ic(r,$d(t)));if(Ee.isValidElement(e))return ic(e,$d(t));if(typeof e=="string")return ic(e,$d(t));throw new Error("Invalid message type")};Je.success=(e,t={})=>{const r={...t,icon:u.jsx(Ce,{className:"text-accent1 shrink-0",children:u.jsx(LHe,{})}),classNames:{...t.classNames,toast:J("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:J("text-xs text-neutral5",t.classNames?.title),description:J("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return ic.success(e,$d(r));case"object":return e.forEach(n=>ic.success(n,$d(r)))}};Je.error=(e,t={})=>{const r={...t,icon:u.jsx(Ce,{className:"text-accent2 shrink-0",children:u.jsx(_D,{})}),classNames:{...t.classNames,toast:J("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:J("text-xs text-neutral5",t.classNames?.title),description:J("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return ic.error(e,$d(r));case"object":return e.forEach(n=>ic.error(n,$d(r)))}};Je.warning=(e,t={})=>{const r={...t,icon:u.jsx(Ce,{className:"text-accent6 shrink-0",children:u.jsx(Am,{})}),classNames:{...t.classNames,toast:J("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:J("text-xs text-neutral5",t.classNames?.title),description:J("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return ic.warning(e,$d(r));case"object":return e.forEach(n=>ic.warning(n,$d(r)))}};Je.info=(e,t={})=>{const r={...t,icon:u.jsx(Ce,{className:"text-accent3 shrink-0",children:u.jsx(Vc,{})}),classNames:{...t.classNames,toast:J("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:J("text-xs text-neutral5",t.classNames?.title),description:J("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return ic.info(e,$d(r));case"object":return e.forEach(n=>ic.info(n,$d(r)))}};Je.custom=(e,t={})=>ic(e,$d(t));Je.dismiss=e=>{e&&ic.dismiss(e)};Je.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>ic.promise(e,{loading:t??"Loading...",success:o=>(s?.(o),r),error:o=>(a?.(o),n||o?.message||"Error..."),...$d(i)});function kh({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(()=>{Je.success(t),n(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{n(!1)},2e3)}).catch(()=>{Je.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:r,handleCopy:a}}const nvt={sm:`${fi.sm} gap-1 text-ui-sm`,md:`${fi.md} gap-1`,lg:`${fi.lg} gap-2`,default:`${fi.default} text-ui-md`,large:`${fi.lg} text-ui-lg`},svt={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"},avt="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]",Jhn=J("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"),emn="focus-visible:outline-none focus-visible:border-accent1/50";function Gme(e){const t=e?.variant||"default",r=e?.size||"md";return J(avt,$h,svt[t],nvt[r])}const Se=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 u.jsx(o,{ref:i,disabled:s,className:J(l?Jhn:avt,l?emn:$h,svt[n],nvt[r],s&&"active:scale-100",e),...a})});Se.displayName="Button";const jP=Ee.forwardRef(({tooltipContent:e,...t},r)=>u.jsxs(Yn,{children:[u.jsx(Kn,{asChild:!0,children:u.jsx(Se,{ref:r,...t})}),e&&u.jsx(Vn,{children:e})]}));jP.displayName="ButtonWithTooltip";function oc({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}=kh({text:e,copyMessage:t}),c=()=>{l(),o(!0),setTimeout(()=>o(!1),2e3)};return u.jsxs(Yn,{children:[u.jsx(Kn,{asChild:!0,children:u.jsx(Se,{onClick:c,type:"button",size:a,variant:"standard",children:i?u.jsx(ni,{}):u.jsx(cc,{})})}),u.jsx(Vn,{children:i?"Copied!":r})]})}const tmn=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,rmn=nr.mark({class:"cm-variable-highlight"}),C5e=new xWe({regexp:tmn,decoration:()=>rmn}),nmn=Ci.fromClass(class{decorations;constructor(e){this.decorations=C5e.createDeco(e)}update(e){this.decorations=C5e.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),smn=nmn;function amn(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,c]of Object.entries(s.properties))n(c,`${a}.${l}`,i+1);if(s.items?.properties)for(const[l,c]of Object.entries(s.items.properties))n(c,`${a}[].${l}`,i+1)}for(const[s,a]of Object.entries(e.properties))n(a,s,1);return r}function imn(e){const t=amn(e);return aXe({override:[omn(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function omn(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:(c,d,p,f)=>{const g=c.state.sliceDoc(f,f+2)==="}}"?d.label:`${d.label}}}`;c.dispatch({changes:{from:p,to:f,insert:g},selection:{anchor:p+g.length}})}}));return{from:a,options:o,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const Ux=()=>E.useMemo(()=>{const e=H6({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=gt.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]},[]),mi=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:c,autoFocus:d,...p},f)=>{const h=Ux(),m=e?JSON.stringify(e,null,2):t??"",g=E.useMemo(()=>{const b=[];return a==="json"?b.push(Nd):a==="markdown"&&(b.push(Mue({base:D1,codeLanguages:CYe})),b.push(gt.lineWrapping)),i&&a==="markdown"&&b.push(smn),c&&a==="markdown"&&b.push(imn(c)),b},[a,i,c]);return u.jsxs("div",{className:J("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...p,children:[n&&u.jsx(oc,{content:m,className:"absolute top-2 right-2 z-20"}),u.jsx(Ld,{ref:f,value:m,theme:h,extensions:g,onChange:r,"aria-label":"Code editor",placeholder:o,height:"100%",style:{height:"100%"},autoFocus:d})]})});async function lmn(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ze(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-CJR663RP.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([29,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 q8=({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]),u.jsxs("div",{className:"mb-4","data-testid":i,children:[u.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between",children:[u.jsxs("button",{onClick:s?()=>l(c=>!c):void 0,className:"flex items-center gap-2 disabled:cursor-not-allowed",disabled:!s,type:"button",children:[u.jsx(Ce,{children:u.jsx(fw,{className:J("transition-all",o?"rotate-90":"rotate-180")})}),u.jsx(Gt,{icon:r,children:n})]}),a]}),!o&&u.jsx("div",{className:"pt-2",children:u.jsx("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:e})})]})},wa=Y6,ivt=MKe,cmn=K6,ovt=E.forwardRef(({className:e,...t},r)=>u.jsx(ZR,{ref:r,className:J("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}));ovt.displayName=ZR.displayName;const sa=E.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(cmn,{children:[u.jsx(ovt,{}),u.jsxs(GR,{ref:n,className:J("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,u.jsxs(t9,{className:J("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:[u.jsx(Oa,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));sa.displayName=GR.displayName;const Sa=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});Sa.displayName="DialogHeader";const H8=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});H8.displayName="DialogFooter";const Ea=({className:e,...t})=>u.jsx("div",{className:J("overflow-y-auto px-6 max-h-[50vh]",e),...t});Ea.displayName="DialogBody";const aa=E.forwardRef(({className:e,...t},r)=>u.jsx(J6,{ref:r,className:J("text-ui-md font-medium",e),...t}));aa.displayName=J6.displayName;const Ei=E.forwardRef(({className:e,...t},r)=>u.jsx(e9,{ref:r,className:J("sr-only",e),...t}));Ei.displayName=e9.displayName;const umn=({selectionReason:e,open:t,onOpenChange:r,input:n})=>{let s=null;if(n)try{s=typeof n=="object"?u.jsx(mi,{data:n}):u.jsx(mi,{data:JSON.parse(n)})}catch{s=u.jsx("pre",{className:"whitespace-pre-wrap",children:n})}return u.jsx(wa,{open:t,onOpenChange:r,children:u.jsxs(sa,{children:[u.jsxs(Sa,{children:[u.jsx(aa,{children:"Agent Network Metadata"}),u.jsx(Ei,{children:"View the metadata of the agent's network choice."})]}),u.jsxs(Ea,{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(We,{className:"text-neutral3",children:"Selection Reason"}),u.jsx("div",{className:"text-neutral6 text-ui-md",children:e})]}),s&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(We,{className:"text-neutral3",children:"Input"}),u.jsx("div",{className:"text-neutral6 text-ui-md",children:s})]})]})]})})},Qme=({selectionReason:e,input:t})=>{const[r,n]=E.useState(!1);return u.jsxs(u.Fragment,{children:[u.jsx(Zi,{variant:"light",size:"md",tooltip:"Show selection reason",onClick:()=>n(s=>!s),children:u.jsx(uLt,{className:"text-neutral3 size-5"})}),u.jsx(umn,{selectionReason:e||"",open:r,onOpenChange:n,input:t})]})},lvt=E.createContext(void 0);function dmn({children:e,approveToolcall:t,declineToolcall:r,approveToolcallGenerate:n,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:l,networkToolCallApprovals:c}){return u.jsx(lvt.Provider,{value:{approveToolcall:t,declineToolcall:r,approveToolcallGenerate:n,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:l,networkToolCallApprovals:c},children:e})}function pmn(){const e=E.useContext(lvt);if(!e)throw new Error("useToolCall must be used within a ToolCallProvider");return e}const $P=({toolCalled:e,toolCallId:t,toolApprovalMetadata:r,toolName:n,isNetwork:s,isGenerateMode:a})=>{const{approveToolcall:i,declineToolcall:o,approveToolcallGenerate:l,declineToolcallGenerate:c,isRunning:d,toolCallApprovals:p,approveNetworkToolcall:f,declineNetworkToolcall:h,networkToolCallApprovals:m}=pmn(),g=()=>{s?f(n,r?.runId):a?l(t):i(t)},b=()=>{s?h(n,r?.runId):a?c(t):o(t)},v=s?m?.[r?.runId?`${r.runId}-${n}`:n]?.status:p?.[t]?.status;return r&&!e?u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Approval required"}),u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsxs(Se,{onClick:g,disabled:d||!!v,className:v==="approved"?"!text-accent1":"",children:[u.jsx(Ce,{children:u.jsx(ni,{})}),"Approve"]}),u.jsxs(Se,{onClick:b,disabled:d||!!v,className:v==="declined"?"!text-accent2":"",children:[u.jsx(Ce,{children:u.jsx(Oa,{})}),"Decline"]})]})]}):null},fmn=({toolName:e,args:t,result:r,metadata:n,toolOutput:s,toolCallId:a,toolApprovalMetadata:i,suspendPayload:o,isNetwork:l,toolCalled:c})=>{let d=null;try{const{__mastraMetadata:b,...v}=typeof t=="object"?t:JSON.parse(t);d=u.jsx(mi,{data:v,"data-testid":"tool-args"})}catch{d=u.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:t})}let p=typeof r=="string"?u.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:r}):u.jsx(mi,{data:r,"data-testid":"tool-result"}),f=typeof o=="string"?u.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:o}):u.jsx(mi,{data:o,"data-testid":"tool-suspend-payload"});const h=n?.mode==="network"?n.selectionReason:void 0,m=n?.mode==="network"?n.agentInput:void 0,g=c??(r||s.length>0);return u.jsx(q8,{"data-testid":"tool-badge",icon:u.jsx(vl,{className:"text-accent6"}),title:e,extraInfo:n?.mode==="network"&&u.jsx(Qme,{selectionReason:h||"",input:m}),initialCollapsed:!(i??o),children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Tool arguments"}),d]}),f!==void 0&&o&&u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Tool suspend payload"}),f]}),p!==void 0&&r&&u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Tool result"}),p]}),s.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Tool output"}),u.jsx("div",{className:"h-40 overflow-y-auto",children:u.jsx(mi,{data:s,"data-testid":"tool-output"})})]}),u.jsx($P,{toolCalled:g,toolCallId:a,toolApprovalMetadata:i,toolName:e,isNetwork:l,isGenerateMode:n?.mode==="generate"})]})})},cvt=E.createContext({Link:E.forwardRef(()=>null),navigate:()=>{},paths:{agentLink:()=>"",agentsLink:()=>"",agentToolLink:()=>"",agentSkillLink:()=>"",agentThreadLink:()=>"",agentNewThreadLink:()=>"",workflowsLink:()=>"",workflowLink:()=>"",networkLink:()=>"",networkNewThreadLink:()=>"",networkThreadLink:()=>"",scorerLink:()=>"",cmsScorersCreateLink:()=>"",cmsScorerEditLink:()=>"",cmsAgentCreateLink:()=>"",cmsAgentEditLink:()=>"",toolLink:()=>"",skillLink:()=>"",workspacesLink:()=>"",workspaceLink:()=>"",workspaceSkillLink:()=>"",processorsLink:()=>"",processorLink:()=>"",mcpServerLink:()=>"",mcpServerToolLink:()=>"",workflowRunLink:()=>"",datasetLink:()=>"",datasetItemLink:()=>"",datasetExperimentLink:()=>""}}),hmn=({children:e,Link:t,navigate:r,paths:n})=>u.jsx(cvt.Provider,{value:{Link:t,navigate:r,paths:n},children:e}),ur=()=>{const e=E.useContext(cvt);if(!e)throw new Error("useLinkComponent must be used within a LinkComponentProvider");return e},mmn=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"}},gmn=(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},ymn=({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]),u.jsxs("div",{className:"rounded-md border border-border1 overflow-hidden",children:[e&&u.jsxs("div",{className:"px-3 py-2 bg-surface3 border-b border-border1 flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx("span",{className:"text-neutral6 text-xs shrink-0",children:"$"}),u.jsx("code",{className:"text-xs text-neutral-300 font-mono truncate",children:e})]}),n&&u.jsx(Zi,{variant:"light",size:"sm",tooltip:"Copy output",onClick:n,className:"shrink-0",children:u.jsxs("span",{className:"grid",children:[u.jsx("span",{style:{gridArea:"1/1"},className:J("transition-transform",s?"scale-100":"scale-0"),children:u.jsx(ni,{size:14})}),u.jsx("span",{style:{gridArea:"1/1"},className:J("transition-transform",s?"scale-0":"scale-100"),children:u.jsx(cc,{size:14})})]})})]}),u.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||u.jsx("span",{className:"text-neutral6 italic",children:"No output"})})]})},bmn=({toolName:e,args:t,result:r,metadata:n,toolCallId:s,toolApprovalMetadata:a,isNetwork:i,toolCalled:o})=>{const l=jn(q=>q.message),c=E.useMemo(()=>l.content.filter(V=>V.type==="data"),[l.content]),[d,p]=E.useState(!1),{isCopied:f,copyToClipboard:h}=V8(),{Link:m}=ur();let g="";try{const q=typeof t=="object"?t:JSON.parse(t);if(e===yL.SANDBOX.EXECUTE_COMMAND){const V=q.command||"",Q=q.args?.join(" ")||"";g=`${V} ${Q}`.trim()}}catch{g=e}const b=c.filter(q=>(q.name==="sandbox-stdout"||q.name==="sandbox-stderr")&&q.data?.toolCallId===s),v=c.find(q=>q.name==="workspace-metadata"&&q.data?.toolCallId===s),w=v?.data,S=c.find(q=>q.name==="sandbox-exit"&&q.data?.toolCallId===s),_=!!S||typeof r=="string",O=!!v,C=O&&!_,T=o??(_||O),A=S?.data?.exitCode,I=S?.data?.success,R=S?.data?.executionTimeMs,P=b.map(q=>q.data?.output||"").join(""),L=typeof r=="string"?r:P,B=e===yL.SANDBOX.EXECUTE_COMMAND?"Execute Command":e,M=b[0]?.data?.timestamp,z=gmn(C,M),H=()=>{!L||f||h(L)};return u.jsxs("div",{className:"mb-4","data-testid":"sandbox-execution-badge",children:[u.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[u.jsxs("button",{onClick:()=>p(q=>!q),className:"flex items-center gap-2 min-w-0",type:"button",children:[u.jsx(Ce,{children:u.jsx(fw,{className:J("transition-all",d?"rotate-90":"rotate-180")})}),u.jsx(Gt,{icon:u.jsx(mLt,{className:"text-accent6",size:16}),children:B}),w?.sandbox&&u.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:q=>q.stopPropagation(),children:[u.jsx("span",{className:J("w-1.5 h-1.5 rounded-full",mmn(w.sandbox.status))}),u.jsx("span",{children:w.sandbox.name||w.sandbox.provider})]})]}),u.jsx("div",{className:"flex items-center gap-2",children:C?u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-accent6",children:[u.jsx("span",{className:"w-1.5 h-1.5 bg-accent6 rounded-full animate-pulse"}),u.jsx("span",{className:"animate-pulse",children:"running"})]}),u.jsxs("span",{className:"text-neutral6 text-xs tabular-nums",children:[z,"ms"]})]}):u.jsxs(u.Fragment,{children:[A!==void 0&&(I?u.jsx(ni,{className:"text-green-400",size:14}):u.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-500/20 text-red-400",children:["exit ",A]})),R!==void 0&&u.jsxs("span",{className:"text-neutral6 text-xs",children:[R,"ms"]})]})})]}),!d&&u.jsxs("div",{className:"pt-2",children:[(L||g)&&u.jsx(ymn,{command:g,content:L,onCopy:L?H:void 0,isCopied:f}),u.jsx($P,{toolCalled:T,toolCallId:s,toolApprovalMetadata:a,toolName:e,isNetwork:i,isGenerateMode:n?.mode==="generate"})]})]})},vmn=({toolName:e,args:t,result:r,toolCallId:n,toolApprovalMetadata:s,isNetwork:a,toolCalled:i})=>{const[o,l]=E.useState(!s),{isCopied:c,copyToClipboard:d}=V8();E.useEffect(()=>{l(!s)},[s]);const{Link:p}=ur();let f={path:"/"};try{f=typeof t=="object"?t:JSON.parse(t)}catch{}const{path:h="/",maxDepth:m,showHidden:g,dirsOnly:b,exclude:v,extension:w}=f,S=[];m!==void 0&&m!==3&&S.push(`depth: ${m}`),g&&S.push("hidden"),b&&S.push("dirs only"),v&&S.push(`exclude: ${v}`),w&&S.push(`ext: ${w}`);let _="",O="";if(typeof r=="string"&&r){const L=r.lastIndexOf(`
|
|
607
607
|
|
|
608
608
|
`);L!==-1?(_=r.slice(0,L),O=r.slice(L+2)):_=r}const C=!!_,T=i??C,A=jn(L=>L.message),R=E.useMemo(()=>A.content.find(B=>B.type==="data"&&B.name==="workspace-metadata"&&B.data?.toolCallId===n),[A.content,n])?.data,P=()=>{!_||c||d(_)};return u.jsxs("div",{className:"mb-4","data-testid":"file-tree-badge",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsxs("button",{onClick:()=>l(L=>!L),className:"flex items-center gap-2 min-w-0",type:"button",children:[u.jsx(Ce,{children:u.jsx(fw,{className:J("transition-all",o?"rotate-90":"rotate-180")})}),u.jsxs(Gt,{icon:u.jsx(B4t,{className:"text-accent6",size:16}),children:["List Files ",u.jsx("span",{className:"text-neutral6 font-normal ml-1",children:h}),S.length>0&&u.jsxs("span",{className:"text-neutral4 font-normal ml-1",children:["(",S.join(", "),")"]})]})]}),R?.filesystem&&u.jsxs(p,{href:R.id?`/workspaces/${R.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:[u.jsx(Xee,{className:"size-3"}),u.jsx("span",{children:R.name||R.filesystem.name})]}),o&&C&&O&&u.jsx("span",{className:"text-neutral6 text-xs",children:O})]}),!o&&u.jsxs("div",{className:"pt-2",children:[s&&!T&&u.jsxs("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Tool arguments"}),u.jsx(mi,{data:f,"data-testid":"tool-args"})]}),u.jsx($P,{toolCalled:T,toolCallId:n,toolApprovalMetadata:s,toolName:e,isNetwork:a})]}),T&&_&&u.jsxs("div",{className:"rounded-md border border-border1 bg-surface2 overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border1 bg-surface3",children:[O&&u.jsx("span",{className:"text-neutral6 text-xs",children:O}),u.jsx(Zi,{variant:"light",size:"sm",tooltip:"Copy tree",onClick:P,disabled:!_,children:u.jsxs("span",{className:"grid",children:[u.jsx("span",{style:{gridArea:"1/1"},className:J("transition-transform",c?"scale-100":"scale-0"),children:u.jsx(ni,{size:14})}),u.jsx("span",{style:{gridArea:"1/1"},className:J("transition-transform",c?"scale-0":"scale-100"),children:u.jsx(cc,{size:14})})]})})]}),u.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:_})]}),T&&!C&&u.jsx("div",{className:"rounded-md border border-border1 bg-surface2 px-3 py-2",children:u.jsx("span",{className:"text-xs text-neutral6",children:"Loading..."})})]})]})};function mae(e){const t={},r=e.context||{};Object.entries(r).forEach(([i,o])=>{if(i!=="input"&&"status"in o){const l=o,c=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:c?void 0:"error"in l?l.error:void 0,tripwire:c?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 Wme=()=>{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}},ma=Die()(Kkr(e=>({requestContext:{},setRequestContext:t=>e({requestContext:t})}),{name:"mastra-playground-store"})),MP=e=>{const t=ht(),{requestContext:r}=ma();return Cr({queryKey:["workflow",e],queryFn:()=>e?t.getWorkflow(e).details(r):null,enabled:!!e,retry:!1,refetchOnWindowFocus:!1,throwOnError:!1})},qJ=20,uvt=(e,{enabled:t=!0}={})=>{const r=ht(),{inView:n,setRef:s}=Wme(),a=w9({queryKey:["workflow-runs",e],queryFn:({pageParam:i})=>r.getWorkflow(e).runs({limit:qJ,offset:i*qJ}),initialPageParam:0,getNextPageParam:(i,o,l)=>{if(!(i.runs.length<qJ))return l+1},select:i=>i.pages.flatMap(o=>o.runs),retry:!1,enabled:t,refetchInterval:5e3,gcTime:0,staleTime:0});return E.useEffect(()=>{n&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[n,a.hasNextPage,a.isFetchingNextPage]),{...a,setEndOfListElement:s}},dvt=(e,t,r)=>{const n=ht();return Cr({queryKey:["workflow-run",e,t],queryFn:()=>n.getWorkflow(e).runById(t),enabled:!!(e&&t),gcTime:0,staleTime:0,refetchInterval:r})},xmn=e=>{const t=ht(),r=Ri();return _n({mutationFn:({runId:n})=>t.getWorkflow(e).deleteRunById(n),onSuccess:()=>{r.invalidateQueries({queryKey:["workflow-runs",e]}),Je.success("Workflow run deleted successfully")},onError:()=>{Je.error("Failed to delete workflow run")}})},pvt=E.createContext(null);function Z8(){const e=E.useContext(pvt);if(!e)throw new Error("useWorkflowStepDetail must be used within WorkflowStepDetailProvider");return e}function wmn({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 u.jsx(pvt.Provider,{value:{stepDetail:t,showMapConfig:n,showNestedGraph:s,closeStepDetail:a},children:e})}function Smn({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 fvt=E.createContext({setSettings:()=>{},resetAll:()=>{},settings:void 0,entityType:void 0}),hvt=({children:e,entityId:t,entityType:r})=>{const n=Smn({entityId:t,entityType:r});return u.jsx(fvt.Provider,{value:n,children:e})},Xme=()=>E.useContext(fvt),bg=E.createContext({});function Yme({children:e,snapshot:t,workflowId:r,initialRunId:n,withoutTimeTravel:s=!1}){const[a,i]=E.useState(()=>t?mae(t):null),[o,l]=E.useState(()=>t?.context?.input??null),[c,d]=E.useState(()=>n??""),[p,f]=E.useState(!1),[h,m]=E.useState(!1),g=p||["success","failed","canceled","bailed"].includes(a?.status??"")?void 0:5e3,{isLoading:b,data:v}=dvt(r,n??"",g),w=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:S,isLoading:_,error:O}=MP(r),{settings:C}=Xme(),T=Qkr(),{streamWorkflow:A,streamResult:I,isStreaming:R,observeWorkflowStream:P,closeStreamsAndReset:L,resumeWorkflowStream:B,timeTravelWorkflowStream:M}=Gkr({debugMode:h,tracingOptions:C?.tracingOptions,onError:q=>Je.error(q.message)}),z=Wkr(),H=()=>{i(null),l(null)};return E.useEffect(()=>{f(!1)},[n]),E.useEffect(()=>{w?.runId&&(i(mae(w)),w.value&&Object.keys(w.value).length>0?l({initialState:w.value,inputData:w.context?.input}):l(w.context?.input),d(w.runId))},[w]),u.jsx(bg.Provider,{value:{workflowId:r,result:a,setResult:i,payload:o,setPayload:l,clearData:H,snapshot:t,runId:c,setRunId:d,workflowError:O??null,workflow:S??void 0,isLoading:_,createWorkflowRun:T.mutateAsync,streamWorkflow:q=>(f(!0),A.mutateAsync(q)),resumeWorkflow:q=>(f(!0),B.mutateAsync(q)),streamResult:I,isStreamingWorkflow:R,isCancellingWorkflowRun:z.isPending,cancelWorkflowRun:z.mutateAsync,observeWorkflowStream:q=>(f(!0),P.mutate(q)),closeStreamsAndReset:L,timeTravelWorkflowStream:q=>(f(!0),M.mutateAsync(q)),runSnapshot:w,isLoadingRunExecutionResult:b,withoutTimeTravel:s,debugMode:h,setDebugMode:m},children:u.jsx(wmn,{children:e})})}function Pr({className:e,...t}){return u.jsx("div",{className:J("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 Emn=e=>e.replace(/[-_\s]+(.)?/g,(r,n)=>n?n.toUpperCase():"").replace(/^(.)/,r=>r.toLowerCase()).replace(/([A-Z])/g," $1").replace(/^./,r=>r.toUpperCase()).trim(),_mn=(e,t,r)=>{if(!e.startsWith("mapping_"))return e;const n=l=>l.split(" ").map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join(" "),s=l=>{const c=l.replace(/Step$/,"").replace(/[-_]/g," ").trim();return n(c)},a=(l,c)=>l.length===0?c?"End":"Start":l.length===1?s(l[0]):`${l.length} Steps`,i=a(t,!1),o=a(r,!0);return`${i} → ${o} Map`},kmn=(e,t)=>{const r=new JPe.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)})),JPe.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}},$f={animated:!0,markerEnd:{type:HI.ArrowClosed,width:20,height:20,color:"#8e8e8e"}},gae=({stepFlow:e,xIndex:t,yIndex:r,prevNodeIds:n,prevStepIds:s,nextStepFlow:a,condition:i,allPrevNodeIds:o})=>{let l=[],c=[];if((a?.type==="step"||a?.type==="foreach"||a?.type==="loop")&&(l=[o?.includes(a.step.id)?`${a.step.id}-${r+1}`:a.step.id],c=[a.step.id]),(a?.type==="sleep"||a?.type==="sleepUntil")&&(l=[o?.includes(a.id)?`${a.id}-${r+1}`:a.id],c=[a.id]),a?.type==="parallel"&&(l=a?.steps.map(d=>{const p=d.step.id;return o?.includes(p)?`${p}-${r+1}`:p})||[],c=a?.steps.map(d=>d.step.id)||[]),a?.type==="conditional"&&(l=a?.serializedConditions.map(d=>d.id)||[],c=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:_mn(e.step.id,s,c),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,g)=>({id:`e${m}-${i.id}`,source:m,data:{previousStepId:s[g],nextStepId:e.step.id},target:i.id,...$f})),{id:`e${i.id}-${p}`,source:i.id,data:{previousStepId:s[s.length-1],nextStepId:e.step.id,conditionNode:!0},target:p,...$f}]:(n||[]).map((m,g)=>({id:`e${m}-${p}`,source:m,data:{previousStepId:s[g],nextStepId:e.step.id},target:p,...$f})),...(l||[]).map((m,g)=>({id:`e${p}-${m}`,source:p,data:{previousStepId:e.step.id,nextStepId:c[g]},target:m,...$f}))];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,...$f})),{id:`e${i.id}-${d}`,source:i.id,data:{previousStepId:s[s.length-1],nextStepId:e.id},target:d,...$f}]:n.map((h,m)=>({id:`e${h}-${d}`,source:h,data:{previousStepId:s[m],nextStepId:e.id},target:d,...$f})):[],...l.length?l.map((h,m)=>({id:`e${d}-${h}`,source:d,data:{previousStepId:e.id,nextStepId:c[m]},target:h,...$f})):[]];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:c[0],withoutTopHandle:!1,withoutBottomHandle:!l.length,isLarge:!0,conditions:[{type:f,fnString:p.fn}]}}],g=[...n.length?n.map((b,v)=>({id:`e${b}-${d.id}`,source:b,data:{previousStepId:s[v],nextStepId:d.id},target:d.id,...$f})):[],{id:`e${d.id}-${p.id}`,source:d.id,data:{previousStepId:d.id,nextStepId:c[0]},target:p.id,...$f},...l.length?l.map((b,v)=>({id:`e${p.id}-${b}`,source:p.id,data:{previousStepId:d.id,nextStepId:c[v]},target:b,...$f})):[]];return{nodes:m,edges:g,nextPrevNodeIds:[p.id],nextPrevStepIds:[d.id]}}if(e.type==="parallel"){let d=[],p=[],f=[];return e.steps.forEach((h,m)=>{const{nodes:g,edges:b,nextPrevStepIds:v}=gae({stepFlow:h,xIndex:m,yIndex:r,prevNodeIds:n,prevStepIds:s,nextStepFlow:a,allPrevNodeIds:o}),w=g.map(S=>({...S,data:{...S.data,isParallel:!0}}));d.push(...w),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:g,edges:b,nextPrevStepIds:v}=gae({stepFlow:h,xIndex:m,yIndex:r,prevNodeIds:n,prevStepIds:s,nextStepFlow:a,condition:e.serializedConditions[m],allPrevNodeIds:o});d.push(...g),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:[]}},mvt=({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:c,edges:d,nextPrevNodeIds:p,nextPrevStepIds:f}=gae({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(...c),r.push(...d),n=p,s=f,a.push(...n)}const{nodes:i,edges:o}=kmn(t,r);return{nodes:i,edges:o}},DO=w2r,Ww=Ee.forwardRef(({className:e,children:t,...r},n)=>u.jsx(bpe,{ref:n,className:J("-outline-offset-2",Jr.colors,Qw.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...r,children:t}));Ww.displayName=bpe.displayName;const Xw=Ee.forwardRef(({className:e,children:t,...r},n)=>u.jsx(xpe,{ref:n,className:J("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}));Xw.displayName=xpe.displayName;const po={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"},Xo={sleep:J3,sleepUntil:p3t,forEach:I_,map:I_,parallel:tZe,suspend:UHe,after:Gle,workflow:c5t,when:XHe,dountil:Q5t,dowhile:X5t,until:J3,while:IR,if:QHe,else:u4t},T5e=e=>{switch(e){case"when":return{icon:Xo.when,color:po.when};case"dountil":return{icon:Xo.dountil,color:po.dountil};case"dowhile":return{icon:Xo.dowhile,color:po.dowhile};case"until":return{icon:Xo.until,color:po.until};case"while":return{icon:Xo.while,color:po.while};case"if":return{icon:Xo.if,color:po.if};case"else":return{icon:Xo.else,color:po.else};default:return{icon:void 0,color:void 0}}},gvt=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}},yvt=(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,c=o.scrollHeight;l>=c-1?r.current=!0:r.current=!1};return n.addEventListener("scroll",a),()=>{n.removeEventListener("scroll",a),s.disconnect()}},[t,e])},Di=E.forwardRef(({className:e,children:t,viewPortClassName:r,maxHeight:n,autoScroll:s=!1,...a},i)=>{const o=E.useRef(null);return yvt(o,{enabled:s}),u.jsxs(sit,{ref:i,className:J("relative overflow-hidden",e),...a,children:[u.jsx(R2r,{ref:o,className:J("h-full w-full rounded-[inherit] [&>div]:!block",r),style:n?{maxHeight:n}:void 0,children:t}),u.jsx(bvt,{}),u.jsx(P2r,{})]})});Di.displayName=sit.displayName;const bvt=E.forwardRef(({className:e,orientation:t="vertical",...r},n)=>u.jsx(Epe,{ref:n,orientation:t,className:J("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:u.jsx(Jat,{className:"relative flex-1 rounded-full bg-neutral2 hover:bg-neutral3 transition-colors duration-normal"})}));bvt.displayName=Epe.displayName;const LP=()=>{const e=E.useContext(bg),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}},hE=({data:e,language:t="auto"})=>{const r=Ux(),n=i=>{if(t==="javascript")return[C4(),gt.lineWrapping];if(t==="json")return[Nd,gt.lineWrapping];try{return JSON.parse(i),[Nd,gt.lineWrapping]}catch{return i.includes("=>")||i.includes("function")||i.includes("const ")||i.includes("return ")?[C4(),gt.lineWrapping]:[gt.lineWrapping]}};if(typeof e!="string"){const i=JSON.stringify(e,null,2);return u.jsxs("div",{className:"max-h-[500px] overflow-auto relative",children:[u.jsx("div",{className:"absolute right-2 top-2 bg-surface4 rounded-full z-10",children:u.jsx(oc,{content:i})}),u.jsx("div",{className:"bg-surface4 rounded-lg p-4",children:u.jsx(Ld,{value:i,theme:r,extensions:[Nd,gt.lineWrapping]})})]})}const s=n(e);let a=e;try{const i=JSON.parse(e);a=JSON.stringify(i,null,2)}catch{}return u.jsxs("div",{className:"max-h-[500px] overflow-auto relative",children:[u.jsx("div",{className:"absolute right-2 top-2 bg-surface4 rounded-full z-10",children:u.jsx(oc,{content:e})}),u.jsx("div",{className:"bg-surface4 rounded-lg p-4",children:u.jsx(Ld,{value:a,theme:r,extensions:s})})]})},Omn=Ee.forwardRef(({children:e,...t},r)=>u.jsx("form",{ref:r,className:"space-y-4",...t,children:e})),Cmn=["boolean","object","array"],Tmn=({label:e,children:t,id:r,field:n,error:s})=>{const a=Cmn.includes(n.type);return u.jsxs("div",{className:"pb-4 last:pb-0",children:[!a&&u.jsxs(We,{as:"label",variant:"ui-sm",className:"text-neutral3 pb-1 block",htmlFor:r,children:[e,n.required&&u.jsx("span",{className:"text-accent2",children:" *"})]}),t,n.fieldConfig?.description&&u.jsx(We,{as:"p",variant:"ui-sm",className:"text-neutral6",children:n.fieldConfig.description}),s&&u.jsx(We,{as:"p",variant:"ui-sm",className:"text-accent2",children:s})]})},Amn=({error:e})=>u.jsx(uh,{variant:"destructive",children:u.jsx(dh,{children:e})}),Dmn=({children:e})=>u.jsx(Se,{type:"submit",children:e}),A5e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,D5e=Lbt,Kme=(e,t)=>r=>{var n;if(t?.variants==null)return D5e(e,r?.class,r?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(c=>{const d=r?.[c],p=a?.[c];if(d===null)return null;const f=A5e(d)||A5e(p);return s[c][f]}),o=r&&Object.entries(r).reduce((c,d)=>{let[p,f]=d;return f===void 0||(c[p]=f),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:p,className:f,...h}=d;return Object.entries(h).every(m=>{let[g,b]=m;return Array.isArray(b)?b.includes({...a,...o}[g]):{...a,...o}[g]===b})?[...c,p,f]:c},[]);return D5e(e,i,l,r?.class,r?.className)},Imn=Kme(J("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",PP,$h),{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:`${fi.sm} px-2 text-ui-sm`,md:`${fi.md} px-3 text-ui-sm`,lg:`${fi.lg} px-4 text-ui-sm`}},defaultVariants:{variant:"default",size:"md"}}),tn=E.forwardRef(({className:e,size:t,testId:r,variant:n,type:s,error:a,...i},o)=>u.jsx("input",{type:s,className:J(Imn({variant:n,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:o,"aria-invalid":a,...i}));tn.displayName="Input";const Nmn=({inputProps:e,error:t,field:r,id:n})=>{const{key:s,...a}=e;return u.jsx(tn,{id:n,className:t?"border-accent2":"",...a,defaultValue:r.default})},Rmn=({inputProps:e,error:t,field:r,id:n})=>{const{key:s,...a}=e;return u.jsx(tn,{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}})}})},Wd=E.forwardRef(({className:e,...t},r)=>u.jsx(Cpe,{ref:r,className:J("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",Jr.all,"hover:border-neutral5 hover:shadow-md",$h,"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:u.jsx(lit,{className:J("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:u.jsx(ni,{className:"h-3.5 w-3.5 stroke-[3]"})})}));Wd.displayName=Cpe.displayName;const Pmn=({field:e,label:t,id:r,inputProps:n,value:s})=>u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(Wd,{id:r,onCheckedChange:a=>{const i={target:{name:n.name,value:a}};n.onChange(i)},defaultChecked:e.default,disabled:n.disabled||n.readOnly}),u.jsxs(We,{as:"label",variant:"ui-sm",className:"text-neutral3",htmlFor:r,children:[t,e.required&&u.jsx("span",{className:"text-accent2",children:" *"})]})]});function vvt({className:e,classNames:t,showOutsideDays:r=!0,...n}){return u.jsx(OMr,{showOutsideDays:r,className:J("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:J("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_next:J("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:J("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 xvt=Q$t,wvt=W$t,Jme=E.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>u.jsx(X$t,{children:u.jsx(iHe,{ref:s,align:t,sideOffset:r,className:J("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})}));Jme.displayName=iHe.displayName;const Ko=KMr,Jo=JMr,jmn={sm:`${fi.sm} px-2 text-ui-sm`,md:`${fi.md} px-3 text-ui-sm`,lg:`${fi.lg} px-3 text-ui-sm`,default:`${fi.default} text-ui-md`},jo=E.forwardRef(({className:e,children:t,size:r="md",variant:n="default",...s},a)=>{const i=["experimental"].includes(n);return u.jsxs(rot,{ref:a,className:J("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":PP,i?"":$h,Jr.all,i?"":"hover:border-neutral2",jmn[r],e),...s,children:[t,u.jsx(e3r,{asChild:!0,children:u.jsx(Ua,{className:J("h-4 w-4 text-neutral3",Jr.colors)})})]})});jo.displayName=rot.displayName;const $o=E.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>u.jsx(t3r,{children:u.jsx(not,{ref:s,className:J("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:u.jsx(r3r,{className:J("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));$o.displayName=not.displayName;const Zs=E.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(sot,{ref:n,className:J("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",Jr.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:[u.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(s3r,{children:u.jsx(ni,{className:"h-4 w-4 text-accent1"})})}),u.jsx(n3r,{children:t})]}));Zs.displayName=sot.displayName;function HJ({name:e,onChange:t,value:r,options:n,placeholder:s}){return u.jsxs(Ko,{name:e,onValueChange:t,value:r,children:[u.jsx(jo,{children:u.jsx(Jo,{placeholder:s||"Select..."})}),u.jsx($o,{children:(n||[]).map((a,i)=>u.jsx(Zs,{value:`${i}`,children:u.jsx("div",{className:"flex items-center gap-2 [&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:text-neutral3",children:a})},a))})]})}const ZJ=["12","1","2","3","4","5","6","7","8","9","10","11"],oM=["00","15","30","45","59"],lM=["AM","PM"];function $mn({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 g=parseInt(h[2],10),b=h[3]?.toUpperCase();m>=1&&m<=12&&g>=0&&g<=59&&(s(m.toString()),i(g===0?"00":g.toString()),l(b||"AM"))}}},[e]);const c=f=>{s(f),t(`${ZJ[+f]}:${a} ${o}`.trim())},d=f=>{i(oM[+f]),t(`${n}:${oM[+f]} ${o}`.trim())},p=f=>{l(lM[+f]),t(`${n}:${a} ${lM[+f]}`.trim())};return u.jsxs("div",{className:J("flex gap-2 items-center",r),children:[u.jsx(HJ,{name:"hour",value:ZJ.indexOf(n).toString(),onChange:c,options:ZJ}),":",u.jsx(HJ,{name:"minute",value:oM.indexOf(a).toString(),onChange:d,options:oM}),u.jsx(HJ,{name:"period",value:lM.indexOf(o).toString(),onChange:p,options:lM})]})}const Mmn={sm:`${fi.sm} px-2`,md:`${fi.md} px-3`,lg:`${fi.lg} px-3 py-2`,default:`${fi.default} px-3`};function My({name:e,value:t,label:r,labelIsHidden:n=!1,className:s,testId:a,required:i,disabled:o,helpMsg:l,error:c,errorMsg:d,size:p="lg",variant:f="default",...h}){const m=({children:b})=>n?u.jsx(Jp,{children:b}):b,g=f==="experimental";return u.jsxs("div",{className:J("grid gap-2 text-neutral4",{"grid-rows-[auto_1fr]":!n&&!l,"grid-rows-[auto_1fr_auto]":!n&&l},s),children:[u.jsx(m,{children:u.jsxs("label",{htmlFor:`input-${e}`,className:J("text-ui-sm text-neutral3 flex justify-between items-center"),children:[r,i&&u.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}),u.jsx("input",{id:`input-${e}`,name:e,value:t,autoComplete:"off",className:J("flex grow items-center cursor-pointer text-ui-md leading-none",Mmn[p],g?"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",g?"focus-visible:outline-none":$h,g?"":PP,g?"placeholder:text-neutral2":"placeholder:text-neutral3 placeholder:text-ui-sm",{"cursor-not-allowed opacity-50":o,"border-red-800 focus:border-border1":!g&&(c||d)}),"data-testid":a,...h}),l&&u.jsx("p",{className:"text-neutral3 text-ui-sm",children:l}),d&&u.jsxs("p",{className:J("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:[u.jsx(Iu,{})," ",d]})]})}function LN({onReset:e,variant:t,...r}){return u.jsxs("div",{className:J("relative group"),children:[u.jsx(My,{labelIsHidden:!0,...r,className:J("[&>input]:pl-10 relative",{}),variant:t}),u.jsx(Ox,{"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&&u.jsx(u.Fragment,{children:t==="experimental"?u.jsx(Se,{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:u.jsx(Oa,{})}):u.jsx("button",{type:"button",onClick:e,className:J("absolute top-1/2 right-2 -translate-y-1/2 p-1 rounded",Jr.all,"hover:bg-surface4","[&>svg]:transition-colors [&>svg]:duration-normal","[&:hover>svg]:text-neutral5"),children:u.jsx(Oa,{className:"text-neutral3 w-[1rem] h-[1rem]"})})})]})}function Fl({name:e,value:t,label:r,labelIsHidden:n=!1,className:s,required:a,disabled:i,helpMsg:o,options:l,onValueChange:c,placeholder:d="Select an option",size:p="lg",variant:f="default"}){const h=({children:m})=>n?u.jsx(Jp,{children:m}):m;return u.jsxs("div",{className:J("flex gap-2 items-center",{"grid-rows-[auto_1fr]":r,"grid-rows-[auto_1fr_auto]":o},s),children:[u.jsx(h,{children:u.jsxs("label",{className:J("text-ui-sm text-neutral3 flex justify-between items-center shrink-0"),children:[r,a&&u.jsx("i",{className:"text-neutral2",children:"(required)"})]})}),u.jsxs(Ko,{name:e,value:t,onValueChange:c,disabled:i,children:[u.jsx(jo,{id:`select-${e}`,size:p,variant:f,className:"grid grid-cols-[1fr_auto] [&>span]:truncate",children:u.jsx(Jo,{placeholder:d})}),u.jsx($o,{children:l.map(m=>u.jsx(Zs,{value:m.value,disabled:m.disabled,children:u.jsxs("span",{className:"whitespace-nowrap truncate flex items-center gap-2",children:[m.icon,m.label]})},m.label))})]}),o&&u.jsx("p",{className:"text-neutral3 text-ui-sm",children:o})]})}const I5e=({value:e,minValue:t,maxValue:r,defaultTimeStrValue:n,onValueChange:s,children:a,className:i,placeholder:o,...l})=>{const[c,d]=E.useState(!1);return u.jsxs(xvt,{open:c,onOpenChange:d,children:[u.jsx(wvt,{asChild:!0,children:a||u.jsx(Fmn,{value:e,placeholder:o,className:i,"data-testid":"datepicker-button"})}),u.jsx(Jme,{className:"backdrop-blur-4xl w-auto !p-0 bg-surface4 max-w-[16.5rem]",align:"start","data-testid":"datepicker-calendar",children:u.jsx(Lmn,{value:e,minValue:t,maxValue:r,onValueChange:s,setOpenPopover:d,defaultTimeStrValue:n,...l})})]})};function cM({date:e,timeStr:t=""}){if(!yv(e))return null;if(t){const r=kn(e,"yyyy-MM-dd"),n=new Date(`${r} ${t}`);if(yv(n))return n}return e}const Lmn=({value:e,minValue:t,maxValue:r,onValueChange:n,setOpenPopover:s,placeholder:a,className:i,defaultTimeStrValue:o,...l})=>{const[c,d]=E.useState(null),[p,f]=E.useState(e?kn(cM({date:e,timeStr:o})||"","PP p"):""),[h,m]=E.useState(o||""),[g,b]=E.useState(e?new Date(e):void 0),v=uP(B=>{yv(B)&&(b(B),n?.(B),s?.(!1))},500),w=B=>{f(B.currentTarget.value);const M=new Date(B.currentTarget.value);v(M)},S=B=>{yv(B)?r&&B>r?(d(`The selected date should be before ${kn(r,"PP p")}`),f("")):t&&B<t?(d(`The selected date should be after ${kn(t,"PP p")}`),f("")):(f(kn(B,"PP p")),d("")):(f(""),d(""))},_=new Date(p),O=yv(_),C=O&&_.getTime()!==e?.getTime(),T=B=>{if(b(B),B){const M=cM({date:B,timeStr:h});S(M||"")}else S("")},A=B=>{if(b(B),B){const M=cM({date:B,timeStr:h});S(M||"")}else S("")},I=B=>{if(m(B),O){const M=cM({date:_,timeStr:B});S(M||"")}},R=()=>{s?.(!1)},P=()=>{yv(_)&&n(_),s?.(!1)},L=()=>{n(void 0),b(void 0),f(""),m(""),s?.(!1)};return u.jsxs("div",{"aria-label":"Choose date",className:J("relative flex flex-col",i),onKeyDown:B=>{B.stopPropagation(),B.key==="Escape"&&s?.(!1)},children:[u.jsx(My,{type:"text",value:p,onChange:w,placeholder:a,className:"m-4 mb-0 !w-auto"}),c&&u.jsxs("div",{className:J("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:[u.jsx(Am,{})," ",c]}),u.jsx(vvt,{mode:"single",month:g,selected:g,onMonthChange:A,onSelect:T,...l}),u.jsx($mn,{onValueChange:I,className:"m-4 mt-0 w-auto",defaultValue:e?kn(new Date(e),"hh:mm a"):o}),u.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-2 m-4 mt-0",children:[u.jsx(Se,{variant:"light",size:"lg",tabIndex:0,onClick:()=>{O?P():R()},children:C?"Apply":"Cancel"}),C&&u.jsx(Se,{tabIndex:0,onClick:L,children:"Clear"})]})]})},Fmn=E.forwardRef(({value:e,placeholder:t,className:r,...n},s)=>u.jsxs(Se,{ref:s,className:J("justify-start",r),variant:"light",size:"lg",...n,children:[u.jsx(RHe,{className:"h-4 w-4"}),e?u.jsx("span",{className:"text-white",children:kn(e,"PP p")}):u.jsx("span",{className:"text-gray",children:t??"Pick a date"})]})),Bmn=({inputProps:e,field:t,error:r,id:n})=>{const{key:s,...a}=e,[i,o]=E.useState(void 0),[l,c]=E.useState(!1);E.useEffect(()=>{if(t.default){const f=new Date(t.default);yv(f)&&o(f)}},[t]);const d=f=>{o(f),f&&a.onChange({target:{value:f.toISOString(),name:e.name}}),c(!1)},p=()=>{o(void 0),a.onChange({target:{value:"",name:e.name}}),c(!1)};return u.jsxs(xvt,{open:l,onOpenChange:c,children:[u.jsx(wvt,{asChild:!0,children:u.jsxs(Se,{id:n,variant:"light",size:"lg",className:J("w-full",r?"border-accent2":""),children:[u.jsx(RHe,{className:"h-4 w-4"}),i?u.jsx("span",{className:"text-white",children:kn(i,"PPP")}):u.jsx("span",{className:"text-gray",children:"Pick a date"})]})}),u.jsxs(Jme,{className:"w-auto p-0 bg-surface4",align:"start",children:[u.jsx(vvt,{mode:"single",selected:i,onSelect:d,month:i,onMonthChange:o}),i&&u.jsx("div",{className:"p-3 pt-0",children:u.jsx(Se,{variant:"light",size:"lg",className:"w-full",onClick:p,children:"Clear"})})]})]})},zmn=({field:e,inputProps:t,error:r,id:n,value:s})=>{const{key:a,...i}=t;return u.jsxs(Ko,{...i,value:s,onValueChange:o=>{const l={target:{value:o,name:t.name}};i.onChange(l)},children:[u.jsx(jo,{id:n,className:r?"border-accent2":"",children:u.jsx(Jo,{placeholder:"Select an option"})}),u.jsx($o,{children:(e.options||[]).map(([o,l])=>u.jsx(Zs,{value:o,children:l},o))})]})},Umn=({label:e,children:t})=>{const r=e!==""&&e!=="",[n,s]=E.useState(!1);return u.jsxs("div",{className:"",children:[u.jsxs("div",{className:"flex items-center",children:[r&&u.jsxs(We,{as:"h3",variant:"ui-sm",className:"text-neutral3 flex items-center gap-1 pb-2",children:[u.jsx(Ce,{size:"sm",children:u.jsx(Kp,{})}),e]}),u.jsx(Se,{onClick:()=>s(!n),type:"button",className:"ml-auto",children:u.jsx(Ce,{size:"sm",children:u.jsx(Ua,{className:J("transition-all",n?"rotate-180":"rotate-0")})})})]}),n&&u.jsx("div",{className:r?"flex flex-col gap-1 [&>*]:border-dashed [&>*]:border-l [&>*]:border-l-border1 [&>*]:pl-4":"",children:t})]})},Vmn=({label:e,children:t,onAddItem:r})=>u.jsxs("div",{children:[u.jsxs("div",{className:"flex gap-2 justify-between",children:[u.jsxs(We,{as:"h3",variant:"ui-sm",className:"text-neutral3 pb-2 flex items-center gap-1",children:[u.jsx(Ce,{size:"sm",children:u.jsx(o3t,{})}),e]}),u.jsx(gc,{children:u.jsxs(Yn,{delayDuration:0,children:[u.jsx(Kn,{asChild:!0,children:u.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:u.jsx(Ce,{size:"sm",children:u.jsx(si,{})})})}),u.jsx(Vn,{children:"Add item"})]})})]}),u.jsx("div",{className:"flex flex-col gap-1",children:t})]}),qmn=({children:e,onRemove:t})=>u.jsxs("div",{className:"pl-4 border-l border-border1",children:[e,u.jsxs(Se,{onClick:t,type:"button",children:[u.jsx(Ce,{size:"sm",children:u.jsx(rce,{})}),"Delete"]})]}),Hmn=({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,g])=>({id:m||Ao(),key:m,value:g})));E.useEffect(()=>{o.length===0&&l([{id:Ao(),key:"",value:""}])},[o]);const c=E.useCallback(m=>{const g=m.reduce((b,v)=>(v.key&&(b[v.key]=v.value),b),{});a?.({target:{value:g,name:e.name}})},[a,e.name]),d=(m,g,b)=>{l(v=>v.map(w=>w.id===m?{...w,[g]:b}:w))},p=()=>{c(o)},f=()=>{const m=[...o,{id:Ao(),key:"",value:""}];l(m),c(m)},h=m=>{const g=o.filter(b=>b.id!==m);g.length===0&&g.push({id:Ao(),key:"",value:""}),l(g),c(g)};return u.jsxs("div",{className:"space-y-3",children:[o.map(m=>u.jsxs("div",{className:"relative space-y-2 rounded-lg border p-4",children:[u.jsx(Se,{type:"button",className:"absolute right-2 top-2",onClick:()=>h(m.id),children:u.jsx(rce,{className:"h-4 w-4"})}),u.jsxs("div",{className:"space-y-2 pt-6",children:[u.jsx(tn,{placeholder:"Key",value:m.key,onChange:g=>d(m.id,"key",g.target.value),onBlur:p}),u.jsx(tn,{placeholder:"Value",value:m.value,onChange:g=>d(m.id,"value",g.target.value),onBlur:p})]})]},m.id)),u.jsxs(Se,{type:"button",className:"w-full",onClick:f,children:[u.jsx(si,{className:"mr-2 h-4 w-4"}),"Add Key-Value Pair"]})]})},Zmn=({field:e,path:t})=>{const{uiComponents:r}=Qpe();return u.jsx(r.ObjectWrapper,{label:I5(e),field:e,children:Object.entries(e.schema).map(([n,s])=>u.jsx(h1,{field:s,path:[...t,s.key]},`${t.join(".")}.${s.key}`))})},Gmn=({field:e,path:t})=>{const{uiComponents:r}=Qpe(),{control:n}=Tw(),{fields:s,append:a,remove:i}=k3r({control:n,name:t.join(".")}),o=e.schema?.[0]?.type;let l;return o==="object"?l={}:o==="array"?l=[]:l=null,u.jsx(r.ArrayWrapper,{label:I5(e),field:e,onAddItem:()=>a(l),children:s.map((c,d)=>u.jsx(r.ArrayElementWrapper,{onRemove:()=>i(d),index:d,children:u.jsx(h1,{field:e.schema[0],path:[...t,d.toString()]})},c.id))})},h1=({field:e,path:t})=>{const{formComponents:r,uiComponents:n}=Qpe(),{register:s,formState:{errors:a},getValues:i}=Tw(),o=t.join("."),l=s4r(a,t)?.message,c=i(o),d=e.fieldConfig?.fieldWrapper||n.FieldWrapper;let p=()=>u.jsx(n.ErrorMessage,{error:`[AutoForm Configuration Error] No component found for type "${e.type}" nor a fallback`});return e.type==="array"?p=Gmn:e.type==="object"?p=Zmn:e.type in r?p=r[e.type]:"fallback"in r&&(p=r.fallback),u.jsx(d,{label:I5(e),error:l,id:o,field:e,children:u.jsx(p,{label:I5(e),field:e,value:c,error:l,id:o,path:t,inputProps:{required:e.required,error:l,key:`${o}-input`,...e.fieldConfig?.inputProps,...s(o)}},o)})},Qmn=({field:e,inputProps:t})=>{const r=t.name?.split(".")??[];return e.schema?.map((n,s)=>u.jsxs("div",{children:[u.jsx(h1,{field:n,path:r},r.join(".")),s<(e.schema?.length??0)-1&&u.jsx(We,{variant:"ui-xs",className:"text-center",children:"OR"})]},n.key))},Wmn=({field:e,path:t})=>{const{watch:r}=Tw(),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(g=>[g,g]);return f.options?.push(...m),f},{key:o.key,required:o.required,type:"select",default:o.default,description:o.description,options:[],fieldConfig:o.fieldConfig}),c=e.schema?.reduce((f,h)=>{const m=h.schema?.find(v=>v.fieldConfig?.customData?.isLiteral),g=m?.fieldConfig?.customData?.literalValues?.[0],b=h.schema?.filter(v=>v.key!==m?.key)??[];return g&&(f[g]=b),f},{}),d=e.schema?.filter(f=>!f.schema?.find(m=>m.fieldConfig?.customData?.isLiteral)),p=s?.[l.key];return u.jsxs("div",{children:[u.jsx(h1,{field:l,path:[...t,l.key]},`${n}.${l.key}`),p&&c?.[p]&&c[p].map(f=>u.jsx(h1,{field:f,path:[...t,f.key]},`${n}.${f.key}`)),d&&d.map(f=>u.jsx(h1,{field:f,path:[...t,f.key]},`${n}.${f.key}`))]},e.key)};function bL(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=bL(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=bL(n);Object.keys(s).length>0&&(t[r]=s)}else t[r]=n}return t}function Km(e){return Function("z",`"use strict";return (${e});`)(vD)}function Xmn({schema:e,onSubmit:t=()=>{},defaultValues:r,values:n,children:s,uiComponents:a,formComponents:i,withSubmit:o=!1,onFormInit:l=()=>{},formProps:c={}}){const d=E.useMemo(()=>C3r(e),[e]),p=Q9({defaultValues:{...T3r(e),...r},values:n});E.useEffect(()=>{l&&l(p)},[l,p]);const f=E.useCallback(async m=>{const g=bL(m),b=e.validateSchema(g);if(b.success)await t(b.data,p);else{p.clearErrors();let v=!1;b.errors?.forEach(w=>{const S=w.path.join(".");p.setError(S,{type:"custom",message:w.message},{shouldFocus:!v}),v=!0;const _=w.path?.slice?.(0,-1);_?.length>0&&p.setError(_.join("."),{type:"custom",message:w.message})})}},[e,t,p]),h=E.useMemo(()=>({schema:d,uiComponents:a,formComponents:i}),[d,a,i]);return u.jsx(o3r,{...p,children:u.jsx(M3r,{value:h,children:u.jsxs(a.Form,{onSubmit:p.handleSubmit(f),...c,children:[d.fields.map(m=>u.jsx(h1,{field:m,path:[m.key]},m.key)),s,o&&u.jsx(a.SubmitButton,{children:"Submit"})]})})})}const Ymn={Form:Omn,FieldWrapper:Tmn,ErrorMessage:Amn,SubmitButton:Dmn,ObjectWrapper:Umn,ArrayWrapper:Vmn,ArrayElementWrapper:qmn};function Kmn({uiComponents:e,formComponents:t,readOnly:r,...n}){const s=E.useMemo(()=>({...Ymn,...e}),[e]),a=E.useMemo(()=>{const i=o=>r===void 0?o:{...o,readOnly:r};return{string:o=>u.jsx(Nmn,{...o,inputProps:i(o.inputProps)}),number:o=>u.jsx(Rmn,{...o,inputProps:i(o.inputProps)}),boolean:o=>u.jsx(Pmn,{...o,inputProps:i(o.inputProps)}),date:o=>u.jsx(Bmn,{...o,inputProps:i(o.inputProps)}),select:o=>u.jsx(zmn,{...o,inputProps:i(o.inputProps)}),record:o=>u.jsx(Hmn,{...o,inputProps:i(o.inputProps)}),union:o=>u.jsx(Qmn,{...o,inputProps:i(o.inputProps)}),"discriminated-union":o=>u.jsx(Wmn,{...o,inputProps:i(o.inputProps)}),...t}},[r,t]);return u.jsx(Xmn,{...n,uiComponents:s,formComponents:a})}const Jmn=Kme("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Zt=E.forwardRef(({className:e,...t},r)=>u.jsx(Pot,{ref:r,className:J(Jmn(),e),...t}));Zt.displayName=Pot.displayName;function egn(e,t){if(t?.fieldType)return t.fieldType;if(e instanceof Oh||e instanceof Qk)return"object";if(e instanceof nw)return"number";if(e instanceof aw)return"boolean";if(e instanceof rw)return(e._zod.def.checks||[]).some(s=>s._zod.def.check==="string_format"&&s._zod.def.format==="datetime")?"date":"string";if(e instanceof qv||e instanceof Vne)return"select";if(e instanceof iw)return"array";if(e instanceof Wk)return"record";if(e instanceof ow)return e._zod.def.options.every(s=>"shape"in s._zod.def?Object.values(s._zod.def.shape).some(a=>a instanceof C_):!1)?"discriminated-union":"union";if(e instanceof UF)return"discriminated-union";if(e instanceof C_){const r=e._zod?.def?.values,n=e._def?.value,s=r!==void 0?Array.isArray(r)?r[0]:r:n;return typeof s=="number"?"number":typeof s=="boolean"?"boolean":"string"}return"string"}function tD(e){if(e instanceof vD.core.$ZodDefault)return e._zod.def.defaultValue;if(e instanceof vD.core.$ZodLiteral){const t=e._zod.def.values;return Array.isArray(t)?t[0]:t}else{if("innerType"in e._zod.def)return tD(e._zod.def.innerType);if("shape"in e._zod.def)return _3(e);if("left"in e._zod.def&&"right"in e._zod.def){const t=e._zod.def.left,r=e._zod.def.right,n="shape"in t?_3(t):tD(t),s="shape"in r?_3(r):tD(r);return{...n,...s}}}}function _3(e){const t=e._zod.def.shape,r={};for(const[n,s]of Object.entries(t)){const a=tD(s);a!==void 0&&(r[n]=a)}return r}function Yb(e,t){const r=yae(t),n=$ot(t);let s=egn(r,n);const a=tD(t),i=r._zod.def?.entries;let o=[];i&&(Array.isArray(i)?o=i.map(p=>[p,p]):o=Object.entries(i));let l=[];if((r instanceof _o||r instanceof Oh)&&(l=Object.entries(r.shape).map(([p,f])=>Yb(p,f))),(r instanceof tN||r instanceof ow)&&(l=Object.entries(r.def.options).map(([p,f])=>Yb(p,f))),r instanceof rN||r instanceof Qk){const p="left"in r.def?r.def.left:null,f="right"in r.def?r.def.right:null;let h=[],m=[];if(p)if("shape"in p&&p.shape)m=Object.entries(p.shape).map(([g,b])=>Yb(g,b));else{const g=Yb(e,p);m=g.schema??[g],s=g.type}if(f)if("shape"in f&&f.shape)h=Object.entries(f.shape).map(([g,b])=>Yb(g,b));else{const g=Yb(e,f);h=g.schema??[g],s=g.type}l=[...m,...h]}(r instanceof oh||r instanceof iw)&&(l=[Yb("0",r._zod.def.element)]);const c=r instanceof C_,d=c?r._zod.def.values:void 0;return{key:e,type:s,required:!t.optional(),default:a,description:r.description,fieldConfig:c||Object.keys(n??{})?.length>0?{...n,customData:{...n?.customData??{},...c?{isLiteral:c,literalValues:d}:{}}}:void 0,options:o,schema:l}}function yae(e){return"innerType"in e._zod.def?yae(e._zod.def.innerType):"schema"in e._zod.def?yae(e._zod.def.schema):e}function tgn(e){const t=e.shape;return{fields:Object.entries(t).map(([n,s])=>Yb(n,s))}}class rgn extends u4r{_schema;constructor(t){super(t),this._schema=t}getDefaultValues(){return _3(this._schema)}validateSchema(t){const r=bL(t);try{const n=this._schema.safeParse(r);return n.success?{success:!0,data:n.data}:{success:!1,errors:n.error.issues.map(s=>({path:s.path,message:s.message}))}}catch(n){throw n}}parseSchema(){return tgn(this._schema)}}function bae(e){return e instanceof Oh?Object.keys(e.shape).length===0:e instanceof Qk?bae(e._def.left)||bae(e._def.right):!1}function ege({schema:e,onSubmit:t,onValuesChange:r,defaultValues:n,isSubmitLoading:s,submitButtonLabel:a,className:i,readOnly:o,children:l}){const c=E.useRef(null),d=!(e instanceof Oh),p=E.useRef(r);E.useEffect(()=>{p.current=r},[r]),E.useEffect(()=>()=>{c.current?.unsubscribe()},[]);const f=E.useCallback(S=>{c.current?.unsubscribe(),p.current&&(c.current=S.watch(_=>{const O=d?_&&Object.prototype.hasOwnProperty.call(_,"")?_[""]:{}:_;p.current?.(O)}))},[d]),h=E.useMemo(()=>{if(!e)return null;const S=_=>bae(_)?vD.object({}):d?vD.object({"":_}):_;return new rgn(S(e))},[e,d]),m=E.useMemo(()=>({SubmitButton:({children:S})=>t?u.jsx(Se,{variant:"light",className:"w-full",size:"md",disabled:s,children:s?u.jsx(Ce,{children:u.jsx(qi,{className:"animate-spin"})}):a||S}):null}),[t,s,a]),g=E.useMemo(()=>({Label:({value:S})=>u.jsx(Zt,{className:"text-sm font-normal",children:S})}),[]),b=E.useMemo(()=>({className:i,noValidate:!0}),[i]),v=E.useMemo(()=>d?n===void 0?void 0:{"":n}:n,[d,n]),w=E.useCallback(async S=>{const _=d?S&&Object.prototype.hasOwnProperty.call(S,"")?S[""]:{}:S;await t?.(_)},[t,d]);return h?u.jsx(Kmn,{schema:h,onSubmit:w,onFormInit:f,defaultValues:v,formProps:b,uiComponents:m,formComponents:g,withSubmit:!0,readOnly:o,children:l}):(console.error("no form schema found"),null)}const FP=E.forwardRef(({className:e,...t},r)=>u.jsx(Jot,{className:J("grid gap-2",e),...t,ref:r}));FP.displayName=Jot.displayName;const Cd=E.forwardRef(({className:e,...t},r)=>u.jsx(elt,{ref:r,className:J("aspect-square h-4 w-4 rounded-full border border-neutral3 text-neutral6","shadow-sm",Jr.all,"hover:border-neutral5 hover:shadow-md",$h,"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:u.jsx(Z4r,{className:J("flex items-center justify-center","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:u.jsx(qHe,{className:"h-2 w-2 fill-accent1 text-accent1"})})}));Cd.displayName=elt.displayName;const tge=({schema:e,defaultValues:t,withoutSubmit:r,isSubmitLoading:n,submitButtonLabel:s,onSubmit:a,children:i,isProcessorWorkflow:o})=>{const[l,c]=E.useState(o?"simple":"form"),[d,p]=E.useState(!1);return E.useEffect(()=>{p(!0)},[]),d?u.jsxs("div",{children:[u.jsx(FP,{disabled:n,value:l,onValueChange:f=>c(f),className:"pb-4",children:u.jsxs("div",{className:"flex flex-row gap-4",children:[o&&u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Cd,{value:"simple",id:"simple"}),u.jsx(Zt,{htmlFor:"simple",className:"!text-neutral3 text-ui-sm",children:"Simple"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Cd,{value:"form",id:"form"}),u.jsx(Zt,{htmlFor:"form",className:"!text-neutral3 text-ui-sm",children:"Form"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Cd,{value:"json",id:"json"}),u.jsx(Zt,{htmlFor:"json",className:"!text-neutral3 text-ui-sm",children:"JSON"})]})]})}),u.jsx("div",{className:J({"opacity-50 pointer-events-none":n}),children:l==="simple"&&o?u.jsx(sgn,{schema:e,defaultValues:t,isSubmitLoading:n,submitButtonLabel:s,onSubmit:a,withoutSubmit:r,children:i}):l==="form"?u.jsx(ege,{schema:e,defaultValues:t,isSubmitLoading:n,submitButtonLabel:s,onSubmit:r?void 0:a,children:i}):u.jsx(ngn,{schema:e,defaultValues:t,isSubmitLoading:n,submitButtonLabel:s,onSubmit:a,withoutSubmit:r,children:i})})]}):null},ngn=({schema:e,defaultValues:t,isSubmitLoading:r,submitButtonLabel:n,onSubmit:s,withoutSubmit:a,children:i})=>{const[o,l]=E.useState([]),[c,d]=E.useState(()=>JSON.stringify(t??{},null,2)),p=()=>{l([]);try{const h=e.safeParse(JSON.parse(c));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(c)}catch{f={}}return u.jsxs("div",{className:"flex flex-col gap-4",children:[o.length>0&&u.jsxs("div",{className:"border border-accent2 rounded-lg p-2",children:[u.jsxs(We,{as:"p",variant:"ui-md",className:"text-accent2 font-semibold",children:[o.length," errors found"]}),u.jsx("ul",{className:"list-disc list-inside",children:o.map((h,m)=>u.jsx("li",{className:"text-ui-sm text-accent2",children:h},m))})]}),u.jsx(mi,{data:f,onChange:d}),i,a?null:u.jsx(Se,{variant:"light",onClick:p,className:"w-full",size:"lg",children:r?u.jsx(qi,{className:"animate-spin"}):n})]})},N5e=[{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"}],sgn=({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."),[c,d]=E.useState("input"),[p,f]=E.useState([]),h=()=>{f([]);const g=c==="outputStep"||c==="outputResult"?"assistant":"user",b={messages:[{id:crypto.randomUUID(),role:g,createdAt:new Date().toISOString(),content:{format:2,parts:[{type:"text",text:o}]}}],phase:c};try{const v=e.safeParse(b);v.success?s(v.data):f(v.error.issues.map(w=>`[${w.path.join(".")}] ${w.message}`))}catch{f(["Error processing input"])}};return u.jsxs("div",{className:"flex flex-col gap-4",children:[p.length>0&&u.jsxs("div",{className:"border border-accent2 rounded-lg p-2",children:[u.jsxs(We,{as:"p",variant:"ui-md",className:"text-accent2 font-semibold",children:[p.length," errors found"]}),u.jsx("ul",{className:"list-disc list-inside",children:p.map((m,g)=>u.jsx("li",{className:"text-ui-sm text-accent2",children:m},g))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(We,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Phase"}),u.jsxs(Ko,{value:c,onValueChange:d,children:[u.jsx(jo,{className:"w-full",children:u.jsx(Jo,{placeholder:"Select phase"})}),u.jsx($o,{children:N5e.map(m=>u.jsx(Zs,{value:m.value,children:m.value},m.value))})]}),u.jsx(We,{variant:"ui-xs",className:"text-neutral4",children:N5e.find(m=>m.value===c)?.label})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(We,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Test Message"}),u.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:u.jsx(Se,{variant:"light",onClick:h,className:"w-full",size:"lg",children:r?u.jsx(qi,{className:"animate-spin"}):n})]})},l_=async e=>await tlt.format(e,{semi:!1,parser:"json",printWidth:80,tabWidth:2,plugins:[rct,Lct]}),FN=e=>{try{const t=JSON.parse(e);return!!t&&typeof t=="object"}catch{return!1}},rge=E.createContext(null);function nge({children:e}){const{requestContext:t}=ma(),[r,n]=E.useState(t),s=i=>n(i),a=()=>{n({})};return u.jsx(rge.Provider,{value:{schemaValues:r,setSchemaValues:s,clearSchemaValues:a},children:e})}function Svt(){const e=E.useContext(rge);if(!e)throw new Error("useSchemaRequestContext must be used within a SchemaRequestContextProvider");return e}function Qu(){const{requestContext:e}=ma(),r=E.useContext(rge)?.schemaValues??{};return{...e??{},...r}}const yT="text-neutral3 hover:text-neutral6",R5e=e=>{try{return e==null?"{}":JSON.stringify(e,null,2)}catch{return"{}"}},GJ=({label:e,value:t,onChange:r,helperText:n,exampleCode:s})=>{const a=Ux(),{handleCopy:i}=kh({text:t}),{handleCopy:o}=kh({text:s??"{}"}),[l,c]=E.useState(null),[d,p]=E.useState(!1),[f,h]=E.useState(!1),m=async()=>{if(c(null),!t.trim()){r("{}");return}if(!FN(t)){c("Invalid JSON");return}try{const g=await l_(t);r(g)}catch{c("Unable to format JSON")}};return u.jsxs(u.Fragment,{children:[f&&u.jsxs("div",{className:"border border-border1 rounded-lg bg-surface3 p-3 space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(We,{as:"p",variant:"ui-sm",className:"text-neutral3",children:["Example ",e]}),u.jsxs(Yn,{children:[u.jsx(Kn,{asChild:!0,children:u.jsx("button",{type:"button",onClick:o,className:yT,"aria-label":"Copy example JSON",children:u.jsx(Ce,{children:u.jsx(cc,{})})})}),u.jsx(Vn,{children:"Copy example JSON"})]})]}),u.jsx(Ld,{value:s,theme:a,extensions:[Nd],className:"h-[150px] w-full overflow-y-scroll bg-surface3 rounded-lg overflow-scroll p-3"})]}),u.jsxs(DO,{className:"border border-border1 rounded-lg bg-surface3",open:d,onOpenChange:p,children:[u.jsxs("div",{className:"flex items-center justify-between w-full px-3",children:[u.jsxs("div",{children:[u.jsx(We,{as:"label",variant:"ui-md",className:"text-neutral3",children:e}),n&&u.jsx(We,{variant:"ui-xs",className:"text-neutral3",children:n})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(Yn,{children:[u.jsx(Kn,{asChild:!0,children:u.jsx("button",{type:"button",onClick:m,className:yT,"aria-label":"Format JSON",children:u.jsx(Ce,{children:u.jsx(Kp,{})})})}),u.jsx(Vn,{children:"Format JSON"})]}),u.jsxs(Yn,{children:[u.jsx(Kn,{asChild:!0,children:u.jsx("button",{type:"button",onClick:i,className:yT,"aria-label":"Copy JSON",children:u.jsx(Ce,{children:u.jsx(cc,{})})})}),u.jsx(Vn,{children:"Copy JSON"})]}),s&&u.jsxs(Yn,{children:[u.jsx(Kn,{asChild:!0,children:u.jsx("button",{type:"button",onClick:()=>h(!f),className:yT,"aria-label":f?"Hide example JSON":"View example JSON",children:u.jsx(Ce,{children:f?u.jsx(k4t,{}):u.jsx(zp,{})})})}),u.jsx(Vn,{children:"View example JSON"})]}),u.jsx(Ww,{asChild:!0,children:u.jsx("button",{type:"button",className:yT,"aria-label":d?`Collapse ${e}`:`Expand ${e}`,children:u.jsx(Ce,{className:J("transition-transform",d?"rotate-0":"-rotate-90"),children:u.jsx(Ua,{})})})})]})]}),u.jsxs(Xw,{className:"space-y-2",children:[u.jsx(Ld,{value:t,onChange:r,theme:a,extensions:[Nd],className:"h-[260px] overflow-y-scroll bg-surface3 rounded-lg overflow-hidden p-3"}),l&&u.jsx(We,{variant:"ui-sm",className:"text-accent2",children:l})]})]})]})},QJ=({stepKey:e,closeModal:t,isPerStepRun:r,isContinueRun:n,buttonText:s="Start time travel",inputData:a})=>{const{result:i,workflow:o,timeTravelWorkflowStream:l,runId:c,workflowId:d,setDebugMode:p}=E.useContext(bg),f=Qu(),h=a?{payload:a}:i?.steps?.[e],[m,g]=E.useState(()=>"{}"),[b,v]=E.useState(()=>"{}"),[w,S]=E.useState(()=>"{}"),[_,O]=E.useState(null),[C,T]=E.useState(!1),A=o?.allSteps?.[e],{schema:I}=E.useMemo(()=>{if(!A?.inputSchema)return{schema:Rc(Yr(),O_())};try{const P=hx(A.inputSchema),L=o?.stateSchema?Km(Xm(hx(o.stateSchema))):null,B=Km(Xm(P));return{schema:L?ps({inputData:B,initialState:L.optional()}):B,schemaError:null}}catch(P){return console.error("Failed to parse step schema",P),{schema:Rc(Yr(),O_())}}},[A?.inputSchema,o?.stateSchema]),R=async P=>{O(null),T(!0);try{const L=m.trim()?JSON.parse(m):{},B=b.trim()?JSON.parse(b):{},M=w.trim()?JSON.parse(w):{},{initialState:z,inputData:H}=P??{},q=o?.stateSchema?H:P,V={runId:c,workflowId:d,step:e,inputData:q,initialState:z,resumeData:Object.keys(L)?.length>0?L:void 0,context:Object.keys(B)?.length>0?B: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),O(L instanceof Error?L.message:"Error time traveling workflow")}finally{T(!1)}};return u.jsx(gc,{children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(We,{as:"p",variant:"ui-lg",className:"text-neutral3",children:"Input data"}),u.jsxs(We,{variant:"ui-xs",className:"text-neutral3",children:["Step: ",e]})]}),u.jsx(tge,{schema:I,defaultValues:h?.payload,isSubmitLoading:C,submitButtonLabel:s,onSubmit:R,children:u.jsxs("div",{className:"space-y-4 pb-4",children:[r||n?null:u.jsxs(u.Fragment,{children:[u.jsx(GJ,{label:"Resume Data (JSON)",value:m,onChange:g,helperText:"Provide any resume payloads that should be passed to the step."}),u.jsx(GJ,{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:R5e({stepId:{status:"success",payload:{value:"test value"},output:{value:"test output"}}})}),u.jsx(GJ,{label:"Nested Step Context (JSON)",value:w,onChange:S,helperText:"Includes nested workflow steps that are required in the time travel execution.",exampleCode:R5e({nestedWorkflowId:{stepId:{status:"success",payload:{value:"test value"},output:{value:"test output"}}}})})]}),_&&u.jsx(We,{variant:"ui-sm",className:"text-accent2",children:_})]})})]})})},sge=({input:e,output:t,resumeData:r,suspendOutput:n,error:s,tripwire:a,mapConfig:i,stepName:o,stepId:l,onShowNestedGraph:c,status:d,stepKey:p,stepsFlow:f})=>{const[h,m]=E.useState(!1),[g,b]=E.useState(!1),[v,w]=E.useState(!1),[S,_]=E.useState(!1),[O,C]=E.useState(!1),[T,A]=E.useState(!1),[I,R]=E.useState(!1),[P,L]=E.useState(!1),{withoutTimeTravel:B,debugMode:M,result:z,runSnapshot:H,timeTravelWorkflowStream:q,runId:V,workflowId:Q,setDebugMode:$}=E.useContext(bg),{showMapConfig:X,stepDetail:U,closeStepDetail:N}=Z8(),Z=Qu(),G=z?.status??H?.status,K="max-w-4xl w-full",ee=!B&&p&&!i&&G!=="running"&&G!=="paused",te=p&&M&&G==="paused",se=E.useMemo(()=>{if(!p||!te)return;const be=f?.[p]??[];if(be.length===0)return;if(be.length>1)return{hasMultiSteps:!0,input:be.reduce((ke,oe)=>(z?.steps?.[oe]?.status==="success"&&(ke[oe]=z?.steps?.[oe].output),ke),{})};const Ne=be[0];if(z?.steps?.[Ne]?.status==="success")return{hasMultiSteps:!1,input:z?.steps?.[Ne].output}},[p,f,te,z]),ue=te&&se&&!z?.steps[p],xe=U?.type==="map-config"&&U?.stepName===o,W=U?.type==="nested-graph"&&U?.stepName===o,ae="ring-2 ring-accent1 ring-offset-1 ring-offset-transparent",ne=()=>{xe?N():X({stepName:o,stepId:l,mapConfig:i})},ye=()=>{W?N():c?.()},le=be=>{const Ne={runId:V,workflowId:Q,step:p,inputData:se?.hasMultiSteps?void 0:se?.input,requestContext:Z,...be?{perStep:!1}:{},...se?.hasMultiSteps?{context:Object.keys(se.input)?.reduce((ke,oe)=>(ke[oe]={output:se.input[oe]},ke),{})}:{}};be&&$(!1),q(Ne)};return u.jsx(u.Fragment,{children:(e||t||s||a||i||r||c||ee||ue)&&u.jsxs("div",{className:J("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:[c&&u.jsx(Se,{onClick:ye,className:J(W&&ae),size:"sm",children:"View nested graph"}),ee&&u.jsxs(u.Fragment,{children:[u.jsx(Se,{onClick:()=>A(!0),size:"sm",children:"Time travel"}),u.jsx(wa,{open:T,onOpenChange:A,children:u.jsxs(sa,{className:K,children:[u.jsxs(Sa,{children:[u.jsxs(aa,{children:["Time travel to ",p]}),u.jsx(Ei,{children:"Time travel to a specific workflow step"})]}),u.jsx(Ea,{className:"max-h-[600px]",children:u.jsx(QJ,{stepKey:p,closeModal:()=>A(!1)})})]})})]}),ue&&u.jsxs(u.Fragment,{children:[u.jsx(Se,{onClick:()=>{i?le():L(!0)},size:"sm",children:"Run step"}),u.jsx(wa,{open:P,onOpenChange:L,children:u.jsxs(sa,{className:K,children:[u.jsxs(Sa,{children:[u.jsxs(aa,{children:["Run step ",p]}),u.jsx(Ei,{children:"Run a specific workflow step"})]}),u.jsx(Ea,{className:"max-h-[600px]",children:u.jsx(QJ,{stepKey:p,closeModal:()=>L(!1),isPerStepRun:!0,buttonText:"Run step",inputData:se?.input})})]})}),u.jsx(Se,{onClick:()=>{i?le(!0):R(!0)},size:"sm",children:"Continue run"}),u.jsx(wa,{open:I,onOpenChange:R,children:u.jsxs(sa,{className:K,children:[u.jsxs(Sa,{children:[u.jsxs(aa,{children:["Continue run ",p]}),u.jsx(Ei,{children:"Continue the workflow run from this step"})]}),u.jsx(Ea,{className:"max-h-[600px]",children:u.jsx(QJ,{stepKey:p,closeModal:()=>R(!1),isContinueRun:!0,buttonText:"Continue run",inputData:se?.input})})]})})]}),i&&u.jsx(Se,{onClick:ne,className:J(xe&&ae),size:"sm",children:"Map config"}),e&&u.jsxs(u.Fragment,{children:[u.jsx(Se,{onClick:()=>m(!0),size:"sm",children:"Input"}),u.jsx(wa,{open:h,onOpenChange:m,children:u.jsxs(sa,{className:K,children:[u.jsxs(Sa,{children:[u.jsxs(aa,{children:[o," input"]}),u.jsx(Ei,{children:"View the input data for this step"})]}),u.jsx(Ea,{children:u.jsx(hE,{data:e})})]})})]}),r&&u.jsxs(u.Fragment,{children:[u.jsx(Se,{onClick:()=>w(!0),size:"sm",children:"Resume data"}),u.jsx(wa,{open:v,onOpenChange:w,children:u.jsxs(sa,{className:K,children:[u.jsxs(Sa,{children:[u.jsxs(aa,{children:[o," resume data"]}),u.jsx(Ei,{children:"View the resume data for this step"})]}),u.jsx(Ea,{children:u.jsx(hE,{data:r})})]})})]}),(t??n)&&u.jsxs(u.Fragment,{children:[u.jsx(Se,{onClick:()=>b(!0),size:"sm",children:"Output"}),u.jsx(wa,{open:g,onOpenChange:b,children:u.jsxs(sa,{className:K,children:[u.jsxs(Sa,{children:[u.jsxs(aa,{children:[o," output"]}),u.jsx(Ei,{children:"View the output data for this step"})]}),u.jsx(Ea,{children:u.jsx(hE,{data:t??n})})]})})]}),s&&u.jsxs(u.Fragment,{children:[u.jsx(Se,{onClick:()=>_(!0),size:"sm",children:"Error"}),u.jsx(wa,{open:S,onOpenChange:_,children:u.jsxs(sa,{className:K,children:[u.jsxs(Sa,{children:[u.jsxs(aa,{children:[o," error"]}),u.jsx(Ei,{children:"View the error details for this step"})]}),u.jsx(Ea,{children:u.jsx(hE,{data:s})})]})})]}),a&&u.jsxs(u.Fragment,{children:[u.jsx(Se,{onClick:()=>C(!0),className:"text-amber-400 hover:text-amber-300",size:"sm",children:"Tripwire"}),u.jsx(wa,{open:O,onOpenChange:C,children:u.jsxs(sa,{className:K,children:[u.jsxs(Sa,{children:[u.jsxs(aa,{children:[o," tripwire"]}),u.jsx(Ei,{children:"View the tripwire details for this step"})]}),u.jsx(Ea,{children:u.jsx(hE,{data:{reason:a.reason,retry:a.retry,metadata:a.metadata,processorId:a.processorId}})})]})})]})]})})};function Evt({data:e}){const{conditions:t,previousStepId:r,nextStepId:n,withoutTopHandle:s}=e,[a,i]=E.useState(!0),[o,l]=E.useState(!1),c=t[0]?.type,d=(t.some(w=>w.fnString)||t?.length>1)&&c!=="else",{steps:p}=LP(),f=p[r],h=p[n],m=f?.status==="failed"&&f?.tripwire!==void 0,g=m?"tripwire":f?.status,{icon:b,color:v}=T5e(c);return u.jsxs(u.Fragment,{children:[!s&&u.jsx(Lu,{type:"target",position:_r.Top,style:{visibility:"hidden"}}),u.jsxs("div",{"data-workflow-node":!0,"data-workflow-step-status":g,"data-testid":"workflow-condition-node",className:J("bg-surface3 rounded-lg w-[300px] border border-border1",g==="success"&&h&&"bg-accent1Darker",g==="failed"&&h&&"bg-accent2Darker",g==="tripwire"&&h&&"bg-amber-950/40 border-amber-500/30",!f&&!!h?.status&&"bg-accent1Darker"),children:[u.jsxs(DO,{open:d?a:!0,onOpenChange:w=>{d&&i(w)},children:[u.jsxs(Ww,{className:"flex items-center justify-between w-full px-3 py-2",children:[u.jsx(Gt,{icon:b?u.jsx(b,{className:"text-current",...v?{style:{color:v}}:{}}):null,children:c?.toUpperCase()}),d&&u.jsx(Ce,{children:u.jsx(Ua,{className:J("transition-transform text-neutral3",{"transform rotate-180":a})})})]}),c==="else"?null:u.jsx(Xw,{className:"flex flex-col gap-2 pb-2",children:t.map((w,S)=>{const _=w.conj||c,{icon:O,color:C}=T5e(_),T=S===0?null:u.jsx(Gt,{icon:O?u.jsx(O,{className:"text-current",...C?{style:{color:C}}:{}}):null,children:w.conj?.toLocaleUpperCase()||"WHEN"});return w.fnString?u.jsxs("div",{className:"px-3",children:[u.jsx(s2e,{theme:Cne.oneDark,code:String(w.fnString).trim(),language:"javascript",children:({className:A,style:I,tokens:R,getLineProps:P,getTokenProps:L})=>u.jsx("pre",{className:J("relative font-mono p-3 w-full cursor-pointer rounded-lg text-xs !bg-surface4 whitespace-pre-wrap break-words",A,g==="success"&&h&&"!bg-accent1Dark",g==="failed"&&h&&"!bg-accent2Dark",g==="tripwire"&&h&&"!bg-amber-900/40"),onClick:()=>l(!0),style:I,children:R.map((B,M)=>u.jsxs("div",{...P({line:B}),children:[u.jsx("span",{className:"inline-block mr-2 text-neutral3",children:M+1}),B.map((z,H)=>u.jsx("span",{...L({token:z})},H))]},M))})}),u.jsx(wa,{open:o,onOpenChange:l,children:u.jsxs(sa,{className:"max-w-[30rem]",children:[u.jsxs(Sa,{children:[u.jsx(aa,{className:"sr-only",children:"Condition Function"}),u.jsx(Ei,{children:"View the condition function code"})]}),u.jsx(Ea,{children:u.jsx(Di,{className:"w-full",maxHeight:"400px",children:u.jsx(s2e,{theme:Cne.oneDark,code:String(w.fnString).trim(),language:"javascript",children:({className:A,style:I,tokens:R,getLineProps:P,getTokenProps:L})=>u.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:{...I,backgroundColor:"#121212",padding:"0 0.75rem 0 0"},children:R.map((B,M)=>u.jsxs("div",{...P({line:B}),children:[u.jsx("span",{className:"inline-block mr-2 text-neutral3",children:M+1}),B.map((z,H)=>u.jsx("span",{...L({token:z})},H))]},M))})})})})]})})]},`${w.fnString}-${S}`):u.jsx(E.Fragment,{children:w.ref?.step?u.jsxs("div",{className:"flex items-center gap-1",children:[T,u.jsxs(We,{variant:"ui-xs",className:" text-neutral3 flex-1",children:[w.ref.step.id||w.ref.step,"'s ",w.ref.path," ",Object.entries(w.query).map(([A,I])=>`${A} ${String(I)}`)]})]}):null},`${w.ref?.path}-${S}`)})})]}),u.jsx(sge,{stepName:n,input:f?.output,mapConfig:e.mapConfig,tripwire:m?f?.tripwire:void 0,status:h?g:void 0})]}),u.jsx(Lu,{type:"source",position:_r.Bottom,style:{visibility:"hidden"}})]})}const agn=(e,t)=>Number(e.toPrecision(t)),_vt=({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 u.jsxs("span",{className:"text-xs text-neutral3",children:[agn(s,3),"ms"]})};function kvt({data:e,parentWorkflowName:t,stepsFlow:r}){const{steps:n}=LP(),{label:s,stepId:a,description:i,withoutTopHandle:o,withoutBottomHandle:l,mapConfig:c,duration:d,date:p,isParallel:f,canSuspend:h,isForEach:m}=e,g=t?`${t}.${a||s}`:a||s,b=n[g],v=b?.status==="failed"&&b?.tripwire!==void 0,w=v?"tripwire":b?.status,{isSleepNode:S,isForEachNode:_,isMapNode:O,hasSpecialBadge:C}=gvt({duration:d,date:p,isForEach:m,mapConfig:c,canSuspend:h,isParallel:f});return u.jsxs(u.Fragment,{children:[!o&&u.jsx(Lu,{type:"target",position:_r.Top,style:{visibility:"hidden"}}),u.jsxs("div",{"data-workflow-node":!0,"data-workflow-step-status":w??"idle","data-testid":"workflow-default-node",className:J("bg-surface3 rounded-lg w-[274px] border border-border1",C?"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:[C&&u.jsxs("div",{className:"px-3 pt-2 pb-1 flex gap-1.5 flex-wrap",children:[S&&u.jsx(Gt,{icon:p?u.jsx(Xo.sleepUntil,{className:"text-current",style:{color:po.sleep}}):u.jsx(Xo.sleep,{className:"text-current",style:{color:po.sleep}}),children:p?"SLEEP UNTIL":"SLEEP"}),h&&u.jsx(Gt,{icon:u.jsx(Xo.suspend,{className:"text-current",style:{color:po.suspend}}),children:"SUSPEND/RESUME"}),f&&u.jsx(Gt,{icon:u.jsx(Xo.parallel,{className:"text-current",style:{color:po.parallel}}),children:"PARALLEL"}),_&&u.jsx(Gt,{icon:u.jsx(Xo.forEach,{className:"text-current",style:{color:po.forEach}}),children:"FOREACH"}),O&&u.jsx(Gt,{icon:u.jsx(Xo.map,{className:"text-current",style:{color:po.map}}),children:"MAP"})]}),u.jsxs("div",{className:J("flex items-center gap-2 px-3",!i&&"pb-2"),children:[u.jsxs(Ce,{children:[w==="tripwire"&&u.jsx(NR,{className:"text-amber-400"}),w==="failed"&&u.jsx(qme,{className:"text-accent2"}),w==="success"&&u.jsx(Vme,{className:"text-accent1"}),w==="suspended"&&u.jsx(eZe,{className:"text-accent3"}),w==="waiting"&&u.jsx(Wle,{className:"text-accent5"}),w==="running"&&u.jsx(qi,{className:"text-accent6 animate-spin"}),!b&&u.jsx(f6,{className:"text-neutral2"})]}),u.jsxs(We,{variant:"ui-lg",className:"text-neutral6 font-medium inline-flex items-center gap-1 justify-between w-full",children:[s," ",b?.startedAt&&u.jsx(_vt,{startedAt:b.startedAt,endedAt:b.endedAt})]})]}),i&&u.jsx(We,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:i}),_&&b?.foreachProgress&&u.jsxs("div",{className:"px-3 pb-2 flex items-center gap-2",children:[u.jsx("div",{className:"flex-1 h-1.5 bg-surface1 rounded-full overflow-hidden",children:u.jsx("div",{className:J("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}%`}})}),u.jsxs(We,{variant:"ui-xs",className:"text-neutral3 whitespace-nowrap",children:[b.foreachProgress.completedCount," / ",b.foreachProgress.totalCount]})]}),d&&u.jsxs(We,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:["sleeps for ",u.jsxs("strong",{children:[d,"ms"]})]}),p&&u.jsxs(We,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:["sleeps until ",u.jsx("strong",{children:new Date(p).toLocaleString()})]}),u.jsx(sge,{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:c,status:w,stepKey:g,stepsFlow:r})]}),!l&&u.jsx(Lu,{type:"source",position:_r.Bottom,style:{visibility:"hidden",color:"red"}})]})}function Ovt({data:e}){const{steps:t}=e,[r,n]=E.useState(!0);return u.jsxs(DO,{open:r,onOpenChange:n,className:J("bg-surface4 rounded-md w-[274px] flex flex-col p-2 gap-2"),children:[u.jsx(Lu,{type:"target",position:_r.Top,style:{visibility:"hidden"}}),u.jsxs(Ww,{className:"flex items-center justify-between w-full",children:[u.jsx(Gt,{icon:u.jsx(Xo.after,{className:"text-current",style:{color:po.after}}),children:"AFTER"}),u.jsx(Ce,{children:u.jsx(Ua,{className:J("transition-transform text-neutral3",{"transform rotate-180":r})})})]}),u.jsx(Xw,{className:"flex flex-col gap-2",children:t.map(s=>u.jsxs("div",{className:"text-sm bg-surface5 flex items-center gap-1.5 rounded-sm p-2",children:[u.jsx(GHe,{className:"text-current w-4 h-4"}),u.jsx(We,{variant:"ui-xs",className:"text-neutral6 capitalize",children:s})]},s))}),u.jsx(Lu,{type:"source",position:_r.Bottom,style:{visibility:"hidden"}})]})}function Cvt({data:e}){const{result:t}=e;return u.jsxs("div",{"data-testid":"workflow-loop-result-node","data-workflow-step-status":t?"success":"failed",className:J("bg-surface4 rounded-md w-[274px]"),"data-workflow-node":!0,children:[u.jsx(Lu,{type:"target",position:_r.Top,style:{visibility:"hidden"}}),u.jsx("div",{className:"p-2",children:u.jsxs("div",{className:"text-sm bg-surface5 flex items-center gap-1.5 rounded-sm p-2",children:[t?u.jsx(LHe,{className:"text-current w-4 h-4"}):u.jsx(_D,{className:"text-current w-4 h-4"}),u.jsx(We,{variant:"ui-xs",className:"text-neutral6 capitalize",children:String(t)})]})}),u.jsx(Lu,{type:"source",position:_r.Bottom,style:{visibility:"hidden"}})]})}function Tvt({data:e,parentWorkflowName:t,stepsFlow:r}){const{steps:n}=LP(),{showNestedGraph:s}=Z8(),{label:a,stepId:i,description:o,withoutTopHandle:l,withoutBottomHandle:c,stepGraph:d,mapConfig:p,isParallel:f,canSuspend:h,isForEach:m}=e,g=t?`${t}.${a}`:a,b=t?`${t}.${i||a}`:i||a,v=n[b],w=v?.status==="failed"&&v?.tripwire!==void 0,S=w?"tripwire":v?.status,{isForEachNode:_,isMapNode:O,isNestedWorkflow:C,hasSpecialBadge:T}=gvt({isForEach:m,mapConfig:p,canSuspend:h,isParallel:f,stepGraph:d});return u.jsxs(u.Fragment,{children:[!l&&u.jsx(Lu,{type:"target",position:_r.Top,style:{visibility:"hidden"}}),u.jsxs("div",{"data-testid":"workflow-nested-node","data-workflow-node":!0,"data-workflow-step-status":S,className:J("bg-surface3 rounded-lg w-[274px] border border-border1",T?"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:[T&&u.jsxs("div",{className:"px-3 pt-2 pb-1 flex gap-1.5 flex-wrap",children:[h&&u.jsx(Gt,{icon:u.jsx(Xo.suspend,{className:"text-current",style:{color:po.suspend}}),children:"SUSPEND/RESUME"}),f&&u.jsx(Gt,{icon:u.jsx(Xo.parallel,{className:"text-current",style:{color:po.parallel}}),children:"PARALLEL"}),C&&u.jsx(Gt,{icon:u.jsx(Xo.workflow,{className:"text-current",style:{color:po.workflow}}),children:"WORKFLOW"}),_&&u.jsx(Gt,{icon:u.jsx(Xo.forEach,{className:"text-current",style:{color:po.forEach}}),children:"FOREACH"}),O&&u.jsx(Gt,{icon:u.jsx(Xo.map,{className:"text-current",style:{color:po.map}}),children:"MAP"})]}),u.jsxs("div",{className:J("flex items-center gap-2 px-3",!o&&"pb-2"),children:[u.jsxs(Ce,{children:[S==="failed"&&u.jsx(qme,{className:"text-accent2"}),S==="success"&&u.jsx(Vme,{className:"text-accent1"}),S==="tripwire"&&u.jsx(NR,{className:"text-amber-400"}),S==="suspended"&&u.jsx(eZe,{className:"text-accent3"}),S==="waiting"&&u.jsx(Wle,{className:"text-accent5"}),S==="running"&&u.jsx(qi,{className:"text-accent6 animate-spin"}),!v&&u.jsx(f6,{className:"text-neutral2"})]}),u.jsxs(We,{variant:"ui-lg",className:"text-neutral6 font-medium inline-flex items-center gap-1 justify-between w-full",children:[a," ",v?.startedAt&&u.jsx(_vt,{startedAt:v.startedAt,endedAt:v.endedAt})]})]}),o&&u.jsx(We,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:o}),_&&v?.foreachProgress&&u.jsxs("div",{className:"px-3 pb-2 flex items-center gap-2",children:[u.jsx("div",{className:"flex-1 h-1.5 bg-surface1 rounded-full overflow-hidden",children:u.jsx("div",{className:J("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}%`}})}),u.jsxs(We,{variant:"ui-xs",className:"text-neutral3 whitespace-nowrap",children:[v.foreachProgress.completedCount," / ",v.foreachProgress.totalCount]})]}),u.jsx(sge,{stepName:a,stepId:i,input:v?.input,resumeData:v?.resumeData,output:v?.output,suspendOutput:v?.suspendOutput,error:v?.error,tripwire:w?v?.tripwire:void 0,mapConfig:p,onShowNestedGraph:()=>s({label:a,fullStep:g,stepGraph:d}),status:S,stepKey:b,stepsFlow:r})]}),!c&&u.jsx(Lu,{type:"source",position:_r.Bottom,style:{visibility:"hidden"}})]})}const vL=E.forwardRef(({className:e,...t},r)=>u.jsxs(Ept,{ref:r,className:J("relative flex w-full touch-none select-none items-center group",e),...t,children:[u.jsx(uQr,{className:J("relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral2",Jr.colors),children:u.jsx(dQr,{className:J("absolute h-full bg-accent1",Jr.all)})}),u.jsx(pQr,{className:J("block h-4 w-4 rounded-full border-2 border-accent1 bg-white shadow-md","transition-all duration-normal ease-out-custom",$h,"hover:scale-110 hover:shadow-lg","active:scale-95","disabled:pointer-events-none disabled:opacity-50")})]}));vL.displayName=Ept.displayName;const age=E.forwardRef(({className:e,...t})=>{const{zoom:r}=aRr(),{zoomTo:n,zoomIn:s,zoomOut:a,fitView:i}=I9();return u.jsxs(oP,{className:J("flex gap-1 rounded-md bg-surface2 p-1 text-neutral6",e),...t,children:[u.jsx(Se,{onClick:()=>a({duration:300}),children:u.jsx(_5t,{className:"h-4 w-4"})}),u.jsx(vL,{className:"w-[140px]",value:[r],min:.01,max:1,step:.01,onValueChange:o=>{n(o[0])}}),u.jsx(Se,{onClick:()=>s({duration:300}),children:u.jsx(si,{className:"h-4 w-4"})}),u.jsxs(Se,{className:"min-w-20 tabular-nums",onClick:()=>n(1,{duration:300}),children:[(100*r).toFixed(0),"%"]}),u.jsx(Se,{onClick:()=>i({duration:300,maxZoom:1}),children:u.jsx(x5t,{className:"h-4 w-4"})})]})});age.displayName="ZoomSlider";function ign({workflow:e}){const{nodes:t,edges:r}=mvt(e),[n,s,a]=Oat(t),[i]=Cat(r),{steps:o}=LP(),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]),c={"default-node":d=>u.jsx(kvt,{...d,stepsFlow:l}),"condition-node":Evt,"after-node":Ovt,"loop-result-node":Cvt,"nested-node":d=>u.jsx(Tvt,{...d,stepsFlow:l})};return u.jsx("div",{className:"w-full h-full bg-surface1",children:u.jsxs(kat,{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:c,onNodesChange:a,fitView:!0,fitViewOptions:{maxZoom:1},minZoom:.01,maxZoom:1,children:[u.jsx(age,{position:"bottom-left"}),u.jsx(Aat,{variant:Rm.Dots,gap:12,size:.5})]})})}function Avt({workflowId:e,workflow:t,isLoading:r}){const{snapshot:n}=E.useContext(bg);return r?u.jsx("div",{className:"p-4",children:u.jsx(Pr,{className:"h-full"})}):t?u.jsx(hpe,{children:u.jsx(ign,{workflow:n?.serializedStepGraph?{stepGraph:n?.serializedStepGraph}:t})}):u.jsx("div",{className:"grid h-full place-items-center",children:u.jsxs("div",{className:"flex flex-col items-center gap-2",children:[u.jsx(Am,{}),u.jsxs("div",{children:["We couldn't find ",Emn(e)," workflow."]})]})})}const ogn=e=>e&&Object.keys(e).length===0&&e.constructor===Object;function lgn(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 cgn(e){return E.useMemo(()=>{const t=e?.inputSchema,r=e?.stateSchema,n=t?Km(Xm(hx(t))):null,s=r?Km(Xm(hx(r))):null;return{zodSchemaToUse:s?ps({inputData:n,initialState:s.optional()}):n,hasStateSchema:!!r}},[e?.inputSchema,e?.stateSchema])}function ugn({zodSchema:e,isStreaming:t,onExecute:r,defaultValues:n,isViewingRun:s,isProcessorWorkflow:a}){return e?u.jsx(tge,{schema:e,defaultValues:n,isSubmitLoading:t,submitButtonLabel:"Run",onSubmit:r,withoutSubmit:s,isProcessorWorkflow:a}):s?null:u.jsx(Se,{className:"w-full",variant:"light",disabled:t,onClick:()=>r(null),children:t?u.jsx(Ce,{children:u.jsx(qi,{className:"animate-spin"})}):"Trigger"})}function dgn({suspendedSteps:e,workflow:t,isStreaming:r,onResume:n}){return r||e.length===0?null:u.jsx(u.Fragment,{children:e.map(s=>{const a=t.allSteps[s.stepId];if(!a||a.isWorkflow)return null;const i=a?.resumeSchema?Km(Xm(hx(a.resumeSchema))):Rc(Yr(),O_());return u.jsxs("div",{className:"flex flex-col px-4",children:[u.jsx(We,{variant:"ui-xs",className:"text-neutral3",children:s.stepId}),s.suspendPayload&&u.jsx("div",{"data-testid":"suspended-payload",children:u.jsx(mi,{data:s.suspendPayload,className:"w-full overflow-x-auto p-2",showCopyButton:!1})}),u.jsx(tge,{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 pgn=["success","failed","canceled","tripwire"];function fgn({status:e,cancelMessage:t,isCancelling:r,onCancel:n}){return e!=="running"?null:u.jsxs(Se,{variant:"light",className:"w-full",onClick:n,disabled:!!t||r||e&&pgn.includes(e),children:[r?u.jsx(Ce,{children:u.jsx(qi,{className:"animate-spin"})}):u.jsx(Ce,{children:u.jsx(VHe,{})}),t||"Cancel Workflow Run"]})}const hgn=({header:e,children:t,footer:r})=>{const[n,s]=E.useState(!1);return u.jsxs("div",{className:"rounded-lg border border-border1 bg-surface4",children:[u.jsxs("button",{className:"py-1 px-2 flex items-center gap-3 justify-between w-full",onClick:()=>s(a=>!a),children:[u.jsx("div",{className:"w-full",children:e}),u.jsx(Ce,{children:u.jsx(Ua,{className:J("text-neutral3 transition-transform -rotate-90",n&&"rotate-0")})})]}),t&&n&&u.jsx("div",{className:"border-t border-border1 max-h-[400px] overflow-y-auto",children:t}),r&&u.jsx("div",{className:"py-1 px-2 border-t border-border1",children:r})]})},mgn=({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 u.jsx(hgn,{header:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs(Ce,{children:[t==="success"&&u.jsx(Vme,{className:"text-accent1"}),t==="failed"&&u.jsx(qme,{className:"text-accent2"}),t==="tripwire"&&u.jsx(NR,{className:"text-amber-400"}),t==="suspended"&&u.jsx(zHe,{className:"text-accent3"}),t==="waiting"&&u.jsx(Wle,{className:"text-accent5"}),t==="running"&&u.jsx(qi,{className:"text-accent6 animate-spin"})]}),u.jsx(We,{as:"span",variant:"ui-lg",className:"text-neutral6 font-medium",children:e.charAt(0).toUpperCase()+e.slice(1)})]}),children:i&&n?u.jsx(ggn,{tripwire:n,isExpanded:s,onToggleExpand:()=>a(!s),hasMetadata:o}):u.jsx(mi,{data:r})})},ggn=({tripwire:e,isExpanded:t,onToggleExpand:r,hasMetadata:n})=>u.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-950/20 overflow-hidden",children:[u.jsxs("div",{className:"flex items-start gap-3 p-4",children:[u.jsx(NR,{className:"w-5 h-5 text-amber-400 mt-0.5 flex-shrink-0"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-amber-200 mb-1",children:"Content Blocked"}),u.jsx("p",{className:"text-sm text-amber-300/90",children:e.reason||"Tripwire triggered"})]})]}),n&&u.jsxs(u.Fragment,{children:[u.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?u.jsx(Ua,{className:"w-3.5 h-3.5"}):u.jsx(co,{className:"w-3.5 h-3.5"}),u.jsx("span",{children:"Details"})]}),t&&u.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&&u.jsxs("div",{className:"flex items-center gap-2 pt-3",children:[u.jsx(IR,{className:"w-3.5 h-3.5 text-amber-400/60"}),u.jsxs("span",{className:"text-xs text-amber-300/70",children:["Retry:"," ",e.retry?u.jsx("span",{className:"text-green-400",children:"Allowed"}):u.jsx("span",{className:"text-red-400",children:"Not allowed"})]})]}),e.processorId&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ece,{className:"w-3.5 h-3.5 text-amber-400/60"}),u.jsxs("span",{className:"text-xs text-amber-300/70",children:["Processor:"," ",u.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&&u.jsxs("div",{className:"pt-1",children:[u.jsx("p",{className:"text-xs text-amber-400/60 mb-1.5",children:"Metadata:"}),u.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 ygn({steps:e,workflowResult:t}){const r=Object.entries(e).filter(([n,s])=>n!=="input"&&!n.endsWith(".input"));return r.length===0?null:u.jsxs("div",{className:"flex flex-col gap-2 pt-5 border-t border-border1",children:[u.jsx(We,{variant:"ui-xs",className:"text-neutral3",children:"Status"}),u.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 c=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 u.jsx(mgn,{stepId:n,status:d,result:i??o??l??{},tripwire:c},n)})})]})}function Dvt({workflowId:e,paramsRunId:t,setRunId:r,workflow:n,isLoading:s,createWorkflowRun:a,resumeWorkflow:i,streamWorkflow:o,observeWorkflowStream:l,isStreamingWorkflow:c,streamResult:d,isCancellingWorkflowRun:p,cancelWorkflowRun:f}){const h=Qu(),{result:m,setResult:g,payload:b,setPayload:v,setRunId:w}=E.useContext(bg),[S,_]=E.useState(""),[O,C]=E.useState(null),T=m??d,A=lgn(T,S),{zodSchemaToUse:I,hasStateSchema:R}=cgn(n),P=async q=>{try{if(!n)return;C(null),g(null);const V=await a({workflowId:e});r?.(V.runId),_(V.runId),w(V.runId);const{initialState:Q,inputData:$}=q??{},X=R?$:q;o({workflowId:e,runId:V.runId,inputData:X,initialState:Q,requestContext:h})}catch{Je.error("Error executing workflow")}},L=async q=>{if(!n)return;C(null);const{stepId:V,runId:Q,resumeData:$}=q,X=await a({workflowId:e,prevRunId:Q});await i({step:V,runId:X.runId,resumeData:$,workflowId:e,requestContext:h})},B=async()=>{const q=await f({workflowId:e,runId:S});C(q)};if(E.useEffect(()=>{t&&l&&(l({workflowId:e,runId:t}),_(t),w(t))},[t]),E.useEffect(()=>{d&&g(d)},[d]),s)return u.jsx(Di,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:u.jsxs("div",{className:"space-y-4",children:[u.jsx(Pr,{className:"h-10"}),u.jsx(Pr,{className:"h-10"})]})});if(!n)return null;const M=A.length>0,z=T?.steps??{},H=Object.values(z).length>0;return u.jsxs("div",{className:"h-full pt-3 overflow-y-auto",children:[u.jsxs("div",{className:"space-y-4 px-5 pb-5 border-b border-border1",children:[M&&c&&u.jsxs("div",{className:"py-2 px-5 flex items-center gap-2 bg-surface5 -mx-5 -mt-5 border-b border-border1",children:[u.jsx(Ce,{children:u.jsx(qi,{className:"animate-spin text-neutral6"})}),u.jsx(We,{children:"Resuming workflow"})]}),!M&&u.jsx(ugn,{zodSchema:I,defaultValues:b,isStreaming:c,onExecute:q=>{v(q),P(q)},isViewingRun:!!t,isProcessorWorkflow:n?.isProcessorWorkflow}),u.jsx(dgn,{suspendedSteps:A,workflow:n,isStreaming:c,onResume:L}),u.jsx(fgn,{status:m?.status,cancelMessage:O?.message??null,isCancelling:p,onCancel:B}),H&&u.jsx(ygn,{steps:z,workflowResult:T})]}),m&&!ogn(m)&&u.jsx("div",{className:"p-5 border-b border-border1",children:u.jsx(bgn,{result:m})})]})}const bgn=({result:e})=>{const[t,r]=E.useState(!1);return u.jsxs(u.Fragment,{children:[u.jsxs(Se,{variant:"light",onClick:()=>r(!0),className:"w-full truncate",children:[u.jsx(Ce,{children:u.jsx(Kp,{className:"text-neutral3"})}),"Open Workflow Execution (JSON)"]}),u.jsx(wa,{open:t,onOpenChange:r,children:u.jsxs(sa,{className:"max-w-6xl",children:[u.jsxs(Sa,{children:[u.jsx(aa,{children:"Workflow Execution (JSON)"}),u.jsx(Ei,{children:"JSON view of the workflow execution result"})]}),u.jsx(Ea,{className:"max-h-[90vh]",children:u.jsx(mi,{data:e,className:"p-4"})})]})})]})},vgn=({workflowId:e,runId:t,observeWorkflowStream:r,...n})=>{const{runSnapshot:s,isLoadingRunExecutionResult:a}=E.useContext(bg);if(a)return u.jsx("div",{className:"p-4",children:u.jsx(Pr,{className:"h-[600px]"})});if(!s||!t)return u.jsx("div",{className:"p-4",children:u.jsx(We,{variant:"ui-md",className:"text-neutral6 text-center",children:"No previous run"})});const i=mae(s),o=i?.status;if(t)return u.jsx("div",{className:"h-full grid grid-rows-[1fr_auto]",children:u.jsx(Dvt,{...n,paramsRunId:t,workflowId:e,observeWorkflowStream:()=>{o!=="success"&&o!=="failed"&&o!=="canceled"&&r?.({workflowId:e,runId:t,storeRunResult:i})}})})};function yf({iconSlot:e,titleSlot:t,descriptionSlot:r,actionSlot:n,className:s,as:a="h3"}){return u.jsxs("div",{className:J("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&u.jsx("div",{className:"mb-4",children:e}),u.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),r&&u.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:r}),n&&u.jsx("div",{className:"mt-5",children:n})]})}const xgn={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},Vl=({className:e,children:t,size:r="default",style:n})=>u.jsx("table",{className:J("w-full",xgn[r],e),style:n,children:t}),ql=({className:e,children:t})=>u.jsx("thead",{children:u.jsx("tr",{className:J("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),Ms=({className:e,children:t,...r})=>u.jsx("th",{className:J("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}),Hl=({className:e,children:t,...r})=>u.jsx("tbody",{className:J("",e),...r,children:t}),Zl=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 c=d=>{d.key==="Enter"&&s&&s()};return u.jsx("tr",{className:J("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:c,"data-active":a||void 0,...i,children:t})}),Ds=({className:e,children:t,...r})=>u.jsx("td",{className:J("text-neutral5 first:pl-3 last:pr-3",e),...r,children:u.jsx("div",{className:J("flex h-full w-full shrink-0 items-center"),children:t})}),uM=({className:e,children:t})=>u.jsx(Ds,{className:e,children:u.jsx(We,{as:"span",variant:"ui-md",className:"w-full truncate",children:t})}),Yw=({name:e,description:t,icon:r,meta:n,...s})=>u.jsx(Ds,{...s,children:u.jsxs("div",{className:"flex items-center gap-3.5",children:[r&&u.jsx(Ce,{size:"lg",className:"text-neutral5",children:r}),u.jsxs("div",{className:"flex flex-col gap-0",children:[u.jsx(We,{as:"span",variant:"ui-md",className:"text-neutral6 !leading-tight",children:e}),t&&u.jsx(We,{as:"span",variant:"ui-xs",className:"text-neutral3 w-full max-w-[300px] truncate !leading-tight pt-1",children:t})]}),n]})});function IO({itemCount:e,initialIndex:t=-1,wrap:r=!1,onSelect:n,global:s=!1}){const[a,i]=E.useState(t),o=E.useCallback(c=>{if(e!==0)switch(c.key){case"ArrowDown":{c.preventDefault(),i(d=>d===-1?0:d>=e-1?r?0:e-1:d+1);break}case"ArrowUp":{c.preventDefault(),i(d=>d===-1?e-1:d<=0?r?e-1:0:d-1);break}case"Home":{c.preventDefault(),i(0);break}case"End":{c.preventDefault(),i(e-1);break}case"Enter":{a>=0&&n&&(c.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 P5e=40,dM=150,j5e=10,Ly=({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,c]=E.useState(0),[d,p]=E.useState(0),[f,h]=E.useState(0),[m,g]=E.useState(!1),[b,v]=E.useState(!1);E.useEffect(()=>{const O=()=>{if(!s.current)return;const I=s.current.scrollLeft<s.current.scrollWidth-s.current.clientWidth;g(I),o(s.current.clientHeight);const R=s.current.getBoundingClientRect();c(R.right),h(R.left),p(R.top)};O();const C=new ResizeObserver(O);s.current&&C.observe(s.current);const T=()=>{if(!s.current)return;const I=s.current.scrollLeft>0,R=s.current.scrollLeft<s.current.scrollWidth-s.current.clientWidth;v(I),g(R),O()};s?.current?.addEventListener("scroll",T);const A=s.current;return()=>{A&&(C.unobserve(A),A.removeEventListener("scroll",T))}},[]);const w=({isVisible:O,position:C,containerHeight:T,containerTop:A,containerRight:I,onStartScrolling:R,onStopScrolling:P})=>{if(!O)return null;const L={top:T<dM?A:A+(T-dM)/2,width:P5e,height:T<dM?`${T}px`:`${dM}px`};return u.jsxs("button",{onMouseDown:R,onTouchStart:R,onMouseUp:P,onTouchEnd:P,onTouchCancel:P,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+j5e:I-P5e-j5e},children:[" ",C==="left"?"«":"»"]})},S=E.useCallback((O,C)=>{C?.preventDefault(),C?.stopPropagation(),a.current&&(clearInterval(a.current),a.current=null),s.current&&s.current.scrollBy({left:O==="right"?r*2:-r*2,behavior:"smooth"}),a.current=setInterval(()=>{s.current&&s.current.scrollBy({left:O==="right"?r:-r,behavior:"smooth"})},n)},[r,n]),_=E.useCallback(()=>{a.current&&(clearInterval(a.current),a.current=null)},[]);return u.jsxs("div",{ref:s,className:J("relative max-h-full overflow-auto",e),children:[t,u.jsx(w,{isVisible:b,position:"left",containerHeight:i,containerTop:d,containerRight:l,onStartScrolling:O=>S("left",O),onStopScrolling:_}),u.jsx(w,{isVisible:m,position:"right",containerHeight:i,containerTop:d,containerRight:l,onStartScrolling:O=>S("right",O),onStopScrolling:_})]})},wgn=[{id:"name",header:"Name",cell:({row:e})=>{const{Link:t,paths:r}=ur(),n=e.original;return u.jsx(Yw,{name:u.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 u.jsx(Ds,{children:u.jsx("div",{className:"flex justify-end items-center gap-2",children:u.jsxs(Gt,{icon:u.jsx(GHe,{}),className:"!h-form-sm",children:[r," step",r>1?"s":""]})})})}}],$5e={sm:fi.sm,md:fi.md,lg:fi.lg,default:fi.default},ap=({onSearch:e,label:t,placeholder:r,debounceMs:n=300,size:s="md"})=>{const a=E.useId(),i=E.useRef(null),o=uP(c=>{e(c)},n);E.useEffect(()=>()=>{o.cancel()},[o]),E.useEffect(()=>{const c=i.current;if(!c)return;const d=p=>{p.key.toLowerCase()==="f"&&p.shiftKey&&(p.ctrlKey||p.metaKey)&&(p.preventDefault(),c.focus())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[]);const l=c=>{o(c.target.value)};return u.jsxs("div",{className:J("border border-border1 flex w-full items-center gap-2 overflow-hidden pl-2 pr-1",PP,Ehn,Jr.all,"hover:border-neutral2",$5e[s]),children:[u.jsx(Ox,{className:J("text-neutral3 h-4 w-4",Jr.colors)}),u.jsxs("div",{className:"flex-1",children:[u.jsx("label",{htmlFor:a,className:"sr-only",children:t}),u.jsx("input",{id:a,type:"text",placeholder:r,className:J("bg-transparent text-ui-md placeholder:text-neutral3 block w-full px-2 outline-none",$5e[s]),name:a,ref:i,onChange:l})]})]})},Vx=({children:e})=>u.jsx("div",{className:"px-3 py-2.5 border-b border-border1",children:e});function Sgn({workflows:e,isLoading:t}){const[r,n]=E.useState(""),{navigate:s,paths:a}=ur(),i=E.useMemo(()=>Object.keys(e??{}).map(h=>{const m=e[h];return{id:h,...m}}),[e]),o=E.useMemo(()=>i.filter(f=>f.name.toLowerCase().includes(r.toLowerCase())),[i,r]),{activeIndex:l}=IO({itemCount:o.length,global:!0,onSelect:f=>{const h=o[f];h&&s(a.workflowLink(h.id))}}),c=Bw({data:o,columns:wgn,getCoreRowModel:Fw()}),d=c.getHeaderGroups()[0],p=c.getRowModel().rows;return i.length===0&&!t?u.jsx(_gn,{}):u.jsxs("div",{children:[u.jsx(Vx,{children:u.jsx(ap,{onSearch:n,label:"Search workflows",placeholder:"Search workflows"})}),t?u.jsx(Egn,{}):u.jsx(Ly,{children:u.jsxs(Vl,{children:[u.jsx(ql,{className:"sticky top-0",children:d.headers.map(f=>u.jsx(Ms,{style:{width:f.index===0?"auto":f.column.getSize()},children:Bu(f.column.columnDef.header,f.getContext())},f.id))}),u.jsx(Hl,{children:p.map((f,h)=>u.jsx(Zl,{isActive:h===l,onClick:()=>s(a.workflowLink(f.original.id)),children:f.getVisibleCells().map(m=>u.jsx(Ee.Fragment,{children:Bu(m.column.columnDef.cell,m.getContext())},m.id))},f.id))})]})})]})}const Egn=()=>u.jsxs(Vl,{children:[u.jsxs(ql,{children:[u.jsx(Ms,{children:"Name"}),u.jsx(Ms,{width:300,children:"Steps"})]}),u.jsx(Hl,{children:Array.from({length:3}).map((e,t)=>u.jsxs(Zl,{children:[u.jsx(Ds,{children:u.jsx(Pr,{className:"h-4 w-1/2"})}),u.jsx(Ds,{width:300,children:u.jsx(Pr,{className:"h-4 w-1/2"})})]},t))})]}),_gn=()=>u.jsx("div",{className:"flex h-full items-center justify-center",children:u.jsx(yf,{iconSlot:u.jsx(Vhn,{}),titleSlot:"Configure Workflows",descriptionSlot:"Mastra workflows are not configured yet. You can find more information in the documentation.",actionSlot:u.jsxs(Se,{size:"lg",className:"w-full",variant:"light",as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(dc,{})}),"Docs"]})})}),Ivt=({icon:e,title:t,isLoading:r,children:n})=>u.jsxs("div",{className:"p-5 w-full overflow-x-hidden",children:[u.jsxs("div",{className:"text-neutral6 flex items-center gap-2",children:[u.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),r?u.jsx(Pr,{className:"h-3 w-1/3"}):u.jsx("div",{className:"flex min-w-0 items-center gap-4",children:u.jsx(We,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),n&&u.jsx("div",{className:"pt-2",children:n})]}),BP=({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,c=d=>{const p=d;o?n(p):i(p)};return u.jsx(sWr,{value:l,onValueChange:c,className:J("overflow-y-auto",s),children:e})},zP=({children:e,variant:t="default",className:r})=>u.jsx("div",{className:J("w-full overflow-x-auto",r),children:u.jsx(aWr,{className:J("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]:${Jr.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]:${Jr.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})}),Uc=({children:e,value:t,onClick:r,onClose:n,className:s})=>u.jsxs(iWr,{value:t,className:J("text-sm p-3 text-neutral3 whitespace-nowrap flex-shrink-0 flex items-center justify-center gap-1.5",Jr.all,Qw.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&&u.jsx("button",{onClick:a=>{a.stopPropagation(),n()},className:J("p-0.5 hover:bg-surface4 rounded",Jr.colors,"hover:text-neutral5"),"aria-label":"Close tab",children:u.jsx(Oa,{className:"w-3 h-3"})})]}),Ed=({children:e,value:t,className:r})=>u.jsx(oWr,{value:t,className:J("grid py-3 overflow-y-auto ring-offset-background",Qw.visible,r),children:e}),kgn=()=>{const{debugMode:e,setDebugMode:t}=E.useContext(bg);return u.jsxs(u.Fragment,{children:[u.jsx(We,{as:"h3",variant:"ui-md",className:"text-neutral3",children:"Debug Mode"}),u.jsx(Wd,{checked:e,onCheckedChange:r=>t(r)})]})},Nvt=()=>{const e=Ux(),{settings:t,setSettings:r,entityType:n}=Xme(),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 u.jsxs("div",{className:"space-y-2 px-5 py-2",children:[u.jsx(We,{as:"h3",variant:"ui-md",className:"text-neutral3",children:"Tracing Options"}),u.jsx(Ld,{value:a,onChange:s,theme:e,extensions:[Nd],className:"h-[400px] overflow-y-scroll bg-surface3 rounded-lg overflow-hidden p-3"}),n==="workflow"&&u.jsx(kgn,{})]})},Ogn={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function vs({color:e,className:t,size:r="md"}){return u.jsx("svg",{className:J("animate-spin",Ogn[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:u.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:e||"currentColor",className:"text-accent1"})})}function Cgn({stepGraph:e,open:t,workflowName:r}){const{nodes:n,edges:s}=mvt({stepGraph:e}),[a,i]=E.useState(!1),[o,l,c]=Oat(n),[d]=Cat(s),{steps:p}=LP(),f=E.useMemo(()=>s.reduce((m,g)=>{if(g.data){const b=g.data.nextStepId,v=g.data.previousStepId;return{...m,[b]:[...new Set([...m[b]||[],v])]}}return m},{}),[s]),h={"default-node":m=>u.jsx(kvt,{parentWorkflowName:r,...m,stepsFlow:f}),"condition-node":Evt,"after-node":Ovt,"loop-result-node":Cvt,"nested-node":m=>u.jsx(Tvt,{parentWorkflowName:r,...m,stepsFlow:f})};return E.useEffect(()=>{t&&setTimeout(()=>{i(!0)},500)},[t]),u.jsx("div",{className:"w-full h-full relative bg-surface1",children:a?u.jsxs(kat,{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:c,children:[u.jsx(age,{position:"bottom-left"}),u.jsx(Aat,{variant:Rm.Lines,gap:12,size:.5})]}):u.jsx("div",{className:"w-full h-full flex items-center justify-center",children:u.jsx(vs,{})})})}function Tgn(){const{stepDetail:e,closeStepDetail:t}=Z8();return e?u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border1 bg-surface1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[e.type==="map-config"&&u.jsx(I_,{className:"w-4 h-4",style:{color:po.map}}),e.type==="nested-graph"&&u.jsx(dc,{className:"w-4 h-4",style:{color:po.workflow}}),u.jsxs("div",{className:"flex flex-col",children:[u.jsx(We,{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&&u.jsx(We,{variant:"ui-xs",className:"text-neutral3",children:e.stepId})]})]}),u.jsx("button",{onClick:t,className:"p-1 hover:bg-surface3 rounded transition-colors","aria-label":"Close",children:u.jsx(Oa,{className:"w-4 h-4 text-neutral3"})})]}),u.jsxs("div",{className:"flex-1 overflow-auto",children:[e.type==="map-config"&&e.mapConfig&&u.jsx(hE,{data:e.mapConfig}),e.type==="nested-graph"&&e.nestedGraph&&u.jsx("div",{className:"h-full min-h-[400px]",children:u.jsx(hpe,{children:u.jsx(Cgn,{stepGraph:e.nestedGraph.stepGraph,open:!0,workflowName:e.nestedGraph.fullStep})},e.nestedGraph.fullStep)})]})]}):null}const ige=({requestContextSchema:e})=>{const{setSchemaValues:t,schemaValues:r}=Svt(),n=JSON.stringify(r),s=E.useMemo(()=>{try{const a=hx(e);return Km(Xm(a))}catch(a){return console.error("Failed to parse requestContextSchema:",a),null}},[e]);return s?u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(We,{as:"span",variant:"ui-md",className:"text-neutral3",children:"Request Context"}),u.jsx(oc,{content:n})]}),u.jsx(ege,{schema:s,onSubmit:t,submitButtonLabel:"Save",defaultValues:r})]}):u.jsx("div",{className:"text-neutral3",children:u.jsx(We,{variant:"ui-sm",children:"Failed to parse request context schema"})})};function Agn(){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 Dgn({workflowId:e,initialRunId:t}){const{data:r,isLoading:n,error:s}=MP(e),{createWorkflowRun:a,streamWorkflow:i,streamResult:o,isStreamingWorkflow:l,observeWorkflowStream:c,closeStreamsAndReset:d,resumeWorkflow:p,cancelWorkflowRun:f,isCancellingWorkflowRun:h}=E.useContext(bg),{stepDetail:m,closeStepDetail:g}=Z8(),[b,v]=E.useState("current-run"),[w,S]=E.useState(""),{handleCopy:_}=kh({text:e}),O=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(()=>{!w&&!t&&d()},[w,t]),E.useEffect(()=>{if(s){const A=s instanceof Error?s.message:"Failed to load workflow";Je.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"&&g(),v(A)};return s?null:u.jsxs("div",{className:"grid grid-rows-[auto_1fr] h-full overflow-y-auto",children:[u.jsx(Ivt,{icon:u.jsx(dc,{}),title:r?.name||"",isLoading:n,children:u.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[u.jsxs(Yn,{children:[u.jsx(Kn,{asChild:!0,children:u.jsx("button",{onClick:_,className:"h-badge-default",children:u.jsx(Gt,{icon:u.jsx(cc,{}),variant:"default",children:e})})}),u.jsx(Vn,{children:"Copy Workflow ID for use in code"})]}),u.jsxs(Gt,{children:[O," step",O>1?"s":""]}),r?.isProcessorWorkflow&&u.jsx(Gt,{icon:u.jsx(kD,{className:"h-3 w-3"}),className:"bg-violet-500/20 text-violet-400",children:"Processor"})]})}),u.jsx("div",{className:"flex-1 overflow-auto border-t border-border1 flex flex-col",children:u.jsxs(BP,{defaultTab:"current-run",value:b,onValueChange:T,className:"h-full",children:[u.jsxs(zP,{children:[u.jsx(Uc,{value:"current-run",children:"Current Run"}),r?.requestContextSchema&&u.jsx(Uc,{value:"request-context",children:"Request Context"}),u.jsx(Uc,{value:"run-options",children:"Run Options"}),m&&C&&u.jsxs(Uc,{value:"node-details",onClose:()=>{g(),v("current-run")},children:[C," Details"]})]}),u.jsx(Ed,{value:"current-run",children:e?t?u.jsx(vgn,{workflowId:e,runId:t,setRunId:S,workflow:r??void 0,isLoading:n,createWorkflowRun:a,streamWorkflow:i,resumeWorkflow:p,streamResult:o,isStreamingWorkflow:l,isCancellingWorkflowRun:h,cancelWorkflowRun:f,observeWorkflowStream:c}):u.jsx(Dvt,{workflowId:e,setRunId:S,workflow:r??void 0,isLoading:n,createWorkflowRun:a,streamWorkflow:i,resumeWorkflow:p,streamResult:o,isStreamingWorkflow:l,isCancellingWorkflowRun:h,cancelWorkflowRun:f}):null}),r?.requestContextSchema&&u.jsx(Ed,{value:"request-context",children:u.jsx("div",{className:"p-5",children:u.jsx(ige,{requestContextSchema:r.requestContextSchema})})}),u.jsx(Ed,{value:"run-options",children:u.jsx(Nvt,{})}),m&&u.jsx(Ed,{value:"node-details",children:u.jsx(Tgn,{})})]})})]})}const io={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",popup:J("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:J("flex items-center border-b border-border1 px-3 py-2",Jr.colors),searchIcon:J("mr-2 h-4 w-4 shrink-0 text-neutral3",Jr.colors),searchInput:J("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",Jr.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:J("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",Jr.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:J("h-4 w-4 text-accent1",Jr.opacity),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 Mh({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:c="md",open:d,onOpenChange:p,container:f,error:h}){const m=e.find(b=>b.value===t)??null,g=b=>{b&&r?.(b.value)};return u.jsxs("div",{className:io.root,children:[u.jsxs(DYr,{items:e,value:m,onValueChange:g,disabled:o,open:d,onOpenChange:p,children:[u.jsxs(ZYr,{className:J(Gme({variant:l,size:c}),io.trigger,h&&io.triggerError,i),children:[u.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,u.jsx(IYr,{placeholder:n})]}),u.jsx(I3t,{className:io.chevron})]}),u.jsx(nKr,{container:f,children:u.jsx(bKr,{align:"start",sideOffset:4,className:io.positioner,children:u.jsxs(wKr,{className:io.popup,children:[u.jsxs("div",{className:io.searchContainer,children:[u.jsx(Ox,{className:io.searchIcon}),u.jsx(BYr,{className:io.searchInput,placeholder:s})]}),u.jsx(TKr,{className:io.empty,children:a}),u.jsx(tKr,{className:io.list,children:b=>u.jsxs(kKr,{value:b,className:J(io.item,io.itemSelected),children:[u.jsx("span",{className:io.checkContainer,children:u.jsx(OKr,{children:u.jsx(ni,{className:io.checkIcon})})}),u.jsxs("span",{className:io.optionContent,children:[b.start,u.jsxs("span",{className:io.optionText,children:[u.jsx("span",{className:io.optionLabel,children:b.label}),b.description&&u.jsx("span",{className:io.optionDescription,children:b.description})]}),b.end?u.jsx("div",{className:io.optionEnd,children:b.end}):null]})]},b.value)})]})})})]}),h&&u.jsx("span",{className:io.error,children:h})]})}const eb=()=>{const e=ht(),{requestContext:t}=ma();return Cr({queryKey:["workflows",t],queryFn:async()=>{const r=await e.listWorkflows(t);return Object.fromEntries(Object.entries(r).filter(([n,s])=>!s.isProcessorWorkflow))}})};function Ign({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:c,isError:d,error:p}=eb(),{navigate:f,paths:h}=ur();E.useEffect(()=>{if(d){const b=p instanceof Error?p.message:"Failed to load workflows";Je.error(`Error loading workflows: ${b}`)}},[d,p]);const m=Object.keys(l).map(b=>({label:l[b]?.name||b,value:b})),g=b=>{t?t(b):b&&b!==e&&f(h.workflowLink(b))};return u.jsx(Mh,{options:m,value:e,onValueChange:g,placeholder:c?"Loading workflows...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||c||d,variant:o})}function yn({children:e,className:t,style:r}){const n=Rvt("MainContentLayout");return u.jsx("main",{className:J("grid grid-rows-[auto_1fr] h-full items-start content-start",t),style:{...r,...n?{border:"3px dotted red"}:{}},children:e})}function eo({children:e,className:t,isCentered:r=!1,isDivided:n=!1,hasLeftServiceColumn:s=!1,style:a}){const i=Rvt("MainContentContent"),o=oge({isCentered:r,isDivided:n,hasLeftServiceColumn:s,className:t});return u.jsx("div",{className:o,style:{...a,...i?{border:"3px dotted orange"}:{}},children:e})}const oge=({isCentered:e,isDivided:t,hasLeftServiceColumn:r,className:n})=>J("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 Rvt(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 xL=()=>u.jsx(uJr,{className:J("w-1.5 bg-surface3","[&[data-separator='hover']]:!bg-surface4","[&[data-separator='active']]:!bg-surface5","focus:outline-none")}),wL=({collapsedSize:e,children:t,direction:r,...n})=>{const[s,a]=E.useState(!1),i=lJr(),o=()=>{i.current&&i.current.expand()};return u.jsx(Lhe,{panelRef:i,collapsedSize:e,...n,onResize:l=>{e&&typeof e=="number"&&(l.inPixels<=e?a(!0):s&&a(!1))},children:s?u.jsxs(Yn,{children:[u.jsx("div",{className:"flex items-center justify-center h-full",children:u.jsx(Kn,{asChild:!0,children:u.jsx(Se,{onClick:o,className:"!h-48 border-none",children:u.jsx(Ce,{children:r==="left"?u.jsx(Tm,{}):u.jsx(TR,{})})})})}),u.jsx(Vn,{children:"Expand"})]}):t})},Ngn=({workflowId:e,children:t,leftSlot:r,rightSlot:n})=>{const{defaultLayout:s,onLayoutChange:a}=cht({id:`workflow-layout-${e}`,storage:localStorage}),i=oge({isCentered:!1,isDivided:!0,hasLeftServiceColumn:!!r});return u.jsxs(lht,{className:i,defaultLayout:s,onLayoutChange:a,children:[r&&u.jsxs(u.Fragment,{children:[u.jsx(wL,{direction:"left",id:"left-slot",minSize:200,maxSize:"30%",defaultSize:200,collapsedSize:60,collapsible:!0,children:r}),u.jsx(xL,{})]}),u.jsx(Lhe,{id:"main-slot",children:t}),n&&u.jsxs(u.Fragment,{children:[u.jsx(xL,{}),u.jsx(wL,{direction:"right",id:"right-slot",minSize:300,maxSize:"50%",defaultSize:300,collapsedSize:60,collapsible:!0,children:n})]})]})},lge=()=>u.jsx(q8,{icon:u.jsx(vs,{color:rZe.neutral3}),title:u.jsx(Pr,{className:"ml-2 w-12 h-2"}),collapsible:!1}),Rgn=({result:e,workflowId:t,isStreaming:r,metadata:n,toolCallId:s,toolApprovalMetadata:a,suspendPayload:i,toolName:o,isNetwork:l,toolCalled:c})=>{const{runId:d,status:p}=e||{},{data:f,isLoading:h}=MP(t),{data:m,isLoading:g}=uvt(t,{enabled:!!d&&!r}),b=m?.find(C=>C.runId===d),v=g||!b,w=typeof b?.snapshot=="object"?b?.snapshot:void 0,S=n?.mode==="network"?n.selectionReason:void 0,_=n?.mode==="network"?n.agentInput:void 0;let O=typeof i=="string"?u.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:i}):u.jsx(mi,{data:i,"data-testid":"tool-suspend-payload"});return h||!f?u.jsx(lge,{}):u.jsxs(q8,{"data-testid":"workflow-badge",icon:u.jsx(dc,{className:"text-accent3"}),title:f.name,initialCollapsed:!1,extraInfo:n?.mode==="network"&&u.jsx(Qme,{selectionReason:S??"",input:_}),children:[!r&&!v&&u.jsx(Yme,{snapshot:w,workflowId:t,initialRunId:d,withoutTimeTravel:!0,children:u.jsx(M5e,{workflowId:t,workflow:f,runId:d})}),r&&u.jsx(M5e,{workflowId:t,workflow:f,runId:d}),O!==void 0&&i&&u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Workflow suspend payload"}),O]}),u.jsx($P,{toolCalled:c??!!p,toolCallId:s,toolApprovalMetadata:a,toolName:o,isNetwork:l,isGenerateMode:n?.mode==="generate"})]})},M5e=({workflowId:e,workflow:t,runId:r})=>{const{Link:n}=ur();return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center gap-2 pb-2",children:[u.jsx(Se,{as:n,href:`/workflows/${e}/graph`,children:"Go to workflow"}),r&&u.jsx(Se,{as:n,href:`/workflows/${e}/graph/${r}`,children:"See run"})]}),u.jsx("div",{className:"rounded-md overflow-hidden h-[60vh] w-full",children:u.jsx(Avt,{workflowId:e,workflow:t})})]})},Pgn=e=>{const{setResult:t}=E.useContext(bg);E.useEffect(()=>{e&&t(e)},[e])},jgn=({agentId:e,messages:t=[],metadata:r,toolCallId:n,toolApprovalMetadata:s,toolName:a,isNetwork:i,suspendPayload:o,toolCalled:l})=>{const c=r?.mode==="network"?r.selectionReason:void 0,d=r?.mode==="network"?r.agentInput:void 0;let p=t.length>0;i&&(p=l??t.every(h=>h.type==="text"?!0:!!h.toolOutput));let f=typeof o=="string"?u.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:o}):u.jsx(mi,{data:o,"data-testid":"tool-suspend-payload"});return u.jsxs(q8,{"data-testid":"agent-badge",icon:u.jsx(Ji,{className:"text-accent1"}),title:e,initialCollapsed:!1,extraInfo:r?.mode==="network"&&u.jsx(Qme,{selectionReason:c??"",input:d}),children:[t.map((h,m)=>{if(h.type==="text")return u.jsx(hgt,{children:h.content},m);let g;try{g=typeof h.toolOutput=="string"?JSON.parse(h.toolOutput):h.toolOutput}catch{g=h.toolOutput}return u.jsx(Ee.Fragment,{children:u.jsx(Fvt,{toolName:h.toolName,argsText:typeof h.args=="string"?h.args:JSON.stringify(h.args),result:g,args:h.args,status:{type:"complete"},type:"tool-call",toolCallId:h.toolCallId,addResult:()=>{},resume:()=>{},metadata:{mode:"stream"}})},m)}),f!==void 0&&o&&u.jsxs("div",{children:[u.jsx("p",{className:"font-medium pb-2",children:"Agent suspend payload"}),f]}),u.jsx($P,{toolCalled:p,toolCallId:n,toolApprovalMetadata:s,toolName:a,isNetwork:i,isGenerateMode:r?.mode==="generate"})]})},Pvt=({threadId:e,agentId:t,memory:r})=>{const n=ht(),{requestContext:s}=ma();return Cr({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})},$gn=({agentId:e,result:t,metadata:r,toolCallId:n,toolApprovalMetadata:s,toolName:a,isNetwork:i,suspendPayload:o,toolCalled:l})=>{const{data:c,isLoading:d}=Pvt({threadId:t?.subAgentThreadId,agentId:e,memory:!0});if(d)return u.jsx(lge,{});const p=c?.messages?fgt(c.messages):[],f=t?.childMessages??agr(p);return u.jsx(jgn,{agentId:e,messages:f,metadata:r,toolCallId:n,toolApprovalMetadata:s,toolName:a,isNetwork:i,suspendPayload:o,toolCalled:l})};function $k({children:e}){const t=e.replace(/\\n/g,`
|
|
609
609
|
`);return u.jsx(hgt,{remarkPlugins:[kGe],components:Lgn,className:"space-y-3",children:t})}const jvt=Ee.memo(({children:e,language:t,...r})=>{const[n,s]=E.useState([]);return E.useEffect(()=>{lmn(e,t).then(a=>{a&&s(a)})},[e,t]),n.length?u.jsx("pre",{...r,children:u.jsx("code",{children:n.map((a,i)=>u.jsxs(u.Fragment,{children:[u.jsx("span",{children:a.map((o,l)=>{const c=typeof o.htmlStyle=="string"?void 0:o.htmlStyle;return u.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",style:c,children:o.content},l)})},i),i!==n.length-1&&`
|
|
@@ -648,4 +648,4 @@ Token usage: ${r} input + ${n} output = ${s} total`:`The model stopped generatin
|
|
|
648
648
|
`),l=a;l<o.length;l++){var c=o[l];if(!(c.length>1024)){var d=ILe.test(c)?c.replace(ILe,"$1"):c;if(!d.match(/\S*Error: /)){for(var p of r){var f=p(d,e);if(f){i.push(f);break}}if(i.length>=NLe)break}}}return(function(h){if(!h.length)return[];var m=Array.from(h);return m.reverse(),m.slice(0,NLe).map((g=>{return cr({},g,{filename:g.filename||(b=m,b[b.length-1]||{}).filename,function:g.function||Lk});var b}))})(i)}}class dOn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,r){var n=Yo(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 DL(t,"DOMException")}isDOMError(t){return DL(t,"DOMError")}}class pOn{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 fOn{constructor(){}match(t){return DL(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 hOn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class mOn{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(hOn);return s&&(r=s[1],n=s[2]),[r,n]}}var gOn=["fatal","error","warning","log","info","debug"];function g1t(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 yOn{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 h1t(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: "+g1t(t)}isSeverityLevel(t){return Yo(t)&&!Mae(t)&&gOn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=t[r];if(eOn(n))return n}}getObjectClassName(t){try{var r=Object.getPrototypeOf(t);return r?r.constructor.name:void 0}catch{return}}}class bOn{match(t){return h1t(t)}coerce(t,r){var n,s=t.constructor.name;return{type:s,value:s+" captured as exception with keys: "+g1t(t),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}}class vOn{match(t){return Lae(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 xOn{match(t){return DL(t,"PromiseRejectionEvent")}coerce(t,r){var n,s=this.getUnhandledRejectionReason(t);return Lae(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(Lae(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 y1t=function(e,t){var{debugEnabled:r}=t===void 0?{}:t,n={k:function(s){if(Xe&&(ny.DEBUG||pn.POSTHOG_DEBUG||r)&&!qt(Xe.console)&&Xe.console){for(var a=("__rrweb_original__"in Xe.console[s])?Xe.console[s].__rrweb_original__:Xe.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)=>y1t(e+" "+s,a)};return n},Kt=y1t("[PostHog.js]"),rl=Kt.createLogger,wOn=rl("[ExternalScriptsLoader]"),RLe=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return wOn.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var n=Xt?.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",(c=>{l.__posthog_loading_callback_fired=!0,r(void 0,c)})),l.onerror=c=>r(c),{v:void 0})}},i=0;i<n.length;i++)if(s=a())return s.v}var o=()=>{if(!Xt)return r("document not found");var l=Xt.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 c,d=Xt.querySelectorAll("body > script");d.length>0?(c=d[0].parentNode)==null||c.insertBefore(l,d[0]):Xt.body.appendChild(l)};Xt!=null&&Xt.body?o():Xt?.addEventListener("DOMContentLoaded",o)};pn.__PosthogExtensions__=pn.__PosthogExtensions__||{},pn.__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);RLe(e,a,r)},pn.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var n=e.requestRouter.endpointFor("api",t);RLe(e,n,r)};var IL={};function Lv(e,t,r){if(Na(e)){if(_Le&&e.forEach===_Le)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)===IL)return}}}function qa(e,t,r){if(!_a(e)){if(Na(e))return Lv(e,t,r);if(Wkn(e)){for(var n of e.entries())if(t.call(r,n[1],n[0])===IL)return}else for(var s in e)if(f1t.call(e,s)&&t.call(r,e[s],s)===IL)return}}var fo=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 Lv(r,(function(s){for(var a in s)s[a]!==void 0&&(e[a]=s[a])})),e},PO=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 Lv(r,(function(s){Lv(s,(function(a){e.push(a)}))})),e};function O3(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 PLe=function(e){try{return e()}catch{return}},SOn=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)}}},Oge=function(e){var t={};return qa(e,(function(r,n){(Yo(r)&&r.length>0||Jm(r))&&(t[n]=r)})),t};function EOn(e,t){return r=e,n=a=>Yo(a)&&!nb(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),Na(i)?(l=[],Lv(i,(c=>{l.push(a(c))}))):(l={},qa(i,((c,d)=>{s.has(c)||(l[d]=a(c,d))}))),l);var l})(r);var r,n,s}var _On=["herokuapp.com","vercel.app","netlify.app"];function kOn(e){var t=e?.hostname;if(!Yo(t))return!1;var r=t.split(".").slice(-2).join(".");for(var n of _On)if(r===n)return!1;return!0}function b1t(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function To(e,t,r,n){var{capture:s=!1,passive:a=!0}=n??{};e?.addEventListener(t,r,{capture:s,passive:a})}var v1t="$people_distinct_id",tA="__alias",rA="__timers",jLe="$autocapture_disabled_server_side",Bae="$heatmaps_enabled_server_side",$Le="$exception_capture_enabled_server_side",zae="$error_tracking_suppression_rules",MLe="$error_tracking_capture_extension_exceptions",LLe="$web_vitals_enabled_server_side",x1t="$dead_clicks_enabled_server_side",FLe="$web_vitals_allowed_metrics",uee="$session_recording_remote_config",NL="$sesid",w1t="$session_is_sampled",PE="$enabled_feature_flags",nA="$early_access_features",Uae="$feature_flag_details",sA="$stored_person_properties",R0="$stored_group_properties",Vae="$surveys",bM="$surveys_activated",RL="$flag_call_reported",sy="$user_state",qae="$client_session_props",Hae="$capture_rate_limit",Zae="$initial_campaign_params",Gae="$initial_referrer_info",PL="$initial_person_info",jL="$epp",S1t="__POSTHOG_TOOLBAR__",vT="$posthog_cookieless",OOn=[v1t,tA,"__cmpns",rA,"$session_recording_enabled_server_side",Bae,NL,PE,zae,sy,nA,Uae,R0,sA,Vae,RL,qae,Hae,Zae,Gae,jL,PL];function BLe(e){return e instanceof Element&&(e.id===S1t||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function a7(e){return!!e&&e.nodeType===1}function Fv(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function E1t(e){return!!e&&e.nodeType===3}function _1t(e){return!!e&&e.nodeType===11}function Cge(e){return e?n7(e).split(/\s+/):[]}function zLe(e){var t=Xe?.location.href;return!!(t&&e&&e.some((r=>t.match(r))))}function $L(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 Cge(t)}function k1t(e){return _a(e)?null:n7(e).split(/(\s+)/).filter((t=>VN(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ZP(e){var t="";return Qae(e)&&!D1t(e)&&e.childNodes&&e.childNodes.length&&qa(e.childNodes,(function(r){var n;E1t(r)&&r.textContent&&(t+=(n=k1t(r.textContent))!==null&&n!==void 0?n:"")})),n7(t)}function O1t(e){return qt(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Tge=["a","button","form","input","select","textarea","label"];function C1t(e,t){if(qt(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 T1t(e){var t=e.parentNode;return!(!t||!a7(t))&&t}var COn=["next","previous","prev",">","<"],ULe=10,VLe=[".ph-no-rageclick",".ph-no-capture"];function TOn(e,t){if(!Xe||Age(e))return!1;var r,n,s;if(Mv(t)?(r=!!t&&VLe,n=void 0):(r=(s=t?.css_selector_ignorelist)!==null&&s!==void 0?s:VLe,n=t?.content_ignorelist),r===!1)return!1;var{targetElementList:a}=A1t(e,!1);return!(function(i,o){if(i===!1||qt(i))return!1;var l;if(i===!0)l=COn;else{if(!Na(i))return!1;if(i.length>ULe)return Kt.error("[PostHog] content_ignorelist array cannot exceed "+ULe+" items. Use css_selector_ignorelist for more complex matching."),!1;l=i.map((c=>c.toLowerCase()))}return o.some((c=>{var{safeText:d,ariaLabel:p}=c;return l.some((f=>d.includes(f)||p.includes(f)))}))})(n,a.map((i=>{var o;return{safeText:ZP(i).toLowerCase(),ariaLabel:((o=i.getAttribute("aria-label"))==null?void 0:o.toLowerCase().trim())||""}})))&&!C1t(a,r)}var Age=e=>!e||Fv(e,"html")||!a7(e),A1t=(e,t)=>{if(!Xe||Age(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],s=e;s.parentNode&&!Fv(s,"body");)if(_1t(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var a=T1t(s);if(!a)break;if(t||Tge.indexOf(a.tagName.toLowerCase())>-1)r=!0;else{var i=Xe.getComputedStyle(a);i&&i.getPropertyValue("cursor")==="pointer"&&(r=!0)}n.push(a),s=a}return{parentIsUsefulElement:r,targetElementList:n}};function AOn(e,t,r,n,s){var a,i,o,l;if(r===void 0&&(r=void 0),!Xe||Age(e)||(a=r)!=null&&a.url_allowlist&&!zLe(r.url_allowlist)||(i=r)!=null&&i.url_ignorelist&&zLe(r.url_ignorelist))return!1;if((o=r)!=null&&o.dom_event_allowlist){var c=r.dom_event_allowlist;if(c&&!c.some((m=>t.type===m)))return!1}var{parentIsUsefulElement:d,targetElementList:p}=A1t(e,n);if(!(function(m,g){var b=g?.element_allowlist;if(qt(b))return!0;var v,w=function(_){if(b.some((O=>_.tagName.toLowerCase()===O)))return{v:!0}};for(var S of m)if(v=w(S))return v.v;return!1})(p,r)||!C1t(p,(l=r)==null?void 0:l.css_selector_allowlist))return!1;var f=Xe.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&&(Tge.indexOf(h)>-1||e.getAttribute("contenteditable")==="true")}}function Qae(e){for(var t=e;t.parentNode&&!Fv(t,"body");t=t.parentNode){var r=$L(t);if(is(r,"ph-sensitive")||is(r,"ph-no-capture"))return!1}if(is($L(e),"ph-include"))return!0;var n=e.type||"";if(Yo(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!(Yo(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 D1t(e){return!!(Fv(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Fv(e,"select")||Fv(e,"textarea")||e.getAttribute("contenteditable")==="true")}var I1t="(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})",DOn=new RegExp("^(?:"+I1t+")$"),IOn=new RegExp(I1t),N1t="\\d{3}-?\\d{2}-?\\d{4}",NOn=new RegExp("^("+N1t+")$"),ROn=new RegExp("("+N1t+")");function VN(e,t){return t===void 0&&(t=!0),!(_a(e)||Yo(e)&&(e=n7(e),(t?DOn:IOn).test((e||"").replace(/[- ]/g,""))||(t?NOn:ROn).test(e)))}function R1t(e){var t=ZP(e);return VN(t=(t+" "+P1t(e)).trim())?t:""}function P1t(e){var t="";return e&&e.childNodes&&e.childNodes.length&&qa(e.childNodes,(function(r){var n;if(r&&((n=r.tagName)==null?void 0:n.toLowerCase())==="span")try{var s=ZP(r);t=(t+" "+s).trim(),r.childNodes&&r.childNodes.length&&(t=(t+" "+P1t(r)).trim())}catch(a){Kt.error("[AutoCapture]",a)}})),t}function POn(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=cr({},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),c={};return O3(l).sort(((d,p)=>{var[f]=d,[h]=p;return f.localeCompare(h)})).forEach((d=>{var[p,f]=d;return c[qLe(p.toString())]=qLe(f.toString())})),i+=":",i+=O3(c).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:jOn(r),attr_id:r.attr__id,nth_child:r.nth_child,nth_of_type:r.nth_of_type,attributes:{}};return O3(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 qLe(e){return e.replace(/"|\\"/g,'\\"')}function jOn(e){var t=e.attr__class;return t?Na(t)?t:Cge(t):void 0}class j1t{constructor(t){this.disabled=t===!1;var r=ll(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 dee="$copy_autocapture",py=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({}),ML=e=>{var t=Xt?.createElement("a");return qt(t)?null:(t.href=e,t)},$On=function(e,t){var r,n;t===void 0&&(t="&");var s=[];return qa(e,(function(a,i){qt(a)||qt(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)},LL=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(!Na(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," ")},GP=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],c=(o||"").split("&"),d=[],p=0;p<c.length;p++){var f=c[p].split("=");Na(f)&&(t.includes(f[0])?d.push(f[0]+"="+r):d.push(c[p]))}var h=l;return o!=null&&(h+="?"+d.join("&")),a!=null&&(h+="#"+a),h},FL=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},HLe=rl("[AutoCapture]");function pee(e,t){return t.length>e?t.slice(0,e)+"...":t}function MOn(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!a7(t));return t}function LOn(e,t,r,n){var s=e.tagName.toLowerCase(),a={tag_name:s};Tge.indexOf(s)>-1&&!r&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?a.$el_text=pee(1024,R1t(e)):a.$el_text=pee(1024,ZP(e)));var i=$L(e);i.length>0&&(a.classes=i.filter((function(d){return d!==""}))),qa(e.attributes,(function(d){var p;if((!D1t(e)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(n==null||!n.includes(d.name))&&!t&&VN(d.value)&&(p=d.name,!Yo(p)||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")){var f=d.value;d.name==="class"&&(f=Cge(f).join(" ")),a["attr__"+d.name]=pee(1024,f)}}));for(var o=1,l=1,c=e;c=MOn(c);)o++,c.tagName===e.tagName&&l++;return a.nth_child=o,a.nth_of_type=l,a}function FOn(e,t){for(var r,n,{e:s,maskAllElementAttributes:a,maskAllText:i,elementAttributeIgnoreList:o,elementsChainAsString:l}=t,c=[e],d=e;d.parentNode&&!Fv(d,"body");)_1t(d.parentNode)?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var p,f=[],h={},m=!1,g=!1;if(qa(c,(_=>{var O=Qae(_);_.tagName.toLowerCase()==="a"&&(m=_.getAttribute("href"),m=O&&m&&VN(m)&&m),is($L(_),"ph-no-capture")&&(g=!0),f.push(LOn(_,a,i,o));var C=(function(T){if(!Qae(T))return{};var A={};return qa(T.attributes,(function(I){if(I.name&&I.name.indexOf("data-ph-capture-attribute")===0){var R=I.name.replace("data-ph-capture-attribute-",""),P=I.value;R&&P&&VN(P)&&(A[R]=P)}})),A})(_);fo(h,C)})),g)return{props:{},explicitNoCapture:g};if(i||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?f[0].$el_text=R1t(e):f[0].$el_text=ZP(e)),m){var b,v;f[0].attr__href=m;var w=(b=ML(m))==null?void 0:b.host,S=Xe==null||(v=Xe.location)==null?void 0:v.host;w&&S&&w!==S&&(p=m)}return{props:fo({$event_type:s.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:POn(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 BOn{constructor(t){this.P=!1,this.T=null,this.R=!1,this.instance=t,this.rageclicks=new j1t(t.config.rageclick),this.I=null}get F(){var t,r,n=ll(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(Xe&&Xt){var t=n=>{n=n||Xe?.event;try{this.M(n)}catch(s){HLe.error("Failed to capture event",s)}};if(To(Xt,"submit",t,{capture:!0}),To(Xt,"change",t,{capture:!0}),To(Xt,"click",t,{capture:!0}),this.F.capture_copied_text){var r=n=>{n=n||Xe?.event,this.M(n,dee)};To(Xt,"copy",r,{capture:!0}),To(Xt,"cut",r,{capture:!0})}}}else HLe.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({[jLe]:!!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=Xt?.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[jLe],s=this.T;if(nb(s)&&!Mv(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=O1t(t);E1t(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())&&TOn(s,this.instance.config.rageclick)&&this.M(t,"$rageclick");var a=r===dee;if(s&&AOn(s,t,this.F,a,a?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:o}=FOn(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===dee){var c,d=k1t(Xe==null||(c=Xe.getSelection())==null?void 0:c.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 $v(Xt?.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Jm(e)&&isFinite(e)&&Math.floor(e)===e});var ZLe="0123456789abcdef";class BL{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 BL(a)}toString(){for(var t="",r=0;r<this.bytes.length;r++)t=t+ZLe.charAt(this.bytes[r]>>>4)+ZLe.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 BL(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 zOn{constructor(){this.A=0,this.D=0,this.j=new UOn}generate(){var t=this.generateOrAbort();if(qt(t)){this.A=0;var r=this.generateOrAbort();if(qt(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 BL.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 GLe,$1t=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};Xe&&!qt(Xe.crypto)&&crypto.getRandomValues&&($1t=e=>crypto.getRandomValues(e));class UOn{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&($1t(this.N),this.U=0),this.N[this.U++]}}var xv=()=>VOn().toString(),VOn=()=>(GLe||(GLe=new zOn)).generate(),xT="",qOn=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function HOn(e,t){if(t){var r=(function(s,a){if(a===void 0&&(a=Xt),xT)return xT;if(!a||["localhost","127.0.0.1"].includes(s))return"";for(var i=s.split("."),o=Math.min(i.length,8),l="dmn_chk_"+xv();!xT&&o--;){var c=i.slice(o).join("."),d=l+"=1;domain=."+c+";path=/";a.cookie=d+";max-age=3",a.cookie.includes(l)&&(a.cookie=d+";max-age=0",xT=c)}return xT})(e);if(!r){var n=(s=>{var a=s.match(qOn);return a?a[0]:""})(e);n!==r&&Kt.info("Warning: cookie subdomain discovery mismatch",n,r),r=n}return r?"; domain=."+r:""}return""}var $m={H:()=>!!Xt,B:function(e){Kt.error("cookieStore error: "+e)},q:function(e){if(Xt){try{for(var t=e+"=",r=Xt.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($m.q(e))||{}}catch{}return t},G:function(e,t,r,n,s){if(Xt)try{var a="",i="",o=HOn(Xt.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 c=e+"="+encodeURIComponent(JSON.stringify(t))+a+"; SameSite=Lax; path=/"+o+i;return c.length>3686.4&&Kt.warn("cookieStore warning: large cookie, len="+c.length),Xt.cookie=c,c}catch{return}},V:function(e,t){if(Xt!=null&&Xt.cookie)try{$m.G(e,"",-1,t)}catch{return}}},fee=null,_i={H:function(){if(!nb(fee))return fee;var e=!0;if(qt(Xe))e=!1;else try{var t="__mplssupport__";_i.G(t,"xyz"),_i.q(t)!=='"xyz"'&&(e=!1),_i.V(t)}catch{e=!1}return e||Kt.error("localStorage unsupported; falling back to cookie store"),fee=e,e},B:function(e){Kt.error("localStorage error: "+e)},q:function(e){try{return Xe?.localStorage.getItem(e)}catch(t){_i.B(t)}return null},W:function(e){try{return JSON.parse(_i.q(e))||{}}catch{}return null},G:function(e,t){try{Xe?.localStorage.setItem(e,JSON.stringify(t))}catch(r){_i.B(r)}},V:function(e){try{Xe?.localStorage.removeItem(e)}catch(t){_i.B(t)}}},ZOn=["distinct_id",NL,w1t,jL,PL],vM=cr({},_i,{W:function(e){try{var t={};try{t=$m.W(e)||{}}catch{}var r=fo(t,JSON.parse(_i.q(e)||"{}"));return _i.G(e,r),r}catch{}return null},G:function(e,t,r,n,s,a){try{_i.G(e,t,void 0,void 0,a);var i={};ZOn.forEach((o=>{t[o]&&(i[o]=t[o])})),Object.keys(i).length&&$m.G(e,i,r,n,s,a)}catch(o){_i.B(o)}},V:function(e,t){try{Xe?.localStorage.removeItem(e),$m.V(e,t)}catch(r){_i.B(r)}}}),xM={},GOn={H:function(){return!0},B:function(e){Kt.error("memoryStorage error: "+e)},q:function(e){return xM[e]||null},W:function(e){return xM[e]||null},G:function(e,t){xM[e]=t},V:function(e){delete xM[e]}},_0=null,Il={H:function(){if(!nb(_0))return _0;if(_0=!0,qt(Xe))_0=!1;else try{var e="__support__";Il.G(e,"xyz"),Il.q(e)!=='"xyz"'&&(_0=!1),Il.V(e)}catch{_0=!1}return _0},B:function(e){Kt.error("sessionStorage error: ",e)},q:function(e){try{return Xe?.sessionStorage.getItem(e)}catch(t){Il.B(t)}return null},W:function(e){try{return JSON.parse(Il.q(e))||null}catch{}return null},G:function(e,t){try{Xe?.sessionStorage.setItem(e,JSON.stringify(t))}catch(r){Il.B(r)}},V:function(e){try{Xe?.sessionStorage.removeItem(e)}catch(t){Il.B(t)}}},ay=(function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e})({});class QOn{constructor(t){this._instance=t}get F(){return this._instance.config}get consent(){return this.J()?ay.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===ay.DENIED||this.consent===ay.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===ay.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 lee(t)?ay.GRANTED:is(Kkn,t)?ay.DENIED:ay.PENDING}get Y(){if(!this.Z){var t=this.F.opt_out_capturing_persistence_type;this.Z=t==="localStorage"?_i:$m;var r=t==="localStorage"?$m:_i;r.q(this.X)&&(this.Z.q(this.X)||this.optInOut(lee(r.q(this.X))),r.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!b1t([Td?.doNotTrack,Td?.msDoNotTrack,pn.doNotTrack],(t=>lee(t)))}}var wM=rl("[Dead Clicks]"),WOn=()=>!0,XOn=e=>{var t,r=!((t=e.instance.persistence)==null||!t.get_property(x1t)),n=e.instance.config.capture_dead_clicks;return Mv(n)?n:!!ll(n)||r};class M1t{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({[x1t]:t?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(t){var r,n;(r=pn.__PosthogExtensions__)!=null&&r.initDeadClicksAutocapture&&t(),(n=pn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?wM.error("failed to load script",s):t()}))}et(){var t;if(Xt){if(!this.tt&&(t=pn.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var r=ll(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};r.__onCapture=this.onCapture,this.tt=pn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,r),this.tt.start(Xt),wM.info("starting...")}}else wM.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,wM.info("stopping..."))}}var wT=rl("[ExceptionAutocapture]");class YOn{constructor(t){var r,n,s;this.rt=()=>{var a;if(Xe&&this.isEnabled&&(a=pn.__PosthogExtensions__)!=null&&a.errorWrappingFunctions){var i=pn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=pn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=pn.__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(c){wT.error("failed to start",c),this.lt()}}},this._instance=t,this.ut=!((r=this._instance.persistence)==null||!r.props[$Le]),this.F=this.ht(),this.vt=new Jkn({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:wT}),this.startIfEnabled()}ht(){var t=this._instance.config.capture_exceptions,r={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ll(t)?r=cr({},r,t):(qt(t)?this.ut:t)&&(r=cr({},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&&(wT.info("enabled"),this.it(this.rt))}it(t){var r,n;(r=pn.__PosthogExtensions__)!=null&&r.errorWrappingFunctions&&t(),(n=pn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(s=>{if(s)return wT.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({[$Le]: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)?wT.info("Skipping exception capture because of client rate limiting.",{exception:s}):this._instance.exceptions.sendExceptionEvent(t)}}function QLe(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],s=r(n);return $v(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}class KOn{constructor(t){var r;this._instance=t,this.dt=(Xe==null||(r=Xe.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(Xe&&Xe.history){var n=this;(t=Xe.history.pushState)!=null&&t.__posthog_wrapped__||QLe(Xe.history,"pushState",(s=>function(a,i,o){s.call(this,a,i,o),n.ft("pushState")})),(r=Xe.history.replaceState)!=null&&r.__posthog_wrapped__||QLe(Xe.history,"replaceState",(s=>function(a,i,o){s.call(this,a,i,o),n.ft("replaceState")})),this.gt()}}ft(t){try{var r,n=Xe==null||(r=Xe.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")};To(Xe,"popstate",t),this.ct=()=>{Xe&&Xe.removeEventListener("popstate",t)}}}}var hee=rl("[SegmentIntegration]");function JOn(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 c=()=>l.anonymousId()||xv();n.config.get_device_id=c,l.id()&&(n.register({distinct_id:l.id(),$device_id:c()}),n.persistence.set_property(sy,"identified")),s()},o=a.user();"then"in o&&$v(o.then)?o.then((l=>i(l))):i(o)})(e,(()=>{r.register((n=>{Promise&&Promise.resolve||hee.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()||(hee.info("No userId set, resetting PostHog"),n.reset()),a.event.userId&&a.event.userId!==n.get_distinct_id()&&(hee.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 L1t="posthog-js";function F1t(e,t){var{organization:r,projectId:n,prefix:s,severityAllowList:a=["error"],sendExceptionsToPostHog:i=!0}=t===void 0?{}:t;return o=>{var l,c,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)||[],g=m.map((v=>cr({},v,{stacktrace:v.stacktrace?cr({},v.stacktrace,{type:"raw",frames:(v.stacktrace.frames||[]).map((w=>cr({},w,{platform:"web:javascript"})))}):void 0}))),b={$exception_message:((c=m[0])==null?void 0:c.value)||o.message,$exception_type:(d=m[0])==null?void 0:d.type,$exception_level:o.level,$exception_list:g,$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 eCn{constructor(t,r,n,s,a,i){this.name=L1t,this.setupOnce=function(o){o(F1t(t,{organization:r,projectId:n,prefix:s,severityAllowList:a,sendExceptionsToPostHog:i==null||i}))}}}var tCn=Xe!=null&&Xe.location?FL(Xe.location.hash,"__posthog")||FL(location.hash,"state"):null,WLe="_postHogToolbarParams",XLe=rl("[Toolbar]"),Jb=(function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e})(Jb||{});class rCn{constructor(t){this.instance=t}_t(t){pn.ph_toolbar_state=t}yt(){var t;return(t=pn.ph_toolbar_state)!==null&&t!==void 0?t:Jb.UNINITIALIZED}maybeLoadToolbar(t,r,n){if(t===void 0&&(t=void 0),r===void 0&&(r=void 0),n===void 0&&(n=void 0),!Xe||!Xt)return!1;t=t??Xe.location,n=n??Xe.history;try{if(!r){try{Xe.localStorage.setItem("test","test"),Xe.localStorage.removeItem("test")}catch{return!1}r=Xe?.localStorage}var s,a=tCn||FL(t.hash,"__posthog")||FL(t.hash,"state"),i=a?PLe((()=>JSON.parse(atob(decodeURIComponent(a)))))||PLe((()=>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(WLe)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}bt(t){var r=pn.ph_load_toolbar||pn.ph_load_editor;!_a(r)&&$v(r)?r(t,this.instance):XLe.warn("No toolbar load function found")}loadToolbar(t){var r=!(Xt==null||!Xt.getElementById(S1t));if(!Xe||r)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=cr({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(Xe.localStorage.setItem(WLe,JSON.stringify(cr({},s,{source:void 0}))),this.yt()===Jb.LOADED)this.bt(s);else if(this.yt()===Jb.UNINITIALIZED){var a;this._t(Jb.LOADING),(a=pn.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return XLe.error("[Toolbar] Failed to load",i),void this._t(Jb.UNINITIALIZED);this._t(Jb.LOADED),this.bt(s)})),To(Xe,"turbolinks:load",(()=>{this._t(Jb.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 nCn=rl("[TracingHeaders]");class sCn{constructor(t){this.xt=void 0,this.St=void 0,this.rt=()=>{var r,n;qt(this.xt)&&((r=pn.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),qt(this.St)&&((n=pn.__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=pn.__PosthogExtensions__)!=null&&r.tracingHeadersPatchFns&&t(),(n=pn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(s=>{if(s)return nCn.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 Qp="Mobile",zL="iOS",_m="Android",qN="Tablet",B1t=_m+" "+qN,z1t="iPad",U1t="Apple",V1t=U1t+" Watch",HN="Safari",Fk="BlackBerry",q1t="Samsung",H1t=q1t+"Browser",Z1t=q1t+" Internet",Y1="Chrome",aCn=Y1+" OS",G1t=Y1+" "+zL,Dge="Internet Explorer",Q1t=Dge+" "+Qp,Ige="Opera",iCn=Ige+" Mini",Nge="Edge",W1t="Microsoft "+Nge,f_="Firefox",X1t=f_+" "+zL,ZN="Nintendo",GN="PlayStation",h_="Xbox",Y1t=_m+" "+Qp,K1t=Qp+" "+HN,aA="Windows",Wae=aA+" Phone",YLe="Nokia",Xae="Ouya",J1t="Generic",oCn=J1t+" "+Qp.toLowerCase(),ewt=J1t+" "+qN.toLowerCase(),Yae="Konqueror",Dc="(\\d+(\\.\\d+)?)",mee=new RegExp("Version/"+Dc),lCn=new RegExp(h_,"i"),cCn=new RegExp(GN+" \\w+","i"),uCn=new RegExp(ZN+" \\w+","i"),Rge=new RegExp(Fk+"|PlayBook|BB10","i"),dCn={"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"},pCn=(e,t)=>t&&is(t,U1t)||(function(r){return is(r,HN)&&!is(r,Y1)&&!is(r,_m)})(e),twt=function(e,t){return t=t||"",is(e," OPR/")&&is(e,"Mini")?iCn:is(e," OPR/")?Ige:Rge.test(e)?Fk:is(e,"IE"+Qp)||is(e,"WPDesktop")?Q1t:is(e,H1t)?Z1t:is(e,Nge)||is(e,"Edg/")?W1t:is(e,"FBIOS")?"Facebook "+Qp:is(e,"UCWEB")||is(e,"UCBrowser")?"UC Browser":is(e,"CriOS")?G1t:is(e,"CrMo")||is(e,Y1)?Y1:is(e,_m)&&is(e,HN)?Y1t:is(e,"FxiOS")?X1t:is(e.toLowerCase(),Yae.toLowerCase())?Yae:pCn(e,t)?is(e,Qp)?K1t:HN:is(e,f_)?f_:is(e,"MSIE")||is(e,"Trident/")?Dge:is(e,"Gecko")?f_:""},fCn={[Q1t]:[new RegExp("rv:"+Dc)],[W1t]:[new RegExp(Nge+"?\\/"+Dc)],[Y1]:[new RegExp("("+Y1+"|CrMo)\\/"+Dc)],[G1t]:[new RegExp("CriOS\\/"+Dc)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Dc)],[HN]:[mee],[K1t]:[mee],[Ige]:[new RegExp("(Opera|OPR)\\/"+Dc)],[f_]:[new RegExp(f_+"\\/"+Dc)],[X1t]:[new RegExp("FxiOS\\/"+Dc)],[Yae]:[new RegExp("Konqueror[:/]?"+Dc,"i")],[Fk]:[new RegExp(Fk+" "+Dc),mee],[Y1t]:[new RegExp("android\\s"+Dc,"i")],[Z1t]:[new RegExp(H1t+"\\/"+Dc)],[Dge]:[new RegExp("(rv:|MSIE )"+Dc)],Mozilla:[new RegExp("rv:"+Dc)]},hCn=function(e,t){var r=twt(e,t),n=fCn[r];if(qt(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},KLe=[[new RegExp(h_+"; "+h_+" (.*?)[);]","i"),e=>[h_,e&&e[1]||""]],[new RegExp(ZN,"i"),[ZN,""]],[new RegExp(GN,"i"),[GN,""]],[Rge,[Fk,""]],[new RegExp(aA,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Wae,""];if(new RegExp(Qp).test(t)&&!/IEMobile\b/.test(t))return[aA+" "+Qp,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var n=r[1],s=dCn[n]||"";return/arm/i.test(t)&&(s="RT"),[aA,s]}return[aA,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[zL,t.join(".")]}return[zL,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=qt(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+_m+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_m+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[_m,t.join(".")]}return[_m,""]}],[/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/,[aCn,""]],[/Linux|debian/i,["Linux",""]]],JLe=function(e){return uCn.test(e)?ZN:cCn.test(e)?GN:lCn.test(e)?h_:new RegExp(Xae,"i").test(e)?Xae:new RegExp("("+Wae+"|WPDesktop)","i").test(e)?Wae:/iPad/.test(e)?z1t:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?V1t:Rge.test(e)?Fk:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(YLe,"i").test(e)?YLe:/(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(Qp).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)?_m:B1t:_m:new RegExp("(pda|"+Qp+")","i").test(e)?oCn:new RegExp(qN,"i").test(e)&&!new RegExp(qN+" pc","i").test(e)?ewt:""},SM="https?://(.*)",jO=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],mCn=PO(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],jO),QP="<masked>",gCn=["li_fat_id"];function rwt(e,t,r){if(!Xt)return{};var n,s=t?PO([],jO,r||[]):[],a=nwt(GP(Xt.URL,s,QP),e),i=(n={},qa(gCn,(function(o){var l=$m.q(o);n[o]=l||null})),n);return fo(i,a)}function nwt(e,t){var r=mCn.concat(t||[]),n={};return qa(r,(function(s){var a=LL(e,s);n[s]=a||null})),n}function swt(e){var t=(function(a){return a?a.search(SM+"google.([^/?]*)")===0?"google":a.search(SM+"bing.com")===0?"bing":a.search(SM+"yahoo.com")===0?"yahoo":a.search(SM+"duckduckgo.com")===0?"duckduckgo":null:null})(e),r=t!="yahoo"?"q":"p",n={};if(!nb(t)){n.$search_engine=t;var s=Xt?LL(Xt.referrer,r):"";s.length&&(n.ph_keyword=s)}return n}function eFe(){return navigator.language||navigator.userLanguage}function awt(){return Xt?.referrer||"$direct"}function iwt(e,t){var r=e?PO([],jO,t||[]):[],n=mu?.href.substring(0,1e3);return{r:awt().substring(0,1e3),u:n?GP(n,r,QP):void 0}}function owt(e){var t,{r,u:n}=e,s={$referrer:r,$referring_domain:r==null?void 0:r=="$direct"?"$direct":(t=ML(r))==null?void 0:t.host};if(n){s.$current_url=n;var a=ML(n);s.$host=a?.host,s.$pathname=a?.pathname;var i=nwt(n);fo(s,i)}if(r){var o=swt(r);fo(s,o)}return s}function lwt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function yCn(){try{return new Date().getTimezoneOffset()}catch{return}}function bCn(e,t){if(!cu)return{};var r,n,s,a=e?PO([],jO,t||[]):[],[i,o]=(function(l){for(var c=0;c<KLe.length;c++){var[d,p]=KLe[c],f=d.exec(l),h=f&&($v(p)?p(f,l):p);if(h)return h}return["",""]})(cu);return fo(Oge({$os:i,$os_version:o,$browser:twt(cu,navigator.vendor),$device:JLe(cu),$device_type:(n=cu,s=JLe(n),s===z1t||s===B1t||s==="Kobo"||s==="Kindle Fire"||s===ewt?qN:s===ZN||s===h_||s===GN||s===Xae?"Console":s===V1t?"Wearable":s?Qp:"Desktop"),$timezone:lwt(),$timezone_offset:yCn()}),{$current_url:GP(mu?.href,a,QP),$host:mu?.host,$pathname:mu?.pathname,$raw_user_agent:cu.length>1e3?cu.substring(0,997)+"...":cu,$browser_version:hCn(cu,navigator.vendor),$browser_language:eFe(),$browser_language_prefix:(r=eFe(),typeof r=="string"?r.split("-")[0]:void 0),$screen_height:Xe?.screen.height,$screen_width:Xe?.screen.width,$viewport_height:Xe?.innerHeight,$viewport_width:Xe?.innerWidth,$lib:"web",$lib_version:ny.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Zb=rl("[Web Vitals]"),tFe=9e5;class vCn{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)=>cr({},n,{["$web_vitals_"+s.name+"_event"]:cr({},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(qt(a))Zb.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Tt();qt(i)||(_a(n?.name)||_a(n?.value)?Zb.error("Invalid metric received",n):this.Rt&&n.value>=this.Rt?Zb.error("Ignoring metric with value >= "+this.Rt,n):(this.N.url!==i&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),qt(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=qt(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.N.metrics.push(cr({},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=pn.__PosthogExtensions__;qt(o)||qt(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):Zb.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.Et=!((r=this._instance.persistence)==null||!r.props[LLe]),this.startIfEnabled()}get allowedMetrics(){var t,r,n=ll(this._instance.config.capture_performance)?(t=this._instance.config.capture_performance)==null?void 0:t.web_vitals_allowed_metrics:void 0;return qt(n)?((r=this._instance.persistence)==null?void 0:r.props[FLe])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(ll(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var t=ll(this._instance.config.capture_performance)&&Jm(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:tFe;return 0<t&&t<=6e4?tFe:t}get isEnabled(){var t=mu?.protocol;if(t!=="http:"&&t!=="https:")return Zb.info("Web Vitals are disabled on non-http/https protocols"),!1;var r=ll(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Mv(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Mv(r)?r:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(Zb.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(t){var r=ll(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=ll(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[LLe]:r}),this._instance.persistence.register({[FLe]:n})),this.Et=r,this.startIfEnabled()}it(t){var r,n;(r=pn.__PosthogExtensions__)!=null&&r.postHogWebVitalsCallbacks&&t(),(n=pn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"web-vitals",(s=>{s?Zb.error("failed to load script",s):t()}))}Tt(){var t=Xe?Xe.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?PO([],jO,n||[]):[];return GP(t,s,QP)}Zb.error("Could not determine current URL")}}var xCn=rl("[Heatmaps]");function rFe(e){return ll(e)&&"clientX"in e&&"clientY"in e&&Jm(e.clientX)&&Jm(e.clientY)}class wCn{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[Bae]),this.rageclicks=new j1t(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return ll(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 qt(this.instance.config.capture_heatmaps)?qt(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;xCn.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({[Bae]: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"})(Xt)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){Xe&&Xt&&(this.jt=this.Dt.bind(this),To(Xe,"beforeunload",this.jt),this.Lt=t=>this.At(t||Xe?.event),To(Xt,"click",this.Lt,{capture:!0}),this.Nt=t=>this.Ut(t||Xe?.event),To(Xt,"mousemove",this.Nt,{capture:!0}),this.zt=new M1t(this.instance,WOn,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),To(Xt,"visibilitychange",this.Ht),this.P=!0)}Mt(){var t;Xe&&Xt&&(this.jt&&Xe.removeEventListener("beforeunload",this.jt),this.Lt&&Xt.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&Xt.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&Xt.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,c){for(var d=o;d&&a7(d)&&!Fv(d,"body");){if(d===c)return!1;if(is(l,Xe?.getComputedStyle(d).position))return!0;d=T1t(d)}return!1})(O1t(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"),!BLe(t.target)&&rFe(t)){var s=this.qt(t,r);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this.Wt(cr({},s,{type:"rageclick"})),this.Wt(s)}}Ut(t){!BLe(t.target)&&rFe(t)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(t,"mousemove"))}),500))}Wt(t){if(Xe){var r=Xe.location.href,n=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,a=n?PO([],jO,s||[]):[],i=GP(r,a,QP);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(t)}}Dt(){this.N&&!RE(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class SCn{constructor(t){this._instance=t}doPageView(t,r){var n,s=this.Gt(t,r);return this.Vt={pathname:(n=Xe?.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:c,lastContentY:d,maxContentY:p}=a;if(!(qt(i)||qt(o)||qt(l)||qt(c)||qt(d)||qt(p))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),d=Math.ceil(d),p=Math.ceil(p);var f=i<=1?1:Em(o/i,0,1,Kt),h=i<=1?1:Em(l/i,0,1,Kt),m=c<=1?1:Em(d/c,0,1,Kt),g=c<=1?1:Em(p/c,0,1,Kt);s=fo(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:g})}}return n.pathname&&(s.$prev_pageview_pathname=n.pathname),n.timestamp&&(s.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),s}}var Wp=Uint8Array,ku=Uint16Array,Bk=Uint32Array,Pge=new Wp([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]),jge=new Wp([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]),nFe=new Wp([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cwt=function(e,t){for(var r=new ku(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new Bk(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]},uwt=cwt(Pge,2),ECn=uwt[0],Kae=uwt[1];ECn[28]=258,Kae[258]=28;for(var sFe=cwt(jge,0)[1],dwt=new ku(32768),ri=0;ri<32768;++ri){var k0=(43690&ri)>>>1|(21845&ri)<<1;k0=(61680&(k0=(52428&k0)>>>2|(13107&k0)<<2))>>>4|(3855&k0)<<4,dwt[ri]=((65280&k0)>>>8|(255&k0)<<8)>>>1}var rD=function(e,t,r){for(var n=e.length,s=0,a=new ku(t);s<n;++s)++a[e[s]-1];var i,o=new ku(t);for(s=0;s<t;++s)o[s]=o[s-1]+a[s-1]<<1;for(i=new ku(n),s=0;s<n;++s)i[s]=dwt[o[e[s]-1]++]>>>15-e[s];return i},K1=new Wp(288);for(ri=0;ri<144;++ri)K1[ri]=8;for(ri=144;ri<256;++ri)K1[ri]=9;for(ri=256;ri<280;++ri)K1[ri]=7;for(ri=280;ri<288;++ri)K1[ri]=8;var UL=new Wp(32);for(ri=0;ri<32;++ri)UL[ri]=5;var _Cn=rD(K1,9),kCn=rD(UL,5),pwt=function(e){return(e/8>>0)+(7&e&&1)},fwt=function(e,t,r){(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof ku?ku:e instanceof Bk?Bk:Wp)(r-t);return n.set(e.subarray(t,r)),n},Zg=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},ST=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},gee=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 Wp(0),0];if(s==1){var i=new Wp(r[0].s+1);return i[r[0].s]=1,[i,1]}r.sort((function(O,C){return O.f-C.f})),r.push({s:-1,f:25001});var o=r[0],l=r[1],c=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[c].f<r[p].f?c++:p++],l=r[c!=d&&r[c].f<r[p].f?c++: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 ku(f+1),m=Jae(r[d-1],h,0);if(m>t){n=0;var g=0,b=m-t,v=1<<b;for(a.sort((function(O,C){return h[C.s]-h[O.s]||O.f-C.f}));n<s;++n){var w=a[n].s;if(!(h[w]>t))break;g+=v-(1<<m-h[w]),h[w]=t}for(g>>>=b;g>0;){var S=a[n].s;h[S]<t?g-=1<<t-h[S]++-1:++n}for(;n>=0&&g;--n){var _=a[n].s;h[_]==t&&(--h[_],++g)}m=t}return[new Wp(h),m]},Jae=function(e,t,r){return e.s==-1?Math.max(Jae(e.l,t,r+1),Jae(e.r,t,r+1)):t[e.s]=r},aFe=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ku(++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]},ET=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},eie=function(e,t,r){var n=r.length,s=pwt(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)},iFe=function(e,t,r,n,s,a,i,o,l,c,d){Zg(t,d++,r),++s[256];for(var p=gee(s,15),f=p[0],h=p[1],m=gee(a,15),g=m[0],b=m[1],v=aFe(f),w=v[0],S=v[1],_=aFe(g),O=_[0],C=_[1],T=new ku(19),A=0;A<w.length;++A)T[31&w[A]]++;for(A=0;A<O.length;++A)T[31&O[A]]++;for(var I=gee(T,7),R=I[0],P=I[1],L=19;L>4&&!R[nFe[L-1]];--L);var B,M,z,H,q=c+5<<3,V=ET(s,K1)+ET(a,UL)+i,Q=ET(s,f)+ET(a,g)+i+14+3*L+ET(T,R)+(2*T[16]+3*T[17]+7*T[18]);if(q<=V&&q<=Q)return eie(t,d,e.subarray(l,l+c));if(Zg(t,d,1+(Q<V)),d+=2,Q<V){B=rD(f,h),M=f,z=rD(g,b),H=g;var $=rD(R,P);for(Zg(t,d,S-257),Zg(t,d+5,C-1),Zg(t,d+10,L-4),d+=14,A=0;A<L;++A)Zg(t,d+3*A,R[nFe[A]]);d+=3*L;for(var X=[w,O],U=0;U<2;++U){var N=X[U];for(A=0;A<N.length;++A){var Z=31&N[A];Zg(t,d,$[Z]),d+=R[Z],Z>15&&(Zg(t,d,N[A]>>>5&127),d+=N[A]>>>12)}}}else B=_Cn,M=K1,z=kCn,H=UL;for(A=0;A<o;++A)if(n[A]>255){Z=n[A]>>>18&31,ST(t,d,B[Z+257]),d+=M[Z+257],Z>7&&(Zg(t,d,n[A]>>>23&31),d+=Pge[Z]);var G=31&n[A];ST(t,d,z[G]),d+=H[G],G>3&&(ST(t,d,n[A]>>>5&8191),d+=jge[G])}else ST(t,d,B[n[A]]),d+=M[n[A]];return ST(t,d,B[256]),d+M[256]},OCn=new Bk([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),CCn=(function(){for(var e=new Bk(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e})(),TCn=function(e,t,r,n,s){return(function(a,i,o,l,c,d){var p=a.length,f=new Wp(l+p+5*(1+Math.floor(p/7e3))+c),h=f.subarray(l,f.length-c),m=0;if(!i||p<8)for(var g=0;g<=p;g+=65535){var b=g+65535;b<p?m=eie(h,m,a.subarray(g,b)):(h[g]=d,m=eie(h,m,a.subarray(g,p)))}else{for(var v=OCn[i-1],w=v>>>13,S=8191&v,_=(1<<o)-1,O=new ku(32768),C=new ku(_+1),T=Math.ceil(o/3),A=2*T,I=function(be){return(a[be]^a[be+1]<<T^a[be+2]<<A)&_},R=new Bk(25e3),P=new ku(288),L=new ku(32),B=0,M=0,z=(g=0,0),H=0,q=0;g<p;++g){var V=I(g),Q=32767&g,$=C[V];if(O[Q]=$,C[V]=Q,H<=g){var X=p-g;if((B>7e3||z>24576)&&X>423){m=iFe(a,h,0,R,P,L,M,z,q,g-q,m),z=B=M=0,q=g;for(var U=0;U<286;++U)P[U]=0;for(U=0;U<30;++U)L[U]=0}var N=2,Z=0,G=S,K=Q-$&32767;if(X>2&&V==I(g-K))for(var ee=Math.min(w,X)-1,te=Math.min(32767,g),se=Math.min(258,X);K<=te&&--G&&Q!=$;){if(a[g+N]==a[g+N-K]){for(var ue=0;ue<se&&a[g+ue]==a[g+ue-K];++ue);if(ue>N){if(N=ue,Z=K,ue>ee)break;var xe=Math.min(K,ue-2),W=0;for(U=0;U<xe;++U){var ae=g-K+U+32768&32767,ne=ae-O[ae]+32768&32767;ne>W&&(W=ne,$=ae)}}}K+=(Q=$)-($=O[Q])+32768&32767}if(Z){R[z++]=268435456|Kae[N]<<18|sFe[Z];var ye=31&Kae[N],le=31&sFe[Z];M+=Pge[ye]+jge[le],++P[257+ye],++L[le],H=g+N,++B}else R[z++]=a[g],++P[a[g]]}}m=iFe(a,h,d,R,P,L,M,z,q,g-q,m)}return fwt(f,0,l+pwt(m)+c)})(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)},yee=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function ACn(e,t){t===void 0&&(t={});var r=(function(){var o=4294967295;return{p:function(l){for(var c=o,d=0;d<l.length;++d)c=CCn[255&c^l[d]]^c>>>8;o=c},d:function(){return 4294967295^o}}})(),n=e.length;r.p(e);var s,a=TCn(e,t,10+((s=t).filename&&s.filename.length+1||0),8),i=a.length;return(function(o,l){var c=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&&yee(o,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){o[3]=8;for(var d=0;d<=c.length;++d)o[d+10]=c.charCodeAt(d)}})(a,t),yee(a,i-8,r.d()),yee(a,i-4,n),a}var DCn=function(e){var t,r,n,s,a="";for(t=r=0,n=(e=(e+"").replace(/\r\n/g,`
|
|
649
649
|
`).replace(/\r/g,`
|
|
650
650
|
`)).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),nb(o)||(r>t&&(a+=e.substring(t,r)),a+=o,t=r=s+1)}return r>t&&(a+=e.substring(t,e.length)),a},ICn=!!jae||!!Pae,oFe="text/plain",VL=function(e,t,r){var n;r===void 0&&(r=!0);var[s,a]=e.split("?"),i=cr({},t),o=(n=a?.split("&").map((c=>{var d,[p,f]=c.split("="),h=r&&(d=i[p])!==null&&d!==void 0?d:f;return delete i[p],p+"="+h})))!==null&&n!==void 0?n:[],l=$On(i);return l&&o.push(l),s+"?"+o.join("&")},iA=(e,t)=>JSON.stringify(e,((r,n)=>typeof n=="bigint"?n.toString():n),t),bee=e=>{var{data:t,compression:r}=e;if(t){if(r===py.GZipJS){var n=ACn((function(l,c){var d=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var p=new Wp(l.length+(l.length>>>1)),f=0,h=function(v){p[f++]=v},m=0;m<d;++m){if(f+5>p.length){var g=new Wp(f+8+(d-m<<1));g.set(p),p=g}var b=l.charCodeAt(m);b<128||c?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 fwt(p,0,f)})(iA(t)),{mtime:0}),s=new Blob([n],{type:oFe});return{contentType:oFe,body:s,estimatedSize:s.size}}if(r===py.Base64){var a=(function(l){var c,d,p,f,h,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=0,b=0,v="",w=[];if(!l)return l;l=DCn(l);do c=(h=l.charCodeAt(g++)<<16|l.charCodeAt(g++)<<8|l.charCodeAt(g++))>>18&63,d=h>>12&63,p=h>>6&63,f=63&h,w[b++]=m.charAt(c)+m.charAt(d)+m.charAt(p)+m.charAt(f);while(g<l.length);switch(v=w.join(""),l.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"="}return v})(iA(t)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:iA(l)))(a);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var o=iA(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},C3=[];Pae&&C3.push({transport:"fetch",method:e=>{var t,r,{contentType:n,body:s,estimatedSize:a}=(t=bee(e))!==null&&t!==void 0?t:{},i=new Headers;qa(e.headers,(function(d,p){i.append(p,d)})),n&&i.append("Content-Type",n);var o=e.url,l=null;if(OLe){var c=new OLe;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),e.timeout)}}Pae(o,cr({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))}}),jae&&C3.push({transport:"XHR",method:e=>{var t,r=new jae;r.open(e.method||"GET",e.url,!0);var{contentType:n,body:s}=(t=bee(e))!==null&&t!==void 0?t:{};qa(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)}}),Td!=null&&Td.sendBeacon&&C3.push({transport:"sendBeacon",method:e=>{var t=VL(e.url,{beacon:"1"});try{var r,{contentType:n,body:s}=(r=bee(e))!==null&&r!==void 0?r:{},a=typeof s=="string"?new Blob([s],{type:n}):s;Td.sendBeacon(t,a)}catch{}}});var qL=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 lFe(e,t,r){return iA({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var hwt={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=>qL(r,n))))),not_regex:(e,t)=>t.every((r=>e.every((n=>!qL(r,n))))),icontains:(e,t)=>t.map(EM).some((r=>e.map(EM).some((n=>r.includes(n))))),not_icontains:(e,t)=>t.map(EM).every((r=>e.map(EM).every((n=>!r.includes(n)))))},EM=e=>e.toLowerCase();function mwt(e,t){return!e||Object.entries(e).every((r=>{var[n,s]=r,a=t?.[n];if(qt(a)||nb(a))return!1;var i=[String(a)],o=hwt[s.operator];return!!o&&o(s.values,i)}))}var vee=rl("[Error tracking]");class NCn{constructor(t){var r,n;this.Jt=[],this.Kt=new rOn([new dOn,new xOn,new fOn,new pOn,new bOn,new yOn,new mOn,new vOn],uOn("web:javascript",iOn,cOn)),this._instance=t,this.Jt=(r=(n=this._instance.persistence)==null?void 0:n.get_property(zae))!==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({[zae]:this.Jt,[MLe]:i})}get Yt(){var t,r=!!this._instance.get_property(MLe),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 vee.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(r))return void vee.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(r))return void vee.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 Yo(a)&&a.length>0&&n.$exception_types.push(a),Yo(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=hwt[a.operator],l=Na(a.value)?a.value:[a.value],c=(i=r[a.key])!==null&&i!==void 0?i:[];return l.length>0&&o(l,c)}));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!_a(t)&&Na(t)}}var Bf=rl("[FeatureFlags]"),_T=rl("[FeatureFlags]",{debugEnabled:!0}),xee="$active_feature_flags",KS="$override_feature_flags",cFe="$feature_flag_payloads",kT="$override_feature_flag_payloads",uFe="$feature_flag_request_id",dFe="$feature_flag_evaluated_at",pFe=e=>{var t={};for(var[r,n]of O3(e||{}))n&&(t[r]=n);return t},RCn=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]})))):Bf.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},PCn=(function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e})({});class jCn{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||Bf.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(Uae),r=this._instance.get_property(KS),n=this._instance.get_property(kT);if(!n&&!r)return t||{};var s=fo({},t||{}),a=[...new Set([...Object.keys(n||{}),...Object.keys(r||{})])];for(var i of a){var o,l,c=s[i],d=r?.[i],p=qt(d)?(o=c?.enabled)!==null&&o!==void 0&&o:!!d,f=qt(d)?c.variant:typeof d=="string"?d:void 0,h=n?.[i],m=cr({},c,{enabled:p,variant:p?f??c?.variant:void 0});p!==c?.enabled&&(m.original_enabled=c?.enabled),f!==c?.variant&&(m.original_variant=c?.variant),h&&(m.metadata=cr({},c?.metadata,{payload:h,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),s[i]=m}return this.ii||(Bf.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:s}),this.ii=!0),s}getFlagVariants(){var t=this._instance.get_property(PE),r=this._instance.get_property(KS);if(!r)return t||{};for(var n=fo({},t),s=Object.keys(r),a=0;a<s.length;a++)n[s[a]]=r[s[a]];return this.ii||(Bf.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:r,finalFlags:n}),this.ii=!0),n}getFlagPayloads(){var t=this._instance.get_property(cFe),r=this._instance.get_property(kT);if(!r)return t||{};for(var n=fo({},t||{}),s=Object.keys(r),a=0;a<s.length;a++)n[s[a]]=r[s[a]];return this.ii||(Bf.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:cr({},((r=this._instance.persistence)==null?void 0:r.get_initial_props())||{},this._instance.get_property(sA)||{}),group_properties:this._instance.get_property(R0)};(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=lwt()),this.ri=!0,this._instance.ci({method:"POST",url:o,data:n,compression:this._instance.config.disable_compression?void 0:py.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,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&&(c=l.json.quotaLimited)!=null&&c.includes(PCn.FeatureFlags))Bf.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(uFe)||void 0,i=this._instance.get_property(dFe)||void 0,o=this._instance.get_property(RL)||{};if((r.send_event||!("send_event"in r))&&(!(t in o)||!o[t].includes(s))){var l,c,d,p,f,h,m,g,b;Na(o[t])?o[t].push(s):o[t]=[s],(l=this._instance.persistence)==null||l.register({[RL]:o});var v=this.getFeatureFlagDetails(t),w={$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:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[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};qt(v==null||(p=v.metadata)==null?void 0:p.version)||(w.$feature_flag_version=v.metadata.version);var S,_=(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;_&&(w.$feature_flag_reason=_),v!=null&&(g=v.metadata)!=null&&g.id&&(w.$feature_flag_id=v.metadata.id),qt(v?.original_variant)&&qt(v?.original_enabled)||(w.$feature_flag_original_response=qt(v.original_variant)?v.original_enabled:v.original_variant),v!=null&&(b=v.metadata)!=null&&b.original_payload&&(w.$feature_flag_original_payload=v==null||(S=v.metadata)==null?void 0:S.original_payload),this._instance.capture("$feature_flag_called",w)}return n}Bf.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:py.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 qt(n)?void 0:!!n}Bf.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,c,d){l===void 0&&(l={}),c===void 0&&(c={}),d===void 0&&(d={});var p=RCn(i),f=p.flags,h=p.featureFlags,m=p.featureFlagPayloads;if(h){var g=i.requestId,b=i.evaluatedAt;if(Na(h)){Bf.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(h)for(var w=0;w<h.length;w++)v[h[w]]=!0;o&&o.register({[xee]:h,[PE]:v})}else{var S=h,_=m,O=f;i.errorsWhileComputingFlags&&(S=cr({},l,S),_=cr({},c,_),O=cr({},d,O)),o&&o.register(cr({[xee]:Object.keys(pFe(S)),[PE]:S||{},[cFe]:_||{},[Uae]:O||{}},g?{[uFe]:g}:{},b?{[dFe]:b}:{}))}}})(t,this._instance.persistence,n,s,a),this.pi(r)}}override(t,r){r===void 0&&(r=!1),Bf.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:r})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return Bf.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this._instance.persistence.unregister(KS),this._instance.persistence.unregister(kT),this.pi(),_T.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(KS),_T.info("Flag overrides cleared");else if(n.flags){if(Na(n.flags)){for(var s={},a=0;a<n.flags.length;a++)s[n.flags[a]]=!0;this._instance.persistence.register({[KS]:s})}else this._instance.persistence.register({[KS]:n.flags});_T.info("Flag overrides set",{flags:n.flags})}}return"payloads"in n&&(n.payloads===!1?(this._instance.persistence.unregister(kT),_T.info("Payload overrides cleared")):n.payloads&&(this._instance.persistence.register({[kT]:n.payloads}),_T.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(nA)||[]).find((c=>c.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=cr({},this.getFlagVariants(),{[t]:r});(s=this._instance.persistence)==null||s.register({[xee]:Object.keys(pFe(l)),[PE]:l}),this.pi()}getEarlyAccessFeatures(t,r,n){r===void 0&&(r=!1);var s=this._instance.get_property(nA),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 c=i.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(nA),(l=this._instance.persistence)==null||l.register({[nA]:c}),t(c)}}})}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(sA)||{};this._instance.register({[sA]:cr({},n,t)}),r&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(sA)}setGroupPropertiesForFlags(t,r){r===void 0&&(r=!0);var n=this._instance.get_property(R0)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((s=>{n[s]=cr({},n[s],t[s]),delete t[s]})),this._instance.register({[R0]:cr({},n,t)}),r&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var r=this._instance.get_property(R0)||{};this._instance.register({[R0]:cr({},r,{[t]:{}})})}else this._instance.unregister(R0)}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 $Cn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class wee{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,cr({},this.props)),this.update_config(t,t,r),this.save()}isDisabled(){return!!this.wi}bi(t){$Cn.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"&&_i.H()?_i:r==="localstorage+cookie"&&vM.H()?vM:r==="sessionstorage"&&Il.H()?Il:r==="memory"?GOn:r==="cookie"?$m:vM.H()?vM:$m}properties(){var t={};return qa(this.props,(function(r,n){if(n===PE&&ll(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,(nb(i=OOn)?l:kLe&&i.indexOf===kLe?i.indexOf(o)!=-1:(qa(i,(function(c){if(l||(l=c===o))return IL})),l))||(t[n]=r);var i,o,l})),t}load(){if(!this.wi){var t=this.Y.W(this.yi);t&&(this.props=fo({},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(ll(t)){qt(r)&&(r="None"),this.xi=qt(n)?this.$i:n;var s=!1;if(qa(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(ll(t)){this.xi=qt(r)?this.$i:r;var n=!1;if(qa(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=rwt(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);RE(Oge(t))||this.register(t),this.mi=!0}}update_search_keyword(){var t;this.register((t=Xt?.referrer)?swt(t):{})}update_referrer_info(){var t;this.register_once({$referrer:awt(),$referring_domain:Xt!=null&&Xt.referrer&&((t=ML(Xt.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Zae]||this.props[Gae]||this.register_once({[PL]:iwt(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};qa([Gae,Zae],(i=>{var o=this.props[i];o&&qa(o,(function(l,c){t["$initial_"+$ae(c)]=l}))}));var r,n,s=this.props[PL];if(s){var a=(r=owt(s),n={},qa(r,(function(i,o){n["$initial_"+$ae(o)]=i})),n);fo(t,a)}return t}safe_merge(t){return qa(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[rA]||{};n[t]=r,this.props[rA]=n,this.save()}remove_event_timer(t){var r=(this.props[rA]||{})[t];return qt(r)||(delete this.props[rA][t],this.save()),r}get_property(t){return this.props[t]}set_property(t,r){this.props[t]=r,this.save()}}var OT=(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 See=(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 T3=(function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e})({}),fFe=(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})({}),gwt=(function(e){return e.Popover="popover",e.Inline="inline",e})({});class $ge{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 JS(e,t,r){if(_a(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 MCn{constructor(t){this.Pi=new $ge,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(!qt((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(!qt((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((c=>{var d;(d=this.Mi)==null||d.add(c?.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"||!JS(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=>JS(o.href,r.href,r.href_matching||"exact")));var a,i=(t==null||(n=t.properties)==null?void 0:n.$elements_chain)||"";return!!i&&JS((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((c=>JS(c.text,r.text,r.text_matching||"exact")||JS(c.$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(c){for(var d,p=[],f=/(?::|")text="(.*?)"/g;!_a(d=f.exec(c));)p.includes(d[1])||p.push(d[1]);return p})(l),i=r.text,o=r.text_matching||"exact",a.some((c=>JS(c,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||mwt(r.properties.reduce(((n,s)=>{var a=Na(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 ea=rl("[Surveys]"),tie="seenSurvey_",LCn=(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},hFe=e=>{var t=""+tie+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+tie+e.id+"_"+e.current_iteration),t},FCn=[See.Popover,See.Widget,See.API],BCn={ignoreConditions:!1,ignoreDelay:!1,displayType:gwt.Popover};class zCn{constructor(t){this._instance=t,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(t,r){return!!t&&mwt(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===OT.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,c=(l=o.conditions)==null||(l=l[n])==null||(l=l.values)==null?void 0:l.find((d=>d.name===t));return this.Wi(c,r)}))}register(t){var r;qt((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 MCn(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((c=>{if(c&&c.name){var d=this.qi.get(c.name);d&&d.push(n.id),this.qi.set(c.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,OT.Activation),this.Bi=this.Gi(t,OT.Cancellation))}onEvent(t,r){var n,s=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[bM])||[];if(T3.SHOWN===t&&r&&s.length>0){var a;ea.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,OT.Cancellation);l.length>0&&(ea.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)){ea.info("survey event name matched",{event:t,eventPayload:r,surveys:this.Hi.get(t)});var c=this.Vi(t,r,OT.Activation);this.Xi(s.concat(c.map((d=>d.id))||[]))}}}onAction(t){var r,n=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[bM])||[];this.qi.has(t)&&this.Xi(n.concat(this.qi.get(t)||[]))}Xi(t){var r;ea.info("updating activated surveys",{activatedSurveys:t}),(r=this._instance)==null||(r=r.persistence)==null||r.register({[bM]:[...new Set(t)]})}getSurveys(){var t,r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[bM];return r||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}}class UCn{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(_a(r))return ea.warn("Flags not loaded yet. Not loading surveys.");var n=Na(r);this.Zi=n?r.length>0:r,ea.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(tie)||n!=null&&n.startsWith("inProgressSurvey_"))&&t.push(n)}t.forEach((s=>localStorage.removeItem(s)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)ea.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ea.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ea.info("Not loading surveys in cookieless mode without consent.");else{var t=pn?.__PosthogExtensions__;if(t){if(!qt(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 ea.error("PostHog Extensions not found.")}}re(t,r){this._surveyManager=t(this._instance,r),this._surveyEventReceiver=new zCn(this._instance),ea.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(t,r){ea.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 ea.info("Disabled. Not loading surveys."),t([]);var n=this._instance.get_property(Vae);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 ea.error(o),t([],{isLoaded:!1,error:o})}var l,c=s.json.surveys||[],d=c.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({[Vae]:c}),t(c,{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){ea.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,r){if(r===void 0&&(r=!1),!_a(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,r);ea.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(_a(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(_a(this._surveyManager))return ea.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 _a(this._surveyManager)?(ea.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(_a(this._surveyManager))ea.warn("init was not called");else{var s=typeof t=="string"?this.oe(t):t;if(s!=null&&s.id)if(FCn.includes(s.type)){var a=Xt?.querySelector(r);if(a)return(n=s.appearance)!=null&&n.surveyPopupDelaySeconds?(ea.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,o;ea.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),ea.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,a);ea.warn("Survey element not found")}else ea.warn("Surveys of type "+s.type+" cannot be rendered in the app");else ea.warn("Survey not found")}}displaySurvey(t,r){var n;if(_a(this._surveyManager))ea.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=cr({},s,{appearance:cr({},s.appearance,{surveyPopupDelaySeconds:0})})),r.ignoreConditions===!1){var i=this.canRenderSurvey(s);if(!i.visible)return void ea.warn("Survey is not eligible to be displayed: ",i.disabledReason)}r.displayType!==gwt.Inline?this._surveyManager.handlePopoverSurvey(a):this.renderSurvey(a,r.selector)}else ea.warn("Survey not found")}}cancelPendingSurvey(t){_a(this._surveyManager)?ea.warn("init was not called"):this._surveyManager.cancelSurvey(t)}}var mFe=rl("[RateLimiter]");class VCn{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=>{mFe.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void mFe.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(Hae))!==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(Hae,i),{isRateLimited:o,remainingTokens:i.tokens}}isServerRateLimited(t){var r=this.serverLimits[t||"events"]||!1;return r!==!1&&new Date().getTime()<r}}var O0=rl("[RemoteConfig]");class qCn{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=pn._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}le(t){var r,n;(r=pn.__PosthogExtensions__)!=null&&r.loadExternalDependency?(n=pn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(O0.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 O0.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void O0.warn("Remote config is disabled. Falling back to local config.");this.le((t=>{if(!t)return O0.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){O0.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()):O0.info("__preview_remote_config is disabled. Logging config instead",t):O0.error("Failed to fetch remote config from PostHog.")}}var rie=3e3;class HCn{constructor(t,r){this.he=!0,this.ve=[],this.de=Em(r?.flush_interval_ms||rie,250,5e3,Kt.createLogger("flush interval"),rie),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(cr({},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&&Na(a.data)&&qa(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 qa(this.ve,(r=>{var n,s=r,a=(s?s.batchKey:null)||s.url;qt(t[a])&&(t[a]=cr({},s,{data:[]})),(n=t[a].data)==null||n.push(s.data)})),this.ve=[],t}}var ZCn=["retriesPerformedSoFar"];class GCn{constructor(t){this.me=!1,this.ye=3e3,this.ve=[],this._instance=t,this.ve=[],this.be=!0,!qt(Xe)&&"onLine"in Xe.navigator&&(this.be=Xe.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},To(Xe,"online",this.we),To(Xe,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(t){var{retriesPerformedSoFar:r}=t,n=d1t(t,ZCn);Jm(r)&&r>0&&(n.url=VL(n.url,{retry_count:r})),this._instance.ci(cr({},n,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(r??0)<10?this.Se(cr({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,c=Math.min(18e5,o),d=(Math.random()-.5)*(c-l);return Math.ceil(c+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,qt(Xe)||(this.we&&(Xe.removeEventListener("online",this.we),this.we=void 0),this.xe&&(Xe.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(cr({},t,{transport:"sendBeacon"}))}catch(r){Kt.error(r)}this.ve=[]}}class QCn{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,c=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=c,this.Pe.maxContentY=Math.max(c,(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(){To(Xe,"scroll",this.ke,{capture:!0}),To(Xe,"scrollend",this.ke,{capture:!0}),To(Xe,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return Xe?.document.documentElement;var t=Na(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=Xe?.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 Xe&&(Xe.scrollY||Xe.pageYOffset||Xe.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Xe&&(Xe.scrollX||Xe.pageXOffset||Xe.document.documentElement.scrollLeft)||0}}var WCn=e=>iwt(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties);class gFe{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({[qae]:o})}},this._instance=t,this.Ce=r,this.Fe=n,this.Ie=s||WCn,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[qae]}getSetOnceProps(){var t,r=(t=this.Re())==null?void 0:t.props;return r?"r"in r?owt(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 qa(Oge(this.getSetOnceProps()),((r,n)=>{n==="$current_url"&&(n="url"),t["$session_entry_"+$ae(n)]=r})),t}}var Eee=rl("[SessionId]");class yFe{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 $ge,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||xv,this.Ue=n||xv;var a=this.F.persistence_name||this.F.token,i=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Em(i,60,36e3,Eee.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=Il.W(this.He),l=Il.W(this.Be);o&&!l?this.je=o:Il.V(this.He),Il.G(this.Be,!0)}if((s=this.F.bootstrap)!=null&&s.sessionID)try{var c=(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(),c)}catch(d){Eee.error("Invalid sessionID in bootstrap",d)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return qt(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&&Il.H()}Ve(t){t!==this.je&&(this.je=t,this.qe()&&Il.G(this.He,t))}Je(){return this.je?this.je:this.qe()?Il.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({[NL]:[r,t,n]}))}Ke(){var t=this.Fe.props[NL];return Na(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&&Xe&&(Xe.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Il.V(this.Be)},To(Xe,"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=Jm(i)&&i>0&&Math.abs(n-i)>864e5,c=!1,d=!a,p=!d&&!t&&this.De(n,s);d||p||l?(a=this.Ne(),o=this.Ue(),Eee.info("new session ID generated",{sessionId:a,windowId:o,changeReason:{noSessionId:d,activityTimeout:p,sessionPastMaximumLength:l}}),i=n,c=!0):o||(o=this.Ue(),c=!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(),c&&this.Oe.forEach((m=>m(a,o,c?{noSessionId:d,activityTimeout:p,sessionPastMaximumLength:l}:void 0))),{sessionId:a,windowId:o,sessionStartTimestamp:h,changeReason:c?{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 XCn=["$set_once","$set"],Gb=rl("[SiteApps]");class YCn{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=pn._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 c={},d=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(var[f,h]of Object.entries(p))c[f]={id:d[f],type:f,properties:h};var{$set_once:m,$set:g}=t;return{event:cr({},d1t(t,XCn),{properties:cr({},t.properties,g?{$set:cr({},(r=(n=t.properties)==null?void 0:n.$set)!==null&&r!==void 0?r:{},g)}:{},m?{$set_once:cr({},(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:c}}setupSiteApp(t){var r=this.apps[t.id],n=()=>{var o;!r.errored&&this.Xe.length&&(Gb.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,Gb.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){Gb.error("Error while initializing PostHog app with config id "+t.id,o),a(!1)}if(s&&r.loaded)try{n()}catch(o){Gb.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){Gb.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",(c=>this.ir(c)))):void Gb.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(c){var d;pn["__$$ph_site_app_"+c]=a._instance,(d=pn.__PosthogExtensions__)==null||d.loadSiteApp==null||d.loadSiteApp(a._instance,l,(p=>{if(p)return Gb.error("Error while initializing PostHog app with config id "+c,p)}))};for(var{id:o,url:l}of t.siteApps)i(o)}else Gb.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var ywt=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&ALe(r,t))return!0;try{var n=e?.userAgentData;if(n!=null&&n.brands&&n.brands.some((s=>ALe(s?.brand,t))))return!0}catch{}return!!e.webdriver},oA=(function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e})({}),bFe="i.posthog.com";class KCn{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("."+bFe,".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]=oA.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=oA.EU:this.er[this.apiHost]=oA.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===oA.CUSTOM)return this.apiHost+r;var n=bFe+r;switch(t){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}}var JCn={icontains:(e,t)=>!!Xe&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Xe&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!Xe&&qL(t.href,e),not_regex:(e,t)=>!!Xe&&!qL(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Wl{constructor(t){var r=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),r.getWebExperiments((s=>{Wl.rr("retrieved web experiments from the server"),r.sr=new Map,s.forEach((a=>{if(a.feature_flag_key){var i;r.sr&&(Wl.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);Yo(o)&&a.variants[o]&&r.nr(a.name,o,a.variants[o].transforms)}else if(a.variants)for(var l in a.variants){var c=a.variants[l];Wl.ar(c)&&r.nr(a.name,l,c.transforms)}}))}),n)},this._instance=t,this._instance.onFeatureFlags((n=>{this.onFeatureFlags(n)}))}onFeatureFlags(t){if(this._is_bot())Wl.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(_a(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Wl.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=Wl.getWindowLocation();if(t!=null&&t.search){var r=LL(t?.search,"__experiment_id"),n=LL(t?.search,"__experiment_variant");r&&n&&(Wl.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&&(Wl.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!_a(t.conditions)&&Wl.ur(t)&&Wl.hr(t)}static ur(t){var r;if(_a(t.conditions)||_a((r=t.conditions)==null?void 0:r.url))return!0;var n,s,a,i=Wl.getWindowLocation();return!!i&&((n=t.conditions)==null||!n.url||JCn[(s=(a=t.conditions)==null?void 0:a.urlMatchType)!==null&&s!==void 0?s:"icontains"](t.conditions.url,i))}static getWindowLocation(){return Xe?.location}static hr(t){var r;if(_a(t.conditions)||_a((r=t.conditions)==null?void 0:r.utm))return!0;var n=rwt();if(n.utm_source){var s,a,i,o,l,c,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||((c=t.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==n.utm_medium,g=(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&&g&&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()?Wl.rr("Refusing to render web experiment since the viewer is a likely bot"):r!=="control"?n.forEach((s=>{if(s.selector){var a;Wl.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)}))}})):Wl.rr("Control variants leave the page unmodified.")}_is_bot(){return Td&&this._instance?ywt(Td,this._instance.config.custom_blocked_useragents):void 0}}var eTn=rl("[PostHog ExternalIntegrations]"),tTn={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class rTn{constructor(t){this._instance=t}it(t,r){var n;(n=pn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,t,(s=>{if(s)return eTn.error("failed to load script",s);r()}))}startIfEnabledOrStop(){var t=this,r=function(i){var o,l,c;!s||(o=pn.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[i]||t.it(tTn[i],(()=>{var d;(d=pn.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[i])==null||d.start(t._instance)})),!s&&(l=pn.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((c=pn.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.stop())};for(var[n,s]of Object.entries((a=this._instance.config.integrations)!==null&&a!==void 0?a:{})){var a;r(n)}}}var nie="[SessionRecording]",CT=rl(nie);class vFe{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 CT.error("started without valid sessionManager"),new Error(nie+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(nie+' cannot be used with cookieless_mode="always"')}get cr(){var t,r=!((t=this._instance.get_property(uee))==null||!t.enabled),n=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Xe&&r&&n&&!s}startIfEnabledOrStop(t){var r;if(!this.cr||(r=this.vr)==null||!r.isStarted){var n=!qt(Object.assign)&&!qt(Array.from);this.cr&&n?(this.gr(t),CT.info("starting")):this.stopRecording()}}gr(t){var r,n,s;this.cr&&(pn!=null&&(r=pn.__PosthogExtensions__)!=null&&(r=r.rrweb)!=null&&r.record&&(n=pn.__PosthogExtensions__)!=null&&n.initSessionRecording?this._r(t):(s=pn.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,this.mr,(a=>{if(a)return CT.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(w1t)}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=_a(o)?null:parseFloat(o);_a(l)&&this.yr();var c=i?.minimumDurationMilliseconds;s.register({[uee]:cr({enabled:!!i},i,{networkPayloadCapture:cr({capturePerformance:t.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:qt(c)?null:c,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:CT.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):CT.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(uee);return(n==null||(r=n.scriptConfig)==null?void 0:r.script)||"lazy-recorder"}_r(t){var r,n;if((r=pn.__PosthogExtensions__)==null||!r.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(n=pn.__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 nD={},sie=()=>{},mE="posthog",bwt=!ICn&&cu?.indexOf("MSIE")===-1&&cu?.indexOf("Mozilla")===-1,xFe=e=>{var t;return cr({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:kOn(Xt?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:sie,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:mu&&Yo(mu?.search)&&mu.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:(Xe==null||(t=Xe.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:rie},error_tracking:{},_onCapture:sie,__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))},wFe=e=>{var t={};qt(e.process_person)||(t.person_profiles=e.process_person),qt(e.xhr_headers)||(t.request_headers=e.xhr_headers),qt(e.cookie_name)||(t.persistence_name=e.cookie_name),qt(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),qt(e.store_google)||(t.save_campaign_params=e.store_google),qt(e.verbose)||(t.debug=e.verbose);var r=fo({},t,e);return Na(e.property_blacklist)&&(qt(e.property_denylist)?r.property_denylist=e.property_blacklist:Na(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 nTn{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 i7{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 nTn,this.Sr=!1,this.version=ny.LIB_VERSION,this.Er=new $ge,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=xFe(),this.SentryIntegration=eCn,this.sentryIntegration=t=>(function(r,n){var s=F1t(r,n);return{name:L1t,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 jCn(this),this.toolbar=new rCn(this),this.scrollManager=new QCn(this),this.pageViewManager=new SCn(this),this.surveys=new UCn(this),this.experiments=new Wl(this),this.exceptions=new NCn(this),this.rateLimiter=new VCn(this),this.requestRouter=new KCn(this),this.consent=new QOn(this),this.externalIntegrations=new rTn(this),this.people={set:(t,r,n)=>{var s=Yo(t)?{[t]:r}:t;this.setPersonProperties(s),n?.({})},set_once:(t,r,n)=>{var s=Yo(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!==mE){var s,a=(s=nD[n])!==null&&s!==void 0?s:new i7;return a._init(t,r,n),nD[n]=a,nD[mE][n]=a,a}return this._init(t,r,n)}_init(t,r,n){var s;if(r===void 0&&(r={}),qt(t)||Mae(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(fo({},xFe(r.defaults),wFe(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:py.GZipJS;var a=this.Cr();this.persistence=new wee(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new wee(cr({},this.config,{persistence:"sessionStorage"}),a);var i=cr({},this.persistence.props),o=cr({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new HCn((w=>this.Or(w)),this.config.request_queue_config),this.Ar=new GCn(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 yFe(this),this.sessionPropsManager=new gFe(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)),ny.DEBUG=ny.DEBUG||this.config.debug,ny.DEBUG&&Kt.info("Starting in debug mode",{this:this,config:r,thisC:cr({},this.config),p:i,s:o}),((s=r.bootstrap)==null?void 0:s.distinctID)!==void 0){var c,d,p=this.config.get_device_id(xv()),f=(c=r.bootstrap)!=null&&c.isIdentifiedID?p:r.bootstrap.distinctID;this.persistence.set_property(sy,(d=r.bootstrap)!=null&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.bootstrap.distinctID,$device_id:f})}if(this.jr()){var h,m,g=Object.keys(((h=r.bootstrap)==null?void 0:h.featureFlags)||{}).filter((w=>{var S;return!((S=r.bootstrap)==null||(S=S.featureFlags)==null||!S[w])})).reduce(((w,S)=>{var _;return w[S]=((_=r.bootstrap)==null||(_=_.featureFlags)==null?void 0:_[S])||!1,w}),{}),b=Object.keys(((m=r.bootstrap)==null?void 0:m.featureFlagPayloads)||{}).filter((w=>g[w])).reduce(((w,S)=>{var _,O;return(_=r.bootstrap)!=null&&(_=_.featureFlagPayloads)!=null&&_[S]&&(w[S]=(O=r.bootstrap)==null||(O=O.featureFlagPayloads)==null?void 0:O[S]),w}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:vT,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(xv());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(sy,"anonymous")}return To(Xe,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),r.segment?JOn(this,(()=>this.Lr())):this.Lr(),$v(this.config._onCapture)&&this.config._onCapture!==sie&&(Kt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(w=>this.config._onCapture(w.event,w)))),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 KOn(this),this.historyAutocapture.startIfEnabled();var n=[];n.push((()=>{new sCn(this).startIfEnabledOrStop()})),n.push((()=>{var s;this.siteApps=new YCn(this),(s=this.siteApps)==null||s.init()})),t||n.push((()=>{this.sessionRecording=new vFe(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||n.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),n.push((()=>{this.autocapture=new BOn(this),this.autocapture.startIfEnabled()})),n.push((()=>{this.surveys.loadIfEnabled()})),n.push((()=>{this.heatmaps=new wCn(this),this.heatmaps.startIfEnabled()})),n.push((()=>{this.webVitalsAutocapture=new vCn(this)})),n.push((()=>{this.exceptionObserver=new YOn(this),this.exceptionObserver.startIfEnabled()})),n.push((()=>{this.deadClicksAutocapture=new M1t(this,XOn),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,c;if(!Xt||!Xt.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=is(t.supportedCompression,py.GZipJS)?py.GZipJS:is(t.supportedCompression,py.Base64)?py.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),(c=this.deadClicksAutocapture)==null||c.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 qCn(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()&&Lv(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&&(bwt?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=VL(t.url,{ip:this.config.ip?1:0}),t.headers=cr({},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=cr({},r);i.timeout=i.timeout||6e4,i.url=VL(i.url,{_:new Date().getTime().toString(),ver:ny.LIB_VERSION,compression:i.compression});var o=(n=i.transport)!==null&&n!==void 0?n:"fetch",l=C3.filter((d=>!i.disableTransport||!d.transport||!i.disableTransport.includes(d.transport))),c=(s=(a=b1t(l,(d=>d.transport===o)))==null?void 0:a.method)!==null&&s!==void 0?s:l[0].method;if(!c)throw new Error("No available transport method");c(i)})(cr({},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=[];Lv(t,(o=>{o&&(r=o[0],Na(r)?a.push(o):$v(o)?o.call(this):Na(o)&&r==="alias"?n.push(o):Na(o)&&r.indexOf("capture")!==-1&&$v(this[r])?a.push(o):s.push(o))}));var i=function(o,l){Lv(o,(function(c){if(Na(c[0])){var d=l;qa(c,(function(p){d=d[p[0]].apply(d,p.slice(1))}))}else this[c[0]].apply(this,c.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(!qt(t)&&Yo(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&&!Yo(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,c=xv(),d={uuid:c,event:t,properties:this.calculateEventProperties(t,r||{},l,c)};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=EOn(d,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,qt(n?.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=o),t===T3.DISMISSED||t===T3.SENT){var h=r?.[fFe.SURVEY_ID],m=r?.[fFe.SURVEY_ITERATION];p={id:h,current_iteration:m},localStorage.getItem(hFe(p))||localStorage.setItem(hFe(p),"true"),d.$set=cr({},d.$set,{[LCn({id:h,current_iteration:m},t===T3.SENT?"responded":"dismissed")]:!0})}var g=cr({},d.properties.$set,d.$set);if(RE(g)||this.setPersonPropertiesForFlags(g),!_a(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=cr({},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=cr({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!Yo(o.distinct_id)&&!Jm(o.distinct_id)||Mae(o.distinct_id))&&Kt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var c,d=bCn(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&&fo(o,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&fo(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===oA.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),c=t!=="$pageview"||a?t!=="$pageleave"||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,s),o=fo(o,c),t==="$pageview"&&Xt&&(o.title=Xt.title),!qt(i)){var m=n.getTime()-i;o.$duration=parseFloat((m/1e3).toFixed(3))}cu&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=fo({},d,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),Na(this.config.property_denylist)?qa(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 g=this.config.sanitize_properties;g&&(Kt.error("sanitize_properties is deprecated. Use before_send instead"),o=g(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=fo({},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,RE(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=BCn),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(Jm(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!==vT){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(tA)&&(this.unregister(tA),this.register({distinct_id:t}));var i=(this.persistence.get_property(sy)||"anonymous")==="anonymous";t!==s&&i?(this.persistence.set_property(sy,"identified"),this.setPersonPropertiesForFlags(cr({},n||{},r||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:s},{$set:r||{},$set_once:n||{}}),this.Tr=lFe(t,r,n),this.featureFlags.setAnonymousDistinctId(s)):(r||n)&&this.setPersonProperties(r,n),t!==s&&(this.reloadFeatureFlags(),this.unregister(RL))}}else Kt.critical('The string "'+vT+'" 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=lFe(this.get_distinct_id(),t,r);this.Tr!==n?(this.setPersonPropertiesForFlags(cr({},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:cr({},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(sy,"anonymous"),(a=this.sessionManager)==null||a.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:vT,$device_id:null},"");else{var o=this.config.get_device_id(xv());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(v1t)?(Kt.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(qt(r)&&(r=this.get_distinct_id()),t!==r?(this.Jr(tA,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=cr({},this.config);if(ll(t)){var n,s,a,i,o;fo(this.config,wFe(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 wee(cr({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);Mv(c)&&(this.config.debug=c),Mv(this.config.debug)&&(this.config.debug?(ny.DEBUG=!0,_i.H()&&_i.G("ph_debug","true"),Kt.info("set_config",{config:t,oldConfig:r,newConfig:cr({},this.config)})):(ny.DEBUG=!1,_i.H()&&_i.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(cr({},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:mE;return r!==mE&&(r=mE+"."+r),r}_isIdentified(){var t,r;return((t=this.persistence)==null?void 0:t.get_property(sy))==="identified"||((r=this.sessionPersistence)==null?void 0:r.get_property(sy))==="identified"}Gr(){var t,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&RE(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[tA])&&((r=this.persistence)==null||(r=r.props)==null||!r[jL]))}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(jL,!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 yFe(this),this.persistence&&(this.sessionPropsManager=new gFe(this,this.sessionManager,this.persistence)),this.sessionRecording=new vFe(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(),(qt(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:vT,$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===ay.GRANTED?"granted":t===ay.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 Td?ywt(Td,this.config.custom_blocked_useragents):void 0}Hr(){Xt&&(Xt.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:Xt.title},{send_instantly:!0}),this.kr&&(Xt.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),To(Xt,"visibilitychange",this.kr)))}debug(t){t===!1?(Xe?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(Xe?.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)&&!qt(t[r]),o=n in t&&!qt(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(_a(this.config.before_send))return t;var r=Na(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r){if(n=s(n),_a(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return Xkn(t.event)?Kt.warn(a+". This can cause unexpected behavior."):Kt.info(a),null}n.properties&&!RE(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=Mv(t)&&!t,n=_i.H()&&_i.q("ph_debug")==="true";return!r&&(!!n||t)}}(function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=SOn(e.prototype[t[r]])})(i7,["identify"]);var SFe,fy=(SFe=nD[mE]=new i7,(function(){function e(){e.done||(e.done=!0,bwt=!1,qa(nD,(function(t){t._dom_loaded()})))}Xt!=null&&Xt.addEventListener?Xt.readyState==="complete"?e():To(Xt,"DOMContentLoaded",e,{capture:!1}):Xe&&Kt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),SFe),vwt=E.createContext({client:fy,bootstrap:void 0});function xwt(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)||!xwt(e[o],t[o],r))return!1}return!0}function sTn(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."),fy)},[s,a,JSON.stringify(i)]);return E.useEffect(function(){if(!s){var c=o.current;c?(a!==c.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&&!xwt(i,c.options)&&fy.set_config(i),o.current={apiKey:a,options:i??{}}):(fy.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),fy.init(a,i),o.current={apiKey:a,options:i??{}})}},[s,a,JSON.stringify(i)]),Ee.createElement(vwt.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 _ee=function(e){return typeof e=="function"},aie=function(e,t){return aie=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])},aie(e,t)};function aTn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");aie(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var iTn={componentStack:null,exceptionEvent:null,error:null},oTn={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){aTn(t,e);function t(r){var n=e.call(this,r)||this;return n.state=iTn,n}return t.prototype.componentDidCatch=function(r,n){var s=this.props.additionalProperties,a;_ee(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 _ee(n)?n():n;var i=_ee(s)?Ee.createElement(s,{error:a.error,componentStack:a.componentStack,exceptionEvent:a.exceptionEvent}):s;return Ee.isValidElement(i)?i:(console.warn(oTn.INVALID_FALLBACK),Ee.createElement(Ee.Fragment,null))},t.contextType=vwt,t})(Ee.Component);function lTn({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}fy.init("phc_SBLpZVAB6jmHOct9CABq3PF0Yn5FU3G2FgT4xUr2XrT",{api_host:"https://us.posthog.com"}),fy.register({mastraSource:"playground"})},[]),u.jsx(sTn,{client:fy,children:e})}function cTn(){return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(p6e,{})}),"Request Context"]})}),u.jsx(eo,{children:u.jsx(uvn,{children:u.jsx(cvn,{})})})]})}const uTn=()=>{const{data:e=[],isLoading:t}=HP(),r=!t&&e.length===0;return u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(_h,{})}),"MCP Servers"]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(Io,{})}),"MCP documentation"]})})]}),u.jsx(eo,{isCentered:r,children:u.jsx(W_n,{mcpServers:e,isLoading:t})})]})},dTn=()=>{const{data:e}=HP(),{serverId:t,toolId:r}=to(),{data:n,isLoading:s}=s1t(t,r),a=e?.find(l=>l.id===t),i=n?.name,o=a?.name||"";return s||!n?null:u.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-hidden",children:[u.jsxs(bn,{children:[u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/mcps",children:[u.jsx(Ce,{children:u.jsx(_h,{})}),"MCP Servers"]}),u.jsx(qr,{as:er,to:`/mcps/${t}`,children:o}),u.jsx(qr,{as:"span",to:"",isCurrent:!0,children:i})]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(Io,{})}),"MCP documentation"]})})]}),u.jsx(J_n,{toolId:r,serverId:t})]})},pTn=()=>{const{serverId:e}=to(),{data:t=[],isLoading:r}=HP(),n=t.find(s=>s.id===e);return u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/mcps",children:[u.jsx(Ce,{children:u.jsx(_h,{})}),"MCP Servers"]}),u.jsx(qr,{as:"span",to:"",isCurrent:!0,children:u.jsx(qxt,{value:e,variant:"ghost"})})]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(Io,{})}),"MCP documentation"]})})]}),u.jsx(ekn,{isLoading:r,server:n})]})},fTn=["/swagger-ui","/openapi.json"],hTn=E.forwardRef(({children:e,href:t,...r},n)=>t&&fTn.some(a=>t.startsWith(a))?u.jsx("a",{ref:n,href:t,...r,children:e}):u.jsx(er,{ref:n,to:t,viewTransition:!0,...r,children:e}));function mTn(){const{Link:e}=ur(),{data:t={},isLoading:r}=rb(),{isCmsAvailable:n}=qP();return u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(wv,{})}),"Scorers"]}),u.jsxs(Qa,{children:[n&&u.jsxs(Se,{variant:"light",as:e,to:"/cms/scorers/create",children:[u.jsx(Ce,{children:u.jsx(gie,{})}),"Create a scorer"]}),u.jsxs(Se,{variant:"outline",as:er,to:"https://mastra.ai/en/docs/evals/overview",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(Io,{})}),"Scorers documentation"]})]})]}),u.jsx(eo,{isCentered:!r&&Object.keys(t||{}).length===0,children:u.jsx(Mvn,{isLoading:r,scorers:t})})]})}function gTn(){const{scorerId:e}=to(),[t,r]=Yd(),[n,s]=E.useState(),[a,i]=E.useState(0),[o,l]=E.useState(!1),[c,d]=E.useState({value:"all",label:"All",type:"ALL"}),{scorer:p,isLoading:f,error:h}=Rvn(e),{data:m={},isLoading:g,error:b}=Lh(),{data:v,isLoading:w,error:S}=eb(),{data:_,isLoading:O,error:C}=Nvn({scorerId:e,page:a,entityId:c?.value==="all"?void 0:c?.value,entityType:c?.type==="ALL"?void 0:c?.type}),T=p?.agentIds?.filter($=>m[$]).map($=>({value:$,label:m[$].name,type:"AGENT"}))||[],A=p?.workflowIds?.map($=>({value:$,label:$,type:"WORKFLOW"}))||[],I=[{value:"all",label:"All",type:"ALL"},...T,...A];if(E.useEffect(()=>{if(I){const $=t.get("entity"),X=I.find(U=>U.value===$);X&&X.value!==c?.value&&d(X)}},[t,c,I]),E.useEffect(()=>{if(h){const $=h instanceof Error?h.message:"Failed to load scorer";Je.error(`Error loading scorer: ${$}`)}},[h]),E.useEffect(()=>{if(b){const $=b instanceof Error?b.message:"Failed to load agents";Je.error(`Error loading agents: ${$}`)}},[b]),E.useEffect(()=>{if(S){const $=S instanceof Error?S.message:"Failed to load workflows";Je.error(`Error loading workflows: ${$}`)}},[S]),f||h||b||S)return null;const R=p?.agentIds?.map($=>({name:$,id:Object.entries(m).find(([X,U])=>U.name===$)?.[0]}))||[],P=p?.workflowIds?.map($=>({name:$,id:Object.entries(v||{}).find(([X,U])=>U.name===$)?.[0]}))||[],B=[{key:"entities",label:"Entities",value:([...R.map($=>({id:$.id,name:$.name,type:"AGENT"})),...P.map($=>({id:$.id,name:$.name,type:"WORKFLOW"}))]||[]).map($=>({id:$.id,name:$.name||$.id,path:`${$.type==="AGENT"?"/agents":"/workflows"}/${$.name}`}))}],M=$=>{$?.value&&r({entity:$?.value})},z=_?.scores||[],H=_?.pagination,q=$=>{s($),l(!0)},V=fge({entries:z,id:n,update:s}),Q=hge({entries:z,id:n,update:s});return u.jsxs(u.Fragment,{children:[u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/scorers",children:[u.jsx(Ce,{children:u.jsx(wv,{})}),"Scorers"]}),u.jsx(qr,{as:"span",to:"",isCurrent:!0,children:u.jsx(Pvn,{value:e,variant:"ghost"})})]}),u.jsxs(Qa,{children:[p?.scorer?.source==="stored"&&u.jsxs(Se,{variant:"light",as:er,to:`/cms/scorers/${e}/edit`,children:[u.jsx(Ce,{children:u.jsx(YOt,{})}),"Edit"]}),u.jsxs(Se,{as:er,to:"https://mastra.ai/en/docs/evals/overview",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(Io,{})}),"Scorers documentation"]})]})]}),u.jsx("div",{className:J("grid overflow-y-auto h-full"),children:u.jsxs("div",{className:J("max-w-[100rem] w-full px-12 mx-auto grid content-start gap-8 h-full"),children:[u.jsx(p_,{title:p?.scorer?.config?.name||"loading",description:p?.scorer?.config?.description||"loading",icon:u.jsx(wv,{})}),u.jsx(nS,{data:B,LinkComponent:er,isLoading:g||w}),u.jsx(Ivn,{selectedEntity:c,entityOptions:I,onEntityChange:M,onReset:()=>r({entity:"all"}),isLoading:O||g||w}),O?u.jsx("div",{className:"h-full w-full flex items-center justify-center",children:u.jsx(vs,{})}):u.jsx(vvn,{scores:z,selectedScoreId:n,pagination:{total:H?.total||0,hasMore:H?.hasMore||!1,perPage:H?.perPage||0,page:H?.page||0},onScoreClick:q,onPageChange:i,errorMsg:C?.message})]})})]}),u.jsx(vxt,{scorerName:p?.scorer?.config?.name,score:yTn(z.find($=>$.id===n)),isOpen:o,onClose:()=>l(!1),onNext:V,onPrevious:Q,computeTraceLink:($,X)=>`/observability?traceId=${$}${X?`&spanId=${X}`:""}`})]})}const yTn=e=>{if(e)return{...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt)}},bTn=async({client:e,page:t,perPage:r,filters:n})=>(await e.listTraces({pagination:{page:t,perPage:r},filters:n})).spans||[],vTn=({filters:e})=>{const t=ht(),{inView:r,setRef:n}=Wme(),s=w9({queryKey:["traces",e],queryFn:({pageParam:a})=>bTn({client:t,page:a,perPage:25,filters:e}),initialPageParam:0,getNextPageParam:(a,i,o)=>{if(a?.length)return o+1},staleTime:0,gcTime:0,select:a=>a.pages.flatMap(i=>i),retry:!1,refetchInterval:3e3});return E.useEffect(()=>{r&&s.hasNextPage&&!s.isFetchingNextPage&&s.fetchNextPage()},[r,s.hasNextPage,s.isFetchingNextPage]),{...s,setEndOfListElement:n}},xTn=(e,t)=>{const r=ht();return Cr({queryKey:["trace",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return await r.getTrace(e)},enabled:!!e,refetchInterval:3e3,...t})};function wTn(){const e=eg(),[t,r]=Yd(),[n,s]=E.useState(),[a,i]=E.useState({value:"all",label:"All",type:"all"}),[o,l]=E.useState(void 0),[c,d]=E.useState(void 0),[p,f]=E.useState(!1),{data:h={},isLoading:m}=Lh(),{data:g,isLoading:b}=eb(),{data:v={},isLoading:w}=rb(),{data:S,isLoading:_}=xTn(n,{enabled:!!n}),O=t.get("traceId"),C=t.get("spanId"),T=t.get("tab"),A=t.get("scoreId"),{data:I=[],isLoading:R,isFetchingNextPage:P,hasNextPage:L,setEndOfListElement:B,error:M,isError:z}=vTn({filters:{...a?.type!=="all"&&{entityId:a?.value,entityType:a?.type},...o&&{startedAt:{start:o}},...c&&{endedAt:{end:c}}}});E.useEffect(()=>{O&&(s(O),f(!0))},[O]);const H=(Object.entries(h)||[]).map(([ee,te])=>({value:te.id,label:te.name,type:MN.AGENT})),q=(Object.entries(g||{})||[]).map(([,ee])=>({value:ee.name,label:ee.name,type:MN.WORKFLOW_RUN})),V=[{value:"all",label:"All",type:"all"},...H,...q];E.useEffect(()=>{if(V){const ee=t.get("entity"),te=V.find(se=>se.value===ee);te&&te.value!==a?.value&&i(te)}},[t,a,V]);const Q=()=>{s(void 0),r({entity:"all",traceId:""}),f(!1),l(void 0),d(void 0)},$=(ee,te)=>{if(te==="from")return l(ee);d(ee)},X=ee=>{ee?.value&&r({entity:ee?.value})},U=ee=>{if(ee===n)return s(void 0);s(ee),f(!0)},N=z?V_n(M):void 0,Z=a?.value!=="all"||o||c,G=fge({entries:I.map(ee=>({id:ee.traceId})),id:n,update:s}),K=hge({entries:I.map(ee=>({id:ee.traceId})),id:n,update:s});return u.jsxs(u.Fragment,{children:[u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(cD,{})}),"Observability"]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(Io,{})}),"Observability documentation"]})})]}),u.jsx("div",{className:J("grid overflow-y-auto h-full"),children:u.jsxs("div",{className:J("max-w-[100rem] px-12 mx-auto grid content-start gap-8 h-full"),children:[u.jsx(p_,{title:"Observability",description:"Explore observability traces for your entities",icon:u.jsx(cD,{})}),u.jsx(qwn,{onEntityChange:X,onReset:Q,selectedEntity:a,entityOptions:V,onDateChange:$,selectedDateFrom:o,selectedDateTo:c,isLoading:R||m||b}),R?u.jsx(yxt,{columns:k3}):u.jsx(Hwn,{traces:I,selectedTraceId:n,onTraceClick:U,errorMsg:N?.error,setEndOfListElement:B,filtersApplied:!!Z,isFetchingNextPage:P,hasNextPage:L})]})})]}),u.jsx(Vwn,{traceSpans:S?.spans,traceId:n,initialSpanId:C||void 0,initialSpanTab:T==="scores"?"scores":"details",initialScoreId:A||void 0,traceDetails:I.find(ee=>ee.traceId===n),isOpen:p,onClose:()=>{e("/observability"),f(!1)},onNext:G,onPrevious:K,isLoadingSpans:_,computeTraceLink:(ee,te)=>`/observability?traceId=${ee}${te?`&spanId=${te}`:""}`,scorers:v,isLoadingScorers:w})]})}function EFe(){const{workspaceId:e}=to(),[t,r]=Yd(),n=eg(),[s,a]=E.useState(!1),[i,o]=E.useState(!1),[l,c]=E.useState(!1),[d,p]=E.useState(null),[f,h]=E.useState(null),[m,g]=E.useState(!1),b=t.get("file"),v=t.get("tab"),{data:w,error:S}=t0t(),_=w?.workspaces??[],O=e??_[0]?.id,{data:C,isLoading:T,error:A}=s1n(O),I=C?.filesystem?.metadata,R=I?.contained===!1&&typeof I?.basePath=="string"?I.basePath:"/",P=t.get("path")||R,L=fae(S)||fae(A),B=O?_.find(ze=>ze.id===O):void 0,M=ze=>{const pt=new URLSearchParams(t);for(const[bt,nt]of Object.entries(ze))nt===null?pt.delete(bt):pt.set(bt,nt);r(pt)},z=ze=>{g(!1),n(`/workspaces/${ze}`)},H=ze=>{M({path:ze,file:null})},q=ze=>{M({file:ze})},V=ze=>{M({tab:ze})},Q=P,$=b,{data:X,isLoading:U,error:N,refetch:Z}=a1n(Q,{enabled:C?.isWorkspaceConfigured&&C?.capabilities?.hasFilesystem,workspaceId:O}),G=o1n(),K=l1n(),ee=c1n(),{data:te,isLoading:se}=r0t($??"",{enabled:!!$,workspaceId:O}),{data:ue,isLoading:xe,refetch:W}=u1n({workspaceId:O}),ae=f1n(),ne=y1n(),ye=b1n(),le=v1n(),be=C?.isWorkspaceConfigured??!1,Ne=C?.capabilities?.hasFilesystem??!1,ke=C?.capabilities?.hasSkills??!1,oe=C?.capabilities?.canBM25??!1,pe=C?.capabilities?.canVector??!1,he=B?.safety?.readOnly??!1,Ie=Ne&&!he,Te=C?.mounts,we=Te?.filter(ze=>!ze.readOnly).map(ze=>({path:ze.path,displayName:ze.displayName,icon:ze.icon,provider:ze.provider,name:ze.name})),de=Te&&Te.length>1?Te.map(ze=>ze.path):void 0,De=E.useCallback(ze=>{O&&ne.mutate({...ze,workspaceId:O},{onSuccess:async pt=>{if(pt.success){c(!1);const{data:bt,error:nt}=await W();if(nt||!bt){Je.success(`Skill "${pt.skillName}" installed successfully (${pt.filesWritten} files)`);return}bt.skills.some(kr=>kr.name===pt.skillName)?Je.success(`Skill "${pt.skillName}" installed successfully (${pt.filesWritten} files)`):(g(!0),Je.warning(`Skill "${pt.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else Je.error("Failed to install skill")},onError:pt=>{Je.error(`Failed to install skill: ${pt instanceof Error?pt.message:"Unknown error"}`)}})},[O,ne,W]),Le=E.useCallback(ze=>{O&&(h(ze),ye.mutate({workspaceId:O,skillName:ze},{onSuccess:pt=>{if(h(null),pt.updated.length>0){const bt=pt.updated[0];bt.success?(Je.success(`Skill "${ze}" updated successfully (${bt.filesWritten} files)`),W()):Je.error(`Failed to update skill: ${bt.error??"Unknown error"}`)}else Je.error("Failed to update skill: No update result returned")},onError:pt=>{h(null),Je.error(`Failed to update skill: ${pt instanceof Error?pt.message:"Unknown error"}`)}}))},[O,ye,W]),rt=E.useCallback(ze=>{O&&(p(ze),le.mutate({workspaceId:O,skillName:ze},{onSuccess:pt=>{p(null),pt.success?(Je.success(`Skill "${pt.skillName}" removed successfully`),W()):Je.error(`Failed to remove skill "${pt.skillName}"`)},onError:pt=>{p(null),Je.error(`Failed to remove skill: ${pt instanceof Error?pt.message:"Unknown error"}`)}}))},[O,le,W]),Mt=v==="files"&&Ne?"files":v==="skills"&&ke?"skills":Ne?"files":ke?"skills":"files",ut=ue?.skills??[],or=ue?.isSkillsConfigured??!1,Hr=X?.entries??[];return L?u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(ev,{className:"h-4 w-4"})}),"Workspace"]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(Io,{})}),"Documentation"]})})]}),u.jsx("div",{className:"grid overflow-y-auto h-full",children:u.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[u.jsx(p_,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:u.jsx(ev,{})}),u.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[u.jsx("div",{className:"flex items-center justify-center w-16 h-16 rounded-full bg-amber-500/10 mb-6",children:u.jsx(Dee,{className:"h-8 w-8 text-amber-500"})}),u.jsx("h2",{className:"text-xl font-semibold text-neutral6 mb-2",children:"Workspace Not Supported"}),u.jsxs("p",{className:"text-neutral4 max-w-md mb-6",children:["The workspace feature requires a newer version of ",u.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),". Please upgrade your dependencies to enable workspace functionality."]}),u.jsxs(Se,{as:er,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(Io,{})}),"Learn More"]})]})]})})]}):!T&&!be?u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(ev,{className:"h-4 w-4"})}),"Workspace"]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(Io,{})}),"Documentation"]})})]}),u.jsx("div",{className:"grid overflow-y-auto h-full",children:u.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[u.jsx(p_,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:u.jsx(ev,{})}),u.jsx(ukn,{})]})})]}):u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(ev,{className:"h-4 w-4"})}),"Workspace"]}),u.jsxs(Qa,{children:[(Ne||ke)&&u.jsxs(Se,{variant:"light",onClick:()=>a(!s),children:[u.jsx(Ce,{children:u.jsx(aCt,{className:"h-4 w-4"})}),"Search"]}),u.jsxs(Se,{as:er,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(Io,{})}),"Documentation"]})]})]}),u.jsx("div",{className:"grid overflow-y-auto h-full",children:u.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start gap-6 h-full w-full",children:[u.jsx(p_,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:u.jsx(ev,{})}),_.length>1&&u.jsxs("div",{className:"relative",children:[u.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:[B?.source==="agent"?u.jsx(TM,{className:"h-4 w-4 text-accent1"}):u.jsx(Sz,{className:"h-4 w-4 text-neutral4"}),u.jsxs("span",{className:"flex-1 text-left truncate",children:[B?.name??"Select workspace",B?.source==="agent"&&B.agentName&&u.jsxs("span",{className:"text-neutral4 ml-1",children:["(",B.agentName,")"]})]}),u.jsx(EOt,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&u.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(ze=>u.jsxs("button",{onClick:()=>{z(ze.id),o(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${B?.id===ze.id?"bg-surface3":""}`,children:[ze.source==="agent"?u.jsx(TM,{className:"h-4 w-4 text-accent1 flex-shrink-0"}):u.jsx(Sz,{className:"h-4 w-4 text-neutral4 flex-shrink-0"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:ze.name}),u.jsx("div",{className:"text-xs text-neutral4 truncate",children:ze.source==="agent"?`Agent: ${ze.agentName}`:"Global workspace"})]}),u.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[ze.safety?.readOnly&&u.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"}),ze.capabilities.hasFilesystem&&u.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),ze.capabilities.hasSandbox&&u.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),ze.capabilities.hasSkills&&u.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},ze.id))})]}),_.length===1&&B&&u.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[B.source==="agent"?u.jsx(TM,{className:"h-4 w-4 text-accent1"}):u.jsx(Sz,{className:"h-4 w-4"}),u.jsx("span",{children:B.name}),B.source==="agent"&&B.agentName&&u.jsxs("span",{className:"text-neutral3",children:["(",B.agentName,")"]}),he&&u.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),s&&u.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[Ne&&(oe||pe)&&u.jsxs("div",{children:[u.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[u.jsx(e0e,{className:"h-4 w-4"}),"Search Files"]}),u.jsx(dkn,{onSearch:ze=>ee.mutate({...ze,workspaceId:O}),isSearching:ee.isPending,searchResults:ee.data,canBM25:oe,canVector:pe,onViewResult:ze=>q(ze)})]}),ke&&or&&ut.length>0&&u.jsxs("div",{children:[u.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[u.jsx(I3,{className:"h-4 w-4"}),"Search Skills"]}),u.jsx(fkn,{onSearch:ze=>ae.mutate({...ze,workspaceId:O}),results:ae.data?.results??[],isSearching:ae.isPending})]})]}),u.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[Ne&&u.jsxs("button",{onClick:()=>V("files"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Mt==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[u.jsx(e0e,{className:"h-4 w-4"}),"Files"]}),ke&&u.jsxs("button",{onClick:()=>V("skills"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Mt==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[u.jsx(I3,{className:"h-4 w-4"}),"Skills",or&&ut.length>0&&u.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:ut.length})]})]}),u.jsxs("div",{className:"pb-8",children:[Mt==="files"&&Ne&&u.jsx("div",{className:"space-y-4",children:u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[u.jsx(ikn,{entries:Hr,currentPath:Q,isLoading:U,error:N,onNavigate:H,onFileSelect:q,onRefresh:()=>Z(),onCreateDirectory:he?void 0:ze=>K.mutate({path:ze,workspaceId:O}),onDelete:he?void 0:ze=>G.mutate({path:ze,recursive:!0,force:!0,workspaceId:O})}),$&&u.jsx(ckn,{path:$,content:te?.content??"",isLoading:se,mimeType:te?.mimeType,onClose:()=>q(null)})]})}),Mt==="skills"&&ke&&u.jsx(vkn,{skills:ut,isLoading:xe,isSkillsConfigured:or,hasUndiscoveredAgentSkills:m,basePath:O?`/workspaces/${O}/skills`:"/workspaces",onAddSkill:Ie?()=>c(!0):void 0,onUpdateSkill:Ie?Le:void 0,onRemoveSkill:Ie?rt:void 0,updatingSkillName:f??void 0,removingSkillName:d??void 0,mountPaths:de}),!Ne&&!ke&&u.jsx("div",{className:"py-12 text-center text-neutral4",children:u.jsx("p",{children:"No workspace capabilities are configured."})})]})]})}),O&&Ie&&u.jsx(kkn,{open:l,onOpenChange:c,workspaceId:O,onInstall:De,isInstalling:ne.isPending,installedSkillIds:ut.filter(ze=>ze.skillsShSource).map(ze=>`${ze.skillsShSource.owner}/${ze.skillsShSource.repo}/${ze.name}`),installedSkillNames:ut.filter(ze=>!ze.skillsShSource).map(ze=>ze.name),writableMounts:we,installedSkillPaths:Object.fromEntries(ut.filter(ze=>ze.path).map(ze=>[ze.name,ze.path]))})]})}function STn(){const{skillName:e,workspaceId:t}=to(),[r]=Yd(),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:c,isLoading:d,error:p}=d1n(n,{workspaceId:t}),{data:f}=r0t(c?.path?`${c.path}/SKILL.md`:"",{enabled:!!c?.path,workspaceId:t}),{data:h,isLoading:m}=p1n(n,o??"",{enabled:!!o,workspaceId:t}),g=b=>a?u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:i,children:[u.jsx(Ce,{children:u.jsx(TM,{className:"h-4 w-4"})}),a]}),u.jsxs(qr,{as:"span",to:"",isCurrent:!0,children:[u.jsx(Ce,{children:u.jsx(I3,{className:"h-4 w-4"})}),b]})]}):u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:i,children:[u.jsx(Ce,{children:u.jsx(ev,{className:"h-4 w-4"})}),"Workspace"]}),u.jsxs(qr,{as:er,to:i,children:[u.jsx(Ce,{children:u.jsx(I3,{className:"h-4 w-4"})}),"Skills"]}),u.jsx(qr,{as:"span",to:"",isCurrent:!0,children:b})]});return d?u.jsxs(yn,{children:[u.jsx(bn,{children:g("Loading...")}),u.jsx("div",{className:"grid place-items-center h-full",children:u.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):p||!c?u.jsxs(yn,{children:[u.jsx(bn,{children:g("Error")}),u.jsx("div",{className:"grid place-items-center h-full",children:u.jsxs("div",{className:"text-center",children:[u.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),u.jsx("p",{className:"text-sm text-neutral3",children:p?.message??"Skill not found"})]})})]}):u.jsxs(yn,{children:[u.jsxs(bn,{children:[g(n),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[u.jsx(Ce,{children:u.jsx(Io,{})}),"Documentation"]})})]}),u.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:u.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:u.jsx(Ekn,{skill:c,rawSkillMd:f?.content,onReferenceClick:l})})}),u.jsx(_kn,{open:!!o,onOpenChange:b=>!b&&l(null),skillName:n,referencePath:o??"",content:h?.content,isLoading:m})]})}async function wwt(){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 ETn({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 _Tn({repoOrSlug:e,owner:t}){const{templates:r}=await wwt(),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 ETn({repo:e,owner:t});if(s)return s;throw new Error(`Template ${e} not found`)}return n}async function kTn({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(`
|
|
651
|
-
`).reduce((o,l)=>{if(!l||l.startsWith("#"))return o;const[c,d]=l.split("=");return c&&(o[c]=d?.split("")?.every(p=>p==="*")?"":d?.replaceAll('"',"")),o},{}):{}}const OTn=()=>Cr({queryKey:["mastra-templates"],queryFn:wwt}),CTn=({repoOrSlug:e,owner:t})=>Cr({queryKey:["template-repo",e,t],queryFn:()=>_Tn({repoOrSlug:e,owner:t})}),TTn=({repo:e,owner:t,branch:r})=>Cr({queryKey:["template-repo-env-vars",e,t,r],queryFn:()=>kTn({repo:e,owner:t,branch:r})}),ATn=()=>{const e=ht();return Cr({queryKey:["agent-builder-workflow"],queryFn:async()=>await e.getAgentBuilderAction("merge-template").details()})},DTn=()=>{const e=ht();return _n({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").createRun({runId:t})})},ITn=()=>{const e=ht();return _n({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").runById(t)})},_Fe=(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}},NTn=(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)}},Swt=(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 c=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 c.read();if(p)break;const{newState:h}=_Fe(f,d,e);if(d=h,n(h),f.runId||l||t){const m=f.runId||l||t;NTn(m,h)}}}catch(p){console.error("💥 [processStream] Error processing template installation stream:",p);const{newState:f}=_Fe({type:"error",payload:{error:p instanceof Error?p.message:"Unknown error"}},d,e);n(f)}finally{a(!1),c.releaseLock()}}}},RTn=e=>{const t=ht(),{streamResult:r,isStreaming:n,processStream:s}=Swt(e);return{streamInstall:_n({mutationFn:async({inputData:i,selectedModel:o,runId:l})=>{for(let d=1;d<=3;d++)try{const p=t.getAgentBuilderAction("merge-template"),f=new my;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}},PTn=e=>{const t=ht(),{streamResult:r,isStreaming:n,processStream:s}=Swt(e);return{observeInstall:_n({mutationFn:async({runId:i})=>{for(let c=1;c<=3;c++)try{const p=await t.getAgentBuilderAction("merge-template").observeStream({runId:i});await s(p,i);return}catch(d){console.error(`💥 [observeInstall] Attempt ${c} 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 ${c}/3 failed:`,d),p&&c<3){console.log(`🔄 ObserveStream network error detected (likely hot reload), retrying in 2000ms... (attempt ${c+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 jTn(){const{data:e,isLoading:t}=OTn(),{templates:r,tags:n,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=E.useState("all"),[o,l]=E.useState("all"),[c,d]=E.useState(""),p=[{value:"all",label:"All"}];(n||[]).forEach(w=>{p.push({value:w,label:w})});const f=[{value:"all",label:"All"}];(s||[]).forEach(w=>{f.push({value:w,label:w})});const h=(w,S)=>{S==="tag"?i(w):S==="provider"&&l(w)},m=w=>{d(w)},g=()=>{i("all"),l("all"),d("")},b=r.filter(w=>!(c&&!w.title.toLowerCase().includes(c)&&!w.description.toLowerCase().includes(c)||a!=="all"&&!w.tags.includes(a)||o!=="all"&&!w.supportedProviders.includes(o))),v=c||a!=="all"||o!=="all";return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(mie,{})}),"Templates"]})}),u.jsxs("div",{className:J("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[u.jsx(hwn,{selectedTag:a,onTagChange:w=>h(w,"tag"),tagOptions:p,selectedProvider:o,onProviderChange:w=>h(w,"provider"),providerOptions:f,searchTerm:c,onSearchChange:m,onReset:v?g:void 0,className:"max-w-[80rem]",isLoading:t}),u.jsx(gwn,{templates:b,linkComponent:er,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const $Tn="1.6.0-alpha.0";function MTn(){const{templateSlug:e}=to(),[t,r]=Yd(),[n,s]=E.useState(""),[a,i]=E.useState(""),[o,l]=E.useState(""),[c,d]=E.useState({}),[p,f]=E.useState([]),[h,m]=E.useState(null),[g,b]=E.useState(!1),[v,w]=E.useState(""),[S,_]=E.useState(!1),[O,C]=E.useState(!1),[T,A]=E.useState([]),{data:I,isLoading:R}=CTn({repoOrSlug:e,owner:"mastra-ai"}),L=$Tn?.includes("beta")??!1?"beta":"main",{data:B,isLoading:M}=TTn({repo:I?.githubUrl?new URL(I.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:L}),{data:z,isLoading:H}=ATn(),{mutateAsync:q,isPending:V}=DTn(),{mutateAsync:Q,isPending:$}=ITn(),{streamInstall:X,streamResult:U,isStreaming:N}=RTn(z),{observeInstall:Z,streamResult:G,isStreaming:K}=PTn(z);E.useEffect(()=>{const ne=t.get("runId");ne&&!g&&!h&&!N&&!K&&(console.log("🔄 Checking completed run after hot reload:",{runId:ne}),w(ne),Q({runId:ne}).then(ye=>{const le=ye.snapshot;if(le?.status==="success"&&le?.result?.success)b(!0);else if(le?.result?.success===!1)if(le?.result?.validationResults&&!le?.result?.validationResults?.valid&&le?.result?.validationResults?.remainingErrors>0){const{remainingErrors:Ne,errors:ke}=le.result.validationResults,oe=`Template installation completed but ${Ne} validation issue${Ne>1?"s":""} remain unresolved.`;m(oe),A(ke||[])}else m(le?.result?.message||le?.result?.error||"Template installation failed")}).catch(ye=>{console.error("❌ Failed to fetch run details:",ye),m("Failed to retrieve installation status after reload")}))},[t,g,h,N,K,Q]),E.useEffect(()=>{const ne=t.get("runId"),ye=t.get("resume"),le=t.get("provider");if(ne&&ye==="true"&&le&&!N&&!K&&!S&&!O&&z){w(ne),_(!0);try{Q({runId:ne}).then(be=>{if(be.snapshot?.status==="running")return Z.mutateAsync({runId:ne})}).then(()=>{r(be=>{const Ne=new URLSearchParams(be);return Ne.delete("resume"),Ne})}).catch(be=>{console.error("❌ Failed to resume template installation:",be),be.message?.includes("404")||be.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(be){console.error("❌ Auto-resume failed with error:",be),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,N,K,S,O,z,Q,Z,r]);const ee=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],te=[{key:"tools",label:"Tools",value:I?.tools?.length?I.tools.map(ne=>ne).join(", "):"n/a",icon:u.jsx(vl,{})},{key:"agents",label:"Agents",value:I?.agents?.length?I.agents.map(ne=>ne).join(", "):"n/a",icon:u.jsx(Ji,{})},{key:"workflows",label:"Workflows",value:I?.workflows?.length?I.workflows.map(ne=>ne).join(", "):"n/a",icon:u.jsx(hCt,{})},{key:"providers",label:"Providers",value:I?.supportedProviders?.length?I.supportedProviders.join(", "):"n/a",icon:u.jsx(bOt,{})},{key:"tags",label:"Tags",value:I?.tags?.length?I.tags.join(", "):"n/a",icon:u.jsx(lCt,{})}],se=[{...te[0]},{...te[1]},{...te[2]}].filter(ne=>ne.value!=="n/a");E.useEffect(()=>{B&&d(B)},[B]),E.useEffect(()=>{const ne=U||G;ne?.phase==="error"&&ne?.error&&m(ne.error)},[U?.phase,U?.error,G?.phase,G?.error]);const ue=ne=>{s(ne)},xe=async ne=>(i(ne.provider),l(ne.modelId),{message:"Model updated successfully"}),W=async()=>{const ne=Object.entries(c).reduce((ye,[le,be])=>(be===""&&ye.push(le),ye),[]);if(ne.length>0){f(ne);return}if(I){m(null),b(!1),w(""),C(!0);try{const le={repo:I.githubUrl||`https://github.com/mastra-ai/template-${I.slug}`,ref:L,slug:I.slug,variables:c},{runId:be}=await q({});w(be),r(Ne=>{const ke=new URLSearchParams(Ne);return ke.set("runId",be),ke.set("resume","true"),ke.set("provider",n||"openai"),ke}),await X.mutateAsync({inputData:le,selectedModel:{provider:a,modelId:o},runId:be})}catch(ye){C(!1),m(ye?.message||"Template installation failed"),console.error("Template installation failed",ye)}}},ae=ne=>{const{name:ye,value:le}=ne.target;le.trim()===""?f(be=>[...be,ye]):f(be=>be.filter(Ne=>Ne!==ye)),d(be=>({...be,[ye]:le}))};return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/templates",children:[u.jsx(Ce,{children:u.jsx(mie,{})}),"Templates"]}),u.jsx(qr,{as:er,to:`/templates/${I?.slug}`,isCurrent:!0,children:I?.title&&I.title})]})}),u.jsx("div",{className:J("w-full lg:px-12 h-full overflow-y-scroll"),children:u.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[u.jsx(ywn,{isLoading:R,title:I?.title,description:I?.longDescription,imageURL:I?.imageURL,githubUrl:I?.githubUrl,infoData:te,templateSlug:e}),I&&u.jsxs(u.Fragment,{children:[(N||K)&&u.jsx(Ewn,{name:I.title,streamResult:K?G:U,runId:v,workflowInfo:z}),g&&u.jsx(_wn,{name:I.title,installedEntities:se,linkComponent:er}),h&&u.jsx(kwn,{errorMsg:h,validationErrors:T.length>0?T:U?.validationResults?.errors||G?.validationResults?.errors}),!N&&!K&&!g&&!h&&u.jsx(bwn,{providerOptions:ee,selectedProvider:n,onProviderChange:ue,variables:c,setVariables:d,errors:p,setErrors:f,handleInstallTemplate:W,handleVariableChange:ae,isLoadingEnvVars:M||H,isInstalling:V,defaultModelProvider:a,defaultModelId:o,onModelUpdate:xe})]})]})})]})}const LTn=()=>{const{baseUrl:e,headers:t}=pge();return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(Zme,{})}),"Settings"]})}),u.jsx(eo,{children:u.jsx("div",{className:"p-5",children:u.jsx("div",{className:"max-w-2xl p-5 w-full bg-surface3 border border-border1 rounded-lg",children:u.jsx(uxt,{initialConfig:{baseUrl:e,headers:t}})})})})]})};function FTn(){const{navigate:e,paths:t}=ur(),r=df(),{form:n,handlePublish:s,isSubmitting:a,canPublish:i}=w0t({mode:"create",onSuccess:o=>e(t.agentLink(o))});return u.jsxs(yn,{children:[u.jsxs(bn,{className:"bg-surface1",children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(Ji,{})}),"Create an agent"]}),u.jsx(Qa,{children:u.jsx(Se,{variant:"primary",onClick:s,disabled:a||!i,className:"w-full",children:a?u.jsxs(u.Fragment,{children:[u.jsx(vs,{className:"h-4 w-4"}),"Creating..."]}):u.jsxs(u.Fragment,{children:[u.jsx(Ce,{children:u.jsx(u6e,{})}),"Create agent"]})})})]}),u.jsx(S0t,{form:n,mode:"create",isSubmitting:a,handlePublish:s,basePath:"/cms/agents/create",currentPath:r.pathname,children:u.jsx(oD,{})})]})}function kFe({agentId:e,selectedVersionId:t,versionData:r,readOnly:n=!1,form:s,handlePublish:a,handleSaveDraft:i,isSubmitting:o,isSavingDraft:l,onVersionSelect:c,activeVersionId:d,latestVersionId:p}){const[,f]=Yd(),h=df(),b=!!t&&!!r&&t!==p?u.jsxs(uh,{variant:"info",className:"mb-4",children:[u.jsx(dh,{children:"This is a previous version"}),u.jsx(vx,{as:"p",children:"You are seeing a specific version of the agent."}),u.jsx("div",{className:"pt-2",children:u.jsx(Se,{type:"button",variant:"light",size:"sm",onClick:()=>f({}),children:"View latest version"})})]}):void 0,v=u.jsx(H1n,{agentId:e,selectedVersionId:t??void 0,onVersionSelect:c,activeVersionId:d});return u.jsx(S0t,{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:u.jsx(oD,{})})}function BTn(){const{agentId:e}=to(),{navigate:t,paths:r}=ur(),[n,s]=Yd(),a=n.get("versionId"),{data:i,isLoading:o}=xxn(e,{status:"draft"}),{data:l,isLoading:c}=wxn({agentId:e??"",versionId:a??""}),{data:d}=Lxt({agentId:e??"",params:{sortDirection:"DESC"}}),p=i?.activeVersionId,f=d?.versions?.[0],h=!!(f&&f.id!==p),m=!!a&&!!l,g=E.useMemo(()=>m&&l?l:i||{},[m,l,i]),{form:b,handlePublish:v,handleSaveDraft:w,isSubmitting:S,isSavingDraft:_}=w0t({mode:"edit",agentId:e??"",dataSource:g,onSuccess:A=>t(r.agentLink(A))}),O=E.useCallback(A=>{s(A?{versionId:A}:{})},[s]),C=!o&&(!i||!e),T=!o&&!!i&&!!e;return u.jsxs(yn,{children:[u.jsxs(bn,{className:"bg-surface1",children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(Ji,{})}),o&&u.jsx(Pr,{className:"h-6 w-[200px]"}),C&&"Agent not found",T&&`Edit agent: ${i.name}`,T&&h&&u.jsx(Gt,{variant:"info",children:"Unpublished changes"})]}),T&&u.jsxs(Qa,{children:[u.jsx(Se,{variant:"outline",onClick:w,disabled:_||S,children:_?u.jsxs(u.Fragment,{children:[u.jsx(vs,{className:"h-4 w-4"}),"Saving..."]}):u.jsxs(u.Fragment,{children:[u.jsx(Ce,{children:u.jsx(rCt,{})}),"Save"]})}),u.jsx(Se,{variant:"primary",onClick:v,disabled:S||_,children:S?u.jsxs(u.Fragment,{children:[u.jsx(vs,{className:"h-4 w-4"}),"Publishing..."]}):u.jsxs(u.Fragment,{children:[u.jsx(Ce,{children:u.jsx(u6e,{})}),"Publish"]})})]})]}),C?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Agent not found"}),u.jsx("div",{className:"hidden",children:u.jsx(kFe,{agentId:e??"",selectedVersionId:a,versionData:l,readOnly:!0,form:b,handlePublish:v,handleSaveDraft:w,isSubmitting:S,isSavingDraft:_,onVersionSelect:O,activeVersionId:p,latestVersionId:f?.id})})]}):u.jsx(kFe,{agentId:e??"",selectedVersionId:a,versionData:l,form:b,handlePublish:v,handleSaveDraft:w,isSubmitting:S,isSavingDraft:_,onVersionSelect:O,activeVersionId:p,latestVersionId:f?.id})]})}function zTn(){return u.jsx(l0n,{})}function UTn(){return u.jsx(O0n,{})}function VTn(){return u.jsx(C0n,{})}function qTn(){return u.jsx(T0n,{})}function HTn(){return u.jsx(D0n,{})}function ZTn(){return u.jsx(I0n,{})}function GTn(){return u.jsx(r1n,{})}function QTn(){return u.jsx(N1n,{})}function WTn(){return u.jsx(c0n,{})}function XTn(){const{navigate:e,paths:t}=ur();return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(wv,{})}),"Create a scorer"]})}),u.jsx(qvn,{onSuccess:r=>e(t.scorerLink(r.id))})]})}function OFe(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 YTn({scorer:e,scorerId:t,selectedVersionId:r}){const n=ht(),s=Ri(),{navigate:a,paths:i}=ur(),{updateStoredScorer:o}=Ext(t),[l,c]=E.useState(!1),[d,p]=E.useState(!1),f=E.useRef(null),{data:h}=Zvn({scorerId:t,versionId:r??""}),m=!!r&&!!h,g=m?h:e,b=E.useMemo(()=>({name:g.name||"",description:g.description||"",type:"llm-judge",model:{provider:g.model?.provider||"",name:g.model?.name||""},instructions:g.instructions||"",scoreRange:{min:g.scoreRange?.min??0,max:g.scoreRange?.max??1},defaultSampling:g.defaultSampling}),[g]),{form:v}=Sxt({initialValues:b});E.useEffect(()=>{b&&v.reset(b)},[b,v]);const w=E.useCallback(async()=>{if(!await v.trigger()){Je.error("Please fill in all required fields");return}p(!0);try{const O=OFe(v.getValues());await o.mutateAsync(O),Je.success("Draft saved")}catch(O){Je.error(`Failed to save draft: ${O instanceof Error?O.message:"Unknown error"}`)}finally{p(!1)}},[v,o]),S=E.useCallback(async()=>{if(!await v.trigger()){Je.error("Please fill in all required fields");return}c(!0);try{const O=OFe(v.getValues());await o.mutateAsync(O);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"]}),Je.success("Scorer published"),a(i.scorerLink(t))}catch(O){Je.error(`Failed to publish scorer: ${O instanceof Error?O.message:"Unknown error"}`)}finally{c(!1)}},[v,o,n,t,a,i,s]);return u.jsxs(_L,{leftSlot:u.jsx(xxt,{form:v,onPublish:S,onSaveDraft:w,isSubmitting:l,isSavingDraft:d,formRef:f,mode:"edit"}),children:[m&&u.jsxs(uh,{variant:"info",className:"m-4 mb-0",children:[u.jsx(dh,{children:"This is a previous version"}),u.jsx(vx,{as:"p",children:"You are seeing a specific version of the scorer."})]}),u.jsx("form",{ref:f,className:"h-full",children:u.jsx(wxt,{form:v})})]})}function KTn(){const{scorerId:e}=to(),[t,r]=Yd(),n=t.get("versionId"),{data:s,isLoading:a}=Vvn(e,{status:"draft"}),{data:i}=_xt({scorerId:e??"",params:{sortDirection:"DESC"}}),o=s?.activeVersionId,l=i?.versions?.[0],c=!!(l&&o&&l.id!==o),d=E.useCallback(p=>{r(p?{versionId:p}:{})},[r]);return a?u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(wv,{})}),u.jsx(Pr,{className:"h-6 w-[200px]"})]})}),u.jsx(_L,{leftSlot:u.jsx("div",{className:"flex items-center justify-center h-full",children:u.jsx(vs,{className:"h-8 w-8"})}),children:u.jsx("div",{className:"flex items-center justify-center h-full",children:u.jsx(vs,{className:"h-8 w-8"})})})]}):!s||!e?u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(wv,{})}),"Scorer not found"]})}),u.jsx(_L,{leftSlot:u.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Scorer not found"}),children:u.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Scorer not found"})})]}):u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(wv,{})}),"Edit scorer: ",s.name,c&&u.jsx(Gt,{variant:"info",children:"Unpublished changes"})]}),u.jsx(Qa,{children:u.jsx(Qvn,{scorerId:e,value:n??"",onValueChange:d,variant:"outline",activeVersionId:o})})]}),u.jsx(YTn,{scorer:s,scorerId:e,selectedVersionId:n})]})}function JTn(){const[e,t]=E.useState(!1),{navigate:r,paths:n}=ur(),{data:s,isLoading:a}=t7(),i=s?.datasets??[],o=l=>{t(!1),r(n.datasetLink(l))};return u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(Qa,{children:u.jsxs(Se,{variant:"light",onClick:()=>t(!0),children:[u.jsx(Ce,{children:u.jsx(gie,{})}),"Create Dataset"]})})]}),u.jsx(eo,{isCentered:!a&&i.length===0,children:u.jsx(dSn,{datasets:i,isLoading:a,onCreateClick:()=>t(!0)})}),u.jsx(ESn,{open:e,onOpenChange:t,onSuccess:o})]})}function eAn(){const{datasetId:e}=to(),t=eg(),[r,n]=E.useState(!1),[s,a]=E.useState(!1),[i,o]=E.useState(!1),[l,c]=E.useState(!1),[d,p]=E.useState(null),{data:f}=Hx(e??"");if(!e)return u.jsx(yn,{children:u.jsx(eo,{children:u.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});const h=b=>{t(`/datasets/${e}/experiments/${b}`)},m=()=>{t("/datasets")},g=b=>{p(b?.version??null)};return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:"span",to:"",isCurrent:!0,children:u.jsx(ASn,{value:e,variant:"ghost"})})]})}),u.jsxs(eo,{className:"content-stretch",children:[u.jsx(UEn,{datasetId:e,onAddItemClick:()=>a(!0),onEditClick:()=>o(!0),onDeleteClick:()=>c(!0),activeDatasetVersion:d,onVersionSelect:g,experimentTriggerSlot:u.jsxs(Se,{variant:"cta",size:"default",onClick:()=>n(!0),children:[u.jsx(JOt,{}),d!=null?`Run on v${d}`:"Run Experiment"]})}),u.jsx(QEn,{datasetId:e,version:d??void 0,open:r,onOpenChange:n,onSuccess:h}),u.jsx(qEn,{datasetId:e,open:s,onOpenChange:a}),f&&u.jsx(CSn,{open:i,onOpenChange:o,dataset:{id:f.id,name:f.name,description:f?.description||"",inputSchema:f.inputSchema,groundTruthSchema:f.groundTruthSchema}}),f&&u.jsx(TSn,{open:l,onOpenChange:c,datasetId:f.id,datasetName:f.name,onSuccess:m})]})]})}function tAn(){const{datasetId:e,itemId:t}=to(),{Link:r}=ur(),n=eg(),{data:s,isLoading:a}=wge(e??"",t??""),{updateItem:i,deleteItem:o}=Wu(),{data:l}=Hx(e??""),c=s?.[0]??null,d=c?.isDeleted??!1,[p,f]=E.useState(null),h=E.useMemo(()=>!c||d?{input:"",groundTruth:"",metadata:""}:{input:JSON.stringify(c.input,null,2),groundTruth:c.groundTruth?JSON.stringify(c.groundTruth,null,2):"",metadata:c.metadata?JSON.stringify(c.metadata,null,2):""},[c,d]),m=c?.datasetVersion??0,[g,b]=E.useState(!1),[v,w]=E.useState(h.input),[S,_]=E.useState(h.groundTruth),[O,C]=E.useState(h.metadata),[T,A]=E.useState(m);m!==T&&(A(m),w(h.input),_(h.groundTruth),C(h.metadata));const[I,R]=E.useState(!1),P=X=>{f(d?X:X.isLatest?null:X)},L=()=>{f(null)},B=!d&&p!=null,M=()=>{B||b(!0)},z=()=>{B||R(!0)},H=async()=>{if(!e||!t)return;let X;try{X=JSON.parse(v)}catch{Je.error("Input must be valid JSON");return}let U;if(S.trim())try{U=JSON.parse(S)}catch{Je.error("Ground Truth must be valid JSON");return}let N;if(O.trim())try{N=JSON.parse(O)}catch{Je.error("Metadata must be valid JSON");return}try{await i.mutateAsync({datasetId:e,itemId:t,input:X,groundTruth:U,metadata:N}),Je.success("Item updated successfully"),b(!1)}catch(Z){Je.error(`Failed to update item: ${Z instanceof Error?Z.message:"Unknown error"}`)}},q=()=>{c&&(w(JSON.stringify(c.input,null,2)),_(c.groundTruth?JSON.stringify(c.groundTruth,null,2):""),C(c.metadata?JSON.stringify(c.metadata,null,2):"")),b(!1)},V=async()=>{if(!(!e||!t))try{await o.mutateAsync({datasetId:e,itemId:t}),Je.success("Item deleted successfully"),R(!1),n(`/datasets/${e}`)}catch(X){Je.error(`Failed to delete item: ${X instanceof Error?X.message:"Unknown error"}`)}},Q=p??c,$=Q?{id:t??"",datasetId:e??"",datasetVersion:Q.datasetVersion,input:Q.input,groundTruth:Q.groundTruth,metadata:Q.metadata,createdAt:Q.createdAt,updatedAt:Q.updatedAt}:null;return a?null:!e||!t||!s||s.length===0?u.jsx(yn,{children:u.jsx(eo,{children:u.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):u.jsxs(u.Fragment,{children:[u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:l?.name}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Item"})]})}),u.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:u.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[u.jsxs(gn,{children:[u.jsxs(gn.Column,{children:[u.jsxs(gn.Title,{children:[u.jsx($Ot,{}),t," ",u.jsx(oc,{content:t})]}),u.jsx(gn.Description,{children:u.jsxs(Qs,{children:["Item of ",u.jsx(Du,{})," ",l?.name]})}),u.jsxs(gn.Description,{children:[u.jsxs(Qs,{children:[u.jsx(xOt,{})," Created at"," ",c?.createdAt?kn(new Date(c.createdAt),"MMM d, yyyy"):""]}),u.jsxs(Qs,{children:[u.jsx(XL,{})," Latest version v",c?.datasetVersion??""]})]})]}),u.jsx(gn.Column,{children:!g&&!d&&u.jsxs(hl,{children:[u.jsxs(Se,{variant:"cta",size:"default",onClick:M,disabled:B,title:B?"Return to latest version to edit":void 0,children:[u.jsx(WOt,{})," Edit"]}),u.jsxs(Se,{variant:"cta",size:"default",onClick:z,disabled:B,title:B?"Return to latest version to delete":void 0,children:[u.jsx(uCt,{})," Delete"]})]})})]}),u.jsxs(RO,{className:g?"grid-cols-1":"grid-cols-[1fr_auto]",children:[u.jsxs(ki,{withRightSeparator:!g,children:[d&&c&&u.jsxs(rc,{variant:"destructive",children:[u.jsx(Dee,{}),u.jsxs(rc.Message,{children:["This item was deleted at version v",c.datasetVersion]})]}),!d&&B&&p&&u.jsx(u.Fragment,{children:u.jsxs(rc,{variant:"warning",children:[u.jsx(Dee,{}),u.jsxs(rc.Message,{children:["Viewing version v",p.datasetVersion]}),u.jsxs(rc.Button,{onClick:L,children:[u.jsx(fOt,{})," Return to the latest version"]})]})}),g?u.jsx(V0t,{inputValue:v,setInputValue:w,groundTruthValue:S,setGroundTruthValue:_,metadataValue:O,setMetadataValue:C,validationErrors:null,onSave:H,onCancel:q,isSaving:i.isPending}):$?u.jsx(r7,{item:$,Link:r}):u.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!g&&u.jsx(ki,{children:u.jsx(E_n,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:P,onCompareVersionsClick:X=>{n(`/datasets/${e}/items/${t}/versions?ids=${X.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})]}),u.jsx(Vt,{open:I,onOpenChange:R,children:u.jsxs(Vt.Content,{children:[u.jsxs(Vt.Header,{children:[u.jsx(Vt.Title,{children:"Delete Item"}),u.jsx(Vt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),u.jsxs(Vt.Footer,{children:[u.jsx(Vt.Cancel,{children:"Cancel"}),u.jsx(Vt.Action,{onClick:V,children:o.isPending?"Deleting...":"Delete"})]})]})})]})}function rAn(){const{datasetId:e,experimentId:t}=to(),{data:r}=Hx(e??""),{data:n,isLoading:s,error:a}=Nae(e,t),{data:i,isLoading:o}=Wwn({datasetId:e,experimentId:t,experimentStatus:n?.status});if(s)return u.jsx(yn,{children:u.jsx("div",{className:"flex items-center justify-center h-full",children:u.jsx(vs,{})})});if(a||!n)return u.jsx(yn,{children:u.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})});const l=i?.results??[];return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:r?.name}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),u.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:u.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[u.jsx(v_n,{experimentId:t,experiment:n}),u.jsx(g_n,{results:l,isLoading:o})]})})]})}function nAn(){const{datasetId:e}=to(),[t]=Yd(),r=t.get("experimentA")??"",n=t.get("experimentB")??"";return!e||!r||!n?u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsxs(qr,{isCurrent:!0,children:[u.jsx(Ce,{children:u.jsx(cA,{})}),"Compare Experiments"]})]})}),u.jsx(eo,{children:u.jsxs("div",{className:"text-neutral4 text-center py-8",children:[u.jsx("p",{children:"Select two experiments to compare."}),u.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/compare?experimentA=","{experimentIdA}","&experimentB=","{experimentIdB}"]})]})})]}):u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:e?.slice(0,8)}),u.jsxs(qr,{isCurrent:!0,children:[u.jsx(Ce,{children:u.jsx(cA,{})}),"Compare Experiments"]})]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:`/datasets/${e}`,variant:"outline",children:[u.jsx(Ce,{children:u.jsx(lD,{})}),"Back to Dataset"]})})]}),u.jsx(eo,{children:u.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start gap-8",children:[u.jsx(p_,{title:"Compare Experiments",description:`Comparing ${r.slice(0,8)} vs ${n.slice(0,8)}`,icon:u.jsx(cA,{})}),u.jsx(x_n,{datasetId:e,experimentIdA:r,experimentIdB:n})]})})]})}function CFe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function sAn(){const{datasetId:e}=to(),[t,r]=Yd(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s}=Hx(e??""),{Link:a}=ur(),[i,o]=E.useState(!1),{data:l}=Dae(e??"",n[0]??""),{data:c}=Dae(e??"",n[1]??"");return!e||n.length<2?u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),u.jsx(eo,{children:u.jsx("div",{className:"text-neutral4 text-center py-8",children:u.jsx("p",{children:"Select at least two items to compare."})})})]}):u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:`/datasets/${e}`,variant:"outline",children:[u.jsx(Ce,{children:u.jsx(lD,{})}),"Back to Dataset"]})})]}),u.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:u.jsxs("div",{className:J("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":i}),children:[u.jsxs(gn,{children:[u.jsxs(gn.Column,{children:[u.jsxs(gn.Title,{children:[u.jsx(cA,{}),"Compare Dataset Items"]}),u.jsx(gn.Description,{children:u.jsxs(Qs,{children:["Comparing ",n.length," items of"," ",u.jsx(er,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),u.jsx(gn.Column,{children:u.jsxs(hl,{children:[u.jsxs(Se,{as:er,to:`/datasets/${e}`,variant:"standard",size:"default",children:[u.jsx(lD,{}),"Back to Dataset"]}),u.jsx(Se,{variant:"cta",size:"default",onClick:()=>o(d=>!d),children:i?u.jsxs(u.Fragment,{children:[u.jsx(d6e,{})," Default View"]}):u.jsxs(u.Fragment,{children:[u.jsx(IOt,{})," Diff View"]})})]})})]}),u.jsx(RO,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((d,p)=>u.jsxs(E.Fragment,{children:[u.jsx(aAn,{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&&u.jsx("div",{className:J("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},d))}),i&&l&&c&&u.jsx(r1t,{codeA:CFe(l),codeB:CFe(c)})]})})]})}function aAn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:o,isLoading:l}=Dae(e,t),{data:c}=AL(e),d=new Set(s.filter((f,h)=>h!==n)),p=(c??[]).map(f=>({value:f.id,label:f.id,disabled:d.has(f.id)}));return u.jsxs(ki,{children:[u.jsxs(ki.Toolbar,{className:"flex gap-4",children:[u.jsx(Fl,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:p,placeholder:"Select item",variant:"experimental",size:"default",labelIsHidden:!0}),u.jsxs(Se,{as:r,to:`/datasets/${e}/items/${t}`,variant:"standard",size:"default",children:[u.jsx(XL,{}),"Versions"]})]}),i&&u.jsx(ki.Content,{children:l?u.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):o?u.jsxs(u.Fragment,{children:[u.jsx(U0t,{item:o}),u.jsx(r7,{item:o,Link:r})]}):u.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function TFe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function iAn(){const{datasetId:e,itemId:t}=to(),[r,n]=Yd(),[s,a]=E.useState(!1),i=r.get("ids")?.split(",").map(Number).filter(f=>!isNaN(f)&&f>0)??[],{data:o}=Hx(e??""),{Link:l}=ur(),{data:c}=wge(e??"",t??""),{data:d}=Iae(e??"",t??"",i[0]??0,o?.version),{data:p}=Iae(e??"",t??"",i[1]??0,o?.version);return!e||!t||i.length<2?u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),u.jsx(eo,{children:u.jsx("div",{className:"text-neutral4 text-center py-8",children:u.jsx("p",{children:"Select at least two versions to compare."})})})]}):u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:o?.name}),u.jsx(qr,{as:er,to:`/datasets/${e}/items/${t}`,children:"Item"}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[u.jsx(Ce,{children:u.jsx(lD,{})}),"Back to Item"]})})]}),u.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:u.jsxs("div",{className:J("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[u.jsxs(gn,{children:[u.jsxs(gn.Column,{children:[u.jsxs(gn.Title,{children:[u.jsx(cA,{}),"Compare Dataset Item Versions"]}),u.jsx(gn.Description,{children:u.jsxs(Qs,{children:["Comparing ",i.length," versions of"," ",u.jsx(er,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),u.jsx(gn.Column,{children:u.jsxs(hl,{children:[u.jsxs(Se,{as:er,to:`/datasets/${e}/items/${t}`,variant:"standard",size:"default",children:[u.jsx(lD,{}),"Back to Item"]}),u.jsx(Se,{variant:"cta",size:"default",onClick:()=>a(f=>!f),children:s?u.jsxs(u.Fragment,{children:[u.jsx(d6e,{})," Default View"]}):u.jsxs(u.Fragment,{children:[u.jsx(zOt,{})," Diff View"]})})]})})]}),u.jsx(RO,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((f,h)=>u.jsxs(E.Fragment,{children:[u.jsx(oAn,{datasetId:e,itemId:t,datasetVersion:f,latestVersion:o?.version,allVersions:c??[],versionNumbers:i,Link:l,idx:h,showContent:!s,onVersionChange:m=>{const g=[...i];g[h]=m,n({ids:g.join(",")})}}),h===0&&u.jsx("div",{className:J("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),s&&d&&p&&u.jsx(r1t,{codeA:TFe(d),codeB:TFe(p)})]})})]})}function oAn({datasetId:e,itemId:t,datasetVersion:r,latestVersion:n,allVersions:s,versionNumbers:a,Link:i,idx:o,showContent:l=!0,onVersionChange:c}){const{data:d,isLoading:p}=Iae(e,t,r,n),f=new Set(a.filter((g,b)=>b!==o)),h=s.map(g=>{const b=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:`v${g.datasetVersion} — ${kn(b,"MMM d, yyyy h:mm a")}${g.isLatest?" (latest)":""}`,disabled:f.has(g.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 u.jsxs(ki,{children:[u.jsxs(ki.Toolbar,{className:"flex gap-4",children:[u.jsx(XL,{className:"w-6 h-6 opacity-50"}),u.jsx(Fl,{label:"Version",name:`compare-version-${o}`,value:String(r),onValueChange:g=>c(Number(g)),options:h,placeholder:"Select version",variant:"experimental",size:"default",labelIsHidden:!0,className:"w-full"})]}),l&&u.jsx(ki.Content,{children:p?u.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?u.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",r," not found"]}):u.jsx(u.Fragment,{children:u.jsx(r7,{item:m,Link:i})})})]})}function lAn(){const{datasetId:e}=to(),[t]=Yd(),r=t.get("ids")?.split(",").map(Number).filter(m=>!isNaN(m)&&m>0)??[],n=eg(),{data:s}=Hx(e??""),a=AL(e??"",void 0,r[0]??null),i=AL(e??"",void 0,r[1]??null),o=E.useMemo(()=>a.data??[],[a.data]),l=E.useMemo(()=>i.data??[],[i.data]),c=E.useMemo(()=>{const m=new Map;for(const g of[...o,...l])m.has(g.id)||m.set(g.id,{id:g.id,createdAt:new Date(g.createdAt)});return[...m.values()].sort((g,b)=>b.createdAt.getTime()-g.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 u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),u.jsx(eo,{children:u.jsx("div",{className:"text-neutral4 text-center py-8",children:u.jsx("p",{children:"Select at least two versions to compare."})})})]});const f=(m,g,b)=>{n(`/datasets/${e}/items/${m}/versions?ids=${g?.datasetVersion??""},${b?.datasetVersion??""}`)},h=(m,g)=>{n(`/datasets/${e}/versions?ids=${m},${g}`,{replace:!0})};return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),u.jsxs(qr,{isCurrent:!0,as:"span",children:[u.jsx(Ce,{children:u.jsx(t0e,{})}),"Compare Versions"]})]})}),u.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:u.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[u.jsx(gn,{children:u.jsxs(gn.Column,{children:[u.jsxs(gn.Title,{children:[u.jsx(t0e,{})," Compare Dataset Versions"]}),u.jsx(gn.Description,{children:u.jsxs(Qs,{children:[u.jsx(XL,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]})}),u.jsx(RO,{children:u.jsxs(ki,{children:[u.jsx(O_n,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:h}),u.jsx(T_n,{allItems:c,itemsAMap:d,itemsBMap:p,onItemClick:f})]})})]})})]})}const cAn={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/${Ao()}`,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`,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}`},uAn=()=>{const e=eg(),t=r=>e(r,{viewTransition:!0});return u.jsx(hmn,{Link:hTn,navigate:t,paths:cAn,children:u.jsx(Rkn,{children:u.jsx(oD,{})})})},dAn=!!window.MASTRA_CLOUD_API_ENDPOINT,pAn=NFe.has("datasets"),AFe=[{index:!0,element:u.jsx(zTn,{})},{path:"instruction-blocks",element:u.jsx(WTn,{})},{path:"tools",element:u.jsx(UTn,{})},{path:"agents",element:u.jsx(VTn,{})},{path:"scorers",element:u.jsx(qTn,{})},{path:"workflows",element:u.jsx(HTn,{})},{path:"skills",element:u.jsx(QTn,{})},{path:"memory",element:u.jsx(ZTn,{})},{path:"variables",element:u.jsx(GTn,{})}],fAn=[{element:u.jsx(uAn,{}),children:[...dAn?[]:[{path:"/settings",element:u.jsx(LTn,{})},{path:"/templates",element:u.jsx(jTn,{})},{path:"/templates/:templateSlug",element:u.jsx(MTn,{})}],{path:"/scorers",element:u.jsx(mTn,{})},{path:"/scorers/:scorerId",element:u.jsx(gTn,{})},{path:"/observability",element:u.jsx(wTn,{})},{path:"/agents",element:u.jsx(Fkn,{})},{path:"/cms/agents/create",element:u.jsx(FTn,{}),children:AFe},{path:"/cms/agents/:agentId/edit",element:u.jsx(BTn,{}),children:AFe},{path:"/cms/scorers/create",element:u.jsx(XTn,{})},{path:"/cms/scorers/:scorerId/edit",element:u.jsx(KTn,{})},{path:"/agents/:agentId/tools/:toolId",element:u.jsx(zkn,{})},{path:"/agents/:agentId",element:u.jsx(jkn,{children:u.jsx(oD,{})}),children:[{index:!0,loader:({params:e})=>yz(`/agents/${e.agentId}/chat`)},{path:"chat",element:u.jsx(SLe,{})},{path:"chat/:threadId",element:u.jsx(SLe,{})}]},{path:"/tools",element:u.jsx($kn,{})},{path:"/tools/:toolId",element:u.jsx(Ukn,{})},{path:"/processors",element:u.jsx(Mkn,{})},{path:"/processors/:processorId",element:u.jsx(Lkn,{})},{path:"/mcps",element:u.jsx(uTn,{})},{path:"/mcps/:serverId",element:u.jsx(pTn,{})},{path:"/mcps/:serverId/tools/:toolId",element:u.jsx(dTn,{})},{path:"/workspaces",element:u.jsx(EFe,{})},{path:"/workspaces/:workspaceId",element:u.jsx(EFe,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:u.jsx(STn,{})},{path:"/workflows",element:u.jsx(Vkn,{})},{path:"/workflows/:workflowId",element:u.jsx(Hkn,{children:u.jsx(oD,{})}),children:[{index:!0,loader:({params:e})=>yz(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:u.jsx(ELe,{})},{path:"graph/:runId",element:u.jsx(ELe,{})}]},...pAn?[{path:"/datasets",element:u.jsx(JTn,{})},{path:"/datasets/:datasetId",element:u.jsx(eAn,{})},{path:"/datasets/:datasetId/items/:itemId",element:u.jsx(tAn,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:u.jsx(iAn,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:u.jsx(rAn,{})},{path:"/datasets/:datasetId/compare",element:u.jsx(nAn,{})},{path:"/datasets/:datasetId/items",element:u.jsx(sAn,{})},{path:"/datasets/:datasetId/versions",element:u.jsx(lAn,{})}]:[],{index:!0,loader:()=>yz("/agents")},{path:"/request-context",element:u.jsx(cTn,{})}]}];function hAn(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:r,apiPrefix:n,isLoading:s}=pge();if(s)return null;if(!t)return u.jsx(avn,{});const a=Qkt(fAn,{basename:e});return u.jsx(tgr,{baseUrl:t,headers:r,apiPrefix:n,children:u.jsx(lTn,{children:u.jsx(vkt,{router:a})})})}function mAn(){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",a=window.MASTRA_CLOUD_API_ENDPOINT||""||`${e}://${t}:${r}`;return u.jsx(U_n,{children:u.jsx(Xbn,{endpoint:a,defaultApiPrefix:n,children:u.jsx(hAn,{})})})}REt.createRoot(document.getElementById("root")).render(u.jsx(E.StrictMode,{children:u.jsx(mAn,{})}));const JIn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{Ke as A,fYe as B,eQe as C,KGe as D,rp as E,qXe as F,UWe as G,Up as H,na as I,E8 as J,GIn as K,k1 as L,gJr as M,YGe as N,JIn as O,d9 as _,dFt as a,CFt as b,EAn as c,lwe as d,xDn as e,EFt as f,w1 as g,OFt as h,C1 as i,vw as j,xw as k,bw as l,QE as m,itr as n,WWe as o,Ca as p,xer as q,ygr as r,oce as s,re as t,wer as u,lue as v,gFt as w,o4 as x,au as y,gt as z};
|
|
651
|
+
`).reduce((o,l)=>{if(!l||l.startsWith("#"))return o;const[c,d]=l.split("=");return c&&(o[c]=d?.split("")?.every(p=>p==="*")?"":d?.replaceAll('"',"")),o},{}):{}}const OTn=()=>Cr({queryKey:["mastra-templates"],queryFn:wwt}),CTn=({repoOrSlug:e,owner:t})=>Cr({queryKey:["template-repo",e,t],queryFn:()=>_Tn({repoOrSlug:e,owner:t})}),TTn=({repo:e,owner:t,branch:r})=>Cr({queryKey:["template-repo-env-vars",e,t,r],queryFn:()=>kTn({repo:e,owner:t,branch:r})}),ATn=()=>{const e=ht();return Cr({queryKey:["agent-builder-workflow"],queryFn:async()=>await e.getAgentBuilderAction("merge-template").details()})},DTn=()=>{const e=ht();return _n({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").createRun({runId:t})})},ITn=()=>{const e=ht();return _n({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").runById(t)})},_Fe=(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}},NTn=(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)}},Swt=(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 c=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 c.read();if(p)break;const{newState:h}=_Fe(f,d,e);if(d=h,n(h),f.runId||l||t){const m=f.runId||l||t;NTn(m,h)}}}catch(p){console.error("💥 [processStream] Error processing template installation stream:",p);const{newState:f}=_Fe({type:"error",payload:{error:p instanceof Error?p.message:"Unknown error"}},d,e);n(f)}finally{a(!1),c.releaseLock()}}}},RTn=e=>{const t=ht(),{streamResult:r,isStreaming:n,processStream:s}=Swt(e);return{streamInstall:_n({mutationFn:async({inputData:i,selectedModel:o,runId:l})=>{for(let d=1;d<=3;d++)try{const p=t.getAgentBuilderAction("merge-template"),f=new my;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}},PTn=e=>{const t=ht(),{streamResult:r,isStreaming:n,processStream:s}=Swt(e);return{observeInstall:_n({mutationFn:async({runId:i})=>{for(let c=1;c<=3;c++)try{const p=await t.getAgentBuilderAction("merge-template").observeStream({runId:i});await s(p,i);return}catch(d){console.error(`💥 [observeInstall] Attempt ${c} 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 ${c}/3 failed:`,d),p&&c<3){console.log(`🔄 ObserveStream network error detected (likely hot reload), retrying in 2000ms... (attempt ${c+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 jTn(){const{data:e,isLoading:t}=OTn(),{templates:r,tags:n,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=E.useState("all"),[o,l]=E.useState("all"),[c,d]=E.useState(""),p=[{value:"all",label:"All"}];(n||[]).forEach(w=>{p.push({value:w,label:w})});const f=[{value:"all",label:"All"}];(s||[]).forEach(w=>{f.push({value:w,label:w})});const h=(w,S)=>{S==="tag"?i(w):S==="provider"&&l(w)},m=w=>{d(w)},g=()=>{i("all"),l("all"),d("")},b=r.filter(w=>!(c&&!w.title.toLowerCase().includes(c)&&!w.description.toLowerCase().includes(c)||a!=="all"&&!w.tags.includes(a)||o!=="all"&&!w.supportedProviders.includes(o))),v=c||a!=="all"||o!=="all";return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(mie,{})}),"Templates"]})}),u.jsxs("div",{className:J("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[u.jsx(hwn,{selectedTag:a,onTagChange:w=>h(w,"tag"),tagOptions:p,selectedProvider:o,onProviderChange:w=>h(w,"provider"),providerOptions:f,searchTerm:c,onSearchChange:m,onReset:v?g:void 0,className:"max-w-[80rem]",isLoading:t}),u.jsx(gwn,{templates:b,linkComponent:er,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const $Tn="1.6.0";function MTn(){const{templateSlug:e}=to(),[t,r]=Yd(),[n,s]=E.useState(""),[a,i]=E.useState(""),[o,l]=E.useState(""),[c,d]=E.useState({}),[p,f]=E.useState([]),[h,m]=E.useState(null),[g,b]=E.useState(!1),[v,w]=E.useState(""),[S,_]=E.useState(!1),[O,C]=E.useState(!1),[T,A]=E.useState([]),{data:I,isLoading:R}=CTn({repoOrSlug:e,owner:"mastra-ai"}),L=$Tn?.includes("beta")??!1?"beta":"main",{data:B,isLoading:M}=TTn({repo:I?.githubUrl?new URL(I.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:L}),{data:z,isLoading:H}=ATn(),{mutateAsync:q,isPending:V}=DTn(),{mutateAsync:Q,isPending:$}=ITn(),{streamInstall:X,streamResult:U,isStreaming:N}=RTn(z),{observeInstall:Z,streamResult:G,isStreaming:K}=PTn(z);E.useEffect(()=>{const ne=t.get("runId");ne&&!g&&!h&&!N&&!K&&(console.log("🔄 Checking completed run after hot reload:",{runId:ne}),w(ne),Q({runId:ne}).then(ye=>{const le=ye.snapshot;if(le?.status==="success"&&le?.result?.success)b(!0);else if(le?.result?.success===!1)if(le?.result?.validationResults&&!le?.result?.validationResults?.valid&&le?.result?.validationResults?.remainingErrors>0){const{remainingErrors:Ne,errors:ke}=le.result.validationResults,oe=`Template installation completed but ${Ne} validation issue${Ne>1?"s":""} remain unresolved.`;m(oe),A(ke||[])}else m(le?.result?.message||le?.result?.error||"Template installation failed")}).catch(ye=>{console.error("❌ Failed to fetch run details:",ye),m("Failed to retrieve installation status after reload")}))},[t,g,h,N,K,Q]),E.useEffect(()=>{const ne=t.get("runId"),ye=t.get("resume"),le=t.get("provider");if(ne&&ye==="true"&&le&&!N&&!K&&!S&&!O&&z){w(ne),_(!0);try{Q({runId:ne}).then(be=>{if(be.snapshot?.status==="running")return Z.mutateAsync({runId:ne})}).then(()=>{r(be=>{const Ne=new URLSearchParams(be);return Ne.delete("resume"),Ne})}).catch(be=>{console.error("❌ Failed to resume template installation:",be),be.message?.includes("404")||be.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(be){console.error("❌ Auto-resume failed with error:",be),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,N,K,S,O,z,Q,Z,r]);const ee=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],te=[{key:"tools",label:"Tools",value:I?.tools?.length?I.tools.map(ne=>ne).join(", "):"n/a",icon:u.jsx(vl,{})},{key:"agents",label:"Agents",value:I?.agents?.length?I.agents.map(ne=>ne).join(", "):"n/a",icon:u.jsx(Ji,{})},{key:"workflows",label:"Workflows",value:I?.workflows?.length?I.workflows.map(ne=>ne).join(", "):"n/a",icon:u.jsx(hCt,{})},{key:"providers",label:"Providers",value:I?.supportedProviders?.length?I.supportedProviders.join(", "):"n/a",icon:u.jsx(bOt,{})},{key:"tags",label:"Tags",value:I?.tags?.length?I.tags.join(", "):"n/a",icon:u.jsx(lCt,{})}],se=[{...te[0]},{...te[1]},{...te[2]}].filter(ne=>ne.value!=="n/a");E.useEffect(()=>{B&&d(B)},[B]),E.useEffect(()=>{const ne=U||G;ne?.phase==="error"&&ne?.error&&m(ne.error)},[U?.phase,U?.error,G?.phase,G?.error]);const ue=ne=>{s(ne)},xe=async ne=>(i(ne.provider),l(ne.modelId),{message:"Model updated successfully"}),W=async()=>{const ne=Object.entries(c).reduce((ye,[le,be])=>(be===""&&ye.push(le),ye),[]);if(ne.length>0){f(ne);return}if(I){m(null),b(!1),w(""),C(!0);try{const le={repo:I.githubUrl||`https://github.com/mastra-ai/template-${I.slug}`,ref:L,slug:I.slug,variables:c},{runId:be}=await q({});w(be),r(Ne=>{const ke=new URLSearchParams(Ne);return ke.set("runId",be),ke.set("resume","true"),ke.set("provider",n||"openai"),ke}),await X.mutateAsync({inputData:le,selectedModel:{provider:a,modelId:o},runId:be})}catch(ye){C(!1),m(ye?.message||"Template installation failed"),console.error("Template installation failed",ye)}}},ae=ne=>{const{name:ye,value:le}=ne.target;le.trim()===""?f(be=>[...be,ye]):f(be=>be.filter(Ne=>Ne!==ye)),d(be=>({...be,[ye]:le}))};return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/templates",children:[u.jsx(Ce,{children:u.jsx(mie,{})}),"Templates"]}),u.jsx(qr,{as:er,to:`/templates/${I?.slug}`,isCurrent:!0,children:I?.title&&I.title})]})}),u.jsx("div",{className:J("w-full lg:px-12 h-full overflow-y-scroll"),children:u.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[u.jsx(ywn,{isLoading:R,title:I?.title,description:I?.longDescription,imageURL:I?.imageURL,githubUrl:I?.githubUrl,infoData:te,templateSlug:e}),I&&u.jsxs(u.Fragment,{children:[(N||K)&&u.jsx(Ewn,{name:I.title,streamResult:K?G:U,runId:v,workflowInfo:z}),g&&u.jsx(_wn,{name:I.title,installedEntities:se,linkComponent:er}),h&&u.jsx(kwn,{errorMsg:h,validationErrors:T.length>0?T:U?.validationResults?.errors||G?.validationResults?.errors}),!N&&!K&&!g&&!h&&u.jsx(bwn,{providerOptions:ee,selectedProvider:n,onProviderChange:ue,variables:c,setVariables:d,errors:p,setErrors:f,handleInstallTemplate:W,handleVariableChange:ae,isLoadingEnvVars:M||H,isInstalling:V,defaultModelProvider:a,defaultModelId:o,onModelUpdate:xe})]})]})})]})}const LTn=()=>{const{baseUrl:e,headers:t}=pge();return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(Zme,{})}),"Settings"]})}),u.jsx(eo,{children:u.jsx("div",{className:"p-5",children:u.jsx("div",{className:"max-w-2xl p-5 w-full bg-surface3 border border-border1 rounded-lg",children:u.jsx(uxt,{initialConfig:{baseUrl:e,headers:t}})})})})]})};function FTn(){const{navigate:e,paths:t}=ur(),r=df(),{form:n,handlePublish:s,isSubmitting:a,canPublish:i}=w0t({mode:"create",onSuccess:o=>e(t.agentLink(o))});return u.jsxs(yn,{children:[u.jsxs(bn,{className:"bg-surface1",children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(Ji,{})}),"Create an agent"]}),u.jsx(Qa,{children:u.jsx(Se,{variant:"primary",onClick:s,disabled:a||!i,className:"w-full",children:a?u.jsxs(u.Fragment,{children:[u.jsx(vs,{className:"h-4 w-4"}),"Creating..."]}):u.jsxs(u.Fragment,{children:[u.jsx(Ce,{children:u.jsx(u6e,{})}),"Create agent"]})})})]}),u.jsx(S0t,{form:n,mode:"create",isSubmitting:a,handlePublish:s,basePath:"/cms/agents/create",currentPath:r.pathname,children:u.jsx(oD,{})})]})}function kFe({agentId:e,selectedVersionId:t,versionData:r,readOnly:n=!1,form:s,handlePublish:a,handleSaveDraft:i,isSubmitting:o,isSavingDraft:l,onVersionSelect:c,activeVersionId:d,latestVersionId:p}){const[,f]=Yd(),h=df(),b=!!t&&!!r&&t!==p?u.jsxs(uh,{variant:"info",className:"mb-4",children:[u.jsx(dh,{children:"This is a previous version"}),u.jsx(vx,{as:"p",children:"You are seeing a specific version of the agent."}),u.jsx("div",{className:"pt-2",children:u.jsx(Se,{type:"button",variant:"light",size:"sm",onClick:()=>f({}),children:"View latest version"})})]}):void 0,v=u.jsx(H1n,{agentId:e,selectedVersionId:t??void 0,onVersionSelect:c,activeVersionId:d});return u.jsx(S0t,{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:u.jsx(oD,{})})}function BTn(){const{agentId:e}=to(),{navigate:t,paths:r}=ur(),[n,s]=Yd(),a=n.get("versionId"),{data:i,isLoading:o}=xxn(e,{status:"draft"}),{data:l,isLoading:c}=wxn({agentId:e??"",versionId:a??""}),{data:d}=Lxt({agentId:e??"",params:{sortDirection:"DESC"}}),p=i?.activeVersionId,f=d?.versions?.[0],h=!!(f&&f.id!==p),m=!!a&&!!l,g=E.useMemo(()=>m&&l?l:i||{},[m,l,i]),{form:b,handlePublish:v,handleSaveDraft:w,isSubmitting:S,isSavingDraft:_}=w0t({mode:"edit",agentId:e??"",dataSource:g,onSuccess:A=>t(r.agentLink(A))}),O=E.useCallback(A=>{s(A?{versionId:A}:{})},[s]),C=!o&&(!i||!e),T=!o&&!!i&&!!e;return u.jsxs(yn,{children:[u.jsxs(bn,{className:"bg-surface1",children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(Ji,{})}),o&&u.jsx(Pr,{className:"h-6 w-[200px]"}),C&&"Agent not found",T&&`Edit agent: ${i.name}`,T&&h&&u.jsx(Gt,{variant:"info",children:"Unpublished changes"})]}),T&&u.jsxs(Qa,{children:[u.jsx(Se,{variant:"outline",onClick:w,disabled:_||S,children:_?u.jsxs(u.Fragment,{children:[u.jsx(vs,{className:"h-4 w-4"}),"Saving..."]}):u.jsxs(u.Fragment,{children:[u.jsx(Ce,{children:u.jsx(rCt,{})}),"Save"]})}),u.jsx(Se,{variant:"primary",onClick:v,disabled:S||_,children:S?u.jsxs(u.Fragment,{children:[u.jsx(vs,{className:"h-4 w-4"}),"Publishing..."]}):u.jsxs(u.Fragment,{children:[u.jsx(Ce,{children:u.jsx(u6e,{})}),"Publish"]})})]})]}),C?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Agent not found"}),u.jsx("div",{className:"hidden",children:u.jsx(kFe,{agentId:e??"",selectedVersionId:a,versionData:l,readOnly:!0,form:b,handlePublish:v,handleSaveDraft:w,isSubmitting:S,isSavingDraft:_,onVersionSelect:O,activeVersionId:p,latestVersionId:f?.id})})]}):u.jsx(kFe,{agentId:e??"",selectedVersionId:a,versionData:l,form:b,handlePublish:v,handleSaveDraft:w,isSubmitting:S,isSavingDraft:_,onVersionSelect:O,activeVersionId:p,latestVersionId:f?.id})]})}function zTn(){return u.jsx(l0n,{})}function UTn(){return u.jsx(O0n,{})}function VTn(){return u.jsx(C0n,{})}function qTn(){return u.jsx(T0n,{})}function HTn(){return u.jsx(D0n,{})}function ZTn(){return u.jsx(I0n,{})}function GTn(){return u.jsx(r1n,{})}function QTn(){return u.jsx(N1n,{})}function WTn(){return u.jsx(c0n,{})}function XTn(){const{navigate:e,paths:t}=ur();return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(wv,{})}),"Create a scorer"]})}),u.jsx(qvn,{onSuccess:r=>e(t.scorerLink(r.id))})]})}function OFe(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 YTn({scorer:e,scorerId:t,selectedVersionId:r}){const n=ht(),s=Ri(),{navigate:a,paths:i}=ur(),{updateStoredScorer:o}=Ext(t),[l,c]=E.useState(!1),[d,p]=E.useState(!1),f=E.useRef(null),{data:h}=Zvn({scorerId:t,versionId:r??""}),m=!!r&&!!h,g=m?h:e,b=E.useMemo(()=>({name:g.name||"",description:g.description||"",type:"llm-judge",model:{provider:g.model?.provider||"",name:g.model?.name||""},instructions:g.instructions||"",scoreRange:{min:g.scoreRange?.min??0,max:g.scoreRange?.max??1},defaultSampling:g.defaultSampling}),[g]),{form:v}=Sxt({initialValues:b});E.useEffect(()=>{b&&v.reset(b)},[b,v]);const w=E.useCallback(async()=>{if(!await v.trigger()){Je.error("Please fill in all required fields");return}p(!0);try{const O=OFe(v.getValues());await o.mutateAsync(O),Je.success("Draft saved")}catch(O){Je.error(`Failed to save draft: ${O instanceof Error?O.message:"Unknown error"}`)}finally{p(!1)}},[v,o]),S=E.useCallback(async()=>{if(!await v.trigger()){Je.error("Please fill in all required fields");return}c(!0);try{const O=OFe(v.getValues());await o.mutateAsync(O);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"]}),Je.success("Scorer published"),a(i.scorerLink(t))}catch(O){Je.error(`Failed to publish scorer: ${O instanceof Error?O.message:"Unknown error"}`)}finally{c(!1)}},[v,o,n,t,a,i,s]);return u.jsxs(_L,{leftSlot:u.jsx(xxt,{form:v,onPublish:S,onSaveDraft:w,isSubmitting:l,isSavingDraft:d,formRef:f,mode:"edit"}),children:[m&&u.jsxs(uh,{variant:"info",className:"m-4 mb-0",children:[u.jsx(dh,{children:"This is a previous version"}),u.jsx(vx,{as:"p",children:"You are seeing a specific version of the scorer."})]}),u.jsx("form",{ref:f,className:"h-full",children:u.jsx(wxt,{form:v})})]})}function KTn(){const{scorerId:e}=to(),[t,r]=Yd(),n=t.get("versionId"),{data:s,isLoading:a}=Vvn(e,{status:"draft"}),{data:i}=_xt({scorerId:e??"",params:{sortDirection:"DESC"}}),o=s?.activeVersionId,l=i?.versions?.[0],c=!!(l&&o&&l.id!==o),d=E.useCallback(p=>{r(p?{versionId:p}:{})},[r]);return a?u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(wv,{})}),u.jsx(Pr,{className:"h-6 w-[200px]"})]})}),u.jsx(_L,{leftSlot:u.jsx("div",{className:"flex items-center justify-center h-full",children:u.jsx(vs,{className:"h-8 w-8"})}),children:u.jsx("div",{className:"flex items-center justify-center h-full",children:u.jsx(vs,{className:"h-8 w-8"})})})]}):!s||!e?u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(wv,{})}),"Scorer not found"]})}),u.jsx(_L,{leftSlot:u.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Scorer not found"}),children:u.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Scorer not found"})})]}):u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(wv,{})}),"Edit scorer: ",s.name,c&&u.jsx(Gt,{variant:"info",children:"Unpublished changes"})]}),u.jsx(Qa,{children:u.jsx(Qvn,{scorerId:e,value:n??"",onValueChange:d,variant:"outline",activeVersionId:o})})]}),u.jsx(YTn,{scorer:s,scorerId:e,selectedVersionId:n})]})}function JTn(){const[e,t]=E.useState(!1),{navigate:r,paths:n}=ur(),{data:s,isLoading:a}=t7(),i=s?.datasets??[],o=l=>{t(!1),r(n.datasetLink(l))};return u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Gi,{children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(Qa,{children:u.jsxs(Se,{variant:"light",onClick:()=>t(!0),children:[u.jsx(Ce,{children:u.jsx(gie,{})}),"Create Dataset"]})})]}),u.jsx(eo,{isCentered:!a&&i.length===0,children:u.jsx(dSn,{datasets:i,isLoading:a,onCreateClick:()=>t(!0)})}),u.jsx(ESn,{open:e,onOpenChange:t,onSuccess:o})]})}function eAn(){const{datasetId:e}=to(),t=eg(),[r,n]=E.useState(!1),[s,a]=E.useState(!1),[i,o]=E.useState(!1),[l,c]=E.useState(!1),[d,p]=E.useState(null),{data:f}=Hx(e??"");if(!e)return u.jsx(yn,{children:u.jsx(eo,{children:u.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});const h=b=>{t(`/datasets/${e}/experiments/${b}`)},m=()=>{t("/datasets")},g=b=>{p(b?.version??null)};return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:"span",to:"",isCurrent:!0,children:u.jsx(ASn,{value:e,variant:"ghost"})})]})}),u.jsxs(eo,{className:"content-stretch",children:[u.jsx(UEn,{datasetId:e,onAddItemClick:()=>a(!0),onEditClick:()=>o(!0),onDeleteClick:()=>c(!0),activeDatasetVersion:d,onVersionSelect:g,experimentTriggerSlot:u.jsxs(Se,{variant:"cta",size:"default",onClick:()=>n(!0),children:[u.jsx(JOt,{}),d!=null?`Run on v${d}`:"Run Experiment"]})}),u.jsx(QEn,{datasetId:e,version:d??void 0,open:r,onOpenChange:n,onSuccess:h}),u.jsx(qEn,{datasetId:e,open:s,onOpenChange:a}),f&&u.jsx(CSn,{open:i,onOpenChange:o,dataset:{id:f.id,name:f.name,description:f?.description||"",inputSchema:f.inputSchema,groundTruthSchema:f.groundTruthSchema}}),f&&u.jsx(TSn,{open:l,onOpenChange:c,datasetId:f.id,datasetName:f.name,onSuccess:m})]})]})}function tAn(){const{datasetId:e,itemId:t}=to(),{Link:r}=ur(),n=eg(),{data:s,isLoading:a}=wge(e??"",t??""),{updateItem:i,deleteItem:o}=Wu(),{data:l}=Hx(e??""),c=s?.[0]??null,d=c?.isDeleted??!1,[p,f]=E.useState(null),h=E.useMemo(()=>!c||d?{input:"",groundTruth:"",metadata:""}:{input:JSON.stringify(c.input,null,2),groundTruth:c.groundTruth?JSON.stringify(c.groundTruth,null,2):"",metadata:c.metadata?JSON.stringify(c.metadata,null,2):""},[c,d]),m=c?.datasetVersion??0,[g,b]=E.useState(!1),[v,w]=E.useState(h.input),[S,_]=E.useState(h.groundTruth),[O,C]=E.useState(h.metadata),[T,A]=E.useState(m);m!==T&&(A(m),w(h.input),_(h.groundTruth),C(h.metadata));const[I,R]=E.useState(!1),P=X=>{f(d?X:X.isLatest?null:X)},L=()=>{f(null)},B=!d&&p!=null,M=()=>{B||b(!0)},z=()=>{B||R(!0)},H=async()=>{if(!e||!t)return;let X;try{X=JSON.parse(v)}catch{Je.error("Input must be valid JSON");return}let U;if(S.trim())try{U=JSON.parse(S)}catch{Je.error("Ground Truth must be valid JSON");return}let N;if(O.trim())try{N=JSON.parse(O)}catch{Je.error("Metadata must be valid JSON");return}try{await i.mutateAsync({datasetId:e,itemId:t,input:X,groundTruth:U,metadata:N}),Je.success("Item updated successfully"),b(!1)}catch(Z){Je.error(`Failed to update item: ${Z instanceof Error?Z.message:"Unknown error"}`)}},q=()=>{c&&(w(JSON.stringify(c.input,null,2)),_(c.groundTruth?JSON.stringify(c.groundTruth,null,2):""),C(c.metadata?JSON.stringify(c.metadata,null,2):"")),b(!1)},V=async()=>{if(!(!e||!t))try{await o.mutateAsync({datasetId:e,itemId:t}),Je.success("Item deleted successfully"),R(!1),n(`/datasets/${e}`)}catch(X){Je.error(`Failed to delete item: ${X instanceof Error?X.message:"Unknown error"}`)}},Q=p??c,$=Q?{id:t??"",datasetId:e??"",datasetVersion:Q.datasetVersion,input:Q.input,groundTruth:Q.groundTruth,metadata:Q.metadata,createdAt:Q.createdAt,updatedAt:Q.updatedAt}:null;return a?null:!e||!t||!s||s.length===0?u.jsx(yn,{children:u.jsx(eo,{children:u.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):u.jsxs(u.Fragment,{children:[u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:l?.name}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Item"})]})}),u.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:u.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[u.jsxs(gn,{children:[u.jsxs(gn.Column,{children:[u.jsxs(gn.Title,{children:[u.jsx($Ot,{}),t," ",u.jsx(oc,{content:t})]}),u.jsx(gn.Description,{children:u.jsxs(Qs,{children:["Item of ",u.jsx(Du,{})," ",l?.name]})}),u.jsxs(gn.Description,{children:[u.jsxs(Qs,{children:[u.jsx(xOt,{})," Created at"," ",c?.createdAt?kn(new Date(c.createdAt),"MMM d, yyyy"):""]}),u.jsxs(Qs,{children:[u.jsx(XL,{})," Latest version v",c?.datasetVersion??""]})]})]}),u.jsx(gn.Column,{children:!g&&!d&&u.jsxs(hl,{children:[u.jsxs(Se,{variant:"cta",size:"default",onClick:M,disabled:B,title:B?"Return to latest version to edit":void 0,children:[u.jsx(WOt,{})," Edit"]}),u.jsxs(Se,{variant:"cta",size:"default",onClick:z,disabled:B,title:B?"Return to latest version to delete":void 0,children:[u.jsx(uCt,{})," Delete"]})]})})]}),u.jsxs(RO,{className:g?"grid-cols-1":"grid-cols-[1fr_auto]",children:[u.jsxs(ki,{withRightSeparator:!g,children:[d&&c&&u.jsxs(rc,{variant:"destructive",children:[u.jsx(Dee,{}),u.jsxs(rc.Message,{children:["This item was deleted at version v",c.datasetVersion]})]}),!d&&B&&p&&u.jsx(u.Fragment,{children:u.jsxs(rc,{variant:"warning",children:[u.jsx(Dee,{}),u.jsxs(rc.Message,{children:["Viewing version v",p.datasetVersion]}),u.jsxs(rc.Button,{onClick:L,children:[u.jsx(fOt,{})," Return to the latest version"]})]})}),g?u.jsx(V0t,{inputValue:v,setInputValue:w,groundTruthValue:S,setGroundTruthValue:_,metadataValue:O,setMetadataValue:C,validationErrors:null,onSave:H,onCancel:q,isSaving:i.isPending}):$?u.jsx(r7,{item:$,Link:r}):u.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!g&&u.jsx(ki,{children:u.jsx(E_n,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:P,onCompareVersionsClick:X=>{n(`/datasets/${e}/items/${t}/versions?ids=${X.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})]}),u.jsx(Vt,{open:I,onOpenChange:R,children:u.jsxs(Vt.Content,{children:[u.jsxs(Vt.Header,{children:[u.jsx(Vt.Title,{children:"Delete Item"}),u.jsx(Vt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),u.jsxs(Vt.Footer,{children:[u.jsx(Vt.Cancel,{children:"Cancel"}),u.jsx(Vt.Action,{onClick:V,children:o.isPending?"Deleting...":"Delete"})]})]})})]})}function rAn(){const{datasetId:e,experimentId:t}=to(),{data:r}=Hx(e??""),{data:n,isLoading:s,error:a}=Nae(e,t),{data:i,isLoading:o}=Wwn({datasetId:e,experimentId:t,experimentStatus:n?.status});if(s)return u.jsx(yn,{children:u.jsx("div",{className:"flex items-center justify-center h-full",children:u.jsx(vs,{})})});if(a||!n)return u.jsx(yn,{children:u.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})});const l=i?.results??[];return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:r?.name}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),u.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:u.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[u.jsx(v_n,{experimentId:t,experiment:n}),u.jsx(g_n,{results:l,isLoading:o})]})})]})}function nAn(){const{datasetId:e}=to(),[t]=Yd(),r=t.get("experimentA")??"",n=t.get("experimentB")??"";return!e||!r||!n?u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsxs(qr,{isCurrent:!0,children:[u.jsx(Ce,{children:u.jsx(cA,{})}),"Compare Experiments"]})]})}),u.jsx(eo,{children:u.jsxs("div",{className:"text-neutral4 text-center py-8",children:[u.jsx("p",{children:"Select two experiments to compare."}),u.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/compare?experimentA=","{experimentIdA}","&experimentB=","{experimentIdB}"]})]})})]}):u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:e?.slice(0,8)}),u.jsxs(qr,{isCurrent:!0,children:[u.jsx(Ce,{children:u.jsx(cA,{})}),"Compare Experiments"]})]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:`/datasets/${e}`,variant:"outline",children:[u.jsx(Ce,{children:u.jsx(lD,{})}),"Back to Dataset"]})})]}),u.jsx(eo,{children:u.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start gap-8",children:[u.jsx(p_,{title:"Compare Experiments",description:`Comparing ${r.slice(0,8)} vs ${n.slice(0,8)}`,icon:u.jsx(cA,{})}),u.jsx(x_n,{datasetId:e,experimentIdA:r,experimentIdB:n})]})})]})}function CFe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function sAn(){const{datasetId:e}=to(),[t,r]=Yd(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s}=Hx(e??""),{Link:a}=ur(),[i,o]=E.useState(!1),{data:l}=Dae(e??"",n[0]??""),{data:c}=Dae(e??"",n[1]??"");return!e||n.length<2?u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),u.jsx(eo,{children:u.jsx("div",{className:"text-neutral4 text-center py-8",children:u.jsx("p",{children:"Select at least two items to compare."})})})]}):u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:`/datasets/${e}`,variant:"outline",children:[u.jsx(Ce,{children:u.jsx(lD,{})}),"Back to Dataset"]})})]}),u.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:u.jsxs("div",{className:J("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":i}),children:[u.jsxs(gn,{children:[u.jsxs(gn.Column,{children:[u.jsxs(gn.Title,{children:[u.jsx(cA,{}),"Compare Dataset Items"]}),u.jsx(gn.Description,{children:u.jsxs(Qs,{children:["Comparing ",n.length," items of"," ",u.jsx(er,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),u.jsx(gn.Column,{children:u.jsxs(hl,{children:[u.jsxs(Se,{as:er,to:`/datasets/${e}`,variant:"standard",size:"default",children:[u.jsx(lD,{}),"Back to Dataset"]}),u.jsx(Se,{variant:"cta",size:"default",onClick:()=>o(d=>!d),children:i?u.jsxs(u.Fragment,{children:[u.jsx(d6e,{})," Default View"]}):u.jsxs(u.Fragment,{children:[u.jsx(IOt,{})," Diff View"]})})]})})]}),u.jsx(RO,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((d,p)=>u.jsxs(E.Fragment,{children:[u.jsx(aAn,{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&&u.jsx("div",{className:J("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},d))}),i&&l&&c&&u.jsx(r1t,{codeA:CFe(l),codeB:CFe(c)})]})})]})}function aAn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:o,isLoading:l}=Dae(e,t),{data:c}=AL(e),d=new Set(s.filter((f,h)=>h!==n)),p=(c??[]).map(f=>({value:f.id,label:f.id,disabled:d.has(f.id)}));return u.jsxs(ki,{children:[u.jsxs(ki.Toolbar,{className:"flex gap-4",children:[u.jsx(Fl,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:p,placeholder:"Select item",variant:"experimental",size:"default",labelIsHidden:!0}),u.jsxs(Se,{as:r,to:`/datasets/${e}/items/${t}`,variant:"standard",size:"default",children:[u.jsx(XL,{}),"Versions"]})]}),i&&u.jsx(ki.Content,{children:l?u.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):o?u.jsxs(u.Fragment,{children:[u.jsx(U0t,{item:o}),u.jsx(r7,{item:o,Link:r})]}):u.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function TFe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function iAn(){const{datasetId:e,itemId:t}=to(),[r,n]=Yd(),[s,a]=E.useState(!1),i=r.get("ids")?.split(",").map(Number).filter(f=>!isNaN(f)&&f>0)??[],{data:o}=Hx(e??""),{Link:l}=ur(),{data:c}=wge(e??"",t??""),{data:d}=Iae(e??"",t??"",i[0]??0,o?.version),{data:p}=Iae(e??"",t??"",i[1]??0,o?.version);return!e||!t||i.length<2?u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),u.jsx(eo,{children:u.jsx("div",{className:"text-neutral4 text-center py-8",children:u.jsx("p",{children:"Select at least two versions to compare."})})})]}):u.jsxs(yn,{children:[u.jsxs(bn,{children:[u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:o?.name}),u.jsx(qr,{as:er,to:`/datasets/${e}/items/${t}`,children:"Item"}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),u.jsx(Qa,{children:u.jsxs(Se,{as:er,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[u.jsx(Ce,{children:u.jsx(lD,{})}),"Back to Item"]})})]}),u.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:u.jsxs("div",{className:J("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[u.jsxs(gn,{children:[u.jsxs(gn.Column,{children:[u.jsxs(gn.Title,{children:[u.jsx(cA,{}),"Compare Dataset Item Versions"]}),u.jsx(gn.Description,{children:u.jsxs(Qs,{children:["Comparing ",i.length," versions of"," ",u.jsx(er,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),u.jsx(gn.Column,{children:u.jsxs(hl,{children:[u.jsxs(Se,{as:er,to:`/datasets/${e}/items/${t}`,variant:"standard",size:"default",children:[u.jsx(lD,{}),"Back to Item"]}),u.jsx(Se,{variant:"cta",size:"default",onClick:()=>a(f=>!f),children:s?u.jsxs(u.Fragment,{children:[u.jsx(d6e,{})," Default View"]}):u.jsxs(u.Fragment,{children:[u.jsx(zOt,{})," Diff View"]})})]})})]}),u.jsx(RO,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((f,h)=>u.jsxs(E.Fragment,{children:[u.jsx(oAn,{datasetId:e,itemId:t,datasetVersion:f,latestVersion:o?.version,allVersions:c??[],versionNumbers:i,Link:l,idx:h,showContent:!s,onVersionChange:m=>{const g=[...i];g[h]=m,n({ids:g.join(",")})}}),h===0&&u.jsx("div",{className:J("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),s&&d&&p&&u.jsx(r1t,{codeA:TFe(d),codeB:TFe(p)})]})})]})}function oAn({datasetId:e,itemId:t,datasetVersion:r,latestVersion:n,allVersions:s,versionNumbers:a,Link:i,idx:o,showContent:l=!0,onVersionChange:c}){const{data:d,isLoading:p}=Iae(e,t,r,n),f=new Set(a.filter((g,b)=>b!==o)),h=s.map(g=>{const b=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:`v${g.datasetVersion} — ${kn(b,"MMM d, yyyy h:mm a")}${g.isLatest?" (latest)":""}`,disabled:f.has(g.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 u.jsxs(ki,{children:[u.jsxs(ki.Toolbar,{className:"flex gap-4",children:[u.jsx(XL,{className:"w-6 h-6 opacity-50"}),u.jsx(Fl,{label:"Version",name:`compare-version-${o}`,value:String(r),onValueChange:g=>c(Number(g)),options:h,placeholder:"Select version",variant:"experimental",size:"default",labelIsHidden:!0,className:"w-full"})]}),l&&u.jsx(ki.Content,{children:p?u.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?u.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",r," not found"]}):u.jsx(u.Fragment,{children:u.jsx(r7,{item:m,Link:i})})})]})}function lAn(){const{datasetId:e}=to(),[t]=Yd(),r=t.get("ids")?.split(",").map(Number).filter(m=>!isNaN(m)&&m>0)??[],n=eg(),{data:s}=Hx(e??""),a=AL(e??"",void 0,r[0]??null),i=AL(e??"",void 0,r[1]??null),o=E.useMemo(()=>a.data??[],[a.data]),l=E.useMemo(()=>i.data??[],[i.data]),c=E.useMemo(()=>{const m=new Map;for(const g of[...o,...l])m.has(g.id)||m.set(g.id,{id:g.id,createdAt:new Date(g.createdAt)});return[...m.values()].sort((g,b)=>b.createdAt.getTime()-g.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 u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),u.jsx(eo,{children:u.jsx("div",{className:"text-neutral4 text-center py-8",children:u.jsx("p",{children:"Select at least two versions to compare."})})})]});const f=(m,g,b)=>{n(`/datasets/${e}/items/${m}/versions?ids=${g?.datasetVersion??""},${b?.datasetVersion??""}`)},h=(m,g)=>{n(`/datasets/${e}/versions?ids=${m},${g}`,{replace:!0})};return u.jsxs(yn,{children:[u.jsx(bn,{children:u.jsxs(Ii,{children:[u.jsxs(qr,{as:er,to:"/datasets",children:[u.jsx(Ce,{children:u.jsx(Du,{})}),"Datasets"]}),u.jsx(qr,{as:er,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),u.jsxs(qr,{isCurrent:!0,as:"span",children:[u.jsx(Ce,{children:u.jsx(t0e,{})}),"Compare Versions"]})]})}),u.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:u.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[u.jsx(gn,{children:u.jsxs(gn.Column,{children:[u.jsxs(gn.Title,{children:[u.jsx(t0e,{})," Compare Dataset Versions"]}),u.jsx(gn.Description,{children:u.jsxs(Qs,{children:[u.jsx(XL,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]})}),u.jsx(RO,{children:u.jsxs(ki,{children:[u.jsx(O_n,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:h}),u.jsx(T_n,{allItems:c,itemsAMap:d,itemsBMap:p,onItemClick:f})]})})]})})]})}const cAn={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/${Ao()}`,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`,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}`},uAn=()=>{const e=eg(),t=r=>e(r,{viewTransition:!0});return u.jsx(hmn,{Link:hTn,navigate:t,paths:cAn,children:u.jsx(Rkn,{children:u.jsx(oD,{})})})},dAn=!!window.MASTRA_CLOUD_API_ENDPOINT,pAn=NFe.has("datasets"),AFe=[{index:!0,element:u.jsx(zTn,{})},{path:"instruction-blocks",element:u.jsx(WTn,{})},{path:"tools",element:u.jsx(UTn,{})},{path:"agents",element:u.jsx(VTn,{})},{path:"scorers",element:u.jsx(qTn,{})},{path:"workflows",element:u.jsx(HTn,{})},{path:"skills",element:u.jsx(QTn,{})},{path:"memory",element:u.jsx(ZTn,{})},{path:"variables",element:u.jsx(GTn,{})}],fAn=[{element:u.jsx(uAn,{}),children:[...dAn?[]:[{path:"/settings",element:u.jsx(LTn,{})},{path:"/templates",element:u.jsx(jTn,{})},{path:"/templates/:templateSlug",element:u.jsx(MTn,{})}],{path:"/scorers",element:u.jsx(mTn,{})},{path:"/scorers/:scorerId",element:u.jsx(gTn,{})},{path:"/observability",element:u.jsx(wTn,{})},{path:"/agents",element:u.jsx(Fkn,{})},{path:"/cms/agents/create",element:u.jsx(FTn,{}),children:AFe},{path:"/cms/agents/:agentId/edit",element:u.jsx(BTn,{}),children:AFe},{path:"/cms/scorers/create",element:u.jsx(XTn,{})},{path:"/cms/scorers/:scorerId/edit",element:u.jsx(KTn,{})},{path:"/agents/:agentId/tools/:toolId",element:u.jsx(zkn,{})},{path:"/agents/:agentId",element:u.jsx(jkn,{children:u.jsx(oD,{})}),children:[{index:!0,loader:({params:e})=>yz(`/agents/${e.agentId}/chat`)},{path:"chat",element:u.jsx(SLe,{})},{path:"chat/:threadId",element:u.jsx(SLe,{})}]},{path:"/tools",element:u.jsx($kn,{})},{path:"/tools/:toolId",element:u.jsx(Ukn,{})},{path:"/processors",element:u.jsx(Mkn,{})},{path:"/processors/:processorId",element:u.jsx(Lkn,{})},{path:"/mcps",element:u.jsx(uTn,{})},{path:"/mcps/:serverId",element:u.jsx(pTn,{})},{path:"/mcps/:serverId/tools/:toolId",element:u.jsx(dTn,{})},{path:"/workspaces",element:u.jsx(EFe,{})},{path:"/workspaces/:workspaceId",element:u.jsx(EFe,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:u.jsx(STn,{})},{path:"/workflows",element:u.jsx(Vkn,{})},{path:"/workflows/:workflowId",element:u.jsx(Hkn,{children:u.jsx(oD,{})}),children:[{index:!0,loader:({params:e})=>yz(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:u.jsx(ELe,{})},{path:"graph/:runId",element:u.jsx(ELe,{})}]},...pAn?[{path:"/datasets",element:u.jsx(JTn,{})},{path:"/datasets/:datasetId",element:u.jsx(eAn,{})},{path:"/datasets/:datasetId/items/:itemId",element:u.jsx(tAn,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:u.jsx(iAn,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:u.jsx(rAn,{})},{path:"/datasets/:datasetId/compare",element:u.jsx(nAn,{})},{path:"/datasets/:datasetId/items",element:u.jsx(sAn,{})},{path:"/datasets/:datasetId/versions",element:u.jsx(lAn,{})}]:[],{index:!0,loader:()=>yz("/agents")},{path:"/request-context",element:u.jsx(cTn,{})}]}];function hAn(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:r,apiPrefix:n,isLoading:s}=pge();if(s)return null;if(!t)return u.jsx(avn,{});const a=Qkt(fAn,{basename:e});return u.jsx(tgr,{baseUrl:t,headers:r,apiPrefix:n,children:u.jsx(lTn,{children:u.jsx(vkt,{router:a})})})}function mAn(){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",a=window.MASTRA_CLOUD_API_ENDPOINT||""||`${e}://${t}:${r}`;return u.jsx(U_n,{children:u.jsx(Xbn,{endpoint:a,defaultApiPrefix:n,children:u.jsx(hAn,{})})})}REt.createRoot(document.getElementById("root")).render(u.jsx(E.StrictMode,{children:u.jsx(mAn,{})}));const JIn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{Ke as A,fYe as B,eQe as C,KGe as D,rp as E,qXe as F,UWe as G,Up as H,na as I,E8 as J,GIn as K,k1 as L,gJr as M,YGe as N,JIn as O,d9 as _,dFt as a,CFt as b,EAn as c,lwe as d,xDn as e,EFt as f,w1 as g,OFt as h,C1 as i,vw as j,xw as k,bw as l,QE as m,itr as n,WWe as o,Ca as p,xer as q,ygr as r,oce as s,re as t,wer as u,lue as v,gFt as w,o4 as x,au as y,gt as z};
|