@forsion/unit 2.13.3 → 2.13.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 (199) hide show
  1. package/main.mjs +25 -3
  2. package/package.json +1 -1
  3. package/release.json +5 -5
  4. package/web/assets/ArtificialView-DLh75dAI.js +1 -0
  5. package/web/assets/AutomationBuilder-DNWWGnFr.js +1 -0
  6. package/web/assets/CalendarConfigView-G7je7k9-.js +1 -0
  7. package/web/assets/{CalendarView-D55PA1vn.js → CalendarView-B2MtaOJk.js} +1 -1
  8. package/web/assets/{CapabilityMenu-BVrokPpT.js → CapabilityMenu-DJaZ_Cyt.js} +1 -1
  9. package/web/assets/{CheckboxInput-BuJ3HPm_.js → CheckboxInput-FYXLaZke.js} +1 -1
  10. package/web/assets/{Chrome-amTcZNE4.js → Chrome-CFonajM4.js} +1 -1
  11. package/web/assets/{CodeView-DRVh13k9.js → CodeView-GZ0BAgoW.js} +3 -3
  12. package/web/assets/DashboardGridView-Xgw4wa0_.js +17 -0
  13. package/web/assets/{EventCard-DUrn2krw.js → EventCard-_39F_I5M.js} +1 -1
  14. package/web/assets/ExcalidrawCanvas-rXujil36.js +1 -0
  15. package/web/assets/{FloatingToc-B1d4-5EL.js → FloatingToc-DNqAkkI0.js} +1 -1
  16. package/web/assets/GitCloneDialog-Bj9G3o-n.css +1 -0
  17. package/web/assets/GitCloneDialog-CQx-O4j1.js +1 -0
  18. package/web/assets/HomepageView-DcWmTPQO.css +1 -0
  19. package/web/assets/HomepageView-MYEk3RCs.js +3 -0
  20. package/web/assets/{ImageStudioPanels-B2PTq6Yb.js → ImageStudioPanels-4wnb2XF4.js} +2 -2
  21. package/web/assets/ImageStudioView-qrmW8pfx.js +1 -0
  22. package/web/assets/InlineAiPanel-B3kd1ob2.js +1 -0
  23. package/web/assets/InlineAiPanel-DZZijfif.css +1 -0
  24. package/web/assets/InlineFiles-Clnqh9jD.js +1 -0
  25. package/web/assets/MarkdownBlock-DQTuoen3.css +1 -0
  26. package/web/assets/MarkdownBlock-DT_wsaja.js +58 -0
  27. package/web/assets/ModelPill-JaIH3ffZ.js +2 -0
  28. package/web/assets/MuseLibraryView-16p1zsxz.css +1 -0
  29. package/web/assets/MuseLibraryView-DOJVVeU6.js +2 -0
  30. package/web/assets/{MuseView-CDDwV6SR.js → MuseView-uxTmjVQa.js} +2 -2
  31. package/web/assets/{PageHistoryPanel-BbdXpjJM.js → PageHistoryPanel-Bn4-XmdK.js} +2 -2
  32. package/web/assets/{PdfAnnotator-CW0wPWRB.js → PdfAnnotator-Cq8cklTz.js} +1 -1
  33. package/web/assets/PenRow-COOYAaxx.js +1 -0
  34. package/web/assets/ProductView-DPTveulg.js +1 -0
  35. package/web/assets/RightPanel-BJUacrsf.js +4 -0
  36. package/web/assets/RightPanel-D0zk1g3I.css +1 -0
  37. package/web/assets/{SketchCard-BcXCdBAs.js → SketchCard-B_UU5sxV.js} +3 -3
  38. package/web/assets/{StudioGuestSurface-ZJFKnNYF.js → StudioGuestSurface-yBa4QKfX.js} +1 -1
  39. package/web/assets/TargetHealthNotice-BLzDB-Xl.css +1 -0
  40. package/web/assets/TargetHealthNotice-CgkdTdhB.js +47 -0
  41. package/web/assets/{TodoListView-DuRdVFgB.js → TodoListView-CricdCfW.js} +1 -1
  42. package/web/assets/{Tooltip-DtDUL18W.js → Tooltip-o8ZqIb3L.js} +1 -1
  43. package/web/assets/UnifiedPage-BWAyqj65.js +69 -0
  44. package/web/assets/ViewSelectionBar-35x8TiLA.js +2 -0
  45. package/web/assets/appStore-CI1_L5OS.js +3357 -0
  46. package/web/assets/appStore-DQc2marq.css +1 -0
  47. package/web/assets/{arrow-up-right-R4P9Mmxz.js → arrow-up-right-BDsMFoNQ.js} +1 -1
  48. package/web/assets/{astryxBridge-CT2wZJXs.js → astryxBridge-CH_c5xjo.js} +3 -3
  49. package/web/assets/automationListSource-CB6AWkL_.js +1 -0
  50. package/web/assets/{boardSurface-Ce0_vf9f.js → boardSurface-CLvEUjbF.js} +1 -1
  51. package/web/assets/{book-open-CcXCToyx.js → book-open-BLzEdGfu.js} +1 -1
  52. package/web/assets/{calendarNavStore-tQJRVpum.js → calendarNavStore-BHUNxDx8.js} +1 -1
  53. package/web/assets/{canvasPrefs-CSuX9aLF.js → canvasPrefs-CvE7mgyq.js} +1 -1
  54. package/web/assets/{chatBoxSurface-IG6Vu4Dz.js → chatBoxSurface-CuuHLzs5.js} +1 -1
  55. package/web/assets/{circle-question-mark-O8AhUz35.js → circle-question-mark-BM4ZRxQS.js} +1 -1
  56. package/web/assets/{circle-x-AV2ZWulM.js → circle-x-DTcNGZDT.js} +1 -1
  57. package/web/assets/{client-BqhpYbYL.js → client-CaivGZFR.js} +5 -5
  58. package/web/assets/{code-xml-DdR58F83.js → code-xml-AE3mT4T5.js} +1 -1
  59. package/web/assets/{codeStudioStore-Dq5i8nbE.js → codeStudioStore-DhyMazGT.js} +1 -1
  60. package/web/assets/codingNavigation-B0kVsy4x.js +53 -0
  61. package/web/assets/codingNavigation-DHCidM4N.css +1 -0
  62. package/web/assets/{create-BgJN5qsj.js → create-1JI2I47p.js} +2 -2
  63. package/web/assets/dashboardSurface-CIE5HybN.js +1 -0
  64. package/web/assets/{deskCapture-BD2qD6NI.js → deskCapture-COW7aG5Y.js} +1 -1
  65. package/web/assets/{diff2html-OoRdHZ_O.js → diff2html-Daje9Kkm.js} +1 -1
  66. package/web/assets/{docx-preview-B43XC8Cn.js → docx-preview-CABR7n30.js} +1 -1
  67. package/web/assets/emoji-DZ9CA_3l.css +1 -0
  68. package/web/assets/emoji-DphwSxPx.js +1 -0
  69. package/web/assets/{floatingTocSurface-BM2SYE_u.js → floatingTocSurface-BOm2QYBK.js} +1 -1
  70. package/web/assets/{foldActions-BcyvNVBs.js → foldActions-DNbJPlPl.js} +1 -1
  71. package/web/assets/{folder-CCZqnwRc.js → folder-DotgUhYD.js} +1 -1
  72. package/web/assets/{folder-plus-BJKT1Pqg.js → folder-plus-aJgL9NeP.js} +1 -1
  73. package/web/assets/gestures-dqncPOwo.js +1 -0
  74. package/web/assets/git-branch-CwR2qic6.js +1 -0
  75. package/web/assets/{hand-DRu7IJdU.js → hand-XNkzNiW2.js} +1 -1
  76. package/web/assets/{hard-drive-CXNJUCXw.js → hard-drive-CfWKRoAE.js} +1 -1
  77. package/web/assets/i18n-CykmULlm.css +1 -0
  78. package/web/assets/{i18n.generated-DvY59Zq3.js → i18n.generated-BwynSSMk.js} +3 -3
  79. package/web/assets/{imageStudio-Axwmd4GW.js → imageStudio-CWgLpC_d.js} +2 -2
  80. package/web/assets/{index-C65u4fXd.js → index-B65ULikK.js} +1 -1
  81. package/web/assets/{index-DDMXVG0h.js → index-BGfvNj7R.js} +1 -1
  82. package/web/assets/{index-BGEkZBs2.js → index-BIIeiIap.js} +1 -1
  83. package/web/assets/{index-BYUntVIZ.js → index-BOzsniE1.js} +89 -89
  84. package/web/assets/{index-BO2XJc36.js → index-BfrjVzia.js} +1 -1
  85. package/web/assets/{index-mB0EQkyZ.js → index-Bi9UtjVz.js} +1 -1
  86. package/web/assets/{index-pJh7JN7_.js → index-C1uilc9i.js} +1 -1
  87. package/web/assets/{index-DY0M_dpd.js → index-C3Dc3Ivz.js} +1 -1
  88. package/web/assets/{index-D3CYvMpl.js → index-CJF_Ld1Y.js} +1 -1
  89. package/web/assets/{index-BFTY79aq.js → index-CMARP4oV.js} +1 -1
  90. package/web/assets/{index-taRxNsbp.js → index-C_RsQVNm.js} +1 -1
  91. package/web/assets/{index-Dlkq7gkE.js → index-ChyxZMm8.js} +1 -1
  92. package/web/assets/{index-DcbZwhpE.js → index-CoKcOaZg.js} +1 -1
  93. package/web/assets/{index-Uq4J2aoW.js → index-CuviSCbk.js} +1 -1
  94. package/web/assets/{index-HqmJW2np.js → index-Cw43kua8.js} +1 -1
  95. package/web/assets/{index-WbVt2P8R.js → index-D1fu6XQN.js} +1 -1
  96. package/web/assets/{index-D78izbLA.js → index-DG-hXb63.js} +1 -1
  97. package/web/assets/index-DjnTfJpN.js +1 -0
  98. package/web/assets/{index-LxlyPm0_.js → index-Dtw0abst.js} +1 -1
  99. package/web/assets/{index-D102FOuM.js → index-O05r2Ty6.js} +1 -1
  100. package/web/assets/{index-C_Ohi-I3.js → index-W3ErfZiX.js} +1 -1
  101. package/web/assets/{index-B1rE_NwA.js → index-Yc56b3XX.js} +1 -1
  102. package/web/assets/{index-CkMhazev.js → index-d4jCdYJH.js} +1 -1
  103. package/web/assets/{index-CobUnTcv.js → index-gt5JBIFf.js} +1 -1
  104. package/web/assets/{index-XyjIhkPw.js → index-siHtlYTM.js} +1 -1
  105. package/web/assets/{invitePage-BW0BH8Ac.js → invitePage-Bgveo6Hj.js} +1 -1
  106. package/web/assets/{ipc-D7yENkjV.js → ipc-B6hkgxQL.js} +1 -1
  107. package/web/assets/{jszip.min-UE5d5vPJ.js → jszip.min-eU-k-vEy.js} +1 -1
  108. package/web/assets/{layout-grid-Hs3eDA07.js → layout-grid-CraV7nhh.js} +1 -1
  109. package/web/assets/linkFollow-BpvDWzUx.js +8 -0
  110. package/web/assets/{list-tree-DmuRb-p9.js → list-tree-cLJw-jYQ.js} +1 -1
  111. package/web/assets/{listFold-CKxjyY5_.js → listFold-M8s5JYEC.js} +1 -1
  112. package/web/assets/{lock-kffGfeHt.js → lock-DBkXXwaI.js} +1 -1
  113. package/web/assets/lock-open-C-9-AWct.js +1 -0
  114. package/web/assets/{log-out-B5gEP0tF.js → log-out-C8bDXj9P.js} +1 -1
  115. package/web/assets/main-CMk6twzA.js +20 -0
  116. package/web/assets/markdownEditorSurface-DgQ0TUWH.js +3 -0
  117. package/web/assets/{message-square-plus-DxBPIhPS.js → message-square-plus-8pfimvem.js} +1 -1
  118. package/web/assets/{messages-4w1Khzm1.js → messages-CKtabOqy.js} +1 -1
  119. package/web/assets/minus-CfA9fAN3.js +1 -0
  120. package/web/assets/mobileEntry-NcMcK0LV.js +13 -0
  121. package/web/assets/{nativeDownload-Udrv_tmU.js → nativeDownload-CNtwSCy0.js} +1 -1
  122. package/web/assets/pageChrome-BR4cfIaA.js +1 -0
  123. package/web/assets/{pageChrome-eO9pb2fH.css → pageChrome-BbUhILy0.css} +1 -1
  124. package/web/assets/{pageTree-CIXFRCLk.js → pageTree-BYYPgZm_.js} +4 -4
  125. package/web/assets/{pen-tool-D_Y9We9x.js → pen-tool-C5ftHCnm.js} +1 -1
  126. package/web/assets/{pencil-DGiTRzW1.js → pencil-ehhM9_9k.js} +1 -1
  127. package/web/assets/phoneList-B6gwUJZF.js +9 -0
  128. package/web/assets/phoneList-iRdfiKA8.css +1 -0
  129. package/web/assets/pluginChat-DTTWWiUS.js +2 -0
  130. package/web/assets/{redo-2-QgiKEg9T.js → redo-2-DCEAgQlN.js} +1 -1
  131. package/web/assets/{rotate-ccw-BLoH5er1.js → rotate-ccw-DdkrbRAB.js} +1 -1
  132. package/web/assets/selectionActions-BQD2kox1.js +2 -0
  133. package/web/assets/selectionBarSurface-CzUZmJDJ.js +1 -0
  134. package/web/assets/server-Ddu9f1k3.js +1 -0
  135. package/web/assets/sharePage-CNrm2xTC.js +2 -0
  136. package/web/assets/{shareViewer-BzuSyJv_.js → shareViewer-BiMqIBxP.js} +2 -2
  137. package/web/assets/{star-BmywYD3u.js → star-Dxv7XANS.js} +1 -1
  138. package/web/assets/tableSurface-Bly1iCXc.js +1 -0
  139. package/web/assets/{terminal-BlmA_Z1C.js → terminal-CAmmC9cV.js} +1 -1
  140. package/web/assets/{terminalView-SAxITnRW.js → terminalView-lbcBgG0c.js} +1 -1
  141. package/web/assets/theme-CUWFlazV.css +1 -0
  142. package/web/assets/{type-DmIL6FB-.js → type-Dz6rnTvG.js} +1 -1
  143. package/web/assets/{undo-2-yMeXc8Wi.js → undo-2-B7izWNb_.js} +1 -1
  144. package/web/assets/{unitAccount-BPYRAa3m.js → unitAccount-DGwGsmC3.js} +1 -1
  145. package/web/assets/{unitBridge-BNVzai6X.js → unitBridge-CE2yAvm0.js} +1 -1
  146. package/web/assets/{unitCloudTransport-iFweA1xk.js → unitCloudTransport-BGFwkaDM.js} +1 -1
  147. package/web/assets/{unitOwnerAccess-Bggl7bDP.js → unitOwnerAccess-D4nKS6Gg.js} +1 -1
  148. package/web/assets/{unitShim-BP2nBO_k.js → unitShim-2_2hhGxS.js} +3 -3
  149. package/web/assets/{upload-D20PZHXc.js → upload-DqpRRAhG.js} +1 -1
  150. package/web/assets/userSpaces-VFu4s05v.js +1 -0
  151. package/web/assets/viewportLock-3AOdDmwi.js +631 -0
  152. package/web/assets/viewportLock-djvL8fUQ.css +1 -0
  153. package/web/assets/{zoom-in-_TgFOpyv.js → zoom-in-Bf-eKTnH.js} +1 -1
  154. package/web/index.html +2 -2
  155. package/web/assets/ArtificialView-DS97zlMg.js +0 -1
  156. package/web/assets/AutomationBuilder-BsJc8wuC.js +0 -1
  157. package/web/assets/CalendarConfigView-BN8mraSo.js +0 -1
  158. package/web/assets/DashboardGridView-DlFyYfUh.js +0 -17
  159. package/web/assets/ExcalidrawCanvas-TpbzBF-J.js +0 -1
  160. package/web/assets/HomepageView-DnQ_5Obe.css +0 -1
  161. package/web/assets/HomepageView-nzKfbHM-.js +0 -1
  162. package/web/assets/ImageStudioView-Cawr6pGW.js +0 -1
  163. package/web/assets/InlineFiles-DKPH5JHz.js +0 -1
  164. package/web/assets/MarkdownBlock--__nPQGh.css +0 -1
  165. package/web/assets/MarkdownBlock-BHpDy2qQ.js +0 -58
  166. package/web/assets/ModelPill-ChzAM3z1.js +0 -2
  167. package/web/assets/MuseLibraryView-DLuQ_jyV.js +0 -2
  168. package/web/assets/PenRow-BY-MZLDQ.js +0 -1
  169. package/web/assets/ProductView-0ieVL3rY.js +0 -1
  170. package/web/assets/RightPanel-BRexwQ3W.js +0 -4
  171. package/web/assets/RunLocationPicker-BrDfOu8-.css +0 -1
  172. package/web/assets/RunLocationPicker-CadYiE7C.js +0 -43
  173. package/web/assets/UnifiedPage-D7JTfABH.js +0 -68
  174. package/web/assets/appStore-ClD7vq5L.css +0 -1
  175. package/web/assets/appStore-affnJoin.js +0 -3292
  176. package/web/assets/automationListSource-JVBMsMbC.js +0 -1
  177. package/web/assets/codingNavigation-CxdCK78-.js +0 -53
  178. package/web/assets/codingNavigation-_tOR0ell.css +0 -1
  179. package/web/assets/dashboardSurface-BY-AFB-r.js +0 -1
  180. package/web/assets/emoji-BPdA62d7.js +0 -1
  181. package/web/assets/gestures-BwPbZDkU.js +0 -1
  182. package/web/assets/i18n-BMo19xaR.css +0 -1
  183. package/web/assets/index-Y2kzYlZq.js +0 -1
  184. package/web/assets/linkFollow-Msu1XH9v.js +0 -8
  185. package/web/assets/main-DIyFlyfK.js +0 -20
  186. package/web/assets/markdownEditorSurface-Cx2rqFAY.js +0 -3
  187. package/web/assets/minus-CfoZ4oxr.js +0 -1
  188. package/web/assets/mobileEntry-B8JwR53-.js +0 -13
  189. package/web/assets/pageChrome-D-9npbUE.js +0 -1
  190. package/web/assets/phoneList-BQfCJwKF.css +0 -1
  191. package/web/assets/phoneList-DHUia6HT.js +0 -9
  192. package/web/assets/pluginChat-BXuJiMYi.js +0 -2
  193. package/web/assets/sharePage-DYYN5usb.js +0 -2
  194. package/web/assets/tableSurface-21LDYY_G.js +0 -1
  195. package/web/assets/theme-Dgqst5S9.css +0 -1
  196. package/web/assets/userSpaces-CrLrKklx.js +0 -1
  197. package/web/assets/viewportLock-DO1lzA2N.css +0 -1
  198. package/web/assets/viewportLock-tlT6H_Hc.js +0 -629
  199. package/web/assets/workflow-Bd6xBHiT.js +0 -1
@@ -0,0 +1 @@
1
+ import{u as U,d as o,j as t}from"./index-BOzsniE1.js";import{J as xe,aM as fe,aU as te,aV as R,X as Z,lm as Se,bK as je,bu as $e,bv as Re,bw as ve,a9 as Ae,aA as Be,V as Ue,ea as Fe,ln as He,x as Ve,ba as _e,u as qe,g2 as Ke,gg as q,aS as We,P as Ye,lo as Xe,T as Ge,d$ as Qe,cE as Je,lp as Ze,gc as et}from"./appStore-CI1_L5OS.js";import"./client-CaivGZFR.js";import{u as tt}from"./gestures-dqncPOwo.js";import{C as st,a as it}from"./Chrome-CFonajM4.js";import{b as M,i as be,u as r,a as at,C as nt,r as ce,m as rt,c as ot,d as ye,e as ue,f as me,g as lt,n as dt,h as ct}from"./RightPanel-BJUacrsf.js";import{s as ut,d as ee,r as mt,h as gt,a as pt,b as we,c as Ce,p as B,e as ke,I as ht,i as xt,f as ft,l as St,u as jt,g as A,S as ge,j as vt,k as K,L as bt,m as yt,n as wt,o as Ct}from"./imageStudio-CWgLpC_d.js";import{L as kt}from"./lock-DBkXXwaI.js";import{L as zt}from"./lock-open-C-9-AWct.js";import{U as W}from"./upload-DqpRRAhG.js";/* empty css */import{F as Nt,R as It}from"./redo-2-DCEAgQlN.js";import{U as Et}from"./undo-2-B7izWNb_.js";import{L as Pt}from"./layout-grid-CraV7nhh.js";import{A as Lt}from"./arrow-up-right-BDsMFoNQ.js";import{H as Tt}from"./hand-XNkzNiW2.js";import{T as Mt,F as Dt}from"./type-Dz6rnTvG.js";import"./nativeDownload-CNtwSCy0.js";import"./ipc-B6hkgxQL.js";import"./minus-CfA9fAN3.js";import"./pencil-ehhM9_9k.js";import"./book-open-BLzEdGfu.js";import"./folder-plus-aJgL9NeP.js";import"./folder-DotgUhYD.js";import"./InlineFiles-Clnqh9jD.js";const Ot=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],$t=xe("clipboard-paste",Ot);const Rt=[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],At=xe("copy-plus",Rt);function Bt({board:s,selection:i,onClose:j}){const{t:c}=U(),[g,v]=o.useState("png"),[b,C]=o.useState(1),[l,p]=o.useState("transparent"),[S,y]=o.useState(.92),[N,w]=o.useState(!1),[u,d]=o.useState(""),z=ut(s,i),P=z?.bounds,L=Math.round((P?.w||0)*b),D=Math.round((P?.h||0)*b),O=!P||L<1||D<1||L*D>4e7||Math.max(L,D)>16384;return t.jsxs("section",{className:"ims-export ims-panel","aria-label":c("imageStudio.exportOptions"),children:[t.jsxs("div",{className:"ims-section-head",children:[t.jsx("h3",{children:c("imageStudio.exportOptions")}),t.jsx("button",{"aria-label":c("imageStudio.close"),onClick:j,children:t.jsx(fe,{size:15})})]}),t.jsxs("div",{className:"ims-fields",children:[t.jsxs("label",{children:[c("imageStudio.format"),t.jsx("select",{"aria-label":c("imageStudio.format"),value:g,onChange:h=>v(h.target.value),children:["png","jpeg","webp","svg"].map(h=>t.jsx("option",{value:h,children:h.toUpperCase()},h))})]}),t.jsxs("label",{children:[c("imageStudio.scale"),t.jsx("select",{"aria-label":c("imageStudio.scale"),value:b,onChange:h=>C(Number(h.target.value)),children:[.5,1,2,3].map(h=>t.jsxs("option",{value:h,children:[h,"×"]},h))})]}),t.jsxs("label",{children:[c("imageStudio.background"),t.jsxs("select",{"aria-label":c("imageStudio.background"),value:l,onChange:h=>p(h.target.value),children:[t.jsx("option",{value:"transparent",children:c("imageStudio.transparent")}),t.jsx("option",{value:"#ffffff",children:c("imageStudio.white")}),t.jsx("option",{value:"#000000",children:c("imageStudio.black")})]})]}),(g==="jpeg"||g==="webp")&&t.jsxs("label",{children:[c("imageStudio.quality"),t.jsx("input",{"aria-label":c("imageStudio.quality"),type:"range",min:".1",max:"1",step:".05",value:S,onChange:h=>y(Number(h.target.value))})]})]}),t.jsxs("p",{children:[L," × ",D," px · ",c(i.length?"imageStudio.selectedOnly":"imageStudio.allVisible")]}),g==="svg"&&t.jsx("p",{children:c("imageStudio.svgHint")}),g==="jpeg"&&l==="transparent"&&t.jsx("p",{children:c("imageStudio.jpegHint")}),O&&t.jsx("p",{role:"alert",children:c("imageStudio.exportLimit")}),t.jsxs("button",{className:"ims-primary",disabled:N||O,onClick:async()=>{w(!0),d("");try{ee(await mt(s,i,{format:g,scale:b,background:l,quality:S}),`${s.name}.${g==="jpeg"?"jpg":g}`)}catch(h){d(String(h))}finally{w(!1)}},children:[N?t.jsx(te,{className:"ims-spin",size:15}):t.jsx(R,{size:15}),c("imageStudio.download")]}),u&&t.jsx("p",{role:"alert",children:c("imageStudio.error",{error:u})})]})}function Ut({target:s,board:i,busy:j,onClose:c,onImport:g,onExport:v,onInspect:b,run:C}){const{t:l}=U(),p=i?M(i).filter(d=>s.ids.includes(d.id)):[],S=p.length===1&&be(p[0])?p[0]:void 0,y=p.filter(d=>!d.locked).map(d=>d.id),N=/Mac|iPhone|iPad/.test(navigator.platform)?"⌘":"Ctrl+",w=d=>()=>{i&&r.getState().activeId!==i.id||(r.setState({selection:p.map(z=>z.id)}),d())},u=[];return S&&u.push({label:l("imageStudio.downloadImage"),icon:t.jsx(R,{size:14}),disabled:j,run:w(()=>{C(async()=>ee(await pt([S],!0),S.name.replace(/\.[^.]+$/,"")+".png"))})},{label:l("imageStudio.downloadOriginal"),icon:t.jsx(R,{size:14}),run:w(()=>{const d={"image/png":"png","image/jpeg":"jpg","image/webp":"webp","image/gif":"gif"}[S.blob.type]||"png";ee(S.blob,S.name.replace(/\.[^.]+$/,"")+"-original."+d)})}),p.length&&i?u.push({label:l("imageStudio.exportSelection"),icon:t.jsx(R,{size:14}),disabled:j,run:w(v)},{label:l("imageStudio.reference"),icon:t.jsx(Z,{size:14}),separatorBefore:!0,disabled:j||p.length>8,run:w(()=>{C(we)})},{label:l("imageStudio.inspector"),icon:t.jsx(Se,{size:14}),run:w(b)},{label:l("imageStudio.copyObjects"),icon:t.jsx(je,{size:14}),shortcut:`${N}C`,separatorBefore:!0,run:w(Ce)},{label:l("imageStudio.duplicate"),icon:t.jsx(At,{size:14}),shortcut:`${N}D`,run:w(()=>B(!0))},{label:l("imageStudio.layerUp"),icon:t.jsx($e,{size:14}),separatorBefore:!0,disabled:!y.length,run:w(()=>r.getState().update(i.id,d=>ce(d,y,"up")))},{label:l("imageStudio.layerDown"),icon:t.jsx(Re,{size:14}),disabled:!y.length,run:w(()=>r.getState().update(i.id,d=>ce(d,y,"down")))},{label:l(y.length?"imageStudio.lock":"imageStudio.unlock"),icon:y.length?t.jsx(kt,{size:14}):t.jsx(zt,{size:14}),run:w(()=>r.getState().update(i.id,d=>rt(d,z=>s.ids.includes(z.id)?{...z,locked:!!y.length}:z)))},{label:l("imageStudio.remove"),icon:t.jsx(ve,{size:14}),shortcut:"⌫",separatorBefore:!0,danger:!0,disabled:!y.length,run:w(ke)}):u.push({label:l("imageStudio.import"),icon:t.jsx(W,{size:14}),disabled:j,run:g},{label:l("imageStudio.pasteObjects"),icon:t.jsx($t,{size:14}),shortcut:`${N}V`,disabled:!i||!gt(),run:w(()=>B())},{label:l("imageStudio.selectAll"),icon:t.jsx(at,{size:14}),disabled:!i?.images.length&&!i?.elements?.length,run:()=>r.setState({selection:i?M(i).filter(d=>!d.hidden).map(d=>d.id):[]})},{label:l("imageStudio.exportBoard"),icon:t.jsx(R,{size:14}),separatorBefore:!0,disabled:j||!i||!M(i).some(d=>!d.hidden),run:w(v)}),t.jsx(nt,{menu:{x:s.x,y:s.y,items:u},onClose:c,autoFocus:!0})}const pe=4/3,Ft=.05;function Ht({board:s}){const i=ot(s,2);if(!i.length)return t.jsx("span",{className:"ims-cover is-empty",children:t.jsx("span",{className:"ims-cover-in",children:t.jsx(He,{size:22,strokeWidth:1.4})})});const j=i.map(g=>{const v=ye(g);return v.w/v.h}),c=Math.min(1,(1-Ft*(i.length-1))*pe/j.reduce((g,v)=>g+v,0));return t.jsx("span",{className:"ims-cover",children:t.jsx("span",{className:"ims-cover-in",children:i.map((g,v)=>t.jsx("span",{className:"ims-cover-img",style:{width:`${j[v]*c/pe*100}%`,aspectRatio:String(j[v])},children:t.jsx(ht,{image:g})},g.id))})})}function Vt(){const{t:s,locale:i}=U(),j=r(u=>u.boards),[c,g]=o.useState(""),[v,b]=o.useState(!1),[C,l]=o.useState(""),p=o.useRef(null),S=o.useMemo(()=>Object.values(j).sort((u,d)=>d.updatedAt-u.updatedAt),[j]),y=c.trim().toLocaleLowerCase(),N=y?S.filter(u=>u.name.toLocaleLowerCase().includes(y)):S,w=async u=>{b(!0),l("");try{const d=await xt(u),z=r.getState().create(d.name);r.getState().update(z,P=>({...d,id:P.id}))}catch(d){l(String(d))}finally{b(!1)}};return t.jsx("div",{className:"csl-launchpad ims-launch",children:t.jsx("div",{className:"csl-inner",children:t.jsxs("main",{className:"csl-catalog",children:[t.jsxs("header",{className:"csl-catalog-header",children:[t.jsxs("div",{children:[t.jsx("h1",{children:s("imageStudio.projects")}),t.jsx("p",{children:s("imageStudio.launch.subtitle")})]}),t.jsxs("div",{className:"csl-catalog-actions",children:[t.jsxs("button",{type:"button",className:"csl-import",disabled:v,onClick:()=>p.current?.click(),children:[t.jsx(Ae,{size:15}),s("imageStudio.restore")]}),t.jsxs("button",{type:"button",className:"csl-new",onClick:()=>r.getState().create(s("imageStudio.untitled")),children:[t.jsx(Be,{size:16}),s("imageStudio.new")]})]})]}),C&&t.jsx("div",{className:"ims-error",role:"alert",children:s("imageStudio.error",{error:C})}),S.length>0&&t.jsx("div",{className:"csl-catalog-toolbar",children:t.jsxs("label",{className:"csl-search",children:[t.jsx(Ue,{size:15}),t.jsx("input",{type:"search","aria-label":s("imageStudio.launch.search"),placeholder:s("imageStudio.launch.search"),value:c,onChange:u=>g(u.target.value)})]})}),N.length?t.jsx("div",{className:"ims-launch-grid",role:"group","aria-label":s("imageStudio.projects"),children:N.map(u=>t.jsxs("button",{type:"button",className:"ims-launch-card","data-project-id":u.id,onClick:()=>r.getState().open(u.id),children:[t.jsx(Ht,{board:u}),t.jsxs("span",{className:"ims-launch-meta",children:[t.jsx("strong",{children:u.name}),t.jsxs("small",{children:[s("imageStudio.itemCount",{count:M(u).length})," · ",Fe(u.updatedAt,{locale:i})]})]})]},u.id))}):t.jsxs("div",{className:"csl-empty",children:[t.jsx("strong",{children:s(S.length?"imageStudio.launch.noMatch":"imageStudio.launch.empty")}),!S.length&&t.jsx("p",{children:s("imageStudio.launch.emptyHint")})]}),t.jsx("input",{ref:p,type:"file",accept:".json",hidden:!0,onChange:u=>{const d=u.target.files?.[0];u.target.value="",d&&w(d)}})]})})})}const he=[];function fs(s){const{t:i}=U(),j=r(l=>l.ready),c=r(l=>l.error),g=r(l=>l.activeId);o.useEffect(()=>{r.getState().hydrate();const l=()=>{r.getState().flush()},p=S=>{const y=r.getState();(y.saving||y.ready&&y.error)&&(l(),S.preventDefault(),S.returnValue="")};return window.addEventListener("pagehide",l),window.addEventListener("beforeunload",p),()=>{window.removeEventListener("pagehide",l),window.removeEventListener("beforeunload",p),l()}},[]);const v=Ve(l=>l.activeSpaceId==="image-studio")&&_e()==="main",b=!!g,C=o.useRef(!1);return o.useEffect(()=>{!j||!v||(b?ft():St(C.current),C.current=b)},[j,v,b]),j?g?t.jsx(_t,{},g):t.jsx(Vt,{}):t.jsx("div",{className:"ims-panel ims-panel-empty",children:c?t.jsxs(t.Fragment,{children:[t.jsx("p",{role:"alert",children:i("imageStudio.error",{error:c})}),t.jsx("button",{onClick:()=>{r.getState().hydrate()},children:i("imageStudio.retry")})]}):t.jsx(te,{className:"ims-spin"})})}function _t(){const{t:s}=U(),i=r(e=>e.activeId?e.boards[e.activeId]:void 0),j=r(e=>e.saving),c=r(e=>e.error),g=r(e=>i&&e.past[i.id]?.length||0),v=r(e=>i&&e.future[i.id]?.length||0),b=r(e=>e.selection),C=r(e=>i&&e.placeholders[i.id]||he),l=qe(e=>!!(i?.sessionId&&e.runningBySession[i.sessionId])),[p,S]=o.useState(!1),[y,N]=o.useState(""),[w,u]=o.useState(0),[d,z]=o.useState(!1),[P,L]=o.useState(!1),[D,O]=o.useState(!1),h=o.useRef(null),[se,ze]=o.useState(!0),[ie,Ne]=o.useState(!1),[Ie,Y]=o.useState(!1),I=o.useRef(null),F=o.useRef(null),[ae,ne]=o.useState(null),Ee=o.useCallback(()=>{ne(null),I.current?.focus({preventScroll:!0})},[]),m=Ke(I,`image-studio:${i?.id||""}`,void 0,{x:56,y:64,z:1}),H=i?.images||[],T=i?M(i):[],V=T.filter(e=>!e.hidden),Pe=!T.length&&!g&&!v,X=[...V,...C],_=o.useRef(!0);o.useEffect(()=>(_.current=!0,()=>{_.current=!1}),[]);const re=o.useCallback(e=>{_.current&&N(e)},[]);jt(i||qt,re,w);const x=tt(I,m,{boxes:()=>new Map(V.map(e=>[e.id,e])),identity:()=>i?.id,commit:e=>{i&&r.getState().update(i.id,a=>me(a,e))},constrain:(e,a)=>{if(a.kind!=="resize")return e;const n=H.find(Oe=>Oe.id===a.key),f=e.get(a.key);if(!n||!f)return e;const k=ye(n),E=Math.max(48,f.w),De=E*k.h/k.w;return new Map(e).set(a.key,{...f,w:E,h:De})},hitKey:e=>e.closest("[data-image-id]")?.dataset.imageId||null,isEditing:e=>!!T.find(a=>a.id===e)?.locked,hitEdge:e=>e.dataset.resize||null,onDelete:e=>{i&&r.getState().update(i.id,a=>ue(a,M(a).filter(n=>n.locked||!e.includes(n.id))))},onDoubleClick:e=>{e&&(r.setState({selection:[e]}),A(K))},onContextMenu:(e,a)=>{const n=e?x.sel.includes(e)?x.sel:[e]:[];x.setSel(n),r.setState({selection:n}),ne({x:a.clientX,y:a.clientY,ids:n})},minW:48,minH:48,repel:!1},se);o.useEffect(()=>x.bind(I.current),[x.bind]),o.useEffect(()=>m.bindWheel(I.current),[m.bindWheel]),o.useEffect(()=>{const e=()=>{O(!1),h.current=null};return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[]);const oe=o.useRef(x.sel);o.useEffect(()=>{oe.current!==x.sel&&(oe.current=x.sel,r.setState({selection:x.sel}))},[x.sel]),o.useEffect(()=>{if(b.join("|")!==x.sel.join("|")){x.setSel(b);const e=T.find(a=>a.id===b[0]);if(e){const{w:a,h:n}=q(I.current),f=m.vpRef.current,k=(e.x+e.w/2)*f.z+f.x,E=(e.y+e.h/2)*f.z+f.y;(k<0||k>a||E<0||E>n)&&m.centerOn(e.x+e.w/2,e.y+e.h/2)}}},[b,x.setSel]);const le=o.useRef(0);o.useEffect(()=>{const e=T.length+C.length;e>le.current&&m.fitTo(X,64),le.current=e},[T,C,m.fitTo]);const $=async e=>{S(!0),N("");try{await e()}catch(a){re(String(a))}finally{_.current&&S(!1)}},G=()=>i?.id||r.getState().create(s("imageStudio.untitled")),de=async e=>{const a=await Promise.all(e.map(f=>Ct(f,f.name,"import")));if(!a.length)return;const n=G();r.getState().update(n,f=>{const k=[...f.images];for(const E of a)k.push({...E,...ct(E.width,E.height,k)});return{...f,images:k}})},Le=e=>{$(async()=>{const a=G();await yt(a,s(e))})},Q=T.filter(e=>b.includes(e.id)),Te=i&&x.live?M(me(i,x.live)):T,J=e=>{const a=G(),{w:n,h:f}=q(I.current),k=dt(e,s(`imageStudio.new.${e}`),(n/2-m.vp.x)/m.vp.z,(f/2-m.vp.y)/m.vp.z);k.x-=k.w/2,k.y-=k.h/2,r.getState().update(a,E=>ue(E,[...M(E),k])),r.setState({selection:[k.id]}),A(K)},Me=e=>{const{w:a,h:n}=q(I.current);m.setVp(et(m.vp,m.vp.z*e,a/2,n/2))};return t.jsxs("div",{className:"ims",onKeyDownCapture:e=>{if(e.target.closest('input, select, textarea, button, [contenteditable="true"]'))return;const a=e.metaKey||e.ctrlKey,n=e.key.toLowerCase();let f=!0;a&&n==="z"&&i?r.getState().undo(i.id,e.shiftKey):a&&n==="c"?Ce():a&&n==="v"?B():a&&n==="d"?B(!0):a&&n==="e"?z(!0):!a&&n==="t"?J("text"):!a&&n==="f"?J("frame"):!a&&n==="h"?L(!0):!a&&n==="v"?L(!1):n===" "?O(!0):(n==="escape"&&(L(!1),z(!1)),f=!1),f&&(e.preventDefault(),e.stopPropagation())},onKeyUpCapture:e=>{e.key===" "&&(O(!1),e.preventDefault(),e.stopPropagation())},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(O(!1),h.current=null)},children:[t.jsxs("header",{className:"ims-header",children:[t.jsxs("button",{className:"ims-back",title:s("imageStudio.back"),onClick:()=>r.getState().close(),children:[t.jsx(We,{size:15}),t.jsx("span",{children:i?.name})]}),t.jsxs("div",{className:"ims-head-actions",children:[i&&t.jsx("button",{disabled:p,title:s("imageStudio.backup"),"aria-label":s("imageStudio.backup"),onClick:()=>{$(()=>wt(i))},children:t.jsx(Nt,{size:16})}),t.jsxs("button",{className:"ims-primary",disabled:!V.length||p,onClick:()=>z(!d),children:[t.jsx(R,{size:14}),t.jsx("span",{children:s("imageStudio.exportOptions")})]})]})]}),t.jsxs("div",{className:"ims-toolbar",role:"toolbar","aria-label":s("imageStudio.title"),children:[t.jsxs("button",{disabled:p,onClick:()=>F.current?.click(),children:[t.jsx(W,{size:15}),t.jsx("span",{children:s("imageStudio.import")})]}),!Pe&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"ims-divider"}),t.jsx("button",{disabled:!g,title:s("imageStudio.undo"),"aria-label":s("imageStudio.undo"),onClick:()=>i&&r.getState().undo(i.id),children:t.jsx(Et,{size:15})}),t.jsx("button",{disabled:!v,title:s("imageStudio.redo"),"aria-label":s("imageStudio.redo"),onClick:()=>i&&r.getState().undo(i.id,!0),children:t.jsx(It,{size:15})}),t.jsx("button",{disabled:!H.some(e=>!e.locked&&!e.hidden),title:s("imageStudio.arrange"),"aria-label":s("imageStudio.arrange"),onClick:()=>{if(i){const e=lt(H.filter(a=>!a.locked&&!a.hidden));r.getState().update(i.id,a=>({...a,images:a.images.map(n=>e.find(f=>f.id===n.id)||n)})),m.fitTo(e)}},children:t.jsx(Pt,{size:15})}),t.jsx("button",{disabled:!Q.length,title:s("imageStudio.remove"),"aria-label":s("imageStudio.remove"),onClick:ke,children:t.jsx(ve,{size:15})}),t.jsx("button",{disabled:!Q.length,title:s("imageStudio.duplicate"),"aria-label":s("imageStudio.duplicate"),onClick:()=>B(!0),children:t.jsx(je,{size:15})}),t.jsx("button",{disabled:!Q.length||p,title:s("imageStudio.reference"),"aria-label":s("imageStudio.reference"),onClick:()=>{$(we)},children:t.jsx(Z,{size:15})})]}),t.jsx("span",{className:"ims-toolbar-space"}),[[ge,Z,"imageStudio.chat"],[vt,Ye,"imageStudio.layers"],[K,Se,"imageStudio.inspector"]].map(([e,a,n])=>t.jsx("button",{title:s(n),"aria-label":s(n),onClick:()=>A(e),children:t.jsx(a,{size:16})},e))]}),d&&i&&t.jsx(Bt,{board:i,selection:b,onClose:()=>z(!1)}),c&&t.jsxs("div",{className:"ims-error",role:"alert",children:[s("imageStudio.saveError"),t.jsx("button",{onClick:()=>{r.getState().flush()},children:s("imageStudio.retry")})]}),y&&t.jsxs("div",{className:"ims-error",role:"alert",children:[s("imageStudio.error",{error:y}),t.jsx("button",{onClick:()=>{N(""),u(e=>e+1)},children:s("imageStudio.retry")})]}),t.jsxs("div",{ref:I,className:`ims-stage${P||D?" is-panning":""}`,tabIndex:0,onContextMenu:e=>e.stopPropagation(),onPointerDownCapture:e=>{e.button===2||!(P||D)||e.target.closest(".amx-stage-tools, .amx-stage-hud, .amx-stage-minimap")||(e.stopPropagation(),e.preventDefault(),e.currentTarget.focus(),e.currentTarget.setPointerCapture(e.pointerId),h.current={id:e.pointerId,x:e.clientX,y:e.clientY,vx:m.vp.x,vy:m.vp.y})},onPointerMoveCapture:e=>{const a=h.current;if(!a||a.id!==e.pointerId)return;e.stopPropagation();const{u:n}=q(I.current);m.setVp({...m.vp,x:a.vx+(e.clientX-a.x)/n,y:a.vy+(e.clientY-a.y)/n})},onPointerUpCapture:e=>{h.current?.id===e.pointerId&&(e.stopPropagation(),h.current=null)},onPointerCancel:()=>{h.current=null},"aria-label":s("imageStudio.title"),onDragOver:e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),Y(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||Y(!1)},onDrop:e=>{e.preventDefault(),Y(!1),p||$(()=>de(Array.from(e.dataTransfer.files)))},children:[t.jsx("div",{className:"ims-grid",style:Xe(m.vp)}),t.jsxs("div",{className:"ims-world",style:{transform:`translate(${m.vp.x}px, ${m.vp.y}px) scale(${m.vp.z})`},children:[V.map(e=>{const a=Te.find(n=>n.id===e.id)||e;return t.jsxs("div",{"data-image-id":e.id,className:`ims-layer ${be(e)?"ims-image":`ims-${e.kind}`}${x.sel.includes(e.id)?" is-selected":""}${e.locked?" is-locked":""}`,style:{left:a.x,top:a.y,width:a.w,height:a.h},children:[t.jsx(bt,{item:e}),t.jsx("div",{className:"ims-image-label",children:e.name}),x.sel.includes(e.id)&&!e.locked&&t.jsx("div",{className:"ims-resize","data-resize":"se"})]},e.id)}),C.map(e=>{const a=H.find(n=>n.id===e.sourceIds[0]);return t.jsxs("div",{"data-generation-id":e.id,className:`ims-generation${e.status==="failed"?" is-failed":""}`,style:{left:e.x,top:e.y,width:e.w,height:e.h},role:e.status==="failed"?"alert":"status","aria-live":"polite",onPointerDown:n=>n.stopPropagation(),children:[t.jsx("div",{className:"ims-generation-sheen"}),t.jsxs("div",{className:"ims-generation-copy",children:[t.jsx(Ge,{size:20,strokeWidth:1.5}),t.jsx("strong",{children:s(e.kind==="edit"?"imageStudio.generation.editing":"imageStudio.generation.creating")}),t.jsx("span",{children:e.status==="failed"?s("imageStudio.generation.failed"):s(e.status==="preparing"?"imageStudio.generation.preparing":"imageStudio.generation.running")}),a&&t.jsx("small",{children:s("imageStudio.generation.versionOf",{name:a.name})}),e.count>1&&t.jsxs("small",{children:[e.index+1," / ",e.count]})]}),e.status==="failed"&&t.jsxs("div",{className:"ims-generation-actions amx-stage-tools",children:[t.jsx("button",{onClick:()=>A(ge),children:s("imageStudio.generation.openChat")}),t.jsx("button",{title:s("imageStudio.generation.dismiss"),"aria-label":s("imageStudio.generation.dismiss"),onClick:()=>r.getState().removeGeneration(i.id,e.id),children:t.jsx(fe,{size:14})})]})]},e.id)}),x.marquee&&t.jsx("div",{className:"ims-marquee",style:{left:x.marquee.x,top:x.marquee.y,width:x.marquee.w,height:x.marquee.h}})]}),!T.length&&!C.length&&t.jsxs("div",{className:"ims-empty amx-stage-tools",children:[t.jsxs("div",{className:"ims-eyebrow",children:[s("imageStudio.title")," ",t.jsx("span",{children:"/"})," ",s("imageStudio.new")]}),t.jsx("h1",{children:s("imageStudio.headline")}),t.jsx("p",{children:s("imageStudio.intro")}),t.jsx("div",{className:"ims-starters",children:["poster","product","illustration"].map(e=>t.jsxs("button",{disabled:p,onClick:()=>Le(`imageStudio.${e}Prompt`),children:[t.jsx("span",{children:s(`imageStudio.${e}`)}),t.jsx(Lt,{size:14})]},e))}),t.jsxs("button",{className:"ims-empty-import",disabled:p,onClick:()=>F.current?.click(),children:[t.jsx(W,{size:16}),s("imageStudio.import")]}),t.jsx("small",{children:s("imageStudio.importLimit")})]}),!C.length&&(l||p)&&t.jsxs("div",{className:"ims-progress amx-stage-tools",role:"status",children:[t.jsx(te,{size:15,className:"ims-spin"}),s(l?"imageStudio.generating":"imageStudio.busy")]}),Ie&&t.jsxs("div",{className:"ims-drop",children:[t.jsx(W,{size:28}),s("imageStudio.drop")]}),t.jsxs("div",{className:"ims-create-tools amx-stage-tools",role:"toolbar","aria-label":s("imageStudio.canvasTools"),children:[t.jsx("button",{title:s("imageStudio.selectTool"),"aria-label":s("imageStudio.selectTool"),"aria-pressed":!P,onClick:()=>{L(!1),I.current?.focus()},children:t.jsx(Qe,{size:17})}),t.jsx("button",{title:s("imageStudio.handTool"),"aria-label":s("imageStudio.handTool"),"aria-pressed":P,onClick:()=>{L(!0),I.current?.focus()},children:t.jsx(Tt,{size:17})}),t.jsx("span",{}),[["text",Mt],["rectangle",Je],["ellipse",Ze],["frame",Dt]].map(([e,a])=>t.jsx("button",{title:s(`imageStudio.add.${e}`),"aria-label":s(`imageStudio.add.${e}`),onClick:()=>J(e),children:t.jsx(a,{size:17})},e))]}),ie&&t.jsx(st,{hostRef:I,vp:m.vp,items:X.map(e=>({key:e.id,kind:"card",box:e})),onCenter:m.centerOn}),t.jsx(it,{zoom:m.vp.z,onZoomBy:Me,onFit:()=>m.fitTo(X),snap:se,onSnap:ze,mini:ie,onMini:Ne})]}),t.jsxs("footer",{className:"ims-footer",children:[t.jsx("span",{title:s("imageStudio.hint"),children:s(i?c?"imageStudio.unsaved":j?"imageStudio.saving":"imageStudio.local":"imageStudio.empty")}),i&&t.jsx("input",{"aria-label":s("imageStudio.name"),value:i.name,onChange:e=>r.getState().update(i.id,a=>({...a,name:e.target.value}),!1)}),t.jsx("span",{children:s("imageStudio.itemCount",{count:T.length})})]}),ae&&t.jsx(Ut,{target:ae,board:i,busy:p,onClose:Ee,onImport:()=>F.current?.click(),onExport:()=>z(!0),onInspect:()=>A(K),run:$}),t.jsx("input",{ref:F,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",multiple:!0,hidden:!0,onChange:e=>{const a=Array.from(e.target.files||[]);e.target.value="",$(()=>de(a))}})]})}const qt={version:1,id:"",name:"",updatedAt:0,sessionId:null,images:[],collected:[]};export{fs as ImageStudioView};
@@ -0,0 +1 @@
1
+ import{P as $,u as H,d as r,j as t,r as Q}from"./index-BOzsniE1.js";import{aq as V,cj as W,T as X}from"./appStore-CI1_L5OS.js";import"./client-CaivGZFR.js";const Y=[{id:"Chinese (Simplified)",label:"简体中文"},{id:"English",label:"English"},{id:"Japanese",label:"日本語"},{id:"Korean",label:"한국어"},{id:"French",label:"Français"},{id:"German",label:"Deutsch"},{id:"Spanish",label:"Español"},{id:"Russian",label:"Русский"}],D=(g,d)=>(g.match(d)||[]).length;function te(g,d=$()){const o=g.replace(/[\s\p{P}\p{S}\d]/gu,"");if(!o)return d==="zh"?"English":"Chinese (Simplified)";const b=!/[぀-ヿ]/.test(o)&&D(o,/[㐀-鿿豈-﫿]/g)/o.length>.3;return d==="zh"?b?"English":"Chinese (Simplified)":D(o,/[A-Za-z]/g)/o.length>.9?"Chinese (Simplified)":"English"}Q({"inlineai.action.improve":{zh:"润色",en:"Improve writing"},"inlineai.action.fix":{zh:"修正拼写与语法",en:"Fix spelling and grammar"},"inlineai.action.shorter":{zh:"精简",en:"Make shorter"},"inlineai.action.longer":{zh:"扩写",en:"Make longer"},"inlineai.action.summarize":{zh:"总结",en:"Summarize"},"inlineai.action.translate":{zh:"翻译",en:"Translate"},"inlineai.action.continue":{zh:"续写",en:"Continue writing"},"inlineai.action.custom":{zh:"自定义指令…",en:"Custom instruction…"},"inlineai.label":{zh:"AI 写作",en:"AI writing"},"inlineai.placeholder":{zh:"告诉 Tangu 要写什么,留空则续写",en:"Tell Tangu what to write, or leave empty to continue"},"inlineai.placeholderSel":{zh:"告诉 Tangu 怎么改选中的文字",en:"Tell Tangu how to change the selection"},"inlineai.send":{zh:"生成",en:"Generate"},"inlineai.generating":{zh:"正在生成…",en:"Generating…"},"inlineai.stop":{zh:"停止",en:"Stop"},"inlineai.replace":{zh:"替换",en:"Replace"},"inlineai.insertBelow":{zh:"插入下方",en:"Insert below"},"inlineai.insert":{zh:"插入",en:"Insert"},"inlineai.discard":{zh:"丢弃",en:"Discard"},"inlineai.retry":{zh:"重试",en:"Try again"},"inlineai.hint":{zh:"预览:确认后才写入笔记",en:"Preview: nothing is written until you confirm"},"inlineai.toolText":{zh:"模型写出了工具调用的样子,但这里什么都没有执行",en:"The model wrote something that looks like a tool call, but nothing was run"},"inlineai.errEmptyResult":{zh:"没有生成任何内容",en:"Nothing was generated"},"inlineai.unavailable":{zh:"这里用不了正文 AI",en:"In-note AI is not available here"},"inlineai.targetChanged":{zh:"选中的文字在生成期间被改过,结果已插入到下方",en:"The selection changed while generating, so the result was inserted below it"},"inlineai.copy":{zh:"复制",en:"Copy"},"inlineai.copied":{zh:"已复制",en:"Copied"},"inlineai.close":{zh:"关闭",en:"Close"},"inlineai.targetLang":{zh:"目标语言",en:"Target language"},"inlineai.byMt":{zh:"机器翻译 · {name}",en:"Machine translation · {name}"}});function ie({x:g,y:d,anchorTop:o,title:b,hasSelection:m,askFirst:k,run:M,onApply:s,onClose:c,editorEl:N,language:f}){const{t:i}=H(),[a,h]=r.useState(k?"ask":"running"),[x,F]=r.useState(""),[u,v]=r.useState(""),[G,E]=r.useState(""),[B,T]=r.useState(!1),[q,O]=r.useState(""),[J,C]=r.useState(!1),w=r.useRef(null),p=r.useRef(""),R=r.useRef(void 0),S=r.useRef(null),y=r.useRef(null),I=r.useRef(N);I.current=N;const z=n=>{w.current?.abort();const e=new AbortController;w.current=e,R.current=n,p.current="",v(""),E(""),T(!1),h("running"),M(n,l=>{e.signal.aborted||(p.current+=l,v(p.current))},e.signal).then(l=>{if(e.signal.aborted)return;const P=String(l.text??"");v(P),T(!!l.toolCallText),O(l.model?l.model.mt?i("inlineai.byMt",{name:l.model.name}):l.model.name:""),P.trim()?h("done"):(E(i("inlineai.errEmptyResult")),h("error"))}).catch(l=>{e.signal.aborted||(E(String(l?.message||l)),h("error"))})},U=()=>{w.current?.abort(),p.current.trim()?(v(p.current),h("done")):k?h("ask"):c()};r.useEffect(()=>(k?requestAnimationFrame(()=>S.current?.focus()):z(void 0),()=>w.current?.abort()),[]);const L=m?"replace":"insert",K=n=>{const e=document.activeElement;return!e||e===document.body||e===document.documentElement?!0:y.current?.contains(e)?!n||e===y.current:s?!!I.current?.contains(e):!e.matches('input, textarea, select, [contenteditable]:not([contenteditable="false"])')},j=r.useRef({phase:a,text:u,primary:L});j.current={phase:a,text:u,primary:L},r.useEffect(()=>{const n=e=>{e.isComposing||e.keyCode===229||(e.key==="Escape"&&K(!1)?(e.preventDefault(),e.stopPropagation(),c()):s&&e.key==="Enter"&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&j.current.phase==="done"&&K(!0)&&(e.preventDefault(),e.stopPropagation(),s(j.current.primary,j.current.text)))};return window.addEventListener("keydown",n,!0),()=>window.removeEventListener("keydown",n,!0)},[c,s]),r.useEffect(()=>{if(s)return;const n=e=>{y.current?.contains(e.target)||c()};return document.addEventListener("mousedown",n,!0),()=>document.removeEventListener("mousedown",n,!0)},[s,c]);const Z=()=>{navigator.clipboard?.writeText(u).then(()=>{C(!0),window.setTimeout(()=>C(!1),1500)}).catch(()=>{})},_=n=>t.jsx("button",{type:"button",className:`btn sm${n?" primary":""}`,"data-act":"copy",onClick:Z,children:i(J?"inlineai.copied":"inlineai.copy")});return t.jsxs(V,{innerRef:n=>{y.current=n},className:"ui-popover am-ai-panel",x:g,y:d,anchorTop:o,prefer:"below",role:"dialog","aria-label":s?i("inlineai.label"):b,"data-testid":"inline-ai-panel","data-phase":a,"data-readonly":s?void 0:"",children:[t.jsxs("div",{className:"am-ai-head",children:[f?t.jsx(W,{size:14,"aria-hidden":!0}):t.jsx(X,{size:14,"aria-hidden":!0}),t.jsx("span",{className:"am-ai-title",children:b}),f&&t.jsx("select",{className:"am-ai-lang","aria-label":i("inlineai.targetLang"),"data-testid":"inline-ai-lang",value:f.value,onChange:n=>f.onChange(n.target.value),children:Y.map(n=>t.jsx("option",{value:n.id,children:n.label},n.id))}),a!=="ask"&&t.jsx("span",{className:"am-ai-hint","data-testid":"inline-ai-hint",children:a==="running"?i("inlineai.generating"):a==="done"&&q||(s?i("inlineai.hint"):"")})]}),a==="ask"&&t.jsxs("div",{className:"am-ai-ask",children:[t.jsx("textarea",{ref:S,className:"am-ai-input",rows:2,value:x,placeholder:i(m?"inlineai.placeholderSel":"inlineai.placeholder"),onChange:n=>F(n.target.value),onKeyDown:n=>{if(n.key!=="Enter"||n.shiftKey||n.nativeEvent.isComposing||n.keyCode===229)return;n.preventDefault(),n.stopPropagation();const e=x.trim();!e&&m||z(e||void 0)}}),t.jsxs("div",{className:"am-ai-actions",children:[t.jsx("button",{type:"button",className:"btn sm primary","data-act":"send",disabled:m&&!x.trim(),onClick:()=>z(x.trim()||void 0),children:i("inlineai.send")}),t.jsx("button",{type:"button",className:"btn sm","data-act":"discard",onClick:c,children:i("inlineai.discard")})]})]}),a!=="ask"&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"am-ai-preview","data-testid":"inline-ai-preview",children:u||(a==="running"?"…":"")}),a==="error"&&t.jsx("div",{className:"am-ai-error",role:"alert",children:G}),B&&a==="done"&&t.jsx("div",{className:"am-ai-error",children:i("inlineai.toolText")}),t.jsxs("div",{className:"am-ai-actions",children:[a==="running"&&t.jsx("button",{type:"button",className:"btn sm","data-act":"stop",onClick:U,children:i("inlineai.stop")}),a==="done"&&s&&m&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"btn sm primary","data-act":"replace",onClick:()=>s("replace",u),children:i("inlineai.replace")}),t.jsx("button",{type:"button",className:"btn sm","data-act":"below",onClick:()=>s("below",u),children:i("inlineai.insertBelow")})]}),a==="done"&&s&&!m&&t.jsx("button",{type:"button",className:"btn sm primary","data-act":"insert",onClick:()=>s("insert",u),children:i("inlineai.insert")}),a==="done"&&_(!s),(a==="done"||a==="error")&&t.jsx("button",{type:"button",className:"btn sm","data-act":"retry",onClick:()=>z(R.current),children:i("inlineai.retry")}),t.jsx("button",{type:"button",className:"btn sm","data-act":"discard",onClick:c,children:i(s?"inlineai.discard":"inlineai.close")})]})]})]})}export{ie as I,te as t};
@@ -0,0 +1 @@
1
+ .am-ai-panel{z-index:100;width:min(440px,calc(100vw - 32px));padding:8px 10px 10px;display:flex;flex-direction:column;gap:8px;-webkit-app-region:no-drag}.am-ai-panel .am-ai-head{display:flex;align-items:center;gap:6px;font-size:var(--ui-font-meta, 12px);line-height:var(--ui-line-meta, 1.5);color:var(--text-muted)}.am-ai-panel .am-ai-head>svg{flex:0 0 auto;color:var(--accent-ink)}.am-ai-panel .am-ai-title{font-weight:500;color:var(--text)}.am-ai-panel .am-ai-hint{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.am-ai-panel .am-ai-input{width:100%;box-sizing:border-box;resize:none;padding:6px 8px;border:var(--border-width, 1px) solid var(--border);border-radius:var(--radius-sm);background:var(--bg-input, var(--bg-card));color:var(--text);font:inherit;font-size:var(--ui-font-body, 13px);line-height:var(--ui-line-body, 1.5)}.am-ai-panel .am-ai-preview{max-height:260px;overflow-y:auto;padding:6px 8px;border-radius:var(--radius-sm);background:var(--overlay-light);color:var(--text);font-family:var(--font-body);font-size:var(--ui-font-body, 13px);line-height:var(--ui-line-body, 1.5);white-space:pre-wrap;overflow-wrap:anywhere}.am-ai-panel .am-ai-error{font-size:var(--ui-font-meta, 12px);line-height:var(--ui-line-meta, 1.5);color:var(--danger)}.am-ai-panel .am-ai-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.am-ai-panel .am-ai-lang{flex:0 0 auto;height:22px;padding:0 4px;border:var(--border-width, 1px) solid var(--border);border-radius:var(--radius-sm);background:transparent;color:var(--text-sec, var(--text));font-size:var(--ui-font-meta, 12px);cursor:pointer}.am-ai-panel .am-ai-preview{user-select:text;-webkit-user-select:text}
@@ -0,0 +1 @@
1
+ import{j as s,d as y}from"./index-BOzsniE1.js";import{tc as v,m7 as f,c8 as b,m9 as p,m8 as x,td as z,lx as T}from"./appStore-CI1_L5OS.js";import{n as S}from"./nativeDownload-CNtwSCy0.js";import"./ipc-B6hkgxQL.js";import"./client-CaivGZFR.js";const L=t=>(t.mime?.startsWith("image/")??!1)||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(t.name);function R(t){const n=t.match(/^data:([^;]+);base64,(.*)$/),e=p(n?.[2]||"");return{mimeType:n?.[1]||"application/octet-stream",bytes:e,size:e.length}}function k(t,n,e,i){e=t.sourceSessionId||e;const o=i==="host"?v(e):null,l=a=>{S({text:a?.message||String(a),level:"error"})},r=o?.downloadHostFile;return{name:t.name,path:o?.local&&t.path&&/^([/~]|[A-Za-z]:[\\/])/.test(t.path)?t.path:void 0,load:async()=>{if(t.dataUrl)return R(t.dataUrl);if(!t.path)return null;if(o){const c=await o.readHostFile(t.path);return c.tooLarge?{tooLarge:!0,size:c.size}:{mimeType:c.mimeType,bytes:p(c.content),size:c.size}}const a=await x(b(e),e,t.path);return{mimeType:a.mimeType,bytes:p(a.content),size:a.size}},download:t.path?i==="host"?r?()=>{r(t.path,t.name).catch(l)}:void 0:()=>{f(b(e),e,t.path).catch(l)}:void 0}}const U=({f:t,onClick:n})=>{const e=T(t.mime||"",t.name);return s.jsxs("button",{className:"inline-file-card",title:t.name,onClick:n,children:[s.jsx(e,{size:15}),s.jsx("span",{className:"inline-file-name",children:t.name})]})},E=({f:t,cfg:n,sessionId:e,execMode:i,onClick:o})=>{e=t.sourceSessionId||e;const l=t.dataUrl||(t.path&&i!=="host"?z(b(e),e,t.path):null),[r,a]=y.useState(l),[c,h]=y.useState(!1),d=y.useRef(null);return y.useEffect(()=>{if(h(!1),l){a(l);return}let u=!1;return(async()=>{if(!t.path)return;const j=i==="host"?v(e):null;try{let g=null,F="";if(j){const m=await j.readHostFile(t.path);if(u)return;if(m.tooLarge){h(!0);return}g=p(m.content),F=m.mimeType}else if(i!=="host"){const m=await x(b(e),e,t.path);if(u)return;g=p(m.content),F=m.mimeType}if(!g||u)return;const w=URL.createObjectURL(new Blob([g],{type:F||t.mime||"image/png"}));d.current=w,a(w)}catch{u||h(!0)}})(),()=>{u=!0,d.current&&(URL.revokeObjectURL(d.current),d.current=null)}},[t.path,t.dataUrl]),c?s.jsx(U,{f:t,onClick:o}):r?s.jsx("img",{className:"inline-file-img",src:r,alt:t.name,title:t.name,onClick:o,draggable:!1,onError:()=>h(!0)}):null},B=({files:t,cfg:n,sessionId:e,execMode:i,onOpenPreview:o})=>{if(!t.length)return null;const l=r=>o?.(k(r,n,e,i));return s.jsx("div",{className:"inline-file-grid",children:t.map((r,a)=>L(r)?s.jsx(E,{f:r,cfg:n,sessionId:e,execMode:i,onClick:()=>l(r)},a):s.jsx(U,{f:r,onClick:()=>l(r)},a))})};export{B as InlineFiles,k as targetFor};
@@ -0,0 +1 @@
1
+ .slash-category-tabs,.wiki-tabs{display:flex;flex-shrink:0;gap:3px;margin:4px 6px 8px;padding:3px;border-radius:var(--radius-pill);background:var(--overlay-light)}.slash-menu .slash-category-tab,.wiki-suggest .wiki-tab{flex:1;min-width:0;border:0;border-radius:var(--radius-pill);padding:4px 8px;background:transparent;color:var(--text-sec);font-family:var(--font-ui);font-size:var(--menu-text-size, var(--ui-font-meta));line-height:var(--ui-line-meta);white-space:nowrap;cursor:pointer}.slash-menu .slash-category-tab[aria-selected=true],.wiki-suggest .wiki-tab[aria-selected=true]{background:var(--menu-hover);color:var(--text)}.wiki-suggest .wiki-tab{flex:1 1 auto}.am-app .wiki-suggest.wiki-suggest-tabbed{min-width:264px;overflow:hidden}.am-app .wiki-suggest-list{display:flex;flex:1 1 auto;flex-direction:column;gap:1px;min-height:0;overflow-y:auto}.slash-menu .slash-list{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.slash-menu .slash-scroll{min-height:0}.slash-menu .slash-foot{flex-shrink:0;flex-wrap:wrap}