koboyo 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/editor/assets/DialogDescription-Ddhk2rmF.js +1 -0
- package/assets/editor/assets/DialogRoot-DUeVfNhS.js +1 -0
- package/assets/editor/assets/DialogTitle-D5au2NAn.js +1 -0
- package/assets/editor/assets/FloatingPortalLite-HnWQWrLk.js +1 -0
- package/assets/editor/assets/{IconAlertTriangle-CxPhYpe-.js → IconAlertTriangle-B33xznYN.js} +1 -1
- package/assets/editor/assets/{IconArrowLeft-DFk3Krim.js → IconArrowLeft-B4Zcy-Fc.js} +1 -1
- package/assets/editor/assets/IconChevronLeft-D7e7QC0h.js +1 -0
- package/assets/editor/assets/IconChevronRight-csfMBSUs.js +1 -0
- package/assets/editor/assets/{IconCode-hd05zxU4.js → IconCode-CHIz1nCU.js} +1 -1
- package/assets/editor/assets/IconCornerDownRight-DDiBMO4O.js +1 -0
- package/assets/editor/assets/{IconEraser-DlZQe3-r.js → IconEraser-CYfXj27R.js} +1 -1
- package/assets/editor/assets/{IconFocusCentered-C5PcDeR0.js → IconFocusCentered-Cn8rbfRI.js} +1 -1
- package/assets/editor/assets/IconHelp-CaEwHrsN.js +2 -0
- package/assets/editor/assets/{IconLink-ze4g4Lrj.js → IconLink-VS5p9Ytk.js} +1 -1
- package/assets/editor/assets/IconLoader2-CzCTn-Sn.js +1 -0
- package/assets/editor/assets/IconMinus-BcaDLts8.js +1 -0
- package/assets/editor/assets/{IconMoodSmile-Bic_fw54.js → IconMoodSmile-CSZ5p_Hy.js} +1 -1
- package/assets/editor/assets/{IconPencil-C5Y-Y4dC.js → IconPencil-D_pQsAyv.js} +1 -1
- package/assets/editor/assets/{IconPhoto-CR36IK-b.js → IconPhoto-5zuCDtnR.js} +1 -1
- package/assets/editor/assets/{IconPlayerPlayFilled-D4OODBX7.js → IconPlayerPlayFilled-DVAWmYt7.js} +1 -1
- package/assets/editor/assets/{IconPlayerStopFilled-BUbX6ZO5.js → IconPlayerStopFilled-D4qdct2R.js} +1 -1
- package/assets/editor/assets/IconPlus-D4tAoi-A.js +1 -0
- package/assets/editor/assets/{IconPresentation-DCrY3PKL.js → IconPresentation-BMKzt7fv.js} +1 -1
- package/assets/editor/assets/{IconSearch-C1K0_Pq_.js → IconSearch-CCpMt02s.js} +1 -1
- package/assets/editor/assets/{IconSparkles-WDcg8BA9.js → IconSparkles-CnCp3BCQ.js} +1 -1
- package/assets/editor/assets/{IconTrash-DbN_RxB7.js → IconTrash-C8w6ThWx.js} +1 -1
- package/assets/editor/assets/{IconUsers-Bwnyj4mm.js → IconUsers-Dp85N225.js} +1 -1
- package/assets/editor/assets/IconX-KrRqxr2j.js +1 -0
- package/assets/editor/assets/MenuSubmenuTrigger-KacA9GM8.js +1 -0
- package/assets/editor/assets/PopoverPopup-B3Y0VRYc.js +1 -0
- package/assets/editor/assets/{asset-glyph-B3c--Mx2.js → asset-glyph-C1E6cGwM.js} +1 -1
- package/assets/editor/assets/billing-BSXr-z2r.js +1 -0
- package/assets/editor/assets/build-pips-BV-uwXlP.js +1 -0
- package/assets/editor/assets/build-visibility-DyML9SHt.js +1 -0
- package/assets/editor/assets/builders-DMHAOPEv.js +1 -0
- package/assets/editor/assets/{chart-Z4HQx-0h.js → chart-4iRduYdU.js} +4 -4
- package/assets/editor/assets/{chrome-layout-B8YmHznO.js → chrome-layout-BzPU9far.js} +1 -1
- package/assets/editor/assets/{code-panel-BfsykjSz.js → code-panel-koBUgEWp.js} +7 -7
- package/assets/editor/assets/command-palette-BR-_ChOL.js +1 -0
- package/assets/editor/assets/config-D8b1QyEk.js +1 -0
- package/assets/editor/assets/connector-labels-CrEgadsC.js +2 -0
- package/assets/editor/assets/copy-image-dialog-BzGP7Xw8.js +1 -0
- package/assets/editor/assets/{core-CBnmD9hT.js → core-CmsJyU_-.js} +1 -1
- package/assets/editor/assets/createReactComponent-C51FAx3B.js +1 -0
- package/assets/editor/assets/{diagram-fingerprint-CsqZK4xZ.js → diagram-fingerprint-WGQ5iVXx.js} +1 -1
- package/assets/editor/assets/dialog-DnXgEbpz.js +1 -0
- package/assets/editor/assets/{edit-BJ_kibk8.js → edit-C0sBxxsg.js} +1 -1
- package/assets/editor/assets/editor-BeufBV54.js +1 -0
- package/assets/editor/assets/{elk-api-DnfklSaw.js → elk-api-C4wlHVIw.js} +1 -1
- package/assets/editor/assets/{elk-worker-loader-CC-I9MmI.js → elk-worker-loader-CVBdN1je.js} +1 -1
- package/assets/editor/assets/{export-ChP0k5F5.js → export-Bce6ra0N.js} +1 -1
- package/assets/editor/assets/export-K2VWg76n.js +6 -0
- package/assets/editor/assets/export-dialog-x2n2a4KX.js +1 -0
- package/assets/editor/assets/flow-layer-ewaL7g2y.js +1 -0
- package/assets/editor/assets/flow-panel-BzXNGGke.js +1 -0
- package/assets/editor/assets/flow-stage-Ba_CAggI.js +1 -0
- package/assets/editor/assets/{flow-start-BKN48uke.js → flow-start-CpAvU-9P.js} +1 -1
- package/assets/editor/assets/{flows-GGbkNqs8.js → flows-Cj7AFMIA.js} +2 -2
- package/assets/editor/assets/frames-Cp1QD3LR.js +1 -0
- package/assets/editor/assets/icon-picker-Cg39IKNJ.js +1 -0
- package/assets/editor/assets/image-library-JQu_tb8P.js +1 -0
- package/assets/editor/assets/index-CBPPqsiR.js +24 -0
- package/assets/editor/assets/{index-e23lIFZB.css → index-DBrN0u0i.css} +1 -1
- package/assets/editor/assets/jsx-runtime-DKdBMi_L.js +1 -0
- package/assets/editor/assets/layout-offthread-mRHRulkS.js +18 -0
- package/assets/editor/assets/{layout.worker-BIE1_z0S.js → layout.worker-CekYkaxO.js} +2 -2
- package/assets/editor/assets/menu-B9BAk63v.js +1 -0
- package/assets/editor/assets/panel-controls-DWVXiNUZ.js +1 -0
- package/assets/editor/assets/{panel-shell-CG2aq4Ia.js → panel-shell-BnMOHgWM.js} +1 -1
- package/assets/editor/assets/{plan-jQm1jDpt.js → plan-CkgM52Yh.js} +1 -1
- package/assets/editor/assets/presentation-DJUO0t7I.js +1 -0
- package/assets/editor/assets/presenter-keys-Bs3LnmOa.js +1 -0
- package/assets/editor/assets/{jsx-runtime-2Zwg-L3c.js → react-lCSYwAWP.js} +1 -1
- package/assets/editor/assets/reflow-DaYiVkwp.js +1 -0
- package/assets/editor/assets/registry-rEGZW7Ab.js +1 -0
- package/assets/editor/assets/renderer-environment-D3n3hbug.js +1 -0
- package/assets/editor/assets/ride-overlay-Hx90v4ZK.js +1 -0
- package/assets/editor/assets/selection-overlay-primitives-BRp854AD.js +1 -0
- package/assets/editor/assets/shape-meta-COE2ATNh.js +1 -0
- package/assets/editor/assets/sign-in-dialog-tmQEB2bx.js +1 -0
- package/assets/editor/assets/slide-notes-dialog-BQBXpep6.js +1 -0
- package/assets/editor/assets/slides-D686obFO.js +15 -0
- package/assets/editor/assets/slides-panel-BEJCevJi.js +26 -0
- package/assets/editor/assets/text-breaks-DM4W6y5f.js +7 -0
- package/assets/editor/assets/{theme-palette-D1nbDFBC.js → theme-palette-Dl_G_VIJ.js} +1 -1
- package/assets/editor/assets/tidy-browser-dF3BON7J.js +1 -0
- package/assets/editor/assets/tidy-scope-BGG3ZXvZ.js +1 -0
- package/assets/editor/assets/toast-Czv_DJ-4.js +1 -0
- package/assets/editor/assets/{tool-catalog-CHq6TJ2q.js → tool-catalog-DXPhX2S1.js} +1 -1
- package/assets/editor/assets/tool-drawer-CWOX_njp.js +1 -0
- package/assets/editor/assets/tooltip-CyBz17g8.js +1 -0
- package/assets/editor/assets/{tree-BbSzMkPL.js → tree-KSgPjntC.js} +1 -1
- package/assets/editor/assets/upgrade-dialog-DhSZnDpx.js +1 -0
- package/assets/editor/assets/use-drag-reorder-ye8-kpyR.js +1 -0
- package/assets/editor/assets/use-export-command-sC9UHj3_.js +2 -0
- package/assets/editor/assets/use-grid-keyboard-nav-DhQKecO1.js +0 -0
- package/assets/editor/assets/use-icon-node-BxqH7H27.js +1 -0
- package/assets/editor/assets/use-key-held-094C3Mn3.js +1 -0
- package/assets/editor/assets/use-recent-list-DuazDypH.js +1 -0
- package/assets/editor/assets/useAnchoredPopupScrollLock-i8D5Dm1d.js +1 -0
- package/assets/editor/assets/useBaseUiId-D2RfU0uY.js +1 -0
- package/assets/editor/assets/useButton-CLQYGhRJ.js +1 -0
- package/assets/editor/assets/useControlled-BE8zdmih.js +1 -0
- package/assets/editor/assets/usePositioner-AtbrPc7w.js +1 -0
- package/assets/editor/assets/useScrollLock-CQpr0n6U.js +1 -0
- package/assets/editor/assets/useValueChanged-SqLfIDi5.js +1 -0
- package/assets/editor/assets/web-controls-CLE9zr7i.js +1 -0
- package/assets/editor/assets/web-embed-dialog-XUNelFFM.js +1 -0
- package/assets/editor/assets/web-html-dialog-BcAyzH5D.js +1 -0
- package/assets/editor/assets/web-shape-C941TGTy.js +1 -0
- package/assets/editor/assets/widget-source-CHujvUeA.js +1 -0
- package/assets/editor/index.html +73 -69
- package/dist/koboyo.js +257 -215
- package/package.json +5 -5
- package/skills/koboyo/SKILL.md +22 -2
- 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/DialogDescription-ZtZCUsfy.js +0 -1
- package/assets/editor/assets/DialogRoot-mHGRFW9m.js +0 -1
- package/assets/editor/assets/DialogTitle-CFhr-gP9.js +0 -1
- package/assets/editor/assets/FloatingPortalLite-Bf0q6fmL.js +0 -1
- package/assets/editor/assets/IconChevronLeft-BR0iwdRI.js +0 -1
- package/assets/editor/assets/IconChevronRight-DBDnxPYT.js +0 -1
- package/assets/editor/assets/IconCornerDownRight-BerbioFY.js +0 -1
- package/assets/editor/assets/IconHelp-DKNacRqS.js +0 -2
- package/assets/editor/assets/IconLoader2-BQaF1LKo.js +0 -1
- package/assets/editor/assets/IconMinus-y4ejub-s.js +0 -1
- package/assets/editor/assets/IconPlus-BbmieIBT.js +0 -1
- package/assets/editor/assets/IconX-AlbPkO_g.js +0 -1
- package/assets/editor/assets/MenuSubmenuTrigger-CpN67g09.js +0 -1
- package/assets/editor/assets/PopoverPopup-BqGWd_uB.js +0 -1
- package/assets/editor/assets/billing-C-BNGM3Z.js +0 -1
- package/assets/editor/assets/build-pips-q_Fq10ov.js +0 -1
- package/assets/editor/assets/build-visibility-E1mHeDCW.js +0 -1
- package/assets/editor/assets/builders-DbF28yId.js +0 -1
- package/assets/editor/assets/command-palette-BjFnQHnz.js +0 -1
- package/assets/editor/assets/config-a_lz-57R.js +0 -1
- package/assets/editor/assets/connector-labels-vVnYQJRz.js +0 -2
- package/assets/editor/assets/copy-image-dialog-CCY_6fM4.js +0 -1
- package/assets/editor/assets/createReactComponent-9UsI5fmM.js +0 -1
- package/assets/editor/assets/dialog-B32krrce.js +0 -1
- package/assets/editor/assets/editor-B0tARd79.js +0 -1
- package/assets/editor/assets/export-DEFKKRRi.js +0 -6
- package/assets/editor/assets/export-dialog-DPg1uzX5.js +0 -1
- package/assets/editor/assets/flow-layer-B7mlx0G4.js +0 -1
- package/assets/editor/assets/flow-panel-DoK6VIJ4.js +0 -1
- package/assets/editor/assets/flow-stage-fiF5Nggn.js +0 -1
- package/assets/editor/assets/frames-CRP8oPP8.js +0 -1
- package/assets/editor/assets/icon-picker-NboB5Fvv.js +0 -1
- package/assets/editor/assets/image-library-Bb6bV6eK.js +0 -1
- package/assets/editor/assets/index-mhi0Z6gG.js +0 -24
- package/assets/editor/assets/layout-offthread-BwetpTFH.js +0 -18
- package/assets/editor/assets/menu-BPrc8Ara.js +0 -1
- package/assets/editor/assets/panel-controls-DYZ7QFT5.js +0 -1
- package/assets/editor/assets/presentation-BavfNtxp.js +0 -1
- package/assets/editor/assets/presenter-keys-DVQcBdy1.js +0 -1
- package/assets/editor/assets/reflow-Cv75wPSh.js +0 -1
- package/assets/editor/assets/registry-DCgwH8wI.js +0 -1
- package/assets/editor/assets/renderer-environment-DmWXvuT4.js +0 -1
- package/assets/editor/assets/ride-overlay-DhygYdx1.js +0 -1
- package/assets/editor/assets/selection-overlay-primitives-hWJ1xjF7.js +0 -1
- package/assets/editor/assets/shape-meta-BpwsiB82.js +0 -1
- package/assets/editor/assets/sign-in-dialog-DRooo5xw.js +0 -1
- package/assets/editor/assets/slide-notes-dialog-DLdTmd7_.js +0 -1
- package/assets/editor/assets/slides-D9bnXqtf.js +0 -15
- package/assets/editor/assets/slides-panel-hozTMSMk.js +0 -26
- package/assets/editor/assets/text-breaks-YU-ymaF9.js +0 -7
- package/assets/editor/assets/tidy-browser-BwodBnAH.js +0 -1
- package/assets/editor/assets/tidy-scope-BgBSUklT.js +0 -1
- package/assets/editor/assets/toast-Nu_fiCd9.js +0 -1
- package/assets/editor/assets/tool-drawer-DEEqsKSN.js +0 -1
- package/assets/editor/assets/tooltip-DgEojto1.js +0 -1
- package/assets/editor/assets/upgrade-dialog-DpZeaLDB.js +0 -1
- package/assets/editor/assets/use-drag-reorder-CTTvTwza.js +0 -1
- package/assets/editor/assets/use-export-command-CPc7qug1.js +0 -2
- package/assets/editor/assets/use-grid-keyboard-nav-B88Qw-cQ.js +0 -0
- package/assets/editor/assets/use-icon-node-DJZFjABX.js +0 -1
- package/assets/editor/assets/use-key-held-38H1v73f.js +0 -1
- package/assets/editor/assets/use-recent-list-BEG0iBIm.js +0 -1
- package/assets/editor/assets/useAnchoredPopupScrollLock-BGKchwpi.js +0 -1
- package/assets/editor/assets/useBaseUiId-C0Zm5sUV.js +0 -1
- package/assets/editor/assets/useButton-D3eS7fh5.js +0 -1
- package/assets/editor/assets/useControlled-C5xhvPXX.js +0 -1
- package/assets/editor/assets/usePositioner-DA3aR0-T.js +0 -1
- package/assets/editor/assets/useScrollLock-B7mQdXyv.js +0 -1
- package/assets/editor/assets/useValueChanged-p8z-93L4.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{An as n,Cn as r,Dn as i,Fn as a,Gt as o,Ht as s,Mn as c,Nn as l,Pn as u,Ut as d,Wt as f,an as p,at as m,bt as h,dt as g,en as _,ht as ee,in as v,it as y,jn as b,lt as x,mn as S,mt as te,pt as C,rn as w,tn as T,yt as E}from"./useScrollLock-CQpr0n6U.js";import{t as D}from"./jsx-runtime-DKdBMi_L.js";import{t as O}from"./FloatingPortalLite-HnWQWrLk.js";var k=e(t(),1),A=k.createContext(void 0);function ne(){let e=k.useContext(A);if(!e)throw Error(b(73));return e}var j=0;function M(e){return j+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${j}`}function N(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function P(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function F(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var I=e=>e.toastMetadata,L={toasts:n(e=>e.toasts),isEmpty:n(e=>e.toasts.length===0),toast:n(I,(e,t)=>e.get(t)?.value),toastIndex:n(I,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:n(I,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:n(I,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:n(e=>e.hovering),focused:n(e=>e.focused),expanded:n(e=>e.hovering||e.focused),expandedOrOutOfFocus:n(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:n(e=>e.prevFocusElement)},R=class extends r{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:P(e.toasts)},{},L)}setFocused(e){this.set(`focused`,e)}setHovering(e){this.set(`hovering`,e)}setIsWindowFocused(e){this.set(`isWindowFocused`,e)}setPrevFocusElement(e){this.set(`prevFocusElement`,e)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e){let t=this.state.limit!==e.limit;if(this.state.timeout===e.timeout&&!t)return;let n={timeout:e.timeout,limit:e.limit};if(t){let t=F(this.state.toasts,e.limit);n.toasts=t,n.toastMetadata=P(t)}this.update(n)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t={}){let n=L.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t.skipOnRemove||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||M(`toast`);if(e.id){let t=L.toast(this.state,e.id);if(t)if(t.transitionStatus===`ending`)this.removeToast(e.id,{skipOnRemove:!0});else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,{resetTimer:!0,markUpdated:!0}),e.id}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(F(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),L.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{this.updateToastInternal(e,t,{markUpdated:!0})};updateToastInternal=(e,t,n={})=>{let{timeout:r,toasts:i}=this.state,a=L.toast(this.state,e)??null;if(!a||a.transitionStatus===`ending`)return;let o={...a,...t,...n.markUpdated&&{updateKey:(a.updateKey??0)+1}};this.setToasts(i.map(t=>t.id===e?o:t));let s=o.timeout??r,c=a?.timeout??r,l=Object.hasOwn(t,`timeout`),u=o.transitionStatus!==`ending`&&o.type!==`loading`&&s>0,d=this.timers.has(e),f=c!==s,p=a?.type===`loading`;if(!u&&d){this.clearTimer(e);return}u&&(!d||f||l||p||n.resetTimer)&&(this.clearTimer(e),this.scheduleTimer(e,s,()=>this.closeToast(e)),L.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=L.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=F(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n),o={toasts:a,toastMetadata:P(a)};a.some(e=>e.transitionStatus!==`ending`)||(o.hovering=!1,o.focused=!1),this.update(o),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=N(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=N(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=N(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=_.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=o(e);f(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=!L.expandedOrOutOfFocus(this.state),a=i?_.create():void 0;a?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e){let t={toasts:e,toastMetadata:P(e)};e.length===0&&(t.hovering=!1,t.focused=!1),this.update(t)}handleFocusManagement(e){let t=d(v(this.state.viewport));if(!this.state.viewport||!f(this.state.viewport,t)||!s(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=L.toasts(this.state),r=L.toastIndex(this.state,e),i=null,a=r+1;for(;a<n.length;){if(n[a].transitionStatus!==`ending`){i=n[a];break}a+=1}if(!i)for(a=r-1;a>=0;){if(n[a].transitionStatus!==`ending`){i=n[a];break}--a}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}},z=D(),B=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=l(()=>new R({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return u(a.disposeEffect),k.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),c(()=>{a.syncProviderProps({timeout:n,limit:r})},[a,n,r]),(0,z.jsx)(A.Provider,{value:a,children:t})},V=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({}),H=k.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...c}=e,l=ne(),u=T(),m=k.useRef(!1),g=k.useRef(!1),_=k.useRef(!1),y=l.useState(`isEmpty`),b=l.useState(`toasts`),x=l.useState(`focused`),te=l.useState(`expanded`),C=l.useState(`prevFocusElement`),D=b[0]?.height??0,O=k.useMemo(()=>b.some(e=>e.transitionStatus===`ending`),[b]),A=k.useMemo(()=>b.filter(e=>e.priority===`high`),[b]);k.useEffect(()=>{let e=l.state.viewport;if(!e)return;function t(t){y||t.key===`F6`&&o(t)!==e&&(t.preventDefault(),l.setPrevFocusElement(d(v(e))),e?.focus({preventScroll:!0}),l.pauseTimers(),l.setFocused(!0))}return w(S(e),`keydown`,t)},[l,y]),k.useEffect(()=>{let e=l.state.viewport;if(!e||y)return;let t=S(e);function n(e){o(e)===t&&(l.setIsWindowFocused(!1),l.pauseTimers())}function r(n){if(n.relatedTarget)return;let r=o(n),i=d(v(e));(r===t||!f(e,r)||!s(i))&&l.resumeTimers(),u.start(0,()=>l.setIsWindowFocused(!0))}return p(w(t,`blur`,n,!0),w(t,`focus`,r,!0))},[l,u,y]),k.useEffect(()=>{let e=l.state.viewport;if(!(!e||y))return w(v(e),`pointerdown`,l.handleDocumentPointerDown,!0)},[y,l]);function j(e){let t=l.state.viewport;if(t)if(m.current=!0,e.relatedTarget===t){let e=b.find(e=>e.transitionStatus!==`ending`&&!e.limited);e?e.ref?.current?.focus():l.restoreFocusToPrevElement()}else l.restoreFocusToPrevElement()}function M(e){e.key===`Tab`&&e.shiftKey&&o(e.nativeEvent)===l.state.viewport&&(e.preventDefault(),l.restoreFocusToPrevElement(),l.resumeTimers())}function N(){l.state.toasts.some(e=>e.transitionStatus===`ending`)||_.current||!g.current||(l.state.isWindowFocused&&l.resumeTimers(),l.setHovering(!1),g.current=!1)}k.useEffect(N,[O,l]);function P(){l.pauseTimers(),l.setHovering(!0),g.current=!1}function F(){l.state.isWindowFocused&&l.resumeTimers()}function I(){l.state.toasts.some(e=>e.transitionStatus===`ending`)||_.current?g.current=!0:(F(),l.setHovering(!1))}function L(e){e.pointerType===`touch`&&(_.current=!0)}function R(e){e.pointerType===`touch`&&(_.current=!1,N())}function B(){if(m.current){m.current=!1;return}x||s(d(v(l.state.viewport)))&&(l.setFocused(!0),l.pauseTimers())}function H(e){!x||f(l.state.viewport,e.relatedTarget)||(l.setFocused(!1),F())}let re={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:P,onMouseMove:P,onMouseLeave:I,onFocus:B,onBlur:H,onKeyDown:M,onClick:B,onPointerDown:L,onPointerUp:R,onPointerCancel:R},ie={expanded:te},U=ee(`div`,e,{ref:[t,l.setViewport],state:ie,props:[re,{style:{[V.frontmostHeight]:D?`${D}px`:void 0}},c,{children:(0,z.jsxs)(k.Fragment,{children:[!y&&C&&(0,z.jsx)(E,{onFocus:j}),a,!y&&C&&(0,z.jsx)(E,{onFocus:j})]})}]});return(0,z.jsxs)(k.Fragment,{children:[!y&&C&&(0,z.jsx)(E,{onFocus:j}),U,!x&&A.length>0&&(0,z.jsx)(`div`,{style:h,children:A.map(e=>(0,z.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,z.jsx)(`div`,{children:e.title}),(0,z.jsx)(`div`,{children:e.description})]},e.id))})]})}),re=e(a(),1),ie=k.createContext(void 0);function U(){let e=k.useContext(ie);if(!e)throw Error(b(66));return e}var W=function(e){return e.index=`--toast-index`,e.offsetY=`--toast-offset-y`,e.height=`--toast-height`,e.swipeMovementX=`--toast-swipe-movement-x`,e.swipeMovementY=`--toast-swipe-movement-y`,e}({});function ae(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function oe(e){let t=S(e).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var se={...C,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},ce=40,le=10,G=.5,ue=1,de=`${m},${x}`,K=k.forwardRef(function(e,t){let{toast:n,render:r,className:a,swipeDirection:s=[`down`,`right`],style:l,...u}=e,p=n.positionerProps?.anchor!==void 0,m=[];p||(m=Array.isArray(s)?s:[s]);let h=m.length>0,_=ne(),[y,b]=k.useState(void 0),[x,S]=k.useState(!1),[C,T]=k.useState(!1),[E,D]=k.useState(!1),[O,A]=k.useState({x:0,y:0}),[j,M]=k.useState({x:0,y:0,scale:1}),[N,P]=k.useState(),[F,I]=k.useState(),[L,R]=k.useState(null),B=k.useRef(null),V=k.useRef({x:0,y:0}),H=k.useRef({x:0,y:0,scale:1}),U=k.useRef(void 0),K=k.useRef(0),q=k.useRef(!1),J=k.useRef({x:0,y:0}),fe=k.useRef(!1),pe=k.useRef({x:0,y:0}),Y=k.useRef(null),X=k.useRef(null),Z=_.useState(`toastIndex`,n.id),Q=_.useState(`toastVisibleIndex`,n.id),me=_.useState(`toastOffsetY`,n.id),he=_.useState(`focused`),$=_.useState(`expanded`);g({open:n.transitionStatus!==`ending`,ref:B,onComplete(){n.transitionStatus===`ending`&&_.removeToast(n.id)}});let ge=i((e=!1)=>{let t=B.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){_.updateToastInternal(n.id,{ref:B,height:i,...n.transitionStatus===`starting`?{transitionStatus:void 0}:{}})}e?re.flushSync(a):a()});c(ge,[ge]);function _e(e){pe.current=e,A(e)}c(()=>()=>{X.current?.abort()},[]);function ve(e,t){let n=e,r=t;return!m.includes(`left`)&&!m.includes(`right`)?n=e>0?e**G:-(Math.abs(e)**G):(!m.includes(`right`)&&e>0&&(n=e**G),!m.includes(`left`)&&e<0&&(n=-(Math.abs(e)**G))),!m.includes(`up`)&&!m.includes(`down`)?r=t>0?t**G:-(Math.abs(t)**G):(!m.includes(`down`)&&t>0&&(r=t**G),!m.includes(`up`)&&t<0&&(r=-(Math.abs(t)**G))),{x:n,y:r}}let ye=i(e=>{if(e.pointerId!==Y.current)return;Y.current=null,X.current?.abort(),X.current=null,S(!1),T(!1),R(null);let t=H.current;if(e.type===`pointercancel`||q.current){_e({x:t.x,y:t.y}),b(void 0);return}let r=!1,i=pe.current,a=i.x-t.x,o=i.y-t.y,s;for(let e of m){switch(e){case`right`:a>ce&&(r=!0,s=`right`);break;case`left`:a<-40&&(r=!0,s=`left`);break;case`down`:o>ce&&(r=!0,s=`down`);break;case`up`:o<-40&&(r=!0,s=`up`);break;default:break}if(r)break}r?(b(s),D(!0),_.closeToast(n.id)):(_e({x:t.x,y:t.y}),b(void 0))});function be(e){if(e.button!==0)return;e.pointerType===`touch`&&_.pauseTimers();let t=o(e.nativeEvent);if(t&&t.closest(`button,a,input,textarea,[role="button"],${de}`))return;if(q.current=!1,U.current=void 0,K.current=0,Y.current=e.pointerId,V.current={x:e.clientX,y:e.clientY},J.current=V.current,B.current){let e=oe(B.current);H.current=e,M(e),_e({x:e.x,y:e.y})}_.setHovering(!0),S(!0),T(!1),R(null),fe.current=!0;let n=B.current;if(n){X.current?.abort();let t=new AbortController;X.current=t;let r=v(n);r.addEventListener(`pointerup`,ye,{signal:t.signal}),r.addEventListener(`pointercancel`,ye,{signal:t.signal}),n.setPointerCapture?.(e.pointerId)}}function xe(e){if(e.pointerId!==Y.current)return;e.preventDefault(),fe.current&&=(V.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>J.current.y||i>0&&t<J.current.y)&&(J.current={x:J.current.x,y:t}),(r<0&&n>J.current.x||r>0&&n<J.current.x)&&(J.current={x:n,y:J.current.y});let a=n-V.current.x,o=t-V.current.y,s=t-J.current.y,c=n-J.current.x;if(!C&&Math.sqrt(a*a+o*o)>=ue&&(T(!0),L===null)){let e=m.includes(`left`)||m.includes(`right`),t=m.includes(`up`)||m.includes(`down`);e&&t&&R(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let l;if(!U.current)L===`vertical`?o>0?l=`down`:o<0&&(l=`up`):L===`horizontal`?a>0?l=`right`:a<0&&(l=`left`):l=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,l&&m.includes(l)&&(U.current=l,K.current=ae(l,a,o),b(l));else{let e=U.current,t=ae(e,c,s);t>ce?(q.current=!1,b(e)):!(m.includes(`left`)&&m.includes(`right`))&&!(m.includes(`up`)&&m.includes(`down`))&&K.current-t>=le&&(q.current=!0)}let u=ve(a,o),d=H.current.x,f=H.current.y;L===`horizontal`?(m.includes(`left`)||m.includes(`right`))&&(d+=u.x):(L===`vertical`||(m.includes(`left`)||m.includes(`right`))&&(d+=u.x),(m.includes(`up`)||m.includes(`down`))&&(f+=u.y)),_e({x:d,y:f})}function Se(e){if(e.key===`Escape`){if(!B.current||!f(B.current,d(v(B.current))))return;_.closeToast(n.id)}}k.useEffect(()=>{if(!h)return;let e=B.current;if(!e)return;function t(t){Y.current===null||!f(e,o(t))||t.preventDefault()}return w(e,`touchmove`,t,{passive:!1})},[h]);function Ce(){if(!x&&O.x===j.x&&O.y===j.y&&!E)return{[W.swipeMovementX]:`0px`,[W.swipeMovementY]:`0px`};let e=O.x-j.x,t=O.y-j.y;return{transition:x?`none`:void 0,transform:x?`translateX(${O.x}px) translateY(${O.y}px) scale(${j.scale})`:void 0,[W.swipeMovementX]:`${e}px`,[W.swipeMovementY]:`${t}px`}}let we=n.priority===`high`,Te={role:we?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":N,"aria-describedby":F,"aria-hidden":we&&!he?!0:void 0,onPointerDown:h?be:void 0,onPointerMove:h?xe:void 0,onPointerUp:h?ye:void 0,onPointerCancel:h?ye:void 0,onKeyDown:Se,inert:te(n.limited),style:{...Ce(),[W.index]:n.transitionStatus===`ending`?Z:Q,[W.offsetY]:`${me}px`,[W.height]:n.height?`${n.height}px`:void 0}},Ee=k.useMemo(()=>({rootRef:B,toast:n,titleId:N,setTitleId:P,descriptionId:F,setDescriptionId:I,swiping:x,swipeDirection:y,recalculateHeight:ge,index:Z,visibleIndex:Q,expanded:$}),[n,N,F,x,y,ge,Z,Q,$]),De={transitionStatus:n.transitionStatus,expanded:$,limited:n.limited||!1,type:n.type,swiping:Ee.swiping,swipeDirection:Ee.swipeDirection},Oe=ee(`div`,e,{ref:[t,Ee.rootRef],state:De,stateAttributesMapping:se,props:[Te,u]});return(0,z.jsx)(ie.Provider,{value:Ee,children:Oe})}),q=k.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{toast:l,setTitleId:u}=U(),d=o??l.title,f=!!d,p=y(a);c(()=>{if(f)return u(p),()=>{u(void 0)}},[f,p,u]);let m=ee(`h2`,e,{ref:t,state:{type:l.type},props:{...s,id:p,children:d}});return f?m:null}),J=O;function fe(){let e=k.useContext(A);if(!e)throw Error(b(73));let t=e.useState(`toasts`);return k.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function pe(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||M(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}function Y(e=pe()){let t=null;function n(n){t!==null&&e.close(t);let r=e.add({title:n,timeout:2600,onClose:()=>{t===r&&(t=null)}});t=r}return{manager:e,notify:n}}var X=[`absolute bottom-0 right-0 z-[calc(1000-var(--toast-index))]`,`w-max select-none rounded-full bg-[var(--chrome-accent)] px-3.5 py-2 text-[13px] text-white`,`shadow-[0_8px_30px_rgba(0,0,0,0.22)] transition-all duration-300 ease-out`,`data-[starting-style]:translate-x-[110%] data-[starting-style]:opacity-0`,`data-[ending-style]:translate-x-[110%] data-[ending-style]:opacity-0`].join(` `);function Z(){let{toasts:e}=fe();return e.map(e=>(0,z.jsx)(K,{toast:e,className:X,swipeDirection:`right`,children:(0,z.jsx)(q,{})},e.id))}var Q=(0,k.createContext)(null);function me(e){let{controller:t,children:n}=e;return(0,z.jsx)(Q.Provider,{value:t,children:(0,z.jsxs)(B,{toastManager:t.manager,children:[n,(0,z.jsx)(J,{children:(0,z.jsx)(H,{"data-overlay":!0,"data-testid":`toast-viewport`,className:`fixed bottom-4 right-4 z-50`,children:(0,z.jsx)(Z,{})})})]})})}var he=()=>{};function $(){let e=(0,k.useContext)(Q);return{notify:e?e.notify:he}}export{Y as n,$ as r,me as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-2Zwg-L3c.js";import{Sr as t}from"./slides-D9bnXqtf.js";import{r as n}from"./frames-CRP8oPP8.js";import{t as r}from"./createReactComponent-9UsI5fmM.js";import{t as i}from"./IconAlertTriangle-CxPhYpe-.js";import{t as a}from"./IconEraser-DlZQe3-r.js";import{t as ee}from"./IconLink-ze4g4Lrj.js";import{t as o}from"./IconMinus-y4ejub-s.js";import{t as te}from"./IconMoodSmile-Bic_fw54.js";import{t as ne}from"./IconPencil-C5Y-Y4dC.js";import{t as s}from"./IconPhoto-CR36IK-b.js";import{t as c}from"./IconSearch-C1K0_Pq_.js";import{t as l}from"./IconSparkles-WDcg8BA9.js";import{C as u,b as d,c as f,f as p,g as m,h as re,p as ie,s as ae,v as oe,x as se,y as ce}from"./PopoverPopup-BqGWd_uB.js";import{t as le}from"./keys-DrjiT9FL.js";var h=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`}]]),ue=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`}]]),de=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`}]]),fe=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:f,tool:`arrow`},line:{label:`Line`,chord:`l`,icon:o,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:ne,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:s,tool:`image`},icon:{label:`Icons`,chord:`s`,icon:te,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 le(W[e].chord)}var Fe=Object.fromEntries(Object.values(W).flatMap(e=>e.tool?[[e.chord,e.tool]]:[])),K=[{kind:`simple`,icon:ie},{kind:`phone`,icon:A},{kind:`tablet`,icon:j},{kind:`browser`,icon:me},{kind:`window`,icon:fe},{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:d},{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:c},{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:h},{kind:`navbar`,label:`Navbar`,icon:ve},{kind:`tabs`,label:`Tabs`,icon:_e},{kind:`image`,label:`Image placeholder`,icon:s},{kind:`avatar`,label:`Avatar`,icon:Me},{kind:`heading`,label:`Heading`,icon:P},{kind:`paragraph`,label:`Paragraph`,icon:ue},{kind:`divider`,label:`Divider`,icon:De},{kind:`link`,label:`Link`,icon:ee},{kind:`textarea`,label:`Text area`,icon:u},{kind:`stepper`,label:`Number stepper`,icon:Ce},{kind:`badge`,label:`Badge`,icon:ke},{kind:`progress`,label:`Progress bar`,icon:ce},{kind:`breadcrumbs`,label:`Breadcrumbs`,icon:w},{kind:`pagination`,label:`Pagination`,icon:oe},{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:ae},{kind:`datepicker`,label:`Date picker`,icon:he},{kind:`sidebar`,label:`Sidebar`,icon:be},{kind:`scrollbar`,label:`Scrollbar`,icon:se},{kind:`segmented`,label:`Segmented control`,icon:R},{kind:`tabbar`,label:`Bottom tab bar`,icon:L},{kind:`statusbar`,label:`Status bar`,icon:de},{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)(re,{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:l,action:{kind:`ai`}},{id:`ai-diagram`,label:`Generate diagram with AI`,group:`AI`,keywords:`assistant architecture flowchart create`,icon:l,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:l,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:l,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:p,action:{kind:`control`,control:`entity`}},{id:`lifeline`,label:`Lifeline`,group:`Shapes`,keywords:`sequence uml participant`,icon:m,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`)],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===`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,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{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};
|
|
@@ -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{i as r,r as i}from"./config-D8b1QyEk.js";import{o as a}from"./editor-BeufBV54.js";import{n as o}from"./tool-catalog-DXPhX2S1.js";import{a as s,i as c,r as l,t as u}from"./PopoverPopup-B3Y0VRYc.js";import{n as d}from"./storage-CvDRYh5V.js";import{s as f}from"./chrome-C2RCq3SI.js";import{CommandList as p}from"./command-palette-BR-_ChOL.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};
|
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
import{o as e}from"./reflow-
|
|
1
|
+
import{o as e}from"./reflow-DaYiVkwp.js";import{an as t}from"./slides-D686obFO.js";import{t as n}from"./createReactComponent-C51FAx3B.js";import{i as r,t as i}from"./flow-start-CpAvU-9P.js";import{i as a,n as o}from"./core-CmsJyU_-.js";import{c as s,i as c,n as l,s as u}from"./flows-Cj7AFMIA.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 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{Dn as n,En as r,Mn as i,Nn as a,Q as o,Tn as s,U as c,_t as l,bt as u,gn as d,ht as f,jn as p,mn as m,vt as h,xt as g}from"./useScrollLock-CQpr0n6U.js";import{t as _}from"./jsx-runtime-DKdBMi_L.js";import{t as v}from"./useButton-CLQYGhRJ.js";import{n as y}from"./config-D8b1QyEk.js";import{t as b}from"./createReactComponent-C51FAx3B.js";import{n as x,t as ee}from"./useValueChanged-SqLfIDi5.js";import{n as S,r as C,t as te}from"./useControlled-BE8zdmih.js";import{a as w,c as ne,i as T,l as E,o as D,r as O,s as re}from"./billing-BSXr-z2r.js";import{t as ie}from"./IconLoader2-CzCTn-Sn.js";import{t as k}from"./IconPencil-D_pQsAyv.js";import{t as ae}from"./IconPhoto-5zuCDtnR.js";import{t as A}from"./IconSparkles-CnCp3BCQ.js";import{t as oe}from"./IconUsers-Dp85N225.js";import{t as j}from"./IconX-KrRqxr2j.js";import{t as M}from"./useBaseUiId-D2RfU0uY.js";import{n as N}from"./surface-Dke4SWpE.js";import{i as P,n as F,r as I,t as L}from"./DialogRoot-DUeVfNhS.js";import{n as se,t as R}from"./DialogTitle-D5au2NAn.js";import{t as z}from"./DialogDescription-Ddhk2rmF.js";import{n as B}from"./dialog-DnXgEbpz.js";var V=b(`outline`,`infinity`,`Infinity`,[[`path`,{d:`M9.828 9.172a4 4 0 1 0 0 5.656a10 10 0 0 0 2.172 -2.828a10 10 0 0 1 2.172 -2.828a4 4 0 1 1 0 5.656a10 10 0 0 1 -2.172 -2.828a10 10 0 0 0 -2.172 -2.828`,key:`svg-0`}]]),H=e(t(),1),U=H.createContext(void 0);function W(){let e=H.useContext(U);if(e===void 0)throw Error(p(63));return e}var G=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),K={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},q={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},J={disabled:!1,...q},ce={valid(e){return e===null?null:e?{[G.valid]:``}:{[G.invalid]:``}}},Y=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),le={...ce,checked(e){return e?{[Y.checked]:``}:{[Y.unchecked]:``}}},ue={invalid:void 0,name:void 0,validityData:{state:K,errors:[],error:``,value:``,initialValue:null},setValidityData:r,disabled:void 0,touched:q.touched,setTouched:r,dirty:q.dirty,setDirty:r,filled:q.filled,setFilled:r,focused:q.focused,setFocused:r,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:J,markedDirtyRef:{current:!1},registerFieldControl:r,validation:{getValidationProps:(e,t=s)=>t,inputRef:{current:null},registerInput:r,commit:async()=>{},change:r}},de=H.createContext(ue);function X(e=!0){let t=H.useContext(de);if(t.setValidityData===r&&!e)throw Error(p(28));return t}function fe(e,t,n,r,a=!0,o){let{registerFieldControl:s}=X(),c=H.useRef(null);c.current||=Symbol(),i(()=>{let i=c.current;if(!(!i||!a))return s(i,{controlRef:e,getValue:r,id:t,name:o,value:n}),()=>{s(i,void 0)}},[e,a,r,t,o,s,n])}var pe=H.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:r,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function me(){return H.useContext(pe)}var he=H.createContext({controlId:void 0,registerControlId:r,labelId:void 0,setLabelId:r,messageIds:[],setMessageIds:r,getDescriptionProps:e=>e});function ge(){return H.useContext(he)}function _e(e,t,n,r=!0,a){let[o,s]=H.useState(),c=M(a?`${a}-label`:void 0),l=e??t??o;return i(()=>{let i=e||t||!r?void 0:Z(n.current,c);o!==i&&s(i)}),l}function Z(e,t){let n=ve(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function ve(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function ye(e={}){let{id:t,implicit:o=!1,controlRef:s}=e,{controlId:c,registerControlId:l}=ge(),u=M(t),f=o?c:void 0,p=a(()=>Symbol(`labelable-control`)),m=H.useRef(!1),h=H.useRef(t!=null),g=n(()=>{!m.current||l===r||(m.current=!1,l(p.current,void 0))});return i(()=>{if(l===r)return;let e;if(o){let n=s?.current;e=d(n)&&n.closest(`label`)!=null?t??null:f??u}else if(t!=null)h.current=!0,e=t;else if(h.current)e=u;else{g();return}if(e===void 0){g();return}m.current=!0,l(p.current,e)},[t,s,f,l,o,u,p,g]),H.useEffect(()=>g,[g]),c??u}var Q=_(),be=H.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:a,"aria-labelledby":d,form:p,id:_,inputRef:y,name:b,nativeButton:x=!1,onCheckedChange:S,readOnly:C=!1,required:w=!1,disabled:ne=!1,render:T,uncheckedValue:E,value:D,style:O,...re}=e,{clearErrors:ie}=me(),{state:k,setTouched:ae,setDirty:A,validityData:oe,setFilled:j,setFocused:N,validationMode:P,disabled:F,name:I,validation:L}=X(),{labelId:se}=ge(),R=F||ne,z=I??b,B=H.useRef(null),V=h(B,y,L.inputRef),W=H.useRef(null),G=M(),K=ye({id:_,implicit:!1,controlRef:W}),q=x?void 0:K,[J,ce]=te({controlled:n,default:!!a,name:`Switch`,state:`checked`});fe(W,G,J,void 0,!R,b),i(()=>{B.current&&j(B.current.checked)},[B,j]),ee(J,()=>{ie(z),A(J!==oe.initialValue),j(J),L.change(J)});let{getButtonProps:Y,buttonRef:ue}=v({disabled:R,native:x}),de=_e(d,se,B,!x,q),pe={id:x?K:G,role:`switch`,"aria-checked":J,"aria-readonly":C||void 0,"aria-required":w||void 0,"aria-labelledby":de,onFocus(){R||N(!0)},onBlur(){let e=B.current;!e||R||(ae(!0),N(!1),P===`onBlur`&&L.commit(e.checked))},onClick(e){if(C||R)return;e.preventDefault();let t=B.current;t&&t.dispatchEvent(new(m(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},he=l({checked:J,disabled:R,form:p,id:q,name:z,required:w,style:z?g:u,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:V,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(C){e.preventDefault();return}let t=e.currentTarget.checked,n=c(o,e.nativeEvent);S?.(t,n),!n.isCanceled&&ce(t)},onFocus(){W.current?.focus()}},e=>L.getValidationProps(R,e),D===void 0?s:{value:D}),Z=H.useMemo(()=>({...k,checked:J,disabled:R,readOnly:C,required:w}),[k,J,R,C,w]),ve=f(`span`,e,{state:Z,ref:[t,W,ue],props:[pe,re,Y,e=>L.getValidationProps(R,e)],stateAttributesMapping:le});return(0,Q.jsxs)(U.Provider,{value:Z,children:[ve,!J&&z&&E!==void 0&&(0,Q.jsx)(`input`,{type:`hidden`,form:p,name:z,value:E,disabled:R}),(0,Q.jsx)(`input`,{...he,suppressHydrationWarning:!0})]})}),xe=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return f(`span`,e,{state:W(),ref:t,stateAttributesMapping:le,props:a})});function Se(e){let{testId:t,sellable:n,currentLabel:r,busy:i,busyLabel:a,ctaLabel:o,chargeLine:s,holdChargeLine:c,error:l,secondaryLabel:u,onSecondary:d,leadWithSecondary:f,onSubmit:p}=e,m=f&&u!=null&&d!=null;return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[m?(0,Q.jsx)(`button`,{type:`button`,onClick:d,"data-testid":`${t}-secondary`,className:`flex h-10 cursor-pointer items-center justify-center gap-2 rounded-xl bg-[var(--chrome-accent)] px-4 text-[14px] text-white outline-none transition-colors active:scale-[0.97] hover:bg-[var(--chrome-accent-hover)]`,children:u}):n?(0,Q.jsxs)(`button`,{type:`button`,onClick:p,disabled:i,"data-testid":`${t}-accept`,className:`flex h-10 cursor-pointer items-center justify-center gap-2 rounded-xl bg-[var(--chrome-accent)] px-4 text-[14px] text-white outline-none transition-colors active:scale-[0.97] hover:bg-[var(--chrome-accent-hover)] disabled:cursor-default disabled:opacity-60 disabled:active:scale-100`,children:[i&&(0,Q.jsx)(ie,{size:15,stroke:2.5,className:`animate-spin`}),i?a:o]}):(0,Q.jsx)(`button`,{type:`button`,disabled:!0,"data-testid":`${t}-current`,className:`flex h-10 items-center justify-center rounded-xl px-4 text-[13.5px] text-[var(--chrome-fg-400)] ring-1 ring-[var(--chrome-ring)]`,children:r}),(n||c)&&(0,Q.jsx)(`span`,{"data-testid":`${t}-charge`,className:`text-center text-[11.5px] text-[var(--chrome-fg-400)]`,children:n?s:`\xA0`}),l&&(0,Q.jsx)(`p`,{"data-testid":`${t}-error`,className:`text-[12px] text-[var(--chrome-danger)]`,children:l}),!m&&u&&d&&(0,Q.jsx)(`button`,{type:`button`,disabled:i,onClick:d,"data-testid":`${t}-secondary`,className:`cursor-pointer text-[12.5px] text-[var(--chrome-fg-500)] underline underline-offset-2 outline-none transition-colors hover:text-[var(--chrome-fg-800)] disabled:cursor-default disabled:opacity-60`,children:u})]})}var Ce=[`free`,`pro`];function $(e){return e===`lifetime`?`total`:`a month`}function we(e){return e==null?`Unlimited canvases`:`${e} canvas${e===1?``:`es`}`}function Te(e){return e==null?V:S}var Ee={free:`Everything you need to draw, diagram, and export.`,pro:`The full assistant, unlimited canvases, and your team.`};function De(e){return[{icon:A,title:`${e.messages.limit} AI credits ${$(e.messages.period)}`,detail:`One credit per assistant turn, to try it out.`},{icon:Te(e.canvasLimit),title:we(e.canvasLimit),detail:`Saved to your account and synced across devices.`},{icon:k,title:`Every drawing tool`,detail:`Shapes, connectors, diagrams, slides, and frames.`},{icon:C,title:`Export anywhere`,detail:`PNG, SVG, and PDF, with the fonts embedded.`}]}function Oe(e){let t=[{icon:A,title:`${e.messages.limit} AI credits ${$(e.messages.period)}`,detail:`Ask the assistant to draw, rewrite, and rearrange.`}];return e.images.limit>0&&t.push({icon:ae,title:`${e.images.limit} generated images ${$(e.images.period)}`,detail:`Drop generated art straight onto the canvas.`}),t.push({icon:Te(e.canvasLimit),title:we(e.canvasLimit),detail:`Keep every project, never clear one to start another.`}),e.folders&&t.push({icon:E,title:`Organize with folders`,detail:`Group client work, projects, and ideas.`}),t.push({icon:oe,title:`Invite your team`,detail:`Add seats at the same price per member.`}),t}function ke(e){return e===`free`?De(w.free):[{icon:x,title:`Everything in Free`,detail:`Every tool and export, unchanged.`},...Oe(w.pro)]}function Ae(){return[`${T.messages} AI credits and ${T.images} generated images`,`Pooled across the workspace, for everyone in it`,`Stacks on your allowance, spent only after it`,`Expires ${T.expiryDays} days after purchase`,`A one-time purchase, nothing renews`]}function je(e,t){return e===`pro`?t===`yearly`?`pro-yearly`:`pro-monthly`:null}var Me=Math.round(D.yearly.amountCents/D.monthly.amountCents),Ne=`flex w-full cursor-pointer items-center gap-3 rounded-lg px-3.5 py-3 text-left outline-none transition-colors disabled:cursor-default`;function Pe(e){let{choice:t,hidden:n,testId:r}=e;return(0,Q.jsxs)(`div`,{"data-testid":`${r}-detail-${t}`,className:`col-start-1 row-start-1 flex flex-col gap-4 ${n?`invisible max-sm:hidden`:``}`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[16px] text-[var(--chrome-fg-900)]`,children:[t===`pro`&&(0,Q.jsx)(A,{size:15,stroke:1.75,className:`text-[var(--chrome-fg-500)]`}),w[t].label]}),(0,Q.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-[var(--chrome-fg-500)]`,children:Ee[t]})]}),(0,Q.jsx)(`span`,{className:`text-[10.5px] uppercase tracking-wider text-[var(--chrome-fg-400)]`,children:`What's included`}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-3.5`,children:ke(t).map(e=>{let t=e.icon;return(0,Q.jsxs)(`li`,{className:`flex gap-2.5`,children:[(0,Q.jsx)(t,{size:16,stroke:1.75,className:`mt-0.5 shrink-0 text-[var(--chrome-fg-600)]`}),(0,Q.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`text-[13px] leading-snug text-[var(--chrome-fg-900)]`,children:e.title}),(0,Q.jsx)(`span`,{className:`text-[12px] leading-relaxed text-[var(--chrome-fg-500)]`,children:e.detail})]})]},e.title)})})]})}function Fe(e){let{choice:t,testId:n}=e;return(0,Q.jsx)(`div`,{className:`grid bg-[var(--chrome-rest)] p-7 ring-1 ring-[var(--chrome-ring)]`,children:Ce.map(e=>(0,Q.jsx)(Pe,{choice:e,hidden:e!==t,testId:n},e))})}function Ie(e){let{testId:t,selected:n,current:r,disabled:i,label:a,price:o,suffix:s,onSelect:c}=e;return(0,Q.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,disabled:i,"data-testid":t,onClick:c,className:`${Ne} ${n?`bg-[var(--chrome-rest)] ring-2 ring-[var(--chrome-fg-900)]`:`ring-1 ring-[var(--chrome-ring)] hover:bg-[var(--chrome-hover)]`}`,children:[(0,Q.jsx)(`span`,{className:`h-2.5 w-2.5 shrink-0 rounded-full ${n?`bg-[var(--chrome-fg-900)]`:`bg-[var(--chrome-fg-300)]`}`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-[14px] text-[var(--chrome-fg-900)]`,children:a}),r&&(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--chrome-active)] px-2 py-0.5 text-[11px] text-[var(--chrome-fg-800)]`,children:`Current`})]}),(0,Q.jsxs)(`span`,{className:`ml-auto shrink-0 text-[12px] text-[var(--chrome-fg-500)]`,children:[(0,Q.jsx)(`span`,{className:`text-[15px] tabular-nums text-[var(--chrome-fg-900)]`,children:o}),` `,s]})]})}function Le(e){let{open:t,onOpenChange:n,initialChoice:r,topUp:i,onCheckout:a,onPurchased:o}=e,[s,c]=(0,H.useState)(r),[l,u]=(0,H.useState)(`yearly`),[d,f]=(0,H.useState)(null),[p,m]=(0,H.useState)(null),[h,g]=(0,H.useState)(null),_=(0,H.useRef)(!1);(0,H.useEffect)(()=>{t&&(c(r),u(`yearly`),f(null),m(null),g(null),_.current=!1)},[t,r]);let v=i?`credits`:je(s,l);async function y(){if(!(!a||v==null||_.current)){_.current=!0,m(null),f(`opening`);try{await a(v,f)===`purchased`&&g(v)}catch(e){m(B(e,`We couldn't start your checkout. Please try again.`))}finally{_.current=!1,f(null)}}}function b(){let e=h;n(!1),e!=null&&o?.(e)}return{choice:s,setChoice:c,billingInterval:l,setBillingInterval:u,phase:d,busy:d!=null,error:p,done:h,submit:y,close:b}}function Re(e){let{testId:t,done:n,onContinue:r}=e;return(0,Q.jsxs)(`div`,{"data-testid":`${t}-success`,className:`flex flex-col items-start gap-4 p-8`,children:[(0,Q.jsx)(`span`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-[var(--chrome-accent)] text-white`,children:(0,Q.jsx)(x,{size:18,stroke:2.5})}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(R,{className:`text-[20px] leading-tight text-[var(--chrome-fg-900)]`,children:n===`credits`?`Credits added`:`You're on ${w.pro.label}`}),(0,Q.jsx)(z,{className:`text-[13.5px] leading-relaxed text-[var(--chrome-fg-500)]`,children:n===`credits`?`${T.messages} AI credits and ${T.images} images are on your account.`:`Everything is unlocked: ${w.pro.messages.limit} AI credits a month, unlimited canvases, folders, and your team.`})]}),(0,Q.jsx)(`button`,{type:`button`,onClick:r,"data-testid":`${t}-continue`,className:`mt-1 flex h-10 cursor-pointer items-center justify-center rounded-xl bg-[var(--chrome-accent)] px-5 text-[14px] text-white outline-none transition-colors active:scale-[0.97] hover:bg-[var(--chrome-accent-hover)]`,children:`Continue`})]})}function ze(e){let{testId:t,reassurance:n,packPrice:r,canSell:i,footer:a}=e;return(0,Q.jsxs)(`div`,{"data-testid":`${t}-topup`,className:`flex flex-col gap-5 p-8`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 pr-8`,children:[(0,Q.jsx)(`span`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-[var(--chrome-rest)] text-[var(--chrome-fg-700)] ring-1 ring-[var(--chrome-ring)]`,children:(0,Q.jsx)(A,{size:18,stroke:1.75})}),(0,Q.jsx)(R,{className:`text-[20px] leading-tight text-[var(--chrome-fg-900)]`,children:`Top up your credits`}),(0,Q.jsx)(z,{className:`text-[13.5px] leading-relaxed text-[var(--chrome-fg-500)]`,children:`You're on ${w.pro.label}, the highest plan, so there's nothing to upgrade. A one-time pack keeps you going now, and your allowance still renews as usual.`})]}),n&&(0,Q.jsx)(`p`,{"data-testid":`${t}-reassurance`,className:`rounded-lg bg-[var(--chrome-rest)] px-3.5 py-2.5 text-[12.5px] leading-relaxed text-[var(--chrome-fg-700)] ring-1 ring-[var(--chrome-ring)]`,children:n}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl bg-[var(--chrome-rest)] p-4 ring-1 ring-[var(--chrome-ring)]`,children:[(0,Q.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,Q.jsx)(`span`,{className:`text-[15px] text-[var(--chrome-fg-900)]`,children:`Credit pack`}),(0,Q.jsxs)(`span`,{className:`text-[12px] text-[var(--chrome-fg-500)]`,children:[(0,Q.jsx)(`span`,{className:`text-[18px] tabular-nums text-[var(--chrome-fg-900)]`,children:r}),` `,`one-time`]})]}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:Ae().map(e=>(0,Q.jsxs)(`li`,{className:`flex items-start gap-2 text-[13px] leading-snug text-[var(--chrome-fg-700)]`,children:[(0,Q.jsx)(x,{size:14,stroke:2,className:`mt-0.5 shrink-0 text-[var(--chrome-fg-500)]`}),e]},e))})]}),(0,Q.jsx)(Se,{...a,sellable:i,currentLabel:`You're on ${w.pro.label}`,holdChargeLine:!1})]})}function Be(e){let{testId:t,title:n,description:r,reassurance:i,currentPlan:a,choice:o,onChoose:s,billingInterval:c,setBillingInterval:l,busy:u,canSell:d,footer:f}=e,p=c===`yearly`,m=o===a,h=O(ne().cents,`usd`),g=O(D.monthly.amountCents,`usd`),_=O(re(),`usd`),v=p?_:g,y=m?`Your current plan`:`Upgrade unavailable`;return(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 overflow-y-auto sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5 p-7`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 pr-8`,children:[(0,Q.jsx)(R,{className:`text-[20px] leading-tight text-[var(--chrome-fg-900)]`,children:n}),(0,Q.jsx)(z,{className:`text-[13.5px] leading-relaxed text-[var(--chrome-fg-500)]`,children:r})]}),i&&(0,Q.jsx)(`p`,{"data-testid":`${t}-reassurance`,className:`rounded-lg bg-[var(--chrome-rest)] px-3.5 py-2.5 text-[12.5px] leading-relaxed text-[var(--chrome-fg-700)] ring-1 ring-[var(--chrome-ring)]`,children:i}),(0,Q.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Choose a plan`,className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Ie,{testId:`upgrade-choice-free`,selected:o===`free`,current:a===`free`,disabled:u,label:w.free.label,price:O(0,`usd`),suffix:`/ month`,onSelect:()=>s(`free`)}),(0,Q.jsx)(Ie,{testId:`upgrade-choice-pro`,selected:o===`pro`,current:!1,disabled:u,label:w.pro.label,price:v,suffix:`/ month`,onSelect:()=>s(`pro`)})]}),(0,Q.jsxs)(`div`,{className:`mt-auto flex flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{"data-testid":`${t}-yearly-box`,className:`mt-8 flex flex-col gap-1.5 rounded-lg border border-dashed border-[var(--chrome-ring)] px-3.5 py-3 ${o===`pro`?``:`invisible max-sm:hidden`}`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`label`,{htmlFor:`${t}-yearly`,className:`cursor-pointer text-[13.5px] text-[var(--chrome-fg-900)]`,children:[`Save `,h,` with yearly billing`]}),(0,Q.jsx)(be,{id:`${t}-yearly`,checked:p,disabled:u,onCheckedChange:e=>l(e?`yearly`:`monthly`),"data-testid":`billing-interval-yearly`,className:`relative h-[22px] w-[38px] shrink-0 cursor-pointer rounded-full outline-none transition-colors disabled:cursor-default disabled:opacity-60 ${p?`bg-[var(--chrome-accent)]`:`bg-[var(--chrome-fg-400)]`}`,children:(0,Q.jsx)(xe,{className:`absolute left-[2px] top-[2px] block h-[18px] w-[18px] rounded-full bg-white shadow-sm transition-transform data-[checked]:translate-x-[16px]`})})]}),(0,Q.jsx)(`span`,{className:`text-[12.5px] leading-relaxed text-[var(--chrome-fg-500)]`,children:`Pay for ${Me} months, get 12. That's ${_}/month instead of ${g}/month.`})]}),(0,Q.jsx)(Se,{...f,sellable:!m&&d,currentLabel:y,holdChargeLine:!0})]})]}),(0,Q.jsx)(Fe,{choice:o,testId:t})]})}function Ve(e){let{open:t,onOpenChange:n,currentPlan:r,title:i,description:a,reassurance:o,onCheckout:s,onPurchased:c,secondaryLabel:l,onSecondary:u,testId:d=`upgrade-dialog`}=e,f=r===`pro`,p=Le({open:t,onOpenChange:n,initialChoice:e.initialChoice??`pro`,topUp:f,onCheckout:s,onPurchased:c}),{busy:m,close:h}=p,g=O(T.price*100,`usd`),_=f?`${g} billed once. No subscription.`:p.billingInterval===`yearly`?`${O(D.yearly.amountCents,`usd`)} billed today, then every year. Cancel anytime.`:`${O(D.monthly.amountCents,`usd`)} billed today, then every month. Cancel anytime.`,v=p.phase===`settling`?`Finishing up…`:p.phase===`checkout`?`Complete your payment…`:`Opening…`,y=u&&(()=>{h(),u()}),b={testId:d,busy:m,busyLabel:v,ctaLabel:f?`Buy credit pack`:`Upgrade to Pro`,chargeLine:_,error:p.error,secondaryLabel:l,onSecondary:y,leadWithSecondary:s==null,onSubmit:()=>void p.submit()};return(0,Q.jsx)(L,{open:t,onOpenChange:e=>{if(!(m&&!e)){if(e){n(!0);return}h()}},children:(0,Q.jsxs)(F,{children:[(0,Q.jsx)(P,{className:N.dialogBackdrop}),(0,Q.jsxs)(I,{"data-overlay":!0,"data-testid":d,className:`flex max-h-[92vh] flex-col overflow-hidden ${p.done||f?`w-[min(440px,92vw)]`:`w-[min(780px,94vw)]`} ${N.dialogPopup}`,children:[(0,Q.jsx)(se,{"aria-label":`Close`,disabled:m,className:`absolute right-3 top-3 z-10 flex h-7 w-7 items-center justify-center rounded-md text-[var(--chrome-fg-400)] outline-none transition-colors hover:bg-[var(--chrome-divider)] hover:text-[var(--chrome-fg-600)] disabled:opacity-40 disabled:hover:bg-transparent`,children:(0,Q.jsx)(j,{size:16,stroke:1.75})}),p.done?(0,Q.jsx)(Re,{testId:d,done:p.done,onContinue:h}):f?(0,Q.jsx)(ze,{testId:d,reassurance:o,packPrice:g,canSell:s!=null,footer:b}):(0,Q.jsx)(Be,{testId:d,title:i,description:a,reassurance:o,currentPlan:r,choice:p.choice,onChoose:p.setChoice,billingInterval:p.billingInterval,setBillingInterval:p.setBillingInterval,busy:m,canSell:s!=null,footer:b})]})]})})}function He(e){let{open:t,onOpenChange:n,currentPlan:r,reassurance:i,onPurchased:a,secondaryLabel:o,onSecondary:s,testId:c}=e,{state:l,startCheckout:u}=y(),d=l.status===`authenticated`&&l.canManageBilling===!1,f=l.status===`authenticated`&&l.canManageBilling!==!1;return(0,Q.jsx)(Ve,{open:t,onOpenChange:n,currentPlan:r,title:e.title??`Get more from the assistant`,description:e.description??`Move to Pro for a monthly credit allowance, image generation, and unlimited canvases.`,reassurance:i??(d?`Only an owner of this workspace can change its plan or buy credits. Ask an owner to upgrade it.`:void 0),onCheckout:f?u:void 0,onPurchased:a,secondaryLabel:o,onSecondary:s,testId:c??`upgrade-dialog`})}export{He as UpgradeDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./createReactComponent-C51FAx3B.js";var r=n(`outline`,`row-insert-bottom`,`RowInsertBottom`,[[`path`,{d:`M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1`,key:`svg-0`}],[`path`,{d:`M12 15l0 4`,key:`svg-1`}],[`path`,{d:`M14 17l-4 0`,key:`svg-2`}]]),i=n(`outline`,`row-insert-top`,`RowInsertTop`,[[`path`,{d:`M4 18v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1`,key:`svg-0`}],[`path`,{d:`M12 9v-4`,key:`svg-1`}],[`path`,{d:`M10 7l4 0`,key:`svg-2`}]]),a=e(t(),1),o=5,s=48,c=16;function l(e,t,n){let r=e[0]-e[t],i=e[e.length-1]-e[t];return Math.max(r,Math.min(i,n))}function u(e,t,n){let r=e[t]+n;if(r<=e[0])return 0;for(let t=0;t<e.length;t+=1)if(r<e[t])return t;return e.length}function d(e,t){return e.gap===null?0:t<e.index&&e.gap<=t?e.lift:t>e.index&&e.gap>t?-e.lift:0}function f(e){let{count:t,gap:n,disabled:r,onReorder:i,onPress:f,canDrag:p}=e,[m,h]=(0,a.useState)(null),g=(0,a.useRef)(null),_=(0,a.useRef)([]),v=(0,a.useRef)(0);(0,a.useEffect)(()=>{if(!m?.dragging)return;let e=0,t=()=>{e=requestAnimationFrame(t);let n=g.current;if(!n)return;let r=n.getBoundingClientRect(),i=v.current,a=0;if(i<r.top+s?a=-Math.min(c,Math.ceil((r.top+s-i)/4)):i>r.bottom-s&&(a=Math.min(c,Math.ceil((i-(r.bottom-s))/4))),a===0)return;let o=n.scrollTop;n.scrollTop=o+a,n.scrollTop!==o&&h(e=>{if(!e?.dragging)return e;let t=v.current-e.startY+(n.scrollTop-e.startScroll),r=l(e.homes,e.index,t);return{...e,dy:r,gap:u(e.homes,e.index,r)}})};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[m?.dragging]);let y=(0,a.useCallback)(e=>t=>{_.current[e]=t},[]);function b(e,r){if(e.button!==0||p?.(r)===!1)return;let i=g.current;if(!i)return;e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),v.current=e.clientY;let a=i.getBoundingClientRect().top-i.scrollTop,o=_.current.slice(0,t).map(e=>{if(!e)return 1/0;let t=e.getBoundingClientRect();return t.top-a+t.height/2}),s=_.current[r]?.getBoundingClientRect().height??0;h({index:r,startY:e.clientY,startScroll:i.scrollTop,dy:0,dragging:!1,gap:null,homes:o,lift:s+n})}function x(e){if(!m)return;v.current=e.clientY;let t=g.current?.scrollTop??m.startScroll,n=e.clientY-m.startY+(t-m.startScroll),i=!r&&(m.dragging||Math.abs(n)>o),a=l(m.homes,m.index,n);h({...m,dy:a,dragging:i,gap:i?u(m.homes,m.index,a):null})}function S(e){if(!m)return;let{index:t,dragging:n,gap:r}=m;if(h(null),!n){f?.(t);return}if(r===null)return;let a=r>t?r-1:r;a!==t&&(e.stopPropagation(),i(t,a))}function C(e){return{onPointerDown:t=>b(t,e),onPointerMove:x,onPointerUp:S,onPointerCancel:()=>h(null)}}function w(e){if(m?.dragging&&m.index===e)return{transform:`translateY(${m.dy}px)`,zIndex:10,opacity:.7};if(m?.dragging)return{transform:`translateY(${d(m,e)}px)`,transition:`transform 150ms ease`}}return{listRef:g,setItemRef:y,rowHandlers:C,rowStyle:w,dragging:!!m?.dragging,cancel:()=>h(null)}}export{i as n,r,f as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/export-Bce6ra0N.js","assets/slides-D686obFO.js","assets/style-BENGW2ZV.js","assets/preload-helper-Czpn1I53.js","assets/blob-CTPsKWYv.js","assets/theme-palette-Dl_G_VIJ.js","assets/clipboard-CO7YHov7.js","assets/export-K2VWg76n.js","assets/registry-rEGZW7Ab.js","assets/text-breaks-DM4W6y5f.js","assets/icon-sources-CZI1h18s.js","assets/chart-4iRduYdU.js","assets/frames-Cp1QD3LR.js","assets/connector-labels-CrEgadsC.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-BeufBV54.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-Bce6ra0N.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]));function d(e){return s(u).then(t=>t.createBrowserExport(e))}function f(e){return e===`copyPng`||e===`copySvg`}function p(e){return e===0?null:e===1?`One shape made in a newer version of Koboyo is not in this export. It is still saved on the canvas.`:`${e} shapes made in a newer version of Koboyo are not in this export. They are still saved on the canvas.`}function m(e,t){let n=p(t);if(!f(e))return n;let r=e===`copyPng`?`Copied as PNG`:`Copied as SVG`;return n?`${r}. ${n}`:r}function h(e){return f(e)?`Couldn't copy, try again`:`Couldn't export, try again`}function g(e){return f(e)?`Nothing to copy yet`:`Nothing to export yet`}function _(){let e=i(),t=r(),o=a(),{notify:s}=n();return(0,l.useCallback)((n,r,i)=>{if(r.length===0)return s(g(n)),Promise.resolve(!1);let a=e.getState().opaqueShapes.length,l={measurement:t.measurement,...i?.options};return d(o).then(e=>n===`copyPng`||n===`copySvg`?e[n](r,l):n===`downloadPdf`?e.downloadSlidesPdf(r,l,i?.filename):e[n](r,l,i?.filename)).then(()=>{let e=m(n,a);return e&&s(e),!0}).catch(t=>t instanceof c&&t.image?(e.getState().setImageToCopy(t.image),!0):(s(h(n)),!1))},[e,t,o,s])}export{_ as t};
|
|
Binary file
|
|
@@ -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"./icons-DzW1j-r3.js";import{a as i,r as a}from"./asset-glyph-C1E6cGwM.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{_ as n}from"./selection-overlay-primitives-BRp854AD.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{t as n}from"./storage-CvDRYh5V.js";var r=e(t(),1);function i(e,t,n,r){let i=r(t);return[t,...e.filter(e=>r(e)!==i)].slice(0,n)}function a(e,t){let r=n.getJSON(e,[]);return t(Array.isArray(r)?r:[])}function o(e,t,o){let s=o?.keyOf??(e=>String(e)),c=o?.sanitize??(e=>e),[l,u]=(0,r.useState)(()=>a(e,c));function d(r){let a=i(l,r,t,s);u(a),n.setJSON(e,a)}return{recent:l,remember:d}}export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{Mn as n,in as r,jn as i,t as a}from"./useScrollLock-CQpr0n6U.js";var o=e(t(),1),s=o.createContext(void 0);function c(e){let t=o.useContext(s);if(t===void 0&&!e)throw Error(i(69));return t}var l=20;function u(e,t,i,s){let[c,u]=o.useState(!1);n(()=>{if(!e||!t||i==null){u(!1);return}let n=r(i).documentElement.clientWidth,a=i.offsetWidth;u(n>0&&a>0&&a>=n-l)},[e,t,i]),a(e&&(!t||c),s)}export{c as n,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{it as e}from"./useScrollLock-CQpr0n6U.js";function t(t){return e(t,`base-ui`)}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{Dn as n,Mn as r,_n as i,_t as a,gt as o,jn as s}from"./useScrollLock-CQpr0n6U.js";var c=e(t(),1),l=c.createContext(void 0);function u(e=!1){let t=c.useContext(l);if(t===void 0&&!e)throw Error(s(16));return t}function d(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:c.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function f(e={}){let{disabled:t=!1,focusableWhenDisabled:i,tabIndex:s=0,native:l=!0,composite:f}=e,h=c.useRef(null),g=u(!0),_=f??g!==void 0,{props:v}=d({focusableWhenDisabled:i,disabled:t,composite:_,tabIndex:s,isNativeButton:l}),y=c.useCallback(()=>{let e=h.current;p(e)&&_&&t&&v.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,v.disabled,_]);return r(y,[y]),{getButtonProps:c.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:i,onKeyDown:s,onPointerDown:c,...u}=e;return a({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(o(e),s?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,i=e.currentTarget,a=p(i),c=!l&&m(i),u=r&&(l?a:!c),d=e.key===`Enter`,f=e.key===` `,h=i.getAttribute(`role`),g=h?.startsWith(`menuitem`)||h===`option`||h===`gridcell`;if(r&&_&&f){if(e.defaultPrevented&&g)return;e.preventDefault(),c||l&&a?(i.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!l&&(f||d)&&e.preventDefault(),!l&&d&&n?.(e))},onKeyUp(e){if(!t){if(o(e),i?.(e),e.target===e.currentTarget&&l&&_&&p(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!l&&!_&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}c?.(e)}},l?{type:`button`}:{role:`button`},v,u)},[t,v,_,l]),buttonRef:n(e=>{h.current=e,y()})}}function p(e){return i(e)&&e.tagName===`BUTTON`}function m(e){return!!(e?.tagName===`A`&&e?.href)}export{u as n,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./createReactComponent-C51FAx3B.js";var r=n(`outline`,`download`,`Download`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 11l5 5l5 -5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),i=n(`outline`,`layout-grid`,`LayoutGrid`,[[`path`,{d:`M4 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-0`}],[`path`,{d:`M14 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-1`}],[`path`,{d:`M4 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-2`}],[`path`,{d:`M14 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-3`}]]),a=e(t(),1);function o({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=a.useRef(e!==void 0),[o,s]=a.useState(t);return[i?e:o,a.useCallback(e=>{i||s(e)},[])]}export{i as n,r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{Dn as n,F as r,Fn as i,Gt as a,H as o,I as s,It as c,Mn as l,Mt as u,Nn as d,O as f,Pn as p,Rt as m,Sn as h,Tn as g,U as _,Wt as v,_n as y,an as b,bn as x,cn as S,dn as C,en as w,f as T,fn as E,gn as D,hn as O,ht as k,in as A,it as j,ln as M,mn as N,nt as P,o as ee,on as F,pn as I,rn as te,sn as ne,st as L,tn as re,un as ie,vn as ae,xn as oe,yn as R,zt as z}from"./useScrollLock-CQpr0n6U.js";var B=e(t(),1),se=[`top`,`right`,`bottom`,`left`],V=Math.min,H=Math.max,ce=Math.round,U=Math.floor,W=e=>({x:e,y:e}),le={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ue(e,t,n){return H(e,V(t,n))}function G(e,t){return typeof e==`function`?e(t):e}function K(e){return e.split(`-`)[0]}function q(e){return e.split(`-`)[1]}function de(e){return e===`x`?`y`:`x`}function J(e){return e===`y`?`height`:`width`}function Y(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function X(e){return de(Y(e))}function fe(e,t,n){n===void 0&&(n=!1);let r=q(e),i=X(e),a=J(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ye(o)),[o,ye(o)]}function pe(e){let t=ye(e);return[Z(e),t,Z(t)]}function Z(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var me=[`left`,`right`],he=[`right`,`left`],ge=[`top`,`bottom`],Q=[`bottom`,`top`];function _e(e,t,n){switch(e){case`top`:case`bottom`:return n?t?he:me:t?me:he;case`left`:case`right`:return t?ge:Q;default:return[]}}function ve(e,t,n,r){let i=q(e),a=_e(K(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Z)))),a}function ye(e){let t=K(e);return le[t]+e.slice(t.length)}function be(e){return{top:0,right:0,bottom:0,left:0,...e}}function xe(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:be(e)}function $(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var Se=e(i(),1);function Ce(e,t){return t!=null&&!u(t)?0:typeof e==`function`?e():e}function we(e,t,n){let r=Ce(e,n);return typeof r==`number`?r:r?.[t]}function Te(e){return typeof e==`function`?e():e}function Ee(e,t){return t||e===`click`||e===`mousedown`}function De(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Oe(e,t,n){let{reference:r,floating:i}=e,a=Y(t),o=X(t),s=J(o),c=K(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(q(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function ke(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=G(t,e),p=xe(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=$(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=$(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ae=50,je=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ke},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Oe(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ae&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Oe(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Me=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=G(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=K(r),_=Y(o),v=K(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ye(o)]:pe(o)),x=p!==`none`;!d&&x&&b.push(...ve(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=fe(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Y(t))||T.every(e=>Y(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Y(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ne(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Pe(e){return se.some(t=>e[t]>=0)}var Fe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=G(e,t);switch(i){case`referenceHidden`:{let e=Ne(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Pe(e)}}}case`escaped`:{let e=Ne(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Pe(e)}}}default:return{}}}}},Ie=new Set([`left`,`top`]);async function Le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=K(n),s=q(n),c=Y(n)===`y`,l=Ie.has(o)?-1:1,u=a&&c?-1:1,d=G(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Re=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Le(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ze=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=G(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Y(K(i)),p=de(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=ue(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=ue(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Be=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=G(e,t),u={x:n,y:r},d=Y(i),f=de(d),p=u[f],m=u[d],h=G(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ie.has(K(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ve=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=G(e,t),u=await o.detectOverflow(t,l),d=K(i),f=q(i),p=Y(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=V(h-u[g],v),x=V(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=H(u.left,0),t=H(u.right,0),n=H(u.top,0),r=H(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:H(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:H(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function He(e){let t=F(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=y(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ce(n)!==a||ce(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ue(e){return D(e)?e:e.contextElement}function We(e){let t=Ue(e);if(!y(t))return W(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=He(t),o=(a?ce(n.width):n.width)/r,s=(a?ce(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ge=W(0);function Ke(e){let t=N(e);return!h()||!t.visualViewport?Ge:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==N(e)?!1:t}function Je(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ue(e),o=W(1);t&&(r?D(r)&&(o=We(r)):o=We(e));let s=qe(a,n,r)?Ke(a):W(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=N(a),t=r&&D(r)?N(r):r,n=e,i=M(n);for(;i&&r&&t!==n;){let e=We(i),t=i.getBoundingClientRect(),r=F(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=N(i),i=M(n)}}return $({width:u,height:d,x:c,y:l})}function Ye(e,t){let n=C(e).scrollLeft;return t?t.left+n:Je(S(e)).left+n}function Xe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ye(e,n),y:n.top+t.scrollTop}}function Ze(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=S(r),s=t?oe(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=W(1),u=W(0),d=y(r);if((d||!d&&!a)&&((ie(r)!==`body`||R(o))&&(c=C(r)),d)){let e=Je(r);l=We(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Xe(o,c):W(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Qe(e){return Array.from(e.getClientRects())}function $e(e){let t=S(e),n=C(e),r=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=H(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ye(e),s=-n.scrollTop;return F(r).direction===`rtl`&&(o+=H(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var et=25;function tt(e,t){let n=N(e),r=S(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=h();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ye(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=et&&(a-=o)}else l<=et&&(a+=l);return{width:a,height:o,x:s,y:c}}function nt(e,t){let n=Je(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=y(e)?We(e):W(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function rt(e,t,n){let r;if(t===`viewport`)r=tt(e,n);else if(t===`document`)r=$e(S(e));else if(D(t))r=nt(t,n);else{let n=Ke(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $(r)}function it(e,t){let n=I(e);return n===t||!D(n)||ae(n)?!1:F(n).position===`fixed`||it(n,t)}function at(e,t){let n=t.get(e);if(n)return n;let r=E(e,[],!1).filter(e=>D(e)&&ie(e)!==`body`),i=null,a=F(e).position===`fixed`,o=a?I(e):e;for(;D(o)&&!ae(o);){let t=F(o),n=O(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||R(o)&&!n&&it(e,o))?r=r.filter(e=>e!==o):i=t,o=I(o)}return t.set(e,r),r}function ot(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?oe(t)?[]:at(t,this._c):[].concat(n),r],o=rt(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=rt(t,a[e],i);s=H(n.top,s),c=V(n.right,c),l=V(n.bottom,l),u=H(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function st(e){let{width:t,height:n}=He(e);return{width:t,height:n}}function ct(e,t,n){let r=y(t),i=S(t),a=n===`fixed`,o=Je(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=W(0);function l(){c.x=Ye(i)}if(r||!r&&!a)if((ie(t)!==`body`||R(i))&&(s=C(t)),r){let e=Je(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Xe(i,s):W(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function lt(e){return F(e).position===`static`}function ut(e,t){if(!y(e)||F(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return S(e)===n&&(n=n.ownerDocument.body),n}function dt(e,t){let n=N(e);if(oe(e))return n;if(!y(e)){let t=I(e);for(;t&&!ae(t);){if(D(t)&&!lt(t))return t;t=I(t)}return n}let r=ut(e,t);for(;r&&x(r)&<(r);)r=ut(r,t);return r&&ae(r)&<(r)&&!O(r)?n:r||ne(e)||n}var ft=async function(e){let t=this.getOffsetParent||dt,n=this.getDimensions,r=await n(e.floating);return{reference:ct(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pt(e){return F(e).direction===`rtl`}var mt={convertOffsetParentRelativeRectToViewportRelativeRect:Ze,getDocumentElement:S,getClippingRect:ot,getOffsetParent:dt,getElementRects:ft,getClientRects:Qe,getDimensions:st,getScale:We,isElement:D,isRTL:pt};function ht(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gt(e,t){let n=null,r,i=S(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=U(d),h=U(i.clientWidth-(u+f)),g=U(i.clientHeight-(d+p)),_=U(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:H(0,V(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!ht(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function _t(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ue(e),u=i||a?[...l?E(l):[],...t?E(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?gt(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Je(e):null;c&&g();function g(){let t=Je(e);h&&!ht(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var vt=Re,yt=ze,bt=Me,xt=Ve,St=Fe,Ct=Be,wt=(e,t,n)=>{let r=new Map,i={platform:mt,...n},a={...i.platform,_c:r};return je(e,t,{...i,platform:a})},Tt=typeof document<`u`?B.useLayoutEffect:function(){};function Et(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Et(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Et(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Dt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ot(e,t){let n=Dt(e);return Math.round(t*n)/n}function kt(e){let t=B.useRef(e);return Tt(()=>{t.current=e}),t}function At(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=B.useState(r);Et(f,r)||p(r);let[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=B.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=B.useRef(null),C=B.useRef(null),w=B.useRef(u),T=c!=null,E=kt(c),D=kt(i),O=kt(l),k=B.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),wt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Et(w.current,t)&&(w.current=t,Se.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Tt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=B.useRef(!1);Tt(()=>(A.current=!0,()=>{A.current=!1}),[]),Tt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=B.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=B.useMemo(()=>({reference:b,floating:x}),[b,x]),N=B.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Ot(M.floating,u.x),r=Ot(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Dt(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return B.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var jt=(e,t)=>{let n=vt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mt=(e,t)=>{let n=yt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nt=(e,t)=>({fn:Ct(e).fn,options:[e,t]}),Pt=(e,t)=>{let n=bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ft=(e,t)=>{let n=xt(e);return{name:n.name,fn:n.fn,options:[e,t]}},It=(e,t)=>{let n=St(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Lt(e){let{open:t=!1,onOpenChange:n,elements:i={}}=e,a=j(),o=r()!=null,s=d(()=>new f({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new T,floatingId:a,syncOnly:!1,nested:o})).current;return l(()=>{let e={open:t,floatingId:a};i.reference!==void 0&&(e.referenceElement=i.reference,e.domReferenceElement=D(i.reference)?i.reference:null),i.floating!==void 0&&(e.floatingElement=i.floating),s.update(e)},[t,a,i.reference,i.floating,s]),s.context.onOpenChange=n,s.context.nested=o,s}function Rt(e={}){let{nodeId:t,externalTree:n}=e,r=Lt(e),i=e.rootContext||r,a=i.useState(`referenceElement`),o=i.useState(`floatingElement`),c=i.useState(`domReferenceElement`),u=i.useState(`open`),d=i.useState(`floatingId`),[f,p]=B.useState(null),[m,h]=B.useState(void 0),[g,_]=B.useState(void 0),v=B.useRef(null),y=s(n),b=B.useMemo(()=>({reference:a,floating:o,domReference:c}),[a,o,c]),x=At({...e,elements:{...b,...f&&{reference:f}}}),S=D(m)?m:null,C=g===void 0?i.state.floatingElement:g;i.useSyncedValue(`referenceElement`,m??null),i.useSyncedValue(`domReferenceElement`,m===void 0?c:S),i.useSyncedValue(`floatingElement`,C);let w=B.useCallback(e=>{let t=D(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;p(t),x.refs.setReference(t)},[x.refs]),T=B.useCallback(e=>{(D(e)||e===null)&&(v.current=e,h(e)),(D(x.refs.reference.current)||x.refs.reference.current===null||e!==null&&!D(e))&&x.refs.setReference(e)},[x.refs,h]),E=B.useCallback(e=>{_(e),x.refs.setFloating(e)},[x.refs]),O=B.useMemo(()=>({...x.refs,setReference:T,setFloating:E,setPositionReference:w,domReference:v}),[x.refs,T,E,w]),k=B.useMemo(()=>({...x.elements,domReference:c}),[x.elements,c]),A=B.useMemo(()=>({...x,dataRef:i.context.dataRef,open:u,onOpenChange:i.setOpen,events:i.context.events,floatingId:d,refs:O,elements:k,nodeId:t,rootStore:i}),[x,O,k,t,i,u,d]);return l(()=>{c&&(v.current=c)},[c]),l(()=>{i.context.dataRef.current.floatingContext=A;let e=y?.nodesRef.current.find(e=>e.id===t);e&&(e.context=A)}),B.useMemo(()=>({...x,context:A,refs:O,elements:k,rootStore:i}),[x,O,k,A,i])}var zt=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new w,this.restTimeout=new w,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Bt=new WeakMap;function Vt(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Bt.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Bt.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Ht(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Bt.get(n);a&&a!==e&&Vt(a),Vt(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Bt.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Ut(e){let t=e.context.dataRef.current,n=d(()=>t.hoverInteractionState??zt.create()).current;return t.hoverInteractionState||=n,p(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Wt(e,t={}){let{enabled:i=!0,closeDelay:o=0,nodeId:u}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=d.useState(`floatingElement`),h=d.useState(`domReferenceElement`),{dataRef:g}=d.context,y=s(),x=r(),S=Ut(d),C=re(),w=n(()=>Ee(g.current.openEvent?.type,S.interactedInside)),T=n(()=>De(g.current.openEvent?.type)),E=n(()=>{Vt(S)});l(()=>{f||(S.pointerType=void 0,S.restTimeoutPending=!1,S.interactedInside=!1,E())},[f,S,E]),B.useEffect(()=>E,[E]),l(()=>{if(i&&f&&S.handleCloseOptions?.blockPointerEvents&&T()&&D(h)&&p){let e=h,t=p,n=A(p),r=y?.nodesRef.current.find(e=>e.id===x)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=S.pointerEventsScopeElement===t?null:S.pointerEventsScopeElement,a=r===t?null:r,o=S.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return Ht(S,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{E()}}},[i,f,h,p,S,T,y,x,E]),B.useEffect(()=>{if(!i)return;function e(){return!!(y&&x&&c(y.nodesRef.current,x).length>0)}function t(e){let t=we(o,`close`,S.pointerType),n=()=>{d.setOpen(!1,_(P,e)),y?.events.emit(`floating.closed`,e)};t?S.openChangeTimeout.start(t,n):(S.openChangeTimeout.clear(),n())}function n(e){let t=a(e);if(!m(t)){S.interactedInside=!1;return}S.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function r(){S.openChangeTimeout.clear(),C.clear(),y?.events.off(`floating.closed`,l),E()}function s(n){if(e()&&y){y.events.on(`floating.closed`,l);return}if(z(n.relatedTarget,d.context.triggerElements))return;let r=g.current.floatingContext?.nodeId??u,i=n.relatedTarget;if(!(y&&r&&D(i)&&c(y.nodesRef.current,r,!1).some(e=>v(e.context?.elements.floating,i)))){if(S.handler){S.handler(n);return}E(),T()&&!w()&&t(n)}}function l(t){!y||!x||e()||C.start(0,()=>{y.events.off(`floating.closed`,l),d.setOpen(!1,_(P,t)),y.events.emit(`floating.closed`,t)})}let f=p;return b(f&&te(f,`mouseenter`,r),f&&te(f,`mouseleave`,s),f&&te(f,`pointerdown`,n,!0),()=>{y?.events.off(`floating.closed`,l)})},[i,p,d,g,o,u,T,w,E,S,y,x,C])}var Gt=B.createContext(void 0);function Kt(){return B.useContext(Gt)?.direction??`ltr`}var qt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=G(e,t)||{};if(l==null)return{};let f=xe(u),p={x:n,y:r},m=X(i),h=J(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=ue(k,j,A),N=!c.arrow&&q(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Jt=(e,t)=>({...qt(e),options:[e,t]}),Yt=It().fn,Xt={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Yt(e)).data?.referenceHidden||a}}}},Zt={sideX:`left`,sideY:`top`},Qt={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=N(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:Zt};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=A(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=K(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Zt.sideX,g=f===`top`?`bottom`:Zt.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function $t(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function en(e,t,n){let{rects:r,placement:i}=e;return{side:$t(t,K(i),n),align:q(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function tn(e){let{anchor:t,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:s=`center`,alignOffset:c=0,collisionBoundary:u,collisionPadding:d=5,sticky:f=!1,arrowPadding:p=5,disableAnchorTracking:m=!1,inline:h,keepMounted:g=!1,floatingRootContext:_,mounted:v,collisionAvoidance:y,shiftCrossAxis:b=!1,nodeId:x,adaptiveOrigin:S,lazyFlip:C=!1,externalTree:w}=e,[T,E]=B.useState(null);!v&&T!==null&&E(null);let D=y.side||`flip`,O=y.align||`flip`,k=y.fallbackAxisSide||`end`,j=typeof t==`function`?t:void 0,M=n(j),P=j?M:t,ee=o(t),F=o(v),I=Kt()===`rtl`,te=T||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],ne=s===`center`?te:`${te}-${s}`,L=d,re=+(i===`bottom`),ie=+(i===`top`),ae=+(i===`right`),oe=+(i===`left`);typeof L==`number`?L={top:L+re,right:L+oe,bottom:L+ie,left:L+ae}:L&&={top:(L.top||0)+re,right:(L.right||0)+oe,bottom:(L.bottom||0)+ie,left:(L.left||0)+ae};let R={boundary:u===`clipping-ancestors`?`clippingAncestors`:u,padding:L},z=B.useRef(null),se=o(a),V=o(c),H=typeof a==`function`?0:a,ce=typeof c==`function`?0:c,U=[];h&&U.push(h),U.push(jt(e=>{let t=en(e,i,I),n=typeof se.current==`function`?se.current(t):se.current,r=typeof V.current==`function`?V.current(t):V.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[H,ce,I,i]));let W=O===`none`&&D!==`shift`,le=!W&&(f||b||D===`shift`),ue=D===`none`?null:Pt({...R,padding:{top:L.top+1,right:L.right+1,bottom:L.bottom+1,left:L.left+1},mainAxis:!b&&D===`flip`,crossAxis:O===`flip`&&`alignment`,fallbackAxisSideDirection:k}),G=W?null:Mt(e=>{let t=A(e.elements.floating).documentElement;return{...R,rootBoundary:b?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:O!==`none`,crossAxis:le,limiter:f||b?void 0:Nt(e=>{if(!z.current)return{};let{width:t,height:n}=z.current.getBoundingClientRect(),r=Y(K(e.placement)),i=r===`y`?t:n,a=r===`y`?L.left+L.right:L.top+L.bottom;return{offset:i/2+a/2}})}},[R,f,b,L,O]);D===`shift`||O===`shift`||s===`center`?U.push(G,ue):U.push(ue,G),U.push(Ft({...R,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=N(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Jt(e=>({element:z.current||A(e.elements.floating).createElement(`div`),padding:p,offsetParent:`floating`}),[p]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=K(r),l=Y(c),u=z.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(en(e,i,I)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,le&&l===`y`&&b?S:x),{}}},Xt,S),l(()=>{!v&&_&&_.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,_]);let de=B.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<`u`,layoutShift:!m&&typeof IntersectionObserver<`u`}),[m]),{refs:J,elements:X,x:fe,y:pe,middlewareData:Z,update:me,placement:he,context:ge,isPositioned:Q,floatingStyles:_e}=Rt({rootContext:_,open:g?v:void 0,placement:ne,middleware:U,strategy:r,whileElementsMounted:g?void 0:(...e)=>_t(...e,de),nodeId:x,externalTree:w}),{sideX:ve,sideY:ye}=Z.adaptiveOrigin||Zt,be=Q?r:`fixed`,xe=B.useMemo(()=>{let e=S?{position:be,[ve]:fe,[ye]:pe}:{position:be,..._e};return Q||(e.opacity=0),e},[S,be,ve,fe,ye,pe,_e,Q]),$=B.useRef(null);l(()=>{if(!v)return;let e=ee.current,t=typeof e==`function`?e():e,n=(nn(t)?t.current:t)||null;n!==$.current&&(J.setPositionReference(n),$.current=n)},[v,J,P,ee]),B.useEffect(()=>{if(!v)return;let e=ee.current;typeof e!=`function`&&nn(e)&&e.current!==$.current&&(J.setPositionReference(e.current),$.current=e.current)},[v,J,P,ee]),B.useEffect(()=>{if(g&&v&&X.reference&&X.floating)return _t(X.reference,X.floating,me,de)},[g,v,X,me,de]);let Se=K(he),Ce=$t(i,Se,I),we=q(he)||`center`,Te=!!Z.hide?.referenceHidden;l(()=>{C&&v&&Q&&E(Se)},[C,v,Q,Se]);let Ee=B.useMemo(()=>({position:`absolute`,top:Z.arrow?.y,left:Z.arrow?.x}),[Z.arrow]),De=Z.arrow?.centerOffset!==0;return B.useMemo(()=>({positionerStyles:xe,arrowStyles:Ee,arrowRef:z,arrowUncentered:De,side:Ce,align:we,physicalSide:Se,anchorHidden:Te,refs:J,context:ge,isPositioned:Q,update:me}),[xe,Ee,z,De,Ce,we,Se,Te,J,ge,Q,me])}function nn(e){return e!=null&&`current`in e}function rn(e){return e===`starting`?L:g}function an(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),k(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},rn(r),i],stateAttributesMapping:ee})}export{Kt as a,Vt as c,Te as d,Ee as f,Qt as i,Ut as l,rn as n,Wt as o,tn as r,Ht as s,an as t,we as u};
|