@neuralnomads/codenomad-dev 0.14.0-dev-20260417-9bf4d351 → 0.14.0-dev-20260418-e022a158
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/assets/{ChangesTab-DEgBUjVz.js → ChangesTab-DUZlwLiK.js} +2 -2
- package/public/assets/{DiffToolbar-C0C8bWki.js → DiffToolbar-C32dRoEE.js} +1 -1
- package/public/assets/{FilesTab-B9WaUTzy.js → FilesTab-BHR_yoxs.js} +2 -2
- package/public/assets/{GitChangesTab-C2Asw384.js → GitChangesTab-glvFfIqf.js} +2 -2
- package/public/assets/{SplitFilePanel-VxErPoCs.js → SplitFilePanel-c1Cyzd2Q.js} +1 -1
- package/public/assets/{StatusTab-DTCwmZhf.js → StatusTab-D_y6grlM.js} +1 -1
- package/public/assets/{bundle-full-CZ8BwlPh.js → bundle-full-xErn6pK2.js} +1 -1
- package/public/assets/{diff-viewer-Djp9avVa.js → diff-viewer-Ti4vD-Wf.js} +1 -1
- package/public/assets/index-Buu9pQM-.js +1 -0
- package/public/assets/index-D5K3x-5q.js +1 -0
- package/public/assets/index-DAUGrHIr.js +1 -0
- package/public/assets/index-DCKsvmLK.js +1 -0
- package/public/assets/{index-gOb9MvU2.js → index-DNjsUvJP.js} +1 -1
- package/public/assets/index-KGa2MZ03.js +1 -0
- package/public/assets/index-MN-xsoRk.js +2 -0
- package/public/assets/{index-CS8igigR.js → index-RbYx88R2.js} +1 -1
- package/public/assets/index-Vi334d28.js +1 -0
- package/public/assets/index-s309YxXV.css +1 -0
- package/public/assets/{loading-Cr_BWqKy.js → loading-8z6r7QGU.js} +1 -1
- package/public/assets/main-BL6QgWzz.js +48 -0
- package/public/assets/{markdown-c_rVsd2S.js → markdown-CN__9g8I.js} +3 -3
- package/public/assets/monaco-viewer-C8arwHE9.js +26 -0
- package/public/assets/{todo-DXEegYgH.js → todo-CGjayFGz.js} +1 -1
- package/public/assets/{tool-call-CTg71hze.js → tool-call-Wyw279OP.js} +3 -3
- package/public/assets/{unified-picker-BgW5kaQo.js → unified-picker-DqT__5EQ.js} +1 -1
- package/public/assets/{wrap-text-DKmMMyWB.js → wrap-text-DJEP0aF1.js} +1 -1
- package/public/index.html +4 -4
- package/public/loading.html +4 -4
- package/public/sw.js +1 -1
- package/public/assets/index-Br2gh9Q_.js +0 -1
- package/public/assets/index-CCdacqcD.js +0 -1
- package/public/assets/index-CMpU59Nd.js +0 -1
- package/public/assets/index-CP2CRaiZ.js +0 -2
- package/public/assets/index-Cf8hOS2M.js +0 -1
- package/public/assets/index-CiwaMGVS.js +0 -1
- package/public/assets/index-D6aXme8N.css +0 -1
- package/public/assets/index-Dwg_Dz3e.js +0 -1
- package/public/assets/main-CBLtYtDo.js +0 -48
- package/public/assets/monaco-viewer-DrmF2KUz.js +0 -25
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var Xr=Object.defineProperty;var Yr=(e,t,n)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xe=(e,t,n)=>Yr(e,typeof t!="symbol"?t+"":t,n);import{c as F,u as je,a as se,s as mt,b as Y,r as Zr,d as E,e as Bn,o as ie,g as ln,f as L,$ as B,h as xe,i as at,j as Ve,k as Me,l as Ke,m as Un,n as ae,p as Qr,q as eo,t as yt,v as to,S as no}from"./git-diff-vendor-CSgooKT_.js";import{g as ro}from"./fast-diff-vendor-DgdwVvTQ.js";const oo=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],so=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...oo]),io=new Set(["innerHTML","textContent","innerText","children"]),ao=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),co=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function lo(e,t){const n=co[e];return typeof n=="object"?n[t]?n.$:void 0:n}const uo=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),_n=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),fo={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},go=e=>F(()=>e());function ho(e,t,n){let r=n.length,o=t.length,s=r,i=0,a=0,c=t[o-1].nextSibling,u=null;for(;i<o||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;t[o-1]===n[s-1];)o--,s--;if(o===i){const l=s<r?a?n[a-1].nextSibling:n[s-a]:c;for(;a<s;)e.insertBefore(n[a++],l)}else if(s===a)for(;i<o;)(!u||!u.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[s-1]&&n[a]===t[o-1]){const l=t[--o].nextSibling;e.insertBefore(n[a++],t[i++].nextSibling),e.insertBefore(n[--s],l),t[o]=n[s]}else{if(!u){u=new Map;let d=a;for(;d<s;)u.set(n[d],d++)}const l=u.get(t[i]);if(l!=null)if(a<l&&l<s){let d=i,g=1,m;for(;++d<o&&d<s&&!((m=u.get(t[d]))==null||m!==l+g);)g++;if(g>l-a){const p=t[i];for(;a<l;)e.insertBefore(n[a++],p)}else e.replaceChild(n[a++],t[i++])}else i++;else t[i++].remove()}}}const un="_$DX_DELEGATE";function $c(e,t,n,r={}){let o;return Bn(s=>{o=s,t===document?e():ct(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function qt(e,t,n,r){let o;const s=()=>{const a=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:r?a.firstChild:a.content.firstChild},i=t?()=>je(()=>document.importNode(o||(o=s()),!0)):()=>(o||(o=s())).cloneNode(!0);return i.cloneNode=i,i}function jn(e,t=window.document){const n=t[un]||(t[un]=new Set);for(let r=0,o=e.length;r<o;r++){const s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,Oo))}}function We(e,t,n){he(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function po(e,t,n,r){he(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function mo(e,t,n){he(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function yo(e,t){he(e)||(t==null?e.removeAttribute("class"):e.className=t)}function bo(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=s=>o.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function wo(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let s,i;for(s=0,i=o.length;s<i;s++){const a=o[s];!a||a==="undefined"||t[a]||(fn(e,a,!1),delete n[a])}for(s=0,i=r.length;s<i;s++){const a=r[s],c=!!t[a];!a||a==="undefined"||n[a]===c||!c||(fn(e,a,!0),n[a]=c)}return n}function Co(e,t,n){if(!t)return n?We(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,s;for(s in n)t[s]==null&&r.removeProperty(s),delete n[s];for(s in t)o=t[s],o!==n[s]&&(r.setProperty(s,o),n[s]=o);return n}function dn(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t)}function Vn(e,t={},n,r){const o={};return r||se(()=>o.children=ze(e,t.children,o.children)),se(()=>typeof t.ref=="function"&&Xt(t.ref,e)),se(()=>So(e,t,n,!0,o,!0)),o}function Xt(e,t,n){return je(()=>e(t,n))}function ct(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return ze(e,t,r,n);se(o=>ze(e,t(),o,n),r)}function So(e,t,n,r,o={},s=!1){t||(t={});for(const i in o)if(!(i in t)){if(i==="children")continue;o[i]=gn(e,i,null,o[i],n,s,t)}for(const i in t){if(i==="children")continue;const a=t[i];o[i]=gn(e,i,a,o[i],n,s,t)}}function Wn(e){let t,n;return!he()||!(t=L.registry.get(n=vo()))?e():(L.completed&&L.completed.add(t),L.registry.delete(n),t)}function he(e){return!!L.context&&!L.done&&(!e||e.isConnected)}function xo(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function fn(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,s=r.length;o<s;o++)e.classList.toggle(r[o],n)}function gn(e,t,n,r,o,s,i){let a,c,u,l,d;if(t==="style")return Co(e,n,r);if(t==="classList")return wo(e,n,r);if(n===r)return r;if(t==="ref")s||n(e);else if(t.slice(0,3)==="on:"){const g=t.slice(3);r&&e.removeEventListener(g,r,typeof r!="function"&&r),n&&e.addEventListener(g,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const g=t.slice(10);r&&e.removeEventListener(g,r,!0),n&&e.addEventListener(g,n,!0)}else if(t.slice(0,2)==="on"){const g=t.slice(2).toLowerCase(),m=uo.has(g);if(!m&&r){const p=Array.isArray(r)?r[0]:r;e.removeEventListener(g,p)}(m||n)&&(bo(e,g,n,m),m&&jn([g]))}else if(t.slice(0,5)==="attr:")We(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")mo(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(u=io.has(t))||!o&&((l=lo(t,e.tagName))||(c=so.has(t)))||(a=e.nodeName.includes("-")||"is"in i)){if(d)t=t.slice(5),c=!0;else if(he(e))return n;t==="class"||t==="className"?yo(e,n):a&&!c&&!u?e[xo(t)]=n:e[l||t]=n}else{const g=o&&t.indexOf(":")>-1&&fo[t.split(":")[0]];g?po(e,g,t,n):We(e,ao[t]||t,n)}return n}function Oo(e){if(L.registry&&L.events&&L.events.find(([c,u])=>u===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,s=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),i=()=>{const c=t[n];if(c&&!t.disabled){const u=t[`${n}Data`];if(u!==void 0?c.call(t,u,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},a=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),L.registry&&!L.done&&(L.done=_$HY.done=!0),e.composedPath){const c=e.composedPath();s(c[0]);for(let u=0;u<c.length-2&&(t=c[u],!!i());u++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();s(r)}function ze(e,t,n,r,o){const s=he(e);if(s){!n&&(n=[...e.childNodes]);let c=[];for(let u=0;u<n.length;u++){const l=n[u];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():c.push(l)}n=c}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(s||i==="number"&&(t=t.toString(),t===n))return n;if(a){let c=n[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),n=be(e,n,r,c)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(s)return n;n=be(e,n,r)}else{if(i==="function")return se(()=>{let c=t();for(;typeof c=="function";)c=c();n=ze(e,c,n,r)}),()=>n;if(Array.isArray(t)){const c=[],u=n&&Array.isArray(n);if(Dt(c,t,n,o))return se(()=>n=ze(e,c,n,r,!0)),()=>n;if(s){if(!c.length)return n;if(r===void 0)return n=[...e.childNodes];let l=c[0];if(l.parentNode!==e)return n;const d=[l];for(;(l=l.nextSibling)!==r;)d.push(l);return n=d}if(c.length===0){if(n=be(e,n,r),a)return n}else u?n.length===0?hn(e,c,r):ho(e,n,c):(n&&be(e),hn(e,c));n=c}else if(t.nodeType){if(s&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=be(e,n,r,t);be(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Dt(e,t,n,r){let o=!1;for(let s=0,i=t.length;s<i;s++){let a=t[s],c=n&&n[e.length],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Dt(e,a,c)||o;else if(u==="function")if(r){for(;typeof a=="function";)a=a();o=Dt(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||o}else e.push(a),o=!0;else{const l=String(a);c&&c.nodeType===3&&c.data===l?e.push(c):e.push(document.createTextNode(l))}}return o}function hn(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function be(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let s=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const c=a.parentNode===e;!s&&!i?c?e.replaceChild(o,a):e.insertBefore(o,n):c&&a.remove()}else s=!0}}else e.insertBefore(o,n);return[o]}function vo(){return L.getNextContextId()}const ko="http://www.w3.org/2000/svg";function zn(e,t=!1,n=void 0){return t?document.createElementNS(ko,e):document.createElement(e,{is:n})}function Ac(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=ln();let s,i=!!L.context;return Y(()=>{i&&(ln().user=i=!1),s||(s=Zr(o,()=>F(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[c,u]=E(!1),l=()=>u(!0);Bn(d=>ct(a,()=>c()?d():s(),null)),ie(l)}else{const c=zn(e.isSVG?"g":"div",e.isSVG),u=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return n.parentNode},configurable:!0}),ct(u,s),a.appendChild(c),e.ref&&e.ref(c),ie(()=>a.removeChild(c))}},void 0,{render:!i}),n}function $o(e,t){const n=F(e);return F(()=>{const r=n();switch(typeof r){case"function":return je(()=>r(t));case"string":const o=_n.has(r),s=L.context?Wn():zn(r,o,je(()=>t.is));return Vn(s,t,o),s}})}function Ic(e){const[,t]=mt(e,["component"]);return $o(()=>e.component,t)}const Ie=Symbol("store-raw"),Q=Symbol("store-node"),W=Symbol("store-has"),Kn=Symbol("store-self");function Hn(e){let t=e[B];if(!t&&(Object.defineProperty(e,B,{value:t=new Proxy(e,Io)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,s=n.length;o<s;o++){const i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function J(e){let t;return e!=null&&typeof e=="object"&&(e[B]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function te(e,t=new Set){let n,r,o,s;if(n=e!=null&&e[Ie])return n;if(!J(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let i=0,a=e.length;i<a;i++)o=e[i],(r=te(o,t))!==o&&(e[i]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const i=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let c=0,u=i.length;c<u;c++)s=i[c],!a[s].get&&(o=e[s],(r=te(o,t))!==o&&(e[s]=r))}return e}function Te(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function de(e,t,n){if(e[t])return e[t];const[r,o]=E(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Ao(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===B||t===Q||(delete n.value,delete n.writable,n.get=()=>e[B][t]),n}function Yt(e){Ve()&&de(Te(e,Q),Kn)()}function Gn(e){return Yt(e),Reflect.ownKeys(e)}const Io={get(e,t,n){if(t===Ie)return e;if(t===B)return n;if(t===at)return Yt(e),n;const r=Te(e,Q),o=r[t];let s=o?o():e[t];if(t===Q||t===W||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t);Ve()&&(typeof s!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(s=de(r,t,s)())}return J(s)?Hn(s):s},has(e,t){return t===Ie||t===B||t===at||t===Q||t===W||t==="__proto__"?!0:(Ve()&&de(Te(e,W),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Gn,getOwnPropertyDescriptor:Ao};function D(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],s=e.length;n===void 0?(delete e[t],e[W]&&e[W][t]&&o!==void 0&&e[W][t].$()):(e[t]=n,e[W]&&e[W][t]&&o===void 0&&e[W][t].$());let i=Te(e,Q),a;if((a=de(i,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==s){for(let c=e.length;c<s;c++)(a=i[c])&&a.$();(a=de(i,"length",s))&&a.$(e.length)}(a=i[Kn])&&a.$()}function Jn(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];D(e,o,t[o])}}function To(e,t){if(typeof t=="function"&&(t=t(e)),t=te(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&D(e,n,o)}D(e,"length",r)}else Jn(e,t)}function Re(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let c=0;c<r.length;c++)Re(e,[r[c]].concat(t),n);return}else if(a&&i==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&Re(e,[c].concat(t),n);return}else if(a&&i==="object"){const{from:c=0,to:u=e.length-1,by:l=1}=r;for(let d=c;d<=u;d+=l)Re(e,[d].concat(t),n);return}else if(t.length>1){Re(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let s=t[0];typeof s=="function"&&(s=s(o,n),s===o)||r===void 0&&s==null||(s=te(s),r===void 0||J(o)&&J(s)&&!Array.isArray(s)?Jn(o,s):D(e,r,s))}function Tc(...[e,t]){const n=te(e||{}),r=Array.isArray(n),o=Hn(n);function s(...i){xe(()=>{r&&i.length===1?To(n,i[0]):Re(n,i)})}return[o,s]}function Eo(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||n.set||!n.configurable||t===B||t===Q||(delete n.value,delete n.writable,n.get=()=>e[B][t],n.set=r=>e[B][t]=r),n}const Po={get(e,t,n){if(t===Ie)return e;if(t===B)return n;if(t===at)return Yt(e),n;const r=Te(e,Q),o=r[t];let s=o?o():e[t];if(t===Q||t===W||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t),a=typeof s=="function";if(Ve()&&(!a||e.hasOwnProperty(t))&&!(i&&i.get))s=de(r,t,s)();else if(s!=null&&a&&s===Array.prototype[t])return(...c)=>xe(()=>Array.prototype[t].apply(n,c))}return J(s)?qn(s):s},has(e,t){return t===Ie||t===B||t===at||t===Q||t===W||t==="__proto__"?!0:(Ve()&&de(Te(e,W),t)(),t in e)},set(e,t,n){return xe(()=>D(e,t,te(n))),!0},deleteProperty(e,t){return xe(()=>D(e,t,void 0,!0)),!0},ownKeys:Gn,getOwnPropertyDescriptor:Eo};function qn(e){let t=e[B];if(!t){Object.defineProperty(e,B,{value:t=new Proxy(e,Po)});const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),o=Object.getPrototypeOf(e),s=o!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&o!==Object.prototype;if(s){let i=o;for(;i!=null;){const a=Object.getOwnPropertyDescriptors(i);n.push(...Object.keys(a)),Object.assign(r,a),i=Object.getPrototypeOf(i)}}for(let i=0,a=n.length;i<a;i++){const c=n[i];if(!(s&&c==="constructor")){if(r[c].get){const u=r[c].get.bind(t);Object.defineProperty(e,c,{get:u,configurable:!0})}if(r[c].set){const u=r[c].set;Object.defineProperty(e,c,{set:d=>xe(()=>u.call(t,d)),configurable:!0})}}}}return t}function Mo(e,t){const n=te(e||{});return qn(n)}const Rt=Symbol("store-root");function Ce(e,t,n,r,o){const s=t[n];if(e===s)return;const i=Array.isArray(e);if(n!==Rt&&(!J(e)||!J(s)||i!==Array.isArray(s)||o&&e[o]!==s[o])){D(t,n,e);return}if(i){if(e.length&&s.length&&(!r||o&&e[0]&&e[0][o]!=null)){let u,l,d,g,m,p,S,w;for(d=0,g=Math.min(s.length,e.length);d<g&&(s[d]===e[d]||o&&s[d]&&e[d]&&s[d][o]&&s[d][o]===e[d][o]);d++)Ce(e[d],s,d,r,o);const P=new Array(e.length),R=new Map;for(g=s.length-1,m=e.length-1;g>=d&&m>=d&&(s[g]===e[m]||o&&s[g]&&e[m]&&s[g][o]&&s[g][o]===e[m][o]);g--,m--)P[m]=s[g];if(d>m||d>g){for(l=d;l<=m;l++)D(s,l,e[l]);for(;l<e.length;l++)D(s,l,P[l]),Ce(e[l],s,l,r,o);s.length>e.length&&D(s,"length",e.length);return}for(S=new Array(m+1),l=m;l>=d;l--)p=e[l],w=o&&p?p[o]:p,u=R.get(w),S[l]=u===void 0?-1:u,R.set(w,l);for(u=d;u<=g;u++)p=s[u],w=o&&p?p[o]:p,l=R.get(w),l!==void 0&&l!==-1&&(P[l]=s[u],l=S[l],R.set(w,l));for(l=d;l<e.length;l++)l in P?(D(s,l,P[l]),Ce(e[l],s,l,r,o)):D(s,l,e[l])}else for(let u=0,l=e.length;u<l;u++)Ce(e[u],s,u,r,o);s.length>e.length&&D(s,"length",e.length);return}const a=Object.keys(e);for(let u=0,l=a.length;u<l;u++)Ce(e[a[u]],s,a[u],r,o);const c=Object.keys(s);for(let u=0,l=c.length;u<l;u++)e[c[u]]===void 0&&D(s,c[u],void 0)}function Ec(e,t={}){const{merge:n,key:r="id"}=t,o=te(e);return s=>{if(!J(s)||!J(o))return o;const i=Ce(o,{[Rt]:s},Rt,n,r);return i===void 0?s:i}}const lt=new WeakMap,Xn={get(e,t){if(t===Ie)return e;const n=e[t];let r;return J(n)?lt.get(n)||(lt.set(n,r=new Proxy(n,Xn)),r):n},set(e,t,n){return D(e,t,te(n)),!0},deleteProperty(e,t){return D(e,t,void 0,!0),!0}};function Pc(e){return t=>{if(J(t)){let n;(n=lt.get(t))||lt.set(t,n=new Proxy(t,Xn)),e(n)}return t}}function Zt(e,t=0,n=1){return Math.min(Math.max(t,e),n)}function Lo(e){e=e.substr(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,o)=>o<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function fe(e){if(typeof e!="string")return e;if(e.charAt(0)==="#")return fe(Lo(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error("MUI: Unsupported `%s` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). "+e);const r=e.substring(t+1,e.length-1);let o,s;if(n==="color"){if(o=r.split(" "),s=o.shift(),o.length===4&&o[3].charAt(0)==="/"&&(o[3]=o[3].substr(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(s)===-1)throw new Error("MUI: unsupported `%s` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020. "+s)}else o=r.split(",");return{type:n,values:o.map(i=>parseFloat(i)),colorSpace:s}}function bt(e){const{type:t,colorSpace:n}=e,{values:r}=e;let o;return t.indexOf("rgb")!==-1?o=r.map((s,i)=>i<3?parseInt(s.toString(),10):s).join(","):t.indexOf("hsl")!==-1&&(o=r.map((s,i)=>i===1||i===2?`${s}%`:s).join(",")),t.indexOf("color")!==-1?o=`${n} ${r.join(" ")}`:o=`${r.join(", ")}`,`${t}(${o})`}function Fo(e){const t=fe(e),{values:n}=t,r=n[0],o=n[1]/100,s=n[2]/100,i=o*Math.min(s,1-s),a=(l,d=(l+r/30)%12)=>s-i*Math.max(Math.min(d-3,9-d,1),-1);let c="rgb";const u=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return t.type==="hsla"&&(c+="a",u.push(n[3])),bt({type:c,values:u})}function pn(e){const{type:t,values:n}=fe(e);let r=t==="hsl"?fe(Fo(e)).values:n;return r=r.map(o=>(t!=="color"&&(o/=255),o<=.03928?o/12.92:((o+.055)/1.055)**2.4)),Number((.2126*r[0]+.7152*r[1]+.0722*r[2]).toFixed(3))}function Do(e,t){const n=pn(e),r=pn(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Mc(e,t){let{type:n,values:r}=fe(e);return t=Zt(t),(n==="rgb"||n==="hsl")&&(n+="a"),n==="color"?r[3]=`/${t}`:r[3]=t,bt({type:n,values:r})}function Ro(e,t){const n=fe(e);if(t=Zt(t),n.type.indexOf("hsl")!==-1)n.values[2]*=1-t;else if(n.type.indexOf("rgb")!==-1||n.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)n.values[r]*=1-t;return bt(n)}function No(e,t){const n=fe(e);if(t=Zt(t),n.type.indexOf("hsl")!==-1)n.values[2]+=(100-n.values[2])*t;else if(n.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)n.values[r]+=(255-n.values[r])*t;else if(n.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)n.values[r]+=(1-n.values[r])*t;return bt(n)}const Bo={xs:0,sm:600,md:900,lg:1200,xl:1536};function Uo(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const s=r.breakpoints;return t.reduce((i,a,c)=>(i={...i,...s.up(s.keys[c],n(t[c]))},i),{})}if(typeof t=="object"){const s=r.breakpoints;return Object.keys(t).reduce((a,c)=>{if(Object.keys(s.values||Bo).indexOf(c)!==-1)a={...a,...s.up(c,n(t[c],c))};else{const u=c;a[u]=t[u]}return a},{})}return n(t)}const _o={cleanupStyles:!0},jo=Me(_o),ge={black:"#000",white:"#fff"},Oe={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},ve={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},ke={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},$e={300:"#4fc3f7",400:"#29b6f6",700:"#0288d1",800:"#0277bd",900:"#01579b"},Ae={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},Ue={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Vo={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function Ne(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function Wo(e,t){for(const n of t){const r=e[n];delete e[n],e[n]=r}}function Qt(e,t,n={clone:!0}){const r=n.clone?{...e}:e,o=n.sortKeys?[]:void 0;return Ne(e)&&Ne(t)&&(Object.keys(t).forEach(s=>{if(s==="__proto__")return;o&&o.push(s);let i,a;Ne(i=t[s])&&s in e&&Ne(a=e[s])?r[s]=Qt(a,i,n):i!==void 0&&(r[s]=i)}),o&&Wo(r,o)),r}function Nt(e){if(Array.isArray(e)){const t=[];for(const n of e)t.push(Nt(n));return t}else if(Ne(e)){const t={};for(const n in e)n!=="__proto__"&&(t[n]=Nt(e[n]));return t}else return e}function He(e,...t){for(const n of t)Qt(e,Nt(n),{clone:!1});return e}const zo=()=>({text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:ge.white,default:ge.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}),Ko={primary:{main:ke[700],light:ke[400],dark:ke[800]},secondary:{main:ve[500],light:ve[300],dark:ve[700]},error:{main:Oe[700],light:Oe[400],dark:Oe[800]},info:{main:$e[700],light:$e[800],dark:$e[900]},success:{main:Ae[800],light:Ae[500],dark:Ae[900]},warning:{main:"#ED6C02",light:Ue[500],dark:Ue[900]}},Ho=()=>({text:{primary:ge.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:ge.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}),Go={primary:{main:ke[200],light:ke[50],dark:ke[400]},secondary:{main:ve[200],light:ve[50],dark:ve[400]},error:{main:Oe[500],light:Oe[300],dark:Oe[700]},info:{main:$e[400],light:$e[300],dark:$e[700]},success:{main:Ae[400],light:Ae[300],dark:Ae[700]},warning:{main:Ue[400],light:Ue[300],dark:Ue[700]}},Jo={light:zo,dark:Ho};function Yn(e,t){return Do(e,ge.white)>=t?ge.white:"rgba(0, 0, 0, 0.87)"}function mn(e,t,n,r){const o=typeof r=="number"?r:r.light,s=typeof r=="number"?r*1.5:r.dark;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=No(e.main,o):t==="dark"&&(e.dark=Ro(e.main,s)))}function qo(e){const t={...e.color},n=e.mainShade??500;return!e.color.main&&e.color[n]&&(t.main=e.color[n]),mn(t,"light",e.lightShade??300,e.tonalOffset),mn(t,"dark",e.darkShade??700,e.tonalOffset),t.contrastText||(t.contrastText=Yn(t.main,e.contrastThreshold)),t}const Xo=()=>({mode:"light",tonalOffset:.2,contrastThreshold:3,grey:Vo,common:ge});function Yo(e){const t=["error","info","primary","secondary","success","warning"],n=Xo(),r={...He({},n,Jo[(e==null?void 0:e.mode)??n.mode](),e),isColorName(s){return t.includes(s)},getColorObject(s){return r[s]},getColor(s){return r.mode==="light"?r[s].light:r[s].dark},augmentColor(s){return qo({...s,tonalOffset:r.tonalOffset,contrastThreshold:r.contrastThreshold})},getContrastText(s){return Yn(s,r.contrastThreshold)}},o=s=>r.mode==="light"?Ko[s]:Go[s];return r.primary=r.augmentColor({color:r.primary||o("primary")}),r.secondary=r.augmentColor({color:r.secondary||o("secondary"),mainShade:"A400",lightShade:"A200",darkShade:"A700"}),r.error=r.augmentColor({color:r.error||o("error")}),r.warning=r.augmentColor({color:r.warning||o("warning")}),r.info=r.augmentColor({color:r.info||o("info")}),r.success=r.augmentColor({color:r.success||o("success")}),r}const Zo={};function Qo(e){return{...He({},Zo,e??{})}}function es(e,t=void 0,n={}){return{toolbar:{minHeight:56,[`${e.up("xs")} and (orientation: landscape)`]:{minHeight:48},[e.up("sm")]:{minHeight:64}},...n}}const $t={},ts=.2,ns=.14,rs=.12;function A(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${ts})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${ns})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${rs})`].join(",")}const os=[()=>"none",()=>A(0,2,1,-1,0,1,1,0,0,1,3,0),()=>A(0,3,1,-2,0,2,2,0,0,1,5,0),()=>A(0,3,3,-2,0,3,4,0,0,1,8,0),()=>A(0,2,4,-1,0,4,5,0,0,1,10,0),()=>A(0,3,5,-1,0,5,8,0,0,1,14,0),()=>A(0,3,5,-1,0,6,10,0,0,1,18,0),()=>A(0,4,5,-2,0,7,10,1,0,2,16,1),()=>A(0,5,5,-3,0,8,10,1,0,3,14,2),()=>A(0,5,6,-3,0,9,12,1,0,3,16,2),()=>A(0,6,6,-3,0,10,14,1,0,4,18,3),()=>A(0,6,7,-4,0,11,15,1,0,4,20,3),()=>A(0,7,8,-4,0,12,17,2,0,5,22,4),()=>A(0,7,8,-4,0,13,19,2,0,5,24,4),()=>A(0,7,9,-4,0,14,21,2,0,5,26,4),()=>A(0,8,9,-5,0,15,22,2,0,6,28,5),()=>A(0,8,10,-5,0,16,24,2,0,6,30,5),()=>A(0,8,11,-5,0,17,26,2,0,6,32,5),()=>A(0,9,11,-5,0,18,28,2,0,7,34,6),()=>A(0,9,12,-6,0,19,29,2,0,7,36,6),()=>A(0,10,13,-6,0,20,31,3,0,8,38,7),()=>A(0,10,13,-6,0,21,33,3,0,8,40,7),()=>A(0,10,14,-6,0,22,35,3,0,8,42,7),()=>A(0,11,14,-7,0,23,36,3,0,9,44,8),()=>A(0,11,15,-7,0,24,38,3,0,9,46,8)];function ss(){return new Proxy([],{get:(e,t)=>typeof t!="string"||isNaN(Number(t))?e[t]:t in $t?$t[t]:$t[t]=os[t]()})}const is={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},as={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function yn(e){return`${Math.round(e)}ms`}function cs(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function ls(e){const t={...is,...e.easing},n={...as,...e.duration};return{getAutoHeightDuration:cs,create:(o=["all"],s={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:c=0,...u}=s;return(Array.isArray(o)?o:[o]).map(l=>`${l} ${typeof i=="string"?i:yn(i)} ${a} ${typeof c=="string"?c:yn(c)}`).join(",")},...e,easing:t,duration:n}}const U={light:300,regular:400,medium:500},Ye={fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontSize:14,htmlFontSize:16,h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},subtitle1:{},subtitle2:{},body1:{},body2:{},button:{},caption:{},overline:{},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700};function us(e){return Math.round(e*1e5)/1e5}function _(e,t,n,r,o,s){return{fontFamily:e.fontFamily,fontWeight:t,fontSize:e.pxToRem(n),lineHeight:`${r}`,letterSpacing:`${us(o/n)}em`,...s?{textTransform:"uppercase"}:{}}}function ds(e={}){const t={fontFamily:e.fontFamily??Ye.fontFamily,fontSize:e.fontSize??Ye.fontSize,htmlFontSize:(e==null?void 0:e.htmlFontSize)??Ye.htmlFontSize,pxToRem:n=>{const r=t.fontSize/14;return`${n/t.htmlFontSize*r}rem`}};return He(Ye,t,{h1:_(t,U.light,96,1.167,-1.5),h2:_(t,U.light,60,1.2,-.5),h3:_(t,U.regular,48,1.167,0),h4:_(t,U.regular,34,1.235,.25),h5:_(t,U.regular,24,1.334,0),h6:_(t,U.medium,20,1.6,.15),subtitle1:_(t,U.regular,16,1.75,.15),subtitle2:_(t,U.medium,14,1.57,.1),body1:_(t,U.regular,16,1.5,.15),body2:_(t,U.regular,14,1.43,.15),button:_(t,U.medium,14,1.75,.4,!0),caption:_(t,U.regular,12,1.66,.4),overline:_(t,U.regular,12,2.66,1,!0)},e)}const fs={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function gs(e){return{...He({},fs,e)}}function At(e,t,n="px"){let r;if(e==="up")r=`(min-width:${t}${n})`;else if(e==="down")r=`(max-width:${t}${n})`;else if(e==="between"){const[o,s]=t;r=`(max-width:${o}${n}) and (min-width:${s}${n})`}else throw new Error(`Invalid comparator: ${e}`);return`@media ${r}`}const hs={columns:12,keys:["xs","sm","md","lg","xl"],values:{xs:0,sm:600,md:900,lg:1200,xl:1536},unit:"px"};function Zn(e){const t={...hs,...e??{},up:(n,r)=>{const o=At("up",t.resolve(n));return r?{[o]:r}:o},down:(n,r)=>{const o=At("down",t.resolve(n));return r?{[o]:r}:o},between:(n,r)=>{const o=At("between",[t.resolve(n[0]),t.resolve(n[1])]);return r?{[o]:r}:o},resolve:n=>typeof n=="number"?n:t.values[n]};return t}function Qn(e){return typeof e=="function"?e:(...n)=>n.map(r=>typeof r=="number"?`${r*(e??8)}px`:r).join(" ")}const ps={borderRadius:4};function er(e){return{...He({},ps,e)}}function tr(e={}){const t={direction:"ltr",...e};function n(r,o){const s=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,...typeof s=="function"?{get:s}:{value:o({[r]:s})}})}return n("breakpoints",r=>Zn(r.breakpoints)),n("components",r=>Qo(r.components)),n("palette",r=>Yo(r.palette)),n("shape",r=>er(r.shape)),n("spacing",r=>Qn(r.spacing)),n("typography",r=>ds(r.typography)),n("shadows",()=>ss()),n("transitions",()=>ls({})),n("zIndex",r=>gs(r.zIndex)),n("mixins",()=>es(t.breakpoints)),t}function nr(e){let t;return function(){return t||(t=e()),t}}const ms=nr(tr);let rr;rr=Me({});const wt=rr;function ys(e){return{direction:"ltr",shadows:void 0,transitions:void 0,components:void 0,palette:void 0,typography:void 0,zIndex:void 0,mixins:void 0,...e,breakpoints:Zn(e==null?void 0:e.breakpoints),shape:er(e==null?void 0:e.shape),spacing:Qn(e==null?void 0:e.spacing)}}const bs=nr(ys);function ws(e){for(const t in e)return!1;return!0}function en(e=bs,t=wt){const n=Ke(t);if(typeof n=="function")return new Proxy({},{get:(r,o)=>n()[o]});if(ws(n)&&e)return typeof e=="function"?e():e;if(!n)throw new Error("Theme is not defined");return n}function or(e=ms){return en(e,wt)}function Cs(e){return en(e,wt)}function Ss(e){var s,i;const t=[],n=typeof e.propDefaults=="function"?e.propDefaults({set:a=>a,inProps:e.props}):e.propDefaults,o=(i=(s=Cs().components)==null?void 0:s[e.name])==null?void 0:i.defaultProps;return n&&t.push(n),o&&t.push(o),t.length?Un(...t,e.props):e.props}function xs(e){return ae(wt.Provider,{get value(){return e.theme},get children(){return e.children}})}function Os(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function vs(e,t){switch(typeof e){case"function":return Object.assign(e,{[Qr]:!0}),je(()=>e(t));case"string":const n=_n.has(e),r=L.context?Wn():Os(e,n);return Vn(r,t,n),r}}function sr(e,t){const n=F(e);return F(()=>vs(n(),t))}function Lc(e){const[t,n]=mt(e,["$component"]);return sr(()=>t.$component,n)}function ks(e){const t=e.reduce((n,r)=>("name"in r&&(n[`--${r.name}`]="0"),Qt(n,r,{clone:!1,sortKeys:!0}),n),{});return delete t.name,t}function ir(e){return e.startsWith("--")}function $s(e){return e.startsWith("__")}function ar(e){return/[^a-z-]/i.test(e)&&!ir(e)}function cr(e){return e.startsWith("@global")}function Bt(e){return e.startsWith("@media")}function lr(e){return e.startsWith("@keyframes")}function bn(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function wn(e,t,n=[],r={}){const o=e.split(",").map(s=>(s=s.trim(),s.includes("&")?s:`& ${s}`));return ut(t,(n.length?n:[""]).flatMap(s=>o.map(i=>i.replace(/&/g,s).trim())),{...r})}function Cn(e,t){if(!t)return bn(e);let n=t.get(e);return n||(t.set(e,n=bn(e)),n)}function ut(e,t=[],n={}){const r=[],o=[];for(let i in e){const a=e[i];if(!$s(i))if(cr(i))for(const c in a)o.push(...wn(c,a[c],[],n));else if(Bt(i))o.push(...ut(a,t,{...n,sublevel:!0}).map(c=>`${i} {
|
|
2
|
-
${c}
|
|
3
|
-
}`));else if(ir(i))a!=null&&r.push(`${i}: ${a};`);else if(lr(i)){const c=[];for(const u in a)c.push(...ut(a[u],[/^\d+$/.test(u)?`${u}%`:u],{...n,sublevel:!0}));o.push(`${i} {
|
|
4
|
-
${c.join(`
|
|
5
|
-
`)}
|
|
6
|
-
}`)}else if(ar(i))o.push(...wn(i,a,t,n));else if(n.extraProperties&&i in n.extraProperties){const c=n.extraProperties[i](a);for(const u in c){const l=c[u],d=n.onPropertyValue?n.onPropertyValue(u,l):l;d!=null&&r.push(`${Cn(u,n.propertyNameCache)}: ${d};`)}}else{i=Cn(i,n.propertyNameCache);const c=n.onPropertyValue?n.onPropertyValue(i,a):a;c!=null&&r.push(`${i}: ${c};`)}}const s=i=>{const a=" ".repeat(i);return`${a}${r.join(`
|
|
7
|
-
${a}`)}`};if(t.length){const i=n.sublevel?" ":"",a=i+t.join(`,
|
|
8
|
-
${i}`);return[...r.length?[`${a} {
|
|
9
|
-
${s(n.sublevel?2:1)}
|
|
10
|
-
${i}}`]:[],...o]}else return[...r.length?[s(0)]:[],...o]}function As(e){return e?Array.isArray(e)?e:[e]:[]}function Is(e){return typeof e=="function"&&(e=e()),e}class Ts{constructor(){Xe(this,"ids",new Map);Xe(this,"rules",new Map);Xe(this,"propertyNames",new Map)}create(t,n,r){let o=this.rules.get(n);if(o)return o;let s=this.ids.get(r);return typeof s=="number"&&(this.ids.set(r,++s),r+=`_${s}`),o=ur(t,n,r),this.save(o,n),o}save(t,n){this.ids.set(t.id,0),this.rules.set(n,t)}delete(t){this.ids.delete(t.id),this.rules.delete(t.rules)}}function ur(e,t,n){return{id:n,name:e,className:`${e}-${n}`,rules:t.replaceAll("$id",`${n}`)}}function Es(e){var s,i;const t=`${e.name}-$id`,n=As(Is(e.props)),r=(s=e.cache)==null?void 0:s.propertyNames,o=n.map(a=>typeof a=="string"?`.${t} {
|
|
11
|
-
${a}
|
|
12
|
-
}`:ut(a,[`.${t}`],{extraProperties:e.extraProperties,propertyNameCache:r}).join(`
|
|
13
|
-
`)).join(`
|
|
14
|
-
`);return((i=e.cache)==null?void 0:i.create(e.name,o,e.componentId))||ur(e.name,o,e.componentId)}function dr(e,t){"styleSheet"in e?e.styleSheet.cssText=t:(e.innerText="",e.appendChild(document.createTextNode(t)))}function Ps(e,t){for(const n in t){const r=t[n];r!==void 0&&(r===null?e.removeAttribute(n):e.setAttribute(n,r))}}function Ms(e,t){const n=document.createElement("style");return n.type="text/css",t&&Ps(n,t),dr(n,e),n}function Ut(e){let t=Number(e.getAttribute("data-uses"));t++,e.setAttribute("data-uses",t.toString())}const Sn="suid-injectFirst";function Ls(e,t,n){Array.isArray(e)&&(e=e.join(`
|
|
15
|
-
`));const r=t==null?void 0:t.id,o=document.head||document.getElementsByTagName("head")[0],s=r&&document.getElementById(r);if(s&&s instanceof HTMLStyleElement)return dr(s,e),Ut(s),s;{s&&s.remove();const i=Ms(e,t);if(Ut(i),n){let a=o.querySelector(`#${Sn}`);a||(a=document.createElement("style"),a.setAttribute("id",Sn),o.prepend(a)),o.insertBefore(i,a)}else o.appendChild(i);return i}}function Fs(e,t="css-"){if(typeof e=="string")return document.getElementById(e);const n=[...e.classList].find(r=>r.startsWith(t));if(n)return document.getElementById(n.slice(t.length))}function xn(e,t=!0){let n=Number(e.getAttribute("data-uses"));n--,n<=0?t?e.remove():e.setAttribute("data-uses","0"):e.setAttribute("data-uses",n.toString())}function Fc(e){if(typeof e!="string")throw new Error("MUI: `capitalize(string)` expects a string argument.");return e.charAt(0).toUpperCase()+e.slice(1)}function Dc(e,t=166){let n;function r(...o){const s=()=>{e.apply(null,o)};clearTimeout(n),n=setTimeout(s,t)}return r.clear=()=>{clearTimeout(n)},r}function Rc(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}function Ds(e){return e&&e.ownerDocument||document}function Nc(e){return Ds(e).defaultView||window}function fr(){return Math.random().toString(36).substring(2,15).slice(0,8)}let Ct=!0,_t=!1,On;const Rs={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Ns(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&Rs[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function Bs(e){e.metaKey||e.altKey||e.ctrlKey||(Ct=!0)}function It(){Ct=!1}function Us(){this.visibilityState==="hidden"&&_t&&(Ct=!0)}function _s(e){e.addEventListener("keydown",Bs,!0),e.addEventListener("mousedown",It,!0),e.addEventListener("pointerdown",It,!0),e.addEventListener("touchstart",It,!0),e.addEventListener("visibilitychange",Us,!0)}function js(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return Ct||Ns(t)}function Bc(){const e=s=>{s!=null&&_s(s.ownerDocument)},[t,n]=E(!1);function r(){return t()?(_t=!0,window.clearTimeout(On),On=window.setTimeout(()=>{_t=!1},100),n(!1),!0):!1}function o(s){return js(s)?(n(!0),!0):!1}return{isFocusVisibleRef:{get current(){return t()}},onFocus:o,onBlur:r,ref:e}}const Vs=new Ts;function Ws(e){return e?Array.isArray(e)?e.flat(1/0).filter(t=>!!t):[e]:[]}function zs(){if(!L.context)return fr();const e=eo().replaceAll("-",""),t=9,n=Math.ceil(e.length/t),r=[];for(let o=1;o<=n;++o){const s=(o-1)*t,i=Number(e.slice(s,s+t));r.push(i.toString(32))}return r.join("-")}function gr(e){const t=Ke(jo),[n,r]=E(""),o=zs();let s,i=!1;return se(a=>{var l;const c=e();let u;if(c){const d=ks(Ws(c));i="@global"in d,u=Es({name:"css",props:d,cache:Vs,componentId:o}),s=Fs(u.id),s?Ut(s):s=Ls(u.rules,{id:u.id,nonce:(l=t.cache)==null?void 0:l.nonce},t.injectFirst),a!=null&&a.styleElement&&xn(a.styleElement)}return typeof(u==null?void 0:u.className)=="string"?r(u.className):r(""),{className:u==null?void 0:u.className,styleElement:s}},void 0),ie(()=>{s&&xn(s,t.cleanupStyles??i)}),n}function Se(e,t,n={}){for(const r in e){const o=e[r];if(cr(r))n[r]=Se(o,t);else if(Bt(r))n[r]=Se(o,t);else if(lr(r)){n[r]={};for(const s in o)n[r][s]=Se(o[s],t)}else if(ar(r))n[r]=Se(o,t);else{const s=t(r,o);if(s)for(const i in s)n[i]=Bt(i)?{...n[i],...s[i]}:s[i];else n[r]=o}}return n}const Ks=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","msGridRow","msGridRowSpan","msGridColumn","msGridColumnSpan","fontWeight","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","WebkitLineClamp","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function hr(e,t){if(typeof t=="number")return{[e]:Ks.has(e)?t.toString():`${t}px`}}function vn(e,t={}){return Se(e,hr,t)}function dt(e,t,n){if(typeof n!="string")return n;const r=n.split(".");let o=e[t];for(let s=0;s<r.length&&(o=o==null?void 0:o[r[s]],!!o);s++);return o??n}function Hs(e,t){return t.split(".").reduce((n,r)=>n&&n[r]?n[r]:null,e)}function Gs(e,t,n,r){const o=Hs(e,t)||n;return typeof o=="number"?s=>typeof s=="string"?s:o*s:Array.isArray(o)?s=>typeof s=="string"?s:o[s]:typeof o=="function"?o:()=>{}}const re={x:["Left","Right"],y:["Top","Bottom"]};function pr(e){return typeof e=="number"?`${e}px`:e}function mr(e,t){return(n,r)=>t(e,n,r)}function f(e,t){return t?(n,r)=>({[e]:t(e,n,r)}):n=>({[e]:n})}function Be(e){return f(e,(t,n)=>pr(n))}function V(e,t,n){const r=t.map(o=>`${e}${o}`);return n?(o,s)=>r.reduce((i,a)=>(i[a]=n(a,o,s),i),{}):o=>r.reduce((s,i)=>(s[i]=o,s),{})}function Js(){return{...qs(),...Xs(),...Ys(),...Zs(),...Qs(),...ei(),...ti(),...ri(),...ni()}}function qs(){return{displayPrint:mr("displayPrint",(e,t)=>({"@media print":{display:t}})),displayRaw:f("display"),overflow:f("overflow"),textOverflow:f("textOverflow"),visibility:f("visibility"),whiteSpace:f("whiteSpace")}}function Xs(){return{flexBasis:f("flexBasis"),flexDirection:f("flexDirection"),flexWrap:f("flexWrap"),justifyContent:f("justifyContent"),alignItems:f("alignItems"),alignContent:f("alignContent"),order:f("order"),flex:f("flex"),flexGrow:f("flexGrow"),flexShrink:f("flexShrink"),alignSelf:f("alignSelf"),justifyItems:f("justifyItems"),justifySelf:f("justifySelf")}}function Ys(){const e=(t,n,r)=>Gs(r,"spacing",8)(n);return{gap:f("gap",e),columnGap:f("columnGap",e),rowGap:f("rowGap",e),gridColumn:f("gridColumn"),gridRow:f("gridRow"),gridAutoFlow:f("gridAutoFlow"),gridAutoColumns:f("gridAutoColumns"),gridAutoRows:f("gridAutoRows"),gridTemplateColumns:f("gridTemplateColumns"),gridTemplateRows:f("gridTemplateRows"),gridTemplateAreas:f("gridTemplateAreas"),gridArea:f("gridArea")}}function Zs(){return{position:f("position"),zIndex:f("zIndex",(e,t,n)=>{var r;return((r=n.zIndex)==null?void 0:r[e])??t}),top:Be("top"),right:Be("right"),bottom:Be("bottom"),left:Be("left")}}function Qs(){const e=(t,n,r)=>dt(r,"palette",n);return{color:f("color",e),bgcolor:f("backgroundColor",e),backgroundColor:f("backgroundColor",e)}}function ei(){const e=(t,n,r)=>(t==="maxWidth"&&(n=r.breakpoints.values[t]??n),typeof n=="number"&&(n=n>0&&n<=1?`${n*100}%`:`${n}px`),n);return{width:f("width",e),maxWidth:f("maxWidth",e),minWidth:f("minWidth",e),height:f("height",e),maxHeight:f("maxHeight",e),minHeight:f("minHeight",e),boxSizing:f("boxSizing",e)}}function ti(){const e=(n,r)=>typeof r=="number"?`${r}px solid`:r,t=(n,r,o)=>dt(o,"palette",r);return{border:f("border",e),borderTop:f("borderTop",e),borderRight:f("borderRight",e),borderBottom:f("borderBottom",e),borderLeft:f("borderLeft",e),borderColor:f("borderColor",t),borderTopColor:f("borderTopColor",t),borderRightColor:f("borderRightColor",t),borderBottomColor:f("borderBottomColor",t),borderLeftColor:f("borderLeftColor",t),borderRadius:f("borderRadius",(n,r,o)=>typeof r=="number"?`${o.shape.borderRadius*r}px`:r)}}function ni(){const e=(t,n,r)=>dt(r,"typography",n);return{typography:mr("typography",(t,n,r)=>dt(r,"typography",n)),fontFamily:f("fontFamily",e),fontSize:f("fontSize",(t,n,r)=>pr(e(t,n,r))),fontStyle:f("fontStyle",e),fontWeight:f("fontWeight",e),letterSpacing:Be("letterSpacing"),lineHeight:f("lineHeight"),textAlign:f("textAlign"),textTransform:f("textTransform")}}function ri(){const e=(r,o,s)=>s.spacing(o),t="margin",n="padding";return{m:f(t,e),mt:f("marginTop",e),mr:f("marginRight",e),mb:f("marginBottom",e),ml:f("marginLeft",e),mx:V(t,re.x,e),my:V(t,re.y,e),margin:f(t,e),marginTop:f("marginTop",e),marginRight:f("marginRight",e),marginBottom:f("marginBottom",e),marginLeft:f("marginLeft",e),marginX:V(t,re.x,e),marginY:V(t,re.y,e),marginInline:V(t,["Inline","InlineStart"],e),marginInlineStart:f("marginInlineStart",e),marginInlineEnd:f("marginInlineEnd",e),marginBlock:V(t,["BlockStart","BlockEnd"],e),marginBlockStart:f("marginBlockStart",e),marginBlockEnd:f("marginBlockEnd",e),p:f(n,e),pt:f("paddingTop",e),pr:f("paddingRight",e),pb:f("paddingBottom",e),pl:f("paddingLeft",e),px:V(n,re.x,e),py:V(n,re.y,e),padding:f(n,e),paddingTop:f("paddingTop",e),paddingRight:f("paddingRight",e),paddingBottom:f("paddingBottom",e),paddingLeft:f("paddingLeft",e),paddingX:V(n,re.x,e),paddingY:V(n,re.y,e),paddingInline:V(n,["Inline","InlineStart"],e),paddingInlineStart:f("paddingInlineStart",e),paddingInlineEnd:f("paddingInlineEnd",e),paddingBlock:V(n,["BlockStart","BlockEnd"],e),paddingBlockStart:f("paddingBlockStart",e),paddingBlockEnd:f("paddingBlockEnd",e)}}const tn=Js(),Uc=Object.keys(tn);function oi(e,t,n){return tn[e](t,n)}function kn(e,t,n){return e in tn?oi(e,t,n):hr(e,t)}function si(e,t){return Se(e,(n,r)=>{if(typeof r=="function"&&(r=r(t)),r==null)return r;if(typeof r=="object"){const o={};for(const s of t.breakpoints.keys)o[t.breakpoints.up(s)]={};return Object.assign(o,Uo({theme:t},r,s=>kn(n,s,t)??{[n]:s}))}else return kn(n,r,t)})}function yr(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=yr(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ii(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=yr(e))&&(r&&(r+=" "),r+=t);return r}const br=["ownerState","theme","sx","as"];function ai(e,t){var n,r;return(r=(n=t.components)==null?void 0:n[e])==null?void 0:r.styleOverrides}function ci(e,t,n,r,o={}){return F(()=>{const s=e(),i=ai(o.name,s),a=r.ownerState,c=n.reduce((l,d)=>{let g;return typeof d=="function"?g=d({ownerState:a,theme:s,get sx(){return r.sx},get as(){return r.as},props:r}):d&&(g=d),g&&l.push(vn(g,{name:t,__resolved:!0})),l},[]);let u=[];return o.overridesResolver&&typeof o.overridesResolver=="function"&&i&&(u=o.overridesResolver(r,i).map(l=>l?vn(l,{}):null).filter(Boolean)),c.concat(u)})}function wr(e,t){e.__suid=t}function $n(e){if(typeof e=="function")return e.__suid}function li(e){return function(n,r={}){let o,s;if(r.name){const a=r.slot||"Root";s=o=`${r.name}-${a.slice(0,1).toLowerCase()+a.slice(1)}`}else s=`styled-${fr()}`,o="css";const i=$n(n);return function(...a){function c(u){let l;const d=()=>{const k=u.theme;return k||l||(l=e&&e.onUseTheme?e.onUseTheme():en())},[,g]=mt(u,r.skipProps||br),m=ci(d,o,a,u,r),p=()=>{const k=u.sx;return k?Array.isArray(k)?k:[k]:[]},S=()=>{if(i)return n;const k=u.as;return k||n},w=i?()=>i:F(()=>$n(S())),P=r.skipSx?()=>m():()=>{const k=d();return[...m(),...p().map(h=>h.__resolved?h:si(h,k))]},R=gr(()=>w()?void 0:P());return sr(S,Un(g,{get children(){return u.children},get component(){return w()?u.component:null},get as(){return i?u.as:void 0},get sx(){return w()?P():void 0},get ownerState(){return w()==="system"?u.ownerState:void 0},get class(){return ii([...new Set([u.class,s,R()])])}}))}return wr(c,"system"),s&&(c.toString=()=>`.${s}`),c}}}const _c=[...br,"classes"],jc=li({onUseTheme:()=>or()}),ui="codenomad.client-id",di="codenomad.connection-id";let Ze=null,Qe=null;function jt(){return{clientId:fi(),connectionId:gi()}}function fi(){return Ze||(Ze=Cr(ui,window.localStorage),Ze)}function gi(){return Qe||(Qe=Cr(di,window.sessionStorage),Qe)}function Cr(e,t){if(typeof window>"u")return Tt();try{const r=t.getItem(e);if(r&&r.trim())return r.trim()}catch{return Tt()}const n=Tt();try{t.setItem(e,n)}catch{}return n}function Tt(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Vt={exports:{}},Et,An;function hi(){if(An)return Et;An=1;var e=1e3,t=e*60,n=t*60,r=n*24,o=r*7,s=r*365.25;Et=function(l,d){d=d||{};var g=typeof l;if(g==="string"&&l.length>0)return i(l);if(g==="number"&&isFinite(l))return d.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function i(l){if(l=String(l),!(l.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var g=parseFloat(d[1]),m=(d[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return g*s;case"weeks":case"week":case"w":return g*o;case"days":case"day":case"d":return g*r;case"hours":case"hour":case"hrs":case"hr":case"h":return g*n;case"minutes":case"minute":case"mins":case"min":case"m":return g*t;case"seconds":case"second":case"secs":case"sec":case"s":return g*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function a(l){var d=Math.abs(l);return d>=r?Math.round(l/r)+"d":d>=n?Math.round(l/n)+"h":d>=t?Math.round(l/t)+"m":d>=e?Math.round(l/e)+"s":l+"ms"}function c(l){var d=Math.abs(l);return d>=r?u(l,d,r,"day"):d>=n?u(l,d,n,"hour"):d>=t?u(l,d,t,"minute"):d>=e?u(l,d,e,"second"):l+" ms"}function u(l,d,g,m){var p=d>=g*1.5;return Math.round(l/g)+" "+m+(p?"s":"")}return Et}function pi(e){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=hi(),n.destroy=u,Object.keys(e).forEach(l=>{n[l]=e[l]}),n.names=[],n.skips=[],n.formatters={};function t(l){let d=0;for(let g=0;g<l.length;g++)d=(d<<5)-d+l.charCodeAt(g),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(l){let d,g=null,m,p;function S(...w){if(!S.enabled)return;const P=S,R=Number(new Date),k=R-(d||R);P.diff=k,P.prev=d,P.curr=R,d=R,w[0]=n.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let h=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,($,O)=>{if($==="%%")return"%";h++;const b=n.formatters[O];if(typeof b=="function"){const v=w[h];$=b.call(P,v),w.splice(h,1),h--}return $}),n.formatArgs.call(P,w),(P.log||n.log).apply(P,w)}return S.namespace=l,S.useColors=n.useColors(),S.color=n.selectColor(l),S.extend=r,S.destroy=n.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(m!==n.namespaces&&(m=n.namespaces,p=n.enabled(l)),p),set:w=>{g=w}}),typeof n.init=="function"&&n.init(S),S}function r(l,d){const g=n(this.namespace+(typeof d>"u"?":":d)+l);return g.log=this.log,g}function o(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];const d=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const g of d)g[0]==="-"?n.skips.push(g.slice(1)):n.names.push(g)}function s(l,d){let g=0,m=0,p=-1,S=0;for(;g<l.length;)if(m<d.length&&(d[m]===l[g]||d[m]==="*"))d[m]==="*"?(p=m,S=g,m++):(g++,m++);else if(p!==-1)m=p+1,S++,g=S;else return!1;for(;m<d.length&&d[m]==="*";)m++;return m===d.length}function i(){const l=[...n.names,...n.skips.map(d=>"-"+d)].join(",");return n.enable(""),l}function a(l){for(const d of n.skips)if(s(l,d))return!1;for(const d of n.names)if(s(l,d))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var mi=pi;(function(e,t){var n={};t.formatArgs=o,t.save=s,t.load=i,t.useColors=r,t.storage=a(),t.destroy=(()=>{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let u;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(u=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(u[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;u.splice(1,0,l,"color: inherit");let d=0,g=0;u[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(d++,m==="%c"&&(g=d))}),u.splice(g,0,l)}t.log=console.debug||console.log||(()=>{});function s(u){try{u?t.storage.setItem("debug",u):t.storage.removeItem("debug")}catch{}}function i(){let u;try{u=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}function a(){try{return localStorage}catch{}}e.exports=mi(t);const{formatters:c}=e.exports;c.j=function(u){try{return JSON.stringify(u)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(Vt,Vt.exports);var yi=Vt.exports;const Wt=ro(yi),Le=["sse","api","session","actions"],Sr="opencode:logger:namespaces",Pt=new Map,q=new Set,Z=typeof globalThis<"u"?globalThis.console:void 0;function Ge(){q.size===0?Wt.disable():Wt.enable(Array.from(q).join(","))}function St(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{window.localStorage.setItem(Sr,JSON.stringify(Array.from(q)))}catch(t){(e=Z==null?void 0:Z.warn)==null||e.call(Z,"Failed to persist logger namespaces",t)}}function bi(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{const t=window.localStorage.getItem(Sr);if(!t)return;const n=JSON.parse(t);if(!Array.isArray(n))return;for(const r of n)Le.includes(r)&&q.add(r)}catch(t){(e=Z==null?void 0:Z.warn)==null||e.call(Z,"Failed to hydrate logger namespaces",t)}}bi();Ge();function wi(e){const n=Wt(e),r=(o,s)=>{n(o,...s)};return{log:(...o)=>n(...o),info:(...o)=>n(...o),warn:(...o)=>r("[warn]",o),error:(...o)=>r("[error]",o)}}function pe(e){if(!Le.includes(e))throw new Error(`Unknown logger namespace: ${e}`);return Pt.has(e)||Pt.set(e,wi(e)),Pt.get(e)}function Ci(){return Le.map(e=>({name:e,enabled:q.has(e)}))}function Si(e){if(!Le.includes(e))throw new Error(`Unknown logger namespace: ${e}`);q.has(e)||(q.add(e),St(),Ge())}function xi(e){if(!Le.includes(e))throw new Error(`Unknown logger namespace: ${e}`);q.has(e)&&(q.delete(e),St(),Ge())}function Oi(){q.clear(),St(),Ge()}function vi(){Le.forEach(e=>q.add(e)),St(),Ge()}const ki={listLoggerNamespaces:Ci,enableLogger:Si,disableLogger:xi,enableAllLoggers:vi,disableAllLoggers:Oi};function $i(){typeof window>"u"||(window.codenomadLogger=ki)}$i();var Nn;const Ai=typeof window<"u"?(Nn=window.location)==null?void 0:Nn.origin:void 0,Ii=typeof window<"u"?window.__CODENOMAD_API_BASE__??Ai:void 0,Ti=typeof window<"u"?window.__CODENOMAD_EVENTS_URL__??"/api/events":"/api/events",ce=Ii,Mt=Ei(ce,Ti),Vc=ce;function Wc(e,t){const n=encodeURIComponent(e),r=encodeURIComponent(t);return Pi(`/workspaces/${n}/plugin/background-processes/${r}/stream`)}function Ei(e,t){if(t.startsWith("http://")||t.startsWith("https://"))return t;if(e){const n=t.startsWith("/")?t:`/${t}`;return`${e}${n}`}return t}function Pi(e){if(e.startsWith("http://")||e.startsWith("https://")||!ce)return e;const t=e.startsWith("/")?e:`/${e}`;return`${ce}${t}`}const In=pe("api"),et=pe("sse");function xr(e){const t={};if(!e)return t;if(e instanceof Headers)return e.forEach((n,r)=>{t[r]=n}),t;if(Array.isArray(e)){for(const[n,r]of e)t[n]=r;return t}return{...e}}function ue(e,t){if(t){In.info(e,t);return}In.info(e)}async function Or(e){const t=await e.text();if(!t)return`Request failed with ${e.status}`;try{const n=JSON.parse(t);if(typeof(n==null?void 0:n.error)=="string"&&n.error.trim())return n.error;if(typeof(n==null?void 0:n.message)=="string"&&n.message.trim())return n.message}catch{}return t}async function y(e,t){const n=ce?new URL(e,ce).toString():e,r=xr(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&(r["Content-Type"]="application/json");const o=((t==null?void 0:t.method)??"GET").toUpperCase(),s=Date.now();ue(`${o} ${e}`);try{const i=await fetch(n,{...t,headers:r,credentials:(t==null?void 0:t.credentials)??"include"});if(!i.ok){const c=await Or(i);throw ue(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:c}),new Error(c||`Request failed with ${i.status}`)}const a=Date.now()-s;return ue(`${o} ${e} -> ${i.status}`,{durationMs:a}),i.status===204?void 0:await i.json()}catch(i){throw ue(`${o} ${e} failed`,{durationMs:Date.now()-s,error:i}),i}}async function Mi(e,t){const n=ce?new URL(e,ce).toString():e,r=xr(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&!r["Content-Type"]&&(r["Content-Type"]="application/json");const o=((t==null?void 0:t.method)??"GET").toUpperCase(),s=Date.now();ue(`${o} ${e}`);const i=await fetch(n,{...t,headers:r,credentials:(t==null?void 0:t.credentials)??"include"});if(!i.ok){const a=await Or(i);throw ue(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:a}),new Error(a||`Request failed with ${i.status}`)}return ue(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s}),i}const X={fetchWorkspaces(){return y("/api/workspaces")},fetchWorktrees(e){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees`)},createWorktree(e,t){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees`,{method:"POST",body:JSON.stringify(t)})},deleteWorktree(e,t,n){const r=new URLSearchParams;n!=null&&n.force&&r.set("force","true");const o=r.toString()?`?${r.toString()}`:"";return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}${o}`,{method:"DELETE"})},readWorktreeMap(e){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`)},writeWorktreeMap(e,t){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`,{method:"PUT",body:JSON.stringify(t)})},createWorkspace(e){return y("/api/workspaces",{method:"POST",body:JSON.stringify(e)})},fetchSidecars(){return y("/api/sidecars")},createSidecar(e){return y("/api/sidecars",{method:"POST",body:JSON.stringify(e)})},updateSidecar(e,t){return y(`/api/sidecars/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})},deleteSidecar(e){return y(`/api/sidecars/${encodeURIComponent(e)}`,{method:"DELETE"})},fetchServerMeta(){return y("/api/meta")},probeRemoteServer(e){return y("/api/remote-servers/probe",{method:"POST",body:JSON.stringify(e)})},fetchAuthStatus(){return y("/api/auth/status")},setServerPassword(e){return y("/api/auth/password",{method:"POST",body:JSON.stringify({password:e})})},deleteWorkspace(e){return y(`/api/workspaces/${encodeURIComponent(e)}`,{method:"DELETE"})},listWorkspaceFiles(e,t="."){const n=new URLSearchParams({path:t});return y(`/api/workspaces/${encodeURIComponent(e)}/files?${n.toString()}`)},searchWorkspaceFiles(e,t,n){const r=t.trim();if(!r)return Promise.resolve([]);const o=new URLSearchParams({q:r});return n!=null&&n.limit&&o.set("limit",String(n.limit)),n!=null&&n.type&&o.set("type",n.type),y(`/api/workspaces/${encodeURIComponent(e)}/files/search?${o.toString()}`)},readWorkspaceFile(e,t){const n=new URLSearchParams({path:t});return y(`/api/workspaces/${encodeURIComponent(e)}/files/content?${n.toString()}`)},writeWorkspaceFile(e,t,n){const r=new URLSearchParams({path:t});return y(`/api/workspaces/${encodeURIComponent(e)}/files/content?${r.toString()}`,{method:"PUT",body:JSON.stringify({contents:n})})},fetchWorktreeGitStatus(e,t){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}/git-status`)},fetchWorktreeGitDiff(e,t,n){const r=new URLSearchParams({path:n.path,scope:n.scope});return n.originalPath&&r.set("originalPath",n.originalPath),y(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}/git-diff?${r.toString()}`)},stageWorktreeGitPaths(e,t,n){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}/git-stage`,{method:"POST",body:JSON.stringify(n)})},unstageWorktreeGitPaths(e,t,n){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}/git-unstage`,{method:"POST",body:JSON.stringify(n)})},commitWorktreeGitChanges(e,t,n){return y(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}/git-commit`,{method:"POST",body:JSON.stringify(n)})},fetchConfigOwner(e){return y(`/api/storage/config/${encodeURIComponent(e)}`)},patchConfigOwner(e,t){return y(`/api/storage/config/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},fetchStateOwner(e){return y(`/api/storage/state/${encodeURIComponent(e)}`)},patchStateOwner(e,t){return y(`/api/storage/state/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},validateBinary(e){return y("/api/storage/binaries/validate",{method:"POST",body:JSON.stringify({path:e})})},fetchSpeechCapabilities(){return y("/api/speech/capabilities")},transcribeAudio(e){return y("/api/speech/transcribe",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeech(e){return y("/api/speech/synthesize",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeechStream(e,t){return Mi("/api/speech/synthesize/stream",{method:"POST",body:JSON.stringify(e),signal:t})},listFileSystem(e,t){const n=new URLSearchParams;e&&e!=="."&&n.set("path",e),(t==null?void 0:t.includeFiles)!==void 0&&n.set("includeFiles",String(t.includeFiles));const r=n.toString();return y(r?`/api/filesystem?${r}`:"/api/filesystem")},createFileSystemFolder(e,t){return y("/api/filesystem/folders",{method:"POST",body:JSON.stringify({parentPath:e,name:t})})},readInstanceData(e){return y(`/api/storage/instances/${encodeURIComponent(e)}`)},writeInstanceData(e,t){return y(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})},deleteInstanceData(e){return y(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"DELETE"})},listBackgroundProcesses(e){return y(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes`)},stopBackgroundProcess(e,t){return y(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/stop`,{method:"POST"})},terminateBackgroundProcess(e,t){return y(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/terminate`,{method:"POST"})},updateVoiceMode(e,t){const n=jt();return y(`/workspaces/${encodeURIComponent(e)}/plugin/voice-mode`,{method:"POST",body:JSON.stringify({...n,enabled:t})})},sendClientConnectionPong(e){return y("/api/client-connections/pong",{method:"POST",body:JSON.stringify(e)})},fetchBackgroundProcessOutput(e,t,n){const r=new URLSearchParams;n!=null&&n.method&&r.set("method",n.method),n!=null&&n.pattern&&r.set("pattern",n.pattern),n!=null&&n.lines&&r.set("lines",String(n.lines)),(n==null?void 0:n.maxBytes)!==void 0&&r.set("maxBytes",String(n.maxBytes));const o=r.toString(),s=o?`?${o}`:"";return y(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/output${s}`)},connectEvents(e,t,n){const r=jt(),o=Li(r);et.info(`Connecting to ${o}`);const s=new EventSource(o,{withCredentials:!0});return s.onmessage=i=>{try{const a=JSON.parse(i.data);e(a)}catch(a){et.error("Failed to parse event",a)}},s.onerror=()=>{et.warn("EventSource error, closing stream"),t==null||t()},s.addEventListener("codenomad.client.ping",i=>{try{const a=i.data?JSON.parse(i.data):{};n==null||n(a)}catch(a){et.error("Failed to parse ping event",a)}}),s}};function Li(e){const t=new URL(Mt,typeof window<"u"?window.location.origin:"http://localhost");return t.searchParams.set("clientId",e.clientId),t.searchParams.set("connectionId",e.connectionId),Mt.startsWith("http://")||Mt.startsWith("https://")?t.toString():`${t.pathname}${t.search}`}const Tn=1e3,Fi=1e4,zt=pe("sse");function tt(e,t){if(t){zt.info(e,t);return}zt.info(e)}class Di{constructor(){this.handlers=new Map,this.openHandlers=new Set,this.source=null,this.retryDelay=Tn,this.connect()}connect(){this.source&&this.source.close(),tt("Connecting to backend events stream"),this.source=X.connectEvents(t=>this.dispatch(t),()=>this.scheduleReconnect(),t=>{X.sendClientConnectionPong({...jt(),pingTs:t.ts}).catch(n=>{zt.error("Failed to send client connection pong",n)})}),this.source.onopen=()=>{tt("Events stream connected"),this.retryDelay=Tn,this.openHandlers.forEach(t=>t())}}scheduleReconnect(){this.source&&(this.source.close(),this.source=null),tt("Events stream disconnected, scheduling reconnect",{delayMs:this.retryDelay}),setTimeout(()=>{this.retryDelay=Math.min(this.retryDelay*2,Fi),this.connect()},this.retryDelay)}dispatch(t){var n,r;tt(`event ${t.type}`),(n=this.handlers.get("*"))==null||n.forEach(o=>o(t)),(r=this.handlers.get(t.type))==null||r.forEach(o=>o(t))}on(t,n){this.handlers.has(t)||this.handlers.set(t,new Set);const r=this.handlers.get(t);return r.add(n),()=>r.delete(n)}onOpen(t){return this.openHandlers.add(t),()=>this.openHandlers.delete(t)}}const Lt=new Di,Ri=pe("actions"),En={messageHistory:[],agentModelSelections:{}};function Pn(e,t){if(e===t)return!0;if(typeof e=="object"&&e!==null&&typeof t=="object"&&t!==null)try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){Ri.warn("Failed to compare config objects",n)}return!1}class Ni{constructor(){this.configOwnerCache=new Map,this.stateOwnerCache=new Map,this.configOwnerLoadPromises=new Map,this.stateOwnerLoadPromises=new Map,this.configOwnerListeners=new Map,this.stateOwnerListeners=new Map,this.instanceDataCache=new Map,this.instanceDataListeners=new Map,this.instanceLoadPromises=new Map,Lt.on("storage.configChanged",t=>{t.type==="storage.configChanged"&&this.setOwnerCache("config",t.owner,t.value)}),Lt.on("storage.stateChanged",t=>{t.type==="storage.stateChanged"&&this.setOwnerCache("state",t.owner,t.value)}),Lt.on("instance.dataChanged",t=>{t.type==="instance.dataChanged"&&this.setInstanceDataCache(t.instanceId,t.data)})}async loadConfigOwner(t){const n=this.configOwnerCache.get(t);if(n)return n;if(!this.configOwnerLoadPromises.has(t)){const r=X.fetchConfigOwner(t).then(o=>(this.setOwnerCache("config",t,o),o)).finally(()=>{this.configOwnerLoadPromises.delete(t)});this.configOwnerLoadPromises.set(t,r)}return this.configOwnerLoadPromises.get(t)}async patchConfigOwner(t,n){const r=await X.patchConfigOwner(t,n);return this.setOwnerCache("config",t,r),r}async loadStateOwner(t){const n=this.stateOwnerCache.get(t);if(n)return n;if(!this.stateOwnerLoadPromises.has(t)){const r=X.fetchStateOwner(t).then(o=>(this.setOwnerCache("state",t,o),o)).finally(()=>{this.stateOwnerLoadPromises.delete(t)});this.stateOwnerLoadPromises.set(t,r)}return this.stateOwnerLoadPromises.get(t)}async patchStateOwner(t,n){const r=await X.patchStateOwner(t,n);return this.setOwnerCache("state",t,r),r}async loadInstanceData(t){const n=this.instanceDataCache.get(t);if(n)return n;if(!this.instanceLoadPromises.has(t)){const r=X.readInstanceData(t).then(o=>{const s=this.normalizeInstanceData(o);return this.setInstanceDataCache(t,s),s}).finally(()=>{this.instanceLoadPromises.delete(t)});this.instanceLoadPromises.set(t,r)}return this.instanceLoadPromises.get(t)}async saveInstanceData(t,n){const r=this.normalizeInstanceData(n);await X.writeInstanceData(t,r),this.setInstanceDataCache(t,r)}async deleteInstanceData(t){await X.deleteInstanceData(t),this.setInstanceDataCache(t,En)}onConfigOwnerChanged(t,n){this.configOwnerListeners.has(t)||this.configOwnerListeners.set(t,new Set);const r=this.configOwnerListeners.get(t);r.add(n);const o=this.configOwnerCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.configOwnerListeners.delete(t)}}onStateOwnerChanged(t,n){this.stateOwnerListeners.has(t)||this.stateOwnerListeners.set(t,new Set);const r=this.stateOwnerListeners.get(t);r.add(n);const o=this.stateOwnerCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.stateOwnerListeners.delete(t)}}onInstanceDataChanged(t,n){this.instanceDataListeners.has(t)||this.instanceDataListeners.set(t,new Set);const r=this.instanceDataListeners.get(t);r.add(n);const o=this.instanceDataCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.instanceDataListeners.delete(t)}}setOwnerCache(t,n,r){if(n==="*"){t==="config"?this.configOwnerCache.clear():this.stateOwnerCache.clear();return}const o=t==="config"?this.configOwnerCache:this.stateOwnerCache,s=t==="config"?this.configOwnerListeners:this.stateOwnerListeners,i=o.get(n);if(i&&Pn(i,r)){o.set(n,r);return}o.set(n,r);const a=s.get(n);if(a)for(const c of a)c(r)}normalizeInstanceData(t){const n=t??En,r=Array.isArray(n.messageHistory)?[...n.messageHistory]:[],o={...n.agentModelSelections??{}};return{...n,messageHistory:r,agentModelSelections:o}}setInstanceDataCache(t,n){const r=this.normalizeInstanceData(n),o=this.instanceDataCache.get(t);if(o&&Pn(o,r)){this.instanceDataCache.set(t,r);return}this.instanceDataCache.set(t,r),this.notifyInstanceDataChanged(t,r)}notifyInstanceDataChanged(t,n){const r=this.instanceDataListeners.get(t);if(r)for(const o of r)o(n)}}const G=new Ni,vr=pe("api"),xt={messageHistory:[],agentModelSelections:{}},[nn,kr]=E(new Map),nt=new Map,Ee=new Map;function $r(e){const t=e??xt;return{...t,messageHistory:Array.isArray(t.messageHistory)?[...t.messageHistory]:[],agentModelSelections:{...t.agentModelSelections??{}}}}function Mn(e){if(Ee.has(e))return;const t=G.onInstanceDataChanged(e,n=>{ft(e,n)});Ee.set(e,t)}function Bi(e){const t=Ee.get(e);t&&(t(),Ee.delete(e))}function ft(e,t){kr(n=>{const r=new Map(n);return r.set(e,$r(t)),r})}async function Ot(e){if(!e||nn().has(e))return;if(nt.has(e)){await nt.get(e);return}const t=G.loadInstanceData(e).then(n=>{ft(e,n),Mn(e)}).catch(n=>{vr.warn("Failed to load instance data",n),ft(e,xt),Mn(e)}).finally(()=>{nt.delete(e)});nt.set(e,t),await t}async function Ar(e,t){if(!e)return;await Ot(e);const n=nn().get(e)??xt,r=$r(n);t(r);try{await G.saveInstanceData(e,r)}catch(o){vr.warn("Failed to persist instance data",o)}ft(e,r)}function Ir(e){return nn().get(e)??xt}function Ui(e){kr(t=>{if(!t.has(e))return t;const n=new Map(t);return n.delete(e),n}),Bi(e)}const _i=Me(),ji={getInstanceConfig:Ir,ensureInstanceConfig:Ot,updateInstanceConfig:Ar,clearInstanceConfig:Ui},zc=e=>(ie(()=>{for(const t of Ee.values())t();Ee.clear()}),ae(_i.Provider,{value:ji,get children(){return e.children}})),Vi=pe("api"),[Ln,Kt]=E(null),[Kc,Fn]=E(!1),[Hc,it]=E(null);let Fe=null;async function Wi(e=!1){return!e&&Ln()?Ln():Fe||(Fn(!0),it(null),Fe=X.fetchSpeechCapabilities().then(t=>(Kt(t),it(null),t)).catch(t=>(Vi.error("Failed to load speech capabilities",t),Kt(null),it(t instanceof Error?t.message:String(t)),null)).finally(()=>{Fn(!1),Fe=null}),Fe)}function zi(){Kt(null),it(null)}const I=pe("actions"),Ki=20,Hi=5,Gi=50,M={showThinkingBlocks:!1,showKeyboardShortcutHints:!0,thinkingBlocksExpansion:"expanded",showTimelineTools:!0,holdLongAssistantReplies:!0,promptSubmitOnEnter:!1,showPromptVoiceInput:!0,diffViewMode:"split",toolOutputExpansion:"expanded",diagnosticsExpansion:"expanded",toolInputsVisibility:"collapsed",showUsageMetrics:!0,autoCleanupBlankSessions:!0,osNotificationsEnabled:!1,osNotificationsAllowWhenVisible:!1,notifyOnNeedsInput:!0,notifyOnIdle:!0},we={provider:"openai-compatible",sttModel:"gpt-4o-mini-transcribe",ttsModel:"gpt-4o-mini-tts",ttsVoice:"alloy",playbackMode:"streaming",ttsFormat:"mp3"};function Tr(e){const t=e??{};return{showThinkingBlocks:t.showThinkingBlocks??M.showThinkingBlocks,showKeyboardShortcutHints:t.showKeyboardShortcutHints??M.showKeyboardShortcutHints,thinkingBlocksExpansion:t.thinkingBlocksExpansion??M.thinkingBlocksExpansion,showTimelineTools:t.showTimelineTools??M.showTimelineTools,holdLongAssistantReplies:t.holdLongAssistantReplies??M.holdLongAssistantReplies,promptSubmitOnEnter:t.promptSubmitOnEnter??M.promptSubmitOnEnter,showPromptVoiceInput:t.showPromptVoiceInput??M.showPromptVoiceInput,locale:t.locale??M.locale,diffViewMode:t.diffViewMode??M.diffViewMode,toolOutputExpansion:t.toolOutputExpansion??M.toolOutputExpansion,diagnosticsExpansion:t.diagnosticsExpansion??M.diagnosticsExpansion,toolInputsVisibility:t.toolInputsVisibility==="hidden"||t.toolInputsVisibility==="collapsed"||t.toolInputsVisibility==="expanded"?t.toolInputsVisibility:M.toolInputsVisibility,showUsageMetrics:t.showUsageMetrics??M.showUsageMetrics,autoCleanupBlankSessions:t.autoCleanupBlankSessions??M.autoCleanupBlankSessions,osNotificationsEnabled:t.osNotificationsEnabled??M.osNotificationsEnabled,osNotificationsAllowWhenVisible:t.osNotificationsAllowWhenVisible??M.osNotificationsAllowWhenVisible,notifyOnNeedsInput:t.notifyOnNeedsInput??M.notifyOnNeedsInput,notifyOnIdle:t.notifyOnIdle??M.notifyOnIdle}}function Er(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[n,r]of Object.entries(e))typeof r=="string"&&(t[n]=r);return t}function Pr(e){const t=e??{};return{provider:t.provider==="openai-compatible"?t.provider:we.provider,apiKey:typeof t.apiKey=="string"&&t.apiKey.trim()?t.apiKey.trim():void 0,hasApiKey:t.hasApiKey===!0||typeof t.apiKey=="string"&&t.apiKey.trim().length>0,baseUrl:typeof t.baseUrl=="string"&&t.baseUrl.trim()?t.baseUrl.trim():void 0,sttModel:typeof t.sttModel=="string"&&t.sttModel.trim()?t.sttModel.trim():we.sttModel,ttsModel:typeof t.ttsModel=="string"&&t.ttsModel.trim()?t.ttsModel.trim():we.ttsModel,ttsVoice:typeof t.ttsVoice=="string"&&t.ttsVoice.trim()?t.ttsVoice.trim():we.ttsVoice,playbackMode:t.playbackMode==="buffered"||t.playbackMode==="streaming"?t.playbackMode:we.playbackMode,ttsFormat:t.ttsFormat==="wav"||t.ttsFormat==="opus"||t.ttsFormat==="aac"||t.ttsFormat==="mp3"?t.ttsFormat:we.ttsFormat}}function De(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){const o=t(r);o&&n.push(o)}return n}function Ji(e){var n,r,o;const t=e??{};return{recentFolders:De(t.recentFolders,s=>{if(!s||typeof s!="object")return null;const i=s.path,a=s.lastAccessed;if(typeof i!="string")return null;const c=typeof a=="number"?a:Date.now();return{path:i,lastAccessed:c}}),opencodeBinaries:De(t.opencodeBinaries,s=>{if(!s||typeof s!="object")return null;const i=s.path;if(typeof i!="string")return null;const a=typeof s.lastUsed=="number"?s.lastUsed:Date.now(),c=typeof s.version=="string"?s.version:void 0,u=typeof s.label=="string"?s.label:void 0;return{path:i,version:c,label:u,lastUsed:a}}),remoteServers:De(t.remoteServers,s=>{if(!s||typeof s!="object")return null;const i=typeof s.id=="string"?s.id.trim():"",a=typeof s.name=="string"?s.name.trim():"",c=typeof s.baseUrl=="string"?s.baseUrl.trim():"";if(!i||!a||!c)return null;const u=typeof s.createdAt=="string"?s.createdAt:new Date().toISOString(),l=typeof s.updatedAt=="string"?s.updatedAt:u,d=typeof s.lastConnectedAt=="string"?s.lastConnectedAt:void 0;return{id:i,name:a,baseUrl:c,skipTlsVerify:!!s.skipTlsVerify,createdAt:u,updatedAt:l,lastConnectedAt:d}}).sort((s,i)=>{const a=s.lastConnectedAt??s.updatedAt;return(i.lastConnectedAt??i.updatedAt).localeCompare(a)}),models:{recents:De((n=t.models)==null?void 0:n.recents,s=>{if(!s||typeof s!="object")return null;const i=s.providerId,a=s.modelId;return typeof i!="string"||typeof a!="string"?null:{providerId:i,modelId:a}}),favorites:De((r=t.models)==null?void 0:r.favorites,s=>{if(!s||typeof s!="object")return null;const i=s.providerId,a=s.modelId;return typeof i!="string"||typeof a!="string"?null:{providerId:i,modelId:a}}),thinkingSelections:Er((o=t.models)==null?void 0:o.thinkingSelections)}}}function qi(e){const t=e??{},n=t.listeningMode==="all"?"all":"local",r=t.logLevel==="INFO"||t.logLevel==="WARN"||t.logLevel==="ERROR"||t.logLevel==="DEBUG"?t.logLevel:"DEBUG",o=typeof t.opencodeBinary=="string"&&t.opencodeBinary.trim()?t.opencodeBinary:"opencode",s=Er(t.environmentVariables),i=Pr(t.speech);return{listeningMode:n,logLevel:r,opencodeBinary:o,environmentVariables:s,speech:i}}function Mr(e){return`${e.providerId}/${e.modelId}`}function Lr(e,t){const n=t.filter(r=>r.path!==e);return n.unshift({path:e,lastAccessed:Date.now()}),n.slice(0,Ki)}function rn(e,t,n){const r=Date.now(),o=n.find(i=>i.path===e);if(o){const i={...o,lastUsed:r,version:t??o.version},a=n.filter(c=>c.path!==e);return[i,...a]}return[t?{path:e,version:t,lastUsed:r}:{path:e,lastUsed:r},...n].slice(0,10)}function Xi(e,t){const n=e.id?t.find(o=>o.id===e.id):void 0,r=new Date().toISOString();return{id:(n==null?void 0:n.id)??e.id??Yi(),name:e.name.trim(),baseUrl:e.baseUrl.trim(),skipTlsVerify:!!e.skipTlsVerify,createdAt:(n==null?void 0:n.createdAt)??r,updatedAt:r,lastConnectedAt:n==null?void 0:n.lastConnectedAt}}function Fr(e,t){const n=t.filter(r=>r.id!==e.id);return[e,...n].sort((r,o)=>{const s=r.lastConnectedAt??r.updatedAt;return(o.lastConnectedAt??o.updatedAt).localeCompare(s)})}function Yi(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`remote-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}const[on,gt]=E({}),[Zi,ht]=E({}),[Qi,pt]=E({}),[Dr,_e]=E(!1),ea=F(()=>Tr(on().settings)),Rr=F(()=>on().theme??"system"),me=F(()=>qi(Zi())),ee=F(()=>Ji(Qi())),j=ea,vt=F(()=>ee().recentFolders),Je=F(()=>ee().opencodeBinaries),Pe=F(()=>ee().remoteServers);let rt=null;async function kt(){Dr()||(rt||(rt=Promise.all([G.loadConfigOwner("ui"),G.loadConfigOwner("server"),G.loadStateOwner("ui")]).then(([e,t,n])=>{gt(e),ht(t),pt(n),_e(!0)}).catch(e=>{I.error("Failed to load settings",e),gt({}),ht({}),pt({}),_e(!0)}).finally(()=>{rt=null})),await rt)}async function ne(e,t){await kt();const n=await G.patchConfigOwner(e,t);e==="ui"&>(n),e==="server"&&ht(n)}async function z(e,t){await kt();const n=await G.patchStateOwner(e,t);pt(n)}function K(e){const t=on(),r={settings:Tr({...t.settings??{},...e})};ne("ui",r).catch(o=>I.error("Failed to patch ui settings",o))}function Nr(e){K(e)}function ta(e){Rr()!==e&&ne("ui",{theme:e}).catch(t=>I.error("Failed to set theme",t))}async function na(e){me().listeningMode!==e&&await ne("server",{listeningMode:e})}function sn(e){ne("server",{environmentVariables:e}).catch(t=>I.error("Failed to update environment variables",t))}function ra(e,t){const n=me().environmentVariables;sn({...n,[e]:t})}function oa(e){const t=me().environmentVariables,{[e]:n,...r}=t;sn(r)}function sa(e){const t=e&&e.trim().length>0?e:"opencode";ne("server",{opencodeBinary:t}).catch(r=>I.error("Failed to set default binary",r));const n=rn(t,void 0,Je());z("ui",{opencodeBinaries:n}).catch(r=>I.error("Failed to update binary list",r))}function ia(e){ne("server",{logLevel:e??"DEBUG"}).catch(n=>I.error("Failed to set log level",n))}async function aa(e){const t=e.apiKey,{apiKey:n,...r}=e,o=Pr({...me().speech,...r,...t===null?{}:{apiKey:t}}),{hasApiKey:s,...i}=o,a={...i,...t===null?{apiKey:null}:{}};try{await ne("server",{speech:a})}catch(c){throw I.error("Failed to update speech settings",c),c}}function ca(e,t){const n=rn(e,t,Je());z("ui",{opencodeBinaries:n}).catch(r=>I.error("Failed to add binary",r))}function la(e){const t=Je().filter(n=>n.path!==e);z("ui",{opencodeBinaries:t}).catch(n=>I.error("Failed to remove binary",n)),me().opencodeBinary===e&&ne("server",{opencodeBinary:"opencode"}).catch(n=>I.error("Failed to reset default binary",n))}function ua(e){const t=Lr(e,vt());z("ui",{recentFolders:t}).catch(n=>I.error("Failed to add recent folder",n))}function da(e){const t=vt().filter(n=>n.path!==e);z("ui",{recentFolders:t}).catch(n=>I.error("Failed to remove recent folder",n))}async function fa(e){const t=Xi(e,Pe());return await z("ui",{remoteServers:Fr(t,Pe())}),t}async function ga(e){const t=Pe().find(o=>o.id===e);if(!t)return;const n=new Date().toISOString(),r={...t,updatedAt:n,lastConnectedAt:n};await z("ui",{remoteServers:Fr(r,Pe())})}function ha(e){const t=Pe().filter(n=>n.id!==e);z("ui",{remoteServers:t}).catch(n=>I.error("Failed to remove remote server",n))}function pa(e,t){const n=t&&t.trim().length>0?t:me().opencodeBinary,r=Lr(e,vt()),o=rn(n,void 0,Je());z("ui",{recentFolders:r,opencodeBinaries:o}).catch(s=>I.error("Failed to update ui state on launch",s)),ne("server",{opencodeBinary:n}).catch(s=>I.error("Failed to persist selected binary",s))}function ma(e){if(!e.providerId||!e.modelId)return;const n=ee().models.recents.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId),r=[e,...n].slice(0,Hi);z("ui",{models:{recents:r}}).catch(o=>I.error("Failed to update model recents",o))}function ya(e){return!e.providerId||!e.modelId?!1:ee().models.favorites.some(t=>t.providerId===e.providerId&&t.modelId===e.modelId)}function ba(e){if(!e.providerId||!e.modelId)return;const t=ee().models.favorites,r=t.some(o=>o.providerId===e.providerId&&o.modelId===e.modelId)?t.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId):[e,...t.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId)].slice(0,Gi);z("ui",{models:{favorites:r}}).catch(o=>I.error("Failed to update model favorites",o))}function wa(e){if(!(!e.providerId||!e.modelId))return ee().models.thinkingSelections[Mr(e)]}function Ca(e,t){if(!e.providerId||!e.modelId)return;const n=Mr(e);if(ee().models.thinkingSelections[n]===t)return;const o={...ee().models.thinkingSelections};t?o[n]=t:delete o[n],z("ui",{models:{thinkingSelections:o}}).catch(s=>I.error("Failed to update thinking selection",s))}function Sa(e){j().diffViewMode!==e&&K({diffViewMode:e})}function xa(e){j().toolOutputExpansion!==e&&K({toolOutputExpansion:e})}function Oa(e){j().diagnosticsExpansion!==e&&K({diagnosticsExpansion:e})}function va(e){j().toolInputsVisibility!==e&&K({toolInputsVisibility:e})}function ka(e){j().thinkingBlocksExpansion!==e&&K({thinkingBlocksExpansion:e})}function $a(){K({showThinkingBlocks:!j().showThinkingBlocks})}function Aa(){Nr({showKeyboardShortcutHints:!j().showKeyboardShortcutHints})}function Ia(){K({showTimelineTools:!j().showTimelineTools})}function Ta(){K({showUsageMetrics:!j().showUsageMetrics})}function Ea(){K({promptSubmitOnEnter:!j().promptSubmitOnEnter})}function Pa(){K({showPromptVoiceInput:!j().showPromptVoiceInput})}function Ma(){const e=!j().autoCleanupBlankSessions;I.info("toggle auto cleanup",{value:e}),K({autoCleanupBlankSessions:e})}async function La(e,t,n){!e||!t||!n.providerId||!n.modelId||(await Ot(e),await Ar(e,r=>{const o={...r.agentModelSelections??{}},s=o[t];s&&s.providerId===n.providerId&&s.modelId===n.modelId||(o[t]=n,r.agentModelSelections=o)}))}async function Fa(e,t){return!e||!t?void 0:(await Ot(e),(Ir(e).agentModelSelections??{})[t])}kt().catch(e=>{I.error("Failed to initialize settings",e)});const Br=Me(),Da={isLoaded:Dr,preferences:j,updatePreferences:Nr,themePreference:Rr,setThemePreference:ta,serverSettings:me,setListeningMode:na,updateEnvironmentVariables:sn,addEnvironmentVariable:ra,removeEnvironmentVariable:oa,updateLastUsedBinary:sa,updateLogLevel:ia,updateSpeechSettings:aa,recentFolders:vt,opencodeBinaries:Je,remoteServers:Pe,uiState:ee,addRecentFolder:ua,removeRecentFolder:da,addOpenCodeBinary:ca,removeOpenCodeBinary:la,saveRemoteServerProfile:fa,markRemoteServerConnected:ga,removeRemoteServerProfile:ha,recordWorkspaceLaunch:pa,addRecentModelPreference:ma,isFavoriteModelPreference:ya,toggleFavoriteModelPreference:ba,getModelThinkingSelection:wa,setModelThinkingSelection:Ca,toggleShowThinkingBlocks:$a,toggleKeyboardShortcutHints:Aa,toggleShowTimelineTools:Ia,toggleUsageMetrics:Ta,toggleAutoCleanupBlankSessions:Ma,togglePromptSubmitOnEnter:Ea,toggleShowPromptVoiceInput:Pa,setDiffViewMode:Sa,setToolOutputExpansion:xa,setDiagnosticsExpansion:Oa,setThinkingBlocksExpansion:ka,setToolInputsVisibility:va,setAgentModelPreference:La,getAgentModelPreference:Fa},Gc=e=>(yt(()=>{kt().catch(o=>{I.error("Failed to initialize settings",o)});const t=G.onConfigOwnerChanged("ui",o=>{gt(o),_e(!0)}),n=G.onConfigOwnerChanged("server",o=>{ht(o),_e(!0),zi(),Wi(!0)}),r=G.onStateOwnerChanged("ui",o=>{pt(o),_e(!0)});return()=>{t(),n(),r()}}),ae(Br.Provider,{value:Da,get children(){return e.children}}));function Ra(){const e=Ke(Br);if(!e)throw new Error("useConfig must be used within ConfigProvider");return e}function Na(e,t,n){const r={};return Object.keys(e).forEach(o=>{r[o]=e[o].reduce((s,i)=>(i&&(n&&n[i]&&s.push(n[i]),s.push(t(i))),s),[]).join(" ")}),r}const Ba=Symbol("solid-inspect"),Ua=Me();function _a(e){function t(n){var r;return(r=Ke(Ua))!=null&&r.enabled?{Component:t,props:n,$INSPECT:Ba}:e(n)}return Object.defineProperty(t,"name",{value:e.name}),t.toString=e.toString,t}function Ur(){return function(e){function t(a){const c=!!e.slotClasses,u=()=>{if(!e.slotClasses)throw new Error("'slotClasses' option is not defined");if(!e.utilityClass)throw new Error("'utilityClass' option is not defined");return Na(e.slotClasses(a),e.utilityClass,a.classes??"")},l=Mo({});return c&&to(()=>{const d=u();xe(()=>{for(const g in d)l[g]=d[g]})}),l}function n(a){const[c,u]=mt(a,e.selfPropNames);return{allProps:a,props:c,otherProps:u}}function r(a){return Ss({propDefaults:a.propDefaults||e.propDefaults,props:a.props,name:e.name})}function o(a){const c=r({props:a});return n(c)}function s(a,c=!0){return a=_a(a),a.toString=()=>`.${e.name}-root`,c&&wr(a,"base"),a}function i(a){const c=s(function(l){const{allProps:d,otherProps:g,props:m}=o(l),p=e.autoCallUseClasses??!0?t(d):{};return a({allProps:d,otherProps:g,props:m,classes:p})});return Object.defineProperty(c,"name",{value:a.name}),c}return{name:e.name,selfPropNames:e.selfPropNames,component:i,defineComponent:s,useClasses:t,useThemeProps:r,useProps:o,splitInProps:n}}}const ja=Ur()({name:"MuiGlobalStyles",selfPropNames:["styles"]}),Va=ja.component(function({props:t}){return gr(()=>({"@global":t.styles||{}})),[]}),Wa=Ur()({name:"MuiCssBaseline",selfPropNames:["children","enableColorScheme"],propDefaults:({set:e})=>e({enableColorScheme:!1})}),za=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&{colorScheme:e.palette.mode}}),Ka=e=>({color:e.palette.text.primary,...e.typography.body1,backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}}),Ha=(e,t=!1)=>({html:za(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...Ka(e),"&::backdrop":{backgroundColor:e.palette.background.default}}}),Ga=Wa.component(function({props:t}){const n=or();return ae(Va,{get styles(){return Ha(n,t.enableColorScheme)}})}),_r=Me();function Dn(e){if(!(typeof document>"u")){if(e==="system"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}const Ja={backgroundDefault:"#ffffff",backgroundPaper:"#f5f5f5",primary:"#0066ff",primaryContrast:"#ffffff",textPrimary:"#1a1a1a",textSecondary:"#666666",divider:"#e0e0e0"},qa={backgroundDefault:"#1a1a1a",backgroundPaper:"#2a2a2a",primary:"#0080ff",primaryContrast:"#1a1a1a",textPrimary:"#cfd4dc",textSecondary:"#999999",divider:"#3a3a3a"},le=(e,t,n)=>{if(!n)return t;const r=n.getPropertyValue(e);return r&&r.trim()||t},Xa=e=>{const t=e?qa:Ja,n=typeof window<"u"?getComputedStyle(document.documentElement):null;return{backgroundDefault:le("--surface-base",t.backgroundDefault,n),backgroundPaper:le("--surface-secondary",t.backgroundPaper,n),primary:le("--accent-primary",t.primary,n),primaryContrast:le("--text-inverted",t.primaryContrast,n),textPrimary:le("--text-primary",t.textPrimary,n),textSecondary:le("--text-secondary",t.textSecondary,n),divider:le("--border-base",t.divider,n)}};function Jc(e){const t=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,{themePreference:n,setThemePreference:r}=Ra(),[o,s]=E(!0),[i,a]=E(0),c=()=>n(),u=()=>{const p=c();return p==="dark"?!0:p==="light"?!1:(t==null?void 0:t.matches)??!1},l=()=>{const p=c(),S=u();Dn(p==="system"?"system":p),s(S),typeof window<"u"?requestAnimationFrame(()=>a(w=>w+1)):a(w=>w+1)};Y(()=>{l()}),yt(()=>{if(!t)return;const p=()=>{l()};return t.addEventListener("change",p),()=>{t.removeEventListener("change",p)}});const d=p=>{r(p)},g=()=>{const p=c();d(p==="system"?"light":p==="light"?"dark":"system")},m=F(()=>{i();const p=Xa(o());return tr({palette:{mode:o()?"dark":"light",primary:{main:p.primary,contrastText:p.primaryContrast},secondary:{main:p.primary},background:{default:p.backgroundDefault,paper:p.backgroundPaper},text:{primary:p.textPrimary,secondary:p.textSecondary},divider:p.divider},typography:{fontFamily:"var(--font-family-sans)"},shape:{borderRadius:8},components:{MuiIconButton:{styleOverrides:{root:{color:"inherit","&.Mui-disabled":{color:"var(--text-muted)",opacity:.55}}}},MuiDrawer:{styleOverrides:{paper:{backgroundColor:"var(--surface-secondary)",color:"var(--text-primary)"}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:"var(--surface-secondary)",color:"var(--text-primary)",boxShadow:"none",borderBottom:"1px solid var(--border-base)",zIndex:10}}},MuiToolbar:{styleOverrides:{root:{minHeight:"56px"}}}}})});return ae(_r.Provider,{value:{isDark:o,themeMode:c,setThemeMode:d,cycleThemeMode:g},get children(){return ae(xs,{get theme(){return m()},get children(){return[ae(Ga,{}),go(()=>e.children)]}})}})}function jr(){const e=Ke(_r);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const Ya=/(^|\n)@@/m,Za=/(^|\n)(diff --git |--- |\+\+\+)/,Qa=/^\*\*\* (Begin|End) Patch/,ec=/^\*\*\* Update File: (.+)$/,tc=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function nc(e){const t=e.trim();if(!t.startsWith("```"))return t;const n=t.split(`
|
|
16
|
-
`);return n.length<2?"":n[n.length-1].startsWith("```")?n.slice(1,-1).join(`
|
|
17
|
-
`):t}function rc(e){var s;if(!e)return"";const n=nc(e.replace(/\r\n/g,`
|
|
18
|
-
`)).split(`
|
|
19
|
-
`).map(i=>i.replace(/\s+$/u,""));let r=null;const o=[];for(const i of n){if(!i||Qa.test(i))continue;const a=i.match(ec);if(a){r=((s=a[1])==null?void 0:s.trim())||null;continue}o.push(i)}return r&&!Za.test(o.join(`
|
|
20
|
-
`))&&(o.unshift(`+++ b/${r}`),o.unshift(`--- a/${r}`)),o.join(`
|
|
21
|
-
`).trim()}function qc(e){if(!e)return!1;const t=rc(e);return t?Ya.test(t):!1}function oc(e){if(!e||e.trim().length===0)return{before:"",after:""};const t=e.replace(/\r\n/g,`
|
|
22
|
-
`).split(`
|
|
23
|
-
`),n=[],r=[];for(const o of t)o.startsWith("---")||o.startsWith("+++")||o.startsWith("diff --git")||tc.test(o)||(o.startsWith("-")&&!o.startsWith("---")?n.push(o.slice(1)):o.startsWith("+")&&!o.startsWith("+++")?r.push(o.slice(1)):o.startsWith(" ")?(n.push(o.slice(1)),r.push(o.slice(1))):o===""?(n.push(""),r.push("")):(n.push(o),r.push(o)));for(;n.length>0&&n[n.length-1]==="";)n.pop();for(;r.length>0&&r[r.length-1]==="";)r.pop();return{before:n.join(`
|
|
24
|
-
`),after:r.join(`
|
|
25
|
-
`)}}const sc="0.52.2",Ht=`https://cdn.jsdelivr.net/npm/monaco-editor@${sc}/min/vs`,H="/monaco/vs";let ot=null;function ic(e,t){return new Promise((n,r)=>{const o=setTimeout(()=>r(new Error("timeout")),t);e.then(s=>{clearTimeout(o),n(s)}).catch(s=>{clearTimeout(o),r(s)})})}async function ac(){if(typeof fetch>"u")return!1;try{const e=new AbortController,t=fetch(`${Ht}/loader.js`,{method:"HEAD",signal:e.signal}),n=await ic(t,1200);return e.abort(),n.ok}catch{return!1}}function cc(){return typeof document>"u"||document.querySelector('script[data-monaco-loader="true"]')?Promise.resolve():new Promise((t,n)=>{const r=document.createElement("script");r.dataset.monacoLoader="true",r.src=`${H}/loader.js`,r.async=!0,r.onload=()=>t(),r.onerror=()=>n(new Error("Failed to load Monaco AMD loader")),document.head.appendChild(r)})}function lc(){if(typeof document>"u"||document.querySelector('link[data-monaco-editor-css="true"]'))return;const t=document.createElement("link");t.rel="stylesheet",t.href=`${H}/editor/editor.main.css`,t.dataset.monacoEditorCss="true",document.head.appendChild(t)}function uc(){const e=globalThis,t=e.MonacoEnvironment??{},n="/monaco.worker.js";e.MonacoEnvironment={...t,getWorkerUrl(r,o){return n}}}function Vr(){const e=globalThis.require;if(!e)throw new Error("Monaco AMD loader is not available");return e}function dc(){const t=Vr().config;if(!t)throw new Error("require.config is not available");return t}function Gt(e){const t=Vr();return new Promise((n,r)=>{t(e,(...o)=>n(o),o=>r(o))})}function fc(e){const t=String(e||"plaintext");return!t||t==="plaintext"?null:t==="typescript"||t==="javascript"?"vs/language/typescript/monaco.contribution":t==="json"?"vs/language/json/monaco.contribution":t==="css"||t==="scss"||t==="less"?"vs/language/css/monaco.contribution":t==="html"?"vs/language/html/monaco.contribution":t==="toml"?"vs/basic-languages/toml/toml":`vs/basic-languages/${t}/${t}`}const Rn=new Set,Ft=new Map;async function Wr(e){const t=fc(e);if(!t||Rn.has(t))return;const n=Ft.get(t);if(n)return n;const r=(async()=>{let o=!1;try{await Gt([t]),o=!0}catch{}finally{o&&Rn.add(t),Ft.delete(t)}})();return Ft.set(t,r),r}async function zr(){return ot||(ot=(async()=>{await cc(),uc(),lc();const e=await ac(),t=dc(),n={vs:H};e&&(n["vs/basic-languages"]=`${Ht}/basic-languages`,n["vs/language"]=`${Ht}/language`,n["vs/basic-languages/python"]=`${H}/basic-languages/python`,n["vs/basic-languages/markdown"]=`${H}/basic-languages/markdown`,n["vs/basic-languages/cpp"]=`${H}/basic-languages/cpp`,n["vs/basic-languages/kotlin"]=`${H}/basic-languages/kotlin`,n["vs/language/typescript"]=`${H}/language/typescript`,n["vs/language/html"]=`${H}/language/html`,n["vs/language/json"]=`${H}/language/json`,n["vs/language/css"]=`${H}/language/css`),t({paths:n,ignoreDuplicateModules:["vs/editor/editor.main"]});const[r]=await Gt(["vs/editor/editor.main"]);return await Gt(["vs/basic-languages/monaco.contribution"]).catch(()=>[]),globalThis.monaco??r})(),ot)}const gc=5,oe=new Map;function hc(e,t){oe.delete(e),oe.set(e,t)}function pc(){for(;oe.size>gc;){const e=oe.keys().next().value;if(!e)return;const t=oe.get(e);oe.delete(e);try{t==null||t.model.dispose()}catch{}}}function Jt(e){const t=oe.get(e.cacheKey);if(t)return hc(e.cacheKey,t),t.model.getValue()!==e.value&&t.model.setValue(e.value),t.model;const n=e.monaco.Uri.parse(`opencode://model/${encodeURIComponent(e.cacheKey)}`),r=e.monaco.editor.createModel(e.value,"plaintext",n),o={model:r};return oe.set(e.cacheKey,o),pc(),r}let st=null;function mc(e){var o;if(st)return st;const t=new Map,n=new Map,r=typeof((o=e==null?void 0:e.languages)==null?void 0:o.getLanguages)=="function"?e.languages.getLanguages():[];if(Array.isArray(r))for(const s of r){const i=typeof(s==null?void 0:s.id)=="string"?s.id:null;if(!i)continue;const a=Array.isArray(s==null?void 0:s.filenames)?s.filenames:[];for(const u of a)typeof u=="string"&&(t.has(u)||t.set(u,i));const c=Array.isArray(s==null?void 0:s.extensions)?s.extensions:[];for(const u of c)typeof u=="string"&&(n.has(u)||n.set(u,i))}return st={fileNameToId:t,extToId:n},st}function yc(e){return e===".gitignore"||e===".gitattributes"||e===".gitmodules"||e==="Makefile"||e.startsWith("Makefile.")?"shell":null}function Kr(e,t){const n=String(t||"").trim(),r=n.split("/").pop()||n,o=yc(r);if(o)return o;const s=mc(e),i=s.fileNameToId.get(r);if(i)return i;const a=r.lastIndexOf(".");if(a>0){const c=r.slice(a),u=s.extToId.get(c);if(u)return u}return"plaintext"}var bc=qt("<div class=monaco-viewer><div class=git-change-context-overlay>"),wc=qt("<div class=git-change-context-widget-host><button type=button class=git-change-context-widget>+");function Cc(e){const{isDark:t}=jr();let n,r=null,o=null;const[s,i]=E(!1),[a,c]=E(null),[u,l]=E(null),[d,g]=E(!1),[m,p]=E(null),S=F(()=>e.patch!==void 0&&e.patch!==null?oc(e.patch):{before:e.before??"",after:e.after??""}),w=()=>{try{r==null||r.setModel(null)}catch{}try{r==null||r.dispose()}catch{}r=null},P=()=>{var h;return((h=r==null?void 0:r.getModifiedEditor)==null?void 0:h.call(r))??null},R=()=>{const h=u();if(h)return h;if(d()&&a())return{startLine:a(),endLine:a()};const x=a();return x?{startLine:x,endLine:x}:null},k=()=>{var O,b,v,C;const h=P(),x=n;if(!h||!x)return;const $=R();if(!$){p(null);return}try{const T=(O=h.getDomNode)==null?void 0:O.call(h);if(!T){p(null);return}const N=T.querySelector(".margin"),ye=T.querySelector(".monaco-scrollable-element.editor-scrollable"),qe=((b=h.getTopForLineNumber)==null?void 0:b.call(h,$.startLine))??0,Hr=((v=h.getScrollTop)==null?void 0:v.call(h))??0,Gr=Number(((C=h.getOption)==null?void 0:C.call(h,o.editor.EditorOption.lineHeight))??18),an=T.getBoundingClientRect(),cn=x.getBoundingClientRect(),Jr=an.left-cn.left+((N==null?void 0:N.offsetWidth)??(ye==null?void 0:ye.offsetLeft)??0),qr=an.top-cn.top+(qe-Hr)+Gr/2;p({top:qr,left:Jr})}catch{p(null)}};return yt(()=>{let h=!1;(async()=>(o=await zr(),!h&&(!n||!o||(o.editor.setTheme(t()?"vs-dark":"vs"),r=o.editor.createDiffEditor(n,{readOnly:!0,automaticLayout:!0,renderSideBySide:!0,renderSideBySideInlineBreakpoint:0,renderMarginRevertIcon:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,renderWhitespace:"selection",fontSize:13,wordWrap:e.wordWrap==="on"?"on":"off",glyphMargin:!0,folding:!1,lineNumbersMinChars:4,lineDecorationsWidth:12,diffAlgorithm:"legacy",maxComputationTime:1e4}),i(!0),k()))))(),ie(()=>{h=!0,i(!1),w()})}),Y(()=>{!s()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),Y(()=>{var $;if(!s()||!o||!r)return;const h=($=r.getModifiedEditor)==null?void 0:$.call(r);if(!(h!=null&&h.onDidChangeCursorSelection))return;const x=h.onDidChangeCursorSelection(O=>{var v;const b=O==null?void 0:O.selection;if(!b||(v=b.isEmpty)!=null&&v.call(b)){l(null),k();return}l({startLine:Math.min(b.startLineNumber,b.endLineNumber),endLine:Math.max(b.startLineNumber,b.endLineNumber)}),k()});ie(()=>{var O;try{(O=x==null?void 0:x.dispose)==null||O.call(x)}catch{}})}),Y(()=>{var b;if(!s()||!o||!r)return;const h=P();if(!(h!=null&&h.onMouseMove)||!(h!=null&&h.onMouseLeave)||!(h!=null&&h.onMouseDown))return;const x=h.onMouseMove(v=>{var T,N;const C=(N=(T=v==null?void 0:v.target)==null?void 0:T.position)==null?void 0:N.lineNumber;c(typeof C=="number"?C:null),k()}),$=h.onMouseLeave(()=>{d()||c(null),k()}),O=(b=h.onDidScrollChange)==null?void 0:b.call(h,()=>{k()});ie(()=>{var v,C,T;try{(v=x==null?void 0:x.dispose)==null||v.call(x),(C=$==null?void 0:$.dispose)==null||C.call($),(T=O==null?void 0:O.dispose)==null||T.call(O)}catch{}})}),Y(()=>{if(!s()||!o||!r)return;R()||p(null),k()}),Y(()=>{var O,b,v,C,T,N;if(!s()||!o||!r)return;const h=e.viewMode==="unified"?"unified":"split",x=e.contextMode==="collapsed"?"collapsed":"expanded",$=e.wordWrap==="on"?"on":"off";r.updateOptions({renderSideBySide:h==="split",renderSideBySideInlineBreakpoint:0,hideUnchangedRegions:x==="collapsed"?{enabled:!0}:{enabled:!1},wordWrap:$});try{(v=(b=(O=r.getOriginalEditor)==null?void 0:O.call(r))==null?void 0:b.updateOptions)==null||v.call(b,{wordWrap:$})}catch{}try{(N=(T=(C=r.getModifiedEditor)==null?void 0:C.call(r))==null?void 0:T.updateOptions)==null||N.call(T,{wordWrap:$})}catch{}}),Y(()=>{if(!s()||!o||!r)return;const h=Kr(o,e.path),{before:x,after:$}=S(),O=`${e.scopeKey}:diff:${e.path}:before`,b=`${e.scopeKey}:diff:${e.path}:after`,v=Jt({monaco:o,cacheKey:O,value:x}),C=Jt({monaco:o,cacheKey:b,value:$});r.setModel({original:v,modified:C}),Wr(h).then(()=>{try{o.editor.setModelLanguage(v,h),o.editor.setModelLanguage(C,h)}catch{}})}),(()=>{var h=bc(),x=h.firstChild,$=n;return typeof $=="function"?Xt($,h):n=h,ct(x,ae(no,{get when(){return m()},children:O=>(()=>{var b=wc(),v=b.firstChild;return b.addEventListener("mouseleave",()=>{g(!1),k()}),b.addEventListener("mouseenter",()=>{g(!0),k()}),v.$$click=C=>{var N;C.preventDefault(),C.stopPropagation();const T=R();T&&((N=e.onRequestInsertContext)==null||N.call(e,T))},v.$$mousedown=C=>{C.preventDefault(),C.stopPropagation()},se(C=>{var T=`${O().top}px`,N=`${O().left}px`,ye=e.insertContextLabel??"Add git change context to prompt",qe=e.insertContextLabel??"Add git change context to prompt";return T!==C.e&&dn(b,"top",C.e=T),N!==C.t&&dn(b,"left",C.t=N),ye!==C.a&&We(v,"aria-label",C.a=ye),qe!==C.o&&We(v,"title",C.o=qe),C},{e:void 0,t:void 0,a:void 0,o:void 0}),b})()})),h})()}jn(["mousedown","click"]);const Xc=Object.freeze(Object.defineProperty({__proto__:null,MonacoDiffViewer:Cc},Symbol.toStringTag,{value:"Module"}));var Sc=qt("<div class=monaco-viewer>");function xc(e){const{isDark:t}=jr();let n,r=null,o=null;const[s,i]=E(!1),a=()=>{try{r==null||r.setModel(null)}catch{}try{r==null||r.dispose()}catch{}r=null},c=()=>{!r||!e.onSave||e.onSave(r.getValue())};return yt(()=>{let u=!1;(async()=>(o=await zr(),!u&&(!n||!o||(o.editor.setTheme(t()?"vs-dark":"vs"),r=o.editor.create(n,{value:"",language:"plaintext",readOnly:!1,automaticLayout:!0,lineNumbers:"on",minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"off",renderWhitespace:"selection",fontSize:13}),r.addCommand(o.KeyMod.CtrlCmd|o.KeyCode.KeyS,c),r.onDidChangeModelContent(()=>{e.onContentChange&&e.onContentChange(r.getValue())}),i(!0)))))(),ie(()=>{u=!0,i(!1),a()})}),Y(()=>{!s()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),Y(()=>{if(!s()||!o||!r)return;const u=Kr(o,e.path),l=`${e.scopeKey}:file:${e.path}`,d=Jt({monaco:o,cacheKey:l,value:e.content});r.setModel(d),Wr(u).then(()=>{try{o.editor.setModelLanguage(d,u)}catch{}})}),(()=>{var u=Sc(),l=n;return typeof l=="function"?Xt(l,u):n=u,u})()}const Yc=Object.freeze(Object.defineProperty({__proto__:null,MonacoFileViewer:xc},Symbol.toStringTag,{value:"Module"}));export{Ir as $,ma as A,wa as B,Vc as C,Ic as D,j as E,Ot as F,jc as G,Mc as H,Ur as I,ii as J,Fc as K,Uc as L,li as M,br as N,Lc as O,Ac as P,Rc as Q,Ds as R,Nc as S,Dc as T,_c as U,Mo as V,Bc as W,No as X,Ro as Y,jr as Z,qc as _,yo as a,Ar as a0,Wc as a1,ba as a2,Ca as a3,na as a4,Kc as a5,Hc as a6,G as a7,$c as a8,zc as a9,Jc as aa,Gc as ab,rc as ac,Xc as ad,Yc as ae,Vn as b,Tc as c,We as d,or as e,jn as f,dn as g,X as h,ct as i,bo as j,pe as k,Ra as l,go as m,wo as n,Lt as o,Pc as p,Fa as q,ee as r,Co as s,qt as t,Xt as u,Ec as v,Wi as w,Ln as x,me as y,La as z};
|