koboyo 0.3.0 → 0.4.0

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 (204) hide show
  1. package/assets/editor/assets/DialogDescription-Ddhk2rmF.js +1 -0
  2. package/assets/editor/assets/DialogRoot-DUeVfNhS.js +1 -0
  3. package/assets/editor/assets/DialogTitle-D5au2NAn.js +1 -0
  4. package/assets/editor/assets/FloatingPortalLite-HnWQWrLk.js +1 -0
  5. package/assets/editor/assets/{IconAlertTriangle-CxPhYpe-.js → IconAlertTriangle-B33xznYN.js} +1 -1
  6. package/assets/editor/assets/{IconArrowLeft-DFk3Krim.js → IconArrowLeft-B4Zcy-Fc.js} +1 -1
  7. package/assets/editor/assets/IconChevronLeft-D7e7QC0h.js +1 -0
  8. package/assets/editor/assets/IconChevronRight-csfMBSUs.js +1 -0
  9. package/assets/editor/assets/{IconCode-hd05zxU4.js → IconCode-CHIz1nCU.js} +1 -1
  10. package/assets/editor/assets/IconCornerDownRight-DDiBMO4O.js +1 -0
  11. package/assets/editor/assets/{IconEraser-DlZQe3-r.js → IconEraser-CYfXj27R.js} +1 -1
  12. package/assets/editor/assets/{IconFocusCentered-C5PcDeR0.js → IconFocusCentered-Cn8rbfRI.js} +1 -1
  13. package/assets/editor/assets/IconHelp-CaEwHrsN.js +2 -0
  14. package/assets/editor/assets/{IconLink-ze4g4Lrj.js → IconLink-VS5p9Ytk.js} +1 -1
  15. package/assets/editor/assets/IconLoader2-CzCTn-Sn.js +1 -0
  16. package/assets/editor/assets/IconMinus-BcaDLts8.js +1 -0
  17. package/assets/editor/assets/{IconMoodSmile-Bic_fw54.js → IconMoodSmile-CSZ5p_Hy.js} +1 -1
  18. package/assets/editor/assets/{IconPencil-C5Y-Y4dC.js → IconPencil-D_pQsAyv.js} +1 -1
  19. package/assets/editor/assets/{IconPhoto-CR36IK-b.js → IconPhoto-5zuCDtnR.js} +1 -1
  20. package/assets/editor/assets/{IconPlayerPlayFilled-D4OODBX7.js → IconPlayerPlayFilled-DVAWmYt7.js} +1 -1
  21. package/assets/editor/assets/{IconPlayerStopFilled-BUbX6ZO5.js → IconPlayerStopFilled-D4qdct2R.js} +1 -1
  22. package/assets/editor/assets/IconPlus-D4tAoi-A.js +1 -0
  23. package/assets/editor/assets/{IconPresentation-DCrY3PKL.js → IconPresentation-BMKzt7fv.js} +1 -1
  24. package/assets/editor/assets/{IconSearch-C1K0_Pq_.js → IconSearch-CCpMt02s.js} +1 -1
  25. package/assets/editor/assets/{IconSparkles-WDcg8BA9.js → IconSparkles-CnCp3BCQ.js} +1 -1
  26. package/assets/editor/assets/{IconTrash-DbN_RxB7.js → IconTrash-C8w6ThWx.js} +1 -1
  27. package/assets/editor/assets/{IconUsers-Bwnyj4mm.js → IconUsers-Dp85N225.js} +1 -1
  28. package/assets/editor/assets/IconX-KrRqxr2j.js +1 -0
  29. package/assets/editor/assets/MenuSubmenuTrigger-KacA9GM8.js +1 -0
  30. package/assets/editor/assets/PopoverPopup-B3Y0VRYc.js +1 -0
  31. package/assets/editor/assets/{asset-glyph-B3c--Mx2.js → asset-glyph-C1E6cGwM.js} +1 -1
  32. package/assets/editor/assets/billing-BSXr-z2r.js +1 -0
  33. package/assets/editor/assets/build-pips-BV-uwXlP.js +1 -0
  34. package/assets/editor/assets/build-visibility-DyML9SHt.js +1 -0
  35. package/assets/editor/assets/builders-DMHAOPEv.js +1 -0
  36. package/assets/editor/assets/{chart-Z4HQx-0h.js → chart-4iRduYdU.js} +4 -4
  37. package/assets/editor/assets/{chrome-layout-B8YmHznO.js → chrome-layout-BzPU9far.js} +1 -1
  38. package/assets/editor/assets/{code-panel-BfsykjSz.js → code-panel-koBUgEWp.js} +7 -7
  39. package/assets/editor/assets/command-palette-BR-_ChOL.js +1 -0
  40. package/assets/editor/assets/config-D8b1QyEk.js +1 -0
  41. package/assets/editor/assets/connector-labels-CrEgadsC.js +2 -0
  42. package/assets/editor/assets/copy-image-dialog-BzGP7Xw8.js +1 -0
  43. package/assets/editor/assets/{core-CBnmD9hT.js → core-CmsJyU_-.js} +1 -1
  44. package/assets/editor/assets/createReactComponent-C51FAx3B.js +1 -0
  45. package/assets/editor/assets/{diagram-fingerprint-CsqZK4xZ.js → diagram-fingerprint-WGQ5iVXx.js} +1 -1
  46. package/assets/editor/assets/dialog-DnXgEbpz.js +1 -0
  47. package/assets/editor/assets/{edit-BJ_kibk8.js → edit-C0sBxxsg.js} +1 -1
  48. package/assets/editor/assets/editor-BeufBV54.js +1 -0
  49. package/assets/editor/assets/{elk-api-DnfklSaw.js → elk-api-C4wlHVIw.js} +1 -1
  50. package/assets/editor/assets/{elk-worker-loader-CC-I9MmI.js → elk-worker-loader-CVBdN1je.js} +1 -1
  51. package/assets/editor/assets/{export-ChP0k5F5.js → export-Bce6ra0N.js} +1 -1
  52. package/assets/editor/assets/export-K2VWg76n.js +6 -0
  53. package/assets/editor/assets/export-dialog-x2n2a4KX.js +1 -0
  54. package/assets/editor/assets/flow-layer-ewaL7g2y.js +1 -0
  55. package/assets/editor/assets/flow-panel-BzXNGGke.js +1 -0
  56. package/assets/editor/assets/flow-stage-Ba_CAggI.js +1 -0
  57. package/assets/editor/assets/{flow-start-BKN48uke.js → flow-start-CpAvU-9P.js} +1 -1
  58. package/assets/editor/assets/{flows-GGbkNqs8.js → flows-Cj7AFMIA.js} +2 -2
  59. package/assets/editor/assets/frames-Cp1QD3LR.js +1 -0
  60. package/assets/editor/assets/icon-picker-Cg39IKNJ.js +1 -0
  61. package/assets/editor/assets/image-library-JQu_tb8P.js +1 -0
  62. package/assets/editor/assets/index-CBPPqsiR.js +24 -0
  63. package/assets/editor/assets/{index-e23lIFZB.css → index-DBrN0u0i.css} +1 -1
  64. package/assets/editor/assets/jsx-runtime-DKdBMi_L.js +1 -0
  65. package/assets/editor/assets/layout-offthread-mRHRulkS.js +18 -0
  66. package/assets/editor/assets/{layout.worker-BIE1_z0S.js → layout.worker-CekYkaxO.js} +2 -2
  67. package/assets/editor/assets/menu-B9BAk63v.js +1 -0
  68. package/assets/editor/assets/panel-controls-DWVXiNUZ.js +1 -0
  69. package/assets/editor/assets/{panel-shell-CG2aq4Ia.js → panel-shell-BnMOHgWM.js} +1 -1
  70. package/assets/editor/assets/{plan-jQm1jDpt.js → plan-CkgM52Yh.js} +1 -1
  71. package/assets/editor/assets/presentation-DJUO0t7I.js +1 -0
  72. package/assets/editor/assets/presenter-keys-Bs3LnmOa.js +1 -0
  73. package/assets/editor/assets/{jsx-runtime-2Zwg-L3c.js → react-lCSYwAWP.js} +1 -1
  74. package/assets/editor/assets/reflow-DaYiVkwp.js +1 -0
  75. package/assets/editor/assets/registry-rEGZW7Ab.js +1 -0
  76. package/assets/editor/assets/renderer-environment-D3n3hbug.js +1 -0
  77. package/assets/editor/assets/ride-overlay-Hx90v4ZK.js +1 -0
  78. package/assets/editor/assets/selection-overlay-primitives-BRp854AD.js +1 -0
  79. package/assets/editor/assets/shape-meta-COE2ATNh.js +1 -0
  80. package/assets/editor/assets/sign-in-dialog-tmQEB2bx.js +1 -0
  81. package/assets/editor/assets/slide-notes-dialog-BQBXpep6.js +1 -0
  82. package/assets/editor/assets/slides-D686obFO.js +15 -0
  83. package/assets/editor/assets/slides-panel-BEJCevJi.js +26 -0
  84. package/assets/editor/assets/text-breaks-DM4W6y5f.js +7 -0
  85. package/assets/editor/assets/{theme-palette-D1nbDFBC.js → theme-palette-Dl_G_VIJ.js} +1 -1
  86. package/assets/editor/assets/tidy-browser-dF3BON7J.js +1 -0
  87. package/assets/editor/assets/tidy-scope-BGG3ZXvZ.js +1 -0
  88. package/assets/editor/assets/toast-Czv_DJ-4.js +1 -0
  89. package/assets/editor/assets/{tool-catalog-CHq6TJ2q.js → tool-catalog-DXPhX2S1.js} +1 -1
  90. package/assets/editor/assets/tool-drawer-CWOX_njp.js +1 -0
  91. package/assets/editor/assets/tooltip-CyBz17g8.js +1 -0
  92. package/assets/editor/assets/{tree-BbSzMkPL.js → tree-KSgPjntC.js} +1 -1
  93. package/assets/editor/assets/upgrade-dialog-DhSZnDpx.js +1 -0
  94. package/assets/editor/assets/use-drag-reorder-ye8-kpyR.js +1 -0
  95. package/assets/editor/assets/use-export-command-sC9UHj3_.js +2 -0
  96. package/assets/editor/assets/use-grid-keyboard-nav-DhQKecO1.js +0 -0
  97. package/assets/editor/assets/use-icon-node-BxqH7H27.js +1 -0
  98. package/assets/editor/assets/use-key-held-094C3Mn3.js +1 -0
  99. package/assets/editor/assets/use-recent-list-DuazDypH.js +1 -0
  100. package/assets/editor/assets/useAnchoredPopupScrollLock-i8D5Dm1d.js +1 -0
  101. package/assets/editor/assets/useBaseUiId-D2RfU0uY.js +1 -0
  102. package/assets/editor/assets/useButton-CLQYGhRJ.js +1 -0
  103. package/assets/editor/assets/useControlled-BE8zdmih.js +1 -0
  104. package/assets/editor/assets/usePositioner-AtbrPc7w.js +1 -0
  105. package/assets/editor/assets/useScrollLock-CQpr0n6U.js +1 -0
  106. package/assets/editor/assets/useValueChanged-SqLfIDi5.js +1 -0
  107. package/assets/editor/assets/web-controls-CLE9zr7i.js +1 -0
  108. package/assets/editor/assets/web-embed-dialog-XUNelFFM.js +1 -0
  109. package/assets/editor/assets/web-html-dialog-BcAyzH5D.js +1 -0
  110. package/assets/editor/assets/web-shape-C941TGTy.js +1 -0
  111. package/assets/editor/assets/widget-source-CHujvUeA.js +1 -0
  112. package/assets/editor/index.html +73 -69
  113. package/dist/koboyo.js +257 -215
  114. package/package.json +5 -5
  115. package/skills/koboyo/SKILL.md +22 -2
  116. package/skills/koboyo/references/architecture.md +1 -1
  117. package/skills/koboyo/references/bpmn.md +1 -1
  118. package/skills/koboyo/references/chart.md +1 -1
  119. package/skills/koboyo/references/cycle.md +1 -1
  120. package/skills/koboyo/references/erd.md +1 -1
  121. package/skills/koboyo/references/flowchart.md +1 -1
  122. package/skills/koboyo/references/funnel.md +1 -1
  123. package/skills/koboyo/references/gantt.md +1 -1
  124. package/skills/koboyo/references/gitgraph.md +1 -1
  125. package/skills/koboyo/references/journey.md +1 -1
  126. package/skills/koboyo/references/matrix.md +1 -1
  127. package/skills/koboyo/references/mindmap.md +1 -1
  128. package/skills/koboyo/references/orgchart.md +1 -1
  129. package/skills/koboyo/references/pyramid.md +1 -1
  130. package/skills/koboyo/references/sankey.md +1 -1
  131. package/skills/koboyo/references/sequence.md +1 -1
  132. package/skills/koboyo/references/statemachine.md +1 -1
  133. package/skills/koboyo/references/timeline.md +1 -1
  134. package/skills/koboyo/references/venn.md +1 -1
  135. package/skills/koboyo/references/wireframe.md +1 -1
  136. package/assets/editor/assets/DialogDescription-ZtZCUsfy.js +0 -1
  137. package/assets/editor/assets/DialogRoot-mHGRFW9m.js +0 -1
  138. package/assets/editor/assets/DialogTitle-CFhr-gP9.js +0 -1
  139. package/assets/editor/assets/FloatingPortalLite-Bf0q6fmL.js +0 -1
  140. package/assets/editor/assets/IconChevronLeft-BR0iwdRI.js +0 -1
  141. package/assets/editor/assets/IconChevronRight-DBDnxPYT.js +0 -1
  142. package/assets/editor/assets/IconCornerDownRight-BerbioFY.js +0 -1
  143. package/assets/editor/assets/IconHelp-DKNacRqS.js +0 -2
  144. package/assets/editor/assets/IconLoader2-BQaF1LKo.js +0 -1
  145. package/assets/editor/assets/IconMinus-y4ejub-s.js +0 -1
  146. package/assets/editor/assets/IconPlus-BbmieIBT.js +0 -1
  147. package/assets/editor/assets/IconX-AlbPkO_g.js +0 -1
  148. package/assets/editor/assets/MenuSubmenuTrigger-CpN67g09.js +0 -1
  149. package/assets/editor/assets/PopoverPopup-BqGWd_uB.js +0 -1
  150. package/assets/editor/assets/billing-C-BNGM3Z.js +0 -1
  151. package/assets/editor/assets/build-pips-q_Fq10ov.js +0 -1
  152. package/assets/editor/assets/build-visibility-E1mHeDCW.js +0 -1
  153. package/assets/editor/assets/builders-DbF28yId.js +0 -1
  154. package/assets/editor/assets/command-palette-BjFnQHnz.js +0 -1
  155. package/assets/editor/assets/config-a_lz-57R.js +0 -1
  156. package/assets/editor/assets/connector-labels-vVnYQJRz.js +0 -2
  157. package/assets/editor/assets/copy-image-dialog-CCY_6fM4.js +0 -1
  158. package/assets/editor/assets/createReactComponent-9UsI5fmM.js +0 -1
  159. package/assets/editor/assets/dialog-B32krrce.js +0 -1
  160. package/assets/editor/assets/editor-B0tARd79.js +0 -1
  161. package/assets/editor/assets/export-DEFKKRRi.js +0 -6
  162. package/assets/editor/assets/export-dialog-DPg1uzX5.js +0 -1
  163. package/assets/editor/assets/flow-layer-B7mlx0G4.js +0 -1
  164. package/assets/editor/assets/flow-panel-DoK6VIJ4.js +0 -1
  165. package/assets/editor/assets/flow-stage-fiF5Nggn.js +0 -1
  166. package/assets/editor/assets/frames-CRP8oPP8.js +0 -1
  167. package/assets/editor/assets/icon-picker-NboB5Fvv.js +0 -1
  168. package/assets/editor/assets/image-library-Bb6bV6eK.js +0 -1
  169. package/assets/editor/assets/index-mhi0Z6gG.js +0 -24
  170. package/assets/editor/assets/layout-offthread-BwetpTFH.js +0 -18
  171. package/assets/editor/assets/menu-BPrc8Ara.js +0 -1
  172. package/assets/editor/assets/panel-controls-DYZ7QFT5.js +0 -1
  173. package/assets/editor/assets/presentation-BavfNtxp.js +0 -1
  174. package/assets/editor/assets/presenter-keys-DVQcBdy1.js +0 -1
  175. package/assets/editor/assets/reflow-Cv75wPSh.js +0 -1
  176. package/assets/editor/assets/registry-DCgwH8wI.js +0 -1
  177. package/assets/editor/assets/renderer-environment-DmWXvuT4.js +0 -1
  178. package/assets/editor/assets/ride-overlay-DhygYdx1.js +0 -1
  179. package/assets/editor/assets/selection-overlay-primitives-hWJ1xjF7.js +0 -1
  180. package/assets/editor/assets/shape-meta-BpwsiB82.js +0 -1
  181. package/assets/editor/assets/sign-in-dialog-DRooo5xw.js +0 -1
  182. package/assets/editor/assets/slide-notes-dialog-DLdTmd7_.js +0 -1
  183. package/assets/editor/assets/slides-D9bnXqtf.js +0 -15
  184. package/assets/editor/assets/slides-panel-hozTMSMk.js +0 -26
  185. package/assets/editor/assets/text-breaks-YU-ymaF9.js +0 -7
  186. package/assets/editor/assets/tidy-browser-BwodBnAH.js +0 -1
  187. package/assets/editor/assets/tidy-scope-BgBSUklT.js +0 -1
  188. package/assets/editor/assets/toast-Nu_fiCd9.js +0 -1
  189. package/assets/editor/assets/tool-drawer-DEEqsKSN.js +0 -1
  190. package/assets/editor/assets/tooltip-DgEojto1.js +0 -1
  191. package/assets/editor/assets/upgrade-dialog-DpZeaLDB.js +0 -1
  192. package/assets/editor/assets/use-drag-reorder-CTTvTwza.js +0 -1
  193. package/assets/editor/assets/use-export-command-CPc7qug1.js +0 -2
  194. package/assets/editor/assets/use-grid-keyboard-nav-B88Qw-cQ.js +0 -0
  195. package/assets/editor/assets/use-icon-node-DJZFjABX.js +0 -1
  196. package/assets/editor/assets/use-key-held-38H1v73f.js +0 -1
  197. package/assets/editor/assets/use-recent-list-BEG0iBIm.js +0 -1
  198. package/assets/editor/assets/useAnchoredPopupScrollLock-BGKchwpi.js +0 -1
  199. package/assets/editor/assets/useBaseUiId-C0Zm5sUV.js +0 -1
  200. package/assets/editor/assets/useButton-D3eS7fh5.js +0 -1
  201. package/assets/editor/assets/useControlled-C5xhvPXX.js +0 -1
  202. package/assets/editor/assets/usePositioner-DA3aR0-T.js +0 -1
  203. package/assets/editor/assets/useScrollLock-B7mQdXyv.js +0 -1
  204. package/assets/editor/assets/useValueChanged-p8z-93L4.js +0 -1
@@ -1,26 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{t as r}from"./tooltip-DgEojto1.js";import{D as i,E as a,T as o,a as s,g as c,h as l,l as u,m as d,n as f,o as p,p as m,r as h}from"./menu-BPrc8Ara.js";import{i as g}from"./config-a_lz-57R.js";import{a as ee,o as _}from"./editor-B0tARd79.js";import{_ as v,g as y,t as b}from"./reflow-Cv75wPSh.js";import{W as x}from"./style-BENGW2ZV.js";import{A as S,C as te,Kn as C,Sn as ne,an as w,c as re,d as ie,f as T,fn as E,i as D,l as O,n as ae,o as oe,p as se,r as ce,s as le,t as ue,u as k,vn as de,x as fe}from"./slides-D9bnXqtf.js";import{n as pe}from"./renderer-environment-DmWXvuT4.js";import{A as me,C as he,D as ge,E as _e,O as ve,S as ye,T as be,_ as xe,b as Se,k as Ce,m as we,v as A,x as Te,y as Ee}from"./panel-controls-DYZ7QFT5.js";import{t as j}from"./createReactComponent-9UsI5fmM.js";import{n as M,r as De,t as Oe}from"./IconTrash-DbN_RxB7.js";import{t as ke}from"./IconArrowLeft-DFk3Krim.js";import{n as N,t as Ae}from"./IconPlayerStopFilled-BUbX6ZO5.js";import{t as je}from"./IconChevronLeft-BR0iwdRI.js";import{t as Me}from"./IconChevronRight-DBDnxPYT.js";import{t as Ne}from"./IconCode-hd05zxU4.js";import{a as Pe,c as Fe,i as P,n as Ie,o as Le,r as Re,s as ze,t as Be}from"./build-visibility-E1mHeDCW.js";import{t as Ve}from"./IconPencil-C5Y-Y4dC.js";import{t as He}from"./IconPlus-BbmieIBT.js";import{n as Ue,r as We,t as Ge}from"./use-drag-reorder-CTTvTwza.js";import{t as Ke}from"./IconSparkles-WDcg8BA9.js";import{t as qe}from"./IconX-AlbPkO_g.js";import{t as Je}from"./IconPlayerPlayFilled-D4OODBX7.js";import{a as Ye,i as Xe,l as Ze,r as Qe,t as $e}from"./PopoverPopup-BqGWd_uB.js";import{t as et}from"./use-export-command-CPc7qug1.js";import{n as tt}from"./surface-Dke4SWpE.js";import{_ as nt,a as rt,c as it,d as at,f as ot,h as st,i as ct,l as lt,m as ut,n as dt,o as ft,p as pt,r as mt,t as ht,u as gt,v as _t,y as vt}from"./plan-jQm1jDpt.js";import{a as yt,c as bt,d as xt,f as St,i as Ct,l as wt,n as Tt,o as Et,r as Dt,s as Ot,t as kt,u as At}from"./edit-BJ_kibk8.js";import{a as jt,c as Mt}from"./chrome-C2RCq3SI.js";import{i as Nt,n as Pt,r as Ft,t as It}from"./DialogRoot-mHGRFW9m.js";import{n as Lt,t as Rt}from"./DialogTitle-CFhr-gP9.js";import{n as zt,t as Bt}from"./shape-meta-BpwsiB82.js";import{r as Vt}from"./chrome-layout-B8YmHznO.js";import{t as Ht}from"./panel-shell-CG2aq4Ia.js";import{A as F,C as I,D as L,E as R,O as z,S as B,T as Ut,_ as Wt,a as V,b as Gt,c as Kt,d as qt,f as H,g as Jt,h as Yt,i as Xt,k as U,l as W,m as G,n as Zt,o as K,p as Qt,r as q,s as J,t as $t,u as en,v as tn,w as Y,x as nn,y as rn}from"./builders-DbF28yId.js";import{n as an,t as on}from"./export-DEFKKRRi.js";var sn=j(`outline`,`grip-vertical`,`GripVertical`,[[`path`,{d:`M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}],[`path`,{d:`M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-5`}]]),cn=j(`outline`,`player-skip-back`,`PlayerSkipBack`,[[`path`,{d:`M20 5v14l-12 -7l12 -7`,key:`svg-0`}],[`path`,{d:`M4 5l0 14`,key:`svg-1`}]]),ln=j(`filled`,`pointer-filled`,`PointerFilled`,[[`path`,{d:`M3.039 4.277l3.904 13.563c.185 .837 .92 1.516 1.831 1.642l.17 .016a2.2 2.2 0 0 0 1.982 -1.006l.045 -.078l1.4 -2.072l4.05 4.05a2.067 2.067 0 0 0 2.924 0l1.047 -1.047c.388 -.388 .606 -.913 .606 -1.461l-.008 -.182a2.067 2.067 0 0 0 -.598 -1.28l-4.047 -4.048l2.103 -1.412c.726 -.385 1.18 -1.278 1.053 -2.189a2.2 2.2 0 0 0 -1.701 -1.845l-13.524 -3.89a1 1 0 0 0 -1.236 1.24z`,key:`svg-0`}]]),X=e(t(),1);function un(e,t){if(!t)return Bt(e[0]);let n=e.find(e=>zt(e).trim().length>0);return n?Bt(n):`Group of ${e.length}`}var Z={enter:`Entry`,emphasis:`Emphasis`,exit:`Exit`},Q=n();function dn(e){let{units:t,idleCount:n,variant:r=`filled`,hasBuild:i,onHover:a,onAdd:o,onSweep:s}=e,c=r===`primary`,l=()=>{c&&(d(!1),a(null))},[u,d]=(0,X.useState)(!1);return(0,Q.jsxs)(Ye,{open:u,onOpenChange:e=>{d(e),e||a(null)},children:[(0,Q.jsx)(xe,{"data-testid":`animate-add-open`,className:c?`mt-1 flex h-8 w-full cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-[var(--chrome-accent)] text-[12px] text-white transition-colors hover:bg-[var(--chrome-accent-hover)]`:`flex h-8 w-full cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-[var(--chrome-rest)] text-[12px] text-[var(--chrome-fg-900)] transition-colors hover:bg-[var(--chrome-hover)]`,children:c?`Choose what animates`:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(He,{size:13,stroke:1.75}),`Add animation`,n>0&&(0,Q.jsxs)(`span`,{"data-testid":`animate-add-count`,className:`text-[var(--chrome-fg-400)]`,children:[`· `,n,` not animated`]})]})}),(0,Q.jsx)(Xe,{children:(0,Q.jsx)(Qe,{side:`left`,align:`end`,sideOffset:8,collisionPadding:8,children:(0,Q.jsxs)($e,{"data-overlay":!0,"data-testid":`animate-add-list`,onPointerDown:e=>e.stopPropagation(),className:`flex max-h-[60vh] w-72 flex-col overflow-y-auto p-1.5 ${tt.popup}`,children:[n>0&&(0,Q.jsxs)(`button`,{type:`button`,"data-testid":`animate-one-by-one`,onClick:()=>{s(),d(!1),a(null)},className:`mb-1 flex h-7 shrink-0 cursor-pointer items-center justify-between gap-2 rounded-lg px-2 text-[11px] font-medium text-[var(--chrome-fg-900)] transition-colors hover:bg-[var(--chrome-hover)]`,children:[(0,Q.jsx)(`span`,{children:i?`Add the remaining ${n}`:`Animate all ${n}, one by one`}),(0,Q.jsx)(be,{size:12,stroke:2})]}),t.map(e=>{let t=e.shapes[0],n=new Set(ht(t).map(e=>e.kind));return(0,Q.jsxs)(`div`,{"data-testid":`animate-add-row`,onPointerEnter:()=>a(t.id),onPointerLeave:()=>a(null),className:`flex h-8 shrink-0 items-center gap-2 rounded-lg px-2 text-[12px] text-[var(--chrome-fg-700)] hover:bg-[var(--chrome-hover)]`,children:[e.groupId&&(0,Q.jsx)(ye,{size:12,stroke:1.75,className:`shrink-0 text-[var(--chrome-fg-400)]`}),(0,Q.jsx)(`span`,{className:`flex-1 truncate`,children:un(e.shapes,e.groupId)}),gt(t).map(t=>{let r=t!==`emphasis`&&n.has(t);return(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-add-${t}`,disabled:r,title:r?`Already has ${Z[t].toLowerCase()}`:`Add ${Z[t].toLowerCase()}`,onClick:()=>{o(e,t),l()},className:`h-5 shrink-0 cursor-pointer rounded px-1.5 text-[10px] font-medium transition-colors ${r?`cursor-default bg-[var(--chrome-active)] text-[var(--chrome-fg-400)]`:`text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] hover:bg-[var(--chrome-hover)] hover:text-[var(--chrome-fg-900)]`}`,children:Z[t]},t)})]},_t(e))})]})})})]})}var fn={click:``,with:`Plays with the step above`,after:`Plays on its own, as soon as the step above finishes`};function pn(e){let{unit:t,click:n,playing:r,start:a,canJoin:o,pointed:s,unseen:c,selected:l,viewMode:u,handlers:d,onSplit:f,onMerge:p,onSetEffect:m,onSetDelay:h,onSetDirection:g,onSetKind:ee,onSetStart:_,onPreviewEffect:v,onRemove:y}=e,b=t.items[0],x=b.shape,S=b.animation,te=ht(x).filter((e,t)=>t!==b.index).map(e=>e.kind),C=f??p;return(0,Q.jsxs)(`div`,{className:`group flex h-8 touch-none items-center gap-1.5 rounded-lg pl-1 pr-1 text-[12px] transition-colors ${r?`bg-[var(--chrome-accent)] text-white`:l?`bg-[var(--chrome-active)]`:s?`bg-[var(--chrome-hover)]`:`hover:bg-[var(--chrome-hover)]`}`,...d,children:[(0,Q.jsx)(sn,{size:13,stroke:1.75,className:`shrink-0 cursor-grab text-[var(--chrome-fg-300)]`}),(0,Q.jsx)(`span`,{className:`flex w-4 shrink-0 items-center justify-center text-[11px] tabular-nums ${r?`text-white/70`:`text-[var(--chrome-fg-500)]`}`,title:a===`click`?void 0:fn[a],children:a===`click`?n:``}),C&&!u?(0,Q.jsx)(`button`,{type:`button`,"data-testid":f?`animate-group-split`:`animate-group-merge`,title:f?`Animate this group's shapes one by one`:`Play these back as one group`,onPointerDown:e=>e.stopPropagation(),onClick:C,className:`flex h-5 w-4 shrink-0 cursor-pointer items-center justify-center rounded ${r?`text-white/70`:`text-[var(--chrome-fg-400)]`} hover:text-[var(--chrome-fg-900)]`,children:f?(0,Q.jsx)(Me,{size:12,stroke:2}):(0,Q.jsx)(i,{size:12,stroke:2})}):C&&(0,Q.jsx)(`span`,{className:`w-4 shrink-0`}),(0,Q.jsx)(`span`,{className:`flex-1 truncate ${r?``:`text-[var(--chrome-fg-900)]`}`,children:un(t.items.map(e=>e.shape),t.groupId)}),c&&(0,Q.jsx)(`span`,{"data-testid":`animate-row-unseen`,title:`This plays while the shape is off screen, so it will not be seen`,className:`shrink-0 ${r?`text-white/70`:`text-[var(--chrome-fg-400)]`}`,children:(0,Q.jsx)(Ce,{size:12,stroke:1.75})}),S.kind!==`enter`&&(0,Q.jsx)(`span`,{"data-testid":`animate-kind-${S.kind}`,className:`shrink-0 rounded px-1 text-[10px] uppercase tracking-wide ring-1 ${r?`text-white/70 ring-white/30`:`text-[var(--chrome-fg-500)] ring-[var(--chrome-ring)]`}`,children:S.kind}),(0,Q.jsx)(mn,{shape:x,kind:S.kind,kindsTaken:te,effect:S.effect,duration:S.duration,delay:S.delay,direction:S.direction,start:a,canJoin:o,disabled:u,onSetEffect:m,onSetDelay:h,onSetDirection:g,onSetKind:ee,onSetStart:_,onPreviewEffect:v}),!u&&(0,Q.jsx)(`button`,{"data-testid":`animate-remove`,title:`Remove from the build`,onPointerDown:e=>e.stopPropagation(),className:`flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-[var(--chrome-fg-400)] opacity-0 hover:bg-[var(--chrome-hover)] group-hover:opacity-100`,onClick:y,children:(0,Q.jsx)(qe,{size:12,stroke:2})})]})}function mn(e){let{shape:t,kind:n,kindsTaken:r,effect:i,duration:a,delay:o,direction:s,start:c,canJoin:l,disabled:u,onSetEffect:d,onSetDelay:f,onSetDirection:p,onSetKind:m,onSetStart:h,onPreviewEffect:g}=e,[ee,_]=(0,X.useState)(!1),b=v.filter(e=>de(t,e)&&E(e,n)),x=gt(t),S=Pe(i);return(0,Q.jsxs)(Ye,{open:ee,onOpenChange:_,children:[(0,Q.jsxs)(xe,{"data-testid":`animate-effect-chip`,disabled:u,onPointerDown:e=>e.stopPropagation(),className:`flex h-6 shrink-0 cursor-pointer items-center gap-0.5 rounded-md bg-[var(--chrome-rest)] pl-1.5 pr-1 text-[11px] text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] transition-colors hover:bg-[var(--chrome-hover)] data-[popup-open]:bg-[var(--chrome-active)] disabled:cursor-default`,children:[S.label,(0,Q.jsx)(Ze,{})]}),(0,Q.jsx)(Xe,{children:(0,Q.jsx)(Qe,{side:`left`,align:`center`,sideOffset:8,collisionPadding:8,children:(0,Q.jsxs)($e,{"data-overlay":!0,onPointerDown:e=>e.stopPropagation(),className:`w-64 p-2.5 ${tt.popup}`,children:[x.length>1&&(0,Q.jsx)(`div`,{className:`mb-2 flex items-center gap-1 border-b border-[var(--chrome-ring)] pb-2`,children:x.map(e=>{let t=e!==n&&e!==`emphasis`&&r.includes(e);return(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-kind-set-${e}`,"aria-pressed":e===n,disabled:t,title:t?`This shape already has an ${Z[e]} row`:void 0,onClick:()=>m(e),className:`flex h-7 flex-1 cursor-pointer items-center justify-center rounded-lg text-[11px] font-medium transition-colors disabled:cursor-default disabled:opacity-40 ${Mt(e===n)}`,children:Z[e]},e)})}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Effect`}),(0,Q.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:b.map(e=>(0,Q.jsxs)(`div`,{className:`flex h-7 items-center gap-1 rounded-lg pr-0.5 text-[11px] transition-colors ${Mt(e===i)}`,children:[(0,Q.jsxs)(`button`,{type:`button`,"data-testid":`animate-effect-${e}`,"aria-pressed":e===i,onClick:()=>d(e,a),className:`flex h-full flex-1 cursor-pointer items-center justify-between gap-1 rounded-l-lg pl-2 font-medium`,children:[Re[e].label,(0,Q.jsxs)(`span`,{className:`text-[10px] tabular-nums text-[var(--chrome-fg-400)]`,children:[Math.round(P(e,e===i?a:void 0,t)),`ms`]})]}),(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-effect-play-${e}`,"aria-label":`Preview ${Re[e].label} on the slide`,title:`Play this on the shape`,onClick:()=>g(e,e===i?a:void 0),className:`flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-[var(--chrome-fg-500)] transition-colors hover:bg-[var(--chrome-hover)] hover:text-[var(--chrome-fg-900)]`,children:(0,Q.jsx)(Je,{size:10})})]},e))})]}),ze(S)&&(0,Q.jsxs)(`div`,{className:`mt-1 space-y-1 border-t border-[var(--chrome-ring)] pt-2`,children:[(0,Q.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Direction`}),(0,Q.jsx)(`div`,{className:`flex items-center gap-1`,children:y.map(e=>{let t=(s??S.defaultDirection)===e;return(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-direction-${e}`,"aria-pressed":t,"aria-label":gn[e],title:gn[e],onClick:()=>p(e),className:`flex h-7 flex-1 cursor-pointer items-center justify-center rounded-lg text-[11px] font-medium transition-colors ${Mt(t)}`,children:(0,Q.jsx)(_n,{direction:e})},e)})})]}),(0,Q.jsxs)(`div`,{className:`mt-1 space-y-1 border-t border-[var(--chrome-ring)] pt-2`,children:[(0,Q.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Start`}),(0,Q.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:vn.map(e=>(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-start-${e.mode}`,"aria-pressed":c===e.mode,disabled:e.mode===`with`&&!l,onClick:()=>h(e.mode),className:`flex h-7 items-center rounded-lg px-2 text-[11px] font-medium transition-colors disabled:cursor-default disabled:opacity-40 ${Mt(c===e.mode)}`,children:e.label},e.mode))})]}),(0,Q.jsxs)(`div`,{className:`mt-1 flex gap-2 border-t border-[var(--chrome-ring)] pt-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,Q.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Duration`}),(0,Q.jsx)(we,{label:`duration in milliseconds`,testId:`animate-duration`,value:Math.round(P(i,a,t)),min:80,max:4e3,step:40,fullWidth:!0,onChange:e=>d(i,e)})]}),c!==`click`&&(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,Q.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Delay`}),(0,Q.jsx)(we,{label:`delay in milliseconds`,testId:`animate-delay`,value:Math.round(Math.max(0,o??0)),min:0,max:1e4,step:100,fullWidth:!0,onChange:f})]})]})]})})})]})}var hn={up:M,down:De,left:ke,right:N},gn={up:`Upward`,down:`Downward`,left:`Leftward`,right:`Rightward`};function _n(e){let{direction:t}=e,n=hn[t];return(0,Q.jsx)(n,{size:13,stroke:2})}var vn=[{mode:`click`,label:`On click`},{mode:`with`,label:`With previous`},{mode:`after`,label:`After previous`}],yn=`flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-[var(--chrome-fg-600)] transition-colors hover:bg-[var(--chrome-hover)] disabled:cursor-default disabled:text-[var(--chrome-fg-300)] disabled:hover:bg-transparent`,bn=4,xn=380,Sn=200;function Cn(e){let{figure:t,index:n,total:r,onBack:i,onGoToSlide:a,onFocusSlide:o,viewMode:s}=e,{store:c,history:l}=ee(),u=_(e=>e.shapes),d=_(e=>e.selectedIds),f=_(e=>e.hoveredId),p=Ie(),m=(0,X.useMemo)(()=>ot(u,t),[u,t]),h=(0,X.useMemo)(()=>nt(u,t),[u,t]),g=(0,X.useMemo)(()=>dt(m,h),[m,h]),v=(0,X.useMemo)(()=>ut(u,t,h),[u,t,h]),y=(0,X.useMemo)(()=>ct(u,t,h),[u,t,h]),b=(0,X.useMemo)(()=>vt(m),[m]),x=(0,X.useMemo)(()=>y.filter(e=>e.shapes.some(e=>d.has(e.id))),[y,d]),te=(0,X.useMemo)(()=>{let e=new Map;g.forEach((t,n)=>{let r=t.groupId?void 0:t.items[0].shape.groupId;r&&!e.has(r)&&e.set(r,n)});let t=new Map;for(let[n,r]of e)g.filter(e=>e.items[0].shape.groupId===n).length>1&&t.set(r,n);return t},[g]),C=(0,X.useMemo)(()=>{let e=0;return g.map((t,n)=>(n>0&&!t.withPrevious&&(e+=1),e))},[g]),ne=(0,X.useMemo)(()=>mt(m),[m]);function re(e,t){T(Tt(m,[e],t===`enter`?st(e.shapes[0]):void 0,t))}function ie(){T(k?Tt(m,v):kt(u,t))}function T(e){e.length!==0&&(l.beginTransaction(),c.getState().replaceMany(e),l.endTransaction())}(0,X.useEffect)(()=>{o(t)},[t.id]);let[E,D]=(0,X.useState)(null);(0,X.useLayoutEffect)(()=>{if(E===null||E<0)return;let e=m[E];e&&p.play(e,w(t))},[E,m,t,p]),(0,X.useEffect)(()=>{if(E===null)return;let e=E>=0?m[E]:null,t=m[E+1]?.afterPrevious?0:xn,n=(e?Le(e):0)+t,r=setTimeout(()=>{D(e=>e===null||e+1>=m.length?null:e+1)},n);return()=>clearTimeout(r)},[E,m]);let[O,ae]=(0,X.useState)(null);function oe(e,t,n){D(null),p.cancel(),ae({items:e.map(e=>({shape:e.shape,index:e.index,start:0,row:e.row,animation:{...e.animation,step:0,effect:rt(e.shape,t,e.animation.kind),duration:n,delay:void 0}})),armed:e[0]?.animation.kind===`exit`})}(0,X.useEffect)(()=>{if(!O||O.armed)return;let e=setTimeout(()=>ae(e=>e&&!e.armed?{...e,armed:!0}:e),Sn);return()=>clearTimeout(e)},[O]),(0,X.useLayoutEffect)(()=>{if(!O?.armed)return;let e=O.items.some(e=>e.animation.kind===`exit`);p.play({index:0,items:O.items,afterPrevious:!1},w(t)).then(()=>{e&&window.setTimeout(()=>p.cancel(),Sn)})},[O,t,p]),(0,X.useEffect)(()=>{D(null),ae(null)},[m]);function se(){if(ae(null),E!==null){p.cancel(),D(null);return}m.length!==0&&(o(t),p.cancel(),D(-1))}let ce=(0,X.useMemo)(()=>{let e=new Set;if(!f)return e;e.add(f);let t=S(u,f);return t?.groupId&&h.has(t.groupId)&&e.add(t.groupId),e},[f,u,h]);function le(e){return{onPointerEnter:()=>c.getState().setHoveredId(e),onPointerLeave:()=>c.getState().setHoveredId(null)}}(0,X.useEffect)(()=>()=>c.getState().setHoveredId(null),[c]);let ue=Ge({count:g.length,gap:bn,disabled:s,onReorder:(e,t)=>T(Et(g,e,t)),onPress:e=>{let t=g[e];t&&c.getState().setSelectedIds(new Set(t.items.map(e=>e.shape.id)))}}),k=g.length>0;return(0,Q.jsxs)(Q.Fragment,{children:[E!==null&&(0,Q.jsx)(Be,{pending:it(m,E)}),O&&!O.armed&&(0,Q.jsx)(Be,{pending:new Set(O.items.map(e=>e.shape.id))}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 bg-[var(--chrome-rest)] px-3 pb-3 pt-2.5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(be,{size:15,stroke:1.75,className:`shrink-0 text-[var(--chrome-fg-500)]`}),(0,Q.jsx)(`span`,{className:`flex-1 truncate text-[13px] font-medium text-[var(--chrome-fg-900)]`,children:`Animate`}),(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-done`,title:`Back to the deck (Esc)`,onClick:i,className:`flex h-7 shrink-0 cursor-pointer items-center rounded-lg bg-[var(--chrome-accent)] px-3 text-[12px] text-white transition-colors hover:bg-[var(--chrome-accent-hover)]`,children:`Done`})]}),(0,Q.jsxs)(`div`,{className:`flex h-7 items-center justify-between rounded-lg bg-[var(--chrome-popup)] px-0.5 ring-1 ring-[var(--chrome-ring)]`,children:[(0,Q.jsx)(`button`,{className:yn,"data-testid":`animate-prev-slide`,"aria-label":`Previous slide`,disabled:n===0,onClick:()=>a(n-1),children:(0,Q.jsx)(je,{size:14,stroke:1.75})}),(0,Q.jsxs)(`span`,{className:`truncate text-[12px] tabular-nums text-[var(--chrome-fg-700)]`,children:[`Slide `,n+1,` of `,r]}),(0,Q.jsx)(`button`,{className:yn,"data-testid":`animate-next-slide`,"aria-label":`Next slide`,disabled:n>=r-1,onClick:()=>a(n+1),children:(0,Q.jsx)(Me,{size:14,stroke:1.75})})]})]}),!s&&x.length>0&&(0,Q.jsxs)(`div`,{"data-testid":`animate-selection`,className:`mx-3 mb-2 flex h-8 shrink-0 items-center gap-2 rounded-[10px] bg-[var(--chrome-rest)] px-2.5`,children:[(0,Q.jsx)(ln,{size:12,className:`shrink-0 text-[var(--chrome-fg-400)]`}),(0,Q.jsx)(`span`,{className:`flex-1 truncate text-[11.5px] text-[var(--chrome-fg-900)]`,children:x.length===1?un(x[0].shapes,x[0].groupId):`${x.length} shapes`}),Tn(x).map(e=>(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-selection-${e}`,title:`Add ${Z[e].toLowerCase()}`,onClick:()=>{for(let t of x)re(t,e)},className:`h-5 shrink-0 cursor-pointer rounded px-1.5 text-[10px] font-medium text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] transition-colors hover:bg-[var(--chrome-hover)] hover:text-[var(--chrome-fg-900)]`,children:Z[e]},e))]}),(0,Q.jsxs)(`div`,{ref:ue.listRef,"data-testid":`animate-list`,className:`flex flex-1 flex-col overflow-y-auto px-3 pb-3 pt-2`,children:[!k&&(0,Q.jsx)(`div`,{className:`px-1 pt-4`,children:y.length===0?(0,Q.jsx)(`div`,{className:`text-balance px-1 py-6 text-center text-[11px] leading-relaxed text-[var(--chrome-fg-400)]`,children:`Nothing on this slide to animate yet.`}):(0,Q.jsxs)(`div`,{"data-testid":`animate-empty`,"data-count":y.length,className:`flex flex-col items-center gap-2.5 rounded-xl p-4 text-center`,children:[(0,Q.jsx)(`span`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-[var(--chrome-hover)] text-[var(--chrome-fg-600)]`,children:(0,Q.jsx)(be,{size:17,stroke:1.75})}),(0,Q.jsx)(`span`,{className:`text-[12.5px] font-medium text-[var(--chrome-fg-900)]`,children:`Reveal this slide in steps`}),(0,Q.jsx)(`span`,{className:`text-balance text-[11px] leading-relaxed text-[var(--chrome-fg-500)]`,children:wn(y.length)}),!s&&(0,Q.jsx)(dn,{variant:`primary`,units:y,idleCount:v.length,hasBuild:k,onHover:e=>c.getState().setHoveredId(e),onAdd:re,onSweep:ie})]})}),k&&(0,Q.jsx)(`div`,{className:`flex flex-col gap-1`,children:g.map((e,t)=>{let n=pt(e);return(0,Q.jsx)(`div`,{ref:ue.setItemRef(t),"data-testid":`animate-row-${t}`,"data-start":n,className:`shrink-0 ${t>0&&n===`click`?`border-t border-[var(--chrome-ring)] pt-1`:t>0&&n===`after`?`border-t border-dashed border-[var(--chrome-ring)] pt-1`:``}`,style:ue.rowStyle(t),children:(0,Q.jsx)(pn,{unit:e,click:ne[C[t]],playing:E!==null&&C[t]===E,start:n,canJoin:t>0,pointed:ce.has(ft(e)),unseen:b.has(lt(e.items[0])),selected:e.items.every(e=>d.has(e.shape.id)),viewMode:s,handlers:{...ue.rowHandlers(t),...le(e.items[0].shape.id)},onSplit:e.groupId?()=>T(St(g,e.groupId)):null,onMerge:te.has(t)?()=>T(yt(g,te.get(t))):null,onSetEffect:(t,n)=>T(wt(e.items,t,n)),onSetDelay:t=>T(Ot(e.items,t)),onSetKind:t=>T(At(e.items,t)),onSetDirection:t=>T(bt(e.items,t)),onPreviewEffect:(t,n)=>oe(e.items,t,n),onSetStart:t=>T(xt(g,ft(e),t)),onRemove:()=>T(Dt(g,ft(e)))})},ft(e))})}),!s&&k&&(0,Q.jsx)(`div`,{className:`pt-3`,children:(0,Q.jsx)(dn,{units:y,idleCount:v.length,hasBuild:k,onHover:e=>c.getState().setHoveredId(e),onSweep:ie,onAdd:re})})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-[var(--chrome-ring)] p-3`,children:[(0,Q.jsx)(`button`,{"data-testid":`animate-play`,disabled:!k,className:`flex h-9 w-full items-center justify-center gap-2 rounded-lg bg-[var(--chrome-accent)] text-[13px] text-white transition-colors hover:bg-[var(--chrome-accent-hover)] disabled:bg-[var(--chrome-hover)] disabled:text-[var(--chrome-fg-400)]`,onClick:se,children:E===null?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Je,{size:13}),`Play`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ae,{size:13}),`Stop`]})}),!s&&k&&(0,Q.jsx)(`button`,{"data-testid":`animate-clear`,className:`mx-auto flex h-6 cursor-pointer items-center rounded px-2 text-[11px] text-[var(--chrome-fg-500)] transition-colors hover:text-[var(--chrome-fg-900)]`,onClick:()=>T(Ct(m)),children:`Clear animations`})]})]})}function wn(e){return e===1?`One thing shows with the slide. Give it a click of its own.`:`${e} things show at once right now. Give each one its own click.`}function Tn(e){let t=e.flatMap(e=>e.shapes);return gt(t[0]).filter(e=>e===`emphasis`||t.some(t=>!ht(t).some(t=>t.kind===e)))}var En=`flex h-9 items-center justify-center bg-[var(--chrome-accent)] text-[13px] text-white transition-colors hover:bg-[var(--chrome-accent-hover)] disabled:bg-[var(--chrome-hover)] disabled:text-[var(--chrome-fg-400)] data-[popup-open]:bg-[var(--chrome-accent-hover)]`;function Dn(e){let{disabled:t,onPresent:n}=e;return(0,Q.jsxs)(`div`,{className:`flex gap-px`,children:[(0,Q.jsxs)(`button`,{type:`button`,"data-testid":`slides-present`,disabled:t,onClick:()=>n(`current`),className:`${En} flex-1 gap-2 rounded-l-lg`,children:[(0,Q.jsx)(Je,{size:14}),`Start presentation`]}),(0,Q.jsxs)(u,{children:[(0,Q.jsx)(p,{disabled:t,render:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Presentation start options`,"data-testid":`slides-present-options`,className:`${En} w-9 rounded-r-lg`,children:(0,Q.jsx)(i,{size:14,stroke:2})})}),(0,Q.jsx)(d,{children:(0,Q.jsx)(m,{side:`top`,align:`end`,sideOffset:6,className:`z-50 outline-none`,children:(0,Q.jsxs)(h,{"data-overlay":!0,className:`min-w-[185px] p-1`,children:[(0,Q.jsxs)(f,{"data-testid":`slides-present-beginning`,onClick:()=>n(`beginning`),children:[(0,Q.jsx)(cn,{size:15,stroke:1.75,className:`text-[var(--chrome-fg-400)]`}),`From beginning`]}),(0,Q.jsxs)(f,{"data-testid":`slides-present-current`,onClick:()=>n(`current`),children:[(0,Q.jsx)(o,{size:15,stroke:1.75,className:`text-[var(--chrome-fg-400)]`}),`From current slide`]})]})})})]})]})}var On=`flex cursor-default select-none items-center gap-2 rounded-lg px-2 py-1.5 text-[13px] text-[var(--chrome-fg-700)] outline-none data-[highlighted]:bg-[var(--chrome-hover)]`,kn=`min-w-[185px] p-1 outline-none ${tt.popup}`;function An(e){let{index:t,prefix:n,actions:r,skipped:i,Item:a,Separator:s}=e;function c(e,r,i,o,s=!1){return(0,Q.jsxs)(a,{className:s?`${On} text-red-600 data-[highlighted]:bg-red-50`:On,"data-testid":`${n}-${e}-${t}`,onClick:o,children:[(0,Q.jsx)(`span`,{className:s?`text-red-400`:`text-[var(--chrome-fg-400)]`,children:r}),(0,Q.jsx)(`span`,{children:i})]})}let l=(0,Q.jsx)(s,{className:`mx-1 my-1 h-px bg-[var(--chrome-divider)]`});return(0,Q.jsxs)(Q.Fragment,{children:[c(`present`,(0,Q.jsx)(o,{size:15,stroke:1.75}),`Present from here`,r.onPresent),l,r.onExportPng?c(`export-png`,(0,Q.jsx)(he,{size:15,stroke:1.75}),`Export slide as PNG`,r.onExportPng):null,r.onExportSvg?c(`export-svg`,(0,Q.jsx)(ge,{size:15,stroke:1.75}),`Export slide as SVG`,r.onExportSvg):null,r.onEmbed?c(`embed`,(0,Q.jsx)(Ne,{size:15,stroke:1.75}),`Embed slide…`,r.onEmbed):null,l,c(`duplicate`,(0,Q.jsx)(me,{size:15,stroke:1.75}),`Duplicate slide`,r.onDuplicate),c(`rename`,(0,Q.jsx)(Ve,{size:15,stroke:1.75}),`Rename slide`,r.onRename),c(`notes`,(0,Q.jsx)(Fe,{size:15,stroke:1.75}),`Speaker notes`,r.onEditNotes),i?c(`skip`,(0,Q.jsx)(ve,{size:15,stroke:1.75}),`Unskip slide`,r.onToggleSkip):c(`skip`,(0,Q.jsx)(Ce,{size:15,stroke:1.75}),`Skip slide`,r.onToggleSkip),c(`add-above`,(0,Q.jsx)(Ue,{size:15,stroke:1.75}),`Add slide above`,r.onAddAbove),c(`add-below`,(0,Q.jsx)(We,{size:15,stroke:1.75}),`Add slide below`,r.onAddBelow),l,c(`delete`,(0,Q.jsx)(Oe,{size:15,stroke:1.75}),`Remove slide`,r.onDelete,!0)]})}function jn(e){let{index:t,actions:n,skipped:r,disabled:i}=e;return i?null:(0,Q.jsxs)(u,{children:[(0,Q.jsx)(p,{render:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Slide options`,"data-testid":`slide-menu-${t}`,className:`absolute right-1.5 top-1.5 flex h-6 w-6 items-center justify-center rounded-md bg-[var(--chrome-surface)] text-[var(--chrome-fg-600)] opacity-0 ring-1 ring-[var(--chrome-ring)] transition-opacity hover:bg-[var(--chrome-hover)] focus-visible:opacity-100 group-hover:opacity-100 data-[popup-open]:opacity-100`,onPointerDown:e=>e.stopPropagation(),children:(0,Q.jsx)(a,{size:13,stroke:1.75})})}),(0,Q.jsx)(d,{children:(0,Q.jsx)(m,{side:`left`,align:`start`,sideOffset:6,className:`z-50 outline-none`,children:(0,Q.jsx)(l,{"data-overlay":!0,className:kn,children:(0,Q.jsx)(An,{index:t,prefix:`slide-menu`,actions:n,skipped:r,Item:c,Separator:s})})})})]})}function Mn(e){let{index:t,actions:n,skipped:r,children:i,disabled:a}=e,o=_(e=>e.coarsePointer);return a||o?(0,Q.jsx)(Q.Fragment,{children:i}):(0,Q.jsxs)(Ee,{children:[(0,Q.jsx)(A,{render:(0,Q.jsx)(`div`,{style:{display:`contents`}}),children:i}),(0,Q.jsx)(d,{children:(0,Q.jsx)(m,{className:`z-50 outline-none`,children:(0,Q.jsx)(l,{"data-overlay":!0,"data-testid":`slide-ctx-${t}`,className:kn,children:(0,Q.jsx)(An,{index:t,prefix:`slide-ctx`,actions:n,skipped:r,Item:c,Separator:s})})})})]})}function Nn(e){let t=L(e),n=18*t.unit,r=[{x:433,fill:W.red},{x:471,fill:W.yellow},{x:509,fill:W.blue}].map(({x:e,fill:r})=>{let i=t.point(e,158);return R({x:i.x,y:i.y,width:n,height:n},r,{kind:`ellipse`,fillStyle:`bold`})}),i=(e,n,r,i)=>R(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[...r,i(812,100,24,W.yellow),i(128,416,16,W.pink),F(t.rect(120,204,720,90),`Presentation title`,t.font(56)),F(t.rect(180,306,600,40),`A short subtitle that sets the scene`,t.font(24),{color:q}),z([t.point(432,436),t.point(528,436)],{color:H,strokeWidth:4}),F(t.rect(280,452,400,30),`Your name · Occasion · Date`,t.font(16),{color:q})]}function Pn(e){let t=L(e);return[R(t.rect(110,145,230,230),W.yellow,{kind:`ellipse`,label:`01`,fontSize:t.font(80)}),F(t.rect(420,190,460,64),`Section title`,t.font(48),{align:`left`}),z([t.point(422,268),t.point(640,268)],{color:J,strokeWidth:4}),F(t.rect(420,292,460,36),`A one-line summary of this chapter`,t.font(20),{align:`left`,color:q})]}function Fn(e){let t=L(e);return[F(t.rect(330,148,300,26),`THE BIG IDEA`,t.font(15),{letterSpacing:.3,color:q}),F(t.rect(120,192,720,156),`Say the one thing that matters.`,t.font(64)),z([t.point(390,374),t.point(570,374)],{color:H,strokeWidth:5})]}function In(e){let t=L(e),n=(e,n,r,i)=>R(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[Yt(t),n(150,106,26,W.yellow),n(806,92,18,W.blue),n(730,414,20,W.yellow),n(208,408,14,W.pink),z([t.point(434,198),t.point(526,198)],{color:H,strokeWidth:4}),Jt(t.rect(120,216,720,90),`A title that glows in the dark`,t.font(52)),Jt(t.rect(240,322,480,40),`A quieter cover for serious rooms`,t.font(20),{color:Xt})]}function Ln(e){let t=L(e);return[R(t.rect(0,0,424,qt.height),W.gray,{dash:`none`,label:`Drop an image
2
- or paste a screenshot`,fontSize:t.font(18),labelColor:q}),F(t.rect(486,168,300,26),`A DECK ABOUT`,t.font(14),{align:`left`,letterSpacing:.3,color:q}),F(t.rect(486,202,408,140),`The thing you came to hear`,t.font(44),{align:`left`,valign:`top`,lineHeight:1.25}),z([t.point(488,360),t.point(600,360)],{color:H,strokeWidth:4}),F(t.rect(486,384,408,30),`Your name · Occasion · Date`,t.font(16),{align:`left`,color:q})]}function Rn(e){let t=L(e),n=W.green,r=(e,n)=>R(t.rect(e,26,15,15),n,{kind:`ellipse`,fillStyle:`bold`,dash:`none`});return[Yt(t),r(30,W.red),r(56,W.yellow),r(82,W.green),nn(t.point(80,130),`~/talks $ present --topic`,t.font(20),n,{fontFamily:K}),nn(t.point(80,176),`"Your big idea"`,t.font(50),Kt,{fontFamily:K}),R(t.rect(80,268,20,42),Kt,{dash:`none`}),nn(t.point(80,356),`loading slides… ████████░░ 80%`,t.font(17),n,{fontFamily:K,opacity:.8}),nn(t.point(80,458),`# your name · today`,t.font(15),Kt,{fontFamily:K,opacity:.5})]}function zn(e){let t=L(e);return[...I(t,`Slide title`),F(t.rect(72,156,816,312),ne([`The first key point`,`A second point, with a little more detail to back it up`,`The third point that drives it home`]),t.font(24),{align:`left`,valign:`top`,lineHeight:2,color:V})]}function Bn(e){let t=L(e),n=[{fill:W.blue,text:`Where we are today`},{fill:W.green,text:`What we learned`},{fill:W.yellow,text:`The plan from here`},{fill:W.pink,text:`Questions and next steps`}].flatMap(({fill:e,text:n},r)=>{let i=160+r*78;return B([R(t.rect(72,i,48,48),e,{kind:`ellipse`,label:String(r+1),fontSize:t.font(20)}),F(t.rect(140,i,720,48),n,t.font(24),{align:`left`})])});return[...I(t,`Agenda`),...n]}function Vn(e){let t=L(e);return[...I(t,`Slide title`),z([t.point(480,160),t.point(480,468)],{strokeWidth:1.5,dash:`dashed`,opacity:.35}),F(t.rect(72,156,380,40),`First column`,t.font(24),{align:`left`}),z([t.point(74,204),t.point(150,204)],{color:`#1971c2`,strokeWidth:3}),F(t.rect(72,216,380,244),`Use this side for the first idea, option or before-state.`,t.font(20),{align:`left`,valign:`top`,color:V}),F(t.rect(508,156,380,40),`Second column`,t.font(24),{align:`left`}),z([t.point(510,204),t.point(586,204)],{color:`#2f9e44`,strokeWidth:3}),F(t.rect(508,216,380,244),`And this side for the second idea, option or after-state.`,t.font(20),{align:`left`,valign:`top`,color:V})]}function Hn(e){let t=L(e);return[F(t.rect(72,48,816,50),`Which way do we go?`,t.font(36)),...B([R(t.rect(72,132,384,344),W.green,{fillStyle:`outline`}),R(t.rect(404,152,32,32),W.green,{kind:`checkbox`,fillStyle:`bold`}),F(t.rect(96,156,336,40),`Option A`,t.font(28)),F(t.rect(108,212,312,240),ne([`Cheaper to build`,`Ships this quarter`,`Less flexible later`]),t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:V})]),...B([R(t.rect(504,132,384,344),W.gray,{fillStyle:`outline`}),F(t.rect(528,156,336,40),`Option B`,t.font(28)),F(t.rect(540,212,312,240),ne([`More upfront work`,`Ships next quarter`,`Grows with us`]),t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:V})]),R(t.rect(450,274,60,60),W.yellow,{kind:`ellipse`,fillStyle:`bold`,label:`vs`,fontSize:t.font(22)})]}function Un(e){let t=L(e);return[...I(t,`Before and after`),...B([R(t.rect(72,140,384,330),W.gray),F(t.rect(96,162,344,36),`Before`,t.font(26),{align:`left`}),F(t.rect(96,214,344,230),`✗ Manual deploys at midnight
3
- ✗ Surprise regressions
4
- ✗ Knowledge in one head`,t.font(19),{align:`left`,valign:`top`,lineHeight:2,color:V})]),...B([R(t.rect(504,140,384,330),W.green),F(t.rect(528,162,344,36),`After`,t.font(26),{align:`left`}),F(t.rect(528,214,344,230),`✓ Ship on every merge
5
- ✓ Tests catch it first
6
- ✓ Docs that stay current`,t.font(19),{align:`left`,valign:`top`,lineHeight:2,color:V})]),Gt(t.point(462,305),t.point(498,305),5)]}function Wn(e){let t=L(e),n=[{x:72,fill:W.blue,value:`42%`,caption:`more signups`},{x:360,fill:W.teal,value:`3×`,caption:`faster builds`},{x:648,fill:W.purple,value:`12k`,caption:`happy users`}].flatMap(({x:e,fill:n,value:r,caption:i})=>B([R(t.rect(e,150,240,260),n,{fillStyle:`outline`,label:r,fontSize:t.font(56)}),F(t.rect(e+20,330,200,56),i,t.font(18),{color:q})]));return[...I(t,`The quarter in numbers`),...n]}function Gn(e){let t=L(e),n=[{color:J,text:`The first thing to remember`},{color:`#1971c2`,text:`The second, said plainly`},{color:`#2f9e44`,text:`The third, end on an action`}].flatMap(({color:e,text:n},r)=>{let i=156+r*104,a=B([nn(t.point(84,i+14),String(r+1),t.font(44),e),F(t.rect(160,i,720,84),n,t.font(26),{align:`left`})]);return r>0&&a.push(z([t.point(84,i-10),t.point(876,i-10)],{strokeWidth:1.5,opacity:.15})),a});return[...I(t,`Three takeaways`),...n]}function Kn(e){let t=L(e);return[...I(t,`Do and don't`),...B([R(t.rect(72,150,400,310),W.green,{fillStyle:`outline`}),R(t.rect(96,170,36,36),W.green,{kind:`checkbox`,fillStyle:`bold`}),F(t.rect(148,170,300,36),`Do`,t.font(28),{align:`left`}),F(t.rect(96,222,352,220),`Keep slides to one idea
7
- Use big readable text
8
- Practice out loud`,t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:V})]),...B([R(t.rect(488,150,400,310),W.red,{fillStyle:`outline`}),R(t.rect(512,170,36,36),W.red,{kind:`crossbox`,fillStyle:`bold`}),F(t.rect(564,170,300,36),`Don't`,t.font(28),{align:`left`}),F(t.rect(512,222,352,220),`Cram every detail in
9
- Read off the slide
10
- Run past the time box`,t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:V})])]}function qn(e){let t=L(e),n=[{icon:`zap`,fill:W.yellow,name:`Fast`,desc:`Blank canvas to first stroke in a second`},{icon:`users`,fill:W.blue,name:`Together`,desc:`Share a link, draw with the whole room`},{icon:`share-2`,fill:W.green,name:`Portable`,desc:`PNG, SVG and PDF out of the box`},{icon:`undo-2`,fill:W.pink,name:`Forgiving`,desc:`Undo everything, nothing is precious`}].flatMap(({icon:e,fill:n,name:r,desc:i},a)=>{let o=162+a*78,s=52*t.unit,c=t.point(72,o),l=26*t.unit;return B([R({x:c.x,y:c.y,width:s,height:s},n,{kind:`ellipse`,dash:`none`}),Y({x:c.x+(s-l)/2,y:c.y+(s-l)/2},l,e,{color:Zt}),F(t.rect(148,o+2,210,48),r,t.font(22),{align:`left`}),F(t.rect(366,o+2,522,48),i,t.font(17),{align:`left`,color:V})])});return[...I(t,`What you get`),...n]}function Jn(e){let t=L(e),n=[{icon:`gauge`,title:`Instant`,body:`Boards open in under a second, however big`},{icon:`users`,title:`Multiplayer`,body:`Cursors, comments and a shared laser pointer`},{icon:`sparkles`,title:`AI drafts`,body:`Describe a diagram, get shapes you can edit`},{icon:`shapes`,title:`Every shape`,body:`Flowcharts, mockups, tables, charts, slides`},{icon:`lock`,title:`Private`,body:`Nothing leaves your workspace unless you share`},{icon:`file-down`,title:`Portable`,body:`PNG, SVG, PDF and a plain file you own`}].flatMap(({icon:e,title:n,body:r},i)=>{let a=72+i%3*280,o=168+Math.floor(i/3)*152,s=34*t.unit,c=t.point(a,o);return B([Y({x:c.x,y:c.y},s,e,{color:J}),F(t.rect(a+46,o-4,200,40),n,t.font(21),{align:`left`}),F(t.rect(a,o+48,252,76),r,t.font(15),{align:`left`,valign:`top`,lineHeight:1.6,color:V})])});return[...I(t,`Why teams switch`),...n]}function Yn(e){let t=L(e),n=(e,n,r,i)=>R(t.rect(e-126,n-126,252,252),r,{kind:`ellipse`,opacity:.6,color:i,strokeWidth:2}),r=[{cx:300,cy:262,fill:W.blue,ink:$t.blue,name:`What users beg for`},{cx:432,cy:262,fill:W.yellow,ink:$t.yellow,name:`What we're best at`},{cx:366,cy:376,fill:W.teal,ink:$t.teal,name:`What pays the bills`}],i=r.flatMap(({fill:e,name:n},r)=>B([R(t.rect(660,214+r*66,20,20),e,{kind:`ellipse`,fillStyle:`bold`}),F(t.rect(694,208+r*66,200,32),n,t.font(17),{align:`left`})]));return[...I(t,`Where the three meet`),...r.map(({cx:e,cy:t,fill:r,ink:i})=>n(e,t,r,i)),F(t.rect(288,292,156,40),`Do this`,t.font(20)),...i]}function Xn(e){let t=L(e),n=B([R(t.rect(72,140,392,300),W.blue,{fillStyle:`outline`}),F(t.rect(96,164,344,96),`38%`,t.font(72),{align:`left`}),F(t.rect(96,250,344,34),`faster to a first board`,t.font(18),{align:`left`,color:V}),Wt(t.rect(96,292,344,130),`area`,[[``,`Minutes`],[`Jan`,`9.4`],[`Feb`,`7.1`],[`Mar`,`6.2`],[`Apr`,`4.8`],[`May`,`3.6`]],t.font(11),{showLegend:!1})]),r=B([R(t.rect(480,140,196,142),W.green,{fillStyle:`outline`}),F(t.rect(496,164,164,62),`4.8`,t.font(48),{align:`left`}),F(t.rect(496,228,164,32),`average rating`,t.font(15),{align:`left`,color:V})]),i=B([R(t.rect(692,140,196,142),W.orange,{fillStyle:`outline`}),Y(t.point(710,162),30*t.unit,`trophy`,{color:J}),F(t.rect(708,204,164,32),`12 of 14 shipped`,t.font(17),{align:`left`}),F(t.rect(708,234,164,28),`two slipped to Q3`,t.font(14),{align:`left`,color:q})]),a=B([R(t.rect(480,298,408,142),W.gray,{fillStyle:`outline`}),F(t.rect(504,316,360,76),`“It replaced three tools and a weekly meeting.”`,t.font(20),{align:`left`,valign:`top`,lineHeight:1.5}),F(t.rect(504,396,360,28),`Kim, platform lead at Globex`,t.font(14),{align:`left`,color:q})]);return[...I(t,`The quarter at a glance`),...n,...r,...i,...a]}function Zn(e){let t=L(e),n=[{fill:W.green,tag:`Added`,text:`Dark mode, at last`},{fill:W.blue,tag:`Improved`,text:`Boards open twice as fast`},{fill:W.red,tag:`Fixed`,text:`That one bug, gone for good`}].flatMap(({fill:e,tag:n,text:r},i)=>{let a=168+i*88;return B([R(t.rect(72,a+4,140,48),e,{fillStyle:`outline`,label:n,fontSize:t.font(18)}),F(t.rect(236,a,652,56),r,t.font(22),{align:`left`})])});return[F(t.rect(72,48,460,56),`What's new`,t.font(36),{align:`left`}),z([t.point(74,118),t.point(250,118)],{color:H,strokeWidth:4}),F(t.rect(560,58,328,36),`v2.4.0 · this week`,t.font(15),{align:`right`,fontFamily:K,color:q}),...n,F(t.rect(72,442,816,40),`…plus twelve smaller fixes nobody will notice but us.`,t.font(24),{fontFamily:en,color:q})]}function Qn(e){let t=L(e),n=[W.blue,W.green,W.yellow,W.pink,W.teal,W.purple].flatMap((e,n)=>{let r=240+n%3*240,i=n<3?152:312;return B([R(t.rect(r-42,i,84,84),e,{kind:`ellipse`,label:String.fromCharCode(65+n),fontSize:t.font(28)}),F(t.rect(r-110,i+92,220,24),`Name Surname`,t.font(18)),F(t.rect(r-110,i+118,220,20),`What they do`,t.font(14),{color:q})])});return[...I(t,`Meet the team`),...n]}function $n(e){let t=L(e),n=[{x:72,fill:W.blue,quote:`“It changed how our team plans every single week.”`,who:`Sam, Acme`},{x:368,fill:W.orange,quote:`“The first tool everyone actually kept using.”`,who:`Ada, Initech`},{x:664,fill:W.pink,quote:`“We shipped the rework two weeks early.”`,who:`Kim, Globex`}].flatMap(({x:e,fill:n,quote:r,who:i})=>B([R(t.rect(e,150,256,268),n,{fillStyle:`outline`}),F(t.rect(e+20,172,216,150),r,t.font(18),{align:`left`,valign:`top`,lineHeight:1.5}),G(t.rect(e+18,330,104,22),`rating`,{value:5,fill:H}),F(t.rect(e+20,362,216,32),i,t.font(14),{align:`left`,color:q})]));return[...I(t,`What people say`),...n]}function er(e){let t=L(e),n=e.width/qt.width,r=e.height/qt.height,i=[[``,`Basic`,`Pro`,`Team`],[`Price`,`$0`,`$12`,`$29`],[`Projects`,`1`,`10`,`Unlimited`],[`Export`,`PNG`,`PNG, SVG, PDF`,`PNG, SVG, PDF`],[`Support`,`—`,`Email`,`Priority`]],a=i.map((e,t)=>e.map((e,n)=>t===0?{background:n===2?W.blue:`#e9ecef`}:n===2?{background:`#e7f5ff`}:{}));return[...I(t,`Compare the options`),tn(t.point(72,156),i,[252,188,188,188].map(e=>e*n),i.map(()=>54*r),t.font(16),{cellStyles:a})]}function tr(e){let t=L(e),n=[{x:176,fill:W.blue,when:`Q1`,what:`Discovery, 20 interviews`},{x:384,fill:W.green,when:`Q2`,what:`First beta, 10 teams`},{x:592,fill:W.yellow,when:`Q3`,what:`Public launch`},{x:792,fill:W.pink,when:`Q4`,what:`Scale up, self-serve`}].flatMap(({x:e,fill:n,when:r,what:i},a)=>{let o=a%2==0,s=26*t.unit,c=t.point(e,306),l=o?-1:1;return B([z([t.point(e,306+l*16),t.point(e,306+l*54)],{strokeWidth:1.5,opacity:.3}),R({x:c.x-s/2,y:c.y-s/2,width:s,height:s},n,{kind:`ellipse`,fillStyle:`bold`}),F(t.rect(e-92,o?184:364,184,34),r,t.font(22),{valign:o?`bottom`:`top`}),F(t.rect(e-92,o?218:398,184,56),i,t.font(15),{valign:o?`bottom`:`top`,lineHeight:1.5,color:V})])});return[...I(t,`Roadmap`),z([t.point(88,306),t.point(890,306)],{strokeWidth:3,endArrow:!0}),...n,R(t.rect(96,332,96,34),J,{kind:`oval`,fillStyle:`bold`,label:`today`,fontSize:t.font(14)}),z([t.point(144,284),t.point(144,332)],{color:J,strokeWidth:2})]}function nr(e){let t=L(e),n=[{x:72,title:`Now`},{x:350,title:`Next`},{x:628,title:`Later`}].flatMap(({x:e,title:n})=>B([R(t.rect(e,140,260,330),`transparent`,{dash:`dashed`,opacity:.6}),F(t.rect(e,152,260,30),n,t.font(22))])),r=116*t.unit,i=[{x:100,y:206,rot:-2,fill:W.yellow,text:`Ship the fix`},{x:168,y:332,rot:3,fill:W.blue,text:`Call the pilot users`},{x:396,y:224,rot:-4,fill:W.green,text:`Write the launch post`},{x:690,y:240,rot:5,fill:W.pink,text:`Explore pricing`}].map(({x:e,y:n,rot:i,fill:a,text:o})=>U(t.point(e,n),r,o,t.font(15),i,a));return[...I(t,`Now, next, later`),...n,...i]}function rr(e){let t=L(e),n=[{label:`Infrastructure`,fill:W.green,pct:.8},{label:`Mobile app`,fill:W.blue,pct:.6},{label:`Documentation`,fill:W.yellow,pct:.45},{label:`Onboarding`,fill:W.pink,pct:.2}].flatMap(({label:e,fill:n,pct:r},i)=>{let a=168+i*76;return B([F(t.rect(72,a,240,32),e,t.font(20),{align:`left`}),R(t.rect(330,a,470,32),W.gray,{dash:`none`}),R(t.rect(330,a,470*r,32),n,{fillStyle:`bold`,dash:`none`}),F(t.rect(814,a,76,32),`${Math.round(r*100)}%`,t.font(16),{align:`left`,fontFamily:K,color:V})])});return[...I(t,`Where things stand`),...n]}function ir(e){let t=L(e),n=[{x:72,y:140,fill:W.green,title:`Strengths`,hint:`What we do well`},{x:504,y:140,fill:W.red,title:`Weaknesses`,hint:`Where we struggle`},{x:72,y:314,fill:W.blue,title:`Opportunities`,hint:`What we could ride`},{x:504,y:314,fill:W.yellow,title:`Threats`,hint:`What could hurt us`}].flatMap(({x:e,y:n,fill:r,title:i,hint:a})=>B([R(t.rect(e,n,384,158),r),F(t.rect(e+20,n+12,344,28),i,t.font(20),{align:`left`}),F(t.rect(e+20,n+48,344,96),a,t.font(15),{align:`left`,valign:`top`,color:V})]));return[...I(t,`SWOT`),...n]}function ar(e){let t=L(e),n=[{fill:W.blue,label:`Collect`,note:`Anyone can file a request`},{fill:W.teal,label:`Sort`,note:`Weekly triage, no backlog`},{fill:W.green,label:`Decide`,note:`One owner says yes or no`},{fill:W.yellow,label:`Ship`,note:`Behind a flag, then wide`}].flatMap(({fill:e,label:n,note:r},i)=>{let a=72+i*188;return B([R(t.rect(a,218,234,104),e,{kind:`chevron`,label:n,fontSize:t.font(21)}),F(t.rect(a+44,340,174,76),r,t.font(15),{valign:`top`,lineHeight:1.5,color:q})])});return[...I(t,`How it works`),...n]}var $=.56;function or(e){let t=L(e),n=[{fill:W.blue,value:`12,400`,name:`Visited the site`,note:`any page, any source`},{fill:W.teal,value:`1,860`,name:`Started a trial`,note:`15% of visitors`},{fill:W.green,value:`410`,name:`Became customers`,note:`22% of trials`}],r=520,i=[],a=[];return n.forEach(({fill:e,value:n,name:o,note:s},c)=>{let l=148+c*96,u=l+96/2,d=r*$;i.push(...B([R(t.rect(340-r/2,l,r,96),e,{kind:`trapezoid`,rotation:180}),F(t.rect(340-d/2,u-24,d,48),n,t.font(30-c*4))]),...B([F(t.rect(646,u-30,250,30),o,t.font(20),{align:`left`}),F(t.rect(646,u+2,250,26),s,t.font(15),{align:`left`,color:q})])),c>0&&a.push(F(t.rect(40,u-30,134,30),c===1?`−10,540`:`−1,450`,t.font(17),{align:`right`,color:q}),Gt(t.point(340-r/2+18,u-6),t.point(150,u+12),1.8,{color:q})),r*=$}),[...I(t,`Where people drop off`),...i,...a,z([t.point(622,156),t.point(622,428)],{strokeWidth:1.5,dash:`dashed`,opacity:.3}),R(t.rect(258,460,164,38),W.gray,{kind:`oval`,fillStyle:`outline`,label:`3.3% end to end`,fontSize:t.font(16)})]}function sr(e){let t=L(e),n=[{fill:W.purple,label:`Why`,note:`Teams lose their mornings to status meetings`},{fill:W.blue,label:`How`,note:`One board replaces the four tools they juggle`},{fill:W.teal,label:`What`,note:`Ship the shared inbox and the weekly digest`}],r=180,i=[];n.forEach(({fill:e,label:n,note:a},o)=>{let s=176+o*96,c=s+96/2;i.push(...B([R(t.rect(330-r/2,s,r,96),e,{kind:`trapezoid`}),F(t.rect(330-r*$*.5,c-22,r*$,44),n,t.font(24))]),...B([R(t.rect(660,c-26,12,12),e,{kind:`ellipse`,fillStyle:`bold`}),F(t.rect(684,c-34,212,68),a,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:V})])),r/=$});let a=180*$;return[...I(t,`How the work ladders up`),R(t.rect(330-a/2,118,a,58),W.yellow,{kind:`triangle`}),...i]}function cr(e){let t=L(e),n={x:340,y:318},r=[{label:`Talk to users`,fill:W.blue},{label:`Pick one bet`,fill:W.teal},{label:`Ship it small`,fill:W.green},{label:`Measure it`,fill:W.yellow}],i=r.map(({label:e,fill:i},a)=>{let o=-Math.PI/2+a*2*Math.PI/r.length;return R(t.rect(n.x+Math.cos(o)*152-156/2,n.y+Math.sin(o)*152-58/2,156,58),i,{label:e,fontSize:t.font(18)})}),a=i.map((e,n)=>{let r=i[(n+1)%i.length];return Ut({x:e.x+e.width/2,y:e.y+e.height/2},{x:r.x+r.width/2,y:r.y+r.height/2},e,r,{bow:-34*t.unit,strokeWidth:2.4})}),o=46*t.unit;return[...I(t,`How we work`),...a,...i,Y({x:t.point(n.x,n.y).x-o/2,y:t.point(n.x,n.y).y-o/2},o,`refresh-cw`,{color:q}),F(t.rect(646,240,250,34),`Every two weeks`,t.font(21),{align:`left`}),F(t.rect(646,282,250,140),`One loop per sprint. Nothing ships that hasn't been through all four.`,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:V})]}function lr(e){let t=L(e),n=rn(t.rect(72,148,816,300),`lanes`,{lanes:[`Customer`,`Support`,`Engineering`]}),r=e=>148+e*100+50,i=(e,n,i,a)=>R(t.rect(e,r(n)-27,148,54),a,{label:i,fontSize:t.font(16)}),a=i(126,0,`Reports a bug`,W.blue),o=i(324,1,`Triages it`,W.teal),s=i(522,2,`Ships a fix`,W.green),c=i(720,0,`Confirms`,W.blue),l=(e,t)=>Ut({x:e.x+e.width,y:e.y+e.height/2},{x:t.x,y:t.y+t.height/2},e,t,{bendStyle:`elbow`,strokeWidth:2.4});return[...I(t,`Who picks it up`),n,a,o,s,c,l(a,o),l(o,s),l(s,c)]}function ur(e){let t=L(e),n=e=>250+e*106,r=Array.from({length:6},(e,r)=>[z([t.point(n(r),150),t.point(n(r),440)],{strokeWidth:1.5,opacity:.12}),F(t.rect(n(r),118,106,26),`W${r+1}`,t.font(14),{color:q})]).flat(),i=[{name:`Research`,from:0,span:2,fill:W.purple},{name:`Design`,from:1,span:2,fill:W.blue},{name:`Build`,from:2,span:3,fill:W.teal},{name:`Beta`,from:4,span:1.5,fill:W.green},{name:`Launch prep`,from:5,span:.7,fill:W.yellow}].flatMap(({name:e,from:r,span:i,fill:a},o)=>{let s=170+o*52;return B([F(t.rect(72,s,164,36),e,t.font(17),{align:`left`}),R(t.rect(n(r)+6,s+4,106*i-12,28),a,{kind:`oval`,fillStyle:`bold`,dash:`none`})])});return[...I(t,`Six weeks to launch`),...r,...i,z([t.point(n(2),138),t.point(n(2),448)],{color:J,strokeWidth:2,dash:`dashed`}),F(t.rect(n(2)-60,452,120,26),`today`,t.font(14),{color:J}),R(t.rect(852,378,36,36),W.red,{kind:`diamond`,fillStyle:`bold`}),F(t.rect(714,418,168,26),`Launch`,t.font(15),{align:`right`,color:V})]}function dr(e){let t=L(e),n=[{y:244,text:`KR1 — Signup to first board under 2 minutes`,progress:.7,pct:`70%`},{y:320,text:`KR2 — Week-one activation up 20%`,progress:.45,pct:`45%`},{y:396,text:`KR3 — 50 teams on the new flow`,progress:.2,pct:`20%`}].flatMap(({y:e,text:n,progress:r,pct:i})=>B([F(t.rect(72,e,540,44),n,t.font(19),{align:`left`}),R(t.rect(640,e+9,160,24),W.gray,{dash:`none`}),R(t.rect(640,e+9,160*r,24),W.green,{fillStyle:`bold`,dash:`none`}),F(t.rect(812,e+2,76,38),i,t.font(18),{align:`left`,color:V})]));return[...I(t,`This quarter's OKRs`),R(t.rect(72,144,816,62),W.blue,{label:`Objective — Make onboarding effortless`,fontSize:t.font(22)}),...n]}function fr(e){let t=L(e);return[...I(t,`The problem we solve`),...B([R(t.rect(72,150,384,320),W.red,{fillStyle:`outline`}),F(t.rect(96,174,336,40),`The problem`,t.font(26),{align:`left`}),F(t.rect(96,228,336,220),`Status lives in six tools
11
- Standups eat the morning
12
- Nobody trusts the roadmap`,t.font(19),{align:`left`,valign:`top`,lineHeight:2,color:V})]),...B([R(t.rect(504,150,384,320),W.green,{fillStyle:`outline`}),F(t.rect(528,174,336,40),`Our solution`,t.font(26),{align:`left`}),F(t.rect(528,228,336,220),`One board for plans and talk
13
- Status that writes itself
14
- A roadmap anyone can read`,t.font(19),{align:`left`,valign:`top`,lineHeight:2,color:V})]),Gt(t.point(462,310),t.point(498,310),5)]}function pr(e){let t=L(e),n=[{d:340,fill:W.blue},{d:230,fill:W.teal},{d:120,fill:W.green}].map(({d:e,fill:n})=>R(t.rect(330-e/2,480-e,e,e),n,{kind:`ellipse`})),r=[{y:190,fill:W.blue,value:`TAM — $4.2B`,caption:`everyone with the problem`},{y:268,fill:W.teal,value:`SAM — $600M`,caption:`who we can reach`},{y:346,fill:W.green,value:`SOM — $40M`,caption:`a realistic first bite`}].flatMap(({y:e,fill:n,value:r,caption:i})=>B([R(t.rect(560,e+4,22,22),n,{kind:`ellipse`,fillStyle:`bold`}),F(t.rect(596,e,292,30),r,t.font(22),{align:`left`}),F(t.rect(596,e+34,292,26),i,t.font(15),{align:`left`,color:q})]));return[...I(t,`How big is this?`),...n,...r]}function mr(e){let t=L(e),n=[{x:72,name:`Free`,price:`$0`,features:`3 boards
15
- Core shapes
16
- PNG export`,highlight:!1},{x:356,name:`Pro`,price:`$12`,features:`Unlimited boards
17
- AI assistant
18
- Every export`,highlight:!0},{x:640,name:`Team`,price:`$49`,features:`Shared spaces
19
- Admin controls
20
- Priority help`,highlight:!1}].flatMap(({x:e,name:n,price:r,features:i,highlight:a})=>{let o=[R(t.rect(e,156,248,314),a?W.blue:W.gray,{fillStyle:`outline`}),F(t.rect(e+24,180,200,34),n,t.font(22),{align:`left`}),F(t.rect(e+24,218,200,60),r,t.font(44),{align:`left`}),F(t.rect(e+26,240,200,60),`per person / month`,t.font(13),{align:`right`,valign:`bottom`,color:q}),F(t.rect(e+24,306,200,150),i,t.font(17),{align:`left`,valign:`top`,lineHeight:2,color:V})];return a&&o.push(Qt(t.rect(e+50,138,148,30),W.yellow,`MOST POPULAR`,t.font(12),{labelColor:Zt})),B(o)});return[...I(t,`Pick a plan`),...n]}function hr(e){let t=L(e);return[...I(t,`Where the line is going`),Wt(t.rect(72,150,536,300),`area`,[[``,`MRR`],[`Jan`,`41`],[`Feb`,`58`],[`Mar`,`76`],[`Apr`,`97`],[`May`,`128`],[`Jun`,`164`]],t.font(12),{showLegend:!1,numberFormat:`currency`,showValues:!0}),...[{value:`4.1×`,caption:`revenue in six months`},{value:`112%`,caption:`net revenue retention`},{value:`$0`,caption:`spent on paid acquisition`}].flatMap(({value:e,caption:n},r)=>{let i=168+r*100;return B([F(t.rect(648,i,240,56),e,t.font(40),{align:`left`}),F(t.rect(648,i+54,240,30),n,t.font(15),{align:`left`,color:q})])})]}function gr(e){let t=L(e);return[...I(t,`How we sit in the market`),Wt(t.rect(96,146,768,330),`quadrant`,[[``,`x`,`y`],[`Us`,`0.78`,`0.82`],[`Legacy suite`,`0.24`,`0.74`],[`Sticky-note app`,`0.8`,`0.26`],[`Docs and slides`,`0.34`,`0.22`]],t.font(13),{quadrantLabels:[`Where we play`,`Heavy and slow`,`Good enough`,`Fast but shallow`],xTitle:`Hard to start → Open and draw`,yTitle:`One meeting → The whole workflow`})]}function _r(e){let t=L(e),n=[{icon:`circle-check`,text:`Ship the collaboration layer`},{icon:`circle-check`,text:`Hire two engineers and a designer`},{icon:`circle-check`,text:`Reach $500k ARR before the next round`}].flatMap(({icon:e,text:n},r)=>{let i=300+r*52,a=22*t.unit,o=t.point(72,i+4);return B([Y({x:o.x,y:o.y},a,e,{color:`#2f9e44`}),F(t.rect(108,i,380,34),n,t.font(17),{align:`left`,color:V})])});return[...I(t,`The ask`),F(t.rect(72,158,420,96),`$2.5M`,t.font(76),{align:`left`}),F(t.rect(72,250,420,34),`seed round · 18 months of runway`,t.font(19),{align:`left`,color:q}),...n,Wt(t.rect(536,152,352,300),`donut`,[[``,`Share`],[`Engineering`,`55`],[`Go to market`,`30`],[`Everything else`,`15`]],t.font(12),{showValues:!0,numberFormat:`percent`})]}function vr(e){let t=L(e),n=[{x:136,y:146,fill:W.green,title:`Quick wins`,align:`left`},{x:491,y:146,fill:W.blue,title:`Big bets`,align:`right`},{x:136,y:299,fill:W.gray,title:`Fill-ins`,align:`left`},{x:491,y:299,fill:W.red,title:`Money pits`,align:`right`}].flatMap(({x:e,y:n,fill:r,title:i,align:a})=>[R({...t.rect(e,n,710/2,306/2)},r,{dash:`none`,opacity:.35}),F(t.rect(e+(a===`left`?16:-16),n+10,710/2-32,26),i,t.font(15),{align:a,color:V})]),r=96*t.unit,i=[{x:190,y:176,rot:-3,fill:W.green,text:`Ship this week`},{x:604,y:190,rot:4,fill:W.blue,text:`The big rewrite`},{x:236,y:322,rot:2,fill:W.yellow,text:`Nice to have`},{x:640,y:336,rot:-5,fill:W.red,text:`Kill it`}].map(({x:e,y:n,rot:i,fill:a,text:o})=>U(t.point(e,n),r,o,t.font(14),i,a));return[...I(t,`Where to spend the effort`),...n,z([t.point(120,299),t.point(868,299)],{strokeWidth:2,endArrow:!0,opacity:.5}),z([t.point(491,468),t.point(491,124)],{strokeWidth:2,endArrow:!0,opacity:.5}),...i,F(t.rect(692,466,160,26),`more effort`,t.font(14),{align:`right`,color:q}),F(t.rect(503,112,160,26),`more impact`,t.font(14),{align:`left`,color:q})]}function yr(e){let t=L(e),n=[{x:72,fill:W.green,icon:`circle-check`,title:`In scope`,body:`Shared inbox
21
- Weekly digest
22
- Slack alerts`},{x:350,fill:W.red,icon:`circle-slash`,title:`Not this time`,body:`Mobile app
23
- Custom roles
24
- SSO`},{x:628,fill:W.orange,icon:`triangle-alert`,title:`Watch out for`,body:`Search rewrite lands late
25
- One backend engineer`}].flatMap(({x:e,fill:n,icon:r,title:i,body:a})=>B([R(t.rect(e,232,260,186),n,{fillStyle:`outline`}),R(t.rect(e+18,250,224,32),`transparent`,{dash:`none`,label:i,fontSize:t.font(19),align:`left`,titleIcon:{source:`lucide`,name:r,placement:`inside`}}),F(t.rect(e+18,292,224,112),a,t.font(15),{align:`left`,valign:`top`,lineHeight:1.9,color:V})])),r=[`Owner · Ada`,`Ships · 14 August`,`Check-in · Fridays, 10:00`].map((e,n)=>Qt(t.rect(72+n*250,448,232,38),W.gray,e,t.font(15),{fillStyle:`pastel`}));return[...I(t,`Project kickoff`),R(t.rect(72,140,816,68),W.blue,{label:`Cut the time a team spends chasing status to zero`,fontSize:t.font(23),titleIcon:{source:`lucide`,name:`target`,placement:`inside`}}),...n,...r]}function br(e){let t=L(e),n=e=>186+e*140,r=[{label:`Hears of us`,doing:`A teammate shares a board`,mood:`smile`,fill:W.green},{label:`Signs up`,doing:`Three fields, no card`,mood:`smile`,fill:W.green},{label:`First board`,doing:`Stares at a blank canvas`,mood:`meh`,fill:W.yellow},{label:`Invites the team`,doing:`Nobody joins for a week`,mood:`frown`,fill:W.red},{label:`Renews`,doing:`Finance asks what it's for`,mood:`meh`,fill:W.yellow}].flatMap(({label:e,doing:r,mood:i,fill:a},o)=>{let s=n(o),c=38*t.unit,l=t.point(s+132/2,318);return[Qt(t.rect(s,148,132,36),W.blue,e,t.font(14),{fillStyle:`outline`}),F(t.rect(s,206,132,76),r,t.font(14),{valign:`top`,lineHeight:1.5,color:V}),Y({x:l.x-c/2,y:l.y-c/2},c,i,{color:a===W.green?`#2f9e44`:a===W.red?`#e03131`:`#f08c00`})]}),i=[`Doing`,`Feeling`,`Fix it here`].map((e,n)=>F(t.rect(56,[212,306,384][n],110,30),e,t.font(15),{align:`right`,color:q})),a=104*t.unit;return[...I(t,`The trip they take`),z([t.point(176,292),t.point(888,292)],{strokeWidth:1.5,opacity:.15}),z([t.point(176,366),t.point(888,366)],{strokeWidth:1.5,opacity:.15}),...r,...i,U(t.point(n(2)+14,384),a,`Start from a template`,t.font(13),-3),U(t.point(n(3)+14,384),a,`Invite from the empty board`,t.font(13),4)]}function xr(e){let t=L(e);return[...I(t,`What the data says`),Wt(t.rect(72,150,530,310),`bar`,[[``,`This year`,`Last year`],[`Q1`,`12`,`8`],[`Q2`,`18`,`11`],[`Q3`,`24`,`16`],[`Q4`,`31`,`19`]],t.font(12),{showLegend:!0,showValues:!0}),F(t.rect(648,170,240,30),`The takeaway`,t.font(22),{align:`left`}),F(t.rect(648,212,240,200),`Say in one sentence what the chart proves, then stop.`,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:V})]}function Sr(e){let t=L(e),n=R(t.rect(96,220,180,90),W.blue,{label:`Client`,fontSize:t.font(20),titleIcon:{source:`lucide`,name:`monitor`,placement:`inside`}}),r=R(t.rect(390,220,180,90),W.teal,{label:`API`,fontSize:t.font(20),titleIcon:{source:`lucide`,name:`server`,placement:`inside`}}),i=R(t.rect(684,205,180,120),W.purple,{kind:`cylinder`,label:`Database`,fontSize:t.font(20)});return[...I(t,`How it fits together`),n,r,i,Ut(t.point(278,265),t.point(388,265),n,r,{label:`REST`,fontSize:t.font(14),strokeWidth:2.4}),Ut(t.point(572,265),t.point(682,265),r,i,{label:`SQL`,fontSize:t.font(14),strokeWidth:2.4}),F(t.rect(72,420,816,30),`Swap the boxes for your pieces. The arrows stay attached.`,t.font(16),{color:q})]}function Cr(e){let t=L(e);return[R(t.rect(-65,277,330,56),W.yellow,{fillStyle:`bold`,label:`THE ONE NUMBER`,fontSize:t.font(17),letterSpacing:.15,rotation:-90}),F(t.rect(180,150,600,200),`99.9%`,t.font(120)),F(t.rect(180,366,600,40),`what it measures, and why it matters`,t.font(20),{color:q}),z([t.point(420,352),t.point(540,352)],{color:J,strokeWidth:4})]}function wr(e){let t=L(e);return[R(t.rect(72,84,400,372),W.gray,{dash:`none`,label:`Drop an image
26
- or sketch here`,fontSize:t.font(18),labelColor:q}),F(t.rect(528,132,360,80),`Show, then tell`,t.font(36),{align:`left`}),z([t.point(530,224),t.point(660,224)],{color:H,strokeWidth:4}),F(t.rect(528,248,360,180),`Pair one strong visual with a few words. Say what it shows and why it matters. Nothing more.`,t.font(20),{align:`left`,valign:`top`,lineHeight:1.5,color:V})]}function Tr(e){let t=L(e),n=58*t.unit,r=46*t.unit,i=t.point(136,412);return[Y(t.point(136,148),n,`quote`,{color:J,strokeWidth:2.4}),F(t.rect(132,232,700,156),`Add one line worth remembering, and give it the whole slide.`,t.font(38),{align:`left`,valign:`top`,lineHeight:1.4}),R({x:i.x,y:i.y,width:r,height:r},W.yellow,{kind:`ellipse`,label:`A`,fontSize:t.font(18)}),F(t.rect(196,410,400,28),`Ada Lovelace`,t.font(19),{align:`left`}),F(t.rect(196,436,400,26),`Head of platform, Initech`,t.font(15),{align:`left`,color:q})]}function Er(e){let t=L(e);return[rn(t.rect(112,64,224,424),`phone`),G(t.rect(128,92,192,22),`statusbar`,{label:`9:41`,fontSize:t.font(11)}),G(t.rect(128,122,192,30),`heading`,{label:`Boards`,fontSize:t.font(18)}),G(t.rect(128,160,192,34),`search`,{label:`Search boards…`,fontSize:t.font(12)}),G(t.rect(128,206,192,116),`list`,{label:`Sprint board | Roadmap wall | Retro — Tuesday`,fontSize:t.font(12)}),G(t.rect(128,336,192,42),`button`,{label:`New board`,fill:W.blue,fontSize:t.font(13)}),G(t.rect(128,424,192,44),`tabbar`,{label:`Home | Search | You`,fontSize:t.font(11)}),F(t.rect(420,150,470,80),`In your pocket`,t.font(36),{align:`left`}),z([t.point(422,240),t.point(552,240)],{color:H,strokeWidth:4}),F(t.rect(420,264,460,160),`One tap from idea to board. Works offline, syncs the moment you're back.`,t.font(20),{align:`left`,valign:`top`,lineHeight:1.5,color:V})]}function Dr(e){let t=L(e);return[...I(t,`Where the work lives`),rn(t.rect(72,148,520,312),`browser`),G(t.rect(84,196,96,252),`sidebar`,{label:`Boards | Team | Settings`,fontSize:t.font(11),fill:W.gray}),G(t.rect(192,194,200,30),`heading`,{label:`Roadmap wall`,fontSize:t.font(16)}),G(t.rect(428,196,152,28),`segmented`,{label:`Day | Week | Month`,fontSize:t.font(10),fill:W.blue}),...[{x:192,label:`Now`},{x:326,label:`Next`},{x:460,label:`Later`}].map(({x:e,label:n})=>G(t.rect(e,238,120,86),`card`,{label:n,fontSize:t.font(12)})),G(t.rect(192,340,388,100),`list`,{label:`Ship the fix | Call the pilot users | Write the launch post`,fontSize:t.font(12)}),F(t.rect(628,190,260,76),`One wall for the whole team`,t.font(25),{align:`left`,valign:`top`,lineHeight:1.3}),F(t.rect(628,288,260,160),`Everything the team is doing, on one wall anyone can open.`,t.font(17),{align:`left`,valign:`top`,lineHeight:1.5,color:V})]}function Or(e){let t=L(e),n=[{x:148,y:214,note:`The one action a new board needs`},{x:300,y:320,note:`Status, without asking anyone`},{x:452,y:396,note:`Everything else hides until it's wanted`}],r=36*t.unit;return[...I(t,`What to look at`),R(t.rect(72,150,520,300),`transparent`,{dash:`dashed`,label:`Drop a screenshot here`,fontSize:t.font(17),labelColor:q,opacity:.6}),...n.flatMap(({x:e,y:n,note:i},a)=>{let o=t.point(e,n),s=178+a*92;return[G({x:o.x,y:o.y,width:r,height:r},`stepbadge`,{label:String(a+1),fontSize:t.font(15),fill:W.yellow}),...B([G(t.rect(628,s,34,34),`stepbadge`,{label:String(a+1),fontSize:t.font(15),fill:W.yellow}),F(t.rect(674,s-4,214,84),i,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:V})])]})]}function kr(e){let t=L(e),n=(e,n,r)=>R(e,`transparent`,{dash:`dashed`,label:n,fontSize:t.font(r),labelColor:q,opacity:.6});return[...I(t,`The look we're after`),n(t.rect(72,148,462,312),`Drop the hero shot`,18),n(t.rect(552,148,336,148),`Reference`,15),n(t.rect(552,312,158,148),`Detail`,14),n(t.rect(730,312,158,148),`Colour`,14)]}function Ar(e){let t=L(e),n=124*t.unit,r=[{x:128,y:96,rot:-4,fill:W.blue,text:`What if…?`},{x:660,y:84,rot:3,fill:W.green,text:`Steal this idea`},{x:116,y:326,rot:5,fill:W.pink,text:`Open question`},{x:692,y:318,rot:-6,fill:W.teal,text:`Remember this`},{x:408,y:392,rot:2,fill:W.yellow,text:`Wild card`}].map(({x:e,y:r,rot:i,fill:a,text:o})=>U(t.point(e,r),n,o,t.font(15),i,a));return[R(t.rect(350,200,260,120),W.yellow,{kind:`ellipse`,fillStyle:`bold`,label:`The topic`,fontSize:t.font(26)}),...r]}function jr(e){let t=L(e),n=(e,n,r,i)=>R(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[n(186,122,44,W.yellow),n(744,104,32,W.pink),n(252,396,26,W.blue),F(t.rect(160,186,640,100),`Demo time`,t.font(72)),F(t.rect(280,300,400,48),`(everything will be fine)`,t.font(30),{fontFamily:en,color:V}),U(t.point(656,360),132*t.unit,`Plan B: screenshots`,t.font(16),5)]}function Mr(e){let t=L(e),n=26*t.unit,r=t.point(772,102);return[R({x:r.x,y:r.y,width:n,height:n},W.pink,{kind:`heart`,fillStyle:`bold`}),F(t.rect(160,190,640,100),`Thank you!`,t.font(64)),...[`hello@example.com`,`koboyo.com`,`@yourhandle`].map((e,n)=>Qt(t.rect(196+n*200,306,184,40),W.gray,e,t.font(15),{fillStyle:`pastel`})),U(t.point(688,366),180*.85*t.unit,`Questions?`,t.font(20),-6)]}function Nr(e){let t=L(e),n=84*t.unit,r=t.point(480,132);return[Y({x:r.x-n/2,y:r.y},n,`coffee`,{color:J}),F(t.rect(160,248,640,90),`Back in 10 minutes`,t.font(56)),F(t.rect(280,344,400,44),`stretch, refill, ignore Slack`,t.font(28),{fontFamily:en,color:V}),G(t.rect(330,424,300,18),`progress`,{value:.35,fill:W.blue})]}var Pr=[{id:`blank`,name:`Blank`,category:`title`,build:()=>[]},{id:`cover`,name:`Title slide`,category:`title`,build:Nn},{id:`image-cover`,name:`Image title`,category:`title`,build:Ln},{id:`dark-cover`,name:`Midnight title`,category:`title`,build:In},{id:`terminal`,name:`Terminal`,category:`title`,build:Rn},{id:`section`,name:`Section divider`,category:`title`,build:Pn},{id:`big-statement`,name:`Big statement`,category:`title`,build:Fn},{id:`bullets`,name:`Title and bullets`,category:`content`,build:zn},{id:`agenda`,name:`Agenda`,category:`content`,build:Bn},{id:`two-columns`,name:`Two columns`,category:`content`,build:Vn},{id:`comparison`,name:`Comparison`,category:`content`,build:Hn},{id:`before-after`,name:`Before and after`,category:`content`,build:Un},{id:`metrics`,name:`Key numbers`,category:`content`,build:Wn},{id:`takeaways`,name:`Three takeaways`,category:`content`,build:Gn},{id:`checklist`,name:`Do and don't`,category:`content`,build:Kn},{id:`feature-list`,name:`Feature rundown`,category:`content`,build:qn},{id:`icon-grid`,name:`Icon grid`,category:`content`,build:Jn},{id:`bento`,name:`At a glance`,category:`content`,build:Xn},{id:`venn`,name:`Overlap`,category:`content`,build:Yn},{id:`changelog`,name:`What's new`,category:`content`,build:Zn},{id:`feature-table`,name:`Feature matrix`,category:`content`,build:er},{id:`timeline`,name:`Timeline`,category:`plan`,build:tr},{id:`kanban`,name:`Now, next, later`,category:`plan`,build:nr},{id:`progress`,name:`Status report`,category:`plan`,build:rr},{id:`okrs`,name:`OKRs`,category:`plan`,build:dr},{id:`swot`,name:`SWOT`,category:`plan`,build:ir},{id:`process`,name:`Process`,category:`plan`,build:ar},{id:`funnel`,name:`Funnel`,category:`plan`,build:or},{id:`pyramid`,name:`Pyramid`,category:`plan`,build:sr},{id:`cycle`,name:`Loop`,category:`plan`,build:cr},{id:`swimlanes`,name:`Swimlanes`,category:`plan`,build:lr},{id:`gantt`,name:`Week-by-week plan`,category:`plan`,build:ur},{id:`problem-solution`,name:`Problem, solution`,category:`pitch`,build:fr},{id:`market-size`,name:`Market size`,category:`pitch`,build:pr},{id:`traction`,name:`Traction`,category:`pitch`,build:hr},{id:`competition`,name:`Competitive map`,category:`pitch`,build:gr},{id:`ask`,name:`The ask`,category:`pitch`,build:_r},{id:`pricing`,name:`Pricing tiers`,category:`pitch`,build:mr},{id:`team`,name:`Meet the team`,category:`pitch`,build:Qn},{id:`testimonials`,name:`What people say`,category:`pitch`,build:$n},{id:`matrix`,name:`Effort vs impact`,category:`workshop`,build:vr},{id:`kickoff`,name:`Project kickoff`,category:`workshop`,build:yr},{id:`journey`,name:`Journey map`,category:`workshop`,build:br},{id:`chart`,name:`Chart`,category:`visual`,build:xr},{id:`diagram`,name:`Diagram starter`,category:`visual`,build:Sr},{id:`big-metric`,name:`One number`,category:`visual`,build:Cr},{id:`image-text`,name:`Image and text`,category:`visual`,build:wr},{id:`image-grid`,name:`Moodboard`,category:`visual`,build:kr},{id:`annotated`,name:`Annotated screenshot`,category:`visual`,build:Or},{id:`phone`,name:`Phone mockup`,category:`visual`,build:Er},{id:`browser`,name:`Browser mockup`,category:`visual`,build:Dr},{id:`quote`,name:`Quote`,category:`visual`,build:Tr},{id:`brainstorm`,name:`Brainstorm`,category:`fun`,build:Ar},{id:`demo`,name:`Demo time`,category:`fun`,build:jr},{id:`intermission`,name:`Break`,category:`fun`,build:Nr},{id:`closing`,name:`Thank you`,category:`fun`,build:Mr}];async function Fr(e,t,n,r){let i=r.theme.palette();return on(await an(e,r,{bounds:t,padding:0,background:n(i),palette:i}))}var Ir=new Map;function Lr(e,t,n,r){let i=pe(),[a,o]=(0,X.useState)(()=>Ir.get(e)??null),s=(0,X.useRef)(t);s.current=t;let c=(0,X.useRef)(n);c.current=n;let l=(0,X.useRef)(r);return l.current=r,(0,X.useEffect)(()=>{let t=Ir.get(e);if(t){o(t);return}let n=!0,r={x:0,y:0,...c.current};return Fr(b(s.current()),r,e=>l.current?e.paperBg:e.bg,i).then(t=>{Ir.set(e,t),n&&o(t)}),()=>{n=!1}},[e,i]),a}function Rr(e){let{template:t,testId:n,cacheKey:r,aspect:i,canvas:a,onPaper:o,onPick:s}=e,c=Lr(r,()=>t.build({x:0,y:0,...a}),a,o);return(0,Q.jsxs)(`button`,{type:`button`,"data-testid":n,onClick:s,className:`group overflow-hidden rounded-lg text-left ring-1 ring-[var(--chrome-ring)] transition-shadow hover:ring-2 hover:ring-[var(--chrome-fg-500)]`,children:[(0,Q.jsx)(`div`,{className:`${i} w-full`,style:{background:o?`var(--paper-bg)`:`var(--canvas-bg)`},children:c&&(0,Q.jsx)(`img`,{src:c,alt:``,draggable:!1,className:`h-full w-full object-fill`})}),(0,Q.jsxs)(`div`,{className:`border-t border-[var(--chrome-ring)] px-2.5 py-1.5`,children:[(0,Q.jsx)(`div`,{className:`text-[12px] text-[var(--chrome-fg-800)]`,children:t.name}),t.blurb?(0,Q.jsx)(`div`,{className:`text-[11px] text-[var(--chrome-fg-500)]`,children:t.blurb}):null]})]})}function zr(e){let{open:t,onOpenChange:n,title:r,prefix:i,width:a,cardAspect:o,canvas:s,filters:c,templates:l,previewOnPaper:u,pinned:d,onPick:f}=e,p=(0,X.useRef)(null),[m,h]=(0,X.useState)(`all`),g=Te(),ee=l.filter(e=>m===`all`||e.category===m||d?.(e));return(0,Q.jsx)(It,{open:t,onOpenChange:n,children:(0,Q.jsxs)(Pt,{children:[(0,Q.jsx)(Nt,{className:`fixed inset-0 bg-gray-900/15`}),(0,Q.jsxs)(Ft,{ref:p,initialFocus:p,"data-overlay":!0,"data-testid":`${i}-dialog`,className:`scrollbar-slim fixed left-1/2 top-1/2 max-h-[82vh] ${a} -translate-x-1/2 -translate-y-1/2 overflow-y-auto overflow-x-hidden rounded-2xl bg-[var(--chrome-popup)] shadow-[0_24px_70px_rgba(0,0,0,0.22)] outline-none ring-1 ring-[var(--chrome-ring)]`,children:[(0,Q.jsxs)(`div`,{className:`sticky top-0 z-10 border-b border-[var(--chrome-ring)] bg-[var(--chrome-surface)] backdrop-blur`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between px-5 pb-2.5 pt-3.5`,children:[(0,Q.jsx)(Rt,{className:`text-[15px] text-[var(--chrome-fg-900)]`,children:r}),(0,Q.jsx)(Lt,{"aria-label":`Close`,className:`-mr-1.5 flex h-7 w-7 items-center justify-center rounded-full text-[var(--chrome-fg-400)] outline-none transition-colors hover:bg-[var(--chrome-divider)] hover:text-[var(--chrome-fg-600)]`,children:(0,Q.jsx)(qe,{size:16,stroke:1.75})})]}),(0,Q.jsx)(`div`,{className:`scrollbar-slim flex gap-1.5 overflow-x-auto px-5 pb-3`,children:c.map(({id:e,label:t})=>(0,Q.jsx)(`button`,{type:`button`,"data-testid":`${i}-filter-${e}`,onClick:()=>h(e),className:`shrink-0 whitespace-nowrap rounded-full px-3 py-1 text-[12px] transition-colors ${m===e?`bg-[var(--chrome-accent)] text-white`:`text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] hover:bg-[var(--chrome-hover)]`}`,children:t},e))})]}),(0,Q.jsx)(`div`,{className:`grid grid-cols-2 gap-3 p-5 sm:grid-cols-3`,children:ee.map(e=>(0,Q.jsx)(Rr,{template:e,testId:`${i}-${e.id}`,cacheKey:`${i}:${e.id}:${g}`,aspect:o,canvas:s,onPaper:u??!1,onPick:()=>{n(!1),f(e)}},e.id))})]})]})})}var Br=[{id:`all`,label:`All`},{id:`title`,label:`Title`},{id:`content`,label:`Content`},{id:`plan`,label:`Plan`},{id:`pitch`,label:`Pitch`},{id:`workshop`,label:`Workshop`},{id:`visual`,label:`Visual`},{id:`fun`,label:`Fun`}];function Vr(e){let{open:t,onOpenChange:n,onPick:r}=e;return(0,Q.jsx)(zr,{open:t,onOpenChange:n,title:`Pick a slide template`,prefix:`slide-template`,width:`w-[min(680px,92vw)]`,cardAspect:`aspect-video`,canvas:qt,filters:Br,templates:Pr,previewOnPaper:!0,pinned:e=>e.id===`blank`,onPick:e=>r(e)})}var Hr=90,Ur=210;function Wr(e){let t=e.width/Math.max(1,e.height);return Math.round(x(248/t,Hr,Ur))}var Gr=new Map;function Kr(e,t,n,r){return e.box.x===t.x&&e.box.y===t.y&&e.box.width===t.width&&e.box.height===t.height&&e.fill===t.fill&&e.theme===r&&e.contents.length===n.length&&e.contents.every((e,t)=>e===n[t])}function qr(e){for(let t of Gr.keys())e.has(t)||Gr.delete(t)}function Jr(e){let{figure:t,shapes:n}=e,r=pe(),i=(0,X.useMemo)(()=>O(n,t),[n,t]),a=Te(),[o,s]=(0,X.useState)(()=>Gr.get(t.id)?.url??null);return(0,X.useEffect)(()=>{let e=Gr.get(t.id);if(e&&Kr(e,t,i,a)){s(e.url);return}let n=!0,o=setTimeout(()=>{Fr(i,w(t),e=>t.fill&&t.fill!==`transparent`?C(t.fill,e):e.bg,r).then(e=>{n&&(Gr.set(t.id,{box:{x:t.x,y:t.y,width:t.width,height:t.height},fill:t.fill,theme:a,contents:i,url:e}),s(e))})},e?300:0);return()=>{n=!1,clearTimeout(o)}},[t,i,a,r]),(0,Q.jsx)(`div`,{className:`w-full overflow-hidden rounded-[7px] bg-[var(--canvas-bg)]`,style:{height:Wr(t)},children:o&&(0,Q.jsx)(`img`,{src:o,alt:``,draggable:!1,className:`h-full w-full object-fill`})})}var Yr=`flex items-center gap-1 rounded-md bg-[var(--chrome-surface)] px-1.5 py-0.5 text-[10px] tabular-nums text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] backdrop-blur-sm`,Xr=72,Zr=12;function Qr(e){let{containerRef:t}=e;return _(e=>e.rightPanel===`slides`)?(0,Q.jsx)($r,{containerRef:t}):null}function $r(e){let{containerRef:t}=e,{ai:n,embed:i}=g(),a=Se(`slide`),o=ee(),{store:s,viewportAnimation:c,history:l}=o,u=et(),{beginTransaction:d,endTransaction:f}=l,p=_(e=>e.shapes),m=_(e=>e.viewport),h=_(e=>e.slidePickerOpen),v=_(e=>e.animateSlideId),y=_(e=>e.selectedIds),b=_(e=>e.viewMode),{addMany:x,sendToBack:S,replaceMany:C,removeShapes:ne,updateShape:E,setSelectedIds:de,setSlidesOpen:pe,setSlidePickerOpen:me,setNotesEditorId:he,setAnimateSlideId:ge,setAiOpen:ve,setPresentingIndex:ye,setViewport:xe,setExportDialog:we}=s.getState(),A=(0,X.useMemo)(()=>D(p),[p]),Te=(0,X.useMemo)(()=>at(p),[p]),Ee=(0,X.useMemo)(()=>oe(A).length,[A]),[j,M]=(0,X.useState)(null);(0,X.useEffect)(()=>{qr(new Set(A.map(e=>e.id)))},[A]);let De=Vt()===`docked`,Oe=(0,X.useCallback)(()=>{let e=t.current,n=e?.clientWidth??window.innerWidth,r=e?.clientHeight??window.innerHeight;return{width:Math.max(1,n-(De?272:0)),height:r}},[t,De]),ke=(0,X.useMemo)(()=>ue(A,m,Oe()),[A,m,Oe]);function N(e){c.animate(s.getState().viewport,fe(w(e),Oe(),Xr),xe)}(0,X.useEffect)(()=>{if(!v||y.size===0)return;let e=s.getState().shapes,t=ie(e,D(e),y);!t||t.id===v||ge(t.id)},[y,v,s,ge]);function Ae(e,t){let{width:n,height:r}=Oe(),i=te({x:n/2,y:r/2},m),a={...ae(A,i,p),slideOrder:e,slideLayout:t&&t.id!==`blank`?t.id:void 0},o=t?t.build(w(a)):[];d(),C(le(A,e)),x([a,...o]),S(new Set([a.id])),f(),de(new Set([a.id])),N(a)}function je(e){let t=s.getState().shapes,{clones:n,renumbered:r}=ce(t,A,e);d(),C(r),x(n),S(new Set([n[0].id])),f(),de(new Set([n[0].id])),N(n[0])}function Me(e){let t=s.getState().shapes;ne(se(t,A[e])),de(new Set)}function Ne(e,t){let n=s.getState().shapes,r=A[e],i=O(n,r),a={bounds:w(r),padding:0,background:r.fill,measurement:o.measurement},c=k(r,e);u(t===`png`?`downloadPng`:`downloadSvg`,i,{options:a,filename:c})}function Pe(e){Ee!==0&&ye(e??Math.max(0,ke))}function Fe(){if(!j)return;let e=j.value.trim();e!==j.initial&&E(j.id,{label:e}),M(null)}let P=Ge({count:A.length,gap:Zr,disabled:b,onPress:e=>N(A[e]),onReorder:(e,t)=>C(re(A,e,t)),canDrag:()=>!j}),Ie=v?A.findIndex(e=>e.id===v):-1,Le=Ie>=0?A[Ie]:void 0;return(0,Q.jsxs)(Ht,{width:272,testId:`slides-panel`,ariaLabel:`Slides`,onDismiss:()=>pe(!1),children:[Le?(0,Q.jsx)(Cn,{figure:Le,index:Ie,total:A.length,viewMode:b,onBack:()=>ge(null),onGoToSlide:e=>{let t=A[e];t&&(ge(t.id),N(t))},onFocusSlide:N}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between py-2 pl-4 pr-2`,children:[(0,Q.jsxs)(`span`,{className:`text-[14px] text-[var(--chrome-fg-900)]`,"data-testid":`slides-count`,children:[`Slides (`,A.length,`)`]}),(0,Q.jsxs)(`div`,{className:`flex items-center`,children:[n&&!b&&(0,Q.jsx)(r,{label:`Generate with AI`,side:`bottom`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Generate slides with AI`,"data-testid":`slides-ai-open`,onClick:()=>ve(!0),className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg text-[var(--chrome-fg-600)] transition-[background-color,scale] hover:bg-[var(--chrome-hover)] active:scale-[0.96] coarse:h-11 coarse:w-11`,children:(0,Q.jsx)(Ke,{size:16,stroke:1.75})})}),!b&&(0,Q.jsx)(r,{label:`Add slide`,side:`bottom`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Add slide`,"data-testid":`slides-add`,onClick:()=>me(!0),className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg text-[var(--chrome-fg-600)] transition-[background-color,scale] hover:bg-[var(--chrome-hover)] active:scale-[0.96] coarse:h-11 coarse:w-11`,children:(0,Q.jsx)(He,{size:16,stroke:1.75})})}),i?null:(0,Q.jsx)(r,{label:`Export as PDF`,side:`bottom`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Export slides as PDF`,"data-testid":`slides-export-pdf`,disabled:Ee===0,onClick:()=>we({format:`pdf`}),className:`${jt} disabled:pointer-events-none disabled:text-[var(--chrome-fg-300)]`,children:(0,Q.jsx)(_e,{size:16,stroke:1.75})})}),(0,Q.jsx)(r,{label:`Hide slides`,side:`bottom`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Hide slides`,"data-testid":`slides-close`,onClick:()=>pe(!1),className:jt,children:(0,Q.jsx)(qe,{size:16,stroke:1.75})})})]})]}),(0,Q.jsx)(`div`,{className:`mx-3 h-px bg-[var(--chrome-divider)]`}),(0,Q.jsxs)(`div`,{ref:P.listRef,"data-testid":`slides-list`,className:`flex flex-1 flex-col gap-3 overflow-y-auto p-3`,children:[A.length===0&&(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-[12px] leading-relaxed text-[var(--chrome-fg-400)]`,children:`No slides yet. Create a new slide or generate one with AI to get started.`}),!b&&(0,Q.jsxs)(`button`,{type:`button`,"data-testid":`slides-add-empty`,onClick:()=>me(!0),className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[12px] text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] transition-colors hover:bg-[var(--chrome-rest)] hover:text-[var(--chrome-fg-900)]`,children:[(0,Q.jsx)(He,{size:14,stroke:1.75}),`Add slide`]})]}),A.map((e,t)=>{let n=T(e,t),r=t===ke,o={onPresent:()=>Pe(t),onExportPng:i?null:()=>Ne(t,`png`),onExportSvg:i?null:()=>Ne(t,`svg`),onEmbed:a?()=>a(e.id):null,onDuplicate:()=>je(t),onRename:()=>M({id:e.id,initial:n,value:n}),onEditNotes:()=>he(e.id),onToggleSkip:()=>E(e.id,{slideSkipped:!e.slideSkipped||void 0}),onAddAbove:()=>Ae(t),onAddBelow:()=>Ae(t+1),onDelete:()=>Me(t)};return(0,Q.jsxs)(`div`,{ref:P.setItemRef(t),"data-testid":`slide-item-${t}`,className:`group relative shrink-0`,style:P.rowStyle(t),children:[(0,Q.jsx)(Mn,{index:t,actions:o,skipped:!!e.slideSkipped,disabled:b,children:(0,Q.jsxs)(`div`,{className:`relative cursor-pointer touch-none overflow-hidden rounded-lg ring-1 transition-shadow ${r?`ring-2 ring-[var(--chrome-fg-500)]`:`ring-[var(--chrome-ring)] hover:ring-black/25`}`,...P.rowHandlers(t),children:[(0,Q.jsx)(`div`,{className:e.slideSkipped?`opacity-40`:void 0,children:(0,Q.jsx)(Jr,{figure:e,shapes:p})}),(0,Q.jsxs)(`div`,{className:`absolute left-1.5 top-1.5 flex items-center gap-1`,children:[e.slideSkipped&&(0,Q.jsxs)(`div`,{"data-testid":`slide-skipped-${t}`,title:`Skipped — not shown when presenting`,className:Yr,children:[(0,Q.jsx)(Ce,{size:11,stroke:1.75}),`Skipped`]}),Te.has(e.id)&&(0,Q.jsxs)(`div`,{"data-testid":`slide-animated-${t}`,title:`Animated: plays in ${Te.get(e.id)} clicks`,className:Yr,children:[(0,Q.jsx)(be,{size:11,stroke:1.75}),Te.get(e.id)]})]}),j?.id===e.id?(0,Q.jsx)(`input`,{autoFocus:!0,onFocus:e=>e.target.select(),value:j.value,onChange:e=>M({...j,value:e.target.value}),onBlur:Fe,onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&Fe(),e.key===`Escape`&&M(null)},onPointerDown:e=>e.stopPropagation(),className:`absolute inset-x-0 bottom-0 border-t border-[var(--chrome-ring)] bg-[var(--chrome-popup)] px-2.5 py-1.5 text-[12px] text-[var(--chrome-fg-800)] outline-none`}):(0,Q.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 flex items-center gap-1.5 border-t border-[var(--chrome-ring)] bg-[var(--chrome-surface)] px-2.5 py-1.5 text-[12px] text-[var(--chrome-fg-800)] backdrop-blur-sm`,title:n,onPointerDown:e=>e.stopPropagation(),onClick:()=>N(e),onDoubleClick:t=>{t.stopPropagation(),b||M({id:e.id,initial:n,value:n})},children:[(0,Q.jsx)(`span`,{className:`shrink-0 text-[var(--chrome-fg-400)]`,children:t+1}),(0,Q.jsx)(`span`,{className:`truncate`,children:n})]})]})}),(0,Q.jsx)(jn,{index:t,actions:o,skipped:!!e.slideSkipped,disabled:b})]},e.id)})]}),(0,Q.jsx)(`div`,{className:`border-t border-[var(--chrome-ring)] p-3`,children:(0,Q.jsx)(Dn,{disabled:Ee===0,onPresent:e=>Pe(e===`beginning`?0:void 0)})})]}),(0,Q.jsx)(Vr,{open:h,onOpenChange:me,onPick:e=>{Ae(A.length,e),De||pe(!1)}})]})}export{Qr as SlidesPanel};
@@ -1,7 +0,0 @@
1
- import{At as e,Tn as t,bn as n}from"./slides-D9bnXqtf.js";function r(e,t,n){}function i(e){return(e.split(`,`)[0]?.trim()??``).replace(/^['"]|['"]$/g,``)}var a=`JetBrains Mono`;function o(e){return e.type===`control`?`${e.label??``} ${e.body??``}`:e.type===`arrow`?[e.label,e.startLabel,e.endLabel].filter(Boolean).join(` `):e.type===`figure`?[e.label,...e.lanes??[]].filter(Boolean).join(` `):e.type===`chart`?[...e.showTitles?[e.title,e.xTitle,e.yTitle]:[],...e.quadrantLabels??[]].filter(Boolean).join(` `):(e.type===`rectangle`||e.type===`icon`||e.type===`line`)&&`label`in e?e.label??``:e.type===`text`||e.type===`sticky`?e.text:``}function s(e){let t=new Set,n=!1,r=!1,s=new Set,c=e=>{for(let t of e)s.add(t.codePointAt(0)??0)};for(let s of e){let e=o(s);if((e||s.type===`chart`||s.type===`table`)&&`fontFamily`in s&&s.fontFamily&&t.add(i(s.fontFamily)),e.includes(`<code`)&&t.add(a),n||=e.includes(`<strong`),r||=e.includes(`<em`),c(e),`cells`in s&&Array.isArray(s.cells))for(let e of s.cells)for(let t of e)c(String(t));if(s.type===`table`&&s.cellStyles){for(let e of s.cellStyles)if(e)for(let n of e)n?.fontFamily&&t.add(i(n.fontFamily))}}return{families:t,bold:n,italic:r,codepoints:s}}var c={woff2:`font/woff2`,woff:`font/woff`,truetype:`font/ttf`,opentype:`font/otf`};function l(e,t){let n=e.format??`woff2`,r=`data:${c[n]};base64,${t(e.data)}`,i=e.unicodeRange?` unicode-range: ${e.unicodeRange};\n`:``;return`@font-face {\n font-family: "${e.family}";\n font-style: ${e.style??`normal`};\n font-weight: ${e.weight??`400`};\n font-display: swap;\n src: url(${r}) format("${n}");\n`+i+`}`}function u(e,t,n){let{families:r,bold:i,italic:a,codepoints:o}=e;return t.filter(e=>r.has(e.family)&&(i||(e.weight??`400`).trim()!==`700`)&&(a||(e.style??`normal`)!==`italic`)&&d(e.unicodeRange??``,o)).map(e=>l(e,n)).join(`
2
- `)}function d(e,t){if(!e.trim())return!0;for(let n of e.split(`,`)){let e=n.trim().match(/^U\+([0-9a-f?]+)(?:-([0-9a-f]+))?$/i);if(!e)continue;let r=parseInt(e[1].replaceAll(`?`,`0`),16),i=e[2]?parseInt(e[2],16):parseInt(e[1].replaceAll(`?`,`f`),16);for(let e of t)if(e>=r&&e<=i)return!0}return!1}var f=`#ffec99`,p=.14;function m(e,t){return(e.fill??``).localeCompare(t.fill??``)||e.y-t.y||e.x-t.x}function h(t,n){return{id:e(),type:`sticky`,x:t.x,y:t.y,width:180,height:180,rotation:0,text:``,fontSize:n.fontSize,fontFamily:n.fontFamily,fill:n.fill===`transparent`?f:n.fill,opacity:n.opacity}}var g=new Set([`/`,`\\`,`.`,`_`,`-`,`:`,`#`,`,`,`?`,`&`,`=`,`@`]),_=2,v=/^[A-Za-z0-9]{1,5}$/,y=e=>e!==e.toUpperCase()&&e===e.toLowerCase(),b=e=>e!==e.toLowerCase()&&e===e.toUpperCase();function x(e){let t=Array.from(e),n=[];for(let e=_;e<=t.length-_;e+=1){let r=t[e-1],i=t[e];if(g.has(r)&&!g.has(i)){(r!==`.`||!v.test(t.slice(e).join(``)))&&n.push(e);continue}let a=y(r)&&b(i),o=b(r)&&b(i)&&y(t[e+1]??``);(a||o)&&n.push(e)}return n}function S(e){let t=Array.from(e),n=[0,...x(e),t.length],r=[];for(let e=0;e<n.length-1;e+=1)r.push(t.slice(n[e],n[e+1]).join(``));return r}function C(e,t,n){let r=[],i=``;for(let a of e){if(i&&n(i+a)>t){r.push(i),i=a;continue}i+=a}return r.push(i),r}function w(e,t,n){if(n(e)<=t)return[e];let r=[],i=``,a=(e,a)=>{let o=i?`${i}${a}${e}`:e;if(n(o)<=t){i=o;return}if(i&&=(r.push(i),``),n(e)<=t){i=e;return}let s=C(e,t,n);r.push(...s.slice(0,-1)),i=s[s.length-1]};for(let r of e.split(` `)){if(n(r)<=t){a(r,` `);continue}S(r).forEach((e,t)=>a(e,t===0?` `:``))}return(i||r.length===0)&&r.push(i),r}function T(e,r,i){return e.split(`
3
- `).map(e=>e.split(` `).map(e=>n(e,i)<=r?t(e):S(e).map(t).join(`<wbr>`)).join(` `)).join(`
4
- `)}var E={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&#39;":`'`},D=/^<\/?(?:br|p|div|li|ul|ol|h[1-6]|blockquote)\b/i;function O(e){let t=[];for(let n of e.split(/(<[^>]*>)/))if(n){if(n.startsWith(`<`)&&n.endsWith(`>`)){t.push({raw:n,char:D.test(n)?`
5
- `:``,tag:!0});continue}for(let e of n.matchAll(/&[#\w]+;|[\s\S]/gu)){let n=e[0],r=n.length>1?E[n]??`x`:n;t.push({raw:n,char:r,tag:!1})}}return t}function k(e,t,r){let i=O(e),a=new Set,o=[],s=()=>{let e=o.map(e=>i[e].char).join(``);if(e&&n(e,r)>t&&Array.from(e).length===o.length)for(let t of x(e))a.add(o[t]);o=[]};return i.forEach((e,t)=>{if(!(e.tag&&e.char===``)){if(/\s/.test(e.char)){s();return}o.push(t)}}),s(),i.map((e,t)=>a.has(t)?`<wbr>${e.raw}`:e.raw).join(``)}function A(e,t,r){return e.split(`
6
- `).map(e=>e.split(` `).map(e=>n(e,r)<=t?e:S(e).join(`​`)).join(` `)).join(`
7
- `)}export{w as a,m as c,i as d,d as f,A as i,h as l,r as m,T as n,f as o,s as p,k as r,p as s,x as t,u};
@@ -1 +0,0 @@
1
- import{S as e,Z as t}from"./style-BENGW2ZV.js";import{Dn as n,Ut as r,Zt as i,_ as a,an as o,on as s}from"./slides-D9bnXqtf.js";import{r as c}from"./elk-worker-loader-CC-I9MmI.js";import{t as l}from"./icons-DzW1j-r3.js";import{i as u,r as d,t as f}from"./tidy-scope-BgBSUklT.js";import{n as p}from"./asset-glyph-B3c--Mx2.js";import{n as m}from"./shape-meta-BpwsiB82.js";import{a as h,c as g,l as _,n as v,o as y,s as b,t as x}from"./layout-offthread-BwetpTFH.js";import{T as S}from"./builders-DbF28yId.js";var C={none:[!1,!1],start:[!0,!1],end:[!1,!0],both:[!0,!0]},w={top:{x:.5,y:0},bottom:{x:.5,y:1},left:{x:0,y:.5},right:{x:1,y:.5},center:{x:.5,y:.5}},T={top:`top`,right:`right`,bottom:`bottom`,left:`left`};function E(e,t){return!e||!t||`kind`in e||!w[t]?e:{...e,anchor:w[t],precise:!0}}function D(t,n){if(t.type!==`arrow`)return t;let r={...t};n.fromSide&&(r.startBinding=E(r.startBinding,n.fromSide)),n.toSide&&(r.endBinding=E(r.endBinding,n.toSide));let i=n.style??(n.dashed?`dashed`:void 0);i&&(r.dash=i),n.color&&e[n.color]&&(r.color=e[n.color]);let a=n.arrows?C[n.arrows]:n.bidirectional?C.both:void 0;return a&&(r.startArrow=a[0],r.endArrow=a[1]),typeof n.label==`string`&&(r.label=n.label),n.bend===`elbow`?r={...r,bendStyle:`elbow`,bend:0,bendAlong:0,bow:0,elbowPoints:void 0,elbowRoute:void 0,elbowMidHandle:void 0}:n.bend===`curved`&&(r.bendStyle=`curved`),r}function O(e){return e.type===`rectangle`||e.type===`icon`||e.type===`sticky`||e.type===`table`||e.type===`chart`}function k(e,t){return{id:e,width:t.width,height:t.height,rank:0,x:t.x,y:t.y}}function A(t,n,r,i,a){let c=()=>{let e=D(S(s(t),s(n),t,n),r);return e.strokeWidth=g,e},l=o(t),u=o(n),d=i.filter(e=>e.id!==t.id&&e.id!==n.id&&O(e)).map(e=>o(e));if(!b([s(t),s(n)],d)&&r.bend===`curved`)return c();let f=_({bounds:l,side:r.fromSide?T[r.fromSide]:void 0},{bounds:u,side:r.toSide?T[r.toSide]:void 0},d,void 0,a);if(!f)return c();let p=y({from:k(t.id,l),to:k(n.id,u),fromShapeId:t.id,toShapeId:n.id,routed:{elbow:!0,bend:0,route:f},label:r.label,labelObstacles:d,dashed:r.style===`dashed`||r.dashed,color:r.color&&e[r.color]?e[r.color]:void 0}),m=r.arrows?C[r.arrows]:r.bidirectional?C.both:void 0;return m&&(p.startArrow=m[0],p.endArrow=m[1]),r.style===`dotted`&&(p.dash=`dotted`),p}function j(e,t){return{...e,x:t.x,y:t.y,x2:t.x2,y2:t.y2,bend:t.bend,bendAlong:t.bendAlong,bendStyle:t.bendStyle,elbowPoints:t.elbowPoints,elbowRoute:void 0,elbowMidHandle:void 0,labelAlong:t.labelAlong,startBinding:t.startBinding,endBinding:t.endBinding}}var M=(()=>{let e={};for(let[t,n]of Object.entries(h))n&&!(n in e)&&(e[n]=t);return e})();function N(e){let t=m(e);if(e.type===`icon`){let n=e.source===`lucide`?e.name:`${e.source}:${e.name}`;return{id:e.id,label:t,icon:n}}return e.type===`sticky`?{id:e.id,label:t,shape:`sticky`}:e.type===`rectangle`?{id:e.id,label:t,shape:M[e.kind]}:{id:e.id,label:t}}var P=28,F=44;function I(e,t,n,i,a){if(e.type===`rectangle`||e.type===`icon`||e.type===`sticky`)return{...e,x:t,y:n,width:i,height:a};let s=o(e);return r(e,{x:t-s.x,y:n-s.y})}function L(e,t){let n=new Map(t.map(e=>[e.id,e])),r=e.startBinding&&!(`kind`in e.startBinding)?n.get(e.startBinding.shapeId):void 0,i=e.endBinding&&!(`kind`in e.endBinding)?n.get(e.endBinding.shapeId):void 0;return!r||!i||r.id===i.id?e:j(e,A(r,i,{},t))}async function R(e,c,l,p){let h=new Set;if(Array.isArray(e.ids)&&e.ids.forEach(e=>h.add(e)),e.selection&&l.forEach(e=>h.add(e)),h.size===0)return[];let g=d(c,h),_=c.filter(e=>g.has(e.id)),v=_.filter(e=>f.has(e.type));if(v.length<2)return[];let y=new Set(v.map(e=>e.id)),b=_.filter(e=>e.type===`arrow`&&!!e.startBinding&&!(`kind`in e.startBinding)&&!!e.endBinding&&!(`kind`in e.endBinding)&&y.has(e.startBinding.shapeId)&&y.has(e.endBinding.shapeId)&&e.startBinding.shapeId!==e.endBinding.shapeId),x=i(v);if(!x)return[];let S=_.filter(e=>e.type===`figure`),C=(e,n)=>t(s(n),o(e)),w=S.filter(e=>!v.every(t=>C(e,t))),T=e=>u(w,e)?.id,E=new Set,D=v.map(e=>{let t=N(e),n=T(e);return n?(E.add(n),{...t,group:n}):t}),O={kind:`graph`,title:``,direction:e.direction??(x.height>x.width*1.3?`down`:`right`),nodes:D,groups:S.filter(e=>E.has(e.id)).map(e=>({id:e.id,label:m(e)})),edges:b.map(e=>({from:e.startBinding.shapeId,to:e.endBinding.shapeId,label:e.label,dashed:e.dash===`dashed`}))},k=await p.layoutGraph(O),A=k.filter(e=>e.type===`rectangle`||e.type===`icon`||e.type===`sticky`);if(A.length!==v.length)return[];let M=i(A);if(!M)return[];let R=x.x-M.x,z=x.y-M.y,B=new Map,V=new Map;v.forEach((e,t)=>{let n=o(A[t]);V.set(A[t].id,e.id),B.set(e.id,I(e,n.x+R,n.y+z,n.width,n.height))});let H=k.filter(e=>e.type===`arrow`),U=e=>{if(!e||`kind`in e)return e;let t=V.get(e.shapeId);return t?{...e,shapeId:t}:e},W;W=H.length===b.length?b.map((e,t)=>{let i=r(H[t],{x:R,y:z}),a=j(e,i);return a.startBinding=U(a.startBinding),a.endBinding=U(a.endBinding),i.label&&e.label&&!n(e.label)&&(a.label=i.label),a}):[];let G=[],K=new Map(B);W.forEach(e=>K.set(e.id,e));let q=S.filter(e=>E.has(e.id)),J=k.filter(e=>e.type===`figure`);J.length===q.length&&q.forEach((e,t)=>{let n=o(J[t]),r={...e,x:n.x+R,y:n.y+z,width:n.width,height:n.height};G.push(r),K.set(e.id,r)});let Y=new Set(G.map(e=>e.id));for(let e of S){if(Y.has(e.id))continue;let t=i(a(c,e).map(e=>K.get(e.id)).filter(e=>e!==void 0));if(t){let n={...e,x:t.x-P,y:t.y-F,width:t.width+P*2,height:t.height+P+F};G.push(n),K.set(e.id,n)}}if(W.length===0&&b.length>0){let e=c.map(e=>K.get(e.id)??e);W=b.map(t=>L(t,e))}return[...B.values(),...G,...W]}var z=c(),B={resolveIcon:e=>l().resolveIcon(e),glyphAspect:p,layoutDiagram:(e,t)=>x(e,t),layoutGraph:v,measureText:typeof document>`u`?void 0:(e,t,n,r)=>z.measure(e,t,n,r)};function V(e,t,n){return R(e,t,n,B)}export{V as tidyInBrowser};
@@ -1 +0,0 @@
1
- import{Z as e}from"./style-BENGW2ZV.js";import{_ as t,an as n,on as r}from"./slides-D9bnXqtf.js";var i=new Set([`rectangle`,`icon`,`sticky`]);function a(t,i){let a=r(i),o;for(let r of t){let t=n(r);e(a,t)&&(!o||t.width*t.height<o.width*o.height)&&(o=r)}return o}function o(e,n){let r=new Set(n),o=e.filter(e=>e.type===`figure`&&(e.kind??`simple`)===`simple`&&e.slideOrder===void 0);for(let n=0;n<4;n+=1){let n=r.size;for(let n of e)r.has(n.id)&&n.type===`figure`&&t(e,n).forEach(e=>r.add(e.id));for(let t of e){if(!r.has(t.id)||!i.has(t.type))continue;let e=a(o,t);e&&r.add(e.id)}if(r.size===n)break}return r}function s(e,t){if(t.size===0)return!1;let n=o(e,t),r=0;for(let t of e)if(n.has(t.id)&&i.has(t.type)&&(r+=1,r>=2))return!0;return!1}export{a as i,s as n,o as r,i as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{An as r,Cn as i,Dn as a,Fn as o,Gt as s,Ht as c,Mn as l,Nn as u,Pn as d,Ut as f,Wt as p,an as m,at as h,bt as g,dt as _,en as v,ht as ee,in as y,it as b,jn as x,lt as S,mn as C,mt as w,pt as T,rn as E,tn as te,yt as D}from"./useScrollLock-B7mQdXyv.js";import{t as O}from"./FloatingPortalLite-Bf0q6fmL.js";var k=e(t(),1),A=k.createContext(void 0);function ne(){let e=k.useContext(A);if(!e)throw Error(x(73));return e}var j=0;function re(e){return j+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${j}`}function M(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function N(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function P(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var F=e=>e.toastMetadata,I={toasts:r(e=>e.toasts),isEmpty:r(e=>e.toasts.length===0),toast:r(F,(e,t)=>e.get(t)?.value),toastIndex:r(F,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:r(F,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:r(F,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:r(e=>e.hovering),focused:r(e=>e.focused),expanded:r(e=>e.hovering||e.focused),expandedOrOutOfFocus:r(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:r(e=>e.prevFocusElement)},L=class extends i{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:N(e.toasts)},{},I)}setFocused(e){this.set(`focused`,e)}setHovering(e){this.set(`hovering`,e)}setIsWindowFocused(e){this.set(`isWindowFocused`,e)}setPrevFocusElement(e){this.set(`prevFocusElement`,e)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e){let t=this.state.limit!==e.limit;if(this.state.timeout===e.timeout&&!t)return;let n={timeout:e.timeout,limit:e.limit};if(t){let t=P(this.state.toasts,e.limit);n.toasts=t,n.toastMetadata=N(t)}this.update(n)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t={}){let n=I.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t.skipOnRemove||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||re(`toast`);if(e.id){let t=I.toast(this.state,e.id);if(t)if(t.transitionStatus===`ending`)this.removeToast(e.id,{skipOnRemove:!0});else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,{resetTimer:!0,markUpdated:!0}),e.id}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(P(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),I.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{this.updateToastInternal(e,t,{markUpdated:!0})};updateToastInternal=(e,t,n={})=>{let{timeout:r,toasts:i}=this.state,a=I.toast(this.state,e)??null;if(!a||a.transitionStatus===`ending`)return;let o={...a,...t,...n.markUpdated&&{updateKey:(a.updateKey??0)+1}};this.setToasts(i.map(t=>t.id===e?o:t));let s=o.timeout??r,c=a?.timeout??r,l=Object.hasOwn(t,`timeout`),u=o.transitionStatus!==`ending`&&o.type!==`loading`&&s>0,d=this.timers.has(e),f=c!==s,p=a?.type===`loading`;if(!u&&d){this.clearTimer(e);return}u&&(!d||f||l||p||n.resetTimer)&&(this.clearTimer(e),this.scheduleTimer(e,s,()=>this.closeToast(e)),I.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=I.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=P(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n),o={toasts:a,toastMetadata:N(a)};a.some(e=>e.transitionStatus!==`ending`)||(o.hovering=!1,o.focused=!1),this.update(o),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=M(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=M(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=M(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=v.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=s(e);p(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=!I.expandedOrOutOfFocus(this.state),a=i?v.create():void 0;a?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e){let t={toasts:e,toastMetadata:N(e)};e.length===0&&(t.hovering=!1,t.focused=!1),this.update(t)}handleFocusManagement(e){let t=f(y(this.state.viewport));if(!this.state.viewport||!p(this.state.viewport,t)||!c(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=I.toasts(this.state),r=I.toastIndex(this.state,e),i=null,a=r+1;for(;a<n.length;){if(n[a].transitionStatus!==`ending`){i=n[a];break}a+=1}if(!i)for(a=r-1;a>=0;){if(n[a].transitionStatus!==`ending`){i=n[a];break}--a}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}},R=n(),z=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=u(()=>new L({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return d(a.disposeEffect),k.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),l(()=>{a.syncProviderProps({timeout:n,limit:r})},[a,n,r]),(0,R.jsx)(A.Provider,{value:a,children:t})},B=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({}),V=k.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,l=ne(),u=te(),d=k.useRef(!1),h=k.useRef(!1),_=k.useRef(!1),v=l.useState(`isEmpty`),b=l.useState(`toasts`),x=l.useState(`focused`),S=l.useState(`expanded`),w=l.useState(`prevFocusElement`),T=b[0]?.height??0,O=k.useMemo(()=>b.some(e=>e.transitionStatus===`ending`),[b]),A=k.useMemo(()=>b.filter(e=>e.priority===`high`),[b]);k.useEffect(()=>{let e=l.state.viewport;if(!e)return;function t(t){v||t.key===`F6`&&s(t)!==e&&(t.preventDefault(),l.setPrevFocusElement(f(y(e))),e?.focus({preventScroll:!0}),l.pauseTimers(),l.setFocused(!0))}return E(C(e),`keydown`,t)},[l,v]),k.useEffect(()=>{let e=l.state.viewport;if(!e||v)return;let t=C(e);function n(e){s(e)===t&&(l.setIsWindowFocused(!1),l.pauseTimers())}function r(n){if(n.relatedTarget)return;let r=s(n),i=f(y(e));(r===t||!p(e,r)||!c(i))&&l.resumeTimers(),u.start(0,()=>l.setIsWindowFocused(!0))}return m(E(t,`blur`,n,!0),E(t,`focus`,r,!0))},[l,u,v]),k.useEffect(()=>{let e=l.state.viewport;if(!(!e||v))return E(y(e),`pointerdown`,l.handleDocumentPointerDown,!0)},[v,l]);function j(e){let t=l.state.viewport;if(t)if(d.current=!0,e.relatedTarget===t){let e=b.find(e=>e.transitionStatus!==`ending`&&!e.limited);e?e.ref?.current?.focus():l.restoreFocusToPrevElement()}else l.restoreFocusToPrevElement()}function re(e){e.key===`Tab`&&e.shiftKey&&s(e.nativeEvent)===l.state.viewport&&(e.preventDefault(),l.restoreFocusToPrevElement(),l.resumeTimers())}function M(){l.state.toasts.some(e=>e.transitionStatus===`ending`)||_.current||!h.current||(l.state.isWindowFocused&&l.resumeTimers(),l.setHovering(!1),h.current=!1)}k.useEffect(M,[O,l]);function N(){l.pauseTimers(),l.setHovering(!0),h.current=!1}function P(){l.state.isWindowFocused&&l.resumeTimers()}function F(){l.state.toasts.some(e=>e.transitionStatus===`ending`)||_.current?h.current=!0:(P(),l.setHovering(!1))}function I(e){e.pointerType===`touch`&&(_.current=!0)}function L(e){e.pointerType===`touch`&&(_.current=!1,M())}function z(){if(d.current){d.current=!1;return}x||c(f(y(l.state.viewport)))&&(l.setFocused(!0),l.pauseTimers())}function V(e){!x||p(l.state.viewport,e.relatedTarget)||(l.setFocused(!1),P())}let ie={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:N,onMouseMove:N,onMouseLeave:F,onFocus:z,onBlur:V,onKeyDown:re,onClick:z,onPointerDown:I,onPointerUp:L,onPointerCancel:L},ae={expanded:S},H=ee(`div`,e,{ref:[t,l.setViewport],state:ae,props:[ie,{style:{[B.frontmostHeight]:T?`${T}px`:void 0}},o,{children:(0,R.jsxs)(k.Fragment,{children:[!v&&w&&(0,R.jsx)(D,{onFocus:j}),a,!v&&w&&(0,R.jsx)(D,{onFocus:j})]})}]});return(0,R.jsxs)(k.Fragment,{children:[!v&&w&&(0,R.jsx)(D,{onFocus:j}),H,!x&&A.length>0&&(0,R.jsx)(`div`,{style:g,children:A.map(e=>(0,R.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,R.jsx)(`div`,{children:e.title}),(0,R.jsx)(`div`,{children:e.description})]},e.id))})]})}),ie=e(o(),1),ae=k.createContext(void 0);function H(){let e=k.useContext(ae);if(!e)throw Error(x(66));return e}var U=function(e){return e.index=`--toast-index`,e.offsetY=`--toast-offset-y`,e.height=`--toast-height`,e.swipeMovementX=`--toast-swipe-movement-x`,e.swipeMovementY=`--toast-swipe-movement-y`,e}({});function oe(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function se(e){let t=C(e).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var ce={...T,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},le=40,ue=10,W=.5,de=1,fe=`${h},${S}`,G=k.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:o=[`down`,`right`],style:c,...u}=e,d=n.positionerProps?.anchor!==void 0,m=[];d||(m=Array.isArray(o)?o:[o]);let h=m.length>0,g=ne(),[v,b]=k.useState(void 0),[x,S]=k.useState(!1),[C,T]=k.useState(!1),[te,D]=k.useState(!1),[O,A]=k.useState({x:0,y:0}),[j,re]=k.useState({x:0,y:0,scale:1}),[M,N]=k.useState(),[P,F]=k.useState(),[I,L]=k.useState(null),z=k.useRef(null),B=k.useRef({x:0,y:0}),V=k.useRef({x:0,y:0,scale:1}),H=k.useRef(void 0),G=k.useRef(0),K=k.useRef(!1),q=k.useRef({x:0,y:0}),pe=k.useRef(!1),me=k.useRef({x:0,y:0}),J=k.useRef(null),Y=k.useRef(null),X=g.useState(`toastIndex`,n.id),Z=g.useState(`toastVisibleIndex`,n.id),he=g.useState(`toastOffsetY`,n.id),ge=g.useState(`focused`),Q=g.useState(`expanded`);_({open:n.transitionStatus!==`ending`,ref:z,onComplete(){n.transitionStatus===`ending`&&g.removeToast(n.id)}});let $=a((e=!1)=>{let t=z.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){g.updateToastInternal(n.id,{ref:z,height:i,...n.transitionStatus===`starting`?{transitionStatus:void 0}:{}})}e?ie.flushSync(a):a()});l($,[$]);function _e(e){me.current=e,A(e)}l(()=>()=>{Y.current?.abort()},[]);function ve(e,t){let n=e,r=t;return!m.includes(`left`)&&!m.includes(`right`)?n=e>0?e**W:-(Math.abs(e)**W):(!m.includes(`right`)&&e>0&&(n=e**W),!m.includes(`left`)&&e<0&&(n=-(Math.abs(e)**W))),!m.includes(`up`)&&!m.includes(`down`)?r=t>0?t**W:-(Math.abs(t)**W):(!m.includes(`down`)&&t>0&&(r=t**W),!m.includes(`up`)&&t<0&&(r=-(Math.abs(t)**W))),{x:n,y:r}}let ye=a(e=>{if(e.pointerId!==J.current)return;J.current=null,Y.current?.abort(),Y.current=null,S(!1),T(!1),L(null);let t=V.current;if(e.type===`pointercancel`||K.current){_e({x:t.x,y:t.y}),b(void 0);return}let r=!1,i=me.current,a=i.x-t.x,o=i.y-t.y,s;for(let e of m){switch(e){case`right`:a>le&&(r=!0,s=`right`);break;case`left`:a<-40&&(r=!0,s=`left`);break;case`down`:o>le&&(r=!0,s=`down`);break;case`up`:o<-40&&(r=!0,s=`up`);break;default:break}if(r)break}r?(b(s),D(!0),g.closeToast(n.id)):(_e({x:t.x,y:t.y}),b(void 0))});function be(e){if(e.button!==0)return;e.pointerType===`touch`&&g.pauseTimers();let t=s(e.nativeEvent);if(t&&t.closest(`button,a,input,textarea,[role="button"],${fe}`))return;if(K.current=!1,H.current=void 0,G.current=0,J.current=e.pointerId,B.current={x:e.clientX,y:e.clientY},q.current=B.current,z.current){let e=se(z.current);V.current=e,re(e),_e({x:e.x,y:e.y})}g.setHovering(!0),S(!0),T(!1),L(null),pe.current=!0;let n=z.current;if(n){Y.current?.abort();let t=new AbortController;Y.current=t;let r=y(n);r.addEventListener(`pointerup`,ye,{signal:t.signal}),r.addEventListener(`pointercancel`,ye,{signal:t.signal}),n.setPointerCapture?.(e.pointerId)}}function xe(e){if(e.pointerId!==J.current)return;e.preventDefault(),pe.current&&=(B.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>q.current.y||i>0&&t<q.current.y)&&(q.current={x:q.current.x,y:t}),(r<0&&n>q.current.x||r>0&&n<q.current.x)&&(q.current={x:n,y:q.current.y});let a=n-B.current.x,o=t-B.current.y,s=t-q.current.y,c=n-q.current.x;if(!C&&Math.sqrt(a*a+o*o)>=de&&(T(!0),I===null)){let e=m.includes(`left`)||m.includes(`right`),t=m.includes(`up`)||m.includes(`down`);e&&t&&L(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let l;if(!H.current)I===`vertical`?o>0?l=`down`:o<0&&(l=`up`):I===`horizontal`?a>0?l=`right`:a<0&&(l=`left`):l=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,l&&m.includes(l)&&(H.current=l,G.current=oe(l,a,o),b(l));else{let e=H.current,t=oe(e,c,s);t>le?(K.current=!1,b(e)):!(m.includes(`left`)&&m.includes(`right`))&&!(m.includes(`up`)&&m.includes(`down`))&&G.current-t>=ue&&(K.current=!0)}let u=ve(a,o),d=V.current.x,f=V.current.y;I===`horizontal`?(m.includes(`left`)||m.includes(`right`))&&(d+=u.x):(I===`vertical`||(m.includes(`left`)||m.includes(`right`))&&(d+=u.x),(m.includes(`up`)||m.includes(`down`))&&(f+=u.y)),_e({x:d,y:f})}function Se(e){if(e.key===`Escape`){if(!z.current||!p(z.current,f(y(z.current))))return;g.closeToast(n.id)}}k.useEffect(()=>{if(!h)return;let e=z.current;if(!e)return;function t(t){J.current===null||!p(e,s(t))||t.preventDefault()}return E(e,`touchmove`,t,{passive:!1})},[h]);function Ce(){if(!x&&O.x===j.x&&O.y===j.y&&!te)return{[U.swipeMovementX]:`0px`,[U.swipeMovementY]:`0px`};let e=O.x-j.x,t=O.y-j.y;return{transition:x?`none`:void 0,transform:x?`translateX(${O.x}px) translateY(${O.y}px) scale(${j.scale})`:void 0,[U.swipeMovementX]:`${e}px`,[U.swipeMovementY]:`${t}px`}}let we=n.priority===`high`,Te={role:we?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":M,"aria-describedby":P,"aria-hidden":we&&!ge?!0:void 0,onPointerDown:h?be:void 0,onPointerMove:h?xe:void 0,onPointerUp:h?ye:void 0,onPointerCancel:h?ye:void 0,onKeyDown:Se,inert:w(n.limited),style:{...Ce(),[U.index]:n.transitionStatus===`ending`?X:Z,[U.offsetY]:`${he}px`,[U.height]:n.height?`${n.height}px`:void 0}},Ee=k.useMemo(()=>({rootRef:z,toast:n,titleId:M,setTitleId:N,descriptionId:P,setDescriptionId:F,swiping:x,swipeDirection:v,recalculateHeight:$,index:X,visibleIndex:Z,expanded:Q}),[n,M,P,x,v,$,X,Z,Q]),De={transitionStatus:n.transitionStatus,expanded:Q,limited:n.limited||!1,type:n.type,swiping:Ee.swiping,swipeDirection:Ee.swipeDirection},Oe=ee(`div`,e,{ref:[t,Ee.rootRef],state:De,stateAttributesMapping:ce,props:[Te,u]});return(0,R.jsx)(ae.Provider,{value:Ee,children:Oe})}),K=k.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{toast:c,setTitleId:u}=H(),d=o??c.title,f=!!d,p=b(a);l(()=>{if(f)return u(p),()=>{u(void 0)}},[f,p,u]);let m=ee(`h2`,e,{ref:t,state:{type:c.type},props:{...s,id:p,children:d}});return f?m:null}),q=O;function pe(){let e=k.useContext(A);if(!e)throw Error(x(73));let t=e.useState(`toasts`);return k.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function me(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||re(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}function J(e=me()){let t=null;function n(n){t!==null&&e.close(t);let r=e.add({title:n,timeout:2600,onClose:()=>{t===r&&(t=null)}});t=r}return{manager:e,notify:n}}var Y=[`absolute bottom-0 right-0 z-[calc(1000-var(--toast-index))]`,`w-max select-none rounded-full bg-[var(--chrome-accent)] px-3.5 py-2 text-[13px] text-white`,`shadow-[0_8px_30px_rgba(0,0,0,0.22)] transition-all duration-300 ease-out`,`data-[starting-style]:translate-x-[110%] data-[starting-style]:opacity-0`,`data-[ending-style]:translate-x-[110%] data-[ending-style]:opacity-0`].join(` `);function X(){let{toasts:e}=pe();return e.map(e=>(0,R.jsx)(G,{toast:e,className:Y,swipeDirection:`right`,children:(0,R.jsx)(K,{})},e.id))}var Z=(0,k.createContext)(null);function he(e){let{controller:t,children:n}=e;return(0,R.jsx)(Z.Provider,{value:t,children:(0,R.jsxs)(z,{toastManager:t.manager,children:[n,(0,R.jsx)(q,{children:(0,R.jsx)(V,{"data-overlay":!0,"data-testid":`toast-viewport`,className:`fixed bottom-4 right-4 z-50`,children:(0,R.jsx)(X,{})})})]})})}var ge=()=>{};function Q(){let e=(0,k.useContext)(Z);return{notify:e?e.notify:ge}}export{J as n,Q as r,he as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{i as r,r as i}from"./config-a_lz-57R.js";import{o as a}from"./editor-B0tARd79.js";import{n as o}from"./tool-catalog-CHq6TJ2q.js";import{a as s,i as c,r as l,t as u}from"./PopoverPopup-BqGWd_uB.js";import{n as d}from"./storage-CvDRYh5V.js";import{s as f}from"./chrome-C2RCq3SI.js";import{CommandList as p}from"./command-palette-BjFnQHnz.js";import{t as m}from"./use-recent-list-BEG0iBIm.js";var h=e(t(),1),g=n(),_=`[data-canvas-toolbar]`,v=8;function y(e){let{onPick:t,onClose:n}=e,{ai:y}=r(),b=i()!==null,x=a(e=>e.deviceMode===`phone`),[S,C]=(0,h.useState)();(0,h.useLayoutEffect)(()=>{if(x){C(void 0);return}let e=()=>{let e=document.querySelector(_);e&&C(e.getBoundingClientRect().height)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[x]);let{recent:w,remember:T}=m(d.recentTools,v,{sanitize:e=>e.filter(e=>typeof e==`string`)}),E=(0,h.useRef)(T);E.current=T;let D=(0,h.useMemo)(()=>{let e=(e,r)=>({id:e.id,label:e.label,group:r,hint:e.shortcut,keywords:e.keywords,icon:e.icon,run:()=>{t(e.action),E.current(e.id),n()}}),r=o(w,{ai:y,comments:b});return[...r.recent.map(t=>e(t,`Recent`)),...r.rest.map(t=>e(t,t.group))]},[w,t,n,y,b]);return(0,g.jsx)(s,{open:!0,modal:!1,onOpenChange:e=>{e||n()},children:(0,g.jsx)(c,{children:(0,g.jsx)(l,{anchor:()=>document.querySelector(_),side:x?`top`:`right`,align:`start`,sideOffset:8,collisionPadding:8,children:(0,g.jsx)(u,{finalFocus:!1,initialFocus:!x&&void 0,children:(0,g.jsx)(`div`,{"data-overlay":!0,"data-testid":`tool-drawer`,className:`flex w-64 flex-col overflow-hidden rounded-xl ${x?`max-h-[55dvh]`:`max-h-[calc(100dvh-72px)]`} ${f}`,style:{maxHeight:S},children:(0,g.jsx)(p,{commands:D,onRun:e=>e.run(),placeholder:`Search all tools`,inputTestId:`tool-drawer-input`,itemTestId:e=>`tool-${e}`,emptyLabel:`No matching tools`,dense:!0,listClassName:`min-h-0 p-1`})})})})})})}export{y as ToolDrawer};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{$t as r,A as i,An as a,C as o,Cn as s,Dn as c,Fn as l,Gt as u,H as d,Ht as f,I as p,It as m,K as h,Mn as g,Mt as _,On as v,Q as y,U as b,Ut as x,V as S,Vt as C,Wt as w,Y as T,Zt as E,_n as D,_t as O,a as k,an as A,b as j,c as ee,d as M,dt as N,en as P,f as F,gn as I,ht as L,in as R,jn as z,kn as B,l as V,m as H,mn as U,nt as W,o as te,p as ne,pt as re,rn as G,rt as ie,tn as ae,tt as K,u as oe,ut as se,v as ce,w as le,x as ue,y as de,zt as fe}from"./useScrollLock-B7mQdXyv.js";import{c as pe,d as me,f as he,i as ge,l as _e,n as ve,o as ye,r as be,s as xe,t as Se,u as q}from"./usePositioner-DA3aR0-T.js";import{t as Ce}from"./FloatingPortalLite-Bf0q6fmL.js";import{o as we}from"./editor-B0tARd79.js";import{n as Te}from"./keys-DrjiT9FL.js";import{t as Ee}from"./useBaseUiId-C0Zm5sUV.js";var J=e(t(),1),Y=n(),De=J.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new P,currentIdRef:{current:null},currentContextRef:{current:null}});function Oe(e,t){e.current=t.current}function ke(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=J.useRef(n),a=J.useRef(n),o=J.useRef(null),s=J.useRef(null),c=ae();return g(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:q(i.current,`open`),close:q(n,`close`)}},[n,o,i,a]),(0,Y.jsx)(De.Provider,{value:J.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Ae(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=J.useContext(De),[f,p]=J.useState(!1),m=J.useRef(n),h=J.useRef(!1);return g(()=>{m.current=n},[n]),g(()=>()=>{h.current=!0},[]),g(()=>{function e(){h.current||p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),g(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:q(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,b(y))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),g(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,Oe(o,c),d.clear()}},[l,a,o,i,c,d]),J.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function je(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Me(e){return e!=null&&e.clientX!=null}function Ne(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),l=i.context.dataRef,d=J.useRef(!1),f=J.useRef(null),[p,m]=J.useState(),[h,g]=J.useState([]),v=c(e=>{i.set(`positionReference`,e)}),y=c((e,t,n)=>{d.current||l.current.openEvent&&!Me(l.current.openEvent)||i.set(`positionReference`,je(n??s,{x:e,y:t,axis:r,dataRef:l,pointerType:p}))}),b=c(e=>{a?f.current||(y(e.clientX,e.clientY,e.currentTarget),g([])):y(e.clientX,e.clientY,e.currentTarget)}),x=_(p)?o:a;J.useEffect(()=>{if(!n){v(s);return}if(!x)return;function e(){f.current?.(),f.current=null}let t=U(o);function r(t){let n=u(t);w(o,n)?e():y(t.clientX,t.clientY)}return!l.current.openEvent||Me(l.current.openEvent)?f.current=G(t,`mousemove`,r):v(s),e},[x,n,o,l,s,i,y,v,h]),J.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),J.useEffect(()=>{n&&!o&&(d.current=!1)},[n,o]),J.useEffect(()=>{!n&&a&&(d.current=!0)},[n,a]);let S=J.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:b,onMouseEnter:b}},[b]);return J.useMemo(()=>n?{reference:S,trigger:S}:{},[n,S])}var Pe=r&&E;function Fe(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=J.useRef(!1),c=J.useRef(null),l=J.useRef(!0),d=ae();J.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=U(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&D(e)&&e===x(R(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return A(G(t,`blur`,r),Pe&&G(t,`keydown`,a,!0),Pe&&G(t,`pointerdown`,o,!0))},[i,n]),J.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);I(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let p=J.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=u(t.nativeEvent);if(I(a)){if(Pe&&!t.relatedTarget){if(!l.current&&!C(a))return}else if(!f(a))return}let o=fe(t.relatedTarget,i.context.triggerElements),{nativeEvent:p,currentTarget:m}=t,h=typeof r==`function`?r():r;if(i.select(`open`)&&o||h===0||h===void 0){i.setOpen(!0,b(K,p,m));return}d.start(h,()=>{s.current||i.setOpen(!0,b(K,p,m))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=I(n)&&n.hasAttribute(S(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;d.start(0,()=>{let e=i.select(`domReferenceElement`),t=x(R(e));!n&&t===e||w(o.current.floatingContext?.refs.floating.current,t)||w(e,t)||a||fe(n??t,i.context.triggerElements)||i.setOpen(!1,b(K,r))})}}},[o,r,i,d]);return J.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}var Ie=e(l(),1),Le={current:null};function Re(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:l=Le,externalTree:f,isActiveTrigger:m=!0,getHandleCloseContext:h,isClosing:g,shouldOpen:v}=t,y=`rootStore`in e?e.rootStore:e,{dataRef:x,events:S}=y.context,C=p(f),T=_e(y),E=J.useRef(!1),D=d(i),O=d(r),k=d(o),j=d(n),ee=d(v),M=d(g),N=c(()=>he(x.current.openEvent?.type,T.interactedInside)),P=c(()=>ee.current?.()!==!1),F=c((e,t,n)=>{let r=y.context.triggerElements;if(r.hasElement(t))return!e||!w(e,t);if(!I(n))return!1;let i=n;return r.hasMatchingElement(e=>w(e,i))&&(!e||!w(e,i))}),L=c(()=>{T.handler&&=(R(y.select(`domReferenceElement`)).removeEventListener(`mousemove`,T.handler),void 0)}),z=c(()=>{pe(T)});return m&&(T.handleCloseOptions=D.current?.__options),J.useEffect(()=>L,[L]),J.useEffect(()=>{if(!n)return;function e(e){e.open?E.current=!1:(E.current=e.reason===W,L(),T.openChangeTimeout.clear(),T.restTimeout.clear(),T.blockMouseMove=!0,T.restTimeoutPending=!1)}return S.on(`openchange`,e),()=>{S.off(`openchange`,e)}},[n,S,T,L]),J.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=q(O.current,`close`,T.pointerType);n?T.openChangeTimeout.start(n,()=>{y.setOpen(!1,b(W,e)),C?.events.emit(`floating.closed`,e)}):t&&(T.openChangeTimeout.clear(),y.setOpen(!1,b(W,e)),C?.events.emit(`floating.closed`,e))}let t=l.current??(m?y.select(`domReferenceElement`):null);if(!I(t))return;function r(e){if(T.openChangeTimeout.clear(),T.blockMouseMove=!1,a&&!_(T.pointerType))return;let t=me(k.current),n=q(O.current,`open`,T.pointerType),r=u(e),i=e.currentTarget??null,o=y.select(`domReferenceElement`),s=i;if(I(r)&&!y.context.triggerElements.hasElement(r)){for(let e of y.context.triggerElements.elements())if(w(e,r)){s=e;break}}I(i)&&I(o)&&!y.context.triggerElements.hasElement(i)&&w(i,o)&&(s=o);let c=s!=null&&F(o,s,r),l=y.select(`open`),d=M.current?.()??y.select(`transitionStatus`)===`ending`,f=!l&&d&&E.current,p=!c&&I(s)&&I(o)&&w(o,s)&&f,m=t>0&&!n,h=c&&(l||f)||p,g=!l||c;if(h){P()&&y.setOpen(!0,b(W,e,s));return}m||(n?T.openChangeTimeout.start(n,()=>{g&&P()&&y.setOpen(!0,b(W,e,s))}):g&&P()&&y.setOpen(!0,b(W,e,s)))}function i(t){if(N()){z();return}L();let n=R(y.select(`domReferenceElement`));T.restTimeout.clear(),T.restTimeoutPending=!1;let r=x.current.floatingContext??h?.();if(!fe(t.relatedTarget,y.context.triggerElements)){if(D.current&&r){y.select(`open`)||T.openChangeTimeout.clear();let i=l.current;T.handler=D.current({...r,tree:C,x:t.clientX,y:t.clientY,onClose(){z(),L(),j.current&&!N()&&i===y.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,T.handler),T.handler(t);return}(T.pointerType!==`touch`||!w(y.select(`floatingElement`),t.relatedTarget))&&e(t)}}return s?A(G(t,`mousemove`,r,{once:!0}),G(t,`mouseenter`,r),G(t,`mouseleave`,i)):A(G(t,`mouseenter`,r),G(t,`mouseleave`,i))},[L,z,x,O,y,n,D,T,m,F,N,a,s,k,l,C,j,h,M,P]),J.useMemo(()=>{if(!n)return;function e(e){T.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=y.select(`domReferenceElement`),i=y.select(`open`),o=F(r,n,e.target);if(a&&!_(T.pointerType))return;if(i&&o&&T.handleCloseOptions?.blockPointerEvents){let e=y.select(`floatingElement`);if(e){let t=T.handleCloseOptions?.getScope?.()??n.ownerDocument.body;xe(T,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=me(k.current);if(i&&!o||s===0||!o&&T.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;T.restTimeout.clear();function c(){if(T.restTimeoutPending=!1,N())return;let e=y.select(`open`);!T.blockMouseMove&&(!e||o)&&P()&&y.setOpen(!0,b(W,t,n))}T.pointerType===`touch`?Ie.flushSync(()=>{c()}):o&&i?c():(T.restTimeoutPending=!0,T.restTimeout.start(s,c))}}},[n,T,N,F,a,y,k,P])}var ze=.1,Be=ze*ze,X=.5;function Z(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Q(e,t,n,r,i,a,o,s,c,l){let u=!1;return Z(e,t,n,r,i,a)&&(u=!u),Z(e,t,i,a,o,s)&&(u=!u),Z(e,t,o,s,c,l)&&(u=!u),Z(e,t,c,l,n,r)&&(u=!u),u}function Ve(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function $(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function He(e={}){let{blockPointerEvents:t=!1}=e,n=new P,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,d=null,f=null,p=typeof performance<`u`?performance.now():0;function h(e,t){let n=performance.now(),r=n-p;if(d===null||f===null||r===0)return d=e,f=t,p=n,!1;let i=e-d,a=t-f,o=i*i+a*a,s=r*r*Be;return d=e,f=t,p=n,o<s}function g(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,d=i.floating;if(!a||!d||c==null||e==null||t==null)return;let{clientX:f,clientY:p}=r,_=u(r),v=r.type===`mouseleave`,y=w(d,_),b=w(a,_);if(y&&(l=!0,!v))return;if(b&&(l=!1,!v)){l=!0;return}if(v&&I(r.relatedTarget)&&w(d,r.relatedTarget))return;function x(){return!!(s&&m(s.nodesRef.current,o).length>0)}function S(){x()||g()}if(x())return;let C=a.getBoundingClientRect(),T=d.getBoundingClientRect(),E=e>T.right-T.width/2,D=t>T.bottom-T.height/2,O=T.width>C.width,k=T.height>C.height,A=(O?C:T).left,j=(O?C:T).right,ee=(k?C:T).top,M=(k?C:T).bottom;if(c===`top`&&t>=C.bottom-1||c===`bottom`&&t<=C.top+1||c===`left`&&e>=C.right-1||c===`right`&&e<=C.left+1){S();return}let N=!1;switch(c){case`top`:N=$(f,p,A,C.top+1,j,T.bottom-1);break;case`bottom`:N=$(f,p,A,T.top+1,j,C.bottom-1);break;case`left`:N=$(f,p,T.right-1,M,C.left+1,ee);break;case`right`:N=$(f,p,C.right-1,M,T.left+1,ee);break;default:}if(N)return;if(l&&!Ve(f,p,C)){S();return}if(!v&&h(f,p)){S();return}let P=!1;switch(c){case`top`:{let n=O?X/2:X*4,r=O||E?e+n:e-n,i=O?e-n:E?e+n:e-n,a=t+X+1,o=E||O?T.bottom-X:T.top,s=E?O?T.bottom-X:T.top:T.bottom-X;P=Q(f,p,r,a,i,a,T.left,o,T.right,s);break}case`bottom`:{let n=O?X/2:X*4,r=O||E?e+n:e-n,i=O?e-n:E?e+n:e-n,a=t-X,o=E||O?T.top+X:T.bottom,s=E?O?T.top+X:T.bottom:T.top+X;P=Q(f,p,r,a,i,a,T.left,o,T.right,s);break}case`left`:{let n=k?X/2:X*4,r=k||D?t+n:t-n,i=k?t-n:D?t+n:t-n,a=e+X+1,o=D||k?T.right-X:T.left,s=D?k?T.right-X:T.left:T.right-X;P=Q(f,p,o,T.top,s,T.bottom,a,r,a,i);break}case`right`:{let n=k?X/2:X*4,r=k||D?t+n:t-n,i=k?t-n:D?t+n:t-n,a=e-X,o=D||k?T.left+X:T.right,s=D?k?T.left+X:T.right:T.left+X;P=Q(f,p,a,r,a,i,o,T.top,s,T.bottom);break}default:}P?l||n.start(40,S):S()}};return r.__options={...e,blockPointerEvents:t},r}var Ue=J.createContext(void 0);function We(e){let t=J.useContext(Ue);if(t===void 0&&!e)throw Error(z(72));return t}var Ge={...M,disabled:a(e=>e.disabled),instantType:a(e=>e.instantType),isInstantPhase:a(e=>e.isInstantPhase),trackCursorAxis:a(e=>e.trackCursorAxis),disableHoverablePopup:a(e=>e.disableHoverablePopup),lastOpenChangeReason:a(e=>e.openChangeReason),closeOnClick:a(e=>e.closeOnClick),closeDelay:a(e=>e.closeDelay),hasViewport:a(e=>e.hasViewport)},Ke=class e extends s{constructor(e,t,n=!1){let r=new F,i={...qe(),...e};i.floatingRootContext=oe(r,t,n),super(i,{popupRef:J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:r},Ge)}setOpen=(e,t)=>{H(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,b(ie,e))}static useStore(t,n){return o(t,(t,r)=>new e(n,t,r)).store}};function qe(){return{...V(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var Je=v(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Ke.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});de(p,r,n,d),p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),_=!t&&m,v=p.useState(`activeTriggerId`),y=p.useState(`mounted`),x=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),p.useSyncedValue(`disabled`,t),ce(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:S,transitionStatus:C}=j(_,p),w=p.useState(`isInstantPhase`),E=p.useState(`instantType`),D=p.useState(`lastOpenChangeReason`),O=J.useRef(null);g(()=>{m&&t&&p.setOpen(!1,b(h))},[m,t,p]),g(()=>{C===`ending`&&D===`none`||C!==`ending`&&w?(E!==`delay`&&(O.current=E),p.set(`instantType`,`delay`)):O.current!==null&&(p.set(`instantType`,O.current),O.current=null)},[C,w,D,E,p]),g(()=>{_&&(v??p.set(`payload`,void 0))},[p,v,_]);let k=J.useCallback(()=>{p.setOpen(!1,b(T))},[p]);J.useImperativeHandle(o,()=>({unmount:S,close:k}),[S,k]);let A=_||y||!t&&a!==`none`;return(0,Y.jsxs)(Ue.Provider,{value:p,children:[A&&(0,Y.jsx)(Ye,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:x}):f]})});function Ye({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),a=i(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),o=Ne(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n});return ue(e,{activeTriggerProps:J.useMemo(()=>O(o.reference,a.reference),[o.reference,a.reference]),inactiveTriggerProps:J.useMemo(()=>O(o.trigger,a.trigger),[o.trigger,a.trigger]),popupProps:J.useMemo(()=>O(ne,o.floating,a.floating),[o.floating,a.floating])}),null}var Xe=J.createContext(void 0);function Ze(){return J.useContext(Xe)}var Qe=function(e){return e[e.popupOpen=k.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),$e=`data-base-ui-tooltip-trigger`;function et(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(I(n))return n}}let t=e.target;return I(t)?t:null}function tt(e){let t=e;for(;t;){if(t.hasAttribute($e))return t;let e=t.parentElement;if(e){t=e;continue}let n=t.getRootNode();t=`host`in n&&I(n.host)?n.host:null}return null}var nt=B(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:f,...p}=e,m=We(!0),h=a?.store??m;if(!h)throw Error(z(82));let g=Ee(f),v=h.useState(`isTriggerActive`,g),y=h.useState(`isOpenedByTrigger`,g),x=h.useState(`floatingRootContext`),S=J.useRef(null),C=c??600,T=u??0,{registerTrigger:E,isMountedByThisTrigger:D}=le(g,S,h,{payload:o,closeOnClick:l,closeDelay:T}),O=Ze(),{delayRef:k,isInstantPhase:A,hasProvider:j}=Ae(x,{open:y}),M=_e(x);h.useSyncedValue(`isInstantPhase`,A);let N=h.useState(`disabled`),P=s??N,F=d(P),I=h.useState(`trackCursorAxis`),R=h.useState(`disableHoverablePopup`),B=J.useRef(!1),V=ae(),H=J.useRef(void 0);function U(){let e=O?.delay,t=typeof k.current==`object`?k.current.open:void 0,n=C;return j&&(n=t===0?0:c??e??C),n}function te(e){let t=S.current;if(!t||!e)return!1;let n=tt(e);return n!==null&&n!==t&&w(t,n)}function ne(e){let t=te(e);return B.current=t,t&&(M.openChangeTimeout.clear(),M.restTimeout.clear(),M.restTimeoutPending=!1,V.clear()),t}let re=Re(x,{enabled:!P,mouseOnly:!0,move:!1,handleClose:!R&&I!==`both`?He():null,restMs:U,delay(){let e=typeof k.current==`object`?k.current.close:void 0,t=T;return u==null&&j&&(t=e),{close:t}},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!B.current}}),G=Fe(x,{enabled:!P}).reference,ie=e=>{let t=B.current,n=et(e),r=ne(n),i=S.current,a=i&&n&&w(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`){h.setOpen(!1,b(W,e));return}if(t&&!r&&a&&!F.current&&!h.select(`open`)&&i&&_(H.current)){let t=()=>{!B.current&&!F.current&&!h.select(`open`)&&h.setOpen(!0,b(W,e,i))},n=U();n===0?(V.clear(),t()):V.start(n,t)}},K=h.useState(`triggerProps`,D);return L(`button`,e,{state:{open:y},ref:[t,E,S],props:[re,G,D||I!==`none`?K:void 0,{onMouseOver(e){ie(e.nativeEvent)},onFocus(e){te(et(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){B.current=!1,V.clear(),H.current=void 0},onPointerEnter(e){H.current=e.pointerType},onPointerDown(e){H.current=e.pointerType,h.set(`closeOnClick`,l),l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},id:g,[Qe.triggerDisabled]:P?``:void 0,[$e]:P?void 0:``},p],stateAttributesMapping:ee})}),rt=J.createContext(void 0);function it(){let e=J.useContext(rt);if(e===void 0)throw Error(z(70));return e}var at=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return We().useState(`mounted`)||n?(0,Y.jsx)(rt.Provider,{value:n,children:(0,Y.jsx)(Ce,{ref:t,...r})}):null}),ot=J.createContext(void 0);function st(){let e=J.useContext(ot);if(e===void 0)throw Error(z(71));return e}var ct=J.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=se,style:g,..._}=e,v=We(),y=it(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=be({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`hasViewport`)?ge:void 0}),O=Se(e,J.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,Y.jsx)(ot.Provider,{value:D,children:O})}),lt={...te,...re},ut=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=We(),{side:s,align:c}=st(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);N({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),ye(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return L(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[f,ve(d),a],stateAttributesMapping:lt})}),dt=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=J.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=J.useMemo(()=>({open:t,close:n}),[t,n]);return(0,Y.jsx)(Xe.Provider,{value:i,children:(0,Y.jsx)(ke,{delay:a,timeoutMs:r,children:e.children})})};function ft(e){let{label:t,shortcut:n,side:r=`top`,sideOffset:i=8,leading:a,disabled:o,testId:s,children:c}=e;return we(e=>e.coarsePointer)?c:(0,Y.jsxs)(Je,{disableHoverablePopup:!0,disabled:o,children:[(0,Y.jsx)(nt,{render:c}),(0,Y.jsx)(at,{children:(0,Y.jsx)(ct,{side:r,sideOffset:i,children:(0,Y.jsxs)(ut,{"data-testid":s,className:`pointer-events-none flex items-center gap-1.5 rounded-md bg-[var(--chrome-accent)] px-2 py-1 text-[11px] text-white shadow-md`,children:[a,(0,Y.jsx)(`span`,{children:t}),n?(0,Y.jsx)(`span`,{className:`text-[var(--chrome-fg-400)]`,children:Te(n)}):null]})})})]})}export{Fe as a,Re as i,dt as n,He as r,ft as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{Dn as r,En as i,Mn as a,Nn as o,Q as s,Tn as c,U as l,_t as u,bt as d,gn as f,ht as p,jn as m,mn as h,vt as g,xt as _}from"./useScrollLock-B7mQdXyv.js";import{t as v}from"./useButton-D3eS7fh5.js";import{n as y}from"./config-a_lz-57R.js";import{t as b}from"./createReactComponent-9UsI5fmM.js";import{n as x,t as ee}from"./useValueChanged-p8z-93L4.js";import{n as S,r as C,t as te}from"./useControlled-C5xhvPXX.js";import{a as w,c as ne,i as T,l as E,o as D,r as O,s as re}from"./billing-C-BNGM3Z.js";import{t as ie}from"./IconLoader2-BQaF1LKo.js";import{t as k}from"./IconPencil-C5Y-Y4dC.js";import{t as ae}from"./IconPhoto-CR36IK-b.js";import{t as A}from"./IconSparkles-WDcg8BA9.js";import{t as oe}from"./IconUsers-Bwnyj4mm.js";import{t as j}from"./IconX-AlbPkO_g.js";import{t as M}from"./useBaseUiId-C0Zm5sUV.js";import{n as N}from"./surface-Dke4SWpE.js";import{i as P,n as F,r as I,t as L}from"./DialogRoot-mHGRFW9m.js";import{n as se,t as R}from"./DialogTitle-CFhr-gP9.js";import{t as z}from"./DialogDescription-ZtZCUsfy.js";import{n as B}from"./dialog-B32krrce.js";var V=b(`outline`,`infinity`,`Infinity`,[[`path`,{d:`M9.828 9.172a4 4 0 1 0 0 5.656a10 10 0 0 0 2.172 -2.828a10 10 0 0 1 2.172 -2.828a4 4 0 1 1 0 5.656a10 10 0 0 1 -2.172 -2.828a10 10 0 0 0 -2.172 -2.828`,key:`svg-0`}]]),H=e(t(),1),U=H.createContext(void 0);function W(){let e=H.useContext(U);if(e===void 0)throw Error(m(63));return e}var G=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),K={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},q={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},J={disabled:!1,...q},ce={valid(e){return e===null?null:e?{[G.valid]:``}:{[G.invalid]:``}}},Y=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),le={...ce,checked(e){return e?{[Y.checked]:``}:{[Y.unchecked]:``}}},ue={invalid:void 0,name:void 0,validityData:{state:K,errors:[],error:``,value:``,initialValue:null},setValidityData:i,disabled:void 0,touched:q.touched,setTouched:i,dirty:q.dirty,setDirty:i,filled:q.filled,setFilled:i,focused:q.focused,setFocused:i,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:J,markedDirtyRef:{current:!1},registerFieldControl:i,validation:{getValidationProps:(e,t=c)=>t,inputRef:{current:null},registerInput:i,commit:async()=>{},change:i}},de=H.createContext(ue);function X(e=!0){let t=H.useContext(de);if(t.setValidityData===i&&!e)throw Error(m(28));return t}function fe(e,t,n,r,i=!0,o){let{registerFieldControl:s}=X(),c=H.useRef(null);c.current||=Symbol(),a(()=>{let a=c.current;if(!(!a||!i))return s(a,{controlRef:e,getValue:r,id:t,name:o,value:n}),()=>{s(a,void 0)}},[e,i,r,t,o,s,n])}var pe=H.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:i,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function me(){return H.useContext(pe)}var he=H.createContext({controlId:void 0,registerControlId:i,labelId:void 0,setLabelId:i,messageIds:[],setMessageIds:i,getDescriptionProps:e=>e});function ge(){return H.useContext(he)}function _e(e,t,n,r=!0,i){let[o,s]=H.useState(),c=M(i?`${i}-label`:void 0),l=e??t??o;return a(()=>{let i=e||t||!r?void 0:Z(n.current,c);o!==i&&s(i)}),l}function Z(e,t){let n=ve(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function ve(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function ye(e={}){let{id:t,implicit:n=!1,controlRef:s}=e,{controlId:c,registerControlId:l}=ge(),u=M(t),d=n?c:void 0,p=o(()=>Symbol(`labelable-control`)),m=H.useRef(!1),h=H.useRef(t!=null),g=r(()=>{!m.current||l===i||(m.current=!1,l(p.current,void 0))});return a(()=>{if(l===i)return;let e;if(n){let n=s?.current;e=f(n)&&n.closest(`label`)!=null?t??null:d??u}else if(t!=null)h.current=!0,e=t;else if(h.current)e=u;else{g();return}if(e===void 0){g();return}m.current=!0,l(p.current,e)},[t,s,d,l,n,u,p,g]),H.useEffect(()=>g,[g]),c??u}var Q=n(),be=H.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":o,form:f,id:m,inputRef:y,name:b,nativeButton:x=!1,onCheckedChange:S,readOnly:C=!1,required:w=!1,disabled:ne=!1,render:T,uncheckedValue:E,value:D,style:O,...re}=e,{clearErrors:ie}=me(),{state:k,setTouched:ae,setDirty:A,validityData:oe,setFilled:j,setFocused:N,validationMode:P,disabled:F,name:I,validation:L}=X(),{labelId:se}=ge(),R=F||ne,z=I??b,B=H.useRef(null),V=g(B,y,L.inputRef),W=H.useRef(null),G=M(),K=ye({id:m,implicit:!1,controlRef:W}),q=x?void 0:K,[J,ce]=te({controlled:n,default:!!i,name:`Switch`,state:`checked`});fe(W,G,J,void 0,!R,b),a(()=>{B.current&&j(B.current.checked)},[B,j]),ee(J,()=>{ie(z),A(J!==oe.initialValue),j(J),L.change(J)});let{getButtonProps:Y,buttonRef:ue}=v({disabled:R,native:x}),de=_e(o,se,B,!x,q),pe={id:x?K:G,role:`switch`,"aria-checked":J,"aria-readonly":C||void 0,"aria-required":w||void 0,"aria-labelledby":de,onFocus(){R||N(!0)},onBlur(){let e=B.current;!e||R||(ae(!0),N(!1),P===`onBlur`&&L.commit(e.checked))},onClick(e){if(C||R)return;e.preventDefault();let t=B.current;t&&t.dispatchEvent(new(h(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},he=u({checked:J,disabled:R,form:f,id:q,name:z,required:w,style:z?_:d,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:V,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(C){e.preventDefault();return}let t=e.currentTarget.checked,n=l(s,e.nativeEvent);S?.(t,n),!n.isCanceled&&ce(t)},onFocus(){W.current?.focus()}},e=>L.getValidationProps(R,e),D===void 0?c:{value:D}),Z=H.useMemo(()=>({...k,checked:J,disabled:R,readOnly:C,required:w}),[k,J,R,C,w]),ve=p(`span`,e,{state:Z,ref:[t,W,ue],props:[pe,re,Y,e=>L.getValidationProps(R,e)],stateAttributesMapping:le});return(0,Q.jsxs)(U.Provider,{value:Z,children:[ve,!J&&z&&E!==void 0&&(0,Q.jsx)(`input`,{type:`hidden`,form:f,name:z,value:E,disabled:R}),(0,Q.jsx)(`input`,{...he,suppressHydrationWarning:!0})]})}),xe=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return p(`span`,e,{state:W(),ref:t,stateAttributesMapping:le,props:a})});function Se(e){let{testId:t,sellable:n,currentLabel:r,busy:i,busyLabel:a,ctaLabel:o,chargeLine:s,holdChargeLine:c,error:l,secondaryLabel:u,onSecondary:d,leadWithSecondary:f,onSubmit:p}=e,m=f&&u!=null&&d!=null;return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[m?(0,Q.jsx)(`button`,{type:`button`,onClick:d,"data-testid":`${t}-secondary`,className:`flex h-10 cursor-pointer items-center justify-center gap-2 rounded-xl bg-[var(--chrome-accent)] px-4 text-[14px] text-white outline-none transition-colors active:scale-[0.97] hover:bg-[var(--chrome-accent-hover)]`,children:u}):n?(0,Q.jsxs)(`button`,{type:`button`,onClick:p,disabled:i,"data-testid":`${t}-accept`,className:`flex h-10 cursor-pointer items-center justify-center gap-2 rounded-xl bg-[var(--chrome-accent)] px-4 text-[14px] text-white outline-none transition-colors active:scale-[0.97] hover:bg-[var(--chrome-accent-hover)] disabled:cursor-default disabled:opacity-60 disabled:active:scale-100`,children:[i&&(0,Q.jsx)(ie,{size:15,stroke:2.5,className:`animate-spin`}),i?a:o]}):(0,Q.jsx)(`button`,{type:`button`,disabled:!0,"data-testid":`${t}-current`,className:`flex h-10 items-center justify-center rounded-xl px-4 text-[13.5px] text-[var(--chrome-fg-400)] ring-1 ring-[var(--chrome-ring)]`,children:r}),(n||c)&&(0,Q.jsx)(`span`,{"data-testid":`${t}-charge`,className:`text-center text-[11.5px] text-[var(--chrome-fg-400)]`,children:n?s:`\xA0`}),l&&(0,Q.jsx)(`p`,{"data-testid":`${t}-error`,className:`text-[12px] text-[var(--chrome-danger)]`,children:l}),!m&&u&&d&&(0,Q.jsx)(`button`,{type:`button`,disabled:i,onClick:d,"data-testid":`${t}-secondary`,className:`cursor-pointer text-[12.5px] text-[var(--chrome-fg-500)] underline underline-offset-2 outline-none transition-colors hover:text-[var(--chrome-fg-800)] disabled:cursor-default disabled:opacity-60`,children:u})]})}var Ce=[`free`,`pro`];function $(e){return e===`lifetime`?`total`:`a month`}function we(e){return e==null?`Unlimited canvases`:`${e} canvas${e===1?``:`es`}`}function Te(e){return e==null?V:S}var Ee={free:`Everything you need to draw, diagram, and export.`,pro:`The full assistant, unlimited canvases, and your team.`};function De(e){return[{icon:A,title:`${e.messages.limit} AI credits ${$(e.messages.period)}`,detail:`One credit per assistant turn, to try it out.`},{icon:Te(e.canvasLimit),title:we(e.canvasLimit),detail:`Saved to your account and synced across devices.`},{icon:k,title:`Every drawing tool`,detail:`Shapes, connectors, diagrams, slides, and frames.`},{icon:C,title:`Export anywhere`,detail:`PNG, SVG, and PDF, with the fonts embedded.`}]}function Oe(e){let t=[{icon:A,title:`${e.messages.limit} AI credits ${$(e.messages.period)}`,detail:`Ask the assistant to draw, rewrite, and rearrange.`}];return e.images.limit>0&&t.push({icon:ae,title:`${e.images.limit} generated images ${$(e.images.period)}`,detail:`Drop generated art straight onto the canvas.`}),t.push({icon:Te(e.canvasLimit),title:we(e.canvasLimit),detail:`Keep every project, never clear one to start another.`}),e.folders&&t.push({icon:E,title:`Organize with folders`,detail:`Group client work, projects, and ideas.`}),t.push({icon:oe,title:`Invite your team`,detail:`Add seats at the same price per member.`}),t}function ke(e){return e===`free`?De(w.free):[{icon:x,title:`Everything in Free`,detail:`Every tool and export, unchanged.`},...Oe(w.pro)]}function Ae(){return[`${T.messages} AI credits and ${T.images} generated images`,`Pooled across the workspace, for everyone in it`,`Stacks on your allowance, spent only after it`,`Expires ${T.expiryDays} days after purchase`,`A one-time purchase, nothing renews`]}function je(e,t){return e===`pro`?t===`yearly`?`pro-yearly`:`pro-monthly`:null}var Me=Math.round(D.yearly.amountCents/D.monthly.amountCents),Ne=`flex w-full cursor-pointer items-center gap-3 rounded-lg px-3.5 py-3 text-left outline-none transition-colors disabled:cursor-default`;function Pe(e){let{choice:t,hidden:n,testId:r}=e;return(0,Q.jsxs)(`div`,{"data-testid":`${r}-detail-${t}`,className:`col-start-1 row-start-1 flex flex-col gap-4 ${n?`invisible max-sm:hidden`:``}`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[16px] text-[var(--chrome-fg-900)]`,children:[t===`pro`&&(0,Q.jsx)(A,{size:15,stroke:1.75,className:`text-[var(--chrome-fg-500)]`}),w[t].label]}),(0,Q.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-[var(--chrome-fg-500)]`,children:Ee[t]})]}),(0,Q.jsx)(`span`,{className:`text-[10.5px] uppercase tracking-wider text-[var(--chrome-fg-400)]`,children:`What's included`}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-3.5`,children:ke(t).map(e=>{let t=e.icon;return(0,Q.jsxs)(`li`,{className:`flex gap-2.5`,children:[(0,Q.jsx)(t,{size:16,stroke:1.75,className:`mt-0.5 shrink-0 text-[var(--chrome-fg-600)]`}),(0,Q.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`text-[13px] leading-snug text-[var(--chrome-fg-900)]`,children:e.title}),(0,Q.jsx)(`span`,{className:`text-[12px] leading-relaxed text-[var(--chrome-fg-500)]`,children:e.detail})]})]},e.title)})})]})}function Fe(e){let{choice:t,testId:n}=e;return(0,Q.jsx)(`div`,{className:`grid bg-[var(--chrome-rest)] p-7 ring-1 ring-[var(--chrome-ring)]`,children:Ce.map(e=>(0,Q.jsx)(Pe,{choice:e,hidden:e!==t,testId:n},e))})}function Ie(e){let{testId:t,selected:n,current:r,disabled:i,label:a,price:o,suffix:s,onSelect:c}=e;return(0,Q.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,disabled:i,"data-testid":t,onClick:c,className:`${Ne} ${n?`bg-[var(--chrome-rest)] ring-2 ring-[var(--chrome-fg-900)]`:`ring-1 ring-[var(--chrome-ring)] hover:bg-[var(--chrome-hover)]`}`,children:[(0,Q.jsx)(`span`,{className:`h-2.5 w-2.5 shrink-0 rounded-full ${n?`bg-[var(--chrome-fg-900)]`:`bg-[var(--chrome-fg-300)]`}`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-[14px] text-[var(--chrome-fg-900)]`,children:a}),r&&(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--chrome-active)] px-2 py-0.5 text-[11px] text-[var(--chrome-fg-800)]`,children:`Current`})]}),(0,Q.jsxs)(`span`,{className:`ml-auto shrink-0 text-[12px] text-[var(--chrome-fg-500)]`,children:[(0,Q.jsx)(`span`,{className:`text-[15px] tabular-nums text-[var(--chrome-fg-900)]`,children:o}),` `,s]})]})}function Le(e){let{open:t,onOpenChange:n,initialChoice:r,topUp:i,onCheckout:a,onPurchased:o}=e,[s,c]=(0,H.useState)(r),[l,u]=(0,H.useState)(`yearly`),[d,f]=(0,H.useState)(null),[p,m]=(0,H.useState)(null),[h,g]=(0,H.useState)(null),_=(0,H.useRef)(!1);(0,H.useEffect)(()=>{t&&(c(r),u(`yearly`),f(null),m(null),g(null),_.current=!1)},[t,r]);let v=i?`credits`:je(s,l);async function y(){if(!(!a||v==null||_.current)){_.current=!0,m(null),f(`opening`);try{await a(v,f)===`purchased`&&g(v)}catch(e){m(B(e,`We couldn't start your checkout. Please try again.`))}finally{_.current=!1,f(null)}}}function b(){let e=h;n(!1),e!=null&&o?.(e)}return{choice:s,setChoice:c,billingInterval:l,setBillingInterval:u,phase:d,busy:d!=null,error:p,done:h,submit:y,close:b}}function Re(e){let{testId:t,done:n,onContinue:r}=e;return(0,Q.jsxs)(`div`,{"data-testid":`${t}-success`,className:`flex flex-col items-start gap-4 p-8`,children:[(0,Q.jsx)(`span`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-[var(--chrome-accent)] text-white`,children:(0,Q.jsx)(x,{size:18,stroke:2.5})}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(R,{className:`text-[20px] leading-tight text-[var(--chrome-fg-900)]`,children:n===`credits`?`Credits added`:`You're on ${w.pro.label}`}),(0,Q.jsx)(z,{className:`text-[13.5px] leading-relaxed text-[var(--chrome-fg-500)]`,children:n===`credits`?`${T.messages} AI credits and ${T.images} images are on your account.`:`Everything is unlocked: ${w.pro.messages.limit} AI credits a month, unlimited canvases, folders, and your team.`})]}),(0,Q.jsx)(`button`,{type:`button`,onClick:r,"data-testid":`${t}-continue`,className:`mt-1 flex h-10 cursor-pointer items-center justify-center rounded-xl bg-[var(--chrome-accent)] px-5 text-[14px] text-white outline-none transition-colors active:scale-[0.97] hover:bg-[var(--chrome-accent-hover)]`,children:`Continue`})]})}function ze(e){let{testId:t,reassurance:n,packPrice:r,canSell:i,footer:a}=e;return(0,Q.jsxs)(`div`,{"data-testid":`${t}-topup`,className:`flex flex-col gap-5 p-8`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 pr-8`,children:[(0,Q.jsx)(`span`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-[var(--chrome-rest)] text-[var(--chrome-fg-700)] ring-1 ring-[var(--chrome-ring)]`,children:(0,Q.jsx)(A,{size:18,stroke:1.75})}),(0,Q.jsx)(R,{className:`text-[20px] leading-tight text-[var(--chrome-fg-900)]`,children:`Top up your credits`}),(0,Q.jsx)(z,{className:`text-[13.5px] leading-relaxed text-[var(--chrome-fg-500)]`,children:`You're on ${w.pro.label}, the highest plan, so there's nothing to upgrade. A one-time pack keeps you going now, and your allowance still renews as usual.`})]}),n&&(0,Q.jsx)(`p`,{"data-testid":`${t}-reassurance`,className:`rounded-lg bg-[var(--chrome-rest)] px-3.5 py-2.5 text-[12.5px] leading-relaxed text-[var(--chrome-fg-700)] ring-1 ring-[var(--chrome-ring)]`,children:n}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl bg-[var(--chrome-rest)] p-4 ring-1 ring-[var(--chrome-ring)]`,children:[(0,Q.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,Q.jsx)(`span`,{className:`text-[15px] text-[var(--chrome-fg-900)]`,children:`Credit pack`}),(0,Q.jsxs)(`span`,{className:`text-[12px] text-[var(--chrome-fg-500)]`,children:[(0,Q.jsx)(`span`,{className:`text-[18px] tabular-nums text-[var(--chrome-fg-900)]`,children:r}),` `,`one-time`]})]}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:Ae().map(e=>(0,Q.jsxs)(`li`,{className:`flex items-start gap-2 text-[13px] leading-snug text-[var(--chrome-fg-700)]`,children:[(0,Q.jsx)(x,{size:14,stroke:2,className:`mt-0.5 shrink-0 text-[var(--chrome-fg-500)]`}),e]},e))})]}),(0,Q.jsx)(Se,{...a,sellable:i,currentLabel:`You're on ${w.pro.label}`,holdChargeLine:!1})]})}function Be(e){let{testId:t,title:n,description:r,reassurance:i,currentPlan:a,choice:o,onChoose:s,billingInterval:c,setBillingInterval:l,busy:u,canSell:d,footer:f}=e,p=c===`yearly`,m=o===a,h=O(ne().cents,`usd`),g=O(D.monthly.amountCents,`usd`),_=O(re(),`usd`),v=p?_:g,y=m?`Your current plan`:`Upgrade unavailable`;return(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 overflow-y-auto sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5 p-7`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 pr-8`,children:[(0,Q.jsx)(R,{className:`text-[20px] leading-tight text-[var(--chrome-fg-900)]`,children:n}),(0,Q.jsx)(z,{className:`text-[13.5px] leading-relaxed text-[var(--chrome-fg-500)]`,children:r})]}),i&&(0,Q.jsx)(`p`,{"data-testid":`${t}-reassurance`,className:`rounded-lg bg-[var(--chrome-rest)] px-3.5 py-2.5 text-[12.5px] leading-relaxed text-[var(--chrome-fg-700)] ring-1 ring-[var(--chrome-ring)]`,children:i}),(0,Q.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Choose a plan`,className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Ie,{testId:`upgrade-choice-free`,selected:o===`free`,current:a===`free`,disabled:u,label:w.free.label,price:O(0,`usd`),suffix:`/ month`,onSelect:()=>s(`free`)}),(0,Q.jsx)(Ie,{testId:`upgrade-choice-pro`,selected:o===`pro`,current:!1,disabled:u,label:w.pro.label,price:v,suffix:`/ month`,onSelect:()=>s(`pro`)})]}),(0,Q.jsxs)(`div`,{className:`mt-auto flex flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{"data-testid":`${t}-yearly-box`,className:`mt-8 flex flex-col gap-1.5 rounded-lg border border-dashed border-[var(--chrome-ring)] px-3.5 py-3 ${o===`pro`?``:`invisible max-sm:hidden`}`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`label`,{htmlFor:`${t}-yearly`,className:`cursor-pointer text-[13.5px] text-[var(--chrome-fg-900)]`,children:[`Save `,h,` with yearly billing`]}),(0,Q.jsx)(be,{id:`${t}-yearly`,checked:p,disabled:u,onCheckedChange:e=>l(e?`yearly`:`monthly`),"data-testid":`billing-interval-yearly`,className:`relative h-[22px] w-[38px] shrink-0 cursor-pointer rounded-full outline-none transition-colors disabled:cursor-default disabled:opacity-60 ${p?`bg-[var(--chrome-accent)]`:`bg-[var(--chrome-fg-400)]`}`,children:(0,Q.jsx)(xe,{className:`absolute left-[2px] top-[2px] block h-[18px] w-[18px] rounded-full bg-white shadow-sm transition-transform data-[checked]:translate-x-[16px]`})})]}),(0,Q.jsx)(`span`,{className:`text-[12.5px] leading-relaxed text-[var(--chrome-fg-500)]`,children:`Pay for ${Me} months, get 12. That's ${_}/month instead of ${g}/month.`})]}),(0,Q.jsx)(Se,{...f,sellable:!m&&d,currentLabel:y,holdChargeLine:!0})]})]}),(0,Q.jsx)(Fe,{choice:o,testId:t})]})}function Ve(e){let{open:t,onOpenChange:n,currentPlan:r,title:i,description:a,reassurance:o,onCheckout:s,onPurchased:c,secondaryLabel:l,onSecondary:u,testId:d=`upgrade-dialog`}=e,f=r===`pro`,p=Le({open:t,onOpenChange:n,initialChoice:e.initialChoice??`pro`,topUp:f,onCheckout:s,onPurchased:c}),{busy:m,close:h}=p,g=O(T.price*100,`usd`),_=f?`${g} billed once. No subscription.`:p.billingInterval===`yearly`?`${O(D.yearly.amountCents,`usd`)} billed today, then every year. Cancel anytime.`:`${O(D.monthly.amountCents,`usd`)} billed today, then every month. Cancel anytime.`,v=p.phase===`settling`?`Finishing up…`:p.phase===`checkout`?`Complete your payment…`:`Opening…`,y=u&&(()=>{h(),u()}),b={testId:d,busy:m,busyLabel:v,ctaLabel:f?`Buy credit pack`:`Upgrade to Pro`,chargeLine:_,error:p.error,secondaryLabel:l,onSecondary:y,leadWithSecondary:s==null,onSubmit:()=>void p.submit()};return(0,Q.jsx)(L,{open:t,onOpenChange:e=>{if(!(m&&!e)){if(e){n(!0);return}h()}},children:(0,Q.jsxs)(F,{children:[(0,Q.jsx)(P,{className:N.dialogBackdrop}),(0,Q.jsxs)(I,{"data-overlay":!0,"data-testid":d,className:`flex max-h-[92vh] flex-col overflow-hidden ${p.done||f?`w-[min(440px,92vw)]`:`w-[min(780px,94vw)]`} ${N.dialogPopup}`,children:[(0,Q.jsx)(se,{"aria-label":`Close`,disabled:m,className:`absolute right-3 top-3 z-10 flex h-7 w-7 items-center justify-center rounded-md text-[var(--chrome-fg-400)] outline-none transition-colors hover:bg-[var(--chrome-divider)] hover:text-[var(--chrome-fg-600)] disabled:opacity-40 disabled:hover:bg-transparent`,children:(0,Q.jsx)(j,{size:16,stroke:1.75})}),p.done?(0,Q.jsx)(Re,{testId:d,done:p.done,onContinue:h}):f?(0,Q.jsx)(ze,{testId:d,reassurance:o,packPrice:g,canSell:s!=null,footer:b}):(0,Q.jsx)(Be,{testId:d,title:i,description:a,reassurance:o,currentPlan:r,choice:p.choice,onChoose:p.setChoice,billingInterval:p.billingInterval,setBillingInterval:p.setBillingInterval,busy:m,canSell:s!=null,footer:b})]})]})})}function He(e){let{open:t,onOpenChange:n,currentPlan:r,reassurance:i,onPurchased:a,secondaryLabel:o,onSecondary:s,testId:c}=e,{state:l,startCheckout:u}=y(),d=l.status===`authenticated`&&l.canManageBilling===!1,f=l.status===`authenticated`&&l.canManageBilling!==!1;return(0,Q.jsx)(Ve,{open:t,onOpenChange:n,currentPlan:r,title:e.title??`Get more from the assistant`,description:e.description??`Move to Pro for a monthly credit allowance, image generation, and unlimited canvases.`,reassurance:i??(d?`Only an owner of this workspace can change its plan or buy credits. Ask an owner to upgrade it.`:void 0),onCheckout:f?u:void 0,onPurchased:a,secondaryLabel:o,onSecondary:s,testId:c??`upgrade-dialog`})}export{He as UpgradeDialog};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{t as n}from"./createReactComponent-9UsI5fmM.js";var r=n(`outline`,`row-insert-bottom`,`RowInsertBottom`,[[`path`,{d:`M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1`,key:`svg-0`}],[`path`,{d:`M12 15l0 4`,key:`svg-1`}],[`path`,{d:`M14 17l-4 0`,key:`svg-2`}]]),i=n(`outline`,`row-insert-top`,`RowInsertTop`,[[`path`,{d:`M4 18v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1`,key:`svg-0`}],[`path`,{d:`M12 9v-4`,key:`svg-1`}],[`path`,{d:`M10 7l4 0`,key:`svg-2`}]]),a=e(t(),1),o=5,s=48,c=16;function l(e,t,n){let r=e[0]-e[t],i=e[e.length-1]-e[t];return Math.max(r,Math.min(i,n))}function u(e,t,n){let r=e[t]+n;if(r<=e[0])return 0;for(let t=0;t<e.length;t+=1)if(r<e[t])return t;return e.length}function d(e,t){return e.gap===null?0:t<e.index&&e.gap<=t?e.lift:t>e.index&&e.gap>t?-e.lift:0}function f(e){let{count:t,gap:n,disabled:r,onReorder:i,onPress:f,canDrag:p}=e,[m,h]=(0,a.useState)(null),g=(0,a.useRef)(null),_=(0,a.useRef)([]),v=(0,a.useRef)(0);(0,a.useEffect)(()=>{if(!m?.dragging)return;let e=0,t=()=>{e=requestAnimationFrame(t);let n=g.current;if(!n)return;let r=n.getBoundingClientRect(),i=v.current,a=0;if(i<r.top+s?a=-Math.min(c,Math.ceil((r.top+s-i)/4)):i>r.bottom-s&&(a=Math.min(c,Math.ceil((i-(r.bottom-s))/4))),a===0)return;let o=n.scrollTop;n.scrollTop=o+a,n.scrollTop!==o&&h(e=>{if(!e?.dragging)return e;let t=v.current-e.startY+(n.scrollTop-e.startScroll),r=l(e.homes,e.index,t);return{...e,dy:r,gap:u(e.homes,e.index,r)}})};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[m?.dragging]);let y=(0,a.useCallback)(e=>t=>{_.current[e]=t},[]);function b(e,r){if(e.button!==0||p?.(r)===!1)return;let i=g.current;if(!i)return;e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),v.current=e.clientY;let a=i.getBoundingClientRect().top-i.scrollTop,o=_.current.slice(0,t).map(e=>{if(!e)return 1/0;let t=e.getBoundingClientRect();return t.top-a+t.height/2}),s=_.current[r]?.getBoundingClientRect().height??0;h({index:r,startY:e.clientY,startScroll:i.scrollTop,dy:0,dragging:!1,gap:null,homes:o,lift:s+n})}function x(e){if(!m)return;v.current=e.clientY;let t=g.current?.scrollTop??m.startScroll,n=e.clientY-m.startY+(t-m.startScroll),i=!r&&(m.dragging||Math.abs(n)>o),a=l(m.homes,m.index,n);h({...m,dy:a,dragging:i,gap:i?u(m.homes,m.index,a):null})}function S(e){if(!m)return;let{index:t,dragging:n,gap:r}=m;if(h(null),!n){f?.(t);return}if(r===null)return;let a=r>t?r-1:r;a!==t&&(e.stopPropagation(),i(t,a))}function C(e){return{onPointerDown:t=>b(t,e),onPointerMove:x,onPointerUp:S,onPointerCancel:()=>h(null)}}function w(e){if(m?.dragging&&m.index===e)return{transform:`translateY(${m.dy}px)`,zIndex:10,opacity:.7};if(m?.dragging)return{transform:`translateY(${d(m,e)}px)`,transition:`transform 150ms ease`}}return{listRef:g,setItemRef:y,rowHandlers:C,rowStyle:w,dragging:!!m?.dragging,cancel:()=>h(null)}}export{i as n,r,f as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/export-ChP0k5F5.js","assets/slides-D9bnXqtf.js","assets/style-BENGW2ZV.js","assets/preload-helper-Czpn1I53.js","assets/blob-CTPsKWYv.js","assets/theme-palette-D1nbDFBC.js","assets/clipboard-CO7YHov7.js","assets/export-DEFKKRRi.js","assets/registry-DCgwH8wI.js","assets/text-breaks-YU-ymaF9.js","assets/icon-sources-CZI1h18s.js","assets/chart-Z4HQx-0h.js","assets/frames-CRP8oPP8.js","assets/connector-labels-vVnYQJRz.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{r as n}from"./toast-Nu_fiCd9.js";import{a as r,s as i}from"./editor-B0tARd79.js";import{n as a}from"./renderer-environment-DmWXvuT4.js";import{t as o}from"./preload-helper-Czpn1I53.js";import{r as s}from"./lazy-module-DkWvu4va.js";import{t as c}from"./clipboard-CO7YHov7.js";var l=e(t(),1),u=()=>o(()=>import(`./export-ChP0k5F5.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]));function d(e){return s(u).then(t=>t.createBrowserExport(e))}function f(e){return e===`copyPng`||e===`copySvg`}function p(e){return e===0?null:e===1?`One shape made in a newer version of Koboyo is not in this export. It is still saved on the canvas.`:`${e} shapes made in a newer version of Koboyo are not in this export. They are still saved on the canvas.`}function m(e,t){let n=p(t);if(!f(e))return n;let r=e===`copyPng`?`Copied as PNG`:`Copied as SVG`;return n?`${r}. ${n}`:r}function h(e){return f(e)?`Couldn't copy, try again`:`Couldn't export, try again`}function g(e){return f(e)?`Nothing to copy yet`:`Nothing to export yet`}function _(){let e=i(),t=r(),o=a(),{notify:s}=n();return(0,l.useCallback)((n,r,i)=>{if(r.length===0)return s(g(n)),Promise.resolve(!1);let a=e.getState().opaqueShapes.length,l={measurement:t.measurement,...i?.options};return d(o).then(e=>n===`copyPng`||n===`copySvg`?e[n](r,l):n===`downloadPdf`?e.downloadSlidesPdf(r,l,i?.filename):e[n](r,l,i?.filename)).then(()=>{let e=m(n,a);return e&&s(e),!0}).catch(t=>t instanceof c&&t.image?(e.getState().setImageToCopy(t.image),!0):(s(h(n)),!1))},[e,t,o,s])}export{_ as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{t as r}from"./icons-DzW1j-r3.js";import{a as i,r as a}from"./asset-glyph-B3c--Mx2.js";var o=e(t(),1),s=n();function c(e){let[t,n]=(0,o.useState)(()=>({name:e,node:r().cachedNode(e)??null}));return(0,o.useEffect)(()=>{let t=r().cachedNode(e);if(t!==void 0){n(n=>n.name===e&&n.node===t?n:{name:e,node:t});return}let i=!0,a,o=(t,s)=>{r().loadNode(e).then(t=>{i&&n({name:e,node:t})}).catch(()=>{i&&t>0&&(a=setTimeout(()=>o(t-1,s*2),s))})};return o(4,2500),()=>{i=!1,a!==void 0&&clearTimeout(a)}},[e]),t.name===e?t.node:r().cachedNode(e)??null}function l(e){return e.map(([e,t],n)=>{let{key:r,...i}=t;return(0,o.createElement)(e,{key:n,...i})})}var u={fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`};function d(e){let{node:t,size:n=24,strokeWidth:r=2}=e;return(0,s.jsx)(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:r,...u,children:l(t)})}function f(e){let{node:t,at:n,size:r,stroke:i,strokeWidth:a=2,...o}=e,c=r/24;return(0,s.jsx)(`g`,{transform:`translate(${n.x} ${n.y}) scale(${c})`,stroke:i,strokeWidth:c>0?a/c:a,...u,...o,children:l(t)})}function p(e,t){let n=`${e}/${t}`,[r,s]=(0,o.useState)(()=>({key:n,glyph:a(e,t)??null}));return(0,o.useEffect)(()=>{let r=a(e,t);if(r!==void 0){s(e=>e.key===n&&e.glyph===r?e:{key:n,glyph:r});return}let o=!0;return i(e,t).then(e=>{o&&s({key:n,glyph:e})}),()=>{o=!1}},[n,e,t]),r.key===n?r.glyph:a(e,t)??null}export{c as i,d as n,p as r,f as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{_ as n}from"./selection-overlay-primitives-hWJ1xjF7.js";import{t as r}from"./editable-target-BTLnvKNi.js";var i=e(t(),1),a=`button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="tab"], [role="option"], [role="checkbox"], [role="switch"], [role="radio"]`;function o(e){return e instanceof Element&&e.closest(a)!==null}function s(e,t={}){let{preventDefault:a=!1}=t,[s,c]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{function t(t){t.code===e&&(r(t.target)||o(t.target)||(a&&t.preventDefault(),c(!0)))}function i(t){t.code!==e&&t.key!==`Meta`||c(!1)}window.addEventListener(`keydown`,t),window.addEventListener(`keyup`,i);let s=n(()=>c(!1));return()=>{window.removeEventListener(`keydown`,t),window.removeEventListener(`keyup`,i),s()}},[e,a]),s}export{s as n,o as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{t as n}from"./storage-CvDRYh5V.js";var r=e(t(),1);function i(e,t,n,r){let i=r(t);return[t,...e.filter(e=>r(e)!==i)].slice(0,n)}function a(e,t){let r=n.getJSON(e,[]);return t(Array.isArray(r)?r:[])}function o(e,t,o){let s=o?.keyOf??(e=>String(e)),c=o?.sanitize??(e=>e),[l,u]=(0,r.useState)(()=>a(e,c));function d(r){let a=i(l,r,t,s);u(a),n.setJSON(e,a)}return{recent:l,remember:d}}export{o as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{Mn as n,in as r,jn as i,t as a}from"./useScrollLock-B7mQdXyv.js";var o=e(t(),1),s=o.createContext(void 0);function c(e){let t=o.useContext(s);if(t===void 0&&!e)throw Error(i(69));return t}var l=20;function u(e,t,i,s){let[c,u]=o.useState(!1);n(()=>{if(!e||!t||i==null){u(!1);return}let n=r(i).documentElement.clientWidth,a=i.offsetWidth;u(n>0&&a>0&&a>=n-l)},[e,t,i]),a(e&&(!t||c),s)}export{c as n,u as t};
@@ -1 +0,0 @@
1
- import{it as e}from"./useScrollLock-B7mQdXyv.js";function t(t){return e(t,`base-ui`)}export{t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{Dn as n,Mn as r,_n as i,_t as a,gt as o,jn as s}from"./useScrollLock-B7mQdXyv.js";var c=e(t(),1),l=c.createContext(void 0);function u(e=!1){let t=c.useContext(l);if(t===void 0&&!e)throw Error(s(16));return t}function d(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:c.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function f(e={}){let{disabled:t=!1,focusableWhenDisabled:i,tabIndex:s=0,native:l=!0,composite:f}=e,h=c.useRef(null),g=u(!0),_=f??g!==void 0,{props:v}=d({focusableWhenDisabled:i,disabled:t,composite:_,tabIndex:s,isNativeButton:l}),y=c.useCallback(()=>{let e=h.current;p(e)&&_&&t&&v.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,v.disabled,_]);return r(y,[y]),{getButtonProps:c.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:i,onKeyDown:s,onPointerDown:c,...u}=e;return a({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(o(e),s?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,i=e.currentTarget,a=p(i),c=!l&&m(i),u=r&&(l?a:!c),d=e.key===`Enter`,f=e.key===` `,h=i.getAttribute(`role`),g=h?.startsWith(`menuitem`)||h===`option`||h===`gridcell`;if(r&&_&&f){if(e.defaultPrevented&&g)return;e.preventDefault(),c||l&&a?(i.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!l&&(f||d)&&e.preventDefault(),!l&&d&&n?.(e))},onKeyUp(e){if(!t){if(o(e),i?.(e),e.target===e.currentTarget&&l&&_&&p(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!l&&!_&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}c?.(e)}},l?{type:`button`}:{role:`button`},v,u)},[t,v,_,l]),buttonRef:n(e=>{h.current=e,y()})}}function p(e){return i(e)&&e.tagName===`BUTTON`}function m(e){return!!(e?.tagName===`A`&&e?.href)}export{u as n,f as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{t as n}from"./createReactComponent-9UsI5fmM.js";var r=n(`outline`,`download`,`Download`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 11l5 5l5 -5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),i=n(`outline`,`layout-grid`,`LayoutGrid`,[[`path`,{d:`M4 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-0`}],[`path`,{d:`M14 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-1`}],[`path`,{d:`M4 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-2`}],[`path`,{d:`M14 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-3`}]]),a=e(t(),1);function o({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=a.useRef(e!==void 0),[o,s]=a.useState(t);return[i?e:o,a.useCallback(e=>{i||s(e)},[])]}export{i as n,r,o as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{Dn as n,F as r,Fn as i,Gt as a,H as o,I as s,It as c,Mn as l,Mt as u,Nn as d,O as f,Pn as p,Rt as m,Sn as h,Tn as g,U as _,Wt as v,_n as y,an as b,bn as x,cn as S,dn as C,en as w,f as T,fn as E,gn as D,hn as O,ht as k,in as A,it as j,ln as M,mn as N,nt as P,o as ee,on as F,pn as I,rn as te,sn as ne,st as L,tn as re,un as ie,vn as ae,xn as oe,yn as R,zt as z}from"./useScrollLock-B7mQdXyv.js";var B=e(t(),1),se=[`top`,`right`,`bottom`,`left`],V=Math.min,H=Math.max,ce=Math.round,U=Math.floor,W=e=>({x:e,y:e}),le={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ue(e,t,n){return H(e,V(t,n))}function G(e,t){return typeof e==`function`?e(t):e}function K(e){return e.split(`-`)[0]}function q(e){return e.split(`-`)[1]}function de(e){return e===`x`?`y`:`x`}function J(e){return e===`y`?`height`:`width`}function Y(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function X(e){return de(Y(e))}function fe(e,t,n){n===void 0&&(n=!1);let r=q(e),i=X(e),a=J(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ye(o)),[o,ye(o)]}function pe(e){let t=ye(e);return[Z(e),t,Z(t)]}function Z(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var me=[`left`,`right`],he=[`right`,`left`],ge=[`top`,`bottom`],Q=[`bottom`,`top`];function _e(e,t,n){switch(e){case`top`:case`bottom`:return n?t?he:me:t?me:he;case`left`:case`right`:return t?ge:Q;default:return[]}}function ve(e,t,n,r){let i=q(e),a=_e(K(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Z)))),a}function ye(e){let t=K(e);return le[t]+e.slice(t.length)}function be(e){return{top:0,right:0,bottom:0,left:0,...e}}function xe(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:be(e)}function $(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var Se=e(i(),1);function Ce(e,t){return t!=null&&!u(t)?0:typeof e==`function`?e():e}function we(e,t,n){let r=Ce(e,n);return typeof r==`number`?r:r?.[t]}function Te(e){return typeof e==`function`?e():e}function Ee(e,t){return t||e===`click`||e===`mousedown`}function De(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Oe(e,t,n){let{reference:r,floating:i}=e,a=Y(t),o=X(t),s=J(o),c=K(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(q(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function ke(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=G(t,e),p=xe(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=$(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=$(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ae=50,je=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ke},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Oe(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ae&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Oe(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Me=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=G(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=K(r),_=Y(o),v=K(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ye(o)]:pe(o)),x=p!==`none`;!d&&x&&b.push(...ve(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=fe(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Y(t))||T.every(e=>Y(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Y(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ne(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Pe(e){return se.some(t=>e[t]>=0)}var Fe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=G(e,t);switch(i){case`referenceHidden`:{let e=Ne(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Pe(e)}}}case`escaped`:{let e=Ne(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Pe(e)}}}default:return{}}}}},Ie=new Set([`left`,`top`]);async function Le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=K(n),s=q(n),c=Y(n)===`y`,l=Ie.has(o)?-1:1,u=a&&c?-1:1,d=G(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Re=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Le(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ze=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=G(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Y(K(i)),p=de(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=ue(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=ue(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Be=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=G(e,t),u={x:n,y:r},d=Y(i),f=de(d),p=u[f],m=u[d],h=G(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ie.has(K(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ve=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=G(e,t),u=await o.detectOverflow(t,l),d=K(i),f=q(i),p=Y(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=V(h-u[g],v),x=V(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=H(u.left,0),t=H(u.right,0),n=H(u.top,0),r=H(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:H(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:H(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function He(e){let t=F(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=y(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ce(n)!==a||ce(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ue(e){return D(e)?e:e.contextElement}function We(e){let t=Ue(e);if(!y(t))return W(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=He(t),o=(a?ce(n.width):n.width)/r,s=(a?ce(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ge=W(0);function Ke(e){let t=N(e);return!h()||!t.visualViewport?Ge:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==N(e)?!1:t}function Je(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ue(e),o=W(1);t&&(r?D(r)&&(o=We(r)):o=We(e));let s=qe(a,n,r)?Ke(a):W(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=N(a),t=r&&D(r)?N(r):r,n=e,i=M(n);for(;i&&r&&t!==n;){let e=We(i),t=i.getBoundingClientRect(),r=F(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=N(i),i=M(n)}}return $({width:u,height:d,x:c,y:l})}function Ye(e,t){let n=C(e).scrollLeft;return t?t.left+n:Je(S(e)).left+n}function Xe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ye(e,n),y:n.top+t.scrollTop}}function Ze(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=S(r),s=t?oe(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=W(1),u=W(0),d=y(r);if((d||!d&&!a)&&((ie(r)!==`body`||R(o))&&(c=C(r)),d)){let e=Je(r);l=We(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Xe(o,c):W(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Qe(e){return Array.from(e.getClientRects())}function $e(e){let t=S(e),n=C(e),r=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=H(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ye(e),s=-n.scrollTop;return F(r).direction===`rtl`&&(o+=H(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var et=25;function tt(e,t){let n=N(e),r=S(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=h();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ye(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=et&&(a-=o)}else l<=et&&(a+=l);return{width:a,height:o,x:s,y:c}}function nt(e,t){let n=Je(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=y(e)?We(e):W(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function rt(e,t,n){let r;if(t===`viewport`)r=tt(e,n);else if(t===`document`)r=$e(S(e));else if(D(t))r=nt(t,n);else{let n=Ke(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $(r)}function it(e,t){let n=I(e);return n===t||!D(n)||ae(n)?!1:F(n).position===`fixed`||it(n,t)}function at(e,t){let n=t.get(e);if(n)return n;let r=E(e,[],!1).filter(e=>D(e)&&ie(e)!==`body`),i=null,a=F(e).position===`fixed`,o=a?I(e):e;for(;D(o)&&!ae(o);){let t=F(o),n=O(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||R(o)&&!n&&it(e,o))?r=r.filter(e=>e!==o):i=t,o=I(o)}return t.set(e,r),r}function ot(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?oe(t)?[]:at(t,this._c):[].concat(n),r],o=rt(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=rt(t,a[e],i);s=H(n.top,s),c=V(n.right,c),l=V(n.bottom,l),u=H(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function st(e){let{width:t,height:n}=He(e);return{width:t,height:n}}function ct(e,t,n){let r=y(t),i=S(t),a=n===`fixed`,o=Je(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=W(0);function l(){c.x=Ye(i)}if(r||!r&&!a)if((ie(t)!==`body`||R(i))&&(s=C(t)),r){let e=Je(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Xe(i,s):W(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function lt(e){return F(e).position===`static`}function ut(e,t){if(!y(e)||F(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return S(e)===n&&(n=n.ownerDocument.body),n}function dt(e,t){let n=N(e);if(oe(e))return n;if(!y(e)){let t=I(e);for(;t&&!ae(t);){if(D(t)&&!lt(t))return t;t=I(t)}return n}let r=ut(e,t);for(;r&&x(r)&&lt(r);)r=ut(r,t);return r&&ae(r)&&lt(r)&&!O(r)?n:r||ne(e)||n}var ft=async function(e){let t=this.getOffsetParent||dt,n=this.getDimensions,r=await n(e.floating);return{reference:ct(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pt(e){return F(e).direction===`rtl`}var mt={convertOffsetParentRelativeRectToViewportRelativeRect:Ze,getDocumentElement:S,getClippingRect:ot,getOffsetParent:dt,getElementRects:ft,getClientRects:Qe,getDimensions:st,getScale:We,isElement:D,isRTL:pt};function ht(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gt(e,t){let n=null,r,i=S(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=U(d),h=U(i.clientWidth-(u+f)),g=U(i.clientHeight-(d+p)),_=U(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:H(0,V(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!ht(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function _t(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ue(e),u=i||a?[...l?E(l):[],...t?E(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?gt(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Je(e):null;c&&g();function g(){let t=Je(e);h&&!ht(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var vt=Re,yt=ze,bt=Me,xt=Ve,St=Fe,Ct=Be,wt=(e,t,n)=>{let r=new Map,i={platform:mt,...n},a={...i.platform,_c:r};return je(e,t,{...i,platform:a})},Tt=typeof document<`u`?B.useLayoutEffect:function(){};function Et(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Et(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Et(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Dt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ot(e,t){let n=Dt(e);return Math.round(t*n)/n}function kt(e){let t=B.useRef(e);return Tt(()=>{t.current=e}),t}function At(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=B.useState(r);Et(f,r)||p(r);let[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=B.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=B.useRef(null),C=B.useRef(null),w=B.useRef(u),T=c!=null,E=kt(c),D=kt(i),O=kt(l),k=B.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),wt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Et(w.current,t)&&(w.current=t,Se.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Tt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=B.useRef(!1);Tt(()=>(A.current=!0,()=>{A.current=!1}),[]),Tt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=B.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=B.useMemo(()=>({reference:b,floating:x}),[b,x]),N=B.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Ot(M.floating,u.x),r=Ot(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Dt(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return B.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var jt=(e,t)=>{let n=vt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mt=(e,t)=>{let n=yt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nt=(e,t)=>({fn:Ct(e).fn,options:[e,t]}),Pt=(e,t)=>{let n=bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ft=(e,t)=>{let n=xt(e);return{name:n.name,fn:n.fn,options:[e,t]}},It=(e,t)=>{let n=St(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Lt(e){let{open:t=!1,onOpenChange:n,elements:i={}}=e,a=j(),o=r()!=null,s=d(()=>new f({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new T,floatingId:a,syncOnly:!1,nested:o})).current;return l(()=>{let e={open:t,floatingId:a};i.reference!==void 0&&(e.referenceElement=i.reference,e.domReferenceElement=D(i.reference)?i.reference:null),i.floating!==void 0&&(e.floatingElement=i.floating),s.update(e)},[t,a,i.reference,i.floating,s]),s.context.onOpenChange=n,s.context.nested=o,s}function Rt(e={}){let{nodeId:t,externalTree:n}=e,r=Lt(e),i=e.rootContext||r,a=i.useState(`referenceElement`),o=i.useState(`floatingElement`),c=i.useState(`domReferenceElement`),u=i.useState(`open`),d=i.useState(`floatingId`),[f,p]=B.useState(null),[m,h]=B.useState(void 0),[g,_]=B.useState(void 0),v=B.useRef(null),y=s(n),b=B.useMemo(()=>({reference:a,floating:o,domReference:c}),[a,o,c]),x=At({...e,elements:{...b,...f&&{reference:f}}}),S=D(m)?m:null,C=g===void 0?i.state.floatingElement:g;i.useSyncedValue(`referenceElement`,m??null),i.useSyncedValue(`domReferenceElement`,m===void 0?c:S),i.useSyncedValue(`floatingElement`,C);let w=B.useCallback(e=>{let t=D(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;p(t),x.refs.setReference(t)},[x.refs]),T=B.useCallback(e=>{(D(e)||e===null)&&(v.current=e,h(e)),(D(x.refs.reference.current)||x.refs.reference.current===null||e!==null&&!D(e))&&x.refs.setReference(e)},[x.refs,h]),E=B.useCallback(e=>{_(e),x.refs.setFloating(e)},[x.refs]),O=B.useMemo(()=>({...x.refs,setReference:T,setFloating:E,setPositionReference:w,domReference:v}),[x.refs,T,E,w]),k=B.useMemo(()=>({...x.elements,domReference:c}),[x.elements,c]),A=B.useMemo(()=>({...x,dataRef:i.context.dataRef,open:u,onOpenChange:i.setOpen,events:i.context.events,floatingId:d,refs:O,elements:k,nodeId:t,rootStore:i}),[x,O,k,t,i,u,d]);return l(()=>{c&&(v.current=c)},[c]),l(()=>{i.context.dataRef.current.floatingContext=A;let e=y?.nodesRef.current.find(e=>e.id===t);e&&(e.context=A)}),B.useMemo(()=>({...x,context:A,refs:O,elements:k,rootStore:i}),[x,O,k,A,i])}var zt=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new w,this.restTimeout=new w,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Bt=new WeakMap;function Vt(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Bt.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Bt.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Ht(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Bt.get(n);a&&a!==e&&Vt(a),Vt(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Bt.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Ut(e){let t=e.context.dataRef.current,n=d(()=>t.hoverInteractionState??zt.create()).current;return t.hoverInteractionState||=n,p(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Wt(e,t={}){let{enabled:i=!0,closeDelay:o=0,nodeId:u}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=d.useState(`floatingElement`),h=d.useState(`domReferenceElement`),{dataRef:g}=d.context,y=s(),x=r(),S=Ut(d),C=re(),w=n(()=>Ee(g.current.openEvent?.type,S.interactedInside)),T=n(()=>De(g.current.openEvent?.type)),E=n(()=>{Vt(S)});l(()=>{f||(S.pointerType=void 0,S.restTimeoutPending=!1,S.interactedInside=!1,E())},[f,S,E]),B.useEffect(()=>E,[E]),l(()=>{if(i&&f&&S.handleCloseOptions?.blockPointerEvents&&T()&&D(h)&&p){let e=h,t=p,n=A(p),r=y?.nodesRef.current.find(e=>e.id===x)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=S.pointerEventsScopeElement===t?null:S.pointerEventsScopeElement,a=r===t?null:r,o=S.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return Ht(S,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{E()}}},[i,f,h,p,S,T,y,x,E]),B.useEffect(()=>{if(!i)return;function e(){return!!(y&&x&&c(y.nodesRef.current,x).length>0)}function t(e){let t=we(o,`close`,S.pointerType),n=()=>{d.setOpen(!1,_(P,e)),y?.events.emit(`floating.closed`,e)};t?S.openChangeTimeout.start(t,n):(S.openChangeTimeout.clear(),n())}function n(e){let t=a(e);if(!m(t)){S.interactedInside=!1;return}S.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function r(){S.openChangeTimeout.clear(),C.clear(),y?.events.off(`floating.closed`,l),E()}function s(n){if(e()&&y){y.events.on(`floating.closed`,l);return}if(z(n.relatedTarget,d.context.triggerElements))return;let r=g.current.floatingContext?.nodeId??u,i=n.relatedTarget;if(!(y&&r&&D(i)&&c(y.nodesRef.current,r,!1).some(e=>v(e.context?.elements.floating,i)))){if(S.handler){S.handler(n);return}E(),T()&&!w()&&t(n)}}function l(t){!y||!x||e()||C.start(0,()=>{y.events.off(`floating.closed`,l),d.setOpen(!1,_(P,t)),y.events.emit(`floating.closed`,t)})}let f=p;return b(f&&te(f,`mouseenter`,r),f&&te(f,`mouseleave`,s),f&&te(f,`pointerdown`,n,!0),()=>{y?.events.off(`floating.closed`,l)})},[i,p,d,g,o,u,T,w,E,S,y,x,C])}var Gt=B.createContext(void 0);function Kt(){return B.useContext(Gt)?.direction??`ltr`}var qt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=G(e,t)||{};if(l==null)return{};let f=xe(u),p={x:n,y:r},m=X(i),h=J(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=ue(k,j,A),N=!c.arrow&&q(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Jt=(e,t)=>({...qt(e),options:[e,t]}),Yt=It().fn,Xt={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Yt(e)).data?.referenceHidden||a}}}},Zt={sideX:`left`,sideY:`top`},Qt={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=N(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:Zt};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=A(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=K(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Zt.sideX,g=f===`top`?`bottom`:Zt.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function $t(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function en(e,t,n){let{rects:r,placement:i}=e;return{side:$t(t,K(i),n),align:q(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function tn(e){let{anchor:t,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:s=`center`,alignOffset:c=0,collisionBoundary:u,collisionPadding:d=5,sticky:f=!1,arrowPadding:p=5,disableAnchorTracking:m=!1,inline:h,keepMounted:g=!1,floatingRootContext:_,mounted:v,collisionAvoidance:y,shiftCrossAxis:b=!1,nodeId:x,adaptiveOrigin:S,lazyFlip:C=!1,externalTree:w}=e,[T,E]=B.useState(null);!v&&T!==null&&E(null);let D=y.side||`flip`,O=y.align||`flip`,k=y.fallbackAxisSide||`end`,j=typeof t==`function`?t:void 0,M=n(j),P=j?M:t,ee=o(t),F=o(v),I=Kt()===`rtl`,te=T||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],ne=s===`center`?te:`${te}-${s}`,L=d,re=+(i===`bottom`),ie=+(i===`top`),ae=+(i===`right`),oe=+(i===`left`);typeof L==`number`?L={top:L+re,right:L+oe,bottom:L+ie,left:L+ae}:L&&={top:(L.top||0)+re,right:(L.right||0)+oe,bottom:(L.bottom||0)+ie,left:(L.left||0)+ae};let R={boundary:u===`clipping-ancestors`?`clippingAncestors`:u,padding:L},z=B.useRef(null),se=o(a),V=o(c),H=typeof a==`function`?0:a,ce=typeof c==`function`?0:c,U=[];h&&U.push(h),U.push(jt(e=>{let t=en(e,i,I),n=typeof se.current==`function`?se.current(t):se.current,r=typeof V.current==`function`?V.current(t):V.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[H,ce,I,i]));let W=O===`none`&&D!==`shift`,le=!W&&(f||b||D===`shift`),ue=D===`none`?null:Pt({...R,padding:{top:L.top+1,right:L.right+1,bottom:L.bottom+1,left:L.left+1},mainAxis:!b&&D===`flip`,crossAxis:O===`flip`&&`alignment`,fallbackAxisSideDirection:k}),G=W?null:Mt(e=>{let t=A(e.elements.floating).documentElement;return{...R,rootBoundary:b?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:O!==`none`,crossAxis:le,limiter:f||b?void 0:Nt(e=>{if(!z.current)return{};let{width:t,height:n}=z.current.getBoundingClientRect(),r=Y(K(e.placement)),i=r===`y`?t:n,a=r===`y`?L.left+L.right:L.top+L.bottom;return{offset:i/2+a/2}})}},[R,f,b,L,O]);D===`shift`||O===`shift`||s===`center`?U.push(G,ue):U.push(ue,G),U.push(Ft({...R,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=N(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Jt(e=>({element:z.current||A(e.elements.floating).createElement(`div`),padding:p,offsetParent:`floating`}),[p]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=K(r),l=Y(c),u=z.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(en(e,i,I)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,le&&l===`y`&&b?S:x),{}}},Xt,S),l(()=>{!v&&_&&_.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,_]);let de=B.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<`u`,layoutShift:!m&&typeof IntersectionObserver<`u`}),[m]),{refs:J,elements:X,x:fe,y:pe,middlewareData:Z,update:me,placement:he,context:ge,isPositioned:Q,floatingStyles:_e}=Rt({rootContext:_,open:g?v:void 0,placement:ne,middleware:U,strategy:r,whileElementsMounted:g?void 0:(...e)=>_t(...e,de),nodeId:x,externalTree:w}),{sideX:ve,sideY:ye}=Z.adaptiveOrigin||Zt,be=Q?r:`fixed`,xe=B.useMemo(()=>{let e=S?{position:be,[ve]:fe,[ye]:pe}:{position:be,..._e};return Q||(e.opacity=0),e},[S,be,ve,fe,ye,pe,_e,Q]),$=B.useRef(null);l(()=>{if(!v)return;let e=ee.current,t=typeof e==`function`?e():e,n=(nn(t)?t.current:t)||null;n!==$.current&&(J.setPositionReference(n),$.current=n)},[v,J,P,ee]),B.useEffect(()=>{if(!v)return;let e=ee.current;typeof e!=`function`&&nn(e)&&e.current!==$.current&&(J.setPositionReference(e.current),$.current=e.current)},[v,J,P,ee]),B.useEffect(()=>{if(g&&v&&X.reference&&X.floating)return _t(X.reference,X.floating,me,de)},[g,v,X,me,de]);let Se=K(he),Ce=$t(i,Se,I),we=q(he)||`center`,Te=!!Z.hide?.referenceHidden;l(()=>{C&&v&&Q&&E(Se)},[C,v,Q,Se]);let Ee=B.useMemo(()=>({position:`absolute`,top:Z.arrow?.y,left:Z.arrow?.x}),[Z.arrow]),De=Z.arrow?.centerOffset!==0;return B.useMemo(()=>({positionerStyles:xe,arrowStyles:Ee,arrowRef:z,arrowUncentered:De,side:Ce,align:we,physicalSide:Se,anchorHidden:Te,refs:J,context:ge,isPositioned:Q,update:me}),[xe,Ee,z,De,Ce,we,Se,Te,J,ge,Q,me])}function nn(e){return e!=null&&`current`in e}function rn(e){return e===`starting`?L:g}function an(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),k(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},rn(r),i],stateAttributesMapping:ee})}export{Kt as a,Vt as c,Te as d,Ee as f,Qt as i,Ut as l,rn as n,Wt as o,tn as r,Ht as s,an as t,we as u};