codeplane-darwin-x64-baseline 29.0.19 → 29.0.21
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/bin/codeplane +0 -0
- package/bin/runtime/tui/{_baseUniq-CKZsAae7-amy2zxzj.js → _baseUniq-CIdKO3dq-saxa3280.js} +1 -1
- package/bin/runtime/tui/{ar-DWS3OItw-dt0zkv78.js → ar-BmGaE6dF-q6t3706d.js} +1 -1
- package/bin/runtime/tui/{ar-BZWjfbwB-qtqfb7fg.js → ar-DWiV1g-n-1af1nyxy.js} +1 -1
- package/bin/runtime/tui/{arc-DMMoS4Sa-03vsc6n3.js → arc-DqLXbJ-l-1yzq3v1g.js} +1 -1
- package/bin/runtime/tui/{architectureDiagram-Q4EWVU46-By5q-GjB-1yar27d6.js → architectureDiagram-Q4EWVU46-9rt-8b6E-wk53k0jh.js} +1 -1
- package/bin/runtime/tui/{blockDiagram-DXYQGD6D-COiddImv-pv135sbv.js → blockDiagram-DXYQGD6D-Wi5D5jIb-83qd40vp.js} +1 -1
- package/bin/runtime/tui/{br-CYRyU94d-sdhx3xkp.js → br-C0Yr4nSr-bs9cbqgb.js} +1 -1
- package/bin/runtime/tui/{br-DkTIl03T-n4zbcp2r.js → br-CJxfXkhA-h51k61qx.js} +1 -1
- package/bin/runtime/tui/{bs-IyM3ti4T-ykpjn53f.js → bs-CEFL9l5a-k8vrktf8.js} +1 -1
- package/bin/runtime/tui/{bs-BoIQtU4H-yv99fc6q.js → bs-CaCKWAeY-xew7v80s.js} +1 -1
- package/bin/runtime/tui/{c4Diagram-AHTNJAMY-CuWIN9yJ-rkrgtknt.js → c4Diagram-AHTNJAMY-Cnx6lSY6-hfk7ydjz.js} +1 -1
- package/bin/runtime/tui/channel-CRd61DfB-a84z4rad.js +1 -0
- package/bin/runtime/tui/{chunk-4BX2VUAB-D2vOyEOF-m6f9p1ek.js → chunk-4BX2VUAB-DdU5eMNC-r5g39pnj.js} +1 -1
- package/bin/runtime/tui/{chunk-4TB4RGXK-QDNaQXp8-aqnrpxkh.js → chunk-4TB4RGXK-DkOtUh9r-1g0b4dt8.js} +1 -1
- package/bin/runtime/tui/{chunk-55IACEB6-CKSwUx1G-tvns5bk7.js → chunk-55IACEB6-CU9uIPGP-rh65kk9d.js} +1 -1
- package/bin/runtime/tui/{chunk-EDXVE4YY-NnNsBfoC-wm46mzn6.js → chunk-EDXVE4YY-DqmH469b-5ymhdtxk.js} +1 -1
- package/bin/runtime/tui/{chunk-FMBD7UC4-DEcg0ekQ-wat1s63x.js → chunk-FMBD7UC4-BMB1F1VO-vy5p5w7r.js} +1 -1
- package/bin/runtime/tui/{chunk-OYMX7WX6-BkbRIi1Q-zm4wak80.js → chunk-OYMX7WX6-mS1fhc79-0fg9mpxa.js} +1 -1
- package/bin/runtime/tui/{chunk-QZHKN3VN-Bb-kvwI_-pgpf90wx.js → chunk-QZHKN3VN-B_uJ2Sul-q596hvme.js} +1 -1
- package/bin/runtime/tui/{chunk-YZCP3GAM-D5Jrc8Wg-2t7drtfm.js → chunk-YZCP3GAM-X3zoXePk-wt6cc28k.js} +1 -1
- package/bin/runtime/tui/classDiagram-6PBFFD2Q-B2auL2tY-ve962fat.js +1 -0
- package/bin/runtime/tui/classDiagram-v2-HSJHXN6E-B2auL2tY-ve962fat.js +1 -0
- package/bin/runtime/tui/clone-BzwFlJAo-xaa46y8s.js +1 -0
- package/bin/runtime/tui/{cose-bilkent-S5V4N54A-Be0H7JB8-anyaen8e.js → cose-bilkent-S5V4N54A-COxeQzun-09sz9bh5.js} +1 -1
- package/bin/runtime/tui/{da-BEIVgvZZ-d2k49mqp.js → da-CLGt8t51-fzwrsjwy.js} +1 -1
- package/bin/runtime/tui/{da-D9qz0rjo-kjc2r6bx.js → da-DYi2YCQi-k85nfe73.js} +1 -1
- package/bin/runtime/tui/{dagre-KV5264BT-BTpulNI0-001q0wcg.js → dagre-KV5264BT-BgAj3J6z-q3rxwrwn.js} +1 -1
- package/bin/runtime/tui/{de-DwHk2dT7-60bw2v0d.js → de-27e6V80Y-9dnj28p9.js} +1 -1
- package/bin/runtime/tui/{de-BvGtd_2t-dt9neae0.js → de-BDLaTYvp-wvmhyndj.js} +1 -1
- package/bin/runtime/tui/{diagram-5BDNPKRD-3AKY6Uzn-csrvjcvc.js → diagram-5BDNPKRD-B595d8w6-sdjnp45b.js} +1 -1
- package/bin/runtime/tui/{diagram-G4DWMVQ6-Cu0J7ePJ-fgm0m496.js → diagram-G4DWMVQ6-GH5GGsQB-13f0w3x6.js} +1 -1
- package/bin/runtime/tui/{diagram-MMDJMWI5-_lAEwwhe-vba3das7.js → diagram-MMDJMWI5-iFQuIw9r-sz4jv8vy.js} +1 -1
- package/bin/runtime/tui/{diagram-TYMM5635-DZ7Gjcd4-g32kra4a.js → diagram-TYMM5635-t1HmZT7K-ys2esat3.js} +1 -1
- package/bin/runtime/tui/{dialog-connect-provider-DmusNzFo-6p95j26n.js → dialog-connect-provider-CbBxytwI-q3p86cwv.js} +2 -2
- package/bin/runtime/tui/{dialog-edit-project-p56AjST6-pssnmvd1.js → dialog-edit-project-CX76A6rc-58d95507.js} +1 -1
- package/bin/runtime/tui/{dialog-fork-DWmHX3bN-n38stabf.js → dialog-fork-CG-wOlV3-xsxbpcme.js} +1 -1
- package/bin/runtime/tui/{dialog-manage-models-l5oINHkE-6580qjkv.js → dialog-manage-models-BFS05VVX-wg4qb1qy.js} +1 -1
- package/bin/runtime/tui/{dialog-quick-switcher-CBfhHLhX-8y791cz7.js → dialog-quick-switcher-Bvm8ie5S-x84spk50.js} +1 -1
- package/bin/runtime/tui/{dialog-select-directory-Cv7O9BIN-gf2c3y12.js → dialog-select-directory-BgyTQJRP-8f8rm1ms.js} +1 -1
- package/bin/runtime/tui/{dialog-select-file-DBC_hrA3-kt14p0jy.js → dialog-select-file-B1bCyEnR-w76wavza.js} +1 -1
- package/bin/runtime/tui/{dialog-select-mcp-NJhjvEbx-mwc2hsjg.js → dialog-select-mcp-DWrPE3wB-6jw1gxs7.js} +1 -1
- package/bin/runtime/tui/{dialog-select-model-unpaid-DgDw-CXo-hsatq0gd.js → dialog-select-model-unpaid-DxRiJHnB-1e51xzvn.js} +2 -2
- package/bin/runtime/tui/{dialog-select-provider-B92vIz_h-zqk042wr.js → dialog-select-provider-C-JEreLC-a3hzzr95.js} +1 -1
- package/bin/runtime/tui/{dialog-select-server-dfebswC4-7q9hjg2d.js → dialog-select-server-DGTNSgKw-hkzncy6h.js} +1 -1
- package/bin/runtime/tui/{erDiagram-SMLLAGMA-DP5cAA3n-bagy0xnn.js → erDiagram-SMLLAGMA-Dkutm0UC-mr8b5cr2.js} +1 -1
- package/bin/runtime/tui/{es-DBeXBNfl-bfw45c04.js → es--JMv8T7K-4n7x3j2t.js} +1 -1
- package/bin/runtime/tui/{es-DLzj3tOR-bv7qbg0d.js → es-KW_Zclw5-sm6qt3en.js} +1 -1
- package/bin/runtime/tui/{file-icon-WDJkIQUb-e6bydd82.js → file-icon-hzEOBp5u-wzb45m8v.js} +1 -1
- package/bin/runtime/tui/{flowDiagram-DWJPFMVM-DQuJBuvD-sy6zm4y8.js → flowDiagram-DWJPFMVM-Dxq5CqUW-55cxb8yg.js} +1 -1
- package/bin/runtime/tui/{fr-DlY6ywao-jv4c74mw.js → fr-BKYYu4_6-q6bgdt7z.js} +1 -1
- package/bin/runtime/tui/{fr-CT5dh1GO-kczghwcx.js → fr-EPg9myXQ-scb4s2xb.js} +1 -1
- package/bin/runtime/tui/{ganttDiagram-T4ZO3ILL-DQN0SBG4-y4ba06b4.js → ganttDiagram-T4ZO3ILL-BMFQ_DA_-wv9dzvbt.js} +1 -1
- package/bin/runtime/tui/{ghostty-web-BsEg925m-x58q6dx0.js → ghostty-web-DF5QFCvM-vyezzh2f.js} +1 -1
- package/bin/runtime/tui/{gitGraphDiagram-UUTBAWPF-_wDXoco0-bhmdgg7v.js → gitGraphDiagram-UUTBAWPF-CXFHqzP_-t4byf1er.js} +1 -1
- package/bin/runtime/tui/{graph-B5741XBm-gsp5acb1.js → graph-CdxUj6yb-scg0vj1a.js} +1 -1
- package/bin/runtime/tui/{home-DmQx2UFO-n4f6az0b.js → home-BxUuIoXQ-ppzcm720.js} +1 -1
- package/bin/runtime/tui/{index-CPokXzBk-mtscz30j.js → index-CaPWFEmi-2z8vnrgq.js} +6 -6
- package/bin/runtime/tui/{index-e6kmsrda.html → index-fanx7c5q.html} +1 -1
- package/bin/runtime/tui/{infoDiagram-42DDH7IO-C_a3CFEZ-z08bkk68.js → infoDiagram-42DDH7IO-gNmXJmyB-s5qv9bvz.js} +1 -1
- package/bin/runtime/tui/{ishikawaDiagram-UXIWVN3A-bKIAb2Qr-bdy3prj1.js → ishikawaDiagram-UXIWVN3A-DB4uZHja-e8hkd3zx.js} +1 -1
- package/bin/runtime/tui/{ja-BvuREAZm-gk37bjmy.js → ja-BflM-d8c-t7h818p0.js} +1 -1
- package/bin/runtime/tui/{ja-J2rvy9Sm-vgn550cs.js → ja-CJTo4KkK-zz1pfe3t.js} +1 -1
- package/bin/runtime/tui/{journeyDiagram-VCZTEJTY-BfBXXSNc-843bw9m4.js → journeyDiagram-VCZTEJTY-C2cCx7a9-n6nfmvss.js} +1 -1
- package/bin/runtime/tui/{kanban-definition-6JOO6SKY-2VedazDB-g1z2s2x0.js → kanban-definition-6JOO6SKY-CNIEkQb7-tejfkajm.js} +1 -1
- package/bin/runtime/tui/{ko-C4ctDXLT-t5qa1fzr.js → ko-1AesI1gp-7w8kmsd8.js} +1 -1
- package/bin/runtime/tui/{ko-3NJR9qON-j403fgwv.js → ko-wnATYZhS-e8rh7bnb.js} +1 -1
- package/bin/runtime/tui/{layout-resSDDfp-szpqjrwd.js → layout-CsyKM6QG-7fdxg3x9.js} +1 -1
- package/bin/runtime/tui/{linear-C4n34Dvy-xx9267bv.js → linear-B97-2TdH-311hnq70.js} +1 -1
- package/bin/runtime/tui/{list-B-BljgiC-zjyn8pzq.js → list-BiQMzfJm-c8sbm1ws.js} +1 -1
- package/bin/runtime/tui/{mermaid.core-BYfeCraQ-wvjh9cwb.js → mermaid.core-B1DAMRyG-23wemngf.js} +5 -5
- package/bin/runtime/tui/{min-BGmgVSVZ-2gk8fzng.js → min-BxM1U1Fg-21yb3amj.js} +1 -1
- package/bin/runtime/tui/{mindmap-definition-QFDTVHPH-DrNpZjMx-x4p4scna.js → mindmap-definition-QFDTVHPH-CcS-c13S-b9v8r98c.js} +1 -1
- package/bin/runtime/tui/{no-DKoerABz-khva2d4e.js → no-bayaWMMG-fkj8cwdj.js} +1 -1
- package/bin/runtime/tui/{no-D0QS5gIq-bgbqx72c.js → no-zt964wOK-kasce13c.js} +1 -1
- package/bin/runtime/tui/node-main.js +117 -117
- package/bin/runtime/tui/{notifications-yiDqvVWb-mg5jjzqq.js → notifications-Can6MxXX-aw5q9fhj.js} +1 -1
- package/bin/runtime/tui/{pieDiagram-DEJITSTG-D13bv9Xl-pegjjyb0.js → pieDiagram-DEJITSTG-Doif1hoz-3b07tqbh.js} +1 -1
- package/bin/runtime/tui/{pl-fQsf_cNV-e5he2t1p.js → pl-4fUPofNs-237e1s4t.js} +1 -1
- package/bin/runtime/tui/{pl-C6Uj0x5G-jwefyv8g.js → pl-DP31XAiJ-tn04m90e.js} +1 -1
- package/bin/runtime/tui/{provider-icon-7kFt_4lz-fp5dsjgn.js → provider-icon-mQ6o_ygz-ygz739x5.js} +1 -1
- package/bin/runtime/tui/{quadrantDiagram-34T5L4WZ-zX5wMAeQ-5frczs12.js → quadrantDiagram-34T5L4WZ-DzCsn8oz-66jhgzt4.js} +1 -1
- package/bin/runtime/tui/{requirementDiagram-MS252O5E-t7b6HUfP-ymfqvzkn.js → requirementDiagram-MS252O5E-3SSg0glz-j59wp495.js} +1 -1
- package/bin/runtime/tui/{ru-BA0rrWOy-1hhhsnck.js → ru-DaitQUn1-hagr69y5.js} +1 -1
- package/bin/runtime/tui/{ru-CaqP6-Hd-dvf7kd6h.js → ru-DjsUX_Mx-m7ckn8dk.js} +1 -1
- package/bin/runtime/tui/{sankeyDiagram-XADWPNL6-9EFqtb_N-9dcd7jys.js → sankeyDiagram-XADWPNL6-mWMx9G9E-4f71xj48.js} +1 -1
- package/bin/runtime/tui/{sequenceDiagram-FGHM5R23-oiFZnj1o-xbyqyx7r.js → sequenceDiagram-FGHM5R23-0Ri6_7zP-k17t9yk8.js} +1 -1
- package/bin/runtime/tui/{session-BmQ21D29-x4hy8ayr.js → session-BV0LX606-j11ppydf.js} +6 -6
- package/bin/runtime/tui/{settings-Bdh9G_Vp-0rvn4ep5.js → settings-CaQrQUx2-jhes3jwj.js} +1 -1
- package/bin/runtime/tui/{stateDiagram-FHFEXIEX-CRUp1geZ-43rkr1eb.js → stateDiagram-FHFEXIEX-fwQ5rVuv-ecabdwkx.js} +1 -1
- package/bin/runtime/tui/stateDiagram-v2-QKLJ7IA2-Dwy86PJv-fgm1z51m.js +1 -0
- package/bin/runtime/tui/{th-X36C4Enc-6ydpve98.js → th-BS1uSHlN-gaxxaqr8.js} +1 -1
- package/bin/runtime/tui/{th-DtVRtACI-kqj0dgr9.js → th-DjONqhgk-72te62ev.js} +1 -1
- package/bin/runtime/tui/{timeline-definition-GMOUNBTQ-DfOMe5W2-99dkaa7m.js → timeline-definition-GMOUNBTQ-D_Neh8bS-f9qz8qj3.js} +1 -1
- package/bin/runtime/tui/{tr-Dz0LfA8h-y50k3ws9.js → tr-D7JUDkNG-trybtksg.js} +1 -1
- package/bin/runtime/tui/{tr-Bz5jwN7v-dgeqqq5m.js → tr-DHKVC_SD-t7crfnsr.js} +1 -1
- package/bin/runtime/tui/{vennDiagram-DHZGUBPP-BA-4dB5--nx8ybcnr.js → vennDiagram-DHZGUBPP-fIOdUHTG-bm8beekk.js} +1 -1
- package/bin/runtime/tui/{wardley-RL74JXVD-CXrPLuRI-ttzthp46.js → wardley-RL74JXVD-mp486ivj-s1bcrv2m.js} +1 -1
- package/bin/runtime/tui/{wardleyDiagram-NUSXRM2D-BwzCJvO--jp7fvn8w.js → wardleyDiagram-NUSXRM2D-CbulH8KL-9vtmgc00.js} +1 -1
- package/bin/runtime/tui/{xychartDiagram-5P7HB3ND-Czb-iER0-z9ypyv26.js → xychartDiagram-5P7HB3ND-5c4vGFpm-4ajepfh1.js} +1 -1
- package/bin/runtime/tui/{zh-6RMNNK9t-3qhrp0e6.js → zh--EusBuW5-v3jgdrns.js} +1 -1
- package/bin/runtime/tui/{zh-zNhqkXA3-sv32qvvj.js → zh-BdQ5rFUE-gq6r6pg6.js} +1 -1
- package/bin/runtime/tui/{zht-C8fAvl_9-nzzhmvsc.js → zht-C2Bj8Y3u-j4mn0ty9.js} +1 -1
- package/bin/runtime/tui/{zht-SA4HMWzQ-9a7e372p.js → zht-uBUhPDWj-tabqnar8.js} +1 -1
- package/package.json +1 -1
- package/bin/runtime/tui/channel-CBN6o8Mh-6mc5pb57.js +0 -1
- package/bin/runtime/tui/classDiagram-6PBFFD2Q-DCY7sQQa-jfnazp9n.js +0 -1
- package/bin/runtime/tui/classDiagram-v2-HSJHXN6E-DCY7sQQa-jfnazp9n.js +0 -1
- package/bin/runtime/tui/clone-DFOVzhNw-9jnxj7cm.js +0 -1
- package/bin/runtime/tui/stateDiagram-v2-QKLJ7IA2-DW1b1IPu-0wqkajks.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-select-provider-
|
|
2
|
-
import{Q as re,e as he,ag as ve,ah as me,X as fe,l as i,y as b,b as ge,C as xe,R as ye,f as be,a7 as _e,o as we,j as y,w as $e,h as M,k as ke,m as r,K as j,M as f,p as Y,ai as R,t as Se,N as Ce,I as De,v as Ie,T as F,B as G,J as ze,aj as Pe,z as Ee,ab as Ke}from"./index-CPokXzBk.js";import{L as Z}from"./list-B-BljgiC.js";import{P as Le}from"./provider-icon-7kFt_4lz.js";var Te=b("<a>");function ee(h){const L=he(),[x,k]=ve(h,["href","children","class"]);return(()=>{var o=Te();return o.$$click=O=>{x.href&&(O.preventDefault(),L.openLink(x.href))},me(o,fe({get href(){return x.href},get class(){return`text-text-strong underline ${x.class??""}`}},k),!1,!0),i(o,()=>x.children),o})()}re(["click"]);var Me=b('<div class="w-full flex flex-col gap-1.5"><div class="text-14-regular text-text-base"></div><div>'),je=b('<form class="flex flex-col items-start gap-4">'),Fe=b('<div class="w-full flex items-center gap-x-2"><div class="w-4 h-2 rounded-[1px] bg-input-base shadow-xs-border-base flex items-center justify-center"><div class="w-2.5 h-0.5 ml-0 bg-icon-strong-base hidden"data-slot=list-item-extra-icon></div></div><span></span><span class="text-14-regular text-text-weak">'),Oe=b('<div class="text-14-regular text-text-base">'),Ae=b("<div>"),Ve=b('<div class="w-full flex items-center gap-x-2"><div class="w-4 h-2 rounded-[1px] bg-input-base shadow-xs-border-base flex items-center justify-center"><div class="w-2.5 h-0.5 ml-0 bg-icon-strong-base hidden"data-slot=list-item-extra-icon></div></div><span>'),te=b('<div class="flex flex-col gap-6"><div class="text-14-regular text-text-base"></div><form class="flex flex-col items-start gap-4">'),qe=b('<div class="flex flex-col gap-6"><div class="text-14-regular text-text-base"></div><div class="text-14-regular text-text-base flex items-center gap-4"><span>'),H=b('<div class="text-14-regular text-text-base"><div class="flex items-center gap-x-2"><span>'),Be=b('<div class="flex flex-col gap-6 px-2.5 pb-3"><div class="px-2.5 flex gap-4 items-center"><div class="text-16-medium text-text-strong"></div></div><div class="px-2.5 pb-10 flex flex-col gap-6"><div tabindex=0>');function Re(h){const L=ge(),x=xe(),k=ye(),o=be(),O=_e(),J=()=>{Ke(()=>import("./dialog-select-provider-B92vIz_h.js").then(e=>e.d),__vite__mapDeps([0,1,2,3,4])).then(e=>{L.show(()=>r(e.DialogSelectProvider,{}))})},C={value:!0},_={current:void 0};we(()=>{C.value=!1,_.current!==void 0&&(clearTimeout(_.current),_.current=void 0)});const S=y(()=>O.all().find(e=>e.id===h.provider)??x.data.provider.all.find(e=>e.id===h.provider)),A=y(()=>[{type:"api",label:o.t("provider.connect.method.apiKey")}]),[N]=$e(()=>h.provider,async()=>{const e=x.data.provider_auth[h.provider];if(e)return e;const t=await k.client.provider.auth();return C.value?(x.set("provider_auth",t.data??{}),t.data?.[h.provider]??A()):A()}),Q=y(()=>N.loading&&!x.data.provider_auth[h.provider]),I=y(()=>N.latest??x.data.provider_auth[h.provider]??A()),[d,ne]=M({methodIndex:void 0,authorization:void 0,state:"pending",error:void 0});function $(e){ne(Pe(t=>{if(e.type==="method.select"){t.methodIndex=e.index,t.authorization=void 0,t.state=void 0,t.error=void 0;return}if(e.type==="method.reset"){t.methodIndex=void 0,t.authorization=void 0,t.state=void 0,t.error=void 0;return}if(e.type==="auth.prompt"){t.state="prompt",t.error=void 0;return}if(e.type==="auth.pending"){t.state="pending",t.error=void 0;return}if(e.type==="auth.complete"){t.state="complete",t.authorization=e.authorization,t.error=void 0;return}t.state="error",t.error=e.error}))}const z=y(()=>d.methodIndex!==void 0?I().at(d.methodIndex):void 0),oe=e=>e?e.type==="api"?o.t("provider.connect.method.apiKey"):e.label??"":"";function T(e,t){if(e&&typeof e=="object"&&"data"in e){const n=e.data;if(typeof n?.message=="string"&&n.message)return n.message}if(e&&typeof e=="object"&&"error"in e){const n=T(e.error,"");if(n)return n}if(e&&typeof e=="object"&&"message"in e){const n=e.message;if(typeof n=="string"&&n)return n}return e instanceof Error&&e.message?e.message:typeof e=="string"&&e?e:t}async function V(e,t){_.current!==void 0&&(clearTimeout(_.current),_.current=void 0);const n=I()[e];if($({type:"method.select",index:e}),n.type==="oauth"){if(n.prompts?.length&&!t){$({type:"auth.prompt"});return}$({type:"auth.pending"});const s=Date.now();await k.client.provider.oauth.authorize({providerID:h.provider,method:e,inputs:t},{throwOnError:!0}).then(l=>{if(!C.value)return;const c=1e3-(Date.now()-s);if(c>0){_.current!==void 0&&clearTimeout(_.current),_.current=setTimeout(()=>{_.current=void 0,C.value&&$({type:"auth.complete",authorization:l.data})},c);return}$({type:"auth.complete",authorization:l.data})}).catch(l=>{C.value&&$({type:"auth.error",error:T(l,o.t("common.requestFailed"))})})}}function ie(){const[e,t]=M({value:{},index:0}),n=y(()=>{const a=z();return a?.type!=="oauth"?[]:a.prompts??[]}),s=(a,p)=>{if(!a.when)return!0;const v=p[a.when.key];return v===void 0?!1:a.when.op==="eq"?v===a.when.value:v!==a.when.value},l=y(()=>{const a=n(),p=a.findIndex((v,K)=>K>=e.index&&s(v,e.value));if(p!==-1)return{index:p,prompt:a[p]}}),u=y(()=>{const a=l();return!a||a.prompt.type!=="text"?!1:(e.value[a.prompt.key]??"").trim().length>0});async function c(a,p){if(d.methodIndex===void 0)return;const v=n().findIndex((K,g)=>g>a&&s(K,p));if(v!==-1){t("index",v);return}await V(d.methodIndex,p)}async function m(a){a.preventDefault();const p=l();!p||p.prompt.type!=="text"||u()&&await c(p.index,e.value)}const w=()=>l(),P=y(()=>{const a=w()?.prompt;if(!(!a||a.type!=="text"))return a}),E=y(()=>{const a=w()?.prompt;if(!(!a||a.type!=="select"))return a});return(()=>{var a=je();return a.addEventListener("submit",m),i(a,r(j,{get children(){return[r(f,{get when(){return w()?.prompt.type==="text"},get children(){return[r(F,{type:"text",get label(){return P()?.message??""},get placeholder(){return P()?.placeholder},get value(){return Y(()=>!!P())()?e.value[P().key]??"":""},onChange:p=>{const v=P();v&&t("value",v.key,p)}}),r(G,{class:"w-auto",type:"submit",size:"large",variant:"primary",get disabled(){return!u()},get children(){return o.t("common.continue")}})]}}),r(f,{get when(){return w()?.prompt.type==="select"},get children(){var p=Me(),v=p.firstChild,K=v.nextSibling;return i(v,()=>E()?.message),i(K,r(Z,{get items(){return E()?.options??[]},key:g=>g.value,get current(){return E()?.options.find(g=>g.value===e.value[E().key])},onSelect:g=>{if(!g)return;const D=E();if(!D)return;const B={...e.value,[D.key]:g.value};t("value",D.key,g.value),c(w().index,B)},children:g=>(()=>{var D=Fe(),B=D.firstChild,W=B.nextSibling,pe=W.nextSibling;return i(W,()=>g.label),i(pe,()=>g.hint),D})()})),p}})]}})),a})()}let X;function ae(e){e.key==="Enter"&&e.target instanceof HTMLInputElement||e.key!=="Escape"&&X?.onKeyDown(e)}let U=!1;ke(()=>{U||Q()||I().length===1&&(U=!0,V(0))});async function q(){await k.client.global.dispose(),L.close(),Ee({variant:"success",icon:"circle-check",title:o.t("provider.connect.toast.connected.title",{provider:S().name}),description:o.t("provider.connect.toast.connected.description",{provider:S().name})})}function le(){if(I().length===1){J();return}if(d.authorization){$({type:"method.reset"});return}if(d.methodIndex!==void 0){$({type:"method.reset"});return}J()}function se(){return[(()=>{var e=Oe();return i(e,()=>o.t("provider.connect.selectMethod",{provider:S().name})),e})(),(()=>{var e=Ae();return i(e,r(Z,{ref:t=>{X=t},items:I,key:t=>t?.label,onSelect:async(t,n)=>{t&&V(n)},children:t=>(()=>{var n=Ve(),s=n.firstChild,l=s.nextSibling;return i(l,()=>oe(t)),n})()})),e})()]}function ce(){const[e,t]=M({value:"",error:void 0});async function n(s){s.preventDefault();const l=s.currentTarget,c=new FormData(l).get("apiKey");if(!c?.trim()){t("error",o.t("provider.connect.apiKey.required"));return}t("error",void 0),await k.client.auth.set({providerID:h.provider,auth:{type:"api",key:c}}),await q()}return(()=>{var s=te(),l=s.firstChild,u=l.nextSibling;return i(l,()=>o.t("provider.connect.apiKey.description",{provider:S().name})),u.addEventListener("submit",n),i(u,r(F,{autofocus:!0,type:"text",get label(){return o.t("provider.connect.apiKey.label",{provider:S().name})},get placeholder(){return o.t("provider.connect.apiKey.placeholder")},name:"apiKey",get value(){return e.value},onChange:c=>t("value",c),get validationState(){return e.error?"invalid":void 0},get error(){return e.error}}),null),i(u,r(G,{class:"w-auto",type:"submit",size:"large",variant:"primary",get children(){return o.t("common.continue")}}),null),s})()}function ue(){const[e,t]=M({value:"",error:void 0});async function n(s){s.preventDefault();const l=s.currentTarget,c=new FormData(l).get("code");if(!c?.trim()){t("error",o.t("provider.connect.oauth.code.required"));return}t("error",void 0);const m=await k.client.provider.oauth.callback({providerID:h.provider,method:d.methodIndex,code:c}).then(w=>w.error?{ok:!1,error:w.error}:{ok:!0}).catch(w=>({ok:!1,error:w}));if(m.ok){await q();return}t("error",T(m.error,o.t("provider.connect.oauth.code.invalid")))}return(()=>{var s=te(),l=s.firstChild,u=l.nextSibling;return i(l,()=>o.t("provider.connect.oauth.code.visit.prefix"),null),i(l,r(ee,{get href(){return d.authorization.url},get children(){return o.t("provider.connect.oauth.code.visit.link")}}),null),i(l,()=>o.t("provider.connect.oauth.code.visit.suffix",{provider:S().name}),null),u.addEventListener("submit",n),i(u,r(F,{autofocus:!0,type:"text",get label(){return o.t("provider.connect.oauth.code.label",{method:z()?.label??""})},get placeholder(){return o.t("provider.connect.oauth.code.placeholder")},name:"code",get value(){return e.value},onChange:c=>t("value",c),get validationState(){return e.error?"invalid":void 0},get error(){return e.error}}),null),i(u,r(G,{class:"w-auto",type:"submit",size:"large",variant:"primary",get children(){return o.t("common.continue")}}),null),s})()}function de(){const e=y(()=>{const t=d.authorization?.instructions;return t?.includes(":")?t.split(":")[1]?.trim():t});return ze(()=>{(async()=>{const t=await k.client.provider.oauth.callback({providerID:h.provider,method:d.methodIndex}).then(n=>n.error?{ok:!1,error:n.error}:{ok:!0}).catch(n=>({ok:!1,error:n}));if(C.value){if(!t.ok){const n=T(t.error,o.t("common.requestFailed"));$({type:"auth.error",error:n});return}await q()}})()}),(()=>{var t=qe(),n=t.firstChild,s=n.nextSibling,l=s.firstChild;return i(n,()=>o.t("provider.connect.oauth.auto.visit.prefix"),null),i(n,r(ee,{get href(){return d.authorization.url},get children(){return o.t("provider.connect.oauth.auto.visit.link")}}),null),i(n,()=>o.t("provider.connect.oauth.auto.visit.suffix",{provider:S().name}),null),i(t,r(F,{get label(){return o.t("provider.connect.oauth.auto.confirmationCode")},class:"font-mono",get value(){return e()},readOnly:!0,copyable:!0}),s),i(s,r(R,{}),l),i(l,()=>o.t("provider.connect.status.waiting")),t})()}return r(Ie,{get title(){return r(De,{tabIndex:-1,icon:"arrow-left",variant:"ghost",onClick:le,get"aria-label"(){return o.t("common.goBack")}})},get children(){var e=Be(),t=e.firstChild,n=t.firstChild,s=t.nextSibling,l=s.firstChild;return i(t,r(Le,{get id(){return h.provider},class:"size-5 shrink-0 icon-strong-base"}),n),i(n,r(j,{get children(){return[r(f,{get when(){return Y(()=>h.provider==="anthropic")()&&z()?.label?.toLowerCase().includes("max")},get children(){return o.t("provider.connect.title.anthropicProMax")}}),r(f,{when:!0,get children(){return o.t("provider.connect.title",{provider:S().name})}})]}})),l.$$keydown=ae,i(l,r(j,{get children(){return[r(f,{get when(){return Q()},get children(){var u=H(),c=u.firstChild,m=c.firstChild;return i(c,r(R,{}),m),i(m,()=>o.t("provider.connect.status.inProgress")),u}}),r(f,{get when(){return d.methodIndex===void 0},get children(){return r(se,{})}}),r(f,{get when(){return d.state==="pending"},get children(){var u=H(),c=u.firstChild,m=c.firstChild;return i(c,r(R,{}),m),i(m,()=>o.t("provider.connect.status.inProgress")),u}}),r(f,{get when(){return d.state==="prompt"},get children(){return r(ie,{})}}),r(f,{get when(){return d.state==="error"},get children(){var u=H(),c=u.firstChild,m=c.firstChild;return i(c,r(Se,{name:"circle-ban-sign",class:"text-icon-critical-base"}),m),i(m,()=>o.t("provider.connect.status.failed",{error:d.error??""})),u}}),r(f,{get when(){return z()?.type==="api"},get children(){return r(ce,{})}}),r(f,{get when(){return z()?.type==="oauth"},get children(){return r(j,{get children(){return[r(f,{get when(){return d.authorization?.method==="code"},get children(){return r(ue,{})}}),r(f,{get when(){return d.authorization?.method==="auto"},get children(){return r(de,{})}})]}})}})]}})),Ce(()=>l.autofocus=d.methodIndex===void 0?!0:void 0),e}})}re(["keydown"]);const Ne=Object.freeze(Object.defineProperty({__proto__:null,DialogConnectProvider:Re},Symbol.toStringTag,{value:"Module"}));export{Re as D,ee as L,Ne as d};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-select-provider-C-JEreLC.js","assets/index-CaPWFEmi.js","assets/index-CZQK3M02.css","assets/list-BiQMzfJm.js","assets/provider-icon-mQ6o_ygz.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Q as re,e as he,ag as ve,ah as me,X as fe,l as i,y as b,b as ge,C as xe,R as ye,f as be,a7 as _e,o as we,j as y,w as $e,h as M,k as ke,m as r,K as j,M as f,p as Y,ai as R,t as Se,N as Ce,I as De,v as Ie,T as F,B as G,J as ze,aj as Pe,z as Ee,ab as Ke}from"./index-CaPWFEmi.js";import{L as Z}from"./list-BiQMzfJm.js";import{P as Le}from"./provider-icon-mQ6o_ygz.js";var Te=b("<a>");function ee(h){const L=he(),[x,k]=ve(h,["href","children","class"]);return(()=>{var o=Te();return o.$$click=O=>{x.href&&(O.preventDefault(),L.openLink(x.href))},me(o,fe({get href(){return x.href},get class(){return`text-text-strong underline ${x.class??""}`}},k),!1,!0),i(o,()=>x.children),o})()}re(["click"]);var Me=b('<div class="w-full flex flex-col gap-1.5"><div class="text-14-regular text-text-base"></div><div>'),je=b('<form class="flex flex-col items-start gap-4">'),Fe=b('<div class="w-full flex items-center gap-x-2"><div class="w-4 h-2 rounded-[1px] bg-input-base shadow-xs-border-base flex items-center justify-center"><div class="w-2.5 h-0.5 ml-0 bg-icon-strong-base hidden"data-slot=list-item-extra-icon></div></div><span></span><span class="text-14-regular text-text-weak">'),Oe=b('<div class="text-14-regular text-text-base">'),Ae=b("<div>"),Ve=b('<div class="w-full flex items-center gap-x-2"><div class="w-4 h-2 rounded-[1px] bg-input-base shadow-xs-border-base flex items-center justify-center"><div class="w-2.5 h-0.5 ml-0 bg-icon-strong-base hidden"data-slot=list-item-extra-icon></div></div><span>'),te=b('<div class="flex flex-col gap-6"><div class="text-14-regular text-text-base"></div><form class="flex flex-col items-start gap-4">'),qe=b('<div class="flex flex-col gap-6"><div class="text-14-regular text-text-base"></div><div class="text-14-regular text-text-base flex items-center gap-4"><span>'),H=b('<div class="text-14-regular text-text-base"><div class="flex items-center gap-x-2"><span>'),Be=b('<div class="flex flex-col gap-6 px-2.5 pb-3"><div class="px-2.5 flex gap-4 items-center"><div class="text-16-medium text-text-strong"></div></div><div class="px-2.5 pb-10 flex flex-col gap-6"><div tabindex=0>');function Re(h){const L=ge(),x=xe(),k=ye(),o=be(),O=_e(),J=()=>{Ke(()=>import("./dialog-select-provider-C-JEreLC.js").then(e=>e.d),__vite__mapDeps([0,1,2,3,4])).then(e=>{L.show(()=>r(e.DialogSelectProvider,{}))})},C={value:!0},_={current:void 0};we(()=>{C.value=!1,_.current!==void 0&&(clearTimeout(_.current),_.current=void 0)});const S=y(()=>O.all().find(e=>e.id===h.provider)??x.data.provider.all.find(e=>e.id===h.provider)),A=y(()=>[{type:"api",label:o.t("provider.connect.method.apiKey")}]),[N]=$e(()=>h.provider,async()=>{const e=x.data.provider_auth[h.provider];if(e)return e;const t=await k.client.provider.auth();return C.value?(x.set("provider_auth",t.data??{}),t.data?.[h.provider]??A()):A()}),Q=y(()=>N.loading&&!x.data.provider_auth[h.provider]),I=y(()=>N.latest??x.data.provider_auth[h.provider]??A()),[d,ne]=M({methodIndex:void 0,authorization:void 0,state:"pending",error:void 0});function $(e){ne(Pe(t=>{if(e.type==="method.select"){t.methodIndex=e.index,t.authorization=void 0,t.state=void 0,t.error=void 0;return}if(e.type==="method.reset"){t.methodIndex=void 0,t.authorization=void 0,t.state=void 0,t.error=void 0;return}if(e.type==="auth.prompt"){t.state="prompt",t.error=void 0;return}if(e.type==="auth.pending"){t.state="pending",t.error=void 0;return}if(e.type==="auth.complete"){t.state="complete",t.authorization=e.authorization,t.error=void 0;return}t.state="error",t.error=e.error}))}const z=y(()=>d.methodIndex!==void 0?I().at(d.methodIndex):void 0),oe=e=>e?e.type==="api"?o.t("provider.connect.method.apiKey"):e.label??"":"";function T(e,t){if(e&&typeof e=="object"&&"data"in e){const n=e.data;if(typeof n?.message=="string"&&n.message)return n.message}if(e&&typeof e=="object"&&"error"in e){const n=T(e.error,"");if(n)return n}if(e&&typeof e=="object"&&"message"in e){const n=e.message;if(typeof n=="string"&&n)return n}return e instanceof Error&&e.message?e.message:typeof e=="string"&&e?e:t}async function V(e,t){_.current!==void 0&&(clearTimeout(_.current),_.current=void 0);const n=I()[e];if($({type:"method.select",index:e}),n.type==="oauth"){if(n.prompts?.length&&!t){$({type:"auth.prompt"});return}$({type:"auth.pending"});const s=Date.now();await k.client.provider.oauth.authorize({providerID:h.provider,method:e,inputs:t},{throwOnError:!0}).then(l=>{if(!C.value)return;const c=1e3-(Date.now()-s);if(c>0){_.current!==void 0&&clearTimeout(_.current),_.current=setTimeout(()=>{_.current=void 0,C.value&&$({type:"auth.complete",authorization:l.data})},c);return}$({type:"auth.complete",authorization:l.data})}).catch(l=>{C.value&&$({type:"auth.error",error:T(l,o.t("common.requestFailed"))})})}}function ie(){const[e,t]=M({value:{},index:0}),n=y(()=>{const a=z();return a?.type!=="oauth"?[]:a.prompts??[]}),s=(a,p)=>{if(!a.when)return!0;const v=p[a.when.key];return v===void 0?!1:a.when.op==="eq"?v===a.when.value:v!==a.when.value},l=y(()=>{const a=n(),p=a.findIndex((v,K)=>K>=e.index&&s(v,e.value));if(p!==-1)return{index:p,prompt:a[p]}}),u=y(()=>{const a=l();return!a||a.prompt.type!=="text"?!1:(e.value[a.prompt.key]??"").trim().length>0});async function c(a,p){if(d.methodIndex===void 0)return;const v=n().findIndex((K,g)=>g>a&&s(K,p));if(v!==-1){t("index",v);return}await V(d.methodIndex,p)}async function m(a){a.preventDefault();const p=l();!p||p.prompt.type!=="text"||u()&&await c(p.index,e.value)}const w=()=>l(),P=y(()=>{const a=w()?.prompt;if(!(!a||a.type!=="text"))return a}),E=y(()=>{const a=w()?.prompt;if(!(!a||a.type!=="select"))return a});return(()=>{var a=je();return a.addEventListener("submit",m),i(a,r(j,{get children(){return[r(f,{get when(){return w()?.prompt.type==="text"},get children(){return[r(F,{type:"text",get label(){return P()?.message??""},get placeholder(){return P()?.placeholder},get value(){return Y(()=>!!P())()?e.value[P().key]??"":""},onChange:p=>{const v=P();v&&t("value",v.key,p)}}),r(G,{class:"w-auto",type:"submit",size:"large",variant:"primary",get disabled(){return!u()},get children(){return o.t("common.continue")}})]}}),r(f,{get when(){return w()?.prompt.type==="select"},get children(){var p=Me(),v=p.firstChild,K=v.nextSibling;return i(v,()=>E()?.message),i(K,r(Z,{get items(){return E()?.options??[]},key:g=>g.value,get current(){return E()?.options.find(g=>g.value===e.value[E().key])},onSelect:g=>{if(!g)return;const D=E();if(!D)return;const B={...e.value,[D.key]:g.value};t("value",D.key,g.value),c(w().index,B)},children:g=>(()=>{var D=Fe(),B=D.firstChild,W=B.nextSibling,pe=W.nextSibling;return i(W,()=>g.label),i(pe,()=>g.hint),D})()})),p}})]}})),a})()}let X;function ae(e){e.key==="Enter"&&e.target instanceof HTMLInputElement||e.key!=="Escape"&&X?.onKeyDown(e)}let U=!1;ke(()=>{U||Q()||I().length===1&&(U=!0,V(0))});async function q(){await k.client.global.dispose(),L.close(),Ee({variant:"success",icon:"circle-check",title:o.t("provider.connect.toast.connected.title",{provider:S().name}),description:o.t("provider.connect.toast.connected.description",{provider:S().name})})}function le(){if(I().length===1){J();return}if(d.authorization){$({type:"method.reset"});return}if(d.methodIndex!==void 0){$({type:"method.reset"});return}J()}function se(){return[(()=>{var e=Oe();return i(e,()=>o.t("provider.connect.selectMethod",{provider:S().name})),e})(),(()=>{var e=Ae();return i(e,r(Z,{ref:t=>{X=t},items:I,key:t=>t?.label,onSelect:async(t,n)=>{t&&V(n)},children:t=>(()=>{var n=Ve(),s=n.firstChild,l=s.nextSibling;return i(l,()=>oe(t)),n})()})),e})()]}function ce(){const[e,t]=M({value:"",error:void 0});async function n(s){s.preventDefault();const l=s.currentTarget,c=new FormData(l).get("apiKey");if(!c?.trim()){t("error",o.t("provider.connect.apiKey.required"));return}t("error",void 0),await k.client.auth.set({providerID:h.provider,auth:{type:"api",key:c}}),await q()}return(()=>{var s=te(),l=s.firstChild,u=l.nextSibling;return i(l,()=>o.t("provider.connect.apiKey.description",{provider:S().name})),u.addEventListener("submit",n),i(u,r(F,{autofocus:!0,type:"text",get label(){return o.t("provider.connect.apiKey.label",{provider:S().name})},get placeholder(){return o.t("provider.connect.apiKey.placeholder")},name:"apiKey",get value(){return e.value},onChange:c=>t("value",c),get validationState(){return e.error?"invalid":void 0},get error(){return e.error}}),null),i(u,r(G,{class:"w-auto",type:"submit",size:"large",variant:"primary",get children(){return o.t("common.continue")}}),null),s})()}function ue(){const[e,t]=M({value:"",error:void 0});async function n(s){s.preventDefault();const l=s.currentTarget,c=new FormData(l).get("code");if(!c?.trim()){t("error",o.t("provider.connect.oauth.code.required"));return}t("error",void 0);const m=await k.client.provider.oauth.callback({providerID:h.provider,method:d.methodIndex,code:c}).then(w=>w.error?{ok:!1,error:w.error}:{ok:!0}).catch(w=>({ok:!1,error:w}));if(m.ok){await q();return}t("error",T(m.error,o.t("provider.connect.oauth.code.invalid")))}return(()=>{var s=te(),l=s.firstChild,u=l.nextSibling;return i(l,()=>o.t("provider.connect.oauth.code.visit.prefix"),null),i(l,r(ee,{get href(){return d.authorization.url},get children(){return o.t("provider.connect.oauth.code.visit.link")}}),null),i(l,()=>o.t("provider.connect.oauth.code.visit.suffix",{provider:S().name}),null),u.addEventListener("submit",n),i(u,r(F,{autofocus:!0,type:"text",get label(){return o.t("provider.connect.oauth.code.label",{method:z()?.label??""})},get placeholder(){return o.t("provider.connect.oauth.code.placeholder")},name:"code",get value(){return e.value},onChange:c=>t("value",c),get validationState(){return e.error?"invalid":void 0},get error(){return e.error}}),null),i(u,r(G,{class:"w-auto",type:"submit",size:"large",variant:"primary",get children(){return o.t("common.continue")}}),null),s})()}function de(){const e=y(()=>{const t=d.authorization?.instructions;return t?.includes(":")?t.split(":")[1]?.trim():t});return ze(()=>{(async()=>{const t=await k.client.provider.oauth.callback({providerID:h.provider,method:d.methodIndex}).then(n=>n.error?{ok:!1,error:n.error}:{ok:!0}).catch(n=>({ok:!1,error:n}));if(C.value){if(!t.ok){const n=T(t.error,o.t("common.requestFailed"));$({type:"auth.error",error:n});return}await q()}})()}),(()=>{var t=qe(),n=t.firstChild,s=n.nextSibling,l=s.firstChild;return i(n,()=>o.t("provider.connect.oauth.auto.visit.prefix"),null),i(n,r(ee,{get href(){return d.authorization.url},get children(){return o.t("provider.connect.oauth.auto.visit.link")}}),null),i(n,()=>o.t("provider.connect.oauth.auto.visit.suffix",{provider:S().name}),null),i(t,r(F,{get label(){return o.t("provider.connect.oauth.auto.confirmationCode")},class:"font-mono",get value(){return e()},readOnly:!0,copyable:!0}),s),i(s,r(R,{}),l),i(l,()=>o.t("provider.connect.status.waiting")),t})()}return r(Ie,{get title(){return r(De,{tabIndex:-1,icon:"arrow-left",variant:"ghost",onClick:le,get"aria-label"(){return o.t("common.goBack")}})},get children(){var e=Be(),t=e.firstChild,n=t.firstChild,s=t.nextSibling,l=s.firstChild;return i(t,r(Le,{get id(){return h.provider},class:"size-5 shrink-0 icon-strong-base"}),n),i(n,r(j,{get children(){return[r(f,{get when(){return Y(()=>h.provider==="anthropic")()&&z()?.label?.toLowerCase().includes("max")},get children(){return o.t("provider.connect.title.anthropicProMax")}}),r(f,{when:!0,get children(){return o.t("provider.connect.title",{provider:S().name})}})]}})),l.$$keydown=ae,i(l,r(j,{get children(){return[r(f,{get when(){return Q()},get children(){var u=H(),c=u.firstChild,m=c.firstChild;return i(c,r(R,{}),m),i(m,()=>o.t("provider.connect.status.inProgress")),u}}),r(f,{get when(){return d.methodIndex===void 0},get children(){return r(se,{})}}),r(f,{get when(){return d.state==="pending"},get children(){var u=H(),c=u.firstChild,m=c.firstChild;return i(c,r(R,{}),m),i(m,()=>o.t("provider.connect.status.inProgress")),u}}),r(f,{get when(){return d.state==="prompt"},get children(){return r(ie,{})}}),r(f,{get when(){return d.state==="error"},get children(){var u=H(),c=u.firstChild,m=c.firstChild;return i(c,r(Se,{name:"circle-ban-sign",class:"text-icon-critical-base"}),m),i(m,()=>o.t("provider.connect.status.failed",{error:d.error??""})),u}}),r(f,{get when(){return z()?.type==="api"},get children(){return r(ce,{})}}),r(f,{get when(){return z()?.type==="oauth"},get children(){return r(j,{get children(){return[r(f,{get when(){return d.authorization?.method==="code"},get children(){return r(ue,{})}}),r(f,{get when(){return d.authorization?.method==="auto"},get children(){return r(de,{})}})]}})}})]}})),Ce(()=>l.autofocus=d.methodIndex===void 0?!0:void 0),e}})}re(["keydown"]);const Ne=Object.freeze(Object.defineProperty({__proto__:null,DialogConnectProvider:Re},Symbol.toStringTag,{value:"Module"}));export{Re as D,ee as L,Ne as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ee,R as te,C as re,f as ae,j as F,U as oe,h as ne,i as ie,m as c,l as i,T as P,q as R,V as y,N as $,W as I,X as T,Y as K,Z as le,t as se,_ as ce,L as de,O as M,B as N,p as ue,v as ve,y as b,Q as ge}from"./index-
|
|
1
|
+
import{b as ee,R as te,C as re,f as ae,j as F,U as oe,h as ne,i as ie,m as c,l as i,T as P,q as R,V as y,N as $,W as I,X as T,Y as K,Z as le,t as se,_ as ce,L as de,O as M,B as N,p as ue,v as ve,y as b,Q as ge}from"./index-CaPWFEmi.js";var fe=b('<div class="flex flex-col gap-2"><label class="text-12-medium text-text-weak"></label><div class="flex gap-1.5">'),me=b('<form class="flex flex-col gap-5 px-6 pt-0 pb-5"><div class="flex flex-col gap-4"><div class="flex flex-col gap-2"><label class="text-12-medium text-text-weak"></label><div class="flex gap-3 items-start"><div class=relative><button type=button class="group relative size-16 shrink-0 overflow-hidden rounded-md border bg-transparent p-0 transition-colors cursor-pointer focus:outline-none focus-visible:border-border-interactive-focus"><div class="pointer-events-none absolute inset-0 flex items-center justify-center bg-[color-mix(in_srgb,var(--surface-raised-stronger-non-alpha)_30%,transparent)] transition-opacity"><div class="flex size-8 items-center justify-center rounded-md border border-border-weak-base bg-surface-raised-stronger-non-alpha/95 shadow-sm"></div></div></button></div><input id=icon-upload type=file accept=image/* class=hidden><div class="flex flex-col gap-1.5 text-12-regular text-text-weak self-center"><span></span><span></span></div></div></div></div><div class="flex justify-end gap-2 pt-1">'),pe=b('<div class="size-full flex items-center justify-center">'),be=b('<img class="size-full object-cover">'),he=b("<button type=button>");const xe=["pink","mint","orange","purple","cyan","lime"];function je(a){const l=a?.start;return typeof l=="string"?l:l?.command??""}function we(a,l){const p=a?.start;return{...a??{},start:!l||typeof p=="string"||!p?l:{...p,command:l}}}function ke(a){const l=ee(),p=te(),C=re(),n=ae(),k=F(()=>oe(a.project.worktree)),_=F(()=>a.project.name||k()),[e,s]=ne({name:_(),color:a.project.icon?.color,iconOverride:a.project.icon?.override,startup:je(a.project.commands),dragOver:!1,iconHover:!1});let S;function L(r){if(!r.type.startsWith("image/"))return;const o=new FileReader;o.onload=v=>{s("iconOverride",v.target?.result),s("iconHover",!1)},o.readAsDataURL(r)}function B(r){r.preventDefault(),s("dragOver",!1);const o=r.dataTransfer?.files[0];o&&L(o)}function G(r){r.preventDefault(),s("dragOver",!0)}function U(){s("dragOver",!1)}function V(r){const v=r.target.files?.[0];v&&L(v)}function W(){s("iconOverride","")}const h=ie(()=>({mutationFn:async()=>{const r=e.name.trim()===k()?"":e.name.trim(),o=e.startup.trim();if(a.project.id&&a.project.id!=="global"){await p.client.project.update({projectID:a.project.id,directory:a.project.worktree,name:r,icon:{color:e.color||"",override:e.iconOverride||""},commands:we(a.project.commands,o)}),C.project.icon(a.project.worktree,e.iconOverride||void 0),l.close();return}C.project.meta(a.project.worktree,{name:r,icon:{color:e.color||void 0,override:e.iconOverride||void 0},commands:{start:o||void 0}}),l.close()}}));function Y(r){r.preventDefault(),!h.isPending&&h.mutate()}return c(ve,{get title(){return n.t("dialog.project.edit.title")},class:"w-full max-w-[480px] mx-auto",fit:!0,get children(){var r=me(),o=r.firstChild,v=o.firstChild,D=v.firstChild,q=D.nextSibling,x=q.firstChild,g=x.firstChild,j=g.firstChild,Q=j.firstChild,O=x.nextSibling,X=O.nextSibling,E=X.firstChild,Z=E.nextSibling,z=o.nextSibling;return r.addEventListener("submit",Y),i(o,c(P,{autofocus:!0,type:"text",get label(){return n.t("dialog.project.edit.name")},get placeholder(){return k()},get value(){return e.name},onChange:t=>s("name",t)}),v),i(D,()=>n.t("dialog.project.edit.icon")),x.addEventListener("mouseleave",()=>s("iconHover",!1)),x.addEventListener("mouseenter",()=>s("iconHover",!0)),g.$$click=()=>{e.iconOverride&&e.iconHover?W():S?.click()},g.addEventListener("dragleave",U),g.addEventListener("dragover",G),g.addEventListener("drop",B),i(g,c(R,{get when(){return le({override:e.iconOverride})},keyed:!0,get fallback(){return(()=>{var t=pe();return i(t,c(I,T({get fallback(){return e.name||_()}},()=>K(e.color),{class:"size-full text-[32px]"}))),t})()},children:t=>(()=>{var u=be();return y(u,"src",t),$(()=>y(u,"alt",n.t("dialog.project.edit.icon.alt"))),u})()}),j),i(Q,c(se,{get name(){return e.iconOverride&&!e.dragOver?"trash":"cloud-upload"},size:"normal",class:"text-icon-strong-base"})),O.addEventListener("change",V),ce(t=>{S=t},O),i(E,()=>n.t("dialog.project.edit.icon.hint")),i(Z,()=>n.t("dialog.project.edit.icon.recommended")),i(o,c(R,{get when(){return!e.iconOverride},get children(){var t=fe(),u=t.firstChild,w=u.nextSibling;return i(u,()=>n.t("dialog.project.edit.color")),i(w,c(de,{each:xe,children:d=>(()=>{var m=he();return m.$$click=()=>s("color",e.color===d?void 0:d),i(m,c(I,T({get fallback(){return e.name||_()}},()=>K(d),{class:"size-full rounded"}))),$(f=>{var A=n.t("dialog.project.edit.color.select",{color:d}),H=e.color===d,J={"flex items-center justify-center size-10 p-0.5 rounded-lg overflow-hidden transition-colors cursor-pointer":!0,"bg-surface-base-active border border-border-strong-base shadow-[var(--shadow-xs)]":e.color===d,"bg-transparent border border-transparent hover:bg-surface-base-hover hover:border-border-weak-base":e.color!==d};return A!==f.e&&y(m,"aria-label",f.e=A),H!==f.t&&y(m,"aria-pressed",f.t=H),f.a=M(m,J,f.a),f},{e:void 0,t:void 0,a:void 0}),m})()})),t}}),null),i(o,c(P,{multiline:!0,get label(){return n.t("dialog.project.edit.worktree.startup")},get description(){return n.t("dialog.project.edit.worktree.startup.description")},get placeholder(){return n.t("dialog.project.edit.worktree.startup.placeholder")},get value(){return e.startup},onChange:t=>s("startup",t),spellcheck:!1,class:"max-h-14 w-full overflow-y-auto font-mono text-xs"}),null),i(z,c(N,{type:"button",variant:"ghost",size:"large",onClick:()=>l.close(),get children(){return n.t("common.cancel")}}),null),i(z,c(N,{type:"submit",variant:"primary",size:"large",get disabled(){return h.isPending},get children(){return ue(()=>!!h.isPending)()?n.t("common.saving"):n.t("common.save")}}),null),$(t=>{var u={"border-border-interactive-base bg-surface-info-base/20":e.dragOver,"border-border-base hover:border-border-strong":!e.dragOver},w=!!(e.iconHover||e.dragOver),d=!e.iconHover&&!e.dragOver;return t.e=M(g,u,t.e),w!==t.t&&j.classList.toggle("opacity-100",t.t=w),d!==t.a&&j.classList.toggle("opacity-0",t.a=d),t},{e:void 0,t:void 0,a:void 0}),r}})}ge(["click"]);export{ke as DialogEditProject};
|
package/bin/runtime/tui/{dialog-fork-DWmHX3bN-n38stabf.js → dialog-fork-CG-wOlV3-xsxbpcme.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a4 as v,u as D,a0 as S,a1 as k,a5 as P,b as _,f as $,j as w,m as d,l as u,v as F,P as L,z as p,y as b}from"./index-
|
|
1
|
+
import{a4 as v,u as D,a0 as S,a1 as k,a5 as P,b as _,f as $,j as w,m as d,l as u,v as F,P as L,z as p,y as b}from"./index-CaPWFEmi.js";import{L as I}from"./list-BiQMzfJm.js";import{e as T}from"./session-BV0LX606.js";import"./provider-icon-mQ6o_ygz.js";import"./file-icon-hzEOBp5u.js";var q=b('<div class="w-full flex items-center gap-2"><span class="truncate flex-1 min-w-0 text-left font-normal"></span><span class="text-text-weak shrink-0 font-normal">');function C(i){return i.toLocaleTimeString(void 0,{timeStyle:"short"})}const z=()=>{const i=v(),g=D(),c=S(),l=k(),f=P(),h=_(),r=$(),x=w(()=>{const t=i.id;if(!t)return[];const a=c.data.message[t]??[],o=[];for(const s of a){if(s.role!=="user")continue;const e=(c.data.part[s.id]??[]).find(n=>n.type==="text"&&!n.synthetic&&!n.ignored);e&&o.push({id:s.id,text:e.text.replace(/\n/g," ").slice(0,200),time:C(new Date(s.time.created))})}return o.reverse()}),y=t=>{if(!t)return;const a=i.id;if(!a)return;const o=c.data.part[t.id]??[],s=T(o,{directory:l.directory,attachmentName:r.t("common.attachment")}),m=L(l.directory);l.client.session.fork({sessionID:a,messageID:t.id}).then(e=>{if(!e.data){p({title:r.t("common.requestFailed")});return}h.close(),f.set(s,void 0,{dir:m,id:e.data.id}),g(`/${m}/session/${e.data.id}`)}).catch(e=>{const n=e instanceof Error?e.message:String(e);p({title:r.t("common.requestFailed"),description:n})})};return d(F,{get title(){return r.t("command.session.fork")},get children(){return d(I,{class:"flex-1 min-h-0 [&_[data-slot=list-scroll]]:flex-1 [&_[data-slot=list-scroll]]:min-h-0",get search(){return{placeholder:r.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return r.t("dialog.fork.empty")},key:t=>t.id,items:x,filterKeys:["text"],onSelect:y,children:t=>(()=>{var a=q(),o=a.firstChild,s=o.nextSibling;return u(o,()=>t.text),u(s,()=>t.time),a})()})}})};export{z as DialogFork};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a6 as y,f as b,b as D,m as o,l as n,a3 as c,a9 as I,B as k,v as $,y as g,aa as C,Q as P}from"./index-
|
|
1
|
+
import{a6 as y,f as b,b as D,m as o,l as n,a3 as c,a9 as I,B as k,v as $,y as g,aa as C,Q as P}from"./index-CaPWFEmi.js";import{L}from"./list-BiQMzfJm.js";import{D as _}from"./dialog-select-provider-C-JEreLC.js";import"./provider-icon-mQ6o_ygz.js";import"./dialog-connect-provider-CbBxytwI.js";var B=g("<span>"),V=g('<div class="w-full flex items-center justify-between gap-x-3"><span></span><div>');const E=()=>{const t=y(),a=b(),u=D(),v=()=>{u.show(()=>o(_,{}))},s=e=>C.indexOf(e),m=e=>t.model.list().filter(r=>r.provider.id===e),h=e=>m(e).every(r=>t.model.visible({modelID:r.id,providerID:r.provider.id})),f=(e,r)=>{m(e).forEach(i=>{t.model.setVisibility({modelID:i.id,providerID:i.provider.id},r)})};return o($,{get title(){return a.t("dialog.model.manage")},get description(){return a.t("dialog.model.manage.description")},get action(){return o(k,{class:"h-7 -my-1 text-14-medium",icon:"plus-small",tabIndex:-1,onClick:v,get children(){return a.t("command.provider.connect")}})},get children(){return o(L,{get search(){return{placeholder:a.t("dialog.model.search.placeholder"),autofocus:!0}},get emptyMessage(){return a.t("dialog.model.empty")},key:e=>`${e?.provider?.id}:${e?.id}`,get items(){return t.model.list()},filterKeys:["provider.name","name","id"],sortBy:(e,r)=>e.name.localeCompare(r.name),groupBy:e=>e.provider.id,groupHeader:e=>{const r=e.items[0].provider;return[(()=>{var i=B();return n(i,()=>r.name),i})(),o(I,{placement:"top",get value(){return a.t("dialog.model.manage.provider.toggle",{provider:r.name})},get children(){return o(c,{class:"-mr-1",get checked(){return h(r.id)},onChange:i=>f(r.id,i),hideLabel:!0,get children(){return r.name}})}})]},sortGroupsBy:(e,r)=>{const i=s(e.items[0].provider.id),l=s(r.items[0].provider.id),d=i>=0,p=l>=0;return d&&!p?-1:!d&&p?1:i-l},onSelect:e=>{if(!e)return;const r={modelID:e.id,providerID:e.provider.id};t.model.setVisibility(r,!t.model.visible(r))},children:e=>(()=>{var r=V(),i=r.firstChild,l=i.nextSibling;return n(i,()=>e.name),l.$$click=d=>d.stopPropagation(),n(l,o(c,{get checked(){return!!t.model.visible({modelID:e.id,providerID:e.provider.id})},onChange:d=>{t.model.setVisibility({modelID:e.id,providerID:e.provider.id},d)}})),r})()})}})};P(["click"]);export{E as DialogManageModels};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as B,u as V,f as W,A as X,C as Y,e as Z,c as ee,E as y,j as o,F as te,G as re,H as se,J as ie,m as c,l as n,T as ne,K as ce,M as E,L,t as le,q as A,p as ae,N as oe,O as ue,v as de,y as u,P as M,Q as he}from"./index-
|
|
1
|
+
import{b as B,u as V,f as W,A as X,C as Y,e as Z,c as ee,E as y,j as o,F as te,G as re,H as se,J as ie,m as c,l as n,T as ne,K as ce,M as E,L,t as le,q as A,p as ae,N as oe,O as ue,v as de,y as u,P as M,Q as he}from"./index-CaPWFEmi.js";var fe=u('<div class="flex h-full items-center justify-center px-8 text-center text-14-regular text-text-weak">'),pe=u('<div class="flex flex-col gap-4">'),me=u('<div class="flex h-full min-h-0 flex-col gap-3 px-4 pb-4"><div class="shrink-0 [&_[data-slot=input-wrapper]:focus-within]:!border-border-weak-base [&_[data-slot=input-wrapper]:focus-within]:!shadow-none"></div><div class="min-h-0 flex-1 overflow-y-auto no-scrollbar">'),ge=u('<div class="flex flex-col gap-1"><div class="px-2 text-11-medium uppercase tracking-wider text-text-weak">'),we=u('<span class="shrink-0 rounded-sm bg-surface-base px-1 py-0.5 text-10-medium text-text-weak">'),ke=u('<div class="shrink-0 text-12-medium text-text-weak">'),xe=u('<button type=button class="group flex w-full min-w-0 items-center gap-3 rounded-md px-2 py-2 text-left focus:outline-none"><div class="flex size-8 shrink-0 items-center justify-center rounded-md bg-surface-base text-icon-weak"></div><div class="min-w-0 flex-1"><div class="flex items-center gap-2"><span class="truncate text-14-medium text-text-strong"></span></div><div class="truncate text-12-regular text-text-weak">');function be(m){const f=B(),b=V(),i=W(),F=X(),I=Y(),P=Z(),z=ee(),[$,N]=y(""),[S,d]=y(0),g=o(()=>m.currentDirectory??""),O=o(()=>{const e=g();if(!e)return[];const[t]=I.child(e,{bootstrap:!0});return te(t,Date.now(),e).filter(r=>!r.time?.archived).slice(0,30).map(r=>({kind:"session",id:r.id,directory:e,title:re(r.title)??i.t("command.session.new"),subtitle:r.id,updated:r.time?.updated??r.time?.created??0}))}),T=o(()=>{const e=g();return F.projects.list().filter(t=>t.id!=="global").map(t=>({kind:"project",worktree:t.worktree,title:se(t),subtitle:t.worktree,current:t.worktree===e}))}),G=o(()=>{const e=[{kind:"action",id:"project.browse",icon:"folder-add-left",title:i.t("command.project.open"),subtitle:i.t("quickSwitcher.action.browseProject")}];return P.desktop&&e.push({kind:"action",id:"server.switch",icon:"server",title:i.t("command.server.switch"),subtitle:z.name??i.t("quickSwitcher.action.switchServer")}),e}),w=e=>{const t=$().trim().toLowerCase();return t?e.filter(s=>`${s.title} ${s.subtitle}`.toLowerCase().includes(t)):e},_=o(()=>{const e=[],t=w(O());t.length>0&&e.push({id:"sessions",title:i.t("quickSwitcher.section.sessions"),entries:t});const s=w(T());s.length>0&&e.push({id:"projects",title:i.t("quickSwitcher.section.projects"),entries:s});const r=w(G());return r.length>0&&e.push({id:"actions",title:i.t("quickSwitcher.section.actions"),entries:r}),e}),p=o(()=>_().flatMap(e=>e.entries)),j=e=>{if(e.kind==="session"){b(`/${M(e.directory)}/session/${e.id}`),f.close();return}if(e.kind==="project"){b(`/${M(e.worktree)}/session`),f.close();return}if(e.id==="project.browse"){f.close(),m.onChooseProject();return}if(e.id==="server.switch"){f.close(),m.onSwitchServer();return}},K=e=>{const t=p();if(e.key==="ArrowDown"){if(e.preventDefault(),t.length===0)return;d(s=>(s+1)%t.length);return}if(e.key==="ArrowUp"){if(e.preventDefault(),t.length===0)return;d(s=>(s-1+t.length)%t.length);return}if(e.key==="Enter"){e.preventDefault();const s=t[S()]??t[0];s&&j(s);return}e.key==="Escape"&&(e.preventDefault(),f.close())},q=e=>p().indexOf(e);ie(()=>{const e=p(),t=g(),s=e.findIndex(r=>r.kind==="project"&&r.current);s>=0?d(s):e.length>0&&t&&e[0]?.kind==="session"&&d(0)});const Q=e=>e.kind==="session"?"comment":e.kind==="project"?"folder":e.icon;return c(de,{get title(){return i.t("quickSwitcher.title")},size:"normal",get children(){var e=me(),t=e.firstChild,s=t.nextSibling;return e.$$keydown=K,n(t,c(ne,{get value(){return $()},onChange:r=>{N(r),d(0)},get placeholder(){return i.t("quickSwitcher.search.placeholder")},get label(){return i.t("quickSwitcher.search.label")},hideLabel:!0,autofocus:!0})),n(s,c(ce,{get children(){return[c(E,{get when(){return p().length===0},get children(){var r=fe();return n(r,()=>i.t("quickSwitcher.empty")),r}}),c(E,{when:!0,get children(){var r=pe();return n(r,c(L,{get each(){return _()},children:D=>(()=>{var k=ge(),R=k.firstChild;return n(R,()=>D.title),n(k,c(L,{get each(){return D.entries},children:l=>{const x=o(()=>q(l)===S());return(()=>{var h=xe(),C=h.firstChild,H=C.nextSibling,v=H.firstChild,J=v.firstChild,U=v.nextSibling;return h.$$click=()=>j(l),h.addEventListener("mouseenter",()=>d(q(l))),n(C,c(le,{get name(){return Q(l)},size:"small"})),n(J,()=>l.title),n(v,c(A,{get when(){return ae(()=>l.kind==="project")()&&l.current},get children(){var a=we();return n(a,()=>i.t("quickSwitcher.label.current")),a}}),null),n(U,()=>l.subtitle),n(h,c(A,{get when(){return x()},get children(){var a=ke();return n(a,()=>i.t("quickSwitcher.hint.enter")),a}}),null),oe(a=>ue(h,{"bg-surface-raised-base-hover":x(),"hover:bg-surface-raised-base-hover":!x()},a)),h})()}}),null),k})()})),r}})]}})),e}})}he(["keydown","click"]);export{be as DialogQuickSwitcher};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{C as T,R as H,A as U,b as V,f as J,E as N,j as W,w as Q,U as C,m as j,l as z,$ as X,v as Y,y as I}from"./index-
|
|
1
|
+
import{C as T,R as H,A as U,b as V,f as J,E as N,j as W,w as Q,U as C,m as j,l as z,$ as X,v as Y,y as I}from"./index-CaPWFEmi.js";import{F as O}from"./file-icon-hzEOBp5u.js";import{L as tt,f as et}from"./list-BiQMzfJm.js";var rt=I('<div class="w-full flex items-center justify-between rounded-md"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular min-w-0"><span class="text-text-strong whitespace-nowrap">~</span><span class="text-text-weak whitespace-nowrap">/'),nt=I('<div class="w-full flex items-center justify-between rounded-md"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular min-w-0"><span class="text-text-weak whitespace-nowrap overflow-hidden overflow-ellipsis truncate min-w-0"></span><span class="text-text-strong whitespace-nowrap"></span><span class="text-text-weak whitespace-nowrap">/');function K(r){return((r??"").split(/\r?\n/)[0]??"").replace(/[\u0000-\u001F\u007F]/g,"").trim()}function st(r){const t=r.replaceAll("\\","/");return t.startsWith("//")&&!t.startsWith("///")?"//"+t.slice(2).replace(/\/+/g,"/"):t.replace(/\/+/g,"/")}function v(r){const t=st(r);return/^[A-Za-z]:$/.test(t)?t+"/":t}function d(r){const t=v(r);return t==="/"||t==="//"||/^[A-Za-z]:\/$/.test(t)?t:t.replace(/\/+$/,"")}function ot(r,t){const o=d(r??""),c=d(t).replace(/^\/+/,"");return o?c?o.endsWith("/")?o+c:o+"/"+c:o:c}function L(r){const t=v(r);return t.startsWith("//")?"//":t.startsWith("/")?"/":/^[A-Za-z]:\//.test(t)?t.slice(0,3):""}function at(r){const t=d(r);if(t==="/"||t==="//"||/^[A-Za-z]:\/$/.test(t))return t;const o=t.lastIndexOf("/");return o<=0?"/":o===2&&/^[A-Za-z]:/.test(t)?t.slice(0,3):t.slice(0,o)}function it(r){const t=v(r.trim());return t?t.startsWith("~")?"tilde":L(t)?"absolute":"relative":"relative"}function G(r,t){const o=d(r);if(!t)return"";const c=d(t),x=o.toLowerCase(),u=c.toLowerCase();return x===u?"~":x.startsWith(u+"/")?"~"+o.slice(c.length):""}function Z(r,t,o){const c=d(r);return it(t)==="absolute"?c:G(c,o)||c}function B(r,t,o){const c=d(r),x=G(c,t),u=l=>l?l.endsWith("/")?l:l+"/":"",y=Array.from(new Set([c,u(c),x,u(x),C(c)].filter(Boolean))).join(`
|
|
2
2
|
`);return{absolute:c,search:y,group:o}}function ct(r){const t=new Set;return r.filter(o=>t.has(o.absolute)?!1:(t.add(o.absolute),!0))}function lt(r){const t=new Map;let o=0;const c=y=>{const l=r.start();if(!l)return;const a=v(y);if(!a)return{directory:d(l),path:""};const m=r.home();if(a==="~")return{directory:d(m||l),path:""};if(a.startsWith("~/"))return{directory:d(m||l),path:a.slice(2)};const i=L(a);return i?{directory:d(i),path:a.slice(i.length)}:{directory:d(l),path:a}},x=async y=>{const l=d(y),a=t.get(l);if(a)return a;const m=r.sdk.client.file.list({directory:l,path:""}).then(i=>i.data??[]).catch(()=>[]).then(i=>i.filter(f=>f.type==="directory").map(f=>({name:f.name,absolute:d(v(f.absolute))})));return t.set(l,m),m},u=async(y,l,a)=>{const m=await x(y);return l?et.go(l,m,{key:"name",limit:a}).map(i=>i.obj.absolute):m.slice(0,a).map(i=>i.absolute)};return async y=>{const l=++o,a=()=>l===o,m=K(y),i=c(m);if(!i)return[];const f=v(m),P=f.startsWith("~")||!!L(f)||f.includes("/"),$=v(i.path),_=()=>r.sdk.client.find.files({directory:i.directory,query:$,type:"directory",limit:50}).then(h=>h.data??[]).catch(()=>[]);if(!P){const h=await _();return a()?h.map(F=>ot(i.directory,F)).slice(0,50):[]}const k=$.replace(/^\/+/,"").split("/"),D=k.slice(0,k.length-1).filter(h=>h&&h!=="."),e=k[k.length-1]??"",p=12,n=4;let s=[i.directory];for(const h of D){if(!a())return[];if(h===".."){s=s.map(at);continue}const F=(await Promise.all(s.map(E=>u(E,h,n)))).flat();if(!a())return[];if(s=Array.from(new Set(F)).slice(0,p),s.length===0)return[]}const w=(await Promise.all(s.map(h=>u(h,e,50)))).flat();if(!a())return[];const g=Array.from(new Set(w)),b=f.startsWith("~")?d(i.directory):"";if(!!f.endsWith("/")||!e)return(b?Array.from(new Set([b,...g])):g).slice(0,50);const A=e.toLowerCase(),R=g.filter(h=>C(h).toLowerCase()===A)[0];if(!R)return g.slice(0,50);const q=await u(R,"",30);if(!a())return[];const M=Array.from(new Set([...g,...q]));return(b?Array.from(new Set([b,...M])):M).slice(0,50)}}function ht(r){const t=T(),o=H(),c=U(),x=V(),u=J(),[y,l]=N("");let a;const m=W(()=>!(t.data.path.home||t.data.path.directory)),[i]=Q(()=>m()?!0:void 0,async()=>o.client.path.get().then(e=>e.data).catch(()=>{}),{initialValue:void 0}),f=W(()=>t.data.path.home||i()?.home||""),P=W(()=>t.data.path.home||t.data.path.directory||i()?.home||i()?.directory),$=lt({sdk:o,home:f,start:P}),_=W(()=>{const e=c.projects.list(),p=new Map;for(const n of e){let s=0;const w=[n.worktree,...n.sandboxes??[]];for(const g of w){const b=t.child(g,{bootstrap:!1})[0].session;for(const S of b){if(S.time.archived)continue;const A=S.time.updated??S.time.created;A>s&&(s=A)}}p.set(n.worktree,s)}return e.map((n,s)=>({project:n,at:p.get(n.worktree)??0,index:s})).sort((n,s)=>s.at-n.at||n.index-s.index).slice(0,5).map(({project:n})=>{const s=B(n.worktree,f(),"recent"),w=n.name||C(n.worktree);return{...s,search:`${s.search}
|
|
3
3
|
${w}`}})}),k=async e=>{const n=(await $(e)).map(s=>B(s,f(),"folders"));return ct([..._(),...n])};function D(e){r.onSelect(r.multiple?[e]:e),x.close()}return j(Y,{get title(){return r.title??u.t("command.project.open")},get children(){return j(tt,{get search(){return{placeholder:u.t("dialog.directory.search.placeholder"),autofocus:!0}},get emptyMessage(){return u.t("dialog.directory.empty")},get loadingMessage(){return u.t("common.loading")},items:k,key:e=>e.absolute,filterKeys:["search"],groupBy:e=>e.group,sortGroupsBy:(e,p)=>e.category===p.category?0:e.category==="recent"?-1:1,groupHeader:e=>e.category==="recent"?u.t("home.recentProjects"):u.t("command.project.open"),ref:e=>a=e,onFilter:e=>l(K(e)),onKeyEvent:(e,p)=>{if(e.key!=="Tab"||e.shiftKey||!p)return;e.preventDefault(),e.stopPropagation();const n=Z(p.absolute,y(),f());a?.setFilter(n.endsWith("/")?n:n+"/")},onSelect:e=>{e&&D(e.absolute)},children:e=>{const p=Z(e.absolute,y(),f());return p==="~"?(()=>{var n=rt(),s=n.firstChild,w=s.firstChild;return z(s,j(O,{get node(){return{path:e.absolute,type:"directory"}},class:"shrink-0 size-4"}),w),n})():(()=>{var n=nt(),s=n.firstChild,w=s.firstChild,g=w.firstChild,b=g.nextSibling;return z(s,j(O,{get node(){return{path:e.absolute,type:"directory"}},class:"shrink-0 size-4"}),w),z(g,()=>X(p)),z(b,()=>C(p)),n})()}})}})}export{ht as DialogSelectDirectory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as u,N as M,O as Q,y as S,al as V,f as X,A as Z,am as ee,b as te,u as ne,R as se,C as re,E as ae,j as b,o as ie,m as y,an as oe,K as ce,M as P,q as F,ao as le,t as de,ap as ue,$ as ge,U as j,v as fe,P as pe}from"./index-
|
|
1
|
+
import{l as u,N as M,O as Q,y as S,al as V,f as X,A as Z,am as ee,b as te,u as ne,R as se,C as re,E as ae,j as b,o as ie,m as y,an as oe,K as ce,M as P,q as F,ao as le,t as de,ap as ue,$ as ge,U as j,v as fe,P as pe}from"./index-CaPWFEmi.js";import{F as he}from"./file-icon-hzEOBp5u.js";import{L as me}from"./list-BiQMzfJm.js";import{u as ye,c as we}from"./session-BV0LX606.js";import"./provider-icon-mQ6o_ygz.js";var ve=S("<span data-component=keybind>");function be(t){return(()=>{var n=ve();return u(n,()=>t.children),M(i=>Q(n,{...t.classList,[t.class??""]:!!t.class},i)),n})()}var K=S('<span class="text-14-regular text-text-weak truncate">'),xe=S('<div class="w-full flex items-center justify-between gap-4"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong whitespace-nowrap">'),$e=S('<span class="text-12-regular text-text-weak whitespace-nowrap ml-2">'),ke=S('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong truncate">'),Se=S('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular"><span class="text-text-weak whitespace-nowrap overflow-hidden overflow-ellipsis truncate min-w-0"></span><span class="text-text-strong whitespace-nowrap">');const T=5,_e=["session.new","workspace.new","session.previous","session.next","terminal.toggle","review.toggle"],q=t=>{const n=new Set,i=[];for(const p of t)n.has(p.id)||(n.add(p.id),i.push(p));return i},N=(t,n)=>({id:"command:"+t.id,type:"command",title:t.title,description:t.description,keybind:t.keybind,category:n,option:t}),D=(t,n)=>({id:"file:"+t,type:"file",title:t,category:n,path:t}),Ce=(t,n)=>({id:`session:${t.directory}:${t.id}`,type:"session",title:t.title,description:t.description,category:n,directory:t.directory,sessionID:t.id,archived:t.archived,updated:t.updated});function Fe(t){const n=b(()=>t.filesOnly()?[]:t.command.options.filter(r=>!r.disabled&&!r.id.startsWith("suggested.")&&r.id!=="file.open")),i=b(()=>{const r=t.language.t("palette.group.commands");return n().map(d=>N(d,r))}),p=b(()=>{const r=n(),d=new Map(_e.map((a,c)=>[a,c])),w=r.filter(a=>d.has(a.id)),o=w.length?w:r.slice(0,T),g=w.length?[...o].sort((a,c)=>(d.get(a.id)??0)-(d.get(c.id)??0)):o,v=t.language.t("palette.group.commands");return g.map(a=>N(a,v))});return{allowed:n,list:i,picks:p}}function De(t){const n=we({tabs:t.tabs,pathFromTab:t.file.pathFromTab,normalizeTab:r=>r.startsWith("file://")?t.file.tab(r):r}),i=b(()=>{const r=n.openedTabs(),d=n.activeFileTab(),w=d?[d,...r.filter(a=>a!==d)]:r,o=new Set,g=t.language.t("palette.group.files"),v=[];for(const a of w){const c=t.file.pathFromTab(a);c&&(o.has(c)||(o.add(c),v.push(D(c,g))))}return v.slice(0,T)}),p=b(()=>{const r=t.language.t("palette.group.files");return t.file.tree.children("").filter(o=>o.type==="file").map(o=>o.path).sort((o,g)=>o.localeCompare(g)).slice(0,T).map(o=>D(o,r))});return{recent:i,root:p}}function Ee(t){const n={token:0,inflight:void 0,cached:void 0};return{sessions:p=>{if(!p.trim())return n.token+=1,n.inflight=void 0,n.cached=void 0,[];if(n.cached)return n.cached;if(n.inflight)return n.inflight;const d=n.token,w=t.workspaces();return w.length===0?[]:(n.inflight=Promise.all(w.map(o=>{const g=t.label(o);return t.globalSDK.client.session.list({directory:o,roots:!0}).then(v=>(v.data??[]).filter(a=>!!a?.id).map(a=>({id:a.id,title:a.title??t.language.t("command.session.new"),description:g,directory:o,archived:a.time?.archived,updated:a.time?.updated}))).catch(()=>[])})).then(o=>{if(n.token!==d)return[];const g=new Set,v=t.language.t("command.category.session"),a=o.flat().filter(c=>{const x=`${c.directory}:${c.id}`;return g.has(x)?!1:(g.add(x),!0)}).map(c=>Ce(c,v));return n.cached=a,a}).catch(()=>[]).finally(()=>{n.inflight=void 0}),n.inflight)}}}function Pe(t){const n=V(),i=X(),p=Z(),r=ee(),d=te(),w=ne(),o=se(),g=re(),{params:v,tabs:a,view:c}=ye(),x=()=>t.mode==="files",k={cleanup:void 0,committed:!1},[R,z]=ae(!1),I=Fe({filesOnly:x,command:n,language:i}),_=De({file:r,tabs:a,language:i}),L=b(()=>oe(v.dir)??""),O=b(()=>{const e=L();if(e)return p.projects.list().find(s=>s.worktree===e||s.sandboxes?.includes(e))}),A=b(()=>{const e=L(),s=O();if(!s)return e?[e]:[];const l=[s.worktree,...s.sandboxes??[]];return e&&!l.includes(e)?[...l,e]:l}),G=b(()=>g.data.path.home),W=e=>{const s=O(),l=s&&e===s.worktree?i.t("workspace.type.local"):i.t("workspace.type.sandbox"),[h]=g.child(e,{bootstrap:!1}),f=G(),m=f?e.replace(f,"~"):e,$=h.vcs?.branch??j(e);return`${l} : ${$||m}`},{sessions:B}=Ee({workspaces:A,label:W,globalSDK:o,language:i}),H=async e=>{const s=e.trim();if(z(s.length>0),!s&&x()){const $=r.tree.state("")?.loaded,E=$?Promise.resolve():r.tree.list(""),C=q([..._.recent(),..._.root()]);return $||C.length>0?C:(await E,q([..._.recent(),..._.root()]))}if(!s)return[...I.picks(),..._.recent()];if(x()){const $=await r.searchFiles(s),E=i.t("palette.group.files");return $.map(C=>D(C,E))}const[l,h]=await Promise.all([r.searchFiles(s),Promise.resolve(B(s))]),f=i.t("palette.group.files"),m=l.map($=>D($,f));return[...I.list(),...h,...m]},U=e=>{k.cleanup?.(),e&&e.type==="command"&&(k.cleanup=e.option?.onHighlight?.())},Y=e=>{const s=r.tab(e);a().open(s),r.load(e),c().reviewPanel.opened()||c().reviewPanel.open(),p.fileTree.setTab("all"),t.onOpenFile?.(e),a().setActive(s)},J=e=>{if(e){if(k.committed=!0,k.cleanup=void 0,d.close(),e.type==="command"){e.option?.onSelect?.("palette");return}if(e.type==="session"){if(!e.directory||!e.sessionID)return;w(`/${pe(e.directory)}/session/${e.sessionID}`);return}e.path&&Y(e.path)}};return ie(()=>{k.committed||k.cleanup?.()}),y(fe,{class:"pt-3 pb-0 !max-h-[480px]",transition:!0,get children(){return y(me,{get search(){return{placeholder:x()?i.t("session.header.searchFiles"):i.t("palette.search.placeholder"),autofocus:!0,hideIcon:!0}},get emptyMessage(){return i.t(x()?"palette.empty.filesPrompt":"palette.empty")},get loadingMessage(){return i.t("common.loading")},items:H,key:e=>e.id,filterKeys:["title","description","category"],get groupBy(){return R()?e=>e.category:()=>""},onMove:U,onSelect:J,children:e=>y(ce,{get fallback(){return(()=>{var s=Se(),l=s.firstChild,h=l.firstChild,f=h.firstChild,m=f.nextSibling;return u(l,y(he,{get node(){return{path:e.path??"",type:"file"}},class:"shrink-0 size-4"}),h),u(f,()=>ge(e.path??"")),u(m,()=>j(e.path??"")),s})()},get children(){return[y(P,{get when(){return e.type==="command"},get children(){var s=xe(),l=s.firstChild,h=l.firstChild;return u(h,()=>e.title),u(l,y(F,{get when(){return e.description},get children(){var f=K();return u(f,()=>e.description),f}}),null),u(s,y(F,{get when(){return e.keybind},get children(){return y(be,{class:"rounded-[4px]",get children(){return le(e.keybind??"",i.t)}})}}),null),s}}),y(P,{get when(){return e.type==="session"},get children(){var s=ke(),l=s.firstChild,h=l.firstChild,f=h.firstChild;return u(l,y(de,{name:"bubble-5",size:"small",class:"shrink-0 text-icon-weak"}),h),u(f,()=>e.title),u(h,y(F,{get when(){return e.description},get children(){var m=K();return u(m,()=>e.description),M(()=>m.classList.toggle("opacity-70",!!e.archived)),m}}),null),u(s,y(F,{get when(){return e.updated},get children(){var m=$e();return u(m,()=>ue(new Date(e.updated).toISOString(),i.t)),m}}),null),M(()=>f.classList.toggle("opacity-70",!!e.archived)),s}})]}})})}})}export{Pe as DialogSelectFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a0 as P,a1 as M,f as j,h as D,k as $,a2 as E,z as q,j as h,i as F,m as u,Q as K,l as c,q as v,p as b,a3 as z,v as B,y as m}from"./index-
|
|
1
|
+
import{a0 as P,a1 as M,f as j,h as D,k as $,a2 as E,z as q,j as h,i as F,m as u,Q as K,l as c,q as v,p as b,a3 as z,v as B,y as m}from"./index-CaPWFEmi.js";import{L as O}from"./list-BiQMzfJm.js";var Q=m('<span class="text-11-regular text-text-weaker">'),T=m('<span class="text-11-regular text-text-weak">'),A=m('<span class="text-11-regular text-text-weaker truncate">'),G=m('<div class="w-full flex items-center justify-between gap-x-3"><div class="flex flex-col gap-0.5 min-w-0"><div class="flex items-center gap-2"><span class=truncate></span></div></div><div>');const H={connected:"mcp.status.connected",failed:"mcp.status.failed",needs_auth:"mcp.status.needs_auth",disabled:"mcp.status.disabled"},N=()=>{const s=P(),d=M(),l=j(),[_,o]=D({done:!1,loading:!1});$(E(()=>s.data.mcp_ready,(e,t)=>{!e&&t&&o("done",!1)},{defer:!0})),$(()=>{if(!(_.done||_.loading)){if(s.data.mcp_ready){o("done",!0);return}o("loading",!0),d.client.mcp.status().then(e=>{s.set("mcp",e.data??{}),s.set("mcp_ready",!0),o("done",!0)}).catch(e=>{o("done",!0),q({variant:"error",title:l.t("common.requestFailed"),description:e instanceof Error?e.message:String(e)})}).finally(()=>{o("loading",!1)})}});const p=h(()=>Object.entries(s.data.mcp??{}).map(([e,t])=>({name:e,status:t.status})).sort((e,t)=>e.name.localeCompare(t.name))),n=F(()=>({mutationFn:async e=>{s.data.mcp[e]?.status==="connected"?await d.client.mcp.disconnect({name:e}):await d.client.mcp.connect({name:e});const i=await d.client.mcp.status();i.data&&s.set("mcp",i.data)}})),S=h(()=>p().filter(e=>e.status==="connected").length),k=h(()=>p().length);return u(B,{get title(){return l.t("dialog.mcp.title")},get description(){return l.t("dialog.mcp.description",{enabled:S(),total:k()})},get children(){return u(O,{get search(){return{placeholder:l.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return l.t("dialog.mcp.empty")},key:e=>e?.name??"",items:p,filterKeys:["name","status"],sortBy:(e,t)=>e.name.localeCompare(t.name),onSelect:e=>{!e||n.isPending||n.mutate(e.name)},children:e=>{const t=()=>s.data.mcp[e.name],i=()=>t()?.status,w=()=>{const r=i()?H[i()]:void 0;if(r)return l.t(r)},x=()=>{const r=t();return r?.status==="failed"?r.error:void 0},C=()=>i()==="connected";return(()=>{var r=G(),g=r.firstChild,f=g.firstChild,L=f.firstChild,y=g.nextSibling;return c(L,()=>e.name),c(f,u(v,{get when(){return w()},get children(){var a=Q();return c(a,w),a}}),null),c(f,u(v,{get when(){return b(()=>!!n.isPending)()&&n.variables===e.name},get children(){var a=T();return c(a,()=>l.t("common.loading.ellipsis")),a}}),null),c(g,u(v,{get when(){return x()},get children(){var a=A();return c(a,x),a}}),null),y.$$click=a=>a.stopPropagation(),c(y,u(z,{get checked(){return C()},get disabled(){return b(()=>!!n.isPending)()&&n.variables===e.name},onChange:()=>{n.isPending||n.mutate(e.name)}})),r})()}})}})};K(["click"]);export{N as DialogSelectMcp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-connect-provider-
|
|
2
|
-
import{a6 as k,b as E,a7 as I,f as L,m as l,l as r,a8 as f,q as p,a9 as S,p as M,aa as g,B as T,v as O,y as u,ab as x,Q as A}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-connect-provider-CbBxytwI.js","assets/index-CaPWFEmi.js","assets/index-CZQK3M02.css","assets/list-BiQMzfJm.js","assets/provider-icon-mQ6o_ygz.js","assets/dialog-select-provider-C-JEreLC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a6 as k,b as E,a7 as I,f as L,m as l,l as r,a8 as f,q as p,a9 as S,p as M,aa as g,B as T,v as O,y as u,ab as x,Q as A}from"./index-CaPWFEmi.js";import{L as w}from"./list-BiQMzfJm.js";import{P as B}from"./provider-icon-mQ6o_ygz.js";import{M as R}from"./session-BV0LX606.js";import"./file-icon-hzEOBp5u.js";var K=u('<div class="flex flex-col gap-3 px-2.5"><div class="text-14-medium text-text-base px-2.5">'),V=u('<div class="px-1.5 pb-1.5"><div class="w-full rounded-sm border border-border-weak-base bg-surface-raised-base"><div class="w-full flex flex-col items-start gap-4 px-1.5 pt-4 pb-4"><div class="px-2 text-14-medium text-text-base"></div><div class=w-full>'),j=u('<div class="w-full flex items-center gap-x-2.5"><span>'),$=u('<div class="text-14-regular text-text-weak">'),q=u('<div class="w-full flex items-center gap-x-3"><span>');const G=b=>{const m=b.model??k().model,v=E(),y=I(),o=L(),D=t=>{x(()=>import("./dialog-connect-provider-CbBxytwI.js").then(n=>n.d),__vite__mapDeps([0,1,2,3,4])).then(n=>{v.show(()=>l(n.DialogConnectProvider,{provider:t}))})},C=()=>{x(()=>import("./dialog-select-provider-C-JEreLC.js").then(t=>t.d),__vite__mapDeps([5,1,2,3,4,0])).then(t=>{v.show(()=>l(t.DialogSelectProvider,{}))})};let h;const P=t=>{t.key!=="Escape"&&h?.onKeyDown(t)};return l(O,{get title(){return o.t("dialog.model.select.title")},class:"overflow-y-auto [&_[data-slot=dialog-body]]:overflow-visible [&_[data-slot=dialog-body]]:flex-none",get children(){return[(()=>{var t=K(),n=t.firstChild;return t.$$keydown=P,r(n,()=>o.t("dialog.model.unpaid.freeModels.title")),r(t,l(w,{class:"[&_[data-slot=list-scroll]]:overflow-visible",ref:e=>h=e,get items(){return m.list},get current(){return m.current()},key:e=>`${e.provider.id}:${e.id}`,itemWrapper:(e,d)=>l(S,{class:"w-full",placement:"right-start",gutter:12,get value(){return l(R,{model:e,get latest(){return e.latest},get free(){return M(()=>e.provider.id==="codeplane")()&&(!e.cost||e.cost.input===0)}})},children:d}),onSelect:e=>{m.set(e?{modelID:e.id,providerID:e.provider.id}:void 0,{recent:!0}),v.close()},children:e=>(()=>{var d=j(),c=d.firstChild;return r(c,()=>e.name),r(d,l(f,{get children(){return o.t("model.tag.free")}}),null),r(d,l(p,{get when(){return e.latest},get children(){return l(f,{get children(){return o.t("model.tag.latest")}})}}),null),d})()}),null),t})(),(()=>{var t=V(),n=t.firstChild,e=n.firstChild,d=e.firstChild,c=d.nextSibling;return r(d,()=>o.t("dialog.model.unpaid.addMore.title")),r(c,l(w,{class:"w-full px-0",key:a=>a?.id,get items(){return y.popular},activeIcon:"plus-small",sortBy:(a,i)=>g.includes(a.id)&&g.includes(i.id)?g.indexOf(a.id)-g.indexOf(i.id):a.name.localeCompare(i.name),onSelect:a=>{a&&D(a.id)},children:a=>(()=>{var i=q(),_=i.firstChild;return r(i,l(B,{"data-slot":"list-item-extra-icon",get id(){return a.id}}),_),r(_,()=>a.name),r(i,l(p,{get when(){return a.id==="codeplane"},get children(){var s=$();return r(s,()=>o.t("dialog.provider.codeplane.tagline")),s}}),null),r(i,l(p,{get when(){return a.id==="codeplane"},get children(){return l(f,{get children(){return o.t("dialog.provider.tag.recommended")}})}}),null),r(i,l(p,{get when(){return a.id==="anthropic"},get children(){var s=$();return r(s,()=>o.t("dialog.provider.anthropic.note")),s}}),null),i})()}),null),r(c,l(T,{variant:"ghost",class:"w-full justify-start px-[11px] py-3.5 gap-4.5 text-14-medium",icon:"dot-grid",onClick:C,get children(){return o.t("dialog.provider.viewAll")}}),null),t})()]}})};A(["keydown"]);export{G as DialogSelectModelUnpaid};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as se,C as pe,R as ge,f as ne,c as he,h as fe,i as Y,z,k as be,o as ye,m as a,l as n,T as x,B as F,q as M,L as Z,I as V,N as ee,V as re,p as we,v as le,y as A,aq as J,aj as B,a7 as xe,a8 as te,aa as U}from"./index-CPokXzBk.js";import{L as ke}from"./list-B-BljgiC.js";import{P as de}from"./provider-icon-7kFt_4lz.js";import{L as Ce,D as Se}from"./dialog-connect-provider-DmusNzFo.js";const _e=/^[a-z0-9][a-z0-9-_]*$/,Le="@ai-sdk/openai-compatible";function De(i){return new URL("/provider/custom-models",i).toString()}async function $e(i,v){if(!i.ok)throw new Error(v);if(i.headers.get("content-type")?.split(";")[0].trim().toLowerCase()!=="application/json")throw new Error(v);const p=await i.json().catch(()=>{});if(!p||typeof p!="object"||!Array.isArray(p.models))throw new Error(v);return p}function Ie(i){const v=i.form.providerID.trim(),d=i.form.name.trim(),p=i.form.baseURL.trim(),r=i.form.apiKey.trim(),k=r.match(/^\{env:([^}]+)\}$/)?.[1]?.trim(),s=r&&!k?r:void 0,t=v?_e.test(v)?void 0:i.t("provider.custom.error.providerID.format"):i.t("provider.custom.error.providerID.required"),m=d?void 0:i.t("provider.custom.error.name.required"),g=p?/^https?:\/\//.test(p)?void 0:i.t("provider.custom.error.baseURL.format"):i.t("provider.custom.error.baseURL.required"),y=i.disabledProviders.includes(v),C=t?void 0:i.existingProviderIDs.has(v)&&!y?i.t("provider.custom.error.providerID.exists"):void 0,O=new Set,L=i.form.models.map(l=>{const f=l.id.trim(),e=f?O.has(f)?i.t("provider.custom.error.duplicate"):(()=>{O.add(f)})():i.t("provider.custom.error.required"),o=l.name.trim()?void 0:i.t("provider.custom.error.required");return{id:e,name:o}}),j=L.every(l=>!l.id&&!l.name),G=Object.fromEntries(i.form.models.map(l=>[l.id.trim(),{name:l.name.trim()}])),w=new Set,D=i.form.headers.map(l=>{const f=l.key.trim(),e=l.value.trim();if(!f&&!e)return{};const o=f?w.has(f.toLowerCase())?i.t("provider.custom.error.duplicate"):(()=>{w.add(f.toLowerCase())})():i.t("provider.custom.error.required"),c=e?void 0:i.t("provider.custom.error.required");return{key:o,value:c}}),$=D.every(l=>!l.key&&!l.value),I=Object.fromEntries(i.form.headers.map(l=>({key:l.key.trim(),value:l.value.trim()})).filter(l=>!!l.key&&!!l.value).map(l=>[l.key,l.value])),E={providerID:t??C,name:m,baseURL:g};return!t&&!C&&!m&&!g&&j&&$?{err:E,models:L,headers:D,result:{providerID:v,name:d,key:s,config:{npm:Le,name:d,...k?{env:[k]}:{},options:{baseURL:p,...Object.keys(I).length?{headers:I}:{}},models:G}}}:{err:E,models:L,headers:D}}let Ee=0;const ce=()=>`row-${Ee++}`,W=()=>({row:ce(),id:"",name:"",err:{}}),oe=()=>({row:ce(),key:"",value:"",err:{}});var Pe=A('<div class="flex flex-col gap-6 px-2.5 pb-3 overflow-y-auto max-h-[60vh]"><div class="px-2.5 flex gap-4 items-center"><div class="text-16-medium text-text-strong"></div></div><form class="px-2.5 pb-6 flex flex-col gap-6"><p class="text-14-regular text-text-base"></p><div class="flex flex-col gap-4"></div><div class="flex flex-col gap-3"><div class="flex items-center justify-between gap-3"><label class="text-12-medium text-text-weak"></label></div></div><div class="flex flex-col gap-3"><label class="text-12-medium text-text-weak">'),ie=A('<div class="flex gap-2 items-start"><div class=flex-1></div><div class=flex-1>');function Re(i){const v=se(),d=pe(),p=ge(),r=ne(),k=he(),[s,t]=fe({providerID:"",name:"",baseURL:"",apiKey:"",models:[W()],headers:[oe()],err:{}}),m=()=>{if(i.back==="close"){v.close();return}v.show(()=>a(ue,{}))},g=()=>{t("models",B(e=>{e.push(W())}))},y=e=>{s.models.length<=1||t("models",B(o=>{o.splice(e,1)}))},C=()=>{t("headers",B(e=>{e.push(oe())}))},O=e=>{s.headers.length<=1||t("headers",B(o=>{o.splice(e,1)}))},L=()=>Object.fromEntries(s.headers.map(e=>({key:e.key.trim(),value:e.value.trim()})).filter(e=>!!e.key&&!!e.value).map(e=>[e.key,e.value])),j=()=>/^https?:\/\//.test(s.baseURL.trim()),G=()=>j()&&(!!s.apiKey.trim()||s.headers.some(e=>e.key.trim().toLowerCase()==="authorization"&&!!e.value.trim())),w=Y(()=>({mutationFn:async e=>{const o=k.current;if(!o)throw new Error(r.t("error.globalSDK.noServerAvailable"));const c=await fetch(De(o.http.url),{method:"POST",headers:{"content-type":"application/json",...o.http.password?{Authorization:`Basic ${btoa(`${o.http.username??"codeplane"}:${o.http.password}`)}`}:{}},body:JSON.stringify({baseURL:s.baseURL.trim(),apiKey:s.apiKey.trim().match(/^\{env:[^}]+\}$/)?void 0:s.apiKey.trim()||void 0,headers:L()})}),h=await $e(c,r.t("provider.custom.models.fetch.error"));if(h.models.length===0)throw new Error(r.t("provider.custom.models.fetch.empty"));return h},onSuccess:(e,o)=>{t("models",e.models.map(c=>({...W(),id:c.id,name:c.name}))),!o?.silent&&z({variant:"success",icon:"circle-check",title:r.t("provider.custom.models.fetch.success",{count:e.models.length})})},onError:(e,o)=>{if(o?.silent)return;const c=e instanceof Error?e.message:String(e);z({title:r.t("common.requestFailed"),description:c})}}));let D="";be(()=>{const e=JSON.stringify({baseURL:s.baseURL.trim(),apiKey:s.apiKey.trim(),headers:L()});if(!s.models.every(h=>!h.id.trim()&&!h.name.trim())||!G()||w.isPending||e===D)return;const c=setTimeout(()=>{D=e,w.mutate({silent:!0})},600);ye(()=>clearTimeout(c))});const $=(e,o)=>{t(e,o),e!=="apiKey"&&t("err",e,void 0)},I=(e,o,c)=>{J(()=>{t("models",e,o,c),t("models",e,"err",o,void 0)})},E=(e,o,c)=>{J(()=>{t("headers",e,o,c),t("headers",e,"err",o,void 0)})},Q=()=>{const e=Ie({form:s,t:r.t,disabledProviders:d.data.config.disabled_providers??[],existingProviderIDs:new Set(d.data.provider.all.map(o=>o.id))});return J(()=>{t("err",e.err),e.models.forEach((o,c)=>t("models",c,"err",o)),e.headers.forEach((o,c)=>t("headers",c,"err",o))}),e.result},l=Y(()=>({mutationFn:async e=>{const c=(d.data.config.disabled_providers??[]).filter(h=>h!==e.providerID);return e.key&&await p.client.auth.set({providerID:e.providerID,auth:{type:"api",key:e.key}}),await d.updateConfig({provider:{[e.providerID]:e.config},disabled_providers:c}),e},onSuccess:e=>{v.close(),z({variant:"success",icon:"circle-check",title:r.t("provider.connect.toast.connected.title",{provider:e.name}),description:r.t("provider.connect.toast.connected.description",{provider:e.name})})},onError:e=>{const o=e instanceof Error?e.message:String(e);z({title:r.t("common.requestFailed"),description:o})}})),f=e=>{if(e.preventDefault(),l.isPending)return;const o=Q();o&&l.mutate(o)};return a(le,{get title(){return a(V,{tabIndex:-1,icon:"arrow-left",variant:"ghost",onClick:m,get"aria-label"(){return r.t("common.goBack")}})},transition:!0,get children(){var e=Pe(),o=e.firstChild,c=o.firstChild,h=o.nextSibling,T=h.firstChild,P=T.nextSibling,q=P.nextSibling,X=q.firstChild,me=X.firstChild,H=q.nextSibling,ve=H.firstChild;return n(o,a(de,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),c),n(c,()=>r.t("provider.custom.title")),h.addEventListener("submit",f),n(T,()=>r.t("provider.custom.description.prefix"),null),n(T,a(Ce,{href:"https://github.com/devinoldenburg/codeplane",tabIndex:-1,get children(){return r.t("provider.custom.description.link")}}),null),n(T,()=>r.t("provider.custom.description.suffix"),null),n(P,a(x,{autofocus:!0,get label(){return r.t("provider.custom.field.providerID.label")},get placeholder(){return r.t("provider.custom.field.providerID.placeholder")},get description(){return r.t("provider.custom.field.providerID.description")},get value(){return s.providerID},onChange:u=>$("providerID",u),get validationState(){return s.err.providerID?"invalid":void 0},get error(){return s.err.providerID}}),null),n(P,a(x,{get label(){return r.t("provider.custom.field.name.label")},get placeholder(){return r.t("provider.custom.field.name.placeholder")},get value(){return s.name},onChange:u=>$("name",u),get validationState(){return s.err.name?"invalid":void 0},get error(){return s.err.name}}),null),n(P,a(x,{get label(){return r.t("provider.custom.field.baseURL.label")},get placeholder(){return r.t("provider.custom.field.baseURL.placeholder")},get value(){return s.baseURL},onChange:u=>$("baseURL",u),get validationState(){return s.err.baseURL?"invalid":void 0},get error(){return s.err.baseURL}}),null),n(P,a(x,{get label(){return r.t("provider.custom.field.apiKey.label")},get placeholder(){return r.t("provider.custom.field.apiKey.placeholder")},get description(){return r.t("provider.custom.field.apiKey.description")},get value(){return s.apiKey},onChange:u=>$("apiKey",u)}),null),n(me,()=>r.t("provider.custom.models.label")),n(X,a(F,{type:"button",size:"small",variant:"ghost",onClick:()=>w.mutate({}),get disabled(){return!j()||w.isPending},get children(){return a(M,{get when(){return!w.isPending},get fallback(){return r.t("provider.custom.models.fetch.loading")},get children(){return r.t("provider.custom.models.fetch")}})}}),null),n(q,a(Z,{get each(){return s.models},children:(u,S)=>(()=>{var b=ie(),R=b.firstChild,N=R.nextSibling;return n(R,a(x,{get label(){return r.t("provider.custom.models.id.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.models.id.placeholder")},get value(){return u.id},onChange:_=>I(S(),"id",_),get validationState(){return u.err.id?"invalid":void 0},get error(){return u.err.id}})),n(N,a(x,{get label(){return r.t("provider.custom.models.name.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.models.name.placeholder")},get value(){return u.name},onChange:_=>I(S(),"name",_),get validationState(){return u.err.name?"invalid":void 0},get error(){return u.err.name}})),n(b,a(V,{type:"button",icon:"trash",variant:"ghost",class:"mt-1.5",onClick:()=>y(S()),get disabled(){return s.models.length<=1},get"aria-label"(){return r.t("provider.custom.models.remove")}}),null),ee(()=>re(b,"data-row",u.row)),b})()}),null),n(q,a(F,{type:"button",size:"small",variant:"ghost",icon:"plus-small",onClick:g,class:"self-start",get children(){return r.t("provider.custom.models.add")}}),null),n(ve,()=>r.t("provider.custom.headers.label")),n(H,a(Z,{get each(){return s.headers},children:(u,S)=>(()=>{var b=ie(),R=b.firstChild,N=R.nextSibling;return n(R,a(x,{get label(){return r.t("provider.custom.headers.key.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.headers.key.placeholder")},get value(){return u.key},onChange:_=>E(S(),"key",_),get validationState(){return u.err.key?"invalid":void 0},get error(){return u.err.key}})),n(N,a(x,{get label(){return r.t("provider.custom.headers.value.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.headers.value.placeholder")},get value(){return u.value},onChange:_=>E(S(),"value",_),get validationState(){return u.err.value?"invalid":void 0},get error(){return u.err.value}})),n(b,a(V,{type:"button",icon:"trash",variant:"ghost",class:"mt-1.5",onClick:()=>O(S()),get disabled(){return s.headers.length<=1},get"aria-label"(){return r.t("provider.custom.headers.remove")}}),null),ee(()=>re(b,"data-row",u.row)),b})()}),null),n(H,a(F,{type:"button",size:"small",variant:"ghost",icon:"plus-small",onClick:C,class:"self-start",get children(){return r.t("provider.custom.headers.add")}}),null),n(h,a(F,{class:"w-auto self-start",type:"submit",size:"large",variant:"primary",get disabled(){return l.isPending},get children(){return we(()=>!!l.isPending)()?r.t("common.saving"):r.t("common.submit")}}),null),e}})}var ae=A('<div class="text-14-regular text-text-weak">'),Ue=A('<div class="px-1.25 w-full flex items-center gap-x-3"><span>');const K="_custom",ue=()=>{const i=se(),v=xe(),d=ne(),p=()=>d.t("dialog.provider.group.popular"),r=()=>d.t("dialog.provider.group.other"),k=()=>d.t("settings.providers.tag.custom"),s=t=>{if(t==="anthropic")return d.t("dialog.provider.anthropic.note");if(t==="openai")return d.t("dialog.provider.openai.note");if(t.startsWith("github-copilot"))return d.t("dialog.provider.copilot.note")};return a(le,{get title(){return d.t("command.provider.connect")},transition:!0,get children(){return a(ke,{get search(){return{placeholder:d.t("dialog.provider.search.placeholder"),autofocus:!0}},get emptyMessage(){return d.t("dialog.provider.empty")},activeIcon:"plus-small",key:t=>t?.id,items:()=>(d.locale(),[{id:K,name:k()},...v.all()]),filterKeys:["id","name"],groupBy:t=>U.includes(t.id)?p():r(),sortBy:(t,m)=>t.id===K?-1:m.id===K?1:U.includes(t.id)&&U.includes(m.id)?U.indexOf(t.id)-U.indexOf(m.id):t.name.localeCompare(m.name),sortGroupsBy:(t,m)=>{const g=p();return t.category===g&&m.category!==g?-1:m.category===g&&t.category!==g?1:0},onSelect:t=>{if(t){if(t.id===K){i.show(()=>a(Re,{back:"providers"}));return}i.show(()=>a(Se,{get provider(){return t.id}}))}},children:t=>(()=>{var m=Ue(),g=m.firstChild;return n(m,a(de,{"data-slot":"list-item-extra-icon",get id(){return t.id}}),g),n(g,()=>t.name),n(m,a(M,{get when(){return t.id==="codeplane"},get children(){var y=ae();return n(y,()=>d.t("dialog.provider.codeplane.tagline")),y}}),null),n(m,a(M,{get when(){return t.id===K},get children(){return a(te,{get children(){return d.t("settings.providers.tag.custom")}})}}),null),n(m,a(M,{get when(){return t.id==="codeplane"},get children(){return a(te,{get children(){return d.t("dialog.provider.tag.recommended")}})}}),null),n(m,a(M,{get when(){return s(t.id)},keyed:!0,children:y=>(()=>{var C=ae();return n(C,y),C})()}),null),m})()})}})},Te=Object.freeze(Object.defineProperty({__proto__:null,DialogSelectProvider:ue},Symbol.toStringTag,{value:"Module"}));export{ue as D,Re as a,Te as d};
|
|
1
|
+
import{b as se,C as pe,R as ge,f as ne,c as he,h as fe,i as Y,z,k as be,o as ye,m as a,l as n,T as x,B as F,q as M,L as Z,I as V,N as ee,V as re,p as we,v as le,y as A,aq as J,aj as B,a7 as xe,a8 as te,aa as U}from"./index-CaPWFEmi.js";import{L as ke}from"./list-BiQMzfJm.js";import{P as de}from"./provider-icon-mQ6o_ygz.js";import{L as Ce,D as Se}from"./dialog-connect-provider-CbBxytwI.js";const _e=/^[a-z0-9][a-z0-9-_]*$/,Le="@ai-sdk/openai-compatible";function De(i){return new URL("/provider/custom-models",i).toString()}async function $e(i,v){if(!i.ok)throw new Error(v);if(i.headers.get("content-type")?.split(";")[0].trim().toLowerCase()!=="application/json")throw new Error(v);const p=await i.json().catch(()=>{});if(!p||typeof p!="object"||!Array.isArray(p.models))throw new Error(v);return p}function Ie(i){const v=i.form.providerID.trim(),d=i.form.name.trim(),p=i.form.baseURL.trim(),r=i.form.apiKey.trim(),k=r.match(/^\{env:([^}]+)\}$/)?.[1]?.trim(),s=r&&!k?r:void 0,t=v?_e.test(v)?void 0:i.t("provider.custom.error.providerID.format"):i.t("provider.custom.error.providerID.required"),m=d?void 0:i.t("provider.custom.error.name.required"),g=p?/^https?:\/\//.test(p)?void 0:i.t("provider.custom.error.baseURL.format"):i.t("provider.custom.error.baseURL.required"),y=i.disabledProviders.includes(v),C=t?void 0:i.existingProviderIDs.has(v)&&!y?i.t("provider.custom.error.providerID.exists"):void 0,O=new Set,L=i.form.models.map(l=>{const f=l.id.trim(),e=f?O.has(f)?i.t("provider.custom.error.duplicate"):(()=>{O.add(f)})():i.t("provider.custom.error.required"),o=l.name.trim()?void 0:i.t("provider.custom.error.required");return{id:e,name:o}}),j=L.every(l=>!l.id&&!l.name),G=Object.fromEntries(i.form.models.map(l=>[l.id.trim(),{name:l.name.trim()}])),w=new Set,D=i.form.headers.map(l=>{const f=l.key.trim(),e=l.value.trim();if(!f&&!e)return{};const o=f?w.has(f.toLowerCase())?i.t("provider.custom.error.duplicate"):(()=>{w.add(f.toLowerCase())})():i.t("provider.custom.error.required"),c=e?void 0:i.t("provider.custom.error.required");return{key:o,value:c}}),$=D.every(l=>!l.key&&!l.value),I=Object.fromEntries(i.form.headers.map(l=>({key:l.key.trim(),value:l.value.trim()})).filter(l=>!!l.key&&!!l.value).map(l=>[l.key,l.value])),E={providerID:t??C,name:m,baseURL:g};return!t&&!C&&!m&&!g&&j&&$?{err:E,models:L,headers:D,result:{providerID:v,name:d,key:s,config:{npm:Le,name:d,...k?{env:[k]}:{},options:{baseURL:p,...Object.keys(I).length?{headers:I}:{}},models:G}}}:{err:E,models:L,headers:D}}let Ee=0;const ce=()=>`row-${Ee++}`,W=()=>({row:ce(),id:"",name:"",err:{}}),oe=()=>({row:ce(),key:"",value:"",err:{}});var Pe=A('<div class="flex flex-col gap-6 px-2.5 pb-3 overflow-y-auto max-h-[60vh]"><div class="px-2.5 flex gap-4 items-center"><div class="text-16-medium text-text-strong"></div></div><form class="px-2.5 pb-6 flex flex-col gap-6"><p class="text-14-regular text-text-base"></p><div class="flex flex-col gap-4"></div><div class="flex flex-col gap-3"><div class="flex items-center justify-between gap-3"><label class="text-12-medium text-text-weak"></label></div></div><div class="flex flex-col gap-3"><label class="text-12-medium text-text-weak">'),ie=A('<div class="flex gap-2 items-start"><div class=flex-1></div><div class=flex-1>');function Re(i){const v=se(),d=pe(),p=ge(),r=ne(),k=he(),[s,t]=fe({providerID:"",name:"",baseURL:"",apiKey:"",models:[W()],headers:[oe()],err:{}}),m=()=>{if(i.back==="close"){v.close();return}v.show(()=>a(ue,{}))},g=()=>{t("models",B(e=>{e.push(W())}))},y=e=>{s.models.length<=1||t("models",B(o=>{o.splice(e,1)}))},C=()=>{t("headers",B(e=>{e.push(oe())}))},O=e=>{s.headers.length<=1||t("headers",B(o=>{o.splice(e,1)}))},L=()=>Object.fromEntries(s.headers.map(e=>({key:e.key.trim(),value:e.value.trim()})).filter(e=>!!e.key&&!!e.value).map(e=>[e.key,e.value])),j=()=>/^https?:\/\//.test(s.baseURL.trim()),G=()=>j()&&(!!s.apiKey.trim()||s.headers.some(e=>e.key.trim().toLowerCase()==="authorization"&&!!e.value.trim())),w=Y(()=>({mutationFn:async e=>{const o=k.current;if(!o)throw new Error(r.t("error.globalSDK.noServerAvailable"));const c=await fetch(De(o.http.url),{method:"POST",headers:{"content-type":"application/json",...o.http.password?{Authorization:`Basic ${btoa(`${o.http.username??"codeplane"}:${o.http.password}`)}`}:{}},body:JSON.stringify({baseURL:s.baseURL.trim(),apiKey:s.apiKey.trim().match(/^\{env:[^}]+\}$/)?void 0:s.apiKey.trim()||void 0,headers:L()})}),h=await $e(c,r.t("provider.custom.models.fetch.error"));if(h.models.length===0)throw new Error(r.t("provider.custom.models.fetch.empty"));return h},onSuccess:(e,o)=>{t("models",e.models.map(c=>({...W(),id:c.id,name:c.name}))),!o?.silent&&z({variant:"success",icon:"circle-check",title:r.t("provider.custom.models.fetch.success",{count:e.models.length})})},onError:(e,o)=>{if(o?.silent)return;const c=e instanceof Error?e.message:String(e);z({title:r.t("common.requestFailed"),description:c})}}));let D="";be(()=>{const e=JSON.stringify({baseURL:s.baseURL.trim(),apiKey:s.apiKey.trim(),headers:L()});if(!s.models.every(h=>!h.id.trim()&&!h.name.trim())||!G()||w.isPending||e===D)return;const c=setTimeout(()=>{D=e,w.mutate({silent:!0})},600);ye(()=>clearTimeout(c))});const $=(e,o)=>{t(e,o),e!=="apiKey"&&t("err",e,void 0)},I=(e,o,c)=>{J(()=>{t("models",e,o,c),t("models",e,"err",o,void 0)})},E=(e,o,c)=>{J(()=>{t("headers",e,o,c),t("headers",e,"err",o,void 0)})},Q=()=>{const e=Ie({form:s,t:r.t,disabledProviders:d.data.config.disabled_providers??[],existingProviderIDs:new Set(d.data.provider.all.map(o=>o.id))});return J(()=>{t("err",e.err),e.models.forEach((o,c)=>t("models",c,"err",o)),e.headers.forEach((o,c)=>t("headers",c,"err",o))}),e.result},l=Y(()=>({mutationFn:async e=>{const c=(d.data.config.disabled_providers??[]).filter(h=>h!==e.providerID);return e.key&&await p.client.auth.set({providerID:e.providerID,auth:{type:"api",key:e.key}}),await d.updateConfig({provider:{[e.providerID]:e.config},disabled_providers:c}),e},onSuccess:e=>{v.close(),z({variant:"success",icon:"circle-check",title:r.t("provider.connect.toast.connected.title",{provider:e.name}),description:r.t("provider.connect.toast.connected.description",{provider:e.name})})},onError:e=>{const o=e instanceof Error?e.message:String(e);z({title:r.t("common.requestFailed"),description:o})}})),f=e=>{if(e.preventDefault(),l.isPending)return;const o=Q();o&&l.mutate(o)};return a(le,{get title(){return a(V,{tabIndex:-1,icon:"arrow-left",variant:"ghost",onClick:m,get"aria-label"(){return r.t("common.goBack")}})},transition:!0,get children(){var e=Pe(),o=e.firstChild,c=o.firstChild,h=o.nextSibling,T=h.firstChild,P=T.nextSibling,q=P.nextSibling,X=q.firstChild,me=X.firstChild,H=q.nextSibling,ve=H.firstChild;return n(o,a(de,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),c),n(c,()=>r.t("provider.custom.title")),h.addEventListener("submit",f),n(T,()=>r.t("provider.custom.description.prefix"),null),n(T,a(Ce,{href:"https://github.com/devinoldenburg/codeplane",tabIndex:-1,get children(){return r.t("provider.custom.description.link")}}),null),n(T,()=>r.t("provider.custom.description.suffix"),null),n(P,a(x,{autofocus:!0,get label(){return r.t("provider.custom.field.providerID.label")},get placeholder(){return r.t("provider.custom.field.providerID.placeholder")},get description(){return r.t("provider.custom.field.providerID.description")},get value(){return s.providerID},onChange:u=>$("providerID",u),get validationState(){return s.err.providerID?"invalid":void 0},get error(){return s.err.providerID}}),null),n(P,a(x,{get label(){return r.t("provider.custom.field.name.label")},get placeholder(){return r.t("provider.custom.field.name.placeholder")},get value(){return s.name},onChange:u=>$("name",u),get validationState(){return s.err.name?"invalid":void 0},get error(){return s.err.name}}),null),n(P,a(x,{get label(){return r.t("provider.custom.field.baseURL.label")},get placeholder(){return r.t("provider.custom.field.baseURL.placeholder")},get value(){return s.baseURL},onChange:u=>$("baseURL",u),get validationState(){return s.err.baseURL?"invalid":void 0},get error(){return s.err.baseURL}}),null),n(P,a(x,{get label(){return r.t("provider.custom.field.apiKey.label")},get placeholder(){return r.t("provider.custom.field.apiKey.placeholder")},get description(){return r.t("provider.custom.field.apiKey.description")},get value(){return s.apiKey},onChange:u=>$("apiKey",u)}),null),n(me,()=>r.t("provider.custom.models.label")),n(X,a(F,{type:"button",size:"small",variant:"ghost",onClick:()=>w.mutate({}),get disabled(){return!j()||w.isPending},get children(){return a(M,{get when(){return!w.isPending},get fallback(){return r.t("provider.custom.models.fetch.loading")},get children(){return r.t("provider.custom.models.fetch")}})}}),null),n(q,a(Z,{get each(){return s.models},children:(u,S)=>(()=>{var b=ie(),R=b.firstChild,N=R.nextSibling;return n(R,a(x,{get label(){return r.t("provider.custom.models.id.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.models.id.placeholder")},get value(){return u.id},onChange:_=>I(S(),"id",_),get validationState(){return u.err.id?"invalid":void 0},get error(){return u.err.id}})),n(N,a(x,{get label(){return r.t("provider.custom.models.name.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.models.name.placeholder")},get value(){return u.name},onChange:_=>I(S(),"name",_),get validationState(){return u.err.name?"invalid":void 0},get error(){return u.err.name}})),n(b,a(V,{type:"button",icon:"trash",variant:"ghost",class:"mt-1.5",onClick:()=>y(S()),get disabled(){return s.models.length<=1},get"aria-label"(){return r.t("provider.custom.models.remove")}}),null),ee(()=>re(b,"data-row",u.row)),b})()}),null),n(q,a(F,{type:"button",size:"small",variant:"ghost",icon:"plus-small",onClick:g,class:"self-start",get children(){return r.t("provider.custom.models.add")}}),null),n(ve,()=>r.t("provider.custom.headers.label")),n(H,a(Z,{get each(){return s.headers},children:(u,S)=>(()=>{var b=ie(),R=b.firstChild,N=R.nextSibling;return n(R,a(x,{get label(){return r.t("provider.custom.headers.key.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.headers.key.placeholder")},get value(){return u.key},onChange:_=>E(S(),"key",_),get validationState(){return u.err.key?"invalid":void 0},get error(){return u.err.key}})),n(N,a(x,{get label(){return r.t("provider.custom.headers.value.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.headers.value.placeholder")},get value(){return u.value},onChange:_=>E(S(),"value",_),get validationState(){return u.err.value?"invalid":void 0},get error(){return u.err.value}})),n(b,a(V,{type:"button",icon:"trash",variant:"ghost",class:"mt-1.5",onClick:()=>O(S()),get disabled(){return s.headers.length<=1},get"aria-label"(){return r.t("provider.custom.headers.remove")}}),null),ee(()=>re(b,"data-row",u.row)),b})()}),null),n(H,a(F,{type:"button",size:"small",variant:"ghost",icon:"plus-small",onClick:C,class:"self-start",get children(){return r.t("provider.custom.headers.add")}}),null),n(h,a(F,{class:"w-auto self-start",type:"submit",size:"large",variant:"primary",get disabled(){return l.isPending},get children(){return we(()=>!!l.isPending)()?r.t("common.saving"):r.t("common.submit")}}),null),e}})}var ae=A('<div class="text-14-regular text-text-weak">'),Ue=A('<div class="px-1.25 w-full flex items-center gap-x-3"><span>');const K="_custom",ue=()=>{const i=se(),v=xe(),d=ne(),p=()=>d.t("dialog.provider.group.popular"),r=()=>d.t("dialog.provider.group.other"),k=()=>d.t("settings.providers.tag.custom"),s=t=>{if(t==="anthropic")return d.t("dialog.provider.anthropic.note");if(t==="openai")return d.t("dialog.provider.openai.note");if(t.startsWith("github-copilot"))return d.t("dialog.provider.copilot.note")};return a(le,{get title(){return d.t("command.provider.connect")},transition:!0,get children(){return a(ke,{get search(){return{placeholder:d.t("dialog.provider.search.placeholder"),autofocus:!0}},get emptyMessage(){return d.t("dialog.provider.empty")},activeIcon:"plus-small",key:t=>t?.id,items:()=>(d.locale(),[{id:K,name:k()},...v.all()]),filterKeys:["id","name"],groupBy:t=>U.includes(t.id)?p():r(),sortBy:(t,m)=>t.id===K?-1:m.id===K?1:U.includes(t.id)&&U.includes(m.id)?U.indexOf(t.id)-U.indexOf(m.id):t.name.localeCompare(m.name),sortGroupsBy:(t,m)=>{const g=p();return t.category===g&&m.category!==g?-1:m.category===g&&t.category!==g?1:0},onSelect:t=>{if(t){if(t.id===K){i.show(()=>a(Re,{back:"providers"}));return}i.show(()=>a(Se,{get provider(){return t.id}}))}},children:t=>(()=>{var m=Ue(),g=m.firstChild;return n(m,a(de,{"data-slot":"list-item-extra-icon",get id(){return t.id}}),g),n(g,()=>t.name),n(m,a(M,{get when(){return t.id==="codeplane"},get children(){var y=ae();return n(y,()=>d.t("dialog.provider.codeplane.tagline")),y}}),null),n(m,a(M,{get when(){return t.id===K},get children(){return a(te,{get children(){return d.t("settings.providers.tag.custom")}})}}),null),n(m,a(M,{get when(){return t.id==="codeplane"},get children(){return a(te,{get children(){return d.t("dialog.provider.tag.recommended")}})}}),null),n(m,a(M,{get when(){return s(t.id)},keyed:!0,children:y=>(()=>{var C=ae();return n(C,y),C})()}),null),m})()})}})},Te=Object.freeze(Object.defineProperty({__proto__:null,DialogSelectProvider:ue},Symbol.toStringTag,{value:"Module"}));export{ue as D,Re as a,Te as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as me,b as he,c as fe,e as Y,f as R,g as Z,h as pe,i as G,n as z,S as h,j as C,k as J,o as Se,l as S,m as a,I as O,p as w,q as $,r as we,s as ye,t as be,D as p,B as Q,v as ke,w as Ce,x as xe,y as F,T as N,z as _e}from"./index-CPokXzBk.js";import{L as Pe}from"./list-B-BljgiC.js";var De=F('<div class=px-5><div class="bg-surface-base rounded-md p-5 flex flex-col gap-3"><div class="flex-1 min-w-0 [&_[data-slot=input-wrapper]]:relative"></div><div class="grid grid-cols-2 gap-2 min-w-0">'),$e=F('<div class="flex items-center gap-2 -ml-2"><span>'),Ie=F('<div class="flex flex-1 min-h-0 flex-col gap-2"><div class="shrink-0 px-5 pb-5">'),Ee=F('<div class="flex items-center gap-3 min-w-0 flex-1 w-full group/item"><div class="flex flex-col h-full items-start w-5"></div><div class="flex items-center justify-center gap-4 pl-4">'),Ae=F('<span class="text-text-base bg-surface-base text-14-regular px-1.5 rounded-xs">');const K="codeplane";function X(i,l){_e({variant:"error",title:i.t("common.requestFailed"),description:l instanceof Error?l.message:String(l)})}function Fe(){const i=R(),l=Y(),[o,u]=Ce(async()=>{try{const g=await l.getDefaultServer?.();return g||null}catch(g){return X(i,g),null}},{initialValue:null}),s=C(()=>!!l.getDefaultServer&&!!l.setDefaultServer);return{defaultKey:o,canDefault:s,setDefault:async g=>{try{await l.setDefaultServer?.(g),u.mutate(g)}catch(x){X(i,x)}}}}function Me(){const i=Z(),l=u=>{const s=z(u);if(!s)return!1;const m=s.replace(/^https?:\/\//,"").split("/")[0];return m?m.includes("localhost")||m.startsWith("127.0.0.1")?!0:m.includes(".")||m.includes(":"):!1};return{previewStatus:async(u,s,m,g)=>{if(g(void 0),!l(u))return;const x=z(u);if(!x)return;const y={url:x};s&&(y.username=s),m&&(y.password=m);const A=await i(y);g(A.healthy)}}}function Ne(i){const l=R(),o=u=>{if(u.stopPropagation(),u.key==="Escape"){u.preventDefault(),i.onBack();return}u.key!=="Enter"||u.isComposing||(u.preventDefault(),i.onSubmit())};return(()=>{var u=De(),s=u.firstChild,m=s.firstChild,g=m.nextSibling;return S(m,a(N,{type:"text",get label(){return l.t("dialog.server.add.url")},get placeholder(){return i.placeholder},get value(){return i.value},autofocus:!0,get validationState(){return i.error?"invalid":"valid"},get error(){return i.error},get disabled(){return i.busy},get onChange(){return i.onChange},onKeyDown:o})),S(s,a(N,{type:"text",get label(){return l.t("dialog.server.add.name")},get placeholder(){return l.t("dialog.server.add.namePlaceholder")},get value(){return i.name},get disabled(){return i.busy},get onChange(){return i.onNameChange},onKeyDown:o}),g),S(g,a(N,{type:"text",get label(){return l.t("dialog.server.add.username")},get placeholder(){return l.t("dialog.server.add.usernamePlaceholder")},get value(){return i.username},get disabled(){return i.busy},get onChange(){return i.onUsernameChange},onKeyDown:o}),null),S(g,a(N,{type:"password",get label(){return l.t("dialog.server.add.password")},get placeholder(){return l.t("dialog.server.add.passwordPlaceholder")},get value(){return i.password},get disabled(){return i.busy},get onChange(){return i.onPasswordChange},onKeyDown:o}),null),u})()}function Ue(){const i=me(),l=he(),o=fe(),u=Y(),s=R(),{defaultKey:m,canDefault:g,setDefault:x}=Fe(),{previewStatus:y}=Me(),A=Z(),[r,d]=pe({status:{},addServer:{url:"",name:"",username:K,password:"",error:"",showForm:!1,status:void 0},editServer:{id:void 0,value:"",name:"",username:"",password:"",error:"",status:void 0}}),M=()=>{d("addServer",{url:"",name:"",username:K,password:"",error:"",showForm:!1,status:void 0})},I=()=>{d("editServer",{id:void 0,value:"",name:"",username:"",password:"",error:"",status:void 0})},_=G(()=>({mutationFn:async e=>{const t=z(e);if(!t){M();return}const n={type:"http",http:{url:t}};if(r.addServer.name.trim()&&(n.displayName=r.addServer.name.trim()),r.addServer.password&&(n.http.password=r.addServer.password),r.addServer.password&&r.addServer.username&&(n.http.username=r.addServer.username),!(await A(n.http)).healthy){d("addServer",{error:s.t("dialog.server.add.error")});return}M(),await q(n,!0)}})),P=G(()=>({mutationFn:async e=>{if(e.original.type!=="http")return;const t=z(e.value);if(!t){I();return}const n=r.editServer.name.trim()||void 0,v=r.editServer.username||void 0,c=r.editServer.password||void 0,b=e.original.displayName;if(t===e.original.http.url&&n===b&&v===e.original.http.username&&c===e.original.http.password){I();return}const k={type:"http",displayName:n,http:{url:t,username:v,password:c}};if(!(await A(k.http)).healthy){d("editServer",{error:s.t("dialog.server.add.error")});return}t===e.original.http.url?o.add(k):ee(e.original,k),I()}})),ee=(e,t)=>{const n=o.key,v=o.add(t);if(!v)return;const c=n===h.key(e)?h.key(v):n;c&&o.setActive(c),o.remove(h.key(e))},E=C(()=>{const e=o.current,t=o.list;return e?t.includes(e)?[e,...t.filter(n=>n!==e)]:[e,...t]:t}),T=C(()=>E().find(e=>h.key(e)===o.key)??E()[0]),re=C(()=>{const e=E();if(!e.length)return e;const t=T(),n=new Map(e.map((c,b)=>[c,b])),v=c=>c?.healthy===!0?0:c?.healthy===!1?2:1;return e.slice().sort((c,b)=>{if(c===t)return-1;if(b===t)return 1;const k=v(r.status[h.key(c)])-v(r.status[h.key(b)]);return k!==0?k:(n.get(c)??0)-(n.get(b)??0)})});async function H(){const e={};await Promise.all(E().map(async t=>{e[h.key(t)]=await A(t.http)})),d("status",xe(e))}J(()=>{E(),H();const e=setInterval(H,1e4);Se(()=>clearInterval(e))});async function q(e,t){if(!(!t&&r.status[h.key(e)]?.healthy===!1)){if(l.close(),t&&e.type==="http"){o.add(e),i("/");return}i("/"),queueMicrotask(()=>o.setActive(h.key(e)))}}const te=e=>{_.isPending||(d("addServer",{url:e,error:""}),y(e,r.addServer.username,r.addServer.password,t=>d("addServer",{status:t})))},ae=e=>{_.isPending||d("addServer",{name:e,error:""})},ne=e=>{_.isPending||(d("addServer",{username:e,error:""}),y(r.addServer.url,e,r.addServer.password,t=>d("addServer",{status:t})))},se=e=>{_.isPending||(d("addServer",{password:e,error:""}),y(r.addServer.url,r.addServer.username,e,t=>d("addServer",{status:t})))},ie=e=>{P.isPending||(d("editServer",{value:e,error:""}),y(e,r.editServer.username,r.editServer.password,t=>d("editServer",{status:t})))},de=e=>{P.isPending||d("editServer",{name:e,error:""})},le=e=>{P.isPending||(d("editServer",{username:e,error:""}),y(r.editServer.value,e,r.editServer.password,t=>d("editServer",{status:t})))},oe=e=>{P.isPending||(d("editServer",{password:e,error:""}),y(r.editServer.value,r.editServer.username,e,t=>d("editServer",{status:t})))},L=C(()=>r.editServer.id?"edit":r.addServer.showForm?"add":"list"),j=C(()=>{if(r.editServer.id)return E().find(e=>e.type==="http"&&e.http.url===r.editServer.id)}),V=()=>{M(),I()},ue=()=>{I(),d("addServer",{showForm:!0,url:"",name:"",username:K,password:"",error:"",status:void 0})},ce=e=>{M(),d("editServer",{id:e.http.url,value:e.http.url,name:e.displayName??"",username:e.http.username??"",password:e.http.password??"",error:"",status:r.status[h.key(e)]?.healthy})},W=()=>{if(L()==="add"){if(_.isPending)return;d("addServer",{error:""}),_.mutate(r.addServer.url);return}const e=j();e&&(P.isPending||(d("editServer",{error:""}),P.mutate({original:e,value:r.editServer.value})))},U=C(()=>L()!=="list"),f=C(()=>L()==="add"),B=C(()=>f()?_.isPending:P.isPending),ge=C(()=>U()?(()=>{var e=$e(),t=e.firstChild;return S(e,a(O,{icon:"arrow-left",variant:"ghost",onClick:V,get"aria-label"(){return s.t("common.goBack")}}),t),S(t,(()=>{var n=w(()=>!!f());return()=>n()?s.t("dialog.server.add.title"):s.t("dialog.server.edit.title")})()),e})():s.t("dialog.server.title"));J(()=>{r.editServer.id&&(j()||I())});async function ve(e){o.remove(e),await u.getDefaultServer?.()===e&&u.setDefaultServer?.(null)}return a(ke,{get title(){return ge()},get children(){var e=Ie(),t=e.firstChild;return S(e,a($,{get when(){return!U()},get fallback(){return a(Ne,{get value(){return w(()=>!!f())()?r.addServer.url:r.editServer.value},get name(){return w(()=>!!f())()?r.addServer.name:r.editServer.name},get username(){return w(()=>!!f())()?r.addServer.username:r.editServer.username},get password(){return w(()=>!!f())()?r.addServer.password:r.editServer.password},get placeholder(){return s.t("dialog.server.add.placeholder")},get busy(){return B()},get error(){return w(()=>!!f())()?r.addServer.error:r.editServer.error},get status(){return w(()=>!!f())()?r.addServer.status:r.editServer.status},get onChange(){return f()?te:ie},get onNameChange(){return f()?ae:de},get onUsernameChange(){return f()?ne:le},get onPasswordChange(){return f()?se:oe},onSubmit:W,onBack:V})},get children(){return a(Pe,{get search(){return{placeholder:s.t("dialog.server.search.placeholder"),autofocus:!1}},noInitialSelection:!0,get emptyMessage(){return s.t("dialog.server.empty")},items:re,key:n=>n.http.url,onSelect:n=>{n&&q(n)},divider:!0,class:"flex-1 min-h-0 px-5 [&_[data-slot=list-search-wrapper]]:w-full [&_[data-slot=list-scroll]]:flex-1 [&_[data-slot=list-scroll]]:overflow-y-auto [&_[data-slot=list-items]]:bg-surface-base [&_[data-slot=list-items]]:rounded-md [&_[data-slot=list-item]]:min-h-14 [&_[data-slot=list-item]]:p-3 [&_[data-slot=list-item]]:!bg-transparent",children:n=>{const v=h.key(n);return(()=>{var c=Ee(),b=c.firstChild,k=b.nextSibling;return S(b,a(we,{get health(){return r.status[v]}})),S(c,a(ye,{conn:n,get dimmed(){return r.status[v]?.healthy===!1},get status(){return r.status[v]},class:"flex items-center gap-3 min-w-0 flex-1",get badge(){return a($,{get when(){return m()===h.key(n)},get children(){var D=Ae();return S(D,()=>s.t("dialog.server.status.default")),D}})},showCredentials:!0}),k),S(k,a($,{get when(){return h.key(T())===v},get children(){return a(be,{name:"check",class:"h-6"})}}),null),S(k,a($,{get when(){return n.type==="http"},get children(){return a(p,{get children(){return[a(p.Trigger,{as:O,icon:"dot-grid",variant:"ghost",class:"shrink-0 size-8 hover:bg-surface-base-hover data-[expanded]:bg-surface-base-active",onClick:D=>D.stopPropagation(),onPointerDown:D=>D.stopPropagation()}),a(p.Portal,{get children(){return a(p.Content,{class:"mt-1",get children(){return[a(p.Item,{onSelect:()=>{n.type==="http"&&ce(n)},get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.edit")}})}}),a($,{get when(){return w(()=>!!g())()&&m()!==v},get children(){return a(p.Item,{onSelect:()=>x(v),get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.default")}})}})}}),a($,{get when(){return w(()=>!!g())()&&m()===v},get children(){return a(p.Item,{onSelect:()=>x(null),get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.defaultRemove")}})}})}}),a(p.Separator,{}),a(p.Item,{onSelect:()=>ve(h.key(n)),class:"text-text-on-critical-base hover:bg-surface-critical-weak",get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.delete")}})}})]}})}})]}})}}),null),c})()}})}}),t),S(t,a($,{get when(){return U()},get fallback(){return a(Q,{variant:"secondary",icon:"plus-small",size:"large",onClick:ue,class:"py-1.5 pl-1.5 pr-3 flex items-center gap-1.5",get children(){return s.t("dialog.server.add.button")}})},get children(){return a(Q,{variant:"primary",size:"large",onClick:W,get disabled(){return B()},class:"px-3 py-1.5",get children(){return w(()=>!!B())()?s.t("dialog.server.add.checking"):w(()=>!!f())()?s.t("dialog.server.add.button"):s.t("common.save")}})}})),e}})}export{Ue as DialogSelectServer};
|
|
1
|
+
import{u as me,b as he,c as fe,e as Y,f as R,g as Z,h as pe,i as G,n as z,S as h,j as C,k as J,o as Se,l as S,m as a,I as O,p as w,q as $,r as we,s as ye,t as be,D as p,B as Q,v as ke,w as Ce,x as xe,y as F,T as N,z as _e}from"./index-CaPWFEmi.js";import{L as Pe}from"./list-BiQMzfJm.js";var De=F('<div class=px-5><div class="bg-surface-base rounded-md p-5 flex flex-col gap-3"><div class="flex-1 min-w-0 [&_[data-slot=input-wrapper]]:relative"></div><div class="grid grid-cols-2 gap-2 min-w-0">'),$e=F('<div class="flex items-center gap-2 -ml-2"><span>'),Ie=F('<div class="flex flex-1 min-h-0 flex-col gap-2"><div class="shrink-0 px-5 pb-5">'),Ee=F('<div class="flex items-center gap-3 min-w-0 flex-1 w-full group/item"><div class="flex flex-col h-full items-start w-5"></div><div class="flex items-center justify-center gap-4 pl-4">'),Ae=F('<span class="text-text-base bg-surface-base text-14-regular px-1.5 rounded-xs">');const K="codeplane";function X(i,l){_e({variant:"error",title:i.t("common.requestFailed"),description:l instanceof Error?l.message:String(l)})}function Fe(){const i=R(),l=Y(),[o,u]=Ce(async()=>{try{const g=await l.getDefaultServer?.();return g||null}catch(g){return X(i,g),null}},{initialValue:null}),s=C(()=>!!l.getDefaultServer&&!!l.setDefaultServer);return{defaultKey:o,canDefault:s,setDefault:async g=>{try{await l.setDefaultServer?.(g),u.mutate(g)}catch(x){X(i,x)}}}}function Me(){const i=Z(),l=u=>{const s=z(u);if(!s)return!1;const m=s.replace(/^https?:\/\//,"").split("/")[0];return m?m.includes("localhost")||m.startsWith("127.0.0.1")?!0:m.includes(".")||m.includes(":"):!1};return{previewStatus:async(u,s,m,g)=>{if(g(void 0),!l(u))return;const x=z(u);if(!x)return;const y={url:x};s&&(y.username=s),m&&(y.password=m);const A=await i(y);g(A.healthy)}}}function Ne(i){const l=R(),o=u=>{if(u.stopPropagation(),u.key==="Escape"){u.preventDefault(),i.onBack();return}u.key!=="Enter"||u.isComposing||(u.preventDefault(),i.onSubmit())};return(()=>{var u=De(),s=u.firstChild,m=s.firstChild,g=m.nextSibling;return S(m,a(N,{type:"text",get label(){return l.t("dialog.server.add.url")},get placeholder(){return i.placeholder},get value(){return i.value},autofocus:!0,get validationState(){return i.error?"invalid":"valid"},get error(){return i.error},get disabled(){return i.busy},get onChange(){return i.onChange},onKeyDown:o})),S(s,a(N,{type:"text",get label(){return l.t("dialog.server.add.name")},get placeholder(){return l.t("dialog.server.add.namePlaceholder")},get value(){return i.name},get disabled(){return i.busy},get onChange(){return i.onNameChange},onKeyDown:o}),g),S(g,a(N,{type:"text",get label(){return l.t("dialog.server.add.username")},get placeholder(){return l.t("dialog.server.add.usernamePlaceholder")},get value(){return i.username},get disabled(){return i.busy},get onChange(){return i.onUsernameChange},onKeyDown:o}),null),S(g,a(N,{type:"password",get label(){return l.t("dialog.server.add.password")},get placeholder(){return l.t("dialog.server.add.passwordPlaceholder")},get value(){return i.password},get disabled(){return i.busy},get onChange(){return i.onPasswordChange},onKeyDown:o}),null),u})()}function Ue(){const i=me(),l=he(),o=fe(),u=Y(),s=R(),{defaultKey:m,canDefault:g,setDefault:x}=Fe(),{previewStatus:y}=Me(),A=Z(),[r,d]=pe({status:{},addServer:{url:"",name:"",username:K,password:"",error:"",showForm:!1,status:void 0},editServer:{id:void 0,value:"",name:"",username:"",password:"",error:"",status:void 0}}),M=()=>{d("addServer",{url:"",name:"",username:K,password:"",error:"",showForm:!1,status:void 0})},I=()=>{d("editServer",{id:void 0,value:"",name:"",username:"",password:"",error:"",status:void 0})},_=G(()=>({mutationFn:async e=>{const t=z(e);if(!t){M();return}const n={type:"http",http:{url:t}};if(r.addServer.name.trim()&&(n.displayName=r.addServer.name.trim()),r.addServer.password&&(n.http.password=r.addServer.password),r.addServer.password&&r.addServer.username&&(n.http.username=r.addServer.username),!(await A(n.http)).healthy){d("addServer",{error:s.t("dialog.server.add.error")});return}M(),await q(n,!0)}})),P=G(()=>({mutationFn:async e=>{if(e.original.type!=="http")return;const t=z(e.value);if(!t){I();return}const n=r.editServer.name.trim()||void 0,v=r.editServer.username||void 0,c=r.editServer.password||void 0,b=e.original.displayName;if(t===e.original.http.url&&n===b&&v===e.original.http.username&&c===e.original.http.password){I();return}const k={type:"http",displayName:n,http:{url:t,username:v,password:c}};if(!(await A(k.http)).healthy){d("editServer",{error:s.t("dialog.server.add.error")});return}t===e.original.http.url?o.add(k):ee(e.original,k),I()}})),ee=(e,t)=>{const n=o.key,v=o.add(t);if(!v)return;const c=n===h.key(e)?h.key(v):n;c&&o.setActive(c),o.remove(h.key(e))},E=C(()=>{const e=o.current,t=o.list;return e?t.includes(e)?[e,...t.filter(n=>n!==e)]:[e,...t]:t}),T=C(()=>E().find(e=>h.key(e)===o.key)??E()[0]),re=C(()=>{const e=E();if(!e.length)return e;const t=T(),n=new Map(e.map((c,b)=>[c,b])),v=c=>c?.healthy===!0?0:c?.healthy===!1?2:1;return e.slice().sort((c,b)=>{if(c===t)return-1;if(b===t)return 1;const k=v(r.status[h.key(c)])-v(r.status[h.key(b)]);return k!==0?k:(n.get(c)??0)-(n.get(b)??0)})});async function H(){const e={};await Promise.all(E().map(async t=>{e[h.key(t)]=await A(t.http)})),d("status",xe(e))}J(()=>{E(),H();const e=setInterval(H,1e4);Se(()=>clearInterval(e))});async function q(e,t){if(!(!t&&r.status[h.key(e)]?.healthy===!1)){if(l.close(),t&&e.type==="http"){o.add(e),i("/");return}i("/"),queueMicrotask(()=>o.setActive(h.key(e)))}}const te=e=>{_.isPending||(d("addServer",{url:e,error:""}),y(e,r.addServer.username,r.addServer.password,t=>d("addServer",{status:t})))},ae=e=>{_.isPending||d("addServer",{name:e,error:""})},ne=e=>{_.isPending||(d("addServer",{username:e,error:""}),y(r.addServer.url,e,r.addServer.password,t=>d("addServer",{status:t})))},se=e=>{_.isPending||(d("addServer",{password:e,error:""}),y(r.addServer.url,r.addServer.username,e,t=>d("addServer",{status:t})))},ie=e=>{P.isPending||(d("editServer",{value:e,error:""}),y(e,r.editServer.username,r.editServer.password,t=>d("editServer",{status:t})))},de=e=>{P.isPending||d("editServer",{name:e,error:""})},le=e=>{P.isPending||(d("editServer",{username:e,error:""}),y(r.editServer.value,e,r.editServer.password,t=>d("editServer",{status:t})))},oe=e=>{P.isPending||(d("editServer",{password:e,error:""}),y(r.editServer.value,r.editServer.username,e,t=>d("editServer",{status:t})))},L=C(()=>r.editServer.id?"edit":r.addServer.showForm?"add":"list"),j=C(()=>{if(r.editServer.id)return E().find(e=>e.type==="http"&&e.http.url===r.editServer.id)}),V=()=>{M(),I()},ue=()=>{I(),d("addServer",{showForm:!0,url:"",name:"",username:K,password:"",error:"",status:void 0})},ce=e=>{M(),d("editServer",{id:e.http.url,value:e.http.url,name:e.displayName??"",username:e.http.username??"",password:e.http.password??"",error:"",status:r.status[h.key(e)]?.healthy})},W=()=>{if(L()==="add"){if(_.isPending)return;d("addServer",{error:""}),_.mutate(r.addServer.url);return}const e=j();e&&(P.isPending||(d("editServer",{error:""}),P.mutate({original:e,value:r.editServer.value})))},U=C(()=>L()!=="list"),f=C(()=>L()==="add"),B=C(()=>f()?_.isPending:P.isPending),ge=C(()=>U()?(()=>{var e=$e(),t=e.firstChild;return S(e,a(O,{icon:"arrow-left",variant:"ghost",onClick:V,get"aria-label"(){return s.t("common.goBack")}}),t),S(t,(()=>{var n=w(()=>!!f());return()=>n()?s.t("dialog.server.add.title"):s.t("dialog.server.edit.title")})()),e})():s.t("dialog.server.title"));J(()=>{r.editServer.id&&(j()||I())});async function ve(e){o.remove(e),await u.getDefaultServer?.()===e&&u.setDefaultServer?.(null)}return a(ke,{get title(){return ge()},get children(){var e=Ie(),t=e.firstChild;return S(e,a($,{get when(){return!U()},get fallback(){return a(Ne,{get value(){return w(()=>!!f())()?r.addServer.url:r.editServer.value},get name(){return w(()=>!!f())()?r.addServer.name:r.editServer.name},get username(){return w(()=>!!f())()?r.addServer.username:r.editServer.username},get password(){return w(()=>!!f())()?r.addServer.password:r.editServer.password},get placeholder(){return s.t("dialog.server.add.placeholder")},get busy(){return B()},get error(){return w(()=>!!f())()?r.addServer.error:r.editServer.error},get status(){return w(()=>!!f())()?r.addServer.status:r.editServer.status},get onChange(){return f()?te:ie},get onNameChange(){return f()?ae:de},get onUsernameChange(){return f()?ne:le},get onPasswordChange(){return f()?se:oe},onSubmit:W,onBack:V})},get children(){return a(Pe,{get search(){return{placeholder:s.t("dialog.server.search.placeholder"),autofocus:!1}},noInitialSelection:!0,get emptyMessage(){return s.t("dialog.server.empty")},items:re,key:n=>n.http.url,onSelect:n=>{n&&q(n)},divider:!0,class:"flex-1 min-h-0 px-5 [&_[data-slot=list-search-wrapper]]:w-full [&_[data-slot=list-scroll]]:flex-1 [&_[data-slot=list-scroll]]:overflow-y-auto [&_[data-slot=list-items]]:bg-surface-base [&_[data-slot=list-items]]:rounded-md [&_[data-slot=list-item]]:min-h-14 [&_[data-slot=list-item]]:p-3 [&_[data-slot=list-item]]:!bg-transparent",children:n=>{const v=h.key(n);return(()=>{var c=Ee(),b=c.firstChild,k=b.nextSibling;return S(b,a(we,{get health(){return r.status[v]}})),S(c,a(ye,{conn:n,get dimmed(){return r.status[v]?.healthy===!1},get status(){return r.status[v]},class:"flex items-center gap-3 min-w-0 flex-1",get badge(){return a($,{get when(){return m()===h.key(n)},get children(){var D=Ae();return S(D,()=>s.t("dialog.server.status.default")),D}})},showCredentials:!0}),k),S(k,a($,{get when(){return h.key(T())===v},get children(){return a(be,{name:"check",class:"h-6"})}}),null),S(k,a($,{get when(){return n.type==="http"},get children(){return a(p,{get children(){return[a(p.Trigger,{as:O,icon:"dot-grid",variant:"ghost",class:"shrink-0 size-8 hover:bg-surface-base-hover data-[expanded]:bg-surface-base-active",onClick:D=>D.stopPropagation(),onPointerDown:D=>D.stopPropagation()}),a(p.Portal,{get children(){return a(p.Content,{class:"mt-1",get children(){return[a(p.Item,{onSelect:()=>{n.type==="http"&&ce(n)},get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.edit")}})}}),a($,{get when(){return w(()=>!!g())()&&m()!==v},get children(){return a(p.Item,{onSelect:()=>x(v),get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.default")}})}})}}),a($,{get when(){return w(()=>!!g())()&&m()===v},get children(){return a(p.Item,{onSelect:()=>x(null),get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.defaultRemove")}})}})}}),a(p.Separator,{}),a(p.Item,{onSelect:()=>ve(h.key(n)),class:"text-text-on-critical-base hover:bg-surface-critical-weak",get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.delete")}})}})]}})}})]}})}}),null),c})()}})}}),t),S(t,a($,{get when(){return U()},get fallback(){return a(Q,{variant:"secondary",icon:"plus-small",size:"large",onClick:ue,class:"py-1.5 pl-1.5 pr-3 flex items-center gap-1.5",get children(){return s.t("dialog.server.add.button")}})},get children(){return a(Q,{variant:"primary",size:"large",onClick:W,get disabled(){return B()},class:"px-3 py-1.5",get children(){return w(()=>!!B())()?s.t("dialog.server.add.checking"):w(()=>!!f())()?s.t("dialog.server.add.button"):s.t("common.save")}})}})),e}})}export{Ue as DialogSelectServer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Mt}from"./chunk-55IACEB6-CKSwUx1G.js";import{s as Bt}from"./chunk-EDXVE4YY-NnNsBfoC.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,q as Gt,t as Kt,c as it,l as V,z as Ut,y as Zt,B as jt,D as Wt,p as Qt,r as Xt,d as Ht,u as qt}from"./mermaid.core-BYfeCraQ.js";import{c as Jt}from"./channel-CBN6o8Mh.js";import"./index-CPokXzBk.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],T=[1,19],Q=[1,28],M=[1,29],D=[1,20],R=[1,18],S=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,70,71],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],X=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],gt=[65,66,67,68,69],bt=[1,84],kt=[1,83],mt=[1,81],Et=[1,82],Tt=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,92],q=[1,91],J=[1,90],U=[19,58],St=[1,101],Ot=[1,100],ht=[19,58,60,62],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 67:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 79:case 80:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 66:case 69:this.$=t[s];break;case 68:t[s-2].push(t[s]),this.$=t[s-2];break;case 70:this.$=t[s].replace(/"/g,"");break;case 71:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:R,51:S,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:R,51:S,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:nt,66:at,67:ct,68:ot,69:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:T,48:D,50:R,51:S,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:T,48:D,50:R,51:S,52:C},{64:57,70:[1,58],71:[1,59]},e(Y,[2,72]),e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(X,[2,37]),e(X,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{63:35,12:72,17:[1,73],42:A,65:nt,66:at,67:ct,68:ot,69:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:nt,66:at,67:ct,68:ot,69:lt},e(gt,[2,77]),e(gt,[2,78]),{6:bt,10:kt,39:80,42:mt,47:Et},{40:[1,85],41:[1,86]},e(Tt,[2,43],{46:87,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:88,42:mt,47:Et},{14:89,40:H,50:q,72:J},{16:93,40:O,41:N},{11:94,40:T,48:D,50:R,51:S,52:C},{18:95,19:[1,96],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:97,57:98,59:99,61:St,62:Ot}),e([19,58,61,62],[2,66]),e(i,[2,22],{15:[1,103],17:[1,102]}),e([40,48,50,51,52],[2,71]),e(i,[2,36]),{13:P,41:z,45:104,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(X,[2,39]),e(X,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,79]),e(i,[2,80]),e(i,[2,81]),{13:[1,105],42:A},{13:[1,107],15:[1,106]},{19:[1,108]},e(i,[2,15]),e(U,[2,62],{57:109,60:[1,110],62:Ot}),e(U,[2,63]),e(ht,[2,67]),e(U,[2,70]),e(ht,[2,69]),{18:111,19:[1,112],53:53,54:54,58:F},{16:113,40:O,41:N},e(Tt,[2,44],{46:87,13:P,41:z,48:G,49:K}),{14:114,40:H,50:q,72:J},{16:115,40:O,41:N},{14:116,40:H,50:q,72:J},e(i,[2,13]),e(U,[2,64]),{59:117,61:St},{19:[1,118]},e(i,[2,20]),e(i,[2,23],{17:[1,119],42:A}),e(i,[2,11]),{13:[1,120],42:A},e(i,[2,10]),e(ht,[2,68]),e(i,[2,18]),{18:121,19:[1,122],53:53,54:54,58:F},{14:123,40:H,50:q,72:J},{19:[1,124]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`:
|
|
1
|
+
import{g as Mt}from"./chunk-55IACEB6-CU9uIPGP.js";import{s as Bt}from"./chunk-EDXVE4YY-DqmH469b.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,q as Gt,t as Kt,c as it,l as V,z as Ut,y as Zt,B as jt,D as Wt,p as Qt,r as Xt,d as Ht,u as qt}from"./mermaid.core-B1DAMRyG.js";import{c as Jt}from"./channel-CRd61DfB.js";import"./index-CaPWFEmi.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],T=[1,19],Q=[1,28],M=[1,29],D=[1,20],R=[1,18],S=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,70,71],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],X=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],gt=[65,66,67,68,69],bt=[1,84],kt=[1,83],mt=[1,81],Et=[1,82],Tt=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,92],q=[1,91],J=[1,90],U=[19,58],St=[1,101],Ot=[1,100],ht=[19,58,60,62],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 67:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 79:case 80:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 66:case 69:this.$=t[s];break;case 68:t[s-2].push(t[s]),this.$=t[s-2];break;case 70:this.$=t[s].replace(/"/g,"");break;case 71:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:R,51:S,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:R,51:S,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:nt,66:at,67:ct,68:ot,69:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:T,48:D,50:R,51:S,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:T,48:D,50:R,51:S,52:C},{64:57,70:[1,58],71:[1,59]},e(Y,[2,72]),e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(X,[2,37]),e(X,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{63:35,12:72,17:[1,73],42:A,65:nt,66:at,67:ct,68:ot,69:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:nt,66:at,67:ct,68:ot,69:lt},e(gt,[2,77]),e(gt,[2,78]),{6:bt,10:kt,39:80,42:mt,47:Et},{40:[1,85],41:[1,86]},e(Tt,[2,43],{46:87,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:88,42:mt,47:Et},{14:89,40:H,50:q,72:J},{16:93,40:O,41:N},{11:94,40:T,48:D,50:R,51:S,52:C},{18:95,19:[1,96],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:97,57:98,59:99,61:St,62:Ot}),e([19,58,61,62],[2,66]),e(i,[2,22],{15:[1,103],17:[1,102]}),e([40,48,50,51,52],[2,71]),e(i,[2,36]),{13:P,41:z,45:104,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(X,[2,39]),e(X,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,79]),e(i,[2,80]),e(i,[2,81]),{13:[1,105],42:A},{13:[1,107],15:[1,106]},{19:[1,108]},e(i,[2,15]),e(U,[2,62],{57:109,60:[1,110],62:Ot}),e(U,[2,63]),e(ht,[2,67]),e(U,[2,70]),e(ht,[2,69]),{18:111,19:[1,112],53:53,54:54,58:F},{16:113,40:O,41:N},e(Tt,[2,44],{46:87,13:P,41:z,48:G,49:K}),{14:114,40:H,50:q,72:J},{16:115,40:O,41:N},{14:116,40:H,50:q,72:J},e(i,[2,13]),e(U,[2,64]),{59:117,61:St},{19:[1,118]},e(i,[2,20]),e(i,[2,23],{17:[1,119],42:A}),e(i,[2,11]),{13:[1,120],42:A},e(i,[2,10]),e(ht,[2,68]),e(i,[2,18]),{18:121,19:[1,122],53:53,54:54,58:F},{14:123,40:H,50:q,72:J},{19:[1,124]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
3
|
Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==At?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:pt,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),p.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,Nt=_.yyleng,s=_.yytext,tt=_.yylineno,pt=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=p[p.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),ft=this.performAction.apply(w,[s,Nt,tt,x.yy,k[1],p,t].concat(Lt)),typeof ft<"u")return ft;E&&(o=o.slice(0,-1*E*2),p=p.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),p.push(w.$),t.push(w._$),Rt=Z[o[o.length-2]][o[o.length-1]],o.push(Rt);break;case 3:return!0}}return!0},"parse")},vt=(function(){var I={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(n){this.unput(this.match.slice(n))},"less"),pastInput:l(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./index-
|
|
1
|
+
import{a as e}from"./index-CaPWFEmi.js";const i={"ui.sessionReview.title":"Cambios de la sesión","ui.sessionReview.title.lastTurn":"Cambios del último turno","ui.sessionReview.diffStyle.unified":"Unificado","ui.sessionReview.diffStyle.split":"Dividido","ui.sessionReview.openFile":"Abrir archivo","ui.sessionReview.selection.line":"línea {{line}}","ui.sessionReview.selection.lines":"líneas {{start}}-{{end}}","ui.sessionReview.expandAll":"Expandir todo","ui.sessionReview.collapseAll":"Colapsar todo","ui.sessionReview.change.added":"Añadido","ui.sessionReview.change.removed":"Eliminado","ui.sessionReview.change.modified":"Modificado","ui.sessionReview.image.loading":"Cargando...","ui.sessionReview.image.placeholder":"Imagen","ui.sessionReview.largeDiff.title":"Diff demasiado grande para renderizar","ui.sessionReview.largeDiff.meta":"Límite: {{limit}} líneas modificadas. Actual: {{current}} líneas modificadas.","ui.sessionReview.largeDiff.renderAnyway":"Renderizar de todos modos","ui.fileMedia.kind.image":"imagen","ui.fileMedia.state.removed":"Archivo de {{kind}} eliminado","ui.fileMedia.state.loading":"Cargando archivo de {{kind}}","ui.fileMedia.state.error":"Error en el archivo de {{kind}}","ui.fileMedia.state.unavailable":"Archivo de {{kind}} no disponible","ui.fileMedia.binary.title":"Archivo binario","ui.fileMedia.binary.description.path":"No se puede mostrar {{path}} porque es un archivo binario.","ui.fileMedia.binary.description.default":"No se puede mostrar este archivo porque es un archivo binario.","ui.lineComment.label.prefix":"Comentar en ","ui.lineComment.editorLabel.prefix":"Comentando en ","ui.lineComment.placeholder":"Añadir comentario","ui.lineComment.submit":"Comentar","ui.sessionTurn.steps.show":"Mostrar pasos","ui.sessionTurn.steps.hide":"Ocultar pasos","ui.sessionTurn.summary.response":"Respuesta","ui.sessionTurn.diff.showMore":"Mostrar más cambios ({{count}})","ui.sessionTurn.retry.retrying":"reintentando","ui.sessionTurn.retry.inSeconds":"en {{seconds}}s","ui.sessionTurn.retry.attempt":"intento #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - intento #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini está demasiado saturado","ui.sessionTurn.error.freeUsageExceeded":"Límite de uso gratuito excedido","ui.sessionTurn.error.addCredits":"Añadir créditos","ui.sessionTurn.status.delegating":"Delegando trabajo","ui.sessionTurn.status.planning":"Planificando siguientes pasos","ui.sessionTurn.status.gatheringContext":"Explorando","ui.sessionTurn.status.gatheredContext":"Explorado","ui.sessionTurn.status.searchingCodebase":"Buscando en la base de código","ui.sessionTurn.status.searchingWeb":"Buscando en la web","ui.sessionTurn.status.makingEdits":"Realizando ediciones","ui.sessionTurn.status.runningCommands":"Ejecutando comandos","ui.sessionTurn.status.thinking":"Pensando","ui.sessionTurn.status.thinkingWithTopic":"Pensando - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Recopilando pensamientos","ui.sessionTurn.status.consideringNextSteps":"Considerando siguientes pasos","ui.messagePart.questions.dismissed":"Preguntas descartadas","ui.messagePart.compaction":"Sesión compactada","ui.messagePart.context.read.one":"{{count}} lectura","ui.messagePart.context.read.other":"{{count}} lecturas","ui.messagePart.context.search.one":"{{count}} búsqueda","ui.messagePart.context.search.other":"{{count}} búsquedas","ui.messagePart.context.list.one":"{{count}} lista","ui.messagePart.context.list.other":"{{count}} listas","ui.messagePart.title.edit":"Editar","ui.messagePart.title.write":"Escribir","ui.messagePart.option.typeOwnAnswer":"Escribe tu propia respuesta","ui.messagePart.review.title":"Revisa tus respuestas","ui.list.loading":"Cargando","ui.list.empty":"Sin resultados","ui.list.clearFilter":"Borrar filtro","ui.list.emptyWithFilter.prefix":"Sin resultados para","ui.messageNav.newMessage":"Nuevo mensaje","ui.textField.copyToClipboard":"Copiar al portapapeles","ui.textField.copyLink":"Copiar enlace","ui.textField.copied":"Copiado","ui.imagePreview.alt":"Vista previa de imagen","ui.scrollView.ariaLabel":"contenido desplazable","ui.tool.read":"Leer","ui.tool.loaded":"Cargado","ui.tool.list":"Listar","ui.tool.websearch":"Búsqueda web","ui.tool.codesearch":"Búsqueda de código","ui.tool.patch":"Parche","ui.tool.todos":"Tareas","ui.tool.todos.read":"Leer tareas","ui.tool.questions":"Preguntas","ui.tool.agent":"Agente {{type}}","ui.tool.agent.default":"Agente","ui.common.file.one":"archivo","ui.common.file.other":"archivos","ui.common.question.one":"pregunta","ui.common.question.other":"preguntas","ui.common.add":"Añadir","ui.common.back":"Atrás","ui.common.cancel":"Cancelar","ui.common.confirm":"Confirmar","ui.common.dismiss":"Descartar","ui.common.close":"Cerrar","ui.common.next":"Siguiente","ui.common.submit":"Enviar","ui.permission.deny":"Denegar","ui.permission.allowAlways":"Permitir siempre","ui.permission.allowOnce":"Permitir una vez","ui.message.expand":"Expandir mensaje","ui.message.collapse":"Colapsar mensaje","ui.message.copy":"Copiar","ui.message.copyMessage":"Copiar mensaje","ui.message.forkMessage":"Bifurcar a nueva sesión","ui.message.revertMessage":"Restablecer a este punto","ui.message.copyResponse":"Copiar respuesta","ui.message.copied":"¡Copiado!","ui.message.interrupted":"Interrumpido","ui.message.queued":"En cola","ui.message.attachment.alt":"adjunto","ui.patch.action.deleted":"Eliminado","ui.patch.action.created":"Creado","ui.patch.action.moved":"Movido","ui.patch.action.patched":"Parcheado","ui.question.subtitle.answered":"{{count}} respondidas","ui.question.answer.none":"(sin respuesta)","ui.question.review.notAnswered":"(no respondida)","ui.question.multiHint":"Selecciona todas las que correspondan","ui.question.singleHint":"Selecciona una respuesta","ui.question.custom.placeholder":"Escribe tu respuesta...","ui.fileSearch.placeholder":"Buscar","ui.fileSearch.previousMatch":"Anterior","ui.fileSearch.nextMatch":"Siguiente","ui.fileSearch.close":"Cerrar búsqueda","ui.tool.task":"Tarea","ui.tool.skill":"Habilidad","ui.basicTool.called":"Llamado `{{tool}}`","ui.toolErrorCard.failed":"Falló","ui.toolErrorCard.copyError":"Copiar error"},a={...e,...i};export{a as dict};
|