@mastra/deployer-cloud 1.18.0-alpha.1 → 1.18.0-alpha.2

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/studio/assets/{chunk-ZCJMLMGS-34NRvadL.js → chunk-ZCJMLMGS-BJ6CAtso.js} +1 -1
  3. package/dist/studio/assets/{index-CHHLlfkZ.js → index-B2yVzy6Q.js} +1 -1
  4. package/dist/studio/assets/{index-Ct0jFr6W.js → index-B3W4BfxH.js} +1 -1
  5. package/dist/studio/assets/{index-BWDMxPAh.js → index-BGyDx-rF.js} +1 -1
  6. package/dist/studio/assets/{index-B8KEGxbu.js → index-Bi-PLM84.js} +1 -1
  7. package/dist/studio/assets/{index-C-E-5lui.js → index-BvKVpLq2.js} +1 -1
  8. package/dist/studio/assets/{index-B0Ziicix.js → index-C3KX4RVQ.js} +1 -1
  9. package/dist/studio/assets/{index-Di7jABOd.js → index-CbJmAOX_.js} +1 -1
  10. package/dist/studio/assets/{index-BAQr-ni3.js → index-CrvJOQ5N.js} +1 -1
  11. package/dist/studio/assets/{index-DF1HjQsf.js → index-D3j4lZvh.js} +1 -1
  12. package/dist/studio/assets/{index-aXMdg2xE.js → index-DNkWF02w.js} +1 -1
  13. package/dist/studio/assets/{index-Buo2H4BG.js → index-DU9zr-1L.js} +1 -1
  14. package/dist/studio/assets/{index-nRQDe8wP.js → index-DYuAM0ID.js} +1 -1
  15. package/dist/studio/assets/{index-BBkPM25S.js → index-DtTMnVbW.js} +1 -1
  16. package/dist/studio/assets/{index-QuFJB9jg.js → index-Dyghc7pm.js} +1 -1
  17. package/dist/studio/assets/{index-CN5NGcTu.js → index-FJTZVbJ2.js} +1 -1
  18. package/dist/studio/assets/{index-DwNTyCh7.js → index-FXB9jWN1.js} +1 -1
  19. package/dist/studio/assets/{index-BvRYQXpd.js → index-YwhaF4oL.js} +1 -1
  20. package/dist/studio/assets/{index-CutfL3UQ.js → index-lAv2ejbo.js} +1 -1
  21. package/dist/studio/assets/{main-DJdtfUBQ.js → main-BqctJLKC.js} +6 -6
  22. package/dist/studio/assets/style-GARsTQdP.css +1 -0
  23. package/dist/studio/assets/{token-APYSY3BW-RPVF55TR-DfAwCdBi.js → token-APYSY3BW-RPVF55TR-CkhyJ5bb.js} +1 -1
  24. package/dist/studio/assets/token-util-RMHT2CPJ-VVUHOXBL-BmjNbOmW.js +1 -0
  25. package/dist/studio/index.html +2 -2
  26. package/dist/utils/logger.d.ts +1 -1
  27. package/dist/utils/logger.d.ts.map +1 -1
  28. package/package.json +5 -5
  29. package/versions.json +1 -1
  30. package/dist/studio/assets/style-tXmkNFay.css +0 -1
  31. package/dist/studio/assets/token-util-RMHT2CPJ-VVUHOXBL-C3s4aDTd.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./token-util-RMHT2CPJ-VVUHOXBL-C3s4aDTd.js","./chunk-ZCJMLMGS-34NRvadL.js","./index-BWDMxPAh.js","./token-APYSY3BW-RPVF55TR-DfAwCdBi.js","./index-aXMdg2xE.js","./index-BBkPM25S.js","./index-DwNTyCh7.js","./index-Di7jABOd.js","./index-CutfL3UQ.js","./index-nRQDe8wP.js","./index-Ct0jFr6W.js","./index-Buo2H4BG.js","./index-BvRYQXpd.js","./index-C-E-5lui.js","./index-B8KEGxbu.js","./index-QuFJB9jg.js","./index-BAQr-ni3.js","./index-B0Ziicix.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-DF1HjQsf.js","./index-CN5NGcTu.js","./index-CHHLlfkZ.js"])))=>i.map(i=>d[i]);
2
- import{_ as Ge}from"./index-BWDMxPAh.js";function o9e(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var p$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _7={exports:{}},QE={};var Gxe;function r_t(){if(Gxe)return QE;Gxe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,s){var i=null;if(s!==void 0&&(i=""+s),a.key!==void 0&&(i=""+a.key),"key"in a){s={};for(var o in a)o!=="key"&&(s[o]=a[o])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:i,ref:a!==void 0?a:null,props:s}}return QE.Fragment=t,QE.jsx=n,QE.jsxs=n,QE}var Zxe;function a_t(){return Zxe||(Zxe=1,_7.exports=r_t()),_7.exports}var l=a_t(),E7={exports:{}},fr={},Yxe;function s_t(){if(Yxe)return fr;Yxe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),h=Symbol.iterator;function m(z){return z===null||typeof z!="object"?null:(z=h&&z[h]||z["@@iterator"],typeof z=="function"?z:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function S(z,R,Q){this.props=z,this.context=R,this.refs=b,this.updater=Q||g}S.prototype.isReactComponent={},S.prototype.setState=function(z,R){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,R,"setState")},S.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function O(){}O.prototype=S.prototype;function k(z,R,Q){this.props=z,this.context=R,this.refs=b,this.updater=Q||g}var E=k.prototype=new O;E.constructor=k,v(E,S.prototype),E.isPureReactComponent=!0;var C=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function I(z,R,Q){var G=Q.ref;return{$$typeof:t,type:z,key:R,ref:G!==void 0?G:null,props:Q}}function P(z,R){return I(z.type,R,z.props)}function M(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function F(z){var R={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(Q){return R[Q]})}var D=/\/+/g;function V(z,R){return typeof z=="object"&&z!==null&&z.key!=null?F(""+z.key):R.toString(36)}function H(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(T,T):(z.status="pending",z.then(function(R){z.status==="pending"&&(z.status="fulfilled",z.value=R)},function(R){z.status==="pending"&&(z.status="rejected",z.reason=R)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function B(z,R,Q,G,ee){var re=typeof z;(re==="undefined"||re==="boolean")&&(z=null);var ne=!1;if(z===null)ne=!0;else switch(re){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(z.$$typeof){case t:case n:ne=!0;break;case f:return ne=z._init,B(ne(z._payload),R,Q,G,ee)}}if(ne)return ee=ee(z),ne=G===""?"."+V(z,0):G,C(ee)?(Q="",ne!=null&&(Q=ne.replace(D,"$&/")+"/"),B(ee,R,Q,"",function(pe){return pe})):ee!=null&&(M(ee)&&(ee=P(ee,Q+(ee.key==null||z&&z.key===ee.key?"":(""+ee.key).replace(D,"$&/")+"/")+ne)),R.push(ee)),1;ne=0;var se=G===""?".":G+":";if(C(z))for(var oe=0;oe<z.length;oe++)G=z[oe],re=se+V(G,oe),ne+=B(G,R,Q,re,ee);else if(oe=m(z),typeof oe=="function")for(z=oe.call(z),oe=0;!(G=z.next()).done;)G=G.value,re=se+V(G,oe++),ne+=B(G,R,Q,re,ee);else if(re==="object"){if(typeof z.then=="function")return B(H(z),R,Q,G,ee);throw R=String(z),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return ne}function q(z,R,Q){if(z==null)return z;var G=[],ee=0;return B(z,G,"","",function(re){return R.call(Q,re,ee++)}),G}function W(z){if(z._status===-1){var R=z._result;R=R(),R.then(function(Q){(z._status===0||z._status===-1)&&(z._status=1,z._result=Q)},function(Q){(z._status===0||z._status===-1)&&(z._status=2,z._result=Q)}),z._status===-1&&(z._status=0,z._result=R)}if(z._status===1)return z._result.default;throw z._result}var L=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(R))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",z);return}console.error(z)},Z={map:q,forEach:function(z,R,Q){q(z,function(){R.apply(this,arguments)},Q)},count:function(z){var R=0;return q(z,function(){R++}),R},toArray:function(z){return q(z,function(R){return R})||[]},only:function(z){if(!M(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return fr.Activity=p,fr.Children=Z,fr.Component=S,fr.Fragment=r,fr.Profiler=s,fr.PureComponent=k,fr.StrictMode=a,fr.Suspense=u,fr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,fr.__COMPILER_RUNTIME={__proto__:null,c:function(z){return j.H.useMemoCache(z)}},fr.cache=function(z){return function(){return z.apply(null,arguments)}},fr.cacheSignal=function(){return null},fr.cloneElement=function(z,R,Q){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var G=v({},z.props),ee=z.key;if(R!=null)for(re in R.key!==void 0&&(ee=""+R.key),R)!A.call(R,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&R.ref===void 0||(G[re]=R[re]);var re=arguments.length-2;if(re===1)G.children=Q;else if(1<re){for(var ne=Array(re),se=0;se<re;se++)ne[se]=arguments[se+2];G.children=ne}return I(z.type,ee,G)},fr.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:i,_context:z},z},fr.createElement=function(z,R,Q){var G,ee={},re=null;if(R!=null)for(G in R.key!==void 0&&(re=""+R.key),R)A.call(R,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(ee[G]=R[G]);var ne=arguments.length-2;if(ne===1)ee.children=Q;else if(1<ne){for(var se=Array(ne),oe=0;oe<ne;oe++)se[oe]=arguments[oe+2];ee.children=se}if(z&&z.defaultProps)for(G in ne=z.defaultProps,ne)ee[G]===void 0&&(ee[G]=ne[G]);return I(z,re,ee)},fr.createRef=function(){return{current:null}},fr.forwardRef=function(z){return{$$typeof:c,render:z}},fr.isValidElement=M,fr.lazy=function(z){return{$$typeof:f,_payload:{_status:-1,_result:z},_init:W}},fr.memo=function(z,R){return{$$typeof:d,type:z,compare:R===void 0?null:R}},fr.startTransition=function(z){var R=j.T,Q={};j.T=Q;try{var G=z(),ee=j.S;ee!==null&&ee(Q,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,L)}catch(re){L(re)}finally{R!==null&&Q.types!==null&&(R.types=Q.types),j.T=R}},fr.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},fr.use=function(z){return j.H.use(z)},fr.useActionState=function(z,R,Q){return j.H.useActionState(z,R,Q)},fr.useCallback=function(z,R){return j.H.useCallback(z,R)},fr.useContext=function(z){return j.H.useContext(z)},fr.useDebugValue=function(){},fr.useDeferredValue=function(z,R){return j.H.useDeferredValue(z,R)},fr.useEffect=function(z,R){return j.H.useEffect(z,R)},fr.useEffectEvent=function(z){return j.H.useEffectEvent(z)},fr.useId=function(){return j.H.useId()},fr.useImperativeHandle=function(z,R,Q){return j.H.useImperativeHandle(z,R,Q)},fr.useInsertionEffect=function(z,R){return j.H.useInsertionEffect(z,R)},fr.useLayoutEffect=function(z,R){return j.H.useLayoutEffect(z,R)},fr.useMemo=function(z,R){return j.H.useMemo(z,R)},fr.useOptimistic=function(z,R){return j.H.useOptimistic(z,R)},fr.useReducer=function(z,R,Q){return j.H.useReducer(z,R,Q)},fr.useRef=function(z){return j.H.useRef(z)},fr.useState=function(z){return j.H.useState(z)},fr.useSyncExternalStore=function(z,R,Q){return j.H.useSyncExternalStore(z,R,Q)},fr.useTransition=function(){return j.H.useTransition()},fr.version="19.2.4",fr}var Xxe;function t_(){return Xxe||(Xxe=1,E7.exports=s_t()),E7.exports}var x=t_();const Ee=xo(x),Aw=o9e({__proto__:null,default:Ee},[x]);var C7={exports:{}},WE={},j7={exports:{}},T7={};var Kxe;function i_t(){return Kxe||(Kxe=1,(function(e){function t(H,B){var q=H.length;H.push(B);e:for(;0<q;){var W=q-1>>>1,L=H[W];if(0<a(L,B))H[W]=B,H[q]=L,q=W;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var B=H[0],q=H.pop();if(q!==B){H[0]=q;e:for(var W=0,L=H.length,Z=L>>>1;W<Z;){var z=2*(W+1)-1,R=H[z],Q=z+1,G=H[Q];if(0>a(R,q))Q<L&&0>a(G,R)?(H[W]=G,H[Q]=q,W=Q):(H[W]=R,H[z]=q,W=z);else if(Q<L&&0>a(G,q))H[W]=G,H[Q]=q,W=Q;else break e}}return B}function a(H,B){var q=H.sortIndex-B.sortIndex;return q!==0?q:H.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],u=[],d=1,f=null,p=3,h=!1,m=!1,g=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function k(H){for(var B=n(u);B!==null;){if(B.callback===null)r(u);else if(B.startTime<=H)r(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=n(u)}}function E(H){if(g=!1,k(H),!m)if(n(c)!==null)m=!0,C||(C=!0,M());else{var B=n(u);B!==null&&V(E,B.startTime-H)}}var C=!1,T=-1,j=5,A=-1;function I(){return v?!0:!(e.unstable_now()-A<j)}function P(){if(v=!1,C){var H=e.unstable_now();A=H;var B=!0;try{e:{m=!1,g&&(g=!1,S(T),T=-1),h=!0;var q=p;try{t:{for(k(H),f=n(c);f!==null&&!(f.expirationTime>H&&I());){var W=f.callback;if(typeof W=="function"){f.callback=null,p=f.priorityLevel;var L=W(f.expirationTime<=H);if(H=e.unstable_now(),typeof L=="function"){f.callback=L,k(H),B=!0;break t}f===n(c)&&r(c),k(H)}else r(c);f=n(c)}if(f!==null)B=!0;else{var Z=n(u);Z!==null&&V(E,Z.startTime-H),B=!1}}break e}finally{f=null,p=q,h=!1}B=void 0}}finally{B?M():C=!1}}}var M;if(typeof O=="function")M=function(){O(P)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,D=F.port2;F.port1.onmessage=P,M=function(){D.postMessage(null)}}else M=function(){b(P,0)};function V(H,B){T=b(function(){H(e.unstable_now())},B)}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"):j=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(H){switch(p){case 1:case 2:case 3:var B=3;break;default:B=p}var q=p;p=B;try{return H()}finally{p=q}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(H,B){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var q=p;p=H;try{return B()}finally{p=q}},e.unstable_scheduleCallback=function(H,B,q){var W=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?W+q:W):q=W,H){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=q+L,H={id:d++,callback:B,priorityLevel:H,startTime:q,expirationTime:L,sortIndex:-1},q>W?(H.sortIndex=q,t(u,H),n(c)===null&&H===n(u)&&(g?(S(T),T=-1):g=!0,V(E,q-W))):(H.sortIndex=L,t(c,H),m||h||(m=!0,C||(C=!0,M()))),H},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(H){var B=p;return function(){var q=p;p=B;try{return H.apply(this,arguments)}finally{p=q}}}})(T7)),T7}var Jxe;function o_t(){return Jxe||(Jxe=1,j7.exports=i_t()),j7.exports}var N7={exports:{}},Rl={};var e0e;function l_t(){if(e0e)return Rl;e0e=1;var e=t_();function t(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Rl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Rl.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return s(c,u,null,d)},Rl.flushSync=function(c){var u=i.T,d=r.p;try{if(i.T=null,r.p=2,c)return c()}finally{i.T=u,r.p=d,r.d.f()}},Rl.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(c,u))},Rl.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Rl.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin),p=typeof u.integrity=="string"?u.integrity:void 0,h=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?r.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:p,fetchPriority:h}):d==="script"&&r.d.X(c,{crossOrigin:f,integrity:p,fetchPriority:h,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Rl.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=o(u.as,u.crossOrigin);r.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(c)},Rl.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin);r.d.L(c,d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Rl.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=o(u.as,u.crossOrigin);r.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(c)},Rl.requestFormReset=function(c){r.d.r(c)},Rl.unstable_batchedUpdates=function(c,u){return c(u)},Rl.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},Rl.useFormStatus=function(){return i.H.useHostTransitionStatus()},Rl.version="19.2.4",Rl}var t0e;function l9e(){if(t0e)return N7.exports;t0e=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(),N7.exports=l_t(),N7.exports}var n0e;function c_t(){if(n0e)return WE;n0e=1;var e={env:{}};var t=o_t(),n=t_(),r=l9e();function a(y){var w="https://react.dev/errors/"+y;if(1<arguments.length){w+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)w+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+y+"; visit "+w+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(y){return!(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)}function i(y){var w=y,_=y;if(y.alternate)for(;w.return;)w=w.return;else{y=w;do w=y,(w.flags&4098)!==0&&(_=w.return),y=w.return;while(y)}return w.tag===3?_:null}function o(y){if(y.tag===13){var w=y.memoizedState;if(w===null&&(y=y.alternate,y!==null&&(w=y.memoizedState)),w!==null)return w.dehydrated}return null}function c(y){if(y.tag===31){var w=y.memoizedState;if(w===null&&(y=y.alternate,y!==null&&(w=y.memoizedState)),w!==null)return w.dehydrated}return null}function u(y){if(i(y)!==y)throw Error(a(188))}function d(y){var w=y.alternate;if(!w){if(w=i(y),w===null)throw Error(a(188));return w!==y?null:y}for(var _=y,N=w;;){var $=_.return;if($===null)break;var U=$.alternate;if(U===null){if(N=$.return,N!==null){_=N;continue}break}if($.child===U.child){for(U=$.child;U;){if(U===_)return u($),y;if(U===N)return u($),w;U=U.sibling}throw Error(a(188))}if(_.return!==N.return)_=$,N=U;else{for(var te=!1,de=$.child;de;){if(de===_){te=!0,_=$,N=U;break}if(de===N){te=!0,N=$,_=U;break}de=de.sibling}if(!te){for(de=U.child;de;){if(de===_){te=!0,_=U,N=$;break}if(de===N){te=!0,N=U,_=$;break}de=de.sibling}if(!te)throw Error(a(189))}}if(_.alternate!==N)throw Error(a(190))}if(_.tag!==3)throw Error(a(188));return _.stateNode.current===_?y:w}function f(y){var w=y.tag;if(w===5||w===26||w===27||w===6)return y;for(y=y.child;y!==null;){if(w=f(y),w!==null)return w;y=y.sibling}return null}var p=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),k=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function F(y){return y===null||typeof y!="object"?null:(y=M&&y[M]||y["@@iterator"],typeof y=="function"?y:null)}var D=Symbol.for("react.client.reference");function V(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===D?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case v:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof y=="object")switch(y.$$typeof){case g:return"Portal";case k:return y.displayName||"Context";case O:return(y._context.displayName||"Context")+".Consumer";case E:var w=y.render;return y=y.displayName,y||(y=w.displayName||w.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case j:return w=y.displayName||null,w!==null?w:V(y.type)||"Memo";case A:w=y._payload,y=y._init;try{return V(y(w))}catch{}}return null}var H=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},L=[],Z=-1;function z(y){return{current:y}}function R(y){0>Z||(y.current=L[Z],L[Z]=null,Z--)}function Q(y,w){Z++,L[Z]=y.current,y.current=w}var G=z(null),ee=z(null),re=z(null),ne=z(null);function se(y,w){switch(Q(re,w),Q(ee,y),Q(G,null),w.nodeType){case 9:case 11:y=(y=w.documentElement)&&(y=y.namespaceURI)?vxe(y):0;break;default:if(y=w.tagName,w=w.namespaceURI)w=vxe(w),y=yxe(w,y);else switch(y){case"svg":y=1;break;case"math":y=2;break;default:y=0}}R(G),Q(G,y)}function oe(){R(G),R(ee),R(re)}function pe(y){y.memoizedState!==null&&Q(ne,y);var w=G.current,_=yxe(w,y.type);w!==_&&(Q(ee,y),Q(G,_))}function K(y){ee.current===y&&(R(G),R(ee)),ne.current===y&&(R(ne),UE._currentValue=W)}var ae,ie;function ve(y){if(ae===void 0)try{throw Error()}catch(_){var w=_.stack.trim().match(/\n( *(at )?)/);ae=w&&w[1]||"",ie=-1<_.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./token-util-RMHT2CPJ-VVUHOXBL-BmjNbOmW.js","./chunk-ZCJMLMGS-BJ6CAtso.js","./index-BGyDx-rF.js","./token-APYSY3BW-RPVF55TR-CkhyJ5bb.js","./index-DNkWF02w.js","./index-DtTMnVbW.js","./index-FXB9jWN1.js","./index-CbJmAOX_.js","./index-lAv2ejbo.js","./index-DYuAM0ID.js","./index-B3W4BfxH.js","./index-DU9zr-1L.js","./index-YwhaF4oL.js","./index-BvKVpLq2.js","./index-Bi-PLM84.js","./index-Dyghc7pm.js","./index-CrvJOQ5N.js","./index-C3KX4RVQ.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-D3j4lZvh.js","./index-FJTZVbJ2.js","./index-B2yVzy6Q.js"])))=>i.map(i=>d[i]);
2
+ import{_ as Ge}from"./index-BGyDx-rF.js";function o9e(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var p$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _7={exports:{}},QE={};var Gxe;function r_t(){if(Gxe)return QE;Gxe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,s){var i=null;if(s!==void 0&&(i=""+s),a.key!==void 0&&(i=""+a.key),"key"in a){s={};for(var o in a)o!=="key"&&(s[o]=a[o])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:i,ref:a!==void 0?a:null,props:s}}return QE.Fragment=t,QE.jsx=n,QE.jsxs=n,QE}var Zxe;function a_t(){return Zxe||(Zxe=1,_7.exports=r_t()),_7.exports}var l=a_t(),E7={exports:{}},fr={},Yxe;function s_t(){if(Yxe)return fr;Yxe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),h=Symbol.iterator;function m(z){return z===null||typeof z!="object"?null:(z=h&&z[h]||z["@@iterator"],typeof z=="function"?z:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function S(z,R,Q){this.props=z,this.context=R,this.refs=b,this.updater=Q||g}S.prototype.isReactComponent={},S.prototype.setState=function(z,R){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,R,"setState")},S.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function O(){}O.prototype=S.prototype;function k(z,R,Q){this.props=z,this.context=R,this.refs=b,this.updater=Q||g}var E=k.prototype=new O;E.constructor=k,v(E,S.prototype),E.isPureReactComponent=!0;var C=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function I(z,R,Q){var G=Q.ref;return{$$typeof:t,type:z,key:R,ref:G!==void 0?G:null,props:Q}}function P(z,R){return I(z.type,R,z.props)}function M(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function F(z){var R={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(Q){return R[Q]})}var D=/\/+/g;function V(z,R){return typeof z=="object"&&z!==null&&z.key!=null?F(""+z.key):R.toString(36)}function H(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(T,T):(z.status="pending",z.then(function(R){z.status==="pending"&&(z.status="fulfilled",z.value=R)},function(R){z.status==="pending"&&(z.status="rejected",z.reason=R)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function B(z,R,Q,G,ee){var re=typeof z;(re==="undefined"||re==="boolean")&&(z=null);var ne=!1;if(z===null)ne=!0;else switch(re){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(z.$$typeof){case t:case n:ne=!0;break;case f:return ne=z._init,B(ne(z._payload),R,Q,G,ee)}}if(ne)return ee=ee(z),ne=G===""?"."+V(z,0):G,C(ee)?(Q="",ne!=null&&(Q=ne.replace(D,"$&/")+"/"),B(ee,R,Q,"",function(pe){return pe})):ee!=null&&(M(ee)&&(ee=P(ee,Q+(ee.key==null||z&&z.key===ee.key?"":(""+ee.key).replace(D,"$&/")+"/")+ne)),R.push(ee)),1;ne=0;var se=G===""?".":G+":";if(C(z))for(var oe=0;oe<z.length;oe++)G=z[oe],re=se+V(G,oe),ne+=B(G,R,Q,re,ee);else if(oe=m(z),typeof oe=="function")for(z=oe.call(z),oe=0;!(G=z.next()).done;)G=G.value,re=se+V(G,oe++),ne+=B(G,R,Q,re,ee);else if(re==="object"){if(typeof z.then=="function")return B(H(z),R,Q,G,ee);throw R=String(z),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return ne}function q(z,R,Q){if(z==null)return z;var G=[],ee=0;return B(z,G,"","",function(re){return R.call(Q,re,ee++)}),G}function W(z){if(z._status===-1){var R=z._result;R=R(),R.then(function(Q){(z._status===0||z._status===-1)&&(z._status=1,z._result=Q)},function(Q){(z._status===0||z._status===-1)&&(z._status=2,z._result=Q)}),z._status===-1&&(z._status=0,z._result=R)}if(z._status===1)return z._result.default;throw z._result}var L=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(R))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",z);return}console.error(z)},Z={map:q,forEach:function(z,R,Q){q(z,function(){R.apply(this,arguments)},Q)},count:function(z){var R=0;return q(z,function(){R++}),R},toArray:function(z){return q(z,function(R){return R})||[]},only:function(z){if(!M(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return fr.Activity=p,fr.Children=Z,fr.Component=S,fr.Fragment=r,fr.Profiler=s,fr.PureComponent=k,fr.StrictMode=a,fr.Suspense=u,fr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,fr.__COMPILER_RUNTIME={__proto__:null,c:function(z){return j.H.useMemoCache(z)}},fr.cache=function(z){return function(){return z.apply(null,arguments)}},fr.cacheSignal=function(){return null},fr.cloneElement=function(z,R,Q){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var G=v({},z.props),ee=z.key;if(R!=null)for(re in R.key!==void 0&&(ee=""+R.key),R)!A.call(R,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&R.ref===void 0||(G[re]=R[re]);var re=arguments.length-2;if(re===1)G.children=Q;else if(1<re){for(var ne=Array(re),se=0;se<re;se++)ne[se]=arguments[se+2];G.children=ne}return I(z.type,ee,G)},fr.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:i,_context:z},z},fr.createElement=function(z,R,Q){var G,ee={},re=null;if(R!=null)for(G in R.key!==void 0&&(re=""+R.key),R)A.call(R,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(ee[G]=R[G]);var ne=arguments.length-2;if(ne===1)ee.children=Q;else if(1<ne){for(var se=Array(ne),oe=0;oe<ne;oe++)se[oe]=arguments[oe+2];ee.children=se}if(z&&z.defaultProps)for(G in ne=z.defaultProps,ne)ee[G]===void 0&&(ee[G]=ne[G]);return I(z,re,ee)},fr.createRef=function(){return{current:null}},fr.forwardRef=function(z){return{$$typeof:c,render:z}},fr.isValidElement=M,fr.lazy=function(z){return{$$typeof:f,_payload:{_status:-1,_result:z},_init:W}},fr.memo=function(z,R){return{$$typeof:d,type:z,compare:R===void 0?null:R}},fr.startTransition=function(z){var R=j.T,Q={};j.T=Q;try{var G=z(),ee=j.S;ee!==null&&ee(Q,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,L)}catch(re){L(re)}finally{R!==null&&Q.types!==null&&(R.types=Q.types),j.T=R}},fr.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},fr.use=function(z){return j.H.use(z)},fr.useActionState=function(z,R,Q){return j.H.useActionState(z,R,Q)},fr.useCallback=function(z,R){return j.H.useCallback(z,R)},fr.useContext=function(z){return j.H.useContext(z)},fr.useDebugValue=function(){},fr.useDeferredValue=function(z,R){return j.H.useDeferredValue(z,R)},fr.useEffect=function(z,R){return j.H.useEffect(z,R)},fr.useEffectEvent=function(z){return j.H.useEffectEvent(z)},fr.useId=function(){return j.H.useId()},fr.useImperativeHandle=function(z,R,Q){return j.H.useImperativeHandle(z,R,Q)},fr.useInsertionEffect=function(z,R){return j.H.useInsertionEffect(z,R)},fr.useLayoutEffect=function(z,R){return j.H.useLayoutEffect(z,R)},fr.useMemo=function(z,R){return j.H.useMemo(z,R)},fr.useOptimistic=function(z,R){return j.H.useOptimistic(z,R)},fr.useReducer=function(z,R,Q){return j.H.useReducer(z,R,Q)},fr.useRef=function(z){return j.H.useRef(z)},fr.useState=function(z){return j.H.useState(z)},fr.useSyncExternalStore=function(z,R,Q){return j.H.useSyncExternalStore(z,R,Q)},fr.useTransition=function(){return j.H.useTransition()},fr.version="19.2.4",fr}var Xxe;function t_(){return Xxe||(Xxe=1,E7.exports=s_t()),E7.exports}var x=t_();const Ee=xo(x),Aw=o9e({__proto__:null,default:Ee},[x]);var C7={exports:{}},WE={},j7={exports:{}},T7={};var Kxe;function i_t(){return Kxe||(Kxe=1,(function(e){function t(H,B){var q=H.length;H.push(B);e:for(;0<q;){var W=q-1>>>1,L=H[W];if(0<a(L,B))H[W]=B,H[q]=L,q=W;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var B=H[0],q=H.pop();if(q!==B){H[0]=q;e:for(var W=0,L=H.length,Z=L>>>1;W<Z;){var z=2*(W+1)-1,R=H[z],Q=z+1,G=H[Q];if(0>a(R,q))Q<L&&0>a(G,R)?(H[W]=G,H[Q]=q,W=Q):(H[W]=R,H[z]=q,W=z);else if(Q<L&&0>a(G,q))H[W]=G,H[Q]=q,W=Q;else break e}}return B}function a(H,B){var q=H.sortIndex-B.sortIndex;return q!==0?q:H.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],u=[],d=1,f=null,p=3,h=!1,m=!1,g=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function k(H){for(var B=n(u);B!==null;){if(B.callback===null)r(u);else if(B.startTime<=H)r(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=n(u)}}function E(H){if(g=!1,k(H),!m)if(n(c)!==null)m=!0,C||(C=!0,M());else{var B=n(u);B!==null&&V(E,B.startTime-H)}}var C=!1,T=-1,j=5,A=-1;function I(){return v?!0:!(e.unstable_now()-A<j)}function P(){if(v=!1,C){var H=e.unstable_now();A=H;var B=!0;try{e:{m=!1,g&&(g=!1,S(T),T=-1),h=!0;var q=p;try{t:{for(k(H),f=n(c);f!==null&&!(f.expirationTime>H&&I());){var W=f.callback;if(typeof W=="function"){f.callback=null,p=f.priorityLevel;var L=W(f.expirationTime<=H);if(H=e.unstable_now(),typeof L=="function"){f.callback=L,k(H),B=!0;break t}f===n(c)&&r(c),k(H)}else r(c);f=n(c)}if(f!==null)B=!0;else{var Z=n(u);Z!==null&&V(E,Z.startTime-H),B=!1}}break e}finally{f=null,p=q,h=!1}B=void 0}}finally{B?M():C=!1}}}var M;if(typeof O=="function")M=function(){O(P)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,D=F.port2;F.port1.onmessage=P,M=function(){D.postMessage(null)}}else M=function(){b(P,0)};function V(H,B){T=b(function(){H(e.unstable_now())},B)}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"):j=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(H){switch(p){case 1:case 2:case 3:var B=3;break;default:B=p}var q=p;p=B;try{return H()}finally{p=q}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(H,B){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var q=p;p=H;try{return B()}finally{p=q}},e.unstable_scheduleCallback=function(H,B,q){var W=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?W+q:W):q=W,H){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=q+L,H={id:d++,callback:B,priorityLevel:H,startTime:q,expirationTime:L,sortIndex:-1},q>W?(H.sortIndex=q,t(u,H),n(c)===null&&H===n(u)&&(g?(S(T),T=-1):g=!0,V(E,q-W))):(H.sortIndex=L,t(c,H),m||h||(m=!0,C||(C=!0,M()))),H},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(H){var B=p;return function(){var q=p;p=B;try{return H.apply(this,arguments)}finally{p=q}}}})(T7)),T7}var Jxe;function o_t(){return Jxe||(Jxe=1,j7.exports=i_t()),j7.exports}var N7={exports:{}},Rl={};var e0e;function l_t(){if(e0e)return Rl;e0e=1;var e=t_();function t(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Rl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Rl.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return s(c,u,null,d)},Rl.flushSync=function(c){var u=i.T,d=r.p;try{if(i.T=null,r.p=2,c)return c()}finally{i.T=u,r.p=d,r.d.f()}},Rl.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(c,u))},Rl.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Rl.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin),p=typeof u.integrity=="string"?u.integrity:void 0,h=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?r.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:p,fetchPriority:h}):d==="script"&&r.d.X(c,{crossOrigin:f,integrity:p,fetchPriority:h,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Rl.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=o(u.as,u.crossOrigin);r.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(c)},Rl.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin);r.d.L(c,d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Rl.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=o(u.as,u.crossOrigin);r.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(c)},Rl.requestFormReset=function(c){r.d.r(c)},Rl.unstable_batchedUpdates=function(c,u){return c(u)},Rl.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},Rl.useFormStatus=function(){return i.H.useHostTransitionStatus()},Rl.version="19.2.4",Rl}var t0e;function l9e(){if(t0e)return N7.exports;t0e=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(),N7.exports=l_t(),N7.exports}var n0e;function c_t(){if(n0e)return WE;n0e=1;var e={env:{}};var t=o_t(),n=t_(),r=l9e();function a(y){var w="https://react.dev/errors/"+y;if(1<arguments.length){w+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)w+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+y+"; visit "+w+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(y){return!(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)}function i(y){var w=y,_=y;if(y.alternate)for(;w.return;)w=w.return;else{y=w;do w=y,(w.flags&4098)!==0&&(_=w.return),y=w.return;while(y)}return w.tag===3?_:null}function o(y){if(y.tag===13){var w=y.memoizedState;if(w===null&&(y=y.alternate,y!==null&&(w=y.memoizedState)),w!==null)return w.dehydrated}return null}function c(y){if(y.tag===31){var w=y.memoizedState;if(w===null&&(y=y.alternate,y!==null&&(w=y.memoizedState)),w!==null)return w.dehydrated}return null}function u(y){if(i(y)!==y)throw Error(a(188))}function d(y){var w=y.alternate;if(!w){if(w=i(y),w===null)throw Error(a(188));return w!==y?null:y}for(var _=y,N=w;;){var $=_.return;if($===null)break;var U=$.alternate;if(U===null){if(N=$.return,N!==null){_=N;continue}break}if($.child===U.child){for(U=$.child;U;){if(U===_)return u($),y;if(U===N)return u($),w;U=U.sibling}throw Error(a(188))}if(_.return!==N.return)_=$,N=U;else{for(var te=!1,de=$.child;de;){if(de===_){te=!0,_=$,N=U;break}if(de===N){te=!0,N=$,_=U;break}de=de.sibling}if(!te){for(de=U.child;de;){if(de===_){te=!0,_=U,N=$;break}if(de===N){te=!0,N=U,_=$;break}de=de.sibling}if(!te)throw Error(a(189))}}if(_.alternate!==N)throw Error(a(190))}if(_.tag!==3)throw Error(a(188));return _.stateNode.current===_?y:w}function f(y){var w=y.tag;if(w===5||w===26||w===27||w===6)return y;for(y=y.child;y!==null;){if(w=f(y),w!==null)return w;y=y.sibling}return null}var p=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),k=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function F(y){return y===null||typeof y!="object"?null:(y=M&&y[M]||y["@@iterator"],typeof y=="function"?y:null)}var D=Symbol.for("react.client.reference");function V(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===D?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case v:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof y=="object")switch(y.$$typeof){case g:return"Portal";case k:return y.displayName||"Context";case O:return(y._context.displayName||"Context")+".Consumer";case E:var w=y.render;return y=y.displayName,y||(y=w.displayName||w.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case j:return w=y.displayName||null,w!==null?w:V(y.type)||"Memo";case A:w=y._payload,y=y._init;try{return V(y(w))}catch{}}return null}var H=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},L=[],Z=-1;function z(y){return{current:y}}function R(y){0>Z||(y.current=L[Z],L[Z]=null,Z--)}function Q(y,w){Z++,L[Z]=y.current,y.current=w}var G=z(null),ee=z(null),re=z(null),ne=z(null);function se(y,w){switch(Q(re,w),Q(ee,y),Q(G,null),w.nodeType){case 9:case 11:y=(y=w.documentElement)&&(y=y.namespaceURI)?vxe(y):0;break;default:if(y=w.tagName,w=w.namespaceURI)w=vxe(w),y=yxe(w,y);else switch(y){case"svg":y=1;break;case"math":y=2;break;default:y=0}}R(G),Q(G,y)}function oe(){R(G),R(ee),R(re)}function pe(y){y.memoizedState!==null&&Q(ne,y);var w=G.current,_=yxe(w,y.type);w!==_&&(Q(ee,y),Q(G,_))}function K(y){ee.current===y&&(R(G),R(ee)),ne.current===y&&(R(ne),UE._currentValue=W)}var ae,ie;function ve(y){if(ae===void 0)try{throw Error()}catch(_){var w=_.stack.trim().match(/\n( *(at )?)/);ae=w&&w[1]||"",ie=-1<_.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<_.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+ae+y+ie}var ye=!1;function fe(y,w){if(!y||ye)return"";ye=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var N={DetermineComponentFrameRoot:function(){try{if(w){var it=function(){throw Error()};if(Object.defineProperty(it.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(it,[])}catch(Xe){var Ve=Xe}Reflect.construct(y,[],it)}else{try{it.call()}catch(Xe){Ve=Xe}y.call(it.prototype)}}else{try{throw Error()}catch(Xe){Ve=Xe}(it=y())&&typeof it.catch=="function"&&it.catch(function(){})}}catch(Xe){if(Xe&&Ve&&typeof Xe.stack=="string")return[Xe.stack,Ve.stack]}return[null,null]}};N.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var $=Object.getOwnPropertyDescriptor(N.DetermineComponentFrameRoot,"name");$&&$.configurable&&Object.defineProperty(N.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var U=N.DetermineComponentFrameRoot(),te=U[0],de=U[1];if(te&&de){var je=te.split(`
5
5
  `),Ue=de.split(`
@@ -56,7 +56,7 @@ Error message: ${fle(n)}`,cause:n}),this[R0e]=!0,this.value=t}static isInstance(
56
56
  ]))`;continue}else if(a[u]==="$"){s+=`($|(?=[\r
57
57
  ]))`;continue}}if(r.s&&a[u]==="."){s+=o?`${a[u]}\r
58
58
  `:`[${a[u]}\r
59
- ]`;continue}s+=a[u],a[u]==="\\"?i=!0:o&&a[u]==="]"?o=!1:!o&&a[u]==="["&&(o=!0)}return s}function kqe(e,t){var n,r,a,s,i,o;const c={type:"object",additionalProperties:(n=Ja(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===$e.ZodString&&((a=e.keyType._def.checks)!=null&&a.length)){const{type:u,...d}=Oqe(e.keyType._def,t);return{...c,propertyNames:d}}else{if(((s=e.keyType)==null?void 0:s._def.typeName)===$e.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===$e.ZodBranded&&e.keyType._def.type._def.typeName===$e.ZodString&&((o=e.keyType._def.type._def.checks)!=null&&o.length)){const{type:u,...d}=wqe(e.keyType._def,t);return{...c,propertyNames:d}}}return c}function nNt(e,t){if(t.mapStrategy==="record")return kqe(e,t);const n=Ja(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||wd(),r=Ja(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||wd();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function rNt(e){const t=e.values,r=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),a=Array.from(new Set(r.map(s=>typeof s)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:r}}function aNt(){return{not:wd()}}function sNt(){return{type:"null"}}var Zee={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function iNt(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in Zee&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((a,s)=>{const i=Zee[s._def.typeName];return i&&!a.includes(i)?[...a,i]:a},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((a,s)=>{const i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...a,i];case"bigint":return[...a,"integer"];case"object":if(s._def.value===null)return[...a,"null"];default:return a}},[]);if(r.length===n.length){const a=r.filter((s,i,o)=>o.indexOf(s)===i);return{type:a.length>1?a:a[0],enum:n.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,a)=>[...r,...a._def.values.filter(s=>!r.includes(s))],[])};return oNt(e,t)}var oNt=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,a)=>Ja(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${a}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function lNt(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Zee[e.innerType._def.typeName],"null"]};const n=Ja(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function cNt(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function uNt(e,t){const n={type:"object",properties:{}},r=[],a=e.shape();for(const i in a){let o=a[i];if(o===void 0||o._def===void 0)continue;const c=fNt(o),u=Ja(o._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(n.properties[i]=u,c||r.push(i))}r.length&&(n.required=r);const s=dNt(e,t);return s!==void 0&&(n.additionalProperties=s),n}function dNt(e,t){if(e.catchall._def.typeName!=="ZodNever")return Ja(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 fNt(e){try{return e.isOptional()}catch{return!0}}var pNt=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return Ja(e.innerType._def,t);const r=Ja(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:wd()},r]}:wd()},hNt=(e,t)=>{if(t.pipeStrategy==="input")return Ja(e.in._def,t);if(t.pipeStrategy==="output")return Ja(e.out._def,t);const n=Ja(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Ja(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(a=>a!==void 0)}};function mNt(e,t){return Ja(e.type._def,t)}function gNt(e,t){const r={type:"array",uniqueItems:!0,items:Ja(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(r.minItems=e.minSize.value),e.maxSize&&(r.maxItems=e.maxSize.value),r}function vNt(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Ja(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ja(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Ja(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function yNt(){return{not:wd()}}function bNt(){return wd()}var xNt=(e,t)=>Ja(e.innerType._def,t),wNt=(e,t,n)=>{switch(t){case $e.ZodString:return Oqe(e,n);case $e.ZodNumber:return cNt(e);case $e.ZodObject:return uNt(e,n);case $e.ZodBigInt:return qTt(e);case $e.ZodBoolean:return HTt();case $e.ZodDate:return Sqe(e,n);case $e.ZodUndefined:return yNt();case $e.ZodNull:return sNt();case $e.ZodArray:return VTt(e,n);case $e.ZodUnion:case $e.ZodDiscriminatedUnion:return iNt(e,n);case $e.ZodIntersection:return KTt(e,n);case $e.ZodTuple:return vNt(e,n);case $e.ZodRecord:return kqe(e,n);case $e.ZodLiteral:return JTt(e);case $e.ZodEnum:return YTt(e);case $e.ZodNativeEnum:return rNt(e);case $e.ZodNullable:return lNt(e,n);case $e.ZodOptional:return pNt(e,n);case $e.ZodMap:return nNt(e,n);case $e.ZodSet:return gNt(e,n);case $e.ZodLazy:return()=>e.getter()._def;case $e.ZodPromise:return mNt(e,n);case $e.ZodNaN:case $e.ZodNever:return aNt();case $e.ZodEffects:return ZTt(e,n);case $e.ZodAny:return wd();case $e.ZodUnknown:return bNt();case $e.ZodDefault:return GTt(e,n);case $e.ZodBranded:return wqe(e,n);case $e.ZodReadonly:return xNt(e,n);case $e.ZodCatch:return QTt(e,n);case $e.ZodPipeline:return hNt(e,n);case $e.ZodFunction:case $e.ZodVoid:case $e.ZodSymbol:return;default:return(r=>{})()}};function Ja(e,t,n=!1){var r;const a=t.seen.get(e);if(t.override){const c=(r=t.override)==null?void 0:r.call(t,e,t,a,n);if(c!==BTt)return c}if(a&&!n){const c=SNt(a,t);if(c!==void 0)return c}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const i=wNt(e,e.typeName,t),o=typeof i=="function"?Ja(i(),t):i;if(o&&ONt(e,t,o),t.postProcess){const c=t.postProcess(o,e,t);return s.jsonSchema=o,c}return s.jsonSchema=o,o}var SNt=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:zTt(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),wd()):t.$refStrategy==="seen"?wd():void 0}},ONt=(e,t,n)=>(e.description&&(n.description=e.description),n),kNt=e=>{const t=UTt(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,a])=>[a._def,{def:a._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},_Nt=(e,t)=>{var n;const r=kNt(t);let a=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[d,f])=>{var p;return{...u,[d]:(p=Ja(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:wd()}},{}):void 0;const s=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(n=Ja(e._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1))!=null?n:wd(),o=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;o!==void 0&&(i.title=o);const c=s===void 0?a?{...i,[r.definitionPath]:a}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...a,[s]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},ENt=_Nt;function CNt(e,t){var n;const r=(n=void 0)!=null?n:!1;return hle(()=>ENt(e,{$refStrategy:r?"root":"none"}),{validate:async a=>{const s=await e.safeParseAsync(a);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function jNt(e,t){var n;const r=(n=void 0)!=null?n:!1;return hle(()=>bD(GA(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async a=>{const s=await koe(e,a);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function TNt(e){return"_zod"in e}function Yp(e,t){return TNt(e)?jNt(e):CNt(e)}var Yee=Symbol.for("vercel.ai.schema");function M5(e){let t;return()=>(t==null&&(t=e()),t)}function hle(e,{validate:t}={}){return{[Yee]:!0,_type:void 0,[C$]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function NNt(e){return typeof e=="object"&&e!==null&&Yee in e&&e[Yee]===!0&&"jsonSchema"in e&&"validate"in e}function ANt(e){return e==null?hle({properties:{},additionalProperties:!1}):NNt(e)?e:typeof e=="function"?e():Yp(e)}function INt(e){return e?.replace(/\/$/,"")}var RNt={},_qe=VL({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/get-context.js"(e,t){var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(p,h)=>{for(var m in h)n(p,m,{get:h[m],enumerable:!0})},o=(p,h,m,g)=>{if(h&&typeof h=="object"||typeof h=="function")for(let v of a(h))!s.call(p,v)&&v!==m&&n(p,v,{get:()=>h[v],enumerable:!(g=r(h,v))||g.enumerable});return p},c=p=>o(n({},"__esModule",{value:!0}),p),u={};i(u,{SYMBOL_FOR_REQ_CONTEXT:()=>d,getContext:()=>f}),t.exports=c(u);var d=Symbol.for("@vercel/request-context");function f(){return globalThis[d]?.get?.()??{}}}}),PNt=VL({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(e,t){var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(m,g)=>{for(var v in g)n(m,v,{get:g[v],enumerable:!0})},o=(m,g,v,b)=>{if(g&&typeof g=="object"||typeof g=="function")for(let S of a(g))!s.call(m,S)&&S!==v&&n(m,S,{get:()=>g[S],enumerable:!(b=r(g,S))||b.enumerable});return m},c=m=>o(n({},"__esModule",{value:!0}),m),u={};i(u,{getVercelOidcToken:()=>p,getVercelOidcTokenSync:()=>h}),t.exports=c(u);var d=_qe(),f=v_t();async function p(){let m="",g;try{m=h()}catch(v){g=v}try{const[{getTokenPayload:v,isExpired:b},{refreshToken:S}]=await Promise.all([await Ge(()=>import("./token-util-RMHT2CPJ-VVUHOXBL-C3s4aDTd.js"),__vite__mapDeps([0,1,2]),import.meta.url),await Ge(()=>import("./token-APYSY3BW-RPVF55TR-DfAwCdBi.js"),__vite__mapDeps([3,1,2]),import.meta.url)]);(!m||b(v(m)))&&(await S(),m=h())}catch(v){let b=g instanceof Error?g.message:"";throw v instanceof Error&&(b=`${b}
59
+ ]`;continue}s+=a[u],a[u]==="\\"?i=!0:o&&a[u]==="]"?o=!1:!o&&a[u]==="["&&(o=!0)}return s}function kqe(e,t){var n,r,a,s,i,o;const c={type:"object",additionalProperties:(n=Ja(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===$e.ZodString&&((a=e.keyType._def.checks)!=null&&a.length)){const{type:u,...d}=Oqe(e.keyType._def,t);return{...c,propertyNames:d}}else{if(((s=e.keyType)==null?void 0:s._def.typeName)===$e.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===$e.ZodBranded&&e.keyType._def.type._def.typeName===$e.ZodString&&((o=e.keyType._def.type._def.checks)!=null&&o.length)){const{type:u,...d}=wqe(e.keyType._def,t);return{...c,propertyNames:d}}}return c}function nNt(e,t){if(t.mapStrategy==="record")return kqe(e,t);const n=Ja(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||wd(),r=Ja(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||wd();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function rNt(e){const t=e.values,r=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),a=Array.from(new Set(r.map(s=>typeof s)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:r}}function aNt(){return{not:wd()}}function sNt(){return{type:"null"}}var Zee={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function iNt(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in Zee&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((a,s)=>{const i=Zee[s._def.typeName];return i&&!a.includes(i)?[...a,i]:a},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((a,s)=>{const i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...a,i];case"bigint":return[...a,"integer"];case"object":if(s._def.value===null)return[...a,"null"];default:return a}},[]);if(r.length===n.length){const a=r.filter((s,i,o)=>o.indexOf(s)===i);return{type:a.length>1?a:a[0],enum:n.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,a)=>[...r,...a._def.values.filter(s=>!r.includes(s))],[])};return oNt(e,t)}var oNt=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,a)=>Ja(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${a}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function lNt(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Zee[e.innerType._def.typeName],"null"]};const n=Ja(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function cNt(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function uNt(e,t){const n={type:"object",properties:{}},r=[],a=e.shape();for(const i in a){let o=a[i];if(o===void 0||o._def===void 0)continue;const c=fNt(o),u=Ja(o._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(n.properties[i]=u,c||r.push(i))}r.length&&(n.required=r);const s=dNt(e,t);return s!==void 0&&(n.additionalProperties=s),n}function dNt(e,t){if(e.catchall._def.typeName!=="ZodNever")return Ja(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 fNt(e){try{return e.isOptional()}catch{return!0}}var pNt=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return Ja(e.innerType._def,t);const r=Ja(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:wd()},r]}:wd()},hNt=(e,t)=>{if(t.pipeStrategy==="input")return Ja(e.in._def,t);if(t.pipeStrategy==="output")return Ja(e.out._def,t);const n=Ja(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Ja(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(a=>a!==void 0)}};function mNt(e,t){return Ja(e.type._def,t)}function gNt(e,t){const r={type:"array",uniqueItems:!0,items:Ja(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(r.minItems=e.minSize.value),e.maxSize&&(r.maxItems=e.maxSize.value),r}function vNt(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Ja(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ja(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Ja(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function yNt(){return{not:wd()}}function bNt(){return wd()}var xNt=(e,t)=>Ja(e.innerType._def,t),wNt=(e,t,n)=>{switch(t){case $e.ZodString:return Oqe(e,n);case $e.ZodNumber:return cNt(e);case $e.ZodObject:return uNt(e,n);case $e.ZodBigInt:return qTt(e);case $e.ZodBoolean:return HTt();case $e.ZodDate:return Sqe(e,n);case $e.ZodUndefined:return yNt();case $e.ZodNull:return sNt();case $e.ZodArray:return VTt(e,n);case $e.ZodUnion:case $e.ZodDiscriminatedUnion:return iNt(e,n);case $e.ZodIntersection:return KTt(e,n);case $e.ZodTuple:return vNt(e,n);case $e.ZodRecord:return kqe(e,n);case $e.ZodLiteral:return JTt(e);case $e.ZodEnum:return YTt(e);case $e.ZodNativeEnum:return rNt(e);case $e.ZodNullable:return lNt(e,n);case $e.ZodOptional:return pNt(e,n);case $e.ZodMap:return nNt(e,n);case $e.ZodSet:return gNt(e,n);case $e.ZodLazy:return()=>e.getter()._def;case $e.ZodPromise:return mNt(e,n);case $e.ZodNaN:case $e.ZodNever:return aNt();case $e.ZodEffects:return ZTt(e,n);case $e.ZodAny:return wd();case $e.ZodUnknown:return bNt();case $e.ZodDefault:return GTt(e,n);case $e.ZodBranded:return wqe(e,n);case $e.ZodReadonly:return xNt(e,n);case $e.ZodCatch:return QTt(e,n);case $e.ZodPipeline:return hNt(e,n);case $e.ZodFunction:case $e.ZodVoid:case $e.ZodSymbol:return;default:return(r=>{})()}};function Ja(e,t,n=!1){var r;const a=t.seen.get(e);if(t.override){const c=(r=t.override)==null?void 0:r.call(t,e,t,a,n);if(c!==BTt)return c}if(a&&!n){const c=SNt(a,t);if(c!==void 0)return c}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const i=wNt(e,e.typeName,t),o=typeof i=="function"?Ja(i(),t):i;if(o&&ONt(e,t,o),t.postProcess){const c=t.postProcess(o,e,t);return s.jsonSchema=o,c}return s.jsonSchema=o,o}var SNt=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:zTt(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),wd()):t.$refStrategy==="seen"?wd():void 0}},ONt=(e,t,n)=>(e.description&&(n.description=e.description),n),kNt=e=>{const t=UTt(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,a])=>[a._def,{def:a._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},_Nt=(e,t)=>{var n;const r=kNt(t);let a=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[d,f])=>{var p;return{...u,[d]:(p=Ja(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:wd()}},{}):void 0;const s=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(n=Ja(e._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1))!=null?n:wd(),o=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;o!==void 0&&(i.title=o);const c=s===void 0?a?{...i,[r.definitionPath]:a}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...a,[s]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},ENt=_Nt;function CNt(e,t){var n;const r=(n=void 0)!=null?n:!1;return hle(()=>ENt(e,{$refStrategy:r?"root":"none"}),{validate:async a=>{const s=await e.safeParseAsync(a);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function jNt(e,t){var n;const r=(n=void 0)!=null?n:!1;return hle(()=>bD(GA(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async a=>{const s=await koe(e,a);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function TNt(e){return"_zod"in e}function Yp(e,t){return TNt(e)?jNt(e):CNt(e)}var Yee=Symbol.for("vercel.ai.schema");function M5(e){let t;return()=>(t==null&&(t=e()),t)}function hle(e,{validate:t}={}){return{[Yee]:!0,_type:void 0,[C$]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function NNt(e){return typeof e=="object"&&e!==null&&Yee in e&&e[Yee]===!0&&"jsonSchema"in e&&"validate"in e}function ANt(e){return e==null?hle({properties:{},additionalProperties:!1}):NNt(e)?e:typeof e=="function"?e():Yp(e)}function INt(e){return e?.replace(/\/$/,"")}var RNt={},_qe=VL({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/get-context.js"(e,t){var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(p,h)=>{for(var m in h)n(p,m,{get:h[m],enumerable:!0})},o=(p,h,m,g)=>{if(h&&typeof h=="object"||typeof h=="function")for(let v of a(h))!s.call(p,v)&&v!==m&&n(p,v,{get:()=>h[v],enumerable:!(g=r(h,v))||g.enumerable});return p},c=p=>o(n({},"__esModule",{value:!0}),p),u={};i(u,{SYMBOL_FOR_REQ_CONTEXT:()=>d,getContext:()=>f}),t.exports=c(u);var d=Symbol.for("@vercel/request-context");function f(){return globalThis[d]?.get?.()??{}}}}),PNt=VL({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(e,t){var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(m,g)=>{for(var v in g)n(m,v,{get:g[v],enumerable:!0})},o=(m,g,v,b)=>{if(g&&typeof g=="object"||typeof g=="function")for(let S of a(g))!s.call(m,S)&&S!==v&&n(m,S,{get:()=>g[S],enumerable:!(b=r(g,S))||b.enumerable});return m},c=m=>o(n({},"__esModule",{value:!0}),m),u={};i(u,{getVercelOidcToken:()=>p,getVercelOidcTokenSync:()=>h}),t.exports=c(u);var d=_qe(),f=v_t();async function p(){let m="",g;try{m=h()}catch(v){g=v}try{const[{getTokenPayload:v,isExpired:b},{refreshToken:S}]=await Promise.all([await Ge(()=>import("./token-util-RMHT2CPJ-VVUHOXBL-BmjNbOmW.js"),__vite__mapDeps([0,1,2]),import.meta.url),await Ge(()=>import("./token-APYSY3BW-RPVF55TR-CkhyJ5bb.js"),__vite__mapDeps([3,1,2]),import.meta.url)]);(!m||b(v(m)))&&(await S(),m=h())}catch(v){let b=g instanceof Error?g.message:"";throw v instanceof Error&&(b=`${b}
60
60
  ${v.message}`),b?new f.VercelOidcTokenError(b):v}return m}function h(){const m=(0,d.getContext)().headers?.["x-vercel-oidc-token"]??RNt.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}}}),Eqe=VL({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/index.js"(e,t){var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(p,h)=>{for(var m in h)n(p,m,{get:h[m],enumerable:!0})},o=(p,h,m,g)=>{if(h&&typeof h=="object"||typeof h=="function")for(let v of a(h))!s.call(p,v)&&v!==m&&n(p,v,{get:()=>h[v],enumerable:!(g=r(h,v))||g.enumerable});return p},c=p=>o(n({},"__esModule",{value:!0}),p),u={};i(u,{getContext:()=>f.getContext,getVercelOidcToken:()=>d.getVercelOidcToken,getVercelOidcTokenSync:()=>d.getVercelOidcTokenSync}),t.exports=c(u);var d=PNt(),f=_qe()}}),MNt=d9e(Eqe()),DNt=d9e(Eqe()),$Nt="vercel.ai.gateway.error",M7=Symbol.for($Nt),z0e,B0e,Tc=class Cqe extends(B0e=Error,z0e=M7,B0e){constructor({message:t,statusCode:n=500,cause:r}){super(t),this[z0e]=!0,this.statusCode=n,this.cause=r}static isInstance(t){return Cqe.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&M7 in t&&t[M7]===!0}},jqe="GatewayAuthenticationError",LNt=`vercel.ai.gateway.error.${jqe}`,U0e=Symbol.for(LNt),V0e,q0e,Tqe=class Nqe extends(q0e=Tc,V0e=U0e,q0e){constructor({message:t="Authentication failed",statusCode:n=401,cause:r}={}){super({message:t,statusCode:n,cause:r}),this[V0e]=!0,this.name=jqe,this.type="authentication_error"}static isInstance(t){return Tc.hasMarker(t)&&U0e in t}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:r="Authentication failed",statusCode:a=401,cause:s}){let i;return t?i=`AI Gateway authentication failed: Invalid API key.
61
61
 
62
62
  Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
@@ -205,7 +205,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
205
205
  constructor(\${params}) {
206
206
  \${}
207
207
  }
208
- }`,{label:"class",detail:"definition",type:"keyword"}),Yc('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Yc('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Zrt=Ode.concat([Yc("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Yc("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Yc("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),O_e=new Ket,Yrt=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function oC(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const Fon=["FunctionDeclaration"],zon={FunctionDeclaration:oC("function"),ClassDeclaration:oC("class"),ClassExpression:()=>!0,EnumDeclaration:oC("constant"),TypeAliasDeclaration:oC("type"),NamespaceDeclaration:oC("namespace"),VariableDefinition(e,t){e.matchContext(Fon)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function Xrt(e,t){let n=O_e.get(t);if(n)return n;let r=[],a=!0;function s(i,o){let c=e.sliceString(i.from,i.to);r.push({label:c,type:o})}return t.cursor(Za.IncludeAnonymous).iterate(i=>{if(a)a=!1;else if(i.name){let o=zon[i.name];if(o&&o(i,s)||Yrt.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of Xrt(e,i.node))r.push(o);return!1}}),O_e.set(t,r),r}const M3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,kde=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Krt(e){let t=ps(e.state).resolveInner(e.pos,-1);if(kde.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&M3.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let a=t;a;a=a.parent)Yrt.has(a.name)&&(r=r.concat(Xrt(e.state.doc,a)));return{options:r,from:n?t.from:e.pos,validFor:M3}}function bU(e,t,n){var r;let a=[];for(;;){let s=t.firstChild,i;if(s?.name=="VariableName")return a.push(e(s)),{path:a.reverse(),name:n};if(s?.name=="MemberExpression"&&((r=i=s.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")a.push(e(i)),t=s;else return null}}function Jrt(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=ps(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?bU(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?bU(t,n.parent,""):kde.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&M3.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?bU(t,n,""):e.explicit?{path:[],name:""}:null}function Bon(e,t){let n=e,r=[],a=new Set;for(let s=0;;s++){for(let o of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(o)||a.has(o))continue;a.add(o);let c;try{c=n[o]}catch{continue}r.push({label:o,type:typeof c=="function"?/^[A-Z]/.test(o)?"class":t?"function":"method":t?"variable":"property",boost:-s})}let i=Object.getPrototypeOf(e);if(!i)return r;e=i}}function Uon(e){let t=new Map;return n=>{let r=Jrt(n);if(!r)return null;let a=e;for(let i of r.path)if(a=a[i],!a)return null;let s=t.get(a);return s||t.set(a,s=Bon(a,!r.path.length)),{from:n.pos-r.name.length,options:s,validFor:M3}}}const Rf=tw.define({name:"javascript",parser:Lon.configure({props:[Yw.add({IfStatement:yO({except:/^\s*({|else\b)/}),TryStatement:yO({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Lrn,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:$rn({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":yO({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":tde,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,r=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?e.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),eat={test:e=>/^JSX/.test(e.name),facet:tF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},_de=Rf.configure({dialect:"ts"},"typescript"),Ede=Rf.configure({dialect:"jsx",props:[Kue.add(e=>e.isTop?[eat]:void 0)]}),Cde=Rf.configure({dialect:"jsx ts",props:[Kue.add(e=>e.isTop?[eat]:void 0)]},"typescript");let tat=e=>({label:e,type:"keyword"});const nat="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(tat),Von=nat.concat(["declare","implements","private","protected","public"].map(tat));function D3(e={}){let t=e.jsx?e.typescript?Cde:Ede:e.typescript?_de:Rf,n=e.typescript?Zrt.concat(Von):Ode.concat(nat);return new rw(t,[Rf.data.of({autocomplete:Oan(kde,Xnt(n))}),Rf.data.of({autocomplete:Krt}),e.jsx?rat:[]])}function qon(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 k_e(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return e.sliceString(r.from,Math.min(r.to,n));return""}const Hon=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),rat=vt.inputHandler.of((e,t,n,r,a)=>{if((Hon?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!Rf.isActiveAt(e.state,t,-1))return!1;let s=a(),{state:i}=s,o=i.changeByRange(c=>{var u;let{head:d}=c,f=ps(i).resolveInner(d-1,-1),p;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,m=h.parent;if(m&&h.from==d-2&&((p=k_e(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${p}>`;return{range:tt.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let h=qon(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(p=k_e(i.doc,h,d)))return{range:c,changes:{from:d,insert:`</${p}>`}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([s,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function Qon(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((n,r)=>{var a;!((a=n.meta.docs)===null||a===void 0)&&a.recommended&&(t.rules[r]=2)})),n=>{let{state:r}=n,a=[];for(let{from:s,to:i}of Rf.findRegions(r)){let o=r.doc.lineAt(s),c={line:o.number-1,col:s-o.from,pos:s};for(let u of e.verify(r.sliceDoc(s,i),t))a.push(Won(u,r.doc,c))}return a}}function __e(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function Won(e,t,n){let r=__e(e.line,e.column,t,n),a={from:r,to:e.endLine!=null&&e.endColumn!=1?__e(e.endLine,e.endColumn,t,n):r,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:s,text:i}=e.fix,o=s[0]+n.pos-r,c=s[1]+n.pos-r;a.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+o,to:d+c,insert:i},scrollIntoView:!0})}}]}return a}const QM=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:rat,completionPath:Jrt,esLint:Qon,javascript:D3,javascriptLanguage:Rf,jsxLanguage:Ede,localCompletionSource:Krt,scopeCompletionSource:Uon,snippets:Ode,tsxLanguage:Cde,typescriptLanguage:_de,typescriptSnippets:Zrt},Symbol.toStringTag,{value:"Module"})),lC=["_blank","_self","_top","_parent"],xU=["ascii","utf-8","utf-16","latin1","latin1"],wU=["get","post","put","delete"],SU=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],qu=["true","false"],An={},Gon={a:{attrs:{href:null,ping:null,type:null,media:null,target:lC,hreflang:null}},abbr:An,address:An,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:An,aside:An,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:An,base:{attrs:{href:null,target:lC}},bdi:An,bdo:An,blockquote:{attrs:{cite:null}},body:An,br:An,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:SU,formmethod:wU,formnovalidate:["novalidate"],formtarget:lC,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:An,center:An,cite:An,code:An,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:An,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:An,div:An,dl:An,dt:An,em:An,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:An,figure:An,footer:An,form:{attrs:{action:null,name:null,"accept-charset":xU,autocomplete:["on","off"],enctype:SU,method:wU,novalidate:["novalidate"],target:lC}},h1:An,h2:An,h3:An,h4:An,h5:An,h6:An,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:An,hgroup:An,hr:An,html:{attrs:{manifest:null}},i:An,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:SU,formmethod:wU,formnovalidate:["novalidate"],formtarget:lC,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:An,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:An,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:An,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:xU,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:An,noscript:An,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:An,param:{attrs:{name:null,value:null}},pre:An,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:An,rt:An,ruby:An,samp:An,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:xU}},section:An,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:An,source:{attrs:{src:null,type:null,media:null}},span:An,strong:An,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:An,summary:An,sup:An,table:An,tbody:An,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:An,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:An,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:An,time:{attrs:{datetime:null}},title:An,tr:An,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:An,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:An},aat={accesskey:null,class:null,contenteditable:qu,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:qu,autocorrect:qu,autocapitalize:qu,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":qu,"aria-autocomplete":["inline","list","both","none"],"aria-busy":qu,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":qu,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":qu,"aria-hidden":qu,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":qu,"aria-multiselectable":qu,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":qu,"aria-relevant":null,"aria-required":qu,"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},sat="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 sat)aat[e]=null;let EN=class{constructor(t,n){this.tags={...Gon,...t},this.globalAttrs={...aat,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};EN.default=new EN;function mk(e,t,n=e.length){if(!t)return"";let r=t.firstChild,a=r&&r.getChild("TagName");return a?e.sliceString(a.from,Math.min(a.to,n)):""}function gk(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function iat(e,t,n){let r=n.tags[mk(e,gk(t))];return r?.children||n.allTags}function jde(e,t){let n=[];for(let r=gk(t);r&&!r.type.isTop;r=gk(r.parent)){let a=mk(e,r);if(a&&r.lastChild.name=="CloseTag")break;a&&n.indexOf(a)<0&&(t.name=="EndTag"||t.from>=r.firstChild.to)&&n.push(a)}return n}const oat=/^[:\-\.\w\u00b7-\uffff]*$/;function E_e(e,t,n,r,a){let s=/\s*>/.test(e.sliceDoc(a,a+5))?"":">",i=gk(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:a,options:iat(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(jde(e.doc,n).map((o,c)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function C_e(e,t,n,r){let a=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:jde(e.doc,t).map((s,i)=>({label:s,apply:s+a,type:"type",boost:99-i})),validFor:oat}}function Zon(e,t,n,r){let a=[],s=0;for(let i of iat(e.doc,n,t))a.push({label:"<"+i,type:"type"});for(let i of jde(e.doc,n))a.push({label:"</"+i+">",type:"type",boost:99-s++});return{from:r,to:r,options:a,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Yon(e,t,n,r,a){let s=gk(n),i=s?t.tags[mk(e.doc,s)]:null,o=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?o:o.length?o.concat(t.globalAttrNames):t.globalAttrNames;return{from:r,to:a,options:c.map(u=>({label:u,type:"property"})),validFor:oat}}function Xon(e,t,n,r,a){var s;let i=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=gk(n),p=f?t.tags[mk(e.doc,f)]:null;d=p?.attrs&&p.attrs[u]}if(d){let f=e.sliceDoc(r,a).toLowerCase(),p='"',h='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",h=e.sliceDoc(a,a+1)==f[0]?"":f[0],f=f.slice(1),r++):c=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:p+m+h,type:"constant"})}}return{from:r,to:a,options:o,validFor:c}}function lat(e,t){let{state:n,pos:r}=t,a=ps(n).resolveInner(r,-1),s=a.resolve(r);for(let i=r,o;s==a&&(o=a.childBefore(i));){let c=o.lastChild;if(!c||!c.type.isError||c.from<c.to)break;s=a=o,i=c.from}return a.name=="TagName"?a.parent&&/CloseTag$/.test(a.parent.name)?C_e(n,a,a.from,r):E_e(n,e,a,a.from,r):a.name=="StartTag"||a.name=="IncompleteTag"?E_e(n,e,a,r,r):a.name=="StartCloseTag"||a.name=="IncompleteCloseTag"?C_e(n,a,r,r):a.name=="OpenTag"||a.name=="SelfClosingTag"||a.name=="AttributeName"?Yon(n,e,a,a.name=="AttributeName"?a.from:r,r):a.name=="Is"||a.name=="AttributeValue"||a.name=="UnquotedAttributeValue"?Xon(n,e,a,a.name=="Is"?r:a.from,r):t.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?Zon(n,e,a,r):null}function cat(e){return lat(EN.default,e)}function uat(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new EN(t,n):EN.default;return a=>lat(r,a)}const Kon=Rf.parser.configure({top:"SingleExpression"}),dat=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:_de.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ede.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Cde.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Kon},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:Rf.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:_N.parser}],fat=[{name:"style",parser:_N.parser.configure({top:"Styles"})}].concat(sat.map(e=>({name:e,parser:Rf.parser}))),pat=tw.define({name:"html",parser:Cin.configure({props:[Yw.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,n;for(let r=e.node;;){let a=r.lastChild;if(!a||a.name!="Element"||a.to!=r.to)break;t=r=a}return t&&!((n=t.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),Xw.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:n.name=="CloseTag"?n.from:e.to}}}),qnt.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Kj=pat.configure({wrap:Frt(dat,fat)});function hat(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=Frt((e.nestedLanguages||[]).concat(dat),(e.nestedAttributes||[]).concat(fat)));let r=n?pat.configure({wrap:n,dialect:t}):t?Kj.configure({dialect:t}):Kj;return new rw(r,[Kj.data.of({autocomplete:uat(e)}),e.autoCloseTags!==!1?mat:[],D3().support,Wrt().support])}const j_e=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),mat=vt.inputHandler.of((e,t,n,r,a)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!Kj.isActiveAt(e.state,t,-1))return!1;let s=a(),{state:i}=s,o=i.changeByRange(c=>{var u,d,f;let p=i.doc.sliceString(c.from-1,c.to)==r,{head:h}=c,m=ps(i).resolveInner(h,-1),g;if(p&&r==">"&&m.name=="EndTag"){let v=m.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=mk(i.doc,v.parent,h))&&!j_e.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`</${g}>`;return{range:c,changes:{from:h,to:b,insert:S}}}}else if(p&&r=="/"&&m.name=="IncompleteCloseTag"){let v=m.parent;if(m.from==h-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=mk(i.doc,v,h))&&!j_e.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`${g}>`;return{range:tt.cursor(h+S.length,-1),changes:{from:h,to:b,insert:S}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([s,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Jon=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:mat,html:hat,htmlCompletionSource:cat,htmlCompletionSourceWith:uat,htmlLanguage:Kj},Symbol.toStringTag,{value:"Module"})),gat=tF({commentTokens:{block:{open:"<!--",close:"-->"}}}),vat=new ur,yat=Tsn.configure({props:[Xw.add(e=>!e.is("Block")||e.is("Document")||Xne(e)!=null||eln(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),vat.add(Xne),Yw.add({Document:()=>null}),By.add({Document:gat})]});function Xne(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function eln(e){return e.name=="OrderedList"||e.name=="BulletList"}function tln(e,t){let n=e;for(;;){let r=n.nextSibling,a;if(!r||(a=Xne(r.type))!=null&&a<=t)break;n=r}return n.to}const nln=Int.of((e,t,n)=>{for(let r=ps(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let a=r.type.prop(vat);if(a==null)continue;let s=tln(r,a);if(s>n)return{from:n,to:s}}return null});function Tde(e){return new ld(gat,e,[],"markdown")}const bat=Tde(yat),rln=yat.configure([zsn,Usn,Bsn,Vsn,{props:[Xw.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),iw=Tde(rln);function aln(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=He.matchLanguageName(e,n,!0),r instanceof He)return r.support?r.support.language.parser:nw.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class OU{constructor(t,n,r,a,s,i,o){this.node=t,this.from=n,this.to=r,this.spaceBefore=a,this.spaceAfter=s,this.type=i,this.item=o}blank(t,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;r.length<t;)r+=" ";return r}else{for(let a=this.to-this.from-r.length-this.spaceAfter.length;a>0;a--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+wat(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function xat(e,t){let n=[],r=[];for(let a=e;a;a=a.parent){if(a.name=="FencedCode")return r;(a.name=="ListItem"||a.name=="Blockquote")&&n.push(a)}for(let a=n.length-1;a>=0;a--){let s=n[a],i,o=t.lineAt(s.from),c=s.from-o.from;if(s.name=="Blockquote"&&(i=/^ *>( ?)/.exec(o.text.slice(c))))r.push(new OU(s,c,c+i[0].length,"",i[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(o.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),r.push(new OU(s.parent,c,c+d,i[1],u,i[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(c)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=i[2];i[3]&&(f+=i[3].replace(/[xX]/," ")),r.push(new OU(s.parent,c,c+d,i[1],u,f,s))}}return r}function wat(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function kU(e,t,n,r=0){for(let a=-1,s=e;;){if(s.name=="ListItem"){let o=wat(s,t),c=+o[2];if(a>=0){if(c!=a+1)return;n.push({from:s.from+o[1].length,to:s.from+o[0].length,insert:String(a+2+r)})}a=c}let i=s.nextSibling;if(!i)break;s=i}}function Nde(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(k_)!=" ")return e;let r=Vp(e,4,n),a="";for(let s=r;s>0;)s>=4?(a+=" ",s-=4):(a+=" ",s--);return a+e.slice(n)}const Sat=(e={})=>({state:t,dispatch:n})=>{let r=ps(t),{doc:a}=t,s=null,i=t.changeByRange(o=>{if(!o.empty||!iw.isActiveAt(t,o.from,-1)&&!iw.isActiveAt(t,o.from,1))return s={range:o};let c=o.from,u=a.lineAt(c),d=xat(r.resolveInner(c,-1),a);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:o};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:o};let p=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&p){let b=f.node.firstChild,S=f.node.getChild("ListItem","ListItem");if(b.to>=c||S&&S.to<c||u.from>0&&!/[^\s>]/.test(a.lineAt(u.from-1).text)||e.nonTightLists===!1){let O=d.length>1?d[d.length-2]:null,k,E="";O&&O.item?(k=u.from+O.from,E=O.marker(a,1)):k=u.from+(O?O.to:0);let C=[{from:k,to:c,insert:E}];return f.node.name=="OrderedList"&&kU(f.item,a,C,-2),O&&O.node.name=="OrderedList"&&kU(O.item,a,C),{range:tt.cursor(k+E.length),changes:C}}else{let O=N_e(d,t,u);return{range:tt.cursor(c+O.length+1),changes:{from:u.from,insert:O+t.lineBreak}}}}if(f.node.name=="Blockquote"&&p&&u.from){let b=a.lineAt(u.from-1),S=/>\s*$/.exec(b.text);if(S&&S.index==f.from){let O=t.changes([{from:b.from+S.index,to:b.to},{from:u.from+f.from,to:u.to}]);return{range:o.map(O),changes:O}}}let h=[];f.node.name=="OrderedList"&&kU(f.item,a,h);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let b=0,S=d.length-1;b<=S;b++)g+=b==S&&!m?d[b].marker(a,1):d[b].blank(b<S?Vp(u.text,4,d[b+1].from)-g.length:null);let v=c;for(;v>u.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return g=Nde(g,t),sln(f.node,t.doc)&&(g=N_e(d,t,u)+t.lineBreak+g),h.push({from:v,to:c,insert:t.lineBreak+g}),{range:tt.cursor(v+g.length+1),changes:h}});return s?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},Oat=Sat();function T_e(e){return e.name=="QuoteMark"||e.name=="ListMark"}function sln(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let a=t.lineAt(n.to),s=t.lineAt(r.from),i=/^[\s>]*$/.test(a.text);return a.number+(i?0:1)<s.number}function N_e(e,t,n){let r="";for(let a=0,s=e.length-2;a<=s;a++)r+=e[a].blank(a<s?Vp(n.text,4,e[a+1].from)-r.length:null,a<s);return Nde(r,t)}function iln(e,t){let n=e.resolveInner(t,-1),r=t;T_e(n)&&(r=n.from,n=n.parent);for(let a;a=n.childBefore(r);)if(T_e(a))r=a.from;else if(a.name=="OrderedList"||a.name=="BulletList")n=a.lastChild,r=n.to;else break;return n}const kat=({state:e,dispatch:t})=>{let n=ps(e),r=null,a=e.changeByRange(s=>{let i=s.from,{doc:o}=e;if(s.empty&&iw.isActiveAt(e,s.from)){let c=o.lineAt(i),u=xat(iln(n,i),o);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-c.from>f&&!/\S/.test(c.text.slice(f,i-c.from)))return{range:tt.cursor(c.from+f),changes:{from:c.from+f,to:i}};if(i-c.from==f&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let p=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let h=d.blank(Vp(c.text,4,d.to)-Vp(c.text,4,d.from));return p==c.from&&(h=Nde(h,e)),{range:tt.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<i)return{range:tt.cursor(p),changes:{from:p,to:i}}}}}return r={range:s}});return r?!1:(t(e.update(a,{scrollIntoView:!0,userEvent:"delete"})),!0)},_at=[{key:"Enter",run:Oat},{key:"Backspace",run:kat}],Eat=hat({matchClosingTags:!1});function Ade(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:a}=bat,completeHTMLTags:s=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=Eat}=e;if(!(a instanceof sF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[o.support,nln],d;i&&u.push(Cat),n instanceof rw?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?aln(t,d):void 0;c.push(Asn({codeParser:f,htmlParser:o.language.parser})),r&&u.push(Jp.high(O_.of(_at)));let p=Tde(a.configure(c));return s&&u.push(p.data.of({autocomplete:oln})),new rw(p,u)}function oln(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let a=ps(t).resolveInner(n,-1);for(;a&&!a.type.isTop;){if(a.name=="CodeBlock"||a.name=="FencedCode"||a.name=="ProcessingInstructionBlock"||a.name=="CommentBlock"||a.name=="Link"||a.name=="Image")return null;a=a.parent}return{from:n-r[0].length,to:n,options:lln(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let _U=null;function lln(){if(_U)return _U;let e=cat(new ode(Pr.create({extensions:Eat}),0,!0));return _U=e?e.options:[]}const cln=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Cat=vt.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let a=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!a||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(a)||(/^www\./.test(a)&&(a="https://"+a),!iw.isActiveAt(t.state,r.from,1)))return!1;let s=ps(t.state),i=!1;return s.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||cln.test(o.name))&&(i=!0)},leave:o=>{o.to<r.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${a})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),uln=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:bat,deleteMarkupBackward:kat,insertNewlineContinueMarkup:Oat,insertNewlineContinueMarkupCommand:Sat,markdown:Ade,markdownKeymap:_at,markdownLanguage:iw,pasteURLAsLink:Cat},Symbol.toStringTag,{value:"Module"}));function dt(e){return new rw(rde.define(e))}function fy(e){return Ge(()=>import("./index-aXMdg2xE.js"),__vite__mapDeps([4,2]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const jat=[He.of({name:"C",extensions:["c","h","ino"],load(){return Ge(()=>import("./index-BBkPM25S.js"),__vite__mapDeps([5,2]),import.meta.url).then(e=>e.cpp())}}),He.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ge(()=>import("./index-BBkPM25S.js"),__vite__mapDeps([5,2]),import.meta.url).then(e=>e.cpp())}}),He.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return fy("Cassandra")}}),He.of({name:"CSS",extensions:["css"],load(){return Ge(()=>Promise.resolve().then(()=>oon),void 0,import.meta.url).then(e=>e.css())}}),He.of({name:"Go",extensions:["go"],load(){return Ge(()=>import("./index-DwNTyCh7.js"),__vite__mapDeps([6,2]),import.meta.url).then(e=>e.go())}}),He.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ge(()=>Promise.resolve().then(()=>Jon),void 0,import.meta.url).then(e=>e.html())}}),He.of({name:"Java",extensions:["java"],load(){return Ge(()=>import("./index-Di7jABOd.js"),__vite__mapDeps([7,2]),import.meta.url).then(e=>e.java())}}),He.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ge(()=>Promise.resolve().then(()=>QM),void 0,import.meta.url).then(e=>e.javascript())}}),He.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ge(()=>import("./index-CutfL3UQ.js"),__vite__mapDeps([8,2]),import.meta.url).then(e=>e.jinja())}}),He.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ge(()=>Promise.resolve().then(()=>wan),void 0,import.meta.url).then(e=>e.json())}}),He.of({name:"JSX",extensions:["jsx"],load(){return Ge(()=>Promise.resolve().then(()=>QM),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),He.of({name:"LESS",extensions:["less"],load(){return Ge(()=>import("./index-nRQDe8wP.js"),__vite__mapDeps([9,2]),import.meta.url).then(e=>e.less())}}),He.of({name:"Liquid",extensions:["liquid"],load(){return Ge(()=>import("./index-Ct0jFr6W.js"),__vite__mapDeps([10,2]),import.meta.url).then(e=>e.liquid())}}),He.of({name:"MariaDB SQL",load(){return fy("MariaSQL")}}),He.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ge(()=>Promise.resolve().then(()=>uln),void 0,import.meta.url).then(e=>e.markdown())}}),He.of({name:"MS SQL",load(){return fy("MSSQL")}}),He.of({name:"MySQL",load(){return fy("MySQL")}}),He.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ge(()=>import("./index-Buo2H4BG.js"),__vite__mapDeps([11,2]),import.meta.url).then(e=>e.php())}}),He.of({name:"PLSQL",extensions:["pls"],load(){return fy("PLSQL")}}),He.of({name:"PostgreSQL",load(){return fy("PostgreSQL")}}),He.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ge(()=>import("./index-BvRYQXpd.js"),__vite__mapDeps([12,2]),import.meta.url).then(e=>e.python())}}),He.of({name:"Rust",extensions:["rs"],load(){return Ge(()=>import("./index-C-E-5lui.js"),__vite__mapDeps([13,2]),import.meta.url).then(e=>e.rust())}}),He.of({name:"Sass",extensions:["sass"],load(){return Ge(()=>import("./index-B8KEGxbu.js"),__vite__mapDeps([14,2]),import.meta.url).then(e=>e.sass({indented:!0}))}}),He.of({name:"SCSS",extensions:["scss"],load(){return Ge(()=>import("./index-B8KEGxbu.js"),__vite__mapDeps([14,2]),import.meta.url).then(e=>e.sass())}}),He.of({name:"SQL",extensions:["sql"],load(){return fy("StandardSQL")}}),He.of({name:"SQLite",load(){return fy("SQLite")}}),He.of({name:"TSX",extensions:["tsx"],load(){return Ge(()=>Promise.resolve().then(()=>QM),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),He.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ge(()=>Promise.resolve().then(()=>QM),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),He.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ge(()=>import("./index-QuFJB9jg.js"),__vite__mapDeps([15,2]),import.meta.url).then(e=>e.wast())}}),He.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ge(()=>import("./index-BAQr-ni3.js"),__vite__mapDeps([16,2]),import.meta.url).then(e=>e.xml())}}),He.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ge(()=>import("./index-B0Ziicix.js"),__vite__mapDeps([17,2]),import.meta.url).then(e=>e.yaml())}}),He.of({name:"APL",extensions:["dyalog","apl"],load(){return Ge(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>dt(e.apl))}}),He.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ge(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>dt(e.asciiArmor))}}),He.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ge(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>dt(e.asn1({})))}}),He.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ge(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>dt(e.asterisk))}}),He.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ge(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>dt(e.brainfuck))}}),He.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ge(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>dt(e.cobol))}}),He.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.csharp))}}),He.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>dt(e.clojure))}}),He.of({name:"ClojureScript",extensions:["cljs"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>dt(e.clojure))}}),He.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ge(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>dt(e.gss))}}),He.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ge(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>dt(e.cmake))}}),He.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ge(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>dt(e.coffeeScript))}}),He.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ge(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>dt(e.commonLisp))}}),He.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ge(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>dt(e.cypher))}}),He.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ge(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>dt(e.cython))}}),He.of({name:"Crystal",extensions:["cr"],load(){return Ge(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>dt(e.crystal))}}),He.of({name:"D",extensions:["d"],load(){return Ge(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>dt(e.d))}}),He.of({name:"Dart",extensions:["dart"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.dart))}}),He.of({name:"diff",extensions:["diff","patch"],load(){return Ge(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>dt(e.diff))}}),He.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ge(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([18,19]),import.meta.url).then(e=>dt(e.dockerFile))}}),He.of({name:"DTD",extensions:["dtd"],load(){return Ge(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>dt(e.dtd))}}),He.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ge(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>dt(e.dylan))}}),He.of({name:"EBNF",load(){return Ge(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>dt(e.ebnf))}}),He.of({name:"ECL",extensions:["ecl"],load(){return Ge(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>dt(e.ecl))}}),He.of({name:"edn",extensions:["edn"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>dt(e.clojure))}}),He.of({name:"Eiffel",extensions:["e"],load(){return Ge(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>dt(e.eiffel))}}),He.of({name:"Elm",extensions:["elm"],load(){return Ge(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>dt(e.elm))}}),He.of({name:"Erlang",extensions:["erl"],load(){return Ge(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>dt(e.erlang))}}),He.of({name:"Esper",load(){return Ge(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>dt(e.esper))}}),He.of({name:"Factor",extensions:["factor"],load(){return Ge(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([20,19]),import.meta.url).then(e=>dt(e.factor))}}),He.of({name:"FCL",load(){return Ge(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>dt(e.fcl))}}),He.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ge(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>dt(e.forth))}}),He.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ge(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>dt(e.fortran))}}),He.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>dt(e.fSharp))}}),He.of({name:"Gas",extensions:["s"],load(){return Ge(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>dt(e.gas))}}),He.of({name:"Gherkin",extensions:["feature"],load(){return Ge(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>dt(e.gherkin))}}),He.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ge(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>dt(e.groovy))}}),He.of({name:"Haskell",extensions:["hs"],load(){return Ge(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>dt(e.haskell))}}),He.of({name:"Haxe",extensions:["hx"],load(){return Ge(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>dt(e.haxe))}}),He.of({name:"HXML",extensions:["hxml"],load(){return Ge(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>dt(e.hxml))}}),He.of({name:"HTTP",load(){return Ge(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>dt(e.http))}}),He.of({name:"IDL",extensions:["pro"],load(){return Ge(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>dt(e.idl))}}),He.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ge(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>dt(e.jsonld))}}),He.of({name:"Julia",extensions:["jl"],load(){return Ge(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>dt(e.julia))}}),He.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.kotlin))}}),He.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ge(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>dt(e.liveScript))}}),He.of({name:"Lua",extensions:["lua"],load(){return Ge(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>dt(e.lua))}}),He.of({name:"mIRC",extensions:["mrc"],load(){return Ge(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>dt(e.mirc))}}),He.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ge(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>dt(e.mathematica))}}),He.of({name:"Modelica",extensions:["mo"],load(){return Ge(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>dt(e.modelica))}}),He.of({name:"MUMPS",extensions:["mps"],load(){return Ge(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>dt(e.mumps))}}),He.of({name:"Mbox",extensions:["mbox"],load(){return Ge(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>dt(e.mbox))}}),He.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ge(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>dt(e.nginx))}}),He.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ge(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([21,19]),import.meta.url).then(e=>dt(e.nsis))}}),He.of({name:"NTriples",extensions:["nt","nq"],load(){return Ge(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>dt(e.ntriples))}}),He.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.objectiveC))}}),He.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.objectiveCpp))}}),He.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>dt(e.oCaml))}}),He.of({name:"Octave",extensions:["m"],load(){return Ge(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>dt(e.octave))}}),He.of({name:"Oz",extensions:["oz"],load(){return Ge(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>dt(e.oz))}}),He.of({name:"Pascal",extensions:["p","pas"],load(){return Ge(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>dt(e.pascal))}}),He.of({name:"Perl",extensions:["pl","pm"],load(){return Ge(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>dt(e.perl))}}),He.of({name:"Pig",extensions:["pig"],load(){return Ge(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>dt(e.pig))}}),He.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ge(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>dt(e.powerShell))}}),He.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ge(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>dt(e.properties))}}),He.of({name:"ProtoBuf",extensions:["proto"],load(){return Ge(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>dt(e.protobuf))}}),He.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ge(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([22,23]),import.meta.url).then(e=>dt(e.pug))}}),He.of({name:"Puppet",extensions:["pp"],load(){return Ge(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>dt(e.puppet))}}),He.of({name:"Q",extensions:["q"],load(){return Ge(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>dt(e.q))}}),He.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ge(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>dt(e.r))}}),He.of({name:"RPM Changes",load(){return Ge(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>dt(e.rpmChanges))}}),He.of({name:"RPM Spec",extensions:["spec"],load(){return Ge(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>dt(e.rpmSpec))}}),He.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ge(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>dt(e.ruby))}}),He.of({name:"SAS",extensions:["sas"],load(){return Ge(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>dt(e.sas))}}),He.of({name:"Scala",extensions:["scala"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.scala))}}),He.of({name:"Scheme",extensions:["scm","ss"],load(){return Ge(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>dt(e.scheme))}}),He.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ge(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>dt(e.shell))}}),He.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ge(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>dt(e.sieve))}}),He.of({name:"Smalltalk",extensions:["st"],load(){return Ge(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>dt(e.smalltalk))}}),He.of({name:"Solr",load(){return Ge(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>dt(e.solr))}}),He.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>dt(e.sml))}}),He.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ge(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>dt(e.sparql))}}),He.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ge(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>dt(e.spreadsheet))}}),He.of({name:"Squirrel",extensions:["nut"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.squirrel))}}),He.of({name:"Stylus",extensions:["styl"],load(){return Ge(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>dt(e.stylus))}}),He.of({name:"Swift",extensions:["swift"],load(){return Ge(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>dt(e.swift))}}),He.of({name:"sTeX",load(){return Ge(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>dt(e.stex))}}),He.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ge(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>dt(e.stex))}}),He.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ge(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>dt(e.verilog))}}),He.of({name:"Tcl",extensions:["tcl"],load(){return Ge(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>dt(e.tcl))}}),He.of({name:"Textile",extensions:["textile"],load(){return Ge(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>dt(e.textile))}}),He.of({name:"TiddlyWiki",load(){return Ge(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>dt(e.tiddlyWiki))}}),He.of({name:"Tiki wiki",load(){return Ge(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>dt(e.tiki))}}),He.of({name:"TOML",extensions:["toml"],load(){return Ge(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>dt(e.toml))}}),He.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ge(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>dt(e.troff))}}),He.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ge(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>dt(e.ttcn))}}),He.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ge(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>dt(e.ttcnCfg))}}),He.of({name:"Turtle",extensions:["ttl"],load(){return Ge(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>dt(e.turtle))}}),He.of({name:"Web IDL",extensions:["webidl"],load(){return Ge(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>dt(e.webIDL))}}),He.of({name:"VB.NET",extensions:["vb"],load(){return Ge(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>dt(e.vb))}}),He.of({name:"VBScript",extensions:["vbs"],load(){return Ge(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>dt(e.vbScript))}}),He.of({name:"Velocity",extensions:["vtl"],load(){return Ge(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>dt(e.velocity))}}),He.of({name:"Verilog",extensions:["v"],load(){return Ge(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>dt(e.verilog))}}),He.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ge(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>dt(e.vhdl))}}),He.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ge(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>dt(e.xQuery))}}),He.of({name:"Yacas",extensions:["ys"],load(){return Ge(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>dt(e.yacas))}}),He.of({name:"Z80",extensions:["z80"],load(){return Ge(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>dt(e.z80))}}),He.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>dt(e.mscgen))}}),He.of({name:"Xù",extensions:["xu"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>dt(e.xu))}}),He.of({name:"MsGenny",extensions:["msgenny"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>dt(e.msgenny))}}),He.of({name:"Vue",extensions:["vue"],load(){return Ge(()=>import("./index-DF1HjQsf.js"),__vite__mapDeps([24,2]),import.meta.url).then(e=>e.vue())}}),He.of({name:"Angular Template",load(){return Ge(()=>import("./index-CN5NGcTu.js"),__vite__mapDeps([25,2]),import.meta.url).then(e=>e.angular())}})];var dln=e=>{var{theme:t,settings:n={},styles:r=[]}=e,a={".cm-gutters":{}},s={};n.background&&(s.backgroundColor=n.background),n.backgroundImage&&(s.backgroundImage=n.backgroundImage),n.foreground&&(s.color=n.foreground),n.fontSize&&(s.fontSize=n.fontSize),(n.background||n.foreground)&&(a["&"]=s),n.fontFamily&&(a["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(a[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(a[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(a[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(a[".cm-content"]={caretColor:n.caret},a[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var i={};n.gutterActiveForeground&&(i.color=n.gutterActiveForeground),n.lineHighlight&&(a[".cm-activeLine"]={backgroundColor:n.lineHighlight},i.backgroundColor=n.lineHighlight),a[".cm-activeLineGutter"]=i,n.selection&&(a["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(a["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var o=vt.theme(a,{dark:t==="dark"}),c=__.define(r),u=[o,nde(c)];return u},fln={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)"},pln=[{tag:he.comment,color:"#6272a4"},{tag:he.string,color:"#f1fa8c"},{tag:he.atom,color:"#bd93f9"},{tag:he.meta,color:"#f8f8f2"},{tag:[he.keyword,he.operator,he.tagName],color:"#ff79c6"},{tag:[he.function(he.propertyName),he.propertyName],color:"#66d9ef"},{tag:[he.definition(he.variableName),he.function(he.variableName),he.className,he.attributeName],color:"#50fa7b"},{tag:he.atom,color:"#bd93f9"}],iF=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return dln({theme:t,settings:wb({},fln,n),styles:[...pln,...r]})};iF();const hln=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Rde(e.state,n.from);return r.line?mln(e):r.block?vln(e):!1};function Ide(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let a=e(t,n);return a?(r(n.update(a)),!0):!1}}const mln=Ide(xln,0),gln=Ide(Tat,0),vln=Ide((e,t)=>Tat(e,t,bln(t)),0);function Rde(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const cC=50;function yln(e,{open:t,close:n},r,a){let s=e.sliceDoc(r-cC,r),i=e.sliceDoc(a,a+cC),o=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(i)[0].length,u=s.length-o;if(s.slice(u-t.length,u)==t&&i.slice(c,c+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:a+c,margin:c&&1}};let d,f;a-r<=2*cC?d=f=e.sliceDoc(r,a):(d=e.sliceDoc(r,r+cC),f=e.sliceDoc(a-cC,a));let p=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(f)[0].length,m=f.length-h-n.length;return d.slice(p,p+t.length)==t&&f.slice(m,m+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(d.charAt(p+t.length))?1:0},close:{pos:a-h-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function bln(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),a=n.to<=r.to?r:e.doc.lineAt(n.to);a.from>r.from&&a.from==n.to&&(a=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>r.from?t[s].to=a.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:a.to})}return t}function Tat(e,t,n=t.selection.ranges){let r=n.map(s=>Rde(t,s.from).block);if(!r.every(s=>s))return null;let a=n.map((s,i)=>yln(t,r[i],s.from,s.to));if(e!=2&&!a.every(s=>s))return{changes:t.changes(n.map((s,i)=>a[i]?[]:[{from:s.from,insert:r[i].open+" "},{from:s.to,insert:" "+r[i].close}]))};if(e!=1&&a.some(s=>s)){let s=[];for(let i=0,o;i<a.length;i++)if(o=a[i]){let c=r[i],{open:u,close:d}=o;s.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:s}}return null}function xln(e,t,n=t.selection.ranges){let r=[],a=-1;for(let{from:s,to:i}of n){let o=r.length,c=1e9,u=Rde(t,s).line;if(u){for(let d=s;d<=i;){let f=t.doc.lineAt(d);if(f.from>a&&(s==i||i>f.from)){a=f.from;let p=/^\s*/.exec(f.text)[0].length,h=p==f.length,m=f.text.slice(p,p+u.length)==u?p:-1;p<f.text.length&&p<c&&(c=p),r.push({line:f,comment:m,token:u,indent:p,empty:h,single:!1})}d=f.to+1}if(c<1e9)for(let d=o;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==o+1&&(r[o].single=!0)}}if(e!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:c,indent:u,empty:d,single:f}of r)(f||!d)&&s.push({from:o.from+u,insert:c+" "});let i=t.changes(s);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:i,comment:o,token:c}of r)if(o>=0){let u=i.from+o,d=u+c.length;i.text[d-i.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const Kne=Rm.define(),wln=Rm.define(),Sln=Xt.define(),Nat=Xt.define({combine(e){return Pm(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,a)=>t(r,a)||n(r,a)})}}),Aat=Ji.define({create(){return em.empty},update(e,t){let n=t.state.facet(Nat),r=t.annotation(Kne);if(r){let c=du.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=$3(d,d.length,n.minDepth,c):d=Pat(d,t.startState.selection),new em(u==0?r.rest:d,u==0?d:r.rest)}let a=t.annotation(wln);if((a=="full"||a=="before")&&(e=e.isolate()),t.annotation(fo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=du.fromTransaction(t),i=t.annotation(fo.time),o=t.annotation(fo.userEvent);return s?e=e.addChanges(s,i,o,n,t):t.selection&&(e=e.addSelection(t.startState.selection,i,o,n.newGroupDelay)),(a=="full"||a=="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 em(e.done.map(du.fromJSON),e.undone.map(du.fromJSON))}});function Oln(e={}){return[Aat,Nat.of(e),vt.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?Iat:t.inputType=="historyRedo"?Jne:null;return r?(t.preventDefault(),r(n)):!1}})]}function oF(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let a=n.field(Aat,!1);if(!a)return!1;let s=a.pop(e,n,t);return s?(r(s),!0):!1}}const Iat=oF(0,!1),Jne=oF(1,!1),kln=oF(0,!0),_ln=oF(1,!0);class du{constructor(t,n,r,a,s){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=a,this.selectionsAfter=s}setSelAfter(t){return new du(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(a=>a.toJSON())}}static fromJSON(t){return new du(t.changes&&oo.fromJSON(t.changes),[],t.mapped&&lm.fromJSON(t.mapped),t.startSelection&&tt.fromJSON(t.startSelection),t.selectionsAfter.map(tt.fromJSON))}static fromTransaction(t,n){let r=Ef;for(let a of t.startState.facet(Sln)){let s=a(t);s.length&&(r=r.concat(s))}return!r.length&&t.changes.empty?null:new du(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Ef)}static selection(t){return new du(void 0,Ef,void 0,void 0,t)}}function $3(e,t,n,r){let a=t+1>n+20?t-n-1:0,s=e.slice(a,t);return s.push(r),s}function Eln(e,t){let n=[],r=!1;return e.iterChangedRanges((a,s)=>n.push(a,s)),t.iterChangedRanges((a,s,i,o)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];o>=u&&i<=d&&(r=!0)}}),r}function Cln(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function Rat(e,t){return e.length?t.length?e.concat(t):e:t}const Ef=[],jln=200;function Pat(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-jln));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),$3(e,e.length-1,1e9,n.setSelAfter(r)))}else return[du.selection([t])]}function Tln(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function EU(e,t){if(!e.length)return e;let n=e.length,r=Ef;for(;n;){let a=Nln(e[n-1],t,r);if(a.changes&&!a.changes.empty||a.effects.length){let s=e.slice(0,n);return s[n-1]=a,s}else t=a.mapped,n--,r=a.selectionsAfter}return r.length?[du.selection(r)]:Ef}function Nln(e,t,n){let r=Rat(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):Ef,n);if(!e.changes)return du.selection(r);let a=e.changes.map(t),s=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(s):s;return new du(a,Kn.mapEffects(e.effects,t),i,e.startSelection.map(s),r)}const Aln=/^(input\.type|delete)($|\.)/;class em{constructor(t,n,r=0,a=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=a}isolate(){return this.prevTime?new em(this.done,this.undone):this}addChanges(t,n,r,a,s){let i=this.done,o=i[i.length-1];return o&&o.changes&&!o.changes.empty&&t.changes&&(!r||Aln.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime<a.newGroupDelay&&a.joinToEvent(s,Eln(o.changes,t.changes))||r=="input.type.compose")?i=$3(i,i.length-1,a.minDepth,new du(t.changes.compose(o.changes),Rat(Kn.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,Ef)):i=$3(i,i.length,a.minDepth,t),new em(i,Ef,n,r)}addSelection(t,n,r,a){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Ef;return s.length>0&&n-this.prevTime<a&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Cln(s[s.length-1],t)?this:new em(Pat(this.done,t),this.undone,n,r)}addMapping(t){return new em(EU(this.done,t),EU(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let a=t==0?this.done:this.undone;if(a.length==0)return null;let s=a[a.length-1],i=s.selectionsAfter[0]||n.selection;if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Kne.of({side:t,rest:Tln(a),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let o=a.length==1?Ef:a.slice(0,a.length-1);return s.mapped&&(o=EU(o,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Kne.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}em.empty=new em(Ef,Ef);const Iln=[{key:"Mod-z",run:Iat,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Jne,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Jne,preventDefault:!0},{key:"Mod-u",run:kln,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:_ln,preventDefault:!0}];function C_(e,t){return tt.create(e.ranges.map(t),e.mainIndex)}function eh(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function th({state:e,dispatch:t},n){let r=C_(e.selection,n);return r.eq(e.selection,!0)?!1:(t(eh(e,r)),!0)}function lF(e,t){return tt.cursor(t?e.to:e.from)}function Mat(e,t){return th(e,n=>n.empty?e.moveByChar(n,t):lF(n,t))}function rc(e){return e.textDirectionAt(e.state.selection.main.head)==Os.LTR}const Dat=e=>Mat(e,!rc(e)),$at=e=>Mat(e,rc(e));function Lat(e,t){return th(e,n=>n.empty?e.moveByGroup(n,t):lF(n,t))}const Rln=e=>Lat(e,!rc(e)),Pln=e=>Lat(e,rc(e));function Mln(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function cF(e,t,n){let r=ps(e).resolveInner(t.head),a=n?ur.closedBy:ur.openedBy;for(let c=t.head;;){let u=n?r.childAfter(c):r.childBefore(c);if(!u)break;Mln(e,u,a)?r=u:c=n?u.to:u.from}let s=r.type.prop(a),i,o;return s&&(i=n?Jh(e,r.from,1):Jh(e,r.to,-1))&&i.matched?o=n?i.end.to:i.end.from:o=n?r.to:r.from,tt.cursor(o,n?-1:1)}const Dln=e=>th(e,t=>cF(e.state,t,!rc(e))),$ln=e=>th(e,t=>cF(e.state,t,rc(e)));function Fat(e,t){return th(e,n=>{if(!n.empty)return lF(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const zat=e=>Fat(e,!1),Bat=e=>Fat(e,!0);function Uat(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,a;if(t){for(let s of e.state.facet(vt.scrollMargins)){let i=s(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}a=e.scrollDOM.clientHeight-n-r}else a=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,a-5)}}function Vat(e,t){let n=Uat(e),{state:r}=e,a=C_(r.selection,i=>i.empty?e.moveVertically(i,t,n.height):lF(i,t));if(a.eq(r.selection))return!1;let s;if(n.selfScroll){let i=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),c=o.top+n.marginTop,u=o.bottom-n.marginBottom;i&&i.top>c&&i.bottom<u&&(s=vt.scrollIntoView(a.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(eh(r,a),{effects:s}),!0}const A_e=e=>Vat(e,!1),ere=e=>Vat(e,!0);function Yb(e,t,n){let r=e.lineBlockAt(t.head),a=e.moveToLineBoundary(t,n);if(a.head==t.head&&a.head!=(n?r.to:r.from)&&(a=e.moveToLineBoundary(t,n,!1)),!n&&a.head==r.from&&r.length){let s=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&t.head!=r.from+s&&(a=tt.cursor(r.from+s))}return a}const Lln=e=>th(e,t=>Yb(e,t,!0)),Fln=e=>th(e,t=>Yb(e,t,!1)),zln=e=>th(e,t=>Yb(e,t,!rc(e))),Bln=e=>th(e,t=>Yb(e,t,rc(e))),Uln=e=>th(e,t=>tt.cursor(e.lineBlockAt(t.head).from,1)),Vln=e=>th(e,t=>tt.cursor(e.lineBlockAt(t.head).to,-1));function qln(e,t,n){let r=!1,a=C_(e.selection,s=>{let i=Jh(e,s.head,-1)||Jh(e,s.head,1)||s.head>0&&Jh(e,s.head-1,1)||s.head<e.doc.length&&Jh(e,s.head+1,-1);if(!i||!i.end)return s;r=!0;let o=i.start.from==s.head?i.end.to:i.end.from;return tt.cursor(o)});return r?(t(eh(e,a)),!0):!1}const Hln=({state:e,dispatch:t})=>qln(e,t);function Jf(e,t){let n=C_(e.state.selection,r=>{let a=t(r);return tt.range(r.anchor,a.head,a.goalColumn,a.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(eh(e.state,n)),!0)}function qat(e,t){return Jf(e,n=>e.moveByChar(n,t))}const Hat=e=>qat(e,!rc(e)),Qat=e=>qat(e,rc(e));function Wat(e,t){return Jf(e,n=>e.moveByGroup(n,t))}const Qln=e=>Wat(e,!rc(e)),Wln=e=>Wat(e,rc(e)),Gln=e=>Jf(e,t=>cF(e.state,t,!rc(e))),Zln=e=>Jf(e,t=>cF(e.state,t,rc(e)));function Gat(e,t){return Jf(e,n=>e.moveVertically(n,t))}const Zat=e=>Gat(e,!1),Yat=e=>Gat(e,!0);function Xat(e,t){return Jf(e,n=>e.moveVertically(n,t,Uat(e).height))}const I_e=e=>Xat(e,!1),R_e=e=>Xat(e,!0),Yln=e=>Jf(e,t=>Yb(e,t,!0)),Xln=e=>Jf(e,t=>Yb(e,t,!1)),Kln=e=>Jf(e,t=>Yb(e,t,!rc(e))),Jln=e=>Jf(e,t=>Yb(e,t,rc(e))),ecn=e=>Jf(e,t=>tt.cursor(e.lineBlockAt(t.head).from)),tcn=e=>Jf(e,t=>tt.cursor(e.lineBlockAt(t.head).to)),P_e=({state:e,dispatch:t})=>(t(eh(e,{anchor:0})),!0),M_e=({state:e,dispatch:t})=>(t(eh(e,{anchor:e.doc.length})),!0),D_e=({state:e,dispatch:t})=>(t(eh(e,{anchor:e.selection.main.anchor,head:0})),!0),$_e=({state:e,dispatch:t})=>(t(eh(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),ncn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),rcn=({state:e,dispatch:t})=>{let n=uF(e).map(({from:r,to:a})=>tt.range(r,Math.min(a+1,e.doc.length)));return t(e.update({selection:tt.create(n),userEvent:"select"})),!0},acn=({state:e,dispatch:t})=>{let n=C_(e.selection,r=>{let a=ps(e),s=a.resolveStack(r.from,1);if(r.empty){let i=a.resolveStack(r.from,-1);i.node.from>=s.node.from&&i.node.to<=s.node.to&&(s=i)}for(let i=s;i;i=i.next){let{node:o}=i;if((o.from<r.from&&o.to>=r.to||o.to>r.to&&o.from<=r.from)&&i.next)return tt.range(o.to,o.from)}return r});return n.eq(e.selection)?!1:(t(eh(e,n)),!0)};function Kat(e,t){let{state:n}=e,r=n.selection,a=n.selection.ranges.slice();for(let s of n.selection.ranges){let i=n.doc.lineAt(s.head);if(t?i.to<e.state.doc.length:i.from>0)for(let o=s;;){let c=e.moveVertically(o,t);if(c.head<i.from||c.head>i.to){a.some(u=>u.head==c.head)||a.push(c);break}else{if(c.head==o.head)break;o=c}}}return a.length==r.ranges.length?!1:(e.dispatch(eh(n,tt.create(a,a.length-1))),!0)}const scn=e=>Kat(e,!1),icn=e=>Kat(e,!0),ocn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=tt.create([n.main]):n.main.empty||(r=tt.create([tt.cursor(n.main.head)])),r?(t(eh(e,r)),!0):!1};function LI(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,a=r.changeByRange(s=>{let{from:i,to:o}=s;if(i==o){let c=t(s);c<i?(n="delete.backward",c=WM(e,c,!1)):c>i&&(n="delete.forward",c=WM(e,c,!0)),i=Math.min(i,c),o=Math.max(o,c)}else i=WM(e,i,!1),o=WM(e,o,!0);return i==o?{range:s}:{changes:{from:i,to:o},range:tt.cursor(i,i<s.head?-1:1)}});return a.changes.empty?!1:(e.dispatch(r.update(a,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?vt.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function WM(e,t,n){if(e instanceof vt)for(let r of e.state.facet(vt.atomicRanges).map(a=>a(e)))r.between(t,t,(a,s)=>{a<t&&s>t&&(t=n?s:a)});return t}const Jat=(e,t,n)=>LI(e,r=>{let a=r.from,{state:s}=e,i=s.doc.lineAt(a),o,c;if(n&&!t&&a>i.from&&a<i.from+200&&!/[^ \t]/.test(o=i.text.slice(0,a-i.from))){if(o[o.length-1]==" ")return a-1;let u=Vp(o,s.tabSize),d=u%aw(s)||aw(s);for(let f=0;f<d&&o[o.length-1-f]==" ";f++)a--;c=a}else c=el(i.text,a-i.from,t,t)+i.from,c==a&&i.number!=(t?s.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,a-i.from))&&(c=el(i.text,c-i.from,!1,!1)+i.from);return c}),tre=e=>Jat(e,!1,!0),est=e=>Jat(e,!0,!1),tst=(e,t)=>LI(e,n=>{let r=n.head,{state:a}=e,s=a.doc.lineAt(r),i=a.charCategorizer(r);for(let o=null;;){if(r==(t?s.to:s.from)){r==n.head&&s.number!=(t?a.doc.lines:1)&&(r+=t?1:-1);break}let c=el(s.text,r-s.from,t)+s.from,u=s.text.slice(Math.min(r,c)-s.from,Math.max(r,c)-s.from),d=i(u);if(o!=null&&d!=o)break;(u!=" "||r!=n.head)&&(o=d),r=c}return r}),nst=e=>tst(e,!1),lcn=e=>tst(e,!0),ccn=e=>LI(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),ucn=e=>LI(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),dcn=e=>LI(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),fcn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Ca.of(["",""])},range:tt.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},pcn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let a=r.from,s=e.doc.lineAt(a),i=a==s.from?a-1:el(s.text,a-s.from,!1)+s.from,o=a==s.to?a+1:el(s.text,a-s.from,!0)+s.from;return{changes:{from:i,to:o,insert:e.doc.slice(a,o).append(e.doc.slice(i,a))},range:tt.cursor(o)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function uF(e){let t=[],n=-1;for(let r of e.selection.ranges){let a=e.doc.lineAt(r.from),s=e.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=e.doc.lineAt(r.to-1)),n>=a.number){let i=t[t.length-1];i.to=s.to,i.ranges.push(r)}else t.push({from:a.from,to:s.to,ranges:[r]});n=s.number+1}return t}function rst(e,t,n){if(e.readOnly)return!1;let r=[],a=[];for(let s of uF(e)){if(n?s.to==e.doc.length:s.from==0)continue;let i=e.doc.lineAt(n?s.to+1:s.from-1),o=i.length+1;if(n){r.push({from:s.to,to:i.to},{from:s.from,insert:i.text+e.lineBreak});for(let c of s.ranges)a.push(tt.range(Math.min(e.doc.length,c.anchor+o),Math.min(e.doc.length,c.head+o)))}else{r.push({from:i.from,to:s.from},{from:s.to,insert:e.lineBreak+i.text});for(let c of s.ranges)a.push(tt.range(c.anchor-o,c.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:tt.create(a,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const hcn=({state:e,dispatch:t})=>rst(e,t,!1),mcn=({state:e,dispatch:t})=>rst(e,t,!0);function ast(e,t,n){if(e.readOnly)return!1;let r=[];for(let s of uF(e))n?r.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):r.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let a=e.changes(r);return t(e.update({changes:a,selection:e.selection.map(a,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const gcn=({state:e,dispatch:t})=>ast(e,t,!1),vcn=({state:e,dispatch:t})=>ast(e,t,!0),ycn=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(uF(t).map(({from:a,to:s})=>(a>0?a--:s<t.doc.length&&s++,{from:a,to:s}))),r=C_(t.selection,a=>{let s;if(e.lineWrapping){let i=e.lineBlockAt(a.head),o=e.coordsAtPos(a.head,a.assoc||1);o&&(s=i.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(a,!0,s)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function bcn(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ps(e).resolveInner(t),r=n.childBefore(t),a=n.childAfter(t),s;return r&&a&&r.to<=t&&a.from>=t&&(s=r.type.prop(ur.closedBy))&&s.indexOf(a.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(a.from).from&&!/\S/.test(e.sliceDoc(r.to,a.from))?{from:r.to,to:a.from}:null}const L_e=sst(!1),xcn=sst(!0);function sst(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(a=>{let{from:s,to:i}=a,o=t.doc.lineAt(s),c=!e&&s==i&&bcn(t,s);e&&(s=i=(i<=o.to?o:t.doc.lineAt(i)).to);let u=new nF(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=Jue(u,s);for(d==null&&(d=Vp(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;c?{from:s,to:i}=c:s>o.from&&s<o.from+100&&!/\S/.test(o.text.slice(0,s))&&(s=o.from);let f=["",vN(t,d)];return c&&f.push(vN(t,u.lineIndent(o.from,-1))),{changes:{from:s,to:i,insert:Ca.of(f)},range:tt.cursor(s+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Pde(e,t){let n=-1;return e.changeByRange(r=>{let a=[];for(let i=r.from;i<=r.to;){let o=e.doc.lineAt(i);o.number>n&&(r.empty||r.to>o.from)&&(t(o,a,r),n=o.number),i=o.to+1}let s=e.changes(a);return{changes:a,range:tt.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const wcn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new nF(e,{overrideIndentation:s=>{let i=n[s];return i??-1}}),a=Pde(e,(s,i,o)=>{let c=Jue(r,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=vN(e,c);(u!=d||o.from<s.from+u.length)&&(n[s.from]=c,i.push({from:s.from,to:s.from+u.length,insert:d}))});return a.changes.empty||t(e.update(a,{userEvent:"indent"})),!0},ist=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Pde(e,(n,r)=>{r.push({from:n.from,insert:e.facet(k_)})}),{userEvent:"input.indent"})),!0),ost=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Pde(e,(n,r)=>{let a=/^\s*/.exec(n.text)[0];if(!a)return;let s=Vp(a,e.tabSize),i=0,o=vN(e,Math.max(0,s-aw(e)));for(;i<a.length&&i<o.length&&a.charCodeAt(i)==o.charCodeAt(i);)i++;r.push({from:n.from+i,to:n.from+a.length,insert:o.slice(i)})}),{userEvent:"delete.dedent"})),!0),Scn=e=>(e.setTabFocusMode(),!0),Ocn=[{key:"Ctrl-b",run:Dat,shift:Hat,preventDefault:!0},{key:"Ctrl-f",run:$at,shift:Qat},{key:"Ctrl-p",run:zat,shift:Zat},{key:"Ctrl-n",run:Bat,shift:Yat},{key:"Ctrl-a",run:Uln,shift:ecn},{key:"Ctrl-e",run:Vln,shift:tcn},{key:"Ctrl-d",run:est},{key:"Ctrl-h",run:tre},{key:"Ctrl-k",run:ccn},{key:"Ctrl-Alt-h",run:nst},{key:"Ctrl-o",run:fcn},{key:"Ctrl-t",run:pcn},{key:"Ctrl-v",run:ere}],kcn=[{key:"ArrowLeft",run:Dat,shift:Hat,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Rln,shift:Qln,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:zln,shift:Kln,preventDefault:!0},{key:"ArrowRight",run:$at,shift:Qat,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Pln,shift:Wln,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Bln,shift:Jln,preventDefault:!0},{key:"ArrowUp",run:zat,shift:Zat,preventDefault:!0},{mac:"Cmd-ArrowUp",run:P_e,shift:D_e},{mac:"Ctrl-ArrowUp",run:A_e,shift:I_e},{key:"ArrowDown",run:Bat,shift:Yat,preventDefault:!0},{mac:"Cmd-ArrowDown",run:M_e,shift:$_e},{mac:"Ctrl-ArrowDown",run:ere,shift:R_e},{key:"PageUp",run:A_e,shift:I_e},{key:"PageDown",run:ere,shift:R_e},{key:"Home",run:Fln,shift:Xln,preventDefault:!0},{key:"Mod-Home",run:P_e,shift:D_e},{key:"End",run:Lln,shift:Yln,preventDefault:!0},{key:"Mod-End",run:M_e,shift:$_e},{key:"Enter",run:L_e,shift:L_e},{key:"Mod-a",run:ncn},{key:"Backspace",run:tre,shift:tre,preventDefault:!0},{key:"Delete",run:est,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:nst,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:lcn,preventDefault:!0},{mac:"Mod-Backspace",run:ucn,preventDefault:!0},{mac:"Mod-Delete",run:dcn,preventDefault:!0}].concat(Ocn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),_cn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Dln,shift:Gln},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:$ln,shift:Zln},{key:"Alt-ArrowUp",run:hcn},{key:"Shift-Alt-ArrowUp",run:gcn},{key:"Alt-ArrowDown",run:mcn},{key:"Shift-Alt-ArrowDown",run:vcn},{key:"Mod-Alt-ArrowUp",run:scn},{key:"Mod-Alt-ArrowDown",run:icn},{key:"Escape",run:ocn},{key:"Mod-Enter",run:xcn},{key:"Alt-l",mac:"Ctrl-l",run:rcn},{key:"Mod-i",run:acn,preventDefault:!0},{key:"Mod-[",run:ost},{key:"Mod-]",run:ist},{key:"Mod-Alt-\\",run:wcn},{key:"Shift-Mod-k",run:ycn},{key:"Shift-Mod-\\",run:Hln},{key:"Mod-/",run:hln},{key:"Alt-A",run:gln},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Scn}].concat(kcn),Ecn={key:"Tab",run:ist,shift:ost},F_e=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class vk{constructor(t,n,r=0,a=t.length,s,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,a),this.bufferStart=r,this.normalize=s?o=>s(F_e(o)):F_e,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return tu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Mue(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Bh(t);let a=this.normalize(n);if(a.length)for(let s=0,i=r;;s++){let o=a.charCodeAt(s),c=this.match(o,i,this.bufferPos+this.bufferStart);if(s==a.length-1){if(c)return this.value=c,this;break}i==r&&s<n.length&&n.charCodeAt(s)==o&&i++}}}match(t,n,r){let a=null;for(let s=0;s<this.matches.length;s+=2){let i=this.matches[s],o=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?a={from:this.matches[s+1],to:r}:(this.matches[s]++,o=!0)),o||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?a={from:n,to:r}:this.matches.push(1,n)),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}}typeof Symbol<"u"&&(vk.prototype[Symbol.iterator]=function(){return this});const lst={from:-1,to:-1,match:/.*/.exec("")},Mde="gm"+(/x/.unicode==null?"":"u");class cst{constructor(t,n,r,a=0,s=t.length){if(this.text=t,this.to=s,this.curLine="",this.done=!1,this.value=lst,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new ust(t,n,r,a,s);this.re=new RegExp(n,Mde+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let i=t.lineAt(a);this.curLineStart=i.from,this.matchPos=L3(t,a),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 n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,a=r+n[0].length;if(this.matchPos=L3(this.text,a+(r==a?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<a||r>this.value.to)&&(!this.test||this.test(r,a,n)))return this.value={from:r,to:a,match:n},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 CU=new WeakMap;class xO{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let a=CU.get(t);if(!a||a.from>=r||a.to<=n){let o=new xO(n,t.sliceString(n,r));return CU.set(t,o),o}if(a.from==n&&a.to==r)return a;let{text:s,from:i}=a;return i>n&&(s=t.sliceString(n,i)+s,i=n),a.to<r&&(s+=t.sliceString(a.to,r)),CU.set(t,new xO(i,s)),new xO(n,s.slice(n-i,r-i))}}class ust{constructor(t,n,r,a,s){this.text=t,this.to=s,this.done=!1,this.value=lst,this.matchPos=L3(t,a),this.re=new RegExp(n,Mde+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=xO.get(t,a,this.chunkEnd(a+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,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,a=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,a,n)))return this.value={from:r,to:a,match:n},this.matchPos=L3(this.text,a+(r==a?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=xO.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(cst.prototype[Symbol.iterator]=ust.prototype[Symbol.iterator]=function(){return this});function Ccn(e){try{return new RegExp(e,Mde),!0}catch{return!1}}function L3(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function nre(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),n=bs("input",{class:"cm-textfield",name:"line",value:t}),r=bs("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),e.dispatch({effects:Jj.of(!1)}),e.focus()):s.keyCode==13&&(s.preventDefault(),a())},onsubmit:s=>{s.preventDefault(),a()}},bs("label",e.state.phrase("Go to line"),": ",n)," ",bs("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),bs("button",{name:"close",onclick:()=>{e.dispatch({effects:Jj.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function a(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!s)return;let{state:i}=e,o=i.doc.lineAt(i.selection.main.head),[,c,u,d,f]=s,p=d?+d.slice(1):0,h=u?+u:o.number;if(u&&f){let v=h/100;c&&(v=v*(c=="-"?-1:1)+o.number/i.doc.lines),h=Math.round(i.doc.lines*v)}else u&&c&&(h=h*(c=="-"?-1:1)+o.number);let m=i.doc.line(Math.max(1,Math.min(i.doc.lines,h))),g=tt.cursor(m.from+Math.max(0,Math.min(p,m.length)));e.dispatch({effects:[Jj.of(!1),vt.scrollIntoView(g.from,{y:"center"})],selection:g}),e.focus()}return{dom:r}}const Jj=Kn.define(),z_e=Ji.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(Jj)&&(e=n.value);return e},provide:e=>gN.from(e,t=>t?nre:null)}),jcn=e=>{let t=mN(e,nre);if(!t){let n=[Jj.of(!0)];e.state.field(z_e,!1)==null&&n.push(Kn.appendConfig.of([z_e,Tcn])),e.dispatch({effects:n}),t=mN(e,nre)}return t&&t.dom.querySelector("input").select(),!0},Tcn=vt.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"}}}),Ncn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Acn=Xt.define({combine(e){return Pm(e,Ncn,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Icn(e){return[$cn,Dcn]}const Rcn=tn.mark({class:"cm-selectionMatch"}),Pcn=tn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function B_e(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=ri.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=ri.Word)}function Mcn(e,t,n,r){return e(t.sliceDoc(n,n+1))==ri.Word&&e(t.sliceDoc(r-1,r))==ri.Word}const Dcn=hi.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(Acn),{state:n}=e,r=n.selection;if(r.ranges.length>1)return tn.none;let a=r.main,s,i=null;if(a.empty){if(!t.highlightWordAroundCursor)return tn.none;let c=n.wordAt(a.head);if(!c)return tn.none;i=n.charCategorizer(a.head),s=n.sliceDoc(c.from,c.to)}else{let c=a.to-a.from;if(c<t.minSelectionLength||c>200)return tn.none;if(t.wholeWords){if(s=n.sliceDoc(a.from,a.to),i=n.charCategorizer(a.head),!(B_e(i,n,a.from,a.to)&&Mcn(i,n,a.from,a.to)))return tn.none}else if(s=n.sliceDoc(a.from,a.to),!s)return tn.none}let o=[];for(let c of e.visibleRanges){let u=new vk(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||B_e(i,n,d,f))&&(a.empty&&d<=a.from&&f>=a.to?o.push(Pcn.range(d,f)):(d>=a.to||f<=a.from)&&o.push(Rcn.range(d,f)),o.length>t.maxMatches))return tn.none}}return tn.set(o)}},{decorations:e=>e.decorations}),$cn=vt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Lcn=({state:e,dispatch:t})=>{let{selection:n}=e,r=tt.create(n.ranges.map(a=>e.wordAt(a.head)||tt.cursor(a.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Fcn(e,t){let{main:n,ranges:r}=e.selection,a=e.wordAt(n.head),s=a&&a.from==n.from&&a.to==n.to;for(let i=!1,o=new vk(e.doc,t,r[r.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new vk(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),i=!0}else{if(i&&r.some(c=>c.from==o.value.from))continue;if(s){let c=e.wordAt(o.value.from);if(!c||c.from!=o.value.from||c.to!=o.value.to)continue}return o.value}}const zcn=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return Lcn({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=r))return!1;let a=Fcn(e,r);return a?(t(e.update({selection:e.selection.addRange(tt.range(a.from,a.to),!1),effects:vt.scrollIntoView(a.to)})),!0):!1},j_=Xt.define({combine(e){return Pm(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Kcn(t),scrollToMatch:t=>vt.scrollIntoView(t)})}});class dst{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||Ccn(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
208
+ }`,{label:"class",detail:"definition",type:"keyword"}),Yc('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Yc('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Zrt=Ode.concat([Yc("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Yc("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Yc("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),O_e=new Ket,Yrt=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function oC(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const Fon=["FunctionDeclaration"],zon={FunctionDeclaration:oC("function"),ClassDeclaration:oC("class"),ClassExpression:()=>!0,EnumDeclaration:oC("constant"),TypeAliasDeclaration:oC("type"),NamespaceDeclaration:oC("namespace"),VariableDefinition(e,t){e.matchContext(Fon)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function Xrt(e,t){let n=O_e.get(t);if(n)return n;let r=[],a=!0;function s(i,o){let c=e.sliceString(i.from,i.to);r.push({label:c,type:o})}return t.cursor(Za.IncludeAnonymous).iterate(i=>{if(a)a=!1;else if(i.name){let o=zon[i.name];if(o&&o(i,s)||Yrt.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of Xrt(e,i.node))r.push(o);return!1}}),O_e.set(t,r),r}const M3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,kde=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Krt(e){let t=ps(e.state).resolveInner(e.pos,-1);if(kde.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&M3.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let a=t;a;a=a.parent)Yrt.has(a.name)&&(r=r.concat(Xrt(e.state.doc,a)));return{options:r,from:n?t.from:e.pos,validFor:M3}}function bU(e,t,n){var r;let a=[];for(;;){let s=t.firstChild,i;if(s?.name=="VariableName")return a.push(e(s)),{path:a.reverse(),name:n};if(s?.name=="MemberExpression"&&((r=i=s.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")a.push(e(i)),t=s;else return null}}function Jrt(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=ps(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?bU(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?bU(t,n.parent,""):kde.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&M3.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?bU(t,n,""):e.explicit?{path:[],name:""}:null}function Bon(e,t){let n=e,r=[],a=new Set;for(let s=0;;s++){for(let o of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(o)||a.has(o))continue;a.add(o);let c;try{c=n[o]}catch{continue}r.push({label:o,type:typeof c=="function"?/^[A-Z]/.test(o)?"class":t?"function":"method":t?"variable":"property",boost:-s})}let i=Object.getPrototypeOf(e);if(!i)return r;e=i}}function Uon(e){let t=new Map;return n=>{let r=Jrt(n);if(!r)return null;let a=e;for(let i of r.path)if(a=a[i],!a)return null;let s=t.get(a);return s||t.set(a,s=Bon(a,!r.path.length)),{from:n.pos-r.name.length,options:s,validFor:M3}}}const Rf=tw.define({name:"javascript",parser:Lon.configure({props:[Yw.add({IfStatement:yO({except:/^\s*({|else\b)/}),TryStatement:yO({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Lrn,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:$rn({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":yO({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":tde,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,r=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?e.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),eat={test:e=>/^JSX/.test(e.name),facet:tF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},_de=Rf.configure({dialect:"ts"},"typescript"),Ede=Rf.configure({dialect:"jsx",props:[Kue.add(e=>e.isTop?[eat]:void 0)]}),Cde=Rf.configure({dialect:"jsx ts",props:[Kue.add(e=>e.isTop?[eat]:void 0)]},"typescript");let tat=e=>({label:e,type:"keyword"});const nat="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(tat),Von=nat.concat(["declare","implements","private","protected","public"].map(tat));function D3(e={}){let t=e.jsx?e.typescript?Cde:Ede:e.typescript?_de:Rf,n=e.typescript?Zrt.concat(Von):Ode.concat(nat);return new rw(t,[Rf.data.of({autocomplete:Oan(kde,Xnt(n))}),Rf.data.of({autocomplete:Krt}),e.jsx?rat:[]])}function qon(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 k_e(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return e.sliceString(r.from,Math.min(r.to,n));return""}const Hon=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),rat=vt.inputHandler.of((e,t,n,r,a)=>{if((Hon?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!Rf.isActiveAt(e.state,t,-1))return!1;let s=a(),{state:i}=s,o=i.changeByRange(c=>{var u;let{head:d}=c,f=ps(i).resolveInner(d-1,-1),p;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,m=h.parent;if(m&&h.from==d-2&&((p=k_e(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${p}>`;return{range:tt.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let h=qon(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(p=k_e(i.doc,h,d)))return{range:c,changes:{from:d,insert:`</${p}>`}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([s,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function Qon(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((n,r)=>{var a;!((a=n.meta.docs)===null||a===void 0)&&a.recommended&&(t.rules[r]=2)})),n=>{let{state:r}=n,a=[];for(let{from:s,to:i}of Rf.findRegions(r)){let o=r.doc.lineAt(s),c={line:o.number-1,col:s-o.from,pos:s};for(let u of e.verify(r.sliceDoc(s,i),t))a.push(Won(u,r.doc,c))}return a}}function __e(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function Won(e,t,n){let r=__e(e.line,e.column,t,n),a={from:r,to:e.endLine!=null&&e.endColumn!=1?__e(e.endLine,e.endColumn,t,n):r,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:s,text:i}=e.fix,o=s[0]+n.pos-r,c=s[1]+n.pos-r;a.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+o,to:d+c,insert:i},scrollIntoView:!0})}}]}return a}const QM=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:rat,completionPath:Jrt,esLint:Qon,javascript:D3,javascriptLanguage:Rf,jsxLanguage:Ede,localCompletionSource:Krt,scopeCompletionSource:Uon,snippets:Ode,tsxLanguage:Cde,typescriptLanguage:_de,typescriptSnippets:Zrt},Symbol.toStringTag,{value:"Module"})),lC=["_blank","_self","_top","_parent"],xU=["ascii","utf-8","utf-16","latin1","latin1"],wU=["get","post","put","delete"],SU=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],qu=["true","false"],An={},Gon={a:{attrs:{href:null,ping:null,type:null,media:null,target:lC,hreflang:null}},abbr:An,address:An,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:An,aside:An,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:An,base:{attrs:{href:null,target:lC}},bdi:An,bdo:An,blockquote:{attrs:{cite:null}},body:An,br:An,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:SU,formmethod:wU,formnovalidate:["novalidate"],formtarget:lC,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:An,center:An,cite:An,code:An,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:An,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:An,div:An,dl:An,dt:An,em:An,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:An,figure:An,footer:An,form:{attrs:{action:null,name:null,"accept-charset":xU,autocomplete:["on","off"],enctype:SU,method:wU,novalidate:["novalidate"],target:lC}},h1:An,h2:An,h3:An,h4:An,h5:An,h6:An,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:An,hgroup:An,hr:An,html:{attrs:{manifest:null}},i:An,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:SU,formmethod:wU,formnovalidate:["novalidate"],formtarget:lC,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:An,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:An,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:An,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:xU,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:An,noscript:An,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:An,param:{attrs:{name:null,value:null}},pre:An,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:An,rt:An,ruby:An,samp:An,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:xU}},section:An,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:An,source:{attrs:{src:null,type:null,media:null}},span:An,strong:An,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:An,summary:An,sup:An,table:An,tbody:An,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:An,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:An,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:An,time:{attrs:{datetime:null}},title:An,tr:An,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:An,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:An},aat={accesskey:null,class:null,contenteditable:qu,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:qu,autocorrect:qu,autocapitalize:qu,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":qu,"aria-autocomplete":["inline","list","both","none"],"aria-busy":qu,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":qu,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":qu,"aria-hidden":qu,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":qu,"aria-multiselectable":qu,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":qu,"aria-relevant":null,"aria-required":qu,"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},sat="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 sat)aat[e]=null;let EN=class{constructor(t,n){this.tags={...Gon,...t},this.globalAttrs={...aat,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};EN.default=new EN;function mk(e,t,n=e.length){if(!t)return"";let r=t.firstChild,a=r&&r.getChild("TagName");return a?e.sliceString(a.from,Math.min(a.to,n)):""}function gk(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function iat(e,t,n){let r=n.tags[mk(e,gk(t))];return r?.children||n.allTags}function jde(e,t){let n=[];for(let r=gk(t);r&&!r.type.isTop;r=gk(r.parent)){let a=mk(e,r);if(a&&r.lastChild.name=="CloseTag")break;a&&n.indexOf(a)<0&&(t.name=="EndTag"||t.from>=r.firstChild.to)&&n.push(a)}return n}const oat=/^[:\-\.\w\u00b7-\uffff]*$/;function E_e(e,t,n,r,a){let s=/\s*>/.test(e.sliceDoc(a,a+5))?"":">",i=gk(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:a,options:iat(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(jde(e.doc,n).map((o,c)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function C_e(e,t,n,r){let a=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:jde(e.doc,t).map((s,i)=>({label:s,apply:s+a,type:"type",boost:99-i})),validFor:oat}}function Zon(e,t,n,r){let a=[],s=0;for(let i of iat(e.doc,n,t))a.push({label:"<"+i,type:"type"});for(let i of jde(e.doc,n))a.push({label:"</"+i+">",type:"type",boost:99-s++});return{from:r,to:r,options:a,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Yon(e,t,n,r,a){let s=gk(n),i=s?t.tags[mk(e.doc,s)]:null,o=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?o:o.length?o.concat(t.globalAttrNames):t.globalAttrNames;return{from:r,to:a,options:c.map(u=>({label:u,type:"property"})),validFor:oat}}function Xon(e,t,n,r,a){var s;let i=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=gk(n),p=f?t.tags[mk(e.doc,f)]:null;d=p?.attrs&&p.attrs[u]}if(d){let f=e.sliceDoc(r,a).toLowerCase(),p='"',h='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",h=e.sliceDoc(a,a+1)==f[0]?"":f[0],f=f.slice(1),r++):c=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:p+m+h,type:"constant"})}}return{from:r,to:a,options:o,validFor:c}}function lat(e,t){let{state:n,pos:r}=t,a=ps(n).resolveInner(r,-1),s=a.resolve(r);for(let i=r,o;s==a&&(o=a.childBefore(i));){let c=o.lastChild;if(!c||!c.type.isError||c.from<c.to)break;s=a=o,i=c.from}return a.name=="TagName"?a.parent&&/CloseTag$/.test(a.parent.name)?C_e(n,a,a.from,r):E_e(n,e,a,a.from,r):a.name=="StartTag"||a.name=="IncompleteTag"?E_e(n,e,a,r,r):a.name=="StartCloseTag"||a.name=="IncompleteCloseTag"?C_e(n,a,r,r):a.name=="OpenTag"||a.name=="SelfClosingTag"||a.name=="AttributeName"?Yon(n,e,a,a.name=="AttributeName"?a.from:r,r):a.name=="Is"||a.name=="AttributeValue"||a.name=="UnquotedAttributeValue"?Xon(n,e,a,a.name=="Is"?r:a.from,r):t.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?Zon(n,e,a,r):null}function cat(e){return lat(EN.default,e)}function uat(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new EN(t,n):EN.default;return a=>lat(r,a)}const Kon=Rf.parser.configure({top:"SingleExpression"}),dat=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:_de.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ede.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Cde.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Kon},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:Rf.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:_N.parser}],fat=[{name:"style",parser:_N.parser.configure({top:"Styles"})}].concat(sat.map(e=>({name:e,parser:Rf.parser}))),pat=tw.define({name:"html",parser:Cin.configure({props:[Yw.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,n;for(let r=e.node;;){let a=r.lastChild;if(!a||a.name!="Element"||a.to!=r.to)break;t=r=a}return t&&!((n=t.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),Xw.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:n.name=="CloseTag"?n.from:e.to}}}),qnt.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Kj=pat.configure({wrap:Frt(dat,fat)});function hat(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=Frt((e.nestedLanguages||[]).concat(dat),(e.nestedAttributes||[]).concat(fat)));let r=n?pat.configure({wrap:n,dialect:t}):t?Kj.configure({dialect:t}):Kj;return new rw(r,[Kj.data.of({autocomplete:uat(e)}),e.autoCloseTags!==!1?mat:[],D3().support,Wrt().support])}const j_e=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),mat=vt.inputHandler.of((e,t,n,r,a)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!Kj.isActiveAt(e.state,t,-1))return!1;let s=a(),{state:i}=s,o=i.changeByRange(c=>{var u,d,f;let p=i.doc.sliceString(c.from-1,c.to)==r,{head:h}=c,m=ps(i).resolveInner(h,-1),g;if(p&&r==">"&&m.name=="EndTag"){let v=m.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=mk(i.doc,v.parent,h))&&!j_e.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`</${g}>`;return{range:c,changes:{from:h,to:b,insert:S}}}}else if(p&&r=="/"&&m.name=="IncompleteCloseTag"){let v=m.parent;if(m.from==h-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=mk(i.doc,v,h))&&!j_e.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`${g}>`;return{range:tt.cursor(h+S.length,-1),changes:{from:h,to:b,insert:S}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([s,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Jon=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:mat,html:hat,htmlCompletionSource:cat,htmlCompletionSourceWith:uat,htmlLanguage:Kj},Symbol.toStringTag,{value:"Module"})),gat=tF({commentTokens:{block:{open:"<!--",close:"-->"}}}),vat=new ur,yat=Tsn.configure({props:[Xw.add(e=>!e.is("Block")||e.is("Document")||Xne(e)!=null||eln(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),vat.add(Xne),Yw.add({Document:()=>null}),By.add({Document:gat})]});function Xne(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function eln(e){return e.name=="OrderedList"||e.name=="BulletList"}function tln(e,t){let n=e;for(;;){let r=n.nextSibling,a;if(!r||(a=Xne(r.type))!=null&&a<=t)break;n=r}return n.to}const nln=Int.of((e,t,n)=>{for(let r=ps(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let a=r.type.prop(vat);if(a==null)continue;let s=tln(r,a);if(s>n)return{from:n,to:s}}return null});function Tde(e){return new ld(gat,e,[],"markdown")}const bat=Tde(yat),rln=yat.configure([zsn,Usn,Bsn,Vsn,{props:[Xw.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),iw=Tde(rln);function aln(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=He.matchLanguageName(e,n,!0),r instanceof He)return r.support?r.support.language.parser:nw.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class OU{constructor(t,n,r,a,s,i,o){this.node=t,this.from=n,this.to=r,this.spaceBefore=a,this.spaceAfter=s,this.type=i,this.item=o}blank(t,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;r.length<t;)r+=" ";return r}else{for(let a=this.to-this.from-r.length-this.spaceAfter.length;a>0;a--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+wat(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function xat(e,t){let n=[],r=[];for(let a=e;a;a=a.parent){if(a.name=="FencedCode")return r;(a.name=="ListItem"||a.name=="Blockquote")&&n.push(a)}for(let a=n.length-1;a>=0;a--){let s=n[a],i,o=t.lineAt(s.from),c=s.from-o.from;if(s.name=="Blockquote"&&(i=/^ *>( ?)/.exec(o.text.slice(c))))r.push(new OU(s,c,c+i[0].length,"",i[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(o.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),r.push(new OU(s.parent,c,c+d,i[1],u,i[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(c)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=i[2];i[3]&&(f+=i[3].replace(/[xX]/," ")),r.push(new OU(s.parent,c,c+d,i[1],u,f,s))}}return r}function wat(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function kU(e,t,n,r=0){for(let a=-1,s=e;;){if(s.name=="ListItem"){let o=wat(s,t),c=+o[2];if(a>=0){if(c!=a+1)return;n.push({from:s.from+o[1].length,to:s.from+o[0].length,insert:String(a+2+r)})}a=c}let i=s.nextSibling;if(!i)break;s=i}}function Nde(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(k_)!=" ")return e;let r=Vp(e,4,n),a="";for(let s=r;s>0;)s>=4?(a+=" ",s-=4):(a+=" ",s--);return a+e.slice(n)}const Sat=(e={})=>({state:t,dispatch:n})=>{let r=ps(t),{doc:a}=t,s=null,i=t.changeByRange(o=>{if(!o.empty||!iw.isActiveAt(t,o.from,-1)&&!iw.isActiveAt(t,o.from,1))return s={range:o};let c=o.from,u=a.lineAt(c),d=xat(r.resolveInner(c,-1),a);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:o};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:o};let p=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&p){let b=f.node.firstChild,S=f.node.getChild("ListItem","ListItem");if(b.to>=c||S&&S.to<c||u.from>0&&!/[^\s>]/.test(a.lineAt(u.from-1).text)||e.nonTightLists===!1){let O=d.length>1?d[d.length-2]:null,k,E="";O&&O.item?(k=u.from+O.from,E=O.marker(a,1)):k=u.from+(O?O.to:0);let C=[{from:k,to:c,insert:E}];return f.node.name=="OrderedList"&&kU(f.item,a,C,-2),O&&O.node.name=="OrderedList"&&kU(O.item,a,C),{range:tt.cursor(k+E.length),changes:C}}else{let O=N_e(d,t,u);return{range:tt.cursor(c+O.length+1),changes:{from:u.from,insert:O+t.lineBreak}}}}if(f.node.name=="Blockquote"&&p&&u.from){let b=a.lineAt(u.from-1),S=/>\s*$/.exec(b.text);if(S&&S.index==f.from){let O=t.changes([{from:b.from+S.index,to:b.to},{from:u.from+f.from,to:u.to}]);return{range:o.map(O),changes:O}}}let h=[];f.node.name=="OrderedList"&&kU(f.item,a,h);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let b=0,S=d.length-1;b<=S;b++)g+=b==S&&!m?d[b].marker(a,1):d[b].blank(b<S?Vp(u.text,4,d[b+1].from)-g.length:null);let v=c;for(;v>u.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return g=Nde(g,t),sln(f.node,t.doc)&&(g=N_e(d,t,u)+t.lineBreak+g),h.push({from:v,to:c,insert:t.lineBreak+g}),{range:tt.cursor(v+g.length+1),changes:h}});return s?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},Oat=Sat();function T_e(e){return e.name=="QuoteMark"||e.name=="ListMark"}function sln(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let a=t.lineAt(n.to),s=t.lineAt(r.from),i=/^[\s>]*$/.test(a.text);return a.number+(i?0:1)<s.number}function N_e(e,t,n){let r="";for(let a=0,s=e.length-2;a<=s;a++)r+=e[a].blank(a<s?Vp(n.text,4,e[a+1].from)-r.length:null,a<s);return Nde(r,t)}function iln(e,t){let n=e.resolveInner(t,-1),r=t;T_e(n)&&(r=n.from,n=n.parent);for(let a;a=n.childBefore(r);)if(T_e(a))r=a.from;else if(a.name=="OrderedList"||a.name=="BulletList")n=a.lastChild,r=n.to;else break;return n}const kat=({state:e,dispatch:t})=>{let n=ps(e),r=null,a=e.changeByRange(s=>{let i=s.from,{doc:o}=e;if(s.empty&&iw.isActiveAt(e,s.from)){let c=o.lineAt(i),u=xat(iln(n,i),o);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-c.from>f&&!/\S/.test(c.text.slice(f,i-c.from)))return{range:tt.cursor(c.from+f),changes:{from:c.from+f,to:i}};if(i-c.from==f&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let p=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let h=d.blank(Vp(c.text,4,d.to)-Vp(c.text,4,d.from));return p==c.from&&(h=Nde(h,e)),{range:tt.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<i)return{range:tt.cursor(p),changes:{from:p,to:i}}}}}return r={range:s}});return r?!1:(t(e.update(a,{scrollIntoView:!0,userEvent:"delete"})),!0)},_at=[{key:"Enter",run:Oat},{key:"Backspace",run:kat}],Eat=hat({matchClosingTags:!1});function Ade(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:a}=bat,completeHTMLTags:s=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=Eat}=e;if(!(a instanceof sF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[o.support,nln],d;i&&u.push(Cat),n instanceof rw?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?aln(t,d):void 0;c.push(Asn({codeParser:f,htmlParser:o.language.parser})),r&&u.push(Jp.high(O_.of(_at)));let p=Tde(a.configure(c));return s&&u.push(p.data.of({autocomplete:oln})),new rw(p,u)}function oln(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let a=ps(t).resolveInner(n,-1);for(;a&&!a.type.isTop;){if(a.name=="CodeBlock"||a.name=="FencedCode"||a.name=="ProcessingInstructionBlock"||a.name=="CommentBlock"||a.name=="Link"||a.name=="Image")return null;a=a.parent}return{from:n-r[0].length,to:n,options:lln(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let _U=null;function lln(){if(_U)return _U;let e=cat(new ode(Pr.create({extensions:Eat}),0,!0));return _U=e?e.options:[]}const cln=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Cat=vt.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let a=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!a||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(a)||(/^www\./.test(a)&&(a="https://"+a),!iw.isActiveAt(t.state,r.from,1)))return!1;let s=ps(t.state),i=!1;return s.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||cln.test(o.name))&&(i=!0)},leave:o=>{o.to<r.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${a})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),uln=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:bat,deleteMarkupBackward:kat,insertNewlineContinueMarkup:Oat,insertNewlineContinueMarkupCommand:Sat,markdown:Ade,markdownKeymap:_at,markdownLanguage:iw,pasteURLAsLink:Cat},Symbol.toStringTag,{value:"Module"}));function dt(e){return new rw(rde.define(e))}function fy(e){return Ge(()=>import("./index-DNkWF02w.js"),__vite__mapDeps([4,2]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const jat=[He.of({name:"C",extensions:["c","h","ino"],load(){return Ge(()=>import("./index-DtTMnVbW.js"),__vite__mapDeps([5,2]),import.meta.url).then(e=>e.cpp())}}),He.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ge(()=>import("./index-DtTMnVbW.js"),__vite__mapDeps([5,2]),import.meta.url).then(e=>e.cpp())}}),He.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return fy("Cassandra")}}),He.of({name:"CSS",extensions:["css"],load(){return Ge(()=>Promise.resolve().then(()=>oon),void 0,import.meta.url).then(e=>e.css())}}),He.of({name:"Go",extensions:["go"],load(){return Ge(()=>import("./index-FXB9jWN1.js"),__vite__mapDeps([6,2]),import.meta.url).then(e=>e.go())}}),He.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ge(()=>Promise.resolve().then(()=>Jon),void 0,import.meta.url).then(e=>e.html())}}),He.of({name:"Java",extensions:["java"],load(){return Ge(()=>import("./index-CbJmAOX_.js"),__vite__mapDeps([7,2]),import.meta.url).then(e=>e.java())}}),He.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ge(()=>Promise.resolve().then(()=>QM),void 0,import.meta.url).then(e=>e.javascript())}}),He.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ge(()=>import("./index-lAv2ejbo.js"),__vite__mapDeps([8,2]),import.meta.url).then(e=>e.jinja())}}),He.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ge(()=>Promise.resolve().then(()=>wan),void 0,import.meta.url).then(e=>e.json())}}),He.of({name:"JSX",extensions:["jsx"],load(){return Ge(()=>Promise.resolve().then(()=>QM),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),He.of({name:"LESS",extensions:["less"],load(){return Ge(()=>import("./index-DYuAM0ID.js"),__vite__mapDeps([9,2]),import.meta.url).then(e=>e.less())}}),He.of({name:"Liquid",extensions:["liquid"],load(){return Ge(()=>import("./index-B3W4BfxH.js"),__vite__mapDeps([10,2]),import.meta.url).then(e=>e.liquid())}}),He.of({name:"MariaDB SQL",load(){return fy("MariaSQL")}}),He.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ge(()=>Promise.resolve().then(()=>uln),void 0,import.meta.url).then(e=>e.markdown())}}),He.of({name:"MS SQL",load(){return fy("MSSQL")}}),He.of({name:"MySQL",load(){return fy("MySQL")}}),He.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ge(()=>import("./index-DU9zr-1L.js"),__vite__mapDeps([11,2]),import.meta.url).then(e=>e.php())}}),He.of({name:"PLSQL",extensions:["pls"],load(){return fy("PLSQL")}}),He.of({name:"PostgreSQL",load(){return fy("PostgreSQL")}}),He.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ge(()=>import("./index-YwhaF4oL.js"),__vite__mapDeps([12,2]),import.meta.url).then(e=>e.python())}}),He.of({name:"Rust",extensions:["rs"],load(){return Ge(()=>import("./index-BvKVpLq2.js"),__vite__mapDeps([13,2]),import.meta.url).then(e=>e.rust())}}),He.of({name:"Sass",extensions:["sass"],load(){return Ge(()=>import("./index-Bi-PLM84.js"),__vite__mapDeps([14,2]),import.meta.url).then(e=>e.sass({indented:!0}))}}),He.of({name:"SCSS",extensions:["scss"],load(){return Ge(()=>import("./index-Bi-PLM84.js"),__vite__mapDeps([14,2]),import.meta.url).then(e=>e.sass())}}),He.of({name:"SQL",extensions:["sql"],load(){return fy("StandardSQL")}}),He.of({name:"SQLite",load(){return fy("SQLite")}}),He.of({name:"TSX",extensions:["tsx"],load(){return Ge(()=>Promise.resolve().then(()=>QM),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),He.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ge(()=>Promise.resolve().then(()=>QM),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),He.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ge(()=>import("./index-Dyghc7pm.js"),__vite__mapDeps([15,2]),import.meta.url).then(e=>e.wast())}}),He.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ge(()=>import("./index-CrvJOQ5N.js"),__vite__mapDeps([16,2]),import.meta.url).then(e=>e.xml())}}),He.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ge(()=>import("./index-C3KX4RVQ.js"),__vite__mapDeps([17,2]),import.meta.url).then(e=>e.yaml())}}),He.of({name:"APL",extensions:["dyalog","apl"],load(){return Ge(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>dt(e.apl))}}),He.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ge(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>dt(e.asciiArmor))}}),He.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ge(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>dt(e.asn1({})))}}),He.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ge(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>dt(e.asterisk))}}),He.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ge(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>dt(e.brainfuck))}}),He.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ge(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>dt(e.cobol))}}),He.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.csharp))}}),He.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>dt(e.clojure))}}),He.of({name:"ClojureScript",extensions:["cljs"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>dt(e.clojure))}}),He.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ge(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>dt(e.gss))}}),He.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ge(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>dt(e.cmake))}}),He.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ge(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>dt(e.coffeeScript))}}),He.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ge(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>dt(e.commonLisp))}}),He.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ge(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>dt(e.cypher))}}),He.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ge(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>dt(e.cython))}}),He.of({name:"Crystal",extensions:["cr"],load(){return Ge(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>dt(e.crystal))}}),He.of({name:"D",extensions:["d"],load(){return Ge(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>dt(e.d))}}),He.of({name:"Dart",extensions:["dart"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.dart))}}),He.of({name:"diff",extensions:["diff","patch"],load(){return Ge(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>dt(e.diff))}}),He.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ge(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([18,19]),import.meta.url).then(e=>dt(e.dockerFile))}}),He.of({name:"DTD",extensions:["dtd"],load(){return Ge(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>dt(e.dtd))}}),He.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ge(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>dt(e.dylan))}}),He.of({name:"EBNF",load(){return Ge(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>dt(e.ebnf))}}),He.of({name:"ECL",extensions:["ecl"],load(){return Ge(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>dt(e.ecl))}}),He.of({name:"edn",extensions:["edn"],load(){return Ge(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>dt(e.clojure))}}),He.of({name:"Eiffel",extensions:["e"],load(){return Ge(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>dt(e.eiffel))}}),He.of({name:"Elm",extensions:["elm"],load(){return Ge(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>dt(e.elm))}}),He.of({name:"Erlang",extensions:["erl"],load(){return Ge(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>dt(e.erlang))}}),He.of({name:"Esper",load(){return Ge(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>dt(e.esper))}}),He.of({name:"Factor",extensions:["factor"],load(){return Ge(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([20,19]),import.meta.url).then(e=>dt(e.factor))}}),He.of({name:"FCL",load(){return Ge(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>dt(e.fcl))}}),He.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ge(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>dt(e.forth))}}),He.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ge(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>dt(e.fortran))}}),He.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>dt(e.fSharp))}}),He.of({name:"Gas",extensions:["s"],load(){return Ge(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>dt(e.gas))}}),He.of({name:"Gherkin",extensions:["feature"],load(){return Ge(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>dt(e.gherkin))}}),He.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ge(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>dt(e.groovy))}}),He.of({name:"Haskell",extensions:["hs"],load(){return Ge(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>dt(e.haskell))}}),He.of({name:"Haxe",extensions:["hx"],load(){return Ge(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>dt(e.haxe))}}),He.of({name:"HXML",extensions:["hxml"],load(){return Ge(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>dt(e.hxml))}}),He.of({name:"HTTP",load(){return Ge(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>dt(e.http))}}),He.of({name:"IDL",extensions:["pro"],load(){return Ge(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>dt(e.idl))}}),He.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ge(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>dt(e.jsonld))}}),He.of({name:"Julia",extensions:["jl"],load(){return Ge(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>dt(e.julia))}}),He.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.kotlin))}}),He.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ge(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>dt(e.liveScript))}}),He.of({name:"Lua",extensions:["lua"],load(){return Ge(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>dt(e.lua))}}),He.of({name:"mIRC",extensions:["mrc"],load(){return Ge(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>dt(e.mirc))}}),He.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ge(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>dt(e.mathematica))}}),He.of({name:"Modelica",extensions:["mo"],load(){return Ge(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>dt(e.modelica))}}),He.of({name:"MUMPS",extensions:["mps"],load(){return Ge(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>dt(e.mumps))}}),He.of({name:"Mbox",extensions:["mbox"],load(){return Ge(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>dt(e.mbox))}}),He.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ge(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>dt(e.nginx))}}),He.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ge(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([21,19]),import.meta.url).then(e=>dt(e.nsis))}}),He.of({name:"NTriples",extensions:["nt","nq"],load(){return Ge(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>dt(e.ntriples))}}),He.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.objectiveC))}}),He.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.objectiveCpp))}}),He.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>dt(e.oCaml))}}),He.of({name:"Octave",extensions:["m"],load(){return Ge(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>dt(e.octave))}}),He.of({name:"Oz",extensions:["oz"],load(){return Ge(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>dt(e.oz))}}),He.of({name:"Pascal",extensions:["p","pas"],load(){return Ge(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>dt(e.pascal))}}),He.of({name:"Perl",extensions:["pl","pm"],load(){return Ge(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>dt(e.perl))}}),He.of({name:"Pig",extensions:["pig"],load(){return Ge(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>dt(e.pig))}}),He.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ge(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>dt(e.powerShell))}}),He.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ge(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>dt(e.properties))}}),He.of({name:"ProtoBuf",extensions:["proto"],load(){return Ge(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>dt(e.protobuf))}}),He.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ge(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([22,23]),import.meta.url).then(e=>dt(e.pug))}}),He.of({name:"Puppet",extensions:["pp"],load(){return Ge(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>dt(e.puppet))}}),He.of({name:"Q",extensions:["q"],load(){return Ge(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>dt(e.q))}}),He.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ge(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>dt(e.r))}}),He.of({name:"RPM Changes",load(){return Ge(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>dt(e.rpmChanges))}}),He.of({name:"RPM Spec",extensions:["spec"],load(){return Ge(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>dt(e.rpmSpec))}}),He.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ge(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>dt(e.ruby))}}),He.of({name:"SAS",extensions:["sas"],load(){return Ge(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>dt(e.sas))}}),He.of({name:"Scala",extensions:["scala"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.scala))}}),He.of({name:"Scheme",extensions:["scm","ss"],load(){return Ge(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>dt(e.scheme))}}),He.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ge(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>dt(e.shell))}}),He.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ge(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>dt(e.sieve))}}),He.of({name:"Smalltalk",extensions:["st"],load(){return Ge(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>dt(e.smalltalk))}}),He.of({name:"Solr",load(){return Ge(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>dt(e.solr))}}),He.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ge(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>dt(e.sml))}}),He.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ge(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>dt(e.sparql))}}),He.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ge(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>dt(e.spreadsheet))}}),He.of({name:"Squirrel",extensions:["nut"],load(){return Ge(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>dt(e.squirrel))}}),He.of({name:"Stylus",extensions:["styl"],load(){return Ge(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>dt(e.stylus))}}),He.of({name:"Swift",extensions:["swift"],load(){return Ge(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>dt(e.swift))}}),He.of({name:"sTeX",load(){return Ge(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>dt(e.stex))}}),He.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ge(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>dt(e.stex))}}),He.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ge(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>dt(e.verilog))}}),He.of({name:"Tcl",extensions:["tcl"],load(){return Ge(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>dt(e.tcl))}}),He.of({name:"Textile",extensions:["textile"],load(){return Ge(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>dt(e.textile))}}),He.of({name:"TiddlyWiki",load(){return Ge(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>dt(e.tiddlyWiki))}}),He.of({name:"Tiki wiki",load(){return Ge(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>dt(e.tiki))}}),He.of({name:"TOML",extensions:["toml"],load(){return Ge(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>dt(e.toml))}}),He.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ge(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>dt(e.troff))}}),He.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ge(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>dt(e.ttcn))}}),He.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ge(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>dt(e.ttcnCfg))}}),He.of({name:"Turtle",extensions:["ttl"],load(){return Ge(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>dt(e.turtle))}}),He.of({name:"Web IDL",extensions:["webidl"],load(){return Ge(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>dt(e.webIDL))}}),He.of({name:"VB.NET",extensions:["vb"],load(){return Ge(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>dt(e.vb))}}),He.of({name:"VBScript",extensions:["vbs"],load(){return Ge(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>dt(e.vbScript))}}),He.of({name:"Velocity",extensions:["vtl"],load(){return Ge(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>dt(e.velocity))}}),He.of({name:"Verilog",extensions:["v"],load(){return Ge(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>dt(e.verilog))}}),He.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ge(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>dt(e.vhdl))}}),He.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ge(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>dt(e.xQuery))}}),He.of({name:"Yacas",extensions:["ys"],load(){return Ge(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>dt(e.yacas))}}),He.of({name:"Z80",extensions:["z80"],load(){return Ge(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>dt(e.z80))}}),He.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>dt(e.mscgen))}}),He.of({name:"Xù",extensions:["xu"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>dt(e.xu))}}),He.of({name:"MsGenny",extensions:["msgenny"],load(){return Ge(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>dt(e.msgenny))}}),He.of({name:"Vue",extensions:["vue"],load(){return Ge(()=>import("./index-D3j4lZvh.js"),__vite__mapDeps([24,2]),import.meta.url).then(e=>e.vue())}}),He.of({name:"Angular Template",load(){return Ge(()=>import("./index-FJTZVbJ2.js"),__vite__mapDeps([25,2]),import.meta.url).then(e=>e.angular())}})];var dln=e=>{var{theme:t,settings:n={},styles:r=[]}=e,a={".cm-gutters":{}},s={};n.background&&(s.backgroundColor=n.background),n.backgroundImage&&(s.backgroundImage=n.backgroundImage),n.foreground&&(s.color=n.foreground),n.fontSize&&(s.fontSize=n.fontSize),(n.background||n.foreground)&&(a["&"]=s),n.fontFamily&&(a["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(a[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(a[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(a[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(a[".cm-content"]={caretColor:n.caret},a[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var i={};n.gutterActiveForeground&&(i.color=n.gutterActiveForeground),n.lineHighlight&&(a[".cm-activeLine"]={backgroundColor:n.lineHighlight},i.backgroundColor=n.lineHighlight),a[".cm-activeLineGutter"]=i,n.selection&&(a["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(a["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var o=vt.theme(a,{dark:t==="dark"}),c=__.define(r),u=[o,nde(c)];return u},fln={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)"},pln=[{tag:he.comment,color:"#6272a4"},{tag:he.string,color:"#f1fa8c"},{tag:he.atom,color:"#bd93f9"},{tag:he.meta,color:"#f8f8f2"},{tag:[he.keyword,he.operator,he.tagName],color:"#ff79c6"},{tag:[he.function(he.propertyName),he.propertyName],color:"#66d9ef"},{tag:[he.definition(he.variableName),he.function(he.variableName),he.className,he.attributeName],color:"#50fa7b"},{tag:he.atom,color:"#bd93f9"}],iF=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return dln({theme:t,settings:wb({},fln,n),styles:[...pln,...r]})};iF();const hln=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Rde(e.state,n.from);return r.line?mln(e):r.block?vln(e):!1};function Ide(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let a=e(t,n);return a?(r(n.update(a)),!0):!1}}const mln=Ide(xln,0),gln=Ide(Tat,0),vln=Ide((e,t)=>Tat(e,t,bln(t)),0);function Rde(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const cC=50;function yln(e,{open:t,close:n},r,a){let s=e.sliceDoc(r-cC,r),i=e.sliceDoc(a,a+cC),o=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(i)[0].length,u=s.length-o;if(s.slice(u-t.length,u)==t&&i.slice(c,c+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:a+c,margin:c&&1}};let d,f;a-r<=2*cC?d=f=e.sliceDoc(r,a):(d=e.sliceDoc(r,r+cC),f=e.sliceDoc(a-cC,a));let p=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(f)[0].length,m=f.length-h-n.length;return d.slice(p,p+t.length)==t&&f.slice(m,m+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(d.charAt(p+t.length))?1:0},close:{pos:a-h-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function bln(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),a=n.to<=r.to?r:e.doc.lineAt(n.to);a.from>r.from&&a.from==n.to&&(a=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>r.from?t[s].to=a.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:a.to})}return t}function Tat(e,t,n=t.selection.ranges){let r=n.map(s=>Rde(t,s.from).block);if(!r.every(s=>s))return null;let a=n.map((s,i)=>yln(t,r[i],s.from,s.to));if(e!=2&&!a.every(s=>s))return{changes:t.changes(n.map((s,i)=>a[i]?[]:[{from:s.from,insert:r[i].open+" "},{from:s.to,insert:" "+r[i].close}]))};if(e!=1&&a.some(s=>s)){let s=[];for(let i=0,o;i<a.length;i++)if(o=a[i]){let c=r[i],{open:u,close:d}=o;s.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:s}}return null}function xln(e,t,n=t.selection.ranges){let r=[],a=-1;for(let{from:s,to:i}of n){let o=r.length,c=1e9,u=Rde(t,s).line;if(u){for(let d=s;d<=i;){let f=t.doc.lineAt(d);if(f.from>a&&(s==i||i>f.from)){a=f.from;let p=/^\s*/.exec(f.text)[0].length,h=p==f.length,m=f.text.slice(p,p+u.length)==u?p:-1;p<f.text.length&&p<c&&(c=p),r.push({line:f,comment:m,token:u,indent:p,empty:h,single:!1})}d=f.to+1}if(c<1e9)for(let d=o;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==o+1&&(r[o].single=!0)}}if(e!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:c,indent:u,empty:d,single:f}of r)(f||!d)&&s.push({from:o.from+u,insert:c+" "});let i=t.changes(s);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:i,comment:o,token:c}of r)if(o>=0){let u=i.from+o,d=u+c.length;i.text[d-i.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const Kne=Rm.define(),wln=Rm.define(),Sln=Xt.define(),Nat=Xt.define({combine(e){return Pm(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,a)=>t(r,a)||n(r,a)})}}),Aat=Ji.define({create(){return em.empty},update(e,t){let n=t.state.facet(Nat),r=t.annotation(Kne);if(r){let c=du.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=$3(d,d.length,n.minDepth,c):d=Pat(d,t.startState.selection),new em(u==0?r.rest:d,u==0?d:r.rest)}let a=t.annotation(wln);if((a=="full"||a=="before")&&(e=e.isolate()),t.annotation(fo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=du.fromTransaction(t),i=t.annotation(fo.time),o=t.annotation(fo.userEvent);return s?e=e.addChanges(s,i,o,n,t):t.selection&&(e=e.addSelection(t.startState.selection,i,o,n.newGroupDelay)),(a=="full"||a=="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 em(e.done.map(du.fromJSON),e.undone.map(du.fromJSON))}});function Oln(e={}){return[Aat,Nat.of(e),vt.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?Iat:t.inputType=="historyRedo"?Jne:null;return r?(t.preventDefault(),r(n)):!1}})]}function oF(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let a=n.field(Aat,!1);if(!a)return!1;let s=a.pop(e,n,t);return s?(r(s),!0):!1}}const Iat=oF(0,!1),Jne=oF(1,!1),kln=oF(0,!0),_ln=oF(1,!0);class du{constructor(t,n,r,a,s){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=a,this.selectionsAfter=s}setSelAfter(t){return new du(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(a=>a.toJSON())}}static fromJSON(t){return new du(t.changes&&oo.fromJSON(t.changes),[],t.mapped&&lm.fromJSON(t.mapped),t.startSelection&&tt.fromJSON(t.startSelection),t.selectionsAfter.map(tt.fromJSON))}static fromTransaction(t,n){let r=Ef;for(let a of t.startState.facet(Sln)){let s=a(t);s.length&&(r=r.concat(s))}return!r.length&&t.changes.empty?null:new du(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Ef)}static selection(t){return new du(void 0,Ef,void 0,void 0,t)}}function $3(e,t,n,r){let a=t+1>n+20?t-n-1:0,s=e.slice(a,t);return s.push(r),s}function Eln(e,t){let n=[],r=!1;return e.iterChangedRanges((a,s)=>n.push(a,s)),t.iterChangedRanges((a,s,i,o)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];o>=u&&i<=d&&(r=!0)}}),r}function Cln(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function Rat(e,t){return e.length?t.length?e.concat(t):e:t}const Ef=[],jln=200;function Pat(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-jln));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),$3(e,e.length-1,1e9,n.setSelAfter(r)))}else return[du.selection([t])]}function Tln(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function EU(e,t){if(!e.length)return e;let n=e.length,r=Ef;for(;n;){let a=Nln(e[n-1],t,r);if(a.changes&&!a.changes.empty||a.effects.length){let s=e.slice(0,n);return s[n-1]=a,s}else t=a.mapped,n--,r=a.selectionsAfter}return r.length?[du.selection(r)]:Ef}function Nln(e,t,n){let r=Rat(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):Ef,n);if(!e.changes)return du.selection(r);let a=e.changes.map(t),s=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(s):s;return new du(a,Kn.mapEffects(e.effects,t),i,e.startSelection.map(s),r)}const Aln=/^(input\.type|delete)($|\.)/;class em{constructor(t,n,r=0,a=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=a}isolate(){return this.prevTime?new em(this.done,this.undone):this}addChanges(t,n,r,a,s){let i=this.done,o=i[i.length-1];return o&&o.changes&&!o.changes.empty&&t.changes&&(!r||Aln.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime<a.newGroupDelay&&a.joinToEvent(s,Eln(o.changes,t.changes))||r=="input.type.compose")?i=$3(i,i.length-1,a.minDepth,new du(t.changes.compose(o.changes),Rat(Kn.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,Ef)):i=$3(i,i.length,a.minDepth,t),new em(i,Ef,n,r)}addSelection(t,n,r,a){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Ef;return s.length>0&&n-this.prevTime<a&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Cln(s[s.length-1],t)?this:new em(Pat(this.done,t),this.undone,n,r)}addMapping(t){return new em(EU(this.done,t),EU(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let a=t==0?this.done:this.undone;if(a.length==0)return null;let s=a[a.length-1],i=s.selectionsAfter[0]||n.selection;if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Kne.of({side:t,rest:Tln(a),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let o=a.length==1?Ef:a.slice(0,a.length-1);return s.mapped&&(o=EU(o,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Kne.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}em.empty=new em(Ef,Ef);const Iln=[{key:"Mod-z",run:Iat,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Jne,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Jne,preventDefault:!0},{key:"Mod-u",run:kln,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:_ln,preventDefault:!0}];function C_(e,t){return tt.create(e.ranges.map(t),e.mainIndex)}function eh(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function th({state:e,dispatch:t},n){let r=C_(e.selection,n);return r.eq(e.selection,!0)?!1:(t(eh(e,r)),!0)}function lF(e,t){return tt.cursor(t?e.to:e.from)}function Mat(e,t){return th(e,n=>n.empty?e.moveByChar(n,t):lF(n,t))}function rc(e){return e.textDirectionAt(e.state.selection.main.head)==Os.LTR}const Dat=e=>Mat(e,!rc(e)),$at=e=>Mat(e,rc(e));function Lat(e,t){return th(e,n=>n.empty?e.moveByGroup(n,t):lF(n,t))}const Rln=e=>Lat(e,!rc(e)),Pln=e=>Lat(e,rc(e));function Mln(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function cF(e,t,n){let r=ps(e).resolveInner(t.head),a=n?ur.closedBy:ur.openedBy;for(let c=t.head;;){let u=n?r.childAfter(c):r.childBefore(c);if(!u)break;Mln(e,u,a)?r=u:c=n?u.to:u.from}let s=r.type.prop(a),i,o;return s&&(i=n?Jh(e,r.from,1):Jh(e,r.to,-1))&&i.matched?o=n?i.end.to:i.end.from:o=n?r.to:r.from,tt.cursor(o,n?-1:1)}const Dln=e=>th(e,t=>cF(e.state,t,!rc(e))),$ln=e=>th(e,t=>cF(e.state,t,rc(e)));function Fat(e,t){return th(e,n=>{if(!n.empty)return lF(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const zat=e=>Fat(e,!1),Bat=e=>Fat(e,!0);function Uat(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,a;if(t){for(let s of e.state.facet(vt.scrollMargins)){let i=s(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}a=e.scrollDOM.clientHeight-n-r}else a=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,a-5)}}function Vat(e,t){let n=Uat(e),{state:r}=e,a=C_(r.selection,i=>i.empty?e.moveVertically(i,t,n.height):lF(i,t));if(a.eq(r.selection))return!1;let s;if(n.selfScroll){let i=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),c=o.top+n.marginTop,u=o.bottom-n.marginBottom;i&&i.top>c&&i.bottom<u&&(s=vt.scrollIntoView(a.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(eh(r,a),{effects:s}),!0}const A_e=e=>Vat(e,!1),ere=e=>Vat(e,!0);function Yb(e,t,n){let r=e.lineBlockAt(t.head),a=e.moveToLineBoundary(t,n);if(a.head==t.head&&a.head!=(n?r.to:r.from)&&(a=e.moveToLineBoundary(t,n,!1)),!n&&a.head==r.from&&r.length){let s=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&t.head!=r.from+s&&(a=tt.cursor(r.from+s))}return a}const Lln=e=>th(e,t=>Yb(e,t,!0)),Fln=e=>th(e,t=>Yb(e,t,!1)),zln=e=>th(e,t=>Yb(e,t,!rc(e))),Bln=e=>th(e,t=>Yb(e,t,rc(e))),Uln=e=>th(e,t=>tt.cursor(e.lineBlockAt(t.head).from,1)),Vln=e=>th(e,t=>tt.cursor(e.lineBlockAt(t.head).to,-1));function qln(e,t,n){let r=!1,a=C_(e.selection,s=>{let i=Jh(e,s.head,-1)||Jh(e,s.head,1)||s.head>0&&Jh(e,s.head-1,1)||s.head<e.doc.length&&Jh(e,s.head+1,-1);if(!i||!i.end)return s;r=!0;let o=i.start.from==s.head?i.end.to:i.end.from;return tt.cursor(o)});return r?(t(eh(e,a)),!0):!1}const Hln=({state:e,dispatch:t})=>qln(e,t);function Jf(e,t){let n=C_(e.state.selection,r=>{let a=t(r);return tt.range(r.anchor,a.head,a.goalColumn,a.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(eh(e.state,n)),!0)}function qat(e,t){return Jf(e,n=>e.moveByChar(n,t))}const Hat=e=>qat(e,!rc(e)),Qat=e=>qat(e,rc(e));function Wat(e,t){return Jf(e,n=>e.moveByGroup(n,t))}const Qln=e=>Wat(e,!rc(e)),Wln=e=>Wat(e,rc(e)),Gln=e=>Jf(e,t=>cF(e.state,t,!rc(e))),Zln=e=>Jf(e,t=>cF(e.state,t,rc(e)));function Gat(e,t){return Jf(e,n=>e.moveVertically(n,t))}const Zat=e=>Gat(e,!1),Yat=e=>Gat(e,!0);function Xat(e,t){return Jf(e,n=>e.moveVertically(n,t,Uat(e).height))}const I_e=e=>Xat(e,!1),R_e=e=>Xat(e,!0),Yln=e=>Jf(e,t=>Yb(e,t,!0)),Xln=e=>Jf(e,t=>Yb(e,t,!1)),Kln=e=>Jf(e,t=>Yb(e,t,!rc(e))),Jln=e=>Jf(e,t=>Yb(e,t,rc(e))),ecn=e=>Jf(e,t=>tt.cursor(e.lineBlockAt(t.head).from)),tcn=e=>Jf(e,t=>tt.cursor(e.lineBlockAt(t.head).to)),P_e=({state:e,dispatch:t})=>(t(eh(e,{anchor:0})),!0),M_e=({state:e,dispatch:t})=>(t(eh(e,{anchor:e.doc.length})),!0),D_e=({state:e,dispatch:t})=>(t(eh(e,{anchor:e.selection.main.anchor,head:0})),!0),$_e=({state:e,dispatch:t})=>(t(eh(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),ncn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),rcn=({state:e,dispatch:t})=>{let n=uF(e).map(({from:r,to:a})=>tt.range(r,Math.min(a+1,e.doc.length)));return t(e.update({selection:tt.create(n),userEvent:"select"})),!0},acn=({state:e,dispatch:t})=>{let n=C_(e.selection,r=>{let a=ps(e),s=a.resolveStack(r.from,1);if(r.empty){let i=a.resolveStack(r.from,-1);i.node.from>=s.node.from&&i.node.to<=s.node.to&&(s=i)}for(let i=s;i;i=i.next){let{node:o}=i;if((o.from<r.from&&o.to>=r.to||o.to>r.to&&o.from<=r.from)&&i.next)return tt.range(o.to,o.from)}return r});return n.eq(e.selection)?!1:(t(eh(e,n)),!0)};function Kat(e,t){let{state:n}=e,r=n.selection,a=n.selection.ranges.slice();for(let s of n.selection.ranges){let i=n.doc.lineAt(s.head);if(t?i.to<e.state.doc.length:i.from>0)for(let o=s;;){let c=e.moveVertically(o,t);if(c.head<i.from||c.head>i.to){a.some(u=>u.head==c.head)||a.push(c);break}else{if(c.head==o.head)break;o=c}}}return a.length==r.ranges.length?!1:(e.dispatch(eh(n,tt.create(a,a.length-1))),!0)}const scn=e=>Kat(e,!1),icn=e=>Kat(e,!0),ocn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=tt.create([n.main]):n.main.empty||(r=tt.create([tt.cursor(n.main.head)])),r?(t(eh(e,r)),!0):!1};function LI(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,a=r.changeByRange(s=>{let{from:i,to:o}=s;if(i==o){let c=t(s);c<i?(n="delete.backward",c=WM(e,c,!1)):c>i&&(n="delete.forward",c=WM(e,c,!0)),i=Math.min(i,c),o=Math.max(o,c)}else i=WM(e,i,!1),o=WM(e,o,!0);return i==o?{range:s}:{changes:{from:i,to:o},range:tt.cursor(i,i<s.head?-1:1)}});return a.changes.empty?!1:(e.dispatch(r.update(a,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?vt.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function WM(e,t,n){if(e instanceof vt)for(let r of e.state.facet(vt.atomicRanges).map(a=>a(e)))r.between(t,t,(a,s)=>{a<t&&s>t&&(t=n?s:a)});return t}const Jat=(e,t,n)=>LI(e,r=>{let a=r.from,{state:s}=e,i=s.doc.lineAt(a),o,c;if(n&&!t&&a>i.from&&a<i.from+200&&!/[^ \t]/.test(o=i.text.slice(0,a-i.from))){if(o[o.length-1]==" ")return a-1;let u=Vp(o,s.tabSize),d=u%aw(s)||aw(s);for(let f=0;f<d&&o[o.length-1-f]==" ";f++)a--;c=a}else c=el(i.text,a-i.from,t,t)+i.from,c==a&&i.number!=(t?s.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,a-i.from))&&(c=el(i.text,c-i.from,!1,!1)+i.from);return c}),tre=e=>Jat(e,!1,!0),est=e=>Jat(e,!0,!1),tst=(e,t)=>LI(e,n=>{let r=n.head,{state:a}=e,s=a.doc.lineAt(r),i=a.charCategorizer(r);for(let o=null;;){if(r==(t?s.to:s.from)){r==n.head&&s.number!=(t?a.doc.lines:1)&&(r+=t?1:-1);break}let c=el(s.text,r-s.from,t)+s.from,u=s.text.slice(Math.min(r,c)-s.from,Math.max(r,c)-s.from),d=i(u);if(o!=null&&d!=o)break;(u!=" "||r!=n.head)&&(o=d),r=c}return r}),nst=e=>tst(e,!1),lcn=e=>tst(e,!0),ccn=e=>LI(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),ucn=e=>LI(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),dcn=e=>LI(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),fcn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Ca.of(["",""])},range:tt.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},pcn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let a=r.from,s=e.doc.lineAt(a),i=a==s.from?a-1:el(s.text,a-s.from,!1)+s.from,o=a==s.to?a+1:el(s.text,a-s.from,!0)+s.from;return{changes:{from:i,to:o,insert:e.doc.slice(a,o).append(e.doc.slice(i,a))},range:tt.cursor(o)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function uF(e){let t=[],n=-1;for(let r of e.selection.ranges){let a=e.doc.lineAt(r.from),s=e.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=e.doc.lineAt(r.to-1)),n>=a.number){let i=t[t.length-1];i.to=s.to,i.ranges.push(r)}else t.push({from:a.from,to:s.to,ranges:[r]});n=s.number+1}return t}function rst(e,t,n){if(e.readOnly)return!1;let r=[],a=[];for(let s of uF(e)){if(n?s.to==e.doc.length:s.from==0)continue;let i=e.doc.lineAt(n?s.to+1:s.from-1),o=i.length+1;if(n){r.push({from:s.to,to:i.to},{from:s.from,insert:i.text+e.lineBreak});for(let c of s.ranges)a.push(tt.range(Math.min(e.doc.length,c.anchor+o),Math.min(e.doc.length,c.head+o)))}else{r.push({from:i.from,to:s.from},{from:s.to,insert:e.lineBreak+i.text});for(let c of s.ranges)a.push(tt.range(c.anchor-o,c.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:tt.create(a,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const hcn=({state:e,dispatch:t})=>rst(e,t,!1),mcn=({state:e,dispatch:t})=>rst(e,t,!0);function ast(e,t,n){if(e.readOnly)return!1;let r=[];for(let s of uF(e))n?r.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):r.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let a=e.changes(r);return t(e.update({changes:a,selection:e.selection.map(a,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const gcn=({state:e,dispatch:t})=>ast(e,t,!1),vcn=({state:e,dispatch:t})=>ast(e,t,!0),ycn=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(uF(t).map(({from:a,to:s})=>(a>0?a--:s<t.doc.length&&s++,{from:a,to:s}))),r=C_(t.selection,a=>{let s;if(e.lineWrapping){let i=e.lineBlockAt(a.head),o=e.coordsAtPos(a.head,a.assoc||1);o&&(s=i.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(a,!0,s)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function bcn(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ps(e).resolveInner(t),r=n.childBefore(t),a=n.childAfter(t),s;return r&&a&&r.to<=t&&a.from>=t&&(s=r.type.prop(ur.closedBy))&&s.indexOf(a.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(a.from).from&&!/\S/.test(e.sliceDoc(r.to,a.from))?{from:r.to,to:a.from}:null}const L_e=sst(!1),xcn=sst(!0);function sst(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(a=>{let{from:s,to:i}=a,o=t.doc.lineAt(s),c=!e&&s==i&&bcn(t,s);e&&(s=i=(i<=o.to?o:t.doc.lineAt(i)).to);let u=new nF(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=Jue(u,s);for(d==null&&(d=Vp(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;c?{from:s,to:i}=c:s>o.from&&s<o.from+100&&!/\S/.test(o.text.slice(0,s))&&(s=o.from);let f=["",vN(t,d)];return c&&f.push(vN(t,u.lineIndent(o.from,-1))),{changes:{from:s,to:i,insert:Ca.of(f)},range:tt.cursor(s+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Pde(e,t){let n=-1;return e.changeByRange(r=>{let a=[];for(let i=r.from;i<=r.to;){let o=e.doc.lineAt(i);o.number>n&&(r.empty||r.to>o.from)&&(t(o,a,r),n=o.number),i=o.to+1}let s=e.changes(a);return{changes:a,range:tt.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const wcn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new nF(e,{overrideIndentation:s=>{let i=n[s];return i??-1}}),a=Pde(e,(s,i,o)=>{let c=Jue(r,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=vN(e,c);(u!=d||o.from<s.from+u.length)&&(n[s.from]=c,i.push({from:s.from,to:s.from+u.length,insert:d}))});return a.changes.empty||t(e.update(a,{userEvent:"indent"})),!0},ist=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Pde(e,(n,r)=>{r.push({from:n.from,insert:e.facet(k_)})}),{userEvent:"input.indent"})),!0),ost=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Pde(e,(n,r)=>{let a=/^\s*/.exec(n.text)[0];if(!a)return;let s=Vp(a,e.tabSize),i=0,o=vN(e,Math.max(0,s-aw(e)));for(;i<a.length&&i<o.length&&a.charCodeAt(i)==o.charCodeAt(i);)i++;r.push({from:n.from+i,to:n.from+a.length,insert:o.slice(i)})}),{userEvent:"delete.dedent"})),!0),Scn=e=>(e.setTabFocusMode(),!0),Ocn=[{key:"Ctrl-b",run:Dat,shift:Hat,preventDefault:!0},{key:"Ctrl-f",run:$at,shift:Qat},{key:"Ctrl-p",run:zat,shift:Zat},{key:"Ctrl-n",run:Bat,shift:Yat},{key:"Ctrl-a",run:Uln,shift:ecn},{key:"Ctrl-e",run:Vln,shift:tcn},{key:"Ctrl-d",run:est},{key:"Ctrl-h",run:tre},{key:"Ctrl-k",run:ccn},{key:"Ctrl-Alt-h",run:nst},{key:"Ctrl-o",run:fcn},{key:"Ctrl-t",run:pcn},{key:"Ctrl-v",run:ere}],kcn=[{key:"ArrowLeft",run:Dat,shift:Hat,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Rln,shift:Qln,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:zln,shift:Kln,preventDefault:!0},{key:"ArrowRight",run:$at,shift:Qat,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Pln,shift:Wln,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Bln,shift:Jln,preventDefault:!0},{key:"ArrowUp",run:zat,shift:Zat,preventDefault:!0},{mac:"Cmd-ArrowUp",run:P_e,shift:D_e},{mac:"Ctrl-ArrowUp",run:A_e,shift:I_e},{key:"ArrowDown",run:Bat,shift:Yat,preventDefault:!0},{mac:"Cmd-ArrowDown",run:M_e,shift:$_e},{mac:"Ctrl-ArrowDown",run:ere,shift:R_e},{key:"PageUp",run:A_e,shift:I_e},{key:"PageDown",run:ere,shift:R_e},{key:"Home",run:Fln,shift:Xln,preventDefault:!0},{key:"Mod-Home",run:P_e,shift:D_e},{key:"End",run:Lln,shift:Yln,preventDefault:!0},{key:"Mod-End",run:M_e,shift:$_e},{key:"Enter",run:L_e,shift:L_e},{key:"Mod-a",run:ncn},{key:"Backspace",run:tre,shift:tre,preventDefault:!0},{key:"Delete",run:est,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:nst,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:lcn,preventDefault:!0},{mac:"Mod-Backspace",run:ucn,preventDefault:!0},{mac:"Mod-Delete",run:dcn,preventDefault:!0}].concat(Ocn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),_cn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Dln,shift:Gln},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:$ln,shift:Zln},{key:"Alt-ArrowUp",run:hcn},{key:"Shift-Alt-ArrowUp",run:gcn},{key:"Alt-ArrowDown",run:mcn},{key:"Shift-Alt-ArrowDown",run:vcn},{key:"Mod-Alt-ArrowUp",run:scn},{key:"Mod-Alt-ArrowDown",run:icn},{key:"Escape",run:ocn},{key:"Mod-Enter",run:xcn},{key:"Alt-l",mac:"Ctrl-l",run:rcn},{key:"Mod-i",run:acn,preventDefault:!0},{key:"Mod-[",run:ost},{key:"Mod-]",run:ist},{key:"Mod-Alt-\\",run:wcn},{key:"Shift-Mod-k",run:ycn},{key:"Shift-Mod-\\",run:Hln},{key:"Mod-/",run:hln},{key:"Alt-A",run:gln},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Scn}].concat(kcn),Ecn={key:"Tab",run:ist,shift:ost},F_e=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class vk{constructor(t,n,r=0,a=t.length,s,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,a),this.bufferStart=r,this.normalize=s?o=>s(F_e(o)):F_e,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return tu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Mue(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Bh(t);let a=this.normalize(n);if(a.length)for(let s=0,i=r;;s++){let o=a.charCodeAt(s),c=this.match(o,i,this.bufferPos+this.bufferStart);if(s==a.length-1){if(c)return this.value=c,this;break}i==r&&s<n.length&&n.charCodeAt(s)==o&&i++}}}match(t,n,r){let a=null;for(let s=0;s<this.matches.length;s+=2){let i=this.matches[s],o=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?a={from:this.matches[s+1],to:r}:(this.matches[s]++,o=!0)),o||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?a={from:n,to:r}:this.matches.push(1,n)),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}}typeof Symbol<"u"&&(vk.prototype[Symbol.iterator]=function(){return this});const lst={from:-1,to:-1,match:/.*/.exec("")},Mde="gm"+(/x/.unicode==null?"":"u");class cst{constructor(t,n,r,a=0,s=t.length){if(this.text=t,this.to=s,this.curLine="",this.done=!1,this.value=lst,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new ust(t,n,r,a,s);this.re=new RegExp(n,Mde+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let i=t.lineAt(a);this.curLineStart=i.from,this.matchPos=L3(t,a),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 n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,a=r+n[0].length;if(this.matchPos=L3(this.text,a+(r==a?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<a||r>this.value.to)&&(!this.test||this.test(r,a,n)))return this.value={from:r,to:a,match:n},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 CU=new WeakMap;class xO{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let a=CU.get(t);if(!a||a.from>=r||a.to<=n){let o=new xO(n,t.sliceString(n,r));return CU.set(t,o),o}if(a.from==n&&a.to==r)return a;let{text:s,from:i}=a;return i>n&&(s=t.sliceString(n,i)+s,i=n),a.to<r&&(s+=t.sliceString(a.to,r)),CU.set(t,new xO(i,s)),new xO(n,s.slice(n-i,r-i))}}class ust{constructor(t,n,r,a,s){this.text=t,this.to=s,this.done=!1,this.value=lst,this.matchPos=L3(t,a),this.re=new RegExp(n,Mde+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=xO.get(t,a,this.chunkEnd(a+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,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,a=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,a,n)))return this.value={from:r,to:a,match:n},this.matchPos=L3(this.text,a+(r==a?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=xO.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(cst.prototype[Symbol.iterator]=ust.prototype[Symbol.iterator]=function(){return this});function Ccn(e){try{return new RegExp(e,Mde),!0}catch{return!1}}function L3(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function nre(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),n=bs("input",{class:"cm-textfield",name:"line",value:t}),r=bs("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),e.dispatch({effects:Jj.of(!1)}),e.focus()):s.keyCode==13&&(s.preventDefault(),a())},onsubmit:s=>{s.preventDefault(),a()}},bs("label",e.state.phrase("Go to line"),": ",n)," ",bs("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),bs("button",{name:"close",onclick:()=>{e.dispatch({effects:Jj.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function a(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!s)return;let{state:i}=e,o=i.doc.lineAt(i.selection.main.head),[,c,u,d,f]=s,p=d?+d.slice(1):0,h=u?+u:o.number;if(u&&f){let v=h/100;c&&(v=v*(c=="-"?-1:1)+o.number/i.doc.lines),h=Math.round(i.doc.lines*v)}else u&&c&&(h=h*(c=="-"?-1:1)+o.number);let m=i.doc.line(Math.max(1,Math.min(i.doc.lines,h))),g=tt.cursor(m.from+Math.max(0,Math.min(p,m.length)));e.dispatch({effects:[Jj.of(!1),vt.scrollIntoView(g.from,{y:"center"})],selection:g}),e.focus()}return{dom:r}}const Jj=Kn.define(),z_e=Ji.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(Jj)&&(e=n.value);return e},provide:e=>gN.from(e,t=>t?nre:null)}),jcn=e=>{let t=mN(e,nre);if(!t){let n=[Jj.of(!0)];e.state.field(z_e,!1)==null&&n.push(Kn.appendConfig.of([z_e,Tcn])),e.dispatch({effects:n}),t=mN(e,nre)}return t&&t.dom.querySelector("input").select(),!0},Tcn=vt.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"}}}),Ncn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Acn=Xt.define({combine(e){return Pm(e,Ncn,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Icn(e){return[$cn,Dcn]}const Rcn=tn.mark({class:"cm-selectionMatch"}),Pcn=tn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function B_e(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=ri.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=ri.Word)}function Mcn(e,t,n,r){return e(t.sliceDoc(n,n+1))==ri.Word&&e(t.sliceDoc(r-1,r))==ri.Word}const Dcn=hi.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(Acn),{state:n}=e,r=n.selection;if(r.ranges.length>1)return tn.none;let a=r.main,s,i=null;if(a.empty){if(!t.highlightWordAroundCursor)return tn.none;let c=n.wordAt(a.head);if(!c)return tn.none;i=n.charCategorizer(a.head),s=n.sliceDoc(c.from,c.to)}else{let c=a.to-a.from;if(c<t.minSelectionLength||c>200)return tn.none;if(t.wholeWords){if(s=n.sliceDoc(a.from,a.to),i=n.charCategorizer(a.head),!(B_e(i,n,a.from,a.to)&&Mcn(i,n,a.from,a.to)))return tn.none}else if(s=n.sliceDoc(a.from,a.to),!s)return tn.none}let o=[];for(let c of e.visibleRanges){let u=new vk(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||B_e(i,n,d,f))&&(a.empty&&d<=a.from&&f>=a.to?o.push(Pcn.range(d,f)):(d>=a.to||f<=a.from)&&o.push(Rcn.range(d,f)),o.length>t.maxMatches))return tn.none}}return tn.set(o)}},{decorations:e=>e.decorations}),$cn=vt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Lcn=({state:e,dispatch:t})=>{let{selection:n}=e,r=tt.create(n.ranges.map(a=>e.wordAt(a.head)||tt.cursor(a.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Fcn(e,t){let{main:n,ranges:r}=e.selection,a=e.wordAt(n.head),s=a&&a.from==n.from&&a.to==n.to;for(let i=!1,o=new vk(e.doc,t,r[r.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new vk(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),i=!0}else{if(i&&r.some(c=>c.from==o.value.from))continue;if(s){let c=e.wordAt(o.value.from);if(!c||c.from!=o.value.from||c.to!=o.value.to)continue}return o.value}}const zcn=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return Lcn({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=r))return!1;let a=Fcn(e,r);return a?(t(e.update({selection:e.selection.addRange(tt.range(a.from,a.to),!1),effects:vt.scrollIntoView(a.to)})),!0):!1},j_=Xt.define({combine(e){return Pm(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Kcn(t),scrollToMatch:t=>vt.scrollIntoView(t)})}});class dst{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||Ccn(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
209
209
  `:r=="r"?"\r":r=="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 qcn(this):new Ucn(this)}getCursor(t,n=0,r){let a=t.doc?t:Pr.create({doc:t});return r==null&&(r=a.doc.length),this.regexp?C1(this,a,n,r):E1(this,a,n,r)}}class fst{constructor(t){this.spec=t}}function E1(e,t,n,r){return new vk(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:a=>a.toLowerCase(),e.wholeWord?Bcn(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function Bcn(e,t){return(n,r,a,s)=>((s>n||s+a.length<r)&&(s=Math.max(0,n-2),a=e.sliceString(s,Math.min(e.length,r+2))),(t(F3(a,n-s))!=ri.Word||t(z3(a,n-s))!=ri.Word)&&(t(z3(a,r-s))!=ri.Word||t(F3(a,r-s))!=ri.Word))}class Ucn extends fst{constructor(t){super(t)}nextMatch(t,n,r){let a=E1(this.spec,t,r,t.doc.length).nextOverlapping();if(a.done){let s=Math.min(t.doc.length,n+this.spec.unquoted.length);a=E1(this.spec,t,0,s).nextOverlapping()}return a.done||a.value.from==n&&a.value.to==r?null:a.value}prevMatchInRange(t,n,r){for(let a=r;;){let s=Math.max(n,a-1e4-this.spec.unquoted.length),i=E1(this.spec,t,s,a),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(s==n)return null;a-=1e4}}prevMatch(t,n,r){let a=this.prevMatchInRange(t,0,n);return a||(a=this.prevMatchInRange(t,Math.max(0,r-this.spec.unquoted.length),t.doc.length)),a&&(a.from!=n||a.to!=r)?a:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,n){let r=E1(this.spec,t,0,t.doc.length),a=[];for(;!r.next().done;){if(a.length>=n)return null;a.push(r.value)}return a}highlight(t,n,r,a){let s=E1(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)a(s.value.from,s.value.to)}}function C1(e,t,n,r){return new cst(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?Vcn(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function F3(e,t){return e.slice(el(e,t,!1),t)}function z3(e,t){return e.slice(t,el(e,t))}function Vcn(e){return(t,n,r)=>!r[0].length||(e(F3(r.input,r.index))!=ri.Word||e(z3(r.input,r.index))!=ri.Word)&&(e(z3(r.input,r.index+r[0].length))!=ri.Word||e(F3(r.input,r.index+r[0].length))!=ri.Word)}class qcn extends fst{nextMatch(t,n,r){let a=C1(this.spec,t,r,t.doc.length).next();return a.done&&(a=C1(this.spec,t,0,n).next()),a.done?null:a.value}prevMatchInRange(t,n,r){for(let a=1;;a++){let s=Math.max(n,r-a*1e4),i=C1(this.spec,t,s,r),o=null;for(;!i.next().done;)o=i.value;if(o&&(s==n||o.from>s+10))return o;if(s==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return t.match[0];if(r=="$")return"$";for(let a=r.length;a>0;a--){let s=+r.slice(0,a);if(s>0&&s<t.match.length)return t.match[s]+r.slice(a)}return n})}matchAll(t,n){let r=C1(this.spec,t,0,t.doc.length),a=[];for(;!r.next().done;){if(a.length>=n)return null;a.push(r.value)}return a}highlight(t,n,r,a){let s=C1(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!s.next().done;)a(s.value.from,s.value.to)}}const CN=Kn.define(),Dde=Kn.define(),Ky=Ji.define({create(e){return new jU(rre(e).create(),null)},update(e,t){for(let n of t.effects)n.is(CN)?e=new jU(n.value.create(),e.panel):n.is(Dde)&&(e=new jU(e.query,n.value?$de:null));return e},provide:e=>gN.from(e,t=>t.panel)});class jU{constructor(t,n){this.query=t,this.panel=n}}const Hcn=tn.mark({class:"cm-searchMatch"}),Qcn=tn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Wcn=hi.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Ky))}update(e){let t=e.state.field(Ky);(t!=e.startState.field(Ky)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return tn.none;let{view:n}=this,r=new Eu;for(let a=0,s=n.visibleRanges,i=s.length;a<i;a++){let{from:o,to:c}=s[a];for(;a<i-1&&c>s[a+1].from-500;)c=s[++a].to;e.highlight(n.state,o,c,(u,d)=>{let f=n.state.selection.ranges.some(p=>p.from==u&&p.to==d);r.add(u,d,f?Qcn:Hcn)})}return r.finish()}},{decorations:e=>e.decorations});function FI(e){return t=>{let n=t.state.field(Ky,!1);return n&&n.query.spec.valid?e(t,n):mst(t)}}const B3=FI((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let a=tt.single(r.from,r.to),s=e.state.facet(j_);return e.dispatch({selection:a,effects:[Lde(e,r),s.scrollToMatch(a.main,e)],userEvent:"select.search"}),hst(e),!0}),U3=FI((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,a=t.prevMatch(n,r,r);if(!a)return!1;let s=tt.single(a.from,a.to),i=e.state.facet(j_);return e.dispatch({selection:s,effects:[Lde(e,a),i.scrollToMatch(s.main,e)],userEvent:"select.search"}),hst(e),!0}),Gcn=FI((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:tt.create(n.map(r=>tt.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),Zcn=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:a}=n.main,s=[],i=0;for(let o=new vk(e.doc,e.sliceDoc(r,a));!o.next().done;){if(s.length>1e3)return!1;o.value.from==r&&(i=s.length),s.push(tt.range(o.value.from,o.value.to))}return t(e.update({selection:tt.create(s,i),userEvent:"select.search.matches"})),!0},U_e=FI((e,{query:t})=>{let{state:n}=e,{from:r,to:a}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,r,r);if(!s)return!1;let i=s,o=[],c,u,d=[];i.from==r&&i.to==a&&(u=n.toText(t.getReplacement(i)),o.push({from:i.from,to:i.to,insert:u}),i=t.nextMatch(n,i.from,i.to),d.push(vt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let f=e.state.changes(o);return i&&(c=tt.single(i.from,i.to).map(f),d.push(Lde(e,i)),d.push(n.facet(j_).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),Ycn=FI((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(a=>{let{from:s,to:i}=a;return{from:s,to:i,insert:t.getReplacement(a)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:vt.announce.of(r),userEvent:"input.replace.all"}),!0});function $de(e){return e.state.facet(j_).createPanel(e)}function rre(e,t){var n,r,a,s,i;let o=e.selection.main,c=o.empty||o.to>o.from+100?"":e.sliceDoc(o.from,o.to);if(t&&!c)return t;let u=e.facet(j_);return new dst({search:((n=t?.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r:u.caseSensitive,literal:(a=t?.literal)!==null&&a!==void 0?a:u.literal,regexp:(s=t?.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(i=t?.wholeWord)!==null&&i!==void 0?i:u.wholeWord})}function pst(e){let t=mN(e,$de);return t&&t.dom.querySelector("[main-field]")}function hst(e){let t=pst(e);t&&t==e.root.activeElement&&t.select()}const mst=e=>{let t=e.state.field(Ky,!1);if(t&&t.panel){let n=pst(e);if(n&&n!=e.root.activeElement){let r=rre(e.state,t.query.spec);r.valid&&e.dispatch({effects:CN.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Dde.of(!0),t?CN.of(rre(e.state,t.query.spec)):Kn.appendConfig.of(eun)]});return!0},gst=e=>{let t=e.state.field(Ky,!1);if(!t||!t.panel)return!1;let n=mN(e,$de);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Dde.of(!1)}),!0},Xcn=[{key:"Mod-f",run:mst,scope:"editor search-panel"},{key:"F3",run:B3,shift:U3,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:B3,shift:U3,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:gst,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Zcn},{key:"Mod-Alt-g",run:jcn},{key:"Mod-d",run:zcn,preventDefault:!0}];class Kcn{constructor(t){this.view=t;let n=this.query=t.state.field(Ky).query.spec;this.commit=this.commit.bind(this),this.searchField=bs("input",{value:n.search,placeholder:Hu(t,"Find"),"aria-label":Hu(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=bs("input",{value:n.replace,placeholder:Hu(t,"Replace"),"aria-label":Hu(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=bs("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=bs("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=bs("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(a,s,i){return bs("button",{class:"cm-button",name:a,onclick:s,type:"button"},i)}this.dom=bs("div",{onkeydown:a=>this.keydown(a),class:"cm-search"},[this.searchField,r("next",()=>B3(t),[Hu(t,"next")]),r("prev",()=>U3(t),[Hu(t,"previous")]),r("select",()=>Gcn(t),[Hu(t,"all")]),bs("label",null,[this.caseField,Hu(t,"match case")]),bs("label",null,[this.reField,Hu(t,"regexp")]),bs("label",null,[this.wordField,Hu(t,"by word")]),...t.state.readOnly?[]:[bs("br"),this.replaceField,r("replace",()=>U_e(t),[Hu(t,"replace")]),r("replaceAll",()=>Ycn(t),[Hu(t,"replace all")])],bs("button",{name:"close",onclick:()=>gst(t),"aria-label":Hu(t,"close"),type:"button"},["×"])])}commit(){let t=new dst({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:CN.of(t)}))}keydown(t){Cnn(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?U3:B3)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),U_e(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(CN)&&!r.value.eq(this.query)&&this.setQuery(r.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(j_).top}}function Hu(e,t){return e.state.phrase(t)}const GM=30,ZM=/[\s\.,:;?!]/;function Lde(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),a=e.state.doc.lineAt(n).to,s=Math.max(r.from,t-GM),i=Math.min(a,n+GM),o=e.state.sliceDoc(s,i);if(s!=r.from){for(let c=0;c<GM;c++)if(!ZM.test(o[c+1])&&ZM.test(o[c])){o=o.slice(c);break}}if(i!=a){for(let c=o.length-1;c>o.length-GM;c--)if(!ZM.test(o[c-1])&&ZM.test(o[c])){o=o.slice(0,c);break}}return vt.announce.of(`${e.state.phrase("current match")}. ${o} ${e.state.phrase("on line")} ${r.number}.`)}const Jcn=vt.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"}}),eun=[Ky,Jp.low(Wcn),Jcn];class V_e{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class r0{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let a=r.facet(jN).markerFilter;a&&(t=a(t,r));let s=t.slice().sort((d,f)=>d.from-f.from||d.to-f.to),i=new Eu,o=[],c=0;for(let d=0;;){let f=d==s.length?null:s[d];if(!f&&!o.length)break;let p,h;for(o.length?(p=c,h=o.reduce((g,v)=>Math.min(g,v.to),f&&f.from>p?f.from:1e8)):(p=f.from,h=f.to,o.push(f),d++);d<s.length;){let g=s[d];if(g.from==p&&(g.to>g.from||g.to==p))o.push(g),d++,h=Math.min(g.to,h);else{h=Math.min(g.from,h);break}}let m=pun(o);if(o.some(g=>g.from==g.to||g.from==g.to-1&&r.doc.lineAt(g.from).to==g.from))i.add(p,p,tn.widget({widget:new cun(m),diagnostics:o.slice()}));else{let g=o.reduce((v,b)=>b.markClass?v+" "+b.markClass:v,"");i.add(p,h,tn.mark({class:"cm-lintRange cm-lintRange-"+m+g,diagnostics:o.slice(),inclusiveEnd:o.some(v=>v.to>h)}))}c=h;for(let g=0;g<o.length;g++)o[g].to<=c&&o.splice(g--,1)}let u=i.finish();return new r0(u,n,yk(u))}}function yk(e,t=null,n=0){let r=null;return e.between(n,1e9,(a,s,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new V_e(a,s,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new V_e(r.from,s,r.diagnostic)}}),r}function tun(e,t){let n=t.pos,r=t.end||n,a=e.state.facet(jN).hideOn(e,n,r);if(a!=null)return a;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(vst))||e.changes.touchesRange(s.from,Math.max(s.to,r)))}function nun(e,t){return e.field(cd,!1)?t:t.concat(Kn.appendConfig.of(hun))}const vst=Kn.define(),Fde=Kn.define(),yst=Kn.define(),cd=Ji.define({create(){return new r0(tn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,a=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);r=yk(n,e.selected.diagnostic,s)||yk(n,null,s)}!n.size&&a&&t.state.facet(jN).autoPanel&&(a=null),e=new r0(n,a,r)}for(let n of t.effects)if(n.is(vst)){let r=t.state.facet(jN).autoPanel?n.value.length?TN.open:null:e.panel;e=r0.init(n.value,r,t.state)}else n.is(Fde)?e=new r0(e.diagnostics,n.value?TN.open:null,e.selected):n.is(yst)&&(e=new r0(e.diagnostics,e.panel,n.value));return e},provide:e=>[gN.from(e,t=>t.panel),vt.decorations.from(e,t=>t.diagnostics)]}),run=tn.mark({class:"cm-lintRange cm-lintRange-active"});function aun(e,t,n){let{diagnostics:r}=e.state.field(cd),a,s=-1,i=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(t<u||n<0)))return a=d.diagnostics,s=c,i=u,!1});let o=e.state.facet(jN).tooltipFilter;return a&&o&&(a=o(a,e.state)),a?{pos:s,end:i,above:e.state.doc.lineAt(s).to<i,create(){return{dom:sun(e,a)}}}:null}function sun(e,t){return bs("ul",{class:"cm-tooltip-lint"},t.map(n=>xst(e,n,!1)))}const iun=e=>{let t=e.state.field(cd,!1);(!t||!t.panel)&&e.dispatch({effects:nun(e.state,[Fde.of(!0)])});let n=mN(e,TN.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},q_e=e=>{let t=e.state.field(cd,!1);return!t||!t.panel?!1:(e.dispatch({effects:Fde.of(!1)}),!0)},oun=e=>{let t=e.state.field(cd,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},lun=[{key:"Mod-Shift-m",run:iun,preventDefault:!0},{key:"F8",run:oun}],jN=Xt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Pm(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:H_e,tooltipFilter:H_e,needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n,hideOn:(t,n)=>t?n?(r,a,s)=>t(r,a,s)||n(r,a,s):t:n,autoPanel:(t,n)=>t||n})}}});function H_e(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function bst(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;r<n.length;r++){let a=n[r];if(/[a-zA-Z]/.test(a)&&!t.some(s=>s.toLowerCase()==a.toLowerCase())){t.push(a);continue e}}t.push("")}return t}function xst(e,t,n){var r;let a=n?bst(t.actions):[];return bs("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},bs("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((s,i)=>{let o=!1,c=h=>{if(h.preventDefault(),o)return;o=!0;let m=yk(e.state.field(cd).diagnostics,t);m&&s.apply(e,m.from,m.to)},{name:u}=s,d=a[i]?u.indexOf(a[i]):-1,f=d<0?u:[u.slice(0,d),bs("u",u.slice(d,d+1)),u.slice(d+1)],p=s.markClass?" "+s.markClass:"";return bs("button",{type:"button",class:"cm-diagnosticAction"+p,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${a[i]})"`}.`},f)}),t.source&&bs("div",{class:"cm-diagnosticSource"},t.source))}class cun extends $d{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return bs("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Q_e{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=xst(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class TN{constructor(t){this.view=t,this.items=[];let n=a=>{if(a.keyCode==27)q_e(this.view),this.view.focus();else if(a.keyCode==38||a.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(a.keyCode==40||a.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(a.keyCode==36)this.moveSelection(0);else if(a.keyCode==35)this.moveSelection(this.items.length-1);else if(a.keyCode==13)this.view.focus();else if(a.keyCode>=65&&a.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],i=bst(s.actions);for(let o=0;o<i.length;o++)if(i[o].toUpperCase().charCodeAt(0)==a.keyCode){let c=yk(this.view.state.field(cd).diagnostics,s);c&&s.actions[o].apply(t,c.from,c.to)}}else return;a.preventDefault()},r=a=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(a.target)&&this.moveSelection(s)};this.list=bs("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=bs("div",{class:"cm-panel-lint"},this.list,bs("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>q_e(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(cd).selected;if(!t)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==t.diagnostic)return n;return-1}update(){let{diagnostics:t,selected:n}=this.view.state.field(cd),r=0,a=!1,s=null,i=new Set;for(t.between(0,this.view.state.doc.length,(o,c,{spec:u})=>{for(let d of u.diagnostics){if(i.has(d))continue;i.add(d);let f=-1,p;for(let h=r;h<this.items.length;h++)if(this.items[h].diagnostic==d){f=h;break}f<0?(p=new Q_e(this.view,d),this.items.splice(r,0,p),a=!0):(p=this.items[f],f>r&&(this.items.splice(r,f-r),a=!0)),n&&p.diagnostic==n.diagnostic?p.dom.hasAttribute("aria-selected")||(p.dom.setAttribute("aria-selected","true"),s=p):p.dom.hasAttribute("aria-selected")&&p.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)a=!0,this.items.pop();this.items.length==0&&(this.items.push(new Q_e(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),a=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:c})=>{let u=c.height/this.list.offsetHeight;o.top<c.top?this.list.scrollTop-=(c.top-o.top)/u:o.bottom>c.bottom&&(this.list.scrollTop+=(o.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),a&&this.sync()}sync(){let t=this.list.firstChild;function n(){let r=t;t=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(cd),r=yk(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:yst.of(r)})}static open(t){return new TN(t)}}function uun(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 YM(e){return uun(`<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 dun=vt.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:YM("#d11")},".cm-lintRange-warning":{backgroundImage:YM("orange")},".cm-lintRange-info":{backgroundImage:YM("#999")},".cm-lintRange-hint":{backgroundImage:YM("#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 fun(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function pun(e){let t="hint",n=1;for(let r of e){let a=fun(r.severity);a>n&&(n=a,t=r.severity)}return t}const hun=[cd,vt.decorations.compute([cd],e=>{let{selected:t,panel:n}=e.field(cd);return!t||!n||t.from==t.to?tn.none:tn.set([run.range(t.from,t.to)])}),hrn(aun,{hideOn:tun}),dun];var W_e=function(t){t===void 0&&(t={});var{crosshairCursor:n=!1}=t,r=[];t.closeBracketsKeymap!==!1&&(r=r.concat(csn)),t.defaultKeymap!==!1&&(r=r.concat(_cn)),t.searchKeymap!==!1&&(r=r.concat(Xcn)),t.historyKeymap!==!1&&(r=r.concat(Iln)),t.foldKeymap!==!1&&(r=r.concat(Grn)),t.completionKeymap!==!1&&(r=r.concat(ort)),t.lintKeymap!==!1&&(r=r.concat(lun));var a=[];return t.lineNumbers!==!1&&a.push(krn()),t.highlightActiveLineGutter!==!1&&a.push(Crn()),t.highlightSpecialChars!==!1&&a.push(Vnn()),t.history!==!1&&a.push(Oln()),t.foldGutter!==!1&&a.push(Krn()),t.drawSelection!==!1&&a.push(Rnn()),t.dropCursor!==!1&&a.push(Lnn()),t.allowMultipleSelections!==!1&&a.push(Pr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&a.push(zrn()),t.syntaxHighlighting!==!1&&a.push(nde(nan,{fallback:!0})),t.bracketMatching!==!1&&a.push(can()),t.closeBrackets!==!1&&a.push(ssn()),t.autocompletion!==!1&&a.push(irt()),t.rectangularSelection!==!1&&a.push(rrn()),n!==!1&&a.push(irn()),t.highlightActiveLine!==!1&&a.push(Znn()),t.highlightSelectionMatches!==!1&&a.push(Icn()),t.tabSize&&typeof t.tabSize=="number"&&a.push(k_.of(" ".repeat(t.tabSize))),a.concat([O_.of(r.flat())]).filter(Boolean)};const mun="#e5c07b",G_e="#e06c75",gun="#56b6c2",vun="#ffffff",LD="#abb2bf",are="#7d8799",yun="#61afef",bun="#98c379",Z_e="#d19a66",xun="#c678dd",wun="#21252b",Y_e="#2c313a",X_e="#282c34",TU="#353a42",Sun="#3E4451",K_e="#528bff",Oun=vt.theme({"&":{color:LD,backgroundColor:X_e},".cm-content":{caretColor:K_e},".cm-cursor, .cm-dropCursor":{borderLeftColor:K_e},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Sun},".cm-panels":{backgroundColor:wun,color:LD},".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:X_e,color:are,border:"none"},".cm-activeLineGutter":{backgroundColor:Y_e},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:TU},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:TU,borderBottomColor:TU},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Y_e,color:LD}}},{dark:!0}),kun=__.define([{tag:he.keyword,color:xun},{tag:[he.name,he.deleted,he.character,he.propertyName,he.macroName],color:G_e},{tag:[he.function(he.variableName),he.labelName],color:yun},{tag:[he.color,he.constant(he.name),he.standard(he.name)],color:Z_e},{tag:[he.definition(he.name),he.separator],color:LD},{tag:[he.typeName,he.className,he.number,he.changed,he.annotation,he.modifier,he.self,he.namespace],color:mun},{tag:[he.operator,he.operatorKeyword,he.url,he.escape,he.regexp,he.link,he.special(he.string)],color:gun},{tag:[he.meta,he.comment],color:are},{tag:he.strong,fontWeight:"bold"},{tag:he.emphasis,fontStyle:"italic"},{tag:he.strikethrough,textDecoration:"line-through"},{tag:he.link,color:are,textDecoration:"underline"},{tag:he.heading,fontWeight:"bold",color:G_e},{tag:[he.atom,he.bool,he.special(he.variableName)],color:Z_e},{tag:[he.processingInstruction,he.string,he.inserted],color:bun},{tag:he.invalid,color:vun}]),_un=[Oun,nde(kun)];var Eun=vt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Cun=function(t){t===void 0&&(t={});var{indentWithTab:n=!0,editable:r=!0,readOnly:a=!1,theme:s="light",placeholder:i="",basicSetup:o=!0}=t,c=[];switch(n&&c.unshift(O_.of([Ecn])),o&&(typeof o=="boolean"?c.unshift(W_e()):c.unshift(W_e(o))),i&&c.unshift(Jnn(i)),s){case"light":c.push(Eun);break;case"dark":c.push(_un);break;case"none":break;default:c.push(s);break}return r===!1&&c.push(vt.editable.of(!1)),a&&c.push(Pr.readOnly.of(!0)),[...c]},jun=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 Tun{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,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(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}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 J_e=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 NU=null,Nun=()=>typeof window>"u"?new J_e:(NU||(NU=new J_e),NU),eEe=Rm.define(),Aun=200,Iun=[];function Run(e){var{value:t,selection:n,onChange:r,onStatistics:a,onCreateEditor:s,onUpdate:i,extensions:o=Iun,autoFocus:c,theme:u="light",height:d=null,minHeight:f=null,maxHeight:p=null,width:h=null,minWidth:m=null,maxWidth:g=null,placeholder:v="",editable:b=!0,readOnly:S=!1,indentWithTab:O=!0,basicSetup:k=!0,root:E,initialState:C}=e,[T,j]=x.useState(),[A,I]=x.useState(),[P,M]=x.useState(),F=x.useState(()=>({current:null}))[0],D=x.useState(()=>({current:null}))[0],V=vt.theme({"&":{height:d,minHeight:f,maxHeight:p,width:h,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),H=vt.updateListener.of(W=>{if(W.docChanged&&typeof r=="function"&&!W.transactions.some(z=>z.annotation(eEe))){F.current?F.current.reset():(F.current=new Tun(()=>{if(D.current){var z=D.current;D.current=null,z()}F.current=null},Aun),Nun().add(F.current));var L=W.state.doc,Z=L.toString();r(Z,W)}a&&a(jun(W))}),B=Cun({theme:u,editable:b,readOnly:S,placeholder:v,indentWithTab:O,basicSetup:k}),q=[H,V,...B];return i&&typeof i=="function"&&q.push(vt.updateListener.of(i)),q=q.concat(o),x.useLayoutEffect(()=>{if(T&&!P){var W={doc:t,selection:n,extensions:q},L=C?Pr.fromJSON(C.json,W,C.fields):Pr.create(W);if(M(L),!A){var Z=new vt({state:L,parent:T,root:E});I(Z),s&&s(Z,L)}}return()=>{A&&(M(void 0),I(void 0))}},[T,P]),x.useEffect(()=>{e.container&&j(e.container)},[e.container]),x.useEffect(()=>()=>{A&&(A.destroy(),I(void 0)),F.current&&(F.current.cancel(),F.current=null)},[A]),x.useEffect(()=>{c&&A&&A.focus()},[c,A]),x.useEffect(()=>{A&&A.dispatch({effects:Kn.reconfigure.of(q)})},[u,o,d,f,p,h,m,g,v,b,S,O,k,r,i]),x.useEffect(()=>{if(t!==void 0){var W=A?A.state.doc.toString():"";if(A&&t!==W){var L=F.current&&!F.current.isDone,Z=()=>{A&&t!==A.state.doc.toString()&&A.dispatch({changes:{from:0,to:A.state.doc.toString().length,insert:t||""},annotations:[eEe.of(!0)]})};L?D.current=Z:Z()}}},[t,A]),{state:P,setState:M,view:A,setView:I,container:T,setContainer:j}}var Pun=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Ed=x.forwardRef((e,t)=>{var{className:n,value:r="",selection:a,extensions:s=[],onChange:i,onStatistics:o,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:f="light",height:p,minHeight:h,maxHeight:m,width:g,minWidth:v,maxWidth:b,basicSetup:S,placeholder:O,indentWithTab:k,editable:E,readOnly:C,root:T,initialState:j}=e,A=iue(e,Pun),I=x.useRef(null),{state:P,view:M,container:F,setContainer:D}=Run({root:T,value:r,autoFocus:d,theme:f,height:p,minHeight:h,maxHeight:m,width:g,minWidth:v,maxWidth:b,basicSetup:S,placeholder:O,indentWithTab:k,editable:E,readOnly:C,selection:a,onChange:i,onStatistics:o,onCreateEditor:c,onUpdate:u,extensions:s,initialState:j});x.useImperativeHandle(t,()=>({editor:I.current,state:P,view:M}),[I,F,P,M]);var V=x.useCallback(B=>{I.current=B,D(B)},[D]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var H=typeof f=="string"?"cm-theme-"+f:"cm-theme";return l.jsx("div",wb({ref:V,className:""+H+(n?" "+n:"")},A))});Ed.displayName="CodeMirror";function Mun(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Dun=e=>{switch(e){case"success":return Fun;case"info":return Bun;case"warning":return zun;case"error":return Uun;default:return null}},$un=Array(12).fill(0),Lun=({visible:e,className:t})=>Ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ee.createElement("div",{className:"sonner-spinner"},$un.map((n,r)=>Ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Fun=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"})),zun=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"})),Bun=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"})),Uun=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"})),Vun=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"})),qun=()=>{const[e,t]=Ee.useState(document.hidden);return Ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let sre=1;class Hun{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...a}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:sre++,i=this.toasts.find(c=>c.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:r}),{...c,...t,id:s,dismissible:o,title:r}):c):this.addToast({title:r,...a,dismissible:o,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,i;const o=a.then(async u=>{if(i=["resolve",u],Ee.isValidElement(u))s=!1,this.create({id:r,type:"default",message:u});else if(Wun(u)&&!u.ok){s=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,m=typeof f=="object"&&!Ee.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...m})}else if(u instanceof Error){s=!1;const f=typeof n.error=="function"?await n.error(u):n.error,p=typeof n.description=="function"?await n.description(u):n.description,m=typeof f=="object"&&!Ee.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...m})}else if(n.success!==void 0){s=!1;const f=typeof n.success=="function"?await n.success(u):n.success,p=typeof n.description=="function"?await n.description(u):n.description,m=typeof f=="object"&&!Ee.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:p,...m})}}).catch(async u=>{if(i=["reject",u],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,h=typeof d=="object"&&!Ee.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...h})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,d)=>o.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=n?.id||sre++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Xc=new Hun,Qun=(e,t)=>{const n=t?.id||sre++;return Xc.addToast({title:e,...t,id:n}),n},Wun=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Gun=Qun,Zun=()=>Xc.toasts,Yun=()=>Xc.getActiveToasts(),Xl=Object.assign(Gun,{success:Xc.success,info:Xc.info,warning:Xc.warning,error:Xc.error,custom:Xc.custom,message:Xc.message,promise:Xc.promise,dismiss:Xc.dismiss,loading:Xc.loading},{getHistory:Zun,getToasts:Yun});Mun("[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 XM(e){return e.label!==void 0}const Xun=3,Kun="24px",Jun="16px",tEe=4e3,edn=356,tdn=14,ndn=45,rdn=200;function Oh(...e){return e.filter(Boolean).join(" ")}function adn(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const sdn=e=>{var t,n,r,a,s,i,o,c,u;const{invert:d,toast:f,unstyled:p,interacting:h,setHeights:m,visibleToasts:g,heights:v,index:b,toasts:S,expanded:O,removeToast:k,defaultRichColors:E,closeButton:C,style:T,cancelButtonStyle:j,actionButtonStyle:A,className:I="",descriptionClassName:P="",duration:M,position:F,gap:D,expandByDefault:V,classNames:H,icons:B,closeButtonAriaLabel:q="Close toast"}=e,[W,L]=Ee.useState(null),[Z,z]=Ee.useState(null),[R,Q]=Ee.useState(!1),[G,ee]=Ee.useState(!1),[re,ne]=Ee.useState(!1),[se,oe]=Ee.useState(!1),[pe,K]=Ee.useState(!1),[ae,ie]=Ee.useState(0),[ve,ye]=Ee.useState(0),fe=Ee.useRef(f.duration||M||tEe),xe=Ee.useRef(null),le=Ee.useRef(null),we=b===0,J=b+1<=g,X=f.type,ue=f.dismissible!==!1,Se=f.className||"",Ce=f.descriptionClassName||"",ce=Ee.useMemo(()=>v.findIndex(Et=>Et.toastId===f.id)||0,[v,f.id]),_e=Ee.useMemo(()=>{var Et;return(Et=f.closeButton)!=null?Et:C},[f.closeButton,C]),Ie=Ee.useMemo(()=>f.duration||M||tEe,[f.duration,M]),Me=Ee.useRef(0),et=Ee.useRef(0),kt=Ee.useRef(0),Yt=Ee.useRef(null),[Sn,Rn]=F.split("-"),ct=Ee.useMemo(()=>v.reduce((Et,Ut,$n)=>$n>=ce?Et:Et+Ut.height,0),[v,ce]),ze=qun(),at=f.invert||d,Je=X==="loading";et.current=Ee.useMemo(()=>ce*D+ct,[ce,ct]),Ee.useEffect(()=>{fe.current=Ie},[Ie]),Ee.useEffect(()=>{Q(!0)},[]),Ee.useEffect(()=>{const Et=le.current;if(Et){const Ut=Et.getBoundingClientRect().height;return ye(Ut),m($n=>[{toastId:f.id,height:Ut,position:f.position},...$n]),()=>m($n=>$n.filter(On=>On.toastId!==f.id))}},[m,f.id]),Ee.useLayoutEffect(()=>{if(!R)return;const Et=le.current,Ut=Et.style.height;Et.style.height="auto";const $n=Et.getBoundingClientRect().height;Et.style.height=Ut,ye($n),m(On=>On.find(on=>on.toastId===f.id)?On.map(on=>on.toastId===f.id?{...on,height:$n}:on):[{toastId:f.id,height:$n,position:f.position},...On])},[R,f.title,f.description,m,f.id,f.jsx,f.action,f.cancel]);const Ze=Ee.useCallback(()=>{ee(!0),ie(et.current),m(Et=>Et.filter(Ut=>Ut.toastId!==f.id)),setTimeout(()=>{k(f)},rdn)},[f,k,m,et]);Ee.useEffect(()=>{if(f.promise&&X==="loading"||f.duration===1/0||f.type==="loading")return;let Et;return O||h||ze?(()=>{if(kt.current<Me.current){const On=new Date().getTime()-Me.current;fe.current=fe.current-On}kt.current=new Date().getTime()})():fe.current!==1/0&&(Me.current=new Date().getTime(),Et=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Ze()},fe.current)),()=>clearTimeout(Et)},[O,h,f,X,ze,Ze]),Ee.useEffect(()=>{f.delete&&(Ze(),f.onDismiss==null||f.onDismiss.call(f,f))},[Ze,f.delete]);function _t(){var Et;if(B?.loading){var Ut;return Ee.createElement("div",{className:Oh(H?.loader,f==null||(Ut=f.classNames)==null?void 0:Ut.loader,"sonner-loader"),"data-visible":X==="loading"},B.loading)}return Ee.createElement(Lun,{className:Oh(H?.loader,f==null||(Et=f.classNames)==null?void 0:Et.loader),visible:X==="loading"})}const gt=f.icon||B?.[X]||Dun(X);var ft,Cn;return Ee.createElement("li",{tabIndex:0,ref:le,className:Oh(I,Se,H?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,H?.default,H?.[X],f==null||(n=f.classNames)==null?void 0:n[X]),"data-sonner-toast":"","data-rich-colors":(ft=f.richColors)!=null?ft:E,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":R,"data-promise":!!f.promise,"data-swiped":pe,"data-removed":G,"data-visible":J,"data-y-position":Sn,"data-x-position":Rn,"data-index":b,"data-front":we,"data-swiping":re,"data-dismissible":ue,"data-type":X,"data-invert":at,"data-swipe-out":se,"data-swipe-direction":Z,"data-expanded":!!(O||V&&R),"data-testid":f.testId,style:{"--index":b,"--toasts-before":b,"--z-index":S.length-b,"--offset":`${G?ae:et.current}px`,"--initial-height":V?"auto":`${ve}px`,...T,...f.style},onDragEnd:()=>{ne(!1),L(null),Yt.current=null},onPointerDown:Et=>{Et.button!==2&&(Je||!ue||(xe.current=new Date,ie(et.current),Et.target.setPointerCapture(Et.pointerId),Et.target.tagName!=="BUTTON"&&(ne(!0),Yt.current={x:Et.clientX,y:Et.clientY})))},onPointerUp:()=>{var Et,Ut,$n;if(se||!ue)return;Yt.current=null;const On=Number(((Et=le.current)==null?void 0:Et.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),un=Number(((Ut=le.current)==null?void 0:Ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),on=new Date().getTime()-(($n=xe.current)==null?void 0:$n.getTime()),Mt=W==="x"?On:un,zs=Math.abs(Mt)/on;if(Math.abs(Mt)>=ndn||zs>.11){ie(et.current),f.onDismiss==null||f.onDismiss.call(f,f),z(W==="x"?On>0?"right":"left":un>0?"down":"up"),Ze(),oe(!0);return}else{var ea,Oe;(ea=le.current)==null||ea.style.setProperty("--swipe-amount-x","0px"),(Oe=le.current)==null||Oe.style.setProperty("--swipe-amount-y","0px")}K(!1),ne(!1),L(null)},onPointerMove:Et=>{var Ut,$n,On;if(!Yt.current||!ue||((Ut=window.getSelection())==null?void 0:Ut.toString().length)>0)return;const on=Et.clientY-Yt.current.y,Mt=Et.clientX-Yt.current.x;var zs;const ea=(zs=e.swipeDirections)!=null?zs:adn(F);!W&&(Math.abs(Mt)>1||Math.abs(on)>1)&&L(Math.abs(Mt)>Math.abs(on)?"x":"y");let Oe={x:0,y:0};const Ne=Le=>1/(1.5+Math.abs(Le)/20);if(W==="y"){if(ea.includes("top")||ea.includes("bottom"))if(ea.includes("top")&&on<0||ea.includes("bottom")&&on>0)Oe.y=on;else{const Le=on*Ne(on);Oe.y=Math.abs(Le)<Math.abs(on)?Le:on}}else if(W==="x"&&(ea.includes("left")||ea.includes("right")))if(ea.includes("left")&&Mt<0||ea.includes("right")&&Mt>0)Oe.x=Mt;else{const Le=Mt*Ne(Mt);Oe.x=Math.abs(Le)<Math.abs(Mt)?Le:Mt}(Math.abs(Oe.x)>0||Math.abs(Oe.y)>0)&&K(!0),($n=le.current)==null||$n.style.setProperty("--swipe-amount-x",`${Oe.x}px`),(On=le.current)==null||On.style.setProperty("--swipe-amount-y",`${Oe.y}px`)}},_e&&!f.jsx&&X!=="loading"?Ee.createElement("button",{"aria-label":q,"data-disabled":Je,"data-close-button":!0,onClick:Je||!ue?()=>{}:()=>{Ze(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Oh(H?.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(Cn=B?.close)!=null?Cn:Vun):null,(X||f.icon||f.promise)&&f.icon!==null&&(B?.[X]!==null||f.icon)?Ee.createElement("div",{"data-icon":"",className:Oh(H?.icon,f==null||(a=f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||_t():null,f.type!=="loading"?gt:null):null,Ee.createElement("div",{"data-content":"",className:Oh(H?.content,f==null||(s=f.classNames)==null?void 0:s.content)},Ee.createElement("div",{"data-title":"",className:Oh(H?.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?Ee.createElement("div",{"data-description":"",className:Oh(P,Ce,H?.description,f==null||(o=f.classNames)==null?void 0:o.description)},typeof f.description=="function"?f.description():f.description):null),Ee.isValidElement(f.cancel)?f.cancel:f.cancel&&XM(f.cancel)?Ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:Et=>{XM(f.cancel)&&ue&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Et),Ze())},className:Oh(H?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,Ee.isValidElement(f.action)?f.action:f.action&&XM(f.action)?Ee.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||A,onClick:Et=>{XM(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Et),!Et.defaultPrevented&&Ze())},className:Oh(H?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function nEe(){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 idn(e,t){const n={};return[e,t].forEach((r,a)=>{const s=a===1,i=s?"--mobile-offset":"--offset",o=s?Jun:Kun;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${i}-${u}`]=o:n[`${i}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(o)}),n}const wst=Ee.forwardRef(function(t,n){const{id:r,invert:a,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:d,mobileOffset:f,theme:p="light",richColors:h,duration:m,style:g,visibleToasts:v=Xun,toastOptions:b,dir:S=nEe(),gap:O=tdn,icons:k,containerAriaLabel:E="Notifications"}=t,[C,T]=Ee.useState([]),j=Ee.useMemo(()=>r?C.filter(R=>R.toasterId===r):C.filter(R=>!R.toasterId),[C,r]),A=Ee.useMemo(()=>Array.from(new Set([s].concat(j.filter(R=>R.position).map(R=>R.position)))),[j,s]),[I,P]=Ee.useState([]),[M,F]=Ee.useState(!1),[D,V]=Ee.useState(!1),[H,B]=Ee.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=Ee.useRef(null),W=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=Ee.useRef(null),Z=Ee.useRef(!1),z=Ee.useCallback(R=>{T(Q=>{var G;return(G=Q.find(ee=>ee.id===R.id))!=null&&G.delete||Xc.dismiss(R.id),Q.filter(({id:ee})=>ee!==R.id)})},[]);return Ee.useEffect(()=>Xc.subscribe(R=>{if(R.dismiss){requestAnimationFrame(()=>{T(Q=>Q.map(G=>G.id===R.id?{...G,delete:!0}:G))});return}setTimeout(()=>{Vle.flushSync(()=>{T(Q=>{const G=Q.findIndex(ee=>ee.id===R.id);return G!==-1?[...Q.slice(0,G),{...Q[G],...R},...Q.slice(G+1)]:[R,...Q]})})})}),[C]),Ee.useEffect(()=>{if(p!=="system"){B(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;const R=window.matchMedia("(prefers-color-scheme: dark)");try{R.addEventListener("change",({matches:Q})=>{B(Q?"dark":"light")})}catch{R.addListener(({matches:G})=>{try{B(G?"dark":"light")}catch(ee){console.error(ee)}})}},[p]),Ee.useEffect(()=>{C.length<=1&&F(!1)},[C]),Ee.useEffect(()=>{const R=Q=>{var G;if(i.every(ne=>Q[ne]||Q.code===ne)){var re;F(!0),(re=q.current)==null||re.focus()}Q.code==="Escape"&&(document.activeElement===q.current||(G=q.current)!=null&&G.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[i]),Ee.useEffect(()=>{if(q.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Z.current=!1)}},[q.current]),Ee.createElement("section",{ref:n,"aria-label":`${E} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((R,Q)=>{var G;const[ee,re]=R.split("-");return j.length?Ee.createElement("ol",{key:R,dir:S==="auto"?nEe():S,tabIndex:-1,ref:q,className:u,"data-sonner-toaster":!0,"data-sonner-theme":H,"data-y-position":ee,"data-x-position":re,style:{"--front-toast-height":`${((G=I[0])==null?void 0:G.height)||0}px`,"--width":`${edn}px`,"--gap":`${O}px`,...g,...idn(d,f)},onBlur:ne=>{Z.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(Z.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,L.current=ne.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{D||F(!1)},onDragEnd:()=>F(!1),onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},j.filter(ne=>!ne.position&&Q===0||ne.position===R).map((ne,se)=>{var oe,pe;return Ee.createElement(sdn,{key:ne.id,icons:k,index:se,toast:ne,defaultRichColors:h,duration:(oe=b?.duration)!=null?oe:m,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:a,visibleToasts:v,closeButton:(pe=b?.closeButton)!=null?pe:c,interacting:D,position:R,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,closeButtonAriaLabel:b?.closeButtonAriaLabel,removeToast:z,toasts:j.filter(K=>K.position==ne.position),heights:I.filter(K=>K.position==ne.position),setHeights:P,expandByDefault:o,gap:O,expanded:M,swipeDirections:t.swipeDirections})})):null}))});function odn(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ldn(e,t,n){const a=H6((n||{}).ignore||[]),s=cdn(t);let i=-1;for(;++i<s.length;)Vet(e,"text",o);function o(u,d){let f=-1,p;for(;++f<d.length;){const h=d[f],m=p?p.children:void 0;if(a(h,m?m.indexOf(h):void 0,p))return;p=h}if(p)return c(u,d)}function c(u,d){const f=d[d.length-1],p=s[i][0],h=s[i][1];let m=0;const v=f.children.indexOf(u);let b=!1,S=[];p.lastIndex=0;let O=p.exec(u.value);for(;O;){const k=O.index,E={index:O.index,input:O.input,stack:[...d,u]};let C=h(...O,E);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=k+1:(m!==k&&S.push({type:"text",value:u.value.slice(m,k)}),Array.isArray(C)?S.push(...C):C&&S.push(C),m=k+O[0].length,b=!0),!p.global)break;O=p.exec(u.value)}return b?(m<u.value.length&&S.push({type:"text",value:u.value.slice(m)}),f.children.splice(v,1,...S)):S=[u],v+S.length}}function cdn(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([udn(a[0]),ddn(a[1])])}return t}function udn(e){return typeof e=="string"?new RegExp(odn(e),"g"):e}function ddn(e){return typeof e=="function"?e:function(){return e}}const AU="phrasing",IU=["autolink","link","image","label"];function fdn(){return{transforms:[bdn],enter:{literalAutolink:hdn,literalAutolinkEmail:RU,literalAutolinkHttp:RU,literalAutolinkWww:RU},exit:{literalAutolink:ydn,literalAutolinkEmail:vdn,literalAutolinkHttp:mdn,literalAutolinkWww:gdn}}}function pdn(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:AU,notInConstruct:IU},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:AU,notInConstruct:IU},{character:":",before:"[ps]",after:"\\/",inConstruct:AU,notInConstruct:IU}]}}function hdn(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function RU(e){this.config.enter.autolinkProtocol.call(this,e)}function mdn(e){this.config.exit.autolinkProtocol.call(this,e)}function gdn(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function vdn(e){this.config.exit.autolinkEmail.call(this,e)}function ydn(e){this.exit(e)}function bdn(e){ldn(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xdn],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),wdn]],{ignore:["link","linkReference"]})}function xdn(e,t,n,r,a){let s="";if(!Sst(a)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!Sdn(n)))return!1;const i=Odn(n+r);if(!i[0])return!1;const o={type:"link",title:null,url:s+t+i[0],children:[{type:"text",value:t+i[0]}]};return i[1]?[o,{type:"text",value:i[1]}]:o}function wdn(e,t,n,r){return!Sst(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Sdn(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Odn(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=HSe(e,"(");let s=HSe(e,")");for(;r!==-1&&a>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Sst(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Y0(n)||U6(n))&&(!t||n!==47)}Ost.peek=Idn;function kdn(){this.buffer()}function _dn(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Edn(){this.buffer()}function Cdn(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function jdn(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lp(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Tdn(e){this.exit(e)}function Ndn(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lp(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Adn(e){this.exit(e)}function Idn(){return"["}function Ost(e,t,n,r){const a=n.createTracker(r);let s=a.move("[^");const i=n.enter("footnoteReference"),o=n.enter("reference");return s+=a.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),i(),s+=a.move("]"),s}function Rdn(){return{enter:{gfmFootnoteCallString:kdn,gfmFootnoteCall:_dn,gfmFootnoteDefinitionLabelString:Edn,gfmFootnoteDefinition:Cdn},exit:{gfmFootnoteCallString:jdn,gfmFootnoteCall:Tdn,gfmFootnoteDefinitionLabelString:Ndn,gfmFootnoteDefinition:Adn}}}function Pdn(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ost},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,s,i){const o=s.createTracker(i);let c=o.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=o.move(s.safe(s.associationId(r),{before:c,after:"]"})),d(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?`
210
210
  `:" ")+s.indentLines(s.containerFlow(r,o.current()),t?kst:Mdn))),u(),c}}function Mdn(e,t,n){return t===0?e:kst(e,t,n)}function kst(e,t,n){return(n?"":" ")+e}const Ddn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];_st.peek=Bdn;function $dn(){return{canContainEols:["delete"],enter:{strikethrough:Fdn},exit:{strikethrough:zdn}}}function Ldn(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ddn}],handlers:{delete:_st}}}function Fdn(e){this.enter({type:"delete",children:[]},e)}function zdn(e){this.exit(e)}function _st(e,t,n,r){const a=n.createTracker(r),s=n.enter("strikethrough");let i=a.move("~~");return i+=n.containerPhrasing(e,{...a.current(),before:i,after:"~"}),i+=a.move("~~"),s(),i}function Bdn(){return"~"}function Udn(e){return e.length}function Vdn(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||Udn,s=[],i=[],o=[],c=[];let u=0,d=-1;for(;++d<e.length;){const g=[],v=[];let b=-1;for(e[d].length>u&&(u=e[d].length);++b<e[d].length;){const S=qdn(e[d][b]);if(n.alignDelimiters!==!1){const O=a(S);v[b]=O,(c[b]===void 0||O>c[b])&&(c[b]=O)}g.push(S)}i[d]=g,o[d]=v}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)s[f]=rEe(r[f]);else{const g=rEe(r);for(;++f<u;)s[f]=g}f=-1;const p=[],h=[];for(;++f<u;){const g=s[f];let v="",b="";g===99?(v=":",b=":"):g===108?v=":":g===114&&(b=":");let S=n.alignDelimiters===!1?1:Math.max(1,c[f]-v.length-b.length);const O=v+"-".repeat(S)+b;n.alignDelimiters!==!1&&(S=v.length+S+b.length,S>c[f]&&(c[f]=S),h[f]=S),p[f]=O}i.splice(1,0,p),o.splice(1,0,h),d=-1;const m=[];for(;++d<i.length;){const g=i[d],v=o[d];f=-1;const b=[];for(;++f<u;){const S=g[f]||"";let O="",k="";if(n.alignDelimiters!==!1){const E=c[f]-(v[f]||0),C=s[f];C===114?O=" ".repeat(E):C===99?E%2?(O=" ".repeat(E/2+.5),k=" ".repeat(E/2-.5)):(O=" ".repeat(E/2),k=O):k=" ".repeat(E)}n.delimiterStart!==!1&&!f&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&S==="")&&(n.delimiterStart!==!1||f)&&b.push(" "),n.alignDelimiters!==!1&&b.push(O),b.push(S),n.alignDelimiters!==!1&&b.push(k),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&b.push("|")}m.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
211
211
  `)}function qdn(e){return e==null?"":String(e)}function rEe(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Hdn(e,t,n,r){const a=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const i=n.indentLines(n.containerFlow(e,s.current()),Qdn);return a(),i}function Qdn(e,t,n){return">"+(n?"":" ")+e}function Wdn(e,t){return aEe(e,t.inConstruct,!0)&&!aEe(e,t.notInConstruct,!1)}function aEe(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function sEe(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
@@ -454,7 +454,7 @@ ${ee.current.stack}
454
454
  `&&(I=`
455
455
  `);var W=0,L=!1;this.parse=function(Z,z,R){if(typeof Z!="string")throw new Error("Input must be a string");var Q=Z.length,G=A.length,ee=I.length,re=P.length,ne=T(M),se=[],oe=[],pe=[],K=W=0;if(!Z)return Se();if(D||D!==!1&&Z.indexOf(B)===-1){for(var ae=Z.split(I),ie=0;ie<ae.length;ie++){if(pe=ae[ie],W+=pe.length,ie!==ae.length-1)W+=I.length;else if(R)return Se();if(!P||pe.substring(0,re)!==P){if(ne){if(se=[],we(pe.split(A)),Ce(),L)return Se()}else we(pe.split(A));if(F&&F<=ie)return se=se.slice(0,F),Se(!0)}}return Se()}for(var ve=Z.indexOf(A,W),ye=Z.indexOf(I,W),fe=new RegExp(v(q)+v(B),"g"),xe=Z.indexOf(B,W);;)if(Z[W]===B)for(xe=W,W++;;){if((xe=Z.indexOf(B,xe+1))===-1)return R||oe.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:se.length,index:W}),X();if(xe===Q-1)return X(Z.substring(W,xe).replace(fe,B));if(B===q&&Z[xe+1]===q)xe++;else if(B===q||xe===0||Z[xe-1]!==q){ve!==-1&&ve<xe+1&&(ve=Z.indexOf(A,xe+1));var le=J((ye=ye!==-1&&ye<xe+1?Z.indexOf(I,xe+1):ye)===-1?ve:Math.min(ve,ye));if(Z.substr(xe+1+le,G)===A){pe.push(Z.substring(W,xe).replace(fe,B)),Z[W=xe+1+le+G]!==B&&(xe=Z.indexOf(B,W)),ve=Z.indexOf(A,W),ye=Z.indexOf(I,W);break}if(le=J(ye),Z.substring(xe+1+le,xe+1+le+ee)===I){if(pe.push(Z.substring(W,xe).replace(fe,B)),ue(xe+1+le+ee),ve=Z.indexOf(A,W),xe=Z.indexOf(B,W),ne&&(Ce(),L))return Se();if(F&&se.length>=F)return Se(!0);break}oe.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:se.length,index:W}),xe++}}else if(P&&pe.length===0&&Z.substring(W,W+re)===P){if(ye===-1)return Se();W=ye+ee,ye=Z.indexOf(I,W),ve=Z.indexOf(A,W)}else if(ve!==-1&&(ve<ye||ye===-1))pe.push(Z.substring(W,ve)),W=ve+G,ve=Z.indexOf(A,W);else{if(ye===-1)break;if(pe.push(Z.substring(W,ye)),ue(ye+ee),ne&&(Ce(),L))return Se();if(F&&se.length>=F)return Se(!0)}return X();function we(ce){se.push(ce),K=W}function J(ce){var _e=0;return _e=ce!==-1&&(ce=Z.substring(xe+1,ce))&&ce.trim()===""?ce.length:_e}function X(ce){return R||(ce===void 0&&(ce=Z.substring(W)),pe.push(ce),W=Q,we(pe),ne&&Ce()),Se()}function ue(ce){W=ce,we(pe),pe=[],ye=Z.indexOf(I,W)}function Se(ce){if(j.header&&!z&&se.length&&!H){var _e=se[0],Ie=Object.create(null),Me=new Set(_e);let et=!1;for(let kt=0;kt<_e.length;kt++){let Yt=_e[kt];if(Ie[Yt=T(j.transformHeader)?j.transformHeader(Yt,kt):Yt]){let Sn,Rn=Ie[Yt];for(;Sn=Yt+"_"+Rn,Rn++,Me.has(Sn););Me.add(Sn),_e[kt]=Sn,Ie[Yt]++,et=!0,(V=V===null?{}:V)[Sn]=Yt}else Ie[Yt]=1,_e[kt]=Yt;Me.add(Yt)}et&&console.warn("Duplicate headers found and renamed."),H=!0}return{data:se,errors:oe,meta:{delimiter:A,linebreak:I,aborted:L,truncated:!!ce,cursor:K+(z||0),renamedHeaders:V}}}function Ce(){M(Se()),se=[],oe=[]}},this.abort=function(){L=!0},this.getCharIndex=function(){return W}}function S(j){var A=j.data,I=o[A.workerId],P=!1;if(A.error)I.userError(A.error,A.file);else if(A.results&&A.results.data){var M={abort:function(){P=!0,O(A.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(T(I.userStep)){for(var F=0;F<A.results.data.length&&(I.userStep({data:A.results.data[F],errors:A.results.errors,meta:A.results.meta},M),!P);F++);delete A.results}else T(I.userChunk)&&(I.userChunk(A.results,M,A.file),delete A.results)}A.finished&&!P&&O(A.workerId,A.results)}function O(j,A){var I=o[j];T(I.userComplete)&&I.userComplete(A),I.terminate(),delete o[j]}function k(){throw new Error("Not implemented.")}function E(j){if(typeof j!="object"||j===null)return j;var A,I=Array.isArray(j)?[]:{};for(A in j)I[A]=E(j[A]);return I}function C(j,A){return function(){j.apply(A,arguments)}}function T(j){return typeof j=="function"}return u.parse=function(j,A){var I=(A=A||{}).dynamicTyping||!1;if(T(I)&&(A.dynamicTypingFunction=I,I={}),A.dynamicTyping=I,A.transform=!!T(A.transform)&&A.transform,!A.worker||!u.WORKERS_SUPPORTED)return I=null,u.NODE_STREAM_INPUT,typeof j=="string"?(j=(P=>P.charCodeAt(0)!==65279?P:P.slice(1))(j),I=new(A.download?f:h)(A)):j.readable===!0&&T(j.read)&&T(j.on)?I=new m(A):(r.File&&j instanceof File||j instanceof Object)&&(I=new p(A)),I.stream(j);(I=(()=>{var P;return!!u.WORKERS_SUPPORTED&&(P=(()=>{var M=r.URL||r.webkitURL||null,F=n.toString();return u.BLOB_URL||(u.BLOB_URL=M.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",F,")();"],{type:"text/javascript"})))})(),(P=new r.Worker(P)).onmessage=S,P.id=c++,o[P.id]=P)})()).userStep=A.step,I.userChunk=A.chunk,I.userComplete=A.complete,I.userError=A.error,A.step=T(A.step),A.chunk=T(A.chunk),A.complete=T(A.complete),A.error=T(A.error),delete A.worker,I.postMessage({input:j,config:A,workerId:I.id})},u.unparse=function(j,A){var I=!1,P=!0,M=",",F=`\r
456
456
  `,D='"',V=D+D,H=!1,B=null,q=!1,W=((()=>{if(typeof A=="object"){if(typeof A.delimiter!="string"||u.BAD_DELIMITERS.filter(function(z){return A.delimiter.indexOf(z)!==-1}).length||(M=A.delimiter),typeof A.quotes!="boolean"&&typeof A.quotes!="function"&&!Array.isArray(A.quotes)||(I=A.quotes),typeof A.skipEmptyLines!="boolean"&&typeof A.skipEmptyLines!="string"||(H=A.skipEmptyLines),typeof A.newline=="string"&&(F=A.newline),typeof A.quoteChar=="string"&&(D=A.quoteChar),typeof A.header=="boolean"&&(P=A.header),Array.isArray(A.columns)){if(A.columns.length===0)throw new Error("Option columns is empty");B=A.columns}A.escapeChar!==void 0&&(V=A.escapeChar+D),A.escapeFormulae instanceof RegExp?q=A.escapeFormulae:typeof A.escapeFormulae=="boolean"&&A.escapeFormulae&&(q=/^[=+\-@\t\r].*$/)}})(),new RegExp(v(D),"g"));if(typeof j=="string"&&(j=JSON.parse(j)),Array.isArray(j)){if(!j.length||Array.isArray(j[0]))return L(null,j,H);if(typeof j[0]=="object")return L(B||Object.keys(j[0]),j,H)}else if(typeof j=="object")return typeof j.data=="string"&&(j.data=JSON.parse(j.data)),Array.isArray(j.data)&&(j.fields||(j.fields=j.meta&&j.meta.fields||B),j.fields||(j.fields=Array.isArray(j.data[0])?j.fields:typeof j.data[0]=="object"?Object.keys(j.data[0]):[]),Array.isArray(j.data[0])||typeof j.data[0]=="object"||(j.data=[j.data])),L(j.fields||[],j.data||[],H);throw new Error("Unable to serialize unrecognized input");function L(z,R,Q){var G="",ee=(typeof z=="string"&&(z=JSON.parse(z)),typeof R=="string"&&(R=JSON.parse(R)),Array.isArray(z)&&0<z.length),re=!Array.isArray(R[0]);if(ee&&P){for(var ne=0;ne<z.length;ne++)0<ne&&(G+=M),G+=Z(z[ne],ne);0<R.length&&(G+=F)}for(var se=0;se<R.length;se++){var oe=(ee?z:R[se]).length,pe=!1,K=ee?Object.keys(R[se]).length===0:R[se].length===0;if(Q&&!ee&&(pe=Q==="greedy"?R[se].join("").trim()==="":R[se].length===1&&R[se][0].length===0),Q==="greedy"&&ee){for(var ae=[],ie=0;ie<oe;ie++){var ve=re?z[ie]:ie;ae.push(R[se][ve])}pe=ae.join("").trim()===""}if(!pe){for(var ye=0;ye<oe;ye++){0<ye&&!K&&(G+=M);var fe=ee&&re?z[ye]:ye;G+=Z(R[se][fe],ye)}se<R.length-1&&(!Q||0<oe&&!K)&&(G+=F)}}return G}function Z(z,R){var Q,G;return z==null?"":z.constructor===Date?JSON.stringify(z).slice(1,25):(G=!1,q&&typeof z=="string"&&q.test(z)&&(z="'"+z,G=!0),Q=z.toString().replace(W,V),(G=G||I===!0||typeof I=="function"&&I(z,R)||Array.isArray(I)&&I[R]||((ee,re)=>{for(var ne=0;ne<re.length;ne++)if(-1<ee.indexOf(re[ne]))return!0;return!1})(Q,u.BAD_DELIMITERS)||-1<Q.indexOf(M)||Q.charAt(0)===" "||Q.charAt(Q.length-1)===" ")?D+Q+D:Q)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
457
- `,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!s&&!!r.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=b,u.ParserHandle=g,u.NetworkStreamer=f,u.FileStreamer=p,u.StringStreamer=h,u.ReadableStreamStreamer=m,r.jQuery&&((a=r.jQuery).fn.parse=function(j){var A=j.config||{},I=[];return this.each(function(F){if(!(a(this).prop("tagName").toUpperCase()==="INPUT"&&a(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var D=0;D<this.files.length;D++)I.push({file:this.files[D],inputElem:this,instanceConfig:a.extend({},A)})}),P(),this;function P(){if(I.length===0)T(j.complete)&&j.complete();else{var F,D,V,H,B=I[0];if(T(j.before)){var q=j.before(B.file,B.inputElem);if(typeof q=="object"){if(q.action==="abort")return F="AbortError",D=B.file,V=B.inputElem,H=q.reason,void(T(j.error)&&j.error({name:F},D,V,H));if(q.action==="skip")return void M();typeof q.config=="object"&&(B.instanceConfig=a.extend(B.instanceConfig,q.config))}else if(q==="skip")return void M()}var W=B.instanceConfig.complete;B.instanceConfig.complete=function(L){T(W)&&W(L,B.file,B.inputElem),M()},u.parse(B.file,B.instanceConfig)}}function M(){I.splice(0,1),P()}}),i&&(r.onmessage=function(j){j=j.data,u.WORKER_ID===void 0&&j&&(u.WORKER_ID=j.workerId),typeof j.input=="string"?r.postMessage({workerId:u.WORKER_ID,results:u.parse(j.input,j.config),finished:!0}):(r.File&&j.input instanceof File||j.input instanceof Object)&&(j=u.parse(j.input,j.config))&&r.postMessage({workerId:u.WORKER_ID,results:j,finished:!0})}),(f.prototype=Object.create(d.prototype)).constructor=f,(p.prototype=Object.create(d.prototype)).constructor=p,(h.prototype=Object.create(h.prototype)).constructor=h,(m.prototype=Object.create(d.prototype)).constructor=m,u})})(a$)),a$.exports}var etr=Jer();const yyt=xo(etr);var m5e=1,ttr=.9,ntr=.8,rtr=.17,xJ=.1,wJ=.999,atr=.9999,str=.99,itr=/[\\\/_+.#"@\[\(\{&]/,otr=/[\\\/_+.#"@\[\(\{&]/g,ltr=/[\s-]/,byt=/[\s-]/g;function ise(e,t,n,r,a,s,i){if(s===t.length)return a===e.length?m5e:str;var o=`${a},${s}`;if(i[o]!==void 0)return i[o];for(var c=r.charAt(s),u=n.indexOf(c,a),d=0,f,p,h,m;u>=0;)f=ise(e,t,n,r,u+1,s+1,i),f>d&&(u===a?f*=m5e:itr.test(e.charAt(u-1))?(f*=ntr,h=e.slice(a,u-1).match(otr),h&&a>0&&(f*=Math.pow(wJ,h.length))):ltr.test(e.charAt(u-1))?(f*=ttr,m=e.slice(a,u-1).match(byt),m&&a>0&&(f*=Math.pow(wJ,m.length))):(f*=rtr,a>0&&(f*=Math.pow(wJ,u-a))),e.charAt(u)!==t.charAt(s)&&(f*=atr)),(f<xJ&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(p=ise(e,t,n,r,u+1,s+2,i),p*xJ>f&&(f=p*xJ)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[o]=d,d}function g5e(e){return e.toLowerCase().replace(byt," ")}function ctr(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,ise(e,t,g5e(e),g5e(t),0,0,{})}var MC='[cmdk-group=""]',SJ='[cmdk-group-items=""]',utr='[cmdk-group-heading=""]',xyt='[cmdk-item=""]',v5e=`${xyt}:not([aria-disabled="true"])`,ose="cmdk-item-select",A1="data-value",dtr=(e,t,n)=>ctr(e,t,n),wyt=x.createContext(void 0),CR=()=>x.useContext(wyt),Syt=x.createContext(void 0),Wme=()=>x.useContext(Syt),Oyt=x.createContext(void 0),kyt=x.forwardRef((e,t)=>{let n=I1(()=>{var z,R;return{search:"",value:(R=(z=e.value)!=null?z:e.defaultValue)!=null?R:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=I1(()=>new Set),a=I1(()=>new Map),s=I1(()=>new Map),i=I1(()=>new Set),o=_yt(e),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:h,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...b}=e,S=Zi(),O=Zi(),k=Zi(),E=x.useRef(null),C=Str();Ew(()=>{if(d!==void 0){let z=d.trim();n.current.value=z,T.emit()}},[d]),Ew(()=>{C(6,F)},[]);let T=x.useMemo(()=>({subscribe:z=>(i.current.add(z),()=>i.current.delete(z)),snapshot:()=>n.current,setState:(z,R,Q)=>{var G,ee,re,ne;if(!Object.is(n.current[z],R)){if(n.current[z]=R,z==="search")M(),I(),C(1,P);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(k);se?se.focus():(G=document.getElementById(S))==null||G.focus()}if(C(7,()=>{var se;n.current.selectedItemId=(se=D())==null?void 0:se.id,T.emit()}),Q||C(5,F),((ee=o.current)==null?void 0:ee.value)!==void 0){let se=R??"";(ne=(re=o.current).onValueChange)==null||ne.call(re,se);return}}T.emit()}},emit:()=>{i.current.forEach(z=>z())}}),[]),j=x.useMemo(()=>({value:(z,R,Q)=>{var G;R!==((G=s.current.get(z))==null?void 0:G.value)&&(s.current.set(z,{value:R,keywords:Q}),n.current.filtered.items.set(z,A(R,Q)),C(2,()=>{I(),T.emit()}))},item:(z,R)=>(r.current.add(z),R&&(a.current.has(R)?a.current.get(R).add(z):a.current.set(R,new Set([z]))),C(3,()=>{M(),I(),n.current.value||P(),T.emit()}),()=>{s.current.delete(z),r.current.delete(z),n.current.filtered.items.delete(z);let Q=D();C(4,()=>{M(),Q?.getAttribute("id")===z&&P(),T.emit()})}),group:z=>(a.current.has(z)||a.current.set(z,new Set),()=>{s.current.delete(z),a.current.delete(z)}),filter:()=>o.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:S,inputId:k,labelId:O,listInnerRef:E}),[]);function A(z,R){var Q,G;let ee=(G=(Q=o.current)==null?void 0:Q.filter)!=null?G:dtr;return z?ee(z,n.current.search,R):0}function I(){if(!n.current.search||o.current.shouldFilter===!1)return;let z=n.current.filtered.items,R=[];n.current.filtered.groups.forEach(G=>{let ee=a.current.get(G),re=0;ee.forEach(ne=>{let se=z.get(ne);re=Math.max(se,re)}),R.push([G,re])});let Q=E.current;V().sort((G,ee)=>{var re,ne;let se=G.getAttribute("id"),oe=ee.getAttribute("id");return((re=z.get(oe))!=null?re:0)-((ne=z.get(se))!=null?ne:0)}).forEach(G=>{let ee=G.closest(SJ);ee?ee.appendChild(G.parentElement===ee?G:G.closest(`${SJ} > *`)):Q.appendChild(G.parentElement===Q?G:G.closest(`${SJ} > *`))}),R.sort((G,ee)=>ee[1]-G[1]).forEach(G=>{var ee;let re=(ee=E.current)==null?void 0:ee.querySelector(`${MC}[${A1}="${encodeURIComponent(G[0])}"]`);re?.parentElement.appendChild(re)})}function P(){let z=V().find(Q=>Q.getAttribute("aria-disabled")!=="true"),R=z?.getAttribute(A1);T.setState("value",R||void 0)}function M(){var z,R,Q,G;if(!n.current.search||o.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ee=0;for(let re of r.current){let ne=(R=(z=s.current.get(re))==null?void 0:z.value)!=null?R:"",se=(G=(Q=s.current.get(re))==null?void 0:Q.keywords)!=null?G:[],oe=A(ne,se);n.current.filtered.items.set(re,oe),oe>0&&ee++}for(let[re,ne]of a.current)for(let se of ne)if(n.current.filtered.items.get(se)>0){n.current.filtered.groups.add(re);break}n.current.filtered.count=ee}function F(){var z,R,Q;let G=D();G&&(((z=G.parentElement)==null?void 0:z.firstChild)===G&&((Q=(R=G.closest(MC))==null?void 0:R.querySelector(utr))==null||Q.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function D(){var z;return(z=E.current)==null?void 0:z.querySelector(`${xyt}[aria-selected="true"]`)}function V(){var z;return Array.from(((z=E.current)==null?void 0:z.querySelectorAll(v5e))||[])}function H(z){let R=V()[z];R&&T.setState("value",R.getAttribute(A1))}function B(z){var R;let Q=D(),G=V(),ee=G.findIndex(ne=>ne===Q),re=G[ee+z];(R=o.current)!=null&&R.loop&&(re=ee+z<0?G[G.length-1]:ee+z===G.length?G[0]:G[ee+z]),re&&T.setState("value",re.getAttribute(A1))}function q(z){let R=D(),Q=R?.closest(MC),G;for(;Q&&!G;)Q=z>0?xtr(Q,MC):wtr(Q,MC),G=Q?.querySelector(v5e);G?T.setState("value",G.getAttribute(A1)):B(z)}let W=()=>H(V().length-1),L=z=>{z.preventDefault(),z.metaKey?W():z.altKey?q(1):B(1)},Z=z=>{z.preventDefault(),z.metaKey?H(0):z.altKey?q(-1):B(-1)};return x.createElement(wo.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:z=>{var R;(R=b.onKeyDown)==null||R.call(b,z);let Q=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||Q))switch(z.key){case"n":case"j":{v&&z.ctrlKey&&L(z);break}case"ArrowDown":{L(z);break}case"p":case"k":{v&&z.ctrlKey&&Z(z);break}case"ArrowUp":{Z(z);break}case"Home":{z.preventDefault(),H(0);break}case"End":{z.preventDefault(),W();break}case"Enter":{z.preventDefault();let G=D();if(G){let ee=new Event(ose);G.dispatchEvent(ee)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:ktr},c),Wz(e,z=>x.createElement(Syt.Provider,{value:T},x.createElement(wyt.Provider,{value:j},z))))}),ftr=x.forwardRef((e,t)=>{var n,r;let a=Zi(),s=x.useRef(null),i=x.useContext(Oyt),o=CR(),c=_yt(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i?.forceMount;Ew(()=>{if(!u)return o.item(a,i?.id)},[u]);let d=Eyt(a,s,[e.value,e.children,s],e.keywords),f=Wme(),p=Rb(C=>C.value&&C.value===d.current),h=Rb(C=>u||o.filter()===!1?!0:C.search?C.filtered.items.get(a)>0:!0);x.useEffect(()=>{let C=s.current;if(!(!C||e.disabled))return C.addEventListener(ose,m),()=>C.removeEventListener(ose,m)},[h,e.onSelect,e.disabled]);function m(){var C,T;g(),(T=(C=c.current).onSelect)==null||T.call(C,d.current)}function g(){f.setState("value",d.current,!0)}if(!h)return null;let{disabled:v,value:b,onSelect:S,forceMount:O,keywords:k,...E}=e;return x.createElement(wo.div,{ref:hm(s,t),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||o.getDisablePointerSelection()?void 0:g,onClick:v?void 0:m},e.children)}),ptr=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...s}=e,i=Zi(),o=x.useRef(null),c=x.useRef(null),u=Zi(),d=CR(),f=Rb(h=>a||d.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);Ew(()=>d.group(i),[]),Eyt(i,o,[e.value,e.heading,c]);let p=x.useMemo(()=>({id:i,forceMount:a}),[a]);return x.createElement(wo.div,{ref:hm(o,t),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&x.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Wz(e,h=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},x.createElement(Oyt.Provider,{value:p},h))))}),htr=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=x.useRef(null),s=Rb(i=>!i.search);return!n&&!s?null:x.createElement(wo.div,{ref:hm(a,t),...r,"cmdk-separator":"",role:"separator"})}),mtr=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,s=Wme(),i=Rb(u=>u.search),o=Rb(u=>u.selectedItemId),c=CR();return x.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),x.createElement(wo.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":o,id:c.inputId,type:"text",value:a?e.value:i,onChange:u=>{a||s.setState("search",u.target.value),n?.(u.target.value)}})}),gtr=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,s=x.useRef(null),i=x.useRef(null),o=Rb(u=>u.selectedItemId),c=CR();return x.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,p=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let h=u.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(f),p.unobserve(u)}}},[]),x.createElement(wo.div,{ref:hm(s,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:c.listId},Wz(e,u=>x.createElement("div",{ref:hm(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),vtr=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:s,container:i,...o}=e;return x.createElement(p6,{open:n,onOpenChange:r},x.createElement(h6,{container:i},x.createElement(vI,{"cmdk-overlay":"",className:a}),x.createElement(yI,{"aria-label":e.label,"cmdk-dialog":"",className:s},x.createElement(kyt,{ref:t,...o}))))}),ytr=x.forwardRef((e,t)=>Rb(n=>n.filtered.count===0)?x.createElement(wo.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),btr=x.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...s}=e;return x.createElement(wo.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Wz(e,i=>x.createElement("div",{"aria-hidden":!0},i)))}),Pu=Object.assign(kyt,{List:gtr,Item:ftr,Input:mtr,Group:ptr,Separator:htr,Dialog:vtr,Empty:ytr,Loading:btr});function xtr(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function wtr(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function _yt(e){let t=x.useRef(e);return Ew(()=>{t.current=e}),t}var Ew=typeof window>"u"?x.useEffect:x.useLayoutEffect;function I1(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Rb(e){let t=Wme(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Eyt(e,t,n,r=[]){let a=x.useRef(),s=CR();return Ew(()=>{var i;let o=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():a.current}})(),c=r.map(u=>u.trim());s.value(e,o,c),(i=t.current)==null||i.setAttribute(A1,o),a.current=o}),a}var Str=()=>{let[e,t]=x.useState(),n=I1(()=>new Map);return Ew(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Otr(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Wz({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(Otr(t),{ref:t.ref},n(t.props.children)):n(t)}var ktr={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};class co{constructor(t,n,r,a){this.fromA=t,this.toA=n,this.fromB=r,this.toB=a}offset(t,n=t){return new co(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}}function Cw(e,t,n,r,a,s){if(e==r)return[];let i=Zme(e,t,n,r,a,s),o=Yme(e,t+i,n,r,a+i,s);t+=i,n-=o,a+=i,s-=o;let c=n-t,u=s-a;if(!c||!u)return[new co(t,n,a,s)];if(c>u){let f=e.slice(t,n).indexOf(r.slice(a,s));if(f>-1)return[new co(t,t+f,a,a),new co(t+f+u,n,s,s)]}else if(u>c){let f=r.slice(a,s).indexOf(e.slice(t,n));if(f>-1)return[new co(t,t,a,a+f),new co(n,n,a+f+c,s)]}if(c==1||u==1)return[new co(t,n,a,s)];let d=Tyt(e,t,n,r,a,s);if(d){let[f,p,h]=d;return Cw(e,t,f,r,a,p).concat(Cw(e,f+h,n,r,p+h,s))}return _tr(e,t,n,r,a,s)}let vj=1e9,yj=0,Gme=!1;function _tr(e,t,n,r,a,s){let i=n-t,o=s-a;if(vj<1e9&&Math.min(i,o)>vj*16||yj>0&&Date.now()>yj)return Math.min(i,o)>vj*64?[new co(t,n,a,s)]:y5e(e,t,n,r,a,s);let c=Math.ceil((i+o)/2);OJ.reset(c),kJ.reset(c);let u=(h,m)=>e.charCodeAt(t+h)==r.charCodeAt(a+m),d=(h,m)=>e.charCodeAt(n-h-1)==r.charCodeAt(s-m-1),f=(i-o)%2!=0?kJ:null,p=f?null:OJ;for(let h=0;h<c;h++){if(h>vj||yj>0&&!(h&63)&&Date.now()>yj)return y5e(e,t,n,r,a,s);let m=OJ.advance(h,i,o,c,f,!1,u)||kJ.advance(h,i,o,c,p,!0,d);if(m)return Etr(e,t,n,t+m[0],r,a,s,a+m[1])}return[new co(t,n,a,s)]}class Cyt{constructor(){this.vec=[]}reset(t){this.len=t<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[t+1]=0,this.start=this.end=0}advance(t,n,r,a,s,i,o){for(let c=-t+this.start;c<=t-this.end;c+=2){let u=a+c,d=c==-t||c!=t&&this.vec[u-1]<this.vec[u+1]?this.vec[u+1]:this.vec[u-1]+1,f=d-c;for(;d<n&&f<r&&o(d,f);)d++,f++;if(this.vec[u]=d,d>n)this.end+=2;else if(f>r)this.start+=2;else if(s){let p=a+(n-r)-c;if(p>=0&&p<this.len&&s.vec[p]!=-1)if(i){let h=s.vec[p];if(h>=n-d)return[h,a+h-p]}else{let h=n-s.vec[p];if(d>=h)return[d,f]}}}return null}}const OJ=new Cyt,kJ=new Cyt;function Etr(e,t,n,r,a,s,i,o){let c=!1;return!Bk(e,r)&&++r==n&&(c=!0),!Bk(a,o)&&++o==i&&(c=!0),c?[new co(t,n,s,i)]:Cw(e,t,r,a,s,o).concat(Cw(e,r,n,a,o,i))}function jyt(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n=n<<1;return n}function Zme(e,t,n,r,a,s){if(t==n||t==s||e.charCodeAt(t)!=r.charCodeAt(a))return 0;let i=jyt(n-t,s-a);for(let o=t,c=a;;){let u=o+i,d=c+i;if(u>n||d>s||e.slice(o,u)!=r.slice(c,d)){if(i==1)return o-t-(Bk(e,o)?0:1);i=i>>1}else{if(u==n||d==s)return u-t;o=u,c=d}}}function Yme(e,t,n,r,a,s){if(t==n||a==s||e.charCodeAt(n-1)!=r.charCodeAt(s-1))return 0;let i=jyt(n-t,s-a);for(let o=n,c=s;;){let u=o-i,d=c-i;if(u<t||d<a||e.slice(u,o)!=r.slice(d,c)){if(i==1)return n-o-(Bk(e,o)?0:1);i=i>>1}else{if(u==t||d==a)return n-u;o=u,c=d}}}function lse(e,t,n,r,a,s,i,o){let c=r.slice(a,s),u=null;for(;;){if(u||i<o)return u;for(let d=t+i;;){Bk(e,d)||d++;let f=d+i;if(Bk(e,f)||(f+=f==d+1?1:-1),f>=n)break;let p=e.slice(d,f),h=-1;for(;(h=c.indexOf(p,h+1))!=-1;){let m=Zme(e,f,n,r,a+h+p.length,s),g=Yme(e,t,d,r,a,a+h),v=p.length+m+g;(!u||u[2]<v)&&(u=[d-g,a+h-g,v])}d=f}if(o<0)return u;i=i>>1}}function Tyt(e,t,n,r,a,s){let i=n-t,o=s-a;if(i<o){let c=Tyt(r,a,s,e,t,n);return c&&[c[1],c[0],c[2]]}return i<4||o*2<i?null:lse(e,t,n,r,a,s,Math.floor(i/4),-1)}function y5e(e,t,n,r,a,s){Gme=!0;let i=n-t,o=s-a,c;if(i<o){let p=lse(r,a,s,e,t,n,Math.floor(i/6),50);c=p&&[p[1],p[0],p[2]]}else c=lse(e,t,n,r,a,s,Math.floor(o/6),50);if(!c)return[new co(t,n,a,s)];let[u,d,f]=c;return Cw(e,t,u,r,a,d).concat(Cw(e,u+f,n,r,d+f,s))}function Nyt(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],a=e[n];r.toA>a.fromA-t&&r.toB>a.fromB-t&&(e[n-1]=new co(r.fromA,a.toA,r.fromB,a.toB),e.splice(n--,1))}}function Ctr(e,t,n){for(;;){Nyt(n,1);let r=!1;for(let a=0;a<n.length;a++){let s=n[a],i,o;(i=Zme(e,s.fromA,s.toA,t,s.fromB,s.toB))&&(s=n[a]=new co(s.fromA+i,s.toA,s.fromB+i,s.toB)),(o=Yme(e,s.fromA,s.toA,t,s.fromB,s.toB))&&(s=n[a]=new co(s.fromA,s.toA-o,s.fromB,s.toB-o));let c=s.toA-s.fromA,u=s.toB-s.fromB;if(c&&u)continue;let d=s.fromA-(a?n[a-1].toA:0),f=(a<n.length-1?n[a+1].fromA:e.length)-s.toA;if(!d||!f)continue;let p=c?e.slice(s.fromA,s.toA):t.slice(s.fromB,s.toB);d<=p.length&&e.slice(s.fromA-d,s.fromA)==p.slice(p.length-d)?(n[a]=new co(s.fromA-d,s.toA-d,s.fromB-d,s.toB-d),r=!0):f<=p.length&&e.slice(s.toA,s.toA+f)==p.slice(0,f)&&(n[a]=new co(s.fromA+f,s.toA+f,s.fromB+f,s.toB+f),r=!0)}if(!r)break}return n}function jtr(e,t,n){for(let r=0,a=0;a<e.length;a++){let s=e[a],i=s.toA-s.fromA,o=s.toB-s.fromB;if(i&&o||i>3||o>3){let c=a==e.length-1?t.length:e[a+1].fromA,u=s.fromA-r,d=c-s.toA,f=x5e(t,s.fromA,u),p=b5e(t,s.toA,d),h=s.fromA-f,m=p-s.toA;if((!i||!o)&&h&&m){let g=Math.max(i,o),[v,b,S]=i?[t,s.fromA,s.toA]:[n,s.fromB,s.toB];g>h&&t.slice(f,s.fromA)==v.slice(S-h,S)?(s=e[a]=new co(f,f+i,s.fromB-h,s.toB-h),f=s.fromA,p=b5e(t,s.toA,c-s.toA)):g>m&&t.slice(s.toA,p)==v.slice(b,b+m)&&(s=e[a]=new co(p-i,p,s.fromB+m,s.toB+m),p=s.toA,f=x5e(t,s.fromA,s.fromA-r)),h=s.fromA-f,m=p-s.toA}if(h||m)s=e[a]=new co(s.fromA-h,s.toA+m,s.fromB-h,s.toB+m);else if(i){if(!o){let g=S5e(t,s.fromA,s.toA),v,b=g<0?-1:w5e(t,s.toA,s.fromA);g>-1&&(v=g-s.fromA)<=d&&t.slice(s.fromA,g)==t.slice(s.toA,s.toA+v)?s=e[a]=s.offset(v):b>-1&&(v=s.toA-b)<=u&&t.slice(s.fromA-v,s.fromA)==t.slice(b,s.toA)&&(s=e[a]=s.offset(-v))}}else{let g=S5e(n,s.fromB,s.toB),v,b=g<0?-1:w5e(n,s.toB,s.fromB);g>-1&&(v=g-s.fromB)<=d&&n.slice(s.fromB,g)==n.slice(s.toB,s.toB+v)?s=e[a]=s.offset(v):b>-1&&(v=s.toB-b)<=u&&n.slice(s.fromB-v,s.fromB)==n.slice(b,s.toB)&&(s=e[a]=s.offset(-v))}}r=s.toA}return Nyt(e,3),e}let N0;try{N0=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Ayt(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Iyt(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?Ayt(n)?1:0:N0?!Myt(n)||t==e.length-1?N0.test(String.fromCharCode(n))?1:0:N0.test(e.slice(t,t+2))?2:0:0}function Ryt(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?Ayt(n)?1:0:N0?!Dyt(n)||t==1?N0.test(String.fromCharCode(n))?1:0:N0.test(e.slice(t-2,t))?2:0:0}const Pyt=8;function b5e(e,t,n){if(t==e.length||!Ryt(e,t))return t;for(let r=t,a=t+n,s=0;s<Pyt;s++){let i=Iyt(e,r);if(!i||r+i>a)return r;r+=i}return t}function x5e(e,t,n){if(!t||!Iyt(e,t))return t;for(let r=t,a=t-n,s=0;s<Pyt;s++){let i=Ryt(e,r);if(!i||r-i<a)return r;r-=i}return t}function w5e(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function S5e(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}const Myt=e=>e>=55296&&e<=56319,Dyt=e=>e>=56320&&e<=57343;function Bk(e,t){return!t||t==e.length||!Myt(e.charCodeAt(t-1))||!Dyt(e.charCodeAt(t))}function Ttr(e,t,n){var r;let a=n?.override;return a?a(e,t):(vj=((r=n?.scanLimit)!==null&&r!==void 0?r:1e9)>>1,yj=n?.timeout?Date.now()+n.timeout:0,Gme=!1,Ctr(e,t,Cw(e,0,e.length,t,0,t.length)))}function $yt(){return!Gme}function Lyt(e,t,n){return jtr(Ttr(e,t,n),e,t)}const Hh=Xt.define({combine:e=>e[0]}),cse=Kn.define(),Ntr=Xt.define(),Uk=Ji.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(cse)&&(e=n.value);for(let n of t.state.facet(Ntr))e=n(e,t);return e}});class NO{constructor(t,n,r,a,s,i=!0){this.changes=t,this.fromA=n,this.toA=r,this.fromB=a,this.toB=s,this.precise=i}offset(t,n){return t||n?new NO(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,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,n,r){let a=Lyt(t.toString(),n.toString(),r);return Fyt(a,t,n,0,0,$yt())}static updateA(t,n,r,a,s){return C5e(E5e(t,a,!0,r.length),t,n,r,s)}static updateB(t,n,r,a,s){return C5e(E5e(t,a,!1,n.length),t,n,r,s)}}function O5e(e,t,n,r){let a=n.lineAt(e),s=r.lineAt(t);return a.to==e&&s.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[a.from,s.from]}function k5e(e,t,n,r){let a=n.lineAt(e),s=r.lineAt(t);return a.from==e&&s.from==t?[e,t]:[a.to+1,s.to+1]}function Fyt(e,t,n,r,a,s){let i=[];for(let o=0;o<e.length;o++){let c=e[o],[u,d]=O5e(c.fromA+r,c.fromB+a,t,n),[f,p]=k5e(c.toA+r,c.toB+a,t,n),h=[c.offset(-u+r,-d+a)];for(;o<e.length-1;){let m=e[o+1],[g,v]=O5e(m.fromA+r,m.fromB+a,t,n);if(g>f+1&&v>p+1)break;h.push(m.offset(-u+r,-d+a)),[f,p]=k5e(m.toA+r,m.toB+a,t,n),o++}i.push(new NO(h,u,Math.max(u,f),d,Math.max(d,p),s))}return i}const B2=1e3;function _5e(e,t,n,r){let a=0,s=e.length;for(;;){if(a==s){let d=0,f=0;a&&({toA:d,toB:f}=e[a-1]);let p=t-(n?d:f);return[d+p,f+p]}let i=a+s>>1,o=e[i],[c,u]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(c>t)s=i;else if(u<=t)a=i+1;else return r?[o.fromA,o.fromB]:[o.toA,o.toB]}}function E5e(e,t,n,r){let a=[];return t.iterChangedRanges((s,i,o,c)=>{let u=0,d=n?t.length:r,f=0,p=n?r:t.length;s>B2&&([u,f]=_5e(e,s-B2,n,!0)),i<t.length-B2&&([d,p]=_5e(e,i+B2,n,!1));let h=c-o-(i-s),m,[g,v]=n?[h,0]:[0,h];a.length&&(m=a[a.length-1]).toA>=u?a[a.length-1]={fromA:m.fromA,fromB:m.fromB,toA:d,toB:p,diffA:m.diffA+g,diffB:m.diffB+v}:a.push({fromA:u,toA:d,fromB:f,toB:p,diffA:g,diffB:v})}),a}function C5e(e,t,n,r,a){if(!e.length)return t;let s=[];for(let i=0,o=0,c=0,u=0;;i++){let d=i==e.length?null:e[i],f=d?d.fromA+o:n.length,p=d?d.fromB+c:r.length;for(;u<t.length;){let v=t[u];if(d&&(v.toA+o>f||v.toB+c>p))break;s.push(v.offset(o,c)),u++}if(!d)break;let h=d.toA+o+d.diffA,m=d.toB+c+d.diffB,g=Lyt(n.sliceString(f,h),r.sliceString(p,m),a);for(let v of Fyt(g,n,r,f,p,$yt()))s.push(v);for(o+=d.diffA,c+=d.diffB;u<t.length;){let v=t[u];if(v.fromA+o>h&&v.fromB+c>m)break;u++}}return s}const Atr={scanLimit:500},zyt=hi.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=N5e(e))}update(e){(e.docChanged||e.viewportChanged||Itr(e.startState,e.state)||Rtr(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=N5e(e.view))}},{decorations:e=>e.deco}),U2=Jp.low(Ent({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(zyt))===null||t===void 0?void 0:t.gutter)||Fr.empty}}));function Itr(e,t){return e.field(Uk,!1)!=t.field(Uk,!1)}function Rtr(e,t){return e.facet(Hh)!=t.facet(Hh)}const j5e=tn.line({class:"cm-changedLine"}),Ptr=tn.mark({class:"cm-changedText"}),Mtr=tn.mark({tagName:"ins",class:"cm-insertedLine"}),Dtr=tn.mark({tagName:"del",class:"cm-deletedLine"}),T5e=new class extends vm{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function $tr(e,t,n,r,a,s){let i=n?e.fromA:e.fromB,o=n?e.toA:e.toB,c=0;if(i!=o){a.add(i,i,j5e),a.add(i,o,n?Dtr:Mtr),s&&s.add(i,i,T5e);for(let u=t.iterRange(i,o-1),d=i;!u.next().done;){if(u.lineBreak){d++,a.add(d,d,j5e),s&&s.add(d,d,T5e);continue}let f=d+u.value.length;if(r)for(;c<e.changes.length;){let p=e.changes[c],h=i+(n?p.fromA:p.fromB),m=i+(n?p.toA:p.toB),g=Math.max(d,h),v=Math.min(f,m);if(g<v&&a.add(g,v,Ptr),m<f)c++;else break}d=f}}}function N5e(e){let t=e.state.field(Uk),{side:n,highlightChanges:r,markGutter:a,overrideChunk:s}=e.state.facet(Hh),i=n=="a",o=new Eu,c=a?new Eu:null,{from:u,to:d}=e.viewport;for(let f of t){if((i?f.fromA:f.fromB)>=d)break;(i?f.toA:f.toB)>u&&(!s||!s(e.state,f,o,c))&&$tr(f,e.state.doc,i,r,o,c)}return{deco:o.finish(),gutter:c&&c.finish()}}class V2 extends $d{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=Kn.define({map:(e,t)=>e.map(t)}),bj=Ji.define({create:()=>tn.none,update:(e,t)=>{for(let n of t.effects)if(n.is(mL))return n.value;return e.map(t.changes)},provide:e=>vt.decorations.from(e)}),q2=.01;function A5e(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function Ltr(e,t,n){let r=new Eu,a=new Eu,s=e.state.field(bj).iter(),i=t.state.field(bj).iter(),o=0,c=0,u=0,d=0,f=e.viewport,p=t.viewport;for(let v=0;;v++){let b=v<n.length?n[v]:null,S=b?b.fromA:e.state.doc.length,O=b?b.fromB:t.state.doc.length;if(o<S){let k=e.lineBlockAt(o).top+u,E=t.lineBlockAt(c).top+d,C=k-E;C<-q2?(u-=C,r.add(o,o,tn.widget({widget:new V2(-C),block:!0,side:-1}))):C>q2&&(d+=C,a.add(c,c,tn.widget({widget:new V2(C),block:!0,side:-1})))}if(S>o+1e3&&o<f.from&&S>f.from&&c<p.from&&O>p.from){let k=Math.min(f.from-o,p.from-c);o+=k,c+=k,v--}else if(b)o=b.toA,c=b.toB;else break;for(;s.value&&s.from<o;)u-=s.value.spec.widget.height,s.next();for(;i.value&&i.from<c;)d-=i.value.spec.widget.height,i.next()}for(;s.value;)u-=s.value.spec.widget.height,s.next();for(;i.value;)d-=i.value.spec.widget.height,i.next();let h=e.contentHeight+u-(t.contentHeight+d);h<q2?r.add(e.state.doc.length,e.state.doc.length,tn.widget({widget:new V2(-h),block:!0,side:1})):h>q2&&a.add(t.state.doc.length,t.state.doc.length,tn.widget({widget:new V2(h),block:!0,side:1}));let m=r.finish(),g=a.finish();A5e(m,e.state.field(bj))||e.dispatch({effects:mL.of(m)}),A5e(g,t.state.field(bj))||t.dispatch({effects:mL.of(g)})}const use=Kn.define({map:(e,t)=>t.mapPos(e)});class Ftr extends $d{constructor(t){super(),this.lines=t}eq(t){return this.lines==t.lines}toDOM(t){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=t.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",r=>{let a=t.posAtDOM(r.target);t.dispatch({effects:use.of(a)});let{side:s,sibling:i}=t.state.facet(Hh);i&&i().dispatch({effects:use.of(ztr(a,t.state.field(Uk),s=="a"))})}),n}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function ztr(e,t,n){let r=0,a=0;for(let s=0;;s++){let i=s<t.length?t[s]:null;if(!i||(n?i.fromA:i.fromB)>=e)return a+(e-r);[r,a]=n?[i.toA,i.toB]:[i.toB,i.toA]}}const Btr=Ji.define({create(e){return tn.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(use)&&(e=e.update({filter:r=>r!=n.value}));return e},provide:e=>vt.decorations.from(e)});function I5e({margin:e=3,minSize:t=4}){return Btr.init(n=>Utr(n,e,t))}function Utr(e,t,n){let r=new Eu,a=e.facet(Hh).side=="a",s=e.field(Uk),i=1;for(let o=0;;o++){let c=o<s.length?s[o]:null,u=o?i+t:1,d=c?e.doc.lineAt(a?c.fromA:c.fromB).number-1-t:e.doc.lines,f=d-u+1;if(f>=n&&r.add(e.doc.line(u).from,e.doc.line(d).to,tn.replace({widget:new Ftr(f),block:!0})),!c)break;i=e.doc.lineAt(Math.min(e.doc.length,a?c.toA:c.toB)).number}return r.finish()}const Vtr=vt.styleModule.of(new nv({".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"}})),qtr=vt.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"}}),R5e=new S_,H2=new S_;class Htr{constructor(t){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=t.diffConfig||Atr;let n=[Jp.low(zyt),qtr,Vtr,bj,vt.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(p=>p.effects.some(h=>h.is(mL)))&&this.measure()})],r=[Hh.of({side:"a",sibling:()=>this.b,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&r.push(U2);let a=Pr.create({doc:t.a.doc,selection:t.a.selection,extensions:[t.a.extensions||[],vt.editorAttributes.of({class:"cm-merge-a"}),H2.of(r),n]}),s=[Hh.of({side:"b",sibling:()=>this.a,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&s.push(U2);let i=Pr.create({doc:t.b.doc,selection:t.b.selection,extensions:[t.b.extensions||[],vt.editorAttributes.of({class:"cm-merge-b"}),H2.of(s),n]});this.chunks=NO.build(a.doc,i.doc,this.diffConf);let o=[Uk.init(()=>this.chunks),R5e.of(t.collapseUnchanged?I5e(t.collapseUnchanged):[])];a=a.update({effects:Kn.appendConfig.of(o)}).state,i=i.update({effects:Kn.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 c=t.orientation||"a-b",u=document.createElement("div");u.className="cm-mergeViewEditor";let d=document.createElement("div");d.className="cm-mergeViewEditor",this.editorDOM.appendChild(c=="a-b"?u:d),this.editorDOM.appendChild(c=="a-b"?d:u),this.a=new vt({state:a,parent:u,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new vt({state:i,parent:d,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!t.revertControls,t.revertControls=="b-to-a",t.renderRevertControl),t.parent&&t.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(t,n){if(t.some(r=>r.docChanged)){let r=t[t.length-1],a=t.reduce((i,o)=>i.compose(o.changes),oo.empty(t[0].startState.doc.length));this.chunks=n==this.a?NO.updateA(this.chunks,r.newDoc,this.b.state.doc,a,this.diffConf):NO.updateB(this.chunks,this.a.state.doc,r.newDoc,a,this.diffConf),n.update([...t,r.state.update({effects:cse.of(this.chunks)})]);let s=n==this.a?this.b:this.a;s.update([s.state.update({effects:cse.of(this.chunks)})]),this.scheduleMeasure()}else n.update(t)}reconfigure(t){if("diffConfig"in t&&(this.diffConf=t.diffConfig),"orientation"in t){let s=t.orientation!="b-a";if(s!=(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(s?i:o,this.editorDOM.firstChild),this.editorDOM.appendChild(s?o:i),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in t||"renderRevertControl"in t){let s=!!this.revertDOM,i=this.revertToA,o=this.renderRevert;"revertControls"in t&&(s=!!t.revertControls,i=t.revertControls=="b-to-a"),"renderRevertControl"in t&&(o=t.renderRevertControl),this.setupRevertControls(s,i,o)}let n="highlightChanges"in t,r="gutter"in t,a="collapseUnchanged"in t;if(n||r||a){let s=[],i=[];if(n||r){let o=this.a.state.facet(Hh),c=r?t.gutter!==!1:o.markGutter,u=n?t.highlightChanges!==!1:o.highlightChanges;s.push(H2.reconfigure([Hh.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:c}),c?U2:[]])),i.push(H2.reconfigure([Hh.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:c}),c?U2:[]]))}if(a){let o=R5e.reconfigure(t.collapseUnchanged?I5e(t.collapseUnchanged):[]);s.push(o),i.push(o)}this.a.dispatch({effects:s}),this.b.dispatch({effects:i})}this.scheduleMeasure()}setupRevertControls(t,n,r){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=r,!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",a=>this.revertClicked(a)),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(){Ltr(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let t=this.revertDOM,n=t.firstChild,r=this.a.viewport,a=this.b.viewport;for(let s=0;s<this.chunks.length;s++){let i=this.chunks[s];if(i.fromA>r.to||i.fromB>a.to)break;if(i.fromA<r.from||i.fromB<a.from)continue;let o=this.a.lineBlockAt(i.fromA).top+"px";for(;n&&+n.dataset.chunk<s;)n=P5e(n);n&&n.dataset.chunk==String(s)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):t.insertBefore(this.renderRevertButton(o,s),n)}for(;n;)n=P5e(n)}renderRevertButton(t,n){let r;if(this.renderRevert)r=this.renderRevert();else{r=document.createElement("button");let a=this.a.state.phrase("Revert this chunk");r.setAttribute("aria-label",a),r.setAttribute("title",a),r.textContent=this.revertToLeft?"⇜":"⇝"}return r.style.top=t,r.setAttribute("data-chunk",String(n)),r}revertClicked(t){let n=t.target,r;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(r=this.chunks[n.dataset.chunk])){let[a,s,i,o,c,u]=this.revertToA?[this.b,this.a,r.fromB,r.toB,r.fromA,r.toA]:[this.a,this.b,r.fromA,r.toA,r.fromB,r.toB],d=a.state.sliceDoc(i,Math.max(i,o-1));i!=o&&u<=s.state.doc.length&&(d+=a.state.lineBreak),s.dispatch({changes:{from:c,to:Math.min(s.state.doc.length,u),insert:d},userEvent:"revert"}),t.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function P5e(e){let t=e.nextSibling;return e.remove(),t}const M5e={modelSettings:{maxRetries:2,maxSteps:5,chatWithGenerateLegacy:!1,chatWithGenerate:!1}};function Qtr({agentId:e,defaultSettings:t}){const[n,r]=x.useState(t),a=`mastra-agent-store-${e}`;return x.useEffect(()=>{try{const o=localStorage.getItem(a),c=o?JSON.parse(o):{},u={...c,modelSettings:{...M5e.modelSettings,...c?.modelSettings??{},...t?.modelSettings??{}}};r(u)}catch{}},[a,t]),{settings:n,setSettings:o=>{r(c=>({...c,...o})),localStorage.setItem(a,JSON.stringify({...o,agentId:e}))},resetAll:()=>{const o={modelSettings:{...M5e.modelSettings,...t?.modelSettings??{}}};r(o),localStorage.removeItem(a)}}}const Byt=x.createContext({});function Xme({children:e,agentId:t,defaultSettings:n}){const{settings:r,setSettings:a,resetAll:s}=Qtr({agentId:t,defaultSettings:n});return l.jsx(Byt.Provider,{value:{settings:r,setSettings:a,resetAll:s},children:e})}const Kme=()=>x.useContext(Byt),Vr=Ile()(w2t(e=>({requestContext:{},theme:"dark",setRequestContext:t=>e({requestContext:t}),setTheme:t=>e({theme:t})}),{name:"mastra-playground-store"})),Jme=x.createContext(null);function Gz({children:e}){const{requestContext:t}=Vr(),[n,r]=x.useState(t),a=i=>r(i),s=()=>{r({})};return l.jsx(Jme.Provider,{value:{schemaValues:n,setSchemaValues:a,clearSchemaValues:s},children:e})}function Uyt(){const e=x.useContext(Jme);if(!e)throw new Error("useSchemaRequestContext must be used within a SchemaRequestContextProvider");return e}function ko(){const{requestContext:e}=Vr(),n=x.useContext(Jme)?.schemaValues??{};return{...e??{},...n}}const Vyt=({threadId:e,agentId:t,memory:n})=>{const r=qe(),{requestContext:a}=Vr();return wt({queryKey:["memory","messages",e,t,"requestContext"],queryFn:async()=>e?await r.listThreadMessages(e,{agentId:t,requestContext:a}):null,enabled:n&&!!e,staleTime:0,gcTime:0,retry:!1,refetchOnWindowFocus:!1})},Wtr=({multiple:e=!0,onChange:t}={})=>{const n=O7t(s=>!s.isEditing),r=hI(),a=x.useCallback(()=>{const s=document.createElement("input");s.type="file",s.multiple=e,s.hidden=!0;const i=r.getState().attachmentAccept;i&&i!=="*"&&(s.accept=i),document.body.appendChild(s),s.onchange=o=>{const c=o.target.files;if(c){for(const u of c)r.addAttachment(u),t?.(Array.from(c));document.body.removeChild(s)}},s.oncancel=()=>{(!s.files||s.files.length===0)&&document.body.removeChild(s)},s.click()},[r,e]);if(!n)return a},Gl={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},jR="focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",Gtr="focus-within:outline-none focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",Ztr="rounded-md",ege="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",tge="outline-none focus-visible:outline-none focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",nge="disabled:opacity-50 disabled:cursor-not-allowed";function qyt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=qyt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Hyt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=qyt(e))&&(r&&(r+=" "),r+=t);return r}const Ytr=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Xtr=(e,t)=>({classGroupId:e,validator:t}),Qyt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),gL="-",D5e=[],Ktr="arbitrary..",Jtr=e=>{const t=tnr(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return enr(i);const o=i.split(gL),c=o[0]===""&&o.length>1?1:0;return Wyt(o,c,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const c=r[i],u=n[i];return c?u?Ytr(u,c):c:u||D5e}return n[i]||D5e}}},Wyt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const u=Wyt(e,t+1,s);if(u)return u}const i=n.validators;if(i===null)return;const o=t===0?e.join(gL):e.slice(t).join(gL),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(o))return d.classGroupId}},enr=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Ktr+r:void 0})(),tnr=e=>{const{theme:t,classGroups:n}=e;return nnr(n,t)},nnr=(e,t)=>{const n=Qyt();for(const r in e){const a=e[r];rge(a,n,r,t)}return n},rge=(e,t,n,r)=>{const a=e.length;for(let s=0;s<a;s++){const i=e[s];rnr(i,t,n,r)}},rnr=(e,t,n,r)=>{if(typeof e=="string"){anr(e,t,n);return}if(typeof e=="function"){snr(e,t,n,r);return}inr(e,t,n,r)},anr=(e,t,n)=>{const r=e===""?t:Gyt(t,e);r.classGroupId=n},snr=(e,t,n,r)=>{if(onr(e)){rge(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Xtr(n,e))},inr=(e,t,n,r)=>{const a=Object.entries(e),s=a.length;for(let i=0;i<s;i++){const[o,c]=a[i];rge(c,Gyt(t,o),n,r)}},Gyt=(e,t)=>{let n=e;const r=t.split(gL),a=r.length;for(let s=0;s<a;s++){const i=r[s];let o=n.nextPart.get(i);o||(o=Qyt(),n.nextPart.set(i,o)),n=o}return n},onr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,lnr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in n?n[s]=i:a(s,i)}}},dse="!",$5e=":",cnr=[],L5e=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),unr=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const s=[];let i=0,o=0,c=0,u;const d=a.length;for(let g=0;g<d;g++){const v=a[g];if(i===0&&o===0){if(v===$5e){s.push(a.slice(c,g)),c=g+1;continue}if(v==="/"){u=g;continue}}v==="["?i++:v==="]"?i--:v==="("?o++:v===")"&&o--}const f=s.length===0?a:a.slice(c);let p=f,h=!1;f.endsWith(dse)?(p=f.slice(0,-1),h=!0):f.startsWith(dse)&&(p=f.slice(1),h=!0);const m=u&&u>c?u-c:void 0;return L5e(s,h,p,m)};if(t){const a=t+$5e,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):L5e(cnr,!1,i,void 0,!0)}if(n){const a=r;r=s=>n({className:s,parseClassName:a})}return r},dnr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let s=0;s<n.length;s++){const i=n[s],o=i[0]==="[",c=t.has(i);o||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},fnr=e=>({cache:lnr(e.cacheSize),parseClassName:unr(e),sortModifiers:dnr(e),...Jtr(e)}),pnr=/\s+/,hnr=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=t,i=[],o=e.trim().split(pnr);let c="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let v=!!g,b=r(v?m.substring(0,g):m);if(!b){if(!v){c=d+(c.length>0?" "+c:c);continue}if(b=r(m),!b){c=d+(c.length>0?" "+c:c);continue}v=!1}const S=p.length===0?"":p.length===1?p[0]:s(p).join(":"),O=h?S+dse:S,k=O+b;if(i.indexOf(k)>-1)continue;i.push(k);const E=a(b,v);for(let C=0;C<E.length;++C){const T=E[C];i.push(O+T)}c=d+(c.length>0?" "+c:c)}return c},mnr=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=Zyt(n))&&(a&&(a+=" "),a+=r);return a},Zyt=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Zyt(e[r]))&&(n&&(n+=" "),n+=t);return n},F5e=(e,...t)=>{let n,r,a,s;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=fnr(u),r=n.cache.get,a=n.cache.set,s=o,o(c)},o=c=>{const u=r(c);if(u)return u;const d=hnr(c,n);return a(c,d),d};return s=i,(...c)=>s(mnr(...c))},gnr=[],To=e=>{const t=n=>n[e]||gnr;return t.isThemeGetter=!0,t},Yyt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Xyt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,vnr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ynr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bnr=/\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$/,xnr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wnr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Snr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yy=e=>vnr.test(e),Rr=e=>!!e&&!Number.isNaN(Number(e)),by=e=>!!e&&Number.isInteger(Number(e)),_J=e=>e.endsWith("%")&&Rr(e.slice(0,-1)),mg=e=>ynr.test(e),Kyt=()=>!0,Onr=e=>bnr.test(e)&&!xnr.test(e),age=()=>!1,knr=e=>wnr.test(e),_nr=e=>Snr.test(e),Enr=e=>!hn(e)&&!xn(e),Cnr=e=>tx(e,tbt,age),hn=e=>Yyt.test(e),Fx=e=>tx(e,nbt,Onr),z5e=e=>tx(e,Mnr,Rr),jnr=e=>tx(e,abt,Kyt),Tnr=e=>tx(e,rbt,age),B5e=e=>tx(e,Jyt,age),Nnr=e=>tx(e,ebt,_nr),Q2=e=>tx(e,sbt,knr),xn=e=>Xyt.test(e),DC=e=>uS(e,nbt),Anr=e=>uS(e,rbt),U5e=e=>uS(e,Jyt),Inr=e=>uS(e,tbt),Rnr=e=>uS(e,ebt),W2=e=>uS(e,sbt,!0),Pnr=e=>uS(e,abt,!0),tx=(e,t,n)=>{const r=Yyt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},uS=(e,t,n=!1)=>{const r=Xyt.exec(e);return r?r[1]?t(r[1]):n:!1},Jyt=e=>e==="position"||e==="percentage",ebt=e=>e==="image"||e==="url",tbt=e=>e==="length"||e==="size"||e==="bg-size",nbt=e=>e==="length",Mnr=e=>e==="number",rbt=e=>e==="family-name",abt=e=>e==="number"||e==="weight",sbt=e=>e==="shadow",V5e=()=>{const e=To("color"),t=To("font"),n=To("text"),r=To("font-weight"),a=To("tracking"),s=To("leading"),i=To("breakpoint"),o=To("container"),c=To("spacing"),u=To("radius"),d=To("shadow"),f=To("inset-shadow"),p=To("text-shadow"),h=To("drop-shadow"),m=To("blur"),g=To("perspective"),v=To("aspect"),b=To("ease"),S=To("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...k(),xn,hn],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[xn,hn,c],A=()=>[yy,"full","auto",...j()],I=()=>[by,"none","subgrid",xn,hn],P=()=>["auto",{span:["full",by,xn,hn]},by,xn,hn],M=()=>[by,"auto",xn,hn],F=()=>["auto","min","max","fr",xn,hn],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...j()],B=()=>[yy,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],q=()=>[yy,"screen","full","dvw","lvw","svw","min","max","fit",...j()],W=()=>[yy,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,xn,hn],Z=()=>[...k(),U5e,B5e,{position:[xn,hn]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],R=()=>["auto","cover","contain",Inr,Cnr,{size:[xn,hn]}],Q=()=>[_J,DC,Fx],G=()=>["","none","full",u,xn,hn],ee=()=>["",Rr,DC,Fx],re=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Rr,_J,U5e,B5e],oe=()=>["","none",m,xn,hn],pe=()=>["none",Rr,xn,hn],K=()=>["none",Rr,xn,hn],ae=()=>[Rr,xn,hn],ie=()=>[yy,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mg],breakpoint:[mg],color:[Kyt],container:[mg],"drop-shadow":[mg],ease:["in","out","in-out"],font:[Enr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mg],shadow:[mg],spacing:["px",Rr],text:[mg],"text-shadow":[mg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yy,hn,xn,v]}],container:["container"],columns:[{columns:[Rr,hn,xn,o]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:E()}],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:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[by,"auto",xn,hn]}],basis:[{basis:[yy,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Rr,yy,"auto","initial","none",hn]}],grow:[{grow:["",Rr,xn,hn]}],shrink:[{shrink:["",Rr,xn,hn]}],order:[{order:[by,"first","last","none",xn,hn]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],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":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[o,"screen",...B()]}],"min-w":[{"min-w":[o,"screen","none",...B()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,DC,Fx]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Pnr,jnr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_J,hn]}],"font-family":[{font:[Anr,Tnr,t]}],"font-features":[{"font-features":[hn]}],"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:[a,xn,hn]}],"line-clamp":[{"line-clamp":[Rr,"none",xn,z5e]}],leading:[{leading:[s,...j()]}],"list-image":[{"list-image":["none",xn,hn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xn,hn]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Rr,"from-font","auto",xn,Fx]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Rr,"auto",xn,hn]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xn,hn]}],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",xn,hn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},by,xn,hn],radial:["",xn,hn],conic:[by,xn,hn]},Rnr,Nnr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],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:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-bs":[{"border-bs":ee()}],"border-w-be":[{"border-be":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Rr,xn,hn]}],"outline-w":[{outline:["",Rr,DC,Fx]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,W2,Q2]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,W2,Q2]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Rr,Fx]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,W2,Q2]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Rr,xn,hn]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"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":[Rr]}],"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":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"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":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"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":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"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":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"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":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"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":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"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":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[xn,hn]}],"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":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Rr]}],"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":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xn,hn]}],filter:[{filter:["","none",xn,hn]}],blur:[{blur:oe()}],brightness:[{brightness:[Rr,xn,hn]}],contrast:[{contrast:[Rr,xn,hn]}],"drop-shadow":[{"drop-shadow":["","none",h,W2,Q2]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Rr,xn,hn]}],"hue-rotate":[{"hue-rotate":[Rr,xn,hn]}],invert:[{invert:["",Rr,xn,hn]}],saturate:[{saturate:[Rr,xn,hn]}],sepia:[{sepia:["",Rr,xn,hn]}],"backdrop-filter":[{"backdrop-filter":["","none",xn,hn]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[Rr,xn,hn]}],"backdrop-contrast":[{"backdrop-contrast":[Rr,xn,hn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Rr,xn,hn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Rr,xn,hn]}],"backdrop-invert":[{"backdrop-invert":["",Rr,xn,hn]}],"backdrop-opacity":[{"backdrop-opacity":[Rr,xn,hn]}],"backdrop-saturate":[{"backdrop-saturate":[Rr,xn,hn]}],"backdrop-sepia":[{"backdrop-sepia":["",Rr,xn,hn]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xn,hn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Rr,"initial",xn,hn]}],ease:[{ease:["linear","initial",b,xn,hn]}],delay:[{delay:[Rr,xn,hn]}],animate:[{animate:["none",S,xn,hn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,xn,hn]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[xn,hn,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",xn,hn]}],"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":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",xn,hn]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Rr,DC,Fx,z5e]}],stroke:[{stroke:["none",...L()]}],"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"]}},Dnr=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:a={},override:s={}})=>(xj(e,"cacheSize",t),xj(e,"prefix",n),xj(e,"experimentalParseClassName",r),G2(e.theme,s.theme),G2(e.classGroups,s.classGroups),G2(e.conflictingClassGroups,s.conflictingClassGroups),G2(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),xj(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),Z2(e.theme,a.theme),Z2(e.classGroups,a.classGroups),Z2(e.conflictingClassGroups,a.conflictingClassGroups),Z2(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),ibt(e,a,"orderSensitiveModifiers"),e),xj=(e,t,n)=>{n!==void 0&&(e[t]=n)},G2=(e,t)=>{if(t)for(const n in t)xj(e,n,t[n])},Z2=(e,t)=>{if(t)for(const n in t)ibt(e,t,n)},ibt=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},$nr=(e,...t)=>typeof e=="function"?F5e(V5e,e,...t):F5e(()=>Dnr(V5e(),e),...t),Lnr=Object.keys({...B6,...fYt}),Fnr=Object.keys(yYt),znr=Object.keys(pYt),Bnr=Object.keys(hYt),Unr=Object.keys(dYt),zx=Object.keys(vYt),Vnr=Object.keys(mYt).concat(Object.keys(gYt)),qnr=$nr({extend:{theme:{color:Lnr,spacing:Fnr,radius:Unr,leading:Bnr,shadow:Vnr},classGroups:{"font-size":[{text:znr}],h:[{h:zx}],w:[{w:zx}],size:[{size:zx}],"min-h":[{"min-h":zx}],"min-w":[{"min-w":zx}],"max-h":[{"max-h":zx}],"max-w":[{"max-w":zx}]}}});function Y(...e){return qnr(Hyt(e))}const Hnr={sm:`${Gl.sm} text-ui-sm px-[.75em]`,md:`${Gl.md} text-ui-md px-[.75em]`,default:`${Gl.default} text-ui-md px-[.85em] `,lg:`${Gl.lg} text-ui-lg px-[1em] `},Qnr={default:"bg-surface3 border-2 border-border1 hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral5",primary:"bg-surface4 border-2 border-border2 hover:text-neutral6 hover:bg-surface5 active:bg-surface6 text-neutral6",cta:"bg-accent1/50 hover:bg-accent1/80 text-neutral5 font-semibold",ghost:"bg-transparent border-2 border-transparent hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral4",inputLike:ege,light:"",outline:""},Wnr=Y("flex items-center justify-center gap-[.75em] leading-0 transition-colors duration-200 ease-out-custom rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100",nge,tge),Gnr={light:"default",outline:"default"};function Znr(e){return Gnr[e]??e}function Q_(e){const t=Znr(e?.variant||"default"),n=e?.size||"default";return Y(Wnr,Qnr[t],Hnr[n],e?.iconOnly&&"[&>svg]:opacity-75")}function obt(e){const t=[];return Ee.Children.forEach(e,n=>{Ee.isValidElement(n)&&n.type===Ee.Fragment?t.push(...obt(n.props.children)):t.push(n)}),t}function Ynr(e){const t=obt(e);return t.length>0&&t.every(n=>Ee.isValidElement(n))}const ge=Ee.forwardRef(({className:e,as:t,size:n="default",variant:r="default",disabled:a,children:s,...i},o)=>{const c=t||"button",u=Ynr(s);return l.jsx(c,{ref:o,disabled:a,className:Y(Q_({variant:r,size:n,iconOnly:u}),e),...i,children:s})});ge.displayName="Button";const Uo=T6t,nr=N6t,rr=A6t,Jn=x.forwardRef(({className:e,sideOffset:t=4,children:n,...r},a)=>l.jsx(I6t,{children:l.jsxs(UWe,{ref:a,sideOffset:t,className:Y("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),...r,children:[n,l.jsx(R6t,{className:"fill-surface6"})]})}));Jn.displayName=UWe.displayName;const Gi=Ee.forwardRef(({tooltipContent:e,...t},n)=>l.jsxs(nr,{children:[l.jsx(rr,{asChild:!0,children:l.jsx(ge,{ref:n,...t})}),e&&l.jsx(Jn,{children:e})]}));Gi.displayName="ButtonWithTooltip";const jr=p6,lbt=KZe,Xnr=h6,cbt=x.forwardRef(({className:e,...t},n)=>l.jsx(vI,{ref:n,className:Y("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}));cbt.displayName=vI.displayName;const _r=x.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Xnr,{children:[l.jsx(cbt,{}),l.jsxs(yI,{ref:r,className:Y("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),...n,children:[t,l.jsxs(v6,{className:Y("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:[l.jsx(mr,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));_r.displayName=yI.displayName;const Tr=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});Tr.displayName="DialogHeader";const Id=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Id.displayName="DialogFooter";const zr=({className:e,...t})=>l.jsx("div",{className:Y("overflow-y-auto px-6 max-h-[50vh]",e),...t});zr.displayName="DialogBody";const Er=x.forwardRef(({className:e,...t},n)=>l.jsx(m6,{ref:n,className:Y("text-ui-md font-medium",e),...t}));Er.displayName=m6.displayName;const Ya=x.forwardRef(({className:e,...t},n)=>l.jsx(g6,{ref:n,className:Y("sr-only",e),...t}));Ya.displayName=g6.displayName;const q5e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,H5e=Hyt,TR=(e,t)=>n=>{var r;if(t?.variants==null)return H5e(e,n?.class,n?.className);const{variants:a,defaultVariants:s}=t,i=Object.keys(a).map(u=>{const d=n?.[u],f=s?.[u];if(d===null)return null;const p=q5e(d)||q5e(f);return a[u][p]}),o=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...s,...o}[g]):{...s,...o}[g]===v})?[...u,f,p]:u},[]);return H5e(e,i,c,n?.class,n?.className)},Knr=TR(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(ege,tge,nge),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Gl.sm} text-ui-sm px-[.75em]`,md:`${Gl.md} text-ui-md px-[.75em]`,default:`${Gl.default} text-ui-md px-[.85em]`,lg:`${Gl.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),an=x.forwardRef(({className:e,size:t,testId:n,variant:r,type:a,error:s,...i},o)=>l.jsx("input",{type:a,className:Y(Knr({variant:r,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:o,"aria-invalid":s,...i}));an.displayName="Input";const Jnr=TR("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=x.forwardRef(({className:e,...t},n)=>l.jsx(xet,{ref:n,className:Y(Jnr(),e),...t}));xt.displayName=xet.displayName;const err={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-smd":"text-ui-smd leading-ui-smd","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-xs":"text-header-xs leading-header-xs","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"},trr={mono:"font-mono"},me=({as:e="p",className:t,variant:n="ui-md",font:r,...a})=>l.jsx(e,{className:Y(err[n],r&&trr[r],t),...a}),hs=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),ubt=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.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"}),l.jsxs("g",{clipPath:"url(#clip0_21421_19519)",children:[l.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"}),l.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"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21421_19519",children:l.jsx("rect",{width:"62.7591",height:"62.7591",fill:"white",transform:"matrix(0.897148 0.441731 -0.897148 0.441731 63.1714 7.24365)"})})})]}),nrr=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),sge=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),ige=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),qi=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),dbt=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:l.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"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_22095",children:l.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),fbt=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[l.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:"#4285F4"}),l.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:"#34A853"}),l.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:"#FBBC05"}),l.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:"#EA4335"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_20513",children:l.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),rrr={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"},ke=({children:e,className:t,size:n="default",...r})=>l.jsx("span",{className:Y("block",rrr[n],t),...r,children:e}),arr=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),pbt=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),srr=e=>l.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),oge=e=>l.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),irr=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),Xi=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),W_=e=>l.jsx(sYt,{...e}),bo=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),orr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.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"}),l.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"})]}),Pc=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),lrr=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),crr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.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"}),l.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"}),l.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"})]}),urr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.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"}),l.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 ob(e){return l.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:[l.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),l.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),l.jsx("path",{d:"M15 2v2"}),l.jsx("path",{d:"M15 20v2"}),l.jsx("path",{d:"M2 15h2"}),l.jsx("path",{d:"M2 9h2"}),l.jsx("path",{d:"M20 15h2"}),l.jsx("path",{d:"M20 9h2"}),l.jsx("path",{d:"M9 2v2"}),l.jsx("path",{d:"M9 20v2"})]})}const drr={jpg:"image/jpg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",pdf:"application/pdf"},frr=async e=>{try{const t=await fetch(e,{method:"HEAD"});if(!t.ok)throw new Error("Failed to get file content type");const n=t.headers.get("content-type");if(!n)throw new Error("Failed to get file content type");return n}catch{const r=new URL(e).pathname.split(".").pop();if(!r)return;const a=r.toLowerCase();return drr[a]}},prr=({onOpenChange:e,open:t})=>{const n=hI(),r=Wtr({onChange:()=>e(!1)}),a=async s=>{s.preventDefault();const o=new FormData(s.target).get("url-attachment")?.toString();if(o){const c=new File([],o,{type:await frr(o)});n.addAttachment(c),e(!1)}};return l.jsx(jr,{onOpenChange:e,open:t,children:l.jsxs(_r,{children:[l.jsxs(Tr,{children:[l.jsx(Er,{children:"Add attachment"}),l.jsx(Ya,{children:"Add a file attachment via URL or from your computer"})]}),l.jsxs(zr,{children:[l.jsxs("form",{onSubmit:a,className:"flex flex-row items-end gap-4",children:[l.jsxs("div",{className:"w-full space-y-1",children:[l.jsx(xt,{htmlFor:"url-attachment",className:"text-neutral3 text-ui-md",children:"Public URL"}),l.jsx(an,{type:"text",name:"url-attachment",id:"url-attachment",className:"w-full",placeholder:"https://placehold.co/600x400/png"})]}),l.jsxs(ge,{type:"submit",className:"!h-8",variant:"light",children:[l.jsx(ke,{children:l.jsx(AGt,{})}),"Add"]})]}),l.jsx("hr",{className:"my-2 border border-border1"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(me,{variant:"ui-md",className:"text-neutral3",children:"Or from your computer"}),l.jsxs("button",{onClick:r,className:"w-full h-40 border border-border1 rounded-lg text-neutral3 border-dashed flex flex-col items-center justify-center gap-2 hover:bg-surface2 active:bg-surface3",children:[l.jsx(vWt,{className:"size-12"}),l.jsx(me,{variant:"header-md",children:"Add a local file"})]})]})]})]})})},hrr=e=>{const[t,n]=x.useState(void 0);return x.useEffect(()=>{if(!e){n(void 0);return}const r=URL.createObjectURL(e);return n(r),()=>{URL.revokeObjectURL(r)}},[e]),t},mrr=()=>{const{file:e,src:t}=_D(dZe(n=>{if(n.file)return n.file.name.startsWith("https://")?{src:n.file.name}:{file:n.file};const r=n.content?.filter(a=>a.type==="image")[0]?.image;return r?{src:r}:{}}));return hrr(e)??t},grr=()=>{const e=hI(),[t,n]=x.useState(!1);return x.useEffect(()=>{e.subscribe(()=>{const r=e.getState().attachments;n(r.length>0)})},[e]),t},vrr=e=>{const[t,n]=x.useState({isLoading:!1,text:""});return x.useEffect(()=>{if(!e)return;(async()=>{n(s=>({...s,isLoading:!0}));const a=await e.text();n(s=>({...s,isLoading:!1,text:a}))})()},[e]),t},vL="h-full w-full flex items-center justify-center",hbt=({data:e,url:t})=>{const[n,r]=x.useState(!1);return t?l.jsx("a",{href:t,className:vL,target:"_blank",rel:"noreferrer noopener",children:l.jsx(_u,{className:"text-accent2","aria-label":"View PDF"})}):l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>r(!0),className:vL,type:"button",children:l.jsx(_u,{className:"text-accent2","aria-label":"View PDF"})}),l.jsx(yrr,{data:e,open:n,onOpenChange:r})]})},yrr=({data:e,open:t,onOpenChange:n})=>l.jsx(jr,{open:t,onOpenChange:n,children:l.jsxs(_r,{className:"max-w-4xl",children:[l.jsxs(Tr,{children:[l.jsx(Er,{children:"PDF preview"}),l.jsx(Ya,{children:"Preview of the PDF document"})]}),l.jsx(zr,{children:t&&l.jsx("iframe",{src:e,width:"100%",height:"600px"})})]})}),mbt=({src:e})=>{const[t,n]=x.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>n(!0),type:"button",className:vL,children:l.jsx("img",{src:e,className:"object-cover aspect-ratio max-h-[140px] max-w-[320px]",alt:"Preview"})}),l.jsx(brr,{src:e,open:t,onOpenChange:n})]})},brr=({src:e,open:t,onOpenChange:n})=>l.jsx(jr,{open:t,onOpenChange:n,children:l.jsxs(_r,{className:"max-w-4xl",children:[l.jsxs(Tr,{children:[l.jsx(Er,{children:"Image preview"}),l.jsx(Ya,{children:"Preview of the image"})]}),l.jsx(zr,{children:t&&l.jsx("img",{src:e,alt:"Image"})})]})}),gbt=({data:e})=>{const[t,n]=x.useState(!1),r=e.replace(/<attachment[^>]*>/,"").replace(/<\/attachment>/g,"");return l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>n(!0),className:vL,type:"button",children:l.jsx(_u,{className:"text-neutral3"})}),l.jsx(xrr,{data:r,open:t,onOpenChange:n})]})},xrr=({data:e,open:t,onOpenChange:n})=>l.jsx(jr,{open:t,onOpenChange:n,children:l.jsxs(_r,{className:"max-w-4xl h-[80vh]",children:[l.jsxs(Tr,{children:[l.jsx(Er,{children:"Text preview"}),l.jsx(Ya,{children:"Preview of the text file"})]}),l.jsx(zr,{children:t&&l.jsx("div",{className:"whitespace-pre-wrap",children:e})})]})}),wrr={sm:`${Gl.sm} w-form-sm`,md:`${Gl.md} w-form-md`,lg:`${Gl.lg} w-form-lg`,default:`${Gl.default}`},Srr={sm:"sm",md:"default",lg:"lg",default:"default"},Orr={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"},krr="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",fs=Ee.forwardRef(({className:e,children:t,tooltip:n,size:r="md",variant:a="default",disabled:s,...i},o)=>l.jsxs(nr,{children:[l.jsx(rr,{asChild:!0,children:l.jsx("button",{ref:o,disabled:s,"aria-label":typeof n=="string"?n:void 0,className:Y(krr,jR,Orr[a],wrr[r],s&&"active:scale-100",e),...i,children:l.jsx(ke,{size:Srr[r],children:t})})}),l.jsx(Jn,{children:n})]}));fs.displayName="IconButton";const _rr={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function Ht({color:e,className:t,size:n="md"}){return l.jsx("svg",{className:Y("animate-spin",_rr[n],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:l.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:e||"currentColor",className:"text-accent1"})})}const vbt=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const a=r.result;typeof a=="string"?t(a):n(new Error("Failed to convert file to base64."))},r.onerror=a=>{n(a)},r.readAsDataURL(e)}),Err=({document:e})=>{const{isLoading:t,text:n}=vrr(e.file);return l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t?l.jsx(Ht,{className:"animate-spin"}):l.jsx(gbt,{data:n})})},Crr=({document:e})=>{const[t,n]=x.useState({isLoading:!1,text:""});x.useEffect(()=>{let a=!1;return(async()=>{if(!e.file)return;n(o=>({...o,isLoading:!0}));const i=await vbt(e.file);a||n(o=>({...o,isLoading:!1,text:i}))})(),()=>{a=!0}},[e]);const r=e.file?.name.startsWith("https://");return l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t.isLoading?l.jsx(Ht,{className:"animate-spin"}):l.jsx(hbt,{data:t.text,url:r?e.file?.name:void 0})})},jrr=()=>{const e=_D(i=>i.type==="image"),t=_D(i=>i.type==="document"?i:void 0),n=mrr(),r=_D(i=>i.source!=="message"),s=t?.file?.name.startsWith("https://")?t?.file?.name:n;return l.jsx(l.Fragment,{children:l.jsxs("div",{className:"relative",children:[l.jsx(J5,{children:l.jsxs(nr,{children:[l.jsx(CJe,{children:l.jsx(rr,{asChild:!0,children:l.jsx("div",{className:"overflow-hidden size-16 rounded-lg bg-surface3 border border-border1 ",children:e?l.jsx(mbt,{src:s??""}):t?.contentType==="application/pdf"?l.jsx(Crr,{document:t}):t?l.jsx(Err,{document:t}):null})})}),l.jsx(Jn,{side:"top",children:l.jsx(jJe,{})})]})}),r&&l.jsx(Trr,{})]})})},Trr=()=>l.jsx(CHt,{asChild:!0,children:l.jsx(fs,{variant:"light",size:"md",tooltip:"Remove file",className:"absolute -right-3 -top-3 text-neutral3 hover:text-neutral6 bg-surface1 hover:bg-surface2 rounded-full p-1",children:l.jsx(ke,{children:l.jsx(Sb,{})})})}),Nrr=()=>grr()?l.jsx("div",{className:"flex w-full flex-row items-center gap-4 pb-2",children:l.jsx(gZe,{components:{Attachment:jrr}})}):null;function Arr({containerRef:e}){const[t,n]=x.useState([]),[r,a]=x.useState(null),s=x.useRef(""),i=x.useRef(0),o=x.useCallback(()=>{const u=e.current;if(!u){s.current!==""&&(s.current="",n([]));return}const d=u.getBoundingClientRect(),f=Array.from(u.querySelectorAll("[data-om-badge]"));if(f.length===0){s.current!==""&&(s.current="",n([]));return}const p=[];for(let m=0;m<f.length;m++){const g=f[m],v=g.getAttribute("data-om-badge")||"",b=g.getAttribute("data-om-state")||"complete",S=g.getAttribute("data-om-type")||"observation",O=g.getBoundingClientRect();let k;const E=Irr(f,m,S);if(E){const A=parseFloat(getComputedStyle(E).marginBottom)||0;k=E.getBoundingClientRect().bottom+A-d.top}else k=0;const C=parseFloat(getComputedStyle(g).marginBottom)||0,j=O.bottom+C-d.top-k;j<=0||p.push({cycleId:v,omType:S,state:b,top:k,height:j})}const h=JSON.stringify(p);h!==s.current&&(s.current=h,n(p))},[e]);if(x.useEffect(()=>{const u=e.current;if(!u)return;o();const d=new ResizeObserver(()=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(o)});d.observe(u);const f=new MutationObserver(()=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(o)});return f.observe(u,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(i.current),d.disconnect(),f.disconnect()}},[o,e]),x.useEffect(()=>{const u=e.current;if(!u)return;const d=p=>{const h=p.target.closest("[data-om-badge]");h&&a(h.getAttribute("data-om-badge"))},f=p=>{p.target.closest("[data-om-badge]")&&a(null)};return u.addEventListener("mouseover",d),u.addEventListener("mouseout",f),()=>{u.removeEventListener("mouseover",d),u.removeEventListener("mouseout",f)}},[e]),t.length===0)return null;const c=t[t.length-1]?.cycleId??null;return l.jsx("div",{className:"pointer-events-none absolute inset-0",style:{zIndex:0},children:t.map(u=>{const d=u.cycleId===c,f=u.cycleId===r,p=r?f:d;return l.jsx(Rrr,{highlight:u,visible:p},u.cycleId)})})}function Irr(e,t,n){for(let r=t-1;r>=0;r--){const a=e[r];if(a.getAttribute("data-om-state")!=="failed"&&(n==="observation"||a.getAttribute("data-om-type")==="reflection"))return a}return null}function Rrr({highlight:e,visible:t}){const n=Prr(e.state),r=e.state.startsWith("buffering");return l.jsx("div",{className:"absolute left-0 right-0 transition-opacity duration-200",style:{top:e.top,height:e.height,border:`3px ${r?"dashed":"solid"} ${n}`,borderRadius:"0.5rem",opacity:t?1:0}})}function Prr(e){switch(e){case"complete":return"rgba(34, 197, 94, 0.4)";case"loading":return"rgba(59, 130, 246, 0.4)";case"failed":return"rgba(239, 68, 68, 0.4)";case"disconnected":return"rgba(234, 179, 8, 0.4)";case"buffering":return"rgba(168, 85, 247, 0.4)";case"buffering-complete":return"rgba(168, 85, 247, 0.4)";case"buffering-failed":return"rgba(239, 68, 68, 0.4)";case"activated":return"rgba(34, 197, 94, 0.4)";default:return"rgba(34, 197, 94, 0.4)"}}const Hn={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"},nx={visible:"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},Mrr={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"},Drr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},rt=({icon:e,variant:t="default",className:n,children:r,...a})=>l.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",Hn.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":Mrr[t],n),...a,children:[e&&l.jsx("span",{className:Drr[t],children:l.jsx(ke,{children:e})}),r]}),Zz=({children:e,initialCollapsed:t=!0,icon:n,title:r,collapsible:a=!0,extraInfo:s,"data-testid":i})=>{const[o,c]=x.useState(t);return x.useEffect(()=>{c(t)},[t]),l.jsxs("div",{className:"mb-4","data-testid":i,children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between",children:[l.jsxs("button",{onClick:a?()=>c(u=>!u):void 0,className:"flex items-center gap-2 disabled:cursor-not-allowed",disabled:!a,type:"button",children:[l.jsx(ke,{children:l.jsx(Qw,{className:Y("transition-all",o?"rotate-90":"rotate-180")})}),l.jsx(rt,{icon:n,children:r})]}),s]}),!o&&l.jsx("div",{className:"pt-2",children:l.jsx("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:e})})]})};function $rr(e,t=5){if(!e?.properties)return[];const n=[];function r(a,s,i){if(i>t)return;const o=Array.isArray(a.type)?a.type.join(" | "):a.type;if(n.push({path:s,label:s,description:a.description??a.title,type:o}),a.properties)for(const[c,u]of Object.entries(a.properties))r(u,`${s}.${c}`,i+1);if(a.items?.properties)for(const[c,u]of Object.entries(a.items.properties))r(u,`${s}[].${c}`,i+1)}for(const[a,s]of Object.entries(e.properties))r(s,a,1);return n}function Lrr(e){const t=$rr(e);return irt({override:[Frr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function Frr(e){return t=>{const r=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!r)return null;const a=r[1]??"",s=t.pos-a.length,i=a?e.filter(c=>c.path.toLowerCase().startsWith(a.toLowerCase())):e;if(i.length===0)return null;const o=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,p)=>{const g=u.state.sliceDoc(p,p+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:p,insert:g},selection:{anchor:f+g.length}})}}));return{from:s,options:o,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const zrr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,Brr=tn.mark({class:"cm-variable-highlight"}),Q5e=new Snt({regexp:zrr,decoration:()=>Brr}),Urr=hi.fromClass(class{decorations;constructor(e){this.decorations=Q5e.createDeco(e)}update(e){this.decorations=Q5e.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),Vrr=Urr,qrr={duration:5e3,cancel:{label:l.jsx(ke,{children:l.jsx(mr,{})}),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 bd(e){const{classNames:t,...n}=qrr,{classNames:r,...a}=e||{};return{...n,classNames:{...t,title:Y(t?.title,r?.title),toast:Y(t?.toast,r?.toast),cancelButton:Y(t?.cancelButton,r?.cancelButton),actionButton:Y(t?.actionButton,r?.actionButton),description:Y(t?.description,r?.description)},...a}}const De=(e,t={})=>{if(Array.isArray(e))return e.forEach(n=>Xl(n,bd(t)));if(Ee.isValidElement(e))return Xl(e,bd(t));if(typeof e=="string")return Xl(e,bd(t));throw new Error("Invalid message type")};De.success=(e,t={})=>{const n={...t,icon:l.jsx(ke,{className:"text-accent1 shrink-0",children:l.jsx(hue,{})}),classNames:{...t.classNames,toast:Y("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Xl.success(e,bd(n));case"object":return e.forEach(r=>Xl.success(r,bd(n)))}};De.error=(e,t={})=>{const n={...t,icon:l.jsx(ke,{className:"text-accent2 shrink-0",children:l.jsx(Sb,{})}),classNames:{...t.classNames,toast:Y("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Xl.error(e,bd(n));case"object":return e.forEach(r=>Xl.error(r,bd(n)))}};De.warning=(e,t={})=>{const n={...t,icon:l.jsx(ke,{className:"text-accent6 shrink-0",children:l.jsx(Dp,{})}),classNames:{...t.classNames,toast:Y("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Xl.warning(e,bd(n));case"object":return e.forEach(r=>Xl.warning(r,bd(n)))}};De.info=(e,t={})=>{const n={...t,icon:l.jsx(ke,{className:"text-accent3 shrink-0",children:l.jsx(Hl,{})}),classNames:{...t.classNames,toast:Y("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Xl.info(e,bd(n));case"object":return e.forEach(r=>Xl.info(r,bd(n)))}};De.custom=(e,t={})=>Xl(e,bd(t));De.dismiss=e=>{e&&Xl.dismiss(e)};De.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:a,onError:s,options:i={}})=>Xl.promise(e,{loading:t??"Loading...",success:o=>(a?.(o),n),error:o=>(s?.(o),r||o?.message||"Error..."),...bd(i)});function Hf({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=x.useState(!1),a=x.useRef(null),s=x.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{De.success(t),r(!0),a.current&&(clearTimeout(a.current),a.current=null),a.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{De.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:s}}function go({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:a}){const[s,i]=x.useState(!1),{handleCopy:o}=Hf({text:e,copyMessage:t}),c=()=>{o(),i(!0),setTimeout(()=>i(!1),2e3)};return l.jsxs(nr,{children:[l.jsx(rr,{asChild:!0,children:l.jsx(ge,{onClick:c,type:"button",size:r,className:a,"aria-label":s?"Copied!":n,children:s?l.jsx(pa,{}):l.jsx(Jl,{})})}),l.jsx(Jn,{children:s?"Copied!":n})]})}const Av=()=>x.useMemo(()=>{const e=iF({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)"},styles:[{tag:[he.className,he.propertyName],color:"var(--neutral6)"},{tag:he.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[he.heading1,he.heading2,he.heading3,he.heading4,he.heading5,he.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:he.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:he.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:he.link,color:"var(--accent3)",textDecoration:"underline"},{tag:he.url,color:"var(--accent3)"},{tag:he.monospace,color:"var(--neutral6)"},{tag:he.strikethrough,textDecoration:"line-through"},{tag:he.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=vt.theme({".cm-editor":{backgroundColor:"transparent"},".cm-content":{color:"var(--neutral6)"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{color:"var(--neutral3)"},".cm-cursor":{borderLeftColor:"var(--neutral6)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--accent3) 22%, transparent)"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}});return[e,t]},[]),cs=x.forwardRef(({data:e,value:t,onChange:n,showCopyButton:r=!0,className:a,language:s="json",highlightVariables:i=!1,placeholder:o,schema:c,autoFocus:u,lineNumbers:d=!0,...f},p)=>{const h=Av(),m=e?JSON.stringify(e,null,2):t??"",g=x.useMemo(()=>{const v=[];return s==="json"?v.push(md):s==="markdown"&&(v.push(Ade({base:iw,codeLanguages:jat})),v.push(vt.lineWrapping)),i&&s==="markdown"&&v.push(Vrr),c&&s==="markdown"&&v.push(Lrr(c)),v},[s,i,c]);return l.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",a),...f,children:[r&&l.jsx(go,{content:m,className:"absolute top-2 right-2 z-20"}),l.jsx(Ed,{ref:p,value:m,theme:h,extensions:g,onChange:n,"aria-label":"Code editor",placeholder:o,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function Hrr(e,t){const{codeToTokens:n,bundledLanguages:r}=await Ge(async()=>{const{codeToTokens:s,bundledLanguages:i}=await import("./index-CHHLlfkZ.js");return{codeToTokens:s,bundledLanguages:i}},__vite__mapDeps([26,2]),import.meta.url);if(!(t in r))return null;const{tokens:a}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return a}const Qrr=({selectionReason:e,open:t,onOpenChange:n,input:r})=>{let a=null;if(r)try{a=typeof r=="object"?l.jsx(cs,{data:r}):l.jsx(cs,{data:JSON.parse(r)})}catch{a=l.jsx("pre",{className:"whitespace-pre-wrap",children:r})}return l.jsx(jr,{open:t,onOpenChange:n,children:l.jsxs(_r,{children:[l.jsxs(Tr,{children:[l.jsx(Er,{children:"Agent Network Metadata"}),l.jsx(Ya,{children:"View the metadata of the agent's network choice."})]}),l.jsxs(zr,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(me,{className:"text-neutral3",children:"Selection Reason"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:e})]}),a&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(me,{className:"text-neutral3",children:"Input"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:a})]})]})]})})},lge=({selectionReason:e,input:t})=>{const[n,r]=x.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(fs,{variant:"light",size:"md",tooltip:"Show selection reason",onClick:()=>r(a=>!a),children:l.jsx(NZt,{className:"text-neutral3 size-5"})}),l.jsx(Qrr,{selectionReason:e||"",open:n,onOpenChange:r,input:t})]})},ybt=x.createContext(void 0);function Wrr({children:e,approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:a,approveNetworkToolcall:s,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:c,networkToolCallApprovals:u}){return l.jsx(ybt.Provider,{value:{approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:a,approveNetworkToolcall:s,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:c,networkToolCallApprovals:u},children:e})}function Grr(){const e=x.useContext(ybt);if(!e)throw new Error("useToolCall must be used within a ToolCallProvider");return e}const NR=({toolCalled:e,toolCallId:t,toolApprovalMetadata:n,toolName:r,isNetwork:a,isGenerateMode:s})=>{const{approveToolcall:i,declineToolcall:o,approveToolcallGenerate:c,declineToolcallGenerate:u,isRunning:d,toolCallApprovals:f,approveNetworkToolcall:p,declineNetworkToolcall:h,networkToolCallApprovals:m}=Grr(),g=()=>{a?p(r,n?.runId):s?c(t):i(t)},v=()=>{a?h(r,n?.runId):s?u(t):o(t)},b=a?m?.[n?.runId?`${n.runId}-${r}`:r]?.status:f?.[t]?.status;return n&&!e?l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Approval required"}),l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsxs(ge,{onClick:g,disabled:d||!!b,className:b==="approved"?"!text-accent1":"",children:[l.jsx(ke,{children:l.jsx(pa,{})}),"Approve"]}),l.jsxs(ge,{onClick:v,disabled:d||!!b,className:b==="declined"?"!text-accent2":"",children:[l.jsx(ke,{children:l.jsx(mr,{})}),"Decline"]})]})]}):null},Zrr=({agentId:e,messages:t=[],metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u=!1})=>{const d=n?.mode==="network"?n.selectionReason:void 0,f=n?.mode==="network"?n.agentInput:void 0;let p=t.length>0;i&&(p=c??t.every(m=>m.type==="text"?!0:!!m.toolOutput));let h=typeof o=="string"?l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:o}):l.jsx(cs,{data:o,"data-testid":"tool-suspend-payload"});return l.jsxs(Zz,{"data-testid":"agent-badge",icon:l.jsx(hs,{className:"text-accent1"}),title:e,initialCollapsed:u,extraInfo:n?.mode==="network"&&l.jsx(lge,{selectionReason:d??"",input:f}),children:[t.map((m,g)=>{if(m.type==="text")return l.jsx(Wet,{children:m.content},g);let v;try{v=typeof m.toolOutput=="string"?JSON.parse(m.toolOutput):m.toolOutput}catch{v=m.toolOutput}return l.jsx(Ee.Fragment,{children:l.jsx(Xbt,{toolName:m.toolName,argsText:typeof m.args=="string"?m.args:JSON.stringify(m.args),result:v,args:m.args,status:{type:"complete"},type:"tool-call",toolCallId:m.toolCallId,addResult:()=>{},resume:()=>{},metadata:{mode:"stream"}})},g)}),h!==void 0&&o&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Agent suspend payload"}),h]}),l.jsx(NR,{toolCalled:p,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,isGenerateMode:n?.mode==="generate"})]})};function Fn({className:e,...t}){return l.jsx("div",{className:Y("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 cge=()=>l.jsx(Zz,{icon:l.jsx(Ht,{color:B6.neutral3}),title:l.jsx(Fn,{className:"ml-2 w-12 h-2"}),collapsible:!1}),Yrr=({agentId:e,result:t,metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u})=>{const{data:d,isLoading:f}=Vyt({threadId:t?.subAgentThreadId,agentId:e,memory:!0});if(f)return l.jsx(cge,{});const p=d?.messages?tQe(d.messages):[],h=t?.childMessages??PFt(p);return l.jsx(Zrr,{agentId:e,messages:h,metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u})},Yz=({copiedDuration:e=1500}={})=>{const[t,n]=x.useState(!1);return{isCopied:t,copyToClipboard:a=>{a&&navigator.clipboard.writeText(a).then(()=>{n(!0),setTimeout(()=>n(!1),e)})}}},bbt=x.createContext({Link:x.forwardRef(()=>null),navigate:()=>{},paths:{agentLink:()=>"",agentsLink:()=>"",agentToolLink:()=>"",agentSkillLink:()=>"",agentThreadLink:()=>"",agentNewThreadLink:()=>"",workflowsLink:()=>"",workflowLink:()=>"",networkLink:()=>"",networkNewThreadLink:()=>"",networkThreadLink:()=>"",scorerLink:()=>"",cmsScorersCreateLink:()=>"",cmsScorerEditLink:()=>"",cmsAgentCreateLink:()=>"",cmsAgentEditLink:()=>"",promptBlockLink:()=>"",promptBlocksLink:()=>"",cmsPromptBlockCreateLink:()=>"",cmsPromptBlockEditLink:()=>"",toolLink:()=>"",skillLink:()=>"",workspacesLink:()=>"",workspaceLink:()=>"",workspaceSkillLink:()=>"",processorsLink:()=>"",processorLink:()=>"",mcpServerLink:()=>"",mcpServerToolLink:()=>"",workflowRunLink:()=>"",datasetLink:()=>"",datasetItemLink:()=>"",datasetExperimentLink:()=>""}}),xbt=({children:e,Link:t,navigate:n,paths:r})=>l.jsx(bbt.Provider,{value:{Link:t,navigate:n,paths:r},children:e}),Pt=()=>{const e=x.useContext(bbt);if(!e)throw new Error("useLinkComponent must be used within a LinkComponentProvider");return e},Xrr=({toolName:e,args:t,result:n,toolCallId:r,toolApprovalMetadata:a,isNetwork:s,toolCalled:i})=>{const[o,c]=x.useState(!a),{isCopied:u,copyToClipboard:d}=Yz();x.useEffect(()=>{c(!a)},[a]);const{Link:f}=Pt();let p={path:"."};try{p=typeof t=="object"?t:JSON.parse(t)}catch{}const{path:h=".",maxDepth:m,showHidden:g,dirsOnly:v,exclude:b,extension:S}=p,O=[];m!==void 0&&m!==3&&O.push(`depth: ${m}`),g&&O.push("hidden"),v&&O.push("dirs only"),b&&O.push(`exclude: ${b}`),S&&O.push(`ext: ${S}`);let k="",E="";if(typeof n=="string"&&n){const M=n.lastIndexOf(`
457
+ `,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!s&&!!r.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=b,u.ParserHandle=g,u.NetworkStreamer=f,u.FileStreamer=p,u.StringStreamer=h,u.ReadableStreamStreamer=m,r.jQuery&&((a=r.jQuery).fn.parse=function(j){var A=j.config||{},I=[];return this.each(function(F){if(!(a(this).prop("tagName").toUpperCase()==="INPUT"&&a(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var D=0;D<this.files.length;D++)I.push({file:this.files[D],inputElem:this,instanceConfig:a.extend({},A)})}),P(),this;function P(){if(I.length===0)T(j.complete)&&j.complete();else{var F,D,V,H,B=I[0];if(T(j.before)){var q=j.before(B.file,B.inputElem);if(typeof q=="object"){if(q.action==="abort")return F="AbortError",D=B.file,V=B.inputElem,H=q.reason,void(T(j.error)&&j.error({name:F},D,V,H));if(q.action==="skip")return void M();typeof q.config=="object"&&(B.instanceConfig=a.extend(B.instanceConfig,q.config))}else if(q==="skip")return void M()}var W=B.instanceConfig.complete;B.instanceConfig.complete=function(L){T(W)&&W(L,B.file,B.inputElem),M()},u.parse(B.file,B.instanceConfig)}}function M(){I.splice(0,1),P()}}),i&&(r.onmessage=function(j){j=j.data,u.WORKER_ID===void 0&&j&&(u.WORKER_ID=j.workerId),typeof j.input=="string"?r.postMessage({workerId:u.WORKER_ID,results:u.parse(j.input,j.config),finished:!0}):(r.File&&j.input instanceof File||j.input instanceof Object)&&(j=u.parse(j.input,j.config))&&r.postMessage({workerId:u.WORKER_ID,results:j,finished:!0})}),(f.prototype=Object.create(d.prototype)).constructor=f,(p.prototype=Object.create(d.prototype)).constructor=p,(h.prototype=Object.create(h.prototype)).constructor=h,(m.prototype=Object.create(d.prototype)).constructor=m,u})})(a$)),a$.exports}var etr=Jer();const yyt=xo(etr);var m5e=1,ttr=.9,ntr=.8,rtr=.17,xJ=.1,wJ=.999,atr=.9999,str=.99,itr=/[\\\/_+.#"@\[\(\{&]/,otr=/[\\\/_+.#"@\[\(\{&]/g,ltr=/[\s-]/,byt=/[\s-]/g;function ise(e,t,n,r,a,s,i){if(s===t.length)return a===e.length?m5e:str;var o=`${a},${s}`;if(i[o]!==void 0)return i[o];for(var c=r.charAt(s),u=n.indexOf(c,a),d=0,f,p,h,m;u>=0;)f=ise(e,t,n,r,u+1,s+1,i),f>d&&(u===a?f*=m5e:itr.test(e.charAt(u-1))?(f*=ntr,h=e.slice(a,u-1).match(otr),h&&a>0&&(f*=Math.pow(wJ,h.length))):ltr.test(e.charAt(u-1))?(f*=ttr,m=e.slice(a,u-1).match(byt),m&&a>0&&(f*=Math.pow(wJ,m.length))):(f*=rtr,a>0&&(f*=Math.pow(wJ,u-a))),e.charAt(u)!==t.charAt(s)&&(f*=atr)),(f<xJ&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(p=ise(e,t,n,r,u+1,s+2,i),p*xJ>f&&(f=p*xJ)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[o]=d,d}function g5e(e){return e.toLowerCase().replace(byt," ")}function ctr(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,ise(e,t,g5e(e),g5e(t),0,0,{})}var MC='[cmdk-group=""]',SJ='[cmdk-group-items=""]',utr='[cmdk-group-heading=""]',xyt='[cmdk-item=""]',v5e=`${xyt}:not([aria-disabled="true"])`,ose="cmdk-item-select",A1="data-value",dtr=(e,t,n)=>ctr(e,t,n),wyt=x.createContext(void 0),CR=()=>x.useContext(wyt),Syt=x.createContext(void 0),Wme=()=>x.useContext(Syt),Oyt=x.createContext(void 0),kyt=x.forwardRef((e,t)=>{let n=I1(()=>{var z,R;return{search:"",value:(R=(z=e.value)!=null?z:e.defaultValue)!=null?R:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=I1(()=>new Set),a=I1(()=>new Map),s=I1(()=>new Map),i=I1(()=>new Set),o=_yt(e),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:h,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...b}=e,S=Zi(),O=Zi(),k=Zi(),E=x.useRef(null),C=Str();Ew(()=>{if(d!==void 0){let z=d.trim();n.current.value=z,T.emit()}},[d]),Ew(()=>{C(6,F)},[]);let T=x.useMemo(()=>({subscribe:z=>(i.current.add(z),()=>i.current.delete(z)),snapshot:()=>n.current,setState:(z,R,Q)=>{var G,ee,re,ne;if(!Object.is(n.current[z],R)){if(n.current[z]=R,z==="search")M(),I(),C(1,P);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(k);se?se.focus():(G=document.getElementById(S))==null||G.focus()}if(C(7,()=>{var se;n.current.selectedItemId=(se=D())==null?void 0:se.id,T.emit()}),Q||C(5,F),((ee=o.current)==null?void 0:ee.value)!==void 0){let se=R??"";(ne=(re=o.current).onValueChange)==null||ne.call(re,se);return}}T.emit()}},emit:()=>{i.current.forEach(z=>z())}}),[]),j=x.useMemo(()=>({value:(z,R,Q)=>{var G;R!==((G=s.current.get(z))==null?void 0:G.value)&&(s.current.set(z,{value:R,keywords:Q}),n.current.filtered.items.set(z,A(R,Q)),C(2,()=>{I(),T.emit()}))},item:(z,R)=>(r.current.add(z),R&&(a.current.has(R)?a.current.get(R).add(z):a.current.set(R,new Set([z]))),C(3,()=>{M(),I(),n.current.value||P(),T.emit()}),()=>{s.current.delete(z),r.current.delete(z),n.current.filtered.items.delete(z);let Q=D();C(4,()=>{M(),Q?.getAttribute("id")===z&&P(),T.emit()})}),group:z=>(a.current.has(z)||a.current.set(z,new Set),()=>{s.current.delete(z),a.current.delete(z)}),filter:()=>o.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:S,inputId:k,labelId:O,listInnerRef:E}),[]);function A(z,R){var Q,G;let ee=(G=(Q=o.current)==null?void 0:Q.filter)!=null?G:dtr;return z?ee(z,n.current.search,R):0}function I(){if(!n.current.search||o.current.shouldFilter===!1)return;let z=n.current.filtered.items,R=[];n.current.filtered.groups.forEach(G=>{let ee=a.current.get(G),re=0;ee.forEach(ne=>{let se=z.get(ne);re=Math.max(se,re)}),R.push([G,re])});let Q=E.current;V().sort((G,ee)=>{var re,ne;let se=G.getAttribute("id"),oe=ee.getAttribute("id");return((re=z.get(oe))!=null?re:0)-((ne=z.get(se))!=null?ne:0)}).forEach(G=>{let ee=G.closest(SJ);ee?ee.appendChild(G.parentElement===ee?G:G.closest(`${SJ} > *`)):Q.appendChild(G.parentElement===Q?G:G.closest(`${SJ} > *`))}),R.sort((G,ee)=>ee[1]-G[1]).forEach(G=>{var ee;let re=(ee=E.current)==null?void 0:ee.querySelector(`${MC}[${A1}="${encodeURIComponent(G[0])}"]`);re?.parentElement.appendChild(re)})}function P(){let z=V().find(Q=>Q.getAttribute("aria-disabled")!=="true"),R=z?.getAttribute(A1);T.setState("value",R||void 0)}function M(){var z,R,Q,G;if(!n.current.search||o.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ee=0;for(let re of r.current){let ne=(R=(z=s.current.get(re))==null?void 0:z.value)!=null?R:"",se=(G=(Q=s.current.get(re))==null?void 0:Q.keywords)!=null?G:[],oe=A(ne,se);n.current.filtered.items.set(re,oe),oe>0&&ee++}for(let[re,ne]of a.current)for(let se of ne)if(n.current.filtered.items.get(se)>0){n.current.filtered.groups.add(re);break}n.current.filtered.count=ee}function F(){var z,R,Q;let G=D();G&&(((z=G.parentElement)==null?void 0:z.firstChild)===G&&((Q=(R=G.closest(MC))==null?void 0:R.querySelector(utr))==null||Q.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function D(){var z;return(z=E.current)==null?void 0:z.querySelector(`${xyt}[aria-selected="true"]`)}function V(){var z;return Array.from(((z=E.current)==null?void 0:z.querySelectorAll(v5e))||[])}function H(z){let R=V()[z];R&&T.setState("value",R.getAttribute(A1))}function B(z){var R;let Q=D(),G=V(),ee=G.findIndex(ne=>ne===Q),re=G[ee+z];(R=o.current)!=null&&R.loop&&(re=ee+z<0?G[G.length-1]:ee+z===G.length?G[0]:G[ee+z]),re&&T.setState("value",re.getAttribute(A1))}function q(z){let R=D(),Q=R?.closest(MC),G;for(;Q&&!G;)Q=z>0?xtr(Q,MC):wtr(Q,MC),G=Q?.querySelector(v5e);G?T.setState("value",G.getAttribute(A1)):B(z)}let W=()=>H(V().length-1),L=z=>{z.preventDefault(),z.metaKey?W():z.altKey?q(1):B(1)},Z=z=>{z.preventDefault(),z.metaKey?H(0):z.altKey?q(-1):B(-1)};return x.createElement(wo.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:z=>{var R;(R=b.onKeyDown)==null||R.call(b,z);let Q=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||Q))switch(z.key){case"n":case"j":{v&&z.ctrlKey&&L(z);break}case"ArrowDown":{L(z);break}case"p":case"k":{v&&z.ctrlKey&&Z(z);break}case"ArrowUp":{Z(z);break}case"Home":{z.preventDefault(),H(0);break}case"End":{z.preventDefault(),W();break}case"Enter":{z.preventDefault();let G=D();if(G){let ee=new Event(ose);G.dispatchEvent(ee)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:ktr},c),Wz(e,z=>x.createElement(Syt.Provider,{value:T},x.createElement(wyt.Provider,{value:j},z))))}),ftr=x.forwardRef((e,t)=>{var n,r;let a=Zi(),s=x.useRef(null),i=x.useContext(Oyt),o=CR(),c=_yt(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i?.forceMount;Ew(()=>{if(!u)return o.item(a,i?.id)},[u]);let d=Eyt(a,s,[e.value,e.children,s],e.keywords),f=Wme(),p=Rb(C=>C.value&&C.value===d.current),h=Rb(C=>u||o.filter()===!1?!0:C.search?C.filtered.items.get(a)>0:!0);x.useEffect(()=>{let C=s.current;if(!(!C||e.disabled))return C.addEventListener(ose,m),()=>C.removeEventListener(ose,m)},[h,e.onSelect,e.disabled]);function m(){var C,T;g(),(T=(C=c.current).onSelect)==null||T.call(C,d.current)}function g(){f.setState("value",d.current,!0)}if(!h)return null;let{disabled:v,value:b,onSelect:S,forceMount:O,keywords:k,...E}=e;return x.createElement(wo.div,{ref:hm(s,t),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||o.getDisablePointerSelection()?void 0:g,onClick:v?void 0:m},e.children)}),ptr=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...s}=e,i=Zi(),o=x.useRef(null),c=x.useRef(null),u=Zi(),d=CR(),f=Rb(h=>a||d.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);Ew(()=>d.group(i),[]),Eyt(i,o,[e.value,e.heading,c]);let p=x.useMemo(()=>({id:i,forceMount:a}),[a]);return x.createElement(wo.div,{ref:hm(o,t),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&x.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Wz(e,h=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},x.createElement(Oyt.Provider,{value:p},h))))}),htr=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=x.useRef(null),s=Rb(i=>!i.search);return!n&&!s?null:x.createElement(wo.div,{ref:hm(a,t),...r,"cmdk-separator":"",role:"separator"})}),mtr=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,s=Wme(),i=Rb(u=>u.search),o=Rb(u=>u.selectedItemId),c=CR();return x.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),x.createElement(wo.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":o,id:c.inputId,type:"text",value:a?e.value:i,onChange:u=>{a||s.setState("search",u.target.value),n?.(u.target.value)}})}),gtr=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,s=x.useRef(null),i=x.useRef(null),o=Rb(u=>u.selectedItemId),c=CR();return x.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,p=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let h=u.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(f),p.unobserve(u)}}},[]),x.createElement(wo.div,{ref:hm(s,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:c.listId},Wz(e,u=>x.createElement("div",{ref:hm(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),vtr=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:s,container:i,...o}=e;return x.createElement(p6,{open:n,onOpenChange:r},x.createElement(h6,{container:i},x.createElement(vI,{"cmdk-overlay":"",className:a}),x.createElement(yI,{"aria-label":e.label,"cmdk-dialog":"",className:s},x.createElement(kyt,{ref:t,...o}))))}),ytr=x.forwardRef((e,t)=>Rb(n=>n.filtered.count===0)?x.createElement(wo.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),btr=x.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...s}=e;return x.createElement(wo.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Wz(e,i=>x.createElement("div",{"aria-hidden":!0},i)))}),Pu=Object.assign(kyt,{List:gtr,Item:ftr,Input:mtr,Group:ptr,Separator:htr,Dialog:vtr,Empty:ytr,Loading:btr});function xtr(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function wtr(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function _yt(e){let t=x.useRef(e);return Ew(()=>{t.current=e}),t}var Ew=typeof window>"u"?x.useEffect:x.useLayoutEffect;function I1(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Rb(e){let t=Wme(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Eyt(e,t,n,r=[]){let a=x.useRef(),s=CR();return Ew(()=>{var i;let o=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():a.current}})(),c=r.map(u=>u.trim());s.value(e,o,c),(i=t.current)==null||i.setAttribute(A1,o),a.current=o}),a}var Str=()=>{let[e,t]=x.useState(),n=I1(()=>new Map);return Ew(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Otr(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Wz({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(Otr(t),{ref:t.ref},n(t.props.children)):n(t)}var ktr={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};class co{constructor(t,n,r,a){this.fromA=t,this.toA=n,this.fromB=r,this.toB=a}offset(t,n=t){return new co(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}}function Cw(e,t,n,r,a,s){if(e==r)return[];let i=Zme(e,t,n,r,a,s),o=Yme(e,t+i,n,r,a+i,s);t+=i,n-=o,a+=i,s-=o;let c=n-t,u=s-a;if(!c||!u)return[new co(t,n,a,s)];if(c>u){let f=e.slice(t,n).indexOf(r.slice(a,s));if(f>-1)return[new co(t,t+f,a,a),new co(t+f+u,n,s,s)]}else if(u>c){let f=r.slice(a,s).indexOf(e.slice(t,n));if(f>-1)return[new co(t,t,a,a+f),new co(n,n,a+f+c,s)]}if(c==1||u==1)return[new co(t,n,a,s)];let d=Tyt(e,t,n,r,a,s);if(d){let[f,p,h]=d;return Cw(e,t,f,r,a,p).concat(Cw(e,f+h,n,r,p+h,s))}return _tr(e,t,n,r,a,s)}let vj=1e9,yj=0,Gme=!1;function _tr(e,t,n,r,a,s){let i=n-t,o=s-a;if(vj<1e9&&Math.min(i,o)>vj*16||yj>0&&Date.now()>yj)return Math.min(i,o)>vj*64?[new co(t,n,a,s)]:y5e(e,t,n,r,a,s);let c=Math.ceil((i+o)/2);OJ.reset(c),kJ.reset(c);let u=(h,m)=>e.charCodeAt(t+h)==r.charCodeAt(a+m),d=(h,m)=>e.charCodeAt(n-h-1)==r.charCodeAt(s-m-1),f=(i-o)%2!=0?kJ:null,p=f?null:OJ;for(let h=0;h<c;h++){if(h>vj||yj>0&&!(h&63)&&Date.now()>yj)return y5e(e,t,n,r,a,s);let m=OJ.advance(h,i,o,c,f,!1,u)||kJ.advance(h,i,o,c,p,!0,d);if(m)return Etr(e,t,n,t+m[0],r,a,s,a+m[1])}return[new co(t,n,a,s)]}class Cyt{constructor(){this.vec=[]}reset(t){this.len=t<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[t+1]=0,this.start=this.end=0}advance(t,n,r,a,s,i,o){for(let c=-t+this.start;c<=t-this.end;c+=2){let u=a+c,d=c==-t||c!=t&&this.vec[u-1]<this.vec[u+1]?this.vec[u+1]:this.vec[u-1]+1,f=d-c;for(;d<n&&f<r&&o(d,f);)d++,f++;if(this.vec[u]=d,d>n)this.end+=2;else if(f>r)this.start+=2;else if(s){let p=a+(n-r)-c;if(p>=0&&p<this.len&&s.vec[p]!=-1)if(i){let h=s.vec[p];if(h>=n-d)return[h,a+h-p]}else{let h=n-s.vec[p];if(d>=h)return[d,f]}}}return null}}const OJ=new Cyt,kJ=new Cyt;function Etr(e,t,n,r,a,s,i,o){let c=!1;return!Bk(e,r)&&++r==n&&(c=!0),!Bk(a,o)&&++o==i&&(c=!0),c?[new co(t,n,s,i)]:Cw(e,t,r,a,s,o).concat(Cw(e,r,n,a,o,i))}function jyt(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n=n<<1;return n}function Zme(e,t,n,r,a,s){if(t==n||t==s||e.charCodeAt(t)!=r.charCodeAt(a))return 0;let i=jyt(n-t,s-a);for(let o=t,c=a;;){let u=o+i,d=c+i;if(u>n||d>s||e.slice(o,u)!=r.slice(c,d)){if(i==1)return o-t-(Bk(e,o)?0:1);i=i>>1}else{if(u==n||d==s)return u-t;o=u,c=d}}}function Yme(e,t,n,r,a,s){if(t==n||a==s||e.charCodeAt(n-1)!=r.charCodeAt(s-1))return 0;let i=jyt(n-t,s-a);for(let o=n,c=s;;){let u=o-i,d=c-i;if(u<t||d<a||e.slice(u,o)!=r.slice(d,c)){if(i==1)return n-o-(Bk(e,o)?0:1);i=i>>1}else{if(u==t||d==a)return n-u;o=u,c=d}}}function lse(e,t,n,r,a,s,i,o){let c=r.slice(a,s),u=null;for(;;){if(u||i<o)return u;for(let d=t+i;;){Bk(e,d)||d++;let f=d+i;if(Bk(e,f)||(f+=f==d+1?1:-1),f>=n)break;let p=e.slice(d,f),h=-1;for(;(h=c.indexOf(p,h+1))!=-1;){let m=Zme(e,f,n,r,a+h+p.length,s),g=Yme(e,t,d,r,a,a+h),v=p.length+m+g;(!u||u[2]<v)&&(u=[d-g,a+h-g,v])}d=f}if(o<0)return u;i=i>>1}}function Tyt(e,t,n,r,a,s){let i=n-t,o=s-a;if(i<o){let c=Tyt(r,a,s,e,t,n);return c&&[c[1],c[0],c[2]]}return i<4||o*2<i?null:lse(e,t,n,r,a,s,Math.floor(i/4),-1)}function y5e(e,t,n,r,a,s){Gme=!0;let i=n-t,o=s-a,c;if(i<o){let p=lse(r,a,s,e,t,n,Math.floor(i/6),50);c=p&&[p[1],p[0],p[2]]}else c=lse(e,t,n,r,a,s,Math.floor(o/6),50);if(!c)return[new co(t,n,a,s)];let[u,d,f]=c;return Cw(e,t,u,r,a,d).concat(Cw(e,u+f,n,r,d+f,s))}function Nyt(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],a=e[n];r.toA>a.fromA-t&&r.toB>a.fromB-t&&(e[n-1]=new co(r.fromA,a.toA,r.fromB,a.toB),e.splice(n--,1))}}function Ctr(e,t,n){for(;;){Nyt(n,1);let r=!1;for(let a=0;a<n.length;a++){let s=n[a],i,o;(i=Zme(e,s.fromA,s.toA,t,s.fromB,s.toB))&&(s=n[a]=new co(s.fromA+i,s.toA,s.fromB+i,s.toB)),(o=Yme(e,s.fromA,s.toA,t,s.fromB,s.toB))&&(s=n[a]=new co(s.fromA,s.toA-o,s.fromB,s.toB-o));let c=s.toA-s.fromA,u=s.toB-s.fromB;if(c&&u)continue;let d=s.fromA-(a?n[a-1].toA:0),f=(a<n.length-1?n[a+1].fromA:e.length)-s.toA;if(!d||!f)continue;let p=c?e.slice(s.fromA,s.toA):t.slice(s.fromB,s.toB);d<=p.length&&e.slice(s.fromA-d,s.fromA)==p.slice(p.length-d)?(n[a]=new co(s.fromA-d,s.toA-d,s.fromB-d,s.toB-d),r=!0):f<=p.length&&e.slice(s.toA,s.toA+f)==p.slice(0,f)&&(n[a]=new co(s.fromA+f,s.toA+f,s.fromB+f,s.toB+f),r=!0)}if(!r)break}return n}function jtr(e,t,n){for(let r=0,a=0;a<e.length;a++){let s=e[a],i=s.toA-s.fromA,o=s.toB-s.fromB;if(i&&o||i>3||o>3){let c=a==e.length-1?t.length:e[a+1].fromA,u=s.fromA-r,d=c-s.toA,f=x5e(t,s.fromA,u),p=b5e(t,s.toA,d),h=s.fromA-f,m=p-s.toA;if((!i||!o)&&h&&m){let g=Math.max(i,o),[v,b,S]=i?[t,s.fromA,s.toA]:[n,s.fromB,s.toB];g>h&&t.slice(f,s.fromA)==v.slice(S-h,S)?(s=e[a]=new co(f,f+i,s.fromB-h,s.toB-h),f=s.fromA,p=b5e(t,s.toA,c-s.toA)):g>m&&t.slice(s.toA,p)==v.slice(b,b+m)&&(s=e[a]=new co(p-i,p,s.fromB+m,s.toB+m),p=s.toA,f=x5e(t,s.fromA,s.fromA-r)),h=s.fromA-f,m=p-s.toA}if(h||m)s=e[a]=new co(s.fromA-h,s.toA+m,s.fromB-h,s.toB+m);else if(i){if(!o){let g=S5e(t,s.fromA,s.toA),v,b=g<0?-1:w5e(t,s.toA,s.fromA);g>-1&&(v=g-s.fromA)<=d&&t.slice(s.fromA,g)==t.slice(s.toA,s.toA+v)?s=e[a]=s.offset(v):b>-1&&(v=s.toA-b)<=u&&t.slice(s.fromA-v,s.fromA)==t.slice(b,s.toA)&&(s=e[a]=s.offset(-v))}}else{let g=S5e(n,s.fromB,s.toB),v,b=g<0?-1:w5e(n,s.toB,s.fromB);g>-1&&(v=g-s.fromB)<=d&&n.slice(s.fromB,g)==n.slice(s.toB,s.toB+v)?s=e[a]=s.offset(v):b>-1&&(v=s.toB-b)<=u&&n.slice(s.fromB-v,s.fromB)==n.slice(b,s.toB)&&(s=e[a]=s.offset(-v))}}r=s.toA}return Nyt(e,3),e}let N0;try{N0=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Ayt(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Iyt(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?Ayt(n)?1:0:N0?!Myt(n)||t==e.length-1?N0.test(String.fromCharCode(n))?1:0:N0.test(e.slice(t,t+2))?2:0:0}function Ryt(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?Ayt(n)?1:0:N0?!Dyt(n)||t==1?N0.test(String.fromCharCode(n))?1:0:N0.test(e.slice(t-2,t))?2:0:0}const Pyt=8;function b5e(e,t,n){if(t==e.length||!Ryt(e,t))return t;for(let r=t,a=t+n,s=0;s<Pyt;s++){let i=Iyt(e,r);if(!i||r+i>a)return r;r+=i}return t}function x5e(e,t,n){if(!t||!Iyt(e,t))return t;for(let r=t,a=t-n,s=0;s<Pyt;s++){let i=Ryt(e,r);if(!i||r-i<a)return r;r-=i}return t}function w5e(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function S5e(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}const Myt=e=>e>=55296&&e<=56319,Dyt=e=>e>=56320&&e<=57343;function Bk(e,t){return!t||t==e.length||!Myt(e.charCodeAt(t-1))||!Dyt(e.charCodeAt(t))}function Ttr(e,t,n){var r;let a=n?.override;return a?a(e,t):(vj=((r=n?.scanLimit)!==null&&r!==void 0?r:1e9)>>1,yj=n?.timeout?Date.now()+n.timeout:0,Gme=!1,Ctr(e,t,Cw(e,0,e.length,t,0,t.length)))}function $yt(){return!Gme}function Lyt(e,t,n){return jtr(Ttr(e,t,n),e,t)}const Hh=Xt.define({combine:e=>e[0]}),cse=Kn.define(),Ntr=Xt.define(),Uk=Ji.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(cse)&&(e=n.value);for(let n of t.state.facet(Ntr))e=n(e,t);return e}});class NO{constructor(t,n,r,a,s,i=!0){this.changes=t,this.fromA=n,this.toA=r,this.fromB=a,this.toB=s,this.precise=i}offset(t,n){return t||n?new NO(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,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,n,r){let a=Lyt(t.toString(),n.toString(),r);return Fyt(a,t,n,0,0,$yt())}static updateA(t,n,r,a,s){return C5e(E5e(t,a,!0,r.length),t,n,r,s)}static updateB(t,n,r,a,s){return C5e(E5e(t,a,!1,n.length),t,n,r,s)}}function O5e(e,t,n,r){let a=n.lineAt(e),s=r.lineAt(t);return a.to==e&&s.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[a.from,s.from]}function k5e(e,t,n,r){let a=n.lineAt(e),s=r.lineAt(t);return a.from==e&&s.from==t?[e,t]:[a.to+1,s.to+1]}function Fyt(e,t,n,r,a,s){let i=[];for(let o=0;o<e.length;o++){let c=e[o],[u,d]=O5e(c.fromA+r,c.fromB+a,t,n),[f,p]=k5e(c.toA+r,c.toB+a,t,n),h=[c.offset(-u+r,-d+a)];for(;o<e.length-1;){let m=e[o+1],[g,v]=O5e(m.fromA+r,m.fromB+a,t,n);if(g>f+1&&v>p+1)break;h.push(m.offset(-u+r,-d+a)),[f,p]=k5e(m.toA+r,m.toB+a,t,n),o++}i.push(new NO(h,u,Math.max(u,f),d,Math.max(d,p),s))}return i}const B2=1e3;function _5e(e,t,n,r){let a=0,s=e.length;for(;;){if(a==s){let d=0,f=0;a&&({toA:d,toB:f}=e[a-1]);let p=t-(n?d:f);return[d+p,f+p]}let i=a+s>>1,o=e[i],[c,u]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(c>t)s=i;else if(u<=t)a=i+1;else return r?[o.fromA,o.fromB]:[o.toA,o.toB]}}function E5e(e,t,n,r){let a=[];return t.iterChangedRanges((s,i,o,c)=>{let u=0,d=n?t.length:r,f=0,p=n?r:t.length;s>B2&&([u,f]=_5e(e,s-B2,n,!0)),i<t.length-B2&&([d,p]=_5e(e,i+B2,n,!1));let h=c-o-(i-s),m,[g,v]=n?[h,0]:[0,h];a.length&&(m=a[a.length-1]).toA>=u?a[a.length-1]={fromA:m.fromA,fromB:m.fromB,toA:d,toB:p,diffA:m.diffA+g,diffB:m.diffB+v}:a.push({fromA:u,toA:d,fromB:f,toB:p,diffA:g,diffB:v})}),a}function C5e(e,t,n,r,a){if(!e.length)return t;let s=[];for(let i=0,o=0,c=0,u=0;;i++){let d=i==e.length?null:e[i],f=d?d.fromA+o:n.length,p=d?d.fromB+c:r.length;for(;u<t.length;){let v=t[u];if(d&&(v.toA+o>f||v.toB+c>p))break;s.push(v.offset(o,c)),u++}if(!d)break;let h=d.toA+o+d.diffA,m=d.toB+c+d.diffB,g=Lyt(n.sliceString(f,h),r.sliceString(p,m),a);for(let v of Fyt(g,n,r,f,p,$yt()))s.push(v);for(o+=d.diffA,c+=d.diffB;u<t.length;){let v=t[u];if(v.fromA+o>h&&v.fromB+c>m)break;u++}}return s}const Atr={scanLimit:500},zyt=hi.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=N5e(e))}update(e){(e.docChanged||e.viewportChanged||Itr(e.startState,e.state)||Rtr(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=N5e(e.view))}},{decorations:e=>e.deco}),U2=Jp.low(Ent({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(zyt))===null||t===void 0?void 0:t.gutter)||Fr.empty}}));function Itr(e,t){return e.field(Uk,!1)!=t.field(Uk,!1)}function Rtr(e,t){return e.facet(Hh)!=t.facet(Hh)}const j5e=tn.line({class:"cm-changedLine"}),Ptr=tn.mark({class:"cm-changedText"}),Mtr=tn.mark({tagName:"ins",class:"cm-insertedLine"}),Dtr=tn.mark({tagName:"del",class:"cm-deletedLine"}),T5e=new class extends vm{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function $tr(e,t,n,r,a,s){let i=n?e.fromA:e.fromB,o=n?e.toA:e.toB,c=0;if(i!=o){a.add(i,i,j5e),a.add(i,o,n?Dtr:Mtr),s&&s.add(i,i,T5e);for(let u=t.iterRange(i,o-1),d=i;!u.next().done;){if(u.lineBreak){d++,a.add(d,d,j5e),s&&s.add(d,d,T5e);continue}let f=d+u.value.length;if(r)for(;c<e.changes.length;){let p=e.changes[c],h=i+(n?p.fromA:p.fromB),m=i+(n?p.toA:p.toB),g=Math.max(d,h),v=Math.min(f,m);if(g<v&&a.add(g,v,Ptr),m<f)c++;else break}d=f}}}function N5e(e){let t=e.state.field(Uk),{side:n,highlightChanges:r,markGutter:a,overrideChunk:s}=e.state.facet(Hh),i=n=="a",o=new Eu,c=a?new Eu:null,{from:u,to:d}=e.viewport;for(let f of t){if((i?f.fromA:f.fromB)>=d)break;(i?f.toA:f.toB)>u&&(!s||!s(e.state,f,o,c))&&$tr(f,e.state.doc,i,r,o,c)}return{deco:o.finish(),gutter:c&&c.finish()}}class V2 extends $d{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=Kn.define({map:(e,t)=>e.map(t)}),bj=Ji.define({create:()=>tn.none,update:(e,t)=>{for(let n of t.effects)if(n.is(mL))return n.value;return e.map(t.changes)},provide:e=>vt.decorations.from(e)}),q2=.01;function A5e(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function Ltr(e,t,n){let r=new Eu,a=new Eu,s=e.state.field(bj).iter(),i=t.state.field(bj).iter(),o=0,c=0,u=0,d=0,f=e.viewport,p=t.viewport;for(let v=0;;v++){let b=v<n.length?n[v]:null,S=b?b.fromA:e.state.doc.length,O=b?b.fromB:t.state.doc.length;if(o<S){let k=e.lineBlockAt(o).top+u,E=t.lineBlockAt(c).top+d,C=k-E;C<-q2?(u-=C,r.add(o,o,tn.widget({widget:new V2(-C),block:!0,side:-1}))):C>q2&&(d+=C,a.add(c,c,tn.widget({widget:new V2(C),block:!0,side:-1})))}if(S>o+1e3&&o<f.from&&S>f.from&&c<p.from&&O>p.from){let k=Math.min(f.from-o,p.from-c);o+=k,c+=k,v--}else if(b)o=b.toA,c=b.toB;else break;for(;s.value&&s.from<o;)u-=s.value.spec.widget.height,s.next();for(;i.value&&i.from<c;)d-=i.value.spec.widget.height,i.next()}for(;s.value;)u-=s.value.spec.widget.height,s.next();for(;i.value;)d-=i.value.spec.widget.height,i.next();let h=e.contentHeight+u-(t.contentHeight+d);h<q2?r.add(e.state.doc.length,e.state.doc.length,tn.widget({widget:new V2(-h),block:!0,side:1})):h>q2&&a.add(t.state.doc.length,t.state.doc.length,tn.widget({widget:new V2(h),block:!0,side:1}));let m=r.finish(),g=a.finish();A5e(m,e.state.field(bj))||e.dispatch({effects:mL.of(m)}),A5e(g,t.state.field(bj))||t.dispatch({effects:mL.of(g)})}const use=Kn.define({map:(e,t)=>t.mapPos(e)});class Ftr extends $d{constructor(t){super(),this.lines=t}eq(t){return this.lines==t.lines}toDOM(t){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=t.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",r=>{let a=t.posAtDOM(r.target);t.dispatch({effects:use.of(a)});let{side:s,sibling:i}=t.state.facet(Hh);i&&i().dispatch({effects:use.of(ztr(a,t.state.field(Uk),s=="a"))})}),n}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function ztr(e,t,n){let r=0,a=0;for(let s=0;;s++){let i=s<t.length?t[s]:null;if(!i||(n?i.fromA:i.fromB)>=e)return a+(e-r);[r,a]=n?[i.toA,i.toB]:[i.toB,i.toA]}}const Btr=Ji.define({create(e){return tn.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(use)&&(e=e.update({filter:r=>r!=n.value}));return e},provide:e=>vt.decorations.from(e)});function I5e({margin:e=3,minSize:t=4}){return Btr.init(n=>Utr(n,e,t))}function Utr(e,t,n){let r=new Eu,a=e.facet(Hh).side=="a",s=e.field(Uk),i=1;for(let o=0;;o++){let c=o<s.length?s[o]:null,u=o?i+t:1,d=c?e.doc.lineAt(a?c.fromA:c.fromB).number-1-t:e.doc.lines,f=d-u+1;if(f>=n&&r.add(e.doc.line(u).from,e.doc.line(d).to,tn.replace({widget:new Ftr(f),block:!0})),!c)break;i=e.doc.lineAt(Math.min(e.doc.length,a?c.toA:c.toB)).number}return r.finish()}const Vtr=vt.styleModule.of(new nv({".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"}})),qtr=vt.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"}}),R5e=new S_,H2=new S_;class Htr{constructor(t){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=t.diffConfig||Atr;let n=[Jp.low(zyt),qtr,Vtr,bj,vt.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(p=>p.effects.some(h=>h.is(mL)))&&this.measure()})],r=[Hh.of({side:"a",sibling:()=>this.b,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&r.push(U2);let a=Pr.create({doc:t.a.doc,selection:t.a.selection,extensions:[t.a.extensions||[],vt.editorAttributes.of({class:"cm-merge-a"}),H2.of(r),n]}),s=[Hh.of({side:"b",sibling:()=>this.a,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&s.push(U2);let i=Pr.create({doc:t.b.doc,selection:t.b.selection,extensions:[t.b.extensions||[],vt.editorAttributes.of({class:"cm-merge-b"}),H2.of(s),n]});this.chunks=NO.build(a.doc,i.doc,this.diffConf);let o=[Uk.init(()=>this.chunks),R5e.of(t.collapseUnchanged?I5e(t.collapseUnchanged):[])];a=a.update({effects:Kn.appendConfig.of(o)}).state,i=i.update({effects:Kn.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 c=t.orientation||"a-b",u=document.createElement("div");u.className="cm-mergeViewEditor";let d=document.createElement("div");d.className="cm-mergeViewEditor",this.editorDOM.appendChild(c=="a-b"?u:d),this.editorDOM.appendChild(c=="a-b"?d:u),this.a=new vt({state:a,parent:u,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new vt({state:i,parent:d,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!t.revertControls,t.revertControls=="b-to-a",t.renderRevertControl),t.parent&&t.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(t,n){if(t.some(r=>r.docChanged)){let r=t[t.length-1],a=t.reduce((i,o)=>i.compose(o.changes),oo.empty(t[0].startState.doc.length));this.chunks=n==this.a?NO.updateA(this.chunks,r.newDoc,this.b.state.doc,a,this.diffConf):NO.updateB(this.chunks,this.a.state.doc,r.newDoc,a,this.diffConf),n.update([...t,r.state.update({effects:cse.of(this.chunks)})]);let s=n==this.a?this.b:this.a;s.update([s.state.update({effects:cse.of(this.chunks)})]),this.scheduleMeasure()}else n.update(t)}reconfigure(t){if("diffConfig"in t&&(this.diffConf=t.diffConfig),"orientation"in t){let s=t.orientation!="b-a";if(s!=(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(s?i:o,this.editorDOM.firstChild),this.editorDOM.appendChild(s?o:i),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in t||"renderRevertControl"in t){let s=!!this.revertDOM,i=this.revertToA,o=this.renderRevert;"revertControls"in t&&(s=!!t.revertControls,i=t.revertControls=="b-to-a"),"renderRevertControl"in t&&(o=t.renderRevertControl),this.setupRevertControls(s,i,o)}let n="highlightChanges"in t,r="gutter"in t,a="collapseUnchanged"in t;if(n||r||a){let s=[],i=[];if(n||r){let o=this.a.state.facet(Hh),c=r?t.gutter!==!1:o.markGutter,u=n?t.highlightChanges!==!1:o.highlightChanges;s.push(H2.reconfigure([Hh.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:c}),c?U2:[]])),i.push(H2.reconfigure([Hh.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:c}),c?U2:[]]))}if(a){let o=R5e.reconfigure(t.collapseUnchanged?I5e(t.collapseUnchanged):[]);s.push(o),i.push(o)}this.a.dispatch({effects:s}),this.b.dispatch({effects:i})}this.scheduleMeasure()}setupRevertControls(t,n,r){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=r,!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",a=>this.revertClicked(a)),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(){Ltr(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let t=this.revertDOM,n=t.firstChild,r=this.a.viewport,a=this.b.viewport;for(let s=0;s<this.chunks.length;s++){let i=this.chunks[s];if(i.fromA>r.to||i.fromB>a.to)break;if(i.fromA<r.from||i.fromB<a.from)continue;let o=this.a.lineBlockAt(i.fromA).top+"px";for(;n&&+n.dataset.chunk<s;)n=P5e(n);n&&n.dataset.chunk==String(s)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):t.insertBefore(this.renderRevertButton(o,s),n)}for(;n;)n=P5e(n)}renderRevertButton(t,n){let r;if(this.renderRevert)r=this.renderRevert();else{r=document.createElement("button");let a=this.a.state.phrase("Revert this chunk");r.setAttribute("aria-label",a),r.setAttribute("title",a),r.textContent=this.revertToLeft?"⇜":"⇝"}return r.style.top=t,r.setAttribute("data-chunk",String(n)),r}revertClicked(t){let n=t.target,r;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(r=this.chunks[n.dataset.chunk])){let[a,s,i,o,c,u]=this.revertToA?[this.b,this.a,r.fromB,r.toB,r.fromA,r.toA]:[this.a,this.b,r.fromA,r.toA,r.fromB,r.toB],d=a.state.sliceDoc(i,Math.max(i,o-1));i!=o&&u<=s.state.doc.length&&(d+=a.state.lineBreak),s.dispatch({changes:{from:c,to:Math.min(s.state.doc.length,u),insert:d},userEvent:"revert"}),t.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function P5e(e){let t=e.nextSibling;return e.remove(),t}const M5e={modelSettings:{maxRetries:2,maxSteps:5,chatWithGenerateLegacy:!1,chatWithGenerate:!1}};function Qtr({agentId:e,defaultSettings:t}){const[n,r]=x.useState(t),a=`mastra-agent-store-${e}`;return x.useEffect(()=>{try{const o=localStorage.getItem(a),c=o?JSON.parse(o):{},u={...c,modelSettings:{...M5e.modelSettings,...c?.modelSettings??{},...t?.modelSettings??{}}};r(u)}catch{}},[a,t]),{settings:n,setSettings:o=>{r(c=>({...c,...o})),localStorage.setItem(a,JSON.stringify({...o,agentId:e}))},resetAll:()=>{const o={modelSettings:{...M5e.modelSettings,...t?.modelSettings??{}}};r(o),localStorage.removeItem(a)}}}const Byt=x.createContext({});function Xme({children:e,agentId:t,defaultSettings:n}){const{settings:r,setSettings:a,resetAll:s}=Qtr({agentId:t,defaultSettings:n});return l.jsx(Byt.Provider,{value:{settings:r,setSettings:a,resetAll:s},children:e})}const Kme=()=>x.useContext(Byt),Vr=Ile()(w2t(e=>({requestContext:{},theme:"dark",setRequestContext:t=>e({requestContext:t}),setTheme:t=>e({theme:t})}),{name:"mastra-playground-store"})),Jme=x.createContext(null);function Gz({children:e}){const{requestContext:t}=Vr(),[n,r]=x.useState(t),a=i=>r(i),s=()=>{r({})};return l.jsx(Jme.Provider,{value:{schemaValues:n,setSchemaValues:a,clearSchemaValues:s},children:e})}function Uyt(){const e=x.useContext(Jme);if(!e)throw new Error("useSchemaRequestContext must be used within a SchemaRequestContextProvider");return e}function ko(){const{requestContext:e}=Vr(),n=x.useContext(Jme)?.schemaValues??{};return{...e??{},...n}}const Vyt=({threadId:e,agentId:t,memory:n})=>{const r=qe(),{requestContext:a}=Vr();return wt({queryKey:["memory","messages",e,t,"requestContext"],queryFn:async()=>e?await r.listThreadMessages(e,{agentId:t,requestContext:a}):null,enabled:n&&!!e,staleTime:0,gcTime:0,retry:!1,refetchOnWindowFocus:!1})},Wtr=({multiple:e=!0,onChange:t}={})=>{const n=O7t(s=>!s.isEditing),r=hI(),a=x.useCallback(()=>{const s=document.createElement("input");s.type="file",s.multiple=e,s.hidden=!0;const i=r.getState().attachmentAccept;i&&i!=="*"&&(s.accept=i),document.body.appendChild(s),s.onchange=o=>{const c=o.target.files;if(c){for(const u of c)r.addAttachment(u),t?.(Array.from(c));document.body.removeChild(s)}},s.oncancel=()=>{(!s.files||s.files.length===0)&&document.body.removeChild(s)},s.click()},[r,e]);if(!n)return a},Gl={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},jR="focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",Gtr="focus-within:outline-none focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",Ztr="rounded-md",ege="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",tge="outline-none focus-visible:outline-none focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",nge="disabled:opacity-50 disabled:cursor-not-allowed";function qyt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=qyt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Hyt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=qyt(e))&&(r&&(r+=" "),r+=t);return r}const Ytr=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Xtr=(e,t)=>({classGroupId:e,validator:t}),Qyt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),gL="-",D5e=[],Ktr="arbitrary..",Jtr=e=>{const t=tnr(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return enr(i);const o=i.split(gL),c=o[0]===""&&o.length>1?1:0;return Wyt(o,c,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const c=r[i],u=n[i];return c?u?Ytr(u,c):c:u||D5e}return n[i]||D5e}}},Wyt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const u=Wyt(e,t+1,s);if(u)return u}const i=n.validators;if(i===null)return;const o=t===0?e.join(gL):e.slice(t).join(gL),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(o))return d.classGroupId}},enr=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Ktr+r:void 0})(),tnr=e=>{const{theme:t,classGroups:n}=e;return nnr(n,t)},nnr=(e,t)=>{const n=Qyt();for(const r in e){const a=e[r];rge(a,n,r,t)}return n},rge=(e,t,n,r)=>{const a=e.length;for(let s=0;s<a;s++){const i=e[s];rnr(i,t,n,r)}},rnr=(e,t,n,r)=>{if(typeof e=="string"){anr(e,t,n);return}if(typeof e=="function"){snr(e,t,n,r);return}inr(e,t,n,r)},anr=(e,t,n)=>{const r=e===""?t:Gyt(t,e);r.classGroupId=n},snr=(e,t,n,r)=>{if(onr(e)){rge(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Xtr(n,e))},inr=(e,t,n,r)=>{const a=Object.entries(e),s=a.length;for(let i=0;i<s;i++){const[o,c]=a[i];rge(c,Gyt(t,o),n,r)}},Gyt=(e,t)=>{let n=e;const r=t.split(gL),a=r.length;for(let s=0;s<a;s++){const i=r[s];let o=n.nextPart.get(i);o||(o=Qyt(),n.nextPart.set(i,o)),n=o}return n},onr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,lnr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in n?n[s]=i:a(s,i)}}},dse="!",$5e=":",cnr=[],L5e=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),unr=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const s=[];let i=0,o=0,c=0,u;const d=a.length;for(let g=0;g<d;g++){const v=a[g];if(i===0&&o===0){if(v===$5e){s.push(a.slice(c,g)),c=g+1;continue}if(v==="/"){u=g;continue}}v==="["?i++:v==="]"?i--:v==="("?o++:v===")"&&o--}const f=s.length===0?a:a.slice(c);let p=f,h=!1;f.endsWith(dse)?(p=f.slice(0,-1),h=!0):f.startsWith(dse)&&(p=f.slice(1),h=!0);const m=u&&u>c?u-c:void 0;return L5e(s,h,p,m)};if(t){const a=t+$5e,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):L5e(cnr,!1,i,void 0,!0)}if(n){const a=r;r=s=>n({className:s,parseClassName:a})}return r},dnr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let s=0;s<n.length;s++){const i=n[s],o=i[0]==="[",c=t.has(i);o||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},fnr=e=>({cache:lnr(e.cacheSize),parseClassName:unr(e),sortModifiers:dnr(e),...Jtr(e)}),pnr=/\s+/,hnr=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=t,i=[],o=e.trim().split(pnr);let c="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let v=!!g,b=r(v?m.substring(0,g):m);if(!b){if(!v){c=d+(c.length>0?" "+c:c);continue}if(b=r(m),!b){c=d+(c.length>0?" "+c:c);continue}v=!1}const S=p.length===0?"":p.length===1?p[0]:s(p).join(":"),O=h?S+dse:S,k=O+b;if(i.indexOf(k)>-1)continue;i.push(k);const E=a(b,v);for(let C=0;C<E.length;++C){const T=E[C];i.push(O+T)}c=d+(c.length>0?" "+c:c)}return c},mnr=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=Zyt(n))&&(a&&(a+=" "),a+=r);return a},Zyt=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Zyt(e[r]))&&(n&&(n+=" "),n+=t);return n},F5e=(e,...t)=>{let n,r,a,s;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=fnr(u),r=n.cache.get,a=n.cache.set,s=o,o(c)},o=c=>{const u=r(c);if(u)return u;const d=hnr(c,n);return a(c,d),d};return s=i,(...c)=>s(mnr(...c))},gnr=[],To=e=>{const t=n=>n[e]||gnr;return t.isThemeGetter=!0,t},Yyt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Xyt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,vnr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ynr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bnr=/\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$/,xnr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wnr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Snr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yy=e=>vnr.test(e),Rr=e=>!!e&&!Number.isNaN(Number(e)),by=e=>!!e&&Number.isInteger(Number(e)),_J=e=>e.endsWith("%")&&Rr(e.slice(0,-1)),mg=e=>ynr.test(e),Kyt=()=>!0,Onr=e=>bnr.test(e)&&!xnr.test(e),age=()=>!1,knr=e=>wnr.test(e),_nr=e=>Snr.test(e),Enr=e=>!hn(e)&&!xn(e),Cnr=e=>tx(e,tbt,age),hn=e=>Yyt.test(e),Fx=e=>tx(e,nbt,Onr),z5e=e=>tx(e,Mnr,Rr),jnr=e=>tx(e,abt,Kyt),Tnr=e=>tx(e,rbt,age),B5e=e=>tx(e,Jyt,age),Nnr=e=>tx(e,ebt,_nr),Q2=e=>tx(e,sbt,knr),xn=e=>Xyt.test(e),DC=e=>uS(e,nbt),Anr=e=>uS(e,rbt),U5e=e=>uS(e,Jyt),Inr=e=>uS(e,tbt),Rnr=e=>uS(e,ebt),W2=e=>uS(e,sbt,!0),Pnr=e=>uS(e,abt,!0),tx=(e,t,n)=>{const r=Yyt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},uS=(e,t,n=!1)=>{const r=Xyt.exec(e);return r?r[1]?t(r[1]):n:!1},Jyt=e=>e==="position"||e==="percentage",ebt=e=>e==="image"||e==="url",tbt=e=>e==="length"||e==="size"||e==="bg-size",nbt=e=>e==="length",Mnr=e=>e==="number",rbt=e=>e==="family-name",abt=e=>e==="number"||e==="weight",sbt=e=>e==="shadow",V5e=()=>{const e=To("color"),t=To("font"),n=To("text"),r=To("font-weight"),a=To("tracking"),s=To("leading"),i=To("breakpoint"),o=To("container"),c=To("spacing"),u=To("radius"),d=To("shadow"),f=To("inset-shadow"),p=To("text-shadow"),h=To("drop-shadow"),m=To("blur"),g=To("perspective"),v=To("aspect"),b=To("ease"),S=To("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...k(),xn,hn],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[xn,hn,c],A=()=>[yy,"full","auto",...j()],I=()=>[by,"none","subgrid",xn,hn],P=()=>["auto",{span:["full",by,xn,hn]},by,xn,hn],M=()=>[by,"auto",xn,hn],F=()=>["auto","min","max","fr",xn,hn],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...j()],B=()=>[yy,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],q=()=>[yy,"screen","full","dvw","lvw","svw","min","max","fit",...j()],W=()=>[yy,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,xn,hn],Z=()=>[...k(),U5e,B5e,{position:[xn,hn]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],R=()=>["auto","cover","contain",Inr,Cnr,{size:[xn,hn]}],Q=()=>[_J,DC,Fx],G=()=>["","none","full",u,xn,hn],ee=()=>["",Rr,DC,Fx],re=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Rr,_J,U5e,B5e],oe=()=>["","none",m,xn,hn],pe=()=>["none",Rr,xn,hn],K=()=>["none",Rr,xn,hn],ae=()=>[Rr,xn,hn],ie=()=>[yy,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mg],breakpoint:[mg],color:[Kyt],container:[mg],"drop-shadow":[mg],ease:["in","out","in-out"],font:[Enr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mg],shadow:[mg],spacing:["px",Rr],text:[mg],"text-shadow":[mg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yy,hn,xn,v]}],container:["container"],columns:[{columns:[Rr,hn,xn,o]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:E()}],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:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[by,"auto",xn,hn]}],basis:[{basis:[yy,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Rr,yy,"auto","initial","none",hn]}],grow:[{grow:["",Rr,xn,hn]}],shrink:[{shrink:["",Rr,xn,hn]}],order:[{order:[by,"first","last","none",xn,hn]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],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":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[o,"screen",...B()]}],"min-w":[{"min-w":[o,"screen","none",...B()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,DC,Fx]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Pnr,jnr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_J,hn]}],"font-family":[{font:[Anr,Tnr,t]}],"font-features":[{"font-features":[hn]}],"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:[a,xn,hn]}],"line-clamp":[{"line-clamp":[Rr,"none",xn,z5e]}],leading:[{leading:[s,...j()]}],"list-image":[{"list-image":["none",xn,hn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xn,hn]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Rr,"from-font","auto",xn,Fx]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Rr,"auto",xn,hn]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xn,hn]}],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",xn,hn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},by,xn,hn],radial:["",xn,hn],conic:[by,xn,hn]},Rnr,Nnr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],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:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-bs":[{"border-bs":ee()}],"border-w-be":[{"border-be":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Rr,xn,hn]}],"outline-w":[{outline:["",Rr,DC,Fx]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,W2,Q2]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,W2,Q2]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Rr,Fx]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,W2,Q2]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Rr,xn,hn]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"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":[Rr]}],"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":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"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":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"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":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"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":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"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":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"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":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"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":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[xn,hn]}],"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":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Rr]}],"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":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xn,hn]}],filter:[{filter:["","none",xn,hn]}],blur:[{blur:oe()}],brightness:[{brightness:[Rr,xn,hn]}],contrast:[{contrast:[Rr,xn,hn]}],"drop-shadow":[{"drop-shadow":["","none",h,W2,Q2]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Rr,xn,hn]}],"hue-rotate":[{"hue-rotate":[Rr,xn,hn]}],invert:[{invert:["",Rr,xn,hn]}],saturate:[{saturate:[Rr,xn,hn]}],sepia:[{sepia:["",Rr,xn,hn]}],"backdrop-filter":[{"backdrop-filter":["","none",xn,hn]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[Rr,xn,hn]}],"backdrop-contrast":[{"backdrop-contrast":[Rr,xn,hn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Rr,xn,hn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Rr,xn,hn]}],"backdrop-invert":[{"backdrop-invert":["",Rr,xn,hn]}],"backdrop-opacity":[{"backdrop-opacity":[Rr,xn,hn]}],"backdrop-saturate":[{"backdrop-saturate":[Rr,xn,hn]}],"backdrop-sepia":[{"backdrop-sepia":["",Rr,xn,hn]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xn,hn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Rr,"initial",xn,hn]}],ease:[{ease:["linear","initial",b,xn,hn]}],delay:[{delay:[Rr,xn,hn]}],animate:[{animate:["none",S,xn,hn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,xn,hn]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[xn,hn,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",xn,hn]}],"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":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",xn,hn]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Rr,DC,Fx,z5e]}],stroke:[{stroke:["none",...L()]}],"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"]}},Dnr=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:a={},override:s={}})=>(xj(e,"cacheSize",t),xj(e,"prefix",n),xj(e,"experimentalParseClassName",r),G2(e.theme,s.theme),G2(e.classGroups,s.classGroups),G2(e.conflictingClassGroups,s.conflictingClassGroups),G2(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),xj(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),Z2(e.theme,a.theme),Z2(e.classGroups,a.classGroups),Z2(e.conflictingClassGroups,a.conflictingClassGroups),Z2(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),ibt(e,a,"orderSensitiveModifiers"),e),xj=(e,t,n)=>{n!==void 0&&(e[t]=n)},G2=(e,t)=>{if(t)for(const n in t)xj(e,n,t[n])},Z2=(e,t)=>{if(t)for(const n in t)ibt(e,t,n)},ibt=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},$nr=(e,...t)=>typeof e=="function"?F5e(V5e,e,...t):F5e(()=>Dnr(V5e(),e),...t),Lnr=Object.keys({...B6,...fYt}),Fnr=Object.keys(yYt),znr=Object.keys(pYt),Bnr=Object.keys(hYt),Unr=Object.keys(dYt),zx=Object.keys(vYt),Vnr=Object.keys(mYt).concat(Object.keys(gYt)),qnr=$nr({extend:{theme:{color:Lnr,spacing:Fnr,radius:Unr,leading:Bnr,shadow:Vnr},classGroups:{"font-size":[{text:znr}],h:[{h:zx}],w:[{w:zx}],size:[{size:zx}],"min-h":[{"min-h":zx}],"min-w":[{"min-w":zx}],"max-h":[{"max-h":zx}],"max-w":[{"max-w":zx}]}}});function Y(...e){return qnr(Hyt(e))}const Hnr={sm:`${Gl.sm} text-ui-sm px-[.75em]`,md:`${Gl.md} text-ui-md px-[.75em]`,default:`${Gl.default} text-ui-md px-[.85em] `,lg:`${Gl.lg} text-ui-lg px-[1em] `},Qnr={default:"bg-surface3 border-2 border-border1 hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral5",primary:"bg-surface4 border-2 border-border2 hover:text-neutral6 hover:bg-surface5 active:bg-surface6 text-neutral6",cta:"bg-accent1/50 hover:bg-accent1/80 text-neutral5 font-semibold",ghost:"bg-transparent border-2 border-transparent hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral4",inputLike:ege,light:"",outline:""},Wnr=Y("flex items-center justify-center gap-[.75em] leading-0 transition-colors duration-200 ease-out-custom rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100",nge,tge),Gnr={light:"default",outline:"default"};function Znr(e){return Gnr[e]??e}function Q_(e){const t=Znr(e?.variant||"default"),n=e?.size||"default";return Y(Wnr,Qnr[t],Hnr[n],e?.iconOnly&&"[&>svg]:opacity-75")}function obt(e){const t=[];return Ee.Children.forEach(e,n=>{Ee.isValidElement(n)&&n.type===Ee.Fragment?t.push(...obt(n.props.children)):t.push(n)}),t}function Ynr(e){const t=obt(e);return t.length>0&&t.every(n=>Ee.isValidElement(n))}const ge=Ee.forwardRef(({className:e,as:t,size:n="default",variant:r="default",disabled:a,children:s,...i},o)=>{const c=t||"button",u=Ynr(s);return l.jsx(c,{ref:o,disabled:a,className:Y(Q_({variant:r,size:n,iconOnly:u}),e),...i,children:s})});ge.displayName="Button";const Uo=T6t,nr=N6t,rr=A6t,Jn=x.forwardRef(({className:e,sideOffset:t=4,children:n,...r},a)=>l.jsx(I6t,{children:l.jsxs(UWe,{ref:a,sideOffset:t,className:Y("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),...r,children:[n,l.jsx(R6t,{className:"fill-surface6"})]})}));Jn.displayName=UWe.displayName;const Gi=Ee.forwardRef(({tooltipContent:e,...t},n)=>l.jsxs(nr,{children:[l.jsx(rr,{asChild:!0,children:l.jsx(ge,{ref:n,...t})}),e&&l.jsx(Jn,{children:e})]}));Gi.displayName="ButtonWithTooltip";const jr=p6,lbt=KZe,Xnr=h6,cbt=x.forwardRef(({className:e,...t},n)=>l.jsx(vI,{ref:n,className:Y("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}));cbt.displayName=vI.displayName;const _r=x.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Xnr,{children:[l.jsx(cbt,{}),l.jsxs(yI,{ref:r,className:Y("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),...n,children:[t,l.jsxs(v6,{className:Y("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:[l.jsx(mr,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));_r.displayName=yI.displayName;const Tr=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});Tr.displayName="DialogHeader";const Id=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Id.displayName="DialogFooter";const zr=({className:e,...t})=>l.jsx("div",{className:Y("overflow-y-auto px-6 max-h-[50vh]",e),...t});zr.displayName="DialogBody";const Er=x.forwardRef(({className:e,...t},n)=>l.jsx(m6,{ref:n,className:Y("text-ui-md font-medium",e),...t}));Er.displayName=m6.displayName;const Ya=x.forwardRef(({className:e,...t},n)=>l.jsx(g6,{ref:n,className:Y("sr-only",e),...t}));Ya.displayName=g6.displayName;const q5e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,H5e=Hyt,TR=(e,t)=>n=>{var r;if(t?.variants==null)return H5e(e,n?.class,n?.className);const{variants:a,defaultVariants:s}=t,i=Object.keys(a).map(u=>{const d=n?.[u],f=s?.[u];if(d===null)return null;const p=q5e(d)||q5e(f);return a[u][p]}),o=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...s,...o}[g]):{...s,...o}[g]===v})?[...u,f,p]:u},[]);return H5e(e,i,c,n?.class,n?.className)},Knr=TR(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(ege,tge,nge),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Gl.sm} text-ui-sm px-[.75em]`,md:`${Gl.md} text-ui-md px-[.75em]`,default:`${Gl.default} text-ui-md px-[.85em]`,lg:`${Gl.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),an=x.forwardRef(({className:e,size:t,testId:n,variant:r,type:a,error:s,...i},o)=>l.jsx("input",{type:a,className:Y(Knr({variant:r,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:o,"aria-invalid":s,...i}));an.displayName="Input";const Jnr=TR("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=x.forwardRef(({className:e,...t},n)=>l.jsx(xet,{ref:n,className:Y(Jnr(),e),...t}));xt.displayName=xet.displayName;const err={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-smd":"text-ui-smd leading-ui-smd","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-xs":"text-header-xs leading-header-xs","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"},trr={mono:"font-mono"},me=({as:e="p",className:t,variant:n="ui-md",font:r,...a})=>l.jsx(e,{className:Y(err[n],r&&trr[r],t),...a}),hs=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),ubt=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.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"}),l.jsxs("g",{clipPath:"url(#clip0_21421_19519)",children:[l.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"}),l.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"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21421_19519",children:l.jsx("rect",{width:"62.7591",height:"62.7591",fill:"white",transform:"matrix(0.897148 0.441731 -0.897148 0.441731 63.1714 7.24365)"})})})]}),nrr=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),sge=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),ige=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),qi=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),dbt=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:l.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"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_22095",children:l.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),fbt=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[l.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:"#4285F4"}),l.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:"#34A853"}),l.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:"#FBBC05"}),l.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:"#EA4335"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_20513",children:l.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),rrr={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"},ke=({children:e,className:t,size:n="default",...r})=>l.jsx("span",{className:Y("block",rrr[n],t),...r,children:e}),arr=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),pbt=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),srr=e=>l.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),oge=e=>l.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),irr=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),Xi=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),W_=e=>l.jsx(sYt,{...e}),bo=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),orr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.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"}),l.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"})]}),Pc=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),lrr=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),crr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.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"}),l.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"}),l.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"})]}),urr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.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"}),l.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 ob(e){return l.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:[l.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),l.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),l.jsx("path",{d:"M15 2v2"}),l.jsx("path",{d:"M15 20v2"}),l.jsx("path",{d:"M2 15h2"}),l.jsx("path",{d:"M2 9h2"}),l.jsx("path",{d:"M20 15h2"}),l.jsx("path",{d:"M20 9h2"}),l.jsx("path",{d:"M9 2v2"}),l.jsx("path",{d:"M9 20v2"})]})}const drr={jpg:"image/jpg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",pdf:"application/pdf"},frr=async e=>{try{const t=await fetch(e,{method:"HEAD"});if(!t.ok)throw new Error("Failed to get file content type");const n=t.headers.get("content-type");if(!n)throw new Error("Failed to get file content type");return n}catch{const r=new URL(e).pathname.split(".").pop();if(!r)return;const a=r.toLowerCase();return drr[a]}},prr=({onOpenChange:e,open:t})=>{const n=hI(),r=Wtr({onChange:()=>e(!1)}),a=async s=>{s.preventDefault();const o=new FormData(s.target).get("url-attachment")?.toString();if(o){const c=new File([],o,{type:await frr(o)});n.addAttachment(c),e(!1)}};return l.jsx(jr,{onOpenChange:e,open:t,children:l.jsxs(_r,{children:[l.jsxs(Tr,{children:[l.jsx(Er,{children:"Add attachment"}),l.jsx(Ya,{children:"Add a file attachment via URL or from your computer"})]}),l.jsxs(zr,{children:[l.jsxs("form",{onSubmit:a,className:"flex flex-row items-end gap-4",children:[l.jsxs("div",{className:"w-full space-y-1",children:[l.jsx(xt,{htmlFor:"url-attachment",className:"text-neutral3 text-ui-md",children:"Public URL"}),l.jsx(an,{type:"text",name:"url-attachment",id:"url-attachment",className:"w-full",placeholder:"https://placehold.co/600x400/png"})]}),l.jsxs(ge,{type:"submit",className:"!h-8",variant:"light",children:[l.jsx(ke,{children:l.jsx(AGt,{})}),"Add"]})]}),l.jsx("hr",{className:"my-2 border border-border1"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(me,{variant:"ui-md",className:"text-neutral3",children:"Or from your computer"}),l.jsxs("button",{onClick:r,className:"w-full h-40 border border-border1 rounded-lg text-neutral3 border-dashed flex flex-col items-center justify-center gap-2 hover:bg-surface2 active:bg-surface3",children:[l.jsx(vWt,{className:"size-12"}),l.jsx(me,{variant:"header-md",children:"Add a local file"})]})]})]})]})})},hrr=e=>{const[t,n]=x.useState(void 0);return x.useEffect(()=>{if(!e){n(void 0);return}const r=URL.createObjectURL(e);return n(r),()=>{URL.revokeObjectURL(r)}},[e]),t},mrr=()=>{const{file:e,src:t}=_D(dZe(n=>{if(n.file)return n.file.name.startsWith("https://")?{src:n.file.name}:{file:n.file};const r=n.content?.filter(a=>a.type==="image")[0]?.image;return r?{src:r}:{}}));return hrr(e)??t},grr=()=>{const e=hI(),[t,n]=x.useState(!1);return x.useEffect(()=>{e.subscribe(()=>{const r=e.getState().attachments;n(r.length>0)})},[e]),t},vrr=e=>{const[t,n]=x.useState({isLoading:!1,text:""});return x.useEffect(()=>{if(!e)return;(async()=>{n(s=>({...s,isLoading:!0}));const a=await e.text();n(s=>({...s,isLoading:!1,text:a}))})()},[e]),t},vL="h-full w-full flex items-center justify-center",hbt=({data:e,url:t})=>{const[n,r]=x.useState(!1);return t?l.jsx("a",{href:t,className:vL,target:"_blank",rel:"noreferrer noopener",children:l.jsx(_u,{className:"text-accent2","aria-label":"View PDF"})}):l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>r(!0),className:vL,type:"button",children:l.jsx(_u,{className:"text-accent2","aria-label":"View PDF"})}),l.jsx(yrr,{data:e,open:n,onOpenChange:r})]})},yrr=({data:e,open:t,onOpenChange:n})=>l.jsx(jr,{open:t,onOpenChange:n,children:l.jsxs(_r,{className:"max-w-4xl",children:[l.jsxs(Tr,{children:[l.jsx(Er,{children:"PDF preview"}),l.jsx(Ya,{children:"Preview of the PDF document"})]}),l.jsx(zr,{children:t&&l.jsx("iframe",{src:e,width:"100%",height:"600px"})})]})}),mbt=({src:e})=>{const[t,n]=x.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>n(!0),type:"button",className:vL,children:l.jsx("img",{src:e,className:"object-cover aspect-ratio max-h-[140px] max-w-[320px]",alt:"Preview"})}),l.jsx(brr,{src:e,open:t,onOpenChange:n})]})},brr=({src:e,open:t,onOpenChange:n})=>l.jsx(jr,{open:t,onOpenChange:n,children:l.jsxs(_r,{className:"max-w-4xl",children:[l.jsxs(Tr,{children:[l.jsx(Er,{children:"Image preview"}),l.jsx(Ya,{children:"Preview of the image"})]}),l.jsx(zr,{children:t&&l.jsx("img",{src:e,alt:"Image"})})]})}),gbt=({data:e})=>{const[t,n]=x.useState(!1),r=e.replace(/<attachment[^>]*>/,"").replace(/<\/attachment>/g,"");return l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>n(!0),className:vL,type:"button",children:l.jsx(_u,{className:"text-neutral3"})}),l.jsx(xrr,{data:r,open:t,onOpenChange:n})]})},xrr=({data:e,open:t,onOpenChange:n})=>l.jsx(jr,{open:t,onOpenChange:n,children:l.jsxs(_r,{className:"max-w-4xl h-[80vh]",children:[l.jsxs(Tr,{children:[l.jsx(Er,{children:"Text preview"}),l.jsx(Ya,{children:"Preview of the text file"})]}),l.jsx(zr,{children:t&&l.jsx("div",{className:"whitespace-pre-wrap",children:e})})]})}),wrr={sm:`${Gl.sm} w-form-sm`,md:`${Gl.md} w-form-md`,lg:`${Gl.lg} w-form-lg`,default:`${Gl.default}`},Srr={sm:"sm",md:"default",lg:"lg",default:"default"},Orr={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"},krr="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",fs=Ee.forwardRef(({className:e,children:t,tooltip:n,size:r="md",variant:a="default",disabled:s,...i},o)=>l.jsxs(nr,{children:[l.jsx(rr,{asChild:!0,children:l.jsx("button",{ref:o,disabled:s,"aria-label":typeof n=="string"?n:void 0,className:Y(krr,jR,Orr[a],wrr[r],s&&"active:scale-100",e),...i,children:l.jsx(ke,{size:Srr[r],children:t})})}),l.jsx(Jn,{children:n})]}));fs.displayName="IconButton";const _rr={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function Ht({color:e,className:t,size:n="md"}){return l.jsx("svg",{className:Y("animate-spin",_rr[n],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:l.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:e||"currentColor",className:"text-accent1"})})}const vbt=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const a=r.result;typeof a=="string"?t(a):n(new Error("Failed to convert file to base64."))},r.onerror=a=>{n(a)},r.readAsDataURL(e)}),Err=({document:e})=>{const{isLoading:t,text:n}=vrr(e.file);return l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t?l.jsx(Ht,{className:"animate-spin"}):l.jsx(gbt,{data:n})})},Crr=({document:e})=>{const[t,n]=x.useState({isLoading:!1,text:""});x.useEffect(()=>{let a=!1;return(async()=>{if(!e.file)return;n(o=>({...o,isLoading:!0}));const i=await vbt(e.file);a||n(o=>({...o,isLoading:!1,text:i}))})(),()=>{a=!0}},[e]);const r=e.file?.name.startsWith("https://");return l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t.isLoading?l.jsx(Ht,{className:"animate-spin"}):l.jsx(hbt,{data:t.text,url:r?e.file?.name:void 0})})},jrr=()=>{const e=_D(i=>i.type==="image"),t=_D(i=>i.type==="document"?i:void 0),n=mrr(),r=_D(i=>i.source!=="message"),s=t?.file?.name.startsWith("https://")?t?.file?.name:n;return l.jsx(l.Fragment,{children:l.jsxs("div",{className:"relative",children:[l.jsx(J5,{children:l.jsxs(nr,{children:[l.jsx(CJe,{children:l.jsx(rr,{asChild:!0,children:l.jsx("div",{className:"overflow-hidden size-16 rounded-lg bg-surface3 border border-border1 ",children:e?l.jsx(mbt,{src:s??""}):t?.contentType==="application/pdf"?l.jsx(Crr,{document:t}):t?l.jsx(Err,{document:t}):null})})}),l.jsx(Jn,{side:"top",children:l.jsx(jJe,{})})]})}),r&&l.jsx(Trr,{})]})})},Trr=()=>l.jsx(CHt,{asChild:!0,children:l.jsx(fs,{variant:"light",size:"md",tooltip:"Remove file",className:"absolute -right-3 -top-3 text-neutral3 hover:text-neutral6 bg-surface1 hover:bg-surface2 rounded-full p-1",children:l.jsx(ke,{children:l.jsx(Sb,{})})})}),Nrr=()=>grr()?l.jsx("div",{className:"flex w-full flex-row items-center gap-4 pb-2",children:l.jsx(gZe,{components:{Attachment:jrr}})}):null;function Arr({containerRef:e}){const[t,n]=x.useState([]),[r,a]=x.useState(null),s=x.useRef(""),i=x.useRef(0),o=x.useCallback(()=>{const u=e.current;if(!u){s.current!==""&&(s.current="",n([]));return}const d=u.getBoundingClientRect(),f=Array.from(u.querySelectorAll("[data-om-badge]"));if(f.length===0){s.current!==""&&(s.current="",n([]));return}const p=[];for(let m=0;m<f.length;m++){const g=f[m],v=g.getAttribute("data-om-badge")||"",b=g.getAttribute("data-om-state")||"complete",S=g.getAttribute("data-om-type")||"observation",O=g.getBoundingClientRect();let k;const E=Irr(f,m,S);if(E){const A=parseFloat(getComputedStyle(E).marginBottom)||0;k=E.getBoundingClientRect().bottom+A-d.top}else k=0;const C=parseFloat(getComputedStyle(g).marginBottom)||0,j=O.bottom+C-d.top-k;j<=0||p.push({cycleId:v,omType:S,state:b,top:k,height:j})}const h=JSON.stringify(p);h!==s.current&&(s.current=h,n(p))},[e]);if(x.useEffect(()=>{const u=e.current;if(!u)return;o();const d=new ResizeObserver(()=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(o)});d.observe(u);const f=new MutationObserver(()=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(o)});return f.observe(u,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(i.current),d.disconnect(),f.disconnect()}},[o,e]),x.useEffect(()=>{const u=e.current;if(!u)return;const d=p=>{const h=p.target.closest("[data-om-badge]");h&&a(h.getAttribute("data-om-badge"))},f=p=>{p.target.closest("[data-om-badge]")&&a(null)};return u.addEventListener("mouseover",d),u.addEventListener("mouseout",f),()=>{u.removeEventListener("mouseover",d),u.removeEventListener("mouseout",f)}},[e]),t.length===0)return null;const c=t[t.length-1]?.cycleId??null;return l.jsx("div",{className:"pointer-events-none absolute inset-0",style:{zIndex:0},children:t.map(u=>{const d=u.cycleId===c,f=u.cycleId===r,p=r?f:d;return l.jsx(Rrr,{highlight:u,visible:p},u.cycleId)})})}function Irr(e,t,n){for(let r=t-1;r>=0;r--){const a=e[r];if(a.getAttribute("data-om-state")!=="failed"&&(n==="observation"||a.getAttribute("data-om-type")==="reflection"))return a}return null}function Rrr({highlight:e,visible:t}){const n=Prr(e.state),r=e.state.startsWith("buffering");return l.jsx("div",{className:"absolute left-0 right-0 transition-opacity duration-200",style:{top:e.top,height:e.height,border:`3px ${r?"dashed":"solid"} ${n}`,borderRadius:"0.5rem",opacity:t?1:0}})}function Prr(e){switch(e){case"complete":return"rgba(34, 197, 94, 0.4)";case"loading":return"rgba(59, 130, 246, 0.4)";case"failed":return"rgba(239, 68, 68, 0.4)";case"disconnected":return"rgba(234, 179, 8, 0.4)";case"buffering":return"rgba(168, 85, 247, 0.4)";case"buffering-complete":return"rgba(168, 85, 247, 0.4)";case"buffering-failed":return"rgba(239, 68, 68, 0.4)";case"activated":return"rgba(34, 197, 94, 0.4)";default:return"rgba(34, 197, 94, 0.4)"}}const Hn={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"},nx={visible:"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},Mrr={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"},Drr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},rt=({icon:e,variant:t="default",className:n,children:r,...a})=>l.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",Hn.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":Mrr[t],n),...a,children:[e&&l.jsx("span",{className:Drr[t],children:l.jsx(ke,{children:e})}),r]}),Zz=({children:e,initialCollapsed:t=!0,icon:n,title:r,collapsible:a=!0,extraInfo:s,"data-testid":i})=>{const[o,c]=x.useState(t);return x.useEffect(()=>{c(t)},[t]),l.jsxs("div",{className:"mb-4","data-testid":i,children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between",children:[l.jsxs("button",{onClick:a?()=>c(u=>!u):void 0,className:"flex items-center gap-2 disabled:cursor-not-allowed",disabled:!a,type:"button",children:[l.jsx(ke,{children:l.jsx(Qw,{className:Y("transition-all",o?"rotate-90":"rotate-180")})}),l.jsx(rt,{icon:n,children:r})]}),s]}),!o&&l.jsx("div",{className:"pt-2",children:l.jsx("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:e})})]})};function $rr(e,t=5){if(!e?.properties)return[];const n=[];function r(a,s,i){if(i>t)return;const o=Array.isArray(a.type)?a.type.join(" | "):a.type;if(n.push({path:s,label:s,description:a.description??a.title,type:o}),a.properties)for(const[c,u]of Object.entries(a.properties))r(u,`${s}.${c}`,i+1);if(a.items?.properties)for(const[c,u]of Object.entries(a.items.properties))r(u,`${s}[].${c}`,i+1)}for(const[a,s]of Object.entries(e.properties))r(s,a,1);return n}function Lrr(e){const t=$rr(e);return irt({override:[Frr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function Frr(e){return t=>{const r=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!r)return null;const a=r[1]??"",s=t.pos-a.length,i=a?e.filter(c=>c.path.toLowerCase().startsWith(a.toLowerCase())):e;if(i.length===0)return null;const o=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,p)=>{const g=u.state.sliceDoc(p,p+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:p,insert:g},selection:{anchor:f+g.length}})}}));return{from:s,options:o,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const zrr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,Brr=tn.mark({class:"cm-variable-highlight"}),Q5e=new Snt({regexp:zrr,decoration:()=>Brr}),Urr=hi.fromClass(class{decorations;constructor(e){this.decorations=Q5e.createDeco(e)}update(e){this.decorations=Q5e.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),Vrr=Urr,qrr={duration:5e3,cancel:{label:l.jsx(ke,{children:l.jsx(mr,{})}),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 bd(e){const{classNames:t,...n}=qrr,{classNames:r,...a}=e||{};return{...n,classNames:{...t,title:Y(t?.title,r?.title),toast:Y(t?.toast,r?.toast),cancelButton:Y(t?.cancelButton,r?.cancelButton),actionButton:Y(t?.actionButton,r?.actionButton),description:Y(t?.description,r?.description)},...a}}const De=(e,t={})=>{if(Array.isArray(e))return e.forEach(n=>Xl(n,bd(t)));if(Ee.isValidElement(e))return Xl(e,bd(t));if(typeof e=="string")return Xl(e,bd(t));throw new Error("Invalid message type")};De.success=(e,t={})=>{const n={...t,icon:l.jsx(ke,{className:"text-accent1 shrink-0",children:l.jsx(hue,{})}),classNames:{...t.classNames,toast:Y("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Xl.success(e,bd(n));case"object":return e.forEach(r=>Xl.success(r,bd(n)))}};De.error=(e,t={})=>{const n={...t,icon:l.jsx(ke,{className:"text-accent2 shrink-0",children:l.jsx(Sb,{})}),classNames:{...t.classNames,toast:Y("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Xl.error(e,bd(n));case"object":return e.forEach(r=>Xl.error(r,bd(n)))}};De.warning=(e,t={})=>{const n={...t,icon:l.jsx(ke,{className:"text-accent6 shrink-0",children:l.jsx(Dp,{})}),classNames:{...t.classNames,toast:Y("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Xl.warning(e,bd(n));case"object":return e.forEach(r=>Xl.warning(r,bd(n)))}};De.info=(e,t={})=>{const n={...t,icon:l.jsx(ke,{className:"text-accent3 shrink-0",children:l.jsx(Hl,{})}),classNames:{...t.classNames,toast:Y("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Xl.info(e,bd(n));case"object":return e.forEach(r=>Xl.info(r,bd(n)))}};De.custom=(e,t={})=>Xl(e,bd(t));De.dismiss=e=>{e&&Xl.dismiss(e)};De.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:a,onError:s,options:i={}})=>Xl.promise(e,{loading:t??"Loading...",success:o=>(a?.(o),n),error:o=>(s?.(o),r||o?.message||"Error..."),...bd(i)});function Hf({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=x.useState(!1),a=x.useRef(null),s=x.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{De.success(t),r(!0),a.current&&(clearTimeout(a.current),a.current=null),a.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{De.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:s}}function go({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:a}){const[s,i]=x.useState(!1),{handleCopy:o}=Hf({text:e,copyMessage:t}),c=()=>{o(),i(!0),setTimeout(()=>i(!1),2e3)};return l.jsxs(nr,{children:[l.jsx(rr,{asChild:!0,children:l.jsx(ge,{onClick:c,type:"button",size:r,className:a,"aria-label":s?"Copied!":n,children:s?l.jsx(pa,{}):l.jsx(Jl,{})})}),l.jsx(Jn,{children:s?"Copied!":n})]})}const Av=()=>x.useMemo(()=>{const e=iF({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)"},styles:[{tag:[he.className,he.propertyName],color:"var(--neutral6)"},{tag:he.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[he.heading1,he.heading2,he.heading3,he.heading4,he.heading5,he.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:he.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:he.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:he.link,color:"var(--accent3)",textDecoration:"underline"},{tag:he.url,color:"var(--accent3)"},{tag:he.monospace,color:"var(--neutral6)"},{tag:he.strikethrough,textDecoration:"line-through"},{tag:he.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=vt.theme({".cm-editor":{backgroundColor:"transparent"},".cm-content":{color:"var(--neutral6)"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{color:"var(--neutral3)"},".cm-cursor":{borderLeftColor:"var(--neutral6)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--accent3) 22%, transparent)"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}});return[e,t]},[]),cs=x.forwardRef(({data:e,value:t,onChange:n,showCopyButton:r=!0,className:a,language:s="json",highlightVariables:i=!1,placeholder:o,schema:c,autoFocus:u,lineNumbers:d=!0,...f},p)=>{const h=Av(),m=e?JSON.stringify(e,null,2):t??"",g=x.useMemo(()=>{const v=[];return s==="json"?v.push(md):s==="markdown"&&(v.push(Ade({base:iw,codeLanguages:jat})),v.push(vt.lineWrapping)),i&&s==="markdown"&&v.push(Vrr),c&&s==="markdown"&&v.push(Lrr(c)),v},[s,i,c]);return l.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",a),...f,children:[r&&l.jsx(go,{content:m,className:"absolute top-2 right-2 z-20"}),l.jsx(Ed,{ref:p,value:m,theme:h,extensions:g,onChange:n,"aria-label":"Code editor",placeholder:o,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function Hrr(e,t){const{codeToTokens:n,bundledLanguages:r}=await Ge(async()=>{const{codeToTokens:s,bundledLanguages:i}=await import("./index-B2yVzy6Q.js");return{codeToTokens:s,bundledLanguages:i}},__vite__mapDeps([26,2]),import.meta.url);if(!(t in r))return null;const{tokens:a}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return a}const Qrr=({selectionReason:e,open:t,onOpenChange:n,input:r})=>{let a=null;if(r)try{a=typeof r=="object"?l.jsx(cs,{data:r}):l.jsx(cs,{data:JSON.parse(r)})}catch{a=l.jsx("pre",{className:"whitespace-pre-wrap",children:r})}return l.jsx(jr,{open:t,onOpenChange:n,children:l.jsxs(_r,{children:[l.jsxs(Tr,{children:[l.jsx(Er,{children:"Agent Network Metadata"}),l.jsx(Ya,{children:"View the metadata of the agent's network choice."})]}),l.jsxs(zr,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(me,{className:"text-neutral3",children:"Selection Reason"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:e})]}),a&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(me,{className:"text-neutral3",children:"Input"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:a})]})]})]})})},lge=({selectionReason:e,input:t})=>{const[n,r]=x.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(fs,{variant:"light",size:"md",tooltip:"Show selection reason",onClick:()=>r(a=>!a),children:l.jsx(NZt,{className:"text-neutral3 size-5"})}),l.jsx(Qrr,{selectionReason:e||"",open:n,onOpenChange:r,input:t})]})},ybt=x.createContext(void 0);function Wrr({children:e,approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:a,approveNetworkToolcall:s,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:c,networkToolCallApprovals:u}){return l.jsx(ybt.Provider,{value:{approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:a,approveNetworkToolcall:s,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:c,networkToolCallApprovals:u},children:e})}function Grr(){const e=x.useContext(ybt);if(!e)throw new Error("useToolCall must be used within a ToolCallProvider");return e}const NR=({toolCalled:e,toolCallId:t,toolApprovalMetadata:n,toolName:r,isNetwork:a,isGenerateMode:s})=>{const{approveToolcall:i,declineToolcall:o,approveToolcallGenerate:c,declineToolcallGenerate:u,isRunning:d,toolCallApprovals:f,approveNetworkToolcall:p,declineNetworkToolcall:h,networkToolCallApprovals:m}=Grr(),g=()=>{a?p(r,n?.runId):s?c(t):i(t)},v=()=>{a?h(r,n?.runId):s?u(t):o(t)},b=a?m?.[n?.runId?`${n.runId}-${r}`:r]?.status:f?.[t]?.status;return n&&!e?l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Approval required"}),l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsxs(ge,{onClick:g,disabled:d||!!b,className:b==="approved"?"!text-accent1":"",children:[l.jsx(ke,{children:l.jsx(pa,{})}),"Approve"]}),l.jsxs(ge,{onClick:v,disabled:d||!!b,className:b==="declined"?"!text-accent2":"",children:[l.jsx(ke,{children:l.jsx(mr,{})}),"Decline"]})]})]}):null},Zrr=({agentId:e,messages:t=[],metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u=!1})=>{const d=n?.mode==="network"?n.selectionReason:void 0,f=n?.mode==="network"?n.agentInput:void 0;let p=t.length>0;i&&(p=c??t.every(m=>m.type==="text"?!0:!!m.toolOutput));let h=typeof o=="string"?l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:o}):l.jsx(cs,{data:o,"data-testid":"tool-suspend-payload"});return l.jsxs(Zz,{"data-testid":"agent-badge",icon:l.jsx(hs,{className:"text-accent1"}),title:e,initialCollapsed:u,extraInfo:n?.mode==="network"&&l.jsx(lge,{selectionReason:d??"",input:f}),children:[t.map((m,g)=>{if(m.type==="text")return l.jsx(Wet,{children:m.content},g);let v;try{v=typeof m.toolOutput=="string"?JSON.parse(m.toolOutput):m.toolOutput}catch{v=m.toolOutput}return l.jsx(Ee.Fragment,{children:l.jsx(Xbt,{toolName:m.toolName,argsText:typeof m.args=="string"?m.args:JSON.stringify(m.args),result:v,args:m.args,status:{type:"complete"},type:"tool-call",toolCallId:m.toolCallId,addResult:()=>{},resume:()=>{},metadata:{mode:"stream"}})},g)}),h!==void 0&&o&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Agent suspend payload"}),h]}),l.jsx(NR,{toolCalled:p,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,isGenerateMode:n?.mode==="generate"})]})};function Fn({className:e,...t}){return l.jsx("div",{className:Y("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 cge=()=>l.jsx(Zz,{icon:l.jsx(Ht,{color:B6.neutral3}),title:l.jsx(Fn,{className:"ml-2 w-12 h-2"}),collapsible:!1}),Yrr=({agentId:e,result:t,metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u})=>{const{data:d,isLoading:f}=Vyt({threadId:t?.subAgentThreadId,agentId:e,memory:!0});if(f)return l.jsx(cge,{});const p=d?.messages?tQe(d.messages):[],h=t?.childMessages??PFt(p);return l.jsx(Zrr,{agentId:e,messages:h,metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u})},Yz=({copiedDuration:e=1500}={})=>{const[t,n]=x.useState(!1);return{isCopied:t,copyToClipboard:a=>{a&&navigator.clipboard.writeText(a).then(()=>{n(!0),setTimeout(()=>n(!1),e)})}}},bbt=x.createContext({Link:x.forwardRef(()=>null),navigate:()=>{},paths:{agentLink:()=>"",agentsLink:()=>"",agentToolLink:()=>"",agentSkillLink:()=>"",agentThreadLink:()=>"",agentNewThreadLink:()=>"",workflowsLink:()=>"",workflowLink:()=>"",networkLink:()=>"",networkNewThreadLink:()=>"",networkThreadLink:()=>"",scorerLink:()=>"",cmsScorersCreateLink:()=>"",cmsScorerEditLink:()=>"",cmsAgentCreateLink:()=>"",cmsAgentEditLink:()=>"",promptBlockLink:()=>"",promptBlocksLink:()=>"",cmsPromptBlockCreateLink:()=>"",cmsPromptBlockEditLink:()=>"",toolLink:()=>"",skillLink:()=>"",workspacesLink:()=>"",workspaceLink:()=>"",workspaceSkillLink:()=>"",processorsLink:()=>"",processorLink:()=>"",mcpServerLink:()=>"",mcpServerToolLink:()=>"",workflowRunLink:()=>"",datasetLink:()=>"",datasetItemLink:()=>"",datasetExperimentLink:()=>""}}),xbt=({children:e,Link:t,navigate:n,paths:r})=>l.jsx(bbt.Provider,{value:{Link:t,navigate:n,paths:r},children:e}),Pt=()=>{const e=x.useContext(bbt);if(!e)throw new Error("useLinkComponent must be used within a LinkComponentProvider");return e},Xrr=({toolName:e,args:t,result:n,toolCallId:r,toolApprovalMetadata:a,isNetwork:s,toolCalled:i})=>{const[o,c]=x.useState(!a),{isCopied:u,copyToClipboard:d}=Yz();x.useEffect(()=>{c(!a)},[a]);const{Link:f}=Pt();let p={path:"."};try{p=typeof t=="object"?t:JSON.parse(t)}catch{}const{path:h=".",maxDepth:m,showHidden:g,dirsOnly:v,exclude:b,extension:S}=p,O=[];m!==void 0&&m!==3&&O.push(`depth: ${m}`),g&&O.push("hidden"),v&&O.push("dirs only"),b&&O.push(`exclude: ${b}`),S&&O.push(`ext: ${S}`);let k="",E="";if(typeof n=="string"&&n){const M=n.lastIndexOf(`
458
458
 
459
459
  `);M!==-1?(k=n.slice(0,M),E=n.slice(M+2)):k=n}const C=!!k,T=i??C,j=Zn(M=>M.message),I=x.useMemo(()=>j.content.find(F=>F.type==="data"&&F.name==="workspace-metadata"&&F.data?.toolCallId===r),[j.content,r])?.data,P=()=>{!k||u||d(k)};return l.jsxs("div",{className:"mb-4","data-testid":"file-tree-badge",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsxs("button",{onClick:()=>c(M=>!M),className:"flex items-center gap-2 min-w-0",type:"button",children:[l.jsx(ke,{children:l.jsx(Qw,{className:Y("transition-all",o?"rotate-90":"rotate-180")})}),l.jsxs(rt,{icon:l.jsx(sGt,{className:"text-accent6",size:16}),children:["List Files ",l.jsx("span",{className:"text-neutral6 font-normal ml-1",children:h}),O.length>0&&l.jsxs("span",{className:"text-neutral4 font-normal ml-1",children:["(",O.join(", "),")"]})]})]}),I?.filesystem&&l.jsxs(f,{href:I.id?`/workspaces/${I.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:[l.jsx(Wte,{className:"size-3"}),l.jsx("span",{children:I.name||I.filesystem.name})]}),o&&C&&E&&l.jsx("span",{className:"text-neutral6 text-xs",children:E})]}),!o&&l.jsxs("div",{className:"pt-2",children:[a&&!T&&l.jsxs("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Tool arguments"}),l.jsx(cs,{data:p,"data-testid":"tool-args"})]}),l.jsx(NR,{toolCalled:T,toolCallId:r,toolApprovalMetadata:a,toolName:e,isNetwork:s})]}),T&&k&&l.jsxs("div",{className:"rounded-md border border-border1 bg-surface2 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border1 bg-surface3",children:[E&&l.jsx("span",{className:"text-neutral6 text-xs",children:E}),l.jsx(fs,{variant:"light",size:"sm",tooltip:"Copy tree",onClick:P,disabled:!k,children:l.jsxs("span",{className:"grid",children:[l.jsx("span",{style:{gridArea:"1/1"},className:Y("transition-transform",u?"scale-100":"scale-0"),children:l.jsx(pa,{size:14})}),l.jsx("span",{style:{gridArea:"1/1"},className:Y("transition-transform",u?"scale-0":"scale-100"),children:l.jsx(Jl,{size:14})})]})})]}),l.jsx("pre",{className:"p-3 text-xs font-mono text-mastra-el-6 overflow-x-auto whitespace-pre max-h-[300px] overflow-y-auto",children:k})]}),T&&!C&&l.jsx("div",{className:"rounded-md border border-border1 bg-surface2 px-3 py-2",children:l.jsx("span",{className:"text-xs text-neutral6",children:"Loading..."})})]})]})};function Vk({children:e}){const t=e.replace(/\\n/g,`
460
460
  `);return l.jsx(Wet,{remarkPlugins:[Hst],components:Jrr,className:"space-y-3",children:t})}const wbt=Ee.memo(({children:e,language:t,...n})=>{const[r,a]=x.useState([]);return x.useEffect(()=>{Hrr(e,t).then(s=>{s&&a(s)})},[e,t]),r.length?l.jsx("pre",{...n,children:l.jsx("code",{children:r.map((s,i)=>l.jsxs(l.Fragment,{children:[l.jsx("span",{children:s.map((o,c)=>{const u=typeof o.htmlStyle=="string"?void 0:o.htmlStyle;return l.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",style:u,children:o.content},c)})},i),i!==r.length-1&&`
@@ -507,4 +507,4 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
507
507
  `),c=s;c<o.length;c++){var u=o[c];if(!(u.length>1024)){var d=JFe.test(u)?u.replace(JFe,"$1"):u;if(!d.match(/\S*Error: /)){for(var f of n){var p=f(d,e);if(p){i.push(p);break}}if(i.length>=eze)break}}}return(function(h){if(!h.length)return[];var m=Array.from(h);return m.reverse(),m.slice(0,eze).map((g=>{return Ft({},g,{filename:g.filename||(v=m,v[v.length-1]||{}).filename,function:g.function||Xk});var v}))})(i)}})("web:javascript",Ewr,Twr)}class Awr{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=uo(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return jL(t,"DOMException")}isDOMError(t){return jL(t,"DOMError")}}class Iwr{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Rwr{constructor(){}match(t){return jL(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r,a=n.apply(t.error);return a||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var Pwr=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Mwr{match(t){return typeof t=="string"}coerce(t,n){var r,[a,s]=this.getInfos(t);return{type:a??"Error",value:s??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,a=t.match(Pwr);return a&&(n=a[1],r=a[2]),[n,r]}}var Dwr=["fatal","error","warning","log","info","debug"];function i1t(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var a=n.slice(0,r).join(", ");if(!(a.length>t))return r===n.length||a.length<=t?a:a.slice(0,t)+"..."}return""}class $wr{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,a=this.getErrorPropertyFromObject(t);return a?n.apply(a):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return sve(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+i1t(t)}isSeverityLevel(t){return uo(t)&&!Yse(t)&&Dwr.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(xwr(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class Lwr{match(t){return sve(t)}coerce(t,n){var r,a=t.constructor.name;return{type:a,value:a+" captured as exception with keys: "+i1t(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class Fwr{match(t){return USt(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class zwr{match(t){return jL(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!sve(t))return!1;try{var n=t.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(t,n){var r,a=this.getUnhandledRejectionReason(t);return USt(a)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(a),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(a)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var o1t=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={k:function(a){if(Ye&&(hf.DEBUG||zn.POSTHOG_DEBUG||n)&&!Wt(Ye.console)&&Ye.console){for(var s=("__rrweb_original__"in Ye.console[a])?Ye.console[a].__rrweb_original__:Ye.console[a],i=arguments.length,o=new Array(i>1?i-1:0),c=1;c<i;c++)o[c-1]=arguments[c];s(e,...o)}},info:function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];r.k("log",...s)},warn:function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];r.k("warn",...s)},error:function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];r.k("error",...s)},critical:function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];console.error(e,...s)},uninitializedWarning:a=>{r.error("You must initialize PostHog before calling "+a)},createLogger:(a,s)=>o1t(e+" "+a,s)};return r},Zt=o1t("[PostHog.js]"),yi=Zt.createLogger,Bwr=yi("[ExternalScriptsLoader]"),tze=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Bwr.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=qt?.querySelectorAll("script");if(r){for(var a,s=function(){if(r[i].src===t){var c=r[i];return c.__posthog_loading_callback_fired?{v:n()}:(c.addEventListener("load",(u=>{c.__posthog_loading_callback_fired=!0,n(void 0,u)})),c.onerror=u=>n(u),{v:void 0})}},i=0;i<r.length;i++)if(a=s())return a.v}var o=()=>{if(!qt)return n("document not found");var c=qt.createElement("script");if(c.type="text/javascript",c.crossOrigin="anonymous",c.src=t,c.onload=f=>{c.__posthog_loading_callback_fired=!0,n(void 0,f)},c.onerror=f=>n(f),e.config.prepare_external_dependency_script&&(c=e.config.prepare_external_dependency_script(c)),!c)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")qt.head.appendChild(c);else{var u,d=qt.querySelectorAll("body > script");d.length>0?(u=d[0].parentNode)==null||u.insertBefore(c,d[0]):qt.body.appendChild(c)}};qt!=null&&qt.body?o():qt?.addEventListener("DOMContentLoaded",o)};zn.__PosthogExtensions__=zn.__PosthogExtensions__||{},zn.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/"+t+".js?v="+e.version;if(t==="remote-config"&&(r="/array/"+e.config.token+"/config.js"),t==="toolbar"){var a=3e5;r=r+"&t="+Math.floor(Date.now()/a)*a}var s=e.requestRouter.endpointFor("assets",r);tze(e,s,n)},zn.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);tze(e,r,n)};var NL={};function cb(e,t,n){if(Aa(e)){if(VFe&&e.forEach===VFe)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,a=e.length;r<a;r++)if(r in e&&t.call(n,e[r],r)===NL)return}}}function Ps(e,t,n){if(!ra(e)){if(Aa(e))return cb(e,t,n);if(swr(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===NL)return}else for(var a in e)if(BSt.call(e,a)&&t.call(n,e[a],a)===NL)return}}var Vi=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return cb(n,(function(a){for(var s in a)a[s]!==void 0&&(e[s]=a[s])})),e},Kk=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return cb(n,(function(a){cb(a,(function(s){e.push(s)}))})),e};function d$(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var nze=function(e){try{return e()}catch{return}},Uwr=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(a){Zt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Zt.critical(a)}}},uve=function(e){var t={};return Ps(e,(function(n,r){(uo(n)&&n.length>0||Cm(n))&&(t[r]=n)})),t};function Vwr(e,t){return n=e,r=s=>uo(s)&&!uh(t)?s.slice(0,t):s,a=new Set,(function s(i,o){return i!==Object(i)?r?r(i,o):i:a.has(i)?void 0:(a.add(i),Aa(i)?(c=[],cb(i,(u=>{c.push(s(u))}))):(c={},Ps(i,((u,d)=>{a.has(u)||(c[d]=s(u,d))}))),c);var c})(n);var n,r,a}var qwr=["herokuapp.com","vercel.app","netlify.app"];function Hwr(e){var t=e?.hostname;if(!uo(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of qwr)if(n===r)return!1;return!0}function l1t(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function io(e,t,n,r){var{capture:a=!1,passive:s=!0}=r??{};e?.addEventListener(t,n,{capture:a,passive:s})}function c1t(e){return e.name==="ph_toolbar_internal"}var u1t="$people_distinct_id",_j="__alias",Ej="__timers",rze="$autocapture_disabled_server_side",tie="$heatmaps_enabled_server_side",aze="$exception_capture_enabled_server_side",nie="$error_tracking_suppression_rules",sze="$error_tracking_capture_extension_exceptions",ize="$web_vitals_enabled_server_side",d1t="$dead_clicks_enabled_server_side",oze="$product_tours_enabled_server_side",lze="$web_vitals_allowed_metrics",dD="$session_recording_remote_config",AL="$sesid",f1t="$session_is_sampled",rO="$enabled_feature_flags",Cj="$early_access_features",rie="$feature_flag_details",jj="$stored_person_properties",t0="$stored_group_properties",aie="$surveys",pT="$flag_call_reported",sie="$flag_call_reported_session_id",iie="$feature_flag_errors",IL="$feature_flag_evaluated_at",Ph="$user_state",oie="$client_session_props",lie="$capture_rate_limit",cie="$initial_campaign_params",uie="$initial_referrer_info",RL="$initial_person_info",PL="$epp",p1t="__POSTHOG_TOOLBAR__",VC="$posthog_cookieless",Qwr=[u1t,_j,"__cmpns",Ej,"$session_recording_enabled_server_side",tie,AL,rO,nie,Ph,Cj,rie,t0,jj,aie,pT,sie,iie,IL,oie,lie,cie,uie,PL,RL];Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Cm(e)&&isFinite(e)&&Math.floor(e)===e});var cze="0123456789abcdef";class ML{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,a){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(a)||t<0||n<0||r<0||a<0||t>0xffffffffffff||n>4095||r>1073741823||a>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=a>>>24,s[13]=a>>>16,s[14]=a>>>8,s[15]=a,new ML(s)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+cze.charAt(this.bytes[n]>>>4)+cze.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new ML(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class Wwr{constructor(){this.P=0,this.T=0,this.R=new Gwr}generate(){var t=this.generateOrAbort();if(Wt(t)){this.P=0;var n=this.generateOrAbort();if(Wt(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.P)this.P=t,this.I();else{if(!(t+1e4>this.P))return;this.T++,this.T>4398046511103&&(this.P++,this.I())}return ML.fromFieldsV7(this.P,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.R.nextUint32())}I(){this.T=1024*this.R.nextUint32()+(1023&this.R.nextUint32())}}var uze,h1t=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};Ye&&!Wt(Ye.crypto)&&crypto.getRandomValues&&(h1t=e=>crypto.getRandomValues(e));class Gwr{constructor(){this.C=new Uint32Array(8),this.O=1/0}nextUint32(){return this.O>=this.C.length&&(h1t(this.C),this.O=0),this.C[this.O++]}}var Wy=()=>Zwr().toString(),Zwr=()=>(uze||(uze=new Wwr)).generate(),qC="",Ywr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Xwr(e,t){if(t){var n=(function(a,s){if(s===void 0&&(s=qt),qC)return qC;if(!s||["localhost","127.0.0.1"].includes(a))return"";for(var i=a.split("."),o=Math.min(i.length,8),c="dmn_chk_"+Wy();!qC&&o--;){var u=i.slice(o).join("."),d=c+"=1;domain=."+u+";path=/";s.cookie=d+";max-age=3",s.cookie.includes(c)&&(s.cookie=d+";max-age=0",qC=u)}return qC})(e);if(!n){var r=(a=>{var s=a.match(Ywr);return s?s[0]:""})(e);r!==n&&Zt.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Qh={F:()=>!!qt,M:function(e){Zt.error("cookieStore error: "+e)},A:function(e){if(qt){try{for(var t=e+"=",n=qt.cookie.split(";").filter((s=>s.length)),r=0;r<n.length;r++){for(var a=n[r];a.charAt(0)==" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return decodeURIComponent(a.substring(t.length,a.length))}}catch{}return null}},D:function(e){var t;try{t=JSON.parse(Qh.A(e))||{}}catch{}return t},L:function(e,t,n,r,a){if(qt)try{var s="",i="",o=Xwr(qt.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+24*n*60*60*1e3),s="; expires="+c.toUTCString()}a&&(i="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+o+i;return u.length>3686.4&&Zt.warn("cookieStore warning: large cookie, len="+u.length),qt.cookie=u,u}catch{return}},j:function(e,t){if(qt!=null&&qt.cookie)try{Qh.L(e,"",-1,t)}catch{return}}},oee=null,di={F:function(){if(!uh(oee))return oee;var e=!0;if(Wt(Ye))e=!1;else try{var t="__mplssupport__";di.L(t,"xyz"),di.A(t)!=='"xyz"'&&(e=!1),di.j(t)}catch{e=!1}return e||Zt.error("localStorage unsupported; falling back to cookie store"),oee=e,e},M:function(e){Zt.error("localStorage error: "+e)},A:function(e){try{return Ye?.localStorage.getItem(e)}catch(t){di.M(t)}return null},D:function(e){try{return JSON.parse(di.A(e))||{}}catch{}return null},L:function(e,t){try{Ye?.localStorage.setItem(e,JSON.stringify(t))}catch(n){di.M(n)}},j:function(e){try{Ye?.localStorage.removeItem(e)}catch(t){di.M(t)}}},Kwr=["$device_id","distinct_id",AL,f1t,PL,RL,Ph],fD={},Jwr={F:function(){return!0},M:function(e){Zt.error("memoryStorage error: "+e)},A:function(e){return fD[e]||null},D:function(e){return fD[e]||null},L:function(e,t){fD[e]=t},j:function(e){delete fD[e]}},qx=null,yl={F:function(){if(!uh(qx))return qx;if(qx=!0,Wt(Ye))qx=!1;else try{var e="__support__";yl.L(e,"xyz"),yl.A(e)!=='"xyz"'&&(qx=!1),yl.j(e)}catch{qx=!1}return qx},M:function(e){Zt.error("sessionStorage error: ",e)},A:function(e){try{return Ye?.sessionStorage.getItem(e)}catch(t){yl.M(t)}return null},D:function(e){try{return JSON.parse(yl.A(e))||null}catch{}return null},L:function(e,t){try{Ye?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){yl.M(n)}},j:function(e){try{Ye?.sessionStorage.removeItem(e)}catch(t){yl.M(t)}}},_g=(function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e})({});class eSr{constructor(t){this._instance=t}get N(){return this._instance.config}get consent(){return this.U()?_g.DENIED:this.H}isOptedOut(){return this.N.cookieless_mode==="always"||this.consent===_g.DENIED||this.consent===_g.PENDING&&(this.N.opt_out_capturing_by_default||this.N.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===_g.DENIED}optInOut(t){this.B.L(this.q,t?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.B.j(this.q,this.N.cross_subdomain_cookie)}get q(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get H(){var t=this.B.A(this.q);return aee(t)?_g.GRANTED:Wr(lwr,t)?_g.DENIED:_g.PENDING}get B(){if(!this.V){var t=this.N.opt_out_capturing_persistence_type;this.V=t==="localStorage"?di:Qh;var n=t==="localStorage"?Qh:di;n.A(this.q)&&(this.V.A(this.q)||this.optInOut(aee(n.A(this.q))),n.j(this.q,this.N.cross_subdomain_cookie))}return this.V}U(){return!!this.N.respect_dnt&&!!l1t([fd?.doNotTrack,fd?.msDoNotTrack,zn.doNotTrack],(t=>aee(t)))}}var pD=yi("[Dead Clicks]"),tSr=()=>!0,nSr=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(d1t)),r=e.instance.config.capture_dead_clicks;return Zg(r)?r:!!Mo(r)||n};class dze{get lazyLoadedDeadClicksAutocapture(){return this.W}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[d1t]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.G((()=>{this.Y()})):this.stop()}G(t){var n,r;(n=zn.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=zn.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(a=>{a?pD.error("failed to load script",a):t()}))}Y(){var t;if(qt){if(!this.W&&(t=zn.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=Mo(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.W=zn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.W.start(qt),pD.info("starting...")}}else pD.error("`document` not found. Cannot start.")}stop(){this.W&&(this.W.stop(),this.W=void 0,pD.info("stopping..."))}}var lee=yi("[SegmentIntegration]");function rSr(e,t){var n=e.config.segment;if(!n)return t();(function(r,a){var s=r.config.segment;if(!s)return a();var i=c=>{var u=()=>c.anonymousId()||Wy();r.config.get_device_id=u,c.id()&&(r.register({distinct_id:c.id(),$device_id:u()}),r.persistence.set_property(Ph,"identified")),a()},o=s.user();"then"in o&&Fg(o.then)?o.then(i):i(o)})(e,(()=>{n.register((r=>{Promise&&Promise.resolve||lee.warn("This browser does not have Promise support, and can not use the segment integration");var a=(s,i)=>{if(!i)return s;s.event.userId||s.event.anonymousId===r.get_distinct_id()||(lee.info("No userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(lee.info("UserId set, identifying with PostHog"),r.identify(s.event.userId));var o=r.calculateEventProperties(i,s.event.properties);return s.event.properties=Object.assign({},o,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>a(s,s.event.event),page:s=>a(s,"$pageview"),identify:s=>a(s,"$identify"),screen:s=>a(s,"$screen")}})(e)).then((()=>{t()}))}))}var m1t="posthog-js";function g1t(e,t){var{organization:n,projectId:r,prefix:a,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}=t===void 0?{}:t;return o=>{var c,u,d,f,p;if(!(s==="*"||s.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,g=((c=o.exception)==null?void 0:c.values)||[],v=g.map((S=>Ft({},S,{stacktrace:S.stacktrace?Ft({},S.stacktrace,{type:"raw",frames:(S.stacktrace.frames||[]).map((O=>Ft({},O,{platform:"web:javascript"})))}):void 0}))),b={$exception_message:((u=g[0])==null?void 0:u.value)||o.message,$exception_type:(d=g[0])==null?void 0:d.type,$exception_level:o.level,$exception_list:v,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=g[0])==null?void 0:f.value)||o.message,$sentry_exception_type:(p=g[0])==null?void 0:p.type,$sentry_tags:o.tags};return n&&r&&(b.$sentry_url=(a||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+o.event_id),i&&((m=e.exceptions)==null||m.sendExceptionEvent(b)),o}}class aSr{constructor(t,n,r,a,s,i){this.name=m1t,this.setupOnce=function(o){o(g1t(t,{organization:n,projectId:r,prefix:a,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}}class fze{constructor(t){this.J=(n,r,a)=>{a&&(a.noSessionId||a.activityTimeout||a.sessionPastMaximumLength)&&(Zt.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:a}),this.K=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.X()}X(){var t;this.Z=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.J)}destroy(){var t;(t=this.Z)==null||t.call(this),this.Z=void 0}doPageView(t,n){var r,a=this.tt(t,n);return this.K={pathname:(r=Ye?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),a}doPageLeave(t){var n;return this.tt(t,(n=this.K)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.K)==null?void 0:t.pageViewId}}tt(t,n){var r=this.K;if(!r)return{$pageview_id:n};var a={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:i,lastScrollY:o,maxScrollY:c,maxContentHeight:u,lastContentY:d,maxContentY:f}=s;if(!(Wt(i)||Wt(o)||Wt(c)||Wt(u)||Wt(d)||Wt(f))){i=Math.ceil(i),o=Math.ceil(o),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f);var p=i<=1?1:sm(o/i,0,1,Zt),h=i<=1?1:sm(c/i,0,1,Zt),m=u<=1?1:sm(d/u,0,1,Zt),g=u<=1?1:sm(f/u,0,1,Zt);a=Vi(a,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:m,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:g})}}return r.pathname&&(a.$prev_pageview_pathname=r.pathname),r.timestamp&&(a.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),a}}var DL=e=>{var t=qt?.createElement("a");return Wt(t)?null:(t.href=e,t)},sSr=function(e,t){var n,r;t===void 0&&(t="&");var a=[];return Ps(e,(function(s,i){Wt(s)||Wt(i)||i==="undefined"||(n=encodeURIComponent((o=>o instanceof File)(s)?s.name:s.toString()),r=encodeURIComponent(i),a[a.length]=r+"="+n)})),a.join(t)},$L=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),a=0;a<r.length;a++){var s=r[a].split("=");if(s[0]===t){n=s;break}}if(!Aa(n)||n.length<2)return"";var i=n[1];try{i=decodeURIComponent(i)}catch{Zt.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},IA=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),a=r[0]||"",s=r[1],i=a.split("?"),o=i[1],c=i[0],u=(o||"").split("&"),d=[],f=0;f<u.length;f++){var p=u[f].split("=");Aa(p)&&(t.includes(p[0])?d.push(p[0]+"="+n):d.push(u[f]))}var h=c;return o!=null&&(h+="?"+d.join("&")),s!=null&&(h+="#"+s),h},LL=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},hD="https?://(.*)",Jk=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],iSr=Kk(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Jk),RA="<masked>",oSr=["li_fat_id"];function v1t(e,t,n){if(!qt)return{};var r,a=t?Kk([],Jk,n||[]):[],s=y1t(IA(qt.URL,a,RA),e),i=(r={},Ps(oSr,(function(o){var c=Qh.A(o);r[o]=c||null})),r);return Vi(i,s)}function y1t(e,t){var n=iSr.concat(t||[]),r={};return Ps(n,(function(a){var s=$L(e,a);r[a]=s||null})),r}function b1t(e){var t=(function(s){return s?s.search(hD+"google.([^/?]*)")===0?"google":s.search(hD+"bing.com")===0?"bing":s.search(hD+"yahoo.com")===0?"yahoo":s.search(hD+"duckduckgo.com")===0?"duckduckgo":null:null})(e),n=t!="yahoo"?"q":"p",r={};if(!uh(t)){r.$search_engine=t;var a=qt?$L(qt.referrer,n):"";a.length&&(r.ph_keyword=a)}return r}function pze(){return navigator.language||navigator.userLanguage}function x1t(){return qt?.referrer||"$direct"}function w1t(e,t){var n=e?Kk([],Jk,t||[]):[],r=xl?.href.substring(0,1e3);return{r:x1t().substring(0,1e3),u:r?IA(r,n,RA):void 0}}function S1t(e){var t,{r:n,u:r}=e,a={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=DL(n))==null?void 0:t.host};if(r){a.$current_url=r;var s=DL(r);a.$host=s?.host,a.$pathname=s?.pathname;var i=y1t(r);Vi(a,i)}if(n){var o=b1t(n);Vi(a,o)}return a}function O1t(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function lSr(){try{return new Date().getTimezoneOffset()}catch{return}}function cSr(e,t){var n,r,a,s;if(!Kc)return{};var i,o,c,u,d,f,p,h,m=e?Kk([],Jk,t||[]):[],[g,v]=(function(b){for(var S=0;S<XFe.length;S++){var[O,k]=XFe[S],E=O.exec(b),C=E&&(Fg(k)?k(E,b):k);if(C)return C}return["",""]})(Kc);return Vi(uve({$os:g,$os_version:v,$browser:a1t(Kc,navigator.vendor),$device:KFe(Kc),$device_type:(o=Kc,c={userAgentDataPlatform:(n=navigator)==null||(n=n.userAgentData)==null?void 0:n.platform,maxTouchPoints:(r=navigator)==null?void 0:r.maxTouchPoints,screenWidth:Ye==null||(a=Ye.screen)==null?void 0:a.width,screenHeight:Ye==null||(s=Ye.screen)==null?void 0:s.height,devicePixelRatio:Ye?.devicePixelRatio},h=KFe(o),h===qSt||h===VSt||h==="Kobo"||h==="Kindle Fire"||h===r1t?Zk:h===NA||h===MO||h===AA||h===Kse?"Console":h===QSt?"Wearable":h?xd:c?.userAgentDataPlatform==="Android"&&((u=c?.maxTouchPoints)!==null&&u!==void 0?u:0)>0?Math.min((d=c?.screenWidth)!==null&&d!==void 0?d:0,(f=c?.screenHeight)!==null&&f!==void 0?f:0)/((p=c?.devicePixelRatio)!==null&&p!==void 0?p:1)>=600?Zk:xd:"Desktop"),$timezone:O1t(),$timezone_offset:lSr()}),{$current_url:IA(xl?.href,m,RA),$host:xl?.host,$pathname:xl?.pathname,$raw_user_agent:Kc.length>1e3?Kc.substring(0,997)+"...":Kc,$browser_version:bwr(Kc,navigator.vendor),$browser_language:pze(),$browser_language_prefix:(i=pze(),typeof i=="string"?i.split("-")[0]:void 0),$screen_height:Ye?.screen.height,$screen_width:Ye?.screen.width,$viewport_height:Ye?.innerHeight,$viewport_width:Ye?.innerWidth,$lib:hf.LIB_NAME,$lib_version:hf.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var uSr=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class cee{constructor(t,n){this.N=t,this.props={},this.it=!1,this.et=(r=>{var a="";return r.token&&(a=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+a+"_posthog"})(t),this.B=this.rt(t),this.load(),t.debug&&Zt.info("Persistence loaded",t.persistence,Ft({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this.st}rt(t){uSr.indexOf(t.persistence.toLowerCase())===-1&&(Zt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=(function(a){a===void 0&&(a=[]);var s=[...Kwr,...a];return Ft({},di,{D:function(i){try{var o={};try{o=Qh.D(i)||{}}catch{}var c=Vi(o,JSON.parse(di.A(i)||"{}"));return di.L(i,c),c}catch{}return null},L:function(i,o,c,u,d,f){try{di.L(i,o,void 0,void 0,f);var p={};s.forEach((h=>{o[h]&&(p[h]=o[h])})),Object.keys(p).length&&Qh.L(i,p,c,u,d,f)}catch(h){di.M(h)}},j:function(i,o){try{Ye?.localStorage.removeItem(i),Qh.j(i,o)}catch(c){di.M(c)}}})})(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&di.F()?di:r==="localstorage+cookie"&&n.F()?n:r==="sessionstorage"&&yl.F()?yl:r==="memory"?Jwr:r==="cookie"?Qh:n.F()?n:Qh}nt(t){var n=t??this.N.feature_flag_cache_ttl_ms;if(!n||n<=0)return!1;var r=this.props[IL];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return Ps(this.props,((n,r)=>{if(r===rO&&Mo(n)){if(!this.nt())for(var a=Object.keys(n),s=0;s<a.length;s++)t["$feature/"+a[s]]=n[a[s]]}else o=r,c=!1,(uh(i=Qwr)?c:qFe&&i.indexOf===qFe?i.indexOf(o)!=-1:(Ps(i,(function(u){if(c||(c=u===o))return NL})),c))||(t[r]=n);var i,o,c})),t}load(){if(!this.st){var t=this.B.D(this.et);t&&(this.props=Vi({},t))}}save(){this.st||this.B.L(this.et,this.props,this.ot,this.ut,this.ht,this.N.debug)}remove(){this.B.j(this.et,!1),this.B.j(this.et,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Mo(t)){Wt(n)&&(n="None"),this.ot=Wt(r)?this.dt:r;var a=!1;if(Ps(t,((s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==n||(this.props[i]=s,a=!0)})),a)return this.save(),!0}return!1}register(t,n){if(Mo(t)){this.ot=Wt(n)?this.dt:n;var r=!1;if(Ps(t,((a,s)=>{t.hasOwnProperty(s)&&this.props[s]!==a&&(this.props[s]=a,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.it){var t=v1t(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);nO(uve(t))||this.register(t),this.it=!0}}update_search_keyword(){var t;this.register((t=qt?.referrer)?b1t(t):{})}update_referrer_info(){var t;this.register_once({$referrer:x1t(),$referring_domain:qt!=null&&qt.referrer&&((t=DL(qt.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[cie]||this.props[uie]||this.register_once({[RL]:w1t(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Ps([uie,cie],(i=>{var o=this.props[i];o&&Ps(o,(function(c,u){t["$initial_"+Zse(u)]=c}))}));var n,r,a=this.props[RL];if(a){var s=(n=S1t(a),r={},Ps(n,(function(i,o){r["$initial_"+Zse(o)]=i})),r);Vi(t,s)}return t}safe_merge(t){return Ps(this.props,(function(n,r){r in t||(t[r]=n)})),t}update_config(t,n,r){if(this.dt=this.ot=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((i,o)=>{if(i.length!==o.length)return!1;var c=[...i].sort(),u=[...o].sort();return c.every(((d,f)=>d===u[f]))})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var a=this.rt(t),s=this.props;this.clear(),this.B=a,this.props=s,this.save()}}set_disabled(t){this.st=t,this.st?this.remove():this.save()}set_cross_subdomain(t){t!==this.ut&&(this.ut=t,this.remove(),this.save())}set_secure(t){t!==this.ht&&(this.ht=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Ej]||{};r[t]=n,this.props[Ej]=r,this.save()}remove_event_timer(t){var n=(this.props[Ej]||{})[t];return Wt(n)||(delete this.props[Ej][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var HC={Activation:"events",Cancellation:"cancelEvents"},uee={Popover:"popover",API:"api",Widget:"widget"},Tj={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},dee={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},die={Popover:"popover",Inline:"inline"},dSr=(function(e){return e.SHOWN="product tour shown",e.DISMISSED="product tour dismissed",e.COMPLETED="product tour completed",e.STEP_SHOWN="product tour step shown",e.STEP_COMPLETED="product tour step completed",e.BUTTON_CLICKED="product tour button clicked",e.STEP_SELECTOR_FAILED="product tour step selector failed",e.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",e.BANNER_ACTION_CLICKED="product tour banner action clicked",e})({}),hze=(function(e){return e.TOUR_ID="$product_tour_id",e.TOUR_NAME="$product_tour_name",e.TOUR_ITERATION="$product_tour_iteration",e.TOUR_RENDER_REASON="$product_tour_render_reason",e.TOUR_STEP_ID="$product_tour_step_id",e.TOUR_STEP_ORDER="$product_tour_step_order",e.TOUR_STEP_TYPE="$product_tour_step_type",e.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",e.TOUR_BUTTON_TEXT="$product_tour_button_text",e.TOUR_BUTTON_ACTION="$product_tour_button_action",e.TOUR_BUTTON_LINK="$product_tour_button_link",e.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",e.TOUR_STEPS_COUNT="$product_tour_steps_count",e.TOUR_STEP_SELECTOR="$product_tour_step_selector",e.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",e.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",e.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",e.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",e.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",e.TOUR_ERROR="$product_tour_error",e.TOUR_MATCHES_COUNT="$product_tour_matches_count",e.TOUR_FAILURE_PHASE="$product_tour_failure_phase",e.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",e.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",e.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",e.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",e.USE_MANUAL_SELECTOR="$use_manual_selector",e.INFERENCE_DATA_PRESENT="$inference_data_present",e.TOUR_LAST_SEEN_DATE="$product_tour_last_seen_date",e.TOUR_TYPE="$product_tour_type",e})({}),mze=yi("[RateLimiter]");class fSr{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((a=>{mze.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void mze.warn('could not rate limit - continuing. Error: "'+a?.message+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,a;t===void 0&&(t=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:i}=this,o=new Date().getTime(),c=(n=(r=this.instance.persistence)==null?void 0:r.get_property(lie))!==null&&n!==void 0?n:{tokens:s,last:o};c.tokens+=(o-c.last)/1e3*i,c.last=o,c.tokens>s&&(c.tokens=s);var u=c.tokens<1;return u||t||(c.tokens=Math.max(0,c.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+i+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(a=this.instance.persistence)==null||a.set_property(lie,c),{isRateLimited:u,remainingTokens:c.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var QC=yi("[RemoteConfig]");class k1t{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=zn._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}vt(t){var n,r;(n=zn.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=zn.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}ct(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return QC.info("Using preloaded remote config",this.remoteConfig),this.ft(this.remoteConfig),void this._t();if(this._instance.bt())return void QC.warn("Remote config is disabled. Falling back to local config.");this.vt((t=>{if(!t)return QC.info("No config found after loading remote JS config. Falling back to JSON."),void this.ct((n=>{this.ft(n),this._t()}));this.ft(t),this._t()}))}catch(t){QC.error("Error loading remote config",t)}}stop(){this.yt&&(clearInterval(this.yt),this.yt=void 0)}refresh(){this._instance.bt()||qt?.visibilityState==="hidden"||this._instance.reloadFeatureFlags()}_t(){var t;if(!this.yt){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.yt=setInterval((()=>{this.refresh()}),n))}}ft(t){var n;t||QC.error("Failed to fetch remote config from PostHog."),this._instance.ft(t??{}),t?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var Ig=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({}),$f=Uint8Array,vu=Uint16Array,e_=Uint32Array,dve=new $f([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]),fve=new $f([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]),gze=new $f([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_1t=function(e,t){for(var n=new vu(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var a=new e_(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)a[s]=s-n[r]<<5|r;return[n,a]},E1t=_1t(dve,2),pSr=E1t[0],fie=E1t[1];pSr[28]=258,fie[258]=28;for(var vze=_1t(fve,0)[1],C1t=new vu(32768),Ws=0;Ws<32768;++Ws){var Hx=(43690&Ws)>>>1|(21845&Ws)<<1;Hx=(61680&(Hx=(52428&Hx)>>>2|(13107&Hx)<<2))>>>4|(3855&Hx)<<4,C1t[Ws]=((65280&Hx)>>>8|(255&Hx)<<8)>>>1}var hT=function(e,t,n){for(var r=e.length,a=0,s=new vu(t);a<r;++a)++s[e[a]-1];var i,o=new vu(t);for(a=0;a<t;++a)o[a]=o[a-1]+s[a-1]<<1;for(i=new vu(r),a=0;a<r;++a)i[a]=C1t[o[e[a]-1]++]>>>15-e[a];return i},Nw=new $f(288);for(Ws=0;Ws<144;++Ws)Nw[Ws]=8;for(Ws=144;Ws<256;++Ws)Nw[Ws]=9;for(Ws=256;Ws<280;++Ws)Nw[Ws]=7;for(Ws=280;Ws<288;++Ws)Nw[Ws]=8;var FL=new $f(32);for(Ws=0;Ws<32;++Ws)FL[Ws]=5;var hSr=hT(Nw,9),mSr=hT(FL,5),j1t=function(e){return(e/8>>0)+(7&e&&1)},T1t=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof vu?vu:e instanceof e_?e_:$f)(n-t);return r.set(e.subarray(t,n)),r},vg=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},WC=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},fee=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,s=n.slice();if(!a)return[new $f(0),0];if(a==1){var i=new $f(n[0].s+1);return i[n[0].s]=1,[i,1]}n.sort((function(E,C){return E.f-C.f})),n.push({s:-1,f:25001});var o=n[0],c=n[1],u=0,d=1,f=2;for(n[0]={s:-1,f:o.f+c.f,l:o,r:c};d!=a-1;)o=n[n[u].f<n[f].f?u++:f++],c=n[u!=d&&n[u].f<n[f].f?u++:f++],n[d++]={s:-1,f:o.f+c.f,l:o,r:c};var p=s[0].s;for(r=1;r<a;++r)s[r].s>p&&(p=s[r].s);var h=new vu(p+1),m=pie(n[d-1],h,0);if(m>t){r=0;var g=0,v=m-t,b=1<<v;for(s.sort((function(E,C){return h[C.s]-h[E.s]||E.f-C.f}));r<a;++r){var S=s[r].s;if(!(h[S]>t))break;g+=b-(1<<m-h[S]),h[S]=t}for(g>>>=v;g>0;){var O=s[r].s;h[O]<t?g-=1<<t-h[O]++-1:++r}for(;r>=0&&g;--r){var k=s[r].s;h[k]==t&&(--h[k],++g)}m=t}return[new $f(h),m]},pie=function(e,t,n){return e.s==-1?Math.max(pie(e.l,t,n+1),pie(e.r,t,n+1)):t[e.s]=n},yze=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new vu(++t),r=0,a=e[0],s=1,i=function(c){n[r++]=c},o=1;o<=t;++o)if(e[o]==a&&o!=t)++s;else{if(!a&&s>2){for(;s>138;s-=138)i(32754);s>2&&(i(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(i(a),--s;s>6;s-=6)i(8304);s>2&&(i(s-3<<5|8208),s=0)}for(;s--;)i(a);s=1,a=e[o]}return[n.subarray(0,r),t]},GC=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},hie=function(e,t,n){var r=n.length,a=j1t(t+2);e[a]=255&r,e[a+1]=r>>>8,e[a+2]=255^e[a],e[a+3]=255^e[a+1];for(var s=0;s<r;++s)e[a+s+4]=n[s];return 8*(a+4+r)},bze=function(e,t,n,r,a,s,i,o,c,u,d){vg(t,d++,n),++a[256];for(var f=fee(a,15),p=f[0],h=f[1],m=fee(s,15),g=m[0],v=m[1],b=yze(p),S=b[0],O=b[1],k=yze(g),E=k[0],C=k[1],T=new vu(19),j=0;j<S.length;++j)T[31&S[j]]++;for(j=0;j<E.length;++j)T[31&E[j]]++;for(var A=fee(T,7),I=A[0],P=A[1],M=19;M>4&&!I[gze[M-1]];--M);var F,D,V,H,B=u+5<<3,q=GC(a,Nw)+GC(s,FL)+i,W=GC(a,p)+GC(s,g)+i+14+3*M+GC(T,I)+(2*T[16]+3*T[17]+7*T[18]);if(B<=q&&B<=W)return hie(t,d,e.subarray(c,c+u));if(vg(t,d,1+(W<q)),d+=2,W<q){F=hT(p,h),D=p,V=hT(g,v),H=g;var L=hT(I,P);for(vg(t,d,O-257),vg(t,d+5,C-1),vg(t,d+10,M-4),d+=14,j=0;j<M;++j)vg(t,d+3*j,I[gze[j]]);d+=3*M;for(var Z=[S,E],z=0;z<2;++z){var R=Z[z];for(j=0;j<R.length;++j){var Q=31&R[j];vg(t,d,L[Q]),d+=I[Q],Q>15&&(vg(t,d,R[j]>>>5&127),d+=R[j]>>>12)}}}else F=hSr,D=Nw,V=mSr,H=FL;for(j=0;j<o;++j)if(r[j]>255){Q=r[j]>>>18&31,WC(t,d,F[Q+257]),d+=D[Q+257],Q>7&&(vg(t,d,r[j]>>>23&31),d+=dve[Q]);var G=31&r[j];WC(t,d,V[G]),d+=H[G],G>3&&(WC(t,d,r[j]>>>5&8191),d+=fve[G])}else WC(t,d,F[r[j]]),d+=D[r[j]];return WC(t,d,F[256]),d+D[256]},gSr=new e_([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),vSr=(function(){for(var e=new e_(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),ySr=function(e,t,n,r,a){return(function(s,i,o,c,u,d){var f=s.length,p=new $f(c+f+5*(1+Math.floor(f/7e3))+u),h=p.subarray(c,p.length-u),m=0;if(!i||f<8)for(var g=0;g<=f;g+=65535){var v=g+65535;v<f?m=hie(h,m,s.subarray(g,v)):(h[g]=d,m=hie(h,m,s.subarray(g,f)))}else{for(var b=gSr[i-1],S=b>>>13,O=8191&b,k=(1<<o)-1,E=new vu(32768),C=new vu(k+1),T=Math.ceil(o/3),j=2*T,A=function(fe){return(s[fe]^s[fe+1]<<T^s[fe+2]<<j)&k},I=new e_(25e3),P=new vu(288),M=new vu(32),F=0,D=0,V=(g=0,0),H=0,B=0;g<f;++g){var q=A(g),W=32767&g,L=C[q];if(E[W]=L,C[q]=W,H<=g){var Z=f-g;if((F>7e3||V>24576)&&Z>423){m=bze(s,h,0,I,P,M,D,V,B,g-B,m),V=F=D=0,B=g;for(var z=0;z<286;++z)P[z]=0;for(z=0;z<30;++z)M[z]=0}var R=2,Q=0,G=O,ee=W-L&32767;if(Z>2&&q==A(g-ee))for(var re=Math.min(S,Z)-1,ne=Math.min(32767,g),se=Math.min(258,Z);ee<=ne&&--G&&W!=L;){if(s[g+R]==s[g+R-ee]){for(var oe=0;oe<se&&s[g+oe]==s[g+oe-ee];++oe);if(oe>R){if(R=oe,Q=ee,oe>re)break;var pe=Math.min(ee,oe-2),K=0;for(z=0;z<pe;++z){var ae=g-ee+z+32768&32767,ie=ae-E[ae]+32768&32767;ie>K&&(K=ie,L=ae)}}}ee+=(W=L)-(L=E[W])+32768&32767}if(Q){I[V++]=268435456|fie[R]<<18|vze[Q];var ve=31&fie[R],ye=31&vze[Q];D+=dve[ve]+fve[ye],++P[257+ve],++M[ye],H=g+R,++F}else I[V++]=s[g],++P[s[g]]}}m=bze(s,h,d,I,P,M,D,V,B,g-B,m)}return T1t(p,0,c+j1t(m)+u)})(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)},pee=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function bSr(e,t){t===void 0&&(t={});var n=(function(){var o=4294967295;return{p:function(c){for(var u=o,d=0;d<c.length;++d)u=vSr[255&u^c[d]]^u>>>8;o=u},d:function(){return 4294967295^o}}})(),r=e.length;n.p(e);var a,s=ySr(e,t,10+((a=t).filename&&a.filename.length+1||0),8),i=s.length;return(function(o,c){var u=c.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=c.level<2?4:c.level==9?2:0,o[9]=3,c.mtime!=0&&pee(o,4,Math.floor(new Date(c.mtime||Date.now())/1e3)),u){o[3]=8;for(var d=0;d<=u.length;++d)o[d+10]=u.charCodeAt(d)}})(s,t),pee(s,i-8,n.d()),pee(s,i-4,r),s}var xSr=function(e){var t,n,r,a,s="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,`
508
508
  `).replace(/\r/g,`
509
509
  `)).length,a=0;a<r;a++){var i=e.charCodeAt(a),o=null;i<128?n++: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),uh(o)||(n>t&&(s+=e.substring(t,n)),s+=o,t=n=a+1)}return n>t&&(s+=e.substring(t,e.length)),s},wSr=!!Gse||!!Wse,zL=function(e,t,n){var r;n===void 0&&(n=!0);var[a,s]=e.split("?"),i=Ft({},t),o=(r=s?.split("&").map((u=>{var d,[f,p]=u.split("="),h=n&&(d=i[f])!==null&&d!==void 0?d:p;return delete i[f],f+"="+h})))!==null&&r!==void 0?r:[],c=sSr(i);return c&&o.push(c),a+"?"+o.join("&")},Nj=(e,t)=>JSON.stringify(e,((n,r)=>typeof r=="bigint"?r.toString():r),t),hee=e=>{var{data:t,compression:n}=e;if(t){if(n===Ig.GZipJS){var r=bSr((function(o,c){var u=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var d=new $f(o.length+(o.length>>>1)),f=0,p=function(v){d[f++]=v},h=0;h<u;++h){if(f+5>d.length){var m=new $f(f+8+(u-h<<1));m.set(d),d=m}var g=o.charCodeAt(h);g<128||c?p(g):g<2048?(p(192|g>>>6),p(128|63&g)):g>55295&&g<57344?(p(240|(g=65536+(1047552&g)|1023&o.charCodeAt(++h))>>>18),p(128|g>>>12&63),p(128|g>>>6&63),p(128|63&g)):(p(224|g>>>12),p(128|g>>>6&63),p(128|63&g))}return T1t(d,0,f)})(Nj(t)),{mtime:0});return{contentType:"text/plain",body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Ig.Base64){var a=(function(o){var c,u,d,f,p,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,g=0,v="",b=[];if(!o)return o;o=xSr(o);do c=(p=o.charCodeAt(m++)<<16|o.charCodeAt(m++)<<8|o.charCodeAt(m++))>>18&63,u=p>>12&63,d=p>>6&63,f=63&p,b[g++]=h.charAt(c)+h.charAt(u)+h.charAt(d)+h.charAt(f);while(m<o.length);switch(v=b.join(""),o.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"="}return v})(Nj(t)),s=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Nj(o)))(a);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var i=Nj(t);return{contentType:"application/json",body:i,estimatedSize:new Blob([i]).size}}},f$=[];Wse&&f$.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:a,estimatedSize:s}=(t=hee(e))!==null&&t!==void 0?t:{},i=new Headers;Ps(e.headers,(function(d,f){i.append(f,d)})),r&&i.append("Content-Type",r);var o=e.url,c=null;if(HFe){var u=new HFe;c={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}Wse(o,Ft({method:e?.method||"GET",headers:i,keepalive:e.method==="POST"&&(s||0)<52428.8,body:a,signal:(n=c)==null?void 0:n.signal},e.fetchOptions)).then((d=>d.text().then((f=>{var p={statusCode:d.status,text:f};if(d.status===200)try{p.json=JSON.parse(f)}catch(h){Zt.error(h)}e.callback==null||e.callback(p)})))).catch((d=>{Zt.error(d),e.callback==null||e.callback({statusCode:0,error:d})})).finally((()=>c?clearTimeout(c.timeout):null))}}),Gse&&f$.push({transport:"XHR",method:e=>{var t,n=new Gse;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:a}=(t=hee(e))!==null&&t!==void 0?t:{};Ps(e.headers,(function(s,i){n.setRequestHeader(i,s)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(s)}},n.send(a)}}),fd!=null&&fd.sendBeacon&&f$.push({transport:"sendBeacon",method:e=>{var t=zL(e.url,{beacon:"1"});try{var n,{contentType:r,body:a}=(n=hee(e))!==null&&n!==void 0?n:{},s=typeof a=="string"?new Blob([a],{type:r}):a;fd.sendBeacon(t,s)}catch{}}});var mie=3e3;class SSr{constructor(t,n){this.wt=!0,this.Et=[],this.St=sm(n?.flush_interval_ms||mie,250,5e3,Zt.createLogger("flush interval"),mie),this.xt=t}enqueue(t){this.Et.push(t),this.$t||this.kt()}unload(){this.Pt();var t=this.Et.length>0?this.Tt():{},n=Object.values(t);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.xt(Ft({},r,{transport:"sendBeacon"}))}))}enable(){this.wt=!1,this.kt()}kt(){var t=this;this.wt||(this.$t=setTimeout((()=>{if(this.Pt(),this.Et.length>0){var n=this.Tt(),r=function(){var s=n[a],i=new Date().getTime();s.data&&Aa(s.data)&&Ps(s.data,(o=>{o.offset=Math.abs(o.timestamp-i),delete o.timestamp})),t.xt(s)};for(var a in n)r()}}),this.St))}Pt(){clearTimeout(this.$t),this.$t=void 0}Tt(){var t={};return Ps(this.Et,(n=>{var r,a=n,s=(a?a.batchKey:null)||a.url;Wt(t[s])&&(t[s]=Ft({},a,{data:[]})),(r=t[s].data)==null||r.push(a.data)})),this.Et=[],t}}var OSr=["retriesPerformedSoFar"];class kSr{constructor(t){this.Rt=!1,this.It=3e3,this.Et=[],this._instance=t,this.Et=[],this.Ct=!0,!Wt(Ye)&&"onLine"in Ye.navigator&&(this.Ct=Ye.navigator.onLine,this.Ot=()=>{this.Ct=!0,this.Ft()},this.Mt=()=>{this.Ct=!1},io(Ye,"online",this.Ot),io(Ye,"offline",this.Mt))}get length(){return this.Et.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=FSt(t,OSr);M1(n)&&(r.url=zL(r.url,{retry_count:n})),this._instance._send_request(Ft({},r,{callback:a=>{a.statusCode!==200&&(a.statusCode<400||a.statusCode>=500)&&(n??0)<10?this.At(Ft({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(a)}}))}At(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=(function(i){var o=3e3*Math.pow(2,i),c=o/2,u=Math.min(18e5,o),d=(Math.random()-.5)*(u-c);return Math.ceil(u+d)})(n),a=Date.now()+r;this.Et.push({retryAt:a,requestOptions:t});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),Zt.warn(s),this.Rt||(this.Rt=!0,this.Dt())}Dt(){if(this.Lt&&clearTimeout(this.Lt),this.Et.length===0)return this.Rt=!1,void(this.Lt=void 0);this.Lt=setTimeout((()=>{this.Ct&&this.Et.length>0&&this.Ft(),this.Dt()}),this.It)}Ft(){var t=Date.now(),n=[],r=this.Et.filter((s=>s.retryAt<t||(n.push(s),!1)));if(this.Et=n,r.length>0)for(var{requestOptions:a}of r)this.retriableRequest(a)}unload(){for(var{requestOptions:t}of(this.Lt&&(clearTimeout(this.Lt),this.Lt=void 0),this.Rt=!1,Wt(Ye)||(this.Ot&&(Ye.removeEventListener("online",this.Ot),this.Ot=void 0),this.Mt&&(Ye.removeEventListener("offline",this.Mt),this.Mt=void 0)),this.Et))try{this._instance._send_request(Ft({},t,{transport:"sendBeacon"}))}catch(n){Zt.error(n)}this.Et=[]}}class _Sr{constructor(t){this.jt=()=>{var n,r,a,s;this.Nt||(this.Nt={});var i=this.scrollElement(),o=this.scrollY(),c=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=o+(i?.clientHeight||0),d=i?.scrollHeight||0;this.Nt.lastScrollY=Math.ceil(o),this.Nt.maxScrollY=Math.max(o,(n=this.Nt.maxScrollY)!==null&&n!==void 0?n:0),this.Nt.maxScrollHeight=Math.max(c,(r=this.Nt.maxScrollHeight)!==null&&r!==void 0?r:0),this.Nt.lastContentY=u,this.Nt.maxContentY=Math.max(u,(a=this.Nt.maxContentY)!==null&&a!==void 0?a:0),this.Nt.maxContentHeight=Math.max(d,(s=this.Nt.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=t}getContext(){return this.Nt}resetContext(){var t=this.Nt;return setTimeout(this.jt,0),t}startMeasuringScrollPosition(){io(Ye,"scroll",this.jt,{capture:!0}),io(Ye,"scrollend",this.jt,{capture:!0}),io(Ye,"resize",this.jt)}scrollElement(){if(!this._instance.config.scroll_root_selector)return Ye?.document.documentElement;var t=Aa(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of t){var r=Ye?.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Ye&&(Ye.scrollY||Ye.pageYOffset||Ye.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Ye&&(Ye.scrollX||Ye.pageXOffset||Ye.document.documentElement.scrollLeft)||0}}var ESr=e=>w1t(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties);class xze{constructor(t,n,r,a){this.Ut=s=>{var i=this.zt();if(!i||i.sessionId!==s){var o={sessionId:s,props:this.Ht(this._instance)};this.Bt.register({[oie]:o})}},this._instance=t,this.qt=n,this.Bt=r,this.Ht=a||ESr,this.qt.onSessionId(this.Ut)}zt(){return this.Bt.props[oie]}getSetOnceProps(){var t,n=(t=this.zt())==null?void 0:t.props;return n?"r"in n?S1t(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return Ps(uve(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+Zse(r)]=n})),t}}class pve{constructor(){this.Vt={},this.Vt={}}on(t,n){return this.Vt[t]||(this.Vt[t]=[]),this.Vt[t].push(n),()=>{this.Vt[t]=this.Vt[t].filter((r=>r!==n))}}emit(t,n){for(var r of this.Vt[t]||[])r(n);for(var a of this.Vt["*"]||[])a(t,n)}}var mee=yi("[SessionId]");class wze{on(t,n){return this.Wt.on(t,n)}constructor(t,n,r){var a;if(this.Gt=[],this.Yt=void 0,this.Wt=new pve,this.Jt=(d,f)=>!(!M1(d)||!M1(f))&&Math.abs(d-f)>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.N=t.config,this.Bt=t.persistence,this.Kt=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Qt=n||Wy,this.Zt=r||Wy;var s=this.N.persistence_name||this.N.token,i=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*sm(i,60,36e3,mee.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ti(),this.ii="ph_"+s+"_window_id",this.ei="ph_"+s+"_primary_window_exists",this.ri()){var o=yl.D(this.ii),c=yl.D(this.ei);o&&!c?this.Kt=o:yl.j(this.ii),yl.L(this.ei,!0)}if((a=this.N.bootstrap)!=null&&a.sessionID)try{var u=(d=>{var f=d.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.N.bootstrap.sessionID);this.si(this.N.bootstrap.sessionID,new Date().getTime(),u)}catch(d){mee.error("Invalid sessionID in bootstrap",d)}this.ni()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Wt(this.Gt)&&(this.Gt=[]),this.Gt.push(t),this.Xt&&t(this.Xt,this.Kt),()=>{this.Gt=this.Gt.filter((n=>n!==t))}}ri(){return this.N.persistence!=="memory"&&!this.Bt.st&&yl.F()}oi(t){t!==this.Kt&&(this.Kt=t,this.ri()&&yl.L(this.ii,t))}ai(){return this.Kt?this.Kt:this.ri()?yl.D(this.ii):null}si(t,n,r){t===this.Xt&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Xt=t,this.Bt.register({[AL]:[n,t,r]}))}li(){var t=this.Bt.props[AL];return Aa(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.si(null,null,null)}destroy(){clearTimeout(this.ui),this.ui=void 0,this.Yt&&Ye&&(Ye.removeEventListener("beforeunload",this.Yt,{capture:!1}),this.Yt=void 0),this.Gt=[]}ni(){this.Yt=()=>{this.ri()&&yl.j(this.ei)},io(Ye,"beforeunload",this.Yt,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.N.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[a,s,i]=this.li(),o=this.ai(),c=M1(i)&&Math.abs(r-i)>864e5,u=!1,d=!s,f=!d&&!t&&this.Jt(r,a);d||f||c?(s=this.Qt(),o=this.Zt(),mee.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}}),i=r,u=!0):o||(o=this.Zt(),u=!0);var p=M1(a)&&t&&!c?a:r,h=M1(i)?i:new Date().getTime();return this.oi(o),this.si(s,p,h),t||this.ti(),u&&this.Gt.forEach((m=>m(s,o,u?{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}:void 0))),{sessionId:s,windowId:o,sessionStartTimestamp:h,changeReason:u?{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:a}}ti(){clearTimeout(this.ui),this.ui=setTimeout((()=>{var[t]=this.li();if(this.Jt(new Date().getTime(),t)){var n=this.Xt;this.resetSessionId(),this.Wt.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}}var N1t=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&GFe(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((a=>GFe(a?.brand,t))))return!0}catch{}return!!e.webdriver},BL=function(e,t){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function Sze(e,t,n){return Nj({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var A1t={exact:(e,t)=>t.some((n=>e.some((r=>n===r)))),is_not:(e,t)=>t.every((n=>e.every((r=>n!==r)))),regex:(e,t)=>t.some((n=>e.some((r=>BL(n,r))))),not_regex:(e,t)=>t.every((n=>e.every((r=>!BL(n,r))))),icontains:(e,t)=>t.map(mD).some((n=>e.map(mD).some((r=>n.includes(r))))),not_icontains:(e,t)=>t.map(mD).every((n=>e.map(mD).every((r=>!n.includes(r))))),gt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((a=>r>parseFloat(a)))})),lt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((a=>r<parseFloat(a)))}))},mD=e=>e.toLowerCase();function I1t(e,t){return!e||Object.entries(e).every((n=>{var[r,a]=n,s=t?.[r];if(Wt(s)||uh(s))return!1;var i=[String(s)],o=A1t[a.operator];return!!o&&o(a.values,i)}))}var Aj=(function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e})({}),Oze="i.posthog.com";class CSr{constructor(t){this.hi={},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,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+Oze,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.hi[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hi[this.apiHost]=Aj.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hi[this.apiHost]=Aj.EU:this.hi[this.apiHost]=Aj.CUSTOM),this.hi[this.apiHost]}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(this.region===Aj.CUSTOM)return this.apiHost+n;var r=Oze+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var vs=yi("[Surveys]"),R1t="seenSurvey_",jSr=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n},kze=e=>((t,n)=>{var r=""+t+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+t+n.id+"_"+n.current_iteration),r})(R1t,e),TSr=[uee.Popover,uee.Widget,uee.API],NSr={ignoreConditions:!1,ignoreDelay:!1,displayType:die.Popover},ASr=yi("[PostHog ExternalIntegrations]"),ISr={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class RSr{constructor(t){this._instance=t}G(t,n){var r;(r=zn.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,(a=>{if(a)return ASr.error("failed to load script",a);n()}))}startIfEnabledOrStop(){var t=this,n=function(i){var o,c,u;!a||(o=zn.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[i]||t.G(ISr[i],(()=>{var d;(d=zn.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[i])==null||d.start(t._instance)})),!a&&(c=zn.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[i]&&((u=zn.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[i])==null||u.stop())};for(var[r,a]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var mT={},gee=0,gie=()=>{},D1="posthog",P1t=!wSr&&Kc?.indexOf("MSIE")===-1&&Kc?.indexOf("Mozilla")===-1,_ze=e=>{var t;return Ft({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Hwr(qt?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:gie,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:xl&&uo(xl?.search)&&xl.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_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(Ye==null||(t=Ye.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_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;Zt.error(r)},get_device_id:n=>n,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:mie},error_tracking:{},_onCapture:gie,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},Eze=e=>{var t={};Wt(e.process_person)||(t.person_profiles=e.process_person),Wt(e.xhr_headers)||(t.request_headers=e.xhr_headers),Wt(e.cookie_name)||(t.persistence_name=e.cookie_name),Wt(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),Wt(e.store_google)||(t.save_campaign_params=e.store_google),Wt(e.verbose)||(t.debug=e.verbose);var n=Vi({},t,e);return Aa(e.property_blacklist)&&(Wt(e.property_denylist)?n.property_denylist=e.property_blacklist:Aa(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:Zt.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class PSr{constructor(){this.__forceAllowLocalhost=!1}get di(){return this.__forceAllowLocalhost}set di(t){Zt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Wh{vi(t,n){if(t){var r=this.ci.indexOf(t);r!==-1&&this.ci.splice(r,1)}return this.ci.push(n),n.initialize==null||n.initialize(),n}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new PSr,this.fi=!1,this.version=hf.LIB_VERSION,this.pi=new pve,this.ci=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=_ze(),this.SentryIntegration=aSr,this.sentryIntegration=r=>(function(a,s){var i=g1t(a,s);return{name:m1t,processEvent:o=>i(o)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.gi=!1,this.mi=null,this.bi=null,this.yi=null,this.scrollManager=new _Sr(this),this.pageViewManager=new fze(this),this.rateLimiter=new fSr(this),this.requestRouter=new CSr(this),this.consent=new eSr(this),this.externalIntegrations=new RSr(this);var n=(t=Wh.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,a,s)=>{var i=uo(r)?{[r]:a}:r;this.setPersonProperties(i),s?.({})},set_once:(r,a,s)=>{var i=uo(r)?{[r]:a}:r;this.setPersonProperties(void 0,i),s?.({})}},this.on("eventCaptured",(r=>Zt.info('send "'+r?.event+'"',r)))}init(t,n,r){if(r&&r!==D1){var a,s=(a=mT[r])!==null&&a!==void 0?a:new Wh;return s._init(t,n,r),mT[r]=s,mT[D1][r]=s,s}return this._init(t,n,r)}_init(t,n,r){var a;if(n===void 0&&(n={}),Wt(t)||Yse(t))return Zt.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={},n.debug=this.wi(n.debug),this.Ei=n,this.Si=[],n.person_profiles?this.bi=n.person_profiles:n.process_person&&(this.bi=n.process_person),this.set_config(Vi({},_ze(n.defaults),Eze(n),{name:r,token:t})),this.config.on_xhr_error&&Zt.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Ig.GZipJS;var s=this.xi();this.persistence=new cee(this.config,s),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new cee(Ft({},this.config,{persistence:"sessionStorage"}),s);var i=Ft({},this.persistence.props),o=Ft({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.$i=new SSr((m=>this.ki(m)),this.config.request_queue_config),this.Pi=new kSr(this),this.__request_queue=[];var c=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(c||(this.sessionManager=new wze(this),this.sessionPropsManager=new xze(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Zt.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Ti(c)}),0)):(Zt.info("Initializing extensions synchronously"),this.Ti(c)),hf.DEBUG=hf.DEBUG||this.config.debug,hf.DEBUG&&Zt.info("Starting in debug mode",{this:this,config:n,thisC:Ft({},this.config),p:i,s:o}),((a=n.bootstrap)==null?void 0:a.distinctID)!==void 0){var u,d,f=this.config.get_device_id(Wy()),p=(u=n.bootstrap)!=null&&u.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(Ph,(d=n.bootstrap)!=null&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:p})}if(c)this.register_once({distinct_id:VC,$device_id:null},"");else if(!this.get_distinct_id()){var h=this.config.get_device_id(Wy());this.register_once({distinct_id:h,$device_id:h},""),this.persistence.set_property(Ph,"anonymous")}return io(Ye,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?rSr(this,(()=>this.Ri())):this.Ri(),Fg(this.config._onCapture)&&this.config._onCapture!==gie&&(Zt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(m=>this.config._onCapture(m.event,m)))),this.config.ip&&Zt.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}Ti(t){var n,r,a,s,i,o,c,u=performance.now(),d=Ft({},Wh.__defaultExtensionClasses,this.config.__extensionClasses),f=[];d.featureFlags&&this.ci.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new d.featureFlags(this)),d.exceptions&&this.ci.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new d.exceptions(this)),d.historyAutocapture&&this.ci.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.ci.push(new d.tracingHeaders(this)),d.siteApps&&this.ci.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!t&&this.ci.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||f.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this.ci.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.ci.push(this.surveys=(a=this.surveys)!==null&&a!==void 0?a:new d.surveys(this)),d.logs&&this.ci.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new d.logs(this)),d.conversations&&this.ci.push(this.conversations=(i=this.conversations)!==null&&i!==void 0?i:new d.conversations(this)),d.productTours&&this.ci.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.ci.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.ci.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.ci.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.ci.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,nSr)),d.toolbar&&this.ci.push(this.toolbar=(o=this.toolbar)!==null&&o!==void 0?o:new d.toolbar(this)),d.experiments&&this.ci.push(this.experiments=(c=this.experiments)!==null&&c!==void 0?c:new d.experiments(this)),this.ci.forEach((p=>{p.initialize&&f.push((()=>{p.initialize==null||p.initialize()}))})),f.push((()=>{if(this.Ii){var p=this.Ii;this.Ii=void 0,this.ft(p)}})),this.Ci(f,u)}Ci(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout((()=>{this.Ci(t,n)}),0);var r=t.shift();if(r)try{r()}catch(s){Zt.error("Error initializing extension:",s)}}var a=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:a}),this.config.__preview_deferred_init_extensions&&Zt.info("PostHog extensions initialized ("+a+"ms)")}ft(t){var n;if(!qt||!qt.body)return Zt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.ft(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Ii=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Wr(t.supportedCompression,Ig.GZipJS)?Ig.GZipJS:Wr(t.supportedCompression,Ig.Base64)?Ig.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.bi?this.bi:"identified_only"}),this.ci.forEach((r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(t)))}Ri(){try{this.config.loaded(this)}catch(r){Zt.critical("`loaded` function failed",r)}if(this.Oi(),this.config.internal_or_test_user_hostname&&xl!=null&&xl.hostname){var t=xl.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Fi()}),1),this.Mi=new k1t(this),this.Mi.load()}Oi(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.$i)==null||t.enable())}_dom_loaded(){this.is_capturing()&&cb(this.__request_queue,(t=>this.ki(t))),this.__request_queue=[],this.Oi()}_handle_unload(){var t,n,r;(t=this.surveys)==null||t.handlePageUnload(),this.config.request_batching?(this.Ai()&&this.capture("$pageleave"),(n=this.$i)==null||n.unload(),(r=this.Pi)==null||r.unload()):this.Ai()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(P1t?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=zL(t.url,{ip:this.config.ip?1:0}),t.headers=Ft({},this.config.request_headers,t.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,(n=>{var r,a,s,i=Ft({},n);i.timeout=i.timeout||6e4,i.url=zL(i.url,{_:new Date().getTime().toString(),ver:hf.JS_SDK_VERSION,compression:i.compression});var o=(r=i.transport)!==null&&r!==void 0?r:"fetch",c=f$.filter((d=>!i.disableTransport||!d.transport||!i.disableTransport.includes(d.transport))),u=(a=(s=l1t(c,(d=>d.transport===o)))==null?void 0:s.method)!==null&&a!==void 0?a:c[0].method;if(!u)throw new Error("No available transport method");u(i)})(Ft({},t,{callback:n=>{var r,a;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(a=this.config).on_request_error)==null||r.call(a,n)),t.callback==null||t.callback(n)}}))))}ki(t){this.Pi?this.Pi.retriableRequest(t):this._send_request(t)}_execute_array(t){gee++;try{var n,r=[],a=[],s=[];cb(t,(o=>{o&&(n=o[0],Aa(n)?s.push(o):Fg(o)?o.call(this):Aa(o)&&n==="alias"?r.push(o):Aa(o)&&n.indexOf("capture")!==-1&&Fg(this[n])?s.push(o):a.push(o))}));var i=function(o,c){cb(o,(function(u){if(Aa(u[0])){var d=c;Ps(u,(function(f){d=d[f[0]].apply(d,f.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),c)};i(r,this),i(a,this),i(s,this)}finally{gee--}}push(t){if(gee>0&&Aa(t)&&uo(t[0])){var n=Wh.prototype[t[0]];Fg(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!Wt(t)&&uo(t)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var i=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){n!=null&&n.$current_url&&!uo(n?.$current_url)&&(Zt.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.Di||Zt.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),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,c=r?.timestamp||o,u=Wy(),d={uuid:u,event:t,properties:this.calculateEventProperties(t,n||{},c,u)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&s&&(d.event="$bot_pageview",d.properties.$browser_type="bot"),i&&(d.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),r?.$set&&(d.$set=r?.$set);var f,p=t!=="$groupidentify",h=this.Li(r?.$set_once,p);if(h&&(d.$set_once=h),(d=Vwr(d,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=c,Wt(r?.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=o),t===Tj.DISMISSED||t===Tj.SENT){var m=n?.[dee.SURVEY_ID],g=n?.[dee.SURVEY_ITERATION];f={id:m,current_iteration:g},localStorage.getItem(kze(f))||localStorage.setItem(kze(f),"true"),d.$set=Ft({},d.$set,{[jSr({id:m,current_iteration:g},t===Tj.SENT?"responded":"dismissed")]:!0})}else t===Tj.SHOWN&&(d.$set=Ft({},d.$set,{[dee.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===dSr.SHOWN){var v=n?.[hze.TOUR_TYPE];v&&(d.$set=Ft({},d.$set,{[hze.TOUR_LAST_SEEN_DATE+"/"+v]:new Date().toISOString()}))}var b=Ft({},d.properties.$set,d.$set);if(nO(b)||this.setPersonPropertiesForFlags(b),!ra(this.config.before_send)){var S=this.ji(d);if(!S)return;d=S}this.pi.emit("eventCaptured",d);var O={method:"POST",url:(a=r?._url)!==null&&a!==void 0?a:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:d,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.ki(O):this.$i.enqueue(O),d}Zt.critical("This capture call is ignored due to client rate limiting.")}}else Zt.error("No event name provided to posthog.capture")}else Zt.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(n=>t(n.event,n)))}calculateEventProperties(t,n,r,a,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var i=s?void 0:this.persistence.remove_event_timer(t),o=Ft({},n);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 c=Ft({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=c.distinct_id,(!uo(o.distinct_id)&&!Cm(o.distinct_id)||Yse(o.distinct_id))&&Zt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,d=cSr(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:p}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());o.$session_id=f,o.$window_id=p}this.sessionPropsManager&&Vi(o,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&Vi(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(h=this.Pi)==null?void 0:h.length}catch(b){o.$sdk_debug_error_capturing_properties=String(b)}if(this.requestRouter.region===Aj.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),u=t!=="$pageview"||s?t!=="$pageleave"||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,a),o=Vi(o,u),t==="$pageview"&&qt&&(o.title=qt.title),!Wt(i)){var m=r.getTime()-i;o.$duration=parseFloat((m/1e3).toFixed(3))}Kc&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=Vi({},d,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),Aa(this.config.property_denylist)?Ps(this.config.property_denylist,(function(b){delete o[b]})):Zt.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&&(Zt.error("sanitize_properties is deprecated. Use before_send instead"),o=g(o,t));var v=this.Ni();return o.$process_person_profile=v,v&&!s&&this.Ui("_calculate_event_properties"),o}Li(t,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.Ni()||this.fi)return t;var a=this.persistence.get_initial_props(),s=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),i=Vi({},a,s||{},t||{}),o=this.config.sanitize_properties;return o&&(Zt.error("sanitize_properties is deprecated. Use before_send instead"),i=o(i,"$set_once")),n&&(this.fi=!0),nO(i)?void 0:i}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var a;(a=this.persistence)==null||a.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}zi(t,n){this.register({[t]:n})}getFeatureFlag(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(t,n)}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,n,r){var a;(a=this.featureFlags)==null||a.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var a;(a=this.featureFlags)==null||a.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var a;return n===void 0&&(n=!1),(a=this.featureFlags)==null?void 0:a.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.pi.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:"Surveys module not available"}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:"Surveys module not available"})}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:"Surveys module not available"})}renderSurvey(t,n){var r;(r=this.surveys)==null||r.renderSurvey(t,n)}displaySurvey(t,n){var r;n===void 0&&(n=NSr),(r=this.surveys)==null||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)==null||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:"Surveys module not available"}}canRenderSurveyAsync(t,n){var r,a;return n===void 0&&(n=!1),(r=(a=this.surveys)==null?void 0:a.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:"Surveys module not available"})}identify(t,n,r){if(!this.__loaded||!this.persistence)return Zt.uninitializedWarning("posthog.identify");if(Cm(t)&&(t=t.toString(),Zt.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()))Zt.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!==VC){if(this.Ui("posthog.identify")){var a=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==a&&t!==this.get_property(_j)&&(this.unregister(_j),this.register({distinct_id:t}));var i,o=(this.persistence.get_property(Ph)||"anonymous")==="anonymous";t!==a&&o?(this.persistence.set_property(Ph,"identified"),this.setPersonPropertiesForFlags(Ft({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:a},{$set:n||{},$set_once:r||{}}),this.yi=Sze(t,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(a)):(n||r)&&this.setPersonProperties(n,r),t!==a&&(this.reloadFeatureFlags(),this.unregister(pT))}}else Zt.critical('The string "'+VC+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Zt.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this.Ui("posthog.setPersonProperties")){var r=Sze(this.get_distinct_id(),t,n);this.yi!==r?(this.setPersonPropertiesForFlags(Ft({},n||{},t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.yi=r):Zt.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var a=this.getGroups();a[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:Ft({},a,{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),a[t]===n||r||this.reloadFeatureFlags()}else Zt.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){var t;(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),this.Ui("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(t)}reset(t){var n,r,a,s,i,o,c;if(Zt.info("reset"),!this.__loaded)return Zt.uninitializedWarning("posthog.reset");var u=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),(a=this.surveys)==null||a.reset(),(s=this.Mi)==null||s.stop(),(i=this.featureFlags)==null||i.reset(),(o=this.persistence)==null||o.set_property(Ph,"anonymous"),(c=this.sessionManager)==null||c.resetSessionId(),this.yi=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:VC,$device_id:null},"");else{var d=this.config.get_device_id(Wy());this.register_once({distinct_id:d,$device_id:t?d:u},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),this.reloadFeatureFlags()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),a=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var s,i=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return a;a+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-i,0)}return a}alias(t,n){return t===this.get_property(u1t)?(Zt.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ui("posthog.alias")?(Wt(n)&&(n=this.get_distinct_id()),t!==n?(this.zi(_j,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(Zt.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=Ft({},this.config);if(Mo(t)){var r,a,s,i,o,c,u,d,f;Vi(this.config,Eze(t));var p=this.xi();(r=this.persistence)==null||r.update_config(this.config,n,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new cee(Ft({},this.config,{persistence:"sessionStorage"}),p);var h=this.wi(this.config.debug);Zg(h)&&(this.config.debug=h),Zg(this.config.debug)&&(this.config.debug?(hf.DEBUG=!0,di.F()&&di.L("ph_debug",!0),Zt.info("set_config",{config:t,oldConfig:n,newConfig:Ft({},this.config)})):(hf.DEBUG=!1,di.F()&&di.j("ph_debug"))),(a=this.exceptionObserver)==null||a.onConfigChange(),(s=this.sessionRecording)==null||s.startIfEnabledOrStop(),(i=this.autocapture)==null||i.startIfEnabled(),(o=this.heatmaps)==null||o.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),(d=this.surveys)==null||d.loadIfEnabled(),this.Hi(),(f=this.externalIntegrations)==null||f.startIfEnabledOrStop()}}_overrideSDKInfo(t,n){hf.LIB_NAME=t,hf.LIB_VERSION=n}startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var a,s,i,o,c;(a=this.sessionManager)==null||a.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)==null||s.overrideSampling()),r.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),r.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),r.event_trigger&&((c=this.sessionRecording)==null||c.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,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),a=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(Ft({},a,n))}}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:D1;return n!==D1&&(n=D1+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(Ph))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Ph))==="identified"}Ni(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&nO(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[_j])&&((n=this.persistence)==null||(n=n.props)==null||!n[PL]))}Ai(){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.Ni()||this.Ui("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Ui("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Ui(t){return this.config.person_profiles==="never"?(Zt.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.zi(PL,!0),!0)}xi(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||t&&!!n}Hi(){var t,n,r,a,s=this.xi();return((t=this.persistence)==null?void 0:t.st)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.st)!==s&&((a=this.sessionPersistence)==null||a.set_disabled(s)),s}opt_in_capturing(t){var n;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var r,a,s,i,o;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(a=this.pageViewManager)==null||a.destroy(),this.sessionManager=new wze(this),this.pageViewManager=new fze(this),this.persistence&&(this.sessionPropsManager=new xze(this,this.sessionManager,this.persistence));var c=(s=(i=this.config.__extensionClasses)==null?void 0:i.sessionRecording)!==null&&s!==void 0?s:(o=Wh.__defaultExtensionClasses)==null?void 0:o.sessionRecording;c&&(this.sessionRecording=this.vi(this.sessionRecording,new c(this)))}var u,d;this.consent.optInOut(!0),this.Hi(),this.Oi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((u=this.surveys)==null||u.loadIfEnabled()),(Wt(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((d=t?.captureEventName)!==null&&d!==void 0?d:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Fi()}else Zt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Hi(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:VC,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.Fi())):Zt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===_g.GRANTED?"granted":t===_g.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Hi()}_is_bot(){return fd?N1t(fd,this.config.custom_blocked_useragents):void 0}Fi(){qt&&(qt.visibilityState==="visible"?this.gi||(this.gi=!0,this.capture("$pageview",{title:qt.title},{send_instantly:!0}),this.mi&&(qt.removeEventListener("visibilitychange",this.mi),this.mi=null)):this.mi||(this.mi=this.Fi.bind(this),io(qt,"visibilitychange",this.mi)))}debug(t){t===!1?(Ye?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(Ye?.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}))}bt(){var t,n,r,a,s,i,o,c=this.Ei||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Zt.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):(r="advanced_disable_decide",a=!1,s=Zt,i=(n="advanced_disable_flags")in(t=c)&&!ra(t[n]),o=r in t&&!ra(t[r]),i?t[n]:o?(s&&s.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]):a)}ji(t){if(ra(this.config.before_send))return t;var n=Aa(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var a of n){if(r=a(r),ra(r)){var s="Event '"+t.event+"' was rejected in beforeSend function";return iwr(t.event)?Zt.warn(s+". This can cause unexpected behavior."):Zt.info(s),null}r.properties&&!nO(r.properties)||Zt.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.K)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}wi(t){var n=Zg(t)&&!t,r=di.F()&&di.A("ph_debug")==="true";return!n&&(!!r||t)}}Wh.__defaultExtensionClasses={},(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Uwr(e.prototype[t[n]])})(Wh,["identify"]);function Cze(e){return e instanceof Element&&(e.id===p1t||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function w9(e){return!!e&&e.nodeType===1}function ub(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function M1t(e){return!!e&&e.nodeType===3}function D1t(e){return!!e&&e.nodeType===11}function hve(e){return e?b9(e).split(/\s+/):[]}function jze(e){var t=Ye?.location.href;return!!(t&&e&&e.some((n=>t.match(n))))}function UL(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 hve(t)}function $1t(e){return ra(e)?null:b9(e).split(/(\s+)/).filter((t=>PA(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function qR(e){var t="";return vie(e)&&!B1t(e)&&e.childNodes&&e.childNodes.length&&Ps(e.childNodes,(function(n){var r;M1t(n)&&n.textContent&&(t+=(r=$1t(n.textContent))!==null&&r!==void 0?r:"")})),b9(t)}function Tze(e){return Wt(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var mve=["a","button","form","input","select","textarea","label"];function L1t(e,t){if(Wt(t))return!0;var n,r=function(s){if(t.some((i=>s.matches(i))))return{v:!0}};for(var a of e)if(n=r(a))return n.v;return!1}function F1t(e){var t=e.parentNode;return!(!t||!w9(t))&&t}var MSr=["next","previous","prev",">","<"],Nze=10,Aze=[".ph-no-rageclick",".ph-no-capture"];function DSr(e,t){if(!Ye||gve(e))return!1;var n,r,a;if(Zg(t)?(n=!!t&&Aze,r=void 0):(n=(a=t?.css_selector_ignorelist)!==null&&a!==void 0?a:Aze,r=t?.content_ignorelist),n===!1)return!1;var{targetElementList:s}=z1t(e,!1);return!(function(i,o){if(i===!1||Wt(i))return!1;var c;if(i===!0)c=MSr;else{if(!Aa(i))return!1;if(i.length>Nze)return Zt.error("[PostHog] content_ignorelist array cannot exceed "+Nze+" items. Use css_selector_ignorelist for more complex matching."),!1;c=i.map((u=>u.toLowerCase()))}return o.some((u=>{var{safeText:d,ariaLabel:f}=u;return c.some((p=>d.includes(p)||f.includes(p)))}))})(r,s.map((i=>{var o;return{safeText:qR(i).toLowerCase(),ariaLabel:((o=i.getAttribute("aria-label"))==null?void 0:o.toLowerCase().trim())||""}})))&&!L1t(s,n)}var gve=e=>!e||ub(e,"html")||!w9(e),z1t=(e,t)=>{if(!Ye||gve(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],a=e;a.parentNode&&!ub(a,"body");)if(D1t(a.parentNode))r.push(a.parentNode.host),a=a.parentNode.host;else{var s=F1t(a);if(!s)break;if(t||mve.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var i=Ye.getComputedStyle(s);i&&i.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),a=s}return{parentIsUsefulElement:n,targetElementList:r}};function $Sr(e,t,n,r,a){var s,i,o,c;if(n===void 0&&(n=void 0),!Ye||gve(e)||(s=n)!=null&&s.url_allowlist&&!jze(n.url_allowlist)||(i=n)!=null&&i.url_ignorelist&&jze(n.url_ignorelist))return!1;if((o=n)!=null&&o.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((m=>t.type===m)))return!1}var{parentIsUsefulElement:d,targetElementList:f}=z1t(e,r);if(!(function(m,g){var v=g?.element_allowlist;if(Wt(v))return!0;var b,S=function(k){if(v.some((E=>k.tagName.toLowerCase()===E)))return{v:!0}};for(var O of m)if(b=S(O))return b.v;return!1})(f,n)||!L1t(f,(c=n)==null?void 0:c.css_selector_allowlist))return!1;var p=Ye.getComputedStyle(e);if(p&&p.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(a||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(a||["change","click"]).indexOf(t.type)>=0;default:return d?(a||["click"]).indexOf(t.type)>=0:(a||["click"]).indexOf(t.type)>=0&&(mve.indexOf(h)>-1||e.getAttribute("contenteditable")==="true")}}function vie(e){for(var t=e;t.parentNode&&!ub(t,"body");t=t.parentNode){var n=UL(t);if(Wr(n,"ph-sensitive")||Wr(n,"ph-no-capture"))return!1}if(Wr(UL(e),"ph-include"))return!0;var r=e.type||"";if(uo(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var a=e.name||e.id||"";return!(uo(a)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,"")))}function B1t(e){return!!(ub(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ub(e,"select")||ub(e,"textarea")||e.getAttribute("contenteditable")==="true")}var U1t="(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})",LSr=new RegExp("^(?:"+U1t+")$"),FSr=new RegExp(U1t),V1t="\\d{3}-?\\d{2}-?\\d{4}",zSr=new RegExp("^("+V1t+")$"),BSr=new RegExp("("+V1t+")");function PA(e,t){return t===void 0&&(t=!0),!(ra(e)||uo(e)&&(e=b9(e),(t?LSr:FSr).test((e||"").replace(/[- ]/g,""))||(t?zSr:BSr).test(e)))}function q1t(e){var t=qR(e);return PA(t=(t+" "+H1t(e)).trim())?t:""}function H1t(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Ps(e.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var a=qR(n);t=(t+" "+a).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+H1t(n)).trim())}catch(s){Zt.error("[AutoCapture]",s)}})),t}function USr(e){return(function(t){var n=t.map((r=>{var a,s,i="";if(r.tag_name&&(i+=r.tag_name),r.attr_class)for(var o of(r.attr_class.sort(),r.attr_class))i+="."+o.replace(/"/g,"");var c=Ft({},r.text?{text:r.text}:{},{"nth-child":(a=r.nth_child)!==null&&a!==void 0?a:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return d$(c).sort(((d,f)=>{var[p]=d,[h]=f;return p.localeCompare(h)})).forEach((d=>{var[f,p]=d;return u[Ize(f.toString())]=Ize(p.toString())})),i+=":",i+=d$(u).map((d=>{var[f,p]=d;return f+'="'+p+'"'})).join("")}));return n.join(";")})((function(t){return t.map((n=>{var r,a,s={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(a=n.attr__href)==null?void 0:a.slice(0,2048),attr_class:VSr(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return d$(n).filter((i=>{var[o]=i;return o.indexOf("attr__")===0})).forEach((i=>{var[o,c]=i;return s.attributes[o]=c})),s}))})(e))}function Ize(e){return e.replace(/"|\\"/g,'\\"')}function VSr(e){var t=e.attr__class;return t?Aa(t)?t:hve(t):void 0}class Rze{constructor(t){this.disabled=t===!1;var n=Mo(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var a=this.clicks[this.clicks.length-1];if(a&&Math.abs(t-a.x)+Math.abs(n-a.y)<this.thresholdPx&&r-a.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var vee="$copy_autocapture",Pze=yi("[AutoCapture]");function yee(e,t){return t.length>e?t.slice(0,e)+"...":t}function qSr(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!w9(t));return t}function HSr(e,t,n,r){var a=e.tagName.toLowerCase(),s={tag_name:a};mve.indexOf(a)>-1&&!n&&(a.toLowerCase()==="a"||a.toLowerCase()==="button"?s.$el_text=yee(1024,q1t(e)):s.$el_text=yee(1024,qR(e)));var i=UL(e);i.length>0&&(s.classes=i.filter((function(d){return d!==""}))),Ps(e.attributes,(function(d){var f;if((!B1t(e)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(r==null||!r.includes(d.name))&&!t&&PA(d.value)&&(f=d.name,!uo(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var p=d.value;d.name==="class"&&(p=hve(p).join(" ")),s["attr__"+d.name]=yee(1024,p)}}));for(var o=1,c=1,u=e;u=qSr(u);)o++,u.tagName===e.tagName&&c++;return s.nth_child=o,s.nth_of_type=c,s}function QSr(e,t){for(var n,r,{e:a,maskAllElementAttributes:s,maskAllText:i,elementAttributeIgnoreList:o,elementsChainAsString:c}=t,u=[e],d=e;d.parentNode&&!ub(d,"body");)D1t(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var f,p=[],h={},m=!1,g=!1;if(Ps(u,(k=>{var E=vie(k);k.tagName.toLowerCase()==="a"&&(m=k.getAttribute("href"),m=E&&m&&PA(m)&&m),Wr(UL(k),"ph-no-capture")&&(g=!0),p.push(HSr(k,s,i,o));var C=(function(T){if(!vie(T))return{};var j={};return Ps(T.attributes,(function(A){if(A.name&&A.name.indexOf("data-ph-capture-attribute")===0){var I=A.name.replace("data-ph-capture-attribute-",""),P=A.value;I&&P&&PA(P)&&(j[I]=P)}})),j})(k);Vi(h,C)})),g)return{props:{},explicitNoCapture:g};if(i||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?p[0].$el_text=q1t(e):p[0].$el_text=qR(e)),m){var v,b;p[0].attr__href=m;var S=(v=DL(m))==null?void 0:v.host,O=Ye==null||(b=Ye.location)==null?void 0:b.host;S&&O&&S!==O&&(f=m)}return{props:Vi({$event_type:a.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:USr(p)},(n=p[0])!=null&&n.$el_text?{$el_text:(r=p[0])==null?void 0:r.$el_text}:{},f&&a.type==="click"?{$external_click_url:f}:{},h)}}var ZC=yi("[ExceptionAutocapture]");function Mze(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],a=n(r);return Fg(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=a,()=>{e[t]=r}}catch{return()=>{}}}var WSr=yi("[TracingHeaders]"),xy=yi("[Web Vitals]"),Dze=9e5,$ze="disabled",Lze="lazy_loading",YC="awaiting_config",gD="missing_config";yi("[SessionRecording]");var yie="[SessionRecording]",Qx=yi(yie),GSr=yi("[Heatmaps]");function Fze(e){return Mo(e)&&"clientX"in e&&"clientY"in e&&Cm(e.clientX)&&Cm(e.clientY)}var zze=yi("[Product Tours]"),bee="ph_product_tours",ZSr=["$set_once","$set"],wy=yi("[SiteApps]");function x1(e,t,n){if(ra(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class YSr{constructor(t){this.Bi=new pve,this.qi=(n,r)=>this.Vi(n,r)&&this.Wi(n,r)&&this.Gi(n,r)&&this.Yi(n,r),this.Vi=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=t,this.Ji=new Set,this.Ki=new Set}init(){var t;if(!Wt((t=this._instance)==null?void 0:t._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook(((r,a)=>{this.on(r,a)}))}}register(t){var n,r;if(!Wt((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach((i=>{var o,c;(o=this.Ki)==null||o.add(i),(c=i.steps)==null||c.forEach((u=>{var d;(d=this.Ji)==null||d.add(u?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var a,s=new Set;t.forEach((i=>{var o;(o=i.steps)==null||o.forEach((c=>{c!=null&&c.selector&&s.add(c?.selector)}))})),(a=this._instance)==null||a.autocapture.setElementSelectors(s)}}on(t,n){var r;n!=null&&t.length!=0&&(this.Ji.has(t)||this.Ji.has(n?.event))&&this.Ki&&((r=this.Ki)==null?void 0:r.size)>0&&this.Ki.forEach((a=>{this.Xi(n,a)&&this.Bi.emit("actionCaptured",a.name)}))}Qi(t){this.onAction("actionCaptured",(n=>t(n)))}Xi(t,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.qi(t,r))return!0;return!1}onAction(t,n){return this.Bi.on(t,n)}Wi(t,n){if(n!=null&&n.url){var r,a=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!a||typeof a!="string"||!x1(a,n.url,n.url_matching||"contains"))return!1}return!0}Gi(t,n){return!!this.Zi(t,n)&&!!this.te(t,n)&&!!this.ie(t,n)}Zi(t,n){var r;if(n==null||!n.href)return!0;var a=this.ee(t);if(a.length>0)return a.some((o=>x1(o.href,n.href,n.href_matching||"exact")));var s,i=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!i&&x1((s=i.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}te(t,n){var r;if(n==null||!n.text)return!0;var a=this.ee(t);if(a.length>0)return a.some((u=>x1(u.text,n.text,n.text_matching||"exact")||x1(u.$el_text,n.text,n.text_matching||"exact")));var s,i,o,c=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!c&&(s=(function(u){for(var d,f=[],p=/(?::|")text="(.*?)"/g;!ra(d=p.exec(u));)f.includes(d[1])||f.push(d[1]);return f})(c),i=n.text,o=n.text_matching||"exact",s.some((u=>x1(u,i,o))))}ie(t,n){var r,a;if(n==null||!n.selector)return!0;var s=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var i=(t==null||(a=t.properties)==null?void 0:a.$elements_chain)||"";if(n.selector_regex&&i)try{return new RegExp(n.selector_regex).test(i)}catch{return!1}return!1}ee(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t?.properties.$elements}Yi(t,n){return n==null||!n.properties||n.properties.length===0||I1t(n.properties.reduce(((r,a)=>{var s=Aa(a.value)?a.value.map(String):a.value!=null?[String(a.value)]:[];return r[a.key]={values:s,operator:a.operator||"exact"},r}),{}),t?.properties)}}class XSr{constructor(t){this._instance=t,this.re=new Map,this.se=new Map,this.ne=new Map}oe(t,n){return!!t&&I1t(t.propertyFilters,n?.properties)}ae(t,n){var r=new Map;return t.forEach((a=>{var s;(s=a.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach((i=>{if(i!=null&&i.name){var o=r.get(i.name)||[];o.push(a.id),r.set(i.name,o)}}))})),r}le(t,n,r){var a=(r===HC.Activation?this.re:this.se).get(t),s=[];return this.ue((i=>{s=i.filter((o=>a?.includes(o.id)))})),s.filter((i=>{var o,c=(o=i.conditions)==null||(o=o[r])==null||(o=o.values)==null?void 0:o.find((u=>u.name===t));return this.oe(c,n)}))}register(t){var n;Wt((n=this._instance)==null?void 0:n._addCaptureHook)||(this.he(t),this.de(t))}de(t){var n=t.filter((r=>{var a,s;return((a=r.conditions)==null?void 0:a.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0}));n.length!==0&&(this.ve==null&&(this.ve=new YSr(this._instance),this.ve.init(),this.ve.Qi((r=>{this.onAction(r)}))),n.forEach((r=>{var a,s,i,o,c;r.conditions&&(a=r.conditions)!=null&&a.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((o=this.ve)==null||o.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((u=>{if(u&&u.name){var d=this.ne.get(u.name);d&&d.push(r.id),this.ne.set(u.name,d||[r.id])}})))})))}he(t){var n,r=t.filter((s=>{var i,o;return((i=s.conditions)==null?void 0:i.events)&&((o=s.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0})),a=t.filter((s=>{var i,o;return((i=s.conditions)==null?void 0:i.cancelEvents)&&((o=s.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0}));(r.length!==0||a.length!==0)&&((n=this._instance)==null||n._addCaptureHook(((s,i)=>{this.onEvent(s,i)})),this.re=this.ae(t,HC.Activation),this.se=this.ae(t,HC.Cancellation))}onEvent(t,n){var r,a=this.ce(),s=this.fe(),i=this.pe(),o=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[s])||[];if(i===t&&n&&o.length>0){var c,u;a.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:o});var d=(n==null||(c=n.properties)==null?void 0:c.$survey_id)||(n==null||(u=n.properties)==null?void 0:u.$product_tour_id);if(d){var f=o.indexOf(d);f>=0&&(o.splice(f,1),this._e(o))}}else{if(this.se.has(t)){var p=this.le(t,n,HC.Cancellation);p.length>0&&(a.info("cancel event matched, cancelling items",{event:t,itemsToCancel:p.map((m=>m.id))}),p.forEach((m=>{var g=o.indexOf(m.id);g>=0&&o.splice(g,1),this.ge(m.id)})),this._e(o))}if(this.re.has(t)){a.info("event name matched",{event:t,eventPayload:n,items:this.re.get(t)});var h=this.le(t,n,HC.Activation);this._e(o.concat(h.map((m=>m.id))||[]))}}}onAction(t){var n,r=this.fe(),a=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.ne.has(t)&&this._e(a.concat(this.ne.get(t)||[]))}_e(t){var n,r=this.ce(),a=this.fe(),s=[...new Set(t)].filter((i=>!this.me(i)));r.info("updating activated items",{activatedItems:s}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[a]:s})}getActivatedIds(){var t,n=this.fe(),r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n];return r||[]}getEventToItemsMap(){return this.re}be(){return this.ve}}class KSr extends XSr{constructor(t){super(t)}fe(){return"$surveys_activated"}pe(){return Tj.SHOWN}ue(t){var n;(n=this._instance)==null||n.getSurveys(t)}ge(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}ce(){return vs}me(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var JSr=Ye!=null&&Ye.location?LL(Ye.location.hash,"__posthog")||LL(location.hash,"state"):null,Bze="_postHogToolbarParams",Uze=yi("[Toolbar]"),_y=(function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e})(_y||{}),Zc=yi("[FeatureFlags]"),XC=yi("[FeatureFlags]",{debugEnabled:!0}),e1r="errors_while_computing_flags",t1r="flag_missing",n1r="quota_limited",r1r="timeout",a1r="connection_error",s1r="unknown_error",i1r=e=>"api_error_"+e,xee="$active_feature_flags",w1="$override_feature_flags",Vze="$feature_flag_payloads",KC="$override_feature_flag_payloads",qze="$feature_flag_request_id",Hze=e=>{var t={};for(var[n,r]of d$(e||{}))r&&(t[n]=r);return t},o1r=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((n=>t[n].enabled)).filter((n=>{var r;return(r=t[n].metadata)==null?void 0:r.payload})).map((n=>{var r;return[n,(r=t[n].metadata)==null?void 0:r.payload]})))):Zc.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},l1r=(function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e})({}),wee=yi("[Error tracking]"),c1r={icontains:(e,t)=>!!Ye&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Ye&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!Ye&&BL(t.href,e),not_regex:(e,t)=>!!Ye&&!BL(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Ml{constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((a=>{Ml.ye("retrieved web experiments from the server"),n.we=new Map,a.forEach((s=>{if(s.feature_flag_key){var i;n.we&&(Ml.ye("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=n.we)==null||i.set(s.feature_flag_key,s));var o=n._instance.getFeatureFlag(s.feature_flag_key);uo(o)&&s.variants[o]&&n.Ee(s.name,o,s.variants[o].transforms)}else if(s.variants)for(var c in s.variants){var u=s.variants[c];Ml.Se(u)&&n.Ee(s.name,c,u.transforms)}}))}),r)},this._instance=t,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Ml.ye("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ra(this.we))return this.we=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Ml.ye("applying feature flags",t),t.forEach((n=>{var r;if(this.we&&(r=this.we)!=null&&r.has(n)){var a,s=this._instance.getFeatureFlag(n),i=(a=this.we)==null?void 0:a.get(n);s&&i!=null&&i.variants[s]&&this.Ee(i.name,s,i.variants[s].transforms)}}))}}previewWebExperiment(){var t=Ml.getWindowLocation();if(t!=null&&t.search){var n=$L(t?.search,"__experiment_id"),r=$L(t?.search,"__experiment_variant");n&&r&&(Ml.ye("previewing web experiments "+n+" && "+r),this.getWebExperiments((a=>{this.xe(parseInt(n),r,a)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var a=this._instance.get_property("$web_experiments");if(a&&!n)return t(a);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:s=>{if(s.statusCode!==200||!s.json)return t([]);var i=s.json.experiments||[];return t(i)}})}xe(t,n,r){var a=r.filter((s=>s.id===t));a&&a.length>0&&(Ml.ye("Previewing web experiment ["+a[0].name+"] with variant ["+n+"]"),this.Ee(a[0].name,n,a[0].variants[n].transforms))}static Se(t){return!ra(t.conditions)&&Ml.$e(t)&&Ml.ke(t)}static $e(t){var n;if(ra(t.conditions)||ra((n=t.conditions)==null?void 0:n.url))return!0;var r,a,s,i=Ml.getWindowLocation();return!!i&&((r=t.conditions)==null||!r.url||c1r[(a=(s=t.conditions)==null?void 0:s.urlMatchType)!==null&&a!==void 0?a:"icontains"](t.conditions.url,i))}static getWindowLocation(){return Ye?.location}static ke(t){var n;if(ra(t.conditions)||ra((n=t.conditions)==null?void 0:n.utm))return!0;var r=v1t();if(r.utm_source){var a,s,i,o,c,u,d,f,p=(a=t.conditions)==null||(a=a.utm)==null||!a.utm_campaign||((s=t.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.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)==r.utm_source,m=(c=t.conditions)==null||(c=c.utm)==null||!c.utm_medium||((u=t.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,g=(d=t.conditions)==null||(d=d.utm)==null||!d.utm_term||((f=t.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==r.utm_term;return p&&m&&g&&h}return!1}static ye(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];Zt.info("[WebExperiments] "+t,r)}Ee(t,n,r){this._is_bot()?Ml.ye("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((a=>{if(a.selector){var s;Ml.ye("applying transform of variant "+n+" for experiment "+t+" ",a);var i=(s=document)==null?void 0:s.querySelectorAll(a.selector);i?.forEach((o=>{var c=o;a.html&&(c.innerHTML=a.html),a.css&&c.setAttribute("style",a.css)}))}})):Ml.ye("Control variants leave the page unmodified.")}_is_bot(){return fd&&this._instance?N1t(fd,this._instance.config.custom_blocked_useragents):void 0}}var ff=yi("[Conversations]"),S9={featureFlags:class{constructor(e){this.Pe=!1,this.Te=!1,this.Re=!1,this.Ie=!1,this.Ce=!1,this.Oe=!1,this.Fe=!1,this.Me=!1,this._instance=e,this.featureFlagEventHandlers=[]}Ae(){var e,t;return(e=(t=this._instance.persistence)==null?void 0:t.nt(this._instance.config.feature_flag_cache_ttl_ms))!==null&&e!==void 0&&e}De(){return!!this.Ae()&&(this.Me||this.Re||(this.Me=!0,Zc.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Le(){var e,t=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Fe||(Zc.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Fe=!0),t!=null&&t.length?t.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||Zc.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}je(){return this.Le().length>0}initialize(){var e,t,{config:n}=this._instance,r=(e=(t=n.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var a,s,i=(a=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&a!==void 0?a:{},o=Object.keys(r).filter((u=>!!r[u])).reduce(((u,d)=>(u[d]=r[d]||!1,u)),{}),c=Object.keys(i).filter((u=>o[u])).reduce(((u,d)=>(i[d]&&(u[d]=i[d]),u)),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:c})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},a=n!=null&&n.merge?this.getFlagPayloads():{},s=Ft({},r,e),i=Ft({},a,t),o={};for(var[c,u]of Object.entries(s)){var d=typeof u=="string";o[c]={key:c,enabled:!!d||!!u,variant:d?u:void 0,reason:void 0,metadata:Wt(i?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:i[c]}}}this.receivedFeatureFlags({flags:o})}get hasLoadedFlags(){return this.Te}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(rie),t=this._instance.get_property(w1),n=this._instance.get_property(KC);if(!n&&!t)return e||{};var r=Vi({},e||{}),a=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of a){var i,o,c=r[s],u=t?.[s],d=Wt(u)?(i=c?.enabled)!==null&&i!==void 0&&i:!!u,f=Wt(u)?c.variant:typeof u=="string"?u:void 0,p=n?.[s],h=Ft({},c,{enabled:d,variant:d?f??c?.variant:void 0});d!==c?.enabled&&(h.original_enabled=c?.enabled),f!==c?.variant&&(h.original_variant=c?.variant),p&&(h.metadata=Ft({},c?.metadata,{payload:p,original_payload:c==null||(o=c.metadata)==null?void 0:o.payload})),r[s]=h}return this.Pe||(Zc.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Pe=!0),r}getFlagVariants(){var e=this._instance.get_property(rO),t=this._instance.get_property(w1);if(!t)return e||{};for(var n=Vi({},e),r=Object.keys(t),a=0;a<r.length;a++)n[r[a]]=t[r[a]];return this.Pe||(Zc.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Pe=!0),n}getFlagPayloads(){var e=this._instance.get_property(Vze),t=this._instance.get_property(KC);if(!t)return e||{};for(var n=Vi({},e||{}),r=Object.keys(t),a=0;a<r.length;a++)n[r[a]]=t[r[a]];return this.Pe||(Zc.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Pe=!0),n}reloadFeatureFlags(){this.Ie||this._instance.config.advanced_disable_feature_flags||this.Ne||(this._instance.pi.emit("featureFlagsReloading",!0),this.Ne=setTimeout((()=>{this.Ue()}),5))}ze(){clearTimeout(this.Ne),this.Ne=void 0}ensureFlagsLoaded(){this.Te||this.Re||this.Ne||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Ie=e}Ue(e){var t;if(this.ze(),!this._instance.bt())if(this.Re)this.Ce=!0;else{var n=this._instance.config.token,r=this._instance.get_property("$device_id"),a={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Ft({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(jj)||{}),group_properties:this._instance.get_property(t0),timezone:O1t()};uh(r)||Wt(r)||(a.$device_id=r),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(a.disable_flags=!0),this.je()&&(a.evaluation_contexts=this.Le());var s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",i=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+s);this.Re=!0,this._instance._send_request({method:"POST",url:i,data:a,compression:this._instance.config.disable_compression?void 0:Ig.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var c,u,d,f=!0;if(o.statusCode===200&&(this.Ce||(this.$anon_distinct_id=void 0),f=!1),this.Re=!1,!a.disable_flags||this.Ce){this.Oe=!f;var p=[];o.error?o.error instanceof Error?p.push(o.error.name==="AbortError"?r1r:a1r):p.push(s1r):o.statusCode!==200&&p.push(i1r(o.statusCode)),(c=o.json)!=null&&c.errorsWhileComputingFlags&&p.push(e1r);var h=!((u=o.json)==null||(u=u.quotaLimited)==null||!u.includes(l1r.FeatureFlags));if(h&&p.push(n1r),(d=this._instance.persistence)==null||d.register({[iie]:p}),h)Zc.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 m;a.disable_flags||this.receivedFeatureFlags((m=o.json)!==null&&m!==void 0?m:{},f),this.Ce&&(this.Ce=!1,this.Ue())}}}})}}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),!t.fresh||this.Oe)if(this.Te||this.getFlags()&&this.getFlags().length>0){if(!this.De()){var r=this.getFeatureFlagResult(e,t);return(n=r?.variant)!==null&&n!==void 0?n:r?.enabled}}else Zc.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.Oe)if(this.Te||this.getFlags()&&this.getFlags().length>0){if(!this.De()){var n=this.getFlagVariants(),r=e in n,a=n[e],s=this.getFlagPayloads()[e],i=String(a),o=this._instance.get_property(qze)||void 0,c=this._instance.get_property(IL)||void 0,u=this._instance.get_property(pT)||{};if(this._instance.config.advanced_feature_flags_dedup_per_session){var d,f=this._instance.get_session_id(),p=this._instance.get_property(sie);f&&f!==p&&(u={},(d=this._instance.persistence)==null||d.register({[pT]:u,[sie]:f}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(i))){var h,m,g,v,b,S,O,k,E,C;Aa(u[e])?u[e].push(i):u[e]=[i],(h=this._instance.persistence)==null||h.register({[pT]:u});var T=this.getFeatureFlagDetails(e),j=[...(m=this._instance.get_property(iie))!==null&&m!==void 0?m:[]];Wt(a)&&j.push(t1r);var A={$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:s||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((g=this._instance.config.bootstrap)==null||(g=g.featureFlags)==null?void 0:g[e])||null,$feature_flag_bootstrapped_payload:((v=this._instance.config.bootstrap)==null||(v=v.featureFlagPayloads)==null?void 0:v[e])||null,$used_bootstrap_value:!this.Oe};Wt(T==null||(b=T.metadata)==null?void 0:b.version)||(A.$feature_flag_version=T.metadata.version);var I,P=(S=T==null||(O=T.reason)==null?void 0:O.description)!==null&&S!==void 0?S:T==null||(k=T.reason)==null?void 0:k.code;P&&(A.$feature_flag_reason=P),T!=null&&(E=T.metadata)!=null&&E.id&&(A.$feature_flag_id=T.metadata.id),Wt(T?.original_variant)&&Wt(T?.original_enabled)||(A.$feature_flag_original_response=Wt(T.original_variant)?T.original_enabled:T.original_variant),T!=null&&(C=T.metadata)!=null&&C.original_payload&&(A.$feature_flag_original_payload=T==null||(I=T.metadata)==null?void 0:I.original_payload),j.length&&(A.$feature_flag_error=j.join(",")),this._instance.capture("$feature_flag_called",A)}if(r){var M=s;if(!Wt(s))try{M=JSON.parse(s)}catch{}return{key:e,enabled:!!a,variant:typeof a=="string"?a:void 0,payload:M}}}}else Zc.warn('getFeatureFlagResult for key "'+e+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(e,t){var n=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.je()&&(r.evaluation_contexts=this.Le()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this._instance.config.disable_compression?void 0:Ig.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:a=>{var s,i=(s=a.json)==null?void 0:s.featureFlagPayloads;t(i?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.Oe){if(this.Te||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return Wt(n)?void 0:!!n}Zc.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(this._instance.persistence){this.Te=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(s,i,o,c,u){o===void 0&&(o={}),c===void 0&&(c={}),u===void 0&&(u={});var d=o1r(s),f=d.flags,p=d.featureFlags,h=d.featureFlagPayloads;if(p){var m=s.requestId,g=s.evaluatedAt;if(Aa(p)){Zc.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(p)for(var b=0;b<p.length;b++)v[p[b]]=!0;i&&i.register({[xee]:p,[rO]:v})}else{var S=p,O=h,k=f;if(s.errorsWhileComputingFlags)if(f){var E=new Set(Object.keys(f).filter((C=>{var T;return!((T=f[C])!=null&&T.failed)})));S=Ft({},o,Object.fromEntries(Object.entries(S).filter((C=>{var[T]=C;return E.has(T)})))),O=Ft({},c,Object.fromEntries(Object.entries(O||{}).filter((C=>{var[T]=C;return E.has(T)})))),k=Ft({},u,Object.fromEntries(Object.entries(k||{}).filter((C=>{var[T]=C;return E.has(T)}))))}else S=Ft({},o,S),O=Ft({},c,O),k=Ft({},u,k);i&&i.register(Ft({[xee]:Object.keys(Hze(S)),[rO]:S||{},[Vze]:O||{},[rie]:k||{}},m?{[qze]:m}:{},g?{[IL]:g}:{}))}}})(e,this._instance.persistence,n,r,a),t||(this.Me=!1),this.He(t)}}override(e,t){t===void 0&&(t=!1),Zc.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Zc.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(w1),this._instance.persistence.unregister(KC),this.He(),XC.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;if(this.Pe=!!((t=n.suppressWarning)!==null&&t!==void 0&&t),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(w1),XC.info("Flag overrides cleared");else if(n.flags){if(Aa(n.flags)){for(var r={},a=0;a<n.flags.length;a++)r[n.flags[a]]=!0;this._instance.persistence.register({[w1]:r})}else this._instance.persistence.register({[w1]:n.flags});XC.info("Flag overrides set",{flags:n.flags})}}return"payloads"in n&&(n.payloads===!1?(this._instance.persistence.unregister(KC),XC.info("Payload overrides cleared")):n.payloads&&(this._instance.persistence.register({[KC]:n.payloads}),XC.info("Payload overrides set",{payloads:n.payloads}))),void this.He()}this.He()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Te){var{flags:t,flagVariants:n}=this.Be();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,a=(this._instance.get_property(Cj)||[]).find((c=>c.flagKey===e)),s={["$feature_enrollment/"+e]:t},i={$feature_flag:e,$feature_enrollment:t,$set:s};a&&(i.$early_access_feature_name=a.name),n&&(i.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",i),this.setPersonPropertiesForFlags(s,!1);var o=Ft({},this.getFlagVariants(),{[e]:t});(r=this._instance.persistence)==null||r.register({[xee]:Object.keys(Hze(o)),[rO]:o}),this.He()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this._instance.get_property(Cj),a=n?"&"+n.map((s=>"stage="+s)).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+a),method:"GET",callback:s=>{var i,o;if(s.json){var c=s.json.earlyAccessFeatures;return(i=this._instance.persistence)==null||i.unregister(Cj),(o=this._instance.persistence)==null||o.register({[Cj]:c}),e(c)}}})}Be(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((n=>t[n])),flagVariants:Object.keys(t).filter((n=>t[n])).reduce(((n,r)=>(n[r]=t[r],n)),{})}}He(e){var{flags:t,flagVariants:n}=this.Be();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(jj)||{};this._instance.register({[jj]:Ft({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(jj)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(t0)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=Ft({},n[r],e[r]),delete e[r]})),this._instance.register({[t0]:Ft({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(t0)||{};this._instance.register({[t0]:Ft({},t,{[e]:{}})})}else this._instance.unregister(t0)}reset(){this.Te=!1,this.Re=!1,this.Ie=!1,this.Ce=!1,this.Oe=!1,this.$anon_distinct_id=void 0,this.ze(),this.Pe=!1}}},u1r={sessionRecording:class{get started(){var e;return!((e=this.qe)==null||!e.isStarted)}get status(){var e,t;return this.Ve===YC||this.Ve===gD?this.Ve:(e=(t=this.qe)==null?void 0:t.status)!==null&&e!==void 0?e:this.Ve}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Ve=$ze,this.We=void 0,this._instance=e,!this._instance.sessionManager)throw Qx.error("started without valid sessionManager"),new Error(yie+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(yie+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ge(){var e,t=!((e=this._instance.get_property(dD))==null||!e.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Ye&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.Ge||(t=this.qe)==null||!t.isStarted){var n=!Wt(Object.assign)&&!Wt(Array.from);this.Ge&&n?(this.Ye(e),Qx.info("starting")):(this.Ve=$ze,this.stopRecording())}}Ye(e){var t,n,r;this.Ge&&(this.Ve!==YC&&this.Ve!==gD&&(this.Ve=Lze),zn!=null&&(t=zn.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=zn.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Je(e):(r=zn.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ke,(a=>{if(a)return Qx.error("could not load recorder",a);this.Je(e)})))}stopRecording(){var e,t;(e=this.We)==null||e.call(this),this.We=void 0,(t=this.qe)==null||t.stop()}Xe(){var e,t;(e=this.We)==null||e.call(this),this.We=void 0,(t=this.qe)==null||t.discard()}Qe(){var e;(e=this._instance.persistence)==null||e.unregister(f1t)}Ze(e,t){if(ra(e))return null;var n,r=Cm(e)?e:parseFloat(e);return typeof(n=r)=="number"&&Number.isFinite(n)&&n>=0&&n<=1?r:(Qx.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null)}tr(e){if(this._instance.persistence){var t,n,r=this._instance.persistence,a=()=>{var s,i=e.sessionRecording===!1?void 0:e.sessionRecording,o=this.Ze((s=this._instance.config.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),c=this.Ze(i?.sampleRate,"remote config sampleRate"),u=o??c;ra(u)&&this.Qe();var d=i?.minimumDurationMilliseconds;r.register({[dD]:Ft({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:Ft({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:u,minimumDurationMilliseconds:Wt(d)?null:d,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};a(),(t=this.We)==null||t.call(this),this.We=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(a)}}onRemoteConfig(e){return"sessionRecording"in e?e.sessionRecording===!1?(this.tr(e),void this.Xe()):(this.tr(e),void this.startIfEnabledOrStop()):(this.Ve===YC&&(this.Ve=gD,Qx.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t="log"),(n=this.qe)!=null&&n.log?this.qe.log(e,t):Qx.warn("log called before recorder was ready")}get Ke(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(dD);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}ir(){var e,t=this._instance.get_property(dD);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return Date.now()-n<=36e5}Je(e){var t,n;if((t=zn.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");if(this.qe||(this.qe=(n=zn.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.qe._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ir())return this.Ve===gD||this.Ve===YC?void 0:(this.Ve=YC,Qx.info("persisted remote config is stale, requesting fresh config before starting"),void new k1t(this._instance).load());this.Ve=Lze,this.qe.start(e)}onRRwebEmit(e){var t;(t=this.qe)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.qe||(t=this._instance.persistence)==null||t.register({$replay_override_linked_flag:!0}),(e=this.qe)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.qe||(t=this._instance.persistence)==null||t.register({$replay_override_sampling:!0}),(e=this.qe)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.qe||(n=this._instance.persistence)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.qe)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.qe)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.qe)==null||!n.tryAddCustomEvent(e,t))}}},d1r={autocapture:class{constructor(e){this.er=!1,this.rr=null,this.sr=!1,this.instance=e,this.rageclicks=new Rze(e.config.rageclick),this.nr=null}initialize(){this.startIfEnabled()}get N(){var e,t,n=Mo(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map((r=>new RegExp(r))),n}ar(){if(this.isBrowserSupported()){if(Ye&&qt){var e=n=>{n=n||Ye?.event;try{this.lr(n)}catch(r){Pze.error("Failed to capture event",r)}};if(io(qt,"submit",e,{capture:!0}),io(qt,"change",e,{capture:!0}),io(qt,"click",e,{capture:!0}),this.N.capture_copied_text){var t=n=>{n=n||Ye?.event,this.lr(n,vee)};io(qt,"copy",t,{capture:!0}),io(qt,"cut",t,{capture:!0})}}}else Pze.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.er&&(this.ar(),this.er=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.sr=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[rze]:!!e.autocapture_opt_out}),this.rr=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.nr=e}getElementSelectors(e){var t,n=[];return(t=this.nr)==null||t.forEach((r=>{var a=qt?.querySelectorAll(r);a?.forEach((s=>{e===s&&n.push(r)}))})),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[rze],r=this.rr;if(uh(r)&&!Zg(n)&&!this.instance.bt())return!1;var a=(t=this.rr)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!a}lr(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=Tze(e);M1t(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&DSr(r,this.instance.config.rageclick)&&this.lr(e,"$rageclick");var a=t===vee;if(r&&$Sr(r,e,this.N,a,a?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:i}=QSr(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.sr});if(i)return!1;var o=this.getElementSelectors(r);if(o&&o.length>0&&(s.$element_selectors=o),t===vee){var c,u=$1t(Ye==null||(c=Ye.getSelection())==null?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=d}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return Fg(qt?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.ur=(Ye==null||(t=Ye.location)==null?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(Zt.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.hr&&this.hr(),this.hr=void 0,Zt.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(Ye&&Ye.history){var n=this;(e=Ye.history.pushState)!=null&&e.__posthog_wrapped__||Mze(Ye.history,"pushState",(r=>function(a,s,i){r.call(this,a,s,i),n.dr("pushState")})),(t=Ye.history.replaceState)!=null&&t.__posthog_wrapped__||Mze(Ye.history,"replaceState",(r=>function(a,s,i){r.call(this,a,s,i),n.dr("replaceState")})),this.vr()}}dr(e){try{var t,n=Ye==null||(t=Ye.location)==null?void 0:t.pathname;if(!n)return;n!==this.ur&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ur=n}catch(r){Zt.error("Error capturing "+e+" pageview",r)}}vr(){if(!this.hr){var e=()=>{this.dr("popstate")};io(Ye,"popstate",e),this.hr=()=>{Ye&&Ye.removeEventListener("popstate",e)}}}},heatmaps:class{constructor(e){var t;this.cr=!1,this.er=!1,this.pr=null,this.instance=e,this.cr=!((t=this.instance.persistence)==null||!t.props[tie]),this.rageclicks=new Rze(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Mo(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ra(this.instance.config.capture_heatmaps)?ra(this.instance.config.enable_heatmaps)?this.cr:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.er)return;GSr.info("starting..."),this._r(),this.gr()}else{var e;clearInterval((e=this.pr)!==null&&e!==void 0?e:void 0),this.mr(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tie]:t}),this.cr=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.C;return this.C=void 0,e}br(e){this.yr(e.originalEvent,"deadclick")}gr(){this.pr&&clearInterval(this.pr),this.pr=(function(e){return e?.visibilityState==="visible"})(qt)?setInterval(this.Ft.bind(this),this.flushIntervalMilliseconds):null}_r(){Ye&&qt&&(this.wr=this.Ft.bind(this),io(Ye,"beforeunload",this.wr),this.Er=e=>this.yr(e||Ye?.event),io(qt,"click",this.Er,{capture:!0}),this.Sr=e=>this.$r(e||Ye?.event),io(qt,"mousemove",this.Sr,{capture:!0}),this.kr=new dze(this.instance,tSr,this.br.bind(this)),this.kr.startIfEnabledOrStop(),this.Pr=this.gr.bind(this),io(qt,"visibilitychange",this.Pr),this.er=!0)}mr(){var e;Ye&&qt&&(this.wr&&Ye.removeEventListener("beforeunload",this.wr),this.Er&&qt.removeEventListener("click",this.Er,{capture:!0}),this.Sr&&qt.removeEventListener("mousemove",this.Sr,{capture:!0}),this.Pr&&qt.removeEventListener("visibilitychange",this.Pr),clearTimeout(this.Tr),(e=this.kr)==null||e.stop(),this.er=!1)}Rr(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),s=(function(i,o,c){for(var u=i;u&&w9(u)&&!ub(u,"body");){if(u===c)return!1;if(Wr(o,Ye?.getComputedStyle(u).position))return!0;u=F1t(u)}return!1})(Tze(e),["fixed","sticky"],a);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}yr(e,t){var n;if(t===void 0&&(t="click"),!Cze(e.target)&&Fze(e)){var r=this.Rr(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Ir(Ft({},r,{type:"rageclick"})),this.Ir(r)}}$r(e){!Cze(e.target)&&Fze(e)&&(clearTimeout(this.Tr),this.Tr=setTimeout((()=>{this.Ir(this.Rr(e,"mousemove"))}),500))}Ir(e){if(Ye){var t=Ye.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,a=n?Kk([],Jk,r||[]):[],s=IA(t,a,RA);this.C=this.C||{},this.C[s]||(this.C[s]=[]),this.C[s].push(e)}}Ft(){this.C&&!nO(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:dze,webVitalsAutocapture:class{constructor(e){var t;this.cr=!1,this.er=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Cr=()=>{clearTimeout(this.Or),this.C.metrics.length!==0&&(this._instance.capture("$web_vitals",this.C.metrics.reduce(((n,r)=>Ft({},n,{["$web_vitals_"+r.name+"_event"]:Ft({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Fr=n=>{var r,a=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(Wt(a))xy.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Mr();Wt(s)||(ra(n?.name)||ra(n?.value)?xy.error("Invalid metric received",n):this.Ar&&n.value>=this.Ar?xy.error("Ignoring metric with value >= "+this.Ar,n):(this.C.url!==s&&(this.Cr(),this.Or=setTimeout(this.Cr,this.flushToCaptureTimeoutMs)),Wt(this.C.url)&&(this.C.url=s),this.C.firstMetricTimestamp=Wt(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.C.metrics.push(Ft({},n,{$current_url:s,$session_id:a.sessionId,$window_id:a.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Cr()))}},this.Dr=()=>{if(!this.er){var n,r,a,s,i=zn.__PosthogExtensions__;Wt(i)||Wt(i.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:a,onINP:s}=i.postHogWebVitalsCallbacks),n&&r&&a&&s?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Fr.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Fr.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&a(this.Fr.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Fr.bind(this)),this.er=!0):xy.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.cr=!((t=this._instance.persistence)==null||!t.props[ize]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=Mo(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return ra(n)?((t=this._instance.persistence)==null?void 0:t.props[lze])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Mo(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Mo(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get Ar(){var e=Mo(this._instance.config.capture_performance)&&Cm(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Dze;return 0<e&&e<=6e4?Dze:e}get isEnabled(){var e=xl?.protocol;if(e!=="http:"&&e!=="https:")return xy.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Mo(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Zg(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Zg(t)?t:this.cr}startIfEnabled(){this.isEnabled&&!this.er&&(xy.info("enabled, starting..."),this.G(this.Dr))}onRemoteConfig(e){if("capturePerformance"in e){var t=Mo(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Mo(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ize]:t}),this._instance.persistence.register({[lze]:n})),this.cr=t,this.startIfEnabled()}}G(e){var t,n;if((t=zn.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks)e();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=zn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,r,(a=>{a?xy.error("failed to load script",a):e()}))}}Mr(){var e=Ye?Ye.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,r=t?Kk([],Jk,n||[]):[];return IA(e,r,RA)}xy.error("Could not determine current URL")}}},f1r={exceptionObserver:class{constructor(e){var t,n,r;this.Dr=()=>{var a;if(Ye&&this.isEnabled&&(a=zn.__PosthogExtensions__)!=null&&a.errorWrappingFunctions){var s=zn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=zn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,o=zn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Lr&&this.N.capture_unhandled_errors&&(this.Lr=s(this.captureException.bind(this))),!this.jr&&this.N.capture_unhandled_rejections&&(this.jr=i(this.captureException.bind(this))),!this.Nr&&this.N.capture_console_errors&&(this.Nr=o(this.captureException.bind(this)))}catch(c){ZC.error("failed to start",c),this.Ur()}}},this._instance=e,this.zr=!((t=this._instance.persistence)==null||!t.props[aze]),this.Hr=new cwr({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:ZC}),this.N=this.Br(),this.startIfEnabledOrStop()}Br(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Mo(e)?t=Ft({},t,e):(Wt(e)?this.zr:e)&&(t=Ft({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ZC.info("enabled"),this.Ur(),this.G(this.Dr)):this.Ur()}G(e){var t,n;(t=zn.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=zn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return ZC.error("failed to load script",r);e()}))}Ur(){var e,t,n;(e=this.Lr)==null||e.call(this),this.Lr=void 0,(t=this.jr)==null||t.call(this),this.jr=void 0,(n=this.Nr)==null||n.call(this),this.Nr=void 0}onRemoteConfig(e){if("autocaptureExceptions"in e){var t=e.autocaptureExceptions;this.zr=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[aze]:this.zr}),this.N=this.Br(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this.Br()}captureException(e){var t,n,r,a=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.Hr.consumeRateLimit(a)?ZC.info("Skipping exception capture because of client rate limiting.",{exception:a}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.qr=[],this.Vr=new Swr([new Awr,new zwr,new Rwr,new Iwr,new Lwr,new $wr,new Mwr,new Fwr],Nwr()),this._instance=e,this.qr=(t=(n=this._instance.persistence)==null?void 0:n.get_property(nie))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r;if("errorTracking"in e){var a=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],s=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.qr=a,this._instance.persistence&&this._instance.persistence.register({[nie]:this.qr,[sze]:s})}}get Wr(){var e,t=!!this._instance.get_property(sze),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.Vr.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.Gr(t)){if(this.Yr(t))return void wee.info("Skipping exception capture because a suppression rule matched");if(!this.Wr&&this.Jr(t))return void wee.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Kr(t))return void wee.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",Di:!0})}Yr(e){if(e.length===0)return!1;var t=e.reduce(((n,r)=>{var{type:a,value:s}=r;return uo(a)&&a.length>0&&n.$exception_types.push(a),uo(s)&&s.length>0&&n.$exception_values.push(s),n}),{$exception_types:[],$exception_values:[]});return this.qr.some((n=>{var r=n.values.map((a=>{var s,i=A1t[a.operator],o=Aa(a.value)?a.value:[a.value],c=(s=t[a.key])!==null&&s!==void 0?s:[];return o.length>0&&i(o,c)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Jr(e){return e.flatMap((t=>{var n,r;return(n=(r=t.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}Kr(e){if(e.length>0){var t,n,r,a,s=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],i=s[s.length-1];return(r=i==null||(a=i.filename)==null?void 0:a.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Gr(e){return!ra(e)&&Aa(e)}}},p1r=Ft({productTours:class{constructor(e){this.Xr=null,this.Qr=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this._instance.persistence&&this._instance.persistence.register({[oze]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Xr||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(oze)||this.G((()=>this.Zr()))}G(e){var t,n;(t=zn.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=zn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?zze.error("Could not load product tours script",r):e()}))}Zr(){var e;!this.Xr&&(e=zn.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Xr=zn.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Aa(this.Qr)||t){var n=this._instance.persistence;if(n){var r=n.props[bee];if(Aa(r)&&!t)return this.Qr=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:a=>{var s=a.statusCode;if(s!==200||!a.json){var i="Product Tours API could not be loaded, status: "+s;return zze.error(i),void e([],{isLoaded:!1,error:i})}var o=Aa(a.json.product_tours)?a.json.product_tours:[];this.Qr=o,n&&n.register({[bee]:o}),e(o,{isLoaded:!0})}})}else e(this.Qr,{isLoaded:!0})}getActiveProductTours(e){ra(this.Xr)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Xr.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Xr)==null||t.showTourById(e)}previewTour(e){this.Xr?this.Xr.previewTour(e):this.G((()=>{var t;this.Zr(),(t=this.Xr)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Xr)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Xr)==null||e.nextStep()}previousStep(){var e;(e=this.Xr)==null||e.previousStep()}clearCache(){var e;this.Qr=null,(e=this._instance.persistence)==null||e.unregister(bee)}resetTour(e){var t;(t=this.Xr)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Xr)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Xr)==null||t.cancelPendingTour(e)}}},S9),h1r={siteApps:class{constructor(e){this._instance=e,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(e,t){if(t){var n=this.globalsForEvent(t);this.ts.push(n),this.ts.length>1e3&&(this.ts=this.ts.slice(10))}}get siteAppLoaders(){var e;return(e=zn._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.es.bind(this));this.rs=()=>{e(),this.ts=[],this.rs=void 0}}}globalsForEvent(e){var t,n,r,a,s,i,o;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[f,p]of Object.entries(d))c[f]={id:u[f],type:f,properties:p};var{$set_once:h,$set:m}=e;return{event:Ft({},FSt(e,ZSr),{properties:Ft({},e.properties,m?{$set:Ft({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},m)}:{},h?{$set_once:Ft({},(r=(a=e.properties)==null?void 0:a.$set_once)!==null&&r!==void 0?r:{},h)}:{}),elements_chain:(s=(i=e.properties)==null?void 0:i.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(o=e.properties)==null?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var i;!t.errored&&this.ts.length&&(wy.info("Processing "+this.ts.length+" events for site app with id "+e.id),this.ts.forEach((o=>t.processEvent==null?void 0:t.processEvent(o))),t.processedBuffer=!0),Object.values(this.apps).every((o=>o.processedBuffer||o.errored))&&((i=this.rs)==null||i.call(this))},r=!1,a=i=>{t.errored=!i,t.loaded=!0,wy.info("Site app with id "+e.id+" "+(i?"loaded":"errored")),r&&n()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:i=>{a(i)}});s&&(t.processEvent=s),r=!0}catch(i){wy.error("Error while initializing PostHog app with config id "+e.id,i),a(!1)}if(r&&t.loaded)try{n()}catch(i){wy.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}ss(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ns(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){wy.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,a=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",(c=>this.ns(c)))):void wy.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.rs)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var s=function(c){var u;zn["__$$ph_site_app_"+c]=a._instance,(u=zn.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(a._instance,o,(d=>{if(d)return wy.error("Error while initializing PostHog app with config id "+c,d)}))};for(var{id:i,url:o}of e.siteApps)s(i)}else wy.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},m1r={tracingHeaders:class{constructor(e){this.os=void 0,this.ls=void 0,this.Dr=()=>{var t,n;Wt(this.os)&&((t=zn.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),Wt(this.ls)&&((n=zn.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}G(e){var t,n;(t=zn.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=zn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return WSr.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.G(this.Dr):((e=this.os)==null||e.call(this),(t=this.ls)==null||t.call(this),this.os=void 0,this.ls=void 0)}}},g1r=Ft({surveys:class{constructor(e){this.us=void 0,this._surveyManager=null,this.hs=!1,this.ds=[],this.vs=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(ra(t))return vs.warn("Flags not loaded yet. Not loading surveys.");var n=Aa(t);this.us=n?t.length>0:t,vs.info("flags response received, isSurveysEnabled: "+this.us),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(R1t)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.hs)vs.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)vs.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())vs.info("Not loading surveys in cookieless mode without consent.");else{var e=zn?.__PosthogExtensions__;if(e){if(!Wt(this.us)||this._instance.config.advanced_enable_surveys){var t=this.us||this._instance.config.advanced_enable_surveys;this.hs=!0;try{var n=e.generateSurveys;if(n)return void this.cs(n,t);var r=e.loadExternalDependency;if(!r)return void this.fs("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(a=>{a||!e.generateSurveys?this.fs("Could not load surveys script",a):this.cs(e.generateSurveys,t)}))}catch(a){throw this.fs("Error initializing surveys",a),a}finally{this.hs=!1}}}else vs.error("PostHog Extensions not found.")}}cs(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new KSr(this._instance),vs.info("Surveys loaded successfully"),this.ps({isLoaded:!0})}fs(e,t){vs.error(e,t),this.ps({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ds.push(e),this._surveyManager&&this.ps({isLoaded:!0}),()=>{this.ds=this.ds.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return vs.info("Disabled. Not loading surveys."),e([]);var n,r=this._instance.get_property(aie);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<"u"&&this.vs?this.vs.then((a=>{var{surveys:s,context:i}=a;return e(s,i)})):(typeof Promise<"u"&&(this.vs=new Promise((a=>{n=a}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:a=>{var s;this.vs=null;var i=a.statusCode;if(i!==200||!a.json){var o="Surveys API could not be loaded, status: "+i;vs.error(o);var c={isLoaded:!1,error:o};return e([],c),void(n==null||n({surveys:[],context:c}))}var u,d=a.json.surveys||[],f=d.filter((h=>(function(m){return!(!m.start_date||m.end_date)})(h)&&((function(m){var g;return!((g=m.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(h)||(function(m){var g;return!((g=m.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(h))));f.length>0&&((u=this._surveyEventReceiver)==null||u.register(f)),(s=this._instance.persistence)==null||s.register({[aie]:d});var p={isLoaded:!0};e(d,p),n?.({surveys:d,context:p})}}))}ps(e){for(var t of this.ds)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(n){vs.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!ra(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);vs.warn("init was not called")}_s(e){var t=null;return this.getSurveys((n=>{var r;t=(r=n.find((a=>a.id===e)))!==null&&r!==void 0?r:null})),t}gs(e){if(ra(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this._s(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ra(this._surveyManager))return vs.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gs(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ra(this._surveyManager)?(vs.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((r=>{var a,s=(a=r.find((o=>o.id===e)))!==null&&a!==void 0?a:null;if(s){var i=this.gs(s);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,n){var r;if(ra(this._surveyManager))vs.warn("init was not called");else{var a=typeof e=="string"?this._s(e):e;if(a!=null&&a.id)if(TSr.includes(a.type)){var s=qt?.querySelector(t);if(s)return(r=a.appearance)!=null&&r.surveyPopupDelaySeconds?(vs.info("Rendering survey "+a.id+" with delay of "+a.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,o;vs.info("Rendering survey "+a.id+" with delay of "+((i=a.appearance)==null?void 0:i.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(a,s,n),vs.info("Survey "+a.id+" rendered")}),1e3*a.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(a,s,n);vs.warn("Survey element not found")}else vs.warn("Surveys of type "+a.type+" cannot be rendered in the app");else vs.warn("Survey not found")}}displaySurvey(e,t){var n;if(ra(this._surveyManager))vs.warn("init was not called");else{var r=this._s(e);if(r){var a=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(a=Ft({},r,{appearance:Ft({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==die.Popover&&t.initialResponses&&vs.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var s=this.canRenderSurvey(r);if(!s.visible)return void vs.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==die.Inline?this._surveyManager.handlePopoverSurvey(a,t):this.renderSurvey(a,t.selector,t.properties)}else vs.warn("Survey not found")}}cancelPendingSurvey(e){ra(this._surveyManager)?vs.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},S9),v1r={toolbar:class{constructor(e){this.instance=e}bs(e){zn.ph_toolbar_state=e}ys(){var e;return(e=zn.ph_toolbar_state)!==null&&e!==void 0?e:_y.UNINITIALIZED}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),c1t(this.instance.config)||!Ye||!qt)return!1;e=e??Ye.location,n=n??Ye.history;try{if(!t){try{Ye.localStorage.setItem("test","test"),Ye.localStorage.removeItem("test")}catch{return!1}t=Ye?.localStorage}var r,a=JSr||LL(e.hash,"__posthog")||LL(e.hash,"state"),s=a?nze((()=>JSON.parse(atob(decodeURIComponent(a)))))||nze((()=>JSON.parse(decodeURIComponent(a)))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(Bze)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}ws(e){var t=zn.ph_load_toolbar||zn.ph_load_editor;!ra(t)&&Fg(t)?t(e,this.instance):Uze.warn("No toolbar load function found")}loadToolbar(e){var t=!(qt==null||!qt.getElementById(p1t));if(!Ye||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=Ft({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(Ye.localStorage.setItem(Bze,JSON.stringify(Ft({},r,{source:void 0}))),this.ys()===_y.LOADED)this.ws(r);else if(this.ys()===_y.UNINITIALIZED){var a;this.bs(_y.LOADING),(a=zn.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return Uze.error("[Toolbar] Failed to load",s),void this.bs(_y.UNINITIALIZED);this.bs(_y.LOADED),this.ws(r)})),io(Ye,"turbolinks:load",(()=>{this.bs(_y.UNINITIALIZED),this.loadToolbar(r)}))}return!0}Es(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},y1r=Ft({experiments:Ml},S9),b1r={conversations:class{constructor(e){this.Ss=void 0,this._conversationsManager=null,this.xs=!1,this.$s=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;ra(t)||(Zg(t)?this.Ss=t:(this.Ss=t.enabled,this.$s=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Ss=void 0,this.$s=null}loadIfEnabled(){if(!(this._conversationsManager||this.xs||this._instance.config.disable_conversations||c1t(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=zn?.__PosthogExtensions__;if(e&&!Wt(this.Ss)&&this.Ss)if(this.$s&&this.$s.token){this.xs=!0;try{var t=e.initConversations;if(t)return this.ks(t),void(this.xs=!1);var n=e.loadExternalDependency;if(!n)return void this.Ps("PostHog loadExternalDependency extension not found.");n(this._instance,"conversations",(r=>{r||!e.initConversations?this.Ps("Could not load conversations script",r):this.ks(e.initConversations),this.xs=!1}))}catch(r){this.Ps("Error initializing conversations",r),this.xs=!1}}else ff.error("Conversations enabled but missing token in remote config.")}}ks(e){if(this.$s)try{this._conversationsManager=e(this.$s,this._instance),ff.info("Conversations loaded successfully")}catch(t){this.Ps("Error completing conversations initialization",t)}else ff.error("Cannot complete initialization: remote config is null")}Ps(e,t){ff.error(e,t),this._conversationsManager=null,this.xs=!1}show(){this._conversationsManager?this._conversationsManager.show():ff.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ss===!0&&!uh(this._conversationsManager)}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return kg((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(ff.warn("Conversations not available yet."),null)}))()}getMessages(e,t){var n=this;return kg((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(ff.warn("Conversations not available yet."),null)}))()}markAsRead(e){var t=this;return kg((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ff.warn("Conversations not available yet."),null)}))()}getTickets(e){var t=this;return kg((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ff.warn("Conversations not available yet."),null)}))()}requestRestoreLink(e){var t=this;return kg((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ff.warn("Conversations not available yet."),null)}))()}restoreFromToken(e){var t=this;return kg((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ff.warn("Conversations not available yet."),null)}))()}restoreFromUrlToken(){var e=this;return kg((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ff.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}}},x1r={logs:class{constructor(e){var t;this.Ts=!1,this.Rs=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.Ts=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,n=(t=e.logs)==null?void 0:t.captureConsoleLogs;!ra(n)&&n&&(this.Ts=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ts&&!this.Rs){var e=yi("[logs]"),t=zn?.__PosthogExtensions__;if(t){var n=t.loadExternalDependency;n?n(this._instance,"logs",(r=>{var a;r||(a=t.logs)==null||!a.initializeLogs?e.error("Could not load logs script",r):(t.logs.initializeLogs(this._instance),this.Rs=!0)})):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}},w1r=Ft({},S9,u1r,d1r,f1r,p1r,h1r,g1r,m1r,v1r,y1r,b1r,x1r);Wh.__defaultExtensionClasses=Ft({},w1r);var Qze,Rg=(Qze=mT[D1]=new Wh,(function(){function e(){e.done||(e.done=!0,P1t=!1,Ps(mT,(function(t){t._dom_loaded()})))}qt!=null&&qt.addEventListener?qt.readyState==="complete"?e():io(qt,"DOMContentLoaded",e,{capture:!1}):Ye&&Zt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),Qze),Q1t=x.createContext({client:Rg,bootstrap:void 0});function W1t(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var s=0,i=r;s<i.length;s++){var o=i[s];if(!a.includes(o)||!W1t(e[o],t[o],n))return!1}return!0}function S1r(e){var t,n,r=e.children,a=e.client,s=e.apiKey,i=e.options,o=x.useRef(null),c=x.useMemo(function(){return a?(s&&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`."),a):(s||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),Rg)},[a,s,JSON.stringify(i)]);return x.useEffect(function(){if(!a){var u=o.current;u?(s!==u.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),i&&!W1t(i,u.options)&&Rg.set_config(i),o.current={apiKey:s,options:i??{}}):(Rg.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),Rg.init(s,i),o.current={apiKey:s,options:i??{}})}},[a,s,JSON.stringify(i)]),Ee.createElement(Q1t.Provider,{value:{client:c,bootstrap:(t=i?.bootstrap)!==null&&t!==void 0?t:(n=a?.config)===null||n===void 0?void 0:n.bootstrap}},r)}var See=function(e){return typeof e=="function"},bie=function(e,t){return bie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},bie(e,t)};function O1r(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");bie(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var k1r={componentStack:null,exceptionEvent:null,error:null},_1r={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){O1r(t,e);function t(n){var r=e.call(this,n)||this;return r.state=k1r,r}return t.prototype.componentDidCatch=function(n,r){var a=this.props.additionalProperties,s;See(a)?s=a(n):typeof a=="object"&&(s=a);var i=this.context.client,o=i.captureException(n,s),c=r.componentStack;this.setState({error:n,componentStack:c??null,exceptionEvent:o})},t.prototype.render=function(){var n=this.props,r=n.children,a=n.fallback,s=this.state;if(s.componentStack==null)return See(r)?r():r;var i=See(a)?Ee.createElement(a,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):a;return Ee.isValidElement(i)?i:(console.warn(_1r.INVALID_FALLBACK),Ee.createElement(Ee.Fragment,null))},t.contextType=Q1t,t})(Ee.Component);function E1r({children:e}){return x.useEffect(()=>{if("brave"in navigator){console.info("[Analytics]: Telemetry is disabled for browser constraints.");return}if(window.MASTRA_TELEMETRY_DISABLED){console.info("[Analytics]: Telemetry is disabled.");return}Rg.init("phc_SBLpZVAB6jmHOct9CABq3PF0Yn5FU3G2FgT4xUr2XrT",{api_host:"https://us.posthog.com"}),Rg.register({mastraSource:"playground"})},[]),l.jsx(S1r,{client:Rg,children:e})}const C1r=["/swagger-ui","/openapi.json"],G1t=x.forwardRef(({children:e,href:t,...n},r)=>t&&C1r.some(s=>t.startsWith(s))?l.jsx("a",{ref:r,href:t,...n,children:e}):l.jsx(Lt,{ref:r,to:t,viewTransition:!0,...n,children:e})),Z1t="experimental-ui:",Y1t="current",vve=Ee.createContext(null);function rE(e){const t=Ee.useContext(vve);if(!t)throw new Error("useExperimentalUI must be used within an ExperimentalUIProvider.");return{variant:t.getVariant(e),setVariant:n=>t.setVariant(e,n)}}function j1r(){return Ee.useContext(vve)}function T1r(e,t){const n=window.localStorage.getItem(Z1t+e);return n&&t.has(n)?n:Y1t}function N1r({experiments:e,children:t}){const n=Ee.useMemo(()=>new Map(e.map(c=>[c.key,new Set(c.variants.map(u=>u.value))])),[e]),[r,a]=Ee.useState({});Ee.useLayoutEffect(()=>{const c={};for(const u of e){const d=n.get(u.key);c[u.key]=T1r(u.key,d)}a(c)},[e,n]);const s=Ee.useCallback(c=>r[c]??Y1t,[r]),i=Ee.useCallback((c,u)=>{window.localStorage.setItem(Z1t+c,u),a(d=>({...d,[c]:u}))},[]),o=Ee.useMemo(()=>({experiments:e,getVariant:s,setVariant:i}),[e,s,i]);return l.jsx(vve.Provider,{value:o,children:t})}function A1r(){const{data:e={},isLoading:t,error:n}=ch(),{variant:r}=rE("entity-list-page"),[a,s]=x.useState(""),{canCreateAgent:i}=Sge(),{Link:o,paths:c}=Pt(),u=c.cmsAgentCreateLink(),d=i&&!!u;return r==="new-proposal"?l.jsxs(us,{children:[l.jsxs(us.Top,{children:[l.jsxs(pt,{withMargins:!1,children:[l.jsx(pt.Column,{children:l.jsxs(pt.Title,{isLoading:t,children:[l.jsx(hs,{})," Agents"]})}),l.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[d&&l.jsx(Gi,{as:o,to:u,tooltipContent:"Create an agent",children:l.jsx(L$,{})}),l.jsx(Gi,{as:"a",href:"https://mastra.ai/en/docs/agents/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Agents documentation",children:l.jsx(Zl,{})})]})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(vS,{onSearch:s,label:"Filter agents",placeholder:"Filter by name or instructions"})})]}),l.jsx(Fpr,{agents:e,isLoading:t,error:n,search:a})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(hs,{})}),"Agents"]}),l.jsxs(Ss,{children:[d&&l.jsxs(ge,{variant:"light",as:o,to:u,children:[l.jsx(ke,{children:l.jsx(L$,{})}),"Create an agent"]}),l.jsxs(ge,{variant:"ghost",size:"md",as:Lt,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",children:[l.jsx(qi,{}),"Agents documentation"]})]})]}),l.jsx(Ki,{isCentered:!t&&Object.keys(e||{}).length===0,children:l.jsx(Oor,{agents:e,isLoading:t,error:n})})]})}function I1r({agentId:e,threadId:t,threads:n,isLoading:r}){const{mutateAsync:a}=Kir(),{paths:s,navigate:i}=Pt(),o=async c=>{await a({threadId:c,agentId:e}),c===t&&i(s.agentNewThreadLink(e))};return l.jsx(ocr,{resourceId:e,resourceType:"agent",threads:n||[],isLoading:r,threadId:t,onDelete:o})}function Wze(){const{agentId:e,threadId:t}=ms(),[n]=_o(),{data:r,isLoading:a,error:s}=Hd(e),{data:i}=J_(e),o=Fc(),c=t==="new",u=x.useMemo(()=>Hi(),[t]),d=!!i?.result,{data:f,isLoading:p,refetch:h}=bxt({agentId:e,isMemoryEnabled:d,resourceId:e});x.useEffect(()=>{t||o(`/agents/${e}/chat/new`)},[t,e,o]);const m=n.get("messageId")??void 0,g=x.useMemo(()=>{if(!r)return{modelSettings:{}};const S=r.defaultOptions,{maxOutputTokens:O,...k}=S?.modelSettings??{};return{modelSettings:{...k,...O!==void 0&&{maxTokens:O},...S?.maxSteps!==void 0&&{maxSteps:S.maxSteps},...S?.providerOptions!==void 0&&{providerOptions:S.providerOptions}}}},[r]);if(s&&xa(s))return l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"agents"})});if(a)return null;if(!r)return l.jsx("div",{className:"text-center py-4",children:"Agent not found"});if(!t)return null;const v=c?u:t,b=async()=>{await h(),c&&o(`/agents/${e}/chat/${u}`)};return l.jsx(uge,{entityId:e,entityType:"agent",children:l.jsx(Xme,{agentId:e,defaultSettings:g,children:l.jsx(uxt,{agentId:e,threadId:v,resourceId:e,children:l.jsx(sxt,{children:l.jsx(pxt,{children:l.jsx(Zbt,{children:l.jsx(Acr,{agentId:e,leftSlot:d&&l.jsx(I1r,{agentId:e,threadId:v,threads:f||[],isLoading:p}),rightSlot:l.jsx(jcr,{agentId:e,threadId:v}),children:l.jsx(wge,{agentId:e,agentName:r?.name,modelVersion:r?.modelVersion,threadId:v,memory:d,refreshThreadList:b,modelList:r?.modelList,messageId:m,isNewThread:c},v)})},`${e}-${v}`)})})})})})}const vD="__custom__",R1r=()=>{const e=Hbt(),{requestContext:t,setRequestContext:n}=Vr(),r=x.useMemo(()=>{if(!e)return vD;const s=JSON.stringify(t??{});for(const[i,o]of Object.entries(e))if(JSON.stringify(o)===s)return i;return vD},[e,t]),a=s=>{if(s===vD){n({});return}if(!e)return;const i=e[s];i&&n(i)};return l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(lb,{className:"h-5 w-8 shrink-0"}),"Mastra Studio",l.jsx(Use,{})]}),e&&Object.keys(e).length>0&&l.jsx(Ss,{children:l.jsxs(Zs,{value:r,onValueChange:a,children:[l.jsx(Ds,{size:"sm",className:"w-[200px]",children:l.jsx(Ys,{placeholder:"Select a preset..."})}),l.jsxs($s,{children:[l.jsx(Yr,{value:vD,children:"Custom"}),Object.keys(e).map(s=>l.jsx(Yr,{value:s,children:s},s))]})]})})]})};function Gze(){const{agentId:e,threadId:t}=ms(),[n]=_o(),{data:r,isLoading:a}=Hd(e),{data:s}=J_(e),i=Fc(),o=t==="new",c=x.useMemo(()=>Hi(),[t]),u=!!s?.result,{refetch:d}=bxt({resourceId:e,agentId:e,isMemoryEnabled:u});x.useEffect(()=>{u&&(t||i(`/agents/${e}/session/new`))},[u,t,e,i]);const f=n.get("messageId")??void 0,p=x.useMemo(()=>{if(!r)return{modelSettings:{}};const g=r.defaultOptions,{maxOutputTokens:v,...b}=g?.modelSettings??{};return{modelSettings:{...b,...v!==void 0&&{maxTokens:v},...g?.maxSteps!==void 0&&{maxSteps:g.maxSteps},...g?.providerOptions!==void 0&&{providerOptions:g.providerOptions}}}},[r]);if(a)return null;if(!r)return l.jsx("div",{className:"text-center py-4",children:"Agent not found"});const h=o?c:t??c,m=async()=>{await d(),o&&i(`/agents/${e}/session/${c}`)};return l.jsx(uge,{entityId:e,entityType:"agent",children:l.jsx(Xme,{agentId:e,defaultSettings:p,children:l.jsx(Gz,{children:l.jsx(uxt,{agentId:e,threadId:h,resourceId:e,children:l.jsx(sxt,{children:l.jsx(pxt,{children:l.jsx(Zbt,{children:l.jsxs(Nn,{children:[l.jsx(R1r,{}),l.jsx("div",{className:"grid overflow-y-auto relative bg-surface1 h-full pt-6",children:l.jsx(wge,{agentId:e,agentName:r?.name,modelVersion:r?.modelVersion,threadId:h,memory:u,refreshThreadList:m,modelList:r?.modelList,messageId:f,isNewThread:o,hideModelSwitcher:!0},h)})]})})})})})})})})}function P1r(){const{agentId:e}=ms(),{navigate:t}=Pt(),{data:n,isLoading:r,error:a}=Hd(e),{data:s,isLoading:i}=Cge(e,{status:"draft"}),o=n?.source==="code",c=r||i,u=x.useMemo(()=>s||(n?Rge(n):{}),[s,n]),{form:d,handlePublish:f,handleSaveDraft:p,isSubmitting:h,isSavingDraft:m}=f9({mode:"edit",agentId:e??"",dataSource:u,isCodeAgentOverride:o,hasStoredOverride:o&&!!s,onSuccess:()=>{}}),[g,v]=x.useState(()=>{const b=sessionStorage.getItem(`pending-scorer-items-${e}`);if(b){sessionStorage.removeItem(`pending-scorer-items-${e}`);try{return JSON.parse(b)}catch{return null}}return null});return a&&xa(a)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"agents"})}):c?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ht,{className:"h-6 w-6"})}):n?l.jsx(bge,{form:d,mode:"edit",agentId:e,isSubmitting:h,isSavingDraft:m,handlePublish:f,handleSaveDraft:p,isCodeAgentOverride:o,readOnly:!1,children:l.jsx(mpr,{agentId:e,onSwitchToReview:()=>t(`/agents/${e}/review`),pendingScorerItems:g,onPendingScorerItemsConsumed:()=>v(null)})}):l.jsx("div",{className:"text-center py-4",children:"Agent not found"})}function M1r(){const{agentId:e}=ms(),[t,n]=x.useState(null),{data:r,isLoading:a,error:s}=Hd(e),{data:i,isLoading:o}=Cge(e,{status:"draft"}),{data:c}=J_(e),u=r?.source==="code",d=a||o,f=!!c?.result,{data:p}=n0t({agentId:e??"",versionId:t??""}),{data:h}=gS({agentId:e??"",params:{sortDirection:"DESC"}}),m=i?.activeVersionId,g=h?.versions?.[0],v=!!(g&&g.id!==m),b=!!t&&!!p,S=b&&t!==g?.id,O=x.useMemo(()=>b&&p?p:i||(r?Rge(r):{}),[b,p,i,r]),{form:k,handlePublish:E,handleSaveDraft:C,isSubmitting:T,isSavingDraft:j,isDirty:A}=f9({mode:"edit",agentId:e??"",dataSource:O,isCodeAgentOverride:u,hasStoredOverride:u&&!!i,onSuccess:()=>{}}),I=x.useCallback(P=>{P===g?.id?n(null):n(P)},[g?.id]);return s&&xa(s)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"agents"})}):d?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ht,{className:"h-6 w-6"})}):r?l.jsx(bge,{form:k,mode:"edit",agentId:e,isSubmitting:T,isSavingDraft:j,handlePublish:E,handleSaveDraft:C,isCodeAgentOverride:u,readOnly:S,children:l.jsx(vfr,{agentId:e,agentName:r?.name,modelVersion:r?.modelVersion,hasMemory:f,activeVersionId:m,selectedVersionId:t??void 0,latestVersionId:g?.id,onVersionSelect:I,isDirty:A,isSavingDraft:j,isPublishing:T,hasDraft:v,readOnly:S,onSaveDraft:C,onPublish:E})}):l.jsx("div",{className:"text-center py-4",children:"Agent not found"})}function D1r(){const{agentId:e}=ms(),{navigate:t}=Pt(),{data:n,isLoading:r,error:a}=Hd(e);if(a&&xa(a))return l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"agents"})});if(r)return l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ht,{className:"h-6 w-6"})});if(!n)return l.jsx("div",{className:"text-center py-4",children:"Agent not found"});const s=i=>{sessionStorage.setItem(`pending-scorer-items-${e}`,JSON.stringify(i)),t(`/agents/${e}/evaluate`)};return l.jsx(wpr,{agentId:e,onCreateScorer:s})}function $1r(){const{agentId:e}=ms();return l.jsx($pr,{agentId:e})}function L1r(){return l.jsx(sdr,{})}function F1r(){const{navigate:e,paths:t}=Pt(),n=Lc(),{form:r,handlePublish:a,isSubmitting:s,canPublish:i}=f9({mode:"create",onSuccess:o=>e(t.agentLink(o))});return l.jsxs(Nn,{children:[l.jsxs(Un,{className:"bg-surface1",children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(hs,{})}),"Create an agent"]}),l.jsx(Ss,{children:l.jsx(ge,{variant:"primary",onClick:a,disabled:s||!i,className:"w-full",children:s?l.jsxs(l.Fragment,{children:[l.jsx(Ht,{className:"h-4 w-4"}),"Creating..."]}):l.jsxs(l.Fragment,{children:[l.jsx(ke,{children:l.jsx(PQe,{})}),"Create agent"]})})})]}),l.jsx(uwt,{form:r,mode:"create",isSubmitting:s,handlePublish:a,basePath:"/cms/agents/create",currentPath:n.pathname,children:l.jsx(Gk,{})})]})}function Zze({agentId:e,selectedVersionId:t,versionData:n,readOnly:r=!1,form:a,handlePublish:s,handleSaveDraft:i,isSubmitting:o,isSavingDraft:c,onVersionSelect:u,activeVersionId:d,latestVersionId:f,hideVersionPanel:p=!1,isCodeAgentOverride:h=!1}){const[,m]=_o(),g=Lc(),S=!!t&&!!n&&t!==f?l.jsxs(Mf,{variant:"info",className:"mb-4",children:[l.jsx(Df,{children:"This is a previous version"}),l.jsx(hv,{as:"p",children:"You are seeing a specific version of the agent."}),l.jsx("div",{className:"pt-2",children:l.jsx(ge,{type:"button",variant:"light",size:"sm",onClick:()=>m({}),children:"View latest version"})})]}):void 0,O=p?void 0:l.jsx(rfr,{agentId:e,selectedVersionId:t??void 0,onVersionSelect:u,activeVersionId:d});return l.jsx(uwt,{form:a,mode:"edit",agentId:e,isSubmitting:o,isSavingDraft:c,handlePublish:s,handleSaveDraft:i,readOnly:r,isCodeAgentOverride:h,basePath:`/cms/agents/${e}/edit`,currentPath:g.pathname,banner:S,versionId:t??void 0,rightPanel:O,children:l.jsx(Gk,{})})}function z1r(){const{agentId:e}=ms(),{navigate:t,paths:n}=Pt(),r=Fc(),a=Lc(),[s,i]=_o(),o=s.get("versionId"),{data:c,isLoading:u}=Hd(e),{data:d,isLoading:f}=Cge(e,{status:"draft"}),p=c?.source==="code",h=d??null,m=u||f,g=`/cms/agents/${e}/edit`,v=a.pathname===g||a.pathname===`${g}/`;x.useEffect(()=>{p&&v&&r(`${g}/instruction-blocks${a.search}${a.hash}`,{replace:!0})},[p,v,r,g,a.search,a.hash]);const{data:b}=n0t({agentId:e??"",versionId:o??""}),{data:S}=gS({agentId:e??"",params:{sortDirection:"DESC"}}),O=h?.activeVersionId,k=S?.versions?.[0],E=!!(k&&k.id!==O),C=!!o&&!!b,T=x.useMemo(()=>C&&b?b:h||(c?Rge(c):{}),[C,b,h,c]),j=h?.name??c?.name,{form:A,handlePublish:I,handleSaveDraft:P,isSubmitting:M,isSavingDraft:F,isDirty:D}=f9({mode:"edit",agentId:e??"",dataSource:T,isCodeAgentOverride:p,hasStoredOverride:p&&!!d,onSuccess:q=>t(n.agentLink(q))}),V=x.useCallback(q=>{i(q?{versionId:q}:{})},[i]),H=!m&&!h&&!c,B=!m&&!!e&&(!!h||!!c);return l.jsxs(Nn,{children:[l.jsxs(Un,{className:"bg-surface1",children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(hs,{})}),m&&l.jsx(Fn,{className:"h-6 w-[200px]"}),H&&"Agent not found",B&&`Edit agent: ${j}`,B&&E&&l.jsx(rt,{variant:"info",children:"Unpublished changes"})]}),B&&l.jsxs(Ss,{children:[l.jsx(ge,{onClick:P,disabled:!D||F||M,children:F?l.jsxs(l.Fragment,{children:[l.jsx(Ht,{className:"h-4 w-4"}),"Saving..."]}):l.jsxs(l.Fragment,{children:[l.jsx(D4t,{}),"Save"]})}),l.jsx(ge,{variant:"primary",onClick:I,disabled:!E&&!D||M||F,children:M?l.jsxs(l.Fragment,{children:[l.jsx(Ht,{className:"h-4 w-4"}),"Publishing..."]}):l.jsxs(l.Fragment,{children:[l.jsx(PQe,{}),"Publish"]})})]})]}),H?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Agent not found"}),l.jsx("div",{className:"hidden",children:l.jsx(Zze,{agentId:e??"",selectedVersionId:o,versionData:b,readOnly:!0,form:A,handlePublish:I,handleSaveDraft:P,isSubmitting:M,isSavingDraft:F,onVersionSelect:V,activeVersionId:O,latestVersionId:k?.id})})]}):l.jsx(Zze,{agentId:e??"",selectedVersionId:o,versionData:b,form:A,handlePublish:I,handleSaveDraft:P,isSubmitting:M,isSavingDraft:F,onVersionSelect:V,activeVersionId:O,latestVersionId:k?.id,hideVersionPanel:p&&!d,isCodeAgentOverride:p})]})}function B1r(){return l.jsx(Uur,{})}function U1r(){return l.jsx(P0t,{})}function V1r(){return l.jsx(cdr,{})}function q1r(){return l.jsx(idr,{})}function H1r(){return l.jsx(Wdr,{})}function Q1r(){return l.jsx($0t,{})}function W1r(){return l.jsx(vdr,{})}function G1r(){return l.jsx(ldr,{})}function Z1r(){const{navigate:e,paths:t}=Pt();return l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(Zl,{})}),"Create a prompt block"]})}),l.jsx(iur,{onSuccess:n=>e(t.cmsPromptBlockEditLink(n.id))})]})}function Yze(e){return{name:e.name,description:e.description||void 0,content:e.content,rules:e.rules||void 0,requestContextSchema:e.variables||void 0}}function Y1r({block:e,blockId:t,selectedVersionId:n,hasDraft:r}){const a=qe(),s=ts(),{navigate:i,paths:o}=Pt(),{updateStoredPromptBlock:c}=i9(t),[u,d]=x.useState(!1),[f,p]=x.useState(!1),{data:h}=fur({blockId:t,versionId:n??""}),m=!!n&&!!h,g=m?h:e,v=x.useMemo(()=>({name:g.name||"",description:g.description||"",content:g.content||"",rules:g.rules,variables:g.requestContextSchema}),[g]),{form:b}=y0t({initialValues:v}),[S,O]=x.useState(0);x.useEffect(()=>{v&&!b.formState.isDirty&&(b.reset(v),O(C=>C+1))},[v,b]);const k=x.useCallback(async()=>{if(!await b.trigger()){De.error("Please fill in all required fields");return}p(!0);try{const T=Yze(b.getValues());await c.mutateAsync(T),b.reset(b.getValues()),De.success("Draft saved")}catch(T){De.error(`Failed to save draft: ${T instanceof Error?T.message:"Unknown error"}`)}finally{p(!1)}},[b,c]),E=x.useCallback(async()=>{if(!await b.trigger()){De.error("Please fill in all required fields");return}d(!0);try{const T=Yze(b.getValues());await c.mutateAsync(T);const A=(await a.getStoredPromptBlock(t).listVersions({sortDirection:"DESC",perPage:1})).versions[0];if(!A)throw new Error("No version found to publish");await a.getStoredPromptBlock(t).activateVersion(A.id),s.invalidateQueries({queryKey:["stored-prompt-blocks"]}),s.invalidateQueries({queryKey:["stored-prompt-block"]}),s.invalidateQueries({queryKey:["prompt-block-versions",t]}),De.success("Prompt block published"),i(o.promptBlocksLink())}catch(T){De.error(`Failed to publish: ${T instanceof Error?T.message:"Unknown error"}`)}finally{d(!1)}},[b,c,a,t,i,o,s]);return l.jsxs(Db,{leftSlot:l.jsx(v0t,{form:b,onPublish:E,onSaveDraft:k,isSubmitting:u,isSavingDraft:f,isDirty:b.formState.isDirty,hasDraft:r,formResetKey:S,mode:"edit",blockId:t}),children:[m&&l.jsxs(Mf,{variant:"info",className:"m-4 mb-0",children:[l.jsx(Df,{children:"This is a previous version"}),l.jsx(hv,{as:"p",children:"You are seeing a specific version of the prompt block."})]}),l.jsx("form",{className:"h-full",children:l.jsx(i0t,{form:b})})]})}function X1r(){const{promptBlockId:e}=ms(),[t,n]=_o(),r=t.get("versionId"),{data:a,isLoading:s}=s0t(e,{status:"draft"}),{data:i}=b0t({blockId:e??"",params:{sortDirection:"DESC"}}),o=a?.activeVersionId,c=i?.versions?.[0],u=!!(c&&(!o||c.id!==o)),d=x.useCallback(f=>{n(f?{versionId:f}:{})},[n]);return s?l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(Zl,{})}),l.jsx(Fn,{className:"h-6 w-[200px]"})]})}),l.jsx(Db,{leftSlot:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Ht,{className:"h-8 w-8"})}),children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Ht,{className:"h-8 w-8"})})})]}):!a||!e?l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(Zl,{})}),"Prompt block not found"]})}),l.jsx(Db,{leftSlot:l.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Prompt block not found"}),children:l.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Prompt block not found"})})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(Zl,{})}),"Edit prompt block: ",a.name,u&&l.jsx(rt,{variant:"info",children:"Unpublished changes"})]}),l.jsx(Ss,{children:l.jsx(hur,{blockId:e,value:r??"",onValueChange:d,activeVersionId:o})})]}),l.jsx(Y1r,{block:a,blockId:e,selectedVersionId:r,hasDraft:u})]})}function K1r(){const{navigate:e,paths:t}=Pt();return l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(S0,{})}),"Create a scorer"]})}),l.jsx(qlr,{onSuccess:n=>e(t.scorerLink(n.id))})]})}function Xze(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 J1r({scorer:e,scorerId:t,selectedVersionId:n}){const r=qe(),a=ts(),{navigate:s,paths:i}=Pt(),{updateStoredScorer:o}=_ge(t),[c,u]=x.useState(!1),[d,f]=x.useState(!1),p=x.useRef(null),{data:h}=Qlr({scorerId:t,versionId:n??""}),m=!!n&&!!h,g=m?h:e,v=x.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:b}=Uxt({initialValues:v});x.useEffect(()=>{v&&b.reset(v)},[v,b]);const S=x.useCallback(async()=>{if(!await b.trigger()){De.error("Please fill in all required fields");return}f(!0);try{const E=Xze(b.getValues());await o.mutateAsync(E),De.success("Draft saved")}catch(E){De.error(`Failed to save draft: ${E instanceof Error?E.message:"Unknown error"}`)}finally{f(!1)}},[b,o]),O=x.useCallback(async()=>{if(!await b.trigger()){De.error("Please fill in all required fields");return}u(!0);try{const E=Xze(b.getValues());await o.mutateAsync(E);const T=(await r.getStoredScorer(t).listVersions({sortDirection:"DESC",perPage:1})).versions[0];T&&await r.getStoredScorer(t).activateVersion(T.id),a.invalidateQueries({queryKey:["scorers"]}),a.invalidateQueries({queryKey:["stored-scorers"]}),De.success("Scorer published"),s(i.scorerLink(t))}catch(E){De.error(`Failed to publish scorer: ${E instanceof Error?E.message:"Unknown error"}`)}finally{u(!1)}},[b,o,r,t,s,i,a]);return l.jsxs(Db,{leftSlot:l.jsx(zxt,{form:b,onPublish:O,onSaveDraft:S,isSubmitting:c,isSavingDraft:d,formRef:p,mode:"edit"}),children:[m&&l.jsxs(Mf,{variant:"info",className:"m-4 mb-0",children:[l.jsx(Df,{children:"This is a previous version"}),l.jsx(hv,{as:"p",children:"You are seeing a specific version of the scorer."})]}),l.jsx("form",{ref:p,className:"h-full",children:l.jsx(Bxt,{form:b})})]})}function eOr(){const{scorerId:e}=ms(),[t,n]=_o(),r=t.get("versionId"),{data:a,isLoading:s}=Vlr(e,{status:"draft"}),{data:i}=Vxt({scorerId:e??"",params:{sortDirection:"DESC"}}),o=a?.activeVersionId,c=i?.versions?.[0],u=!!(c&&o&&c.id!==o),d=x.useCallback(f=>{n(f?{versionId:f}:{})},[n]);return s?l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(S0,{})}),l.jsx(Fn,{className:"h-6 w-[200px]"})]})}),l.jsx(Db,{leftSlot:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Ht,{className:"h-8 w-8"})}),children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Ht,{className:"h-8 w-8"})})})]}):!a||!e?l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(S0,{})}),"Scorer not found"]})}),l.jsx(Db,{leftSlot:l.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Scorer not found"}),children:l.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Scorer not found"})})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(S0,{})}),"Edit scorer: ",a.name,u&&l.jsx(rt,{variant:"info",children:"Unpublished changes"})]}),l.jsx(Ss,{children:l.jsx(Glr,{scorerId:e,value:r??"",onValueChange:d,variant:"outline",activeVersionId:o})})]}),l.jsx(J1r,{scorer:a,scorerId:e,selectedVersionId:r})]})}const tOr=new Set(["items","experiments","review"]);function nOr(){const{datasetId:e}=ms(),t=Fc(),[n,r]=_o(),a=n.get("tab"),s=a&&tOr.has(a)?a:"items",i=C=>{r(C==="items"?{}:{tab:C},{replace:!0})},[o,c]=x.useState(!1),[u,d]=x.useState(!1),[f,p]=x.useState(!1),[h,m]=x.useState(!1),[g,v]=x.useState(null),{data:b,error:S}=zm(e??"");if(!e)return l.jsx(Nn,{children:l.jsx(Ki,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(S&&xa(S))return l.jsx(Nn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"datasets"})})});const O=C=>{t(`/evaluation/datasets/${e}/experiments/${C}`)},k=()=>{t("/evaluation?tab=datasets")},E=C=>{v(C?.version??null)};return l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=datasets",children:[l.jsx(ke,{children:l.jsx(Sd,{})}),"Datasets"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:l.jsx(Wmr,{value:e,variant:"ghost"})})]})}),l.jsxs(Ki,{className:"content-stretch",children:[l.jsx(rvr,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>p(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:E,initialTab:s,onTabChange:i,experimentTriggerSlot:l.jsxs(ge,{variant:"primary",onClick:()=>c(!0),children:[l.jsx(R4t,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),l.jsx(cvr,{datasetId:e,version:g??void 0,open:o,onOpenChange:c,onSuccess:O}),l.jsx(svr,{datasetId:e,open:u,onOpenChange:d}),b&&l.jsx(Hmr,{open:f,onOpenChange:p,dataset:{id:b.id,name:b.name,description:b?.description||"",inputSchema:b.inputSchema,groundTruthSchema:b.groundTruthSchema}}),b&&l.jsx(Qmr,{open:h,onOpenChange:m,datasetId:b.id,datasetName:b.name,onSuccess:k})]})]})}function rOr(){const{datasetId:e,experimentId:t}=ms(),{data:n}=zm(e??""),{data:r,isLoading:a,error:s}=Pse(e,t),{data:i,isLoading:o,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=Pge({datasetId:e,experimentId:t,experimentStatus:r?.status});return!e||!t?null:a?l.jsx(Nn,{children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Ht,{})})}):s&&xa(s)?l.jsx(Nn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"datasets"})})}):s||!r?l.jsx(Nn,{children:l.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",s instanceof Error?s.message:"Unknown error"]})}):l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=datasets",children:[l.jsx(ke,{children:l.jsx(Sd,{})}),"Datasets"]}),l.jsx(En,{as:Lt,to:`/evaluation/datasets/${e}`,children:n?.name}),l.jsx(En,{isCurrent:!0,as:"span",children:"Experiment"})]})}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsx(Nvr,{experimentId:t,experiment:r}),l.jsx(Cvr,{experimentId:t,experimentStatus:r?.status,results:i??[],isLoading:o,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function aOr(){const{datasetId:e}=ms(),[t,n]=_o(),{data:r,error:a}=zm(e??""),s=t.get("baseline")??"",i=t.get("contender")??"";return a&&xa(a)?l.jsx(Nn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"datasets"})})}):!e||!s||!i?l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=datasets",children:[l.jsx(ke,{children:l.jsx(Sd,{})}),"Datasets"]}),l.jsxs(En,{isCurrent:!0,as:"span",children:[l.jsx(ke,{children:l.jsx(Mj,{})}),"Compare Experiments"]})]})}),l.jsx(Ki,{children:l.jsxs("div",{className:"text-neutral4 text-center py-8",children:[l.jsx("p",{children:"Select two experiments to compare."}),l.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/experiments?baseline=","{experimentIdA}","&contender=","{experimentIdB}"]})]})})]}):l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=datasets",children:[l.jsx(ke,{children:l.jsx(Sd,{})}),"Datasets"]}),l.jsx(En,{as:Lt,to:`/evaluation/datasets/${e}`,children:r?.name??e?.slice(0,8)}),l.jsxs(En,{isCurrent:!0,as:"span",children:[l.jsx(ke,{children:l.jsx(Mj,{})}),"Experiments Comparison"]})]})}),l.jsx(Ki,{children:l.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[l.jsxs(pt,{children:[l.jsxs(pt.Column,{children:[l.jsxs(pt.Title,{children:[l.jsx(Mj,{})," Dataset Experiments Comparison"]}),l.jsxs(pt.Description,{children:["Comparing"," ",l.jsx(Lt,{to:`/datasets/${e}/experiments/${s}`,children:s.slice(0,8)})," vs"," ",l.jsx(Lt,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),l.jsx(pt.Column,{children:l.jsxs(ge,{as:Lt,to:`/evaluation/datasets/${e}`,children:[l.jsx(KO,{}),"Back to Dataset"]})})]}),l.jsx(Pvr,{datasetId:e,experimentIdA:s,experimentIdB:i,onSwap:()=>{n({baseline:i,contender:s})}})]})})]})}function sOr(){const{datasetId:e,itemId:t}=ms(),{Link:n}=Pt(),r=Fc(),{data:a,isLoading:s,error:i}=Bge(e??"",t??""),{updateItem:o,deleteItem:c}=Js(),{data:u}=zm(e??""),d=a?.[0]??null,f=d?.isDeleted??!1,[p,h]=x.useState(null),m=x.useMemo(()=>!d||f?{input:"",groundTruth:"",metadata:""}:{input:JSON.stringify(d.input,null,2),groundTruth:d.groundTruth?JSON.stringify(d.groundTruth,null,2):"",metadata:d.metadata?JSON.stringify(d.metadata,null,2):""},[d,f]),g=d?.datasetVersion??0,[v,b]=x.useState(!1),[S,O]=x.useState(m.input),[k,E]=x.useState(m.groundTruth),[C,T]=x.useState(m.metadata),[j,A]=x.useState(g);g!==j&&(A(g),O(m.input),E(m.groundTruth),T(m.metadata));const[I,P]=x.useState(!1),M=z=>{h(f?z:z.isLatest?null:z)},F=()=>{h(null)},D=!f&&p!=null,V=()=>{D||b(!0)},H=()=>{D||P(!0)},B=async()=>{if(!e||!t)return;let z;try{z=JSON.parse(S)}catch{De.error("Input must be valid JSON");return}let R;if(k.trim())try{R=JSON.parse(k)}catch{De.error("Ground Truth must be valid JSON");return}let Q;if(C.trim())try{Q=JSON.parse(C)}catch{De.error("Metadata must be valid JSON");return}try{await o.mutateAsync({datasetId:e,itemId:t,input:z,groundTruth:R,metadata:Q}),De.success("Item updated successfully"),b(!1)}catch(G){De.error(`Failed to update item: ${G instanceof Error?G.message:"Unknown error"}`)}},q=()=>{d&&(O(JSON.stringify(d.input,null,2)),E(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),b(!1)},W=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),De.success("Item deleted successfully"),P(!1),r(`/evaluation/datasets/${e}`)}catch(z){De.error(`Failed to delete item: ${z instanceof Error?z.message:"Unknown error"}`)}},L=p??d,Z=L?{id:t??"",datasetId:e??"",datasetVersion:L.datasetVersion,input:L.input,groundTruth:L.groundTruth,metadata:L.metadata,createdAt:L.createdAt,updatedAt:L.updatedAt}:null;return i&&xa(i)?l.jsx(Nn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"datasets"})})}):s?null:!e||!t||!a||a.length===0?l.jsx(Nn,{children:l.jsx(Ki,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):l.jsxs(l.Fragment,{children:[l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=datasets",children:[l.jsx(ke,{children:l.jsx(Sd,{})}),"Datasets"]}),l.jsx(En,{as:Lt,to:`/evaluation/datasets/${e}`,children:u?.name}),l.jsx(En,{isCurrent:!0,as:"span",children:"Item"})]})}),l.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:l.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsxs(pt,{children:[l.jsxs(pt.Column,{children:[l.jsxs(pt.Title,{children:[l.jsx(m4t,{}),t," ",l.jsx(go,{content:t})]}),l.jsx(pt.Description,{children:l.jsxs(ua,{children:["Item of ",l.jsx(Sd,{})," ",u?.name]})}),l.jsxs(pt.Description,{children:[l.jsxs(ua,{children:[l.jsx(K3t,{})," Created at"," ",d?.createdAt?tr(new Date(d.createdAt),"MMM d, yyyy"):""]}),l.jsxs(ua,{children:[l.jsx(V5,{})," Latest version v",d?.datasetVersion??""]})]})]}),l.jsx(pt.Column,{children:!v&&!f&&l.jsxs(pi,{children:[l.jsxs(ge,{onClick:V,disabled:D,title:D?"Return to latest version to edit":void 0,children:[l.jsx(T4t,{})," Edit"]}),l.jsxs(ge,{onClick:H,disabled:D,title:D?"Return to latest version to delete":void 0,children:[l.jsx(Q4t,{})," Delete"]})]})})]}),l.jsxs(sx,{className:v?"grid-cols-1":"grid-cols-[1fr_auto]",children:[l.jsxs(Ar,{withRightSeparator:!v,children:[f&&d&&l.jsxs(Ko,{variant:"destructive",children:[l.jsx(cte,{}),l.jsxs(Ko.Message,{children:["This item was deleted at version v",d.datasetVersion]})]}),!f&&D&&p&&l.jsx(l.Fragment,{children:l.jsxs(Ko,{variant:"warning",children:[l.jsx(cte,{}),l.jsxs(Ko.Message,{children:["Viewing version v",p.datasetVersion]}),l.jsxs(Ko.Button,{onClick:F,children:[l.jsx(q3t,{})," Return to the latest version"]})]})}),v?l.jsx(Dwt,{inputValue:S,setInputValue:O,groundTruthValue:k,setGroundTruthValue:E,metadataValue:C,setMetadataValue:T,validationErrors:null,onSave:B,onCancel:q,isSaving:o.isPending}):Z?l.jsx(m9,{item:Z,Link:n}):l.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!v&&l.jsx(Ar,{children:l.jsx(Mvr,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:M,onCompareVersionsClick:z=>{r(`/evaluation/datasets/${e}/items/${t}/versions?ids=${z.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})]}),l.jsx(Gt,{open:I,onOpenChange:P,children:l.jsxs(Gt.Content,{children:[l.jsxs(Gt.Header,{children:[l.jsx(Gt.Title,{children:"Delete Item"}),l.jsx(Gt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),l.jsxs(Gt.Footer,{children:[l.jsx(Gt.Cancel,{children:"Cancel"}),l.jsx(Gt.Action,{onClick:W,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function Kze(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function iOr(){const{datasetId:e}=ms(),[t,n]=_o(),r=t.get("items")?.split(",").filter(Boolean)??[],{data:a,error:s}=zm(e??""),{Link:i}=Pt(),[o,c]=x.useState(!1),{data:u}=Dse(e??"",r[0]??""),{data:d}=Dse(e??"",r[1]??"");return s&&xa(s)?l.jsx(Nn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"datasets"})})}):!e||r.length<2?l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=datasets",children:[l.jsx(ke,{children:l.jsx(Sd,{})}),"Datasets"]}),l.jsx(En,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),l.jsx(Ki,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two items to compare."})})})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=datasets",children:[l.jsx(ke,{children:l.jsx(Sd,{})}),"Datasets"]}),l.jsx(En,{as:Lt,to:`/evaluation/datasets/${e}`,children:a?.name||e?.slice(0,8)}),l.jsx(En,{isCurrent:!0,as:"span",children:"Compare Items"})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:`/evaluation/datasets/${e}`,variant:"outline",children:[l.jsx(ke,{children:l.jsx(KO,{})}),"Back to Dataset"]})})]}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":o}),children:[l.jsxs(pt,{children:[l.jsxs(pt.Column,{children:[l.jsxs(pt.Title,{children:[l.jsx(Mj,{}),"Compare Dataset Items"]}),l.jsx(pt.Description,{children:l.jsxs(ua,{children:["Comparing ",r.length," items of"," ",l.jsx(Lt,{to:`/evaluation/datasets/${e}`,className:"text-info1 hover:underline",children:a?.name||e?.slice(0,8)})]})})]}),l.jsx(pt.Column,{children:l.jsxs(pi,{children:[l.jsxs(ge,{as:Lt,to:`/evaluation/datasets/${e}`,children:[l.jsx(KO,{}),"Back to Dataset"]}),l.jsx(ge,{variant:"primary",onClick:()=>c(f=>!f),children:o?l.jsxs(l.Fragment,{children:[l.jsx(MQe,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(c4t,{})," Diff View"]})})]})})]}),l.jsx(sx,{className:"grid-cols-[1fr_3vw_1fr]",children:r.map((f,p)=>l.jsxs(x.Fragment,{children:[l.jsx(oOr,{datasetId:e,itemId:f,Link:i,idx:p,itemIds:r,showContent:!o,onItemChange:h=>{const m=[...r];m[p]=h,n({items:m.join(",")})}}),p==0&&l.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),o&&u&&d&&l.jsx(Zwt,{codeA:Kze(u),codeB:Kze(d)})]})})]})}function oOr({datasetId:e,itemId:t,Link:n,idx:r,itemIds:a,onItemChange:s,showContent:i=!0}){const{data:o,isLoading:c}=Dse(e,t),{data:u}=Hk(e),d=new Set(a.filter((p,h)=>h!==r)),f=(u??[]).map(p=>({value:p.id,label:p.id,disabled:d.has(p.id)}));return l.jsxs(Ar,{children:[l.jsxs(Ar.Toolbar,{className:"flex gap-4",children:[l.jsx(s9,{label:"Item",name:`compare-item-${r}`,value:t,onValueChange:s,options:f,placeholder:"Select item",labelIsHidden:!0}),l.jsxs(ge,{as:n,to:`/datasets/${e}/items/${t}`,children:[l.jsx(V5,{}),"Versions"]})]}),i&&l.jsx(Ar.Content,{children:c?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):o?l.jsxs(l.Fragment,{children:[l.jsx($wt,{item:o}),l.jsx(m9,{item:o,Link:n})]}):l.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function Jze(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function lOr(){const{datasetId:e,itemId:t}=ms(),[n,r]=_o(),[a,s]=x.useState(!1),i=n.get("ids")?.split(",").map(Number).filter(h=>!isNaN(h)&&h>0)??[],{data:o,error:c}=zm(e??""),{Link:u}=Pt(),{data:d}=Bge(e??"",t??""),{data:f}=Bse(e??"",t??"",i[0]??0,o?.version),{data:p}=Bse(e??"",t??"",i[1]??0,o?.version);return c&&xa(c)?l.jsx(Nn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"datasets"})})}):!e||!t||i.length<2?l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=datasets",children:[l.jsx(ke,{children:l.jsx(Sd,{})}),"Datasets"]}),l.jsx(En,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),l.jsx(Ki,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two versions to compare."})})})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=datasets",children:[l.jsx(ke,{children:l.jsx(Sd,{})}),"Datasets"]}),l.jsx(En,{as:Lt,to:`/evaluation/datasets/${e}`,children:o?.name}),l.jsx(En,{as:Lt,to:`/datasets/${e}/items/${t}`,children:"Item"}),l.jsx(En,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[l.jsx(ke,{children:l.jsx(KO,{})}),"Back to Item"]})})]}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":a}),children:[l.jsxs(pt,{children:[l.jsxs(pt.Column,{children:[l.jsxs(pt.Title,{children:[l.jsx(Mj,{}),"Compare Dataset Item Versions"]}),l.jsx(pt.Description,{children:l.jsxs(ua,{children:["Comparing ",i.length," versions of"," ",l.jsx(Lt,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),l.jsx(pt.Column,{children:l.jsxs(pi,{children:[l.jsxs(ge,{as:Lt,to:`/datasets/${e}/items/${t}`,children:[l.jsx(KO,{}),"Back to Item"]}),l.jsx(ge,{variant:"primary",onClick:()=>s(h=>!h),children:a?l.jsxs(l.Fragment,{children:[l.jsx(MQe,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(w4t,{})," Diff View"]})})]})})]}),l.jsx(sx,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((h,m)=>l.jsxs(x.Fragment,{children:[l.jsx(cOr,{datasetId:e,itemId:t,datasetVersion:h,latestVersion:o?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!a,onVersionChange:g=>{const v=[...i];v[m]=g,r({ids:v.join(",")})}}),m===0&&l.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},h))}),a&&f&&p&&l.jsx(Zwt,{codeA:Jze(f),codeB:Jze(p)})]})})]})}function cOr({datasetId:e,itemId:t,datasetVersion:n,latestVersion:r,allVersions:a,versionNumbers:s,Link:i,idx:o,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Bse(e,t,n,r),p=new Set(s.filter((g,v)=>v!==o)),h=a.map(g=>{const v=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:l.jsxs(l.Fragment,{children:[l.jsxs("b",{children:["v. ",g.datasetVersion]})," - ",tr(v,"MMM d, yyyy h:mm a"),g.isLatest?l.jsx(ji,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:p.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 l.jsxs(Ar,{children:[l.jsxs(Ar.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[l.jsx(V5,{className:"w-6 h-6 opacity-50"}),l.jsx(s9,{label:"Version",name:`compare-version-${o}`,value:String(n),onValueChange:g=>u(Number(g)),options:h,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&l.jsx(Ar.Content,{children:f?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?l.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",n," not found"]}):l.jsx(m9,{item:m,Link:i})})]})}function uOr(){const{datasetId:e}=ms(),[t]=_o(),n=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],r=Fc(),{data:a,error:s}=zm(e??""),i=Hk(e??"",void 0,n[0]??null),o=Hk(e??"",void 0,n[1]??null),c=x.useMemo(()=>i.data??[],[i.data]),u=x.useMemo(()=>o.data??[],[o.data]),d=x.useMemo(()=>{const g=new Map;for(const v of[...c,...u])g.has(v.id)||g.set(v.id,{id:v.id,createdAt:new Date(v.createdAt)});return[...g.values()].sort((v,b)=>b.createdAt.getTime()-v.createdAt.getTime())},[c,u]),f=x.useMemo(()=>new Map(c.map(g=>[g.id,g])),[c]),p=x.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(s&&xa(s))return l.jsx(Nn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"datasets"})})});if(!e||n.length<2)return l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=datasets",children:[l.jsx(ke,{children:l.jsx(Sd,{})}),"Datasets"]}),l.jsx(En,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),l.jsx(Ki,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two versions to compare."})})})]});const h=(g,v,b)=>{r(`/datasets/${e}/items/${g}/versions?ids=${v?.datasetVersion??""},${b?.datasetVersion??""}`)},m=(g,v)=>{r(`/evaluation/datasets/${e}/versions?ids=${g},${v}`,{replace:!0})};return l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=datasets",children:[l.jsx(ke,{children:l.jsx(Sd,{})}),"Datasets"]}),l.jsx(En,{as:Lt,to:`/evaluation/datasets/${e}`,children:a?.name||e?.slice(0,8)}),l.jsxs(En,{isCurrent:!0,as:"span",children:[l.jsx(ke,{children:l.jsx(mSe,{})}),"Compare Versions"]})]})}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsxs(pt,{children:[l.jsxs(pt.Column,{children:[l.jsxs(pt.Title,{children:[l.jsx(mSe,{})," Compare Dataset Versions"]}),l.jsx(pt.Description,{children:l.jsxs(ua,{children:[l.jsx(V5,{})," Comparing ",n.length," versions of"," ",a?.name||e?.slice(0,8)]})})]}),l.jsx(pt.Column,{children:l.jsxs(ge,{as:Lt,to:`/evaluation/datasets/${e}`,children:[l.jsx(KO,{}),"Back to Dataset"]})})]}),l.jsx(sx,{children:l.jsxs(Ar,{children:[l.jsx(Lvr,{datasetId:e,versionA:String(n[0]),versionB:String(n[1]),onVersionChange:m}),l.jsx(Uvr,{datasetId:e,versionA:n[0],versionB:n[1],allItems:d,itemsAMap:f,itemsBMap:p,onItemClick:h})]})})]})})]})}const dOr="tab",fOr=["overview","scorers","datasets","experiments"];function pOr(){const[e]=_o(),t=e.get(dOr),n=t&&fOr.includes(t)?t:"overview";return l.jsxs(us,{children:[l.jsx(us.Top,{children:l.jsx(pt,{withMargins:!1,children:l.jsx(pt.Column,{children:l.jsxs(pt.Title,{children:[l.jsx(LQe,{})," Evaluation"]})})})}),l.jsx("div",{className:"px-4 pt-2 overflow-y-auto",children:l.jsx(myr,{activeTab:n})})]})}function hOr(){const[e]=_o(),t=Fc(),n=e.get("redirect")||"/",a=e.get("mode")==="signup"?"signup":"signin",s=e.get("error_description")||e.get("error")||null,i=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(sSt,{redirectUri:n,onSuccess:i,initialMode:a,errorMessage:s})}const mOr=()=>{const{data:e=[],isLoading:t,error:n}=$R(),{variant:r}=rE("entity-list-page"),[a,s]=x.useState(""),i=!t&&e.length===0;return r==="new-proposal"?l.jsxs(us,{children:[l.jsxs(us.Top,{children:[l.jsxs(pt,{withMargins:!1,children:[l.jsx(pt.Column,{children:l.jsxs(pt.Title,{isLoading:t,children:[l.jsx(Pc,{})," MCP Servers"]})}),l.jsx(pt.Column,{className:"flex justify-end gap-2",children:l.jsx(Gi,{as:"a",href:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to MCP documentation",children:l.jsx(Zl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(vS,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),l.jsx(Hyr,{mcpServers:e,isLoading:t,error:n,search:a,onSearch:s})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(Pc,{})}),"MCP Servers"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"MCP documentation"]})})]}),l.jsx(Ki,{isCentered:i,children:l.jsx(zyr,{mcpServers:e,isLoading:t,error:n})})]})},gOr=()=>{const{serverId:e}=ms(),{data:t=[],isLoading:n}=$R(),r=t.find(a=>a.id===e);return l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/mcps",children:[l.jsx(ke,{children:l.jsx(Pc,{})}),"MCP Servers"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:l.jsx(M0t,{value:e,variant:"ghost"})})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"MCP documentation"]})})]}),l.jsx(Gyr,{isLoading:n,server:r})]})},vOr=()=>{const{data:e}=$R(),{serverId:t,toolId:n}=ms(),{data:r,isLoading:a}=Ywt(t,n),s=e?.find(c=>c.id===t),i=r?.name,o=s?.name||"";return a||!r?null:l.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-hidden",children:[l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/mcps",children:[l.jsx(ke,{children:l.jsx(Pc,{})}),"MCP Servers"]}),l.jsx(En,{as:Lt,to:`/mcps/${t}`,children:o}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:i})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"MCP documentation"]})})]}),l.jsx(Wyr,{toolId:n,serverId:t})]})},Oee="period";function yOr(){const[e,t]=_o(),n=e.get(Oee),r=_hr(n)?n:"24h",a=x.useCallback(s=>{t(i=>{const o=new URLSearchParams(i);return s==="24h"?o.delete(Oee):o.set(Oee,s),o},{replace:!0})},[t]);return l.jsx(Nhr,{initialPreset:r,onPresetChange:a,children:l.jsxs("div",{className:"w-full px-[3vw] mx-auto grid h-full grid-rows-[auto_1fr] overflow-y-auto",children:[l.jsxs(pt,{withMargins:!1,className:"mt-6 mb-4",children:[l.jsx(pt.Column,{children:l.jsxs(pt.Title,{children:[l.jsx(Fle,{})," Metrics"]})}),l.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[l.jsx(gmr,{}),l.jsx(Gi,{as:"a",href:"https://mastra.ai/en/docs/observability/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Metrics documentation",children:l.jsx(Zl,{})})]})]}),l.jsx(hmr,{})]})})}const bOr=(e,t)=>{const n=qe();return wt({queryKey:["trace",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return await n.getTrace(e)},enabled:!!e,refetchInterval:3e3,...t})},xOr=async({client:e,page:t,perPage:n,filters:r})=>e.listTraces({pagination:{page:t,perPage:n},filters:r}),wOr=25;function SOr(e,t,n){if(e?.pagination?.hasMore)return n+1}function OOr(e){const t=new Set,n=e.pages.flatMap(a=>a.spans??[]).filter(a=>t.has(a.traceId)?!1:(t.add(a.traceId),!0)),r={};for(const a of e.pages)a.threadTitles&&Object.assign(r,a.threadTitles);return{spans:n,threadTitles:r}}const kOr=({filters:e})=>{const t=qe(),{inView:n,setRef:r}=AR(),a=d_({queryKey:["traces",e],queryFn:({pageParam:c})=>xOr({client:t,page:c,perPage:wOr,filters:e}),initialPageParam:0,getNextPageParam:SOr,select:OOr,placeholderData:GFt,retry:!1,refetchInterval:c=>xa(c.state.error)?!1:3e3}),{hasNextPage:s,isFetchingNextPage:i,fetchNextPage:o}=a;return x.useEffect(()=>{n&&s&&!i&&o()},[n,s,i,o]),{...a,setEndOfListElement:r}};function _Or(){const e=Fc(),[t,n]=_o(),[r,a]=x.useState(),[s,i]=x.useState({value:"all",label:"All",type:"all"}),[o,c]=x.useState(()=>new Date(Date.now()-1440*60*1e3)),[u,d]=x.useState(void 0),[f,p]=x.useState(!1),[h,m]=x.useState(!1),[g,v]=x.useState(""),[b,S]=x.useState([]),[O,k]=x.useState(!1),[E,C]=x.useState({}),[T,j]=x.useState("last-24h"),[A,I]=x.useState({}),{data:P={},isLoading:M}=ch(),{data:F,isLoading:D}=Pv(),{data:V={},isLoading:H}=Vm(),{data:B=[]}=Cmr(),{data:q=[]}=jmr(),{data:W=[]}=Tmr(),{data:L,isLoading:Z}=bOr(r,{enabled:!!r}),z=t.get("traceId"),R=t.get("spanId"),Q=t.get("tab"),G=t.get("scoreId"),ee=x.useMemo(()=>{if(Object.keys(E).length!==0)return E},[E]),{data:re,isLoading:ne,isFetchingNextPage:se,hasNextPage:oe,setEndOfListElement:pe,error:K,isError:ae}=kOr({filters:{...s?.type!=="all"&&{entityId:s?.value,entityType:s?.type},...o&&{startedAt:{start:o}},...u&&{endedAt:{end:u}},...b.length>0&&{tags:b},...O&&{status:"error"},...ee&&{metadata:ee},...Object.fromEntries(Object.entries(A).filter(([,Je])=>Je.trim()))}}),ie=x.useMemo(()=>re?.spans??[],[re?.spans]),ve=x.useDeferredValue(g),ye=x.useMemo(()=>{if(!ve.trim())return ie;const Je=ve.trim().toLowerCase();return ie.filter(Ze=>{if(Ze.traceId?.toLowerCase().includes(Je)||Ze.name?.toLowerCase().includes(Je)||Ze.entityId?.toLowerCase().includes(Je)||Ze.entityName?.toLowerCase().includes(Je))return!0;const _t=Ze.metadata;if(_t&&typeof _t=="object"){for(const gt of Object.values(_t))if(String(gt).toLowerCase().includes(Je))return!0}return!1})},[ie,ve]),fe=re?.threadTitles??{},xe=x.useRef({}),le=x.useRef({}),we=x.useMemo(()=>{let Je=!1;const Ze=xe.current;for(const gt of ie){const ft=gt.metadata;if(ft&&typeof ft=="object")for(const[Cn,Et]of Object.entries(ft)){if(Et==null)continue;Ze[Cn]||(Ze[Cn]=new Set,Je=!0);const Ut=String(Et);Ze[Cn].has(Ut)||(Ze[Cn].add(Ut),Je=!0)}}if(!Je)return le.current;const _t=Object.fromEntries(Object.entries(Ze).map(([gt,ft])=>[gt,[...ft].sort()]));return le.current=_t,_t},[ie]),J=x.useRef({}),X=x.useRef({}),ue=x.useMemo(()=>{let Je=!1;const Ze=J.current;for(const gt of ie)for(const ft of Pwt){const Cn=gt[ft];Cn!=null&&typeof Cn=="string"&&Cn.trim()&&(Ze[ft]||(Ze[ft]=new Set,Je=!0),Ze[ft].has(Cn)||(Ze[ft].add(Cn),Je=!0))}for(const gt of q)Ze.environment||(Ze.environment=new Set,Je=!0),Ze.environment.has(gt)||(Ze.environment.add(gt),Je=!0);for(const gt of W)Ze.serviceName||(Ze.serviceName=new Set,Je=!0),Ze.serviceName.has(gt)||(Ze.serviceName.add(gt),Je=!0);if(!Je)return X.current;const _t=Object.fromEntries(Object.entries(Ze).map(([gt,ft])=>[gt,[...ft].sort()]));return X.current=_t,_t},[ie,q,W]);z&&z!==r&&(a(z),m(!0));const Se=x.useMemo(()=>(Object.entries(P)||[]).map(([Je,Ze])=>({value:Ze.id,label:Ze.name,type:xm.AGENT})),[P]),Ce=x.useMemo(()=>(Object.entries(F||{})||[]).map(([,Je])=>({value:Je.name,label:Je.name,type:xm.WORKFLOW_RUN})),[F]),ce=x.useMemo(()=>[{value:"all",label:"All",type:"all"},...Se,...Ce],[Se,Ce]),_e=t.get("entity"),Ie=ce.find(Je=>Je.value===_e);Ie&&Ie.value!==s?.value&&i(Ie);const Me=()=>{a(void 0),n({entity:"all",traceId:""}),m(!1),c(void 0),d(void 0),p(!1),v(""),S([]),k(!1),C({}),j("last-24h"),I({}),xe.current={},le.current={},J.current={},X.current={}},et=(Je,Ze)=>{if(Ze==="from")return c(Je);d(Je)},kt=Je=>{Je?.value&&n({entity:Je.value})},Yt=Je=>{if(Je===r)return a(void 0);a(Je),m(!0)},Sn=ae?Pyr(K):void 0,Rn=x.useMemo(()=>{if(!f)return ye.map(gt=>({id:gt.traceId}));const{groups:Je,ungrouped:Ze}=Rwt(ye),_t=[];for(const gt of Je)for(const ft of gt.traces)_t.push({id:ft.traceId});for(const gt of Ze)_t.push({id:gt.traceId});return _t},[ye,f]);if(K&&xa(K))return l.jsxs(us,{children:[l.jsx(us.Top,{children:l.jsxs(pt,{withMargins:!1,children:[l.jsxs(pt.Column,{children:[l.jsxs(pt.Title,{children:[l.jsx(JO,{})," Observability"]}),l.jsx(pt.Description,{children:"Explore observability traces for your entities"})]}),l.jsx(pt.Column,{className:"flex justify-end gap-2",children:l.jsx(Gi,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Observability documentation",tooltipContent:"Go to Observability documentation",children:l.jsx(Zl,{})})})]})}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"traces"})})]});const ct=s?.value!=="all"||o||u||g.trim()||b.length>0||O||Object.keys(E).length>0||Object.values(A).some(Je=>Je.trim()),ze=t9({entries:Rn,id:r,update:a}),at=n9({entries:Rn,id:r,update:a});return l.jsxs(l.Fragment,{children:[l.jsxs(us,{className:"grid-rows-[auto_1fr] overflow-y-auto",children:[l.jsxs(us.Top,{children:[l.jsxs(pt,{withMargins:!1,children:[l.jsxs(pt.Column,{children:[l.jsxs(pt.Title,{isLoading:ne,children:[l.jsx(JO,{})," Observability"]}),l.jsx(pt.Description,{children:"Explore observability traces for your entities"})]}),l.jsx(pt.Column,{className:"flex justify-end gap-2",children:l.jsx(Gi,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Observability documentation",tooltipContent:"Go to Observability documentation",children:l.jsx(Zl,{})})})]}),l.jsx(xmr,{onEntityChange:kt,onReset:Me,selectedEntity:s,entityOptions:ce,onDateChange:et,selectedDateFrom:o,selectedDateTo:u,isLoading:ne||M||D,groupByThread:f,onGroupByThreadChange:p,searchQuery:g,onSearchChange:v,selectedTags:b,availableTags:B,onTagsChange:S,errorOnly:O,onErrorOnlyChange:k,selectedMetadata:E,availableMetadata:we,onMetadataChange:C,datePreset:T,onDatePresetChange:j,contextFilters:A,availableContextValues:ue,onContextFiltersChange:I})]}),ne?l.jsx(jxt,{columns:h9}):l.jsx(Omr,{traces:ye,selectedTraceId:r,onTraceClick:Yt,errorMsg:Sn?.error,setEndOfListElement:pe,filtersApplied:!!ct,isFetchingNextPage:se,hasNextPage:oe,groupByThread:f,threadTitles:fe})]}),l.jsx(Mge,{traceSpans:L?.spans,traceId:r,initialSpanId:R||void 0,initialSpanTab:Q==="scores"?"scores":"details",initialScoreId:G||void 0,traceDetails:ye.find(Je=>Je.traceId===r),isOpen:h,onClose:()=>{e("/observability"),m(!1)},onNext:ze,onPrevious:at,isLoadingSpans:Z,computeTraceLink:(Je,Ze)=>`/observability?traceId=${Je}${Ze?`&spanId=${Ze}`:""}`,scorers:V,isLoadingScorers:H})]})}const EOr=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:Fle,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:JO,href:"/observability"}];function COr(){return l.jsxs(us,{children:[l.jsx(us.Top,{children:l.jsx(pt,{withMargins:!1,children:l.jsx(pt.Column,{children:l.jsxs(pt.Title,{children:[l.jsx(JO,{})," Observability"]})})})}),l.jsx("div",{className:"px-6 pt-6",children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:EOr.map(e=>l.jsxs(Lt,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),l.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),l.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}const jOr=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:hs,href:"/agents"},{title:"Prompts",description:"Design and version reusable prompt templates for your agents.",icon:ek,href:"/prompts"},{title:"Workflows",description:"Build step-based execution flows with suspend, resume, and branching.",icon:bo,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:DQe,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:Pc,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:Xi,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:vp,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:zle,href:"/request-context"}];function TOr(){return l.jsxs(us,{children:[l.jsx(us.Top,{children:l.jsx(pt,{withMargins:!1,children:l.jsx(pt.Column,{children:l.jsx(pt.Title,{children:"Primitives"})})})}),l.jsx("div",{className:"px-6 pt-6",children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 max-w-5xl",children:jOr.map(e=>l.jsxs(Lt,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),l.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),l.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function NOr(){const{Link:e,paths:t}=Pt(),{data:n,isLoading:r}=a0t(),{isCmsAvailable:a}=kge(),{variant:s}=rE("entity-list-page"),[i,o]=x.useState(""),c=n?.promptBlocks??[];return s==="new-proposal"?l.jsxs(us,{children:[l.jsxs(us.Top,{children:[l.jsxs(pt,{withMargins:!1,children:[l.jsx(pt.Column,{children:l.jsxs(pt.Title,{isLoading:r,children:[l.jsx(ek,{})," Prompts"]})}),l.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[l.jsx(Gi,{as:"a",href:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Prompts documentation",children:l.jsx(Zl,{})}),a&&l.jsxs(ge,{as:Lt,to:t.cmsPromptBlockCreateLink(),variant:"primary",children:[l.jsx(L$,{}),"Create Prompt"]})]})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(vS,{onSearch:o,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),l.jsx(gur,{promptBlocks:c,isLoading:r,search:i,onSearch:o})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(ek,{})}),"Prompts"]}),l.jsxs(Ss,{children:[a&&l.jsxs(ge,{variant:"light",as:e,to:t.cmsPromptBlockCreateLink(),children:[l.jsx(ke,{children:l.jsx(L$,{})}),"Create a prompt block"]}),l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Documentation"]})]})]}),l.jsx(Ki,{isCentered:!r&&c.length===0,children:l.jsx(cur,{isLoading:r,promptBlocks:c})})]})}function AOr(){return l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(zle,{})}),"Request Context"]})}),l.jsx(Ki,{children:l.jsx(Eor,{children:l.jsx(wxt,{})})})]})}const IOr=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:d4t,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:Zl,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:$Qe,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:E4t,href:"https://discord.gg/BTYqqHKUrf",external:!0},{title:"Share with your team",description:"Running Mastra Studio locally? Deploy to the cloud so your team can collaborate.",icon:a4t,href:"https://mastra.ai/cloud",external:!0}];function ROr(){return l.jsxs(us,{children:[l.jsx(us.Top,{children:l.jsx(pt,{withMargins:!1,children:l.jsx(pt.Column,{children:l.jsxs(pt.Title,{children:[l.jsx(Zl,{})," Resources"]})})})}),l.jsx("div",{className:"px-6 pt-6",children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:IOr.map(e=>l.jsxs("a",{href:e.href,...e.external?{target:"_blank",rel:"noreferrer"}:{},className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),l.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title}),e.external&&l.jsx($Qe,{className:"h-3.5 w-3.5 text-icon3 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),l.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function POr(){const{scorerId:e}=ms(),[t,n]=_o(),[r,a]=x.useState(),[s,i]=x.useState(0),[o,c]=x.useState(!1),[u,d]=x.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:f,isLoading:p,error:h}=rlr(e),{data:m={},isLoading:g,error:v}=ch(),{data:b,isLoading:S,error:O}=Pv(),{data:k,isLoading:E,error:C}=nlr({scorerId:e,page:s,entityId:u?.value==="all"?void 0:u?.value,entityType:u?.type==="ALL"?void 0:u?.type}),T=x.useMemo(()=>f?.agentIds?.filter(z=>m[z]).map(z=>({value:z,label:m[z].name,type:"AGENT"}))||[],[f?.agentIds,m]),j=x.useMemo(()=>f?.workflowIds?.map(z=>({value:z,label:z,type:"WORKFLOW"}))||[],[f?.workflowIds]),A=x.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...T,...j],[T,j]),I=t.get("entity"),P=A.find(z=>z.value===I);if(P&&P.value!==u?.value&&d(P),x.useEffect(()=>{if(h){const z=h instanceof Error?h.message:"Failed to load scorer";De.error(`Error loading scorer: ${z}`)}},[h]),x.useEffect(()=>{if(v){const z=v instanceof Error?v.message:"Failed to load agents";De.error(`Error loading agents: ${z}`)}},[v]),x.useEffect(()=>{if(O){const z=O instanceof Error?O.message:"Failed to load workflows";De.error(`Error loading workflows: ${z}`)}},[O]),h&&xa(h))return l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=scorers",children:[l.jsx(ke,{children:l.jsx(S0,{})}),"Scorers"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:e})]})}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"scorers"})})]});if(p||h||v||O)return null;const M=f?.agentIds?.map(z=>({name:z,id:Object.entries(m).find(([,R])=>R.name===z)?.[0]}))||[],F=f?.workflowIds?.map(z=>({name:z,id:Object.entries(b||{}).find(([,R])=>R.name===z)?.[0]}))||[],V=[{key:"entities",label:"Entities",value:([...M.map(z=>({id:z.id,name:z.name,type:"AGENT"})),...F.map(z=>({id:z.id,name:z.name,type:"WORKFLOW"}))]||[]).map(z=>({id:z.id,name:z.name||z.id,path:`${z.type==="AGENT"?"/agents":"/workflows"}/${z.name}`}))}],H=z=>{z?.value&&n({entity:z.value})},B=k?.scores||[],q=k?.pagination,W=z=>{a(z),c(!0)},L=t9({entries:B,id:r,update:a}),Z=n9({entries:B,id:r,update:a});return l.jsxs(l.Fragment,{children:[l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/evaluation?tab=scorers",children:[l.jsx(ke,{children:l.jsx(S0,{})}),"Scorers"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:l.jsx(alr,{value:e,variant:"ghost"})})]}),l.jsxs(Ss,{children:[f?.scorer?.source==="stored"&&l.jsxs(ge,{variant:"light",as:Lt,to:`/cms/scorers/${e}/edit`,children:[l.jsx(ke,{children:l.jsx(A4t,{})}),"Edit"]}),l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/evals/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Scorers documentation"]})]})]}),l.jsx("div",{className:Y("grid overflow-y-auto h-full"),children:l.jsxs("div",{className:Y("max-w-[100rem] w-full px-12 mx-auto grid content-start gap-8 h-full"),children:[l.jsx(o$,{title:f?.scorer?.config?.name||"loading",description:f?.scorer?.config?.description||"loading",icon:l.jsx(S0,{})}),l.jsx(mS,{data:V,LinkComponent:Lt,isLoading:g||S}),l.jsx(tlr,{selectedEntity:u,entityOptions:A,onEntityChange:H,onReset:()=>n({entity:"all"}),isLoading:E||g||S}),E?l.jsx("div",{className:"h-full w-full flex items-center justify-center",children:l.jsx(Ht,{})}):l.jsx(For,{scores:B,selectedScoreId:r,pagination:{total:q?.total||0,hasMore:q?.hasMore||!1,perPage:q?.perPage||0,page:q?.page||0},onScoreClick:W,onPageChange:i,errorMsg:C?.message})]})})]}),l.jsx(Axt,{scorerName:f?.scorer?.config?.name,score:MOr(B.find(z=>z.id===r)),isOpen:o,onClose:()=>c(!1),onNext:L,onPrevious:Z,computeTraceLink:(z,R)=>`/observability?traceId=${z}${R?`&spanId=${R}`:""}`})]})}const MOr=e=>{if(e)return{...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt)}},DOr=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],$Or=()=>{const{baseUrl:e,headers:t,themeToggleEnabled:n}=r9(),{theme:r,setTheme:a}=Vr(),[s,i]=x.useState(r),o=x.useRef(r);return x.useEffect(()=>{i(r),o.current=r},[r]),l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(oge,{})}),"Settings"]})}),l.jsx(Ki,{children:l.jsxs("div",{className:"max-w-2xl mx-auto w-full mt-8 space-y-8",children:[n?l.jsx("section",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:l.jsxs("div",{className:"space-y-3",children:[l.jsx("h2",{className:"text-icon6 font-medium",children:"Theme"}),l.jsx(s9,{name:"theme",label:"Theme mode",value:s,onValueChange:c=>{const u=c;o.current=u,i(u)},options:DOr.map(c=>({...c}))})]})}):null,l.jsx(Fxt,{initialConfig:{baseUrl:e,headers:t},onSave:()=>{n&&a(o.current)}})]})})]})};function LOr(){const[e]=_o(),t=Fc(),n=e.get("redirect")||"/",r=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(sSt,{redirectUri:n,onSuccess:r,initialMode:"signup"})}async function X1t(){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(),n=[{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],r=Array.from(new Set(n.flatMap(s=>s.tags))),a=Array.from(new Set(n.flatMap(s=>s.supportedProviders)));return{templates:n,tags:r,providers:a}}async function FOr({repo:e,owner:t}){const n=await fetch(`https://api.github.com/repos/${t}/${e}`);if(!n.ok)throw new Error(`Failed to fetch template: ${n.statusText}`);const r=await n.json();if(!r.is_template)throw new Error("Repo is not a template, please update the repo settings to make it a template");return{title:r.name,slug:r.name,description:r.description??"",imageURL:"",tags:[],useCase:"",longDescription:r.description??"",githubUrl:r.html_url,supportedProviders:[]}}async function zOr({repoOrSlug:e,owner:t}){const{templates:n}=await X1t(),r=n.find(a=>a.slug===e);if(!r){if(e.startsWith("template-")){const s=n.find(i=>`template-${i.slug}`===e);if(s)return s}const a=await FOr({repo:e,owner:t});if(a)return a;throw new Error(`Template ${e} not found`)}return r}async function BOr({repo:e,owner:t,branch:n}){const r=`https://raw.githubusercontent.com/${t}/${e}/${n}/.env.example`,a=await fetch(r);return a.ok?(await a.text()).split(`
510
- `).reduce((o,c)=>{if(!c||c.startsWith("#"))return o;const[u,d]=c.split("=");return u&&(o[u]=d?.split("")?.every(f=>f==="*")?"":d?.replaceAll('"',"")),o},{}):{}}const UOr=()=>wt({queryKey:["mastra-templates"],queryFn:X1t}),VOr=({repoOrSlug:e,owner:t})=>wt({queryKey:["template-repo",e,t],queryFn:()=>zOr({repoOrSlug:e,owner:t})}),qOr=({repo:e,owner:t,branch:n})=>wt({queryKey:["template-repo-env-vars",e,t,n],queryFn:()=>BOr({repo:e,owner:t,branch:n})}),HOr=()=>{const e=qe();return wt({queryKey:["agent-builder-workflow"],queryFn:async()=>await e.getAgentBuilderAction("merge-template").details()})},QOr=()=>{const e=qe();return Qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").createRun({runId:t})})},WOr=()=>{const e=qe();return Qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").runById(t)})},e9e=e=>{if(typeof e=="string")return e;if(e==null)return"Unknown error";if(e instanceof Error)return typeof e.message=="string"&&e.message.length>0?e.message:"Unknown error";if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)},t9e=(e,t,n)=>{let r={...t};if(!(r.payload?.workflowState?.steps&&Object.keys(r.payload.workflowState.steps).length>0)&&n?.allSteps&&(r.payload={...r.payload,workflowState:{...r.payload?.workflowState,steps:Object.keys(n.allSteps).reduce((s,i)=>(s[i]={id:i,description:n.allSteps[i].description,status:"pending"},s),{})}}),e.type==="start"||e.type==="workflow-start"){const s={};n?.allSteps&&Object.entries(n.allSteps).forEach(([o,c])=>{s[o]={id:c.id,description:c.description,status:"pending"}});const i=e.runId||e.payload?.runId;r={...r,runId:i,eventTimestamp:new Date().toISOString(),status:"running",phase:"initializing",payload:{workflowState:{status:"running",steps:s},currentStep:null}}}if(e.type==="step-start"||e.type==="workflow-step-start"){const s=e.payload.id;r={...r,phase:"processing",payload:{...r.payload,currentStep:{id:s,status:"running",startTime:new Date,...e.payload},workflowState:{...r.payload.workflowState,steps:{...r.payload.workflowState.steps,[s]:{...r.payload.workflowState.steps[s],status:"running",startTime:new Date,...e.payload}}}}}}if(e.type==="step-result"||e.type==="workflow-step-result"){const s=e.payload.id,i=e.payload.status,o=e.payload.error;if(r={...r,payload:{...r.payload,currentStep:{...r.payload.currentStep,status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date},workflowState:{...r.payload.workflowState,steps:{...r.payload.workflowState.steps,[s]:{...r.payload.workflowState.steps[s],status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date}}}}},i==="failed"&&o){const c=e9e(o);r={...r,status:"failed",error:c,phase:"error",failedStep:{id:s,error:c,description:e.payload.description||s},payload:{...r.payload,workflowState:{...r.payload.workflowState,status:"failed"}},errorTimestamp:new Date}}}if((e.type==="step-finish"||e.type==="workflow-step-finish")&&(r={...r,payload:{...r.payload,currentStep:null}}),(e.type==="finish"||e.type==="workflow-finish")&&(r.phase==="error"||r.status==="failed"?r={...r,completedAt:new Date}:r={...r,status:e.payload.status||"completed",phase:"completed",payload:{...r.payload,currentStep:null,workflowState:{...r.payload.workflowState,status:e.payload.status||"completed"}},completedAt:new Date}),e.type==="error"){const s=e9e(e.payload.error);r={...r,status:"failed",error:s,phase:"error",payload:{...r.payload,workflowState:{...r.payload.workflowState,status:"failed"}},errorTimestamp:new Date}}return{newState:r}},GOr=(e,t)=>{try{localStorage.setItem(`template-install-${e}`,JSON.stringify({state:t,timestamp:Date.now()}))}catch(n){console.warn("Failed to save template state to localStorage:",n)}},K1t=(e,t)=>{const[n,r]=x.useState({}),[a,s]=x.useState(!1);return{streamResult:n,isStreaming:a,processStream:async(o,c)=>{if(s(!0),r({}),!o)throw new Error("No stream returned");const u=o.getReader();let d={runId:c||t,eventTimestamp:new Date().toISOString(),phase:"running",payload:{workflowState:{steps:{}},currentStep:null}};try{for(;;){const{done:f,value:p}=await u.read();if(f)break;const{newState:h}=t9e(p,d,e);if(d=h,r(h),p.runId||c||t){const m=p.runId||c||t;GOr(m,h)}}}catch(f){console.error("💥 [processStream] Error processing template installation stream:",f);const{newState:p}=t9e({type:"error",payload:{error:f instanceof Error?f.message:"Unknown error"}},d,e);r(p)}finally{s(!1),u.releaseLock()}}}},ZOr=e=>{const t=qe(),{streamResult:n,isStreaming:r,processStream:a}=K1t(e);return{streamInstall:Qn({mutationFn:async({inputData:i,selectedModel:o,runId:c})=>{for(let d=1;d<=3;d++)try{const f=t.getAgentBuilderAction("merge-template"),p=new oI;p.set("selectedModel",o);const h=await f.stream({inputData:i,requestContext:p},c);await a(h,c);return}catch(f){console.error(`💥 [streamInstall] Attempt ${d} failed:`,f);const p=f?.message?.includes("Failed to fetch")||f?.message?.includes("NetworkError")||f?.message?.includes("network error")||f?.message?.includes("fetch")||f?.code==="NETWORK_ERROR"||f?.name==="TypeError";if(console.warn(`Stream attempt ${d}/3 failed:`,f),p){const h=c?`Network error during template installation (likely hot reload). Please refresh the page to resume from where you left off using runId: ${c}`:"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:",f),f}}}),streamResult:n,isStreaming:r}},YOr=e=>{const t=qe(),{streamResult:n,isStreaming:r,processStream:a}=K1t(e);return{observeInstall:Qn({mutationFn:async({runId:i})=>{for(let u=1;u<=3;u++)try{const f=await t.getAgentBuilderAction("merge-template").observeStream({runId:i});await a(f,i);return}catch(d){console.error(`💥 [observeInstall] Attempt ${u} failed:`,d);const f=d?.message?.includes("Failed to fetch")||d?.message?.includes("NetworkError")||d?.message?.includes("network error")||d?.message?.includes("fetch")||d?.code==="NETWORK_ERROR"||d?.name==="TypeError";if(console.warn(`ObserveStream attempt ${u}/3 failed:`,d),f&&u<3){console.info(`🔄 ObserveStream network error detected (likely hot reload), retrying in 2000ms... (attempt ${u+1}/3)`),await new Promise(p=>setTimeout(p,2e3));continue}throw console.error("❌ [observeInstall] Non-network error or max retries reached, throwing:",d),d}}}),streamResult:n,isStreaming:r}};function XOr(){const{data:e,isLoading:t}=UOr(),{templates:n,tags:r,providers:a}=e??{templates:[],tags:[],providers:[]},[s,i]=x.useState("all"),[o,c]=x.useState("all"),[u,d]=x.useState(""),f=[{value:"all",label:"Any tag"}];(r||[]).forEach(S=>{f.push({value:S,label:S})});const p=[{value:"all",label:"Any provider"}];(a||[]).forEach(S=>{p.push({value:S,label:S})});const h=(S,O)=>{O==="tag"?i(S):O==="provider"&&c(S)},m=S=>{d(S)},g=()=>{i("all"),c("all"),d("")},v=n.filter(S=>!(u&&!S.title.toLowerCase().includes(u)&&!S.description.toLowerCase().includes(u)||s!=="all"&&!S.tags.includes(s)||o!=="all"&&!S.supportedProviders.includes(o))),b=u||s!=="all"||o!=="all";return l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(FQe,{})}),"Templates"]})}),l.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[l.jsx(fhr,{selectedTag:s,onTagChange:S=>h(S,"tag"),tagOptions:f,selectedProvider:o,onProviderChange:S=>h(S,"provider"),providerOptions:p,searchTerm:u,onSearchChange:m,onReset:b?g:void 0,className:"max-w-[80rem]",isLoading:t}),l.jsx(hhr,{templates:v,linkComponent:Lt,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const KOr="1.18.0-alpha.1";function JOr(){const{templateSlug:e}=ms(),[t,n]=_o(),[r,a]=x.useState(""),[s,i]=x.useState(""),[o,c]=x.useState(""),[u,d]=x.useState({}),[f,p]=x.useState([]),[h,m]=x.useState(null),[g,v]=x.useState(!1),[b,S]=x.useState(""),[O,k]=x.useState(!1),[E,C]=x.useState(!1),[T,j]=x.useState([]),{data:A,isLoading:I}=VOr({repoOrSlug:e,owner:"mastra-ai"}),M=KOr?.includes("beta")??!1?"beta":"main",{data:F,isLoading:D}=qOr({repo:A?.githubUrl?new URL(A.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:M}),{data:V,isLoading:H}=HOr(),{mutateAsync:B,isPending:q}=QOr(),{mutateAsync:W}=WOr(),{streamInstall:L,streamResult:Z,isStreaming:z}=ZOr(V),{observeInstall:R,streamResult:Q,isStreaming:G}=YOr(V);x.useEffect(()=>{const ae=t.get("runId");ae&&!g&&!h&&!z&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:ae}),S(ae),W({runId:ae}).then(ie=>{const ve=ie.snapshot;if(ve?.status==="success"&&ve?.result?.success)v(!0);else if(ve?.result?.success===!1)if(ve?.result?.validationResults&&!ve?.result?.validationResults?.valid&&ve?.result?.validationResults?.remainingErrors>0){const{remainingErrors:fe,errors:xe}=ve.result.validationResults,le=`Template installation completed but ${fe} validation issue${fe>1?"s":""} remain unresolved.`;m(le),j(xe||[])}else{const fe=ve?.result?.message||ve?.result?.error||"Template installation failed";m(typeof fe=="string"?fe:String(fe))}}).catch(ie=>{console.error("❌ Failed to fetch run details:",ie),m("Failed to retrieve installation status after reload")}))},[t,g,h,z,G,W]),x.useEffect(()=>{const ae=t.get("runId"),ie=t.get("resume"),ve=t.get("provider");if(ae&&ie==="true"&&ve&&!z&&!G&&!O&&!E&&V){S(ae),k(!0);try{W({runId:ae}).then(ye=>{if(ye.snapshot?.status==="running")return R.mutateAsync({runId:ae})}).then(()=>{n(ye=>{const fe=new URLSearchParams(ye);return fe.delete("resume"),fe})}).catch(ye=>{console.error("❌ Failed to resume template installation:",ye),ye.message?.includes("404")||ye.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(ye){console.error("❌ Auto-resume failed with error:",ye),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,z,G,O,E,V,W,R,n]);const ee=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],re=[{key:"tools",label:"Tools",value:A?.tools?.length?A.tools.map(ae=>ae).join(", "):"n/a",icon:l.jsx(Xi,{})},{key:"agents",label:"Agents",value:A?.agents?.length?A.agents.map(ae=>ae).join(", "):"n/a",icon:l.jsx(hs,{})},{key:"workflows",label:"Workflows",value:A?.workflows?.length?A.workflows.map(ae=>ae).join(", "):"n/a",icon:l.jsx(Y4t,{})},{key:"providers",label:"Providers",value:A?.supportedProviders?.length?A.supportedProviders.join(", "):"n/a",icon:l.jsx(Y3t,{})},{key:"tags",label:"Tags",value:A?.tags?.length?A.tags.join(", "):"n/a",icon:l.jsx(U4t,{})}],ne=[{...re[0]},{...re[1]},{...re[2]}].filter(ae=>ae.value!=="n/a");x.useEffect(()=>{F&&d(F)},[F]),x.useEffect(()=>{const ae=Z||Q;ae?.phase==="error"&&ae?.error&&m(typeof ae.error=="string"?ae.error:String(ae.error))},[Z?.phase,Z?.error,Q?.phase,Q?.error]);const se=ae=>{a(ae)},oe=async ae=>(i(ae.provider),c(ae.modelId),{message:"Model updated successfully"}),pe=async()=>{const ae=Object.entries(u).reduce((ie,[ve,ye])=>(ye===""&&ie.push(ve),ie),[]);if(ae.length>0){p(ae);return}if(A){m(null),v(!1),S(""),C(!0);try{const ve={repo:A.githubUrl||`https://github.com/mastra-ai/template-${A.slug}`,ref:M,slug:A.slug,variables:u},{runId:ye}=await B({});S(ye),n(fe=>{const xe=new URLSearchParams(fe);return xe.set("runId",ye),xe.set("resume","true"),xe.set("provider",r||"openai"),xe}),await L.mutateAsync({inputData:ve,selectedModel:{provider:s,modelId:o},runId:ye})}catch(ie){C(!1),m(ie?.message||"Template installation failed"),console.error("Template installation failed",ie)}}},K=ae=>{const{name:ie,value:ve}=ae.target;ve.trim()===""?p(ye=>[...ye,ie]):p(ye=>ye.filter(fe=>fe!==ie)),d(ye=>({...ye,[ie]:ve}))};return l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/templates",children:[l.jsx(ke,{children:l.jsx(FQe,{})}),"Templates"]}),l.jsx(En,{as:Lt,to:`/templates/${A?.slug}`,isCurrent:!0,children:A?.title&&A.title})]})}),l.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:l.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[l.jsx(mhr,{isLoading:I,title:A?.title,description:A?.longDescription,imageURL:A?.imageURL,githubUrl:A?.githubUrl,infoData:re,templateSlug:e}),A&&l.jsxs(l.Fragment,{children:[(z||G)&&l.jsx(whr,{name:A.title,streamResult:G?Q:Z,runId:b,workflowInfo:V}),g&&l.jsx(Shr,{name:A.title,installedEntities:ne,linkComponent:Lt}),h&&l.jsx(Ohr,{errorMsg:h,validationErrors:T.length>0?T:Z?.validationResults?.errors||Q?.validationResults?.errors}),!z&&!G&&!g&&!h&&l.jsx(ghr,{providerOptions:ee,selectedProvider:r,onProviderChange:se,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:pe,handleVariableChange:K,isLoadingEnvVars:D||H,isInstalling:q,defaultModelProvider:s,defaultModelId:o,onModelUpdate:oe})]})]})})]})}const ekr=()=>{const{toolId:e,agentId:t}=ms();return l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/agents",children:[l.jsx(ke,{children:l.jsx(hs,{})}),"Agents"]}),l.jsx(En,{as:Lt,to:`/agents/${t}/chat`,children:t}),l.jsx(En,{as:Lt,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[l.jsx(ke,{children:l.jsx(qi,{})}),"Tools documentation"]})})]}),l.jsx(ycr,{toolId:e,agentId:t})]})},tkr=()=>{const{toolId:e}=ms();return l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/tools",children:[l.jsx(ke,{children:l.jsx(Xi,{})}),"Tools"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:l.jsx(dhr,{value:e,variant:"ghost"})})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Tools documentation"]})})]}),l.jsx(uhr,{toolId:e})]})};function nkr(){const{data:e,isLoading:t,error:n}=Pv(),{variant:r}=rE("entity-list-page"),[a,s]=x.useState(""),i=!t&&Object.keys(e||{}).length===0;return r==="new-proposal"?l.jsxs(us,{children:[l.jsxs(us.Top,{children:[l.jsxs(pt,{withMargins:!1,children:[l.jsx(pt.Column,{children:l.jsxs(pt.Title,{isLoading:t,children:[l.jsx(bo,{})," Workflows"]})}),l.jsx(pt.Column,{className:"flex justify-end gap-2",children:l.jsx(Gi,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:l.jsx(Zl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(vS,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),l.jsx(Hsr,{workflows:e||{},isLoading:t,error:n,search:a,onSearch:s})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(bo,{})}),"Workflows"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Workflows documentation"]})})]}),l.jsx(Ki,{isCentered:i,children:l.jsx(Asr,{workflows:e||{},isLoading:t,error:n})})]})}const n9e=()=>{const{workflowId:e}=ms(),{data:t,isLoading:n,error:r}=IR(e);return r&&xa(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"workflows"})}):l.jsx(zbt,{workflowId:e,workflow:t??void 0,isLoading:n})};function r9e(){const{workspaceId:e}=ms(),[t,n]=_o(),r=Fc(),[a,s]=x.useState(!1),[i,o]=x.useState(!1),[c,u]=x.useState(!1),[d,f]=x.useState(null),[p,h]=x.useState(null),[m,g]=x.useState(!1),v=t.get("file"),b=t.get("tab"),{data:S,error:O,isLoading:k}=nwt(),E=S?.workspaces??[],C=e??E[0]?.id,{data:T,isLoading:j,error:A}=jdr(C),I=xa(O)||xa(A),P=t.get("path")||".",M=aae(O)||aae(A),F=C?E.find(ze=>ze.id===C):void 0,D=ze=>{const at=new URLSearchParams(t);for(const[Je,Ze]of Object.entries(ze))Ze===null?at.delete(Je):at.set(Je,Ze);n(at)},V=ze=>{g(!1),s(!1),r(`/workspaces/${ze}`)},H=ze=>{D({path:ze==="."||ze===""?null:ze,file:null})},B=ze=>{D({file:ze})},q=ze=>{D({tab:ze})},W=P,L=v,{data:Z,isLoading:z,error:R,refetch:Q}=Tdr(W,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:C}),G=Adr(),ee=Idr(),{data:re,isLoading:ne}=rwt(L??"",{enabled:!!L,workspaceId:C}),{data:se,isLoading:oe,refetch:pe}=Pdr({workspaceId:C}),K=Bdr(),ae=Udr(),ie=Vdr(),ve=T?.isWorkspaceConfigured??!1,ye=T?.capabilities?.hasFilesystem??!1,fe=T?.capabilities?.hasSkills??!1,xe=T?.capabilities?.canBM25??!1,le=T?.capabilities?.canVector??!1,we=F?.safety?.readOnly??!1,J=ye&&!we,X=T?.mounts,ue=X?.filter(ze=>!ze.readOnly).map(ze=>({path:ze.path,displayName:ze.displayName,icon:ze.icon,provider:ze.provider,name:ze.name})),Se=X&&X.length>1?X.map(ze=>ze.path):void 0,Ce=x.useCallback(ze=>{C&&K.mutate({...ze,workspaceId:C},{onSuccess:async at=>{if(at.success){u(!1);const{data:Je,error:Ze}=await pe();if(Ze||!Je){De.success(`Skill "${at.skillName}" installed successfully (${at.filesWritten} files)`);return}Je.skills.some(gt=>gt.name===at.skillName)?De.success(`Skill "${at.skillName}" installed successfully (${at.filesWritten} files)`):(g(!0),De.warning(`Skill "${at.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else De.error("Failed to install skill")},onError:at=>{De.error(`Failed to install skill: ${at instanceof Error?at.message:"Unknown error"}`)}})},[C,K,pe]),ce=x.useCallback(ze=>{C&&(h(ze),ae.mutate({workspaceId:C,skillName:ze},{onSuccess:at=>{if(h(null),at.updated.length>0){const Je=at.updated[0];Je.success?(De.success(`Skill "${ze}" updated successfully (${Je.filesWritten} files)`),pe()):De.error(`Failed to update skill: ${Je.error??"Unknown error"}`)}else De.error("Failed to update skill: No update result returned")},onError:at=>{h(null),De.error(`Failed to update skill: ${at instanceof Error?at.message:"Unknown error"}`)}}))},[C,ae,pe]),_e=x.useCallback(ze=>{C&&(f(ze),ie.mutate({workspaceId:C,skillName:ze},{onSuccess:at=>{f(null),at.success?(De.success(`Skill "${at.skillName}" removed successfully`),pe()):De.error(`Failed to remove skill "${at.skillName}"`)},onError:at=>{f(null),De.error(`Failed to remove skill: ${at instanceof Error?at.message:"Unknown error"}`)}}))},[C,ie,pe]),Me=b==="files"&&ye?"files":b==="skills"&&fe?"skills":ye?"files":fe?"skills":"files",et=se?.skills??[],kt=se?.isSkillsConfigured??!1,Yt=Z?.entries??[],Sn=ye&&(xe||le),Rn=fe&&kt&&et.length>0,ct=Sn||Rn;return I?l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"workspaces"})})]}):M?l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[l.jsx(o$,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(vp,{})}),l.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[l.jsx("div",{className:"flex items-center justify-center w-16 h-16 rounded-full bg-amber-500/10 mb-6",children:l.jsx(cte,{className:"h-8 w-8 text-amber-500"})}),l.jsx("h2",{className:"text-xl font-semibold text-neutral6 mb-2",children:"Workspace Not Supported"}),l.jsxs("p",{className:"text-neutral4 max-w-md mb-6",children:["The workspace feature requires a newer version of ",l.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),". Please upgrade your dependencies to enable workspace functionality."]}),l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[l.jsx(ke,{children:l.jsx(qi,{})}),"Learn More"]})]})]})})]}):k?l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(ke,{children:l.jsx(qi,{})}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ht,{})})]}):!j&&!k&&!ve?l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[l.jsx(o$,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(vp,{})}),l.jsx(abr,{})]})})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(Ss,{children:[ct&&l.jsxs(ge,{variant:"light",onClick:()=>s(!a),children:[l.jsx(ke,{children:l.jsx(F4t,{className:"h-4 w-4"})}),"Search"]}),l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(ke,{children:l.jsx(qi,{})}),"Workspaces documentation"]})]})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start gap-6 h-full w-full",children:[l.jsx(o$,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(vp,{})}),E.length>1&&l.jsxs("div",{className:"relative",children:[l.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:[F?.source==="agent"?l.jsx(wD,{className:"h-4 w-4 text-accent1"}):l.jsx(K7,{className:"h-4 w-4 text-neutral4"}),l.jsxs("span",{className:"flex-1 text-left truncate",children:[F?.name??"Select workspace",F?.source==="agent"&&F.agentName&&l.jsxs("span",{className:"text-neutral4 ml-1",children:["(",F.agentName,")"]})]}),l.jsx(n4t,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&l.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:E.map(ze=>l.jsxs("button",{onClick:()=>{V(ze.id),o(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${F?.id===ze.id?"bg-surface3":""}`,children:[ze.source==="agent"?l.jsx(wD,{className:"h-4 w-4 text-accent1 flex-shrink-0"}):l.jsx(K7,{className:"h-4 w-4 text-neutral4 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:ze.name}),l.jsx("div",{className:"text-xs text-neutral4 truncate",children:ze.source==="agent"?`Agent: ${ze.agentName}`:"Global workspace"})]}),l.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[ze.safety?.readOnly&&l.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&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),ze.capabilities.hasSandbox&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),ze.capabilities.hasSkills&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},ze.id))})]}),E.length===1&&F&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[F.source==="agent"?l.jsx(wD,{className:"h-4 w-4 text-accent1"}):l.jsx(K7,{className:"h-4 w-4"}),l.jsx("span",{children:F.name}),F.source==="agent"&&F.agentName&&l.jsxs("span",{className:"text-neutral3",children:["(",F.agentName,")"]}),we&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),a&&ct&&C&&l.jsx(rkr,{workspaceId:C,canSearchFiles:Sn,canSearchSkills:Rn,canBM25:xe,canVector:le,showInitWarning:!j&&T?.status!=="ready",onViewFileResult:ze=>{D({file:ze,tab:"files"})},onViewSkillResult:(ze,at)=>{C&&r(`/workspaces/${C}/skills/${encodeURIComponent(ze)}?path=${encodeURIComponent(at)}`)}},C),l.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[ye&&l.jsxs("button",{onClick:()=>q("files"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Me==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(ek,{className:"h-4 w-4"}),"Files"]}),fe&&l.jsxs("button",{onClick:()=>q("skills"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Me==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(F$,{className:"h-4 w-4"}),"Skills",kt&&et.length>0&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:et.length})]})]}),l.jsxs("div",{className:"pb-8",children:[Me==="files"&&ye&&l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(ebr,{entries:Yt,currentPath:W,isLoading:z,error:R,onNavigate:H,onFileSelect:B,onRefresh:()=>Q(),onCreateDirectory:we?void 0:ze=>ee.mutate({path:ze,workspaceId:C}),onDelete:we?void 0:ze=>G.mutate({path:ze,recursive:!0,force:!0,workspaceId:C})}),L&&l.jsx(rbr,{path:L,content:re?.content??"",isLoading:ne,mimeType:re?.mimeType,onClose:()=>B(null)})]})}),Me==="skills"&&fe&&l.jsx(pbr,{skills:et,isLoading:oe,isSkillsConfigured:kt,hasUndiscoveredAgentSkills:m,basePath:C?`/workspaces/${C}/skills`:"/workspaces",onAddSkill:J?()=>u(!0):void 0,onUpdateSkill:J?ce:void 0,onRemoveSkill:J?_e:void 0,updatingSkillName:p??void 0,removingSkillName:d??void 0,mountPaths:Se}),!ye&&!fe&&l.jsx("div",{className:"py-12 text-center text-neutral4",children:l.jsx("p",{children:"No workspace capabilities are configured."})})]})]})}),C&&J&&l.jsx(bbr,{open:c,onOpenChange:u,workspaceId:C,onInstall:Ce,isInstalling:K.isPending,installedSkillIds:et.filter(ze=>ze.skillsShSource).map(ze=>`${ze.skillsShSource.owner}/${ze.skillsShSource.repo}/${ze.name}`),installedSkillNames:et.filter(ze=>!ze.skillsShSource).map(ze=>ze.name),writableMounts:ue,installedSkillPaths:Object.fromEntries(et.filter(ze=>ze.path).map(ze=>[ze.name,ze.path]))})]})}function rkr({workspaceId:e,canSearchFiles:t,canSearchSkills:n,canBM25:r,canVector:a,showInitWarning:s,onViewFileResult:i,onViewSkillResult:o}){const c=Rdr(),u=$dr();return l.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[t&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[l.jsx(ek,{className:"h-4 w-4"}),"Search Indexed Files"]}),s&&l.jsxs("p",{className:"text-xs text-amber-400 mb-3",children:["File search requires ",l.jsx("code",{className:"text-amber-300",children:"workspace.init()"})," to index files from your configured ",l.jsx("code",{className:"text-amber-300",children:"autoIndexPaths"}),"."]}),l.jsx(sbr,{onSearch:d=>c.mutate({...d,workspaceId:e}),isSearching:c.isPending,searchResults:c.data?{...c.data,results:c.data.results.filter(d=>!d.id.startsWith("skill:"))}:void 0,canBM25:r,canVector:a,onViewResult:i})]}),n&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[l.jsx(F$,{className:"h-4 w-4"}),"Search Skills"]}),l.jsx(obr,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>o(d.skillName,d.skillPath)})]})]})}function akr(e,t){return e==null||t==null?null:e in t?e:null}function skr(){const{skillName:e,workspaceId:t}=ms(),[n]=_o(),r=ts(),a=e?decodeURIComponent(e):"",s=n.get("path"),i=s?decodeURIComponent(s):void 0,o=n.get("agentId"),c=o?decodeURIComponent(o):null,d=r.getQueriesData({queryKey:["agents"]})?.[0]?.[1]??null,f=akr(c,d),p=f?`/agents/${f}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[h,m]=x.useState(null),{data:g,isLoading:v,error:b}=Mdr(a,{workspaceId:t,path:i}),{data:S}=rwt(g?.path?`${g.path}/SKILL.md`:"",{enabled:!!g?.path,workspaceId:t}),{data:O,isLoading:k}=Ddr(a,h??"",{enabled:!!h,workspaceId:t,path:i}),E=C=>f?l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:p,children:[l.jsx(ke,{children:l.jsx(wD,{className:"h-4 w-4"})}),f]}),l.jsxs(En,{as:"span",to:"",isCurrent:!0,children:[l.jsx(ke,{children:l.jsx(F$,{className:"h-4 w-4"})}),C]})]}):l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:p,children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(En,{as:Lt,to:p,children:[l.jsx(ke,{children:l.jsx(F$,{className:"h-4 w-4"})}),"Skills"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:C})]});return v?l.jsxs(Nn,{children:[l.jsx(Un,{children:E("Loading...")}),l.jsx("div",{className:"grid place-items-center h-full",children:l.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):b&&xa(b)?l.jsxs(Nn,{children:[l.jsx(Un,{children:E("Permission Denied")}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"workspaces"})})]}):b||!g?l.jsxs(Nn,{children:[l.jsx(Un,{children:E("Error")}),l.jsx("div",{className:"grid place-items-center h-full",children:l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),l.jsx("p",{className:"text-sm text-neutral3",children:b?.message??"Skill not found"})]})})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[E(g.name),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[l.jsx(ke,{children:l.jsx(qi,{})}),"Documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:l.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:l.jsx(vbr,{skill:g,rawSkillMd:S?.content,onReferenceClick:m})})}),l.jsx(ybr,{open:!!h,onOpenChange:C=>!C&&m(null),skillName:g.name,referencePath:h??"",content:O?.content,isLoading:k})]})}function ikr({pathname:e}){const t=j1r();if(!t)return null;const{experiments:n,getVariant:r,setVariant:a}=t,s=e?n.filter(i=>!i.path||(Array.isArray(i.path)?i.path.includes(e):i.path===e)):n;return s.length===0?null:l.jsxs(ih,{children:[l.jsx(tp,{asChild:!0,children:l.jsxs(ge,{"aria-label":"Experimental UI",size:"sm",className:"mr-auto ml-3 bg-blue-600 text-white",children:[l.jsx(LQe,{})," UI"]})}),l.jsx(Fd,{side:"top",align:"start",className:"w-auto p-4",children:l.jsx("div",{className:"grid gap-4",children:s.map(i=>l.jsxs("div",{children:[l.jsx("span",{className:"text-ui-md text-neutral4",children:i.name}),l.jsx(G_,{value:r(i.key),onValueChange:o=>a(i.key,o),className:"mt-2",children:i.variants.map(o=>l.jsxs("label",{className:"flex items-center gap-3 text-ui-md text-neutral3 cursor-pointer",children:[l.jsx(gu,{value:o.value}),o.label]},o.value))})]},i.key))})})]})}const okr=[{key:"primitives",title:"Primitives",href:"/primitives",links:[{name:"Agents",url:"/agents",icon:l.jsx(hs,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",icon:l.jsx(ek,{}),isOnMastraPlatform:!0,indent:!0},{name:"Workflows",url:"/workflows",icon:l.jsx(bo,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",icon:l.jsx(DQe,{}),isOnMastraPlatform:!1,indent:!0,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",icon:l.jsx(Pc,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",icon:l.jsx(Xi,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"tools:read"},{name:"Workspaces",url:"/workspaces",icon:l.jsx(vp,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",icon:l.jsx(zle,{}),isOnMastraPlatform:!0,indent:!0}]},{key:"evaluation",title:"Evaluation",href:"/evaluation",links:[{name:"Scorers",url:"/evaluation?tab=scorers",icon:l.jsx(Q3t,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"scorers:read"},{name:"Datasets",url:"/evaluation?tab=datasets",icon:l.jsx(Sd,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]},{name:"Experiments",url:"/evaluation?tab=experiments",icon:l.jsx(q4t,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]}]},{key:"observability",title:"Observability",href:"/observability-overview",links:[{name:"Metrics",url:"/metrics",icon:l.jsx(Fle,{}),isOnMastraPlatform:!0,indent:!0},{name:"Traces",url:"/observability",icon:l.jsx(JO,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"}]},{key:"bottom",separator:!0,links:[{name:"Settings",url:"/settings",icon:l.jsx(oge,{}),isOnMastraPlatform:!1},{name:"Resources",url:"/resources",icon:l.jsx(Zl,{}),isOnMastraPlatform:!0}]}],lkr={scorers:"/evaluation/scorers",datasets:"/evaluation/datasets"};function a9e(e,t,n){if(e.url.includes("?")){const[r,a]=e.url.split("?"),s=new URLSearchParams(a).get("tab"),i=new URLSearchParams(n).get("tab");if(t===r&&s&&s===i)return!0;if(s){const o=lkr[s];if(o&&(t===o||t.startsWith(o+"/")))return!0}return!1}return t===e.url||t.startsWith(e.url+"/")}function ckr(){const{state:e}=Gwt(),t=Lc(),n=t.pathname,{isMastraPlatform:r}=nSt(),{data:a}=Z_(),{isCmsAvailable:s,isLoading:i}=kge(),{hasPermission:o,hasAnyPermission:c,rbacEnabled:u,isAuthenticated:d,isLoading:f}=Iv(),p=a&&PR(a),h=new Set(["/prompts"]),m=g=>h.has(g.url)&&!s&&!i||r&&!g.isOnMastraPlatform?!1:u&&d&&f?!0:!(g.requiredPermission&&!o(g.requiredPermission)||g.requiredAnyPermission&&!c(g.requiredAnyPermission));return l.jsxs(gg,{footerSlot:l.jsx(ikr,{pathname:n}),children:[l.jsx("div",{className:"pt-3 mb-4 -ml-0.5 sticky top-0 bg-surface1 z-10",children:e==="collapsed"?l.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[l.jsx(lb,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),p&&l.jsx(Use,{})]}):p?l.jsxs("span",{className:"flex items-center justify-between pl-3 pr-2",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(lb,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),l.jsx(Use,{})]}):l.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[l.jsx(lb,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),l.jsx(gg.Nav,{children:okr.map(g=>{const v=g.links.filter(m),b=v.length>0&&g?.separator,S=v.some(k=>a9e(k,n,t.search)),O=!!(g.href&&n===g.href&&!S);return l.jsxs(gg.NavSection,{children:[g?.title?l.jsx(gg.NavHeader,{state:e,href:g.href,isActive:O,children:g.title}):l.jsx(l.Fragment,{children:b&&l.jsx(gg.NavSeparator,{})}),l.jsx(gg.NavList,{children:v.map(k=>{const E=a9e(k,n,t.search);return l.jsx(gg.NavLink,{state:e,link:k,isActive:E},k.name)})})]},g.key)})}),l.jsx(gg.Bottom,{children:e!=="collapsed"&&l.jsxs(l.Fragment,{children:[l.jsx(gg.NavSeparator,{}),l.jsx(Mlr,{collapsed:!1})]})})]})}const ukr=x.createContext({theme:"dark",setTheme:()=>null}),dkr=e=>e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";function J1t({children:e,defaultTheme:t="dark"}){const{themeToggleEnabled:n}=r9(),r=Vr(o=>o.theme),a=Vr(o=>o.setTheme),i=n?r==="light"||r==="system"?r:"dark":t;return x.useEffect(()=>{const o=window.document.documentElement,c=f=>{const p=dkr(f);o.classList.remove("light","dark"),o.classList.add(p)};if(c(i),i!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>c("system");return u.addEventListener("change",d),()=>{u.removeEventListener("change",d)}},[i]),l.jsx(ukr.Provider,{value:{theme:i,setTheme:a},children:e})}const fkr=[{key:"entity-list-page",name:"Entity List page UI",path:["/agents","/prompts","/tools","/datasets","/scorers","/mcps","/workflows","/processors"],variants:[{value:"current",label:"Current state"},{value:"new-proposal",label:"New proposal"}]}],pkr=()=>({experimentalUIEnabled:typeof window<"u"&&window.MASTRA_EXPERIMENTAL_UI==="true"});function hkr({children:e}){const{data:t,isFetched:n}=Z_(),r=n&&t?.enabled&&!PR(t),a=n&&!r;return l.jsxs(l.Fragment,{children:[l.jsx(Cbr,{}),l.jsxs("div",{className:a?"grid h-full grid-cols-[auto_1fr]":"h-full",children:[a&&l.jsx(ckr,{}),l.jsx("div",{className:Y("bg-transparent overflow-y-auto",{"h-[calc(100%-1.5rem)]":r}),children:l.jsx(iSt,{children:e})})]})]})}const mkr=({children:e})=>{const{experimentalUIEnabled:t}=pkr();return l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(wst,{position:"bottom-right"}),l.jsx(J1t,{defaultTheme:"dark",attribute:"class",children:l.jsx(Uo,{delayDuration:0,children:l.jsx(N1r,{experiments:t?fkr:[],children:l.jsx(Tyr,{children:l.jsx(hkr,{children:e})})})})})]})},gkr=({children:e})=>l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(wst,{position:"bottom-right"}),l.jsx(J1t,{defaultTheme:"dark",attribute:"class",children:l.jsx(Uo,{delayDuration:0,children:l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsx(iSt,{children:e})})})})]});function vkr({agentId:e}){return l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/agents",children:[l.jsx(ke,{children:l.jsx(hs,{})}),"Agents"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:l.jsx(pcr,{value:e,variant:"ghost"})})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Agents documentation"]})})]})}const ykr=({children:e})=>{const{agentId:t}=ms(),n=Lc(),{isCmsAvailable:r}=kge(),{hasObservability:a}=Flr(),s=xie.has("datasets"),i=r&&s,o=a&&s,{data:c}=Hd(t),u=_c(c?.provider??""),d=c?.modelId??"",f=c?.requestContextSchema,p=n.pathname.includes("/playground")?"versions":n.pathname.includes("/evaluate")?"evaluate":n.pathname.includes("/review")?"review":n.pathname.includes("/traces")?"traces":"chat",h=(p==="versions"||p==="evaluate"||p==="review")&&(i||o),m=l.jsxs(Nn,{className:"grid-rows-[auto_auto_1fr]",children:[l.jsx(vkr,{agentId:t}),l.jsx(Spr,{agentId:t,activeTab:p,showPlayground:i,showObservability:o,rightSlot:h?l.jsx(Opr,{requestContextSchema:f}):void 0}),e]});return!i&&!o?m:l.jsx(Gz,{children:l.jsx(Zir,{defaultProvider:u,defaultModel:d,children:l.jsx(dpr,{children:l.jsx(Yir,{children:m})})})})};function bkr(){const{data:e={},isLoading:t,error:n}=Lge(),{variant:r}=rE("entity-list-page"),[a,s]=x.useState(""),i=!t&&Object.keys(e).length===0;return r==="new-proposal"?l.jsxs(us,{children:[l.jsxs(us.Top,{children:[l.jsxs(pt,{withMargins:!1,children:[l.jsx(pt.Column,{children:l.jsxs(pt.Title,{isLoading:t,children:[l.jsx(ob,{})," Processors"]})}),l.jsx(pt.Column,{className:"flex justify-end gap-2",children:l.jsx(Gi,{as:"a",href:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Processors documentation",children:l.jsx(Zl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(vS,{onSearch:s,label:"Filter processors",placeholder:"Filter by name"})})]}),l.jsx(Zpr,{processors:e,isLoading:t,error:n,search:a,onSearch:s})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(ob,{})}),"Processors"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Processors documentation"]})})]}),l.jsx(Ki,{isCentered:i,children:l.jsx(qpr,{processors:e,isLoading:t,error:n})})]})}function xkr(){const{processorId:e}=ms(),{data:t,isLoading:n,error:r}=_wt(e);return r&&xa(r)?l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/processors",children:[l.jsx(ke,{children:l.jsx(ob,{})}),"Processors"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:e})]})}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"processors"})})]}):!n&&t?.isWorkflow?l.jsx(g0r,{to:`/workflows/${e}/graph`,replace:!0}):n?l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/processors",children:[l.jsx(ke,{children:l.jsx(ob,{})}),"Processors"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:l.jsx(Fn,{className:"h-6 w-32"})})]})}),l.jsxs("div",{className:"p-6",children:[l.jsx(Fn,{className:"h-8 w-48 mb-4"}),l.jsx(Fn,{className:"h-32 w-full"})]})]}):l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/processors",children:[l.jsx(ke,{children:l.jsx(ob,{})}),"Processors"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:l.jsx(thr,{value:e,variant:"ghost"})})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Processors documentation"]})})]}),l.jsx(Kpr,{processorId:e})]})}function wkr(){const{data:e={},isLoading:t}=ch(),{data:n={},isLoading:r,error:a}=u9(),{variant:s}=rE("entity-list-page"),[i,o]=x.useState(""),c=t||r,u=Object.keys(n).length>0,d=Object.values(e).some(p=>p.tools&&Object.keys(p.tools).length>0),f=!c&&!u&&!d;return s==="new-proposal"?l.jsxs(us,{children:[l.jsxs(us.Top,{children:[l.jsxs(pt,{withMargins:!1,children:[l.jsx(pt.Column,{children:l.jsxs(pt.Title,{isLoading:c,children:[l.jsx(Xi,{})," Tools"]})}),l.jsx(pt.Column,{className:"flex justify-end gap-2",children:l.jsx(Gi,{as:"a",href:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Tools documentation",children:l.jsx(Zl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(vS,{onSearch:o,label:"Filter tools",placeholder:"Filter by name"})})]}),l.jsx(lhr,{tools:n,agents:e,isLoading:c,error:a,search:i,onSearch:o})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(Xi,{})}),"Tools"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Tools documentation"]})})]}),l.jsx(Ki,{isCentered:f,children:l.jsx(ahr,{tools:n,agents:e,isLoading:c,error:a})})]})}const eOt={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,n,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(t)}?agentId=${encodeURIComponent(e)}${n?`&path=${encodeURIComponent(n)}`:""}`:"/workspaces",agentsLink:()=>"/agents",agentNewThreadLink:e=>`/agents/${e}/chat/new`,agentThreadLink:(e,t,n)=>n?`/agents/${e}/chat/${t}?messageId=${n}`:`/agents/${e}/chat/${t}`,workflowsLink:()=>"/workflows",workflowLink:e=>`/workflows/${e}`,networkLink:e=>`/networks/v-next/${e}/chat`,networkNewThreadLink:e=>`/networks/v-next/${e}/chat/${Hi()}`,networkThreadLink:(e,t)=>`/networks/v-next/${e}/chat/${t}`,scorerLink:e=>`/evaluation/scorers/${e}`,cmsScorersCreateLink:()=>"/cms/scorers/create",cmsScorerEditLink:e=>`/cms/scorers/${e}/edit`,cmsAgentCreateLink:()=>"/cms/agents/create",cmsAgentEditLink:e=>`/cms/agents/${e}/edit`,promptBlockLink:e=>`/prompts/${e}`,promptBlocksLink:()=>"/prompts",cmsPromptBlockCreateLink:()=>"/cms/prompts/create",cmsPromptBlockEditLink:e=>`/cms/prompts/${e}/edit`,toolLink:e=>`/tools/${e}`,skillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/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=>`/evaluation/datasets/${e}`,datasetItemLink:(e,t)=>`/evaluation/datasets/${e}/items/${t}`,datasetExperimentLink:(e,t)=>`/evaluation/datasets/${e}/experiments/${t}`},Skr=()=>{const e=Fc(),t=n=>e(n,{viewTransition:!0});return l.jsx(xbt,{Link:G1t,navigate:t,paths:eOt,children:l.jsx(mkr,{children:l.jsx(Gk,{})})})},Okr=()=>{const e=Fc(),t=n=>e(n,{viewTransition:!0});return l.jsx(xbt,{Link:G1t,navigate:t,paths:eOt,children:l.jsx(gkr,{children:l.jsx(Gk,{})})})},kkr=!!window.MASTRA_CLOUD_API_ENDPOINT,s9e=xie.has("datasets"),i9e=[{index:!0,element:l.jsx(B1r,{})},{path:"instruction-blocks",element:l.jsx(U1r,{})},{path:"tools",element:l.jsx(Q1r,{})},{path:"agents",element:l.jsx(L1r,{})},{path:"scorers",element:l.jsx(q1r,{})},{path:"workflows",element:l.jsx(G1r,{})},{path:"skills",element:l.jsx(H1r,{})},{path:"memory",element:l.jsx(V1r,{})},{path:"variables",element:l.jsx(W1r,{})}],_kr=[{path:"/login",element:l.jsx(hOr,{})},{path:"/signup",element:l.jsx(LOr,{})},{element:l.jsx(Okr,{}),children:[{path:"/agents/:agentId/session",element:l.jsx(Gze,{})},{path:"/agents/:agentId/session/:threadId",element:l.jsx(Gze,{})}]},{element:l.jsx(Skr,{}),children:[...kkr?[]:[{path:"/settings",element:l.jsx($Or,{})},{path:"/templates",element:l.jsx(XOr,{})},{path:"/templates/:templateSlug",element:l.jsx(JOr,{})}],{path:"/primitives",element:l.jsx(TOr,{})},{path:"/evaluation",element:l.jsx(pOr,{})},{path:"/evaluation/scorers/:scorerId",element:l.jsx(POr,{})},{path:"/metrics",element:l.jsx(yOr,{})},{path:"/observability-overview",element:l.jsx(COr,{})},{path:"/observability",element:l.jsx(_Or,{})},{path:"/resources",element:l.jsx(ROr,{})},{path:"/agents",element:l.jsx(A1r,{})},{path:"/cms/agents/create",element:l.jsx(F1r,{}),children:i9e},{path:"/cms/agents/:agentId/edit",element:l.jsx(z1r,{}),children:i9e},{path:"/cms/scorers/create",element:l.jsx(K1r,{})},{path:"/cms/scorers/:scorerId/edit",element:l.jsx(eOr,{})},{path:"/prompts",element:l.jsx(NOr,{})},{path:"/cms/prompts/create",element:l.jsx(Z1r,{})},{path:"/cms/prompts/:promptBlockId/edit",element:l.jsx(X1r,{})},{path:"/agents/:agentId/tools/:toolId",element:l.jsx(ekr,{})},{path:"/agents/:agentId",element:l.jsx(ykr,{children:l.jsx(Gk,{})}),children:[{index:!0,loader:({params:e})=>JJ(`/agents/${e.agentId}/chat`)},{path:"chat",element:l.jsx(Wze,{})},{path:"chat/:threadId",element:l.jsx(Wze,{})},...s9e?[{path:"playground",element:l.jsx(M1r,{})},{path:"evaluate",element:l.jsx(P1r,{})},{path:"review",element:l.jsx(D1r,{})}]:[],{path:"traces",element:l.jsx($1r,{})}]},{path:"/tools",element:l.jsx(wkr,{})},{path:"/tools/:toolId",element:l.jsx(tkr,{})},{path:"/processors",element:l.jsx(bkr,{})},{path:"/processors/:processorId",element:l.jsx(xkr,{})},{path:"/mcps",element:l.jsx(mOr,{})},{path:"/mcps/:serverId",element:l.jsx(gOr,{})},{path:"/mcps/:serverId/tools/:toolId",element:l.jsx(vOr,{})},{path:"/workspaces",element:l.jsx(r9e,{})},{path:"/workspaces/:workspaceId",element:l.jsx(r9e,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:l.jsx(skr,{})},{path:"/workflows",element:l.jsx(nkr,{})},{path:"/workflows/:workflowId",element:l.jsx(twr,{children:l.jsx(Gk,{})}),children:[{index:!0,loader:({params:e})=>JJ(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:l.jsx(n9e,{})},{path:"graph/:runId",element:l.jsx(n9e,{})}]},...s9e?[{path:"/evaluation/datasets/:datasetId",element:l.jsx(nOr,{})},{path:"/evaluation/datasets/:datasetId/items/:itemId",element:l.jsx(sOr,{})},{path:"/evaluation/datasets/:datasetId/items/:itemId/versions",element:l.jsx(lOr,{})},{path:"/evaluation/datasets/:datasetId/experiments/:experimentId",element:l.jsx(rOr,{})},{path:"/evaluation/datasets/:datasetId/experiments",element:l.jsx(aOr,{})},{path:"/evaluation/datasets/:datasetId/items",element:l.jsx(iOr,{})},{path:"/evaluation/datasets/:datasetId/versions",element:l.jsx(uOr,{})}]:[],{index:!0,loader:()=>JJ("/agents")},{path:"/request-context",element:l.jsx(AOr,{})}]}];function Ekr(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:n,apiPrefix:r,isLoading:a}=r9();if(a)return null;if(!t)return l.jsx(Llr,{});const s=U0r(_kr,{basename:e});return l.jsx(jFt,{baseUrl:t,headers:n,apiPrefix:r,children:l.jsx(E1r,{children:l.jsx(p0r,{router:s})})})}function Ckr(){const e=window.MASTRA_SERVER_PROTOCOL||"http",t=window.MASTRA_SERVER_HOST||"localhost",n=window.MASTRA_SERVER_PORT||4111,r=window.MASTRA_API_PREFIX||"/api",a=window.MASTRA_CLOUD_API_ENDPOINT||"",s=window.MASTRA_AUTO_DETECT_URL==="true",i=window.MASTRA_THEME_TOGGLE==="true",o=a||(s?window.location.origin:`${e}://${t}:${n}`);return l.jsx(Ryr,{children:l.jsx(Tlr,{endpoint:o,defaultApiPrefix:r,themeToggleEnabled:i,children:l.jsx(Ekr,{})})})}d_t.createRoot(document.getElementById("root")).render(l.jsx(x.StrictMode,{children:l.jsx(Ckr,{})}));const $_r=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{Jet as A,Hrt as B,ttt as C,qnt as D,Dd as E,Rf as F,Tkr as G,v_t as H,Za as I,$_r as J,tw as L,Ket as N,VL as _,P6t as a,Y6t as b,c_r as c,HSe as d,rw as e,Q6t as f,yO as g,Z6t as h,Yw as i,Xw as j,Zw as k,Oan as l,Xnt as m,X0 as n,ps as o,Lrn as p,$rn as q,tde as r,tce as s,he as t,g3 as u,Yc as v,F6t as w,vt as x,tt as y,hat as z};
510
+ `).reduce((o,c)=>{if(!c||c.startsWith("#"))return o;const[u,d]=c.split("=");return u&&(o[u]=d?.split("")?.every(f=>f==="*")?"":d?.replaceAll('"',"")),o},{}):{}}const UOr=()=>wt({queryKey:["mastra-templates"],queryFn:X1t}),VOr=({repoOrSlug:e,owner:t})=>wt({queryKey:["template-repo",e,t],queryFn:()=>zOr({repoOrSlug:e,owner:t})}),qOr=({repo:e,owner:t,branch:n})=>wt({queryKey:["template-repo-env-vars",e,t,n],queryFn:()=>BOr({repo:e,owner:t,branch:n})}),HOr=()=>{const e=qe();return wt({queryKey:["agent-builder-workflow"],queryFn:async()=>await e.getAgentBuilderAction("merge-template").details()})},QOr=()=>{const e=qe();return Qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").createRun({runId:t})})},WOr=()=>{const e=qe();return Qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").runById(t)})},e9e=e=>{if(typeof e=="string")return e;if(e==null)return"Unknown error";if(e instanceof Error)return typeof e.message=="string"&&e.message.length>0?e.message:"Unknown error";if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)},t9e=(e,t,n)=>{let r={...t};if(!(r.payload?.workflowState?.steps&&Object.keys(r.payload.workflowState.steps).length>0)&&n?.allSteps&&(r.payload={...r.payload,workflowState:{...r.payload?.workflowState,steps:Object.keys(n.allSteps).reduce((s,i)=>(s[i]={id:i,description:n.allSteps[i].description,status:"pending"},s),{})}}),e.type==="start"||e.type==="workflow-start"){const s={};n?.allSteps&&Object.entries(n.allSteps).forEach(([o,c])=>{s[o]={id:c.id,description:c.description,status:"pending"}});const i=e.runId||e.payload?.runId;r={...r,runId:i,eventTimestamp:new Date().toISOString(),status:"running",phase:"initializing",payload:{workflowState:{status:"running",steps:s},currentStep:null}}}if(e.type==="step-start"||e.type==="workflow-step-start"){const s=e.payload.id;r={...r,phase:"processing",payload:{...r.payload,currentStep:{id:s,status:"running",startTime:new Date,...e.payload},workflowState:{...r.payload.workflowState,steps:{...r.payload.workflowState.steps,[s]:{...r.payload.workflowState.steps[s],status:"running",startTime:new Date,...e.payload}}}}}}if(e.type==="step-result"||e.type==="workflow-step-result"){const s=e.payload.id,i=e.payload.status,o=e.payload.error;if(r={...r,payload:{...r.payload,currentStep:{...r.payload.currentStep,status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date},workflowState:{...r.payload.workflowState,steps:{...r.payload.workflowState.steps,[s]:{...r.payload.workflowState.steps[s],status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date}}}}},i==="failed"&&o){const c=e9e(o);r={...r,status:"failed",error:c,phase:"error",failedStep:{id:s,error:c,description:e.payload.description||s},payload:{...r.payload,workflowState:{...r.payload.workflowState,status:"failed"}},errorTimestamp:new Date}}}if((e.type==="step-finish"||e.type==="workflow-step-finish")&&(r={...r,payload:{...r.payload,currentStep:null}}),(e.type==="finish"||e.type==="workflow-finish")&&(r.phase==="error"||r.status==="failed"?r={...r,completedAt:new Date}:r={...r,status:e.payload.status||"completed",phase:"completed",payload:{...r.payload,currentStep:null,workflowState:{...r.payload.workflowState,status:e.payload.status||"completed"}},completedAt:new Date}),e.type==="error"){const s=e9e(e.payload.error);r={...r,status:"failed",error:s,phase:"error",payload:{...r.payload,workflowState:{...r.payload.workflowState,status:"failed"}},errorTimestamp:new Date}}return{newState:r}},GOr=(e,t)=>{try{localStorage.setItem(`template-install-${e}`,JSON.stringify({state:t,timestamp:Date.now()}))}catch(n){console.warn("Failed to save template state to localStorage:",n)}},K1t=(e,t)=>{const[n,r]=x.useState({}),[a,s]=x.useState(!1);return{streamResult:n,isStreaming:a,processStream:async(o,c)=>{if(s(!0),r({}),!o)throw new Error("No stream returned");const u=o.getReader();let d={runId:c||t,eventTimestamp:new Date().toISOString(),phase:"running",payload:{workflowState:{steps:{}},currentStep:null}};try{for(;;){const{done:f,value:p}=await u.read();if(f)break;const{newState:h}=t9e(p,d,e);if(d=h,r(h),p.runId||c||t){const m=p.runId||c||t;GOr(m,h)}}}catch(f){console.error("💥 [processStream] Error processing template installation stream:",f);const{newState:p}=t9e({type:"error",payload:{error:f instanceof Error?f.message:"Unknown error"}},d,e);r(p)}finally{s(!1),u.releaseLock()}}}},ZOr=e=>{const t=qe(),{streamResult:n,isStreaming:r,processStream:a}=K1t(e);return{streamInstall:Qn({mutationFn:async({inputData:i,selectedModel:o,runId:c})=>{for(let d=1;d<=3;d++)try{const f=t.getAgentBuilderAction("merge-template"),p=new oI;p.set("selectedModel",o);const h=await f.stream({inputData:i,requestContext:p},c);await a(h,c);return}catch(f){console.error(`💥 [streamInstall] Attempt ${d} failed:`,f);const p=f?.message?.includes("Failed to fetch")||f?.message?.includes("NetworkError")||f?.message?.includes("network error")||f?.message?.includes("fetch")||f?.code==="NETWORK_ERROR"||f?.name==="TypeError";if(console.warn(`Stream attempt ${d}/3 failed:`,f),p){const h=c?`Network error during template installation (likely hot reload). Please refresh the page to resume from where you left off using runId: ${c}`:"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:",f),f}}}),streamResult:n,isStreaming:r}},YOr=e=>{const t=qe(),{streamResult:n,isStreaming:r,processStream:a}=K1t(e);return{observeInstall:Qn({mutationFn:async({runId:i})=>{for(let u=1;u<=3;u++)try{const f=await t.getAgentBuilderAction("merge-template").observeStream({runId:i});await a(f,i);return}catch(d){console.error(`💥 [observeInstall] Attempt ${u} failed:`,d);const f=d?.message?.includes("Failed to fetch")||d?.message?.includes("NetworkError")||d?.message?.includes("network error")||d?.message?.includes("fetch")||d?.code==="NETWORK_ERROR"||d?.name==="TypeError";if(console.warn(`ObserveStream attempt ${u}/3 failed:`,d),f&&u<3){console.info(`🔄 ObserveStream network error detected (likely hot reload), retrying in 2000ms... (attempt ${u+1}/3)`),await new Promise(p=>setTimeout(p,2e3));continue}throw console.error("❌ [observeInstall] Non-network error or max retries reached, throwing:",d),d}}}),streamResult:n,isStreaming:r}};function XOr(){const{data:e,isLoading:t}=UOr(),{templates:n,tags:r,providers:a}=e??{templates:[],tags:[],providers:[]},[s,i]=x.useState("all"),[o,c]=x.useState("all"),[u,d]=x.useState(""),f=[{value:"all",label:"Any tag"}];(r||[]).forEach(S=>{f.push({value:S,label:S})});const p=[{value:"all",label:"Any provider"}];(a||[]).forEach(S=>{p.push({value:S,label:S})});const h=(S,O)=>{O==="tag"?i(S):O==="provider"&&c(S)},m=S=>{d(S)},g=()=>{i("all"),c("all"),d("")},v=n.filter(S=>!(u&&!S.title.toLowerCase().includes(u)&&!S.description.toLowerCase().includes(u)||s!=="all"&&!S.tags.includes(s)||o!=="all"&&!S.supportedProviders.includes(o))),b=u||s!=="all"||o!=="all";return l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(FQe,{})}),"Templates"]})}),l.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[l.jsx(fhr,{selectedTag:s,onTagChange:S=>h(S,"tag"),tagOptions:f,selectedProvider:o,onProviderChange:S=>h(S,"provider"),providerOptions:p,searchTerm:u,onSearchChange:m,onReset:b?g:void 0,className:"max-w-[80rem]",isLoading:t}),l.jsx(hhr,{templates:v,linkComponent:Lt,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const KOr="1.18.0-alpha.2";function JOr(){const{templateSlug:e}=ms(),[t,n]=_o(),[r,a]=x.useState(""),[s,i]=x.useState(""),[o,c]=x.useState(""),[u,d]=x.useState({}),[f,p]=x.useState([]),[h,m]=x.useState(null),[g,v]=x.useState(!1),[b,S]=x.useState(""),[O,k]=x.useState(!1),[E,C]=x.useState(!1),[T,j]=x.useState([]),{data:A,isLoading:I}=VOr({repoOrSlug:e,owner:"mastra-ai"}),M=KOr?.includes("beta")??!1?"beta":"main",{data:F,isLoading:D}=qOr({repo:A?.githubUrl?new URL(A.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:M}),{data:V,isLoading:H}=HOr(),{mutateAsync:B,isPending:q}=QOr(),{mutateAsync:W}=WOr(),{streamInstall:L,streamResult:Z,isStreaming:z}=ZOr(V),{observeInstall:R,streamResult:Q,isStreaming:G}=YOr(V);x.useEffect(()=>{const ae=t.get("runId");ae&&!g&&!h&&!z&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:ae}),S(ae),W({runId:ae}).then(ie=>{const ve=ie.snapshot;if(ve?.status==="success"&&ve?.result?.success)v(!0);else if(ve?.result?.success===!1)if(ve?.result?.validationResults&&!ve?.result?.validationResults?.valid&&ve?.result?.validationResults?.remainingErrors>0){const{remainingErrors:fe,errors:xe}=ve.result.validationResults,le=`Template installation completed but ${fe} validation issue${fe>1?"s":""} remain unresolved.`;m(le),j(xe||[])}else{const fe=ve?.result?.message||ve?.result?.error||"Template installation failed";m(typeof fe=="string"?fe:String(fe))}}).catch(ie=>{console.error("❌ Failed to fetch run details:",ie),m("Failed to retrieve installation status after reload")}))},[t,g,h,z,G,W]),x.useEffect(()=>{const ae=t.get("runId"),ie=t.get("resume"),ve=t.get("provider");if(ae&&ie==="true"&&ve&&!z&&!G&&!O&&!E&&V){S(ae),k(!0);try{W({runId:ae}).then(ye=>{if(ye.snapshot?.status==="running")return R.mutateAsync({runId:ae})}).then(()=>{n(ye=>{const fe=new URLSearchParams(ye);return fe.delete("resume"),fe})}).catch(ye=>{console.error("❌ Failed to resume template installation:",ye),ye.message?.includes("404")||ye.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(ye){console.error("❌ Auto-resume failed with error:",ye),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,z,G,O,E,V,W,R,n]);const ee=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],re=[{key:"tools",label:"Tools",value:A?.tools?.length?A.tools.map(ae=>ae).join(", "):"n/a",icon:l.jsx(Xi,{})},{key:"agents",label:"Agents",value:A?.agents?.length?A.agents.map(ae=>ae).join(", "):"n/a",icon:l.jsx(hs,{})},{key:"workflows",label:"Workflows",value:A?.workflows?.length?A.workflows.map(ae=>ae).join(", "):"n/a",icon:l.jsx(Y4t,{})},{key:"providers",label:"Providers",value:A?.supportedProviders?.length?A.supportedProviders.join(", "):"n/a",icon:l.jsx(Y3t,{})},{key:"tags",label:"Tags",value:A?.tags?.length?A.tags.join(", "):"n/a",icon:l.jsx(U4t,{})}],ne=[{...re[0]},{...re[1]},{...re[2]}].filter(ae=>ae.value!=="n/a");x.useEffect(()=>{F&&d(F)},[F]),x.useEffect(()=>{const ae=Z||Q;ae?.phase==="error"&&ae?.error&&m(typeof ae.error=="string"?ae.error:String(ae.error))},[Z?.phase,Z?.error,Q?.phase,Q?.error]);const se=ae=>{a(ae)},oe=async ae=>(i(ae.provider),c(ae.modelId),{message:"Model updated successfully"}),pe=async()=>{const ae=Object.entries(u).reduce((ie,[ve,ye])=>(ye===""&&ie.push(ve),ie),[]);if(ae.length>0){p(ae);return}if(A){m(null),v(!1),S(""),C(!0);try{const ve={repo:A.githubUrl||`https://github.com/mastra-ai/template-${A.slug}`,ref:M,slug:A.slug,variables:u},{runId:ye}=await B({});S(ye),n(fe=>{const xe=new URLSearchParams(fe);return xe.set("runId",ye),xe.set("resume","true"),xe.set("provider",r||"openai"),xe}),await L.mutateAsync({inputData:ve,selectedModel:{provider:s,modelId:o},runId:ye})}catch(ie){C(!1),m(ie?.message||"Template installation failed"),console.error("Template installation failed",ie)}}},K=ae=>{const{name:ie,value:ve}=ae.target;ve.trim()===""?p(ye=>[...ye,ie]):p(ye=>ye.filter(fe=>fe!==ie)),d(ye=>({...ye,[ie]:ve}))};return l.jsxs(Nn,{children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/templates",children:[l.jsx(ke,{children:l.jsx(FQe,{})}),"Templates"]}),l.jsx(En,{as:Lt,to:`/templates/${A?.slug}`,isCurrent:!0,children:A?.title&&A.title})]})}),l.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:l.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[l.jsx(mhr,{isLoading:I,title:A?.title,description:A?.longDescription,imageURL:A?.imageURL,githubUrl:A?.githubUrl,infoData:re,templateSlug:e}),A&&l.jsxs(l.Fragment,{children:[(z||G)&&l.jsx(whr,{name:A.title,streamResult:G?Q:Z,runId:b,workflowInfo:V}),g&&l.jsx(Shr,{name:A.title,installedEntities:ne,linkComponent:Lt}),h&&l.jsx(Ohr,{errorMsg:h,validationErrors:T.length>0?T:Z?.validationResults?.errors||Q?.validationResults?.errors}),!z&&!G&&!g&&!h&&l.jsx(ghr,{providerOptions:ee,selectedProvider:r,onProviderChange:se,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:pe,handleVariableChange:K,isLoadingEnvVars:D||H,isInstalling:q,defaultModelProvider:s,defaultModelId:o,onModelUpdate:oe})]})]})})]})}const ekr=()=>{const{toolId:e,agentId:t}=ms();return l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/agents",children:[l.jsx(ke,{children:l.jsx(hs,{})}),"Agents"]}),l.jsx(En,{as:Lt,to:`/agents/${t}/chat`,children:t}),l.jsx(En,{as:Lt,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[l.jsx(ke,{children:l.jsx(qi,{})}),"Tools documentation"]})})]}),l.jsx(ycr,{toolId:e,agentId:t})]})},tkr=()=>{const{toolId:e}=ms();return l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/tools",children:[l.jsx(ke,{children:l.jsx(Xi,{})}),"Tools"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:l.jsx(dhr,{value:e,variant:"ghost"})})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Tools documentation"]})})]}),l.jsx(uhr,{toolId:e})]})};function nkr(){const{data:e,isLoading:t,error:n}=Pv(),{variant:r}=rE("entity-list-page"),[a,s]=x.useState(""),i=!t&&Object.keys(e||{}).length===0;return r==="new-proposal"?l.jsxs(us,{children:[l.jsxs(us.Top,{children:[l.jsxs(pt,{withMargins:!1,children:[l.jsx(pt.Column,{children:l.jsxs(pt.Title,{isLoading:t,children:[l.jsx(bo,{})," Workflows"]})}),l.jsx(pt.Column,{className:"flex justify-end gap-2",children:l.jsx(Gi,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:l.jsx(Zl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(vS,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),l.jsx(Hsr,{workflows:e||{},isLoading:t,error:n,search:a,onSearch:s})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(bo,{})}),"Workflows"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Workflows documentation"]})})]}),l.jsx(Ki,{isCentered:i,children:l.jsx(Asr,{workflows:e||{},isLoading:t,error:n})})]})}const n9e=()=>{const{workflowId:e}=ms(),{data:t,isLoading:n,error:r}=IR(e);return r&&xa(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"workflows"})}):l.jsx(zbt,{workflowId:e,workflow:t??void 0,isLoading:n})};function r9e(){const{workspaceId:e}=ms(),[t,n]=_o(),r=Fc(),[a,s]=x.useState(!1),[i,o]=x.useState(!1),[c,u]=x.useState(!1),[d,f]=x.useState(null),[p,h]=x.useState(null),[m,g]=x.useState(!1),v=t.get("file"),b=t.get("tab"),{data:S,error:O,isLoading:k}=nwt(),E=S?.workspaces??[],C=e??E[0]?.id,{data:T,isLoading:j,error:A}=jdr(C),I=xa(O)||xa(A),P=t.get("path")||".",M=aae(O)||aae(A),F=C?E.find(ze=>ze.id===C):void 0,D=ze=>{const at=new URLSearchParams(t);for(const[Je,Ze]of Object.entries(ze))Ze===null?at.delete(Je):at.set(Je,Ze);n(at)},V=ze=>{g(!1),s(!1),r(`/workspaces/${ze}`)},H=ze=>{D({path:ze==="."||ze===""?null:ze,file:null})},B=ze=>{D({file:ze})},q=ze=>{D({tab:ze})},W=P,L=v,{data:Z,isLoading:z,error:R,refetch:Q}=Tdr(W,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:C}),G=Adr(),ee=Idr(),{data:re,isLoading:ne}=rwt(L??"",{enabled:!!L,workspaceId:C}),{data:se,isLoading:oe,refetch:pe}=Pdr({workspaceId:C}),K=Bdr(),ae=Udr(),ie=Vdr(),ve=T?.isWorkspaceConfigured??!1,ye=T?.capabilities?.hasFilesystem??!1,fe=T?.capabilities?.hasSkills??!1,xe=T?.capabilities?.canBM25??!1,le=T?.capabilities?.canVector??!1,we=F?.safety?.readOnly??!1,J=ye&&!we,X=T?.mounts,ue=X?.filter(ze=>!ze.readOnly).map(ze=>({path:ze.path,displayName:ze.displayName,icon:ze.icon,provider:ze.provider,name:ze.name})),Se=X&&X.length>1?X.map(ze=>ze.path):void 0,Ce=x.useCallback(ze=>{C&&K.mutate({...ze,workspaceId:C},{onSuccess:async at=>{if(at.success){u(!1);const{data:Je,error:Ze}=await pe();if(Ze||!Je){De.success(`Skill "${at.skillName}" installed successfully (${at.filesWritten} files)`);return}Je.skills.some(gt=>gt.name===at.skillName)?De.success(`Skill "${at.skillName}" installed successfully (${at.filesWritten} files)`):(g(!0),De.warning(`Skill "${at.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else De.error("Failed to install skill")},onError:at=>{De.error(`Failed to install skill: ${at instanceof Error?at.message:"Unknown error"}`)}})},[C,K,pe]),ce=x.useCallback(ze=>{C&&(h(ze),ae.mutate({workspaceId:C,skillName:ze},{onSuccess:at=>{if(h(null),at.updated.length>0){const Je=at.updated[0];Je.success?(De.success(`Skill "${ze}" updated successfully (${Je.filesWritten} files)`),pe()):De.error(`Failed to update skill: ${Je.error??"Unknown error"}`)}else De.error("Failed to update skill: No update result returned")},onError:at=>{h(null),De.error(`Failed to update skill: ${at instanceof Error?at.message:"Unknown error"}`)}}))},[C,ae,pe]),_e=x.useCallback(ze=>{C&&(f(ze),ie.mutate({workspaceId:C,skillName:ze},{onSuccess:at=>{f(null),at.success?(De.success(`Skill "${at.skillName}" removed successfully`),pe()):De.error(`Failed to remove skill "${at.skillName}"`)},onError:at=>{f(null),De.error(`Failed to remove skill: ${at instanceof Error?at.message:"Unknown error"}`)}}))},[C,ie,pe]),Me=b==="files"&&ye?"files":b==="skills"&&fe?"skills":ye?"files":fe?"skills":"files",et=se?.skills??[],kt=se?.isSkillsConfigured??!1,Yt=Z?.entries??[],Sn=ye&&(xe||le),Rn=fe&&kt&&et.length>0,ct=Sn||Rn;return I?l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"workspaces"})})]}):M?l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[l.jsx(o$,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(vp,{})}),l.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[l.jsx("div",{className:"flex items-center justify-center w-16 h-16 rounded-full bg-amber-500/10 mb-6",children:l.jsx(cte,{className:"h-8 w-8 text-amber-500"})}),l.jsx("h2",{className:"text-xl font-semibold text-neutral6 mb-2",children:"Workspace Not Supported"}),l.jsxs("p",{className:"text-neutral4 max-w-md mb-6",children:["The workspace feature requires a newer version of ",l.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),". Please upgrade your dependencies to enable workspace functionality."]}),l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[l.jsx(ke,{children:l.jsx(qi,{})}),"Learn More"]})]})]})})]}):k?l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(ke,{children:l.jsx(qi,{})}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ht,{})})]}):!j&&!k&&!ve?l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[l.jsx(o$,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(vp,{})}),l.jsx(abr,{})]})})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(Ss,{children:[ct&&l.jsxs(ge,{variant:"light",onClick:()=>s(!a),children:[l.jsx(ke,{children:l.jsx(F4t,{className:"h-4 w-4"})}),"Search"]}),l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(ke,{children:l.jsx(qi,{})}),"Workspaces documentation"]})]})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start gap-6 h-full w-full",children:[l.jsx(o$,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(vp,{})}),E.length>1&&l.jsxs("div",{className:"relative",children:[l.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:[F?.source==="agent"?l.jsx(wD,{className:"h-4 w-4 text-accent1"}):l.jsx(K7,{className:"h-4 w-4 text-neutral4"}),l.jsxs("span",{className:"flex-1 text-left truncate",children:[F?.name??"Select workspace",F?.source==="agent"&&F.agentName&&l.jsxs("span",{className:"text-neutral4 ml-1",children:["(",F.agentName,")"]})]}),l.jsx(n4t,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&l.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:E.map(ze=>l.jsxs("button",{onClick:()=>{V(ze.id),o(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${F?.id===ze.id?"bg-surface3":""}`,children:[ze.source==="agent"?l.jsx(wD,{className:"h-4 w-4 text-accent1 flex-shrink-0"}):l.jsx(K7,{className:"h-4 w-4 text-neutral4 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:ze.name}),l.jsx("div",{className:"text-xs text-neutral4 truncate",children:ze.source==="agent"?`Agent: ${ze.agentName}`:"Global workspace"})]}),l.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[ze.safety?.readOnly&&l.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&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),ze.capabilities.hasSandbox&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),ze.capabilities.hasSkills&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},ze.id))})]}),E.length===1&&F&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[F.source==="agent"?l.jsx(wD,{className:"h-4 w-4 text-accent1"}):l.jsx(K7,{className:"h-4 w-4"}),l.jsx("span",{children:F.name}),F.source==="agent"&&F.agentName&&l.jsxs("span",{className:"text-neutral3",children:["(",F.agentName,")"]}),we&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),a&&ct&&C&&l.jsx(rkr,{workspaceId:C,canSearchFiles:Sn,canSearchSkills:Rn,canBM25:xe,canVector:le,showInitWarning:!j&&T?.status!=="ready",onViewFileResult:ze=>{D({file:ze,tab:"files"})},onViewSkillResult:(ze,at)=>{C&&r(`/workspaces/${C}/skills/${encodeURIComponent(ze)}?path=${encodeURIComponent(at)}`)}},C),l.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[ye&&l.jsxs("button",{onClick:()=>q("files"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Me==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(ek,{className:"h-4 w-4"}),"Files"]}),fe&&l.jsxs("button",{onClick:()=>q("skills"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Me==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(F$,{className:"h-4 w-4"}),"Skills",kt&&et.length>0&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:et.length})]})]}),l.jsxs("div",{className:"pb-8",children:[Me==="files"&&ye&&l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(ebr,{entries:Yt,currentPath:W,isLoading:z,error:R,onNavigate:H,onFileSelect:B,onRefresh:()=>Q(),onCreateDirectory:we?void 0:ze=>ee.mutate({path:ze,workspaceId:C}),onDelete:we?void 0:ze=>G.mutate({path:ze,recursive:!0,force:!0,workspaceId:C})}),L&&l.jsx(rbr,{path:L,content:re?.content??"",isLoading:ne,mimeType:re?.mimeType,onClose:()=>B(null)})]})}),Me==="skills"&&fe&&l.jsx(pbr,{skills:et,isLoading:oe,isSkillsConfigured:kt,hasUndiscoveredAgentSkills:m,basePath:C?`/workspaces/${C}/skills`:"/workspaces",onAddSkill:J?()=>u(!0):void 0,onUpdateSkill:J?ce:void 0,onRemoveSkill:J?_e:void 0,updatingSkillName:p??void 0,removingSkillName:d??void 0,mountPaths:Se}),!ye&&!fe&&l.jsx("div",{className:"py-12 text-center text-neutral4",children:l.jsx("p",{children:"No workspace capabilities are configured."})})]})]})}),C&&J&&l.jsx(bbr,{open:c,onOpenChange:u,workspaceId:C,onInstall:Ce,isInstalling:K.isPending,installedSkillIds:et.filter(ze=>ze.skillsShSource).map(ze=>`${ze.skillsShSource.owner}/${ze.skillsShSource.repo}/${ze.name}`),installedSkillNames:et.filter(ze=>!ze.skillsShSource).map(ze=>ze.name),writableMounts:ue,installedSkillPaths:Object.fromEntries(et.filter(ze=>ze.path).map(ze=>[ze.name,ze.path]))})]})}function rkr({workspaceId:e,canSearchFiles:t,canSearchSkills:n,canBM25:r,canVector:a,showInitWarning:s,onViewFileResult:i,onViewSkillResult:o}){const c=Rdr(),u=$dr();return l.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[t&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[l.jsx(ek,{className:"h-4 w-4"}),"Search Indexed Files"]}),s&&l.jsxs("p",{className:"text-xs text-amber-400 mb-3",children:["File search requires ",l.jsx("code",{className:"text-amber-300",children:"workspace.init()"})," to index files from your configured ",l.jsx("code",{className:"text-amber-300",children:"autoIndexPaths"}),"."]}),l.jsx(sbr,{onSearch:d=>c.mutate({...d,workspaceId:e}),isSearching:c.isPending,searchResults:c.data?{...c.data,results:c.data.results.filter(d=>!d.id.startsWith("skill:"))}:void 0,canBM25:r,canVector:a,onViewResult:i})]}),n&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[l.jsx(F$,{className:"h-4 w-4"}),"Search Skills"]}),l.jsx(obr,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>o(d.skillName,d.skillPath)})]})]})}function akr(e,t){return e==null||t==null?null:e in t?e:null}function skr(){const{skillName:e,workspaceId:t}=ms(),[n]=_o(),r=ts(),a=e?decodeURIComponent(e):"",s=n.get("path"),i=s?decodeURIComponent(s):void 0,o=n.get("agentId"),c=o?decodeURIComponent(o):null,d=r.getQueriesData({queryKey:["agents"]})?.[0]?.[1]??null,f=akr(c,d),p=f?`/agents/${f}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[h,m]=x.useState(null),{data:g,isLoading:v,error:b}=Mdr(a,{workspaceId:t,path:i}),{data:S}=rwt(g?.path?`${g.path}/SKILL.md`:"",{enabled:!!g?.path,workspaceId:t}),{data:O,isLoading:k}=Ddr(a,h??"",{enabled:!!h,workspaceId:t,path:i}),E=C=>f?l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:p,children:[l.jsx(ke,{children:l.jsx(wD,{className:"h-4 w-4"})}),f]}),l.jsxs(En,{as:"span",to:"",isCurrent:!0,children:[l.jsx(ke,{children:l.jsx(F$,{className:"h-4 w-4"})}),C]})]}):l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:p,children:[l.jsx(ke,{children:l.jsx(vp,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(En,{as:Lt,to:p,children:[l.jsx(ke,{children:l.jsx(F$,{className:"h-4 w-4"})}),"Skills"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:C})]});return v?l.jsxs(Nn,{children:[l.jsx(Un,{children:E("Loading...")}),l.jsx("div",{className:"grid place-items-center h-full",children:l.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):b&&xa(b)?l.jsxs(Nn,{children:[l.jsx(Un,{children:E("Permission Denied")}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"workspaces"})})]}):b||!g?l.jsxs(Nn,{children:[l.jsx(Un,{children:E("Error")}),l.jsx("div",{className:"grid place-items-center h-full",children:l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),l.jsx("p",{className:"text-sm text-neutral3",children:b?.message??"Skill not found"})]})})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[E(g.name),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[l.jsx(ke,{children:l.jsx(qi,{})}),"Documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:l.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:l.jsx(vbr,{skill:g,rawSkillMd:S?.content,onReferenceClick:m})})}),l.jsx(ybr,{open:!!h,onOpenChange:C=>!C&&m(null),skillName:g.name,referencePath:h??"",content:O?.content,isLoading:k})]})}function ikr({pathname:e}){const t=j1r();if(!t)return null;const{experiments:n,getVariant:r,setVariant:a}=t,s=e?n.filter(i=>!i.path||(Array.isArray(i.path)?i.path.includes(e):i.path===e)):n;return s.length===0?null:l.jsxs(ih,{children:[l.jsx(tp,{asChild:!0,children:l.jsxs(ge,{"aria-label":"Experimental UI",size:"sm",className:"mr-auto ml-3 bg-blue-600 text-white",children:[l.jsx(LQe,{})," UI"]})}),l.jsx(Fd,{side:"top",align:"start",className:"w-auto p-4",children:l.jsx("div",{className:"grid gap-4",children:s.map(i=>l.jsxs("div",{children:[l.jsx("span",{className:"text-ui-md text-neutral4",children:i.name}),l.jsx(G_,{value:r(i.key),onValueChange:o=>a(i.key,o),className:"mt-2",children:i.variants.map(o=>l.jsxs("label",{className:"flex items-center gap-3 text-ui-md text-neutral3 cursor-pointer",children:[l.jsx(gu,{value:o.value}),o.label]},o.value))})]},i.key))})})]})}const okr=[{key:"primitives",title:"Primitives",href:"/primitives",links:[{name:"Agents",url:"/agents",icon:l.jsx(hs,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",icon:l.jsx(ek,{}),isOnMastraPlatform:!0,indent:!0},{name:"Workflows",url:"/workflows",icon:l.jsx(bo,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",icon:l.jsx(DQe,{}),isOnMastraPlatform:!1,indent:!0,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",icon:l.jsx(Pc,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",icon:l.jsx(Xi,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"tools:read"},{name:"Workspaces",url:"/workspaces",icon:l.jsx(vp,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",icon:l.jsx(zle,{}),isOnMastraPlatform:!0,indent:!0}]},{key:"evaluation",title:"Evaluation",href:"/evaluation",links:[{name:"Scorers",url:"/evaluation?tab=scorers",icon:l.jsx(Q3t,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"scorers:read"},{name:"Datasets",url:"/evaluation?tab=datasets",icon:l.jsx(Sd,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]},{name:"Experiments",url:"/evaluation?tab=experiments",icon:l.jsx(q4t,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]}]},{key:"observability",title:"Observability",href:"/observability-overview",links:[{name:"Metrics",url:"/metrics",icon:l.jsx(Fle,{}),isOnMastraPlatform:!0,indent:!0},{name:"Traces",url:"/observability",icon:l.jsx(JO,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"}]},{key:"bottom",separator:!0,links:[{name:"Settings",url:"/settings",icon:l.jsx(oge,{}),isOnMastraPlatform:!1},{name:"Resources",url:"/resources",icon:l.jsx(Zl,{}),isOnMastraPlatform:!0}]}],lkr={scorers:"/evaluation/scorers",datasets:"/evaluation/datasets"};function a9e(e,t,n){if(e.url.includes("?")){const[r,a]=e.url.split("?"),s=new URLSearchParams(a).get("tab"),i=new URLSearchParams(n).get("tab");if(t===r&&s&&s===i)return!0;if(s){const o=lkr[s];if(o&&(t===o||t.startsWith(o+"/")))return!0}return!1}return t===e.url||t.startsWith(e.url+"/")}function ckr(){const{state:e}=Gwt(),t=Lc(),n=t.pathname,{isMastraPlatform:r}=nSt(),{data:a}=Z_(),{isCmsAvailable:s,isLoading:i}=kge(),{hasPermission:o,hasAnyPermission:c,rbacEnabled:u,isAuthenticated:d,isLoading:f}=Iv(),p=a&&PR(a),h=new Set(["/prompts"]),m=g=>h.has(g.url)&&!s&&!i||r&&!g.isOnMastraPlatform?!1:u&&d&&f?!0:!(g.requiredPermission&&!o(g.requiredPermission)||g.requiredAnyPermission&&!c(g.requiredAnyPermission));return l.jsxs(gg,{footerSlot:l.jsx(ikr,{pathname:n}),children:[l.jsx("div",{className:"pt-3 mb-4 -ml-0.5 sticky top-0 bg-surface1 z-10",children:e==="collapsed"?l.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[l.jsx(lb,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),p&&l.jsx(Use,{})]}):p?l.jsxs("span",{className:"flex items-center justify-between pl-3 pr-2",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(lb,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),l.jsx(Use,{})]}):l.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[l.jsx(lb,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),l.jsx(gg.Nav,{children:okr.map(g=>{const v=g.links.filter(m),b=v.length>0&&g?.separator,S=v.some(k=>a9e(k,n,t.search)),O=!!(g.href&&n===g.href&&!S);return l.jsxs(gg.NavSection,{children:[g?.title?l.jsx(gg.NavHeader,{state:e,href:g.href,isActive:O,children:g.title}):l.jsx(l.Fragment,{children:b&&l.jsx(gg.NavSeparator,{})}),l.jsx(gg.NavList,{children:v.map(k=>{const E=a9e(k,n,t.search);return l.jsx(gg.NavLink,{state:e,link:k,isActive:E},k.name)})})]},g.key)})}),l.jsx(gg.Bottom,{children:e!=="collapsed"&&l.jsxs(l.Fragment,{children:[l.jsx(gg.NavSeparator,{}),l.jsx(Mlr,{collapsed:!1})]})})]})}const ukr=x.createContext({theme:"dark",setTheme:()=>null}),dkr=e=>e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";function J1t({children:e,defaultTheme:t="dark"}){const{themeToggleEnabled:n}=r9(),r=Vr(o=>o.theme),a=Vr(o=>o.setTheme),i=n?r==="light"||r==="system"?r:"dark":t;return x.useEffect(()=>{const o=window.document.documentElement,c=f=>{const p=dkr(f);o.classList.remove("light","dark"),o.classList.add(p)};if(c(i),i!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>c("system");return u.addEventListener("change",d),()=>{u.removeEventListener("change",d)}},[i]),l.jsx(ukr.Provider,{value:{theme:i,setTheme:a},children:e})}const fkr=[{key:"entity-list-page",name:"Entity List page UI",path:["/agents","/prompts","/tools","/datasets","/scorers","/mcps","/workflows","/processors"],variants:[{value:"current",label:"Current state"},{value:"new-proposal",label:"New proposal"}]}],pkr=()=>({experimentalUIEnabled:typeof window<"u"&&window.MASTRA_EXPERIMENTAL_UI==="true"});function hkr({children:e}){const{data:t,isFetched:n}=Z_(),r=n&&t?.enabled&&!PR(t),a=n&&!r;return l.jsxs(l.Fragment,{children:[l.jsx(Cbr,{}),l.jsxs("div",{className:a?"grid h-full grid-cols-[auto_1fr]":"h-full",children:[a&&l.jsx(ckr,{}),l.jsx("div",{className:Y("bg-transparent overflow-y-auto",{"h-[calc(100%-1.5rem)]":r}),children:l.jsx(iSt,{children:e})})]})]})}const mkr=({children:e})=>{const{experimentalUIEnabled:t}=pkr();return l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(wst,{position:"bottom-right"}),l.jsx(J1t,{defaultTheme:"dark",attribute:"class",children:l.jsx(Uo,{delayDuration:0,children:l.jsx(N1r,{experiments:t?fkr:[],children:l.jsx(Tyr,{children:l.jsx(hkr,{children:e})})})})})]})},gkr=({children:e})=>l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(wst,{position:"bottom-right"}),l.jsx(J1t,{defaultTheme:"dark",attribute:"class",children:l.jsx(Uo,{delayDuration:0,children:l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsx(iSt,{children:e})})})})]});function vkr({agentId:e}){return l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/agents",children:[l.jsx(ke,{children:l.jsx(hs,{})}),"Agents"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:l.jsx(pcr,{value:e,variant:"ghost"})})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Agents documentation"]})})]})}const ykr=({children:e})=>{const{agentId:t}=ms(),n=Lc(),{isCmsAvailable:r}=kge(),{hasObservability:a}=Flr(),s=xie.has("datasets"),i=r&&s,o=a&&s,{data:c}=Hd(t),u=_c(c?.provider??""),d=c?.modelId??"",f=c?.requestContextSchema,p=n.pathname.includes("/playground")?"versions":n.pathname.includes("/evaluate")?"evaluate":n.pathname.includes("/review")?"review":n.pathname.includes("/traces")?"traces":"chat",h=(p==="versions"||p==="evaluate"||p==="review")&&(i||o),m=l.jsxs(Nn,{className:"grid-rows-[auto_auto_1fr]",children:[l.jsx(vkr,{agentId:t}),l.jsx(Spr,{agentId:t,activeTab:p,showPlayground:i,showObservability:o,rightSlot:h?l.jsx(Opr,{requestContextSchema:f}):void 0}),e]});return!i&&!o?m:l.jsx(Gz,{children:l.jsx(Zir,{defaultProvider:u,defaultModel:d,children:l.jsx(dpr,{children:l.jsx(Yir,{children:m})})})})};function bkr(){const{data:e={},isLoading:t,error:n}=Lge(),{variant:r}=rE("entity-list-page"),[a,s]=x.useState(""),i=!t&&Object.keys(e).length===0;return r==="new-proposal"?l.jsxs(us,{children:[l.jsxs(us.Top,{children:[l.jsxs(pt,{withMargins:!1,children:[l.jsx(pt.Column,{children:l.jsxs(pt.Title,{isLoading:t,children:[l.jsx(ob,{})," Processors"]})}),l.jsx(pt.Column,{className:"flex justify-end gap-2",children:l.jsx(Gi,{as:"a",href:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Processors documentation",children:l.jsx(Zl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(vS,{onSearch:s,label:"Filter processors",placeholder:"Filter by name"})})]}),l.jsx(Zpr,{processors:e,isLoading:t,error:n,search:a,onSearch:s})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(ob,{})}),"Processors"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Processors documentation"]})})]}),l.jsx(Ki,{isCentered:i,children:l.jsx(qpr,{processors:e,isLoading:t,error:n})})]})}function xkr(){const{processorId:e}=ms(),{data:t,isLoading:n,error:r}=_wt(e);return r&&xa(r)?l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/processors",children:[l.jsx(ke,{children:l.jsx(ob,{})}),"Processors"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:e})]})}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ba,{resource:"processors"})})]}):!n&&t?.isWorkflow?l.jsx(g0r,{to:`/workflows/${e}/graph`,replace:!0}):n?l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsx(Un,{children:l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/processors",children:[l.jsx(ke,{children:l.jsx(ob,{})}),"Processors"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:l.jsx(Fn,{className:"h-6 w-32"})})]})}),l.jsxs("div",{className:"p-6",children:[l.jsx(Fn,{className:"h-8 w-48 mb-4"}),l.jsx(Fn,{className:"h-32 w-full"})]})]}):l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs(Un,{children:[l.jsxs(Xs,{children:[l.jsxs(En,{as:Lt,to:"/processors",children:[l.jsx(ke,{children:l.jsx(ob,{})}),"Processors"]}),l.jsx(En,{as:"span",to:"",isCurrent:!0,children:l.jsx(thr,{value:e,variant:"ghost"})})]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Processors documentation"]})})]}),l.jsx(Kpr,{processorId:e})]})}function wkr(){const{data:e={},isLoading:t}=ch(),{data:n={},isLoading:r,error:a}=u9(),{variant:s}=rE("entity-list-page"),[i,o]=x.useState(""),c=t||r,u=Object.keys(n).length>0,d=Object.values(e).some(p=>p.tools&&Object.keys(p.tools).length>0),f=!c&&!u&&!d;return s==="new-proposal"?l.jsxs(us,{children:[l.jsxs(us.Top,{children:[l.jsxs(pt,{withMargins:!1,children:[l.jsx(pt.Column,{children:l.jsxs(pt.Title,{isLoading:c,children:[l.jsx(Xi,{})," Tools"]})}),l.jsx(pt.Column,{className:"flex justify-end gap-2",children:l.jsx(Gi,{as:"a",href:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Tools documentation",children:l.jsx(Zl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(vS,{onSearch:o,label:"Filter tools",placeholder:"Filter by name"})})]}),l.jsx(lhr,{tools:n,agents:e,isLoading:c,error:a,search:i,onSearch:o})]}):l.jsxs(Nn,{children:[l.jsxs(Un,{children:[l.jsxs(ws,{children:[l.jsx(ke,{children:l.jsx(Xi,{})}),"Tools"]}),l.jsx(Ss,{children:l.jsxs(ge,{as:Lt,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(qi,{}),"Tools documentation"]})})]}),l.jsx(Ki,{isCentered:f,children:l.jsx(ahr,{tools:n,agents:e,isLoading:c,error:a})})]})}const eOt={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,n,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(t)}?agentId=${encodeURIComponent(e)}${n?`&path=${encodeURIComponent(n)}`:""}`:"/workspaces",agentsLink:()=>"/agents",agentNewThreadLink:e=>`/agents/${e}/chat/new`,agentThreadLink:(e,t,n)=>n?`/agents/${e}/chat/${t}?messageId=${n}`:`/agents/${e}/chat/${t}`,workflowsLink:()=>"/workflows",workflowLink:e=>`/workflows/${e}`,networkLink:e=>`/networks/v-next/${e}/chat`,networkNewThreadLink:e=>`/networks/v-next/${e}/chat/${Hi()}`,networkThreadLink:(e,t)=>`/networks/v-next/${e}/chat/${t}`,scorerLink:e=>`/evaluation/scorers/${e}`,cmsScorersCreateLink:()=>"/cms/scorers/create",cmsScorerEditLink:e=>`/cms/scorers/${e}/edit`,cmsAgentCreateLink:()=>"/cms/agents/create",cmsAgentEditLink:e=>`/cms/agents/${e}/edit`,promptBlockLink:e=>`/prompts/${e}`,promptBlocksLink:()=>"/prompts",cmsPromptBlockCreateLink:()=>"/cms/prompts/create",cmsPromptBlockEditLink:e=>`/cms/prompts/${e}/edit`,toolLink:e=>`/tools/${e}`,skillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/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=>`/evaluation/datasets/${e}`,datasetItemLink:(e,t)=>`/evaluation/datasets/${e}/items/${t}`,datasetExperimentLink:(e,t)=>`/evaluation/datasets/${e}/experiments/${t}`},Skr=()=>{const e=Fc(),t=n=>e(n,{viewTransition:!0});return l.jsx(xbt,{Link:G1t,navigate:t,paths:eOt,children:l.jsx(mkr,{children:l.jsx(Gk,{})})})},Okr=()=>{const e=Fc(),t=n=>e(n,{viewTransition:!0});return l.jsx(xbt,{Link:G1t,navigate:t,paths:eOt,children:l.jsx(gkr,{children:l.jsx(Gk,{})})})},kkr=!!window.MASTRA_CLOUD_API_ENDPOINT,s9e=xie.has("datasets"),i9e=[{index:!0,element:l.jsx(B1r,{})},{path:"instruction-blocks",element:l.jsx(U1r,{})},{path:"tools",element:l.jsx(Q1r,{})},{path:"agents",element:l.jsx(L1r,{})},{path:"scorers",element:l.jsx(q1r,{})},{path:"workflows",element:l.jsx(G1r,{})},{path:"skills",element:l.jsx(H1r,{})},{path:"memory",element:l.jsx(V1r,{})},{path:"variables",element:l.jsx(W1r,{})}],_kr=[{path:"/login",element:l.jsx(hOr,{})},{path:"/signup",element:l.jsx(LOr,{})},{element:l.jsx(Okr,{}),children:[{path:"/agents/:agentId/session",element:l.jsx(Gze,{})},{path:"/agents/:agentId/session/:threadId",element:l.jsx(Gze,{})}]},{element:l.jsx(Skr,{}),children:[...kkr?[]:[{path:"/settings",element:l.jsx($Or,{})},{path:"/templates",element:l.jsx(XOr,{})},{path:"/templates/:templateSlug",element:l.jsx(JOr,{})}],{path:"/primitives",element:l.jsx(TOr,{})},{path:"/evaluation",element:l.jsx(pOr,{})},{path:"/evaluation/scorers/:scorerId",element:l.jsx(POr,{})},{path:"/metrics",element:l.jsx(yOr,{})},{path:"/observability-overview",element:l.jsx(COr,{})},{path:"/observability",element:l.jsx(_Or,{})},{path:"/resources",element:l.jsx(ROr,{})},{path:"/agents",element:l.jsx(A1r,{})},{path:"/cms/agents/create",element:l.jsx(F1r,{}),children:i9e},{path:"/cms/agents/:agentId/edit",element:l.jsx(z1r,{}),children:i9e},{path:"/cms/scorers/create",element:l.jsx(K1r,{})},{path:"/cms/scorers/:scorerId/edit",element:l.jsx(eOr,{})},{path:"/prompts",element:l.jsx(NOr,{})},{path:"/cms/prompts/create",element:l.jsx(Z1r,{})},{path:"/cms/prompts/:promptBlockId/edit",element:l.jsx(X1r,{})},{path:"/agents/:agentId/tools/:toolId",element:l.jsx(ekr,{})},{path:"/agents/:agentId",element:l.jsx(ykr,{children:l.jsx(Gk,{})}),children:[{index:!0,loader:({params:e})=>JJ(`/agents/${e.agentId}/chat`)},{path:"chat",element:l.jsx(Wze,{})},{path:"chat/:threadId",element:l.jsx(Wze,{})},...s9e?[{path:"playground",element:l.jsx(M1r,{})},{path:"evaluate",element:l.jsx(P1r,{})},{path:"review",element:l.jsx(D1r,{})}]:[],{path:"traces",element:l.jsx($1r,{})}]},{path:"/tools",element:l.jsx(wkr,{})},{path:"/tools/:toolId",element:l.jsx(tkr,{})},{path:"/processors",element:l.jsx(bkr,{})},{path:"/processors/:processorId",element:l.jsx(xkr,{})},{path:"/mcps",element:l.jsx(mOr,{})},{path:"/mcps/:serverId",element:l.jsx(gOr,{})},{path:"/mcps/:serverId/tools/:toolId",element:l.jsx(vOr,{})},{path:"/workspaces",element:l.jsx(r9e,{})},{path:"/workspaces/:workspaceId",element:l.jsx(r9e,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:l.jsx(skr,{})},{path:"/workflows",element:l.jsx(nkr,{})},{path:"/workflows/:workflowId",element:l.jsx(twr,{children:l.jsx(Gk,{})}),children:[{index:!0,loader:({params:e})=>JJ(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:l.jsx(n9e,{})},{path:"graph/:runId",element:l.jsx(n9e,{})}]},...s9e?[{path:"/evaluation/datasets/:datasetId",element:l.jsx(nOr,{})},{path:"/evaluation/datasets/:datasetId/items/:itemId",element:l.jsx(sOr,{})},{path:"/evaluation/datasets/:datasetId/items/:itemId/versions",element:l.jsx(lOr,{})},{path:"/evaluation/datasets/:datasetId/experiments/:experimentId",element:l.jsx(rOr,{})},{path:"/evaluation/datasets/:datasetId/experiments",element:l.jsx(aOr,{})},{path:"/evaluation/datasets/:datasetId/items",element:l.jsx(iOr,{})},{path:"/evaluation/datasets/:datasetId/versions",element:l.jsx(uOr,{})}]:[],{index:!0,loader:()=>JJ("/agents")},{path:"/request-context",element:l.jsx(AOr,{})}]}];function Ekr(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:n,apiPrefix:r,isLoading:a}=r9();if(a)return null;if(!t)return l.jsx(Llr,{});const s=U0r(_kr,{basename:e});return l.jsx(jFt,{baseUrl:t,headers:n,apiPrefix:r,children:l.jsx(E1r,{children:l.jsx(p0r,{router:s})})})}function Ckr(){const e=window.MASTRA_SERVER_PROTOCOL||"http",t=window.MASTRA_SERVER_HOST||"localhost",n=window.MASTRA_SERVER_PORT||4111,r=window.MASTRA_API_PREFIX||"/api",a=window.MASTRA_CLOUD_API_ENDPOINT||"",s=window.MASTRA_AUTO_DETECT_URL==="true",i=window.MASTRA_THEME_TOGGLE==="true",o=a||(s?window.location.origin:`${e}://${t}:${n}`);return l.jsx(Ryr,{children:l.jsx(Tlr,{endpoint:o,defaultApiPrefix:r,themeToggleEnabled:i,children:l.jsx(Ekr,{})})})}d_t.createRoot(document.getElementById("root")).render(l.jsx(x.StrictMode,{children:l.jsx(Ckr,{})}));const $_r=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{Jet as A,Hrt as B,ttt as C,qnt as D,Dd as E,Rf as F,Tkr as G,v_t as H,Za as I,$_r as J,tw as L,Ket as N,VL as _,P6t as a,Y6t as b,c_r as c,HSe as d,rw as e,Q6t as f,yO as g,Z6t as h,Yw as i,Xw as j,Zw as k,Oan as l,Xnt as m,X0 as n,ps as o,Lrn as p,$rn as q,tde as r,tce as s,he as t,g3 as u,Yc as v,F6t as w,vt as x,tt as y,hat as z};