@intent-hq/web 2.383.2 → 2.383.4

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 (147) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{BDU9DorN.js → -Mic_e6k.js} +1 -1
  3. package/web/app/immutable/chunks/{BvYSMLN-.js → -ZE0BKMJ.js} +1 -1
  4. package/web/app/immutable/chunks/{CERS_x_a.js → 0Z36NhH2.js} +1 -1
  5. package/web/app/immutable/chunks/{HnXWs0wn.js → 12yXK53O.js} +1 -1
  6. package/web/app/immutable/chunks/{BnaqhxMa.js → 35Pj1tWu.js} +1 -1
  7. package/web/app/immutable/chunks/{BALrIQ13.js → 5sSmbvC-.js} +1 -1
  8. package/web/app/immutable/chunks/{BBLmHF-x.js → 6oqjp0oY.js} +1 -1
  9. package/web/app/immutable/chunks/{BnOThusB.js → B1PlU8Mp.js} +2 -2
  10. package/web/app/immutable/chunks/{DYw-jZnX.js → B1QCl1Po.js} +2 -2
  11. package/web/app/immutable/chunks/{C68E7oEN.js → B1poZr5t.js} +1 -1
  12. package/web/app/immutable/chunks/{CTKRrTvZ.js → B48XhjTD.js} +2 -2
  13. package/web/app/immutable/chunks/{CtxKEpQR.js → BAtDEUM7.js} +1 -1
  14. package/web/app/immutable/chunks/{g9tUAsNS.js → BFzamEtR.js} +1 -1
  15. package/web/app/immutable/chunks/{TLXVPYri.js → BIsvX0dB.js} +3 -3
  16. package/web/app/immutable/chunks/{Doz22Fw6.js → BJWnaGKs.js} +1 -1
  17. package/web/app/immutable/chunks/{Dc-K8gB4.js → BLL1wBVI.js} +1 -1
  18. package/web/app/immutable/chunks/{CHJf6CKw.js → BMGB0uZU.js} +1 -1
  19. package/web/app/immutable/chunks/{03HQb6Nz.js → BMv9rEVV.js} +1 -1
  20. package/web/app/immutable/chunks/{Bnurq_Pf.js → BNF7dSgi.js} +2 -2
  21. package/web/app/immutable/chunks/{BYtUt_7N.js → BNcG1DWU.js} +1 -1
  22. package/web/app/immutable/chunks/{CecaUouy.js → BTa8GIiv.js} +2 -2
  23. package/web/app/immutable/chunks/{DYAwS63B.js → BV1ipkUL.js} +1 -1
  24. package/web/app/immutable/chunks/{DPTJGt-4.js → B_Fn14Ok.js} +1 -1
  25. package/web/app/immutable/chunks/{C4oBHTC7.js → Bc3KFcWc.js} +3 -3
  26. package/web/app/immutable/chunks/{DUrqr-_9.js → BdJ_iWAp.js} +1 -1
  27. package/web/app/immutable/chunks/{YJiBWTwd.js → BgxuPkk9.js} +1 -1
  28. package/web/app/immutable/chunks/{kLtCLkab.js → Bi3RVGsg.js} +1 -1
  29. package/web/app/immutable/chunks/{ClJH5EDU.js → BnSzQmM2.js} +1 -1
  30. package/web/app/immutable/chunks/{B-HvfCLM.js → BnaEYx3G.js} +1 -1
  31. package/web/app/immutable/chunks/{DOBbyUSI.js → BoIrWOoc.js} +1 -1
  32. package/web/app/immutable/chunks/{BK3I1582.js → Boyio2o8.js} +1 -1
  33. package/web/app/immutable/chunks/{BCEIpZAe.js → BpboU9n2.js} +1 -1
  34. package/web/app/immutable/chunks/{dbsKZB4V.js → Bt7IO3Ki.js} +1 -1
  35. package/web/app/immutable/chunks/{C5wdJ-5g.js → Bt7Q47HI.js} +1 -1
  36. package/web/app/immutable/chunks/{VQuhn_Lt.js → Bvp3gPe2.js} +1 -1
  37. package/web/app/immutable/chunks/{BsLGFv7V.js → Bw9sjqWK.js} +1 -1
  38. package/web/app/immutable/chunks/{CDTDaiWd.js → C3cn2j3y.js} +1 -1
  39. package/web/app/immutable/chunks/{DOTkiVAt.js → C3vHP-qn.js} +1 -1
  40. package/web/app/immutable/chunks/{BYf4P-Xv.js → C7d9ZbWc.js} +1 -1
  41. package/web/app/immutable/chunks/{DWKRk5qT.js → CATo12kv.js} +1 -1
  42. package/web/app/immutable/chunks/{_Yaq9uZY.js → CBp-yM36.js} +1 -1
  43. package/web/app/immutable/chunks/{1pbfqlmC.js → CDGoCDAX.js} +4 -4
  44. package/web/app/immutable/chunks/{CfqtYdKm.js → CE15e5UF.js} +1 -1
  45. package/web/app/immutable/chunks/{CaOXszWh.js → CFr8iZKI.js} +1 -1
  46. package/web/app/immutable/chunks/{OKklWV7_.js → CGwsFBBd.js} +1 -1
  47. package/web/app/immutable/chunks/{DKN2oFQh.js → CHtJr32B.js} +1 -1
  48. package/web/app/immutable/chunks/{B54vxPSC.js → CIEu92Dv.js} +3 -3
  49. package/web/app/immutable/chunks/{BVGxYq00.js → CJj7ZaOk.js} +1 -1
  50. package/web/app/immutable/chunks/{DqVxq9qz.js → CMHU_cf0.js} +1 -1
  51. package/web/app/immutable/chunks/{CKjDn57H.js → CO3Ad3gs.js} +1 -1
  52. package/web/app/immutable/chunks/{Cq8vwNeW.js → CP-xkzkH.js} +1 -1
  53. package/web/app/immutable/chunks/{DQK1MQRy.js → CPr4uSCV.js} +1 -1
  54. package/web/app/immutable/chunks/{CBvXBpaM.js → CQHTACis.js} +1 -1
  55. package/web/app/immutable/chunks/{DgKxSqnb.js → CSB4cQlc.js} +3 -3
  56. package/web/app/immutable/chunks/{DF4N7xKD.js → CUJZhB5z.js} +1 -1
  57. package/web/app/immutable/chunks/{mEP1tNc7.js → CWoaP7UR.js} +1 -1
  58. package/web/app/immutable/chunks/{Ci6sHn75.js → CY8jnGs7.js} +1 -1
  59. package/web/app/immutable/chunks/{D7OzCs6b.js → CZ1onE9g.js} +1 -1
  60. package/web/app/immutable/chunks/{Bm_BMJ5S.js → Ca13FruI.js} +1 -1
  61. package/web/app/immutable/chunks/{CqaNT709.js → CjZzZn8W.js} +3 -3
  62. package/web/app/immutable/chunks/{DaA4cwB7.js → CnEpmcA-.js} +1 -1
  63. package/web/app/immutable/chunks/{CjoAn_VO.js → Cpi4W9SM.js} +1 -1
  64. package/web/app/immutable/chunks/{CCMszM-p.js → Cqg6DAOX.js} +2 -2
  65. package/web/app/immutable/chunks/{CCsFilO2.js → CruNSA_k.js} +1 -1
  66. package/web/app/immutable/chunks/{-wH-MzHg.js → CtDWHhd5.js} +2 -2
  67. package/web/app/immutable/chunks/{MpqcTAsG.js → CtTTJ9Pl.js} +1 -1
  68. package/web/app/immutable/chunks/{BxKrk2Xm.js → Cv7maMEX.js} +1 -1
  69. package/web/app/immutable/chunks/{DqnZckLn.js → CvQK16ac.js} +1 -1
  70. package/web/app/immutable/chunks/{yOorim_l.js → CvWPR84D.js} +1 -1
  71. package/web/app/immutable/chunks/{BFnrc2L0.js → CvjFWjQI.js} +3 -3
  72. package/web/app/immutable/chunks/{DKAEb0Nq.js → Cxdjn52l.js} +1 -1
  73. package/web/app/immutable/chunks/{CCNu9Rxf.js → CzXxUwZ9.js} +1 -1
  74. package/web/app/immutable/chunks/{BI4Gr7El.js → Czxip--U.js} +1 -1
  75. package/web/app/immutable/chunks/{DMis7v6J.js → DEU72krH.js} +2 -2
  76. package/web/app/immutable/chunks/{COs0nq_h.js → DH-1Jck3.js} +1 -1
  77. package/web/app/immutable/chunks/{DtEcb9Kl.js → DH3NAcDJ.js} +1 -1
  78. package/web/app/immutable/chunks/{CkJj_XU1.js → DIdM8saJ.js} +2 -2
  79. package/web/app/immutable/chunks/{DU6GzJo7.js → DL8v_XLP.js} +1 -1
  80. package/web/app/immutable/chunks/{BNsReuZq.js → DOL2D_mf.js} +1 -1
  81. package/web/app/immutable/chunks/{BL78xDnE.js → DRYK6Su3.js} +1 -1
  82. package/web/app/immutable/chunks/{D9PsslUR.js → DTTFQasE.js} +2 -2
  83. package/web/app/immutable/chunks/{BTLLdzM2.js → DU-k_hXE.js} +1 -1
  84. package/web/app/immutable/chunks/{5Ya2tobY.js → DYguRX86.js} +1 -1
  85. package/web/app/immutable/chunks/{Cv4Nh90j.js → D_Eq4qPA.js} +1 -1
  86. package/web/app/immutable/chunks/{TkG8RZHk.js → D_vQVrz1.js} +1 -1
  87. package/web/app/immutable/chunks/{C6aFracI.js → Dbiz8ybb.js} +1 -1
  88. package/web/app/immutable/chunks/{CPfM5J_u.js → DeQ_Nnwi.js} +1 -1
  89. package/web/app/immutable/chunks/{g_W_KtW7.js → DgL848jV.js} +1 -1
  90. package/web/app/immutable/chunks/{CU2vyfYu.js → Dgfo6hku.js} +1 -1
  91. package/web/app/immutable/chunks/{DynK7LpZ.js → Dh9P66ji.js} +1 -1
  92. package/web/app/immutable/chunks/{DJ7NuUn9.js → Di84urxA.js} +1 -1
  93. package/web/app/immutable/chunks/{BPlFpIis.js → Dk14zZxI.js} +1 -1
  94. package/web/app/immutable/chunks/{DbhHGGnX.js → DkCny-Z-.js} +1 -1
  95. package/web/app/immutable/chunks/{DTKdf69M.js → Dkwe3T9x.js} +1 -1
  96. package/web/app/immutable/chunks/{sSkm7u9g.js → DoRDI0_k.js} +1 -1
  97. package/web/app/immutable/chunks/{BGOOya_A.js → Drv2Rza_.js} +13 -13
  98. package/web/app/immutable/chunks/{D3326bvN.js → DrvBnHFf.js} +3 -3
  99. package/web/app/immutable/chunks/{CRmihGrZ.js → DvmLmn-C.js} +1 -1
  100. package/web/app/immutable/chunks/{Bw02Klel.js → Dw1ghJA6.js} +4 -4
  101. package/web/app/immutable/chunks/{hSGzq1Th.js → DxxuJILr.js} +5 -5
  102. package/web/app/immutable/chunks/{DRJrqXOC.js → F-AjnQny.js} +1 -1
  103. package/web/app/immutable/chunks/{4lxKnD4E.js → HRIwLWKn.js} +1 -1
  104. package/web/app/immutable/chunks/{B73pME8S.js → HlXIpYIa.js} +1 -1
  105. package/web/app/immutable/chunks/{aR25fz44.js → K6lw4N0L.js} +1 -1
  106. package/web/app/immutable/chunks/{DBUDGVnq.js → KcJe_B2f.js} +1 -1
  107. package/web/app/immutable/chunks/{ML4TWB19.js → MIFcwWBB.js} +1 -1
  108. package/web/app/immutable/chunks/{Bk0JLGzR.js → QMwjEX1-.js} +1 -1
  109. package/web/app/immutable/chunks/{B6Ea_mQK.js → TLsmZI1o.js} +1 -1
  110. package/web/app/immutable/chunks/{46R-6bwp.js → TMWKDIeD.js} +1 -1
  111. package/web/app/immutable/chunks/{D89oEjt1.js → TwdEefIb.js} +1 -1
  112. package/web/app/immutable/chunks/{gMS62uii.js → UqfcQTtt.js} +1 -1
  113. package/web/app/immutable/chunks/{CCOwocDi.js → Y-O_IvTW.js} +1 -1
  114. package/web/app/immutable/chunks/{CMW1kPYq.js → Y3tz73Wx.js} +1 -1
  115. package/web/app/immutable/chunks/{BUAZt4k8.js → YjYi8jsS.js} +1 -1
  116. package/web/app/immutable/chunks/{BUtMbPHc.js → bXVL0d4u.js} +1 -1
  117. package/web/app/immutable/chunks/{C5E04JHB.js → cmJ0YuhX.js} +1 -1
  118. package/web/app/immutable/chunks/{pWMJoQQd.js → gTlamSLB.js} +3 -3
  119. package/web/app/immutable/chunks/{C9nDXeDI.js → jIe9AFY3.js} +1 -1
  120. package/web/app/immutable/chunks/{1eGVa7uN.js → mbHeC_bT.js} +1 -1
  121. package/web/app/immutable/chunks/{C2UQ69-V.js → oBUj9ZOr.js} +1 -1
  122. package/web/app/immutable/chunks/{DhFCW7ui.js → qCXYeue5.js} +1 -1
  123. package/web/app/immutable/chunks/{BQpH3OoI.js → t0y-kHkY.js} +1 -1
  124. package/web/app/immutable/chunks/{B8eFCa5E.js → usXRXUNe.js} +1 -1
  125. package/web/app/immutable/chunks/{BaJk_Nxp.js → vELdnnGk.js} +1 -1
  126. package/web/app/immutable/chunks/{t_AdNc5B.js → w8vA4Z3z.js} +1 -1
  127. package/web/app/immutable/chunks/{NV_vO3Eg.js → wVIKqVlE.js} +4 -4
  128. package/web/app/immutable/chunks/{SQ1JAgBB.js → x81_VdcZ.js} +1 -1
  129. package/web/app/immutable/entry/{app.D9Jtjo9u.js → app.CQjcFUvX.js} +2 -2
  130. package/web/app/immutable/entry/start.BSd130By.js +1 -0
  131. package/web/app/immutable/nodes/{0.D7G8zYtJ.js → 0.BZ6BuxeE.js} +1 -1
  132. package/web/app/immutable/nodes/{1.CeP6l7to.js → 1.DxAIVMOr.js} +1 -1
  133. package/web/app/immutable/nodes/{10.B0HUYmSO.js → 10.UdD3v_c2.js} +4 -4
  134. package/web/app/immutable/nodes/{11.DK72_yYq.js → 11.DFg9W_ST.js} +1 -1
  135. package/web/app/immutable/nodes/{15.u_u2o_gG.js → 15.7ofOw_b1.js} +1 -1
  136. package/web/app/immutable/nodes/{19.Ckyt7QSw.js → 19.C7CCQoBf.js} +2 -2
  137. package/web/app/immutable/nodes/{2.B6dSCynl.js → 2.DuqlsYHB.js} +4 -4
  138. package/web/app/immutable/nodes/{3.BYMfscY7.js → 3.DRC75TZt.js} +1 -1
  139. package/web/app/immutable/nodes/{4.BbNp4BGO.js → 4.DKVGzRd0.js} +1 -1
  140. package/web/app/immutable/nodes/{5.BY-7-cOX.js → 5.DY0hRGuv.js} +1 -1
  141. package/web/app/immutable/nodes/{6.CgyQkAW2.js → 6.TN7w_X2Z.js} +1 -1
  142. package/web/app/immutable/nodes/{7.573udsYL.js → 7.swMVj6u3.js} +1 -1
  143. package/web/app/immutable/nodes/{8.CRV-jSmC.js → 8.DlrgL_9b.js} +1 -1
  144. package/web/app/immutable/nodes/{9.BWV1lf5B.js → 9.CSFgmDLj.js} +4 -4
  145. package/web/app/version.json +1 -1
  146. package/web/index.html +9 -9
  147. package/web/app/immutable/entry/start.CkN6A8cF.js +0 -1
@@ -1,2 +1,2 @@
1
- import{t as Xt,bo as de,_ as aa,bw as Yt,bs as ge,bq as pr,b as Gt,bm as d}from"./C0QTy0Sy.js";import{bs as Jt,ca as se,aD as e,bH as c,a5 as F,bA as k,W as s,bn as Zt,bV as j,c9 as i,aA as ce,c6 as Ht,ay as ve,be as ot,b$ as ct,b_ as I,bO as m,bS as g,bl as C,aB as x,bj as oa,aw as ut,ai as ia,c5 as ur,a as Lr,a7 as Ue,aj as yt,cd as na,br as la,bf as sa}from"./3SdAC2_C.js";import{i as Y}from"./bhKPSdq4.js";import{k as Mr}from"./-K3ARgq0.js";import{g as Ut}from"./B6S6VNu7.js";import{c as Nt}from"./CUkDMZwP.js";import{s as Qe,g as jt,f as Kt}from"./7UPrdiE9.js";import{b as Rr}from"./Dn334wJv.js";import{Jv as R,nX as jr,we as Ur,wd as Vr,LL as da,LM as ca,eJ as ua,eK as fa,Lb as yr,m5 as nr,Cx as $r,sG as kr,oj as va,A2 as pa,ac as Ir,nZ as ga,K2 as ma,Ki as _a,nx as ha,iW as wa,vG as ba,Av as xa,La as Pa}from"./tr-2J8Mf.js";import{g as ya}from"./DWGXN6Nr.js";import{a as $a,h as ka,j as Ia,c as Sa,d as Ca,i as Fa,e as Da,f as Sr,g as Ta,b as lr}from"./Dsr4GELp.js";import{bO as Ea,b$ as La,dH as Ma}from"./BaujsV9k.js";import{w as Cr,d as Ra}from"./wEnqV1Ol.js";import{f as ja}from"./EK6zOAHM.js";import{m as sr}from"./BmTMWrby.js";import{f as Te}from"./FzlZUztb.js";import{h as Ua}from"./DCRuihKm.js";import"./CrD0jtXE.js";import{F as dt,ac as Va,au as za,aZ as Aa,b3 as Ot,ct as Wa,cu as Na,bm as Ba,cS as Ha,c9 as Oa}from"./U9jJmfYa.js";import{E as qa,b as Ka,S as Fr}from"./fiz8N_zQ.js";import{c as Xa}from"./ChTqQfQN.js";import"./B4SiDSWP.js";import{$ as Ya}from"./BGOOya_A.js";import{i as dr,b as Ga,a as Ja}from"./H2jLkRRS.js";import{C as fr,p as Za}from"./DTuql3Rj.js";import{M as Qa}from"./D3326bvN.js";import{l as cr,m as zr}from"./CE7dsja4.js";import"./Bsh6nUhU.js";import"./QeBH-DWE.js";import{M as Bt}from"./CDK_hSiv.js";import{V as eo}from"./CqcqWJoa.js";import{bT as to,b7 as ro}from"./CCOwocDi.js";import{g as ao}from"./yFcbscNn.js";import{H as oo}from"./Bqd7fdCF.js";import{g as io,W as no}from"./CO5zWp8I.js";import{b as lo,h as so}from"./BxEf7uwl.js";import{t as co}from"./BfojStRz.js";const Dr=1024*1024,uo=5e3;function fo(A,_){if(A.length>Dr||new TextEncoder().encode(A).byteLength>Dr){_(null);return}let re;try{re=new Worker(new URL("/app/immutable/workers/html-file-preview.worker-BfFljPK-.js",import.meta.url),{type:"module"})}catch{_(null);return}let Be=!1;const ee=setTimeout(()=>O(null),uo);function P(){Be||(Be=!0,clearTimeout(ee),re.terminate())}function O(ae){Be||(P(),_(ae))}return re.onmessage=({data:ae})=>O(ae),re.onerror=ae=>{ae.preventDefault(),O(null)},re.postMessage(A),P}const Ar=R.createSelector((A,_)=>jr(A.pdfPreview.previews,_));var vo=x('<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),po=x('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function vr(A,_){if(new.target)return Xt({component:vr,...A});Jt(_,!0);const re=()=>ge(ye,"$preview",Be),[Be,ee]=pr();let P=de(_,"workspaceId",7),O=de(_,"filePath",7),ae=de(_,"gitRootId",7);const Ee=crypto.randomUUID(),ye=Ar(Ee),be=new WeakMap;let oe=j(null),et=j(void 0),U=j(1),B=j(1),pe=j(!0),xe=j(!1),Le=j(null),W=j(0);const $e=i(()=>re()?.error??e(Le)),Ce=i(()=>e($e)==="missing"?d.file_pdf_missing_error():e($e)==="large"?d.file_pdf_large_error():e($e)==="invalid"?d.file_pdf_invalid_error():e($e)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());se(()=>{const v=P(),f=O();e(W);const ie=crypto.randomUUID();return R.dispatch(Ur(Ee,ie,v,f,...ae()?[{gitRootId:ae()}]:[])),()=>{R.dispatch(Vr(Ee,ie))}}),se(()=>{const v=re()?.url;let f=!1,ie;if(c(oe,null),c(Le,null),c(pe,!0),c(U,1),c(B,1),!!v)return(async()=>{try{const{loadPdfDocument:y}=await aa(async()=>{const{loadPdfDocument:N}=await import("./cb1JHFKl.js");return{loadPdfDocument:N}},[],import.meta.url);if(f)return;ie=y(v);const G=await ie.promise;f||c(oe,G)}catch(y){if(f)return;c(Le,y instanceof Error&&y.name==="PasswordException"?"password":y instanceof Error&&y.name==="InvalidPDFException"?"invalid":"load",!0)}finally{f||c(pe,!1)}})(),()=>{f=!0,ie?.destroy()}}),se(()=>{const v=e(oe),f=e(et),ie=e(U),y=e(B);if(!v||!f)return;let G=!1,N,D;const fe=()=>{if(!D)return;const J=(be.get(D)??1)-1;J?be.set(D,J):(be.delete(D),D.cleanup()),D=void 0};return c(xe,!0),(async()=>{try{if(D=await v.getPage(ie),be.set(D,(be.get(D)??0)+1),G){fe();return}const J=D.getViewport({scale:y}),ne=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(J.width*J.height)));f.width=Math.ceil(J.width*ne),f.height=Math.ceil(J.height*ne),f.style.width=`${J.width}px`,f.style.height=`${J.height}px`,N=D.render({canvas:f,viewport:J,transform:[ne,0,0,ne,0,0]}),await N.promise}catch{G||c(Le,"invalid")}finally{G||c(xe,!1)}})(),()=>{G=!0,N?.cancel(),N?N.promise.then(fe,fe):fe()}});var qe={get workspaceId(){return P()},set workspaceId(v){P(v),ce()},get filePath(){return O()},set filePath(v){O(v),ce()},get gitRootId(){return ae()},set gitRootId(v){ae(v),ce()},$set:Yt,$on:(v,f)=>Gt(_,v,f)},Ve=po(),Ke=F(Ve);{var ue=v=>{{const f=y=>{ot();var G=ct();I(()=>m(G,e(Ce))),s(y,G)};let ie=i(()=>d.ui_combobox_retry_label());qa(v,{onRetry:()=>Ht(W),get retryLabel(){return e(ie)},class:"m-auto",message:f,$$slots:{message:!0}})}},a=v=>{{let f=i(()=>d.file_pdf_loading_label());Ka(v,{get label(){return e(f)},count:1,class:"p-4"})}},l=v=>{var f=vo(),ie=ve(f),y=F(ie);{let me=i(()=>e(U)<=1);Te(y,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U,-1),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_previous_label()]),s(Me,_e)},$$slots:{default:!0}})}var G=g(y,2),N=C(G,!0),D=g(G,2);{let me=i(()=>e(U)>=e(oe).numPages);Te(D,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_next_label()]),s(Me,_e)},$$slots:{default:!0}})}var fe=g(D,2);{let me=i(()=>e(B)<=.25);Te(fe,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.max(.25,e(B)-.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}var J=g(fe,2),ne=C(J,!0),ft=g(J,2);{let me=i(()=>e(B)>=3);Te(ft,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.min(3,e(B)+.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}k(ie);var vt=g(ie,2),pt=F(vt);let bt;Rr(pt,me=>c(et,me),()=>e(et)),k(vt),I((me,Me,tt)=>{m(N,me),m(ne,Me),Qe(vt,"aria-busy",e(xe)),Qe(pt,"aria-label",tt),bt=jt(pt,"",bt,{visibility:e(xe)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:cr(e(U)),total:cr(e(oe).numPages)}),()=>zr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:O(),page:cr(e(U))})]),s(v,f)};Y(Ke,v=>{e($e)?v(ue):e(pe)||re()?.status==="loading"?v(a,1):e(oe)&&v(l,2)})}k(Ve),s(A,Ve);var q=Zt(qe);return ee(),q}const go=R.createSelector((A,_)=>jr(A.videoPreview.previews,_));var mo=x('<p role="status"> </p>'),_o=x('<p role="alert"> </p>'),ho=x('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),wo=x('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),bo=x('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Wr(A,_){if(new.target)return Xt({component:Wr,...A});Jt(_,!0);const re=()=>ge(et,"$preview",Be),[Be,ee]=pr();let P=de(_,"sourceUrl",7),O=de(_,"fileName",7),ae=de(_,"allowDownload",7),Ee=de(_,"downloading",7),ye=de(_,"onDownload",7),be=j(null);const oe=crypto.randomUUID(),et=go(oe),U=i(()=>re()?.status==="loading"),B=i(()=>e(be)??re()?.error);let pe=!1,xe=!1;oa(()=>{xe=!0,R.dispatch(da(oe))});function Le(){if(xe||e(U))return;const a=P().startsWith("workspace-file://")?new URL(P()):null;if(pe||!a||!a.pathname.toLowerCase().endsWith(".mp4")){c(be,"unsupported");return}pe=!0,a.searchParams.set("preview","h264"),R.dispatch(ca(oe,a.hostname,a.toString()))}function W(a){if(xe)return;const l=a.currentTarget.error?.code;l===2?c(be,"network"):l!==1&&Le()}var $e={get sourceUrl(){return P()},set sourceUrl(a){P(a),ce()},get fileName(){return O()},set fileName(a){O(a),ce()},get allowDownload(){return ae()},set allowDownload(a){ae(a),ce()},get downloading(){return Ee()},set downloading(a){Ee(a),ce()},get onDownload(){return ye()},set onDownload(a){ye(a),ce()},$set:Yt,$on:(a,l)=>Gt(_,a,l)},Ce=bo(),qe=F(Ce);{var Ve=a=>{var l=ho(),q=F(l),v=C(q,!0),f=g(q,2);{var ie=D=>{var fe=mo(),J=C(fe,!0);I(ne=>m(J,ne),[()=>d.editor_fileViewer_videoPreparing_label()]),s(D,fe)},y=D=>{var fe=_o(),J=C(fe,!0);I(ne=>m(J,ne),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(D,fe)};Y(f,D=>{e(U)?D(ie):D(y,-1)})}var G=g(f,2);{var N=D=>{Te(D,{variant:"secondary",size:"sm",get onclick(){return ye()},get disabled(){return Ee()},children:(fe,J)=>{ot();var ne=ct();I(ft=>m(ne,ft),[()=>d.layout_fileTab_downloadFile_label()]),s(fe,ne)},$$slots:{default:!0}})};Y(G,D=>{ae()&&D(N)})}k(l),I(()=>m(v,O())),s(a,l)},Ke=a=>{var l=wo(),q=C(l,!0);I(v=>{Qe(l,"src",re()?.url??P()),m(q,v)},[()=>d.editor_fileViewer_videoUnsupported_label()]),ut("error",l,W),ut("loadedmetadata",l,v=>{v.currentTarget.videoWidth===0&&Le()}),s(a,l)};Y(qe,a=>{e(B)||e(U)?a(Ve):a(Ke,-1)})}k(Ce),s(A,Ce);var ue=Zt($e);return ee(),ue}var xo=x('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Po=x('<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>'),yo=x('<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>'),$o=x('<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>'),ko=x("<!> ",1),Io=x('<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>'),So=x('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Co=x('<td class="border border-border px-2 py-1 text-xs"> </td>'),Fo=x("<tr></tr>"),Do=x('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),To=x('<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>'),Eo=x('<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>'),Lo=x('<div class="h-full flex flex-col"><!></div>');function qt(A,_){if(new.target)return Xt({component:qt,...A});Jt(_,!0);const re=t=>{var o=xo(),u=ve(o);{let V=i(()=>d.editor_fileViewer_zoomOut_tooltip());Te(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:fe,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Wa},size:"sm"})},$$slots:{default:!0}})}var w=g(u,2),$=C(w,!0),E=g(w,2);{let V=i(()=>d.editor_fileViewer_zoomIn_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:D,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Na},size:"sm"})},$$slots:{default:!0}})}ot(2),I(()=>m($,e(Le))),s(t,o)},Be=Xa("FileViewer");let ee=de(_,"filePath",7),P=de(_,"fileContent",7,""),O=de(_,"sourceUrl",7),ae=de(_,"language",7),Ee=de(_,"isBinary",7),ye=de(_,"allowDownload",7,!0),be=de(_,"onDownload",7),oe=de(_,"downloading",7,!1);const et=t=>{const o=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(o)?"image":o==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(o)?"video":["mp3","wav","ogg","m4a","flac"].includes(o)?"audio":o==="pdf"?"pdf":["md","markdown"].includes(o)?"markdown":o==="json"?"json":o==="csv"?"csv":["yaml","yml"].includes(o)?"yaml":o==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(o)?"archive":["exe","dll","so","dylib","wasm"].includes(o)?"binary":"text"},U=i(()=>et(ee())),B=i(()=>ee().split("/").pop()||d.editor_fileViewer_unknown_fallback());let pe=j(100),xe=j(0);const Le=i(()=>zr(e(pe)/100,{style:"percent",maximumFractionDigits:0}));let W=j(!1),$e=j(0),Ce=j(0),qe=j(0),Ve=j(0),Ke=j(!1),ue=null;function a(){const t=ue;ue=null,c(Ke,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function l(t){if(t.button!==0||!t.isPrimary||ue)return;const o=t.currentTarget;o.setPointerCapture(t.pointerId),ue={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:o},c(Ke,!0),t.preventDefault()}function q(t){if(!(!ue||t.pointerId!==ue.pointerId)){if((t.buttons&1)===0){a();return}c(qe,ue.viewport.scrollLeft,!0),c(Ve,ue.viewport.scrollTop,!0),c($e,e($e)+(t.clientX-ue.x)),c(Ce,e(Ce)+(t.clientY-ue.y)),ue.x=t.clientX,ue.y=t.clientY}}function v(t){t.pointerId===ue?.pointerId&&a()}se(()=>{ee(),O(),e(pe),e(xe),c(qe,0),c(Ve,0)}),se(()=>(ee(),O(),ur(()=>{a(),c($e,0),c(Ce,0)}),a));const f=t=>{const o=t.split(".").pop()?.toLowerCase();return o==="jpg"||o==="jpeg"?"image/jpeg":o==="png"?"image/png":o==="gif"?"image/gif":o==="webp"?"image/webp":"application/octet-stream"},ie=t=>{const o=t.split(".").pop()?.toLowerCase();if(o==="mp4")return"video/mp4";if(o==="webm")return"video/webm"},y=()=>{if(O())return O();if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():Ee()?`data:${f(ee())};base64,${P()}`:`data:${f(ee())};base64,${P()}`;if(P()instanceof ArrayBuffer){const o=new Uint8Array(P()).reduce((w,$)=>w+String.fromCharCode($),""),u=btoa(o);return`data:${f(ee())};base64,${u}`}return""},G=()=>{if(O())return O();const t=ie(ee());if(!t)return"";if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():`data:${t};base64,${P()}`;const o=new Uint8Array(P()),u=[],w=32768;for(let $=0;$<o.length;$+=w)u.push(String.fromCharCode(...o.subarray($,$+w)));return`data:${t};base64,${btoa(u.join(""))}`},N=()=>{const t=typeof P()=="string"?new TextEncoder().encode(P()):new Uint8Array(P()),o=[],u=32768;for(let w=0;w<t.length;w+=u)o.push(String.fromCharCode(...t.subarray(w,w+u)));return`data:image/svg+xml;base64,${btoa(o.join(""))}`},D=()=>{c(pe,Math.min(e(pe)+25,500),!0)},fe=()=>{c(pe,Math.max(e(pe)-25,25),!0)},J=()=>{c(xe,(e(xe)+90)%360)},ne=()=>{if(!ye()||oe())return;if(be()){be()();return}const t=document.createElement("a");t.href=e(U)==="video"?G():e(U)==="svg"?N():y(),t.download=e(B),t.click()},ft=async()=>{try{const t=y(),o=new Image;o.crossOrigin="anonymous";const u=await new Promise((w,$)=>{o.onload=()=>{const E=document.createElement("canvas");E.width=o.naturalWidth,E.height=o.naturalHeight;const V=E.getContext("2d");if(!V){$(new Error("Failed to get canvas context"));return}V.drawImage(o,0,0),E.toBlob(T=>{T?w(T):$(new Error("Failed to create blob from canvas"))},"image/png",1)},o.onerror=()=>$(new Error("Failed to load image")),o.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),c(W,!0),setTimeout(()=>c(W,!1),2e3)}catch(t){Be.error("Failed to copy image:",t)}},vt=t=>{try{const o=JSON.parse(t);return JSON.stringify(o,null,2)}catch{return t}},pt=t=>t.split(`
1
+ import{t as Xt,bo as de,_ as aa,bw as Yt,bs as ge,bq as pr,b as Gt,bm as d}from"./C0QTy0Sy.js";import{bs as Jt,ca as se,aD as e,bH as c,a5 as F,bA as k,W as s,bn as Zt,bV as j,c9 as i,aA as ce,c6 as Ht,ay as ve,be as ot,b$ as ct,b_ as I,bO as m,bS as g,bl as C,aB as x,bj as oa,aw as ut,ai as ia,c5 as ur,a as Lr,a7 as Ue,aj as yt,cd as na,br as la,bf as sa}from"./3SdAC2_C.js";import{i as Y}from"./bhKPSdq4.js";import{k as Mr}from"./-K3ARgq0.js";import{g as Ut}from"./B6S6VNu7.js";import{c as Nt}from"./CUkDMZwP.js";import{s as Qe,g as jt,f as Kt}from"./7UPrdiE9.js";import{b as Rr}from"./Dn334wJv.js";import{Jv as R,nX as jr,we as Ur,wd as Vr,LL as da,LM as ca,eJ as ua,eK as fa,Lb as yr,m5 as nr,Cx as $r,sG as kr,oj as va,A2 as pa,ac as Ir,nZ as ga,K2 as ma,Ki as _a,nx as ha,iW as wa,vG as ba,Av as xa,La as Pa}from"./tr-2J8Mf.js";import{g as ya}from"./DWGXN6Nr.js";import{a as $a,h as ka,j as Ia,c as Sa,d as Ca,i as Fa,e as Da,f as Sr,g as Ta,b as lr}from"./Dsr4GELp.js";import{bO as Ea,b$ as La,dH as Ma}from"./BaujsV9k.js";import{w as Cr,d as Ra}from"./wEnqV1Ol.js";import{f as ja}from"./EK6zOAHM.js";import{m as sr}from"./BmTMWrby.js";import{f as Te}from"./FzlZUztb.js";import{h as Ua}from"./DCRuihKm.js";import"./CrD0jtXE.js";import{F as dt,ac as Va,au as za,aZ as Aa,b3 as Ot,ct as Wa,cu as Na,bm as Ba,cS as Ha,c9 as Oa}from"./U9jJmfYa.js";import{E as qa,b as Ka,S as Fr}from"./fiz8N_zQ.js";import{c as Xa}from"./ChTqQfQN.js";import"./B4SiDSWP.js";import{$ as Ya}from"./Drv2Rza_.js";import{i as dr,b as Ga,a as Ja}from"./H2jLkRRS.js";import{C as fr,p as Za}from"./DTuql3Rj.js";import{M as Qa}from"./DrvBnHFf.js";import{l as cr,m as zr}from"./CE7dsja4.js";import"./Bsh6nUhU.js";import"./QeBH-DWE.js";import{M as Bt}from"./CDK_hSiv.js";import{V as eo}from"./CqcqWJoa.js";import{bT as to,b7 as ro}from"./Y-O_IvTW.js";import{g as ao}from"./yFcbscNn.js";import{H as oo}from"./Bqd7fdCF.js";import{g as io,W as no}from"./CO5zWp8I.js";import{b as lo,h as so}from"./BxEf7uwl.js";import{t as co}from"./BfojStRz.js";const Dr=1024*1024,uo=5e3;function fo(A,_){if(A.length>Dr||new TextEncoder().encode(A).byteLength>Dr){_(null);return}let re;try{re=new Worker(new URL("/app/immutable/workers/html-file-preview.worker-BfFljPK-.js",import.meta.url),{type:"module"})}catch{_(null);return}let Be=!1;const ee=setTimeout(()=>O(null),uo);function P(){Be||(Be=!0,clearTimeout(ee),re.terminate())}function O(ae){Be||(P(),_(ae))}return re.onmessage=({data:ae})=>O(ae),re.onerror=ae=>{ae.preventDefault(),O(null)},re.postMessage(A),P}const Ar=R.createSelector((A,_)=>jr(A.pdfPreview.previews,_));var vo=x('<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),po=x('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function vr(A,_){if(new.target)return Xt({component:vr,...A});Jt(_,!0);const re=()=>ge(ye,"$preview",Be),[Be,ee]=pr();let P=de(_,"workspaceId",7),O=de(_,"filePath",7),ae=de(_,"gitRootId",7);const Ee=crypto.randomUUID(),ye=Ar(Ee),be=new WeakMap;let oe=j(null),et=j(void 0),U=j(1),B=j(1),pe=j(!0),xe=j(!1),Le=j(null),W=j(0);const $e=i(()=>re()?.error??e(Le)),Ce=i(()=>e($e)==="missing"?d.file_pdf_missing_error():e($e)==="large"?d.file_pdf_large_error():e($e)==="invalid"?d.file_pdf_invalid_error():e($e)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());se(()=>{const v=P(),f=O();e(W);const ie=crypto.randomUUID();return R.dispatch(Ur(Ee,ie,v,f,...ae()?[{gitRootId:ae()}]:[])),()=>{R.dispatch(Vr(Ee,ie))}}),se(()=>{const v=re()?.url;let f=!1,ie;if(c(oe,null),c(Le,null),c(pe,!0),c(U,1),c(B,1),!!v)return(async()=>{try{const{loadPdfDocument:y}=await aa(async()=>{const{loadPdfDocument:N}=await import("./cb1JHFKl.js");return{loadPdfDocument:N}},[],import.meta.url);if(f)return;ie=y(v);const G=await ie.promise;f||c(oe,G)}catch(y){if(f)return;c(Le,y instanceof Error&&y.name==="PasswordException"?"password":y instanceof Error&&y.name==="InvalidPDFException"?"invalid":"load",!0)}finally{f||c(pe,!1)}})(),()=>{f=!0,ie?.destroy()}}),se(()=>{const v=e(oe),f=e(et),ie=e(U),y=e(B);if(!v||!f)return;let G=!1,N,D;const fe=()=>{if(!D)return;const J=(be.get(D)??1)-1;J?be.set(D,J):(be.delete(D),D.cleanup()),D=void 0};return c(xe,!0),(async()=>{try{if(D=await v.getPage(ie),be.set(D,(be.get(D)??0)+1),G){fe();return}const J=D.getViewport({scale:y}),ne=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(J.width*J.height)));f.width=Math.ceil(J.width*ne),f.height=Math.ceil(J.height*ne),f.style.width=`${J.width}px`,f.style.height=`${J.height}px`,N=D.render({canvas:f,viewport:J,transform:[ne,0,0,ne,0,0]}),await N.promise}catch{G||c(Le,"invalid")}finally{G||c(xe,!1)}})(),()=>{G=!0,N?.cancel(),N?N.promise.then(fe,fe):fe()}});var qe={get workspaceId(){return P()},set workspaceId(v){P(v),ce()},get filePath(){return O()},set filePath(v){O(v),ce()},get gitRootId(){return ae()},set gitRootId(v){ae(v),ce()},$set:Yt,$on:(v,f)=>Gt(_,v,f)},Ve=po(),Ke=F(Ve);{var ue=v=>{{const f=y=>{ot();var G=ct();I(()=>m(G,e(Ce))),s(y,G)};let ie=i(()=>d.ui_combobox_retry_label());qa(v,{onRetry:()=>Ht(W),get retryLabel(){return e(ie)},class:"m-auto",message:f,$$slots:{message:!0}})}},a=v=>{{let f=i(()=>d.file_pdf_loading_label());Ka(v,{get label(){return e(f)},count:1,class:"p-4"})}},l=v=>{var f=vo(),ie=ve(f),y=F(ie);{let me=i(()=>e(U)<=1);Te(y,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U,-1),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_previous_label()]),s(Me,_e)},$$slots:{default:!0}})}var G=g(y,2),N=C(G,!0),D=g(G,2);{let me=i(()=>e(U)>=e(oe).numPages);Te(D,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_next_label()]),s(Me,_e)},$$slots:{default:!0}})}var fe=g(D,2);{let me=i(()=>e(B)<=.25);Te(fe,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.max(.25,e(B)-.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}var J=g(fe,2),ne=C(J,!0),ft=g(J,2);{let me=i(()=>e(B)>=3);Te(ft,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.min(3,e(B)+.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}k(ie);var vt=g(ie,2),pt=F(vt);let bt;Rr(pt,me=>c(et,me),()=>e(et)),k(vt),I((me,Me,tt)=>{m(N,me),m(ne,Me),Qe(vt,"aria-busy",e(xe)),Qe(pt,"aria-label",tt),bt=jt(pt,"",bt,{visibility:e(xe)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:cr(e(U)),total:cr(e(oe).numPages)}),()=>zr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:O(),page:cr(e(U))})]),s(v,f)};Y(Ke,v=>{e($e)?v(ue):e(pe)||re()?.status==="loading"?v(a,1):e(oe)&&v(l,2)})}k(Ve),s(A,Ve);var q=Zt(qe);return ee(),q}const go=R.createSelector((A,_)=>jr(A.videoPreview.previews,_));var mo=x('<p role="status"> </p>'),_o=x('<p role="alert"> </p>'),ho=x('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),wo=x('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),bo=x('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Wr(A,_){if(new.target)return Xt({component:Wr,...A});Jt(_,!0);const re=()=>ge(et,"$preview",Be),[Be,ee]=pr();let P=de(_,"sourceUrl",7),O=de(_,"fileName",7),ae=de(_,"allowDownload",7),Ee=de(_,"downloading",7),ye=de(_,"onDownload",7),be=j(null);const oe=crypto.randomUUID(),et=go(oe),U=i(()=>re()?.status==="loading"),B=i(()=>e(be)??re()?.error);let pe=!1,xe=!1;oa(()=>{xe=!0,R.dispatch(da(oe))});function Le(){if(xe||e(U))return;const a=P().startsWith("workspace-file://")?new URL(P()):null;if(pe||!a||!a.pathname.toLowerCase().endsWith(".mp4")){c(be,"unsupported");return}pe=!0,a.searchParams.set("preview","h264"),R.dispatch(ca(oe,a.hostname,a.toString()))}function W(a){if(xe)return;const l=a.currentTarget.error?.code;l===2?c(be,"network"):l!==1&&Le()}var $e={get sourceUrl(){return P()},set sourceUrl(a){P(a),ce()},get fileName(){return O()},set fileName(a){O(a),ce()},get allowDownload(){return ae()},set allowDownload(a){ae(a),ce()},get downloading(){return Ee()},set downloading(a){Ee(a),ce()},get onDownload(){return ye()},set onDownload(a){ye(a),ce()},$set:Yt,$on:(a,l)=>Gt(_,a,l)},Ce=bo(),qe=F(Ce);{var Ve=a=>{var l=ho(),q=F(l),v=C(q,!0),f=g(q,2);{var ie=D=>{var fe=mo(),J=C(fe,!0);I(ne=>m(J,ne),[()=>d.editor_fileViewer_videoPreparing_label()]),s(D,fe)},y=D=>{var fe=_o(),J=C(fe,!0);I(ne=>m(J,ne),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(D,fe)};Y(f,D=>{e(U)?D(ie):D(y,-1)})}var G=g(f,2);{var N=D=>{Te(D,{variant:"secondary",size:"sm",get onclick(){return ye()},get disabled(){return Ee()},children:(fe,J)=>{ot();var ne=ct();I(ft=>m(ne,ft),[()=>d.layout_fileTab_downloadFile_label()]),s(fe,ne)},$$slots:{default:!0}})};Y(G,D=>{ae()&&D(N)})}k(l),I(()=>m(v,O())),s(a,l)},Ke=a=>{var l=wo(),q=C(l,!0);I(v=>{Qe(l,"src",re()?.url??P()),m(q,v)},[()=>d.editor_fileViewer_videoUnsupported_label()]),ut("error",l,W),ut("loadedmetadata",l,v=>{v.currentTarget.videoWidth===0&&Le()}),s(a,l)};Y(qe,a=>{e(B)||e(U)?a(Ve):a(Ke,-1)})}k(Ce),s(A,Ce);var ue=Zt($e);return ee(),ue}var xo=x('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Po=x('<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>'),yo=x('<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>'),$o=x('<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>'),ko=x("<!> ",1),Io=x('<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>'),So=x('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Co=x('<td class="border border-border px-2 py-1 text-xs"> </td>'),Fo=x("<tr></tr>"),Do=x('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),To=x('<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>'),Eo=x('<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>'),Lo=x('<div class="h-full flex flex-col"><!></div>');function qt(A,_){if(new.target)return Xt({component:qt,...A});Jt(_,!0);const re=t=>{var o=xo(),u=ve(o);{let V=i(()=>d.editor_fileViewer_zoomOut_tooltip());Te(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:fe,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Wa},size:"sm"})},$$slots:{default:!0}})}var w=g(u,2),$=C(w,!0),E=g(w,2);{let V=i(()=>d.editor_fileViewer_zoomIn_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:D,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Na},size:"sm"})},$$slots:{default:!0}})}ot(2),I(()=>m($,e(Le))),s(t,o)},Be=Xa("FileViewer");let ee=de(_,"filePath",7),P=de(_,"fileContent",7,""),O=de(_,"sourceUrl",7),ae=de(_,"language",7),Ee=de(_,"isBinary",7),ye=de(_,"allowDownload",7,!0),be=de(_,"onDownload",7),oe=de(_,"downloading",7,!1);const et=t=>{const o=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(o)?"image":o==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(o)?"video":["mp3","wav","ogg","m4a","flac"].includes(o)?"audio":o==="pdf"?"pdf":["md","markdown"].includes(o)?"markdown":o==="json"?"json":o==="csv"?"csv":["yaml","yml"].includes(o)?"yaml":o==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(o)?"archive":["exe","dll","so","dylib","wasm"].includes(o)?"binary":"text"},U=i(()=>et(ee())),B=i(()=>ee().split("/").pop()||d.editor_fileViewer_unknown_fallback());let pe=j(100),xe=j(0);const Le=i(()=>zr(e(pe)/100,{style:"percent",maximumFractionDigits:0}));let W=j(!1),$e=j(0),Ce=j(0),qe=j(0),Ve=j(0),Ke=j(!1),ue=null;function a(){const t=ue;ue=null,c(Ke,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function l(t){if(t.button!==0||!t.isPrimary||ue)return;const o=t.currentTarget;o.setPointerCapture(t.pointerId),ue={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:o},c(Ke,!0),t.preventDefault()}function q(t){if(!(!ue||t.pointerId!==ue.pointerId)){if((t.buttons&1)===0){a();return}c(qe,ue.viewport.scrollLeft,!0),c(Ve,ue.viewport.scrollTop,!0),c($e,e($e)+(t.clientX-ue.x)),c(Ce,e(Ce)+(t.clientY-ue.y)),ue.x=t.clientX,ue.y=t.clientY}}function v(t){t.pointerId===ue?.pointerId&&a()}se(()=>{ee(),O(),e(pe),e(xe),c(qe,0),c(Ve,0)}),se(()=>(ee(),O(),ur(()=>{a(),c($e,0),c(Ce,0)}),a));const f=t=>{const o=t.split(".").pop()?.toLowerCase();return o==="jpg"||o==="jpeg"?"image/jpeg":o==="png"?"image/png":o==="gif"?"image/gif":o==="webp"?"image/webp":"application/octet-stream"},ie=t=>{const o=t.split(".").pop()?.toLowerCase();if(o==="mp4")return"video/mp4";if(o==="webm")return"video/webm"},y=()=>{if(O())return O();if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():Ee()?`data:${f(ee())};base64,${P()}`:`data:${f(ee())};base64,${P()}`;if(P()instanceof ArrayBuffer){const o=new Uint8Array(P()).reduce((w,$)=>w+String.fromCharCode($),""),u=btoa(o);return`data:${f(ee())};base64,${u}`}return""},G=()=>{if(O())return O();const t=ie(ee());if(!t)return"";if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():`data:${t};base64,${P()}`;const o=new Uint8Array(P()),u=[],w=32768;for(let $=0;$<o.length;$+=w)u.push(String.fromCharCode(...o.subarray($,$+w)));return`data:${t};base64,${btoa(u.join(""))}`},N=()=>{const t=typeof P()=="string"?new TextEncoder().encode(P()):new Uint8Array(P()),o=[],u=32768;for(let w=0;w<t.length;w+=u)o.push(String.fromCharCode(...t.subarray(w,w+u)));return`data:image/svg+xml;base64,${btoa(o.join(""))}`},D=()=>{c(pe,Math.min(e(pe)+25,500),!0)},fe=()=>{c(pe,Math.max(e(pe)-25,25),!0)},J=()=>{c(xe,(e(xe)+90)%360)},ne=()=>{if(!ye()||oe())return;if(be()){be()();return}const t=document.createElement("a");t.href=e(U)==="video"?G():e(U)==="svg"?N():y(),t.download=e(B),t.click()},ft=async()=>{try{const t=y(),o=new Image;o.crossOrigin="anonymous";const u=await new Promise((w,$)=>{o.onload=()=>{const E=document.createElement("canvas");E.width=o.naturalWidth,E.height=o.naturalHeight;const V=E.getContext("2d");if(!V){$(new Error("Failed to get canvas context"));return}V.drawImage(o,0,0),E.toBlob(T=>{T?w(T):$(new Error("Failed to create blob from canvas"))},"image/png",1)},o.onerror=()=>$(new Error("Failed to load image")),o.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),c(W,!0),setTimeout(()=>c(W,!1),2e3)}catch(t){Be.error("Failed to copy image:",t)}},vt=t=>{try{const o=JSON.parse(t);return JSON.stringify(o,null,2)}catch{return t}},pt=t=>t.split(`
2
2
  `).map(u=>u.split(",").map(w=>w.trim()));var bt={get filePath(){return ee()},set filePath(t){ee(t),ce()},get fileContent(){return P()},set fileContent(t=""){P(t),ce()},get sourceUrl(){return O()},set sourceUrl(t){O(t),ce()},get language(){return ae()},set language(t){ae(t),ce()},get isBinary(){return Ee()},set isBinary(t){Ee(t),ce()},get allowDownload(){return ye()},set allowDownload(t=!0){ye(t),ce()},get onDownload(){return be()},set onDownload(t){be(t),ce()},get downloading(){return oe()},set downloading(t=!1){oe(t),ce()},$set:Yt,$on:(t,o)=>Gt(_,t,o)},me=Lo();ut("blur",Lr,a);var Me=F(me);{var tt=t=>{var o=Po(),u=F(o),w=F(u);re(w);var $=g(w,2);{let Pe=i(()=>d.editor_fileViewer_rotate_tooltip());Te($,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:J,get title(){return e(Pe)},children:(Ae,Ye)=>{dt(Ae,{get icon(){return Va},size:"sm"})},$$slots:{default:!0}})}var E=g($,4);{let Pe=i(()=>d.editor_fileViewer_copyImage_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ft,get title(){return e(Pe)},children:(Ae,Ye)=>{var rt=Ue(),Ge=ve(rt);{var kt=Fe=>{dt(Fe,{get icon(){return za},size:"sm",class:"text-green-500"})},Vt=Fe=>{dt(Fe,{get icon(){return Aa},size:"sm"})};Y(Ge,Fe=>{e(W)?Fe(kt):Fe(Vt,-1)})}s(Ae,rt)},$$slots:{default:!0}})}var V=g(E,2);{let Pe=i(()=>!ye()||oe()),Ae=i(()=>d.editor_fileViewer_download_tooltip());Te(V,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get disabled(){return e(Pe)},get title(){return e(Ae)},children:(Ye,rt)=>{dt(Ye,{get icon(){return Ot},size:"sm"})},$$slots:{default:!0}})}var T=g(V,2),K=C(T,!0);k(u);var L=g(u,2),he=C(L);k(o),I(Pe=>{m(K,e(B)),Kt(L,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Ke)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),jt(L,`--pan-scroll-x: ${e(qe)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),Qe(he,"src",Pe),Qe(he,"alt",e(B)),jt(he,`translate: ${e($e)??""}px ${e(Ce)??""}px; transform: scale(${e(pe)/100}) rotate(${e(xe)??""}deg); transition: transform 0.2s;`)},[()=>y()]),yt("pointerdown",L,l),yt("pointermove",L,q),yt("pointerup",L,v),ut("pointercancel",L,v),ut("lostpointercapture",L,v),s(t,o)},_e=t=>{var o=yo(),u=F(o),w=F(u);re(w);var $=g(w,2);{let L=i(()=>!ye()||oe()),he=i(()=>d.editor_fileViewer_download_tooltip());Te($,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get disabled(){return e(L)},get title(){return e(he)},children:(Pe,Ae)=>{dt(Pe,{get icon(){return Ot},size:"sm"})},$$slots:{default:!0}})}var E=g($,2),V=C(E,!0);k(u);var T=g(u,2),K=C(T);k(o),I(L=>{m(V,e(B)),Kt(T,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Ke)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),jt(T,`--pan-scroll-x: ${e(qe)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),Qe(K,"src",L),Qe(K,"alt",e(B)),jt(K,`translate: ${e($e)??""}px ${e(Ce)??""}px; transform: scale(${e(pe)/100});`)},[()=>N()]),yt("pointerdown",T,l),yt("pointermove",T,q),yt("pointerup",T,v),ut("pointercancel",T,v),ut("lostpointercapture",T,v),s(t,o)},Re=t=>{const o=i(G);var u=Ue(),w=ve(u);Mr(w,()=>ee()+e(o),$=>{Wr($,{get sourceUrl(){return e(o)},get fileName(){return e(B)},get allowDownload(){return ye()},get downloading(){return oe()},onDownload:ne})}),s(t,u)},Qt=t=>{var o=$o(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=F($),V=g(E);k($),k(o),I((T,K)=>{m(w,e(B)),Qe(E,"src",T),m(V,` ${K??""}`)},[()=>y(),()=>d.editor_fileViewer_audioUnsupported_label()]),s(t,o)},$t=t=>{var o=Io(),u=g(F(o),2),w=C(u,!0),$=g(u,2);{let E=i(()=>!ye()||oe());Te($,{size:"sm",variant:"secondary",onclick:ne,get disabled(){return e(E)},children:(V,T)=>{var K=ko(),L=ve(K);dt(L,{get icon(){return Ot},size:"sm",class:"mr-2"});var he=g(L);I(Pe=>m(he,` ${Pe??""}`),[()=>d.editor_fileViewer_downloadPdf_label()]),s(V,K)},$$slots:{default:!0}})}k(o),I(E=>m(w,E),[()=>d.editor_fileViewer_pdfUnavailable_label()]),s(t,o)},er=t=>{{let o=i(()=>vt(P().toString()));fr(t,{get value(){return e(o)},language:"json",get fileName(){return ee()},lineNumbers:!0,readOnly:!0})}},tr=t=>{const o=i(()=>pt(P().toString()));var u=Do(),w=F(u),$=F(w),E=F($);Ut(E,23,()=>e(o)[0]||[],(T,K)=>`header-${K}-${T}`,(T,K)=>{var L=So(),he=C(L,!0);I(()=>m(he,e(K))),s(T,L)}),k(E),k($);var V=g($);Ut(V,23,()=>e(o).slice(1),(T,K)=>`row-${K}`,(T,K,L)=>{var he=Fo();Ut(he,23,()=>e(K),(Pe,Ae)=>`cell-${e(L)}-${Ae}`,(Pe,Ae)=>{var Ye=Co(),rt=C(Ye,!0);I(()=>m(rt,e(Ae))),s(Pe,Ye)}),k(he),s(T,he)}),k(V),k(w),k(u),s(t,u)},Xe=t=>{var o=To(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=C($,!0);k(o),I(V=>{m(w,e(B)),m(E,V)},[()=>d.editor_fileViewer_archive_label()]),s(t,o)},ze=t=>{var o=Eo(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=C($,!0);k(o),I(V=>{m(w,e(B)),m(E,V)},[()=>d.editor_fileViewer_binary_label()]),s(t,o)},rr=t=>{{let o=i(()=>P().toString());fr(t,{get value(){return e(o)},get language(){return ae()},get fileName(){return ee()},lineNumbers:!0,highlightActiveLine:!0})}};Y(Me,t=>{e(U)==="image"?t(tt):e(U)==="svg"?t(_e,1):e(U)==="video"?t(Re,2):e(U)==="audio"?t(Qt,3):e(U)==="pdf"?t($t,4):e(U)==="json"?t(er,5):e(U)==="csv"?t(tr,6):e(U)==="archive"?t(Xe,7):e(U)==="binary"?t(ze,8):t(rr,-1)})}return k(me),s(A,me),Zt(bt)}ia(["pointerdown","pointermove","pointerup"]);const Mo=/access denied|permission denied|outside (?:the )?workspace/i,Ro=/file not found|no such file or directory/i;function jo(A){return Mo.test(A)?"access-denied":A===d.files_read_notFound_error()||Ro.test(A)?"not-found":"generic"}function Uo(A){switch(A){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 Vo=x("<!> <!>",1),zo=x("<!> <!> <!>",1),Ao=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),Tr=x('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),Wo=x('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),Er=x('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),No=x('<div class="flex items-center gap-3"><!> <!></div>'),Bo=x('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),Ho=x('<p class="text-xs"> </p>'),Oo=x("<li><!></li>"),qo=x('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),Ko=x('<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=x('<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=x('<div class="h-full overflow-auto p-4"><!></div>'),Go=x("<div><!></div>"),Jo=x('<iframe sandbox="" referrerpolicy="no-referrer"></iframe>'),Zo=x('<div class="absolute inset-0 flex items-center justify-center text-subtle" role="status"> </div>'),Qo=x('<div class="relative size-full"><!> <!> <!></div>');function ei(A,_){if(new.target)return Xt({component:ei,...A});Jt(_,!0);const re=()=>ge(tr,"$workspace",W),Be=()=>ge(D,"$fileContentStore",W),ee=()=>ge(fe,"$fileLoadingStore",W),P=()=>ge(J,"$fileSavingStore",W),O=()=>ge(ne,"$fileErrorStore",W),ae=()=>ge(ft,"$fileErrorInfoStore",W),Ee=()=>ge(vt,"$homeView$",W),ye=()=>ge(pt,"$fileNotFoundCandidatesStore",W),be=()=>ge(bt,"$isFileBinaryStore",W),oe=()=>ge(me,"$isFileDirtyStore",W),et=()=>ge(Me,"$fileLastUpdatedStore",W),U=()=>ge(tt,"$ftChanges$",W),B=()=>ge(er,"$gutterRead$",W),pe=()=>ge(Ke,"$lineWrapping",W),xe=()=>ge(ue,"$diffIndicators",W),Le=()=>ge(Qt,"$rootMediaPreview",W),[W,$e]=pr(),Ce=(r,n=sa)=>{var b=Or,S=qr;{let le=i(()=>xe()?e(rt):[]),ke=i(()=>n()&&v());Rr(fr(r,{get value(){return b()},set value(Z){S(Z)},get language(){return e(or)},get readOnly(){return e(y)},get fileName(){return a().filePath},get workspaceId(){return l()},get filePath(){return a().filePath},get lineWrapping(){return pe()},get lineChanges(){return e(le)},get jumpTo(){return e(kt)},get externalContentVersion(){return e(Pe)},get isPanelFocused(){return e(ke)}}),Z=>c(Ye,Z,!0),()=>e(Ye))}},qe=r=>{var n=Vo(),b=ve(n);{var S=Z=>{var He=Ue(),Je=ve(He);Nt(Je,()=>Bt,(nt,Tt)=>{Tt(nt,{get icon(){return Ba},get label(){return e(Ae)},disabled:!0})}),s(Z,He)};Y(b,Z=>{!e(It)&&!e(y)&&!e(L)&&Z(S)})}var le=g(b,2);{var ke=Z=>{{let He=i(()=>e(_t)?d.ui_viewSettings_htmlPreview_label():void 0),Je=i(()=>!e(We)),nt=i(()=>!e(y)&&!e(We));eo(Z,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(wr)},get previewLabel(){return e(He)},get previewEnabled(){return e(Fe)},onTogglePreview:()=>c(Fe,!e(Fe)),get showWrap(){return e(Je)},get wrapEnabled(){return pe()},onToggleWrap:()=>R.dispatch(_a()),get showDiff(){return e(nt)},get diffEnabled(){return xe()},onToggleDiff:()=>R.dispatch(ma())})}};Y(le,Z=>{a().filePath&&!e(It)&&!e(L)&&Z(ke)})}s(r,n)},Ve=r=>{var n=Ue(),b=ve(n);{var S=le=>{var ke=zo(),Z=ve(ke);{var He=Oe=>{var at=Ue(),ht=ve(at);{let Et=i(()=>d.layout_fileTab_goToChanges_tooltip());Nt(ht,()=>Bt,(Lt,Mt)=>{Mt(Lt,{get icon(){return Oa},get label(){return e(Et)},onclick:Gr})})}s(Oe,at)};Y(Z,Oe=>{e(Hr)&&Oe(He)})}var Je=g(Z,2);{var nt=Oe=>{var at=Ue(),ht=ve(at);{let Et=i(()=>d.layout_fileTab_downloadFile_label()),Lt=i(()=>!e(Ct)||e(mt));Nt(ht,()=>Bt,(Mt,ir)=>{ir(Mt,{get icon(){return Ot},get label(){return e(Et)},onclick:At,get disabled(){return e(Lt)}})})}s(Oe,at)};Y(Je,Oe=>{e(it)&&Oe(nt)})}var Tt=g(Je,2);{let Oe=i(()=>d.layout_fileTab_deleteFile_tooltip());Nt(Tt,()=>Bt,(at,ht)=>{ht(at,{get icon(){return Ha},get label(){return e(Oe)},onclick:Jr,destructive:!0})})}s(le,ke)};Y(b,le=>{a().filePath&&!e(It)&&!e(y)&&le(S)})}s(r,n)},Ke=to(),ue=ro();let a=de(_,"tab",7),l=de(_,"workspaceId",7),q=de(_,"isActive",7),v=de(_,"isPanelFocused",7);se(()=>{const r=l();if(!(!q()||!r||e(f)))return R.dispatch(ua(r,"files")),()=>R.dispatch(fa(r,"files"))});const f=i(()=>typeof a().data?.gitRootId=="string"?a().data.gitRootId:void 0),ie=i(()=>typeof a().data?.gitRootPath=="string"?a().data.gitRootPath:void 0),y=i(()=>!!e(f)),G=i(()=>a().filePath?ja(a().filePath,e(f)):a().filePath),N=na(e(G));se(()=>{N.set(e(G))});const D=$a(l(),N),fe=ka(l(),N),J=Ia(l(),N),ne=Sa(l(),N),ft=Ca(l(),N),vt=co(l()),pt=Fa(l(),N),bt=Da(l(),N),me=Sr(l(),N),Me=Ta(l(),N),tt=Ea(l()),_e=ya(),Re=crypto.randomUUID(),Qt=Ar(Re),$t=`file-gutter:${crypto.randomUUID()}`,er=La(l(),$t),tr=Ma(l()),Xe=i(()=>re()?.worktreePath||re()?.repositoryPath||re()?.path||null),ze=i(Be),rr=io();se(()=>{e(ze)!==null&&e(ze)!==void 0&&rr?.markContentLoaded()});const t=i(ee),o=i(P),u=i(O),w=i(()=>e(u)?jo(e(u)):"generic"),$=i(()=>e(u)?lo(ae()):null);let E=j(0),V=!1;se(()=>{const r=Ee();if(!r||r.unavailable){V=!1;return}e($)&&!V&&(V=!0,ur(()=>Ht(E)))});const T=5,K=i(()=>(ye()??[]).slice(0,T)),L=i(be),he=i(oe),Pe=i(et),Ae=i(()=>e(o)?d.ui_saveIndicator_saving_tooltip():e(he)?d.ui_saveIndicator_autoSaving_tooltip():d.ui_saveIndicator_saved_tooltip());let Ye=j(null),rt=j(la([])),Ge=j(null),kt=j(void 0),Vt=j(void 0),Fe=j(!0),gr=j(null);se(()=>{const r=a().data?.line,n=a().data?.jumpTimestamp;!r||n!==void 0&&n===e(Vt)||(c(Vt,n,!0),c(kt,{line:r},!0),c(Fe,!1))});const gt=i(()=>e(f)?Cr(a().filePath,e(ie)):null),It=i(()=>e(f)?!e(gt):!!(a().filePath&&(Ga(a().filePath)||e(Xe)&&Ja(a().filePath,e(Xe))))),St=i(()=>a().filePath&&e(Xe)?dr(a().filePath)?a().filePath:`${e(Xe)}/${a().filePath}`:null),xt=i(()=>!!a().filePath&&/\.pdf$/i.test(a().filePath)),Pt=i(()=>!!a().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(a().filePath)),it=i(()=>l()&&/^[A-Za-z0-9._-]+$/.test(l())?Cr(a().filePath,e(Xe)):null),Nr=i(()=>!e(f)&&e(it)?e(it).split("/").slice(0,-1).join("/"):void 0),ar=i(()=>e(xt)||e(Pt)?e(it):null),mr=i(()=>e(f)&&e(Pt)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[a().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);se(()=>{if(!q()||!e(f)||!e(gt)||!e(mr))return;const r=crypto.randomUUID();return R.dispatch(Ur(Re,r,l(),e(gt),{gitRootId:e(f),mimeType:e(mr)})),()=>R.dispatch(Vr(Re,r))});let mt=j(!1);const Ct=i(()=>!!e(it)&&!e(t)&&(!e(Pt)||e(Ge)===e(it))),_r=i(()=>e(Ge)&&l()?`workspace-file://${l()}/${e(Ge).split("/").map(encodeURIComponent).join("/")}`:null),or=i(()=>a().filePath?ga(a().filePath):"plaintext"),hr=i(()=>e(or)==="markdown"),_t=i(()=>/\.html?$/i.test(a().filePath??""));let Ft=j(void 0);const zt=i(()=>e(Ft)?.source===e(ze)),wr=i(()=>e(hr)||e(_t)&&!(e(zt)&&e(Ft)?.document===null)),We=i(()=>e(wr)&&e(Fe));se(()=>{if(!q()||!e(_t)||!e(We)||e(L)||e(u))return;const r=e(ze);if(!(r===null||e(zt)))return fo(r,n=>{c(Ft,{source:r,document:n}),n===null&&c(Fe,!1)})}),se(()=>{e(_t)&&!e(We)&&a().filePath&&c(gr,a().filePath,!0)}),se(()=>{if(!e(_t)||!e(We)||!q()||!v())return;function r(n){const b=n.detail?.line;b&&(c(kt,{line:b},!0),c(Fe,!1))}return window.addEventListener("workspace:go-to-line",r),()=>window.removeEventListener("workspace:go-to-line",r)}),se(()=>{if(!q()||e(xt)||e(f))return;const r=e(ar),n=a().filePath,b=l(),S=a().id;if(c(Ge,null),!r||!n||!b)return;let le=!1;const ke=()=>!le&&l()===b&&a().id===S&&a().filePath===n;return(async()=>{let Z=!1;try{Z=(await Ua("file.stat",{workspaceId:b,path:r}))?.isFile===!0}catch{}if(!ke())return;if(Z){c(Ge,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){c(Ge,r,!0);return}const{candidates:He,truncated:Je}=await Ya(b,r);if(ke()){if(!Je&&He.length===1){R.dispatch(yr(b,n,He[0],S));return}c(Ge,r,!0)}})(),()=>{le=!0}});function Br(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 Dt=i(()=>e(y)||!a().filePath?null:U().find(r=>Br(r,a().filePath))??null),Hr=i(()=>!!e(Dt));se(()=>{if(e(y))return;const r=l(),n=a().filePath,b=e(Xe);return()=>{if(!r||!n)return;const S=lr.select(R.state,r,n);if(S?.kind!=="editable-text")return;const le=nr(S.localContent),ke=Sr.select(R.state,r,n),Z=dr(n)?n:b?`${b}/${n}`:null;ke&&Z&&R.dispatch($r(r,n,Z,le))}}),se(()=>{const r=a().filePath,n=e(St),b=l();if(e(E),!q())return;const S=!e(f)&&!!r&&dr(r)&&!e(Xe);r&&b&&!e(It)&&!e(Pt)&&!e(xt)&&!S&&(e(f)&&e(gt)&&e(G)?R.dispatch(kr(b,e(G),n??r,{gitRoot:{id:e(f),relativePath:e(gt)}})):R.dispatch(kr(b,r,n??r)))});function Or(){return e(ze)??""}function qr(r){e(y)||e(L)||!a().filePath||!l()||!e(St)||R.dispatch(Pa(l(),a().filePath,nr(r)))}function Kr(){if(e(y)||e(L)||!a().filePath||!e(St)||e(ze)===null||e(o))return;const r=lr.select(R.state,l(),a().filePath);r?.kind==="editable-text"&&R.dispatch($r(l(),a().filePath,e(St),nr(r.localContent)))}function Xr(r){const n=a().filePath;!n||!l()||(R.dispatch(xa(l(),n)),R.dispatch(yr(l(),n,r,a().id)))}se(()=>{const r=a().filePath,n=e(Dt);if(!r||!n){c(rt,[],!0);return}if(!q())return;const b=l(),S=crypto.randomUUID();return R.dispatch(va(b,$t,S,{kind:"diffs",path:r,staged:n.stage==="staged"})),()=>{R.dispatch(pa(b,$t,S))}}),se(()=>{const r=B(),n=r?.result?.kind==="diffs"?r.result.chunks:[],b=n.find(S=>S.file===a().filePath)??n[0];c(rt,b?Za(b.chunks.map(S=>({oldStart:S.oldStart,oldLines:S.oldLines,newStart:S.newStart,newLines:S.newLines,lines:S.lines.map(le=>(le.type===Ir.Addition?"+":le.type===Ir.Deletion?"-":" ")+le.content)}))):[],!0)});function Yr(r){const n=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),b=ke=>oo(r,ao(ke),n);if(b("editor.save")){r.preventDefault(),e(he)&&!e(o)&&Kr();return}const S=b("editor.undo")?"undo":b("editor.redo")?"redo":b("editor.toggle-task-list")?"toggle-task-list":b("editor.copy")?"copy":b("editor.select-all")?"select-all":null;if(!S||e(y)&&S!=="copy"&&S!=="select-all")return;S!=="toggle-task-list"&&e(Ye)?.runShortcut(S)&&r.preventDefault()}function Gr(r){if(!a().filePath||!e(Dt))return;const n=r?.metaKey||r?.ctrlKey||!1,S=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;R.dispatch(ba(l(),e(Dt),{filePath:a().filePath,changeId:e(Dt).id,openInAdjacentPanel:n,sourcePanelId:S}))}async function At(){const r=e(it);if(!(e(y)||!r||!l()||!e(Ct)||e(mt))){c(mt,!0);try{const n=await Ra(l(),r,e(Xe));!n?.success&&!n?.canceled&&sr.error(n?.error?.message||d.layout_fileTab_downloadFailed_error())}catch{sr.error(d.layout_fileTab_downloadFailed_error())}finally{c(mt,!1)}}}function Jr(){const r=e(St);if(e(y)||!a().filePath||!l()||!r)return;const n=ha(lr.select(R.state,l(),a().filePath));if(!n){sr.error(d.ui_reversibleActions_failed_error({message:d.fileExplorer_tree_undoUnavailable_error()}));return}R.dispatch(wa(l(),a().filePath,{absolutePath:r,tabId:a().id,snapshot:n}))}se(()=>{if(!_e||!q())return;const r={isDirty:!e(y)&&e(he),isSaving:!e(y)&&e(o)};ur(()=>{_e.registerActions({display:qe,actions:Ve}),_e.registerState(r)})});var Zr={get tab(){return a()},set tab(r){a(r),ce()},get workspaceId(){return l()},set workspaceId(r){l(r),ce()},get isActive(){return q()},set isActive(r){q(r),ce()},get isPanelFocused(){return v()},set isPanelFocused(r){v(r),ce()},$set:Yt,$on:(r,n)=>Gt(_,r,n)},br=Ue();ut("keydown",Lr,r=>q()&&Yr(r));var Qr=ve(br);{var ea=r=>{var n=Ue(),b=ve(n);Mr(b,()=>a().filePath,S=>{var le=Ue(),ke=ve(le);{var Z=h=>{var p=Ao(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0);k(p),I(te=>{m(X,te),m(je,a().filePath)},[()=>d.layout_fileTab_outsideWorkspace_label()]),s(h,p)},He=h=>{var p=Ue(),M=ve(p);{var X=z=>{vr(z,{get workspaceId(){return l()},get filePath(){return e(gt)},get gitRootId(){return e(f)}})};Y(M,z=>{q()&&z(X)})}s(h,p)},Je=h=>{var p=Ue(),M=ve(p);{var X=te=>{var Ie=Tr(),H=F(Ie),we=C(H,!0);k(Ie),I(Q=>m(we,Q),[()=>d.layout_fileTab_errorLoading_label()]),s(te,Ie)},z=te=>{qt(te,{get filePath(){return a().filePath},get sourceUrl(){return Le().url},allowDownload:!1})},je=te=>{var Ie=Wo(),H=F(Ie),we=C(H,!0);k(Ie),I(Q=>m(we,Q),[()=>d.layout_fileTab_preparing_label()]),s(te,Ie)};Y(M,te=>{Le()?.error?te(X):Le()?.url?te(z,1):te(je,-1)})}s(h,p)},nt=h=>{var p=Ue(),M=ve(p);{var X=z=>{vr(z,{get workspaceId(){return l()},get filePath(){return e(ar)}})};Y(M,z=>{q()&&z(X)})}s(h,p)},Tt=h=>{var p=Tr(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.file_pdf_load_error()]),s(h,p)},Oe=h=>{{let p=i(()=>e(Ge)??a().filePath),M=i(()=>!e(y)&&e(Ct));qt(h,{get filePath(){return e(p)},get sourceUrl(){return e(_r)},onDownload:At,get allowDownload(){return e(M)},get downloading(){return e(mt)}})}},at=h=>{var p=Er(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.layout_fileTab_preparing_label()]),s(h,p)},ht=h=>{var p=Bo(),M=F(p);Ut(M,20,()=>[...Array(20).keys()],X=>X,(X,z)=>{var je=No(),te=F(je);Fr(te,{class:"h-3 w-8 shrink-0"});var Ie=g(te,2);Fr(Ie,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),k(je),s(X,je)}),k(M),k(p),s(h,p)},Et=h=>{{let p=i(()=>so(e($)));no(h,{get view(){return e(p)}})}},Lt=h=>{var p=Ko(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0),te=g(z,2);{var Ie=Q=>{var lt=Ho(),Ze=C(lt,!0);I(()=>m(Ze,e(u))),s(Q,lt)};Y(te,Q=>{e(w)==="generic"&&Q(Ie)})}var H=g(te,2);{var we=Q=>{var lt=qo(),Ze=ve(lt),Rt=C(Ze,!0),Wt=g(Ze,2);Ut(Wt,20,()=>e(K),wt=>wt,(wt,De)=>{var Se=Oo(),Ne=F(Se);Te(Ne,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Xr(De),children:(st,xr)=>{ot();var Pr=ct();I(()=>m(Pr,De)),s(st,Pr)},$$slots:{default:!0}}),k(Se),s(wt,Se)}),k(Wt),I(wt=>m(Rt,wt),[()=>d.layout_fileTab_didYouMean_label()]),s(Q,lt)};Y(H,Q=>{e(K).length>0&&Q(we)})}k(p),I(Q=>{m(X,Q),m(je,a().filePath)},[()=>Uo(e(w))]),s(h,p)},Mt=h=>{var p=Xo(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0),te=g(z,2);{var Ie=H=>{{let we=i(()=>!e(Ct)||e(mt));Te(H,{variant:"secondary",size:"sm",onclick:At,get disabled(){return e(we)},children:(Q,lt)=>{ot();var Ze=ct();I(Rt=>m(Ze,Rt),[()=>d.layout_fileTab_downloadFile_label()]),s(Q,Ze)},$$slots:{default:!0}})}};Y(te,H=>{!e(y)&&e(it)&&H(Ie)})}k(p),I(H=>{m(X,H),m(je,a().filePath)},[()=>d.editor_fileViewer_binary_label()]),s(h,p)},ir=h=>{const p=i(()=>a().filePath?.toLowerCase().endsWith(".svg"));var M=Ue(),X=ve(M);{var z=H=>{{let we=i(()=>a().filePath||""),Q=i(()=>!e(y)&&e(Ct));qt(H,{get filePath(){return e(we)},get fileContent(){return e(ze)},get language(){return e(or)},get isBinary(){return e(L)},onDownload:At,get allowDownload(){return e(Q)},get downloading(){return e(mt)}})}},je=H=>{var we=Yo(),Q=F(we);Qa(Q,{get content(){return e(ze)},get workspaceId(){return l()},get relativeMediaBase(){return e(Nr)},renderRichFencesAsCode:!0,renderDiagrams:!0}),k(we),s(H,we)},te=H=>{var we=Qo(),Q=F(we);{var lt=De=>{var Se=Go();let Ne;var st=F(Se);Ce(st,()=>!e(We)),k(Se),I(()=>{Ne=Kt(Se,1,"size-full",null,Ne,{invisible:e(We)}),Se.inert=e(We)}),s(De,Se)};Y(Q,De=>{(!e(We)||e(gr)===a().filePath)&&De(lt)})}var Ze=g(Q,2);{var Rt=De=>{const Se=i(()=>e(We)&&e(zt));var Ne=Jo();let st;I(xr=>{Qe(Ne,"title",xr),Qe(Ne,"srcdoc",e(Ft).document),st=Kt(Ne,1,"absolute inset-0 block size-full border-0 bg-background",null,st,{invisible:!e(Se)}),Ne.inert=!e(Se)},[()=>d.ui_viewSettings_htmlPreview_label()]),s(De,Ne)};Y(Ze,De=>{e(Ft)?.document!=null&&De(Rt)})}var Wt=g(Ze,2);{var wt=De=>{var Se=Zo(),Ne=C(Se,!0);I(st=>m(Ne,st),[()=>d.layout_fileTab_preparing_label()]),s(De,Se)};Y(Wt,De=>{e(We)&&!e(zt)&&De(wt)})}k(we),s(H,we)},Ie=H=>{Ce(H,()=>!0)};Y(X,H=>{e(p)?H(z):e(hr)&&e(We)?H(je,1):e(_t)?H(te,2):H(Ie,-1)})}s(h,M)},ra=h=>{var p=Er(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.layout_fileTab_preparing_label()]),s(h,p)};Y(ke,h=>{e(It)?h(Z):e(f)&&e(xt)&&e(gt)?h(He,1):e(f)&&e(Pt)?h(Je,2):e(xt)&&e(ar)?h(nt,3):e(xt)?h(Tt,4):e(_r)?h(Oe,5):e(Pt)?h(at,6):e(t)&&(!e(_t)||e(ze)===null)?h(ht,7):e($)?h(Et,8):e(u)?h(Lt,9):e(L)?h(Mt,10):e(ze)!==null?h(ir,11):h(ra,-1)})}s(S,le)}),s(r,n)};Y(Qr,r=>{a().filePath&&r(ea)})}s(A,br);var ta=Zt(Zr);return $e(),ta}export{ei as default};
@@ -1 +1 @@
1
- import{d as l,v as h,t as k}from"./Dms_DO28.js";import{Jv as s,vL as w}from"./tr-2J8Mf.js";import{i as W,d as E,e as c,n as i,b as m}from"./CCMszM-p.js";const A=new Set(["new","creating"]);function g(n){let t;try{t=decodeURIComponent(n)}catch{return null}return t.length===0||A.has(t)?null:t}function f(n){const t=/^\/workspace\/([^/?#]+)\/?(?:[?#].*)?$/.exec(n);return t?g(t[1]):null}function I(n){const t=/^\/workspace\/([^/?#]+)(?:[/?#].*)?$/.exec(n);return t?g(t[1]):null}function L(n,t){return t.length>0&&I(n)===t}function p(){return typeof window>"u"?null:window.location?.pathname??null}function d(n,t){const e=`/workspace/${encodeURIComponent(n)}`,a=t?new URLSearchParams(t).toString():"";return a?`${e}?${a}`:e}function R(n,t){const e=t?.presenceFollowRequestId;return e?w(n,e):w(n)}function P(n,t){return t?i(n,{state:t}):i(n)}function o(n){return n?.tabState?.currentTabId??null}async function S(n,t,e,a){m();const u=P(t,e),r={workspaceId:n,epoch:c(),startTabId:a};return await u,r}function b(n){return!n||W()||E()}function v(n,t){if(c()!==n.epoch||t!==n.startTabId&&t!==n.workspaceId)return!1;const e=p();return e===null||f(e)===n.workspaceId}async function y(n,t,e){if(b(n))return!1;const a=await S(n,t,e,o(s.state));return v(a,o(s.state))?(s.dispatch(R(n,e)),!0):!1}function*T(n,t,e){if(b(n))return!1;const a=o(yield*h(r=>r)),u=yield*l(S,n,t,e,a);return v(u,o(yield*h(r=>r)))?(yield*k(R(n,e)),!0):!1}function _(){m();const n=c(),t=o(s.state),e=p();return()=>c()===n&&o(s.state)===t&&p()===e}function O(n,t={}){return y(n,d(n,t.query),t.state)}function $(n,t={}){return T(n,d(n,t.query),t.state)}async function j(n){const t=f(n);t?await y(t,n,void 0):await i(n)}function*q(n){const t=f(n);t?yield*l(T,t,n,void 0):yield*l(i,n)}const N=Object.freeze(Object.defineProperty({__proto__:null,claimNavigation:_,navigateToAppRoute:j,navigateToAppRouteSaga:q,openAndShowWorkspace:O,showWorkspaceSaga:$,workspaceRoute:d},Symbol.toStringTag,{value:"Module"}));export{p as a,q as b,_ as c,$ as d,d as e,L as i,j as n,O as o,f as p,N as s,I as w};
1
+ import{d as l,v as h,t as k}from"./Dms_DO28.js";import{Jv as s,vL as w}from"./tr-2J8Mf.js";import{i as W,d as E,e as c,n as i,b as m}from"./Cqg6DAOX.js";const A=new Set(["new","creating"]);function g(n){let t;try{t=decodeURIComponent(n)}catch{return null}return t.length===0||A.has(t)?null:t}function f(n){const t=/^\/workspace\/([^/?#]+)\/?(?:[?#].*)?$/.exec(n);return t?g(t[1]):null}function I(n){const t=/^\/workspace\/([^/?#]+)(?:[/?#].*)?$/.exec(n);return t?g(t[1]):null}function L(n,t){return t.length>0&&I(n)===t}function p(){return typeof window>"u"?null:window.location?.pathname??null}function d(n,t){const e=`/workspace/${encodeURIComponent(n)}`,a=t?new URLSearchParams(t).toString():"";return a?`${e}?${a}`:e}function R(n,t){const e=t?.presenceFollowRequestId;return e?w(n,e):w(n)}function P(n,t){return t?i(n,{state:t}):i(n)}function o(n){return n?.tabState?.currentTabId??null}async function S(n,t,e,a){m();const u=P(t,e),r={workspaceId:n,epoch:c(),startTabId:a};return await u,r}function b(n){return!n||W()||E()}function v(n,t){if(c()!==n.epoch||t!==n.startTabId&&t!==n.workspaceId)return!1;const e=p();return e===null||f(e)===n.workspaceId}async function y(n,t,e){if(b(n))return!1;const a=await S(n,t,e,o(s.state));return v(a,o(s.state))?(s.dispatch(R(n,e)),!0):!1}function*T(n,t,e){if(b(n))return!1;const a=o(yield*h(r=>r)),u=yield*l(S,n,t,e,a);return v(u,o(yield*h(r=>r)))?(yield*k(R(n,e)),!0):!1}function _(){m();const n=c(),t=o(s.state),e=p();return()=>c()===n&&o(s.state)===t&&p()===e}function O(n,t={}){return y(n,d(n,t.query),t.state)}function $(n,t={}){return T(n,d(n,t.query),t.state)}async function j(n){const t=f(n);t?await y(t,n,void 0):await i(n)}function*q(n){const t=f(n);t?yield*l(T,t,n,void 0):yield*l(i,n)}const N=Object.freeze(Object.defineProperty({__proto__:null,claimNavigation:_,navigateToAppRoute:j,navigateToAppRouteSaga:q,openAndShowWorkspace:O,showWorkspaceSaga:$,workspaceRoute:d},Symbol.toStringTag,{value:"Module"}));export{p as a,q as b,_ as c,$ as d,d as e,L as i,j as n,O as o,f as p,N as s,I as w};