nothumanallowed 14.4.16 → 14.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "14.4.
|
|
3
|
+
"version": "14.4.17",
|
|
4
4
|
"description": "NotHumanAllowed — 38 AI agents, 80 tools, Studio (visual agentic workflows). Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, Alexandria E2E messaging, GitHub, Notion, Slack, voice chat, free AI (Liara), 28 languages. Zero-dependency CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/constants.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
|
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = path.dirname(__filename);
|
|
7
7
|
|
|
8
|
-
export const VERSION = '14.4.
|
|
8
|
+
export const VERSION = '14.4.17';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|
|
@@ -673,7 +673,9 @@ Be concise. Highlight what each agent contributed uniquely. Give your own synthe
|
|
|
673
673
|
`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``}(n||(t.C0=n={})),function(e){e.PAD=``,e.HOP=``,e.BPH=``,e.NBH=``,e.IND=``,e.NEL=`
`,e.SSA=``,e.ESA=``,e.HTS=``,e.HTJ=``,e.VTS=``,e.PLD=``,e.PLU=``,e.RI=``,e.SS2=``,e.SS3=``,e.DCS=``,e.PU1=``,e.PU2=``,e.STS=``,e.CCH=``,e.MW=``,e.SPA=``,e.EPA=``,e.SOS=``,e.SGCI=``,e.SCI=``,e.CSI=``,e.ST=``,e.OSC=``,e.PM=``,e.APC=``}(r||(t.C1=r={})),function(e){e.ST=`${n.ESC}\\`}(i||(t.C1_ESCAPED=i={}))},7399:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.evaluateKeyboardEvent=void 0;let r=n(2584),i={48:[`0`,`)`],49:[`1`,`!`],50:[`2`,`@`],51:[`3`,`#`],52:[`4`,`$`],53:[`5`,`%`],54:[`6`,`^`],55:[`7`,`&`],56:[`8`,`*`],57:[`9`,`(`],186:[`;`,`:`],187:[`=`,`+`],188:[`,`,`<`],189:[`-`,`_`],190:[`.`,`>`],191:[`/`,`?`],192:["`",`~`],219:[`[`,`{`],220:[`\\`,`|`],221:[`]`,`}`],222:[`'`,`"`]};t.evaluateKeyboardEvent=function(e,t,n,a){let o={type:0,cancel:!1,key:void 0},s=!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?o.key=t?r.C0.ESC+`OA`:r.C0.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?o.key=t?r.C0.ESC+`OD`:r.C0.ESC+`[D`:e.key===`UIKeyInputRightArrow`?o.key=t?r.C0.ESC+`OC`:r.C0.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(o.key=t?r.C0.ESC+`OB`:r.C0.ESC+`[B`);break;case 8:if(e.altKey){o.key=r.C0.ESC+r.C0.DEL;break}o.key=r.C0.DEL;break;case 9:if(e.shiftKey){o.key=r.C0.ESC+`[Z`;break}o.key=r.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?r.C0.ESC+r.C0.CR:r.C0.CR,o.cancel=!0;break;case 27:o.key=r.C0.ESC,e.altKey&&(o.key=r.C0.ESC+r.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`D`,o.key===r.C0.ESC+`[1;3D`&&(o.key=r.C0.ESC+(n?`b`:`[1;5D`))):o.key=t?r.C0.ESC+`OD`:r.C0.ESC+`[D`;break;case 39:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`C`,o.key===r.C0.ESC+`[1;3C`&&(o.key=r.C0.ESC+(n?`f`:`[1;5C`))):o.key=t?r.C0.ESC+`OC`:r.C0.ESC+`[C`;break;case 38:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`A`,n||o.key!==r.C0.ESC+`[1;3A`||(o.key=r.C0.ESC+`[1;5A`)):o.key=t?r.C0.ESC+`OA`:r.C0.ESC+`[A`;break;case 40:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`B`,n||o.key!==r.C0.ESC+`[1;3B`||(o.key=r.C0.ESC+`[1;5B`)):o.key=t?r.C0.ESC+`OB`:r.C0.ESC+`[B`;break;case 45:e.shiftKey||e.ctrlKey||(o.key=r.C0.ESC+`[2~`);break;case 46:o.key=s?r.C0.ESC+`[3;`+(s+1)+`~`:r.C0.ESC+`[3~`;break;case 36:o.key=s?r.C0.ESC+`[1;`+(s+1)+`H`:t?r.C0.ESC+`OH`:r.C0.ESC+`[H`;break;case 35:o.key=s?r.C0.ESC+`[1;`+(s+1)+`F`:t?r.C0.ESC+`OF`:r.C0.ESC+`[F`;break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=r.C0.ESC+`[5;`+(s+1)+`~`:o.key=r.C0.ESC+`[5~`;break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=r.C0.ESC+`[6;`+(s+1)+`~`:o.key=r.C0.ESC+`[6~`;break;case 112:o.key=s?r.C0.ESC+`[1;`+(s+1)+`P`:r.C0.ESC+`OP`;break;case 113:o.key=s?r.C0.ESC+`[1;`+(s+1)+`Q`:r.C0.ESC+`OQ`;break;case 114:o.key=s?r.C0.ESC+`[1;`+(s+1)+`R`:r.C0.ESC+`OR`;break;case 115:o.key=s?r.C0.ESC+`[1;`+(s+1)+`S`:r.C0.ESC+`OS`;break;case 116:o.key=s?r.C0.ESC+`[15;`+(s+1)+`~`:r.C0.ESC+`[15~`;break;case 117:o.key=s?r.C0.ESC+`[17;`+(s+1)+`~`:r.C0.ESC+`[17~`;break;case 118:o.key=s?r.C0.ESC+`[18;`+(s+1)+`~`:r.C0.ESC+`[18~`;break;case 119:o.key=s?r.C0.ESC+`[19;`+(s+1)+`~`:r.C0.ESC+`[19~`;break;case 120:o.key=s?r.C0.ESC+`[20;`+(s+1)+`~`:r.C0.ESC+`[20~`;break;case 121:o.key=s?r.C0.ESC+`[21;`+(s+1)+`~`:r.C0.ESC+`[21~`;break;case 122:o.key=s?r.C0.ESC+`[23;`+(s+1)+`~`:r.C0.ESC+`[23~`;break;case 123:o.key=s?r.C0.ESC+`[24;`+(s+1)+`~`:r.C0.ESC+`[24~`;break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(n&&!a||!e.altKey||e.metaKey)!n||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(o.key=r.C0.US),e.key===`@`&&(o.key=r.C0.NUL)):e.keyCode===65&&(o.type=1);else{let t=i[e.keyCode]?.[+!!e.shiftKey];if(t)o.key=r.C0.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),o.key=r.C0.ESC+n}else if(e.keyCode===32)o.key=r.C0.ESC+(e.ctrlKey?r.C0.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),o.key=r.C0.ESC+t,o.cancel=!0}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=r.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=r.C0.DEL:e.keyCode===219?o.key=r.C0.ESC:e.keyCode===220?o.key=r.C0.FS:e.keyCode===221&&(o.key=r.C0.GS)}return o}},482:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=1024*(this._interim-55296)+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=1024*(i-55296)+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r,i,a,o,s=0,c=0,l=0;if(this.interim[0]){let r=!1,i=this.interim[0];i&=(224&i)==192?31:(240&i)==224?15:7;let a,o=0;for(;(a=63&this.interim[++o])&&o<4;)i<<=6,i|=a;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(a=e[l++],(192&a)!=128){l--,r=!0;break}this.interim[o++]=a,i<<=6,i|=63&a}r||(c===2?i<128?l--:t[s++]=i:c===3?i<2048||i>=55296&&i<=57343||i===65279||(t[s++]=i):i<65536||i>1114111||(t[s++]=i)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;!(!(d<u)||128&(r=e[d])||128&(i=e[d+1])||128&(a=e[d+2])||128&(o=e[d+3]));)t[s++]=r,t[s++]=i,t[s++]=a,t[s++]=o,d+=4;if(r=e[d++],r<128)t[s++]=r;else if((224&r)==192){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(c=(31&r)<<6|63&i,c<128){d--;continue}t[s++]=c}else if((240&r)==224){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(c=(15&r)<<12|(63&i)<<6|63&a,c<2048||c>=55296&&c<=57343||c===65279)continue;t[s++]=c}else if((248&r)==240){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,this.interim[2]=a,s;if(o=e[d++],(192&o)!=128){d--;continue}if(c=(7&r)<<18|(63&i)<<12|(63&a)<<6|63&o,c<65536||c>1114111)continue;t[s++]=c}}return s}}},225:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeV6=void 0;let n=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],r=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],i;t.UnicodeV6=class{constructor(){if(this.version=`6`,!i){i=new Uint8Array(65536),i.fill(1),i[0]=0,i.fill(0,1,32),i.fill(0,127,160),i.fill(2,4352,4448),i[9001]=2,i[9002]=2,i.fill(2,11904,42192),i[12351]=1,i.fill(2,44032,55204),i.fill(2,63744,64256),i.fill(2,65040,65050),i.fill(2,65072,65136),i.fill(2,65280,65377),i.fill(2,65504,65511);for(let e=0;e<n.length;++e)i.fill(0,n[e][0],n[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?i[e]:function(e,t){let n,r=0,i=t.length-1;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=r;)if(n=r+i>>1,e>t[n][1])r=n+1;else{if(!(e<t[n][0]))return!0;i=n-1}return!1}(e,r)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}}},5981:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WriteBuffer=void 0;let r=n(8460),i=n(844);class a extends i.Disposable{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t)return void(this._syncCalls=0);if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let n;for(this._isSyncWriting=!0;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>5e7)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch((e=>(queueMicrotask((()=>{throw e})),Promise.resolve(!1)))).then(e=>Date.now()-n>=12?setTimeout((()=>this._innerWrite(0,e))):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-n>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}t.WriteBuffer=a},5941:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.toRgbString=t.parseColor=void 0;let n=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,r=/^[\da-f]+$/;function i(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}t.parseColor=function(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=n.exec(t);if(e){let t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(t.indexOf(`#`)===0&&(t=t.slice(1),r.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let i=parseInt(t.slice(e*r,e*r+e),16);n[r]=e===1?i<<4:e===2?i:e===3?i>>4:i>>8}return n}},t.toRgbString=function(e,t=16){let[n,r,a]=e;return`rgb:${i(n,t)}/${i(r,t)}/${i(a,t)}`}},5770:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DcsHandler=t.DcsParser=void 0;let r=n(482),i=n(8742),a=n(5770),o=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t);else this._handlerFb(this._ident,`HOOK`,t)}put(e,t,n){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n);else this._handlerFb(this._ident,`PUT`,(0,r.utf32ToString)(e,t,n))}unhook(e,t=!0){if(this._active.length){let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===n){for(;r>=0&&(n=this._active[r].unhook(e),!0!==n);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,`UNHOOK`,e);this._active=o,this._ident=0}};let s=new i.Params;s.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data=``,this._params=s,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():s,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,n),this._data.length>a.PAYLOAD_LIMIT&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then((e=>(this._params=s,this._data=``,this._hitLimit=!1,e)));return this._params=s,this._data=``,this._hitLimit=!1,t}}},2015:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;let r=n(844),i=n(8742),a=n(6242),o=n(6351);class s{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}}t.TransitionTable=s,t.VT500_TRANSITION_TABLE=function(){let e=new s(4095),t=Array.apply(null,Array(256)).map(((e,t)=>t)),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(160,0,2,0),e.add(160,8,5,8),e.add(160,6,0,6),e.add(160,11,0,11),e.add(160,13,13,13),e}();class c extends r.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new i.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,r.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new o.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},(()=>!0))}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;t<e.intermediates.length;++t){let r=e.intermediates.charCodeAt(t);if(32>r||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r,i=0,a=0,o=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,a=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===n&&a>-1){for(;a>=0&&(r=t[a](this._params),!0!==r);a--)if(r instanceof Promise)return this._parseStack.handlerPos=a,r}this._parseStack.handlers=[];break;case 4:if(!1===n&&a>-1){for(;a>=0&&(r=t[a](),!0!==r);a--)if(r instanceof Promise)return this._parseStack.handlerPos=a,r}this._parseStack.handlers=[];break;case 6:if(i=e[this._parseStack.chunkPos],r=this._dcsParser.unhook(i!==24&&i!==26,n),r)return r;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],r=this._oscParser.end(i!==24&&i!==26,n),r)return r;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let n=o;n<t;++n){switch(i=e[n],a=this._transitions.table[this.currentState<<8|(i<160?i:160)],a>>4){case 2:for(let r=n+1;;++r){if(r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:i,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let o=this._csiHandlers[this._collect<<8|i],s=o?o.length-1:-1;for(;s>=0&&(r=o[s](this._params),!0!==r);s--)if(r instanceof Promise)return this._preserveStack(3,o,s,a,n),r;s<0&&this._csiHandlerFb(this._collect<<8|i,this._params),this.precedingCodepoint=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++n<t&&(i=e[n])>47&&i<60);n--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let c=this._escHandlers[this._collect<<8|i],l=c?c.length-1:-1;for(;l>=0&&(r=c[l](),!0!==r);l--)if(r instanceof Promise)return this._preserveStack(4,c,l,a,n),r;l<0&&this._escHandlerFb(this._collect<<8|i),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|i,this._params);break;case 13:for(let r=n+1;;++r)if(r>=t||(i=e[r])===24||i===26||i===27||i>127&&i<160){this._dcsParser.put(e,n,r),n=r-1;break}break;case 14:if(r=this._dcsParser.unhook(i!==24&&i!==26),r)return this._preserveStack(6,[],0,a,n),r;i===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let r=n+1;;r++)if(r>=t||(i=e[r])<32||i>127&&i<160){this._oscParser.put(e,n,r),n=r-1;break}break;case 6:if(r=this._oscParser.end(i!==24&&i!==26),r)return this._preserveStack(5,[],0,a,n),r;i===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&a}}}t.EscapeSequenceParser=c},6242:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.OscHandler=t.OscParser=void 0;let r=n(5770),i=n(482),a=[];t.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,`START`)}_put(e,t,n){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n);else this._handlerFb(this._id,`PUT`,(0,i.utf32ToString)(e,t,n))}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+n-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===n){for(;r>=0&&(n=this._active[r].end(e),!0!==n);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}else this._handlerFb(this._id,`END`,e);this._active=a,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=(0,i.utf32ToString)(e,t,n),this._data.length>r.PAYLOAD_LIMIT&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then((e=>(this._data=``,this._hitLimit=!1,e)));return this._data=``,this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Params=void 0;let n=2147483647;class r{static fromArray(e){let t=new r;if(!e.length)return t;for(let n=+!!Array.isArray(e[0]);n<e.length;++n){let r=e[n];if(Array.isArray(r))for(let e=0;e<r.length;++e)t.addSubParam(r[e]);else t.addParam(r)}return t}constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>256)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){let e=new r(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>n?n:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>n?n:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=255&this._subParamsIdx[e];return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t<this.length;++t){let n=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,i=r[t-1];r[t-1]=~i?Math.min(10*i+e,n):e}}t.Params=r},5741:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}}},8771:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferApiView=void 0;let r=n(3785),i=n(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new r.BufferLineApiView(t)}getNullCell(){return new i.CellData}}},3785:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferLineApiView=void 0;let r=n(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}}},8285:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferNamespaceApi=void 0;let r=n(8771),i=n(8460),a=n(844);class o extends a.Disposable{constructor(e){super(),this._core=e,this._onBufferChange=this.register(new i.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new r.BufferApiView(this._core.buffers.normal,`normal`),this._alternate=new r.BufferApiView(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}t.BufferNamespaceApi=o},7975:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.toArray())))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,n)=>t(e,n.toArray())))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},7090:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;let a=n(8460),o=n(844),s=n(5295),c=n(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let l=t.BufferService=class extends o.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new s.BufferSet(e,this))}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,r&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t,n){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let i=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),i!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};t.BufferService=l=r([i(0,c.IOptionsService)],l)},7994:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},1753:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreMouseService=void 0;let a=n(2585),o=n(8460),s=n(844),c={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button!==4&&e.action===1&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function l(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=3&e.button,4&e.button&&(n|=64),8&e.button&&(n|=128),e.action===32?n|=32:e.action!==0||t||(n|=3)),n}let u=String.fromCharCode,d={DEFAULT:e=>{let t=[l(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`[M${u(t[0])}${u(t[1])}${u(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`[<${l(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`[<${l(e,!0)};${e.x};${e.y}${t}`}},f=t.CoreMouseService=class extends s.Disposable{constructor(e,t){super(),this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._onProtocolChange=this.register(new o.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(c))this.addProtocol(e,c[e]);for(let e of Object.keys(d))this.addEncoding(e,d[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};t.CoreMouseService=f=r([i(0,a.IBufferService),i(1,a.ICoreService)],f)},6975:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreService=void 0;let a=n(1439),o=n(8460),s=n(844),c=n(2585),l=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),d=t.CoreService=class extends s.Disposable{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new o.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new o.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(u)}reset(){this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(u)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split(``).map((e=>e.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split(``).map((e=>e.charCodeAt(0))))),this._onBinary.fire(e))}};t.CoreService=d=r([i(0,c.IBufferService),i(1,c.ILogService),i(2,c.IOptionsService)],d)},9074:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DecorationService=void 0;let r=n(8055),i=n(8460),a=n(844),o=n(6106),s=0,c=0;class l extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker.line)),this._onDecorationRegistered=this.register(new i.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new i.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;let t=new u(e);if(t){let e=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e<i&&(!n||(a.options.layer??`bottom`)===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,(t=>{s=t.options.x??0,c=s+(t.options.width??1),e>=s&&e<c&&(!n||(t.options.layer??`bottom`)===n)&&r(t)}))}}t.DecorationService=l;class u extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=r.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=r.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new i.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new i.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position=`full`)}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;let r=n(2585),i=n(8343);class a{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=a,t.InstantiationService=class{constructor(){this._services=new a,this._services.set(r.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=(0,i.getServiceDependencies)(e).sort(((e,t)=>e.index-t.index)),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);r.push(n)}let a=n.length>0?n[0].index:t.length;if(t.length!==a)throw Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}}},7866:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;let a=n(844),o=n(2585),s={trace:o.LogLevelEnum.TRACE,debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF},c,l=t.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange(`logLevel`,(()=>this._updateLogLevel()))),c=this}_updateLogLevel(){this._logLevel=s[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:`xterm.js: `)+t,...n)}trace(e,...t){this._logLevel<=o.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=o.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=o.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=o.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=o.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};t.LogService=l=r([i(0,o.IOptionsService)],l),t.setTraceLogger=function(e){c=e},t.traceCall=function(e,t,n){if(typeof n.value!=`function`)throw Error(`not supported`);let r=n.value;n.value=function(...e){if(c.logLevel!==o.LogLevelEnum.TRACE)return r.apply(this,e);c.trace(`GlyphRenderer#${r.name}(${e.map((e=>JSON.stringify(e))).join(`, `)})`);let t=r.apply(this,e);return c.trace(`GlyphRenderer#${r.name} return`,t),t}}},7302:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;let r=n(8460),i=n(844);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`courier-new, courier, monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:n(6114).isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRulerWidth:0};let a=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`];class o extends i.Disposable{constructor(e){super(),this._onOptionChange=this.register(new r.EventEmitter),this.onOptionChange=this._onOptionChange.event;let n=Object.assign({},t.DEFAULT_OPTIONS);for(let t in e)if(t in n)try{let r=e[t];n[t]=this._sanitizeAndValidateOption(t,r)}catch(e){console.error(e)}this.rawOptions=n,this.options=Object.assign({},n),this._setupOptions()}onSpecificOptionChange(e,t){return this.onOptionChange((n=>{n===e&&t(this.rawOptions[e])}))}onMultipleOptionChange(e,t){return this.onOptionChange((n=>{e.indexOf(n)!==-1&&t()}))}_setupOptions(){let e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},n=(e,n)=>{if(!(e in t.DEFAULT_OPTIONS))throw Error(`No option with key "${e}"`);n=this._sanitizeAndValidateOption(e,n),this.rawOptions[e]!==n&&(this.rawOptions[e]=n,this._onOptionChange.fire(e))};for(let t in this.rawOptions){let r={get:e.bind(this,t),set:n.bind(this,t)};Object.defineProperty(this.options,t,r)}}_sanitizeAndValidateOption(e,n){switch(e){case`cursorStyle`:if(n||=t.DEFAULT_OPTIONS[e],!function(e){return e===`block`||e===`underline`||e===`bar`}(n))throw Error(`"${n}" is not a valid value for ${e}`);break;case`wordSeparator`:n||=t.DEFAULT_OPTIONS[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof n==`number`&&1<=n&&n<=1e3)break;n=a.includes(n)?n:t.DEFAULT_OPTIONS[e];break;case`cursorWidth`:n=Math.floor(n);case`lineHeight`:case`tabStopWidth`:if(n<1)throw Error(`${e} cannot be less than 1, value: ${n}`);break;case`minimumContrastRatio`:n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case`scrollback`:if((n=Math.min(n,4294967295))<0)throw Error(`${e} cannot be less than 0, value: ${n}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(n<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${n}`);break;case`rows`:case`cols`:if(!n&&n!==0)throw Error(`${e} must be numeric, value: ${n}`);break;case`windowsPty`:n??={}}return n}}t.OptionsService=o},2660:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OscLinkService=void 0;let a=n(2585),o=t.OscLinkService=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(r,n))),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(o,a))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every((e=>e.line!==t))){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(n,e)))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};t.OscLinkService=o=r([i(0,a.IBufferService)],o)},8343:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;let n=`di$target`,r=`di$dependencies`;t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[r]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);let i=function(e,t,a){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);(function(e,t,i){t[n]===t?t[r].push({id:e,index:i}):(t[r]=[{id:e,index:i}],t[n]=t)})(i,e,a)};return i.toString=()=>e,t.serviceRegistry.set(e,i),i}},2585:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;let r=n(8343);var i;t.IBufferService=(0,r.createDecorator)(`BufferService`),t.ICoreMouseService=(0,r.createDecorator)(`CoreMouseService`),t.ICoreService=(0,r.createDecorator)(`CoreService`),t.ICharsetService=(0,r.createDecorator)(`CharsetService`),t.IInstantiationService=(0,r.createDecorator)(`InstantiationService`),function(e){e[e.TRACE=0]=`TRACE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARN=3]=`WARN`,e[e.ERROR=4]=`ERROR`,e[e.OFF=5]=`OFF`}(i||(t.LogLevelEnum=i={})),t.ILogService=(0,r.createDecorator)(`LogService`),t.IOptionsService=(0,r.createDecorator)(`OptionsService`),t.IOscLinkService=(0,r.createDecorator)(`OscLinkService`),t.IUnicodeService=(0,r.createDecorator)(`UnicodeService`),t.IDecorationService=(0,r.createDecorator)(`DecorationService`)},1480:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeService=void 0;let r=n(8460),i=n(225);t.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new r.EventEmitter,this.onChange=this._onChange.event;let e=new i.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0,n=e.length;for(let r=0;r<n;++r){let i=e.charCodeAt(r);if(55296<=i&&i<=56319){if(++r>=n)return t+this.wcwidth(i);let a=e.charCodeAt(r);56320<=a&&a<=57343?i=1024*(i-55296)+a-56320+65536:t+=this.wcwidth(a)}t+=this.wcwidth(i)}return t}}}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,`__esModule`,{value:!0}),e.Terminal=void 0;let t=n(9042),i=n(3236),a=n(844),o=n(5741),s=n(8285),c=n(7975),l=n(7090),u=[`cols`,`rows`];class d extends a.Disposable{constructor(e){super(),this._core=this.register(new i.Terminal(e)),this._addonManager=this.register(new o.AddonManager),this._publicOptions=Object.assign({},this._core.options);let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(u.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new c.ParserApi(this._core),this._parser}get unicode(){return this._checkProposedApi(),new l.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this.register(new s.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
674
674
|
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return t}_verifyIntegers(...e){for(let t of e)if(t===1/0||isNaN(t)||t%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(let t of e)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw Error(`This API only accepts positive integers`)}}e.Terminal=d})(),r})()))}))(),NT=2,PT=1,FT=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(NT,Math.floor(u/e.css.cell.width)),rows:Math.max(PT,Math.floor(l/e.css.cell.height))}}};function IT({wsUrl:e,projectDir:t,logs:n,className:r}){let i=(0,_.useRef)(null),a=(0,_.useRef)(null),o=(0,_.useRef)(null),s=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(!i.current)return;let e=new MT.Terminal({theme:{background:`#0d1117`,foreground:`#e6edf3`,cursor:`#6366f1`,selectionBackground:`rgba(99, 102, 241, 0.3)`,black:`#0d1117`,red:`#f87171`,green:`#4ade80`,yellow:`#facc15`,blue:`#60a5fa`,magenta:`#c084fc`,cyan:`#22d3ee`,white:`#e6edf3`,brightBlack:`#484f58`,brightRed:`#fca5a5`,brightGreen:`#86efac`,brightYellow:`#fde68a`,brightBlue:`#93c5fd`,brightMagenta:`#d8b4fe`,brightCyan:`#67e8f9`,brightWhite:`#ffffff`},fontSize:12,fontFamily:`'SF Mono', Monaco, 'Cascadia Code', monospace`,cursorBlink:!0,cursorStyle:`bar`,scrollback:5e3,convertEol:!0}),t=new FT;e.loadAddon(t),e.open(i.current),t.fit(),a.current=e,o.current=t;let n=new ResizeObserver(()=>{try{t.fit()}catch{}});return n.observe(i.current),()=>{n.disconnect(),e.dispose(),a.current=null,o.current=null}},[]),(0,_.useEffect)(()=>{if(!a.current)return;let n=a.current,r=window.location.protocol===`https:`?`wss:`:`ws:`,i=e||`${r}//${window.location.host}/ws/terminal${t?`?cwd=${encodeURIComponent(t)}`:``}`,o=new WebSocket(i);return s.current=o,o.binaryType=`arraybuffer`,o.onmessage=e=>{e.data instanceof ArrayBuffer?n.write(new Uint8Array(e.data)):n.write(e.data)},o.onclose=()=>{n.write(`\r
|
|
675
675
|
\x1B[90m[disconnected]\x1B[0m\r
|
|
676
|
-
`)},n.onData(e=>{o.readyState===WebSocket.OPEN&&o.send(e)}),()=>{o.close(),s.current=null}},[e,t]),(0,_.useEffect)(()=>{if(!n||!a.current)return;let e=a.current;for(let t of n)e.writeln(t)},[n]),(0,k.jsx)(`div`,{ref:i,className:r,style:{flex:1,minHeight:0,overflow:`hidden`,background:`#0d1117`}})}var $={root:`_root_pvj3h_2`,header:`_header_pvj3h_10`,title:`_title_pvj3h_21`,subtitle:`_subtitle_pvj3h_28`,headerTabs:`_headerTabs_pvj3h_34`,tabBtn:`_tabBtn_pvj3h_40`,tabActive:`_tabActive_pvj3h_51`,body:`_body_pvj3h_58`,editor:`_editor_pvj3h_67`,examples:`_examples_pvj3h_75`,sectionLabel:`_sectionLabel_pvj3h_81`,examplePills:`_examplePills_pvj3h_89`,examplePill:`_examplePill_pvj3h_89`,editorCols:`_editorCols_pvj3h_109`,leftSidebar:`_leftSidebar_pvj3h_119`,panel:`_panel_pvj3h_128`,panelHeader:`_panelHeader_pvj3h_135`,panelTitle:`_panelTitle_pvj3h_142`,addBtn:`_addBtn_pvj3h_149`,blockLabel:`_blockLabel_pvj3h_160`,blockCheck:`_blockCheck_pvj3h_170`,authField:`_authField_pvj3h_173`,authFieldInput:`_authFieldInput_pvj3h_183`,authFieldSelect:`_authFieldSelect_pvj3h_193`,authFieldReq:`_authFieldReq_pvj3h_204`,removeFieldBtn:`_removeFieldBtn_pvj3h_205`,skillsList:`_skillsList_pvj3h_208`,skillRow:`_skillRow_pvj3h_210`,skillIcon:`_skillIcon_pvj3h_218`,skillName:`_skillName_pvj3h_220`,skillBadge:`_skillBadge_pvj3h_229`,skillBadge_skill:`_skillBadge_skill_pvj3h_237`,skillBadge_memory:`_skillBadge_memory_pvj3h_238`,skillBadge_provider:`_skillBadge_provider_pvj3h_239`,skillBadge_log:`_skillBadge_log_pvj3h_240`,skillEmpty:`_skillEmpty_pvj3h_242`,skillBtn:`_skillBtn_pvj3h_244`,skillsEmpty:`_skillsEmpty_pvj3h_246`,snapshotRow:`_snapshotRow_pvj3h_249`,snapshotTs:`_snapshotTs_pvj3h_258`,snapshotCount:`_snapshotCount_pvj3h_259`,snapshotBtn:`_snapshotBtn_pvj3h_260`,genStatus:`_genStatus_pvj3h_263`,repairStatus:`_repairStatus_pvj3h_265`,repairStatusTitle:`_repairStatusTitle_pvj3h_266`,repairStatusProg:`_repairStatusProg_pvj3h_267`,repairStatusFile:`_repairStatusFile_pvj3h_268`,actionRow:`_actionRow_pvj3h_271`,actionBtn:`_actionBtn_pvj3h_273`,actionBtnIcon:`_actionBtnIcon_pvj3h_275`,actionBtnActive:`_actionBtnActive_pvj3h_276`,repairBtn:`_repairBtn_pvj3h_278`,sandboxBtn:`_sandboxBtn_pvj3h_280`,statsBar:`_statsBar_pvj3h_282`,rightPanel:`_rightPanel_pvj3h_285`,rightTabBar:`_rightTabBar_pvj3h_296`,rightTab:`_rightTab_pvj3h_296`,rightTabActive:`_rightTabActive_pvj3h_313`,repairBar:`_repairBar_pvj3h_316`,repairBarRow:`_repairBarRow_pvj3h_326`,repairBarIcon:`_repairBarIcon_pvj3h_327`,repairBarLabel:`_repairBarLabel_pvj3h_328`,repairBarFile:`_repairBarFile_pvj3h_329`,repairBarCounter:`_repairBarCounter_pvj3h_330`,repairBarTime:`_repairBarTime_pvj3h_331`,genBar:`_genBar_pvj3h_333`,genBarRow:`_genBarRow_pvj3h_343`,genBarRobot:`_genBarRobot_pvj3h_344`,robotBob:`_robotBob_pvj3h_1`,genBarLabel:`_genBarLabel_pvj3h_345`,genBarFile:`_genBarFile_pvj3h_346`,genBarCounter:`_genBarCounter_pvj3h_347`,genBarTime:`_genBarTime_pvj3h_348`,progressTrack:`_progressTrack_pvj3h_350`,repairProgress:`_repairProgress_pvj3h_351`,genProgress:`_genProgress_pvj3h_352`,genDots:`_genDots_pvj3h_355`,dot:`_dot_pvj3h_356`,dot1:`_dot1_pvj3h_357`,dotBounce:`_dotBounce_pvj3h_1`,dot2:`_dot2_pvj3h_358`,dot3:`_dot3_pvj3h_359`,stopBtn:`_stopBtn_pvj3h_362`,codeArea:`_codeArea_pvj3h_365`,sandboxWrap:`_sandboxWrap_pvj3h_366`,sandboxFrame:`_sandboxFrame_pvj3h_367`,sandboxEmpty:`_sandboxEmpty_pvj3h_368`,sandboxStartBtn:`_sandboxStartBtn_pvj3h_369`,sandboxStatusBar:`_sandboxStatusBar_pvj3h_372`,sandboxStatusDot:`_sandboxStatusDot_pvj3h_381`,sandboxStatusText:`_sandboxStatusText_pvj3h_382`,sandboxStartBtnSmall:`_sandboxStartBtnSmall_pvj3h_383`,sandboxConsole:`_sandboxConsole_pvj3h_386`,sandboxConsoleCollapsed:`_sandboxConsoleCollapsed_pvj3h_395`,sandboxConsoleHeader:`_sandboxConsoleHeader_pvj3h_396`,sandboxConsoleTitle:`_sandboxConsoleTitle_pvj3h_408`,sandboxConsolePort:`_sandboxConsolePort_pvj3h_409`,sandboxConsoleDots:`_sandboxConsoleDots_pvj3h_410`,sandboxConsoleToggle:`_sandboxConsoleToggle_pvj3h_411`,sandboxReloadBtn:`_sandboxReloadBtn_pvj3h_412`,sandboxStopBtn:`_sandboxStopBtn_pvj3h_414`,sandboxConsoleBody:`_sandboxConsoleBody_pvj3h_416`,sandboxLogLine:`_sandboxLogLine_pvj3h_422`,sandboxLogPhase:`_sandboxLogPhase_pvj3h_431`,sandboxLogError:`_sandboxLogError_pvj3h_432`,sandboxLogWarn:`_sandboxLogWarn_pvj3h_433`,sandboxLogOk:`_sandboxLogOk_pvj3h_434`,codeLayout:`_codeLayout_pvj3h_437`,codeRow:`_codeRow_pvj3h_446`,ideTabBar:`_ideTabBar_pvj3h_454`,ideTab:`_ideTab_pvj3h_454`,ideTabActive:`_ideTabActive_pvj3h_486`,ideTabError:`_ideTabError_pvj3h_491`,ideTabPending:`_ideTabPending_pvj3h_492`,ideTabIcon:`_ideTabIcon_pvj3h_493`,ideTabName:`_ideTabName_pvj3h_494`,ideTabDot:`_ideTabDot_pvj3h_495`,ideTabUnsaved:`_ideTabUnsaved_pvj3h_501`,codeEditorWrap:`_codeEditorWrap_pvj3h_509`,editToggleBtn:`_editToggleBtn_pvj3h_520`,editToggleBtnActive:`_editToggleBtnActive_pvj3h_531`,codeEditor:`_codeEditor_pvj3h_509`,genCursor:`_genCursor_pvj3h_553`,cursorBlink:`_cursorBlink_pvj3h_1`,diffOverlay:`_diffOverlay_pvj3h_562`,diffOverlayHeader:`_diffOverlayHeader_pvj3h_571`,diffOverlayActions:`_diffOverlayActions_pvj3h_582`,diffAcceptBtn:`_diffAcceptBtn_pvj3h_583`,diffRejectBtn:`_diffRejectBtn_pvj3h_584`,diffOverlayBody:`_diffOverlayBody_pvj3h_585`,diffSame:`_diffSame_pvj3h_586`,diffRem:`_diffRem_pvj3h_587`,diffAdd:`_diffAdd_pvj3h_588`,noFiles:`_noFiles_pvj3h_590`,noFilesHero:`_noFilesHero_pvj3h_600`,noFilesIcon:`_noFilesIcon_pvj3h_607`,noFilesTitle:`_noFilesTitle_pvj3h_609`,noFilesTagline:`_noFilesTagline_pvj3h_616`,noFilesSteps:`_noFilesSteps_pvj3h_621`,noFilesStep:`_noFilesStep_pvj3h_621`,noFilesStepNum:`_noFilesStepNum_pvj3h_638`,noFilesExamplesHint:`_noFilesExamplesHint_pvj3h_652`,noFilesExampleBtn:`_noFilesExampleBtn_pvj3h_662`,codeViewer:`_codeViewer_pvj3h_674`,codeHeader:`_codeHeader_pvj3h_682`,codeFileIcon:`_codeFileIcon_pvj3h_695`,codeFileName:`_codeFileName_pvj3h_696`,codeFileMeta:`_codeFileMeta_pvj3h_697`,fileError:`_fileError_pvj3h_699`,fileSyntaxError:`_fileSyntaxError_pvj3h_700`,filePending:`_filePending_pvj3h_701`,codeWithLines:`_codeWithLines_pvj3h_704`,lineNumbers:`_lineNumbers_pvj3h_711`,lineNum:`_lineNum_pvj3h_711`,code:`_code_pvj3h_365`,codeError:`_codeError_pvj3h_742`,codeSyntaxError:`_codeSyntaxError_pvj3h_743`,fileSidebar:`_fileSidebar_pvj3h_746`,fileSidebarHeader:`_fileSidebarHeader_pvj3h_755`,fileTab:`_fileTab_pvj3h_765`,fileTabActive:`_fileTabActive_pvj3h_781`,fileTabError:`_fileTabError_pvj3h_782`,fileTabRow:`_fileTabRow_pvj3h_784`,fileTabIcon:`_fileTabIcon_pvj3h_785`,fileTabName:`_fileTabName_pvj3h_786`,fileTabSize:`_fileTabSize_pvj3h_787`,fileTabDir:`_fileTabDir_pvj3h_788`,fileTabTokens:`_fileTabTokens_pvj3h_789`,fileTabMeta:`_fileTabMeta_pvj3h_790`,projectsList:`_projectsList_pvj3h_793`,emptyProjects:`_emptyProjects_pvj3h_795`,emptyIcon:`_emptyIcon_pvj3h_796`,emptyHint:`_emptyHint_pvj3h_797`,projectCard:`_projectCard_pvj3h_799`,projectInfo:`_projectInfo_pvj3h_800`,projectName:`_projectName_pvj3h_801`,projectDesc:`_projectDesc_pvj3h_802`,projectMeta:`_projectMeta_pvj3h_803`,openBtn:`_openBtn_pvj3h_804`,deleteBtn:`_deleteBtn_pvj3h_805`,planBanner:`_planBanner_pvj3h_808`,planTitle:`_planTitle_pvj3h_817`,planText:`_planText_pvj3h_818`,planActions:`_planActions_pvj3h_819`,planApprove:`_planApprove_pvj3h_820`,planReject:`_planReject_pvj3h_821`,grepPanel:`_grepPanel_pvj3h_824`,grepRow:`_grepRow_pvj3h_833`,grepInput:`_grepInput_pvj3h_834`,grepBtn:`_grepBtn_pvj3h_836`,grepClose:`_grepClose_pvj3h_837`,grepCount:`_grepCount_pvj3h_838`,grepResults:`_grepResults_pvj3h_839`,grepEmpty:`_grepEmpty_pvj3h_840`,grepMatch:`_grepMatch_pvj3h_841`,grepMatchFile:`_grepMatchFile_pvj3h_843`,grepMatchLine:`_grepMatchLine_pvj3h_844`,diffPanel:`_diffPanel_pvj3h_847`,diffHeader:`_diffHeader_pvj3h_856`,diffClose:`_diffClose_pvj3h_857`,diffFile:`_diffFile_pvj3h_858`,diffSummary:`_diffSummary_pvj3h_859`,diffArrow:`_diffArrow_pvj3h_860`,diffFileName:`_diffFileName_pvj3h_861`,diffAdded:`_diffAdded_pvj3h_862`,diffRemoved:`_diffRemoved_pvj3h_863`,diffContent:`_diffContent_pvj3h_864`,diffInline:`_diffInline_pvj3h_867`,diffInlineHeader:`_diffInlineHeader_pvj3h_868`,diffRemLine:`_diffRemLine_pvj3h_869`,diffAddLine:`_diffAddLine_pvj3h_870`,chatPanel:`_chatPanel_pvj3h_873`,chatMessages:`_chatMessages_pvj3h_882`,chatWelcome:`_chatWelcome_pvj3h_884`,doctrineOpenBtn:`_doctrineOpenBtn_pvj3h_885`,streamingPre:`_streamingPre_pvj3h_888`,streamingCursor:`_streamingCursor_pvj3h_901`,streamBlink:`_streamBlink_pvj3h_1`,doctrineSubtitle:`_doctrineSubtitle_pvj3h_908`,doctrineSection:`_doctrineSection_pvj3h_909`,doctrineSectionTitle:`_doctrineSectionTitle_pvj3h_914`,doctrineSectionBody:`_doctrineSectionBody_pvj3h_921`,doctrineBullet:`_doctrineBullet_pvj3h_930`,chatUser:`_chatUser_pvj3h_940`,chatUserBubble:`_chatUserBubble_pvj3h_941`,chatAttachPreviews:`_chatAttachPreviews_pvj3h_942`,chatAttachBadge:`_chatAttachBadge_pvj3h_943`,chatSystem:`_chatSystem_pvj3h_945`,chatSystemBubble:`_chatSystemBubble_pvj3h_946`,chatSyntaxErr:`_chatSyntaxErr_pvj3h_947`,chatAgent:`_chatAgent_pvj3h_949`,chatAgentCard:`_chatAgentCard_pvj3h_950`,chatAgentHeader:`_chatAgentHeader_pvj3h_951`,chatAgentRobot:`_chatAgentRobot_pvj3h_952`,chatAgentRobotAnim:`_chatAgentRobotAnim_pvj3h_953`,chatAgentLabel:`_chatAgentLabel_pvj3h_954`,chatRunningDots:`_chatRunningDots_pvj3h_955`,chatAgentText:`_chatAgentText_pvj3h_956`,chatToolBadges:`_chatToolBadges_pvj3h_957`,toolBadge:`_toolBadge_pvj3h_958`,toolBadgeOk:`_toolBadgeOk_pvj3h_959`,toolBadgeErr:`_toolBadgeErr_pvj3h_960`,cursor:`_cursor_pvj3h_962`,blink:`_blink_pvj3h_1`,attachPreviews:`_attachPreviews_pvj3h_965`,attachBadge:`_attachBadge_pvj3h_966`,removeAttachBtn:`_removeAttachBtn_pvj3h_967`,projNameRow:`_projNameRow_pvj3h_970`,projNameLabel:`_projNameLabel_pvj3h_971`,projNameInput:`_projNameInput_pvj3h_972`,projActiveRow:`_projActiveRow_pvj3h_973`,projActiveName:`_projActiveName_pvj3h_974`,chatInputRow:`_chatInputRow_pvj3h_977`,attachLabel:`_attachLabel_pvj3h_978`,chatTextarea:`_chatTextarea_pvj3h_979`,chatSendCol:`_chatSendCol_pvj3h_982`,chatSendBtn:`_chatSendBtn_pvj3h_983`,chatStopBtn:`_chatStopBtn_pvj3h_985`,modalOverlay:`_modalOverlay_pvj3h_988`,modal:`_modal_pvj3h_988`,modalHeader:`_modalHeader_pvj3h_1010`,modalTitle:`_modalTitle_pvj3h_1011`,modalClose:`_modalClose_pvj3h_1012`,modalBody:`_modalBody_pvj3h_1014`,modalRow:`_modalRow_pvj3h_1016`,modalField:`_modalField_pvj3h_1017`,modalLabel:`_modalLabel_pvj3h_1018`,modalLabelRow:`_modalLabelRow_pvj3h_1019`,modalSelect:`_modalSelect_pvj3h_1021`,modalInput:`_modalInput_pvj3h_1022`,modalHint:`_modalHint_pvj3h_1025`,modalAiBox:`_modalAiBox_pvj3h_1027`,modalAiRow:`_modalAiRow_pvj3h_1028`,modalAiDesc:`_modalAiDesc_pvj3h_1029`,modalAiBtn:`_modalAiBtn_pvj3h_1030`,modalContentArea:`_modalContentArea_pvj3h_1033`,logView:`_logView_pvj3h_1036`,modalFooter:`_modalFooter_pvj3h_1038`,modalCancelBtn:`_modalCancelBtn_pvj3h_1039`,modalSaveBtn:`_modalSaveBtn_pvj3h_1040`,fileTreeWrap:`_fileTreeWrap_pvj3h_1043`,headerIconBtn:`_headerIconBtn_pvj3h_1053`,headerIconBtnActive:`_headerIconBtnActive_pvj3h_1064`,terminalPanel:`_terminalPanel_pvj3h_1067`,terminalHeader:`_terminalHeader_pvj3h_1075`,terminalTitle:`_terminalTitle_pvj3h_1084`,terminalClose:`_terminalClose_pvj3h_1085`,findBar:`_findBar_pvj3h_1088`,findInput:`_findInput_pvj3h_1097`,findCount:`_findCount_pvj3h_1108`,findBtn:`_findBtn_pvj3h_1109`,findClose:`_findClose_pvj3h_1111`},LT=[{name:`MySaaS`,desc:`Full-stack SaaS web application with Node.js/Express backend and vanilla JS frontend.
|
|
676
|
+
`)},n.onData(e=>{o.readyState===WebSocket.OPEN&&o.send(e)}),()=>{o.close(),s.current=null}},[e,t]),(0,_.useEffect)(()=>{if(!n||!a.current)return;let e=a.current;for(let t of n)e.writeln(t)},[n]),(0,k.jsx)(`div`,{ref:i,className:r,style:{flex:1,minHeight:0,overflow:`hidden`,background:`#0d1117`}})}var $={root:`_root_pvj3h_2`,header:`_header_pvj3h_10`,title:`_title_pvj3h_21`,subtitle:`_subtitle_pvj3h_28`,headerTabs:`_headerTabs_pvj3h_34`,tabBtn:`_tabBtn_pvj3h_40`,tabActive:`_tabActive_pvj3h_51`,body:`_body_pvj3h_58`,editor:`_editor_pvj3h_67`,examples:`_examples_pvj3h_75`,sectionLabel:`_sectionLabel_pvj3h_81`,examplePills:`_examplePills_pvj3h_89`,examplePill:`_examplePill_pvj3h_89`,editorCols:`_editorCols_pvj3h_109`,leftSidebar:`_leftSidebar_pvj3h_119`,panel:`_panel_pvj3h_128`,panelHeader:`_panelHeader_pvj3h_135`,panelTitle:`_panelTitle_pvj3h_142`,addBtn:`_addBtn_pvj3h_149`,blockLabel:`_blockLabel_pvj3h_160`,blockCheck:`_blockCheck_pvj3h_170`,authField:`_authField_pvj3h_173`,authFieldInput:`_authFieldInput_pvj3h_183`,authFieldSelect:`_authFieldSelect_pvj3h_193`,authFieldReq:`_authFieldReq_pvj3h_204`,removeFieldBtn:`_removeFieldBtn_pvj3h_205`,skillsList:`_skillsList_pvj3h_208`,skillRow:`_skillRow_pvj3h_210`,skillIcon:`_skillIcon_pvj3h_218`,skillName:`_skillName_pvj3h_220`,skillBadge:`_skillBadge_pvj3h_229`,skillBadge_skill:`_skillBadge_skill_pvj3h_237`,skillBadge_memory:`_skillBadge_memory_pvj3h_238`,skillBadge_provider:`_skillBadge_provider_pvj3h_239`,skillBadge_log:`_skillBadge_log_pvj3h_240`,skillEmpty:`_skillEmpty_pvj3h_242`,skillBtn:`_skillBtn_pvj3h_244`,skillsEmpty:`_skillsEmpty_pvj3h_246`,snapshotRow:`_snapshotRow_pvj3h_249`,snapshotTs:`_snapshotTs_pvj3h_258`,snapshotCount:`_snapshotCount_pvj3h_259`,snapshotBtn:`_snapshotBtn_pvj3h_260`,genStatus:`_genStatus_pvj3h_263`,repairStatus:`_repairStatus_pvj3h_265`,repairStatusTitle:`_repairStatusTitle_pvj3h_266`,repairStatusProg:`_repairStatusProg_pvj3h_267`,repairStatusFile:`_repairStatusFile_pvj3h_268`,actionRow:`_actionRow_pvj3h_271`,actionBtn:`_actionBtn_pvj3h_273`,actionBtnIcon:`_actionBtnIcon_pvj3h_275`,actionBtnActive:`_actionBtnActive_pvj3h_276`,repairBtn:`_repairBtn_pvj3h_278`,sandboxBtn:`_sandboxBtn_pvj3h_280`,statsBar:`_statsBar_pvj3h_282`,rightPanel:`_rightPanel_pvj3h_285`,rightTabBar:`_rightTabBar_pvj3h_296`,rightTab:`_rightTab_pvj3h_296`,rightTabActive:`_rightTabActive_pvj3h_313`,repairBar:`_repairBar_pvj3h_316`,repairBarRow:`_repairBarRow_pvj3h_326`,repairBarIcon:`_repairBarIcon_pvj3h_327`,repairBarLabel:`_repairBarLabel_pvj3h_328`,repairBarFile:`_repairBarFile_pvj3h_329`,repairBarCounter:`_repairBarCounter_pvj3h_330`,repairBarTime:`_repairBarTime_pvj3h_331`,genBar:`_genBar_pvj3h_333`,genBarRow:`_genBarRow_pvj3h_343`,genBarRobot:`_genBarRobot_pvj3h_344`,robotBob:`_robotBob_pvj3h_1`,genBarLabel:`_genBarLabel_pvj3h_345`,genBarFile:`_genBarFile_pvj3h_346`,genBarCounter:`_genBarCounter_pvj3h_347`,genBarTime:`_genBarTime_pvj3h_348`,progressTrack:`_progressTrack_pvj3h_350`,repairProgress:`_repairProgress_pvj3h_351`,genProgress:`_genProgress_pvj3h_352`,genDots:`_genDots_pvj3h_355`,dot:`_dot_pvj3h_356`,dot1:`_dot1_pvj3h_357`,dotBounce:`_dotBounce_pvj3h_1`,dot2:`_dot2_pvj3h_358`,dot3:`_dot3_pvj3h_359`,stopBtn:`_stopBtn_pvj3h_362`,codeArea:`_codeArea_pvj3h_365`,sandboxWrap:`_sandboxWrap_pvj3h_366`,sandboxFrame:`_sandboxFrame_pvj3h_367`,sandboxEmpty:`_sandboxEmpty_pvj3h_368`,sandboxStartBtn:`_sandboxStartBtn_pvj3h_369`,sandboxStatusBar:`_sandboxStatusBar_pvj3h_372`,sandboxStatusDot:`_sandboxStatusDot_pvj3h_381`,sandboxStatusText:`_sandboxStatusText_pvj3h_382`,sandboxStartBtnSmall:`_sandboxStartBtnSmall_pvj3h_383`,sandboxConsole:`_sandboxConsole_pvj3h_386`,sandboxConsoleCollapsed:`_sandboxConsoleCollapsed_pvj3h_395`,sandboxConsoleHeader:`_sandboxConsoleHeader_pvj3h_396`,sandboxConsoleTitle:`_sandboxConsoleTitle_pvj3h_408`,sandboxConsolePort:`_sandboxConsolePort_pvj3h_409`,sandboxConsoleDots:`_sandboxConsoleDots_pvj3h_410`,sandboxConsoleToggle:`_sandboxConsoleToggle_pvj3h_411`,sandboxReloadBtn:`_sandboxReloadBtn_pvj3h_412`,sandboxStopBtn:`_sandboxStopBtn_pvj3h_414`,sandboxConsoleBody:`_sandboxConsoleBody_pvj3h_416`,sandboxLogLine:`_sandboxLogLine_pvj3h_422`,sandboxLogPhase:`_sandboxLogPhase_pvj3h_431`,sandboxLogError:`_sandboxLogError_pvj3h_432`,sandboxLogWarn:`_sandboxLogWarn_pvj3h_433`,sandboxLogOk:`_sandboxLogOk_pvj3h_434`,codeLayout:`_codeLayout_pvj3h_437`,codeRow:`_codeRow_pvj3h_446`,ideTabBar:`_ideTabBar_pvj3h_454`,ideTab:`_ideTab_pvj3h_454`,ideTabActive:`_ideTabActive_pvj3h_486`,ideTabError:`_ideTabError_pvj3h_491`,ideTabPending:`_ideTabPending_pvj3h_492`,ideTabIcon:`_ideTabIcon_pvj3h_493`,ideTabName:`_ideTabName_pvj3h_494`,ideTabDot:`_ideTabDot_pvj3h_495`,ideTabUnsaved:`_ideTabUnsaved_pvj3h_501`,codeEditorWrap:`_codeEditorWrap_pvj3h_509`,editToggleBtn:`_editToggleBtn_pvj3h_520`,editToggleBtnActive:`_editToggleBtnActive_pvj3h_531`,codeEditor:`_codeEditor_pvj3h_509`,genCursor:`_genCursor_pvj3h_553`,cursorBlink:`_cursorBlink_pvj3h_1`,diffOverlay:`_diffOverlay_pvj3h_562`,diffOverlayHeader:`_diffOverlayHeader_pvj3h_571`,diffOverlayActions:`_diffOverlayActions_pvj3h_582`,diffAcceptBtn:`_diffAcceptBtn_pvj3h_583`,diffRejectBtn:`_diffRejectBtn_pvj3h_584`,diffOverlayBody:`_diffOverlayBody_pvj3h_585`,diffSame:`_diffSame_pvj3h_586`,diffRem:`_diffRem_pvj3h_587`,diffAdd:`_diffAdd_pvj3h_588`,noFiles:`_noFiles_pvj3h_590`,noFilesHero:`_noFilesHero_pvj3h_600`,noFilesIcon:`_noFilesIcon_pvj3h_607`,noFilesTitle:`_noFilesTitle_pvj3h_609`,noFilesTagline:`_noFilesTagline_pvj3h_616`,noFilesSteps:`_noFilesSteps_pvj3h_621`,noFilesStep:`_noFilesStep_pvj3h_621`,noFilesStepNum:`_noFilesStepNum_pvj3h_638`,noFilesExamplesHint:`_noFilesExamplesHint_pvj3h_652`,noFilesExampleBtn:`_noFilesExampleBtn_pvj3h_662`,codeViewer:`_codeViewer_pvj3h_674`,codeHeader:`_codeHeader_pvj3h_682`,codeFileIcon:`_codeFileIcon_pvj3h_695`,codeFileName:`_codeFileName_pvj3h_696`,codeFileMeta:`_codeFileMeta_pvj3h_697`,fileError:`_fileError_pvj3h_699`,fileSyntaxError:`_fileSyntaxError_pvj3h_700`,filePending:`_filePending_pvj3h_701`,codeWithLines:`_codeWithLines_pvj3h_704`,lineNumbers:`_lineNumbers_pvj3h_711`,lineNum:`_lineNum_pvj3h_711`,code:`_code_pvj3h_365`,codeError:`_codeError_pvj3h_742`,codeSyntaxError:`_codeSyntaxError_pvj3h_743`,fileSidebar:`_fileSidebar_pvj3h_746`,fileSidebarHeader:`_fileSidebarHeader_pvj3h_755`,fileTab:`_fileTab_pvj3h_765`,fileTabActive:`_fileTabActive_pvj3h_781`,fileTabError:`_fileTabError_pvj3h_782`,fileTabRow:`_fileTabRow_pvj3h_784`,fileTabIcon:`_fileTabIcon_pvj3h_785`,fileTabName:`_fileTabName_pvj3h_786`,fileTabSize:`_fileTabSize_pvj3h_787`,fileTabDir:`_fileTabDir_pvj3h_788`,fileTabTokens:`_fileTabTokens_pvj3h_789`,fileTabMeta:`_fileTabMeta_pvj3h_790`,projectsList:`_projectsList_pvj3h_793`,emptyProjects:`_emptyProjects_pvj3h_795`,emptyIcon:`_emptyIcon_pvj3h_796`,emptyHint:`_emptyHint_pvj3h_797`,projectCard:`_projectCard_pvj3h_799`,projectInfo:`_projectInfo_pvj3h_800`,projectName:`_projectName_pvj3h_801`,projectDesc:`_projectDesc_pvj3h_802`,projectMeta:`_projectMeta_pvj3h_803`,openBtn:`_openBtn_pvj3h_804`,deleteBtn:`_deleteBtn_pvj3h_805`,planBanner:`_planBanner_pvj3h_808`,planTitle:`_planTitle_pvj3h_817`,planText:`_planText_pvj3h_818`,planActions:`_planActions_pvj3h_819`,planApprove:`_planApprove_pvj3h_820`,planReject:`_planReject_pvj3h_821`,grepPanel:`_grepPanel_pvj3h_824`,grepRow:`_grepRow_pvj3h_833`,grepInput:`_grepInput_pvj3h_834`,grepBtn:`_grepBtn_pvj3h_836`,grepClose:`_grepClose_pvj3h_837`,grepCount:`_grepCount_pvj3h_838`,grepResults:`_grepResults_pvj3h_839`,grepEmpty:`_grepEmpty_pvj3h_840`,grepMatch:`_grepMatch_pvj3h_841`,grepMatchFile:`_grepMatchFile_pvj3h_843`,grepMatchLine:`_grepMatchLine_pvj3h_844`,diffPanel:`_diffPanel_pvj3h_847`,diffHeader:`_diffHeader_pvj3h_856`,diffClose:`_diffClose_pvj3h_857`,diffFile:`_diffFile_pvj3h_858`,diffSummary:`_diffSummary_pvj3h_859`,diffArrow:`_diffArrow_pvj3h_860`,diffFileName:`_diffFileName_pvj3h_861`,diffAdded:`_diffAdded_pvj3h_862`,diffRemoved:`_diffRemoved_pvj3h_863`,diffContent:`_diffContent_pvj3h_864`,diffInline:`_diffInline_pvj3h_867`,diffInlineHeader:`_diffInlineHeader_pvj3h_868`,diffRemLine:`_diffRemLine_pvj3h_869`,diffAddLine:`_diffAddLine_pvj3h_870`,chatPanel:`_chatPanel_pvj3h_873`,chatMessages:`_chatMessages_pvj3h_882`,chatWelcome:`_chatWelcome_pvj3h_884`,doctrineOpenBtn:`_doctrineOpenBtn_pvj3h_885`,streamingPre:`_streamingPre_pvj3h_888`,streamingCursor:`_streamingCursor_pvj3h_901`,streamBlink:`_streamBlink_pvj3h_1`,doctrineSubtitle:`_doctrineSubtitle_pvj3h_908`,doctrineSection:`_doctrineSection_pvj3h_909`,doctrineSectionTitle:`_doctrineSectionTitle_pvj3h_914`,doctrineSectionBody:`_doctrineSectionBody_pvj3h_921`,doctrineBullet:`_doctrineBullet_pvj3h_930`,chatUser:`_chatUser_pvj3h_940`,chatUserBubble:`_chatUserBubble_pvj3h_941`,chatAttachPreviews:`_chatAttachPreviews_pvj3h_942`,chatAttachBadge:`_chatAttachBadge_pvj3h_943`,chatSystem:`_chatSystem_pvj3h_945`,chatSystemBubble:`_chatSystemBubble_pvj3h_946`,chatSyntaxErr:`_chatSyntaxErr_pvj3h_947`,chatAgent:`_chatAgent_pvj3h_949`,chatAgentCard:`_chatAgentCard_pvj3h_950`,chatAgentHeader:`_chatAgentHeader_pvj3h_951`,chatAgentRobot:`_chatAgentRobot_pvj3h_952`,chatAgentRobotAnim:`_chatAgentRobotAnim_pvj3h_953`,chatAgentLabel:`_chatAgentLabel_pvj3h_954`,chatRunningDots:`_chatRunningDots_pvj3h_955`,chatAgentText:`_chatAgentText_pvj3h_956`,chatToolBadges:`_chatToolBadges_pvj3h_957`,toolBadge:`_toolBadge_pvj3h_958`,toolBadgeOk:`_toolBadgeOk_pvj3h_959`,toolBadgeErr:`_toolBadgeErr_pvj3h_960`,cursor:`_cursor_pvj3h_962`,blink:`_blink_pvj3h_1`,attachPreviews:`_attachPreviews_pvj3h_965`,attachBadge:`_attachBadge_pvj3h_966`,removeAttachBtn:`_removeAttachBtn_pvj3h_967`,projNameRow:`_projNameRow_pvj3h_970`,projNameLabel:`_projNameLabel_pvj3h_971`,projNameInput:`_projNameInput_pvj3h_972`,projActiveRow:`_projActiveRow_pvj3h_973`,projActiveName:`_projActiveName_pvj3h_974`,chatInputRow:`_chatInputRow_pvj3h_977`,attachLabel:`_attachLabel_pvj3h_978`,chatTextarea:`_chatTextarea_pvj3h_979`,chatSendCol:`_chatSendCol_pvj3h_982`,chatSendBtn:`_chatSendBtn_pvj3h_983`,chatStopBtn:`_chatStopBtn_pvj3h_985`,modalOverlay:`_modalOverlay_pvj3h_988`,modal:`_modal_pvj3h_988`,modalHeader:`_modalHeader_pvj3h_1010`,modalTitle:`_modalTitle_pvj3h_1011`,modalClose:`_modalClose_pvj3h_1012`,modalBody:`_modalBody_pvj3h_1014`,modalRow:`_modalRow_pvj3h_1016`,modalField:`_modalField_pvj3h_1017`,modalLabel:`_modalLabel_pvj3h_1018`,modalLabelRow:`_modalLabelRow_pvj3h_1019`,modalSelect:`_modalSelect_pvj3h_1021`,modalInput:`_modalInput_pvj3h_1022`,modalHint:`_modalHint_pvj3h_1025`,modalAiBox:`_modalAiBox_pvj3h_1027`,modalAiRow:`_modalAiRow_pvj3h_1028`,modalAiDesc:`_modalAiDesc_pvj3h_1029`,modalAiBtn:`_modalAiBtn_pvj3h_1030`,modalContentArea:`_modalContentArea_pvj3h_1033`,logView:`_logView_pvj3h_1036`,modalFooter:`_modalFooter_pvj3h_1038`,modalCancelBtn:`_modalCancelBtn_pvj3h_1039`,modalSaveBtn:`_modalSaveBtn_pvj3h_1040`,fileTreeWrap:`_fileTreeWrap_pvj3h_1043`,headerIconBtn:`_headerIconBtn_pvj3h_1053`,headerIconBtnActive:`_headerIconBtnActive_pvj3h_1064`,terminalPanel:`_terminalPanel_pvj3h_1067`,terminalHeader:`_terminalHeader_pvj3h_1075`,terminalTitle:`_terminalTitle_pvj3h_1084`,terminalClose:`_terminalClose_pvj3h_1085`,findBar:`_findBar_pvj3h_1088`,findInput:`_findInput_pvj3h_1097`,findCount:`_findCount_pvj3h_1108`,findBtn:`_findBtn_pvj3h_1109`,findClose:`_findClose_pvj3h_1111`};function LT(e,t){let n=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`);return e.split(`
|
|
677
|
+
`).map(e=>{let r=n(e);if(t===`css`)r=r.replace(/([a-z-]+)\s*(?=:)/g,`<span style="color:#82aaff">$1</span>`),r=r.replace(/(\/\*[\s\S]*?\*\/)/g,`<span style="color:#546e7a;font-style:italic">$1</span>`);else if(t===`html`||t===`htm`)r=r.replace(/(<\/?)([\w-]+)/g,`$1<span style="color:#f07178">$2</span>`),r=r.replace(/\s([\w-]+)(?==)/g,` <span style="color:#ffcb6b">$1</span>`),r=r.replace(/(["'])(?:(?!\1).)*?\1/g,`<span style="color:#c3e88d">$&</span>`);else if(t===`json`)r=r.replace(/(["'])(?:(?!\1|\\).|\\.)*?\1(?=\s*:)/g,`<span style="color:#82aaff">$&</span>`),r=r.replace(/:\s*(["'])(?:(?!\1|\\).|\\.)*?\1/g,e=>`: <span style="color:#c3e88d">`+e.slice(2)+`</span>`),r=r.replace(/:\s*(true|false|null)\b/g,`: <span style="color:#c792ea">$1</span>`),r=r.replace(/:\s*(\d+\.?\d*)/g,`: <span style="color:#f78c6c">$1</span>`);else{if(/^\s*\/\//.test(r))return`<span style="color:#546e7a;font-style:italic">`+r+`</span>`;r=r.replace(/(["'`])(?:(?!\1|\\).|\\.)*?\1/g,`<span style="color:#c3e88d">$&</span>`),r=r.replace(/\b(const|let|var|function|return|if|else|for|while|switch|case|break|continue|try|catch|throw|new|class|extends|import|export|from|default|async|await|typeof|instanceof)\b/g,`<span style="color:#c792ea">$&</span>`),r=r.replace(/\b(null|undefined|true|false)\b/g,`<span style="color:#ff5370">$&</span>`),r=r.replace(/\b(require|module|exports|console|process)\b/g,`<span style="color:#82aaff">$&</span>`)}return r}).join(`
|
|
678
|
+
`)}var RT=[{name:`MySaaS`,desc:`Full-stack SaaS web application with Node.js/Express backend and vanilla JS frontend.
|
|
677
679
|
|
|
678
680
|
BACKEND (server.js + routes/):
|
|
679
681
|
- Express server with helmet, cors, rate-limiting, compression middleware
|
|
@@ -761,9 +763,9 @@ FRONTEND:
|
|
|
761
763
|
- index.html: Job board homepage — (1) Hero: gradient background, large search widget (keyword input + location input + category select + Search button), quick stats bar (12,847 Jobs / 3,420 Companies / 45K Candidates). (2) Featured jobs: horizontal scroll row of 4 "Featured" cards with company logo (colored emoji), job title, company name, location + type badge + salary range + "Easy Apply" button. (3) Main layout: left sidebar filters (Job Type checkboxes, Salary Range slider, Category checkboxes, Location input, Posted Within select, Remote Only toggle) + right: jobs list (job row cards with company logo/title/company/location/type/salary/time-ago posted/Save bookmark/Apply button). (4) "Load More" button + results count "Showing 12 of 247 jobs". (5) Top companies section: 8 company cards with logo/name/industry/openings count. (6) Category browsing: 6 category cards with icon/name/count/link. (7) Job seeker CTA banner. (8) Newsletter.
|
|
762
764
|
- job.html: Job detail page — company header (logo + name + industry + website + size + "Follow" button), job title + badges (Remote, Senior, Urgent), salary + location + posted date, Apply Now button (sticky on scroll), job description (markdown-rendered sections: About/Responsibilities/Requirements/Nice-to-Have/Benefits), company sidebar card (description + stats), similar jobs list (4 cards)
|
|
763
765
|
- apply.html: Application modal/page — job summary header, form (Full Name / Email / Phone / LinkedIn URL / Portfolio URL / Cover Letter textarea with character count / Resume paste textarea), Submit button with loading state, success page with application reference number
|
|
764
|
-
- public/css/main.css: Modern job board design — tag/badge system (Remote=blue, Onsite=green, Urgent=red), salary range display, company logo placeholder styles, filter sidebar collapse on mobile, job card hover effects, application form validation styles`}],
|
|
766
|
+
- public/css/main.css: Modern job board design — tag/badge system (Remote=blue, Onsite=green, Urgent=red), salary range display, company logo placeholder styles, filter sidebar collapse on mobile, job card hover effects, application form validation styles`}],zT=[{key:`auth`,label:`Auth (register/login/JWT)`,icon:`🔒`},{key:`cookieBanner`,label:`GDPR Cookie Banner`,icon:`🍪`},{key:`securityMiddleware`,label:`Security Middleware`,icon:`🛡️`},{key:`emailVerification`,label:`Email Verification`,icon:`✉️`}],BT={js:`📄`,ts:`📄`,css:`🎨`,html:`🌐`,json:`📋`,md:`📑`,sql:`🗂`,env:`🔐`,conf:`⚙`,lock:`🔒`};function VT(e){return BT[e.split(`.`).pop()?.toLowerCase()??``]??`📄`}function HT(e){let t=new TextEncoder().encode(e).length;return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function UT(e){return e===`memory`?`🧠`:e===`provider`?`🤖`:e===`log`?`📄`:`📋`}function WT(){let e=j(),[t,n]=(0,_.useState)(`new`),[r,i]=(0,_.useState)(`files`),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)({auth:!0,cookieBanner:!0,securityMiddleware:!0,emailVerification:!0}),[d,f]=(0,_.useState)([{label:`Email`,type:`email`,required:!0},{label:`Password`,type:`password`,required:!0},{label:`Name`,type:`text`,required:!0}]),[p,m]=(0,_.useState)([]),[h,g]=(0,_.useState)(0),[v,y]=(0,_.useState)(null),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(new Set),[w,ee]=(0,_.useState)(!1),[te,T]=(0,_.useState)(``),[ne,re]=(0,_.useState)(``),[ie,O]=(0,_.useState)(!1),[ae,A]=(0,_.useState)(null),[oe,se]=(0,_.useState)(!1),ce=(0,_.useRef)(null),le=(0,_.useRef)(null),ue=(0,_.useRef)(!0),de=(0,_.useRef)(null),M=(0,_.useRef)(null),fe=(0,_.useRef)(null),pe=(0,_.useRef)(null),[me,he]=(0,_.useState)(null),[ge,_e]=(0,_.useState)(!1),[ve,ye]=(0,_.useState)(!1),[be,xe]=(0,_.useState)(0),[Se,N]=(0,_.useState)(0),[Ce,we]=(0,_.useState)(``),[Te,Ee]=(0,_.useState)({fi:0,total:0,name:``}),[P,De]=(0,_.useState)({tokIn:0,tokOut:0}),[Oe,ke]=(0,_.useState)(null),[F,I]=(0,_.useState)([]),[Ae,je]=(0,_.useState)(``),[Me,Ne]=(0,_.useState)(!1),[Pe,Fe]=(0,_.useState)([]),[Ie,Le]=(0,_.useState)(null),[Re,ze]=(0,_.useState)([]),[L,Be]=(0,_.useState)(!1),[Ve,He]=(0,_.useState)(null),[Ue,We]=(0,_.useState)([]),[Ge,Ke]=(0,_.useState)(!1),[qe,Je]=(0,_.useState)(``),[Ye,Xe]=(0,_.useState)([]),[Ze,Qe]=(0,_.useState)([]),[$e,et]=(0,_.useState)([]),[tt,nt]=(0,_.useState)(null),[rt,it]=(0,_.useState)(!1),[at,ot]=(0,_.useState)(null),[st,ct]=(0,_.useState)(`0s`),[lt,ut]=(0,_.useState)(`0s`),dt=(0,_.useRef)(0),ft=(0,_.useRef)(0),R=(0,_.useRef)(null),pt=(0,_.useRef)(null),mt=(0,_.useRef)(null),ht=(0,_.useRef)(null),gt=(0,_.useRef)(null),_t=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key===`f`&&(e.preventDefault(),ee(e=>!e)),(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),b!==null&&p[h])){let e=p[h];m(e=>e.map((e,t)=>t===h?{...e,content:b}:e)),D(`/api/studio/webcraft/file/write`,{projectName:a,path:e.name,content:b}),x(null),C(t=>{let n=new Set(t);return n.delete(e.name),n})}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b,h,p,a]),(0,_.useEffect)(()=>{let e=()=>{let e=b===null?fe.current:M.current;e&&pe.current&&(pe.current.scrollTop=e.scrollTop)},t=b===null?fe.current:M.current;return t&&t.addEventListener(`scroll`,e),()=>{t&&t.removeEventListener(`scroll`,e)}},[b,h]);function vt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function yt(e){let t=Math.floor((Date.now()-e)/1e3),n=Math.floor(t/60);return(n>0?`${n}m `:``)+`${t%60}s`}(0,_.useEffect)(()=>(ge||ve?R.current=setInterval(()=>{ge&&ct(yt(dt.current)),ve&&ut(yt(ft.current))},1e3):R.current&&=(clearInterval(R.current),null),()=>{R.current&&clearInterval(R.current)}),[ge,ve]);function z(){mt.current&&(mt.current.scrollTop=mt.current.scrollHeight)}(0,_.useEffect)(()=>{z()},[F]),(0,_.useEffect)(()=>{a&&!L&&(Be(!0),E(`/api/studio/webcraft/skills/${encodeURIComponent(a)}`).then(e=>{e?.skills&&ze(e.skills)}).catch(()=>{}))},[a,L]);async function bt(e,t){if(ge||!e||e.length<5)return;_e(!0),m([]),g(0),y(null),Ee({fi:0,total:0,name:``}),De({tokIn:0,tokOut:0}),dt.current=Date.now(),ct(`0s`),pt.current=new AbortController;let n=Date.now();try{let r=await fetch(`/api/studio/webcraft/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},signal:pt.current.signal,body:JSON.stringify({projectName:t,description:e,blocks:l,authFields:d})});if(!r.ok||!r.body){_e(!1);return}let i=r.body.getReader(),a=pt.current,s=new TextDecoder,c=``,u=[];for(;;){if(a?.signal?.aborted){try{i.cancel()}catch{}break}let{done:e,value:t}=await i.read();if(e)break;c+=s.decode(t,{stream:!0});let r=c.split(`
|
|
765
767
|
|
|
766
|
-
`);c=r.pop()??``;for(let e of r){let t=e.replace(/^data: /,``).trim();if(t)try{let e=JSON.parse(t);if(e.type===`project_renamed`)o(e.name);else if(e.type===`processing`||e.type===`planning`)Ee(t=>({...t,name:e.type===`planning`?`📋 Pianificazione struttura...`:e.msg||`Avvio...`}));else if(e.type===`file_start`)u.push({name:e.name,content:``,_pending:!0}),m([...u]),Ee({fi:e.fi,total:e.total,name:e.name}),ce.current=u.length-1,g(u.length-1),y(``),ue.current=!0;else if(e.type===`file_chunk`){let t=u.find(t=>t.name===e.name);t&&(t.content+=e.chunk,t._pending=!1),m([...u]);let n=u.findIndex(t=>t.name===e.name);n>=0&&(ce.current=n,y(t?t.content:null))}else if(e.type===`file_done`){let t=u.find(t=>t.name===e.name);t&&(t._pending=!1,e.syntaxError&&(t._syntaxError=e.syntaxError)),m([...u]),Ee({fi:e.fi,total:e.total,name:e.name}),(e.cumTokIn||e.cumTokOut)&&De({tokIn:e.cumTokIn||0,tokOut:e.cumTokOut||0})}else if(e.type===`file_error`){let t=u.find(t=>t.name===e.name);t&&(t._error=!0,t._pending=!1),m([...u])}else e.type===`phase`||e.type===`status`&&!e.op?Ee(t=>({...t,name:e.msg||e.phase||``})):e.type===`done`&&(ke({seconds:Math.round((Date.now()-n)/1e3),tokIn:e.tokIn??0,tokOut:e.tokOut??0,files:u.length}),y(null),_e(!1),ce.current=null,le.current&&=(clearTimeout(le.current),null),se(!0),Be(!1),ze([]),u.some(e=>e._error||e._syntaxError)?setTimeout(()=>gt.current?.(),800):setTimeout(()=>_t.current?.(),800))}catch{}}}}catch(e){e.name!==`AbortError`&&I(t=>[...t,{role:`system`,text:`Errore generazione: `+e.message}]),_e(!1)}}async function xt(){let e=Ae.trim();if(!(a&&p.length>0)){if(!e||e.length<5)return;let t=a||`MyProject`;o(t),c(e),je(``),await bt(e,t);return}if(!e&&Pe.length===0||Me||ge)return;let t=[...Pe];if(Fe([]),je(``),e.toLowerCase().startsWith(`/plan `)||e.toLowerCase().startsWith(`piano: `)){let t=e.replace(/^\/plan[ ]*/i,``).replace(/^piano:[ ]*/i,``);I(t=>[...t,{role:`user`,text:e}]),await St(`[MODALITA PIANO] Descrivi cosa modificheresti per: "${t}". Elenca i file e cosa faresti. NON applicare modifiche ancora. Rispondi con il piano in bullet list.`,t,[]);return}I(n=>[...n,{role:`user`,text:e,attachments:t}]),await St(e,null,t)}async function St(e,t,n){if(Me)return;Ne(!0),a&&p.length>0&&D(`/api/studio/webcraft/snapshot`,{projectName:a}).catch(()=>{});let r={};p.forEach(e=>{r[e.name]=e.content});try{let i=await fetch(`/api/studio/webcraft/agent`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectName:a,message:e,attachments:n.map(e=>({name:e.name,mimeType:e.mimeType,base64:e.base64}))})});if(!i.ok||!i.body){I(e=>[...e,{role:`agent`,text:`Errore: ${i.status}`,tools:[]}]),Ne(!1);return}let o={role:`agent`,text:``,tools:[]};I(e=>[...e,o]);let s=i.body.getReader(),c=new TextDecoder,l=``,u=!1,d=``;for(;;){let{done:e,value:n}=await s.read();if(e)break;l+=c.decode(n,{stream:!0});let i=l.split(`
|
|
768
|
+
`);c=r.pop()??``;for(let e of r){let t=e.replace(/^data: /,``).trim();if(t)try{let e=JSON.parse(t);if(e.type===`project_renamed`)o(e.name);else if(e.type===`processing`||e.type===`planning`)Ee(t=>({...t,name:e.type===`planning`?`📋 Pianificazione struttura...`:e.msg||`Avvio...`}));else if(e.type===`file_start`)u.push({name:e.name,content:``,_pending:!0}),m([...u]),Ee({fi:e.fi,total:e.total,name:e.name}),ce.current=u.length-1,le.current||(g(u.length-1),y(``)),ue.current=!0;else if(e.type===`file_chunk`){let t=u.find(t=>t.name===e.name);t&&(t.content+=e.chunk,t._pending=!1),m([...u]);let n=u.findIndex(t=>t.name===e.name);n>=0&&(ce.current=n,y(t?t.content:null))}else if(e.type===`file_done`){let t=u.find(t=>t.name===e.name);t&&(t._pending=!1,e.syntaxError&&(t._syntaxError=e.syntaxError)),m([...u]),Ee({fi:e.fi,total:e.total,name:e.name}),(e.cumTokIn||e.cumTokOut)&&De({tokIn:e.cumTokIn||0,tokOut:e.cumTokOut||0})}else if(e.type===`file_error`){let t=u.find(t=>t.name===e.name);t&&(t._error=!0,t._pending=!1),m([...u])}else e.type===`phase`||e.type===`status`&&!e.op?Ee(t=>({...t,name:e.msg||e.phase||``})):e.type===`done`&&(ke({seconds:Math.round((Date.now()-n)/1e3),tokIn:e.tokIn??0,tokOut:e.tokOut??0,files:u.length}),y(null),_e(!1),ce.current=null,le.current&&=(clearTimeout(le.current),null),se(!0),Be(!1),ze([]),u.some(e=>e._error||e._syntaxError)?setTimeout(()=>gt.current?.(),800):setTimeout(()=>_t.current?.(),800))}catch{}}}}catch(e){e.name!==`AbortError`&&I(t=>[...t,{role:`system`,text:`Errore generazione: `+e.message}]),_e(!1)}}async function xt(){let e=Ae.trim();if(!(a&&p.length>0)){if(!e||e.length<5)return;let t=a||`MyProject`;o(t),c(e),je(``),await bt(e,t);return}if(!e&&Pe.length===0||Me||ge)return;let t=[...Pe];if(Fe([]),je(``),e.toLowerCase().startsWith(`/plan `)||e.toLowerCase().startsWith(`piano: `)){let t=e.replace(/^\/plan[ ]*/i,``).replace(/^piano:[ ]*/i,``);I(t=>[...t,{role:`user`,text:e}]),await St(`[MODALITA PIANO] Descrivi cosa modificheresti per: "${t}". Elenca i file e cosa faresti. NON applicare modifiche ancora. Rispondi con il piano in bullet list.`,t,[]);return}I(n=>[...n,{role:`user`,text:e,attachments:t}]),await St(e,null,t)}async function St(e,t,n){if(Me)return;Ne(!0),a&&p.length>0&&D(`/api/studio/webcraft/snapshot`,{projectName:a}).catch(()=>{});let r={};p.forEach(e=>{r[e.name]=e.content});try{let i=await fetch(`/api/studio/webcraft/agent`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectName:a,message:e,attachments:n.map(e=>({name:e.name,mimeType:e.mimeType,base64:e.base64}))})});if(!i.ok||!i.body){I(e=>[...e,{role:`agent`,text:`Errore: ${i.status}`,tools:[]}]),Ne(!1);return}let o={role:`agent`,text:``,tools:[]};I(e=>[...e,o]);let s=i.body.getReader(),c=new TextDecoder,l=``,u=!1,d=``;for(;;){let{done:e,value:n}=await s.read();if(e)break;l+=c.decode(n,{stream:!0});let i=l.split(`
|
|
767
769
|
|
|
768
770
|
`);l=i.pop()??``;for(let e of i){let n=e.replace(/^data: /,``).trim();if(n)try{let e=JSON.parse(n);if(e.type===`text`){d+=e.token;let t=d.lastIndexOf(`<`),n;t>=0&&!d.slice(t).includes(`>`)?(n=d.slice(0,t),d=d.slice(t)):(n=d.replace(/<tool>[\s\S]*?<\/tool>/g,``).replace(/<done\s*\/>/g,``),d=``),n&&(o.text+=n,I(e=>{let t=[...e];return t[t.length-1]={...o},t}))}else if(e.type===`step`)o.text+=`\n\n**[Step ${e.step}/${e.max}]** `,I(e=>{let t=[...e];return t[t.length-1]={...o},t});else if(e.type===`tool`)o.tools.push({op:e.op,path:e.path,result:e.result,oldSnippet:e.oldSnippet??``,newSnippet:e.newSnippet??``}),(e.op===`edit`||e.op===`write`)&&(e.result===`ok`||e.result===`ok_repaired`)&&(u=!0),I(e=>{let t=[...e];return t[t.length-1]={...o},t});else if(e.type===`files_changed`)e.files?.length&&await Ct(e.files,r);else if(e.type===`syntax_errors`)e.errors?.length&&(o.syntaxErrors=e.errors,I(e=>{let t=[...e];return t[t.length-1]={...o},t}));else if(e.type===`sandbox_restart`)o.text+=`
|
|
769
771
|
|
|
@@ -773,17 +775,17 @@ FRONTEND:
|
|
|
773
775
|
Errore: `+e.msg,Ne(!1))}catch{}}}}catch(e){I(t=>[...t,{role:`agent`,text:`Errore di rete: `+e.message,tools:[]}])}Ne(!1)}async function Ct(e,t){if(!a)return;let n=await E(`/api/studio/webcraft/projects/load/${encodeURIComponent(a)}`);if(n?.files&&(m(n.files),e.length>0)){let r=e.map(e=>{let r=n.files.find(t=>t.name===e);return r?{file:e,before:t[e]??``,after:r.content}:null}).filter(Boolean);Qe(e=>[...e,...r])}}function wt(){pt.current&&=(pt.current.abort(),null),_e(!1),Ne(!1),y(null),I(e=>[...e,{role:`system`,text:`⏹ Generazione interrotta.`}])}async function B(){return a?(await D(`/api/studio/webcraft/snapshot`,{projectName:a}))?.snapshot??null:null}async function Tt(){let e=await B();e&&(I(t=>[...t,{role:`system`,text:`💾 Snapshot salvato (${e.slice(0,16).replace(`T`,` `)})`}]),Et())}async function Et(){if(!a)return;let e=await E(`/api/studio/webcraft/snapshots/${encodeURIComponent(a)}`);e?.snapshots&&We(e.snapshots)}async function Dt(e){confirm(`Ripristinare lo snapshot del ${e.replace(`T`,` `).slice(0,16)}? I file attuali verranno sovrascritti.`)&&await D(`/api/studio/webcraft/restore`,{projectName:a,ts:e})!==null&&(I(t=>[...t,{role:`agent`,text:`Snapshot ripristinato (${e}). Ricarico i file...`}]),Ct([],{}))}async function Ot(){if(!a)return;let e=await D(`/api/studio/webcraft/syntax-check`,{projectName:a});if(e?.results){let t=e.results.filter(e=>!e.ok);t.length>0?I(e=>[...e,{role:`system`,text:`⚠ Syntax check: ${t.length} errore/i trovato/i.`,syntaxErrors:t}]):I(e=>[...e,{role:`system`,text:`✓ Syntax check: tutti i file JS sono validi.`}])}}async function kt(){let e=p.filter(e=>e._error||e._syntaxError);if(e.length===0){_t.current?.();return}ye(!0),xe(0),N(e.length),ft.current=Date.now(),ut(`0s`);for(let t=0;t<e.length;t++){let n=e[t];we(n.name),xe(t),await St(`REPAIR FILE: ${n.name}\nErrore: ${n._syntaxError??`generazione fallita`}\nRigenera il file correttamente. Output SOLO il contenuto del file, nessuna spiegazione.`,null,[])}xe(e.length),we(``),ye(!1),setTimeout(()=>_t.current?.(),500)}async function At(e){if(!rt){it(!0),ot(null),nt(null),i(`preview`);try{let t=await fetch(`/api/studio/webcraft/sandbox/start`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectName:e})});if(!t.ok||!t.body){ot(t.ok?`No response body`:`HTTP ${t.status}`),it(!1);return}let n=t.body.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,{stream:!0});let a=i.split(`
|
|
774
776
|
|
|
775
777
|
`);i=a.pop()??``;for(let e of a){let t=e.replace(/^data: /,``).trim();if(t)try{let e=JSON.parse(t);e.type===`phase`?O(!0):e.type===`ready`&&e.port?(nt(e.port),it(!1)):e.type===`status`||e.type===`log`||e.type===`warn`||(e.type===`error`?ot(e.msg):e.type)}catch{}}}}catch(e){ot(e.message||`Connection failed`)}it(!1)}}async function jt(){a&&await At(a)}(0,_.useEffect)(()=>{gt.current=kt,_t.current=jt});async function Mt(){if(!qe||!a)return;let e=await D(`/api/studio/webcraft/grep`,{projectName:a,query:qe});e?.matches&&Xe(e.matches)}function Nt(e){let t=p.findIndex(t=>t.name===e);t>=0&&(g(t),i(`files`))}function V(){window.open(`/api/studio/webcraft/download/${encodeURIComponent(a)}`,`_blank`)}async function Pt(e,t,n,r){t.endsWith(`.md`)||(t+=`.md`);let i={name:t,content:n,type:r},s;s=e.mode===`edit`&&e.idx!==null?Re.map((t,n)=>n===e.idx?i:t):[...Re,i],ze(s),He(null);let c=a||`MyProject`;a||o(c),await D(`/api/studio/webcraft/skills/${encodeURIComponent(c)}`,{skills:s})}async function Ft(e){let t=Re[e];!t||!confirm(`Eliminare "${t.name}"?`)||(await D(`/api/studio/webcraft/skills/${encodeURIComponent(a)}/delete`,{name:t.name}),ze(Re.filter((t,n)=>n!==e)))}async function It(e){let t=Re[e];if(!t||!confirm(`Svuotare "${t.name}"? Il file rimane ma il contenuto viene cancellato.`))return;let n=Re.map((t,n)=>n===e?{...t,content:``}:t);ze(n),await D(`/api/studio/webcraft/skills/${encodeURIComponent(a)}`,{skills:n})}async function Lt(){let e=await E(`/api/studio/webcraft/projects`);e?.projects&&et(e.projects)}async function Rt(e){let t=await E(`/api/studio/webcraft/projects/load/${encodeURIComponent(e.name)}`);if(!t)return;o(t.projectName??e.name),c(t.description??``),m(t.files??[]),g(0),n(`new`),i(`files`),I([]),ze([]),Be(!1);let r=await E(`/api/studio/webcraft/projects/chat/load/${encodeURIComponent(t.projectName??e.name)}`);r?.chat&&I(r.chat);let a=await E(`/api/studio/webcraft/skills/${encodeURIComponent(t.projectName??e.name)}`);a?.skills&&(ze(a.skills),Be(!0))}async function zt(e){confirm(`Eliminare: ${e.name} - ${e.dir}?`)&&(await D(`/api/studio/webcraft/projects/${encodeURIComponent(e.name)}`,{},`DELETE`),et($e.filter(t=>t.name!==e.name)),a===e.name&&(o(``),m([]),I([]),c(``)))}async function Bt(){if(!Ie)return;let e=Ie.originalMessage;Le(null),await St(e+`
|
|
776
|
-
[Piano approvato — procedi con le modifiche]`,null,[])}function H(e){e&&Array.from(e).forEach(e=>{let t=new FileReader;t.onload=t=>{let n=(t.target?.result).split(`,`)[1];Fe(t=>[...t,{name:e.name,mimeType:e.type,base64:n,size:e.size}])},t.readAsDataURL(e)})}let Vt=a&&p.length>0,Ht=p[h],Ut=Me||ge;return(0,k.jsxs)(`div`,{className:$.root,children:[(0,k.jsxs)(`div`,{className:$.header,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:$.title,children:`⚙ WebCraft`}),(0,k.jsx)(`div`,{className:$.subtitle,children:`Genera progetti web completi con agenti AI`})]}),(0,k.jsxs)(`div`,{className:$.headerTabs,children:[(0,k.jsx)(`button`,{className:`${$.tabBtn} ${t===`new`?$.tabActive:``}`,onClick:()=>n(`new`),children:`+ Nuovo`}),(0,k.jsx)(`button`,{className:`${$.tabBtn} ${t===`projects`?$.tabActive:``}`,onClick:()=>{n(`projects`),Lt()},children:`📁 Progetti`})]})]}),(0,k.jsx)(`div`,{className:$.body,children:t===`projects`?(0,k.jsx)(`div`,{className:$.projectsList,children:$e.length===0?(0,k.jsxs)(`div`,{className:$.emptyProjects,children:[(0,k.jsx)(`span`,{className:$.emptyIcon,children:`📁`}),(0,k.jsx)(`span`,{children:e(`webcraft.noProjects`)}),(0,k.jsx)(`span`,{className:$.emptyHint,children:`Crea un progetto nella tab Nuovo`})]}):$e.map(e=>(0,k.jsxs)(`div`,{className:$.projectCard,children:[(0,k.jsxs)(`div`,{className:$.projectInfo,children:[(0,k.jsx)(`div`,{className:$.projectName,children:e.name}),(0,k.jsx)(`div`,{className:$.projectDesc,children:e.description}),(0,k.jsxs)(`div`,{className:$.projectMeta,children:[(0,k.jsxs)(`span`,{children:[`📄 `,e.fileCount,` file`]}),(0,k.jsxs)(`span`,{children:[`📅 `,e.createdAt?new Date(e.createdAt).toLocaleString():``]})]})]}),(0,k.jsx)(`button`,{className:$.openBtn,onClick:()=>Rt(e),children:`↗ Apri`}),(0,k.jsx)(`button`,{className:$.deleteBtn,onClick:()=>zt(e),children:`🗑`})]},e.name))}):(0,k.jsxs)(`div`,{className:$.editor,children:[(0,k.jsxs)(`div`,{className:$.examples,children:[(0,k.jsx)(`div`,{className:$.sectionLabel,children:`Esempi`}),(0,k.jsx)(`div`,{className:$.examplePills,children:LT.map(e=>(0,k.jsx)(`button`,{className:$.examplePill,onClick:()=>{o(e.name),c(e.desc),je(e.desc)},children:e.name},e.name))})]}),(0,k.jsxs)(`div`,{className:$.editorCols,children:[(0,k.jsxs)(`div`,{className:$.leftSidebar,children:[(0,k.jsxs)(`div`,{className:$.panel,children:[(0,k.jsx)(`div`,{className:$.panelTitle,children:`Blocchi`}),RT.map(e=>(0,k.jsxs)(`label`,{className:$.blockLabel,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:l[e.key],onChange:t=>u(n=>({...n,[e.key]:t.target.checked})),className:$.blockCheck}),(0,k.jsx)(`span`,{children:e.icon}),(0,k.jsx)(`span`,{children:e.label})]},e.key))]}),l.auth&&(0,k.jsxs)(`div`,{className:$.panel,children:[(0,k.jsxs)(`div`,{className:$.panelHeader,children:[(0,k.jsx)(`div`,{className:$.panelTitle,children:`Campi Auth`}),(0,k.jsx)(`button`,{className:$.addBtn,onClick:()=>f(e=>[...e,{label:`New field`,type:`text`,required:!1}]),children:`+ Campo`})]}),d.map((e,t)=>(0,k.jsxs)(`div`,{className:$.authField,children:[(0,k.jsx)(`input`,{value:e.label,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,label:e.target.value}:n)),className:$.authFieldInput}),(0,k.jsx)(`select`,{value:e.type,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,type:e.target.value}:n)),className:$.authFieldSelect,children:[`text`,`email`,`password`,`tel`,`date`,`number`].map(e=>(0,k.jsx)(`option`,{value:e,children:e},e))}),(0,k.jsx)(`input`,{type:`checkbox`,checked:e.required,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,required:e.target.checked}:n)),title:`Required`,className:$.authFieldReq}),(0,k.jsx)(`button`,{onClick:()=>f(e=>e.filter((e,n)=>n!==t)),className:$.removeFieldBtn,children:`×`})]},t))]}),(0,k.jsxs)(`div`,{className:$.panel,children:[(0,k.jsxs)(`div`,{className:$.panelHeader,children:[(0,k.jsx)(`div`,{className:$.panelTitle,children:`🗂 Contesto AI`}),(0,k.jsx)(`button`,{className:$.addBtn,onClick:()=>He({mode:`new`,idx:null,name:``,content:``,type:`skill`,generating:!1}),children:`+ Skill`})]}),Re.length>0?(0,k.jsx)(`div`,{className:$.skillsList,children:Re.map((e,t)=>(0,k.jsxs)(`div`,{className:$.skillRow,children:[(0,k.jsx)(`span`,{className:$.skillIcon,children:HT(e.type)}),(0,k.jsx)(`span`,{className:$.skillName,title:e.name,children:e.name}),(0,k.jsx)(`span`,{className:`${$.skillBadge} ${$[`skillBadge_`+e.type]}`,children:e.type}),!e.content&&e.type!==`log`&&(0,k.jsx)(`span`,{className:$.skillEmpty,children:`⚠`}),(0,k.jsx)(`button`,{className:$.skillBtn,onClick:()=>He({mode:e.type===`log`?`view`:`edit`,idx:t,name:e.name,content:e.content,type:e.type,generating:!1}),children:e.type===`log`?`👁`:`✏`}),e.type!==`memory`&&e.type!==`provider`&&e.type!==`log`&&(0,k.jsx)(`button`,{className:$.skillBtn,onClick:()=>It(t),children:`🗑`}),e.type===`log`&&(0,k.jsx)(`button`,{className:$.skillBtn,onClick:()=>Ft(t),children:`🗑`})]},t))}):(0,k.jsx)(`div`,{className:$.skillsEmpty,children:L?`Nessun file di contesto. Clicca "+ Skill" per aggiungerne uno.`:`Crea o carica un progetto per i file di contesto.`})]}),Ue.length>0&&(0,k.jsxs)(`div`,{className:$.panel,children:[(0,k.jsx)(`div`,{className:$.panelTitle,children:`💾 Snapshot`}),Ue.slice(0,5).map(e=>{let t=e.ts.replace(`T`,` `).slice(0,16);return(0,k.jsxs)(`div`,{className:$.snapshotRow,children:[(0,k.jsx)(`span`,{className:$.snapshotTs,children:t}),(0,k.jsxs)(`span`,{className:$.snapshotCount,children:[e.fileCount,`f`]}),(0,k.jsx)(`button`,{className:$.snapshotBtn,onClick:()=>Dt(e.ts),children:`↺`})]},e.ts)})]}),ge&&(0,k.jsx)(`div`,{className:$.genStatus,children:`⏳ Generazione...`}),ve&&(0,k.jsxs)(`div`,{className:$.repairStatus,children:[(0,k.jsx)(`div`,{className:$.repairStatusTitle,children:`🔧 Correzione automatica...`}),(0,k.jsxs)(`div`,{className:$.repairStatusProg,children:[be,` / `,Se,` file`]}),(0,k.jsx)(`div`,{className:$.repairStatusFile,children:Ce})]}),p.length>0&&!ge&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:$.actionRow,children:[(0,k.jsx)(`button`,{className:$.actionBtn,onClick:V,children:`⬇ ZIP`}),(0,k.jsx)(`button`,{className:$.actionBtnIcon,title:`Syntax check`,onClick:Ot,children:`✅`}),(0,k.jsx)(`button`,{className:`${$.actionBtnIcon} ${Ge?$.actionBtnActive:``}`,title:`Grep`,onClick:()=>Ke(!Ge),children:`🔍`}),(0,k.jsx)(`button`,{className:$.actionBtnIcon,title:`Snapshot`,onClick:Tt,children:`💾`})]}),p.some(e=>e._error||e._syntaxError)&&!ve&&(0,k.jsx)(`button`,{className:$.repairBtn,onClick:kt,children:`🔧 Correggi tutti i file rossi`}),(0,k.jsx)(`button`,{className:$.sandboxBtn,onClick:()=>{a?At(a):i(`preview`)},children:rt?`⏳ Starting...`:tt?`🌐 Sandbox Live`:`▶ Sandbox`}),Oe&&(0,k.jsxs)(`div`,{className:$.statsBar,children:[(0,k.jsxs)(`span`,{children:[`⏱ `,Oe.seconds>=60?`${Math.floor(Oe.seconds/60)}m ${Oe.seconds%60}s`:`${Oe.seconds}s`]}),(0,k.jsxs)(`span`,{children:[`↑ `,Oe.tokIn.toLocaleString(),` tok`]}),(0,k.jsxs)(`span`,{children:[`↓ `,Oe.tokOut.toLocaleString(),` tok`]}),(0,k.jsxs)(`span`,{children:[`📄 `,Oe.files,` file`]})]})]})]}),(0,k.jsxs)(`div`,{className:$.rightPanel,children:[(0,k.jsxs)(`div`,{className:$.rightTabBar,children:[(0,k.jsx)(`button`,{className:`${$.rightTab} ${r===`preview`?``:$.rightTabActive}`,onClick:()=>i(`files`),children:`📄 File`}),(0,k.jsx)(`button`,{className:`${$.rightTab} ${r===`preview`?$.rightTabActive:``}`,onClick:()=>i(`preview`),children:`🌐 Sandbox`})]}),ve&&(0,k.jsxs)(`div`,{className:$.repairBar,children:[(0,k.jsxs)(`div`,{className:$.repairBarRow,children:[(0,k.jsx)(`span`,{className:$.repairBarIcon,children:`🔧`}),(0,k.jsx)(`span`,{className:$.repairBarLabel,children:`Auto-fix`}),(0,k.jsx)(`span`,{className:$.repairBarFile,children:Ce}),(0,k.jsxs)(`span`,{className:$.repairBarCounter,children:[be,` / `,Se]}),(0,k.jsx)(`span`,{className:$.repairBarTime,children:lt}),(0,k.jsx)(`button`,{className:$.stopBtn,onClick:wt,children:`⏹ Stop`})]}),(0,k.jsx)(`div`,{className:$.progressTrack,children:(0,k.jsx)(`div`,{className:$.repairProgress,style:{width:Se>0?`${Math.round(be/Se*100)}%`:`0%`}})})]}),ge&&(0,k.jsxs)(`div`,{className:$.genBar,children:[(0,k.jsxs)(`div`,{className:$.genBarRow,children:[(0,k.jsx)(`span`,{className:$.genBarRobot,children:`🤖`}),(0,k.jsx)(`span`,{className:$.genBarLabel,children:Te.total===0?`Pianificazione...`:`Generazione`}),(0,k.jsx)(`span`,{className:$.genBarFile,children:Te.name.split(`,`)[0].trim()}),(0,k.jsx)(`span`,{className:$.genBarCounter,children:Te.total>0?`${Te.fi} / ${Te.total}`:``}),(0,k.jsx)(`span`,{className:$.genBarCounter,children:P.tokIn+P.tokOut>0?`↑${vt(P.tokIn)} ↓${vt(P.tokOut)}`:``}),(0,k.jsx)(`span`,{className:$.genBarTime,children:st}),(0,k.jsxs)(`span`,{className:$.genDots,children:[(0,k.jsx)(`span`,{className:`${$.dot} ${$.dot1}`}),(0,k.jsx)(`span`,{className:`${$.dot} ${$.dot2}`}),(0,k.jsx)(`span`,{className:`${$.dot} ${$.dot3}`})]})]}),(0,k.jsx)(`div`,{className:$.progressTrack,children:(0,k.jsx)(`div`,{className:$.genProgress,style:{width:Te.total>0?`${Math.round(Te.fi/Te.total*100)}%`:`0%`}})})]}),r===`preview`?(0,k.jsxs)(`div`,{className:$.sandboxWrap,children:[(0,k.jsxs)(`div`,{className:$.sandboxStatusBar,children:[(0,k.jsx)(`span`,{className:$.sandboxStatusDot,style:{background:tt?`#4ade80`:rt?`#facc15`:`#64748b`}}),(0,k.jsx)(`span`,{className:$.sandboxStatusText,children:tt?`Live :${tt}`:rt?`Starting...`:`Stopped`}),tt&&(0,k.jsx)(`button`,{className:$.sandboxReloadBtn,onClick:()=>{let e=document.querySelector(`iframe[title="WebCraft Sandbox"]`);e&&(e.src=e.src)},children:`↻`}),tt&&(0,k.jsx)(`button`,{className:$.sandboxStopBtn,onClick:()=>{fetch(`/api/studio/webcraft/sandbox`,{method:`DELETE`}),nt(null)},children:`⏹`}),!tt&&!rt&&(0,k.jsx)(`button`,{className:$.sandboxStartBtnSmall,onClick:()=>{a&&At(a)},children:`▶ Start`})]}),tt?(0,k.jsx)(`iframe`,{src:`http://127.0.0.1:${tt}`,className:$.sandboxFrame,title:`WebCraft Sandbox`,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups`}):(0,k.jsxs)(`div`,{className:$.sandboxEmpty,children:[(0,k.jsx)(`span`,{style:{fontSize:48},children:rt?`⏳`:at?`❌`:`🌐`}),(0,k.jsx)(`span`,{style:{fontWeight:700,fontSize:16},children:rt?`Starting sandbox...`:at?`Sandbox Error`:`Preview`}),at&&(0,k.jsx)(`span`,{style:{fontSize:11,maxWidth:400,textAlign:`center`,color:`#f87171`},children:at}),!rt&&(0,k.jsxs)(`button`,{className:$.sandboxStartBtn,onClick:()=>{a&&At(a)},children:[`▶ `,at?`Retry`:`Start Sandbox`]})]})]}):(0,k.jsx)(`div`,{className:$.codeArea,children:p.length===0&&ge?(0,k.jsx)(`div`,{className:$.noFiles,children:(0,k.jsxs)(`div`,{className:$.noFilesHero,children:[(0,k.jsx)(`span`,{className:$.noFilesIcon,children:`⏳`}),(0,k.jsx)(`span`,{className:$.noFilesTitle,children:`Pianificazione...`}),(0,k.jsx)(`span`,{className:$.noFilesTagline,children:Te.name||`Analisi della struttura del progetto in corso`})]})}):p.length===0?(0,k.jsxs)(`div`,{className:$.noFiles,children:[(0,k.jsxs)(`div`,{className:$.noFilesHero,children:[(0,k.jsx)(`span`,{className:$.noFilesIcon,children:`🔨`}),(0,k.jsx)(`span`,{className:$.noFilesTitle,children:`WebCraft`}),(0,k.jsx)(`span`,{className:$.noFilesTagline,children:`Genera progetti web completi con AI`})]}),(0,k.jsxs)(`div`,{className:$.noFilesSteps,children:[(0,k.jsxs)(`div`,{className:$.noFilesStep,children:[(0,k.jsx)(`span`,{className:$.noFilesStepNum,children:`1`}),(0,k.jsx)(`span`,{children:`Scegli un esempio o scrivi una descrizione nel box in basso`})]}),(0,k.jsxs)(`div`,{className:$.noFilesStep,children:[(0,k.jsx)(`span`,{className:$.noFilesStepNum,children:`2`}),(0,k.jsxs)(`span`,{children:[`Premi `,(0,k.jsx)(`strong`,{children:`▶ Genera`}),` — l'AI crea tutti i file del progetto`]})]}),(0,k.jsxs)(`div`,{className:$.noFilesStep,children:[(0,k.jsx)(`span`,{className:$.noFilesStepNum,children:`3`}),(0,k.jsx)(`span`,{children:`Chiedi modifiche in chat, scarica lo ZIP o avvia il Sandbox`})]})]}),(0,k.jsxs)(`div`,{className:$.noFilesExamplesHint,children:[`💡 Prova: `,(0,k.jsx)(`button`,{className:$.noFilesExampleBtn,onClick:()=>{let e=LT[0];o(e.name),c(e.desc),je(e.desc)},children:`MySaaS`}),(0,k.jsx)(`button`,{className:$.noFilesExampleBtn,onClick:()=>{let e=LT[1];o(e.name),c(e.desc),je(e.desc)},children:`MyShop`}),(0,k.jsx)(`button`,{className:$.noFilesExampleBtn,onClick:()=>{let e=LT[3];o(e.name),c(e.desc),je(e.desc)},children:`MyPortfolio`})]})]}):(0,k.jsxs)(`div`,{className:$.codeLayout,children:[(0,k.jsx)(`div`,{className:$.ideTabBar,children:p.map((e,t)=>{let n=e._error||!!e._syntaxError,r=t===h;return(0,k.jsxs)(`button`,{className:`${$.ideTab} ${r?$.ideTabActive:``} ${n?$.ideTabError:``} ${e._pending?$.ideTabPending:``}`,onClick:()=>{g(t),x(null),y(null),ge&&ce.current!==null&&t!==ce.current&&(le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{ce.current!==null&&(g(ce.current),y(null))},1e4))},title:e.name,children:[(0,k.jsx)(`span`,{className:$.ideTabIcon,children:e._pending?`⌛`:n?`⚠`:BT(e.name)}),(0,k.jsx)(`span`,{className:$.ideTabName,children:e.name.split(`/`).pop()}),S.has(e.name)&&(0,k.jsx)(`span`,{className:$.ideTabUnsaved,children:`●`}),n&&(0,k.jsx)(`span`,{className:$.ideTabDot})]},t)})}),me&&(0,k.jsxs)(`div`,{className:$.diffOverlay,children:[(0,k.jsxs)(`div`,{className:$.diffOverlayHeader,children:[(0,k.jsxs)(`span`,{children:[`✏ Modifica proposta — `,(0,k.jsx)(`strong`,{children:me.file})]}),(0,k.jsxs)(`div`,{className:$.diffOverlayActions,children:[(0,k.jsx)(`button`,{className:$.diffAcceptBtn,onClick:()=>{m(e=>e.map(e=>e.name===me.file?{...e,content:me.after}:e)),he(null)},children:`✓ Accetta`}),(0,k.jsx)(`button`,{className:$.diffRejectBtn,onClick:()=>he(null),children:`✕ Rifiuta`})]})]}),(0,k.jsxs)(`div`,{className:$.diffOverlayBody,children:[me.before.split(`
|
|
778
|
+
[Piano approvato — procedi con le modifiche]`,null,[])}function H(e){e&&Array.from(e).forEach(e=>{let t=new FileReader;t.onload=t=>{let n=(t.target?.result).split(`,`)[1];Fe(t=>[...t,{name:e.name,mimeType:e.type,base64:n,size:e.size}])},t.readAsDataURL(e)})}let Vt=a&&p.length>0,Ht=p[h],Ut=Me||ge;return(0,k.jsxs)(`div`,{className:$.root,children:[(0,k.jsxs)(`div`,{className:$.header,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:$.title,children:`⚙ WebCraft`}),(0,k.jsx)(`div`,{className:$.subtitle,children:`Genera progetti web completi con agenti AI`})]}),(0,k.jsxs)(`div`,{className:$.headerTabs,children:[(0,k.jsx)(`button`,{className:`${$.tabBtn} ${t===`new`?$.tabActive:``}`,onClick:()=>n(`new`),children:`+ Nuovo`}),(0,k.jsx)(`button`,{className:`${$.tabBtn} ${t===`projects`?$.tabActive:``}`,onClick:()=>{n(`projects`),Lt()},children:`📁 Progetti`})]})]}),(0,k.jsx)(`div`,{className:$.body,children:t===`projects`?(0,k.jsx)(`div`,{className:$.projectsList,children:$e.length===0?(0,k.jsxs)(`div`,{className:$.emptyProjects,children:[(0,k.jsx)(`span`,{className:$.emptyIcon,children:`📁`}),(0,k.jsx)(`span`,{children:e(`webcraft.noProjects`)}),(0,k.jsx)(`span`,{className:$.emptyHint,children:`Crea un progetto nella tab Nuovo`})]}):$e.map(e=>(0,k.jsxs)(`div`,{className:$.projectCard,children:[(0,k.jsxs)(`div`,{className:$.projectInfo,children:[(0,k.jsx)(`div`,{className:$.projectName,children:e.name}),(0,k.jsx)(`div`,{className:$.projectDesc,children:e.description}),(0,k.jsxs)(`div`,{className:$.projectMeta,children:[(0,k.jsxs)(`span`,{children:[`📄 `,e.fileCount,` file`]}),(0,k.jsxs)(`span`,{children:[`📅 `,e.createdAt?new Date(e.createdAt).toLocaleString():``]})]})]}),(0,k.jsx)(`button`,{className:$.openBtn,onClick:()=>Rt(e),children:`↗ Apri`}),(0,k.jsx)(`button`,{className:$.deleteBtn,onClick:()=>zt(e),children:`🗑`})]},e.name))}):(0,k.jsxs)(`div`,{className:$.editor,children:[(0,k.jsxs)(`div`,{className:$.examples,children:[(0,k.jsx)(`div`,{className:$.sectionLabel,children:`Esempi`}),(0,k.jsx)(`div`,{className:$.examplePills,children:RT.map(e=>(0,k.jsx)(`button`,{className:$.examplePill,onClick:()=>{o(e.name),c(e.desc),je(e.desc)},children:e.name},e.name))})]}),(0,k.jsxs)(`div`,{className:$.editorCols,children:[(0,k.jsxs)(`div`,{className:$.leftSidebar,children:[(0,k.jsxs)(`div`,{className:$.panel,children:[(0,k.jsx)(`div`,{className:$.panelTitle,children:`Blocchi`}),zT.map(e=>(0,k.jsxs)(`label`,{className:$.blockLabel,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:l[e.key],onChange:t=>u(n=>({...n,[e.key]:t.target.checked})),className:$.blockCheck}),(0,k.jsx)(`span`,{children:e.icon}),(0,k.jsx)(`span`,{children:e.label})]},e.key))]}),l.auth&&(0,k.jsxs)(`div`,{className:$.panel,children:[(0,k.jsxs)(`div`,{className:$.panelHeader,children:[(0,k.jsx)(`div`,{className:$.panelTitle,children:`Campi Auth`}),(0,k.jsx)(`button`,{className:$.addBtn,onClick:()=>f(e=>[...e,{label:`New field`,type:`text`,required:!1}]),children:`+ Campo`})]}),d.map((e,t)=>(0,k.jsxs)(`div`,{className:$.authField,children:[(0,k.jsx)(`input`,{value:e.label,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,label:e.target.value}:n)),className:$.authFieldInput}),(0,k.jsx)(`select`,{value:e.type,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,type:e.target.value}:n)),className:$.authFieldSelect,children:[`text`,`email`,`password`,`tel`,`date`,`number`].map(e=>(0,k.jsx)(`option`,{value:e,children:e},e))}),(0,k.jsx)(`input`,{type:`checkbox`,checked:e.required,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,required:e.target.checked}:n)),title:`Required`,className:$.authFieldReq}),(0,k.jsx)(`button`,{onClick:()=>f(e=>e.filter((e,n)=>n!==t)),className:$.removeFieldBtn,children:`×`})]},t))]}),(0,k.jsxs)(`div`,{className:$.panel,children:[(0,k.jsxs)(`div`,{className:$.panelHeader,children:[(0,k.jsx)(`div`,{className:$.panelTitle,children:`🗂 Contesto AI`}),(0,k.jsx)(`button`,{className:$.addBtn,onClick:()=>He({mode:`new`,idx:null,name:``,content:``,type:`skill`,generating:!1}),children:`+ Skill`})]}),Re.length>0?(0,k.jsx)(`div`,{className:$.skillsList,children:Re.map((e,t)=>(0,k.jsxs)(`div`,{className:$.skillRow,children:[(0,k.jsx)(`span`,{className:$.skillIcon,children:UT(e.type)}),(0,k.jsx)(`span`,{className:$.skillName,title:e.name,children:e.name}),(0,k.jsx)(`span`,{className:`${$.skillBadge} ${$[`skillBadge_`+e.type]}`,children:e.type}),!e.content&&e.type!==`log`&&(0,k.jsx)(`span`,{className:$.skillEmpty,children:`⚠`}),(0,k.jsx)(`button`,{className:$.skillBtn,onClick:()=>He({mode:e.type===`log`?`view`:`edit`,idx:t,name:e.name,content:e.content,type:e.type,generating:!1}),children:e.type===`log`?`👁`:`✏`}),e.type!==`memory`&&e.type!==`provider`&&e.type!==`log`&&(0,k.jsx)(`button`,{className:$.skillBtn,onClick:()=>It(t),children:`🗑`}),e.type===`log`&&(0,k.jsx)(`button`,{className:$.skillBtn,onClick:()=>Ft(t),children:`🗑`})]},t))}):(0,k.jsx)(`div`,{className:$.skillsEmpty,children:L?`Nessun file di contesto. Clicca "+ Skill" per aggiungerne uno.`:`Crea o carica un progetto per i file di contesto.`})]}),Ue.length>0&&(0,k.jsxs)(`div`,{className:$.panel,children:[(0,k.jsx)(`div`,{className:$.panelTitle,children:`💾 Snapshot`}),Ue.slice(0,5).map(e=>{let t=e.ts.replace(`T`,` `).slice(0,16);return(0,k.jsxs)(`div`,{className:$.snapshotRow,children:[(0,k.jsx)(`span`,{className:$.snapshotTs,children:t}),(0,k.jsxs)(`span`,{className:$.snapshotCount,children:[e.fileCount,`f`]}),(0,k.jsx)(`button`,{className:$.snapshotBtn,onClick:()=>Dt(e.ts),children:`↺`})]},e.ts)})]}),ge&&(0,k.jsx)(`div`,{className:$.genStatus,children:`⏳ Generazione...`}),ve&&(0,k.jsxs)(`div`,{className:$.repairStatus,children:[(0,k.jsx)(`div`,{className:$.repairStatusTitle,children:`🔧 Correzione automatica...`}),(0,k.jsxs)(`div`,{className:$.repairStatusProg,children:[be,` / `,Se,` file`]}),(0,k.jsx)(`div`,{className:$.repairStatusFile,children:Ce})]}),p.length>0&&!ge&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:$.actionRow,children:[(0,k.jsx)(`button`,{className:$.actionBtn,onClick:V,children:`⬇ ZIP`}),(0,k.jsx)(`button`,{className:$.actionBtnIcon,title:`Syntax check`,onClick:Ot,children:`✅`}),(0,k.jsx)(`button`,{className:`${$.actionBtnIcon} ${Ge?$.actionBtnActive:``}`,title:`Grep`,onClick:()=>Ke(!Ge),children:`🔍`}),(0,k.jsx)(`button`,{className:$.actionBtnIcon,title:`Snapshot`,onClick:Tt,children:`💾`})]}),p.some(e=>e._error||e._syntaxError)&&!ve&&(0,k.jsx)(`button`,{className:$.repairBtn,onClick:kt,children:`🔧 Correggi tutti i file rossi`}),(0,k.jsx)(`button`,{className:$.sandboxBtn,onClick:()=>{a?At(a):i(`preview`)},children:rt?`⏳ Starting...`:tt?`🌐 Sandbox Live`:`▶ Sandbox`}),Oe&&(0,k.jsxs)(`div`,{className:$.statsBar,children:[(0,k.jsxs)(`span`,{children:[`⏱ `,Oe.seconds>=60?`${Math.floor(Oe.seconds/60)}m ${Oe.seconds%60}s`:`${Oe.seconds}s`]}),(0,k.jsxs)(`span`,{children:[`↑ `,Oe.tokIn.toLocaleString(),` tok`]}),(0,k.jsxs)(`span`,{children:[`↓ `,Oe.tokOut.toLocaleString(),` tok`]}),(0,k.jsxs)(`span`,{children:[`📄 `,Oe.files,` file`]})]})]})]}),(0,k.jsxs)(`div`,{className:$.rightPanel,children:[(0,k.jsxs)(`div`,{className:$.rightTabBar,children:[(0,k.jsx)(`button`,{className:`${$.rightTab} ${r===`preview`?``:$.rightTabActive}`,onClick:()=>i(`files`),children:`📄 File`}),(0,k.jsx)(`button`,{className:`${$.rightTab} ${r===`preview`?$.rightTabActive:``}`,onClick:()=>i(`preview`),children:`🌐 Sandbox`})]}),ve&&(0,k.jsxs)(`div`,{className:$.repairBar,children:[(0,k.jsxs)(`div`,{className:$.repairBarRow,children:[(0,k.jsx)(`span`,{className:$.repairBarIcon,children:`🔧`}),(0,k.jsx)(`span`,{className:$.repairBarLabel,children:`Auto-fix`}),(0,k.jsx)(`span`,{className:$.repairBarFile,children:Ce}),(0,k.jsxs)(`span`,{className:$.repairBarCounter,children:[be,` / `,Se]}),(0,k.jsx)(`span`,{className:$.repairBarTime,children:lt}),(0,k.jsx)(`button`,{className:$.stopBtn,onClick:wt,children:`⏹ Stop`})]}),(0,k.jsx)(`div`,{className:$.progressTrack,children:(0,k.jsx)(`div`,{className:$.repairProgress,style:{width:Se>0?`${Math.round(be/Se*100)}%`:`0%`}})})]}),ge&&(0,k.jsxs)(`div`,{className:$.genBar,children:[(0,k.jsxs)(`div`,{className:$.genBarRow,children:[(0,k.jsx)(`span`,{className:$.genBarRobot,children:`🤖`}),(0,k.jsx)(`span`,{className:$.genBarLabel,children:Te.total===0?`Pianificazione...`:`Generazione`}),(0,k.jsx)(`span`,{className:$.genBarFile,children:Te.name.split(`,`)[0].trim()}),(0,k.jsx)(`span`,{className:$.genBarCounter,children:Te.total>0?`${Te.fi} / ${Te.total}`:``}),(0,k.jsx)(`span`,{className:$.genBarCounter,children:P.tokIn+P.tokOut>0?`↑${vt(P.tokIn)} ↓${vt(P.tokOut)}`:``}),(0,k.jsx)(`span`,{className:$.genBarTime,children:st}),(0,k.jsxs)(`span`,{className:$.genDots,children:[(0,k.jsx)(`span`,{className:`${$.dot} ${$.dot1}`}),(0,k.jsx)(`span`,{className:`${$.dot} ${$.dot2}`}),(0,k.jsx)(`span`,{className:`${$.dot} ${$.dot3}`})]})]}),(0,k.jsx)(`div`,{className:$.progressTrack,children:(0,k.jsx)(`div`,{className:$.genProgress,style:{width:Te.total>0?`${Math.round(Te.fi/Te.total*100)}%`:`0%`}})})]}),r===`preview`?(0,k.jsxs)(`div`,{className:$.sandboxWrap,children:[(0,k.jsxs)(`div`,{className:$.sandboxStatusBar,children:[(0,k.jsx)(`span`,{className:$.sandboxStatusDot,style:{background:tt?`#4ade80`:rt?`#facc15`:`#64748b`}}),(0,k.jsx)(`span`,{className:$.sandboxStatusText,children:tt?`Live :${tt}`:rt?`Starting...`:`Stopped`}),tt&&(0,k.jsx)(`button`,{className:$.sandboxReloadBtn,onClick:()=>{let e=document.querySelector(`iframe[title="WebCraft Sandbox"]`);e&&(e.src=e.src)},children:`↻`}),tt&&(0,k.jsx)(`button`,{className:$.sandboxStopBtn,onClick:()=>{fetch(`/api/studio/webcraft/sandbox`,{method:`DELETE`}),nt(null)},children:`⏹`}),!tt&&!rt&&(0,k.jsx)(`button`,{className:$.sandboxStartBtnSmall,onClick:()=>{a&&At(a)},children:`▶ Start`})]}),tt?(0,k.jsx)(`iframe`,{src:`http://127.0.0.1:${tt}`,className:$.sandboxFrame,title:`WebCraft Sandbox`,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups`}):(0,k.jsxs)(`div`,{className:$.sandboxEmpty,children:[(0,k.jsx)(`span`,{style:{fontSize:48},children:rt?`⏳`:at?`❌`:`🌐`}),(0,k.jsx)(`span`,{style:{fontWeight:700,fontSize:16},children:rt?`Starting sandbox...`:at?`Sandbox Error`:`Preview`}),at&&(0,k.jsx)(`span`,{style:{fontSize:11,maxWidth:400,textAlign:`center`,color:`#f87171`},children:at}),!rt&&(0,k.jsxs)(`button`,{className:$.sandboxStartBtn,onClick:()=>{a&&At(a)},children:[`▶ `,at?`Retry`:`Start Sandbox`]})]})]}):(0,k.jsx)(`div`,{className:$.codeArea,children:p.length===0&&ge?(0,k.jsx)(`div`,{className:$.noFiles,children:(0,k.jsxs)(`div`,{className:$.noFilesHero,children:[(0,k.jsx)(`span`,{className:$.noFilesIcon,children:`⏳`}),(0,k.jsx)(`span`,{className:$.noFilesTitle,children:`Pianificazione...`}),(0,k.jsx)(`span`,{className:$.noFilesTagline,children:Te.name||`Analisi della struttura del progetto in corso`})]})}):p.length===0?(0,k.jsxs)(`div`,{className:$.noFiles,children:[(0,k.jsxs)(`div`,{className:$.noFilesHero,children:[(0,k.jsx)(`span`,{className:$.noFilesIcon,children:`🔨`}),(0,k.jsx)(`span`,{className:$.noFilesTitle,children:`WebCraft`}),(0,k.jsx)(`span`,{className:$.noFilesTagline,children:`Genera progetti web completi con AI`})]}),(0,k.jsxs)(`div`,{className:$.noFilesSteps,children:[(0,k.jsxs)(`div`,{className:$.noFilesStep,children:[(0,k.jsx)(`span`,{className:$.noFilesStepNum,children:`1`}),(0,k.jsx)(`span`,{children:`Scegli un esempio o scrivi una descrizione nel box in basso`})]}),(0,k.jsxs)(`div`,{className:$.noFilesStep,children:[(0,k.jsx)(`span`,{className:$.noFilesStepNum,children:`2`}),(0,k.jsxs)(`span`,{children:[`Premi `,(0,k.jsx)(`strong`,{children:`▶ Genera`}),` — l'AI crea tutti i file del progetto`]})]}),(0,k.jsxs)(`div`,{className:$.noFilesStep,children:[(0,k.jsx)(`span`,{className:$.noFilesStepNum,children:`3`}),(0,k.jsx)(`span`,{children:`Chiedi modifiche in chat, scarica lo ZIP o avvia il Sandbox`})]})]}),(0,k.jsxs)(`div`,{className:$.noFilesExamplesHint,children:[`💡 Prova: `,(0,k.jsx)(`button`,{className:$.noFilesExampleBtn,onClick:()=>{let e=RT[0];o(e.name),c(e.desc),je(e.desc)},children:`MySaaS`}),(0,k.jsx)(`button`,{className:$.noFilesExampleBtn,onClick:()=>{let e=RT[1];o(e.name),c(e.desc),je(e.desc)},children:`MyShop`}),(0,k.jsx)(`button`,{className:$.noFilesExampleBtn,onClick:()=>{let e=RT[3];o(e.name),c(e.desc),je(e.desc)},children:`MyPortfolio`})]})]}):(0,k.jsxs)(`div`,{className:$.codeLayout,children:[(0,k.jsx)(`div`,{className:$.ideTabBar,children:p.map((e,t)=>{let n=e._error||!!e._syntaxError,r=t===h;return(0,k.jsxs)(`button`,{className:`${$.ideTab} ${r?$.ideTabActive:``} ${n?$.ideTabError:``} ${e._pending?$.ideTabPending:``}`,onClick:()=>{g(t),x(null),y(null),ge&&ce.current!==null&&t!==ce.current&&(le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{ce.current!==null&&(g(ce.current),y(null))},1e4))},title:e.name,children:[(0,k.jsx)(`span`,{className:$.ideTabIcon,children:e._pending?`⌛`:n?`⚠`:VT(e.name)}),(0,k.jsx)(`span`,{className:$.ideTabName,children:e.name.split(`/`).pop()}),S.has(e.name)&&(0,k.jsx)(`span`,{className:$.ideTabUnsaved,children:`●`}),n&&(0,k.jsx)(`span`,{className:$.ideTabDot})]},t)})}),me&&(0,k.jsxs)(`div`,{className:$.diffOverlay,children:[(0,k.jsxs)(`div`,{className:$.diffOverlayHeader,children:[(0,k.jsxs)(`span`,{children:[`✏ Modifica proposta — `,(0,k.jsx)(`strong`,{children:me.file})]}),(0,k.jsxs)(`div`,{className:$.diffOverlayActions,children:[(0,k.jsx)(`button`,{className:$.diffAcceptBtn,onClick:()=>{m(e=>e.map(e=>e.name===me.file?{...e,content:me.after}:e)),he(null)},children:`✓ Accetta`}),(0,k.jsx)(`button`,{className:$.diffRejectBtn,onClick:()=>he(null),children:`✕ Rifiuta`})]})]}),(0,k.jsxs)(`div`,{className:$.diffOverlayBody,children:[me.before.split(`
|
|
777
779
|
`).map((e,t)=>e===(me.after.split(`
|
|
778
780
|
`)[t]??``)?(0,k.jsxs)(`div`,{className:$.diffSame,children:[`\xA0`,e||` `]},t):(0,k.jsxs)(`div`,{className:$.diffRem,children:[`- `,e]},`r${t}`)),me.after.split(`
|
|
779
781
|
`).map((e,t)=>e===(me.before.split(`
|
|
780
|
-
`)[t]??``)?null:(0,k.jsxs)(`div`,{className:$.diffAdd,children:[`+ `,e]},`a${t}`))]})]}),(0,k.jsxs)(`div`,{className:$.codeRow,children:[(0,k.jsx)(`div`,{className:$.fileTreeWrap,children:(0,k.jsx)(jT,{files:p,activeIndex:h,unsavedFiles:S,onSelect:e=>{g(e),x(null),y(null),ge&&ce.current!==null&&e!==ce.current&&(le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{ce.current!==null&&(g(ce.current),y(null))},1e4))}})}),(0,k.jsx)(`div`,{className:$.codeEditorWrap,children:Ht&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:$.codeHeader,children:[(0,k.jsx)(`span`,{className:$.codeFileIcon,children:
|
|
781
|
-
`).length,` righe · `,
|
|
782
|
+
`)[t]??``)?null:(0,k.jsxs)(`div`,{className:$.diffAdd,children:[`+ `,e]},`a${t}`))]})]}),(0,k.jsxs)(`div`,{className:$.codeRow,children:[(0,k.jsx)(`div`,{className:$.fileTreeWrap,children:(0,k.jsx)(jT,{files:p,activeIndex:h,unsavedFiles:S,onSelect:e=>{g(e),x(null),y(null),ge&&ce.current!==null&&e!==ce.current&&(le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{ce.current!==null&&(g(ce.current),y(null))},1e4))}})}),(0,k.jsx)(`div`,{className:$.codeEditorWrap,children:Ht&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:$.codeHeader,children:[(0,k.jsx)(`span`,{className:$.codeFileIcon,children:VT(Ht.name)}),(0,k.jsx)(`span`,{className:$.codeFileName,children:Ht.name}),Ht.content&&!Ht._error&&(0,k.jsxs)(`span`,{className:$.codeFileMeta,children:[Ht.content.split(`
|
|
783
|
+
`).length,` righe · `,HT(Ht.content)]}),!Ht._pending&&!Ht._error&&Ht.content&&(0,k.jsx)(`button`,{className:`${$.editToggleBtn} ${b===null?``:$.editToggleBtnActive}`,onClick:()=>{b===null?x(Ht.content):(m(e=>e.map((e,t)=>t===h?{...e,content:b}:e)),D(`/api/studio/webcraft/file/write`,{projectName:a,path:Ht.name,content:b}),x(null))},children:b===null?`✏ Modifica`:`💾 Salva`}),(0,k.jsx)(`button`,{className:$.headerIconBtn,title:`Split view`,onClick:()=>A(ae===null?+(h===0&&p.length>1):null),children:`⫼`}),(0,k.jsx)(`button`,{className:`${$.headerIconBtn} ${ie?$.headerIconBtnActive:``}`,title:`Terminal`,onClick:()=>O(!ie),children:`⌨`}),(0,k.jsx)(`button`,{className:$.headerIconBtn,title:`Development Guide`,onClick:()=>se(!0),children:`📖`})]}),w&&(0,k.jsxs)(`div`,{className:$.findBar,children:[(0,k.jsx)(`input`,{className:$.findInput,value:te,onChange:e=>T(e.target.value),placeholder:`Find...`,autoFocus:!0}),(0,k.jsx)(`input`,{className:$.findInput,value:ne,onChange:e=>re(e.target.value),placeholder:`Replace...`}),(0,k.jsx)(`span`,{className:$.findCount,children:te?((Ht.content||``).match(new RegExp(te.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),`gi`))?.length||0)+` found`:``}),(0,k.jsx)(`button`,{className:$.findBtn,onClick:()=>{!te||b===null||x(b.replace(new RegExp(te.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),`i`),ne))},children:`Replace`}),(0,k.jsx)(`button`,{className:$.findBtn,onClick:()=>{!te||b===null||x(b.replace(new RegExp(te.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),`gi`),ne))},children:`All`}),(0,k.jsx)(`button`,{className:$.findClose,onClick:()=>ee(!1),children:`×`})]}),Ht._error&&(0,k.jsx)(`div`,{className:$.fileError,children:`⚠ Generazione fallita — chiedi al modello di rigenerare questo file`}),Ht._syntaxError&&!Ht._error&&(0,k.jsxs)(`div`,{className:$.fileSyntaxError,children:[`⚠ Syntax error: `,Ht._syntaxError]}),ge&&v!==null?(0,k.jsx)(`pre`,{className:$.streamingPre,ref:e=>{e&&ue.current&&(e.scrollTop=e.scrollHeight)},onScroll:e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<50?ue.current=!0:(ue.current=!1,de.current&&clearTimeout(de.current),de.current=setTimeout(()=>{ue.current=!0},15e3))},dangerouslySetInnerHTML:{__html:LT(v||``,(Ht.name.split(`.`).pop()||`js`).toLowerCase())+`<span class="`+$.streamingCursor+`">▋</span>`}}):(0,k.jsx)(TT,{value:b===null?Ht.content||``:b,filename:Ht.name,readOnly:b===null,projectName:a,onChange:e=>{x(e),Ht&&C(e=>new Set(e).add(Ht.name))},onSave:e=>{m(t=>t.map((t,n)=>n===h?{...t,content:e}:t)),D(`/api/studio/webcraft/file/write`,{projectName:a,path:Ht.name,content:e}),x(null),C(e=>{let t=new Set(e);return t.delete(Ht.name),t})}})]})}),ae!==null&&p[ae]&&(0,k.jsxs)(`div`,{className:$.codeEditorWrap,children:[(0,k.jsxs)(`div`,{className:$.codeHeader,children:[(0,k.jsx)(`span`,{className:$.codeFileIcon,children:VT(p[ae].name)}),(0,k.jsx)(`span`,{className:$.codeFileName,children:p[ae].name}),(0,k.jsx)(`button`,{className:$.headerIconBtn,onClick:()=>A(null),children:`✕`})]}),(0,k.jsx)(TT,{value:p[ae].content||``,filename:p[ae].name,readOnly:!0})]})]}),ie&&(0,k.jsxs)(`div`,{className:$.terminalPanel,children:[(0,k.jsxs)(`div`,{className:$.terminalHeader,children:[(0,k.jsx)(`span`,{className:$.terminalTitle,children:`Terminal`}),(0,k.jsx)(`button`,{className:$.terminalClose,onClick:()=>O(!1),children:`✕`})]}),(0,k.jsx)(IT,{projectDir:a||void 0})]})]})})]})]})]})}),Ie&&t!==`projects`&&(0,k.jsxs)(`div`,{className:$.planBanner,children:[(0,k.jsx)(`div`,{className:$.planTitle,children:`📌 Piano proposto — approva per eseguire`}),(0,k.jsx)(`pre`,{className:$.planText,children:Ie.plan}),(0,k.jsxs)(`div`,{className:$.planActions,children:[(0,k.jsx)(`button`,{className:$.planApprove,onClick:Bt,children:`✓ Esegui`}),(0,k.jsx)(`button`,{className:$.planReject,onClick:()=>Le(null),children:`✕ Annulla`})]})]}),Ge&&t!==`projects`&&(0,k.jsxs)(`div`,{className:$.grepPanel,children:[(0,k.jsxs)(`div`,{className:$.grepRow,children:[(0,k.jsx)(`input`,{className:$.grepInput,value:qe,onChange:e=>Je(e.target.value),onKeyDown:e=>e.key===`Enter`&&Mt(),placeholder:`Cerca nel codice...`}),(0,k.jsx)(`button`,{className:$.grepBtn,onClick:Mt,children:`🔍`}),(0,k.jsx)(`button`,{className:$.grepClose,onClick:()=>Ke(!1),children:`×`})]}),Ye.length>0&&(0,k.jsxs)(`div`,{className:$.grepCount,children:[Ye.length,` risultati`]}),(0,k.jsx)(`div`,{className:$.grepResults,children:Ye.length===0?(0,k.jsx)(`div`,{className:$.grepEmpty,children:`Nessun risultato.`}):Ye.map((e,t)=>(0,k.jsxs)(`div`,{className:$.grepMatch,onClick:()=>Nt(e.file),children:[(0,k.jsxs)(`span`,{className:$.grepMatchFile,children:[e.file,`:`,e.lineNum]}),(0,k.jsx)(`pre`,{className:$.grepMatchLine,children:e.line})]},t))})]}),Ze.length>0&&t!==`projects`&&(0,k.jsxs)(`div`,{className:$.diffPanel,children:[(0,k.jsxs)(`div`,{className:$.diffHeader,children:[(0,k.jsxs)(`span`,{children:[`🔌 Diff — `,Ze.length,` file modificati`]}),(0,k.jsx)(`button`,{className:$.diffClose,onClick:()=>Qe([]),children:`✕ Chiudi`})]}),Ze.map((e,t)=>{let n=e.after.split(`
|
|
782
784
|
`).length-e.before.split(`
|
|
783
|
-
`).length;return(0,k.jsxs)(`details`,{open:!0,className:$.diffFile,children:[(0,k.jsxs)(`summary`,{className:$.diffSummary,children:[(0,k.jsx)(`span`,{className:$.diffArrow,children:`▲`}),(0,k.jsx)(`span`,{className:$.diffFileName,children:e.file}),(0,k.jsxs)(`span`,{className:n>=0?$.diffAdded:$.diffRemoved,children:[n>=0?`+`:``,n,` linee`]})]}),(0,k.jsx)(`div`,{className:$.diffContent,children:(0,k.jsx)(
|
|
785
|
+
`).length;return(0,k.jsxs)(`details`,{open:!0,className:$.diffFile,children:[(0,k.jsxs)(`summary`,{className:$.diffSummary,children:[(0,k.jsx)(`span`,{className:$.diffArrow,children:`▲`}),(0,k.jsx)(`span`,{className:$.diffFileName,children:e.file}),(0,k.jsxs)(`span`,{className:n>=0?$.diffAdded:$.diffRemoved,children:[n>=0?`+`:``,n,` linee`]})]}),(0,k.jsx)(`div`,{className:$.diffContent,children:(0,k.jsx)(GT,{before:e.before,after:e.after})})]},t)})]}),t!==`projects`&&(0,k.jsxs)(`div`,{className:$.chatPanel,children:[(0,k.jsxs)(`div`,{className:$.chatMessages,ref:mt,children:[F.length===0&&Vt&&(0,k.jsxs)(`div`,{className:$.chatWelcome,children:[`🤖 `,e(`webcraft.doctrine.title`),` — `,(0,k.jsx)(`button`,{className:$.doctrineOpenBtn,onClick:()=>se(!0),children:`📖 Open Guide`})]}),F.map((e,t)=>(0,k.jsxs)(`div`,{className:e.role===`user`?$.chatUser:e.role===`system`?$.chatSystem:$.chatAgent,children:[e.role===`user`&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:$.chatUserBubble,children:e.text}),e.attachments&&e.attachments.length>0&&(0,k.jsx)(`div`,{className:$.chatAttachPreviews,children:e.attachments.map((e,t)=>(0,k.jsxs)(`span`,{className:$.chatAttachBadge,children:[`📎 `,e.name]},t))})]}),e.role===`system`&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:$.chatSystemBubble,children:e.text}),e.syntaxErrors?.map((e,t)=>(0,k.jsxs)(`div`,{className:$.chatSyntaxErr,children:[`✕ `,e.file,`: `,e.error]},t))]}),e.role===`agent`&&(0,k.jsxs)(`div`,{className:$.chatAgentCard,children:[(0,k.jsxs)(`div`,{className:$.chatAgentHeader,children:[(0,k.jsx)(`span`,{className:$.chatAgentRobot,children:`🤖`}),(0,k.jsx)(`span`,{className:$.chatAgentLabel,children:`WebCraft Agent`})]}),(0,k.jsx)(`div`,{className:$.chatAgentText,children:e.text.replace(/<tool>[\s\S]*?<\/tool>/g,``).trim()}),e.tools&&e.tools.filter(e=>(e.op===`edit`||e.op===`write`)&&e.result===`ok`&&(e.oldSnippet||e.newSnippet)).map((e,t)=>(0,k.jsxs)(`div`,{className:$.diffInline,children:[(0,k.jsxs)(`div`,{className:$.diffInlineHeader,children:[`✏ `,e.path]}),e.oldSnippet?.split(`
|
|
784
786
|
`).map((e,t)=>(0,k.jsxs)(`div`,{className:$.diffRemLine,children:[`- `,e]},`r${t}`)),e.newSnippet?.split(`
|
|
785
787
|
`).map((e,t)=>(0,k.jsxs)(`div`,{className:$.diffAddLine,children:[`+ `,e]},`a${t}`))]},t)),e.tools&&e.tools.length>0&&(0,k.jsx)(`div`,{className:$.chatToolBadges,children:e.tools.map((e,t)=>(0,k.jsxs)(`span`,{className:`${$.toolBadge} ${e.result===`ok`?$.toolBadgeOk:$.toolBadgeErr}`,children:[e.op===`edit`?`✏`:e.op===`write`?`+`:`👁`,` `,e.path]},t))})]})]},t)),Me&&(0,k.jsxs)(`div`,{className:$.chatAgentCard,children:[(0,k.jsxs)(`div`,{className:$.chatAgentHeader,children:[(0,k.jsx)(`span`,{className:$.chatAgentRobotAnim,children:`🤖`}),(0,k.jsx)(`span`,{className:$.chatAgentLabel,children:`WebCraft Agent`}),(0,k.jsxs)(`span`,{className:$.chatRunningDots,children:[(0,k.jsx)(`span`,{className:`${$.dot} ${$.dot1}`}),(0,k.jsx)(`span`,{className:`${$.dot} ${$.dot2}`}),(0,k.jsx)(`span`,{className:`${$.dot} ${$.dot3}`})]})]}),(0,k.jsx)(`div`,{className:$.chatAgentText,children:(0,k.jsx)(`span`,{className:$.cursor,children:``})})]})]}),Pe.length>0&&(0,k.jsx)(`div`,{className:$.attachPreviews,children:Pe.map((e,t)=>(0,k.jsxs)(`span`,{className:$.attachBadge,children:[`📎 `,e.name,(0,k.jsx)(`button`,{className:$.removeAttachBtn,onClick:()=>Fe(e=>e.filter((e,n)=>n!==t)),children:`×`})]},t))}),Vt?(0,k.jsxs)(`div`,{className:$.projActiveRow,children:[`📄 `,(0,k.jsx)(`strong`,{className:$.projActiveName,children:a}),` — scrivi per modificare o migliorare il progetto`]}):(0,k.jsxs)(`div`,{className:$.projNameRow,children:[(0,k.jsx)(`span`,{className:$.projNameLabel,children:`Nome progetto:`}),(0,k.jsx)(`input`,{className:$.projNameInput,value:a,onChange:e=>o(e.target.value),placeholder:`MioProgetto`})]}),(0,k.jsxs)(`div`,{className:$.chatInputRow,children:[(0,k.jsxs)(`label`,{className:$.attachLabel,title:`Allega immagine o PDF`,children:[`📎`,(0,k.jsx)(`input`,{ref:ht,type:`file`,multiple:!0,accept:`image/*,.pdf`,style:{display:`none`},onChange:e=>H(e.target.files)})]}),(0,k.jsx)(`textarea`,{className:$.chatTextarea,value:Ae,onChange:e=>je(e.target.value),placeholder:Vt?`Parla con il tuo agente: chiedi correzioni, migliorie, nuove funzionalità...`:`Descrivi il progetto da creare, poi premi Genera...`,disabled:Ut,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),xt())},rows:4}),(0,k.jsxs)(`div`,{className:$.chatSendCol,children:[(0,k.jsx)(`button`,{className:$.chatSendBtn,onClick:xt,disabled:Ut,children:ge?`⏳`:Vt?`▶`:`▶ Genera`}),Ut&&(0,k.jsx)(`button`,{className:$.chatStopBtn,onClick:wt,children:`⏹ Stop`})]})]})]}),oe&&(0,k.jsx)(`div`,{className:$.modalOverlay,onClick:()=>se(!1),children:(0,k.jsxs)(`div`,{className:$.modal,onClick:e=>e.stopPropagation(),style:{width:720,maxHeight:`90vh`},children:[(0,k.jsxs)(`div`,{className:$.modalHeader,children:[(0,k.jsxs)(`span`,{className:$.modalTitle,children:[`📖 `,e(`webcraft.doctrine.title`)]}),(0,k.jsx)(`span`,{className:$.doctrineSubtitle,children:e(`webcraft.doctrine.subtitle`)}),(0,k.jsx)(`button`,{className:$.modalClose,onClick:()=>se(!1),children:`✕`})]}),(0,k.jsx)(`div`,{className:$.modalBody,style:{gap:0},children:[`phase1`,`phase2`,`phase3`,`phase4`,`phase5`,`tools`,`golden`].map(t=>(0,k.jsxs)(`div`,{className:$.doctrineSection,children:[(0,k.jsx)(`div`,{className:$.doctrineSectionTitle,children:e(`webcraft.doctrine.${t}.title`)}),(0,k.jsx)(`div`,{className:$.doctrineSectionBody,children:e(`webcraft.doctrine.${t}.desc`).split(`
|
|
786
|
-
`).map((e,t)=>(0,k.jsx)(`p`,{className:e.startsWith(`•`)||e.startsWith(`1.`)||e.startsWith(`2.`)||e.startsWith(`3.`)||e.startsWith(`4.`)||e.startsWith(`5.`)||e.startsWith(`6.`)?$.doctrineBullet:``,children:e},t))})]},t))}),(0,k.jsx)(`div`,{className:$.modalFooter,children:(0,k.jsx)(`button`,{className:$.modalSaveBtn,onClick:()=>se(!1),style:{padding:`10px 28px`,fontSize:14},children:e(`webcraft.doctrine.close`)})})]})}),Ve&&(0,k.jsx)(
|
|
788
|
+
`).map((e,t)=>(0,k.jsx)(`p`,{className:e.startsWith(`•`)||e.startsWith(`1.`)||e.startsWith(`2.`)||e.startsWith(`3.`)||e.startsWith(`4.`)||e.startsWith(`5.`)||e.startsWith(`6.`)?$.doctrineBullet:``,children:e},t))})]},t))}),(0,k.jsx)(`div`,{className:$.modalFooter,children:(0,k.jsx)(`button`,{className:$.modalSaveBtn,onClick:()=>se(!1),style:{padding:`10px 28px`,fontSize:14},children:e(`webcraft.doctrine.close`)})})]})}),Ve&&(0,k.jsx)(KT,{modal:Ve,skills:Re,projectName:a,onClose:()=>He(null),onSave:(e,t,n)=>Pt(Ve,e,t,n)})]})}function GT({before:e,after:t}){let n=e.split(`
|
|
787
789
|
`),r=t.split(`
|
|
788
|
-
`),i=[],a=0,o=0;for(;(a<n.length||o<r.length)&&(a>=n.length?i.push({type:`add`,text:r[o++]??``}):o>=r.length?i.push({type:`rem`,text:n[a++]??``}):n[a]===r[o]?(i.push({type:`same`,text:n[a++]??``}),o++):(i.push({type:`rem`,text:n[a++]??``}),i.push({type:`add`,text:r[o++]??``})),!(i.length>2e3)););return(0,k.jsx)(`div`,{style:{fontFamily:`var(--mono)`,fontSize:10},children:i.map((e,t)=>(0,k.jsxs)(`div`,{style:{padding:`1px 8px`,background:e.type===`add`?`#0a3a1a`:e.type===`rem`?`#3a0a0a`:`transparent`,color:e.type===`add`?`#4ade80`:e.type===`rem`?`#f87171`:`var(--dim)`,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:[e.type===`add`?`+`:e.type===`rem`?`-`:` `,e.text]},t))})}function
|
|
789
|
-
Scrivi le istruzioni in Markdown...`,className:$.modalContentArea,style:{borderColor:g?`#e05050`:`var(--border2)`}})]})]})}),(0,k.jsxs)(`div`,{className:$.modalFooter,children:[(0,k.jsx)(`button`,{onClick:r,className:$.modalCancelBtn,children:`Annulla`}),e.mode!==`view`&&(0,k.jsx)(`button`,{onClick:y,className:$.modalSaveBtn,children:`✓ Salva`})]})]})})}var KT={root:`_root_x9yvu_1`,loading:`_loading_x9yvu_7`,empty:`_empty_x9yvu_18`,emptyIcon:`_emptyIcon_x9yvu_29`,emptyTitle:`_emptyTitle_x9yvu_30`,emptySub:`_emptySub_x9yvu_31`,generateBtn:`_generateBtn_x9yvu_33`,summary:`_summary_x9yvu_46`,sectionTitle:`_sectionTitle_x9yvu_57`,alertTitle:`_alertTitle_x9yvu_68`,actionCard:`_actionCard_x9yvu_70`,actionTime:`_actionTime_x9yvu_81`,actionText:`_actionText_x9yvu_89`,schedCard:`_schedCard_x9yvu_95`,schedTime:`_schedTime_x9yvu_106`,schedTitle:`_schedTitle_x9yvu_114`,alertCard:`_alertCard_x9yvu_119`,alertSev:`_alertSev_x9yvu_129`,alertAction:`_alertAction_x9yvu_135`,insight:`_insight_x9yvu_141`,regenRow:`_regenRow_x9yvu_148`,regenBtn:`_regenBtn_x9yvu_153`};function qT(){let e=j(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1),l=()=>{i(!0),c(!1),E(`/api/plan`).then(e=>{e?.plan?(n(e.plan),c(!1)):(n(null),c(!0)),i(!1)}).catch(()=>{i(!1),c(!0)})},u=async()=>{o(!0),i(!0),n(null);try{await D(`/api/plan/refresh`,{}),l()}catch{i(!1)}finally{o(!1)}};if((0,_.useEffect)(()=>{l()},[]),r)return(0,k.jsxs)(`div`,{className:KT.loading,children:[(0,k.jsx)(`div`,{className:`spinner`}),(0,k.jsx)(`div`,{children:a?`Generating plan with 5 agents...`:`Loading plan...`})]});if(s||!t)return(0,k.jsxs)(`div`,{className:KT.empty,children:[(0,k.jsx)(`div`,{className:KT.emptyIcon,children:`🗓️`}),(0,k.jsxs)(`div`,{className:KT.emptyTitle,children:[e(`plan.noplan`),` generated yet`]}),(0,k.jsx)(`div`,{className:KT.emptySub,children:`Generate a daily plan using your calendar, tasks, and emails.`}),(0,k.jsx)(`button`,{className:KT.generateBtn,onClick:u,children:e(`plan.generate`)})]});let d=e=>typeof e==`string`?e:e.description??e.message??e.action_required??`Alert`,f=e=>typeof e==`object`&&e.severity?` [${e.severity.toUpperCase()}]`:``,p=e=>typeof e==`object`&&e.action_required&&e.action_required!==d(e)?e.action_required:``,m=e=>typeof e==`string`?e:e.message??e.insight??``;return(0,k.jsxs)(`div`,{className:KT.root,children:[t.executive_summary&&(0,k.jsx)(`div`,{className:KT.summary,children:t.executive_summary}),t.priority_actions&&t.priority_actions.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:KT.sectionTitle,children:`Priority Actions`}),t.priority_actions.map((e,t)=>(0,k.jsxs)(`div`,{className:KT.actionCard,children:[e.time&&(0,k.jsx)(`span`,{className:KT.actionTime,children:e.time}),(0,k.jsx)(`span`,{className:KT.actionText,children:e.action})]},t))]}),t.schedule&&t.schedule.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:KT.sectionTitle,children:`Schedule`}),t.schedule.map((e,t)=>(0,k.jsxs)(`div`,{className:KT.schedCard,children:[(0,k.jsxs)(`span`,{className:KT.schedTime,children:[e.time_start,`–`,e.time_end]}),(0,k.jsx)(`span`,{className:KT.schedTitle,children:e.title})]},t))]}),t.security_alerts&&t.security_alerts.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`${KT.sectionTitle} ${KT.alertTitle}`,children:`Security Alerts`}),t.security_alerts.map((e,t)=>(0,k.jsxs)(`div`,{className:KT.alertCard,children:[(0,k.jsxs)(`span`,{className:KT.alertSev,children:[`!`,f(e)]}),(0,k.jsx)(`span`,{children:d(e)}),p(e)&&(0,k.jsxs)(`div`,{className:KT.alertAction,children:[`Action: `,p(e)]})]},t))]}),t.insights&&t.insights.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:KT.sectionTitle,children:`Insights`}),t.insights.map((e,t)=>(0,k.jsxs)(`div`,{className:KT.insight,children:[`→ `,m(e)]},t))]}),(0,k.jsx)(`div`,{className:KT.regenRow,children:(0,k.jsx)(`button`,{className:KT.regenBtn,onClick:u,disabled:a,children:a?`Regenerating…`:`↺ Regenerate`})})]})}function JT(e){return e===`folder`?`📁`:e===`image`?`🖼`:e===`pdf`?`📕`:e===`video`?`🎬`:e===`audio`?`🎵`:e===`sheet`?`📊`:e===`slides`?`📽`:`📄`}function YT(){let e=j(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=(e=``)=>{i(!0),E(e?`/api/onedrive?q=${encodeURIComponent(e)}`:`/api/onedrive`).then(e=>{n(e??{files:[]}),i(!1)}).catch(()=>{o(`Could not load OneDrive. Run nha microsoft auth in the terminal to connect.`),i(!1)})};if((0,_.useEffect)(()=>{l()},[]),a)return(0,k.jsx)(`div`,{className:G.error,children:a});let u=t?.files??[],d=t?.quota;return(0,k.jsxs)(`div`,{className:G.root,children:[d&&(0,k.jsxs)(`div`,{className:G.quotaBar,children:[(0,k.jsxs)(`div`,{className:G.quotaText,children:[(0,k.jsxs)(`span`,{className:G.quotaUsed,children:[d.usage,` of `,d.limit,` used`]}),(0,k.jsxs)(`span`,{className:G.quotaPct,children:[d.percentUsed,`%`]})]}),(0,k.jsx)(`div`,{className:G.quotaTrack,children:(0,k.jsx)(`div`,{className:G.quotaFill,style:{width:`${Math.min(d.percentUsed,100)}%`,background:d.percentUsed>90?`var(--red)`:d.percentUsed>70?`var(--amber)`:`var(--cyan)`}})})]}),(0,k.jsxs)(`div`,{className:G.searchRow,children:[(0,k.jsx)(`input`,{className:G.searchInput,value:s,onChange:e=>c(e.target.value),placeholder:`Search OneDrive files…`,onKeyDown:e=>e.key===`Enter`&&l(s)}),(0,k.jsx)(`button`,{className:G.searchBtn,onClick:()=>l(s),children:`Search`})]}),r&&(0,k.jsxs)(`div`,{className:G.loading,children:[(0,k.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!r&&u.length===0&&(0,k.jsx)(`div`,{className:G.empty,children:e(`drive.noFiles`)}),(0,k.jsx)(`div`,{className:G.fileList,children:u.map(e=>(0,k.jsxs)(`div`,{className:G.fileRow,children:[(0,k.jsx)(`span`,{className:G.fileIcon,children:JT(e.type)}),(0,k.jsxs)(`div`,{className:G.fileInfo,children:[(0,k.jsx)(`div`,{className:G.fileName,children:e.name}),(0,k.jsxs)(`div`,{className:G.fileMeta,children:[e.modifiedTime?new Date(e.modifiedTime).toLocaleDateString():``,e.size?` · ${e.size}`:``]})]}),(0,k.jsx)(`div`,{className:G.fileBtns,children:e.webViewLink&&(0,k.jsx)(`a`,{className:G.openBtn,href:e.webViewLink,target:`_blank`,rel:`noreferrer`,children:`Open`})})]},e.id))})]})}var XT={root:`_root_1vbmp_1`,loading:`_loading_1vbmp_2`,error:`_error_1vbmp_3`,empty:`_empty_1vbmp_4`,addRow:`_addRow_1vbmp_6`,addInput:`_addInput_1vbmp_7`,addBtn:`_addBtn_1vbmp_8`,list:`_list_1vbmp_10`,taskRow:`_taskRow_1vbmp_11`,checkBtn:`_checkBtn_1vbmp_12`,taskInfo:`_taskInfo_1vbmp_14`,taskTitle:`_taskTitle_1vbmp_15`,taskDue:`_taskDue_1vbmp_16`,taskImp:`_taskImp_1vbmp_17`};function ZT(){let e=j(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=()=>{E(`/api/mstodo`).then(e=>{n(e?.tasks??[]),i(!1)}).catch(()=>{o(`Microsoft To Do requires Microsoft authentication. Run nha microsoft auth in the terminal.`),i(!1)})};(0,_.useEffect)(()=>{l()},[]);let u=()=>{let e=s.trim();e&&(c(``),D(`/api/mstodo`,{title:e}).then(e=>{e?.task&&l()}))},d=(e,t)=>{D(`/api/mstodo/${e}/complete`,{listId:t}).then(()=>l())};return r?(0,k.jsxs)(`div`,{className:XT.loading,children:[(0,k.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):a?(0,k.jsx)(`div`,{className:XT.error,children:a}):(0,k.jsxs)(`div`,{className:XT.root,children:[(0,k.jsxs)(`div`,{className:XT.addRow,children:[(0,k.jsx)(`input`,{className:XT.addInput,value:s,onChange:e=>c(e.target.value),placeholder:`Add a new task…`,onKeyDown:e=>e.key===`Enter`&&u()}),(0,k.jsx)(`button`,{className:XT.addBtn,onClick:u,children:`+ Add`})]}),t.length===0&&(0,k.jsx)(`div`,{className:XT.empty,children:`No active tasks`}),(0,k.jsx)(`div`,{className:XT.list,children:t.map(e=>{let t=e.importance===`high`?`var(--red)`:e.importance===`low`?`var(--dim)`:`var(--amber)`;return(0,k.jsxs)(`div`,{className:XT.taskRow,children:[(0,k.jsx)(`button`,{className:XT.checkBtn,onClick:()=>d(e.id,e.listId)}),(0,k.jsxs)(`div`,{className:XT.taskInfo,children:[(0,k.jsx)(`div`,{className:XT.taskTitle,children:e.title}),e.dueDate&&(0,k.jsxs)(`div`,{className:XT.taskDue,children:[`Due: `,e.dueDate.split(`T`)[0]]})]}),e.importance&&(0,k.jsx)(`span`,{className:XT.taskImp,style:{color:t},children:e.importance})]},e.id)})})]})}var QT={root:`_root_1ag4s_1`,header:`_header_1ag4s_3`,title:`_title_1ag4s_4`,subtitle:`_subtitle_1ag4s_5`,controls:`_controls_1ag4s_7`,monitorRow:`_monitorRow_1ag4s_8`,label:`_label_1ag4s_9`,monitorBtn:`_monitorBtn_1ag4s_10`,monitorActive:`_monitorActive_1ag4s_11`,captureBtn:`_captureBtn_1ag4s_12`,analyzeSection:`_analyzeSection_1ag4s_15`,sectionTitle:`_sectionTitle_1ag4s_16`,presets:`_presets_1ag4s_17`,preset:`_preset_1ag4s_17`,presetActive:`_presetActive_1ag4s_20`,questionRow:`_questionRow_1ag4s_21`,questionInput:`_questionInput_1ag4s_22`,analyzeBtn:`_analyzeBtn_1ag4s_23`,error:`_error_1ag4s_26`,screenshotContainer:`_screenshotContainer_1ag4s_28`,screenshot:`_screenshot_1ag4s_28`,screenshotMeta:`_screenshotMeta_1ag4s_30`,analysis:`_analysis_1ag4s_32`,analysisTitle:`_analysisTitle_1ag4s_33`,analysisText:`_analysisText_1ag4s_34`,continueInChat:`_continueInChat_1ag4s_35`,history:`_history_1ag4s_37`,historyGrid:`_historyGrid_1ag4s_38`,historyItem:`_historyItem_1ag4s_39`,historyThumb:`_historyThumb_1ag4s_40`,historyMeta:`_historyMeta_1ag4s_41`,historyTs:`_historyTs_1ag4s_42`,historyQ:`_historyQ_1ag4s_43`,historyA:`_historyA_1ag4s_44`},$T=[`Describe exactly what you see on the screen`,`Identify any errors, warnings, or issues visible`,`What application is open and what is the user doing?`,`Summarize the content visible on screen and suggest next actions`,`Read and extract all visible text from the screen`,`Analyze the code visible on screen and identify bugs or improvements`,`What financial data or charts are visible? Summarize key numbers`,`Is there anything sensitive or that should be kept private?`];function eE(){let e=j(),t=T(e=>e.setView),n=T(e=>e.apiBase),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(1),[p,m]=(0,_.useState)([]),h=async()=>{i(!0),c(null);try{let e=await D(`/api/screen/capture`,{monitor:d});c(e),(e?.base64||e?.file)&&m(t=>[{ts:new Date().toLocaleTimeString(),question:`Screenshot`,analysis:``,src:e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:`${n}/api/screenshots/${e.file}`},...t.slice(0,9)])}catch(e){c({error:e.message})}i(!1)},g=async()=>{if(l.trim()){o(!0);try{let e=await D(`/api/screen/analyze`,{question:l.trim(),monitor:d});if(c(e),e?.analysis){let t=e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:e.file?`${n}/api/screenshots/${e.file}`:``;m(n=>[{ts:new Date().toLocaleTimeString(),question:l.trim(),analysis:e.analysis??``,src:t},...n.slice(0,9)])}}catch(e){c({error:e.message})}o(!1)}},v=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},y=s?.base64?`data:image/${s.format??`jpeg`};base64,${s.base64}`:s?.file?`${n}/api/screenshots/${s.file}`:null;return(0,k.jsxs)(`div`,{className:QT.root,children:[(0,k.jsx)(`div`,{className:QT.header,children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:QT.title,children:`🖥️ Screen Capture`}),(0,k.jsxs)(`div`,{className:QT.subtitle,children:[e(`screen.capture`),` and analyze your desktop screen with AI vision`]})]})}),(0,k.jsxs)(`div`,{className:QT.controls,children:[(0,k.jsxs)(`div`,{className:QT.monitorRow,children:[(0,k.jsx)(`label`,{className:QT.label,children:`Monitor`}),[1,2,3].map(e=>(0,k.jsxs)(`button`,{className:`${QT.monitorBtn} ${d===e?QT.monitorActive:``}`,onClick:()=>f(e),children:[`Monitor `,e]},e))]}),(0,k.jsx)(`button`,{className:QT.captureBtn,onClick:h,disabled:r||a,children:r?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`spinner`}),` Capturing…`]}):`📷 Capture Screen`})]}),(0,k.jsxs)(`div`,{className:QT.analyzeSection,children:[(0,k.jsx)(`div`,{className:QT.sectionTitle,children:`Capture + Analyze`}),(0,k.jsx)(`div`,{className:QT.presets,children:$T.map(e=>(0,k.jsxs)(`button`,{className:`${QT.preset} ${l===e?QT.presetActive:``}`,onClick:()=>u(e),children:[e.slice(0,50),e.length>50?`…`:``]},e))}),(0,k.jsxs)(`div`,{className:QT.questionRow,children:[(0,k.jsx)(`input`,{className:QT.questionInput,value:l,onChange:e=>u(e.target.value),placeholder:`Ask something about your screen…`,onKeyDown:e=>e.key===`Enter`&&g()}),(0,k.jsx)(`button`,{className:QT.analyzeBtn,onClick:g,disabled:!l.trim()||r||a,children:a?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`spinner`}),` Analyzing…`]}):`🔍 Analyze`})]})]}),s?.error&&(0,k.jsx)(`div`,{className:QT.error,children:s.error}),y&&(0,k.jsxs)(`div`,{className:QT.screenshotContainer,children:[(0,k.jsx)(`img`,{src:y,className:QT.screenshot,alt:`Screen capture`}),s?.width&&s?.height&&(0,k.jsxs)(`div`,{className:QT.screenshotMeta,children:[s.width,` × `,s.height,`px`]})]}),s?.analysis&&(0,k.jsxs)(`div`,{className:QT.analysis,children:[(0,k.jsx)(`div`,{className:QT.analysisTitle,children:`AI Analysis`}),(0,k.jsx)(`div`,{className:QT.analysisText,children:s.analysis}),(0,k.jsx)(`button`,{className:QT.continueInChat,onClick:()=>v(`I captured my screen. Here's what the AI saw:\n\n${s.analysis}\n\nCan you help me with this?`),children:`Continue in Chat →`})]}),p.length>0&&(0,k.jsxs)(`div`,{className:QT.history,children:[(0,k.jsx)(`div`,{className:QT.sectionTitle,children:`Recent Captures`}),(0,k.jsx)(`div`,{className:QT.historyGrid,children:p.map((e,t)=>(0,k.jsxs)(`div`,{className:QT.historyItem,children:[e.src&&(0,k.jsx)(`img`,{src:e.src,className:QT.historyThumb,alt:e.question}),(0,k.jsxs)(`div`,{className:QT.historyMeta,children:[(0,k.jsx)(`div`,{className:QT.historyTs,children:e.ts}),(0,k.jsx)(`div`,{className:QT.historyQ,children:e.question}),e.analysis&&(0,k.jsxs)(`div`,{className:QT.historyA,children:[e.analysis.slice(0,120),`…`]})]})]},t))})]})]})}var tE={root:`_root_v12qq_1`,header:`_header_v12qq_3`,title:`_title_v12qq_4`,subtitle:`_subtitle_v12qq_5`,section:`_section_v12qq_7`,sectionTitle:`_sectionTitle_v12qq_8`,quickBtns:`_quickBtns_v12qq_10`,quickBtn:`_quickBtn_v12qq_10`,searchRow:`_searchRow_v12qq_14`,searchInput:`_searchInput_v12qq_15`,searchBtn:`_searchBtn_v12qq_16`,modeRow:`_modeRow_v12qq_19`,modeBtn:`_modeBtn_v12qq_20`,modeActive:`_modeActive_v12qq_21`,routeInputs:`_routeInputs_v12qq_23`,inputWrapper:`_inputWrapper_v12qq_24`,inputIcon:`_inputIcon_v12qq_25`,routeInput:`_routeInput_v12qq_23`,swapBtn:`_swapBtn_v12qq_27`,dirBtns:`_dirBtns_v12qq_29`,dirBtn:`_dirBtn_v12qq_29`,openMapsBtn:`_openMapsBtn_v12qq_32`,error:`_error_v12qq_34`,resultCard:`_resultCard_v12qq_36`,routeSummary:`_routeSummary_v12qq_37`,routeDistance:`_routeDistance_v12qq_38`,routeDuration:`_routeDuration_v12qq_39`,routeMode:`_routeMode_v12qq_40`,steps:`_steps_v12qq_41`,step:`_step_v12qq_41`,stepNum:`_stepNum_v12qq_43`,stepText:`_stepText_v12qq_44`,mapLink:`_mapLink_v12qq_45`,askChatBtn:`_askChatBtn_v12qq_47`,savedRoute:`_savedRoute_v12qq_49`,savedFrom:`_savedFrom_v12qq_51`,savedArrow:`_savedArrow_v12qq_52`,savedTo:`_savedTo_v12qq_53`,savedTs:`_savedTs_v12qq_54`},nE=[`driving`,`walking`,`bicycling`,`transit`],rE={driving:`🚗`,walking:`🚶`,bicycling:`🚲`,transit:`🚌`},iE=[{label:`🏥 Nearest Hospital`,query:`nearest hospital`},{label:`⛽ Gas Station`,query:`gas station near me`},{label:`🛒 Supermarket`,query:`supermarket near me`},{label:`☕ Coffee Shop`,query:`coffee shop near me`},{label:`🏧 ATM`,query:`ATM near me`},{label:`🍕 Pizza`,query:`pizza restaurant near me`}];function aE(e,t,n){try{let r=JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`),i=[{from:e,to:t,label:n,ts:new Date().toISOString()},...r.filter(n=>!(n.from===e&&n.to===t))].slice(0,10);localStorage.setItem(`nha_maps_routes`,JSON.stringify(i))}catch{}}function oE(){try{return JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`)}catch{return[]}}function sE(){let e=j(),t=T(e=>e.setView),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(`driving`),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(oE),[m,h]=(0,_.useState)(``),g=async()=>{if(!(!n.trim()||!i.trim())){l(!0),d(null);try{let e=await E(`/api/maps/directions?from=${encodeURIComponent(n.trim())}&to=${encodeURIComponent(i.trim())}&mode=${o}`);e&&(d(e),e.error||(aE(n.trim(),i.trim()),p(oE())))}catch{d({url:`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`}),aE(n.trim(),i.trim()),p(oE())}l(!1)}},v=e=>{let t=`https://www.google.com/maps/search/${encodeURIComponent(e)}`;window.open(t,`_blank`)},y=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},b=e=>{r(e.from),a(e.to)},x=n.trim()&&i.trim()?`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`:null;return(0,k.jsxs)(`div`,{className:tE.root,children:[(0,k.jsx)(`div`,{className:tE.header,children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:tE.title,children:`🗺️ Maps & Directions`}),(0,k.jsx)(`div`,{className:tE.subtitle,children:e(`maps.directions`)})]})}),(0,k.jsxs)(`div`,{className:tE.section,children:[(0,k.jsx)(`div`,{className:tE.sectionTitle,children:e(`common.search`)}),(0,k.jsx)(`div`,{className:tE.quickBtns,children:iE.map(e=>(0,k.jsx)(`button`,{className:tE.quickBtn,onClick:()=>v(e.query),children:e.label},e.label))}),(0,k.jsxs)(`div`,{className:tE.searchRow,children:[(0,k.jsx)(`input`,{className:tE.searchInput,value:m,onChange:e=>h(e.target.value),placeholder:`Search for a place, address, or business…`,onKeyDown:e=>e.key===`Enter`&&v(m)}),(0,k.jsx)(`button`,{className:tE.searchBtn,onClick:()=>v(m),disabled:!m.trim(),children:`Search ↗`})]})]}),(0,k.jsxs)(`div`,{className:tE.section,children:[(0,k.jsx)(`div`,{className:tE.sectionTitle,children:`Directions`}),(0,k.jsx)(`div`,{className:tE.modeRow,children:nE.map(e=>(0,k.jsxs)(`button`,{className:`${tE.modeBtn} ${o===e?tE.modeActive:``}`,onClick:()=>s(e),title:e,children:[rE[e],` `,e.charAt(0).toUpperCase()+e.slice(1)]},e))}),(0,k.jsxs)(`div`,{className:tE.routeInputs,children:[(0,k.jsxs)(`div`,{className:tE.inputWrapper,children:[(0,k.jsx)(`span`,{className:tE.inputIcon,children:`A`}),(0,k.jsx)(`input`,{className:tE.routeInput,value:n,onChange:e=>r(e.target.value),placeholder:`From (address, city, or 'my location')`,onKeyDown:e=>e.key===`Enter`&&g()})]}),(0,k.jsx)(`button`,{className:tE.swapBtn,onClick:()=>{r(i),a(n)},title:`Swap`,children:`⇅`}),(0,k.jsxs)(`div`,{className:tE.inputWrapper,children:[(0,k.jsx)(`span`,{className:tE.inputIcon,children:`B`}),(0,k.jsx)(`input`,{className:tE.routeInput,value:i,onChange:e=>a(e.target.value),placeholder:`To (address, city, or landmark)`,onKeyDown:e=>e.key===`Enter`&&g()})]})]}),(0,k.jsxs)(`div`,{className:tE.dirBtns,children:[(0,k.jsx)(`button`,{className:tE.dirBtn,onClick:g,disabled:c||!n.trim()||!i.trim(),children:c?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`spinner`}),` Getting route…`]}):`🗺️ Get Directions`}),x&&(0,k.jsx)(`a`,{className:tE.openMapsBtn,href:x,target:`_blank`,rel:`noreferrer`,children:`Open in Google Maps ↗`})]})]}),u?.error&&(0,k.jsx)(`div`,{className:tE.error,children:u.error}),u&&!u.error&&(0,k.jsxs)(`div`,{className:tE.resultCard,children:[(u.distance||u.duration)&&(0,k.jsxs)(`div`,{className:tE.routeSummary,children:[u.distance&&(0,k.jsxs)(`span`,{className:tE.routeDistance,children:[`📏 `,u.distance]}),u.duration&&(0,k.jsxs)(`span`,{className:tE.routeDuration,children:[`⏱ `,u.duration]}),(0,k.jsxs)(`span`,{className:tE.routeMode,children:[rE[o],` `,o]})]}),u.steps&&u.steps.length>0&&(0,k.jsx)(`div`,{className:tE.steps,children:u.steps.map((e,t)=>(0,k.jsxs)(`div`,{className:tE.step,children:[(0,k.jsx)(`span`,{className:tE.stepNum,children:t+1}),(0,k.jsx)(`span`,{className:tE.stepText,children:e})]},t))}),u.url&&(0,k.jsx)(`a`,{className:tE.mapLink,href:u.url,target:`_blank`,rel:`noreferrer`,children:`View full route on Google Maps ↗`}),(0,k.jsx)(`button`,{className:tE.askChatBtn,onClick:()=>y(`Give me directions from "${n}" to "${i}" by ${o}. Include estimated time, distance, and any traffic alerts or alternative routes.`),children:`Ask AI for detailed route advice →`})]}),f.length>0&&(0,k.jsxs)(`div`,{className:tE.section,children:[(0,k.jsx)(`div`,{className:tE.sectionTitle,children:`Recent Routes`}),f.map((e,t)=>(0,k.jsxs)(`div`,{className:tE.savedRoute,onClick:()=>b(e),children:[(0,k.jsx)(`span`,{className:tE.savedFrom,children:e.from}),(0,k.jsx)(`span`,{className:tE.savedArrow,children:`→`}),(0,k.jsx)(`span`,{className:tE.savedTo,children:e.to}),(0,k.jsx)(`span`,{className:tE.savedTs,children:new Date(e.ts).toLocaleDateString()})]},t))]})]})}var cE={root:`_root_esnjz_1`,header:`_header_esnjz_3`,title:`_title_esnjz_4`,subtitle:`_subtitle_esnjz_5`,addBtn:`_addBtn_esnjz_6`,quickAdd:`_quickAdd_esnjz_8`,quickLabel:`_quickLabel_esnjz_9`,quickPresets:`_quickPresets_esnjz_10`,quickPreset:`_quickPreset_esnjz_10`,section:`_section_esnjz_14`,sectionTitle:`_sectionTitle_esnjz_15`,loading:`_loading_esnjz_17`,empty:`_empty_esnjz_18`,card:`_card_esnjz_20`,cardPast:`_cardPast_esnjz_21`,cardLeft:`_cardLeft_esnjz_22`,reminderMsg:`_reminderMsg_esnjz_23`,reminderTime:`_reminderTime_esnjz_24`,timeBadge:`_timeBadge_esnjz_25`,countdown:`_countdown_esnjz_26`,timePast:`_timePast_esnjz_27`,sentBadge:`_sentBadge_esnjz_28`,cancelledBadge:`_cancelledBadge_esnjz_29`,cancelBtn:`_cancelBtn_esnjz_30`,repeatBtn:`_repeatBtn_esnjz_31`,aiButtons:`_aiButtons_esnjz_33`,aiBtn:`_aiBtn_esnjz_34`,overlay:`_overlay_esnjz_38`,modal:`_modal_esnjz_39`,modalTitle:`_modalTitle_esnjz_40`,label:`_label_esnjz_41`,input:`_input_esnjz_42`,msgTemplates:`_msgTemplates_esnjz_44`,msgTemplate:`_msgTemplate_esnjz_44`,msgTemplateActive:`_msgTemplateActive_esnjz_47`,typeTabs:`_typeTabs_esnjz_49`,typeTab:`_typeTab_esnjz_49`,typeTabActive:`_typeTabActive_esnjz_51`,relRow:`_relRow_esnjz_53`,inLabel:`_inLabel_esnjz_54`,relInput:`_relInput_esnjz_55`,relSelect:`_relSelect_esnjz_56`,formErr:`_formErr_esnjz_58`,formOk:`_formOk_esnjz_59`,modalBtns:`_modalBtns_esnjz_60`,cancelModalBtn:`_cancelModalBtn_esnjz_61`,saveBtn:`_saveBtn_esnjz_62`},lE=[{label:`In 5 min`,value:`in 5 minutes`},{label:`In 15 min`,value:`in 15 minutes`},{label:`In 30 min`,value:`in 30 minutes`},{label:`In 1 hour`,value:`in 1 hour`},{label:`In 2 hours`,value:`in 2 hours`},{label:`In 3 hours`,value:`in 3 hours`},{label:`Tomorrow 9am`,value:`tomorrow at 09:00`},{label:`Tomorrow noon`,value:`tomorrow at 12:00`}],uE=[`Take a break and stretch`,`Check emails`,`Join the standup call`,`Review and respond to messages`,`Take your medication`,`Drink water`,`Focus review — what did you accomplish in the last hour?`,`Follow up on pending tasks`,`End of work day — log your achievements`,`Weekly review — prepare for next week`];function dE(e){if(e<1)return`now`;if(e<60)return`in ${e}m`;let t=Math.floor(e/60),n=e%60;return n>0?`in ${t}h ${n}m`:`in ${t}h`}function fE(){let e=j(),t=T(e=>e.setView),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)({message:``,atTime:``,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`}),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),g=()=>{a(!0),E(`/api/reminders`).then(e=>{r(e?.reminders??[]),a(!1)}).catch(()=>{r([]),a(!1)})};(0,_.useEffect)(()=>{g()},[]);let v=async()=>{if(!o.message.trim()){d(`Message is required`);return}let e=``;if(o.atTimeType===`relative`)e=`in ${o.relValue} ${o.relUnit}`;else{if(!o.atTime){d(`Time is required`);return}e=o.atTime}l(!0),d(``);try{await D(`/api/reminders`,{message:o.message.trim(),atTime:e}),p(`Reminder set!`),setTimeout(()=>{p(``),h(!1)},1500),g()}catch(e){d(e.message??`Failed to set reminder`)}l(!1)},y=e=>{confirm(`Cancel this reminder?`)&&D(`/api/reminders/cancel`,{id:e}).then(g)},b=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},x=n.filter(e=>e.status===`pending`),S=n.filter(e=>e.status!==`pending`);return(0,k.jsxs)(`div`,{className:cE.root,children:[(0,k.jsxs)(`div`,{className:cE.header,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:cE.title,children:`🔔 Reminders`}),(0,k.jsx)(`div`,{className:cE.subtitle,children:`Set one-time notifications via the NHA daemon`})]}),(0,k.jsx)(`button`,{className:cE.addBtn,onClick:()=>{h(!0),d(``),p(``)},children:`+ New Reminder`})]}),(0,k.jsxs)(`div`,{className:cE.quickAdd,children:[(0,k.jsx)(`div`,{className:cE.quickLabel,children:`Quick reminder for now:`}),(0,k.jsx)(`div`,{className:cE.quickPresets,children:lE.map(e=>(0,k.jsx)(`button`,{className:cE.quickPreset,onClick:()=>{s(e=>({...e,atTimeType:`relative`,atTime:``,message:e.message||`Reminder`})),h(!0),d(``),p(``)},children:e.label},e.value))})]}),i&&(0,k.jsxs)(`div`,{className:cE.loading,children:[(0,k.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!i&&(0,k.jsxs)(`div`,{className:cE.section,children:[(0,k.jsxs)(`div`,{className:cE.sectionTitle,children:[`Pending (`,x.length,`)`]}),x.length===0&&(0,k.jsx)(`div`,{className:cE.empty,children:`No pending reminders. Set one to get notified.`}),x.map(e=>(0,k.jsxs)(`div`,{className:cE.card,children:[(0,k.jsxs)(`div`,{className:cE.cardLeft,children:[(0,k.jsx)(`div`,{className:cE.reminderMsg,children:e.message}),(0,k.jsxs)(`div`,{className:cE.reminderTime,children:[(0,k.jsx)(`span`,{className:cE.timeBadge,children:new Date(e.atTime).toLocaleString()}),e.minutesUntil!==void 0&&(0,k.jsx)(`span`,{className:cE.countdown,children:dE(e.minutesUntil)})]})]}),(0,k.jsx)(`button`,{className:cE.cancelBtn,onClick:()=>y(e.id),children:`Cancel`})]},e.id))]}),S.length>0&&(0,k.jsxs)(`div`,{className:cE.section,children:[(0,k.jsxs)(`div`,{className:cE.sectionTitle,children:[`Recent (`,S.length,`)`]}),S.slice(0,10).map(e=>(0,k.jsxs)(`div`,{className:`${cE.card} ${cE.cardPast}`,children:[(0,k.jsxs)(`div`,{className:cE.cardLeft,children:[(0,k.jsx)(`div`,{className:cE.reminderMsg,children:e.message}),(0,k.jsxs)(`div`,{className:cE.reminderTime,children:[(0,k.jsx)(`span`,{className:e.status===`sent`?cE.sentBadge:cE.cancelledBadge,children:e.status}),(0,k.jsx)(`span`,{className:cE.timePast,children:new Date(e.atTime).toLocaleString()})]})]}),(0,k.jsx)(`button`,{className:cE.repeatBtn,onClick:()=>{s(t=>({...t,message:e.message,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`})),h(!0)},children:`Repeat`})]},e.id))]}),(0,k.jsxs)(`div`,{className:cE.section,children:[(0,k.jsx)(`div`,{className:cE.sectionTitle,children:`AI-Powered Reminders`}),(0,k.jsxs)(`div`,{className:cE.aiButtons,children:[(0,k.jsx)(`button`,{className:cE.aiBtn,onClick:()=>b(`Set a reminder to check my emails in 30 minutes`),children:`📧 Email check in 30min`}),(0,k.jsx)(`button`,{className:cE.aiBtn,onClick:()=>b(`Set a reminder every hour to take a break and drink water`),children:`💧 Hourly water break`}),(0,k.jsx)(`button`,{className:cE.aiBtn,onClick:()=>b(`Set a reminder at the end of the work day (6pm) to do an evening review of my tasks and prepare tomorrow's plan`),children:`🌆 Evening review 6pm`}),(0,k.jsx)(`button`,{className:cE.aiBtn,onClick:()=>b(`Look at my calendar and set reminders for all events today`),children:`📅 Remind me of today's events`})]})]}),m&&(0,k.jsx)(`div`,{className:cE.overlay,onClick:e=>{e.target===e.currentTarget&&h(!1)},children:(0,k.jsxs)(`div`,{className:cE.modal,children:[(0,k.jsx)(`div`,{className:cE.modalTitle,children:e(`reminders.new`)}),(0,k.jsx)(`div`,{className:cE.label,children:`Message *`}),(0,k.jsx)(`div`,{className:cE.msgTemplates,children:uE.map(e=>(0,k.jsx)(`button`,{className:`${cE.msgTemplate} ${o.message===e?cE.msgTemplateActive:``}`,onClick:()=>s(t=>({...t,message:e})),children:e},e))}),(0,k.jsx)(`input`,{className:cE.input,value:o.message,onChange:e=>s(t=>({...t,message:e.target.value})),placeholder:`Reminder message (e.g. Call John)`}),(0,k.jsx)(`div`,{className:cE.label,children:`When *`}),(0,k.jsxs)(`div`,{className:cE.typeTabs,children:[(0,k.jsx)(`button`,{className:`${cE.typeTab} ${o.atTimeType===`relative`?cE.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`relative`})),children:`Relative`}),(0,k.jsx)(`button`,{className:`${cE.typeTab} ${o.atTimeType===`absolute`?cE.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`absolute`})),children:`Exact time`})]}),o.atTimeType===`relative`?(0,k.jsxs)(`div`,{className:cE.relRow,children:[(0,k.jsx)(`span`,{className:cE.inLabel,children:`in`}),(0,k.jsx)(`input`,{className:cE.relInput,type:`number`,min:`1`,value:o.relValue,onChange:e=>s(t=>({...t,relValue:e.target.value}))}),(0,k.jsxs)(`select`,{className:cE.relSelect,value:o.relUnit,onChange:e=>s(t=>({...t,relUnit:e.target.value})),children:[(0,k.jsx)(`option`,{value:`minutes`,children:`minutes`}),(0,k.jsx)(`option`,{value:`hours`,children:`hours`}),(0,k.jsx)(`option`,{value:`days`,children:`days`})]})]}):(0,k.jsx)(`input`,{className:cE.input,type:`datetime-local`,value:o.atTime,onChange:e=>s(t=>({...t,atTime:e.target.value}))}),u&&(0,k.jsx)(`div`,{className:cE.formErr,children:u}),f&&(0,k.jsx)(`div`,{className:cE.formOk,children:f}),(0,k.jsxs)(`div`,{className:cE.modalBtns,children:[(0,k.jsx)(`button`,{className:cE.cancelModalBtn,onClick:()=>h(!1),children:`Cancel`}),(0,k.jsx)(`button`,{className:cE.saveBtn,onClick:v,disabled:c,children:c?`Setting…`:`🔔 Set Reminder`})]})]})})]})}var pE={root:`_root_atgeb_1`,icon:`_icon_atgeb_10`,title:`_title_atgeb_11`,sub:`_sub_atgeb_12`},mE={dashboard:`⚡`,email:`📧`,calendar:`📅`,tasks:`✅`,contacts:`👤`,notes:`📝`,drive:`💾`,onedrive:`☁️`,mstodo:`📋`,github:`🐙`,slack:`💬`,notion:`📋`,collab:`🏛️`,maps:`🗺️`,cron:`⏰`,screen:`🖥️`,reminders:`🔔`,birthdays:`🎂`,settings:`⚙️`,agents:`🤖`,plan:`🗓️`,webcraft:`🔨`,connectors:`🔗`};function hE({view:e}){let t=j();return(0,k.jsxs)(`div`,{className:pE.root,children:[(0,k.jsx)(`div`,{className:pE.icon,children:mE[e]??`🔧`}),(0,k.jsx)(`div`,{className:pE.title,children:e.charAt(0).toUpperCase()+e.slice(1)}),(0,k.jsx)(`div`,{className:pE.sub,children:t(`common.comingSoon`)})]})}function gE({activeView:e}){switch(e){case`dashboard`:return(0,k.jsx)(_t,{});case`chat`:return(0,k.jsx)(Ee,{});case`email`:return(0,k.jsx)(Gt,{});case`calendar`:return(0,k.jsx)(Yt,{});case`tasks`:return(0,k.jsx)(yt,{});case`notes`:return(0,k.jsx)(At,{});case`contacts`:return(0,k.jsx)(Nt,{});case`birthdays`:return(0,k.jsx)(wt,{});case`cron`:return(0,k.jsx)(Ot,{});case`connectors`:return(0,k.jsx)(Bt,{});case`agents`:return(0,k.jsx)($t,{});case`drive`:return(0,k.jsx)(nn,{});case`onedrive`:return(0,k.jsx)(YT,{});case`mstodo`:return(0,k.jsx)(ZT,{});case`github`:return(0,k.jsx)(an,{});case`slack`:return(0,k.jsx)(sn,{});case`notion`:return(0,k.jsx)(cn,{});case`collab`:return(0,k.jsx)(fn,{});case`plan`:return(0,k.jsx)(qT,{});case`screen`:return(0,k.jsx)(eE,{});case`maps`:return(0,k.jsx)(sE,{});case`reminders`:return(0,k.jsx)(fE,{});case`settings`:return(0,k.jsx)(St,{});default:return(0,k.jsx)(hE,{view:e})}}function _E(){let{activeView:e}=T();return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{style:{display:e===`studio`?`contents`:`none`},children:(0,k.jsx)(ft,{})}),(0,k.jsx)(`div`,{style:{display:e===`webcraft`?`contents`:`none`},children:(0,k.jsx)(UT,{})}),e!==`studio`&&e!==`webcraft`&&(0,k.jsx)(gE,{activeView:e})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,k.jsx)(_.StrictMode,{children:(0,k.jsx)(me,{children:(0,k.jsx)(_E,{})})}));
|
|
790
|
+
`),i=[],a=0,o=0;for(;(a<n.length||o<r.length)&&(a>=n.length?i.push({type:`add`,text:r[o++]??``}):o>=r.length?i.push({type:`rem`,text:n[a++]??``}):n[a]===r[o]?(i.push({type:`same`,text:n[a++]??``}),o++):(i.push({type:`rem`,text:n[a++]??``}),i.push({type:`add`,text:r[o++]??``})),!(i.length>2e3)););return(0,k.jsx)(`div`,{style:{fontFamily:`var(--mono)`,fontSize:10},children:i.map((e,t)=>(0,k.jsxs)(`div`,{style:{padding:`1px 8px`,background:e.type===`add`?`#0a3a1a`:e.type===`rem`?`#3a0a0a`:`transparent`,color:e.type===`add`?`#4ade80`:e.type===`rem`?`#f87171`:`var(--dim)`,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:[e.type===`add`?`+`:e.type===`rem`?`-`:` `,e.text]},t))})}function KT({modal:e,skills:t,projectName:n,onClose:r,onSave:i}){let[a,o]=(0,_.useState)(e.name),[s,c]=(0,_.useState)(e.content),[l,u]=(0,_.useState)(e.type),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(!1),h=l===`skill`?6e3:4e3,g=s.length>h;async function v(){if(!d.trim())return;m(!0);let e={skill:`Sei un esperto di sviluppo web fullstack. Genera un file Markdown "skill" per il WebCraft Agent. Deve contenere istruzioni, pattern di codice, best practice e snippet pronti all uso come contesto persistente. Scrivi SOLO il contenuto Markdown, niente altro.`,memory:`Sei un assistente tecnico. Genera un file Markdown "memory" per il WebCraft Agent. Deve riassumere decisioni architetturali, preferenze dello sviluppatore e contesto generale del progetto. Scrivi SOLO il Markdown.`,provider:`Sei un esperto di prompt engineering. Genera un file Markdown con istruzioni specifiche per calibrare il comportamento del modello AI. Scrivi SOLO il Markdown.`},t=await D(`/api/studio/webcraft`,{system:e[l]??e.skill,user:`Progetto: ${n}\n\n${d}`,max_tokens:2048});t?.text&&(c(t.text),a||o(l===`memory`?`memory.md`:l===`provider`?`liara.md`:d.toLowerCase().replace(/[^a-z0-9]+/g,`-`).slice(0,30)+`.md`)),m(!1)}function y(){if(!a.trim()){alert(`Inserisci un nome per il file.`);return}let n=a.endsWith(`.md`)?a:a+`.md`;if((l===`memory`||l===`provider`)&&e.mode===`new`&&t.findIndex(e=>e.type===l)>=0){alert(`Esiste già un file di tipo "${l}". Modificalo direttamente.`);return}i(n,s,l)}return(0,k.jsx)(`div`,{className:$.modalOverlay,onClick:e=>{e.target===e.currentTarget&&r()},children:(0,k.jsxs)(`div`,{className:$.modal,children:[(0,k.jsxs)(`div`,{className:$.modalHeader,children:[(0,k.jsxs)(`span`,{className:$.modalTitle,children:[UT(l),` `,e.mode===`new`?`Nuovo file di contesto`:`Modifica ${e.name}`]}),(0,k.jsx)(`button`,{className:$.modalClose,onClick:r,children:`×`})]}),(0,k.jsx)(`div`,{className:$.modalBody,children:e.mode===`view`?(0,k.jsx)(`pre`,{className:$.logView,children:s}):(0,k.jsxs)(k.Fragment,{children:[e.mode===`new`&&(0,k.jsxs)(`div`,{className:$.modalRow,children:[(0,k.jsxs)(`div`,{className:$.modalField,children:[(0,k.jsx)(`div`,{className:$.modalLabel,children:`TIPO`}),(0,k.jsx)(`select`,{value:l,onChange:e=>{let t=e.target.value;u(t),t===`memory`?o(`memory.md`):t===`provider`&&o(`liara.md`)},className:$.modalSelect,children:[`skill`,`memory`,`provider`].map(e=>{let n=(e===`memory`||e===`provider`)&&t.some(t=>t.type===e);return(0,k.jsxs)(`option`,{value:e,disabled:n,children:[e,n?` (esiste già)`:``]},e)})})]}),(0,k.jsxs)(`div`,{className:$.modalField,style:{flex:2},children:[(0,k.jsx)(`div`,{className:$.modalLabel,children:`NOME FILE`}),(0,k.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),placeholder:l===`memory`?`memory.md`:l===`provider`?`liara.md`:`nome-skill.md`,className:$.modalInput})]})]}),(0,k.jsxs)(`div`,{className:$.modalHint,children:[`💡 `,l===`skill`?`Istruzioni tecniche, snippet, pattern di codice specifici. Max ~6000 caratteri.`:l===`memory`?`Note persistenti sul progetto: decisioni architetturali, preferenze. Solo UN file. Max ~4000 caratteri.`:`Istruzioni specifiche per il modello AI (tono, formato, vincoli). Solo UN file. Max ~4000 caratteri.`]}),(0,k.jsxs)(`div`,{className:$.modalAiBox,children:[(0,k.jsx)(`div`,{className:$.modalLabel,children:`🤖 GENERA CON AI`}),(0,k.jsxs)(`div`,{className:$.modalAiRow,children:[(0,k.jsx)(`textarea`,{value:d,onChange:e=>f(e.target.value),rows:2,placeholder:`Descrivi cosa deve contenere questo file...`,className:$.modalAiDesc}),(0,k.jsx)(`button`,{onClick:v,disabled:p,className:$.modalAiBtn,children:p?`⏳ ...`:`▶ Genera`})]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:$.modalLabelRow,children:[(0,k.jsx)(`span`,{children:`CONTENUTO (markdown)`}),(0,k.jsxs)(`span`,{style:{color:g?`#e05050`:`var(--dim)`},children:[s.length,` car.`,g?` ⚠ Troppo lungo`:``]})]}),(0,k.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),rows:14,placeholder:`# Titolo
|
|
791
|
+
Scrivi le istruzioni in Markdown...`,className:$.modalContentArea,style:{borderColor:g?`#e05050`:`var(--border2)`}})]})]})}),(0,k.jsxs)(`div`,{className:$.modalFooter,children:[(0,k.jsx)(`button`,{onClick:r,className:$.modalCancelBtn,children:`Annulla`}),e.mode!==`view`&&(0,k.jsx)(`button`,{onClick:y,className:$.modalSaveBtn,children:`✓ Salva`})]})]})})}var qT={root:`_root_x9yvu_1`,loading:`_loading_x9yvu_7`,empty:`_empty_x9yvu_18`,emptyIcon:`_emptyIcon_x9yvu_29`,emptyTitle:`_emptyTitle_x9yvu_30`,emptySub:`_emptySub_x9yvu_31`,generateBtn:`_generateBtn_x9yvu_33`,summary:`_summary_x9yvu_46`,sectionTitle:`_sectionTitle_x9yvu_57`,alertTitle:`_alertTitle_x9yvu_68`,actionCard:`_actionCard_x9yvu_70`,actionTime:`_actionTime_x9yvu_81`,actionText:`_actionText_x9yvu_89`,schedCard:`_schedCard_x9yvu_95`,schedTime:`_schedTime_x9yvu_106`,schedTitle:`_schedTitle_x9yvu_114`,alertCard:`_alertCard_x9yvu_119`,alertSev:`_alertSev_x9yvu_129`,alertAction:`_alertAction_x9yvu_135`,insight:`_insight_x9yvu_141`,regenRow:`_regenRow_x9yvu_148`,regenBtn:`_regenBtn_x9yvu_153`};function JT(){let e=j(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1),l=()=>{i(!0),c(!1),E(`/api/plan`).then(e=>{e?.plan?(n(e.plan),c(!1)):(n(null),c(!0)),i(!1)}).catch(()=>{i(!1),c(!0)})},u=async()=>{o(!0),i(!0),n(null);try{await D(`/api/plan/refresh`,{}),l()}catch{i(!1)}finally{o(!1)}};if((0,_.useEffect)(()=>{l()},[]),r)return(0,k.jsxs)(`div`,{className:qT.loading,children:[(0,k.jsx)(`div`,{className:`spinner`}),(0,k.jsx)(`div`,{children:a?`Generating plan with 5 agents...`:`Loading plan...`})]});if(s||!t)return(0,k.jsxs)(`div`,{className:qT.empty,children:[(0,k.jsx)(`div`,{className:qT.emptyIcon,children:`🗓️`}),(0,k.jsxs)(`div`,{className:qT.emptyTitle,children:[e(`plan.noplan`),` generated yet`]}),(0,k.jsx)(`div`,{className:qT.emptySub,children:`Generate a daily plan using your calendar, tasks, and emails.`}),(0,k.jsx)(`button`,{className:qT.generateBtn,onClick:u,children:e(`plan.generate`)})]});let d=e=>typeof e==`string`?e:e.description??e.message??e.action_required??`Alert`,f=e=>typeof e==`object`&&e.severity?` [${e.severity.toUpperCase()}]`:``,p=e=>typeof e==`object`&&e.action_required&&e.action_required!==d(e)?e.action_required:``,m=e=>typeof e==`string`?e:e.message??e.insight??``;return(0,k.jsxs)(`div`,{className:qT.root,children:[t.executive_summary&&(0,k.jsx)(`div`,{className:qT.summary,children:t.executive_summary}),t.priority_actions&&t.priority_actions.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:qT.sectionTitle,children:`Priority Actions`}),t.priority_actions.map((e,t)=>(0,k.jsxs)(`div`,{className:qT.actionCard,children:[e.time&&(0,k.jsx)(`span`,{className:qT.actionTime,children:e.time}),(0,k.jsx)(`span`,{className:qT.actionText,children:e.action})]},t))]}),t.schedule&&t.schedule.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:qT.sectionTitle,children:`Schedule`}),t.schedule.map((e,t)=>(0,k.jsxs)(`div`,{className:qT.schedCard,children:[(0,k.jsxs)(`span`,{className:qT.schedTime,children:[e.time_start,`–`,e.time_end]}),(0,k.jsx)(`span`,{className:qT.schedTitle,children:e.title})]},t))]}),t.security_alerts&&t.security_alerts.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`${qT.sectionTitle} ${qT.alertTitle}`,children:`Security Alerts`}),t.security_alerts.map((e,t)=>(0,k.jsxs)(`div`,{className:qT.alertCard,children:[(0,k.jsxs)(`span`,{className:qT.alertSev,children:[`!`,f(e)]}),(0,k.jsx)(`span`,{children:d(e)}),p(e)&&(0,k.jsxs)(`div`,{className:qT.alertAction,children:[`Action: `,p(e)]})]},t))]}),t.insights&&t.insights.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:qT.sectionTitle,children:`Insights`}),t.insights.map((e,t)=>(0,k.jsxs)(`div`,{className:qT.insight,children:[`→ `,m(e)]},t))]}),(0,k.jsx)(`div`,{className:qT.regenRow,children:(0,k.jsx)(`button`,{className:qT.regenBtn,onClick:u,disabled:a,children:a?`Regenerating…`:`↺ Regenerate`})})]})}function YT(e){return e===`folder`?`📁`:e===`image`?`🖼`:e===`pdf`?`📕`:e===`video`?`🎬`:e===`audio`?`🎵`:e===`sheet`?`📊`:e===`slides`?`📽`:`📄`}function XT(){let e=j(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=(e=``)=>{i(!0),E(e?`/api/onedrive?q=${encodeURIComponent(e)}`:`/api/onedrive`).then(e=>{n(e??{files:[]}),i(!1)}).catch(()=>{o(`Could not load OneDrive. Run nha microsoft auth in the terminal to connect.`),i(!1)})};if((0,_.useEffect)(()=>{l()},[]),a)return(0,k.jsx)(`div`,{className:G.error,children:a});let u=t?.files??[],d=t?.quota;return(0,k.jsxs)(`div`,{className:G.root,children:[d&&(0,k.jsxs)(`div`,{className:G.quotaBar,children:[(0,k.jsxs)(`div`,{className:G.quotaText,children:[(0,k.jsxs)(`span`,{className:G.quotaUsed,children:[d.usage,` of `,d.limit,` used`]}),(0,k.jsxs)(`span`,{className:G.quotaPct,children:[d.percentUsed,`%`]})]}),(0,k.jsx)(`div`,{className:G.quotaTrack,children:(0,k.jsx)(`div`,{className:G.quotaFill,style:{width:`${Math.min(d.percentUsed,100)}%`,background:d.percentUsed>90?`var(--red)`:d.percentUsed>70?`var(--amber)`:`var(--cyan)`}})})]}),(0,k.jsxs)(`div`,{className:G.searchRow,children:[(0,k.jsx)(`input`,{className:G.searchInput,value:s,onChange:e=>c(e.target.value),placeholder:`Search OneDrive files…`,onKeyDown:e=>e.key===`Enter`&&l(s)}),(0,k.jsx)(`button`,{className:G.searchBtn,onClick:()=>l(s),children:`Search`})]}),r&&(0,k.jsxs)(`div`,{className:G.loading,children:[(0,k.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!r&&u.length===0&&(0,k.jsx)(`div`,{className:G.empty,children:e(`drive.noFiles`)}),(0,k.jsx)(`div`,{className:G.fileList,children:u.map(e=>(0,k.jsxs)(`div`,{className:G.fileRow,children:[(0,k.jsx)(`span`,{className:G.fileIcon,children:YT(e.type)}),(0,k.jsxs)(`div`,{className:G.fileInfo,children:[(0,k.jsx)(`div`,{className:G.fileName,children:e.name}),(0,k.jsxs)(`div`,{className:G.fileMeta,children:[e.modifiedTime?new Date(e.modifiedTime).toLocaleDateString():``,e.size?` · ${e.size}`:``]})]}),(0,k.jsx)(`div`,{className:G.fileBtns,children:e.webViewLink&&(0,k.jsx)(`a`,{className:G.openBtn,href:e.webViewLink,target:`_blank`,rel:`noreferrer`,children:`Open`})})]},e.id))})]})}var ZT={root:`_root_1vbmp_1`,loading:`_loading_1vbmp_2`,error:`_error_1vbmp_3`,empty:`_empty_1vbmp_4`,addRow:`_addRow_1vbmp_6`,addInput:`_addInput_1vbmp_7`,addBtn:`_addBtn_1vbmp_8`,list:`_list_1vbmp_10`,taskRow:`_taskRow_1vbmp_11`,checkBtn:`_checkBtn_1vbmp_12`,taskInfo:`_taskInfo_1vbmp_14`,taskTitle:`_taskTitle_1vbmp_15`,taskDue:`_taskDue_1vbmp_16`,taskImp:`_taskImp_1vbmp_17`};function QT(){let e=j(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=()=>{E(`/api/mstodo`).then(e=>{n(e?.tasks??[]),i(!1)}).catch(()=>{o(`Microsoft To Do requires Microsoft authentication. Run nha microsoft auth in the terminal.`),i(!1)})};(0,_.useEffect)(()=>{l()},[]);let u=()=>{let e=s.trim();e&&(c(``),D(`/api/mstodo`,{title:e}).then(e=>{e?.task&&l()}))},d=(e,t)=>{D(`/api/mstodo/${e}/complete`,{listId:t}).then(()=>l())};return r?(0,k.jsxs)(`div`,{className:ZT.loading,children:[(0,k.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):a?(0,k.jsx)(`div`,{className:ZT.error,children:a}):(0,k.jsxs)(`div`,{className:ZT.root,children:[(0,k.jsxs)(`div`,{className:ZT.addRow,children:[(0,k.jsx)(`input`,{className:ZT.addInput,value:s,onChange:e=>c(e.target.value),placeholder:`Add a new task…`,onKeyDown:e=>e.key===`Enter`&&u()}),(0,k.jsx)(`button`,{className:ZT.addBtn,onClick:u,children:`+ Add`})]}),t.length===0&&(0,k.jsx)(`div`,{className:ZT.empty,children:`No active tasks`}),(0,k.jsx)(`div`,{className:ZT.list,children:t.map(e=>{let t=e.importance===`high`?`var(--red)`:e.importance===`low`?`var(--dim)`:`var(--amber)`;return(0,k.jsxs)(`div`,{className:ZT.taskRow,children:[(0,k.jsx)(`button`,{className:ZT.checkBtn,onClick:()=>d(e.id,e.listId)}),(0,k.jsxs)(`div`,{className:ZT.taskInfo,children:[(0,k.jsx)(`div`,{className:ZT.taskTitle,children:e.title}),e.dueDate&&(0,k.jsxs)(`div`,{className:ZT.taskDue,children:[`Due: `,e.dueDate.split(`T`)[0]]})]}),e.importance&&(0,k.jsx)(`span`,{className:ZT.taskImp,style:{color:t},children:e.importance})]},e.id)})})]})}var $T={root:`_root_1ag4s_1`,header:`_header_1ag4s_3`,title:`_title_1ag4s_4`,subtitle:`_subtitle_1ag4s_5`,controls:`_controls_1ag4s_7`,monitorRow:`_monitorRow_1ag4s_8`,label:`_label_1ag4s_9`,monitorBtn:`_monitorBtn_1ag4s_10`,monitorActive:`_monitorActive_1ag4s_11`,captureBtn:`_captureBtn_1ag4s_12`,analyzeSection:`_analyzeSection_1ag4s_15`,sectionTitle:`_sectionTitle_1ag4s_16`,presets:`_presets_1ag4s_17`,preset:`_preset_1ag4s_17`,presetActive:`_presetActive_1ag4s_20`,questionRow:`_questionRow_1ag4s_21`,questionInput:`_questionInput_1ag4s_22`,analyzeBtn:`_analyzeBtn_1ag4s_23`,error:`_error_1ag4s_26`,screenshotContainer:`_screenshotContainer_1ag4s_28`,screenshot:`_screenshot_1ag4s_28`,screenshotMeta:`_screenshotMeta_1ag4s_30`,analysis:`_analysis_1ag4s_32`,analysisTitle:`_analysisTitle_1ag4s_33`,analysisText:`_analysisText_1ag4s_34`,continueInChat:`_continueInChat_1ag4s_35`,history:`_history_1ag4s_37`,historyGrid:`_historyGrid_1ag4s_38`,historyItem:`_historyItem_1ag4s_39`,historyThumb:`_historyThumb_1ag4s_40`,historyMeta:`_historyMeta_1ag4s_41`,historyTs:`_historyTs_1ag4s_42`,historyQ:`_historyQ_1ag4s_43`,historyA:`_historyA_1ag4s_44`},eE=[`Describe exactly what you see on the screen`,`Identify any errors, warnings, or issues visible`,`What application is open and what is the user doing?`,`Summarize the content visible on screen and suggest next actions`,`Read and extract all visible text from the screen`,`Analyze the code visible on screen and identify bugs or improvements`,`What financial data or charts are visible? Summarize key numbers`,`Is there anything sensitive or that should be kept private?`];function tE(){let e=j(),t=T(e=>e.setView),n=T(e=>e.apiBase),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(1),[p,m]=(0,_.useState)([]),h=async()=>{i(!0),c(null);try{let e=await D(`/api/screen/capture`,{monitor:d});c(e),(e?.base64||e?.file)&&m(t=>[{ts:new Date().toLocaleTimeString(),question:`Screenshot`,analysis:``,src:e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:`${n}/api/screenshots/${e.file}`},...t.slice(0,9)])}catch(e){c({error:e.message})}i(!1)},g=async()=>{if(l.trim()){o(!0);try{let e=await D(`/api/screen/analyze`,{question:l.trim(),monitor:d});if(c(e),e?.analysis){let t=e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:e.file?`${n}/api/screenshots/${e.file}`:``;m(n=>[{ts:new Date().toLocaleTimeString(),question:l.trim(),analysis:e.analysis??``,src:t},...n.slice(0,9)])}}catch(e){c({error:e.message})}o(!1)}},v=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},y=s?.base64?`data:image/${s.format??`jpeg`};base64,${s.base64}`:s?.file?`${n}/api/screenshots/${s.file}`:null;return(0,k.jsxs)(`div`,{className:$T.root,children:[(0,k.jsx)(`div`,{className:$T.header,children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:$T.title,children:`🖥️ Screen Capture`}),(0,k.jsxs)(`div`,{className:$T.subtitle,children:[e(`screen.capture`),` and analyze your desktop screen with AI vision`]})]})}),(0,k.jsxs)(`div`,{className:$T.controls,children:[(0,k.jsxs)(`div`,{className:$T.monitorRow,children:[(0,k.jsx)(`label`,{className:$T.label,children:`Monitor`}),[1,2,3].map(e=>(0,k.jsxs)(`button`,{className:`${$T.monitorBtn} ${d===e?$T.monitorActive:``}`,onClick:()=>f(e),children:[`Monitor `,e]},e))]}),(0,k.jsx)(`button`,{className:$T.captureBtn,onClick:h,disabled:r||a,children:r?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`spinner`}),` Capturing…`]}):`📷 Capture Screen`})]}),(0,k.jsxs)(`div`,{className:$T.analyzeSection,children:[(0,k.jsx)(`div`,{className:$T.sectionTitle,children:`Capture + Analyze`}),(0,k.jsx)(`div`,{className:$T.presets,children:eE.map(e=>(0,k.jsxs)(`button`,{className:`${$T.preset} ${l===e?$T.presetActive:``}`,onClick:()=>u(e),children:[e.slice(0,50),e.length>50?`…`:``]},e))}),(0,k.jsxs)(`div`,{className:$T.questionRow,children:[(0,k.jsx)(`input`,{className:$T.questionInput,value:l,onChange:e=>u(e.target.value),placeholder:`Ask something about your screen…`,onKeyDown:e=>e.key===`Enter`&&g()}),(0,k.jsx)(`button`,{className:$T.analyzeBtn,onClick:g,disabled:!l.trim()||r||a,children:a?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`spinner`}),` Analyzing…`]}):`🔍 Analyze`})]})]}),s?.error&&(0,k.jsx)(`div`,{className:$T.error,children:s.error}),y&&(0,k.jsxs)(`div`,{className:$T.screenshotContainer,children:[(0,k.jsx)(`img`,{src:y,className:$T.screenshot,alt:`Screen capture`}),s?.width&&s?.height&&(0,k.jsxs)(`div`,{className:$T.screenshotMeta,children:[s.width,` × `,s.height,`px`]})]}),s?.analysis&&(0,k.jsxs)(`div`,{className:$T.analysis,children:[(0,k.jsx)(`div`,{className:$T.analysisTitle,children:`AI Analysis`}),(0,k.jsx)(`div`,{className:$T.analysisText,children:s.analysis}),(0,k.jsx)(`button`,{className:$T.continueInChat,onClick:()=>v(`I captured my screen. Here's what the AI saw:\n\n${s.analysis}\n\nCan you help me with this?`),children:`Continue in Chat →`})]}),p.length>0&&(0,k.jsxs)(`div`,{className:$T.history,children:[(0,k.jsx)(`div`,{className:$T.sectionTitle,children:`Recent Captures`}),(0,k.jsx)(`div`,{className:$T.historyGrid,children:p.map((e,t)=>(0,k.jsxs)(`div`,{className:$T.historyItem,children:[e.src&&(0,k.jsx)(`img`,{src:e.src,className:$T.historyThumb,alt:e.question}),(0,k.jsxs)(`div`,{className:$T.historyMeta,children:[(0,k.jsx)(`div`,{className:$T.historyTs,children:e.ts}),(0,k.jsx)(`div`,{className:$T.historyQ,children:e.question}),e.analysis&&(0,k.jsxs)(`div`,{className:$T.historyA,children:[e.analysis.slice(0,120),`…`]})]})]},t))})]})]})}var nE={root:`_root_v12qq_1`,header:`_header_v12qq_3`,title:`_title_v12qq_4`,subtitle:`_subtitle_v12qq_5`,section:`_section_v12qq_7`,sectionTitle:`_sectionTitle_v12qq_8`,quickBtns:`_quickBtns_v12qq_10`,quickBtn:`_quickBtn_v12qq_10`,searchRow:`_searchRow_v12qq_14`,searchInput:`_searchInput_v12qq_15`,searchBtn:`_searchBtn_v12qq_16`,modeRow:`_modeRow_v12qq_19`,modeBtn:`_modeBtn_v12qq_20`,modeActive:`_modeActive_v12qq_21`,routeInputs:`_routeInputs_v12qq_23`,inputWrapper:`_inputWrapper_v12qq_24`,inputIcon:`_inputIcon_v12qq_25`,routeInput:`_routeInput_v12qq_23`,swapBtn:`_swapBtn_v12qq_27`,dirBtns:`_dirBtns_v12qq_29`,dirBtn:`_dirBtn_v12qq_29`,openMapsBtn:`_openMapsBtn_v12qq_32`,error:`_error_v12qq_34`,resultCard:`_resultCard_v12qq_36`,routeSummary:`_routeSummary_v12qq_37`,routeDistance:`_routeDistance_v12qq_38`,routeDuration:`_routeDuration_v12qq_39`,routeMode:`_routeMode_v12qq_40`,steps:`_steps_v12qq_41`,step:`_step_v12qq_41`,stepNum:`_stepNum_v12qq_43`,stepText:`_stepText_v12qq_44`,mapLink:`_mapLink_v12qq_45`,askChatBtn:`_askChatBtn_v12qq_47`,savedRoute:`_savedRoute_v12qq_49`,savedFrom:`_savedFrom_v12qq_51`,savedArrow:`_savedArrow_v12qq_52`,savedTo:`_savedTo_v12qq_53`,savedTs:`_savedTs_v12qq_54`},rE=[`driving`,`walking`,`bicycling`,`transit`],iE={driving:`🚗`,walking:`🚶`,bicycling:`🚲`,transit:`🚌`},aE=[{label:`🏥 Nearest Hospital`,query:`nearest hospital`},{label:`⛽ Gas Station`,query:`gas station near me`},{label:`🛒 Supermarket`,query:`supermarket near me`},{label:`☕ Coffee Shop`,query:`coffee shop near me`},{label:`🏧 ATM`,query:`ATM near me`},{label:`🍕 Pizza`,query:`pizza restaurant near me`}];function oE(e,t,n){try{let r=JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`),i=[{from:e,to:t,label:n,ts:new Date().toISOString()},...r.filter(n=>!(n.from===e&&n.to===t))].slice(0,10);localStorage.setItem(`nha_maps_routes`,JSON.stringify(i))}catch{}}function sE(){try{return JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`)}catch{return[]}}function cE(){let e=j(),t=T(e=>e.setView),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(`driving`),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(sE),[m,h]=(0,_.useState)(``),g=async()=>{if(!(!n.trim()||!i.trim())){l(!0),d(null);try{let e=await E(`/api/maps/directions?from=${encodeURIComponent(n.trim())}&to=${encodeURIComponent(i.trim())}&mode=${o}`);e&&(d(e),e.error||(oE(n.trim(),i.trim()),p(sE())))}catch{d({url:`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`}),oE(n.trim(),i.trim()),p(sE())}l(!1)}},v=e=>{let t=`https://www.google.com/maps/search/${encodeURIComponent(e)}`;window.open(t,`_blank`)},y=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},b=e=>{r(e.from),a(e.to)},x=n.trim()&&i.trim()?`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`:null;return(0,k.jsxs)(`div`,{className:nE.root,children:[(0,k.jsx)(`div`,{className:nE.header,children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:nE.title,children:`🗺️ Maps & Directions`}),(0,k.jsx)(`div`,{className:nE.subtitle,children:e(`maps.directions`)})]})}),(0,k.jsxs)(`div`,{className:nE.section,children:[(0,k.jsx)(`div`,{className:nE.sectionTitle,children:e(`common.search`)}),(0,k.jsx)(`div`,{className:nE.quickBtns,children:aE.map(e=>(0,k.jsx)(`button`,{className:nE.quickBtn,onClick:()=>v(e.query),children:e.label},e.label))}),(0,k.jsxs)(`div`,{className:nE.searchRow,children:[(0,k.jsx)(`input`,{className:nE.searchInput,value:m,onChange:e=>h(e.target.value),placeholder:`Search for a place, address, or business…`,onKeyDown:e=>e.key===`Enter`&&v(m)}),(0,k.jsx)(`button`,{className:nE.searchBtn,onClick:()=>v(m),disabled:!m.trim(),children:`Search ↗`})]})]}),(0,k.jsxs)(`div`,{className:nE.section,children:[(0,k.jsx)(`div`,{className:nE.sectionTitle,children:`Directions`}),(0,k.jsx)(`div`,{className:nE.modeRow,children:rE.map(e=>(0,k.jsxs)(`button`,{className:`${nE.modeBtn} ${o===e?nE.modeActive:``}`,onClick:()=>s(e),title:e,children:[iE[e],` `,e.charAt(0).toUpperCase()+e.slice(1)]},e))}),(0,k.jsxs)(`div`,{className:nE.routeInputs,children:[(0,k.jsxs)(`div`,{className:nE.inputWrapper,children:[(0,k.jsx)(`span`,{className:nE.inputIcon,children:`A`}),(0,k.jsx)(`input`,{className:nE.routeInput,value:n,onChange:e=>r(e.target.value),placeholder:`From (address, city, or 'my location')`,onKeyDown:e=>e.key===`Enter`&&g()})]}),(0,k.jsx)(`button`,{className:nE.swapBtn,onClick:()=>{r(i),a(n)},title:`Swap`,children:`⇅`}),(0,k.jsxs)(`div`,{className:nE.inputWrapper,children:[(0,k.jsx)(`span`,{className:nE.inputIcon,children:`B`}),(0,k.jsx)(`input`,{className:nE.routeInput,value:i,onChange:e=>a(e.target.value),placeholder:`To (address, city, or landmark)`,onKeyDown:e=>e.key===`Enter`&&g()})]})]}),(0,k.jsxs)(`div`,{className:nE.dirBtns,children:[(0,k.jsx)(`button`,{className:nE.dirBtn,onClick:g,disabled:c||!n.trim()||!i.trim(),children:c?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`spinner`}),` Getting route…`]}):`🗺️ Get Directions`}),x&&(0,k.jsx)(`a`,{className:nE.openMapsBtn,href:x,target:`_blank`,rel:`noreferrer`,children:`Open in Google Maps ↗`})]})]}),u?.error&&(0,k.jsx)(`div`,{className:nE.error,children:u.error}),u&&!u.error&&(0,k.jsxs)(`div`,{className:nE.resultCard,children:[(u.distance||u.duration)&&(0,k.jsxs)(`div`,{className:nE.routeSummary,children:[u.distance&&(0,k.jsxs)(`span`,{className:nE.routeDistance,children:[`📏 `,u.distance]}),u.duration&&(0,k.jsxs)(`span`,{className:nE.routeDuration,children:[`⏱ `,u.duration]}),(0,k.jsxs)(`span`,{className:nE.routeMode,children:[iE[o],` `,o]})]}),u.steps&&u.steps.length>0&&(0,k.jsx)(`div`,{className:nE.steps,children:u.steps.map((e,t)=>(0,k.jsxs)(`div`,{className:nE.step,children:[(0,k.jsx)(`span`,{className:nE.stepNum,children:t+1}),(0,k.jsx)(`span`,{className:nE.stepText,children:e})]},t))}),u.url&&(0,k.jsx)(`a`,{className:nE.mapLink,href:u.url,target:`_blank`,rel:`noreferrer`,children:`View full route on Google Maps ↗`}),(0,k.jsx)(`button`,{className:nE.askChatBtn,onClick:()=>y(`Give me directions from "${n}" to "${i}" by ${o}. Include estimated time, distance, and any traffic alerts or alternative routes.`),children:`Ask AI for detailed route advice →`})]}),f.length>0&&(0,k.jsxs)(`div`,{className:nE.section,children:[(0,k.jsx)(`div`,{className:nE.sectionTitle,children:`Recent Routes`}),f.map((e,t)=>(0,k.jsxs)(`div`,{className:nE.savedRoute,onClick:()=>b(e),children:[(0,k.jsx)(`span`,{className:nE.savedFrom,children:e.from}),(0,k.jsx)(`span`,{className:nE.savedArrow,children:`→`}),(0,k.jsx)(`span`,{className:nE.savedTo,children:e.to}),(0,k.jsx)(`span`,{className:nE.savedTs,children:new Date(e.ts).toLocaleDateString()})]},t))]})]})}var lE={root:`_root_esnjz_1`,header:`_header_esnjz_3`,title:`_title_esnjz_4`,subtitle:`_subtitle_esnjz_5`,addBtn:`_addBtn_esnjz_6`,quickAdd:`_quickAdd_esnjz_8`,quickLabel:`_quickLabel_esnjz_9`,quickPresets:`_quickPresets_esnjz_10`,quickPreset:`_quickPreset_esnjz_10`,section:`_section_esnjz_14`,sectionTitle:`_sectionTitle_esnjz_15`,loading:`_loading_esnjz_17`,empty:`_empty_esnjz_18`,card:`_card_esnjz_20`,cardPast:`_cardPast_esnjz_21`,cardLeft:`_cardLeft_esnjz_22`,reminderMsg:`_reminderMsg_esnjz_23`,reminderTime:`_reminderTime_esnjz_24`,timeBadge:`_timeBadge_esnjz_25`,countdown:`_countdown_esnjz_26`,timePast:`_timePast_esnjz_27`,sentBadge:`_sentBadge_esnjz_28`,cancelledBadge:`_cancelledBadge_esnjz_29`,cancelBtn:`_cancelBtn_esnjz_30`,repeatBtn:`_repeatBtn_esnjz_31`,aiButtons:`_aiButtons_esnjz_33`,aiBtn:`_aiBtn_esnjz_34`,overlay:`_overlay_esnjz_38`,modal:`_modal_esnjz_39`,modalTitle:`_modalTitle_esnjz_40`,label:`_label_esnjz_41`,input:`_input_esnjz_42`,msgTemplates:`_msgTemplates_esnjz_44`,msgTemplate:`_msgTemplate_esnjz_44`,msgTemplateActive:`_msgTemplateActive_esnjz_47`,typeTabs:`_typeTabs_esnjz_49`,typeTab:`_typeTab_esnjz_49`,typeTabActive:`_typeTabActive_esnjz_51`,relRow:`_relRow_esnjz_53`,inLabel:`_inLabel_esnjz_54`,relInput:`_relInput_esnjz_55`,relSelect:`_relSelect_esnjz_56`,formErr:`_formErr_esnjz_58`,formOk:`_formOk_esnjz_59`,modalBtns:`_modalBtns_esnjz_60`,cancelModalBtn:`_cancelModalBtn_esnjz_61`,saveBtn:`_saveBtn_esnjz_62`},uE=[{label:`In 5 min`,value:`in 5 minutes`},{label:`In 15 min`,value:`in 15 minutes`},{label:`In 30 min`,value:`in 30 minutes`},{label:`In 1 hour`,value:`in 1 hour`},{label:`In 2 hours`,value:`in 2 hours`},{label:`In 3 hours`,value:`in 3 hours`},{label:`Tomorrow 9am`,value:`tomorrow at 09:00`},{label:`Tomorrow noon`,value:`tomorrow at 12:00`}],dE=[`Take a break and stretch`,`Check emails`,`Join the standup call`,`Review and respond to messages`,`Take your medication`,`Drink water`,`Focus review — what did you accomplish in the last hour?`,`Follow up on pending tasks`,`End of work day — log your achievements`,`Weekly review — prepare for next week`];function fE(e){if(e<1)return`now`;if(e<60)return`in ${e}m`;let t=Math.floor(e/60),n=e%60;return n>0?`in ${t}h ${n}m`:`in ${t}h`}function pE(){let e=j(),t=T(e=>e.setView),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)({message:``,atTime:``,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`}),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),g=()=>{a(!0),E(`/api/reminders`).then(e=>{r(e?.reminders??[]),a(!1)}).catch(()=>{r([]),a(!1)})};(0,_.useEffect)(()=>{g()},[]);let v=async()=>{if(!o.message.trim()){d(`Message is required`);return}let e=``;if(o.atTimeType===`relative`)e=`in ${o.relValue} ${o.relUnit}`;else{if(!o.atTime){d(`Time is required`);return}e=o.atTime}l(!0),d(``);try{await D(`/api/reminders`,{message:o.message.trim(),atTime:e}),p(`Reminder set!`),setTimeout(()=>{p(``),h(!1)},1500),g()}catch(e){d(e.message??`Failed to set reminder`)}l(!1)},y=e=>{confirm(`Cancel this reminder?`)&&D(`/api/reminders/cancel`,{id:e}).then(g)},b=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},x=n.filter(e=>e.status===`pending`),S=n.filter(e=>e.status!==`pending`);return(0,k.jsxs)(`div`,{className:lE.root,children:[(0,k.jsxs)(`div`,{className:lE.header,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:lE.title,children:`🔔 Reminders`}),(0,k.jsx)(`div`,{className:lE.subtitle,children:`Set one-time notifications via the NHA daemon`})]}),(0,k.jsx)(`button`,{className:lE.addBtn,onClick:()=>{h(!0),d(``),p(``)},children:`+ New Reminder`})]}),(0,k.jsxs)(`div`,{className:lE.quickAdd,children:[(0,k.jsx)(`div`,{className:lE.quickLabel,children:`Quick reminder for now:`}),(0,k.jsx)(`div`,{className:lE.quickPresets,children:uE.map(e=>(0,k.jsx)(`button`,{className:lE.quickPreset,onClick:()=>{s(e=>({...e,atTimeType:`relative`,atTime:``,message:e.message||`Reminder`})),h(!0),d(``),p(``)},children:e.label},e.value))})]}),i&&(0,k.jsxs)(`div`,{className:lE.loading,children:[(0,k.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!i&&(0,k.jsxs)(`div`,{className:lE.section,children:[(0,k.jsxs)(`div`,{className:lE.sectionTitle,children:[`Pending (`,x.length,`)`]}),x.length===0&&(0,k.jsx)(`div`,{className:lE.empty,children:`No pending reminders. Set one to get notified.`}),x.map(e=>(0,k.jsxs)(`div`,{className:lE.card,children:[(0,k.jsxs)(`div`,{className:lE.cardLeft,children:[(0,k.jsx)(`div`,{className:lE.reminderMsg,children:e.message}),(0,k.jsxs)(`div`,{className:lE.reminderTime,children:[(0,k.jsx)(`span`,{className:lE.timeBadge,children:new Date(e.atTime).toLocaleString()}),e.minutesUntil!==void 0&&(0,k.jsx)(`span`,{className:lE.countdown,children:fE(e.minutesUntil)})]})]}),(0,k.jsx)(`button`,{className:lE.cancelBtn,onClick:()=>y(e.id),children:`Cancel`})]},e.id))]}),S.length>0&&(0,k.jsxs)(`div`,{className:lE.section,children:[(0,k.jsxs)(`div`,{className:lE.sectionTitle,children:[`Recent (`,S.length,`)`]}),S.slice(0,10).map(e=>(0,k.jsxs)(`div`,{className:`${lE.card} ${lE.cardPast}`,children:[(0,k.jsxs)(`div`,{className:lE.cardLeft,children:[(0,k.jsx)(`div`,{className:lE.reminderMsg,children:e.message}),(0,k.jsxs)(`div`,{className:lE.reminderTime,children:[(0,k.jsx)(`span`,{className:e.status===`sent`?lE.sentBadge:lE.cancelledBadge,children:e.status}),(0,k.jsx)(`span`,{className:lE.timePast,children:new Date(e.atTime).toLocaleString()})]})]}),(0,k.jsx)(`button`,{className:lE.repeatBtn,onClick:()=>{s(t=>({...t,message:e.message,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`})),h(!0)},children:`Repeat`})]},e.id))]}),(0,k.jsxs)(`div`,{className:lE.section,children:[(0,k.jsx)(`div`,{className:lE.sectionTitle,children:`AI-Powered Reminders`}),(0,k.jsxs)(`div`,{className:lE.aiButtons,children:[(0,k.jsx)(`button`,{className:lE.aiBtn,onClick:()=>b(`Set a reminder to check my emails in 30 minutes`),children:`📧 Email check in 30min`}),(0,k.jsx)(`button`,{className:lE.aiBtn,onClick:()=>b(`Set a reminder every hour to take a break and drink water`),children:`💧 Hourly water break`}),(0,k.jsx)(`button`,{className:lE.aiBtn,onClick:()=>b(`Set a reminder at the end of the work day (6pm) to do an evening review of my tasks and prepare tomorrow's plan`),children:`🌆 Evening review 6pm`}),(0,k.jsx)(`button`,{className:lE.aiBtn,onClick:()=>b(`Look at my calendar and set reminders for all events today`),children:`📅 Remind me of today's events`})]})]}),m&&(0,k.jsx)(`div`,{className:lE.overlay,onClick:e=>{e.target===e.currentTarget&&h(!1)},children:(0,k.jsxs)(`div`,{className:lE.modal,children:[(0,k.jsx)(`div`,{className:lE.modalTitle,children:e(`reminders.new`)}),(0,k.jsx)(`div`,{className:lE.label,children:`Message *`}),(0,k.jsx)(`div`,{className:lE.msgTemplates,children:dE.map(e=>(0,k.jsx)(`button`,{className:`${lE.msgTemplate} ${o.message===e?lE.msgTemplateActive:``}`,onClick:()=>s(t=>({...t,message:e})),children:e},e))}),(0,k.jsx)(`input`,{className:lE.input,value:o.message,onChange:e=>s(t=>({...t,message:e.target.value})),placeholder:`Reminder message (e.g. Call John)`}),(0,k.jsx)(`div`,{className:lE.label,children:`When *`}),(0,k.jsxs)(`div`,{className:lE.typeTabs,children:[(0,k.jsx)(`button`,{className:`${lE.typeTab} ${o.atTimeType===`relative`?lE.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`relative`})),children:`Relative`}),(0,k.jsx)(`button`,{className:`${lE.typeTab} ${o.atTimeType===`absolute`?lE.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`absolute`})),children:`Exact time`})]}),o.atTimeType===`relative`?(0,k.jsxs)(`div`,{className:lE.relRow,children:[(0,k.jsx)(`span`,{className:lE.inLabel,children:`in`}),(0,k.jsx)(`input`,{className:lE.relInput,type:`number`,min:`1`,value:o.relValue,onChange:e=>s(t=>({...t,relValue:e.target.value}))}),(0,k.jsxs)(`select`,{className:lE.relSelect,value:o.relUnit,onChange:e=>s(t=>({...t,relUnit:e.target.value})),children:[(0,k.jsx)(`option`,{value:`minutes`,children:`minutes`}),(0,k.jsx)(`option`,{value:`hours`,children:`hours`}),(0,k.jsx)(`option`,{value:`days`,children:`days`})]})]}):(0,k.jsx)(`input`,{className:lE.input,type:`datetime-local`,value:o.atTime,onChange:e=>s(t=>({...t,atTime:e.target.value}))}),u&&(0,k.jsx)(`div`,{className:lE.formErr,children:u}),f&&(0,k.jsx)(`div`,{className:lE.formOk,children:f}),(0,k.jsxs)(`div`,{className:lE.modalBtns,children:[(0,k.jsx)(`button`,{className:lE.cancelModalBtn,onClick:()=>h(!1),children:`Cancel`}),(0,k.jsx)(`button`,{className:lE.saveBtn,onClick:v,disabled:c,children:c?`Setting…`:`🔔 Set Reminder`})]})]})})]})}var mE={root:`_root_atgeb_1`,icon:`_icon_atgeb_10`,title:`_title_atgeb_11`,sub:`_sub_atgeb_12`},hE={dashboard:`⚡`,email:`📧`,calendar:`📅`,tasks:`✅`,contacts:`👤`,notes:`📝`,drive:`💾`,onedrive:`☁️`,mstodo:`📋`,github:`🐙`,slack:`💬`,notion:`📋`,collab:`🏛️`,maps:`🗺️`,cron:`⏰`,screen:`🖥️`,reminders:`🔔`,birthdays:`🎂`,settings:`⚙️`,agents:`🤖`,plan:`🗓️`,webcraft:`🔨`,connectors:`🔗`};function gE({view:e}){let t=j();return(0,k.jsxs)(`div`,{className:mE.root,children:[(0,k.jsx)(`div`,{className:mE.icon,children:hE[e]??`🔧`}),(0,k.jsx)(`div`,{className:mE.title,children:e.charAt(0).toUpperCase()+e.slice(1)}),(0,k.jsx)(`div`,{className:mE.sub,children:t(`common.comingSoon`)})]})}function _E({activeView:e}){switch(e){case`dashboard`:return(0,k.jsx)(_t,{});case`chat`:return(0,k.jsx)(Ee,{});case`email`:return(0,k.jsx)(Gt,{});case`calendar`:return(0,k.jsx)(Yt,{});case`tasks`:return(0,k.jsx)(yt,{});case`notes`:return(0,k.jsx)(At,{});case`contacts`:return(0,k.jsx)(Nt,{});case`birthdays`:return(0,k.jsx)(wt,{});case`cron`:return(0,k.jsx)(Ot,{});case`connectors`:return(0,k.jsx)(Bt,{});case`agents`:return(0,k.jsx)($t,{});case`drive`:return(0,k.jsx)(nn,{});case`onedrive`:return(0,k.jsx)(XT,{});case`mstodo`:return(0,k.jsx)(QT,{});case`github`:return(0,k.jsx)(an,{});case`slack`:return(0,k.jsx)(sn,{});case`notion`:return(0,k.jsx)(cn,{});case`collab`:return(0,k.jsx)(fn,{});case`plan`:return(0,k.jsx)(JT,{});case`screen`:return(0,k.jsx)(tE,{});case`maps`:return(0,k.jsx)(cE,{});case`reminders`:return(0,k.jsx)(pE,{});case`settings`:return(0,k.jsx)(St,{});default:return(0,k.jsx)(gE,{view:e})}}function vE(){let{activeView:e}=T();return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{style:{display:e===`studio`?`contents`:`none`},children:(0,k.jsx)(ft,{})}),(0,k.jsx)(`div`,{style:{display:e===`webcraft`?`contents`:`none`},children:(0,k.jsx)(WT,{})}),e!==`studio`&&e!==`webcraft`&&(0,k.jsx)(_E,{activeView:e})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,k.jsx)(_.StrictMode,{children:(0,k.jsx)(me,{children:(0,k.jsx)(vE,{})})}));
|
package/src/ui-dist/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
10
10
|
<title>NHA — NotHumanAllowed</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-R6rCjjN5.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/index-R2XRhcPq.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|