@intent-hq/web 2.341.4 → 2.341.5

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.
Files changed (142) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{CsgGOYLg.js → 0UOJtLsJ.js} +1 -1
  3. package/web/app/immutable/chunks/{Cj-mnOKC.js → 38yQCBhn.js} +1 -1
  4. package/web/app/immutable/chunks/{RLDKXce3.js → 3NMJ-T4c.js} +1 -1
  5. package/web/app/immutable/chunks/{S-y_pRxX.js → 6th0qMpZ.js} +3 -3
  6. package/web/app/immutable/chunks/{CjFks5qN.js → B2QGhazy.js} +1 -1
  7. package/web/app/immutable/chunks/{sxefbKie.js → B3geCnPE.js} +1 -1
  8. package/web/app/immutable/chunks/{BXjVUZ2B.js → B7BP9VFr.js} +1 -1
  9. package/web/app/immutable/chunks/{hpoN7Rk0.js → B8qRDFAR.js} +2 -2
  10. package/web/app/immutable/chunks/{D9bKP3Hx.js → B906VD80.js} +1 -1
  11. package/web/app/immutable/chunks/{JvJIKXgZ.js → B9Ac9NPe.js} +3 -3
  12. package/web/app/immutable/chunks/{yfYdt-hl.js → BAcJE2jC.js} +1 -1
  13. package/web/app/immutable/chunks/{B1aiVw0D.js → BBBsO-ja.js} +1 -1
  14. package/web/app/immutable/chunks/{BpvizIhe.js → BDXAZs6G.js} +1 -1
  15. package/web/app/immutable/chunks/{DpJ5Wccc.js → BE5i3xJG.js} +1 -1
  16. package/web/app/immutable/chunks/{CHD1Bdm7.js → BHXDiVJa.js} +1 -1
  17. package/web/app/immutable/chunks/{6X5anZSR.js → BKJ8oZUz.js} +1 -1
  18. package/web/app/immutable/chunks/{BnXZPw_-.js → BOWJTwZ4.js} +1 -1
  19. package/web/app/immutable/chunks/{JmJV-qA7.js → BOoKSQro.js} +1 -1
  20. package/web/app/immutable/chunks/{BSmS0SHR.js → BVxXVDbS.js} +1 -1
  21. package/web/app/immutable/chunks/{BFTlNJv7.js → BXNjGjOh.js} +4 -4
  22. package/web/app/immutable/chunks/{CkjDXBNK.js → BXrfRFiJ.js} +1 -1
  23. package/web/app/immutable/chunks/{yEA-_XFs.js → BYY6Mdow.js} +1 -1
  24. package/web/app/immutable/chunks/{DbrJb8q7.js → BZrlo0qu.js} +1 -1
  25. package/web/app/immutable/chunks/{D71nrcX6.js → Bai_JUYY.js} +1 -1
  26. package/web/app/immutable/chunks/{BpdOSZ3K.js → BajCfmEt.js} +1 -1
  27. package/web/app/immutable/chunks/{BrvGK9gp.js → BcIMKw7J.js} +1 -1
  28. package/web/app/immutable/chunks/{CVVvQr4v.js → BojWpKVo.js} +1 -1
  29. package/web/app/immutable/chunks/{C6bGz2wI.js → BpdV3TcH.js} +1 -1
  30. package/web/app/immutable/chunks/{DbQ0TH44.js → BrRMJbsZ.js} +4 -4
  31. package/web/app/immutable/chunks/{B7Q4hJJ8.js → Bwtjyrwh.js} +1 -1
  32. package/web/app/immutable/chunks/{6sAa0Op8.js → Bx0YpB0R.js} +4 -4
  33. package/web/app/immutable/chunks/{CmWFbIXS.js → C1kFXPBe.js} +1 -1
  34. package/web/app/immutable/chunks/{DciyEdyK.js → C2Iay8YK.js} +1 -1
  35. package/web/app/immutable/chunks/{DNeS4bH4.js → C3Dh-hMQ.js} +2 -2
  36. package/web/app/immutable/chunks/{DGYTxb3X.js → C4ORLCQU.js} +12 -12
  37. package/web/app/immutable/chunks/{tc7ktccF.js → C6C4Ld-7.js} +1 -1
  38. package/web/app/immutable/chunks/{D0NH0wJe.js → C7JGNpWi.js} +1 -1
  39. package/web/app/immutable/chunks/{BKAobQX_.js → C917cXWW.js} +2 -2
  40. package/web/app/immutable/chunks/{2rzjJeJ2.js → C9Z2RfJv.js} +1 -1
  41. package/web/app/immutable/chunks/{BKTf-Gsl.js → C9oLhYTD.js} +1 -1
  42. package/web/app/immutable/chunks/{xf7slqST.js → CBBf0qeC.js} +1 -1
  43. package/web/app/immutable/chunks/{Sk5RmV-P.js → CFE66sz9.js} +1 -1
  44. package/web/app/immutable/chunks/{DaNy32PK.js → CFyuWvv0.js} +1 -1
  45. package/web/app/immutable/chunks/{C-mvxH3E.js → CKgx2tR4.js} +1 -1
  46. package/web/app/immutable/chunks/{B3OpKY8A.js → CLd7g0F2.js} +1 -1
  47. package/web/app/immutable/chunks/{B25g1SEU.js → CPX8zhew.js} +1 -1
  48. package/web/app/immutable/chunks/{B48zVP7m.js → CPpc87Js.js} +1 -1
  49. package/web/app/immutable/chunks/{DR517ZLh.js → CQ7bMJPD.js} +1 -1
  50. package/web/app/immutable/chunks/{BZaP4TlW.js → CRYpe2Bk.js} +1 -1
  51. package/web/app/immutable/chunks/{BgE6o4ts.js → CSDWItbp.js} +1 -1
  52. package/web/app/immutable/chunks/{DDAmTTDv.js → CUihDKz3.js} +1 -1
  53. package/web/app/immutable/chunks/{B1JfbHKW.js → Cd5Uexh3.js} +1 -1
  54. package/web/app/immutable/chunks/{9Q1iR9sq.js → Cdwev8lm.js} +2 -2
  55. package/web/app/immutable/chunks/{o2F0F4IJ.js → CfSDjT8L.js} +1 -1
  56. package/web/app/immutable/chunks/{CvmQNR5A.js → CgxCV15A.js} +1 -1
  57. package/web/app/immutable/chunks/{CJ-QJuBK.js → CkS58pW_.js} +1 -1
  58. package/web/app/immutable/chunks/{IrFjVNUS.js → CkdOZCgG.js} +1 -1
  59. package/web/app/immutable/chunks/{iQQWMpAQ.js → Cpx-8sHO.js} +1 -1
  60. package/web/app/immutable/chunks/{SP14gC8P.js → Cs4Cv-Kb.js} +1 -1
  61. package/web/app/immutable/chunks/{CWIpVcE8.js → CuSbsrVb.js} +1 -1
  62. package/web/app/immutable/chunks/{CfkA_MJ6.js → Cwk-rY7x.js} +1 -1
  63. package/web/app/immutable/chunks/{CuIUKxl_.js → D3jZwA_u.js} +3 -3
  64. package/web/app/immutable/chunks/{nGCgKKFL.js → D50V7yeE.js} +1 -1
  65. package/web/app/immutable/chunks/{fejC11c0.js → D7zDNSty.js} +1 -1
  66. package/web/app/immutable/chunks/{BPlA_F0H.js → D8peLl3x.js} +1 -1
  67. package/web/app/immutable/chunks/{eNDBh2Xw.js → D9dOmSnu.js} +1 -1
  68. package/web/app/immutable/chunks/{CbMd5I0J.js → DCsbuai7.js} +1 -1
  69. package/web/app/immutable/chunks/{C80hd_K2.js → DCy7s0NX.js} +1 -1
  70. package/web/app/immutable/chunks/{CBTFFv-q.js → DGE_vLuJ.js} +1 -1
  71. package/web/app/immutable/chunks/{DllksLOW.js → DGr_Wmve.js} +2 -2
  72. package/web/app/immutable/chunks/{B9vKot9Y.js → DHRIyqtz.js} +1 -1
  73. package/web/app/immutable/chunks/{C6h_aLcl.js → DHsszpMd.js} +1 -1
  74. package/web/app/immutable/chunks/{Do2s1-ZW.js → DJ5GBwyi.js} +1 -1
  75. package/web/app/immutable/chunks/{BYvg_ZGg.js → DK2PFAHR.js} +1 -1
  76. package/web/app/immutable/chunks/{jBI7gIvH.js → DLMNYx6T.js} +1 -1
  77. package/web/app/immutable/chunks/{CNqHpwXg.js → DM1MDQku.js} +1 -1
  78. package/web/app/immutable/chunks/{DS-AVMuy.js → DNYfmhPC.js} +1 -1
  79. package/web/app/immutable/chunks/{9CKhw0O4.js → DO9dFDRF.js} +1 -1
  80. package/web/app/immutable/chunks/{CT19p5Qn.js → DP_vpfd2.js} +1 -1
  81. package/web/app/immutable/chunks/{Cr6-fUqV.js → DQZ4ftz8.js} +1 -1
  82. package/web/app/immutable/chunks/{BFGq-_ll.js → DTA8xgKe.js} +1 -1
  83. package/web/app/immutable/chunks/{B4JblUQ_.js → DVVLy6Dq.js} +2 -2
  84. package/web/app/immutable/chunks/{BYblxwo5.js → DYLprb_-.js} +1 -1
  85. package/web/app/immutable/chunks/{CIh5DTsk.js → DZuQd9yv.js} +1 -1
  86. package/web/app/immutable/chunks/{BYfly9_3.js → DaDvzxpY.js} +1 -1
  87. package/web/app/immutable/chunks/{X51JKYQ1.js → DaIZQusv.js} +1 -1
  88. package/web/app/immutable/chunks/{DxHob-bh.js → DdAYpf2o.js} +6 -6
  89. package/web/app/immutable/chunks/{DDpwkz_y.js → DdjtNwmd.js} +1 -1
  90. package/web/app/immutable/chunks/{C76ZPk79.js → Dis9xqAU.js} +1 -1
  91. package/web/app/immutable/chunks/{Rx3qJQkm.js → DkDBy5ZH.js} +1 -1
  92. package/web/app/immutable/chunks/{C-WCUKNv.js → DnMg5b8C.js} +1 -1
  93. package/web/app/immutable/chunks/{03H0Rain.js → DnmbPoCD.js} +1 -1
  94. package/web/app/immutable/chunks/{D8jne4Jc.js → DveqomV7.js} +1 -1
  95. package/web/app/immutable/chunks/{hiKOhYfu.js → Dx-u2TKd.js} +1 -1
  96. package/web/app/immutable/chunks/{Dhc0zLXE.js → DzBxCXlV.js} +1 -1
  97. package/web/app/immutable/chunks/{bgYBbNkU.js → DzRizlBW.js} +1 -1
  98. package/web/app/immutable/chunks/{JumZ6iI0.js → DzSFqVqX.js} +1 -1
  99. package/web/app/immutable/chunks/{Bh6tU9zC.js → EYUXPzKo.js} +1 -1
  100. package/web/app/immutable/chunks/{DgZippXc.js → Fum1kLAq.js} +1 -1
  101. package/web/app/immutable/chunks/{Qgve2nLc.js → GT8JMIrk.js} +1 -1
  102. package/web/app/immutable/chunks/{CxlOdKlx.js → Iz-nyA_f.js} +3 -3
  103. package/web/app/immutable/chunks/{Ch2CU2jj.js → LnFw2qwD.js} +2 -2
  104. package/web/app/immutable/chunks/{Ba2fyjC_.js → LuxF3iU-.js} +1 -1
  105. package/web/app/immutable/chunks/{CNdZoHmu.js → M8OiKFKl.js} +1 -1
  106. package/web/app/immutable/chunks/{Dz0jv9u2.js → MmCSbZhF.js} +1 -1
  107. package/web/app/immutable/chunks/{Cr4ui72l.js → N_iN6cUB.js} +2 -2
  108. package/web/app/immutable/chunks/{CPVhDNvb.js → OF70dTAx.js} +1 -1
  109. package/web/app/immutable/chunks/{_ZyJx2QH.js → R2c9wxBz.js} +1 -1
  110. package/web/app/immutable/chunks/{D7Xt1SkT.js → WYk3QPoC.js} +1 -1
  111. package/web/app/immutable/chunks/{63wzgq2y.js → Wnu7Dt4p.js} +1 -1
  112. package/web/app/immutable/chunks/{Bg4ZIRgI.js → _0vlacSq.js} +1 -1
  113. package/web/app/immutable/chunks/{8oeIoGAG.js → bCH1ao3Y.js} +3 -3
  114. package/web/app/immutable/chunks/{osdRNRcE.js → eT_u3fHa.js} +1 -1
  115. package/web/app/immutable/chunks/{D37vxI2K.js → jctv_QLg.js} +1 -1
  116. package/web/app/immutable/chunks/{BD3qDOqH.js → ltYowWup.js} +1 -1
  117. package/web/app/immutable/chunks/{Cvh8IgDm.js → mr7ekWyC.js} +4 -4
  118. package/web/app/immutable/chunks/{C2Jv33-s.js → oh9nhT2f.js} +1 -1
  119. package/web/app/immutable/chunks/{CVjCdQzl.js → qGuNU8qU.js} +1 -1
  120. package/web/app/immutable/chunks/{PjzNbVbY.js → qK1XU_sn.js} +1 -1
  121. package/web/app/immutable/chunks/{CnItH7Qd.js → uINNqKxE.js} +1 -1
  122. package/web/app/immutable/chunks/{D6pin7kj.js → vBH-DCjX.js} +1 -1
  123. package/web/app/immutable/chunks/{BUnKtOZ7.js → xOX4I0DA.js} +1 -1
  124. package/web/app/immutable/chunks/{BSw3ndv2.js → zMhCX0I3.js} +1 -1
  125. package/web/app/immutable/entry/{app.YWMiN_f6.js → app.BL9lS81x.js} +2 -2
  126. package/web/app/immutable/entry/start.u5SVWDzz.js +1 -0
  127. package/web/app/immutable/nodes/{0.DX1WooqV.js → 0.Dpnsdx_u.js} +1 -1
  128. package/web/app/immutable/nodes/{1.DDJBAwnQ.js → 1.CGm108o4.js} +1 -1
  129. package/web/app/immutable/nodes/{10.DOWDpKqR.js → 10.Dm5VV5Im.js} +1 -1
  130. package/web/app/immutable/nodes/{14.Bl2G62xL.js → 14.5BwzEnwA.js} +1 -1
  131. package/web/app/immutable/nodes/{17.Dk70Srbz.js → 17.CcG_1EGZ.js} +2 -2
  132. package/web/app/immutable/nodes/{2.CCtsAAdD.js → 2.BVtlTotI.js} +4 -4
  133. package/web/app/immutable/nodes/{3.q5Utpq42.js → 3.COQ56KGv.js} +1 -1
  134. package/web/app/immutable/nodes/{4.C4vEG10b.js → 4.CECnTV9o.js} +1 -1
  135. package/web/app/immutable/nodes/{5.Bwi1S2uy.js → 5.Bizeki-Y.js} +1 -1
  136. package/web/app/immutable/nodes/{6.Cbzw4k4E.js → 6.DCIerevL.js} +1 -1
  137. package/web/app/immutable/nodes/{7.ChPE7n_q.js → 7.BMy1PMTt.js} +1 -1
  138. package/web/app/immutable/nodes/{8.Dh22eEQw.js → 8.BbOOmsUD.js} +4 -4
  139. package/web/app/immutable/nodes/{9.CXLjTth1.js → 9.Dm-sC3eN.js} +4 -4
  140. package/web/app/version.json +1 -1
  141. package/web/index.html +9 -9
  142. package/web/app/immutable/entry/start.D0ehuxeh.js +0 -1
@@ -1,2 +1,2 @@
1
- import{t as Mt,br as ae,_ as Vr,a_ as re,bz as jt,bv as be,bt as Zt,b as zt,bp as d}from"./O1QHAURn.js";import{bs as Ut,ca as ke,aD as e,bH as u,a5 as R,bA as P,W as s,bn as Et,bV as O,c9 as i,aA as oe,c6 as Ot,ay as ue,be as Ge,b$ as et,b_ as C,bO as g,bS as p,bl as S,aB as k,bj as Ar,aw as tt,ai as Nr,c5 as pr,a as gr,a7 as ze,aj as vt,cd as Wr,br as Br}from"./DYhIMPy1.js";import{G as mr,H as Or}from"./CovkQMd0.js";import{u as rt,w as yt,v as or,n as Pt}from"./CAyg2ijY.js";import{c as St}from"./C2mPABxH.js";import{b as _r}from"./BaIAhI85.js";import{Ix as A,nx as hr,vz as wr,vy as br,KL as Hr,KM as qr,eu as Kr,ev as Jr,Kb as ir,lJ as Ht,BE as nr,s2 as sr,nV as Xr,zf as Yr,a5 as lr,J1 as Gr,Jj as Zr,n8 as Qr,iF as ea,nz as ta,v0 as ra,zC as aa,Ka as oa}from"./DNqM68dO.js";import{g as ia}from"./DfN8_dcw.js";import{a as na,g as sa,i as la,c as da,h as ca,d as ua,e as dr,f as fa,b as qt}from"./jSWfcAmB.js";import{bA as va,bN as pa,dr as ga}from"./VZEkDWIM.js";import{w as cr,d as ma}from"./DW9tlmqQ.js";import{f as _a}from"./BVs4aETe.js";import{k as Kt}from"./B6kyqBFl.js";import{f as Fe,ax as ha}from"./CR_t_AVn.js";import"./BBDxUL80.js";import{F as Qe,a8 as wa,aq as ba,aV as xa,a$ as Tt,co as ya,cp as Pa,bi as $a,cN as ka,c4 as Ia}from"./B0f-om7y.js";import{d as Ca,f as Fa,t as ur}from"./DV9nY0bt.js";import{c as Sa}from"./ChTqQfQN.js";import"./B1mZq3ve.js";import{$ as Da}from"./DGYTxb3X.js";import{i as Jt,b as Ta,a as Ra}from"./H2jLkRRS.js";import{C as Yt,p as Ma}from"./BJrt2eqM.js";import{M as ja}from"./Cvh8IgDm.js";import{t as Xt,u as xr}from"./BkT9o_nd.js";import"./CerLhVOI.js";import"./BgCTNfXj.js";import{M as Dt}from"./C64Iv2ib.js";import{V as za}from"./CyQ_uOB0.js";import{bR as Ua,b5 as Ea}from"./D6pin7kj.js";import{ap as La}from"./DbQ0TH44.js";const yr=A.createSelector((Y,x)=>hr(Y.pdfPreview.previews,x));var Va=k('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),Aa=k('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function Gt(Y,x){if(new.target)return Mt({component:Gt,...Y});Ut(x,!0);const Ie=()=>be(xe,"$preview",at),[at,ie]=Zt();let $=ae(x,"workspaceId",7),ne=ae(x,"filePath",7),Ce=ae(x,"gitRootId",7);const Se=crypto.randomUUID(),xe=yr(Se),_e=new WeakMap;let Q=O(null),qe=O(void 0),N=O(1),B=O(1),se=O(!0),U=O(!1),Ee=O(null),Ne=O(0);const ye=i(()=>Ie()?.error??e(Ee)),De=i(()=>e(ye)==="missing"?d.file_pdf_missing_error():e(ye)==="large"?d.file_pdf_large_error():e(ye)==="invalid"?d.file_pdf_invalid_error():e(ye)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());ke(()=>{const l=$(),y=ne();e(Ne);const E=crypto.randomUUID();return A.dispatch(wr(Se,E,l,y,...Ce()?[{gitRootId:Ce()}]:[])),()=>{A.dispatch(br(Se,E))}}),ke(()=>{const l=Ie()?.url;let y=!1,E;if(u(Q,null),u(Ee,null),u(se,!0),u(N,1),u(B,1),!!l)return(async()=>{try{const{loadPdfDocument:J}=await Vr(async()=>{const{loadPdfDocument:he}=await import("./cb1JHFKl.js");return{loadPdfDocument:he}},[],import.meta.url);if(y)return;E=J(l);const le=await E.promise;y||u(Q,le)}catch(J){if(y)return;u(Ee,J instanceof Error&&J.name==="PasswordException"?"password":J instanceof Error&&J.name==="InvalidPDFException"?"invalid":"load",!0)}finally{y||u(se,!1)}})(),()=>{y=!0,E?.destroy()}}),ke(()=>{const l=e(Q),y=e(qe),E=e(N),J=e(B);if(!l||!y)return;let le=!1,he,j;const de=()=>{if(!j)return;const X=(_e.get(j)??1)-1;X?_e.set(j,X):(_e.delete(j),j.cleanup()),j=void 0};return u(U,!0),(async()=>{try{if(j=await l.getPage(E),_e.set(j,(_e.get(j)??0)+1),le){de();return}const X=j.getViewport({scale:J}),ee=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(X.width*X.height)));y.width=Math.ceil(X.width*ee),y.height=Math.ceil(X.height*ee),y.style.width=`${X.width}px`,y.style.height=`${X.height}px`,he=j.render({canvas:y,viewport:X,transform:[ee,0,0,ee,0,0]}),await he.promise}catch{le||u(Ee,"invalid")}finally{le||u(U,!1)}})(),()=>{le=!0,he?.cancel(),he?he.promise.then(de,de):de()}});var We={get workspaceId(){return $()},set workspaceId(l){$(l),oe()},get filePath(){return ne()},set filePath(l){ne(l),oe()},get gitRootId(){return Ce()},set gitRootId(l){Ce(l),oe()},$set:jt,$on:(l,y)=>zt(x,l,y)},o=Aa(),c=R(o);{var M=l=>{{const y=J=>{Ge();var le=et();C(()=>g(le,e(De))),s(J,le)};let E=i(()=>d.ui_combobox_retry_label());Ca(l,{onRetry:()=>Ot(Ne),get retryLabel(){return e(E)},class:"m-auto",message:y,$$slots:{message:!0}})}},m=l=>{{let y=i(()=>d.file_pdf_loading_label());Fa(l,{get label(){return e(y)},count:1,class:"p-4"})}},w=l=>{var y=Va(),E=ue(y),J=R(E);{let ge=i(()=>e(N)<=1);Fe(J,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(N,-1),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.file_pdf_previous_label()]),s(Pe,$e)},$$slots:{default:!0}})}var le=p(J,2),he=S(le,!0),j=p(le,2);{let ge=i(()=>e(N)>=e(Q).numPages);Fe(j,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(N),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.file_pdf_next_label()]),s(Pe,$e)},$$slots:{default:!0}})}var de=p(j,2);{let ge=i(()=>e(B)<=.25);Fe(de,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.max(.25,e(B)-.25),!0),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}var X=p(de,2),ee=S(X,!0),ot=p(X,2);{let ge=i(()=>e(B)>=3);Fe(ot,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.min(3,e(B)+.25),!0),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}P(E);var it=p(E,2),Ke=R(it);let Ze;_r(Ke,ge=>u(qe,ge),()=>e(qe)),P(it),C((ge,Pe,Je)=>{g(he,ge),g(ee,Pe),rt(it,"aria-busy",e(U)),rt(Ke,"aria-label",Je),Ze=yt(Ke,"",Ze,{visibility:e(U)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:Xt(e(N)),total:Xt(e(Q).numPages)}),()=>xr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:ne(),page:Xt(e(N))})]),s(l,y)};re(c,l=>{e(ye)?l(M):e(se)||Ie()?.status==="loading"?l(m,1):e(Q)&&l(w,2)})}P(o),s(Y,o);var Le=Et(We);return ie(),Le}const Na=A.createSelector((Y,x)=>hr(Y.videoPreview.previews,x));var Wa=k('<p role="status"> </p>'),Ba=k('<p role="alert"> </p>'),Oa=k('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),Ha=k('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),qa=k('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Pr(Y,x){if(new.target)return Mt({component:Pr,...Y});Ut(x,!0);const Ie=()=>be(qe,"$preview",at),[at,ie]=Zt();let $=ae(x,"sourceUrl",7),ne=ae(x,"fileName",7),Ce=ae(x,"allowDownload",7),Se=ae(x,"downloading",7),xe=ae(x,"onDownload",7),_e=O(null);const Q=crypto.randomUUID(),qe=Na(Q),N=i(()=>Ie()?.status==="loading"),B=i(()=>e(_e)??Ie()?.error);let se=!1,U=!1;Ar(()=>{U=!0,A.dispatch(Hr(Q))});function Ee(){if(U||e(N))return;const m=$().startsWith("workspace-file://")?new URL($()):null;if(se||!m||!m.pathname.toLowerCase().endsWith(".mp4")){u(_e,"unsupported");return}se=!0,m.searchParams.set("preview","h264"),A.dispatch(qr(Q,m.hostname,m.toString()))}function Ne(m){if(U)return;const w=m.currentTarget.error?.code;w===2?u(_e,"network"):w!==1&&Ee()}var ye={get sourceUrl(){return $()},set sourceUrl(m){$(m),oe()},get fileName(){return ne()},set fileName(m){ne(m),oe()},get allowDownload(){return Ce()},set allowDownload(m){Ce(m),oe()},get downloading(){return Se()},set downloading(m){Se(m),oe()},get onDownload(){return xe()},set onDownload(m){xe(m),oe()},$set:jt,$on:(m,w)=>zt(x,m,w)},De=qa(),We=R(De);{var o=m=>{var w=Oa(),Le=R(w),l=S(Le,!0),y=p(Le,2);{var E=j=>{var de=Wa(),X=S(de,!0);C(ee=>g(X,ee),[()=>d.editor_fileViewer_videoPreparing_label()]),s(j,de)},J=j=>{var de=Ba(),X=S(de,!0);C(ee=>g(X,ee),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(j,de)};re(y,j=>{e(N)?j(E):j(J,-1)})}var le=p(y,2);{var he=j=>{Fe(j,{variant:"secondary",size:"sm",get onclick(){return xe()},get disabled(){return Se()},children:(de,X)=>{Ge();var ee=et();C(ot=>g(ee,ot),[()=>d.layout_fileTab_downloadFile_label()]),s(de,ee)},$$slots:{default:!0}})};re(le,j=>{Ce()&&j(he)})}P(w),C(()=>g(l,ne())),s(m,w)},c=m=>{var w=Ha(),Le=S(w,!0);C(l=>{rt(w,"src",Ie()?.url??$()),g(Le,l)},[()=>d.editor_fileViewer_videoUnsupported_label()]),tt("error",w,Ne),tt("loadedmetadata",w,l=>{l.currentTarget.videoWidth===0&&Ee()}),s(m,w)};re(We,m=>{e(B)||e(N)?m(o):m(c,-1)})}P(De),s(Y,De);var M=Et(ye);return ie(),M}var Ka=k('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Ja=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Xa=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Ya=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),Ga=k("<!> ",1),Za=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),Qa=k('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),eo=k('<td class="border border-border px-2 py-1 text-xs"> </td>'),to=k("<tr></tr>"),ro=k('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),ao=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),oo=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),io=k('<div class="h-full flex flex-col"><!></div>');function Rt(Y,x){if(new.target)return Mt({component:Rt,...Y});Ut(x,!0);const Ie=t=>{var a=Ka(),f=ue(a);{let D=i(()=>d.editor_fileViewer_zoomOut_tooltip());Fe(f,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:de,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return ya},size:"sm"})},$$slots:{default:!0}})}var _=p(f,2),h=S(_,!0),z=p(_,2);{let D=i(()=>d.editor_fileViewer_zoomIn_tooltip());Fe(z,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:j,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return Pa},size:"sm"})},$$slots:{default:!0}})}Ge(2),C(()=>g(h,e(Ee))),s(t,a)},at=Sa("FileViewer");let ie=ae(x,"filePath",7),$=ae(x,"fileContent",7,""),ne=ae(x,"sourceUrl",7),Ce=ae(x,"language",7),Se=ae(x,"isBinary",7),xe=ae(x,"allowDownload",7,!0),_e=ae(x,"onDownload",7),Q=ae(x,"downloading",7,!1);const qe=t=>{const a=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(a)?"image":a==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(a)?"video":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":a==="pdf"?"pdf":["md","markdown"].includes(a)?"markdown":a==="json"?"json":a==="csv"?"csv":["yaml","yml"].includes(a)?"yaml":a==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(a)?"archive":["exe","dll","so","dylib","wasm"].includes(a)?"binary":"text"},N=i(()=>qe(ie())),B=i(()=>ie().split("/").pop()||d.editor_fileViewer_unknown_fallback());let se=O(100),U=O(0);const Ee=i(()=>xr(e(se)/100,{style:"percent",maximumFractionDigits:0}));let Ne=O(!1),ye=O(0),De=O(0),We=O(0),o=O(0),c=O(!1),M=null;function m(){const t=M;M=null,u(c,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function w(t){if(t.button!==0||!t.isPrimary||M)return;const a=t.currentTarget;a.setPointerCapture(t.pointerId),M={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:a},u(c,!0),t.preventDefault()}function Le(t){if(!(!M||t.pointerId!==M.pointerId)){if((t.buttons&1)===0){m();return}u(We,M.viewport.scrollLeft,!0),u(o,M.viewport.scrollTop,!0),u(ye,e(ye)+(t.clientX-M.x)),u(De,e(De)+(t.clientY-M.y)),M.x=t.clientX,M.y=t.clientY}}function l(t){t.pointerId===M?.pointerId&&m()}ke(()=>{ie(),ne(),e(se),e(U),u(We,0),u(o,0)}),ke(()=>(ie(),ne(),pr(()=>{m(),u(ye,0),u(De,0)}),m));const y=t=>{const a=t.split(".").pop()?.toLowerCase();return a==="jpg"||a==="jpeg"?"image/jpeg":a==="png"?"image/png":a==="gif"?"image/gif":a==="webp"?"image/webp":"application/octet-stream"},E=t=>{const a=t.split(".").pop()?.toLowerCase();if(a==="mp4")return"video/mp4";if(a==="webm")return"video/webm"},J=()=>{if(ne())return ne();if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():Se()?`data:${y(ie())};base64,${$()}`:`data:${y(ie())};base64,${$()}`;if($()instanceof ArrayBuffer){const a=new Uint8Array($()).reduce((_,h)=>_+String.fromCharCode(h),""),f=btoa(a);return`data:${y(ie())};base64,${f}`}return""},le=()=>{if(ne())return ne();const t=E(ie());if(!t)return"";if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():`data:${t};base64,${$()}`;const a=new Uint8Array($()),f=[],_=32768;for(let h=0;h<a.length;h+=_)f.push(String.fromCharCode(...a.subarray(h,h+_)));return`data:${t};base64,${btoa(f.join(""))}`},he=()=>{const t=typeof $()=="string"?new TextEncoder().encode($()):new Uint8Array($()),a=[],f=32768;for(let _=0;_<t.length;_+=f)a.push(String.fromCharCode(...t.subarray(_,_+f)));return`data:image/svg+xml;base64,${btoa(a.join(""))}`},j=()=>{u(se,Math.min(e(se)+25,500),!0)},de=()=>{u(se,Math.max(e(se)-25,25),!0)},X=()=>{u(U,(e(U)+90)%360)},ee=()=>{if(!xe()||Q())return;if(_e()){_e()();return}const t=document.createElement("a");t.href=e(N)==="video"?le():e(N)==="svg"?he():J(),t.download=e(B),t.click()},ot=async()=>{try{const t=J(),a=new Image;a.crossOrigin="anonymous";const f=await new Promise((_,h)=>{a.onload=()=>{const z=document.createElement("canvas");z.width=a.naturalWidth,z.height=a.naturalHeight;const D=z.getContext("2d");if(!D){h(new Error("Failed to get canvas context"));return}D.drawImage(a,0,0),z.toBlob(T=>{T?_(T):h(new Error("Failed to create blob from canvas"))},"image/png",1)},a.onerror=()=>h(new Error("Failed to load image")),a.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),u(Ne,!0),setTimeout(()=>u(Ne,!1),2e3)}catch(t){at.error("Failed to copy image:",t)}},it=t=>{try{const a=JSON.parse(t);return JSON.stringify(a,null,2)}catch{return t}},Ke=t=>t.split(`
1
+ import{t as Mt,br as ae,_ as Vr,a_ as re,bz as jt,bv as be,bt as Zt,b as zt,bp as d}from"./O1QHAURn.js";import{bs as Ut,ca as ke,aD as e,bH as u,a5 as R,bA as P,W as s,bn as Et,bV as O,c9 as i,aA as oe,c6 as Ot,ay as ue,be as Ge,b$ as et,b_ as C,bO as g,bS as p,bl as S,aB as k,bj as Ar,aw as tt,ai as Nr,c5 as pr,a as gr,a7 as ze,aj as vt,cd as Wr,br as Br}from"./DYhIMPy1.js";import{G as mr,H as Or}from"./CovkQMd0.js";import{u as rt,w as yt,v as or,n as Pt}from"./CAyg2ijY.js";import{c as St}from"./C2mPABxH.js";import{b as _r}from"./BaIAhI85.js";import{Ix as A,nx as hr,vz as wr,vy as br,KL as Hr,KM as qr,eu as Kr,ev as Jr,Kb as ir,lJ as Ht,BE as nr,s2 as sr,nV as Xr,zf as Yr,a5 as lr,J1 as Gr,Jj as Zr,n8 as Qr,iF as ea,nz as ta,v0 as ra,zC as aa,Ka as oa}from"./DNqM68dO.js";import{g as ia}from"./DfN8_dcw.js";import{a as na,g as sa,i as la,c as da,h as ca,d as ua,e as dr,f as fa,b as qt}from"./jSWfcAmB.js";import{bA as va,bN as pa,dr as ga}from"./VZEkDWIM.js";import{w as cr,d as ma}from"./DW9tlmqQ.js";import{f as _a}from"./BVs4aETe.js";import{k as Kt}from"./B6kyqBFl.js";import{f as Fe,ax as ha}from"./CR_t_AVn.js";import"./BBDxUL80.js";import{F as Qe,a8 as wa,aq as ba,aV as xa,a$ as Tt,co as ya,cp as Pa,bi as $a,cN as ka,c4 as Ia}from"./B0f-om7y.js";import{d as Ca,f as Fa,t as ur}from"./DV9nY0bt.js";import{c as Sa}from"./ChTqQfQN.js";import"./B1mZq3ve.js";import{$ as Da}from"./C4ORLCQU.js";import{i as Jt,b as Ta,a as Ra}from"./H2jLkRRS.js";import{C as Yt,p as Ma}from"./BJrt2eqM.js";import{M as ja}from"./mr7ekWyC.js";import{t as Xt,u as xr}from"./BkT9o_nd.js";import"./CerLhVOI.js";import"./BgCTNfXj.js";import{M as Dt}from"./C64Iv2ib.js";import{V as za}from"./CyQ_uOB0.js";import{bR as Ua,b5 as Ea}from"./vBH-DCjX.js";import{ap as La}from"./BrRMJbsZ.js";const yr=A.createSelector((Y,x)=>hr(Y.pdfPreview.previews,x));var Va=k('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),Aa=k('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function Gt(Y,x){if(new.target)return Mt({component:Gt,...Y});Ut(x,!0);const Ie=()=>be(xe,"$preview",at),[at,ie]=Zt();let $=ae(x,"workspaceId",7),ne=ae(x,"filePath",7),Ce=ae(x,"gitRootId",7);const Se=crypto.randomUUID(),xe=yr(Se),_e=new WeakMap;let Q=O(null),qe=O(void 0),N=O(1),B=O(1),se=O(!0),U=O(!1),Ee=O(null),Ne=O(0);const ye=i(()=>Ie()?.error??e(Ee)),De=i(()=>e(ye)==="missing"?d.file_pdf_missing_error():e(ye)==="large"?d.file_pdf_large_error():e(ye)==="invalid"?d.file_pdf_invalid_error():e(ye)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());ke(()=>{const l=$(),y=ne();e(Ne);const E=crypto.randomUUID();return A.dispatch(wr(Se,E,l,y,...Ce()?[{gitRootId:Ce()}]:[])),()=>{A.dispatch(br(Se,E))}}),ke(()=>{const l=Ie()?.url;let y=!1,E;if(u(Q,null),u(Ee,null),u(se,!0),u(N,1),u(B,1),!!l)return(async()=>{try{const{loadPdfDocument:J}=await Vr(async()=>{const{loadPdfDocument:he}=await import("./cb1JHFKl.js");return{loadPdfDocument:he}},[],import.meta.url);if(y)return;E=J(l);const le=await E.promise;y||u(Q,le)}catch(J){if(y)return;u(Ee,J instanceof Error&&J.name==="PasswordException"?"password":J instanceof Error&&J.name==="InvalidPDFException"?"invalid":"load",!0)}finally{y||u(se,!1)}})(),()=>{y=!0,E?.destroy()}}),ke(()=>{const l=e(Q),y=e(qe),E=e(N),J=e(B);if(!l||!y)return;let le=!1,he,j;const de=()=>{if(!j)return;const X=(_e.get(j)??1)-1;X?_e.set(j,X):(_e.delete(j),j.cleanup()),j=void 0};return u(U,!0),(async()=>{try{if(j=await l.getPage(E),_e.set(j,(_e.get(j)??0)+1),le){de();return}const X=j.getViewport({scale:J}),ee=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(X.width*X.height)));y.width=Math.ceil(X.width*ee),y.height=Math.ceil(X.height*ee),y.style.width=`${X.width}px`,y.style.height=`${X.height}px`,he=j.render({canvas:y,viewport:X,transform:[ee,0,0,ee,0,0]}),await he.promise}catch{le||u(Ee,"invalid")}finally{le||u(U,!1)}})(),()=>{le=!0,he?.cancel(),he?he.promise.then(de,de):de()}});var We={get workspaceId(){return $()},set workspaceId(l){$(l),oe()},get filePath(){return ne()},set filePath(l){ne(l),oe()},get gitRootId(){return Ce()},set gitRootId(l){Ce(l),oe()},$set:jt,$on:(l,y)=>zt(x,l,y)},o=Aa(),c=R(o);{var M=l=>{{const y=J=>{Ge();var le=et();C(()=>g(le,e(De))),s(J,le)};let E=i(()=>d.ui_combobox_retry_label());Ca(l,{onRetry:()=>Ot(Ne),get retryLabel(){return e(E)},class:"m-auto",message:y,$$slots:{message:!0}})}},m=l=>{{let y=i(()=>d.file_pdf_loading_label());Fa(l,{get label(){return e(y)},count:1,class:"p-4"})}},w=l=>{var y=Va(),E=ue(y),J=R(E);{let ge=i(()=>e(N)<=1);Fe(J,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(N,-1),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.file_pdf_previous_label()]),s(Pe,$e)},$$slots:{default:!0}})}var le=p(J,2),he=S(le,!0),j=p(le,2);{let ge=i(()=>e(N)>=e(Q).numPages);Fe(j,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(N),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.file_pdf_next_label()]),s(Pe,$e)},$$slots:{default:!0}})}var de=p(j,2);{let ge=i(()=>e(B)<=.25);Fe(de,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.max(.25,e(B)-.25),!0),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}var X=p(de,2),ee=S(X,!0),ot=p(X,2);{let ge=i(()=>e(B)>=3);Fe(ot,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.min(3,e(B)+.25),!0),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}P(E);var it=p(E,2),Ke=R(it);let Ze;_r(Ke,ge=>u(qe,ge),()=>e(qe)),P(it),C((ge,Pe,Je)=>{g(he,ge),g(ee,Pe),rt(it,"aria-busy",e(U)),rt(Ke,"aria-label",Je),Ze=yt(Ke,"",Ze,{visibility:e(U)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:Xt(e(N)),total:Xt(e(Q).numPages)}),()=>xr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:ne(),page:Xt(e(N))})]),s(l,y)};re(c,l=>{e(ye)?l(M):e(se)||Ie()?.status==="loading"?l(m,1):e(Q)&&l(w,2)})}P(o),s(Y,o);var Le=Et(We);return ie(),Le}const Na=A.createSelector((Y,x)=>hr(Y.videoPreview.previews,x));var Wa=k('<p role="status"> </p>'),Ba=k('<p role="alert"> </p>'),Oa=k('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),Ha=k('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),qa=k('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Pr(Y,x){if(new.target)return Mt({component:Pr,...Y});Ut(x,!0);const Ie=()=>be(qe,"$preview",at),[at,ie]=Zt();let $=ae(x,"sourceUrl",7),ne=ae(x,"fileName",7),Ce=ae(x,"allowDownload",7),Se=ae(x,"downloading",7),xe=ae(x,"onDownload",7),_e=O(null);const Q=crypto.randomUUID(),qe=Na(Q),N=i(()=>Ie()?.status==="loading"),B=i(()=>e(_e)??Ie()?.error);let se=!1,U=!1;Ar(()=>{U=!0,A.dispatch(Hr(Q))});function Ee(){if(U||e(N))return;const m=$().startsWith("workspace-file://")?new URL($()):null;if(se||!m||!m.pathname.toLowerCase().endsWith(".mp4")){u(_e,"unsupported");return}se=!0,m.searchParams.set("preview","h264"),A.dispatch(qr(Q,m.hostname,m.toString()))}function Ne(m){if(U)return;const w=m.currentTarget.error?.code;w===2?u(_e,"network"):w!==1&&Ee()}var ye={get sourceUrl(){return $()},set sourceUrl(m){$(m),oe()},get fileName(){return ne()},set fileName(m){ne(m),oe()},get allowDownload(){return Ce()},set allowDownload(m){Ce(m),oe()},get downloading(){return Se()},set downloading(m){Se(m),oe()},get onDownload(){return xe()},set onDownload(m){xe(m),oe()},$set:jt,$on:(m,w)=>zt(x,m,w)},De=qa(),We=R(De);{var o=m=>{var w=Oa(),Le=R(w),l=S(Le,!0),y=p(Le,2);{var E=j=>{var de=Wa(),X=S(de,!0);C(ee=>g(X,ee),[()=>d.editor_fileViewer_videoPreparing_label()]),s(j,de)},J=j=>{var de=Ba(),X=S(de,!0);C(ee=>g(X,ee),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(j,de)};re(y,j=>{e(N)?j(E):j(J,-1)})}var le=p(y,2);{var he=j=>{Fe(j,{variant:"secondary",size:"sm",get onclick(){return xe()},get disabled(){return Se()},children:(de,X)=>{Ge();var ee=et();C(ot=>g(ee,ot),[()=>d.layout_fileTab_downloadFile_label()]),s(de,ee)},$$slots:{default:!0}})};re(le,j=>{Ce()&&j(he)})}P(w),C(()=>g(l,ne())),s(m,w)},c=m=>{var w=Ha(),Le=S(w,!0);C(l=>{rt(w,"src",Ie()?.url??$()),g(Le,l)},[()=>d.editor_fileViewer_videoUnsupported_label()]),tt("error",w,Ne),tt("loadedmetadata",w,l=>{l.currentTarget.videoWidth===0&&Ee()}),s(m,w)};re(We,m=>{e(B)||e(N)?m(o):m(c,-1)})}P(De),s(Y,De);var M=Et(ye);return ie(),M}var Ka=k('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Ja=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Xa=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Ya=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),Ga=k("<!> ",1),Za=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),Qa=k('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),eo=k('<td class="border border-border px-2 py-1 text-xs"> </td>'),to=k("<tr></tr>"),ro=k('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),ao=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),oo=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),io=k('<div class="h-full flex flex-col"><!></div>');function Rt(Y,x){if(new.target)return Mt({component:Rt,...Y});Ut(x,!0);const Ie=t=>{var a=Ka(),f=ue(a);{let D=i(()=>d.editor_fileViewer_zoomOut_tooltip());Fe(f,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:de,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return ya},size:"sm"})},$$slots:{default:!0}})}var _=p(f,2),h=S(_,!0),z=p(_,2);{let D=i(()=>d.editor_fileViewer_zoomIn_tooltip());Fe(z,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:j,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return Pa},size:"sm"})},$$slots:{default:!0}})}Ge(2),C(()=>g(h,e(Ee))),s(t,a)},at=Sa("FileViewer");let ie=ae(x,"filePath",7),$=ae(x,"fileContent",7,""),ne=ae(x,"sourceUrl",7),Ce=ae(x,"language",7),Se=ae(x,"isBinary",7),xe=ae(x,"allowDownload",7,!0),_e=ae(x,"onDownload",7),Q=ae(x,"downloading",7,!1);const qe=t=>{const a=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(a)?"image":a==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(a)?"video":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":a==="pdf"?"pdf":["md","markdown"].includes(a)?"markdown":a==="json"?"json":a==="csv"?"csv":["yaml","yml"].includes(a)?"yaml":a==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(a)?"archive":["exe","dll","so","dylib","wasm"].includes(a)?"binary":"text"},N=i(()=>qe(ie())),B=i(()=>ie().split("/").pop()||d.editor_fileViewer_unknown_fallback());let se=O(100),U=O(0);const Ee=i(()=>xr(e(se)/100,{style:"percent",maximumFractionDigits:0}));let Ne=O(!1),ye=O(0),De=O(0),We=O(0),o=O(0),c=O(!1),M=null;function m(){const t=M;M=null,u(c,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function w(t){if(t.button!==0||!t.isPrimary||M)return;const a=t.currentTarget;a.setPointerCapture(t.pointerId),M={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:a},u(c,!0),t.preventDefault()}function Le(t){if(!(!M||t.pointerId!==M.pointerId)){if((t.buttons&1)===0){m();return}u(We,M.viewport.scrollLeft,!0),u(o,M.viewport.scrollTop,!0),u(ye,e(ye)+(t.clientX-M.x)),u(De,e(De)+(t.clientY-M.y)),M.x=t.clientX,M.y=t.clientY}}function l(t){t.pointerId===M?.pointerId&&m()}ke(()=>{ie(),ne(),e(se),e(U),u(We,0),u(o,0)}),ke(()=>(ie(),ne(),pr(()=>{m(),u(ye,0),u(De,0)}),m));const y=t=>{const a=t.split(".").pop()?.toLowerCase();return a==="jpg"||a==="jpeg"?"image/jpeg":a==="png"?"image/png":a==="gif"?"image/gif":a==="webp"?"image/webp":"application/octet-stream"},E=t=>{const a=t.split(".").pop()?.toLowerCase();if(a==="mp4")return"video/mp4";if(a==="webm")return"video/webm"},J=()=>{if(ne())return ne();if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():Se()?`data:${y(ie())};base64,${$()}`:`data:${y(ie())};base64,${$()}`;if($()instanceof ArrayBuffer){const a=new Uint8Array($()).reduce((_,h)=>_+String.fromCharCode(h),""),f=btoa(a);return`data:${y(ie())};base64,${f}`}return""},le=()=>{if(ne())return ne();const t=E(ie());if(!t)return"";if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():`data:${t};base64,${$()}`;const a=new Uint8Array($()),f=[],_=32768;for(let h=0;h<a.length;h+=_)f.push(String.fromCharCode(...a.subarray(h,h+_)));return`data:${t};base64,${btoa(f.join(""))}`},he=()=>{const t=typeof $()=="string"?new TextEncoder().encode($()):new Uint8Array($()),a=[],f=32768;for(let _=0;_<t.length;_+=f)a.push(String.fromCharCode(...t.subarray(_,_+f)));return`data:image/svg+xml;base64,${btoa(a.join(""))}`},j=()=>{u(se,Math.min(e(se)+25,500),!0)},de=()=>{u(se,Math.max(e(se)-25,25),!0)},X=()=>{u(U,(e(U)+90)%360)},ee=()=>{if(!xe()||Q())return;if(_e()){_e()();return}const t=document.createElement("a");t.href=e(N)==="video"?le():e(N)==="svg"?he():J(),t.download=e(B),t.click()},ot=async()=>{try{const t=J(),a=new Image;a.crossOrigin="anonymous";const f=await new Promise((_,h)=>{a.onload=()=>{const z=document.createElement("canvas");z.width=a.naturalWidth,z.height=a.naturalHeight;const D=z.getContext("2d");if(!D){h(new Error("Failed to get canvas context"));return}D.drawImage(a,0,0),z.toBlob(T=>{T?_(T):h(new Error("Failed to create blob from canvas"))},"image/png",1)},a.onerror=()=>h(new Error("Failed to load image")),a.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),u(Ne,!0),setTimeout(()=>u(Ne,!1),2e3)}catch(t){at.error("Failed to copy image:",t)}},it=t=>{try{const a=JSON.parse(t);return JSON.stringify(a,null,2)}catch{return t}},Ke=t=>t.split(`
2
2
  `).map(f=>f.split(",").map(_=>_.trim()));var Ze={get filePath(){return ie()},set filePath(t){ie(t),oe()},get fileContent(){return $()},set fileContent(t=""){$(t),oe()},get sourceUrl(){return ne()},set sourceUrl(t){ne(t),oe()},get language(){return Ce()},set language(t){Ce(t),oe()},get isBinary(){return Se()},set isBinary(t){Se(t),oe()},get allowDownload(){return xe()},set allowDownload(t=!0){xe(t),oe()},get onDownload(){return _e()},set onDownload(t){_e(t),oe()},get downloading(){return Q()},set downloading(t=!1){Q(t),oe()},$set:jt,$on:(t,a)=>zt(x,t,a)},ge=io();tt("blur",gr,m);var Pe=R(ge);{var Je=t=>{var a=Ja(),f=R(a),_=R(f);Ie(_);var h=p(_,2);{let te=i(()=>d.editor_fileViewer_rotate_tooltip());Fe(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:X,get title(){return e(te)},children:(we,Te)=>{Qe(we,{get icon(){return wa},size:"sm"})},$$slots:{default:!0}})}var z=p(h,4);{let te=i(()=>d.editor_fileViewer_copyImage_tooltip());Fe(z,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ot,get title(){return e(te)},children:(we,Te)=>{var Ue=ze(),Be=ue(Ue);{var Vt=Xe=>{Qe(Xe,{get icon(){return ba},size:"sm",class:"text-green-500"})},pt=Xe=>{Qe(Xe,{get icon(){return xa},size:"sm"})};re(Be,Xe=>{e(Ne)?Xe(Vt):Xe(pt,-1)})}s(we,Ue)},$$slots:{default:!0}})}var D=p(z,2);{let te=i(()=>!xe()||Q()),we=i(()=>d.editor_fileViewer_download_tooltip());Fe(D,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ee,get disabled(){return e(te)},get title(){return e(we)},children:(Te,Ue)=>{Qe(Te,{get icon(){return Tt},size:"sm"})},$$slots:{default:!0}})}var T=p(D,2),H=S(T,!0);P(f);var L=p(f,2),G=S(L);P(a),C(te=>{g(H,e(B)),or(L,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(c)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),yt(L,`--pan-scroll-x: ${e(We)??""}px; --pan-scroll-y: ${e(o)??""}px;`),rt(G,"src",te),rt(G,"alt",e(B)),yt(G,`translate: ${e(ye)??""}px ${e(De)??""}px; transform: scale(${e(se)/100}) rotate(${e(U)??""}deg); transition: transform 0.2s;`)},[()=>J()]),vt("pointerdown",L,w),vt("pointermove",L,Le),vt("pointerup",L,l),tt("pointercancel",L,l),tt("lostpointercapture",L,l),s(t,a)},$e=t=>{var a=Xa(),f=R(a),_=R(f);Ie(_);var h=p(_,2);{let L=i(()=>!xe()||Q()),G=i(()=>d.editor_fileViewer_download_tooltip());Fe(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ee,get disabled(){return e(L)},get title(){return e(G)},children:(te,we)=>{Qe(te,{get icon(){return Tt},size:"sm"})},$$slots:{default:!0}})}var z=p(h,2),D=S(z,!0);P(f);var T=p(f,2),H=S(T);P(a),C(L=>{g(D,e(B)),or(T,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(c)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),yt(T,`--pan-scroll-x: ${e(We)??""}px; --pan-scroll-y: ${e(o)??""}px;`),rt(H,"src",L),rt(H,"alt",e(B)),yt(H,`translate: ${e(ye)??""}px ${e(De)??""}px; transform: scale(${e(se)/100});`)},[()=>he()]),vt("pointerdown",T,w),vt("pointermove",T,Le),vt("pointerup",T,l),tt("pointercancel",T,l),tt("lostpointercapture",T,l),s(t,a)},fe=t=>{const a=i(le);var f=ze(),_=ue(f);mr(_,()=>ie()+e(a),h=>{Pr(h,{get sourceUrl(){return e(a)},get fileName(){return e(B)},get allowDownload(){return xe()},get downloading(){return Q()},onDownload:ee})}),s(t,f)},nt=t=>{var a=Ya(),f=p(R(a),2),_=S(f,!0),h=p(f,2),z=R(h),D=p(z);P(h),P(a),C((T,H)=>{g(_,e(B)),rt(z,"src",T),g(D,` ${H??""}`)},[()=>J(),()=>d.editor_fileViewer_audioUnsupported_label()]),s(t,a)},$t=t=>{var a=Za(),f=p(R(a),2),_=S(f,!0),h=p(f,2);{let z=i(()=>!xe()||Q());Fe(h,{size:"sm",variant:"secondary",onclick:ee,get disabled(){return e(z)},children:(D,T)=>{var H=Ga(),L=ue(H);Qe(L,{get icon(){return Tt},size:"sm",class:"mr-2"});var G=p(L);C(te=>g(G,` ${te??""}`),[()=>d.editor_fileViewer_downloadPdf_label()]),s(D,H)},$$slots:{default:!0}})}P(a),C(z=>g(_,z),[()=>d.editor_fileViewer_pdfUnavailable_label()]),s(t,a)},ct=t=>{{let a=i(()=>it($().toString()));Yt(t,{get value(){return e(a)},language:"json",get fileName(){return ie()},lineNumbers:!0,readOnly:!0})}},ut=t=>{const a=i(()=>Ke($().toString()));var f=ro(),_=R(f),h=R(_),z=R(h);Pt(z,23,()=>e(a)[0]||[],(T,H)=>`header-${H}-${T}`,(T,H)=>{var L=Qa(),G=S(L,!0);C(()=>g(G,e(H))),s(T,L)}),P(z),P(h);var D=p(h);Pt(D,23,()=>e(a).slice(1),(T,H)=>`row-${H}`,(T,H,L)=>{var G=to();Pt(G,23,()=>e(H),(te,we)=>`cell-${e(L)}-${we}`,(te,we)=>{var Te=eo(),Ue=S(Te,!0);C(()=>g(Ue,e(we))),s(te,Te)}),P(G),s(T,G)}),P(D),P(_),P(f),s(t,f)},kt=t=>{var a=ao(),f=p(R(a),2),_=S(f,!0),h=p(f,2),z=S(h,!0);P(a),C(D=>{g(_,e(B)),g(z,D)},[()=>d.editor_fileViewer_archive_label()]),s(t,a)},Lt=t=>{var a=oo(),f=p(R(a),2),_=S(f,!0),h=p(f,2),z=S(h,!0);P(a),C(D=>{g(_,e(B)),g(z,D)},[()=>d.editor_fileViewer_binary_label()]),s(t,a)},It=t=>{{let a=i(()=>$().toString());Yt(t,{get value(){return e(a)},get language(){return Ce()},get fileName(){return ie()},lineNumbers:!0,highlightActiveLine:!0})}};re(Pe,t=>{e(N)==="image"?t(Je):e(N)==="svg"?t($e,1):e(N)==="video"?t(fe,2):e(N)==="audio"?t(nt,3):e(N)==="pdf"?t($t,4):e(N)==="json"?t(ct,5):e(N)==="csv"?t(ut,6):e(N)==="archive"?t(kt,7):e(N)==="binary"?t(Lt,8):t(It,-1)})}return P(ge),s(Y,ge),Et(Ze)}Nr(["pointerdown","pointermove","pointerup"]);const no=/access denied|permission denied|outside (?:the )?workspace/i,so=/file not found|no such file or directory/i;function lo(Y){return no.test(Y)?"access-denied":Y===d.files_read_notFound_error()||so.test(Y)?"not-found":"generic"}function co(Y){switch(Y){case"access-denied":return d.layout_fileTab_errorAccessDenied_label();case"not-found":return d.layout_fileTab_errorNotFound_label();case"generic":return d.layout_fileTab_errorGeneric_label()}}var uo=k("<!> <!>",1),fo=k("<!> <!> <!>",1),vo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),fr=k('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),po=k('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),vr=k('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),go=k('<div class="flex items-center gap-3"><!> <!></div>'),mo=k('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),_o=k('<p class="text-xs"> </p>'),ho=k("<li><!></li>"),wo=k('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),bo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger" role="alert"> </p> <p class="text-xs font-mono"> </p> <!> <!></div>'),xo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-3 p-4"><p> </p> <p class="text-xs break-all"> </p> <!></div>'),yo=k('<div class="h-full overflow-auto p-4"><!></div>');function Po(Y,x){if(new.target)return Mt({component:Po,...Y});Ut(x,!0);const Ie=()=>be($e,"$workspace",U),at=()=>be(J,"$fileContentStore",U),ie=()=>be(le,"$fileLoadingStore",U),$=()=>be(he,"$fileSavingStore",U),ne=()=>be(j,"$fileErrorStore",U),Ce=()=>be(de,"$fileNotFoundCandidatesStore",U),Se=()=>be(X,"$isFileBinaryStore",U),xe=()=>be(ee,"$isFileDirtyStore",U),_e=()=>be(ot,"$fileLastUpdatedStore",U),Q=()=>be(it,"$ftChanges$",U),qe=()=>be(Je,"$gutterRead$",U),N=()=>be(De,"$lineWrapping",U),B=()=>be(We,"$diffIndicators",U),se=()=>be(ge,"$rootMediaPreview",U),[U,Ee]=Zt(),Ne=r=>{var n=uo(),I=ue(n);{var F=pe=>{var Ve=ze(),Oe=ue(Ve);St(Oe,()=>Dt,(ft,_t)=>{_t(ft,{get icon(){return $a},get label(){return e(_)},disabled:!0})}),s(pe,Ve)};re(I,pe=>{!e(te)&&!e(l)&&!e(t)&&pe(F)})}var ve=p(I,2);{var Re=pe=>{{let Ve=i(()=>!e(Ct)||!e(L)),Oe=i(()=>!e(l)&&(!e(Ct)||!e(L)));za(pe,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(Ct)},get previewEnabled(){return e(L)},onTogglePreview:()=>u(L,!e(L)),get showWrap(){return e(Ve)},get wrapEnabled(){return N()},onToggleWrap:()=>A.dispatch(Zr()),get showDiff(){return e(Oe)},get diffEnabled(){return B()},onToggleDiff:()=>A.dispatch(Gr())})}};re(ve,pe=>{o().filePath&&!e(te)&&!e(t)&&pe(Re)})}s(r,n)},ye=r=>{var n=ze(),I=ue(n);{var F=ve=>{var Re=fo(),pe=ue(Re);{var Ve=Ae=>{var Ye=ze(),lt=ue(Ye);{let ht=i(()=>d.layout_fileTab_goToChanges_tooltip());St(lt,()=>Dt,(wt,bt)=>{bt(wt,{get icon(){return Ia},get label(){return e(ht)},onclick:Tr})})}s(Ae,Ye)};re(pe,Ae=>{e(kr)&&Ae(Ve)})}var Oe=p(pe,2);{var ft=Ae=>{var Ye=ze(),lt=ue(Ye);{let ht=i(()=>d.layout_fileTab_downloadFile_label()),wt=i(()=>!e(gt)||e(st));St(lt,()=>Dt,(bt,Nt)=>{Nt(bt,{get icon(){return Tt},get label(){return e(ht)},onclick:Ft,get disabled(){return e(wt)}})})}s(Ae,Ye)};re(Oe,Ae=>{e(Be)&&Ae(ft)})}var _t=p(Oe,2);{let Ae=i(()=>d.layout_fileTab_deleteFile_tooltip());St(_t,()=>Dt,(Ye,lt)=>{lt(Ye,{get icon(){return ka},get label(){return e(Ae)},onclick:Rr,destructive:!0})})}s(ve,Re)};re(I,ve=>{o().filePath&&!e(te)&&!e(l)&&ve(F)})}s(r,n)},De=Ua(),We=Ea();let o=ae(x,"tab",7),c=ae(x,"workspaceId",7),M=ae(x,"isActive",7),m=ae(x,"isPanelFocused",7);ke(()=>{const r=c();if(!(!M()||!r||e(w)))return A.dispatch(Kr(r,"files")),()=>A.dispatch(Jr(r,"files"))});const w=i(()=>typeof o().data?.gitRootId=="string"?o().data.gitRootId:void 0),Le=i(()=>typeof o().data?.gitRootPath=="string"?o().data.gitRootPath:void 0),l=i(()=>!!e(w)),y=i(()=>o().filePath?_a(o().filePath,e(w)):o().filePath),E=Wr(e(y));ke(()=>{E.set(e(y))});const J=na(c(),E),le=sa(c(),E),he=la(c(),E),j=da(c(),E),de=ca(c(),E),X=ua(c(),E),ee=dr(c(),E),ot=fa(c(),E),it=va(c()),Ke=ia(),Ze=crypto.randomUUID(),ge=yr(Ze),Pe=`file-gutter:${crypto.randomUUID()}`,Je=pa(c(),Pe),$e=ga(c()),fe=i(()=>Ie()?.worktreePath||Ie()?.repositoryPath||Ie()?.path||null),nt=i(at),$t=i(ie),ct=i($),ut=i(ne),kt=i(()=>e(ut)?lo(e(ut)):"generic"),Lt=5,It=i(()=>(Ce()??[]).slice(0,Lt)),t=i(Se),a=i(xe),f=i(_e),_=i(()=>e(ct)?d.ui_saveIndicator_saving_tooltip():e(a)?d.ui_saveIndicator_autoSaving_tooltip():d.ui_saveIndicator_saved_tooltip());let h=O(null),z=O(Br([])),D=O(null),T=O(void 0),H=O(void 0),L=O(!0);ke(()=>{const r=o().data?.line,n=o().data?.jumpTimestamp;!r||n!==void 0&&n===e(H)||(u(H,n,!0),u(T,{line:r},!0),u(L,!1))});const G=i(()=>e(w)?cr(o().filePath,e(Le)):null),te=i(()=>e(w)?!e(G):!!(o().filePath&&(Ta(o().filePath)||e(fe)&&Ra(o().filePath,e(fe))))),we=i(()=>o().filePath&&e(fe)?Jt(o().filePath)?o().filePath:`${e(fe)}/${o().filePath}`:null),Te=i(()=>!!o().filePath&&/\.pdf$/i.test(o().filePath)),Ue=i(()=>!!o().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(o().filePath)),Be=i(()=>c()&&/^[A-Za-z0-9._-]+$/.test(c())?cr(o().filePath,e(fe)):null),Vt=i(()=>!e(w)&&e(Be)?e(Be).split("/").slice(0,-1).join("/"):void 0),pt=i(()=>e(Te)||e(Ue)?e(Be):null),Xe=i(()=>e(w)&&e(Ue)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[o().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);ke(()=>{if(!M()||!e(w)||!e(G)||!e(Xe))return;const r=crypto.randomUUID();return A.dispatch(wr(Ze,r,c(),e(G),{gitRootId:e(w),mimeType:e(Xe)})),()=>A.dispatch(br(Ze,r))});let st=O(!1);const gt=i(()=>!!e(Be)&&!e($t)&&(!e(Ue)||e(D)===e(Be))),Qt=i(()=>e(D)&&c()?`workspace-file://${c()}/${e(D).split("/").map(encodeURIComponent).join("/")}`:null),At=i(()=>o().filePath?ta(o().filePath):"plaintext"),Ct=i(()=>e(At)==="markdown");ke(()=>{if(!M()||e(Te)||e(w))return;const r=e(pt),n=o().filePath,I=c(),F=o().id;if(u(D,null),!r||!n||!I)return;let ve=!1;const Re=()=>!ve&&c()===I&&o().id===F&&o().filePath===n;return(async()=>{let pe=!1;try{pe=(await ha("file.stat",{workspaceId:I,path:r}))?.isFile===!0}catch{}if(!Re())return;if(pe){u(D,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){u(D,r,!0);return}const{candidates:Ve,truncated:Oe}=await Da(I,r);if(Re()){if(!Oe&&Ve.length===1){A.dispatch(ir(I,n,Ve[0],F));return}u(D,r,!0)}})(),()=>{ve=!0}});function $r(r,n){return!!(r.file===n||r.relativePath===n||r.relativePath&&n.endsWith("/"+r.relativePath)||r.file&&n.endsWith("/"+r.file)||r.relativePath&&r.relativePath.endsWith("/"+n)||r.file&&r.file.endsWith("/"+n))}const mt=i(()=>e(l)||!o().filePath?null:Q().find(r=>$r(r,o().filePath))??null),kr=i(()=>!!e(mt));ke(()=>{if(e(l))return;const r=c(),n=o().filePath,I=e(fe);return()=>{if(!r||!n)return;const F=qt.select(A.state,r,n);if(F?.kind!=="editable-text")return;const ve=Ht(F.localContent),Re=dr.select(A.state,r,n),pe=Jt(n)?n:I?`${I}/${n}`:null;Re&&pe&&A.dispatch(nr(r,n,pe,ve))}}),ke(()=>{const r=o().filePath,n=e(we),I=c();if(!M())return;const F=!e(w)&&!!r&&Jt(r)&&!e(fe);r&&I&&!e(te)&&!e(Ue)&&!e(Te)&&!F&&(e(w)&&e(G)&&e(y)?A.dispatch(sr(I,e(y),n??r,{gitRoot:{id:e(w),relativePath:e(G)}})):A.dispatch(sr(I,r,n??r)))});function Ir(){return e(nt)??""}function Cr(r){e(l)||e(t)||!o().filePath||!c()||!e(we)||A.dispatch(oa(c(),o().filePath,Ht(r)))}function Fr(){if(e(l)||e(t)||!o().filePath||!e(we)||e(nt)===null||e(ct))return;const r=qt.select(A.state,c(),o().filePath);r?.kind==="editable-text"&&A.dispatch(nr(c(),o().filePath,e(we),Ht(r.localContent)))}function Sr(r){const n=o().filePath;!n||!c()||(A.dispatch(aa(c(),n)),A.dispatch(ir(c(),n,r,o().id)))}ke(()=>{const r=o().filePath,n=e(mt);if(!r||!n){u(z,[],!0);return}if(!M())return;const I=c(),F=crypto.randomUUID();return A.dispatch(Xr(I,Pe,F,{kind:"diffs",path:r,staged:n.stage==="staged"})),()=>{A.dispatch(Yr(I,Pe,F))}}),ke(()=>{const r=qe(),n=r?.result?.kind==="diffs"?r.result.chunks:[],I=n.find(F=>F.file===o().filePath)??n[0];u(z,I?Ma(I.chunks.map(F=>({oldStart:F.oldStart,oldLines:F.oldLines,newStart:F.newStart,newLines:F.newLines,lines:F.lines.map(ve=>(ve.type===lr.Addition?"+":ve.type===lr.Deletion?"-":" ")+ve.content)}))):[],!0)});function Dr(r){const n=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),I=Re=>Or(r,La(Re),n);if(I("editor.save")){r.preventDefault(),e(a)&&!e(ct)&&Fr();return}const F=I("editor.undo")?"undo":I("editor.redo")?"redo":I("editor.toggle-task-list")?"toggle-task-list":I("editor.copy")?"copy":I("editor.select-all")?"select-all":null;if(!F||e(l)&&F!=="copy"&&F!=="select-all")return;F!=="toggle-task-list"&&e(h)?.runShortcut(F)&&r.preventDefault()}function Tr(r){if(!o().filePath||!e(mt))return;const n=r?.metaKey||r?.ctrlKey||!1,F=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;A.dispatch(ra(c(),e(mt),{filePath:o().filePath,changeId:e(mt).id,openInAdjacentPanel:n,sourcePanelId:F}))}async function Ft(){const r=e(Be);if(!(e(l)||!r||!c()||!e(gt)||e(st))){u(st,!0);try{const n=await ma(c(),r,e(fe));!n?.success&&!n?.canceled&&Kt.error(n?.error?.message||d.layout_fileTab_downloadFailed_error())}catch{Kt.error(d.layout_fileTab_downloadFailed_error())}finally{u(st,!1)}}}function Rr(){const r=e(we);if(e(l)||!o().filePath||!c()||!r)return;const n=Qr(qt.select(A.state,c(),o().filePath));if(!n){Kt.error(d.ui_reversibleActions_failed_error({message:d.fileExplorer_tree_undoUnavailable_error()}));return}A.dispatch(ea(c(),o().filePath,{absolutePath:r,tabId:o().id,snapshot:n}))}ke(()=>{if(!Ke||!M())return;const r={isDirty:!e(l)&&e(a),isSaving:!e(l)&&e(ct)};pr(()=>{Ke.registerActions({display:Ne,actions:ye}),Ke.registerState(r)})});var Mr={get tab(){return o()},set tab(r){o(r),oe()},get workspaceId(){return c()},set workspaceId(r){c(r),oe()},get isActive(){return M()},set isActive(r){M(r),oe()},get isPanelFocused(){return m()},set isPanelFocused(r){m(r),oe()},$set:jt,$on:(r,n)=>zt(x,r,n)},er=ze();tt("keydown",gr,r=>M()&&Dr(r));var jr=ue(er);{var zr=r=>{var n=ze(),I=ue(n);mr(I,()=>o().filePath,F=>{var ve=ze(),Re=ue(ve);{var pe=b=>{var v=vo(),V=R(v),q=S(V,!0),W=p(V,2),Me=S(W,!0);P(v),C(Z=>{g(q,Z),g(Me,o().filePath)},[()=>d.layout_fileTab_outsideWorkspace_label()]),s(b,v)},Ve=b=>{var v=ze(),V=ue(v);{var q=W=>{Gt(W,{get workspaceId(){return c()},get filePath(){return e(G)},get gitRootId(){return e(w)}})};re(V,W=>{M()&&W(q)})}s(b,v)},Oe=b=>{var v=ze(),V=ue(v);{var q=Z=>{var K=fr(),ce=R(K),je=S(ce,!0);P(K),C(me=>g(je,me),[()=>d.layout_fileTab_errorLoading_label()]),s(Z,K)},W=Z=>{Rt(Z,{get filePath(){return o().filePath},get sourceUrl(){return se().url},allowDownload:!1})},Me=Z=>{var K=po(),ce=R(K),je=S(ce,!0);P(K),C(me=>g(je,me),[()=>d.layout_fileTab_preparing_label()]),s(Z,K)};re(V,Z=>{se()?.error?Z(q):se()?.url?Z(W,1):Z(Me,-1)})}s(b,v)},ft=b=>{var v=ze(),V=ue(v);{var q=W=>{Gt(W,{get workspaceId(){return c()},get filePath(){return e(pt)}})};re(V,W=>{M()&&W(q)})}s(b,v)},_t=b=>{var v=fr(),V=R(v),q=S(V,!0);P(v),C(W=>g(q,W),[()=>d.file_pdf_load_error()]),s(b,v)},Ae=b=>{{let v=i(()=>e(D)??o().filePath),V=i(()=>!e(l)&&e(gt));Rt(b,{get filePath(){return e(v)},get sourceUrl(){return e(Qt)},onDownload:Ft,get allowDownload(){return e(V)},get downloading(){return e(st)}})}},Ye=b=>{var v=vr(),V=R(v),q=S(V,!0);P(v),C(W=>g(q,W),[()=>d.layout_fileTab_preparing_label()]),s(b,v)},lt=b=>{var v=mo(),V=R(v);Pt(V,20,()=>[...Array(20).keys()],q=>q,(q,W)=>{var Me=go(),Z=R(Me);ur(Z,{class:"h-3 w-8 shrink-0"});var K=p(Z,2);ur(K,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),P(Me),s(q,Me)}),P(V),P(v),s(b,v)},ht=b=>{var v=bo(),V=R(v),q=S(V,!0),W=p(V,2),Me=S(W,!0),Z=p(W,2);{var K=me=>{var He=_o(),dt=S(He,!0);C(()=>g(dt,e(ut))),s(me,He)};re(Z,me=>{e(kt)==="generic"&&me(K)})}var ce=p(Z,2);{var je=me=>{var He=wo(),dt=ue(He),Wt=S(dt,!0),tr=p(dt,2);Pt(tr,20,()=>e(It),xt=>xt,(xt,rr)=>{var Bt=ho(),Er=R(Bt);Fe(Er,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Sr(rr),children:(Lr,$o)=>{Ge();var ar=et();C(()=>g(ar,rr)),s(Lr,ar)},$$slots:{default:!0}}),P(Bt),s(xt,Bt)}),P(tr),C(xt=>g(Wt,xt),[()=>d.layout_fileTab_didYouMean_label()]),s(me,He)};re(ce,me=>{e(It).length>0&&me(je)})}P(v),C(me=>{g(q,me),g(Me,o().filePath)},[()=>co(e(kt))]),s(b,v)},wt=b=>{var v=xo(),V=R(v),q=S(V,!0),W=p(V,2),Me=S(W,!0),Z=p(W,2);{var K=ce=>{{let je=i(()=>!e(gt)||e(st));Fe(ce,{variant:"secondary",size:"sm",onclick:Ft,get disabled(){return e(je)},children:(me,He)=>{Ge();var dt=et();C(Wt=>g(dt,Wt),[()=>d.layout_fileTab_downloadFile_label()]),s(me,dt)},$$slots:{default:!0}})}};re(Z,ce=>{!e(l)&&e(Be)&&ce(K)})}P(v),C(ce=>{g(q,ce),g(Me,o().filePath)},[()=>d.editor_fileViewer_binary_label()]),s(b,v)},bt=b=>{const v=i(()=>o().filePath?.toLowerCase().endsWith(".svg"));var V=ze(),q=ue(V);{var W=K=>{{let ce=i(()=>o().filePath||""),je=i(()=>!e(l)&&e(gt));Rt(K,{get filePath(){return e(ce)},get fileContent(){return e(nt)},get language(){return e(At)},get isBinary(){return e(t)},onDownload:Ft,get allowDownload(){return e(je)},get downloading(){return e(st)}})}},Me=K=>{var ce=yo(),je=R(ce);ja(je,{get content(){return e(nt)},get workspaceId(){return c()},get relativeMediaBase(){return e(Vt)},renderRichFencesAsCode:!0,renderDiagrams:!0}),P(ce),s(K,ce)},Z=K=>{var ce=Ir,je=Cr;{let me=i(()=>B()?e(z):[]);_r(Yt(K,{get value(){return ce()},set value(He){je(He)},get language(){return e(At)},get readOnly(){return e(l)},get fileName(){return o().filePath},get workspaceId(){return c()},get filePath(){return o().filePath},get lineWrapping(){return N()},get lineChanges(){return e(me)},get jumpTo(){return e(T)},get externalContentVersion(){return e(f)},get isPanelFocused(){return m()}}),He=>u(h,He,!0),()=>e(h))}};re(q,K=>{e(v)?K(W):e(Ct)&&e(L)?K(Me,1):K(Z,-1)})}s(b,V)},Nt=b=>{var v=vr(),V=R(v),q=S(V,!0);P(v),C(W=>g(q,W),[()=>d.layout_fileTab_preparing_label()]),s(b,v)};re(Re,b=>{e(te)?b(pe):e(w)&&e(Te)&&e(G)?b(Ve,1):e(w)&&e(Ue)?b(Oe,2):e(Te)&&e(pt)?b(ft,3):e(Te)?b(_t,4):e(Qt)?b(Ae,5):e(Ue)?b(Ye,6):e($t)?b(lt,7):e(ut)?b(ht,8):e(t)?b(wt,9):e(nt)!==null?b(bt,10):b(Nt,-1)})}s(F,ve)}),s(r,n)};re(jr,r=>{o().filePath&&r(zr)})}s(Y,er);var Ur=Et(Mr);return Ee(),Ur}export{Po as default};
@@ -1,4 +1,4 @@
1
- import{g as ie}from"./D7Xt1SkT.js";import{s as re}from"./BPlA_F0H.js";import{b as p,ay as b,X as $,a1 as ae,aP as ne,bh as oe,V as le,a_ as ce,U as he,aZ as de,b0 as ue,Y as fe,T as pe,z as j,r as Se,aW as vt,am as ge,aU as ye,ab as me,aG as Te}from"./BFTlNJv7.js";import{c as Ee}from"./yfYdt-hl.js";import{aP as _e}from"./D6pin7kj.js";var At=(function(){var t=p(function(V,o,f,n){for(f=f||{},n=V.length;n--;f[V[n]]=o);return f},"o"),e=[1,2],s=[1,3],a=[1,4],r=[2,4],c=[1,9],h=[1,11],u=[1,16],l=[1,17],m=[1,18],y=[1,19],_=[1,33],L=[1,20],R=[1,21],D=[1,22],S=[1,23],w=[1,24],C=[1,26],F=[1,27],I=[1,28],P=[1,29],v=[1,30],z=[1,31],at=[1,32],nt=[1,35],ot=[1,36],lt=[1,37],ct=[1,38],K=[1,34],g=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ht=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],It=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],mt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:p(function(o,f,n,T,E,i,B){var d=i.length-1;switch(E){case 3:return T.setRootDoc(i[d]),i[d];case 4:this.$=[];break;case 5:i[d]!="nl"&&(i[d-1].push(i[d]),this.$=i[d-1]);break;case 6:case 7:this.$=i[d];break;case 8:this.$="nl";break;case 12:this.$=i[d];break;case 13:const Q=i[d-1];Q.description=T.trimColon(i[d]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[d-2],state2:i[d]};break;case 15:const Tt=T.trimColon(i[d]);this.$={stmt:"relation",state1:i[d-3],state2:i[d-1],description:Tt};break;case 19:this.$={stmt:"state",id:i[d-3],type:"default",description:"",doc:i[d-1]};break;case 20:var G=i[d],X=i[d-2].trim();if(i[d].match(":")){var ut=i[d].split(":");G=ut[0],X=[X,ut[1]]}this.$={stmt:"state",id:G,type:"default",description:X};break;case 21:this.$={stmt:"state",id:i[d-3],type:"default",description:i[d-5],doc:i[d-1]};break;case 22:this.$={stmt:"state",id:i[d],type:"fork"};break;case 23:this.$={stmt:"state",id:i[d],type:"join"};break;case 24:this.$={stmt:"state",id:i[d],type:"choice"};break;case 25:this.$={stmt:"state",id:T.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[d-1].trim(),note:{position:i[d-2].trim(),text:i[d].trim()}};break;case 29:this.$=i[d].trim(),T.setAccTitle(this.$);break;case 30:case 31:this.$=i[d].trim(),T.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[d-3],url:i[d-2],tooltip:i[d-1]};break;case 33:this.$={stmt:"click",id:i[d-3],url:i[d-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[d-1].trim(),classes:i[d].trim()};break;case 36:this.$={stmt:"style",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 37:this.$={stmt:"applyClass",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 38:T.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:T.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:T.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:T.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[d].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:u,17:l,19:m,22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,7]),t(g,[2,8]),t(g,[2,9]),t(g,[2,10]),t(g,[2,11]),t(g,[2,12],{14:[1,40],15:[1,41]}),t(g,[2,16]),{18:[1,42]},t(g,[2,18],{20:[1,43]}),{23:[1,44]},t(g,[2,22]),t(g,[2,23]),t(g,[2,24]),t(g,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(g,[2,28]),{34:[1,49]},{36:[1,50]},t(g,[2,31]),{13:51,24:_,57:K},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ht,[2,44],{58:[1,56]}),t(ht,[2,45],{58:[1,57]}),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,41]),t(g,[2,6]),t(g,[2,13]),{13:58,24:_,57:K},t(g,[2,17]),t(It,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(g,[2,29]),t(g,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(g,[2,14],{14:[1,71]}),{4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,21:[1,72],22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(g,[2,34]),t(g,[2,35]),t(g,[2,36]),t(g,[2,37]),t(ht,[2,46]),t(ht,[2,47]),t(g,[2,15]),t(g,[2,19]),t(It,r,{7:78}),t(g,[2,26]),t(g,[2,27]),{5:[1,79]},{5:[1,80]},{4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,21:[1,81],22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,32]),t(g,[2,33]),t(g,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:p(function(o,f){if(f.recoverable)this.trace(o);else{var n=new Error(o);throw n.hash=f,n}},"parseError"),parse:p(function(o){var f=this,n=[0],T=[],E=[null],i=[],B=this.table,d="",G=0,X=0,ut=2,Q=1,Tt=i.slice.call(arguments,1),k=Object.create(this.lexer),W={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(W.yy[Et]=this.yy[Et]);k.setInput(o,W.yy),W.yy.lexer=k,W.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var _t=k.yylloc;i.push(_t);var ee=k.options&&k.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function se(N){n.length=n.length-2*N,E.length=E.length-N,i.length=i.length-N}p(se,"popStack");function Nt(){var N;return N=T.pop()||k.lex()||Q,typeof N!="number"&&(N instanceof Array&&(T=N,N=T.pop()),N=f.symbols_[N]||N),N}p(Nt,"lex");for(var x,U,O,bt,J={},ft,Y,Rt,pt;;){if(U=n[n.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((x===null||typeof x>"u")&&(x=Nt()),O=B[U]&&B[U][x]),typeof O>"u"||!O.length||!O[0]){var kt="";pt=[];for(ft in B[U])this.terminals_[ft]&&ft>ut&&pt.push("'"+this.terminals_[ft]+"'");k.showPosition?kt="Parse error on line "+(G+1)+`:
1
+ import{g as ie}from"./WYk3QPoC.js";import{s as re}from"./D8peLl3x.js";import{b as p,ay as b,X as $,a1 as ae,aP as ne,bh as oe,V as le,a_ as ce,U as he,aZ as de,b0 as ue,Y as fe,T as pe,z as j,r as Se,aW as vt,am as ge,aU as ye,ab as me,aG as Te}from"./BXNjGjOh.js";import{c as Ee}from"./BAcJE2jC.js";import{aP as _e}from"./vBH-DCjX.js";var At=(function(){var t=p(function(V,o,f,n){for(f=f||{},n=V.length;n--;f[V[n]]=o);return f},"o"),e=[1,2],s=[1,3],a=[1,4],r=[2,4],c=[1,9],h=[1,11],u=[1,16],l=[1,17],m=[1,18],y=[1,19],_=[1,33],L=[1,20],R=[1,21],D=[1,22],S=[1,23],w=[1,24],C=[1,26],F=[1,27],I=[1,28],P=[1,29],v=[1,30],z=[1,31],at=[1,32],nt=[1,35],ot=[1,36],lt=[1,37],ct=[1,38],K=[1,34],g=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ht=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],It=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],mt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:p(function(o,f,n,T,E,i,B){var d=i.length-1;switch(E){case 3:return T.setRootDoc(i[d]),i[d];case 4:this.$=[];break;case 5:i[d]!="nl"&&(i[d-1].push(i[d]),this.$=i[d-1]);break;case 6:case 7:this.$=i[d];break;case 8:this.$="nl";break;case 12:this.$=i[d];break;case 13:const Q=i[d-1];Q.description=T.trimColon(i[d]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[d-2],state2:i[d]};break;case 15:const Tt=T.trimColon(i[d]);this.$={stmt:"relation",state1:i[d-3],state2:i[d-1],description:Tt};break;case 19:this.$={stmt:"state",id:i[d-3],type:"default",description:"",doc:i[d-1]};break;case 20:var G=i[d],X=i[d-2].trim();if(i[d].match(":")){var ut=i[d].split(":");G=ut[0],X=[X,ut[1]]}this.$={stmt:"state",id:G,type:"default",description:X};break;case 21:this.$={stmt:"state",id:i[d-3],type:"default",description:i[d-5],doc:i[d-1]};break;case 22:this.$={stmt:"state",id:i[d],type:"fork"};break;case 23:this.$={stmt:"state",id:i[d],type:"join"};break;case 24:this.$={stmt:"state",id:i[d],type:"choice"};break;case 25:this.$={stmt:"state",id:T.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[d-1].trim(),note:{position:i[d-2].trim(),text:i[d].trim()}};break;case 29:this.$=i[d].trim(),T.setAccTitle(this.$);break;case 30:case 31:this.$=i[d].trim(),T.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[d-3],url:i[d-2],tooltip:i[d-1]};break;case 33:this.$={stmt:"click",id:i[d-3],url:i[d-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[d-1].trim(),classes:i[d].trim()};break;case 36:this.$={stmt:"style",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 37:this.$={stmt:"applyClass",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 38:T.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:T.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:T.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:T.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[d].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:u,17:l,19:m,22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,7]),t(g,[2,8]),t(g,[2,9]),t(g,[2,10]),t(g,[2,11]),t(g,[2,12],{14:[1,40],15:[1,41]}),t(g,[2,16]),{18:[1,42]},t(g,[2,18],{20:[1,43]}),{23:[1,44]},t(g,[2,22]),t(g,[2,23]),t(g,[2,24]),t(g,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(g,[2,28]),{34:[1,49]},{36:[1,50]},t(g,[2,31]),{13:51,24:_,57:K},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ht,[2,44],{58:[1,56]}),t(ht,[2,45],{58:[1,57]}),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,41]),t(g,[2,6]),t(g,[2,13]),{13:58,24:_,57:K},t(g,[2,17]),t(It,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(g,[2,29]),t(g,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(g,[2,14],{14:[1,71]}),{4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,21:[1,72],22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(g,[2,34]),t(g,[2,35]),t(g,[2,36]),t(g,[2,37]),t(ht,[2,46]),t(ht,[2,47]),t(g,[2,15]),t(g,[2,19]),t(It,r,{7:78}),t(g,[2,26]),t(g,[2,27]),{5:[1,79]},{5:[1,80]},{4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,21:[1,81],22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,32]),t(g,[2,33]),t(g,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:p(function(o,f){if(f.recoverable)this.trace(o);else{var n=new Error(o);throw n.hash=f,n}},"parseError"),parse:p(function(o){var f=this,n=[0],T=[],E=[null],i=[],B=this.table,d="",G=0,X=0,ut=2,Q=1,Tt=i.slice.call(arguments,1),k=Object.create(this.lexer),W={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(W.yy[Et]=this.yy[Et]);k.setInput(o,W.yy),W.yy.lexer=k,W.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var _t=k.yylloc;i.push(_t);var ee=k.options&&k.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function se(N){n.length=n.length-2*N,E.length=E.length-N,i.length=i.length-N}p(se,"popStack");function Nt(){var N;return N=T.pop()||k.lex()||Q,typeof N!="number"&&(N instanceof Array&&(T=N,N=T.pop()),N=f.symbols_[N]||N),N}p(Nt,"lex");for(var x,U,O,bt,J={},ft,Y,Rt,pt;;){if(U=n[n.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((x===null||typeof x>"u")&&(x=Nt()),O=B[U]&&B[U][x]),typeof O>"u"||!O.length||!O[0]){var kt="";pt=[];for(ft in B[U])this.terminals_[ft]&&ft>ut&&pt.push("'"+this.terminals_[ft]+"'");k.showPosition?kt="Parse error on line "+(G+1)+`:
2
2
  `+k.showPosition()+`
3
3
  Expecting `+pt.join(", ")+", got '"+(this.terminals_[x]||x)+"'":kt="Parse error on line "+(G+1)+": Unexpected "+(x==Q?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(kt,{text:k.match,token:this.terminals_[x]||x,line:k.yylineno,loc:_t,expected:pt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+x);switch(O[0]){case 1:n.push(x),E.push(k.yytext),i.push(k.yylloc),n.push(O[1]),x=null,X=k.yyleng,d=k.yytext,G=k.yylineno,_t=k.yylloc;break;case 2:if(Y=this.productions_[O[1]][1],J.$=E[E.length-Y],J._$={first_line:i[i.length-(Y||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(Y||1)].first_column,last_column:i[i.length-1].last_column},ee&&(J._$.range=[i[i.length-(Y||1)].range[0],i[i.length-1].range[1]]),bt=this.performAction.apply(J,[d,X,G,W.yy,O[1],E,i].concat(Tt)),typeof bt<"u")return bt;Y&&(n=n.slice(0,-1*Y*2),E=E.slice(0,-1*Y),i=i.slice(0,-1*Y)),n.push(this.productions_[O[1]][0]),E.push(J.$),i.push(J._$),Rt=B[n[n.length-2]][n[n.length-1]],n.push(Rt);break;case 3:return!0}}return!0},"parse")},te=(function(){var V={EOF:1,parseError:p(function(f,n){if(this.yy.parser)this.yy.parser.parseError(f,n);else throw new Error(f)},"parseError"),setInput:p(function(o,f){return this.yy=f||this.yy||{},this._input=o,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:p(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var f=o.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:p(function(o){var f=o.length,n=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var T=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),n.length-1&&(this.yylineno-=n.length-1);var E=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:n?(n.length===T.length?this.yylloc.first_column:0)+T[T.length-n.length].length-n[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(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:p(function(o){this.unput(this.match.slice(o))},"less"),pastInput:p(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var o=this.pastInput(),f=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
@@ -1,6 +1,6 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BKAobQX_.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/O1QHAURn.js","/app/immutable/chunks/BBDxUL80.js","/app/immutable/chunks/haHmm526.js","/app/immutable/chunks/BkT9o_nd.js","/app/immutable/chunks/CAyg2ijY.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/DNqM68dO.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BUzdsYyD.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CovkQMd0.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/CR_t_AVn.js","/app/immutable/chunks/C2mPABxH.js","/app/immutable/chunks/4kJJ0Qm4.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BV0i7JjW.js","/app/immutable/chunks/BH3LKWph.js","/app/immutable/chunks/DV9nY0bt.js","/app/immutable/chunks/CWDPeeaf.js","/app/immutable/chunks/B0f-om7y.js","/app/immutable/chunks/BgCTNfXj.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/CqO6BKca.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/BsieX9dN.js","/app/immutable/assets/observe-overflow.CbDLK6fN.css","/app/immutable/chunks/BViMgwIT.js","/app/immutable/chunks/DEEBY1o3.js","/app/immutable/chunks/CQkmEJ54.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/BeP4UORy.js","/app/immutable/chunks/CerLhVOI.js","/app/immutable/chunks/B1mZq3ve.js","/app/immutable/assets/SettingsPage.D8u26cHZ.css","/app/immutable/chunks/DwupWOJr.js","/app/immutable/chunks/Drd3_KgI.js","/app/immutable/chunks/CC7to1B5.js","/app/immutable/chunks/B6kyqBFl.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/CJ-QJuBK.js","/app/immutable/chunks/VZEkDWIM.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/xEfOpOba.js","/app/immutable/chunks/RoOfSbrC.js","/app/immutable/chunks/Csj7SEat.js","/app/immutable/chunks/DrbtWgvN.js","/app/immutable/chunks/BVs4aETe.js","/app/immutable/chunks/BgLcfABG.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/9Q1iR9sq.js","/app/immutable/chunks/BnXZPw_-.js","/app/immutable/chunks/DxHob-bh.js","/app/immutable/chunks/C80hd_K2.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/6X5anZSR.js","/app/immutable/assets/directory-picker-service.CzNEA6Ot.css","/app/immutable/chunks/C2Jv33-s.js","/app/immutable/chunks/BFTlNJv7.js","/app/immutable/chunks/D6pin7kj.js","/app/immutable/chunks/BV3MrUXO.js","/app/immutable/chunks/DRjQ_WEk.js","/app/immutable/chunks/DbQ0TH44.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/lkH5RFQO.js","/app/immutable/chunks/DlwwHsb5.js","/app/immutable/assets/AttachmentPreview.BCSCCZGm.css","/app/immutable/assets/DiagramPresentation.Bfi3xHm0.css","/app/immutable/chunks/D9bKP3Hx.js","/app/immutable/assets/StreamingDiagramRenderer.BShsSvPz.css"])))=>i.map(i=>d[i]);
2
- var Ua=Object.defineProperty;var Ba=(a,t,r)=>t in a?Ua(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r;var dt=(a,t,r)=>Ba(a,typeof t!="symbol"?t+"":t,r);import{bp as C,t as rt,br as y,a_ as re,bz as nt,b as st,bt as Va,bv as Jt,_ as ka}from"./O1QHAURn.js";import{bs as ot,a5 as N,aD as e,bA as T,b_ as X,W,bn as it,c9 as E,aA as x,aB as B,ca as yt,bk as ya,c6 as Ka,cd as Ht,bV as oe,bS as z,ay as Ee,bl as me,bO as be,ai as xa,a7 as xt,c0 as ja,bf as Ot,bH as O,aw as Be,aj as Se,aC as Ga,c3 as ft,bb as St,aF as Ya,br as Za,bj as Ja}from"./DYhIMPy1.js";import{j as Qa,l as Xa,v as Pe,w as pt,u as $,g as tt,n as Ut,p as $a}from"./CAyg2ijY.js";import{aO as er,cY as tr,M as ar,aw as rr,dm as nr,W as sr,dr as Aa,C as or,a0 as ir}from"./VZEkDWIM.js";import{t as Bt}from"./CWDPeeaf.js";import{a9 as cr,ao as lr,A as dr,n as ur,a5 as Ia,s as Vt,a4 as Kt,aJ as At,b5 as Ma,m as fr,aL as pr,b4 as mr}from"./DbQ0TH44.js";import{l as Qt}from"./JvJIKXgZ.js";import{bV as gr,bS as vr,bT as Xt,aB as hr}from"./DrbtWgvN.js";import{t as ut,P as br}from"./DV9nY0bt.js";import{f as jt,bc as qt}from"./CR_t_AVn.js";import{t as Ve,v as wr,I as Ct,F as $t,c as ea}from"./BkT9o_nd.js";import{ry as Ca,Ix as we,mq as _r,fF as kr,nk as yr,ul as xr,a as Ar,vX as Ir,t0 as Mr,rg as Cr,g as Sr,be as ta,v2 as Rr,sH as Er,v4 as Pr}from"./DNqM68dO.js";import{c as Tr,l as bt}from"./ChTqQfQN.js";import{o as Fr}from"./6X5anZSR.js";import{aN as Lr,aO as aa,by as Wr,ax as Nr,bx as Hr,aC as Or,c_ as qr,cO as Dr,F as wt,au as ra,bG as zr,bB as Ur}from"./B0f-om7y.js";import{l as Br}from"./BVs4aETe.js";import{p as Vr,c_ as _t,cZ as na,ao as Kr,d0 as Sa,a8 as Et,aE as Ra,aV as jr,aw as Gr,a7 as sa,r as Yr,aM as Zr,aR as Jr,F as Qr}from"./D6pin7kj.js";import{s as Rt}from"./BBDxUL80.js";import{b as at}from"./BaIAhI85.js";import{s as Xr}from"./BsieX9dN.js";import{c as $r,u as en,s as tn,a as an}from"./DfxQWSVU.js";import{z as oa,x as ia}from"./BKAobQX_.js";import{g as ca}from"./haHmm526.js";import{n as la}from"./BV3MrUXO.js";const rn=new Set(["failed","blocked","needs_attention","in_progress"]),nn={failed:{visual:"icon",icon:Dr,className:"text-foreground"},blocked:{visual:"icon",icon:qr,className:"text-danger"},needs_attention:{visual:"icon",icon:Or,className:"text-warning-ink"},in_progress:{visual:"dot",icon:null,className:"workspace-status-color-active"},waiting:{visual:"icon",icon:Hr,className:"text-muted-foreground"},unread:{visual:"dot",icon:null,className:"workspace-status-color-unread"},not_started:{visual:"dot",icon:null,className:"text-muted-foreground/35"},idle:{visual:"dot",icon:null,className:"text-muted-foreground/35"},complete:{visual:"icon",icon:Nr,className:"text-success"},pr_queued:{visual:"icon",icon:Wr,className:"text-info"},pr_ready:{visual:"icon",icon:aa,className:"text-success"},pr_open:{visual:"icon",icon:aa,className:"text-info"},pr_merged:{visual:"icon",icon:Lr,className:"text-purple-500"}};function sn(a){switch(a){case"failed":return C.workspace_statusIcon_failed_label();case"blocked":return C.workspace_statusIcon_blocked_label();case"needs_attention":return C.workspace_statusIcon_needsAttention_label();case"in_progress":return C.workspace_statusIcon_inProgress_label();case"waiting":return C.workspace_taskStatus_waiting_label();case"unread":return C.layout_activeCard_unread_header();case"not_started":return C.workspace_statusIcon_notStarted_label();case"idle":return C.workspace_statusIcon_idle_label();case"complete":return C.workspace_statusIcon_complete_label();case"pr_queued":return C.workspace_statusIcon_prQueued_label();case"pr_ready":return C.workspace_statusIcon_prReady_label();case"pr_open":return C.workspace_statusIcon_prOpen_label();case"pr_merged":return C.workspace_statusIcon_prMerged_label()}}function on(a){const t=Ca(a.displayStatus)?a.displayStatus:"not_started";return rn.has(t)?t:a.attention==="unread"?"unread":a.waiting===!0?"waiting":t}function Ea(a){const t=a==="waiting"||a==="unread"||Ca(a)?a:"not_started",r=sn(t);return{state:t,...nn[t],label:r,tooltip:r,accessibleName:r}}var cn=B('<span class="workspace-status-dot svelte-14zk5l0" data-workspace-status-dot=""></span>'),ln=B("<span><!></span>");function Pa(a,t){if(new.target)return rt({component:Pa,...a});ot(t,!0);let r=y(t,"status",7),d=y(t,"size",7,14),c=y(t,"decorative",7,!1),u=y(t,"class",7);const s=E(()=>Ea(r()));var o={get status(){return r()},set status(m){r(m),x()},get size(){return d()},set size(m=14){d(m),x()},get decorative(){return c()},set decorative(m=!1){c(m),x()},get class(){return u()},set class(m){u(m),x()},$set:nt,$on:(m,w)=>st(t,m,w)},v=ln(),_=N(v);{var b=m=>{var w=cn();W(m,w)},A=m=>{wt(m,{get icon(){return e(s).icon},class:"size-full!"})};re(_,m=>{e(s).visual==="dot"?m(b):e(s).icon&&m(A,1)})}return T(v),X(m=>{Pe(v,1,m,"svelte-14zk5l0"),pt(v,`width: ${d()??""}px; height: ${d()??""}px;`),$(v,"role",c()?void 0:"img"),$(v,"aria-label",c()?void 0:e(s).accessibleName),$(v,"aria-hidden",c()?"true":void 0),$(v,"title",c()?void 0:e(s).tooltip),$(v,"data-workspace-status",e(s).state),$(v,"data-workspace-status-visual",e(s).visual),$(v,"data-workspace-status-icon",e(s).icon?.iconName)},[()=>Qa(Xa("workspace-status-icon inline-flex shrink-0 items-center justify-center forced-colors:text-[CanvasText]",e(s).className,u()))]),W(a,v),it(o)}const Gt=6e4,Yt=60*Gt,Zt=24*Yt,da=30*Zt;function dn(a,t=new Date){if(a==null)return null;const r=a instanceof Date?a:new Date(a),d=r.getTime(),c=t.getTime();if(!Number.isFinite(d)||!Number.isFinite(c))return null;const u=Math.max(0,c-d);let s;u<Gt?s="<1m":u<Yt?s=`${Ve(Math.floor(u/Gt))}m`:u<Zt?s=`${Ve(Math.floor(u/Yt))}h`:u<da?s=`${Ve(Math.floor(u/Zt))}d`:s=`${Ve(Math.floor(u/da))}mo`;const o=d>c?t:r,v=wr(o,{now:t});return v?{compact:s,accessible:v,dateTime:r.toISOString()}:null}var un=B('<div><div class="grid gap-0.5 px-5 pt-4"><div class="flex min-w-0 items-center justify-between gap-3"><!> <!></div> <!> <!></div> <div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><div class="grid" data-workspace-hover-card-activity=""><!></div> <div class="pull-requests grid" data-workspace-hover-card-pr-column=""><!></div></div></div>'),fn=B('<p class="type-caption mt-1 min-w-0 line-clamp-3 text-muted-foreground" data-workspace-hover-card-summary=""> </p>'),pn=B('<span class="shrink-0 text-muted-foreground" data-workspace-hover-card-question-meta=""><span aria-hidden="true"> </span></span>'),mn=B('<span class="row-span-2 flex h-(--text-caption-line-height) items-center" aria-hidden="true"><!></span><span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-agent-name=""> </span><time class="type-caption whitespace-nowrap text-muted-foreground" data-workspace-hover-card-agent-time=""> </time> <span class="agent-detail type-caption flex min-w-0 items-start gap-1.5 text-muted-foreground svelte-1vax087" data-workspace-hover-card-agent-detail=""><span class="min-w-0 truncate" data-workspace-hover-card-agent-context=""> </span><!></span>',1),ua=B('<div role="listitem"><!></div>'),gn=B('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-overflow=""><span> </span> <!></div>'),vn=B('<section class="activity min-w-0" data-workspace-hover-card-activity="" data-workspace-hover-card-agent-table=""><div class="-mx-2 grid gap-2" role="list"></div> <!></section>'),hn=B('<!> <span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-pr-title=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-status=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-number=""> </span>',1),bn=B('<div class="grid w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center gap-x-2 rounded-sm px-2 py-0 text-left" data-workspace-hover-card-pr-row=""><!></div>'),wn=B('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-pr-overflow=""><span> </span> <!></div>'),_n=B('<section class="pull-requests min-w-0" data-workspace-hover-card-pr-column=""><div class="-mx-2 grid min-w-0 gap-2" role="list" data-workspace-hover-card-pr-list=""></div> <!></section>'),kn=B('<div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><!> <!></div>',1),yn=B('<header data-workspace-hover-card-header=""><div class="min-w-0" data-workspace-hover-card-identity=""><div class="flex min-w-0 items-center justify-between gap-3"><h2 class="type-body min-w-0 truncate font-medium text-foreground" data-workspace-hover-card-title=""> </h2> <span class="type-caption flex shrink-0 items-center gap-1.5 text-muted-foreground" data-workspace-hover-card-status=""><span class="truncate" data-workspace-hover-card-status-label=""> </span><!></span></div> <div class="type-caption mt-0.5 min-w-0 truncate text-muted-foreground" data-workspace-hover-card-repo=""> </div> <!></div></header> <!>',1),xn=B('<section class="workspace-hover-card shrink-0 overflow-hidden rounded-md bg-background text-left text-foreground shadow-(--elevation-overlay) ring-1 ring-border svelte-1vax087" data-workspace-hover-card="" data-workspace-hover-card-layout="landscape"><!></section>');function An(a,t){if(new.target)return rt({component:An,...a});ot(t,!0);const r=()=>Jt(F,"$workspaceAgents$",c),d=()=>Jt(i,"$prMonitors$",c),[c,u]=Va(),s=Tr("WorkspaceHoverCard");let o=y(t,"workspace",7),v=y(t,"isLoading",7,!1),_=y(t,"activeAgentIds",23,()=>[]),b=y(t,"loadAgentSessions",7,!0),A=y(t,"onkeydown",7),m=y(t,"staticData",7,!1);const w=Ht("");function q(){return m()?Ht([]):er(w)}function V(){return m()?Ht([]):tr(w)}const F=q(),i=V();yt(()=>w.set(o()?.id??""));let p=oe(0);ya(()=>Qt.subscribe(()=>Ka(p)));let k=E(()=>o()?.agentSummary?.agentIds??[]),P=E(()=>(e(p),o()?Qt.getStreamingAgentIdsForWorkspace(o().id):[])),U=null,K=new Set;yt(()=>{if(!o()||!b())return;const l=String(o().id);U!==l&&(U=l,K=new Set);for(const M of new Set([...e(k).slice(0,6),..._(),...e(P)]))K.has(M)||(we.dispatch(_r(l,M)),K.add(M))});function ne(l){return[l.name,l.context,l.questionMeta?.accessible,l.updated.accessible].filter(Boolean).join(". ")}function Le(l){return l?l.kind==="attention"?l.attention.reason?.trim()||null:"text"in l&&l.text.trim()||null:null}function le(l){return dn(l.lastActivity||l.updatedAt||l.createdAt)??{compact:"—",accessible:C.workspace_hoverCard_noRecentActivity_label()}}function ie(l){const M=String(l.status).toLowerCase(),L=yr(l),Q=lr(l),ye=Q==="question"?gr(l):null,he=Le(rr.select(we.state,String(l.id)));let xe,Ne,Ae,n,f,H,S=!1;if(Q==="question"){xe="attention",Ne="question",Ae=ye?.questions[0]?.question.trim()||he||C.workspace_hoverCard_question_label(),n="question",f=1;const G=ye?.questions.length??0;G>1&&(H={compact:`${Ve(1)}/${Ve(G)}`,accessible:C.chat_questionWizard_stepCounter_label({current:1,total:G})})}else if(Q==="attention-discussion")xe="attention",Ne="discussion",Ae=L?.reason?.trim()||C.chat_agentCard_attentionDiscussion_label(),n="attention-discussion",f=1;else if(Q==="attention-blocker"||M==="blocked")xe="attention",Ne="blocker",Ae=L?.reason?.trim()||C.chat_agentCard_attentionBlocker_label(),n="attention-blocker",f=0;else if(l.hasUnread)xe="attention",Ne="unread",Ae=he||C.chat_newMessagesDivider_label(),S=!!he,n="unread",f=2;else if(l.isStreaming||l.isProcessing||_().includes(String(l.id))||e(P).includes(String(l.id))||["active","busy","processing","responding","running","streaming","in_progress"].includes(M))xe="active",Ae=he||C.workspace_devScripts_running_label(),S=!!he,n=l.isProcessing?"responding":"running",f=3;else if(["waiting","pending","queued","starting"].includes(M))xe="waiting",Ae=he||C.workspace_taskStatus_waiting_label(),S=!!he,n="waiting",f=4;else return null;const Y=l.agentMetadata??l.metadata;return{id:String(l.id),name:l.name?.trim()||C.workspace_fileChanges_agent_label(),group:xe,attentionKind:Ne,avatarState:n,specialist:Y?.specialist,context:Ae,questionMeta:H,contextIsPreview:S,updated:le(l),priority:f}}let ge=E(()=>{const l=o()?.agentSummary,M=new Map;if(Array.isArray(l?.agents))for(const L of l.agents)L&&typeof L=="object"&&typeof L.id=="string"&&M.set(L.id,L.parentAgentId);return r().filter(L=>{const Q=M.get(String(L.id));return!(kr(L)!=="topLevel"||typeof Q=="string"&&Q||L.pendingDeleteAt||L.retiredAt||String(L.status).toLowerCase()==="deleted")})}),_e=E(()=>e(ge).map(ie).filter(l=>l!==null).sort((l,M)=>l.priority-M.priority)),Ge=E(()=>e(_e).slice(0,6)),I=E(()=>Math.max(0,e(_e).length-6)),ee=E(()=>o()?.repositoryName?o().repositoryOwner?`${o().repositoryOwner} / ${o().repositoryName}`:o().repositoryName:C.workspace_hoverCard_localRepository_label()),Re=E(()=>on(o()??{})),ve=E(()=>Ea(e(Re))),ce=E(()=>o()?.statusMessage?.trim()||"");function ke(l){if(!l)return null;const M=l.activePullRequest??l.pullRequests?.[0]??null;return M||(l.prStatus?{id:`legacy-pr-${l.prNumber??"workspace"}`,number:l.prNumber??0,url:l.prUrl??"",title:C.workspace_hoverCard_pullRequest_label(),status:l.prStatus,createdAt:l.updatedAt,updatedAt:l.updatedAt}:null)}let We=E(()=>o()?m()?ke(o()):nr.select(we.state,o().id)??ke(o()):null),de=E(()=>{if(!o()||ar(o()))return[];const l=o().repositoryOwner&&o().repositoryName?`${o().repositoryOwner}/${o().repositoryName}`:void 0;return cr({workspacePRs:o().pullRequests,activePR:e(We),monitors:d(),workspaceRepo:l,buildPrUrl:(M,L)=>Vr(M,o().repositoryOwner,o().repositoryName,L),getDisplayTitle:M=>M.title})}),Ze=E(()=>e(de).slice(0,3)),Te=E(()=>Math.max(0,e(de).length-3)),se=E(()=>e(_e).length>0),qe=E(()=>e(de).length>0),h=E(()=>e(se)||e(qe));function g(l){const M=l.resource?.repository.provider==="gitlab"?`${l.repo} !${l.number}`:l.repo?C.workspace_card_prBadge_repoLine_tooltip({repo:l.repo,number:l.number}):C.workspace_card_prBadge_label({number:` #${l.number}`});return[sr(M,l),l.title,l.details].filter(Boolean).join(`
3
- `)}function J(l,M){if(l.stopPropagation(),!o()||!b())return;const L=o().id;Br.select(we.state)!==L&&Fr(L).catch(Q=>{s.warn("Failed to switch workspace for hover-card agent",{agentId:M,error:Q})}),we.dispatch(xr(L,{agentId:M}))}function D(l,M){if(l.stopPropagation(),!o()||!M.url)return;const L=o().id;ka(async()=>{const{handleLink:Q}=await import("./BKAobQX_.js").then(ye=>ye.H);return{handleLink:Q}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65]),import.meta.url).then(({handleLink:Q})=>Q(M.url,{workspaceId:L,event:l}))}var ae={get workspace(){return o()},set workspace(l){o(l),x()},get isLoading(){return v()},set isLoading(l=!1){v(l),x()},get activeAgentIds(){return _()},set activeAgentIds(l=[]){_(l),x()},get loadAgentSessions(){return b()},set loadAgentSessions(l=!0){b(l),x()},get onkeydown(){return A()},set onkeydown(l){A(l),x()},get staticData(){return m()},set staticData(l=!1){m(l),x()},$set:nt,$on:(l,M)=>st(t,l,M)},ue=xn(),j=N(ue);{var Ie=l=>{var M=un(),L=N(M),Q=N(L),ye=N(Q);ut(ye,{class:"h-7 min-w-0 max-w-64 flex-1"});var he=z(ye,2);ut(he,{class:"h-5 w-20 shrink-0"}),T(Q);var xe=z(Q,2);ut(xe,{class:"h-4 w-40"});var Ne=z(xe,2);ut(Ne,{class:"mt-2 h-10 w-full"}),T(L);var Ae=z(L,4),n=N(Ae),f=N(n);ut(f,{class:"h-10 w-full"}),T(n);var H=z(n,2),S=N(H);ut(S,{class:"h-10 w-full"}),T(H),T(Ae),T(M),W(l,M)},Fe=l=>{var M=yn(),L=Ee(M);let Q;var ye=N(L),he=N(ye),xe=N(he),Ne=me(xe,!0),Ae=z(xe,2),n=N(Ae),f=me(n,!0),H=z(n);Pa(H,{get status(){return e(Re)},size:16,decorative:!0}),T(Ae),T(he);var S=z(he,2),Y=me(S,!0),G=z(S,2);{var te=pe=>{var ze=fn(),It=me(ze,!0);tt(ze,(Mt,Pt)=>Bt?.(Mt,Pt),()=>e(ce)),X(()=>be(It,e(ce))),W(pe,ze)};re(G,pe=>{e(ce)&&pe(te)})}T(ye),T(L);var He=z(L,2);{var fe=pe=>{var ze=kn(),It=z(Ee(ze),2),Mt=N(It);{var Pt=Je=>{var Ke=vn(),Ye=N(Ke);Ut(Ye,21,()=>e(Ge),Z=>Z.id,(Z,R)=>{var Me=ua(),Qe=N(Me);{let Xe=E(()=>ne(e(R)));jt(Qe,{variant:"plain",wrapContent:!1,class:"grid h-auto! min-h-8 w-full min-w-0 cursor-pointer grid-cols-[1rem_minmax(0,1fr)_auto] items-start justify-normal gap-x-2 gap-y-0 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return e(Xe)},"data-workspace-hover-card-agent-row":!0,get"data-agent-group-row"(){return e(R).group},get"data-attention-kind"(){return e(R).attentionKind},get onkeydown(){return A()},onclick:je=>J(je,e(R).id),children:(je,mt)=>{var Oe=mn(),Ce=Ee(Oe),Ue=N(Ce);{let et=E(()=>e(R).specialist??null);dr(Ue,{get agentId(){return e(R).id},variant:"compact",get state(){return e(R).avatarState},get specialist(){return e(et)}})}T(Ce);var ct=z(Ce),Lt=me(ct,!0),$e=z(ct),Wt=me($e,!0),gt=z($e,2),vt=N(gt),Nt=me(vt,!0);tt(vt,(et,lt)=>Bt?.(et,lt),()=>e(R).context);var Oa=z(vt);{var qa=et=>{var lt=pn(),Da=N(lt),za=me(Da,!0);T(lt),X(()=>{$(lt,"aria-label",e(R).questionMeta.accessible),be(za,e(R).questionMeta.compact)}),W(et,lt)};re(Oa,et=>{e(R).questionMeta&&et(qa)})}T(gt),X(()=>{be(Lt,e(R).name),$($e,"datetime",e(R).updated.dateTime),$($e,"aria-label",e(R).updated.accessible),be(Wt,e(R).updated.compact),$(gt,"data-workspace-hover-card-agent-preview",e(R).contextIsPreview||void 0),be(Nt,e(R).context)}),W(je,Oe)},$$slots:{default:!0}})}T(Me),W(Z,Me)}),T(Ye);var Tt=z(Ye,2);{var Ft=Z=>{var R=gn(),Me=N(R),Qe=me(Me,!0),Xe=z(Me,2);wt(Xe,{get icon(){return ra},size:10}),T(R),X(je=>be(Qe,je),[()=>C.workspace_hoverCard_moreAgents_label({count:Ve(e(I))})]),W(Z,R)};re(Tt,Z=>{e(I)&&Z(Ft)})}T(Ke),X(Z=>$(Ke,"aria-label",Z),[()=>C.workspace_multiSelectSidebar_agentsTab_label()]),W(Je,Ke)};re(Mt,Je=>{e(se)&&Je(Pt)})}var Na=z(Mt,2);{var Ha=Je=>{var Ke=_n(),Ye=N(Ke);Ut(Ye,21,()=>e(Ze),Z=>Z.identity,(Z,R)=>{var Me=ua();{const mt=Oe=>{var Ce=hn(),Ue=Ee(Ce);wt(Ue,{get icon(){return e(R).statusIcon},size:16,get class(){return`shrink-0 justify-self-start ${e(R).foregroundClass??""}`}});var ct=z(Ue,2),Lt=me(ct,!0),$e=z(ct,2),Wt=me($e,!0),gt=z($e,2),vt=me(gt,!0);X(Nt=>{be(Lt,Nt),be(Wt,e(R).accessibleStateLabel),be(vt,e(R).numberLabel??`#${e(R).number}`)},[()=>e(R).title||(e(R).resource?.repository.provider==="gitlab"?C.workspace_hoverCard_mergeRequest_label():C.workspace_hoverCard_pullRequest_label())]),W(Oe,Ce)};var Qe=N(Me);{var Xe=Oe=>{{let Ce=E(()=>g(e(R)));jt(Oe,{variant:"plain",wrapContent:!1,class:"grid h-auto! w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center justify-normal gap-x-2 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return e(Ce)},"data-workspace-hover-card-pr-row":!0,get"data-pr-identity"(){return e(R).identity},get"data-pr-status"(){return e(R).status},get onkeydown(){return A()},onclick:Ue=>D(Ue,e(R)),children:(Ue,ct)=>{mt(Ue)},$$slots:{default:!0}})}},je=Oe=>{var Ce=bn(),Ue=N(Ce);mt(Ue),T(Ce),X(()=>{$(Ce,"data-pr-identity",e(R).identity),$(Ce,"data-pr-status",e(R).status)}),W(Oe,Ce)};re(Qe,Oe=>{e(R).url?Oe(Xe):Oe(je,-1)})}T(Me)}X(mt=>$(Me,"aria-label",mt),[()=>e(R).url?void 0:g(e(R))]),W(Z,Me)}),T(Ye);var Tt=z(Ye,2);{var Ft=Z=>{var R=wn(),Me=N(R),Qe=me(Me,!0),Xe=z(Me,2);wt(Xe,{get icon(){return ra},size:10}),T(R),X(je=>be(Qe,je),[()=>C.workspace_hoverCard_moreItems_label({count:Ve(e(Te))})]),W(Z,R)};re(Tt,Z=>{e(Te)&&Z(Ft)})}T(Ke),X((Z,R)=>{$(Ke,"aria-label",Z),$(Ye,"aria-label",R)},[()=>e(de).every(Z=>Z.resource?.repository.provider==="gitlab")?C.workspace_hoverCard_mergeRequests_label():e(de).some(Z=>Z.resource?.repository.provider==="gitlab")?C.workspace_hoverCard_reviews_label():C.workspace_hoverCard_pullRequests_label(),()=>e(de).every(Z=>Z.resource?.repository.provider==="gitlab")?C.workspace_hoverCard_mergeRequests_label():e(de).some(Z=>Z.resource?.repository.provider==="gitlab")?C.workspace_hoverCard_reviews_label():C.workspace_hoverCard_pullRequests_label()]),W(Je,Ke)};re(Na,Je=>{e(qe)&&Je(Ha)})}T(It),W(pe,ze)};re(He,pe=>{e(h)&&pe(fe)})}X(pe=>{Q=Pe(L,1,"min-w-0 px-5 pt-4",null,Q,{"pb-4":!e(h)}),be(Ne,pe),be(f,e(ve).label),be(Y,e(ee))},[()=>o().title||C.workspace_links_untitled_label()]),W(l,M)};re(j,l=>{v()||!o()?l(Ie):l(Fe,-1)})}T(ue),W(a,ue);var De=it(ae);return u(),De}const fa=800,Rs=175,In=300;function Mn(){let a=0,t=null;const r=new Set,d=new Set;function c(){return a>0||t!==null?0:fa}function u(){const o=c();r.forEach(v=>v(o))}function s(){t!==null&&(clearTimeout(t),t=null)}return{get currentOpenDelay(){return c()},subscribe(o){return r.add(o),o(c()),()=>r.delete(o)},notifyOpened(){const o=a===0&&t===null;s(),a+=1,o&&u()},notifyClosed(){a!==0&&(a-=1,!(a>0)&&(s(),t=setTimeout(()=>{t=null,u()},In)))},deferClose(o){return d.add(o),()=>d.delete(o)},settleDeferredCloses(){const o=[...d];d.clear(),o.forEach(v=>v())},reset(){const o=c()!==fa;s(),a=0,d.clear(),o&&u()}}}const Es=Mn();function Dt(a){const t=Aa.select(we.state,a);return t!==void 0&&Cr(t)}function Cn(a,t){if(!Dt(a))return[];const r=vr.select(we.state,a),d=Xt.select(we.state,a),c=hr.select(we.state),u=[];for(let s=0;s<Ar;s+=1){const o=c[s],v=o&&o!==a?Aa.select(we.state,o):void 0;u.push({id:`assign-micro-key-${s+1}`,label:v?C.workspace_card_assignOccupiedMicroKey_label({number:Ve(s+1),title:v.title}):C.workspace_card_assignMicroKeyNumber_label({number:Ve(s+1)}),checked:r===s,closeOnSelect:!0,onClick:()=>{Dt(a)&&we.dispatch(Ir(s,a)),t()}})}return d!==null&&(u.push({type:"separator"}),u.push({id:"unassign-micro-key",label:C.workspace_card_unassignMicroKey_label(),onClick:()=>{Dt(a)&&Xt.select(we.state,a)===d&&we.dispatch(Mr(d)),t()}})),u}function Ps(a,{connected:t,onClose:r}){if(!t)return[];const d=Cn(a,r);if(d.length===0)return[];const c=d.filter(s=>"id"in s&&s.id!=="unassign-micro-key"),u=d.find(s=>"id"in s&&s.id==="unassign-micro-key");return[{id:"assign-micro-key",label:C.workspace_card_assignMicroKey_label(),icon:zr,onClick:()=>{},selection:"single",submenu:c},...u?[u]:[]]}var Sn=B('<div data-static-position="" role="tooltip"><!></div>'),pa=B('<div role="tooltip"><!></div>');function Rn(a,t){if(new.target)return rt({component:Rn,...a});ot(t,!0);let r=y(t,"id",7),d=y(t,"anchor",7),c=y(t,"position",7,"right"),u=y(t,"absolute",7,!1),s=y(t,"anchorElement",7,null),o=y(t,"staticPosition",7,!1),v=y(t,"class",7,""),_=y(t,"children",7),b=y(t,"onmouseenter",7),A=y(t,"onmouseleave",7),m=y(t,"onfocusin",7),w=y(t,"onfocusout",7);const q=$r(en()+2);tn(q);const V=an(q),F=8,i=4;let p=oe(null),k=oe(""),P=oe(void 0);const U=E(()=>c()==="bottom-right"||c()==="bottom-left"),K=E(()=>c()==="top"),ne=E(()=>o()?"relative":u()?"absolute":"fixed"),Le=E(()=>c()==="right"?{x:-4,y:0}:c()==="bottom"?{x:4,y:0}:e(K)?{x:0,y:4}:{x:0,y:-4});function le(h,g,J){return Math.max(g,Math.min(J,h))}let ie=null,ge=null;function _e(){return!ie?.isConnected||ge!==d()?!1:ie.style.getPropertyValue("anchor-name").includes(d())||getComputedStyle(ie).getPropertyValue("anchor-name").includes(d())}function Ge(){return s()?s():(_e()||(ie=Array.from(document.querySelectorAll('[style*="anchor-name"]')).find(h=>{const g=h.style.getPropertyValue("anchor-name"),J=getComputedStyle(h).getPropertyValue("anchor-name");return g.includes(d())||J.includes(d())})??null,ge=ie?d():null),ie)}function I(){if(o()||u()||!e(p))return;const h=Ge();if(!h)return;const g=h.getBoundingClientRect(),J=e(p).getBoundingClientRect(),D=window.innerWidth||document.documentElement.clientWidth,ae=window.innerHeight||document.documentElement.clientHeight,ue=J.width||e(p).offsetWidth,j=J.height||e(p).offsetHeight,Ie=Math.max(0,g.top-i-F),Fe=Math.max(0,ae-g.bottom-i-F),De=e(K)?!(Ie<j&&Fe>Ie):e(U)&&Fe<j&&Ie>Fe;let l=g.left,M=g.bottom+i,L=De?Ie:Fe;if(c()==="right"){const Q=g.left-i-F,ye=D-g.right-i-F;l=ye>=ue||ye>=Q?g.right+i:g.left-ue-i,M=g.top,L=Math.max(0,ae-F*2)}else c()==="bottom"?(l=g.left-ue-i,M=g.bottom-j):(e(K)||e(U))&&(c()==="bottom-left"?l=g.right-ue:e(K)&&(l=g.left+g.width/2-ue/2),M=De?g.top-Math.min(j,L)-i:g.bottom+i);l=le(l,F,Math.max(F,D-ue-F)),M=le(M,F,Math.max(F,ae-Math.min(j,L)-F)),O(P,`${L}px`),O(k,`left: ${l}px; top: ${M}px;`)}let ee=!1;async function Re(){ee||(ee=!0,await ja(),ee=!1,I())}let ve=null;function ce(){ve||(ve=Xr(()=>{ve=null,I()}))}function ke(h){const g=s()??(_e()?ie:null);g&&h.target instanceof Node&&!h.target.contains(g)||ce()}yt(()=>{const h=e(p),g=s();o()||u()||!h||!g||Re()}),ya(()=>{if(o())return;let h=null;return Re().then(()=>{if(!u()&&typeof ResizeObserver<"u"){h=new ResizeObserver(ce),e(p)&&h.observe(e(p));const g=Ge();g&&h.observe(g)}}),window.addEventListener("resize",ce),window.addEventListener("scroll",ke,!0),()=>{h?.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("scroll",ke,!0),ve?.(),ve=null}});var We={get id(){return r()},set id(h){r(h),x()},get anchor(){return d()},set anchor(h){d(h),x()},get position(){return c()},set position(h="right"){c(h),x()},get absolute(){return u()},set absolute(h=!1){u(h),x()},get anchorElement(){return s()},set anchorElement(h=null){s(h),x()},get staticPosition(){return o()},set staticPosition(h=!1){o(h),x()},get class(){return v()},set class(h=""){v(h),x()},get children(){return _()},set children(h){_(h),x()},get onmouseenter(){return b()},set onmouseenter(h){b(h),x()},get onmouseleave(){return A()},set onmouseleave(h){A(h),x()},get onfocusin(){return m()},set onfocusin(h){m(h),x()},get onfocusout(){return w()},set onfocusout(h){w(h),x()},$set:nt,$on:(h,g)=>st(t,h,g)},de=xt(),Ze=Ee(de);{var Te=h=>{var g=Sn(),J=N(g);Rt(J,()=>_()??Ot),T(g),at(g,D=>O(p,D),()=>e(p)),X(()=>{$(g,"id",r()),Pe(g,1,e(ne)+` z-50 w-64 flex flex-col overflow-y-auto border border-border pointer-events-auto ${V} `+v()),$(g,"data-surface-level",q)}),W(h,g)},se=h=>{var g=pa();let J;var D=N(g);Rt(D,()=>_()??Ot),T(g),at(g,ae=>O(p,ae),()=>e(p)),X(()=>{$(g,"id",r()),Pe(g,1,e(ne)+` z-50 w-64 flex flex-col border border-border pointer-events-none ${V} `+v()),$(g,"data-surface-level",q),J=pt(g,"",J,{"position-anchor":d(),right:c()==="bottom"?"anchor(left)":void 0,left:c()==="right"?"anchor(right)":e(U)?"anchor(left)":e(K)?"anchor(center)":void 0,top:c()==="right"?"anchor(top)":e(U)?"anchor(bottom)":void 0,bottom:c()==="bottom"?"anchor(bottom)":e(K)?"anchor(top)":void 0,"margin-right":c()==="bottom"?"8px":void 0,"margin-left":c()==="right"?"8px":void 0,"margin-top":e(U)?"4px":void 0,"margin-bottom":e(K)?"4px":void 0,translate:e(K)?"-50% 0":void 0})}),Be("mouseenter",g,function(...ae){b()?.apply(this,ae)}),Be("mouseleave",g,function(...ae){A()?.apply(this,ae)}),Se("focusin",g,function(...ae){m()?.apply(this,ae)}),Se("focusout",g,function(...ae){w()?.apply(this,ae)}),Ct(1,g,()=>$t,()=>({tier:"fast",...e(Le),scale:.96})),Ct(2,g,()=>ea,()=>({tier:"fast"})),W(h,g)},qe=h=>{br(h,{zIndex:50,children:(g,J)=>{var D=pa();let ae;var ue=N(D);Rt(ue,()=>_()??Ot),T(D),at(D,j=>O(p,j),()=>e(p)),X(()=>{$(D,"id",r()),Pe(D,1,e(ne)+` z-50 w-64 flex flex-col overflow-y-auto border border-border pointer-events-auto ${V} `+v()),$(D,"data-surface-level",q),ae=pt(D,e(k),ae,{"max-height":e(P)})}),Be("mouseenter",D,function(...j){b()?.apply(this,j)}),Be("mouseleave",D,function(...j){A()?.apply(this,j)}),Se("focusin",D,function(...j){m()?.apply(this,j)}),Se("focusout",D,function(...j){w()?.apply(this,j)}),Ct(1,D,()=>$t,()=>({tier:"fast",...e(Le),scale:.96})),Ct(2,D,()=>ea,()=>({tier:"fast"})),W(g,D)},$$slots:{default:!0}})};re(Ze,h=>{o()?h(Te):u()?h(se,1):h(qe,-1)})}return W(a,de),it(We)}xa(["focusin","focusout"]);function kt(a,t){return t||/^(?:https?:|data:|blob:|workspace-asset:)/i.test(a.trim())}function En(a,t){if(t||!a)return a;const r=document.createElement("template");r.innerHTML=a;for(const d of r.content.querySelectorAll("img, video")){const c=d.getAttribute("src")||d.getAttribute("data-media-src")||"",u=[...d.querySelectorAll("source")];if(!kt(c,!1)||u.some(o=>!kt(o.getAttribute("src")||"",!1))){const o=document.createElement("img");o.setAttribute("alt",d.getAttribute("alt")||d.getAttribute("data-name")||""),o.setAttribute("data-media-unavailable","node-owned"),d.replaceWith(o);continue}d.removeAttribute("srcset");const s=d.getAttribute("poster");s&&!kt(s,!1)&&d.removeAttribute("poster")}return r.innerHTML}const Pn=[/(^|[^\\])\$(?!\$)(?=\S)(?:\\.|[^\\$\n])+?\$(?!\$)/,/(^|[^\\])\\\((?:\\.|[^\\\n])*?\\\)/,/^(?: {0,3})(?:\$\$|\\\[)/m,/^\s*[-*]\s*\[[ x]\]/m,/```/,/`[^`]+`/,/\|.*\|/,/\[.*\]\(.*\)/,/!\[.*\]\(.*\)/,/<[a-z][\s\S]*>/i,/^#{1,6}\s/m,/^\s*>\s/m,/\*\*[^*]+\*\*/,/\*[^*]+\*/,/_[^_]+_/,/~~[^~]+~~/,/^[-*_]{3,}\s*$/m,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m];function Tn(a){return a&&(Pn.some(t=>t.test(a))||or(a,"markdown"))?"static":"simple"}var Fn=B("<!> <!>",1);function Ta(a,t){if(new.target)return rt({component:Ta,...a});ot(t,!0);let r=y(t,"workspaceId",7),d=y(t,"canUseMedia",7),c=oe(null),u=oe(null),s=oe(!1),o=oe(!1);function v(k){O(c,{url:k.getAttribute("src")||"",name:k.getAttribute("alt")||void 0,opener:k},!0),O(s,!0)}function _(k){const P=na(k.getAttribute("href")||"",r());return P&&d()(P)?(O(c,{url:P,name:k.textContent?.trim()||void 0,opener:k,assetLink:!0},!0),O(s,!0),!0):b(k)}function b(k){const P=_t(k.getAttribute("href")||"",r());return!P||!d()(P.url)?!1:(O(u,{url:P.url,mimeType:P.mimeType,name:k.textContent?.trim()||void 0,opener:k},!0),O(o,!0),!0)}yt(()=>{e(u)&&!_t(e(u).url,r())&&(O(o,!1),O(u,null)),e(c)?.assetLink&&!na(e(c).url,r())&&(O(s,!1),O(c,null))});var A={openImage:v,openAsset:_,get workspaceId(){return r()},set workspaceId(k){r(k),x()},get canUseMedia(){return d()},set canUseMedia(k){d(k),x()},$set:nt,$on:(k,P)=>st(t,k,P)},m=Fn(),w=Ee(m);{var q=k=>{ur(k,{get imageUrl(){return e(c).url},get imageName(){return e(c).name},get openerElement(){return e(c).opener},showActionsMenu:!0,get open(){return e(s)},set open(P){O(s,P,!0)}})},V=E(()=>e(c)&&d()(e(c).url));re(w,k=>{e(V)&&k(q)})}var F=z(w,2);{var i=k=>{Ia(k,{get videoUrl(){return e(u).url},get videoName(){return e(u).name},get mimeType(){return e(u).mimeType},sourceKind:"workspace",get openerElement(){return e(u).opener},get open(){return e(o)},set open(P){O(o,P,!0)}})},p=E(()=>e(u)&&_t(e(u).url,r())&&d()(e(u).url));re(F,k=>{e(p)&&k(i)})}return W(a,m),it(A)}var Ln=B('<div class="flex items-center gap-2"><!> <!></div>'),Wn=Ga('<svg viewBox="0 0 24 24" class="size-10" fill="none"><rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect><path d="m10 9 5 3-5 3V9Z" fill="currentColor"></path></svg>'),Nn=B('<div class="absolute inset-0 flex items-center justify-center bg-muted text-muted-foreground" aria-hidden="true"><!></div> <video preload="metadata" playsinline="" tabindex="-1" aria-hidden="true"></video> <span class="absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20 motion-reduce:transition-none forced-colors:bg-transparent" aria-hidden="true"><span><svg viewBox="0 0 20 20" fill="currentColor"><path d="m7 5 7 5-7 5V5Z"></path></svg></span></span>',3),Hn=B("<div><!> <!></div>"),On=B('<div class="my-2 min-w-0 max-w-2xl" data-chat-video=""><!></div> <!>',1);function Fa(a,t){if(new.target)return rt({component:Fa,...a});ot(t,!0);let r=y(t,"source",7),d=y(t,"name",23,()=>C.chat_videoBlock_fromAgent_label()),c=y(t,"poster",7),u=y(t,"allowFileMedia",7,!0),s=y(t,"canOpenFile",7),o=y(t,"fluid",7,!1),v=y(t,"compact",7,!1),_=y(t,"compactPreview",7),b=oe(!1),A=oe(!1),m=oe(!1),w=oe(null);const q=E(()=>r().kind==="inline"?`data:${r().mimeType};base64,${r().data}`:r().url);function V(I){return kt(I,u()&&s()?.()!==!1)}const F=E(()=>!V(e(q))),i=E(()=>At(e(q))),p=E(()=>{if(!(!c()||!V(c()))){if(/^data:image\/(?:gif|jpeg|png|webp);base64,[a-z0-9+/=]+$/i.test(c()))return c();try{const I=new URL(c());return(I.protocol==="https:"||I.protocol==="workspace-file:")&&!I.username&&!I.password?c():void 0}catch{return}}});function k(){O(A,!0),O(m,!1)}var P={get source(){return r()},set source(I){r(I),x()},get name(){return d()},set name(I=C.chat_videoBlock_fromAgent_label()){d(I),x()},get poster(){return c()},set poster(I){c(I),x()},get allowFileMedia(){return u()},set allowFileMedia(I=!0){u(I),x()},get canOpenFile(){return s()},set canOpenFile(I){s(I),x()},get fluid(){return o()},set fluid(I=!1){o(I),x()},get compact(){return v()},set compact(I=!1){v(I),x()},get compactPreview(){return _()},set compactPreview(I){_(I),x()},$set:nt,$on:(I,ee)=>st(t,I,ee)},U=On(),K=Ee(U);let ne;var Le=N(K);{var le=I=>{Vt(I,{get name(){return d()},reason:"load-failed"})},ie=I=>{var ee=Ln(),Re=N(ee);{let ce=E(()=>e(i)?.path),ke=E(()=>e(i)?.workspaceId);Vt(Re,{get name(){return d()},reason:"load-failed",get path(){return e(ce)},get workspaceId(){return e(ke)}})}var ve=z(Re,2);Kt(ve,{get videoUrl(){return e(q)},get videoName(){return d()},get sourceKind(){return r().kind},get mimeType(){return r().mimeType}}),T(ee),W(I,ee)},ge=I=>{var ee=Hn();let Re;var ve=N(ee);{let We=E(()=>C.chat_videoBlock_play_ariaLabel({name:d()}));jt(ve,{wrapContent:!1,type:"button",variant:"ghost",size:"default",class:"relative block size-full cursor-pointer overflow-hidden rounded-lg border border-border bg-muted/40 p-0 shadow-(--elevation-raised) focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 forced-colors:border",get"aria-label"(){return e(We)},"data-testid":"chat-video-snapshot",onclick:()=>{V(e(q))&&O(b,!0)},get ref(){return e(w)},set ref(de){O(w,de,!0)},children:(de,Ze)=>{var Te=xt(),se=Ee(Te);{var qe=g=>{var J=xt(),D=Ee(J);Rt(D,_),W(g,J)},h=g=>{var J=Nn(),D=Ee(J),ae=N(D);{var ue=l=>{var M=Wn();W(l,M)};re(ae,l=>{o()||l(ue)})}T(D);var j=z(D,2);j.muted=!0;var Ie=z(j,2),Fe=N(Ie),De=me(Fe);T(Ie),X(()=>{$(j,"src",e(q)),$(j,"poster",e(p)),Pe(j,1,`pointer-events-none absolute inset-0 size-full object-contain transition-opacity motion-reduce:transition-none ${e(p)||e(A)&&!e(m)?"opacity-100":"opacity-0"}`),Pe(Fe,1,`flex ${v()?"size-6":"size-11"} shrink-0 aspect-square items-center justify-center rounded-full border border-white/70 bg-black/60 text-white shadow-(--elevation-raised) forced-colors:border forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]`),Pe(De,0,`ml-0.5 ${v()?"size-3":"size-5"}`)}),Be("loadeddata",j,k),Be("error",j,()=>O(m,!0)),W(g,J)};re(se,g=>{_()?g(qe):g(h,-1)})}W(de,Te)},$$slots:{default:!0}})}var ce=z(ve,2);{var ke=We=>{Kt(We,{get videoUrl(){return e(q)},get videoName(){return d()},get sourceKind(){return r().kind},get mimeType(){return r().mimeType},triggerClass:"absolute right-1.5 top-1.5 opacity-0 transition-opacity focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100"})};re(ce,We=>{_()||We(ke)})}T(ee),X(()=>{Pe(ee,1,`group relative aspect-video w-full max-w-2xl ${o()?"max-h-72":"max-h-40"}`),Re=pt(ee,"",Re,{height:_()?"100%":void 0,width:o()?"min(100%, calc(18rem * 16 / 9))":"min(100%, calc(10rem * 16 / 9))"})}),W(I,ee)};re(Le,I=>{e(F)?I(le):e(m)?I(ie,1):I(ge,-1)})}T(K);var _e=z(K,2);{var Ge=I=>{Ia(I,{get videoUrl(){return e(q)},get videoName(){return d()},get poster(){return e(p)},get sourceKind(){return r().kind},get mimeType(){return r().mimeType},get openerElement(){return e(w)},get open(){return e(b)},set open(ee){O(b,ee,!0)}})};re(_e,I=>{!e(m)&&!e(F)&&I(Ge)})}return X(()=>ne=pt(K,"",ne,{height:_()?"100%":void 0})),W(a,U),it(P)}const qn=/^\s*!\[([^\]\n]*)\]\((?:<)?((?:intent:\/\/local\/|workspace-file:\/\/|workspace-asset:\/\/)[^)\s>]+)(?:>)?\)\s*$/,Dn=/^ {0,3}(`{3,}|~{3,})(.*)$/;function ma(a,t){if(typeof a!="string"||!a||a!==a.trim())return null;if(a.startsWith("workspace-asset://"))return _t(a,t);if(a.startsWith("workspace-file://")){const d=At(a);if(!d||d.workspaceId!==t)return null;const c=Sa(a);return c?la(c,t):null}const r=a.startsWith("intent://")?a:`intent://local/file/${a}`;return la(r,t)}function zn(a,t){if(a.startsWith("workspace-file://")){const r=At(a);if(!r||r.workspaceId!==t)return!1;const d=Sa(a);return!!d&&!!Et(d,t)}return!!Et(a,t,{readOnly:!0})}function Un(a,t){return(t===0||!a[t-1].trim())&&(t===a.length-1||!a[t+1].trim())}function Bn(a,t,r){const d=r[0];return a.findIndex((c,u)=>{if(u<=t)return!1;const s=c.trim();return s.length>=r.length&&s.split("").every(o=>o===d)})}function Vn(a,t){const r=a.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/C917cXWW.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/O1QHAURn.js","/app/immutable/chunks/BBDxUL80.js","/app/immutable/chunks/haHmm526.js","/app/immutable/chunks/BkT9o_nd.js","/app/immutable/chunks/CAyg2ijY.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/DNqM68dO.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BUzdsYyD.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CovkQMd0.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/CR_t_AVn.js","/app/immutable/chunks/C2mPABxH.js","/app/immutable/chunks/4kJJ0Qm4.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BV0i7JjW.js","/app/immutable/chunks/BH3LKWph.js","/app/immutable/chunks/DV9nY0bt.js","/app/immutable/chunks/CWDPeeaf.js","/app/immutable/chunks/B0f-om7y.js","/app/immutable/chunks/BgCTNfXj.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/CqO6BKca.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/BsieX9dN.js","/app/immutable/assets/observe-overflow.CbDLK6fN.css","/app/immutable/chunks/BViMgwIT.js","/app/immutable/chunks/DEEBY1o3.js","/app/immutable/chunks/CQkmEJ54.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/BeP4UORy.js","/app/immutable/chunks/CerLhVOI.js","/app/immutable/chunks/B1mZq3ve.js","/app/immutable/assets/SettingsPage.D8u26cHZ.css","/app/immutable/chunks/DwupWOJr.js","/app/immutable/chunks/Drd3_KgI.js","/app/immutable/chunks/CC7to1B5.js","/app/immutable/chunks/B6kyqBFl.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/CkS58pW_.js","/app/immutable/chunks/VZEkDWIM.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/xEfOpOba.js","/app/immutable/chunks/RoOfSbrC.js","/app/immutable/chunks/Csj7SEat.js","/app/immutable/chunks/DrbtWgvN.js","/app/immutable/chunks/BVs4aETe.js","/app/immutable/chunks/BgLcfABG.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/Cdwev8lm.js","/app/immutable/chunks/BOWJTwZ4.js","/app/immutable/chunks/DdAYpf2o.js","/app/immutable/chunks/DCy7s0NX.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/BKJ8oZUz.js","/app/immutable/assets/directory-picker-service.CzNEA6Ot.css","/app/immutable/chunks/oh9nhT2f.js","/app/immutable/chunks/BXNjGjOh.js","/app/immutable/chunks/vBH-DCjX.js","/app/immutable/chunks/BV3MrUXO.js","/app/immutable/chunks/DRjQ_WEk.js","/app/immutable/chunks/BrRMJbsZ.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/lkH5RFQO.js","/app/immutable/chunks/DlwwHsb5.js","/app/immutable/assets/AttachmentPreview.BCSCCZGm.css","/app/immutable/assets/DiagramPresentation.Bfi3xHm0.css","/app/immutable/chunks/B906VD80.js","/app/immutable/assets/StreamingDiagramRenderer.BShsSvPz.css"])))=>i.map(i=>d[i]);
2
+ var Ua=Object.defineProperty;var Ba=(a,t,r)=>t in a?Ua(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r;var dt=(a,t,r)=>Ba(a,typeof t!="symbol"?t+"":t,r);import{bp as C,t as rt,br as y,a_ as re,bz as nt,b as st,bt as Va,bv as Jt,_ as ka}from"./O1QHAURn.js";import{bs as ot,a5 as N,aD as e,bA as T,b_ as X,W,bn as it,c9 as E,aA as x,aB as B,ca as yt,bk as ya,c6 as Ka,cd as Ht,bV as oe,bS as z,ay as Ee,bl as me,bO as be,ai as xa,a7 as xt,c0 as ja,bf as Ot,bH as O,aw as Be,aj as Se,aC as Ga,c3 as ft,bb as St,aF as Ya,br as Za,bj as Ja}from"./DYhIMPy1.js";import{j as Qa,l as Xa,v as Pe,w as pt,u as $,g as tt,n as Ut,p as $a}from"./CAyg2ijY.js";import{aO as er,cY as tr,M as ar,aw as rr,dm as nr,W as sr,dr as Aa,C as or,a0 as ir}from"./VZEkDWIM.js";import{t as Bt}from"./CWDPeeaf.js";import{a9 as cr,ao as lr,A as dr,n as ur,a5 as Ia,s as Vt,a4 as Kt,aJ as At,b5 as Ma,m as fr,aL as pr,b4 as mr}from"./BrRMJbsZ.js";import{l as Qt}from"./B9Ac9NPe.js";import{bV as gr,bS as vr,bT as Xt,aB as hr}from"./DrbtWgvN.js";import{t as ut,P as br}from"./DV9nY0bt.js";import{f as jt,bc as qt}from"./CR_t_AVn.js";import{t as Ve,v as wr,I as Ct,F as $t,c as ea}from"./BkT9o_nd.js";import{ry as Ca,Ix as we,mq as _r,fF as kr,nk as yr,ul as xr,a as Ar,vX as Ir,t0 as Mr,rg as Cr,g as Sr,be as ta,v2 as Rr,sH as Er,v4 as Pr}from"./DNqM68dO.js";import{c as Tr,l as bt}from"./ChTqQfQN.js";import{o as Fr}from"./BKJ8oZUz.js";import{aN as Lr,aO as aa,by as Wr,ax as Nr,bx as Hr,aC as Or,c_ as qr,cO as Dr,F as wt,au as ra,bG as zr,bB as Ur}from"./B0f-om7y.js";import{l as Br}from"./BVs4aETe.js";import{p as Vr,c_ as _t,cZ as na,ao as Kr,d0 as Sa,a8 as Et,aE as Ra,aV as jr,aw as Gr,a7 as sa,r as Yr,aM as Zr,aR as Jr,F as Qr}from"./vBH-DCjX.js";import{s as Rt}from"./BBDxUL80.js";import{b as at}from"./BaIAhI85.js";import{s as Xr}from"./BsieX9dN.js";import{c as $r,u as en,s as tn,a as an}from"./DfxQWSVU.js";import{z as oa,x as ia}from"./C917cXWW.js";import{g as ca}from"./haHmm526.js";import{n as la}from"./BV3MrUXO.js";const rn=new Set(["failed","blocked","needs_attention","in_progress"]),nn={failed:{visual:"icon",icon:Dr,className:"text-foreground"},blocked:{visual:"icon",icon:qr,className:"text-danger"},needs_attention:{visual:"icon",icon:Or,className:"text-warning-ink"},in_progress:{visual:"dot",icon:null,className:"workspace-status-color-active"},waiting:{visual:"icon",icon:Hr,className:"text-muted-foreground"},unread:{visual:"dot",icon:null,className:"workspace-status-color-unread"},not_started:{visual:"dot",icon:null,className:"text-muted-foreground/35"},idle:{visual:"dot",icon:null,className:"text-muted-foreground/35"},complete:{visual:"icon",icon:Nr,className:"text-success"},pr_queued:{visual:"icon",icon:Wr,className:"text-info"},pr_ready:{visual:"icon",icon:aa,className:"text-success"},pr_open:{visual:"icon",icon:aa,className:"text-info"},pr_merged:{visual:"icon",icon:Lr,className:"text-purple-500"}};function sn(a){switch(a){case"failed":return C.workspace_statusIcon_failed_label();case"blocked":return C.workspace_statusIcon_blocked_label();case"needs_attention":return C.workspace_statusIcon_needsAttention_label();case"in_progress":return C.workspace_statusIcon_inProgress_label();case"waiting":return C.workspace_taskStatus_waiting_label();case"unread":return C.layout_activeCard_unread_header();case"not_started":return C.workspace_statusIcon_notStarted_label();case"idle":return C.workspace_statusIcon_idle_label();case"complete":return C.workspace_statusIcon_complete_label();case"pr_queued":return C.workspace_statusIcon_prQueued_label();case"pr_ready":return C.workspace_statusIcon_prReady_label();case"pr_open":return C.workspace_statusIcon_prOpen_label();case"pr_merged":return C.workspace_statusIcon_prMerged_label()}}function on(a){const t=Ca(a.displayStatus)?a.displayStatus:"not_started";return rn.has(t)?t:a.attention==="unread"?"unread":a.waiting===!0?"waiting":t}function Ea(a){const t=a==="waiting"||a==="unread"||Ca(a)?a:"not_started",r=sn(t);return{state:t,...nn[t],label:r,tooltip:r,accessibleName:r}}var cn=B('<span class="workspace-status-dot svelte-14zk5l0" data-workspace-status-dot=""></span>'),ln=B("<span><!></span>");function Pa(a,t){if(new.target)return rt({component:Pa,...a});ot(t,!0);let r=y(t,"status",7),d=y(t,"size",7,14),c=y(t,"decorative",7,!1),u=y(t,"class",7);const s=E(()=>Ea(r()));var o={get status(){return r()},set status(m){r(m),x()},get size(){return d()},set size(m=14){d(m),x()},get decorative(){return c()},set decorative(m=!1){c(m),x()},get class(){return u()},set class(m){u(m),x()},$set:nt,$on:(m,w)=>st(t,m,w)},v=ln(),_=N(v);{var b=m=>{var w=cn();W(m,w)},A=m=>{wt(m,{get icon(){return e(s).icon},class:"size-full!"})};re(_,m=>{e(s).visual==="dot"?m(b):e(s).icon&&m(A,1)})}return T(v),X(m=>{Pe(v,1,m,"svelte-14zk5l0"),pt(v,`width: ${d()??""}px; height: ${d()??""}px;`),$(v,"role",c()?void 0:"img"),$(v,"aria-label",c()?void 0:e(s).accessibleName),$(v,"aria-hidden",c()?"true":void 0),$(v,"title",c()?void 0:e(s).tooltip),$(v,"data-workspace-status",e(s).state),$(v,"data-workspace-status-visual",e(s).visual),$(v,"data-workspace-status-icon",e(s).icon?.iconName)},[()=>Qa(Xa("workspace-status-icon inline-flex shrink-0 items-center justify-center forced-colors:text-[CanvasText]",e(s).className,u()))]),W(a,v),it(o)}const Gt=6e4,Yt=60*Gt,Zt=24*Yt,da=30*Zt;function dn(a,t=new Date){if(a==null)return null;const r=a instanceof Date?a:new Date(a),d=r.getTime(),c=t.getTime();if(!Number.isFinite(d)||!Number.isFinite(c))return null;const u=Math.max(0,c-d);let s;u<Gt?s="<1m":u<Yt?s=`${Ve(Math.floor(u/Gt))}m`:u<Zt?s=`${Ve(Math.floor(u/Yt))}h`:u<da?s=`${Ve(Math.floor(u/Zt))}d`:s=`${Ve(Math.floor(u/da))}mo`;const o=d>c?t:r,v=wr(o,{now:t});return v?{compact:s,accessible:v,dateTime:r.toISOString()}:null}var un=B('<div><div class="grid gap-0.5 px-5 pt-4"><div class="flex min-w-0 items-center justify-between gap-3"><!> <!></div> <!> <!></div> <div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><div class="grid" data-workspace-hover-card-activity=""><!></div> <div class="pull-requests grid" data-workspace-hover-card-pr-column=""><!></div></div></div>'),fn=B('<p class="type-caption mt-1 min-w-0 line-clamp-3 text-muted-foreground" data-workspace-hover-card-summary=""> </p>'),pn=B('<span class="shrink-0 text-muted-foreground" data-workspace-hover-card-question-meta=""><span aria-hidden="true"> </span></span>'),mn=B('<span class="row-span-2 flex h-(--text-caption-line-height) items-center" aria-hidden="true"><!></span><span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-agent-name=""> </span><time class="type-caption whitespace-nowrap text-muted-foreground" data-workspace-hover-card-agent-time=""> </time> <span class="agent-detail type-caption flex min-w-0 items-start gap-1.5 text-muted-foreground svelte-1vax087" data-workspace-hover-card-agent-detail=""><span class="min-w-0 truncate" data-workspace-hover-card-agent-context=""> </span><!></span>',1),ua=B('<div role="listitem"><!></div>'),gn=B('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-overflow=""><span> </span> <!></div>'),vn=B('<section class="activity min-w-0" data-workspace-hover-card-activity="" data-workspace-hover-card-agent-table=""><div class="-mx-2 grid gap-2" role="list"></div> <!></section>'),hn=B('<!> <span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-pr-title=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-status=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-number=""> </span>',1),bn=B('<div class="grid w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center gap-x-2 rounded-sm px-2 py-0 text-left" data-workspace-hover-card-pr-row=""><!></div>'),wn=B('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-pr-overflow=""><span> </span> <!></div>'),_n=B('<section class="pull-requests min-w-0" data-workspace-hover-card-pr-column=""><div class="-mx-2 grid min-w-0 gap-2" role="list" data-workspace-hover-card-pr-list=""></div> <!></section>'),kn=B('<div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><!> <!></div>',1),yn=B('<header data-workspace-hover-card-header=""><div class="min-w-0" data-workspace-hover-card-identity=""><div class="flex min-w-0 items-center justify-between gap-3"><h2 class="type-body min-w-0 truncate font-medium text-foreground" data-workspace-hover-card-title=""> </h2> <span class="type-caption flex shrink-0 items-center gap-1.5 text-muted-foreground" data-workspace-hover-card-status=""><span class="truncate" data-workspace-hover-card-status-label=""> </span><!></span></div> <div class="type-caption mt-0.5 min-w-0 truncate text-muted-foreground" data-workspace-hover-card-repo=""> </div> <!></div></header> <!>',1),xn=B('<section class="workspace-hover-card shrink-0 overflow-hidden rounded-md bg-background text-left text-foreground shadow-(--elevation-overlay) ring-1 ring-border svelte-1vax087" data-workspace-hover-card="" data-workspace-hover-card-layout="landscape"><!></section>');function An(a,t){if(new.target)return rt({component:An,...a});ot(t,!0);const r=()=>Jt(F,"$workspaceAgents$",c),d=()=>Jt(i,"$prMonitors$",c),[c,u]=Va(),s=Tr("WorkspaceHoverCard");let o=y(t,"workspace",7),v=y(t,"isLoading",7,!1),_=y(t,"activeAgentIds",23,()=>[]),b=y(t,"loadAgentSessions",7,!0),A=y(t,"onkeydown",7),m=y(t,"staticData",7,!1);const w=Ht("");function q(){return m()?Ht([]):er(w)}function V(){return m()?Ht([]):tr(w)}const F=q(),i=V();yt(()=>w.set(o()?.id??""));let p=oe(0);ya(()=>Qt.subscribe(()=>Ka(p)));let k=E(()=>o()?.agentSummary?.agentIds??[]),P=E(()=>(e(p),o()?Qt.getStreamingAgentIdsForWorkspace(o().id):[])),U=null,K=new Set;yt(()=>{if(!o()||!b())return;const l=String(o().id);U!==l&&(U=l,K=new Set);for(const M of new Set([...e(k).slice(0,6),..._(),...e(P)]))K.has(M)||(we.dispatch(_r(l,M)),K.add(M))});function ne(l){return[l.name,l.context,l.questionMeta?.accessible,l.updated.accessible].filter(Boolean).join(". ")}function Le(l){return l?l.kind==="attention"?l.attention.reason?.trim()||null:"text"in l&&l.text.trim()||null:null}function le(l){return dn(l.lastActivity||l.updatedAt||l.createdAt)??{compact:"—",accessible:C.workspace_hoverCard_noRecentActivity_label()}}function ie(l){const M=String(l.status).toLowerCase(),L=yr(l),Q=lr(l),ye=Q==="question"?gr(l):null,he=Le(rr.select(we.state,String(l.id)));let xe,Ne,Ae,n,f,H,S=!1;if(Q==="question"){xe="attention",Ne="question",Ae=ye?.questions[0]?.question.trim()||he||C.workspace_hoverCard_question_label(),n="question",f=1;const G=ye?.questions.length??0;G>1&&(H={compact:`${Ve(1)}/${Ve(G)}`,accessible:C.chat_questionWizard_stepCounter_label({current:1,total:G})})}else if(Q==="attention-discussion")xe="attention",Ne="discussion",Ae=L?.reason?.trim()||C.chat_agentCard_attentionDiscussion_label(),n="attention-discussion",f=1;else if(Q==="attention-blocker"||M==="blocked")xe="attention",Ne="blocker",Ae=L?.reason?.trim()||C.chat_agentCard_attentionBlocker_label(),n="attention-blocker",f=0;else if(l.hasUnread)xe="attention",Ne="unread",Ae=he||C.chat_newMessagesDivider_label(),S=!!he,n="unread",f=2;else if(l.isStreaming||l.isProcessing||_().includes(String(l.id))||e(P).includes(String(l.id))||["active","busy","processing","responding","running","streaming","in_progress"].includes(M))xe="active",Ae=he||C.workspace_devScripts_running_label(),S=!!he,n=l.isProcessing?"responding":"running",f=3;else if(["waiting","pending","queued","starting"].includes(M))xe="waiting",Ae=he||C.workspace_taskStatus_waiting_label(),S=!!he,n="waiting",f=4;else return null;const Y=l.agentMetadata??l.metadata;return{id:String(l.id),name:l.name?.trim()||C.workspace_fileChanges_agent_label(),group:xe,attentionKind:Ne,avatarState:n,specialist:Y?.specialist,context:Ae,questionMeta:H,contextIsPreview:S,updated:le(l),priority:f}}let ge=E(()=>{const l=o()?.agentSummary,M=new Map;if(Array.isArray(l?.agents))for(const L of l.agents)L&&typeof L=="object"&&typeof L.id=="string"&&M.set(L.id,L.parentAgentId);return r().filter(L=>{const Q=M.get(String(L.id));return!(kr(L)!=="topLevel"||typeof Q=="string"&&Q||L.pendingDeleteAt||L.retiredAt||String(L.status).toLowerCase()==="deleted")})}),_e=E(()=>e(ge).map(ie).filter(l=>l!==null).sort((l,M)=>l.priority-M.priority)),Ge=E(()=>e(_e).slice(0,6)),I=E(()=>Math.max(0,e(_e).length-6)),ee=E(()=>o()?.repositoryName?o().repositoryOwner?`${o().repositoryOwner} / ${o().repositoryName}`:o().repositoryName:C.workspace_hoverCard_localRepository_label()),Re=E(()=>on(o()??{})),ve=E(()=>Ea(e(Re))),ce=E(()=>o()?.statusMessage?.trim()||"");function ke(l){if(!l)return null;const M=l.activePullRequest??l.pullRequests?.[0]??null;return M||(l.prStatus?{id:`legacy-pr-${l.prNumber??"workspace"}`,number:l.prNumber??0,url:l.prUrl??"",title:C.workspace_hoverCard_pullRequest_label(),status:l.prStatus,createdAt:l.updatedAt,updatedAt:l.updatedAt}:null)}let We=E(()=>o()?m()?ke(o()):nr.select(we.state,o().id)??ke(o()):null),de=E(()=>{if(!o()||ar(o()))return[];const l=o().repositoryOwner&&o().repositoryName?`${o().repositoryOwner}/${o().repositoryName}`:void 0;return cr({workspacePRs:o().pullRequests,activePR:e(We),monitors:d(),workspaceRepo:l,buildPrUrl:(M,L)=>Vr(M,o().repositoryOwner,o().repositoryName,L),getDisplayTitle:M=>M.title})}),Ze=E(()=>e(de).slice(0,3)),Te=E(()=>Math.max(0,e(de).length-3)),se=E(()=>e(_e).length>0),qe=E(()=>e(de).length>0),h=E(()=>e(se)||e(qe));function g(l){const M=l.resource?.repository.provider==="gitlab"?`${l.repo} !${l.number}`:l.repo?C.workspace_card_prBadge_repoLine_tooltip({repo:l.repo,number:l.number}):C.workspace_card_prBadge_label({number:` #${l.number}`});return[sr(M,l),l.title,l.details].filter(Boolean).join(`
3
+ `)}function J(l,M){if(l.stopPropagation(),!o()||!b())return;const L=o().id;Br.select(we.state)!==L&&Fr(L).catch(Q=>{s.warn("Failed to switch workspace for hover-card agent",{agentId:M,error:Q})}),we.dispatch(xr(L,{agentId:M}))}function D(l,M){if(l.stopPropagation(),!o()||!M.url)return;const L=o().id;ka(async()=>{const{handleLink:Q}=await import("./C917cXWW.js").then(ye=>ye.H);return{handleLink:Q}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65]),import.meta.url).then(({handleLink:Q})=>Q(M.url,{workspaceId:L,event:l}))}var ae={get workspace(){return o()},set workspace(l){o(l),x()},get isLoading(){return v()},set isLoading(l=!1){v(l),x()},get activeAgentIds(){return _()},set activeAgentIds(l=[]){_(l),x()},get loadAgentSessions(){return b()},set loadAgentSessions(l=!0){b(l),x()},get onkeydown(){return A()},set onkeydown(l){A(l),x()},get staticData(){return m()},set staticData(l=!1){m(l),x()},$set:nt,$on:(l,M)=>st(t,l,M)},ue=xn(),j=N(ue);{var Ie=l=>{var M=un(),L=N(M),Q=N(L),ye=N(Q);ut(ye,{class:"h-7 min-w-0 max-w-64 flex-1"});var he=z(ye,2);ut(he,{class:"h-5 w-20 shrink-0"}),T(Q);var xe=z(Q,2);ut(xe,{class:"h-4 w-40"});var Ne=z(xe,2);ut(Ne,{class:"mt-2 h-10 w-full"}),T(L);var Ae=z(L,4),n=N(Ae),f=N(n);ut(f,{class:"h-10 w-full"}),T(n);var H=z(n,2),S=N(H);ut(S,{class:"h-10 w-full"}),T(H),T(Ae),T(M),W(l,M)},Fe=l=>{var M=yn(),L=Ee(M);let Q;var ye=N(L),he=N(ye),xe=N(he),Ne=me(xe,!0),Ae=z(xe,2),n=N(Ae),f=me(n,!0),H=z(n);Pa(H,{get status(){return e(Re)},size:16,decorative:!0}),T(Ae),T(he);var S=z(he,2),Y=me(S,!0),G=z(S,2);{var te=pe=>{var ze=fn(),It=me(ze,!0);tt(ze,(Mt,Pt)=>Bt?.(Mt,Pt),()=>e(ce)),X(()=>be(It,e(ce))),W(pe,ze)};re(G,pe=>{e(ce)&&pe(te)})}T(ye),T(L);var He=z(L,2);{var fe=pe=>{var ze=kn(),It=z(Ee(ze),2),Mt=N(It);{var Pt=Je=>{var Ke=vn(),Ye=N(Ke);Ut(Ye,21,()=>e(Ge),Z=>Z.id,(Z,R)=>{var Me=ua(),Qe=N(Me);{let Xe=E(()=>ne(e(R)));jt(Qe,{variant:"plain",wrapContent:!1,class:"grid h-auto! min-h-8 w-full min-w-0 cursor-pointer grid-cols-[1rem_minmax(0,1fr)_auto] items-start justify-normal gap-x-2 gap-y-0 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return e(Xe)},"data-workspace-hover-card-agent-row":!0,get"data-agent-group-row"(){return e(R).group},get"data-attention-kind"(){return e(R).attentionKind},get onkeydown(){return A()},onclick:je=>J(je,e(R).id),children:(je,mt)=>{var Oe=mn(),Ce=Ee(Oe),Ue=N(Ce);{let et=E(()=>e(R).specialist??null);dr(Ue,{get agentId(){return e(R).id},variant:"compact",get state(){return e(R).avatarState},get specialist(){return e(et)}})}T(Ce);var ct=z(Ce),Lt=me(ct,!0),$e=z(ct),Wt=me($e,!0),gt=z($e,2),vt=N(gt),Nt=me(vt,!0);tt(vt,(et,lt)=>Bt?.(et,lt),()=>e(R).context);var Oa=z(vt);{var qa=et=>{var lt=pn(),Da=N(lt),za=me(Da,!0);T(lt),X(()=>{$(lt,"aria-label",e(R).questionMeta.accessible),be(za,e(R).questionMeta.compact)}),W(et,lt)};re(Oa,et=>{e(R).questionMeta&&et(qa)})}T(gt),X(()=>{be(Lt,e(R).name),$($e,"datetime",e(R).updated.dateTime),$($e,"aria-label",e(R).updated.accessible),be(Wt,e(R).updated.compact),$(gt,"data-workspace-hover-card-agent-preview",e(R).contextIsPreview||void 0),be(Nt,e(R).context)}),W(je,Oe)},$$slots:{default:!0}})}T(Me),W(Z,Me)}),T(Ye);var Tt=z(Ye,2);{var Ft=Z=>{var R=gn(),Me=N(R),Qe=me(Me,!0),Xe=z(Me,2);wt(Xe,{get icon(){return ra},size:10}),T(R),X(je=>be(Qe,je),[()=>C.workspace_hoverCard_moreAgents_label({count:Ve(e(I))})]),W(Z,R)};re(Tt,Z=>{e(I)&&Z(Ft)})}T(Ke),X(Z=>$(Ke,"aria-label",Z),[()=>C.workspace_multiSelectSidebar_agentsTab_label()]),W(Je,Ke)};re(Mt,Je=>{e(se)&&Je(Pt)})}var Na=z(Mt,2);{var Ha=Je=>{var Ke=_n(),Ye=N(Ke);Ut(Ye,21,()=>e(Ze),Z=>Z.identity,(Z,R)=>{var Me=ua();{const mt=Oe=>{var Ce=hn(),Ue=Ee(Ce);wt(Ue,{get icon(){return e(R).statusIcon},size:16,get class(){return`shrink-0 justify-self-start ${e(R).foregroundClass??""}`}});var ct=z(Ue,2),Lt=me(ct,!0),$e=z(ct,2),Wt=me($e,!0),gt=z($e,2),vt=me(gt,!0);X(Nt=>{be(Lt,Nt),be(Wt,e(R).accessibleStateLabel),be(vt,e(R).numberLabel??`#${e(R).number}`)},[()=>e(R).title||(e(R).resource?.repository.provider==="gitlab"?C.workspace_hoverCard_mergeRequest_label():C.workspace_hoverCard_pullRequest_label())]),W(Oe,Ce)};var Qe=N(Me);{var Xe=Oe=>{{let Ce=E(()=>g(e(R)));jt(Oe,{variant:"plain",wrapContent:!1,class:"grid h-auto! w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center justify-normal gap-x-2 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return e(Ce)},"data-workspace-hover-card-pr-row":!0,get"data-pr-identity"(){return e(R).identity},get"data-pr-status"(){return e(R).status},get onkeydown(){return A()},onclick:Ue=>D(Ue,e(R)),children:(Ue,ct)=>{mt(Ue)},$$slots:{default:!0}})}},je=Oe=>{var Ce=bn(),Ue=N(Ce);mt(Ue),T(Ce),X(()=>{$(Ce,"data-pr-identity",e(R).identity),$(Ce,"data-pr-status",e(R).status)}),W(Oe,Ce)};re(Qe,Oe=>{e(R).url?Oe(Xe):Oe(je,-1)})}T(Me)}X(mt=>$(Me,"aria-label",mt),[()=>e(R).url?void 0:g(e(R))]),W(Z,Me)}),T(Ye);var Tt=z(Ye,2);{var Ft=Z=>{var R=wn(),Me=N(R),Qe=me(Me,!0),Xe=z(Me,2);wt(Xe,{get icon(){return ra},size:10}),T(R),X(je=>be(Qe,je),[()=>C.workspace_hoverCard_moreItems_label({count:Ve(e(Te))})]),W(Z,R)};re(Tt,Z=>{e(Te)&&Z(Ft)})}T(Ke),X((Z,R)=>{$(Ke,"aria-label",Z),$(Ye,"aria-label",R)},[()=>e(de).every(Z=>Z.resource?.repository.provider==="gitlab")?C.workspace_hoverCard_mergeRequests_label():e(de).some(Z=>Z.resource?.repository.provider==="gitlab")?C.workspace_hoverCard_reviews_label():C.workspace_hoverCard_pullRequests_label(),()=>e(de).every(Z=>Z.resource?.repository.provider==="gitlab")?C.workspace_hoverCard_mergeRequests_label():e(de).some(Z=>Z.resource?.repository.provider==="gitlab")?C.workspace_hoverCard_reviews_label():C.workspace_hoverCard_pullRequests_label()]),W(Je,Ke)};re(Na,Je=>{e(qe)&&Je(Ha)})}T(It),W(pe,ze)};re(He,pe=>{e(h)&&pe(fe)})}X(pe=>{Q=Pe(L,1,"min-w-0 px-5 pt-4",null,Q,{"pb-4":!e(h)}),be(Ne,pe),be(f,e(ve).label),be(Y,e(ee))},[()=>o().title||C.workspace_links_untitled_label()]),W(l,M)};re(j,l=>{v()||!o()?l(Ie):l(Fe,-1)})}T(ue),W(a,ue);var De=it(ae);return u(),De}const fa=800,Rs=175,In=300;function Mn(){let a=0,t=null;const r=new Set,d=new Set;function c(){return a>0||t!==null?0:fa}function u(){const o=c();r.forEach(v=>v(o))}function s(){t!==null&&(clearTimeout(t),t=null)}return{get currentOpenDelay(){return c()},subscribe(o){return r.add(o),o(c()),()=>r.delete(o)},notifyOpened(){const o=a===0&&t===null;s(),a+=1,o&&u()},notifyClosed(){a!==0&&(a-=1,!(a>0)&&(s(),t=setTimeout(()=>{t=null,u()},In)))},deferClose(o){return d.add(o),()=>d.delete(o)},settleDeferredCloses(){const o=[...d];d.clear(),o.forEach(v=>v())},reset(){const o=c()!==fa;s(),a=0,d.clear(),o&&u()}}}const Es=Mn();function Dt(a){const t=Aa.select(we.state,a);return t!==void 0&&Cr(t)}function Cn(a,t){if(!Dt(a))return[];const r=vr.select(we.state,a),d=Xt.select(we.state,a),c=hr.select(we.state),u=[];for(let s=0;s<Ar;s+=1){const o=c[s],v=o&&o!==a?Aa.select(we.state,o):void 0;u.push({id:`assign-micro-key-${s+1}`,label:v?C.workspace_card_assignOccupiedMicroKey_label({number:Ve(s+1),title:v.title}):C.workspace_card_assignMicroKeyNumber_label({number:Ve(s+1)}),checked:r===s,closeOnSelect:!0,onClick:()=>{Dt(a)&&we.dispatch(Ir(s,a)),t()}})}return d!==null&&(u.push({type:"separator"}),u.push({id:"unassign-micro-key",label:C.workspace_card_unassignMicroKey_label(),onClick:()=>{Dt(a)&&Xt.select(we.state,a)===d&&we.dispatch(Mr(d)),t()}})),u}function Ps(a,{connected:t,onClose:r}){if(!t)return[];const d=Cn(a,r);if(d.length===0)return[];const c=d.filter(s=>"id"in s&&s.id!=="unassign-micro-key"),u=d.find(s=>"id"in s&&s.id==="unassign-micro-key");return[{id:"assign-micro-key",label:C.workspace_card_assignMicroKey_label(),icon:zr,onClick:()=>{},selection:"single",submenu:c},...u?[u]:[]]}var Sn=B('<div data-static-position="" role="tooltip"><!></div>'),pa=B('<div role="tooltip"><!></div>');function Rn(a,t){if(new.target)return rt({component:Rn,...a});ot(t,!0);let r=y(t,"id",7),d=y(t,"anchor",7),c=y(t,"position",7,"right"),u=y(t,"absolute",7,!1),s=y(t,"anchorElement",7,null),o=y(t,"staticPosition",7,!1),v=y(t,"class",7,""),_=y(t,"children",7),b=y(t,"onmouseenter",7),A=y(t,"onmouseleave",7),m=y(t,"onfocusin",7),w=y(t,"onfocusout",7);const q=$r(en()+2);tn(q);const V=an(q),F=8,i=4;let p=oe(null),k=oe(""),P=oe(void 0);const U=E(()=>c()==="bottom-right"||c()==="bottom-left"),K=E(()=>c()==="top"),ne=E(()=>o()?"relative":u()?"absolute":"fixed"),Le=E(()=>c()==="right"?{x:-4,y:0}:c()==="bottom"?{x:4,y:0}:e(K)?{x:0,y:4}:{x:0,y:-4});function le(h,g,J){return Math.max(g,Math.min(J,h))}let ie=null,ge=null;function _e(){return!ie?.isConnected||ge!==d()?!1:ie.style.getPropertyValue("anchor-name").includes(d())||getComputedStyle(ie).getPropertyValue("anchor-name").includes(d())}function Ge(){return s()?s():(_e()||(ie=Array.from(document.querySelectorAll('[style*="anchor-name"]')).find(h=>{const g=h.style.getPropertyValue("anchor-name"),J=getComputedStyle(h).getPropertyValue("anchor-name");return g.includes(d())||J.includes(d())})??null,ge=ie?d():null),ie)}function I(){if(o()||u()||!e(p))return;const h=Ge();if(!h)return;const g=h.getBoundingClientRect(),J=e(p).getBoundingClientRect(),D=window.innerWidth||document.documentElement.clientWidth,ae=window.innerHeight||document.documentElement.clientHeight,ue=J.width||e(p).offsetWidth,j=J.height||e(p).offsetHeight,Ie=Math.max(0,g.top-i-F),Fe=Math.max(0,ae-g.bottom-i-F),De=e(K)?!(Ie<j&&Fe>Ie):e(U)&&Fe<j&&Ie>Fe;let l=g.left,M=g.bottom+i,L=De?Ie:Fe;if(c()==="right"){const Q=g.left-i-F,ye=D-g.right-i-F;l=ye>=ue||ye>=Q?g.right+i:g.left-ue-i,M=g.top,L=Math.max(0,ae-F*2)}else c()==="bottom"?(l=g.left-ue-i,M=g.bottom-j):(e(K)||e(U))&&(c()==="bottom-left"?l=g.right-ue:e(K)&&(l=g.left+g.width/2-ue/2),M=De?g.top-Math.min(j,L)-i:g.bottom+i);l=le(l,F,Math.max(F,D-ue-F)),M=le(M,F,Math.max(F,ae-Math.min(j,L)-F)),O(P,`${L}px`),O(k,`left: ${l}px; top: ${M}px;`)}let ee=!1;async function Re(){ee||(ee=!0,await ja(),ee=!1,I())}let ve=null;function ce(){ve||(ve=Xr(()=>{ve=null,I()}))}function ke(h){const g=s()??(_e()?ie:null);g&&h.target instanceof Node&&!h.target.contains(g)||ce()}yt(()=>{const h=e(p),g=s();o()||u()||!h||!g||Re()}),ya(()=>{if(o())return;let h=null;return Re().then(()=>{if(!u()&&typeof ResizeObserver<"u"){h=new ResizeObserver(ce),e(p)&&h.observe(e(p));const g=Ge();g&&h.observe(g)}}),window.addEventListener("resize",ce),window.addEventListener("scroll",ke,!0),()=>{h?.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("scroll",ke,!0),ve?.(),ve=null}});var We={get id(){return r()},set id(h){r(h),x()},get anchor(){return d()},set anchor(h){d(h),x()},get position(){return c()},set position(h="right"){c(h),x()},get absolute(){return u()},set absolute(h=!1){u(h),x()},get anchorElement(){return s()},set anchorElement(h=null){s(h),x()},get staticPosition(){return o()},set staticPosition(h=!1){o(h),x()},get class(){return v()},set class(h=""){v(h),x()},get children(){return _()},set children(h){_(h),x()},get onmouseenter(){return b()},set onmouseenter(h){b(h),x()},get onmouseleave(){return A()},set onmouseleave(h){A(h),x()},get onfocusin(){return m()},set onfocusin(h){m(h),x()},get onfocusout(){return w()},set onfocusout(h){w(h),x()},$set:nt,$on:(h,g)=>st(t,h,g)},de=xt(),Ze=Ee(de);{var Te=h=>{var g=Sn(),J=N(g);Rt(J,()=>_()??Ot),T(g),at(g,D=>O(p,D),()=>e(p)),X(()=>{$(g,"id",r()),Pe(g,1,e(ne)+` z-50 w-64 flex flex-col overflow-y-auto border border-border pointer-events-auto ${V} `+v()),$(g,"data-surface-level",q)}),W(h,g)},se=h=>{var g=pa();let J;var D=N(g);Rt(D,()=>_()??Ot),T(g),at(g,ae=>O(p,ae),()=>e(p)),X(()=>{$(g,"id",r()),Pe(g,1,e(ne)+` z-50 w-64 flex flex-col border border-border pointer-events-none ${V} `+v()),$(g,"data-surface-level",q),J=pt(g,"",J,{"position-anchor":d(),right:c()==="bottom"?"anchor(left)":void 0,left:c()==="right"?"anchor(right)":e(U)?"anchor(left)":e(K)?"anchor(center)":void 0,top:c()==="right"?"anchor(top)":e(U)?"anchor(bottom)":void 0,bottom:c()==="bottom"?"anchor(bottom)":e(K)?"anchor(top)":void 0,"margin-right":c()==="bottom"?"8px":void 0,"margin-left":c()==="right"?"8px":void 0,"margin-top":e(U)?"4px":void 0,"margin-bottom":e(K)?"4px":void 0,translate:e(K)?"-50% 0":void 0})}),Be("mouseenter",g,function(...ae){b()?.apply(this,ae)}),Be("mouseleave",g,function(...ae){A()?.apply(this,ae)}),Se("focusin",g,function(...ae){m()?.apply(this,ae)}),Se("focusout",g,function(...ae){w()?.apply(this,ae)}),Ct(1,g,()=>$t,()=>({tier:"fast",...e(Le),scale:.96})),Ct(2,g,()=>ea,()=>({tier:"fast"})),W(h,g)},qe=h=>{br(h,{zIndex:50,children:(g,J)=>{var D=pa();let ae;var ue=N(D);Rt(ue,()=>_()??Ot),T(D),at(D,j=>O(p,j),()=>e(p)),X(()=>{$(D,"id",r()),Pe(D,1,e(ne)+` z-50 w-64 flex flex-col overflow-y-auto border border-border pointer-events-auto ${V} `+v()),$(D,"data-surface-level",q),ae=pt(D,e(k),ae,{"max-height":e(P)})}),Be("mouseenter",D,function(...j){b()?.apply(this,j)}),Be("mouseleave",D,function(...j){A()?.apply(this,j)}),Se("focusin",D,function(...j){m()?.apply(this,j)}),Se("focusout",D,function(...j){w()?.apply(this,j)}),Ct(1,D,()=>$t,()=>({tier:"fast",...e(Le),scale:.96})),Ct(2,D,()=>ea,()=>({tier:"fast"})),W(g,D)},$$slots:{default:!0}})};re(Ze,h=>{o()?h(Te):u()?h(se,1):h(qe,-1)})}return W(a,de),it(We)}xa(["focusin","focusout"]);function kt(a,t){return t||/^(?:https?:|data:|blob:|workspace-asset:)/i.test(a.trim())}function En(a,t){if(t||!a)return a;const r=document.createElement("template");r.innerHTML=a;for(const d of r.content.querySelectorAll("img, video")){const c=d.getAttribute("src")||d.getAttribute("data-media-src")||"",u=[...d.querySelectorAll("source")];if(!kt(c,!1)||u.some(o=>!kt(o.getAttribute("src")||"",!1))){const o=document.createElement("img");o.setAttribute("alt",d.getAttribute("alt")||d.getAttribute("data-name")||""),o.setAttribute("data-media-unavailable","node-owned"),d.replaceWith(o);continue}d.removeAttribute("srcset");const s=d.getAttribute("poster");s&&!kt(s,!1)&&d.removeAttribute("poster")}return r.innerHTML}const Pn=[/(^|[^\\])\$(?!\$)(?=\S)(?:\\.|[^\\$\n])+?\$(?!\$)/,/(^|[^\\])\\\((?:\\.|[^\\\n])*?\\\)/,/^(?: {0,3})(?:\$\$|\\\[)/m,/^\s*[-*]\s*\[[ x]\]/m,/```/,/`[^`]+`/,/\|.*\|/,/\[.*\]\(.*\)/,/!\[.*\]\(.*\)/,/<[a-z][\s\S]*>/i,/^#{1,6}\s/m,/^\s*>\s/m,/\*\*[^*]+\*\*/,/\*[^*]+\*/,/_[^_]+_/,/~~[^~]+~~/,/^[-*_]{3,}\s*$/m,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m];function Tn(a){return a&&(Pn.some(t=>t.test(a))||or(a,"markdown"))?"static":"simple"}var Fn=B("<!> <!>",1);function Ta(a,t){if(new.target)return rt({component:Ta,...a});ot(t,!0);let r=y(t,"workspaceId",7),d=y(t,"canUseMedia",7),c=oe(null),u=oe(null),s=oe(!1),o=oe(!1);function v(k){O(c,{url:k.getAttribute("src")||"",name:k.getAttribute("alt")||void 0,opener:k},!0),O(s,!0)}function _(k){const P=na(k.getAttribute("href")||"",r());return P&&d()(P)?(O(c,{url:P,name:k.textContent?.trim()||void 0,opener:k,assetLink:!0},!0),O(s,!0),!0):b(k)}function b(k){const P=_t(k.getAttribute("href")||"",r());return!P||!d()(P.url)?!1:(O(u,{url:P.url,mimeType:P.mimeType,name:k.textContent?.trim()||void 0,opener:k},!0),O(o,!0),!0)}yt(()=>{e(u)&&!_t(e(u).url,r())&&(O(o,!1),O(u,null)),e(c)?.assetLink&&!na(e(c).url,r())&&(O(s,!1),O(c,null))});var A={openImage:v,openAsset:_,get workspaceId(){return r()},set workspaceId(k){r(k),x()},get canUseMedia(){return d()},set canUseMedia(k){d(k),x()},$set:nt,$on:(k,P)=>st(t,k,P)},m=Fn(),w=Ee(m);{var q=k=>{ur(k,{get imageUrl(){return e(c).url},get imageName(){return e(c).name},get openerElement(){return e(c).opener},showActionsMenu:!0,get open(){return e(s)},set open(P){O(s,P,!0)}})},V=E(()=>e(c)&&d()(e(c).url));re(w,k=>{e(V)&&k(q)})}var F=z(w,2);{var i=k=>{Ia(k,{get videoUrl(){return e(u).url},get videoName(){return e(u).name},get mimeType(){return e(u).mimeType},sourceKind:"workspace",get openerElement(){return e(u).opener},get open(){return e(o)},set open(P){O(o,P,!0)}})},p=E(()=>e(u)&&_t(e(u).url,r())&&d()(e(u).url));re(F,k=>{e(p)&&k(i)})}return W(a,m),it(A)}var Ln=B('<div class="flex items-center gap-2"><!> <!></div>'),Wn=Ga('<svg viewBox="0 0 24 24" class="size-10" fill="none"><rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect><path d="m10 9 5 3-5 3V9Z" fill="currentColor"></path></svg>'),Nn=B('<div class="absolute inset-0 flex items-center justify-center bg-muted text-muted-foreground" aria-hidden="true"><!></div> <video preload="metadata" playsinline="" tabindex="-1" aria-hidden="true"></video> <span class="absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20 motion-reduce:transition-none forced-colors:bg-transparent" aria-hidden="true"><span><svg viewBox="0 0 20 20" fill="currentColor"><path d="m7 5 7 5-7 5V5Z"></path></svg></span></span>',3),Hn=B("<div><!> <!></div>"),On=B('<div class="my-2 min-w-0 max-w-2xl" data-chat-video=""><!></div> <!>',1);function Fa(a,t){if(new.target)return rt({component:Fa,...a});ot(t,!0);let r=y(t,"source",7),d=y(t,"name",23,()=>C.chat_videoBlock_fromAgent_label()),c=y(t,"poster",7),u=y(t,"allowFileMedia",7,!0),s=y(t,"canOpenFile",7),o=y(t,"fluid",7,!1),v=y(t,"compact",7,!1),_=y(t,"compactPreview",7),b=oe(!1),A=oe(!1),m=oe(!1),w=oe(null);const q=E(()=>r().kind==="inline"?`data:${r().mimeType};base64,${r().data}`:r().url);function V(I){return kt(I,u()&&s()?.()!==!1)}const F=E(()=>!V(e(q))),i=E(()=>At(e(q))),p=E(()=>{if(!(!c()||!V(c()))){if(/^data:image\/(?:gif|jpeg|png|webp);base64,[a-z0-9+/=]+$/i.test(c()))return c();try{const I=new URL(c());return(I.protocol==="https:"||I.protocol==="workspace-file:")&&!I.username&&!I.password?c():void 0}catch{return}}});function k(){O(A,!0),O(m,!1)}var P={get source(){return r()},set source(I){r(I),x()},get name(){return d()},set name(I=C.chat_videoBlock_fromAgent_label()){d(I),x()},get poster(){return c()},set poster(I){c(I),x()},get allowFileMedia(){return u()},set allowFileMedia(I=!0){u(I),x()},get canOpenFile(){return s()},set canOpenFile(I){s(I),x()},get fluid(){return o()},set fluid(I=!1){o(I),x()},get compact(){return v()},set compact(I=!1){v(I),x()},get compactPreview(){return _()},set compactPreview(I){_(I),x()},$set:nt,$on:(I,ee)=>st(t,I,ee)},U=On(),K=Ee(U);let ne;var Le=N(K);{var le=I=>{Vt(I,{get name(){return d()},reason:"load-failed"})},ie=I=>{var ee=Ln(),Re=N(ee);{let ce=E(()=>e(i)?.path),ke=E(()=>e(i)?.workspaceId);Vt(Re,{get name(){return d()},reason:"load-failed",get path(){return e(ce)},get workspaceId(){return e(ke)}})}var ve=z(Re,2);Kt(ve,{get videoUrl(){return e(q)},get videoName(){return d()},get sourceKind(){return r().kind},get mimeType(){return r().mimeType}}),T(ee),W(I,ee)},ge=I=>{var ee=Hn();let Re;var ve=N(ee);{let We=E(()=>C.chat_videoBlock_play_ariaLabel({name:d()}));jt(ve,{wrapContent:!1,type:"button",variant:"ghost",size:"default",class:"relative block size-full cursor-pointer overflow-hidden rounded-lg border border-border bg-muted/40 p-0 shadow-(--elevation-raised) focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 forced-colors:border",get"aria-label"(){return e(We)},"data-testid":"chat-video-snapshot",onclick:()=>{V(e(q))&&O(b,!0)},get ref(){return e(w)},set ref(de){O(w,de,!0)},children:(de,Ze)=>{var Te=xt(),se=Ee(Te);{var qe=g=>{var J=xt(),D=Ee(J);Rt(D,_),W(g,J)},h=g=>{var J=Nn(),D=Ee(J),ae=N(D);{var ue=l=>{var M=Wn();W(l,M)};re(ae,l=>{o()||l(ue)})}T(D);var j=z(D,2);j.muted=!0;var Ie=z(j,2),Fe=N(Ie),De=me(Fe);T(Ie),X(()=>{$(j,"src",e(q)),$(j,"poster",e(p)),Pe(j,1,`pointer-events-none absolute inset-0 size-full object-contain transition-opacity motion-reduce:transition-none ${e(p)||e(A)&&!e(m)?"opacity-100":"opacity-0"}`),Pe(Fe,1,`flex ${v()?"size-6":"size-11"} shrink-0 aspect-square items-center justify-center rounded-full border border-white/70 bg-black/60 text-white shadow-(--elevation-raised) forced-colors:border forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]`),Pe(De,0,`ml-0.5 ${v()?"size-3":"size-5"}`)}),Be("loadeddata",j,k),Be("error",j,()=>O(m,!0)),W(g,J)};re(se,g=>{_()?g(qe):g(h,-1)})}W(de,Te)},$$slots:{default:!0}})}var ce=z(ve,2);{var ke=We=>{Kt(We,{get videoUrl(){return e(q)},get videoName(){return d()},get sourceKind(){return r().kind},get mimeType(){return r().mimeType},triggerClass:"absolute right-1.5 top-1.5 opacity-0 transition-opacity focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100"})};re(ce,We=>{_()||We(ke)})}T(ee),X(()=>{Pe(ee,1,`group relative aspect-video w-full max-w-2xl ${o()?"max-h-72":"max-h-40"}`),Re=pt(ee,"",Re,{height:_()?"100%":void 0,width:o()?"min(100%, calc(18rem * 16 / 9))":"min(100%, calc(10rem * 16 / 9))"})}),W(I,ee)};re(Le,I=>{e(F)?I(le):e(m)?I(ie,1):I(ge,-1)})}T(K);var _e=z(K,2);{var Ge=I=>{Ia(I,{get videoUrl(){return e(q)},get videoName(){return d()},get poster(){return e(p)},get sourceKind(){return r().kind},get mimeType(){return r().mimeType},get openerElement(){return e(w)},get open(){return e(b)},set open(ee){O(b,ee,!0)}})};re(_e,I=>{!e(m)&&!e(F)&&I(Ge)})}return X(()=>ne=pt(K,"",ne,{height:_()?"100%":void 0})),W(a,U),it(P)}const qn=/^\s*!\[([^\]\n]*)\]\((?:<)?((?:intent:\/\/local\/|workspace-file:\/\/|workspace-asset:\/\/)[^)\s>]+)(?:>)?\)\s*$/,Dn=/^ {0,3}(`{3,}|~{3,})(.*)$/;function ma(a,t){if(typeof a!="string"||!a||a!==a.trim())return null;if(a.startsWith("workspace-asset://"))return _t(a,t);if(a.startsWith("workspace-file://")){const d=At(a);if(!d||d.workspaceId!==t)return null;const c=Sa(a);return c?la(c,t):null}const r=a.startsWith("intent://")?a:`intent://local/file/${a}`;return la(r,t)}function zn(a,t){if(a.startsWith("workspace-file://")){const r=At(a);if(!r||r.workspaceId!==t)return!1;const d=Sa(a);return!!d&&!!Et(d,t)}return!!Et(a,t,{readOnly:!0})}function Un(a,t){return(t===0||!a[t-1].trim())&&(t===a.length-1||!a[t+1].trim())}function Bn(a,t,r){const d=r[0];return a.findIndex((c,u)=>{if(u<=t)return!1;const s=c.trim();return s.length>=r.length&&s.split("").every(o=>o===d)})}function Vn(a,t){const r=a.split(`
4
4
  `),d=[];let c=[];const u=()=>{const s=c.join(`
5
5
  `);s.trim()&&d.push({type:"markdown",content:s}),c=[]};for(let s=0;s<r.length;s+=1){const o=r[s].match(Dn);if(o){const w=Bn(r,s,o[1]);if(w>s){const q=r.slice(s,w+1);if(o[2].trim()==="ws-block:video")try{const V=JSON.parse(r.slice(s+1,w).join(`
6
- `)),F=ma(V?.path,t);if(F){u(),d.push({type:"video",source:F,name:typeof V.path=="string"?V.path:void 0,poster:typeof V.poster=="string"?V.poster:void 0}),s=w;continue}}catch{}c.push(...q),s=w;continue}c.push(...r.slice(s));break}const _=!/^(?: {4}|\t)/.test(r[s])&&Un(r,s)?r[s].match(qn):null;if(!_){c.push(r[s]);continue}const[,b,A]=_,m=ma(A,t);m?(u(),d.push({type:"video",source:m,name:b||void 0})):A.startsWith("workspace-asset://")&&!Kr(A)||zn(A,t)?c.push(r[s]):c.push(`[${b}](${A})`)}return u(),d}function ht(a){return Ma(a.getAttribute("src")||"")}function zt(a){return a instanceof HTMLImageElement?a:a instanceof HTMLAnchorElement?a.querySelector("img"):null}function Kn(a,t){const r=a.getBoundingClientRect(),d=t.getBoundingClientRect();return{top:r.top-d.top+6,right:d.right-r.right+6}}function ga(a,t){const r=document.activeElement;return!!(r&&(r===a||r===a?.closest("a")||t?.contains(r)))}function jn(a,t){const r=a.getAttribute("src")||"",d=At(r)?.path??Ra(r,t)?.path;if(d)return d;if(r.startsWith("workspace-asset://")){const c=r.split(/[?#]/)[0].split("/").pop();if(c)return c}if(r&&!/^[a-z][a-z0-9+.-]*:/i.test(r)&&!r.startsWith("//"))try{return decodeURI(r)}catch{return r}return a.getAttribute("alt")||void 0}const La="data-image-sized",va=a=>typeof a=="number"&&Number.isInteger(a)&&a>0;function Gn(a){try{return encodeURI(a).replace(/%25/g,"%")}catch{return null}}function Yn(a){return a.startsWith("workspace-file://")?a.split(/[?#]/)[0]:a}function Zn(a,t,r){const d=new Map;for(const[c,u]of Object.entries(a)){if(!u||!va(u.width)||!va(u.height))continue;const s={width:u.width,height:u.height},o=new Set([c]),v=Gn(c);v&&o.add(v);for(const _ of[...o]){const b=Et(_,t);if(b&&o.add(b),r!==void 0){const A=jr(_,r);if(A){const m=Et(`intent://local/file/${A.split("/").map(encodeURIComponent).join("/")}`,t);m&&o.add(m)}}}for(const _ of o)d.has(_)||d.set(_,s)}return d}function Jn(a,t,r,d){if(!t||!a.includes("<img"))return a;const c=Zn(t,r,d);return c.size===0?a:a.replace(/<img\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,u=>{if(/\s(?:width|height)="/i.test(u))return u;const s=/\ssrc="([^"]*)"/i.exec(u);if(!s)return u;const o=Yn(s[1].replace(/&amp;/g,"&")),v=c.get(o);return v?u.replace(/\s*\/?>$/,` width="${v.width}" height="${v.height}" ${La}="">`):u})}function ha(a,t){let r=t,d,c=!1,u=!1;const s=new Map;function o(){for(const[b,{component:A,source:m}]of s)ft(A),a.contains(b)&&b.replaceWith(m);s.clear()}function v(){if(!u){for(const[b,{component:A}]of s)a.contains(b)||(ft(A),s.delete(b));if(r.enabled)for(const b of a.querySelectorAll("pre > code")){if(b.closest("[data-markdown-diagram]"))continue;const A=[...b.classList].find(F=>F.startsWith("language-"))?.slice(9);let m;if(A==="mermaid")m="mermaid";else if(A==="diagram"||A==="ws-block:diagram")m="diagram";else if(A==="ws-block")try{if(JSON.parse(b.textContent??"").type!=="diagram")continue;m="diagram"}catch{continue}else continue;const w=b.parentElement;if(!w)continue;if(!d){c||(c=!0,ka(()=>import("./C2Jv33-s.js"),__vite__mapDeps([66,2,1,67,48,68,50,14,7,9,10,11,12,3,13,15,25,18,6,8,51,17,16,19,20,52,5,49,46,41,28,38,36,47,53,54,55,56,57,58,59,69,70,0,4,21,22,23,24,26,27,29,30,31,32,33,34,35,37,39,40,42,43,44,45,60,61,62,63,64,65,71,72,73,74,75,76,77,78]),import.meta.url).then(F=>{d=F.default,c=!1,v()}).catch(F=>{c=!1,bt.error("Failed to load the Markdown diagram renderer",{error:F})}));return}const q=document.createElement("div");q.dataset.markdownDiagram=m,w.replaceWith(q);const V=St(d,{target:q,context:r.context,props:{kind:m,source:b.textContent??"",workspaceId:r.workspaceId}});s.set(q,{component:V,source:w})}}}const _=new MutationObserver(v);return _.observe(a,{childList:!0,subtree:!0}),queueMicrotask(v),{update(b){(r.enabled!==b.enabled||r.workspaceId!==b.workspaceId)&&o(),r=b,v()},destroy(){u=!0,_.disconnect(),o()}}}var Qn=B('<span class="min-w-0 max-w-full truncate"> </span>'),Xn=B('<span class="type-caption flex min-w-0 max-w-full items-start gap-2 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-loading-placeholder"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="flex min-w-0 flex-wrap items-baseline gap-x-1.5"><span> </span> <!></span></span>');function Wa(a,t){if(new.target)return rt({component:Wa,...a});ot(t,!0);let r=y(t,"name",7);var d={get name(){return r()},set name(m){r(m),x()},$set:nt,$on:(m,w)=>st(t,m,w)},c=Xn(),u=N(c),s=N(u);wt(s,{get icon(){return Ur},class:"size-3.5"}),T(u);var o=z(u,2),v=N(o),_=me(v,!0),b=z(v,2);{var A=m=>{var w=Qn(),q=me(w,!0);tt(w,(V,F)=>Bt?.(V,F),r),X(()=>be(q,r())),W(m,w)};re(b,m=>{r()&&m(A)})}return T(o),T(c),X(m=>be(_,m),[()=>C.ui_mediaLoadingPlaceholder_title_label()]),W(a,c),it(d)}const ba="markdown-image-frame";function $n(a,t){const r=new Map,d=new Map,c=new Map,u=[300,1e3];let s=!1;function o(i){let p=d.get(i);return p||(p={source:i.getAttribute("src")||"",workspaceId:t.getWorkspaceId(),retries:0,failureHandled:!1},d.set(i,p)),p}function v(i){const p=o(i);return!s&&a.contains(p.fallbackHost??i)&&p.workspaceId===t.getWorkspaceId()&&t.canUseMedia(p.source)&&!i.hasAttribute("data-media-unavailable")&&!i.hasAttribute("data-media-unsupported")&&sa(p.source)!==null}function _(i,p=!1){if(!v(i))return;const k=o(i),P=sa(k.source);if(!P)return;const U=k.fallbackHost,K=U?.contains(document.activeElement)??!1;if(k.failureHandled=!1,k.fallbackHost=void 0,p&&(k.retries=0),i.removeAttribute("src"),i.setAttribute("src",P),U){const ne=r.get(U);ne&&ft(ne),r.delete(U),U.replaceWith(i),q(),K&&a.contains(i)&&i.focus()}}function b(i){const p=o(i);s||!a.contains(i)||p.failureHandled||(p.failureHandled=!0,v(i)&&p.retries<u.length?p.timer=setTimeout(()=>{p.timer=void 0,_(i)},u[p.retries++]):w(i,"load-failed"))}function A(i){const p=i.parentElement;return p?.classList.contains(ba)?p:null}function m(i){const p=Number(i.getAttribute("width")),k=Number(i.getAttribute("height"));if(!(p>0&&k>0))return;const P=document.createElement("span");P.className=ba,P.style.aspectRatio=`${p} / ${k}`,P.style.setProperty("--image-aspect-ratio",`${p} / ${k}`),P.style.width=`min(${p}px, 100%)`,P.dataset.loaded="false",i.replaceWith(P),P.appendChild(i);const U=P.appendChild(document.createElement("span"));U.className="markdown-image-frame-placeholder",r.set(U,St(Wa,{target:U,props:{name:jn(i,t.getWorkspaceId())}}));const K=()=>{if(c.delete(i),s||!a.contains(P))return;P.dataset.loaded="true";const ne=r.get(U);ne&&(ft(ne),r.delete(U)),U.remove()};i.complete&&i.naturalWidth>0?K():(c.set(i,K),i.addEventListener("load",K,{once:!0}))}function w(i,p){const k=i.getAttribute("src")||i.getAttribute("data-media-src")||"",P=At(k),U=Ra(k,t.getWorkspaceId()),K=P?.path??U?.path,ne=P?.workspaceId??U?.workspaceId,Le=i.getAttribute("data-name")||i.getAttribute("alt")||K?.split("/").pop()||void 0,le=document.createElement(i instanceof HTMLVideoElement?"div":"span");le.className="media-unavailable-host",(A(i)??i).replaceWith(le),t.onMediaRemoved(i);let ie;if(i instanceof HTMLImageElement&&p==="load-failed"){const _e=o(i);_e.fallbackHost=le,v(i)&&(ie=()=>_(i,!0))}const ge=St(Vt,{target:le,props:{name:Le,reason:p,path:K,workspaceId:ne,onRetry:ie}});if(r.set(le,ge),i instanceof HTMLVideoElement){le.classList.add("flex","items-center","gap-2");const _e=le.appendChild(document.createElement("span"));r.set(_e,St(Kt,{target:_e,props:{videoUrl:k,videoName:Le,sourceKind:"workspace",mimeType:_t(k,t.getWorkspaceId())?.mimeType}}))}}function q(){if(!s){for(const i of a.querySelectorAll("img"))ht(i)&&!i.closest("a")&&(i.tabIndex=0,i.setAttribute("role","button")),!(i.hasAttribute("data-media-unsupported")||i.hasAttribute("data-media-unavailable"))&&(o(i),i.hasAttribute(La)&&!A(i)&&m(i),i.getAttribute("src")&&i.complete&&i.naturalWidth===0&&b(i));for(const i of a.querySelectorAll("[data-media-unsupported]"))w(i,"unsupported");for(const i of a.querySelectorAll("[data-media-unavailable]"))w(i,Gr(i));for(const[i,p]of d)a.contains(p.fallbackHost??i)||(p.timer!==void 0&&clearTimeout(p.timer),d.delete(i));for(const[i,p]of c)a.contains(i)||(i.removeEventListener("load",p),c.delete(i));for(const[i,p]of r)a.contains(i)||(ft(p),r.delete(i))}}function V(i){const p=i.target;(p instanceof HTMLImageElement||p instanceof HTMLVideoElement)&&(p instanceof HTMLImageElement?b(p):w(p,"load-failed"))}const F=new MutationObserver(q);return F.observe(a,{childList:!0,subtree:!0}),a.addEventListener("error",V,!0),queueMicrotask(q),{destroy(){s=!0,F.disconnect();for(const i of d.values())i.timer!==void 0&&clearTimeout(i.timer);d.clear();for(const[i,p]of c)i.removeEventListener("load",p);c.clear(),a.removeEventListener("error",V,!0);for(const i of r.values())ft(i);r.clear()}}}var es=B('<div class="image-actions-overlay absolute z-10 svelte-nzvuq5" data-testid="markdown-image-actions-overlay"><!></div>'),ts=B("<div></div>"),wa=B('<div role="group"><!> <!></div>'),as=B('<div><p class="whitespace-pre-wrap svelte-nzvuq5"> </p></div>'),rs=B("<!> <!>",1);function _a(a,t){if(new.target)return rt({component:_a,...a});ot(t,!0);const r=n=>{var f=xt(),H=Ee(f);{var S=G=>{var te=es(),He=N(te);{let fe=E(()=>e(se).getAttribute("src")||""),pe=E(()=>e(se).getAttribute("alt")||void 0);at(fr(He,{get imageUrl(){return e(fe)},get imageName(){return e(pe)},get open(){return e(h)},set open(ze){O(h,ze,!0)}}),ze=>O(g,ze,!0),()=>e(g))}T(te),at(te,fe=>O(J,fe),()=>e(J)),X(()=>pt(te,`top: ${e(qe).top??""}px; right: ${e(qe).right??""}px;`)),W(G,te)},Y=E(()=>e(se)&&ge(e(se).getAttribute("src")||""));re(H,G=>{e(Y)&&G(S)})}W(n,f)};let d=y(t,"content",7),c=y(t,"isStreaming",7,!1),u=y(t,"className",7,""),s=y(t,"workspaceId",23,()=>ca()?.workspaceId??void 0),o=y(t,"relativeMediaBase",7),v=y(t,"onCodeBlockAction",7),_=y(t,"onFileClick",7),b=y(t,"canOpenFile",7),A=y(t,"allowFileMedia",7,!0),m=y(t,"taskBlockRenderMode",7,"placeholder"),w=y(t,"chatImageThumbnails",7,!1),q=y(t,"forceExternalLinks",7,!1),V=y(t,"renderRichFencesAsCode",7,!1),F=y(t,"renderDiagrams",7,!1),i=y(t,"allowSanitizedHtml",7,!1),p=y(t,"media",7);const k=Yr(),P=Ya(),U=E(()=>Vn(d(),s())),K=E(()=>e(U).some(n=>n.type==="video")),ne=E(()=>!e(K)&&e(U).length===1&&e(U)[0].type==="markdown"?e(U)[0].content:d()),Le=E(()=>Tn(e(ne)));let le=oe(null),ie=oe("");function ge(n){return kt(n,A()&&b()?.()!==!1)}const _e=E(()=>En(e(ie),A()&&b()?.()!==!1)),Ge=E(()=>pr(e(_e),s(),mr)),I=E(()=>`<div class="markdown-content">${e(Ge)}</div>`);let ee=0;const Re=150;let ve=-1/0,ce=null,ke=null;async function We(n,f,H,S){try{const Y=await Zr(n,{...f,readOnly:!0});if(S!==ee)return;O(ie,Jn(Y,H,f?.workspaceId,f?.relativeMediaBase),!0)}catch(Y){if(S!==ee)return;bt.error("Failed to process markdown:",Y);const G=n.replace(/[&<>"']/g,te=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[te]||te);O(ie,`<p>${G}</p>`)}}function de(){if(!ke)return;const n=Re-(performance.now()-ve);if(n>0){ce=setTimeout(()=>{ce=null,de()},n);return}const f=ke;ke=null,ve=performance.now(),f()}function Ze(){ce!==null&&(clearTimeout(ce),ce=null),ke=null,ve=-1/0}yt(()=>{const n=e(ne),f={allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!0,taskBlockRenderMode:m(),workspaceId:s(),relativeMediaBase:o()??(s()&&s()!==Sr?"":void 0),renderRichFencesAsCode:V()||F(),processPrimitives:!F(),allowSanitizedHtml:i(),renderMath:!c(),workspaceFileVersion:k},H=p(),S=++ee,Y=()=>void We(n,f,H,S);c()?(ke=Y,ce===null&&de()):(Ze(),Y())});let Te=oe(void 0),se=oe(null),qe=oe(Za({top:0,right:0})),h=oe(!1),g=oe(void 0),J=oe(null);function D(n){if(n.type==="mouseover"&&ga(e(se),e(J)))return;const f=n.target,H=zt(f);if(H&&ht(H)&&ge(H.getAttribute("src")||"")){if(e(se)===H)return;O(se,H,!0),O(qe,Kn(H,n.currentTarget),!0)}else if(e(se)&&!e(h)){if(f instanceof Node&&e(J)?.contains(f))return;O(se,null)}}function ae(){!e(h)&&!ga(e(se),e(J))&&O(se,null)}function ue(n){const f=zt(n.target);!f||!ht(f)||!ge(f.getAttribute("src")||"")||(n.preventDefault(),n.stopPropagation(),D(n),O(h,!0))}function j(n){return $n(n,{getWorkspaceId:()=>s(),canUseMedia:ge,onMediaRemoved:f=>{e(se)===f&&O(se,null)}})}function Ie(n){const f=n.target,H=f.closest("a");if(!H&&f instanceof HTMLImageElement){const Y=f.getAttribute("src")||"";if(Ma(Y)&&ge(Y)){n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),e(Te)?.openImage(f);return}}if(H?.href){if(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),e(Te)?.openAsset(H))return;const Y=l(n),G=s()?ta(s()):void 0;ia(H.href,{workspaceId:G,canOpenFile:b(),sourcePanelId:Y,event:n,rawHref:H.getAttribute("href")??void 0,...q()?{forceExternal:!0}:{}});return}const S=Jr(f.closest("[data-mention]"));if(S){const{type:Y,meta:G}=S;if(Y==="file"&&S.filePath){if(b()?.()===!1)return;n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation();const te=S.filePath;bt.debug("[MarkdownViewer] File mention clicked",{filePath:te,meta:G});const He=l(n),fe=qt({event:n});if(_())_()(te,{line:S.line,openInAdjacentPanel:fe,sourcePanelId:He});else{const pe=s();pe&&we.dispatch(Rr(pe,te,{line:S.line,openInAdjacentPanel:fe,sourcePanelId:He}))}}else if(S.folderPath!==void 0){if(b()?.()===!1||!s())return;n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),we.dispatch(Er(s(),Qr(S.folderPath)))}else if(Y==="note"&&S.note){n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation();const te=S.note.id;bt.debug("[MarkdownViewer] Note mention clicked",{noteId:te,meta:G});const He=l(n),fe=qt({event:n});if(S.note.workspaceId&&S.note.workspaceId!==s()){ia(ir(te,S.note.workspaceId),{workspaceId:s()?ta(s()):void 0,sourcePanelId:He,event:n});return}const pe=s();pe&&we.dispatch(Pr(pe,te,{openInAdjacentPanel:fe,sourcePanelId:He}))}}}function Fe(n){if(De(n),!n.defaultPrevented){if(n.target instanceof HTMLImageElement&&ht(n.target)&&(n.key==="Enter"||n.key===" ")){Ie(n);return}n.key!=="Enter"||!qt({event:n})||Ie(n)}}function De(n){const f=zt(n.target);!f||!ht(f)||!ge(f.getAttribute("src")||"")||e(g)?.handleCopy(n,f.getAttribute("src")||"")}function l(n){const f=n.target;if(f instanceof HTMLElement)return f.closest("[data-panel-id]")?.dataset.panelId}Ja(()=>{ee+=1,Ze()});var M={get content(){return d()},set content(n){d(n),x()},get isStreaming(){return c()},set isStreaming(n=!1){c(n),x()},get className(){return u()},set className(n=""){u(n),x()},get workspaceId(){return s()},set workspaceId(n=ca()?.workspaceId??void 0){s(n),x()},get relativeMediaBase(){return o()},set relativeMediaBase(n){o(n),x()},get onCodeBlockAction(){return v()},set onCodeBlockAction(n){v(n),x()},get onFileClick(){return _()},set onFileClick(n){_(n),x()},get canOpenFile(){return b()},set canOpenFile(n){b(n),x()},get allowFileMedia(){return A()},set allowFileMedia(n=!0){A(n),x()},get taskBlockRenderMode(){return m()},set taskBlockRenderMode(n="placeholder"){m(n),x()},get chatImageThumbnails(){return w()},set chatImageThumbnails(n=!1){w(n),x()},get forceExternalLinks(){return q()},set forceExternalLinks(n=!1){q(n),x()},get renderRichFencesAsCode(){return V()},set renderRichFencesAsCode(n=!1){V(n),x()},get renderDiagrams(){return F()},set renderDiagrams(n=!1){F(n),x()},get allowSanitizedHtml(){return i()},set allowSanitizedHtml(n=!1){i(n),x()},get media(){return p()},set media(n){p(n),x()},$set:nt,$on:(n,f)=>st(t,n,f)},L=rs(),Q=Ee(L);{var ye=n=>{var f=ts();Ut(f,21,()=>e(U),$a,(H,S)=>{var Y=xt(),G=Ee(Y);{var te=fe=>{Fa(fe,{get allowFileMedia(){return A()},get canOpenFile(){return b()},get source(){return e(S).source},get name(){return e(S).name},get poster(){return e(S).poster}})},He=fe=>{_a(fe,{get content(){return e(S).content},get isStreaming(){return c()},get workspaceId(){return s()},get relativeMediaBase(){return o()},get onCodeBlockAction(){return v()},get onFileClick(){return _()},get canOpenFile(){return b()},get allowFileMedia(){return A()},get taskBlockRenderMode(){return m()},get chatImageThumbnails(){return w()},get forceExternalLinks(){return q()},get renderRichFencesAsCode(){return V()},get renderDiagrams(){return F()},get allowSanitizedHtml(){return i()},get media(){return p()}})};re(G,fe=>{e(S).type==="video"?fe(te):fe(He,-1)})}W(H,Y)}),T(f),X(()=>Pe(f,1,`markdown-video-segments ${u()??""}`,"svelte-nzvuq5")),W(n,f)},he=n=>{var f=wa();let H;var S=N(f);oa(S,()=>e(I));var Y=z(S,2);r(Y),T(f),tt(f,G=>j?.(G)),tt(f,(G,te)=>ha?.(G,te),()=>({enabled:F(),workspaceId:s(),context:P})),X(()=>H=Pe(f,1,`markdown-viewer streaming-content ${u()??""}`,"svelte-nzvuq5",H,{"chat-image-thumbnails":w()})),Se("click",f,Ie),Se("keydown",f,Fe),Be("copy",f,De),Se("contextmenu",f,ue),Se("mouseover",f,D),Se("focusin",f,D),Be("mouseleave",f,ae),W(n,f)},xe=n=>{var f=as(),H=N(f),S=me(H,!0);T(f),X(()=>{Pe(f,1,`markdown-viewer simple-content ${u()??""}`,"svelte-nzvuq5"),be(S,e(ne))}),W(n,f)},Ne=n=>{var f=wa();let H;var S=N(f);oa(S,()=>e(I));var Y=z(S,2);r(Y),T(f),at(f,G=>O(le,G),()=>e(le)),tt(f,G=>j?.(G)),tt(f,(G,te)=>ha?.(G,te),()=>({enabled:F(),workspaceId:s(),context:P})),X(()=>H=Pe(f,1,`markdown-viewer static-content ${u()??""}`,"svelte-nzvuq5",H,{"chat-image-thumbnails":w()})),Se("click",f,Ie),Se("keydown",f,Fe),Be("copy",f,De),Se("contextmenu",f,ue),Se("mouseover",f,D),Se("focusin",f,D),Be("mouseleave",f,ae),W(n,f)};re(Q,n=>{e(K)?n(ye):c()?n(he,1):e(Le)==="simple"&&!i()?n(xe,2):n(Ne,-1)})}var Ae=z(Q,2);return at(Ta(Ae,{get workspaceId(){return s()},canUseMedia:ge}),n=>O(Te,n,!0),()=>e(Te)),W(a,L),it(M)}xa(["click","keydown","contextmenu","mouseover","focusin"]);class Ts{constructor(t){dt(this,"container");dt(this,"previousFocus",null);dt(this,"firstFocusable",null);dt(this,"lastFocusable",null);dt(this,"handleKeyDown");this.container=t,this.handleKeyDown=this.onKeyDown.bind(this)}activate(){this.previousFocus=document.activeElement;const t=this.container.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');t.length>0&&(this.firstFocusable=t[0],this.lastFocusable=t[t.length-1],this.firstFocusable.focus()),document.addEventListener("keydown",this.handleKeyDown)}deactivate(){document.removeEventListener("keydown",this.handleKeyDown),this.previousFocus&&this.previousFocus.focus()}onKeyDown(t){t.key==="Tab"&&(!this.firstFocusable||!this.lastFocusable||(t.shiftKey?document.activeElement===this.firstFocusable&&(t.preventDefault(),this.lastFocusable.focus()):document.activeElement===this.lastFocusable&&(t.preventDefault(),this.firstFocusable.focus())))}}function Fs(a,t){const r=_=>{const b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(_);return b?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null},d=_=>{const[b,A,m]=[_.r,_.g,_.b].map(w=>(w=w/255,w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4)));return .2126*b+.7152*A+.0722*m},c=r(a),u=r(t);if(!c||!u)return bt.warn("Invalid color values for contrast check",{foreground:a,background:t}),{ratio:0,passes:{aa:!1,aaa:!1}};const s=d(c),o=d(u),v=(Math.max(s,o)+.05)/(Math.min(s,o)+.05);return{ratio:v,passes:{aa:v>=4.5,aaa:v>=7}}}export{Fa as C,Ts as F,Rn as H,_a as M,Rs as W,Wa as a,fa as b,An as c,Pa as d,Fs as e,Cn as f,Ps as g,Ea as h,on as r,Vn as s,Es as w};
6
+ `)),F=ma(V?.path,t);if(F){u(),d.push({type:"video",source:F,name:typeof V.path=="string"?V.path:void 0,poster:typeof V.poster=="string"?V.poster:void 0}),s=w;continue}}catch{}c.push(...q),s=w;continue}c.push(...r.slice(s));break}const _=!/^(?: {4}|\t)/.test(r[s])&&Un(r,s)?r[s].match(qn):null;if(!_){c.push(r[s]);continue}const[,b,A]=_,m=ma(A,t);m?(u(),d.push({type:"video",source:m,name:b||void 0})):A.startsWith("workspace-asset://")&&!Kr(A)||zn(A,t)?c.push(r[s]):c.push(`[${b}](${A})`)}return u(),d}function ht(a){return Ma(a.getAttribute("src")||"")}function zt(a){return a instanceof HTMLImageElement?a:a instanceof HTMLAnchorElement?a.querySelector("img"):null}function Kn(a,t){const r=a.getBoundingClientRect(),d=t.getBoundingClientRect();return{top:r.top-d.top+6,right:d.right-r.right+6}}function ga(a,t){const r=document.activeElement;return!!(r&&(r===a||r===a?.closest("a")||t?.contains(r)))}function jn(a,t){const r=a.getAttribute("src")||"",d=At(r)?.path??Ra(r,t)?.path;if(d)return d;if(r.startsWith("workspace-asset://")){const c=r.split(/[?#]/)[0].split("/").pop();if(c)return c}if(r&&!/^[a-z][a-z0-9+.-]*:/i.test(r)&&!r.startsWith("//"))try{return decodeURI(r)}catch{return r}return a.getAttribute("alt")||void 0}const La="data-image-sized",va=a=>typeof a=="number"&&Number.isInteger(a)&&a>0;function Gn(a){try{return encodeURI(a).replace(/%25/g,"%")}catch{return null}}function Yn(a){return a.startsWith("workspace-file://")?a.split(/[?#]/)[0]:a}function Zn(a,t,r){const d=new Map;for(const[c,u]of Object.entries(a)){if(!u||!va(u.width)||!va(u.height))continue;const s={width:u.width,height:u.height},o=new Set([c]),v=Gn(c);v&&o.add(v);for(const _ of[...o]){const b=Et(_,t);if(b&&o.add(b),r!==void 0){const A=jr(_,r);if(A){const m=Et(`intent://local/file/${A.split("/").map(encodeURIComponent).join("/")}`,t);m&&o.add(m)}}}for(const _ of o)d.has(_)||d.set(_,s)}return d}function Jn(a,t,r,d){if(!t||!a.includes("<img"))return a;const c=Zn(t,r,d);return c.size===0?a:a.replace(/<img\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,u=>{if(/\s(?:width|height)="/i.test(u))return u;const s=/\ssrc="([^"]*)"/i.exec(u);if(!s)return u;const o=Yn(s[1].replace(/&amp;/g,"&")),v=c.get(o);return v?u.replace(/\s*\/?>$/,` width="${v.width}" height="${v.height}" ${La}="">`):u})}function ha(a,t){let r=t,d,c=!1,u=!1;const s=new Map;function o(){for(const[b,{component:A,source:m}]of s)ft(A),a.contains(b)&&b.replaceWith(m);s.clear()}function v(){if(!u){for(const[b,{component:A}]of s)a.contains(b)||(ft(A),s.delete(b));if(r.enabled)for(const b of a.querySelectorAll("pre > code")){if(b.closest("[data-markdown-diagram]"))continue;const A=[...b.classList].find(F=>F.startsWith("language-"))?.slice(9);let m;if(A==="mermaid")m="mermaid";else if(A==="diagram"||A==="ws-block:diagram")m="diagram";else if(A==="ws-block")try{if(JSON.parse(b.textContent??"").type!=="diagram")continue;m="diagram"}catch{continue}else continue;const w=b.parentElement;if(!w)continue;if(!d){c||(c=!0,ka(()=>import("./oh9nhT2f.js"),__vite__mapDeps([66,2,1,67,48,68,50,14,7,9,10,11,12,3,13,15,25,18,6,8,51,17,16,19,20,52,5,49,46,41,28,38,36,47,53,54,55,56,57,58,59,69,70,0,4,21,22,23,24,26,27,29,30,31,32,33,34,35,37,39,40,42,43,44,45,60,61,62,63,64,65,71,72,73,74,75,76,77,78]),import.meta.url).then(F=>{d=F.default,c=!1,v()}).catch(F=>{c=!1,bt.error("Failed to load the Markdown diagram renderer",{error:F})}));return}const q=document.createElement("div");q.dataset.markdownDiagram=m,w.replaceWith(q);const V=St(d,{target:q,context:r.context,props:{kind:m,source:b.textContent??"",workspaceId:r.workspaceId}});s.set(q,{component:V,source:w})}}}const _=new MutationObserver(v);return _.observe(a,{childList:!0,subtree:!0}),queueMicrotask(v),{update(b){(r.enabled!==b.enabled||r.workspaceId!==b.workspaceId)&&o(),r=b,v()},destroy(){u=!0,_.disconnect(),o()}}}var Qn=B('<span class="min-w-0 max-w-full truncate"> </span>'),Xn=B('<span class="type-caption flex min-w-0 max-w-full items-start gap-2 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-loading-placeholder"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="flex min-w-0 flex-wrap items-baseline gap-x-1.5"><span> </span> <!></span></span>');function Wa(a,t){if(new.target)return rt({component:Wa,...a});ot(t,!0);let r=y(t,"name",7);var d={get name(){return r()},set name(m){r(m),x()},$set:nt,$on:(m,w)=>st(t,m,w)},c=Xn(),u=N(c),s=N(u);wt(s,{get icon(){return Ur},class:"size-3.5"}),T(u);var o=z(u,2),v=N(o),_=me(v,!0),b=z(v,2);{var A=m=>{var w=Qn(),q=me(w,!0);tt(w,(V,F)=>Bt?.(V,F),r),X(()=>be(q,r())),W(m,w)};re(b,m=>{r()&&m(A)})}return T(o),T(c),X(m=>be(_,m),[()=>C.ui_mediaLoadingPlaceholder_title_label()]),W(a,c),it(d)}const ba="markdown-image-frame";function $n(a,t){const r=new Map,d=new Map,c=new Map,u=[300,1e3];let s=!1;function o(i){let p=d.get(i);return p||(p={source:i.getAttribute("src")||"",workspaceId:t.getWorkspaceId(),retries:0,failureHandled:!1},d.set(i,p)),p}function v(i){const p=o(i);return!s&&a.contains(p.fallbackHost??i)&&p.workspaceId===t.getWorkspaceId()&&t.canUseMedia(p.source)&&!i.hasAttribute("data-media-unavailable")&&!i.hasAttribute("data-media-unsupported")&&sa(p.source)!==null}function _(i,p=!1){if(!v(i))return;const k=o(i),P=sa(k.source);if(!P)return;const U=k.fallbackHost,K=U?.contains(document.activeElement)??!1;if(k.failureHandled=!1,k.fallbackHost=void 0,p&&(k.retries=0),i.removeAttribute("src"),i.setAttribute("src",P),U){const ne=r.get(U);ne&&ft(ne),r.delete(U),U.replaceWith(i),q(),K&&a.contains(i)&&i.focus()}}function b(i){const p=o(i);s||!a.contains(i)||p.failureHandled||(p.failureHandled=!0,v(i)&&p.retries<u.length?p.timer=setTimeout(()=>{p.timer=void 0,_(i)},u[p.retries++]):w(i,"load-failed"))}function A(i){const p=i.parentElement;return p?.classList.contains(ba)?p:null}function m(i){const p=Number(i.getAttribute("width")),k=Number(i.getAttribute("height"));if(!(p>0&&k>0))return;const P=document.createElement("span");P.className=ba,P.style.aspectRatio=`${p} / ${k}`,P.style.setProperty("--image-aspect-ratio",`${p} / ${k}`),P.style.width=`min(${p}px, 100%)`,P.dataset.loaded="false",i.replaceWith(P),P.appendChild(i);const U=P.appendChild(document.createElement("span"));U.className="markdown-image-frame-placeholder",r.set(U,St(Wa,{target:U,props:{name:jn(i,t.getWorkspaceId())}}));const K=()=>{if(c.delete(i),s||!a.contains(P))return;P.dataset.loaded="true";const ne=r.get(U);ne&&(ft(ne),r.delete(U)),U.remove()};i.complete&&i.naturalWidth>0?K():(c.set(i,K),i.addEventListener("load",K,{once:!0}))}function w(i,p){const k=i.getAttribute("src")||i.getAttribute("data-media-src")||"",P=At(k),U=Ra(k,t.getWorkspaceId()),K=P?.path??U?.path,ne=P?.workspaceId??U?.workspaceId,Le=i.getAttribute("data-name")||i.getAttribute("alt")||K?.split("/").pop()||void 0,le=document.createElement(i instanceof HTMLVideoElement?"div":"span");le.className="media-unavailable-host",(A(i)??i).replaceWith(le),t.onMediaRemoved(i);let ie;if(i instanceof HTMLImageElement&&p==="load-failed"){const _e=o(i);_e.fallbackHost=le,v(i)&&(ie=()=>_(i,!0))}const ge=St(Vt,{target:le,props:{name:Le,reason:p,path:K,workspaceId:ne,onRetry:ie}});if(r.set(le,ge),i instanceof HTMLVideoElement){le.classList.add("flex","items-center","gap-2");const _e=le.appendChild(document.createElement("span"));r.set(_e,St(Kt,{target:_e,props:{videoUrl:k,videoName:Le,sourceKind:"workspace",mimeType:_t(k,t.getWorkspaceId())?.mimeType}}))}}function q(){if(!s){for(const i of a.querySelectorAll("img"))ht(i)&&!i.closest("a")&&(i.tabIndex=0,i.setAttribute("role","button")),!(i.hasAttribute("data-media-unsupported")||i.hasAttribute("data-media-unavailable"))&&(o(i),i.hasAttribute(La)&&!A(i)&&m(i),i.getAttribute("src")&&i.complete&&i.naturalWidth===0&&b(i));for(const i of a.querySelectorAll("[data-media-unsupported]"))w(i,"unsupported");for(const i of a.querySelectorAll("[data-media-unavailable]"))w(i,Gr(i));for(const[i,p]of d)a.contains(p.fallbackHost??i)||(p.timer!==void 0&&clearTimeout(p.timer),d.delete(i));for(const[i,p]of c)a.contains(i)||(i.removeEventListener("load",p),c.delete(i));for(const[i,p]of r)a.contains(i)||(ft(p),r.delete(i))}}function V(i){const p=i.target;(p instanceof HTMLImageElement||p instanceof HTMLVideoElement)&&(p instanceof HTMLImageElement?b(p):w(p,"load-failed"))}const F=new MutationObserver(q);return F.observe(a,{childList:!0,subtree:!0}),a.addEventListener("error",V,!0),queueMicrotask(q),{destroy(){s=!0,F.disconnect();for(const i of d.values())i.timer!==void 0&&clearTimeout(i.timer);d.clear();for(const[i,p]of c)i.removeEventListener("load",p);c.clear(),a.removeEventListener("error",V,!0);for(const i of r.values())ft(i);r.clear()}}}var es=B('<div class="image-actions-overlay absolute z-10 svelte-nzvuq5" data-testid="markdown-image-actions-overlay"><!></div>'),ts=B("<div></div>"),wa=B('<div role="group"><!> <!></div>'),as=B('<div><p class="whitespace-pre-wrap svelte-nzvuq5"> </p></div>'),rs=B("<!> <!>",1);function _a(a,t){if(new.target)return rt({component:_a,...a});ot(t,!0);const r=n=>{var f=xt(),H=Ee(f);{var S=G=>{var te=es(),He=N(te);{let fe=E(()=>e(se).getAttribute("src")||""),pe=E(()=>e(se).getAttribute("alt")||void 0);at(fr(He,{get imageUrl(){return e(fe)},get imageName(){return e(pe)},get open(){return e(h)},set open(ze){O(h,ze,!0)}}),ze=>O(g,ze,!0),()=>e(g))}T(te),at(te,fe=>O(J,fe),()=>e(J)),X(()=>pt(te,`top: ${e(qe).top??""}px; right: ${e(qe).right??""}px;`)),W(G,te)},Y=E(()=>e(se)&&ge(e(se).getAttribute("src")||""));re(H,G=>{e(Y)&&G(S)})}W(n,f)};let d=y(t,"content",7),c=y(t,"isStreaming",7,!1),u=y(t,"className",7,""),s=y(t,"workspaceId",23,()=>ca()?.workspaceId??void 0),o=y(t,"relativeMediaBase",7),v=y(t,"onCodeBlockAction",7),_=y(t,"onFileClick",7),b=y(t,"canOpenFile",7),A=y(t,"allowFileMedia",7,!0),m=y(t,"taskBlockRenderMode",7,"placeholder"),w=y(t,"chatImageThumbnails",7,!1),q=y(t,"forceExternalLinks",7,!1),V=y(t,"renderRichFencesAsCode",7,!1),F=y(t,"renderDiagrams",7,!1),i=y(t,"allowSanitizedHtml",7,!1),p=y(t,"media",7);const k=Yr(),P=Ya(),U=E(()=>Vn(d(),s())),K=E(()=>e(U).some(n=>n.type==="video")),ne=E(()=>!e(K)&&e(U).length===1&&e(U)[0].type==="markdown"?e(U)[0].content:d()),Le=E(()=>Tn(e(ne)));let le=oe(null),ie=oe("");function ge(n){return kt(n,A()&&b()?.()!==!1)}const _e=E(()=>En(e(ie),A()&&b()?.()!==!1)),Ge=E(()=>pr(e(_e),s(),mr)),I=E(()=>`<div class="markdown-content">${e(Ge)}</div>`);let ee=0;const Re=150;let ve=-1/0,ce=null,ke=null;async function We(n,f,H,S){try{const Y=await Zr(n,{...f,readOnly:!0});if(S!==ee)return;O(ie,Jn(Y,H,f?.workspaceId,f?.relativeMediaBase),!0)}catch(Y){if(S!==ee)return;bt.error("Failed to process markdown:",Y);const G=n.replace(/[&<>"']/g,te=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[te]||te);O(ie,`<p>${G}</p>`)}}function de(){if(!ke)return;const n=Re-(performance.now()-ve);if(n>0){ce=setTimeout(()=>{ce=null,de()},n);return}const f=ke;ke=null,ve=performance.now(),f()}function Ze(){ce!==null&&(clearTimeout(ce),ce=null),ke=null,ve=-1/0}yt(()=>{const n=e(ne),f={allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!0,taskBlockRenderMode:m(),workspaceId:s(),relativeMediaBase:o()??(s()&&s()!==Sr?"":void 0),renderRichFencesAsCode:V()||F(),processPrimitives:!F(),allowSanitizedHtml:i(),renderMath:!c(),workspaceFileVersion:k},H=p(),S=++ee,Y=()=>void We(n,f,H,S);c()?(ke=Y,ce===null&&de()):(Ze(),Y())});let Te=oe(void 0),se=oe(null),qe=oe(Za({top:0,right:0})),h=oe(!1),g=oe(void 0),J=oe(null);function D(n){if(n.type==="mouseover"&&ga(e(se),e(J)))return;const f=n.target,H=zt(f);if(H&&ht(H)&&ge(H.getAttribute("src")||"")){if(e(se)===H)return;O(se,H,!0),O(qe,Kn(H,n.currentTarget),!0)}else if(e(se)&&!e(h)){if(f instanceof Node&&e(J)?.contains(f))return;O(se,null)}}function ae(){!e(h)&&!ga(e(se),e(J))&&O(se,null)}function ue(n){const f=zt(n.target);!f||!ht(f)||!ge(f.getAttribute("src")||"")||(n.preventDefault(),n.stopPropagation(),D(n),O(h,!0))}function j(n){return $n(n,{getWorkspaceId:()=>s(),canUseMedia:ge,onMediaRemoved:f=>{e(se)===f&&O(se,null)}})}function Ie(n){const f=n.target,H=f.closest("a");if(!H&&f instanceof HTMLImageElement){const Y=f.getAttribute("src")||"";if(Ma(Y)&&ge(Y)){n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),e(Te)?.openImage(f);return}}if(H?.href){if(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),e(Te)?.openAsset(H))return;const Y=l(n),G=s()?ta(s()):void 0;ia(H.href,{workspaceId:G,canOpenFile:b(),sourcePanelId:Y,event:n,rawHref:H.getAttribute("href")??void 0,...q()?{forceExternal:!0}:{}});return}const S=Jr(f.closest("[data-mention]"));if(S){const{type:Y,meta:G}=S;if(Y==="file"&&S.filePath){if(b()?.()===!1)return;n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation();const te=S.filePath;bt.debug("[MarkdownViewer] File mention clicked",{filePath:te,meta:G});const He=l(n),fe=qt({event:n});if(_())_()(te,{line:S.line,openInAdjacentPanel:fe,sourcePanelId:He});else{const pe=s();pe&&we.dispatch(Rr(pe,te,{line:S.line,openInAdjacentPanel:fe,sourcePanelId:He}))}}else if(S.folderPath!==void 0){if(b()?.()===!1||!s())return;n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),we.dispatch(Er(s(),Qr(S.folderPath)))}else if(Y==="note"&&S.note){n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation();const te=S.note.id;bt.debug("[MarkdownViewer] Note mention clicked",{noteId:te,meta:G});const He=l(n),fe=qt({event:n});if(S.note.workspaceId&&S.note.workspaceId!==s()){ia(ir(te,S.note.workspaceId),{workspaceId:s()?ta(s()):void 0,sourcePanelId:He,event:n});return}const pe=s();pe&&we.dispatch(Pr(pe,te,{openInAdjacentPanel:fe,sourcePanelId:He}))}}}function Fe(n){if(De(n),!n.defaultPrevented){if(n.target instanceof HTMLImageElement&&ht(n.target)&&(n.key==="Enter"||n.key===" ")){Ie(n);return}n.key!=="Enter"||!qt({event:n})||Ie(n)}}function De(n){const f=zt(n.target);!f||!ht(f)||!ge(f.getAttribute("src")||"")||e(g)?.handleCopy(n,f.getAttribute("src")||"")}function l(n){const f=n.target;if(f instanceof HTMLElement)return f.closest("[data-panel-id]")?.dataset.panelId}Ja(()=>{ee+=1,Ze()});var M={get content(){return d()},set content(n){d(n),x()},get isStreaming(){return c()},set isStreaming(n=!1){c(n),x()},get className(){return u()},set className(n=""){u(n),x()},get workspaceId(){return s()},set workspaceId(n=ca()?.workspaceId??void 0){s(n),x()},get relativeMediaBase(){return o()},set relativeMediaBase(n){o(n),x()},get onCodeBlockAction(){return v()},set onCodeBlockAction(n){v(n),x()},get onFileClick(){return _()},set onFileClick(n){_(n),x()},get canOpenFile(){return b()},set canOpenFile(n){b(n),x()},get allowFileMedia(){return A()},set allowFileMedia(n=!0){A(n),x()},get taskBlockRenderMode(){return m()},set taskBlockRenderMode(n="placeholder"){m(n),x()},get chatImageThumbnails(){return w()},set chatImageThumbnails(n=!1){w(n),x()},get forceExternalLinks(){return q()},set forceExternalLinks(n=!1){q(n),x()},get renderRichFencesAsCode(){return V()},set renderRichFencesAsCode(n=!1){V(n),x()},get renderDiagrams(){return F()},set renderDiagrams(n=!1){F(n),x()},get allowSanitizedHtml(){return i()},set allowSanitizedHtml(n=!1){i(n),x()},get media(){return p()},set media(n){p(n),x()},$set:nt,$on:(n,f)=>st(t,n,f)},L=rs(),Q=Ee(L);{var ye=n=>{var f=ts();Ut(f,21,()=>e(U),$a,(H,S)=>{var Y=xt(),G=Ee(Y);{var te=fe=>{Fa(fe,{get allowFileMedia(){return A()},get canOpenFile(){return b()},get source(){return e(S).source},get name(){return e(S).name},get poster(){return e(S).poster}})},He=fe=>{_a(fe,{get content(){return e(S).content},get isStreaming(){return c()},get workspaceId(){return s()},get relativeMediaBase(){return o()},get onCodeBlockAction(){return v()},get onFileClick(){return _()},get canOpenFile(){return b()},get allowFileMedia(){return A()},get taskBlockRenderMode(){return m()},get chatImageThumbnails(){return w()},get forceExternalLinks(){return q()},get renderRichFencesAsCode(){return V()},get renderDiagrams(){return F()},get allowSanitizedHtml(){return i()},get media(){return p()}})};re(G,fe=>{e(S).type==="video"?fe(te):fe(He,-1)})}W(H,Y)}),T(f),X(()=>Pe(f,1,`markdown-video-segments ${u()??""}`,"svelte-nzvuq5")),W(n,f)},he=n=>{var f=wa();let H;var S=N(f);oa(S,()=>e(I));var Y=z(S,2);r(Y),T(f),tt(f,G=>j?.(G)),tt(f,(G,te)=>ha?.(G,te),()=>({enabled:F(),workspaceId:s(),context:P})),X(()=>H=Pe(f,1,`markdown-viewer streaming-content ${u()??""}`,"svelte-nzvuq5",H,{"chat-image-thumbnails":w()})),Se("click",f,Ie),Se("keydown",f,Fe),Be("copy",f,De),Se("contextmenu",f,ue),Se("mouseover",f,D),Se("focusin",f,D),Be("mouseleave",f,ae),W(n,f)},xe=n=>{var f=as(),H=N(f),S=me(H,!0);T(f),X(()=>{Pe(f,1,`markdown-viewer simple-content ${u()??""}`,"svelte-nzvuq5"),be(S,e(ne))}),W(n,f)},Ne=n=>{var f=wa();let H;var S=N(f);oa(S,()=>e(I));var Y=z(S,2);r(Y),T(f),at(f,G=>O(le,G),()=>e(le)),tt(f,G=>j?.(G)),tt(f,(G,te)=>ha?.(G,te),()=>({enabled:F(),workspaceId:s(),context:P})),X(()=>H=Pe(f,1,`markdown-viewer static-content ${u()??""}`,"svelte-nzvuq5",H,{"chat-image-thumbnails":w()})),Se("click",f,Ie),Se("keydown",f,Fe),Be("copy",f,De),Se("contextmenu",f,ue),Se("mouseover",f,D),Se("focusin",f,D),Be("mouseleave",f,ae),W(n,f)};re(Q,n=>{e(K)?n(ye):c()?n(he,1):e(Le)==="simple"&&!i()?n(xe,2):n(Ne,-1)})}var Ae=z(Q,2);return at(Ta(Ae,{get workspaceId(){return s()},canUseMedia:ge}),n=>O(Te,n,!0),()=>e(Te)),W(a,L),it(M)}xa(["click","keydown","contextmenu","mouseover","focusin"]);class Ts{constructor(t){dt(this,"container");dt(this,"previousFocus",null);dt(this,"firstFocusable",null);dt(this,"lastFocusable",null);dt(this,"handleKeyDown");this.container=t,this.handleKeyDown=this.onKeyDown.bind(this)}activate(){this.previousFocus=document.activeElement;const t=this.container.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');t.length>0&&(this.firstFocusable=t[0],this.lastFocusable=t[t.length-1],this.firstFocusable.focus()),document.addEventListener("keydown",this.handleKeyDown)}deactivate(){document.removeEventListener("keydown",this.handleKeyDown),this.previousFocus&&this.previousFocus.focus()}onKeyDown(t){t.key==="Tab"&&(!this.firstFocusable||!this.lastFocusable||(t.shiftKey?document.activeElement===this.firstFocusable&&(t.preventDefault(),this.lastFocusable.focus()):document.activeElement===this.lastFocusable&&(t.preventDefault(),this.firstFocusable.focus())))}}function Fs(a,t){const r=_=>{const b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(_);return b?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null},d=_=>{const[b,A,m]=[_.r,_.g,_.b].map(w=>(w=w/255,w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4)));return .2126*b+.7152*A+.0722*m},c=r(a),u=r(t);if(!c||!u)return bt.warn("Invalid color values for contrast check",{foreground:a,background:t}),{ratio:0,passes:{aa:!1,aaa:!1}};const s=d(c),o=d(u),v=(Math.max(s,o)+.05)/(Math.min(s,o)+.05);return{ratio:v,passes:{aa:v>=4.5,aaa:v>=7}}}export{Fa as C,Ts as F,Rn as H,_a as M,Rs as W,Wa as a,fa as b,An as c,Pa as d,Fs as e,Cn as f,Ps as g,Ea as h,on as r,Vn as s,Es as w};
@@ -1,3 +1,3 @@
1
- import{t as D,br as d,a_ as P,bz as b,b as x}from"./O1QHAURn.js";import{bs as S,a7 as z,ay as A,W as C,bn as M,aA as m,aD as i,c9 as c}from"./DYhIMPy1.js";import{D as f,M as B}from"./BFTlNJv7.js";import{S as N,p as W}from"./D9bKP3Hx.js";import{N as $}from"./D6pin7kj.js";import{Ix as j,v2 as E,be as J}from"./DNqM68dO.js";import{x as K}from"./BKAobQX_.js";import{a0 as O}from"./VZEkDWIM.js";function R(l,s){if(new.target)return D({component:R,...l});S(s,!0);let o=d(s,"kind",7),t=d(s,"source",7),a=d(s,"workspaceId",7);const g=new $,p=c(()=>{if(o()==="mermaid")return null;const e=g.parseMarkdown(`\`\`\`ws-block:diagram
1
+ import{t as D,br as d,a_ as P,bz as b,b as x}from"./O1QHAURn.js";import{bs as S,a7 as z,ay as A,W as C,bn as M,aA as m,aD as i,c9 as c}from"./DYhIMPy1.js";import{D as f,M as B}from"./BXNjGjOh.js";import{S as N,p as W}from"./B906VD80.js";import{N as $}from"./vBH-DCjX.js";import{Ix as j,v2 as E,be as J}from"./DNqM68dO.js";import{x as K}from"./C917cXWW.js";import{a0 as O}from"./VZEkDWIM.js";function R(l,s){if(new.target)return D({component:R,...l});S(s,!0);let o=d(s,"kind",7),t=d(s,"source",7),a=d(s,"workspaceId",7);const g=new $,p=c(()=>{if(o()==="mermaid")return null;const e=g.parseMarkdown(`\`\`\`ws-block:diagram
2
2
  ${t()}
3
3
  \`\`\``)[0],r=e?.primitive.type==="diagram"?JSON.stringify(e.primitive):t();return W(r,!0)});function k(e,r){if(!a()||!r.target)return;const n={openInAdjacentPanel:e.metaKey||e.ctrlKey,sourcePanelId:e.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0};r.type==="file"?j.dispatch(E(a(),r.target,n)):r.type==="note"&&K(O(r.target,a()),{...n,workspaceId:J(a()),event:e})}var w={get kind(){return o()},set kind(e){o(e),m()},get source(){return t()},set source(e){t(e),m()},get workspaceId(){return a()},set workspaceId(e){a(e),m()},$set:b,$on:(e,r)=>x(s,e,r)},u=z(),y=A(u);{var I=e=>{f(e,{kind:"mermaid",rendererOwnsActions:!0,children:(r,n)=>{B(r,{get code(){return t()},showExportButton:!0})},$$slots:{default:!0}})},v=e=>{f(e,{kind:"custom",children:(r,n)=>{{let _=c(()=>i(p)?.diagram??null),h=c(()=>i(p)?.error);N(r,{get diagram(){return i(_)},get source(){return t()},get sourceError(){return i(h)},onBindingClick:k})}},$$slots:{default:!0}})};P(y,e=>{o()==="mermaid"?e(I):e(v,-1)})}return C(l,u),M(w)}export{R as default};
@@ -1 +1 @@
1
- import{b as s}from"./BFTlNJv7.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I};
1
+ import{b as s}from"./BXNjGjOh.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I};
@@ -1 +1 @@
1
- import{t as T,br as r,a_ as W,bz as x,bt as $,b as B,bv as C}from"./O1QHAURn.js";import{bs as L,cd as S,ca as z,a7 as m,ay as f,W as b,bn as D,aA as o}from"./DYhIMPy1.js";import{G}from"./CovkQMd0.js";import{a as H}from"./JmJV-qA7.js";import{dr as j}from"./VZEkDWIM.js";import{Ix as q,gL as E}from"./DNqM68dO.js";function F(i,t){if(new.target)return T({component:F,...i});L(t,!0);const d=()=>C(_,"$workspace$",k),[k,v]=$();let c=r(t,"tab",7),a=r(t,"workspaceId",7),n=r(t,"layoutId",7),p=r(t,"isActive",7);const l=S(a());z(()=>l.set(a()));const _=j(l);var g={get tab(){return c()},set tab(e){c(e),o()},get workspaceId(){return a()},set workspaceId(e){a(e),o()},get layoutId(){return n()},set layoutId(e){n(e),o()},get isActive(){return p()},set isActive(e){p(e),o()},$set:x,$on:(e,s)=>B(t,e,s)},u=m(),w=f(u);{var y=e=>{var s=m(),A=f(s);G(A,a,h=>{H(h,{get workspace(){return d()},showBackToList:!1,onclose:()=>q.dispatch(E(n()??a(),c().id))})}),b(e,s)};W(w,e=>{p()&&d()&&e(y)})}b(i,u);var I=D(g);return v(),I}export{F as default};
1
+ import{t as T,br as r,a_ as W,bz as x,bt as $,b as B,bv as C}from"./O1QHAURn.js";import{bs as L,cd as S,ca as z,a7 as m,ay as f,W as b,bn as D,aA as o}from"./DYhIMPy1.js";import{G}from"./CovkQMd0.js";import{a as H}from"./BOoKSQro.js";import{dr as j}from"./VZEkDWIM.js";import{Ix as q,gL as E}from"./DNqM68dO.js";function F(i,t){if(new.target)return T({component:F,...i});L(t,!0);const d=()=>C(_,"$workspace$",k),[k,v]=$();let c=r(t,"tab",7),a=r(t,"workspaceId",7),n=r(t,"layoutId",7),p=r(t,"isActive",7);const l=S(a());z(()=>l.set(a()));const _=j(l);var g={get tab(){return c()},set tab(e){c(e),o()},get workspaceId(){return a()},set workspaceId(e){a(e),o()},get layoutId(){return n()},set layoutId(e){n(e),o()},get isActive(){return p()},set isActive(e){p(e),o()},$set:x,$on:(e,s)=>B(t,e,s)},u=m(),w=f(u);{var y=e=>{var s=m(),A=f(s);G(A,a,h=>{H(h,{get workspace(){return d()},showBackToList:!1,onclose:()=>q.dispatch(E(n()??a(),c().id))})}),b(e,s)};W(w,e=>{p()&&d()&&e(y)})}b(i,u);var I=D(g);return v(),I}export{F as default};