@yoopta/ui 6.0.0 → 6.0.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"element-options-root.d.ts","sourceRoot":"","sources":["../../../src/element-options/components/element-options-root.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,eAAO,MAAM,kBAAkB;wDAM5B,uBAAuB;;CA4BzB,CAAC"}
1
+ {"version":3,"file":"element-options-root.d.ts","sourceRoot":"","sources":["../../../src/element-options/components/element-options-root.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,eAAO,MAAM,kBAAkB;wDAM5B,uBAAuB;;CA8BzB,CAAC"}
@@ -1,14 +1,14 @@
1
- import{s as e}from"./chunks/style-inject.es-e87a8d02.js";import{jsx as t,jsxs as n,Fragment as o}from"react/jsx-runtime";import*as r from"react";import a,{useState as i,useRef as l,useEffect as s,useMemo as c,useCallback as d,createContext as u,useContext as p}from"react";import*as f from"react-dom";import m from"react-dom";import{u as h,j as v,o as g,s as y,n as b,l as w,m as x,p as S,q as C}from"./chunks/floating-ui.react-dom-dc823237.js";import{_ as E,a as k,b as R}from"./chunks/_tslib-29461875.js";import{useYooptaEditor as P,Elements as O}from"@yoopta/editor";import{d as N,Z as _,O as D}from"./chunks/debounce-c595d128.js";import{c as M}from"./chunks/createLucideIcon-8605f860.js";function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}function I(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function T(...e){return t=>{let n=!1;const o=e.map(e=>{const o=I(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():I(e[t],null)}}}}function L(...e){return r.useCallback(T(...e),e)}function F(e,n=[]){let o=[];const a=()=>{const t=o.map(e=>r.createContext(e));return function(n){const o=n?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return a.scopeName=e,[function(n,a){const i=r.createContext(a),l=o.length;o=[...o,a];const s=n=>{const{scope:o,children:a,...s}=n,c=o?.[e]?.[l]||i,d=r.useMemo(()=>s,Object.values(s));return t(c.Provider,{value:d,children:a})};return s.displayName=n+"Provider",[s,function(t,o){const s=o?.[e]?.[l]||i,c=r.useContext(s);if(c)return c;if(void 0!==a)return a;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},j(a,...n)]}function j(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function z(e){const t=r.forwardRef((e,t)=>{const{children:n,...o}=e;if(r.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(a.ref=t?T(t,e):e),r.cloneElement(n,a)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}e(":root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-primary:221.2 83.2% 53.3%;--yoopta-ui-primary-foreground:210 40% 98%;--yoopta-ui-destructive:0 84.2% 60.2%;--yoopta-ui-destructive-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-radius-sm:0.375rem;--yoopta-ui-radius:0.5rem;--yoopta-ui-radius-lg:0.625rem;--yoopta-ui-z-dropdown:50;--yoopta-ui-z-sticky:100;--yoopta-ui-z-overlay:200;--yoopta-ui-z-modal:9999;--yoopta-ui-transition-fast:100ms ease;--yoopta-ui-transition:150ms ease;--yoopta-ui-transition-slow:200ms ease}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -2px rgba(0,0,0,.3);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.5),0 4px 16px -4px rgba(0,0,0,.3)}:root{--yoopta-ui-element-options-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-element-options-content-min-width:180px;--yoopta-ui-element-options-content-padding:8px;--yoopta-ui-element-options-content-radius:0.5rem;--yoopta-ui-element-options-content-z-index:50;--yoopta-ui-element-options-trigger-padding:4px;--yoopta-ui-element-options-trigger-radius:4px;--yoopta-ui-element-options-trigger-icon-size:16px;--yoopta-ui-element-options-control-padding-y:6px;--yoopta-ui-element-options-control-padding-x:10px;--yoopta-ui-element-options-control-radius:6px;--yoopta-ui-element-options-control-font-size:13px;--yoopta-ui-element-options-toggle-width:36px;--yoopta-ui-element-options-toggle-height:20px;--yoopta-ui-element-options-toggle-thumb-size:16px;--yoopta-ui-element-options-transition:background-color 0.15s ease,border-color 0.15s ease,opacity 0.15s ease,transform 0.15s ease}[data-element-options-root]{position:relative}[data-element-options-trigger]{align-items:center;background:transparent;border:none;border-radius:var(--yoopta-ui-element-options-trigger-radius);cursor:pointer;display:inline-flex;justify-content:center;padding:var(--yoopta-ui-element-options-trigger-padding);transition:var(--yoopta-ui-element-options-transition)}[data-element-options-trigger]:hover{background-color:hsl(var(--yoopta-ui-accent))}[data-element-options-trigger]:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring)/.5);outline-offset:2px}[data-element-options-trigger] .yoopta-ui-element-options-trigger-icon{color:hsl(var(--yoopta-ui-muted-foreground));height:var(--yoopta-ui-element-options-trigger-icon-size);width:var(--yoopta-ui-element-options-trigger-icon-size)}[data-element-options-content]{background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-content-radius);box-shadow:var(--yoopta-ui-element-options-shadow);min-width:var(--yoopta-ui-element-options-content-min-width);padding:var(--yoopta-ui-element-options-content-padding);z-index:var(--yoopta-ui-element-options-content-z-index)}[data-element-options-group]{display:flex;flex-direction:column;gap:6px}[data-element-options-group]+[data-element-options-group]{margin-top:8px}[data-element-options-label]{color:hsl(var(--yoopta-ui-muted-foreground));font-size:12px;font-weight:500}[data-element-options-separator]{background-color:hsl(var(--yoopta-ui-border));height:1px;margin:8px 0}[data-element-options-select]{align-items:center;background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-control-radius);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-element-options-control-font-size);justify-content:space-between;padding:var(--yoopta-ui-element-options-control-padding-y) var(--yoopta-ui-element-options-control-padding-x);transition:var(--yoopta-ui-element-options-transition);width:100%}[data-element-options-select]:hover{border-color:hsl(var(--yoopta-ui-muted-foreground))}[data-element-options-select]:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring)/.5);outline-offset:2px}[data-element-options-select-value]{align-items:center;display:flex;gap:8px}[data-element-options-select-chevron]{color:hsl(var(--yoopta-ui-muted-foreground));height:14px;transition:var(--yoopta-ui-element-options-transition);width:14px}[data-element-options-select][data-state=open] [data-element-options-select-chevron]{transform:rotate(180deg)}[data-element-options-select-content]{background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-control-radius);box-shadow:var(--yoopta-ui-element-options-shadow);min-width:var(--radix-select-trigger-width,140px);padding:4px;z-index:calc(var(--yoopta-ui-element-options-content-z-index) + 1)}[data-element-options-select-item]{align-items:center;background:transparent;border:none;border-radius:4px;color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-element-options-control-font-size);justify-content:space-between;padding:var(--yoopta-ui-element-options-control-padding-y) 8px;text-align:left;transition:var(--yoopta-ui-element-options-transition);width:100%}[data-element-options-select-item]:hover{background-color:hsl(var(--yoopta-ui-accent))}[data-element-options-select-item][data-selected=true]{background-color:hsl(var(--yoopta-ui-primary)/.1)}[data-element-options-select-item-content]{align-items:center;display:flex;gap:8px}[data-element-options-select-check]{color:hsl(var(--yoopta-ui-primary));height:14px;width:14px}[data-element-options-select-icon]{align-items:center;display:flex;height:16px;justify-content:center;width:16px}[data-element-options-select-color]{border:1px solid hsl(var(--yoopta-ui-border));border-radius:50%;display:inline-block;height:12px;width:12px}[data-element-options-color-picker]{align-items:center;background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-control-radius);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-element-options-control-font-size);gap:8px;padding:var(--yoopta-ui-element-options-control-padding-y) var(--yoopta-ui-element-options-control-padding-x);transition:var(--yoopta-ui-element-options-transition);width:100%}[data-element-options-color-picker]:hover{border-color:hsl(var(--yoopta-ui-muted-foreground))}[data-element-options-color-preview]{border:1px solid hsl(var(--yoopta-ui-border));border-radius:4px;display:inline-block;height:20px;width:20px}[data-element-options-color-value]{color:hsl(var(--yoopta-ui-muted-foreground));font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:12px}[data-element-options-color-picker-content]{background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-content-radius);box-shadow:var(--yoopta-ui-element-options-shadow);padding:12px;z-index:calc(var(--yoopta-ui-element-options-content-z-index) + 1)}[data-element-options-color-picker-content] .react-colorful{height:150px;width:180px}[data-element-options-color-presets]{border-top:1px solid hsl(var(--yoopta-ui-border));display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;padding-top:10px}[data-element-options-color-preset]{border:2px solid transparent;border-radius:4px;cursor:pointer;height:20px;padding:0;transition:var(--yoopta-ui-element-options-transition);width:20px}[data-element-options-color-preset]:hover{transform:scale(1.1)}[data-element-options-color-preset][data-selected=true]{border-color:hsl(var(--yoopta-ui-primary))}[data-element-options-color-hex-row]{align-items:center;border-top:1px solid hsl(var(--yoopta-ui-border));display:flex;gap:8px;margin-top:10px;padding-top:10px}[data-element-options-color-swatch]{border:1px solid hsl(var(--yoopta-ui-border));border-radius:6px;flex-shrink:0;height:26px;width:26px}[data-element-options-color-hex-input]{background:transparent;border:1px solid hsl(var(--yoopta-ui-border));border-radius:6px;color:hsl(var(--yoopta-ui-foreground));flex:1;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:12px;height:26px;min-width:0;outline:none;padding:0 10px;transition:var(--yoopta-ui-element-options-transition)}[data-element-options-color-hex-input]:focus{border-color:hsl(var(--yoopta-ui-primary));box-shadow:0 0 0 2px hsl(var(--yoopta-ui-primary)/.15)}[data-element-options-toggle-wrapper]{align-items:center;display:flex;gap:8px}[data-element-options-toggle]{all:unset;align-items:center;background-color:hsl(var(--yoopta-ui-border));border-radius:10px;cursor:pointer;display:inline-flex;height:var(--yoopta-ui-element-options-toggle-height);transition:var(--yoopta-ui-element-options-transition);width:var(--yoopta-ui-element-options-toggle-width)}[data-element-options-toggle][data-state=checked]{background-color:hsl(var(--yoopta-ui-primary))}[data-element-options-toggle-thumb]{background-color:hsl(var(--yoopta-ui-background));border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.1);display:block;height:var(--yoopta-ui-element-options-toggle-thumb-size);transform:translateX(2px);transition:var(--yoopta-ui-element-options-transition);width:var(--yoopta-ui-element-options-toggle-thumb-size)}[data-element-options-toggle][data-state=checked] [data-element-options-toggle-thumb]{transform:translateX(18px)}[data-element-options-toggle-label]{color:hsl(var(--yoopta-ui-foreground));font-size:var(--yoopta-ui-element-options-control-font-size)}[data-element-options-slider]{align-items:center;display:flex;gap:10px}[data-element-options-slider-root]{align-items:center;cursor:pointer;display:flex;flex:1;height:14px;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-element-options-slider-track]{background-color:hsl(var(--yoopta-ui-border));border-radius:2px;flex-grow:1;height:4px;overflow:hidden;position:relative}[data-element-options-slider-range]{background-color:hsl(var(--yoopta-ui-primary));border-radius:2px;height:100%;position:absolute}[data-element-options-slider-thumb]{all:unset;background-color:hsl(var(--yoopta-ui-background));border:2px solid hsl(var(--yoopta-ui-primary));border-radius:50%;cursor:pointer;display:block;height:14px;transition:var(--yoopta-ui-element-options-transition);width:14px}[data-element-options-slider-thumb]:hover{transform:scale(1.1)}[data-element-options-slider-thumb]:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring)/.5);outline-offset:2px}[data-element-options-slider-value]{color:hsl(var(--yoopta-ui-muted-foreground));font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:12px;min-width:32px;text-align:right}[data-element-options-input]{background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-control-radius);color:hsl(var(--yoopta-ui-foreground));font-size:var(--yoopta-ui-element-options-control-font-size);padding:var(--yoopta-ui-element-options-control-padding-y) var(--yoopta-ui-element-options-control-padding-x);transition:var(--yoopta-ui-element-options-transition);width:100%}[data-element-options-input]:hover{border-color:hsl(var(--yoopta-ui-muted-foreground))}[data-element-options-input]:focus{border-color:hsl(var(--yoopta-ui-primary));box-shadow:0 0 0 2px hsl(var(--yoopta-ui-primary)/.1);outline:none}[data-element-options-input]::-moz-placeholder{color:hsl(var(--yoopta-ui-muted-foreground))}[data-element-options-input]::placeholder{color:hsl(var(--yoopta-ui-muted-foreground))}");var W=Symbol("radix.slottable");function B(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===W}var H=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{const o=function(e){const n=z(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,l=r.Children.toArray(a),s=l.find(B);if(s){const e=s.props.children,a=l.map(t=>t===s?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return t(n,{...i,ref:o,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return t(n,{...i,ref:o,children:a})});return o.displayName=`${e}.Slot`,o}(`Primitive.${n}`),a=r.forwardRef((e,r)=>{const{asChild:a,...i}=e,l=a?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(l,{...i,ref:r})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function V(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var K,$="dismissableLayer.update",U="dismissableLayer.pointerDownOutside",X="dismissableLayer.focusOutside",Y=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),q=r.forwardRef((e,n)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:s,onDismiss:c,...d}=e,u=r.useContext(Y),[p,f]=r.useState(null),m=p?.ownerDocument??globalThis?.document,[,h]=r.useState({}),v=L(n,e=>f(e)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(y),w=p?g.indexOf(p):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,C=function(e,t=globalThis?.document){const n=V(e),o=r.useRef(!1),a=r.useRef(()=>{});return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let o=function(){G(U,n,r,{discrete:!0})};const r={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=o,t.addEventListener("click",a.current,{once:!0})):o()}else t.removeEventListener("click",a.current);o.current=!1},r=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(r),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));S&&!n&&(i?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=function(e,t=globalThis?.document){const n=V(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){G(X,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(l?.(e),s?.(e),e.defaultPrevented||c?.())},m);return function(e,t=globalThis?.document){const n=V(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===u.layers.size-1&&(a?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},m),r.useEffect(()=>{if(p)return o&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(K=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),Z(),()=>{o&&1===u.layersWithOutsidePointerEventsDisabled.size&&(m.body.style.pointerEvents=K)}},[p,m,o,u]),r.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),Z())},[p,u]),r.useEffect(()=>{const e=()=>h({});return document.addEventListener($,e),()=>document.removeEventListener($,e)},[]),t(H.div,{...d,ref:v,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,E.onFocusCapture),onBlurCapture:A(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,C.onPointerDownCapture)})});q.displayName="DismissableLayer";function Z(){const e=new CustomEvent($);document.dispatchEvent(e)}function G(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?function(e,t){e&&f.flushSync(()=>e.dispatchEvent(t))}(r,a):r.dispatchEvent(a)}r.forwardRef((e,n)=>{const o=r.useContext(Y),a=r.useRef(null),i=L(n,a);return r.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),t(H.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var J=0;function Q(){r.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ee()),document.body.insertAdjacentElement("beforeend",e[1]??ee()),J++,()=>{1===J&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),J--}},[])}function ee(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var te="focusScope.autoFocusOnMount",ne="focusScope.autoFocusOnUnmount",oe={bubbles:!1,cancelable:!0},re=r.forwardRef((e,n)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...s}=e,[c,d]=r.useState(null),u=V(i),p=V(l),f=r.useRef(null),m=L(n,e=>d(e)),h=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(a){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:se(f.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||se(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&se(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return c&&o.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[a,c,h.paused]),r.useEffect(()=>{if(c){ce.add(h);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(te,oe);c.addEventListener(te,u),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(se(o,{select:t}),document.activeElement!==n)return}((e=ae(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&se(c))}return()=>{c.removeEventListener(te,u),setTimeout(()=>{const e=new CustomEvent(ne,oe);c.addEventListener(ne,p),c.dispatchEvent(e),e.defaultPrevented||se(t??document.body,{select:!0}),c.removeEventListener(ne,p),ce.remove(h)},0)}}var e},[c,u,p,h]);const v=r.useCallback(e=>{if(!o&&!a)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=ae(e),n=ie(t,e),o=ie(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&se(a,{select:!0})):(e.preventDefault(),o&&se(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return t(H.div,{tabIndex:-1,...s,ref:m,onKeyDown:v})});function ae(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ie(e,t){for(const n of e)if(!le(n,{upTo:t}))return n}function le(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function se(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}re.displayName="FocusScope";var ce=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=de(e,t),e.unshift(t)},remove(t){e=de(e,t),e[0]?.resume()}}}();function de(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var ue=globalThis?.document?r.useLayoutEffect:()=>{},pe=r[" useId ".trim().toString()]||(()=>{}),fe=0;function me(e){const[t,n]=r.useState(pe());return ue(()=>{e||n(e=>e??String(fe++))},[e]),e||(t?`radix-${t}`:"")}var he=r.forwardRef((e,n)=>{const{children:o,width:r=10,height:a=5,...i}=e;return t(H.svg,{...i,ref:n,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:t("polygon",{points:"0,0 30,0 15,10"})})});he.displayName="Arrow";var ve=he;function ge(e){const[t,n]=r.useState(void 0);return ue(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,a;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var ye="Popper",[be,we]=F(ye),[xe,Se]=be(ye),Ce=e=>{const{__scopePopper:n,children:o}=e,[a,i]=r.useState(null);return t(xe,{scope:n,anchor:a,onAnchorChange:i,children:o})};Ce.displayName=ye;var Ee="PopperAnchor",ke=r.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:a,...i}=e,l=Se(Ee,o),s=r.useRef(null),c=L(n,s),d=r.useRef(null);return r.useEffect(()=>{const e=d.current;d.current=a?.current||s.current,e!==d.current&&l.onAnchorChange(d.current)}),a?null:t(H.div,{...i,ref:c})});ke.displayName=Ee;var Re="PopperContent",[Pe,Oe]=be(Re),Ne=r.forwardRef((e,n)=>{const{__scopePopper:o,side:a="bottom",sideOffset:i=0,align:l="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:E="optimized",onPlaced:k,...R}=e,P=Se(Re,o),[O,N]=r.useState(null),_=L(n,e=>N(e)),[D,M]=r.useState(null),A=ge(D),I=A?.width??0,T=A?.height??0,F=a+("center"!==l?"-"+l:""),j="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},z=Array.isArray(u)?u:[u],W=z.length>0,B={padding:j,boundary:z.filter(Ae),altBoundary:W},{refs:K,floatingStyles:$,placement:U,isPositioned:X,middlewareData:Y}=h({strategy:"fixed",placement:F,whileElementsMounted:(...e)=>v(...e,{animationFrame:"always"===E}),elements:{reference:P.anchor},middleware:[g({mainAxis:i+T,alignmentAxis:s}),d&&y({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?b():void 0,...B}),d&&w({...B}),x({...B,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),D&&S({element:D,padding:c}),Ie({arrowWidth:I,arrowHeight:T}),m&&C({strategy:"referenceHidden",...B})]}),[q,Z]=Te(U),G=V(k);ue(()=>{X&&G?.()},[X,G]);const J=Y.arrow?.x,Q=Y.arrow?.y,ee=0!==Y.arrow?.centerOffset,[te,ne]=r.useState();return ue(()=>{O&&ne(window.getComputedStyle(O).zIndex)},[O]),t("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:X?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t(Pe,{scope:o,placedSide:q,onArrowChange:M,arrowX:J,arrowY:Q,shouldHideArrow:ee,children:t(H.div,{"data-side":q,"data-align":Z,...R,ref:_,style:{...R.style,animation:X?void 0:"none"}})})})});Ne.displayName=Re;var _e="PopperArrow",De={top:"bottom",right:"left",bottom:"top",left:"right"},Me=r.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,a=Oe(_e,o),i=De[a.placedSide];return t("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t(ve,{...r,ref:n,style:{...r.style,display:"block"}})})});function Ae(e){return null!==e}Me.displayName=_e;var Ie=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[s,c]=Te(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(r.arrow?.x??0)+i/2,p=(r.arrow?.y??0)+l/2;let f="",m="";return"bottom"===s?(f=a?d:`${u}px`,m=-l+"px"):"top"===s?(f=a?d:`${u}px`,m=`${o.floating.height+l}px`):"right"===s?(f=-l+"px",m=a?d:`${p}px`):"left"===s&&(f=`${o.floating.width+l}px`,m=a?d:`${p}px`),{data:{x:f,y:m}}}});function Te(e){const[t,n="center"]=e.split("-");return[t,n]}var Le=Ce,Fe=ke,je=Ne,ze=Me,We=r.forwardRef((e,n)=>{const{container:o,...a}=e,[i,l]=r.useState(!1);ue(()=>l(!0),[]);const s=o||i&&globalThis?.document?.body;return s?m.createPortal(t(H.div,{...a,ref:n}),s):null});We.displayName="Portal";var Be=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=r.useState(),o=r.useRef(null),a=r.useRef(e),i=r.useRef("none"),l=e?"mounted":"unmounted",[s,c]=function(e,t){return r.useReducer((e,n)=>t[e][n]??e,e)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=He(o.current);i.current="mounted"===s?e:"none"},[s]),ue(()=>{const t=o.current,n=a.current;if(n!==e){const o=i.current,r=He(t);if(e)c("MOUNT");else if("none"===r||"none"===t?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),ue(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const i=He(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&i&&(c("ANIMATION_END"),!a.current)){const o=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=o)})}},l=e=>{e.target===t&&(i.current=He(o.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),i=L(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||o.isPresent?r.cloneElement(a,{ref:i}):null};function He(e){return e?.animationName||"none"}function Ve(e){const t=r.forwardRef((e,t)=>{const{children:n,...o}=e;if(r.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(a.ref=t?T(t,e):e),r.cloneElement(n,a)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Be.displayName="Presence";var Ke=Symbol("radix.slottable");function $e(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ke}var Ue=r[" useInsertionEffect ".trim().toString()]||ue;function Xe({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[a,i,l]=function({defaultProp:e,onChange:t}){const[n,o]=r.useState(e),a=r.useRef(n),i=r.useRef(t);return Ue(()=>{i.current=t},[t]),r.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,o,i]}({defaultProp:t,onChange:n}),s=void 0!==e,c=s?e:a;{const t=r.useRef(void 0!==e);r.useEffect(()=>{const e=t.current;if(e!==s){const t=e?"controlled":"uncontrolled",n=s?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,o])}const d=r.useCallback(t=>{if(s){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&l.current?.(n)}else i(t)},[s,e,i,l]);return[c,d]}var Ye=new WeakMap,qe=new WeakMap,Ze={},Ge=0,Je=function(e){return e&&(e.host||Je(e.parentNode))},Qe=function(e,t,n,o){var r=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Je(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Ze[n]||(Ze[n]=new WeakMap);var a=Ze[n],i=[],l=new Set,s=new Set(r),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};r.forEach(c);var d=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(l.has(e))d(e);else try{var t=e.getAttribute(o),r=null!==t&&"false"!==t,s=(Ye.get(e)||0)+1,c=(a.get(e)||0)+1;Ye.set(e,s),a.set(e,c),i.push(e),1===s&&r&&qe.set(e,!0),1===c&&e.setAttribute(n,"true"),r||e.setAttribute(o,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),l.clear(),Ge++,function(){i.forEach(function(e){var t=Ye.get(e)-1,r=a.get(e)-1;Ye.set(e,t),a.set(e,r),t||(qe.has(e)||e.removeAttribute(o),qe.delete(e)),r||e.removeAttribute(n)}),--Ge||(Ye=new WeakMap,Ye=new WeakMap,qe=new WeakMap,Ze={})}},et=function(e,t,n){void 0===n&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Qe(o,r,n,"aria-hidden")):function(){return null}},tt="right-scroll-bar-position",nt="width-before-scroll-bar";function ot(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var rt="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,at=new WeakMap;function it(e,t){var n,o,r,a=(n=t||null,o=function(t){return e.forEach(function(e){return ot(e,t)})},(r=i(function(){return{value:n,callback:o,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0]).callback=o,r.facade);return rt(function(){var t=at.get(a);if(t){var n=new Set(t),o=new Set(e),r=a.current;n.forEach(function(e){o.has(e)||ot(e,null)}),o.forEach(function(e){n.has(e)||ot(e,r)})}at.set(a,e)},[e]),a}function lt(e){return e}var st=function(e){var t=e.sideCar,n=k(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return r.createElement(o,E({},n))};st.isSideCarExport=!0;var ct=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=lt);var n=[],o=!1;return{read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var r=t(e,o);return n.push(r),function(){n=n.filter(function(e){return e!==r})}},assignSyncMedium:function(e){for(o=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){o=!0;var t=[];if(n.length){var r=n;n=[],r.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=E({async:!0,ssr:!1},e),t}(),dt=function(){},ut=r.forwardRef(function(e,t){var n=r.useRef(null),o=r.useState({onScrollCapture:dt,onWheelCapture:dt,onTouchMoveCapture:dt}),a=o[0],i=o[1],l=e.forwardProps,s=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,f=e.sideCar,m=e.noRelative,h=e.noIsolation,v=e.inert,g=e.allowPinchZoom,y=e.as,b=void 0===y?"div":y,w=e.gapMode,x=k(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,C=it([n,t]),R=E(E({},x),a);return r.createElement(r.Fragment,null,u&&r.createElement(S,{sideCar:ct,removeScrollBar:d,shards:p,noRelative:m,noIsolation:h,inert:v,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:w}),l?r.cloneElement(r.Children.only(s),E(E({},R),{ref:C})):r.createElement(b,E({},R,{className:c,ref:C}),s))});ut.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ut.classNames={fullWidth:nt,zeroRight:tt};function pt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var ft=function(){var e=0,t=null;return{add:function(n){var o,r;0==e&&(t=pt())&&(r=n,(o=t).styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mt=function(){var e,t=(e=ft(),function(t,n){r.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,o=e.dynamic;return t(n,o),null}},ht={left:0,top:0,right:0,gap:0},vt=function(e){return parseInt(e||"",10)||0},gt=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return ht;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],o=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[vt(n),vt(o),vt(r)]}(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},yt=mt(),bt="data-scroll-locked",wt=function(e,t,n,o){var r=e.left,a=e.top,i=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(o,";\n padding-right: ").concat(l,"px ").concat(o,";\n }\n body[").concat(bt,"] {\n overflow: hidden ").concat(o,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(o,";"),"margin"===n&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(o,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(o,";")].filter(Boolean).join(""),"\n }\n \n .").concat(tt," {\n right: ").concat(l,"px ").concat(o,";\n }\n \n .").concat(nt," {\n margin-right: ").concat(l,"px ").concat(o,";\n }\n \n .").concat(tt," .").concat(tt," {\n right: 0 ").concat(o,";\n }\n \n .").concat(nt," .").concat(nt," {\n margin-right: 0 ").concat(o,";\n }\n \n body[").concat(bt,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},xt=function(){var e=parseInt(document.body.getAttribute(bt)||"0",10);return isFinite(e)?e:0},St=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,a=void 0===o?"margin":o;r.useEffect(function(){return document.body.setAttribute(bt,(xt()+1).toString()),function(){var e=xt()-1;e<=0?document.body.removeAttribute(bt):document.body.setAttribute(bt,e.toString())}},[]);var i=r.useMemo(function(){return gt(a)},[a]);return r.createElement(yt,{styles:wt(i,!t,a,n?"":"!important")})},Ct=!1;if("undefined"!=typeof window)try{var Et=Object.defineProperty({},"passive",{get:function(){return Ct=!0,!0}});window.addEventListener("test",Et,Et),window.removeEventListener("test",Et,Et)}catch(e){Ct=!1}var kt=!!Ct&&{passive:!1},Rt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Pt=function(e,t){var n=t.ownerDocument,o=t;do{if("undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot&&(o=o.host),Ot(e,o)){var r=Nt(e,o);if(r[1]>r[2])return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Ot=function(e,t){return"v"===e?function(e){return Rt(e,"overflowY")}(t):function(e){return Rt(e,"overflowX")}(t)},Nt=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},_t=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Dt=function(e){return[e.deltaX,e.deltaY]},Mt=function(e){return e&&"current"in e?e.current:e},At=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},It=0,Tt=[];function Lt(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ft,jt=(Ft=function(e){var t=r.useRef([]),n=r.useRef([0,0]),o=r.useRef(),a=r.useState(It++)[0],i=r.useState(mt)[0],l=r.useRef(e);r.useEffect(function(){l.current=e},[e]),r.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=R([e.lockRef.current],(e.shards||[]).map(Mt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var s=r.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!l.current.allowPinchZoom;var r,a=_t(e),i=n.current,s="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],d=e.target,u=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var p=window.getSelection(),f=p&&p.anchorNode;if(f&&(f===d||f.contains(d)))return!1;var m=Pt(u,d);if(!m)return!0;if(m?r=u:(r="v"===u?"h":"v",m=Pt(u,d)),!m)return!1;if(!o.current&&"changedTouches"in e&&(s||c)&&(o.current=r),!r)return!0;var h=o.current||r;return function(e,t,n,o,r){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*o,l=n.target,s=t.contains(l),c=!1,d=i>0,u=0,p=0;do{if(!l)break;var f=Nt(e,l),m=f[0],h=f[1]-f[2]-a*m;(m||h)&&Ot(e,l)&&(u+=h,p+=m);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!s&&l!==document.body||s&&(t.contains(l)||t===l));return(d&&(r&&Math.abs(u)<1||!r&&i>u)||!d&&(r&&Math.abs(p)<1||!r&&-i>p))&&(c=!0),c}(h,t,e,"h"===h?s:c,!0)},[]),c=r.useCallback(function(e){var n=e;if(Tt.length&&Tt[Tt.length-1]===i){var o="deltaY"in n?Dt(n):_t(n),r=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,r=o,t[0]===r[0]&&t[1]===r[1]);var t,r})[0];if(r&&r.should)n.cancelable&&n.preventDefault();else if(!r){var a=(l.current.shards||[]).map(Mt).filter(Boolean).filter(function(e){return e.contains(n.target)});(a.length>0?s(n,a[0]):!l.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),d=r.useCallback(function(e,n,o,r){var a={name:e,delta:n,target:o,should:r,shadowParent:Lt(o)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=r.useCallback(function(e){n.current=_t(e),o.current=void 0},[]),p=r.useCallback(function(t){d(t.type,Dt(t),t.target,s(t,e.lockRef.current))},[]),f=r.useCallback(function(t){d(t.type,_t(t),t.target,s(t,e.lockRef.current))},[]);r.useEffect(function(){return Tt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",c,kt),document.addEventListener("touchmove",c,kt),document.addEventListener("touchstart",u,kt),function(){Tt=Tt.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,kt),document.removeEventListener("touchmove",c,kt),document.removeEventListener("touchstart",u,kt)}},[]);var m=e.removeScrollBar,h=e.inert;return r.createElement(r.Fragment,null,h?r.createElement(i,{styles:At(a)}):null,m?r.createElement(St,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},ct.useMedium(Ft),st),zt=r.forwardRef(function(e,t){return r.createElement(ut,E({},e,{ref:t,sideCar:jt}))});zt.classNames=ut.classNames;var Wt=zt,Bt="Popover",[Ht,Vt]=F(Bt,[we]),Kt=we(),[$t,Ut]=Ht(Bt),Xt=e=>{const{__scopePopover:n,children:o,open:a,defaultOpen:i,onOpenChange:l,modal:s=!1}=e,c=Kt(n),d=r.useRef(null),[u,p]=r.useState(!1),[f,m]=Xe({prop:a,defaultProp:i??!1,onChange:l,caller:Bt});return t(Le,{...c,children:t($t,{scope:n,contentId:me(),triggerRef:d,open:f,onOpenChange:m,onOpenToggle:r.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:u,onCustomAnchorAdd:r.useCallback(()=>p(!0),[]),onCustomAnchorRemove:r.useCallback(()=>p(!1),[]),modal:s,children:o})})};Xt.displayName=Bt;var Yt="PopoverAnchor";r.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,i=Ut(Yt,o),l=Kt(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:c}=i;return r.useEffect(()=>(s(),()=>c()),[s,c]),t(Fe,{...l,...a,ref:n})}).displayName=Yt;var qt="PopoverTrigger",Zt=r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=Ut(qt,o),i=Kt(o),l=L(n,a.triggerRef),s=t(H.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":cn(a.open),...r,ref:l,onClick:A(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?s:t(Fe,{asChild:!0,...i,children:s})});Zt.displayName=qt;var Gt="PopoverPortal",[Jt,Qt]=Ht(Gt,{forceMount:void 0}),en=e=>{const{__scopePopover:n,forceMount:o,children:r,container:a}=e,i=Ut(Gt,n);return t(Jt,{scope:n,forceMount:o,children:t(Be,{present:o||i.open,children:t(We,{asChild:!0,container:a,children:r})})})};en.displayName=Gt;var tn="PopoverContent",nn=r.forwardRef((e,n)=>{const o=Qt(tn,e.__scopePopover),{forceMount:r=o.forceMount,...a}=e,i=Ut(tn,e.__scopePopover);return t(Be,{present:r||i.open,children:i.modal?t(rn,{...a,ref:n}):t(an,{...a,ref:n})})});nn.displayName=tn;var on=function(e){const n=Ve(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,l=r.Children.toArray(a),s=l.find($e);if(s){const e=s.props.children,a=l.map(t=>t===s?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return t(n,{...i,ref:o,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return t(n,{...i,ref:o,children:a})});return o.displayName=`${e}.Slot`,o}("PopoverContent.RemoveScroll"),rn=r.forwardRef((e,n)=>{const o=Ut(tn,e.__scopePopover),a=r.useRef(null),i=L(n,a),l=r.useRef(!1);return r.useEffect(()=>{const e=a.current;if(e)return et(e)},[]),t(Wt,{as:on,allowPinchZoom:!0,children:t(ln,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:A(e.onCloseAutoFocus,e=>{e.preventDefault(),l.current||o.triggerRef.current?.focus()}),onPointerDownOutside:A(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;l.current=o},{checkForDefaultPrevented:!1}),onFocusOutside:A(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),an=r.forwardRef((e,n)=>{const o=Ut(tn,e.__scopePopover),a=r.useRef(!1),i=r.useRef(!1);return t(ln,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||o.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const n=t.target,r=o.triggerRef.current?.contains(n);r&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),ln=r.forwardRef((e,n)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,f=Ut(tn,o),m=Kt(o);return Q(),t(re,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t(q,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:t(je,{"data-state":cn(f.open),role:"dialog",id:f.contentId,...m,...p,ref:n,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),sn="PopoverClose";r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=Ut(sn,o);return t(H.button,{type:"button",...r,ref:n,onClick:A(e.onClick,()=>a.onOpenChange(!1))})}).displayName=sn;function cn(e){return e?"open":"closed"}r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=Kt(o);return t(ze,{...a,...r,ref:n})}).displayName="PopoverArrow";var dn=Xt,un=Zt,pn=en,fn=nn;const mn=["#000000","#6B7280","#EF4444","#F59E0B","#22C55E","#3B82F6","#8B5CF6","#EC4899"],hn={width:"100%"},vn=({value:e,onChange:o,presetColors:r=mn,className:a,style:u})=>{const p=P(),[f,m]=i(e);l(e).current=e,s(()=>{m(e)},[e]);const h=c(()=>N(e=>{o(e)},300),[o]);s(()=>()=>{h.cancel()},[h]);const v=d(e=>{m(e),h(e)},[h]),g=d(e=>{h.cancel(),m(e),o(e)},[o,h]);return n(dn,{children:[t(un,Object.assign({asChild:!0},{children:n("button",Object.assign({type:"button",className:a,style:u,onMouseDown:e=>e.preventDefault(),"data-element-options-color-picker":!0},{children:[t("span",{"data-element-options-color-preview":!0,style:{backgroundColor:f}}),t("span",Object.assign({"data-element-options-color-value":!0},{children:f}))]}))})),t(pn,Object.assign({container:p.refElement},{children:n(fn,Object.assign({"data-element-options-color-picker-content":!0,side:"bottom",align:"start",sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),h.flush()},onMouseDown:e=>e.preventDefault()},{children:[t(_,{color:f,onChange:v,"data-element-options-color-picker-picker":!0,style:hn}),r.length>0&&t("div",Object.assign({"data-element-options-color-presets":!0},{children:r.map(e=>t("button",{type:"button","data-element-options-color-preset":!0,"data-selected":e.toLowerCase()===(null==f?void 0:f.toLowerCase()),style:{backgroundColor:e},onClick:()=>g(e),onMouseDown:e=>e.preventDefault(),"aria-label":`Select color ${e}`},e))})),n("div",Object.assign({"data-element-options-color-hex-row":!0},{children:[t("div",{"data-element-options-color-swatch":!0,style:{backgroundColor:f}}),t(D,{color:f,onChange:g,"data-element-options-color-hex-input":!0,prefixed:!0})]}))]}))}))]})};vn.displayName="ElementOptions.ColorPicker";const gn=u(null);function yn(){const e=p(gn);if(!e)throw new Error("useElementOptionsContext must be used within an ElementOptions.Root");return e}function bn(){const{blockId:e,element:t,editor:n,isOpen:o,setIsOpen:r}=yn();return{blockId:e,element:t,editor:n,isOpen:o,setIsOpen:r}}function wn(){const{blockId:e,element:t,editor:n}=yn();return o=>{O.updateElement(n,{blockId:e,type:t.type,props:Object.assign(Object.assign({},t.props),o)})}}gn.displayName="ElementOptionsContext";const xn=({children:e,className:n,style:o,side:r="bottom",align:a="end",sideOffset:i=4,alignOffset:l=0})=>{const{isOpen:s}=yn(),c=P();return s?t(pn,Object.assign({container:c.refElement},{children:t(fn,Object.assign({side:r,align:a,sideOffset:i,alignOffset:l,collisionPadding:8,className:n,style:o,"data-element-options-content":!0,"data-state":"open","data-side":r,"data-align":a,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault()},{children:e}))})):null};xn.displayName="ElementOptions.Content";const Sn=({children:e,className:n,style:o})=>t("div",Object.assign({className:n,style:o,"data-element-options-group":!0},{children:e}));Sn.displayName="ElementOptions.Group";const Cn=({value:e,onChange:n,placeholder:o,type:r="text",className:a,style:i})=>t("input",{type:r,value:e,onChange:e=>{n(e.target.value)},onMouseDown:e=>{e.stopPropagation()},placeholder:o,className:a,style:i,"data-element-options-input":!0});Cn.displayName="ElementOptions.Input";const En=({children:e,className:n,style:o})=>t("label",Object.assign({className:n,style:o,"data-element-options-label":!0},{children:e}));En.displayName="ElementOptions.Label";const kn=({blockId:e,element:n,children:o,className:r,style:a})=>{const l=P(),[s,d]=i(!1),u=c(()=>({blockId:e,element:n,editor:l,isOpen:s,setIsOpen:d}),[e,n,l,s]);return t(gn.Provider,Object.assign({value:u},{children:t(dn,Object.assign({open:s,onOpenChange:d},{children:t("div",Object.assign({className:r,style:a,"data-element-options-root":!0,"data-state":s?"open":"closed"},{children:o}))}))}))};function Rn(e,[t,n]){return Math.min(n,Math.max(t,e))}function Pn(e){const n=On(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,l=r.Children.toArray(a),s=l.find(_n);if(s){const e=s.props.children,a=l.map(t=>t===s?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return t(n,{...i,ref:o,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return t(n,{...i,ref:o,children:a})});return o.displayName=`${e}.Slot`,o}function On(e){const t=r.forwardRef((e,t)=>{const{children:n,...o}=e;if(r.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(a.ref=t?T(t,e):e),r.cloneElement(n,a)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}kn.displayName="ElementOptions.Root";var Nn=Symbol("radix.slottable");function _n(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Nn}function Dn(e){const n=e+"CollectionProvider",[o,r]=F(n),[i,l]=o(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:o}=e,r=a.useRef(null),l=a.useRef(new Map).current;return t(i,{scope:n,itemMap:l,collectionRef:r,children:o})};s.displayName=n;const c=e+"CollectionSlot",d=Pn(c),u=a.forwardRef((e,n)=>{const{scope:o,children:r}=e,a=L(n,l(c,o).collectionRef);return t(d,{ref:a,children:r})});u.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",m=Pn(p),h=a.forwardRef((e,n)=>{const{scope:o,children:r,...i}=e,s=a.useRef(null),c=L(n,s),d=l(p,o);return a.useEffect(()=>(d.itemMap.set(s,{ref:s,...i}),()=>{d.itemMap.delete(s)})),t(m,{[f]:"",ref:c,children:r})});return h.displayName=p,[{Provider:s,Slot:u,ItemSlot:h},function(t){const n=l(e+"CollectionConsumer",t);return a.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},r]}var Mn=r.createContext(void 0);function An(e){const t=r.useContext(Mn);return e||t||"ltr"}function In(e){const t=r.forwardRef((e,t)=>{const{children:n,...o}=e;if(r.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(a.ref=t?T(t,e):e),r.cloneElement(n,a)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tn=Symbol("radix.slottable");function Ln(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Tn}function Fn(e){const t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var jn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});r.forwardRef((e,n)=>t(H.span,{...e,ref:n,style:{...jn,...e.style}})).displayName="VisuallyHidden";var zn=[" ","Enter","ArrowUp","ArrowDown"],Wn=[" ","Enter"],Bn="Select",[Hn,Vn,Kn]=Dn(Bn),[$n,Un]=F(Bn,[Kn,we]),Xn=we(),[Yn,qn]=$n(Bn),[Zn,Gn]=$n(Bn),Jn=e=>{const{__scopeSelect:o,children:a,open:i,defaultOpen:l,onOpenChange:s,value:c,defaultValue:d,onValueChange:u,dir:p,name:f,autoComplete:m,disabled:h,required:v,form:g}=e,y=Xn(o),[b,w]=r.useState(null),[x,S]=r.useState(null),[C,E]=r.useState(!1),k=An(p),[R,P]=Xe({prop:i,defaultProp:l??!1,onChange:s,caller:Bn}),[O,N]=Xe({prop:c,defaultProp:d,onChange:u,caller:Bn}),_=r.useRef(null),D=!b||(g||!!b.closest("form")),[M,A]=r.useState(new Set),I=Array.from(M).map(e=>e.props.value).join(";");return t(Le,{...y,children:n(Yn,{required:v,scope:o,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:me(),value:O,onValueChange:N,open:R,onOpenChange:P,dir:k,triggerPointerDownPosRef:_,disabled:h,children:[t(Hn.Provider,{scope:o,children:t(Zn,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{A(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:a})}),D?n(To,{"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:m,value:O,onChange:e=>N(e.target.value),disabled:h,form:g,children:[void 0===O?t("option",{value:""}):null,Array.from(M)]},I):null]})})};Jn.displayName=Bn;var Qn="SelectTrigger",eo=r.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:a=!1,...i}=e,l=Xn(o),s=qn(Qn,o),c=s.disabled||a,d=L(n,s.onTriggerChange),u=Vn(o),p=r.useRef("touch"),[f,m,h]=Fo(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),o=jo(t,e,n);void 0!==o&&s.onValueChange(o.value)}),v=e=>{c||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t(Fe,{asChild:!0,...l,children:t(H.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Lo(s.value)?"":void 0,...i,ref:d,onClick:A(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:A(i.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:A(i.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),t&&" "===e.key||zn.includes(e.key)&&(v(),e.preventDefault())})})})});eo.displayName=Qn;var to="SelectValue",no=r.forwardRef((e,n)=>{const{__scopeSelect:r,className:a,style:i,children:l,placeholder:s="",...c}=e,d=qn(to,r),{onValueNodeHasChildrenChange:u}=d,p=void 0!==l,f=L(n,d.onValueNodeChange);return ue(()=>{u(p)},[u,p]),t(H.span,{...c,ref:f,style:{pointerEvents:"none"},children:Lo(d.value)?t(o,{children:s}):l})});no.displayName=to;var oo=r.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,...a}=e;return t(H.span,{"aria-hidden":!0,...a,ref:n,children:r||"▼"})});oo.displayName="SelectIcon";var ro=e=>t(We,{asChild:!0,...e});ro.displayName="SelectPortal";var ao="SelectContent",io=r.forwardRef((e,n)=>{const o=qn(ao,e.__scopeSelect),[a,i]=r.useState();if(ue(()=>{i(new DocumentFragment)},[]),!o.open){const n=a;return n?f.createPortal(t(so,{scope:e.__scopeSelect,children:t(Hn.Slot,{scope:e.__scopeSelect,children:t("div",{children:e.children})})}),n):null}return t(po,{...e,ref:n})});io.displayName=ao;var lo=10,[so,co]=$n(ao),uo=function(e){const n=In(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,l=r.Children.toArray(a),s=l.find(Ln);if(s){const e=s.props.children,a=l.map(t=>t===s?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return t(n,{...i,ref:o,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return t(n,{...i,ref:o,children:a})});return o.displayName=`${e}.Slot`,o}("SelectContent.RemoveScroll"),po=r.forwardRef((e,n)=>{const{__scopeSelect:o,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:s,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:y,...b}=e,w=qn(ao,o),[x,S]=r.useState(null),[C,E]=r.useState(null),k=L(n,e=>S(e)),[R,P]=r.useState(null),[O,N]=r.useState(null),_=Vn(o),[D,M]=r.useState(!1),I=r.useRef(!1);r.useEffect(()=>{if(x)return et(x)},[x]),Q();const T=r.useCallback(e=>{const[t,...n]=_().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&C&&(C.scrollTop=0),n===o&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==r)return}},[_,C]),F=r.useCallback(()=>T([R,x]),[T,R,x]);r.useEffect(()=>{D&&F()},[D,F]);const{onOpenChange:j,triggerPointerDownPosRef:z}=w;r.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||j(!1),document.removeEventListener("pointermove",t),z.current=null};return null!==z.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,j,z]),r.useEffect(()=>{const e=()=>j(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[j]);const[W,B]=Fo(e=>{const t=_().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=jo(t,e,n);o&&setTimeout(()=>o.ref.current.focus())}),H=r.useCallback((e,t,n)=>{const o=!I.current&&!n;(void 0!==w.value&&w.value===t||o)&&(P(e),o&&(I.current=!0))},[w.value]),V=r.useCallback(()=>x?.focus(),[x]),K=r.useCallback((e,t,n)=>{const o=!I.current&&!n;(void 0!==w.value&&w.value===t||o)&&N(e)},[w.value]),$="popper"===a?mo:fo,U=$===mo?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:y}:{};return t(so,{scope:o,content:x,viewport:C,onViewportChange:E,itemRefCallback:H,selectedItem:R,onItemLeave:V,itemTextRefCallback:K,focusSelectedItem:F,selectedItemText:O,position:a,isPositioned:D,searchRef:W,children:t(Wt,{as:uo,allowPinchZoom:!0,children:t(re,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:A(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t(q,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:t($,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...U,onPlaced:()=>M(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:A(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=_().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>T(t)),e.preventDefault()}})})})})})})});po.displayName="SelectContentImpl";var fo=r.forwardRef((e,n)=>{const{__scopeSelect:o,onPlaced:a,...i}=e,l=qn(ao,o),s=co(ao,o),[c,d]=r.useState(null),[u,p]=r.useState(null),f=L(n,e=>p(e)),m=Vn(o),h=r.useRef(!1),v=r.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:b,focusSelectedItem:w}=s,x=r.useCallback(()=>{if(l.trigger&&l.valueNode&&c&&u&&g&&y&&b){const e=l.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=l.valueNode.getBoundingClientRect(),o=b.getBoundingClientRect();if("rtl"!==l.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,l=e.width+i,s=Math.max(l,t.width),d=window.innerWidth-lo,u=Rn(a,[lo,Math.max(lo,d-s)]);c.style.minWidth=l+"px",c.style.left=u+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,l=e.width+i,s=Math.max(l,t.width),d=window.innerWidth-lo,u=Rn(a,[lo,Math.max(lo,d-s)]);c.style.minWidth=l+"px",c.style.right=u+"px"}const r=m(),i=window.innerHeight-2*lo,s=g.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),f=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),w=p+f+s+parseInt(d.paddingBottom,10)+v,x=Math.min(5*y.offsetHeight,w),S=window.getComputedStyle(g),C=parseInt(S.paddingTop,10),E=parseInt(S.paddingBottom,10),k=e.top+e.height/2-lo,R=i-k,P=y.offsetHeight/2,O=p+f+(y.offsetTop+P),N=w-O;if(O<=k){const e=r.length>0&&y===r[r.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-g.offsetTop-g.offsetHeight,n=O+Math.max(R,P+(e?E:0)+t+v);c.style.height=n+"px"}else{const e=r.length>0&&y===r[0].ref.current;c.style.top="0px";const t=Math.max(k,p+g.offsetTop+(e?C:0)+P)+N;c.style.height=t+"px",g.scrollTop=O-k+g.offsetTop}c.style.margin=`${lo}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>h.current=!0)}},[m,l.trigger,l.valueNode,c,u,g,y,b,l.dir,a]);ue(()=>x(),[x]);const[S,C]=r.useState();ue(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const E=r.useCallback(e=>{e&&!0===v.current&&(x(),w?.(),v.current=!1)},[x,w]);return t(ho,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:E,children:t("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:t(H.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});fo.displayName="SelectItemAlignedPosition";var mo=r.forwardRef((e,n)=>{const{__scopeSelect:o,align:r="start",collisionPadding:a=lo,...i}=e,l=Xn(o);return t(je,{...l,...i,ref:n,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});mo.displayName="SelectPopperPosition";var[ho,vo]=$n(ao,{}),go="SelectViewport",yo=r.forwardRef((e,a)=>{const{__scopeSelect:i,nonce:l,...s}=e,c=co(go,i),d=vo(go,i),u=L(a,c.onViewportChange),p=r.useRef(0);return n(o,{children:[t("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),t(Hn.Slot,{scope:i,children:t(H.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:A(s.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=d;if(o?.current&&n){const e=Math.abs(p.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*lo,r=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(r,a);if(i<o){const r=i+e,a=Math.min(o,r),l=r-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=l>0?l:0,n.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});yo.displayName=go;var bo="SelectGroup",[wo,xo]=$n(bo);r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=me();return t(wo,{scope:o,id:a,children:t(H.div,{role:"group","aria-labelledby":a,...r,ref:n})})}).displayName=bo;var So="SelectLabel";r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=xo(So,o);return t(H.div,{id:a.id,...r,ref:n})}).displayName=So;var Co="SelectItem",[Eo,ko]=$n(Co),Ro=r.forwardRef((e,n)=>{const{__scopeSelect:o,value:a,disabled:i=!1,textValue:l,...s}=e,c=qn(Co,o),d=co(Co,o),u=c.value===a,[p,f]=r.useState(l??""),[m,h]=r.useState(!1),v=L(n,e=>d.itemRefCallback?.(e,a,i)),g=me(),y=r.useRef("touch"),b=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};if(""===a)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t(Eo,{scope:o,value:a,disabled:i,textId:g,isSelected:u,onItemTextChange:r.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:t(Hn.ItemSlot,{scope:o,value:a,disabled:i,textValue:p,children:t(H.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:v,onFocus:A(s.onFocus,()=>h(!0)),onBlur:A(s.onBlur,()=>h(!1)),onClick:A(s.onClick,()=>{"mouse"!==y.current&&b()}),onPointerUp:A(s.onPointerUp,()=>{"mouse"===y.current&&b()}),onPointerDown:A(s.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:A(s.onPointerMove,e=>{y.current=e.pointerType,i?d.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:A(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:A(s.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(Wn.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});Ro.displayName=Co;var Po="SelectItemText",Oo=r.forwardRef((e,a)=>{const{__scopeSelect:i,className:l,style:s,...c}=e,d=qn(Po,i),u=co(Po,i),p=ko(Po,i),m=Gn(Po,i),[h,v]=r.useState(null),g=L(a,e=>v(e),p.onItemTextChange,e=>u.itemTextRefCallback?.(e,p.value,p.disabled)),y=h?.textContent,b=r.useMemo(()=>t("option",{value:p.value,disabled:p.disabled,children:y},p.value),[p.disabled,p.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=m;return ue(()=>(w(b),()=>x(b)),[w,x,b]),n(o,{children:[t(H.span,{id:p.textId,...c,ref:g}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren?f.createPortal(c.children,d.valueNode):null]})});Oo.displayName=Po;var No="SelectItemIndicator",_o=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return ko(No,o).isSelected?t(H.span,{"aria-hidden":!0,...r,ref:n}):null});_o.displayName=No;var Do="SelectScrollUpButton";r.forwardRef((e,n)=>{const o=co(Do,e.__scopeSelect),a=vo(Do,e.__scopeSelect),[i,l]=r.useState(!1),s=L(n,a.onScrollButtonChange);return ue(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;l(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t(Ao,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=Do;var Mo="SelectScrollDownButton";r.forwardRef((e,n)=>{const o=co(Mo,e.__scopeSelect),a=vo(Mo,e.__scopeSelect),[i,l]=r.useState(!1),s=L(n,a.onScrollButtonChange);return ue(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;l(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t(Ao,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=Mo;var Ao=r.forwardRef((e,n)=>{const{__scopeSelect:o,onAutoScroll:a,...i}=e,l=co("SelectScrollButton",o),s=r.useRef(null),c=Vn(o),d=r.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return r.useEffect(()=>()=>d(),[d]),ue(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),t(H.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:A(i.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(a,50))}),onPointerMove:A(i.onPointerMove,()=>{l.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(a,50))}),onPointerLeave:A(i.onPointerLeave,()=>{d()})})});r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return t(H.div,{"aria-hidden":!0,...r,ref:n})}).displayName="SelectSeparator";var Io="SelectArrow";r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=Xn(o),i=qn(Io,o),l=co(Io,o);return i.open&&"popper"===l.position?t(ze,{...a,...r,ref:n}):null}).displayName=Io;var To=r.forwardRef(({__scopeSelect:e,value:n,...o},a)=>{const i=r.useRef(null),l=L(a,i),s=Fn(n);return r.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,o=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&o){const t=new Event("change",{bubbles:!0});o.call(e,n),e.dispatchEvent(t)}},[s,n]),t(H.select,{...o,style:{...jn,...o.style},ref:l,defaultValue:n})});function Lo(e){return""===e||void 0===e}function Fo(e){const t=V(e),n=r.useRef(""),o=r.useRef(0),a=r.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),i=r.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,a,i]}function jo(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let a=(i=e,l=Math.max(r,0),i.map((e,t)=>i[(l+t)%i.length]));var i,l;1===o.length&&(a=a.filter(e=>e!==n));const s=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return s!==n?s:void 0}To.displayName="SelectBubbleInput";var zo=Jn,Wo=eo,Bo=no,Ho=oo,Vo=ro,Ko=io,$o=yo,Uo=Ro,Xo=Oo,Yo=_o;
1
+ import{s as e}from"./chunks/style-inject.es-e87a8d02.js";import{jsx as t,jsxs as n,Fragment as o}from"react/jsx-runtime";import*as r from"react";import a,{useState as i,useRef as l,useEffect as s,useMemo as c,useCallback as d,createContext as u,useContext as p}from"react";import*as f from"react-dom";import m from"react-dom";import{u as h,j as v,o as g,s as y,n as b,l as w,m as x,p as S,q as C}from"./chunks/floating-ui.react-dom-dc823237.js";import{_ as E,a as k,b as R}from"./chunks/_tslib-29461875.js";import{useYooptaEditor as O,Elements as P}from"@yoopta/editor";import{d as N,Z as _,O as D}from"./chunks/debounce-c595d128.js";import{c as M}from"./chunks/createLucideIcon-8605f860.js";function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}function I(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function T(...e){return t=>{let n=!1;const o=e.map(e=>{const o=I(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():I(e[t],null)}}}}function L(...e){return r.useCallback(T(...e),e)}function F(e,n=[]){let o=[];const a=()=>{const t=o.map(e=>r.createContext(e));return function(n){const o=n?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return a.scopeName=e,[function(n,a){const i=r.createContext(a),l=o.length;o=[...o,a];const s=n=>{const{scope:o,children:a,...s}=n,c=o?.[e]?.[l]||i,d=r.useMemo(()=>s,Object.values(s));return t(c.Provider,{value:d,children:a})};return s.displayName=n+"Provider",[s,function(t,o){const s=o?.[e]?.[l]||i,c=r.useContext(s);if(c)return c;if(void 0!==a)return a;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},j(a,...n)]}function j(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function z(e){const t=r.forwardRef((e,t)=>{const{children:n,...o}=e;if(r.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(a.ref=t?T(t,e):e),r.cloneElement(n,a)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}e(":root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-primary:221.2 83.2% 53.3%;--yoopta-ui-primary-foreground:210 40% 98%;--yoopta-ui-destructive:0 84.2% 60.2%;--yoopta-ui-destructive-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-radius-sm:0.375rem;--yoopta-ui-radius:0.5rem;--yoopta-ui-radius-lg:0.625rem;--yoopta-ui-z-dropdown:50;--yoopta-ui-z-sticky:100;--yoopta-ui-z-overlay:200;--yoopta-ui-z-modal:9999;--yoopta-ui-transition-fast:100ms ease;--yoopta-ui-transition:150ms ease;--yoopta-ui-transition-slow:200ms ease}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -2px rgba(0,0,0,.3);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.5),0 4px 16px -4px rgba(0,0,0,.3)}:root{--yoopta-ui-element-options-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-element-options-content-min-width:180px;--yoopta-ui-element-options-content-padding:8px;--yoopta-ui-element-options-content-radius:0.5rem;--yoopta-ui-element-options-content-z-index:50;--yoopta-ui-element-options-trigger-padding:4px;--yoopta-ui-element-options-trigger-radius:4px;--yoopta-ui-element-options-trigger-icon-size:16px;--yoopta-ui-element-options-control-padding-y:6px;--yoopta-ui-element-options-control-padding-x:10px;--yoopta-ui-element-options-control-radius:6px;--yoopta-ui-element-options-control-font-size:13px;--yoopta-ui-element-options-toggle-width:36px;--yoopta-ui-element-options-toggle-height:20px;--yoopta-ui-element-options-toggle-thumb-size:16px;--yoopta-ui-element-options-transition:background-color 0.15s ease,border-color 0.15s ease,opacity 0.15s ease,transform 0.15s ease}[data-element-options-root]{position:relative}[data-element-options-trigger]{align-items:center;background:transparent;border:none;border-radius:var(--yoopta-ui-element-options-trigger-radius);cursor:pointer;display:inline-flex;justify-content:center;padding:var(--yoopta-ui-element-options-trigger-padding);transition:var(--yoopta-ui-element-options-transition)}[data-element-options-trigger]:hover{background-color:hsl(var(--yoopta-ui-accent))}[data-element-options-trigger]:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring)/.5);outline-offset:2px}[data-element-options-trigger] .yoopta-ui-element-options-trigger-icon{color:hsl(var(--yoopta-ui-muted-foreground));height:var(--yoopta-ui-element-options-trigger-icon-size);width:var(--yoopta-ui-element-options-trigger-icon-size)}[data-element-options-content]{background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-content-radius);box-shadow:var(--yoopta-ui-element-options-shadow);min-width:var(--yoopta-ui-element-options-content-min-width);padding:var(--yoopta-ui-element-options-content-padding);z-index:var(--yoopta-ui-element-options-content-z-index)}[data-element-options-group]{display:flex;flex-direction:column;gap:6px}[data-element-options-group]+[data-element-options-group]{margin-top:8px}[data-element-options-label]{color:hsl(var(--yoopta-ui-muted-foreground));font-size:12px;font-weight:500}[data-element-options-separator]{background-color:hsl(var(--yoopta-ui-border));height:1px;margin:8px 0}[data-element-options-select]{align-items:center;background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-control-radius);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-element-options-control-font-size);justify-content:space-between;padding:var(--yoopta-ui-element-options-control-padding-y) var(--yoopta-ui-element-options-control-padding-x);transition:var(--yoopta-ui-element-options-transition);width:100%}[data-element-options-select]:hover{border-color:hsl(var(--yoopta-ui-muted-foreground))}[data-element-options-select]:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring)/.5);outline-offset:2px}[data-element-options-select-value]{align-items:center;display:flex;gap:8px}[data-element-options-select-chevron]{color:hsl(var(--yoopta-ui-muted-foreground));height:14px;transition:var(--yoopta-ui-element-options-transition);width:14px}[data-element-options-select][data-state=open] [data-element-options-select-chevron]{transform:rotate(180deg)}[data-element-options-select-content]{background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-control-radius);box-shadow:var(--yoopta-ui-element-options-shadow);min-width:var(--radix-select-trigger-width,140px);padding:4px;z-index:calc(var(--yoopta-ui-element-options-content-z-index) + 1)}[data-element-options-select-item]{align-items:center;background:transparent;border:none;border-radius:4px;color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-element-options-control-font-size);justify-content:space-between;padding:var(--yoopta-ui-element-options-control-padding-y) 8px;text-align:left;transition:var(--yoopta-ui-element-options-transition);width:100%}[data-element-options-select-item]:hover{background-color:hsl(var(--yoopta-ui-accent))}[data-element-options-select-item][data-selected=true]{background-color:hsl(var(--yoopta-ui-primary)/.1)}[data-element-options-select-item-content]{align-items:center;display:flex;gap:8px}[data-element-options-select-check]{color:hsl(var(--yoopta-ui-primary));height:14px;width:14px}[data-element-options-select-icon]{align-items:center;display:flex;height:16px;justify-content:center;width:16px}[data-element-options-select-color]{border:1px solid hsl(var(--yoopta-ui-border));border-radius:50%;display:inline-block;height:12px;width:12px}[data-element-options-color-picker]{align-items:center;background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-control-radius);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-element-options-control-font-size);gap:8px;padding:var(--yoopta-ui-element-options-control-padding-y) var(--yoopta-ui-element-options-control-padding-x);transition:var(--yoopta-ui-element-options-transition);width:100%}[data-element-options-color-picker]:hover{border-color:hsl(var(--yoopta-ui-muted-foreground))}[data-element-options-color-preview]{border:1px solid hsl(var(--yoopta-ui-border));border-radius:4px;display:inline-block;height:20px;width:20px}[data-element-options-color-value]{color:hsl(var(--yoopta-ui-muted-foreground));font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:12px}[data-element-options-color-picker-content]{background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-content-radius);box-shadow:var(--yoopta-ui-element-options-shadow);padding:12px;z-index:calc(var(--yoopta-ui-element-options-content-z-index) + 1)}[data-element-options-color-picker-content] .react-colorful{height:150px;width:180px}[data-element-options-color-presets]{border-top:1px solid hsl(var(--yoopta-ui-border));display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;padding-top:10px}[data-element-options-color-preset]{border:2px solid transparent;border-radius:4px;cursor:pointer;height:20px;padding:0;transition:var(--yoopta-ui-element-options-transition);width:20px}[data-element-options-color-preset]:hover{transform:scale(1.1)}[data-element-options-color-preset][data-selected=true]{border-color:hsl(var(--yoopta-ui-primary))}[data-element-options-color-hex-row]{align-items:center;border-top:1px solid hsl(var(--yoopta-ui-border));display:flex;gap:8px;margin-top:10px;padding-top:10px}[data-element-options-color-swatch]{border:1px solid hsl(var(--yoopta-ui-border));border-radius:6px;flex-shrink:0;height:26px;width:26px}[data-element-options-color-hex-input]{background:transparent;border:1px solid hsl(var(--yoopta-ui-border));border-radius:6px;color:hsl(var(--yoopta-ui-foreground));flex:1;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:12px;height:26px;min-width:0;outline:none;padding:0 10px;transition:var(--yoopta-ui-element-options-transition)}[data-element-options-color-hex-input]:focus{border-color:hsl(var(--yoopta-ui-primary));box-shadow:0 0 0 2px hsl(var(--yoopta-ui-primary)/.15)}[data-element-options-toggle-wrapper]{align-items:center;display:flex;gap:8px}[data-element-options-toggle]{all:unset;align-items:center;background-color:hsl(var(--yoopta-ui-border));border-radius:10px;cursor:pointer;display:inline-flex;height:var(--yoopta-ui-element-options-toggle-height);transition:var(--yoopta-ui-element-options-transition);width:var(--yoopta-ui-element-options-toggle-width)}[data-element-options-toggle][data-state=checked]{background-color:hsl(var(--yoopta-ui-primary))}[data-element-options-toggle-thumb]{background-color:hsl(var(--yoopta-ui-background));border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.1);display:block;height:var(--yoopta-ui-element-options-toggle-thumb-size);transform:translateX(2px);transition:var(--yoopta-ui-element-options-transition);width:var(--yoopta-ui-element-options-toggle-thumb-size)}[data-element-options-toggle][data-state=checked] [data-element-options-toggle-thumb]{transform:translateX(18px)}[data-element-options-toggle-label]{color:hsl(var(--yoopta-ui-foreground));font-size:var(--yoopta-ui-element-options-control-font-size)}[data-element-options-slider]{align-items:center;display:flex;gap:10px}[data-element-options-slider-root]{align-items:center;cursor:pointer;display:flex;flex:1;height:14px;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-element-options-slider-track]{background-color:hsl(var(--yoopta-ui-border));border-radius:2px;flex-grow:1;height:4px;overflow:hidden;position:relative}[data-element-options-slider-range]{background-color:hsl(var(--yoopta-ui-primary));border-radius:2px;height:100%;position:absolute}[data-element-options-slider-thumb]{all:unset;background-color:hsl(var(--yoopta-ui-background));border:2px solid hsl(var(--yoopta-ui-primary));border-radius:50%;cursor:pointer;display:block;height:14px;transition:var(--yoopta-ui-element-options-transition);width:14px}[data-element-options-slider-thumb]:hover{transform:scale(1.1)}[data-element-options-slider-thumb]:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring)/.5);outline-offset:2px}[data-element-options-slider-value]{color:hsl(var(--yoopta-ui-muted-foreground));font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:12px;min-width:32px;text-align:right}[data-element-options-input]{background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-element-options-control-radius);color:hsl(var(--yoopta-ui-foreground));font-size:var(--yoopta-ui-element-options-control-font-size);padding:var(--yoopta-ui-element-options-control-padding-y) var(--yoopta-ui-element-options-control-padding-x);transition:var(--yoopta-ui-element-options-transition);width:100%}[data-element-options-input]:hover{border-color:hsl(var(--yoopta-ui-muted-foreground))}[data-element-options-input]:focus{border-color:hsl(var(--yoopta-ui-primary));box-shadow:0 0 0 2px hsl(var(--yoopta-ui-primary)/.1);outline:none}[data-element-options-input]::-moz-placeholder{color:hsl(var(--yoopta-ui-muted-foreground))}[data-element-options-input]::placeholder{color:hsl(var(--yoopta-ui-muted-foreground))}");var W=Symbol("radix.slottable");function B(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===W}var H=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{const o=function(e){const n=z(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,l=r.Children.toArray(a),s=l.find(B);if(s){const e=s.props.children,a=l.map(t=>t===s?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return t(n,{...i,ref:o,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return t(n,{...i,ref:o,children:a})});return o.displayName=`${e}.Slot`,o}(`Primitive.${n}`),a=r.forwardRef((e,r)=>{const{asChild:a,...i}=e,l=a?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(l,{...i,ref:r})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function V(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var K,$="dismissableLayer.update",U="dismissableLayer.pointerDownOutside",X="dismissableLayer.focusOutside",Y=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),q=r.forwardRef((e,n)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:s,onDismiss:c,...d}=e,u=r.useContext(Y),[p,f]=r.useState(null),m=p?.ownerDocument??globalThis?.document,[,h]=r.useState({}),v=L(n,e=>f(e)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(y),w=p?g.indexOf(p):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,C=function(e,t=globalThis?.document){const n=V(e),o=r.useRef(!1),a=r.useRef(()=>{});return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let o=function(){G(U,n,r,{discrete:!0})};const r={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=o,t.addEventListener("click",a.current,{once:!0})):o()}else t.removeEventListener("click",a.current);o.current=!1},r=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(r),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));S&&!n&&(i?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=function(e,t=globalThis?.document){const n=V(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){G(X,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(l?.(e),s?.(e),e.defaultPrevented||c?.())},m);return function(e,t=globalThis?.document){const n=V(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===u.layers.size-1&&(a?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},m),r.useEffect(()=>{if(p)return o&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(K=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),Z(),()=>{o&&1===u.layersWithOutsidePointerEventsDisabled.size&&(m.body.style.pointerEvents=K)}},[p,m,o,u]),r.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),Z())},[p,u]),r.useEffect(()=>{const e=()=>h({});return document.addEventListener($,e),()=>document.removeEventListener($,e)},[]),t(H.div,{...d,ref:v,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,E.onFocusCapture),onBlurCapture:A(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,C.onPointerDownCapture)})});q.displayName="DismissableLayer";function Z(){const e=new CustomEvent($);document.dispatchEvent(e)}function G(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?function(e,t){e&&f.flushSync(()=>e.dispatchEvent(t))}(r,a):r.dispatchEvent(a)}r.forwardRef((e,n)=>{const o=r.useContext(Y),a=r.useRef(null),i=L(n,a);return r.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),t(H.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var J=0;function Q(){r.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ee()),document.body.insertAdjacentElement("beforeend",e[1]??ee()),J++,()=>{1===J&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),J--}},[])}function ee(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var te="focusScope.autoFocusOnMount",ne="focusScope.autoFocusOnUnmount",oe={bubbles:!1,cancelable:!0},re=r.forwardRef((e,n)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...s}=e,[c,d]=r.useState(null),u=V(i),p=V(l),f=r.useRef(null),m=L(n,e=>d(e)),h=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(a){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:se(f.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||se(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&se(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return c&&o.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[a,c,h.paused]),r.useEffect(()=>{if(c){ce.add(h);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(te,oe);c.addEventListener(te,u),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(se(o,{select:t}),document.activeElement!==n)return}((e=ae(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&se(c))}return()=>{c.removeEventListener(te,u),setTimeout(()=>{const e=new CustomEvent(ne,oe);c.addEventListener(ne,p),c.dispatchEvent(e),e.defaultPrevented||se(t??document.body,{select:!0}),c.removeEventListener(ne,p),ce.remove(h)},0)}}var e},[c,u,p,h]);const v=r.useCallback(e=>{if(!o&&!a)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=ae(e),n=ie(t,e),o=ie(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&se(a,{select:!0})):(e.preventDefault(),o&&se(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return t(H.div,{tabIndex:-1,...s,ref:m,onKeyDown:v})});function ae(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ie(e,t){for(const n of e)if(!le(n,{upTo:t}))return n}function le(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function se(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}re.displayName="FocusScope";var ce=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=de(e,t),e.unshift(t)},remove(t){e=de(e,t),e[0]?.resume()}}}();function de(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var ue=globalThis?.document?r.useLayoutEffect:()=>{},pe=r[" useId ".trim().toString()]||(()=>{}),fe=0;function me(e){const[t,n]=r.useState(pe());return ue(()=>{e||n(e=>e??String(fe++))},[e]),e||(t?`radix-${t}`:"")}var he=r.forwardRef((e,n)=>{const{children:o,width:r=10,height:a=5,...i}=e;return t(H.svg,{...i,ref:n,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:t("polygon",{points:"0,0 30,0 15,10"})})});he.displayName="Arrow";var ve=he;function ge(e){const[t,n]=r.useState(void 0);return ue(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,a;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var ye="Popper",[be,we]=F(ye),[xe,Se]=be(ye),Ce=e=>{const{__scopePopper:n,children:o}=e,[a,i]=r.useState(null);return t(xe,{scope:n,anchor:a,onAnchorChange:i,children:o})};Ce.displayName=ye;var Ee="PopperAnchor",ke=r.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:a,...i}=e,l=Se(Ee,o),s=r.useRef(null),c=L(n,s),d=r.useRef(null);return r.useEffect(()=>{const e=d.current;d.current=a?.current||s.current,e!==d.current&&l.onAnchorChange(d.current)}),a?null:t(H.div,{...i,ref:c})});ke.displayName=Ee;var Re="PopperContent",[Oe,Pe]=be(Re),Ne=r.forwardRef((e,n)=>{const{__scopePopper:o,side:a="bottom",sideOffset:i=0,align:l="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:E="optimized",onPlaced:k,...R}=e,O=Se(Re,o),[P,N]=r.useState(null),_=L(n,e=>N(e)),[D,M]=r.useState(null),A=ge(D),I=A?.width??0,T=A?.height??0,F=a+("center"!==l?"-"+l:""),j="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},z=Array.isArray(u)?u:[u],W=z.length>0,B={padding:j,boundary:z.filter(Ae),altBoundary:W},{refs:K,floatingStyles:$,placement:U,isPositioned:X,middlewareData:Y}=h({strategy:"fixed",placement:F,whileElementsMounted:(...e)=>v(...e,{animationFrame:"always"===E}),elements:{reference:O.anchor},middleware:[g({mainAxis:i+T,alignmentAxis:s}),d&&y({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?b():void 0,...B}),d&&w({...B}),x({...B,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),D&&S({element:D,padding:c}),Ie({arrowWidth:I,arrowHeight:T}),m&&C({strategy:"referenceHidden",...B})]}),[q,Z]=Te(U),G=V(k);ue(()=>{X&&G?.()},[X,G]);const J=Y.arrow?.x,Q=Y.arrow?.y,ee=0!==Y.arrow?.centerOffset,[te,ne]=r.useState();return ue(()=>{P&&ne(window.getComputedStyle(P).zIndex)},[P]),t("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:X?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t(Oe,{scope:o,placedSide:q,onArrowChange:M,arrowX:J,arrowY:Q,shouldHideArrow:ee,children:t(H.div,{"data-side":q,"data-align":Z,...R,ref:_,style:{...R.style,animation:X?void 0:"none"}})})})});Ne.displayName=Re;var _e="PopperArrow",De={top:"bottom",right:"left",bottom:"top",left:"right"},Me=r.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,a=Pe(_e,o),i=De[a.placedSide];return t("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t(ve,{...r,ref:n,style:{...r.style,display:"block"}})})});function Ae(e){return null!==e}Me.displayName=_e;var Ie=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[s,c]=Te(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(r.arrow?.x??0)+i/2,p=(r.arrow?.y??0)+l/2;let f="",m="";return"bottom"===s?(f=a?d:`${u}px`,m=-l+"px"):"top"===s?(f=a?d:`${u}px`,m=`${o.floating.height+l}px`):"right"===s?(f=-l+"px",m=a?d:`${p}px`):"left"===s&&(f=`${o.floating.width+l}px`,m=a?d:`${p}px`),{data:{x:f,y:m}}}});function Te(e){const[t,n="center"]=e.split("-");return[t,n]}var Le=Ce,Fe=ke,je=Ne,ze=Me,We=r.forwardRef((e,n)=>{const{container:o,...a}=e,[i,l]=r.useState(!1);ue(()=>l(!0),[]);const s=o||i&&globalThis?.document?.body;return s?m.createPortal(t(H.div,{...a,ref:n}),s):null});We.displayName="Portal";var Be=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=r.useState(),o=r.useRef(null),a=r.useRef(e),i=r.useRef("none"),l=e?"mounted":"unmounted",[s,c]=function(e,t){return r.useReducer((e,n)=>t[e][n]??e,e)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=He(o.current);i.current="mounted"===s?e:"none"},[s]),ue(()=>{const t=o.current,n=a.current;if(n!==e){const o=i.current,r=He(t);if(e)c("MOUNT");else if("none"===r||"none"===t?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),ue(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const i=He(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&i&&(c("ANIMATION_END"),!a.current)){const o=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=o)})}},l=e=>{e.target===t&&(i.current=He(o.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),i=L(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||o.isPresent?r.cloneElement(a,{ref:i}):null};function He(e){return e?.animationName||"none"}function Ve(e){const t=r.forwardRef((e,t)=>{const{children:n,...o}=e;if(r.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(a.ref=t?T(t,e):e),r.cloneElement(n,a)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Be.displayName="Presence";var Ke=Symbol("radix.slottable");function $e(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ke}var Ue=r[" useInsertionEffect ".trim().toString()]||ue;function Xe({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[a,i,l]=function({defaultProp:e,onChange:t}){const[n,o]=r.useState(e),a=r.useRef(n),i=r.useRef(t);return Ue(()=>{i.current=t},[t]),r.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,o,i]}({defaultProp:t,onChange:n}),s=void 0!==e,c=s?e:a;{const t=r.useRef(void 0!==e);r.useEffect(()=>{const e=t.current;if(e!==s){const t=e?"controlled":"uncontrolled",n=s?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,o])}const d=r.useCallback(t=>{if(s){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&l.current?.(n)}else i(t)},[s,e,i,l]);return[c,d]}var Ye=new WeakMap,qe=new WeakMap,Ze={},Ge=0,Je=function(e){return e&&(e.host||Je(e.parentNode))},Qe=function(e,t,n,o){var r=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Je(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Ze[n]||(Ze[n]=new WeakMap);var a=Ze[n],i=[],l=new Set,s=new Set(r),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};r.forEach(c);var d=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(l.has(e))d(e);else try{var t=e.getAttribute(o),r=null!==t&&"false"!==t,s=(Ye.get(e)||0)+1,c=(a.get(e)||0)+1;Ye.set(e,s),a.set(e,c),i.push(e),1===s&&r&&qe.set(e,!0),1===c&&e.setAttribute(n,"true"),r||e.setAttribute(o,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),l.clear(),Ge++,function(){i.forEach(function(e){var t=Ye.get(e)-1,r=a.get(e)-1;Ye.set(e,t),a.set(e,r),t||(qe.has(e)||e.removeAttribute(o),qe.delete(e)),r||e.removeAttribute(n)}),--Ge||(Ye=new WeakMap,Ye=new WeakMap,qe=new WeakMap,Ze={})}},et=function(e,t,n){void 0===n&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Qe(o,r,n,"aria-hidden")):function(){return null}},tt="right-scroll-bar-position",nt="width-before-scroll-bar";function ot(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var rt="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,at=new WeakMap;function it(e,t){var n,o,r,a=(n=t||null,o=function(t){return e.forEach(function(e){return ot(e,t)})},(r=i(function(){return{value:n,callback:o,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0]).callback=o,r.facade);return rt(function(){var t=at.get(a);if(t){var n=new Set(t),o=new Set(e),r=a.current;n.forEach(function(e){o.has(e)||ot(e,null)}),o.forEach(function(e){n.has(e)||ot(e,r)})}at.set(a,e)},[e]),a}function lt(e){return e}var st=function(e){var t=e.sideCar,n=k(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return r.createElement(o,E({},n))};st.isSideCarExport=!0;var ct=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=lt);var n=[],o=!1;return{read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var r=t(e,o);return n.push(r),function(){n=n.filter(function(e){return e!==r})}},assignSyncMedium:function(e){for(o=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){o=!0;var t=[];if(n.length){var r=n;n=[],r.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=E({async:!0,ssr:!1},e),t}(),dt=function(){},ut=r.forwardRef(function(e,t){var n=r.useRef(null),o=r.useState({onScrollCapture:dt,onWheelCapture:dt,onTouchMoveCapture:dt}),a=o[0],i=o[1],l=e.forwardProps,s=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,f=e.sideCar,m=e.noRelative,h=e.noIsolation,v=e.inert,g=e.allowPinchZoom,y=e.as,b=void 0===y?"div":y,w=e.gapMode,x=k(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,C=it([n,t]),R=E(E({},x),a);return r.createElement(r.Fragment,null,u&&r.createElement(S,{sideCar:ct,removeScrollBar:d,shards:p,noRelative:m,noIsolation:h,inert:v,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:w}),l?r.cloneElement(r.Children.only(s),E(E({},R),{ref:C})):r.createElement(b,E({},R,{className:c,ref:C}),s))});ut.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ut.classNames={fullWidth:nt,zeroRight:tt};function pt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var ft=function(){var e=0,t=null;return{add:function(n){var o,r;0==e&&(t=pt())&&(r=n,(o=t).styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mt=function(){var e,t=(e=ft(),function(t,n){r.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,o=e.dynamic;return t(n,o),null}},ht={left:0,top:0,right:0,gap:0},vt=function(e){return parseInt(e||"",10)||0},gt=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return ht;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],o=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[vt(n),vt(o),vt(r)]}(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},yt=mt(),bt="data-scroll-locked",wt=function(e,t,n,o){var r=e.left,a=e.top,i=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(o,";\n padding-right: ").concat(l,"px ").concat(o,";\n }\n body[").concat(bt,"] {\n overflow: hidden ").concat(o,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(o,";"),"margin"===n&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(o,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(o,";")].filter(Boolean).join(""),"\n }\n \n .").concat(tt," {\n right: ").concat(l,"px ").concat(o,";\n }\n \n .").concat(nt," {\n margin-right: ").concat(l,"px ").concat(o,";\n }\n \n .").concat(tt," .").concat(tt," {\n right: 0 ").concat(o,";\n }\n \n .").concat(nt," .").concat(nt," {\n margin-right: 0 ").concat(o,";\n }\n \n body[").concat(bt,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},xt=function(){var e=parseInt(document.body.getAttribute(bt)||"0",10);return isFinite(e)?e:0},St=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,a=void 0===o?"margin":o;r.useEffect(function(){return document.body.setAttribute(bt,(xt()+1).toString()),function(){var e=xt()-1;e<=0?document.body.removeAttribute(bt):document.body.setAttribute(bt,e.toString())}},[]);var i=r.useMemo(function(){return gt(a)},[a]);return r.createElement(yt,{styles:wt(i,!t,a,n?"":"!important")})},Ct=!1;if("undefined"!=typeof window)try{var Et=Object.defineProperty({},"passive",{get:function(){return Ct=!0,!0}});window.addEventListener("test",Et,Et),window.removeEventListener("test",Et,Et)}catch(e){Ct=!1}var kt=!!Ct&&{passive:!1},Rt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Ot=function(e,t){var n=t.ownerDocument,o=t;do{if("undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot&&(o=o.host),Pt(e,o)){var r=Nt(e,o);if(r[1]>r[2])return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Pt=function(e,t){return"v"===e?function(e){return Rt(e,"overflowY")}(t):function(e){return Rt(e,"overflowX")}(t)},Nt=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},_t=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Dt=function(e){return[e.deltaX,e.deltaY]},Mt=function(e){return e&&"current"in e?e.current:e},At=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},It=0,Tt=[];function Lt(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ft,jt=(Ft=function(e){var t=r.useRef([]),n=r.useRef([0,0]),o=r.useRef(),a=r.useState(It++)[0],i=r.useState(mt)[0],l=r.useRef(e);r.useEffect(function(){l.current=e},[e]),r.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=R([e.lockRef.current],(e.shards||[]).map(Mt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var s=r.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!l.current.allowPinchZoom;var r,a=_t(e),i=n.current,s="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],d=e.target,u=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var p=window.getSelection(),f=p&&p.anchorNode;if(f&&(f===d||f.contains(d)))return!1;var m=Ot(u,d);if(!m)return!0;if(m?r=u:(r="v"===u?"h":"v",m=Ot(u,d)),!m)return!1;if(!o.current&&"changedTouches"in e&&(s||c)&&(o.current=r),!r)return!0;var h=o.current||r;return function(e,t,n,o,r){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*o,l=n.target,s=t.contains(l),c=!1,d=i>0,u=0,p=0;do{if(!l)break;var f=Nt(e,l),m=f[0],h=f[1]-f[2]-a*m;(m||h)&&Pt(e,l)&&(u+=h,p+=m);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!s&&l!==document.body||s&&(t.contains(l)||t===l));return(d&&(r&&Math.abs(u)<1||!r&&i>u)||!d&&(r&&Math.abs(p)<1||!r&&-i>p))&&(c=!0),c}(h,t,e,"h"===h?s:c,!0)},[]),c=r.useCallback(function(e){var n=e;if(Tt.length&&Tt[Tt.length-1]===i){var o="deltaY"in n?Dt(n):_t(n),r=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,r=o,t[0]===r[0]&&t[1]===r[1]);var t,r})[0];if(r&&r.should)n.cancelable&&n.preventDefault();else if(!r){var a=(l.current.shards||[]).map(Mt).filter(Boolean).filter(function(e){return e.contains(n.target)});(a.length>0?s(n,a[0]):!l.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),d=r.useCallback(function(e,n,o,r){var a={name:e,delta:n,target:o,should:r,shadowParent:Lt(o)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=r.useCallback(function(e){n.current=_t(e),o.current=void 0},[]),p=r.useCallback(function(t){d(t.type,Dt(t),t.target,s(t,e.lockRef.current))},[]),f=r.useCallback(function(t){d(t.type,_t(t),t.target,s(t,e.lockRef.current))},[]);r.useEffect(function(){return Tt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",c,kt),document.addEventListener("touchmove",c,kt),document.addEventListener("touchstart",u,kt),function(){Tt=Tt.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,kt),document.removeEventListener("touchmove",c,kt),document.removeEventListener("touchstart",u,kt)}},[]);var m=e.removeScrollBar,h=e.inert;return r.createElement(r.Fragment,null,h?r.createElement(i,{styles:At(a)}):null,m?r.createElement(St,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},ct.useMedium(Ft),st),zt=r.forwardRef(function(e,t){return r.createElement(ut,E({},e,{ref:t,sideCar:jt}))});zt.classNames=ut.classNames;var Wt=zt,Bt="Popover",[Ht,Vt]=F(Bt,[we]),Kt=we(),[$t,Ut]=Ht(Bt),Xt=e=>{const{__scopePopover:n,children:o,open:a,defaultOpen:i,onOpenChange:l,modal:s=!1}=e,c=Kt(n),d=r.useRef(null),[u,p]=r.useState(!1),[f,m]=Xe({prop:a,defaultProp:i??!1,onChange:l,caller:Bt});return t(Le,{...c,children:t($t,{scope:n,contentId:me(),triggerRef:d,open:f,onOpenChange:m,onOpenToggle:r.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:u,onCustomAnchorAdd:r.useCallback(()=>p(!0),[]),onCustomAnchorRemove:r.useCallback(()=>p(!1),[]),modal:s,children:o})})};Xt.displayName=Bt;var Yt="PopoverAnchor";r.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,i=Ut(Yt,o),l=Kt(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:c}=i;return r.useEffect(()=>(s(),()=>c()),[s,c]),t(Fe,{...l,...a,ref:n})}).displayName=Yt;var qt="PopoverTrigger",Zt=r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=Ut(qt,o),i=Kt(o),l=L(n,a.triggerRef),s=t(H.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":cn(a.open),...r,ref:l,onClick:A(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?s:t(Fe,{asChild:!0,...i,children:s})});Zt.displayName=qt;var Gt="PopoverPortal",[Jt,Qt]=Ht(Gt,{forceMount:void 0}),en=e=>{const{__scopePopover:n,forceMount:o,children:r,container:a}=e,i=Ut(Gt,n);return t(Jt,{scope:n,forceMount:o,children:t(Be,{present:o||i.open,children:t(We,{asChild:!0,container:a,children:r})})})};en.displayName=Gt;var tn="PopoverContent",nn=r.forwardRef((e,n)=>{const o=Qt(tn,e.__scopePopover),{forceMount:r=o.forceMount,...a}=e,i=Ut(tn,e.__scopePopover);return t(Be,{present:r||i.open,children:i.modal?t(rn,{...a,ref:n}):t(an,{...a,ref:n})})});nn.displayName=tn;var on=function(e){const n=Ve(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,l=r.Children.toArray(a),s=l.find($e);if(s){const e=s.props.children,a=l.map(t=>t===s?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return t(n,{...i,ref:o,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return t(n,{...i,ref:o,children:a})});return o.displayName=`${e}.Slot`,o}("PopoverContent.RemoveScroll"),rn=r.forwardRef((e,n)=>{const o=Ut(tn,e.__scopePopover),a=r.useRef(null),i=L(n,a),l=r.useRef(!1);return r.useEffect(()=>{const e=a.current;if(e)return et(e)},[]),t(Wt,{as:on,allowPinchZoom:!0,children:t(ln,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:A(e.onCloseAutoFocus,e=>{e.preventDefault(),l.current||o.triggerRef.current?.focus()}),onPointerDownOutside:A(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;l.current=o},{checkForDefaultPrevented:!1}),onFocusOutside:A(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),an=r.forwardRef((e,n)=>{const o=Ut(tn,e.__scopePopover),a=r.useRef(!1),i=r.useRef(!1);return t(ln,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||o.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const n=t.target,r=o.triggerRef.current?.contains(n);r&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),ln=r.forwardRef((e,n)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,f=Ut(tn,o),m=Kt(o);return Q(),t(re,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t(q,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:t(je,{"data-state":cn(f.open),role:"dialog",id:f.contentId,...m,...p,ref:n,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),sn="PopoverClose";r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=Ut(sn,o);return t(H.button,{type:"button",...r,ref:n,onClick:A(e.onClick,()=>a.onOpenChange(!1))})}).displayName=sn;function cn(e){return e?"open":"closed"}r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=Kt(o);return t(ze,{...a,...r,ref:n})}).displayName="PopoverArrow";var dn=Xt,un=Zt,pn=en,fn=nn;const mn=["#000000","#6B7280","#EF4444","#F59E0B","#22C55E","#3B82F6","#8B5CF6","#EC4899"],hn={width:"100%"},vn=({value:e,onChange:o,presetColors:r=mn,className:a,style:u})=>{const p=O(),[f,m]=i(e);l(e).current=e,s(()=>{m(e)},[e]);const h=c(()=>N(e=>{o(e)},300),[o]);s(()=>()=>{h.cancel()},[h]);const v=d(e=>{m(e),h(e)},[h]),g=d(e=>{h.cancel(),m(e),o(e)},[o,h]);return n(dn,{children:[t(un,Object.assign({asChild:!0},{children:n("button",Object.assign({type:"button",className:a,style:u,onMouseDown:e=>e.preventDefault(),"data-element-options-color-picker":!0},{children:[t("span",{"data-element-options-color-preview":!0,style:{backgroundColor:f}}),t("span",Object.assign({"data-element-options-color-value":!0},{children:f}))]}))})),t(pn,Object.assign({container:p.refElement},{children:n(fn,Object.assign({"data-element-options-color-picker-content":!0,side:"bottom",align:"start",sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),h.flush()},onMouseDown:e=>e.preventDefault()},{children:[t(_,{color:f,onChange:v,"data-element-options-color-picker-picker":!0,style:hn}),r.length>0&&t("div",Object.assign({"data-element-options-color-presets":!0},{children:r.map(e=>t("button",{type:"button","data-element-options-color-preset":!0,"data-selected":e.toLowerCase()===(null==f?void 0:f.toLowerCase()),style:{backgroundColor:e},onClick:()=>g(e),onMouseDown:e=>e.preventDefault(),"aria-label":`Select color ${e}`},e))})),n("div",Object.assign({"data-element-options-color-hex-row":!0},{children:[t("div",{"data-element-options-color-swatch":!0,style:{backgroundColor:f}}),t(D,{color:f,onChange:g,"data-element-options-color-hex-input":!0,prefixed:!0})]}))]}))}))]})};vn.displayName="ElementOptions.ColorPicker";const gn=u(null);function yn(){const e=p(gn);if(!e)throw new Error("useElementOptionsContext must be used within an ElementOptions.Root");return e}function bn(){const{blockId:e,element:t,editor:n,isOpen:o,setIsOpen:r}=yn();return{blockId:e,element:t,editor:n,isOpen:o,setIsOpen:r}}function wn(){const{blockId:e,element:t,editor:n}=yn();return o=>{P.updateElement(n,{blockId:e,type:t.type,props:Object.assign(Object.assign({},t.props),o)})}}gn.displayName="ElementOptionsContext";const xn=({children:e,className:n,style:o,side:r="bottom",align:a="end",sideOffset:i=4,alignOffset:l=0})=>{const{isOpen:s}=yn(),c=O();return s?t(pn,Object.assign({container:c.refElement},{children:t(fn,Object.assign({side:r,align:a,sideOffset:i,alignOffset:l,collisionPadding:8,className:n,style:o,"data-element-options-content":!0,"data-state":"open","data-side":r,"data-align":a,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault()},{children:e}))})):null};xn.displayName="ElementOptions.Content";const Sn=({children:e,className:n,style:o})=>t("div",Object.assign({className:n,style:o,"data-element-options-group":!0},{children:e}));Sn.displayName="ElementOptions.Group";const Cn=({value:e,onChange:n,placeholder:o,type:r="text",className:a,style:i})=>t("input",{type:r,value:e,onChange:e=>{n(e.target.value)},onMouseDown:e=>{e.stopPropagation()},placeholder:o,className:a,style:i,"data-element-options-input":!0});Cn.displayName="ElementOptions.Input";const En=({children:e,className:n,style:o})=>t("label",Object.assign({className:n,style:o,"data-element-options-label":!0},{children:e}));En.displayName="ElementOptions.Label";const kn=({blockId:e,element:n,children:o,className:r,style:a})=>{const l=O(),[s,d]=i(!1),u=c(()=>({blockId:e,element:n,editor:l,isOpen:s,setIsOpen:d}),[e,n,l,s]);return t(gn.Provider,Object.assign({value:u},{children:l.readOnly?null:t(dn,Object.assign({open:s,onOpenChange:d},{children:t("div",Object.assign({className:r,style:a,"data-element-options-root":!0,"data-state":s?"open":"closed"},{children:o}))}))}))};function Rn(e,[t,n]){return Math.min(n,Math.max(t,e))}function On(e){const n=Pn(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,l=r.Children.toArray(a),s=l.find(_n);if(s){const e=s.props.children,a=l.map(t=>t===s?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return t(n,{...i,ref:o,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return t(n,{...i,ref:o,children:a})});return o.displayName=`${e}.Slot`,o}function Pn(e){const t=r.forwardRef((e,t)=>{const{children:n,...o}=e;if(r.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(a.ref=t?T(t,e):e),r.cloneElement(n,a)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}kn.displayName="ElementOptions.Root";var Nn=Symbol("radix.slottable");function _n(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Nn}function Dn(e){const n=e+"CollectionProvider",[o,r]=F(n),[i,l]=o(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:o}=e,r=a.useRef(null),l=a.useRef(new Map).current;return t(i,{scope:n,itemMap:l,collectionRef:r,children:o})};s.displayName=n;const c=e+"CollectionSlot",d=On(c),u=a.forwardRef((e,n)=>{const{scope:o,children:r}=e,a=L(n,l(c,o).collectionRef);return t(d,{ref:a,children:r})});u.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",m=On(p),h=a.forwardRef((e,n)=>{const{scope:o,children:r,...i}=e,s=a.useRef(null),c=L(n,s),d=l(p,o);return a.useEffect(()=>(d.itemMap.set(s,{ref:s,...i}),()=>{d.itemMap.delete(s)})),t(m,{[f]:"",ref:c,children:r})});return h.displayName=p,[{Provider:s,Slot:u,ItemSlot:h},function(t){const n=l(e+"CollectionConsumer",t);return a.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},r]}var Mn=r.createContext(void 0);function An(e){const t=r.useContext(Mn);return e||t||"ltr"}function In(e){const t=r.forwardRef((e,t)=>{const{children:n,...o}=e;if(r.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(a.ref=t?T(t,e):e),r.cloneElement(n,a)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tn=Symbol("radix.slottable");function Ln(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Tn}function Fn(e){const t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var jn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});r.forwardRef((e,n)=>t(H.span,{...e,ref:n,style:{...jn,...e.style}})).displayName="VisuallyHidden";var zn=[" ","Enter","ArrowUp","ArrowDown"],Wn=[" ","Enter"],Bn="Select",[Hn,Vn,Kn]=Dn(Bn),[$n,Un]=F(Bn,[Kn,we]),Xn=we(),[Yn,qn]=$n(Bn),[Zn,Gn]=$n(Bn),Jn=e=>{const{__scopeSelect:o,children:a,open:i,defaultOpen:l,onOpenChange:s,value:c,defaultValue:d,onValueChange:u,dir:p,name:f,autoComplete:m,disabled:h,required:v,form:g}=e,y=Xn(o),[b,w]=r.useState(null),[x,S]=r.useState(null),[C,E]=r.useState(!1),k=An(p),[R,O]=Xe({prop:i,defaultProp:l??!1,onChange:s,caller:Bn}),[P,N]=Xe({prop:c,defaultProp:d,onChange:u,caller:Bn}),_=r.useRef(null),D=!b||(g||!!b.closest("form")),[M,A]=r.useState(new Set),I=Array.from(M).map(e=>e.props.value).join(";");return t(Le,{...y,children:n(Yn,{required:v,scope:o,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:me(),value:P,onValueChange:N,open:R,onOpenChange:O,dir:k,triggerPointerDownPosRef:_,disabled:h,children:[t(Hn.Provider,{scope:o,children:t(Zn,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{A(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:a})}),D?n(To,{"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:m,value:P,onChange:e=>N(e.target.value),disabled:h,form:g,children:[void 0===P?t("option",{value:""}):null,Array.from(M)]},I):null]})})};Jn.displayName=Bn;var Qn="SelectTrigger",eo=r.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:a=!1,...i}=e,l=Xn(o),s=qn(Qn,o),c=s.disabled||a,d=L(n,s.onTriggerChange),u=Vn(o),p=r.useRef("touch"),[f,m,h]=Fo(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),o=jo(t,e,n);void 0!==o&&s.onValueChange(o.value)}),v=e=>{c||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t(Fe,{asChild:!0,...l,children:t(H.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Lo(s.value)?"":void 0,...i,ref:d,onClick:A(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:A(i.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:A(i.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),t&&" "===e.key||zn.includes(e.key)&&(v(),e.preventDefault())})})})});eo.displayName=Qn;var to="SelectValue",no=r.forwardRef((e,n)=>{const{__scopeSelect:r,className:a,style:i,children:l,placeholder:s="",...c}=e,d=qn(to,r),{onValueNodeHasChildrenChange:u}=d,p=void 0!==l,f=L(n,d.onValueNodeChange);return ue(()=>{u(p)},[u,p]),t(H.span,{...c,ref:f,style:{pointerEvents:"none"},children:Lo(d.value)?t(o,{children:s}):l})});no.displayName=to;var oo=r.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,...a}=e;return t(H.span,{"aria-hidden":!0,...a,ref:n,children:r||"▼"})});oo.displayName="SelectIcon";var ro=e=>t(We,{asChild:!0,...e});ro.displayName="SelectPortal";var ao="SelectContent",io=r.forwardRef((e,n)=>{const o=qn(ao,e.__scopeSelect),[a,i]=r.useState();if(ue(()=>{i(new DocumentFragment)},[]),!o.open){const n=a;return n?f.createPortal(t(so,{scope:e.__scopeSelect,children:t(Hn.Slot,{scope:e.__scopeSelect,children:t("div",{children:e.children})})}),n):null}return t(po,{...e,ref:n})});io.displayName=ao;var lo=10,[so,co]=$n(ao),uo=function(e){const n=In(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,l=r.Children.toArray(a),s=l.find(Ln);if(s){const e=s.props.children,a=l.map(t=>t===s?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return t(n,{...i,ref:o,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return t(n,{...i,ref:o,children:a})});return o.displayName=`${e}.Slot`,o}("SelectContent.RemoveScroll"),po=r.forwardRef((e,n)=>{const{__scopeSelect:o,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:s,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:y,...b}=e,w=qn(ao,o),[x,S]=r.useState(null),[C,E]=r.useState(null),k=L(n,e=>S(e)),[R,O]=r.useState(null),[P,N]=r.useState(null),_=Vn(o),[D,M]=r.useState(!1),I=r.useRef(!1);r.useEffect(()=>{if(x)return et(x)},[x]),Q();const T=r.useCallback(e=>{const[t,...n]=_().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&C&&(C.scrollTop=0),n===o&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==r)return}},[_,C]),F=r.useCallback(()=>T([R,x]),[T,R,x]);r.useEffect(()=>{D&&F()},[D,F]);const{onOpenChange:j,triggerPointerDownPosRef:z}=w;r.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||j(!1),document.removeEventListener("pointermove",t),z.current=null};return null!==z.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,j,z]),r.useEffect(()=>{const e=()=>j(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[j]);const[W,B]=Fo(e=>{const t=_().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=jo(t,e,n);o&&setTimeout(()=>o.ref.current.focus())}),H=r.useCallback((e,t,n)=>{const o=!I.current&&!n;(void 0!==w.value&&w.value===t||o)&&(O(e),o&&(I.current=!0))},[w.value]),V=r.useCallback(()=>x?.focus(),[x]),K=r.useCallback((e,t,n)=>{const o=!I.current&&!n;(void 0!==w.value&&w.value===t||o)&&N(e)},[w.value]),$="popper"===a?mo:fo,U=$===mo?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:y}:{};return t(so,{scope:o,content:x,viewport:C,onViewportChange:E,itemRefCallback:H,selectedItem:R,onItemLeave:V,itemTextRefCallback:K,focusSelectedItem:F,selectedItemText:P,position:a,isPositioned:D,searchRef:W,children:t(Wt,{as:uo,allowPinchZoom:!0,children:t(re,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:A(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t(q,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:t($,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...U,onPlaced:()=>M(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:A(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=_().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>T(t)),e.preventDefault()}})})})})})})});po.displayName="SelectContentImpl";var fo=r.forwardRef((e,n)=>{const{__scopeSelect:o,onPlaced:a,...i}=e,l=qn(ao,o),s=co(ao,o),[c,d]=r.useState(null),[u,p]=r.useState(null),f=L(n,e=>p(e)),m=Vn(o),h=r.useRef(!1),v=r.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:b,focusSelectedItem:w}=s,x=r.useCallback(()=>{if(l.trigger&&l.valueNode&&c&&u&&g&&y&&b){const e=l.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=l.valueNode.getBoundingClientRect(),o=b.getBoundingClientRect();if("rtl"!==l.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,l=e.width+i,s=Math.max(l,t.width),d=window.innerWidth-lo,u=Rn(a,[lo,Math.max(lo,d-s)]);c.style.minWidth=l+"px",c.style.left=u+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,l=e.width+i,s=Math.max(l,t.width),d=window.innerWidth-lo,u=Rn(a,[lo,Math.max(lo,d-s)]);c.style.minWidth=l+"px",c.style.right=u+"px"}const r=m(),i=window.innerHeight-2*lo,s=g.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),f=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),w=p+f+s+parseInt(d.paddingBottom,10)+v,x=Math.min(5*y.offsetHeight,w),S=window.getComputedStyle(g),C=parseInt(S.paddingTop,10),E=parseInt(S.paddingBottom,10),k=e.top+e.height/2-lo,R=i-k,O=y.offsetHeight/2,P=p+f+(y.offsetTop+O),N=w-P;if(P<=k){const e=r.length>0&&y===r[r.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-g.offsetTop-g.offsetHeight,n=P+Math.max(R,O+(e?E:0)+t+v);c.style.height=n+"px"}else{const e=r.length>0&&y===r[0].ref.current;c.style.top="0px";const t=Math.max(k,p+g.offsetTop+(e?C:0)+O)+N;c.style.height=t+"px",g.scrollTop=P-k+g.offsetTop}c.style.margin=`${lo}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>h.current=!0)}},[m,l.trigger,l.valueNode,c,u,g,y,b,l.dir,a]);ue(()=>x(),[x]);const[S,C]=r.useState();ue(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const E=r.useCallback(e=>{e&&!0===v.current&&(x(),w?.(),v.current=!1)},[x,w]);return t(ho,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:E,children:t("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:t(H.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});fo.displayName="SelectItemAlignedPosition";var mo=r.forwardRef((e,n)=>{const{__scopeSelect:o,align:r="start",collisionPadding:a=lo,...i}=e,l=Xn(o);return t(je,{...l,...i,ref:n,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});mo.displayName="SelectPopperPosition";var[ho,vo]=$n(ao,{}),go="SelectViewport",yo=r.forwardRef((e,a)=>{const{__scopeSelect:i,nonce:l,...s}=e,c=co(go,i),d=vo(go,i),u=L(a,c.onViewportChange),p=r.useRef(0);return n(o,{children:[t("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),t(Hn.Slot,{scope:i,children:t(H.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:A(s.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=d;if(o?.current&&n){const e=Math.abs(p.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*lo,r=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(r,a);if(i<o){const r=i+e,a=Math.min(o,r),l=r-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=l>0?l:0,n.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});yo.displayName=go;var bo="SelectGroup",[wo,xo]=$n(bo);r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=me();return t(wo,{scope:o,id:a,children:t(H.div,{role:"group","aria-labelledby":a,...r,ref:n})})}).displayName=bo;var So="SelectLabel";r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=xo(So,o);return t(H.div,{id:a.id,...r,ref:n})}).displayName=So;var Co="SelectItem",[Eo,ko]=$n(Co),Ro=r.forwardRef((e,n)=>{const{__scopeSelect:o,value:a,disabled:i=!1,textValue:l,...s}=e,c=qn(Co,o),d=co(Co,o),u=c.value===a,[p,f]=r.useState(l??""),[m,h]=r.useState(!1),v=L(n,e=>d.itemRefCallback?.(e,a,i)),g=me(),y=r.useRef("touch"),b=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};if(""===a)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t(Eo,{scope:o,value:a,disabled:i,textId:g,isSelected:u,onItemTextChange:r.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:t(Hn.ItemSlot,{scope:o,value:a,disabled:i,textValue:p,children:t(H.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:v,onFocus:A(s.onFocus,()=>h(!0)),onBlur:A(s.onBlur,()=>h(!1)),onClick:A(s.onClick,()=>{"mouse"!==y.current&&b()}),onPointerUp:A(s.onPointerUp,()=>{"mouse"===y.current&&b()}),onPointerDown:A(s.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:A(s.onPointerMove,e=>{y.current=e.pointerType,i?d.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:A(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:A(s.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(Wn.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});Ro.displayName=Co;var Oo="SelectItemText",Po=r.forwardRef((e,a)=>{const{__scopeSelect:i,className:l,style:s,...c}=e,d=qn(Oo,i),u=co(Oo,i),p=ko(Oo,i),m=Gn(Oo,i),[h,v]=r.useState(null),g=L(a,e=>v(e),p.onItemTextChange,e=>u.itemTextRefCallback?.(e,p.value,p.disabled)),y=h?.textContent,b=r.useMemo(()=>t("option",{value:p.value,disabled:p.disabled,children:y},p.value),[p.disabled,p.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=m;return ue(()=>(w(b),()=>x(b)),[w,x,b]),n(o,{children:[t(H.span,{id:p.textId,...c,ref:g}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren?f.createPortal(c.children,d.valueNode):null]})});Po.displayName=Oo;var No="SelectItemIndicator",_o=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return ko(No,o).isSelected?t(H.span,{"aria-hidden":!0,...r,ref:n}):null});_o.displayName=No;var Do="SelectScrollUpButton";r.forwardRef((e,n)=>{const o=co(Do,e.__scopeSelect),a=vo(Do,e.__scopeSelect),[i,l]=r.useState(!1),s=L(n,a.onScrollButtonChange);return ue(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;l(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t(Ao,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=Do;var Mo="SelectScrollDownButton";r.forwardRef((e,n)=>{const o=co(Mo,e.__scopeSelect),a=vo(Mo,e.__scopeSelect),[i,l]=r.useState(!1),s=L(n,a.onScrollButtonChange);return ue(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;l(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t(Ao,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=Mo;var Ao=r.forwardRef((e,n)=>{const{__scopeSelect:o,onAutoScroll:a,...i}=e,l=co("SelectScrollButton",o),s=r.useRef(null),c=Vn(o),d=r.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return r.useEffect(()=>()=>d(),[d]),ue(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),t(H.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:A(i.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(a,50))}),onPointerMove:A(i.onPointerMove,()=>{l.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(a,50))}),onPointerLeave:A(i.onPointerLeave,()=>{d()})})});r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return t(H.div,{"aria-hidden":!0,...r,ref:n})}).displayName="SelectSeparator";var Io="SelectArrow";r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=Xn(o),i=qn(Io,o),l=co(Io,o);return i.open&&"popper"===l.position?t(ze,{...a,...r,ref:n}):null}).displayName=Io;var To=r.forwardRef(({__scopeSelect:e,value:n,...o},a)=>{const i=r.useRef(null),l=L(a,i),s=Fn(n);return r.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,o=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&o){const t=new Event("change",{bubbles:!0});o.call(e,n),e.dispatchEvent(t)}},[s,n]),t(H.select,{...o,style:{...jn,...o.style},ref:l,defaultValue:n})});function Lo(e){return""===e||void 0===e}function Fo(e){const t=V(e),n=r.useRef(""),o=r.useRef(0),a=r.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),i=r.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,a,i]}function jo(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let a=(i=e,l=Math.max(r,0),i.map((e,t)=>i[(l+t)%i.length]));var i,l;1===o.length&&(a=a.filter(e=>e!==n));const s=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return s!==n?s:void 0}To.displayName="SelectBubbleInput";var zo=Jn,Wo=eo,Bo=no,Ho=oo,Vo=ro,Ko=io,$o=yo,Uo=Ro,Xo=Po,Yo=_o;
2
2
  /**
3
3
  * @license lucide-react v0.294.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
- const qo=M("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Zo=M("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Go=M("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),Jo=({value:e,options:r,onValueChange:a,placeholder:i="Select...",className:l,style:s,renderOption:c,renderValue:d})=>{const u=P(),p=r.find(t=>t.value===e),f=e=>n(o,{children:[e.icon&&t("span",Object.assign({"data-element-options-select-icon":!0},{children:e.icon})),e.color&&t("span",{"data-element-options-select-color":!0,style:{backgroundColor:e.color}}),t("span",{children:e.label})]});return n(zo,Object.assign({value:e,onValueChange:e=>a(e)},{children:[n(Wo,Object.assign({className:l,style:s,"data-element-options-select":!0,onMouseDown:e=>e.preventDefault()},{children:[t(Bo,Object.assign({placeholder:i},{children:t("span",Object.assign({"data-element-options-select-value":!0},{children:d?d(p):(m=p,n(o,{children:[(null==m?void 0:m.icon)&&t("span",Object.assign({"data-element-options-select-icon":!0},{children:m.icon})),(null==m?void 0:m.color)&&t("span",{"data-element-options-select-color":!0,style:{backgroundColor:m.color}}),t("span",{children:null!==(h=null==m?void 0:m.label)&&void 0!==h?h:i})]}))}))})),t(Ho,{children:t(Zo,{"data-element-options-select-chevron":!0})})]})),t(Vo,Object.assign({container:u.refElement},{children:t(Ko,Object.assign({"data-element-options-select-content":!0,position:"popper",sideOffset:4,onCloseAutoFocus:e=>e.preventDefault()},{children:t($o,{children:r.map(o=>n(Uo,Object.assign({value:String(o.value),"data-element-options-select-item":!0,"data-selected":o.value===e},{children:[t(Xo,{children:t("span",Object.assign({"data-element-options-select-item-content":!0},{children:c?c(o):f(o)}))}),t(Yo,{children:t(qo,{"data-element-options-select-check":!0})})]}),String(o.value)))})}))}))]}));var m,h};
8
+ const qo=M("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Zo=M("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Go=M("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),Jo=({value:e,options:r,onValueChange:a,placeholder:i="Select...",className:l,style:s,renderOption:c,renderValue:d})=>{const u=O(),p=r.find(t=>t.value===e),f=e=>n(o,{children:[e.icon&&t("span",Object.assign({"data-element-options-select-icon":!0},{children:e.icon})),e.color&&t("span",{"data-element-options-select-color":!0,style:{backgroundColor:e.color}}),t("span",{children:e.label})]});return n(zo,Object.assign({value:e,onValueChange:e=>a(e)},{children:[n(Wo,Object.assign({className:l,style:s,"data-element-options-select":!0,onMouseDown:e=>e.preventDefault()},{children:[t(Bo,Object.assign({placeholder:i},{children:t("span",Object.assign({"data-element-options-select-value":!0},{children:d?d(p):(m=p,n(o,{children:[(null==m?void 0:m.icon)&&t("span",Object.assign({"data-element-options-select-icon":!0},{children:m.icon})),(null==m?void 0:m.color)&&t("span",{"data-element-options-select-color":!0,style:{backgroundColor:m.color}}),t("span",{children:null!==(h=null==m?void 0:m.label)&&void 0!==h?h:i})]}))}))})),t(Ho,{children:t(Zo,{"data-element-options-select-chevron":!0})})]})),t(Vo,Object.assign({container:u.refElement},{children:t(Ko,Object.assign({"data-element-options-select-content":!0,position:"popper",sideOffset:4,onCloseAutoFocus:e=>e.preventDefault()},{children:t($o,{children:r.map(o=>n(Uo,Object.assign({value:String(o.value),"data-element-options-select-item":!0,"data-selected":o.value===e},{children:[t(Xo,{children:t("span",Object.assign({"data-element-options-select-item-content":!0},{children:c?c(o):f(o)}))}),t(Yo,{children:t(qo,{"data-element-options-select-check":!0})})]}),String(o.value)))})}))}))]}));var m,h};
9
9
  /**
10
10
  * @license lucide-react v0.294.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
- */Jo.displayName="ElementOptions.Select";const Qo=({className:e,style:n})=>t("div",{className:e,style:n,"data-element-options-separator":!0,role:"separator","aria-orientation":"horizontal"});Qo.displayName="ElementOptions.Separator";var er=["PageUp","PageDown"],tr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],nr={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},or="Slider",[rr,ar,ir]=Dn(or),[lr,sr]=F(or,[ir]),[cr,dr]=lr(or),ur=r.forwardRef((e,n)=>{const{name:o,min:a=0,max:i=100,step:l=1,orientation:s="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:u=[a],value:p,onValueChange:f=()=>{},onValueCommit:m=()=>{},inverted:h=!1,form:v,...g}=e,y=r.useRef(new Set),b=r.useRef(0),w="horizontal"===s?mr:hr,[x=[],S]=Xe({prop:p,defaultProp:u,onChange:e=>{const t=[...y.current];t[b.current]?.focus(),f(e)}}),C=r.useRef(x);function E(e,t,{commit:n}={commit:!1}){const o=function(e){return(String(e).split(".")[1]||"").length}(l),r=function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}(Math.round((e-a)/l)*l+a,o),s=Rn(r,[a,i]);S((e=[])=>{const o=function(e=[],t,n){const o=[...e];return o[n]=t,o.sort((e,t)=>e-t)}(e,s,t);if(function(e,t){if(t>0){const n=function(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}(e);return Math.min(...n)>=t}return!0}(o,d*l)){b.current=o.indexOf(s);const t=String(o)!==String(e);return t&&n&&m(o),t?o:e}return e})}return t(cr,{scope:e.__scopeSlider,name:o,disabled:c,min:a,max:i,valueIndexToChangeRef:b,thumbs:y.current,values:x,orientation:s,form:v,children:t(rr.Provider,{scope:e.__scopeSlider,children:t(rr.Slot,{scope:e.__scopeSlider,children:t(w,{"aria-disabled":c,"data-disabled":c?"":void 0,...g,ref:n,onPointerDown:A(g.onPointerDown,()=>{c||(C.current=x)}),min:a,max:i,inverted:h,onSlideStart:c?void 0:function(e){const t=function(e,t){if(1===e.length)return 0;const n=e.map(e=>Math.abs(e-t)),o=Math.min(...n);return n.indexOf(o)}(x,e);E(e,t)},onSlideMove:c?void 0:function(e){E(e,b.current)},onSlideEnd:c?void 0:function(){const e=C.current[b.current];x[b.current]!==e&&m(x)},onHomeKeyDown:()=>!c&&E(a,0,{commit:!0}),onEndKeyDown:()=>!c&&E(i,x.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!c){const n=er.includes(e.key)||e.shiftKey&&tr.includes(e.key)?10:1,o=b.current;E(x[o]+l*n*t,o,{commit:!0})}}})})})})});ur.displayName=or;var[pr,fr]=lr(or,{startEdge:"left",endEdge:"right",size:"width",direction:1}),mr=r.forwardRef((e,n)=>{const{min:o,max:a,dir:i,inverted:l,onSlideStart:s,onSlideMove:c,onSlideEnd:d,onStepKeyDown:u,...p}=e,[f,m]=r.useState(null),h=L(n,e=>m(e)),v=r.useRef(void 0),g=An(i),y="ltr"===g,b=y&&!l||!y&&l;function w(e){const t=v.current||f.getBoundingClientRect(),n=Rr([0,t.width],b?[o,a]:[a,o]);return v.current=t,n(e-t.left)}return t(pr,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:t(vr,{dir:g,"data-orientation":"horizontal",...p,ref:h,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{const t=w(e.clientX);s?.(t)},onSlideMove:e=>{const t=w(e.clientX);c?.(t)},onSlideEnd:()=>{v.current=void 0,d?.()},onStepKeyDown:e=>{const t=nr[b?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),hr=r.forwardRef((e,n)=>{const{min:o,max:a,inverted:i,onSlideStart:l,onSlideMove:s,onSlideEnd:c,onStepKeyDown:d,...u}=e,p=r.useRef(null),f=L(n,p),m=r.useRef(void 0),h=!i;function v(e){const t=m.current||p.current.getBoundingClientRect(),n=Rr([0,t.height],h?[a,o]:[o,a]);return m.current=t,n(e-t.top)}return t(pr,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:t(vr,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{const t=v(e.clientY);l?.(t)},onSlideMove:e=>{const t=v(e.clientY);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{const t=nr[h?"from-bottom":"from-top"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})}),vr=r.forwardRef((e,n)=>{const{__scopeSlider:o,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:c,...d}=e,u=dr(or,o);return t(H.span,{...d,ref:n,onKeyDown:A(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(s(e),e.preventDefault()):er.concat(tr).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:A(e.onPointerDown,e=>{const t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)}),onPointerMove:A(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:A(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),i(e))})})}),gr="SliderTrack",yr=r.forwardRef((e,n)=>{const{__scopeSlider:o,...r}=e,a=dr(gr,o);return t(H.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:n})});yr.displayName=gr;var br="SliderRange",wr=r.forwardRef((e,n)=>{const{__scopeSlider:o,...a}=e,i=dr(br,o),l=fr(br,o),s=L(n,r.useRef(null)),c=i.values.length,d=i.values.map(e=>kr(e,i.min,i.max)),u=c>1?Math.min(...d):0,p=100-Math.max(...d);return t(H.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...a,ref:s,style:{...e.style,[l.startEdge]:u+"%",[l.endEdge]:p+"%"}})});wr.displayName=br;var xr="SliderThumb",Sr=r.forwardRef((e,n)=>{const o=ar(e.__scopeSlider),[a,i]=r.useState(null),l=L(n,e=>i(e)),s=r.useMemo(()=>a?o().findIndex(e=>e.ref.current===a):-1,[o,a]);return t(Cr,{...e,ref:l,index:s})}),Cr=r.forwardRef((e,o)=>{const{__scopeSlider:a,index:i,name:l,...s}=e,c=dr(xr,a),d=fr(xr,a),[u,p]=r.useState(null),f=L(o,e=>p(e)),m=!u||(c.form||!!u.closest("form")),h=ge(u),v=c.values[i],g=void 0===v?0:kr(v,c.min,c.max),y=function(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}(i,c.values.length),b=h?.[d.size],w=b?function(e,t,n){const o=e/2,r=Rr([0,50],[0,o]);return(o-r(t)*n)*n}(b,g,d.direction):0;return r.useEffect(()=>{if(u)return c.thumbs.add(u),()=>{c.thumbs.delete(u)}},[u,c.thumbs]),n("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[d.startEdge]:`calc(${g}% + ${w}px)`},children:[t(rr.ItemSlot,{scope:e.__scopeSlider,children:t(H.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":c.min,"aria-valuenow":v,"aria-valuemax":c.max,"aria-orientation":c.orientation,"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,tabIndex:c.disabled?void 0:0,...s,ref:f,style:void 0===v?{display:"none"}:e.style,onFocus:A(e.onFocus,()=>{c.valueIndexToChangeRef.current=i})})}),m&&t(Er,{name:l??(c.name?c.name+(c.values.length>1?"[]":""):void 0),form:c.form,value:v},i)]})});Sr.displayName=xr;var Er=r.forwardRef(({__scopeSlider:e,value:n,...o},a)=>{const i=r.useRef(null),l=L(i,a),s=Fn(n);return r.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLInputElement.prototype,o=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&o){const t=new Event("input",{bubbles:!0});o.call(e,n),e.dispatchEvent(t)}},[s,n]),t(H.input,{style:{display:"none"},...o,ref:l,defaultValue:n})});function kr(e,t,n){return Rn(100/(n-t)*(e-t),[0,100])}function Rr(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}Er.displayName="RadioBubbleInput";var Pr=ur,Or=yr,Nr=wr,_r=Sr;const Dr=({value:e,onValueChange:o,min:r=0,max:a=100,step:i=1,className:l,style:s})=>n("div",Object.assign({className:l,style:s,"data-element-options-slider":!0},{children:[n(Pr,Object.assign({value:[e],onValueChange:([e])=>o(e),min:r,max:a,step:i,onMouseDown:e=>e.stopPropagation(),"data-element-options-slider-root":!0},{children:[t(Or,Object.assign({"data-element-options-slider-track":!0},{children:t(Nr,{"data-element-options-slider-range":!0})})),t(_r,{"data-element-options-slider-thumb":!0})]})),t("span",Object.assign({"data-element-options-slider-value":!0},{children:e}))]}));Dr.displayName="ElementOptions.Slider";var Mr="Switch",[Ar,Ir]=F(Mr),[Tr,Lr]=Ar(Mr),Fr=r.forwardRef((e,o)=>{const{__scopeSwitch:a,name:i,checked:l,defaultChecked:s,required:c,disabled:d,value:u="on",onCheckedChange:p,form:f,...m}=e,[h,v]=r.useState(null),g=L(o,e=>v(e)),y=r.useRef(!1),b=!h||(f||!!h.closest("form")),[w,x]=Xe({prop:l,defaultProp:s??!1,onChange:p,caller:Mr});return n(Tr,{scope:a,checked:w,disabled:d,children:[t(H.button,{type:"button",role:"switch","aria-checked":w,"aria-required":c,"data-state":Br(w),"data-disabled":d?"":void 0,disabled:d,value:u,...m,ref:g,onClick:A(e.onClick,e=>{x(e=>!e),b&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),b&&t(Wr,{control:h,bubbles:!y.current,name:i,value:u,checked:w,required:c,disabled:d,form:f,style:{transform:"translateX(-100%)"}})]})});Fr.displayName=Mr;var jr="SwitchThumb",zr=r.forwardRef((e,n)=>{const{__scopeSwitch:o,...r}=e,a=Lr(jr,o);return t(H.span,{"data-state":Br(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:n})});zr.displayName=jr;var Wr=r.forwardRef(({__scopeSwitch:e,control:n,checked:o,bubbles:a=!0,...i},l)=>{const s=r.useRef(null),c=L(s,l),d=Fn(o),u=ge(n);return r.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==o&&n){const t=new Event("click",{bubbles:a});n.call(e,o),e.dispatchEvent(t)}},[d,o,a]),t("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...i,tabIndex:-1,ref:c,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Br(e){return e?"checked":"unchecked"}Wr.displayName="SwitchBubbleInput";var Hr=Fr,Vr=zr;const Kr=({checked:e,onCheckedChange:o,label:r,className:a,style:i})=>n("div",Object.assign({className:a,style:i,"data-element-options-toggle-wrapper":!0},{children:[t(Hr,Object.assign({checked:e,onCheckedChange:o,onMouseDown:e=>e.preventDefault(),"data-element-options-toggle":!0},{children:t(Vr,{"data-element-options-toggle-thumb":!0})})),r&&t("span",Object.assign({"data-element-options-toggle-label":!0},{children:r}))]}));Kr.displayName="ElementOptions.Toggle";const $r=({children:e,className:n,style:o})=>{const{isOpen:r}=yn();return t(un,Object.assign({asChild:!0},{children:t("button",Object.assign({type:"button",className:n,style:o,onMouseDown:e=>e.preventDefault(),"data-element-options-trigger":!0,"data-state":r?"open":"closed","aria-haspopup":"dialog"},{children:null!=e?e:t(Go,{className:"yoopta-ui-element-options-trigger-icon"})}))}))};$r.displayName="ElementOptions.Trigger";const Ur=Object.assign(kn,{Root:kn,Trigger:$r,Content:xn,Group:Sn,Label:En,Separator:Qo,Select:Jo,ColorPicker:vn,Toggle:Kr,Slider:Dr,Input:Cn});export{Ur as ElementOptions,vn as ElementOptionsColorPicker,xn as ElementOptionsContent,gn as ElementOptionsContext,Sn as ElementOptionsGroup,Cn as ElementOptionsInput,En as ElementOptionsLabel,kn as ElementOptionsRoot,Jo as ElementOptionsSelect,Qo as ElementOptionsSeparator,Dr as ElementOptionsSlider,Kr as ElementOptionsToggle,$r as ElementOptionsTrigger,bn as useElementOptions,yn as useElementOptionsContext,wn as useUpdateElementProps};
14
+ */Jo.displayName="ElementOptions.Select";const Qo=({className:e,style:n})=>t("div",{className:e,style:n,"data-element-options-separator":!0,role:"separator","aria-orientation":"horizontal"});Qo.displayName="ElementOptions.Separator";var er=["PageUp","PageDown"],tr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],nr={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},or="Slider",[rr,ar,ir]=Dn(or),[lr,sr]=F(or,[ir]),[cr,dr]=lr(or),ur=r.forwardRef((e,n)=>{const{name:o,min:a=0,max:i=100,step:l=1,orientation:s="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:u=[a],value:p,onValueChange:f=()=>{},onValueCommit:m=()=>{},inverted:h=!1,form:v,...g}=e,y=r.useRef(new Set),b=r.useRef(0),w="horizontal"===s?mr:hr,[x=[],S]=Xe({prop:p,defaultProp:u,onChange:e=>{const t=[...y.current];t[b.current]?.focus(),f(e)}}),C=r.useRef(x);function E(e,t,{commit:n}={commit:!1}){const o=function(e){return(String(e).split(".")[1]||"").length}(l),r=function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}(Math.round((e-a)/l)*l+a,o),s=Rn(r,[a,i]);S((e=[])=>{const o=function(e=[],t,n){const o=[...e];return o[n]=t,o.sort((e,t)=>e-t)}(e,s,t);if(function(e,t){if(t>0){const n=function(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}(e);return Math.min(...n)>=t}return!0}(o,d*l)){b.current=o.indexOf(s);const t=String(o)!==String(e);return t&&n&&m(o),t?o:e}return e})}return t(cr,{scope:e.__scopeSlider,name:o,disabled:c,min:a,max:i,valueIndexToChangeRef:b,thumbs:y.current,values:x,orientation:s,form:v,children:t(rr.Provider,{scope:e.__scopeSlider,children:t(rr.Slot,{scope:e.__scopeSlider,children:t(w,{"aria-disabled":c,"data-disabled":c?"":void 0,...g,ref:n,onPointerDown:A(g.onPointerDown,()=>{c||(C.current=x)}),min:a,max:i,inverted:h,onSlideStart:c?void 0:function(e){const t=function(e,t){if(1===e.length)return 0;const n=e.map(e=>Math.abs(e-t)),o=Math.min(...n);return n.indexOf(o)}(x,e);E(e,t)},onSlideMove:c?void 0:function(e){E(e,b.current)},onSlideEnd:c?void 0:function(){const e=C.current[b.current];x[b.current]!==e&&m(x)},onHomeKeyDown:()=>!c&&E(a,0,{commit:!0}),onEndKeyDown:()=>!c&&E(i,x.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!c){const n=er.includes(e.key)||e.shiftKey&&tr.includes(e.key)?10:1,o=b.current;E(x[o]+l*n*t,o,{commit:!0})}}})})})})});ur.displayName=or;var[pr,fr]=lr(or,{startEdge:"left",endEdge:"right",size:"width",direction:1}),mr=r.forwardRef((e,n)=>{const{min:o,max:a,dir:i,inverted:l,onSlideStart:s,onSlideMove:c,onSlideEnd:d,onStepKeyDown:u,...p}=e,[f,m]=r.useState(null),h=L(n,e=>m(e)),v=r.useRef(void 0),g=An(i),y="ltr"===g,b=y&&!l||!y&&l;function w(e){const t=v.current||f.getBoundingClientRect(),n=Rr([0,t.width],b?[o,a]:[a,o]);return v.current=t,n(e-t.left)}return t(pr,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:t(vr,{dir:g,"data-orientation":"horizontal",...p,ref:h,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{const t=w(e.clientX);s?.(t)},onSlideMove:e=>{const t=w(e.clientX);c?.(t)},onSlideEnd:()=>{v.current=void 0,d?.()},onStepKeyDown:e=>{const t=nr[b?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),hr=r.forwardRef((e,n)=>{const{min:o,max:a,inverted:i,onSlideStart:l,onSlideMove:s,onSlideEnd:c,onStepKeyDown:d,...u}=e,p=r.useRef(null),f=L(n,p),m=r.useRef(void 0),h=!i;function v(e){const t=m.current||p.current.getBoundingClientRect(),n=Rr([0,t.height],h?[a,o]:[o,a]);return m.current=t,n(e-t.top)}return t(pr,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:t(vr,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{const t=v(e.clientY);l?.(t)},onSlideMove:e=>{const t=v(e.clientY);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{const t=nr[h?"from-bottom":"from-top"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})}),vr=r.forwardRef((e,n)=>{const{__scopeSlider:o,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:c,...d}=e,u=dr(or,o);return t(H.span,{...d,ref:n,onKeyDown:A(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(s(e),e.preventDefault()):er.concat(tr).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:A(e.onPointerDown,e=>{const t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)}),onPointerMove:A(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:A(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),i(e))})})}),gr="SliderTrack",yr=r.forwardRef((e,n)=>{const{__scopeSlider:o,...r}=e,a=dr(gr,o);return t(H.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:n})});yr.displayName=gr;var br="SliderRange",wr=r.forwardRef((e,n)=>{const{__scopeSlider:o,...a}=e,i=dr(br,o),l=fr(br,o),s=L(n,r.useRef(null)),c=i.values.length,d=i.values.map(e=>kr(e,i.min,i.max)),u=c>1?Math.min(...d):0,p=100-Math.max(...d);return t(H.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...a,ref:s,style:{...e.style,[l.startEdge]:u+"%",[l.endEdge]:p+"%"}})});wr.displayName=br;var xr="SliderThumb",Sr=r.forwardRef((e,n)=>{const o=ar(e.__scopeSlider),[a,i]=r.useState(null),l=L(n,e=>i(e)),s=r.useMemo(()=>a?o().findIndex(e=>e.ref.current===a):-1,[o,a]);return t(Cr,{...e,ref:l,index:s})}),Cr=r.forwardRef((e,o)=>{const{__scopeSlider:a,index:i,name:l,...s}=e,c=dr(xr,a),d=fr(xr,a),[u,p]=r.useState(null),f=L(o,e=>p(e)),m=!u||(c.form||!!u.closest("form")),h=ge(u),v=c.values[i],g=void 0===v?0:kr(v,c.min,c.max),y=function(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}(i,c.values.length),b=h?.[d.size],w=b?function(e,t,n){const o=e/2,r=Rr([0,50],[0,o]);return(o-r(t)*n)*n}(b,g,d.direction):0;return r.useEffect(()=>{if(u)return c.thumbs.add(u),()=>{c.thumbs.delete(u)}},[u,c.thumbs]),n("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[d.startEdge]:`calc(${g}% + ${w}px)`},children:[t(rr.ItemSlot,{scope:e.__scopeSlider,children:t(H.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":c.min,"aria-valuenow":v,"aria-valuemax":c.max,"aria-orientation":c.orientation,"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,tabIndex:c.disabled?void 0:0,...s,ref:f,style:void 0===v?{display:"none"}:e.style,onFocus:A(e.onFocus,()=>{c.valueIndexToChangeRef.current=i})})}),m&&t(Er,{name:l??(c.name?c.name+(c.values.length>1?"[]":""):void 0),form:c.form,value:v},i)]})});Sr.displayName=xr;var Er=r.forwardRef(({__scopeSlider:e,value:n,...o},a)=>{const i=r.useRef(null),l=L(i,a),s=Fn(n);return r.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLInputElement.prototype,o=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&o){const t=new Event("input",{bubbles:!0});o.call(e,n),e.dispatchEvent(t)}},[s,n]),t(H.input,{style:{display:"none"},...o,ref:l,defaultValue:n})});function kr(e,t,n){return Rn(100/(n-t)*(e-t),[0,100])}function Rr(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}Er.displayName="RadioBubbleInput";var Or=ur,Pr=yr,Nr=wr,_r=Sr;const Dr=({value:e,onValueChange:o,min:r=0,max:a=100,step:i=1,className:l,style:s})=>n("div",Object.assign({className:l,style:s,"data-element-options-slider":!0},{children:[n(Or,Object.assign({value:[e],onValueChange:([e])=>o(e),min:r,max:a,step:i,onMouseDown:e=>e.stopPropagation(),"data-element-options-slider-root":!0},{children:[t(Pr,Object.assign({"data-element-options-slider-track":!0},{children:t(Nr,{"data-element-options-slider-range":!0})})),t(_r,{"data-element-options-slider-thumb":!0})]})),t("span",Object.assign({"data-element-options-slider-value":!0},{children:e}))]}));Dr.displayName="ElementOptions.Slider";var Mr="Switch",[Ar,Ir]=F(Mr),[Tr,Lr]=Ar(Mr),Fr=r.forwardRef((e,o)=>{const{__scopeSwitch:a,name:i,checked:l,defaultChecked:s,required:c,disabled:d,value:u="on",onCheckedChange:p,form:f,...m}=e,[h,v]=r.useState(null),g=L(o,e=>v(e)),y=r.useRef(!1),b=!h||(f||!!h.closest("form")),[w,x]=Xe({prop:l,defaultProp:s??!1,onChange:p,caller:Mr});return n(Tr,{scope:a,checked:w,disabled:d,children:[t(H.button,{type:"button",role:"switch","aria-checked":w,"aria-required":c,"data-state":Br(w),"data-disabled":d?"":void 0,disabled:d,value:u,...m,ref:g,onClick:A(e.onClick,e=>{x(e=>!e),b&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),b&&t(Wr,{control:h,bubbles:!y.current,name:i,value:u,checked:w,required:c,disabled:d,form:f,style:{transform:"translateX(-100%)"}})]})});Fr.displayName=Mr;var jr="SwitchThumb",zr=r.forwardRef((e,n)=>{const{__scopeSwitch:o,...r}=e,a=Lr(jr,o);return t(H.span,{"data-state":Br(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:n})});zr.displayName=jr;var Wr=r.forwardRef(({__scopeSwitch:e,control:n,checked:o,bubbles:a=!0,...i},l)=>{const s=r.useRef(null),c=L(s,l),d=Fn(o),u=ge(n);return r.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==o&&n){const t=new Event("click",{bubbles:a});n.call(e,o),e.dispatchEvent(t)}},[d,o,a]),t("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...i,tabIndex:-1,ref:c,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Br(e){return e?"checked":"unchecked"}Wr.displayName="SwitchBubbleInput";var Hr=Fr,Vr=zr;const Kr=({checked:e,onCheckedChange:o,label:r,className:a,style:i})=>n("div",Object.assign({className:a,style:i,"data-element-options-toggle-wrapper":!0},{children:[t(Hr,Object.assign({checked:e,onCheckedChange:o,onMouseDown:e=>e.preventDefault(),"data-element-options-toggle":!0},{children:t(Vr,{"data-element-options-toggle-thumb":!0})})),r&&t("span",Object.assign({"data-element-options-toggle-label":!0},{children:r}))]}));Kr.displayName="ElementOptions.Toggle";const $r=({children:e,className:n,style:o})=>{const{isOpen:r}=yn();return t(un,Object.assign({asChild:!0},{children:t("button",Object.assign({type:"button",className:n,style:o,onMouseDown:e=>e.preventDefault(),"data-element-options-trigger":!0,"data-state":r?"open":"closed","aria-haspopup":"dialog"},{children:null!=e?e:t(Go,{className:"yoopta-ui-element-options-trigger-icon"})}))}))};$r.displayName="ElementOptions.Trigger";const Ur=Object.assign(kn,{Root:kn,Trigger:$r,Content:xn,Group:Sn,Label:En,Separator:Qo,Select:Jo,ColorPicker:vn,Toggle:Kr,Slider:Dr,Input:Cn});export{Ur as ElementOptions,vn as ElementOptionsColorPicker,xn as ElementOptionsContent,gn as ElementOptionsContext,Sn as ElementOptionsGroup,Cn as ElementOptionsInput,En as ElementOptionsLabel,kn as ElementOptionsRoot,Jo as ElementOptionsSelect,Qo as ElementOptionsSeparator,Dr as ElementOptionsSlider,Kr as ElementOptionsToggle,$r as ElementOptionsTrigger,bn as useElementOptions,yn as useElementOptionsContext,wn as useUpdateElementProps};
@@ -1 +1 @@
1
- {"version":3,"file":"highlight-color-picker.d.ts","sourceRoot":"","sources":["../../src/highlight-color-picker/highlight-color-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C,OAAO,8BAA8B,CAAC;AAEtC,MAAM,MAAM,yBAAyB,GAAG;IACtC,wCAAwC;IACxC,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,kCAAkC;IAClC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1E,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,QAAQ,EAAE,YAAY,CAAC;IACvB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAChD,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAaF,eAAO,MAAM,oBAAoB,sHAuNhC,CAAC"}
1
+ {"version":3,"file":"highlight-color-picker.d.ts","sourceRoot":"","sources":["../../src/highlight-color-picker/highlight-color-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C,OAAO,8BAA8B,CAAC;AAEtC,MAAM,MAAM,yBAAyB,GAAG;IACtC,wCAAwC;IACxC,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,kCAAkC;IAClC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1E,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,QAAQ,EAAE,YAAY,CAAC;IACvB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAChD,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAaF,eAAO,MAAM,oBAAoB,sHA2OhC,CAAC"}
@@ -1 +1 @@
1
- import{jsxs as o,Fragment as r,jsx as i}from"react/jsx-runtime";import{forwardRef as t,useState as e,useRef as a,useEffect as p,useMemo as l,useCallback as c,cloneElement as h}from"react";import{u as n}from"./chunks/floating-ui.react-0f8b5c36.js";import{d as u,Z as s,O as g}from"./chunks/debounce-c595d128.js";import{s as d}from"./chunks/style-inject.es-e87a8d02.js";import{o as y,l as b,s as x,j as k}from"./chunks/floating-ui.react-dom-dc823237.js";import"react-dom";d(":root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-primary:221.2 83.2% 53.3%;--yoopta-ui-primary-foreground:210 40% 98%;--yoopta-ui-destructive:0 84.2% 60.2%;--yoopta-ui-destructive-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-radius-sm:0.375rem;--yoopta-ui-radius:0.5rem;--yoopta-ui-radius-lg:0.625rem;--yoopta-ui-z-dropdown:50;--yoopta-ui-z-sticky:100;--yoopta-ui-z-overlay:200;--yoopta-ui-z-modal:9999;--yoopta-ui-transition-fast:100ms ease;--yoopta-ui-transition:150ms ease;--yoopta-ui-transition-slow:200ms ease}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -2px rgba(0,0,0,.3);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.5),0 4px 16px -4px rgba(0,0,0,.3)}:root{--yoopta-ui-highlight-color-picker-shadow:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-highlight-color-picker-radius:0.625rem;--yoopta-ui-highlight-color-picker-padding:10px;--yoopta-ui-highlight-color-picker-gap:10px;--yoopta-ui-highlight-color-picker-width:224px;--yoopta-ui-highlight-color-picker-z-index:9999;--yoopta-ui-highlight-color-picker-picker-height:120px;--yoopta-ui-highlight-color-picker-preset-size:24px;--yoopta-ui-highlight-color-picker-input-height:26px;--yoopta-ui-highlight-color-picker-transition:background-color 120ms ease,color 120ms ease,border-color 120ms ease,box-shadow 120ms ease,transform 120ms ease}.yoopta-ui-highlight-color-picker{background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-highlight-color-picker-radius);box-shadow:var(--yoopta-ui-highlight-color-picker-shadow);color:hsl(var(--yoopta-ui-foreground));display:flex;flex-direction:column;gap:8px;outline:none;padding:var(--yoopta-ui-highlight-color-picker-padding);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--yoopta-ui-highlight-color-picker-width);z-index:var(--yoopta-ui-highlight-color-picker-z-index)}.yoopta-ui-highlight-color-picker-mode-toggle{background:hsl(var(--yoopta-ui-border));border-radius:8px;display:flex;flex-shrink:0;gap:4px;padding:4px}.yoopta-ui-highlight-color-picker-mode-btn{background:transparent;border:none;border-radius:6px;color:hsl(var(--yoopta-ui-muted-foreground));cursor:pointer;flex:1;font-size:11px;font-weight:500;line-height:1.4;outline:none;padding:4px 8px;text-align:center;transition:var(--yoopta-ui-highlight-color-picker-transition)}.yoopta-ui-highlight-color-picker-mode-btn:hover{color:hsl(var(--yoopta-ui-foreground))}.yoopta-ui-highlight-color-picker-mode-btn[data-active=true]{background:hsl(var(--yoopta-ui-background));box-shadow:0 1px 2px rgba(0,0,0,.1);color:hsl(var(--yoopta-ui-foreground))}.yoopta-ui-highlight-color-picker-mode-btn:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}.yoopta-ui-highlight-color-picker-react-colorful{height:var(--yoopta-ui-highlight-color-picker-picker-height)!important;width:100%!important}.yoopta-ui-highlight-color-picker-react-colorful .react-colorful__saturation{border:1px solid hsl(var(--yoopta-ui-border));border-radius:8px}.yoopta-ui-highlight-color-picker-react-colorful .react-colorful__hue{border:1px solid hsl(var(--yoopta-ui-border));border-radius:999px;height:10px;margin-top:8px}.yoopta-ui-highlight-color-picker-react-colorful .react-colorful__pointer{border:2px solid hsl(var(--yoopta-ui-background));border-radius:999px;box-shadow:0 2px 6px rgba(0,0,0,.22);height:16px;width:16px}.yoopta-ui-highlight-color-picker-presets{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;gap:6px;overflow-x:auto;padding-bottom:2px;scrollbar-color:hsl(var(--yoopta-ui-border)) transparent;scrollbar-width:thin}.yoopta-ui-highlight-color-picker-presets::-webkit-scrollbar{height:6px}.yoopta-ui-highlight-color-picker-presets::-webkit-scrollbar-track{background:transparent}.yoopta-ui-highlight-color-picker-presets::-webkit-scrollbar-thumb{background-color:hsl(var(--yoopta-ui-border));border-radius:999px}.yoopta-ui-highlight-color-picker-preset{border:2px solid hsl(var(--yoopta-ui-border));border-radius:7px;cursor:pointer;flex:0 0 auto;height:var(--yoopta-ui-highlight-color-picker-preset-size);outline:none;padding:0;transition:var(--yoopta-ui-highlight-color-picker-transition);width:var(--yoopta-ui-highlight-color-picker-preset-size)}.yoopta-ui-highlight-color-picker-preset:hover{transform:scale(1.08)}.yoopta-ui-highlight-color-picker-preset:focus-visible{border-color:hsl(var(--yoopta-ui-ring));box-shadow:0 0 0 2px hsl(var(--yoopta-ui-ring))}.yoopta-ui-highlight-color-picker-preset[data-selected=true]{border-color:hsl(var(--yoopta-ui-ring));box-shadow:0 0 0 2px hsl(var(--yoopta-ui-ring)/.35)}.yoopta-ui-highlight-color-picker-hex-row{align-items:center;display:flex;gap:8px}.yoopta-ui-highlight-color-picker-swatch{border:1px solid hsl(var(--yoopta-ui-border));border-radius:7px;flex:0 0 auto;height:var(--yoopta-ui-highlight-color-picker-input-height);width:var(--yoopta-ui-highlight-color-picker-input-height)}.yoopta-ui-highlight-color-picker-hex-input{background:transparent;border:1px solid hsl(var(--yoopta-ui-border));border-radius:9px;color:hsl(var(--yoopta-ui-foreground));flex:1;font-size:12px;height:var(--yoopta-ui-highlight-color-picker-input-height);line-height:1;min-width:0;outline:none;padding:0 10px}.yoopta-ui-highlight-color-picker-hex-input:focus{border-color:hsl(var(--yoopta-ui-ring));box-shadow:0 0 0 2px hsl(var(--yoopta-ui-ring)/.25)}.yoopta-ui-highlight-color-picker-hex-input::-moz-placeholder{color:hsl(var(--yoopta-ui-muted-foreground))}.yoopta-ui-highlight-color-picker-hex-input::placeholder{color:hsl(var(--yoopta-ui-muted-foreground))}");const m=["#FFFF00","#FFE066","#FFCC99","#FF9999","#99CCFF","#99FF99","#FF99FF","#CC99FF"],f=t(({value:t={backgroundColor:"#FFFF00"},onChange:d,presets:f=m,showInput:v=!0,className:w,children:C,placement:F="bottom",offset:j=8},O)=>{const[z,N]=e(!1),[E,_]=e("backgroundColor"),[L,M]=e(t.backgroundColor),[P,D]=e(t.color),{refs:B,floatingStyles:S}=n({open:z,onOpenChange:N,placement:F,middleware:[y(j),b(),x()],whileElementsMounted:k}),T=a(t);T.current=t;const $=a(E);$.current=E,p(()=>{t.backgroundColor&&M(t.backgroundColor),t.color&&D(t.color)},[t]);const H=l(()=>u((o,r)=>{"backgroundColor"===r?null==d||d(Object.assign(Object.assign({},T.current),{backgroundColor:o})):null==d||d(Object.assign(Object.assign({},T.current),{color:o}))},300),[d]);p(()=>()=>{H.cancel()},[H]),p(()=>{if(!z)return;const o=o=>{const r=o.target,i=B.reference.current,t=B.floating.current;i&&i instanceof Element&&i.contains(r)||(null==t?void 0:t.contains(r))||(H.flush(),N(!1))};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[z,B.floating,B.reference,H]);const I=c(o=>{"backgroundColor"===$.current?M(o):D(o),H(o,$.current)},[H]),R=c(o=>{H.cancel(),"backgroundColor"===E?(M(o),null==d||d(Object.assign(Object.assign({},t),{backgroundColor:o}))):(D(o),null==d||d(Object.assign(Object.assign({},t),{color:o})))},[E,t,d,H]),q="backgroundColor"===E?L:P,A=h(C,{ref:B.setReference,onClick:o=>{var r,i;o.stopPropagation(),N(o=>!o),null===(i=(r=C.props).onClick)||void 0===i||i.call(r,o)}});return o(r,{children:[A,z&&o("div",Object.assign({ref:o=>{B.setFloating(o),O&&("function"==typeof O?O(o):O.current=o)},style:S,className:`yoopta-ui-highlight-color-picker ${null!=w?w:""}`,onClick:o=>o.stopPropagation(),contentEditable:!1,onMouseDown:o=>o.stopPropagation()},{children:[o("div",Object.assign({className:"yoopta-ui-highlight-color-picker-mode-toggle"},{children:[i("button",Object.assign({type:"button",className:"yoopta-ui-highlight-color-picker-mode-btn","data-active":"backgroundColor"===E,onMouseDown:()=>_("backgroundColor"),"aria-label":"Background color"},{children:"Background"})),i("button",Object.assign({type:"button",className:"yoopta-ui-highlight-color-picker-mode-btn","data-active":"color"===E,onMouseDown:()=>_("color"),"aria-label":"Text color"},{children:"Text"}))]})),i("div",Object.assign({className:"yoopta-ui-highlight-color-picker-picker"},{children:i(s,{color:q,onChange:I,className:"yoopta-ui-highlight-color-picker-react-colorful"})})),f.length>0&&i("div",Object.assign({className:"yoopta-ui-highlight-color-picker-presets"},{children:f.map(o=>{const r=(null==q?void 0:q.toLowerCase())===o.toLowerCase();return i("button",{type:"button",className:"yoopta-ui-highlight-color-picker-preset","data-selected":r,style:{backgroundColor:o},onClick:()=>R(o),"aria-label":`Select color ${o}`},o)})})),v&&o("div",Object.assign({className:"yoopta-ui-highlight-color-picker-hex-row"},{children:[i("div",{className:"yoopta-ui-highlight-color-picker-swatch",style:{backgroundColor:q}}),i(g,{color:q,onChange:R,className:"yoopta-ui-highlight-color-picker-hex-input",prefixed:!0})]}))]}))]})});f.displayName="HighlightColorPicker";export{f as HighlightColorPicker};
1
+ import{jsxs as o,Fragment as r,jsx as i}from"react/jsx-runtime";import{forwardRef as t,useState as e,useRef as a,useEffect as p,useMemo as l,useCallback as c,cloneElement as h}from"react";import{u as n}from"./chunks/floating-ui.react-0f8b5c36.js";import{d as u,Z as s,O as g}from"./chunks/debounce-c595d128.js";import{s as d}from"./chunks/style-inject.es-e87a8d02.js";import{o as b,l as y,s as x,j as k}from"./chunks/floating-ui.react-dom-dc823237.js";import"react-dom";d(":root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-primary:221.2 83.2% 53.3%;--yoopta-ui-primary-foreground:210 40% 98%;--yoopta-ui-destructive:0 84.2% 60.2%;--yoopta-ui-destructive-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-radius-sm:0.375rem;--yoopta-ui-radius:0.5rem;--yoopta-ui-radius-lg:0.625rem;--yoopta-ui-z-dropdown:50;--yoopta-ui-z-sticky:100;--yoopta-ui-z-overlay:200;--yoopta-ui-z-modal:9999;--yoopta-ui-transition-fast:100ms ease;--yoopta-ui-transition:150ms ease;--yoopta-ui-transition-slow:200ms ease}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -2px rgba(0,0,0,.3);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.5),0 4px 16px -4px rgba(0,0,0,.3)}:root{--yoopta-ui-highlight-color-picker-shadow:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-highlight-color-picker-radius:0.625rem;--yoopta-ui-highlight-color-picker-padding:10px;--yoopta-ui-highlight-color-picker-gap:10px;--yoopta-ui-highlight-color-picker-width:224px;--yoopta-ui-highlight-color-picker-z-index:9999;--yoopta-ui-highlight-color-picker-picker-height:120px;--yoopta-ui-highlight-color-picker-preset-size:24px;--yoopta-ui-highlight-color-picker-input-height:26px;--yoopta-ui-highlight-color-picker-transition:background-color 120ms ease,color 120ms ease,border-color 120ms ease,box-shadow 120ms ease,transform 120ms ease}.yoopta-ui-highlight-color-picker{background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-highlight-color-picker-radius);box-shadow:var(--yoopta-ui-highlight-color-picker-shadow);color:hsl(var(--yoopta-ui-foreground));display:flex;flex-direction:column;gap:8px;outline:none;padding:var(--yoopta-ui-highlight-color-picker-padding);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--yoopta-ui-highlight-color-picker-width);z-index:var(--yoopta-ui-highlight-color-picker-z-index)}.yoopta-ui-highlight-color-picker-mode-toggle{background:hsl(var(--yoopta-ui-border));border-radius:8px;display:flex;flex-shrink:0;gap:4px;padding:4px}.yoopta-ui-highlight-color-picker-mode-btn{background:transparent;border:none;border-radius:6px;color:hsl(var(--yoopta-ui-muted-foreground));cursor:pointer;flex:1;font-size:11px;font-weight:500;line-height:1.4;outline:none;padding:4px 8px;text-align:center;transition:var(--yoopta-ui-highlight-color-picker-transition)}.yoopta-ui-highlight-color-picker-mode-btn:hover{color:hsl(var(--yoopta-ui-foreground))}.yoopta-ui-highlight-color-picker-mode-btn[data-active=true]{background:hsl(var(--yoopta-ui-background));box-shadow:0 1px 2px rgba(0,0,0,.1);color:hsl(var(--yoopta-ui-foreground))}.yoopta-ui-highlight-color-picker-mode-btn:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}.yoopta-ui-highlight-color-picker-react-colorful{height:var(--yoopta-ui-highlight-color-picker-picker-height)!important;width:100%!important}.yoopta-ui-highlight-color-picker-react-colorful .react-colorful__saturation{border:1px solid hsl(var(--yoopta-ui-border));border-radius:8px}.yoopta-ui-highlight-color-picker-react-colorful .react-colorful__hue{border:1px solid hsl(var(--yoopta-ui-border));border-radius:999px;height:10px;margin-top:8px}.yoopta-ui-highlight-color-picker-react-colorful .react-colorful__pointer{border:2px solid hsl(var(--yoopta-ui-background));border-radius:999px;box-shadow:0 2px 6px rgba(0,0,0,.22);height:16px;width:16px}.yoopta-ui-highlight-color-picker-presets{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;gap:6px;overflow-x:auto;padding-bottom:2px;scrollbar-color:hsl(var(--yoopta-ui-border)) transparent;scrollbar-width:thin}.yoopta-ui-highlight-color-picker-presets::-webkit-scrollbar{height:6px}.yoopta-ui-highlight-color-picker-presets::-webkit-scrollbar-track{background:transparent}.yoopta-ui-highlight-color-picker-presets::-webkit-scrollbar-thumb{background-color:hsl(var(--yoopta-ui-border));border-radius:999px}.yoopta-ui-highlight-color-picker-preset{border:2px solid hsl(var(--yoopta-ui-border));border-radius:7px;cursor:pointer;flex:0 0 auto;height:var(--yoopta-ui-highlight-color-picker-preset-size);outline:none;padding:0;transition:var(--yoopta-ui-highlight-color-picker-transition);width:var(--yoopta-ui-highlight-color-picker-preset-size)}.yoopta-ui-highlight-color-picker-preset:hover{transform:scale(1.08)}.yoopta-ui-highlight-color-picker-preset:focus-visible{border-color:hsl(var(--yoopta-ui-ring));box-shadow:0 0 0 2px hsl(var(--yoopta-ui-ring))}.yoopta-ui-highlight-color-picker-preset[data-selected=true]{border-color:hsl(var(--yoopta-ui-ring));box-shadow:0 0 0 0 hsl(var(--yoopta-ui-ring)/.35)}.yoopta-ui-highlight-color-picker-preset-remove{background:linear-gradient(to top right,transparent calc(50% - 1px),#d74242 calc(50% - 1px),#d74242 calc(50% + 1px),transparent calc(50% + 1px)),linear-gradient(to right bottom,hsl(var(--yoopta-ui-background)) 50%,hsl(var(--yoopta-ui-border)) 50%)!important}.yoopta-ui-highlight-color-picker-hex-row{align-items:center;display:flex;gap:8px}.yoopta-ui-highlight-color-picker-swatch{border:1px solid hsl(var(--yoopta-ui-border));border-radius:7px;flex:0 0 auto;height:var(--yoopta-ui-highlight-color-picker-input-height);width:var(--yoopta-ui-highlight-color-picker-input-height)}.yoopta-ui-highlight-color-picker-hex-input{background:transparent;border:1px solid hsl(var(--yoopta-ui-border));border-radius:9px;color:hsl(var(--yoopta-ui-foreground));flex:1;font-size:12px;height:var(--yoopta-ui-highlight-color-picker-input-height);line-height:1;min-width:0;outline:none;padding:0 10px}.yoopta-ui-highlight-color-picker-hex-input:focus{border-color:hsl(var(--yoopta-ui-ring));box-shadow:0 0 0 2px hsl(var(--yoopta-ui-ring)/.25)}.yoopta-ui-highlight-color-picker-hex-input::-moz-placeholder{color:hsl(var(--yoopta-ui-muted-foreground))}.yoopta-ui-highlight-color-picker-hex-input::placeholder{color:hsl(var(--yoopta-ui-muted-foreground))}");const m=["#FFFF00","#FFE066","#FFCC99","#FF9999","#99CCFF","#99FF99","#FF99FF","#CC99FF"],v=t(({value:t={backgroundColor:"#FFFF00"},onChange:d,presets:v=m,showInput:f=!0,className:w,children:C,placement:j="bottom",offset:F=8},O)=>{const[z,N]=e(!1),[E,_]=e("backgroundColor"),[L,M]=e(t.backgroundColor),[P,D]=e(t.color),{refs:$,floatingStyles:B}=n({open:z,onOpenChange:N,placement:j,middleware:[b(F),y(),x()],whileElementsMounted:k}),R=a(t);R.current=t;const S=a(E);S.current=E,p(()=>{t.backgroundColor&&M(t.backgroundColor),t.color&&D(t.color)},[t]);const T=l(()=>u((o,r)=>{"backgroundColor"===r?null==d||d(Object.assign(Object.assign({},R.current),{backgroundColor:o})):null==d||d(Object.assign(Object.assign({},R.current),{color:o}))},300),[d]);p(()=>()=>{T.cancel()},[T]),p(()=>{if(!z)return;const o=o=>{const r=o.target,i=$.reference.current,t=$.floating.current;i&&i instanceof Element&&i.contains(r)||(null==t?void 0:t.contains(r))||(T.flush(),N(!1))};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[z,$.floating,$.reference,T]);const H=c(o=>{"backgroundColor"===S.current?M(o):D(o),T(o,S.current)},[T]),I=c(o=>{T.cancel(),"backgroundColor"===E?(M(o),null==d||d(Object.assign(Object.assign({},t),{backgroundColor:o}))):(D(o),null==d||d(Object.assign(Object.assign({},t),{color:o})))},[E,t,d,T]),q=c(()=>{T.cancel(),"backgroundColor"===E?(M(void 0),null==d||d(Object.assign(Object.assign({},t),{backgroundColor:void 0}))):(D(void 0),null==d||d(Object.assign(Object.assign({},t),{color:void 0})))},[E,t,d,T]),A="backgroundColor"===E?L:P,G=h(C,{ref:$.setReference,onClick:o=>{var r,i;o.stopPropagation(),N(o=>!o),null===(i=(r=C.props).onClick)||void 0===i||i.call(r,o)}});return o(r,{children:[G,z&&o("div",Object.assign({ref:o=>{$.setFloating(o),O&&("function"==typeof O?O(o):O.current=o)},style:B,className:`yoopta-ui-highlight-color-picker ${null!=w?w:""}`,onClick:o=>o.stopPropagation(),contentEditable:!1,onMouseDown:o=>o.stopPropagation()},{children:[o("div",Object.assign({className:"yoopta-ui-highlight-color-picker-mode-toggle"},{children:[i("button",Object.assign({type:"button",className:"yoopta-ui-highlight-color-picker-mode-btn","data-active":"backgroundColor"===E,onMouseDown:()=>_("backgroundColor"),"aria-label":"Background color"},{children:"Background"})),i("button",Object.assign({type:"button",className:"yoopta-ui-highlight-color-picker-mode-btn","data-active":"color"===E,onMouseDown:()=>_("color"),"aria-label":"Text color"},{children:"Text"}))]})),i("div",Object.assign({className:"yoopta-ui-highlight-color-picker-picker"},{children:i(s,{color:A,onChange:H,className:"yoopta-ui-highlight-color-picker-react-colorful"})})),v.length>0&&o("div",Object.assign({className:"yoopta-ui-highlight-color-picker-presets"},{children:[i("button",{type:"button",className:"yoopta-ui-highlight-color-picker-preset yoopta-ui-highlight-color-picker-preset-remove","data-selected":!A,onClick:q,"aria-label":`Remove ${"backgroundColor"===E?"background":"text"} color`}),v.map(o=>{const r=(null==A?void 0:A.toLowerCase())===o.toLowerCase();return i("button",{type:"button",className:"yoopta-ui-highlight-color-picker-preset","data-selected":r,style:{backgroundColor:o},onClick:()=>I(o),"aria-label":`Select color ${o}`},o)})]})),f&&o("div",Object.assign({className:"yoopta-ui-highlight-color-picker-hex-row"},{children:[i("div",{className:"yoopta-ui-highlight-color-picker-swatch",style:{backgroundColor:A}}),i(g,{color:A,onChange:I,className:"yoopta-ui-highlight-color-picker-hex-input",prefixed:!0})]}))]}))]})});v.displayName="HighlightColorPicker";export{v as HighlightColorPicker};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/ui",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
4
4
  "description": "UI components for Yoopta Editor",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
@@ -103,7 +103,7 @@
103
103
  "dist/"
104
104
  ],
105
105
  "peerDependencies": {
106
- "@yoopta/editor": "6.0.0",
106
+ "@yoopta/editor": "6.0.2",
107
107
  "react": ">=18.2.0",
108
108
  "react-dom": ">=18.2.0"
109
109
  },