@jait/gateway 0.1.344 → 0.1.345
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/routes/threads.d.ts.map +1 -1
- package/dist/routes/threads.js +14 -2
- package/dist/routes/threads.js.map +1 -1
- package/package.json +1 -1
- package/web-dist/assets/{_basePickBy-5dsCXGlk.js → _basePickBy-DDZBbVa9.js} +1 -1
- package/web-dist/assets/{_baseUniq-CaY_K8Q6.js → _baseUniq-D3y9XHHg.js} +1 -1
- package/web-dist/assets/{arc-CiQW9G89.js → arc-BCAp9AaD.js} +1 -1
- package/web-dist/assets/{architectureDiagram-2XIMDMQ5-BeO6uAhf.js → architectureDiagram-2XIMDMQ5-UqF6qgDi.js} +1 -1
- package/web-dist/assets/{blockDiagram-WCTKOSBZ-fefg4PUZ.js → blockDiagram-WCTKOSBZ-BgA4E7gt.js} +1 -1
- package/web-dist/assets/{c4Diagram-IC4MRINW-B3VzpFTa.js → c4Diagram-IC4MRINW-DysDeHPS.js} +1 -1
- package/web-dist/assets/channel-D95yUbTA.js +1 -0
- package/web-dist/assets/{chunk-4BX2VUAB-DB1OCtOf.js → chunk-4BX2VUAB-BCffCkTn.js} +1 -1
- package/web-dist/assets/{chunk-55IACEB6-CV_KeMJQ.js → chunk-55IACEB6-nKTLcOPY.js} +1 -1
- package/web-dist/assets/{chunk-FMBD7UC4-DmpgLYfs.js → chunk-FMBD7UC4-Cyef9s7K.js} +1 -1
- package/web-dist/assets/{chunk-JSJVCQXG-f5h4OV5E.js → chunk-JSJVCQXG-CrYgwrPS.js} +1 -1
- package/web-dist/assets/{chunk-KX2RTZJC-apg5Iwf_.js → chunk-KX2RTZJC-Bg3QWLDg.js} +1 -1
- package/web-dist/assets/{chunk-NQ4KR5QH-C5vgNFtg.js → chunk-NQ4KR5QH-BhvTZHn8.js} +1 -1
- package/web-dist/assets/{chunk-QZHKN3VN-D2DSFxUx.js → chunk-QZHKN3VN-e4adOWJg.js} +1 -1
- package/web-dist/assets/{chunk-WL4C6EOR-s69rKZO8.js → chunk-WL4C6EOR-DRS_U7LX.js} +1 -1
- package/web-dist/assets/classDiagram-VBA2DB6C-Dibm0i7y.js +1 -0
- package/web-dist/assets/classDiagram-v2-RAHNMMFH-Dibm0i7y.js +1 -0
- package/web-dist/assets/clone-Ca9jdgiY.js +1 -0
- package/web-dist/assets/{cose-bilkent-S5V4N54A-CUMqIMaE.js → cose-bilkent-S5V4N54A-DKjpSdTF.js} +1 -1
- package/web-dist/assets/{dagre-KLK3FWXG-D1pqjsv9.js → dagre-KLK3FWXG-Beok1xve.js} +1 -1
- package/web-dist/assets/{diagram-E7M64L7V-Cq0BHNvg.js → diagram-E7M64L7V-CH8hwKTm.js} +1 -1
- package/web-dist/assets/{diagram-IFDJBPK2-BuFd3ET4.js → diagram-IFDJBPK2-pRXXJopV.js} +1 -1
- package/web-dist/assets/{diagram-P4PSJMXO-B0fQm-IW.js → diagram-P4PSJMXO-BBR8On_g.js} +1 -1
- package/web-dist/assets/{erDiagram-INFDFZHY-IfQCpBC0.js → erDiagram-INFDFZHY-D68qu6h_.js} +1 -1
- package/web-dist/assets/{flowDiagram-PKNHOUZH-Cb0TI4bM.js → flowDiagram-PKNHOUZH-BpVDS62R.js} +1 -1
- package/web-dist/assets/{ganttDiagram-A5KZAMGK-r_16EseP.js → ganttDiagram-A5KZAMGK-DBKzQhCL.js} +1 -1
- package/web-dist/assets/{gitGraphDiagram-K3NZZRJ6-WLJfv0-h.js → gitGraphDiagram-K3NZZRJ6-CvBRSFlf.js} +1 -1
- package/web-dist/assets/{graph-BNzNk1T7.js → graph-CKR_sYun.js} +1 -1
- package/web-dist/assets/{index-p2CjVDSl.css → index-D-At7mLv.css} +1 -1
- package/web-dist/assets/{index-D5C1ZwX3.js → index-sO857Q5m.js} +4 -4
- package/web-dist/assets/{infoDiagram-LFFYTUFH-DLD4P91P.js → infoDiagram-LFFYTUFH-Ly3-UMJR.js} +1 -1
- package/web-dist/assets/{ishikawaDiagram-PHBUUO56-SJqBTmBu.js → ishikawaDiagram-PHBUUO56-C3qLfmyu.js} +1 -1
- package/web-dist/assets/{journeyDiagram-4ABVD52K-BOpfAfPl.js → journeyDiagram-4ABVD52K-BU00tgXX.js} +1 -1
- package/web-dist/assets/{kanban-definition-K7BYSVSG-DyOv9a25.js → kanban-definition-K7BYSVSG-CwSnU5Qv.js} +1 -1
- package/web-dist/assets/{layout-B0EVKVEk.js → layout-B-s5iZga.js} +1 -1
- package/web-dist/assets/{linear-DfWQSn4S.js → linear-DTsHFF3V.js} +1 -1
- package/web-dist/assets/{mindmap-definition-YRQLILUH-DlE85YYX.js → mindmap-definition-YRQLILUH-DOYbhQzM.js} +1 -1
- package/web-dist/assets/{pieDiagram-SKSYHLDU-CIHb2940.js → pieDiagram-SKSYHLDU-BkqY9oKT.js} +1 -1
- package/web-dist/assets/{quadrantDiagram-337W2JSQ-_Np404Qz.js → quadrantDiagram-337W2JSQ-CenWciwP.js} +1 -1
- package/web-dist/assets/{requirementDiagram-Z7DCOOCP-DJN0cElK.js → requirementDiagram-Z7DCOOCP-D6yUwSQW.js} +1 -1
- package/web-dist/assets/{sankeyDiagram-WA2Y5GQK-DXRdOqqC.js → sankeyDiagram-WA2Y5GQK-zqzGSEUy.js} +1 -1
- package/web-dist/assets/{sequenceDiagram-2WXFIKYE-CSwtaXRM.js → sequenceDiagram-2WXFIKYE-BZ1AXjDr.js} +1 -1
- package/web-dist/assets/{stateDiagram-RAJIS63D-D3X7AXBS.js → stateDiagram-RAJIS63D-BYZ5MN-_.js} +1 -1
- package/web-dist/assets/stateDiagram-v2-FVOUBMTO-D_zSXFIT.js +1 -0
- package/web-dist/assets/{timeline-definition-YZTLITO2-BO0ZLZX-.js → timeline-definition-YZTLITO2-DXHUGIi-.js} +1 -1
- package/web-dist/assets/{treemap-KZPCXAKY-BXIY-XYS.js → treemap-KZPCXAKY-CtyGazEG.js} +1 -1
- package/web-dist/assets/{vennDiagram-LZ73GAT5-D6XzKc84.js → vennDiagram-LZ73GAT5-D_yIv7Ug.js} +1 -1
- package/web-dist/assets/{xychartDiagram-JWTSCODW-B05ztKFG.js → xychartDiagram-JWTSCODW-CpJYzW_t.js} +1 -1
- package/web-dist/index.html +2 -2
- package/web-dist/assets/channel-JhmJl-rx.js +0 -1
- package/web-dist/assets/classDiagram-VBA2DB6C-CtN55YO2.js +0 -1
- package/web-dist/assets/classDiagram-v2-RAHNMMFH-CtN55YO2.js +0 -1
- package/web-dist/assets/clone-BaXJgvrD.js +0 -1
- package/web-dist/assets/stateDiagram-v2-FVOUBMTO-CYF37jma.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuFy.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./angular-ts-BrjP3tb8.js","./scss-D5BDwBP9.js","./astro-HNnZUWAn.js","./json-Cp-IABpG.js","./typescript-BPQ3VLAy.js","./postcss-CXtECtnM.js","./tsx-COt5Ahok.js","./blade-BjGOyj-B.js","./html-derivative-DlHx6ybY.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./sql-BLtJtn59.js","./coffee-Ch7k5sss.js","./cpp-CofmeUqb.js","./regexp-CDVJQ6XC.js","./glsl-DplSGwfg.js","./c-BIGW1oBm.js","./graphql-ChdNCCLP.js","./jsx-g9-lgVsj.js","./haml-D5jkg6IW.js","./handlebars-BpdQsYii.js","./yaml-Buea-lGh.js","./http-jrhK8wxY.js","./shellscript-Yzrsuije.js","./hurl-irOxFIW8.js","./csv-fuZLfV_i.js","./jinja-f2NsQr07.js","./jison-wvAkD_A8.js","./julia-CxzCAyBv.js","./python-B6aJPvgy.js","./r-Dspwwk_N.js","./marko-DjSrsDqO.js","./less-B1dDrJ26.js","./mdc-DTYItulj.js","./markdown-Cvjx9yec.js","./php-R6g_5hLQ.js","./pug-DKIMFp6K.js","./svelte-Cy7k_4gC.js","./ts-tags-DQrlYJgV.js","./vue-D2xRrEX4.js","./vue-html-AaS7Mt5G.js","./vue-vine-BoDAl6tE.js","./stylus-BEDo0Tqx.js","./dagre-KLK3FWXG-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuFy.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./angular-ts-BrjP3tb8.js","./scss-D5BDwBP9.js","./astro-HNnZUWAn.js","./json-Cp-IABpG.js","./typescript-BPQ3VLAy.js","./postcss-CXtECtnM.js","./tsx-COt5Ahok.js","./blade-BjGOyj-B.js","./html-derivative-DlHx6ybY.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./sql-BLtJtn59.js","./coffee-Ch7k5sss.js","./cpp-CofmeUqb.js","./regexp-CDVJQ6XC.js","./glsl-DplSGwfg.js","./c-BIGW1oBm.js","./graphql-ChdNCCLP.js","./jsx-g9-lgVsj.js","./haml-D5jkg6IW.js","./handlebars-BpdQsYii.js","./yaml-Buea-lGh.js","./http-jrhK8wxY.js","./shellscript-Yzrsuije.js","./hurl-irOxFIW8.js","./csv-fuZLfV_i.js","./jinja-f2NsQr07.js","./jison-wvAkD_A8.js","./julia-CxzCAyBv.js","./python-B6aJPvgy.js","./r-Dspwwk_N.js","./marko-DjSrsDqO.js","./less-B1dDrJ26.js","./mdc-DTYItulj.js","./markdown-Cvjx9yec.js","./php-R6g_5hLQ.js","./pug-DKIMFp6K.js","./svelte-Cy7k_4gC.js","./ts-tags-DQrlYJgV.js","./vue-D2xRrEX4.js","./vue-html-AaS7Mt5G.js","./vue-vine-BoDAl6tE.js","./stylus-BEDo0Tqx.js","./dagre-KLK3FWXG-Beok1xve.js","./graph-CKR_sYun.js","./_baseUniq-D3y9XHHg.js","./layout-B-s5iZga.js","./_basePickBy-DDZBbVa9.js","./clone-Ca9jdgiY.js","./cose-bilkent-S5V4N54A-DKjpSdTF.js","./cytoscape.esm-BQaXIfA_.js","./c4Diagram-IC4MRINW-DysDeHPS.js","./chunk-JSJVCQXG-CrYgwrPS.js","./flowDiagram-PKNHOUZH-BpVDS62R.js","./chunk-FMBD7UC4-Cyef9s7K.js","./chunk-55IACEB6-nKTLcOPY.js","./chunk-KX2RTZJC-Bg3QWLDg.js","./channel-D95yUbTA.js","./erDiagram-INFDFZHY-D68qu6h_.js","./gitGraphDiagram-K3NZZRJ6-CvBRSFlf.js","./chunk-4BX2VUAB-BCffCkTn.js","./chunk-QZHKN3VN-e4adOWJg.js","./treemap-KZPCXAKY-CtyGazEG.js","./ganttDiagram-A5KZAMGK-DBKzQhCL.js","./linear-DTsHFF3V.js","./defaultLocale-DX6XiGOO.js","./infoDiagram-LFFYTUFH-Ly3-UMJR.js","./pieDiagram-SKSYHLDU-BkqY9oKT.js","./arc-BCAp9AaD.js","./quadrantDiagram-337W2JSQ-CenWciwP.js","./xychartDiagram-JWTSCODW-CpJYzW_t.js","./requirementDiagram-Z7DCOOCP-D6yUwSQW.js","./sequenceDiagram-2WXFIKYE-BZ1AXjDr.js","./classDiagram-VBA2DB6C-Dibm0i7y.js","./chunk-WL4C6EOR-DRS_U7LX.js","./classDiagram-v2-RAHNMMFH-Dibm0i7y.js","./stateDiagram-RAJIS63D-BYZ5MN-_.js","./chunk-NQ4KR5QH-BhvTZHn8.js","./stateDiagram-v2-FVOUBMTO-D_zSXFIT.js","./journeyDiagram-4ABVD52K-BU00tgXX.js","./timeline-definition-YZTLITO2-DXHUGIi-.js","./mindmap-definition-YRQLILUH-DOYbhQzM.js","./kanban-definition-K7BYSVSG-CwSnU5Qv.js","./diagram-P4PSJMXO-BBR8On_g.js","./diagram-IFDJBPK2-pRXXJopV.js","./blockDiagram-WCTKOSBZ-BgA4E7gt.js","./architectureDiagram-2XIMDMQ5-UqF6qgDi.js","./diagram-E7M64L7V-CH8hwKTm.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var dhe=Object.defineProperty;var hhe=(e,r,n)=>r in e?dhe(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var Fe=(e,r,n)=>hhe(e,typeof r!="symbol"?r+"":r,n);function fhe(e,r){for(var n=0;n<r.length;n++){const i=r[n];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(i,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function T0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n1t(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var r=e.default;if(typeof r=="function"){var n=function i(){return this instanceof i?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};n.prototype=r.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),n}var Q6={exports:{}},Vx={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -1116,8 +1116,8 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
1116
1116
|
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,s=e.y,o=Math.abs(i-n.x),a=e.width/2;let l=n.x<r.x?a-o:a+o;const u=e.height/2,c=Math.abs(r.y-n.y),h=Math.abs(r.x-n.x);if(Math.abs(s-r.y)*a>Math.abs(i-r.x)*u){let p=n.y<r.y?r.y-u-s:s-u-r.y;l=h*p/c;const g={x:n.x<r.x?n.x+l:n.x-h+l,y:n.y<r.y?n.y+c-p:n.y-c+p};return l===0&&(g.x=r.x,g.y=r.y),h===0&&(g.x=r.x),c===0&&(g.y=r.y),_t.debug(`abc89 top/bottom calc, Q ${c}, q ${p}, R ${h}, r ${l}`,g),g}else{n.x<r.x?l=r.x-a-i:l=i-a-r.x;let p=c*l/h,g=n.x<r.x?n.x+h-l:n.x-h+l,v=n.y<r.y?n.y+p:n.y-p;return _t.debug(`sides calc abc89, Q ${c}, q ${p}, R ${h}, r ${l}`,{_x:g,_y:v}),l===0&&(g=r.x,v=r.y),h===0&&(g=r.x),c===0&&(v=r.y),{x:g,y:v}}},"intersection"),xF=X((e,r)=>{_t.warn("abc88 cutPathAtIntersect",e,r);let n=[],i=e[0],s=!1;return e.forEach(o=>{if(_t.info("abc88 checking point",o,r),!YUe(r,o)&&!s){const a=XUe(r,i,o);_t.debug("abc88 inside",o,i,a),_t.debug("abc88 intersection",a,r);let l=!1;n.forEach(u=>{l=l||u.x===a.x&&u.y===a.y}),n.some(u=>u.x===a.x&&u.y===a.y)?_t.warn("abc88 no intersect",a,n):n.push(a),s=!0}else _t.warn("abc88 outside",o,i),i=o,s||n.push(o)}),_t.debug("returning points",n),n},"cutPathAtIntersect");function use(e){const r=[],n=[];for(let i=1;i<e.length-1;i++){const s=e[i-1],o=e[i],a=e[i+1];(s.x===o.x&&o.y===a.y&&Math.abs(o.x-a.x)>5&&Math.abs(o.y-s.y)>5||s.y===o.y&&o.x===a.x&&Math.abs(o.x-s.x)>5&&Math.abs(o.y-a.y)>5)&&(r.push(o),n.push(i))}return{cornerPoints:r,cornerPointPositions:n}}X(use,"extractCornerPoints");var bF=X(function(e,r,n){const i=r.x-e.x,s=r.y-e.y,o=Math.sqrt(i*i+s*s),a=n/o;return{x:r.x-a*i,y:r.y-a*s}},"findAdjacentPoint"),ZUe=X(function(e){const{cornerPointPositions:r}=use(e),n=[];for(let i=0;i<e.length;i++)if(r.includes(i)){const s=e[i-1],o=e[i+1],a=e[i],l=bF(s,a,5),u=bF(o,a,5),c=u.x-l.x,h=u.y-l.y;n.push(l);const p=Math.sqrt(2)*2;let g={x:a.x,y:a.y};if(Math.abs(o.x-s.x)>10&&Math.abs(o.y-s.y)>=10){_t.debug("Corner point fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));const v=5;a.x===l.x?g={x:c<0?l.x-v+p:l.x+v-p,y:h<0?l.y-p:l.y+p}:g={x:c<0?l.x-p:l.x+p,y:h<0?l.y-v+p:l.y+v-p}}else _t.debug("Corner point skipping fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));n.push(g,u)}else n.push(e[i]);return n},"fixCorners"),JUe=X((e,r,n)=>{const i=e-r-n,s=2,o=2,a=s+o,l=Math.floor(i/a),u=Array(l).fill(`${s} ${o}`).join(" ");return`0 ${r} ${u} ${n}`},"generateDashArray"),QUe=X(function(e,r,n,i,s,o,a,l=!1){var L;const{handDrawnSeed:u}=ri();let c=r.points,h=!1;const p=s;var g=o;const v=[];for(const z in r.cssCompiledStyles)une(z)||v.push(r.cssCompiledStyles[z]);_t.debug("UIO intersect check",r.points,g.x,p.x),g.intersect&&p.intersect&&!l&&(c=c.slice(1,r.points.length-1),c.unshift(p.intersect(c[0])),_t.debug("Last point UIO",r.start,"-->",r.end,c[c.length-1],g,g.intersect(c[c.length-1])),c.push(g.intersect(c[c.length-1])));const b=btoa(JSON.stringify(c));r.toCluster&&(_t.info("to cluster abc88",n.get(r.toCluster)),c=xF(r.points,n.get(r.toCluster).node),h=!0),r.fromCluster&&(_t.debug("from cluster abc88",n.get(r.fromCluster),JSON.stringify(c,null,2)),c=xF(c.reverse(),n.get(r.fromCluster).node).reverse(),h=!0);let _=c.filter(z=>!Number.isNaN(z.y));const k=qUe(r.curve);k!=="rounded"&&(_=ZUe(_));let w=k_;switch(k){case"linear":w=k_;break;case"basis":w=TA;break;case"cardinal":w=Uee;break;case"bumpX":w=Bee;break;case"bumpY":w=zee;break;case"catmullRom":w=qee;break;case"monotoneX":w=Jee;break;case"monotoneY":w=Qee;break;case"natural":w=tte;break;case"step":w=rte;break;case"stepAfter":w=ite;break;case"stepBefore":w=nte;break;case"rounded":w=k_;break;default:w=TA}const{x:C,y:j}=YBe(r),T=CIe().x(C).y(j).curve(w);let A;switch(r.thickness){case"normal":A="edge-thickness-normal";break;case"thick":A="edge-thickness-thick";break;case"invisible":A="edge-thickness-invisible";break;default:A="edge-thickness-normal"}switch(r.pattern){case"solid":A+=" edge-pattern-solid";break;case"dotted":A+=" edge-pattern-dotted";break;case"dashed":A+=" edge-pattern-dashed";break;default:A+=" edge-pattern-solid"}let E,R=k==="rounded"?dse(hse(_,r),5):T(_);const P=Array.isArray(r.style)?r.style:[r.style];let H=P.find(z=>z==null?void 0:z.startsWith("stroke:")),$="";r.animate&&($="edge-animation-fast"),r.animation&&($="edge-animation-"+r.animation);let U=!1;if(r.look==="handDrawn"){const z=xr.svg(e);Object.assign([],_);const W=z.path(R,{roughness:.3,seed:u});A+=" transition",E=$r(W).select("path").attr("id",r.id).attr("class"," "+A+(r.classes?" "+r.classes:"")+($?" "+$:"")).attr("style",P?P.reduce((F,q)=>F+";"+q,""):"");let Y=E.attr("d");E.attr("d",Y),e.node().appendChild(E.node())}else{const z=v.join(";"),W=P?P.reduce((ee,ne)=>ee+ne+";",""):"",Y=(z?z+";"+W+";":W)+";"+(P?P.reduce((ee,ne)=>ee+";"+ne,""):"");E=e.append("path").attr("d",R).attr("id",r.id).attr("class"," "+A+(r.classes?" "+r.classes:"")+($?" "+$:"")).attr("style",Y),H=(L=Y.match(/stroke:([^;]+)/))==null?void 0:L[1],U=r.animate===!0||!!r.animation||z.includes("animation");const F=E.node(),q=typeof F.getTotalLength=="function"?F.getTotalLength():0,J=Lz[r.arrowTypeStart]||0,V=Lz[r.arrowTypeEnd]||0;if(r.look==="neo"&&!U){const ne=`stroke-dasharray: ${r.pattern==="dotted"||r.pattern==="dashed"?JUe(q,J,V):`0 ${J} ${q-J-V} ${V}`}; stroke-dashoffset: 0;`;E.attr("style",ne+E.attr("style"))}}E.attr("data-edge",!0),E.attr("data-et","edge"),E.attr("data-id",r.id),E.attr("data-points",b),r.showPoints&&_.forEach(z=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",z.x).attr("cy",z.y)});let I="";(ri().flowchart.arrowMarkerAbsolute||ri().state.arrowMarkerAbsolute)&&(I=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,I=I.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),_t.info("arrowTypeStart",r.arrowTypeStart),_t.info("arrowTypeEnd",r.arrowTypeEnd),UUe(E,r,I,a,i,H);const K=Math.floor(c.length/2),M=c[K];rd.isLabelCoordinateInPath(M,E.attr("d"))||(h=!0);let B={};return h&&(B.updatedPath=c),B.originalPath=r.points,B},"insertEdge");function dse(e,r){if(e.length<2)return"";let n="";const i=e.length,s=1e-5;for(let o=0;o<i;o++){const a=e[o],l=e[o-1],u=e[o+1];if(o===0)n+=`M${a.x},${a.y}`;else if(o===i-1)n+=`L${a.x},${a.y}`;else{const c=a.x-l.x,h=a.y-l.y,p=u.x-a.x,g=u.y-a.y,v=Math.hypot(c,h),b=Math.hypot(p,g);if(v<s||b<s){n+=`L${a.x},${a.y}`;continue}const _=c/v,k=h/v,w=p/b,C=g/b,j=_*w+k*C,T=Math.max(-1,Math.min(1,j)),A=Math.acos(T);if(A<s||Math.abs(Math.PI-A)<s){n+=`L${a.x},${a.y}`;continue}const E=Math.min(r/Math.sin(A/2),v/2,b/2),R=a.x-_*E,P=a.y-k*E,H=a.x+w*E,$=a.y+C*E;n+=`L${R},${P}`,n+=`Q${a.x},${a.y} ${H},${$}`}}return n}X(dse,"generateRoundedPath");function tO(e,r){if(!e||!r)return{angle:0,deltaX:0,deltaY:0};const n=r.x-e.x,i=r.y-e.y;return{angle:Math.atan2(i,n),deltaX:n,deltaY:i}}X(tO,"calculateDeltaAndAngle");function hse(e,r){const n=e.map(s=>({...s}));if(e.length>=2&&ka[r.arrowTypeStart]){const s=ka[r.arrowTypeStart],o=e[0],a=e[1],{angle:l}=tO(o,a),u=s*Math.cos(l),c=s*Math.sin(l);n[0].x=o.x+u,n[0].y=o.y+c}const i=e.length;if(i>=2&&ka[r.arrowTypeEnd]){const s=ka[r.arrowTypeEnd],o=e[i-1],a=e[i-2],{angle:l}=tO(a,o),u=s*Math.cos(l),c=s*Math.sin(l);n[i-1].x=o.x-u,n[i-1].y=o.y-c}return n}X(hse,"applyMarkerOffsetsToPoints");var eVe=X((e,r,n,i)=>{r.forEach(s=>{gVe[s](e,n,i)})},"insertMarkers"),tVe=X((e,r,n)=>{_t.trace("Making markers for ",n),e.append("defs").append("marker").attr("id",n+"_"+r+"-extensionStart").attr("class","marker extension "+r).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-extensionEnd").attr("class","marker extension "+r).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),rVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-compositionStart").attr("class","marker composition "+r).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-compositionEnd").attr("class","marker composition "+r).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),nVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-aggregationStart").attr("class","marker aggregation "+r).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-aggregationEnd").attr("class","marker aggregation "+r).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),iVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-dependencyStart").attr("class","marker dependency "+r).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-dependencyEnd").attr("class","marker dependency "+r).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),sVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-lollipopStart").attr("class","marker lollipop "+r).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",n+"_"+r+"-lollipopEnd").attr("class","marker lollipop "+r).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),oVe=X((e,r,n)=>{e.append("marker").attr("id",n+"_"+r+"-pointEnd").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+r+"-pointStart").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),aVe=X((e,r,n)=>{e.append("marker").attr("id",n+"_"+r+"-circleEnd").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+r+"-circleStart").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),lVe=X((e,r,n)=>{e.append("marker").attr("id",n+"_"+r+"-crossEnd").attr("class","marker cross "+r).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+r+"-crossStart").attr("class","marker cross "+r).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),cVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),uVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-onlyOneStart").attr("class","marker onlyOne "+r).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",n+"_"+r+"-onlyOneEnd").attr("class","marker onlyOne "+r).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),dVe=X((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrOneStart").attr("class","marker zeroOrOne "+r).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const s=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+r).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),s.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),hVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-oneOrMoreStart").attr("class","marker oneOrMore "+r).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",n+"_"+r+"-oneOrMoreEnd").attr("class","marker oneOrMore "+r).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),fVe=X((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+r).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const s=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+r).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),s.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),pVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
|
|
1117
1117
|
L20,10
|
|
1118
1118
|
M20,10
|
|
1119
|
-
L0,20`)},"requirement_arrow"),mVe=X((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),gVe={extension:tVe,composition:rVe,aggregation:nVe,dependency:iVe,lollipop:sVe,point:oVe,circle:aVe,cross:lVe,barb:cVe,only_one:uVe,zero_or_one:dVe,one_or_more:hVe,zero_or_more:fVe,requirement_arrow:pVe,requirement_contains:mVe},yVe=eVe,vVe={common:hS,getConfig:Oa,insertCluster:kUe,insertEdge:QUe,insertEdgeLabel:GUe,insertMarkers:yVe,insertNode:cse,interpolateToCurve:mM,labelHelper:Fr,log:_t,positionEdgeLabel:KUe},$2={},fse=X(e=>{for(const r of e)$2[r.name]=r},"registerLayoutLoaders"),xVe=X(()=>{fse([{name:"dagre",loader:X(async()=>await Ge(()=>import("./dagre-KLK3FWXG-
|
|
1120
|
-
`);const i=FIe(r),s=i.append("g");i.attr("viewBox","0 0 2412 512"),see(i,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),Ose={draw:qqe},Gqe=Ose,Kqe={db:{},renderer:Ose,parser:{parse:X(()=>{},"parse")}},Yqe=Kqe,Rse="flowchart-elk",Xqe=X((e,r={})=>{var n;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="elk"?(r.layout="elk",!0):!1},"detector"),Zqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-
|
|
1119
|
+
L0,20`)},"requirement_arrow"),mVe=X((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),gVe={extension:tVe,composition:rVe,aggregation:nVe,dependency:iVe,lollipop:sVe,point:oVe,circle:aVe,cross:lVe,barb:cVe,only_one:uVe,zero_or_one:dVe,one_or_more:hVe,zero_or_more:fVe,requirement_arrow:pVe,requirement_contains:mVe},yVe=eVe,vVe={common:hS,getConfig:Oa,insertCluster:kUe,insertEdge:QUe,insertEdgeLabel:GUe,insertMarkers:yVe,insertNode:cse,interpolateToCurve:mM,labelHelper:Fr,log:_t,positionEdgeLabel:KUe},$2={},fse=X(e=>{for(const r of e)$2[r.name]=r},"registerLayoutLoaders"),xVe=X(()=>{fse([{name:"dagre",loader:X(async()=>await Ge(()=>import("./dagre-KLK3FWXG-Beok1xve.js"),__vite__mapDeps([47,48,49,50,51,52]),import.meta.url),"loader")},{name:"cose-bilkent",loader:X(async()=>await Ge(()=>import("./cose-bilkent-S5V4N54A-DKjpSdTF.js"),__vite__mapDeps([53,54]),import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");xVe();var U1t=X(async(e,r)=>{if(!(e.layoutAlgorithm in $2))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=$2[e.layoutAlgorithm];return(await n.loader()).render(e,r,vVe,{algorithm:n.algorithm})},"render"),V1t=X((e="",{fallback:r="dagre"}={})=>{if(e in $2)return e;if(r in $2)return _t.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw new Error(`Both layout algorithms ${e} and ${r} are not registered.`)},"getRegisteredLayoutAlgorithm"),bVe=Wre(Object.keys,Object),_Ve=Object.prototype,wVe=_Ve.hasOwnProperty;function SVe(e){if(!zj(e))return bVe(e);var r=[];for(var n in Object(e))wVe.call(e,n)&&n!="constructor"&&r.push(n);return r}var rO=D0(wd,"DataView"),nO=D0(wd,"Promise"),iO=D0(wd,"Set"),sO=D0(wd,"WeakMap"),_F="[object Map]",kVe="[object Object]",wF="[object Promise]",SF="[object Set]",kF="[object WeakMap]",CF="[object DataView]",CVe=$0(rO),jVe=$0(P2),TVe=$0(nO),NVe=$0(iO),EVe=$0(sO),Lg=L0;(rO&&Lg(new rO(new ArrayBuffer(1)))!=CF||P2&&Lg(new P2)!=_F||nO&&Lg(nO.resolve())!=wF||iO&&Lg(new iO)!=SF||sO&&Lg(new sO)!=kF)&&(Lg=function(e){var r=L0(e),n=r==kVe?e.constructor:void 0,i=n?$0(n):"";if(i)switch(i){case CVe:return CF;case jVe:return _F;case TVe:return wF;case NVe:return SF;case EVe:return kF}return r});var AVe="[object Map]",OVe="[object Set]",RVe=Object.prototype,MVe=RVe.hasOwnProperty;function jF(e){if(e==null)return!0;if(Fj(e)&&(M5(e)||typeof e=="string"||typeof e.splice=="function"||fM(e)||pM(e)||R5(e)))return!e.length;var r=Lg(e);if(r==AVe||r==OVe)return!e.size;if(zj(e))return!SVe(e).length;for(var n in e)if(MVe.call(e,n))return!1;return!0}var pse="c4",PVe=X(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),LVe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./c4Diagram-IC4MRINW-DysDeHPS.js");return{diagram:r}},__vite__mapDeps([55,56]),import.meta.url);return{id:pse,diagram:e}},"loader"),$Ve={id:pse,detector:PVe,loader:LVe},DVe=$Ve,mse="flowchart",IVe=X((e,r)=>{var n,i;return((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"||((i=r==null?void 0:r.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),BVe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-BpVDS62R.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:mse,diagram:e}},"loader"),zVe={id:mse,detector:IVe,loader:BVe},FVe=zVe,gse="flowchart-v2",HVe=X((e,r)=>{var n,i,s;return((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="dagre-d3"?!1:(((i=r==null?void 0:r.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(r.layout="elk"),/^\s*graph/.test(e)&&((s=r==null?void 0:r.flowchart)==null?void 0:s.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),WVe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-BpVDS62R.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:gse,diagram:e}},"loader"),UVe={id:gse,detector:HVe,loader:WVe},VVe=UVe,yse="er",qVe=X(e=>/^\s*erDiagram/.test(e),"detector"),GVe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./erDiagram-INFDFZHY-D68qu6h_.js");return{diagram:r}},__vite__mapDeps([62,59,60,61]),import.meta.url);return{id:yse,diagram:e}},"loader"),KVe={id:yse,detector:qVe,loader:GVe},YVe=KVe,vse="gitGraph",XVe=X(e=>/^\s*gitGraph/.test(e),"detector"),ZVe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./gitGraphDiagram-K3NZZRJ6-CvBRSFlf.js");return{diagram:r}},__vite__mapDeps([63,64,65,66,49,51,52]),import.meta.url);return{id:vse,diagram:e}},"loader"),JVe={id:vse,detector:XVe,loader:ZVe},QVe=JVe,xse="gantt",eqe=X(e=>/^\s*gantt/.test(e),"detector"),tqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./ganttDiagram-A5KZAMGK-DBKzQhCL.js");return{diagram:r}},__vite__mapDeps([67,68,69]),import.meta.url);return{id:xse,diagram:e}},"loader"),rqe={id:xse,detector:eqe,loader:tqe},nqe=rqe,bse="info",iqe=X(e=>/^\s*info/.test(e),"detector"),sqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./infoDiagram-LFFYTUFH-Ly3-UMJR.js");return{diagram:r}},__vite__mapDeps([70,66,49,51,52]),import.meta.url);return{id:bse,diagram:e}},"loader"),oqe={id:bse,detector:iqe,loader:sqe},_se="pie",aqe=X(e=>/^\s*pie/.test(e),"detector"),lqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./pieDiagram-SKSYHLDU-BkqY9oKT.js");return{diagram:r}},__vite__mapDeps([71,64,66,49,51,52,72]),import.meta.url);return{id:_se,diagram:e}},"loader"),cqe={id:_se,detector:aqe,loader:lqe},wse="quadrantChart",uqe=X(e=>/^\s*quadrantChart/.test(e),"detector"),dqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./quadrantDiagram-337W2JSQ-CenWciwP.js");return{diagram:r}},__vite__mapDeps([73,68,69]),import.meta.url);return{id:wse,diagram:e}},"loader"),hqe={id:wse,detector:uqe,loader:dqe},fqe=hqe,Sse="xychart",pqe=X(e=>/^\s*xychart(-beta)?/.test(e),"detector"),mqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./xychartDiagram-JWTSCODW-CpJYzW_t.js");return{diagram:r}},__vite__mapDeps([74,68,69]),import.meta.url);return{id:Sse,diagram:e}},"loader"),gqe={id:Sse,detector:pqe,loader:mqe},yqe=gqe,kse="requirement",vqe=X(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),xqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./requirementDiagram-Z7DCOOCP-D6yUwSQW.js");return{diagram:r}},__vite__mapDeps([75,59,60]),import.meta.url);return{id:kse,diagram:e}},"loader"),bqe={id:kse,detector:vqe,loader:xqe},_qe=bqe,Cse="sequence",wqe=X(e=>/^\s*sequenceDiagram/.test(e),"detector"),Sqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./sequenceDiagram-2WXFIKYE-BZ1AXjDr.js");return{diagram:r}},__vite__mapDeps([76,56,65]),import.meta.url);return{id:Cse,diagram:e}},"loader"),kqe={id:Cse,detector:wqe,loader:Sqe},Cqe=kqe,jse="class",jqe=X((e,r)=>{var n;return((n=r==null?void 0:r.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),Tqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./classDiagram-VBA2DB6C-Dibm0i7y.js");return{diagram:r}},__vite__mapDeps([77,78,58,56,59,60]),import.meta.url);return{id:jse,diagram:e}},"loader"),Nqe={id:jse,detector:jqe,loader:Tqe},Eqe=Nqe,Tse="classDiagram",Aqe=X((e,r)=>{var n;return/^\s*classDiagram/.test(e)&&((n=r==null?void 0:r.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),Oqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./classDiagram-v2-RAHNMMFH-Dibm0i7y.js");return{diagram:r}},__vite__mapDeps([79,78,58,56,59,60]),import.meta.url);return{id:Tse,diagram:e}},"loader"),Rqe={id:Tse,detector:Aqe,loader:Oqe},Mqe=Rqe,Nse="state",Pqe=X((e,r)=>{var n;return((n=r==null?void 0:r.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),Lqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./stateDiagram-RAJIS63D-BYZ5MN-_.js");return{diagram:r}},__vite__mapDeps([80,81,59,60,48,49,50,51]),import.meta.url);return{id:Nse,diagram:e}},"loader"),$qe={id:Nse,detector:Pqe,loader:Lqe},Dqe=$qe,Ese="stateDiagram",Iqe=X((e,r)=>{var n;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((n=r==null?void 0:r.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper")},"detector"),Bqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./stateDiagram-v2-FVOUBMTO-D_zSXFIT.js");return{diagram:r}},__vite__mapDeps([82,81,59,60]),import.meta.url);return{id:Ese,diagram:e}},"loader"),zqe={id:Ese,detector:Iqe,loader:Bqe},Fqe=zqe,Ase="journey",Hqe=X(e=>/^\s*journey/.test(e),"detector"),Wqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./journeyDiagram-4ABVD52K-BU00tgXX.js");return{diagram:r}},__vite__mapDeps([83,58,56,72]),import.meta.url);return{id:Ase,diagram:e}},"loader"),Uqe={id:Ase,detector:Hqe,loader:Wqe},Vqe=Uqe,qqe=X((e,r,n)=>{_t.debug(`rendering svg for syntax error
|
|
1120
|
+
`);const i=FIe(r),s=i.append("g");i.attr("viewBox","0 0 2412 512"),see(i,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),Ose={draw:qqe},Gqe=Ose,Kqe={db:{},renderer:Ose,parser:{parse:X(()=>{},"parse")}},Yqe=Kqe,Rse="flowchart-elk",Xqe=X((e,r={})=>{var n;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="elk"?(r.layout="elk",!0):!1},"detector"),Zqe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-BpVDS62R.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:Rse,diagram:e}},"loader"),Jqe={id:Rse,detector:Xqe,loader:Zqe},Qqe=Jqe,Mse="timeline",eGe=X(e=>/^\s*timeline/.test(e),"detector"),tGe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./timeline-definition-YZTLITO2-DXHUGIi-.js");return{diagram:r}},__vite__mapDeps([84,72]),import.meta.url);return{id:Mse,diagram:e}},"loader"),rGe={id:Mse,detector:eGe,loader:tGe},nGe=rGe,Pse="mindmap",iGe=X(e=>/^\s*mindmap/.test(e),"detector"),sGe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./mindmap-definition-YRQLILUH-DOYbhQzM.js");return{diagram:r}},__vite__mapDeps([85,59,60]),import.meta.url);return{id:Pse,diagram:e}},"loader"),oGe={id:Pse,detector:iGe,loader:sGe},aGe=oGe,Lse="kanban",lGe=X(e=>/^\s*kanban/.test(e),"detector"),cGe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./kanban-definition-K7BYSVSG-CwSnU5Qv.js");return{diagram:r}},__vite__mapDeps([86,58]),import.meta.url);return{id:Lse,diagram:e}},"loader"),uGe={id:Lse,detector:lGe,loader:cGe},dGe=uGe,$se="sankey",hGe=X(e=>/^\s*sankey(-beta)?/.test(e),"detector"),fGe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./sankeyDiagram-WA2Y5GQK-zqzGSEUy.js");return{diagram:r}},[],import.meta.url);return{id:$se,diagram:e}},"loader"),pGe={id:$se,detector:hGe,loader:fGe},mGe=pGe,Dse="packet",gGe=X(e=>/^\s*packet(-beta)?/.test(e),"detector"),yGe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./diagram-P4PSJMXO-BBR8On_g.js");return{diagram:r}},__vite__mapDeps([87,64,66,49,51,52]),import.meta.url);return{id:Dse,diagram:e}},"loader"),vGe={id:Dse,detector:gGe,loader:yGe},Ise="radar",xGe=X(e=>/^\s*radar-beta/.test(e),"detector"),bGe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./diagram-IFDJBPK2-pRXXJopV.js");return{diagram:r}},__vite__mapDeps([88,64,66,49,51,52]),import.meta.url);return{id:Ise,diagram:e}},"loader"),_Ge={id:Ise,detector:xGe,loader:bGe},Bse="block",wGe=X(e=>/^\s*block(-beta)?/.test(e),"detector"),SGe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./blockDiagram-WCTKOSBZ-BgA4E7gt.js");return{diagram:r}},__vite__mapDeps([89,58,52,49,48,61]),import.meta.url);return{id:Bse,diagram:e}},"loader"),kGe={id:Bse,detector:wGe,loader:SGe},CGe=kGe,zse="architecture",jGe=X(e=>/^\s*architecture/.test(e),"detector"),TGe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./architectureDiagram-2XIMDMQ5-UqF6qgDi.js");return{diagram:r}},__vite__mapDeps([90,64,66,49,51,52,54]),import.meta.url);return{id:zse,diagram:e}},"loader"),NGe={id:zse,detector:jGe,loader:TGe},EGe=NGe,Fse="ishikawa",AGe=X(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),OGe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./ishikawaDiagram-PHBUUO56-C3qLfmyu.js");return{diagram:r}},[],import.meta.url);return{id:Fse,diagram:e}},"loader"),RGe={id:Fse,detector:AGe,loader:OGe},Hse="venn",MGe=X(e=>/^\s*venn-beta/.test(e),"detector"),PGe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./vennDiagram-LZ73GAT5-D_yIv7Ug.js");return{diagram:r}},[],import.meta.url);return{id:Hse,diagram:e}},"loader"),LGe={id:Hse,detector:MGe,loader:PGe},$Ge=LGe,Wse="treemap",DGe=X(e=>/^\s*treemap/.test(e),"detector"),IGe=X(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:r}=await import("./diagram-E7M64L7V-CH8hwKTm.js");return{diagram:r}},__vite__mapDeps([91,60,64,66,49,51,52,69]),import.meta.url);return{id:Wse,diagram:e}},"loader"),BGe={id:Wse,detector:DGe,loader:IGe},TF=!1,Yj=X(()=>{TF||(TF=!0,p5("error",Yqe,e=>e.toLowerCase().trim()==="error"),p5("---",{db:{clear:X(()=>{},"clear")},styles:{},renderer:{draw:X(()=>{},"draw")},parser:{parse:X(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:X(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),hA(Qqe,aGe,EGe),hA(DVe,dGe,Mqe,Eqe,YVe,nqe,oqe,cqe,_qe,Cqe,VVe,FVe,nGe,QVe,Fqe,Dqe,Vqe,fqe,mGe,vGe,yqe,CGe,_Ge,RGe,BGe,$Ge))},"addDiagrams"),zGe=X(async()=>{_t.debug("Loading registered diagrams");const r=(await Promise.allSettled(Object.entries(f0).map(async([n,{detector:i,loader:s}])=>{if(s)try{gA(n)}catch{try{const{diagram:o,id:a}=await s();p5(a,o,i)}catch(o){throw _t.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete f0[n],o}}}))).filter(n=>n.status==="rejected");if(r.length>0){_t.error(`Failed to load ${r.length} external diagrams`);for(const n of r)_t.error(n);throw new Error(`Failed to load ${r.length} external diagrams`)}},"loadRegisteredDiagrams"),FGe="graphics-document document";function Use(e,r){e.attr("role",FGe),r!==""&&e.attr("aria-roledescription",r)}X(Use,"setA11yDiagramInfo");function Vse(e,r,n,i){if(e.insert!==void 0){if(n){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(n)}if(r){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(r)}}}X(Vse,"addSVGa11yTitleDescription");var n0,oO=(n0=class{constructor(r,n,i,s,o){this.type=r,this.text=n,this.db=i,this.parser=s,this.renderer=o}static async fromText(r,n={}){var c,h;const i=Oa(),s=$R(r,i);r=UHe(r)+`
|
|
1121
1121
|
`;try{gA(s)}catch{const p=RMe(s);if(!p)throw new VQ(`Diagram ${s} not found.`);const{id:g,diagram:v}=await p();p5(g,v)}const{db:o,parser:a,renderer:l,init:u}=gA(s);return a.parser&&(a.parser.yy=o),(c=o.clear)==null||c.call(o),u==null||u(i),n.title&&((h=o.setDiagramTitle)==null||h.call(o,n.title)),await a.parse(r),new n0(s,r,o,a,l)}async render(r,n){await this.renderer.draw(this.text,r,n,this)}getParser(){return this.parser}getType(){return this.type}},X(n0,"Diagram"),n0),NF=[],HGe=X(()=>{NF.forEach(e=>{e()}),NF=[]},"attachFunctions"),WGe=X(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function qse(e){const r=e.match(UQ);if(!r)return{text:e,metadata:{}};let n=KBe(r[1],{schema:GBe})??{};n=typeof n=="object"&&!Array.isArray(n)?n:{};const i={};return n.displayMode&&(i.displayMode=n.displayMode.toString()),n.title&&(i.title=n.title.toString()),n.config&&(i.config=n.config),{text:e.slice(r[0].length),metadata:i}}X(qse,"extractFrontMatter");var UGe=X(e=>e.replace(/\r\n?/g,`
|
|
1122
1122
|
`).replace(/<(\w+)([^>]*)>/g,(r,n,i)=>"<"+n+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),VGe=X(e=>{const{text:r,metadata:n}=qse(e),{displayMode:i,title:s,config:o={}}=n;return i&&(o.gantt||(o.gantt={}),o.gantt.displayMode=i),{title:s,config:o,text:r}},"processFrontmatter"),qGe=X(e=>{const r=rd.detectInit(e)??{},n=rd.detectDirective(e,"wrap");return Array.isArray(n)?r.wrap=n.some(({type:i})=>i==="wrap"):(n==null?void 0:n.type)==="wrap"&&(r.wrap=!0),{text:OHe(e),directive:r}},"processDirectives");function $M(e){const r=UGe(e),n=VGe(r),i=qGe(n.text),s=bM(n.config,i.directive);return e=WGe(i.text),{code:e,title:n.title,config:s}}X($M,"preprocessDiagram");function Gse(e){const r=new TextEncoder().encode(e),n=Array.from(r,i=>String.fromCodePoint(i)).join("");return btoa(n)}X(Gse,"toBase64");var GGe=5e4,KGe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",YGe="sandbox",XGe="loose",ZGe="http://www.w3.org/2000/svg",JGe="http://www.w3.org/1999/xlink",QGe="http://www.w3.org/1999/xhtml",eKe="100%",tKe="100%",rKe="border:0;margin:0;",nKe="margin:0",iKe="allow-top-navigation-by-user-activation allow-popups",sKe='The "iframe" tag is not supported by your browser.',oKe=["foreignobject"],aKe=["dominant-baseline"];function DM(e){const r=$M(e);return h5(),KMe(r.config??{}),r}X(DM,"processAndSetConfigs");async function Kse(e,r){Yj();try{const{code:n,config:i}=DM(e);return{diagramType:(await Xse(n)).type,config:i}}catch(n){if(r!=null&&r.suppressErrors)return!1;throw n}}X(Kse,"parse");var EF=X((e,r,n=[])=>`
|
|
1123
1123
|
.${e} ${r} { ${n.join(" !important; ")} !important; }`,"cssImportantStyles"),lKe=X((e,r=new Map)=>{let n="";if(e.themeCSS!==void 0&&(n+=`
|
|
@@ -1153,7 +1153,7 @@ ${e.themeCSS}`),e.fontFamily!==void 0&&(n+=`
|
|
|
1153
1153
|
`).trim():"",u=s>=0?r.slice(s+1).map(p=>p.trim()).filter(Boolean):[];return d.jsxs("div",{className:"space-y-2 rounded-md border bg-muted/20 p-3 text-xs",children:[d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold text-foreground/90",children:"Browser snapshot"}),i?d.jsx("div",{className:"text-muted-foreground",children:i}):null,n?d.jsx("div",{className:"font-mono text-xs break-all",children:n}):null]}),d.jsxs("div",{children:[d.jsx("div",{className:"mb-1 text-xs uppercase tracking-wide text-muted-foreground",children:"Text"}),d.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded bg-background p-2 font-mono text-xs leading-5",children:l||"(no textual content)"})]}),d.jsxs("div",{children:[d.jsx("div",{className:"mb-1 text-xs uppercase tracking-wide text-muted-foreground",children:"Interactive elements"}),u.length?d.jsx("ul",{className:"max-h-40 space-y-1 overflow-auto rounded bg-background p-2 font-mono text-xs",children:u.map((p,g)=>d.jsx("li",{className:"break-all",children:p},`${p}-${g}`))}):d.jsx("div",{className:"rounded bg-background p-2 text-muted-foreground",children:"No interactive elements found."})]})]})}function YYe({path:e}){const[r,n]=y.useState(!1),[i,s]=y.useState(!1),o=e.trim(),a=koe(o)??`${Mn()}/api/browser/screenshot?path=${encodeURIComponent(o)}`;return d.jsxs("div",{className:"space-y-2 rounded-md bg-muted/30 p-3 text-xs",children:[d.jsxs("div",{className:"text-xs text-muted-foreground",children:["Screenshot path: ",d.jsx("span",{className:"font-mono break-all",children:o})]}),d.jsxs("div",{className:"group relative overflow-hidden rounded-md bg-background/90 ring-1 ring-inset ring-border/35",children:[d.jsx("img",{src:a,alt:"Browser screenshot",className:"max-h-80 w-full cursor-pointer object-contain transition-opacity group-hover:opacity-80",onLoad:()=>n(!0),onError:()=>n(!1),onClick:()=>r&&s(!0)}),r&&d.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",children:d.jsx("span",{className:"rounded-full bg-black/60 px-3 py-1.5 text-xs font-medium text-white",children:"Click to expand"})})]}),!r&&d.jsx("div",{className:"rounded bg-background p-2 text-muted-foreground",children:"Preview unavailable in browser. Open the screenshot path directly from the host environment."}),i&&d.jsx(Yf,{open:!0,onOpenChange:l=>!l&&s(!1),children:d.jsx(Oh,{className:"max-w-[90vw] max-h-[90vh] p-2",showCloseButton:!0,children:d.jsx("img",{src:a,alt:"Browser screenshot",className:"max-h-[85vh] w-full object-contain"})})})]})}function vC(e){var i;const r=typeof e.args.terminalId=="string"?e.args.terminalId:null;if(r)return r;const n=(i=e.result)==null?void 0:i.data;if(n&&typeof n=="object"){const s=n,o=typeof s.terminalId=="string"?s.terminalId:null;if(o)return o;const a=typeof s.id=="string"?s.id:null;if(a)return a;const l=typeof s.surfaceId=="string"?s.surfaceId:null;if(l)return l}return null}function XYe(e){var n;const r=Da(e.tool);if(r==="surfaces.start"){if(e.args.type==="terminal")return vC(e)!==null;const i=(n=e.result)==null?void 0:n.data;return i&&typeof i=="object"&&i.type==="terminal"?vC(e)!==null:!1}return r==="execute"||r.startsWith("terminal.")?vC(e)!==null:!1}function Moe(e){if(!e)return null;const r=e.match(/"command"\s*:\s*"((?:[^"\\]|\\.)*)/);return r?r[1].replace(/\\n/g,`
|
|
1154
1154
|
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\"):null}function eu(e,r){if(!e)return null;const n=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`"${n}"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)`),s=e.match(i);return s?s[1].replace(/\\n/g,`
|
|
1155
1155
|
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\"):null}function Poe(e){if(!e)return null;const r=eu(e,"url")??eu(e,"uri")??eu(e,"href")??eu(e,"query")??eu(e,"q");if(r)return If(r)??r;const n=eu(e,"type"),i=eu(e,"action");return n==="webSearch"||i==="webSearch"?"web search":n==="fetch"||i==="fetch"?"website":null}function ZYe({tool:e,streamingArgs:r}){const n=Da(e),i=Eoe[n],s=n.startsWith("terminal."),o=s?Moe(r):null,a=n==="web"||n==="web.search"||n==="web.fetch"||n==="browser.search"||n==="browser.fetch",l=a?Poe(r):null;return i&&s&&o?d.jsxs("span",{className:"inline-flex max-w-full min-w-0 items-center gap-1.5 text-foreground",children:[d.jsx("span",{className:"shrink-0 text-xs text-emerald-500 dark:text-emerald-400 font-mono",children:"$"}),d.jsx("code",{className:"min-w-0 truncate text-xs font-mono",children:o}),d.jsx("span",{className:"inline-block w-1 h-3.5 bg-blue-400 animate-pulse ml-0.5 align-text-bottom"})]}):i&&a&&l?d.jsxs("span",{className:"inline-flex max-w-full min-w-0 items-center gap-1.5 text-foreground",children:[d.jsxs("span",{children:[i.label,":"]}),d.jsx("code",{className:"min-w-0 truncate text-xs font-mono",children:l}),d.jsx("span",{className:"inline-block w-1 h-3.5 bg-blue-400 animate-pulse ml-0.5 align-text-bottom"})]}):i?d.jsxs("span",{className:"text-blue-400",children:[i.label,d.jsx("span",{className:"inline-block w-1 h-3 bg-blue-400 animate-pulse ml-1 align-text-bottom"})]}):e?d.jsxs("span",{className:"text-blue-400",children:[d.jsx("code",{className:"text-xs font-mono",children:e}),d.jsx("span",{className:"inline-block w-1 h-3 bg-blue-400 animate-pulse ml-0.5 align-text-bottom"})]}):d.jsx("span",{className:"text-muted-foreground",children:"Preparing..."})}function JYe({tool:e,streamingArgs:r,scrollRef:n}){const i=Da(e),s=i.startsWith("terminal."),o=s?Moe(r):null,a=i==="web"||i==="web.search"||i==="web.fetch"||i==="browser.search"||i==="browser.fetch",l=a?Poe(r):null;if(s&&o)return d.jsxs("pre",{ref:n,className:qe("text-xs font-mono leading-5 rounded-md px-3 py-2 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap break-all","bg-muted/40 text-foreground"),children:[d.jsx("span",{className:"text-emerald-400",children:"$ "}),o,d.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-blue-400 animate-pulse ml-0.5 align-text-bottom"})]});if(a&&l){const u=i==="web.search"||i==="browser.search"?"Searching":"Fetching";return d.jsx("div",{className:qe("rounded-md border px-3 py-2 text-xs","bg-muted/40 text-foreground"),children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ir,{className:"h-3 w-3 animate-spin text-blue-400"}),d.jsxs("span",{children:[u," ",l,"..."]})]})})}if(i==="memory.save"){const u=eu(r,"scope")??"memory",c=eu(r,"content");return d.jsxs("div",{className:qe("rounded-md border px-3 py-2 text-xs","bg-muted/40 text-foreground"),children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ir,{className:"h-3 w-3 animate-spin text-blue-400"}),d.jsxs("span",{children:["Saving memory (",u,")..."]})]}),c?d.jsxs("div",{className:"mt-1 opacity-80",children:['"',nd(c,120),'"']}):null]})}if(i==="cron.add"){const u=eu(r,"name"),c=eu(r,"cron"),h=eu(r,"toolName");return d.jsxs("div",{className:qe("rounded-md border px-3 py-2 text-xs","bg-muted/40 text-foreground"),children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ir,{className:"h-3 w-3 animate-spin text-blue-400"}),d.jsxs("span",{children:["Creating cron job",u?`: ${u}`:"..."]})]}),(c||h)&&d.jsxs("div",{className:"mt-1 opacity-80",children:[c?`schedule ${c}`:"",c&&h?" • ":"",h?`tool ${h}`:""]})]})}return r?d.jsxs("pre",{ref:n,className:qe("text-xs font-mono leading-5 rounded-md px-3 py-2 overflow-x-auto max-h-36 overflow-y-auto whitespace-pre-wrap break-all","bg-muted/40 text-muted-foreground"),children:[r,d.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-blue-400 animate-pulse ml-0.5 align-text-bottom"})]}):d.jsx("div",{className:qe("rounded-md border px-3 py-2 text-xs","bg-muted/40 text-foreground"),children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ir,{className:"h-3 w-3 animate-spin text-blue-400"}),d.jsx("span",{children:"Preparing..."})]})})}function Loe(e){const r=new Map,n=new Set;for(let i=0;i<e.length;i++){const s=e[i];if(Da(s.tool)!=="agent")continue;const o=[];for(let a=i+1;a<e.length;a++){const l=e[a];if(n.has(l.callId))continue;const u=s.status==="running"||s.status==="pending",c=s.completedAt!=null&&l.startedAt<=s.completedAt;if(u||c)o.push(l),n.add(l.callId);else break}o.length>0&&r.set(s.callId,o)}return{childMap:r,parentSet:n}}function $oe(e){return e==="browserScreenshot"}function Doe(e){var o,a;const r=Da(e.tool),n=(o=e.result)!=null&&o.data&&typeof e.result.data=="object"?e.result.data:void 0,i=cu(r,e.args,n),s=Toe(r,i,n,(a=e.result)==null?void 0:a.message);return $oe(Noe({tool:r,args:i,status:e.status,displayOutput:Roe(e.result,r)||e.streamingOutput||"",snapshotText:typeof(n==null?void 0:n.snapshot)=="string"?n.snapshot:null,screenshotPath:s}))}function QYe({path:e,onOpenDiff:r,disabled:n}){const i=UM(e),s=!!r&&!n,o=d.jsxs(d.Fragment,{children:[d.jsx(bo,{filename:i,className:"h-3.5 w-3.5 shrink-0"}),d.jsx("span",{className:"max-w-[220px] truncate",children:i})]});return s?d.jsx("span",{role:"button",tabIndex:0,className:"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground transition-colors hover:bg-muted cursor-pointer",title:`Open diff for ${e}`,onClick:a=>{a.preventDefault(),a.stopPropagation(),r(e)},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),a.stopPropagation(),r(e))},children:o}):d.jsx("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground",title:e,children:o})}function eXe({call:e,childCalls:r,onOpenTerminal:n,onOpenDiff:i}){var te,ae,ge,le,Je,Ze,De,re,Te;const s=Doe(e),[o,a]=y.useState(e.status==="running"||e.status==="pending"||s),[l,u]=y.useState(()=>Date.now()),c=y.useRef(e.status),h=Da(e.tool),p=(te=e.result)!=null&&te.data&&typeof e.result.data=="object"?e.result.data:void 0,g=cu(h,e.args,p),v=h==="mcp-tool"?WM(g,p):null,b=v?OYe(v.title):null,_=Aoe(h),k=(b==null?void 0:b.icon)??_.icon,w=(b==null?void 0:b.color)??_.color,C=DYe(h,g,p,(ae=e.result)==null?void 0:ae.message),j=yO(h,g),A=Roe(e.result,h)||e.streamingOutput||"",E=typeof(p==null?void 0:p.snapshot)=="string"?p.snapshot:null,R=Toe(h,g,p,(ge=e.result)==null?void 0:ge.message),P=h.startsWith("terminal.")||h==="execute",H=qYe(e),$=XYe(e),U=$?vC(e):null,I=UYe(h,g),K=e.status==="pending",M=((Je=gO(h,g,p,(le=e.result)==null?void 0:le.message))==null?void 0:Je.trim())??"",B=!!M&&PYe(h),L=eH(A),z=eH(e.streamingArgs),W=Noe({tool:h,args:g,status:e.status,displayOutput:A,snapshotText:E,screenshotPath:R}),Y=$oe(W),F=W==="terminal"?!0:W!=="none"&&!Y,q=e.status==="pending"||e.status==="running"?ir:e.status==="success"?yc:wh,J=e.status==="pending"?"text-blue-400":e.status==="running"?"text-muted-foreground":e.status==="success"?"text-green-500":"text-red-500";y.useEffect(()=>{const _e=c.current;!Y&&(_e==="running"||_e==="pending")&&e.status!=="running"&&e.status!=="pending"&&a(!1),(e.status==="pending"||e.status==="running"||Y)&&a(!0),c.current=e.status},[e.status,Y]),y.useEffect(()=>{var _e;h!=="web"&&h!=="web.search"&&h!=="web.fetch"&&h!=="browser.search"&&h!=="browser.fetch"||console.debug("[tool-call-card:web]",{tool:e.tool,normalizedTool:h,callId:e.callId,status:e.status,rawArgs:e.args,normalizedArgs:g,resultMessage:(_e=e.result)==null?void 0:_e.message,resultData:p,streamingArgs:e.streamingArgs})},[e.args,e.callId,(Ze=e.result)==null?void 0:Ze.message,e.status,e.streamingArgs,e.tool,g,h,p]),y.useEffect(()=>{if(e.status!=="running"&&e.status!=="pending")return;const _e=window.setInterval(()=>u(Date.now()),250);return()=>window.clearInterval(_e)},[e.status]);const V=AYe(h,g,p,(De=e.result)==null?void 0:De.message),ne=e.status==="running"||e.status==="pending"?V.running:V.done,de=d.jsxs(d.Fragment,{children:[d.jsx(q,{className:qe("h-4 w-4 shrink-0",J,(e.status==="running"||e.status==="pending")&&"animate-spin")}),d.jsx(k,{className:qe("h-4 w-4 shrink-0",w)}),d.jsx("span",{className:"text-sm font-medium text-muted-foreground truncate flex-1",children:K?d.jsx(ZYe,{tool:e.tool,streamingArgs:e.streamingArgs}):P?d.jsxs("span",{className:"inline-flex max-w-full min-w-0 items-center gap-1.5 text-foreground",children:[d.jsx("span",{className:"shrink-0 text-xs text-emerald-500 dark:text-emerald-400 font-mono",children:"$"}),d.jsx("code",{className:"min-w-0 truncate text-xs font-mono",title:C,children:C})]}):B?d.jsxs("span",{className:"inline-flex min-w-0 max-w-full items-center gap-2",children:[d.jsxs("span",{children:[ne,":"]}),d.jsx(QYe,{path:M,onOpenDiff:i,disabled:e.status!=="success"})]}):v&&(v.title||v.details)?d.jsxs("span",{className:"inline-flex min-w-0 max-w-full items-center gap-2",children:[d.jsxs("span",{children:[ne,":"]}),d.jsxs("span",{className:"min-w-0 truncate",children:[v.title?d.jsx("code",{className:"text-xs font-mono",children:v.title}):null,v.title&&v.details?d.jsx("span",{className:"text-muted-foreground",children:" • "}):null,v.details?d.jsx("span",{className:"text-xs text-muted-foreground",children:v.details}):null]})]}):d.jsxs("span",{children:[ne,": ",d.jsx("code",{className:"text-xs font-mono",children:C})]})}),d.jsx("span",{className:"text-xs text-muted-foreground/60 tabular-nums shrink-0",children:d.jsx(xO,{startedAt:e.startedAt,completedAt:e.completedAt,now:l})}),j&&d.jsx("span",{className:"rounded border border-blue-500/25 bg-blue-500/10 px-1.5 py-0.5 text-2xs font-semibold tabular-nums text-blue-500 shrink-0",children:j}),H&&d.jsx("span",{className:qe("rounded border px-1.5 py-0.5 text-2xs font-semibold uppercase tracking-wide shrink-0",H.className),children:H.label})]}),fe=W==="pending"?d.jsx(JYe,{tool:e.tool,streamingArgs:e.streamingArgs,scrollRef:z}):W==="terminal"?d.jsxs("pre",{ref:L,className:qe("text-xs font-mono leading-5 rounded-md px-3 py-2 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap break-all","bg-muted/40 text-foreground",e.result&&!e.result.ok&&"text-red-500 dark:text-red-400"),children:[!A&&e.status!=="running"&&d.jsxs("span",{className:"text-muted-foreground",children:[d.jsx("span",{className:"text-emerald-500 dark:text-emerald-400",children:"$ "}),C]}),A,e.status==="running"&&!A&&d.jsx("span",{className:"text-muted-foreground",children:"Running..."}),e.status==="running"&&d.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-foreground animate-pulse ml-0.5 align-text-bottom"})]}):W==="browserSnapshot"?d.jsx(KYe,{snapshot:E}):W==="browserScreenshot"?d.jsx(YYe,{path:R}):W==="subagent"?r&&r.length>0?d.jsxs("div",{className:"rounded-lg border border-purple-500/20 bg-purple-500/[0.03] text-xs",children:[(e.status==="running"||e.status==="pending")&&r.length>0&&d.jsxs("div",{className:"flex items-center justify-end gap-2 border-b border-purple-500/15 px-3 py-2 text-xs text-muted-foreground",children:[d.jsx(ir,{className:"h-3 w-3 animate-spin text-purple-500"}),d.jsxs("span",{children:[r.length," tool",r.length!==1?"s":""]})]}),(e.status==="running"||e.status==="pending")&&r.length===0&&d.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Agent is working..."}),d.jsx("div",{className:"divide-y divide-border/30",children:r.map(_e=>d.jsx(Bf,{call:_e,onOpenTerminal:n,onOpenDiff:i},_e.callId))}),((re=e.result)==null?void 0:re.message)&&(e.status==="success"||e.status==="error")&&d.jsxs("div",{className:"border-t border-purple-500/15 px-3 py-2",children:[d.jsx("div",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"Result"}),d.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-background/60 p-2 font-mono text-xs leading-5",children:e.result.message})]})]}):d.jsx(GYe,{data:p??{},message:(Te=e.result)==null?void 0:Te.message,status:e.status}):W==="editDiff"?d.jsx(_Ye,{filePath:String(g.path??""),oldText:h==="file.patch"||h==="edit"&&g.search!=null?String(g.search??""):void 0,newText:h==="file.patch"||h==="edit"&&g.replace!=null?String(g.replace??""):void 0,writtenContent:h==="file.write"||h==="edit"&&g.content!=null?String(g.content??""):void 0,isNewFile:h==="file.write"}):W==="output"?d.jsxs("pre",{className:qe("text-xs font-mono leading-5 rounded-md px-3 py-2 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap break-all","bg-muted/40 text-foreground",e.result&&!e.result.ok&&"text-red-500 dark:text-red-400"),children:[A,e.status==="running"&&d.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-foreground animate-pulse ml-0.5 align-text-bottom"})]}):W==="runningHint"?d.jsxs("div",{className:qe("rounded-md border px-3 py-2 text-xs","bg-muted/40 text-foreground"),children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ir,{className:"h-3 w-3 animate-spin"}),d.jsx("span",{children:I})]}),d.jsxs("div",{className:"mt-1 text-xs opacity-75",children:["Elapsed: ",d.jsx(xO,{startedAt:e.startedAt,completedAt:e.completedAt,now:l})]})]}):null;return d.jsxs(gj,{open:F?o:!1,onOpenChange:a,children:[d.jsxs("div",{className:"group flex items-center gap-2 rounded-md px-3 py-2 hover:bg-muted/50 transition-colors",children:[F?d.jsxs(yj,{className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[d.jsx(No,{className:qe("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform duration-200",o&&"rotate-90")}),de]}):d.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[d.jsx("span",{className:"h-3.5 w-3.5 shrink-0"}),de]}),$&&n&&d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(ke,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:_e=>{_e.preventDefault(),_e.stopPropagation(),n(U)},children:d.jsx(wm,{className:"h-3.5 w-3.5"})})}),d.jsx(xn,{side:"top",children:"Open terminal"})]}),W==="editDiff"&&i&&e.status==="success"&&M&&d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(ke,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:_e=>{_e.preventDefault(),_e.stopPropagation(),i(M)},children:d.jsx(wm,{className:"h-3.5 w-3.5"})})}),d.jsx(xn,{side:"top",children:"Open diff in editor"})]})]}),F&&d.jsx(vj,{children:d.jsx("div",{className:"ml-[3.25rem] mr-3 mb-2",children:fe})}),Y&&d.jsx("div",{className:"ml-[3.25rem] mr-3 mb-2",children:fe})]})}const Bf=y.memo(eXe);Bf.displayName="ToolCallCard";const Ioe=3,R1=6;function tXe(e,r){if(!r||e.some(Doe))return!1;const n=e.filter(i=>i.status!=="running"&&i.status!=="pending");return n.length>=Ioe&&n.length===e.length}function rXe({calls:e,collapsible:r,onOpenTerminal:n,onOpenDiff:i}){const[s,o]=y.useState(!1),[a,l]=y.useState(()=>!tXe(e,r)),u=y.useRef(!1),{childMap:c,parentSet:h}=y.useMemo(()=>Loe(e),[e]),p=y.useMemo(()=>e.filter(P=>!h.has(P.callId)),[e,h]),g=p.filter(P=>P.status==="running"||P.status==="pending"),v=p.filter(P=>P.status!=="running"&&P.status!=="pending"),b=g.length===0&&v.length>0,_=r&&b&&v.length>=Ioe;if(y.useEffect(()=>{_&&!u.current&&l(!1),u.current=b},[b,_]),e.length===0)return null;const k=v.filter(P=>P.status==="success").length,w=v.filter(P=>P.status==="error").length,C=Ooe(v);if(_&&!a)return d.jsx("div",{className:"my-2 overflow-hidden rounded-xl border border-border/40 bg-muted/[0.18]",children:d.jsxs("button",{type:"button",onClick:()=>l(!0),className:"flex w-full items-center gap-2 px-3 py-2 text-xs text-muted-foreground hover:bg-muted/50 transition-colors",children:[d.jsx(No,{className:"h-3.5 w-3.5 shrink-0"}),d.jsx(C,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),d.jsx("span",{className:"font-medium",children:vO(v)}),k>0&&d.jsxs("span",{className:"inline-flex items-center gap-0.5 text-green-500",children:[d.jsx(yc,{className:"h-3 w-3"})," ",k]}),w>0&&d.jsxs("span",{className:"inline-flex items-center gap-0.5 text-red-500",children:[d.jsx(wh,{className:"h-3 w-3"})," ",w]})]})});const j=!s&&v.length>R1,T=j?v.length-R1:0,A=j?v.slice(-R1):v,E=j?v.slice(0,T).filter(P=>P.status==="success").length:0,R=T-E;return d.jsxs("div",{className:"my-2 overflow-hidden rounded-xl border border-border/40 bg-muted/[0.18] divide-y divide-border/30",children:[_&&d.jsxs("button",{type:"button",onClick:()=>l(!1),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-muted-foreground hover:bg-muted/50 transition-colors",children:[d.jsx(No,{className:"h-3 w-3 rotate-90 transition-transform"}),d.jsxs("span",{children:["Collapse ",vO(v)]})]}),j&&d.jsxs("button",{type:"button",onClick:()=>o(!0),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-muted-foreground hover:bg-muted/50 transition-colors",children:[d.jsx(No,{className:"h-3 w-3"}),d.jsxs("span",{children:[T," earlier tool call",T!==1?"s":"",E>0&&d.jsxs("span",{className:"text-green-500 ml-1",children:["(",E," passed)"]}),R>0&&d.jsxs("span",{className:"text-red-500 ml-1",children:["(",R," failed)"]})]})]}),s&&v.slice(0,T).map(P=>d.jsx(Bf,{call:P,childCalls:c.get(P.callId),onOpenTerminal:n,onOpenDiff:i},P.callId)),A.map(P=>d.jsx(Bf,{call:P,childCalls:c.get(P.callId),onOpenTerminal:n,onOpenDiff:i},P.callId)),g.map(P=>d.jsx(Bf,{call:P,childCalls:c.get(P.callId),onOpenTerminal:n,onOpenDiff:i},P.callId))]})}function Boe(e,r){if(e===r)return!0;if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==r[n])return!1;return!0}const bO=y.memo(rXe,(e,r)=>e.onOpenTerminal===r.onOpenTerminal&&e.onOpenDiff===r.onOpenDiff&&e.collapsible===r.collapsible&&Boe(e.calls,r.calls));bO.displayName="ToolCallGroup";function rH(e,r){return r?!1:e.length>0&&e.every(n=>n.status!=="running"&&n.status!=="pending")}function nXe({provider:e,calls:r,isStreaming:n,onOpenTerminal:i,onOpenDiff:s}){const[o,a]=y.useState(()=>!rH(r,n)),[l,u]=y.useState(!1),[c,h]=y.useState(()=>Date.now()),p=y.useRef(!rH(r,n)),g=!!n||r.some(I=>I.status==="running"||I.status==="pending"),v=r.filter(I=>I.status==="success").length,b=r.filter(I=>I.status==="error").length,_=r.length>0?Math.min(...r.map(I=>I.startedAt)):Date.now(),k=!g&&r.length>0?Math.max(...r.map(I=>I.completedAt??I.startedAt)):void 0,w=Ooe(r),{childMap:C,parentSet:j}=y.useMemo(()=>Loe(r),[r]),T=y.useMemo(()=>r.filter(I=>!j.has(I.callId)),[r,j]),A=T.filter(I=>I.status==="running"||I.status==="pending"),E=T.filter(I=>I.status!=="running"&&I.status!=="pending"),R=!l&&E.length>R1,P=R?E.length-R1:0,H=R?E.slice(-R1):E,$=R?E.slice(0,P).filter(I=>I.status==="success").length:0,U=P-$;return y.useEffect(()=>{p.current&&!g&&r.length>0&&a(!1),p.current=g},[g,r.length]),y.useEffect(()=>{if(!g)return;const I=window.setInterval(()=>h(Date.now()),250);return()=>window.clearInterval(I)},[g]),r.length===0?null:d.jsx(gj,{open:o,onOpenChange:a,children:d.jsxs("div",{className:"my-2 overflow-hidden rounded-xl border border-border/40 bg-muted/[0.18]",children:[d.jsxs(yj,{className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50 transition-colors",children:[d.jsx(No,{className:qe("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform duration-200",o&&"rotate-90")}),g?d.jsx(ir,{className:"h-4 w-4 shrink-0 text-muted-foreground animate-spin"}):d.jsx(w,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),d.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:vO(r)}),d.jsxs("div",{className:"flex items-center gap-2 ml-auto text-xs text-muted-foreground tabular-nums shrink-0",children:[!g&&b>0&&d.jsxs("span",{className:"text-red-500",children:[b," failed"]}),d.jsx(xO,{startedAt:_,completedAt:k,now:c})]}),!g&&b===0&&v>0&&d.jsx(yc,{className:"h-3.5 w-3.5 shrink-0 text-green-500"}),!g&&b>0&&d.jsx(wh,{className:"h-3.5 w-3.5 shrink-0 text-red-500"})]}),d.jsx(vj,{children:d.jsxs("div",{className:"divide-y divide-border/30 border-t border-border/30",children:[R&&d.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-muted-foreground hover:bg-muted/50 transition-colors",children:[d.jsx(No,{className:"h-3 w-3"}),d.jsxs("span",{children:[P," earlier tool call",P!==1?"s":"",$>0&&d.jsxs("span",{className:"text-green-500 ml-1",children:["(",$," passed)"]}),U>0&&d.jsxs("span",{className:"text-red-500 ml-1",children:["(",U," failed)"]})]})]}),l&&E.slice(0,P).map(I=>d.jsx(Bf,{call:I,childCalls:C.get(I.callId),onOpenTerminal:i,onOpenDiff:s},I.callId)),H.map(I=>d.jsx(Bf,{call:I,childCalls:C.get(I.callId),onOpenTerminal:i,onOpenDiff:s},I.callId)),A.map(I=>d.jsx(Bf,{call:I,childCalls:C.get(I.callId),onOpenTerminal:i,onOpenDiff:s},I.callId))]})})]})})}const _O=y.memo(nXe,(e,r)=>e.provider===r.provider&&e.isStreaming===r.isStreaming&&e.onOpenTerminal===r.onOpenTerminal&&e.onOpenDiff===r.onOpenDiff&&Boe(e.calls,r.calls));_O.displayName="AgentToolCallWrapper";function nH(e){switch(e){case"system":return"border-red-500/35 bg-red-500/10 text-red-700 dark:text-red-300";case"user":return"border-blue-500/35 bg-blue-500/10 text-blue-700 dark:text-blue-300";case"assistant":return"border-emerald-500/35 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300";case"tool":return"border-amber-500/35 bg-amber-500/10 text-amber-700 dark:text-amber-300";default:return"border-border bg-muted text-muted-foreground"}}function zf(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e,null,2)}catch{return String(e)}}function iXe(e){return"content"in e?zf(e.content):zf(e)}function sXe(e){return(Array.isArray(e.tool_calls)?e.tool_calls:Array.isArray(e.toolCalls)?e.toolCalls:[]).map((n,i)=>{const s=n&&typeof n=="object"?n:{},o=s.function&&typeof s.function=="object"?s.function:{};return{id:zf(s.id||s.call_id||s.tool_call_id||`tool-call-${i+1}`),name:zf(o.name||s.name||s.tool||"tool"),args:zf(o.arguments||s.arguments||s.args||{})}})}function oXe(e,r){const n=e&&typeof e=="object"?e:{},i=n.function&&typeof n.function=="object"?n.function:{};return{name:zf(i.name||n.name||`tool_${r+1}`),description:typeof i.description=="string"?i.description:typeof n.description=="string"?n.description:void 0,raw:e}}function zoe(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function sm(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function aXe({flow:e}){const r=e.rounds;if(!r.some(p=>p.metrics))return null;let i=0,s=0,o=0,a=0,l,u=0,c=0;for(const p of r){const g=p.metrics;g&&(i+=g.durationMs,g.promptTokens&&(s+=g.promptTokens),g.completionTokens&&(o+=g.completionTokens),g.totalTokens&&(a+=g.totalTokens),g.tokensPerSecond&&g.completionTokens&&(u+=g.tokensPerSecond*g.completionTokens,c+=g.completionTokens),g.contextUsage&&(l=g.contextUsage))}const h=c>0?Math.round(u/c*10)/10:void 0;return d.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[d.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-2.5 py-2",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[d.jsx($m,{className:"h-3 w-3"}),"Total Duration"]}),d.jsx("div",{className:"mt-0.5 text-sm font-semibold text-foreground",children:zoe(i)}),d.jsxs("div",{className:"text-xs text-muted-foreground",children:[r.length," round",r.length!==1?"s":""]})]}),d.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-2.5 py-2",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[d.jsx(b8,{className:"h-3 w-3"}),"Tokens"]}),d.jsx("div",{className:"mt-0.5 text-sm font-semibold text-foreground",children:a>0?sm(a):s+o>0?sm(s+o):"—"}),d.jsxs("div",{className:"text-xs text-muted-foreground",children:[s>0?`${sm(s)} in`:"",s>0&&o>0?" · ":"",o>0?`${sm(o)} out`:"",s===0&&o===0?"estimated":""]})]}),d.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-2.5 py-2",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[d.jsx(nK,{className:"h-3 w-3"}),"Speed"]}),d.jsx("div",{className:"mt-0.5 text-sm font-semibold text-foreground",children:h?`${h} tok/s`:"—"}),d.jsx("div",{className:"text-xs text-muted-foreground",children:"completion tokens/sec"})]}),d.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-2.5 py-2",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[d.jsx(Fge,{className:"h-3 w-3"}),"Context Window"]}),l?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"mt-0.5 text-sm font-semibold text-foreground",children:[Math.round(l.ratio*100),"%"]}),d.jsxs("div",{className:"text-xs text-muted-foreground",children:[sm(l.total)," / ",sm(l.limit)," tokens",l.pruned?" (pruned)":""]})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mt-0.5 text-sm font-semibold text-foreground",children:"—"}),d.jsx("div",{className:"text-xs text-muted-foreground",children:"no data"})]})]})]})}function lXe({metrics:e}){return e?d.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[d.jsx("span",{title:"LLM request duration",children:zoe(e.durationMs)}),e.promptTokens!=null&&d.jsxs("span",{title:"Prompt tokens",children:[sm(e.promptTokens)," prompt"]}),e.completionTokens!=null&&d.jsxs("span",{title:"Completion tokens",children:[sm(e.completionTokens)," completion"]}),e.tokensPerSecond!=null&&d.jsxs("span",{title:"Completion tokens per second",className:"font-medium text-foreground/80",children:[e.tokensPerSecond," tok/s"]}),e.contextUsage&&d.jsxs("span",{title:"Context window utilisation",children:["ctx ",Math.round(e.contextUsage.ratio*100),"%",e.contextUsage.pruned?" (pruned)":""]})]}):null}function cXe(e,r){const n=[];if(!e)return r?[{id:"assistant-response",kind:"response",content:r}]:n;e.rounds.some(i=>i.metrics)&&n.push({id:"summary",kind:"summary",flow:e});for(const i of e.rounds){const s=Array.isArray(i.messages)?i.messages:[],o=Array.isArray(i.tools)?i.tools.map(oXe):[];n.push({id:`round-${i.round}`,kind:"round",round:i,messageCount:s.length,toolCount:o.length}),s.forEach((a,l)=>{const u=a&&typeof a=="object"?a:{content:a};n.push({id:`round-${i.round}-message-${l}`,kind:"message",roundNumber:i.round,index:l,role:zf(u.role||"message"),content:iXe(u),raw:a,toolCalls:sXe(u)})}),o.length>0&&n.push({id:`round-${i.round}-tools`,kind:"tools",roundNumber:i.round,tools:o})}return r&&n.push({id:"assistant-response",kind:"response",content:r}),n}function uXe({row:e}){return e.kind==="summary"?d.jsx(aXe,{flow:e.flow}):e.kind==="round"?d.jsxs("div",{className:"rounded-md border border-border bg-background px-3 py-2",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("span",{className:"rounded-md bg-foreground px-2 py-1 text-xs font-semibold text-background",children:["Round ",e.round.round]}),d.jsx("span",{className:"text-xs text-muted-foreground",children:e.round.model}),d.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(e.round.createdAt).toLocaleString()})]}),d.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-muted-foreground",children:[d.jsxs("span",{children:[e.messageCount," messages sent"]}),d.jsxs("span",{children:[e.toolCount," tool schemas available"]}),e.round.tool_choice?d.jsxs("span",{children:["tool_choice: ",e.round.tool_choice]}):null]}),d.jsx(lXe,{metrics:e.round.metrics})]}):e.kind==="tools"?d.jsxs("div",{className:"relative ml-4 border-l border-border pl-4",children:[d.jsx("div",{className:"absolute -left-1.5 top-3 h-3 w-3 rounded-full border border-border bg-background"}),d.jsxs("div",{className:"rounded-md border border-border/80 bg-muted/25 p-3",children:[d.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-medium text-foreground",children:[d.jsx(x9,{className:"h-3.5 w-3.5"}),"Tools offered to model in round ",e.roundNumber]}),d.jsx("div",{className:"grid gap-2 md:grid-cols-2",children:e.tools.map(r=>d.jsxs("details",{className:"rounded-md border border-border/70 bg-background/70 p-2",children:[d.jsx("summary",{className:"cursor-pointer text-xs font-medium text-foreground",children:r.name}),r.description?d.jsx("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:r.description}):null,d.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/40 p-2 font-mono text-xs leading-5",children:zf(r.raw)})]},r.name))})]})]}):e.kind==="response"?d.jsxs("div",{className:"relative ml-4 border-l border-border pl-4",children:[d.jsx("div",{className:"absolute -left-1.5 top-3 h-3 w-3 rounded-full border border-emerald-500/40 bg-background"}),d.jsxs("div",{className:"rounded-md border border-emerald-500/25 bg-emerald-500/10 p-3",children:[d.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[d.jsx("span",{className:qe("rounded-md border px-2 py-0.5 text-xs font-semibold",nH("assistant")),children:"assistant response"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"rendered chat answer"})]}),d.jsx("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md bg-background/70 p-3 font-mono text-xs leading-5 text-foreground [overflow-wrap:anywhere]",children:e.content||"(empty response)"})]})]}):d.jsxs("div",{className:"relative ml-4 border-l border-border pl-4",children:[d.jsx("div",{className:"absolute -left-1.5 top-3 h-3 w-3 rounded-full border border-border bg-background"}),d.jsxs("div",{className:"rounded-md border border-border/80 bg-background p-3",children:[d.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[d.jsx("span",{className:qe("rounded-md border px-2 py-0.5 text-xs font-semibold",nH(e.role)),children:e.role}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:["round ",e.roundNumber," / message ",e.index+1]})]}),d.jsx("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/35 p-3 font-mono text-xs leading-5 text-foreground [overflow-wrap:anywhere]",children:e.content||"(empty content)"}),e.toolCalls.length>0?d.jsx("div",{className:"mt-3 space-y-2",children:e.toolCalls.map(r=>d.jsxs("details",{className:"rounded-md border border-amber-500/25 bg-amber-500/10 p-2",children:[d.jsxs("summary",{className:"cursor-pointer text-xs font-medium text-amber-800 dark:text-amber-200",children:["Tool call: ",r.name," ",d.jsxs("span",{className:"font-normal text-muted-foreground",children:["(",r.id,")"]})]}),d.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-background/70 p-2 font-mono text-xs leading-5",children:r.args||"{}"})]},r.id))}):null,d.jsxs("details",{className:"mt-2",children:[d.jsx("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:"Raw message JSON"}),d.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/35 p-2 font-mono text-xs leading-5",children:zf(e.raw)})]})]})]})}function dXe({open:e,onOpenChange:r,contextFlow:n,responseContent:i}){const[s,o]=y.useState("trace"),[a,l]=y.useState(!1),u=y.useRef(null),c=y.useMemo(()=>cXe(n,i),[n,i]),h=y.useMemo(()=>n?JSON.stringify(n,null,2):"",[n]),p=z9({count:c.length,getScrollElement:()=>u.current,estimateSize:v=>{const b=c[v];return b?b.kind==="summary"?110:b.kind==="round"?120:b.kind==="tools"?Math.min(420,110+b.tools.length*72):b.kind==="response"?Math.min(520,120+Math.ceil(b.content.length/90)*18):Math.min(520,135+Math.ceil(b.content.length/90)*18+b.toolCalls.length*72):120},overscan:5,enabled:e&&s==="trace"});y.useEffect(()=>{if(!e||s!=="trace")return;const v=window.requestAnimationFrame(()=>{p.measure()});return()=>window.cancelAnimationFrame(v)},[e,s,c.length,p]);const g=async()=>{h&&(await navigator.clipboard.writeText(h),l(!0),window.setTimeout(()=>l(!1),1200))};return d.jsx(Yf,{open:e,onOpenChange:r,children:d.jsxs(Oh,{showCloseButton:!1,className:"grid h-[85vh] max-w-[min(1200px,96vw)] grid-rows-[auto_minmax(0,1fr)] p-0",children:[d.jsx(Sh,{className:"border-b px-3 py-2",children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(kh,{className:"shrink-0 text-sm font-semibold",children:"LLM Context Flow"}),d.jsx(s0,{className:"min-w-0 truncate text-xs",children:n?`${n.provider}${n.model?` / ${n.model}`:""} · ${n.rounds.length} round${n.rounds.length===1?"":"s"}`:"No context snapshot available"}),d.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[d.jsx(ke,{type:"button",variant:s==="trace"?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>o("trace"),children:"Trace"}),d.jsx(ke,{type:"button",variant:s==="raw"?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>o("raw"),children:"Raw"}),d.jsxs(ke,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:g,disabled:!h,children:[a?d.jsx(os,{className:"mr-1 h-3 w-3"}):d.jsx(ru,{className:"mr-1 h-3 w-3"}),a?"Copied":"Copy"]}),d.jsxs(BG,{className:"ml-1 rounded-sm p-1 opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[d.jsx(ti,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}),s==="trace"?d.jsxs("div",{className:"min-h-0 px-3 pb-3 pt-2",children:[n!=null&&n.note?d.jsx("p",{className:"mb-2 rounded-md border border-border/70 bg-muted/40 px-2.5 py-1.5 text-xs text-muted-foreground",children:n.note}):null,c.length>0?d.jsx("div",{ref:u,className:"h-full min-h-0 overflow-auto pr-2",children:d.jsx("div",{className:"relative w-full",style:{height:`${p.getTotalSize()}px`},children:p.getVirtualItems().map(v=>{const b=c[v.index];return b?d.jsx("div",{"data-index":v.index,ref:p.measureElement,className:"absolute left-0 top-0 w-full pb-3",style:{transform:`translateY(${v.start}px)`},children:d.jsx(uXe,{row:b})},b.id):null})})}):d.jsxs("div",{className:"flex h-full items-center justify-center rounded-md border border-dashed border-border text-sm text-muted-foreground",children:[d.jsx(um,{className:"mr-2 h-4 w-4"}),"No context snapshot is available for this message."]})]}):d.jsx("div",{className:"min-h-0 overflow-auto px-3 pb-3 pt-2",children:d.jsx("pre",{className:"min-h-full whitespace-pre-wrap break-words rounded-md border border-border/70 bg-muted/35 p-3 font-mono text-xs leading-relaxed text-foreground [overflow-wrap:anywhere]",children:h||"No context snapshot is available for this message."})})]})})}const wO=/^[A-Za-z]:[\\/]/,hXe=/^\//;function iH(e){return e.replace(/\\/g,"/").replace(/\/+$/,"")}function fXe(e){return wO.test(e)||hXe.test(e)}function pXe(e,r){const n=e.replace(/\\/g,"/");if(!n||n==="/")return!1;if(/^L\d+(?:C\d+)?$/i.test(r))return!0;const i=n.split("/").pop()??"";return/\.[A-Za-z0-9]+$/.test(i)}function mXe(e){if(!e)return null;const r=e.trim();if(!r)return null;let n=r,i="";try{const l=new URL(r);if(l.protocol==="http:"||l.protocol==="https:"){if(n=l.pathname,i=l.hash.startsWith("#")?l.hash.slice(1):l.hash,!pXe(n,i))return null}else{const u=r.indexOf("#");u>=0&&(n=r.slice(0,u),i=r.slice(u+1))}}catch{const l=r.indexOf("#");l>=0&&(n=r.slice(0,l),i=r.slice(l+1))}const s=decodeURIComponent(n);if(!fXe(s))return null;const o={path:s},a=i.match(/^L(\d+)(?:C(\d+))?$/i);return a&&(o.line=Number.parseInt(a[1],10),a[2]&&(o.column=Number.parseInt(a[2],10))),o}function sH(e,r){if(!r)return!1;const n=iH(e),i=iH(r);if(!n||!i)return!1;const s=wO.test(n)?n.toLowerCase():n,o=wO.test(i)?i.toLowerCase():i;return s===o||s.startsWith(`${o}/`)}const gXe=3;function oH(e,r){return!!(e&&e!=="jait"&&r.length>=gXe)}const aH=/<pre[^>]*><code>([\s\S]*)<\/code><\/pre>/;function lH(){return d.jsx("span",{className:"inline-flex items-center gap-1",children:[0,1,2].map(e=>d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-pulse",style:{animationDelay:`${e*160}ms`}},e))})}function yXe(e){const r=e.toLowerCase();return!r||r==="text"||r==="plain"?"txt":r==="shell"||r==="sh"?"bash":r}function vXe({code:e,language:r,className:n}){const[i,s]=y.useState(null);return y.useEffect(()=>{let o=!1;const a=setTimeout(()=>{(async()=>{var h,p;const u=document.documentElement.classList.contains("dark")?"github-dark":"github-light",c=yXe(r);try{const g=await HI(e,{lang:c,theme:u});if(o)return;s(((h=g.match(aH))==null?void 0:h[1])??null)}catch{try{const g=await HI(e,{lang:"txt",theme:u});if(o)return;s(((p=g.match(aH))==null?void 0:p[1])??null)}catch{o||s(null)}}})()},150);return()=>{o=!0,clearTimeout(a)}},[e,r]),i?d.jsx("code",{className:qe(n,"whitespace-pre"),dangerouslySetInnerHTML:{__html:i}}):d.jsx("code",{className:qe(n,"whitespace-pre"),children:e})}function Foe(e){return"prose dark:prose-invert max-w-none break-words [overflow-wrap:anywhere] prose-pre:bg-muted prose-pre:border prose-pre:max-w-full prose-pre:overflow-x-auto prose-code:before:content-none prose-code:after:content-none prose-p:leading-relaxed [font-size:0.9rem]"}function xXe(e){const r=e.replace(/\\/g,"/"),n=r.split("/");return n[n.length-1]??r}function bXe({href:e,target:r,onOpenPath:n}){const i=xXe(r.path),s=r.line?`L${r.line}${r.column?`:${r.column}`:""}`:null;return d.jsxs("a",{href:e,className:qe("not-prose inline-flex max-w-full items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 align-middle text-xs font-medium leading-none text-foreground no-underline transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),title:r.path,onClick:o=>{o.preventDefault(),n(r.path,r.line,r.column)},children:[d.jsx(bo,{filename:i,className:"h-3.5 w-3.5 shrink-0"}),d.jsx("span",{className:"max-w-[220px] truncate",children:i}),s?d.jsx("span",{className:"shrink-0 rounded bg-background/80 px-1 py-0.5 text-2xs text-muted-foreground",children:s}):null]})}function Hoe(e){return{pre:({children:r})=>d.jsx(d.Fragment,{children:r}),code:({node:r,className:n,children:i,ref:s,...o})=>{var l,u;if(!(((l=r==null?void 0:r.position)==null?void 0:l.start.line)===((u=r==null?void 0:r.position)==null?void 0:u.end.line)&&!n)){const c=typeof n=="string"&&n.replace(/^language-/,"").split(" ")[0]||"text",h=String(i??"").replace(/\n$/,"");return d.jsxs(QNe,{code:h,language:c,children:[d.jsxs(eEe,{children:[d.jsx(tEe,{children:d.jsx(rEe,{children:c})}),d.jsx(nEe,{children:d.jsx(iEe,{})})]}),d.jsx("div",{className:"overflow-x-auto px-3 py-2 text-sm",children:d.jsx(vXe,{code:h,language:c,className:n})})]})}return d.jsx("code",{className:qe("not-prose inline-flex max-w-full items-baseline rounded-md border border-border/70 bg-muted/45 px-2 py-1 align-middle font-mono text-xs font-medium leading-[1.2] text-foreground","shadow-[inset_0_1px_0_hsl(var(--background)/0.55)]"),...o,children:d.jsx("span",{className:"max-w-[32rem] truncate sm:max-w-[40rem]",children:i})})},a:({href:r,ref:n,...i})=>{if(!e)return d.jsx("a",{href:r,...i,children:i.children});const s=mXe(r);return s?d.jsx(bXe,{href:r,target:s,onOpenPath:e}):d.jsx("a",{href:r,...i,children:i.children})},img:({src:r,alt:n,ref:i,...s})=>{const o=typeof r=="string"?koe(r):null;return o?d.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:"not-prose block overflow-hidden rounded-xl border border-border/60 bg-muted/20 no-underline",children:d.jsx("img",{src:o,alt:n??"Chat image",loading:"lazy",className:"max-h-[28rem] w-full object-contain bg-background/80",...s})}):d.jsx("span",{className:"inline-flex rounded-md border border-dashed border-border/70 px-2 py-1 text-xs text-muted-foreground",children:"image unavailable"})}}}function _Xe({content:e,compact:r,onOpenPath:n}){const i=y.useMemo(()=>Hoe(n),[n]);return d.jsx("div",{className:Foe(),children:d.jsx(DZ,{remarkPlugins:[IZ],components:i,children:e})})}function wXe({content:e,compact:r,onOpenPath:n}){const i=y.useMemo(()=>Hoe(n),[n]),s=({blockMatch:a})=>d.jsx(DZ,{remarkPlugins:[IZ],components:i,children:a.output}),{blockMatches:o}=z5e({llmOutput:e,blocks:[],fallbackBlock:{component:s,lookBack:E5e()},isStreamFinished:!1});return d.jsx("div",{className:Foe(),children:o.map((a,l)=>{const u=a.block.component;return d.jsx(u,{blockMatch:a},l)})})}const SO=y.memo(function({content:r,compact:n,isStreaming:i,preferLlmUi:s,onOpenPath:o}){return s&&i?d.jsx(wXe,{content:r,compact:n,onOpenPath:o}):d.jsx(_Xe,{content:r,compact:n,onOpenPath:o})});SO.displayName="AssistantMarkdown";function SXe({messageId:e,messageIndex:r,messageFromEnd:n,role:i,content:s,contextFlow:o,displayContent:a,referencedFiles:l,displaySegments:u,attachments:c,thinking:h,thinkingDuration:p,toolCalls:g,segments:v,isStreaming:b,compact:_,preferLlmUi:k,provider:w,onOpenTerminal:C,onEditMessage:j,editComposer:T,onOpenPath:A,onOpenDiff:E}){const R=i==="user",{userDisplayText:P,userDisplaySegments:H}=y.useMemo(()=>{if(!R)return{userDisplayText:s,userDisplaySegments:[]};if(u!=null&&u.length)return{userDisplayText:X1(u),userDisplaySegments:u};if(a){const Be=n5(a,l);return{userDisplayText:a,userDisplaySegments:Be}}const Ne=NJ(s);return{userDisplayText:Ne.text,userDisplaySegments:Ne.displaySegments}},[R,s,a,l,u]),[$,U]=y.useState(!1),[I,K]=y.useState(!1),[M,B]=y.useState(!1),[L,z]=y.useState(!1),[W,Y]=y.useState(!1),[F,q]=y.useState(!1),[J,V]=y.useState(""),[ee,ne]=y.useState([]),[de,fe]=y.useState(null),[te,ae]=y.useState(null),ge=y.useMemo(()=>{if(!R)return[];const Ne=ks(te??H).flatMap(Be=>Be.type==="image"?[{name:Be.name,mimeType:Be.mimeType,data:Be.data,preview:`data:${Be.mimeType};base64,${Be.data}`}]:[]);return Ne.length>0?Ne:c??[]},[c,R,te,H]),le=y.useRef(null),Je=y.useRef(null),Ze=y.useRef(null);y.useEffect(()=>()=>{le.current!==null&&window.clearTimeout(le.current)},[]),y.useEffect(()=>{M||(V(P),ne(H))},[M,H,P]),y.useEffect(()=>{if(!te&&de==null)return;const Ne=de===P,Be=te===H||JSON.stringify(te??[])===JSON.stringify(H);Ne&&Be&&(fe(null),ae(null))},[te,de,H,P]),y.useEffect(()=>{var Be;if(!M){z(!1);return}const Ne=window.requestAnimationFrame(()=>{z(!0)});return(Be=Ze.current)==null||Be.focus(),()=>window.cancelAnimationFrame(Ne)},[M]);const De=()=>{var Be;const Ne=[];if(g&&g.length>0)for(const it of g){const ft=it.tool.replace(/_/g,"."),st=Object.entries(it.args).filter(([,Xe])=>Xe!=null&&Xe!=="").map(([Xe,Qe])=>`${Xe}: ${typeof Qe=="string"?Qe:JSON.stringify(Qe)}`).join(", "),ot=it.status==="success"?"✓":it.status==="error"?"✗":"…",It=it.completedAt&&it.startedAt?`${((it.completedAt-it.startedAt)/1e3).toFixed(1)}s`:"";if(Ne.push(`[${ot} ${ft}] ${st}`),(Be=it.result)!=null&&Be.message){const Xe=it.result.message.length>500?it.result.message.slice(0,500)+"…":it.result.message;Ne.push(Xe)}It&&Ne.push(`Duration: ${It}`),Ne.push("")}return s&&Ne.push(R?EJ(H)||P:s),Ne.join(`
|
|
1156
|
-
`).trim()},re=async()=>{const Ne=De();if(!Ne)return;const Be=R?AJ(H):null;try{Be&&typeof ClipboardItem<"u"&&navigator.clipboard.write?await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Ne],{type:"text/plain"}),[r5]:new Blob([Be],{type:r5})})]):await navigator.clipboard.writeText(Ne)}catch{const it=document.createElement("textarea");it.value=Ne,it.style.position="fixed",it.style.opacity="0",document.body.appendChild(it),it.focus(),it.select(),document.execCommand("copy"),document.body.removeChild(it)}U(!0),le.current!==null&&window.clearTimeout(le.current),le.current=window.setTimeout(()=>U(!1),1200)},Te=R&&!!e&&!!j,_e=Te,we=b&&!h&&!s.trim(),Ke=R||!b,St=y.useCallback(()=>{!Te||W||(V(P),ne(H),B(!0))},[Te,W,H,P]),vt=y.useCallback(()=>{V(P),ne(H),B(!1)},[H,P]),Rt=()=>{var Be;!Te||M||typeof window<"u"&&(Be=window.getSelection())!=null&&Be.toString().trim()||St()},Xt=y.useCallback(async(Ne,Be)=>{if(!Te||!e||!j||W)return;const it=RJ(Ne??J,Be??ee);if(it){if(REe(it.text,P,H)){B(!1);return}fe(it.text),ae(it.displaySegments),B(!1),Y(!0);try{await j(e,it.text,r,n,{referencedFiles:it.referencedFiles,displaySegments:it.displaySegments})}catch(ft){throw fe(null),ae(null),B(!0),ft}finally{Y(!1)}}},[Te,J,ee,W,e,n,r,j,H,P]),Ot=async(Ne,Be)=>{if(!Te||!e||!j)return;const it=Ne.trim();it&&await j(e,it,r,n,{referencedFiles:(Be??H).filter(ft=>ft.type==="file").map(ft=>({path:ft.path,name:ft.name})),displaySegments:Be??H})},rr=async()=>{if(_e){K(!0);try{await Ot(P,H)}finally{K(!1)}}},Ee=Ne=>M||!Ke||!s?null:d.jsx("div",{className:qe("absolute z-10 rounded-full border border-border/70 bg-background p-1","right-1 bottom-[.25rem]","opacity-0 transition-opacity group-hover/message:opacity-100 focus-within:opacity-100","touch-device:opacity-80",$&&"opacity-100"),children:d.jsxs(oEe,{children:[Te?d.jsx(G3,{onClick:St,"aria-label":"Edit message",tooltip:"Edit message",className:"h-6 w-6",children:d.jsx(y9,{className:"h-3.5 w-3.5"})}):null,_e?d.jsx(G3,{onClick:Be=>{Be.preventDefault(),Be.stopPropagation(),rr()},disabled:I,"aria-label":"Retry from this message",tooltip:"Retry from this message",className:"h-6 w-6",children:d.jsx(eK,{className:qe("h-3.5 w-3.5",I&&"animate-spin")})}):null,!R&&o?d.jsx(G3,{onClick:Be=>{Be.preventDefault(),Be.stopPropagation(),q(!0)},"aria-label":"View LLM context",tooltip:"View LLM context",className:"h-6 w-6",children:d.jsx(jf,{className:"h-3.5 w-3.5"})}):null,d.jsx(G3,{onClick:re,"aria-label":$?"Copied":"Copy message",tooltip:$?"Copied":"Copy message",className:"h-6 w-6",children:$?d.jsx(os,{className:"h-3.5 w-3.5"}):d.jsx(ru,{className:"h-3.5 w-3.5"})})]})}),Le=R?null:Ee();return d.jsxs(d.Fragment,{children:[d.jsx(sEe,{from:i,className:qe(_?"py-2":"py-4"),children:d.jsxs("div",{className:qe("min-w-0 max-w-[85%] space-y-2",R&&"order-1"),children:[!R&&h&&d.jsx(jEe,{content:h,isStreaming:!!b&&!s,duration:p}),!R&&v&&v.length>0?d.jsxs("div",{className:"relative min-w-0 max-w-full select-text break-words [overflow-wrap:anywhere]",children:[v.map((Ne,Be)=>{if(Ne.type==="toolGroup"){const it=(g??[]).filter(st=>Ne.callIds.includes(st.callId)),ft=v.slice(Be+1).some(st=>st.type==="text"&&st.content.trim());return it.length>0?oH(w,it)?d.jsx(_O,{provider:w,calls:it,isStreaming:!!b&&Be===v.length-1,onOpenTerminal:C,onOpenDiff:E},`tg-${Be}`):d.jsx(bO,{calls:it,collapsible:ft,onOpenTerminal:C,onOpenDiff:E},`tg-${Be}`):null}return Ne.content.trim()?d.jsx(tN,{"data-message-from":"assistant",className:"max-w-full bg-card/78",children:d.jsx(SO,{content:Ne.content,compact:_,isStreaming:!!b&&Be===v.length-1,preferLlmUi:k,onOpenPath:A})},`ts-${Be}`):null}),b&&!s&&!v.some(Ne=>Ne.type==="text"&&Ne.content.trim())&&d.jsx("div",{className:"flex items-center gap-3 px-1 py-1 text-sm text-muted-foreground",children:d.jsx(lH,{})}),Le]}):d.jsxs(d.Fragment,{children:[g&&g.length>0&&(oH(w,g)?d.jsx(_O,{provider:w,calls:g,isStreaming:b,onOpenTerminal:C,onOpenDiff:E}):d.jsx(bO,{calls:g,collapsible:w!=="jait",onOpenTerminal:C,onOpenDiff:E})),s?R?M?d.jsx("div",{className:"w-full max-w-3xl",onClick:Ne=>Ne.stopPropagation(),children:d.jsx("div",{className:qe("space-y-3 origin-bottom transition-all duration-150 ease-out",L?"translate-y-0 opacity-100":"translate-y-2 opacity-0"),children:d.jsx(Ub,{ref:Ze,draftStateKey:`edit:${e??"user-message"}`,value:J,segments:ee,onChange:Ne=>{var Be;V(Ne),ne(((Be=Ze.current)==null?void 0:Be.getSegments())??[])},onSubmit:(Ne,Be,it)=>{const ft=it??[],st=X1(ft)||J;ne(ft),Xt(st,ft)},disabled:W,controlsDisabled:W,placeholder:"Edit message...",onVoiceInput:T==null?void 0:T.onVoiceInput,voiceRecording:T==null?void 0:T.voiceRecording,voiceLevels:T==null?void 0:T.voiceLevels,voiceTranscribing:T==null?void 0:T.voiceTranscribing,onVoiceStop:T==null?void 0:T.onVoiceStop,mode:T==null?void 0:T.mode,onModeChange:T==null?void 0:T.onModeChange,provider:T==null?void 0:T.provider,onProviderChange:T==null?void 0:T.onProviderChange,responseStyle:T==null?void 0:T.responseStyle,onResponseStyleChange:T==null?void 0:T.onResponseStyleChange,providerRuntimeMode:T==null?void 0:T.providerRuntimeMode,onProviderRuntimeModeChange:T==null?void 0:T.onProviderRuntimeModeChange,cliModel:T==null?void 0:T.cliModel,onCliModelChange:T==null?void 0:T.onCliModelChange,sessionInfo:T==null?void 0:T.sessionInfo,workspaceNodeId:T==null?void 0:T.workspaceNodeId,availableFiles:(T==null?void 0:T.availableFiles)??Z1(H),onSearchFiles:T==null?void 0:T.onSearchFiles,workspaceOpen:(T==null?void 0:T.workspaceOpen)??Z1(H).length>0,footerTrailingContent:d.jsx(ke,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-lg",onClick:vt,disabled:W,"aria-label":"Cancel editing message",title:"Cancel editing",children:d.jsx(ti,{className:"h-3.5 w-3.5"})}),className:"rounded-lg border-primary/20 bg-primary/[0.08] dark:!bg-primary/[0.08] shadow-none [&_.text-muted-foreground]:text-muted-foreground [&>div]:!bg-transparent [&_[contenteditable='true']]:!bg-transparent"},`edit-${e??"user-message"}`)})}):d.jsxs("div",{className:"relative w-fit max-w-full",children:[d.jsx(tN,{ref:Je,"data-message-from":"user",className:qe("min-w-0 rounded-lg bg-muted px-4 py-3 break-words [overflow-wrap:anywhere]",Te&&!M&&"cursor-text transition-colors hover:bg-muted/80","leading-relaxed [font-size:0.9rem]"),onClick:Rt,title:Te&&!M?"Click to edit message":void 0,children:d.jsxs("div",{className:"min-w-0 space-y-3",children:[d.jsx("div",{className:"min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:(te??H).length>0?(te??H).map((Ne,Be)=>Ne.type==="text"?d.jsx("span",{children:Ne.text},`text-${Be}`):Ne.type==="file"?d.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:Ne.path,children:[d.jsx(bo,{filename:Ne.name,className:"h-3.5 w-3.5 shrink-0"}),d.jsx("span",{className:"max-w-[180px] truncate",children:Ne.lineRange?`${Ne.name}:${Z_(Ne.lineRange).replace(/^lines? /,"")}`:Ne.name})]},`${Ne.path}-${Be}`):Ne.type==="workspace"?d.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:Ne.path,children:[d.jsx(pj,{name:Ne.name,className:"h-3.5 w-3.5 shrink-0"}),d.jsx("span",{className:"max-w-[180px] truncate",children:Ne.name})]},`${Ne.path}-${Be}`):Ne.type==="terminal"?d.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:Ne.workspaceRoot?`${Ne.terminalId} · ${Ne.workspaceRoot}`:Ne.terminalId,children:[d.jsx("span",{className:"inline-flex h-3.5 w-3.5 items-center justify-center rounded-sm bg-muted-foreground/15 text-2xs font-bold uppercase text-muted-foreground",children:"T"}),d.jsx("span",{className:"max-w-[180px] truncate",children:Ne.lineRange?`${Ne.name}:${Z_(Ne.lineRange).replace(/^lines? /,"")}`:Ne.name})]},`${Ne.terminalId}-${Be}`):null):de??P}),ge.length>0&&d.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:ge.map((Ne,Be)=>{const it=Ne.preview??`data:${Ne.mimeType};base64,${Ne.data}`;return d.jsxs("a",{href:it,target:"_blank",rel:"noreferrer",className:"block overflow-hidden rounded-lg border border-primary/10 bg-background/65",children:[d.jsx("img",{src:it,alt:Ne.name,className:"max-h-72 w-full object-cover"}),d.jsx("div",{className:"truncate border-t border-border/60 px-2 py-1 text-xs text-muted-foreground",children:Ne.name})]},`${Ne.name}-${Be}`)})})]})}),Ee()]}):d.jsxs("div",{className:"relative min-w-0 max-w-full break-words [overflow-wrap:anywhere]",children:[d.jsx(tN,{"data-message-from":"assistant",className:"min-w-0 max-w-full break-words [overflow-wrap:anywhere]",children:d.jsx(SO,{content:s,compact:_,isStreaming:b,preferLlmUi:k,onOpenPath:A})}),Le]}):we?d.jsx("div",{className:"flex items-center gap-3 px-1 py-1 text-sm text-muted-foreground",children:d.jsx(lH,{})}):null]})]})}),d.jsx(dXe,{open:F,onOpenChange:q,contextFlow:o,responseContent:s})]})}const kO=y.memo(SXe,(e,r)=>{const{messageFromEnd:n,messageIndex:i,...s}=e,{messageFromEnd:o,messageIndex:a,...l}=r,u=Object.keys(l);return u.length===Object.keys(s).length&&u.every(c=>Object.is(s[c],l[c]))});kO.displayName="Message";function kXe(e,r){return!e||e==="gateway"?!1:!r.has(e)}function cH(e){const r=new Date(e),i=new Date().getTime()-r.getTime();return i<6e4?"just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:r.toLocaleDateString()}function CXe({platform:e}){switch(e){case"windows":case"macos":case"linux":return d.jsx(Aa,{className:"h-2.5 w-2.5"});case"android":case"ios":return d.jsx(P4,{className:"h-2.5 w-2.5"});default:return d.jsx(Ci,{className:"h-2.5 w-2.5"})}}function jXe({workspaces:e,personalSessions:r=[],activeWorkspaceId:n,activeSessionId:i,loading:s=!1,hasMoreWorkspaces:o=!1,showFewerWorkspaces:a=!1,onSelectWorkspace:l,onSelectPersonalSession:u,onNewPersonalSession:c,onCreateWorkspace:h,onRemoveWorkspace:p,onChangeDirectory:g,onShowMore:v,onShowFewer:b,sessionInfo:_,nodes:k=[]}){const w=y.useMemo(()=>new Set(k.filter(C=>!C.isGateway).map(C=>C.id)),[k]);return d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsxs("div",{className:"flex h-[35px] shrink-0 items-center justify-between px-3 border-b",children:[d.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Chats & Workspaces"}),d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:h,children:d.jsx(jo,{className:"h-3.5 w-3.5"})})}),d.jsx(xn,{side:"right",children:"New workspace"})]})]}),s?d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx(ir,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex max-h-[50%] min-h-0 shrink-0 flex-col border-b",children:[d.jsx("div",{className:"flex h-7 shrink-0 items-center justify-between px-3",children:d.jsx("span",{className:"text-2xs font-medium text-muted-foreground",children:"Workspaces"})}),d.jsx(lh,{className:"min-h-0 flex-1",children:d.jsxs("div",{className:"space-y-0.5 px-1.5 pb-1.5",children:[e.length===0&&d.jsxs("p",{className:"text-xs text-muted-foreground text-center py-4",children:["No workspaces yet.",d.jsx("br",{}),d.jsx("button",{onClick:h,className:"underline underline-offset-2 hover:text-foreground mt-1 inline-block",children:"Choose workspace folder"})]}),e.map(C=>{const j=C.id===n,T=C.nodeId&&C.nodeId!=="gateway"?k.find(E=>E.id===C.nodeId):null,A=kXe(C.nodeId,w);return d.jsx("div",{className:`overflow-hidden rounded-md border border-border/60 bg-background/40 ${A?"opacity-50":""}`,children:d.jsxs("div",{className:`group flex items-start gap-1.5 rounded-md px-1.5 py-1.5 transition-colors text-sm ${A||j?"cursor-default":"cursor-pointer"} ${j?"bg-secondary/70":A?"":"hover:bg-muted/40"}`,draggable:!!C.rootPath,onDragStart:E=>{if(!C.rootPath){E.preventDefault();return}E.dataTransfer.effectAllowed="copy",E.dataTransfer.setData(kQ,JSON.stringify(c9e(C.rootPath,C.title||void 0)))},onClick:()=>{!A&&!j&&l(C.id)},children:[j?d.jsx(ph,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-primary"}):d.jsx(f9,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),d.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden",children:[d.jsx("div",{className:"truncate text-xs font-medium",children:C.title||"Untitled Workspace"}),d.jsxs("div",{className:"flex items-center gap-1 text-2xs text-muted-foreground overflow-hidden",children:[d.jsx("span",{className:"truncate min-w-0",children:C.rootPath||"No folder linked"}),d.jsx("span",{className:"shrink-0",children:"·"}),d.jsx("span",{className:"shrink-0",children:cH(C.lastActiveAt)})]}),A&&d.jsxs("div",{className:"mt-0.5 flex items-center gap-1 text-2xs text-orange-500",children:[d.jsx(Jye,{className:"h-2.5 w-2.5"}),d.jsx("span",{children:"Node offline"})]}),T&&!A&&d.jsx("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-2xs",children:d.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-muted-foreground",children:[d.jsx(CXe,{platform:T.platform}),d.jsx("span",{className:"truncate max-w-[80px]",children:T.name})]})}),j&&_&&d.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-2xs text-blue-500",children:[d.jsx("span",{className:"truncate",children:_.provider}),d.jsx("span",{className:"shrink-0 text-muted-foreground",children:"·"}),d.jsx(Aa,{className:"h-2.5 w-2.5 shrink-0"}),d.jsx("span",{className:"truncate",children:_.isRemote&&_.remoteNode?_.remoteNode.nodeName:"Gateway"})]})]}),d.jsxs("div",{className:"flex shrink-0 self-start gap-0.5",children:[d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",onClick:E=>{E.stopPropagation(),g(C.id)},children:d.jsx(o0e,{className:"h-3 w-3"})})}),d.jsx(xn,{side:"right",children:"Change directory"})]}),d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity shrink-0 text-muted-foreground hover:text-destructive",onClick:E=>{E.stopPropagation(),p(C.id)},children:d.jsx(FG,{className:"h-3 w-3"})})}),d.jsx(xn,{side:"right",children:"Archive workspace"})]})]})]})},C.id)}),o&&v&&d.jsx("button",{className:"w-full px-2 py-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:v,children:"Show more workspaces"}),a&&b&&d.jsx("button",{className:"w-full px-2 py-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:b,children:"Show fewer workspaces"})]})})]}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[d.jsxs("div",{className:"flex h-7 shrink-0 items-center justify-between px-3",children:[d.jsx("span",{className:"text-2xs font-medium text-muted-foreground",children:"Personal chats"}),c&&d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:c,children:d.jsx(jo,{className:"h-3 w-3"})})}),d.jsx(xn,{side:"right",children:"New personal chat"})]})]}),d.jsx(lh,{className:"min-h-0 flex-1",children:d.jsxs("div",{className:"space-y-0.5 px-1.5 pb-1.5",children:[r.length===0&&d.jsxs("p",{className:"text-xs text-muted-foreground text-center py-4",children:["No personal chats yet.",c&&d.jsxs(d.Fragment,{children:[d.jsx("br",{}),d.jsx("button",{onClick:c,className:"underline underline-offset-2 hover:text-foreground mt-1 inline-block",children:"Start a chat"})]})]}),r.map(C=>{const j=n===null&&C.id===i;return d.jsxs("div",{className:`group flex items-center gap-1.5 rounded-md px-1.5 py-1 transition-colors text-sm ${j?"bg-secondary/70 cursor-default":"cursor-pointer hover:bg-muted/40"}`,onClick:()=>{!j&&u&&u(C.id)},children:[d.jsx(um,{className:`h-3.5 w-3.5 shrink-0 ${j?"text-primary":"text-muted-foreground"}`}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("div",{className:"truncate text-xs font-medium",children:C.name||"Personal chat"}),d.jsx("div",{className:"text-2xs text-muted-foreground",children:cH(C.lastActiveAt??C.createdAt)})]})]},C.id)})]})})]})]})]})}function TXe(e){const r=new Date(e),i=new Date().getTime()-r.getTime();return i<6e4?"just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:r.toLocaleDateString()}function NXe({sessions:e,activeSessionId:r,workspaceTitle:n,onSelectSession:i,onNewSession:s,onOpenChange:o,showTitle:a=!0,triggerLabel:l=null}){const[u,c]=y.useState(!1),h=e.find(g=>g.id===r)??e[0]??null,p=g=>{c(g),o==null||o(g)};return d.jsxs("div",{className:a?"flex min-w-0 flex-1 items-center justify-between gap-1.5":"flex items-center gap-1.5",children:[a?d.jsx("span",{className:"min-w-0 truncate text-sm font-semibold leading-tight",children:h!=null&&h.name&&h.name!=="New Chat"?h.name:""}):null,d.jsxs(au,{open:u,onOpenChange:p,children:[d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(lu,{asChild:!0,children:d.jsxs(ke,{variant:"ghost",size:l?"sm":"icon",className:l?"h-7 shrink-0 rounded-md px-2 text-xs text-muted-foreground hover:text-foreground":"h-6 w-6 shrink-0 rounded-md text-muted-foreground hover:text-foreground",children:[d.jsx(YG,{className:"h-3.5 w-3.5"}),l?d.jsx("span",{children:l}):null]})})}),d.jsx(xn,{side:"bottom",children:l??"Sessions"})]}),d.jsxs(dc,{align:"start",className:"w-[min(28rem,calc(100vw-1rem))] p-0",children:[d.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-sm font-medium",children:"Sessions"}),d.jsx("div",{className:"text-xs text-muted-foreground",children:n||"Current workspace"})]}),d.jsxs(ke,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>{s(),c(!1)},children:[d.jsx(B0e,{className:"mr-1 h-3 w-3"}),"New chat"]})]}),d.jsx("div",{className:"max-h-[min(28rem,70vh)] overflow-y-auto p-2",children:e.length===0?d.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No sessions yet."}):d.jsx("div",{className:"space-y-0.5",children:e.map(g=>{const v=g.id===r;return d.jsxs("button",{type:"button",className:`flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors ${v?"bg-secondary text-secondary-foreground":"hover:bg-muted/50"}`,onClick:()=>{i(g.id),c(!1)},children:[v?d.jsx(os,{className:"mt-0.5 h-3 w-3 shrink-0 text-primary"}):d.jsx("span",{className:"mt-1 h-2 w-2 shrink-0 rounded-full bg-muted-foreground/50"}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"truncate text-xs font-medium",children:g.name||"Untitled"}),g.status==="archived"&&d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-1.5 py-0 text-2xs text-muted-foreground",children:[d.jsx(FG,{className:"h-2.5 w-2.5"}),"Archived"]})]}),d.jsx("div",{className:"text-2xs text-muted-foreground",children:TXe(g.lastActiveAt)})]})]},g.id)})})})]})]})]})}function EXe({suggestions:e,onSelect:r,className:n}){return d.jsx("div",{className:qe("flex flex-wrap gap-2 justify-center",n),children:e.map(i=>d.jsx("button",{onClick:()=>r(i),className:"px-4 py-2 text-sm rounded-full border bg-background text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:i},i))})}const AXe=T4("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium leading-4 transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500/15 text-green-700 dark:text-green-400",warning:"border-transparent bg-yellow-500/15 text-yellow-700 dark:text-yellow-400"}},defaultVariants:{variant:"default"}});function tn({className:e,variant:r,...n}){return d.jsx("div",{className:qe(AXe({variant:r}),e),...n})}const On=y.forwardRef(({className:e,...r},n)=>d.jsx("div",{ref:n,className:qe("rounded-xl border border-border/70 bg-card text-card-foreground shadow-sm",e),...r}));On.displayName="Card";const Woe=y.forwardRef(({className:e,...r},n)=>d.jsx("div",{ref:n,className:qe("flex flex-col space-y-1.5 p-6",e),...r}));Woe.displayName="CardHeader";const Uoe=y.forwardRef(({className:e,...r},n)=>d.jsx("h3",{ref:n,className:qe("font-semibold leading-none tracking-tight",e),...r}));Uoe.displayName="CardTitle";const OXe=y.forwardRef(({className:e,...r},n)=>d.jsx("p",{ref:n,className:qe("text-sm text-muted-foreground",e),...r}));OXe.displayName="CardDescription";const Voe=y.forwardRef(({className:e,...r},n)=>d.jsx("div",{ref:n,className:qe("p-6 pt-0",e),...r}));Voe.displayName="CardContent";const RXe=y.forwardRef(({className:e,...r},n)=>d.jsx("div",{ref:n,className:qe("flex items-center p-6 pt-0",e),...r}));RXe.displayName="CardFooter";const MXe={pending:{icon:$m,label:"Pending",color:"text-muted-foreground"},approved:{icon:ir,label:"Running",color:"text-blue-500"},rejected:{icon:ti,label:"Rejected",color:"text-destructive"},executed:{icon:yc,label:"Done",color:"text-green-500"},failed:{icon:Ea,label:"Failed",color:"text-destructive"}};function PXe({action:e,expanded:r,onToggle:n}){const i=MXe[e.status],s=i.icon;return d.jsxs("div",{className:"border rounded-md",children:[d.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full px-3 py-2.5 text-left hover:bg-muted/50 transition-colors",onClick:n,children:[d.jsx(s,{className:qe("h-4 w-4 shrink-0",i.color,e.status==="approved"&&"animate-spin")}),d.jsxs("span",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"font-mono text-sm font-medium",children:e.tool}),d.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["Step ",e.order+1]})]}),d.jsx(tn,{variant:"outline",className:"text-2xs px-1.5 py-0",children:i.label}),r?d.jsx(al,{className:"h-4 w-4 text-muted-foreground"}):d.jsx(No,{className:"h-4 w-4 text-muted-foreground"})]}),r&&d.jsxs("div",{className:"px-3 pb-3 pt-1 border-t bg-muted/30",children:[d.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),d.jsx("pre",{className:"text-xs bg-background rounded p-2 overflow-x-auto max-h-48",children:JSON.stringify(e.args,null,2)}),e.result&&d.jsx("div",{className:qe("mt-2 text-xs rounded p-2",e.result.ok?"bg-green-500/10 text-green-700 dark:text-green-400":"bg-destructive/10 text-destructive"),children:e.result.message})]})]})}function LXe({plan:e,onApprove:r,onReject:n,isExecuting:i,className:s}){const[o,a]=y.useState(new Set),l=g=>{a(v=>{const b=new Set(v);return b.has(g)?b.delete(g):b.add(g),b})},u=e.actions.filter(g=>g.status==="pending").length,c=e.actions.filter(g=>g.status==="executed").length,h=e.actions.filter(g=>g.status==="failed").length,p=u===0;return d.jsxs(On,{className:qe("p-4 space-y-3",s),children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{children:[d.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:[d.jsx($Xe,{className:"h-4 w-4"}),"Plan",d.jsxs(tn,{variant:"secondary",className:"text-2xs px-1.5 py-0",children:[e.actions.length," step",e.actions.length!==1?"s":""]})]}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.summary})]}),p&&d.jsx(tn,{variant:h>0?"destructive":"success",className:"shrink-0",children:h>0?`${h} failed`:"Complete"})]}),d.jsx("div",{className:"space-y-1.5",children:e.actions.map(g=>d.jsx(PXe,{action:g,expanded:o.has(g.id),onToggle:()=>l(g.id)},g.id))}),u>0&&d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[d.jsx(ke,{size:"sm",onClick:()=>r(),disabled:i,children:i?d.jsxs(d.Fragment,{children:[d.jsx(ir,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Executing..."]}):d.jsxs(d.Fragment,{children:[d.jsx(R4,{className:"h-3.5 w-3.5 mr-1.5"}),"Execute all (",u,")"]})}),d.jsxs(ke,{size:"sm",variant:"outline",onClick:n,disabled:i,children:[d.jsx(ti,{className:"h-3.5 w-3.5 mr-1.5"}),"Reject"]})]}),p&&!i&&d.jsxs("p",{className:"text-xs text-muted-foreground",children:[c>0&&`${c} action${c!==1?"s":""} executed.`,h>0&&` ${h} failed.`]})]})}function $Xe({className:e}){return d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[d.jsx("rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}),d.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),d.jsx("path",{d:"M12 11h4"}),d.jsx("path",{d:"M12 16h4"}),d.jsx("path",{d:"M8 11h.01"}),d.jsx("path",{d:"M8 16h.01"})]})}function uH({items:e,className:r}){const[n,i]=y.useState(!1);if(e.length===0)return null;const s=e.filter(l=>l.status==="completed").length,o=e.length,a=o>0?Math.round(s/o*100):0;return d.jsxs("div",{className:qe("rounded-lg border bg-muted/30 p-3 space-y-2",r),children:[d.jsxs("button",{type:"button",onClick:()=>i(l=>!l),className:"flex items-center gap-2 w-full text-left",children:[d.jsx(al,{className:qe("h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-200",!n&&"-rotate-90")}),d.jsx("span",{className:"text-xs font-medium text-foreground",children:"Tasks"}),d.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:d.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-300",style:{width:`${a}%`}})}),d.jsxs("span",{className:"text-2xs text-muted-foreground tabular-nums",children:[s,"/",o]})]}),n&&d.jsx("div",{className:"space-y-1",children:e.map(l=>d.jsxs("div",{className:qe("flex items-start gap-2 text-xs py-0.5",l.status==="completed"&&"text-muted-foreground"),children:[l.status==="completed"?d.jsx(yc,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-green-500"}):l.status==="in-progress"?d.jsx(ir,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-primary animate-spin"}):d.jsx(Age,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-muted-foreground/50"}),d.jsx("span",{className:qe("flex-1 min-w-0",l.status==="completed"&&"line-through"),children:l.title})]},l.id))})]})}function DXe({files:e,onAccept:r,onReject:n,onAcceptAll:i,onRejectAll:s,onFileClick:o,className:a}){const l=y.useRef(null),[u,c]=y.useState(!1);if(y.useEffect(()=>{const p=l.current;if(!p||typeof ResizeObserver>"u")return;const g=()=>{c(p.clientWidth<560)};g();const v=new ResizeObserver(()=>g());return v.observe(p),()=>v.disconnect()},[]),e.length===0)return null;const h=e.filter(p=>p.state==="undecided").length;return d.jsxs("div",{ref:l,className:qe("overflow-hidden rounded-lg border bg-muted/30",a),children:[d.jsxs("div",{className:"flex items-center justify-between gap-2 border-b bg-muted/20 px-3 py-2",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[d.jsx(Rl,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsxs("span",{className:"truncate text-xs font-medium",children:["Files changed (",e.length,")"]}),h>0&&d.jsxs("span",{className:"shrink-0 text-2xs text-amber-500 dark:text-amber-400",children:[h," pending"]})]}),h>0&&d.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[d.jsxs(ke,{size:u?"icon":"sm",variant:"ghost",className:qe("h-6 shrink-0 text-xs",u?"w-6 p-0":"px-2"),onClick:i,title:"Keep all","aria-label":"Keep all",children:[d.jsx(os,{className:qe("h-3 w-3 shrink-0",!u&&"mr-1")}),!u&&"Keep all"]}),d.jsxs(ke,{size:u?"icon":"sm",variant:"ghost",className:qe("h-6 shrink-0 text-xs",u?"w-6 p-0":"px-2"),onClick:s,title:"Undo all","aria-label":"Undo all",children:[d.jsx(uh,{className:qe("h-3 w-3 shrink-0",!u&&"mr-1")}),!u&&"Undo all"]})]})]}),d.jsx("div",{className:"divide-y",children:e.map(p=>d.jsxs("div",{className:qe("flex items-center gap-2 px-3 py-1.5 text-xs",p.state==="accepted"&&"bg-green-500/5",p.state==="rejected"&&"bg-red-500/5 text-muted-foreground"),children:[d.jsx(bo,{filename:p.name,className:"h-3.5 w-3.5 shrink-0"}),d.jsx("button",{type:"button",className:qe("min-w-0 flex-1 truncate text-left hover:underline cursor-pointer",p.state==="rejected"&&"line-through"),title:`Review diff for ${p.path}`,onClick:()=>o==null?void 0:o(p.path),children:p.path}),p.state==="undecided"&&d.jsxs("div",{className:"ml-auto flex items-center gap-0.5 shrink-0",children:[d.jsx("button",{type:"button",className:"p-1 rounded hover:bg-primary/10 text-primary transition-colors",onClick:()=>o==null?void 0:o(p.path),title:"Review changes",children:d.jsx(wm,{className:"h-3 w-3"})}),d.jsx("button",{type:"button",className:"p-1 rounded hover:bg-green-500/20 text-green-600 dark:text-green-400 transition-colors",onClick:()=>r==null?void 0:r(p.path),title:"Keep all changes",children:d.jsx(os,{className:"h-3 w-3"})}),d.jsx("button",{type:"button",className:"p-1 rounded hover:bg-red-500/20 text-red-600 dark:text-red-400 transition-colors",onClick:()=>n==null?void 0:n(p.path),title:"Undo all changes",children:d.jsx(uh,{className:"h-3 w-3"})})]}),p.state==="accepted"&&d.jsx("span",{className:"text-2xs text-green-600 dark:text-green-400 shrink-0",children:"Kept"}),p.state==="rejected"&&d.jsx("span",{className:"text-2xs text-red-500 shrink-0",children:"Undone"})]},p.path))})]})}function IXe(e,r,n,i){const s=e.findIndex(u=>u.id===r);if(s<0)return e;const o=[...e],[a]=o.splice(s,1);if(!a)return e;if(n==null)return o.push(a),o;const l=o.findIndex(u=>u.id===n);return l<0?e:(o.splice(l+(i==="after"?1:0),0,a),o)}function BXe({item:e,index:r}){return d.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border/40 bg-background px-3 py-2 text-sm shadow-2xl ring-1 ring-primary/10",children:[d.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground",children:r===0?d.jsx(p9,{className:"h-3.5 w-3.5 text-primary"}):d.jsx(No,{className:"h-3.5 w-3.5 text-muted-foreground"})}),d.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground",children:d.jsx(KG,{className:"h-3.5 w-3.5"})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[r===0?d.jsx("span",{className:"mb-0.5 block text-2xs font-medium uppercase tracking-wider text-primary/70",children:"Next"}):d.jsxs("span",{className:"mb-0.5 block text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:["Queued #",r+1]}),d.jsx("span",{className:"whitespace-pre-wrap break-words text-foreground",children:e.displayContent??e.content})]})]})}function zXe({item:e,index:r,onRemove:n,onEdit:i,onReorder:s,onSendToParallelThread:o,dragActive:a,dropBefore:l,dropAfter:u,onDragStart:c}){const[h,p]=y.useState(!1),[g,v]=y.useState(!0),[b,_]=y.useState(e.displayContent??e.content),k=y.useRef(null),w=h||!a;y.useEffect(()=>{if(h){const A=k.current;A&&(A.focus(),A.setSelectionRange(A.value.length,A.value.length))}},[h]),y.useEffect(()=>{h||_(e.displayContent??e.content)},[e.content,e.displayContent,h]);const C=y.useCallback(()=>{const A=b.trim(),E=e.displayContent??e.content;A&&A!==E&&(i==null||i(e.id,A)),p(!1)},[b,e.content,e.displayContent,e.id,i]),j=y.useCallback(()=>{_(e.displayContent??e.content),p(!1)},[e.content,e.displayContent]),T=y.useCallback(A=>{A.key==="Enter"&&!A.shiftKey?(A.preventDefault(),C()):A.key==="Escape"&&j()},[C,j]);return d.jsxs(d.Fragment,{children:[l&&d.jsx("div",{className:"relative h-0",children:d.jsx("div",{className:"absolute inset-x-2 -top-px h-0.5 rounded-full bg-primary shadow-[0_0_0_1px_hsl(var(--background))]"})}),d.jsxs("div",{"data-queue-id":e.id,className:qe("group flex cursor-grab touch-none items-start gap-2 rounded-lg border border-border/40 bg-muted/50 px-3 py-2 text-sm transition-all duration-150 ease-out hover:bg-muted/70 active:cursor-grabbing",a&&"border-dashed border-primary/35 bg-primary/5 opacity-0"),onPointerDown:A=>{h||!s||A.target.closest('button, textarea, input, a, [data-no-drag="true"]')||c==null||c(e.id,A)},children:[d.jsx("button",{type:"button","data-no-drag":"true",className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground hover:bg-foreground/10 hover:text-foreground transition-colors",onClick:()=>v(A=>!A),"aria-label":g?"Expand queued message":"Collapse queued message",title:g?"Expand queued message":"Collapse queued message",children:g?d.jsx(No,{className:"h-3.5 w-3.5"}):r===0?d.jsx(p9,{className:"h-3.5 w-3.5 text-primary"}):d.jsx(al,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s&&!h&&d.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground cursor-grab active:cursor-grabbing touch-none",title:"Drag to reorder","aria-label":"Drag to reorder",children:d.jsx(KG,{className:"h-3.5 w-3.5"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[r===0&&!h&&d.jsx("span",{className:"text-2xs font-medium uppercase tracking-wider text-primary/70 block mb-0.5",children:"Next"}),r>0&&!h&&d.jsxs("span",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground block mb-0.5",children:["Queued #",r+1]}),h?d.jsx("textarea",{ref:k,value:b,onChange:A=>_(A.target.value),onKeyDown:T,onBlur:C,rows:Math.min(b.split(`
|
|
1156
|
+
`).trim()},re=async()=>{const Ne=De();if(!Ne)return;const Be=R?AJ(H):null;try{Be&&typeof ClipboardItem<"u"&&navigator.clipboard.write?await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Ne],{type:"text/plain"}),[r5]:new Blob([Be],{type:r5})})]):await navigator.clipboard.writeText(Ne)}catch{const it=document.createElement("textarea");it.value=Ne,it.style.position="fixed",it.style.opacity="0",document.body.appendChild(it),it.focus(),it.select(),document.execCommand("copy"),document.body.removeChild(it)}U(!0),le.current!==null&&window.clearTimeout(le.current),le.current=window.setTimeout(()=>U(!1),1200)},Te=R&&!!e&&!!j,_e=Te,we=b&&!h&&!s.trim(),Ke=R||!b,St=y.useCallback(()=>{!Te||W||(V(P),ne(H),B(!0))},[Te,W,H,P]),vt=y.useCallback(()=>{V(P),ne(H),B(!1)},[H,P]),Rt=()=>{var Be;!Te||M||typeof window<"u"&&(Be=window.getSelection())!=null&&Be.toString().trim()||St()},Xt=y.useCallback(async(Ne,Be)=>{if(!Te||!e||!j||W)return;const it=RJ(Ne??J,Be??ee);if(it){if(REe(it.text,P,H)){B(!1);return}fe(it.text),ae(it.displaySegments),B(!1),Y(!0);try{await j(e,it.text,r,n,{referencedFiles:it.referencedFiles,displaySegments:it.displaySegments})}catch(ft){throw fe(null),ae(null),B(!0),ft}finally{Y(!1)}}},[Te,J,ee,W,e,n,r,j,H,P]),Ot=async(Ne,Be)=>{if(!Te||!e||!j)return;const it=Ne.trim();it&&await j(e,it,r,n,{referencedFiles:(Be??H).filter(ft=>ft.type==="file").map(ft=>({path:ft.path,name:ft.name})),displaySegments:Be??H})},rr=async()=>{if(_e){K(!0);try{await Ot(P,H)}finally{K(!1)}}},Ee=Ne=>M||!Ke||!s?null:d.jsx("div",{className:qe("absolute z-10 rounded-full border border-border/70 bg-background p-1","right-1 bottom-[.25rem]","opacity-0 transition-opacity group-hover/message:opacity-100 focus-within:opacity-100","touch-device:opacity-80",$&&"opacity-100"),children:d.jsxs(oEe,{children:[Te?d.jsx(G3,{onClick:St,"aria-label":"Edit message",tooltip:"Edit message",className:"h-6 w-6",children:d.jsx(y9,{className:"h-3.5 w-3.5"})}):null,_e?d.jsx(G3,{onClick:Be=>{Be.preventDefault(),Be.stopPropagation(),rr()},disabled:I,"aria-label":"Retry from this message",tooltip:"Retry from this message",className:"h-6 w-6",children:d.jsx(eK,{className:qe("h-3.5 w-3.5",I&&"animate-spin")})}):null,!R&&o?d.jsx(G3,{onClick:Be=>{Be.preventDefault(),Be.stopPropagation(),q(!0)},"aria-label":"View LLM context",tooltip:"View LLM context",className:"h-6 w-6",children:d.jsx(jf,{className:"h-3.5 w-3.5"})}):null,d.jsx(G3,{onClick:re,"aria-label":$?"Copied":"Copy message",tooltip:$?"Copied":"Copy message",className:"h-6 w-6",children:$?d.jsx(os,{className:"h-3.5 w-3.5"}):d.jsx(ru,{className:"h-3.5 w-3.5"})})]})}),Le=R?null:Ee();return d.jsxs(d.Fragment,{children:[d.jsx(sEe,{from:i,className:qe(_?"py-2":"py-4"),children:d.jsxs("div",{className:qe("min-w-0 max-w-[85%] space-y-2",R&&"order-1"),children:[!R&&h&&d.jsx(jEe,{content:h,isStreaming:!!b&&!s,duration:p}),!R&&v&&v.length>0?d.jsxs("div",{className:"relative min-w-0 max-w-full select-text break-words [overflow-wrap:anywhere]",children:[v.map((Ne,Be)=>{if(Ne.type==="toolGroup"){const it=(g??[]).filter(st=>Ne.callIds.includes(st.callId)),ft=v.slice(Be+1).some(st=>st.type==="text"&&st.content.trim());return it.length>0?oH(w,it)?d.jsx(_O,{provider:w,calls:it,isStreaming:!!b&&Be===v.length-1,onOpenTerminal:C,onOpenDiff:E},`tg-${Be}`):d.jsx(bO,{calls:it,collapsible:ft,onOpenTerminal:C,onOpenDiff:E},`tg-${Be}`):null}return Ne.content.trim()?d.jsx(tN,{"data-message-from":"assistant",className:"max-w-full bg-card/78",children:d.jsx(SO,{content:Ne.content,compact:_,isStreaming:!!b&&Be===v.length-1,preferLlmUi:k,onOpenPath:A})},`ts-${Be}`):null}),b&&!s&&!v.some(Ne=>Ne.type==="text"&&Ne.content.trim())&&d.jsx("div",{className:"flex items-center gap-3 px-1 py-1 text-sm text-muted-foreground",children:d.jsx(lH,{})}),Le]}):d.jsxs(d.Fragment,{children:[g&&g.length>0&&(oH(w,g)?d.jsx(_O,{provider:w,calls:g,isStreaming:b,onOpenTerminal:C,onOpenDiff:E}):d.jsx(bO,{calls:g,collapsible:w!=="jait",onOpenTerminal:C,onOpenDiff:E})),s?R?M?d.jsx("div",{className:"w-full max-w-3xl",onClick:Ne=>Ne.stopPropagation(),children:d.jsx("div",{className:qe("space-y-3 origin-bottom transition-all duration-150 ease-out",L?"translate-y-0 opacity-100":"translate-y-2 opacity-0"),children:d.jsx(Ub,{ref:Ze,draftStateKey:`edit:${e??"user-message"}`,value:J,segments:ee,onChange:Ne=>{var Be;V(Ne),ne(((Be=Ze.current)==null?void 0:Be.getSegments())??[])},onSubmit:(Ne,Be,it)=>{const ft=it??[],st=X1(ft)||J;ne(ft),Xt(st,ft)},disabled:W,controlsDisabled:W,placeholder:"Edit message...",onVoiceInput:T==null?void 0:T.onVoiceInput,voiceRecording:T==null?void 0:T.voiceRecording,voiceLevels:T==null?void 0:T.voiceLevels,voiceTranscribing:T==null?void 0:T.voiceTranscribing,onVoiceStop:T==null?void 0:T.onVoiceStop,mode:T==null?void 0:T.mode,onModeChange:T==null?void 0:T.onModeChange,provider:T==null?void 0:T.provider,onProviderChange:T==null?void 0:T.onProviderChange,responseStyle:T==null?void 0:T.responseStyle,onResponseStyleChange:T==null?void 0:T.onResponseStyleChange,providerRuntimeMode:T==null?void 0:T.providerRuntimeMode,onProviderRuntimeModeChange:T==null?void 0:T.onProviderRuntimeModeChange,cliModel:T==null?void 0:T.cliModel,onCliModelChange:T==null?void 0:T.onCliModelChange,sessionInfo:T==null?void 0:T.sessionInfo,workspaceNodeId:T==null?void 0:T.workspaceNodeId,availableFiles:(T==null?void 0:T.availableFiles)??Z1(H),onSearchFiles:T==null?void 0:T.onSearchFiles,workspaceOpen:(T==null?void 0:T.workspaceOpen)??Z1(H).length>0,footerTrailingContent:d.jsx(ke,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-lg",onClick:vt,disabled:W,"aria-label":"Cancel editing message",title:"Cancel editing",children:d.jsx(ti,{className:"h-3.5 w-3.5"})}),className:"rounded-lg border-primary/20 bg-primary/[0.08] dark:!bg-primary/[0.08] shadow-none [&_.text-muted-foreground]:text-muted-foreground [&>div]:!bg-transparent [&_[contenteditable='true']]:!bg-transparent"},`edit-${e??"user-message"}`)})}):d.jsxs("div",{className:"relative w-fit max-w-full",children:[d.jsx(tN,{ref:Je,"data-message-from":"user",className:qe("min-w-0 rounded-lg bg-muted px-4 py-3 break-words [overflow-wrap:anywhere]",Te&&!M&&"cursor-text transition-colors hover:bg-muted/80","leading-relaxed [font-size:0.9rem]"),onClick:Rt,title:Te&&!M?"Click to edit message":void 0,children:d.jsxs("div",{className:"min-w-0 space-y-3",children:[d.jsx("div",{className:"min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:(te??H).length>0?(te??H).map((Ne,Be)=>Ne.type==="text"?d.jsx("span",{children:Ne.text},`text-${Be}`):Ne.type==="file"?d.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:Ne.path,children:[d.jsx(bo,{filename:Ne.name,className:"h-3.5 w-3.5 shrink-0"}),d.jsx("span",{className:"max-w-[180px] truncate",children:Ne.lineRange?`${Ne.name}:${Z_(Ne.lineRange).replace(/^lines? /,"")}`:Ne.name})]},`${Ne.path}-${Be}`):Ne.type==="workspace"?d.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:Ne.path,children:[d.jsx(pj,{name:Ne.name,className:"h-3.5 w-3.5 shrink-0"}),d.jsx("span",{className:"max-w-[180px] truncate",children:Ne.name})]},`${Ne.path}-${Be}`):Ne.type==="terminal"?d.jsxs("span",{className:"mx-[2px] inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-muted/45 px-2 py-1 text-xs font-medium leading-none text-foreground align-middle select-none",title:Ne.workspaceRoot?`${Ne.terminalId} · ${Ne.workspaceRoot}`:Ne.terminalId,children:[d.jsx("span",{className:"inline-flex h-3.5 w-3.5 items-center justify-center rounded-sm bg-muted-foreground/15 text-2xs font-bold uppercase text-muted-foreground",children:"T"}),d.jsx("span",{className:"max-w-[180px] truncate",children:Ne.lineRange?`${Ne.name}:${Z_(Ne.lineRange).replace(/^lines? /,"")}`:Ne.name})]},`${Ne.terminalId}-${Be}`):null):de??P}),ge.length>0&&d.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:ge.map((Ne,Be)=>{const it=Ne.preview??`data:${Ne.mimeType};base64,${Ne.data}`;return d.jsxs("a",{href:it,target:"_blank",rel:"noreferrer",className:"block overflow-hidden rounded-lg border border-primary/10 bg-background/65",children:[d.jsx("img",{src:it,alt:Ne.name,className:"max-h-72 w-full object-cover"}),d.jsx("div",{className:"truncate border-t border-border/60 px-2 py-1 text-xs text-muted-foreground",children:Ne.name})]},`${Ne.name}-${Be}`)})})]})}),Ee()]}):d.jsxs("div",{className:"relative min-w-0 max-w-full break-words [overflow-wrap:anywhere]",children:[d.jsx(tN,{"data-message-from":"assistant",className:"min-w-0 max-w-full break-words [overflow-wrap:anywhere]",children:d.jsx(SO,{content:s,compact:_,isStreaming:b,preferLlmUi:k,onOpenPath:A})}),Le]}):we?d.jsx("div",{className:"flex items-center gap-3 px-1 py-1 text-sm text-muted-foreground",children:d.jsx(lH,{})}):null]})]})}),d.jsx(dXe,{open:F,onOpenChange:q,contextFlow:o,responseContent:s})]})}const kO=y.memo(SXe,(e,r)=>{const{messageFromEnd:n,messageIndex:i,...s}=e,{messageFromEnd:o,messageIndex:a,...l}=r,u=Object.keys(l);return u.length===Object.keys(s).length&&u.every(c=>Object.is(s[c],l[c]))});kO.displayName="Message";function kXe(e,r){return!e||e==="gateway"?!1:!r.has(e)}function cH(e){const r=new Date(e),i=new Date().getTime()-r.getTime();return i<6e4?"just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:r.toLocaleDateString()}function CXe({platform:e}){switch(e){case"windows":case"macos":case"linux":return d.jsx(Aa,{className:"h-2.5 w-2.5"});case"android":case"ios":return d.jsx(P4,{className:"h-2.5 w-2.5"});default:return d.jsx(Ci,{className:"h-2.5 w-2.5"})}}function jXe({workspaces:e,personalSessions:r=[],activeWorkspaceId:n,activeSessionId:i,loading:s=!1,hasMoreWorkspaces:o=!1,showFewerWorkspaces:a=!1,onSelectWorkspace:l,onSelectPersonalSession:u,onNewPersonalSession:c,onCreateWorkspace:h,onRemoveWorkspace:p,onChangeDirectory:g,onShowMore:v,onShowFewer:b,sessionInfo:_,nodes:k=[]}){const w=y.useMemo(()=>new Set(k.filter(C=>!C.isGateway).map(C=>C.id)),[k]);return d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsxs("div",{className:"flex h-[35px] shrink-0 items-center justify-between px-3 border-b",children:[d.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Chats & Workspaces"}),d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:h,children:d.jsx(jo,{className:"h-3.5 w-3.5"})})}),d.jsx(xn,{side:"right",children:"New workspace"})]})]}),s?d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx(ir,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex max-h-[50%] min-h-0 shrink-0 flex-col border-b",children:[d.jsx("div",{className:"flex h-7 shrink-0 items-center justify-between px-3",children:d.jsx("span",{className:"text-2xs font-medium text-muted-foreground",children:"Workspaces"})}),d.jsx(lh,{className:"min-h-0 flex-1",children:d.jsxs("div",{className:"space-y-0.5 px-1.5 pb-1.5",children:[e.length===0&&d.jsxs("p",{className:"text-xs text-muted-foreground text-center py-4",children:["No workspaces yet.",d.jsx("br",{}),d.jsx("button",{onClick:h,className:"underline underline-offset-2 hover:text-foreground mt-1 inline-block",children:"Choose workspace folder"})]}),e.map(C=>{const j=C.id===n,T=C.nodeId&&C.nodeId!=="gateway"?k.find(E=>E.id===C.nodeId):null,A=kXe(C.nodeId,w);return d.jsx("div",{className:`overflow-hidden rounded-md ${A?"opacity-50":""}`,children:d.jsxs("div",{className:`group flex items-start gap-1.5 rounded-md px-1.5 py-1.5 transition-colors text-sm ${A||j?"cursor-default":"cursor-pointer"} ${j?"bg-secondary/70":A?"":"hover:bg-muted/40"}`,draggable:!!C.rootPath,onDragStart:E=>{if(!C.rootPath){E.preventDefault();return}E.dataTransfer.effectAllowed="copy",E.dataTransfer.setData(kQ,JSON.stringify(c9e(C.rootPath,C.title||void 0)))},onClick:()=>{!A&&!j&&l(C.id)},children:[j?d.jsx(ph,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-primary"}):d.jsx(f9,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),d.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden",children:[d.jsx("div",{className:"truncate text-xs font-medium",children:C.title||"Untitled Workspace"}),d.jsxs("div",{className:"flex items-center gap-1 text-2xs text-muted-foreground overflow-hidden",children:[d.jsx("span",{className:"truncate min-w-0",children:C.rootPath||"No folder linked"}),d.jsx("span",{className:"shrink-0",children:"·"}),d.jsx("span",{className:"shrink-0",children:cH(C.lastActiveAt)})]}),A&&d.jsxs("div",{className:"mt-0.5 flex items-center gap-1 text-2xs text-orange-500",children:[d.jsx(Jye,{className:"h-2.5 w-2.5"}),d.jsx("span",{children:"Node offline"})]}),T&&!A&&d.jsx("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-2xs",children:d.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded bg-muted px-1 py-0.5 text-muted-foreground",children:[d.jsx(CXe,{platform:T.platform}),d.jsx("span",{className:"truncate max-w-[80px]",children:T.name})]})}),j&&_&&d.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-2xs text-blue-500",children:[d.jsx("span",{className:"truncate",children:_.provider}),d.jsx("span",{className:"shrink-0 text-muted-foreground",children:"·"}),d.jsx(Aa,{className:"h-2.5 w-2.5 shrink-0"}),d.jsx("span",{className:"truncate",children:_.isRemote&&_.remoteNode?_.remoteNode.nodeName:"Gateway"})]})]}),d.jsxs("div",{className:"flex shrink-0 self-start gap-0.5",children:[d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",onClick:E=>{E.stopPropagation(),g(C.id)},children:d.jsx(o0e,{className:"h-3 w-3"})})}),d.jsx(xn,{side:"right",children:"Change directory"})]}),d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity shrink-0 text-muted-foreground hover:text-destructive",onClick:E=>{E.stopPropagation(),p(C.id)},children:d.jsx(FG,{className:"h-3 w-3"})})}),d.jsx(xn,{side:"right",children:"Archive workspace"})]})]})]})},C.id)}),o&&v&&d.jsx("button",{className:"w-full px-2 py-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:v,children:"Show more workspaces"}),a&&b&&d.jsx("button",{className:"w-full px-2 py-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:b,children:"Show fewer workspaces"})]})})]}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[d.jsxs("div",{className:"flex h-7 shrink-0 items-center justify-between px-3",children:[d.jsx("span",{className:"text-2xs font-medium text-muted-foreground",children:"Personal chats"}),c&&d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(ke,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:c,children:d.jsx(jo,{className:"h-3 w-3"})})}),d.jsx(xn,{side:"right",children:"New personal chat"})]})]}),d.jsx(lh,{className:"min-h-0 flex-1",children:d.jsxs("div",{className:"space-y-0.5 px-1.5 pb-1.5",children:[r.length===0&&d.jsxs("p",{className:"text-xs text-muted-foreground text-center py-4",children:["No personal chats yet.",c&&d.jsxs(d.Fragment,{children:[d.jsx("br",{}),d.jsx("button",{onClick:c,className:"underline underline-offset-2 hover:text-foreground mt-1 inline-block",children:"Start a chat"})]})]}),r.map(C=>{const j=n===null&&C.id===i;return d.jsxs("div",{className:`group flex items-center gap-1.5 rounded-md px-1.5 py-1 transition-colors text-sm ${j?"bg-secondary/70 cursor-default":"cursor-pointer hover:bg-muted/40"}`,onClick:()=>{!j&&u&&u(C.id)},children:[d.jsx(um,{className:`h-3.5 w-3.5 shrink-0 ${j?"text-primary":"text-muted-foreground"}`}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("div",{className:"truncate text-xs font-medium",children:C.name||"Personal chat"}),d.jsx("div",{className:"text-2xs text-muted-foreground",children:cH(C.lastActiveAt??C.createdAt)})]})]},C.id)})]})})]})]})]})}function TXe(e){const r=new Date(e),i=new Date().getTime()-r.getTime();return i<6e4?"just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:r.toLocaleDateString()}function NXe({sessions:e,activeSessionId:r,workspaceTitle:n,onSelectSession:i,onNewSession:s,onOpenChange:o,showTitle:a=!0,triggerLabel:l=null}){const[u,c]=y.useState(!1),h=e.find(g=>g.id===r)??e[0]??null,p=g=>{c(g),o==null||o(g)};return d.jsxs("div",{className:a?"flex min-w-0 flex-1 items-center justify-between gap-1.5":"flex items-center gap-1.5",children:[a?d.jsx("span",{className:"min-w-0 truncate text-sm font-semibold leading-tight",children:h!=null&&h.name&&h.name!=="New Chat"?h.name:""}):null,d.jsxs(au,{open:u,onOpenChange:p,children:[d.jsxs(Cn,{children:[d.jsx(jn,{asChild:!0,children:d.jsx(lu,{asChild:!0,children:d.jsxs(ke,{variant:"ghost",size:l?"sm":"icon",className:l?"h-7 shrink-0 rounded-md px-2 text-xs text-muted-foreground hover:text-foreground":"h-6 w-6 shrink-0 rounded-md text-muted-foreground hover:text-foreground",children:[d.jsx(YG,{className:"h-3.5 w-3.5"}),l?d.jsx("span",{children:l}):null]})})}),d.jsx(xn,{side:"bottom",children:l??"Sessions"})]}),d.jsxs(dc,{align:"start",className:"w-[min(28rem,calc(100vw-1rem))] p-0",children:[d.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-sm font-medium",children:"Sessions"}),d.jsx("div",{className:"text-xs text-muted-foreground",children:n||"Current workspace"})]}),d.jsxs(ke,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>{s(),c(!1)},children:[d.jsx(B0e,{className:"mr-1 h-3 w-3"}),"New chat"]})]}),d.jsx("div",{className:"max-h-[min(28rem,70vh)] overflow-y-auto p-2",children:e.length===0?d.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No sessions yet."}):d.jsx("div",{className:"space-y-0.5",children:e.map(g=>{const v=g.id===r;return d.jsxs("button",{type:"button",className:`flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors ${v?"bg-secondary text-secondary-foreground":"hover:bg-muted/50"}`,onClick:()=>{i(g.id),c(!1)},children:[v?d.jsx(os,{className:"mt-0.5 h-3 w-3 shrink-0 text-primary"}):d.jsx("span",{className:"mt-1 h-2 w-2 shrink-0 rounded-full bg-muted-foreground/50"}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"truncate text-xs font-medium",children:g.name||"Untitled"}),g.status==="archived"&&d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-1.5 py-0 text-2xs text-muted-foreground",children:[d.jsx(FG,{className:"h-2.5 w-2.5"}),"Archived"]})]}),d.jsx("div",{className:"text-2xs text-muted-foreground",children:TXe(g.lastActiveAt)})]})]},g.id)})})})]})]})]})}function EXe({suggestions:e,onSelect:r,className:n}){return d.jsx("div",{className:qe("flex flex-wrap gap-2 justify-center",n),children:e.map(i=>d.jsx("button",{onClick:()=>r(i),className:"px-4 py-2 text-sm rounded-full border bg-background text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:i},i))})}const AXe=T4("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium leading-4 transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500/15 text-green-700 dark:text-green-400",warning:"border-transparent bg-yellow-500/15 text-yellow-700 dark:text-yellow-400"}},defaultVariants:{variant:"default"}});function tn({className:e,variant:r,...n}){return d.jsx("div",{className:qe(AXe({variant:r}),e),...n})}const On=y.forwardRef(({className:e,...r},n)=>d.jsx("div",{ref:n,className:qe("rounded-xl border border-border/70 bg-card text-card-foreground shadow-sm",e),...r}));On.displayName="Card";const Woe=y.forwardRef(({className:e,...r},n)=>d.jsx("div",{ref:n,className:qe("flex flex-col space-y-1.5 p-6",e),...r}));Woe.displayName="CardHeader";const Uoe=y.forwardRef(({className:e,...r},n)=>d.jsx("h3",{ref:n,className:qe("font-semibold leading-none tracking-tight",e),...r}));Uoe.displayName="CardTitle";const OXe=y.forwardRef(({className:e,...r},n)=>d.jsx("p",{ref:n,className:qe("text-sm text-muted-foreground",e),...r}));OXe.displayName="CardDescription";const Voe=y.forwardRef(({className:e,...r},n)=>d.jsx("div",{ref:n,className:qe("p-6 pt-0",e),...r}));Voe.displayName="CardContent";const RXe=y.forwardRef(({className:e,...r},n)=>d.jsx("div",{ref:n,className:qe("flex items-center p-6 pt-0",e),...r}));RXe.displayName="CardFooter";const MXe={pending:{icon:$m,label:"Pending",color:"text-muted-foreground"},approved:{icon:ir,label:"Running",color:"text-blue-500"},rejected:{icon:ti,label:"Rejected",color:"text-destructive"},executed:{icon:yc,label:"Done",color:"text-green-500"},failed:{icon:Ea,label:"Failed",color:"text-destructive"}};function PXe({action:e,expanded:r,onToggle:n}){const i=MXe[e.status],s=i.icon;return d.jsxs("div",{className:"border rounded-md",children:[d.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full px-3 py-2.5 text-left hover:bg-muted/50 transition-colors",onClick:n,children:[d.jsx(s,{className:qe("h-4 w-4 shrink-0",i.color,e.status==="approved"&&"animate-spin")}),d.jsxs("span",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"font-mono text-sm font-medium",children:e.tool}),d.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["Step ",e.order+1]})]}),d.jsx(tn,{variant:"outline",className:"text-2xs px-1.5 py-0",children:i.label}),r?d.jsx(al,{className:"h-4 w-4 text-muted-foreground"}):d.jsx(No,{className:"h-4 w-4 text-muted-foreground"})]}),r&&d.jsxs("div",{className:"px-3 pb-3 pt-1 border-t bg-muted/30",children:[d.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),d.jsx("pre",{className:"text-xs bg-background rounded p-2 overflow-x-auto max-h-48",children:JSON.stringify(e.args,null,2)}),e.result&&d.jsx("div",{className:qe("mt-2 text-xs rounded p-2",e.result.ok?"bg-green-500/10 text-green-700 dark:text-green-400":"bg-destructive/10 text-destructive"),children:e.result.message})]})]})}function LXe({plan:e,onApprove:r,onReject:n,isExecuting:i,className:s}){const[o,a]=y.useState(new Set),l=g=>{a(v=>{const b=new Set(v);return b.has(g)?b.delete(g):b.add(g),b})},u=e.actions.filter(g=>g.status==="pending").length,c=e.actions.filter(g=>g.status==="executed").length,h=e.actions.filter(g=>g.status==="failed").length,p=u===0;return d.jsxs(On,{className:qe("p-4 space-y-3",s),children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{children:[d.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:[d.jsx($Xe,{className:"h-4 w-4"}),"Plan",d.jsxs(tn,{variant:"secondary",className:"text-2xs px-1.5 py-0",children:[e.actions.length," step",e.actions.length!==1?"s":""]})]}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.summary})]}),p&&d.jsx(tn,{variant:h>0?"destructive":"success",className:"shrink-0",children:h>0?`${h} failed`:"Complete"})]}),d.jsx("div",{className:"space-y-1.5",children:e.actions.map(g=>d.jsx(PXe,{action:g,expanded:o.has(g.id),onToggle:()=>l(g.id)},g.id))}),u>0&&d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[d.jsx(ke,{size:"sm",onClick:()=>r(),disabled:i,children:i?d.jsxs(d.Fragment,{children:[d.jsx(ir,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Executing..."]}):d.jsxs(d.Fragment,{children:[d.jsx(R4,{className:"h-3.5 w-3.5 mr-1.5"}),"Execute all (",u,")"]})}),d.jsxs(ke,{size:"sm",variant:"outline",onClick:n,disabled:i,children:[d.jsx(ti,{className:"h-3.5 w-3.5 mr-1.5"}),"Reject"]})]}),p&&!i&&d.jsxs("p",{className:"text-xs text-muted-foreground",children:[c>0&&`${c} action${c!==1?"s":""} executed.`,h>0&&` ${h} failed.`]})]})}function $Xe({className:e}){return d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[d.jsx("rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}),d.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),d.jsx("path",{d:"M12 11h4"}),d.jsx("path",{d:"M12 16h4"}),d.jsx("path",{d:"M8 11h.01"}),d.jsx("path",{d:"M8 16h.01"})]})}function uH({items:e,className:r}){const[n,i]=y.useState(!1);if(e.length===0)return null;const s=e.filter(l=>l.status==="completed").length,o=e.length,a=o>0?Math.round(s/o*100):0;return d.jsxs("div",{className:qe("rounded-lg border bg-muted/30 p-3 space-y-2",r),children:[d.jsxs("button",{type:"button",onClick:()=>i(l=>!l),className:"flex items-center gap-2 w-full text-left",children:[d.jsx(al,{className:qe("h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-200",!n&&"-rotate-90")}),d.jsx("span",{className:"text-xs font-medium text-foreground",children:"Tasks"}),d.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:d.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-300",style:{width:`${a}%`}})}),d.jsxs("span",{className:"text-2xs text-muted-foreground tabular-nums",children:[s,"/",o]})]}),n&&d.jsx("div",{className:"space-y-1",children:e.map(l=>d.jsxs("div",{className:qe("flex items-start gap-2 text-xs py-0.5",l.status==="completed"&&"text-muted-foreground"),children:[l.status==="completed"?d.jsx(yc,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-green-500"}):l.status==="in-progress"?d.jsx(ir,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-primary animate-spin"}):d.jsx(Age,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-muted-foreground/50"}),d.jsx("span",{className:qe("flex-1 min-w-0",l.status==="completed"&&"line-through"),children:l.title})]},l.id))})]})}function DXe({files:e,onAccept:r,onReject:n,onAcceptAll:i,onRejectAll:s,onFileClick:o,className:a}){const l=y.useRef(null),[u,c]=y.useState(!1);if(y.useEffect(()=>{const p=l.current;if(!p||typeof ResizeObserver>"u")return;const g=()=>{c(p.clientWidth<560)};g();const v=new ResizeObserver(()=>g());return v.observe(p),()=>v.disconnect()},[]),e.length===0)return null;const h=e.filter(p=>p.state==="undecided").length;return d.jsxs("div",{ref:l,className:qe("overflow-hidden rounded-lg border bg-muted/30",a),children:[d.jsxs("div",{className:"flex items-center justify-between gap-2 border-b bg-muted/20 px-3 py-2",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[d.jsx(Rl,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsxs("span",{className:"truncate text-xs font-medium",children:["Files changed (",e.length,")"]}),h>0&&d.jsxs("span",{className:"shrink-0 text-2xs text-amber-500 dark:text-amber-400",children:[h," pending"]})]}),h>0&&d.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[d.jsxs(ke,{size:u?"icon":"sm",variant:"ghost",className:qe("h-6 shrink-0 text-xs",u?"w-6 p-0":"px-2"),onClick:i,title:"Keep all","aria-label":"Keep all",children:[d.jsx(os,{className:qe("h-3 w-3 shrink-0",!u&&"mr-1")}),!u&&"Keep all"]}),d.jsxs(ke,{size:u?"icon":"sm",variant:"ghost",className:qe("h-6 shrink-0 text-xs",u?"w-6 p-0":"px-2"),onClick:s,title:"Undo all","aria-label":"Undo all",children:[d.jsx(uh,{className:qe("h-3 w-3 shrink-0",!u&&"mr-1")}),!u&&"Undo all"]})]})]}),d.jsx("div",{className:"divide-y",children:e.map(p=>d.jsxs("div",{className:qe("flex items-center gap-2 px-3 py-1.5 text-xs",p.state==="accepted"&&"bg-green-500/5",p.state==="rejected"&&"bg-red-500/5 text-muted-foreground"),children:[d.jsx(bo,{filename:p.name,className:"h-3.5 w-3.5 shrink-0"}),d.jsx("button",{type:"button",className:qe("min-w-0 flex-1 truncate text-left hover:underline cursor-pointer",p.state==="rejected"&&"line-through"),title:`Review diff for ${p.path}`,onClick:()=>o==null?void 0:o(p.path),children:p.path}),p.state==="undecided"&&d.jsxs("div",{className:"ml-auto flex items-center gap-0.5 shrink-0",children:[d.jsx("button",{type:"button",className:"p-1 rounded hover:bg-primary/10 text-primary transition-colors",onClick:()=>o==null?void 0:o(p.path),title:"Review changes",children:d.jsx(wm,{className:"h-3 w-3"})}),d.jsx("button",{type:"button",className:"p-1 rounded hover:bg-green-500/20 text-green-600 dark:text-green-400 transition-colors",onClick:()=>r==null?void 0:r(p.path),title:"Keep all changes",children:d.jsx(os,{className:"h-3 w-3"})}),d.jsx("button",{type:"button",className:"p-1 rounded hover:bg-red-500/20 text-red-600 dark:text-red-400 transition-colors",onClick:()=>n==null?void 0:n(p.path),title:"Undo all changes",children:d.jsx(uh,{className:"h-3 w-3"})})]}),p.state==="accepted"&&d.jsx("span",{className:"text-2xs text-green-600 dark:text-green-400 shrink-0",children:"Kept"}),p.state==="rejected"&&d.jsx("span",{className:"text-2xs text-red-500 shrink-0",children:"Undone"})]},p.path))})]})}function IXe(e,r,n,i){const s=e.findIndex(u=>u.id===r);if(s<0)return e;const o=[...e],[a]=o.splice(s,1);if(!a)return e;if(n==null)return o.push(a),o;const l=o.findIndex(u=>u.id===n);return l<0?e:(o.splice(l+(i==="after"?1:0),0,a),o)}function BXe({item:e,index:r}){return d.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border/40 bg-background px-3 py-2 text-sm shadow-2xl ring-1 ring-primary/10",children:[d.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground",children:r===0?d.jsx(p9,{className:"h-3.5 w-3.5 text-primary"}):d.jsx(No,{className:"h-3.5 w-3.5 text-muted-foreground"})}),d.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground",children:d.jsx(KG,{className:"h-3.5 w-3.5"})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[r===0?d.jsx("span",{className:"mb-0.5 block text-2xs font-medium uppercase tracking-wider text-primary/70",children:"Next"}):d.jsxs("span",{className:"mb-0.5 block text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:["Queued #",r+1]}),d.jsx("span",{className:"whitespace-pre-wrap break-words text-foreground",children:e.displayContent??e.content})]})]})}function zXe({item:e,index:r,onRemove:n,onEdit:i,onReorder:s,onSendToParallelThread:o,dragActive:a,dropBefore:l,dropAfter:u,onDragStart:c}){const[h,p]=y.useState(!1),[g,v]=y.useState(!0),[b,_]=y.useState(e.displayContent??e.content),k=y.useRef(null),w=h||!a;y.useEffect(()=>{if(h){const A=k.current;A&&(A.focus(),A.setSelectionRange(A.value.length,A.value.length))}},[h]),y.useEffect(()=>{h||_(e.displayContent??e.content)},[e.content,e.displayContent,h]);const C=y.useCallback(()=>{const A=b.trim(),E=e.displayContent??e.content;A&&A!==E&&(i==null||i(e.id,A)),p(!1)},[b,e.content,e.displayContent,e.id,i]),j=y.useCallback(()=>{_(e.displayContent??e.content),p(!1)},[e.content,e.displayContent]),T=y.useCallback(A=>{A.key==="Enter"&&!A.shiftKey?(A.preventDefault(),C()):A.key==="Escape"&&j()},[C,j]);return d.jsxs(d.Fragment,{children:[l&&d.jsx("div",{className:"relative h-0",children:d.jsx("div",{className:"absolute inset-x-2 -top-px h-0.5 rounded-full bg-primary shadow-[0_0_0_1px_hsl(var(--background))]"})}),d.jsxs("div",{"data-queue-id":e.id,className:qe("group flex cursor-grab touch-none items-start gap-2 rounded-lg border border-border/40 bg-muted/50 px-3 py-2 text-sm transition-all duration-150 ease-out hover:bg-muted/70 active:cursor-grabbing",a&&"border-dashed border-primary/35 bg-primary/5 opacity-0"),onPointerDown:A=>{h||!s||A.target.closest('button, textarea, input, a, [data-no-drag="true"]')||c==null||c(e.id,A)},children:[d.jsx("button",{type:"button","data-no-drag":"true",className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground hover:bg-foreground/10 hover:text-foreground transition-colors",onClick:()=>v(A=>!A),"aria-label":g?"Expand queued message":"Collapse queued message",title:g?"Expand queued message":"Collapse queued message",children:g?d.jsx(No,{className:"h-3.5 w-3.5"}):r===0?d.jsx(p9,{className:"h-3.5 w-3.5 text-primary"}):d.jsx(al,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s&&!h&&d.jsx("div",{className:"mt-0.5 shrink-0 rounded p-0.5 text-muted-foreground cursor-grab active:cursor-grabbing touch-none",title:"Drag to reorder","aria-label":"Drag to reorder",children:d.jsx(KG,{className:"h-3.5 w-3.5"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[r===0&&!h&&d.jsx("span",{className:"text-2xs font-medium uppercase tracking-wider text-primary/70 block mb-0.5",children:"Next"}),r>0&&!h&&d.jsxs("span",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground block mb-0.5",children:["Queued #",r+1]}),h?d.jsx("textarea",{ref:k,value:b,onChange:A=>_(A.target.value),onKeyDown:T,onBlur:C,rows:Math.min(b.split(`
|
|
1157
1157
|
`).length,5),className:"w-full resize-none rounded border border-primary/30 bg-background px-2 py-1 text-sm outline-none focus:border-primary focus:ring-1 focus:ring-primary/20"}):g?d.jsx("span",{className:"block truncate text-foreground",children:e.displayContent??e.content}):d.jsx("span",{className:"whitespace-pre-wrap break-words text-foreground",children:e.displayContent??e.content})]}),d.jsx("div",{className:qe("mt-0.5 flex shrink-0 items-center gap-0.5 transition-opacity",w?"opacity-0 group-hover:opacity-100":"opacity-0"),children:h?d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button","data-no-drag":"true",className:"p-1 rounded hover:bg-primary/10 text-primary transition-colors",onClick:C,title:"Save",children:d.jsx(os,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button","data-no-drag":"true",className:"p-1 rounded hover:bg-foreground/10 text-muted-foreground transition-colors",onClick:j,title:"Cancel",children:d.jsx(ti,{className:"h-3.5 w-3.5"})})]}):d.jsxs(d.Fragment,{children:[i&&d.jsx("button",{type:"button","data-no-drag":"true",className:"p-1 rounded hover:bg-foreground/10 text-muted-foreground transition-colors",onClick:()=>p(!0),title:"Edit message",children:d.jsx(y9,{className:"h-3 w-3"})}),o&&d.jsx("button",{type:"button","data-no-drag":"true",className:"p-1 rounded hover:bg-primary/10 text-muted-foreground hover:text-primary transition-colors",onClick:()=>o(e.id),title:"Send to parallel thread",children:d.jsx(Xg,{className:"h-3 w-3"})}),d.jsx("button",{type:"button","data-no-drag":"true",className:"p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors",onClick:()=>n==null?void 0:n(e.id),title:"Remove from queue",children:d.jsx(ti,{className:"h-3.5 w-3.5"})})]})})]}),u&&d.jsx("div",{className:"relative h-0",children:d.jsx("div",{className:"absolute inset-x-2 -top-px h-0.5 rounded-full bg-primary shadow-[0_0_0_1px_hsl(var(--background))]"})})]})}function dH({items:e,onRemove:r,onEdit:n,onReorder:i,onSendToParallelThread:s,className:o}){const a=y.useRef(null),l=y.useRef(null),[u,c]=y.useState(null),[h,p]=y.useState(null),[g,v]=y.useState(null);y.useEffect(()=>{if(u&&!e.some(C=>C.id===u)){c(null),p(null),v(null);return}h!=null&&h.targetId&&!e.some(C=>C.id===h.targetId)&&p(u?{targetId:u,placement:"before"}:null)},[u,h,e]),y.useEffect(()=>{var R;if(!u||!g)return;document.body.style.cursor="grabbing",document.body.style.userSelect="none",document.body.style.touchAction="none";const C=(P,H)=>{var K,M;const $=Array.from(((K=a.current)==null?void 0:K.querySelectorAll("[data-queue-id]"))??[]);if($.length===0){p(null);return}const U=$.filter(B=>B.dataset.queueId&&B.dataset.queueId!==u);if(U.length===0){p({targetId:null,placement:"after"});return}for(const B of U){const L=B.dataset.queueId;if(!L)continue;const z=B.getBoundingClientRect(),W=z.top+z.height/2;if(H<W){p({targetId:L,placement:"before"});return}}const I=((M=U[U.length-1])==null?void 0:M.dataset.queueId)??null;p(I?{targetId:I,placement:"after"}:{targetId:null,placement:"after"})},j=P=>{P.pointerId===g.pointerId&&(v(H=>H&&{...H,x:P.clientX,y:P.clientY}),C(P.clientX,P.clientY))},T=P=>{var $,U;if(P&&P.pointerId!==g.pointerId)return;u&&h&&h.targetId!==u&&(i==null||i(u,h.targetId,h.placement));const H=l.current;($=H==null?void 0:H.hasPointerCapture)!=null&&$.call(H,g.pointerId)&&((U=H.releasePointerCapture)==null||U.call(H,g.pointerId)),l.current=null,c(null),p(null),v(null)},A=()=>{T()},E=()=>{T()};return window.addEventListener("pointermove",j),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",T),window.addEventListener("blur",E),(R=l.current)==null||R.addEventListener("lostpointercapture",A),()=>{var P;document.body.style.cursor="",document.body.style.userSelect="",document.body.style.touchAction="",window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",T),window.removeEventListener("blur",E),(P=l.current)==null||P.removeEventListener("lostpointercapture",A)}},[g,u,h,i]);const b=y.useCallback((C,j)=>{var E;if(!i||j.button!==0&&j.pointerType!=="touch"&&j.pointerType!=="pen")return;j.preventDefault();const T=j.currentTarget.closest("[data-queue-id]");if(!T)return;l.current=T,(E=T.setPointerCapture)==null||E.call(T,j.pointerId);const A=T.getBoundingClientRect();c(C),p({targetId:C,placement:"before"}),v({id:C,pointerId:j.pointerId,x:j.clientX,y:j.clientY,offsetX:j.clientX-A.left,offsetY:j.clientY-A.top,width:A.width,height:A.height})},[i]);if(e.length===0)return null;const _=u&&h&&(h.targetId!==u||h.placement==="after")?IXe(e,u,h.targetId,h.placement):e,k=g?_.findIndex(C=>C.id===g.id):-1,w=k>=0?_[k]:null;return d.jsxs("div",{ref:a,className:qe("space-y-1.5",o),children:[d.jsx("div",{className:"flex items-center gap-1.5 px-0.5",children:d.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:[e.length," queued message",e.length!==1?"s":""]})}),_.map((C,j)=>d.jsx(zXe,{item:C,index:j,onRemove:r,onEdit:n,onReorder:i,onSendToParallelThread:s,dragActive:u===C.id,dropBefore:!!(u&&(h==null?void 0:h.targetId)===C.id&&h.placement==="before"&&u!==C.id),dropAfter:!!(u&&(h==null?void 0:h.targetId)===C.id&&h.placement==="after"&&u!==C.id),onDragStart:b},C.id)),g&&w&&d.jsx("div",{className:"pointer-events-none fixed z-50",style:{left:`${g.x-g.offsetX}px`,top:`${g.y-g.offsetY}px`,width:`${g.width}px`,minHeight:`${g.height}px`},children:d.jsx("div",{className:"scale-[1.01] opacity-95",children:d.jsx(BXe,{item:w,index:k})})})]})}function FXe({usage:e}){if(!e||e.limit<=0)return null;const r=Math.round(e.ratio*100),n=y.useMemo(()=>{if(!e||e.total===0)return[];const k=e.total;return[{label:"System",tokens:e.system,pct:Math.round(e.system/k*100),color:"var(--ctx-system)"},{label:"History",tokens:e.history,pct:Math.round(e.history/k*100),color:"var(--ctx-history)"},{label:"Tool Results",tokens:e.toolResults,pct:Math.round(e.toolResults/k*100),color:"var(--ctx-tool-results)"},{label:"Tools",tokens:e.tools,pct:Math.round(e.tools/k*100),color:"var(--ctx-tools)"}].filter(w=>w.tokens>0)},[e]),i=22,s=3,o=(i-s)/2,a=2*Math.PI*o,l=y.useMemo(()=>{if(!e||e.limit<=0)return[];const k=[];let w=0;for(const C of n){const T=C.tokens/e.limit*a;k.push({offset:w,length:T,color:C.color}),w+=T}return k},[n,e,a]),u=r>=90?"text-red-500":r>=75?"text-amber-500":"text-emerald-500",c=k=>k>=1e3?`${(k/1e3).toFixed(1)}k`:String(k),[h,p]=y.useState(!1),[g,v]=y.useState(!1),b=y.useCallback(()=>p(k=>!k),[]),_=y.useCallback(k=>{v(k),!k&&!h&&p(!1)},[h]);return d.jsxs(Cn,{open:h||g,onOpenChange:_,children:[d.jsx(jn,{asChild:!0,children:d.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1.5 px-1.5 py-1 rounded-md hover:bg-muted/50 cursor-pointer transition-colors",children:[d.jsxs("svg",{width:i,height:i,viewBox:`0 0 ${i} ${i}`,className:`-rotate-90 ${u}`,children:[d.jsx("circle",{cx:i/2,cy:i/2,r:o,fill:"none",stroke:"currentColor",strokeWidth:s,opacity:.15}),l.map((k,w)=>d.jsx("circle",{cx:i/2,cy:i/2,r:o,fill:"none",stroke:k.color,strokeWidth:s,strokeDasharray:`${k.length} ${a-k.length}`,strokeDashoffset:-k.offset,strokeLinecap:"round",opacity:.85},w))]}),d.jsxs("span",{className:"text-2xs tabular-nums text-muted-foreground",children:[r,"%"]})]})}),d.jsx(xn,{side:"bottom",className:"max-w-[220px] bg-popover text-popover-foreground border shadow-md",onPointerDownOutside:()=>p(!1),children:d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex items-center justify-between text-xs font-medium",children:[d.jsx("span",{children:"Context Window"}),d.jsxs("span",{className:"tabular-nums",children:[c(e.total)," / ",c(e.limit)]})]}),d.jsx("div",{className:"w-full h-1.5 rounded-full bg-muted overflow-hidden",children:d.jsx("div",{className:`h-full rounded-full transition-all ${r>=90?"bg-red-500":r>=75?"bg-amber-500":"bg-emerald-500"}`,style:{width:`${Math.min(r,100)}%`}})}),d.jsx("div",{className:"space-y-0.5",children:n.map(k=>d.jsxs("div",{className:"flex items-center justify-between text-xs",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{backgroundColor:k.color}}),d.jsx("span",{className:"text-muted-foreground",children:k.label})]}),d.jsxs("span",{className:"tabular-nums text-muted-foreground",children:[k.pct,"%"]})]},k.label))}),e.pruned&&d.jsx("div",{className:"text-2xs text-amber-500 pt-0.5 border-t border-border",children:"Old messages pruned to fit context"})]})})]})}const d1=Mn(),HXe=P0();function WXe(e){const[r,n]=y.useState([]),i=y.useCallback(async()=>{try{const l=e?`${d1}/api/consent/pending/${e}`:`${d1}/api/consent/pending`,c=await(await fetch(l)).json();n(c.requests)}catch{}},[e]);y.useEffect(()=>{const l=new WebSocket(HXe);return l.onmessage=u=>{try{const c=JSON.parse(u.data);if(c.type==="consent.required"){const h=c.payload;(!e||h.sessionId===e)&&n(p=>[...p,h])}if(c.type==="consent.resolved"){const h=c.payload;n(p=>p.filter(g=>g.id!==h.requestId))}}catch{}},l.onopen=()=>i(),()=>l.close()},[i,e]);const s=y.useCallback(async l=>{try{await fetch(`${d1}/api/consent/${l}/approve`,{method:"POST"}),n(u=>u.filter(c=>c.id!==l))}catch{}},[]),o=y.useCallback(async(l,u)=>{try{await fetch(`${d1}/api/consent/${l}/reject`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:u})}),n(c=>c.filter(h=>h.id!==l))}catch{}},[]),a=y.useCallback(async(l,u)=>{try{const h=await(await fetch(`${d1}/api/consent/pending/${l}/approve-all`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:u})})).json(),p=new Set(h.requestIds??[]);return p.size>0?n(g=>g.filter(v=>!p.has(v.id))):n(g=>g.filter(v=>v.sessionId!==l)),!0}catch{return!1}},[]);return{queue:r,approve:s,reject:o,approveAllForSession:a,refresh:i}}function UXe(){const[e,r]=y.useState(null),n=y.useCallback(async()=>{try{const s=await(await fetch(`${d1}/api/consent/policy`)).json();r(s)}catch{r(null)}},[]);return y.useEffect(()=>{n()},[n]),{policy:e,refresh:n}}function hH({risk:e}){const r={low:"bg-green-500/10 text-green-600 dark:text-green-400",medium:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",high:"bg-red-500/10 text-red-600 dark:text-red-400"},i={low:M4,medium:rK,high:w8}[e];return d.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${r[e]}`,children:[d.jsx(i,{className:"h-3 w-3"}),e]})}function fH({level:e}){const r={none:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",once:"bg-blue-500/10 text-blue-600 dark:text-blue-400",always:"bg-amber-500/10 text-amber-700 dark:text-amber-300",dangerous:"bg-red-500/10 text-red-600 dark:text-red-400"};return d.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${r[e]}`,children:e})}function pH({expiresAt:e}){const[r,n]=y.useState("");return y.useEffect(()=>{const i=()=>{const o=new Date(e).getTime()-Date.now();if(o<=0){n("expired");return}const a=Math.ceil(o/1e3);a>60?n(`${Math.ceil(a/60)}m`):n(`${a}s`)};i();const s=setInterval(i,1e3);return()=>clearInterval(s)},[e]),d.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[d.jsx($m,{className:"h-3 w-3"}),r]})}function mH({toolName:e}){return e.startsWith("terminal.")?d.jsx(Xo,{className:"h-4 w-4"}):e.startsWith("file.")?d.jsx(Rl,{className:"h-4 w-4"}):d.jsx(JG,{className:"h-4 w-4"})}function VXe({preview:e,toolName:r}){const n=e.command,i=e.path,s=e.content;return n?d.jsxs("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed overflow-x-auto",children:[d.jsx("span",{className:"text-muted-foreground",children:"$ "}),n]}):i?d.jsxs("div",{className:"rounded-md bg-muted p-3 text-xs leading-relaxed overflow-x-auto",children:[d.jsxs("div",{className:"text-muted-foreground mb-1",children:[r,": ",i]}),s&&d.jsx("pre",{className:"font-mono whitespace-pre-wrap",children:s.length>500?s.slice(0,500)+"...":s})]}):d.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs leading-relaxed overflow-x-auto",children:JSON.stringify(e,null,2)})}function qXe({request:e,onApprove:r,onReject:n,compact:i=!1}){const[s,o]=y.useState(!1),a=async()=>{o(!0),r(e.id)},l=async()=>{o(!0),n(e.id)};return i?d.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg border bg-card",children:[d.jsx(mH,{toolName:e.toolName}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-medium truncate",children:e.toolName}),d.jsx(hH,{risk:e.risk}),d.jsx(fH,{level:e.policy.consentLevel}),d.jsx(pH,{expiresAt:e.expiresAt})]}),d.jsx("p",{className:"text-xs text-muted-foreground truncate",children:e.summary})]}),d.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[d.jsxs("button",{onClick:a,disabled:s,className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-md text-xs font-medium bg-green-500/10 text-green-600 dark:text-green-400 hover:bg-green-500/20 disabled:opacity-50 transition-colors",children:[d.jsx(tD,{className:"h-3 w-3"}),"Approve"]}),d.jsxs("button",{onClick:l,disabled:s,className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-md text-xs font-medium bg-red-500/10 text-red-600 dark:text-red-400 hover:bg-red-500/20 disabled:opacity-50 transition-colors",children:[d.jsx(w8,{className:"h-3 w-3"}),"Reject"]})]})]}):d.jsxs("div",{className:"rounded-lg border bg-card shadow-sm overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b bg-muted/30",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(mH,{toolName:e.toolName}),d.jsx("span",{className:"text-sm font-medium",children:e.toolName}),d.jsx(hH,{risk:e.risk}),d.jsx(fH,{level:e.policy.consentLevel})]}),d.jsx(pH,{expiresAt:e.expiresAt})]}),d.jsxs("div",{className:"p-4 space-y-3",children:[d.jsx("p",{className:"text-sm text-foreground",children:e.summary}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"text-xs text-muted-foreground",children:e.policy.description}),!e.policy.knownTool&&d.jsx("p",{className:"text-xs text-red-600 dark:text-red-400",children:"Unknown tool: blocked behind dangerous consent until added to the active profile."})]}),d.jsx(VXe,{preview:e.preview,toolName:e.toolName})]}),d.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t bg-muted/20",children:[d.jsxs("button",{onClick:l,disabled:s,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-md text-xs font-medium bg-red-500/10 text-red-600 dark:text-red-400 hover:bg-red-500/20 disabled:opacity-50 transition-colors",children:[d.jsx(w8,{className:"h-3.5 w-3.5"}),"Reject"]}),d.jsxs("button",{onClick:a,disabled:s,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-md text-xs font-medium bg-green-500/10 text-green-600 dark:text-green-400 hover:bg-green-500/20 disabled:opacity-50 transition-colors",children:[d.jsx(tD,{className:"h-3.5 w-3.5"}),"Approve"]})]})]})}function GXe({status:e}){const r={running:{icon:ir,label:"Running",color:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},"awaiting-approval":{icon:rK,label:"Awaiting Approval",color:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"},"needs-input":{icon:$m,label:"Needs Input",color:"bg-orange-500/10 text-orange-600 dark:text-orange-400"},completed:{icon:yc,label:"Completed",color:"bg-green-500/10 text-green-600 dark:text-green-400"},failed:{icon:wh,label:"Failed",color:"bg-red-500/10 text-red-600 dark:text-red-400"}},{icon:n,label:i,color:s}=r[e];return d.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${s}`,children:[d.jsx(n,{className:`h-3 w-3 ${e==="running"?"animate-spin":""}`}),i]})}function KXe({className:e="",compact:r=!1,sessionId:n,onApproveAllEnabled:i}){const{queue:s,approve:o,reject:a,approveAllForSession:l}=WXe(n),{policy:u}=UXe(),[c,h]=y.useState(!1),p=y.useMemo(()=>n?s.filter(v=>v.sessionId===n):s,[s,n]),g=async()=>{if(!n||c)return;h(!0),await l(n)&&(i==null||i()),h(!1)};return p.length===0?null:d.jsxs("div",{className:`space-y-2 ${e}`,children:[d.jsxs("div",{className:"flex items-center justify-between px-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(GXe,{status:"awaiting-approval"}),d.jsxs("div",{className:"flex flex-col",children:[d.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.length," pending ",p.length===1?"request":"requests"]}),u&&d.jsxs("span",{className:"text-xs text-muted-foreground",children:["Profile: ",d.jsx("span",{className:"font-medium text-foreground",children:u.activeProfileName??"custom"})," ","• ",u.toolCount," configured tools • unknown tools require dangerous consent"]})]})]}),n&&p.length>0&&d.jsx("button",{onClick:g,disabled:c,className:"text-xs text-green-600 hover:text-green-500 dark:text-green-400 dark:hover:text-green-300 disabled:opacity-50 disabled:cursor-not-allowed",children:c?"Approving...":"Approve all in this session"})]}),d.jsx("div",{className:"space-y-2",children:p.map(v=>d.jsx(qXe,{request:v,onApprove:o,onReject:a,compact:r},v.id))})]})}const gH=5e3;let YXe=0,x1=[],Y5=new Set;function eE(e,r){x1.push({id:YXe++,ts:Date.now(),type:e,raw:r}),x1.length>gH&&(x1=x1.slice(-gH)),Y5.forEach(n=>n())}function XXe(){x1=[],Y5.forEach(e=>e())}function ZXe(){const[,e]=y.useState(0);return y.useEffect(()=>{const r=()=>e(n=>n+1);return Y5.add(r),()=>{Y5.delete(r)}},[]),x1}const JXe={request:"text-orange-400",token:"text-gray-400",tool_call_delta:"text-blue-400",tool_start:"text-yellow-400",tool_output:"text-green-400",tool_result:"text-emerald-400",thinking:"text-purple-400",done:"text-gray-500",error:"text-red-400"},tE=20;function QXe({onClose:e}){const r=ZXe(),n=y.useRef(null),[i,s]=y.useState(!0),[o,a]=y.useState(""),[l,u]=y.useState(!1),[c,h]=y.useState(new Set),p=y.useCallback(k=>{h(w=>{const C=new Set(w);return C.has(k)?C.delete(k):C.add(k),C})},[]),g=o?r.filter(k=>k.type.includes(o)||k.raw.includes(o)):r,v=z9({count:g.length,getScrollElement:()=>n.current,estimateSize:()=>tE,overscan:30}),b=()=>{const k=g.map(w=>`${new Date(w.ts).toISOString().slice(11,23)} ${w.type} ${w.raw}`).join(`
|
|
1158
1158
|
`);navigator.clipboard.writeText(k),u(!0),setTimeout(()=>u(!1),1500)};y.useEffect(()=>{i&&g.length>0&&v.scrollToIndex(g.length-1,{align:"end"})},[g.length,i]);const _=y.useCallback(()=>{const k=n.current;if(!k)return;const w=k.scrollHeight-k.scrollTop-k.clientHeight<40;s(w)},[]);return d.jsxs("div",{className:"flex flex-col h-full bg-[#0d1117] text-[#c9d1d9] text-xs font-mono",children:[d.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-zinc-700/60 shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"SSE Debug"}),d.jsxs("span",{className:"text-2xs text-zinc-500",children:[g.length,"/",r.length]})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("input",{type:"text",placeholder:"Filter...",value:o,onChange:k=>a(k.target.value),className:"h-5 w-28 px-1.5 text-2xs rounded bg-zinc-800 border border-zinc-700 text-zinc-300 placeholder-zinc-500 focus:outline-none focus:border-blue-500"}),d.jsx(ke,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:b,title:"Copy all events",children:l?d.jsx(os,{className:"h-3 w-3 text-green-400"}):d.jsx(ru,{className:"h-3 w-3"})}),d.jsx(ke,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:XXe,children:d.jsx(mh,{className:"h-3 w-3"})}),d.jsx(ke,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:e,children:d.jsx(ti,{className:"h-3 w-3"})})]})]}),d.jsx("div",{ref:n,onScroll:_,className:"flex-1 overflow-y-auto overflow-x-hidden",children:d.jsx("div",{style:{height:`${v.getTotalSize()}px`,position:"relative",width:"100%"},children:v.getVirtualItems().map(k=>{const w=g[k.index],C=new Date(w.ts).toISOString().slice(11,23),j=JXe[w.type]??"text-zinc-400",T=w.raw.length>120,A=c.has(w.id),E=T&&!A?w.raw.slice(0,120)+"…":w.raw;return d.jsxs("div",{"data-index":k.index,ref:v.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${k.start}px)`},className:qe("flex gap-2 px-2 hover:bg-zinc-800/50 leading-tight cursor-pointer select-none",A?"items-start py-1 bg-zinc-800/30":"items-center"),onClick:()=>p(w.id),children:[d.jsx("span",{className:"text-zinc-600 shrink-0 w-20",style:{minHeight:tE},children:C}),d.jsx("span",{className:qe("shrink-0 w-28 text-right",j),style:{minHeight:tE},children:w.type}),d.jsxs("span",{className:qe("text-zinc-400 min-w-0",A?"break-all whitespace-pre-wrap":"truncate"),children:[E,T&&!A&&d.jsx("span",{className:"text-zinc-600 ml-1",children:"▸"})]})]},w.id)})})}),!i&&d.jsx("div",{className:"absolute bottom-2 right-4",children:d.jsx(ke,{variant:"outline",size:"icon",className:"h-6 w-6 rounded-full bg-zinc-800 border-zinc-600",onClick:()=>{s(!0),v.scrollToIndex(g.length-1,{align:"end"})},children:d.jsx(HG,{className:"h-3 w-3"})})})]})}function eZe(e,r=[]){let n=[];function i(o,a){const l=y.createContext(a),u=n.length;n=[...n,a];const c=p=>{var w;const{scope:g,children:v,...b}=p,_=((w=g==null?void 0:g[e])==null?void 0:w[u])||l,k=y.useMemo(()=>b,Object.values(b));return d.jsx(_.Provider,{value:k,children:v})};c.displayName=o+"Provider";function h(p,g){var _;const v=((_=g==null?void 0:g[e])==null?void 0:_[u])||l,b=y.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[c,h]}const s=()=>{const o=n.map(a=>y.createContext(a));return function(l){const u=(l==null?void 0:l[e])||o;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return s.scopeName=e,[i,tZe(s,...r)]}function tZe(...e){const r=e[0];if(e.length===1)return r;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=i.reduce((l,{useScope:u,scopeName:c})=>{const p=u(o)[`__scope${c}`];return{...l,...p}},{});return y.useMemo(()=>({[`__scope${r.scopeName}`]:a}),[a])}};return n.scopeName=r.scopeName,n}function qoe(e){const r=y.useRef({value:e,previous:e});return y.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}function rZe(e){const r=nZe(e),n=y.forwardRef((i,s)=>{const{children:o,...a}=i,l=y.Children.toArray(o),u=l.find(sZe);if(u){const c=u.props.children,h=l.map(p=>p===u?y.Children.count(c)>1?y.Children.only(null):y.isValidElement(c)?c.props.children:null:p);return d.jsx(r,{...a,ref:s,children:y.isValidElement(c)?y.cloneElement(c,void 0,h):null})}return d.jsx(r,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function nZe(e){const r=y.forwardRef((n,i)=>{const{children:s,...o}=n;if(y.isValidElement(s)){const a=aZe(s),l=oZe(o,s.props);return s.type!==y.Fragment&&(l.ref=i?gs(i,a):a),y.cloneElement(s,l)}return y.Children.count(s)>1?y.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var iZe=Symbol("radix.slottable");function sZe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iZe}function oZe(e,r){const n={...r};for(const i in r){const s=e[i],o=r[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...l)=>{const u=o(...l);return s(...l),u}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function aZe(e){var i,s;let r=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=r&&"isReactWarning"in r&&r.isReactWarning;return n?e.ref:(r=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=r&&"isReactWarning"in r&&r.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lZe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Goe=lZe.reduce((e,r)=>{const n=rZe(`Primitive.${r}`),i=y.forwardRef((s,o)=>{const{asChild:a,...l}=s,u=a?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...l,ref:o})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{}),Qj="Switch",[cZe]=eZe(Qj),[uZe,dZe]=cZe(Qj),Koe=y.forwardRef((e,r)=>{const{__scopeSwitch:n,name:i,checked:s,defaultChecked:o,required:a,disabled:l,value:u="on",onCheckedChange:c,form:h,...p}=e,[g,v]=y.useState(null),b=hn(r,j=>v(j)),_=y.useRef(!1),k=g?h||!!g.closest("form"):!0,[w,C]=_h({prop:s,defaultProp:o??!1,onChange:c,caller:Qj});return d.jsxs(uZe,{scope:n,checked:w,disabled:l,children:[d.jsx(Goe.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":Joe(w),"data-disabled":l?"":void 0,disabled:l,value:u,...p,ref:b,onClick:Kt(e.onClick,j=>{C(T=>!T),k&&(_.current=j.isPropagationStopped(),_.current||j.stopPropagation())})}),k&&d.jsx(Zoe,{control:g,bubbles:!_.current,name:i,value:u,checked:w,required:a,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});Koe.displayName=Qj;var Yoe="SwitchThumb",Xoe=y.forwardRef((e,r)=>{const{__scopeSwitch:n,...i}=e,s=dZe(Yoe,n);return d.jsx(Goe.span,{"data-state":Joe(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:r})});Xoe.displayName=Yoe;var hZe="SwitchBubbleInput",Zoe=y.forwardRef(({__scopeSwitch:e,control:r,checked:n,bubbles:i=!0,...s},o)=>{const a=y.useRef(null),l=hn(a,o),u=qoe(n),c=NK(r);return y.useEffect(()=>{const h=a.current;if(!h)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(u!==n&&v){const b=new Event("click",{bubbles:i});v.call(h,n),h.dispatchEvent(b)}},[u,n,i]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Zoe.displayName=hZe;function Joe(e){return e?"checked":"unchecked"}var Qoe=Koe,fZe=Xoe;const qf=y.forwardRef(({className:e,...r},n)=>d.jsx(Qoe,{className:qe("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:n,children:d.jsx(fZe,{className:qe("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));qf.displayName=Qoe.displayName;var SS="Ollama",pZe=.6,mZe=.1,eae="#fff",gZe=eae,yZe="#000",vZe=.75;function D2(e){"@babel/helpers - typeof";return D2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},D2(e)}var xZe=["size","style"];function yH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function rE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?yH(Object(n),!0).forEach(function(i){bZe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function bZe(e,r,n){return r=_Ze(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function _Ze(e){var r=wZe(e,"string");return D2(r)=="symbol"?r:String(r)}function wZe(e,r){if(D2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(D2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function SZe(e,r){if(e==null)return{};var n=kZe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function kZe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var VM=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=SZe(e,xZe);return d.jsxs("svg",rE(rE({fill:"currentColor",fillRule:"evenodd",height:n,style:rE({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[d.jsx("title",{children:SS}),d.jsx("path",{d:"M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z"})]}))});function I2(e){"@babel/helpers - typeof";return I2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},I2(e)}function vH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function CZe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?vH(Object(n),!0).forEach(function(i){jZe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function jZe(e,r,n){return r=TZe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function TZe(e){var r=NZe(e,"string");return I2(r)=="symbol"?r:String(r)}function NZe(e,r){if(I2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(I2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function EZe(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var AZe=y.memo(function(e){var r=Object.assign({},(EZe(e),e));return d.jsx(cl,CZe({Icon:VM,"aria-label":SS,background:gZe,color:yZe,iconMultiple:vZe},r))});function B2(e){"@babel/helpers - typeof";return B2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},B2(e)}var OZe=["size","style"];function xH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function nE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?xH(Object(n),!0).forEach(function(i){RZe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function RZe(e,r,n){return r=MZe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function MZe(e){var r=PZe(e,"string");return B2(r)=="symbol"?r:String(r)}function PZe(e,r){if(B2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(B2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function LZe(e,r){if(e==null)return{};var n=$Ze(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function $Ze(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var tae=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=LZe(e,OZe);return d.jsxs("svg",nE(nE({fill:"currentColor",fillRule:"evenodd",height:n,style:nE({flex:"none",lineHeight:1},i),viewBox:"0 0 87 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[d.jsx("title",{children:SS}),d.jsx("path",{d:"M11.333 2c-2.959 0-5.272.943-6.94 2.884C2.78 6.717 2 9.09 2 12.027c0 2.911.78 5.283 2.394 7.116C6.06 21.03 8.374 22 11.333 22c2.931 0 5.244-.943 6.939-2.83 1.614-1.806 2.42-4.178 2.42-7.143s-.806-5.364-2.42-7.17C16.577 2.943 14.264 2 11.332 2zm0 2.776c1.99 0 3.523.62 4.599 1.914 1.049 1.294 1.587 3.073 1.587 5.337s-.538 4.016-1.587 5.283c-1.076 1.267-2.609 1.914-4.6 1.914-1.99 0-3.55-.674-4.625-1.995-1.05-1.294-1.56-3.019-1.56-5.202 0-2.21.51-3.935 1.56-5.23 1.102-1.347 2.636-2.02 4.626-2.02zM22.979 2v19.623h3.066V2h-3.066zm6.159 0v19.623h3.066V2h-3.066zm12.21 5.31c-1.775 0-3.173.296-4.195.943-1.21.701-1.964 1.833-2.26 3.37l3.04.242c.161-.728.564-1.267 1.156-1.617.511-.323 1.184-.458 2.044-.458 1.99 0 2.986.89 2.986 2.722v.54l-3.04.08c-2.044.054-3.63.485-4.76 1.294-1.237.835-1.829 2.048-1.829 3.612 0 1.159.43 2.102 1.29 2.857.835.728 1.964 1.105 3.417 1.105 1.21 0 2.259-.216 3.146-.62.78-.377 1.453-.89 1.99-1.59v1.833h2.852v-8.895c0-1.698-.43-2.992-1.291-3.882-.969-1.024-2.502-1.536-4.546-1.536zm2.77 7.951v.701c0 1.078-.43 1.968-1.237 2.669-.806.674-1.802 1.024-2.985 1.024-.672 0-1.21-.189-1.64-.512-.431-.324-.62-.728-.62-1.213 0-1.614 1.129-2.473 3.41-2.58l3.073-.089zM56.572 7.31c-1.344 0-2.609.593-3.765 1.806V7.687H49.74v13.936h3.066v-8.356c0-.917.269-1.725.807-2.372.538-.7 1.237-1.024 2.125-1.024 1.828 0 2.743 1.05 2.743 3.18v8.572h3.066v-8.518c0-1.024.242-1.806.78-2.372.511-.593 1.13-.862 1.883-.862 1.075 0 1.829.242 2.313.754.457.486.699 1.294.699 2.4v8.598h3.066v-9.138c0-1.536-.484-2.776-1.398-3.746-.969-.97-2.152-1.429-3.578-1.429-.941 0-1.72.162-2.34.485-.699.324-1.371.917-2.017 1.78-.887-1.51-2.34-2.265-4.384-2.265zm22.593 0c-1.775 0-3.174.296-4.196.943-1.21.701-1.963 1.833-2.26 3.37l3.04.242c.161-.728.565-1.267 1.156-1.617.511-.323 1.184-.458 2.044-.458 1.99 0 2.986.89 2.986 2.722v.54l-3.04.08c-2.043.054-3.63.485-4.76 1.294-1.237.835-1.829 2.048-1.829 3.612 0 1.159.43 2.102 1.291 2.857.834.728 1.964 1.105 3.416 1.105 1.21 0 2.26-.216 3.147-.62.78-.377 1.452-.89 1.99-1.59v1.833H85v-8.895c0-1.698-.43-2.992-1.291-3.882-.968-1.024-2.501-1.536-4.545-1.536zm2.77 7.951v.701c0 1.078-.43 1.968-1.237 2.669-.807.674-1.802 1.024-2.986 1.024-.672 0-1.21-.189-1.64-.512-.43-.324-.619-.728-.619-1.213 0-1.614 1.128-2.473 3.41-2.58l3.072-.089z"})]}))});function z2(e){"@babel/helpers - typeof";return z2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},z2(e)}function bH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function DZe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?bH(Object(n),!0).forEach(function(i){IZe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function IZe(e,r,n){return r=BZe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function BZe(e){var r=zZe(e,"string");return z2(r)=="symbol"?r:String(r)}function zZe(e,r){if(z2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(z2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function FZe(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var HZe=y.memo(function(e){var r=Object.assign({},(FZe(e),e));return d.jsx(ul,DZe({Icon:VM,Text:tae,"aria-label":SS,spaceMultiple:mZe,textMultiple:pZe},r))}),B0=VM;B0.Text=tae;B0.Combine=HZe;B0.Avatar=AZe;B0.colorPrimary=eae;B0.title=SS;var b0="Qwen",WZe=.7,UZe=.2,rae="#615ced",VZe="linear-gradient(to right, #6336E7, #6F69F7)",qZe=rae,GZe="#fff",KZe=.75;function F2(e){"@babel/helpers - typeof";return F2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},F2(e)}var YZe=["size","style"];function _H(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function iE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?_H(Object(n),!0).forEach(function(i){XZe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_H(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function XZe(e,r,n){return r=ZZe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function ZZe(e){var r=JZe(e,"string");return F2(r)=="symbol"?r:String(r)}function JZe(e,r){if(F2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(F2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function QZe(e,r){if(e==null)return{};var n=eJe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function eJe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var qM=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=QZe(e,YZe);return d.jsxs("svg",iE(iE({fill:"currentColor",fillRule:"evenodd",height:n,style:iE({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[d.jsx("title",{children:b0}),d.jsx("path",{d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"})]}))});function H2(e){"@babel/helpers - typeof";return H2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},H2(e)}function wH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function tJe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?wH(Object(n),!0).forEach(function(i){rJe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function rJe(e,r,n){return r=nJe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function nJe(e){var r=iJe(e,"string");return H2(r)=="symbol"?r:String(r)}function iJe(e,r){if(H2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(H2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function sJe(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var oJe=y.memo(function(e){var r=Object.assign({},(sJe(e),e));return d.jsx(cl,tJe({Icon:qM,"aria-label":b0,background:qZe,color:GZe,iconMultiple:KZe},r))});function W2(e){"@babel/helpers - typeof";return W2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},W2(e)}var aJe=["size","style"];function SH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function sE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?SH(Object(n),!0).forEach(function(i){lJe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function lJe(e,r,n){return r=cJe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function cJe(e){var r=uJe(e,"string");return W2(r)=="symbol"?r:String(r)}function uJe(e,r){if(W2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(W2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function dJe(e,r){if(e==null)return{};var n=hJe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function hJe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var nae=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=dJe(e,aJe),o=YAe(b0),a=o.id,l=o.fill;return d.jsxs("svg",sE(sE({height:n,style:sE({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[d.jsx("title",{children:b0}),d.jsx("path",{d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z",fill:l,fillRule:"nonzero"}),d.jsx("defs",{children:d.jsxs("linearGradient",{id:a,x1:"0%",x2:"100%",y1:"0%",y2:"0%",children:[d.jsx("stop",{offset:"0%",stopColor:"#6336E7",stopOpacity:".84"}),d.jsx("stop",{offset:"100%",stopColor:"#6F69F7",stopOpacity:".84"})]})})]}))});function U2(e){"@babel/helpers - typeof";return U2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},U2(e)}var fJe=["size","style"];function kH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function oE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?kH(Object(n),!0).forEach(function(i){pJe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function pJe(e,r,n){return r=mJe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function mJe(e){var r=gJe(e,"string");return U2(r)=="symbol"?r:String(r)}function gJe(e,r){if(U2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(U2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function yJe(e,r){if(e==null)return{};var n=vJe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function vJe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var iae=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=yJe(e,fJe);return d.jsxs("svg",oE(oE({fill:"currentColor",fillRule:"evenodd",height:n,style:oE({flex:"none",lineHeight:1},i),viewBox:"0 0 75 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[d.jsx("title",{children:b0}),d.jsx("path",{d:"M11.425 14.13h3.642l1.529 1.795a7.89 7.89 0 002.166-2.832 8.36 8.36 0 00.771-3.562c0-2.03-.624-3.664-1.874-4.905-1.24-1.25-2.884-1.874-4.931-1.874-1.028 0-1.99.186-2.885.558A6.99 6.99 0 007.45 4.932 8.576 8.576 0 005.656 7.67a8.354 8.354 0 00-.625 3.19c0 2.003.611 3.643 1.834 4.919 1.223 1.276 2.779 1.914 4.666 1.914.39 0 .793-.031 1.21-.093.425-.062.868-.16 1.329-.293l-2.645-3.177zM18.07 22l-2.127-2.46c-.753.293-1.48.51-2.18.652a9.84 9.84 0 01-2.073.226c-2.97 0-5.326-.85-7.072-2.552C2.873 16.164 2 13.865 2 10.966c0-1.577.28-3.052.837-4.426a10.148 10.148 0 012.406-3.576A10.427 10.427 0 018.713.758C10.025.253 11.429 0 12.927 0c2.915 0 5.25.86 7.005 2.579 1.755 1.72 2.632 4.01 2.632 6.872 0 1.764-.354 3.399-1.063 4.905a10.156 10.156 0 01-3.031 3.776L21.714 22H18.07zm5.743-14.675h2.884l2.047 6.433.054.16c.248.789.38 1.373.399 1.755.097-.302.221-.62.372-.958.16-.345.354-.713.585-1.103l4.227-7.218 2.06 7.43c.08.275.146.559.2.851.053.293.097.63.133 1.01.132-.372.265-.708.398-1.01.142-.3.28-.562.412-.784l3.816-6.567h3.243L36.097 20.71l-2.127-7.045a8.683 8.683 0 01-.213-.798 17.846 17.846 0 01-.146-.97 69.17 69.17 0 01-.519 1.063c-.15.302-.265.514-.345.638l-4.28 7.112-4.653-13.385zm24.392 4.785h6.5c-.026-.85-.292-1.52-.797-2.007-.496-.497-1.166-.745-2.008-.745-.957 0-1.768.248-2.432.745-.665.496-1.086 1.165-1.263 2.007zm6.34 3.948l2.061 1.608c-.735.966-1.533 1.67-2.392 2.114-.86.443-1.848.665-2.965.665-1.87 0-3.38-.563-4.533-1.689-1.152-1.134-1.728-2.623-1.728-4.466 0-2.162.66-3.935 1.98-5.317 1.33-1.391 3.018-2.087 5.066-2.087 1.71 0 3.07.532 4.08 1.595 1.02 1.055 1.53 2.473 1.53 4.254 0 .15-.01.345-.027.585-.01.23-.027.51-.054.837h-9.61c0 1.143.288 2.056.864 2.738.576.674 1.342 1.01 2.3 1.01.664 0 1.293-.159 1.887-.478a4.633 4.633 0 001.542-1.369zm14.317 3.868l.957-7.244c.018-.133.031-.27.04-.412.009-.151.013-.368.013-.652 0-.824-.2-1.453-.598-1.887-.399-.444-.98-.665-1.741-.665-1.188 0-2.118.385-2.792 1.156-.673.763-1.112 1.937-1.316 3.523l-.797 6.181H59.77l1.661-12.601h2.752l-.213 1.515c.727-.664 1.476-1.156 2.247-1.475a6.5 6.5 0 012.486-.479c1.293 0 2.3.341 3.017 1.024.727.673 1.09 1.622 1.09 2.845 0 .31-.018.673-.053 1.09-.036.407-.089.886-.16 1.435l-.877 6.647h-2.858z"})]}))});function V2(e){"@babel/helpers - typeof";return V2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},V2(e)}var xJe=["type","extraStyle"];function CH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function jH(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?CH(Object(n),!0).forEach(function(i){bJe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function bJe(e,r,n){return r=_Je(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function _Je(e){var r=wJe(e,"string");return V2(r)=="symbol"?r:String(r)}function wJe(e,r){if(V2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(V2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function SJe(e,r){if(e==null)return{};var n=kJe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function kJe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var CJe=y.memo(function(e){var r=e.type,n=r===void 0?"mono":r,i=e.extraStyle,s=SJe(e,xJe),o=n==="color"?nae:qM;return d.jsx(ul,jH({Icon:o,Text:iae,"aria-label":b0,extraStyle:jH({fontWeight:500},i),spaceMultiple:UZe,textMultiple:WZe},s))}),ld=qM;ld.Color=nae;ld.Text=iae;ld.Combine=CJe;ld.Avatar=oJe;ld.colorPrimary=rae;ld.colorGradient=VZe;ld.title=b0;var Nh="Meta",jJe=.75,TJe=.2,NJe="#1d65c1",sae="linear-gradient(45deg, #007FF8, #0668E1, #007FF8)",EJe=sae,AJe="#fff",OJe=.75;function q2(e){"@babel/helpers - typeof";return q2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},q2(e)}var RJe=["size","style"];function TH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function aE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?TH(Object(n),!0).forEach(function(i){MJe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function MJe(e,r,n){return r=PJe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function PJe(e){var r=LJe(e,"string");return q2(r)=="symbol"?r:String(r)}function LJe(e,r){if(q2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(q2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function $Je(e,r){if(e==null)return{};var n=DJe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function DJe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var GM=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=$Je(e,RJe);return d.jsxs("svg",aE(aE({fill:"currentColor",fillRule:"evenodd",height:n,style:aE({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[d.jsx("title",{children:Nh}),d.jsx("path",{d:"M6.897 4c1.915 0 3.516.932 5.43 3.376l.282-.373c.19-.246.383-.484.58-.71l.313-.35C14.588 4.788 15.792 4 17.225 4c1.273 0 2.469.557 3.491 1.516l.218.213c1.73 1.765 2.917 4.71 3.053 8.026l.011.392.002.25c0 1.501-.28 2.759-.818 3.7l-.14.23-.108.153c-.301.42-.664.758-1.086 1.009l-.265.142-.087.04a3.493 3.493 0 01-.302.118 4.117 4.117 0 01-1.33.208c-.524 0-.996-.067-1.438-.215-.614-.204-1.163-.56-1.726-1.116l-.227-.235c-.753-.812-1.534-1.976-2.493-3.586l-1.43-2.41-.544-.895-1.766 3.13-.343.592C7.597 19.156 6.227 20 4.356 20c-1.21 0-2.205-.42-2.936-1.182l-.168-.184c-.484-.573-.837-1.311-1.043-2.189l-.067-.32a8.69 8.69 0 01-.136-1.288L0 14.468c.002-.745.06-1.49.174-2.23l.1-.573c.298-1.53.828-2.958 1.536-4.157l.209-.34c1.177-1.83 2.789-3.053 4.615-3.16L6.897 4zm-.033 2.615l-.201.01c-.83.083-1.606.673-2.252 1.577l-.138.199-.01.018c-.67 1.017-1.185 2.378-1.456 3.845l-.004.022a12.591 12.591 0 00-.207 2.254l.002.188c.004.18.017.36.04.54l.043.291c.092.503.257.908.486 1.208l.117.137c.303.323.698.492 1.17.492 1.1 0 1.796-.676 3.696-3.641l2.175-3.4.454-.701-.139-.198C9.11 7.3 8.084 6.616 6.864 6.616zm10.196-.552l-.176.007c-.635.048-1.223.359-1.82.933l-.196.198c-.439.462-.887 1.064-1.367 1.807l.266.398c.18.274.362.56.55.858l.293.475 1.396 2.335.695 1.114c.583.926 1.03 1.6 1.408 2.082l.213.262c.282.326.529.54.777.673l.102.05c.227.1.457.138.718.138.176.002.35-.023.518-.073.338-.104.61-.32.813-.637l.095-.163.077-.162c.194-.459.29-1.06.29-1.785l-.006-.449c-.08-2.871-.938-5.372-2.2-6.798l-.176-.189c-.67-.683-1.444-1.074-2.27-1.074z"})]}))});function G2(e){"@babel/helpers - typeof";return G2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},G2(e)}function NH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function IJe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?NH(Object(n),!0).forEach(function(i){BJe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function BJe(e,r,n){return r=zJe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function zJe(e){var r=FJe(e,"string");return G2(r)=="symbol"?r:String(r)}function FJe(e,r){if(G2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(G2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function HJe(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var WJe=y.memo(function(e){var r=Object.assign({},(HJe(e),e));return d.jsx(cl,IJe({Icon:GM,"aria-label":Nh,background:EJe,color:AJe,iconMultiple:OJe},r))});function K2(e){"@babel/helpers - typeof";return K2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},K2(e)}var UJe=["size","style"];function EH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function lE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?EH(Object(n),!0).forEach(function(i){VJe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function VJe(e,r,n){return r=qJe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function qJe(e){var r=GJe(e,"string");return K2(r)=="symbol"?r:String(r)}function GJe(e,r){if(K2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(K2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function KJe(e,r){return JJe(e)||ZJe(e,r)||XJe(e,r)||YJe()}function YJe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1159
1159
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XJe(e,r){if(e){if(typeof e=="string")return AH(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AH(e,r)}}function AH(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,i=new Array(r);n<r;n++)i[n]=e[n];return i}function ZJe(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,s,o,a,l=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,r!==0)for(;!(u=(i=o.call(n)).done)&&(l.push(i.value),l.length!==r);u=!0);}catch(h){c=!0,s=h}finally{try{if(!u&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw s}}return l}}function JJe(e){if(Array.isArray(e))return e}function QJe(e,r){if(e==null)return{};var n=eQe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function eQe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var tQe=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=QJe(e,UJe),o=_j("".concat(Nh,"-brand"),13),a=KJe(o,13),l=a[0],u=a[1],c=a[2],h=a[3],p=a[4],g=a[5],v=a[6],b=a[7],_=a[8],k=a[9],w=a[10],C=a[11],j=a[12];return d.jsxs("svg",lE(lE({fill:"currentColor",fillRule:"evenodd",height:n,style:lE({flex:"none",lineHeight:1},i),viewBox:"0 0 103 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[d.jsx("title",{children:Nh}),d.jsx("path",{d:"M38.337 2.641h3.752l6.38 11.57 6.38-11.57h3.671v19.011H55.46V7.082l-5.594 10.09h-2.872l-5.595-10.09v14.57h-3.06V2.642zm30.058 19.353c-1.418 0-2.664-.314-3.739-.944a6.594 6.594 0 01-2.513-2.614c-.6-1.113-.9-2.39-.9-3.829 0-1.457.293-2.748.88-3.87.587-1.123 1.402-2 2.445-2.635 1.043-.633 2.242-.95 3.596-.95 1.346 0 2.504.319 3.475.957.97.638 1.718 1.532 2.242 2.682.523 1.15.785 2.499.785 4.047v.842h-10.39c.19 1.159.658 2.07 1.403 2.736.745.665 1.686.998 2.824.998.912 0 1.698-.136 2.357-.407a5.997 5.997 0 001.856-1.236l1.625 1.996c-1.616 1.485-3.599 2.227-5.946 2.227zm2.235-11.278c-.642-.656-1.481-.984-2.52-.984-1.011 0-1.858.335-2.54 1.005-.681.67-1.113 1.57-1.293 2.702h7.45c-.09-1.159-.456-2.066-1.097-2.723zm7.748-.712h-2.817V7.492h2.817V3.337h2.953v4.155h4.28v2.512h-4.28v6.369c0 1.059.18 1.815.542 2.267.36.453.98.68 1.855.68.389 0 .718-.016.99-.048l.426-.056c.15-.022.305-.046.467-.073v2.485a8.876 8.876 0 01-2.452.34c-3.187 0-4.781-1.748-4.781-5.242v-6.722zM101 21.654h-2.899v-1.982a5.24 5.24 0 01-1.964 1.718c-.795.403-1.698.604-2.71.604-1.245 0-2.35-.319-3.311-.957-.962-.638-1.718-1.517-2.269-2.635-.55-1.118-.826-2.396-.826-3.836 0-1.448.28-2.73.84-3.843.56-1.113 1.334-1.987 2.323-2.62.989-.634 2.124-.951 3.406-.951.967 0 1.834.188 2.601.563a5.145 5.145 0 011.91 1.596V7.49H101v14.164zm-2.953-9.206c-.316-.806-.815-1.442-1.497-1.908-.682-.466-1.47-.7-2.363-.7-1.265 0-2.272.426-3.021 1.277-.75.851-1.125 2-1.124 3.45 0 1.457.36 2.611 1.083 3.462.722.851 1.702 1.276 2.94 1.276.911 0 1.724-.235 2.438-.706a3.987 3.987 0 001.544-1.9v-4.251z"}),d.jsx("path",{d:"M8.627 0h-.029l-.04 3.27.028-.001c2.146 0 3.81 1.696 7.43 7.807l.22.372.014.024 2.026-3.047-.014-.023a60.949 60.949 0 00-1.374-2.146 35.014 35.014 0 00-1.47-2.036C13.026 1.165 11.024 0 8.628 0z",fill:l.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M8.598 0C6.19.013 4.062 1.573 2.525 3.961a5.44 5.44 0 00-.013.021l2.82 1.54.015-.022c.897-1.354 2.014-2.218 3.211-2.23l.027-.001L8.627 0h-.03z",fill:u.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M2.525 3.963l-.013.02C1.502 5.56.749 7.494.342 9.58l-.005.027 3.17.75c0-.01.002-.018.004-.028.339-1.833.984-3.533 1.822-4.806l.013-.02-2.82-1.54z",fill:c.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M3.511 10.33L.342 9.582l-.005.027A18.541 18.541 0 000 13.09v.028l3.25.292v-.029a15.728 15.728 0 01.262-3.05z",fill:h.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M3.349 14.422a6.822 6.822 0 01-.099-1.017v-.028L0 13.085v.031a11.105 11.105 0 00.183 2.064l3.17-.731a5.131 5.131 0 01-.004-.027z",fill:p.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M4.09 16.112c-.354-.387-.605-.945-.736-1.659l-.005-.027-3.171.731.005.027c.24 1.262.71 2.313 1.383 3.108l.018.022 2.524-2.181a2.635 2.635 0 01-.019-.02z",fill:g.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M15.484 9.067a399.491 399.491 0 00-3.069 4.781c-2.545 4-3.426 4.897-4.843 4.897-.591 0-1.085-.211-1.464-.615a2.313 2.313 0 01-.019-.02l-2.523 2.18.018.021C4.514 21.397 5.825 22 7.448 22c2.456 0 4.222-1.16 7.361-6.662l2.21-3.913a51.6 51.6 0 00-1.535-2.358z",fill:"#0082FB"}),d.jsx("path",{d:"M16.89 2.432a19.722 19.722 0 00-1.471 1.79c.472.604.96 1.281 1.47 2.038.6-.93 1.16-1.682 1.71-2.258l.019-.02-1.728-1.55z",fill:v.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M28.166 4.142C26.834 2.792 25.245 2 23.546 2c-1.79 0-3.297.984-4.656 2.43a6.451 6.451 0 00-.02.02L20.6 6l.019-.021c.895-.934 1.762-1.4 2.722-1.4 1.034 0 2.001.488 2.84 1.343l.019.02 1.987-1.78-.02-.02z",fill:"#0082FB"}),d.jsx("path",{d:"M30.019 12.656c-.075-4.333-1.588-8.207-3.833-10.495l-.02-.02-1.987 1.78.02.02c1.689 1.74 2.848 4.975 2.953 8.714v.028l2.867.001v-.028z",fill:b.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M30.02 12.687l-.001-.028h-2.867v.027c.005.176.008.352.008.53 0 1.02-.152 1.843-.461 2.438l-.014.027 2.137 2.228.016-.024c.776-1.2 1.183-2.868 1.183-4.89 0-.103 0-.205-.002-.308z",fill:_.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M26.7 15.65l-.015.026c-.267.502-.649.836-1.147.982l.974 3.079a4.372 4.372 0 00.547-.229 4.45 4.45 0 001.709-1.522 4.18 4.18 0 00.055-.081l.015-.025-2.139-2.23z",fill:k.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M24.917 16.742c-.327 0-.615-.049-.897-.175l-.998 3.151c.56.192 1.16.279 1.826.279.615 0 1.179-.092 1.69-.27l-.974-3.077c-.21.063-.428.094-.647.092z",fill:w.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M22.92 15.667l-.018-.021-2.296 2.393.02.02c.797.853 1.56 1.382 2.423 1.672l.997-3.15c-.364-.156-.716-.44-1.125-.914z",fill:C.fill,transform:"translate(2 2)"}),d.jsx("path",{d:"M22.902 15.643c-.688-.802-1.54-2.139-2.88-4.3l-1.746-2.92-.014-.023-2.026 3.046.014.024 1.237 2.087c1.2 2.012 2.177 3.467 3.12 4.48l.019.02 2.295-2.392a2.945 2.945 0 01-.019-.022z",fill:j.fill,transform:"translate(2 2)"}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:l.id,x1:"75.904%",x2:"33.275%",y1:"89.153%",y2:"23.044%",children:[d.jsx("stop",{offset:".06%",stopColor:"#0867DF"}),d.jsx("stop",{offset:"45.39%",stopColor:"#0668E1"}),d.jsx("stop",{offset:"100%",stopColor:"#0064E0"})]}),d.jsxs("linearGradient",{id:u.id,x1:"21.67%",x2:"97.068%",y1:"75.837%",y2:"24.022%",children:[d.jsx("stop",{offset:"13.23%",stopColor:"#0064DF"}),d.jsx("stop",{offset:"99.88%",stopColor:"#0064E0"})]}),d.jsxs("linearGradient",{id:c.id,x1:"38.247%",x2:"60.91%",y1:"89.127%",y2:"16.131%",children:[d.jsx("stop",{offset:"1.47%",stopColor:"#0072EC"}),d.jsx("stop",{offset:"68.81%",stopColor:"#0064DF"})]}),d.jsxs("linearGradient",{id:h.id,x1:"47.027%",x2:"52.153%",y1:"90.19%",y2:"15.745%",children:[d.jsx("stop",{offset:"7.31%",stopColor:"#007CF6"}),d.jsx("stop",{offset:"99.43%",stopColor:"#0072EC"})]}),d.jsxs("linearGradient",{id:p.id,x1:"52.155%",x2:"47.591%",y1:"58.289%",y2:"37.023%",children:[d.jsx("stop",{offset:"7.31%",stopColor:"#007FF9"}),d.jsx("stop",{offset:"100%",stopColor:"#007CF6"})]}),d.jsxs("linearGradient",{id:g.id,x1:"37.689%",x2:"61.961%",y1:"12.556%",y2:"63.605%",children:[d.jsx("stop",{offset:"7.31%",stopColor:"#007FF9"}),d.jsx("stop",{offset:"100%",stopColor:"#0082FB"})]}),d.jsxs("linearGradient",{id:v.id,x1:"42.496%",x2:"59.964%",y1:"56.072%",y2:"27.099%",children:[d.jsx("stop",{offset:"0%",stopColor:"#007FF8"}),d.jsx("stop",{offset:"100%",stopColor:"#0082FB"})]}),d.jsxs("linearGradient",{id:b.id,x1:"43.753%",x2:"57.613%",y1:"6.235%",y2:"98.514%",children:[d.jsx("stop",{offset:"0%",stopColor:"#0082FB"}),d.jsx("stop",{offset:"99.95%",stopColor:"#0081FA"})]}),d.jsxs("linearGradient",{id:_.id,x1:"60.07%",x2:"39.865%",y1:"4.661%",y2:"69.077%",children:[d.jsx("stop",{offset:"6.19%",stopColor:"#0081FA"}),d.jsx("stop",{offset:"100%",stopColor:"#0080F9"})]}),d.jsxs("linearGradient",{id:k.id,x1:"30.254%",x2:"61.097%",y1:"59.32%",y2:"33.244%",children:[d.jsx("stop",{offset:"0%",stopColor:"#027AF3"}),d.jsx("stop",{offset:"100%",stopColor:"#0080F9"})]}),d.jsxs("linearGradient",{id:w.id,x1:"20.433%",x2:"82.112%",y1:"50.001%",y2:"50.001%",children:[d.jsx("stop",{offset:"0%",stopColor:"#0377EF"}),d.jsx("stop",{offset:"99.94%",stopColor:"#0279F1"})]}),d.jsxs("linearGradient",{id:C.id,x1:"40.289%",x2:"72.427%",y1:"35.298%",y2:"57.811%",children:[d.jsx("stop",{offset:".19%",stopColor:"#0471E9"}),d.jsx("stop",{offset:"100%",stopColor:"#0377EF"})]}),d.jsxs("linearGradient",{id:j.id,x1:"32.228%",x2:"68.028%",y1:"19.719%",y2:"84.908%",children:[d.jsx("stop",{offset:"27.65%",stopColor:"#0867DF"}),d.jsx("stop",{offset:"100%",stopColor:"#0471E9"})]})]})]}))});function Y2(e){"@babel/helpers - typeof";return Y2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Y2(e)}var rQe=["size","style"];function OH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function cE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?OH(Object(n),!0).forEach(function(i){nQe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function nQe(e,r,n){return r=iQe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function iQe(e){var r=sQe(e,"string");return Y2(r)=="symbol"?r:String(r)}function sQe(e,r){if(Y2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(Y2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function oQe(e,r){if(e==null)return{};var n=aQe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function aQe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var lQe=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=oQe(e,rQe);return d.jsxs("svg",cE(cE({fill:"currentColor",fillRule:"evenodd",height:n,style:cE({flex:"none",lineHeight:1},i),viewBox:"0 0 103 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[d.jsx("title",{children:Nh}),d.jsx("path",{d:"M38.337 2.641h3.752l6.38 11.57 6.38-11.57h3.671v19.011H55.46V7.082l-5.594 10.09h-2.872l-5.595-10.09v14.57h-3.06V2.642zm30.058 19.353c-1.418 0-2.664-.314-3.739-.944a6.594 6.594 0 01-2.513-2.614c-.6-1.113-.9-2.39-.9-3.829 0-1.457.293-2.748.88-3.87.587-1.123 1.402-2 2.445-2.635 1.043-.633 2.242-.95 3.596-.95 1.346 0 2.504.319 3.475.957.97.638 1.718 1.532 2.242 2.682.523 1.15.785 2.499.785 4.047v.842h-10.39c.19 1.159.658 2.07 1.403 2.736.745.665 1.686.998 2.824.998.912 0 1.698-.136 2.357-.407a5.997 5.997 0 001.856-1.236l1.625 1.996c-1.616 1.485-3.599 2.227-5.946 2.227zm2.235-11.278c-.642-.656-1.481-.984-2.52-.984-1.011 0-1.858.335-2.54 1.005-.681.67-1.113 1.57-1.293 2.702h7.45c-.09-1.159-.456-2.066-1.097-2.723zm7.748-.712h-2.817V7.492h2.817V3.337h2.953v4.155h4.28v2.512h-4.28v6.369c0 1.059.18 1.815.542 2.267.36.453.98.68 1.855.68.389 0 .718-.016.99-.048l.426-.056c.15-.022.305-.046.467-.073v2.485a8.88 8.88 0 01-2.452.34c-3.187 0-4.781-1.748-4.781-5.242v-6.722zM101 21.654h-2.899v-1.982a5.24 5.24 0 01-1.964 1.718c-.795.403-1.698.604-2.71.604-1.245 0-2.35-.319-3.311-.957-.962-.638-1.718-1.517-2.269-2.635-.55-1.118-.826-2.396-.826-3.836 0-1.448.28-2.73.84-3.843.56-1.113 1.334-1.987 2.323-2.62.989-.634 2.124-.951 3.406-.951.967 0 1.834.188 2.601.563a5.145 5.145 0 011.91 1.596V7.49H101v14.164zm-2.953-9.206c-.316-.806-.815-1.442-1.497-1.908-.682-.466-1.47-.7-2.363-.7-1.265 0-2.272.426-3.021 1.277-.75.851-1.125 2-1.124 3.45 0 1.457.36 2.611 1.083 3.462.722.851 1.702 1.276 2.94 1.276.911 0 1.724-.235 2.438-.706a3.987 3.987 0 001.544-1.9v-4.251zM10.627 2c2.396 0 4.398 1.165 6.792 4.22.375-.507.758-.99 1.153-1.438l.318-.352C20.249 2.984 21.755 2 23.546 2c1.604 0 3.11.706 4.395 1.92l.245.24c2.173 2.215 3.66 5.914 3.821 10.078l.012.446.002.311c0 1.896-.358 3.48-1.042 4.66l-.157.254-.134.19a4.45 4.45 0 01-1.629 1.41l-.17.08a4.372 4.372 0 01-.377.148c-.505.17-1.06.26-1.664.26-.656 0-1.246-.084-1.8-.27-.784-.26-1.485-.72-2.206-1.443l-.236-.245c-.942-1.015-1.92-2.47-3.119-4.482l-1.472-2.481c-.171-.29-.338-.57-.5-.839l-.497-.812-2.209 3.913-.377.652-.373.623C11.374 21.023 9.701 22 7.449 22c-1.528 0-2.78-.534-3.696-1.501l-.187-.207c-.617-.729-1.063-1.673-1.318-2.797l-.07-.338a10.856 10.856 0 01-.17-1.61L2 15.084c.002-.97.08-1.941.235-2.902l.107-.603C2.72 9.643 3.396 7.837 4.3 6.327l.226-.366c1.482-2.303 3.514-3.836 5.816-3.954L10.627 2zm.114 3.272l-.183-.003c-1.13.012-2.19.784-3.06 2.01l-.153.222-.012.022c-.774 1.175-1.383 2.714-1.738 4.386l-.089.448c-.17.93-.257 1.873-.259 2.818l.003.235c.005.224.022.45.05.675l.054.364c.117.639.328 1.15.621 1.528l.113.133.02.02c.379.404.873.615 1.464.615 1.348 0 2.21-.811 4.482-4.333l2.286-3.578 1.144-1.767-.25-.354c-1.744-2.429-2.965-3.32-4.34-3.432l-.153-.009zm12.599-.693l-.204.007c-.88.062-1.687.526-2.518 1.393l-.02.023c-.549.576-1.11 1.329-1.71 2.258.352.52.715 1.082 1.09 1.683l.298.48 1.746 2.92.748 1.2.527.83c.607.946 1.085 1.641 1.5 2.146l.124.146c.358.416.672.686.989.852l.108.051c.284.125.572.174.899.174.22.002.437-.03.647-.092.43-.132.774-.409 1.03-.815l.106-.185.087-.181c.25-.576.373-1.336.373-2.253l-.002-.266-.006-.292c-.102-3.612-1.185-6.752-2.78-8.53l-.193-.206c-.838-.855-1.805-1.343-2.84-1.343z"})]}))});function X2(e){"@babel/helpers - typeof";return X2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},X2(e)}var cQe=["size","style"];function RH(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function uE(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?RH(Object(n),!0).forEach(function(i){uQe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RH(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function uQe(e,r,n){return r=dQe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function dQe(e){var r=hQe(e,"string");return X2(r)=="symbol"?r:String(r)}function hQe(e,r){if(X2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(X2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function fQe(e,r){return yQe(e)||gQe(e,r)||mQe(e,r)||pQe()}function pQe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|