koboyo 0.4.0 → 0.5.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.
- package/README.md +26 -0
- package/assets/editor/assets/ContextMenuTrigger-CXUL1E23.js +1 -0
- package/assets/editor/assets/{IconHelp-CaEwHrsN.js → IconHelp-4FIVl1rh.js} +2 -2
- package/assets/editor/assets/IconReplace-CYUD1RLF.js +1 -0
- package/assets/editor/assets/MenuSubmenuTrigger-BFlIkXYg.js +1 -0
- package/assets/editor/assets/{PopoverPopup-B3Y0VRYc.js → PopoverPopup-1zO38CRl.js} +1 -1
- package/assets/editor/assets/asset-glyph-DjBHkQcP.js +1 -0
- package/assets/editor/assets/build-pips-BRf3pMnt.js +1 -0
- package/assets/editor/assets/build-visibility-CAmmsnmF.js +1 -0
- package/assets/editor/assets/builders-DrWdKwLQ.js +1 -0
- package/assets/editor/assets/{chart-4iRduYdU.js → chart-CKIxcbcM.js} +4 -4
- package/assets/editor/assets/{chrome-layout-BzPU9far.js → chrome-layout-D5dql-y4.js} +1 -1
- package/assets/editor/assets/code-panel-BFikzGNv.js +18 -0
- package/assets/editor/assets/color-swatches-CZKb4DxX.js +1 -0
- package/assets/editor/assets/{command-palette-BR-_ChOL.js → command-palette-Uat68wmJ.js} +1 -1
- package/assets/editor/assets/connector-labels-DqVssnYz.js +2 -0
- package/assets/editor/assets/{copy-image-dialog-BzGP7Xw8.js → copy-image-dialog-C0fXdR1a.js} +1 -1
- package/assets/editor/assets/core-C1TxysMz.js +1 -0
- package/assets/editor/assets/diagram-fingerprint-B-HB8UbR.js +3 -0
- package/assets/editor/assets/{edit-C0sBxxsg.js → edit-B4DMFSZr.js} +1 -1
- package/assets/editor/assets/editor-DAJETlQW.js +1 -0
- package/assets/editor/assets/{elk-worker-loader-CVBdN1je.js → elk-worker-loader-BCdkmVMX.js} +1 -1
- package/assets/editor/assets/embed-input-D77Udvni.js +1 -0
- package/assets/editor/assets/export-FQTXirjn.js +2 -0
- package/assets/editor/assets/{export-dialog-x2n2a4KX.js → export-dialog-KYLeNY3G.js} +1 -1
- package/assets/editor/assets/export-u442sUQs.js +6 -0
- package/assets/editor/assets/flow-layer-B4Q8rktl.js +1 -0
- package/assets/editor/assets/flow-panel-DbnavW4w.js +1 -0
- package/assets/editor/assets/flow-stage-CSTrNMZF.js +1 -0
- package/assets/editor/assets/{flow-start-CpAvU-9P.js → flow-start-ByhFxEeV.js} +1 -1
- package/assets/editor/assets/{flows-Cj7AFMIA.js → flows-CGl4r-xb.js} +1 -1
- package/assets/editor/assets/{frames-Cp1QD3LR.js → frames-DRSLvE9E.js} +1 -1
- package/assets/editor/assets/generate-DHP90nDk.js +26 -0
- package/assets/editor/assets/{icon-picker-Cg39IKNJ.js → icon-picker-DIkw2xYL.js} +1 -1
- package/assets/editor/assets/{image-library-JQu_tb8P.js → image-library-BmoSPV9c.js} +1 -1
- package/assets/editor/assets/index-DFwoT1_W.js +25 -0
- package/assets/editor/assets/layout-offthread-JPTCbsLL.js +18 -0
- package/assets/editor/assets/menu-4xb5HtA1.js +1 -0
- package/assets/editor/assets/mermaid-paste-2cCwweY0.js +1 -0
- package/assets/editor/assets/panel-controls-B0Ccd0XF.js +1 -0
- package/assets/editor/assets/{panel-shell-BnMOHgWM.js → panel-shell-COqmheb-.js} +1 -1
- package/assets/editor/assets/plan-D4Jyzo5X.js +1 -0
- package/assets/editor/assets/presentation-DNmdm11D.js +1 -0
- package/assets/editor/assets/{presenter-keys-Bs3LnmOa.js → presenter-keys-DLNIsrm5.js} +1 -1
- package/assets/editor/assets/reflow-C6bvnSVm.js +1 -0
- package/assets/editor/assets/registry-d5KleeyB.js +1 -0
- package/assets/editor/assets/rich-paste-route-Bx69sREx.js +1 -0
- package/assets/editor/assets/ride-overlay-C1TrM7Ki.js +1 -0
- package/assets/editor/assets/selection-overlay-primitives-CfOaP5_G.js +1 -0
- package/assets/editor/assets/shape-meta-YgfIm0bQ.js +1 -0
- package/assets/editor/assets/shape-render-DZscezZk.js +1 -0
- package/assets/editor/assets/shapes-D5w8NTQQ.js +11 -0
- package/assets/editor/assets/{slide-notes-dialog-BQBXpep6.js → slide-notes-dialog-43EMJFJV.js} +1 -1
- package/assets/editor/assets/slides-DDNzjFz9.js +5 -0
- package/assets/editor/assets/slides-panel-DANnu_nw.js +26 -0
- package/assets/editor/assets/text-breaks-DhCXtQrJ.js +7 -0
- package/assets/editor/assets/{theme-palette-Dl_G_VIJ.js → theme-palette-DEq19D0h.js} +1 -1
- package/assets/editor/assets/tidy-browser-BdlwTfCT.js +1 -0
- package/assets/editor/assets/tidy-scope-REEad7oC.js +1 -0
- package/assets/editor/assets/{tool-catalog-DXPhX2S1.js → tool-catalog-CIjdZm_C.js} +1 -1
- package/assets/editor/assets/{tool-drawer-CWOX_njp.js → tool-drawer-B-Ys7Rsn.js} +1 -1
- package/assets/editor/assets/{tooltip-CyBz17g8.js → tooltip-CKCG8vcp.js} +1 -1
- package/assets/editor/assets/tree-BWJsAqkV.js +1 -0
- package/assets/editor/assets/use-export-command-BR-A4kAa.js +2 -0
- package/assets/editor/assets/{use-grid-keyboard-nav-DhQKecO1.js → use-grid-keyboard-nav-B0jjlh8Q.js} +0 -0
- package/assets/editor/assets/{use-icon-node-BxqH7H27.js → use-icon-node-uhKPP4Ki.js} +1 -1
- package/assets/editor/assets/{use-key-held-094C3Mn3.js → use-key-held-DaUTxGze.js} +1 -1
- package/assets/editor/assets/useTriggerFocusGuards-Mibi8yYw.js +1 -0
- package/assets/editor/assets/web-card-BTru0lge.js +1 -0
- package/assets/editor/assets/web-card-font-BbZEq3En.js +1 -0
- package/assets/editor/assets/web-controls-BjBov-C2.js +1 -0
- package/assets/editor/assets/web-embed-dialog-sT-1yK5o.js +1 -0
- package/assets/editor/assets/web-embed-url-CHu4SU82.js +1 -0
- package/assets/editor/assets/web-embeds-I3saJ_yp.js +1 -0
- package/assets/editor/assets/web-html-dialog-B5Hb3RGw.js +1 -0
- package/assets/editor/assets/web-runtime-wPi8lWzO.js +1 -0
- package/assets/editor/assets/web-widget-limits-DeMquLIR.js +1 -0
- package/assets/editor/assets/web-widgets-DsFUBhiq.js +325 -0
- package/assets/editor/assets/widget-source-C3N9ZKTz.js +2 -0
- package/assets/editor/assets/widget-target-C9a207gT.js +1 -0
- package/assets/editor/index.html +41 -35
- package/dist/koboyo.js +565 -232
- package/package.json +3 -3
- package/skills/koboyo/SKILL.md +8 -3
- package/skills/koboyo/references/architecture.md +1 -1
- package/skills/koboyo/references/bpmn.md +1 -1
- package/skills/koboyo/references/chart.md +1 -1
- package/skills/koboyo/references/cycle.md +1 -1
- package/skills/koboyo/references/erd.md +1 -1
- package/skills/koboyo/references/flowchart.md +1 -1
- package/skills/koboyo/references/funnel.md +1 -1
- package/skills/koboyo/references/gantt.md +1 -1
- package/skills/koboyo/references/gitgraph.md +1 -1
- package/skills/koboyo/references/journey.md +1 -1
- package/skills/koboyo/references/matrix.md +1 -1
- package/skills/koboyo/references/mindmap.md +1 -1
- package/skills/koboyo/references/orgchart.md +1 -1
- package/skills/koboyo/references/pyramid.md +1 -1
- package/skills/koboyo/references/sankey.md +1 -1
- package/skills/koboyo/references/sequence.md +1 -1
- package/skills/koboyo/references/statemachine.md +1 -1
- package/skills/koboyo/references/timeline.md +1 -1
- package/skills/koboyo/references/venn.md +1 -1
- package/skills/koboyo/references/wireframe.md +1 -1
- package/assets/editor/assets/MenuSubmenuTrigger-KacA9GM8.js +0 -1
- package/assets/editor/assets/asset-glyph-C1E6cGwM.js +0 -1
- package/assets/editor/assets/build-pips-BV-uwXlP.js +0 -1
- package/assets/editor/assets/build-visibility-DyML9SHt.js +0 -1
- package/assets/editor/assets/builders-DMHAOPEv.js +0 -1
- package/assets/editor/assets/code-panel-koBUgEWp.js +0 -43
- package/assets/editor/assets/connector-labels-CrEgadsC.js +0 -2
- package/assets/editor/assets/core-CmsJyU_-.js +0 -1
- package/assets/editor/assets/diagram-fingerprint-WGQ5iVXx.js +0 -3
- package/assets/editor/assets/editor-BeufBV54.js +0 -1
- package/assets/editor/assets/export-Bce6ra0N.js +0 -2
- package/assets/editor/assets/export-K2VWg76n.js +0 -6
- package/assets/editor/assets/flow-layer-ewaL7g2y.js +0 -1
- package/assets/editor/assets/flow-panel-BzXNGGke.js +0 -1
- package/assets/editor/assets/flow-stage-Ba_CAggI.js +0 -1
- package/assets/editor/assets/index-CBPPqsiR.js +0 -24
- package/assets/editor/assets/layout-offthread-mRHRulkS.js +0 -18
- package/assets/editor/assets/menu-B9BAk63v.js +0 -1
- package/assets/editor/assets/panel-controls-DWVXiNUZ.js +0 -1
- package/assets/editor/assets/plan-CkgM52Yh.js +0 -1
- package/assets/editor/assets/presentation-DJUO0t7I.js +0 -1
- package/assets/editor/assets/reflow-DaYiVkwp.js +0 -1
- package/assets/editor/assets/registry-rEGZW7Ab.js +0 -1
- package/assets/editor/assets/ride-overlay-Hx90v4ZK.js +0 -1
- package/assets/editor/assets/selection-overlay-primitives-BRp854AD.js +0 -1
- package/assets/editor/assets/shape-meta-COE2ATNh.js +0 -1
- package/assets/editor/assets/slides-D686obFO.js +0 -15
- package/assets/editor/assets/slides-panel-BEJCevJi.js +0 -26
- package/assets/editor/assets/text-breaks-DM4W6y5f.js +0 -7
- package/assets/editor/assets/tidy-browser-dF3BON7J.js +0 -1
- package/assets/editor/assets/tidy-scope-BGG3ZXvZ.js +0 -1
- package/assets/editor/assets/tree-KSgPjntC.js +0 -1
- package/assets/editor/assets/use-export-command-sC9UHj3_.js +0 -2
- package/assets/editor/assets/web-controls-CLE9zr7i.js +0 -1
- package/assets/editor/assets/web-embed-dialog-XUNelFFM.js +0 -1
- package/assets/editor/assets/web-html-dialog-BcAyzH5D.js +0 -1
- package/assets/editor/assets/web-shape-C941TGTy.js +0 -1
- package/assets/editor/assets/widget-source-CHujvUeA.js +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{t as r}from"./tooltip-CKCG8vcp.js";import{i}from"./useTriggerFocusGuards-Mibi8yYw.js";import{C as a,a as o,c as s,d as c,f as l,m as u,n as d,o as f,p,r as m,w as h}from"./menu-4xb5HtA1.js";import{i as g}from"./config-D8b1QyEk.js";import{a as ee,o as _}from"./editor-DAJETlQW.js";import{_ as v,g as y,t as b}from"./reflow-C6bvnSVm.js";import{W as x}from"./style-BENGW2ZV.js";import{J as S,R as C,W as w,j as T,vt as te}from"./shapes-D5w8NTQQ.js";import{A as ne,C as re,c as E,d as D,f as O,i as k,l as ie,n as ae,o as oe,p as se,r as ce,s as le,t as A,u as ue,x as de}from"./slides-DDNzjFz9.js";import{n as fe}from"./renderer-environment-D3n3hbug.js";import{_ as pe,m as me}from"./panel-controls-B0Ccd0XF.js";import{t as j}from"./createReactComponent-C51FAx3B.js";import{n as he,r as ge,t as _e}from"./IconTrash-C8w6ThWx.js";import{t as ve}from"./IconArrowLeft-B4Zcy-Fc.js";import{n as M,t as ye}from"./IconPlayerStopFilled-D4qdct2R.js";import{t as be}from"./IconChevronLeft-D7e7QC0h.js";import{t as N}from"./IconChevronRight-csfMBSUs.js";import{t as xe}from"./IconCode-CHIz1nCU.js";import{a as Se,c as Ce,d as we,f as Te,i as Ee,l as P,n as De,o as Oe,r as ke,s as Ae,t as je,u as Me}from"./ContextMenuTrigger-CXUL1E23.js";import{a as Ne,c as Pe,i as F,n as Fe,o as Ie,r as Le,s as Re,t as ze}from"./build-visibility-CAmmsnmF.js";import{t as Be}from"./IconPencil-D_pQsAyv.js";import{t as Ve}from"./IconPlus-D4tAoi-A.js";import{n as He,r as Ue,t as We}from"./use-drag-reorder-ye8-kpyR.js";import{t as Ge}from"./IconSparkles-CnCp3BCQ.js";import{t as Ke}from"./IconX-KrRqxr2j.js";import{t as qe}from"./IconPlayerPlayFilled-DVAWmYt7.js";import{a as Je,i as Ye,l as Xe,r as Ze,t as Qe}from"./PopoverPopup-1zO38CRl.js";import{t as $e}from"./use-export-command-BR-A4kAa.js";import{n as et}from"./surface-Dke4SWpE.js";import{_ as tt,a as nt,c as rt,d as it,f as at,h as ot,i as st,l as ct,m as lt,n as ut,o as dt,p as ft,r as pt,t as mt,u as ht,v as gt,y as _t}from"./plan-D4Jyzo5X.js";import{a as vt,c as yt,d as bt,f as xt,i as St,l as Ct,n as wt,o as Tt,r as Et,s as Dt,t as Ot,u as kt}from"./edit-B4DMFSZr.js";import{a as At,c as jt}from"./chrome-C2RCq3SI.js";import{i as Mt,n as Nt,r as Pt,t as Ft}from"./DialogRoot-DUeVfNhS.js";import{n as It,t as Lt}from"./DialogTitle-D5au2NAn.js";import{n as Rt,t as zt}from"./shape-meta-YgfIm0bQ.js";import{r as Bt}from"./chrome-layout-D5dql-y4.js";import{t as Vt}from"./panel-shell-COqmheb-.js";import{A as I,C as L,D as R,E as z,O as B,S as V,T as Ht,_ as Ut,a as H,b as Wt,c as Gt,d as Kt,f as U,g as qt,h as Jt,i as Yt,k as W,l as G,m as K,n as Xt,o as Zt,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-DrWdKwLQ.js";import{n as an,t as on}from"./export-u442sUQs.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 zt(e[0]);let n=e.find(e=>Rt(e).trim().length>0);return n?zt(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)(Je,{open:u,onOpenChange:e=>{d(e),e||a(null)},children:[(0,Q.jsx)(pe,{"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)(Ve,{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)(Ye,{children:(0,Q.jsx)(Ze,{side:`left`,align:`end`,sideOffset:8,collisionPadding:8,children:(0,Q.jsxs)(Qe,{"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 ${et.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)(Ae,{size:12,stroke:2})]}),t.map(e=>{let t=e.shapes[0],n=new Set(mt(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)(Se,{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)}),ht(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)})]},gt(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,C=mt(x).filter((e,t)=>t!==b.index).map(e=>e.kind),w=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:``}),w&&!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:w,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)(N,{size:12,stroke:2}):(0,Q.jsx)(i,{size:12,stroke:2})}):w&&(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)(we,{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:C,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)(Ke,{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=>w(t,e)&&C(e,n)),x=ht(t),S=Ne(i);return(0,Q.jsxs)(Je,{open:ee,onOpenChange:_,children:[(0,Q.jsxs)(pe,{"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)(Xe,{})]}),(0,Q.jsx)(Ye,{children:(0,Q.jsx)(Ze,{side:`left`,align:`center`,sideOffset:8,collisionPadding:8,children:(0,Q.jsxs)(Qe,{"data-overlay":!0,onPointerDown:e=>e.stopPropagation(),className:`w-64 p-2.5 ${et.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 ${jt(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 ${jt(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:[Le[e].label,(0,Q.jsxs)(`span`,{className:`text-[10px] tabular-nums text-[var(--chrome-fg-400)]`,children:[Math.round(F(e,e===i?a:void 0,t)),`ms`]})]}),(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-effect-play-${e}`,"aria-label":`Preview ${Le[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)(qe,{size:10})})]},e))})]}),Re(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 ${jt(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 ${jt(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)(me,{label:`duration in milliseconds`,testId:`animate-duration`,value:Math.round(F(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)(me,{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:he,down:ge,left:ve,right:M},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=Fe(),m=(0,X.useMemo)(()=>at(u,t),[u,t]),h=(0,X.useMemo)(()=>tt(u,t),[u,t]),g=(0,X.useMemo)(()=>ut(m,h),[m,h]),v=(0,X.useMemo)(()=>lt(u,t,h),[u,t,h]),y=(0,X.useMemo)(()=>st(u,t,h),[u,t,h]),b=(0,X.useMemo)(()=>_t(m),[m]),x=(0,X.useMemo)(()=>y.filter(e=>e.shapes.some(e=>d.has(e.id))),[y,d]),S=(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]),w=(0,X.useMemo)(()=>pt(m),[m]);function te(e,t){E(wt(m,[e],t===`enter`?ot(e.shapes[0]):void 0,t))}function re(){E(A?wt(m,v):Ot(u,t))}function E(e){e.length!==0&&(l.beginTransaction(),c.getState().replaceMany(e),l.endTransaction())}(0,X.useEffect)(()=>{o(t)},[t.id]);let[D,O]=(0,X.useState)(null);(0,X.useLayoutEffect)(()=>{if(D===null||D<0)return;let e=m[D];e&&p.play(e,T(t))},[D,m,t,p]),(0,X.useEffect)(()=>{if(D===null)return;let e=D>=0?m[D]:null,t=m[D+1]?.afterPrevious?0:xn,n=(e?Ie(e):0)+t,r=setTimeout(()=>{O(e=>e===null||e+1>=m.length?null:e+1)},n);return()=>clearTimeout(r)},[D,m]);let[k,ie]=(0,X.useState)(null);function ae(e,t,n){O(null),p.cancel(),ie({items:e.map(e=>({shape:e.shape,index:e.index,start:0,row:e.row,animation:{...e.animation,step:0,effect:nt(e.shape,t,e.animation.kind),duration:n,delay:void 0}})),armed:e[0]?.animation.kind===`exit`})}(0,X.useEffect)(()=>{if(!k||k.armed)return;let e=setTimeout(()=>ie(e=>e&&!e.armed?{...e,armed:!0}:e),Sn);return()=>clearTimeout(e)},[k]),(0,X.useLayoutEffect)(()=>{if(!k?.armed)return;let e=k.items.some(e=>e.animation.kind===`exit`);p.play({index:0,items:k.items,afterPrevious:!1},T(t)).then(()=>{e&&window.setTimeout(()=>p.cancel(),Sn)})},[k,t,p]),(0,X.useEffect)(()=>{O(null),ie(null)},[m]);function oe(){if(ie(null),D!==null){p.cancel(),O(null);return}m.length!==0&&(o(t),p.cancel(),O(-1))}let se=(0,X.useMemo)(()=>{let e=new Set;if(!f)return e;e.add(f);let t=ne(u,f);return t?.groupId&&h.has(t.groupId)&&e.add(t.groupId),e},[f,u,h]);function ce(e){return{onPointerEnter:()=>c.getState().setHoveredId(e),onPointerLeave:()=>c.getState().setHoveredId(null)}}(0,X.useEffect)(()=>()=>c.getState().setHoveredId(null),[c]);let le=We({count:g.length,gap:bn,disabled:s,onReorder:(e,t)=>E(Tt(g,e,t)),onPress:e=>{let t=g[e];t&&c.getState().setSelectedIds(new Set(t.items.map(e=>e.shape.id)))}}),A=g.length>0;return(0,Q.jsxs)(Q.Fragment,{children:[D!==null&&(0,Q.jsx)(ze,{pending:rt(m,D)}),k&&!k.armed&&(0,Q.jsx)(ze,{pending:new Set(k.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)(Ae,{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)(be,{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)(N,{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)te(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:le.listRef,"data-testid":`animate-list`,className:`flex flex-1 flex-col overflow-y-auto px-3 pb-3 pt-2`,children:[!A&&(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)(Ae,{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:A,onHover:e=>c.getState().setHoveredId(e),onAdd:te,onSweep:re})]})}),A&&(0,Q.jsx)(`div`,{className:`flex flex-col gap-1`,children:g.map((e,t)=>{let n=ft(e);return(0,Q.jsx)(`div`,{ref:le.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:le.rowStyle(t),children:(0,Q.jsx)(pn,{unit:e,click:w[C[t]],playing:D!==null&&C[t]===D,start:n,canJoin:t>0,pointed:se.has(dt(e)),unseen:b.has(ct(e.items[0])),selected:e.items.every(e=>d.has(e.shape.id)),viewMode:s,handlers:{...le.rowHandlers(t),...ce(e.items[0].shape.id)},onSplit:e.groupId?()=>E(xt(g,e.groupId)):null,onMerge:S.has(t)?()=>E(vt(g,S.get(t))):null,onSetEffect:(t,n)=>E(Ct(e.items,t,n)),onSetDelay:t=>E(Dt(e.items,t)),onSetKind:t=>E(kt(e.items,t)),onSetDirection:t=>E(yt(e.items,t)),onPreviewEffect:(t,n)=>ae(e.items,t,n),onSetStart:t=>E(bt(g,dt(e),t)),onRemove:()=>E(Et(g,dt(e)))})},dt(e))})}),!s&&A&&(0,Q.jsx)(`div`,{className:`pt-3`,children:(0,Q.jsx)(dn,{units:y,idleCount:v.length,hasBuild:A,onHover:e=>c.getState().setHoveredId(e),onSweep:re,onAdd:te})})]}),(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:!A,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:oe,children:D===null?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(qe,{size:13}),`Play`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ye,{size:13}),`Stop`]})}),!s&&A&&(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:()=>E(St(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 ht(t[0]).filter(e=>e===`emphasis`||t.some(t=>!mt(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)(qe,{size:14}),`Start presentation`]}),(0,Q.jsxs)(s,{children:[(0,Q.jsx)(f,{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)(l,{children:(0,Q.jsx)(c,{side:`top`,align:`end`,sideOffset:6,className:`z-50 outline-none`,children:(0,Q.jsxs)(m,{"data-overlay":!0,className:`min-w-[185px] p-1`,children:[(0,Q.jsxs)(d,{"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)(d,{"data-testid":`slides-present-current`,onClick:()=>n(`current`),children:[(0,Q.jsx)(a,{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 ${et.popup}`;function An(e){let{index:t,prefix:n,actions:r,skipped:i,Item:o,Separator:s}=e;function c(e,r,i,a,s=!1){return(0,Q.jsxs)(o,{className:s?`${On} text-red-600 data-[highlighted]:bg-red-50`:On,"data-testid":`${n}-${e}-${t}`,onClick:a,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)(a,{size:15,stroke:1.75}),`Present from here`,r.onPresent),l,r.onExportPng?c(`export-png`,(0,Q.jsx)(Oe,{size:15,stroke:1.75}),`Export slide as PNG`,r.onExportPng):null,r.onExportSvg?c(`export-svg`,(0,Q.jsx)(P,{size:15,stroke:1.75}),`Export slide as SVG`,r.onExportSvg):null,r.onEmbed?c(`embed`,(0,Q.jsx)(xe,{size:15,stroke:1.75}),`Embed slide…`,r.onEmbed):null,l,c(`duplicate`,(0,Q.jsx)(Te,{size:15,stroke:1.75}),`Duplicate slide`,r.onDuplicate),c(`rename`,(0,Q.jsx)(Be,{size:15,stroke:1.75}),`Rename slide`,r.onRename),c(`notes`,(0,Q.jsx)(Pe,{size:15,stroke:1.75}),`Speaker notes`,r.onEditNotes),i?c(`skip`,(0,Q.jsx)(Me,{size:15,stroke:1.75}),`Unskip slide`,r.onToggleSkip):c(`skip`,(0,Q.jsx)(we,{size:15,stroke:1.75}),`Skip slide`,r.onToggleSkip),c(`add-above`,(0,Q.jsx)(He,{size:15,stroke:1.75}),`Add slide above`,r.onAddAbove),c(`add-below`,(0,Q.jsx)(Ue,{size:15,stroke:1.75}),`Add slide below`,r.onAddBelow),l,c(`delete`,(0,Q.jsx)(_e,{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)(s,{children:[(0,Q.jsx)(f,{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)(h,{size:13,stroke:1.75})})}),(0,Q.jsx)(l,{children:(0,Q.jsx)(c,{side:`left`,align:`start`,sideOffset:6,className:`z-50 outline-none`,children:(0,Q.jsx)(p,{"data-overlay":!0,className:kn,children:(0,Q.jsx)(An,{index:t,prefix:`slide-menu`,actions:n,skipped:r,Item:u,Separator:o})})})})]})}function Mn(e){let{index:t,actions:n,skipped:r,children:i,disabled:a}=e,s=_(e=>e.coarsePointer);return a||s?(0,Q.jsx)(Q.Fragment,{children:i}):(0,Q.jsxs)(De,{children:[(0,Q.jsx)(je,{render:(0,Q.jsx)(`div`,{style:{display:`contents`}}),children:i}),(0,Q.jsx)(l,{children:(0,Q.jsx)(c,{className:`z-50 outline-none`,children:(0,Q.jsx)(p,{"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:u,Separator:o})})})})]})}function Nn(e){let t=R(e),n=18*t.unit,r=[{x:433,fill:G.red},{x:471,fill:G.yellow},{x:509,fill:G.blue}].map(({x:e,fill:r})=>{let i=t.point(e,158);return z({x:i.x,y:i.y,width:n,height:n},r,{kind:`ellipse`,fillStyle:`bold`})}),i=(e,n,r,i)=>z(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[...r,i(812,100,24,G.yellow),i(128,416,16,G.pink),I(t.rect(120,204,720,90),`Presentation title`,t.font(56)),I(t.rect(180,306,600,40),`A short subtitle that sets the scene`,t.font(24),{color:q}),B([t.point(432,436),t.point(528,436)],{color:U,strokeWidth:4}),I(t.rect(280,452,400,30),`Your name · Occasion · Date`,t.font(16),{color:q})]}function Pn(e){let t=R(e);return[z(t.rect(110,145,230,230),G.yellow,{kind:`ellipse`,label:`01`,fontSize:t.font(80)}),I(t.rect(420,190,460,64),`Section title`,t.font(48),{align:`left`}),B([t.point(422,268),t.point(640,268)],{color:J,strokeWidth:4}),I(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=R(e);return[I(t.rect(330,148,300,26),`THE BIG IDEA`,t.font(15),{letterSpacing:.3,color:q}),I(t.rect(120,192,720,156),`Say the one thing that matters.`,t.font(64)),B([t.point(390,374),t.point(570,374)],{color:U,strokeWidth:5})]}function In(e){let t=R(e),n=(e,n,r,i)=>z(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[Jt(t),n(150,106,26,G.yellow),n(806,92,18,G.blue),n(730,414,20,G.yellow),n(208,408,14,G.pink),B([t.point(434,198),t.point(526,198)],{color:U,strokeWidth:4}),qt(t.rect(120,216,720,90),`A title that glows in the dark`,t.font(52)),qt(t.rect(240,322,480,40),`A quieter cover for serious rooms`,t.font(20),{color:Yt})]}function Ln(e){let t=R(e);return[z(t.rect(0,0,424,Kt.height),G.gray,{dash:`none`,label:`Drop an image
|
|
2
|
+
or paste a screenshot`,fontSize:t.font(18),labelColor:q}),I(t.rect(486,168,300,26),`A DECK ABOUT`,t.font(14),{align:`left`,letterSpacing:.3,color:q}),I(t.rect(486,202,408,140),`The thing you came to hear`,t.font(44),{align:`left`,valign:`top`,lineHeight:1.25}),B([t.point(488,360),t.point(600,360)],{color:U,strokeWidth:4}),I(t.rect(486,384,408,30),`Your name · Occasion · Date`,t.font(16),{align:`left`,color:q})]}function Rn(e){let t=R(e),n=G.green,r=(e,n)=>z(t.rect(e,26,15,15),n,{kind:`ellipse`,fillStyle:`bold`,dash:`none`});return[Jt(t),r(30,G.red),r(56,G.yellow),r(82,G.green),nn(t.point(80,130),`~/talks $ present --topic`,t.font(20),n,{fontFamily:Zt}),nn(t.point(80,176),`"Your big idea"`,t.font(50),Gt,{fontFamily:Zt}),z(t.rect(80,268,20,42),Gt,{dash:`none`}),nn(t.point(80,356),`loading slides… ████████░░ 80%`,t.font(17),n,{fontFamily:Zt,opacity:.8}),nn(t.point(80,458),`# your name · today`,t.font(15),Gt,{fontFamily:Zt,opacity:.5})]}function zn(e){let t=R(e);return[...L(t,`Slide title`),I(t.rect(72,156,816,312),S([`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:H})]}function Bn(e){let t=R(e),n=[{fill:G.blue,text:`Where we are today`},{fill:G.green,text:`What we learned`},{fill:G.yellow,text:`The plan from here`},{fill:G.pink,text:`Questions and next steps`}].flatMap(({fill:e,text:n},r)=>{let i=160+r*78;return V([z(t.rect(72,i,48,48),e,{kind:`ellipse`,label:String(r+1),fontSize:t.font(20)}),I(t.rect(140,i,720,48),n,t.font(24),{align:`left`})])});return[...L(t,`Agenda`),...n]}function Vn(e){let t=R(e);return[...L(t,`Slide title`),B([t.point(480,160),t.point(480,468)],{strokeWidth:1.5,dash:`dashed`,opacity:.35}),I(t.rect(72,156,380,40),`First column`,t.font(24),{align:`left`}),B([t.point(74,204),t.point(150,204)],{color:`#1971c2`,strokeWidth:3}),I(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:H}),I(t.rect(508,156,380,40),`Second column`,t.font(24),{align:`left`}),B([t.point(510,204),t.point(586,204)],{color:`#2f9e44`,strokeWidth:3}),I(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:H})]}function Hn(e){let t=R(e);return[I(t.rect(72,48,816,50),`Which way do we go?`,t.font(36)),...V([z(t.rect(72,132,384,344),G.green,{fillStyle:`outline`}),z(t.rect(404,152,32,32),G.green,{kind:`checkbox`,fillStyle:`bold`}),I(t.rect(96,156,336,40),`Option A`,t.font(28)),I(t.rect(108,212,312,240),S([`Cheaper to build`,`Ships this quarter`,`Less flexible later`]),t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:H})]),...V([z(t.rect(504,132,384,344),G.gray,{fillStyle:`outline`}),I(t.rect(528,156,336,40),`Option B`,t.font(28)),I(t.rect(540,212,312,240),S([`More upfront work`,`Ships next quarter`,`Grows with us`]),t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:H})]),z(t.rect(450,274,60,60),G.yellow,{kind:`ellipse`,fillStyle:`bold`,label:`vs`,fontSize:t.font(22)})]}function Un(e){let t=R(e);return[...L(t,`Before and after`),...V([z(t.rect(72,140,384,330),G.gray),I(t.rect(96,162,344,36),`Before`,t.font(26),{align:`left`}),I(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:H})]),...V([z(t.rect(504,140,384,330),G.green),I(t.rect(528,162,344,36),`After`,t.font(26),{align:`left`}),I(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:H})]),Wt(t.point(462,305),t.point(498,305),5)]}function Wn(e){let t=R(e),n=[{x:72,fill:G.blue,value:`42%`,caption:`more signups`},{x:360,fill:G.teal,value:`3×`,caption:`faster builds`},{x:648,fill:G.purple,value:`12k`,caption:`happy users`}].flatMap(({x:e,fill:n,value:r,caption:i})=>V([z(t.rect(e,150,240,260),n,{fillStyle:`outline`,label:r,fontSize:t.font(56)}),I(t.rect(e+20,330,200,56),i,t.font(18),{color:q})]));return[...L(t,`The quarter in numbers`),...n]}function Gn(e){let t=R(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=V([nn(t.point(84,i+14),String(r+1),t.font(44),e),I(t.rect(160,i,720,84),n,t.font(26),{align:`left`})]);return r>0&&a.push(B([t.point(84,i-10),t.point(876,i-10)],{strokeWidth:1.5,opacity:.15})),a});return[...L(t,`Three takeaways`),...n]}function Kn(e){let t=R(e);return[...L(t,`Do and don't`),...V([z(t.rect(72,150,400,310),G.green,{fillStyle:`outline`}),z(t.rect(96,170,36,36),G.green,{kind:`checkbox`,fillStyle:`bold`}),I(t.rect(148,170,300,36),`Do`,t.font(28),{align:`left`}),I(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:H})]),...V([z(t.rect(488,150,400,310),G.red,{fillStyle:`outline`}),z(t.rect(512,170,36,36),G.red,{kind:`crossbox`,fillStyle:`bold`}),I(t.rect(564,170,300,36),`Don't`,t.font(28),{align:`left`}),I(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:H})])]}function qn(e){let t=R(e),n=[{icon:`zap`,fill:G.yellow,name:`Fast`,desc:`Blank canvas to first stroke in a second`},{icon:`users`,fill:G.blue,name:`Together`,desc:`Share a link, draw with the whole room`},{icon:`share-2`,fill:G.green,name:`Portable`,desc:`PNG, SVG and PDF out of the box`},{icon:`undo-2`,fill:G.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 V([z({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:Xt}),I(t.rect(148,o+2,210,48),r,t.font(22),{align:`left`}),I(t.rect(366,o+2,522,48),i,t.font(17),{align:`left`,color:H})])});return[...L(t,`What you get`),...n]}function Jn(e){let t=R(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 V([Y({x:c.x,y:c.y},s,e,{color:J}),I(t.rect(a+46,o-4,200,40),n,t.font(21),{align:`left`}),I(t.rect(a,o+48,252,76),r,t.font(15),{align:`left`,valign:`top`,lineHeight:1.6,color:H})])});return[...L(t,`Why teams switch`),...n]}function Yn(e){let t=R(e),n=(e,n,r,i)=>z(t.rect(e-126,n-126,252,252),r,{kind:`ellipse`,opacity:.6,color:i,strokeWidth:2}),r=[{cx:300,cy:262,fill:G.blue,ink:$t.blue,name:`What users beg for`},{cx:432,cy:262,fill:G.yellow,ink:$t.yellow,name:`What we're best at`},{cx:366,cy:376,fill:G.teal,ink:$t.teal,name:`What pays the bills`}],i=r.flatMap(({fill:e,name:n},r)=>V([z(t.rect(660,214+r*66,20,20),e,{kind:`ellipse`,fillStyle:`bold`}),I(t.rect(694,208+r*66,200,32),n,t.font(17),{align:`left`})]));return[...L(t,`Where the three meet`),...r.map(({cx:e,cy:t,fill:r,ink:i})=>n(e,t,r,i)),I(t.rect(288,292,156,40),`Do this`,t.font(20)),...i]}function Xn(e){let t=R(e),n=V([z(t.rect(72,140,392,300),G.blue,{fillStyle:`outline`}),I(t.rect(96,164,344,96),`38%`,t.font(72),{align:`left`}),I(t.rect(96,250,344,34),`faster to a first board`,t.font(18),{align:`left`,color:H}),Ut(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=V([z(t.rect(480,140,196,142),G.green,{fillStyle:`outline`}),I(t.rect(496,164,164,62),`4.8`,t.font(48),{align:`left`}),I(t.rect(496,228,164,32),`average rating`,t.font(15),{align:`left`,color:H})]),i=V([z(t.rect(692,140,196,142),G.orange,{fillStyle:`outline`}),Y(t.point(710,162),30*t.unit,`trophy`,{color:J}),I(t.rect(708,204,164,32),`12 of 14 shipped`,t.font(17),{align:`left`}),I(t.rect(708,234,164,28),`two slipped to Q3`,t.font(14),{align:`left`,color:q})]),a=V([z(t.rect(480,298,408,142),G.gray,{fillStyle:`outline`}),I(t.rect(504,316,360,76),`“It replaced three tools and a weekly meeting.”`,t.font(20),{align:`left`,valign:`top`,lineHeight:1.5}),I(t.rect(504,396,360,28),`Kim, platform lead at Globex`,t.font(14),{align:`left`,color:q})]);return[...L(t,`The quarter at a glance`),...n,...r,...i,...a]}function Zn(e){let t=R(e),n=[{fill:G.green,tag:`Added`,text:`Dark mode, at last`},{fill:G.blue,tag:`Improved`,text:`Boards open twice as fast`},{fill:G.red,tag:`Fixed`,text:`That one bug, gone for good`}].flatMap(({fill:e,tag:n,text:r},i)=>{let a=168+i*88;return V([z(t.rect(72,a+4,140,48),e,{fillStyle:`outline`,label:n,fontSize:t.font(18)}),I(t.rect(236,a,652,56),r,t.font(22),{align:`left`})])});return[I(t.rect(72,48,460,56),`What's new`,t.font(36),{align:`left`}),B([t.point(74,118),t.point(250,118)],{color:U,strokeWidth:4}),I(t.rect(560,58,328,36),`v2.4.0 · this week`,t.font(15),{align:`right`,fontFamily:Zt,color:q}),...n,I(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=R(e),n=[G.blue,G.green,G.yellow,G.pink,G.teal,G.purple].flatMap((e,n)=>{let r=240+n%3*240,i=n<3?152:312;return V([z(t.rect(r-42,i,84,84),e,{kind:`ellipse`,label:String.fromCharCode(65+n),fontSize:t.font(28)}),I(t.rect(r-110,i+92,220,24),`Name Surname`,t.font(18)),I(t.rect(r-110,i+118,220,20),`What they do`,t.font(14),{color:q})])});return[...L(t,`Meet the team`),...n]}function $n(e){let t=R(e),n=[{x:72,fill:G.blue,quote:`“It changed how our team plans every single week.”`,who:`Sam, Acme`},{x:368,fill:G.orange,quote:`“The first tool everyone actually kept using.”`,who:`Ada, Initech`},{x:664,fill:G.pink,quote:`“We shipped the rework two weeks early.”`,who:`Kim, Globex`}].flatMap(({x:e,fill:n,quote:r,who:i})=>V([z(t.rect(e,150,256,268),n,{fillStyle:`outline`}),I(t.rect(e+20,172,216,150),r,t.font(18),{align:`left`,valign:`top`,lineHeight:1.5}),K(t.rect(e+18,330,104,22),`rating`,{value:5,fill:U}),I(t.rect(e+20,362,216,32),i,t.font(14),{align:`left`,color:q})]));return[...L(t,`What people say`),...n]}function er(e){let t=R(e),n=e.width/Kt.width,r=e.height/Kt.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?G.blue:`#e9ecef`}:n===2?{background:`#e7f5ff`}:{}));return[...L(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=R(e),n=[{x:176,fill:G.blue,when:`Q1`,what:`Discovery, 20 interviews`},{x:384,fill:G.green,when:`Q2`,what:`First beta, 10 teams`},{x:592,fill:G.yellow,when:`Q3`,what:`Public launch`},{x:792,fill:G.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 V([B([t.point(e,306+l*16),t.point(e,306+l*54)],{strokeWidth:1.5,opacity:.3}),z({x:c.x-s/2,y:c.y-s/2,width:s,height:s},n,{kind:`ellipse`,fillStyle:`bold`}),I(t.rect(e-92,o?184:364,184,34),r,t.font(22),{valign:o?`bottom`:`top`}),I(t.rect(e-92,o?218:398,184,56),i,t.font(15),{valign:o?`bottom`:`top`,lineHeight:1.5,color:H})])});return[...L(t,`Roadmap`),B([t.point(88,306),t.point(890,306)],{strokeWidth:3,endArrow:!0}),...n,z(t.rect(96,332,96,34),J,{kind:`oval`,fillStyle:`bold`,label:`today`,fontSize:t.font(14)}),B([t.point(144,284),t.point(144,332)],{color:J,strokeWidth:2})]}function nr(e){let t=R(e),n=[{x:72,title:`Now`},{x:350,title:`Next`},{x:628,title:`Later`}].flatMap(({x:e,title:n})=>V([z(t.rect(e,140,260,330),`transparent`,{dash:`dashed`,opacity:.6}),I(t.rect(e,152,260,30),n,t.font(22))])),r=116*t.unit,i=[{x:100,y:206,rot:-2,fill:G.yellow,text:`Ship the fix`},{x:168,y:332,rot:3,fill:G.blue,text:`Call the pilot users`},{x:396,y:224,rot:-4,fill:G.green,text:`Write the launch post`},{x:690,y:240,rot:5,fill:G.pink,text:`Explore pricing`}].map(({x:e,y:n,rot:i,fill:a,text:o})=>W(t.point(e,n),r,o,t.font(15),i,a));return[...L(t,`Now, next, later`),...n,...i]}function rr(e){let t=R(e),n=[{label:`Infrastructure`,fill:G.green,pct:.8},{label:`Mobile app`,fill:G.blue,pct:.6},{label:`Documentation`,fill:G.yellow,pct:.45},{label:`Onboarding`,fill:G.pink,pct:.2}].flatMap(({label:e,fill:n,pct:r},i)=>{let a=168+i*76;return V([I(t.rect(72,a,240,32),e,t.font(20),{align:`left`}),z(t.rect(330,a,470,32),G.gray,{dash:`none`}),z(t.rect(330,a,470*r,32),n,{fillStyle:`bold`,dash:`none`}),I(t.rect(814,a,76,32),`${Math.round(r*100)}%`,t.font(16),{align:`left`,fontFamily:Zt,color:H})])});return[...L(t,`Where things stand`),...n]}function ir(e){let t=R(e),n=[{x:72,y:140,fill:G.green,title:`Strengths`,hint:`What we do well`},{x:504,y:140,fill:G.red,title:`Weaknesses`,hint:`Where we struggle`},{x:72,y:314,fill:G.blue,title:`Opportunities`,hint:`What we could ride`},{x:504,y:314,fill:G.yellow,title:`Threats`,hint:`What could hurt us`}].flatMap(({x:e,y:n,fill:r,title:i,hint:a})=>V([z(t.rect(e,n,384,158),r),I(t.rect(e+20,n+12,344,28),i,t.font(20),{align:`left`}),I(t.rect(e+20,n+48,344,96),a,t.font(15),{align:`left`,valign:`top`,color:H})]));return[...L(t,`SWOT`),...n]}function ar(e){let t=R(e),n=[{fill:G.blue,label:`Collect`,note:`Anyone can file a request`},{fill:G.teal,label:`Sort`,note:`Weekly triage, no backlog`},{fill:G.green,label:`Decide`,note:`One owner says yes or no`},{fill:G.yellow,label:`Ship`,note:`Behind a flag, then wide`}].flatMap(({fill:e,label:n,note:r},i)=>{let a=72+i*188;return V([z(t.rect(a,218,234,104),e,{kind:`chevron`,label:n,fontSize:t.font(21)}),I(t.rect(a+44,340,174,76),r,t.font(15),{valign:`top`,lineHeight:1.5,color:q})])});return[...L(t,`How it works`),...n]}var $=.56;function or(e){let t=R(e),n=[{fill:G.blue,value:`12,400`,name:`Visited the site`,note:`any page, any source`},{fill:G.teal,value:`1,860`,name:`Started a trial`,note:`15% of visitors`},{fill:G.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(...V([z(t.rect(340-r/2,l,r,96),e,{kind:`trapezoid`,rotation:180}),I(t.rect(340-d/2,u-24,d,48),n,t.font(30-c*4))]),...V([I(t.rect(646,u-30,250,30),o,t.font(20),{align:`left`}),I(t.rect(646,u+2,250,26),s,t.font(15),{align:`left`,color:q})])),c>0&&a.push(I(t.rect(40,u-30,134,30),c===1?`−10,540`:`−1,450`,t.font(17),{align:`right`,color:q}),Wt(t.point(340-r/2+18,u-6),t.point(150,u+12),1.8,{color:q})),r*=$}),[...L(t,`Where people drop off`),...i,...a,B([t.point(622,156),t.point(622,428)],{strokeWidth:1.5,dash:`dashed`,opacity:.3}),z(t.rect(258,460,164,38),G.gray,{kind:`oval`,fillStyle:`outline`,label:`3.3% end to end`,fontSize:t.font(16)})]}function sr(e){let t=R(e),n=[{fill:G.purple,label:`Why`,note:`Teams lose their mornings to status meetings`},{fill:G.blue,label:`How`,note:`One board replaces the four tools they juggle`},{fill:G.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(...V([z(t.rect(330-r/2,s,r,96),e,{kind:`trapezoid`}),I(t.rect(330-r*$*.5,c-22,r*$,44),n,t.font(24))]),...V([z(t.rect(660,c-26,12,12),e,{kind:`ellipse`,fillStyle:`bold`}),I(t.rect(684,c-34,212,68),a,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:H})])),r/=$});let a=180*$;return[...L(t,`How the work ladders up`),z(t.rect(330-a/2,118,a,58),G.yellow,{kind:`triangle`}),...i]}function cr(e){let t=R(e),n={x:340,y:318},r=[{label:`Talk to users`,fill:G.blue},{label:`Pick one bet`,fill:G.teal},{label:`Ship it small`,fill:G.green},{label:`Measure it`,fill:G.yellow}],i=r.map(({label:e,fill:i},a)=>{let o=-Math.PI/2+a*2*Math.PI/r.length;return z(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 Ht({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[...L(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}),I(t.rect(646,240,250,34),`Every two weeks`,t.font(21),{align:`left`}),I(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:H})]}function lr(e){let t=R(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)=>z(t.rect(e,r(n)-27,148,54),a,{label:i,fontSize:t.font(16)}),a=i(126,0,`Reports a bug`,G.blue),o=i(324,1,`Triages it`,G.teal),s=i(522,2,`Ships a fix`,G.green),c=i(720,0,`Confirms`,G.blue),l=(e,t)=>Ht({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[...L(t,`Who picks it up`),n,a,o,s,c,l(a,o),l(o,s),l(s,c)]}function ur(e){let t=R(e),n=e=>250+e*106,r=Array.from({length:6},(e,r)=>[B([t.point(n(r),150),t.point(n(r),440)],{strokeWidth:1.5,opacity:.12}),I(t.rect(n(r),118,106,26),`W${r+1}`,t.font(14),{color:q})]).flat(),i=[{name:`Research`,from:0,span:2,fill:G.purple},{name:`Design`,from:1,span:2,fill:G.blue},{name:`Build`,from:2,span:3,fill:G.teal},{name:`Beta`,from:4,span:1.5,fill:G.green},{name:`Launch prep`,from:5,span:.7,fill:G.yellow}].flatMap(({name:e,from:r,span:i,fill:a},o)=>{let s=170+o*52;return V([I(t.rect(72,s,164,36),e,t.font(17),{align:`left`}),z(t.rect(n(r)+6,s+4,106*i-12,28),a,{kind:`oval`,fillStyle:`bold`,dash:`none`})])});return[...L(t,`Six weeks to launch`),...r,...i,B([t.point(n(2),138),t.point(n(2),448)],{color:J,strokeWidth:2,dash:`dashed`}),I(t.rect(n(2)-60,452,120,26),`today`,t.font(14),{color:J}),z(t.rect(852,378,36,36),G.red,{kind:`diamond`,fillStyle:`bold`}),I(t.rect(714,418,168,26),`Launch`,t.font(15),{align:`right`,color:H})]}function dr(e){let t=R(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})=>V([I(t.rect(72,e,540,44),n,t.font(19),{align:`left`}),z(t.rect(640,e+9,160,24),G.gray,{dash:`none`}),z(t.rect(640,e+9,160*r,24),G.green,{fillStyle:`bold`,dash:`none`}),I(t.rect(812,e+2,76,38),i,t.font(18),{align:`left`,color:H})]));return[...L(t,`This quarter's OKRs`),z(t.rect(72,144,816,62),G.blue,{label:`Objective — Make onboarding effortless`,fontSize:t.font(22)}),...n]}function fr(e){let t=R(e);return[...L(t,`The problem we solve`),...V([z(t.rect(72,150,384,320),G.red,{fillStyle:`outline`}),I(t.rect(96,174,336,40),`The problem`,t.font(26),{align:`left`}),I(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:H})]),...V([z(t.rect(504,150,384,320),G.green,{fillStyle:`outline`}),I(t.rect(528,174,336,40),`Our solution`,t.font(26),{align:`left`}),I(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:H})]),Wt(t.point(462,310),t.point(498,310),5)]}function pr(e){let t=R(e),n=[{d:340,fill:G.blue},{d:230,fill:G.teal},{d:120,fill:G.green}].map(({d:e,fill:n})=>z(t.rect(330-e/2,480-e,e,e),n,{kind:`ellipse`})),r=[{y:190,fill:G.blue,value:`TAM — $4.2B`,caption:`everyone with the problem`},{y:268,fill:G.teal,value:`SAM — $600M`,caption:`who we can reach`},{y:346,fill:G.green,value:`SOM — $40M`,caption:`a realistic first bite`}].flatMap(({y:e,fill:n,value:r,caption:i})=>V([z(t.rect(560,e+4,22,22),n,{kind:`ellipse`,fillStyle:`bold`}),I(t.rect(596,e,292,30),r,t.font(22),{align:`left`}),I(t.rect(596,e+34,292,26),i,t.font(15),{align:`left`,color:q})]));return[...L(t,`How big is this?`),...n,...r]}function mr(e){let t=R(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=[z(t.rect(e,156,248,314),a?G.blue:G.gray,{fillStyle:`outline`}),I(t.rect(e+24,180,200,34),n,t.font(22),{align:`left`}),I(t.rect(e+24,218,200,60),r,t.font(44),{align:`left`}),I(t.rect(e+26,240,200,60),`per person / month`,t.font(13),{align:`right`,valign:`bottom`,color:q}),I(t.rect(e+24,306,200,150),i,t.font(17),{align:`left`,valign:`top`,lineHeight:2,color:H})];return a&&o.push(Qt(t.rect(e+50,138,148,30),G.yellow,`MOST POPULAR`,t.font(12),{labelColor:Xt})),V(o)});return[...L(t,`Pick a plan`),...n]}function hr(e){let t=R(e);return[...L(t,`Where the line is going`),Ut(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 V([I(t.rect(648,i,240,56),e,t.font(40),{align:`left`}),I(t.rect(648,i+54,240,30),n,t.font(15),{align:`left`,color:q})])})]}function gr(e){let t=R(e);return[...L(t,`How we sit in the market`),Ut(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=R(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 V([Y({x:o.x,y:o.y},a,e,{color:`#2f9e44`}),I(t.rect(108,i,380,34),n,t.font(17),{align:`left`,color:H})])});return[...L(t,`The ask`),I(t.rect(72,158,420,96),`$2.5M`,t.font(76),{align:`left`}),I(t.rect(72,250,420,34),`seed round · 18 months of runway`,t.font(19),{align:`left`,color:q}),...n,Ut(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=R(e),n=[{x:136,y:146,fill:G.green,title:`Quick wins`,align:`left`},{x:491,y:146,fill:G.blue,title:`Big bets`,align:`right`},{x:136,y:299,fill:G.gray,title:`Fill-ins`,align:`left`},{x:491,y:299,fill:G.red,title:`Money pits`,align:`right`}].flatMap(({x:e,y:n,fill:r,title:i,align:a})=>[z({...t.rect(e,n,710/2,306/2)},r,{dash:`none`,opacity:.35}),I(t.rect(e+(a===`left`?16:-16),n+10,710/2-32,26),i,t.font(15),{align:a,color:H})]),r=96*t.unit,i=[{x:190,y:176,rot:-3,fill:G.green,text:`Ship this week`},{x:604,y:190,rot:4,fill:G.blue,text:`The big rewrite`},{x:236,y:322,rot:2,fill:G.yellow,text:`Nice to have`},{x:640,y:336,rot:-5,fill:G.red,text:`Kill it`}].map(({x:e,y:n,rot:i,fill:a,text:o})=>W(t.point(e,n),r,o,t.font(14),i,a));return[...L(t,`Where to spend the effort`),...n,B([t.point(120,299),t.point(868,299)],{strokeWidth:2,endArrow:!0,opacity:.5}),B([t.point(491,468),t.point(491,124)],{strokeWidth:2,endArrow:!0,opacity:.5}),...i,I(t.rect(692,466,160,26),`more effort`,t.font(14),{align:`right`,color:q}),I(t.rect(503,112,160,26),`more impact`,t.font(14),{align:`left`,color:q})]}function yr(e){let t=R(e),n=[{x:72,fill:G.green,icon:`circle-check`,title:`In scope`,body:`Shared inbox
|
|
21
|
+
Weekly digest
|
|
22
|
+
Slack alerts`},{x:350,fill:G.red,icon:`circle-slash`,title:`Not this time`,body:`Mobile app
|
|
23
|
+
Custom roles
|
|
24
|
+
SSO`},{x:628,fill:G.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})=>V([z(t.rect(e,232,260,186),n,{fillStyle:`outline`}),z(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`}}),I(t.rect(e+18,292,224,112),a,t.font(15),{align:`left`,valign:`top`,lineHeight:1.9,color:H})])),r=[`Owner · Ada`,`Ships · 14 August`,`Check-in · Fridays, 10:00`].map((e,n)=>Qt(t.rect(72+n*250,448,232,38),G.gray,e,t.font(15),{fillStyle:`pastel`}));return[...L(t,`Project kickoff`),z(t.rect(72,140,816,68),G.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=R(e),n=e=>186+e*140,r=[{label:`Hears of us`,doing:`A teammate shares a board`,mood:`smile`,fill:G.green},{label:`Signs up`,doing:`Three fields, no card`,mood:`smile`,fill:G.green},{label:`First board`,doing:`Stares at a blank canvas`,mood:`meh`,fill:G.yellow},{label:`Invites the team`,doing:`Nobody joins for a week`,mood:`frown`,fill:G.red},{label:`Renews`,doing:`Finance asks what it's for`,mood:`meh`,fill:G.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),G.blue,e,t.font(14),{fillStyle:`outline`}),I(t.rect(s,206,132,76),r,t.font(14),{valign:`top`,lineHeight:1.5,color:H}),Y({x:l.x-c/2,y:l.y-c/2},c,i,{color:a===G.green?`#2f9e44`:a===G.red?`#e03131`:`#f08c00`})]}),i=[`Doing`,`Feeling`,`Fix it here`].map((e,n)=>I(t.rect(56,[212,306,384][n],110,30),e,t.font(15),{align:`right`,color:q})),a=104*t.unit;return[...L(t,`The trip they take`),B([t.point(176,292),t.point(888,292)],{strokeWidth:1.5,opacity:.15}),B([t.point(176,366),t.point(888,366)],{strokeWidth:1.5,opacity:.15}),...r,...i,W(t.point(n(2)+14,384),a,`Start from a template`,t.font(13),-3),W(t.point(n(3)+14,384),a,`Invite from the empty board`,t.font(13),4)]}function xr(e){let t=R(e);return[...L(t,`What the data says`),Ut(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}),I(t.rect(648,170,240,30),`The takeaway`,t.font(22),{align:`left`}),I(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:H})]}function Sr(e){let t=R(e),n=z(t.rect(96,220,180,90),G.blue,{label:`Client`,fontSize:t.font(20),titleIcon:{source:`lucide`,name:`monitor`,placement:`inside`}}),r=z(t.rect(390,220,180,90),G.teal,{label:`API`,fontSize:t.font(20),titleIcon:{source:`lucide`,name:`server`,placement:`inside`}}),i=z(t.rect(684,205,180,120),G.purple,{kind:`cylinder`,label:`Database`,fontSize:t.font(20)});return[...L(t,`How it fits together`),n,r,i,Ht(t.point(278,265),t.point(388,265),n,r,{label:`REST`,fontSize:t.font(14),strokeWidth:2.4}),Ht(t.point(572,265),t.point(682,265),r,i,{label:`SQL`,fontSize:t.font(14),strokeWidth:2.4}),I(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=R(e);return[z(t.rect(-65,277,330,56),G.yellow,{fillStyle:`bold`,label:`THE ONE NUMBER`,fontSize:t.font(17),letterSpacing:.15,rotation:-90}),I(t.rect(180,150,600,200),`99.9%`,t.font(120)),I(t.rect(180,366,600,40),`what it measures, and why it matters`,t.font(20),{color:q}),B([t.point(420,352),t.point(540,352)],{color:J,strokeWidth:4})]}function wr(e){let t=R(e);return[z(t.rect(72,84,400,372),G.gray,{dash:`none`,label:`Drop an image
|
|
26
|
+
or sketch here`,fontSize:t.font(18),labelColor:q}),I(t.rect(528,132,360,80),`Show, then tell`,t.font(36),{align:`left`}),B([t.point(530,224),t.point(660,224)],{color:U,strokeWidth:4}),I(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:H})]}function Tr(e){let t=R(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}),I(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}),z({x:i.x,y:i.y,width:r,height:r},G.yellow,{kind:`ellipse`,label:`A`,fontSize:t.font(18)}),I(t.rect(196,410,400,28),`Ada Lovelace`,t.font(19),{align:`left`}),I(t.rect(196,436,400,26),`Head of platform, Initech`,t.font(15),{align:`left`,color:q})]}function Er(e){let t=R(e);return[rn(t.rect(112,64,224,424),`phone`),K(t.rect(128,92,192,22),`statusbar`,{label:`9:41`,fontSize:t.font(11)}),K(t.rect(128,122,192,30),`heading`,{label:`Boards`,fontSize:t.font(18)}),K(t.rect(128,160,192,34),`search`,{label:`Search boards…`,fontSize:t.font(12)}),K(t.rect(128,206,192,116),`list`,{label:`Sprint board | Roadmap wall | Retro — Tuesday`,fontSize:t.font(12)}),K(t.rect(128,336,192,42),`button`,{label:`New board`,fill:G.blue,fontSize:t.font(13)}),K(t.rect(128,424,192,44),`tabbar`,{label:`Home | Search | You`,fontSize:t.font(11)}),I(t.rect(420,150,470,80),`In your pocket`,t.font(36),{align:`left`}),B([t.point(422,240),t.point(552,240)],{color:U,strokeWidth:4}),I(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:H})]}function Dr(e){let t=R(e);return[...L(t,`Where the work lives`),rn(t.rect(72,148,520,312),`browser`),K(t.rect(84,196,96,252),`sidebar`,{label:`Boards | Team | Settings`,fontSize:t.font(11),fill:G.gray}),K(t.rect(192,194,200,30),`heading`,{label:`Roadmap wall`,fontSize:t.font(16)}),K(t.rect(428,196,152,28),`segmented`,{label:`Day | Week | Month`,fontSize:t.font(10),fill:G.blue}),...[{x:192,label:`Now`},{x:326,label:`Next`},{x:460,label:`Later`}].map(({x:e,label:n})=>K(t.rect(e,238,120,86),`card`,{label:n,fontSize:t.font(12)})),K(t.rect(192,340,388,100),`list`,{label:`Ship the fix | Call the pilot users | Write the launch post`,fontSize:t.font(12)}),I(t.rect(628,190,260,76),`One wall for the whole team`,t.font(25),{align:`left`,valign:`top`,lineHeight:1.3}),I(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:H})]}function Or(e){let t=R(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[...L(t,`What to look at`),z(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[K({x:o.x,y:o.y,width:r,height:r},`stepbadge`,{label:String(a+1),fontSize:t.font(15),fill:G.yellow}),...V([K(t.rect(628,s,34,34),`stepbadge`,{label:String(a+1),fontSize:t.font(15),fill:G.yellow}),I(t.rect(674,s-4,214,84),i,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:H})])]})]}function kr(e){let t=R(e),n=(e,n,r)=>z(e,`transparent`,{dash:`dashed`,label:n,fontSize:t.font(r),labelColor:q,opacity:.6});return[...L(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=R(e),n=124*t.unit,r=[{x:128,y:96,rot:-4,fill:G.blue,text:`What if…?`},{x:660,y:84,rot:3,fill:G.green,text:`Steal this idea`},{x:116,y:326,rot:5,fill:G.pink,text:`Open question`},{x:692,y:318,rot:-6,fill:G.teal,text:`Remember this`},{x:408,y:392,rot:2,fill:G.yellow,text:`Wild card`}].map(({x:e,y:r,rot:i,fill:a,text:o})=>W(t.point(e,r),n,o,t.font(15),i,a));return[z(t.rect(350,200,260,120),G.yellow,{kind:`ellipse`,fillStyle:`bold`,label:`The topic`,fontSize:t.font(26)}),...r]}function jr(e){let t=R(e),n=(e,n,r,i)=>z(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[n(186,122,44,G.yellow),n(744,104,32,G.pink),n(252,396,26,G.blue),I(t.rect(160,186,640,100),`Demo time`,t.font(72)),I(t.rect(280,300,400,48),`(everything will be fine)`,t.font(30),{fontFamily:en,color:H}),W(t.point(656,360),132*t.unit,`Plan B: screenshots`,t.font(16),5)]}function Mr(e){let t=R(e),n=26*t.unit,r=t.point(772,102);return[z({x:r.x,y:r.y,width:n,height:n},G.pink,{kind:`heart`,fillStyle:`bold`}),I(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),G.gray,e,t.font(15),{fillStyle:`pastel`})),W(t.point(688,366),180*.85*t.unit,`Questions?`,t.font(20),-6)]}function Nr(e){let t=R(e),n=84*t.unit,r=t.point(480,132);return[Y({x:r.x-n/2,y:r.y},n,`coffee`,{color:J}),I(t.rect(160,248,640,90),`Back in 10 minutes`,t.font(56)),I(t.rect(280,344,400,44),`stretch, refill, ignore Slack`,t.font(28),{fontFamily:en,color:H}),K(t.rect(330,424,300,18),`progress`,{value:.35,fill:G.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=fe(),[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=Ee(),ee=l.filter(e=>m===`all`||e.category===m||d?.(e));return(0,Q.jsx)(Ft,{open:t,onOpenChange:n,children:(0,Q.jsxs)(Nt,{children:[(0,Q.jsx)(Mt,{className:`fixed inset-0 bg-gray-900/15`}),(0,Q.jsxs)(Pt,{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)(Lt,{className:`text-[15px] text-[var(--chrome-fg-900)]`,children:r}),(0,Q.jsx)(It,{"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)(Ke,{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:Kt,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=fe(),i=(0,X.useMemo)(()=>ie(n,t),[n,t]),a=Ee(),[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,T(t),e=>t.fill&&t.fill!==`transparent`?te(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=ke(`slide`),o=ee(),{store:s,viewportAnimation:c,history:l}=o,u=$e(),{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:w,updateShape:te,setSelectedIds:ne,setSlidesOpen:fe,setSlidePickerOpen:pe,setNotesEditorId:me,setAnimateSlideId:j,setAiOpen:he,setPresentingIndex:ge,setViewport:_e,setExportDialog:ve}=s.getState(),M=(0,X.useMemo)(()=>k(p),[p]),ye=(0,X.useMemo)(()=>it(p),[p]),be=(0,X.useMemo)(()=>oe(M).length,[M]),[N,xe]=(0,X.useState)(null);(0,X.useEffect)(()=>{qr(new Set(M.map(e=>e.id)))},[M]);let Se=Bt()===`docked`,Te=(0,X.useCallback)(()=>{let e=t.current,n=e?.clientWidth??window.innerWidth,r=e?.clientHeight??window.innerHeight;return{width:Math.max(1,n-(Se?272:0)),height:r}},[t,Se]),Ee=(0,X.useMemo)(()=>A(M,m,Te()),[M,m,Te]);function P(e){c.animate(s.getState().viewport,de(T(e),Te(),Xr),_e)}(0,X.useEffect)(()=>{if(!v||y.size===0)return;let e=s.getState().shapes,t=D(e,k(e),y);!t||t.id===v||j(t.id)},[y,v,s,j]);function De(e,t){let{width:n,height:r}=Te(),i=re({x:n/2,y:r/2},m),a={...ae(M,i,p),slideOrder:e,slideLayout:t&&t.id!==`blank`?t.id:void 0},o=t?t.build(T(a)):[];d(),C(le(M,e)),x([a,...o]),S(new Set([a.id])),f(),ne(new Set([a.id])),P(a)}function Oe(e){let t=s.getState().shapes,{clones:n,renumbered:r}=ce(t,M,e);d(),C(r),x(n),S(new Set([n[0].id])),f(),ne(new Set([n[0].id])),P(n[0])}function je(e){let t=s.getState().shapes;w(se(t,M[e])),ne(new Set)}function Me(e,t){let n=s.getState().shapes,r=M[e],i=ie(n,r),a={bounds:T(r),padding:0,background:r.fill,measurement:o.measurement},c=ue(r,e);u(t===`png`?`downloadPng`:`downloadSvg`,i,{options:a,filename:c})}function Ne(e){be!==0&&ge(e??Math.max(0,Ee))}function Pe(){if(!N)return;let e=N.value.trim();e!==N.initial&&te(N.id,{label:e}),xe(null)}let F=We({count:M.length,gap:Zr,disabled:b,onPress:e=>P(M[e]),onReorder:(e,t)=>C(E(M,e,t)),canDrag:()=>!N}),Fe=v?M.findIndex(e=>e.id===v):-1,Ie=Fe>=0?M[Fe]:void 0;return(0,Q.jsxs)(Vt,{width:272,testId:`slides-panel`,ariaLabel:`Slides`,onDismiss:()=>fe(!1),children:[Ie?(0,Q.jsx)(Cn,{figure:Ie,index:Fe,total:M.length,viewMode:b,onBack:()=>j(null),onGoToSlide:e=>{let t=M[e];t&&(j(t.id),P(t))},onFocusSlide:P}):(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 (`,M.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:()=>he(!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)(Ge,{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:()=>pe(!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)(Ve,{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:be===0,onClick:()=>ve({format:`pdf`}),className:`${At} disabled:pointer-events-none disabled:text-[var(--chrome-fg-300)]`,children:(0,Q.jsx)(Ce,{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:()=>fe(!1),className:At,children:(0,Q.jsx)(Ke,{size:16,stroke:1.75})})})]})]}),(0,Q.jsx)(`div`,{className:`mx-3 h-px bg-[var(--chrome-divider)]`}),(0,Q.jsxs)(`div`,{ref:F.listRef,"data-testid":`slides-list`,className:`flex flex-1 flex-col gap-3 overflow-y-auto p-3`,children:[M.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:()=>pe(!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)(Ve,{size:14,stroke:1.75}),`Add slide`]})]}),M.map((e,t)=>{let n=O(e,t),r=t===Ee,o={onPresent:()=>Ne(t),onExportPng:i?null:()=>Me(t,`png`),onExportSvg:i?null:()=>Me(t,`svg`),onEmbed:a?()=>a(e.id):null,onDuplicate:()=>Oe(t),onRename:()=>xe({id:e.id,initial:n,value:n}),onEditNotes:()=>me(e.id),onToggleSkip:()=>te(e.id,{slideSkipped:!e.slideSkipped||void 0}),onAddAbove:()=>De(t),onAddBelow:()=>De(t+1),onDelete:()=>je(t)};return(0,Q.jsxs)(`div`,{ref:F.setItemRef(t),"data-testid":`slide-item-${t}`,className:`group relative shrink-0`,style:F.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`}`,...F.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)(we,{size:11,stroke:1.75}),`Skipped`]}),ye.has(e.id)&&(0,Q.jsxs)(`div`,{"data-testid":`slide-animated-${t}`,title:`Animated: plays in ${ye.get(e.id)} clicks`,className:Yr,children:[(0,Q.jsx)(Ae,{size:11,stroke:1.75}),ye.get(e.id)]})]}),N?.id===e.id?(0,Q.jsx)(`input`,{autoFocus:!0,onFocus:e=>e.target.select(),value:N.value,onChange:e=>xe({...N,value:e.target.value}),onBlur:Pe,onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&Pe(),e.key===`Escape`&&xe(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:()=>P(e),onDoubleClick:t=>{t.stopPropagation(),b||xe({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:be===0,onPresent:e=>Ne(e===`beginning`?0:void 0)})})]}),(0,Q.jsx)(Vr,{open:h,onOpenChange:pe,onPick:e=>{De(M.length,e),Se||fe(!1)}})]})}export{Qr as SlidesPanel};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{K as e,Z as t,n}from"./shapes-D5w8NTQQ.js";import{t as r}from"./web-card-font-BbZEq3En.js";function i(e,t,n){}function a(e){return(e.split(`,`)[0]?.trim()??``).replace(/^['"]|['"]$/g,``)}var o=`JetBrains Mono`;function s(e,t){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:e.type===`web`&&!e.poster?t?t(e):`${e.label} ${e.kind}`:``}function c(e,t){let n=new Set,i=!1,c=!1,l=new Set,u=e=>{for(let t of e)l.add(t.codePointAt(0)??0)};for(let l of e){let e=s(l,t),d=!!e||l.type===`chart`||l.type===`table`;if(d&&`fontFamily`in l&&l.fontFamily&&n.add(a(l.fontFamily)),d&&l.type===`web`&&n.add(a(r)),e.includes(`<code`)&&n.add(o),i||=e.includes(`<strong`),c||=e.includes(`<em`),u(e),`cells`in l&&Array.isArray(l.cells))for(let e of l.cells)for(let t of e)u(String(t));if(l.type===`table`&&l.cellStyles){for(let e of l.cellStyles)if(e)for(let t of e)t?.fontFamily&&n.add(a(t.fontFamily))}}return{families:n,bold:i,italic:c,codepoints:l}}var l={woff2:`font/woff2`,woff:`font/woff`,truetype:`font/ttf`,opentype:`font/otf`};function u(e,t){let n=e.format??`woff2`,r=`data:${l[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 d(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`)&&f(e.unicodeRange??``,o)).map(e=>u(e,n)).join(`
|
|
2
|
+
`)}function f(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 p=`#ffec99`,m=.14;function h(e,t){return(e.fill??``).localeCompare(t.fill??``)||e.y-t.y||e.x-t.x}function g(e,t){return{id:n(),type:`sticky`,x:e.x,y:e.y,width:180,height:180,rotation:0,text:``,fontSize:t.fontSize,fontFamily:t.fontFamily,fill:t.fill===`transparent`?p:t.fill,opacity:t.opacity}}var _=new Set([`/`,`\\`,`.`,`_`,`-`,`:`,`#`,`,`,`?`,`&`,`=`,`@`]),v=2,y=/^[A-Za-z0-9]{1,5}$/,b=e=>e!==e.toUpperCase()&&e===e.toLowerCase(),x=e=>e!==e.toLowerCase()&&e===e.toUpperCase();function S(e){let t=Array.from(e),n=[];for(let e=v;e<=t.length-v;e+=1){let r=t[e-1],i=t[e];if(_.has(r)&&!_.has(i)){(r!==`.`||!y.test(t.slice(e).join(``)))&&n.push(e);continue}let a=b(r)&&x(i),o=x(r)&&x(i)&&b(t[e+1]??``);(a||o)&&n.push(e)}return n}function C(e){let t=Array.from(e),n=[0,...S(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 w(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 T(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=w(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}C(r).forEach((e,t)=>a(e,t===0?` `:``))}return(i||r.length===0)&&r.push(i),r}function E(n,r,i){return n.split(`
|
|
3
|
+
`).map(n=>n.split(` `).map(n=>e(n,i)<=r?t(n):C(n).map(t).join(`<wbr>`)).join(` `)).join(`
|
|
4
|
+
`)}var D={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`},O=/^<\/?(?:br|p|div|li|ul|ol|h[1-6]|blockquote)\b/i;function k(e){let t=[];for(let n of e.split(/(<[^>]*>)/))if(n){if(n.startsWith(`<`)&&n.endsWith(`>`)){t.push({raw:n,char:O.test(n)?`
|
|
5
|
+
`:``,tag:!0});continue}for(let e of n.matchAll(/&[#\w]+;|[\s\S]/gu)){let n=e[0],r=n.length>1?D[n]??`x`:n;t.push({raw:n,char:r,tag:!1})}}return t}function A(t,n,r){let i=k(t),a=new Set,o=[],s=()=>{let t=o.map(e=>i[e].char).join(``);if(t&&e(t,r)>n&&Array.from(t).length===o.length)for(let e of S(t))a.add(o[e]);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 j(t,n,r){return t.split(`
|
|
6
|
+
`).map(t=>t.split(` `).map(t=>e(t,r)<=n?t:C(t).join(``)).join(` `)).join(`
|
|
7
|
+
`)}export{T as a,h as c,a as d,f,j as i,g as l,i as m,E as n,p as o,c as p,A as r,m as s,S as t,d as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{dt as e}from"./shapes-D5w8NTQQ.js";var t={...e,bg:`#ffffff`},n={bg:`#1c1c1f`,ink:`#e6e6e6`,inkMuted:`#a6a7ae`,inkInverse:`#1e1e1e`,paperBg:`#26262b`,paperGrid:`rgba(255, 255, 255, 0.06)`,paperLine:`rgba(255, 255, 255, 0.13)`};export{t as n,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,Z as t}from"./style-BENGW2ZV.js";import{$ as n,C as r,M as i,h as a,j as o}from"./shapes-D5w8NTQQ.js";import{_ as s}from"./slides-DDNzjFz9.js";import{r as c}from"./elk-worker-loader-BCdkmVMX.js";import{t as l}from"./icons-DzW1j-r3.js";import{i as u,r as d,t as f}from"./tidy-scope-REEad7oC.js";import{n as p}from"./asset-glyph-DjBHkQcP.js";import{n as m}from"./shape-meta-YgfIm0bQ.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-JPTCbsLL.js";import{T as S}from"./builders-DrWdKwLQ.js";import{t as C}from"./widget-source-C3N9ZKTz.js";var w={none:[!1,!1],start:[!0,!1],end:[!1,!0],both:[!0,!0]},T={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}},E={top:`top`,right:`right`,bottom:`bottom`,left:`left`};function D(e,t){return!e||!t||`kind`in e||!T[t]?e:{...e,anchor:T[t],precise:!0}}function O(t,n){if(t.type!==`arrow`)return t;let r={...t};n.fromSide&&(r.startBinding=D(r.startBinding,n.fromSide)),n.toSide&&(r.endBinding=D(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?w[n.arrows]:n.bidirectional?w.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 k(e){return e.type===`rectangle`||e.type===`icon`||e.type===`sticky`||e.type===`table`||e.type===`chart`}function A(e,t){return{id:e,width:t.width,height:t.height,rank:0,x:t.x,y:t.y}}function j(t,n,r,a,s){let c=()=>{let e=O(S(i(t),i(n),t,n),r);return e.strokeWidth=g,e},l=o(t),u=o(n),d=a.filter(e=>e.id!==t.id&&e.id!==n.id&&k(e)).map(e=>o(e));if(!b([i(t),i(n)],d)&&r.bend===`curved`)return c();let f=_({bounds:l,side:r.fromSide?E[r.fromSide]:void 0},{bounds:u,side:r.toSide?E[r.toSide]:void 0},d,void 0,s);if(!f)return c();let p=y({from:A(t.id,l),to:A(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?w[r.arrows]:r.bidirectional?w.both:void 0;return m&&(p.startArrow=m[0],p.endArrow=m[1]),r.style===`dotted`&&(p.dash=`dotted`),p}function M(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 N=(()=>{let e={};for(let[t,n]of Object.entries(h))n&&!(n in e)&&(e[n]=t);return e})();function P(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:N[e.kind]}:{id:e.id,label:t}}var F=28,I=44;function L(e,t,n,r,i){if(e.type===`rectangle`||e.type===`icon`||e.type===`sticky`)return{...e,x:t,y:n,width:r,height:i};let s=o(e);return a(e,{x:t-s.x,y:n-s.y})}function R(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:M(e,j(r,i,{},t))}async function z(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=r(v);if(!x)return[];let S=_.filter(e=>e.type===`figure`),C=(e,n)=>t(i(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=P(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 j=r(A);if(!j)return[];let N=x.x-j.x,z=x.y-j.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,L(e,n.x+N,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 r=a(H[t],{x:N,y:z}),i=M(e,r);return i.startBinding=U(i.startBinding),i.endBinding=U(i.endBinding),r.label&&e.label&&!n(e.label)&&(i.label=r.label),i}):[];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+N,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=r(s(c,e).map(e=>K.get(e.id)).filter(e=>e!==void 0));if(t){let n={...e,x:t.x-F,y:t.y-I,width:t.width+F*2,height:t.height+F+I};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=>R(t,e))}return[...B.values(),...G,...W]}var B=c(),V={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)=>B.measure(e,t,n,r),loadWidgetHtml:C};function H(e,t,n){return z(e,t,n,V)}export{H as tidyInBrowser};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Z as e}from"./style-BENGW2ZV.js";import{M as t,j as n}from"./shapes-D5w8NTQQ.js";import{_ as r}from"./slides-DDNzjFz9.js";var i=new Set([`rectangle`,`icon`,`sticky`]);function a(r,i){let a=t(i),o;for(let t of r){let r=n(t);e(a,r)&&(!o||r.width*r.height<o.width*o.height)&&(o=t)}return o}function o(e,t){let n=new Set(t),o=e.filter(e=>e.type===`figure`&&(e.kind??`simple`)===`simple`&&e.slideOrder===void 0);for(let t=0;t<4;t+=1){let t=n.size;for(let t of e)n.has(t.id)&&t.type===`figure`&&r(e,t).forEach(e=>n.add(e.id));for(let t of e){if(!n.has(t.id)||!i.has(t.type))continue;let e=a(o,t);e&&n.add(e.id)}if(n.size===t)break}return n}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 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DKdBMi_L.js";import{Sr as t}from"./slides-D686obFO.js";import{r as n}from"./frames-Cp1QD3LR.js";import{t as r}from"./createReactComponent-C51FAx3B.js";import{t as i}from"./IconAlertTriangle-B33xznYN.js";import{t as a}from"./IconEraser-CYfXj27R.js";import{t as ee}from"./IconLink-VS5p9Ytk.js";import{t as te}from"./IconMinus-BcaDLts8.js";import{t as ne}from"./IconMoodSmile-CSZ5p_Hy.js";import{t as re}from"./IconPencil-D_pQsAyv.js";import{t as o}from"./IconPhoto-5zuCDtnR.js";import{t as ie}from"./IconSearch-CCpMt02s.js";import{t as s}from"./IconSparkles-CnCp3BCQ.js";import{C as c,b as l,c as u,f as d,g as f,h as p,p as ae,s as oe,v as se,x as ce,y as le}from"./PopoverPopup-B3Y0VRYc.js";import{t as ue}from"./keys-DrjiT9FL.js";var m=r(`outline`,`adjustments-horizontal`,`AdjustmentsHorizontal`,[[`path`,{d:`M12 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-0`}],[`path`,{d:`M4 6l8 0`,key:`svg-1`}],[`path`,{d:`M16 6l4 0`,key:`svg-2`}],[`path`,{d:`M6 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-3`}],[`path`,{d:`M4 12l2 0`,key:`svg-4`}],[`path`,{d:`M10 12l10 0`,key:`svg-5`}],[`path`,{d:`M15 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-6`}],[`path`,{d:`M4 18l11 0`,key:`svg-7`}],[`path`,{d:`M19 18l1 0`,key:`svg-8`}]]),de=r(`outline`,`align-justified`,`AlignJustified`,[[`path`,{d:`M4 6l16 0`,key:`svg-0`}],[`path`,{d:`M4 12l16 0`,key:`svg-1`}],[`path`,{d:`M4 18l12 0`,key:`svg-2`}]]),fe=r(`outline`,`antenna-bars-5`,`AntennaBars5`,[[`path`,{d:`M6 18l0 -3`,key:`svg-0`}],[`path`,{d:`M10 18l0 -6`,key:`svg-1`}],[`path`,{d:`M14 18l0 -9`,key:`svg-2`}],[`path`,{d:`M18 18l0 -12`,key:`svg-3`}]]),h=r(`outline`,`app-window`,`AppWindow`,[[`path`,{d:`M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10`,key:`svg-0`}],[`path`,{d:`M6 8h.01`,key:`svg-1`}],[`path`,{d:`M9 8h.01`,key:`svg-2`}]]),pe=r(`outline`,`box-margin`,`BoxMargin`,[[`path`,{d:`M8 8h8v8h-8l0 -8`,key:`svg-0`}],[`path`,{d:`M4 4v.01`,key:`svg-1`}],[`path`,{d:`M8 4v.01`,key:`svg-2`}],[`path`,{d:`M12 4v.01`,key:`svg-3`}],[`path`,{d:`M16 4v.01`,key:`svg-4`}],[`path`,{d:`M20 4v.01`,key:`svg-5`}],[`path`,{d:`M4 20v.01`,key:`svg-6`}],[`path`,{d:`M8 20v.01`,key:`svg-7`}],[`path`,{d:`M12 20v.01`,key:`svg-8`}],[`path`,{d:`M16 20v.01`,key:`svg-9`}],[`path`,{d:`M20 20v.01`,key:`svg-10`}],[`path`,{d:`M20 16v.01`,key:`svg-11`}],[`path`,{d:`M20 12v.01`,key:`svg-12`}],[`path`,{d:`M20 8v.01`,key:`svg-13`}],[`path`,{d:`M4 16v.01`,key:`svg-14`}],[`path`,{d:`M4 12v.01`,key:`svg-15`}],[`path`,{d:`M4 8v.01`,key:`svg-16`}]]),g=r(`outline`,`brackets-contain`,`BracketsContain`,[[`path`,{d:`M7 4h-4v16h4`,key:`svg-0`}],[`path`,{d:`M17 4h4v16h-4`,key:`svg-1`}],[`path`,{d:`M8 16h.01`,key:`svg-2`}],[`path`,{d:`M12 16h.01`,key:`svg-3`}],[`path`,{d:`M16 16h.01`,key:`svg-4`}]]),me=r(`outline`,`browser`,`Browser`,[[`path`,{d:`M4 8h16`,key:`svg-0`}],[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-1`}],[`path`,{d:`M8 4v4`,key:`svg-2`}]]),he=r(`outline`,`calendar`,`Calendar`,[[`path`,{d:`M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12`,key:`svg-0`}],[`path`,{d:`M16 3v4`,key:`svg-1`}],[`path`,{d:`M8 3v4`,key:`svg-2`}],[`path`,{d:`M4 11h16`,key:`svg-3`}],[`path`,{d:`M11 15h1`,key:`svg-4`}],[`path`,{d:`M12 15v3`,key:`svg-5`}]]),ge=r(`outline`,`cards`,`Cards`,[[`path`,{d:`M3.604 7.197l7.138 -3.109a.96 .96 0 0 1 1.27 .527l4.924 11.902a1 1 0 0 1 -.514 1.304l-7.137 3.109a.96 .96 0 0 1 -1.271 -.527l-4.924 -11.903a1 1 0 0 1 .514 -1.304l0 .001`,key:`svg-0`}],[`path`,{d:`M15 4h1a1 1 0 0 1 1 1v3.5`,key:`svg-1`}],[`path`,{d:`M20 6c.264 .112 .52 .217 .768 .315a1 1 0 0 1 .53 1.311l-2.298 5.374`,key:`svg-2`}]]),_=r(`outline`,`chart-area-line`,`ChartAreaLine`,[[`path`,{d:`M4 19l4 -6l4 2l4 -5l4 4l0 5l-16 0`,key:`svg-0`}],[`path`,{d:`M4 12l3 -4l4 2l5 -6l4 4`,key:`svg-1`}]]),v=r(`outline`,`chart-bar`,`ChartBar`,[[`path`,{d:`M3 13a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -6`,key:`svg-0`}],[`path`,{d:`M15 9a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -10`,key:`svg-1`}],[`path`,{d:`M9 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -14`,key:`svg-2`}],[`path`,{d:`M4 20h14`,key:`svg-3`}]]),y=r(`outline`,`chart-dots`,`ChartDots`,[[`path`,{d:`M3 3v18h18`,key:`svg-0`}],[`path`,{d:`M7 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M17 7a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-2`}],[`path`,{d:`M12 15a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-3`}],[`path`,{d:`M10.16 10.62l2.34 2.88`,key:`svg-4`}],[`path`,{d:`M15.088 13.328l2.837 -4.586`,key:`svg-5`}]]),b=r(`outline`,`chart-grid-dots`,`ChartGridDots`,[[`path`,{d:`M16 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-0`}],[`path`,{d:`M4 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M4 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-2`}],[`path`,{d:`M16 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-3`}],[`path`,{d:`M8 18h8`,key:`svg-4`}],[`path`,{d:`M18 20v1`,key:`svg-5`}],[`path`,{d:`M18 3v1`,key:`svg-6`}],[`path`,{d:`M6 20v1`,key:`svg-7`}],[`path`,{d:`M6 10v-7`,key:`svg-8`}],[`path`,{d:`M12 3v18`,key:`svg-9`}],[`path`,{d:`M18 8v8`,key:`svg-10`}],[`path`,{d:`M8 12h13`,key:`svg-11`}],[`path`,{d:`M21 6h-1`,key:`svg-12`}],[`path`,{d:`M16 6h-13`,key:`svg-13`}],[`path`,{d:`M3 12h1`,key:`svg-14`}],[`path`,{d:`M20 18h1`,key:`svg-15`}],[`path`,{d:`M3 18h1`,key:`svg-16`}],[`path`,{d:`M6 14v2`,key:`svg-17`}]]),x=r(`outline`,`chart-line`,`ChartLine`,[[`path`,{d:`M4 19l16 0`,key:`svg-0`}],[`path`,{d:`M4 15l4 -6l4 2l4 -5l4 4`,key:`svg-1`}]]),S=r(`outline`,`chart-pie`,`ChartPie`,[[`path`,{d:`M10 3.2a9 9 0 1 0 10.8 10.8a1 1 0 0 0 -1 -1h-6.8a2 2 0 0 1 -2 -2v-7a.9 .9 0 0 0 -1 -.8`,key:`svg-0`}],[`path`,{d:`M15 3.5a9 9 0 0 1 5.5 5.5h-4.5a1 1 0 0 1 -1 -1v-4.5`,key:`svg-1`}]]),C=r(`outline`,`checkbox`,`Checkbox`,[[`path`,{d:`M9 11l3 3l8 -8`,key:`svg-0`}],[`path`,{d:`M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9`,key:`svg-1`}]]),w=r(`outline`,`chevrons-right`,`ChevronsRight`,[[`path`,{d:`M7 7l5 5l-5 5`,key:`svg-0`}],[`path`,{d:`M13 7l5 5l-5 5`,key:`svg-1`}]]),T=r(`outline`,`circle-dashed`,`CircleDashed`,[[`path`,{d:`M8.56 3.69a9 9 0 0 0 -2.92 1.95`,key:`svg-0`}],[`path`,{d:`M3.69 8.56a9 9 0 0 0 -.69 3.44`,key:`svg-1`}],[`path`,{d:`M3.69 15.44a9 9 0 0 0 1.95 2.92`,key:`svg-2`}],[`path`,{d:`M8.56 20.31a9 9 0 0 0 3.44 .69`,key:`svg-3`}],[`path`,{d:`M15.44 20.31a9 9 0 0 0 2.92 -1.95`,key:`svg-4`}],[`path`,{d:`M20.31 15.44a9 9 0 0 0 .69 -3.44`,key:`svg-5`}],[`path`,{d:`M20.31 8.56a9 9 0 0 0 -1.95 -2.92`,key:`svg-6`}],[`path`,{d:`M15.44 3.69a9 9 0 0 0 -3.44 -.69`,key:`svg-7`}]]),E=r(`outline`,`circle-dot`,`CircleDot`,[[`path`,{d:`M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-1`}]]),D=r(`outline`,`circle-number-1`,`CircleNumber1`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M10 10l2 -2v8`,key:`svg-1`}]]),O=r(`outline`,`circle-plus`,`CirclePlus`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0`,key:`svg-0`}],[`path`,{d:`M9 12h6`,key:`svg-1`}],[`path`,{d:`M12 9v6`,key:`svg-2`}]]),k=r(`outline`,`circle`,`Circle`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}]]),A=r(`outline`,`device-mobile`,`DeviceMobile`,[[`path`,{d:`M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}],[`path`,{d:`M11 4h2`,key:`svg-1`}],[`path`,{d:`M12 17v.01`,key:`svg-2`}]]),j=r(`outline`,`device-tablet`,`DeviceTablet`,[[`path`,{d:`M5 4a1 1 0 0 1 1 -1h12a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-12a1 1 0 0 1 -1 -1v-16`,key:`svg-0`}],[`path`,{d:`M11 17a1 1 0 1 0 2 0a1 1 0 0 0 -2 0`,key:`svg-1`}]]),M=r(`outline`,`forms`,`Forms`,[[`path`,{d:`M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3`,key:`svg-0`}],[`path`,{d:`M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3`,key:`svg-1`}],[`path`,{d:`M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7`,key:`svg-2`}],[`path`,{d:`M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1`,key:`svg-3`}],[`path`,{d:`M17 12h.01`,key:`svg-4`}],[`path`,{d:`M13 12h.01`,key:`svg-5`}]]),N=r(`outline`,`hand-stop`,`HandStop`,[[`path`,{d:`M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5`,key:`svg-0`}],[`path`,{d:`M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5`,key:`svg-1`}],[`path`,{d:`M14 5.5a1.5 1.5 0 0 1 3 0v6.5`,key:`svg-2`}],[`path`,{d:`M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47`,key:`svg-3`}]]),P=r(`outline`,`heading`,`Heading`,[[`path`,{d:`M7 12h10`,key:`svg-0`}],[`path`,{d:`M7 5v14`,key:`svg-1`}],[`path`,{d:`M17 5v14`,key:`svg-2`}],[`path`,{d:`M15 19h4`,key:`svg-3`}],[`path`,{d:`M15 5h4`,key:`svg-4`}],[`path`,{d:`M5 19h4`,key:`svg-5`}],[`path`,{d:`M5 5h4`,key:`svg-6`}]]),F=r(`outline`,`highlight`,`Highlight`,[[`path`,{d:`M3 19h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4`,key:`svg-0`}],[`path`,{d:`M12.5 5.5l4 4`,key:`svg-1`}],[`path`,{d:`M4.5 13.5l4 4`,key:`svg-2`}],[`path`,{d:`M21 15v4h-8l4 -4l4 0`,key:`svg-3`}]]),I=r(`outline`,`lasso`,`Lasso`,[[`path`,{d:`M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255`,key:`svg-0`}],[`path`,{d:`M3 15a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M5 17c0 1.42 .316 2.805 1 4`,key:`svg-2`}]]),L=r(`outline`,`layout-bottombar`,`LayoutBottombar`,[[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M4 15l16 0`,key:`svg-1`}]]),R=r(`outline`,`layout-columns`,`LayoutColumns`,[[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M12 4l0 16`,key:`svg-1`}]]),_e=r(`outline`,`layout-kanban`,`LayoutKanban`,[[`path`,{d:`M4 4l6 0`,key:`svg-0`}],[`path`,{d:`M14 4l6 0`,key:`svg-1`}],[`path`,{d:`M4 10a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -8`,key:`svg-2`}],[`path`,{d:`M14 10a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -2`,key:`svg-3`}]]),ve=r(`outline`,`layout-navbar`,`LayoutNavbar`,[[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M4 9l16 0`,key:`svg-1`}]]),ye=r(`outline`,`layout-rows`,`LayoutRows`,[[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M4 12l16 0`,key:`svg-1`}]]),be=r(`outline`,`layout-sidebar`,`LayoutSidebar`,[[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M9 4l0 16`,key:`svg-1`}]]),z=r(`outline`,`list`,`List`,[[`path`,{d:`M9 6l11 0`,key:`svg-0`}],[`path`,{d:`M9 12l11 0`,key:`svg-1`}],[`path`,{d:`M9 18l11 0`,key:`svg-2`}],[`path`,{d:`M5 6l0 .01`,key:`svg-3`}],[`path`,{d:`M5 12l0 .01`,key:`svg-4`}],[`path`,{d:`M5 18l0 .01`,key:`svg-5`}]]),B=r(`outline`,`menu-2`,`Menu2`,[[`path`,{d:`M4 6l16 0`,key:`svg-0`}],[`path`,{d:`M4 12l16 0`,key:`svg-1`}],[`path`,{d:`M4 18l16 0`,key:`svg-2`}]]),V=r(`outline`,`message`,`Message`,[[`path`,{d:`M8 9h8`,key:`svg-0`}],[`path`,{d:`M8 13h6`,key:`svg-1`}],[`path`,{d:`M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12`,key:`svg-2`}]]),xe=r(`outline`,`north-star`,`NorthStar`,[[`path`,{d:`M3 12h18`,key:`svg-0`}],[`path`,{d:`M12 21v-18`,key:`svg-1`}],[`path`,{d:`M7.5 7.5l9 9`,key:`svg-2`}],[`path`,{d:`M7.5 16.5l9 -9`,key:`svg-3`}]]),Se=r(`outline`,`note`,`Note`,[[`path`,{d:`M13 20l7 -7`,key:`svg-0`}],[`path`,{d:`M13 20v-6a1 1 0 0 1 1 -1h6v-7a2 2 0 0 0 -2 -2h-12a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7`,key:`svg-1`}]]),Ce=r(`outline`,`numbers`,`Numbers`,[[`path`,{d:`M8 10v-7l-2 2`,key:`svg-0`}],[`path`,{d:`M6 16a2 2 0 1 1 4 0c0 .591 -.601 1.46 -1 2l-3 3h4`,key:`svg-1`}],[`path`,{d:`M15 14a2 2 0 1 0 2 -2a2 2 0 1 0 -2 -2`,key:`svg-2`}],[`path`,{d:`M6.5 10h3`,key:`svg-3`}]]),we=r(`outline`,`pointer`,`Pointer`,[[`path`,{d:`M7.904 17.563a1.2 1.2 0 0 0 2.228 .308l2.09 -3.093l4.907 4.907a1.067 1.067 0 0 0 1.509 0l1.047 -1.047a1.067 1.067 0 0 0 0 -1.509l-4.907 -4.907l3.113 -2.09a1.2 1.2 0 0 0 -.309 -2.228l-13.582 -3.904l3.904 13.563`,key:`svg-0`}]]),Te=r(`outline`,`polygon`,`Polygon`,[[`path`,{d:`M10 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-0`}],[`path`,{d:`M17 8a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M3 11a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-2`}],[`path`,{d:`M13 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-3`}],[`path`,{d:`M6.5 9.5l3.5 -3`,key:`svg-4`}],[`path`,{d:`M14 5.5l3 1.5`,key:`svg-5`}],[`path`,{d:`M18.5 10l-2.5 7`,key:`svg-6`}],[`path`,{d:`M13.5 17.5l-7 -5`,key:`svg-7`}]]),Ee=r(`outline`,`select`,`Select`,[[`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}],[`path`,{d:`M9 11l3 3l3 -3`,key:`svg-1`}]]),De=r(`outline`,`separator-horizontal`,`SeparatorHorizontal`,[[`path`,{d:`M4 12l16 0`,key:`svg-0`}],[`path`,{d:`M8 8l4 -4l4 4`,key:`svg-1`}],[`path`,{d:`M16 16l-4 4l-4 -4`,key:`svg-2`}]]),H=r(`outline`,`square`,`Square`,[[`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}]]),Oe=r(`outline`,`star`,`Star`,[[`path`,{d:`M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245`,key:`svg-0`}]]),U=r(`outline`,`table`,`Table`,[[`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}],[`path`,{d:`M3 10h18`,key:`svg-1`}],[`path`,{d:`M10 3v18`,key:`svg-2`}]]),ke=r(`outline`,`tag`,`Tag`,[[`path`,{d:`M6.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3`,key:`svg-1`}]]),Ae=r(`outline`,`toggle-right`,`ToggleRight`,[[`path`,{d:`M14 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-0`}],[`path`,{d:`M2 12a6 6 0 0 1 6 -6h8a6 6 0 0 1 6 6a6 6 0 0 1 -6 6h-8a6 6 0 0 1 -6 -6`,key:`svg-1`}]]),je=r(`outline`,`typography`,`Typography`,[[`path`,{d:`M4 20l3 0`,key:`svg-0`}],[`path`,{d:`M14 20l7 0`,key:`svg-1`}],[`path`,{d:`M6.9 15l6.9 0`,key:`svg-2`}],[`path`,{d:`M10.2 6.3l5.8 13.7`,key:`svg-3`}],[`path`,{d:`M5 20l6 -16l2 0l7 16`,key:`svg-4`}]]),Me=r(`outline`,`user-circle`,`UserCircle`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M9 10a3 3 0 1 0 6 0a3 3 0 1 0 -6 0`,key:`svg-1`}],[`path`,{d:`M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855`,key:`svg-2`}]]),Ne=r(`outline`,`vector-spline`,`VectorSpline`,[[`path`,{d:`M17 4a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -2`,key:`svg-0`}],[`path`,{d:`M3 18a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -2`,key:`svg-1`}],[`path`,{d:`M17 5c-6.627 0 -12 5.373 -12 12`,key:`svg-2`}]]),Pe=r(`outline`,`window-maximize`,`WindowMaximize`,[[`path`,{d:`M3 17a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-3a1 1 0 0 1 -1 -1l0 -3`,key:`svg-0`}],[`path`,{d:`M4 12v-6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-6`,key:`svg-1`}],[`path`,{d:`M12 8h4v4`,key:`svg-2`}],[`path`,{d:`M16 8l-5 5`,key:`svg-3`}]]),W={select:{label:`Select`,chord:`v`,icon:we,tool:`select`,viewSafe:!0},lasso:{label:`Lasso select`,chord:`q`,icon:I,tool:`lasso`},hand:{label:`Hand`,help:`Hand (pan)`,chord:`h`,icon:N,tool:`hand`,viewSafe:!0},rectangle:{label:`Rectangle`,chord:`r`,icon:H,tool:`rectangle`},ellipse:{label:`Ellipse`,chord:`o`,icon:k},arrow:{label:`Arrow`,chord:`a`,icon:u,tool:`arrow`},line:{label:`Line`,chord:`l`,icon:te,tool:`line`},polyline:{label:`Multi-point line`,chord:`Shift+KeyC`,icon:Ne,tool:`polyline`},polygon:{label:`Polygon`,chord:`y`,icon:Te,tool:`polygon`},draw:{label:`Draw`,chord:`p`,icon:re,tool:`draw`},highlight:{label:`Highlighter`,chord:`Shift+KeyP`,icon:F,tool:`highlight`},laser:{label:`Laser pointer`,chord:`k`,icon:xe,tool:`laser`,viewSafe:!0},text:{label:`Text`,chord:`t`,icon:je,tool:`text`},sticky:{label:`Sticky note`,chord:`n`,icon:Se,tool:`sticky`},figure:{label:`Frame`,chord:`f`,tool:`figure`},image:{label:`Image`,chord:`i`,icon:o,tool:`image`},icon:{label:`Icons`,chord:`s`,icon:ne,tool:`icon`},imageLibrary:{label:`Image library`,chord:`Shift+KeyS`},chart:{label:`Chart`,chord:`g`,tool:`chart`},stepbadge:{label:`Step badge`,chord:`b`,icon:D},eraser:{label:`Eraser`,chord:`e`,icon:a,tool:`eraser`},comment:{label:`Comment`,chord:`c`,icon:V,viewSafe:!0}};function G(e){return ue(W[e].chord)}var Fe=Object.fromEntries(Object.values(W).flatMap(e=>e.tool?[[e.chord,e.tool]]:[])),K=[{kind:`simple`,icon:ae},{kind:`phone`,icon:A},{kind:`tablet`,icon:j},{kind:`browser`,icon:me},{kind:`window`,icon:h},{kind:`lanes`,icon:ye},{kind:`vlanes`,icon:R},{kind:`boundary`,icon:pe}],q=[{value:`table`,label:`Table`,icon:U},{value:`bar`,label:`Bar chart`,icon:v},{value:`line`,label:`Line chart`,icon:x},{value:`area`,label:`Area chart`,icon:_},{value:`scatter`,label:`Scatter chart`,icon:y},{value:`pie`,label:`Pie chart`,icon:S},{value:`donut`,label:`Donut chart`,icon:T},{value:`radar`,label:`Radar chart`,icon:l},{value:`quadrant`,label:`Quadrant chart`,icon:b}],J=[{kind:`button`,label:`Button`,icon:H},{kind:`input`,label:`Input`,icon:M},{kind:`search`,label:`Search field`,icon:ie},{kind:`checkbox`,label:`Checkbox`,icon:C},{kind:`radio`,label:`Radio`,icon:E},{kind:`toggle`,label:`Toggle`,icon:Ae},{kind:`dropdown`,label:`Dropdown`,icon:Ee},{kind:`slider`,label:`Slider`,icon:m},{kind:`navbar`,label:`Navbar`,icon:ve},{kind:`tabs`,label:`Tabs`,icon:_e},{kind:`image`,label:`Image placeholder`,icon:o},{kind:`avatar`,label:`Avatar`,icon:Me},{kind:`heading`,label:`Heading`,icon:P},{kind:`paragraph`,label:`Paragraph`,icon:de},{kind:`divider`,label:`Divider`,icon:De},{kind:`link`,label:`Link`,icon:ee},{kind:`textarea`,label:`Text area`,icon:c},{kind:`stepper`,label:`Number stepper`,icon:Ce},{kind:`badge`,label:`Badge`,icon:ke},{kind:`progress`,label:`Progress bar`,icon:le},{kind:`breadcrumbs`,label:`Breadcrumbs`,icon:w},{kind:`pagination`,label:`Pagination`,icon:se},{kind:`rating`,label:`Rating`,icon:Oe},{kind:`card`,label:`Card`,icon:ge},{kind:`list`,label:`List`,icon:z},{kind:`alert`,label:`Alert`,icon:i},{kind:`modal`,label:`Modal dialog`,icon:Pe},{kind:`menu`,label:`Menu`,icon:B},{kind:`tooltip`,label:`Tooltip`,icon:V},{kind:`accordion`,label:`Accordion`,icon:oe},{kind:`datepicker`,label:`Date picker`,icon:he},{kind:`sidebar`,label:`Sidebar`,icon:be},{kind:`scrollbar`,label:`Scrollbar`,icon:ce},{kind:`segmented`,label:`Segmented control`,icon:R},{kind:`tabbar`,label:`Bottom tab bar`,icon:L},{kind:`statusbar`,label:`Status bar`,icon:fe},{kind:`fab`,label:`Floating button`,icon:O}],Y={rectangle:`Rectangle`,ellipse:`Ellipse`,diamond:`Diamond`,triangle:`Triangle`,oval:`Oval`,parallelogram:`Parallelogram`,trapezoid:`Trapezoid`,cylinder:`Cylinder`,note:`Note`,hexagon:`Hexagon`,star:`Star`,checkbox:`Checkbox`,crossbox:`Crossed box`,heart:`Heart`,cloud:`Cloud`,"arrow-up":`Arrow up`,"arrow-down":`Arrow down`,"arrow-left":`Arrow left`,"arrow-right":`Arrow right`,plus:`Plus`,"speech-bubble":`Speech bubble`,bolt:`Lightning bolt`,queue:`Queue`,callout:`Callout`,document:`Document`,"predefined-process":`Predefined process`,"manual-input":`Manual input`,pentagon:`Pentagon`,chevron:`Chevron`,octagon:`Octagon`,cube:`Cube`,actor:`Actor`,"double-circle":`Double circle`,card:`Card`,delay:`Delay`,"fork-join":`Fork / join`,"multi-document":`Multi-document`,"multi-process":`Multi-process`,package:`Package`,component:`Component`,brace:`Brace`},X=t.filter(e=>e!==`rectangle`&&e!==`ellipse`&&e!==`actor`),Ie=e();function Le(e){return t=>(0,Ie.jsx)(p,{kind:e,size:t.size})}function Z(e,t,n,r){let i=W[e];return{id:e,label:i.label,group:t,shortcut:G(e),keywords:n,icon:i.icon??H,action:r??{kind:`tool`,tool:i.tool??`select`}}}var Re=[Z(`select`,`Basic`),Z(`hand`,`Basic`,`pan`),Z(`lasso`,`Basic`,`freehand select`),Z(`eraser`,`Basic`),Z(`laser`,`Basic`,`present`),Z(`comment`,`Basic`,`review note feedback pin annotate`,{kind:`tool`,tool:`comment`})],Q=[{id:`ask-ai`,label:`Ask AI`,group:`AI`,keywords:`assistant chat sparkles help`,icon:s,action:{kind:`ai`}},{id:`ai-diagram`,label:`Generate diagram with AI`,group:`AI`,keywords:`assistant architecture flowchart create`,icon:s,action:{kind:`ai`,prompt:`Draw a diagram of `,send:!1}},{id:`ai-deck`,label:`Generate slides with AI`,group:`AI`,keywords:`assistant deck presentation create`,icon:s,action:{kind:`ai`,prompt:`Create a short deck about `,send:!1}},{id:`ai-image`,label:`Generate image with AI`,group:`AI`,keywords:`assistant picture photo create`,icon:s,action:{kind:`ai`,prompt:`Generate an image of `,send:!1}}],ze=[Z(`rectangle`,`Shapes`,`box square`,{kind:`shape`,shape:`rectangle`}),Z(`ellipse`,`Shapes`,`circle oval`,{kind:`shape`,shape:`ellipse`}),...X.map(e=>({id:`shape-${e}`,label:Y[e],group:`Shapes`,keywords:`shape`,icon:Le(e),action:{kind:`shape`,shape:e}})),Z(`stepbadge`,`Shapes`,`number step`,{kind:`control`,control:`stepbadge`}),{id:`entity`,label:`Class / entity`,group:`Shapes`,keywords:`erd uml class table attributes fields`,icon:d,action:{kind:`control`,control:`entity`}},{id:`lifeline`,label:`Lifeline`,group:`Shapes`,keywords:`sequence uml participant`,icon:f,action:{kind:`control`,control:`lifeline`}},{id:`fragment`,label:`Fragment`,group:`Shapes`,keywords:`sequence uml combined opt alt loop par frame container`,icon:g,action:{kind:`control`,control:`fragment`}}],Be=[Z(`arrow`,`Connectors`,`connector`),Z(`line`,`Connectors`,`connector`),Z(`polyline`,`Connectors`,`connector elbow path`),Z(`polygon`,`Connectors`,`shape filled closed outline area band`)],Ve=[Z(`text`,`Text & media`),Z(`sticky`,`Text & media`,`note`),Z(`draw`,`Text & media`,`pen pencil freehand`),Z(`highlight`,`Text & media`,`marker highlight pen freehand`),Z(`image`,`Text & media`,`photo picture`),Z(`icon`,`Text & media`,`emoji sticker symbol`),{id:`web-embed`,label:`Web embed…`,group:`Text & media`,keywords:`iframe video youtube vimeo loom figma codepen map spotify website link url`,icon:h,action:{kind:`web-embed`}}],He=q.map(e=>({id:`data-${e.value}`,label:e.label,group:`Charts & data`,keywords:e.value===`table`?`grid data`:`chart graph data`,icon:e.icon,action:e.value===`table`?{kind:`table`}:{kind:`chart`,chart:e.value}})),Ue=K.map(e=>({id:`frame-${e.kind}`,label:n[e.kind],group:`Frames`,shortcut:e.kind===`simple`?G(`figure`):void 0,keywords:`frame container device mockup`,icon:e.icon,action:{kind:`frame`,frame:e.kind}})),We=J.map(e=>({id:`control-${e.kind}`,label:e.label,group:`UI controls`,keywords:`wireframe mockup ui widget`,icon:e.icon,action:{kind:`control`,control:e.kind}})),$=[...Re,...Q,...ze,...Be,...Ve,...He,...Ue,...We],Ge=new Map($.map(e=>[e.id,e]));function Ke(e,t){let n=$.filter(e=>e.group===`AI`?t.ai:e.id!==`comment`||t.comments),r=new Set(n.map(e=>e.id)),i=e.map(e=>Ge.get(e)).filter(e=>e!==void 0&&r.has(e.id)),a=new Set(i.map(e=>e.id));return{recent:i,rest:n.filter(e=>!a.has(e.id))}}function qe(e,t){if(e.kind===`ai`){t.askAi(e.prompt??``,e.send??!1);return}if(e.kind===`web-embed`){t.openWebEmbed();return}if(e.kind===`tool`){t.selectTool(e.tool);return}if(e.kind===`shape`){t.selectTool(`rectangle`),t.setShapeKind(e.shape);return}if(e.kind===`chart`){t.selectTool(`chart`),t.setChartKind(e.chart);return}if(e.kind===`table`){t.selectTool(`table`);return}if(e.kind===`frame`){t.selectTool(`figure`),t.setFrameKind(e.frame);return}t.insertControl(e.control)}export{_ as C,m as E,v as S,h as T,T as _,X as a,b,Fe as c,U as d,H as f,k as g,z as h,q as i,W as l,B as m,Ke as n,K as o,V as p,J as r,Y as s,qe as t,G as u,S as v,g as w,y as x,x as y};
|
|
1
|
+
import{t as e}from"./jsx-runtime-DKdBMi_L.js";import{Jt as t}from"./shapes-D5w8NTQQ.js";import{r as n}from"./frames-DRSLvE9E.js";import{t as r}from"./createReactComponent-C51FAx3B.js";import{t as i}from"./IconAlertTriangle-B33xznYN.js";import{t as a}from"./IconEraser-CYfXj27R.js";import{t as ee}from"./IconLink-VS5p9Ytk.js";import{t as te}from"./IconMinus-BcaDLts8.js";import{t as ne}from"./IconMoodSmile-CSZ5p_Hy.js";import{t as re}from"./IconPencil-D_pQsAyv.js";import{t as o}from"./IconPhoto-5zuCDtnR.js";import{t as ie}from"./IconSearch-CCpMt02s.js";import{t as s}from"./IconSparkles-CnCp3BCQ.js";import{C as c,b as l,c as u,f as d,g as f,h as p,p as ae,s as oe,v as se,x as ce,y as le}from"./PopoverPopup-1zO38CRl.js";import{t as ue}from"./keys-DrjiT9FL.js";var m=r(`outline`,`adjustments-horizontal`,`AdjustmentsHorizontal`,[[`path`,{d:`M12 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-0`}],[`path`,{d:`M4 6l8 0`,key:`svg-1`}],[`path`,{d:`M16 6l4 0`,key:`svg-2`}],[`path`,{d:`M6 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-3`}],[`path`,{d:`M4 12l2 0`,key:`svg-4`}],[`path`,{d:`M10 12l10 0`,key:`svg-5`}],[`path`,{d:`M15 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-6`}],[`path`,{d:`M4 18l11 0`,key:`svg-7`}],[`path`,{d:`M19 18l1 0`,key:`svg-8`}]]),de=r(`outline`,`align-justified`,`AlignJustified`,[[`path`,{d:`M4 6l16 0`,key:`svg-0`}],[`path`,{d:`M4 12l16 0`,key:`svg-1`}],[`path`,{d:`M4 18l12 0`,key:`svg-2`}]]),fe=r(`outline`,`antenna-bars-5`,`AntennaBars5`,[[`path`,{d:`M6 18l0 -3`,key:`svg-0`}],[`path`,{d:`M10 18l0 -6`,key:`svg-1`}],[`path`,{d:`M14 18l0 -9`,key:`svg-2`}],[`path`,{d:`M18 18l0 -12`,key:`svg-3`}]]),h=r(`outline`,`app-window`,`AppWindow`,[[`path`,{d:`M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10`,key:`svg-0`}],[`path`,{d:`M6 8h.01`,key:`svg-1`}],[`path`,{d:`M9 8h.01`,key:`svg-2`}]]),pe=r(`outline`,`box-margin`,`BoxMargin`,[[`path`,{d:`M8 8h8v8h-8l0 -8`,key:`svg-0`}],[`path`,{d:`M4 4v.01`,key:`svg-1`}],[`path`,{d:`M8 4v.01`,key:`svg-2`}],[`path`,{d:`M12 4v.01`,key:`svg-3`}],[`path`,{d:`M16 4v.01`,key:`svg-4`}],[`path`,{d:`M20 4v.01`,key:`svg-5`}],[`path`,{d:`M4 20v.01`,key:`svg-6`}],[`path`,{d:`M8 20v.01`,key:`svg-7`}],[`path`,{d:`M12 20v.01`,key:`svg-8`}],[`path`,{d:`M16 20v.01`,key:`svg-9`}],[`path`,{d:`M20 20v.01`,key:`svg-10`}],[`path`,{d:`M20 16v.01`,key:`svg-11`}],[`path`,{d:`M20 12v.01`,key:`svg-12`}],[`path`,{d:`M20 8v.01`,key:`svg-13`}],[`path`,{d:`M4 16v.01`,key:`svg-14`}],[`path`,{d:`M4 12v.01`,key:`svg-15`}],[`path`,{d:`M4 8v.01`,key:`svg-16`}]]),g=r(`outline`,`brackets-contain`,`BracketsContain`,[[`path`,{d:`M7 4h-4v16h4`,key:`svg-0`}],[`path`,{d:`M17 4h4v16h-4`,key:`svg-1`}],[`path`,{d:`M8 16h.01`,key:`svg-2`}],[`path`,{d:`M12 16h.01`,key:`svg-3`}],[`path`,{d:`M16 16h.01`,key:`svg-4`}]]),me=r(`outline`,`browser`,`Browser`,[[`path`,{d:`M4 8h16`,key:`svg-0`}],[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-1`}],[`path`,{d:`M8 4v4`,key:`svg-2`}]]),he=r(`outline`,`calendar`,`Calendar`,[[`path`,{d:`M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12`,key:`svg-0`}],[`path`,{d:`M16 3v4`,key:`svg-1`}],[`path`,{d:`M8 3v4`,key:`svg-2`}],[`path`,{d:`M4 11h16`,key:`svg-3`}],[`path`,{d:`M11 15h1`,key:`svg-4`}],[`path`,{d:`M12 15v3`,key:`svg-5`}]]),ge=r(`outline`,`cards`,`Cards`,[[`path`,{d:`M3.604 7.197l7.138 -3.109a.96 .96 0 0 1 1.27 .527l4.924 11.902a1 1 0 0 1 -.514 1.304l-7.137 3.109a.96 .96 0 0 1 -1.271 -.527l-4.924 -11.903a1 1 0 0 1 .514 -1.304l0 .001`,key:`svg-0`}],[`path`,{d:`M15 4h1a1 1 0 0 1 1 1v3.5`,key:`svg-1`}],[`path`,{d:`M20 6c.264 .112 .52 .217 .768 .315a1 1 0 0 1 .53 1.311l-2.298 5.374`,key:`svg-2`}]]),_=r(`outline`,`chart-area-line`,`ChartAreaLine`,[[`path`,{d:`M4 19l4 -6l4 2l4 -5l4 4l0 5l-16 0`,key:`svg-0`}],[`path`,{d:`M4 12l3 -4l4 2l5 -6l4 4`,key:`svg-1`}]]),v=r(`outline`,`chart-bar`,`ChartBar`,[[`path`,{d:`M3 13a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -6`,key:`svg-0`}],[`path`,{d:`M15 9a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -10`,key:`svg-1`}],[`path`,{d:`M9 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -14`,key:`svg-2`}],[`path`,{d:`M4 20h14`,key:`svg-3`}]]),y=r(`outline`,`chart-dots`,`ChartDots`,[[`path`,{d:`M3 3v18h18`,key:`svg-0`}],[`path`,{d:`M7 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M17 7a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-2`}],[`path`,{d:`M12 15a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-3`}],[`path`,{d:`M10.16 10.62l2.34 2.88`,key:`svg-4`}],[`path`,{d:`M15.088 13.328l2.837 -4.586`,key:`svg-5`}]]),b=r(`outline`,`chart-grid-dots`,`ChartGridDots`,[[`path`,{d:`M16 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-0`}],[`path`,{d:`M4 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M4 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-2`}],[`path`,{d:`M16 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-3`}],[`path`,{d:`M8 18h8`,key:`svg-4`}],[`path`,{d:`M18 20v1`,key:`svg-5`}],[`path`,{d:`M18 3v1`,key:`svg-6`}],[`path`,{d:`M6 20v1`,key:`svg-7`}],[`path`,{d:`M6 10v-7`,key:`svg-8`}],[`path`,{d:`M12 3v18`,key:`svg-9`}],[`path`,{d:`M18 8v8`,key:`svg-10`}],[`path`,{d:`M8 12h13`,key:`svg-11`}],[`path`,{d:`M21 6h-1`,key:`svg-12`}],[`path`,{d:`M16 6h-13`,key:`svg-13`}],[`path`,{d:`M3 12h1`,key:`svg-14`}],[`path`,{d:`M20 18h1`,key:`svg-15`}],[`path`,{d:`M3 18h1`,key:`svg-16`}],[`path`,{d:`M6 14v2`,key:`svg-17`}]]),x=r(`outline`,`chart-line`,`ChartLine`,[[`path`,{d:`M4 19l16 0`,key:`svg-0`}],[`path`,{d:`M4 15l4 -6l4 2l4 -5l4 4`,key:`svg-1`}]]),S=r(`outline`,`chart-pie`,`ChartPie`,[[`path`,{d:`M10 3.2a9 9 0 1 0 10.8 10.8a1 1 0 0 0 -1 -1h-6.8a2 2 0 0 1 -2 -2v-7a.9 .9 0 0 0 -1 -.8`,key:`svg-0`}],[`path`,{d:`M15 3.5a9 9 0 0 1 5.5 5.5h-4.5a1 1 0 0 1 -1 -1v-4.5`,key:`svg-1`}]]),C=r(`outline`,`checkbox`,`Checkbox`,[[`path`,{d:`M9 11l3 3l8 -8`,key:`svg-0`}],[`path`,{d:`M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9`,key:`svg-1`}]]),w=r(`outline`,`chevrons-right`,`ChevronsRight`,[[`path`,{d:`M7 7l5 5l-5 5`,key:`svg-0`}],[`path`,{d:`M13 7l5 5l-5 5`,key:`svg-1`}]]),T=r(`outline`,`circle-dashed`,`CircleDashed`,[[`path`,{d:`M8.56 3.69a9 9 0 0 0 -2.92 1.95`,key:`svg-0`}],[`path`,{d:`M3.69 8.56a9 9 0 0 0 -.69 3.44`,key:`svg-1`}],[`path`,{d:`M3.69 15.44a9 9 0 0 0 1.95 2.92`,key:`svg-2`}],[`path`,{d:`M8.56 20.31a9 9 0 0 0 3.44 .69`,key:`svg-3`}],[`path`,{d:`M15.44 20.31a9 9 0 0 0 2.92 -1.95`,key:`svg-4`}],[`path`,{d:`M20.31 15.44a9 9 0 0 0 .69 -3.44`,key:`svg-5`}],[`path`,{d:`M20.31 8.56a9 9 0 0 0 -1.95 -2.92`,key:`svg-6`}],[`path`,{d:`M15.44 3.69a9 9 0 0 0 -3.44 -.69`,key:`svg-7`}]]),E=r(`outline`,`circle-dot`,`CircleDot`,[[`path`,{d:`M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-1`}]]),D=r(`outline`,`circle-number-1`,`CircleNumber1`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M10 10l2 -2v8`,key:`svg-1`}]]),O=r(`outline`,`circle-plus`,`CirclePlus`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0`,key:`svg-0`}],[`path`,{d:`M9 12h6`,key:`svg-1`}],[`path`,{d:`M12 9v6`,key:`svg-2`}]]),k=r(`outline`,`circle`,`Circle`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}]]),A=r(`outline`,`device-mobile`,`DeviceMobile`,[[`path`,{d:`M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}],[`path`,{d:`M11 4h2`,key:`svg-1`}],[`path`,{d:`M12 17v.01`,key:`svg-2`}]]),j=r(`outline`,`device-tablet`,`DeviceTablet`,[[`path`,{d:`M5 4a1 1 0 0 1 1 -1h12a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-12a1 1 0 0 1 -1 -1v-16`,key:`svg-0`}],[`path`,{d:`M11 17a1 1 0 1 0 2 0a1 1 0 0 0 -2 0`,key:`svg-1`}]]),M=r(`outline`,`forms`,`Forms`,[[`path`,{d:`M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3`,key:`svg-0`}],[`path`,{d:`M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3`,key:`svg-1`}],[`path`,{d:`M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7`,key:`svg-2`}],[`path`,{d:`M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1`,key:`svg-3`}],[`path`,{d:`M17 12h.01`,key:`svg-4`}],[`path`,{d:`M13 12h.01`,key:`svg-5`}]]),N=r(`outline`,`hand-stop`,`HandStop`,[[`path`,{d:`M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5`,key:`svg-0`}],[`path`,{d:`M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5`,key:`svg-1`}],[`path`,{d:`M14 5.5a1.5 1.5 0 0 1 3 0v6.5`,key:`svg-2`}],[`path`,{d:`M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47`,key:`svg-3`}]]),P=r(`outline`,`heading`,`Heading`,[[`path`,{d:`M7 12h10`,key:`svg-0`}],[`path`,{d:`M7 5v14`,key:`svg-1`}],[`path`,{d:`M17 5v14`,key:`svg-2`}],[`path`,{d:`M15 19h4`,key:`svg-3`}],[`path`,{d:`M15 5h4`,key:`svg-4`}],[`path`,{d:`M5 19h4`,key:`svg-5`}],[`path`,{d:`M5 5h4`,key:`svg-6`}]]),F=r(`outline`,`highlight`,`Highlight`,[[`path`,{d:`M3 19h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4`,key:`svg-0`}],[`path`,{d:`M12.5 5.5l4 4`,key:`svg-1`}],[`path`,{d:`M4.5 13.5l4 4`,key:`svg-2`}],[`path`,{d:`M21 15v4h-8l4 -4l4 0`,key:`svg-3`}]]),I=r(`outline`,`lasso`,`Lasso`,[[`path`,{d:`M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255`,key:`svg-0`}],[`path`,{d:`M3 15a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M5 17c0 1.42 .316 2.805 1 4`,key:`svg-2`}]]),L=r(`outline`,`layout-bottombar`,`LayoutBottombar`,[[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M4 15l16 0`,key:`svg-1`}]]),R=r(`outline`,`layout-columns`,`LayoutColumns`,[[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M12 4l0 16`,key:`svg-1`}]]),_e=r(`outline`,`layout-kanban`,`LayoutKanban`,[[`path`,{d:`M4 4l6 0`,key:`svg-0`}],[`path`,{d:`M14 4l6 0`,key:`svg-1`}],[`path`,{d:`M4 10a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -8`,key:`svg-2`}],[`path`,{d:`M14 10a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -2`,key:`svg-3`}]]),ve=r(`outline`,`layout-navbar`,`LayoutNavbar`,[[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M4 9l16 0`,key:`svg-1`}]]),ye=r(`outline`,`layout-rows`,`LayoutRows`,[[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M4 12l16 0`,key:`svg-1`}]]),be=r(`outline`,`layout-sidebar`,`LayoutSidebar`,[[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M9 4l0 16`,key:`svg-1`}]]),z=r(`outline`,`list`,`List`,[[`path`,{d:`M9 6l11 0`,key:`svg-0`}],[`path`,{d:`M9 12l11 0`,key:`svg-1`}],[`path`,{d:`M9 18l11 0`,key:`svg-2`}],[`path`,{d:`M5 6l0 .01`,key:`svg-3`}],[`path`,{d:`M5 12l0 .01`,key:`svg-4`}],[`path`,{d:`M5 18l0 .01`,key:`svg-5`}]]),B=r(`outline`,`menu-2`,`Menu2`,[[`path`,{d:`M4 6l16 0`,key:`svg-0`}],[`path`,{d:`M4 12l16 0`,key:`svg-1`}],[`path`,{d:`M4 18l16 0`,key:`svg-2`}]]),V=r(`outline`,`message`,`Message`,[[`path`,{d:`M8 9h8`,key:`svg-0`}],[`path`,{d:`M8 13h6`,key:`svg-1`}],[`path`,{d:`M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12`,key:`svg-2`}]]),xe=r(`outline`,`north-star`,`NorthStar`,[[`path`,{d:`M3 12h18`,key:`svg-0`}],[`path`,{d:`M12 21v-18`,key:`svg-1`}],[`path`,{d:`M7.5 7.5l9 9`,key:`svg-2`}],[`path`,{d:`M7.5 16.5l9 -9`,key:`svg-3`}]]),Se=r(`outline`,`note`,`Note`,[[`path`,{d:`M13 20l7 -7`,key:`svg-0`}],[`path`,{d:`M13 20v-6a1 1 0 0 1 1 -1h6v-7a2 2 0 0 0 -2 -2h-12a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7`,key:`svg-1`}]]),Ce=r(`outline`,`numbers`,`Numbers`,[[`path`,{d:`M8 10v-7l-2 2`,key:`svg-0`}],[`path`,{d:`M6 16a2 2 0 1 1 4 0c0 .591 -.601 1.46 -1 2l-3 3h4`,key:`svg-1`}],[`path`,{d:`M15 14a2 2 0 1 0 2 -2a2 2 0 1 0 -2 -2`,key:`svg-2`}],[`path`,{d:`M6.5 10h3`,key:`svg-3`}]]),we=r(`outline`,`pointer`,`Pointer`,[[`path`,{d:`M7.904 17.563a1.2 1.2 0 0 0 2.228 .308l2.09 -3.093l4.907 4.907a1.067 1.067 0 0 0 1.509 0l1.047 -1.047a1.067 1.067 0 0 0 0 -1.509l-4.907 -4.907l3.113 -2.09a1.2 1.2 0 0 0 -.309 -2.228l-13.582 -3.904l3.904 13.563`,key:`svg-0`}]]),Te=r(`outline`,`polygon`,`Polygon`,[[`path`,{d:`M10 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-0`}],[`path`,{d:`M17 8a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M3 11a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-2`}],[`path`,{d:`M13 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-3`}],[`path`,{d:`M6.5 9.5l3.5 -3`,key:`svg-4`}],[`path`,{d:`M14 5.5l3 1.5`,key:`svg-5`}],[`path`,{d:`M18.5 10l-2.5 7`,key:`svg-6`}],[`path`,{d:`M13.5 17.5l-7 -5`,key:`svg-7`}]]),Ee=r(`outline`,`select`,`Select`,[[`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}],[`path`,{d:`M9 11l3 3l3 -3`,key:`svg-1`}]]),De=r(`outline`,`separator-horizontal`,`SeparatorHorizontal`,[[`path`,{d:`M4 12l16 0`,key:`svg-0`}],[`path`,{d:`M8 8l4 -4l4 4`,key:`svg-1`}],[`path`,{d:`M16 16l-4 4l-4 -4`,key:`svg-2`}]]),H=r(`outline`,`square`,`Square`,[[`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}]]),Oe=r(`outline`,`star`,`Star`,[[`path`,{d:`M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245`,key:`svg-0`}]]),U=r(`outline`,`table`,`Table`,[[`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}],[`path`,{d:`M3 10h18`,key:`svg-1`}],[`path`,{d:`M10 3v18`,key:`svg-2`}]]),ke=r(`outline`,`tag`,`Tag`,[[`path`,{d:`M6.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3`,key:`svg-1`}]]),Ae=r(`outline`,`toggle-right`,`ToggleRight`,[[`path`,{d:`M14 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-0`}],[`path`,{d:`M2 12a6 6 0 0 1 6 -6h8a6 6 0 0 1 6 6a6 6 0 0 1 -6 6h-8a6 6 0 0 1 -6 -6`,key:`svg-1`}]]),je=r(`outline`,`typography`,`Typography`,[[`path`,{d:`M4 20l3 0`,key:`svg-0`}],[`path`,{d:`M14 20l7 0`,key:`svg-1`}],[`path`,{d:`M6.9 15l6.9 0`,key:`svg-2`}],[`path`,{d:`M10.2 6.3l5.8 13.7`,key:`svg-3`}],[`path`,{d:`M5 20l6 -16l2 0l7 16`,key:`svg-4`}]]),Me=r(`outline`,`user-circle`,`UserCircle`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M9 10a3 3 0 1 0 6 0a3 3 0 1 0 -6 0`,key:`svg-1`}],[`path`,{d:`M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855`,key:`svg-2`}]]),Ne=r(`outline`,`vector-spline`,`VectorSpline`,[[`path`,{d:`M17 4a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -2`,key:`svg-0`}],[`path`,{d:`M3 18a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -2`,key:`svg-1`}],[`path`,{d:`M17 5c-6.627 0 -12 5.373 -12 12`,key:`svg-2`}]]),Pe=r(`outline`,`window-maximize`,`WindowMaximize`,[[`path`,{d:`M3 17a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-3a1 1 0 0 1 -1 -1l0 -3`,key:`svg-0`}],[`path`,{d:`M4 12v-6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-6`,key:`svg-1`}],[`path`,{d:`M12 8h4v4`,key:`svg-2`}],[`path`,{d:`M16 8l-5 5`,key:`svg-3`}]]),W={select:{label:`Select`,chord:`v`,icon:we,tool:`select`,viewSafe:!0},lasso:{label:`Lasso select`,chord:`q`,icon:I,tool:`lasso`},hand:{label:`Hand`,help:`Hand (pan)`,chord:`h`,icon:N,tool:`hand`,viewSafe:!0},rectangle:{label:`Rectangle`,chord:`r`,icon:H,tool:`rectangle`},ellipse:{label:`Ellipse`,chord:`o`,icon:k},arrow:{label:`Arrow`,chord:`a`,icon:u,tool:`arrow`},line:{label:`Line`,chord:`l`,icon:te,tool:`line`},polyline:{label:`Multi-point line`,chord:`Shift+KeyC`,icon:Ne,tool:`polyline`},polygon:{label:`Polygon`,chord:`y`,icon:Te,tool:`polygon`},draw:{label:`Draw`,chord:`p`,icon:re,tool:`draw`},highlight:{label:`Highlighter`,chord:`Shift+KeyP`,icon:F,tool:`highlight`},laser:{label:`Laser pointer`,chord:`k`,icon:xe,tool:`laser`,viewSafe:!0},text:{label:`Text`,chord:`t`,icon:je,tool:`text`},sticky:{label:`Sticky note`,chord:`n`,icon:Se,tool:`sticky`},figure:{label:`Frame`,chord:`f`,tool:`figure`},image:{label:`Image`,chord:`i`,icon:o,tool:`image`},icon:{label:`Icons`,chord:`s`,icon:ne,tool:`icon`},imageLibrary:{label:`Image library`,chord:`Shift+KeyS`},chart:{label:`Chart`,chord:`g`,tool:`chart`},stepbadge:{label:`Step badge`,chord:`b`,icon:D},eraser:{label:`Eraser`,chord:`e`,icon:a,tool:`eraser`},comment:{label:`Comment`,chord:`c`,icon:V,viewSafe:!0}};function G(e){return ue(W[e].chord)}var Fe=Object.fromEntries(Object.values(W).flatMap(e=>e.tool?[[e.chord,e.tool]]:[])),K=[{kind:`simple`,icon:ae},{kind:`phone`,icon:A},{kind:`tablet`,icon:j},{kind:`browser`,icon:me},{kind:`window`,icon:h},{kind:`lanes`,icon:ye},{kind:`vlanes`,icon:R},{kind:`boundary`,icon:pe}],q=[{value:`table`,label:`Table`,icon:U},{value:`bar`,label:`Bar chart`,icon:v},{value:`line`,label:`Line chart`,icon:x},{value:`area`,label:`Area chart`,icon:_},{value:`scatter`,label:`Scatter chart`,icon:y},{value:`pie`,label:`Pie chart`,icon:S},{value:`donut`,label:`Donut chart`,icon:T},{value:`radar`,label:`Radar chart`,icon:l},{value:`quadrant`,label:`Quadrant chart`,icon:b}],J=[{kind:`button`,label:`Button`,icon:H},{kind:`input`,label:`Input`,icon:M},{kind:`search`,label:`Search field`,icon:ie},{kind:`checkbox`,label:`Checkbox`,icon:C},{kind:`radio`,label:`Radio`,icon:E},{kind:`toggle`,label:`Toggle`,icon:Ae},{kind:`dropdown`,label:`Dropdown`,icon:Ee},{kind:`slider`,label:`Slider`,icon:m},{kind:`navbar`,label:`Navbar`,icon:ve},{kind:`tabs`,label:`Tabs`,icon:_e},{kind:`image`,label:`Image placeholder`,icon:o},{kind:`avatar`,label:`Avatar`,icon:Me},{kind:`heading`,label:`Heading`,icon:P},{kind:`paragraph`,label:`Paragraph`,icon:de},{kind:`divider`,label:`Divider`,icon:De},{kind:`link`,label:`Link`,icon:ee},{kind:`textarea`,label:`Text area`,icon:c},{kind:`stepper`,label:`Number stepper`,icon:Ce},{kind:`badge`,label:`Badge`,icon:ke},{kind:`progress`,label:`Progress bar`,icon:le},{kind:`breadcrumbs`,label:`Breadcrumbs`,icon:w},{kind:`pagination`,label:`Pagination`,icon:se},{kind:`rating`,label:`Rating`,icon:Oe},{kind:`card`,label:`Card`,icon:ge},{kind:`list`,label:`List`,icon:z},{kind:`alert`,label:`Alert`,icon:i},{kind:`modal`,label:`Modal dialog`,icon:Pe},{kind:`menu`,label:`Menu`,icon:B},{kind:`tooltip`,label:`Tooltip`,icon:V},{kind:`accordion`,label:`Accordion`,icon:oe},{kind:`datepicker`,label:`Date picker`,icon:he},{kind:`sidebar`,label:`Sidebar`,icon:be},{kind:`scrollbar`,label:`Scrollbar`,icon:ce},{kind:`segmented`,label:`Segmented control`,icon:R},{kind:`tabbar`,label:`Bottom tab bar`,icon:L},{kind:`statusbar`,label:`Status bar`,icon:fe},{kind:`fab`,label:`Floating button`,icon:O}],Y={rectangle:`Rectangle`,ellipse:`Ellipse`,diamond:`Diamond`,triangle:`Triangle`,oval:`Oval`,parallelogram:`Parallelogram`,trapezoid:`Trapezoid`,cylinder:`Cylinder`,note:`Note`,hexagon:`Hexagon`,star:`Star`,checkbox:`Checkbox`,crossbox:`Crossed box`,heart:`Heart`,cloud:`Cloud`,"arrow-up":`Arrow up`,"arrow-down":`Arrow down`,"arrow-left":`Arrow left`,"arrow-right":`Arrow right`,plus:`Plus`,"speech-bubble":`Speech bubble`,bolt:`Lightning bolt`,queue:`Queue`,callout:`Callout`,document:`Document`,"predefined-process":`Predefined process`,"manual-input":`Manual input`,pentagon:`Pentagon`,chevron:`Chevron`,octagon:`Octagon`,cube:`Cube`,actor:`Actor`,"double-circle":`Double circle`,card:`Card`,delay:`Delay`,"fork-join":`Fork / join`,"multi-document":`Multi-document`,"multi-process":`Multi-process`,package:`Package`,component:`Component`,brace:`Brace`},X=t.filter(e=>e!==`rectangle`&&e!==`ellipse`&&e!==`actor`),Ie=e();function Le(e){return t=>(0,Ie.jsx)(p,{kind:e,size:t.size})}function Z(e,t,n,r){let i=W[e];return{id:e,label:i.label,group:t,shortcut:G(e),keywords:n,icon:i.icon??H,action:r??{kind:`tool`,tool:i.tool??`select`}}}var Re=[Z(`select`,`Basic`),Z(`hand`,`Basic`,`pan`),Z(`lasso`,`Basic`,`freehand select`),Z(`eraser`,`Basic`),Z(`laser`,`Basic`,`present`),Z(`comment`,`Basic`,`review note feedback pin annotate`,{kind:`tool`,tool:`comment`})],Q=[{id:`ask-ai`,label:`Ask AI`,group:`AI`,keywords:`assistant chat sparkles help`,icon:s,action:{kind:`ai`}},{id:`ai-diagram`,label:`Generate diagram with AI`,group:`AI`,keywords:`assistant architecture flowchart create`,icon:s,action:{kind:`ai`,prompt:`Draw a diagram of `,send:!1}},{id:`ai-deck`,label:`Generate slides with AI`,group:`AI`,keywords:`assistant deck presentation create`,icon:s,action:{kind:`ai`,prompt:`Create a short deck about `,send:!1}},{id:`ai-image`,label:`Generate image with AI`,group:`AI`,keywords:`assistant picture photo create`,icon:s,action:{kind:`ai`,prompt:`Generate an image of `,send:!1}}],ze=[Z(`rectangle`,`Shapes`,`box square`,{kind:`shape`,shape:`rectangle`}),Z(`ellipse`,`Shapes`,`circle oval`,{kind:`shape`,shape:`ellipse`}),...X.map(e=>({id:`shape-${e}`,label:Y[e],group:`Shapes`,keywords:`shape`,icon:Le(e),action:{kind:`shape`,shape:e}})),Z(`stepbadge`,`Shapes`,`number step`,{kind:`control`,control:`stepbadge`}),{id:`entity`,label:`Class / entity`,group:`Shapes`,keywords:`erd uml class table attributes fields`,icon:d,action:{kind:`control`,control:`entity`}},{id:`lifeline`,label:`Lifeline`,group:`Shapes`,keywords:`sequence uml participant`,icon:f,action:{kind:`control`,control:`lifeline`}},{id:`fragment`,label:`Fragment`,group:`Shapes`,keywords:`sequence uml combined opt alt loop par frame container`,icon:g,action:{kind:`control`,control:`fragment`}}],Be=[Z(`arrow`,`Connectors`,`connector`),Z(`line`,`Connectors`,`connector`),Z(`polyline`,`Connectors`,`connector elbow path`),Z(`polygon`,`Connectors`,`shape filled closed outline area band`)],Ve=[Z(`text`,`Text & media`),Z(`sticky`,`Text & media`,`note`),Z(`draw`,`Text & media`,`pen pencil freehand`),Z(`highlight`,`Text & media`,`marker highlight pen freehand`),Z(`image`,`Text & media`,`photo picture`),Z(`icon`,`Text & media`,`emoji sticker symbol`),{id:`web-embed`,label:`Web embed…`,group:`Text & media`,keywords:`iframe video youtube vimeo loom figma codepen map spotify website link url`,icon:h,action:{kind:`web-embed`}}],He=q.map(e=>({id:`data-${e.value}`,label:e.label,group:`Charts & data`,keywords:e.value===`table`?`grid data`:`chart graph data`,icon:e.icon,action:e.value===`table`?{kind:`table`}:{kind:`chart`,chart:e.value}})),Ue=K.map(e=>({id:`frame-${e.kind}`,label:n[e.kind],group:`Frames`,shortcut:e.kind===`simple`?G(`figure`):void 0,keywords:`frame container device mockup`,icon:e.icon,action:{kind:`frame`,frame:e.kind}})),We=J.map(e=>({id:`control-${e.kind}`,label:e.label,group:`UI controls`,keywords:`wireframe mockup ui widget`,icon:e.icon,action:{kind:`control`,control:e.kind}})),$=[...Re,...Q,...ze,...Be,...Ve,...He,...Ue,...We],Ge=new Map($.map(e=>[e.id,e]));function Ke(e,t){let n=$.filter(e=>e.group===`AI`?t.ai:e.id!==`comment`||t.comments),r=new Set(n.map(e=>e.id)),i=e.map(e=>Ge.get(e)).filter(e=>e!==void 0&&r.has(e.id)),a=new Set(i.map(e=>e.id));return{recent:i,rest:n.filter(e=>!a.has(e.id))}}function qe(e,t){if(e.kind===`ai`){t.askAi(e.prompt??``,e.send??!1);return}if(e.kind===`web-embed`){t.openWebEmbed();return}if(e.kind===`tool`){t.selectTool(e.tool);return}if(e.kind===`shape`){t.selectTool(`rectangle`),t.setShapeKind(e.shape);return}if(e.kind===`chart`){t.selectTool(`chart`),t.setChartKind(e.chart);return}if(e.kind===`table`){t.selectTool(`table`);return}if(e.kind===`frame`){t.selectTool(`figure`),t.setFrameKind(e.frame);return}t.insertControl(e.control)}export{_ as C,m as E,v as S,h as T,T as _,X as a,b,Fe as c,U as d,H as f,k as g,z as h,q as i,W as l,B as m,Ke as n,K as o,V as p,J as r,Y as s,qe as t,G as u,S as v,g as w,y as x,x as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{i as r,r as i}from"./config-D8b1QyEk.js";import{o as a}from"./editor-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{i as r,r as i}from"./config-D8b1QyEk.js";import{o as a}from"./editor-DAJETlQW.js";import{n as o}from"./tool-catalog-CIjdZm_C.js";import{a as s,i as c,r as l,t as u}from"./PopoverPopup-1zO38CRl.js";import{n as d}from"./storage-CvDRYh5V.js";import{s as f}from"./chrome-C2RCq3SI.js";import{CommandList as p}from"./command-palette-Uat68wmJ.js";import{t as m}from"./use-recent-list-DuazDypH.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 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{$t as n,A as r,An as i,C as a,Cn as o,Dn as s,Fn as c,Gt as l,H as u,Ht as d,I as f,It as p,K as m,Mn as h,Mt as g,On as _,Q as v,U as y,Ut as b,V as x,Vt as S,Wt as C,Y as w,Zt as T,_n as E,_t as D,a as O,an as k,b as A,c as j,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 ee,p as te,pt as ne,rn as G,rt as re,tn as ie,tt as ae,u as oe,ut as se,v as ce,w as le,x as ue,y as de,zt as fe}from"./useScrollLock-CQpr0n6U.js";import{t as pe}from"./jsx-runtime-DKdBMi_L.js";import{c as me,d as he,f as ge,i as _e,l as ve,n as ye,o as be,r as xe,s as Se,t as Ce,u as K}from"./usePositioner-AtbrPc7w.js";import{t as we}from"./FloatingPortalLite-HnWQWrLk.js";import{o as Te}from"./editor-BeufBV54.js";import{n as Ee}from"./keys-DrjiT9FL.js";import{t as De}from"./useBaseUiId-D2RfU0uY.js";var q=e(t(),1),J=pe(),Oe=q.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new P,currentIdRef:{current:null},currentContextRef:{current:null}});function ke(e,t){e.current=t.current}function Ae(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=q.useRef(n),a=q.useRef(n),o=q.useRef(null),s=q.useRef(null),c=ie();return h(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:K(i.current,`open`),close:K(n,`close`)}},[n,o,i,a]),(0,J.jsx)(Oe.Provider,{value:q.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function je(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}=q.useContext(Oe),[f,p]=q.useState(!1),m=q.useRef(n),g=q.useRef(!1);return h(()=>{m.current=n},[n]),h(()=>()=>{g.current=!0},[]),h(()=>{function e(){g.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]),h(()=>{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:K(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,y(v))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),h(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,ke(o,c),d.clear()}},[l,a,o,i,c,d]),q.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function Me(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 Ne(e){return e!=null&&e.clientX!=null}function Pe(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`),c=i.useState(`domReferenceElement`),u=i.context.dataRef,d=q.useRef(!1),f=q.useRef(null),[p,m]=q.useState(),[h,_]=q.useState([]),v=s(e=>{i.set(`positionReference`,e)}),y=s((e,t,n)=>{d.current||u.current.openEvent&&!Ne(u.current.openEvent)||i.set(`positionReference`,Me(n??c,{x:e,y:t,axis:r,dataRef:u,pointerType:p}))}),b=s(e=>{a?f.current||(y(e.clientX,e.clientY,e.currentTarget),_([])):y(e.clientX,e.clientY,e.currentTarget)}),x=g(p)?o:a;q.useEffect(()=>{if(!n){v(c);return}if(!x)return;function e(){f.current?.(),f.current=null}let t=U(o);function r(t){let n=l(t);C(o,n)?e():y(t.clientX,t.clientY)}return!u.current.openEvent||Ne(u.current.openEvent)?f.current=G(t,`mousemove`,r):v(c),e},[x,n,o,u,c,i,y,v,h]),q.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),q.useEffect(()=>{n&&!o&&(d.current=!1)},[n,o]),q.useEffect(()=>{!n&&a&&(d.current=!0)},[n,a]);let S=q.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:b,onMouseEnter:b}},[b]);return q.useMemo(()=>n?{reference:S,trigger:S}:{},[n,S])}var Fe=n&&T;function Ie(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=q.useRef(!1),c=q.useRef(null),u=q.useRef(!0),f=ie();q.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=U(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&E(e)&&e===b(R(e))&&(s.current=!0)}function a(){u.current=!0}function o(){u.current=!1}return k(G(t,`blur`,r),Fe&&G(t,`keydown`,a,!0),Fe&&G(t,`pointerdown`,o,!0))},[i,n]),q.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=q.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=l(t.nativeEvent);if(I(a)){if(Fe&&!t.relatedTarget){if(!u.current&&!S(a))return}else if(!d(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,y(ae,p,m));return}f.start(h,()=>{s.current||i.setOpen(!0,y(ae,p,m))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=I(n)&&n.hasAttribute(x(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;f.start(0,()=>{let e=i.select(`domReferenceElement`),t=b(R(e));!n&&t===e||C(o.current.floatingContext?.refs.floating.current,t)||C(e,t)||a||fe(n??t,i.context.triggerElements)||i.setOpen(!1,y(ae,r))})}}},[o,r,i,f]);return q.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}var Le=e(c(),1),Re={current:null};function ze(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:c=!0,triggerElementRef:d=Re,externalTree:p,isActiveTrigger:m=!0,getHandleCloseContext:h,isClosing:_,shouldOpen:v}=t,b=`rootStore`in e?e.rootStore:e,{dataRef:x,events:S}=b.context,w=f(p),T=ve(b),E=q.useRef(!1),D=u(i),O=u(r),A=u(o),j=u(n),M=u(v),N=u(_),P=s(()=>ge(x.current.openEvent?.type,T.interactedInside)),F=s(()=>M.current?.()!==!1),L=s((e,t,n)=>{let r=b.context.triggerElements;if(r.hasElement(t))return!e||!C(e,t);if(!I(n))return!1;let i=n;return r.hasMatchingElement(e=>C(e,i))&&(!e||!C(e,i))}),z=s(()=>{T.handler&&=(R(b.select(`domReferenceElement`)).removeEventListener(`mousemove`,T.handler),void 0)}),B=s(()=>{me(T)});return m&&(T.handleCloseOptions=D.current?.__options),q.useEffect(()=>z,[z]),q.useEffect(()=>{if(!n)return;function e(e){e.open?E.current=!1:(E.current=e.reason===W,z(),T.openChangeTimeout.clear(),T.restTimeout.clear(),T.blockMouseMove=!0,T.restTimeoutPending=!1)}return S.on(`openchange`,e),()=>{S.off(`openchange`,e)}},[n,S,T,z]),q.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=K(O.current,`close`,T.pointerType);n?T.openChangeTimeout.start(n,()=>{b.setOpen(!1,y(W,e)),w?.events.emit(`floating.closed`,e)}):t&&(T.openChangeTimeout.clear(),b.setOpen(!1,y(W,e)),w?.events.emit(`floating.closed`,e))}let t=d.current??(m?b.select(`domReferenceElement`):null);if(!I(t))return;function r(e){if(T.openChangeTimeout.clear(),T.blockMouseMove=!1,a&&!g(T.pointerType))return;let t=he(A.current),n=K(O.current,`open`,T.pointerType),r=l(e),i=e.currentTarget??null,o=b.select(`domReferenceElement`),s=i;if(I(r)&&!b.context.triggerElements.hasElement(r)){for(let e of b.context.triggerElements.elements())if(C(e,r)){s=e;break}}I(i)&&I(o)&&!b.context.triggerElements.hasElement(i)&&C(i,o)&&(s=o);let c=s!=null&&L(o,s,r),u=b.select(`open`),d=N.current?.()??b.select(`transitionStatus`)===`ending`,f=!u&&d&&E.current,p=!c&&I(s)&&I(o)&&C(o,s)&&f,m=t>0&&!n,h=c&&(u||f)||p,_=!u||c;if(h){F()&&b.setOpen(!0,y(W,e,s));return}m||(n?T.openChangeTimeout.start(n,()=>{_&&F()&&b.setOpen(!0,y(W,e,s))}):_&&F()&&b.setOpen(!0,y(W,e,s)))}function i(t){if(P()){B();return}z();let n=R(b.select(`domReferenceElement`));T.restTimeout.clear(),T.restTimeoutPending=!1;let r=x.current.floatingContext??h?.();if(!fe(t.relatedTarget,b.context.triggerElements)){if(D.current&&r){b.select(`open`)||T.openChangeTimeout.clear();let i=d.current;T.handler=D.current({...r,tree:w,x:t.clientX,y:t.clientY,onClose(){B(),z(),j.current&&!P()&&i===b.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,T.handler),T.handler(t);return}(T.pointerType!==`touch`||!C(b.select(`floatingElement`),t.relatedTarget))&&e(t)}}return c?k(G(t,`mousemove`,r,{once:!0}),G(t,`mouseenter`,r),G(t,`mouseleave`,i)):k(G(t,`mouseenter`,r),G(t,`mouseleave`,i))},[z,B,x,O,b,n,D,T,m,L,P,a,c,A,d,w,j,h,N,F]),q.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=b.select(`domReferenceElement`),i=b.select(`open`),o=L(r,n,e.target);if(a&&!g(T.pointerType))return;if(i&&o&&T.handleCloseOptions?.blockPointerEvents){let e=b.select(`floatingElement`);if(e){let t=T.handleCloseOptions?.getScope?.()??n.ownerDocument.body;Se(T,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=he(A.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,P())return;let e=b.select(`open`);!T.blockMouseMove&&(!e||o)&&F()&&b.setOpen(!0,y(W,t,n))}T.pointerType===`touch`?Le.flushSync(()=>{c()}):o&&i?c():(T.restTimeoutPending=!0,T.restTimeout.start(s,c))}}},[n,T,P,L,a,b,A,F])}var Be=.1,Ve=Be*Be,Y=.5;function X(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Z(e,t,n,r,i,a,o,s,c,l){let u=!1;return X(e,t,n,r,i,a)&&(u=!u),X(e,t,i,a,o,s)&&(u=!u),X(e,t,o,s,c,l)&&(u=!u),X(e,t,c,l,n,r)&&(u=!u),u}function He(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Q(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 Ue(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],u=!1,d=null,f=null,m=typeof performance<`u`?performance.now():0;function h(e,t){let n=performance.now(),r=n-m;if(d===null||f===null||r===0)return d=e,f=t,m=n,!1;let i=e-d,a=t-f,o=i*i+a*a,s=r*r*Ve;return d=e,f=t,m=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:m}=r,_=l(r),v=r.type===`mouseleave`,y=C(d,_),b=C(a,_);if(y&&(u=!0,!v))return;if(b&&(u=!1,!v)){u=!0;return}if(v&&I(r.relatedTarget)&&C(d,r.relatedTarget))return;function x(){return!!(s&&p(s.nodesRef.current,o).length>0)}function S(){x()||g()}if(x())return;let w=a.getBoundingClientRect(),T=d.getBoundingClientRect(),E=e>T.right-T.width/2,D=t>T.bottom-T.height/2,O=T.width>w.width,k=T.height>w.height,A=(O?w:T).left,j=(O?w:T).right,M=(k?w:T).top,N=(k?w:T).bottom;if(c===`top`&&t>=w.bottom-1||c===`bottom`&&t<=w.top+1||c===`left`&&e>=w.right-1||c===`right`&&e<=w.left+1){S();return}let P=!1;switch(c){case`top`:P=Q(f,m,A,w.top+1,j,T.bottom-1);break;case`bottom`:P=Q(f,m,A,T.top+1,j,w.bottom-1);break;case`left`:P=Q(f,m,T.right-1,N,w.left+1,M);break;case`right`:P=Q(f,m,w.right-1,N,T.left+1,M);break;default:}if(P)return;if(u&&!He(f,m,w)){S();return}if(!v&&h(f,m)){S();return}let F=!1;switch(c){case`top`:{let n=O?Y/2:Y*4,r=O||E?e+n:e-n,i=O?e-n:E?e+n:e-n,a=t+Y+1,o=E||O?T.bottom-Y:T.top,s=E?O?T.bottom-Y:T.top:T.bottom-Y;F=Z(f,m,r,a,i,a,T.left,o,T.right,s);break}case`bottom`:{let n=O?Y/2:Y*4,r=O||E?e+n:e-n,i=O?e-n:E?e+n:e-n,a=t-Y,o=E||O?T.top+Y:T.bottom,s=E?O?T.top+Y:T.bottom:T.top+Y;F=Z(f,m,r,a,i,a,T.left,o,T.right,s);break}case`left`:{let n=k?Y/2:Y*4,r=k||D?t+n:t-n,i=k?t-n:D?t+n:t-n,a=e+Y+1,o=D||k?T.right-Y:T.left,s=D?k?T.right-Y:T.left:T.right-Y;F=Z(f,m,o,T.top,s,T.bottom,a,r,a,i);break}case`right`:{let n=k?Y/2:Y*4,r=k||D?t+n:t-n,i=k?t-n:D?t+n:t-n,a=e-Y,o=D||k?T.left+Y:T.right,s=D?k?T.left+Y:T.right:T.left+Y;F=Z(f,m,a,r,a,i,o,T.top,s,T.bottom);break}default:}F?u||n.start(40,S):S()}};return r.__options={...e,blockPointerEvents:t},r}var We=q.createContext(void 0);function $(e){let t=q.useContext(We);if(t===void 0&&!e)throw Error(z(72));return t}var Ge={...M,disabled:i(e=>e.disabled),instantType:i(e=>e.instantType),isInstantPhase:i(e=>e.isInstantPhase),trackCursorAxis:i(e=>e.trackCursorAxis),disableHoverablePopup:i(e=>e.disableHoverablePopup),lastOpenChangeReason:i(e=>e.openChangeReason),closeOnClick:i(e=>e.closeOnClick),closeDelay:i(e=>e.closeDelay),hasViewport:i(e=>e.hasViewport)},Ke=class e extends o{constructor(e,t,n=!1){let r=new F,i={...qe(),...e};i.floatingRootContext=oe(r,t,n),super(i,{popupRef:q.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,y(re,e))}static useStore(t,n){return a(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=_(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 g=p.useState(`open`),_=!t&&g,v=p.useState(`activeTriggerId`),b=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}=A(_,p),T=p.useState(`isInstantPhase`),E=p.useState(`instantType`),D=p.useState(`lastOpenChangeReason`),O=q.useRef(null);h(()=>{g&&t&&p.setOpen(!1,y(m))},[g,t,p]),h(()=>{C===`ending`&&D===`none`||C!==`ending`&&T?(E!==`delay`&&(O.current=E),p.set(`instantType`,`delay`)):O.current!==null&&(p.set(`instantType`,O.current),O.current=null)},[C,T,D,E,p]),h(()=>{_&&(v??p.set(`payload`,void 0))},[p,v,_]);let k=q.useCallback(()=>{p.setOpen(!1,y(w))},[p]);q.useImperativeHandle(o,()=>({unmount:S,close:k}),[S,k]);let j=_||b||!t&&a!==`none`;return(0,J.jsxs)(We.Provider,{value:p,children:[j&&(0,J.jsx)(Ye,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:x}):f]})});function Ye({store:e,disabled:t,trackCursorAxis:n}){let i=e.useState(`floatingRootContext`),a=r(i,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),o=Pe(i,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n});return ue(e,{activeTriggerProps:q.useMemo(()=>D(o.reference,a.reference),[o.reference,a.reference]),inactiveTriggerProps:q.useMemo(()=>D(o.trigger,a.trigger),[o.trigger,a.trigger]),popupProps:q.useMemo(()=>D(te,o.floating,a.floating),[o.floating,a.floating])}),null}var Xe=q.createContext(void 0);function Ze(){return q.useContext(Xe)}var Qe=function(e){return e[e.popupOpen=O.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:d,id:f,...p}=e,m=$(!0),h=a?.store??m;if(!h)throw Error(z(82));let _=De(f),v=h.useState(`isTriggerActive`,_),b=h.useState(`isOpenedByTrigger`,_),x=h.useState(`floatingRootContext`),S=q.useRef(null),w=c??600,T=d??0,{registerTrigger:E,isMountedByThisTrigger:D}=le(_,S,h,{payload:o,closeOnClick:l,closeDelay:T}),O=Ze(),{delayRef:k,isInstantPhase:A,hasProvider:M}=je(x,{open:b}),N=ve(x);h.useSyncedValue(`isInstantPhase`,A);let P=h.useState(`disabled`),F=s??P,I=u(F),R=h.useState(`trackCursorAxis`),B=h.useState(`disableHoverablePopup`),V=q.useRef(!1),H=ie(),U=q.useRef(void 0);function ee(){let e=O?.delay,t=typeof k.current==`object`?k.current.open:void 0,n=w;return M&&(n=t===0?0:c??e??w),n}function te(e){let t=S.current;if(!t||!e)return!1;let n=tt(e);return n!==null&&n!==t&&C(t,n)}function ne(e){let t=te(e);return V.current=t,t&&(N.openChangeTimeout.clear(),N.restTimeout.clear(),N.restTimeoutPending=!1,H.clear()),t}let G=ze(x,{enabled:!F,mouseOnly:!0,move:!1,handleClose:!B&&R!==`both`?Ue():null,restMs:ee,delay(){let e=typeof k.current==`object`?k.current.close:void 0,t=T;return d==null&&M&&(t=e),{close:t}},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!V.current}}),re=Ie(x,{enabled:!F}).reference,ae=e=>{let t=V.current,n=et(e),r=ne(n),i=S.current,a=i&&n&&C(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`){h.setOpen(!1,y(W,e));return}if(t&&!r&&a&&!I.current&&!h.select(`open`)&&i&&g(U.current)){let t=()=>{!V.current&&!I.current&&!h.select(`open`)&&h.setOpen(!0,y(W,e,i))},n=ee();n===0?(H.clear(),t()):H.start(n,t)}},oe=h.useState(`triggerProps`,D);return L(`button`,e,{state:{open:b},ref:[t,E,S],props:[G,re,D||R!==`none`?oe:void 0,{onMouseOver(e){ae(e.nativeEvent)},onFocus(e){te(et(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){V.current=!1,H.clear(),U.current=void 0},onPointerEnter(e){U.current=e.pointerType},onPointerDown(e){U.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:_,[Qe.triggerDisabled]:F?``:void 0,[$e]:F?void 0:``},p],stateAttributesMapping:j})}),rt=q.createContext(void 0);function it(){let e=q.useContext(rt);if(e===void 0)throw Error(z(70));return e}var at=q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return $().useState(`mounted`)||n?(0,J.jsx)(rt.Provider,{value:n,children:(0,J.jsx)(we,{ref:t,...r})}):null}),ot=q.createContext(void 0);function st(){let e=q.useContext(ot);if(e===void 0)throw Error(z(71));return e}var ct=q.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=$(),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=xe({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`)?_e:void 0}),O=Ce(e,q.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,J.jsx)(ot.Provider,{value:D,children:O})}),lt={...ee,...ne},ut=q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=$(),{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)}}),be(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,ye(d),a],stateAttributesMapping:lt})}),dt=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=q.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=q.useMemo(()=>({open:t,close:n}),[t,n]);return(0,J.jsx)(Xe.Provider,{value:i,children:(0,J.jsx)(Ae,{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 Te(e=>e.coarsePointer)?c:(0,J.jsxs)(Je,{disableHoverablePopup:!0,disabled:o,children:[(0,J.jsx)(nt,{render:c}),(0,J.jsx)(at,{children:(0,J.jsx)(ct,{side:r,sideOffset:i,children:(0,J.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,J.jsx)(`span`,{children:t}),n?(0,J.jsx)(`span`,{className:`text-[var(--chrome-fg-400)]`,children:Ee(n)}):null]})})})]})}export{Ie as a,ze as i,dt as n,Ue as r,ft as t};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{$t as n,A as r,An as i,C as a,Cn as o,Dn as s,Fn as c,Gt as l,H as u,Ht as d,I as f,It as p,K as m,Mn as h,Mt as g,On as _,Q as v,U as y,Ut as b,V as x,Vt as S,Wt as C,Y as w,Zt as T,_n as E,_t as D,a as O,an as k,b as A,c as j,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 ee,p as te,pt as ne,rn as G,rt as re,tn as ie,tt as ae,u as oe,ut as se,v as ce,w as le,x as ue,y as de,zt as fe}from"./useScrollLock-CQpr0n6U.js";import{t as pe}from"./jsx-runtime-DKdBMi_L.js";import{c as me,d as he,f as ge,i as _e,l as ve,n as ye,o as be,r as xe,s as Se,t as Ce,u as K}from"./usePositioner-AtbrPc7w.js";import{t as we}from"./FloatingPortalLite-HnWQWrLk.js";import{o as Te}from"./editor-DAJETlQW.js";import{n as Ee}from"./keys-DrjiT9FL.js";import{t as De}from"./useBaseUiId-D2RfU0uY.js";var q=e(t(),1),J=pe(),Oe=q.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new P,currentIdRef:{current:null},currentContextRef:{current:null}});function ke(e,t){e.current=t.current}function Ae(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=q.useRef(n),a=q.useRef(n),o=q.useRef(null),s=q.useRef(null),c=ie();return h(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:K(i.current,`open`),close:K(n,`close`)}},[n,o,i,a]),(0,J.jsx)(Oe.Provider,{value:q.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function je(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}=q.useContext(Oe),[f,p]=q.useState(!1),m=q.useRef(n),g=q.useRef(!1);return h(()=>{m.current=n},[n]),h(()=>()=>{g.current=!0},[]),h(()=>{function e(){g.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]),h(()=>{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:K(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,y(v))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),h(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,ke(o,c),d.clear()}},[l,a,o,i,c,d]),q.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function Me(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 Ne(e){return e!=null&&e.clientX!=null}function Pe(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`),c=i.useState(`domReferenceElement`),u=i.context.dataRef,d=q.useRef(!1),f=q.useRef(null),[p,m]=q.useState(),[h,_]=q.useState([]),v=s(e=>{i.set(`positionReference`,e)}),y=s((e,t,n)=>{d.current||u.current.openEvent&&!Ne(u.current.openEvent)||i.set(`positionReference`,Me(n??c,{x:e,y:t,axis:r,dataRef:u,pointerType:p}))}),b=s(e=>{a?f.current||(y(e.clientX,e.clientY,e.currentTarget),_([])):y(e.clientX,e.clientY,e.currentTarget)}),x=g(p)?o:a;q.useEffect(()=>{if(!n){v(c);return}if(!x)return;function e(){f.current?.(),f.current=null}let t=U(o);function r(t){let n=l(t);C(o,n)?e():y(t.clientX,t.clientY)}return!u.current.openEvent||Ne(u.current.openEvent)?f.current=G(t,`mousemove`,r):v(c),e},[x,n,o,u,c,i,y,v,h]),q.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),q.useEffect(()=>{n&&!o&&(d.current=!1)},[n,o]),q.useEffect(()=>{!n&&a&&(d.current=!0)},[n,a]);let S=q.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:b,onMouseEnter:b}},[b]);return q.useMemo(()=>n?{reference:S,trigger:S}:{},[n,S])}var Fe=n&&T;function Ie(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=q.useRef(!1),c=q.useRef(null),u=q.useRef(!0),f=ie();q.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=U(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&E(e)&&e===b(R(e))&&(s.current=!0)}function a(){u.current=!0}function o(){u.current=!1}return k(G(t,`blur`,r),Fe&&G(t,`keydown`,a,!0),Fe&&G(t,`pointerdown`,o,!0))},[i,n]),q.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=q.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=l(t.nativeEvent);if(I(a)){if(Fe&&!t.relatedTarget){if(!u.current&&!S(a))return}else if(!d(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,y(ae,p,m));return}f.start(h,()=>{s.current||i.setOpen(!0,y(ae,p,m))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=I(n)&&n.hasAttribute(x(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;f.start(0,()=>{let e=i.select(`domReferenceElement`),t=b(R(e));!n&&t===e||C(o.current.floatingContext?.refs.floating.current,t)||C(e,t)||a||fe(n??t,i.context.triggerElements)||i.setOpen(!1,y(ae,r))})}}},[o,r,i,f]);return q.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}var Le=e(c(),1),Re={current:null};function ze(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:c=!0,triggerElementRef:d=Re,externalTree:p,isActiveTrigger:m=!0,getHandleCloseContext:h,isClosing:_,shouldOpen:v}=t,b=`rootStore`in e?e.rootStore:e,{dataRef:x,events:S}=b.context,w=f(p),T=ve(b),E=q.useRef(!1),D=u(i),O=u(r),A=u(o),j=u(n),M=u(v),N=u(_),P=s(()=>ge(x.current.openEvent?.type,T.interactedInside)),F=s(()=>M.current?.()!==!1),L=s((e,t,n)=>{let r=b.context.triggerElements;if(r.hasElement(t))return!e||!C(e,t);if(!I(n))return!1;let i=n;return r.hasMatchingElement(e=>C(e,i))&&(!e||!C(e,i))}),z=s(()=>{T.handler&&=(R(b.select(`domReferenceElement`)).removeEventListener(`mousemove`,T.handler),void 0)}),B=s(()=>{me(T)});return m&&(T.handleCloseOptions=D.current?.__options),q.useEffect(()=>z,[z]),q.useEffect(()=>{if(!n)return;function e(e){e.open?E.current=!1:(E.current=e.reason===W,z(),T.openChangeTimeout.clear(),T.restTimeout.clear(),T.blockMouseMove=!0,T.restTimeoutPending=!1)}return S.on(`openchange`,e),()=>{S.off(`openchange`,e)}},[n,S,T,z]),q.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=K(O.current,`close`,T.pointerType);n?T.openChangeTimeout.start(n,()=>{b.setOpen(!1,y(W,e)),w?.events.emit(`floating.closed`,e)}):t&&(T.openChangeTimeout.clear(),b.setOpen(!1,y(W,e)),w?.events.emit(`floating.closed`,e))}let t=d.current??(m?b.select(`domReferenceElement`):null);if(!I(t))return;function r(e){if(T.openChangeTimeout.clear(),T.blockMouseMove=!1,a&&!g(T.pointerType))return;let t=he(A.current),n=K(O.current,`open`,T.pointerType),r=l(e),i=e.currentTarget??null,o=b.select(`domReferenceElement`),s=i;if(I(r)&&!b.context.triggerElements.hasElement(r)){for(let e of b.context.triggerElements.elements())if(C(e,r)){s=e;break}}I(i)&&I(o)&&!b.context.triggerElements.hasElement(i)&&C(i,o)&&(s=o);let c=s!=null&&L(o,s,r),u=b.select(`open`),d=N.current?.()??b.select(`transitionStatus`)===`ending`,f=!u&&d&&E.current,p=!c&&I(s)&&I(o)&&C(o,s)&&f,m=t>0&&!n,h=c&&(u||f)||p,_=!u||c;if(h){F()&&b.setOpen(!0,y(W,e,s));return}m||(n?T.openChangeTimeout.start(n,()=>{_&&F()&&b.setOpen(!0,y(W,e,s))}):_&&F()&&b.setOpen(!0,y(W,e,s)))}function i(t){if(P()){B();return}z();let n=R(b.select(`domReferenceElement`));T.restTimeout.clear(),T.restTimeoutPending=!1;let r=x.current.floatingContext??h?.();if(!fe(t.relatedTarget,b.context.triggerElements)){if(D.current&&r){b.select(`open`)||T.openChangeTimeout.clear();let i=d.current;T.handler=D.current({...r,tree:w,x:t.clientX,y:t.clientY,onClose(){B(),z(),j.current&&!P()&&i===b.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,T.handler),T.handler(t);return}(T.pointerType!==`touch`||!C(b.select(`floatingElement`),t.relatedTarget))&&e(t)}}return c?k(G(t,`mousemove`,r,{once:!0}),G(t,`mouseenter`,r),G(t,`mouseleave`,i)):k(G(t,`mouseenter`,r),G(t,`mouseleave`,i))},[z,B,x,O,b,n,D,T,m,L,P,a,c,A,d,w,j,h,N,F]),q.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=b.select(`domReferenceElement`),i=b.select(`open`),o=L(r,n,e.target);if(a&&!g(T.pointerType))return;if(i&&o&&T.handleCloseOptions?.blockPointerEvents){let e=b.select(`floatingElement`);if(e){let t=T.handleCloseOptions?.getScope?.()??n.ownerDocument.body;Se(T,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=he(A.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,P())return;let e=b.select(`open`);!T.blockMouseMove&&(!e||o)&&F()&&b.setOpen(!0,y(W,t,n))}T.pointerType===`touch`?Le.flushSync(()=>{c()}):o&&i?c():(T.restTimeoutPending=!0,T.restTimeout.start(s,c))}}},[n,T,P,L,a,b,A,F])}var Be=.1,Ve=Be*Be,Y=.5;function X(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Z(e,t,n,r,i,a,o,s,c,l){let u=!1;return X(e,t,n,r,i,a)&&(u=!u),X(e,t,i,a,o,s)&&(u=!u),X(e,t,o,s,c,l)&&(u=!u),X(e,t,c,l,n,r)&&(u=!u),u}function He(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Q(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 Ue(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],u=!1,d=null,f=null,m=typeof performance<`u`?performance.now():0;function h(e,t){let n=performance.now(),r=n-m;if(d===null||f===null||r===0)return d=e,f=t,m=n,!1;let i=e-d,a=t-f,o=i*i+a*a,s=r*r*Ve;return d=e,f=t,m=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:m}=r,_=l(r),v=r.type===`mouseleave`,y=C(d,_),b=C(a,_);if(y&&(u=!0,!v))return;if(b&&(u=!1,!v)){u=!0;return}if(v&&I(r.relatedTarget)&&C(d,r.relatedTarget))return;function x(){return!!(s&&p(s.nodesRef.current,o).length>0)}function S(){x()||g()}if(x())return;let w=a.getBoundingClientRect(),T=d.getBoundingClientRect(),E=e>T.right-T.width/2,D=t>T.bottom-T.height/2,O=T.width>w.width,k=T.height>w.height,A=(O?w:T).left,j=(O?w:T).right,M=(k?w:T).top,N=(k?w:T).bottom;if(c===`top`&&t>=w.bottom-1||c===`bottom`&&t<=w.top+1||c===`left`&&e>=w.right-1||c===`right`&&e<=w.left+1){S();return}let P=!1;switch(c){case`top`:P=Q(f,m,A,w.top+1,j,T.bottom-1);break;case`bottom`:P=Q(f,m,A,T.top+1,j,w.bottom-1);break;case`left`:P=Q(f,m,T.right-1,N,w.left+1,M);break;case`right`:P=Q(f,m,w.right-1,N,T.left+1,M);break;default:}if(P)return;if(u&&!He(f,m,w)){S();return}if(!v&&h(f,m)){S();return}let F=!1;switch(c){case`top`:{let n=O?Y/2:Y*4,r=O||E?e+n:e-n,i=O?e-n:E?e+n:e-n,a=t+Y+1,o=E||O?T.bottom-Y:T.top,s=E?O?T.bottom-Y:T.top:T.bottom-Y;F=Z(f,m,r,a,i,a,T.left,o,T.right,s);break}case`bottom`:{let n=O?Y/2:Y*4,r=O||E?e+n:e-n,i=O?e-n:E?e+n:e-n,a=t-Y,o=E||O?T.top+Y:T.bottom,s=E?O?T.top+Y:T.bottom:T.top+Y;F=Z(f,m,r,a,i,a,T.left,o,T.right,s);break}case`left`:{let n=k?Y/2:Y*4,r=k||D?t+n:t-n,i=k?t-n:D?t+n:t-n,a=e+Y+1,o=D||k?T.right-Y:T.left,s=D?k?T.right-Y:T.left:T.right-Y;F=Z(f,m,o,T.top,s,T.bottom,a,r,a,i);break}case`right`:{let n=k?Y/2:Y*4,r=k||D?t+n:t-n,i=k?t-n:D?t+n:t-n,a=e-Y,o=D||k?T.left+Y:T.right,s=D?k?T.left+Y:T.right:T.left+Y;F=Z(f,m,a,r,a,i,o,T.top,s,T.bottom);break}default:}F?u||n.start(40,S):S()}};return r.__options={...e,blockPointerEvents:t},r}var We=q.createContext(void 0);function $(e){let t=q.useContext(We);if(t===void 0&&!e)throw Error(z(72));return t}var Ge={...M,disabled:i(e=>e.disabled),instantType:i(e=>e.instantType),isInstantPhase:i(e=>e.isInstantPhase),trackCursorAxis:i(e=>e.trackCursorAxis),disableHoverablePopup:i(e=>e.disableHoverablePopup),lastOpenChangeReason:i(e=>e.openChangeReason),closeOnClick:i(e=>e.closeOnClick),closeDelay:i(e=>e.closeDelay),hasViewport:i(e=>e.hasViewport)},Ke=class e extends o{constructor(e,t,n=!1){let r=new F,i={...qe(),...e};i.floatingRootContext=oe(r,t,n),super(i,{popupRef:q.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,y(re,e))}static useStore(t,n){return a(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=_(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 g=p.useState(`open`),_=!t&&g,v=p.useState(`activeTriggerId`),b=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}=A(_,p),T=p.useState(`isInstantPhase`),E=p.useState(`instantType`),D=p.useState(`lastOpenChangeReason`),O=q.useRef(null);h(()=>{g&&t&&p.setOpen(!1,y(m))},[g,t,p]),h(()=>{C===`ending`&&D===`none`||C!==`ending`&&T?(E!==`delay`&&(O.current=E),p.set(`instantType`,`delay`)):O.current!==null&&(p.set(`instantType`,O.current),O.current=null)},[C,T,D,E,p]),h(()=>{_&&(v??p.set(`payload`,void 0))},[p,v,_]);let k=q.useCallback(()=>{p.setOpen(!1,y(w))},[p]);q.useImperativeHandle(o,()=>({unmount:S,close:k}),[S,k]);let j=_||b||!t&&a!==`none`;return(0,J.jsxs)(We.Provider,{value:p,children:[j&&(0,J.jsx)(Ye,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:x}):f]})});function Ye({store:e,disabled:t,trackCursorAxis:n}){let i=e.useState(`floatingRootContext`),a=r(i,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),o=Pe(i,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n});return ue(e,{activeTriggerProps:q.useMemo(()=>D(o.reference,a.reference),[o.reference,a.reference]),inactiveTriggerProps:q.useMemo(()=>D(o.trigger,a.trigger),[o.trigger,a.trigger]),popupProps:q.useMemo(()=>D(te,o.floating,a.floating),[o.floating,a.floating])}),null}var Xe=q.createContext(void 0);function Ze(){return q.useContext(Xe)}var Qe=function(e){return e[e.popupOpen=O.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:d,id:f,...p}=e,m=$(!0),h=a?.store??m;if(!h)throw Error(z(82));let _=De(f),v=h.useState(`isTriggerActive`,_),b=h.useState(`isOpenedByTrigger`,_),x=h.useState(`floatingRootContext`),S=q.useRef(null),w=c??600,T=d??0,{registerTrigger:E,isMountedByThisTrigger:D}=le(_,S,h,{payload:o,closeOnClick:l,closeDelay:T}),O=Ze(),{delayRef:k,isInstantPhase:A,hasProvider:M}=je(x,{open:b}),N=ve(x);h.useSyncedValue(`isInstantPhase`,A);let P=h.useState(`disabled`),F=s??P,I=u(F),R=h.useState(`trackCursorAxis`),B=h.useState(`disableHoverablePopup`),V=q.useRef(!1),H=ie(),U=q.useRef(void 0);function ee(){let e=O?.delay,t=typeof k.current==`object`?k.current.open:void 0,n=w;return M&&(n=t===0?0:c??e??w),n}function te(e){let t=S.current;if(!t||!e)return!1;let n=tt(e);return n!==null&&n!==t&&C(t,n)}function ne(e){let t=te(e);return V.current=t,t&&(N.openChangeTimeout.clear(),N.restTimeout.clear(),N.restTimeoutPending=!1,H.clear()),t}let G=ze(x,{enabled:!F,mouseOnly:!0,move:!1,handleClose:!B&&R!==`both`?Ue():null,restMs:ee,delay(){let e=typeof k.current==`object`?k.current.close:void 0,t=T;return d==null&&M&&(t=e),{close:t}},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!V.current}}),re=Ie(x,{enabled:!F}).reference,ae=e=>{let t=V.current,n=et(e),r=ne(n),i=S.current,a=i&&n&&C(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`){h.setOpen(!1,y(W,e));return}if(t&&!r&&a&&!I.current&&!h.select(`open`)&&i&&g(U.current)){let t=()=>{!V.current&&!I.current&&!h.select(`open`)&&h.setOpen(!0,y(W,e,i))},n=ee();n===0?(H.clear(),t()):H.start(n,t)}},oe=h.useState(`triggerProps`,D);return L(`button`,e,{state:{open:b},ref:[t,E,S],props:[G,re,D||R!==`none`?oe:void 0,{onMouseOver(e){ae(e.nativeEvent)},onFocus(e){te(et(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){V.current=!1,H.clear(),U.current=void 0},onPointerEnter(e){U.current=e.pointerType},onPointerDown(e){U.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:_,[Qe.triggerDisabled]:F?``:void 0,[$e]:F?void 0:``},p],stateAttributesMapping:j})}),rt=q.createContext(void 0);function it(){let e=q.useContext(rt);if(e===void 0)throw Error(z(70));return e}var at=q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return $().useState(`mounted`)||n?(0,J.jsx)(rt.Provider,{value:n,children:(0,J.jsx)(we,{ref:t,...r})}):null}),ot=q.createContext(void 0);function st(){let e=q.useContext(ot);if(e===void 0)throw Error(z(71));return e}var ct=q.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=$(),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=xe({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`)?_e:void 0}),O=Ce(e,q.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,J.jsx)(ot.Provider,{value:D,children:O})}),lt={...ee,...ne},ut=q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=$(),{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)}}),be(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,ye(d),a],stateAttributesMapping:lt})}),dt=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=q.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=q.useMemo(()=>({open:t,close:n}),[t,n]);return(0,J.jsx)(Xe.Provider,{value:i,children:(0,J.jsx)(Ae,{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 Te(e=>e.coarsePointer)?c:(0,J.jsxs)(Je,{disableHoverablePopup:!0,disabled:o,children:[(0,J.jsx)(nt,{render:c}),(0,J.jsx)(at,{children:(0,J.jsx)(ct,{side:r,sideOffset:i,children:(0,J.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,J.jsx)(`span`,{children:t}),n?(0,J.jsx)(`span`,{className:`text-[var(--chrome-fg-400)]`,children:Ee(n)}):null]})})})]})}export{Ie as a,ze as i,dt as n,Ue as r,ft as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./reflow-C6bvnSVm.js";import{j as t}from"./shapes-D5w8NTQQ.js";import{t as n}from"./createReactComponent-C51FAx3B.js";import{i as r,t as i}from"./flow-start-ByhFxEeV.js";import{i as a,n as o}from"./core-C1TxysMz.js";import{c as s,i as c,n as l,s as u}from"./flows-CGl4r-xb.js";var d=n(`outline`,`arrow-fork`,`ArrowFork`,[[`path`,{d:`M16 3h5v5`,key:`svg-0`}],[`path`,{d:`M8 3h-5v5`,key:`svg-1`}],[`path`,{d:`M21 3l-7.536 7.536a5 5 0 0 0 -1.464 3.534v6.93`,key:`svg-2`}],[`path`,{d:`M3 3l7.536 7.536a5 5 0 0 1 1.464 3.534v.93`,key:`svg-3`}]]),f=24;function p(e,t,n){let r=new Set([...t,...n]),i=e.filter(e=>r.has(e.id)&&e.type!==`arrow`),a=e=>i.find(t=>m(t,e))?.id??null,o=(e,r)=>t.includes(e)&&n.includes(r)||n.includes(e)&&t.includes(r),s=null;for(let t of e){if(t.type!==`arrow`)continue;let e={x:t.x,y:t.y},n={x:t.x2,y:t.y2},r=t.startBinding?.shapeId??a(e),i=t.endBinding?.shapeId??a(n);if(!r||!i||r===i||!o(r,i))continue;if(t.startBinding&&t.endBinding)return null;let c=[];t.startBinding||c.push({end:`start`,shapeId:r,point:e}),t.endBinding||c.push({end:`end`,shapeId:i,point:n}),s??={arrow:t,ends:c}}return s}function m(e,n){let r=t(e);return n.x>=r.x-f&&n.x<=r.x+r.width+f&&n.y>=r.y-f&&n.y<=r.y+r.height+f}function h(e,t,n){let r=b(t,e.length);return e[r-1]?.target===n.target?e:[...e.slice(0,r),n,...e.slice(r)]}function g(e,t,n){let r=Math.min(Math.max(n,0),e.length-1);if(t===r||!e[t])return e;let i=[...e],[a]=i.splice(t,1);return i.splice(r,0,a),i}function _(e,t){return e[t]?e.filter((e,n)=>n!==t):e}function v(e,t,n,r){let i=e[t];if(!i||i.target===n)return e;let a={...i,target:n};r!==void 0&&(a.title=r);let o=(i.also??[]).filter(e=>e!==n);return o.length>0?a.also=o:delete a.also,e.map((e,n)=>n===t?a:e)}function y(e,t,n){let r=e[t];if(!r||r.target===n)return e;let i=r.also??[],a={...r,also:i.includes(n)?i.filter(e=>e!==n):[...i,n]};return a.also?.length===0&&delete a.also,e.map((e,n)=>n===t?a:e)}function b(e,t){return Math.min(Math.max(e,0),t)}function x(e,t,n,a){let o=i(e,t);o&&r(e,o,(o.flows??[]).flatMap(e=>{if(e.id!==n)return[e];let t=a(e);return t?[t]:[]}))}function S(e,t,n,o){let s=i(e,t);if(!s)return;let c=s.flows??[],l=a(c);e.history.withTransaction(()=>{r(e,s,[...c.map(e=>e.id===n?{...e,steps:e.steps.map((e,t)=>t===o?{...e,branches:[...e.branches??[],l.id]}:e)}:e),l])}),e.store.getState().setFlowEdit({frameId:t,flowId:l.id})}function C(e,t,n){let{flowEdit:r,flowPlay:a,flowPreview:o,setFlowEdit:s,setFlowPlay:c,setFlowPreview:l}=e.store.getState();if(x(e,t,n,()=>null),a?.flowId===n&&c(null),o?.flowId===n&&l(null),r?.flowId!==n)return;let u=i(e,t)?.flows?.[0];s(u?{frameId:t,flowId:u.id}:null)}function w(e,t,n){let r=e.store.getState();r.setFlowPlay(null),r.setFlowEdit({frameId:t,flowId:n})}function T(e,t){let n=e.slot;return n==null||n>=t?t:Math.max(n,0)}function E(e,t){return T(e,t)<t}function D(e,t){let n=e.selected;return n==null||n<0||n>=t?null:n}function O(e,t){let n=D(e,t);if(n!==null)return n;let r=T(e,t)-1;return r>=0?r:null}function k(e,t,n){return{selected:t,slot:E(e,n)?t+1:null,picking:null}}function A(e,t){let n=e=>e==null?null:e>t?e-1:e;return{selected:e.selected===t?null:n(e.selected),slot:n(e.slot),hovered:null,picking:null}}function j(e,t,n){let r=e=>e==null?e:e===t?n:t<e&&e<=n?e-1:n<=e&&e<t?e+1:e,i={};return e.selected!==null&&e.selected!==void 0&&(i.selected=r(e.selected)),e.picking!==null&&e.picking!==void 0&&(i.picking=r(e.picking)),i}function M(e,t,n){let r=i(e,t),a=r?.flows?.find(e=>e.id===n);if(!r||!a)return null;let s=e.store.getState().shapes;return u(a,o(s,r)).steps}function N(e,t,n,r){let i=M(e,t,n);if(!i)return!1;let a=r(i);return a===i?!1:(x(e,t,n,e=>({...e,steps:a})),!0)}function P(e,t,n){let r=e.store.getState().flowEdit;return r&&r.frameId===t&&r.flowId===n?r:null}function F(e,t,n,r){P(e,t,n)&&e.store.getState().patchFlowEdit(r)}function I(e,t,n){M(e,t,n)?.length===0&&C(e,t,n),e.store.getState().setFlowEdit(null)}function L(e,t,n,r){let i=M(e,t,n);if(!i)return;let a=P(e,t,n)??{},o=T(a,i.length),s=e.store.getState().shapes,l={target:r.id,title:c(s,r)};N(e,t,n,e=>h(e,o,l))&&F(e,t,n,k(a,o,i.length))}function R(e,t,n,r){let i=M(e,t,n);if(!i)return;let a=O(P(e,t,n)??{},i.length);a!==null&&(N(e,t,n,e=>y(e,a,r.id)),F(e,t,n,{selected:a}))}function z(e,t,n,r,i){let a=M(e,t,n),o=a?.[r];if(!a||!o){F(e,t,n,{picking:null});return}let s=e.store.getState().shapes,l=s.find(e=>e.id===o.target),u=l&&o.title===c(s,l)?c(s,i):void 0;N(e,t,n,e=>v(e,r,i.id,u)),F(e,t,n,{picking:null,selected:r})}function B(e,t,n,r){let i=P(e,t,n);N(e,t,n,e=>_(e,r))&&i&&F(e,t,n,A(i,r))}function V(e,t,n,r,i){let a=P(e,t,n);N(e,t,n,e=>g(e,r,i))&&a&&F(e,t,n,j(a,r,i))}function H(e,t,n,r,i){N(e,t,n,e=>e.map((e,t)=>t===r?U({...e,...i}):e))}function U(e){let t={...e};return t.text||delete t.text,(!t.kind||t.kind===`call`)&&delete t.kind,t.payload||delete t.payload,t.also?.length||delete t.also,t.branches?.length||delete t.branches,t.fails||delete t.fails,t}function W(e,t,n){let r=new Map;return t.forEach((i,a)=>{let o=a===0?n:t[a-1];if(!o)return;let c=p(e,s(o),s(i));c&&r.set(a,c)}),r}function G(e,t){return e.ends.map(e=>t.get(e.shapeId)??`the box`).join(` and `)}function K(t,n){let r=t.store.getState(),i=r.shapes.find(e=>e.id===n.arrow.id);if(i?.type!==`arrow`)return;let a={};for(let t of n.ends){let n=r.shapes.find(e=>e.id===t.shapeId);n&&(t.end===`start`?a.startBinding=e(n,{x:i.x,y:i.y}):a.endBinding=e(n,{x:i.x2,y:i.y2}))}Object.keys(a).length>0&&r.updateShape(i.id,a)}function q(e){let t=new Map,n=new Map,r=[];for(let i of e){let a=l(e,i.id);a?(t.set(a.flow.id,[...t.get(a.flow.id)??[],i]),n.set(i.id,{flowId:a.flow.id,index:a.index})):r.push(i)}let i=[],a=new Set,o=(e,r)=>{if(!a.has(e.id)){a.add(e.id),i.push({flow:e,depth:r,origin:r>0?n.get(e.id)??null:null});for(let n of t.get(e.id)??[])o(n,r+1)}};return r.forEach(e=>o(e,0)),e.forEach(e=>o(e,0)),i}function J(e){return q(e).filter(e=>e.depth===0).map(e=>e.flow)}export{S as _,W as a,x as b,R as c,z as d,I as f,T as g,D as h,G as i,V as l,O as m,J as n,L as o,E as p,K as r,H as s,q as t,B as u,C as v,d as x,w as y};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/export-FQTXirjn.js","assets/shapes-D5w8NTQQ.js","assets/style-BENGW2ZV.js","assets/slides-DDNzjFz9.js","assets/preload-helper-Czpn1I53.js","assets/blob-CTPsKWYv.js","assets/theme-palette-DEq19D0h.js","assets/clipboard-CO7YHov7.js","assets/export-u442sUQs.js","assets/registry-d5KleeyB.js","assets/text-breaks-DhCXtQrJ.js","assets/web-card-font-BbZEq3En.js","assets/icon-sources-CZI1h18s.js","assets/chart-CKIxcbcM.js","assets/frames-DRSLvE9E.js","assets/connector-labels-DqVssnYz.js","assets/web-card-BTru0lge.js","assets/web-embeds-I3saJ_yp.js","assets/web-embed-url-CHu4SU82.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{r as n}from"./toast-Czv_DJ-4.js";import{a as r,s as i}from"./editor-DAJETlQW.js";import{n as a}from"./renderer-environment-D3n3hbug.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-FQTXirjn.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));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};
|
package/assets/editor/assets/{use-grid-keyboard-nav-DhQKecO1.js → use-grid-keyboard-nav-B0jjlh8Q.js}
RENAMED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{t as r}from"./icons-DzW1j-r3.js";import{a as i,r as a}from"./asset-glyph-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{t as r}from"./icons-DzW1j-r3.js";import{a as i,r as a}from"./asset-glyph-DjBHkQcP.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 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{_ as n}from"./selection-overlay-primitives-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{_ as n}from"./selection-overlay-primitives-CfOaP5_G.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{Ct as n,Dn as r,Fn as i,Gt as a,J as o,Mt as s,Qt as c,St as l,Tn as u,Tt as d,U as f,Vt as p,Wt as m,nn as h,rt as g,tn as _,wt as v}from"./useScrollLock-CQpr0n6U.js";import{t as y}from"./createReactComponent-C51FAx3B.js";import{t as b}from"./useValueChanged-SqLfIDi5.js";var x=e(t(),1);function S(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:o=!1,stickIfOpen:c=!0,touchOpenDelay:l=0,reason:d=g}=t,m=`rootStore`in e?e.rootStore:e,v=m.context.dataRef,y=x.useRef(void 0),b=h(),S=_(),C=x.useMemo(()=>{function e(e,t,n,r){let i=f(d,t,n);e&&r===`touch`&&l>0?S.start(l,()=>{m.setOpen(!0,i)}):m.setOpen(e,i)}function t(e,t,n){let r=v.current.openEvent,a=m.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&c?!n(r.type):!1}return{onPointerDown(e){y.current=e.pointerType},onMouseDown(n){let i=y.current,c=n.nativeEvent,l=m.select(`open`);if(n.button!==0||r===`click`||s(i,!0)&&o)return;let u=t(l,n.currentTarget,e=>e===`click`||e===`mousedown`),d=a(c);if(p(d)){e(u,c,d,i);return}let f=n.currentTarget;b.request(()=>{e(u,c,f,i)})},onClick(n){if(r===`mousedown-only`)return;let i=y.current;if(r===`mousedown`&&i){y.current=void 0;return}s(i,!0)&&o||e(t(m.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){y.current=void 0}}},[v,r,o,d,m,c,i,b,S,l]);return x.useMemo(()=>n?{reference:C}:u,[n,C])}var C=y(`outline`,`chevron-down`,`ChevronDown`,[[`path`,{d:`M6 9l6 6l6 -6`,key:`svg-0`}]]);function w(e){let t=x.useRef(``),n=x.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:x.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function T(e,t){let{onClick:n,onPointerDown:i}=w(r((n,r)=>{(typeof e==`function`?e():e)||t(r||(c?`touch`:``))}));return x.useMemo(()=>({onClick:n,onPointerDown:i}),[n,i])}function E(e){let[t,n]=x.useState(null),r=T(e,n);return b(e,t=>{t&&!e&&n(null)}),x.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var D=e(i(),1);function O(e,t){let r=x.useRef(null);function i(t){D.flushSync(()=>{e.setOpen(!1,f(o,t.nativeEvent,t.currentTarget))}),v(r.current)?.focus()}function a(r){let i=e.select(`positionerElement`);if(i&&d(r,i))e.context.beforeContentFocusGuardRef.current?.focus();else{D.flushSync(()=>{e.setOpen(!1,f(o,r.nativeEvent,r.currentTarget))});let a=n(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&m(i,a);){let e=a;if(a=l(a),a===e)break}a?.focus()}}return{preFocusGuardRef:r,handlePreFocusGuardFocus:i,handleFocusTargetFocus:a}}export{S as a,C as i,E as n,T as r,O as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./web-embeds-I3saJ_yp.js";function t(t){let n=t.label.trim();if(t.kind===`html`){let e=`${Math.round(t.width)}×${Math.round(t.height)}`;return{title:n||`HTML widget`,caption:`HTML widget · ${e}`,glyph:`code`}}let r=t.url?e(t.url):null;if(!r)return{title:n||`Web embed`,caption:t.url??``,glyph:`globe`};let i=new URL(r.canonical).hostname.replace(/^www\./,``);return{title:n||r.label,caption:i,glyph:r.video?`play`:`globe`}}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`Inter, ui-sans-serif, system-ui, sans-serif`;export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{t as r}from"./tooltip-CKCG8vcp.js";import{o as i,s as a}from"./editor-DAJETlQW.js";import{r as o}from"./web-widget-limits-DeMquLIR.js";import{jt as s}from"./shapes-D5w8NTQQ.js";import{t as c}from"./panel-controls-B0Ccd0XF.js";import{t as l}from"./createReactComponent-C51FAx3B.js";import{t as u}from"./IconCode-CHIz1nCU.js";import{n as d,t as f}from"./IconReplace-CYUD1RLF.js";import{l as p}from"./chrome-C2RCq3SI.js";import{n as m,r as h}from"./widget-source-C3N9ZKTz.js";var g=l(`outline`,`arrow-autofit-height`,`ArrowAutofitHeight`,[[`path`,{d:`M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h6`,key:`svg-0`}],[`path`,{d:`M18 14v7`,key:`svg-1`}],[`path`,{d:`M18 3v7`,key:`svg-2`}],[`path`,{d:`M15 18l3 3l3 -3`,key:`svg-3`}],[`path`,{d:`M15 6l3 -3l3 3`,key:`svg-4`}]]),_=l(`outline`,`aspect-ratio`,`AspectRatio`,[[`path`,{d:`M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10`,key:`svg-0`}],[`path`,{d:`M7 12v-3h3`,key:`svg-1`}],[`path`,{d:`M17 12v3h-3`,key:`svg-2`}]]),v=l(`outline`,`devices`,`Devices`,[[`path`,{d:`M13 9a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1v-10`,key:`svg-0`}],[`path`,{d:`M18 8v-3a1 1 0 0 0 -1 -1h-13a1 1 0 0 0 -1 1v12a1 1 0 0 0 1 1h9`,key:`svg-1`}],[`path`,{d:`M16 9h2`,key:`svg-2`}]]),y=e(t(),1),b=n();function x(e){let t=m(e.kind===`html`?h({kind:`html`,html:e.html,htmlSrc:e.htmlSrc}):null,!0),n=t?.status===`ready`?t.html:null;return(0,y.useMemo)(()=>n===null?null:o(n),[n])}function S(e){let t=e/1024;return`${t<10?t.toFixed(1):Math.round(t)} KB`}var C=[{label:`Phone`,width:390},{label:`Tablet`,width:820},{label:`Desktop`,width:1280}],w=2400,T=`flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg transition-colors`;function E(e){try{let t=new URL(e),n=t.pathname===`/`?``:t.pathname;return`${t.hostname.replace(/^www\./,``)}${n}`}catch{return e}}function D(e){let{web:t}=e,n=a(),o=i(e=>e.widgetSizes.get(t.id)?.height??null),l=x(t);if(t.kind===`html`)return(0,b.jsxs)(`div`,{className:`flex items-center gap-0.5`,"data-testid":`web-controls`,children:[(0,b.jsx)(`span`,{"data-testid":`web-html-size-label`,className:`px-2 text-[12px] text-[var(--chrome-fg-500)]`,children:l===null?`Widget`:`Widget · ${S(l)}`}),(0,b.jsx)(c,{label:`Width`,caret:!0,closeOnPick:!0,testId:`web-width-presets`,trigger:(0,b.jsx)(v,{size:17,stroke:1.75}),children:(0,b.jsx)(`div`,{className:`flex flex-col gap-0.5 p-1`,children:C.map(e=>(0,b.jsxs)(`button`,{type:`button`,"data-testid":`web-width-${e.label.toLowerCase()}`,onClick:()=>n.getState().updateShape(t.id,{width:e.width}),className:`flex h-8 items-center justify-between gap-4 rounded-lg px-2 text-[13px] ${p(!1)}`,children:[e.label,(0,b.jsx)(`span`,{className:`text-[12px] text-[var(--chrome-fg-500)]`,children:e.width})]},e.label))})}),(0,b.jsx)(r,{label:o===null?`Fit height (once the page runs)`:`Fit height`,children:(0,b.jsx)(`button`,{type:`button`,"aria-label":`Fit height`,"data-testid":`web-fit-height`,disabled:o===null,onClick:()=>{if(o===null)return;let e=Math.min(w,Math.max(1,Math.round(o)));n.getState().updateShape(t.id,{height:e})},className:`${T} ${p(!1)} disabled:cursor-default disabled:opacity-40`,children:(0,b.jsx)(g,{size:17,stroke:1.75})})}),(0,b.jsxs)(`button`,{type:`button`,"data-testid":`web-edit-html`,onClick:()=>n.getState().setWebHtmlEditorId(t.id),className:`flex h-8 items-center gap-1.5 rounded-lg px-2 text-[13px] ${p(!1)}`,children:[(0,b.jsx)(u,{size:16,stroke:1.75}),`Edit HTML`]})]});let m=s(t.url);return(0,b.jsxs)(`div`,{className:`flex items-center gap-0.5`,"data-testid":`web-controls`,children:[m&&(0,b.jsx)(r,{label:`Open in new tab`,children:(0,b.jsxs)(`a`,{href:m,target:`_blank`,rel:`noopener noreferrer`,"data-testid":`web-url`,className:`flex h-8 max-w-[220px] items-center gap-1.5 rounded-lg px-2 text-[12px] text-[var(--chrome-fg-600)] transition-colors hover:bg-[var(--chrome-hover)]`,children:[(0,b.jsx)(`span`,{className:`truncate`,children:E(m)}),(0,b.jsx)(d,{size:14,stroke:1.75,className:`shrink-0`})]})}),(0,b.jsx)(r,{label:`Replace link`,children:(0,b.jsx)(`button`,{type:`button`,"aria-label":`Replace link`,"data-testid":`web-replace-url`,onClick:()=>n.getState().setWebEmbedDialog({mode:`replace`,shapeId:t.id}),className:`${T} ${p(!1)}`,children:(0,b.jsx)(f,{size:17,stroke:1.75})})}),(0,b.jsx)(r,{label:`Keep aspect ratio`,children:(0,b.jsx)(`button`,{type:`button`,"aria-label":`Keep aspect ratio`,"aria-pressed":t.keepAspect,"data-testid":`web-keep-aspect`,onClick:()=>n.getState().updateShape(t.id,{keepAspect:!t.keepAspect||void 0}),className:`${T} ${p(t.keepAspect)}`,children:(0,b.jsx)(_,{size:17,stroke:1.75})})})]})}export{S as n,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{o as r,s as i}from"./editor-DAJETlQW.js";import{A as a}from"./slides-DDNzjFz9.js";import{t as o}from"./IconAlertTriangle-B33xznYN.js";import{n as s,t as c}from"./surface-Dke4SWpE.js";import{i as l,n as u,r as d,t as f}from"./DialogRoot-DUeVfNhS.js";import{n as p,t as m}from"./DialogTitle-D5au2NAn.js";import{t as h}from"./DialogDescription-Ddhk2rmF.js";import{t as g}from"./dialog-DnXgEbpz.js";import{i as _,r as v,t as y}from"./embed-input-D77Udvni.js";var b=e(t(),1),x=n(),S={youtube:`YouTube video`,vimeo:`Vimeo video`,loom:`Loom video`,figma:`Figma file`,codepen:`CodePen`,codesandbox:`CodeSandbox`,"google-maps":`Google Map`,spotify:`Spotify`,generic:`Web page`};function C(e){let{onInsert:t}=e,n=i(),C=r(e=>e.webEmbedDialog),[w,T]=(0,b.useState)(``),E=C!==null;(0,b.useEffect)(()=>{if(C){if(C.mode===`replace`){let e=a(n.getState().shapes,C.shapeId);T(e?.type===`web`?e.url??``:``);return}T(``)}},[C,n]);let D=v(w),O=D?null:y(w),k=w.trim()===``?null:D,A=C?.mode===`replace`;function j(){n.getState().setWebEmbedDialog(null)}function M(e){if(e.preventDefault(),!(!O||!C)){if(C.mode===`replace`){let e=n.getState(),t=a(e.shapes,C.shapeId);t?.type===`web`&&t.url!==O.canonical&&e.replaceShape(_(t,O)),j();return}t(O),j()}}return(0,x.jsx)(f,{open:E,onOpenChange:e=>{e||j()},children:(0,x.jsxs)(u,{children:[(0,x.jsx)(l,{className:s.dialogBackdrop}),(0,x.jsxs)(d,{"data-overlay":!0,"data-testid":`web-embed-dialog`,className:`w-[min(460px,92vw)] p-5 ${s.dialogPopup}`,children:[(0,x.jsx)(m,{className:g.title,children:A?`Replace link`:`Embed a web page`}),(0,x.jsx)(h,{className:c(`mt-1`,g.description),children:`Paste a link or embed code. Videos, Figma files, CodePens, maps and Spotify play right on the board.`}),(0,x.jsxs)(`form`,{className:`mt-4 flex flex-col gap-3`,onSubmit:M,children:[(0,x.jsx)(`input`,{"data-testid":`web-embed-url`,className:g.field,value:w,placeholder:`https://`,autoFocus:!0,spellCheck:!1,autoComplete:`off`,onChange:e=>T(e.target.value),onKeyDown:e=>e.stopPropagation()}),O&&(0,x.jsxs)(`p`,{"data-testid":`web-embed-kind`,className:`text-[12px] text-[var(--chrome-fg-500)]`,children:[S[O.provider],` ·`,` `,new URL(O.canonical).hostname.replace(/^www\./,``)]}),O?.provider===`generic`&&(0,x.jsxs)(`p`,{"data-testid":`web-embed-warning`,className:`flex items-start gap-1.5 text-[12px] leading-relaxed text-[var(--chrome-fg-500)]`,children:[(0,x.jsx)(o,{size:14,stroke:1.75,className:`mt-[2px] shrink-0`}),`This site may refuse to be embedded. If it shows an error, open it in a new tab instead.`]}),k&&(0,x.jsx)(`p`,{"data-testid":`web-embed-error`,className:g.error,children:k}),(0,x.jsxs)(`div`,{className:g.actions,children:[(0,x.jsx)(p,{className:g.cancelButton,children:`Cancel`}),(0,x.jsx)(`button`,{type:`submit`,"data-testid":`web-embed-submit`,disabled:!O,className:g.submitButton,children:A?`Replace`:`Embed`})]})]})]})]})})}export{C as WebEmbedDialog};
|