@neuralnomads/codenomad-dev 0.14.0-dev-20260416-657e78da → 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/dist/server/http-server.js +2 -31
- package/dist/server/routes/workspaces.js +118 -0
- package/dist/workspaces/git-mutations.js +98 -0
- package/dist/workspaces/git-status.js +323 -0
- package/dist/workspaces/git-worktrees.js +18 -1
- package/dist/workspaces/worktree-directory.js +74 -0
- package/package.json +1 -1
- package/public/assets/{ChangesTab-CFkk3tAp.js → ChangesTab-DUZlwLiK.js} +2 -2
- package/public/assets/{DiffToolbar-CQQLR1mp.js → DiffToolbar-C32dRoEE.js} +1 -1
- package/public/assets/{FilesTab-CXgucPtN.js → FilesTab-BHR_yoxs.js} +2 -2
- package/public/assets/GitChangesTab-glvFfIqf.js +2 -0
- package/public/assets/{SplitFilePanel-CupweEA5.js → SplitFilePanel-c1Cyzd2Q.js} +1 -1
- package/public/assets/StatusTab-D_y6grlM.js +1 -0
- package/public/assets/{bundle-full-B-5u6Iv3.js → bundle-full-xErn6pK2.js} +1 -1
- package/public/assets/{diff-viewer-_ehhYA-Z.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-BqiNjV6R.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-CxQr-wOF.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-Dck2H3XH.js → loading-8z6r7QGU.js} +1 -1
- package/public/assets/main-BL6QgWzz.js +48 -0
- package/public/assets/{markdown-CFV9kR80.js → markdown-CN__9g8I.js} +3 -3
- package/public/assets/monaco-viewer-C8arwHE9.js +26 -0
- package/public/assets/{todo-Ghwirj-b.js → todo-CGjayFGz.js} +1 -1
- package/public/assets/{tool-call-BC2Pv3uG.js → tool-call-Wyw279OP.js} +3 -3
- package/public/assets/{unified-picker-Dw0kTXoT.js → unified-picker-DqT__5EQ.js} +1 -1
- package/public/assets/{wrap-text-D2MJk2ad.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/GitChangesTab-BidSb28_.js +0 -2
- package/public/assets/StatusTab-C2Pl_Vce.js +0 -1
- package/public/assets/index-BnfDkr8C.js +0 -1
- package/public/assets/index-BntAaLZs.js +0 -1
- package/public/assets/index-BwCEJ4BE.css +0 -1
- package/public/assets/index-DXaitXVC.js +0 -1
- package/public/assets/index-DzRzoTK8.js +0 -2
- package/public/assets/index-ShHad48G.js +0 -1
- package/public/assets/index-_EaXFUIj.js +0 -1
- package/public/assets/index-mMh5TJvW.js +0 -1
- package/public/assets/main-BsIf5lOY.js +0 -50
- package/public/assets/monaco-viewer-CMM6n0T3.js +0 -25
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var Lr=Object.defineProperty;var Rr=(e,t,n)=>t in e?Lr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ue=(e,t,n)=>Rr(e,typeof t!="symbol"?t+"":t,n);import{c as v,u as Me,a as Q,s as ot,b as ee,r as Nr,d as k,e as kn,o as be,g as Yt,f as x,$ as E,h as fe,i as Xe,j as Fe,k as xe,l as Le,m as $n,n as te,p as Br,q as Ur,t as st,v as _r}from"./git-diff-vendor-CSgooKT_.js";import{g as jr}from"./fast-diff-vendor-DgdwVvTQ.js";const Vr=["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"],Wr=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...Vr]),zr=new Set(["innerHTML","textContent","innerText","children"]),Kr=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Hr=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 Gr(e,t){const n=Hr[e];return typeof n=="object"?n[t]?n.$:void 0:n}const qr=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),En=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"]),Jr={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Xr=e=>v(()=>e());function Yr(e,t,n){let r=n.length,o=t.length,s=r,i=0,a=0,c=t[o-1].nextSibling,l=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 u=s<r?a?n[a-1].nextSibling:n[s-a]:c;for(;a<s;)e.insertBefore(n[a++],u)}else if(s===a)for(;i<o;)(!l||!l.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[s-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[i++].nextSibling),e.insertBefore(n[--s],u),t[o]=n[s]}else{if(!l){l=new Map;let d=a;for(;d<s;)l.set(n[d],d++)}const u=l.get(t[i]);if(u!=null)if(a<u&&u<s){let d=i,h=1,g;for(;++d<o&&d<s&&!((g=l.get(t[d]))==null||g!==u+h);)h++;if(h>u-a){const p=t[i];for(;a<u;)e.insertBefore(n[a++],p)}else e.replaceChild(n[a++],t[i++])}else i++;else t[i++].remove()}}}const Zt="_$DX_DELEGATE";function dc(e,t,n,r={}){let o;return kn(s=>{o=s,t===document?e():At(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function Tn(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?()=>Me(()=>document.importNode(o||(o=s()),!0)):()=>(o||(o=s())).cloneNode(!0);return i.cloneNode=i,i}function Zr(e,t=window.document){const n=t[Zt]||(t[Zt]=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,ao))}}function vt(e,t,n){se(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Qr(e,t,n,r){se(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function eo(e,t,n){se(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function to(e,t){se(e)||(t==null?e.removeAttribute("class"):e.className=t)}function no(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 ro(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]||(Qt(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||(Qt(e,a,!0),n[a]=c)}return n}function oo(e,t,n){if(!t)return n?vt(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 fc(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t)}function In(e,t={},n,r){const o={};return r||Q(()=>o.children=De(e,t.children,o.children)),Q(()=>typeof t.ref=="function"&&_t(t.ref,e)),Q(()=>so(e,t,n,!0,o,!0)),o}function _t(e,t,n){return Me(()=>e(t,n))}function At(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return De(e,t,r,n);Q(o=>De(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]=en(e,i,null,o[i],n,s,t)}for(const i in t){if(i==="children")continue;const a=t[i];o[i]=en(e,i,a,o[i],n,s,t)}}function Pn(e){let t,n;return!se()||!(t=x.registry.get(n=co()))?e():(x.completed&&x.completed.add(t),x.registry.delete(n),t)}function se(e){return!!x.context&&!x.done&&(!e||e.isConnected)}function io(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Qt(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 en(e,t,n,r,o,s,i){let a,c,l,u,d;if(t==="style")return oo(e,n,r);if(t==="classList")return ro(e,n,r);if(n===r)return r;if(t==="ref")s||n(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);r&&e.removeEventListener(h,r,typeof r!="function"&&r),n&&e.addEventListener(h,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);r&&e.removeEventListener(h,r,!0),n&&e.addEventListener(h,n,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),g=qr.has(h);if(!g&&r){const p=Array.isArray(r)?r[0]:r;e.removeEventListener(h,p)}(g||n)&&(no(e,h,n,g),g&&Zr([h]))}else if(t.slice(0,5)==="attr:")vt(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")eo(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(l=zr.has(t))||!o&&((u=Gr(t,e.tagName))||(c=Wr.has(t)))||(a=e.nodeName.includes("-")||"is"in i)){if(d)t=t.slice(5),c=!0;else if(se(e))return n;t==="class"||t==="className"?to(e,n):a&&!c&&!l?e[io(t)]=n:e[u||t]=n}else{const h=o&&t.indexOf(":")>-1&&Jr[t.split(":")[0]];h?Qr(e,h,t,n):vt(e,Kr[t]||t,n)}return n}function ao(e){if(x.registry&&x.events&&x.events.find(([c,l])=>l===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 l=t[`${n}Data`];if(l!==void 0?c.call(t,l,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}}),x.registry&&!x.done&&(x.done=_$HY.done=!0),e.composedPath){const c=e.composedPath();s(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!i());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();s(r)}function De(e,t,n,r,o){const s=se(e);if(s){!n&&(n=[...e.childNodes]);let c=[];for(let l=0;l<n.length;l++){const u=n[l];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():c.push(u)}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=ce(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=ce(e,n,r)}else{if(i==="function")return Q(()=>{let c=t();for(;typeof c=="function";)c=c();n=De(e,c,n,r)}),()=>n;if(Array.isArray(t)){const c=[],l=n&&Array.isArray(n);if(kt(c,t,n,o))return Q(()=>n=De(e,c,n,r,!0)),()=>n;if(s){if(!c.length)return n;if(r===void 0)return n=[...e.childNodes];let u=c[0];if(u.parentNode!==e)return n;const d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(c.length===0){if(n=ce(e,n,r),a)return n}else l?n.length===0?tn(e,c,r):Yr(e,n,c):(n&&ce(e),tn(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=ce(e,n,r,t);ce(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function kt(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],l;if(!(a==null||a===!0||a===!1))if((l=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=kt(e,a,c)||o;else if(l==="function")if(r){for(;typeof a=="function";)a=a();o=kt(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||o}else e.push(a),o=!0;else{const u=String(a);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return o}function tn(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function ce(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 co(){return x.getNextContextId()}const lo="http://www.w3.org/2000/svg";function Mn(e,t=!1,n=void 0){return t?document.createElementNS(lo,e):document.createElement(e,{is:n})}function hc(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Yt();let s,i=!!x.context;return ee(()=>{i&&(Yt().user=i=!1),s||(s=Nr(o,()=>v(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[c,l]=k(!1),u=()=>l(!0);kn(d=>At(a,()=>c()?d():s(),null)),be(u)}else{const c=Mn(e.isSVG?"g":"div",e.isSVG),l=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return n.parentNode},configurable:!0}),At(l,s),a.appendChild(c),e.ref&&e.ref(c),be(()=>a.removeChild(c))}},void 0,{render:!i}),n}function uo(e,t){const n=v(e);return v(()=>{const r=n();switch(typeof r){case"function":return Me(()=>r(t));case"string":const o=En.has(r),s=x.context?Pn():Mn(r,o,Me(()=>t.is));return In(s,t,o),s}})}function gc(e){const[,t]=ot(e,["component"]);return uo(()=>e.component,t)}const we=Symbol("store-raw"),W=Symbol("store-node"),F=Symbol("store-has"),Fn=Symbol("store-self");function Dn(e){let t=e[E];if(!t&&(Object.defineProperty(e,E,{value:t=new Proxy(e,ho)}),!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 U(e){let t;return e!=null&&typeof e=="object"&&(e[E]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function K(e,t=new Set){let n,r,o,s;if(n=e!=null&&e[we])return n;if(!U(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=K(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,l=i.length;c<l;c++)s=i[c],!a[s].get&&(o=e[s],(r=K(o,t))!==o&&(e[s]=r))}return e}function Ce(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function ne(e,t,n){if(e[t])return e[t];const[r,o]=k(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function fo(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===E||t===W||(delete n.value,delete n.writable,n.get=()=>e[E][t]),n}function jt(e){Fe()&&ne(Ce(e,W),Fn)()}function Ln(e){return jt(e),Reflect.ownKeys(e)}const ho={get(e,t,n){if(t===we)return e;if(t===E)return n;if(t===Xe)return jt(e),n;const r=Ce(e,W),o=r[t];let s=o?o():e[t];if(t===W||t===F||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t);Fe()&&(typeof s!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(s=ne(r,t,s)())}return U(s)?Dn(s):s},has(e,t){return t===we||t===E||t===Xe||t===W||t===F||t==="__proto__"?!0:(Fe()&&ne(Ce(e,F),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Ln,getOwnPropertyDescriptor:fo};function A(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[F]&&e[F][t]&&o!==void 0&&e[F][t].$()):(e[t]=n,e[F]&&e[F][t]&&o===void 0&&e[F][t].$());let i=Ce(e,W),a;if((a=ne(i,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==s){for(let c=e.length;c<s;c++)(a=i[c])&&a.$();(a=ne(i,"length",s))&&a.$(e.length)}(a=i[Fn])&&a.$()}function Rn(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];A(e,o,t[o])}}function go(e,t){if(typeof t=="function"&&(t=t(e)),t=K(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&&A(e,n,o)}A(e,"length",r)}else Rn(e,t)}function $e(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++)$e(e,[r[c]].concat(t),n);return}else if(a&&i==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&$e(e,[c].concat(t),n);return}else if(a&&i==="object"){const{from:c=0,to:l=e.length-1,by:u=1}=r;for(let d=c;d<=l;d+=u)$e(e,[d].concat(t),n);return}else if(t.length>1){$e(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=K(s),r===void 0||U(o)&&U(s)&&!Array.isArray(s)?Rn(o,s):A(e,r,s))}function pc(...[e,t]){const n=K(e||{}),r=Array.isArray(n),o=Dn(n);function s(...i){fe(()=>{r&&i.length===1?go(n,i[0]):$e(n,i)})}return[o,s]}function po(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||n.set||!n.configurable||t===E||t===W||(delete n.value,delete n.writable,n.get=()=>e[E][t],n.set=r=>e[E][t]=r),n}const mo={get(e,t,n){if(t===we)return e;if(t===E)return n;if(t===Xe)return jt(e),n;const r=Ce(e,W),o=r[t];let s=o?o():e[t];if(t===W||t===F||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t),a=typeof s=="function";if(Fe()&&(!a||e.hasOwnProperty(t))&&!(i&&i.get))s=ne(r,t,s)();else if(s!=null&&a&&s===Array.prototype[t])return(...c)=>fe(()=>Array.prototype[t].apply(n,c))}return U(s)?Nn(s):s},has(e,t){return t===we||t===E||t===Xe||t===W||t===F||t==="__proto__"?!0:(Fe()&&ne(Ce(e,F),t)(),t in e)},set(e,t,n){return fe(()=>A(e,t,K(n))),!0},deleteProperty(e,t){return fe(()=>A(e,t,void 0,!0)),!0},ownKeys:Ln,getOwnPropertyDescriptor:po};function Nn(e){let t=e[E];if(!t){Object.defineProperty(e,E,{value:t=new Proxy(e,mo)});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 l=r[c].get.bind(t);Object.defineProperty(e,c,{get:l,configurable:!0})}if(r[c].set){const l=r[c].set;Object.defineProperty(e,c,{set:d=>fe(()=>l.call(t,d)),configurable:!0})}}}}return t}function yo(e,t){const n=K(e||{});return Nn(n)}const $t=Symbol("store-root");function ue(e,t,n,r,o){const s=t[n];if(e===s)return;const i=Array.isArray(e);if(n!==$t&&(!U(e)||!U(s)||i!==Array.isArray(s)||o&&e[o]!==s[o])){A(t,n,e);return}if(i){if(e.length&&s.length&&(!r||o&&e[0]&&e[0][o]!=null)){let l,u,d,h,g,p,b,y;for(d=0,h=Math.min(s.length,e.length);d<h&&(s[d]===e[d]||o&&s[d]&&e[d]&&s[d][o]&&s[d][o]===e[d][o]);d++)ue(e[d],s,d,r,o);const S=new Array(e.length),R=new Map;for(h=s.length-1,g=e.length-1;h>=d&&g>=d&&(s[h]===e[g]||o&&s[h]&&e[g]&&s[h][o]&&s[h][o]===e[g][o]);h--,g--)S[g]=s[h];if(d>g||d>h){for(u=d;u<=g;u++)A(s,u,e[u]);for(;u<e.length;u++)A(s,u,S[u]),ue(e[u],s,u,r,o);s.length>e.length&&A(s,"length",e.length);return}for(b=new Array(g+1),u=g;u>=d;u--)p=e[u],y=o&&p?p[o]:p,l=R.get(y),b[u]=l===void 0?-1:l,R.set(y,u);for(l=d;l<=h;l++)p=s[l],y=o&&p?p[o]:p,u=R.get(y),u!==void 0&&u!==-1&&(S[u]=s[l],u=b[u],R.set(y,u));for(u=d;u<e.length;u++)u in S?(A(s,u,S[u]),ue(e[u],s,u,r,o)):A(s,u,e[u])}else for(let l=0,u=e.length;l<u;l++)ue(e[l],s,l,r,o);s.length>e.length&&A(s,"length",e.length);return}const a=Object.keys(e);for(let l=0,u=a.length;l<u;l++)ue(e[a[l]],s,a[l],r,o);const c=Object.keys(s);for(let l=0,u=c.length;l<u;l++)e[c[l]]===void 0&&A(s,c[l],void 0)}function mc(e,t={}){const{merge:n,key:r="id"}=t,o=K(e);return s=>{if(!U(s)||!U(o))return o;const i=ue(o,{[$t]:s},$t,n,r);return i===void 0?s:i}}const Ye=new WeakMap,Bn={get(e,t){if(t===we)return e;const n=e[t];let r;return U(n)?Ye.get(n)||(Ye.set(n,r=new Proxy(n,Bn)),r):n},set(e,t,n){return A(e,t,K(n)),!0},deleteProperty(e,t){return A(e,t,void 0,!0),!0}};function yc(e){return t=>{if(U(t)){let n;(n=Ye.get(t))||Ye.set(t,n=new Proxy(t,Bn)),e(n)}return t}}function Vt(e,t=0,n=1){return Math.min(Math.max(t,e),n)}function bo(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 re(e){if(typeof e!="string")return e;if(e.charAt(0)==="#")return re(bo(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 it(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 wo(e){const t=re(e),{values:n}=t,r=n[0],o=n[1]/100,s=n[2]/100,i=o*Math.min(s,1-s),a=(u,d=(u+r/30)%12)=>s-i*Math.max(Math.min(d-3,9-d,1),-1);let c="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return t.type==="hsla"&&(c+="a",l.push(n[3])),it({type:c,values:l})}function nn(e){const{type:t,values:n}=re(e);let r=t==="hsl"?re(wo(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 Co(e,t){const n=nn(e),r=nn(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function bc(e,t){let{type:n,values:r}=re(e);return t=Vt(t),(n==="rgb"||n==="hsl")&&(n+="a"),n==="color"?r[3]=`/${t}`:r[3]=t,it({type:n,values:r})}function So(e,t){const n=re(e);if(t=Vt(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 it(n)}function Oo(e,t){const n=re(e);if(t=Vt(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 it(n)}const xo={xs:0,sm:600,md:900,lg:1200,xl:1536};function vo(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||xo).indexOf(c)!==-1)a={...a,...s.up(c,n(t[c],c))};else{const l=c;a[l]=t[l]}return a},{})}return n(t)}const Ao={cleanupStyles:!0},ko=xe(Ao),oe={black:"#000",white:"#fff"},he={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},ge={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},pe={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},me={300:"#4fc3f7",400:"#29b6f6",700:"#0288d1",800:"#0277bd",900:"#01579b"},ye={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},Ie={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},$o={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 Ee(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function Eo(e,t){for(const n of t){const r=e[n];delete e[n],e[n]=r}}function Wt(e,t,n={clone:!0}){const r=n.clone?{...e}:e,o=n.sortKeys?[]:void 0;return Ee(e)&&Ee(t)&&(Object.keys(t).forEach(s=>{if(s==="__proto__")return;o&&o.push(s);let i,a;Ee(i=t[s])&&s in e&&Ee(a=e[s])?r[s]=Wt(a,i,n):i!==void 0&&(r[s]=i)}),o&&Eo(r,o)),r}function Et(e){if(Array.isArray(e)){const t=[];for(const n of e)t.push(Et(n));return t}else if(Ee(e)){const t={};for(const n in e)n!=="__proto__"&&(t[n]=Et(e[n]));return t}else return e}function Re(e,...t){for(const n of t)Wt(e,Et(n),{clone:!1});return e}const To=()=>({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:oe.white,default:oe.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}}),Io={primary:{main:pe[700],light:pe[400],dark:pe[800]},secondary:{main:ge[500],light:ge[300],dark:ge[700]},error:{main:he[700],light:he[400],dark:he[800]},info:{main:me[700],light:me[800],dark:me[900]},success:{main:ye[800],light:ye[500],dark:ye[900]},warning:{main:"#ED6C02",light:Ie[500],dark:Ie[900]}},Po=()=>({text:{primary:oe.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:oe.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}}),Mo={primary:{main:pe[200],light:pe[50],dark:pe[400]},secondary:{main:ge[200],light:ge[50],dark:ge[400]},error:{main:he[500],light:he[300],dark:he[700]},info:{main:me[400],light:me[300],dark:me[700]},success:{main:ye[400],light:ye[300],dark:ye[700]},warning:{main:Ie[400],light:Ie[300],dark:Ie[700]}},Fo={light:To,dark:Po};function Un(e,t){return Co(e,oe.white)>=t?oe.white:"rgba(0, 0, 0, 0.87)"}function rn(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=Oo(e.main,o):t==="dark"&&(e.dark=So(e.main,s)))}function Do(e){const t={...e.color},n=e.mainShade??500;return!e.color.main&&e.color[n]&&(t.main=e.color[n]),rn(t,"light",e.lightShade??300,e.tonalOffset),rn(t,"dark",e.darkShade??700,e.tonalOffset),t.contrastText||(t.contrastText=Un(t.main,e.contrastThreshold)),t}const Lo=()=>({mode:"light",tonalOffset:.2,contrastThreshold:3,grey:$o,common:oe});function Ro(e){const t=["error","info","primary","secondary","success","warning"],n=Lo(),r={...Re({},n,Fo[(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 Do({...s,tonalOffset:r.tonalOffset,contrastThreshold:r.contrastThreshold})},getContrastText(s){return Un(s,r.contrastThreshold)}},o=s=>r.mode==="light"?Io[s]:Mo[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 No={};function Bo(e){return{...Re({},No,e??{})}}function Uo(e,t=void 0,n={}){return{toolbar:{minHeight:56,[`${e.up("xs")} and (orientation: landscape)`]:{minHeight:48},[e.up("sm")]:{minHeight:64}},...n}}const pt={},_o=.2,jo=.14,Vo=.12;function w(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${_o})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${jo})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Vo})`].join(",")}const Wo=[()=>"none",()=>w(0,2,1,-1,0,1,1,0,0,1,3,0),()=>w(0,3,1,-2,0,2,2,0,0,1,5,0),()=>w(0,3,3,-2,0,3,4,0,0,1,8,0),()=>w(0,2,4,-1,0,4,5,0,0,1,10,0),()=>w(0,3,5,-1,0,5,8,0,0,1,14,0),()=>w(0,3,5,-1,0,6,10,0,0,1,18,0),()=>w(0,4,5,-2,0,7,10,1,0,2,16,1),()=>w(0,5,5,-3,0,8,10,1,0,3,14,2),()=>w(0,5,6,-3,0,9,12,1,0,3,16,2),()=>w(0,6,6,-3,0,10,14,1,0,4,18,3),()=>w(0,6,7,-4,0,11,15,1,0,4,20,3),()=>w(0,7,8,-4,0,12,17,2,0,5,22,4),()=>w(0,7,8,-4,0,13,19,2,0,5,24,4),()=>w(0,7,9,-4,0,14,21,2,0,5,26,4),()=>w(0,8,9,-5,0,15,22,2,0,6,28,5),()=>w(0,8,10,-5,0,16,24,2,0,6,30,5),()=>w(0,8,11,-5,0,17,26,2,0,6,32,5),()=>w(0,9,11,-5,0,18,28,2,0,7,34,6),()=>w(0,9,12,-6,0,19,29,2,0,7,36,6),()=>w(0,10,13,-6,0,20,31,3,0,8,38,7),()=>w(0,10,13,-6,0,21,33,3,0,8,40,7),()=>w(0,10,14,-6,0,22,35,3,0,8,42,7),()=>w(0,11,14,-7,0,23,36,3,0,9,44,8),()=>w(0,11,15,-7,0,24,38,3,0,9,46,8)];function zo(){return new Proxy([],{get:(e,t)=>typeof t!="string"||isNaN(Number(t))?e[t]:t in pt?pt[t]:pt[t]=Wo[t]()})}const Ko={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)"},Ho={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function on(e){return`${Math.round(e)}ms`}function Go(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function qo(e){const t={...Ko,...e.easing},n={...Ho,...e.duration};return{getAutoHeightDuration:Go,create:(o=["all"],s={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:c=0,...l}=s;return(Array.isArray(o)?o:[o]).map(u=>`${u} ${typeof i=="string"?i:on(i)} ${a} ${typeof c=="string"?c:on(c)}`).join(",")},...e,easing:t,duration:n}}const T={light:300,regular:400,medium:500},_e={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 Jo(e){return Math.round(e*1e5)/1e5}function I(e,t,n,r,o,s){return{fontFamily:e.fontFamily,fontWeight:t,fontSize:e.pxToRem(n),lineHeight:`${r}`,letterSpacing:`${Jo(o/n)}em`,...s?{textTransform:"uppercase"}:{}}}function Xo(e={}){const t={fontFamily:e.fontFamily??_e.fontFamily,fontSize:e.fontSize??_e.fontSize,htmlFontSize:(e==null?void 0:e.htmlFontSize)??_e.htmlFontSize,pxToRem:n=>{const r=t.fontSize/14;return`${n/t.htmlFontSize*r}rem`}};return Re(_e,t,{h1:I(t,T.light,96,1.167,-1.5),h2:I(t,T.light,60,1.2,-.5),h3:I(t,T.regular,48,1.167,0),h4:I(t,T.regular,34,1.235,.25),h5:I(t,T.regular,24,1.334,0),h6:I(t,T.medium,20,1.6,.15),subtitle1:I(t,T.regular,16,1.75,.15),subtitle2:I(t,T.medium,14,1.57,.1),body1:I(t,T.regular,16,1.5,.15),body2:I(t,T.regular,14,1.43,.15),button:I(t,T.medium,14,1.75,.4,!0),caption:I(t,T.regular,12,1.66,.4),overline:I(t,T.regular,12,2.66,1,!0)},e)}const Yo={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Zo(e){return{...Re({},Yo,e)}}function mt(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 Qo={columns:12,keys:["xs","sm","md","lg","xl"],values:{xs:0,sm:600,md:900,lg:1200,xl:1536},unit:"px"};function _n(e){const t={...Qo,...e??{},up:(n,r)=>{const o=mt("up",t.resolve(n));return r?{[o]:r}:o},down:(n,r)=>{const o=mt("down",t.resolve(n));return r?{[o]:r}:o},between:(n,r)=>{const o=mt("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 jn(e){return typeof e=="function"?e:(...n)=>n.map(r=>typeof r=="number"?`${r*(e??8)}px`:r).join(" ")}const es={borderRadius:4};function Vn(e){return{...Re({},es,e)}}function Wn(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=>_n(r.breakpoints)),n("components",r=>Bo(r.components)),n("palette",r=>Ro(r.palette)),n("shape",r=>Vn(r.shape)),n("spacing",r=>jn(r.spacing)),n("typography",r=>Xo(r.typography)),n("shadows",()=>zo()),n("transitions",()=>qo({})),n("zIndex",r=>Zo(r.zIndex)),n("mixins",()=>Uo(t.breakpoints)),t}function zn(e){let t;return function(){return t||(t=e()),t}}const ts=zn(Wn);let Kn;Kn=xe({});const at=Kn;function ns(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:_n(e==null?void 0:e.breakpoints),shape:Vn(e==null?void 0:e.shape),spacing:jn(e==null?void 0:e.spacing)}}const rs=zn(ns);function os(e){for(const t in e)return!1;return!0}function zt(e=rs,t=at){const n=Le(t);if(typeof n=="function")return new Proxy({},{get:(r,o)=>n()[o]});if(os(n)&&e)return typeof e=="function"?e():e;if(!n)throw new Error("Theme is not defined");return n}function Hn(e=ts){return zt(e,at)}function ss(e){return zt(e,at)}function is(e){var s,i;const t=[],n=typeof e.propDefaults=="function"?e.propDefaults({set:a=>a,inProps:e.props}):e.propDefaults,o=(i=(s=ss().components)==null?void 0:s[e.name])==null?void 0:i.defaultProps;return n&&t.push(n),o&&t.push(o),t.length?$n(...t,e.props):e.props}function as(e){return te(at.Provider,{get value(){return e.theme},get children(){return e.children}})}function cs(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function ls(e,t){switch(typeof e){case"function":return Object.assign(e,{[Br]:!0}),Me(()=>e(t));case"string":const n=En.has(e),r=x.context?Pn():cs(e,n);return In(r,t,n),r}}function Gn(e,t){const n=v(e);return v(()=>ls(n(),t))}function wc(e){const[t,n]=ot(e,["$component"]);return Gn(()=>t.$component,n)}function us(e){const t=e.reduce((n,r)=>("name"in r&&(n[`--${r.name}`]="0"),Wt(n,r,{clone:!1,sortKeys:!0}),n),{});return delete t.name,t}function qn(e){return e.startsWith("--")}function ds(e){return e.startsWith("__")}function Jn(e){return/[^a-z-]/i.test(e)&&!qn(e)}function Xn(e){return e.startsWith("@global")}function Tt(e){return e.startsWith("@media")}function Yn(e){return e.startsWith("@keyframes")}function sn(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function an(e,t,n=[],r={}){const o=e.split(",").map(s=>(s=s.trim(),s.includes("&")?s:`& ${s}`));return Ze(t,(n.length?n:[""]).flatMap(s=>o.map(i=>i.replace(/&/g,s).trim())),{...r})}function cn(e,t){if(!t)return sn(e);let n=t.get(e);return n||(t.set(e,n=sn(e)),n)}function Ze(e,t=[],n={}){const r=[],o=[];for(let i in e){const a=e[i];if(!ds(i))if(Xn(i))for(const c in a)o.push(...an(c,a[c],[],n));else if(Tt(i))o.push(...Ze(a,t,{...n,sublevel:!0}).map(c=>`${i} {
|
|
2
|
-
${c}
|
|
3
|
-
}`));else if(qn(i))a!=null&&r.push(`${i}: ${a};`);else if(Yn(i)){const c=[];for(const l in a)c.push(...Ze(a[l],[/^\d+$/.test(l)?`${l}%`:l],{...n,sublevel:!0}));o.push(`${i} {
|
|
4
|
-
${c.join(`
|
|
5
|
-
`)}
|
|
6
|
-
}`)}else if(Jn(i))o.push(...an(i,a,t,n));else if(n.extraProperties&&i in n.extraProperties){const c=n.extraProperties[i](a);for(const l in c){const u=c[l],d=n.onPropertyValue?n.onPropertyValue(l,u):u;d!=null&&r.push(`${cn(l,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 fs(e){return e?Array.isArray(e)?e:[e]:[]}function hs(e){return typeof e=="function"&&(e=e()),e}class gs{constructor(){Ue(this,"ids",new Map);Ue(this,"rules",new Map);Ue(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=Zn(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 Zn(e,t,n){return{id:n,name:e,className:`${e}-${n}`,rules:t.replaceAll("$id",`${n}`)}}function ps(e){var s,i;const t=`${e.name}-$id`,n=fs(hs(e.props)),r=(s=e.cache)==null?void 0:s.propertyNames,o=n.map(a=>typeof a=="string"?`.${t} {
|
|
11
|
-
${a}
|
|
12
|
-
}`:Ze(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))||Zn(e.name,o,e.componentId)}function Qn(e,t){"styleSheet"in e?e.styleSheet.cssText=t:(e.innerText="",e.appendChild(document.createTextNode(t)))}function ms(e,t){for(const n in t){const r=t[n];r!==void 0&&(r===null?e.removeAttribute(n):e.setAttribute(n,r))}}function ys(e,t){const n=document.createElement("style");return n.type="text/css",t&&ms(n,t),Qn(n,e),n}function It(e){let t=Number(e.getAttribute("data-uses"));t++,e.setAttribute("data-uses",t.toString())}const ln="suid-injectFirst";function bs(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 Qn(s,e),It(s),s;{s&&s.remove();const i=ys(e,t);if(It(i),n){let a=o.querySelector(`#${ln}`);a||(a=document.createElement("style"),a.setAttribute("id",ln),o.prepend(a)),o.insertBefore(i,a)}else o.appendChild(i);return i}}function ws(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 un(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 Cc(e){if(typeof e!="string")throw new Error("MUI: `capitalize(string)` expects a string argument.");return e.charAt(0).toUpperCase()+e.slice(1)}function Sc(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 Oc(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}function Cs(e){return e&&e.ownerDocument||document}function xc(e){return Cs(e).defaultView||window}function er(){return Math.random().toString(36).substring(2,15).slice(0,8)}let ct=!0,Pt=!1,dn;const Ss={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 Os(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&Ss[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function xs(e){e.metaKey||e.altKey||e.ctrlKey||(ct=!0)}function yt(){ct=!1}function vs(){this.visibilityState==="hidden"&&Pt&&(ct=!0)}function As(e){e.addEventListener("keydown",xs,!0),e.addEventListener("mousedown",yt,!0),e.addEventListener("pointerdown",yt,!0),e.addEventListener("touchstart",yt,!0),e.addEventListener("visibilitychange",vs,!0)}function ks(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return ct||Os(t)}function vc(){const e=s=>{s!=null&&As(s.ownerDocument)},[t,n]=k(!1);function r(){return t()?(Pt=!0,window.clearTimeout(dn),dn=window.setTimeout(()=>{Pt=!1},100),n(!1),!0):!1}function o(s){return ks(s)?(n(!0),!0):!1}return{isFocusVisibleRef:{get current(){return t()}},onFocus:o,onBlur:r,ref:e}}const $s=new gs;function Es(e){return e?Array.isArray(e)?e.flat(1/0).filter(t=>!!t):[e]:[]}function Ts(){if(!x.context)return er();const e=Ur().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 tr(e){const t=Le(ko),[n,r]=k(""),o=Ts();let s,i=!1;return Q(a=>{var u;const c=e();let l;if(c){const d=us(Es(c));i="@global"in d,l=ps({name:"css",props:d,cache:$s,componentId:o}),s=ws(l.id),s?It(s):s=bs(l.rules,{id:l.id,nonce:(u=t.cache)==null?void 0:u.nonce},t.injectFirst),a!=null&&a.styleElement&&un(a.styleElement)}return typeof(l==null?void 0:l.className)=="string"?r(l.className):r(""),{className:l==null?void 0:l.className,styleElement:s}},void 0),be(()=>{s&&un(s,t.cleanupStyles??i)}),n}function de(e,t,n={}){for(const r in e){const o=e[r];if(Xn(r))n[r]=de(o,t);else if(Tt(r))n[r]=de(o,t);else if(Yn(r)){n[r]={};for(const s in o)n[r][s]=de(o[s],t)}else if(Jn(r))n[r]=de(o,t);else{const s=t(r,o);if(s)for(const i in s)n[i]=Tt(i)?{...n[i],...s[i]}:s[i];else n[r]=o}}return n}const Is=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 nr(e,t){if(typeof t=="number")return{[e]:Is.has(e)?t.toString():`${t}px`}}function fn(e,t={}){return de(e,nr,t)}function Qe(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 Ps(e,t){return t.split(".").reduce((n,r)=>n&&n[r]?n[r]:null,e)}function Ms(e,t,n,r){const o=Ps(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 q={x:["Left","Right"],y:["Top","Bottom"]};function rr(e){return typeof e=="number"?`${e}px`:e}function or(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 Te(e){return f(e,(t,n)=>rr(n))}function M(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 Fs(){return{...Ds(),...Ls(),...Rs(),...Ns(),...Bs(),...Us(),..._s(),...Vs(),...js()}}function Ds(){return{displayPrint:or("displayPrint",(e,t)=>({"@media print":{display:t}})),displayRaw:f("display"),overflow:f("overflow"),textOverflow:f("textOverflow"),visibility:f("visibility"),whiteSpace:f("whiteSpace")}}function Ls(){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 Rs(){const e=(t,n,r)=>Ms(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 Ns(){return{position:f("position"),zIndex:f("zIndex",(e,t,n)=>{var r;return((r=n.zIndex)==null?void 0:r[e])??t}),top:Te("top"),right:Te("right"),bottom:Te("bottom"),left:Te("left")}}function Bs(){const e=(t,n,r)=>Qe(r,"palette",n);return{color:f("color",e),bgcolor:f("backgroundColor",e),backgroundColor:f("backgroundColor",e)}}function Us(){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 _s(){const e=(n,r)=>typeof r=="number"?`${r}px solid`:r,t=(n,r,o)=>Qe(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 js(){const e=(t,n,r)=>Qe(r,"typography",n);return{typography:or("typography",(t,n,r)=>Qe(r,"typography",n)),fontFamily:f("fontFamily",e),fontSize:f("fontSize",(t,n,r)=>rr(e(t,n,r))),fontStyle:f("fontStyle",e),fontWeight:f("fontWeight",e),letterSpacing:Te("letterSpacing"),lineHeight:f("lineHeight"),textAlign:f("textAlign"),textTransform:f("textTransform")}}function Vs(){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:M(t,q.x,e),my:M(t,q.y,e),margin:f(t,e),marginTop:f("marginTop",e),marginRight:f("marginRight",e),marginBottom:f("marginBottom",e),marginLeft:f("marginLeft",e),marginX:M(t,q.x,e),marginY:M(t,q.y,e),marginInline:M(t,["Inline","InlineStart"],e),marginInlineStart:f("marginInlineStart",e),marginInlineEnd:f("marginInlineEnd",e),marginBlock:M(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:M(n,q.x,e),py:M(n,q.y,e),padding:f(n,e),paddingTop:f("paddingTop",e),paddingRight:f("paddingRight",e),paddingBottom:f("paddingBottom",e),paddingLeft:f("paddingLeft",e),paddingX:M(n,q.x,e),paddingY:M(n,q.y,e),paddingInline:M(n,["Inline","InlineStart"],e),paddingInlineStart:f("paddingInlineStart",e),paddingInlineEnd:f("paddingInlineEnd",e),paddingBlock:M(n,["BlockStart","BlockEnd"],e),paddingBlockStart:f("paddingBlockStart",e),paddingBlockEnd:f("paddingBlockEnd",e)}}const Kt=Fs(),Ac=Object.keys(Kt);function Ws(e,t,n){return Kt[e](t,n)}function hn(e,t,n){return e in Kt?Ws(e,t,n):nr(e,t)}function zs(e,t){return de(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,vo({theme:t},r,s=>hn(n,s,t)??{[n]:s}))}else return hn(n,r,t)})}function sr(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=sr(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ks(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=sr(e))&&(r&&(r+=" "),r+=t);return r}const ir=["ownerState","theme","sx","as"];function Hs(e,t){var n,r;return(r=(n=t.components)==null?void 0:n[e])==null?void 0:r.styleOverrides}function Gs(e,t,n,r,o={}){return v(()=>{const s=e(),i=Hs(o.name,s),a=r.ownerState,c=n.reduce((u,d)=>{let h;return typeof d=="function"?h=d({ownerState:a,theme:s,get sx(){return r.sx},get as(){return r.as},props:r}):d&&(h=d),h&&u.push(fn(h,{name:t,__resolved:!0})),u},[]);let l=[];return o.overridesResolver&&typeof o.overridesResolver=="function"&&i&&(l=o.overridesResolver(r,i).map(u=>u?fn(u,{}):null).filter(Boolean)),c.concat(l)})}function ar(e,t){e.__suid=t}function gn(e){if(typeof e=="function")return e.__suid}function qs(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-${er()}`,o="css";const i=gn(n);return function(...a){function c(l){let u;const d=()=>{const $=l.theme;return $||u||(u=e&&e.onUseTheme?e.onUseTheme():zt())},[,h]=ot(l,r.skipProps||ir),g=Gs(d,o,a,l,r),p=()=>{const $=l.sx;return $?Array.isArray($)?$:[$]:[]},b=()=>{if(i)return n;const $=l.as;return $||n},y=i?()=>i:v(()=>gn(b())),S=r.skipSx?()=>g():()=>{const $=d();return[...g(),...p().map(G=>G.__resolved?G:zs(G,$))]},R=tr(()=>y()?void 0:S());return Gn(b,$n(h,{get children(){return l.children},get component(){return y()?l.component:null},get as(){return i?l.as:void 0},get sx(){return y()?S():void 0},get ownerState(){return y()==="system"?l.ownerState:void 0},get class(){return Ks([...new Set([l.class,s,R()])])}}))}return ar(c,"system"),s&&(c.toString=()=>`.${s}`),c}}}const kc=[...ir,"classes"],$c=qs({onUseTheme:()=>Hn()}),Js="codenomad.client-id",Xs="codenomad.connection-id";let je=null,Ve=null;function Mt(){return{clientId:Ys(),connectionId:Zs()}}function Ys(){return je||(je=cr(Js,window.localStorage),je)}function Zs(){return Ve||(Ve=cr(Xs,window.sessionStorage),Ve)}function cr(e,t){if(typeof window>"u")return bt();try{const r=t.getItem(e);if(r&&r.trim())return r.trim()}catch{return bt()}const n=bt();try{t.setItem(e,n)}catch{}return n}function bt(){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 Ft={exports:{}},wt,pn;function Qs(){if(pn)return wt;pn=1;var e=1e3,t=e*60,n=t*60,r=n*24,o=r*7,s=r*365.25;wt=function(u,d){d=d||{};var h=typeof u;if(h==="string"&&u.length>0)return i(u);if(h==="number"&&isFinite(u))return d.long?c(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function i(u){if(u=String(u),!(u.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(u);if(d){var h=parseFloat(d[1]),g=(d[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return h*s;case"weeks":case"week":case"w":return h*o;case"days":case"day":case"d":return h*r;case"hours":case"hour":case"hrs":case"hr":case"h":return h*n;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(u){var d=Math.abs(u);return d>=r?Math.round(u/r)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function c(u){var d=Math.abs(u);return d>=r?l(u,d,r,"day"):d>=n?l(u,d,n,"hour"):d>=t?l(u,d,t,"minute"):d>=e?l(u,d,e,"second"):u+" ms"}function l(u,d,h,g){var p=d>=h*1.5;return Math.round(u/h)+" "+g+(p?"s":"")}return wt}function ei(e){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=Qs(),n.destroy=l,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let h=0;h<u.length;h++)d=(d<<5)-d+u.charCodeAt(h),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,h=null,g,p;function b(...y){if(!b.enabled)return;const S=b,R=Number(new Date),$=R-(d||R);S.diff=$,S.prev=d,S.curr=R,d=R,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let G=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(gt,Fr)=>{if(gt==="%%")return"%";G++;const Xt=n.formatters[Fr];if(typeof Xt=="function"){const Dr=y[G];gt=Xt.call(S,Dr),y.splice(G,1),G--}return gt}),n.formatArgs.call(S,y),(S.log||n.log).apply(S,y)}return b.namespace=u,b.useColors=n.useColors(),b.color=n.selectColor(u),b.extend=r,b.destroy=n.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(g!==n.namespaces&&(g=n.namespaces,p=n.enabled(u)),p),set:y=>{h=y}}),typeof n.init=="function"&&n.init(b),b}function r(u,d){const h=n(this.namespace+(typeof d>"u"?":":d)+u);return h.log=this.log,h}function o(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];const d=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const h of d)h[0]==="-"?n.skips.push(h.slice(1)):n.names.push(h)}function s(u,d){let h=0,g=0,p=-1,b=0;for(;h<u.length;)if(g<d.length&&(d[g]===u[h]||d[g]==="*"))d[g]==="*"?(p=g,b=h,g++):(h++,g++);else if(p!==-1)g=p+1,b++,h=b;else return!1;for(;g<d.length&&d[g]==="*";)g++;return g===d.length}function i(){const u=[...n.names,...n.skips.map(d=>"-"+d)].join(",");return n.enable(""),u}function a(u){for(const d of n.skips)if(s(u,d))return!1;for(const d of n.names)if(s(u,d))return!0;return!1}function c(u){return u instanceof Error?u.stack||u.message:u}function l(){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 ti=ei;(function(e,t){var n={};t.formatArgs=o,t.save=s,t.load=i,t.useColors=r,t.storage=a(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!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 l;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&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;l.splice(1,0,u,"color: inherit");let d=0,h=0;l[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(d++,g==="%c"&&(h=d))}),l.splice(h,0,u)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function i(){let l;try{l=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=n.DEBUG),l}function a(){try{return localStorage}catch{}}e.exports=ti(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(Ft,Ft.exports);var ni=Ft.exports;const Dt=jr(ni),ve=["sse","api","session","actions"],lr="opencode:logger:namespaces",Ct=new Map,_=new Set,V=typeof globalThis<"u"?globalThis.console:void 0;function Ne(){_.size===0?Dt.disable():Dt.enable(Array.from(_).join(","))}function lt(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{window.localStorage.setItem(lr,JSON.stringify(Array.from(_)))}catch(t){(e=V==null?void 0:V.warn)==null||e.call(V,"Failed to persist logger namespaces",t)}}function ri(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{const t=window.localStorage.getItem(lr);if(!t)return;const n=JSON.parse(t);if(!Array.isArray(n))return;for(const r of n)ve.includes(r)&&_.add(r)}catch(t){(e=V==null?void 0:V.warn)==null||e.call(V,"Failed to hydrate logger namespaces",t)}}ri();Ne();function oi(e){const n=Dt(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 ie(e){if(!ve.includes(e))throw new Error(`Unknown logger namespace: ${e}`);return Ct.has(e)||Ct.set(e,oi(e)),Ct.get(e)}function si(){return ve.map(e=>({name:e,enabled:_.has(e)}))}function ii(e){if(!ve.includes(e))throw new Error(`Unknown logger namespace: ${e}`);_.has(e)||(_.add(e),lt(),Ne())}function ai(e){if(!ve.includes(e))throw new Error(`Unknown logger namespace: ${e}`);_.has(e)&&(_.delete(e),lt(),Ne())}function ci(){_.clear(),lt(),Ne()}function li(){ve.forEach(e=>_.add(e)),lt(),Ne()}const ui={listLoggerNamespaces:si,enableLogger:ii,disableLogger:ai,enableAllLoggers:li,disableAllLoggers:ci};function di(){typeof window>"u"||(window.codenomadLogger=ui)}di();var An;const fi=typeof window<"u"?(An=window.location)==null?void 0:An.origin:void 0,hi=typeof window<"u"?window.__CODENOMAD_API_BASE__??fi:void 0,gi=typeof window<"u"?window.__CODENOMAD_EVENTS_URL__??"/api/events":"/api/events",X=hi,St=pi(X,gi),Ec=X;function Tc(e,t){const n=encodeURIComponent(e),r=encodeURIComponent(t);return mi(`/workspaces/${n}/plugin/background-processes/${r}/stream`)}function pi(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 mi(e){if(e.startsWith("http://")||e.startsWith("https://")||!X)return e;const t=e.startsWith("/")?e:`/${e}`;return`${X}${t}`}const mn=ie("api"),We=ie("sse");function ur(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 Z(e,t){if(t){mn.info(e,t);return}mn.info(e)}async function m(e,t){const n=X?new URL(e,X).toString():e,r=ur(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();Z(`${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 i.text();throw Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:c}),new Error(c||`Request failed with ${i.status}`)}const a=Date.now()-s;return Z(`${o} ${e} -> ${i.status}`,{durationMs:a}),i.status===204?void 0:await i.json()}catch(i){throw Z(`${o} ${e} failed`,{durationMs:Date.now()-s,error:i}),i}}async function yi(e,t){const n=X?new URL(e,X).toString():e,r=ur(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();Z(`${o} ${e}`);const i=await fetch(n,{...t,headers:r,credentials:(t==null?void 0:t.credentials)??"include"});if(!i.ok){const a=await i.text();throw Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:a}),new Error(a||`Request failed with ${i.status}`)}return Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s}),i}const j={fetchWorkspaces(){return m("/api/workspaces")},fetchWorktrees(e){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees`)},createWorktree(e,t){return m(`/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 m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}${o}`,{method:"DELETE"})},readWorktreeMap(e){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`)},writeWorktreeMap(e,t){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`,{method:"PUT",body:JSON.stringify(t)})},createWorkspace(e){return m("/api/workspaces",{method:"POST",body:JSON.stringify(e)})},fetchSidecars(){return m("/api/sidecars")},createSidecar(e){return m("/api/sidecars",{method:"POST",body:JSON.stringify(e)})},updateSidecar(e,t){return m(`/api/sidecars/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})},deleteSidecar(e){return m(`/api/sidecars/${encodeURIComponent(e)}`,{method:"DELETE"})},fetchServerMeta(){return m("/api/meta")},probeRemoteServer(e){return m("/api/remote-servers/probe",{method:"POST",body:JSON.stringify(e)})},fetchAuthStatus(){return m("/api/auth/status")},setServerPassword(e){return m("/api/auth/password",{method:"POST",body:JSON.stringify({password:e})})},deleteWorkspace(e){return m(`/api/workspaces/${encodeURIComponent(e)}`,{method:"DELETE"})},listWorkspaceFiles(e,t="."){const n=new URLSearchParams({path:t});return m(`/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),m(`/api/workspaces/${encodeURIComponent(e)}/files/search?${o.toString()}`)},readWorkspaceFile(e,t){const n=new URLSearchParams({path:t});return m(`/api/workspaces/${encodeURIComponent(e)}/files/content?${n.toString()}`)},writeWorkspaceFile(e,t,n){const r=new URLSearchParams({path:t});return m(`/api/workspaces/${encodeURIComponent(e)}/files/content?${r.toString()}`,{method:"PUT",body:JSON.stringify({contents:n})})},fetchConfigOwner(e){return m(`/api/storage/config/${encodeURIComponent(e)}`)},patchConfigOwner(e,t){return m(`/api/storage/config/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},fetchStateOwner(e){return m(`/api/storage/state/${encodeURIComponent(e)}`)},patchStateOwner(e,t){return m(`/api/storage/state/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},validateBinary(e){return m("/api/storage/binaries/validate",{method:"POST",body:JSON.stringify({path:e})})},fetchSpeechCapabilities(){return m("/api/speech/capabilities")},transcribeAudio(e){return m("/api/speech/transcribe",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeech(e){return m("/api/speech/synthesize",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeechStream(e,t){return yi("/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 m(r?`/api/filesystem?${r}`:"/api/filesystem")},createFileSystemFolder(e,t){return m("/api/filesystem/folders",{method:"POST",body:JSON.stringify({parentPath:e,name:t})})},readInstanceData(e){return m(`/api/storage/instances/${encodeURIComponent(e)}`)},writeInstanceData(e,t){return m(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})},deleteInstanceData(e){return m(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"DELETE"})},listBackgroundProcesses(e){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes`)},stopBackgroundProcess(e,t){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/stop`,{method:"POST"})},terminateBackgroundProcess(e,t){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/terminate`,{method:"POST"})},updateVoiceMode(e,t){const n=Mt();return m(`/workspaces/${encodeURIComponent(e)}/plugin/voice-mode`,{method:"POST",body:JSON.stringify({...n,enabled:t})})},sendClientConnectionPong(e){return m("/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 m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/output${s}`)},connectEvents(e,t,n){const r=Mt(),o=bi(r);We.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){We.error("Failed to parse event",a)}},s.onerror=()=>{We.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){We.error("Failed to parse ping event",a)}}),s}};function bi(e){const t=new URL(St,typeof window<"u"?window.location.origin:"http://localhost");return t.searchParams.set("clientId",e.clientId),t.searchParams.set("connectionId",e.connectionId),St.startsWith("http://")||St.startsWith("https://")?t.toString():`${t.pathname}${t.search}`}const yn=1e3,wi=1e4,Lt=ie("sse");function ze(e,t){if(t){Lt.info(e,t);return}Lt.info(e)}class Ci{constructor(){this.handlers=new Map,this.openHandlers=new Set,this.source=null,this.retryDelay=yn,this.connect()}connect(){this.source&&this.source.close(),ze("Connecting to backend events stream"),this.source=j.connectEvents(t=>this.dispatch(t),()=>this.scheduleReconnect(),t=>{j.sendClientConnectionPong({...Mt(),pingTs:t.ts}).catch(n=>{Lt.error("Failed to send client connection pong",n)})}),this.source.onopen=()=>{ze("Events stream connected"),this.retryDelay=yn,this.openHandlers.forEach(t=>t())}}scheduleReconnect(){this.source&&(this.source.close(),this.source=null),ze("Events stream disconnected, scheduling reconnect",{delayMs:this.retryDelay}),setTimeout(()=>{this.retryDelay=Math.min(this.retryDelay*2,wi),this.connect()},this.retryDelay)}dispatch(t){var n,r;ze(`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 Ot=new Ci,Si=ie("actions"),bn={messageHistory:[],agentModelSelections:{}};function wn(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){Si.warn("Failed to compare config objects",n)}return!1}class Oi{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,Ot.on("storage.configChanged",t=>{t.type==="storage.configChanged"&&this.setOwnerCache("config",t.owner,t.value)}),Ot.on("storage.stateChanged",t=>{t.type==="storage.stateChanged"&&this.setOwnerCache("state",t.owner,t.value)}),Ot.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=j.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 j.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=j.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 j.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=j.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 j.writeInstanceData(t,r),this.setInstanceDataCache(t,r)}async deleteInstanceData(t){await j.deleteInstanceData(t),this.setInstanceDataCache(t,bn)}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&&wn(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??bn,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&&wn(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 B=new Oi,dr=ie("api"),ut={messageHistory:[],agentModelSelections:{}},[Ht,fr]=k(new Map),Ke=new Map,Se=new Map;function hr(e){const t=e??ut;return{...t,messageHistory:Array.isArray(t.messageHistory)?[...t.messageHistory]:[],agentModelSelections:{...t.agentModelSelections??{}}}}function Cn(e){if(Se.has(e))return;const t=B.onInstanceDataChanged(e,n=>{et(e,n)});Se.set(e,t)}function xi(e){const t=Se.get(e);t&&(t(),Se.delete(e))}function et(e,t){fr(n=>{const r=new Map(n);return r.set(e,hr(t)),r})}async function dt(e){if(!e||Ht().has(e))return;if(Ke.has(e)){await Ke.get(e);return}const t=B.loadInstanceData(e).then(n=>{et(e,n),Cn(e)}).catch(n=>{dr.warn("Failed to load instance data",n),et(e,ut),Cn(e)}).finally(()=>{Ke.delete(e)});Ke.set(e,t),await t}async function gr(e,t){if(!e)return;await dt(e);const n=Ht().get(e)??ut,r=hr(n);t(r);try{await B.saveInstanceData(e,r)}catch(o){dr.warn("Failed to persist instance data",o)}et(e,r)}function pr(e){return Ht().get(e)??ut}function vi(e){fr(t=>{if(!t.has(e))return t;const n=new Map(t);return n.delete(e),n}),xi(e)}const Ai=xe(),ki={getInstanceConfig:pr,ensureInstanceConfig:dt,updateInstanceConfig:gr,clearInstanceConfig:vi},Ic=e=>(be(()=>{for(const t of Se.values())t();Se.clear()}),te(Ai.Provider,{value:ki,get children(){return e.children}})),$i=ie("api"),[Sn,Rt]=k(null),[Pc,On]=k(!1),[Mc,Je]=k(null);let Ae=null;async function Ei(e=!1){return!e&&Sn()?Sn():Ae||(On(!0),Je(null),Ae=j.fetchSpeechCapabilities().then(t=>(Rt(t),Je(null),t)).catch(t=>($i.error("Failed to load speech capabilities",t),Rt(null),Je(t instanceof Error?t.message:String(t)),null)).finally(()=>{On(!1),Ae=null}),Ae)}function Ti(){Rt(null),Je(null)}const C=ie("actions"),Ii=20,Pi=5,Mi=50,O={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},le={provider:"openai-compatible",sttModel:"gpt-4o-mini-transcribe",ttsModel:"gpt-4o-mini-tts",ttsVoice:"alloy",playbackMode:"streaming",ttsFormat:"mp3"};function mr(e){const t=e??{};return{showThinkingBlocks:t.showThinkingBlocks??O.showThinkingBlocks,showKeyboardShortcutHints:t.showKeyboardShortcutHints??O.showKeyboardShortcutHints,thinkingBlocksExpansion:t.thinkingBlocksExpansion??O.thinkingBlocksExpansion,showTimelineTools:t.showTimelineTools??O.showTimelineTools,holdLongAssistantReplies:t.holdLongAssistantReplies??O.holdLongAssistantReplies,promptSubmitOnEnter:t.promptSubmitOnEnter??O.promptSubmitOnEnter,showPromptVoiceInput:t.showPromptVoiceInput??O.showPromptVoiceInput,locale:t.locale??O.locale,diffViewMode:t.diffViewMode??O.diffViewMode,toolOutputExpansion:t.toolOutputExpansion??O.toolOutputExpansion,diagnosticsExpansion:t.diagnosticsExpansion??O.diagnosticsExpansion,toolInputsVisibility:t.toolInputsVisibility==="hidden"||t.toolInputsVisibility==="collapsed"||t.toolInputsVisibility==="expanded"?t.toolInputsVisibility:O.toolInputsVisibility,showUsageMetrics:t.showUsageMetrics??O.showUsageMetrics,autoCleanupBlankSessions:t.autoCleanupBlankSessions??O.autoCleanupBlankSessions,osNotificationsEnabled:t.osNotificationsEnabled??O.osNotificationsEnabled,osNotificationsAllowWhenVisible:t.osNotificationsAllowWhenVisible??O.osNotificationsAllowWhenVisible,notifyOnNeedsInput:t.notifyOnNeedsInput??O.notifyOnNeedsInput,notifyOnIdle:t.notifyOnIdle??O.notifyOnIdle}}function yr(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 br(e){const t=e??{};return{provider:t.provider==="openai-compatible"?t.provider:le.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():le.sttModel,ttsModel:typeof t.ttsModel=="string"&&t.ttsModel.trim()?t.ttsModel.trim():le.ttsModel,ttsVoice:typeof t.ttsVoice=="string"&&t.ttsVoice.trim()?t.ttsVoice.trim():le.ttsVoice,playbackMode:t.playbackMode==="buffered"||t.playbackMode==="streaming"?t.playbackMode:le.playbackMode,ttsFormat:t.ttsFormat==="wav"||t.ttsFormat==="opus"||t.ttsFormat==="aac"||t.ttsFormat==="mp3"?t.ttsFormat:le.ttsFormat}}function ke(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 Fi(e){var n,r,o;const t=e??{};return{recentFolders:ke(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:ke(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,l=typeof s.label=="string"?s.label:void 0;return{path:i,version:c,label:l,lastUsed:a}}),remoteServers:ke(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 l=typeof s.createdAt=="string"?s.createdAt:new Date().toISOString(),u=typeof s.updatedAt=="string"?s.updatedAt:l,d=typeof s.lastConnectedAt=="string"?s.lastConnectedAt:void 0;return{id:i,name:a,baseUrl:c,skipTlsVerify:!!s.skipTlsVerify,createdAt:l,updatedAt:u,lastConnectedAt:d}}).sort((s,i)=>{const a=s.lastConnectedAt??s.updatedAt;return(i.lastConnectedAt??i.updatedAt).localeCompare(a)}),models:{recents:ke((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:ke((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:yr((o=t.models)==null?void 0:o.thinkingSelections)}}}function Di(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=yr(t.environmentVariables),i=br(t.speech);return{listeningMode:n,logLevel:r,opencodeBinary:o,environmentVariables:s,speech:i}}function wr(e){return`${e.providerId}/${e.modelId}`}function Cr(e,t){const n=t.filter(r=>r.path!==e);return n.unshift({path:e,lastAccessed:Date.now()}),n.slice(0,Ii)}function Gt(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 Li(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??Ri(),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 Sr(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 Ri(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`remote-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}const[qt,tt]=k({}),[Ni,nt]=k({}),[Bi,rt]=k({}),[Or,Pe]=k(!1),Ui=v(()=>mr(qt().settings)),xr=v(()=>qt().theme??"system"),ae=v(()=>Di(Ni())),z=v(()=>Fi(Bi())),P=Ui,ft=v(()=>z().recentFolders),Be=v(()=>z().opencodeBinaries),Oe=v(()=>z().remoteServers);let He=null;async function ht(){Or()||(He||(He=Promise.all([B.loadConfigOwner("ui"),B.loadConfigOwner("server"),B.loadStateOwner("ui")]).then(([e,t,n])=>{tt(e),nt(t),rt(n),Pe(!0)}).catch(e=>{C.error("Failed to load settings",e),tt({}),nt({}),rt({}),Pe(!0)}).finally(()=>{He=null})),await He)}async function H(e,t){await ht();const n=await B.patchConfigOwner(e,t);e==="ui"&&tt(n),e==="server"&&nt(n)}async function D(e,t){await ht();const n=await B.patchStateOwner(e,t);rt(n)}function L(e){const t=qt(),r={settings:mr({...t.settings??{},...e})};H("ui",r).catch(o=>C.error("Failed to patch ui settings",o))}function vr(e){L(e)}function _i(e){xr()!==e&&H("ui",{theme:e}).catch(t=>C.error("Failed to set theme",t))}async function ji(e){ae().listeningMode!==e&&await H("server",{listeningMode:e})}function Jt(e){H("server",{environmentVariables:e}).catch(t=>C.error("Failed to update environment variables",t))}function Vi(e,t){const n=ae().environmentVariables;Jt({...n,[e]:t})}function Wi(e){const t=ae().environmentVariables,{[e]:n,...r}=t;Jt(r)}function zi(e){const t=e&&e.trim().length>0?e:"opencode";H("server",{opencodeBinary:t}).catch(r=>C.error("Failed to set default binary",r));const n=Gt(t,void 0,Be());D("ui",{opencodeBinaries:n}).catch(r=>C.error("Failed to update binary list",r))}function Ki(e){H("server",{logLevel:e??"DEBUG"}).catch(n=>C.error("Failed to set log level",n))}async function Hi(e){const t=e.apiKey,{apiKey:n,...r}=e,o=br({...ae().speech,...r,...t===null?{}:{apiKey:t}}),{hasApiKey:s,...i}=o,a={...i,...t===null?{apiKey:null}:{}};try{await H("server",{speech:a})}catch(c){throw C.error("Failed to update speech settings",c),c}}function Gi(e,t){const n=Gt(e,t,Be());D("ui",{opencodeBinaries:n}).catch(r=>C.error("Failed to add binary",r))}function qi(e){const t=Be().filter(n=>n.path!==e);D("ui",{opencodeBinaries:t}).catch(n=>C.error("Failed to remove binary",n)),ae().opencodeBinary===e&&H("server",{opencodeBinary:"opencode"}).catch(n=>C.error("Failed to reset default binary",n))}function Ji(e){const t=Cr(e,ft());D("ui",{recentFolders:t}).catch(n=>C.error("Failed to add recent folder",n))}function Xi(e){const t=ft().filter(n=>n.path!==e);D("ui",{recentFolders:t}).catch(n=>C.error("Failed to remove recent folder",n))}async function Yi(e){const t=Li(e,Oe());return await D("ui",{remoteServers:Sr(t,Oe())}),t}async function Zi(e){const t=Oe().find(o=>o.id===e);if(!t)return;const n=new Date().toISOString(),r={...t,updatedAt:n,lastConnectedAt:n};await D("ui",{remoteServers:Sr(r,Oe())})}function Qi(e){const t=Oe().filter(n=>n.id!==e);D("ui",{remoteServers:t}).catch(n=>C.error("Failed to remove remote server",n))}function ea(e,t){const n=t&&t.trim().length>0?t:ae().opencodeBinary,r=Cr(e,ft()),o=Gt(n,void 0,Be());D("ui",{recentFolders:r,opencodeBinaries:o}).catch(s=>C.error("Failed to update ui state on launch",s)),H("server",{opencodeBinary:n}).catch(s=>C.error("Failed to persist selected binary",s))}function ta(e){if(!e.providerId||!e.modelId)return;const n=z().models.recents.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId),r=[e,...n].slice(0,Pi);D("ui",{models:{recents:r}}).catch(o=>C.error("Failed to update model recents",o))}function na(e){return!e.providerId||!e.modelId?!1:z().models.favorites.some(t=>t.providerId===e.providerId&&t.modelId===e.modelId)}function ra(e){if(!e.providerId||!e.modelId)return;const t=z().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,Mi);D("ui",{models:{favorites:r}}).catch(o=>C.error("Failed to update model favorites",o))}function oa(e){if(!(!e.providerId||!e.modelId))return z().models.thinkingSelections[wr(e)]}function sa(e,t){if(!e.providerId||!e.modelId)return;const n=wr(e);if(z().models.thinkingSelections[n]===t)return;const o={...z().models.thinkingSelections};t?o[n]=t:delete o[n],D("ui",{models:{thinkingSelections:o}}).catch(s=>C.error("Failed to update thinking selection",s))}function ia(e){P().diffViewMode!==e&&L({diffViewMode:e})}function aa(e){P().toolOutputExpansion!==e&&L({toolOutputExpansion:e})}function ca(e){P().diagnosticsExpansion!==e&&L({diagnosticsExpansion:e})}function la(e){P().toolInputsVisibility!==e&&L({toolInputsVisibility:e})}function ua(e){P().thinkingBlocksExpansion!==e&&L({thinkingBlocksExpansion:e})}function da(){L({showThinkingBlocks:!P().showThinkingBlocks})}function fa(){vr({showKeyboardShortcutHints:!P().showKeyboardShortcutHints})}function ha(){L({showTimelineTools:!P().showTimelineTools})}function ga(){L({showUsageMetrics:!P().showUsageMetrics})}function pa(){L({promptSubmitOnEnter:!P().promptSubmitOnEnter})}function ma(){L({showPromptVoiceInput:!P().showPromptVoiceInput})}function ya(){const e=!P().autoCleanupBlankSessions;C.info("toggle auto cleanup",{value:e}),L({autoCleanupBlankSessions:e})}async function ba(e,t,n){!e||!t||!n.providerId||!n.modelId||(await dt(e),await gr(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 wa(e,t){return!e||!t?void 0:(await dt(e),(pr(e).agentModelSelections??{})[t])}ht().catch(e=>{C.error("Failed to initialize settings",e)});const Ar=xe(),Ca={isLoaded:Or,preferences:P,updatePreferences:vr,themePreference:xr,setThemePreference:_i,serverSettings:ae,setListeningMode:ji,updateEnvironmentVariables:Jt,addEnvironmentVariable:Vi,removeEnvironmentVariable:Wi,updateLastUsedBinary:zi,updateLogLevel:Ki,updateSpeechSettings:Hi,recentFolders:ft,opencodeBinaries:Be,remoteServers:Oe,uiState:z,addRecentFolder:Ji,removeRecentFolder:Xi,addOpenCodeBinary:Gi,removeOpenCodeBinary:qi,saveRemoteServerProfile:Yi,markRemoteServerConnected:Zi,removeRemoteServerProfile:Qi,recordWorkspaceLaunch:ea,addRecentModelPreference:ta,isFavoriteModelPreference:na,toggleFavoriteModelPreference:ra,getModelThinkingSelection:oa,setModelThinkingSelection:sa,toggleShowThinkingBlocks:da,toggleKeyboardShortcutHints:fa,toggleShowTimelineTools:ha,toggleUsageMetrics:ga,toggleAutoCleanupBlankSessions:ya,togglePromptSubmitOnEnter:pa,toggleShowPromptVoiceInput:ma,setDiffViewMode:ia,setToolOutputExpansion:aa,setDiagnosticsExpansion:ca,setThinkingBlocksExpansion:ua,setToolInputsVisibility:la,setAgentModelPreference:ba,getAgentModelPreference:wa},Fc=e=>(st(()=>{ht().catch(o=>{C.error("Failed to initialize settings",o)});const t=B.onConfigOwnerChanged("ui",o=>{tt(o),Pe(!0)}),n=B.onConfigOwnerChanged("server",o=>{nt(o),Pe(!0),Ti(),Ei(!0)}),r=B.onStateOwnerChanged("ui",o=>{rt(o),Pe(!0)});return()=>{t(),n(),r()}}),te(Ar.Provider,{value:Ca,get children(){return e.children}}));function Sa(){const e=Le(Ar);if(!e)throw new Error("useConfig must be used within ConfigProvider");return e}function Oa(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 xa=Symbol("solid-inspect"),va=xe();function Aa(e){function t(n){var r;return(r=Le(va))!=null&&r.enabled?{Component:t,props:n,$INSPECT:xa}:e(n)}return Object.defineProperty(t,"name",{value:e.name}),t.toString=e.toString,t}function kr(){return function(e){function t(a){const c=!!e.slotClasses,l=()=>{if(!e.slotClasses)throw new Error("'slotClasses' option is not defined");if(!e.utilityClass)throw new Error("'utilityClass' option is not defined");return Oa(e.slotClasses(a),e.utilityClass,a.classes??"")},u=yo({});return c&&_r(()=>{const d=l();fe(()=>{for(const h in d)u[h]=d[h]})}),u}function n(a){const[c,l]=ot(a,e.selfPropNames);return{allProps:a,props:c,otherProps:l}}function r(a){return is({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=Aa(a),a.toString=()=>`.${e.name}-root`,c&&ar(a,"base"),a}function i(a){const c=s(function(u){const{allProps:d,otherProps:h,props:g}=o(u),p=e.autoCallUseClasses??!0?t(d):{};return a({allProps:d,otherProps:h,props:g,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 ka=kr()({name:"MuiGlobalStyles",selfPropNames:["styles"]}),$a=ka.component(function({props:t}){return tr(()=>({"@global":t.styles||{}})),[]}),Ea=kr()({name:"MuiCssBaseline",selfPropNames:["children","enableColorScheme"],propDefaults:({set:e})=>e({enableColorScheme:!1})}),Ta=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&{colorScheme:e.palette.mode}}),Ia=e=>({color:e.palette.text.primary,...e.typography.body1,backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}}),Pa=(e,t=!1)=>({html:Ta(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...Ia(e),"&::backdrop":{backgroundColor:e.palette.background.default}}}),Ma=Ea.component(function({props:t}){const n=Hn();return te($a,{get styles(){return Pa(n,t.enableColorScheme)}})}),$r=xe();function xn(e){if(!(typeof document>"u")){if(e==="system"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}const Fa={backgroundDefault:"#ffffff",backgroundPaper:"#f5f5f5",primary:"#0066ff",primaryContrast:"#ffffff",textPrimary:"#1a1a1a",textSecondary:"#666666",divider:"#e0e0e0"},Da={backgroundDefault:"#1a1a1a",backgroundPaper:"#2a2a2a",primary:"#0080ff",primaryContrast:"#1a1a1a",textPrimary:"#cfd4dc",textSecondary:"#999999",divider:"#3a3a3a"},Y=(e,t,n)=>{if(!n)return t;const r=n.getPropertyValue(e);return r&&r.trim()||t},La=e=>{const t=e?Da:Fa,n=typeof window<"u"?getComputedStyle(document.documentElement):null;return{backgroundDefault:Y("--surface-base",t.backgroundDefault,n),backgroundPaper:Y("--surface-secondary",t.backgroundPaper,n),primary:Y("--accent-primary",t.primary,n),primaryContrast:Y("--text-inverted",t.primaryContrast,n),textPrimary:Y("--text-primary",t.textPrimary,n),textSecondary:Y("--text-secondary",t.textSecondary,n),divider:Y("--border-base",t.divider,n)}};function Dc(e){const t=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,{themePreference:n,setThemePreference:r}=Sa(),[o,s]=k(!0),[i,a]=k(0),c=()=>n(),l=()=>{const p=c();return p==="dark"?!0:p==="light"?!1:(t==null?void 0:t.matches)??!1},u=()=>{const p=c(),b=l();xn(p==="system"?"system":p),s(b),typeof window<"u"?requestAnimationFrame(()=>a(y=>y+1)):a(y=>y+1)};ee(()=>{u()}),st(()=>{if(!t)return;const p=()=>{u()};return t.addEventListener("change",p),()=>{t.removeEventListener("change",p)}});const d=p=>{r(p)},h=()=>{const p=c();d(p==="system"?"light":p==="light"?"dark":"system")},g=v(()=>{i();const p=La(o());return Wn({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 te($r.Provider,{value:{isDark:o,themeMode:c,setThemeMode:d,cycleThemeMode:h},get children(){return te(as,{get theme(){return g()},get children(){return[te(Ma,{}),Xr(()=>e.children)]}})}})}function Er(){const e=Le($r);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const Ra=/(^|\n)@@/m,Na=/(^|\n)(diff --git |--- |\+\+\+)/,Ba=/^\*\*\* (Begin|End) Patch/,Ua=/^\*\*\* Update File: (.+)$/,_a=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function ja(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 Va(e){var s;if(!e)return"";const n=ja(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||Ba.test(i))continue;const a=i.match(Ua);if(a){r=((s=a[1])==null?void 0:s.trim())||null;continue}o.push(i)}return r&&!Na.test(o.join(`
|
|
20
|
-
`))&&(o.unshift(`+++ b/${r}`),o.unshift(`--- a/${r}`)),o.join(`
|
|
21
|
-
`).trim()}function Lc(e){if(!e)return!1;const t=Va(e);return t?Ra.test(t):!1}function Wa(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")||_a.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 za="0.52.2",Nt=`https://cdn.jsdelivr.net/npm/monaco-editor@${za}/min/vs`,N="/monaco/vs";let Ge=null;function Ka(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 Ha(){if(typeof fetch>"u")return!1;try{const e=new AbortController,t=fetch(`${Nt}/loader.js`,{method:"HEAD",signal:e.signal}),n=await Ka(t,1200);return e.abort(),n.ok}catch{return!1}}function Ga(){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=`${N}/loader.js`,r.async=!0,r.onload=()=>t(),r.onerror=()=>n(new Error("Failed to load Monaco AMD loader")),document.head.appendChild(r)})}function qa(){if(typeof document>"u"||document.querySelector('link[data-monaco-editor-css="true"]'))return;const t=document.createElement("link");t.rel="stylesheet",t.href=`${N}/editor/editor.main.css`,t.dataset.monacoEditorCss="true",document.head.appendChild(t)}function Ja(){const e=globalThis,t=e.MonacoEnvironment??{},n="/monaco.worker.js";e.MonacoEnvironment={...t,getWorkerUrl(r,o){return n}}}function Tr(){const e=globalThis.require;if(!e)throw new Error("Monaco AMD loader is not available");return e}function Xa(){const t=Tr().config;if(!t)throw new Error("require.config is not available");return t}function Bt(e){const t=Tr();return new Promise((n,r)=>{t(e,(...o)=>n(o),o=>r(o))})}function Ya(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 vn=new Set,xt=new Map;async function Ir(e){const t=Ya(e);if(!t||vn.has(t))return;const n=xt.get(t);if(n)return n;const r=(async()=>{let o=!1;try{await Bt([t]),o=!0}catch{}finally{o&&vn.add(t),xt.delete(t)}})();return xt.set(t,r),r}async function Pr(){return Ge||(Ge=(async()=>{await Ga(),Ja(),qa();const e=await Ha(),t=Xa(),n={vs:N};e&&(n["vs/basic-languages"]=`${Nt}/basic-languages`,n["vs/language"]=`${Nt}/language`,n["vs/basic-languages/python"]=`${N}/basic-languages/python`,n["vs/basic-languages/markdown"]=`${N}/basic-languages/markdown`,n["vs/basic-languages/cpp"]=`${N}/basic-languages/cpp`,n["vs/basic-languages/kotlin"]=`${N}/basic-languages/kotlin`,n["vs/language/typescript"]=`${N}/language/typescript`,n["vs/language/html"]=`${N}/language/html`,n["vs/language/json"]=`${N}/language/json`,n["vs/language/css"]=`${N}/language/css`),t({paths:n,ignoreDuplicateModules:["vs/editor/editor.main"]});const[r]=await Bt(["vs/editor/editor.main"]);return await Bt(["vs/basic-languages/monaco.contribution"]).catch(()=>[]),globalThis.monaco??r})(),Ge)}const Za=5,J=new Map;function Qa(e,t){J.delete(e),J.set(e,t)}function ec(){for(;J.size>Za;){const e=J.keys().next().value;if(!e)return;const t=J.get(e);J.delete(e);try{t==null||t.model.dispose()}catch{}}}function Ut(e){const t=J.get(e.cacheKey);if(t)return Qa(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 J.set(e.cacheKey,o),ec(),r}let qe=null;function tc(e){var o;if(qe)return qe;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 l of a)typeof l=="string"&&(t.has(l)||t.set(l,i));const c=Array.isArray(s==null?void 0:s.extensions)?s.extensions:[];for(const l of c)typeof l=="string"&&(n.has(l)||n.set(l,i))}return qe={fileNameToId:t,extToId:n},qe}function nc(e){return e===".gitignore"||e===".gitattributes"||e===".gitmodules"||e==="Makefile"||e.startsWith("Makefile.")?"shell":null}function Mr(e,t){const n=String(t||"").trim(),r=n.split("/").pop()||n,o=nc(r);if(o)return o;const s=tc(e),i=s.fileNameToId.get(r);if(i)return i;const a=r.lastIndexOf(".");if(a>0){const c=r.slice(a),l=s.extToId.get(c);if(l)return l}return"plaintext"}var rc=Tn("<div class=monaco-viewer>");function oc(e){const{isDark:t}=Er();let n,r=null,o=null;const[s,i]=k(!1),a=v(()=>e.patch!==void 0&&e.patch!==null?Wa(e.patch):{before:e.before??"",after:e.after??""}),c=()=>{try{r==null||r.setModel(null)}catch{}try{r==null||r.dispose()}catch{}r=null};return st(()=>{let l=!1;(async()=>(o=await Pr(),!l&&(!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:!1,folding:!1,lineNumbersMinChars:4,lineDecorationsWidth:12,diffAlgorithm:"legacy",maxComputationTime:1e4}),i(!0)))))(),be(()=>{l=!0,i(!1),c()})}),ee(()=>{!s()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),ee(()=>{var h,g,p,b,y,S;if(!s()||!o||!r)return;const l=e.viewMode==="unified"?"unified":"split",u=e.contextMode==="collapsed"?"collapsed":"expanded",d=e.wordWrap==="on"?"on":"off";r.updateOptions({renderSideBySide:l==="split",renderSideBySideInlineBreakpoint:0,hideUnchangedRegions:u==="collapsed"?{enabled:!0}:{enabled:!1},wordWrap:d});try{(p=(g=(h=r.getOriginalEditor)==null?void 0:h.call(r))==null?void 0:g.updateOptions)==null||p.call(g,{wordWrap:d})}catch{}try{(S=(y=(b=r.getModifiedEditor)==null?void 0:b.call(r))==null?void 0:y.updateOptions)==null||S.call(y,{wordWrap:d})}catch{}}),ee(()=>{if(!s()||!o||!r)return;const l=Mr(o,e.path),{before:u,after:d}=a(),h=`${e.scopeKey}:diff:${e.path}:before`,g=`${e.scopeKey}:diff:${e.path}:after`,p=Ut({monaco:o,cacheKey:h,value:u}),b=Ut({monaco:o,cacheKey:g,value:d});r.setModel({original:p,modified:b}),Ir(l).then(()=>{try{o.editor.setModelLanguage(p,l),o.editor.setModelLanguage(b,l)}catch{}})}),(()=>{var l=rc(),u=n;return typeof u=="function"?_t(u,l):n=l,l})()}const Rc=Object.freeze(Object.defineProperty({__proto__:null,MonacoDiffViewer:oc},Symbol.toStringTag,{value:"Module"}));var sc=Tn("<div class=monaco-viewer>");function ic(e){const{isDark:t}=Er();let n,r=null,o=null;const[s,i]=k(!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 st(()=>{let l=!1;(async()=>(o=await Pr(),!l&&(!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)))))(),be(()=>{l=!0,i(!1),a()})}),ee(()=>{!s()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),ee(()=>{if(!s()||!o||!r)return;const l=Mr(o,e.path),u=`${e.scopeKey}:file:${e.path}`,d=Ut({monaco:o,cacheKey:u,value:e.content});r.setModel(d),Ir(l).then(()=>{try{o.editor.setModelLanguage(d,l)}catch{}})}),(()=>{var l=sc(),u=n;return typeof u=="function"?_t(u,l):n=l,l})()}const Nc=Object.freeze(Object.defineProperty({__proto__:null,MonacoFileViewer:ic},Symbol.toStringTag,{value:"Module"}));export{pr as $,ta as A,oa as B,Ec as C,gc as D,P as E,dt as F,$c as G,bc as H,kr as I,Ks as J,Cc as K,Ac as L,qs as M,ir as N,wc as O,hc as P,Oc as Q,Cs as R,xc as S,Sc as T,kc as U,yo as V,vc as W,Oo as X,So as Y,Er as Z,Lc as _,to as a,gr as a0,Tc as a1,ra as a2,sa as a3,ji as a4,Pc as a5,Mc as a6,B as a7,dc as a8,Ic as a9,Dc as aa,Fc as ab,Va as ac,Rc as ad,Nc as ae,In as b,pc as c,vt as d,Hn as e,Zr as f,fc as g,j as h,At as i,no as j,ie as k,Sa as l,Xr as m,ro as n,Ot as o,yc as p,wa as q,z as r,oo as s,Tn as t,_t as u,mc as v,Ei as w,Sn as x,ae as y,ba as z};
|