@yoopta/themes-shadcn 6.0.0-beta.7 → 6.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/applyTheme.d.ts.map +1 -1
- package/dist/embed/elements/embed/embed-element.d.ts +3 -0
- package/dist/embed/elements/embed/embed-element.d.ts.map +1 -0
- package/dist/embed/elements/embed/embed-inline-toolbar.d.ts +13 -0
- package/dist/embed/elements/embed/embed-inline-toolbar.d.ts.map +1 -0
- package/dist/embed/elements/embed/embed-placeholder.d.ts +11 -0
- package/dist/embed/elements/embed/embed-placeholder.d.ts.map +1 -0
- package/dist/embed/elements/embed/embed-render.d.ts +18 -0
- package/dist/embed/elements/embed/embed-render.d.ts.map +1 -0
- package/dist/embed/index.d.ts +6 -0
- package/dist/embed/index.d.ts.map +1 -0
- package/dist/embed/types.d.ts +3 -0
- package/dist/embed/types.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as r from"react";import o,{forwardRef as i,createElement as a,useReducer as s,useMemo as l,useCallback as c,useRef as d,useState as u,useEffect as p,createContext as h,useContext as f,useLayoutEffect as g,memo as m,PureComponent as b}from"react";import*as v from"react-dom";import w,{flushSync as y}from"react-dom";import{useYooptaEditor as x,Blocks as k,Elements as N,Selection as C,useElementSelected as O,useBlockSelected as S,useYooptaPluginOptions as E,useBlockData as j}from"@yoopta/editor";import{Editor as R,Path as z,Transforms as D,Element as P,Text as M}from"slate";import"@yoopta/ui/element-options";import{CodeCommands as T,isLanguageSupported as _,SHIKI_CODE_LANGUAGES as I,SHIKI_CODE_THEMES as A,HighlightedCodeOverlay as L,CodeGroupCommands as H}from"@yoopta/code";import{useImageUpload as F,useImageDelete as W,useImagePreview as B}from"@yoopta/image";import{useNumberListCount as U}from"@yoopta/lists";import{StepsCommands as V}from"@yoopta/steps";import{TableCommands as $,TABLE_CELLS_IN_SELECTION as X,TABLE_SLATE_TO_SELECTION_SET as Y}from"@yoopta/table";import{Portal as K}from"@yoopta/ui/portal";import{TabsCommands as q}from"@yoopta/tabs";import{parseVideoUrl as G,getEmbedUrl as Z,useVideoUpload as J,useVideoDelete as Q,useVideoPreview as ee,buildVideoProvider as te}from"@yoopta/video";function ne(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function re(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}re(":root{--background:0 0% 100%;--foreground:0 0% 3.9%;--card:0 0% 100%;--card-foreground:0 0% 3.9%;--popover:0 0% 100%;--popover-foreground:0 0% 3.9%;--primary:0 0% 9%;--primary-foreground:0 0% 98%;--secondary:0 0% 96.1%;--secondary-foreground:0 0% 9%;--muted:0 0% 96.1%;--muted-foreground:0 0% 45.1%;--accent:0 0% 96.1%;--accent-foreground:0 0% 9%;--destructive:0 84.2% 60.2%;--destructive-foreground:0 0% 98%;--border:0 0% 89.8%;--input:0 0% 89.8%;--ring:0 0% 3.9%;--radius:0.5rem}.dark,[data-theme=dark]{--background:0 0% 3.9%;--foreground:0 0% 98%;--card:0 0% 3.9%;--card-foreground:0 0% 98%;--popover:0 0% 3.9%;--popover-foreground:0 0% 98%;--primary:0 0% 98%;--primary-foreground:0 0% 9%;--secondary:0 0% 14.9%;--secondary-foreground:0 0% 98%;--muted:0 0% 14.9%;--muted-foreground:0 0% 63.9%;--accent:0 0% 14.9%;--accent-foreground:0 0% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:0 0% 98%;--border:0 0% 14.9%;--input:0 0% 14.9%;--ring:0 0% 83.1%}");re("*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Inter,system-ui,sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-bottom-12{bottom:-3rem}.-left-12{left:-3rem}.-right-12{right:-3rem}.-top-12{top:-3rem}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:.5rem}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.top-0{top:0}.top-1\\/2{top:50%}.top-2{top:.5rem}.top-\\[2\\.75rem\\]{top:2.75rem}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-bottom:0;margin-top:0}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-4{margin-bottom:1rem;margin-top:1rem}.-ml-3\\.5{margin-left:-.875rem}.-ml-4{margin-left:-1rem}.-mt-4{margin-top:-1rem}.mb-2{margin-bottom:.5rem}.ml-1{margin-left:.25rem}.ml-3\\.5{margin-left:.875rem}.ml-6{margin-left:1.5rem}.ml-\\[-13px\\]{margin-left:-13px}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\\.5{margin-top:.125rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.\\!block{display:block!important}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1/1}.size-2{height:.5rem;width:.5rem}.size-2\\.5{height:.625rem;width:.625rem}.size-3\\.5{height:.875rem;width:.875rem}.size-4{height:1rem;width:1rem}.size-7{height:1.75rem;width:1.75rem}.size-8{height:2rem;width:2rem}.size-full{height:100%;width:100%}.h-10{height:2.5rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[1px\\]{height:1px}.h-\\[2px\\]{height:2px}.h-\\[calc\\(100\\%-2\\.75rem\\)\\]{height:calc(100% - 2.75rem)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-\\[200px\\]{max-height:200px}.max-h-full{max-height:100%}.min-h-16{min-height:4rem}.min-h-\\[300px\\]{min-height:300px}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\\[1px\\]{width:1px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0}.min-w-\\[160px\\]{min-width:160px}.min-w-\\[180px\\]{min-width:180px}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.table-fixed{table-layout:fixed}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.translate-y-0{--tw-translate-y:0px}.translate-y-0,.translate-y-2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-2{--tw-translate-y:0.5rem}.translate-y-\\[calc\\(-50\\%_-_2px\\)\\]{--tw-translate-y:calc(-50% - 2px)}.rotate-180,.translate-y-\\[calc\\(-50\\%_-_2px\\)\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate:180deg}.rotate-45{--tw-rotate:45deg}.rotate-45,.rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate:90deg}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.scroll-m-20{scroll-margin:5rem}.scroll-my-1{scroll-margin-bottom:.25rem;scroll-margin-top:.25rem}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.125rem*var(--tw-space-y-reverse));margin-top:calc(.125rem*(1 - var(--tw-space-y-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.25rem*var(--tw-space-y-reverse));margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.375rem*var(--tw-space-y-reverse));margin-top:calc(.375rem*(1 - var(--tw-space-y-reverse)))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.text-balance{text-wrap:balance}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-b-lg{border-bottom-left-radius:var(--radius);border-bottom-right-radius:var(--radius)}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-0{border-width:0}.border-2{border-width:2px}.border-x-0{border-left-width:0;border-right-width:0}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0}.border-t{border-top-width:1px}.border-t-0{border-top-width:0}.border-t-2{border-top-width:2px}.border-dashed{border-style:dashed}.border-dotted{border-style:dotted}.border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.border-border{border-color:hsl(var(--border))}.border-border\\/50{border-color:hsl(var(--border)/.5)}.border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.border-input{border-color:hsl(var(--input))}.border-muted-foreground\\/20{border-color:hsl(var(--muted-foreground)/.2)}.border-primary{border-color:hsl(var(--primary))}.border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity:1;border-color:rgb(254 240 138/var(--tw-border-opacity,1))}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\\/80{background-color:hsl(var(--background)/.8)}.bg-background\\/95{background-color:hsl(var(--background)/.95)}.bg-black\\/5{background-color:rgba(0,0,0,.05)}.bg-black\\/70{background-color:rgba(0,0,0,.7)}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.bg-border{background-color:hsl(var(--border))}.bg-border\\/70{background-color:hsl(var(--border)/.7)}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-foreground{background-color:hsl(var(--foreground))}.bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\\/50{background-color:hsl(var(--muted)/.5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-white\\/20{background-color:hsla(0,0%,100%,.2)}.bg-yellow-50{--tw-bg-opacity:1;background-color:rgb(254 252 232/var(--tw-bg-opacity,1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.from-border{--tw-gradient-from:hsl(var(--border)) var(--tw-gradient-from-position);--tw-gradient-to:hsl(var(--border)/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.via-80\\%{--tw-gradient-via-position:80%}.to-transparent{--tw-gradient-to:transparent var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-foreground{fill:hsl(var(--foreground))}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.object-center{-o-object-position:center;object-position:center}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-px{padding:1px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-8{padding-bottom:2rem;padding-top:2rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-7{padding-left:1.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-8{padding-right:2rem}.pr-px{padding-right:1px}.pt-0{padding-top:0}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.leading-7{line-height:1.75rem}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-background{color:hsl(var(--background))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.text-white\\/60{color:hsla(0,0%,100%,.6)}.text-white\\/80{color:hsla(0,0%,100%,.8)}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-ring\\/50{--tw-ring-color:hsl(var(--ring)/0.5)}.ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-\\[color\\2c box-shadow\\]{transition-duration:.15s;transition-property:color,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.yoopta-editor::-moz-selection{background:#c6ddf8}.yoopta-editor::selection{background:#c6ddf8}.yoopta-slate{outline:none}.yoopta-block{margin:2px 0;position:relative}.yoopta-block:before{background-color:#2383e224;border-radius:4px;height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .2s;width:100%;z-index:0}.yoopta-block[data-block-selected=true]:before{background-color:#2383e224;content:\"\";opacity:1;transition:opacity .2s}.file\\:border-0::file-selector-button{border-width:0}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.file\\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.first\\:mt-0:first-child{margin-top:0}.last\\:border-b-0:last-child{border-bottom-width:0}.last\\:border-r-0:last-child{border-right-width:0}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-black\\/10:hover{background-color:rgba(0,0,0,.1)}.hover\\:bg-destructive\\/10:hover{background-color:hsl(var(--destructive)/.1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive)/.9)}.hover\\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\\:bg-muted\\/50:hover{background-color:hsl(var(--muted)/.5)}.hover\\:bg-muted\\/80:hover{background-color:hsl(var(--muted)/.8)}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary)/.9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary)/.8)}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-destructive:hover{color:hsl(var(--destructive))}.hover\\:text-foreground:hover{color:hsl(var(--foreground))}.hover\\:text-primary\\/80:hover{color:hsl(var(--primary)/.8)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:ring-4:hover{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:text-destructive:focus{color:hsl(var(--destructive))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:border-ring:focus-visible{border-color:hsl(var(--ring))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline-1:focus-visible{outline-width:1px}.focus-visible\\:ring-0:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-4:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:hsl(var(--ring)/0.5)}.focus-visible\\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color:hsl(var(--background))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group\\/code-block:hover .group-hover\\/code-block\\:opacity-100,.group\\/code-group-content:hover .group-hover\\/code-group-content\\:opacity-100,.group\\/step:hover .group-hover\\/step\\:opacity-100,.group\\/steps-node:hover .group-hover\\/steps-node\\:opacity-100,.group\\/tab:hover .group-hover\\/tab\\:opacity-100{opacity:1}.peer:disabled~.peer-disabled\\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\\:opacity-70{opacity:.7}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[orientation\\=horizontal\\]\\:h-1\\.5[data-orientation=horizontal]{height:.375rem}.data-\\[orientation\\=horizontal\\]\\:h-full[data-orientation=horizontal],.data-\\[orientation\\=vertical\\]\\:h-full[data-orientation=vertical]{height:100%}.data-\\[size\\=default\\]\\:h-9[data-size=default]{height:2.25rem}.data-\\[size\\=sm\\]\\:h-8[data-size=sm]{height:2rem}.data-\\[orientation\\=vertical\\]\\:min-h-44[data-orientation=vertical]{min-height:11rem}.data-\\[orientation\\=horizontal\\]\\:w-full[data-orientation=horizontal]{width:100%}.data-\\[orientation\\=vertical\\]\\:w-1\\.5[data-orientation=vertical]{width:.375rem}.data-\\[orientation\\=vertical\\]\\:w-auto[data-orientation=vertical]{width:auto}.data-\\[orientation\\=vertical\\]\\:w-full[data-orientation=vertical]{width:100%}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x:1rem}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked],.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x:0px}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\\[state\\=closed\\]\\:animate-accordion-up[data-state=closed]{animation:accordion-up .2s ease-out}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\\[state\\=open\\]\\:animate-accordion-down[data-state=open]{animation:accordion-down .2s ease-out}.data-\\[orientation\\=vertical\\]\\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\\[align\\=start\\]\\:items-start[data-align=start]{align-items:flex-start}.data-\\[align\\=end\\]\\:items-end[data-align=end]{align-items:flex-end}.data-\\[align\\=center\\]\\:items-center[data-align=center]{align-items:center}.data-\\[state\\=active\\]\\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\\[state\\=selected\\]\\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\\[inset\\]\\:pl-8[data-inset]{padding-left:2rem}.data-\\[placeholder\\]\\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\\[state\\=active\\]\\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\\[state\\=open\\]\\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\\[variant\\=destructive\\]\\:text-destructive[data-variant=destructive]{color:hsl(var(--destructive))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1[data-slot=select-value]>*{-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box;overflow:hidden}.\\*\\:data-\\[slot\\=select-value\\]\\:flex[data-slot=select-value]>*{display:flex}.\\*\\:data-\\[slot\\=select-value\\]\\:items-center[data-slot=select-value]>*{align-items:center}.\\*\\:data-\\[slot\\=select-value\\]\\:gap-2[data-slot=select-value]>*{gap:.5rem}.data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10:focus[data-variant=destructive]{background-color:hsl(var(--destructive)/.1)}.data-\\[variant\\=destructive\\]\\:focus\\:text-destructive:focus[data-variant=destructive]{color:hsl(var(--destructive))}.dark\\:border-blue-800:is(.dark *){--tw-border-opacity:1;border-color:rgb(30 64 175/var(--tw-border-opacity,1))}.dark\\:border-green-800:is(.dark *){--tw-border-opacity:1;border-color:rgb(22 101 52/var(--tw-border-opacity,1))}.dark\\:border-red-800:is(.dark *){--tw-border-opacity:1;border-color:rgb(153 27 27/var(--tw-border-opacity,1))}.dark\\:border-yellow-800:is(.dark *){--tw-border-opacity:1;border-color:rgb(133 77 14/var(--tw-border-opacity,1))}.dark\\:bg-blue-950:is(.dark *){--tw-bg-opacity:1;background-color:rgb(23 37 84/var(--tw-bg-opacity,1))}.dark\\:bg-green-950:is(.dark *){--tw-bg-opacity:1;background-color:rgb(5 46 22/var(--tw-bg-opacity,1))}.dark\\:bg-input\\/30:is(.dark *){background-color:hsl(var(--input)/.3)}.dark\\:bg-red-950:is(.dark *){--tw-bg-opacity:1;background-color:rgb(69 10 10/var(--tw-bg-opacity,1))}.dark\\:bg-yellow-950:is(.dark *){--tw-bg-opacity:1;background-color:rgb(66 32 6/var(--tw-bg-opacity,1))}.dark\\:text-blue-100:is(.dark *){--tw-text-opacity:1;color:rgb(219 234 254/var(--tw-text-opacity,1))}.dark\\:text-green-100:is(.dark *){--tw-text-opacity:1;color:rgb(220 252 231/var(--tw-text-opacity,1))}.dark\\:text-green-400:is(.dark *){--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity,1))}.dark\\:text-red-100:is(.dark *){--tw-text-opacity:1;color:rgb(254 226 226/var(--tw-text-opacity,1))}.dark\\:text-yellow-100:is(.dark *){--tw-text-opacity:1;color:rgb(254 249 195/var(--tw-text-opacity,1))}.dark\\:hover\\:bg-input\\/50:hover:is(.dark *){background-color:hsl(var(--input)/.5)}.dark\\:hover\\:bg-white\\/10:hover:is(.dark *){background-color:hsla(0,0%,100%,.1)}.dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20:focus[data-variant=destructive]:is(.dark *){background-color:hsl(var(--destructive)/.2)}@media (min-width:768px){.md\\:basis-1\\/2{flex-basis:50%}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width:1024px){.lg\\:basis-1\\/3{flex-basis:33.333333%}.lg\\:text-5xl{font-size:3rem;line-height:1}}.\\[\\&\\:has\\(\\[role\\=checkbox\\]\\)\\]\\:pr-0:has([role=checkbox]){padding-right:0}.\\[\\&\\:not\\(\\:first-child\\)\\]\\:mt-6:not(:first-child){margin-top:1.5rem}.\\[\\&\\>\\[role\\=checkbox\\]\\]\\:translate-y-\\[2px\\]>[role=checkbox]{--tw-translate-y:2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\[\\&\\>div\\]\\:contents>div{display:contents}.\\[\\&\\>li\\]\\:mt-2>li{margin-top:.5rem}.\\[\\&\\>p\\]\\:m-0>p{margin:0}.\\[\\&\\>p\\]\\:text-sm>p{font-size:.875rem;line-height:1.25rem}.\\[\\&\\>tr\\]\\:last\\:border-b-0:last-child>tr{border-bottom-width:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){height:1rem;width:1rem}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground svg:not([class*=text-]){color:hsl(var(--muted-foreground))}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_tr\\:first-child\\]\\:border-t tr:first-child{border-top-width:1px}.\\[\\&_tr\\]\\:border-b tr{border-bottom-width:1px}.\\[\\&_tr\\]\\:border-border tr{border-color:hsl(var(--border))}");var oe=function(){return oe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},oe.apply(this,arguments)};function ie(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function ae(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function se(t,n=[]){let o=[];const i=()=>{const e=o.map(e=>r.createContext(e));return function(n){const o=n?.[t]||e;return r.useMemo(()=>({[`__scope${t}`]:{...n,[t]:o}}),[n,o])}};return i.scopeName=t,[function(n,i){const a=r.createContext(i),s=o.length;o=[...o,i];const l=n=>{const{scope:o,children:i,...l}=n,c=o?.[t]?.[s]||a,d=r.useMemo(()=>l,Object.values(l));return e(c.Provider,{value:d,children:i})};return l.displayName=n+"Provider",[l,function(e,o){const l=o?.[t]?.[s]||a,c=r.useContext(l);if(c)return c;if(void 0!==i)return i;throw new Error(`\`${e}\` must be used within \`${n}\``)}]},le(i,...n)]}function le(...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:r})=>({...t,...n(e)[`__scope${r}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function ce(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function de(...e){return t=>{let n=!1;const r=e.map(e=>{const r=ce(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():ce(e[t],null)}}}}function ue(...e){return r.useCallback(de(...e),e)}function pe(t){const n=he(t),o=r.forwardRef((t,o)=>{const{children:i,...a}=t,s=r.Children.toArray(i),l=s.find(ge);if(l){const t=l.props.children,i=s.map(e=>e===l?r.Children.count(t)>1?r.Children.only(null):r.isValidElement(t)?t.props.children:null:e);return e(n,{...a,ref:o,children:r.isValidElement(t)?r.cloneElement(t,void 0,i):null})}return e(n,{...a,ref:o,children:i})});return o.displayName=`${t}.Slot`,o}function he(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),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(i.ref=t?de(t,e):e),r.cloneElement(n,i)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}"function"==typeof SuppressedError&&SuppressedError;var fe=Symbol("radix.slottable");function ge(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===fe}function me(t){const n=t+"CollectionProvider",[r,i]=se(n),[a,s]=r(n,{collectionRef:{current:null},itemMap:new Map}),l=t=>{const{scope:n,children:r}=t,i=o.useRef(null),s=o.useRef(new Map).current;return e(a,{scope:n,itemMap:s,collectionRef:i,children:r})};l.displayName=n;const c=t+"CollectionSlot",d=pe(c),u=o.forwardRef((t,n)=>{const{scope:r,children:o}=t,i=ue(n,s(c,r).collectionRef);return e(d,{ref:i,children:o})});u.displayName=c;const p=t+"CollectionItemSlot",h="data-radix-collection-item",f=pe(p),g=o.forwardRef((t,n)=>{const{scope:r,children:i,...a}=t,l=o.useRef(null),c=ue(n,l),d=s(p,r);return o.useEffect(()=>(d.itemMap.set(l,{ref:l,...a}),()=>{d.itemMap.delete(l)})),e(f,{[h]:"",ref:c,children:i})});return g.displayName=p,[{Provider:l,Slot:u,ItemSlot:g},function(e){const n=s(t+"CollectionConsumer",e);return o.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},i]}function be(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var ve=globalThis?.document?r.useLayoutEffect:()=>{},we=r[" useInsertionEffect ".trim().toString()]||ve;function ye({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[i,a,s]=function({defaultProp:e,onChange:t}){const[n,o]=r.useState(e),i=r.useRef(n),a=r.useRef(t);return we(()=>{a.current=t},[t]),r.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,o,a]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:i;{const t=r.useRef(void 0!==e);r.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"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=l},[l,o])}const d=r.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[l,e,a,s]);return[c,d]}var xe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const o=pe(`Primitive.${n}`),i=r.forwardRef((t,r)=>{const{asChild:i,...a}=t,s=i?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e(s,{...a,ref:r})});return i.displayName=`Primitive.${n}`,{...t,[n]:i}},{});function ke(e,t){e&&v.flushSync(()=>e.dispatchEvent(t))}var Ne=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=r.useState(),o=r.useRef(null),i=r.useRef(e),a=r.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return r.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=Ce(o.current);a.current="mounted"===l?e:"none"},[l]),ve(()=>{const t=o.current,n=i.current;if(n!==e){const r=a.current,o=Ce(t);if(e)c("MOUNT");else if("none"===o||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=e}},[e,c]),ve(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const a=Ce(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&a&&(c("ANIMATION_END"),!i.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=Ce(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),i="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),a=ue(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}(i));return"function"==typeof n||o.isPresent?r.cloneElement(i,{ref:a}):null};function Ce(e){return e?.animationName||"none"}Ne.displayName="Presence";var Oe=r[" useId ".trim().toString()]||(()=>{}),Se=0;function Ee(e){const[t,n]=r.useState(Oe());return ve(()=>{e||n(e=>e??String(Se++))},[e]),e||(t?`radix-${t}`:"")}var je="Collapsible",[Re,ze]=se(je),[De,Pe]=Re(je),Me=r.forwardRef((t,n)=>{const{__scopeCollapsible:o,open:i,defaultOpen:a,disabled:s,onOpenChange:l,...c}=t,[d,u]=ye({prop:i,defaultProp:a??!1,onChange:l,caller:je});return e(De,{scope:o,disabled:s,contentId:Ee(),open:d,onOpenToggle:r.useCallback(()=>u(e=>!e),[u]),children:e(xe.div,{"data-state":He(d),"data-disabled":s?"":void 0,...c,ref:n})})});Me.displayName=je;var Te="CollapsibleTrigger",_e=r.forwardRef((t,n)=>{const{__scopeCollapsible:r,...o}=t,i=Pe(Te,r);return e(xe.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":He(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...o,ref:n,onClick:be(t.onClick,i.onOpenToggle)})});_e.displayName=Te;var Ie="CollapsibleContent",Ae=r.forwardRef((t,n)=>{const{forceMount:r,...o}=t,i=Pe(Ie,t.__scopeCollapsible);return e(Ne,{present:r||i.open,children:({present:t})=>e(Le,{...o,ref:n,present:t})})});Ae.displayName=Ie;var Le=r.forwardRef((t,n)=>{const{__scopeCollapsible:o,present:i,children:a,...s}=t,l=Pe(Ie,o),[c,d]=r.useState(i),u=r.useRef(null),p=ue(n,u),h=r.useRef(0),f=h.current,g=r.useRef(0),m=g.current,b=l.open||c,v=r.useRef(b),w=r.useRef(void 0);return r.useEffect(()=>{const e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),ve(()=>{const e=u.current;if(e){w.current=w.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const t=e.getBoundingClientRect();h.current=t.height,g.current=t.width,v.current||(e.style.transitionDuration=w.current.transitionDuration,e.style.animationName=w.current.animationName),d(i)}},[l.open,i]),e(xe.div,{"data-state":He(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!b,...s,ref:p,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...t.style},children:b&&a})});function He(e){return e?"open":"closed"}var Fe=Me,We=_e,Be=Ae,Ue=r.createContext(void 0);function Ve(e){const t=r.useContext(Ue);return e||t||"ltr"}var $e="Accordion",Xe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ye,Ke,qe]=me($e),[Ge,Ze]=se($e,[qe,ze]),Je=ze(),Qe=o.forwardRef((t,n)=>{const{type:r,...o}=t,i=o,a=o;return e(Ye.Provider,{scope:t.__scopeAccordion,children:"multiple"===r?e(it,{...a,ref:n}):e(ot,{...i,ref:n})})});Qe.displayName=$e;var[et,tt]=Ge($e),[nt,rt]=Ge($e,{collapsible:!1}),ot=o.forwardRef((t,n)=>{const{value:r,defaultValue:i,onValueChange:a=()=>{},collapsible:s=!1,...l}=t,[c,d]=ye({prop:r,defaultProp:i??"",onChange:a,caller:$e});return e(et,{scope:t.__scopeAccordion,value:o.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:o.useCallback(()=>s&&d(""),[s,d]),children:e(nt,{scope:t.__scopeAccordion,collapsible:s,children:e(lt,{...l,ref:n})})})}),it=o.forwardRef((t,n)=>{const{value:r,defaultValue:i,onValueChange:a=()=>{},...s}=t,[l,c]=ye({prop:r,defaultProp:i??[],onChange:a,caller:$e}),d=o.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=o.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return e(et,{scope:t.__scopeAccordion,value:l,onItemOpen:d,onItemClose:u,children:e(nt,{scope:t.__scopeAccordion,collapsible:!0,children:e(lt,{...s,ref:n})})})}),[at,st]=Ge($e),lt=o.forwardRef((t,n)=>{const{__scopeAccordion:r,disabled:i,dir:a,orientation:s="vertical",...l}=t,c=ue(o.useRef(null),n),d=Ke(r),u="ltr"===Ve(a),p=be(t.onKeyDown,e=>{if(!Xe.includes(e.key))return;const t=e.target,n=d().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),o=n.length;if(-1===r)return;e.preventDefault();let i=r;const a=o-1,l=()=>{i=r+1,i>a&&(i=0)},c=()=>{i=r-1,i<0&&(i=a)};switch(e.key){case"Home":i=0;break;case"End":i=a;break;case"ArrowRight":"horizontal"===s&&(u?l():c());break;case"ArrowDown":"vertical"===s&&l();break;case"ArrowLeft":"horizontal"===s&&(u?c():l());break;case"ArrowUp":"vertical"===s&&c()}const p=i%o;n[p].ref.current?.focus()});return e(at,{scope:r,disabled:i,direction:a,orientation:s,children:e(Ye.Slot,{scope:r,children:e(xe.div,{...l,"data-orientation":s,ref:c,onKeyDown:i?void 0:p})})})}),ct="AccordionItem",[dt,ut]=Ge(ct),pt=o.forwardRef((t,n)=>{const{__scopeAccordion:r,value:o,...i}=t,a=st(ct,r),s=tt(ct,r),l=Je(r),c=Ee(),d=o&&s.value.includes(o)||!1,u=a.disabled||t.disabled;return e(dt,{scope:r,open:d,disabled:u,triggerId:c,children:e(Fe,{"data-orientation":a.orientation,"data-state":vt(d),...l,...i,ref:n,disabled:u,open:d,onOpenChange:e=>{e?s.onItemOpen(o):s.onItemClose(o)}})})});pt.displayName=ct;var ht="AccordionHeader";o.forwardRef((t,n)=>{const{__scopeAccordion:r,...o}=t,i=st($e,r),a=ut(ht,r);return e(xe.h3,{"data-orientation":i.orientation,"data-state":vt(a.open),"data-disabled":a.disabled?"":void 0,...o,ref:n})}).displayName=ht;var ft="AccordionTrigger",gt=o.forwardRef((t,n)=>{const{__scopeAccordion:r,...o}=t,i=st($e,r),a=ut(ft,r),s=rt(ft,r),l=Je(r);return e(Ye.ItemSlot,{scope:r,children:e(We,{"aria-disabled":a.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...l,...o,ref:n})})});gt.displayName=ft;var mt="AccordionContent",bt=o.forwardRef((t,n)=>{const{__scopeAccordion:r,...o}=t,i=st($e,r),a=ut(mt,r),s=Je(r);return e(Be,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...s,...o,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});function vt(e){return e?"open":"closed"}bt.displayName=mt;var wt=Qe,yt=pt,xt=gt,kt=bt;const Nt=i((t,n)=>{var{children:r}=t,o=ie(t,["children"]);return e(wt,Object.assign({},o,{className:"w-full rounded-md border",ref:n,"data-slot":"accordion"},{children:r}))});Nt.displayName="Accordion";const Ct=i((t,n)=>{var{children:r}=t,o=ie(t,["children"]);return e(yt,Object.assign({},o,{ref:n,"data-slot":"accordion-item",className:"border-b last:border-b-0"},{children:r}))});Ct.displayName="AccordionItem";const Ot=t=>{var{children:n}=t,r=ie(t,["children"]);return e(xt,Object.assign({},r,{type:"button",contentEditable:!1,"data-slot":"accordion-trigger",className:"flex shrink-0 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},{children:n}))},St=i((t,n)=>{var{children:r}=t,o=ie(t,["children"]);return e(kt,Object.assign({},o,{ref:n,"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"},{children:e("div",Object.assign({className:"pt-0 pb-4 text-muted-foreground px-5"},{children:r}))}))});St.displayName="AccordionContent";const Et=(...e)=>e.filter((e,t,n)=>Boolean(e)&&n.indexOf(e)===t).join(" ");
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as r from"react";import o,{forwardRef as i,createElement as a,useReducer as s,useMemo as l,useCallback as c,useRef as d,useState as u,useEffect as p,createContext as h,useContext as f,useLayoutEffect as g,memo as m,PureComponent as b}from"react";import*as v from"react-dom";import w,{flushSync as y}from"react-dom";import{useYooptaEditor as x,Blocks as k,Elements as N,Selection as O,useElementSelected as C,useBlockSelected as S,useYooptaPluginOptions as j,useBlockData as E}from"@yoopta/editor";import{Editor as R,Path as z,Transforms as D,Element as P,Text as M}from"slate";import"@yoopta/ui/element-options";import{CodeCommands as T,isLanguageSupported as I,SHIKI_CODE_LANGUAGES as _,SHIKI_CODE_THEMES as A,HighlightedCodeOverlay as L,CodeGroupCommands as H}from"@yoopta/code";import{detectProvider as F,getSupportedProviders as W,isEmbedUrl as B,parseEmbedUrl as U,calculateEmbedDimensions as V}from"@yoopta/embed";import{useImageUpload as $,useImageDelete as X,useImagePreview as Y}from"@yoopta/image";import{useNumberListCount as K}from"@yoopta/lists";import{StepsCommands as q}from"@yoopta/steps";import{TableCommands as G,TABLE_CELLS_IN_SELECTION as Z,TABLE_SLATE_TO_SELECTION_SET as J}from"@yoopta/table";import{Portal as Q}from"@yoopta/ui/portal";import{TabsCommands as ee}from"@yoopta/tabs";import{parseVideoUrl as te,getEmbedUrl as ne,useVideoUpload as re,useVideoDelete as oe,useVideoPreview as ie,buildVideoProvider as ae}from"@yoopta/video";function se(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function le(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}le(":root{--background:0 0% 100%;--foreground:0 0% 3.9%;--card:0 0% 100%;--card-foreground:0 0% 3.9%;--popover:0 0% 100%;--popover-foreground:0 0% 3.9%;--primary:0 0% 9%;--primary-foreground:0 0% 98%;--secondary:0 0% 96.1%;--secondary-foreground:0 0% 9%;--muted:0 0% 96.1%;--muted-foreground:0 0% 45.1%;--accent:0 0% 96.1%;--accent-foreground:0 0% 9%;--destructive:0 84.2% 60.2%;--destructive-foreground:0 0% 98%;--border:0 0% 89.8%;--input:0 0% 89.8%;--ring:0 0% 3.9%;--radius:0.5rem}.dark,[data-theme=dark]{--background:0 0% 3.9%;--foreground:0 0% 98%;--card:0 0% 3.9%;--card-foreground:0 0% 98%;--popover:0 0% 3.9%;--popover-foreground:0 0% 98%;--primary:0 0% 98%;--primary-foreground:0 0% 9%;--secondary:0 0% 14.9%;--secondary-foreground:0 0% 98%;--muted:0 0% 14.9%;--muted-foreground:0 0% 63.9%;--accent:0 0% 14.9%;--accent-foreground:0 0% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:0 0% 98%;--border:0 0% 14.9%;--input:0 0% 14.9%;--ring:0 0% 83.1%}");le("*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Inter,system-ui,sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-bottom-12{bottom:-3rem}.-left-12{left:-3rem}.-right-12{right:-3rem}.-top-12{top:-3rem}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:.5rem}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.top-0{top:0}.top-1\\/2{top:50%}.top-2{top:.5rem}.top-\\[2\\.75rem\\]{top:2.75rem}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-bottom:0;margin-top:0}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-4{margin-bottom:1rem;margin-top:1rem}.-ml-3\\.5{margin-left:-.875rem}.-ml-4{margin-left:-1rem}.-mt-4{margin-top:-1rem}.mb-2{margin-bottom:.5rem}.ml-1{margin-left:.25rem}.ml-3\\.5{margin-left:.875rem}.ml-6{margin-left:1.5rem}.ml-\\[-13px\\]{margin-left:-13px}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\\.5{margin-top:.125rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.\\!block{display:block!important}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1/1}.size-2{height:.5rem;width:.5rem}.size-2\\.5{height:.625rem;width:.625rem}.size-3\\.5{height:.875rem;width:.875rem}.size-4{height:1rem;width:1rem}.size-7{height:1.75rem;width:1.75rem}.size-8{height:2rem;width:2rem}.size-full{height:100%;width:100%}.h-10{height:2.5rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[1px\\]{height:1px}.h-\\[2px\\]{height:2px}.h-\\[calc\\(100\\%-2\\.75rem\\)\\]{height:calc(100% - 2.75rem)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-\\[200px\\]{max-height:200px}.max-h-full{max-height:100%}.min-h-16{min-height:4rem}.min-h-\\[300px\\]{min-height:300px}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\\[1px\\]{width:1px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0}.min-w-\\[160px\\]{min-width:160px}.min-w-\\[180px\\]{min-width:180px}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.table-fixed{table-layout:fixed}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.translate-y-0{--tw-translate-y:0px}.translate-y-0,.translate-y-2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-2{--tw-translate-y:0.5rem}.translate-y-\\[calc\\(-50\\%_-_2px\\)\\]{--tw-translate-y:calc(-50% - 2px)}.rotate-180,.translate-y-\\[calc\\(-50\\%_-_2px\\)\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate:180deg}.rotate-45{--tw-rotate:45deg}.rotate-45,.rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate:90deg}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.scroll-m-20{scroll-margin:5rem}.scroll-my-1{scroll-margin-bottom:.25rem;scroll-margin-top:.25rem}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.125rem*var(--tw-space-y-reverse));margin-top:calc(.125rem*(1 - var(--tw-space-y-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.25rem*var(--tw-space-y-reverse));margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.375rem*var(--tw-space-y-reverse));margin-top:calc(.375rem*(1 - var(--tw-space-y-reverse)))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.text-balance{text-wrap:balance}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-b-lg{border-bottom-left-radius:var(--radius);border-bottom-right-radius:var(--radius)}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-0{border-width:0}.border-2{border-width:2px}.border-x-0{border-left-width:0;border-right-width:0}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0}.border-t{border-top-width:1px}.border-t-0{border-top-width:0}.border-t-2{border-top-width:2px}.border-dashed{border-style:dashed}.border-dotted{border-style:dotted}.border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.border-border{border-color:hsl(var(--border))}.border-border\\/50{border-color:hsl(var(--border)/.5)}.border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.border-input{border-color:hsl(var(--input))}.border-muted-foreground\\/20{border-color:hsl(var(--muted-foreground)/.2)}.border-primary{border-color:hsl(var(--primary))}.border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity:1;border-color:rgb(254 240 138/var(--tw-border-opacity,1))}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\\/80{background-color:hsl(var(--background)/.8)}.bg-background\\/95{background-color:hsl(var(--background)/.95)}.bg-black\\/5{background-color:rgba(0,0,0,.05)}.bg-black\\/70{background-color:rgba(0,0,0,.7)}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.bg-border{background-color:hsl(var(--border))}.bg-border\\/70{background-color:hsl(var(--border)/.7)}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-foreground{background-color:hsl(var(--foreground))}.bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\\/50{background-color:hsl(var(--muted)/.5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-white\\/20{background-color:hsla(0,0%,100%,.2)}.bg-yellow-50{--tw-bg-opacity:1;background-color:rgb(254 252 232/var(--tw-bg-opacity,1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.from-border{--tw-gradient-from:hsl(var(--border)) var(--tw-gradient-from-position);--tw-gradient-to:hsl(var(--border)/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.via-80\\%{--tw-gradient-via-position:80%}.to-transparent{--tw-gradient-to:transparent var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-foreground{fill:hsl(var(--foreground))}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.object-center{-o-object-position:center;object-position:center}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-px{padding:1px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-8{padding-bottom:2rem;padding-top:2rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-7{padding-left:1.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-8{padding-right:2rem}.pr-px{padding-right:1px}.pt-0{padding-top:0}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\\[10px\\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.leading-7{line-height:1.75rem}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-background{color:hsl(var(--background))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.text-white\\/60{color:hsla(0,0%,100%,.6)}.text-white\\/80{color:hsla(0,0%,100%,.8)}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-ring\\/50{--tw-ring-color:hsl(var(--ring)/0.5)}.ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-\\[color\\2c box-shadow\\]{transition-duration:.15s;transition-property:color,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.yoopta-editor::-moz-selection{background:#c6ddf8}.yoopta-editor::selection{background:#c6ddf8}.yoopta-slate{outline:none}.yoopta-block{margin:2px 0;position:relative}.yoopta-block:before{background-color:#2383e224;border-radius:4px;height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .2s;width:100%;z-index:0}.yoopta-block[data-block-selected=true]:before{background-color:#2383e224;content:\"\";opacity:1;transition:opacity .2s}.file\\:border-0::file-selector-button{border-width:0}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.file\\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.first\\:mt-0:first-child{margin-top:0}.last\\:border-b-0:last-child{border-bottom-width:0}.last\\:border-r-0:last-child{border-right-width:0}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-black\\/10:hover{background-color:rgba(0,0,0,.1)}.hover\\:bg-destructive\\/10:hover{background-color:hsl(var(--destructive)/.1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive)/.9)}.hover\\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\\:bg-muted\\/50:hover{background-color:hsl(var(--muted)/.5)}.hover\\:bg-muted\\/80:hover{background-color:hsl(var(--muted)/.8)}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary)/.9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary)/.8)}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-destructive:hover{color:hsl(var(--destructive))}.hover\\:text-foreground:hover{color:hsl(var(--foreground))}.hover\\:text-primary\\/80:hover{color:hsl(var(--primary)/.8)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:ring-4:hover{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:text-destructive:focus{color:hsl(var(--destructive))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:border-ring:focus-visible{border-color:hsl(var(--ring))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline-1:focus-visible{outline-width:1px}.focus-visible\\:ring-0:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-4:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:hsl(var(--ring)/0.5)}.focus-visible\\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color:hsl(var(--background))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group\\/code-block:hover .group-hover\\/code-block\\:opacity-100,.group\\/code-group-content:hover .group-hover\\/code-group-content\\:opacity-100,.group\\/step:hover .group-hover\\/step\\:opacity-100,.group\\/steps-node:hover .group-hover\\/steps-node\\:opacity-100,.group\\/tab:hover .group-hover\\/tab\\:opacity-100{opacity:1}.peer:disabled~.peer-disabled\\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\\:opacity-70{opacity:.7}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[orientation\\=horizontal\\]\\:h-1\\.5[data-orientation=horizontal]{height:.375rem}.data-\\[orientation\\=horizontal\\]\\:h-full[data-orientation=horizontal],.data-\\[orientation\\=vertical\\]\\:h-full[data-orientation=vertical]{height:100%}.data-\\[size\\=default\\]\\:h-9[data-size=default]{height:2.25rem}.data-\\[size\\=sm\\]\\:h-8[data-size=sm]{height:2rem}.data-\\[orientation\\=vertical\\]\\:min-h-44[data-orientation=vertical]{min-height:11rem}.data-\\[orientation\\=horizontal\\]\\:w-full[data-orientation=horizontal]{width:100%}.data-\\[orientation\\=vertical\\]\\:w-1\\.5[data-orientation=vertical]{width:.375rem}.data-\\[orientation\\=vertical\\]\\:w-auto[data-orientation=vertical]{width:auto}.data-\\[orientation\\=vertical\\]\\:w-full[data-orientation=vertical]{width:100%}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x:1rem}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked],.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x:0px}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\\[state\\=closed\\]\\:animate-accordion-up[data-state=closed]{animation:accordion-up .2s ease-out}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\\[state\\=open\\]\\:animate-accordion-down[data-state=open]{animation:accordion-down .2s ease-out}.data-\\[orientation\\=vertical\\]\\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\\[align\\=start\\]\\:items-start[data-align=start]{align-items:flex-start}.data-\\[align\\=end\\]\\:items-end[data-align=end]{align-items:flex-end}.data-\\[align\\=center\\]\\:items-center[data-align=center]{align-items:center}.data-\\[state\\=active\\]\\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\\[state\\=selected\\]\\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\\[inset\\]\\:pl-8[data-inset]{padding-left:2rem}.data-\\[placeholder\\]\\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\\[state\\=active\\]\\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\\[state\\=open\\]\\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\\[variant\\=destructive\\]\\:text-destructive[data-variant=destructive]{color:hsl(var(--destructive))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1[data-slot=select-value]>*{-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box;overflow:hidden}.\\*\\:data-\\[slot\\=select-value\\]\\:flex[data-slot=select-value]>*{display:flex}.\\*\\:data-\\[slot\\=select-value\\]\\:items-center[data-slot=select-value]>*{align-items:center}.\\*\\:data-\\[slot\\=select-value\\]\\:gap-2[data-slot=select-value]>*{gap:.5rem}.data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10:focus[data-variant=destructive]{background-color:hsl(var(--destructive)/.1)}.data-\\[variant\\=destructive\\]\\:focus\\:text-destructive:focus[data-variant=destructive]{color:hsl(var(--destructive))}.dark\\:border-blue-800:is(.dark *){--tw-border-opacity:1;border-color:rgb(30 64 175/var(--tw-border-opacity,1))}.dark\\:border-green-800:is(.dark *){--tw-border-opacity:1;border-color:rgb(22 101 52/var(--tw-border-opacity,1))}.dark\\:border-red-800:is(.dark *){--tw-border-opacity:1;border-color:rgb(153 27 27/var(--tw-border-opacity,1))}.dark\\:border-yellow-800:is(.dark *){--tw-border-opacity:1;border-color:rgb(133 77 14/var(--tw-border-opacity,1))}.dark\\:bg-blue-950:is(.dark *){--tw-bg-opacity:1;background-color:rgb(23 37 84/var(--tw-bg-opacity,1))}.dark\\:bg-green-950:is(.dark *){--tw-bg-opacity:1;background-color:rgb(5 46 22/var(--tw-bg-opacity,1))}.dark\\:bg-input\\/30:is(.dark *){background-color:hsl(var(--input)/.3)}.dark\\:bg-red-950:is(.dark *){--tw-bg-opacity:1;background-color:rgb(69 10 10/var(--tw-bg-opacity,1))}.dark\\:bg-yellow-950:is(.dark *){--tw-bg-opacity:1;background-color:rgb(66 32 6/var(--tw-bg-opacity,1))}.dark\\:text-blue-100:is(.dark *){--tw-text-opacity:1;color:rgb(219 234 254/var(--tw-text-opacity,1))}.dark\\:text-green-100:is(.dark *){--tw-text-opacity:1;color:rgb(220 252 231/var(--tw-text-opacity,1))}.dark\\:text-green-400:is(.dark *){--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity,1))}.dark\\:text-red-100:is(.dark *){--tw-text-opacity:1;color:rgb(254 226 226/var(--tw-text-opacity,1))}.dark\\:text-yellow-100:is(.dark *){--tw-text-opacity:1;color:rgb(254 249 195/var(--tw-text-opacity,1))}.dark\\:hover\\:bg-input\\/50:hover:is(.dark *){background-color:hsl(var(--input)/.5)}.dark\\:hover\\:bg-white\\/10:hover:is(.dark *){background-color:hsla(0,0%,100%,.1)}.dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20:focus[data-variant=destructive]:is(.dark *){background-color:hsl(var(--destructive)/.2)}@media (min-width:768px){.md\\:basis-1\\/2{flex-basis:50%}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width:1024px){.lg\\:basis-1\\/3{flex-basis:33.333333%}.lg\\:text-5xl{font-size:3rem;line-height:1}}.\\[\\&\\:has\\(\\[role\\=checkbox\\]\\)\\]\\:pr-0:has([role=checkbox]){padding-right:0}.\\[\\&\\:not\\(\\:first-child\\)\\]\\:mt-6:not(:first-child){margin-top:1.5rem}.\\[\\&\\>\\[role\\=checkbox\\]\\]\\:translate-y-\\[2px\\]>[role=checkbox]{--tw-translate-y:2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\[\\&\\>div\\]\\:contents>div{display:contents}.\\[\\&\\>li\\]\\:mt-2>li{margin-top:.5rem}.\\[\\&\\>p\\]\\:m-0>p{margin:0}.\\[\\&\\>p\\]\\:text-sm>p{font-size:.875rem;line-height:1.25rem}.\\[\\&\\>tr\\]\\:last\\:border-b-0:last-child>tr{border-bottom-width:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){height:1rem;width:1rem}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground svg:not([class*=text-]){color:hsl(var(--muted-foreground))}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_tr\\:first-child\\]\\:border-t tr:first-child{border-top-width:1px}.\\[\\&_tr\\]\\:border-b tr{border-bottom-width:1px}.\\[\\&_tr\\]\\:border-border tr{border-color:hsl(var(--border))}");var ce=function(){return ce=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ce.apply(this,arguments)};function de(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function ue(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function pe(t,n=[]){let o=[];const i=()=>{const e=o.map(e=>r.createContext(e));return function(n){const o=n?.[t]||e;return r.useMemo(()=>({[`__scope${t}`]:{...n,[t]:o}}),[n,o])}};return i.scopeName=t,[function(n,i){const a=r.createContext(i),s=o.length;o=[...o,i];const l=n=>{const{scope:o,children:i,...l}=n,c=o?.[t]?.[s]||a,d=r.useMemo(()=>l,Object.values(l));return e(c.Provider,{value:d,children:i})};return l.displayName=n+"Provider",[l,function(e,o){const l=o?.[t]?.[s]||a,c=r.useContext(l);if(c)return c;if(void 0!==i)return i;throw new Error(`\`${e}\` must be used within \`${n}\``)}]},he(i,...n)]}function he(...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:r})=>({...t,...n(e)[`__scope${r}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function fe(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function ge(...e){return t=>{let n=!1;const r=e.map(e=>{const r=fe(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():fe(e[t],null)}}}}function me(...e){return r.useCallback(ge(...e),e)}function be(t){const n=ve(t),o=r.forwardRef((t,o)=>{const{children:i,...a}=t,s=r.Children.toArray(i),l=s.find(ye);if(l){const t=l.props.children,i=s.map(e=>e===l?r.Children.count(t)>1?r.Children.only(null):r.isValidElement(t)?t.props.children:null:e);return e(n,{...a,ref:o,children:r.isValidElement(t)?r.cloneElement(t,void 0,i):null})}return e(n,{...a,ref:o,children:i})});return o.displayName=`${t}.Slot`,o}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),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(i.ref=t?ge(t,e):e),r.cloneElement(n,i)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}"function"==typeof SuppressedError&&SuppressedError;var we=Symbol("radix.slottable");function ye(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===we}function xe(t){const n=t+"CollectionProvider",[r,i]=pe(n),[a,s]=r(n,{collectionRef:{current:null},itemMap:new Map}),l=t=>{const{scope:n,children:r}=t,i=o.useRef(null),s=o.useRef(new Map).current;return e(a,{scope:n,itemMap:s,collectionRef:i,children:r})};l.displayName=n;const c=t+"CollectionSlot",d=be(c),u=o.forwardRef((t,n)=>{const{scope:r,children:o}=t,i=me(n,s(c,r).collectionRef);return e(d,{ref:i,children:o})});u.displayName=c;const p=t+"CollectionItemSlot",h="data-radix-collection-item",f=be(p),g=o.forwardRef((t,n)=>{const{scope:r,children:i,...a}=t,l=o.useRef(null),c=me(n,l),d=s(p,r);return o.useEffect(()=>(d.itemMap.set(l,{ref:l,...a}),()=>{d.itemMap.delete(l)})),e(f,{[h]:"",ref:c,children:i})});return g.displayName=p,[{Provider:l,Slot:u,ItemSlot:g},function(e){const n=s(t+"CollectionConsumer",e);return o.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},i]}function ke(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var Ne=globalThis?.document?r.useLayoutEffect:()=>{},Oe=r[" useInsertionEffect ".trim().toString()]||Ne;function Ce({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[i,a,s]=function({defaultProp:e,onChange:t}){const[n,o]=r.useState(e),i=r.useRef(n),a=r.useRef(t);return Oe(()=>{a.current=t},[t]),r.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,o,a]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:i;{const t=r.useRef(void 0!==e);r.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"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=l},[l,o])}const d=r.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[l,e,a,s]);return[c,d]}var Se=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const o=be(`Primitive.${n}`),i=r.forwardRef((t,r)=>{const{asChild:i,...a}=t,s=i?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e(s,{...a,ref:r})});return i.displayName=`Primitive.${n}`,{...t,[n]:i}},{});function je(e,t){e&&v.flushSync(()=>e.dispatchEvent(t))}var Ee=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=r.useState(),o=r.useRef(null),i=r.useRef(e),a=r.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return r.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=Re(o.current);a.current="mounted"===l?e:"none"},[l]),Ne(()=>{const t=o.current,n=i.current;if(n!==e){const r=a.current,o=Re(t);if(e)c("MOUNT");else if("none"===o||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=e}},[e,c]),Ne(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const a=Re(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&a&&(c("ANIMATION_END"),!i.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=Re(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),i="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),a=me(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}(i));return"function"==typeof n||o.isPresent?r.cloneElement(i,{ref:a}):null};function Re(e){return e?.animationName||"none"}Ee.displayName="Presence";var ze=r[" useId ".trim().toString()]||(()=>{}),De=0;function Pe(e){const[t,n]=r.useState(ze());return Ne(()=>{e||n(e=>e??String(De++))},[e]),e||(t?`radix-${t}`:"")}var Me="Collapsible",[Te,Ie]=pe(Me),[_e,Ae]=Te(Me),Le=r.forwardRef((t,n)=>{const{__scopeCollapsible:o,open:i,defaultOpen:a,disabled:s,onOpenChange:l,...c}=t,[d,u]=Ce({prop:i,defaultProp:a??!1,onChange:l,caller:Me});return e(_e,{scope:o,disabled:s,contentId:Pe(),open:d,onOpenToggle:r.useCallback(()=>u(e=>!e),[u]),children:e(Se.div,{"data-state":Ve(d),"data-disabled":s?"":void 0,...c,ref:n})})});Le.displayName=Me;var He="CollapsibleTrigger",Fe=r.forwardRef((t,n)=>{const{__scopeCollapsible:r,...o}=t,i=Ae(He,r);return e(Se.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ve(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...o,ref:n,onClick:ke(t.onClick,i.onOpenToggle)})});Fe.displayName=He;var We="CollapsibleContent",Be=r.forwardRef((t,n)=>{const{forceMount:r,...o}=t,i=Ae(We,t.__scopeCollapsible);return e(Ee,{present:r||i.open,children:({present:t})=>e(Ue,{...o,ref:n,present:t})})});Be.displayName=We;var Ue=r.forwardRef((t,n)=>{const{__scopeCollapsible:o,present:i,children:a,...s}=t,l=Ae(We,o),[c,d]=r.useState(i),u=r.useRef(null),p=me(n,u),h=r.useRef(0),f=h.current,g=r.useRef(0),m=g.current,b=l.open||c,v=r.useRef(b),w=r.useRef(void 0);return r.useEffect(()=>{const e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),Ne(()=>{const e=u.current;if(e){w.current=w.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const t=e.getBoundingClientRect();h.current=t.height,g.current=t.width,v.current||(e.style.transitionDuration=w.current.transitionDuration,e.style.animationName=w.current.animationName),d(i)}},[l.open,i]),e(Se.div,{"data-state":Ve(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!b,...s,ref:p,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...t.style},children:b&&a})});function Ve(e){return e?"open":"closed"}var $e=Le,Xe=Fe,Ye=Be,Ke=r.createContext(void 0);function qe(e){const t=r.useContext(Ke);return e||t||"ltr"}var Ge="Accordion",Ze=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Je,Qe,et]=xe(Ge),[tt,nt]=pe(Ge,[et,Ie]),rt=Ie(),ot=o.forwardRef((t,n)=>{const{type:r,...o}=t,i=o,a=o;return e(Je.Provider,{scope:t.__scopeAccordion,children:"multiple"===r?e(dt,{...a,ref:n}):e(ct,{...i,ref:n})})});ot.displayName=Ge;var[it,at]=tt(Ge),[st,lt]=tt(Ge,{collapsible:!1}),ct=o.forwardRef((t,n)=>{const{value:r,defaultValue:i,onValueChange:a=()=>{},collapsible:s=!1,...l}=t,[c,d]=Ce({prop:r,defaultProp:i??"",onChange:a,caller:Ge});return e(it,{scope:t.__scopeAccordion,value:o.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:o.useCallback(()=>s&&d(""),[s,d]),children:e(st,{scope:t.__scopeAccordion,collapsible:s,children:e(ht,{...l,ref:n})})})}),dt=o.forwardRef((t,n)=>{const{value:r,defaultValue:i,onValueChange:a=()=>{},...s}=t,[l,c]=Ce({prop:r,defaultProp:i??[],onChange:a,caller:Ge}),d=o.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=o.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return e(it,{scope:t.__scopeAccordion,value:l,onItemOpen:d,onItemClose:u,children:e(st,{scope:t.__scopeAccordion,collapsible:!0,children:e(ht,{...s,ref:n})})})}),[ut,pt]=tt(Ge),ht=o.forwardRef((t,n)=>{const{__scopeAccordion:r,disabled:i,dir:a,orientation:s="vertical",...l}=t,c=me(o.useRef(null),n),d=Qe(r),u="ltr"===qe(a),p=ke(t.onKeyDown,e=>{if(!Ze.includes(e.key))return;const t=e.target,n=d().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),o=n.length;if(-1===r)return;e.preventDefault();let i=r;const a=o-1,l=()=>{i=r+1,i>a&&(i=0)},c=()=>{i=r-1,i<0&&(i=a)};switch(e.key){case"Home":i=0;break;case"End":i=a;break;case"ArrowRight":"horizontal"===s&&(u?l():c());break;case"ArrowDown":"vertical"===s&&l();break;case"ArrowLeft":"horizontal"===s&&(u?c():l());break;case"ArrowUp":"vertical"===s&&c()}const p=i%o;n[p].ref.current?.focus()});return e(ut,{scope:r,disabled:i,direction:a,orientation:s,children:e(Je.Slot,{scope:r,children:e(Se.div,{...l,"data-orientation":s,ref:c,onKeyDown:i?void 0:p})})})}),ft="AccordionItem",[gt,mt]=tt(ft),bt=o.forwardRef((t,n)=>{const{__scopeAccordion:r,value:o,...i}=t,a=pt(ft,r),s=at(ft,r),l=rt(r),c=Pe(),d=o&&s.value.includes(o)||!1,u=a.disabled||t.disabled;return e(gt,{scope:r,open:d,disabled:u,triggerId:c,children:e($e,{"data-orientation":a.orientation,"data-state":Nt(d),...l,...i,ref:n,disabled:u,open:d,onOpenChange:e=>{e?s.onItemOpen(o):s.onItemClose(o)}})})});bt.displayName=ft;var vt="AccordionHeader";o.forwardRef((t,n)=>{const{__scopeAccordion:r,...o}=t,i=pt(Ge,r),a=mt(vt,r);return e(Se.h3,{"data-orientation":i.orientation,"data-state":Nt(a.open),"data-disabled":a.disabled?"":void 0,...o,ref:n})}).displayName=vt;var wt="AccordionTrigger",yt=o.forwardRef((t,n)=>{const{__scopeAccordion:r,...o}=t,i=pt(Ge,r),a=mt(wt,r),s=lt(wt,r),l=rt(r);return e(Je.ItemSlot,{scope:r,children:e(Xe,{"aria-disabled":a.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...l,...o,ref:n})})});yt.displayName=wt;var xt="AccordionContent",kt=o.forwardRef((t,n)=>{const{__scopeAccordion:r,...o}=t,i=pt(Ge,r),a=mt(xt,r),s=rt(r);return e(Ye,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...s,...o,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});function Nt(e){return e?"open":"closed"}kt.displayName=xt;var Ot=ot,Ct=bt,St=yt,jt=kt;const Et=i((t,n)=>{var{children:r}=t,o=de(t,["children"]);return e(Ot,Object.assign({},o,{className:"w-full rounded-md border",ref:n,"data-slot":"accordion"},{children:r}))});Et.displayName="Accordion";const Rt=i((t,n)=>{var{children:r}=t,o=de(t,["children"]);return e(Ct,Object.assign({},o,{ref:n,"data-slot":"accordion-item",className:"border-b last:border-b-0"},{children:r}))});Rt.displayName="AccordionItem";const zt=t=>{var{children:n}=t,r=de(t,["children"]);return e(St,Object.assign({},r,{type:"button",contentEditable:!1,"data-slot":"accordion-trigger",className:"flex shrink-0 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},{children:n}))},Dt=i((t,n)=>{var{children:r}=t,o=de(t,["children"]);return e(jt,Object.assign({},o,{ref:n,"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"},{children:e("div",Object.assign({className:"pt-0 pb-4 text-muted-foreground px-5"},{children:r}))}))});Dt.displayName="AccordionContent";const Pt=(...e)=>e.filter((e,t,n)=>Boolean(e)&&n.indexOf(e)===t).join(" ");
|
|
2
2
|
/**
|
|
3
3
|
* @license lucide-react v0.378.0 - ISC
|
|
4
4
|
*
|
|
@@ -11,16 +11,16 @@ import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as r from
|
|
|
11
11
|
* This source code is licensed under the ISC license.
|
|
12
12
|
* See the LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
|
-
var
|
|
14
|
+
var Mt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
|
|
15
15
|
/**
|
|
16
16
|
* @license lucide-react v0.378.0 - ISC
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the ISC license.
|
|
19
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/const
|
|
20
|
+
*/const Tt=i(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...l},c)=>a("svg",{ref:c,...Mt,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Pt("lucide",o),...l},[...s.map(([e,t])=>a(e,t)),...Array.isArray(i)?i:[i]])),It=(e,t)=>{const n=i(({className:n,...r},o)=>{return a(Tt,{ref:o,iconNode:t,className:Pt(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i});return n.displayName=`${e}`,n},_t=It("AlignCenter",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"17",x2:"7",y1:"12",y2:"12",key:"rsh8ii"}],["line",{x1:"19",x2:"5",y1:"18",y2:"18",key:"1t0tuv"}]]),At=It("AlignLeft",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}],["line",{x1:"17",x2:"3",y1:"18",y2:"18",key:"1awlsn"}]]),Lt=It("AlignRight",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}],["line",{x1:"21",x2:"7",y1:"18",y2:"18",key:"1g9eri"}]]),Ht=It("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),Ft=It("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),Wt=It("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Bt=It("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),Ut=It("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Vt=It("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),$t=It("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Xt=It("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),Yt=It("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Kt=It("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),qt=It("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),Gt=It("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),Zt=It("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),Jt=It("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),Qt=It("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),en=It("Ellipsis",[["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"}]]),tn=It("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]),nn=It("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),rn=It("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),on=It("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),an=It("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),sn=It("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ln=It("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]),cn=It("Merge",[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]),dn=It("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),un=It("MoveHorizontal",[["polyline",{points:"18 8 22 12 18 16",key:"1hqrds"}],["polyline",{points:"6 8 2 12 6 16",key:"f0ernq"}],["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}]]),pn=It("MoveVertical",[["polyline",{points:"8 18 12 22 16 18",key:"1uutw3"}],["polyline",{points:"8 6 12 2 16 6",key:"d60sxy"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}]]),hn=It("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]),fn=It("Paintbrush",[["path",{d:"M18.37 2.63 14 7l-1.59-1.59a2 2 0 0 0-2.82 0L8 7l9 9 1.59-1.59a2 2 0 0 0 0-2.82L17 10l4.37-4.37a2.12 2.12 0 1 0-3-3Z",key:"m6k5sh"}],["path",{d:"M9 8c-2 3-4 3.5-7 4l8 10c2-1 6-5 6-7",key:"arzq70"}],["path",{d:"M14.5 17.5 4.5 15",key:"s7fvrz"}]]),gn=It("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]]),mn=It("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),bn=It("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),vn=It("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),wn=It("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),yn=It("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]),xn=It("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]),kn=It("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),Nn=It("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),On=It("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),Cn=It("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),Sn=It("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]),jn=It("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);
|
|
21
21
|
/**
|
|
22
22
|
* @license lucide-react v0.378.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/re("[data-element-type=accordion-list-item-content] [data-slate-node=element],[data-element-type=accordion-list-item-heading] [data-slate-node=element]{margin:0}");const yn={"accordion-list":{render:t=>{const{attributes:n,children:r,blockId:o,element:i}=t,a=x(),s=l(()=>{const e=[];return i.children.forEach(t=>{var n;"accordion-list-item"===t.type&&(null===(n=t.props)||void 0===n?void 0:n.isExpanded)&&e.push(t.id)}),e},[i]);return e(Nt,Object.assign({},n,{type:"multiple",value:s,onValueChange:e=>{const t=k.getBlockSlate(a,{id:o});if(!t)return;const n=R.nodes(t,{match:e=>P.isElement(e)&&"accordion-list-item"===e.type});R.withoutNormalizing(t,()=>{var r;for(const[o,i]of n){const n=o,a=n.id,s=e.includes(a);(null===(r=n.props)||void 0===r?void 0:r.isExpanded)!==s&&D.setNodes(t,{props:Object.assign(Object.assign({},n.props),{isExpanded:s})},{at:i})}})},className:"w-full rounded-md border"},{children:r}))}},"accordion-list-item":{render:t=>{var n;const{attributes:r,children:o,element:i}=t;return e(Ct,Object.assign({value:i.id,"data-state":(null===(n=i.props)||void 0===n?void 0:n.isExpanded)?"open":"closed"},r,{children:o}))}},"accordion-list-item-heading":{render:t=>{var r,o;const{attributes:i,children:a,element:d,blockId:u}=t,p=x(),[,h]=s(e=>e+1,0),f=l(()=>{const e=k.getBlockSlate(p,{id:u});if(e)try{const t=N.getElementPath(p,{blockId:u,element:d});return R.parent(e,t)[0]}catch(e){}},[p,u,d]),g=l(()=>{if(!f)return;if(k.getBlockSlate(p,{id:u}))try{return N.getElementPath(p,{blockId:u,element:f})}catch(e){}},[p,u,f]),m=null!==(o=null===(r=null==f?void 0:f.props)||void 0===r?void 0:r.isExpanded)&&void 0!==o&&o,b=c(()=>{f&&g&&N.updateElement(p,{blockId:u,type:f.type,props:Object.assign(Object.assign({},f.props),{isExpanded:!m}),path:g}),h()},[p,u,f,g,m]),v=c(e=>{if(e.preventDefault(),e.stopPropagation(),!f||!g)return;const t=N.getElementChildren(p,{blockId:u,type:"accordion-list"});1!==(null==t?void 0:t.length)?N.deleteElement(p,{blockId:u,type:"accordion-list-item",path:g}):k.deleteBlock(p,{blockId:u})},[p,u,f,g]),w=c(e=>{e.preventDefault(),e.stopPropagation();const t=k.getBlockSlate(p,{id:u});if(!t||!g)return;const n=p.y("accordion-list-item",{props:{isExpanded:!1},children:[p.y("accordion-list-item-heading"),p.y("accordion-list-item-content")]});R.withoutNormalizing(t,()=>{const e=z.next(g);D.insertNodes(t,n,{at:e});const r=[...e,0,0];setTimeout(()=>{D.select(t,{offset:0,path:r})},0)})},[p,u,g]);return n("div",Object.assign({},i,{className:"flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all px-5"},{children:[e("div",Object.assign({className:"flex-1 min-w-0"},{children:a})),n("div",Object.assign({className:"flex shrink-0 items-center gap-1",contentEditable:!1},{children:[e("button",Object.assign({type:"button",contentEditable:!1,onClick:w,className:"flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1",title:"Add accordion item"},{children:e(cn,{className:"h-4 w-4 shrink-0 text-muted-foreground"})})),e("button",Object.assign({type:"button",contentEditable:!1,onClick:v,className:"flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1",title:"Delete accordion item"},{children:e(gn,{className:"h-4 w-4 shrink-0 text-muted-foreground"})})),e(Ot,Object.assign({type:"button",contentEditable:!1,"data-slot":"accordion-trigger",onClick:b,className:"flex shrink-0 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},{children:e(Ht,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 "+(m?"rotate-180":"")})}))]}))]}))}},"accordion-list-item-content":{render:t=>{const{attributes:n,children:r}=t;return e(St,Object.assign({},n,{className:"text-muted-foreground px-5"},{children:r}))}}},xn={blockquote:{render:t=>{const{attributes:n,children:r}=t;return e("blockquote",Object.assign({},n,{className:"mt-6 border-l-2 pl-6"},{children:r}))}}};function kn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=kn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Nn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=kn(e))&&(r&&(r+=" "),r+=t);return r}const Cn=e=>{const t=jn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),On(n,t)||En(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},On=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?On(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const i=e.join("-");return t.validators.find(({validator:e})=>e(i))?.classGroupId},Sn=/^\[(.+)\]$/,En=e=>{if(Sn.test(e)){const t=Sn.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},jn=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Pn(Object.entries(e.classGroups),n).forEach(([e,n])=>{Rn(n,r,e,t)}),r},Rn=(e,t,n,r)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:zn(t,e)).classGroupId=n)}if("function"==typeof e)return Dn(e)?void Rn(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,o])=>{Rn(o,zn(t,e),n,r)})})},zn=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Dn=e=>e.isThemeGetter,Pn=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,Mn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},Tn=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],i=t.length,a=e=>{const n=[];let a,s=0,l=0;for(let c=0;c<e.length;c++){let d=e[c];if(0===s){if(d===o&&(r||e.slice(c,c+i)===t)){n.push(e.slice(l,c)),l=c+i;continue}if("/"===d){a=c;continue}}"["===d?s++:"]"===d&&s--}const c=0===n.length?e:e.substring(l),d=c.startsWith("!");return{modifiers:n,hasImportantModifier:d,baseClassName:d?c.substring(1):c,maybePostfixModifierPosition:a&&a>l?a-l:void 0}};return n?e=>n({className:e,parseClassName:a}):a},_n=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},In=/\s+/;function An(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Ln(e))&&(r&&(r+=" "),r+=t);return r}const Ln=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ln(e[r]))&&(n&&(n+=" "),n+=t);return n};function Hn(e,...t){let n,r,o,i=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Mn(e.cacheSize),parseClassName:Tn(e),...Cn(e)}))(l),r=n.cache.get,o=n.cache.set,i=a,a(s)};function a(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(In);let s="";for(let e=a.length-1;e>=0;e-=1){const t=a[e],{modifiers:l,hasImportantModifier:c,baseClassName:d,maybePostfixModifierPosition:u}=n(t);let p=Boolean(u),h=r(p?d.substring(0,u):d);if(!h){if(!p){s=t+(s.length>0?" "+s:s);continue}if(h=r(d),!h){s=t+(s.length>0?" "+s:s);continue}p=!1}const f=_n(l).join(":"),g=c?f+"!":f,m=g+h;if(i.includes(m))continue;i.push(m);const b=o(h,p);for(let e=0;e<b.length;++e){const t=b[e];i.push(g+t)}s=t+(s.length>0?" "+s:s)}return s})(e,n);return o(e,i),i}return function(){return i(An.apply(null,arguments))}}const Fn=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Wn=/^\[(?:([a-z-]+):)?(.+)\]$/i,Bn=/^\d+\/\d+$/,Un=new Set(["px","full","screen"]),Vn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$n=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Xn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Yn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Kn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qn=e=>Zn(e)||Un.has(e)||Bn.test(e),Gn=e=>dr(e,"length",ur),Zn=e=>Boolean(e)&&!Number.isNaN(Number(e)),Jn=e=>dr(e,"number",Zn),Qn=e=>Boolean(e)&&Number.isInteger(Number(e)),er=e=>e.endsWith("%")&&Zn(e.slice(0,-1)),tr=e=>Wn.test(e),nr=e=>Vn.test(e),rr=new Set(["length","size","percentage"]),or=e=>dr(e,rr,pr),ir=e=>dr(e,"position",pr),ar=new Set(["image","url"]),sr=e=>dr(e,ar,fr),lr=e=>dr(e,"",hr),cr=()=>!0,dr=(e,t,n)=>{const r=Wn.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},ur=e=>$n.test(e)&&!Xn.test(e),pr=()=>!1,hr=e=>Yn.test(e),fr=e=>Kn.test(e),gr=Hn(()=>{const e=Fn("colors"),t=Fn("spacing"),n=Fn("blur"),r=Fn("brightness"),o=Fn("borderColor"),i=Fn("borderRadius"),a=Fn("borderSpacing"),s=Fn("borderWidth"),l=Fn("contrast"),c=Fn("grayscale"),d=Fn("hueRotate"),u=Fn("invert"),p=Fn("gap"),h=Fn("gradientColorStops"),f=Fn("gradientColorStopPositions"),g=Fn("inset"),m=Fn("margin"),b=Fn("opacity"),v=Fn("padding"),w=Fn("saturate"),y=Fn("scale"),x=Fn("sepia"),k=Fn("skew"),N=Fn("space"),C=Fn("translate"),O=()=>["auto",tr,t],S=()=>[tr,t],E=()=>["",qn,Gn],j=()=>["auto",Zn,tr],R=()=>["","0",tr],z=()=>[Zn,tr];return{cacheSize:500,separator:":",theme:{colors:[cr],spacing:[qn,Gn],blur:["none","",nr,tr],brightness:z(),borderColor:[e],borderRadius:["none","","full",nr,tr],borderSpacing:S(),borderWidth:E(),contrast:z(),grayscale:R(),hueRotate:z(),invert:R(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[er,Gn],inset:O(),margin:O(),opacity:z(),padding:S(),saturate:z(),scale:z(),sepia:R(),skew:z(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",tr]}],container:["container"],columns:[{columns:[nr]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",tr]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qn,tr]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",tr]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",Qn,tr]}],"grid-cols":[{"grid-cols":[cr]}],"col-start-end":[{col:["auto",{span:["full",Qn,tr]},tr]}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":[cr]}],"row-start-end":[{row:["auto",{span:[Qn,tr]},tr]}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",tr]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",tr]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",tr,t]}],"min-w":[{"min-w":[tr,t,"min","max","fit"]}],"max-w":[{"max-w":[tr,t,"none","full","min","max","fit","prose",{screen:[nr]},nr]}],h:[{h:[tr,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[tr,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[tr,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[tr,t,"auto","min","max","fit"]}],"font-size":[{text:["base",nr,Gn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Jn]}],"font-family":[{font:[cr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",tr]}],"line-clamp":[{"line-clamp":["none",Zn,Jn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qn,tr]}],"list-image":[{"list-image":["none",tr]}],"list-style-type":[{list:["none","disc","decimal",tr]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qn,Gn]}],"underline-offset":[{"underline-offset":["auto",qn,tr]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tr]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",tr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",ir]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",or]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},sr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[qn,tr]}],"outline-w":[{outline:[qn,Gn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:E()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[qn,Gn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",nr,lr]}],"shadow-color":[{shadow:[cr]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",nr,tr]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[w]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",tr]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",tr]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",tr]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[Qn,tr]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",tr]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tr]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",tr]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[qn,Gn,Jn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function mr(...e){return gr(Nn(e))}const br=(e="default")=>({default:"bg-muted text-muted-foreground border-muted-foreground/20",info:"bg-blue-50 text-blue-900 border-blue-200 dark:bg-blue-950 dark:text-blue-100 dark:border-blue-800",success:"bg-green-50 text-green-900 border-green-200 dark:bg-green-950 dark:text-green-100 dark:border-green-800",warning:"bg-yellow-50 text-yellow-900 border-yellow-200 dark:bg-yellow-950 dark:text-yellow-100 dark:border-yellow-800",error:"bg-red-50 text-red-900 border-red-200 dark:bg-red-950 dark:text-red-100 dark:border-red-800"}[e]);e(nn,{className:"h-4 w-4"}),e(Jt,{className:"h-4 w-4 text-blue-500"}),e(Ut,{className:"h-4 w-4 text-green-500"}),e(Bt,{className:"h-4 w-4 text-yellow-500"}),e(Vt,{className:"h-4 w-4 text-red-500"});const vr={callout:{render:t=>{var n,r;const{attributes:o,children:i,element:a}=t,s=null!==(r=null===(n=a.props)||void 0===n?void 0:n.theme)&&void 0!==r?r:"default";return e("div",Object.assign({},o,{className:mr("group relative rounded-lg border-l-4 p-4 [&>p]:m-0 [&>p]:text-sm",br(s))},{children:i}))}}};function wr(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function yr(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&n.every(n=>{const r=e[n],o=t[n];return"function"==typeof r?`${r}`==`${o}`:wr(r)&&wr(o)?yr(r,o):r===o})}function xr(e){return e.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function kr(e){return"number"==typeof e}function Nr(e){return"string"==typeof e}function Cr(e){return"boolean"==typeof e}function Or(e){return"[object Object]"===Object.prototype.toString.call(e)}function Sr(e){return Math.abs(e)}function Er(e){return Math.sign(e)}function jr(e,t){return Sr(e-t)}function Rr(e){return Tr(e).map(Number)}function zr(e){return e[Dr(e)]}function Dr(e){return Math.max(0,e.length-1)}function Pr(e,t){return t===Dr(e)}function Mr(e,t=0){return Array.from(Array(e),(e,n)=>t+n)}function Tr(e){return Object.keys(e)}function _r(e,t){return[e,t].reduce((e,t)=>(Tr(t).forEach(n=>{const r=e[n],o=t[n],i=Or(r)&&Or(o);e[n]=i?_r(r,o):o}),e),{})}function Ir(e,t){return void 0!==t.MouseEvent&&e instanceof t.MouseEvent}function Ar(){let e=[];const t={add:function(n,r,o,i={passive:!0}){let a;if("addEventListener"in n)n.addEventListener(r,o,i),a=()=>n.removeEventListener(r,o,i);else{const e=n;e.addListener(o),a=()=>e.removeListener(o)}return e.push(a),t},clear:function(){e=e.filter(e=>e())}};return t}function Lr(e,t,n,r){const o=Ar(),i=1e3/60;let a=null,s=0,l=0;function c(e){if(!l)return;a||(a=e,n(),n());const o=e-a;for(a=e,s+=o;s>=i;)n(),s-=i;r(s/i),l&&(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),a=null,s=0,l=0}return{init:function(){o.add(e,"visibilitychange",()=>{e.hidden&&(a=null,s=0)})},destroy:function(){d(),o.clear()},start:function(){l||(l=t.requestAnimationFrame(c))},stop:d,update:n,render:r}}function Hr(e=0,t=0){const n=Sr(e-t);function r(t){return t<e}function o(e){return e>t}function i(e){return r(e)||o(e)}return{length:n,max:t,min:e,constrain:function(n){return i(n)?r(n)?e:t:n},reachedAny:i,reachedMax:o,reachedMin:r,removeOffset:function(e){return n?e-n*Math.ceil((e-t)/n):e}}}function Fr(e,t,n){const{constrain:r}=Hr(0,e),o=e+1;let i=a(t);function a(e){return n?Sr((o+e)%o):r(e)}function s(){return i}function l(){return Fr(e,s(),n)}const c={get:s,set:function(e){return i=a(e),c},add:function(e){return l().set(s()+e)},clone:l};return c}function Wr(e,t,n,r,o,i,a,s,l,c,d,u,p,h,f,g,m,b,v){const{cross:w,direction:y}=e,x=["INPUT","SELECT","TEXTAREA"],k={passive:!1},N=Ar(),C=Ar(),O=Hr(50,225).constrain(h.measure(20)),S={mouse:300,touch:400},E={mouse:500,touch:600},j=f?43:25;let R=!1,z=0,D=0,P=!1,M=!1,T=!1,_=!1;function I(e){if(!Ir(e,r)&&e.touches.length>=2)return A(e);const t=i.readPoint(e),n=i.readPoint(e,w),a=jr(t,z),l=jr(n,D);if(!M&&!_){if(!e.cancelable)return A(e);if(M=a>l,!M)return A(e)}const d=i.pointerMove(e);a>g&&(T=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(y(d)),e.preventDefault()}function A(e){const t=d.byDistance(0,!1).index!==u.get(),n=i.pointerUp(e)*(f?E:S)[_?"mouse":"touch"],r=function(e,t){const n=u.add(-1*Er(e)),r=d.byDistance(e,!f).distance;return f||Sr(e)<O?r:m&&t?.5*r:d.byIndex(n.get(),0).distance}(y(n),t),o=function(e,t){if(0===e||0===t)return 0;if(Sr(e)<=Sr(t))return 0;const n=jr(Sr(e),Sr(t));return Sr(n/e)}(n,r),a=j-10*o,s=b+o/50;M=!1,P=!1,C.clear(),c.useDuration(a).useFriction(s),l.distance(r,!f),_=!1,p.emit("pointerUp")}function L(e){T&&(e.stopPropagation(),e.preventDefault(),T=!1)}return{init:function(e){if(!v)return;function s(s){(Cr(v)||v(e,s))&&function(e){const s=Ir(e,r);if(_=s,T=f&&s&&!e.buttons&&R,R=jr(o.get(),a.get())>=2,s&&0!==e.button)return;if(function(e){const t=e.nodeName||"";return x.includes(t)}(e.target))return;P=!0,i.pointerDown(e),c.useFriction(0).useDuration(0),o.set(a),function(){const e=_?n:t;C.add(e,"touchmove",I,k).add(e,"touchend",A).add(e,"mousemove",I,k).add(e,"mouseup",A)}(),z=i.readPoint(e),D=i.readPoint(e,w),p.emit("pointerDown")}(s)}const l=t;N.add(l,"dragstart",e=>e.preventDefault(),k).add(l,"touchmove",()=>{},k).add(l,"touchend",()=>{}).add(l,"touchstart",s).add(l,"mousedown",s).add(l,"touchcancel",A).add(l,"contextmenu",A).add(l,"click",L,!0)},destroy:function(){N.clear(),C.clear()},pointerDown:function(){return P}}}function Br(e,t){let n,r;function o(e){return e.timeStamp}function i(n,r){const o="client"+("x"===(r||e.scroll)?"X":"Y");return(Ir(n,t)?n:n.touches[0])[o]}return{pointerDown:function(e){return n=e,r=e,i(e)},pointerMove:function(e){const t=i(e)-i(r),a=o(e)-o(n)>170;return r=e,a&&(n=e),t},pointerUp:function(e){if(!n||!r)return 0;const t=i(r)-i(n),a=o(e)-o(n),s=o(e)-o(r)>170,l=t/a;return a&&!s&&Sr(l)>.1?l:0},readPoint:i}}function Ur(e,t,n,r,o,i,a){const s=[e].concat(r);let l,c,d=[],u=!1;function p(e){return o.measureSize(a.measure(e))}return{init:function(o){i&&(c=p(e),d=r.map(p),l=new ResizeObserver(n=>{(Cr(i)||i(o,n))&&function(n){for(const i of n){if(u)return;const n=i.target===e,a=r.indexOf(i.target),s=n?c:d[a];if(Sr(p(n?e:r[a])-s)>=.5){o.reInit(),t.emit("resize");break}}}(n)}),n.requestAnimationFrame(()=>{s.forEach(e=>l.observe(e))}))},destroy:function(){u=!0,l&&l.disconnect()}}}function Vr(e,t,n,r,o){const i=o.measure(10),a=o.measure(50),s=Hr(.1,.99);let l=!1;function c(){return!l&&(!!e.reachedAny(n.get())&&!!e.reachedAny(t.get()))}return{shouldConstrain:c,constrain:function(o){if(!c())return;const l=e.reachedMin(t.get())?"min":"max",d=Sr(e[l]-t.get()),u=n.get()-t.get(),p=s.constrain(d/a);n.subtract(u*p),!o&&Sr(u)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())},toggleActive:function(e){l=!e}}}function $r(e,t,n,r){const o=t.min+.1,i=t.max+.1,{reachedMin:a,reachedMax:s}=Hr(o,i);return{loop:function(t){if(!function(e){return 1===e?s(n.get()):-1===e&&a(n.get())}(t))return;const o=e*(-1*t);r.forEach(e=>e.add(o))}}}function Xr(e,t,n,r,o){const{reachedAny:i,removeOffset:a,constrain:s}=r;function l(e){return e.concat().sort((e,t)=>Sr(e)-Sr(t))[0]}function c(t,r){const o=[t,t+n,t-n];if(!e)return t;if(!r)return l(o);const i=o.filter(e=>Er(e)===r);return i.length?l(i):zr(o)-n}const d={byDistance:function(n,r){const l=o.get()+n,{index:d,distance:u}=function(n){const r=e?a(n):s(n),o=t.map((e,t)=>({diff:c(e-r,0),index:t})).sort((e,t)=>Sr(e.diff)-Sr(t.diff)),{index:i}=o[0];return{index:i,distance:r}}(l),p=!e&&i(l);return!r||p?{index:d,distance:n}:{index:d,distance:n+c(t[d]-u,0)}},byIndex:function(e,n){return{index:e,distance:c(t[e]-o.get(),n)}},shortcut:c};return d}function Yr(e,t,n,r,o,i,a,s){const l={passive:!0,capture:!0};let c=0;function d(e){"Tab"===e.code&&(c=(new Date).getTime())}const u={init:function(u){s&&(i.add(document,"keydown",d,!1),t.forEach((t,d)=>{i.add(t,"focus",t=>{(Cr(s)||s(u,t))&&function(t){if((new Date).getTime()-c>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const i=n.findIndex(e=>e.includes(t));kr(i)&&(o.useDuration(0),r.index(i,0),a.emit("slideFocus"))}(d)},l)}))}};return u}function Kr(e){let t=e;function n(e){return kr(e)?e:e.get()}return{get:function(){return t},set:function(e){t=n(e)},add:function(e){t+=n(e)},subtract:function(e){t-=n(e)}}}function qr(e,t){const n="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},r=t.style;let o=null,i=!1;return{clear:function(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){if(i)return;const a=(s=e.direction(t),Math.round(100*s)/100);var s;a!==o&&(r.transform=n(a),o=a)},toggleActive:function(e){i=!e}}}function Gr(e,t,n,r,o,i,a,s,l){const c=Rr(o),d=Rr(o).reverse(),u=function(){const e=a[0];return f(h(d,e),n,!1)}().concat(function(){const e=t-a[0]-1;return f(h(c,e),-n,!0)}());function p(e,t){return e.reduce((e,t)=>e-o[t],t)}function h(e,t){return e.reduce((e,n)=>p(e,t)>0?e.concat([n]):e,[])}function f(o,a,c){const d=function(e){return i.map((n,o)=>({start:n-r[o]+.5+e,end:n+t-.5+e}))}(a);return o.map(t=>{const r=c?0:-n,o=c?n:0,i=c?"end":"start",a=d[t][i];return{index:t,loopPoint:a,slideLocation:Kr(-1),translate:qr(e,l[t]),target:()=>s.get()>a?r:o}})}const g={canLoop:function(){return u.every(({index:e})=>p(c.filter(t=>t!==e),t)<=.1)},clear:function(){u.forEach(e=>e.translate.clear())},loop:function(){u.forEach(e=>{const{target:t,translate:n,slideLocation:r}=e,o=t();o!==r.get()&&(n.to(o),r.set(o))})},loopPoints:u};return g}function Zr(e,t,n){let r,o=!1;return{init:function(i){n&&(r=new MutationObserver(e=>{o||(Cr(n)||n(i,e))&&function(e){for(const n of e)if("childList"===n.type){i.reInit(),t.emit("slidesChanged");break}}(e)}),r.observe(e,{childList:!0}))},destroy:function(){r&&r.disconnect(),o=!0}}}function Jr(e,t,n,r){const o={};let i,a=null,s=null,l=!1;const c={init:function(){i=new IntersectionObserver(e=>{l||(e.forEach(e=>{const n=t.indexOf(e.target);o[n]=e}),a=null,s=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(e=>i.observe(e))},destroy:function(){i&&i.disconnect(),l=!0},get:function(e=!0){if(e&&a)return a;if(!e&&s)return s;const t=function(e){return Tr(o).reduce((t,n)=>{const r=parseInt(n),{isIntersecting:i}=o[r];return(e&&i||!e&&!i)&&t.push(r),t},[])}(e);return e&&(a=t),e||(s=t),t}};return c}function Qr(e,t,n,r,o,i,a,s,l){const{startEdge:c,endEdge:d,direction:u}=e,p=kr(n);const h={groupSlides:function(e){return p?function(e,t){return Rr(e).filter(e=>e%t===0).map(n=>e.slice(n,n+t))}(e,n):function(e){return e.length?Rr(e).reduce((n,p,h)=>{const f=zr(n)||0,g=0===f,m=p===Dr(e),b=o[c]-i[f][c],v=o[c]-i[p][d],w=!r&&g?u(a):0,y=Sr(v-(!r&&m?u(s):0)-(b+w));return h&&y>t+l&&n.push(p),m&&n.push(e.length),n},[]).map((t,n,r)=>{const o=Math.max(r[n-1]||0);return e.slice(o,t)}):[]}(e)}};return h}function eo(e,t,n,r,o,i,a){const{align:s,axis:l,direction:c,startIndex:d,loop:u,duration:p,dragFree:h,dragThreshold:f,inViewThreshold:g,slidesToScroll:m,skipSnaps:b,containScroll:v,watchResize:w,watchSlides:y,watchDrag:x,watchFocus:k}=i,N={measure:function(e){const{offsetTop:t,offsetLeft:n,offsetWidth:r,offsetHeight:o}=e;return{top:t,right:n+r,bottom:t+o,left:n,width:r,height:o}}},C=N.measure(t),O=n.map(N.measure),S=function(e,t){const n="rtl"===t,r="y"===e,o=!r&&n?-1:1;return{scroll:r?"y":"x",cross:r?"x":"y",startEdge:r?"top":n?"right":"left",endEdge:r?"bottom":n?"left":"right",measureSize:function(e){const{height:t,width:n}=e;return r?t:n},direction:function(e){return e*o}}}(l,c),E=S.measureSize(C),j=function(e){return{measure:function(t){return e*(t/100)}}}(E),R=function(e,t){const n={start:function(){return 0},center:function(e){return r(e)/2},end:r};function r(e){return t-e}const o={measure:function(r,o){return Nr(e)?n[e](r):e(t,r,o)}};return o}(s,E),z=!u&&!!v,D=u||!!v,{slideSizes:P,slideSizesWithGaps:M,startGap:T,endGap:_}=function(e,t,n,r,o,i){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&o,d=function(){if(!c)return 0;const e=n[0];return Sr(t[s]-e[s])}(),u=function(){if(!c)return 0;const e=i.getComputedStyle(zr(r));return parseFloat(e.getPropertyValue(`margin-${l}`))}(),p=n.map(a),h=n.map((e,t,n)=>{const r=!t,o=Pr(n,t);return r?p[t]+d:o?p[t]+u:n[t+1][s]-e[s]}).map(Sr);return{slideSizes:p,slideSizesWithGaps:h,startGap:d,endGap:u}}(S,C,O,n,D,o),I=Qr(S,E,m,u,C,O,T,_,2),{snaps:A,snapsAligned:L}=function(e,t,n,r,o){const{startEdge:i,endEdge:a}=e,{groupSlides:s}=o,l=s(r).map(e=>zr(e)[a]-e[0][i]).map(Sr).map(t.measure),c=r.map(e=>n[i]-e[i]).map(e=>-Sr(e)),d=s(c).map(e=>e[0]).map((e,t)=>e+l[t]);return{snaps:c,snapsAligned:d}}(S,R,C,O,I),H=-zr(A)+zr(M),{snapsContained:F,scrollContainLimit:W}=function(e,t,n,r,o){const i=Hr(-t+e,0),a=n.map((e,t)=>{const{min:r,max:o}=i,a=i.constrain(e),s=!t,l=Pr(n,t);return s?o:l||c(r,a)?r:c(o,a)?o:a}).map(e=>parseFloat(e.toFixed(3))),s=function(){const e=a[0],t=zr(a);return Hr(a.lastIndexOf(e),a.indexOf(t)+1)}(),l=function(){if(t<=e+o)return[i.max];if("keepSnaps"===r)return a;const{min:n,max:l}=s;return a.slice(n,l)}();function c(e,t){return jr(e,t)<=1}return{snapsContained:l,scrollContainLimit:s}}(E,H,L,v,2),B=z?F:L,{limit:U}=function(e,t,n){const r=t[0];return{limit:Hr(n?r-e:zr(t),r)}}(H,B,u),V=Fr(Dr(B),d,u),$=V.clone(),X=Rr(n),Y=Lr(r,o,()=>(({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:r}})=>{r||n.constrain(e.pointerDown()),t.seek()})(se),e=>(({scrollBody:e,translate:t,location:n,offsetLocation:r,previousLocation:o,scrollLooper:i,slideLooper:a,dragHandler:s,animation:l,eventHandler:c,scrollBounds:d,options:{loop:u}},p)=>{const h=e.settled(),f=!d.shouldConstrain(),g=u?h:h&&f,m=g&&!s.pointerDown();m&&l.stop();const b=n.get()*p+o.get()*(1-p);r.set(b),u&&(i.loop(e.direction()),a.loop()),t.to(r.get()),m&&c.emit("settle"),g||c.emit("scroll")})(se,e)),K=B[V.get()],q=Kr(K),G=Kr(K),Z=Kr(K),J=Kr(K),Q=function(e,t,n,r,o,i){let a=0,s=0,l=o,c=i,d=e.get(),u=0;function p(e){return l=e,f}function h(e){return c=e,f}const f={direction:function(){return s},duration:function(){return l},velocity:function(){return a},seek:function(){const t=r.get()-e.get();let o=0;return l?(n.set(e),a+=t/l,a*=c,d+=a,e.add(a),o=d-u):(a=0,n.set(r),e.set(r),o=t),s=Er(o),u=d,f},settled:function(){return Sr(r.get()-t.get())<.001},useBaseFriction:function(){return h(i)},useBaseDuration:function(){return p(o)},useFriction:h,useDuration:p};return f}(q,Z,G,J,p,.68),ee=Xr(u,B,H,U,J),te=function(e,t,n,r,o,i,a){function s(o){const s=o.distance,l=o.index!==t.get();i.add(s),s&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),l&&(n.set(t.get()),t.set(o.index),a.emit("select"))}const l={distance:function(e,t){s(o.byDistance(e,t))},index:function(e,n){const r=t.clone().set(e);s(o.byIndex(r.get(),n))}};return l}(Y,V,$,Q,ee,J,a),ne=function(e){const{max:t,length:n}=e;return{get:function(e){return n?(e-t)/-n:0}}}(U),re=Ar(),oe=Jr(t,n,a,g),{slideRegistry:ie}=function(e,t,n,r,o,i){const{groupSlides:a}=o,{min:s,max:l}=r,c=function(){const r=a(i),o=!e||"keepSnaps"===t;return 1===n.length?[i]:o?r:r.slice(s,l).map((e,t,n)=>{const r=!t,o=Pr(n,t);return r?Mr(zr(n[0])+1):o?Mr(Dr(i)-zr(n)[0]+1,zr(n)[0]):e})}();return{slideRegistry:c}}(z,v,B,W,I,X),ae=Yr(e,n,ie,te,Q,re,a,k),se={ownerDocument:r,ownerWindow:o,eventHandler:a,containerRect:C,slideRects:O,animation:Y,axis:S,dragHandler:Wr(S,e,r,o,J,Br(S,o),q,Y,te,Q,ee,V,a,j,h,f,b,.68,x),eventStore:re,percentOfView:j,index:V,indexPrevious:$,limit:U,location:q,offsetLocation:Z,previousLocation:G,options:i,resizeHandler:Ur(t,a,o,n,S,w,N),scrollBody:Q,scrollBounds:Vr(U,Z,J,Q,j),scrollLooper:$r(H,U,Z,[q,Z,G,J]),scrollProgress:ne,scrollSnapList:B.map(ne.get),scrollSnaps:B,scrollTarget:ee,scrollTo:te,slideLooper:Gr(S,E,H,P,M,A,B,Z,n),slideFocus:ae,slidesHandler:Zr(t,a,y),slidesInView:oe,slideIndexes:X,slideRegistry:ie,slidesToScroll:I,target:J,translate:qr(S,t)};return se}const to={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function no(e){function t(e,t){return _r(e,t||{})}const n={mergeOptions:t,optionsAtMedia:function(n){const r=n.breakpoints||{},o=Tr(r).filter(t=>e.matchMedia(t).matches).map(e=>r[e]).reduce((e,n)=>t(e,n),{});return t(n,o)},optionsMediaQueries:function(t){return t.map(e=>Tr(e.breakpoints||{})).reduce((e,t)=>e.concat(t),[]).map(e.matchMedia)}};return n}function ro(e,t,n){const r=e.ownerDocument,o=r.defaultView,i=no(o),a=function(e){let t=[];const n={init:function(n,r){return t=r.filter(({options:t})=>!1!==e.optionsAtMedia(t).active),t.forEach(t=>t.init(n,e)),r.reduce((e,t)=>Object.assign(e,{[t.name]:t}),{})},destroy:function(){t=t.filter(e=>e.destroy())}};return n}(i),s=Ar(),l=function(){let e,t={};function n(e){return t[e]||[]}const r={init:function(t){e=t},emit:function(t){return n(t).forEach(n=>n(e,t)),r},off:function(e,o){return t[e]=n(e).filter(e=>e!==o),r},on:function(e,o){return t[e]=n(e).concat([o]),r},clear:function(){t={}}};return r}(),{mergeOptions:c,optionsAtMedia:d,optionsMediaQueries:u}=i,{on:p,off:h,emit:f}=l,g=S;let m,b,v,w,y=!1,x=c(to,ro.globalOptions),k=c(x),N=[];function C(t){const n=eo(e,v,w,r,o,t,l);if(t.loop&&!n.slideLooper.canLoop()){return C(Object.assign({},t,{loop:!1}))}return n}function O(t,n){y||(x=c(x,t),k=d(x),N=n||N,function(){const{container:t,slides:n}=k,r=Nr(t)?e.querySelector(t):t;v=r||e.children[0];const o=Nr(n)?v.querySelectorAll(n):n;w=[].slice.call(o||v.children)}(),m=C(k),u([x,...N.map(({options:e})=>e)]).forEach(e=>s.add(e,"change",S)),k.active&&(m.translate.to(m.location.get()),m.animation.init(),m.slidesInView.init(),m.slideFocus.init(z),m.eventHandler.init(z),m.resizeHandler.init(z),m.slidesHandler.init(z),m.options.loop&&m.slideLooper.loop(),v.offsetParent&&w.length&&m.dragHandler.init(z),b=a.init(z,N)))}function S(e,t){const n=R();E(),O(c({startIndex:n},e),t),l.emit("reInit")}function E(){m.dragHandler.destroy(),m.eventStore.clear(),m.translate.clear(),m.slideLooper.clear(),m.resizeHandler.destroy(),m.slidesHandler.destroy(),m.slidesInView.destroy(),m.animation.destroy(),a.destroy(),s.clear()}function j(e,t,n){k.active&&!y&&(m.scrollBody.useBaseFriction().useDuration(!0===t?0:k.duration),m.scrollTo.index(e,n||0))}function R(){return m.index.get()}const z={canScrollNext:function(){return m.index.add(1).get()!==R()},canScrollPrev:function(){return m.index.add(-1).get()!==R()},containerNode:function(){return v},internalEngine:function(){return m},destroy:function(){y||(y=!0,s.clear(),E(),l.emit("destroy"),l.clear())},off:h,on:p,emit:f,plugins:function(){return b},previousScrollSnap:function(){return m.indexPrevious.get()},reInit:g,rootNode:function(){return e},scrollNext:function(e){j(m.index.add(1).get(),e,-1)},scrollPrev:function(e){j(m.index.add(-1).get(),e,1)},scrollProgress:function(){return m.scrollProgress.get(m.offsetLocation.get())},scrollSnapList:function(){return m.scrollSnapList},scrollTo:j,selectedScrollSnap:R,slideNodes:function(){return w},slidesInView:function(){return m.slidesInView.get()},slidesNotInView:function(){return m.slidesInView.get(!1)}};return O(t,n),setTimeout(()=>l.emit("init"),0),z}function oo(e={},t=[]){const n=d(e),r=d(t),[o,i]=u(),[a,s]=u(),l=c(()=>{o&&o.reInit(n.current,r.current)},[o]);return p(()=>{yr(n.current,e)||(n.current=e,l())},[e,l]),p(()=>{(function(e,t){if(e.length!==t.length)return!1;const n=xr(e),r=xr(t);return n.every((e,t)=>yr(e,r[t]))})(r.current,t)||(r.current=t,l())},[t,l]),p(()=>{if("undefined"!=typeof window&&window.document&&window.document.createElement&&a){ro.globalOptions=oo.globalOptions;const e=ro(a,n.current,r.current);return i(e),()=>e.destroy()}i(void 0)},[a,i]),[s,o]}ro.globalOptions=void 0,oo.globalOptions=void 0;const io=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ao=Nn,so=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return ao(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(e=>{const t=null==n?void 0:n[e],r=null==i?void 0:i[e];if(null===t)return null;const a=io(t)||io(r);return o[e][a]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...s}[t]):{...i,...s}[t]===n})?[...e,n,r]:e},[]);return ao(e,a,l,null==n?void 0:n.class,null==n?void 0:n.className)},lo=so("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),co=r.forwardRef((t,n)=>{var{className:r,variant:o,size:i}=t,a=ie(t,["className","variant","size"]);return e("button",Object.assign({className:mr(lo({variant:o,size:i,className:r})),ref:n},a))});co.displayName="Button";const uo=h(null);function po(){const e=f(uo);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const ho=i((t,n)=>{var{orientation:r="horizontal",opts:o,setApi:i,plugins:a,className:s,children:d}=t,h=ie(t,["orientation","opts","setApi","plugins","className","children"]);const[f,g]=oo(Object.assign(Object.assign({},o),{axis:"horizontal"===r?"x":"y"}),a),[m,b]=u(!1),[v,w]=u(!1),y=c(e=>{e&&(b(e.canScrollPrev()),w(e.canScrollNext()))},[]),x=c(()=>{null==g||g.scrollPrev()},[g]),k=c(()=>{null==g||g.scrollNext()},[g]),N=c(e=>{"ArrowLeft"===e.key?(e.preventDefault(),x()):"ArrowRight"===e.key&&(e.preventDefault(),k())},[x,k]);p(()=>{g&&i&&i(g)},[g,i]),p(()=>{if(g)return y(g),g.on("reInit",y),g.on("select",y),()=>{null==g||g.off("select",y)}},[g,y]);const C=l(()=>({carouselRef:f,api:g,opts:o,orientation:r||("y"===(null==o?void 0:o.axis)?"vertical":"horizontal"),scrollPrev:x,scrollNext:k,canScrollPrev:m,canScrollNext:v}),[f,g,o,r,x,k,m,v]);return e(uo.Provider,Object.assign({value:C},{children:e("div",Object.assign({onKeyDownCapture:N,className:mr("relative",s),role:"region","aria-roledescription":"carousel","data-slot":"carousel",ref:n},h,{children:d}))}))});ho.displayName="Carousel";const fo=i((t,n)=>{var{className:r}=t,o=ie(t,["className"]);const{carouselRef:i,orientation:a}=po();return e("div",Object.assign({ref:i,className:"overflow-hidden","data-slot":"carousel-content"},{children:e("div",Object.assign({ref:n,className:mr("flex","horizontal"===a?"-ml-4":"-mt-4 flex-col",r)},o))}))});fo.displayName="CarouselContent";const go=i((t,n)=>{var{className:r}=t,o=ie(t,["className"]);const{orientation:i}=po();return e("div",Object.assign({ref:n,role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:mr("min-w-0 shrink-0 grow-0 basis-full","horizontal"===i?"pl-4":"pt-4",r)},o))});go.displayName="CarouselItem";const mo=t=>{var{className:r,variant:o="outline",size:i="icon"}=t,a=ie(t,["className","variant","size"]);const{orientation:s,scrollPrev:l,canScrollPrev:c}=po();return n(co,Object.assign({"data-slot":"carousel-previous",variant:o,size:i,className:mr("absolute size-8 rounded-full","horizontal"===s?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",r),disabled:!c,onClick:l},a,{children:[e(_t,{}),e("span",Object.assign({className:"sr-only"},{children:"Previous slide"}))]}))},bo=t=>{var{className:r,variant:o="outline",size:i="icon"}=t,a=ie(t,["className","variant","size"]);const{orientation:s,scrollNext:l,canScrollNext:c}=po();return n(co,Object.assign({"data-slot":"carousel-next",variant:o,size:i,className:mr("absolute size-8 rounded-full","horizontal"===s?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",r),disabled:!c,onClick:l},a,{children:[e(It,{}),e("span",Object.assign({className:"sr-only"},{children:"Next slide"}))]}))},vo=r.forwardRef((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("div",Object.assign({ref:n,className:mr("rounded-xl border bg-card text-card-foreground shadow",r)},o))});vo.displayName="Card";r.forwardRef((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("div",Object.assign({ref:n,className:mr("flex flex-col space-y-1.5 p-6",r)},o))}).displayName="CardHeader";r.forwardRef((t,n)=>{var{className:r,children:o}=t,i=ie(t,["className","children"]);return e("h3",Object.assign({ref:n,className:mr("font-semibold leading-none tracking-tight",r)},i,{children:o}))}).displayName="CardTitle";r.forwardRef((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("p",Object.assign({ref:n,className:mr("text-sm text-muted-foreground",r)},o))}).displayName="CardDescription";const wo=r.forwardRef((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("div",Object.assign({ref:n,className:mr("p-6 pt-0",r)},o))});wo.displayName="CardContent";r.forwardRef((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("div",Object.assign({ref:n,className:mr("flex items-center p-6 pt-0",r)},o))}).displayName="CardFooter";const yo={"carousel-container":{render:t=>{const{attributes:r,children:o}=t,[i,a]=u(),[s,l]=u(0),[c,d]=u(0);return p(()=>{i&&(d(i.scrollSnapList().length),l(i.selectedScrollSnap()+1),i.on("select",()=>{l(i.selectedScrollSnap()+1)}))},[i]),e("div",Object.assign({className:"flex w-full justify-center data-[align=center]:items-center data-[align=end]:items-end data-[align=start]:items-start"},{children:n("div",Object.assign({className:"mx-auto\n "},{children:[n(ho,Object.assign({},r,{setApi:a,opts:{align:"start",axis:"x",loop:!0},orientation:"horizontal",className:"w-full max-w-lg"},{children:[e(fo,{children:o}),e(mo,{contentEditable:!1,className:"select-none"}),e(bo,{contentEditable:!1,className:"select-none"})]})),n("div",Object.assign({contentEditable:!1,className:"select-none text-muted-foreground py-2 text-center text-sm"},{children:["Slide ",s," of ",c]}))]}))}))}},"carousel-list-item":{render:t=>{const{children:n}=t;return e(go,Object.assign({className:"md:basis-1/2 lg:basis-1/3"},{children:e("div",Object.assign({className:"p-1"},{children:e(vo,{children:e(wo,Object.assign({className:"flex aspect-square items-center justify-center p-6"},{children:n}))})}))}))}}};function xo(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(t,n))}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var ko=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}},No={"text/plain":"Text","text/html":"Url",default:"Text"};var Co=function(e,t){var n,r,o,i,a,s,l=!1;t||(t={}),n=t.debug||!1;try{if(o=ko(),i=document.createRange(),a=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=No[t.format]||No.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))}),document.body.appendChild(s),i.selectNodeContents(s),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),r=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(r,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),s&&document.body.removeChild(s),o()}return l},Oo=ne({__proto__:null,default:Co},[Co]);const So=r.forwardRef((t,n)=>{var{className:r,type:o}=t,i=ie(t,["className","type"]);return e("input",Object.assign({type:o,className:mr("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:n},i))});function Eo(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}So.displayName="Input";var jo,Ro="dismissableLayer.update",zo="dismissableLayer.pointerDownOutside",Do="dismissableLayer.focusOutside",Po=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mo=r.forwardRef((t,n)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=t,u=r.useContext(Po),[p,h]=r.useState(null),f=p?.ownerDocument??globalThis?.document,[,g]=r.useState({}),m=ue(n,e=>h(e)),b=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(v),y=p?b.indexOf(p):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,k=y>=w,N=function(e,t=globalThis?.document){const n=Eo(e),o=r.useRef(!1),i=r.useRef(()=>{});return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let r=function(){_o(zo,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=r,t.addEventListener("click",i.current,{once:!0})):r()}else t.removeEventListener("click",i.current);o.current=!1},r=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(r),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));k&&!n&&(a?.(e),l?.(e),e.defaultPrevented||c?.())},f),C=function(e,t=globalThis?.document){const n=Eo(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){_o(Do,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))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},f);return function(e,t=globalThis?.document){const n=Eo(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=>{y===u.layers.size-1&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),r.useEffect(()=>{if(p)return o&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(jo=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),To(),()=>{o&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=jo)}},[p,f,o,u]),r.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),To())},[p,u]),r.useEffect(()=>{const e=()=>g({});return document.addEventListener(Ro,e),()=>document.removeEventListener(Ro,e)},[]),e(xe.div,{...d,ref:m,style:{pointerEvents:x?k?"auto":"none":void 0,...t.style},onFocusCapture:be(t.onFocusCapture,C.onFocusCapture),onBlurCapture:be(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:be(t.onPointerDownCapture,N.onPointerDownCapture)})});Mo.displayName="DismissableLayer";function To(){const e=new CustomEvent(Ro);document.dispatchEvent(e)}function _o(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ke(o,i):o.dispatchEvent(i)}r.forwardRef((t,n)=>{const o=r.useContext(Po),i=r.useRef(null),a=ue(n,i);return r.useEffect(()=>{const e=i.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),e(xe.div,{...t,ref:a})}).displayName="DismissableLayerBranch";var Io=0;function Ao(){r.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Lo()),document.body.insertAdjacentElement("beforeend",e[1]??Lo()),Io++,()=>{1===Io&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Io--}},[])}function Lo(){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 Ho="focusScope.autoFocusOnMount",Fo="focusScope.autoFocusOnUnmount",Wo={bubbles:!1,cancelable:!0},Bo=r.forwardRef((t,n)=>{const{loop:o=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...l}=t,[c,d]=r.useState(null),u=Eo(a),p=Eo(s),h=r.useRef(null),f=ue(n,e=>d(e)),g=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(i){let e=function(e){if(g.paused||!c)return;const t=e.target;c.contains(t)?h.current=t:Xo(h.current,{select:!0})},t=function(e){if(g.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Xo(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Xo(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[i,c,g.paused]),r.useEffect(()=>{if(c){Yo.add(g);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(Ho,Wo);c.addEventListener(Ho,u),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xo(r,{select:t}),document.activeElement!==n)return}((e=Uo(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Xo(c))}return()=>{c.removeEventListener(Ho,u),setTimeout(()=>{const e=new CustomEvent(Fo,Wo);c.addEventListener(Fo,p),c.dispatchEvent(e),e.defaultPrevented||Xo(t??document.body,{select:!0}),c.removeEventListener(Fo,p),Yo.remove(g)},0)}}var e},[c,u,p,g]);const m=r.useCallback(e=>{if(!o&&!i)return;if(g.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,i]=function(e){const t=Uo(e),n=Vo(t,e),r=Vo(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||n!==i?e.shiftKey&&n===r&&(e.preventDefault(),o&&Xo(i,{select:!0})):(e.preventDefault(),o&&Xo(r,{select:!0})):n===t&&e.preventDefault()}},[o,i,g.paused]);return e(xe.div,{tabIndex:-1,...l,ref:f,onKeyDown:m})});function Uo(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 Vo(e,t){for(const n of e)if(!$o(n,{upTo:t}))return n}function $o(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 Xo(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()}}Bo.displayName="FocusScope";var Yo=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Ko(e,t),e.unshift(t)},remove(t){e=Ko(e,t),e[0]?.resume()}}}();function Ko(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const qo=["top","right","bottom","left"],Go=Math.min,Zo=Math.max,Jo=Math.round,Qo=Math.floor,ei=e=>({x:e,y:e}),ti={left:"right",right:"left",bottom:"top",top:"bottom"},ni={start:"end",end:"start"};function ri(e,t,n){return Zo(e,Go(t,n))}function oi(e,t){return"function"==typeof e?e(t):e}function ii(e){return e.split("-")[0]}function ai(e){return e.split("-")[1]}function si(e){return"x"===e?"y":"x"}function li(e){return"y"===e?"height":"width"}const ci=new Set(["top","bottom"]);function di(e){return ci.has(ii(e))?"y":"x"}function ui(e){return si(di(e))}function pi(e){return e.replace(/start|end/g,e=>ni[e])}const hi=["left","right"],fi=["right","left"],gi=["top","bottom"],mi=["bottom","top"];function bi(e,t,n,r){const o=ai(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?fi:hi:t?hi:fi;case"left":case"right":return t?gi:mi;default:return[]}}(ii(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(pi)))),i}function vi(e){return e.replace(/left|right|bottom|top/g,e=>ti[e])}function wi(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function yi(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function xi(e,t,n){let{reference:r,floating:o}=e;const i=di(t),a=ui(t),s=li(a),l=ii(t),c="y"===i,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(l){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-o.width,y:u};break;default:h={x:r.x,y:r.y}}switch(ai(t)){case"start":h[a]-=p*(n&&c?-1:1);break;case"end":h[a]+=p*(n&&c?-1:1)}return h}async function ki(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:h=0}=oi(t,e),f=wi(h),g=s[p?"floating"===u?"reference":"floating":u],m=yi(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),b="floating"===u?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),w=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},y=yi(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:v,strategy:l}):b);return{top:(m.top-y.top+f.top)/w.y,bottom:(y.bottom-m.bottom+f.bottom)/w.y,left:(m.left-y.left+f.left)/w.x,right:(y.right-m.right+f.right)/w.x}}function Ni(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ci(e){return qo.some(t=>e[t]>=0)}function Oi(e){const t=Go(...e.map(e=>e.left)),n=Go(...e.map(e=>e.top));return{x:t,y:n,width:Zo(...e.map(e=>e.right))-t,height:Zo(...e.map(e=>e.bottom))-n}}const Si=new Set(["left","top"]);function Ei(){return"undefined"!=typeof window}function ji(e){return Di(e)?(e.nodeName||"").toLowerCase():"#document"}function Ri(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function zi(e){var t;return null==(t=(Di(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Di(e){return!!Ei()&&(e instanceof Node||e instanceof Ri(e).Node)}function Pi(e){return!!Ei()&&(e instanceof Element||e instanceof Ri(e).Element)}function Mi(e){return!!Ei()&&(e instanceof HTMLElement||e instanceof Ri(e).HTMLElement)}function Ti(e){return!(!Ei()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Ri(e).ShadowRoot)}const _i=new Set(["inline","contents"]);function Ii(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ki(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!_i.has(o)}const Ai=new Set(["table","td","th"]);function Li(e){return Ai.has(ji(e))}const Hi=[":popover-open",":modal"];function Fi(e){return Hi.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Wi=["transform","translate","scale","rotate","perspective"],Bi=["transform","translate","scale","rotate","perspective","filter"],Ui=["paint","layout","strict","content"];function Vi(e){const t=$i(),n=Pi(e)?Ki(e):e;return Wi.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Bi.some(e=>(n.willChange||"").includes(e))||Ui.some(e=>(n.contain||"").includes(e))}function $i(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Xi=new Set(["html","body","#document"]);function Yi(e){return Xi.has(ji(e))}function Ki(e){return Ri(e).getComputedStyle(e)}function qi(e){return Pi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gi(e){if("html"===ji(e))return e;const t=e.assignedSlot||e.parentNode||Ti(e)&&e.host||zi(e);return Ti(t)?t.host:t}function Zi(e){const t=Gi(e);return Yi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mi(t)&&Ii(t)?t:Zi(t)}function Ji(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Zi(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Ri(o);if(i){const e=Qi(a);return t.concat(a,a.visualViewport||[],Ii(o)?o:[],e&&n?Ji(e):[])}return t.concat(o,Ji(o,[],n))}function Qi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ea(e){const t=Ki(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Mi(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Jo(n)!==i||Jo(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function ta(e){return Pi(e)?e:e.contextElement}function na(e){const t=ta(e);if(!Mi(t))return ei(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ea(t);let a=(i?Jo(n.width):n.width)/r,s=(i?Jo(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const ra=ei(0);function oa(e){const t=Ri(e);return $i()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ra}function ia(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ta(e);let a=ei(1);t&&(r?Pi(r)&&(a=na(r)):a=na(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Ri(e))&&t}(i,n,r)?oa(i):ei(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,d=o.width/a.x,u=o.height/a.y;if(i){const e=Ri(i),t=r&&Pi(r)?Ri(r):r;let n=e,o=Qi(n);for(;o&&r&&t!==n;){const e=na(o),t=o.getBoundingClientRect(),r=Ki(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=i,c+=a,n=Ri(o),o=Qi(n)}}return yi({width:d,height:u,x:l,y:c})}function aa(e,t){const n=qi(e).scrollLeft;return t?t.left+n:ia(zi(e)).left+n}function sa(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-aa(e,n),y:n.top+t.scrollTop}}const la=new Set(["absolute","fixed"]);function ca(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Ri(e),r=zi(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=$i();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=aa(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=zi(e),n=qi(e),r=e.ownerDocument.body,o=Zo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Zo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+aa(e);const s=-n.scrollTop;return"rtl"===Ki(r).direction&&(a+=Zo(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(zi(e));else if(Pi(t))r=function(e,t){const n=ia(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Mi(e)?na(e):ei(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=oa(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yi(r)}function da(e,t){const n=Gi(e);return!(n===t||!Pi(n)||Yi(n))&&("fixed"===Ki(n).position||da(n,t))}function ua(e,t,n){const r=Mi(t),o=zi(t),i="fixed"===n,a=ia(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=ei(0);function c(){l.x=aa(o)}if(r||!r&&!i)if(("body"!==ji(t)||Ii(o))&&(s=qi(t)),r){const e=ia(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const d=!o||r||i?ei(0):sa(o,s);return{x:a.left+s.scrollLeft-l.x-d.x,y:a.top+s.scrollTop-l.y-d.y,width:a.width,height:a.height}}function pa(e){return"static"===Ki(e).position}function ha(e,t){if(!Mi(e)||"fixed"===Ki(e).position)return null;if(t)return t(e);let n=e.offsetParent;return zi(e)===n&&(n=n.ownerDocument.body),n}function fa(e,t){const n=Ri(e);if(Fi(e))return n;if(!Mi(e)){let t=Gi(e);for(;t&&!Yi(t);){if(Pi(t)&&!pa(t))return t;t=Gi(t)}return n}let r=ha(e,t);for(;r&&Li(r)&&pa(r);)r=ha(r,t);return r&&Yi(r)&&pa(r)&&!Vi(r)?n:r||function(e){let t=Gi(e);for(;Mi(t)&&!Yi(t);){if(Vi(t))return t;if(Fi(t))return null;t=Gi(t)}return null}(e)||n}const ga={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=zi(r),s=!!t&&Fi(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=ei(1);const d=ei(0),u=Mi(r);if((u||!u&&!i)&&(("body"!==ji(r)||Ii(a))&&(l=qi(r)),Mi(r))){const e=ia(r);c=na(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const p=!a||u||i?ei(0):sa(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}},getDocumentElement:zi,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Fi(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ji(e,[],!1).filter(e=>Pi(e)&&"body"!==ji(e)),o=null;const i="fixed"===Ki(e).position;let a=i?Gi(e):e;for(;Pi(a)&&!Yi(a);){const t=Ki(a),n=Vi(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&la.has(o.position)||Ii(a)&&!n&&da(e,a))?r=r.filter(e=>e!==a):o=t,a=Gi(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=ca(t,n,o);return e.top=Zo(r.top,e.top),e.right=Go(r.right,e.right),e.bottom=Go(r.bottom,e.bottom),e.left=Zo(r.left,e.left),e},ca(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:fa,getElementRects:async function(e){const t=this.getOffsetParent||fa,n=this.getDimensions,r=await n(e.floating);return{reference:ua(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ea(e);return{width:t,height:n}},getScale:na,isElement:Pi,isRTL:function(e){return"rtl"===Ki(e).direction}};function ma(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ba(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=ta(e),d=o||i?[...c?Ji(c):[],...Ji(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const u=c&&s?function(e,t){let n,r=null;const o=zi(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-Qo(u)+"px "+-Qo(o.clientWidth-(d+p))+"px "+-Qo(o.clientHeight-(u+h))+"px "+-Qo(d)+"px",threshold:Zo(0,Go(1,l))||1};let g=!0;function m(t){const r=t[0].intersectionRatio;if(r!==l){if(!g)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||ma(c,e.getBoundingClientRect())||a(),g=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let g=l?ia(e):null;return l&&function t(){const r=ia(e);g&&!ma(g,r)&&n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const va=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=ii(n),s=ai(n),l="y"===di(n),c=Si.has(a)?-1:1,d=i&&l?-1:1,u=oi(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},wa=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=oi(e,t),c={x:n,y:r},d=await ki(t,l),u=di(ii(o)),p=si(u);let h=c[p],f=c[u];if(i){const e="y"===p?"bottom":"right";h=ri(h+d["y"===p?"top":"left"],h,h-d[e])}if(a){const e="y"===u?"bottom":"right";f=ri(f+d["y"===u?"top":"left"],f,f-d[e])}const g=s.fn({...t,[p]:h,[u]:f});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[u]:a}}}}}},ya=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=oi(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const b=ii(o),v=di(s),w=ii(s)===s,y=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=p||(w||!g?[vi(s)]:function(e){const t=vi(e);return[pi(e),t,pi(t)]}(s)),k="none"!==f;!p&&k&&x.push(...bi(s,g,f,y));const N=[s,...x],C=await ki(t,m),O=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(d&&O.push(C[b]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=ai(e),o=ui(e),i=li(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=vi(a)),[a,vi(a)]}(o,a,y);O.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:o,overflows:O}],!O.every(e=>e<=0)){var E,j;const e=((null==(E=i.flip)?void 0:E.index)||0)+1,t=N[e];if(t){if(!("alignment"===u&&v!==di(t))||S.every(e=>di(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:S},reset:{placement:t}}}let n=null==(j=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:j.placement;if(!n)switch(h){case"bestFit":{var R;const e=null==(R=S.filter(e=>{if(k){const t=di(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},xa=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=oi(e,t),d=await ki(t,c),u=ii(o),p=ai(o),h="y"===di(o),{width:f,height:g}=i.floating;let m,b;"top"===u||"bottom"===u?(m=u,b=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,m="end"===p?"top":"bottom");const v=g-d.top-d.bottom,w=f-d.left-d.right,y=Go(g-d[m],v),x=Go(f-d[b],w),k=!t.middlewareData.shift;let N=y,C=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(C=w),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(N=v),k&&!p){const e=Zo(d.left,0),t=Zo(d.right,0),n=Zo(d.top,0),r=Zo(d.bottom,0);h?C=f-2*(0!==e||0!==t?e+t:Zo(d.left,d.right)):N=g-2*(0!==n||0!==r?n+r:Zo(d.top,d.bottom))}await l({...t,availableWidth:C,availableHeight:N});const O=await a.getDimensions(s.floating);return f!==O.width||g!==O.height?{reset:{rects:!0}}:{}}}},ka=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=oi(e,t);switch(r){case"referenceHidden":{const e=Ni(await ki(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ci(e)}}}case"escaped":{const e=Ni(await ki(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ci(e)}}}default:return{}}}}},Na=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=oi(e,t)||{};if(null==c)return{};const u=wi(d),p={x:n,y:r},h=ui(o),f=li(h),g=await a.getDimensions(c),m="y"===h,b=m?"top":"left",v=m?"bottom":"right",w=m?"clientHeight":"clientWidth",y=i.reference[f]+i.reference[h]-p[h]-i.floating[f],x=p[h]-i.reference[h],k=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let N=k?k[w]:0;N&&await(null==a.isElement?void 0:a.isElement(k))||(N=s.floating[w]||i.floating[f]);const C=y/2-x/2,O=N/2-g[f]/2-1,S=Go(u[b],O),E=Go(u[v],O),j=S,R=N-g[f]-E,z=N/2-g[f]/2+C,D=ri(j,z,R),P=!l.arrow&&null!=ai(o)&&z!==D&&i.reference[f]/2-(z<j?S:E)-g[f]/2<0,M=P?z<j?z-j:z-R:0;return{[h]:p[h]+M,data:{[h]:D,centerOffset:z-D-M,...P&&{alignmentOffset:M}},reset:P}}}),Ca=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:s=2,x:l,y:c}=oi(e,t),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[]),u=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let r=null;for(let e=0;e<t.length;e++){const o=t[e];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(e=>yi(Oi(e)))}(d),p=yi(Oi(d)),h=wi(s);const f=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=l&&null!=c)return u.find(e=>l>e.left-h.left&&l<e.right+h.right&&c>e.top-h.top&&c<e.bottom+h.bottom)||p;if(u.length>=2){if("y"===di(n)){const e=u[0],t=u[u.length-1],r="top"===ii(n),o=e.top,i=t.bottom,a=r?e.left:t.left,s=r?e.right:t.right;return{top:o,bottom:i,left:a,right:s,width:s-a,height:i-o,x:a,y:o}}const e="left"===ii(n),t=Zo(...u.map(e=>e.right)),r=Go(...u.map(e=>e.left)),o=u.filter(n=>e?n.left===r:n.right===t),i=o[0].top,a=o[o.length-1].bottom;return{top:i,bottom:a,left:r,right:t,width:t-r,height:a-i,x:r,y:i}}return p}},floating:r.floating,strategy:a});return o.reference.x!==f.reference.x||o.reference.y!==f.reference.y||o.reference.width!==f.reference.width||o.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},Oa=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=oi(e,t),d={x:n,y:r},u=di(o),p=si(u);let h=d[p],f=d[u];const g=oi(s,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+m.mainAxis,n=i.reference[p]+i.reference[e]-m.mainAxis;h<t?h=t:h>n&&(h=n)}if(c){var b,v;const e="y"===p?"width":"height",t=Si.has(ii(o)),n=i.reference[u]-i.floating[e]+(t&&(null==(b=a.offset)?void 0:b[u])||0)+(t?0:m.crossAxis),r=i.reference[u]+i.reference[e]+(t?0:(null==(v=a.offset)?void 0:v[u])||0)-(t?m.crossAxis:0);f<n?f=n:f>r&&(f=r)}return{[p]:h,[u]:f}}}},Sa=(e,t,n)=>{const r=new Map,o={platform:ga,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=xi(c,r,l),p=r,h={},f=0;for(let n=0;n<s.length;n++){const{name:i,fn:g}=s[n],{x:m,y:b,data:v,reset:w}=await g({x:d,y:u,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=m?m:d,u=null!=b?b:u,h={...h,[i]:{...h[i],...v}},w&&f<=50&&(f++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:d,y:u}=xi(c,p,l))),n=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};var Ea="undefined"!=typeof document?g:function(){};function ja(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!ja(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!ja(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ra(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function za(e,t){const n=Ra(e);return Math.round(t*n)/n}function Da(e){const t=r.useRef(e);return Ea(()=>{t.current=e}),t}function Pa(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=r.useState(o);ja(h,o)||f(o);const[g,m]=r.useState(null),[b,w]=r.useState(null),y=r.useCallback(e=>{e!==C.current&&(C.current=e,m(e))},[]),x=r.useCallback(e=>{e!==O.current&&(O.current=e,w(e))},[]),k=a||g,N=s||b,C=r.useRef(null),O=r.useRef(null),S=r.useRef(u),E=null!=c,j=Da(c),R=Da(i),z=Da(d),D=r.useCallback(()=>{if(!C.current||!O.current)return;const e={placement:t,strategy:n,middleware:h};R.current&&(e.platform=R.current),Sa(C.current,O.current,e).then(e=>{const t={...e,isPositioned:!1!==z.current};P.current&&!ja(S.current,t)&&(S.current=t,v.flushSync(()=>{p(t)}))})},[h,t,n,R,z]);Ea(()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const P=r.useRef(!1);Ea(()=>(P.current=!0,()=>{P.current=!1}),[]),Ea(()=>{if(k&&(C.current=k),N&&(O.current=N),k&&N){if(j.current)return j.current(k,N,D);D()}},[k,N,D,j,E]);const M=r.useMemo(()=>({reference:C,floating:O,setReference:y,setFloating:x}),[y,x]),T=r.useMemo(()=>({reference:k,floating:N}),[k,N]),_=r.useMemo(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=za(T.floating,u.x),r=za(T.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...Ra(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,T.floating,u.x,u.y]);return r.useMemo(()=>({...u,update:D,refs:M,elements:T,floatingStyles:_}),[u,D,M,T,_])}const Ma=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Na({element:n.current,padding:r}).fn(t):{}:n?Na({element:n,padding:r}).fn(t):{};var o}}),Ta=(e,t)=>({...va(e),options:[e,t]}),_a=(e,t)=>({...wa(e),options:[e,t]}),Ia=(e,t)=>({...Oa(e),options:[e,t]}),Aa=(e,t)=>({...ya(e),options:[e,t]}),La=(e,t)=>({...xa(e),options:[e,t]}),Ha=(e,t)=>({...ka(e),options:[e,t]}),Fa=(e,t)=>({...Ca(e),options:[e,t]}),Wa=(e,t)=>({...Ma(e),options:[e,t]});var Ba=r.forwardRef((t,n)=>{const{children:r,width:o=10,height:i=5,...a}=t;return e(xe.svg,{...a,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:e("polygon",{points:"0,0 30,0 15,10"})})});Ba.displayName="Arrow";var Ua=Ba;function Va(e){const[t,n]=r.useState(void 0);return ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var $a="Popper",[Xa,Ya]=se($a),[Ka,qa]=Xa($a),Ga=t=>{const{__scopePopper:n,children:o}=t,[i,a]=r.useState(null);return e(Ka,{scope:n,anchor:i,onAnchorChange:a,children:o})};Ga.displayName=$a;var Za="PopperAnchor",Ja=r.forwardRef((t,n)=>{const{__scopePopper:o,virtualRef:i,...a}=t,s=qa(Za,o),l=r.useRef(null),c=ue(n,l),d=r.useRef(null);return r.useEffect(()=>{const e=d.current;d.current=i?.current||l.current,e!==d.current&&s.onAnchorChange(d.current)}),i?null:e(xe.div,{...a,ref:c})});Ja.displayName=Za;var Qa="PopperContent",[es,ts]=Xa(Qa),ns=r.forwardRef((t,n)=>{const{__scopePopper:o,side:i="bottom",sideOffset:a=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:m,...b}=t,v=qa(Qa,o),[w,y]=r.useState(null),x=ue(n,e=>y(e)),[k,N]=r.useState(null),C=Va(k),O=C?.width??0,S=C?.height??0,E=i+("center"!==s?"-"+s:""),j="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},R=Array.isArray(u)?u:[u],z=R.length>0,D={padding:j,boundary:R.filter(as),altBoundary:z},{refs:P,floatingStyles:M,placement:T,isPositioned:_,middlewareData:I}=Pa({strategy:"fixed",placement:E,whileElementsMounted:(...e)=>ba(...e,{animationFrame:"always"===g}),elements:{reference:v.anchor},middleware:[Ta({mainAxis:a+S,alignmentAxis:l}),d&&_a({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?Ia():void 0,...D}),d&&Aa({...D}),La({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),k&&Wa({element:k,padding:c}),ss({arrowWidth:O,arrowHeight:S}),f&&Ha({strategy:"referenceHidden",...D})]}),[A,L]=ls(T),H=Eo(m);ve(()=>{_&&H?.()},[_,H]);const F=I.arrow?.x,W=I.arrow?.y,B=0!==I.arrow?.centerOffset,[U,V]=r.useState();return ve(()=>{w&&V(window.getComputedStyle(w).zIndex)},[w]),e("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:_?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e(es,{scope:o,placedSide:A,onArrowChange:N,arrowX:F,arrowY:W,shouldHideArrow:B,children:e(xe.div,{"data-side":A,"data-align":L,...b,ref:x,style:{...b.style,animation:_?void 0:"none"}})})})});ns.displayName=Qa;var rs="PopperArrow",os={top:"bottom",right:"left",bottom:"top",left:"right"},is=r.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=ts(rs,r),a=os[i.placedSide];return e("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:e(Ua,{...o,ref:n,style:{...o.style,display:"block"}})})});function as(e){return null!==e}is.displayName=rs;var ss=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[l,c]=ls(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+s/2;let h="",f="";return"bottom"===l?(h=i?d:`${u}px`,f=-s+"px"):"top"===l?(h=i?d:`${u}px`,f=`${r.floating.height+s}px`):"right"===l?(h=-s+"px",f=i?d:`${p}px`):"left"===l&&(h=`${r.floating.width+s}px`,f=i?d:`${p}px`),{data:{x:h,y:f}}}});function ls(e){const[t,n="center"]=e.split("-");return[t,n]}var cs=Ga,ds=Ja,us=ns,ps=is,hs=r.forwardRef((t,n)=>{const{container:o,...i}=t,[a,s]=r.useState(!1);ve(()=>s(!0),[]);const l=o||a&&globalThis?.document?.body;return l?w.createPortal(e(xe.div,{...i,ref:n}),l):null});hs.displayName="Portal";var fs=new WeakMap,gs=new WeakMap,ms={},bs=0,vs=function(e){return e&&(e.host||vs(e.parentNode))},ws=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=vs(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]);ms[n]||(ms[n]=new WeakMap);var i=ms[n],a=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var d=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))d(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(fs.get(e)||0)+1,c=(i.get(e)||0)+1;fs.set(e,l),i.set(e,c),a.push(e),1===l&&o&&gs.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),s.clear(),bs++,function(){a.forEach(function(e){var t=fs.get(e)-1,o=i.get(e)-1;fs.set(e,t),i.set(e,o),t||(gs.has(e)||e.removeAttribute(r),gs.delete(e)),o||e.removeAttribute(n)}),--bs||(fs=new WeakMap,fs=new WeakMap,gs=new WeakMap,ms={})}},ys=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),ws(r,o,n,"aria-hidden")):function(){return null}},xs="right-scroll-bar-position",ks="width-before-scroll-bar";function Ns(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Cs="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,Os=new WeakMap;function Ss(e,t){var n,r,o,i=(n=t||null,r=function(t){return e.forEach(function(e){return Ns(e,t)})},(o=u(function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=r,o.facade);return Cs(function(){var t=Os.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach(function(e){r.has(e)||Ns(e,null)}),r.forEach(function(e){n.has(e)||Ns(e,o)})}Os.set(i,e)},[e]),i}function Es(e){return e}var js=function(e){var t=e.sideCar,n=ie(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,oe({},n))};js.isSideCarExport=!0;var Rs=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Es);var n=[],r=!1;return{read:function(){if(r)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 o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=oe({async:!0,ssr:!1},e),t}(),zs=function(){},Ds=r.forwardRef(function(e,t){var n=r.useRef(null),o=r.useState({onScrollCapture:zs,onWheelCapture:zs,onTouchMoveCapture:zs}),i=o[0],a=o[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,h=e.sideCar,f=e.noRelative,g=e.noIsolation,m=e.inert,b=e.allowPinchZoom,v=e.as,w=void 0===v?"div":v,y=e.gapMode,x=ie(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,N=Ss([n,t]),C=oe(oe({},x),i);return r.createElement(r.Fragment,null,u&&r.createElement(k,{sideCar:Rs,removeScrollBar:d,shards:p,noRelative:f,noIsolation:g,inert:m,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:y}),s?r.cloneElement(r.Children.only(l),oe(oe({},C),{ref:N})):r.createElement(w,oe({},C,{className:c,ref:N}),l))});Ds.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ds.classNames={fullWidth:ks,zeroRight:xs};function Ps(){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 Ms=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=Ps())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ts=function(){var e,t=(e=Ms(),function(t,n){r.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},_s={left:0,top:0,right:0,gap:0},Is=function(e){return parseInt(e||"",10)||0},As=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return _s;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Is(n),Is(r),Is(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ls=Ts(),Hs="data-scroll-locked",Fs=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(Hs,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(xs," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(ks," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(xs," .").concat(xs," {\n right: 0 ").concat(r,";\n }\n \n .").concat(ks," .").concat(ks," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Hs,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Ws=function(){var e=parseInt(document.body.getAttribute(Hs)||"0",10);return isFinite(e)?e:0},Bs=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,i=void 0===o?"margin":o;r.useEffect(function(){return document.body.setAttribute(Hs,(Ws()+1).toString()),function(){var e=Ws()-1;e<=0?document.body.removeAttribute(Hs):document.body.setAttribute(Hs,e.toString())}},[]);var a=r.useMemo(function(){return As(i)},[i]);return r.createElement(Ls,{styles:Fs(a,!t,i,n?"":"!important")})},Us=!1;if("undefined"!=typeof window)try{var Vs=Object.defineProperty({},"passive",{get:function(){return Us=!0,!0}});window.addEventListener("test",Vs,Vs),window.removeEventListener("test",Vs,Vs)}catch(e){Us=!1}var $s=!!Us&&{passive:!1},Xs=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])},Ys=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Ks(e,r)){var o=qs(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ks=function(e,t){return"v"===e?function(e){return Xs(e,"overflowY")}(t):function(e){return Xs(e,"overflowX")}(t)},qs=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},Gs=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Zs=function(e){return[e.deltaX,e.deltaY]},Js=function(e){return e&&"current"in e?e.current:e},Qs=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},el=0,tl=[];function nl(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var rl,ol=(rl=function(e){var t=r.useRef([]),n=r.useRef([0,0]),o=r.useRef(),i=r.useState(el++)[0],a=r.useState(Ts)[0],s=r.useRef(e);r.useEffect(function(){s.current=e},[e]),r.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(Js),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=r.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var r,i=Gs(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var p=window.getSelection(),h=p&&p.anchorNode;if(h&&(h===d||h.contains(d)))return!1;var f=Ys(u,d);if(!f)return!0;if(f?r=u:(r="v"===u?"h":"v",f=Ys(u,d)),!f)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=r),!r)return!0;var g=o.current||r;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,d=a>0,u=0,p=0;do{if(!s)break;var h=qs(e,s),f=h[0],g=h[1]-h[2]-i*f;(f||g)&&Ks(e,s)&&(u+=g,p+=f);var m=s.parentNode;s=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(o&&Math.abs(u)<1||!o&&a>u)||!d&&(o&&Math.abs(p)<1||!o&&-a>p))&&(c=!0),c}(g,t,e,"h"===g?l:c,!0)},[]),c=r.useCallback(function(e){var n=e;if(tl.length&&tl[tl.length-1]===a){var r="deltaY"in n?Zs(n):Gs(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var i=(s.current.shards||[]).map(Js).filter(Boolean).filter(function(e){return e.contains(n.target)});(i.length>0?l(n,i[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),d=r.useCallback(function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:nl(r)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),u=r.useCallback(function(e){n.current=Gs(e),o.current=void 0},[]),p=r.useCallback(function(t){d(t.type,Zs(t),t.target,l(t,e.lockRef.current))},[]),h=r.useCallback(function(t){d(t.type,Gs(t),t.target,l(t,e.lockRef.current))},[]);r.useEffect(function(){return tl.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,$s),document.addEventListener("touchmove",c,$s),document.addEventListener("touchstart",u,$s),function(){tl=tl.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,$s),document.removeEventListener("touchmove",c,$s),document.removeEventListener("touchstart",u,$s)}},[]);var f=e.removeScrollBar,g=e.inert;return r.createElement(r.Fragment,null,g?r.createElement(a,{styles:Qs(i)}):null,f?r.createElement(Bs,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Rs.useMedium(rl),js),il=r.forwardRef(function(e,t){return r.createElement(Ds,oe({},e,{ref:t,sideCar:ol}))});il.classNames=Ds.classNames;var al=il,sl="Popover",[ll,cl]=se(sl,[Ya]),dl=Ya(),[ul,pl]=ll(sl),hl=t=>{const{__scopePopover:n,children:o,open:i,defaultOpen:a,onOpenChange:s,modal:l=!1}=t,c=dl(n),d=r.useRef(null),[u,p]=r.useState(!1),[h,f]=ye({prop:i,defaultProp:a??!1,onChange:s,caller:sl});return e(cs,{...c,children:e(ul,{scope:n,contentId:Ee(),triggerRef:d,open:h,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:u,onCustomAnchorAdd:r.useCallback(()=>p(!0),[]),onCustomAnchorRemove:r.useCallback(()=>p(!1),[]),modal:l,children:o})})};hl.displayName=sl;var fl="PopoverAnchor";r.forwardRef((t,n)=>{const{__scopePopover:o,...i}=t,a=pl(fl,o),s=dl(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=a;return r.useEffect(()=>(l(),()=>c()),[l,c]),e(ds,{...s,...i,ref:n})}).displayName=fl;var gl="PopoverTrigger",ml=r.forwardRef((t,n)=>{const{__scopePopover:r,...o}=t,i=pl(gl,r),a=dl(r),s=ue(n,i.triggerRef),l=e(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":jl(i.open),...o,ref:s,onClick:be(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:e(ds,{asChild:!0,...a,children:l})});ml.displayName=gl;var bl="PopoverPortal",[vl,wl]=ll(bl,{forceMount:void 0}),yl=t=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=t,a=pl(bl,n);return e(vl,{scope:n,forceMount:r,children:e(Ne,{present:r||a.open,children:e(hs,{asChild:!0,container:i,children:o})})})};yl.displayName=bl;var xl="PopoverContent",kl=r.forwardRef((t,n)=>{const r=wl(xl,t.__scopePopover),{forceMount:o=r.forceMount,...i}=t,a=pl(xl,t.__scopePopover);return e(Ne,{present:o||a.open,children:a.modal?e(Cl,{...i,ref:n}):e(Ol,{...i,ref:n})})});kl.displayName=xl;var Nl=pe("PopoverContent.RemoveScroll"),Cl=r.forwardRef((t,n)=>{const o=pl(xl,t.__scopePopover),i=r.useRef(null),a=ue(n,i),s=r.useRef(!1);return r.useEffect(()=>{const e=i.current;if(e)return ys(e)},[]),e(al,{as:Nl,allowPinchZoom:!0,children:e(Sl,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(t.onCloseAutoFocus,e=>{e.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:be(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:be(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ol=r.forwardRef((t,n)=>{const o=pl(xl,t.__scopePopover),i=r.useRef(!1),a=r.useRef(!1);return e(Sl,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(i.current||o.triggerRef.current?.focus(),e.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(i.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,r=o.triggerRef.current?.contains(n);r&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),Sl=r.forwardRef((t,n)=>{const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=t,h=pl(xl,r),f=dl(r);return Ao(),e(Bo,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:a,children:e(Mo,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:e(us,{"data-state":jl(h.open),role:"dialog",id:h.contentId,...f,...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)"}})})})}),El="PopoverClose";r.forwardRef((t,n)=>{const{__scopePopover:r,...o}=t,i=pl(El,r);return e(xe.button,{type:"button",...o,ref:n,onClick:be(t.onClick,()=>i.onOpenChange(!1))})}).displayName=El;function jl(e){return e?"open":"closed"}r.forwardRef((t,n)=>{const{__scopePopover:r,...o}=t,i=dl(r);return e(ps,{...i,...o,ref:n})}).displayName="PopoverArrow";var Rl=yl,zl=kl;const Dl=hl,Pl=ml,Ml=r.forwardRef((t,n)=>{var{className:r,align:o="center",sideOffset:i=4}=t,a=ie(t,["className","align","sideOffset"]);return e(Rl,{children:e(zl,Object.assign({ref:n,align:o,sideOffset:i,className:mr("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r)},a))})});Ml.displayName=zl.displayName;const Tl=({value:t,options:r,onValueChange:o,currentLabel:i})=>{const[a,s]=u(!1),[c,d]=u(""),p=l(()=>{if(!c)return r;const e=c.toLowerCase();return r.filter(t=>t.label.toLowerCase().includes(e)||t.value.toLowerCase().includes(e))},[c,r]);return n(Dl,Object.assign({open:a,onOpenChange:s},{children:[e(Pl,Object.assign({asChild:!0},{children:n(co,Object.assign({variant:"outline",size:"sm",className:"h-7 gap-1.5 text-xs font-mono",contentEditable:!1},{children:[i,e(Ht,{className:"h-3 w-3 opacity-50"})]}))})),e(Ml,Object.assign({className:"w-64 p-0",align:"start",contentEditable:!1,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},{children:n("div",Object.assign({className:"p-2"},{children:[n("div",Object.assign({className:"relative mb-2"},{children:[e(un,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),e(So,{placeholder:"Search language...",value:c,onChange:e=>d(e.target.value),className:"h-8 pl-7 text-xs",autoFocus:!0})]})),e("div",Object.assign({className:"max-h-[200px] overflow-y-auto"},{children:0===p.length?e("div",Object.assign({className:"px-2 py-4 text-center text-sm text-muted-foreground"},{children:"No languages found"})):e("div",Object.assign({className:"space-y-0.5"},{children:p.map(n=>e("button",Object.assign({type:"button",onClick:()=>{return e=n.value,o(e),s(!1),void d("");var e},className:mr("w-full rounded-sm px-2 py-1.5 text-left text-xs font-mono transition-colors","hover:bg-accent hover:text-accent-foreground",t===n.value&&"bg-accent text-accent-foreground")},{children:n.label}),n.value))}))}))]}))}))]}))},_l=({value:t,options:r,onValueChange:o,currentLabel:i})=>{const[a,s]=u(!1),[c,d]=u(""),p=l(()=>{if(!c)return r;const e=c.toLowerCase();return r.filter(t=>t.label.toLowerCase().includes(e)||t.value.toLowerCase().includes(e))},[c,r]);return n(Dl,Object.assign({open:a,onOpenChange:s},{children:[e(Pl,Object.assign({asChild:!0},{children:n(co,Object.assign({variant:"outline",size:"sm",className:"h-7 gap-1.5 text-xs",contentEditable:!1},{children:[i,e(Ht,{className:"h-3 w-3 opacity-50"})]}))})),e(Ml,Object.assign({className:"w-64 p-0",align:"start",contentEditable:!1,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},{children:n("div",Object.assign({className:"p-2"},{children:[n("div",Object.assign({className:"relative mb-2"},{children:[e(un,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),e(So,{placeholder:"Search theme...",value:c,onChange:e=>d(e.target.value),className:"h-8 pl-7 text-xs",autoFocus:!0})]})),e("div",Object.assign({className:"max-h-[200px] overflow-y-auto"},{children:0===p.length?e("div",Object.assign({className:"px-2 py-4 text-center text-sm text-muted-foreground"},{children:"No themes found"})):e("div",Object.assign({className:"space-y-0.5"},{children:p.map(n=>e("button",Object.assign({type:"button",onClick:()=>{return e=n.value,o(e),s(!1),void d("");var e},className:mr("w-full rounded-sm px-2 py-1.5 text-left text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",t===n.value&&"bg-accent text-accent-foreground")},{children:n.label}),n.value))}))}))]}))}))]}))},Il=e=>{var t;if(M.isText(e))return e.text;if("object"==typeof e&&null!==e&&"children"in e){const n=e.children;return null!==(t=null==n?void 0:n.map(Il).join("\n"))&&void 0!==t?t:""}return""},Al={code:{render:({attributes:t,children:r,element:o,blockId:i})=>{var a,s,l,h,f,g;const m=x(),b=null!==(s=null===(a=o.props)||void 0===a?void 0:a.language)&&void 0!==s?s:"javascript",v=null!==(h=null===(l=o.props)||void 0===l?void 0:l.theme)&&void 0!==h?h:"github-dark",w=d(null),[y,C]=u(!1),[O,S]=u(!1),[E,j]=u({background:"",foreground:"",caret:"",tabActiveBackground:"",tabInactiveBackground:"",buttonForeground:""});p(()=>{var e,t,n,r,o,i,a,s,l,c,d,u,p,h;if(window.yShiki){const f=window.yShiki.getTheme(v);j({background:f.bg,foreground:f.fg,caret:null!==(t=null===(e=f.colors)||void 0===e?void 0:e["editorCursor.foreground"])&&void 0!==t?t:f.fg,tabActiveBackground:null!==(i=null!==(r=null===(n=f.colors)||void 0===n?void 0:n["editorTab.activeBackground"])&&void 0!==r?r:null===(o=f.colors)||void 0===o?void 0:o["tab.activeBackground"])&&void 0!==i?i:f.bg,tabInactiveBackground:null!==(c=null!==(s=null===(a=f.colors)||void 0===a?void 0:a["editorTab.inactiveBackground"])&&void 0!==s?s:null===(l=f.colors)||void 0===l?void 0:l["tab.inactiveBackground"])&&void 0!==c?c:f.bg,buttonForeground:null!==(h=null!==(u=null===(d=f.colors)||void 0===d?void 0:d["button.foreground"])&&void 0!==u?u:null===(p=f.colors)||void 0===p?void 0:p["icon.foreground"])&&void 0!==h?h:f.fg})}},[v]);const z=c(()=>{const e=Il(o);Co(e)&&(C(!0),setTimeout(()=>C(!1),1500))},[o]),D=c(()=>{const e=k.getBlockSlate(m,{id:i});if(!e)return;const t=N.getElementPath(m,{blockId:i,element:o});if(!t)return;const n=t?R.parent(e,t):void 0;n&&P.isElement(n[0])&&!R.isEditor(n[0])?N.deleteElement(m,{blockId:i,type:"code",path:t}):k.deleteBlock(m,{blockId:i,focus:!0})},[m,i,o]),M=c(e=>{T.updateCodeLanguage(m,i,e)},[m,i]),H=c(e=>{T.updateCodeTheme(m,i,e)},[m,i]),F=c(()=>ae(void 0,void 0,void 0,function*(){if(!O){S(!0);try{yield T.beautifyCode(m,i)}finally{S(!1)}}}),[m,i,O]),W=_(b),B=null!==(f=I.find(e=>e.value===b))&&void 0!==f?f:I[0],U=null!==(g=A.find(e=>e.value===v))&&void 0!==g?g:A[0];return n("div",Object.assign({},t,{className:"relative my-2 group/code-block rounded-lg border border-border bg-muted/50 overflow-hidden"},{children:[n("div",Object.assign({contentEditable:!1,className:"flex items-center justify-between px-4 py-2 border-b border-border select-none",style:{backgroundColor:E.tabActiveBackground||void 0}},{children:[n("div",Object.assign({className:"flex items-center gap-2"},{children:[e(Tl,{value:b,options:I,onValueChange:e=>M(e),currentLabel:B.label}),e(_l,{value:v,options:A,onValueChange:e=>H(e),currentLabel:U.label})]})),n("div",Object.assign({className:"flex items-center gap-1 opacity-0 group-hover/code-block:opacity-100 transition-opacity"},{children:[W&&e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:F,disabled:O,title:"Beautify code",style:{color:E.buttonForeground||void 0}},{children:e(hn,{className:"h-4 w-4 "+(O?"animate-pulse":"")})})),e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:z,title:y?"Copied!":"Copy code",style:{color:E.buttonForeground||void 0}},{children:e(y?Lt:$t,{className:"h-4 w-4"})})),e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:"Delete code block",style:{color:E.buttonForeground||void 0}},{children:e(gn,{className:"h-4 w-4"})}))]}))]})),n("div",Object.assign({className:"relative bg-background overflow-hidden",style:{backgroundColor:E.background,color:E.foreground,caretColor:E.caret}},{children:[e("div",Object.assign({ref:w,className:"absolute inset-0 p-4 font-mono text-sm whitespace-pre overflow-auto pointer-events-none z-10 select-none",style:{lineHeight:"1.6",tabSize:2},contentEditable:!1,"aria-hidden":"true"},{children:e(L,{element:o,language:b,theme:v})})),e("div",Object.assign({className:"relative p-4 font-mono text-sm whitespace-pre overflow-auto",style:{lineHeight:"1.6",tabSize:2,color:"transparent",caretColor:E.caret},onScroll:e=>{w.current&&(w.current.scrollTop=e.currentTarget.scrollTop,w.current.scrollLeft=e.currentTarget.scrollLeft)}},{children:r}))]}))]}))}}};var Ll="rovingFocusGroup.onEntryFocus",Hl={bubbles:!1,cancelable:!0},Fl="RovingFocusGroup",[Wl,Bl,Ul]=me(Fl),[Vl,$l]=se(Fl,[Ul]),[Xl,Yl]=Vl(Fl),Kl=r.forwardRef((t,n)=>e(Wl.Provider,{scope:t.__scopeRovingFocusGroup,children:e(Wl.Slot,{scope:t.__scopeRovingFocusGroup,children:e(ql,{...t,ref:n})})}));Kl.displayName=Fl;var ql=r.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,orientation:i,loop:a=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...h}=t,f=r.useRef(null),g=ue(n,f),m=Ve(s),[b,v]=ye({prop:l,defaultProp:c??null,onChange:d,caller:Fl}),[w,y]=r.useState(!1),x=Eo(u),k=Bl(o),N=r.useRef(!1),[C,O]=r.useState(0);return r.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(Ll,x),()=>e.removeEventListener(Ll,x)},[x]),e(Xl,{scope:o,orientation:i,dir:m,loop:a,currentTabStopId:b,onItemFocus:r.useCallback(e=>v(e),[v]),onItemShiftTab:r.useCallback(()=>y(!0),[]),onFocusableItemAdd:r.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>O(e=>e-1),[]),children:e(xe.div,{tabIndex:w||0===C?-1:0,"data-orientation":i,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:be(t.onMouseDown,()=>{N.current=!0}),onFocus:be(t.onFocus,e=>{const t=!N.current;if(e.target===e.currentTarget&&t&&!w){const t=new CustomEvent(Ll,Hl);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);Ql([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}N.current=!1}),onBlur:be(t.onBlur,()=>y(!1))})})}),Gl="RovingFocusGroupItem",Zl=r.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,focusable:i=!0,active:a=!1,tabStopId:s,children:l,...c}=t,d=Ee(),u=s||d,p=Yl(Gl,o),h=p.currentTabStopId===u,f=Bl(o),{onFocusableItemAdd:g,onFocusableItemRemove:m,currentTabStopId:b}=p;return r.useEffect(()=>{if(i)return g(),()=>m()},[i,g,m]),e(Wl.ItemSlot,{scope:o,id:u,focusable:i,active:a,children:e(xe.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:n,onMouseDown:be(t.onMouseDown,e=>{i?p.onItemFocus(u):e.preventDefault()}),onFocus:be(t.onFocus,()=>p.onItemFocus(u)),onKeyDown:be(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Jl[r]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=p.loop?(r=i+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(i+1)}setTimeout(()=>Ql(o))}var n,r}),children:"function"==typeof l?l({isCurrentTabStop:h,hasTabStop:null!=b}):l})})});Zl.displayName=Gl;var Jl={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ql(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var ec=Kl,tc=Zl,nc="Tabs",[rc,oc]=se(nc,[$l]),ic=$l(),[ac,sc]=rc(nc),lc=r.forwardRef((t,n)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:a,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=t,u=Ve(l),[p,h]=ye({prop:o,onChange:i,defaultProp:a??"",caller:nc});return e(ac,{scope:r,baseId:Ee(),value:p,onValueChange:h,orientation:s,dir:u,activationMode:c,children:e(xe.div,{dir:u,"data-orientation":s,...d,ref:n})})});lc.displayName=nc;var cc="TabsList",dc=r.forwardRef((t,n)=>{const{__scopeTabs:r,loop:o=!0,...i}=t,a=sc(cc,r),s=ic(r);return e(ec,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:o,children:e(xe.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:n})})});dc.displayName=cc;var uc="TabsTrigger",pc=r.forwardRef((t,n)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...a}=t,s=sc(uc,r),l=ic(r),c=gc(s.baseId,o),d=mc(s.baseId,o),u=o===s.value;return e(tc,{asChild:!0,...l,focusable:!i,active:u,children:e(xe.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:n,onMouseDown:be(t.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(o)}),onKeyDown:be(t.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(o)}),onFocus:be(t.onFocus,()=>{const e="manual"!==s.activationMode;u||i||!e||s.onValueChange(o)})})})});pc.displayName=uc;var hc="TabsContent",fc=r.forwardRef((t,n)=>{const{__scopeTabs:o,value:i,forceMount:a,children:s,...l}=t,c=sc(hc,o),d=gc(c.baseId,i),u=mc(c.baseId,i),p=i===c.value,h=r.useRef(p);return r.useEffect(()=>{const e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),e(Ne,{present:a||p,children:({present:r})=>e(xe.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!r,id:u,tabIndex:0,...l,ref:n,style:{...t.style,animationDuration:h.current?"0s":void 0},children:r&&s})})});function gc(e,t){return`${e}-trigger-${t}`}function mc(e,t){return`${e}-content-${t}`}fc.displayName=hc;var bc=dc,vc=pc,wc=fc;const yc=lc,xc=r.forwardRef((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e(bc,Object.assign({ref:n,className:mr("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r)},o))});xc.displayName=bc.displayName;const kc=r.forwardRef((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e(vc,Object.assign({ref:n,className:mr("inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",r)},o))});kc.displayName=vc.displayName;const Nc=r.forwardRef((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e(wc,Object.assign({ref:n,className:mr("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r)},o))});Nc.displayName=wc.displayName;const Cc=e=>{var t;if(M.isText(e))return e.text;if("object"==typeof e&&null!==e&&"children"in e){const n=e.children;return null!==(t=null==n?void 0:n.map(Cc).join("\n"))&&void 0!==t?t:""}return""};function Oc(e,[t,n]){return Math.min(n,Math.max(t,e))}var Sc="ScrollArea",[Ec,jc]=se(Sc),[Rc,zc]=Ec(Sc),Dc=r.forwardRef((t,n)=>{const{__scopeScrollArea:o,type:i="hover",dir:a,scrollHideDelay:s=600,...l}=t,[c,d]=r.useState(null),[u,p]=r.useState(null),[h,f]=r.useState(null),[g,m]=r.useState(null),[b,v]=r.useState(null),[w,y]=r.useState(0),[x,k]=r.useState(0),[N,C]=r.useState(!1),[O,S]=r.useState(!1),E=ue(n,e=>d(e)),j=Ve(a);return e(Rc,{scope:o,type:i,dir:j,scrollHideDelay:s,scrollArea:c,viewport:u,onViewportChange:p,content:h,onContentChange:f,scrollbarX:g,onScrollbarXChange:m,scrollbarXEnabled:N,onScrollbarXEnabledChange:C,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:O,onScrollbarYEnabledChange:S,onCornerWidthChange:y,onCornerHeightChange:k,children:e(xe.div,{dir:j,...l,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});Dc.displayName=Sc;var Pc="ScrollAreaViewport",Mc=r.forwardRef((o,i)=>{const{__scopeScrollArea:a,children:s,nonce:l,...c}=o,d=zc(Pc,a),u=ue(i,r.useRef(null),d.onViewportChange);return n(t,{children:[e("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),e(xe.div,{"data-radix-scroll-area-viewport":"",...c,ref:u,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...o.style},children:e("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});Mc.displayName=Pc;var Tc="ScrollAreaScrollbar",_c=r.forwardRef((t,n)=>{const{forceMount:o,...i}=t,a=zc(Tc,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=a,c="horizontal"===t.orientation;return r.useEffect(()=>(c?s(!0):l(!0),()=>{c?s(!1):l(!1)}),[c,s,l]),"hover"===a.type?e(Ic,{...i,ref:n,forceMount:o}):"scroll"===a.type?e(Ac,{...i,ref:n,forceMount:o}):"auto"===a.type?e(Lc,{...i,ref:n,forceMount:o}):"always"===a.type?e(Hc,{...i,ref:n}):null});_c.displayName=Tc;var Ic=r.forwardRef((t,n)=>{const{forceMount:o,...i}=t,a=zc(Tc,t.__scopeScrollArea),[s,l]=r.useState(!1);return r.useEffect(()=>{const e=a.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),l(!0)},r=()=>{t=window.setTimeout(()=>l(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[a.scrollArea,a.scrollHideDelay]),e(Ne,{present:o||s,children:e(Lc,{"data-state":s?"visible":"hidden",...i,ref:n})})}),Ac=r.forwardRef((t,n)=>{const{forceMount:o,...i}=t,a=zc(Tc,t.__scopeScrollArea),s="horizontal"===t.orientation,l=od(()=>d("SCROLL_END"),100),[c,d]=(u="hidden",p={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},r.useReducer((e,t)=>p[e][t]??e,u));var u,p;return r.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,a.scrollHideDelay,d]),r.useEffect(()=>{const e=a.viewport,t=s?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(d("SCROLL"),l()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[a.viewport,s,d,l]),e(Ne,{present:o||"hidden"!==c,children:e(Hc,{"data-state":"hidden"===c?"hidden":"visible",...i,ref:n,onPointerEnter:be(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:be(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),Lc=r.forwardRef((t,n)=>{const o=zc(Tc,t.__scopeScrollArea),{forceMount:i,...a}=t,[s,l]=r.useState(!1),c="horizontal"===t.orientation,d=od(()=>{if(o.viewport){const e=o.viewport.offsetWidth<o.viewport.scrollWidth,t=o.viewport.offsetHeight<o.viewport.scrollHeight;l(c?e:t)}},10);return id(o.viewport,d),id(o.content,d),e(Ne,{present:i||s,children:e(Hc,{"data-state":s?"visible":"hidden",...a,ref:n})})}),Hc=r.forwardRef((t,n)=>{const{orientation:o="vertical",...i}=t,a=zc(Tc,t.__scopeScrollArea),s=r.useRef(null),l=r.useRef(0),[c,d]=r.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Jc(c.viewport,c.content),p={...i,sizes:c,onSizesChange:d,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>s.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function h(e,t){return function(e,t,n,r="ltr"){const o=Qc(n),i=o/2,a=t||i,s=o-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,d=n.content-n.viewport,u="ltr"===r?[0,d]:[-1*d,0];return td([l,c],u)(e)}(e,l.current,c,t)}return"horizontal"===o?e(Fc,{...p,ref:n,onThumbPositionChange:()=>{if(a.viewport&&s.current){const e=ed(a.viewport.scrollLeft,c,a.dir);s.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=h(e,a.dir))}}):"vertical"===o?e(Wc,{...p,ref:n,onThumbPositionChange:()=>{if(a.viewport&&s.current){const e=ed(a.viewport.scrollTop,c);s.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=h(e))}}):null}),Fc=r.forwardRef((t,n)=>{const{sizes:o,onSizesChange:i,...a}=t,s=zc(Tc,t.__scopeScrollArea),[l,c]=r.useState(),d=r.useRef(null),u=ue(n,d,s.onScrollbarXChange);return r.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),e(Vc,{"data-orientation":"horizontal",...a,ref:u,sizes:o,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Qc(o)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,n)=>{if(s.viewport){const r=s.viewport.scrollLeft+e.deltaX;t.onWheelScroll(r),nd(r,n)&&e.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&i({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Zc(l.paddingLeft),paddingEnd:Zc(l.paddingRight)}})}})}),Wc=r.forwardRef((t,n)=>{const{sizes:o,onSizesChange:i,...a}=t,s=zc(Tc,t.__scopeScrollArea),[l,c]=r.useState(),d=r.useRef(null),u=ue(n,d,s.onScrollbarYChange);return r.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),e(Vc,{"data-orientation":"vertical",...a,ref:u,sizes:o,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Qc(o)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,n)=>{if(s.viewport){const r=s.viewport.scrollTop+e.deltaY;t.onWheelScroll(r),nd(r,n)&&e.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&i({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Zc(l.paddingTop),paddingEnd:Zc(l.paddingBottom)}})}})}),[Bc,Uc]=Ec(Tc),Vc=r.forwardRef((t,n)=>{const{__scopeScrollArea:o,sizes:i,hasThumb:a,onThumbChange:s,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:p,onResize:h,...f}=t,g=zc(Tc,o),[m,b]=r.useState(null),v=ue(n,e=>b(e)),w=r.useRef(null),y=r.useRef(""),x=g.viewport,k=i.content-i.viewport,N=Eo(p),C=Eo(d),O=od(h,10);function S(e){if(w.current){const t=e.clientX-w.current.left,n=e.clientY-w.current.top;u({x:t,y:n})}}return r.useEffect(()=>{const e=e=>{const t=e.target,n=m?.contains(t);n&&N(e,k)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,m,k,N]),r.useEffect(C,[i,C]),id(m,O),id(g.content,O),e(Bc,{scope:o,scrollbar:m,hasThumb:a,onThumbChange:Eo(s),onThumbPointerUp:Eo(l),onThumbPositionChange:C,onThumbPointerDown:Eo(c),children:e(xe.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:be(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),w.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),S(e)}}),onPointerMove:be(t.onPointerMove,S),onPointerUp:be(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,g.viewport&&(g.viewport.style.scrollBehavior=""),w.current=null})})})}),$c="ScrollAreaThumb",Xc=r.forwardRef((t,n)=>{const{forceMount:r,...o}=t,i=Uc($c,t.__scopeScrollArea);return e(Ne,{present:r||i.hasThumb,children:e(Yc,{ref:n,...o})})}),Yc=r.forwardRef((t,n)=>{const{__scopeScrollArea:o,style:i,...a}=t,s=zc($c,o),l=Uc($c,o),{onThumbPositionChange:c}=l,d=ue(n,e=>l.onThumbChange(e)),u=r.useRef(void 0),p=od(()=>{u.current&&(u.current(),u.current=void 0)},100);return r.useEffect(()=>{const e=s.viewport;if(e){const t=()=>{if(p(),!u.current){const t=rd(e,c);u.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[s.viewport,p,c]),e(xe.div,{"data-state":l.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:be(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;l.onThumbPointerDown({x:n,y:r})}),onPointerUp:be(t.onPointerUp,l.onThumbPointerUp)})});Xc.displayName=$c;var Kc="ScrollAreaCorner",qc=r.forwardRef((t,n)=>{const r=zc(Kc,t.__scopeScrollArea),o=Boolean(r.scrollbarX&&r.scrollbarY);return"scroll"!==r.type&&o?e(Gc,{...t,ref:n}):null});qc.displayName=Kc;var Gc=r.forwardRef((t,n)=>{const{__scopeScrollArea:o,...i}=t,a=zc(Kc,o),[s,l]=r.useState(0),[c,d]=r.useState(0),u=Boolean(s&&c);return id(a.scrollbarX,()=>{const e=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(e),d(e)}),id(a.scrollbarY,()=>{const e=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(e),l(e)}),u?e(xe.div,{...i,ref:n,style:{width:s,height:c,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...t.style}}):null});function Zc(e){return e?parseInt(e,10):0}function Jc(e,t){const n=e/t;return isNaN(n)?0:n}function Qc(e){const t=Jc(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ed(e,t,n="ltr"){const r=Qc(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,s=i-r,l=Oc(e,"ltr"===n?[0,a]:[-1*a,0]);return td([0,a],[0,s])(l)}function td(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function nd(e,t){return e>0&&e<t}var rd=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,s=n.top!==i.top;(a||s)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function od(e,t){const n=Eo(e),o=r.useRef(0);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),r.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(n,t)},[n,t])}function id(e,t){const n=Eo(t);ve(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var ad=Dc,sd=Mc,ld=qc;const cd=t=>{var{className:n,orientation:r="vertical"}=t,o=ie(t,["className","orientation"]);return e(_c,Object.assign({"data-slot":"scroll-area-scrollbar",orientation:r,className:mr("flex touch-none p-px transition-colors select-none","vertical"===r&&"h-full w-2.5 border-l border-l-transparent","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent",n)},o,{children:e(Xc,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})}))},dd=t=>{var{className:r,children:o}=t,i=ie(t,["className","children"]);return n(ad,Object.assign({"data-slot":"scroll-area",className:mr("relative",r)},i,{children:[e(sd,Object.assign({"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"},{children:o})),e(cd,{}),e(ld,{})]}))};re("[data-code-group-container] [data-state=active]{background-color:var(--code-group-tab-active-bg)!important;border-bottom-color:var(--code-group-tab-active-fg)!important;color:var(--code-group-tab-active-fg)!important}[data-code-group-container] [data-state=inactive]{background-color:var(--code-group-tab-inactive-bg)!important;color:var(--code-group-tab-inactive-fg)!important}");const ud={"code-group-container":{render:t=>{var n,r;const{attributes:o,children:i,blockId:a,element:s}=t,l=x(),c=null===(n=t.element.props)||void 0===n?void 0:n.theme;p(()=>{var e,t,n,r,o,i,a,s,l,d,u,p,h,f,g,m,b,v,w,y,x,k,N,C,O,S,E,j,R,z,D,P,M,T,_,I;if(window.yShiki){const A=window.yShiki.getTheme(c),L=null!==(r=null!==(t=null===(e=A.colors)||void 0===e?void 0:e["tab.activeBackground"])&&void 0!==t?t:null===(n=A.colors)||void 0===n?void 0:n["editorTab.activeBackground"])&&void 0!==r?r:A.bg,H={"code-group-tab-active-bg":L,"code-group-tab-inactive-bg":null!==(d=null!==(s=null!==(i=null===(o=A.colors)||void 0===o?void 0:o["tab.inactiveBackground"])&&void 0!==i?i:null===(a=A.colors)||void 0===a?void 0:a["editorTab.inactiveBackground"])&&void 0!==s?s:null===(l=A.colors)||void 0===l?void 0:l["editorGroupHeader.tabsBackground"])&&void 0!==d?d:A.bg,"code-group-tab-active-fg":null!==(f=null!==(p=null===(u=A.colors)||void 0===u?void 0:u["tab.activeForeground"])&&void 0!==p?p:null===(h=A.colors)||void 0===h?void 0:h["editorTab.activeForeground"])&&void 0!==f?f:A.fg,"code-group-tab-inactive-fg":null!==(y=null!==(v=null!==(m=null===(g=A.colors)||void 0===g?void 0:g["tab.inactiveForeground"])&&void 0!==m?m:null===(b=A.colors)||void 0===b?void 0:b["editorTab.inactiveForeground"])&&void 0!==v?v:null===(w=A.colors)||void 0===w?void 0:w.foreground)&&void 0!==y?y:A.fg,"code-group-tab-active-border":null!==(C=null!==(k=null===(x=A.colors)||void 0===x?void 0:x["tab.activeBorder"])&&void 0!==k?k:null===(N=A.colors)||void 0===N?void 0:N["editorTab.activeBorder"])&&void 0!==C?C:L,"code-group-tab-border":null!==(z=null!==(j=null!==(S=null===(O=A.colors)||void 0===O?void 0:O["tab.border"])&&void 0!==S?S:null===(E=A.colors)||void 0===E?void 0:E["editorGroupHeader.border"])&&void 0!==j?j:null===(R=A.colors)||void 0===R?void 0:R["editorGroup.border"])&&void 0!==z?z:"transparent","code-group-editor-bg":null!==(P=null===(D=A.colors)||void 0===D?void 0:D["editor.background"])&&void 0!==P?P:A.bg,"code-group-editor-fg":null!==(T=null===(M=A.colors)||void 0===M?void 0:M["editor.foreground"])&&void 0!==T?T:A.fg,"code-group-editor-cursor":null!==(I=null===(_=A.colors)||void 0===_?void 0:_["editorCursor.foreground"])&&void 0!==I?I:A.fg};Object.entries(H).forEach(([e,t])=>{document.documentElement.style.setProperty(`--${e}`,t)})}},[c]);return e("div",Object.assign({},o,{"data-code-group-container":!0,className:"w-full"},{children:e(yc,Object.assign({value:null===(r=s.props)||void 0===r?void 0:r.activeTabId,onValueChange:e=>{const t=k.getBlockSlate(l,{id:a});t&&D.setNodes(t,{props:Object.assign(Object.assign({},s.props),{activeTabId:e})},{at:[0],match:e=>P.isElement(e)&&"code-group-container"===e.type})},className:"w-full"},{children:i}))}))}},"code-group-list":{render:t=>{const{attributes:r,children:o,blockId:i}=t,a=x();return n(dd,Object.assign({className:"w-full"},{children:[n(xc,Object.assign({},r,{className:"w-full relative justify-start h-8 rounded-none rounded-t-lg bg-transparent p-0 border-b border-x-0 border-t-0",style:{backgroundColor:"var(--code-group-tab-inactive-bg)",borderBottomColor:"var(--code-group-tab-border)"}},{children:[o,e("button",Object.assign({type:"button",contentEditable:!1,onClick:e=>{e.preventDefault(),e.stopPropagation(),H.addTabItem(a,i)},className:"ml-1 flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1.5 h-7",style:{color:"var(--code-group-tab-inactive-fg)"},title:"Add tab"},{children:e(cn,{className:"h-3.5 w-3.5 shrink-0"})}))]})),e(cd,{orientation:"horizontal"})]}))}},"code-group-item-heading":{render:t=>{const{attributes:r,children:o,element:i,blockId:a}=t,s=x();return n(kc,Object.assign({},r,{value:i.id,className:"relative group/tab flex items-center gap-1.5 px-3 h-7 rounded-none rounded-t-lg border-b-2 border-transparent whitespace-nowrap text-xs font-normal transition-colors",style:{backgroundColor:"var(--code-group-tab-inactive-bg, hsl(var(--muted)))",color:"var(--code-group-tab-inactive-fg, hsl(var(--muted-foreground)))"}},{children:[e("div",Object.assign({className:"flex-1 min-w-0"},{children:o})),e("span",Object.assign({contentEditable:!1,onClick:()=>{const e=k.getBlockSlate(s,{id:a});if(!e)return;const t=N.getElementPath(s,{blockId:a,element:i});t&&(D.select(e,t),H.deleteTabItem(s,a,{tabId:i.id}))},className:"ml-1 flex items-center justify-center rounded-sm opacity-0 group-hover/tab:opacity-100 transition-opacity hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-0.5",style:{color:"inherit"},title:"Close tab"},{children:e(wn,{className:"h-3 w-3 shrink-0"})}))]}))}},"code-group-content":{render:t=>{var r,o,i,a;const{attributes:s,children:c,element:h,blockId:f}=t,g=d(null),m=x(),b=null!==(o=null===(r=null==h?void 0:h.props)||void 0===r?void 0:r.language)&&void 0!==o?o:"javascript",v=l(()=>{var e,t,n;const r=k.getBlockSlate(m,{id:f});if(!r)return"github-dark";const o=null===(e=Array.from(R.nodes(r,{at:[0],match:e=>P.isElement(e)&&"code-group-container"===e.type})))||void 0===e?void 0:e[0];if(!o)return"github-dark";const[i]=o;return i&&null!==(n=null===(t=i.props)||void 0===t?void 0:t.theme)&&void 0!==n?n:"github-dark"},[m,f]),[w,y]=u(!1),[C,O]=u(!1),[S,E]=u({buttonForeground:""});p(()=>{var e,t,n,r;if(window.yShiki){const o=window.yShiki.getTheme(v);E({buttonForeground:null!==(r=null!==(t=null===(e=o.colors)||void 0===e?void 0:e["button.foreground"])&&void 0!==t?t:null===(n=o.colors)||void 0===n?void 0:n["icon.foreground"])&&void 0!==r?r:o.fg})}},[v]);const j=_(b),z=null!==(i=I.find(e=>e.value===b))&&void 0!==i?i:I[0];return e(Nc,Object.assign({},s,{value:null===(a=h.props)||void 0===a?void 0:a.referenceId,className:"rounded-b-lg mt-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"},{children:n("div",Object.assign({className:"relative group/code-group-content overflow-hidden"},{children:[n("div",Object.assign({contentEditable:!1,className:"absolute top-2 right-2 z-20 flex items-center gap-2 opacity-0 group-hover/code-group-content:opacity-100 transition-opacity",style:{backgroundColor:"var(--code-group-tab-active-bg)",padding:"4px",borderRadius:"4px"}},{children:[e(Tl,{value:b,options:I,onValueChange:e=>{const t=N.getElementPath(m,{blockId:f,element:h});t&&N.updateElement(m,{blockId:f,type:"code-group-content",props:Object.assign(Object.assign({},h.props),{language:e}),path:t})},currentLabel:z.label}),j&&e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>ae(void 0,void 0,void 0,function*(){var e;if(C)return;const t=null===(e=h.props)||void 0===e?void 0:e.referenceId;if(t){O(!0);try{yield H.beautifyTab(m,f,t)}finally{O(!1)}}}),disabled:C,title:"Beautify code",style:{color:S.buttonForeground||"var(--code-group-tab-active-fg)"}},{children:e(hn,{className:"h-4 w-4 "+(C?"animate-pulse":"")})})),e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{const e=Cc(h);Co(e)&&(y(!0),setTimeout(()=>y(!1),1500))},title:w?"Copied!":"Copy code",style:{color:S.buttonForeground||"var(--code-group-tab-active-fg)"}},{children:e(w?Lt:$t,{className:"h-4 w-4"})})),e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{var e;H.deleteTabItem(m,f,{tabId:null===(e=h.props)||void 0===e?void 0:e.referenceId})},title:"Delete code",style:{color:S.buttonForeground||"var(--code-group-tab-active-fg)"}},{children:e(gn,{className:"h-4 w-4"})}))]})),n("div",Object.assign({className:"relative bg-background overflow-hidden rounded-lg",style:{backgroundColor:"var(--code-group-editor-bg)",color:"var(--code-group-editor-fg)",caretColor:"var(--code-group-editor-cursor)"}},{children:[e("div",Object.assign({ref:g,className:"absolute inset-0 p-4 font-mono text-sm whitespace-pre overflow-auto pointer-events-none z-10 select-none",style:{lineHeight:"1.6",tabSize:2},contentEditable:!1,"aria-hidden":"true"},{children:e(L,{element:h,language:b,theme:v})})),e("div",Object.assign({className:"relative p-4 font-mono text-sm whitespace-pre overflow-auto",style:{lineHeight:"1.6",tabSize:2,color:"transparent",caretColor:"var(--code-group-editor-cursor)"},onScroll:e=>{g.current&&(g.current.scrollTop=e.currentTarget.scrollTop,g.current.scrollLeft=e.currentTarget.scrollLeft)}},{children:c}))]}))]}))}))}}};var pd=Symbol.for("react.lazy"),hd=r[" use ".trim().toString()];function fd(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===pd&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function gd(e){const t=r.forwardRef((e,t)=>{let{children:n,...o}=e;if(fd(n)&&"function"==typeof hd&&(n=hd(n._payload)),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),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(i.ref=t?de(t,e):e),r.cloneElement(n,i)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var md=Symbol("radix.slottable");function bd(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===md}var vd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const o=function(t){const n=gd(t),o=r.forwardRef((t,o)=>{let{children:i,...a}=t;fd(i)&&"function"==typeof hd&&(i=hd(i._payload));const s=r.Children.toArray(i),l=s.find(bd);if(l){const t=l.props.children,i=s.map(e=>e===l?r.Children.count(t)>1?r.Children.only(null):r.isValidElement(t)?t.props.children:null:e);return e(n,{...a,ref:o,children:r.isValidElement(t)?r.cloneElement(t,void 0,i):null})}return e(n,{...a,ref:o,children:i})});return o.displayName=`${t}.Slot`,o}(`Primitive.${n}`),i=r.forwardRef((t,r)=>{const{asChild:i,...a}=t,s=i?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e(s,{...a,ref:r})});return i.displayName=`Primitive.${n}`,{...t,[n]:i}},{}),wd="horizontal",yd=["horizontal","vertical"],xd=r.forwardRef((t,n)=>{const{decorative:r,orientation:o=wd,...i}=t,a=function(e){return yd.includes(e)}(o)?o:wd,s=r?{role:"none"}:{"aria-orientation":"vertical"===a?a:void 0,role:"separator"};return e(vd.div,{"data-orientation":a,...s,...i,ref:n})});xd.displayName="Separator";var kd=xd;const Nd=r.forwardRef((t,n)=>{var{className:r,orientation:o="horizontal",decorative:i=!0}=t,a=ie(t,["className","orientation","decorative"]);return e(kd,Object.assign({ref:n,decorative:i,orientation:o,className:mr("shrink-0 bg-border","horizontal"===o?"h-[1px] w-full":"h-full w-[1px]",r)},a))});Nd.displayName=kd.displayName;const Cd={divider:{render:t=>{var r,o,i;const a=x(),{attributes:s,element:l,blockId:c}=t,d=l,u=null!==(o=null===(r=d.props)||void 0===r?void 0:r.theme)&&void 0!==o?o:"solid",p=null===(i=d.props)||void 0===i?void 0:i.color;return n("div",Object.assign({},s,{contentEditable:!1,className:"group relative w-full py-3",onClick:()=>{const e=k.getBlock(a,{id:c});e&&C.setSelected(a,{at:e.meta.order})}},{children:[e(Nd,{orientation:"horizontal",decorative:!0,className:(()=>{switch(u){case"dashed":return mr("border-t-2 border-dashed border-b-0 border-l-0 border-r-0 bg-transparent",p?"":"border-border");case"dotted":return mr("border-t-2 border-dotted border-b-0 border-l-0 border-r-0 bg-transparent",p?"":"border-border");case"gradient":return"h-[2px] bg-transparent border-0";default:return mr("h-[1px]",p?"":"bg-border")}})(),style:(()=>{if(!p)return{};switch(u){case"dashed":case"dotted":return{borderTopColor:p};case"gradient":return{background:`linear-gradient(to right, transparent, ${p}, transparent)`};default:return{backgroundColor:p}}})()}),t.children]}))}}},Od={HeadingOne:{"heading-one":{render:t=>{const{attributes:n,children:r,element:o}=t;return e("h1",Object.assign({id:o.id,draggable:!1},n,{className:"scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl"},{children:r}))}}},HeadingTwo:{"heading-two":{render:t=>{const{attributes:n,children:r,element:o}=t;return e("h2",Object.assign({id:o.id,draggable:!1},n,{className:"scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0"},{children:r}))}}},HeadingThree:{"heading-three":{render:t=>{const{attributes:n,children:r,element:o}=t;return e("h3",Object.assign({id:o.id,draggable:!1},n,{className:"mt-4 scroll-m-20 text-2xl font-semibold tracking-tight"},{children:r}))}}}},Sd=({onInsertFromUnsplash:t})=>e(Nc,Object.assign({value:"unsplash",className:"mt-4"},{children:n("div",Object.assign({className:"flex flex-col items-center gap-3 py-6"},{children:[e("div",Object.assign({className:"rounded-lg bg-muted p-3"},{children:e("svg",Object.assign({className:"h-6 w-6",viewBox:"0 0 32 32",fill:"currentColor"},{children:e("path",{d:"M10 9V0h12v9H10zm12 5h10v18H0V14h10v9h12v-9z"})}))})),n("div",Object.assign({className:"text-center"},{children:[e("p",Object.assign({className:"text-sm font-medium"},{children:"Browse free photos"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Powered by Unsplash"}))]})),e(co,Object.assign({onClick:t},{children:"Browse photos"}))]}))}));var Ed=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"}),jd=r.forwardRef((t,n)=>e(xe.span,{...t,ref:n,style:{...Ed,...t.style}}));jd.displayName="VisuallyHidden";var Rd=jd,[zd,Dd]=se("Tooltip",[Ya]),Pd=Ya(),Md="TooltipProvider",Td=700,_d="tooltip.open",[Id,Ad]=zd(Md),Ld=t=>{const{__scopeTooltip:n,delayDuration:o=Td,skipDelayDuration:i=300,disableHoverableContent:a=!1,children:s}=t,l=r.useRef(!0),c=r.useRef(!1),d=r.useRef(0);return r.useEffect(()=>{const e=d.current;return()=>window.clearTimeout(e)},[]),e(Id,{scope:n,isOpenDelayedRef:l,delayDuration:o,onOpen:r.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:r.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,i)},[i]),isPointerInTransitRef:c,onPointerInTransitChange:r.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:s})};Ld.displayName=Md;var Hd="Tooltip",[Fd,Wd]=zd(Hd),Bd=t=>{const{__scopeTooltip:n,children:o,open:i,defaultOpen:a,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=t,d=Ad(Hd,t.__scopeTooltip),u=Pd(n),[p,h]=r.useState(null),f=Ee(),g=r.useRef(0),m=l??d.disableHoverableContent,b=c??d.delayDuration,v=r.useRef(!1),[w,y]=ye({prop:i,defaultProp:a??!1,onChange:e=>{e?(d.onOpen(),document.dispatchEvent(new CustomEvent(_d))):d.onClose(),s?.(e)},caller:Hd}),x=r.useMemo(()=>w?v.current?"delayed-open":"instant-open":"closed",[w]),k=r.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v.current=!1,y(!0)},[y]),N=r.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y(!1)},[y]),C=r.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{v.current=!0,y(!0),g.current=0},b)},[b,y]);return r.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),e(cs,{...u,children:e(Fd,{scope:n,contentId:f,open:w,stateAttribute:x,trigger:p,onTriggerChange:h,onTriggerEnter:r.useCallback(()=>{d.isOpenDelayedRef.current?C():k()},[d.isOpenDelayedRef,C,k]),onTriggerLeave:r.useCallback(()=>{m?N():(window.clearTimeout(g.current),g.current=0)},[N,m]),onOpen:k,onClose:N,disableHoverableContent:m,children:o})})};Bd.displayName=Hd;var Ud="TooltipTrigger",Vd=r.forwardRef((t,n)=>{const{__scopeTooltip:o,...i}=t,a=Wd(Ud,o),s=Ad(Ud,o),l=Pd(o),c=ue(n,r.useRef(null),a.onTriggerChange),d=r.useRef(!1),u=r.useRef(!1),p=r.useCallback(()=>d.current=!1,[]);return r.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),e(ds,{asChild:!0,...l,children:e(xe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:be(t.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||s.isPointerInTransitRef.current||(a.onTriggerEnter(),u.current=!0))}),onPointerLeave:be(t.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:be(t.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:be(t.onFocus,()=>{d.current||a.onOpen()}),onBlur:be(t.onBlur,a.onClose),onClick:be(t.onClick,a.onClose)})})});Vd.displayName=Ud;var $d="TooltipPortal",[Xd,Yd]=zd($d,{forceMount:void 0}),Kd=t=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=t,a=Wd($d,n);return e(Xd,{scope:n,forceMount:r,children:e(Ne,{present:r||a.open,children:e(hs,{asChild:!0,container:i,children:o})})})};Kd.displayName=$d;var qd="TooltipContent",Gd=r.forwardRef((t,n)=>{const r=Yd(qd,t.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...a}=t,s=Wd(qd,t.__scopeTooltip);return e(Ne,{present:o||s.open,children:s.disableHoverableContent?e(tu,{side:i,...a,ref:n}):e(Zd,{side:i,...a,ref:n})})}),Zd=r.forwardRef((t,n)=>{const o=Wd(qd,t.__scopeTooltip),i=Ad(qd,t.__scopeTooltip),a=r.useRef(null),s=ue(n,a),[l,c]=r.useState(null),{trigger:d,onClose:u}=o,p=a.current,{onPointerInTransitChange:h}=i,f=r.useCallback(()=>{c(null),h(!1)},[h]),g=r.useCallback((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const r=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x)))break;t.pop()}t.push(r)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const r=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x)))break;n.pop()}n.push(r)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...o,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);c(i),h(!0)},[h]);return r.useEffect(()=>()=>f(),[f]),r.useEffect(()=>{if(d&&p){const e=e=>g(e,p),t=e=>g(e,d);return d.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[d,p,g,f]),r.useEffect(()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=d?.contains(t)||p?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e],s=t[i],l=a.x,c=a.y,d=s.x,u=s.y;c>r!=u>r&&n<(d-l)*(r-c)/(u-c)+l&&(o=!o)}return o}(n,l);r?f():o&&(f(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,p,l,u,f]),e(tu,{...t,ref:s})}),[Jd,Qd]=zd(Hd,{isInside:!1}),eu=function(n){const r=({children:n})=>e(t,{children:n});return r.displayName=`${n}.Slottable`,r.__radixId=fe,r}("TooltipContent"),tu=r.forwardRef((t,o)=>{const{__scopeTooltip:i,children:a,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=t,u=Wd(qd,i),p=Pd(i),{onClose:h}=u;return r.useEffect(()=>(document.addEventListener(_d,h),()=>document.removeEventListener(_d,h)),[h]),r.useEffect(()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&h()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,h]),e(Mo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:h,children:n(us,{"data-state":u.stateAttribute,...p,...d,ref:o,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[e(eu,{children:a}),e(Jd,{scope:i,isInside:!0,children:e(Rd,{id:u.contentId,role:"tooltip",children:s||a})})]})})});Gd.displayName=qd;var nu="TooltipArrow",ru=r.forwardRef((t,n)=>{const{__scopeTooltip:r,...o}=t,i=Pd(r);return Qd(nu,r).isInside?null:e(ps,{...i,...o,ref:n})});ru.displayName=nu;var ou=Ld,iu=Bd,au=Vd,su=Kd,lu=Gd,cu=ru;const du=t=>{var{delayDuration:n=0}=t,r=ie(t,["delayDuration"]);return e(ou,Object.assign({"data-slot":"tooltip-provider",delayDuration:n},r))},uu=t=>{var n=ie(t,[]);return e(du,{children:e(iu,Object.assign({"data-slot":"tooltip"},n))})},pu=t=>{var n=ie(t,[]);return e(au,Object.assign({"data-slot":"tooltip-trigger"},n))},hu=t=>{var{className:r,sideOffset:o=0,children:i}=t,a=ie(t,["className","sideOffset","children"]);return e(su,{children:n(lu,Object.assign({"data-slot":"tooltip-content",sideOffset:o,className:mr("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r)},a,{children:[i,e(cu,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]}))})},fu=({preview:t})=>e("div",Object.assign({className:"absolute inset-0 overflow-hidden",style:{width:t.width,height:t.height}},{children:e("img",{src:t.url,alt:"Preview",className:"h-full w-full object-cover object-center",style:{width:t.width,height:t.height},draggable:!1})})),gu=({progress:t})=>e("div",Object.assign({className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-4 bg-black/70 backdrop-blur-sm p-6"},{children:e("div",Object.assign({className:"w-full max-w-md space-y-4"},{children:n("div",Object.assign({className:"space-y-2"},{children:[n("div",Object.assign({className:"flex items-center justify-between text-sm"},{children:[e("span",Object.assign({className:"font-medium text-white"},{children:"Uploading..."})),n("span",Object.assign({className:"text-white/80"},{children:[t.percentage,"%"]}))]})),e("div",Object.assign({className:"h-2 w-full overflow-hidden rounded-full bg-white/20"},{children:e("div",{className:"h-full bg-primary transition-all duration-300 ease-out",style:{width:`${t.percentage}%`}})})),n("div",Object.assign({className:"flex items-center justify-between text-xs text-white/60"},{children:[n("span",{children:[(t.loaded/1024/1024).toFixed(2)," MB /"," ",(t.total/1024/1024).toFixed(2)," MB"]}),e(en,{className:"h-3.5 w-3.5 animate-spin"})]}))]}))}))})),mu=({onUpload:t,hasPreview:r})=>{const o=d(null);return n("div",r?Object.assign({className:"flex flex-col items-center justify-center gap-4 py-8"},{children:[n("div",Object.assign({className:"text-center space-y-2"},{children:[e("p",Object.assign({className:"text-sm font-medium text-white"},{children:"Image preview"})),e("p",Object.assign({className:"text-xs text-white/80"},{children:"Uploading your image..."}))]})),e("input",{ref:o,type:"file",accept:"image/*",onChange:t,className:"hidden"})]}):Object.assign({className:"flex flex-col items-center gap-3 py-6"},{children:[e("div",Object.assign({className:"rounded-lg bg-muted p-3"},{children:e(Zt,{className:"h-6 w-6 text-muted-foreground"})})),n("div",Object.assign({className:"text-center"},{children:[e("p",Object.assign({className:"text-sm font-medium"},{children:"Upload an image"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Click or drag and drop"}))]})),e(co,Object.assign({onClick:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.click()}},{children:"Choose file"})),e("input",{ref:o,type:"file",accept:"image/*",onChange:t,className:"hidden"})]}))},bu=({onInsertUrl:t})=>{const[r,o]=u(""),i=()=>{r.trim()&&(t(r.trim()),o(""))};return n("div",Object.assign({className:"mt-4 space-y-3"},{children:[e(So,{placeholder:"Paste image URL...",value:r,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&r.trim()&&i()}}),e(co,Object.assign({className:"w-full",onClick:i,disabled:!r.trim()},{children:"Embed image"}))]}))},vu=({onInsertFromAI:r})=>{const[o,i]=u(""),[a,s]=u(!1),l=()=>{o.trim()&&!a&&(s(!0),r(o.trim()),s(!1),i(""))};return n("div",Object.assign({className:"mt-4 space-y-3"},{children:[n("div",Object.assign({className:"space-y-2"},{children:[e(So,{placeholder:"Describe the image...",value:o,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&l()},disabled:a}),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:'Example: "A sunset over mountains with dramatic clouds”'}))]})),e(co,Object.assign({className:"w-full gap-2",onClick:l,disabled:!o.trim()||a},{children:n(t,a?{children:[e(en,{className:"h-4 w-4 animate-spin"}),"Generating..."]}:{children:[e(hn,{className:"h-4 w-4"}),"Generate image"]})}))]}))},wu=({onUpload:t,onInsertUrl:r,onInsertFromUnsplash:o,onInsertFromAI:i,hasPreview:a})=>e("div",Object.assign({className:mr("relative p-4",a&&"min-h-[300px] flex flex-col")},{children:n(yc,Object.assign({defaultValue:"upload",className:"w-full"},{children:[n(xc,Object.assign({className:mr("grid w-full grid-cols-4",a&&"bg-background/80 backdrop-blur-sm")},{children:[n(kc,Object.assign({value:"upload",className:"gap-1.5"},{children:[e(bn,{className:"h-3.5 w-3.5"}),"Upload"]})),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:n(kc,Object.assign({value:"link",disabled:!0,className:"gap-1.5"},{children:[e(Qt,{className:"h-3.5 w-3.5"}),"Link"]}))})),e(hu,{children:"Link is not available yet"})]}),o&&n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:n(kc,Object.assign({value:"unsplash",disabled:!0,className:"gap-1.5"},{children:[e("svg",Object.assign({className:"h-3.5 w-3.5",viewBox:"0 0 32 32",fill:"currentColor"},{children:e("path",{d:"M10 9V0h12v9H10zm12 5h10v18H0V14h10v9h12v-9z"})})),"Unsplash"]}))})),e(hu,{children:"Unsplash is not available yet"})]}),i&&n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:n(kc,Object.assign({value:"ai",disabled:!0,className:"gap-1.5"},{children:[e(hn,{className:"h-3.5 w-3.5"}),"AI"]}))})),e(hu,{children:"AI is not available yet"})]})]})),e(Nc,Object.assign({value:"upload",className:"mt-4"},{children:e(mu,{onUpload:t,hasPreview:a})})),e(Nc,Object.assign({value:"link",d:!0},{children:e(bu,{onInsertUrl:r})})),o&&e(Sd,{onInsertFromUnsplash:o}),i&&e(Nc,Object.assign({value:"ai"},{children:e(vu,{onInsertFromAI:i})}))]}))})),yu=({onUpload:t,onInsertUrl:r,onInsertFromUnsplash:o,onInsertFromAI:i,className:a,attributes:s,children:l,preview:c,progress:d,loading:u})=>{const p=null!==c&&!!c.url,h=u&&d;return n("div",Object.assign({className:mr("mt-2 relative rounded-lg border bg-background overflow-hidden",p&&"min-h-[300px]",a)},s,{contentEditable:!1},{children:[p&&e(fu,{preview:c}),!p&&e(wu,{onUpload:t,onInsertUrl:r,onInsertFromUnsplash:o,onInsertFromAI:i,hasPreview:p}),h&&d&&e(gu,{progress:d}),l]}))};var xu,ku,Nu,Cu,Ou={},Su={get exports(){return Ou},set exports(e){Ou=e}},Eu={},ju={};function Ru(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Ru(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function zu(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Ru(e))&&(r&&(r+=" "),r+=t);return r}({get exports(){return ju},set exports(e){ju=e}}).exports=function(){if(Cu)return Nu;Cu=1;var e=ku?xu:(ku=1,xu="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,Nu=function(){function r(t,n,r,o,i,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}()();var Du=xo(Object.freeze({__proto__:null,clsx:zu,default:zu})),Pu={},Mu={};Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.dontSetMe=function(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))},Mu.findInArray=function(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]},Mu.int=function(e){return parseInt(e,10)},Mu.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},Mu.isNum=function(e){return"number"==typeof e&&!isNaN(e)};var Tu={};Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.browserPrefixToKey=Au,Tu.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},Tu.default=void 0,Tu.getPrefix=Iu;const _u=["Moz","Webkit","O","ms"];function Iu(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const n=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!n)return"";if(t in n)return"";for(let e=0;e<_u.length;e++)if(Au(t,_u[e])in n)return _u[e];return""}function Au(e,t){return t?"".concat(t).concat(function(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e)):e}Tu.default=Iu(),Object.defineProperty(Pu,"__esModule",{value:!0}),Pu.addClassName=Vu,Pu.addEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},Pu.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&Vu(e.body,"react-draggable-transparent-selection")},Pu.createCSSTransform=function(e,t){const n=Uu(e,t,"px");return{[(0,Hu.browserPrefixToKey)("transform",Hu.default)]:n}},Pu.createSVGTransform=function(e,t){return Uu(e,t,"")},Pu.getTouch=function(e,t){return e.targetTouches&&(0,Lu.findInArray)(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&(0,Lu.findInArray)(e.changedTouches,e=>t===e.identifier)},Pu.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},Pu.getTranslation=Uu,Pu.innerHeight=function(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Lu.int)(n.paddingTop),t-=(0,Lu.int)(n.paddingBottom),t},Pu.innerWidth=function(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Lu.int)(n.paddingLeft),t-=(0,Lu.int)(n.paddingRight),t},Pu.matchesSelector=Bu,Pu.matchesSelectorAndParentsTo=function(e,t,n){let r=e;do{if(Bu(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},Pu.offsetXYFromParent=function(e,t,n){const r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-r.left)/n,i=(e.clientY+t.scrollTop-r.top)/n;return{x:o,y:i}},Pu.outerHeight=function(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Lu.int)(n.borderTopWidth),t+=(0,Lu.int)(n.borderBottomWidth),t},Pu.outerWidth=function(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Lu.int)(n.borderLeftWidth),t+=(0,Lu.int)(n.borderRightWidth),t},Pu.removeClassName=$u,Pu.removeEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},Pu.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&$u(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var Lu=Mu,Hu=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=Fu(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(Tu);function Fu(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(Fu=function(e){return e?n:t})(e)}let Wu="";function Bu(e,t){return Wu||(Wu=(0,Lu.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(t){return(0,Lu.isFunction)(e[t])})),!!(0,Lu.isFunction)(e[Wu])&&e[Wu](t)}function Uu(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const e="".concat("string"==typeof t.x?t.x:t.x+n),r="".concat("string"==typeof t.y?t.y:t.y+n);i="translate(".concat(e,", ").concat(r,")")+i}return i}function Vu(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function $u(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Xu={};Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},Xu.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},Xu.createCoreData=function(e,t,n){const r=!(0,Yu.isNum)(e.lastX),o=qu(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}},Xu.createDraggableData=function(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}},Xu.getBoundPosition=function(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r="string"==typeof r?r:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(r);const o=qu(e);if("string"==typeof r){const{ownerDocument:e}=o,t=e.defaultView;let n;if(n="parent"===r?o.parentNode:e.querySelector(r),!(n instanceof t.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const i=n,a=t.getComputedStyle(o),s=t.getComputedStyle(i);r={left:-o.offsetLeft+(0,Yu.int)(s.paddingLeft)+(0,Yu.int)(a.marginLeft),top:-o.offsetTop+(0,Yu.int)(s.paddingTop)+(0,Yu.int)(a.marginTop),right:(0,Ku.innerWidth)(i)-(0,Ku.outerWidth)(o)-o.offsetLeft+(0,Yu.int)(s.paddingRight)-(0,Yu.int)(a.marginRight),bottom:(0,Ku.innerHeight)(i)-(0,Ku.outerHeight)(o)-o.offsetTop+(0,Yu.int)(s.paddingBottom)-(0,Yu.int)(a.marginBottom)}}(0,Yu.isNum)(r.right)&&(t=Math.min(t,r.right));(0,Yu.isNum)(r.bottom)&&(n=Math.min(n,r.bottom));(0,Yu.isNum)(r.left)&&(t=Math.max(t,r.left));(0,Yu.isNum)(r.top)&&(n=Math.max(n,r.top));return[t,n]},Xu.getControlPosition=function(e,t,n){const r="number"==typeof t?(0,Ku.getTouch)(e,t):null;if("number"==typeof t&&!r)return null;const o=qu(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Ku.offsetXYFromParent)(r||e,i,n.props.scale)},Xu.snapToGrid=function(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]};var Yu=Mu,Ku=Pu;function qu(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Gu={},Zu={};Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.default=function(){},Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.default=void 0;var Ju=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=ap(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(o),Qu=ip(ju),ep=ip(w),tp=Pu,np=Xu,rp=Mu,op=ip(Zu);function ip(e){return e&&e.__esModule?e:{default:e}}function ap(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(ap=function(e){return e?n:t})(e)}function sp(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const lp={start:"touchstart",move:"touchmove",stop:"touchend"},cp={start:"mousedown",move:"mousemove",stop:"mouseup"};let dp=cp,up=class extends Ju.Component{constructor(){super(...arguments),sp(this,"dragging",!1),sp(this,"lastX",NaN),sp(this,"lastY",NaN),sp(this,"touchIdentifier",null),sp(this,"mounted",!1),sp(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,tp.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,tp.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();const r=(0,tp.getTouchIdentifier)(e);this.touchIdentifier=r;const o=(0,np.getControlPosition)(e,r,this);if(null==o)return;const{x:i,y:a}=o,s=(0,np.createCoreData)(this,i,a);(0,op.default)("DraggableCore: handleDragStart: %j",s),(0,op.default)("calling",this.props.onStart);!1!==this.props.onStart(e,s)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,tp.addUserSelectStyles)(n),this.dragging=!0,this.lastX=i,this.lastY=a,(0,tp.addEvent)(n,dp.move,this.handleDrag),(0,tp.addEvent)(n,dp.stop,this.handleDragStop))}),sp(this,"handleDrag",e=>{const t=(0,np.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,np.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}const o=(0,np.createCoreData)(this,n,r);(0,op.default)("DraggableCore: handleDrag: %j",o);if(!1!==this.props.onDrag(e,o)&&!1!==this.mounted)this.lastX=n,this.lastY=r;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}}),sp(this,"handleDragStop",e=>{if(!this.dragging)return;const t=(0,np.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=(0,np.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}const o=(0,np.createCoreData)(this,n,r);if(!1===this.props.onStop(e,o)||!1===this.mounted)return!1;const i=this.findDOMNode();i&&this.props.enableUserSelectHack&&(0,tp.removeUserSelectStyles)(i.ownerDocument),(0,op.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,i&&((0,op.default)("DraggableCore: Removing handlers"),(0,tp.removeEvent)(i.ownerDocument,dp.move,this.handleDrag),(0,tp.removeEvent)(i.ownerDocument,dp.stop,this.handleDragStop))}),sp(this,"onMouseDown",e=>(dp=cp,this.handleDragStart(e))),sp(this,"onMouseUp",e=>(dp=cp,this.handleDragStop(e))),sp(this,"onTouchStart",e=>(dp=lp,this.handleDragStart(e))),sp(this,"onTouchEnd",e=>(dp=lp,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,tp.addEvent)(e,lp.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,tp.removeEvent)(t,cp.move,this.handleDrag),(0,tp.removeEvent)(t,lp.move,this.handleDrag),(0,tp.removeEvent)(t,cp.stop,this.handleDragStop),(0,tp.removeEvent)(t,lp.stop,this.handleDragStop),(0,tp.removeEvent)(e,lp.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,tp.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:ep.default.findDOMNode(this)}render(){return Ju.cloneElement(Ju.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Gu.default=up,sp(up,"displayName","DraggableCore"),sp(up,"propTypes",{allowAnyClick:Qu.default.bool,children:Qu.default.node.isRequired,disabled:Qu.default.bool,enableUserSelectHack:Qu.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Qu.default.arrayOf(Qu.default.number),handle:Qu.default.string,cancel:Qu.default.string,nodeRef:Qu.default.object,onStart:Qu.default.func,onDrag:Qu.default.func,onStop:Qu.default.func,onMouseDown:Qu.default.func,scale:Qu.default.number,className:rp.dontSetMe,style:rp.dontSetMe,transform:rp.dontSetMe}),sp(up,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(o),n=u(ju),r=u(w),i=u(Du),a=Pu,s=Xu,l=Mu,c=u(Gu),d=u(Zu);function u(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function f(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class g extends t.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:r}=t;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,d.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:{...n}})}constructor(e){super(e),f(this,"onDragStart",(e,t)=>{(0,d.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,s.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})}),f(this,"onDrag",(e,t)=>{if(!this.state.dragging)return!1;(0,d.default)("Draggable: onDrag: %j",t);const n=(0,s.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;const[o,i]=(0,s.getBoundPosition)(this,r.x,r.y);r.x=o,r.y=i,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)}),f(this,"onDragStop",(e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,s.createDraggableData)(this,t)))return!1;(0,d.default)("Draggable: onDragStop: %j",t);const n={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)}),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:r.default.findDOMNode(this)}render(){const{axis:e,bounds:n,children:r,defaultPosition:o,defaultClassName:l,defaultClassNameDragging:d,defaultClassNameDragged:u,position:p,positionOffset:f,scale:g,...m}=this.props;let b={},v=null;const w=!Boolean(p)||this.state.dragging,y=p||o,x={x:(0,s.canDragX)(this)&&w?this.state.x:y.x,y:(0,s.canDragY)(this)&&w?this.state.y:y.y};this.state.isElementSVG?v=(0,a.createSVGTransform)(x,f):b=(0,a.createCSSTransform)(x,f);const k=(0,i.default)(r.props.className||"",l,{[d]:this.state.dragging,[u]:this.state.dragged});return t.createElement(c.default,h({},m,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(r),{className:k,style:{...r.props.style,...b},transform:v}))}}e.default=g,f(g,"displayName","Draggable"),f(g,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),f(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Eu);const{default:pp,DraggableCore:hp}=Eu;Su.exports=pp,Ou.default=pp,Ou.DraggableCore=hp;var fp=function(){return fp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},fp.apply(this,arguments)},gp={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},mp={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},bp={width:"20px",height:"20px",position:"absolute",zIndex:1},vp={top:fp(fp({},gp),{top:"-5px"}),right:fp(fp({},mp),{left:void 0,right:"-5px"}),bottom:fp(fp({},gp),{top:void 0,bottom:"-5px"}),left:fp(fp({},mp),{left:"-5px"}),topRight:fp(fp({},bp),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:fp(fp({},bp),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:fp(fp({},bp),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:fp(fp({},bp),{left:"-10px",top:"-10px",cursor:"nw-resize"})},wp=m(function(t){var n=t.onResizeStart,r=t.direction,o=t.children,i=t.replaceStyles,a=t.className,s=c(function(e){n(e,r)},[n,r]),d=c(function(e){n(e,r)},[n,r]),u=l(function(){return fp(fp({position:"absolute",userSelect:"none"},vp[r]),null!=i?i:{})},[i,r]);return e("div",{className:a||void 0,style:u,onMouseDown:s,onTouchStart:d,children:o})}),yp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xp=function(){return xp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},xp.apply(this,arguments)},kp={width:"auto",height:"auto"},Np=function(e,t,n){return Math.max(Math.min(e,n),t)},Cp=function(e,t,n){var r=Math.round(e/t);return r*t+n*(r-1)},Op=function(e,t){return new RegExp(e,"i").test(t)},Sp=function(e){return Boolean(e.touches&&e.touches.length)},Ep=function(e,t,n){void 0===n&&(n=0);var r=t.reduce(function(n,r,o){return Math.abs(r-e)<Math.abs(t[n]-e)?o:n},0),o=Math.abs(t[r]-e);return 0===n||o<n?t[r]:e},jp=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},Rp=function(e,t,n,r){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return n*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return r*(Number(e.replace("vh",""))/100)}return e},zp=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Dp="__resizable_base__",Pp=function(t){function r(e){var n,r,o,i,a=t.call(this,e)||this;return a.ratio=1,a.resizable=null,a.parentLeft=0,a.parentTop=0,a.resizableLeft=0,a.resizableRight=0,a.resizableTop=0,a.resizableBottom=0,a.targetLeft=0,a.targetTop=0,a.delta={width:0,height:0},a.appendBase=function(){if(!a.resizable||!a.window)return null;var e=a.parentNode;if(!e)return null;var t=a.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(Dp):t.className+=Dp,e.appendChild(t),t},a.removeBase=function(e){var t=a.parentNode;t&&t.removeChild(e)},a.state={isResizing:!1,width:null!==(r=null===(n=a.propsSize)||void 0===n?void 0:n.width)&&void 0!==r?r:"auto",height:null!==(i=null===(o=a.propsSize)||void 0===o?void 0:o.height)&&void 0!==i?i:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},a.onResizeStart=a.onResizeStart.bind(a),a.onMouseMove=a.onMouseMove.bind(a),a.onMouseUp=a.onMouseUp.bind(a),a}return yp(r,t),Object.defineProperty(r.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||kp},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,o=this.resizable.style.position;"relative"!==o&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:r,this.resizable.style.position=o}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){var n;if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&(null===(n=e.propsSize[t])||void 0===n?void 0:n.toString().endsWith("%"))){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var r=e.getParentSize(),o=Number(e.state[t].toString().replace("px",""))/r[t]*100;return"".concat(o,"%")}return jp(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?jp(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?jp(t.height):n("height")}},enumerable:!1,configurable:!0}),r.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},r.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},r.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},r.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},r.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},r.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},r.prototype.calculateNewMaxFromBoundary=function(e,t){var n,r,o=this.props.boundsByDirection,i=this.state.direction,a=o&&Op("left",i),s=o&&Op("top",i);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=a?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),r=s?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,r=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),r=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(e=e&&e<n?e:n),r&&Number.isFinite(r)&&(t=t&&t<r?t:r),{maxWidth:e,maxHeight:t}},r.prototype.calculateNewSizeFromDirection=function(e,t){var n,r=this.props.scale||1,o=(n=this.props.resizeRatio||1,Array.isArray(n)?n:[n,n]),i=o[0],a=o[1],s=this.state,l=s.direction,c=s.original,d=this.props,u=d.lockAspectRatio,p=d.lockAspectRatioExtraHeight,h=d.lockAspectRatioExtraWidth,f=c.width,g=c.height,m=p||0,b=h||0;return Op("right",l)&&(f=c.width+(e-c.x)*i/r,u&&(g=(f-b)/this.ratio+m)),Op("left",l)&&(f=c.width-(e-c.x)*i/r,u&&(g=(f-b)/this.ratio+m)),Op("bottom",l)&&(g=c.height+(t-c.y)*a/r,u&&(f=(g-m)*this.ratio+b)),Op("top",l)&&(g=c.height-(t-c.y)*a/r,u&&(f=(g-m)*this.ratio+b)),{newWidth:f,newHeight:g}},r.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var o=this.props,i=o.lockAspectRatio,a=o.lockAspectRatioExtraHeight,s=o.lockAspectRatioExtraWidth,l=void 0===r.width?10:r.width,c=void 0===n.width||n.width<0?e:n.width,d=void 0===r.height?10:r.height,u=void 0===n.height||n.height<0?t:n.height,p=a||0,h=s||0;if(i){var f=(d-p)*this.ratio+h,g=(u-p)*this.ratio+h,m=(l-h)/this.ratio+p,b=(c-h)/this.ratio+p,v=Math.max(l,f),w=Math.min(c,g),y=Math.max(d,m),x=Math.min(u,b);e=Np(e,v,w),t=Np(t,y,x)}else e=Np(e,l,c),t=Np(t,d,u);return{newWidth:e,newHeight:t}},r.prototype.setBoundingClientRect=function(){var e=1/(this.props.scale||1);if("parent"===this.props.bounds){var t=this.parentNode;if(t){var n=t.getBoundingClientRect();this.parentLeft=n.left*e,this.parentTop=n.top*e}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var r=this.props.bounds.getBoundingClientRect();this.targetLeft=r.left*e,this.targetTop=r.top*e}if(this.resizable){var o=this.resizable.getBoundingClientRect(),i=o.left,a=o.top,s=o.right,l=o.bottom;this.resizableLeft=i*e,this.resizableRight=s*e,this.resizableTop=a*e,this.resizableBottom=l*e}},r.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n,r=0,o=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(r=e.nativeEvent.clientX,o=e.nativeEvent.clientY):e.nativeEvent&&Sp(e.nativeEvent)&&(r=e.nativeEvent.touches[0].clientX,o=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var i=this.window.getComputedStyle(this.resizable);if("auto"!==i.flexBasis){var a=this.parentNode;if(a){var s=this.window.getComputedStyle(a).flexDirection;this.flexDir=s.startsWith("row")?"row":"column",n=i.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:r,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:xp(xp({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},r.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&Sp(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var n=this.props,r=n.maxWidth,o=n.maxHeight,i=n.minWidth,a=n.minHeight,s=Sp(e)?e.touches[0].clientX:e.clientX,l=Sp(e)?e.touches[0].clientY:e.clientY,c=this.state,d=c.direction,u=c.original,p=c.width,h=c.height,f=this.getParentSize(),g=function(e,t,n,r,o,i,a){return r=Rp(r,e.width,t,n),o=Rp(o,e.height,t,n),i=Rp(i,e.width,t,n),a=Rp(a,e.height,t,n),{maxWidth:void 0===r?void 0:Number(r),maxHeight:void 0===o?void 0:Number(o),minWidth:void 0===i?void 0:Number(i),minHeight:void 0===a?void 0:Number(a)}}(f,this.window.innerWidth,this.window.innerHeight,r,o,i,a);r=g.maxWidth,o=g.maxHeight,i=g.minWidth,a=g.minHeight;var m=this.calculateNewSizeFromDirection(s,l),b=m.newHeight,v=m.newWidth,w=this.calculateNewMaxFromBoundary(r,o);this.props.snap&&this.props.snap.x&&(v=Ep(v,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(b=Ep(b,this.props.snap.y,this.props.snapGap));var x=this.calculateNewSizeFromAspectRatio(v,b,{width:w.maxWidth,height:w.maxHeight},{width:i,height:a});if(v=x.newWidth,b=x.newHeight,this.props.grid){var k=Cp(v,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),N=Cp(b,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),C=this.props.snapGap||0;v=0===C||Math.abs(k-v)<=C?k:v,b=0===C||Math.abs(N-b)<=C?N:b}var O={width:v-u.width,height:b-u.height};if(this.delta=O,p&&"string"==typeof p)if(p.endsWith("%")){var S=v/f.width*100;v="".concat(S,"%")}else if(p.endsWith("vw")){var E=v/this.window.innerWidth*100;v="".concat(E,"vw")}else if(p.endsWith("vh")){var j=v/this.window.innerHeight*100;v="".concat(j,"vh")}if(h&&"string"==typeof h)if(h.endsWith("%")){S=b/f.height*100;b="".concat(S,"%")}else if(h.endsWith("vw")){E=b/this.window.innerWidth*100;b="".concat(E,"vw")}else if(h.endsWith("vh")){j=b/this.window.innerHeight*100;b="".concat(j,"vh")}var R={width:this.createSizeForCssProperty(v,"width"),height:this.createSizeForCssProperty(b,"height")};"row"===this.flexDir?R.flexBasis=R.width:"column"===this.flexDir&&(R.flexBasis=R.height);var z=this.state.width!==R.width,D=this.state.height!==R.height,P=this.state.flexBasis!==R.flexBasis,M=z||D||P;M&&y(function(){t.setState(R)}),this.props.onResize&&M&&this.props.onResize(e,d,this.resizable,O)}},r.prototype.onMouseUp=function(e){var t,n,r=this.state,o=r.isResizing,i=r.direction;r.original,o&&this.resizable&&(this.props.onResizeStop&&this.props.onResizeStop(e,i,this.resizable,this.delta),this.props.size&&this.setState({width:null!==(t=this.props.size.width)&&void 0!==t?t:"auto",height:null!==(n=this.props.size.height)&&void 0!==n?n:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:xp(xp({},this.state.backgroundStyle),{cursor:"auto"})}))},r.prototype.updateSize=function(e){var t,n;this.setState({width:null!==(t=e.width)&&void 0!==t?t:"auto",height:null!==(n=e.height)&&void 0!==n?n:"auto"})},r.prototype.renderResizer=function(){var t=this,n=this.props,r=n.enable,o=n.handleStyles,i=n.handleClasses,a=n.handleWrapperStyle,s=n.handleWrapperClass,l=n.handleComponent;if(!r)return null;var c=Object.keys(r).map(function(n){return!1!==r[n]?e(wp,{direction:n,onResizeStart:t.onResizeStart,replaceStyles:o&&o[n],className:i&&i[n],children:l&&l[n]?l[n]:null},n):null});return e("div",{className:s,style:a,children:c})},r.prototype.render=function(){var t=this,r=Object.keys(this.props).reduce(function(e,n){return-1!==zp.indexOf(n)||(e[n]=t.props[n]),e},{}),o=xp(xp(xp({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return n(i,xp({style:o,className:this.props.className},r,{ref:function(e){e&&(t.resizable=e)},children:[this.state.isResizing&&e("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},r.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},r}(b),Mp=function(e,t){return Mp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Mp(e,t)};var Tp=function(){return Tp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Tp.apply(this,arguments)};var _p={width:"auto",height:"auto",display:"inline-block",position:"absolute",top:0,left:0},Ip=function(e){function t(t){var n=e.call(this,t)||this;return n.resizingPosition={x:0,y:0},n.offsetFromParent={left:0,top:0},n.resizableElement={current:null},n.originalPosition={x:0,y:0},n.state={resizing:!1,bounds:{top:0,right:0,bottom:0,left:0},maxWidth:t.maxWidth,maxHeight:t.maxHeight},n.onResizeStart=n.onResizeStart.bind(n),n.onResize=n.onResize.bind(n),n.onResizeStop=n.onResizeStop.bind(n),n.onDragStart=n.onDragStart.bind(n),n.onDrag=n.onDrag.bind(n),n.onDragStop=n.onDragStop.bind(n),n.getMaxSizesFromProps=n.getMaxSizesFromProps.bind(n),n}return function(e,t){function n(){this.constructor=e}Mp(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.updateOffsetFromParent();var e=this.offsetFromParent,t=e.left,n=e.top,r=this.getDraggablePosition(),o=r.x,i=r.y;this.draggable.setState({x:o-t,y:i-n}),this.forceUpdate()},t.prototype.getDraggablePosition=function(){var e=this.draggable.state;return{x:e.x,y:e.y}},t.prototype.getParent=function(){return this.resizable&&this.resizable.parentNode},t.prototype.getParentSize=function(){return this.resizable.getParentSize()},t.prototype.getMaxSizesFromProps=function(){return{maxWidth:void 0===this.props.maxWidth?Number.MAX_SAFE_INTEGER:this.props.maxWidth,maxHeight:void 0===this.props.maxHeight?Number.MAX_SAFE_INTEGER:this.props.maxHeight}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(e){var t=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/t;case"body":return document.body.offsetHeight/t;default:return e.offsetHeight}},t.prototype.getOffsetWidth=function(e){var t=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/t;case"body":return document.body.offsetWidth/t;default:return e.offsetWidth}},t.prototype.onDragStart=function(e,t){this.props.onDragStart&&this.props.onDragStart(e,t);var n=this.getDraggablePosition();if(this.originalPosition=n,this.props.bounds){var r,o=this.getParent(),i=this.props.scale;if("parent"===this.props.bounds)r=o;else{if("body"===this.props.bounds){var a=o.getBoundingClientRect(),s=a.left,l=a.top,c=document.body.getBoundingClientRect(),d=-(s-o.offsetLeft*i-c.left)/i,u=-(l-o.offsetTop*i-c.top)/i,p=(document.body.offsetWidth-this.resizable.size.width*i)/i+d,h=(document.body.offsetHeight-this.resizable.size.height*i)/i+u;return this.setState({bounds:{top:u,right:p,bottom:h,left:d}})}if("window"===this.props.bounds){if(!this.resizable)return;var f=o.getBoundingClientRect(),g=f.left,m=f.top,b=-(g-o.offsetLeft*i)/i,v=-(m-o.offsetTop*i)/i;p=(window.innerWidth-this.resizable.size.width*i)/i+b,h=(window.innerHeight-this.resizable.size.height*i)/i+v;return this.setState({bounds:{top:v,right:p,bottom:h,left:b}})}"string"==typeof this.props.bounds?r=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(r=this.props.bounds)}if(r instanceof HTMLElement&&o instanceof HTMLElement){var w=r.getBoundingClientRect(),y=w.left,x=w.top,k=o.getBoundingClientRect(),N=(y-k.left)/i,C=x-k.top;if(this.resizable){this.updateOffsetFromParent();var O=this.offsetFromParent;this.setState({bounds:{top:C-O.top,right:N+(r.offsetWidth-this.resizable.size.width)-O.left/i,bottom:C+(r.offsetHeight-this.resizable.size.height)-O.top,left:N-O.left/i}})}}}},t.prototype.onDrag=function(e,t){if(this.props.onDrag){var n=this.offsetFromParent,r=n.left,o=n.top;return this.props.dragAxis&&"both"!==this.props.dragAxis?"x"===this.props.dragAxis?this.props.onDrag(e,Tp(Tp({},t),{x:t.x+r,y:this.originalPosition.y+o,deltaY:0})):"y"===this.props.dragAxis?this.props.onDrag(e,Tp(Tp({},t),{x:this.originalPosition.x+r,y:t.y+o,deltaX:0})):void 0:this.props.onDrag(e,Tp(Tp({},t),{x:t.x+r,y:t.y+o}))}},t.prototype.onDragStop=function(e,t){if(this.props.onDragStop){var n=this.offsetFromParent,r=n.left,o=n.top;return this.props.dragAxis&&"both"!==this.props.dragAxis?"x"===this.props.dragAxis?this.props.onDragStop(e,Tp(Tp({},t),{x:t.x+r,y:this.originalPosition.y+o,deltaY:0})):"y"===this.props.dragAxis?this.props.onDragStop(e,Tp(Tp({},t),{x:this.originalPosition.x+r,y:t.y+o,deltaX:0})):void 0:this.props.onDragStop(e,Tp(Tp({},t),{x:t.x+r,y:t.y+o}))}},t.prototype.onResizeStart=function(e,t,n){e.stopPropagation(),this.setState({resizing:!0});var r=this.props.scale,o=this.offsetFromParent,i=this.getDraggablePosition();if(this.resizingPosition={x:i.x+o.left,y:i.y+o.top},this.originalPosition=i,this.props.bounds){var a=this.getParent(),s=void 0;"parent"===this.props.bounds?s=a:"body"===this.props.bounds?s=document.body:"window"===this.props.bounds?s=window:"string"==typeof this.props.bounds?s=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(s=this.props.bounds);var l=this.getSelfElement();if(l instanceof Element&&(s instanceof HTMLElement||s===window)&&a instanceof HTMLElement){var c=this.getMaxSizesFromProps(),d=c.maxWidth,u=c.maxHeight,p=this.getParentSize();if(d&&"string"==typeof d)if(d.endsWith("%")){var h=Number(d.replace("%",""))/100;d=p.width*h}else d.endsWith("px")&&(d=Number(d.replace("px","")));if(u&&"string"==typeof u)if(u.endsWith("%")){h=Number(u.replace("%",""))/100;u=p.height*h}else u.endsWith("px")&&(u=Number(u.replace("px","")));var f=l.getBoundingClientRect(),g=f.left,m=f.top,b="window"===this.props.bounds?{left:0,top:0}:s.getBoundingClientRect(),v=b.left,w=b.top,y=this.getOffsetWidth(s),x=this.getOffsetHeight(s),k=t.toLowerCase().endsWith("left"),N=t.toLowerCase().endsWith("right"),C=t.startsWith("top"),O=t.startsWith("bottom");if((k||C)&&this.resizable){var S=(g-v)/r+this.resizable.size.width;this.setState({maxWidth:S>Number(d)?d:S})}if(N||this.props.lockAspectRatio&&!k&&!C){S=y+(v-g)/r;this.setState({maxWidth:S>Number(d)?d:S})}if((C||k)&&this.resizable){S=(m-w)/r+this.resizable.size.height;this.setState({maxHeight:S>Number(u)?u:S})}if(O||this.props.lockAspectRatio&&!C&&!k){S=x+(w-m)/r;this.setState({maxHeight:S>Number(u)?u:S})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(e,t,n)},t.prototype.onResize=function(e,t,n,r){var o=this,i={x:this.originalPosition.x,y:this.originalPosition.y},a=-r.width,s=-r.height;["top","left","topLeft","bottomLeft","topRight"].includes(t)&&("bottomLeft"===t?i.x+=a:("topRight"===t||(i.x+=a),i.y+=s));var l=this.draggable.state;i.x===l.x&&i.y===l.y||y(function(){o.draggable.setState(i)}),this.updateOffsetFromParent();var c=this.offsetFromParent,d=this.getDraggablePosition().x+c.left,u=this.getDraggablePosition().y+c.top;this.resizingPosition={x:d,y:u},this.props.onResize&&this.props.onResize(e,t,n,r,{x:d,y:u})},t.prototype.onResizeStop=function(e,t,n,r){this.setState({resizing:!1});var o=this.getMaxSizesFromProps(),i=o.maxWidth,a=o.maxHeight;this.setState({maxWidth:i,maxHeight:a}),this.props.onResizeStop&&this.props.onResizeStop(e,t,n,r,this.resizingPosition)},t.prototype.updateSize=function(e){this.resizable&&this.resizable.updateSize({width:e.width,height:e.height})},t.prototype.updatePosition=function(e){this.draggable.setState(e)},t.prototype.updateOffsetFromParent=function(){var e=this.props.scale,t=this.getParent(),n=this.getSelfElement();if(!t||null===n)return{top:0,left:0};var r=t.getBoundingClientRect(),o=r.left,i=r.top,a=n.getBoundingClientRect(),s=this.getDraggablePosition(),l=t.scrollLeft,c=t.scrollTop;this.offsetFromParent={left:a.left-o+l-s.x*e,top:a.top-i+c-s.y*e}},t.prototype.render=function(){var e=this,t=this.props,n=t.disableDragging,r=t.style,o=t.dragHandleClassName,i=t.position,s=t.onMouseDown,l=t.onMouseUp,c=t.dragAxis,d=t.dragGrid,u=t.bounds,p=t.enableUserSelectHack,h=t.cancel,f=t.children;t.onResizeStart,t.onResize,t.onResizeStop,t.onDragStart,t.onDrag,t.onDragStop;var g=t.resizeHandleStyles,m=t.resizeHandleClasses,b=t.resizeHandleComponent,v=t.enableResizing,w=t.resizeGrid,y=t.resizeHandleWrapperClass,x=t.resizeHandleWrapperStyle,k=t.scale,N=t.allowAnyClick,C=t.dragPositionOffset,O=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick","dragPositionOffset"]),S=this.props.default?Tp({},this.props.default):void 0;delete O.default;var E,j=n||o?{cursor:"auto"}:{cursor:"move"},R=Tp(Tp(Tp({},_p),j),r),z=this.offsetFromParent,D=z.left,P=z.top;i&&(E={x:i.x-D,y:i.y-P});var M,T=this.state.resizing?void 0:E,_=this.state.resizing?"both":c;return a(Ou,{ref:function(t){t&&(e.draggable=t)},handle:o?".".concat(o):void 0,defaultPosition:S,onMouseDown:s,onMouseUp:l,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:_,disabled:n,grid:d,bounds:u?this.state.bounds:void 0,position:T,enableUserSelectHack:p,cancel:h,scale:k,allowAnyClick:N,nodeRef:this.resizableElement,positionOffset:C},a(Pp,Tp({},O,{ref:function(t){t&&(e.resizable=t,e.resizableElement.current=t.resizable)},defaultSize:S,size:this.props.size,enable:"boolean"==typeof v?(M=v,{bottom:M,bottomLeft:M,bottomRight:M,left:M,right:M,top:M,topLeft:M,topRight:M}):v,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:R,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:w,handleWrapperClass:y,handleWrapperStyle:x,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:g,handleClasses:m,handleComponent:b,scale:this.props.scale}),f))},t.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(b);const Ap={...r},Lp=Ap.useInsertionEffect||(e=>e());var Hp="undefined"!=typeof document?g:p;let Fp=!1,Wp=0;const Bp=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Wp++;const Up=Ap.useId||function(){const[e,t]=r.useState(()=>Fp?Bp():void 0);return Hp(()=>{null==e&&t(Bp())},[]),r.useEffect(()=>{Fp=!0},[]),e};const Vp=r.createContext(null),$p=r.createContext(null);function Xp(e){const{open:t=!1,onOpenChange:n,elements:o}=e,i=Up(),a=r.useRef({}),[s]=r.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}()),l=null!=((null==(c=r.useContext(Vp))?void 0:c.id)||null);var c;const[d,u]=r.useState(o.reference),p=function(e){const t=r.useRef(()=>{});return Lp(()=>{t.current=e}),r.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}((e,t,r)=>{a.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)}),h=r.useMemo(()=>({setPositionReference:u}),[]),f=r.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return r.useMemo(()=>({dataRef:a,open:t,onOpenChange:p,elements:f,events:s,floatingId:i,refs:h}),[t,p,f,s,i,h])}function Yp(e){void 0===e&&(e={});const{nodeId:t}=e,n=Xp({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,i=o.elements,[a,s]=r.useState(null),[l,c]=r.useState(null),d=(null==i?void 0:i.domReference)||a,u=r.useRef(null),p=r.useContext($p);Hp(()=>{d&&(u.current=d)},[d]);const h=Pa({...e,elements:{...i,...l&&{reference:l}}}),f=r.useCallback(e=>{const t=Pi(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),h.refs.setReference(t)},[h.refs]),g=r.useCallback(e=>{(Pi(e)||null===e)&&(u.current=e,s(e)),(Pi(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!Pi(e))&&h.refs.setReference(e)},[h.refs]),m=r.useMemo(()=>({...h.refs,setReference:g,setPositionReference:f,domReference:u}),[h.refs,g,f]),b=r.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),v=r.useMemo(()=>({...h,...o,refs:m,elements:b,nodeId:t}),[h,m,b,t,o]);return Hp(()=>{o.dataRef.current.floatingContext=v;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),r.useMemo(()=>({...h,context:v,refs:m,elements:b}),[h,m,b,v])}var Kp=Symbol.for("react.lazy"),qp=r[" use ".trim().toString()];function Gp(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===Kp&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function Zp(e){const t=r.forwardRef((e,t)=>{let{children:n,...o}=e;if(Gp(n)&&"function"==typeof qp&&(n=qp(n._payload)),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),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(i.ref=t?de(t,e):e),r.cloneElement(n,i)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jp=Symbol("radix.slottable");function Qp(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Jp}var eh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const o=function(t){const n=Zp(t),o=r.forwardRef((t,o)=>{let{children:i,...a}=t;Gp(i)&&"function"==typeof qp&&(i=qp(i._payload));const s=r.Children.toArray(i),l=s.find(Qp);if(l){const t=l.props.children,i=s.map(e=>e===l?r.Children.count(t)>1?r.Children.only(null):r.isValidElement(t)?t.props.children:null:e);return e(n,{...a,ref:o,children:r.isValidElement(t)?r.cloneElement(t,void 0,i):null})}return e(n,{...a,ref:o,children:i})});return o.displayName=`${t}.Slot`,o}(`Primitive.${n}`),i=r.forwardRef((t,r)=>{const{asChild:i,...a}=t,s=i?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e(s,{...a,ref:r})});return i.displayName=`Primitive.${n}`,{...t,[n]:i}},{}),th=r.forwardRef((t,n)=>e(eh.label,{...t,ref:n,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));th.displayName="Label";var nh=th;const rh=so("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),oh=r.forwardRef((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e(nh,Object.assign({ref:n,className:mr(rh(),r)},o))});function ih(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])}oh.displayName=nh.displayName;var ah=[" ","Enter","ArrowUp","ArrowDown"],sh=[" ","Enter"],lh="Select",[ch,dh,uh]=me(lh),[ph,hh]=se(lh,[uh,Ya]),fh=Ya(),[gh,mh]=ph(lh),[bh,vh]=ph(lh),wh=t=>{const{__scopeSelect:o,children:i,open:a,defaultOpen:s,onOpenChange:l,value:c,defaultValue:d,onValueChange:u,dir:p,name:h,autoComplete:f,disabled:g,required:m,form:b}=t,v=fh(o),[w,y]=r.useState(null),[x,k]=r.useState(null),[N,C]=r.useState(!1),O=Ve(p),[S,E]=ye({prop:a,defaultProp:s??!1,onChange:l,caller:lh}),[j,R]=ye({prop:c,defaultProp:d,onChange:u,caller:lh}),z=r.useRef(null),D=!w||(b||!!w.closest("form")),[P,M]=r.useState(new Set),T=Array.from(P).map(e=>e.props.value).join(";");return e(cs,{...v,children:n(gh,{required:m,scope:o,trigger:w,onTriggerChange:y,valueNode:x,onValueNodeChange:k,valueNodeHasChildren:N,onValueNodeHasChildrenChange:C,contentId:Ee(),value:j,onValueChange:R,open:S,onOpenChange:E,dir:O,triggerPointerDownPosRef:z,disabled:g,children:[e(ch.Provider,{scope:o,children:e(bh,{scope:t.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{M(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:i})}),D?n(of,{"aria-hidden":!0,required:m,tabIndex:-1,name:h,autoComplete:f,value:j,onChange:e=>R(e.target.value),disabled:g,form:b,children:[void 0===j?e("option",{value:""}):null,Array.from(P)]},T):null]})})};wh.displayName=lh;var yh="SelectTrigger",xh=r.forwardRef((t,n)=>{const{__scopeSelect:o,disabled:i=!1,...a}=t,s=fh(o),l=mh(yh,o),c=l.disabled||i,d=ue(n,l.onTriggerChange),u=dh(o),p=r.useRef("touch"),[h,f,g]=sf(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),r=lf(t,e,n);void 0!==r&&l.onValueChange(r.value)}),m=e=>{c||(l.onOpenChange(!0),g()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e(ds,{asChild:!0,...s,children:e(xe.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":af(l.value)?"":void 0,...a,ref:d,onClick:be(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&m(e)}),onPointerDown:be(a.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&&(m(e),e.preventDefault())}),onKeyDown:be(a.onKeyDown,e=>{const t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),t&&" "===e.key||ah.includes(e.key)&&(m(),e.preventDefault())})})})});xh.displayName=yh;var kh="SelectValue",Nh=r.forwardRef((n,r)=>{const{__scopeSelect:o,className:i,style:a,children:s,placeholder:l="",...c}=n,d=mh(kh,o),{onValueNodeHasChildrenChange:u}=d,p=void 0!==s,h=ue(r,d.onValueNodeChange);return ve(()=>{u(p)},[u,p]),e(xe.span,{...c,ref:h,style:{pointerEvents:"none"},children:af(d.value)?e(t,{children:l}):s})});Nh.displayName=kh;var Ch=r.forwardRef((t,n)=>{const{__scopeSelect:r,children:o,...i}=t;return e(xe.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})});Ch.displayName="SelectIcon";var Oh=t=>e(hs,{asChild:!0,...t});Oh.displayName="SelectPortal";var Sh="SelectContent",Eh=r.forwardRef((t,n)=>{const o=mh(Sh,t.__scopeSelect),[i,a]=r.useState();if(ve(()=>{a(new DocumentFragment)},[]),!o.open){const n=i;return n?v.createPortal(e(Rh,{scope:t.__scopeSelect,children:e(ch.Slot,{scope:t.__scopeSelect,children:e("div",{children:t.children})})}),n):null}return e(Ph,{...t,ref:n})});Eh.displayName=Sh;var jh=10,[Rh,zh]=ph(Sh),Dh=pe("SelectContent.RemoveScroll"),Ph=r.forwardRef((t,n)=>{const{__scopeSelect:o,position:i="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:g,sticky:m,hideWhenDetached:b,avoidCollisions:v,...w}=t,y=mh(Sh,o),[x,k]=r.useState(null),[N,C]=r.useState(null),O=ue(n,e=>k(e)),[S,E]=r.useState(null),[j,R]=r.useState(null),z=dh(o),[D,P]=r.useState(!1),M=r.useRef(!1);r.useEffect(()=>{if(x)return ys(x)},[x]),Ao();const T=r.useCallback(e=>{const[t,...n]=z().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&N&&(N.scrollTop=0),n===r&&N&&(N.scrollTop=N.scrollHeight),n?.focus(),document.activeElement!==o)return}},[z,N]),_=r.useCallback(()=>T([S,x]),[T,S,x]);r.useEffect(()=>{D&&_()},[D,_]);const{onOpenChange:I,triggerPointerDownPosRef:A}=y;r.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(A.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(A.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||I(!1),document.removeEventListener("pointermove",t),A.current=null};return null!==A.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,I,A]),r.useEffect(()=>{const e=()=>I(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);const[L,H]=sf(e=>{const t=z().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=lf(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),F=r.useCallback((e,t,n)=>{const r=!M.current&&!n;(void 0!==y.value&&y.value===t||r)&&(E(e),r&&(M.current=!0))},[y.value]),W=r.useCallback(()=>x?.focus(),[x]),B=r.useCallback((e,t,n)=>{const r=!M.current&&!n;(void 0!==y.value&&y.value===t||r)&&R(e)},[y.value]),U="popper"===i?Th:Mh,V=U===Th?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:g,sticky:m,hideWhenDetached:b,avoidCollisions:v}:{};return e(Rh,{scope:o,content:x,viewport:N,onViewportChange:C,itemRefCallback:F,selectedItem:S,onItemLeave:W,itemTextRefCallback:B,focusSelectedItem:_,selectedItemText:j,position:i,isPositioned:D,searchRef:L,children:e(al,{as:Dh,allowPinchZoom:!0,children:e(Bo,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:be(a,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e(Mo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:e(U,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:e=>e.preventDefault(),...w,...V,onPlaced:()=>P(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:be(w.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||H(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=z().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,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>T(t)),e.preventDefault()}})})})})})})});Ph.displayName="SelectContentImpl";var Mh=r.forwardRef((t,n)=>{const{__scopeSelect:o,onPlaced:i,...a}=t,s=mh(Sh,o),l=zh(Sh,o),[c,d]=r.useState(null),[u,p]=r.useState(null),h=ue(n,e=>p(e)),f=dh(o),g=r.useRef(!1),m=r.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:w,focusSelectedItem:y}=l,x=r.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&b&&v&&w){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==s.dir){const o=r.left-t.left,i=n.left-o,a=e.left-i,s=e.width+a,l=Math.max(s,t.width),d=window.innerWidth-jh,u=Oc(i,[jh,Math.max(jh,d-l)]);c.style.minWidth=s+"px",c.style.left=u+"px"}else{const o=t.right-r.right,i=window.innerWidth-n.right-o,a=window.innerWidth-e.right-i,s=e.width+a,l=Math.max(s,t.width),d=window.innerWidth-jh,u=Oc(i,[jh,Math.max(jh,d-l)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const o=f(),a=window.innerHeight-2*jh,l=b.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),m=parseInt(d.borderBottomWidth,10),y=p+h+l+parseInt(d.paddingBottom,10)+m,x=Math.min(5*v.offsetHeight,y),k=window.getComputedStyle(b),N=parseInt(k.paddingTop,10),C=parseInt(k.paddingBottom,10),O=e.top+e.height/2-jh,S=a-O,E=v.offsetHeight/2,j=p+h+(v.offsetTop+E),R=y-j;if(j<=O){const e=o.length>0&&v===o[o.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-b.offsetTop-b.offsetHeight,n=j+Math.max(S,E+(e?C:0)+t+m);c.style.height=n+"px"}else{const e=o.length>0&&v===o[0].ref.current;c.style.top="0px";const t=Math.max(O,p+b.offsetTop+(e?N:0)+E)+R;c.style.height=t+"px",b.scrollTop=j-O+b.offsetTop}c.style.margin=`${jh}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=a+"px",i?.(),requestAnimationFrame(()=>g.current=!0)}},[f,s.trigger,s.valueNode,c,u,b,v,w,s.dir,i]);ve(()=>x(),[x]);const[k,N]=r.useState();ve(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const C=r.useCallback(e=>{e&&!0===m.current&&(x(),y?.(),m.current=!1)},[x,y]);return e(_h,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:C,children:e("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:e(xe.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});Mh.displayName="SelectItemAlignedPosition";var Th=r.forwardRef((t,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=jh,...a}=t,s=fh(r);return e(us,{...s,...a,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...a.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)"}})});Th.displayName="SelectPopperPosition";var[_h,Ih]=ph(Sh,{}),Ah="SelectViewport",Lh=r.forwardRef((o,i)=>{const{__scopeSelect:a,nonce:s,...l}=o,c=zh(Ah,a),d=Ih(Ah,a),u=ue(i,c.onViewportChange),p=r.useRef(0);return n(t,{children:[e("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:s}),e(ch.Slot,{scope:a,children:e(xe.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:be(l.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=d;if(r?.current&&n){const e=Math.abs(p.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*jh,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),a=Math.max(o,i);if(a<r){const o=a+e,i=Math.min(r,o),s=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});Lh.displayName=Ah;var Hh="SelectGroup",[Fh,Wh]=ph(Hh),Bh=r.forwardRef((t,n)=>{const{__scopeSelect:r,...o}=t,i=Ee();return e(Fh,{scope:r,id:i,children:e(xe.div,{role:"group","aria-labelledby":i,...o,ref:n})})});Bh.displayName=Hh;var Uh="SelectLabel";r.forwardRef((t,n)=>{const{__scopeSelect:r,...o}=t,i=Wh(Uh,r);return e(xe.div,{id:i.id,...o,ref:n})}).displayName=Uh;var Vh="SelectItem",[$h,Xh]=ph(Vh),Yh=r.forwardRef((t,n)=>{const{__scopeSelect:o,value:i,disabled:a=!1,textValue:s,...l}=t,c=mh(Vh,o),d=zh(Vh,o),u=c.value===i,[p,h]=r.useState(s??""),[f,g]=r.useState(!1),m=ue(n,e=>d.itemRefCallback?.(e,i,a)),b=Ee(),v=r.useRef("touch"),w=()=>{a||(c.onValueChange(i),c.onOpenChange(!1))};if(""===i)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 e($h,{scope:o,value:i,disabled:a,textId:b,isSelected:u,onItemTextChange:r.useCallback(e=>{h(t=>t||(e?.textContent??"").trim())},[]),children:e(ch.ItemSlot,{scope:o,value:i,disabled:a,textValue:p,children:e(xe.div,{role:"option","aria-labelledby":b,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:m,onFocus:be(l.onFocus,()=>g(!0)),onBlur:be(l.onBlur,()=>g(!1)),onClick:be(l.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:be(l.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:be(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:be(l.onPointerMove,e=>{v.current=e.pointerType,a?d.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:be(l.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(sh.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});Yh.displayName=Vh;var Kh="SelectItemText",qh=r.forwardRef((o,i)=>{const{__scopeSelect:a,className:s,style:l,...c}=o,d=mh(Kh,a),u=zh(Kh,a),p=Xh(Kh,a),h=vh(Kh,a),[f,g]=r.useState(null),m=ue(i,e=>g(e),p.onItemTextChange,e=>u.itemTextRefCallback?.(e,p.value,p.disabled)),b=f?.textContent,w=r.useMemo(()=>e("option",{value:p.value,disabled:p.disabled,children:b},p.value),[p.disabled,p.value,b]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=h;return ve(()=>(y(w),()=>x(w)),[y,x,w]),n(t,{children:[e(xe.span,{id:p.textId,...c,ref:m}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren?v.createPortal(c.children,d.valueNode):null]})});qh.displayName=Kh;var Gh="SelectItemIndicator",Zh=r.forwardRef((t,n)=>{const{__scopeSelect:r,...o}=t;return Xh(Gh,r).isSelected?e(xe.span,{"aria-hidden":!0,...o,ref:n}):null});Zh.displayName=Gh;var Jh="SelectScrollUpButton",Qh=r.forwardRef((t,n)=>{const o=zh(Jh,t.__scopeSelect),i=Ih(Jh,t.__scopeSelect),[a,s]=r.useState(!1),l=ue(n,i.onScrollButtonChange);return ve(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?e(nf,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Qh.displayName=Jh;var ef="SelectScrollDownButton",tf=r.forwardRef((t,n)=>{const o=zh(ef,t.__scopeSelect),i=Ih(ef,t.__scopeSelect),[a,s]=r.useState(!1),l=ue(n,i.onScrollButtonChange);return ve(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?e(nf,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});tf.displayName=ef;var nf=r.forwardRef((t,n)=>{const{__scopeSelect:o,onAutoScroll:i,...a}=t,s=zh("SelectScrollButton",o),l=r.useRef(null),c=dh(o),d=r.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return r.useEffect(()=>()=>d(),[d]),ve(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),e(xe.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:be(a.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(i,50))}),onPointerMove:be(a.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(i,50))}),onPointerLeave:be(a.onPointerLeave,()=>{d()})})});r.forwardRef((t,n)=>{const{__scopeSelect:r,...o}=t;return e(xe.div,{"aria-hidden":!0,...o,ref:n})}).displayName="SelectSeparator";var rf="SelectArrow";r.forwardRef((t,n)=>{const{__scopeSelect:r,...o}=t,i=fh(r),a=mh(rf,r),s=zh(rf,r);return a.open&&"popper"===s.position?e(ps,{...i,...o,ref:n}):null}).displayName=rf;var of=r.forwardRef(({__scopeSelect:t,value:n,...o},i)=>{const a=r.useRef(null),s=ue(i,a),l=ih(n);return r.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[l,n]),e(xe.select,{...o,style:{...Ed,...o.style},ref:s,defaultValue:n})});function af(e){return""===e||void 0===e}function sf(e){const t=Eo(e),n=r.useRef(""),o=r.useRef(0),i=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]),a=r.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,i,a]}function lf(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=(a=e,s=Math.max(o,0),a.map((e,t)=>a[(s+t)%a.length]));var a,s;1===r.length&&(i=i.filter(e=>e!==n));const l=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}of.displayName="SelectBubbleInput";var cf=wh,df=xh,uf=Nh,pf=Ch,hf=Oh,ff=Eh,gf=Lh,mf=Bh,bf=Yh,vf=qh,wf=Zh,yf=Qh,xf=tf;const kf=t=>{var n=ie(t,[]);return e(cf,Object.assign({"data-slot":"select"},n))},Nf=t=>{var n=ie(t,[]);return e(mf,Object.assign({"data-slot":"select-group"},n))},Cf=t=>{var n=ie(t,[]);return e(uf,Object.assign({"data-slot":"select-value"},n))},Of=t=>{var{className:r,size:o="default",children:i}=t,a=ie(t,["className","size","children"]);return n(df,Object.assign({"data-slot":"select-trigger","data-size":o,className:mr("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r)},a,{children:[i,e(pf,Object.assign({asChild:!0},{children:e(Ht,{className:"size-4 opacity-50"})}))]}))},Sf=t=>{var{className:n}=t,r=ie(t,["className"]);return e(yf,Object.assign({"data-slot":"select-scroll-up-button",className:mr("flex cursor-default items-center justify-center py-1",n)},r,{children:e(Wt,{className:"size-4"})}))},Ef=t=>{var{className:n}=t,r=ie(t,["className"]);return e(xf,Object.assign({"data-slot":"select-scroll-down-button",className:mr("flex cursor-default items-center justify-center py-1",n)},r,{children:e(Ht,{className:"size-4"})}))},jf=t=>{var{className:r,children:o,position:i="item-aligned",align:a="center"}=t,s=ie(t,["className","children","position","align"]);return e(hf,{children:n(ff,Object.assign({"data-slot":"select-content",className:mr("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:i,align:a},s,{children:[e(Sf,{}),e(gf,Object.assign({className:mr("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1")},{children:o})),e(Ef,{})]}))})},Rf=t=>{var{className:r,children:o}=t,i=ie(t,["className","children"]);return n(bf,Object.assign({"data-slot":"select-item",className:mr("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",r)},i,{children:[e("span",Object.assign({"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center"},{children:e(wf,{children:e(Lt,{className:"size-4"})})})),e(vf,{children:o})]}))};var zf=["PageUp","PageDown"],Df=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Pf={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Mf="Slider",[Tf,_f,If]=me(Mf),[Af,Lf]=se(Mf,[If]),[Hf,Ff]=Af(Mf),Wf=r.forwardRef((t,n)=>{const{name:o,min:i=0,max:a=100,step:s=1,orientation:l="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:u=[i],value:p,onValueChange:h=()=>{},onValueCommit:f=()=>{},inverted:g=!1,form:m,...b}=t,v=r.useRef(new Set),w=r.useRef(0),y="horizontal"===l?Vf:$f,[x=[],k]=ye({prop:p,defaultProp:u,onChange:e=>{const t=[...v.current];t[w.current]?.focus(),h(e)}}),N=r.useRef(x);function C(e,t,{commit:n}={commit:!1}){const r=function(e){return(String(e).split(".")[1]||"").length}(s),o=function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}(Math.round((e-i)/s)*s+i,r),l=Oc(o,[i,a]);k((e=[])=>{const r=function(e=[],t,n){const r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}(e,l,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}(r,d*s)){w.current=r.indexOf(l);const t=String(r)!==String(e);return t&&n&&f(r),t?r:e}return e})}return e(Hf,{scope:t.__scopeSlider,name:o,disabled:c,min:i,max:a,valueIndexToChangeRef:w,thumbs:v.current,values:x,orientation:l,form:m,children:e(Tf.Provider,{scope:t.__scopeSlider,children:e(Tf.Slot,{scope:t.__scopeSlider,children:e(y,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:n,onPointerDown:be(b.onPointerDown,()=>{c||(N.current=x)}),min:i,max:a,inverted:g,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)),r=Math.min(...n);return n.indexOf(r)}(x,e);C(e,t)},onSlideMove:c?void 0:function(e){C(e,w.current)},onSlideEnd:c?void 0:function(){const e=N.current[w.current];x[w.current]!==e&&f(x)},onHomeKeyDown:()=>!c&&C(i,0,{commit:!0}),onEndKeyDown:()=>!c&&C(a,x.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!c){const n=zf.includes(e.key)||e.shiftKey&&Df.includes(e.key)?10:1,r=w.current;C(x[r]+s*n*t,r,{commit:!0})}}})})})})});Wf.displayName=Mf;var[Bf,Uf]=Af(Mf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Vf=r.forwardRef((t,n)=>{const{min:o,max:i,dir:a,inverted:s,onSlideStart:l,onSlideMove:c,onSlideEnd:d,onStepKeyDown:u,...p}=t,[h,f]=r.useState(null),g=ue(n,e=>f(e)),m=r.useRef(void 0),b=Ve(a),v="ltr"===b,w=v&&!s||!v&&s;function y(e){const t=m.current||h.getBoundingClientRect(),n=ng([0,t.width],w?[o,i]:[i,o]);return m.current=t,n(e-t.left)}return e(Bf,{scope:t.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:e(Xf,{dir:b,"data-orientation":"horizontal",...p,ref:g,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{const t=y(e.clientX);l?.(t)},onSlideMove:e=>{const t=y(e.clientX);c?.(t)},onSlideEnd:()=>{m.current=void 0,d?.()},onStepKeyDown:e=>{const t=Pf[w?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),$f=r.forwardRef((t,n)=>{const{min:o,max:i,inverted:a,onSlideStart:s,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...u}=t,p=r.useRef(null),h=ue(n,p),f=r.useRef(void 0),g=!a;function m(e){const t=f.current||p.current.getBoundingClientRect(),n=ng([0,t.height],g?[i,o]:[o,i]);return f.current=t,n(e-t.top)}return e(Bf,{scope:t.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:e(Xf,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{const t=m(e.clientY);s?.(t)},onSlideMove:e=>{const t=m(e.clientY);l?.(t)},onSlideEnd:()=>{f.current=void 0,c?.()},onStepKeyDown:e=>{const t=Pf[g?"from-bottom":"from-top"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})}),Xf=r.forwardRef((t,n)=>{const{__scopeSlider:r,onSlideStart:o,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:s,onEndKeyDown:l,onStepKeyDown:c,...d}=t,u=Ff(Mf,r);return e(xe.span,{...d,ref:n,onKeyDown:be(t.onKeyDown,e=>{"Home"===e.key?(s(e),e.preventDefault()):"End"===e.key?(l(e),e.preventDefault()):zf.concat(Df).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:be(t.onPointerDown,e=>{const t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():o(e)}),onPointerMove:be(t.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:be(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),Yf="SliderTrack",Kf=r.forwardRef((t,n)=>{const{__scopeSlider:r,...o}=t,i=Ff(Yf,r);return e(xe.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...o,ref:n})});Kf.displayName=Yf;var qf="SliderRange",Gf=r.forwardRef((t,n)=>{const{__scopeSlider:o,...i}=t,a=Ff(qf,o),s=Uf(qf,o),l=ue(n,r.useRef(null)),c=a.values.length,d=a.values.map(e=>tg(e,a.min,a.max)),u=c>1?Math.min(...d):0,p=100-Math.max(...d);return e(xe.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...i,ref:l,style:{...t.style,[s.startEdge]:u+"%",[s.endEdge]:p+"%"}})});Gf.displayName=qf;var Zf="SliderThumb",Jf=r.forwardRef((t,n)=>{const o=_f(t.__scopeSlider),[i,a]=r.useState(null),s=ue(n,e=>a(e)),l=r.useMemo(()=>i?o().findIndex(e=>e.ref.current===i):-1,[o,i]);return e(Qf,{...t,ref:s,index:l})}),Qf=r.forwardRef((t,o)=>{const{__scopeSlider:i,index:a,name:s,...l}=t,c=Ff(Zf,i),d=Uf(Zf,i),[u,p]=r.useState(null),h=ue(o,e=>p(e)),f=!u||(c.form||!!u.closest("form")),g=Va(u),m=c.values[a],b=void 0===m?0:tg(m,c.min,c.max),v=function(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}(a,c.values.length),w=g?.[d.size],y=w?function(e,t,n){const r=e/2,o=ng([0,50],[0,r]);return(r-o(t)*n)*n}(w,b,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(${b}% + ${y}px)`},children:[e(Tf.ItemSlot,{scope:t.__scopeSlider,children:e(xe.span,{role:"slider","aria-label":t["aria-label"]||v,"aria-valuemin":c.min,"aria-valuenow":m,"aria-valuemax":c.max,"aria-orientation":c.orientation,"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,tabIndex:c.disabled?void 0:0,...l,ref:h,style:void 0===m?{display:"none"}:t.style,onFocus:be(t.onFocus,()=>{c.valueIndexToChangeRef.current=a})})}),f&&e(eg,{name:s??(c.name?c.name+(c.values.length>1?"[]":""):void 0),form:c.form,value:m},a)]})});Jf.displayName=Zf;var eg=r.forwardRef(({__scopeSlider:t,value:n,...o},i)=>{const a=r.useRef(null),s=ue(a,i),l=ih(n);return r.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==n&&r){const t=new Event("input",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[l,n]),e(xe.input,{style:{display:"none"},...o,ref:s,defaultValue:n})});function tg(e,t,n){return Oc(100/(n-t)*(e-t),[0,100])}function ng(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}eg.displayName="RadioBubbleInput";var rg=Wf,og=Kf,ig=Gf,ag=Jf;const sg=t=>{var{className:o,defaultValue:i,value:a,min:s=0,max:l=100}=t,c=ie(t,["className","defaultValue","value","min","max"]);const d=r.useMemo(()=>Array.isArray(a)?a:Array.isArray(i)?i:[s,l],[a,i,s,l]);return n(rg,Object.assign({"data-slot":"slider",defaultValue:i,value:a,min:s,max:l,className:mr("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",o)},c,{children:[e(og,Object.assign({"data-slot":"slider-track",className:mr("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5")},{children:e(ig,{"data-slot":"slider-range",className:mr("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})})),Array.from({length:d.length},(t,n)=>e(ag,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},n))]}))},lg={contain:{label:"Contain",description:"Fit within bounds"},cover:{label:"Cover",description:"Fill and crop"},fill:{label:"Fill",description:"Stretch to fit"}},cg=({fit:t,alt:r,borderRadius:o,onUpdate:i})=>{var a,s,l,c,d,p,h,f;const[g,m]=u(r),[b,v]=u(!1);return n(Dl,Object.assign({open:b,onOpenChange:v},{children:[e(du,{children:n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(Pl,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:b?"secondary":"ghost",size:"icon",className:"h-7 w-7"},{children:e(pn,{className:"h-4 w-4"})}))}))})),e(hu,{children:"Settings"})]})}),e(Ml,Object.assign({className:"w-80 p-3",align:"start",contentEditable:!1,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},{children:n("div",Object.assign({className:"space-y-3"},{children:[n("div",{children:[e("h4",Object.assign({className:"font-semibold"},{children:"Image settings"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Customize how the image appears"}))]}),e(Nd,{}),n("div",Object.assign({className:"space-y-1"},{children:[e(oh,Object.assign({htmlFor:"alt-text",className:"text-sm font-medium"},{children:"Alt text"})),e(So,{id:"alt-text",value:g,onChange:e=>m(e.target.value),onBlur:()=>i({alt:g}),placeholder:"Describe this image...",className:"h-9"}),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Important for accessibility and SEO"}))]})),n("div",Object.assign({className:"space-y-1"},{children:[e(oh,Object.assign({htmlFor:"object-fit",className:"text-sm font-medium"},{children:"How image fits"})),n(kf,Object.assign({value:t,onValueChange:e=>i({fit:e})},{children:[e(Of,Object.assign({id:"object-fit",className:"h-9 w-full"},{children:e(Cf,Object.assign({placeholder:"Select how image fits"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(a=lg[t])||void 0===a?void 0:a.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(s=lg[t])||void 0===s?void 0:s.description}))]}))}))})),e(jf,{children:n(Nf,{children:[e(Rf,Object.assign({value:"contain",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-4 w-3 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(l=lg.contain)||void 0===l?void 0:l.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(c=lg.contain)||void 0===c?void 0:c.description}))]}))]}))})),e(Rf,Object.assign({value:"cover",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-8 w-6 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(d=lg.cover)||void 0===d?void 0:d.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(p=lg.cover)||void 0===p?void 0:p.description}))]}))]}))})),e(Rf,Object.assign({value:"fill",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-8 w-8 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(h=lg.fill)||void 0===h?void 0:h.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(f=lg.fill)||void 0===f?void 0:f.description}))]}))]}))}))]})})]}))]})),n("div",Object.assign({className:"space-y-1"},{children:[n("div",Object.assign({className:"flex items-center justify-between"},{children:[e(oh,Object.assign({className:"text-sm font-medium"},{children:"Border radius"})),n("span",Object.assign({className:"text-sm text-muted-foreground"},{children:[o,"px"]}))]})),e(sg,{value:[o],onValueChange:([e])=>i({borderRadius:e}),max:50,step:1,className:"w-full"})]}))]}))}))]}))},dg=({referenceRef:t,elementProps:r,onUpdate:o,onReplace:i,onDelete:a,onDownload:s,onCopy:l})=>{var c,d;const[h,f]=u(!1),{refs:g,floatingStyles:m}=Yp({placement:"top-end",strategy:"fixed",middleware:[Ta(8),Aa({fallbackPlacements:["bottom","top"],padding:10}),_a({padding:10})],whileElementsMounted:ba});return p(()=>{requestAnimationFrame(()=>{f(!0)})},[]),p(()=>{const e=t.current;e&&g.setReference(e)},[t,g]),e("div",Object.assign({ref:g.setFloating,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),className:mr("pointer-events-auto","flex items-center gap-1 rounded-lg border bg-background/95 backdrop-blur-sm p-1 shadow-lg","transition-all duration-200 ease-out",h?"opacity-100 translate-y-0":"opacity-0 translate-y-2"),style:m},{children:n(du,Object.assign({delayDuration:0},{children:[n("div",Object.assign({className:"flex items-center gap-0.5 border-r pr-1"},{children:[n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"left"===r.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o({alignment:"left"})},{children:e(Pt,{className:"h-4 w-4"})}))})),e(hu,{children:"Align left"})]}),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"center"===r.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o({alignment:"center"})},{children:e(Dt,{className:"h-4 w-4"})}))})),e(hu,{children:"Align center"})]}),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"right"===r.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o({alignment:"right"})},{children:e(Mt,{className:"h-4 w-4"})}))})),e(hu,{children:"Align right"})]})]})),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i},{children:e(dn,{className:"h-4 w-4"})}))})),e(hu,{children:"Replace"})]}),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:s},{children:e(Xt,{className:"h-4 w-4"})}))})),e(hu,{children:"Download"})]}),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:l},{children:e($t,{className:"h-4 w-4"})}))})),e(hu,{children:"Copy"})]}),e(Nd,{orientation:"vertical",className:"h-4"}),e(cg,{fit:null!==(c=r.fit)&&void 0!==c?c:"contain",alt:r.alt||"",borderRadius:null!==(d=r.borderRadius)&&void 0!==d?d:0,onUpdate:o}),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:a},{children:e(gn,{className:"h-4 w-4"})}))})),e(hu,{children:"Delete"})]})]}))}))},ug=({blockId:t,attributes:r,children:o,elementProps:i,onUpdate:a,onDelete:s,onReplace:l,pluginOptions:c})=>{var h;const[f,g]=u(i.sizes),{isElementSelected:m}=O(),b=S({blockId:t}),v=m&&b,w=d(null),y=x(),[k,N]=u(()=>{var e;const t=(null===(e=y.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,n=null==c?void 0:c.maxSizes;return{maxWidth:(null==n?void 0:n.maxWidth)?"number"==typeof n.maxWidth?n.maxWidth:parseInt(String(n.maxWidth).replace(/[^\d]/g,""),10):t,maxHeight:(null==n?void 0:n.maxHeight)?"number"==typeof n.maxHeight?n.maxHeight:parseInt(String(n.maxHeight).replace(/[^\d]/g,""),10):550}});p(()=>{const e=()=>{var e;const t=(null===(e=y.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,n=null==c?void 0:c.maxSizes;N({maxWidth:(null==n?void 0:n.maxWidth)?"number"==typeof n.maxWidth?n.maxWidth:parseInt(String(n.maxWidth).replace(/[^\d]/g,""),10):t,maxHeight:(null==n?void 0:n.maxHeight)?"number"==typeof n.maxHeight?n.maxHeight:parseInt(String(n.maxHeight).replace(/[^\d]/g,""),10):550})};e();const t=new ResizeObserver(e);return y.refElement&&t.observe(y.refElement),window.addEventListener("resize",e),()=>{t.disconnect(),window.removeEventListener("resize",e)}},[y,c]);const C=(e,t)=>{const n=e=>"number"==typeof e?e:parseInt(String(e).replace(/[^\d]/g,""),10),r=n(e.width),o=n(e.height),i=n(t.width),a=n(t.height);if(r<=i&&o<=a)return{width:r,height:o};const s=r/i,l=o/a,c=Math.max(s,l),d=Math.round(r/c),u=Math.round(o/c);return{width:Math.min(d,i),height:Math.min(u,a)}},E={left:"justify-start",center:"justify-center",right:"justify-end"}[null!==(h=i.alignment)&&void 0!==h?h:"center"];return n("div",Object.assign({},r,{className:mr("group/image mt-2 relative transition-all w-full flex",E)},{children:[n("div",Object.assign({className:"relative",contentEditable:!1},{children:[e(Ip,Object.assign({ref:e=>{(null==e?void 0:e.resizableElement)&&e.resizableElement instanceof HTMLElement&&(w.current=e.resizableElement)},style:{position:"relative",outline:v?".125rem solid rgba(0, 0, 0, 0)":"none",outlineColor:v?"hsl(var(--primary))":"none"},size:{width:f.width,height:f.height},onResize:(e,t,n)=>{const r=parseInt(n.style.width,10),o=parseInt(n.style.height,10),i=C({width:r,height:o},{width:k.maxWidth,height:k.maxHeight});g(i)},onResizeStop:(e,t,n)=>{const r=parseInt(n.style.width,10),o=parseInt(n.style.height,10),i=C({width:r,height:o},{width:k.maxWidth,height:k.maxHeight});a({sizes:i})},lockAspectRatio:!0,minWidth:100,minHeight:100,maxWidth:k.maxWidth,maxHeight:k.maxHeight,enableResizing:!!v&&{bottom:!1,bottomLeft:!1,bottomRight:!1,left:!0,right:!0,top:!1,topLeft:!1,topRight:!1},disableDragging:!0,resizeHandleStyles:{left:{width:"auto",height:"40px",left:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"},right:{width:"auto",height:"40px",right:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"}},resizeHandleComponent:{left:e("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"}),right:e("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"})},className:mr("rounded-sm")},{children:e("img",{src:i.src,alt:i.alt||"",className:"w-full h-full transition-all duration-200",style:{objectFit:i.fit,borderRadius:`${i.borderRadius}px`},draggable:!1})})),v&&e(dg,{referenceRef:w,elementProps:i,onUpdate:a,onReplace:l,onDelete:s,onDownload:()=>ae(void 0,void 0,void 0,function*(){try{const e=yield fetch(i.src),t=yield e.blob(),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=`image-${Date.now()}.jpg`,r.click(),URL.revokeObjectURL(n)}catch(e){}}),onCopy:()=>ae(void 0,void 0,void 0,function*(){try{const e=yield fetch(i.src),t=yield e.blob();navigator.clipboard&&ClipboardItem?yield navigator.clipboard.write([new ClipboardItem({[t.type]:t})]):Co(i.src)}catch(e){Co(i.src)}})})]})),o]}))},pg={image:{render:({element:t,attributes:n,children:r,blockId:o})=>{const i=x(),a=E("Image"),{upload:s,progress:l,loading:d}=F(a.upload),{deleteImage:u}=W(a.delete),{preview:p,generatePreview:h,clearPreview:f}=B(),g=c(e=>{N.updateElement(i,{blockId:o,type:"image",props:Object.assign(Object.assign({},t.props),e)})},[i,o,t.props]),m=c(()=>ae(void 0,void 0,void 0,function*(){yield u(t);const e=k.getBlockSlate(i,{id:o});if(!e)return;const n=N.getElementPath(i,{blockId:o,element:t});if(!n)return;const r=n?R.parent(e,n):void 0;r&&P.isElement(r[0])&&!R.isEditor(r[0])?N.deleteElement(i,{blockId:o,type:"image",path:n}):k.deleteBlock(i,{blockId:o,focus:!0})}),[i,o,t,u]),b=c(()=>{N.updateElement(i,{blockId:o,type:"image",props:Object.assign(Object.assign({},t.props),{src:null,alt:null})})},[i,o,t.props]),v=c(e=>ae(void 0,void 0,void 0,function*(){var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!n)return;h(n);const r=yield s(n);g({id:r.id||r.fileId,src:r.url,alt:n.name,sizes:{width:r.width,height:r.height}}),f()}),[s,g,h,f]);return t.props.src?e(ug,Object.assign({blockId:o,elementId:t.id,onUpdate:g,onDelete:m,attributes:n,onReplace:b,elementProps:t.props,pluginOptions:a},{children:r})):e(yu,Object.assign({onUpload:v,preview:p,progress:l,loading:d,onInsertUrl:()=>{},onInsertFromUnsplash:()=>{},onInsertFromAI:()=>ae(void 0,void 0,void 0,function*(){}),attributes:n},{children:r}))}}},hg=({textInputRef:t,urlInputRef:r,editedText:o,editedUrl:i,onChangeText:a,onChangeUrl:s,onKeyDown:l,saveEdit:c,cancelEdit:d,deleteLink:u})=>n("div",Object.assign({className:"p-2 space-y-2"},{children:[n("div",Object.assign({className:"space-y-1"},{children:[e(oh,Object.assign({htmlFor:"link-text",className:"text-xs"},{children:"Link text"})),e(So,{id:"link-text",ref:t,value:o,onChange:a,placeholder:"Link text...",className:"h-8 text-sm",onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()})]})),n("div",Object.assign({className:"space-y-1"},{children:[e(oh,Object.assign({htmlFor:"link-url",className:"text-xs"},{children:"URL"})),e(So,{id:"link-url",ref:r,value:i,onChange:s,onKeyDown:l,placeholder:"Enter URL...",className:"h-8 text-sm",onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()})]})),n("div",Object.assign({className:"flex justify-between items-center"},{children:[n("div",Object.assign({className:"flex items-center gap-2"},{children:[e(co,Object.assign({size:"sm",variant:"default",className:"h-7 text-xs",onClick:c,disabled:0===i.length||0===o.length},{children:"Save"})),e(co,Object.assign({size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:d},{children:"Cancel"}))]})),e(co,Object.assign({size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:u},{children:e(gn,{className:"h-3.5 w-3.5"})}))]}))]})),fg=({element:t,openLink:r,copyUrl:o,openEdit:i,copied:a})=>{var s;return e("div",Object.assign({className:"px-2 py-1"},{children:n("div",Object.assign({className:"flex items-center gap-1"},{children:[e("div",Object.assign({className:"flex-1 min-w-0"},{children:e("div",Object.assign({className:"text-sm truncate text-foreground"},{children:null!==(s=t.props.url)&&void 0!==s?s:"No URL"}))})),e("div",{className:"h-4 w-px bg-border"}),e(co,Object.assign({size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:r,disabled:!t.props.url,title:"Open link"},{children:e(Gt,{className:"h-3.5 w-3.5"})})),e(co,Object.assign({size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:o,disabled:!t.props.url,title:a?"Copied!":"Copy URL"},{children:e(a?Lt:$t,{className:"h-3.5 w-3.5"})})),e(co,Object.assign({size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:i,title:"Edit URL"},{children:e(sn,{className:"h-3.5 w-3.5"})}))]}))}))};var gg,mg="HoverCard",[bg,vg]=se(mg,[Ya]),wg=Ya(),[yg,xg]=bg(mg),kg=t=>{const{__scopeHoverCard:n,children:o,open:i,defaultOpen:a,onOpenChange:s,openDelay:l=700,closeDelay:c=300}=t,d=wg(n),u=r.useRef(0),p=r.useRef(0),h=r.useRef(!1),f=r.useRef(!1),[g,m]=ye({prop:i,defaultProp:a??!1,onChange:s,caller:mg}),b=r.useCallback(()=>{clearTimeout(p.current),u.current=window.setTimeout(()=>m(!0),l)},[l,m]),v=r.useCallback(()=>{clearTimeout(u.current),h.current||f.current||(p.current=window.setTimeout(()=>m(!1),c))},[c,m]),w=r.useCallback(()=>m(!1),[m]);return r.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(p.current)},[]),e(yg,{scope:n,open:g,onOpenChange:m,onOpen:b,onClose:v,onDismiss:w,hasSelectionRef:h,isPointerDownOnContentRef:f,children:e(cs,{...d,children:o})})};kg.displayName=mg;var Ng="HoverCardTrigger",Cg=r.forwardRef((t,n)=>{const{__scopeHoverCard:r,...o}=t,i=xg(Ng,r),a=wg(r);return e(ds,{asChild:!0,...a,children:e(xe.a,{"data-state":i.open?"open":"closed",...o,ref:n,onPointerEnter:be(t.onPointerEnter,Pg(i.onOpen)),onPointerLeave:be(t.onPointerLeave,Pg(i.onClose)),onFocus:be(t.onFocus,i.onOpen),onBlur:be(t.onBlur,i.onClose),onTouchStart:be(t.onTouchStart,e=>e.preventDefault())})})});Cg.displayName=Ng;var Og="HoverCardPortal",[Sg,Eg]=bg(Og,{forceMount:void 0}),jg=t=>{const{__scopeHoverCard:n,forceMount:r,children:o,container:i}=t,a=xg(Og,n);return e(Sg,{scope:n,forceMount:r,children:e(Ne,{present:r||a.open,children:e(hs,{asChild:!0,container:i,children:o})})})};jg.displayName=Og;var Rg="HoverCardContent",zg=r.forwardRef((t,n)=>{const r=Eg(Rg,t.__scopeHoverCard),{forceMount:o=r.forceMount,...i}=t,a=xg(Rg,t.__scopeHoverCard);return e(Ne,{present:o||a.open,children:e(Dg,{"data-state":a.open?"open":"closed",...i,onPointerEnter:be(t.onPointerEnter,Pg(a.onOpen)),onPointerLeave:be(t.onPointerLeave,Pg(a.onClose)),ref:n})})});zg.displayName=Rg;var Dg=r.forwardRef((t,n)=>{const{__scopeHoverCard:o,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,...c}=t,d=xg(Rg,o),u=wg(o),p=r.useRef(null),h=ue(n,p),[f,g]=r.useState(!1);return r.useEffect(()=>{if(f){const e=document.body;return gg=e.style.userSelect||e.style.webkitUserSelect,e.style.userSelect="none",e.style.webkitUserSelect="none",()=>{e.style.userSelect=gg,e.style.webkitUserSelect=gg}}},[f]),r.useEffect(()=>{if(p.current){const e=()=>{g(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{""!==document.getSelection()?.toString()&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",e),()=>{document.removeEventListener("pointerup",e),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),r.useEffect(()=>{if(p.current){(function(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t})(p.current).forEach(e=>e.setAttribute("tabindex","-1"))}}),e(Mo,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:be(s,e=>{e.preventDefault()}),onDismiss:d.onDismiss,children:e(us,{...u,...c,onPointerDown:be(c.onPointerDown,e=>{e.currentTarget.contains(e.target)&&g(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...c.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})});function Pg(e){return t=>"touch"===t.pointerType?void 0:e()}r.forwardRef((t,n)=>{const{__scopeHoverCard:r,...o}=t,i=wg(r);return e(ps,{...i,...o,ref:n})}).displayName="HoverCardArrow";var Mg=kg,Tg=Cg,_g=jg,Ig=zg;const Ag=t=>{var n=ie(t,[]);return e(Mg,Object.assign({"data-slot":"hover-card"},n))},Lg=t=>{var n=ie(t,[]);return e(Tg,Object.assign({"data-slot":"hover-card-trigger"},n))},Hg=t=>{var{className:n,align:r="center",sideOffset:o=4}=t,i=ie(t,["className","align","sideOffset"]);return e(_g,Object.assign({"data-slot":"hover-card-portal"},{children:e(Ig,Object.assign({"data-slot":"hover-card-content",align:r,sideOffset:o,className:mr("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n)},i))}))},Fg=e=>{var t;if(M.isText(e))return e.text;if("object"==typeof e&&null!==e&&"children"in e){const n=e.children;return null!==(t=null==n?void 0:n.map(Fg).join(""))&&void 0!==t?t:""}return""},Wg={link:{render:t=>{var r;const{attributes:o,children:i,element:a,blockId:s}=t,l=x(),c=Fg(a),[h,f]=u(!1),[g,m]=u(null!==(r=a.props.url)&&void 0!==r?r:""),[b,v]=u(c),[w,y]=u(!1),k=d(null),C=d(null);p(()=>{var e;m(null!==(e=a.props.url)&&void 0!==e?e:""),v(c)},[a.props.url,c]),p(()=>{h&&k.current&&(k.current.focus(),k.current.select())},[h]);return n(Ag,Object.assign({openDelay:100,closeDelay:100},{children:[e(Lg,Object.assign({asChild:!0},{children:e("a",Object.assign({},o,{href:a.props.url||void 0,target:a.props.target,rel:a.props.rel,title:a.props.title||void 0,className:"text-primary font-medium underline underline-offset-4 cursor-pointer hover:text-primary/80 transition-colors",contentEditable:!1,onClick:e=>{h&&e.preventDefault()}},{children:i}))})),e(Hg,Object.assign({className:"w-80 p-0",onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},{children:h?e(hg,{textInputRef:C,urlInputRef:k,editedText:b,editedUrl:g,onChangeText:e=>v(e.target.value),onChangeUrl:e=>m(e.target.value),onKeyDown:e=>{var t;"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),N.updateElement(l,{blockId:s,type:"link",text:b,props:{url:g}}),f(!1)):"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),m(null!==(t=a.props.url)&&void 0!==t?t:""),v(c),f(!1))},saveEdit:e=>{e.preventDefault(),e.stopPropagation();const t=N.getElementPath(l,{blockId:s,element:a});t&&(N.updateElement(l,{blockId:s,type:"link",text:b,path:t,props:{url:g}}),f(!1))},cancelEdit:e=>{var t;e.preventDefault(),e.stopPropagation(),m(null!==(t=a.props.url)&&void 0!==t?t:""),v(c),f(!1)},deleteLink:e=>{e.preventDefault(),e.stopPropagation();const t=N.getElementPath(l,{blockId:s,element:a});t&&(N.deleteElement(l,{mode:"unwrap",type:"link",path:t,blockId:s}),f(!1))}}):e(fg,{element:a,openLink:e=>{var t;e.preventDefault(),e.stopPropagation(),a.props.url&&window.open(a.props.url,null!==(t=a.props.target)&&void 0!==t?t:"_blank",a.props.rel)},copyUrl:e=>{if(e.preventDefault(),e.stopPropagation(),a.props.url){Co(a.props.url)&&(y(!0),setTimeout(()=>y(!1),1500))}},openEdit:e=>{0!==g.length&&(e.preventDefault(),e.stopPropagation(),f(!0))},copied:w})}))]}))}}},Bg={"numbered-list":{render:t=>{const{attributes:r,children:o,blockId:i}=t,a=j(i),s=U(a);return n("div",Object.assign({},r,{className:"my-0 ml-6 list-decimal [&>li]:mt-2"},{children:[n("span",Object.assign({contentEditable:!1},{children:[s,"."]})),e("span",Object.assign({},r,{className:"pl-2"},{children:o}))]}))}}},Ug={BulletedList:{"bulleted-list":{render:t=>{const{attributes:n,children:r}=t;return e("ul",Object.assign({},n,{className:"my-0 ml-6 list-disc [&>li]:mt-2"},{children:e("li",Object.assign({},n,{className:"pl-2"},{children:r}))}))}}},NumberedList:Bg,TodoList:{"todo-list":{render:t=>{const{attributes:r,children:o,element:i,blockId:a}=t,s=i.props.checked,l=x();return e("div",Object.assign({},r,{className:"m-0 mt-2 ml-6 list-none"},{children:n("div",Object.assign({className:"flex items-start gap-2 pl-2"},{children:[e("button",Object.assign({type:"button",contentEditable:!1,onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),N.updateElement(l,{blockId:a,type:"todo-list",props:{checked:!s}})},className:mr("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-sm border-2 transition-colors",s?"bg-primary border-primary text-primary-foreground":"border-input bg-background"),"aria-label":s?"Mark as unchecked":"Mark as checked"},{children:s&&e(Lt,{className:"h-3 w-3"})})),e("span",Object.assign({className:mr("flex-1",s&&"text-muted-foreground line-through")},{children:o}))]}))}))}}}},Vg={paragraph:{render:t=>{const{attributes:n,children:r}=t;return e("p",Object.assign({},n,{className:"leading-7 [&:not(:first-child)]:mt-6"},{children:r}))}}};var $g=["Enter"," "],Xg=["ArrowUp","PageDown","End"],Yg=["ArrowDown","PageUp","Home",...Xg],Kg={ltr:[...$g,"ArrowRight"],rtl:[...$g,"ArrowLeft"]},qg={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gg="Menu",[Zg,Jg,Qg]=me(Gg),[em,tm]=se(Gg,[Qg,Ya,$l]),nm=Ya(),rm=$l(),[om,im]=em(Gg),[am,sm]=em(Gg),lm=t=>{const{__scopeMenu:n,open:o=!1,children:i,dir:a,onOpenChange:s,modal:l=!0}=t,c=nm(n),[d,u]=r.useState(null),p=r.useRef(!1),h=Eo(s),f=Ve(a);return r.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),e(cs,{...c,children:e(om,{scope:n,open:o,onOpenChange:h,content:d,onContentChange:u,children:e(am,{scope:n,onClose:r.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:f,modal:l,children:i})})})};lm.displayName=Gg;var cm=r.forwardRef((t,n)=>{const{__scopeMenu:r,...o}=t,i=nm(r);return e(ds,{...i,...o,ref:n})});cm.displayName="MenuAnchor";var dm="MenuPortal",[um,pm]=em(dm,{forceMount:void 0}),hm=t=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=t,a=im(dm,n);return e(um,{scope:n,forceMount:r,children:e(Ne,{present:r||a.open,children:e(hs,{asChild:!0,container:i,children:o})})})};hm.displayName=dm;var fm="MenuContent",[gm,mm]=em(fm),bm=r.forwardRef((t,n)=>{const r=pm(fm,t.__scopeMenu),{forceMount:o=r.forceMount,...i}=t,a=im(fm,t.__scopeMenu),s=sm(fm,t.__scopeMenu);return e(Zg.Provider,{scope:t.__scopeMenu,children:e(Ne,{present:o||a.open,children:e(Zg.Slot,{scope:t.__scopeMenu,children:s.modal?e(vm,{...i,ref:n}):e(wm,{...i,ref:n})})})})}),vm=r.forwardRef((t,n)=>{const o=im(fm,t.__scopeMenu),i=r.useRef(null),a=ue(n,i);return r.useEffect(()=>{const e=i.current;if(e)return ys(e)},[]),e(xm,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:be(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),wm=r.forwardRef((t,n)=>{const r=im(fm,t.__scopeMenu);return e(xm,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),ym=pe("MenuContent.ScrollLock"),xm=r.forwardRef((t,n)=>{const{__scopeMenu:o,loop:i=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:g,disableOutsideScroll:m,...b}=t,v=im(fm,o),w=sm(fm,o),y=nm(o),x=rm(o),k=Jg(o),[N,C]=r.useState(null),O=r.useRef(null),S=ue(n,O,v.onContentChange),E=r.useRef(0),j=r.useRef(""),R=r.useRef(0),z=r.useRef(null),D=r.useRef("right"),P=r.useRef(0),M=m?al:r.Fragment,T=m?{as:ym,allowPinchZoom:!0}:void 0,_=e=>{const t=j.current+e,n=k().filter(e=>!e.disabled),r=document.activeElement,o=n.find(e=>e.ref.current===r)?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,l=Math.max(i,0),s.map((e,t)=>s[(l+t)%s.length]));var s,l;1===o.length&&(a=a.filter(e=>e!==n));const c=a.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}(n.map(e=>e.textValue),t,o),a=n.find(e=>e.textValue===i)?.ref.current;!function e(t){j.current=t,window.clearTimeout(E.current),""!==t&&(E.current=window.setTimeout(()=>e(""),1e3))}(t),a&&setTimeout(()=>a.focus())};r.useEffect(()=>()=>window.clearTimeout(E.current),[]),Ao();const I=r.useCallback(e=>D.current===z.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e],s=t[i],l=a.x,c=a.y,d=s.x,u=s.y;c>r!=u>r&&n<(d-l)*(r-c)/(u-c)+l&&(o=!o)}return o}(n,t)}(e,z.current?.area),[]);return e(gm,{scope:o,searchRef:j,onItemEnter:r.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:r.useCallback(e=>{I(e)||(O.current?.focus(),C(null))},[I]),onTriggerLeave:r.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:R,onPointerGraceIntentChange:r.useCallback(e=>{z.current=e},[]),children:e(M,{...T,children:e(Bo,{asChild:!0,trapped:a,onMountAutoFocus:be(s,e=>{e.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:e(Mo,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:g,children:e(ec,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:i,currentTabStopId:N,onCurrentTabStopIdChange:C,onEntryFocus:be(d,e=>{w.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:e(us,{role:"menu","aria-orientation":"vertical","data-state":qm(v.open),"data-radix-menu-content":"",dir:w.dir,...y,...b,ref:S,style:{outline:"none",...b.style},onKeyDown:be(b.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&_(e.key));const o=O.current;if(e.target!==o)return;if(!Yg.includes(e.key))return;e.preventDefault();const i=k().filter(e=>!e.disabled).map(e=>e.ref.current);Xg.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)}),onBlur:be(t.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),j.current="")}),onPointerMove:be(t.onPointerMove,Jm(e=>{const t=e.target,n=P.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>P.current?"right":"left";D.current=t,P.current=e.clientX}}))})})})})})})});bm.displayName=fm;var km=r.forwardRef((t,n)=>{const{__scopeMenu:r,...o}=t;return e(xe.div,{role:"group",...o,ref:n})});km.displayName="MenuGroup";var Nm=r.forwardRef((t,n)=>{const{__scopeMenu:r,...o}=t;return e(xe.div,{...o,ref:n})});Nm.displayName="MenuLabel";var Cm="MenuItem",Om="menu.itemSelect",Sm=r.forwardRef((t,n)=>{const{disabled:o=!1,onSelect:i,...a}=t,s=r.useRef(null),l=sm(Cm,t.__scopeMenu),c=mm(Cm,t.__scopeMenu),d=ue(n,s),u=r.useRef(!1);return e(Em,{...a,ref:d,disabled:o,onClick:be(t.onClick,()=>{const e=s.current;if(!o&&e){const t=new CustomEvent(Om,{bubbles:!0,cancelable:!0});e.addEventListener(Om,e=>i?.(e),{once:!0}),ke(e,t),t.defaultPrevented?u.current=!1:l.onClose()}}),onPointerDown:e=>{t.onPointerDown?.(e),u.current=!0},onPointerUp:be(t.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:be(t.onKeyDown,e=>{const t=""!==c.searchRef.current;o||t&&" "===e.key||$g.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Sm.displayName=Cm;var Em=r.forwardRef((t,n)=>{const{__scopeMenu:o,disabled:i=!1,textValue:a,...s}=t,l=mm(Cm,o),c=rm(o),d=r.useRef(null),u=ue(n,d),[p,h]=r.useState(!1),[f,g]=r.useState("");return r.useEffect(()=>{const e=d.current;e&&g((e.textContent??"").trim())},[s.children]),e(Zg.ItemSlot,{scope:o,disabled:i,textValue:a??f,children:e(tc,{asChild:!0,...c,focusable:!i,children:e(xe.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...s,ref:u,onPointerMove:be(t.onPointerMove,Jm(e=>{if(i)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:be(t.onPointerLeave,Jm(e=>l.onItemLeave(e))),onFocus:be(t.onFocus,()=>h(!0)),onBlur:be(t.onBlur,()=>h(!1))})})})}),jm=r.forwardRef((t,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=t;return e(Im,{scope:t.__scopeMenu,checked:r,children:e(Sm,{role:"menuitemcheckbox","aria-checked":Gm(r)?"mixed":r,...i,ref:n,"data-state":Zm(r),onSelect:be(i.onSelect,()=>o?.(!!Gm(r)||!r),{checkForDefaultPrevented:!1})})})});jm.displayName="MenuCheckboxItem";var Rm="MenuRadioGroup",[zm,Dm]=em(Rm,{value:void 0,onValueChange:()=>{}}),Pm=r.forwardRef((t,n)=>{const{value:r,onValueChange:o,...i}=t,a=Eo(o);return e(zm,{scope:t.__scopeMenu,value:r,onValueChange:a,children:e(km,{...i,ref:n})})});Pm.displayName=Rm;var Mm="MenuRadioItem",Tm=r.forwardRef((t,n)=>{const{value:r,...o}=t,i=Dm(Mm,t.__scopeMenu),a=r===i.value;return e(Im,{scope:t.__scopeMenu,checked:a,children:e(Sm,{role:"menuitemradio","aria-checked":a,...o,ref:n,"data-state":Zm(a),onSelect:be(o.onSelect,()=>i.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});Tm.displayName=Mm;var _m="MenuItemIndicator",[Im,Am]=em(_m,{checked:!1}),Lm=r.forwardRef((t,n)=>{const{__scopeMenu:r,forceMount:o,...i}=t,a=Am(_m,r);return e(Ne,{present:o||Gm(a.checked)||!0===a.checked,children:e(xe.span,{...i,ref:n,"data-state":Zm(a.checked)})})});Lm.displayName=_m;var Hm=r.forwardRef((t,n)=>{const{__scopeMenu:r,...o}=t;return e(xe.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});Hm.displayName="MenuSeparator";var Fm=r.forwardRef((t,n)=>{const{__scopeMenu:r,...o}=t,i=nm(r);return e(ps,{...i,...o,ref:n})});Fm.displayName="MenuArrow";var Wm="MenuSub",[Bm,Um]=em(Wm),Vm=t=>{const{__scopeMenu:n,children:o,open:i=!1,onOpenChange:a}=t,s=im(Wm,n),l=nm(n),[c,d]=r.useState(null),[u,p]=r.useState(null),h=Eo(a);return r.useEffect(()=>(!1===s.open&&h(!1),()=>h(!1)),[s.open,h]),e(cs,{...l,children:e(om,{scope:n,open:i,onOpenChange:h,content:u,onContentChange:p,children:e(Bm,{scope:n,contentId:Ee(),triggerId:Ee(),trigger:c,onTriggerChange:d,children:o})})})};Vm.displayName=Wm;var $m="MenuSubTrigger",Xm=r.forwardRef((t,n)=>{const o=im($m,t.__scopeMenu),i=sm($m,t.__scopeMenu),a=Um($m,t.__scopeMenu),s=mm($m,t.__scopeMenu),l=r.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,u={__scopeMenu:t.__scopeMenu},p=r.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return r.useEffect(()=>p,[p]),r.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),d(null)}},[c,d]),e(cm,{asChild:!0,...u,children:e(Em,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":a.contentId,"data-state":qm(o.open),...t,ref:de(n,a.onTriggerChange),onClick:e=>{t.onClick?.(e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:be(t.onPointerMove,Jm(e=>{s.onItemEnter(e),e.defaultPrevented||t.disabled||o.open||l.current||(s.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{o.onOpenChange(!0),p()},100))})),onPointerLeave:be(t.onPointerLeave,Jm(e=>{p();const t=o.content?.getBoundingClientRect();if(t){const n=o.content?.dataset.side,r="right"===n,i=r?-5:5,a=t[r?"left":"right"],l=t[r?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+i,y:e.clientY},{x:a,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:a,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:be(t.onKeyDown,e=>{const n=""!==s.searchRef.current;t.disabled||n&&" "===e.key||Kg[i.dir].includes(e.key)&&(o.onOpenChange(!0),o.content?.focus(),e.preventDefault())})})})});Xm.displayName=$m;var Ym="MenuSubContent",Km=r.forwardRef((t,n)=>{const o=pm(fm,t.__scopeMenu),{forceMount:i=o.forceMount,...a}=t,s=im(fm,t.__scopeMenu),l=sm(fm,t.__scopeMenu),c=Um(Ym,t.__scopeMenu),d=r.useRef(null),u=ue(n,d);return e(Zg.Provider,{scope:t.__scopeMenu,children:e(Ne,{present:i||s.open,children:e(Zg.Slot,{scope:t.__scopeMenu,children:e(xm,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:be(t.onFocusOutside,e=>{e.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:be(t.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:be(t.onKeyDown,e=>{const t=e.currentTarget.contains(e.target),n=qg[l.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});function qm(e){return e?"open":"closed"}function Gm(e){return"indeterminate"===e}function Zm(e){return Gm(e)?"indeterminate":e?"checked":"unchecked"}function Jm(e){return t=>"mouse"===t.pointerType?e(t):void 0}Km.displayName=Ym;var Qm=lm,eb=cm,tb=hm,nb=bm,rb=km,ob=Nm,ib=Sm,ab=jm,sb=Pm,lb=Tm,cb=Lm,db=Hm,ub=Fm,pb=Vm,hb=Xm,fb=Km,gb="DropdownMenu",[mb,bb]=se(gb,[tm]),vb=tm(),[wb,yb]=mb(gb),xb=t=>{const{__scopeDropdownMenu:n,children:o,dir:i,open:a,defaultOpen:s,onOpenChange:l,modal:c=!0}=t,d=vb(n),u=r.useRef(null),[p,h]=ye({prop:a,defaultProp:s??!1,onChange:l,caller:gb});return e(wb,{scope:n,triggerId:Ee(),triggerRef:u,contentId:Ee(),open:p,onOpenChange:h,onOpenToggle:r.useCallback(()=>h(e=>!e),[h]),modal:c,children:e(Qm,{...d,open:p,onOpenChange:h,dir:i,modal:c,children:o})})};xb.displayName=gb;var kb="DropdownMenuTrigger",Nb=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=t,a=yb(kb,r),s=vb(r);return e(eb,{asChild:!0,...s,children:e(xe.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:de(n,a.triggerRef),onPointerDown:be(t.onPointerDown,e=>{o||0!==e.button||!1!==e.ctrlKey||(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:be(t.onKeyDown,e=>{o||(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});Nb.displayName=kb;var Cb=t=>{const{__scopeDropdownMenu:n,...r}=t,o=vb(n);return e(tb,{...o,...r})};Cb.displayName="DropdownMenuPortal";var Ob="DropdownMenuContent",Sb=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:o,...i}=t,a=yb(Ob,o),s=vb(o),l=r.useRef(!1);return e(nb,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...i,ref:n,onCloseAutoFocus:be(t.onCloseAutoFocus,e=>{l.current||a.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:be(t.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;a.modal&&!r||(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Sb.displayName=Ob;r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=vb(r);return e(rb,{...i,...o,ref:n})}).displayName="DropdownMenuGroup";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=vb(r);return e(ob,{...i,...o,ref:n})}).displayName="DropdownMenuLabel";var Eb=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=vb(r);return e(ib,{...i,...o,ref:n})});Eb.displayName="DropdownMenuItem";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=vb(r);return e(ab,{...i,...o,ref:n})}).displayName="DropdownMenuCheckboxItem";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=vb(r);return e(sb,{...i,...o,ref:n})}).displayName="DropdownMenuRadioGroup";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=vb(r);return e(lb,{...i,...o,ref:n})}).displayName="DropdownMenuRadioItem";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=vb(r);return e(cb,{...i,...o,ref:n})}).displayName="DropdownMenuItemIndicator";var jb=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=vb(r);return e(db,{...i,...o,ref:n})});jb.displayName="DropdownMenuSeparator";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=vb(r);return e(ub,{...i,...o,ref:n})}).displayName="DropdownMenuArrow";var Rb=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=vb(r);return e(hb,{...i,...o,ref:n})});Rb.displayName="DropdownMenuSubTrigger";var zb=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=vb(r);return e(fb,{...i,...o,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});zb.displayName="DropdownMenuSubContent";var Db=xb,Pb=Nb,Mb=Cb,Tb=Sb,_b=Eb,Ib=jb,Ab=t=>{const{__scopeDropdownMenu:n,children:r,open:o,onOpenChange:i,defaultOpen:a}=t,s=vb(n),[l,c]=ye({prop:o,defaultProp:a??!1,onChange:i,caller:"DropdownMenuSub"});return e(pb,{...s,open:l,onOpenChange:c,children:r})},Lb=Rb,Hb=zb;const Fb=t=>{var n=ie(t,[]);return e(Db,Object.assign({"data-slot":"dropdown-menu"},n))},Wb=t=>{var n=ie(t,[]);return e(Pb,Object.assign({"data-slot":"dropdown-menu-trigger"},n))},Bb=t=>{var{className:n,sideOffset:r=4}=t,o=ie(t,["className","sideOffset"]);return e(Mb,{children:e(Tb,Object.assign({"data-slot":"dropdown-menu-content",sideOffset:r,className:mr("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n)},o))})},Ub=t=>{var{className:n,inset:r,variant:o="default"}=t,i=ie(t,["className","inset","variant"]);return e(_b,Object.assign({"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":o,className:mr("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n)},i))},Vb=t=>{var{className:n}=t,r=ie(t,["className"]);return e(Ib,Object.assign({"data-slot":"dropdown-menu-separator",className:mr("bg-border -mx-1 my-1 h-px",n)},r))},$b=t=>{var n=ie(t,[]);return e(Ab,Object.assign({"data-slot":"dropdown-menu-sub"},n))},Xb=t=>{var{className:r,inset:o,children:i}=t,a=ie(t,["className","inset","children"]);return n(Lb,Object.assign({"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:mr("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r)},a,{children:[i,e(Ft,{className:"ml-auto size-4"})]}))},Yb=t=>{var{className:n}=t,r=ie(t,["className"]);return e(Hb,Object.assign({"data-slot":"dropdown-menu-sub-content",className:mr("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",n)},r))},Kb={"step-container":{render:t=>{const r=x(),{attributes:o,children:i}=t;return n("div",Object.assign({},o,{role:"list",className:"ml-3.5 my-4 relative group/steps-node"},{children:[i,e("div",Object.assign({contentEditable:!1,className:mr("-ml-3.5 z-20 absolute left-0 flex","transition-opacity duration-300","opacity-0 group-hover/steps-node:opacity-100"),style:{bottom:"-4px"}},{children:e(co,Object.assign({variant:"ghost",size:"icon",className:mr("w-7 h-7 shrink-0 rounded-lg","bg-muted hover:bg-muted/80","text-sm font-semibold"),onClick:()=>{k.getBlockSlate(r,{id:t.blockId})&&V.addStep(r,{blockId:t.blockId})},"aria-label":"Add more Step"},{children:e(cn,{className:"w-4 h-4"})}))}))]}))}},"step-list":{render:t=>{const{attributes:n,children:r}=t;return e("div",Object.assign({},n,{className:"[&>div]:contents contents"},{children:r}))}},"step-list-item":{render:t=>{const{attributes:r,children:o,element:i}=t,a=x(),s=l(()=>{const e=N.getElementPath(a,{blockId:t.blockId,element:i}),n=null==e?void 0:e[e.length-1];return n||0},[a,i,t.blockId]),c=s+1,d=s===i.children.length-1,u=0===i.children.length;return e("div",Object.assign({className:"prose dark:prose-invert"},{children:n("div",Object.assign({className:"relative group/component-wrapper group/step"},{children:[n("div",Object.assign({},r,{role:"listitem",className:"step group/step relative flex items-start pb-5"},{children:[e("div",{"data-component-part":"step-line",contentEditable:!1,className:mr("absolute w-px h-[calc(100%-2.75rem)] top-[2.75rem]",d?"bg-transparent bg-gradient-to-b from-border via-80% to-transparent":"bg-border/70",d&&u&&"hidden")}),e("div",Object.assign({"data-component-part":"step-number",contentEditable:!1,className:"absolute ml-[-13px] py-2 pointer-events-none select-none"},{children:e("div",Object.assign({className:mr("size-7 shrink-0 rounded-full","bg-muted","text-xs font-semibold","flex items-center justify-center","text-foreground")},{children:c}))})),e("div",Object.assign({className:"w-full overflow-hidden pl-8 pr-px"},{children:o}))]})),e("div",Object.assign({contentEditable:!1,className:mr("z-20 absolute top-0 right-3 flex","transition-opacity duration-300","opacity-0 hover:opacity-100 group-hover/step:opacity-100")},{children:n(Fb,{children:[e(Wb,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"icon",className:mr("size-8 shrink-0 rounded-lg","border border-transparent","hover:bg-muted"),"aria-label":"Edit Step attributes"},{children:e(Yt,{className:"h-4 w-4"})}))})),n(Bb,Object.assign({align:"end"},{children:[n(Ub,Object.assign({onClick:()=>{V.moveUp(a,{blockId:t.blockId,stepId:i.id})},className:"cursor-pointer"},{children:[e(At,{className:"h-4 w-4"})," Move up"]})),n(Ub,Object.assign({onClick:()=>{V.moveDown(a,{blockId:t.blockId,stepId:i.id})},className:"cursor-pointer"},{children:[e(Tt,{className:"h-4 w-4"})," Move down"]})),e(Vb,{}),n(Ub,Object.assign({onClick:()=>{V.deleteStep(a,{blockId:t.blockId,stepId:i.id})},className:"text-destructive focus:text-destructive cursor-pointer"},{children:[e(gn,{className:"h-4 w-4"})," Delete step"]}))]}))]})}))]}))}))}},"step-list-item-heading":{render:t=>{const{attributes:n,children:r}=t;return e("p",Object.assign({},n,{"data-component-part":"step-title",className:"mt-2 font-semibold prose dark:prose-invert text-foreground"},{children:r}))}},"step-list-item-content":{render:t=>{const{attributes:n,children:r}=t;return e("div",Object.assign({},n,{"data-component-part":"step-content",className:"my-2 prose dark:prose-invert"},{children:r}))}}},qb=i((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("div",Object.assign({"data-slot":"table-container",className:"relative w-full overflow-x-auto rounded-md"},{children:e("table",Object.assign({ref:n,"data-slot":"table",className:mr("caption-bottom text-sm table-fixed border-collapse",r)},o))}))});qb.displayName="Table";i((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("thead",Object.assign({ref:n,"data-slot":"table-header",className:mr("[&_tr]:border-b",r)},o))}).displayName="TableHeader";const Gb=i((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("tbody",Object.assign({ref:n,"data-slot":"table-body",className:mr("[&_tr:first-child]:border-t [&_tr]:border-b [&_tr]:border-border",r)},o))});Gb.displayName="TableBody";i((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("tfoot",Object.assign({ref:n,"data-slot":"table-footer",className:mr("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",r)},o))}).displayName="TableFooter";const Zb=i((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("tr",Object.assign({ref:n,"data-slot":"table-row",className:mr("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",r)},o))});Zb.displayName="TableRow";const Jb=i((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("th",Object.assign({ref:n,"data-slot":"table-head",className:mr("border-border border-r last:border-r-0 text-foreground h-10 px-2 text-left font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] bg-muted/50",r)},o))});Jb.displayName="TableHead";const Qb=i((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("td",Object.assign({ref:n,"data-slot":"table-cell",className:mr("border-border border-r last:border-r-0 p-2 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",r)},o))});Qb.displayName="TableCell";i((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e("caption",Object.assign({ref:n,"data-slot":"table-caption",className:mr("text-muted-foreground mt-4 text-sm",r)},o))}).displayName="TableCaption";const ev=({blockId:t})=>{const n=x(),[r,o]=u(null),[i,a]=u(!1),[s,l]=u(null),[h,f]=u([]),g=d(0),m=d(0),b=d([]),v=d(null),w=d(null),y=d(null);p(()=>{b.current=h},[h]),p(()=>{w.current=r},[r]),p(()=>{v.current=s},[s]);const k=c(()=>{const e=document.querySelector(`[data-yoopta-block-id="${t}"][data-table-container]`);if(!e)return;const n=e.querySelector("table");if(!n)return;const r=n.getBoundingClientRect();o(r);const i=n.querySelector("colgroup");y.current=i;const a=n.querySelectorAll("colgroup col"),s=n.querySelector("tr");if(a.length>0){const e=[];r.left,a.forEach((t,n)=>{const r=window.getComputedStyle(t),o=parseInt(r.width,10)||200;e.push(o)}),f(e)}else if(s){const e=s.querySelectorAll("td, th"),t=[],n=[];e.forEach((e,r)=>{const o=e.getBoundingClientRect();n.push(o.width),t.push({index:r,left:o.left,width:o.width})}),f(n)}},[t]);p(()=>{k();const e=document.querySelector(`[data-yoopta-block-id="${t}"][data-table-container]`);if(!e)return;const n=e.querySelector("table");if(!n)return;const r=new ResizeObserver(()=>{i||k()});r.observe(n);const o=new MutationObserver(()=>{i||k()});o.observe(n,{childList:!0,subtree:!0});const a=()=>{i||k()};return window.addEventListener("scroll",a,!0),()=>{r.disconnect(),o.disconnect(),window.removeEventListener("scroll",a,!0)}},[t,k,i]);const N=c(e=>{if(!y.current)return;y.current.querySelectorAll("col").forEach((t,n)=>{void 0!==e[n]&&(t.style.width=`${e[n]}px`)})},[]),C=c((e,t)=>{if(!t||0===e.length)return[];let n=t.left;return e.map((e,t)=>{const r={index:t,left:n,width:e};return n+=e,r})},[]),O=c((e,t)=>{e.preventDefault(),e.stopPropagation();const n=h[t];void 0!==n&&(a(!0),l(t),g.current=e.clientX,m.current=n,document.body.classList.add("resizing-column"))},[h]),S=c(e=>{const t=v.current;if(null===t)return;const n=e.clientX-g.current,r=Math.max(50,m.current+n),o=[...b.current];o[t]=r,f(o),N(o)},[N]),E=c(()=>{const e=v.current,r=b.current;null!==e&&void 0!==r[e]&&$.setColumnWidth(n,t,e,r[e]),a(!1),l(null),document.body.classList.remove("resizing-column"),setTimeout(k,50)},[n,t,k]);if(p(()=>{if(i)return document.addEventListener("mousemove",S),document.addEventListener("mouseup",E),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",E)}},[i,S,E]),!r||0===h.length)return null;const j=C(h,r).slice(0,-1).map(t=>{const n=t.left+t.width-3;return e("div",{className:"column-resize-handle",style:{position:"fixed",left:`${n}px`,top:`${r.top}px`,width:"6px",height:`${r.height}px`,cursor:"col-resize",zIndex:50,backgroundColor:i&&s===t.index?"hsl(var(--primary))":"transparent"},onMouseDown:e=>O(e,t.index),onMouseEnter:e=>{i||(e.target.style.backgroundColor="hsl(var(--primary) / 0.3)")},onMouseLeave:e=>{i||(e.target.style.backgroundColor="transparent")}},`resize-${t.index}`)});return e(K,Object.assign({id:"column-resize-handles-container"},{children:e("div",Object.assign({className:"column-resize-handles-container",style:{pointerEvents:i?"auto":void 0}},{children:j}))}))},tv=({blockId:t,totalColumns:n,position:r,onMouseEnter:o,onMouseLeave:i})=>{const a=x(),s=c(()=>{const e=[0,0,n-1,0];$.insertTableColumn(a,t,{path:e,insertMode:"after"})},[a,t,n]);return e(K,Object.assign({id:`table-add-column-button-${t}`},{children:e("div",Object.assign({className:"fixed z-[9999] pointer-events-auto",style:{left:`${r.left+4}px`,top:`${r.top}px`,width:"18px",height:`${r.height}px`},onMouseEnter:o,onMouseLeave:i},{children:e(co,Object.assign({variant:"ghost",size:"sm",className:"p-0 h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md transition-all hover:shadow-md flex items-center justify-center text-muted-foreground hover:text-foreground",onClick:s,onMouseDown:e=>e.preventDefault()},{children:e(cn,{className:"h-3 w-3"})}))}))}))},nv=({blockId:t,totalRows:n,position:r,onMouseEnter:o,onMouseLeave:i})=>{const a=x(),s=c(()=>{const e=[0,n-1,0,0];$.insertTableRow(a,t,{path:e,insertMode:"after"})},[a,t,n]);return e(K,Object.assign({id:`table-add-row-button-${t}`},{children:e("div",Object.assign({className:"fixed z-[9999] pointer-events-auto",style:{left:`${r.left}px`,top:`${r.top+4}px`,width:`${r.width}px`,height:"18px"},onMouseEnter:o,onMouseLeave:i},{children:e(co,Object.assign({variant:"ghost",size:"sm",className:"h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md transition-all hover:shadow-md flex items-center justify-center gap-1.5 text-muted-foreground hover:text-foreground",onClick:s,onMouseDown:e=>e.preventDefault()},{children:e(cn,{className:"h-3 w-3"})}))}))}))},rv=({blockId:r,colIndex:o,position:i,onMouseEnter:a,onMouseLeave:s})=>{const d=x(),u=l(()=>[0,0,o,0],[o]),p=c(()=>{$.insertTableColumn(d,r,{path:u,insertMode:"before"})},[d,r,u]),h=c(()=>{$.insertTableColumn(d,r,{path:u,insertMode:"after"})},[d,r,u]),f=c(()=>{$.deleteTableColumn(d,r,{path:u})},[d,r,u]),g=c(()=>{$.toggleHeaderColumn(d,r)},[d,r]);return e(K,Object.assign({id:`table-column-controls-${r}-${o}`},{children:e("div",Object.assign({className:"fixed z-[9999] pointer-events-auto",style:{left:`${i.left}px`,top:`${i.top+4}px`,width:`${i.width}px`,height:"18px"},onMouseEnter:a,onMouseLeave:s},{children:n(Fb,{children:[e(Wb,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"sm",className:"h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md p-0 transition-all hover:shadow-md",onMouseDown:e=>e.preventDefault()},{children:e(Kt,{className:"h-3 w-3 text-muted-foreground"})}))})),n(Bb,Object.assign({align:"start",side:"top",className:"w-48"},{children:[0===o&&n(t,{children:[n(Ub,Object.assign({onClick:g},{children:[e(fn,{className:"mr-2 h-4 w-4"}),"Header column"]})),e(Vb,{})]}),n(Ub,Object.assign({onClick:p},{children:[e(_t,{className:"mr-2 h-4 w-4"}),"Insert column left"]})),n(Ub,Object.assign({onClick:h},{children:[e(It,{className:"mr-2 h-4 w-4"}),"Insert column right"]})),e(Vb,{}),n(Ub,Object.assign({onClick:f,className:"text-destructive focus:text-destructive"},{children:[e(gn,{className:"mr-2 h-4 w-4"}),"Delete column"]}))]}))]})}))}))},ov=({blockId:r,rowIndex:o,position:i,onMouseEnter:a,onMouseLeave:s})=>{const d=x(),u=l(()=>[0,o,0,0],[o]),p=c(()=>{$.insertTableRow(d,r,{path:u,insertMode:"before"})},[d,r,u]),h=c(()=>{$.insertTableRow(d,r,{path:u,insertMode:"after"})},[d,r,u]),f=c(()=>{$.deleteTableRow(d,r,{path:u})},[d,r,u]),g=c(()=>{$.toggleHeaderRow(d,r)},[d,r]);return e(K,Object.assign({id:`table-row-controls-${r}-${o}`},{children:e("div",Object.assign({className:"fixed z-[9998] pointer-events-auto",style:{left:`${i.left+20}px`,top:`${i.top}px`,width:"18px",height:`${i.height}px`},onMouseEnter:a,onMouseLeave:s},{children:n(Fb,{children:[e(Wb,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"sm",className:"h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md p-0 transition-all hover:shadow-md flex items-center justify-center",onMouseDown:e=>e.preventDefault()},{children:e(Yt,{className:"h-3 w-3 text-muted-foreground"})}))})),n(Bb,Object.assign({align:"start",side:"left",className:"w-48"},{children:[0===o&&n(t,{children:[n(Ub,Object.assign({onClick:g},{children:[e(fn,{className:"mr-2 h-4 w-4"}),"Header row"]})),e(Vb,{})]}),n(Ub,Object.assign({onClick:p},{children:[e(At,{className:"mr-2 h-4 w-4"}),"Insert row above"]})),n(Ub,Object.assign({onClick:h},{children:[e(Tt,{className:"mr-2 h-4 w-4"}),"Insert row below"]})),e(Vb,{}),n(Ub,Object.assign({onClick:f,className:"text-destructive focus:text-destructive"},{children:[e(gn,{className:"mr-2 h-4 w-4"}),"Delete row"]}))]}))]})}))}))},iv=({blockId:r})=>{const o=x(),i=l(()=>k.getBlockSlate(o,{id:r}),[r,o]),[a,s]=u(null),[h,f]=u(!1),[g,m]=u({rowControls:null,columnControls:null,addRowButton:null,addColumnButton:null}),b=d(!1),v=d(!1),w=d(null),y=d(null);y.current=a;const N=c(()=>{const e=y.current;if(!e)return void m({rowControls:null,columnControls:null,addRowButton:null,addColumnButton:null});const t=document.querySelector(`[data-yoopta-block-id="${r}"][data-table-container]`);if(!t)return;const n=t.querySelector("table");if(!n)return;const o=n.getBoundingClientRect(),i=Array.from(t.querySelectorAll("tr")),a=i[e.rowIndex];if(!a)return;const s=Array.from(a.querySelectorAll('[data-element-type="table-data-cell"]'));if(0===s.length)return;const l=s.map(e=>e.getBoundingClientRect()),c=Math.min(...l.map(e=>e.top)),d=Math.max(...l.map(e=>e.bottom)),u=Math.min(...l.map(e=>e.left)),p=Math.max(...l.map(e=>e.right)),h=d-c,f=[];i.forEach(t=>{const n=Array.from(t.querySelectorAll('[data-element-type="table-data-cell"]'));n[e.colIndex]&&f.push(n[e.colIndex].getBoundingClientRect())});const g=f.length>0?Math.min(...f.map(e=>e.left)):u,b=f.length>0?Math.max(...f.map(e=>e.right)):p,v=b-g,w=f.length>0?Math.min(...f.map(e=>e.top)):c,x=e.rowIndex===e.totalRows-1,k=e.colIndex===e.totalColumns-1;m({rowControls:{left:Math.max(0,u-32),top:c,height:h},columnControls:{left:g,top:w-32,width:v},addRowButton:x?{left:o.left,top:o.bottom,width:o.width}:null,addColumnButton:k?{left:o.right,top:o.top,height:o.height}:null})},[r]);p(()=>{if(!a||!h)return;const e=()=>{N()};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),N(),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[a,h,N]);const C=c(()=>{w.current&&(clearTimeout(w.current),w.current=null)},[]),O=c(()=>{C(),w.current=setTimeout(()=>{b.current||v.current||(f(!1),s(null))},150)},[C]),S=c(e=>{if(!i)return null;const t=Array.from(R.nodes(i,{at:[0],match:t=>{if(!P.isElement(t))return!1;const n=t;return"table-data-cell"===n.type&&"id"in n&&n.id===e},mode:"all"}));if(0===t.length)return null;const[,n]=t[0],r=n[n.length-2],o=n[n.length-1],a=Array.from(R.nodes(i,{at:[0],match:e=>P.isElement(e)&&"table"===e.type,mode:"lowest"}));if(0===a.length)return null;const[s]=a[0];if(!P.isElement(s))return null;const l=s.children.length,c=s.children[0];if(!P.isElement(c))return null;const d=c.children.length;return{rowIndex:r,colIndex:o,cellElementId:e,totalRows:l,totalColumns:d}},[i]);p(()=>{const e=document.querySelector(`[data-yoopta-block-id="${r}"][data-table-container]`);if(!e||!i)return;const t=e=>{C(),b.current=!0;const t=e.target.closest('[data-element-type="table-data-cell"]');if(!t)return;const n=t.getAttribute("data-yoopta-element-id");if(!n)return;const r=y.current;if((null==r?void 0:r.cellElementId)===n)return void f(!0);const o=S(n);o&&(s(o),f(!0))},n=()=>{b.current=!1,O()};return e.addEventListener("mousemove",t),e.addEventListener("mouseleave",n),()=>{C(),e.removeEventListener("mousemove",t),e.removeEventListener("mouseleave",n)}},[r,i,S,C,O]);const E=c(()=>{C(),v.current=!0},[C]),j=c(()=>{v.current=!1,O()},[O]);return h&&a?n(t,{children:[g.rowControls&&e(ov,{blockId:r,rowIndex:a.rowIndex,position:g.rowControls,onMouseEnter:E,onMouseLeave:j}),g.columnControls&&e(rv,{blockId:r,colIndex:a.colIndex,position:g.columnControls,onMouseEnter:E,onMouseLeave:j}),g.addColumnButton&&e(tv,{blockId:r,totalColumns:a.totalColumns,position:g.addColumnButton,onMouseEnter:E,onMouseLeave:j}),g.addRowButton&&e(nv,{blockId:r,totalRows:a.totalRows,position:g.addRowButton,onMouseEnter:E,onMouseLeave:j})]}):null},av=[{label:"None",value:"transparent",color:"transparent"},{label:"Gray",value:"hsl(var(--muted))",color:"hsl(var(--muted))"},{label:"Red",value:"hsl(0 70% 95%)",color:"hsl(0 70% 95%)"},{label:"Orange",value:"hsl(30 70% 95%)",color:"hsl(30 70% 95%)"},{label:"Yellow",value:"hsl(60 70% 95%)",color:"hsl(60 70% 95%)"},{label:"Green",value:"hsl(120 70% 95%)",color:"hsl(120 70% 95%)"},{label:"Blue",value:"hsl(210 70% 95%)",color:"hsl(210 70% 95%)"},{label:"Purple",value:"hsl(270 70% 95%)",color:"hsl(270 70% 95%)"}],sv=[{label:"Default",value:"inherit",color:"currentColor"},{label:"Gray",value:"hsl(var(--muted-foreground))",color:"hsl(var(--muted-foreground))"},{label:"Red",value:"hsl(0 70% 50%)",color:"hsl(0 70% 50%)"},{label:"Orange",value:"hsl(30 70% 50%)",color:"hsl(30 70% 50%)"},{label:"Yellow",value:"hsl(60 70% 40%)",color:"hsl(60 70% 40%)"},{label:"Green",value:"hsl(120 70% 40%)",color:"hsl(120 70% 40%)"},{label:"Blue",value:"hsl(210 70% 50%)",color:"hsl(210 70% 50%)"},{label:"Purple",value:"hsl(270 70% 50%)",color:"hsl(270 70% 50%)"}],lv=({blockId:r})=>{const o=x(),i=l(()=>k.getBlockSlate(o,{id:r}),[r,o]),[a,s]=u(null),[c,d]=u(!1),[h,f]=u([]),g=i?X.get(i):[];p(()=>{f(g)},[g]);const m=Array.isArray(g)&&(null==g?void 0:g.length)>0?g:h;p(()=>{if(!i||!m||m.length<=1)return void s(null);const e=document.querySelector(`[data-yoopta-block-id="${r}"]`);if(!e)return void s(null);const t=e.getBoundingClientRect();let n=1/0,o=-1/0,a=1/0,l=-1/0;for(const[e]of m){const t=document.querySelector(`[data-yoopta-block-id="${r}"] [data-yoopta-element-id="${e.id}"]`);if(!t)continue;const i=t.getBoundingClientRect();if(!i)continue;const{top:s,bottom:c,left:d,right:u}=i;n=Math.min(n,s),o=Math.max(o,c),a=Math.min(a,d),l=Math.max(l,u)}s(n!==1/0?{top:n-t.top,left:a-t.left,width:l-a,height:o-n}:null)},[i,m,r]),p(()=>{if(!m||m.length<=1)return;const e=()=>{s(e=>e?Object.assign({},e):null)};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[m]);const b=e=>{o&&m&&0!==m.length&&($.setCellHorizontalAlign(o,r,{cells:m,align:e}),d(!1))},v=e=>{o&&m&&0!==m.length&&($.setCellVerticalAlign(o,r,{cells:m,align:e}),d(!1))};return a?n(t,{children:[e("div",{className:"pointer-events-none absolute z-[9999]",style:{top:`${a.top}px`,left:`${a.left}px`,width:`${a.width}px`,height:`${a.height}px`,border:"2px solid hsl(var(--primary))",backgroundColor:"hsl(var(--primary) / 0.05)",borderRadius:"2px"}}),e("div",Object.assign({className:"absolute z-20 pointer-events-auto",style:{top:`${a.top+a.height/2}px`,left:`${a.left+a.width}px`,transform:"translate(-50%, -50%)"}},{children:n(Dl,Object.assign({open:c,onOpenChange:d},{children:[e(Pl,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"secondary",size:"icon",className:"h-4 w-4 rounded-full shadow-lg bg-primary hover:bg-primary/90",onMouseDown:e=>e.preventDefault()},{children:e(Yt,{className:"h-3 w-3 text-primary-foreground"})}))})),e(Ml,Object.assign({className:"w-64 p-2",align:"start",side:"right"},{children:n("div",Object.assign({className:"space-y-2"},{children:[n(co,Object.assign({variant:"ghost",size:"sm",className:"w-full justify-start gap-2",onClick:()=>{!o||!m||m.length<=1||($.mergeCells(o,r,{cells:m}),d(!1))},disabled:!m||m.length<=1},{children:[e(tn,{className:"h-4 w-4"}),"Merge cells"]})),e(Nd,{}),n("div",Object.assign({className:"space-y-1"},{children:[e(oh,Object.assign({className:"text-sm font-medium"},{children:"Color"})),n(Fb,{children:[e(Wb,Object.assign({asChild:!0},{children:n(co,Object.assign({variant:"outline",size:"sm",className:"w-full justify-between"},{children:[n("span",Object.assign({className:"flex items-center gap-2"},{children:[e(an,{className:"h-4 w-4"}),"Select color"]})),e(Ht,{className:"h-4 w-4 opacity-50"})]}))})),n(Bb,Object.assign({className:"w-56",align:"start"},{children:[n($b,{children:[n(Xb,{children:[e(an,{className:"mr-2 h-4 w-4"}),"Background color"]}),e(Yb,{children:av.map(t=>e(Ub,Object.assign({onClick:()=>(e=>{o&&m&&0!==m.length&&($.setCellBackgroundColor(o,r,{cells:m,color:e}),d(!1))})(t.value)},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",{className:"h-4 w-4 rounded border",style:{backgroundColor:t.color}}),t.label]}))}),t.value))})]}),n($b,{children:[n(Xb,{children:[e(mn,{className:"mr-2 h-4 w-4"}),"Text color"]}),e(Yb,{children:sv.map(t=>e(Ub,Object.assign({onClick:()=>(e=>{o&&m&&0!==m.length&&($.setCellTextColor(o,r,{cells:m,color:e}),d(!1))})(t.value)},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"h-4 w-4 rounded border flex items-center justify-center text-xs font-bold",style:{color:t.color}},{children:"A"})),t.label]}))}),t.value))})]})]}))]})]})),n("div",Object.assign({className:"space-y-1"},{children:[e(oh,Object.assign({className:"text-sm font-medium"},{children:"Alignment"})),n(Fb,{children:[e(Wb,Object.assign({asChild:!0},{children:n(co,Object.assign({variant:"outline",size:"sm",className:"w-full justify-between"},{children:[n("span",Object.assign({className:"flex items-center gap-2"},{children:[e(rn,{className:"h-4 w-4"}),"Select alignment"]})),e(Ht,{className:"h-4 w-4 opacity-50"})]}))})),n(Bb,Object.assign({className:"w-56",align:"start"},{children:[n($b,{children:[n(Xb,{children:[e(rn,{className:"mr-2 h-4 w-4"}),"Horizontal"]}),n(Yb,{children:[e(Ub,Object.assign({onClick:()=>b("left")},{children:"Left"})),e(Ub,Object.assign({onClick:()=>b("center")},{children:"Center"})),e(Ub,Object.assign({onClick:()=>b("right")},{children:"Right"})),e(Ub,Object.assign({onClick:()=>b("justify")},{children:"Justify"}))]})]}),n($b,{children:[n(Xb,{children:[e(on,{className:"mr-2 h-4 w-4"}),"Vertical"]}),n(Yb,{children:[e(Ub,Object.assign({onClick:()=>v("top")},{children:"Top"})),e(Ub,Object.assign({onClick:()=>v("middle")},{children:"Middle"})),e(Ub,Object.assign({onClick:()=>v("bottom")},{children:"Bottom"}))]})]})]}))]})]})),e(Nd,{}),n(co,Object.assign({variant:"ghost",size:"sm",className:"w-full justify-start gap-2 text-destructive hover:text-destructive",onClick:()=>{o&&m&&0!==m.length&&($.clearContents(o,r,{cells:m}),d(!1))}},{children:[e(qt,{className:"h-4 w-4"}),"Clear contents"]}))]}))}))]}))}))]}):null};re("[data-element-type=table-data-cell] [data-slate-node=element]{margin:0}[data-slate-node=table]{-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-slate-node=table-data-cell]{cursor:cell}[data-slate-node=table-data-cell]:active{cursor:crosshair}[data-is-selecting=true] ::-moz-selection{background:none}[data-is-selecting=true] ::selection{background:none}.column-resize-handle{transition:background-color .15s ease}.column-resize-handle:hover{background-color:hsl(var(--primary)/.3)!important}body.resizing-column{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}body.resizing-column,body.resizing-column *{cursor:col-resize!important}");const cv={table:{render:t=>{var r,o;const{attributes:i,children:a,element:s}=t,c=s,d=x(),u=l(()=>k.getBlockSlate(d,{id:t.blockId}),[d,t.blockId]),p=u?Y.get(u):null;return n("div",Object.assign({className:"p-4 overflow-x-auto","data-yoopta-block-id":t.blockId,"data-table-container":!0},{children:[n(qb,Object.assign({},i,{"data-is-selecting":!!p},{children:[e("colgroup",{children:null===(o=null===(r=c.props)||void 0===r?void 0:r.columnWidths)||void 0===o?void 0:o.map((t,n)=>e("col",{style:{width:`${t}px`}},n))}),e(Gb,{children:a})]})),e(lv,{blockId:t.blockId}),e(iv,{blockId:t.blockId}),e(ev,{blockId:t.blockId})]}))}},"table-row":{render:t=>{const{attributes:n,children:r}=t;return e(Zb,Object.assign({},n,{children:r}))}},"table-data-cell":{render:t=>{var n,r,o,i,a,s,c,d,u,p,h,f;const{attributes:g,children:m,element:b}=t,v=b,w=x(),y=l(()=>k.getBlockSlate(w,{id:t.blockId}),[w,t.blockId]),N=(null===(n=v.props)||void 0===n?void 0:n.asHeader)?Jb:Qb;return e(N,Object.assign({},g,{onMouseDown:e=>{e.stopPropagation(),y&&(X.delete(y),Y.delete(y))},colSpan:null!==(o=null===(r=v.props)||void 0===r?void 0:r.colSpan)&&void 0!==o?o:1,rowSpan:null!==(a=null===(i=v.props)||void 0===i?void 0:i.rowSpan)&&void 0!==a?a:1,align:null!==(c=null===(s=v.props)||void 0===s?void 0:s.align)&&void 0!==c?c:"left",valign:null!==(u=null===(d=v.props)||void 0===d?void 0:d.verticalAlign)&&void 0!==u?u:"middle","data-yoopta-element-id":v.id,className:mr("relative group transition-colors"),style:{backgroundColor:null===(p=v.props)||void 0===p?void 0:p.backgroundColor,color:null!==(f=null===(h=v.props)||void 0===h?void 0:h.color)&&void 0!==f?f:"inherit"}},{children:m}))}}},dv={"tabs-container":{render:t=>{var n;const{attributes:r,children:o,blockId:i,element:a}=t,s=x();return e(yc,Object.assign({},r,{value:null===(n=a.props)||void 0===n?void 0:n.activeTabId,onValueChange:e=>{const t=k.getBlockSlate(s,{id:i});t&&D.setNodes(t,{props:Object.assign(Object.assign({},a.props),{activeTabId:e})},{at:[0],match:e=>P.isElement(e)&&"tabs-container"===e.type})},className:"w-full"},{children:o}))}},"tabs-list":{render:t=>{const{attributes:r,children:o,blockId:i}=t,a=x();return n(dd,Object.assign({className:"w-full"},{children:[n(xc,Object.assign({},r,{className:"w-full relative justify-start"},{children:[o,e("button",Object.assign({type:"button",contentEditable:!1,onClick:e=>{e.preventDefault(),e.stopPropagation(),q.addTabItem(a,i)},className:"ml-1 flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1.5",title:"Add tab"},{children:e(cn,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}))]})),e(cd,{orientation:"horizontal"})]}))}},"tabs-item-heading":{render:t=>{const{attributes:r,children:o,element:i,blockId:a}=t,s=x();return n(kc,Object.assign({},r,{value:i.id,className:"relative group/tab flex items-center gap-2 pr-8 whitespace-nowrap"},{children:[e("div",Object.assign({className:"flex-1 min-w-0"},{children:o})),e("span",Object.assign({contentEditable:!1,onClick:()=>{q.deleteTabItem(s,a,{tabId:i.id})},className:"absolute right-1 flex items-center justify-center rounded-sm opacity-0 group-hover/tab:opacity-100 transition-opacity hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1",title:"Close tab"},{children:e(wn,{className:"h-3 w-3 shrink-0 text-muted-foreground"})}))]}))}},"tabs-item-content":{render:t=>{var n;const{attributes:r,children:o,element:i}=t;return e(Nc,Object.assign({},r,{value:null===(n=i.props)||void 0===n?void 0:n.referenceId,className:"mt-2"},{children:o}))}}},uv=({preview:t})=>e("div",Object.assign({className:"absolute inset-0 overflow-hidden flex items-center justify-center bg-black/5"},{children:e("video",{src:t.url,className:"max-w-full max-h-full object-contain",style:{maxWidth:t.width||"100%",maxHeight:t.height||"100%"},controls:!1,muted:!0,draggable:!1})})),pv=({progress:t})=>e("div",Object.assign({className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-4 bg-black/70 backdrop-blur-sm p-6"},{children:e("div",Object.assign({className:"w-full max-w-md space-y-4"},{children:n("div",Object.assign({className:"space-y-2"},{children:[n("div",Object.assign({className:"flex items-center justify-between text-sm"},{children:[e("span",Object.assign({className:"font-medium text-white"},{children:"Uploading video..."})),n("span",Object.assign({className:"text-white/80"},{children:[t.percentage,"%"]}))]})),e("div",Object.assign({className:"h-2 w-full overflow-hidden rounded-full bg-white/20"},{children:e("div",{className:"h-full bg-primary transition-all duration-300 ease-out",style:{width:`${t.percentage}%`}})})),n("div",Object.assign({className:"flex items-center justify-between text-xs text-white/60"},{children:[n("span",{children:[(t.loaded/1024/1024).toFixed(2)," MB /"," ",(t.total/1024/1024).toFixed(2)," MB"]}),e(en,{className:"h-3.5 w-3.5 animate-spin"})]}))]}))}))})),hv=({onUpload:t,hasPreview:r})=>{const o=d(null);return n("div",r?Object.assign({className:"flex flex-col items-center justify-center gap-4 py-8"},{children:[n("div",Object.assign({className:"text-center space-y-2"},{children:[e("p",Object.assign({className:"text-sm font-medium text-white"},{children:"Video preview"})),e("p",Object.assign({className:"text-xs text-white/80"},{children:"Uploading your video..."}))]})),e("input",{ref:o,type:"file",accept:"video/*",onChange:t,className:"hidden"})]}):Object.assign({className:"flex flex-col items-center gap-3 py-6"},{children:[e("div",Object.assign({className:"rounded-lg bg-muted p-3"},{children:e(vn,{className:"h-6 w-6 text-muted-foreground"})})),n("div",Object.assign({className:"text-center"},{children:[e("p",Object.assign({className:"text-sm font-medium"},{children:"Upload a video"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Click or drag and drop"}))]})),e(co,Object.assign({onClick:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.click()}},{children:"Choose file"})),e("input",{ref:o,type:"file",accept:"video/*",onChange:t,className:"hidden"})]}))},fv=({onInsertUrl:t})=>{const[r,o]=u(""),[i,a]=u(!1),[s,l]=u(null),c=()=>{r.trim()&&(t(r.trim()),o(""),a(!1),l(null))};return n("div",Object.assign({className:"mt-4 space-y-3"},{children:[n("div",Object.assign({className:"space-y-2"},{children:[e(So,{placeholder:"Paste video URL (YouTube, Vimeo, Dailymotion, Loom, Wistia)...",value:r,onChange:e=>(e=>{if(o(e),e.trim()){const t=G(e.trim());a(t.isValid),l(t.provider?t.provider.charAt(0).toUpperCase()+t.provider.slice(1):null)}else a(!1),l(null)})(e.target.value),onKeyDown:e=>{"Enter"===e.key&&r.trim()&&i&&c()}}),r.trim()&&e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:i?n("span",Object.assign({className:"flex items-center gap-1.5 text-green-600 dark:text-green-400"},{children:[e(ln,{className:"h-3 w-3"}),s," video detected"]})):e("span",Object.assign({className:"text-destructive"},{children:"Invalid video URL. Supported: YouTube, Vimeo, Dailymotion, Loom, Wistia"}))}))]})),e(co,Object.assign({className:"w-full",onClick:c,disabled:!r.trim()||!i},{children:i?`Embed ${s} video`:"Embed video"}))]}))},gv=({onUpload:t,onInsertUrl:r,hasPreview:o})=>e("div",Object.assign({className:mr("relative p-4",o&&"min-h-[300px] flex flex-col")},{children:n(yc,Object.assign({defaultValue:"upload",className:"w-full"},{children:[n(xc,Object.assign({className:mr("grid w-full grid-cols-2",o&&"bg-background/80 backdrop-blur-sm")},{children:[n(kc,Object.assign({value:"upload",className:"gap-1.5"},{children:[e(bn,{className:"h-3.5 w-3.5"}),"Upload"]})),n(kc,Object.assign({value:"link",className:"gap-1.5"},{children:[e(Qt,{className:"h-3.5 w-3.5"}),"Link"]}))]})),e(Nc,Object.assign({value:"upload",className:"mt-4"},{children:e(hv,{onUpload:t,hasPreview:o})})),e(Nc,Object.assign({value:"link"},{children:e(fv,{onInsertUrl:r})}))]}))})),mv=({onUpload:t,onInsertUrl:r,className:o,attributes:i,children:a,preview:s,progress:l,loading:c})=>{const d=null!==s&&!!s.url,u=c&&l;return n("div",Object.assign({className:mr("mt-2 relative rounded-lg border bg-background overflow-hidden",d&&"min-h-[300px]",o)},i,{contentEditable:!1},{children:[d&&e(uv,{preview:s}),!d&&e(gv,{onUpload:t,onInsertUrl:r,hasPreview:d}),u&&l&&e(pv,{progress:l}),a]}))};var bv="Switch",[vv,wv]=se(bv),[yv,xv]=vv(bv),kv=r.forwardRef((t,o)=>{const{__scopeSwitch:i,name:a,checked:s,defaultChecked:l,required:c,disabled:d,value:u="on",onCheckedChange:p,form:h,...f}=t,[g,m]=r.useState(null),b=ue(o,e=>m(e)),v=r.useRef(!1),w=!g||(h||!!g.closest("form")),[y,x]=ye({prop:s,defaultProp:l??!1,onChange:p,caller:bv});return n(yv,{scope:i,checked:y,disabled:d,children:[e(xe.button,{type:"button",role:"switch","aria-checked":y,"aria-required":c,"data-state":Sv(y),"data-disabled":d?"":void 0,disabled:d,value:u,...f,ref:b,onClick:be(t.onClick,e=>{x(e=>!e),w&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),w&&e(Ov,{control:g,bubbles:!v.current,name:a,value:u,checked:y,required:c,disabled:d,form:h,style:{transform:"translateX(-100%)"}})]})});kv.displayName=bv;var Nv="SwitchThumb",Cv=r.forwardRef((t,n)=>{const{__scopeSwitch:r,...o}=t,i=xv(Nv,r);return e(xe.span,{"data-state":Sv(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:n})});Cv.displayName=Nv;var Ov=r.forwardRef(({__scopeSwitch:t,control:n,checked:o,bubbles:i=!0,...a},s)=>{const l=r.useRef(null),c=ue(l,s),d=ih(o),u=Va(n);return r.useEffect(()=>{const e=l.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:i});n.call(e,o),e.dispatchEvent(t)}},[d,o,i]),e("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...a,tabIndex:-1,ref:c,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Sv(e){return e?"checked":"unchecked"}Ov.displayName="SwitchBubbleInput";var Ev=kv,jv=Cv;const Rv=r.forwardRef((t,n)=>{var{className:r}=t,o=ie(t,["className"]);return e(Ev,Object.assign({className:mr("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",r)},o,{ref:n},{children:e(jv,{className:mr("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}))});Rv.displayName=Ev.displayName;const zv={contain:{label:"Contain",description:"Fit within bounds"},cover:{label:"Cover",description:"Fill and crop"},fill:{label:"Fill",description:"Stretch to fit"}},Dv=({fit:t,settings:r,onUpdate:o})=>{var i,a,s,l,c,d,p,h,f,g,m,b;const[v,w]=u(!1),y=e=>{o({settings:Object.assign(Object.assign({},r),e)})};return n(Dl,Object.assign({open:v,onOpenChange:w},{children:[e(du,{children:n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(Pl,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:v?"secondary":"ghost",size:"icon",className:"h-7 w-7"},{children:e(pn,{className:"h-4 w-4"})}))}))})),e(hu,{children:"Settings"})]})}),e(Ml,Object.assign({className:"w-80 p-3",align:"start",contentEditable:!1,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},{children:n("div",Object.assign({className:"space-y-3"},{children:[n("div",{children:[e("h4",Object.assign({className:"font-semibold"},{children:"Video settings"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Customize video playback and display"}))]}),e(Nd,{}),n("div",Object.assign({className:"space-y-1"},{children:[e(oh,Object.assign({htmlFor:"object-fit",className:"text-sm font-medium"},{children:"How video fits"})),n(kf,Object.assign({value:t||"contain",onValueChange:e=>o({fit:e})},{children:[e(Of,Object.assign({id:"object-fit",className:"h-9 w-full"},{children:e(Cf,Object.assign({placeholder:"Select how video fits"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(i=zv[t||"contain"])||void 0===i?void 0:i.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(a=zv[t||"contain"])||void 0===a?void 0:a.description}))]}))}))})),e(jf,{children:n(Nf,{children:[e(Rf,Object.assign({value:"contain",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-4 w-3 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(s=zv.contain)||void 0===s?void 0:s.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(l=zv.contain)||void 0===l?void 0:l.description}))]}))]}))})),e(Rf,Object.assign({value:"cover",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-8 w-6 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(c=zv.cover)||void 0===c?void 0:c.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(d=zv.cover)||void 0===d?void 0:d.description}))]}))]}))})),e(Rf,Object.assign({value:"fill",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-8 w-8 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(p=zv.fill)||void 0===p?void 0:p.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(h=zv.fill)||void 0===h?void 0:h.description}))]}))]}))}))]})})]}))]})),e(Nd,{}),n("div",Object.assign({className:"space-y-3"},{children:[n("div",Object.assign({className:"flex items-center justify-between"},{children:[n("div",Object.assign({className:"space-y-0.5"},{children:[e(oh,Object.assign({htmlFor:"controls",className:"text-sm font-medium"},{children:"Show controls"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Display video player controls"}))]})),e(Rv,{id:"controls",checked:null!==(f=r.controls)&&void 0!==f&&f,onCheckedChange:e=>y({controls:e})})]})),n("div",Object.assign({className:"flex items-center justify-between"},{children:[n("div",Object.assign({className:"space-y-0.5"},{children:[e(oh,Object.assign({htmlFor:"loop",className:"text-sm font-medium"},{children:"Loop video"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Automatically replay when finished"}))]})),e(Rv,{id:"loop",checked:null!==(g=r.loop)&&void 0!==g&&g,onCheckedChange:e=>y({loop:e})})]})),n("div",Object.assign({className:"flex items-center justify-between"},{children:[n("div",Object.assign({className:"space-y-0.5"},{children:[e(oh,Object.assign({htmlFor:"muted",className:"text-sm font-medium"},{children:"Muted"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Start video without sound"}))]})),e(Rv,{id:"muted",checked:null!==(m=r.muted)&&void 0!==m&&m,onCheckedChange:e=>y({muted:e})})]})),n("div",Object.assign({className:"flex items-center justify-between"},{children:[n("div",Object.assign({className:"space-y-0.5"},{children:[e(oh,Object.assign({htmlFor:"autoplay",className:"text-sm font-medium"},{children:"Autoplay"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Start playing automatically (may require muted)"}))]})),e(Rv,{id:"autoplay",checked:null!==(b=r.autoPlay)&&void 0!==b&&b,onCheckedChange:e=>y({autoPlay:e})})]}))]}))]}))}))]}))},Pv=({referenceRef:r,elementProps:o,onUpdate:i,onReplace:a,onDelete:s,onDownload:l,onCopy:c})=>{var d,h;const[f,g]=u(!1),m=o.provider&&o.provider.type,b="alignment"in o,{refs:v,floatingStyles:w}=Yp({placement:"top",strategy:"fixed",middleware:[Ta(8),Fa(),_a({padding:10})],whileElementsMounted:ba});p(()=>{requestAnimationFrame(()=>{g(!0)})},[]),p(()=>{const e=r.current;e&&v.setReference(e)},[r,v]);return e("div",Object.assign({ref:v.setFloating,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),className:mr("pointer-events-auto","flex items-center gap-1 rounded-lg border bg-background/95 backdrop-blur-sm p-1 shadow-lg","transition-all duration-200 ease-out",f?"opacity-100 translate-y-0":"opacity-0 translate-y-2"),style:w},{children:n(du,Object.assign({delayDuration:0},{children:[b&&n("div",Object.assign({className:"flex items-center gap-0.5 border-r pr-1"},{children:[n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"left"===o.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>i({alignment:"left"})},{children:e(Pt,{className:"h-4 w-4"})}))})),e(hu,{children:"Align left"})]}),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"center"===o.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>i({alignment:"center"})},{children:e(Dt,{className:"h-4 w-4"})}))})),e(hu,{children:"Align center"})]}),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"right"===o.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>i({alignment:"right"})},{children:e(Mt,{className:"h-4 w-4"})}))})),e(hu,{children:"Align right"})]})]})),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a},{children:e(dn,{className:"h-4 w-4"})}))})),e(hu,{children:"Replace"})]}),!m&&o.src&&n(t,{children:[n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{if(l)l();else if(o.src&&!m){const e=document.createElement("a");e.href=o.src,e.download=`video-${Date.now()}.mp4`,e.click()}}},{children:e(Xt,{className:"h-4 w-4"})}))})),e(hu,{children:"Download"})]}),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{c?c():o.src&&Co(o.src)}},{children:e($t,{className:"h-4 w-4"})}))})),e(hu,{children:"Copy URL"})]})]}),m&&(null===(d=o.provider)||void 0===d?void 0:d.url)&&n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{var e;(null===(e=o.provider)||void 0===e?void 0:e.url)&&window.open(o.provider.url,"_blank")}},{children:e(Gt,{className:"h-4 w-4"})}))})),e(hu,{children:"Open in new tab"})]}),!m&&n(t,{children:[e(Nd,{orientation:"vertical",className:"h-4"}),e(Dv,{fit:null!==(h=o.fit)&&void 0!==h?h:"contain",settings:o.settings||{controls:!1,loop:!1,muted:!1,autoPlay:!1},onUpdate:i})]}),n(uu,{children:[e(pu,Object.assign({asChild:!0},{children:e(co,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:s},{children:e(gn,{className:"h-4 w-4"})}))})),e(hu,{children:"Delete"})]})]}))}))},Mv=({blockId:t,attributes:r,children:o,elementProps:i,onUpdate:a,onDelete:s,onReplace:l,pluginOptions:c})=>{var h,f,g,m;const[b,v]=u(i.sizes||{width:650,height:400}),{isElementSelected:w}=O(),y=S({blockId:t}),k=w&&y,N=d(null),C=x(),[E,j]=u(()=>{var e;const t=(null===(e=C.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,n=null==c?void 0:c.maxSizes;return{maxWidth:(null==n?void 0:n.maxWidth)?"number"==typeof n.maxWidth?n.maxWidth:parseInt(String(n.maxWidth).replace(/[^\d]/g,""),10):t,maxHeight:(null==n?void 0:n.maxHeight)?"number"==typeof n.maxHeight?n.maxHeight:parseInt(String(n.maxHeight).replace(/[^\d]/g,""),10):550}});p(()=>{const e=()=>{var e;const t=(null===(e=C.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,n=null==c?void 0:c.maxSizes;j({maxWidth:(null==n?void 0:n.maxWidth)?"number"==typeof n.maxWidth?n.maxWidth:parseInt(String(n.maxWidth).replace(/[^\d]/g,""),10):t,maxHeight:(null==n?void 0:n.maxHeight)?"number"==typeof n.maxHeight?n.maxHeight:parseInt(String(n.maxHeight).replace(/[^\d]/g,""),10):550})};e();const t=new ResizeObserver(e);return C.refElement&&t.observe(C.refElement),window.addEventListener("resize",e),()=>{t.disconnect(),window.removeEventListener("resize",e)}},[C,c]);const R=(e,t)=>{const n=e=>"number"==typeof e?e:parseInt(String(e).replace(/[^\d]/g,""),10),r=n(e.width),o=n(e.height),i=n(t.width),a=n(t.height);if(r<=i&&o<=a)return{width:r,height:o};const s=r/i,l=o/a,c=Math.max(s,l),d=Math.round(r/c),u=Math.round(o/c);return{width:Math.min(d,i),height:Math.min(u,a)}},z=i.provider&&i.provider.type,D=i.src||"",P=z&&(null===(h=i.provider)||void 0===h?void 0:h.id)?Z(i.provider.type,i.provider.id):null,M=i.settings||{controls:!0,loop:!1,muted:!1,autoPlay:!1},T={left:"justify-start",center:"justify-center",right:"justify-end"}[null!==(f=i.alignment)&&void 0!==f?f:"center"];return n("div",Object.assign({},r,{className:mr("group/video mt-2 relative transition-all w-full flex",T)},{children:[n("div",Object.assign({className:"relative",contentEditable:!1},{children:[e(Ip,Object.assign({ref:e=>{(null==e?void 0:e.resizableElement)&&e.resizableElement instanceof HTMLElement&&(N.current=e.resizableElement)},style:{position:"relative",outline:k?".125rem solid rgba(0, 0, 0, 0)":"none",outlineColor:k?"hsl(var(--primary))":"none"},size:{width:"number"==typeof b.width?b.width:parseInt(String(b.width),10),height:"number"==typeof b.height?b.height:parseInt(String(b.height),10)},onResize:(e,t,n)=>{const r=parseInt(n.style.width,10),o=parseInt(n.style.height,10),i=R({width:r,height:o},{width:E.maxWidth,height:E.maxHeight});v(i)},onResizeStop:(e,t,n)=>{const r=parseInt(n.style.width,10),o=parseInt(n.style.height,10),i=R({width:r,height:o},{width:E.maxWidth,height:E.maxHeight});a({sizes:i})},lockAspectRatio:!0,minWidth:200,minHeight:150,maxWidth:E.maxWidth,maxHeight:E.maxHeight,enableResizing:!!k&&{bottom:!1,bottomLeft:!1,bottomRight:!1,left:!0,right:!0,top:!1,topLeft:!1,topRight:!1},disableDragging:!0,resizeHandleStyles:{left:{width:"auto",height:"40px",left:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"},right:{width:"auto",height:"40px",right:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"}},resizeHandleComponent:{left:e("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"}),right:e("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"})},className:mr("rounded-sm overflow-hidden")},{children:z&&P?e("iframe",{title:i.provider.type,src:P,width:"100%",height:"100%",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full",style:{aspectRatio:`${b.width} / ${b.height}`}}):e("video",{title:"Video",src:D,controls:M.controls,loop:M.loop,muted:M.muted,autoPlay:M.autoPlay,poster:null!==(g=i.poster)&&void 0!==g?g:void 0,className:"w-full h-full transition-all duration-200",style:{objectFit:null!==(m=i.fit)&&void 0!==m?m:"contain"},draggable:!1})})),k&&e(Pv,{referenceRef:N,elementProps:i,onUpdate:a,onReplace:l,onDelete:s,onDownload:()=>ae(void 0,void 0,void 0,function*(){if(i.src&&!z)try{const e=yield fetch(i.src),t=yield e.blob(),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=`video-${Date.now()}.mp4`,r.click(),URL.revokeObjectURL(n)}catch(e){}}),onCopy:()=>ae(void 0,void 0,void 0,function*(){var e;if(i.src)try{if(z&&(null===(e=i.provider)||void 0===e?void 0:e.url)){const{default:e}=yield Promise.resolve().then(function(){return Oo});e(i.provider.url)}else{const e=yield fetch(i.src),t=yield e.blob();if(navigator.clipboard&&ClipboardItem)yield navigator.clipboard.write([new ClipboardItem({[t.type]:t})]);else{const{default:e}=yield Promise.resolve().then(function(){return Oo});e(i.src)}}}catch(e){const{default:t}=yield Promise.resolve().then(function(){return Oo});t(i.src||"")}})})]})),o]}))},Tv={video:{render:({element:t,attributes:n,children:r,blockId:o})=>{const i=x(),a=E("Video"),{upload:s,progress:l,loading:d}=J(a.upload),{deleteVideo:u}=Q(a.delete),{preview:p,generatePreview:h,clearPreview:f}=ee(),g=c(e=>{N.updateElement(i,{blockId:o,type:"video",props:Object.assign(Object.assign({},t.props),e)})},[i,o,t.props]),m=c(()=>ae(void 0,void 0,void 0,function*(){yield u(t);const e=k.getBlockSlate(i,{id:o});if(!e)return;const n=N.getElementPath(i,{blockId:o,element:t});if(!n)return;const r=n?R.parent(e,n):void 0;r&&P.isElement(r[0])&&!R.isEditor(r[0])?N.deleteElement(i,{blockId:o,type:"video",path:n}):k.deleteBlock(i,{blockId:o,focus:!0})}),[i,o,t,u]),b=c(()=>{N.updateElement(i,{blockId:o,type:"video",props:Object.assign(Object.assign({},t.props),{src:null,provider:null})})},[i,o,t.props]),v=c(e=>ae(void 0,void 0,void 0,function*(){var n;const r=null===(n=e.target.files)||void 0===n?void 0:n[0];if(!r)return;h(r);const o=yield s(r);g({id:o.id||o.fileId,src:o.url,sizes:o.width&&o.height?{width:o.width,height:o.height}:t.props.sizes||{width:650,height:400},provider:o.provider||null,poster:o.poster||null}),f()}),[s,g,h,f,t.props.sizes]),w=c(e=>ae(void 0,void 0,void 0,function*(){const n=G(e);if(n.isValid&&n.provider){const r=te(e);g({src:n.embedUrl,provider:r,sizes:t.props.sizes||{width:650,height:400}})}else e.trim()&&g({src:e.trim(),provider:null,sizes:t.props.sizes||{width:650,height:400}})}),[g,t.props.sizes]);return t.props.src||t.props.provider?e(Mv,Object.assign({blockId:o,elementId:t.id,onUpdate:g,onDelete:m,attributes:n,onReplace:b,elementProps:t.props,pluginOptions:a},{children:r})):e(mv,Object.assign({onUpload:v,preview:p,progress:l,loading:d,onInsertUrl:w,attributes:n},{children:r}))}}};function _v(e,t){const n={Accordion:yn,Paragraph:Vg,Blockquote:xn,Callout:vr,Table:cv,Link:Wg,HeadingOne:Od.HeadingOne,HeadingTwo:Od.HeadingTwo,HeadingThree:Od.HeadingThree,BulletedList:Ug.BulletedList,NumberedList:Ug.NumberedList,TodoList:Ug.TodoList,Image:pg,Video:Tv,Code:Al,Tabs:dv,CodeGroup:ud,Steps:Kb,Carousel:yo,Divider:Cd};return e.map(e=>{var r;const o=e.getPlugin.type,i=n[o];if(!i)return e;const a=null==t?void 0:t[o],s=null!==(r=null==a?void 0:a.elements)&&void 0!==r?r:i;return e.extend(Object.assign({elements:s},a&&{injectElementsFromPlugins:a.injectElementsFromPlugins,events:a.events,options:a.options}))})}export{yn as AccordionUI,xn as BlockquoteUI,vr as CalloutUI,Al as CodeUI,Cd as DividerUI,Od as HeadingsUI,pg as ImageUI,Wg as LinkUI,Ug as ListsUI,Vg as ParagraphUI,Kb as StepsUI,cv as TableUI,dv as TabsUI,Tv as VideoUI,_v as default};
|
|
26
|
+
*/le("[data-element-type=accordion-list-item-content] [data-slate-node=element],[data-element-type=accordion-list-item-heading] [data-slate-node=element]{margin:0}");const En={"accordion-list":{render:t=>{const{attributes:n,children:r,blockId:o,element:i}=t,a=x(),s=l(()=>{const e=[];return i.children.forEach(t=>{var n;"accordion-list-item"===t.type&&(null===(n=t.props)||void 0===n?void 0:n.isExpanded)&&e.push(t.id)}),e},[i]);return e(Et,Object.assign({},n,{type:"multiple",value:s,onValueChange:e=>{const t=k.getBlockSlate(a,{id:o});if(!t)return;const n=R.nodes(t,{match:e=>P.isElement(e)&&"accordion-list-item"===e.type});R.withoutNormalizing(t,()=>{var r;for(const[o,i]of n){const n=o,a=n.id,s=e.includes(a);(null===(r=n.props)||void 0===r?void 0:r.isExpanded)!==s&&D.setNodes(t,{props:Object.assign(Object.assign({},n.props),{isExpanded:s})},{at:i})}})},className:"w-full rounded-md border"},{children:r}))}},"accordion-list-item":{render:t=>{var n;const{attributes:r,children:o,element:i}=t;return e(Rt,Object.assign({value:i.id,"data-state":(null===(n=i.props)||void 0===n?void 0:n.isExpanded)?"open":"closed"},r,{children:o}))}},"accordion-list-item-heading":{render:t=>{var r,o;const{attributes:i,children:a,element:d,blockId:u}=t,p=x(),[,h]=s(e=>e+1,0),f=l(()=>{const e=k.getBlockSlate(p,{id:u});if(e)try{const t=N.getElementPath(p,{blockId:u,element:d});return R.parent(e,t)[0]}catch(e){}},[p,u,d]),g=l(()=>{if(!f)return;if(k.getBlockSlate(p,{id:u}))try{return N.getElementPath(p,{blockId:u,element:f})}catch(e){}},[p,u,f]),m=null!==(o=null===(r=null==f?void 0:f.props)||void 0===r?void 0:r.isExpanded)&&void 0!==o&&o,b=c(()=>{f&&g&&N.updateElement(p,{blockId:u,type:f.type,props:Object.assign(Object.assign({},f.props),{isExpanded:!m}),path:g}),h()},[p,u,f,g,m]),v=c(e=>{if(e.preventDefault(),e.stopPropagation(),!f||!g)return;const t=N.getElementChildren(p,{blockId:u,type:"accordion-list"});1!==(null==t?void 0:t.length)?N.deleteElement(p,{blockId:u,type:"accordion-list-item",path:g}):k.deleteBlock(p,{blockId:u})},[p,u,f,g]),w=c(e=>{e.preventDefault(),e.stopPropagation();const t=k.getBlockSlate(p,{id:u});if(!t||!g)return;const n=p.y("accordion-list-item",{props:{isExpanded:!1},children:[p.y("accordion-list-item-heading"),p.y("accordion-list-item-content")]});R.withoutNormalizing(t,()=>{const e=z.next(g);D.insertNodes(t,n,{at:e});const r=[...e,0,0];setTimeout(()=>{D.select(t,{offset:0,path:r})},0)})},[p,u,g]);return n("div",Object.assign({},i,{className:"flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all px-5"},{children:[e("div",Object.assign({className:"flex-1 min-w-0"},{children:a})),n("div",Object.assign({className:"flex shrink-0 items-center gap-1",contentEditable:!1},{children:[e("button",Object.assign({type:"button",contentEditable:!1,onClick:w,className:"flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1",title:"Add accordion item"},{children:e(bn,{className:"h-4 w-4 shrink-0 text-muted-foreground"})})),e("button",Object.assign({type:"button",contentEditable:!1,onClick:v,className:"flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1",title:"Delete accordion item"},{children:e(Nn,{className:"h-4 w-4 shrink-0 text-muted-foreground"})})),e(zt,Object.assign({type:"button",contentEditable:!1,"data-slot":"accordion-trigger",onClick:b,className:"flex shrink-0 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},{children:e(Vt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 "+(m?"rotate-180":"")})}))]}))]}))}},"accordion-list-item-content":{render:t=>{const{attributes:n,children:r}=t;return e(Dt,Object.assign({},n,{className:"text-muted-foreground px-5"},{children:r}))}}},Rn={blockquote:{render:t=>{const{attributes:n,children:r}=t;return e("blockquote",Object.assign({},n,{className:"mt-6 border-l-2 pl-6"},{children:r}))}}};function zn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=zn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Dn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=zn(e))&&(r&&(r+=" "),r+=t);return r}const Pn=e=>{const t=_n(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),Mn(n,t)||In(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},Mn=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Mn(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const i=e.join("-");return t.validators.find(({validator:e})=>e(i))?.classGroupId},Tn=/^\[(.+)\]$/,In=e=>{if(Tn.test(e)){const t=Tn.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},_n=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Fn(Object.entries(e.classGroups),n).forEach(([e,n])=>{An(n,r,e,t)}),r},An=(e,t,n,r)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Ln(t,e)).classGroupId=n)}if("function"==typeof e)return Hn(e)?void An(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,o])=>{An(o,Ln(t,e),n,r)})})},Ln=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Hn=e=>e.isThemeGetter,Fn=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,Wn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},Bn=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],i=t.length,a=e=>{const n=[];let a,s=0,l=0;for(let c=0;c<e.length;c++){let d=e[c];if(0===s){if(d===o&&(r||e.slice(c,c+i)===t)){n.push(e.slice(l,c)),l=c+i;continue}if("/"===d){a=c;continue}}"["===d?s++:"]"===d&&s--}const c=0===n.length?e:e.substring(l),d=c.startsWith("!");return{modifiers:n,hasImportantModifier:d,baseClassName:d?c.substring(1):c,maybePostfixModifierPosition:a&&a>l?a-l:void 0}};return n?e=>n({className:e,parseClassName:a}):a},Un=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},Vn=/\s+/;function $n(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Xn(e))&&(r&&(r+=" "),r+=t);return r}const Xn=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Xn(e[r]))&&(n&&(n+=" "),n+=t);return n};function Yn(e,...t){let n,r,o,i=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Wn(e.cacheSize),parseClassName:Bn(e),...Pn(e)}))(l),r=n.cache.get,o=n.cache.set,i=a,a(s)};function a(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(Vn);let s="";for(let e=a.length-1;e>=0;e-=1){const t=a[e],{modifiers:l,hasImportantModifier:c,baseClassName:d,maybePostfixModifierPosition:u}=n(t);let p=Boolean(u),h=r(p?d.substring(0,u):d);if(!h){if(!p){s=t+(s.length>0?" "+s:s);continue}if(h=r(d),!h){s=t+(s.length>0?" "+s:s);continue}p=!1}const f=Un(l).join(":"),g=c?f+"!":f,m=g+h;if(i.includes(m))continue;i.push(m);const b=o(h,p);for(let e=0;e<b.length;++e){const t=b[e];i.push(g+t)}s=t+(s.length>0?" "+s:s)}return s})(e,n);return o(e,i),i}return function(){return i($n.apply(null,arguments))}}const Kn=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},qn=/^\[(?:([a-z-]+):)?(.+)\]$/i,Gn=/^\d+\/\d+$/,Zn=new Set(["px","full","screen"]),Jn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,er=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,tr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,rr=e=>ir(e)||Zn.has(e)||Gn.test(e),or=e=>vr(e,"length",wr),ir=e=>Boolean(e)&&!Number.isNaN(Number(e)),ar=e=>vr(e,"number",ir),sr=e=>Boolean(e)&&Number.isInteger(Number(e)),lr=e=>e.endsWith("%")&&ir(e.slice(0,-1)),cr=e=>qn.test(e),dr=e=>Jn.test(e),ur=new Set(["length","size","percentage"]),pr=e=>vr(e,ur,yr),hr=e=>vr(e,"position",yr),fr=new Set(["image","url"]),gr=e=>vr(e,fr,kr),mr=e=>vr(e,"",xr),br=()=>!0,vr=(e,t,n)=>{const r=qn.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},wr=e=>Qn.test(e)&&!er.test(e),yr=()=>!1,xr=e=>tr.test(e),kr=e=>nr.test(e),Nr=Yn(()=>{const e=Kn("colors"),t=Kn("spacing"),n=Kn("blur"),r=Kn("brightness"),o=Kn("borderColor"),i=Kn("borderRadius"),a=Kn("borderSpacing"),s=Kn("borderWidth"),l=Kn("contrast"),c=Kn("grayscale"),d=Kn("hueRotate"),u=Kn("invert"),p=Kn("gap"),h=Kn("gradientColorStops"),f=Kn("gradientColorStopPositions"),g=Kn("inset"),m=Kn("margin"),b=Kn("opacity"),v=Kn("padding"),w=Kn("saturate"),y=Kn("scale"),x=Kn("sepia"),k=Kn("skew"),N=Kn("space"),O=Kn("translate"),C=()=>["auto",cr,t],S=()=>[cr,t],j=()=>["",rr,or],E=()=>["auto",ir,cr],R=()=>["","0",cr],z=()=>[ir,cr];return{cacheSize:500,separator:":",theme:{colors:[br],spacing:[rr,or],blur:["none","",dr,cr],brightness:z(),borderColor:[e],borderRadius:["none","","full",dr,cr],borderSpacing:S(),borderWidth:j(),contrast:z(),grayscale:R(),hueRotate:z(),invert:R(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[lr,or],inset:C(),margin:C(),opacity:z(),padding:S(),saturate:z(),scale:z(),sepia:R(),skew:z(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",cr]}],container:["container"],columns:[{columns:[dr]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",cr]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",sr,cr]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",cr]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",sr,cr]}],"grid-cols":[{"grid-cols":[br]}],"col-start-end":[{col:["auto",{span:["full",sr,cr]},cr]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[br]}],"row-start-end":[{row:["auto",{span:[sr,cr]},cr]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",cr]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",cr]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",cr,t]}],"min-w":[{"min-w":[cr,t,"min","max","fit"]}],"max-w":[{"max-w":[cr,t,"none","full","min","max","fit","prose",{screen:[dr]},dr]}],h:[{h:[cr,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[cr,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[cr,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[cr,t,"auto","min","max","fit"]}],"font-size":[{text:["base",dr,or]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ar]}],"font-family":[{font:[br]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",cr]}],"line-clamp":[{"line-clamp":["none",ir,ar]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",rr,cr]}],"list-image":[{"list-image":["none",cr]}],"list-style-type":[{list:["none","disc","decimal",cr]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",rr,or]}],"underline-offset":[{"underline-offset":["auto",rr,cr]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",cr]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",cr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",hr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[rr,cr]}],"outline-w":[{outline:[rr,or]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[rr,or]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",dr,mr]}],"shadow-color":[{shadow:[br]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",dr,cr]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[w]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",cr]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",cr]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",cr]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[sr,cr]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",cr]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",cr]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",cr]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[rr,or,ar]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Or(...e){return Nr(Dn(e))}const Cr=(e="default")=>({default:"bg-muted text-muted-foreground border-muted-foreground/20",info:"bg-blue-50 text-blue-900 border-blue-200 dark:bg-blue-950 dark:text-blue-100 dark:border-blue-800",success:"bg-green-50 text-green-900 border-green-200 dark:bg-green-950 dark:text-green-100 dark:border-green-800",warning:"bg-yellow-50 text-yellow-900 border-yellow-200 dark:bg-yellow-950 dark:text-yellow-100 dark:border-yellow-800",error:"bg-red-50 text-red-900 border-red-200 dark:bg-red-950 dark:text-red-100 dark:border-red-800"}[e]);e(dn,{className:"h-4 w-4"}),e(on,{className:"h-4 w-4 text-blue-500"}),e(Kt,{className:"h-4 w-4 text-green-500"}),e(Yt,{className:"h-4 w-4 text-yellow-500"}),e(qt,{className:"h-4 w-4 text-red-500"});const Sr={callout:{render:t=>{var n,r;const{attributes:o,children:i,element:a}=t,s=null!==(r=null===(n=a.props)||void 0===n?void 0:n.theme)&&void 0!==r?r:"default";return e("div",Object.assign({},o,{className:Or("group relative rounded-lg border-l-4 p-4 [&>p]:m-0 [&>p]:text-sm",Cr(s))},{children:i}))}}};function jr(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function Er(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&n.every(n=>{const r=e[n],o=t[n];return"function"==typeof r?`${r}`==`${o}`:jr(r)&&jr(o)?Er(r,o):r===o})}function Rr(e){return e.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function zr(e){return"number"==typeof e}function Dr(e){return"string"==typeof e}function Pr(e){return"boolean"==typeof e}function Mr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Tr(e){return Math.abs(e)}function Ir(e){return Math.sign(e)}function _r(e,t){return Tr(e-t)}function Ar(e){return Br(e).map(Number)}function Lr(e){return e[Hr(e)]}function Hr(e){return Math.max(0,e.length-1)}function Fr(e,t){return t===Hr(e)}function Wr(e,t=0){return Array.from(Array(e),(e,n)=>t+n)}function Br(e){return Object.keys(e)}function Ur(e,t){return[e,t].reduce((e,t)=>(Br(t).forEach(n=>{const r=e[n],o=t[n],i=Mr(r)&&Mr(o);e[n]=i?Ur(r,o):o}),e),{})}function Vr(e,t){return void 0!==t.MouseEvent&&e instanceof t.MouseEvent}function $r(){let e=[];const t={add:function(n,r,o,i={passive:!0}){let a;if("addEventListener"in n)n.addEventListener(r,o,i),a=()=>n.removeEventListener(r,o,i);else{const e=n;e.addListener(o),a=()=>e.removeListener(o)}return e.push(a),t},clear:function(){e=e.filter(e=>e())}};return t}function Xr(e,t,n,r){const o=$r(),i=1e3/60;let a=null,s=0,l=0;function c(e){if(!l)return;a||(a=e,n(),n());const o=e-a;for(a=e,s+=o;s>=i;)n(),s-=i;r(s/i),l&&(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),a=null,s=0,l=0}return{init:function(){o.add(e,"visibilitychange",()=>{e.hidden&&(a=null,s=0)})},destroy:function(){d(),o.clear()},start:function(){l||(l=t.requestAnimationFrame(c))},stop:d,update:n,render:r}}function Yr(e=0,t=0){const n=Tr(e-t);function r(t){return t<e}function o(e){return e>t}function i(e){return r(e)||o(e)}return{length:n,max:t,min:e,constrain:function(n){return i(n)?r(n)?e:t:n},reachedAny:i,reachedMax:o,reachedMin:r,removeOffset:function(e){return n?e-n*Math.ceil((e-t)/n):e}}}function Kr(e,t,n){const{constrain:r}=Yr(0,e),o=e+1;let i=a(t);function a(e){return n?Tr((o+e)%o):r(e)}function s(){return i}function l(){return Kr(e,s(),n)}const c={get:s,set:function(e){return i=a(e),c},add:function(e){return l().set(s()+e)},clone:l};return c}function qr(e,t,n,r,o,i,a,s,l,c,d,u,p,h,f,g,m,b,v){const{cross:w,direction:y}=e,x=["INPUT","SELECT","TEXTAREA"],k={passive:!1},N=$r(),O=$r(),C=Yr(50,225).constrain(h.measure(20)),S={mouse:300,touch:400},j={mouse:500,touch:600},E=f?43:25;let R=!1,z=0,D=0,P=!1,M=!1,T=!1,I=!1;function _(e){if(!Vr(e,r)&&e.touches.length>=2)return A(e);const t=i.readPoint(e),n=i.readPoint(e,w),a=_r(t,z),l=_r(n,D);if(!M&&!I){if(!e.cancelable)return A(e);if(M=a>l,!M)return A(e)}const d=i.pointerMove(e);a>g&&(T=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(y(d)),e.preventDefault()}function A(e){const t=d.byDistance(0,!1).index!==u.get(),n=i.pointerUp(e)*(f?j:S)[I?"mouse":"touch"],r=function(e,t){const n=u.add(-1*Ir(e)),r=d.byDistance(e,!f).distance;return f||Tr(e)<C?r:m&&t?.5*r:d.byIndex(n.get(),0).distance}(y(n),t),o=function(e,t){if(0===e||0===t)return 0;if(Tr(e)<=Tr(t))return 0;const n=_r(Tr(e),Tr(t));return Tr(n/e)}(n,r),a=E-10*o,s=b+o/50;M=!1,P=!1,O.clear(),c.useDuration(a).useFriction(s),l.distance(r,!f),I=!1,p.emit("pointerUp")}function L(e){T&&(e.stopPropagation(),e.preventDefault(),T=!1)}return{init:function(e){if(!v)return;function s(s){(Pr(v)||v(e,s))&&function(e){const s=Vr(e,r);if(I=s,T=f&&s&&!e.buttons&&R,R=_r(o.get(),a.get())>=2,s&&0!==e.button)return;if(function(e){const t=e.nodeName||"";return x.includes(t)}(e.target))return;P=!0,i.pointerDown(e),c.useFriction(0).useDuration(0),o.set(a),function(){const e=I?n:t;O.add(e,"touchmove",_,k).add(e,"touchend",A).add(e,"mousemove",_,k).add(e,"mouseup",A)}(),z=i.readPoint(e),D=i.readPoint(e,w),p.emit("pointerDown")}(s)}const l=t;N.add(l,"dragstart",e=>e.preventDefault(),k).add(l,"touchmove",()=>{},k).add(l,"touchend",()=>{}).add(l,"touchstart",s).add(l,"mousedown",s).add(l,"touchcancel",A).add(l,"contextmenu",A).add(l,"click",L,!0)},destroy:function(){N.clear(),O.clear()},pointerDown:function(){return P}}}function Gr(e,t){let n,r;function o(e){return e.timeStamp}function i(n,r){const o="client"+("x"===(r||e.scroll)?"X":"Y");return(Vr(n,t)?n:n.touches[0])[o]}return{pointerDown:function(e){return n=e,r=e,i(e)},pointerMove:function(e){const t=i(e)-i(r),a=o(e)-o(n)>170;return r=e,a&&(n=e),t},pointerUp:function(e){if(!n||!r)return 0;const t=i(r)-i(n),a=o(e)-o(n),s=o(e)-o(r)>170,l=t/a;return a&&!s&&Tr(l)>.1?l:0},readPoint:i}}function Zr(e,t,n,r,o,i,a){const s=[e].concat(r);let l,c,d=[],u=!1;function p(e){return o.measureSize(a.measure(e))}return{init:function(o){i&&(c=p(e),d=r.map(p),l=new ResizeObserver(n=>{(Pr(i)||i(o,n))&&function(n){for(const i of n){if(u)return;const n=i.target===e,a=r.indexOf(i.target),s=n?c:d[a];if(Tr(p(n?e:r[a])-s)>=.5){o.reInit(),t.emit("resize");break}}}(n)}),n.requestAnimationFrame(()=>{s.forEach(e=>l.observe(e))}))},destroy:function(){u=!0,l&&l.disconnect()}}}function Jr(e,t,n,r,o){const i=o.measure(10),a=o.measure(50),s=Yr(.1,.99);let l=!1;function c(){return!l&&(!!e.reachedAny(n.get())&&!!e.reachedAny(t.get()))}return{shouldConstrain:c,constrain:function(o){if(!c())return;const l=e.reachedMin(t.get())?"min":"max",d=Tr(e[l]-t.get()),u=n.get()-t.get(),p=s.constrain(d/a);n.subtract(u*p),!o&&Tr(u)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())},toggleActive:function(e){l=!e}}}function Qr(e,t,n,r){const o=t.min+.1,i=t.max+.1,{reachedMin:a,reachedMax:s}=Yr(o,i);return{loop:function(t){if(!function(e){return 1===e?s(n.get()):-1===e&&a(n.get())}(t))return;const o=e*(-1*t);r.forEach(e=>e.add(o))}}}function eo(e,t,n,r,o){const{reachedAny:i,removeOffset:a,constrain:s}=r;function l(e){return e.concat().sort((e,t)=>Tr(e)-Tr(t))[0]}function c(t,r){const o=[t,t+n,t-n];if(!e)return t;if(!r)return l(o);const i=o.filter(e=>Ir(e)===r);return i.length?l(i):Lr(o)-n}const d={byDistance:function(n,r){const l=o.get()+n,{index:d,distance:u}=function(n){const r=e?a(n):s(n),o=t.map((e,t)=>({diff:c(e-r,0),index:t})).sort((e,t)=>Tr(e.diff)-Tr(t.diff)),{index:i}=o[0];return{index:i,distance:r}}(l),p=!e&&i(l);return!r||p?{index:d,distance:n}:{index:d,distance:n+c(t[d]-u,0)}},byIndex:function(e,n){return{index:e,distance:c(t[e]-o.get(),n)}},shortcut:c};return d}function to(e,t,n,r,o,i,a,s){const l={passive:!0,capture:!0};let c=0;function d(e){"Tab"===e.code&&(c=(new Date).getTime())}const u={init:function(u){s&&(i.add(document,"keydown",d,!1),t.forEach((t,d)=>{i.add(t,"focus",t=>{(Pr(s)||s(u,t))&&function(t){if((new Date).getTime()-c>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const i=n.findIndex(e=>e.includes(t));zr(i)&&(o.useDuration(0),r.index(i,0),a.emit("slideFocus"))}(d)},l)}))}};return u}function no(e){let t=e;function n(e){return zr(e)?e:e.get()}return{get:function(){return t},set:function(e){t=n(e)},add:function(e){t+=n(e)},subtract:function(e){t-=n(e)}}}function ro(e,t){const n="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},r=t.style;let o=null,i=!1;return{clear:function(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){if(i)return;const a=(s=e.direction(t),Math.round(100*s)/100);var s;a!==o&&(r.transform=n(a),o=a)},toggleActive:function(e){i=!e}}}function oo(e,t,n,r,o,i,a,s,l){const c=Ar(o),d=Ar(o).reverse(),u=function(){const e=a[0];return f(h(d,e),n,!1)}().concat(function(){const e=t-a[0]-1;return f(h(c,e),-n,!0)}());function p(e,t){return e.reduce((e,t)=>e-o[t],t)}function h(e,t){return e.reduce((e,n)=>p(e,t)>0?e.concat([n]):e,[])}function f(o,a,c){const d=function(e){return i.map((n,o)=>({start:n-r[o]+.5+e,end:n+t-.5+e}))}(a);return o.map(t=>{const r=c?0:-n,o=c?n:0,i=c?"end":"start",a=d[t][i];return{index:t,loopPoint:a,slideLocation:no(-1),translate:ro(e,l[t]),target:()=>s.get()>a?r:o}})}const g={canLoop:function(){return u.every(({index:e})=>p(c.filter(t=>t!==e),t)<=.1)},clear:function(){u.forEach(e=>e.translate.clear())},loop:function(){u.forEach(e=>{const{target:t,translate:n,slideLocation:r}=e,o=t();o!==r.get()&&(n.to(o),r.set(o))})},loopPoints:u};return g}function io(e,t,n){let r,o=!1;return{init:function(i){n&&(r=new MutationObserver(e=>{o||(Pr(n)||n(i,e))&&function(e){for(const n of e)if("childList"===n.type){i.reInit(),t.emit("slidesChanged");break}}(e)}),r.observe(e,{childList:!0}))},destroy:function(){r&&r.disconnect(),o=!0}}}function ao(e,t,n,r){const o={};let i,a=null,s=null,l=!1;const c={init:function(){i=new IntersectionObserver(e=>{l||(e.forEach(e=>{const n=t.indexOf(e.target);o[n]=e}),a=null,s=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(e=>i.observe(e))},destroy:function(){i&&i.disconnect(),l=!0},get:function(e=!0){if(e&&a)return a;if(!e&&s)return s;const t=function(e){return Br(o).reduce((t,n)=>{const r=parseInt(n),{isIntersecting:i}=o[r];return(e&&i||!e&&!i)&&t.push(r),t},[])}(e);return e&&(a=t),e||(s=t),t}};return c}function so(e,t,n,r,o,i,a,s,l){const{startEdge:c,endEdge:d,direction:u}=e,p=zr(n);const h={groupSlides:function(e){return p?function(e,t){return Ar(e).filter(e=>e%t===0).map(n=>e.slice(n,n+t))}(e,n):function(e){return e.length?Ar(e).reduce((n,p,h)=>{const f=Lr(n)||0,g=0===f,m=p===Hr(e),b=o[c]-i[f][c],v=o[c]-i[p][d],w=!r&&g?u(a):0,y=Tr(v-(!r&&m?u(s):0)-(b+w));return h&&y>t+l&&n.push(p),m&&n.push(e.length),n},[]).map((t,n,r)=>{const o=Math.max(r[n-1]||0);return e.slice(o,t)}):[]}(e)}};return h}function lo(e,t,n,r,o,i,a){const{align:s,axis:l,direction:c,startIndex:d,loop:u,duration:p,dragFree:h,dragThreshold:f,inViewThreshold:g,slidesToScroll:m,skipSnaps:b,containScroll:v,watchResize:w,watchSlides:y,watchDrag:x,watchFocus:k}=i,N={measure:function(e){const{offsetTop:t,offsetLeft:n,offsetWidth:r,offsetHeight:o}=e;return{top:t,right:n+r,bottom:t+o,left:n,width:r,height:o}}},O=N.measure(t),C=n.map(N.measure),S=function(e,t){const n="rtl"===t,r="y"===e,o=!r&&n?-1:1;return{scroll:r?"y":"x",cross:r?"x":"y",startEdge:r?"top":n?"right":"left",endEdge:r?"bottom":n?"left":"right",measureSize:function(e){const{height:t,width:n}=e;return r?t:n},direction:function(e){return e*o}}}(l,c),j=S.measureSize(O),E=function(e){return{measure:function(t){return e*(t/100)}}}(j),R=function(e,t){const n={start:function(){return 0},center:function(e){return r(e)/2},end:r};function r(e){return t-e}const o={measure:function(r,o){return Dr(e)?n[e](r):e(t,r,o)}};return o}(s,j),z=!u&&!!v,D=u||!!v,{slideSizes:P,slideSizesWithGaps:M,startGap:T,endGap:I}=function(e,t,n,r,o,i){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&o,d=function(){if(!c)return 0;const e=n[0];return Tr(t[s]-e[s])}(),u=function(){if(!c)return 0;const e=i.getComputedStyle(Lr(r));return parseFloat(e.getPropertyValue(`margin-${l}`))}(),p=n.map(a),h=n.map((e,t,n)=>{const r=!t,o=Fr(n,t);return r?p[t]+d:o?p[t]+u:n[t+1][s]-e[s]}).map(Tr);return{slideSizes:p,slideSizesWithGaps:h,startGap:d,endGap:u}}(S,O,C,n,D,o),_=so(S,j,m,u,O,C,T,I,2),{snaps:A,snapsAligned:L}=function(e,t,n,r,o){const{startEdge:i,endEdge:a}=e,{groupSlides:s}=o,l=s(r).map(e=>Lr(e)[a]-e[0][i]).map(Tr).map(t.measure),c=r.map(e=>n[i]-e[i]).map(e=>-Tr(e)),d=s(c).map(e=>e[0]).map((e,t)=>e+l[t]);return{snaps:c,snapsAligned:d}}(S,R,O,C,_),H=-Lr(A)+Lr(M),{snapsContained:F,scrollContainLimit:W}=function(e,t,n,r,o){const i=Yr(-t+e,0),a=n.map((e,t)=>{const{min:r,max:o}=i,a=i.constrain(e),s=!t,l=Fr(n,t);return s?o:l||c(r,a)?r:c(o,a)?o:a}).map(e=>parseFloat(e.toFixed(3))),s=function(){const e=a[0],t=Lr(a);return Yr(a.lastIndexOf(e),a.indexOf(t)+1)}(),l=function(){if(t<=e+o)return[i.max];if("keepSnaps"===r)return a;const{min:n,max:l}=s;return a.slice(n,l)}();function c(e,t){return _r(e,t)<=1}return{snapsContained:l,scrollContainLimit:s}}(j,H,L,v,2),B=z?F:L,{limit:U}=function(e,t,n){const r=t[0];return{limit:Yr(n?r-e:Lr(t),r)}}(H,B,u),V=Kr(Hr(B),d,u),$=V.clone(),X=Ar(n),Y=Xr(r,o,()=>(({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:r}})=>{r||n.constrain(e.pointerDown()),t.seek()})(se),e=>(({scrollBody:e,translate:t,location:n,offsetLocation:r,previousLocation:o,scrollLooper:i,slideLooper:a,dragHandler:s,animation:l,eventHandler:c,scrollBounds:d,options:{loop:u}},p)=>{const h=e.settled(),f=!d.shouldConstrain(),g=u?h:h&&f,m=g&&!s.pointerDown();m&&l.stop();const b=n.get()*p+o.get()*(1-p);r.set(b),u&&(i.loop(e.direction()),a.loop()),t.to(r.get()),m&&c.emit("settle"),g||c.emit("scroll")})(se,e)),K=B[V.get()],q=no(K),G=no(K),Z=no(K),J=no(K),Q=function(e,t,n,r,o,i){let a=0,s=0,l=o,c=i,d=e.get(),u=0;function p(e){return l=e,f}function h(e){return c=e,f}const f={direction:function(){return s},duration:function(){return l},velocity:function(){return a},seek:function(){const t=r.get()-e.get();let o=0;return l?(n.set(e),a+=t/l,a*=c,d+=a,e.add(a),o=d-u):(a=0,n.set(r),e.set(r),o=t),s=Ir(o),u=d,f},settled:function(){return Tr(r.get()-t.get())<.001},useBaseFriction:function(){return h(i)},useBaseDuration:function(){return p(o)},useFriction:h,useDuration:p};return f}(q,Z,G,J,p,.68),ee=eo(u,B,H,U,J),te=function(e,t,n,r,o,i,a){function s(o){const s=o.distance,l=o.index!==t.get();i.add(s),s&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),l&&(n.set(t.get()),t.set(o.index),a.emit("select"))}const l={distance:function(e,t){s(o.byDistance(e,t))},index:function(e,n){const r=t.clone().set(e);s(o.byIndex(r.get(),n))}};return l}(Y,V,$,Q,ee,J,a),ne=function(e){const{max:t,length:n}=e;return{get:function(e){return n?(e-t)/-n:0}}}(U),re=$r(),oe=ao(t,n,a,g),{slideRegistry:ie}=function(e,t,n,r,o,i){const{groupSlides:a}=o,{min:s,max:l}=r,c=function(){const r=a(i),o=!e||"keepSnaps"===t;return 1===n.length?[i]:o?r:r.slice(s,l).map((e,t,n)=>{const r=!t,o=Fr(n,t);return r?Wr(Lr(n[0])+1):o?Wr(Hr(i)-Lr(n)[0]+1,Lr(n)[0]):e})}();return{slideRegistry:c}}(z,v,B,W,_,X),ae=to(e,n,ie,te,Q,re,a,k),se={ownerDocument:r,ownerWindow:o,eventHandler:a,containerRect:O,slideRects:C,animation:Y,axis:S,dragHandler:qr(S,e,r,o,J,Gr(S,o),q,Y,te,Q,ee,V,a,E,h,f,b,.68,x),eventStore:re,percentOfView:E,index:V,indexPrevious:$,limit:U,location:q,offsetLocation:Z,previousLocation:G,options:i,resizeHandler:Zr(t,a,o,n,S,w,N),scrollBody:Q,scrollBounds:Jr(U,Z,J,Q,E),scrollLooper:Qr(H,U,Z,[q,Z,G,J]),scrollProgress:ne,scrollSnapList:B.map(ne.get),scrollSnaps:B,scrollTarget:ee,scrollTo:te,slideLooper:oo(S,j,H,P,M,A,B,Z,n),slideFocus:ae,slidesHandler:io(t,a,y),slidesInView:oe,slideIndexes:X,slideRegistry:ie,slidesToScroll:_,target:J,translate:ro(S,t)};return se}const co={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function uo(e){function t(e,t){return Ur(e,t||{})}const n={mergeOptions:t,optionsAtMedia:function(n){const r=n.breakpoints||{},o=Br(r).filter(t=>e.matchMedia(t).matches).map(e=>r[e]).reduce((e,n)=>t(e,n),{});return t(n,o)},optionsMediaQueries:function(t){return t.map(e=>Br(e.breakpoints||{})).reduce((e,t)=>e.concat(t),[]).map(e.matchMedia)}};return n}function po(e,t,n){const r=e.ownerDocument,o=r.defaultView,i=uo(o),a=function(e){let t=[];const n={init:function(n,r){return t=r.filter(({options:t})=>!1!==e.optionsAtMedia(t).active),t.forEach(t=>t.init(n,e)),r.reduce((e,t)=>Object.assign(e,{[t.name]:t}),{})},destroy:function(){t=t.filter(e=>e.destroy())}};return n}(i),s=$r(),l=function(){let e,t={};function n(e){return t[e]||[]}const r={init:function(t){e=t},emit:function(t){return n(t).forEach(n=>n(e,t)),r},off:function(e,o){return t[e]=n(e).filter(e=>e!==o),r},on:function(e,o){return t[e]=n(e).concat([o]),r},clear:function(){t={}}};return r}(),{mergeOptions:c,optionsAtMedia:d,optionsMediaQueries:u}=i,{on:p,off:h,emit:f}=l,g=S;let m,b,v,w,y=!1,x=c(co,po.globalOptions),k=c(x),N=[];function O(t){const n=lo(e,v,w,r,o,t,l);if(t.loop&&!n.slideLooper.canLoop()){return O(Object.assign({},t,{loop:!1}))}return n}function C(t,n){y||(x=c(x,t),k=d(x),N=n||N,function(){const{container:t,slides:n}=k,r=Dr(t)?e.querySelector(t):t;v=r||e.children[0];const o=Dr(n)?v.querySelectorAll(n):n;w=[].slice.call(o||v.children)}(),m=O(k),u([x,...N.map(({options:e})=>e)]).forEach(e=>s.add(e,"change",S)),k.active&&(m.translate.to(m.location.get()),m.animation.init(),m.slidesInView.init(),m.slideFocus.init(z),m.eventHandler.init(z),m.resizeHandler.init(z),m.slidesHandler.init(z),m.options.loop&&m.slideLooper.loop(),v.offsetParent&&w.length&&m.dragHandler.init(z),b=a.init(z,N)))}function S(e,t){const n=R();j(),C(c({startIndex:n},e),t),l.emit("reInit")}function j(){m.dragHandler.destroy(),m.eventStore.clear(),m.translate.clear(),m.slideLooper.clear(),m.resizeHandler.destroy(),m.slidesHandler.destroy(),m.slidesInView.destroy(),m.animation.destroy(),a.destroy(),s.clear()}function E(e,t,n){k.active&&!y&&(m.scrollBody.useBaseFriction().useDuration(!0===t?0:k.duration),m.scrollTo.index(e,n||0))}function R(){return m.index.get()}const z={canScrollNext:function(){return m.index.add(1).get()!==R()},canScrollPrev:function(){return m.index.add(-1).get()!==R()},containerNode:function(){return v},internalEngine:function(){return m},destroy:function(){y||(y=!0,s.clear(),j(),l.emit("destroy"),l.clear())},off:h,on:p,emit:f,plugins:function(){return b},previousScrollSnap:function(){return m.indexPrevious.get()},reInit:g,rootNode:function(){return e},scrollNext:function(e){E(m.index.add(1).get(),e,-1)},scrollPrev:function(e){E(m.index.add(-1).get(),e,1)},scrollProgress:function(){return m.scrollProgress.get(m.offsetLocation.get())},scrollSnapList:function(){return m.scrollSnapList},scrollTo:E,selectedScrollSnap:R,slideNodes:function(){return w},slidesInView:function(){return m.slidesInView.get()},slidesNotInView:function(){return m.slidesInView.get(!1)}};return C(t,n),setTimeout(()=>l.emit("init"),0),z}function ho(e={},t=[]){const n=d(e),r=d(t),[o,i]=u(),[a,s]=u(),l=c(()=>{o&&o.reInit(n.current,r.current)},[o]);return p(()=>{Er(n.current,e)||(n.current=e,l())},[e,l]),p(()=>{(function(e,t){if(e.length!==t.length)return!1;const n=Rr(e),r=Rr(t);return n.every((e,t)=>Er(e,r[t]))})(r.current,t)||(r.current=t,l())},[t,l]),p(()=>{if("undefined"!=typeof window&&window.document&&window.document.createElement&&a){po.globalOptions=ho.globalOptions;const e=po(a,n.current,r.current);return i(e),()=>e.destroy()}i(void 0)},[a,i]),[s,o]}po.globalOptions=void 0,ho.globalOptions=void 0;const fo=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,go=Dn,mo=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return go(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(e=>{const t=null==n?void 0:n[e],r=null==i?void 0:i[e];if(null===t)return null;const a=fo(t)||fo(r);return o[e][a]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...s}[t]):{...i,...s}[t]===n})?[...e,n,r]:e},[]);return go(e,a,l,null==n?void 0:n.class,null==n?void 0:n.className)},bo=mo("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),vo=r.forwardRef((t,n)=>{var{className:r,variant:o,size:i}=t,a=de(t,["className","variant","size"]);return e("button",Object.assign({className:Or(bo({variant:o,size:i,className:r})),ref:n},a))});vo.displayName="Button";const wo=h(null);function yo(){const e=f(wo);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const xo=i((t,n)=>{var{orientation:r="horizontal",opts:o,setApi:i,plugins:a,className:s,children:d}=t,h=de(t,["orientation","opts","setApi","plugins","className","children"]);const[f,g]=ho(Object.assign(Object.assign({},o),{axis:"horizontal"===r?"x":"y"}),a),[m,b]=u(!1),[v,w]=u(!1),y=c(e=>{e&&(b(e.canScrollPrev()),w(e.canScrollNext()))},[]),x=c(()=>{null==g||g.scrollPrev()},[g]),k=c(()=>{null==g||g.scrollNext()},[g]),N=c(e=>{"ArrowLeft"===e.key?(e.preventDefault(),x()):"ArrowRight"===e.key&&(e.preventDefault(),k())},[x,k]);p(()=>{g&&i&&i(g)},[g,i]),p(()=>{if(g)return y(g),g.on("reInit",y),g.on("select",y),()=>{null==g||g.off("select",y)}},[g,y]);const O=l(()=>({carouselRef:f,api:g,opts:o,orientation:r||("y"===(null==o?void 0:o.axis)?"vertical":"horizontal"),scrollPrev:x,scrollNext:k,canScrollPrev:m,canScrollNext:v}),[f,g,o,r,x,k,m,v]);return e(wo.Provider,Object.assign({value:O},{children:e("div",Object.assign({onKeyDownCapture:N,className:Or("relative",s),role:"region","aria-roledescription":"carousel","data-slot":"carousel",ref:n},h,{children:d}))}))});xo.displayName="Carousel";const ko=i((t,n)=>{var{className:r}=t,o=de(t,["className"]);const{carouselRef:i,orientation:a}=yo();return e("div",Object.assign({ref:i,className:"overflow-hidden","data-slot":"carousel-content"},{children:e("div",Object.assign({ref:n,className:Or("flex","horizontal"===a?"-ml-4":"-mt-4 flex-col",r)},o))}))});ko.displayName="CarouselContent";const No=i((t,n)=>{var{className:r}=t,o=de(t,["className"]);const{orientation:i}=yo();return e("div",Object.assign({ref:n,role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:Or("min-w-0 shrink-0 grow-0 basis-full","horizontal"===i?"pl-4":"pt-4",r)},o))});No.displayName="CarouselItem";const Oo=t=>{var{className:r,variant:o="outline",size:i="icon"}=t,a=de(t,["className","variant","size"]);const{orientation:s,scrollPrev:l,canScrollPrev:c}=yo();return n(vo,Object.assign({"data-slot":"carousel-previous",variant:o,size:i,className:Or("absolute size-8 rounded-full","horizontal"===s?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",r),disabled:!c,onClick:l},a,{children:[e(Ft,{}),e("span",Object.assign({className:"sr-only"},{children:"Previous slide"}))]}))},Co=t=>{var{className:r,variant:o="outline",size:i="icon"}=t,a=de(t,["className","variant","size"]);const{orientation:s,scrollNext:l,canScrollNext:c}=yo();return n(vo,Object.assign({"data-slot":"carousel-next",variant:o,size:i,className:Or("absolute size-8 rounded-full","horizontal"===s?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",r),disabled:!c,onClick:l},a,{children:[e(Wt,{}),e("span",Object.assign({className:"sr-only"},{children:"Next slide"}))]}))},So=r.forwardRef((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("div",Object.assign({ref:n,className:Or("rounded-xl border bg-card text-card-foreground shadow",r)},o))});So.displayName="Card";r.forwardRef((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("div",Object.assign({ref:n,className:Or("flex flex-col space-y-1.5 p-6",r)},o))}).displayName="CardHeader";r.forwardRef((t,n)=>{var{className:r,children:o}=t,i=de(t,["className","children"]);return e("h3",Object.assign({ref:n,className:Or("font-semibold leading-none tracking-tight",r)},i,{children:o}))}).displayName="CardTitle";r.forwardRef((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("p",Object.assign({ref:n,className:Or("text-sm text-muted-foreground",r)},o))}).displayName="CardDescription";const jo=r.forwardRef((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("div",Object.assign({ref:n,className:Or("p-6 pt-0",r)},o))});jo.displayName="CardContent";r.forwardRef((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("div",Object.assign({ref:n,className:Or("flex items-center p-6 pt-0",r)},o))}).displayName="CardFooter";const Eo={"carousel-container":{render:t=>{const{attributes:r,children:o}=t,[i,a]=u(),[s,l]=u(0),[c,d]=u(0);return p(()=>{i&&(d(i.scrollSnapList().length),l(i.selectedScrollSnap()+1),i.on("select",()=>{l(i.selectedScrollSnap()+1)}))},[i]),e("div",Object.assign({className:"flex w-full justify-center data-[align=center]:items-center data-[align=end]:items-end data-[align=start]:items-start"},{children:n("div",Object.assign({className:"mx-auto\n "},{children:[n(xo,Object.assign({},r,{setApi:a,opts:{align:"start",axis:"x",loop:!0},orientation:"horizontal",className:"w-full max-w-lg"},{children:[e(ko,{children:o}),e(Oo,{contentEditable:!1,className:"select-none"}),e(Co,{contentEditable:!1,className:"select-none"})]})),n("div",Object.assign({contentEditable:!1,className:"select-none text-muted-foreground py-2 text-center text-sm"},{children:["Slide ",s," of ",c]}))]}))}))}},"carousel-list-item":{render:t=>{const{children:n}=t;return e(No,Object.assign({className:"md:basis-1/2 lg:basis-1/3"},{children:e("div",Object.assign({className:"p-1"},{children:e(So,{children:e(jo,Object.assign({className:"flex aspect-square items-center justify-center p-6"},{children:n}))})}))}))}}};function Ro(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(t,n))}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var zo=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}},Do={"text/plain":"Text","text/html":"Url",default:"Text"};var Po=function(e,t){var n,r,o,i,a,s,l=!1;t||(t={}),n=t.debug||!1;try{if(o=zo(),i=document.createRange(),a=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=Do[t.format]||Do.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))}),document.body.appendChild(s),i.selectNodeContents(s),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),r=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(r,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),s&&document.body.removeChild(s),o()}return l},Mo=se({__proto__:null,default:Po},[Po]);const To=r.forwardRef((t,n)=>{var{className:r,type:o}=t,i=de(t,["className","type"]);return e("input",Object.assign({type:o,className:Or("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:n},i))});function Io(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}To.displayName="Input";var _o,Ao="dismissableLayer.update",Lo="dismissableLayer.pointerDownOutside",Ho="dismissableLayer.focusOutside",Fo=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wo=r.forwardRef((t,n)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=t,u=r.useContext(Fo),[p,h]=r.useState(null),f=p?.ownerDocument??globalThis?.document,[,g]=r.useState({}),m=me(n,e=>h(e)),b=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(v),y=p?b.indexOf(p):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,k=y>=w,N=function(e,t=globalThis?.document){const n=Io(e),o=r.useRef(!1),i=r.useRef(()=>{});return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let r=function(){Uo(Lo,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=r,t.addEventListener("click",i.current,{once:!0})):r()}else t.removeEventListener("click",i.current);o.current=!1},r=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(r),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));k&&!n&&(a?.(e),l?.(e),e.defaultPrevented||c?.())},f),O=function(e,t=globalThis?.document){const n=Io(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){Uo(Ho,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))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},f);return function(e,t=globalThis?.document){const n=Io(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=>{y===u.layers.size-1&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),r.useEffect(()=>{if(p)return o&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(_o=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),Bo(),()=>{o&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=_o)}},[p,f,o,u]),r.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),Bo())},[p,u]),r.useEffect(()=>{const e=()=>g({});return document.addEventListener(Ao,e),()=>document.removeEventListener(Ao,e)},[]),e(Se.div,{...d,ref:m,style:{pointerEvents:x?k?"auto":"none":void 0,...t.style},onFocusCapture:ke(t.onFocusCapture,O.onFocusCapture),onBlurCapture:ke(t.onBlurCapture,O.onBlurCapture),onPointerDownCapture:ke(t.onPointerDownCapture,N.onPointerDownCapture)})});Wo.displayName="DismissableLayer";function Bo(){const e=new CustomEvent(Ao);document.dispatchEvent(e)}function Uo(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?je(o,i):o.dispatchEvent(i)}r.forwardRef((t,n)=>{const o=r.useContext(Fo),i=r.useRef(null),a=me(n,i);return r.useEffect(()=>{const e=i.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),e(Se.div,{...t,ref:a})}).displayName="DismissableLayerBranch";var Vo=0;function $o(){r.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Xo()),document.body.insertAdjacentElement("beforeend",e[1]??Xo()),Vo++,()=>{1===Vo&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Vo--}},[])}function Xo(){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 Yo="focusScope.autoFocusOnMount",Ko="focusScope.autoFocusOnUnmount",qo={bubbles:!1,cancelable:!0},Go=r.forwardRef((t,n)=>{const{loop:o=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...l}=t,[c,d]=r.useState(null),u=Io(a),p=Io(s),h=r.useRef(null),f=me(n,e=>d(e)),g=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(i){let e=function(e){if(g.paused||!c)return;const t=e.target;c.contains(t)?h.current=t:ei(h.current,{select:!0})},t=function(e){if(g.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||ei(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ei(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[i,c,g.paused]),r.useEffect(()=>{if(c){ti.add(g);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(Yo,qo);c.addEventListener(Yo,u),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ei(r,{select:t}),document.activeElement!==n)return}((e=Zo(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&ei(c))}return()=>{c.removeEventListener(Yo,u),setTimeout(()=>{const e=new CustomEvent(Ko,qo);c.addEventListener(Ko,p),c.dispatchEvent(e),e.defaultPrevented||ei(t??document.body,{select:!0}),c.removeEventListener(Ko,p),ti.remove(g)},0)}}var e},[c,u,p,g]);const m=r.useCallback(e=>{if(!o&&!i)return;if(g.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,i]=function(e){const t=Zo(e),n=Jo(t,e),r=Jo(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||n!==i?e.shiftKey&&n===r&&(e.preventDefault(),o&&ei(i,{select:!0})):(e.preventDefault(),o&&ei(r,{select:!0})):n===t&&e.preventDefault()}},[o,i,g.paused]);return e(Se.div,{tabIndex:-1,...l,ref:f,onKeyDown:m})});function Zo(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 Jo(e,t){for(const n of e)if(!Qo(n,{upTo:t}))return n}function Qo(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 ei(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()}}Go.displayName="FocusScope";var ti=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ni(e,t),e.unshift(t)},remove(t){e=ni(e,t),e[0]?.resume()}}}();function ni(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const ri=["top","right","bottom","left"],oi=Math.min,ii=Math.max,ai=Math.round,si=Math.floor,li=e=>({x:e,y:e}),ci={left:"right",right:"left",bottom:"top",top:"bottom"},di={start:"end",end:"start"};function ui(e,t,n){return ii(e,oi(t,n))}function pi(e,t){return"function"==typeof e?e(t):e}function hi(e){return e.split("-")[0]}function fi(e){return e.split("-")[1]}function gi(e){return"x"===e?"y":"x"}function mi(e){return"y"===e?"height":"width"}const bi=new Set(["top","bottom"]);function vi(e){return bi.has(hi(e))?"y":"x"}function wi(e){return gi(vi(e))}function yi(e){return e.replace(/start|end/g,e=>di[e])}const xi=["left","right"],ki=["right","left"],Ni=["top","bottom"],Oi=["bottom","top"];function Ci(e,t,n,r){const o=fi(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?ki:xi:t?xi:ki;case"left":case"right":return t?Ni:Oi;default:return[]}}(hi(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(yi)))),i}function Si(e){return e.replace(/left|right|bottom|top/g,e=>ci[e])}function ji(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Ei(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ri(e,t,n){let{reference:r,floating:o}=e;const i=vi(t),a=wi(t),s=mi(a),l=hi(t),c="y"===i,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(l){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-o.width,y:u};break;default:h={x:r.x,y:r.y}}switch(fi(t)){case"start":h[a]-=p*(n&&c?-1:1);break;case"end":h[a]+=p*(n&&c?-1:1)}return h}async function zi(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:h=0}=pi(t,e),f=ji(h),g=s[p?"floating"===u?"reference":"floating":u],m=Ei(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),b="floating"===u?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),w=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},y=Ei(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:v,strategy:l}):b);return{top:(m.top-y.top+f.top)/w.y,bottom:(y.bottom-m.bottom+f.bottom)/w.y,left:(m.left-y.left+f.left)/w.x,right:(y.right-m.right+f.right)/w.x}}function Di(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Pi(e){return ri.some(t=>e[t]>=0)}function Mi(e){const t=oi(...e.map(e=>e.left)),n=oi(...e.map(e=>e.top));return{x:t,y:n,width:ii(...e.map(e=>e.right))-t,height:ii(...e.map(e=>e.bottom))-n}}const Ti=new Set(["left","top"]);function Ii(){return"undefined"!=typeof window}function _i(e){return Hi(e)?(e.nodeName||"").toLowerCase():"#document"}function Ai(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Li(e){var t;return null==(t=(Hi(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Hi(e){return!!Ii()&&(e instanceof Node||e instanceof Ai(e).Node)}function Fi(e){return!!Ii()&&(e instanceof Element||e instanceof Ai(e).Element)}function Wi(e){return!!Ii()&&(e instanceof HTMLElement||e instanceof Ai(e).HTMLElement)}function Bi(e){return!(!Ii()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Ai(e).ShadowRoot)}const Ui=new Set(["inline","contents"]);function Vi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=na(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ui.has(o)}const $i=new Set(["table","td","th"]);function Xi(e){return $i.has(_i(e))}const Yi=[":popover-open",":modal"];function Ki(e){return Yi.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const qi=["transform","translate","scale","rotate","perspective"],Gi=["transform","translate","scale","rotate","perspective","filter"],Zi=["paint","layout","strict","content"];function Ji(e){const t=Qi(),n=Fi(e)?na(e):e;return qi.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Gi.some(e=>(n.willChange||"").includes(e))||Zi.some(e=>(n.contain||"").includes(e))}function Qi(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ea=new Set(["html","body","#document"]);function ta(e){return ea.has(_i(e))}function na(e){return Ai(e).getComputedStyle(e)}function ra(e){return Fi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oa(e){if("html"===_i(e))return e;const t=e.assignedSlot||e.parentNode||Bi(e)&&e.host||Li(e);return Bi(t)?t.host:t}function ia(e){const t=oa(e);return ta(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wi(t)&&Vi(t)?t:ia(t)}function aa(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ia(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Ai(o);if(i){const e=sa(a);return t.concat(a,a.visualViewport||[],Vi(o)?o:[],e&&n?aa(e):[])}return t.concat(o,aa(o,[],n))}function sa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function la(e){const t=na(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Wi(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=ai(n)!==i||ai(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function ca(e){return Fi(e)?e:e.contextElement}function da(e){const t=ca(e);if(!Wi(t))return li(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=la(t);let a=(i?ai(n.width):n.width)/r,s=(i?ai(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const ua=li(0);function pa(e){const t=Ai(e);return Qi()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ua}function ha(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ca(e);let a=li(1);t&&(r?Fi(r)&&(a=da(r)):a=da(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Ai(e))&&t}(i,n,r)?pa(i):li(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,d=o.width/a.x,u=o.height/a.y;if(i){const e=Ai(i),t=r&&Fi(r)?Ai(r):r;let n=e,o=sa(n);for(;o&&r&&t!==n;){const e=da(o),t=o.getBoundingClientRect(),r=na(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=i,c+=a,n=Ai(o),o=sa(n)}}return Ei({width:d,height:u,x:l,y:c})}function fa(e,t){const n=ra(e).scrollLeft;return t?t.left+n:ha(Li(e)).left+n}function ga(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-fa(e,n),y:n.top+t.scrollTop}}const ma=new Set(["absolute","fixed"]);function ba(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Ai(e),r=Li(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=Qi();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=fa(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Li(e),n=ra(e),r=e.ownerDocument.body,o=ii(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ii(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+fa(e);const s=-n.scrollTop;return"rtl"===na(r).direction&&(a+=ii(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(Li(e));else if(Fi(t))r=function(e,t){const n=ha(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Wi(e)?da(e):li(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=pa(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ei(r)}function va(e,t){const n=oa(e);return!(n===t||!Fi(n)||ta(n))&&("fixed"===na(n).position||va(n,t))}function wa(e,t,n){const r=Wi(t),o=Li(t),i="fixed"===n,a=ha(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=li(0);function c(){l.x=fa(o)}if(r||!r&&!i)if(("body"!==_i(t)||Vi(o))&&(s=ra(t)),r){const e=ha(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const d=!o||r||i?li(0):ga(o,s);return{x:a.left+s.scrollLeft-l.x-d.x,y:a.top+s.scrollTop-l.y-d.y,width:a.width,height:a.height}}function ya(e){return"static"===na(e).position}function xa(e,t){if(!Wi(e)||"fixed"===na(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Li(e)===n&&(n=n.ownerDocument.body),n}function ka(e,t){const n=Ai(e);if(Ki(e))return n;if(!Wi(e)){let t=oa(e);for(;t&&!ta(t);){if(Fi(t)&&!ya(t))return t;t=oa(t)}return n}let r=xa(e,t);for(;r&&Xi(r)&&ya(r);)r=xa(r,t);return r&&ta(r)&&ya(r)&&!Ji(r)?n:r||function(e){let t=oa(e);for(;Wi(t)&&!ta(t);){if(Ji(t))return t;if(Ki(t))return null;t=oa(t)}return null}(e)||n}const Na={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Li(r),s=!!t&&Ki(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=li(1);const d=li(0),u=Wi(r);if((u||!u&&!i)&&(("body"!==_i(r)||Vi(a))&&(l=ra(r)),Wi(r))){const e=ha(r);c=da(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const p=!a||u||i?li(0):ga(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}},getDocumentElement:Li,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Ki(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=aa(e,[],!1).filter(e=>Fi(e)&&"body"!==_i(e)),o=null;const i="fixed"===na(e).position;let a=i?oa(e):e;for(;Fi(a)&&!ta(a);){const t=na(a),n=Ji(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&ma.has(o.position)||Vi(a)&&!n&&va(e,a))?r=r.filter(e=>e!==a):o=t,a=oa(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=ba(t,n,o);return e.top=ii(r.top,e.top),e.right=oi(r.right,e.right),e.bottom=oi(r.bottom,e.bottom),e.left=ii(r.left,e.left),e},ba(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:ka,getElementRects:async function(e){const t=this.getOffsetParent||ka,n=this.getDimensions,r=await n(e.floating);return{reference:wa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=la(e);return{width:t,height:n}},getScale:da,isElement:Fi,isRTL:function(e){return"rtl"===na(e).direction}};function Oa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ca(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=ca(e),d=o||i?[...c?aa(c):[],...aa(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const u=c&&s?function(e,t){let n,r=null;const o=Li(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-si(u)+"px "+-si(o.clientWidth-(d+p))+"px "+-si(o.clientHeight-(u+h))+"px "+-si(d)+"px",threshold:ii(0,oi(1,l))||1};let g=!0;function m(t){const r=t[0].intersectionRatio;if(r!==l){if(!g)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||Oa(c,e.getBoundingClientRect())||a(),g=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let g=l?ha(e):null;return l&&function t(){const r=ha(e);g&&!Oa(g,r)&&n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Sa=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=hi(n),s=fi(n),l="y"===vi(n),c=Ti.has(a)?-1:1,d=i&&l?-1:1,u=pi(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},ja=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=pi(e,t),c={x:n,y:r},d=await zi(t,l),u=vi(hi(o)),p=gi(u);let h=c[p],f=c[u];if(i){const e="y"===p?"bottom":"right";h=ui(h+d["y"===p?"top":"left"],h,h-d[e])}if(a){const e="y"===u?"bottom":"right";f=ui(f+d["y"===u?"top":"left"],f,f-d[e])}const g=s.fn({...t,[p]:h,[u]:f});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[u]:a}}}}}},Ea=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=pi(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const b=hi(o),v=vi(s),w=hi(s)===s,y=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=p||(w||!g?[Si(s)]:function(e){const t=Si(e);return[yi(e),t,yi(t)]}(s)),k="none"!==f;!p&&k&&x.push(...Ci(s,g,f,y));const N=[s,...x],O=await zi(t,m),C=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(d&&C.push(O[b]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=fi(e),o=wi(e),i=mi(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Si(a)),[a,Si(a)]}(o,a,y);C.push(O[e[0]],O[e[1]])}if(S=[...S,{placement:o,overflows:C}],!C.every(e=>e<=0)){var j,E;const e=((null==(j=i.flip)?void 0:j.index)||0)+1,t=N[e];if(t){if(!("alignment"===u&&v!==vi(t))||S.every(e=>vi(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:S},reset:{placement:t}}}let n=null==(E=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:E.placement;if(!n)switch(h){case"bestFit":{var R;const e=null==(R=S.filter(e=>{if(k){const t=vi(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Ra=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=pi(e,t),d=await zi(t,c),u=hi(o),p=fi(o),h="y"===vi(o),{width:f,height:g}=i.floating;let m,b;"top"===u||"bottom"===u?(m=u,b=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,m="end"===p?"top":"bottom");const v=g-d.top-d.bottom,w=f-d.left-d.right,y=oi(g-d[m],v),x=oi(f-d[b],w),k=!t.middlewareData.shift;let N=y,O=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(O=w),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(N=v),k&&!p){const e=ii(d.left,0),t=ii(d.right,0),n=ii(d.top,0),r=ii(d.bottom,0);h?O=f-2*(0!==e||0!==t?e+t:ii(d.left,d.right)):N=g-2*(0!==n||0!==r?n+r:ii(d.top,d.bottom))}await l({...t,availableWidth:O,availableHeight:N});const C=await a.getDimensions(s.floating);return f!==C.width||g!==C.height?{reset:{rects:!0}}:{}}}},za=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=pi(e,t);switch(r){case"referenceHidden":{const e=Di(await zi(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Pi(e)}}}case"escaped":{const e=Di(await zi(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Pi(e)}}}default:return{}}}}},Da=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=pi(e,t)||{};if(null==c)return{};const u=ji(d),p={x:n,y:r},h=wi(o),f=mi(h),g=await a.getDimensions(c),m="y"===h,b=m?"top":"left",v=m?"bottom":"right",w=m?"clientHeight":"clientWidth",y=i.reference[f]+i.reference[h]-p[h]-i.floating[f],x=p[h]-i.reference[h],k=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let N=k?k[w]:0;N&&await(null==a.isElement?void 0:a.isElement(k))||(N=s.floating[w]||i.floating[f]);const O=y/2-x/2,C=N/2-g[f]/2-1,S=oi(u[b],C),j=oi(u[v],C),E=S,R=N-g[f]-j,z=N/2-g[f]/2+O,D=ui(E,z,R),P=!l.arrow&&null!=fi(o)&&z!==D&&i.reference[f]/2-(z<E?S:j)-g[f]/2<0,M=P?z<E?z-E:z-R:0;return{[h]:p[h]+M,data:{[h]:D,centerOffset:z-D-M,...P&&{alignmentOffset:M}},reset:P}}}),Pa=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:s=2,x:l,y:c}=pi(e,t),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[]),u=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let r=null;for(let e=0;e<t.length;e++){const o=t[e];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(e=>Ei(Mi(e)))}(d),p=Ei(Mi(d)),h=ji(s);const f=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=l&&null!=c)return u.find(e=>l>e.left-h.left&&l<e.right+h.right&&c>e.top-h.top&&c<e.bottom+h.bottom)||p;if(u.length>=2){if("y"===vi(n)){const e=u[0],t=u[u.length-1],r="top"===hi(n),o=e.top,i=t.bottom,a=r?e.left:t.left,s=r?e.right:t.right;return{top:o,bottom:i,left:a,right:s,width:s-a,height:i-o,x:a,y:o}}const e="left"===hi(n),t=ii(...u.map(e=>e.right)),r=oi(...u.map(e=>e.left)),o=u.filter(n=>e?n.left===r:n.right===t),i=o[0].top,a=o[o.length-1].bottom;return{top:i,bottom:a,left:r,right:t,width:t-r,height:a-i,x:r,y:i}}return p}},floating:r.floating,strategy:a});return o.reference.x!==f.reference.x||o.reference.y!==f.reference.y||o.reference.width!==f.reference.width||o.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},Ma=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=pi(e,t),d={x:n,y:r},u=vi(o),p=gi(u);let h=d[p],f=d[u];const g=pi(s,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+m.mainAxis,n=i.reference[p]+i.reference[e]-m.mainAxis;h<t?h=t:h>n&&(h=n)}if(c){var b,v;const e="y"===p?"width":"height",t=Ti.has(hi(o)),n=i.reference[u]-i.floating[e]+(t&&(null==(b=a.offset)?void 0:b[u])||0)+(t?0:m.crossAxis),r=i.reference[u]+i.reference[e]+(t?0:(null==(v=a.offset)?void 0:v[u])||0)-(t?m.crossAxis:0);f<n?f=n:f>r&&(f=r)}return{[p]:h,[u]:f}}}},Ta=(e,t,n)=>{const r=new Map,o={platform:Na,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Ri(c,r,l),p=r,h={},f=0;for(let n=0;n<s.length;n++){const{name:i,fn:g}=s[n],{x:m,y:b,data:v,reset:w}=await g({x:d,y:u,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=m?m:d,u=null!=b?b:u,h={...h,[i]:{...h[i],...v}},w&&f<=50&&(f++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:d,y:u}=Ri(c,p,l))),n=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};var Ia="undefined"!=typeof document?g:function(){};function _a(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!_a(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!_a(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Aa(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function La(e,t){const n=Aa(e);return Math.round(t*n)/n}function Ha(e){const t=r.useRef(e);return Ia(()=>{t.current=e}),t}function Fa(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=r.useState(o);_a(h,o)||f(o);const[g,m]=r.useState(null),[b,w]=r.useState(null),y=r.useCallback(e=>{e!==O.current&&(O.current=e,m(e))},[]),x=r.useCallback(e=>{e!==C.current&&(C.current=e,w(e))},[]),k=a||g,N=s||b,O=r.useRef(null),C=r.useRef(null),S=r.useRef(u),j=null!=c,E=Ha(c),R=Ha(i),z=Ha(d),D=r.useCallback(()=>{if(!O.current||!C.current)return;const e={placement:t,strategy:n,middleware:h};R.current&&(e.platform=R.current),Ta(O.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==z.current};P.current&&!_a(S.current,t)&&(S.current=t,v.flushSync(()=>{p(t)}))})},[h,t,n,R,z]);Ia(()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const P=r.useRef(!1);Ia(()=>(P.current=!0,()=>{P.current=!1}),[]),Ia(()=>{if(k&&(O.current=k),N&&(C.current=N),k&&N){if(E.current)return E.current(k,N,D);D()}},[k,N,D,E,j]);const M=r.useMemo(()=>({reference:O,floating:C,setReference:y,setFloating:x}),[y,x]),T=r.useMemo(()=>({reference:k,floating:N}),[k,N]),I=r.useMemo(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=La(T.floating,u.x),r=La(T.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...Aa(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,T.floating,u.x,u.y]);return r.useMemo(()=>({...u,update:D,refs:M,elements:T,floatingStyles:I}),[u,D,M,T,I])}const Wa=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Da({element:n.current,padding:r}).fn(t):{}:n?Da({element:n,padding:r}).fn(t):{};var o}}),Ba=(e,t)=>({...Sa(e),options:[e,t]}),Ua=(e,t)=>({...ja(e),options:[e,t]}),Va=(e,t)=>({...Ma(e),options:[e,t]}),$a=(e,t)=>({...Ea(e),options:[e,t]}),Xa=(e,t)=>({...Ra(e),options:[e,t]}),Ya=(e,t)=>({...za(e),options:[e,t]}),Ka=(e,t)=>({...Pa(e),options:[e,t]}),qa=(e,t)=>({...Wa(e),options:[e,t]});var Ga=r.forwardRef((t,n)=>{const{children:r,width:o=10,height:i=5,...a}=t;return e(Se.svg,{...a,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:e("polygon",{points:"0,0 30,0 15,10"})})});Ga.displayName="Arrow";var Za=Ga;function Ja(e){const[t,n]=r.useState(void 0);return Ne(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var Qa="Popper",[es,ts]=pe(Qa),[ns,rs]=es(Qa),os=t=>{const{__scopePopper:n,children:o}=t,[i,a]=r.useState(null);return e(ns,{scope:n,anchor:i,onAnchorChange:a,children:o})};os.displayName=Qa;var is="PopperAnchor",as=r.forwardRef((t,n)=>{const{__scopePopper:o,virtualRef:i,...a}=t,s=rs(is,o),l=r.useRef(null),c=me(n,l),d=r.useRef(null);return r.useEffect(()=>{const e=d.current;d.current=i?.current||l.current,e!==d.current&&s.onAnchorChange(d.current)}),i?null:e(Se.div,{...a,ref:c})});as.displayName=is;var ss="PopperContent",[ls,cs]=es(ss),ds=r.forwardRef((t,n)=>{const{__scopePopper:o,side:i="bottom",sideOffset:a=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:m,...b}=t,v=rs(ss,o),[w,y]=r.useState(null),x=me(n,e=>y(e)),[k,N]=r.useState(null),O=Ja(k),C=O?.width??0,S=O?.height??0,j=i+("center"!==s?"-"+s:""),E="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},R=Array.isArray(u)?u:[u],z=R.length>0,D={padding:E,boundary:R.filter(fs),altBoundary:z},{refs:P,floatingStyles:M,placement:T,isPositioned:I,middlewareData:_}=Fa({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>Ca(...e,{animationFrame:"always"===g}),elements:{reference:v.anchor},middleware:[Ba({mainAxis:a+S,alignmentAxis:l}),d&&Ua({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?Va():void 0,...D}),d&&$a({...D}),Xa({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),k&&qa({element:k,padding:c}),gs({arrowWidth:C,arrowHeight:S}),f&&Ya({strategy:"referenceHidden",...D})]}),[A,L]=ms(T),H=Io(m);Ne(()=>{I&&H?.()},[I,H]);const F=_.arrow?.x,W=_.arrow?.y,B=0!==_.arrow?.centerOffset,[U,V]=r.useState();return Ne(()=>{w&&V(window.getComputedStyle(w).zIndex)},[w]),e("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:I?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e(ls,{scope:o,placedSide:A,onArrowChange:N,arrowX:F,arrowY:W,shouldHideArrow:B,children:e(Se.div,{"data-side":A,"data-align":L,...b,ref:x,style:{...b.style,animation:I?void 0:"none"}})})})});ds.displayName=ss;var us="PopperArrow",ps={top:"bottom",right:"left",bottom:"top",left:"right"},hs=r.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=cs(us,r),a=ps[i.placedSide];return e("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:e(Za,{...o,ref:n,style:{...o.style,display:"block"}})})});function fs(e){return null!==e}hs.displayName=us;var gs=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[l,c]=ms(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+s/2;let h="",f="";return"bottom"===l?(h=i?d:`${u}px`,f=-s+"px"):"top"===l?(h=i?d:`${u}px`,f=`${r.floating.height+s}px`):"right"===l?(h=-s+"px",f=i?d:`${p}px`):"left"===l&&(h=`${r.floating.width+s}px`,f=i?d:`${p}px`),{data:{x:h,y:f}}}});function ms(e){const[t,n="center"]=e.split("-");return[t,n]}var bs=os,vs=as,ws=ds,ys=hs,xs=r.forwardRef((t,n)=>{const{container:o,...i}=t,[a,s]=r.useState(!1);Ne(()=>s(!0),[]);const l=o||a&&globalThis?.document?.body;return l?w.createPortal(e(Se.div,{...i,ref:n}),l):null});xs.displayName="Portal";var ks=new WeakMap,Ns=new WeakMap,Os={},Cs=0,Ss=function(e){return e&&(e.host||Ss(e.parentNode))},js=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ss(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]);Os[n]||(Os[n]=new WeakMap);var i=Os[n],a=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var d=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))d(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(ks.get(e)||0)+1,c=(i.get(e)||0)+1;ks.set(e,l),i.set(e,c),a.push(e),1===l&&o&&Ns.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),s.clear(),Cs++,function(){a.forEach(function(e){var t=ks.get(e)-1,o=i.get(e)-1;ks.set(e,t),i.set(e,o),t||(Ns.has(e)||e.removeAttribute(r),Ns.delete(e)),o||e.removeAttribute(n)}),--Cs||(ks=new WeakMap,ks=new WeakMap,Ns=new WeakMap,Os={})}},Es=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),js(r,o,n,"aria-hidden")):function(){return null}},Rs="right-scroll-bar-position",zs="width-before-scroll-bar";function Ds(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Ps="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,Ms=new WeakMap;function Ts(e,t){var n,r,o,i=(n=t||null,r=function(t){return e.forEach(function(e){return Ds(e,t)})},(o=u(function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=r,o.facade);return Ps(function(){var t=Ms.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach(function(e){r.has(e)||Ds(e,null)}),r.forEach(function(e){n.has(e)||Ds(e,o)})}Ms.set(i,e)},[e]),i}function Is(e){return e}var _s=function(e){var t=e.sideCar,n=de(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,ce({},n))};_s.isSideCarExport=!0;var As=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Is);var n=[],r=!1;return{read:function(){if(r)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 o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=ce({async:!0,ssr:!1},e),t}(),Ls=function(){},Hs=r.forwardRef(function(e,t){var n=r.useRef(null),o=r.useState({onScrollCapture:Ls,onWheelCapture:Ls,onTouchMoveCapture:Ls}),i=o[0],a=o[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,h=e.sideCar,f=e.noRelative,g=e.noIsolation,m=e.inert,b=e.allowPinchZoom,v=e.as,w=void 0===v?"div":v,y=e.gapMode,x=de(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,N=Ts([n,t]),O=ce(ce({},x),i);return r.createElement(r.Fragment,null,u&&r.createElement(k,{sideCar:As,removeScrollBar:d,shards:p,noRelative:f,noIsolation:g,inert:m,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:y}),s?r.cloneElement(r.Children.only(l),ce(ce({},O),{ref:N})):r.createElement(w,ce({},O,{className:c,ref:N}),l))});Hs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Hs.classNames={fullWidth:zs,zeroRight:Rs};function Fs(){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 Ws=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=Fs())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Bs=function(){var e,t=(e=Ws(),function(t,n){r.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},Us={left:0,top:0,right:0,gap:0},Vs=function(e){return parseInt(e||"",10)||0},$s=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Us;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Vs(n),Vs(r),Vs(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Xs=Bs(),Ys="data-scroll-locked",Ks=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(Ys,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Rs," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(zs," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Rs," .").concat(Rs," {\n right: 0 ").concat(r,";\n }\n \n .").concat(zs," .").concat(zs," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Ys,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},qs=function(){var e=parseInt(document.body.getAttribute(Ys)||"0",10);return isFinite(e)?e:0},Gs=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,i=void 0===o?"margin":o;r.useEffect(function(){return document.body.setAttribute(Ys,(qs()+1).toString()),function(){var e=qs()-1;e<=0?document.body.removeAttribute(Ys):document.body.setAttribute(Ys,e.toString())}},[]);var a=r.useMemo(function(){return $s(i)},[i]);return r.createElement(Xs,{styles:Ks(a,!t,i,n?"":"!important")})},Zs=!1;if("undefined"!=typeof window)try{var Js=Object.defineProperty({},"passive",{get:function(){return Zs=!0,!0}});window.addEventListener("test",Js,Js),window.removeEventListener("test",Js,Js)}catch(e){Zs=!1}var Qs=!!Zs&&{passive:!1},el=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])},tl=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),nl(e,r)){var o=rl(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nl=function(e,t){return"v"===e?function(e){return el(e,"overflowY")}(t):function(e){return el(e,"overflowX")}(t)},rl=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},ol=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},il=function(e){return[e.deltaX,e.deltaY]},al=function(e){return e&&"current"in e?e.current:e},sl=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},ll=0,cl=[];function dl(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ul,pl=(ul=function(e){var t=r.useRef([]),n=r.useRef([0,0]),o=r.useRef(),i=r.useState(ll++)[0],a=r.useState(Bs)[0],s=r.useRef(e);r.useEffect(function(){s.current=e},[e]),r.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(al),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=r.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var r,i=ol(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var p=window.getSelection(),h=p&&p.anchorNode;if(h&&(h===d||h.contains(d)))return!1;var f=tl(u,d);if(!f)return!0;if(f?r=u:(r="v"===u?"h":"v",f=tl(u,d)),!f)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=r),!r)return!0;var g=o.current||r;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,d=a>0,u=0,p=0;do{if(!s)break;var h=rl(e,s),f=h[0],g=h[1]-h[2]-i*f;(f||g)&&nl(e,s)&&(u+=g,p+=f);var m=s.parentNode;s=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(o&&Math.abs(u)<1||!o&&a>u)||!d&&(o&&Math.abs(p)<1||!o&&-a>p))&&(c=!0),c}(g,t,e,"h"===g?l:c,!0)},[]),c=r.useCallback(function(e){var n=e;if(cl.length&&cl[cl.length-1]===a){var r="deltaY"in n?il(n):ol(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var i=(s.current.shards||[]).map(al).filter(Boolean).filter(function(e){return e.contains(n.target)});(i.length>0?l(n,i[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),d=r.useCallback(function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:dl(r)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),u=r.useCallback(function(e){n.current=ol(e),o.current=void 0},[]),p=r.useCallback(function(t){d(t.type,il(t),t.target,l(t,e.lockRef.current))},[]),h=r.useCallback(function(t){d(t.type,ol(t),t.target,l(t,e.lockRef.current))},[]);r.useEffect(function(){return cl.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Qs),document.addEventListener("touchmove",c,Qs),document.addEventListener("touchstart",u,Qs),function(){cl=cl.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,Qs),document.removeEventListener("touchmove",c,Qs),document.removeEventListener("touchstart",u,Qs)}},[]);var f=e.removeScrollBar,g=e.inert;return r.createElement(r.Fragment,null,g?r.createElement(a,{styles:sl(i)}):null,f?r.createElement(Gs,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},As.useMedium(ul),_s),hl=r.forwardRef(function(e,t){return r.createElement(Hs,ce({},e,{ref:t,sideCar:pl}))});hl.classNames=Hs.classNames;var fl=hl,gl="Popover",[ml,bl]=pe(gl,[ts]),vl=ts(),[wl,yl]=ml(gl),xl=t=>{const{__scopePopover:n,children:o,open:i,defaultOpen:a,onOpenChange:s,modal:l=!1}=t,c=vl(n),d=r.useRef(null),[u,p]=r.useState(!1),[h,f]=Ce({prop:i,defaultProp:a??!1,onChange:s,caller:gl});return e(bs,{...c,children:e(wl,{scope:n,contentId:Pe(),triggerRef:d,open:h,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:u,onCustomAnchorAdd:r.useCallback(()=>p(!0),[]),onCustomAnchorRemove:r.useCallback(()=>p(!1),[]),modal:l,children:o})})};xl.displayName=gl;var kl="PopoverAnchor";r.forwardRef((t,n)=>{const{__scopePopover:o,...i}=t,a=yl(kl,o),s=vl(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=a;return r.useEffect(()=>(l(),()=>c()),[l,c]),e(vs,{...s,...i,ref:n})}).displayName=kl;var Nl="PopoverTrigger",Ol=r.forwardRef((t,n)=>{const{__scopePopover:r,...o}=t,i=yl(Nl,r),a=vl(r),s=me(n,i.triggerRef),l=e(Se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":_l(i.open),...o,ref:s,onClick:ke(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:e(vs,{asChild:!0,...a,children:l})});Ol.displayName=Nl;var Cl="PopoverPortal",[Sl,jl]=ml(Cl,{forceMount:void 0}),El=t=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=t,a=yl(Cl,n);return e(Sl,{scope:n,forceMount:r,children:e(Ee,{present:r||a.open,children:e(xs,{asChild:!0,container:i,children:o})})})};El.displayName=Cl;var Rl="PopoverContent",zl=r.forwardRef((t,n)=>{const r=jl(Rl,t.__scopePopover),{forceMount:o=r.forceMount,...i}=t,a=yl(Rl,t.__scopePopover);return e(Ee,{present:o||a.open,children:a.modal?e(Pl,{...i,ref:n}):e(Ml,{...i,ref:n})})});zl.displayName=Rl;var Dl=be("PopoverContent.RemoveScroll"),Pl=r.forwardRef((t,n)=>{const o=yl(Rl,t.__scopePopover),i=r.useRef(null),a=me(n,i),s=r.useRef(!1);return r.useEffect(()=>{const e=i.current;if(e)return Es(e)},[]),e(fl,{as:Dl,allowPinchZoom:!0,children:e(Tl,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(t.onCloseAutoFocus,e=>{e.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:ke(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:ke(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ml=r.forwardRef((t,n)=>{const o=yl(Rl,t.__scopePopover),i=r.useRef(!1),a=r.useRef(!1);return e(Tl,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(i.current||o.triggerRef.current?.focus(),e.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(i.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,r=o.triggerRef.current?.contains(n);r&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),Tl=r.forwardRef((t,n)=>{const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=t,h=yl(Rl,r),f=vl(r);return $o(),e(Go,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:a,children:e(Wo,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:e(ws,{"data-state":_l(h.open),role:"dialog",id:h.contentId,...f,...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)"}})})})}),Il="PopoverClose";r.forwardRef((t,n)=>{const{__scopePopover:r,...o}=t,i=yl(Il,r);return e(Se.button,{type:"button",...o,ref:n,onClick:ke(t.onClick,()=>i.onOpenChange(!1))})}).displayName=Il;function _l(e){return e?"open":"closed"}r.forwardRef((t,n)=>{const{__scopePopover:r,...o}=t,i=vl(r);return e(ys,{...i,...o,ref:n})}).displayName="PopoverArrow";var Al=El,Ll=zl;const Hl=xl,Fl=Ol,Wl=r.forwardRef((t,n)=>{var{className:r,align:o="center",sideOffset:i=4}=t,a=de(t,["className","align","sideOffset"]);return e(Al,{children:e(Ll,Object.assign({ref:n,align:o,sideOffset:i,className:Or("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r)},a))})});Wl.displayName=Ll.displayName;const Bl=({value:t,options:r,onValueChange:o,currentLabel:i})=>{const[a,s]=u(!1),[c,d]=u(""),p=l(()=>{if(!c)return r;const e=c.toLowerCase();return r.filter(t=>t.label.toLowerCase().includes(e)||t.value.toLowerCase().includes(e))},[c,r]);return n(Hl,Object.assign({open:a,onOpenChange:s},{children:[e(Fl,Object.assign({asChild:!0},{children:n(vo,Object.assign({variant:"outline",size:"sm",className:"h-7 gap-1.5 text-xs font-mono",contentEditable:!1},{children:[i,e(Vt,{className:"h-3 w-3 opacity-50"})]}))})),e(Wl,Object.assign({className:"w-64 p-0",align:"start",contentEditable:!1,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},{children:n("div",Object.assign({className:"p-2"},{children:[n("div",Object.assign({className:"relative mb-2"},{children:[e(wn,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),e(To,{placeholder:"Search language...",value:c,onChange:e=>d(e.target.value),className:"h-8 pl-7 text-xs",autoFocus:!0})]})),e("div",Object.assign({className:"max-h-[200px] overflow-y-auto"},{children:0===p.length?e("div",Object.assign({className:"px-2 py-4 text-center text-sm text-muted-foreground"},{children:"No languages found"})):e("div",Object.assign({className:"space-y-0.5"},{children:p.map(n=>e("button",Object.assign({type:"button",onClick:()=>{return e=n.value,o(e),s(!1),void d("");var e},className:Or("w-full rounded-sm px-2 py-1.5 text-left text-xs font-mono transition-colors","hover:bg-accent hover:text-accent-foreground",t===n.value&&"bg-accent text-accent-foreground")},{children:n.label}),n.value))}))}))]}))}))]}))},Ul=({value:t,options:r,onValueChange:o,currentLabel:i})=>{const[a,s]=u(!1),[c,d]=u(""),p=l(()=>{if(!c)return r;const e=c.toLowerCase();return r.filter(t=>t.label.toLowerCase().includes(e)||t.value.toLowerCase().includes(e))},[c,r]);return n(Hl,Object.assign({open:a,onOpenChange:s},{children:[e(Fl,Object.assign({asChild:!0},{children:n(vo,Object.assign({variant:"outline",size:"sm",className:"h-7 gap-1.5 text-xs",contentEditable:!1},{children:[i,e(Vt,{className:"h-3 w-3 opacity-50"})]}))})),e(Wl,Object.assign({className:"w-64 p-0",align:"start",contentEditable:!1,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},{children:n("div",Object.assign({className:"p-2"},{children:[n("div",Object.assign({className:"relative mb-2"},{children:[e(wn,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),e(To,{placeholder:"Search theme...",value:c,onChange:e=>d(e.target.value),className:"h-8 pl-7 text-xs",autoFocus:!0})]})),e("div",Object.assign({className:"max-h-[200px] overflow-y-auto"},{children:0===p.length?e("div",Object.assign({className:"px-2 py-4 text-center text-sm text-muted-foreground"},{children:"No themes found"})):e("div",Object.assign({className:"space-y-0.5"},{children:p.map(n=>e("button",Object.assign({type:"button",onClick:()=>{return e=n.value,o(e),s(!1),void d("");var e},className:Or("w-full rounded-sm px-2 py-1.5 text-left text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",t===n.value&&"bg-accent text-accent-foreground")},{children:n.label}),n.value))}))}))]}))}))]}))},Vl=e=>{var t;if(M.isText(e))return e.text;if("object"==typeof e&&null!==e&&"children"in e){const n=e.children;return null!==(t=null==n?void 0:n.map(Vl).join("\n"))&&void 0!==t?t:""}return""},$l={code:{render:({attributes:t,children:r,element:o,blockId:i})=>{var a,s,l,h,f,g;const m=x(),b=null!==(s=null===(a=o.props)||void 0===a?void 0:a.language)&&void 0!==s?s:"javascript",v=null!==(h=null===(l=o.props)||void 0===l?void 0:l.theme)&&void 0!==h?h:"github-dark",w=d(null),[y,O]=u(!1),[C,S]=u(!1),[j,E]=u({background:"",foreground:"",caret:"",tabActiveBackground:"",tabInactiveBackground:"",buttonForeground:""});p(()=>{var e,t,n,r,o,i,a,s,l,c,d,u,p,h;if(window.yShiki){const f=window.yShiki.getTheme(v);E({background:f.bg,foreground:f.fg,caret:null!==(t=null===(e=f.colors)||void 0===e?void 0:e["editorCursor.foreground"])&&void 0!==t?t:f.fg,tabActiveBackground:null!==(i=null!==(r=null===(n=f.colors)||void 0===n?void 0:n["editorTab.activeBackground"])&&void 0!==r?r:null===(o=f.colors)||void 0===o?void 0:o["tab.activeBackground"])&&void 0!==i?i:f.bg,tabInactiveBackground:null!==(c=null!==(s=null===(a=f.colors)||void 0===a?void 0:a["editorTab.inactiveBackground"])&&void 0!==s?s:null===(l=f.colors)||void 0===l?void 0:l["tab.inactiveBackground"])&&void 0!==c?c:f.bg,buttonForeground:null!==(h=null!==(u=null===(d=f.colors)||void 0===d?void 0:d["button.foreground"])&&void 0!==u?u:null===(p=f.colors)||void 0===p?void 0:p["icon.foreground"])&&void 0!==h?h:f.fg})}},[v]);const z=c(()=>{const e=Vl(o);Po(e)&&(O(!0),setTimeout(()=>O(!1),1500))},[o]),D=c(()=>{const e=k.getBlockSlate(m,{id:i});if(!e)return;const t=N.getElementPath(m,{blockId:i,element:o});if(!t)return;const n=t?R.parent(e,t):void 0;n&&P.isElement(n[0])&&!R.isEditor(n[0])?N.deleteElement(m,{blockId:i,type:"code",path:t}):k.deleteBlock(m,{blockId:i,focus:!0})},[m,i,o]),M=c(e=>{T.updateCodeLanguage(m,i,e)},[m,i]),H=c(e=>{T.updateCodeTheme(m,i,e)},[m,i]),F=c(()=>ue(void 0,void 0,void 0,function*(){if(!C){S(!0);try{yield T.beautifyCode(m,i)}finally{S(!1)}}}),[m,i,C]),W=I(b),B=null!==(f=_.find(e=>e.value===b))&&void 0!==f?f:_[0],U=null!==(g=A.find(e=>e.value===v))&&void 0!==g?g:A[0];return n("div",Object.assign({},t,{className:"relative my-2 group/code-block rounded-lg border border-border bg-muted/50 overflow-hidden"},{children:[n("div",Object.assign({contentEditable:!1,className:"flex items-center justify-between px-4 py-2 border-b border-border select-none",style:{backgroundColor:j.tabActiveBackground||void 0}},{children:[n("div",Object.assign({className:"flex items-center gap-2"},{children:[e(Bl,{value:b,options:_,onValueChange:e=>M(e),currentLabel:B.label}),e(Ul,{value:v,options:A,onValueChange:e=>H(e),currentLabel:U.label})]})),n("div",Object.assign({className:"flex items-center gap-1 opacity-0 group-hover/code-block:opacity-100 transition-opacity"},{children:[W&&e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:F,disabled:C,title:"Beautify code",style:{color:j.buttonForeground||void 0}},{children:e(xn,{className:"h-4 w-4 "+(C?"animate-pulse":"")})})),e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:z,title:y?"Copied!":"Copy code",style:{color:j.buttonForeground||void 0}},{children:e(y?Ut:Zt,{className:"h-4 w-4"})})),e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:"Delete code block",style:{color:j.buttonForeground||void 0}},{children:e(Nn,{className:"h-4 w-4"})}))]}))]})),n("div",Object.assign({className:"relative bg-background overflow-hidden",style:{backgroundColor:j.background,color:j.foreground,caretColor:j.caret}},{children:[e("div",Object.assign({ref:w,className:"absolute inset-0 p-4 font-mono text-sm whitespace-pre overflow-auto pointer-events-none z-10 select-none",style:{lineHeight:"1.6",tabSize:2},contentEditable:!1,"aria-hidden":"true"},{children:e(L,{element:o,language:b,theme:v})})),e("div",Object.assign({className:"relative p-4 font-mono text-sm whitespace-pre overflow-auto",style:{lineHeight:"1.6",tabSize:2,color:"transparent",caretColor:j.caret},onScroll:e=>{w.current&&(w.current.scrollTop=e.currentTarget.scrollTop,w.current.scrollLeft=e.currentTarget.scrollLeft)}},{children:r}))]}))]}))}}};var Xl="rovingFocusGroup.onEntryFocus",Yl={bubbles:!1,cancelable:!0},Kl="RovingFocusGroup",[ql,Gl,Zl]=xe(Kl),[Jl,Ql]=pe(Kl,[Zl]),[ec,tc]=Jl(Kl),nc=r.forwardRef((t,n)=>e(ql.Provider,{scope:t.__scopeRovingFocusGroup,children:e(ql.Slot,{scope:t.__scopeRovingFocusGroup,children:e(rc,{...t,ref:n})})}));nc.displayName=Kl;var rc=r.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,orientation:i,loop:a=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...h}=t,f=r.useRef(null),g=me(n,f),m=qe(s),[b,v]=Ce({prop:l,defaultProp:c??null,onChange:d,caller:Kl}),[w,y]=r.useState(!1),x=Io(u),k=Gl(o),N=r.useRef(!1),[O,C]=r.useState(0);return r.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(Xl,x),()=>e.removeEventListener(Xl,x)},[x]),e(ec,{scope:o,orientation:i,dir:m,loop:a,currentTabStopId:b,onItemFocus:r.useCallback(e=>v(e),[v]),onItemShiftTab:r.useCallback(()=>y(!0),[]),onFocusableItemAdd:r.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>C(e=>e-1),[]),children:e(Se.div,{tabIndex:w||0===O?-1:0,"data-orientation":i,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:ke(t.onMouseDown,()=>{N.current=!0}),onFocus:ke(t.onFocus,e=>{const t=!N.current;if(e.target===e.currentTarget&&t&&!w){const t=new CustomEvent(Xl,Yl);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);sc([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}N.current=!1}),onBlur:ke(t.onBlur,()=>y(!1))})})}),oc="RovingFocusGroupItem",ic=r.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,focusable:i=!0,active:a=!1,tabStopId:s,children:l,...c}=t,d=Pe(),u=s||d,p=tc(oc,o),h=p.currentTabStopId===u,f=Gl(o),{onFocusableItemAdd:g,onFocusableItemRemove:m,currentTabStopId:b}=p;return r.useEffect(()=>{if(i)return g(),()=>m()},[i,g,m]),e(ql.ItemSlot,{scope:o,id:u,focusable:i,active:a,children:e(Se.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:n,onMouseDown:ke(t.onMouseDown,e=>{i?p.onItemFocus(u):e.preventDefault()}),onFocus:ke(t.onFocus,()=>p.onItemFocus(u)),onKeyDown:ke(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:ac[r]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=p.loop?(r=i+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(i+1)}setTimeout(()=>sc(o))}var n,r}),children:"function"==typeof l?l({isCurrentTabStop:h,hasTabStop:null!=b}):l})})});ic.displayName=oc;var ac={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sc(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var lc=nc,cc=ic,dc="Tabs",[uc,pc]=pe(dc,[Ql]),hc=Ql(),[fc,gc]=uc(dc),mc=r.forwardRef((t,n)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:a,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=t,u=qe(l),[p,h]=Ce({prop:o,onChange:i,defaultProp:a??"",caller:dc});return e(fc,{scope:r,baseId:Pe(),value:p,onValueChange:h,orientation:s,dir:u,activationMode:c,children:e(Se.div,{dir:u,"data-orientation":s,...d,ref:n})})});mc.displayName=dc;var bc="TabsList",vc=r.forwardRef((t,n)=>{const{__scopeTabs:r,loop:o=!0,...i}=t,a=gc(bc,r),s=hc(r);return e(lc,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:o,children:e(Se.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:n})})});vc.displayName=bc;var wc="TabsTrigger",yc=r.forwardRef((t,n)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...a}=t,s=gc(wc,r),l=hc(r),c=Nc(s.baseId,o),d=Oc(s.baseId,o),u=o===s.value;return e(cc,{asChild:!0,...l,focusable:!i,active:u,children:e(Se.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:n,onMouseDown:ke(t.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(o)}),onKeyDown:ke(t.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(o)}),onFocus:ke(t.onFocus,()=>{const e="manual"!==s.activationMode;u||i||!e||s.onValueChange(o)})})})});yc.displayName=wc;var xc="TabsContent",kc=r.forwardRef((t,n)=>{const{__scopeTabs:o,value:i,forceMount:a,children:s,...l}=t,c=gc(xc,o),d=Nc(c.baseId,i),u=Oc(c.baseId,i),p=i===c.value,h=r.useRef(p);return r.useEffect(()=>{const e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),e(Ee,{present:a||p,children:({present:r})=>e(Se.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!r,id:u,tabIndex:0,...l,ref:n,style:{...t.style,animationDuration:h.current?"0s":void 0},children:r&&s})})});function Nc(e,t){return`${e}-trigger-${t}`}function Oc(e,t){return`${e}-content-${t}`}kc.displayName=xc;var Cc=vc,Sc=yc,jc=kc;const Ec=mc,Rc=r.forwardRef((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e(Cc,Object.assign({ref:n,className:Or("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r)},o))});Rc.displayName=Cc.displayName;const zc=r.forwardRef((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e(Sc,Object.assign({ref:n,className:Or("inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",r)},o))});zc.displayName=Sc.displayName;const Dc=r.forwardRef((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e(jc,Object.assign({ref:n,className:Or("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r)},o))});Dc.displayName=jc.displayName;const Pc=e=>{var t;if(M.isText(e))return e.text;if("object"==typeof e&&null!==e&&"children"in e){const n=e.children;return null!==(t=null==n?void 0:n.map(Pc).join("\n"))&&void 0!==t?t:""}return""};function Mc(e,[t,n]){return Math.min(n,Math.max(t,e))}var Tc="ScrollArea",[Ic,_c]=pe(Tc),[Ac,Lc]=Ic(Tc),Hc=r.forwardRef((t,n)=>{const{__scopeScrollArea:o,type:i="hover",dir:a,scrollHideDelay:s=600,...l}=t,[c,d]=r.useState(null),[u,p]=r.useState(null),[h,f]=r.useState(null),[g,m]=r.useState(null),[b,v]=r.useState(null),[w,y]=r.useState(0),[x,k]=r.useState(0),[N,O]=r.useState(!1),[C,S]=r.useState(!1),j=me(n,e=>d(e)),E=qe(a);return e(Ac,{scope:o,type:i,dir:E,scrollHideDelay:s,scrollArea:c,viewport:u,onViewportChange:p,content:h,onContentChange:f,scrollbarX:g,onScrollbarXChange:m,scrollbarXEnabled:N,onScrollbarXEnabledChange:O,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:C,onScrollbarYEnabledChange:S,onCornerWidthChange:y,onCornerHeightChange:k,children:e(Se.div,{dir:E,...l,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});Hc.displayName=Tc;var Fc="ScrollAreaViewport",Wc=r.forwardRef((o,i)=>{const{__scopeScrollArea:a,children:s,nonce:l,...c}=o,d=Lc(Fc,a),u=me(i,r.useRef(null),d.onViewportChange);return n(t,{children:[e("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),e(Se.div,{"data-radix-scroll-area-viewport":"",...c,ref:u,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...o.style},children:e("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});Wc.displayName=Fc;var Bc="ScrollAreaScrollbar",Uc=r.forwardRef((t,n)=>{const{forceMount:o,...i}=t,a=Lc(Bc,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=a,c="horizontal"===t.orientation;return r.useEffect(()=>(c?s(!0):l(!0),()=>{c?s(!1):l(!1)}),[c,s,l]),"hover"===a.type?e(Vc,{...i,ref:n,forceMount:o}):"scroll"===a.type?e($c,{...i,ref:n,forceMount:o}):"auto"===a.type?e(Xc,{...i,ref:n,forceMount:o}):"always"===a.type?e(Yc,{...i,ref:n}):null});Uc.displayName=Bc;var Vc=r.forwardRef((t,n)=>{const{forceMount:o,...i}=t,a=Lc(Bc,t.__scopeScrollArea),[s,l]=r.useState(!1);return r.useEffect(()=>{const e=a.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),l(!0)},r=()=>{t=window.setTimeout(()=>l(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[a.scrollArea,a.scrollHideDelay]),e(Ee,{present:o||s,children:e(Xc,{"data-state":s?"visible":"hidden",...i,ref:n})})}),$c=r.forwardRef((t,n)=>{const{forceMount:o,...i}=t,a=Lc(Bc,t.__scopeScrollArea),s="horizontal"===t.orientation,l=pd(()=>d("SCROLL_END"),100),[c,d]=(u="hidden",p={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},r.useReducer((e,t)=>p[e][t]??e,u));var u,p;return r.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,a.scrollHideDelay,d]),r.useEffect(()=>{const e=a.viewport,t=s?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(d("SCROLL"),l()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[a.viewport,s,d,l]),e(Ee,{present:o||"hidden"!==c,children:e(Yc,{"data-state":"hidden"===c?"hidden":"visible",...i,ref:n,onPointerEnter:ke(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:ke(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),Xc=r.forwardRef((t,n)=>{const o=Lc(Bc,t.__scopeScrollArea),{forceMount:i,...a}=t,[s,l]=r.useState(!1),c="horizontal"===t.orientation,d=pd(()=>{if(o.viewport){const e=o.viewport.offsetWidth<o.viewport.scrollWidth,t=o.viewport.offsetHeight<o.viewport.scrollHeight;l(c?e:t)}},10);return hd(o.viewport,d),hd(o.content,d),e(Ee,{present:i||s,children:e(Yc,{"data-state":s?"visible":"hidden",...a,ref:n})})}),Yc=r.forwardRef((t,n)=>{const{orientation:o="vertical",...i}=t,a=Lc(Bc,t.__scopeScrollArea),s=r.useRef(null),l=r.useRef(0),[c,d]=r.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ad(c.viewport,c.content),p={...i,sizes:c,onSizesChange:d,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>s.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function h(e,t){return function(e,t,n,r="ltr"){const o=sd(n),i=o/2,a=t||i,s=o-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,d=n.content-n.viewport,u="ltr"===r?[0,d]:[-1*d,0];return cd([l,c],u)(e)}(e,l.current,c,t)}return"horizontal"===o?e(Kc,{...p,ref:n,onThumbPositionChange:()=>{if(a.viewport&&s.current){const e=ld(a.viewport.scrollLeft,c,a.dir);s.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=h(e,a.dir))}}):"vertical"===o?e(qc,{...p,ref:n,onThumbPositionChange:()=>{if(a.viewport&&s.current){const e=ld(a.viewport.scrollTop,c);s.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=h(e))}}):null}),Kc=r.forwardRef((t,n)=>{const{sizes:o,onSizesChange:i,...a}=t,s=Lc(Bc,t.__scopeScrollArea),[l,c]=r.useState(),d=r.useRef(null),u=me(n,d,s.onScrollbarXChange);return r.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),e(Jc,{"data-orientation":"horizontal",...a,ref:u,sizes:o,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":sd(o)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,n)=>{if(s.viewport){const r=s.viewport.scrollLeft+e.deltaX;t.onWheelScroll(r),dd(r,n)&&e.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&i({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:id(l.paddingLeft),paddingEnd:id(l.paddingRight)}})}})}),qc=r.forwardRef((t,n)=>{const{sizes:o,onSizesChange:i,...a}=t,s=Lc(Bc,t.__scopeScrollArea),[l,c]=r.useState(),d=r.useRef(null),u=me(n,d,s.onScrollbarYChange);return r.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),e(Jc,{"data-orientation":"vertical",...a,ref:u,sizes:o,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":sd(o)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,n)=>{if(s.viewport){const r=s.viewport.scrollTop+e.deltaY;t.onWheelScroll(r),dd(r,n)&&e.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&i({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:id(l.paddingTop),paddingEnd:id(l.paddingBottom)}})}})}),[Gc,Zc]=Ic(Bc),Jc=r.forwardRef((t,n)=>{const{__scopeScrollArea:o,sizes:i,hasThumb:a,onThumbChange:s,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:p,onResize:h,...f}=t,g=Lc(Bc,o),[m,b]=r.useState(null),v=me(n,e=>b(e)),w=r.useRef(null),y=r.useRef(""),x=g.viewport,k=i.content-i.viewport,N=Io(p),O=Io(d),C=pd(h,10);function S(e){if(w.current){const t=e.clientX-w.current.left,n=e.clientY-w.current.top;u({x:t,y:n})}}return r.useEffect(()=>{const e=e=>{const t=e.target,n=m?.contains(t);n&&N(e,k)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,m,k,N]),r.useEffect(O,[i,O]),hd(m,C),hd(g.content,C),e(Gc,{scope:o,scrollbar:m,hasThumb:a,onThumbChange:Io(s),onThumbPointerUp:Io(l),onThumbPositionChange:O,onThumbPointerDown:Io(c),children:e(Se.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:ke(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),w.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),S(e)}}),onPointerMove:ke(t.onPointerMove,S),onPointerUp:ke(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,g.viewport&&(g.viewport.style.scrollBehavior=""),w.current=null})})})}),Qc="ScrollAreaThumb",ed=r.forwardRef((t,n)=>{const{forceMount:r,...o}=t,i=Zc(Qc,t.__scopeScrollArea);return e(Ee,{present:r||i.hasThumb,children:e(td,{ref:n,...o})})}),td=r.forwardRef((t,n)=>{const{__scopeScrollArea:o,style:i,...a}=t,s=Lc(Qc,o),l=Zc(Qc,o),{onThumbPositionChange:c}=l,d=me(n,e=>l.onThumbChange(e)),u=r.useRef(void 0),p=pd(()=>{u.current&&(u.current(),u.current=void 0)},100);return r.useEffect(()=>{const e=s.viewport;if(e){const t=()=>{if(p(),!u.current){const t=ud(e,c);u.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[s.viewport,p,c]),e(Se.div,{"data-state":l.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:ke(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;l.onThumbPointerDown({x:n,y:r})}),onPointerUp:ke(t.onPointerUp,l.onThumbPointerUp)})});ed.displayName=Qc;var nd="ScrollAreaCorner",rd=r.forwardRef((t,n)=>{const r=Lc(nd,t.__scopeScrollArea),o=Boolean(r.scrollbarX&&r.scrollbarY);return"scroll"!==r.type&&o?e(od,{...t,ref:n}):null});rd.displayName=nd;var od=r.forwardRef((t,n)=>{const{__scopeScrollArea:o,...i}=t,a=Lc(nd,o),[s,l]=r.useState(0),[c,d]=r.useState(0),u=Boolean(s&&c);return hd(a.scrollbarX,()=>{const e=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(e),d(e)}),hd(a.scrollbarY,()=>{const e=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(e),l(e)}),u?e(Se.div,{...i,ref:n,style:{width:s,height:c,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...t.style}}):null});function id(e){return e?parseInt(e,10):0}function ad(e,t){const n=e/t;return isNaN(n)?0:n}function sd(e){const t=ad(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ld(e,t,n="ltr"){const r=sd(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,s=i-r,l=Mc(e,"ltr"===n?[0,a]:[-1*a,0]);return cd([0,a],[0,s])(l)}function cd(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function dd(e,t){return e>0&&e<t}var ud=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,s=n.top!==i.top;(a||s)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function pd(e,t){const n=Io(e),o=r.useRef(0);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),r.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(n,t)},[n,t])}function hd(e,t){const n=Io(t);Ne(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var fd=Hc,gd=Wc,md=rd;const bd=t=>{var{className:n,orientation:r="vertical"}=t,o=de(t,["className","orientation"]);return e(Uc,Object.assign({"data-slot":"scroll-area-scrollbar",orientation:r,className:Or("flex touch-none p-px transition-colors select-none","vertical"===r&&"h-full w-2.5 border-l border-l-transparent","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent",n)},o,{children:e(ed,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})}))},vd=t=>{var{className:r,children:o}=t,i=de(t,["className","children"]);return n(fd,Object.assign({"data-slot":"scroll-area",className:Or("relative",r)},i,{children:[e(gd,Object.assign({"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"},{children:o})),e(bd,{}),e(md,{})]}))};le("[data-code-group-container] [data-state=active]{background-color:var(--code-group-tab-active-bg)!important;border-bottom-color:var(--code-group-tab-active-fg)!important;color:var(--code-group-tab-active-fg)!important}[data-code-group-container] [data-state=inactive]{background-color:var(--code-group-tab-inactive-bg)!important;color:var(--code-group-tab-inactive-fg)!important}");const wd={"code-group-container":{render:t=>{var n,r;const{attributes:o,children:i,blockId:a,element:s}=t,l=x(),c=null===(n=t.element.props)||void 0===n?void 0:n.theme;p(()=>{var e,t,n,r,o,i,a,s,l,d,u,p,h,f,g,m,b,v,w,y,x,k,N,O,C,S,j,E,R,z,D,P,M,T,I,_;if(window.yShiki){const A=window.yShiki.getTheme(c),L=null!==(r=null!==(t=null===(e=A.colors)||void 0===e?void 0:e["tab.activeBackground"])&&void 0!==t?t:null===(n=A.colors)||void 0===n?void 0:n["editorTab.activeBackground"])&&void 0!==r?r:A.bg,H={"code-group-tab-active-bg":L,"code-group-tab-inactive-bg":null!==(d=null!==(s=null!==(i=null===(o=A.colors)||void 0===o?void 0:o["tab.inactiveBackground"])&&void 0!==i?i:null===(a=A.colors)||void 0===a?void 0:a["editorTab.inactiveBackground"])&&void 0!==s?s:null===(l=A.colors)||void 0===l?void 0:l["editorGroupHeader.tabsBackground"])&&void 0!==d?d:A.bg,"code-group-tab-active-fg":null!==(f=null!==(p=null===(u=A.colors)||void 0===u?void 0:u["tab.activeForeground"])&&void 0!==p?p:null===(h=A.colors)||void 0===h?void 0:h["editorTab.activeForeground"])&&void 0!==f?f:A.fg,"code-group-tab-inactive-fg":null!==(y=null!==(v=null!==(m=null===(g=A.colors)||void 0===g?void 0:g["tab.inactiveForeground"])&&void 0!==m?m:null===(b=A.colors)||void 0===b?void 0:b["editorTab.inactiveForeground"])&&void 0!==v?v:null===(w=A.colors)||void 0===w?void 0:w.foreground)&&void 0!==y?y:A.fg,"code-group-tab-active-border":null!==(O=null!==(k=null===(x=A.colors)||void 0===x?void 0:x["tab.activeBorder"])&&void 0!==k?k:null===(N=A.colors)||void 0===N?void 0:N["editorTab.activeBorder"])&&void 0!==O?O:L,"code-group-tab-border":null!==(z=null!==(E=null!==(S=null===(C=A.colors)||void 0===C?void 0:C["tab.border"])&&void 0!==S?S:null===(j=A.colors)||void 0===j?void 0:j["editorGroupHeader.border"])&&void 0!==E?E:null===(R=A.colors)||void 0===R?void 0:R["editorGroup.border"])&&void 0!==z?z:"transparent","code-group-editor-bg":null!==(P=null===(D=A.colors)||void 0===D?void 0:D["editor.background"])&&void 0!==P?P:A.bg,"code-group-editor-fg":null!==(T=null===(M=A.colors)||void 0===M?void 0:M["editor.foreground"])&&void 0!==T?T:A.fg,"code-group-editor-cursor":null!==(_=null===(I=A.colors)||void 0===I?void 0:I["editorCursor.foreground"])&&void 0!==_?_:A.fg};Object.entries(H).forEach(([e,t])=>{document.documentElement.style.setProperty(`--${e}`,t)})}},[c]);return e("div",Object.assign({},o,{"data-code-group-container":!0,className:"w-full"},{children:e(Ec,Object.assign({value:null===(r=s.props)||void 0===r?void 0:r.activeTabId,onValueChange:e=>{const t=k.getBlockSlate(l,{id:a});t&&D.setNodes(t,{props:Object.assign(Object.assign({},s.props),{activeTabId:e})},{at:[0],match:e=>P.isElement(e)&&"code-group-container"===e.type})},className:"w-full"},{children:i}))}))}},"code-group-list":{render:t=>{const{attributes:r,children:o,blockId:i}=t,a=x();return n(vd,Object.assign({className:"w-full"},{children:[n(Rc,Object.assign({},r,{className:"w-full relative justify-start h-8 rounded-none rounded-t-lg bg-transparent p-0 border-b border-x-0 border-t-0",style:{backgroundColor:"var(--code-group-tab-inactive-bg)",borderBottomColor:"var(--code-group-tab-border)"}},{children:[o,e("button",Object.assign({type:"button",contentEditable:!1,onClick:e=>{e.preventDefault(),e.stopPropagation(),H.addTabItem(a,i)},className:"ml-1 flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1.5 h-7",style:{color:"var(--code-group-tab-inactive-fg)"},title:"Add tab"},{children:e(bn,{className:"h-3.5 w-3.5 shrink-0"})}))]})),e(bd,{orientation:"horizontal"})]}))}},"code-group-item-heading":{render:t=>{const{attributes:r,children:o,element:i,blockId:a}=t,s=x();return n(zc,Object.assign({},r,{value:i.id,className:"relative group/tab flex items-center gap-1.5 px-3 h-7 rounded-none rounded-t-lg border-b-2 border-transparent whitespace-nowrap text-xs font-normal transition-colors",style:{backgroundColor:"var(--code-group-tab-inactive-bg, hsl(var(--muted)))",color:"var(--code-group-tab-inactive-fg, hsl(var(--muted-foreground)))"}},{children:[e("div",Object.assign({className:"flex-1 min-w-0"},{children:o})),e("span",Object.assign({contentEditable:!1,onClick:()=>{const e=k.getBlockSlate(s,{id:a});if(!e)return;const t=N.getElementPath(s,{blockId:a,element:i});t&&(D.select(e,t),H.deleteTabItem(s,a,{tabId:i.id}))},className:"ml-1 flex items-center justify-center rounded-sm opacity-0 group-hover/tab:opacity-100 transition-opacity hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-0.5",style:{color:"inherit"},title:"Close tab"},{children:e(jn,{className:"h-3 w-3 shrink-0"})}))]}))}},"code-group-content":{render:t=>{var r,o,i,a;const{attributes:s,children:c,element:h,blockId:f}=t,g=d(null),m=x(),b=null!==(o=null===(r=null==h?void 0:h.props)||void 0===r?void 0:r.language)&&void 0!==o?o:"javascript",v=l(()=>{var e,t,n;const r=k.getBlockSlate(m,{id:f});if(!r)return"github-dark";const o=null===(e=Array.from(R.nodes(r,{at:[0],match:e=>P.isElement(e)&&"code-group-container"===e.type})))||void 0===e?void 0:e[0];if(!o)return"github-dark";const[i]=o;return i&&null!==(n=null===(t=i.props)||void 0===t?void 0:t.theme)&&void 0!==n?n:"github-dark"},[m,f]),[w,y]=u(!1),[O,C]=u(!1),[S,j]=u({buttonForeground:""});p(()=>{var e,t,n,r;if(window.yShiki){const o=window.yShiki.getTheme(v);j({buttonForeground:null!==(r=null!==(t=null===(e=o.colors)||void 0===e?void 0:e["button.foreground"])&&void 0!==t?t:null===(n=o.colors)||void 0===n?void 0:n["icon.foreground"])&&void 0!==r?r:o.fg})}},[v]);const E=I(b),z=null!==(i=_.find(e=>e.value===b))&&void 0!==i?i:_[0];return e(Dc,Object.assign({},s,{value:null===(a=h.props)||void 0===a?void 0:a.referenceId,className:"rounded-b-lg mt-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"},{children:n("div",Object.assign({className:"relative group/code-group-content overflow-hidden"},{children:[n("div",Object.assign({contentEditable:!1,className:"absolute top-2 right-2 z-20 flex items-center gap-2 opacity-0 group-hover/code-group-content:opacity-100 transition-opacity",style:{backgroundColor:"var(--code-group-tab-active-bg)",padding:"4px",borderRadius:"4px"}},{children:[e(Bl,{value:b,options:_,onValueChange:e=>{const t=N.getElementPath(m,{blockId:f,element:h});t&&N.updateElement(m,{blockId:f,type:"code-group-content",props:Object.assign(Object.assign({},h.props),{language:e}),path:t})},currentLabel:z.label}),E&&e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>ue(void 0,void 0,void 0,function*(){var e;if(O)return;const t=null===(e=h.props)||void 0===e?void 0:e.referenceId;if(t){C(!0);try{yield H.beautifyTab(m,f,t)}finally{C(!1)}}}),disabled:O,title:"Beautify code",style:{color:S.buttonForeground||"var(--code-group-tab-active-fg)"}},{children:e(xn,{className:"h-4 w-4 "+(O?"animate-pulse":"")})})),e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{const e=Pc(h);Po(e)&&(y(!0),setTimeout(()=>y(!1),1500))},title:w?"Copied!":"Copy code",style:{color:S.buttonForeground||"var(--code-group-tab-active-fg)"}},{children:e(w?Ut:Zt,{className:"h-4 w-4"})})),e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{var e;H.deleteTabItem(m,f,{tabId:null===(e=h.props)||void 0===e?void 0:e.referenceId})},title:"Delete code",style:{color:S.buttonForeground||"var(--code-group-tab-active-fg)"}},{children:e(Nn,{className:"h-4 w-4"})}))]})),n("div",Object.assign({className:"relative bg-background overflow-hidden rounded-lg",style:{backgroundColor:"var(--code-group-editor-bg)",color:"var(--code-group-editor-fg)",caretColor:"var(--code-group-editor-cursor)"}},{children:[e("div",Object.assign({ref:g,className:"absolute inset-0 p-4 font-mono text-sm whitespace-pre overflow-auto pointer-events-none z-10 select-none",style:{lineHeight:"1.6",tabSize:2},contentEditable:!1,"aria-hidden":"true"},{children:e(L,{element:h,language:b,theme:v})})),e("div",Object.assign({className:"relative p-4 font-mono text-sm whitespace-pre overflow-auto",style:{lineHeight:"1.6",tabSize:2,color:"transparent",caretColor:"var(--code-group-editor-cursor)"},onScroll:e=>{g.current&&(g.current.scrollTop=e.currentTarget.scrollTop,g.current.scrollLeft=e.currentTarget.scrollLeft)}},{children:c}))]}))]}))}))}}};var yd=Symbol.for("react.lazy"),xd=r[" use ".trim().toString()];function kd(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===yd&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function Nd(e){const t=r.forwardRef((e,t)=>{let{children:n,...o}=e;if(kd(n)&&"function"==typeof xd&&(n=xd(n._payload)),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),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(i.ref=t?ge(t,e):e),r.cloneElement(n,i)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Od=Symbol("radix.slottable");function Cd(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Od}var Sd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const o=function(t){const n=Nd(t),o=r.forwardRef((t,o)=>{let{children:i,...a}=t;kd(i)&&"function"==typeof xd&&(i=xd(i._payload));const s=r.Children.toArray(i),l=s.find(Cd);if(l){const t=l.props.children,i=s.map(e=>e===l?r.Children.count(t)>1?r.Children.only(null):r.isValidElement(t)?t.props.children:null:e);return e(n,{...a,ref:o,children:r.isValidElement(t)?r.cloneElement(t,void 0,i):null})}return e(n,{...a,ref:o,children:i})});return o.displayName=`${t}.Slot`,o}(`Primitive.${n}`),i=r.forwardRef((t,r)=>{const{asChild:i,...a}=t,s=i?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e(s,{...a,ref:r})});return i.displayName=`Primitive.${n}`,{...t,[n]:i}},{}),jd="horizontal",Ed=["horizontal","vertical"],Rd=r.forwardRef((t,n)=>{const{decorative:r,orientation:o=jd,...i}=t,a=function(e){return Ed.includes(e)}(o)?o:jd,s=r?{role:"none"}:{"aria-orientation":"vertical"===a?a:void 0,role:"separator"};return e(Sd.div,{"data-orientation":a,...s,...i,ref:n})});Rd.displayName="Separator";var zd=Rd;const Dd=r.forwardRef((t,n)=>{var{className:r,orientation:o="horizontal",decorative:i=!0}=t,a=de(t,["className","orientation","decorative"]);return e(zd,Object.assign({ref:n,decorative:i,orientation:o,className:Or("shrink-0 bg-border","horizontal"===o?"h-[1px] w-full":"h-full w-[1px]",r)},a))});Dd.displayName=zd.displayName;const Pd={divider:{render:t=>{var r,o,i;const a=x(),{attributes:s,element:l,blockId:c}=t,d=l,u=null!==(o=null===(r=d.props)||void 0===r?void 0:r.theme)&&void 0!==o?o:"solid",p=null===(i=d.props)||void 0===i?void 0:i.color;return n("div",Object.assign({},s,{contentEditable:!1,className:"group relative w-full py-3",onClick:()=>{const e=k.getBlock(a,{id:c});e&&O.setSelected(a,{at:e.meta.order})}},{children:[e(Dd,{orientation:"horizontal",decorative:!0,className:(()=>{switch(u){case"dashed":return Or("border-t-2 border-dashed border-b-0 border-l-0 border-r-0 bg-transparent",p?"":"border-border");case"dotted":return Or("border-t-2 border-dotted border-b-0 border-l-0 border-r-0 bg-transparent",p?"":"border-border");case"gradient":return"h-[2px] bg-transparent border-0";default:return Or("h-[1px]",p?"":"bg-border")}})(),style:(()=>{if(!p)return{};switch(u){case"dashed":case"dotted":return{borderTopColor:p};case"gradient":return{background:`linear-gradient(to right, transparent, ${p}, transparent)`};default:return{backgroundColor:p}}})()}),t.children]}))}}},Md=t=>{switch(t){case"youtube":case"vimeo":case"dailymotion":case"wistia":case"loom":return e(mn,{className:"h-3 w-3"});case"spotify":case"soundcloud":return e(hn,{className:"h-3 w-3"});case"codepen":case"codesandbox":return e(Gt,{className:"h-3 w-3"});case"google-maps":return e(ln,{className:"h-3 w-3"});default:return e(an,{className:"h-3 w-3"})}},Td=({name:e,type:t})=>n("span",Object.assign({className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium bg-muted text-muted-foreground"},{children:[Md(t),e]})),Id=({onInsertUrl:t})=>{const[r,o]=u(""),[i,a]=u(!1),[s,l]=u(null),c=()=>{r.trim()&&(t(r.trim()),o(""),a(!1),l(null))};return n("div",Object.assign({className:"space-y-3"},{children:[n("div",Object.assign({className:"space-y-2"},{children:[e(To,{placeholder:"Paste a URL to embed (YouTube, Vimeo, Twitter, Spotify, etc.)",value:r,onChange:e=>(e=>{var t;if(o(e),e.trim()){const n=B(e.trim());if(a(n),n){const n=F(e.trim()),r=W().find(e=>e.type===n);l(null!==(t=null==r?void 0:r.name)&&void 0!==t?t:null)}else l(null)}else a(!1),l(null)})(e.target.value),onKeyDown:e=>{"Enter"===e.key&&r.trim()&&i&&(e.preventDefault(),c())},className:"h-10"}),r.trim()&&e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:i?n("span",Object.assign({className:"flex items-center gap-1.5 text-green-600 dark:text-green-400"},{children:[Md(F(r.trim())),s," detected"]})):e("span",Object.assign({className:"text-destructive"},{children:"Unsupported URL. Try YouTube, Vimeo, Twitter, Spotify, Figma, CodePen, etc."}))}))]})),e(vo,Object.assign({className:"w-full",onClick:c,disabled:!r.trim()||!i},{children:i?`Embed ${s}`:"Embed content"}))]}))},_d=()=>{const t=W().filter(e=>"unknown"!==e.type);return n("div",Object.assign({className:"mt-4 space-y-2"},{children:[e("p",Object.assign({className:"text-xs text-muted-foreground text-center"},{children:"Supported providers:"})),n("div",Object.assign({className:"flex flex-wrap gap-1.5 justify-center"},{children:[t.slice(0,8).map(t=>e(Td,{name:t.name,type:t.type},t.type)),t.length>8&&n("span",Object.assign({className:"inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium bg-muted text-muted-foreground"},{children:["+",t.length-8," more"]}))]}))]}))},Ad=({onInsertUrl:t,className:r,attributes:o,children:i})=>n("div",Object.assign({className:Or("mt-2 relative rounded-lg border bg-background overflow-hidden",r)},o,{contentEditable:!1},{children:[n("div",Object.assign({className:"p-6"},{children:[n("div",Object.assign({className:"flex flex-col items-center gap-4"},{children:[e("div",Object.assign({className:"rounded-lg bg-muted p-3"},{children:e(an,{className:"h-6 w-6 text-muted-foreground"})})),n("div",Object.assign({className:"text-center"},{children:[e("p",Object.assign({className:"text-sm font-medium"},{children:"Embed content"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Paste a URL from supported platforms"}))]}))]})),e("div",Object.assign({className:"mt-6 max-w-md mx-auto"},{children:e(Id,{onInsertUrl:t})})),e(_d,{})]})),i]}));var Ld,Hd,Fd,Wd,Bd={},Ud={get exports(){return Bd},set exports(e){Bd=e}},Vd={},$d={};function Xd(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Xd(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Yd(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Xd(e))&&(r&&(r+=" "),r+=t);return r}({get exports(){return $d},set exports(e){$d=e}}).exports=function(){if(Wd)return Fd;Wd=1;var e=Hd?Ld:(Hd=1,Ld="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,Fd=function(){function r(t,n,r,o,i,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}()();var Kd=Ro(Object.freeze({__proto__:null,clsx:Yd,default:Yd})),qd={},Gd={};Object.defineProperty(Gd,"__esModule",{value:!0}),Gd.dontSetMe=function(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))},Gd.findInArray=function(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]},Gd.int=function(e){return parseInt(e,10)},Gd.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},Gd.isNum=function(e){return"number"==typeof e&&!isNaN(e)};var Zd={};Object.defineProperty(Zd,"__esModule",{value:!0}),Zd.browserPrefixToKey=eu,Zd.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},Zd.default=void 0,Zd.getPrefix=Qd;const Jd=["Moz","Webkit","O","ms"];function Qd(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const n=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!n)return"";if(t in n)return"";for(let e=0;e<Jd.length;e++)if(eu(t,Jd[e])in n)return Jd[e];return""}function eu(e,t){return t?"".concat(t).concat(function(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e)):e}Zd.default=Qd(),Object.defineProperty(qd,"__esModule",{value:!0}),qd.addClassName=su,qd.addEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},qd.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&su(e.body,"react-draggable-transparent-selection")},qd.createCSSTransform=function(e,t){const n=au(e,t,"px");return{[(0,nu.browserPrefixToKey)("transform",nu.default)]:n}},qd.createSVGTransform=function(e,t){return au(e,t,"")},qd.getTouch=function(e,t){return e.targetTouches&&(0,tu.findInArray)(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&(0,tu.findInArray)(e.changedTouches,e=>t===e.identifier)},qd.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},qd.getTranslation=au,qd.innerHeight=function(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,tu.int)(n.paddingTop),t-=(0,tu.int)(n.paddingBottom),t},qd.innerWidth=function(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,tu.int)(n.paddingLeft),t-=(0,tu.int)(n.paddingRight),t},qd.matchesSelector=iu,qd.matchesSelectorAndParentsTo=function(e,t,n){let r=e;do{if(iu(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},qd.offsetXYFromParent=function(e,t,n){const r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-r.left)/n,i=(e.clientY+t.scrollTop-r.top)/n;return{x:o,y:i}},qd.outerHeight=function(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,tu.int)(n.borderTopWidth),t+=(0,tu.int)(n.borderBottomWidth),t},qd.outerWidth=function(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,tu.int)(n.borderLeftWidth),t+=(0,tu.int)(n.borderRightWidth),t},qd.removeClassName=lu,qd.removeEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},qd.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&lu(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var tu=Gd,nu=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=ru(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(Zd);function ru(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(ru=function(e){return e?n:t})(e)}let ou="";function iu(e,t){return ou||(ou=(0,tu.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(t){return(0,tu.isFunction)(e[t])})),!!(0,tu.isFunction)(e[ou])&&e[ou](t)}function au(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const e="".concat("string"==typeof t.x?t.x:t.x+n),r="".concat("string"==typeof t.y?t.y:t.y+n);i="translate(".concat(e,", ").concat(r,")")+i}return i}function su(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function lu(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var cu={};Object.defineProperty(cu,"__esModule",{value:!0}),cu.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},cu.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},cu.createCoreData=function(e,t,n){const r=!(0,du.isNum)(e.lastX),o=pu(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}},cu.createDraggableData=function(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}},cu.getBoundPosition=function(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r="string"==typeof r?r:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(r);const o=pu(e);if("string"==typeof r){const{ownerDocument:e}=o,t=e.defaultView;let n;if(n="parent"===r?o.parentNode:e.querySelector(r),!(n instanceof t.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const i=n,a=t.getComputedStyle(o),s=t.getComputedStyle(i);r={left:-o.offsetLeft+(0,du.int)(s.paddingLeft)+(0,du.int)(a.marginLeft),top:-o.offsetTop+(0,du.int)(s.paddingTop)+(0,du.int)(a.marginTop),right:(0,uu.innerWidth)(i)-(0,uu.outerWidth)(o)-o.offsetLeft+(0,du.int)(s.paddingRight)-(0,du.int)(a.marginRight),bottom:(0,uu.innerHeight)(i)-(0,uu.outerHeight)(o)-o.offsetTop+(0,du.int)(s.paddingBottom)-(0,du.int)(a.marginBottom)}}(0,du.isNum)(r.right)&&(t=Math.min(t,r.right));(0,du.isNum)(r.bottom)&&(n=Math.min(n,r.bottom));(0,du.isNum)(r.left)&&(t=Math.max(t,r.left));(0,du.isNum)(r.top)&&(n=Math.max(n,r.top));return[t,n]},cu.getControlPosition=function(e,t,n){const r="number"==typeof t?(0,uu.getTouch)(e,t):null;if("number"==typeof t&&!r)return null;const o=pu(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,uu.offsetXYFromParent)(r||e,i,n.props.scale)},cu.snapToGrid=function(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]};var du=Gd,uu=qd;function pu(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var hu={},fu={};Object.defineProperty(fu,"__esModule",{value:!0}),fu.default=function(){},Object.defineProperty(hu,"__esModule",{value:!0}),hu.default=void 0;var gu=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=Nu(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(o),mu=ku($d),bu=ku(w),vu=qd,wu=cu,yu=Gd,xu=ku(fu);function ku(e){return e&&e.__esModule?e:{default:e}}function Nu(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(Nu=function(e){return e?n:t})(e)}function Ou(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Cu={start:"touchstart",move:"touchmove",stop:"touchend"},Su={start:"mousedown",move:"mousemove",stop:"mouseup"};let ju=Su,Eu=class extends gu.Component{constructor(){super(...arguments),Ou(this,"dragging",!1),Ou(this,"lastX",NaN),Ou(this,"lastY",NaN),Ou(this,"touchIdentifier",null),Ou(this,"mounted",!1),Ou(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,vu.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,vu.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();const r=(0,vu.getTouchIdentifier)(e);this.touchIdentifier=r;const o=(0,wu.getControlPosition)(e,r,this);if(null==o)return;const{x:i,y:a}=o,s=(0,wu.createCoreData)(this,i,a);(0,xu.default)("DraggableCore: handleDragStart: %j",s),(0,xu.default)("calling",this.props.onStart);!1!==this.props.onStart(e,s)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,vu.addUserSelectStyles)(n),this.dragging=!0,this.lastX=i,this.lastY=a,(0,vu.addEvent)(n,ju.move,this.handleDrag),(0,vu.addEvent)(n,ju.stop,this.handleDragStop))}),Ou(this,"handleDrag",e=>{const t=(0,wu.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,wu.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}const o=(0,wu.createCoreData)(this,n,r);(0,xu.default)("DraggableCore: handleDrag: %j",o);if(!1!==this.props.onDrag(e,o)&&!1!==this.mounted)this.lastX=n,this.lastY=r;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}}),Ou(this,"handleDragStop",e=>{if(!this.dragging)return;const t=(0,wu.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=(0,wu.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}const o=(0,wu.createCoreData)(this,n,r);if(!1===this.props.onStop(e,o)||!1===this.mounted)return!1;const i=this.findDOMNode();i&&this.props.enableUserSelectHack&&(0,vu.removeUserSelectStyles)(i.ownerDocument),(0,xu.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,i&&((0,xu.default)("DraggableCore: Removing handlers"),(0,vu.removeEvent)(i.ownerDocument,ju.move,this.handleDrag),(0,vu.removeEvent)(i.ownerDocument,ju.stop,this.handleDragStop))}),Ou(this,"onMouseDown",e=>(ju=Su,this.handleDragStart(e))),Ou(this,"onMouseUp",e=>(ju=Su,this.handleDragStop(e))),Ou(this,"onTouchStart",e=>(ju=Cu,this.handleDragStart(e))),Ou(this,"onTouchEnd",e=>(ju=Cu,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,vu.addEvent)(e,Cu.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,vu.removeEvent)(t,Su.move,this.handleDrag),(0,vu.removeEvent)(t,Cu.move,this.handleDrag),(0,vu.removeEvent)(t,Su.stop,this.handleDragStop),(0,vu.removeEvent)(t,Cu.stop,this.handleDragStop),(0,vu.removeEvent)(e,Cu.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,vu.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:bu.default.findDOMNode(this)}render(){return gu.cloneElement(gu.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};hu.default=Eu,Ou(Eu,"displayName","DraggableCore"),Ou(Eu,"propTypes",{allowAnyClick:mu.default.bool,children:mu.default.node.isRequired,disabled:mu.default.bool,enableUserSelectHack:mu.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:mu.default.arrayOf(mu.default.number),handle:mu.default.string,cancel:mu.default.string,nodeRef:mu.default.object,onStart:mu.default.func,onDrag:mu.default.func,onStop:mu.default.func,onMouseDown:mu.default.func,scale:mu.default.number,className:yu.dontSetMe,style:yu.dontSetMe,transform:yu.dontSetMe}),Ou(Eu,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(o),n=u($d),r=u(w),i=u(Kd),a=qd,s=cu,l=Gd,c=u(hu),d=u(fu);function u(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function f(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class g extends t.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:r}=t;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,d.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:{...n}})}constructor(e){super(e),f(this,"onDragStart",(e,t)=>{(0,d.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,s.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})}),f(this,"onDrag",(e,t)=>{if(!this.state.dragging)return!1;(0,d.default)("Draggable: onDrag: %j",t);const n=(0,s.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;const[o,i]=(0,s.getBoundPosition)(this,r.x,r.y);r.x=o,r.y=i,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)}),f(this,"onDragStop",(e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,s.createDraggableData)(this,t)))return!1;(0,d.default)("Draggable: onDragStop: %j",t);const n={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)}),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:r.default.findDOMNode(this)}render(){const{axis:e,bounds:n,children:r,defaultPosition:o,defaultClassName:l,defaultClassNameDragging:d,defaultClassNameDragged:u,position:p,positionOffset:f,scale:g,...m}=this.props;let b={},v=null;const w=!Boolean(p)||this.state.dragging,y=p||o,x={x:(0,s.canDragX)(this)&&w?this.state.x:y.x,y:(0,s.canDragY)(this)&&w?this.state.y:y.y};this.state.isElementSVG?v=(0,a.createSVGTransform)(x,f):b=(0,a.createCSSTransform)(x,f);const k=(0,i.default)(r.props.className||"",l,{[d]:this.state.dragging,[u]:this.state.dragged});return t.createElement(c.default,h({},m,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(r),{className:k,style:{...r.props.style,...b},transform:v}))}}e.default=g,f(g,"displayName","Draggable"),f(g,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),f(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Vd);const{default:Ru,DraggableCore:zu}=Vd;Ud.exports=Ru,Bd.default=Ru,Bd.DraggableCore=zu;var Du=function(){return Du=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Du.apply(this,arguments)},Pu={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Mu={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Tu={width:"20px",height:"20px",position:"absolute",zIndex:1},Iu={top:Du(Du({},Pu),{top:"-5px"}),right:Du(Du({},Mu),{left:void 0,right:"-5px"}),bottom:Du(Du({},Pu),{top:void 0,bottom:"-5px"}),left:Du(Du({},Mu),{left:"-5px"}),topRight:Du(Du({},Tu),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Du(Du({},Tu),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Du(Du({},Tu),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Du(Du({},Tu),{left:"-10px",top:"-10px",cursor:"nw-resize"})},_u=m(function(t){var n=t.onResizeStart,r=t.direction,o=t.children,i=t.replaceStyles,a=t.className,s=c(function(e){n(e,r)},[n,r]),d=c(function(e){n(e,r)},[n,r]),u=l(function(){return Du(Du({position:"absolute",userSelect:"none"},Iu[r]),null!=i?i:{})},[i,r]);return e("div",{className:a||void 0,style:u,onMouseDown:s,onTouchStart:d,children:o})}),Au=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lu=function(){return Lu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Lu.apply(this,arguments)},Hu={width:"auto",height:"auto"},Fu=function(e,t,n){return Math.max(Math.min(e,n),t)},Wu=function(e,t,n){var r=Math.round(e/t);return r*t+n*(r-1)},Bu=function(e,t){return new RegExp(e,"i").test(t)},Uu=function(e){return Boolean(e.touches&&e.touches.length)},Vu=function(e,t,n){void 0===n&&(n=0);var r=t.reduce(function(n,r,o){return Math.abs(r-e)<Math.abs(t[n]-e)?o:n},0),o=Math.abs(t[r]-e);return 0===n||o<n?t[r]:e},$u=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},Xu=function(e,t,n,r){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return n*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return r*(Number(e.replace("vh",""))/100)}return e},Yu=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Ku="__resizable_base__",qu=function(t){function r(e){var n,r,o,i,a=t.call(this,e)||this;return a.ratio=1,a.resizable=null,a.parentLeft=0,a.parentTop=0,a.resizableLeft=0,a.resizableRight=0,a.resizableTop=0,a.resizableBottom=0,a.targetLeft=0,a.targetTop=0,a.delta={width:0,height:0},a.appendBase=function(){if(!a.resizable||!a.window)return null;var e=a.parentNode;if(!e)return null;var t=a.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(Ku):t.className+=Ku,e.appendChild(t),t},a.removeBase=function(e){var t=a.parentNode;t&&t.removeChild(e)},a.state={isResizing:!1,width:null!==(r=null===(n=a.propsSize)||void 0===n?void 0:n.width)&&void 0!==r?r:"auto",height:null!==(i=null===(o=a.propsSize)||void 0===o?void 0:o.height)&&void 0!==i?i:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},a.onResizeStart=a.onResizeStart.bind(a),a.onMouseMove=a.onMouseMove.bind(a),a.onMouseUp=a.onMouseUp.bind(a),a}return Au(r,t),Object.defineProperty(r.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||Hu},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,o=this.resizable.style.position;"relative"!==o&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:r,this.resizable.style.position=o}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){var n;if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&(null===(n=e.propsSize[t])||void 0===n?void 0:n.toString().endsWith("%"))){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var r=e.getParentSize(),o=Number(e.state[t].toString().replace("px",""))/r[t]*100;return"".concat(o,"%")}return $u(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?$u(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?$u(t.height):n("height")}},enumerable:!1,configurable:!0}),r.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},r.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},r.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},r.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},r.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},r.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},r.prototype.calculateNewMaxFromBoundary=function(e,t){var n,r,o=this.props.boundsByDirection,i=this.state.direction,a=o&&Bu("left",i),s=o&&Bu("top",i);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=a?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),r=s?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,r=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),r=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(e=e&&e<n?e:n),r&&Number.isFinite(r)&&(t=t&&t<r?t:r),{maxWidth:e,maxHeight:t}},r.prototype.calculateNewSizeFromDirection=function(e,t){var n,r=this.props.scale||1,o=(n=this.props.resizeRatio||1,Array.isArray(n)?n:[n,n]),i=o[0],a=o[1],s=this.state,l=s.direction,c=s.original,d=this.props,u=d.lockAspectRatio,p=d.lockAspectRatioExtraHeight,h=d.lockAspectRatioExtraWidth,f=c.width,g=c.height,m=p||0,b=h||0;return Bu("right",l)&&(f=c.width+(e-c.x)*i/r,u&&(g=(f-b)/this.ratio+m)),Bu("left",l)&&(f=c.width-(e-c.x)*i/r,u&&(g=(f-b)/this.ratio+m)),Bu("bottom",l)&&(g=c.height+(t-c.y)*a/r,u&&(f=(g-m)*this.ratio+b)),Bu("top",l)&&(g=c.height-(t-c.y)*a/r,u&&(f=(g-m)*this.ratio+b)),{newWidth:f,newHeight:g}},r.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var o=this.props,i=o.lockAspectRatio,a=o.lockAspectRatioExtraHeight,s=o.lockAspectRatioExtraWidth,l=void 0===r.width?10:r.width,c=void 0===n.width||n.width<0?e:n.width,d=void 0===r.height?10:r.height,u=void 0===n.height||n.height<0?t:n.height,p=a||0,h=s||0;if(i){var f=(d-p)*this.ratio+h,g=(u-p)*this.ratio+h,m=(l-h)/this.ratio+p,b=(c-h)/this.ratio+p,v=Math.max(l,f),w=Math.min(c,g),y=Math.max(d,m),x=Math.min(u,b);e=Fu(e,v,w),t=Fu(t,y,x)}else e=Fu(e,l,c),t=Fu(t,d,u);return{newWidth:e,newHeight:t}},r.prototype.setBoundingClientRect=function(){var e=1/(this.props.scale||1);if("parent"===this.props.bounds){var t=this.parentNode;if(t){var n=t.getBoundingClientRect();this.parentLeft=n.left*e,this.parentTop=n.top*e}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var r=this.props.bounds.getBoundingClientRect();this.targetLeft=r.left*e,this.targetTop=r.top*e}if(this.resizable){var o=this.resizable.getBoundingClientRect(),i=o.left,a=o.top,s=o.right,l=o.bottom;this.resizableLeft=i*e,this.resizableRight=s*e,this.resizableTop=a*e,this.resizableBottom=l*e}},r.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n,r=0,o=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(r=e.nativeEvent.clientX,o=e.nativeEvent.clientY):e.nativeEvent&&Uu(e.nativeEvent)&&(r=e.nativeEvent.touches[0].clientX,o=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var i=this.window.getComputedStyle(this.resizable);if("auto"!==i.flexBasis){var a=this.parentNode;if(a){var s=this.window.getComputedStyle(a).flexDirection;this.flexDir=s.startsWith("row")?"row":"column",n=i.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:r,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Lu(Lu({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},r.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&Uu(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var n=this.props,r=n.maxWidth,o=n.maxHeight,i=n.minWidth,a=n.minHeight,s=Uu(e)?e.touches[0].clientX:e.clientX,l=Uu(e)?e.touches[0].clientY:e.clientY,c=this.state,d=c.direction,u=c.original,p=c.width,h=c.height,f=this.getParentSize(),g=function(e,t,n,r,o,i,a){return r=Xu(r,e.width,t,n),o=Xu(o,e.height,t,n),i=Xu(i,e.width,t,n),a=Xu(a,e.height,t,n),{maxWidth:void 0===r?void 0:Number(r),maxHeight:void 0===o?void 0:Number(o),minWidth:void 0===i?void 0:Number(i),minHeight:void 0===a?void 0:Number(a)}}(f,this.window.innerWidth,this.window.innerHeight,r,o,i,a);r=g.maxWidth,o=g.maxHeight,i=g.minWidth,a=g.minHeight;var m=this.calculateNewSizeFromDirection(s,l),b=m.newHeight,v=m.newWidth,w=this.calculateNewMaxFromBoundary(r,o);this.props.snap&&this.props.snap.x&&(v=Vu(v,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(b=Vu(b,this.props.snap.y,this.props.snapGap));var x=this.calculateNewSizeFromAspectRatio(v,b,{width:w.maxWidth,height:w.maxHeight},{width:i,height:a});if(v=x.newWidth,b=x.newHeight,this.props.grid){var k=Wu(v,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),N=Wu(b,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),O=this.props.snapGap||0;v=0===O||Math.abs(k-v)<=O?k:v,b=0===O||Math.abs(N-b)<=O?N:b}var C={width:v-u.width,height:b-u.height};if(this.delta=C,p&&"string"==typeof p)if(p.endsWith("%")){var S=v/f.width*100;v="".concat(S,"%")}else if(p.endsWith("vw")){var j=v/this.window.innerWidth*100;v="".concat(j,"vw")}else if(p.endsWith("vh")){var E=v/this.window.innerHeight*100;v="".concat(E,"vh")}if(h&&"string"==typeof h)if(h.endsWith("%")){S=b/f.height*100;b="".concat(S,"%")}else if(h.endsWith("vw")){j=b/this.window.innerWidth*100;b="".concat(j,"vw")}else if(h.endsWith("vh")){E=b/this.window.innerHeight*100;b="".concat(E,"vh")}var R={width:this.createSizeForCssProperty(v,"width"),height:this.createSizeForCssProperty(b,"height")};"row"===this.flexDir?R.flexBasis=R.width:"column"===this.flexDir&&(R.flexBasis=R.height);var z=this.state.width!==R.width,D=this.state.height!==R.height,P=this.state.flexBasis!==R.flexBasis,M=z||D||P;M&&y(function(){t.setState(R)}),this.props.onResize&&M&&this.props.onResize(e,d,this.resizable,C)}},r.prototype.onMouseUp=function(e){var t,n,r=this.state,o=r.isResizing,i=r.direction;r.original,o&&this.resizable&&(this.props.onResizeStop&&this.props.onResizeStop(e,i,this.resizable,this.delta),this.props.size&&this.setState({width:null!==(t=this.props.size.width)&&void 0!==t?t:"auto",height:null!==(n=this.props.size.height)&&void 0!==n?n:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Lu(Lu({},this.state.backgroundStyle),{cursor:"auto"})}))},r.prototype.updateSize=function(e){var t,n;this.setState({width:null!==(t=e.width)&&void 0!==t?t:"auto",height:null!==(n=e.height)&&void 0!==n?n:"auto"})},r.prototype.renderResizer=function(){var t=this,n=this.props,r=n.enable,o=n.handleStyles,i=n.handleClasses,a=n.handleWrapperStyle,s=n.handleWrapperClass,l=n.handleComponent;if(!r)return null;var c=Object.keys(r).map(function(n){return!1!==r[n]?e(_u,{direction:n,onResizeStart:t.onResizeStart,replaceStyles:o&&o[n],className:i&&i[n],children:l&&l[n]?l[n]:null},n):null});return e("div",{className:s,style:a,children:c})},r.prototype.render=function(){var t=this,r=Object.keys(this.props).reduce(function(e,n){return-1!==Yu.indexOf(n)||(e[n]=t.props[n]),e},{}),o=Lu(Lu(Lu({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return n(i,Lu({style:o,className:this.props.className},r,{ref:function(e){e&&(t.resizable=e)},children:[this.state.isResizing&&e("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},r.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},r}(b),Gu=function(e,t){return Gu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Gu(e,t)};var Zu=function(){return Zu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Zu.apply(this,arguments)};var Ju={width:"auto",height:"auto",display:"inline-block",position:"absolute",top:0,left:0},Qu=function(e){function t(t){var n=e.call(this,t)||this;return n.resizingPosition={x:0,y:0},n.offsetFromParent={left:0,top:0},n.resizableElement={current:null},n.originalPosition={x:0,y:0},n.state={resizing:!1,bounds:{top:0,right:0,bottom:0,left:0},maxWidth:t.maxWidth,maxHeight:t.maxHeight},n.onResizeStart=n.onResizeStart.bind(n),n.onResize=n.onResize.bind(n),n.onResizeStop=n.onResizeStop.bind(n),n.onDragStart=n.onDragStart.bind(n),n.onDrag=n.onDrag.bind(n),n.onDragStop=n.onDragStop.bind(n),n.getMaxSizesFromProps=n.getMaxSizesFromProps.bind(n),n}return function(e,t){function n(){this.constructor=e}Gu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.updateOffsetFromParent();var e=this.offsetFromParent,t=e.left,n=e.top,r=this.getDraggablePosition(),o=r.x,i=r.y;this.draggable.setState({x:o-t,y:i-n}),this.forceUpdate()},t.prototype.getDraggablePosition=function(){var e=this.draggable.state;return{x:e.x,y:e.y}},t.prototype.getParent=function(){return this.resizable&&this.resizable.parentNode},t.prototype.getParentSize=function(){return this.resizable.getParentSize()},t.prototype.getMaxSizesFromProps=function(){return{maxWidth:void 0===this.props.maxWidth?Number.MAX_SAFE_INTEGER:this.props.maxWidth,maxHeight:void 0===this.props.maxHeight?Number.MAX_SAFE_INTEGER:this.props.maxHeight}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(e){var t=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/t;case"body":return document.body.offsetHeight/t;default:return e.offsetHeight}},t.prototype.getOffsetWidth=function(e){var t=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/t;case"body":return document.body.offsetWidth/t;default:return e.offsetWidth}},t.prototype.onDragStart=function(e,t){this.props.onDragStart&&this.props.onDragStart(e,t);var n=this.getDraggablePosition();if(this.originalPosition=n,this.props.bounds){var r,o=this.getParent(),i=this.props.scale;if("parent"===this.props.bounds)r=o;else{if("body"===this.props.bounds){var a=o.getBoundingClientRect(),s=a.left,l=a.top,c=document.body.getBoundingClientRect(),d=-(s-o.offsetLeft*i-c.left)/i,u=-(l-o.offsetTop*i-c.top)/i,p=(document.body.offsetWidth-this.resizable.size.width*i)/i+d,h=(document.body.offsetHeight-this.resizable.size.height*i)/i+u;return this.setState({bounds:{top:u,right:p,bottom:h,left:d}})}if("window"===this.props.bounds){if(!this.resizable)return;var f=o.getBoundingClientRect(),g=f.left,m=f.top,b=-(g-o.offsetLeft*i)/i,v=-(m-o.offsetTop*i)/i;p=(window.innerWidth-this.resizable.size.width*i)/i+b,h=(window.innerHeight-this.resizable.size.height*i)/i+v;return this.setState({bounds:{top:v,right:p,bottom:h,left:b}})}"string"==typeof this.props.bounds?r=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(r=this.props.bounds)}if(r instanceof HTMLElement&&o instanceof HTMLElement){var w=r.getBoundingClientRect(),y=w.left,x=w.top,k=o.getBoundingClientRect(),N=(y-k.left)/i,O=x-k.top;if(this.resizable){this.updateOffsetFromParent();var C=this.offsetFromParent;this.setState({bounds:{top:O-C.top,right:N+(r.offsetWidth-this.resizable.size.width)-C.left/i,bottom:O+(r.offsetHeight-this.resizable.size.height)-C.top,left:N-C.left/i}})}}}},t.prototype.onDrag=function(e,t){if(this.props.onDrag){var n=this.offsetFromParent,r=n.left,o=n.top;return this.props.dragAxis&&"both"!==this.props.dragAxis?"x"===this.props.dragAxis?this.props.onDrag(e,Zu(Zu({},t),{x:t.x+r,y:this.originalPosition.y+o,deltaY:0})):"y"===this.props.dragAxis?this.props.onDrag(e,Zu(Zu({},t),{x:this.originalPosition.x+r,y:t.y+o,deltaX:0})):void 0:this.props.onDrag(e,Zu(Zu({},t),{x:t.x+r,y:t.y+o}))}},t.prototype.onDragStop=function(e,t){if(this.props.onDragStop){var n=this.offsetFromParent,r=n.left,o=n.top;return this.props.dragAxis&&"both"!==this.props.dragAxis?"x"===this.props.dragAxis?this.props.onDragStop(e,Zu(Zu({},t),{x:t.x+r,y:this.originalPosition.y+o,deltaY:0})):"y"===this.props.dragAxis?this.props.onDragStop(e,Zu(Zu({},t),{x:this.originalPosition.x+r,y:t.y+o,deltaX:0})):void 0:this.props.onDragStop(e,Zu(Zu({},t),{x:t.x+r,y:t.y+o}))}},t.prototype.onResizeStart=function(e,t,n){e.stopPropagation(),this.setState({resizing:!0});var r=this.props.scale,o=this.offsetFromParent,i=this.getDraggablePosition();if(this.resizingPosition={x:i.x+o.left,y:i.y+o.top},this.originalPosition=i,this.props.bounds){var a=this.getParent(),s=void 0;"parent"===this.props.bounds?s=a:"body"===this.props.bounds?s=document.body:"window"===this.props.bounds?s=window:"string"==typeof this.props.bounds?s=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(s=this.props.bounds);var l=this.getSelfElement();if(l instanceof Element&&(s instanceof HTMLElement||s===window)&&a instanceof HTMLElement){var c=this.getMaxSizesFromProps(),d=c.maxWidth,u=c.maxHeight,p=this.getParentSize();if(d&&"string"==typeof d)if(d.endsWith("%")){var h=Number(d.replace("%",""))/100;d=p.width*h}else d.endsWith("px")&&(d=Number(d.replace("px","")));if(u&&"string"==typeof u)if(u.endsWith("%")){h=Number(u.replace("%",""))/100;u=p.height*h}else u.endsWith("px")&&(u=Number(u.replace("px","")));var f=l.getBoundingClientRect(),g=f.left,m=f.top,b="window"===this.props.bounds?{left:0,top:0}:s.getBoundingClientRect(),v=b.left,w=b.top,y=this.getOffsetWidth(s),x=this.getOffsetHeight(s),k=t.toLowerCase().endsWith("left"),N=t.toLowerCase().endsWith("right"),O=t.startsWith("top"),C=t.startsWith("bottom");if((k||O)&&this.resizable){var S=(g-v)/r+this.resizable.size.width;this.setState({maxWidth:S>Number(d)?d:S})}if(N||this.props.lockAspectRatio&&!k&&!O){S=y+(v-g)/r;this.setState({maxWidth:S>Number(d)?d:S})}if((O||k)&&this.resizable){S=(m-w)/r+this.resizable.size.height;this.setState({maxHeight:S>Number(u)?u:S})}if(C||this.props.lockAspectRatio&&!O&&!k){S=x+(w-m)/r;this.setState({maxHeight:S>Number(u)?u:S})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(e,t,n)},t.prototype.onResize=function(e,t,n,r){var o=this,i={x:this.originalPosition.x,y:this.originalPosition.y},a=-r.width,s=-r.height;["top","left","topLeft","bottomLeft","topRight"].includes(t)&&("bottomLeft"===t?i.x+=a:("topRight"===t||(i.x+=a),i.y+=s));var l=this.draggable.state;i.x===l.x&&i.y===l.y||y(function(){o.draggable.setState(i)}),this.updateOffsetFromParent();var c=this.offsetFromParent,d=this.getDraggablePosition().x+c.left,u=this.getDraggablePosition().y+c.top;this.resizingPosition={x:d,y:u},this.props.onResize&&this.props.onResize(e,t,n,r,{x:d,y:u})},t.prototype.onResizeStop=function(e,t,n,r){this.setState({resizing:!1});var o=this.getMaxSizesFromProps(),i=o.maxWidth,a=o.maxHeight;this.setState({maxWidth:i,maxHeight:a}),this.props.onResizeStop&&this.props.onResizeStop(e,t,n,r,this.resizingPosition)},t.prototype.updateSize=function(e){this.resizable&&this.resizable.updateSize({width:e.width,height:e.height})},t.prototype.updatePosition=function(e){this.draggable.setState(e)},t.prototype.updateOffsetFromParent=function(){var e=this.props.scale,t=this.getParent(),n=this.getSelfElement();if(!t||null===n)return{top:0,left:0};var r=t.getBoundingClientRect(),o=r.left,i=r.top,a=n.getBoundingClientRect(),s=this.getDraggablePosition(),l=t.scrollLeft,c=t.scrollTop;this.offsetFromParent={left:a.left-o+l-s.x*e,top:a.top-i+c-s.y*e}},t.prototype.render=function(){var e=this,t=this.props,n=t.disableDragging,r=t.style,o=t.dragHandleClassName,i=t.position,s=t.onMouseDown,l=t.onMouseUp,c=t.dragAxis,d=t.dragGrid,u=t.bounds,p=t.enableUserSelectHack,h=t.cancel,f=t.children;t.onResizeStart,t.onResize,t.onResizeStop,t.onDragStart,t.onDrag,t.onDragStop;var g=t.resizeHandleStyles,m=t.resizeHandleClasses,b=t.resizeHandleComponent,v=t.enableResizing,w=t.resizeGrid,y=t.resizeHandleWrapperClass,x=t.resizeHandleWrapperStyle,k=t.scale,N=t.allowAnyClick,O=t.dragPositionOffset,C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick","dragPositionOffset"]),S=this.props.default?Zu({},this.props.default):void 0;delete C.default;var j,E=n||o?{cursor:"auto"}:{cursor:"move"},R=Zu(Zu(Zu({},Ju),E),r),z=this.offsetFromParent,D=z.left,P=z.top;i&&(j={x:i.x-D,y:i.y-P});var M,T=this.state.resizing?void 0:j,I=this.state.resizing?"both":c;return a(Bd,{ref:function(t){t&&(e.draggable=t)},handle:o?".".concat(o):void 0,defaultPosition:S,onMouseDown:s,onMouseUp:l,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:I,disabled:n,grid:d,bounds:u?this.state.bounds:void 0,position:T,enableUserSelectHack:p,cancel:h,scale:k,allowAnyClick:N,nodeRef:this.resizableElement,positionOffset:O},a(qu,Zu({},C,{ref:function(t){t&&(e.resizable=t,e.resizableElement.current=t.resizable)},defaultSize:S,size:this.props.size,enable:"boolean"==typeof v?(M=v,{bottom:M,bottomLeft:M,bottomRight:M,left:M,right:M,top:M,topLeft:M,topRight:M}):v,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:R,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:w,handleWrapperClass:y,handleWrapperStyle:x,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:g,handleClasses:m,handleComponent:b,scale:this.props.scale}),f))},t.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(b);const ep={...r},tp=ep.useInsertionEffect||(e=>e());var np="undefined"!=typeof document?g:p;let rp=!1,op=0;const ip=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+op++;const ap=ep.useId||function(){const[e,t]=r.useState(()=>rp?ip():void 0);return np(()=>{null==e&&t(ip())},[]),r.useEffect(()=>{rp=!0},[]),e};const sp=r.createContext(null),lp=r.createContext(null);function cp(e){const{open:t=!1,onOpenChange:n,elements:o}=e,i=ap(),a=r.useRef({}),[s]=r.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}()),l=null!=((null==(c=r.useContext(sp))?void 0:c.id)||null);var c;const[d,u]=r.useState(o.reference),p=function(e){const t=r.useRef(()=>{});return tp(()=>{t.current=e}),r.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}((e,t,r)=>{a.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)}),h=r.useMemo(()=>({setPositionReference:u}),[]),f=r.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return r.useMemo(()=>({dataRef:a,open:t,onOpenChange:p,elements:f,events:s,floatingId:i,refs:h}),[t,p,f,s,i,h])}function dp(e){void 0===e&&(e={});const{nodeId:t}=e,n=cp({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,i=o.elements,[a,s]=r.useState(null),[l,c]=r.useState(null),d=(null==i?void 0:i.domReference)||a,u=r.useRef(null),p=r.useContext(lp);np(()=>{d&&(u.current=d)},[d]);const h=Fa({...e,elements:{...i,...l&&{reference:l}}}),f=r.useCallback(e=>{const t=Fi(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),h.refs.setReference(t)},[h.refs]),g=r.useCallback(e=>{(Fi(e)||null===e)&&(u.current=e,s(e)),(Fi(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!Fi(e))&&h.refs.setReference(e)},[h.refs]),m=r.useMemo(()=>({...h.refs,setReference:g,setPositionReference:f,domReference:u}),[h.refs,g,f]),b=r.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),v=r.useMemo(()=>({...h,...o,refs:m,elements:b,nodeId:t}),[h,m,b,t,o]);return np(()=>{o.dataRef.current.floatingContext=v;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),r.useMemo(()=>({...h,context:v,refs:m,elements:b}),[h,m,b,v])}var up=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"}),pp=r.forwardRef((t,n)=>e(Se.span,{...t,ref:n,style:{...up,...t.style}}));pp.displayName="VisuallyHidden";var hp=pp,[fp,gp]=pe("Tooltip",[ts]),mp=ts(),bp="TooltipProvider",vp=700,wp="tooltip.open",[yp,xp]=fp(bp),kp=t=>{const{__scopeTooltip:n,delayDuration:o=vp,skipDelayDuration:i=300,disableHoverableContent:a=!1,children:s}=t,l=r.useRef(!0),c=r.useRef(!1),d=r.useRef(0);return r.useEffect(()=>{const e=d.current;return()=>window.clearTimeout(e)},[]),e(yp,{scope:n,isOpenDelayedRef:l,delayDuration:o,onOpen:r.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:r.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,i)},[i]),isPointerInTransitRef:c,onPointerInTransitChange:r.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:s})};kp.displayName=bp;var Np="Tooltip",[Op,Cp]=fp(Np),Sp=t=>{const{__scopeTooltip:n,children:o,open:i,defaultOpen:a,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=t,d=xp(Np,t.__scopeTooltip),u=mp(n),[p,h]=r.useState(null),f=Pe(),g=r.useRef(0),m=l??d.disableHoverableContent,b=c??d.delayDuration,v=r.useRef(!1),[w,y]=Ce({prop:i,defaultProp:a??!1,onChange:e=>{e?(d.onOpen(),document.dispatchEvent(new CustomEvent(wp))):d.onClose(),s?.(e)},caller:Np}),x=r.useMemo(()=>w?v.current?"delayed-open":"instant-open":"closed",[w]),k=r.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v.current=!1,y(!0)},[y]),N=r.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y(!1)},[y]),O=r.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{v.current=!0,y(!0),g.current=0},b)},[b,y]);return r.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),e(bs,{...u,children:e(Op,{scope:n,contentId:f,open:w,stateAttribute:x,trigger:p,onTriggerChange:h,onTriggerEnter:r.useCallback(()=>{d.isOpenDelayedRef.current?O():k()},[d.isOpenDelayedRef,O,k]),onTriggerLeave:r.useCallback(()=>{m?N():(window.clearTimeout(g.current),g.current=0)},[N,m]),onOpen:k,onClose:N,disableHoverableContent:m,children:o})})};Sp.displayName=Np;var jp="TooltipTrigger",Ep=r.forwardRef((t,n)=>{const{__scopeTooltip:o,...i}=t,a=Cp(jp,o),s=xp(jp,o),l=mp(o),c=me(n,r.useRef(null),a.onTriggerChange),d=r.useRef(!1),u=r.useRef(!1),p=r.useCallback(()=>d.current=!1,[]);return r.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),e(vs,{asChild:!0,...l,children:e(Se.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:ke(t.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||s.isPointerInTransitRef.current||(a.onTriggerEnter(),u.current=!0))}),onPointerLeave:ke(t.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:ke(t.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:ke(t.onFocus,()=>{d.current||a.onOpen()}),onBlur:ke(t.onBlur,a.onClose),onClick:ke(t.onClick,a.onClose)})})});Ep.displayName=jp;var Rp="TooltipPortal",[zp,Dp]=fp(Rp,{forceMount:void 0}),Pp=t=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=t,a=Cp(Rp,n);return e(zp,{scope:n,forceMount:r,children:e(Ee,{present:r||a.open,children:e(xs,{asChild:!0,container:i,children:o})})})};Pp.displayName=Rp;var Mp="TooltipContent",Tp=r.forwardRef((t,n)=>{const r=Dp(Mp,t.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...a}=t,s=Cp(Mp,t.__scopeTooltip);return e(Ee,{present:o||s.open,children:s.disableHoverableContent?e(Hp,{side:i,...a,ref:n}):e(Ip,{side:i,...a,ref:n})})}),Ip=r.forwardRef((t,n)=>{const o=Cp(Mp,t.__scopeTooltip),i=xp(Mp,t.__scopeTooltip),a=r.useRef(null),s=me(n,a),[l,c]=r.useState(null),{trigger:d,onClose:u}=o,p=a.current,{onPointerInTransitChange:h}=i,f=r.useCallback(()=>{c(null),h(!1)},[h]),g=r.useCallback((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const r=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x)))break;t.pop()}t.push(r)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const r=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x)))break;n.pop()}n.push(r)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...o,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);c(i),h(!0)},[h]);return r.useEffect(()=>()=>f(),[f]),r.useEffect(()=>{if(d&&p){const e=e=>g(e,p),t=e=>g(e,d);return d.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[d,p,g,f]),r.useEffect(()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=d?.contains(t)||p?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e],s=t[i],l=a.x,c=a.y,d=s.x,u=s.y;c>r!=u>r&&n<(d-l)*(r-c)/(u-c)+l&&(o=!o)}return o}(n,l);r?f():o&&(f(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,p,l,u,f]),e(Hp,{...t,ref:s})}),[_p,Ap]=fp(Np,{isInside:!1}),Lp=function(n){const r=({children:n})=>e(t,{children:n});return r.displayName=`${n}.Slottable`,r.__radixId=we,r}("TooltipContent"),Hp=r.forwardRef((t,o)=>{const{__scopeTooltip:i,children:a,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=t,u=Cp(Mp,i),p=mp(i),{onClose:h}=u;return r.useEffect(()=>(document.addEventListener(wp,h),()=>document.removeEventListener(wp,h)),[h]),r.useEffect(()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&h()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,h]),e(Wo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:h,children:n(ws,{"data-state":u.stateAttribute,...p,...d,ref:o,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[e(Lp,{children:a}),e(_p,{scope:i,isInside:!0,children:e(hp,{id:u.contentId,role:"tooltip",children:s||a})})]})})});Tp.displayName=Mp;var Fp="TooltipArrow",Wp=r.forwardRef((t,n)=>{const{__scopeTooltip:r,...o}=t,i=mp(r);return Ap(Fp,r).isInside?null:e(ys,{...i,...o,ref:n})});Wp.displayName=Fp;var Bp=kp,Up=Sp,Vp=Ep,$p=Pp,Xp=Tp,Yp=Wp;const Kp=t=>{var{delayDuration:n=0}=t,r=de(t,["delayDuration"]);return e(Bp,Object.assign({"data-slot":"tooltip-provider",delayDuration:n},r))},qp=t=>{var n=de(t,[]);return e(Kp,{children:e(Up,Object.assign({"data-slot":"tooltip"},n))})},Gp=t=>{var n=de(t,[]);return e(Vp,Object.assign({"data-slot":"tooltip-trigger"},n))},Zp=t=>{var{className:r,sideOffset:o=0,children:i}=t,a=de(t,["className","sideOffset","children"]);return e($p,{children:n(Xp,Object.assign({"data-slot":"tooltip-content",sideOffset:o,className:Or("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r)},a,{children:[i,e(Yp,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]}))})},Jp=({referenceRef:r,elementProps:o,onUpdate:i,onReplace:a,onDelete:s,onCopy:l})=>{var c;const[d,h]=u(!1),f=o.provider&&o.provider.type,g="alignment"in o,{refs:m,floatingStyles:b}=dp({placement:"top",strategy:"fixed",middleware:[Ba(8),Ka(),Ua({padding:10})],whileElementsMounted:Ca});p(()=>{requestAnimationFrame(()=>{h(!0)})},[]),p(()=>{const e=r.current;e&&m.setReference(e)},[r,m]);return e("div",Object.assign({ref:m.setFloating,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),className:Or("pointer-events-auto","flex items-center gap-1 rounded-lg border bg-background/95 backdrop-blur-sm p-1 shadow-lg","transition-all duration-200 ease-out",d?"opacity-100 translate-y-0":"opacity-0 translate-y-2"),style:b},{children:n(Kp,Object.assign({delayDuration:0},{children:[g&&n("div",Object.assign({className:"flex items-center gap-0.5 border-r pr-1"},{children:[n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"left"===o.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>i({alignment:"left"})},{children:e(At,{className:"h-4 w-4"})}))})),e(Zp,{children:"Align left"})]}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"center"===o.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>i({alignment:"center"})},{children:e(_t,{className:"h-4 w-4"})}))})),e(Zp,{children:"Align center"})]}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"right"===o.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>i({alignment:"right"})},{children:e(Lt,{className:"h-4 w-4"})}))})),e(Zp,{children:"Align right"})]})]})),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a},{children:e(vn,{className:"h-4 w-4"})}))})),e(Zp,{children:"Replace"})]}),f&&(null===(c=o.provider)||void 0===c?void 0:c.url)&&n(t,{children:[n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{var e;l?l():(null===(e=o.provider)||void 0===e?void 0:e.url)&&Po(o.provider.url)}},{children:e(Zt,{className:"h-4 w-4"})}))})),e(Zp,{children:"Copy URL"})]}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{var e;(null===(e=o.provider)||void 0===e?void 0:e.url)&&window.open(o.provider.url,"_blank")}},{children:e(nn,{className:"h-4 w-4"})}))})),e(Zp,{children:"Open in new tab"})]})]}),e(Dd,{orientation:"vertical",className:"h-4"}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:s},{children:e(Nn,{className:"h-4 w-4"})}))})),e(Zp,{children:"Delete"})]})]}))}))},Qp=({blockId:t,attributes:r,children:o,elementProps:i,onUpdate:a,onDelete:s,onReplace:l,pluginOptions:c})=>{var h,f,g,m,b;const[v,w]=u(i.sizes||{width:650,height:400}),{isElementSelected:y}=C(),k=S({blockId:t}),N=y&&k,O=d(null),j=x(),[E,R]=u(()=>{var e,t;const n=(null===(e=j.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,r=null!==(t=null==c?void 0:c.maxWidth)&&void 0!==t?t:n;return{maxWidth:"number"==typeof r?r:n,maxHeight:800}});p(()=>{const e=()=>{var e,t;const n=(null===(e=j.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,r=null!==(t=null==c?void 0:c.maxWidth)&&void 0!==t?t:n;R({maxWidth:"number"==typeof r?r:n,maxHeight:800})};e();const t=new ResizeObserver(e);return j.refElement&&t.observe(j.refElement),window.addEventListener("resize",e),()=>{t.disconnect(),window.removeEventListener("resize",e)}},[j,c]);const z=(e,t)=>{const n=e=>"number"==typeof e?e:parseInt(String(e).replace(/[^\d]/g,""),10),r=n(e.width),o=n(e.height),i=n(t.width),a=n(t.height);if(r<=i&&o<=a)return{width:r,height:o};const s=r/i,l=o/a,c=Math.max(s,l),d=Math.round(r/c),u=Math.round(o/c);return{width:Math.min(d,i),height:Math.min(u,a)}},D=i.provider,P=null!==(h=null==D?void 0:D.embedUrl)&&void 0!==h?h:"",M={left:"justify-start",center:"justify-center",right:"justify-end"}[null!==(f=i.alignment)&&void 0!==f?f:"center"];return n("div",Object.assign({},r,{className:Or("group/embed mt-2 relative transition-all w-full flex",M)},{children:[n("div",Object.assign({className:"relative",contentEditable:!1},{children:[e(Qu,Object.assign({ref:e=>{(null==e?void 0:e.resizableElement)&&e.resizableElement instanceof HTMLElement&&(O.current=e.resizableElement)},style:{position:"relative",outline:N?".125rem solid rgba(0, 0, 0, 0)":"none",outlineColor:N?"hsl(var(--primary))":"none"},size:{width:"number"==typeof v.width?v.width:parseInt(String(v.width),10),height:"number"==typeof v.height?v.height:parseInt(String(v.height),10)},onResize:(e,t,n)=>{const r=parseInt(n.style.width,10),o=parseInt(n.style.height,10),i=z({width:r,height:o},{width:E.maxWidth,height:E.maxHeight});w(i)},onResizeStop:(e,t,n)=>{const r=parseInt(n.style.width,10),o=parseInt(n.style.height,10),i=z({width:r,height:o},{width:E.maxWidth,height:E.maxHeight});a({sizes:i})},lockAspectRatio:!0,minWidth:200,minHeight:150,maxWidth:E.maxWidth,maxHeight:E.maxHeight,enableResizing:!!N&&{bottom:!1,bottomLeft:!1,bottomRight:!1,left:!0,right:!0,top:!1,topLeft:!1,topRight:!1},disableDragging:!0,resizeHandleStyles:{left:{width:"auto",height:"40px",left:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"},right:{width:"auto",height:"40px",right:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"}},resizeHandleComponent:{left:e("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"}),right:e("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"})},className:Or("rounded-sm overflow-hidden")},{children:e("iframe",{title:null!==(m=null===(g=null==D?void 0:D.meta)||void 0===g?void 0:g.title)&&void 0!==m?m:`Embedded content from ${null!==(b=null==D?void 0:D.type)&&void 0!==b?b:"unknown"}`,src:P,width:"100%",height:"100%",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,className:"w-full h-full",style:{aspectRatio:`${v.width} / ${v.height}`}})})),N&&e(Jp,{referenceRef:O,elementProps:i,onUpdate:a,onReplace:l,onDelete:s,onCopy:()=>ue(void 0,void 0,void 0,function*(){if(null==D?void 0:D.url)try{const{default:e}=yield Promise.resolve().then(function(){return Mo});e(D.url)}catch(e){}})})]})),o]}))},eh={embed:{render:({element:t,attributes:n,children:r,blockId:o})=>{var i;const a=x(),s=j("Embed"),l=c(e=>{N.updateElement(a,{blockId:o,type:"embed",props:Object.assign(Object.assign({},t.props),e)})},[a,o,t.props]),d=c(()=>ue(void 0,void 0,void 0,function*(){const e=k.getBlockSlate(a,{id:o});if(!e)return;const n=N.getElementPath(a,{blockId:o,element:t});if(!n)return;const r=n?R.parent(e,n):void 0;r&&P.isElement(r[0])&&!R.isEditor(r[0])?N.deleteElement(a,{blockId:o,type:"embed",path:n}):k.deleteBlock(a,{blockId:o,focus:!0})}),[a,o,t]),u=c(()=>{N.updateElement(a,{blockId:o,type:"embed",props:Object.assign(Object.assign({},t.props),{provider:null})})},[a,o,t.props]),p=c(e=>ue(void 0,void 0,void 0,function*(){var t;const n=U(e);if(n){const e=null!==(t=null==s?void 0:s.maxWidth)&&void 0!==t?t:650,{width:r,height:o}=V(n.type,e);l({provider:n,sizes:{width:r,height:o}})}}),[l,s]),h=t;return(null===(i=h.props)||void 0===i?void 0:i.provider)?e(Qp,Object.assign({blockId:o,elementId:t.id,onUpdate:l,onDelete:d,attributes:n,onReplace:u,elementProps:h.props,pluginOptions:s},{children:r})):e(Ad,Object.assign({onInsertUrl:p,attributes:n},{children:r}))}}},th={HeadingOne:{"heading-one":{render:t=>{const{attributes:n,children:r,element:o}=t;return e("h1",Object.assign({id:o.id,draggable:!1},n,{className:"scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl"},{children:r}))}}},HeadingTwo:{"heading-two":{render:t=>{const{attributes:n,children:r,element:o}=t;return e("h2",Object.assign({id:o.id,draggable:!1},n,{className:"scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0"},{children:r}))}}},HeadingThree:{"heading-three":{render:t=>{const{attributes:n,children:r,element:o}=t;return e("h3",Object.assign({id:o.id,draggable:!1},n,{className:"mt-4 scroll-m-20 text-2xl font-semibold tracking-tight"},{children:r}))}}}},nh=({onInsertFromUnsplash:t})=>e(Dc,Object.assign({value:"unsplash",className:"mt-4"},{children:n("div",Object.assign({className:"flex flex-col items-center gap-3 py-6"},{children:[e("div",Object.assign({className:"rounded-lg bg-muted p-3"},{children:e("svg",Object.assign({className:"h-6 w-6",viewBox:"0 0 32 32",fill:"currentColor"},{children:e("path",{d:"M10 9V0h12v9H10zm12 5h10v18H0V14h10v9h12v-9z"})}))})),n("div",Object.assign({className:"text-center"},{children:[e("p",Object.assign({className:"text-sm font-medium"},{children:"Browse free photos"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Powered by Unsplash"}))]})),e(vo,Object.assign({onClick:t},{children:"Browse photos"}))]}))})),rh=({preview:t})=>e("div",Object.assign({className:"absolute inset-0 overflow-hidden",style:{width:t.width,height:t.height}},{children:e("img",{src:t.url,alt:"Preview",className:"h-full w-full object-cover object-center",style:{width:t.width,height:t.height},draggable:!1})})),oh=({progress:t})=>e("div",Object.assign({className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-4 bg-black/70 backdrop-blur-sm p-6"},{children:e("div",Object.assign({className:"w-full max-w-md space-y-4"},{children:n("div",Object.assign({className:"space-y-2"},{children:[n("div",Object.assign({className:"flex items-center justify-between text-sm"},{children:[e("span",Object.assign({className:"font-medium text-white"},{children:"Uploading..."})),n("span",Object.assign({className:"text-white/80"},{children:[t.percentage,"%"]}))]})),e("div",Object.assign({className:"h-2 w-full overflow-hidden rounded-full bg-white/20"},{children:e("div",{className:"h-full bg-primary transition-all duration-300 ease-out",style:{width:`${t.percentage}%`}})})),n("div",Object.assign({className:"flex items-center justify-between text-xs text-white/60"},{children:[n("span",{children:[(t.loaded/1024/1024).toFixed(2)," MB /"," ",(t.total/1024/1024).toFixed(2)," MB"]}),e(sn,{className:"h-3.5 w-3.5 animate-spin"})]}))]}))}))})),ih=({onUpload:t,hasPreview:r})=>{const o=d(null);return n("div",r?Object.assign({className:"flex flex-col items-center justify-center gap-4 py-8"},{children:[n("div",Object.assign({className:"text-center space-y-2"},{children:[e("p",Object.assign({className:"text-sm font-medium text-white"},{children:"Image preview"})),e("p",Object.assign({className:"text-xs text-white/80"},{children:"Uploading your image..."}))]})),e("input",{ref:o,type:"file",accept:"image/*",onChange:t,className:"hidden"})]}):Object.assign({className:"flex flex-col items-center gap-3 py-6"},{children:[e("div",Object.assign({className:"rounded-lg bg-muted p-3"},{children:e(rn,{className:"h-6 w-6 text-muted-foreground"})})),n("div",Object.assign({className:"text-center"},{children:[e("p",Object.assign({className:"text-sm font-medium"},{children:"Upload an image"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Click or drag and drop"}))]})),e(vo,Object.assign({onClick:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.click()}},{children:"Choose file"})),e("input",{ref:o,type:"file",accept:"image/*",onChange:t,className:"hidden"})]}))},ah=({onInsertUrl:t})=>{const[r,o]=u(""),i=()=>{r.trim()&&(t(r.trim()),o(""))};return n("div",Object.assign({className:"mt-4 space-y-3"},{children:[e(To,{placeholder:"Paste image URL...",value:r,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&r.trim()&&i()}}),e(vo,Object.assign({className:"w-full",onClick:i,disabled:!r.trim()},{children:"Embed image"}))]}))},sh=({onInsertFromAI:r})=>{const[o,i]=u(""),[a,s]=u(!1),l=()=>{o.trim()&&!a&&(s(!0),r(o.trim()),s(!1),i(""))};return n("div",Object.assign({className:"mt-4 space-y-3"},{children:[n("div",Object.assign({className:"space-y-2"},{children:[e(To,{placeholder:"Describe the image...",value:o,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&l()},disabled:a}),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:'Example: "A sunset over mountains with dramatic clouds”'}))]})),e(vo,Object.assign({className:"w-full gap-2",onClick:l,disabled:!o.trim()||a},{children:n(t,a?{children:[e(sn,{className:"h-4 w-4 animate-spin"}),"Generating..."]}:{children:[e(xn,{className:"h-4 w-4"}),"Generate image"]})}))]}))},lh=({onUpload:t,onInsertUrl:r,onInsertFromUnsplash:o,onInsertFromAI:i,hasPreview:a})=>e("div",Object.assign({className:Or("relative p-4",a&&"min-h-[300px] flex flex-col")},{children:n(Ec,Object.assign({defaultValue:"upload",className:"w-full"},{children:[n(Rc,Object.assign({className:Or("grid w-full grid-cols-4",a&&"bg-background/80 backdrop-blur-sm")},{children:[n(zc,Object.assign({value:"upload",className:"gap-1.5"},{children:[e(Cn,{className:"h-3.5 w-3.5"}),"Upload"]})),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:n(zc,Object.assign({value:"link",disabled:!0,className:"gap-1.5"},{children:[e(an,{className:"h-3.5 w-3.5"}),"Link"]}))})),e(Zp,{children:"Link is not available yet"})]}),o&&n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:n(zc,Object.assign({value:"unsplash",disabled:!0,className:"gap-1.5"},{children:[e("svg",Object.assign({className:"h-3.5 w-3.5",viewBox:"0 0 32 32",fill:"currentColor"},{children:e("path",{d:"M10 9V0h12v9H10zm12 5h10v18H0V14h10v9h12v-9z"})})),"Unsplash"]}))})),e(Zp,{children:"Unsplash is not available yet"})]}),i&&n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:n(zc,Object.assign({value:"ai",disabled:!0,className:"gap-1.5"},{children:[e(xn,{className:"h-3.5 w-3.5"}),"AI"]}))})),e(Zp,{children:"AI is not available yet"})]})]})),e(Dc,Object.assign({value:"upload",className:"mt-4"},{children:e(ih,{onUpload:t,hasPreview:a})})),e(Dc,Object.assign({value:"link",d:!0},{children:e(ah,{onInsertUrl:r})})),o&&e(nh,{onInsertFromUnsplash:o}),i&&e(Dc,Object.assign({value:"ai"},{children:e(sh,{onInsertFromAI:i})}))]}))})),ch=({onUpload:t,onInsertUrl:r,onInsertFromUnsplash:o,onInsertFromAI:i,className:a,attributes:s,children:l,preview:c,progress:d,loading:u})=>{const p=null!==c&&!!c.url,h=u&&d;return n("div",Object.assign({className:Or("mt-2 relative rounded-lg border bg-background overflow-hidden",p&&"min-h-[300px]",a)},s,{contentEditable:!1},{children:[p&&e(rh,{preview:c}),!p&&e(lh,{onUpload:t,onInsertUrl:r,onInsertFromUnsplash:o,onInsertFromAI:i,hasPreview:p}),h&&d&&e(oh,{progress:d}),l]}))};var dh=Symbol.for("react.lazy"),uh=r[" use ".trim().toString()];function ph(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===dh&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function hh(e){const t=r.forwardRef((e,t)=>{let{children:n,...o}=e;if(ph(n)&&"function"==typeof uh&&(n=uh(n._payload)),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),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(i.ref=t?ge(t,e):e),r.cloneElement(n,i)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fh=Symbol("radix.slottable");function gh(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===fh}var mh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const o=function(t){const n=hh(t),o=r.forwardRef((t,o)=>{let{children:i,...a}=t;ph(i)&&"function"==typeof uh&&(i=uh(i._payload));const s=r.Children.toArray(i),l=s.find(gh);if(l){const t=l.props.children,i=s.map(e=>e===l?r.Children.count(t)>1?r.Children.only(null):r.isValidElement(t)?t.props.children:null:e);return e(n,{...a,ref:o,children:r.isValidElement(t)?r.cloneElement(t,void 0,i):null})}return e(n,{...a,ref:o,children:i})});return o.displayName=`${t}.Slot`,o}(`Primitive.${n}`),i=r.forwardRef((t,r)=>{const{asChild:i,...a}=t,s=i?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e(s,{...a,ref:r})});return i.displayName=`Primitive.${n}`,{...t,[n]:i}},{}),bh=r.forwardRef((t,n)=>e(mh.label,{...t,ref:n,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));bh.displayName="Label";var vh=bh;const wh=mo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),yh=r.forwardRef((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e(vh,Object.assign({ref:n,className:Or(wh(),r)},o))});function xh(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])}yh.displayName=vh.displayName;var kh=[" ","Enter","ArrowUp","ArrowDown"],Nh=[" ","Enter"],Oh="Select",[Ch,Sh,jh]=xe(Oh),[Eh,Rh]=pe(Oh,[jh,ts]),zh=ts(),[Dh,Ph]=Eh(Oh),[Mh,Th]=Eh(Oh),Ih=t=>{const{__scopeSelect:o,children:i,open:a,defaultOpen:s,onOpenChange:l,value:c,defaultValue:d,onValueChange:u,dir:p,name:h,autoComplete:f,disabled:g,required:m,form:b}=t,v=zh(o),[w,y]=r.useState(null),[x,k]=r.useState(null),[N,O]=r.useState(!1),C=qe(p),[S,j]=Ce({prop:a,defaultProp:s??!1,onChange:l,caller:Oh}),[E,R]=Ce({prop:c,defaultProp:d,onChange:u,caller:Oh}),z=r.useRef(null),D=!w||(b||!!w.closest("form")),[P,M]=r.useState(new Set),T=Array.from(P).map(e=>e.props.value).join(";");return e(bs,{...v,children:n(Dh,{required:m,scope:o,trigger:w,onTriggerChange:y,valueNode:x,onValueNodeChange:k,valueNodeHasChildren:N,onValueNodeHasChildrenChange:O,contentId:Pe(),value:E,onValueChange:R,open:S,onOpenChange:j,dir:C,triggerPointerDownPosRef:z,disabled:g,children:[e(Ch.Provider,{scope:o,children:e(Mh,{scope:t.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{M(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:i})}),D?n(xf,{"aria-hidden":!0,required:m,tabIndex:-1,name:h,autoComplete:f,value:E,onChange:e=>R(e.target.value),disabled:g,form:b,children:[void 0===E?e("option",{value:""}):null,Array.from(P)]},T):null]})})};Ih.displayName=Oh;var _h="SelectTrigger",Ah=r.forwardRef((t,n)=>{const{__scopeSelect:o,disabled:i=!1,...a}=t,s=zh(o),l=Ph(_h,o),c=l.disabled||i,d=me(n,l.onTriggerChange),u=Sh(o),p=r.useRef("touch"),[h,f,g]=Nf(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),r=Of(t,e,n);void 0!==r&&l.onValueChange(r.value)}),m=e=>{c||(l.onOpenChange(!0),g()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e(vs,{asChild:!0,...s,children:e(Se.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":kf(l.value)?"":void 0,...a,ref:d,onClick:ke(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&m(e)}),onPointerDown:ke(a.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&&(m(e),e.preventDefault())}),onKeyDown:ke(a.onKeyDown,e=>{const t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),t&&" "===e.key||kh.includes(e.key)&&(m(),e.preventDefault())})})})});Ah.displayName=_h;var Lh="SelectValue",Hh=r.forwardRef((n,r)=>{const{__scopeSelect:o,className:i,style:a,children:s,placeholder:l="",...c}=n,d=Ph(Lh,o),{onValueNodeHasChildrenChange:u}=d,p=void 0!==s,h=me(r,d.onValueNodeChange);return Ne(()=>{u(p)},[u,p]),e(Se.span,{...c,ref:h,style:{pointerEvents:"none"},children:kf(d.value)?e(t,{children:l}):s})});Hh.displayName=Lh;var Fh=r.forwardRef((t,n)=>{const{__scopeSelect:r,children:o,...i}=t;return e(Se.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})});Fh.displayName="SelectIcon";var Wh=t=>e(xs,{asChild:!0,...t});Wh.displayName="SelectPortal";var Bh="SelectContent",Uh=r.forwardRef((t,n)=>{const o=Ph(Bh,t.__scopeSelect),[i,a]=r.useState();if(Ne(()=>{a(new DocumentFragment)},[]),!o.open){const n=i;return n?v.createPortal(e($h,{scope:t.__scopeSelect,children:e(Ch.Slot,{scope:t.__scopeSelect,children:e("div",{children:t.children})})}),n):null}return e(Kh,{...t,ref:n})});Uh.displayName=Bh;var Vh=10,[$h,Xh]=Eh(Bh),Yh=be("SelectContent.RemoveScroll"),Kh=r.forwardRef((t,n)=>{const{__scopeSelect:o,position:i="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:g,sticky:m,hideWhenDetached:b,avoidCollisions:v,...w}=t,y=Ph(Bh,o),[x,k]=r.useState(null),[N,O]=r.useState(null),C=me(n,e=>k(e)),[S,j]=r.useState(null),[E,R]=r.useState(null),z=Sh(o),[D,P]=r.useState(!1),M=r.useRef(!1);r.useEffect(()=>{if(x)return Es(x)},[x]),$o();const T=r.useCallback(e=>{const[t,...n]=z().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&N&&(N.scrollTop=0),n===r&&N&&(N.scrollTop=N.scrollHeight),n?.focus(),document.activeElement!==o)return}},[z,N]),I=r.useCallback(()=>T([S,x]),[T,S,x]);r.useEffect(()=>{D&&I()},[D,I]);const{onOpenChange:_,triggerPointerDownPosRef:A}=y;r.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(A.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(A.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||_(!1),document.removeEventListener("pointermove",t),A.current=null};return null!==A.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,_,A]),r.useEffect(()=>{const e=()=>_(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[_]);const[L,H]=Nf(e=>{const t=z().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=Of(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),F=r.useCallback((e,t,n)=>{const r=!M.current&&!n;(void 0!==y.value&&y.value===t||r)&&(j(e),r&&(M.current=!0))},[y.value]),W=r.useCallback(()=>x?.focus(),[x]),B=r.useCallback((e,t,n)=>{const r=!M.current&&!n;(void 0!==y.value&&y.value===t||r)&&R(e)},[y.value]),U="popper"===i?Gh:qh,V=U===Gh?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:g,sticky:m,hideWhenDetached:b,avoidCollisions:v}:{};return e($h,{scope:o,content:x,viewport:N,onViewportChange:O,itemRefCallback:F,selectedItem:S,onItemLeave:W,itemTextRefCallback:B,focusSelectedItem:I,selectedItemText:E,position:i,isPositioned:D,searchRef:L,children:e(fl,{as:Yh,allowPinchZoom:!0,children:e(Go,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ke(a,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e(Wo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:e(U,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:e=>e.preventDefault(),...w,...V,onPlaced:()=>P(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:ke(w.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||H(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=z().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,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>T(t)),e.preventDefault()}})})})})})})});Kh.displayName="SelectContentImpl";var qh=r.forwardRef((t,n)=>{const{__scopeSelect:o,onPlaced:i,...a}=t,s=Ph(Bh,o),l=Xh(Bh,o),[c,d]=r.useState(null),[u,p]=r.useState(null),h=me(n,e=>p(e)),f=Sh(o),g=r.useRef(!1),m=r.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:w,focusSelectedItem:y}=l,x=r.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&b&&v&&w){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==s.dir){const o=r.left-t.left,i=n.left-o,a=e.left-i,s=e.width+a,l=Math.max(s,t.width),d=window.innerWidth-Vh,u=Mc(i,[Vh,Math.max(Vh,d-l)]);c.style.minWidth=s+"px",c.style.left=u+"px"}else{const o=t.right-r.right,i=window.innerWidth-n.right-o,a=window.innerWidth-e.right-i,s=e.width+a,l=Math.max(s,t.width),d=window.innerWidth-Vh,u=Mc(i,[Vh,Math.max(Vh,d-l)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const o=f(),a=window.innerHeight-2*Vh,l=b.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),m=parseInt(d.borderBottomWidth,10),y=p+h+l+parseInt(d.paddingBottom,10)+m,x=Math.min(5*v.offsetHeight,y),k=window.getComputedStyle(b),N=parseInt(k.paddingTop,10),O=parseInt(k.paddingBottom,10),C=e.top+e.height/2-Vh,S=a-C,j=v.offsetHeight/2,E=p+h+(v.offsetTop+j),R=y-E;if(E<=C){const e=o.length>0&&v===o[o.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-b.offsetTop-b.offsetHeight,n=E+Math.max(S,j+(e?O:0)+t+m);c.style.height=n+"px"}else{const e=o.length>0&&v===o[0].ref.current;c.style.top="0px";const t=Math.max(C,p+b.offsetTop+(e?N:0)+j)+R;c.style.height=t+"px",b.scrollTop=E-C+b.offsetTop}c.style.margin=`${Vh}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=a+"px",i?.(),requestAnimationFrame(()=>g.current=!0)}},[f,s.trigger,s.valueNode,c,u,b,v,w,s.dir,i]);Ne(()=>x(),[x]);const[k,N]=r.useState();Ne(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const O=r.useCallback(e=>{e&&!0===m.current&&(x(),y?.(),m.current=!1)},[x,y]);return e(Zh,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:O,children:e("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:e(Se.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});qh.displayName="SelectItemAlignedPosition";var Gh=r.forwardRef((t,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=Vh,...a}=t,s=zh(r);return e(ws,{...s,...a,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...a.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)"}})});Gh.displayName="SelectPopperPosition";var[Zh,Jh]=Eh(Bh,{}),Qh="SelectViewport",ef=r.forwardRef((o,i)=>{const{__scopeSelect:a,nonce:s,...l}=o,c=Xh(Qh,a),d=Jh(Qh,a),u=me(i,c.onViewportChange),p=r.useRef(0);return n(t,{children:[e("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:s}),e(Ch.Slot,{scope:a,children:e(Se.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:ke(l.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=d;if(r?.current&&n){const e=Math.abs(p.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*Vh,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),a=Math.max(o,i);if(a<r){const o=a+e,i=Math.min(r,o),s=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});ef.displayName=Qh;var tf="SelectGroup",[nf,rf]=Eh(tf),of=r.forwardRef((t,n)=>{const{__scopeSelect:r,...o}=t,i=Pe();return e(nf,{scope:r,id:i,children:e(Se.div,{role:"group","aria-labelledby":i,...o,ref:n})})});of.displayName=tf;var af="SelectLabel";r.forwardRef((t,n)=>{const{__scopeSelect:r,...o}=t,i=rf(af,r);return e(Se.div,{id:i.id,...o,ref:n})}).displayName=af;var sf="SelectItem",[lf,cf]=Eh(sf),df=r.forwardRef((t,n)=>{const{__scopeSelect:o,value:i,disabled:a=!1,textValue:s,...l}=t,c=Ph(sf,o),d=Xh(sf,o),u=c.value===i,[p,h]=r.useState(s??""),[f,g]=r.useState(!1),m=me(n,e=>d.itemRefCallback?.(e,i,a)),b=Pe(),v=r.useRef("touch"),w=()=>{a||(c.onValueChange(i),c.onOpenChange(!1))};if(""===i)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 e(lf,{scope:o,value:i,disabled:a,textId:b,isSelected:u,onItemTextChange:r.useCallback(e=>{h(t=>t||(e?.textContent??"").trim())},[]),children:e(Ch.ItemSlot,{scope:o,value:i,disabled:a,textValue:p,children:e(Se.div,{role:"option","aria-labelledby":b,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:m,onFocus:ke(l.onFocus,()=>g(!0)),onBlur:ke(l.onBlur,()=>g(!1)),onClick:ke(l.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:ke(l.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:ke(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:ke(l.onPointerMove,e=>{v.current=e.pointerType,a?d.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:ke(l.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(Nh.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});df.displayName=sf;var uf="SelectItemText",pf=r.forwardRef((o,i)=>{const{__scopeSelect:a,className:s,style:l,...c}=o,d=Ph(uf,a),u=Xh(uf,a),p=cf(uf,a),h=Th(uf,a),[f,g]=r.useState(null),m=me(i,e=>g(e),p.onItemTextChange,e=>u.itemTextRefCallback?.(e,p.value,p.disabled)),b=f?.textContent,w=r.useMemo(()=>e("option",{value:p.value,disabled:p.disabled,children:b},p.value),[p.disabled,p.value,b]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=h;return Ne(()=>(y(w),()=>x(w)),[y,x,w]),n(t,{children:[e(Se.span,{id:p.textId,...c,ref:m}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren?v.createPortal(c.children,d.valueNode):null]})});pf.displayName=uf;var hf="SelectItemIndicator",ff=r.forwardRef((t,n)=>{const{__scopeSelect:r,...o}=t;return cf(hf,r).isSelected?e(Se.span,{"aria-hidden":!0,...o,ref:n}):null});ff.displayName=hf;var gf="SelectScrollUpButton",mf=r.forwardRef((t,n)=>{const o=Xh(gf,t.__scopeSelect),i=Jh(gf,t.__scopeSelect),[a,s]=r.useState(!1),l=me(n,i.onScrollButtonChange);return Ne(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?e(wf,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});mf.displayName=gf;var bf="SelectScrollDownButton",vf=r.forwardRef((t,n)=>{const o=Xh(bf,t.__scopeSelect),i=Jh(bf,t.__scopeSelect),[a,s]=r.useState(!1),l=me(n,i.onScrollButtonChange);return Ne(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?e(wf,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});vf.displayName=bf;var wf=r.forwardRef((t,n)=>{const{__scopeSelect:o,onAutoScroll:i,...a}=t,s=Xh("SelectScrollButton",o),l=r.useRef(null),c=Sh(o),d=r.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return r.useEffect(()=>()=>d(),[d]),Ne(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),e(Se.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:ke(a.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(i,50))}),onPointerMove:ke(a.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(i,50))}),onPointerLeave:ke(a.onPointerLeave,()=>{d()})})});r.forwardRef((t,n)=>{const{__scopeSelect:r,...o}=t;return e(Se.div,{"aria-hidden":!0,...o,ref:n})}).displayName="SelectSeparator";var yf="SelectArrow";r.forwardRef((t,n)=>{const{__scopeSelect:r,...o}=t,i=zh(r),a=Ph(yf,r),s=Xh(yf,r);return a.open&&"popper"===s.position?e(ys,{...i,...o,ref:n}):null}).displayName=yf;var xf=r.forwardRef(({__scopeSelect:t,value:n,...o},i)=>{const a=r.useRef(null),s=me(i,a),l=xh(n);return r.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[l,n]),e(Se.select,{...o,style:{...up,...o.style},ref:s,defaultValue:n})});function kf(e){return""===e||void 0===e}function Nf(e){const t=Io(e),n=r.useRef(""),o=r.useRef(0),i=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]),a=r.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,i,a]}function Of(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=(a=e,s=Math.max(o,0),a.map((e,t)=>a[(s+t)%a.length]));var a,s;1===r.length&&(i=i.filter(e=>e!==n));const l=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}xf.displayName="SelectBubbleInput";var Cf=Ih,Sf=Ah,jf=Hh,Ef=Fh,Rf=Wh,zf=Uh,Df=ef,Pf=of,Mf=df,Tf=pf,If=ff,_f=mf,Af=vf;const Lf=t=>{var n=de(t,[]);return e(Cf,Object.assign({"data-slot":"select"},n))},Hf=t=>{var n=de(t,[]);return e(Pf,Object.assign({"data-slot":"select-group"},n))},Ff=t=>{var n=de(t,[]);return e(jf,Object.assign({"data-slot":"select-value"},n))},Wf=t=>{var{className:r,size:o="default",children:i}=t,a=de(t,["className","size","children"]);return n(Sf,Object.assign({"data-slot":"select-trigger","data-size":o,className:Or("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r)},a,{children:[i,e(Ef,Object.assign({asChild:!0},{children:e(Vt,{className:"size-4 opacity-50"})}))]}))},Bf=t=>{var{className:n}=t,r=de(t,["className"]);return e(_f,Object.assign({"data-slot":"select-scroll-up-button",className:Or("flex cursor-default items-center justify-center py-1",n)},r,{children:e(Xt,{className:"size-4"})}))},Uf=t=>{var{className:n}=t,r=de(t,["className"]);return e(Af,Object.assign({"data-slot":"select-scroll-down-button",className:Or("flex cursor-default items-center justify-center py-1",n)},r,{children:e(Vt,{className:"size-4"})}))},Vf=t=>{var{className:r,children:o,position:i="item-aligned",align:a="center"}=t,s=de(t,["className","children","position","align"]);return e(Rf,{children:n(zf,Object.assign({"data-slot":"select-content",className:Or("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:i,align:a},s,{children:[e(Bf,{}),e(Df,Object.assign({className:Or("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1")},{children:o})),e(Uf,{})]}))})},$f=t=>{var{className:r,children:o}=t,i=de(t,["className","children"]);return n(Mf,Object.assign({"data-slot":"select-item",className:Or("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",r)},i,{children:[e("span",Object.assign({"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center"},{children:e(If,{children:e(Ut,{className:"size-4"})})})),e(Tf,{children:o})]}))};var Xf=["PageUp","PageDown"],Yf=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Kf={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},qf="Slider",[Gf,Zf,Jf]=xe(qf),[Qf,eg]=pe(qf,[Jf]),[tg,ng]=Qf(qf),rg=r.forwardRef((t,n)=>{const{name:o,min:i=0,max:a=100,step:s=1,orientation:l="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:u=[i],value:p,onValueChange:h=()=>{},onValueCommit:f=()=>{},inverted:g=!1,form:m,...b}=t,v=r.useRef(new Set),w=r.useRef(0),y="horizontal"===l?ag:sg,[x=[],k]=Ce({prop:p,defaultProp:u,onChange:e=>{const t=[...v.current];t[w.current]?.focus(),h(e)}}),N=r.useRef(x);function O(e,t,{commit:n}={commit:!1}){const r=function(e){return(String(e).split(".")[1]||"").length}(s),o=function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}(Math.round((e-i)/s)*s+i,r),l=Mc(o,[i,a]);k((e=[])=>{const r=function(e=[],t,n){const r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}(e,l,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}(r,d*s)){w.current=r.indexOf(l);const t=String(r)!==String(e);return t&&n&&f(r),t?r:e}return e})}return e(tg,{scope:t.__scopeSlider,name:o,disabled:c,min:i,max:a,valueIndexToChangeRef:w,thumbs:v.current,values:x,orientation:l,form:m,children:e(Gf.Provider,{scope:t.__scopeSlider,children:e(Gf.Slot,{scope:t.__scopeSlider,children:e(y,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:n,onPointerDown:ke(b.onPointerDown,()=>{c||(N.current=x)}),min:i,max:a,inverted:g,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)),r=Math.min(...n);return n.indexOf(r)}(x,e);O(e,t)},onSlideMove:c?void 0:function(e){O(e,w.current)},onSlideEnd:c?void 0:function(){const e=N.current[w.current];x[w.current]!==e&&f(x)},onHomeKeyDown:()=>!c&&O(i,0,{commit:!0}),onEndKeyDown:()=>!c&&O(a,x.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!c){const n=Xf.includes(e.key)||e.shiftKey&&Yf.includes(e.key)?10:1,r=w.current;O(x[r]+s*n*t,r,{commit:!0})}}})})})})});rg.displayName=qf;var[og,ig]=Qf(qf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ag=r.forwardRef((t,n)=>{const{min:o,max:i,dir:a,inverted:s,onSlideStart:l,onSlideMove:c,onSlideEnd:d,onStepKeyDown:u,...p}=t,[h,f]=r.useState(null),g=me(n,e=>f(e)),m=r.useRef(void 0),b=qe(a),v="ltr"===b,w=v&&!s||!v&&s;function y(e){const t=m.current||h.getBoundingClientRect(),n=vg([0,t.width],w?[o,i]:[i,o]);return m.current=t,n(e-t.left)}return e(og,{scope:t.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:e(lg,{dir:b,"data-orientation":"horizontal",...p,ref:g,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{const t=y(e.clientX);l?.(t)},onSlideMove:e=>{const t=y(e.clientX);c?.(t)},onSlideEnd:()=>{m.current=void 0,d?.()},onStepKeyDown:e=>{const t=Kf[w?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),sg=r.forwardRef((t,n)=>{const{min:o,max:i,inverted:a,onSlideStart:s,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...u}=t,p=r.useRef(null),h=me(n,p),f=r.useRef(void 0),g=!a;function m(e){const t=f.current||p.current.getBoundingClientRect(),n=vg([0,t.height],g?[i,o]:[o,i]);return f.current=t,n(e-t.top)}return e(og,{scope:t.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:e(lg,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{const t=m(e.clientY);s?.(t)},onSlideMove:e=>{const t=m(e.clientY);l?.(t)},onSlideEnd:()=>{f.current=void 0,c?.()},onStepKeyDown:e=>{const t=Kf[g?"from-bottom":"from-top"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})}),lg=r.forwardRef((t,n)=>{const{__scopeSlider:r,onSlideStart:o,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:s,onEndKeyDown:l,onStepKeyDown:c,...d}=t,u=ng(qf,r);return e(Se.span,{...d,ref:n,onKeyDown:ke(t.onKeyDown,e=>{"Home"===e.key?(s(e),e.preventDefault()):"End"===e.key?(l(e),e.preventDefault()):Xf.concat(Yf).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:ke(t.onPointerDown,e=>{const t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():o(e)}),onPointerMove:ke(t.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:ke(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),cg="SliderTrack",dg=r.forwardRef((t,n)=>{const{__scopeSlider:r,...o}=t,i=ng(cg,r);return e(Se.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...o,ref:n})});dg.displayName=cg;var ug="SliderRange",pg=r.forwardRef((t,n)=>{const{__scopeSlider:o,...i}=t,a=ng(ug,o),s=ig(ug,o),l=me(n,r.useRef(null)),c=a.values.length,d=a.values.map(e=>bg(e,a.min,a.max)),u=c>1?Math.min(...d):0,p=100-Math.max(...d);return e(Se.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...i,ref:l,style:{...t.style,[s.startEdge]:u+"%",[s.endEdge]:p+"%"}})});pg.displayName=ug;var hg="SliderThumb",fg=r.forwardRef((t,n)=>{const o=Zf(t.__scopeSlider),[i,a]=r.useState(null),s=me(n,e=>a(e)),l=r.useMemo(()=>i?o().findIndex(e=>e.ref.current===i):-1,[o,i]);return e(gg,{...t,ref:s,index:l})}),gg=r.forwardRef((t,o)=>{const{__scopeSlider:i,index:a,name:s,...l}=t,c=ng(hg,i),d=ig(hg,i),[u,p]=r.useState(null),h=me(o,e=>p(e)),f=!u||(c.form||!!u.closest("form")),g=Ja(u),m=c.values[a],b=void 0===m?0:bg(m,c.min,c.max),v=function(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}(a,c.values.length),w=g?.[d.size],y=w?function(e,t,n){const r=e/2,o=vg([0,50],[0,r]);return(r-o(t)*n)*n}(w,b,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(${b}% + ${y}px)`},children:[e(Gf.ItemSlot,{scope:t.__scopeSlider,children:e(Se.span,{role:"slider","aria-label":t["aria-label"]||v,"aria-valuemin":c.min,"aria-valuenow":m,"aria-valuemax":c.max,"aria-orientation":c.orientation,"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,tabIndex:c.disabled?void 0:0,...l,ref:h,style:void 0===m?{display:"none"}:t.style,onFocus:ke(t.onFocus,()=>{c.valueIndexToChangeRef.current=a})})}),f&&e(mg,{name:s??(c.name?c.name+(c.values.length>1?"[]":""):void 0),form:c.form,value:m},a)]})});fg.displayName=hg;var mg=r.forwardRef(({__scopeSlider:t,value:n,...o},i)=>{const a=r.useRef(null),s=me(a,i),l=xh(n);return r.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==n&&r){const t=new Event("input",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[l,n]),e(Se.input,{style:{display:"none"},...o,ref:s,defaultValue:n})});function bg(e,t,n){return Mc(100/(n-t)*(e-t),[0,100])}function vg(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}mg.displayName="RadioBubbleInput";var wg=rg,yg=dg,xg=pg,kg=fg;const Ng=t=>{var{className:o,defaultValue:i,value:a,min:s=0,max:l=100}=t,c=de(t,["className","defaultValue","value","min","max"]);const d=r.useMemo(()=>Array.isArray(a)?a:Array.isArray(i)?i:[s,l],[a,i,s,l]);return n(wg,Object.assign({"data-slot":"slider",defaultValue:i,value:a,min:s,max:l,className:Or("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",o)},c,{children:[e(yg,Object.assign({"data-slot":"slider-track",className:Or("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5")},{children:e(xg,{"data-slot":"slider-range",className:Or("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})})),Array.from({length:d.length},(t,n)=>e(kg,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},n))]}))},Og={contain:{label:"Contain",description:"Fit within bounds"},cover:{label:"Cover",description:"Fill and crop"},fill:{label:"Fill",description:"Stretch to fit"}},Cg=({fit:t,alt:r,borderRadius:o,onUpdate:i})=>{var a,s,l,c,d,p,h,f;const[g,m]=u(r),[b,v]=u(!1);return n(Hl,Object.assign({open:b,onOpenChange:v},{children:[e(Kp,{children:n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(Fl,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:b?"secondary":"ghost",size:"icon",className:"h-7 w-7"},{children:e(yn,{className:"h-4 w-4"})}))}))})),e(Zp,{children:"Settings"})]})}),e(Wl,Object.assign({className:"w-80 p-3",align:"start",contentEditable:!1,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},{children:n("div",Object.assign({className:"space-y-3"},{children:[n("div",{children:[e("h4",Object.assign({className:"font-semibold"},{children:"Image settings"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Customize how the image appears"}))]}),e(Dd,{}),n("div",Object.assign({className:"space-y-1"},{children:[e(yh,Object.assign({htmlFor:"alt-text",className:"text-sm font-medium"},{children:"Alt text"})),e(To,{id:"alt-text",value:g,onChange:e=>m(e.target.value),onBlur:()=>i({alt:g}),placeholder:"Describe this image...",className:"h-9"}),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Important for accessibility and SEO"}))]})),n("div",Object.assign({className:"space-y-1"},{children:[e(yh,Object.assign({htmlFor:"object-fit",className:"text-sm font-medium"},{children:"How image fits"})),n(Lf,Object.assign({value:t,onValueChange:e=>i({fit:e})},{children:[e(Wf,Object.assign({id:"object-fit",className:"h-9 w-full"},{children:e(Ff,Object.assign({placeholder:"Select how image fits"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(a=Og[t])||void 0===a?void 0:a.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(s=Og[t])||void 0===s?void 0:s.description}))]}))}))})),e(Vf,{children:n(Hf,{children:[e($f,Object.assign({value:"contain",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-4 w-3 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(l=Og.contain)||void 0===l?void 0:l.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(c=Og.contain)||void 0===c?void 0:c.description}))]}))]}))})),e($f,Object.assign({value:"cover",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-8 w-6 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(d=Og.cover)||void 0===d?void 0:d.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(p=Og.cover)||void 0===p?void 0:p.description}))]}))]}))})),e($f,Object.assign({value:"fill",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-8 w-8 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(h=Og.fill)||void 0===h?void 0:h.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(f=Og.fill)||void 0===f?void 0:f.description}))]}))]}))}))]})})]}))]})),n("div",Object.assign({className:"space-y-1"},{children:[n("div",Object.assign({className:"flex items-center justify-between"},{children:[e(yh,Object.assign({className:"text-sm font-medium"},{children:"Border radius"})),n("span",Object.assign({className:"text-sm text-muted-foreground"},{children:[o,"px"]}))]})),e(Ng,{value:[o],onValueChange:([e])=>i({borderRadius:e}),max:50,step:1,className:"w-full"})]}))]}))}))]}))},Sg=({referenceRef:t,elementProps:r,onUpdate:o,onReplace:i,onDelete:a,onDownload:s,onCopy:l})=>{var c,d;const[h,f]=u(!1),{refs:g,floatingStyles:m}=dp({placement:"top-end",strategy:"fixed",middleware:[Ba(8),$a({fallbackPlacements:["bottom","top"],padding:10}),Ua({padding:10})],whileElementsMounted:Ca});return p(()=>{requestAnimationFrame(()=>{f(!0)})},[]),p(()=>{const e=t.current;e&&g.setReference(e)},[t,g]),e("div",Object.assign({ref:g.setFloating,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),className:Or("pointer-events-auto","flex items-center gap-1 rounded-lg border bg-background/95 backdrop-blur-sm p-1 shadow-lg","transition-all duration-200 ease-out",h?"opacity-100 translate-y-0":"opacity-0 translate-y-2"),style:m},{children:n(Kp,Object.assign({delayDuration:0},{children:[n("div",Object.assign({className:"flex items-center gap-0.5 border-r pr-1"},{children:[n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"left"===r.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o({alignment:"left"})},{children:e(At,{className:"h-4 w-4"})}))})),e(Zp,{children:"Align left"})]}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"center"===r.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o({alignment:"center"})},{children:e(_t,{className:"h-4 w-4"})}))})),e(Zp,{children:"Align center"})]}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"right"===r.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o({alignment:"right"})},{children:e(Lt,{className:"h-4 w-4"})}))})),e(Zp,{children:"Align right"})]})]})),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i},{children:e(vn,{className:"h-4 w-4"})}))})),e(Zp,{children:"Replace"})]}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:s},{children:e(Jt,{className:"h-4 w-4"})}))})),e(Zp,{children:"Download"})]}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:l},{children:e(Zt,{className:"h-4 w-4"})}))})),e(Zp,{children:"Copy"})]}),e(Dd,{orientation:"vertical",className:"h-4"}),e(Cg,{fit:null!==(c=r.fit)&&void 0!==c?c:"contain",alt:r.alt||"",borderRadius:null!==(d=r.borderRadius)&&void 0!==d?d:0,onUpdate:o}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:a},{children:e(Nn,{className:"h-4 w-4"})}))})),e(Zp,{children:"Delete"})]})]}))}))},jg=({blockId:t,attributes:r,children:o,elementProps:i,onUpdate:a,onDelete:s,onReplace:l,pluginOptions:c})=>{var h;const[f,g]=u(i.sizes),{isElementSelected:m}=C(),b=S({blockId:t}),v=m&&b,w=d(null),y=x(),[k,N]=u(()=>{var e;const t=(null===(e=y.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,n=null==c?void 0:c.maxSizes;return{maxWidth:(null==n?void 0:n.maxWidth)?"number"==typeof n.maxWidth?n.maxWidth:parseInt(String(n.maxWidth).replace(/[^\d]/g,""),10):t,maxHeight:(null==n?void 0:n.maxHeight)?"number"==typeof n.maxHeight?n.maxHeight:parseInt(String(n.maxHeight).replace(/[^\d]/g,""),10):550}});p(()=>{const e=()=>{var e;const t=(null===(e=y.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,n=null==c?void 0:c.maxSizes;N({maxWidth:(null==n?void 0:n.maxWidth)?"number"==typeof n.maxWidth?n.maxWidth:parseInt(String(n.maxWidth).replace(/[^\d]/g,""),10):t,maxHeight:(null==n?void 0:n.maxHeight)?"number"==typeof n.maxHeight?n.maxHeight:parseInt(String(n.maxHeight).replace(/[^\d]/g,""),10):550})};e();const t=new ResizeObserver(e);return y.refElement&&t.observe(y.refElement),window.addEventListener("resize",e),()=>{t.disconnect(),window.removeEventListener("resize",e)}},[y,c]);const O=(e,t)=>{const n=e=>"number"==typeof e?e:parseInt(String(e).replace(/[^\d]/g,""),10),r=n(e.width),o=n(e.height),i=n(t.width),a=n(t.height);if(r<=i&&o<=a)return{width:r,height:o};const s=r/i,l=o/a,c=Math.max(s,l),d=Math.round(r/c),u=Math.round(o/c);return{width:Math.min(d,i),height:Math.min(u,a)}},j={left:"justify-start",center:"justify-center",right:"justify-end"}[null!==(h=i.alignment)&&void 0!==h?h:"center"];return n("div",Object.assign({},r,{className:Or("group/image mt-2 relative transition-all w-full flex",j)},{children:[n("div",Object.assign({className:"relative",contentEditable:!1},{children:[e(Qu,Object.assign({ref:e=>{(null==e?void 0:e.resizableElement)&&e.resizableElement instanceof HTMLElement&&(w.current=e.resizableElement)},style:{position:"relative",outline:v?".125rem solid rgba(0, 0, 0, 0)":"none",outlineColor:v?"hsl(var(--primary))":"none"},size:{width:f.width,height:f.height},onResize:(e,t,n)=>{const r=parseInt(n.style.width,10),o=parseInt(n.style.height,10),i=O({width:r,height:o},{width:k.maxWidth,height:k.maxHeight});g(i)},onResizeStop:(e,t,n)=>{const r=parseInt(n.style.width,10),o=parseInt(n.style.height,10),i=O({width:r,height:o},{width:k.maxWidth,height:k.maxHeight});a({sizes:i})},lockAspectRatio:!0,minWidth:100,minHeight:100,maxWidth:k.maxWidth,maxHeight:k.maxHeight,enableResizing:!!v&&{bottom:!1,bottomLeft:!1,bottomRight:!1,left:!0,right:!0,top:!1,topLeft:!1,topRight:!1},disableDragging:!0,resizeHandleStyles:{left:{width:"auto",height:"40px",left:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"},right:{width:"auto",height:"40px",right:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"}},resizeHandleComponent:{left:e("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"}),right:e("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"})},className:Or("rounded-sm")},{children:e("img",{src:i.src,alt:i.alt||"",className:"w-full h-full transition-all duration-200",style:{objectFit:i.fit,borderRadius:`${i.borderRadius}px`},draggable:!1})})),v&&e(Sg,{referenceRef:w,elementProps:i,onUpdate:a,onReplace:l,onDelete:s,onDownload:()=>ue(void 0,void 0,void 0,function*(){try{const e=yield fetch(i.src),t=yield e.blob(),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=`image-${Date.now()}.jpg`,r.click(),URL.revokeObjectURL(n)}catch(e){}}),onCopy:()=>ue(void 0,void 0,void 0,function*(){try{const e=yield fetch(i.src),t=yield e.blob();navigator.clipboard&&ClipboardItem?yield navigator.clipboard.write([new ClipboardItem({[t.type]:t})]):Po(i.src)}catch(e){Po(i.src)}})})]})),o]}))},Eg={image:{render:({element:t,attributes:n,children:r,blockId:o})=>{const i=x(),a=j("Image"),{upload:s,progress:l,loading:d}=$(a.upload),{deleteImage:u}=X(a.delete),{preview:p,generatePreview:h,clearPreview:f}=Y(),g=c(e=>{N.updateElement(i,{blockId:o,type:"image",props:Object.assign(Object.assign({},t.props),e)})},[i,o,t.props]),m=c(()=>ue(void 0,void 0,void 0,function*(){yield u(t);const e=k.getBlockSlate(i,{id:o});if(!e)return;const n=N.getElementPath(i,{blockId:o,element:t});if(!n)return;const r=n?R.parent(e,n):void 0;r&&P.isElement(r[0])&&!R.isEditor(r[0])?N.deleteElement(i,{blockId:o,type:"image",path:n}):k.deleteBlock(i,{blockId:o,focus:!0})}),[i,o,t,u]),b=c(()=>{N.updateElement(i,{blockId:o,type:"image",props:Object.assign(Object.assign({},t.props),{src:null,alt:null})})},[i,o,t.props]),v=c(e=>ue(void 0,void 0,void 0,function*(){var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!n)return;h(n);const r=yield s(n);g({id:r.id||r.fileId,src:r.url,alt:n.name,sizes:{width:r.width,height:r.height}}),f()}),[s,g,h,f]);return t.props.src?e(jg,Object.assign({blockId:o,elementId:t.id,onUpdate:g,onDelete:m,attributes:n,onReplace:b,elementProps:t.props,pluginOptions:a},{children:r})):e(ch,Object.assign({onUpload:v,preview:p,progress:l,loading:d,onInsertUrl:()=>{},onInsertFromUnsplash:()=>{},onInsertFromAI:()=>ue(void 0,void 0,void 0,function*(){}),attributes:n},{children:r}))}}},Rg=({textInputRef:t,urlInputRef:r,editedText:o,editedUrl:i,onChangeText:a,onChangeUrl:s,onKeyDown:l,saveEdit:c,cancelEdit:d,deleteLink:u})=>n("div",Object.assign({className:"p-2 space-y-2"},{children:[n("div",Object.assign({className:"space-y-1"},{children:[e(yh,Object.assign({htmlFor:"link-text",className:"text-xs"},{children:"Link text"})),e(To,{id:"link-text",ref:t,value:o,onChange:a,placeholder:"Link text...",className:"h-8 text-sm",onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()})]})),n("div",Object.assign({className:"space-y-1"},{children:[e(yh,Object.assign({htmlFor:"link-url",className:"text-xs"},{children:"URL"})),e(To,{id:"link-url",ref:r,value:i,onChange:s,onKeyDown:l,placeholder:"Enter URL...",className:"h-8 text-sm",onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()})]})),n("div",Object.assign({className:"flex justify-between items-center"},{children:[n("div",Object.assign({className:"flex items-center gap-2"},{children:[e(vo,Object.assign({size:"sm",variant:"default",className:"h-7 text-xs",onClick:c,disabled:0===i.length||0===o.length},{children:"Save"})),e(vo,Object.assign({size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:d},{children:"Cancel"}))]})),e(vo,Object.assign({size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:u},{children:e(Nn,{className:"h-3.5 w-3.5"})}))]}))]})),zg=({element:t,openLink:r,copyUrl:o,openEdit:i,copied:a})=>{var s;return e("div",Object.assign({className:"px-2 py-1"},{children:n("div",Object.assign({className:"flex items-center gap-1"},{children:[e("div",Object.assign({className:"flex-1 min-w-0"},{children:e("div",Object.assign({className:"text-sm truncate text-foreground"},{children:null!==(s=t.props.url)&&void 0!==s?s:"No URL"}))})),e("div",{className:"h-4 w-px bg-border"}),e(vo,Object.assign({size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:r,disabled:!t.props.url,title:"Open link"},{children:e(nn,{className:"h-3.5 w-3.5"})})),e(vo,Object.assign({size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:o,disabled:!t.props.url,title:a?"Copied!":"Copy URL"},{children:e(a?Ut:Zt,{className:"h-3.5 w-3.5"})})),e(vo,Object.assign({size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:i,title:"Edit URL"},{children:e(gn,{className:"h-3.5 w-3.5"})}))]}))}))};var Dg,Pg="HoverCard",[Mg,Tg]=pe(Pg,[ts]),Ig=ts(),[_g,Ag]=Mg(Pg),Lg=t=>{const{__scopeHoverCard:n,children:o,open:i,defaultOpen:a,onOpenChange:s,openDelay:l=700,closeDelay:c=300}=t,d=Ig(n),u=r.useRef(0),p=r.useRef(0),h=r.useRef(!1),f=r.useRef(!1),[g,m]=Ce({prop:i,defaultProp:a??!1,onChange:s,caller:Pg}),b=r.useCallback(()=>{clearTimeout(p.current),u.current=window.setTimeout(()=>m(!0),l)},[l,m]),v=r.useCallback(()=>{clearTimeout(u.current),h.current||f.current||(p.current=window.setTimeout(()=>m(!1),c))},[c,m]),w=r.useCallback(()=>m(!1),[m]);return r.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(p.current)},[]),e(_g,{scope:n,open:g,onOpenChange:m,onOpen:b,onClose:v,onDismiss:w,hasSelectionRef:h,isPointerDownOnContentRef:f,children:e(bs,{...d,children:o})})};Lg.displayName=Pg;var Hg="HoverCardTrigger",Fg=r.forwardRef((t,n)=>{const{__scopeHoverCard:r,...o}=t,i=Ag(Hg,r),a=Ig(r);return e(vs,{asChild:!0,...a,children:e(Se.a,{"data-state":i.open?"open":"closed",...o,ref:n,onPointerEnter:ke(t.onPointerEnter,Kg(i.onOpen)),onPointerLeave:ke(t.onPointerLeave,Kg(i.onClose)),onFocus:ke(t.onFocus,i.onOpen),onBlur:ke(t.onBlur,i.onClose),onTouchStart:ke(t.onTouchStart,e=>e.preventDefault())})})});Fg.displayName=Hg;var Wg="HoverCardPortal",[Bg,Ug]=Mg(Wg,{forceMount:void 0}),Vg=t=>{const{__scopeHoverCard:n,forceMount:r,children:o,container:i}=t,a=Ag(Wg,n);return e(Bg,{scope:n,forceMount:r,children:e(Ee,{present:r||a.open,children:e(xs,{asChild:!0,container:i,children:o})})})};Vg.displayName=Wg;var $g="HoverCardContent",Xg=r.forwardRef((t,n)=>{const r=Ug($g,t.__scopeHoverCard),{forceMount:o=r.forceMount,...i}=t,a=Ag($g,t.__scopeHoverCard);return e(Ee,{present:o||a.open,children:e(Yg,{"data-state":a.open?"open":"closed",...i,onPointerEnter:ke(t.onPointerEnter,Kg(a.onOpen)),onPointerLeave:ke(t.onPointerLeave,Kg(a.onClose)),ref:n})})});Xg.displayName=$g;var Yg=r.forwardRef((t,n)=>{const{__scopeHoverCard:o,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,...c}=t,d=Ag($g,o),u=Ig(o),p=r.useRef(null),h=me(n,p),[f,g]=r.useState(!1);return r.useEffect(()=>{if(f){const e=document.body;return Dg=e.style.userSelect||e.style.webkitUserSelect,e.style.userSelect="none",e.style.webkitUserSelect="none",()=>{e.style.userSelect=Dg,e.style.webkitUserSelect=Dg}}},[f]),r.useEffect(()=>{if(p.current){const e=()=>{g(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{""!==document.getSelection()?.toString()&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",e),()=>{document.removeEventListener("pointerup",e),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),r.useEffect(()=>{if(p.current){(function(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t})(p.current).forEach(e=>e.setAttribute("tabindex","-1"))}}),e(Wo,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:ke(s,e=>{e.preventDefault()}),onDismiss:d.onDismiss,children:e(ws,{...u,...c,onPointerDown:ke(c.onPointerDown,e=>{e.currentTarget.contains(e.target)&&g(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...c.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})});function Kg(e){return t=>"touch"===t.pointerType?void 0:e()}r.forwardRef((t,n)=>{const{__scopeHoverCard:r,...o}=t,i=Ig(r);return e(ys,{...i,...o,ref:n})}).displayName="HoverCardArrow";var qg=Lg,Gg=Fg,Zg=Vg,Jg=Xg;const Qg=t=>{var n=de(t,[]);return e(qg,Object.assign({"data-slot":"hover-card"},n))},em=t=>{var n=de(t,[]);return e(Gg,Object.assign({"data-slot":"hover-card-trigger"},n))},tm=t=>{var{className:n,align:r="center",sideOffset:o=4}=t,i=de(t,["className","align","sideOffset"]);return e(Zg,Object.assign({"data-slot":"hover-card-portal"},{children:e(Jg,Object.assign({"data-slot":"hover-card-content",align:r,sideOffset:o,className:Or("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n)},i))}))},nm=e=>{var t;if(M.isText(e))return e.text;if("object"==typeof e&&null!==e&&"children"in e){const n=e.children;return null!==(t=null==n?void 0:n.map(nm).join(""))&&void 0!==t?t:""}return""},rm={link:{render:t=>{var r;const{attributes:o,children:i,element:a,blockId:s}=t,l=x(),c=nm(a),[h,f]=u(!1),[g,m]=u(null!==(r=a.props.url)&&void 0!==r?r:""),[b,v]=u(c),[w,y]=u(!1),k=d(null),O=d(null);p(()=>{var e;m(null!==(e=a.props.url)&&void 0!==e?e:""),v(c)},[a.props.url,c]),p(()=>{h&&k.current&&(k.current.focus(),k.current.select())},[h]);return n(Qg,Object.assign({openDelay:100,closeDelay:100},{children:[e(em,Object.assign({asChild:!0},{children:e("a",Object.assign({},o,{href:a.props.url||void 0,target:a.props.target,rel:a.props.rel,title:a.props.title||void 0,className:"text-primary font-medium underline underline-offset-4 cursor-pointer hover:text-primary/80 transition-colors",contentEditable:!1,onClick:e=>{h&&e.preventDefault()}},{children:i}))})),e(tm,Object.assign({className:"w-80 p-0",onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},{children:h?e(Rg,{textInputRef:O,urlInputRef:k,editedText:b,editedUrl:g,onChangeText:e=>v(e.target.value),onChangeUrl:e=>m(e.target.value),onKeyDown:e=>{var t;"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),N.updateElement(l,{blockId:s,type:"link",text:b,props:{url:g}}),f(!1)):"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),m(null!==(t=a.props.url)&&void 0!==t?t:""),v(c),f(!1))},saveEdit:e=>{e.preventDefault(),e.stopPropagation();const t=N.getElementPath(l,{blockId:s,element:a});t&&(N.updateElement(l,{blockId:s,type:"link",text:b,path:t,props:{url:g}}),f(!1))},cancelEdit:e=>{var t;e.preventDefault(),e.stopPropagation(),m(null!==(t=a.props.url)&&void 0!==t?t:""),v(c),f(!1)},deleteLink:e=>{e.preventDefault(),e.stopPropagation();const t=N.getElementPath(l,{blockId:s,element:a});t&&(N.deleteElement(l,{mode:"unwrap",type:"link",path:t,blockId:s}),f(!1))}}):e(zg,{element:a,openLink:e=>{var t;e.preventDefault(),e.stopPropagation(),a.props.url&&window.open(a.props.url,null!==(t=a.props.target)&&void 0!==t?t:"_blank",a.props.rel)},copyUrl:e=>{if(e.preventDefault(),e.stopPropagation(),a.props.url){Po(a.props.url)&&(y(!0),setTimeout(()=>y(!1),1500))}},openEdit:e=>{0!==g.length&&(e.preventDefault(),e.stopPropagation(),f(!0))},copied:w})}))]}))}}},om={"numbered-list":{render:t=>{const{attributes:r,children:o,blockId:i}=t,a=E(i),s=K(a);return n("div",Object.assign({},r,{className:"my-0 ml-6 list-decimal [&>li]:mt-2"},{children:[n("span",Object.assign({contentEditable:!1},{children:[s,"."]})),e("span",Object.assign({},r,{className:"pl-2"},{children:o}))]}))}}},im={BulletedList:{"bulleted-list":{render:t=>{const{attributes:n,children:r}=t;return e("ul",Object.assign({},n,{className:"my-0 ml-6 list-disc [&>li]:mt-2"},{children:e("li",Object.assign({},n,{className:"pl-2"},{children:r}))}))}}},NumberedList:om,TodoList:{"todo-list":{render:t=>{const{attributes:r,children:o,element:i,blockId:a}=t,s=i.props.checked,l=x();return e("div",Object.assign({},r,{className:"m-0 mt-2 ml-6 list-none"},{children:n("div",Object.assign({className:"flex items-start gap-2 pl-2"},{children:[e("button",Object.assign({type:"button",contentEditable:!1,onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),N.updateElement(l,{blockId:a,type:"todo-list",props:{checked:!s}})},className:Or("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-sm border-2 transition-colors",s?"bg-primary border-primary text-primary-foreground":"border-input bg-background"),"aria-label":s?"Mark as unchecked":"Mark as checked"},{children:s&&e(Ut,{className:"h-3 w-3"})})),e("span",Object.assign({className:Or("flex-1",s&&"text-muted-foreground line-through")},{children:o}))]}))}))}}}},am={paragraph:{render:t=>{const{attributes:n,children:r}=t;return e("p",Object.assign({},n,{className:"leading-7 [&:not(:first-child)]:mt-6"},{children:r}))}}};var sm=["Enter"," "],lm=["ArrowUp","PageDown","End"],cm=["ArrowDown","PageUp","Home",...lm],dm={ltr:[...sm,"ArrowRight"],rtl:[...sm,"ArrowLeft"]},um={ltr:["ArrowLeft"],rtl:["ArrowRight"]},pm="Menu",[hm,fm,gm]=xe(pm),[mm,bm]=pe(pm,[gm,ts,Ql]),vm=ts(),wm=Ql(),[ym,xm]=mm(pm),[km,Nm]=mm(pm),Om=t=>{const{__scopeMenu:n,open:o=!1,children:i,dir:a,onOpenChange:s,modal:l=!0}=t,c=vm(n),[d,u]=r.useState(null),p=r.useRef(!1),h=Io(s),f=qe(a);return r.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),e(bs,{...c,children:e(ym,{scope:n,open:o,onOpenChange:h,content:d,onContentChange:u,children:e(km,{scope:n,onClose:r.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:f,modal:l,children:i})})})};Om.displayName=pm;var Cm=r.forwardRef((t,n)=>{const{__scopeMenu:r,...o}=t,i=vm(r);return e(vs,{...i,...o,ref:n})});Cm.displayName="MenuAnchor";var Sm="MenuPortal",[jm,Em]=mm(Sm,{forceMount:void 0}),Rm=t=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=t,a=xm(Sm,n);return e(jm,{scope:n,forceMount:r,children:e(Ee,{present:r||a.open,children:e(xs,{asChild:!0,container:i,children:o})})})};Rm.displayName=Sm;var zm="MenuContent",[Dm,Pm]=mm(zm),Mm=r.forwardRef((t,n)=>{const r=Em(zm,t.__scopeMenu),{forceMount:o=r.forceMount,...i}=t,a=xm(zm,t.__scopeMenu),s=Nm(zm,t.__scopeMenu);return e(hm.Provider,{scope:t.__scopeMenu,children:e(Ee,{present:o||a.open,children:e(hm.Slot,{scope:t.__scopeMenu,children:s.modal?e(Tm,{...i,ref:n}):e(Im,{...i,ref:n})})})})}),Tm=r.forwardRef((t,n)=>{const o=xm(zm,t.__scopeMenu),i=r.useRef(null),a=me(n,i);return r.useEffect(()=>{const e=i.current;if(e)return Es(e)},[]),e(Am,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:ke(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),Im=r.forwardRef((t,n)=>{const r=xm(zm,t.__scopeMenu);return e(Am,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),_m=be("MenuContent.ScrollLock"),Am=r.forwardRef((t,n)=>{const{__scopeMenu:o,loop:i=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:g,disableOutsideScroll:m,...b}=t,v=xm(zm,o),w=Nm(zm,o),y=vm(o),x=wm(o),k=fm(o),[N,O]=r.useState(null),C=r.useRef(null),S=me(n,C,v.onContentChange),j=r.useRef(0),E=r.useRef(""),R=r.useRef(0),z=r.useRef(null),D=r.useRef("right"),P=r.useRef(0),M=m?fl:r.Fragment,T=m?{as:_m,allowPinchZoom:!0}:void 0,I=e=>{const t=E.current+e,n=k().filter(e=>!e.disabled),r=document.activeElement,o=n.find(e=>e.ref.current===r)?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,l=Math.max(i,0),s.map((e,t)=>s[(l+t)%s.length]));var s,l;1===o.length&&(a=a.filter(e=>e!==n));const c=a.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}(n.map(e=>e.textValue),t,o),a=n.find(e=>e.textValue===i)?.ref.current;!function e(t){E.current=t,window.clearTimeout(j.current),""!==t&&(j.current=window.setTimeout(()=>e(""),1e3))}(t),a&&setTimeout(()=>a.focus())};r.useEffect(()=>()=>window.clearTimeout(j.current),[]),$o();const _=r.useCallback(e=>D.current===z.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e],s=t[i],l=a.x,c=a.y,d=s.x,u=s.y;c>r!=u>r&&n<(d-l)*(r-c)/(u-c)+l&&(o=!o)}return o}(n,t)}(e,z.current?.area),[]);return e(Dm,{scope:o,searchRef:E,onItemEnter:r.useCallback(e=>{_(e)&&e.preventDefault()},[_]),onItemLeave:r.useCallback(e=>{_(e)||(C.current?.focus(),O(null))},[_]),onTriggerLeave:r.useCallback(e=>{_(e)&&e.preventDefault()},[_]),pointerGraceTimerRef:R,onPointerGraceIntentChange:r.useCallback(e=>{z.current=e},[]),children:e(M,{...T,children:e(Go,{asChild:!0,trapped:a,onMountAutoFocus:ke(s,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:e(Wo,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:g,children:e(lc,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:i,currentTabStopId:N,onCurrentTabStopIdChange:O,onEntryFocus:ke(d,e=>{w.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:e(ws,{role:"menu","aria-orientation":"vertical","data-state":ub(v.open),"data-radix-menu-content":"",dir:w.dir,...y,...b,ref:S,style:{outline:"none",...b.style},onKeyDown:ke(b.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&I(e.key));const o=C.current;if(e.target!==o)return;if(!cm.includes(e.key))return;e.preventDefault();const i=k().filter(e=>!e.disabled).map(e=>e.ref.current);lm.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)}),onBlur:ke(t.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),E.current="")}),onPointerMove:ke(t.onPointerMove,fb(e=>{const t=e.target,n=P.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>P.current?"right":"left";D.current=t,P.current=e.clientX}}))})})})})})})});Mm.displayName=zm;var Lm=r.forwardRef((t,n)=>{const{__scopeMenu:r,...o}=t;return e(Se.div,{role:"group",...o,ref:n})});Lm.displayName="MenuGroup";var Hm=r.forwardRef((t,n)=>{const{__scopeMenu:r,...o}=t;return e(Se.div,{...o,ref:n})});Hm.displayName="MenuLabel";var Fm="MenuItem",Wm="menu.itemSelect",Bm=r.forwardRef((t,n)=>{const{disabled:o=!1,onSelect:i,...a}=t,s=r.useRef(null),l=Nm(Fm,t.__scopeMenu),c=Pm(Fm,t.__scopeMenu),d=me(n,s),u=r.useRef(!1);return e(Um,{...a,ref:d,disabled:o,onClick:ke(t.onClick,()=>{const e=s.current;if(!o&&e){const t=new CustomEvent(Wm,{bubbles:!0,cancelable:!0});e.addEventListener(Wm,e=>i?.(e),{once:!0}),je(e,t),t.defaultPrevented?u.current=!1:l.onClose()}}),onPointerDown:e=>{t.onPointerDown?.(e),u.current=!0},onPointerUp:ke(t.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:ke(t.onKeyDown,e=>{const t=""!==c.searchRef.current;o||t&&" "===e.key||sm.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Bm.displayName=Fm;var Um=r.forwardRef((t,n)=>{const{__scopeMenu:o,disabled:i=!1,textValue:a,...s}=t,l=Pm(Fm,o),c=wm(o),d=r.useRef(null),u=me(n,d),[p,h]=r.useState(!1),[f,g]=r.useState("");return r.useEffect(()=>{const e=d.current;e&&g((e.textContent??"").trim())},[s.children]),e(hm.ItemSlot,{scope:o,disabled:i,textValue:a??f,children:e(cc,{asChild:!0,...c,focusable:!i,children:e(Se.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...s,ref:u,onPointerMove:ke(t.onPointerMove,fb(e=>{if(i)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:ke(t.onPointerLeave,fb(e=>l.onItemLeave(e))),onFocus:ke(t.onFocus,()=>h(!0)),onBlur:ke(t.onBlur,()=>h(!1))})})})}),Vm=r.forwardRef((t,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=t;return e(Jm,{scope:t.__scopeMenu,checked:r,children:e(Bm,{role:"menuitemcheckbox","aria-checked":pb(r)?"mixed":r,...i,ref:n,"data-state":hb(r),onSelect:ke(i.onSelect,()=>o?.(!!pb(r)||!r),{checkForDefaultPrevented:!1})})})});Vm.displayName="MenuCheckboxItem";var $m="MenuRadioGroup",[Xm,Ym]=mm($m,{value:void 0,onValueChange:()=>{}}),Km=r.forwardRef((t,n)=>{const{value:r,onValueChange:o,...i}=t,a=Io(o);return e(Xm,{scope:t.__scopeMenu,value:r,onValueChange:a,children:e(Lm,{...i,ref:n})})});Km.displayName=$m;var qm="MenuRadioItem",Gm=r.forwardRef((t,n)=>{const{value:r,...o}=t,i=Ym(qm,t.__scopeMenu),a=r===i.value;return e(Jm,{scope:t.__scopeMenu,checked:a,children:e(Bm,{role:"menuitemradio","aria-checked":a,...o,ref:n,"data-state":hb(a),onSelect:ke(o.onSelect,()=>i.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});Gm.displayName=qm;var Zm="MenuItemIndicator",[Jm,Qm]=mm(Zm,{checked:!1}),eb=r.forwardRef((t,n)=>{const{__scopeMenu:r,forceMount:o,...i}=t,a=Qm(Zm,r);return e(Ee,{present:o||pb(a.checked)||!0===a.checked,children:e(Se.span,{...i,ref:n,"data-state":hb(a.checked)})})});eb.displayName=Zm;var tb=r.forwardRef((t,n)=>{const{__scopeMenu:r,...o}=t;return e(Se.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});tb.displayName="MenuSeparator";var nb=r.forwardRef((t,n)=>{const{__scopeMenu:r,...o}=t,i=vm(r);return e(ys,{...i,...o,ref:n})});nb.displayName="MenuArrow";var rb="MenuSub",[ob,ib]=mm(rb),ab=t=>{const{__scopeMenu:n,children:o,open:i=!1,onOpenChange:a}=t,s=xm(rb,n),l=vm(n),[c,d]=r.useState(null),[u,p]=r.useState(null),h=Io(a);return r.useEffect(()=>(!1===s.open&&h(!1),()=>h(!1)),[s.open,h]),e(bs,{...l,children:e(ym,{scope:n,open:i,onOpenChange:h,content:u,onContentChange:p,children:e(ob,{scope:n,contentId:Pe(),triggerId:Pe(),trigger:c,onTriggerChange:d,children:o})})})};ab.displayName=rb;var sb="MenuSubTrigger",lb=r.forwardRef((t,n)=>{const o=xm(sb,t.__scopeMenu),i=Nm(sb,t.__scopeMenu),a=ib(sb,t.__scopeMenu),s=Pm(sb,t.__scopeMenu),l=r.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,u={__scopeMenu:t.__scopeMenu},p=r.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return r.useEffect(()=>p,[p]),r.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),d(null)}},[c,d]),e(Cm,{asChild:!0,...u,children:e(Um,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":a.contentId,"data-state":ub(o.open),...t,ref:ge(n,a.onTriggerChange),onClick:e=>{t.onClick?.(e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:ke(t.onPointerMove,fb(e=>{s.onItemEnter(e),e.defaultPrevented||t.disabled||o.open||l.current||(s.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{o.onOpenChange(!0),p()},100))})),onPointerLeave:ke(t.onPointerLeave,fb(e=>{p();const t=o.content?.getBoundingClientRect();if(t){const n=o.content?.dataset.side,r="right"===n,i=r?-5:5,a=t[r?"left":"right"],l=t[r?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+i,y:e.clientY},{x:a,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:a,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ke(t.onKeyDown,e=>{const n=""!==s.searchRef.current;t.disabled||n&&" "===e.key||dm[i.dir].includes(e.key)&&(o.onOpenChange(!0),o.content?.focus(),e.preventDefault())})})})});lb.displayName=sb;var cb="MenuSubContent",db=r.forwardRef((t,n)=>{const o=Em(zm,t.__scopeMenu),{forceMount:i=o.forceMount,...a}=t,s=xm(zm,t.__scopeMenu),l=Nm(zm,t.__scopeMenu),c=ib(cb,t.__scopeMenu),d=r.useRef(null),u=me(n,d);return e(hm.Provider,{scope:t.__scopeMenu,children:e(Ee,{present:i||s.open,children:e(hm.Slot,{scope:t.__scopeMenu,children:e(Am,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:ke(t.onFocusOutside,e=>{e.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ke(t.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:ke(t.onKeyDown,e=>{const t=e.currentTarget.contains(e.target),n=um[l.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});function ub(e){return e?"open":"closed"}function pb(e){return"indeterminate"===e}function hb(e){return pb(e)?"indeterminate":e?"checked":"unchecked"}function fb(e){return t=>"mouse"===t.pointerType?e(t):void 0}db.displayName=cb;var gb=Om,mb=Cm,bb=Rm,vb=Mm,wb=Lm,yb=Hm,xb=Bm,kb=Vm,Nb=Km,Ob=Gm,Cb=eb,Sb=tb,jb=nb,Eb=ab,Rb=lb,zb=db,Db="DropdownMenu",[Pb,Mb]=pe(Db,[bm]),Tb=bm(),[Ib,_b]=Pb(Db),Ab=t=>{const{__scopeDropdownMenu:n,children:o,dir:i,open:a,defaultOpen:s,onOpenChange:l,modal:c=!0}=t,d=Tb(n),u=r.useRef(null),[p,h]=Ce({prop:a,defaultProp:s??!1,onChange:l,caller:Db});return e(Ib,{scope:n,triggerId:Pe(),triggerRef:u,contentId:Pe(),open:p,onOpenChange:h,onOpenToggle:r.useCallback(()=>h(e=>!e),[h]),modal:c,children:e(gb,{...d,open:p,onOpenChange:h,dir:i,modal:c,children:o})})};Ab.displayName=Db;var Lb="DropdownMenuTrigger",Hb=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=t,a=_b(Lb,r),s=Tb(r);return e(mb,{asChild:!0,...s,children:e(Se.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:ge(n,a.triggerRef),onPointerDown:ke(t.onPointerDown,e=>{o||0!==e.button||!1!==e.ctrlKey||(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:ke(t.onKeyDown,e=>{o||(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});Hb.displayName=Lb;var Fb=t=>{const{__scopeDropdownMenu:n,...r}=t,o=Tb(n);return e(bb,{...o,...r})};Fb.displayName="DropdownMenuPortal";var Wb="DropdownMenuContent",Bb=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:o,...i}=t,a=_b(Wb,o),s=Tb(o),l=r.useRef(!1);return e(vb,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...i,ref:n,onCloseAutoFocus:ke(t.onCloseAutoFocus,e=>{l.current||a.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:ke(t.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;a.modal&&!r||(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Bb.displayName=Wb;r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Tb(r);return e(wb,{...i,...o,ref:n})}).displayName="DropdownMenuGroup";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Tb(r);return e(yb,{...i,...o,ref:n})}).displayName="DropdownMenuLabel";var Ub=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Tb(r);return e(xb,{...i,...o,ref:n})});Ub.displayName="DropdownMenuItem";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Tb(r);return e(kb,{...i,...o,ref:n})}).displayName="DropdownMenuCheckboxItem";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Tb(r);return e(Nb,{...i,...o,ref:n})}).displayName="DropdownMenuRadioGroup";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Tb(r);return e(Ob,{...i,...o,ref:n})}).displayName="DropdownMenuRadioItem";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Tb(r);return e(Cb,{...i,...o,ref:n})}).displayName="DropdownMenuItemIndicator";var Vb=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Tb(r);return e(Sb,{...i,...o,ref:n})});Vb.displayName="DropdownMenuSeparator";r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Tb(r);return e(jb,{...i,...o,ref:n})}).displayName="DropdownMenuArrow";var $b=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Tb(r);return e(Rb,{...i,...o,ref:n})});$b.displayName="DropdownMenuSubTrigger";var Xb=r.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Tb(r);return e(zb,{...i,...o,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Xb.displayName="DropdownMenuSubContent";var Yb=Ab,Kb=Hb,qb=Fb,Gb=Bb,Zb=Ub,Jb=Vb,Qb=t=>{const{__scopeDropdownMenu:n,children:r,open:o,onOpenChange:i,defaultOpen:a}=t,s=Tb(n),[l,c]=Ce({prop:o,defaultProp:a??!1,onChange:i,caller:"DropdownMenuSub"});return e(Eb,{...s,open:l,onOpenChange:c,children:r})},ev=$b,tv=Xb;const nv=t=>{var n=de(t,[]);return e(Yb,Object.assign({"data-slot":"dropdown-menu"},n))},rv=t=>{var n=de(t,[]);return e(Kb,Object.assign({"data-slot":"dropdown-menu-trigger"},n))},ov=t=>{var{className:n,sideOffset:r=4}=t,o=de(t,["className","sideOffset"]);return e(qb,{children:e(Gb,Object.assign({"data-slot":"dropdown-menu-content",sideOffset:r,className:Or("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n)},o))})},iv=t=>{var{className:n,inset:r,variant:o="default"}=t,i=de(t,["className","inset","variant"]);return e(Zb,Object.assign({"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":o,className:Or("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n)},i))},av=t=>{var{className:n}=t,r=de(t,["className"]);return e(Jb,Object.assign({"data-slot":"dropdown-menu-separator",className:Or("bg-border -mx-1 my-1 h-px",n)},r))},sv=t=>{var n=de(t,[]);return e(Qb,Object.assign({"data-slot":"dropdown-menu-sub"},n))},lv=t=>{var{className:r,inset:o,children:i}=t,a=de(t,["className","inset","children"]);return n(ev,Object.assign({"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:Or("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r)},a,{children:[i,e($t,{className:"ml-auto size-4"})]}))},cv=t=>{var{className:n}=t,r=de(t,["className"]);return e(tv,Object.assign({"data-slot":"dropdown-menu-sub-content",className:Or("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",n)},r))},dv={"step-container":{render:t=>{const r=x(),{attributes:o,children:i}=t;return n("div",Object.assign({},o,{role:"list",className:"ml-3.5 my-4 relative group/steps-node"},{children:[i,e("div",Object.assign({contentEditable:!1,className:Or("-ml-3.5 z-20 absolute left-0 flex","transition-opacity duration-300","opacity-0 group-hover/steps-node:opacity-100"),style:{bottom:"-4px"}},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:Or("w-7 h-7 shrink-0 rounded-lg","bg-muted hover:bg-muted/80","text-sm font-semibold"),onClick:()=>{k.getBlockSlate(r,{id:t.blockId})&&q.addStep(r,{blockId:t.blockId})},"aria-label":"Add more Step"},{children:e(bn,{className:"w-4 h-4"})}))}))]}))}},"step-list":{render:t=>{const{attributes:n,children:r}=t;return e("div",Object.assign({},n,{className:"[&>div]:contents contents"},{children:r}))}},"step-list-item":{render:t=>{const{attributes:r,children:o,element:i}=t,a=x(),s=l(()=>{const e=N.getElementPath(a,{blockId:t.blockId,element:i}),n=null==e?void 0:e[e.length-1];return n||0},[a,i,t.blockId]),c=s+1,d=s===i.children.length-1,u=0===i.children.length;return e("div",Object.assign({className:"prose dark:prose-invert"},{children:n("div",Object.assign({className:"relative group/component-wrapper group/step"},{children:[n("div",Object.assign({},r,{role:"listitem",className:"step group/step relative flex items-start pb-5"},{children:[e("div",{"data-component-part":"step-line",contentEditable:!1,className:Or("absolute w-px h-[calc(100%-2.75rem)] top-[2.75rem]",d?"bg-transparent bg-gradient-to-b from-border via-80% to-transparent":"bg-border/70",d&&u&&"hidden")}),e("div",Object.assign({"data-component-part":"step-number",contentEditable:!1,className:"absolute ml-[-13px] py-2 pointer-events-none select-none"},{children:e("div",Object.assign({className:Or("size-7 shrink-0 rounded-full","bg-muted","text-xs font-semibold","flex items-center justify-center","text-foreground")},{children:c}))})),e("div",Object.assign({className:"w-full overflow-hidden pl-8 pr-px"},{children:o}))]})),e("div",Object.assign({contentEditable:!1,className:Or("z-20 absolute top-0 right-3 flex","transition-opacity duration-300","opacity-0 hover:opacity-100 group-hover/step:opacity-100")},{children:n(nv,{children:[e(rv,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:Or("size-8 shrink-0 rounded-lg","border border-transparent","hover:bg-muted"),"aria-label":"Edit Step attributes"},{children:e(Qt,{className:"h-4 w-4"})}))})),n(ov,Object.assign({align:"end"},{children:[n(iv,Object.assign({onClick:()=>{q.moveUp(a,{blockId:t.blockId,stepId:i.id})},className:"cursor-pointer"},{children:[e(Bt,{className:"h-4 w-4"})," Move up"]})),n(iv,Object.assign({onClick:()=>{q.moveDown(a,{blockId:t.blockId,stepId:i.id})},className:"cursor-pointer"},{children:[e(Ht,{className:"h-4 w-4"})," Move down"]})),e(av,{}),n(iv,Object.assign({onClick:()=>{q.deleteStep(a,{blockId:t.blockId,stepId:i.id})},className:"text-destructive focus:text-destructive cursor-pointer"},{children:[e(Nn,{className:"h-4 w-4"})," Delete step"]}))]}))]})}))]}))}))}},"step-list-item-heading":{render:t=>{const{attributes:n,children:r}=t;return e("p",Object.assign({},n,{"data-component-part":"step-title",className:"mt-2 font-semibold prose dark:prose-invert text-foreground"},{children:r}))}},"step-list-item-content":{render:t=>{const{attributes:n,children:r}=t;return e("div",Object.assign({},n,{"data-component-part":"step-content",className:"my-2 prose dark:prose-invert"},{children:r}))}}},uv=i((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("div",Object.assign({"data-slot":"table-container",className:"relative w-full overflow-x-auto rounded-md"},{children:e("table",Object.assign({ref:n,"data-slot":"table",className:Or("caption-bottom text-sm table-fixed border-collapse",r)},o))}))});uv.displayName="Table";i((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("thead",Object.assign({ref:n,"data-slot":"table-header",className:Or("[&_tr]:border-b",r)},o))}).displayName="TableHeader";const pv=i((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("tbody",Object.assign({ref:n,"data-slot":"table-body",className:Or("[&_tr:first-child]:border-t [&_tr]:border-b [&_tr]:border-border",r)},o))});pv.displayName="TableBody";i((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("tfoot",Object.assign({ref:n,"data-slot":"table-footer",className:Or("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",r)},o))}).displayName="TableFooter";const hv=i((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("tr",Object.assign({ref:n,"data-slot":"table-row",className:Or("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",r)},o))});hv.displayName="TableRow";const fv=i((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("th",Object.assign({ref:n,"data-slot":"table-head",className:Or("border-border border-r last:border-r-0 text-foreground h-10 px-2 text-left font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] bg-muted/50",r)},o))});fv.displayName="TableHead";const gv=i((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("td",Object.assign({ref:n,"data-slot":"table-cell",className:Or("border-border border-r last:border-r-0 p-2 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",r)},o))});gv.displayName="TableCell";i((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e("caption",Object.assign({ref:n,"data-slot":"table-caption",className:Or("text-muted-foreground mt-4 text-sm",r)},o))}).displayName="TableCaption";const mv=({blockId:t})=>{const n=x(),[r,o]=u(null),[i,a]=u(!1),[s,l]=u(null),[h,f]=u([]),g=d(0),m=d(0),b=d([]),v=d(null),w=d(null),y=d(null);p(()=>{b.current=h},[h]),p(()=>{w.current=r},[r]),p(()=>{v.current=s},[s]);const k=c(()=>{const e=document.querySelector(`[data-yoopta-block-id="${t}"][data-table-container]`);if(!e)return;const n=e.querySelector("table");if(!n)return;const r=n.getBoundingClientRect();o(r);const i=n.querySelector("colgroup");y.current=i;const a=n.querySelectorAll("colgroup col"),s=n.querySelector("tr");if(a.length>0){const e=[];r.left,a.forEach((t,n)=>{const r=window.getComputedStyle(t),o=parseInt(r.width,10)||200;e.push(o)}),f(e)}else if(s){const e=s.querySelectorAll("td, th"),t=[],n=[];e.forEach((e,r)=>{const o=e.getBoundingClientRect();n.push(o.width),t.push({index:r,left:o.left,width:o.width})}),f(n)}},[t]);p(()=>{k();const e=document.querySelector(`[data-yoopta-block-id="${t}"][data-table-container]`);if(!e)return;const n=e.querySelector("table");if(!n)return;const r=new ResizeObserver(()=>{i||k()});r.observe(n);const o=new MutationObserver(()=>{i||k()});o.observe(n,{childList:!0,subtree:!0});const a=()=>{i||k()};return window.addEventListener("scroll",a,!0),()=>{r.disconnect(),o.disconnect(),window.removeEventListener("scroll",a,!0)}},[t,k,i]);const N=c(e=>{if(!y.current)return;y.current.querySelectorAll("col").forEach((t,n)=>{void 0!==e[n]&&(t.style.width=`${e[n]}px`)})},[]),O=c((e,t)=>{if(!t||0===e.length)return[];let n=t.left;return e.map((e,t)=>{const r={index:t,left:n,width:e};return n+=e,r})},[]),C=c((e,t)=>{e.preventDefault(),e.stopPropagation();const n=h[t];void 0!==n&&(a(!0),l(t),g.current=e.clientX,m.current=n,document.body.classList.add("resizing-column"))},[h]),S=c(e=>{const t=v.current;if(null===t)return;const n=e.clientX-g.current,r=Math.max(50,m.current+n),o=[...b.current];o[t]=r,f(o),N(o)},[N]),j=c(()=>{const e=v.current,r=b.current;null!==e&&void 0!==r[e]&&G.setColumnWidth(n,t,e,r[e]),a(!1),l(null),document.body.classList.remove("resizing-column"),setTimeout(k,50)},[n,t,k]);if(p(()=>{if(i)return document.addEventListener("mousemove",S),document.addEventListener("mouseup",j),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",j)}},[i,S,j]),!r||0===h.length)return null;const E=O(h,r).slice(0,-1).map(t=>{const n=t.left+t.width-3;return e("div",{className:"column-resize-handle",style:{position:"fixed",left:`${n}px`,top:`${r.top}px`,width:"6px",height:`${r.height}px`,cursor:"col-resize",zIndex:50,backgroundColor:i&&s===t.index?"hsl(var(--primary))":"transparent"},onMouseDown:e=>C(e,t.index),onMouseEnter:e=>{i||(e.target.style.backgroundColor="hsl(var(--primary) / 0.3)")},onMouseLeave:e=>{i||(e.target.style.backgroundColor="transparent")}},`resize-${t.index}`)});return e(Q,Object.assign({id:"column-resize-handles-container"},{children:e("div",Object.assign({className:"column-resize-handles-container",style:{pointerEvents:i?"auto":void 0}},{children:E}))}))},bv=({blockId:t,totalColumns:n,position:r,onMouseEnter:o,onMouseLeave:i})=>{const a=x(),s=c(()=>{const e=[0,0,n-1,0];G.insertTableColumn(a,t,{path:e,insertMode:"after"})},[a,t,n]);return e(Q,Object.assign({id:`table-add-column-button-${t}`},{children:e("div",Object.assign({className:"fixed z-[9999] pointer-events-auto",style:{left:`${r.left+4}px`,top:`${r.top}px`,width:"18px",height:`${r.height}px`},onMouseEnter:o,onMouseLeave:i},{children:e(vo,Object.assign({variant:"ghost",size:"sm",className:"p-0 h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md transition-all hover:shadow-md flex items-center justify-center text-muted-foreground hover:text-foreground",onClick:s,onMouseDown:e=>e.preventDefault()},{children:e(bn,{className:"h-3 w-3"})}))}))}))},vv=({blockId:t,totalRows:n,position:r,onMouseEnter:o,onMouseLeave:i})=>{const a=x(),s=c(()=>{const e=[0,n-1,0,0];G.insertTableRow(a,t,{path:e,insertMode:"after"})},[a,t,n]);return e(Q,Object.assign({id:`table-add-row-button-${t}`},{children:e("div",Object.assign({className:"fixed z-[9999] pointer-events-auto",style:{left:`${r.left}px`,top:`${r.top+4}px`,width:`${r.width}px`,height:"18px"},onMouseEnter:o,onMouseLeave:i},{children:e(vo,Object.assign({variant:"ghost",size:"sm",className:"h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md transition-all hover:shadow-md flex items-center justify-center gap-1.5 text-muted-foreground hover:text-foreground",onClick:s,onMouseDown:e=>e.preventDefault()},{children:e(bn,{className:"h-3 w-3"})}))}))}))},wv=({blockId:r,colIndex:o,position:i,onMouseEnter:a,onMouseLeave:s})=>{const d=x(),u=l(()=>[0,0,o,0],[o]),p=c(()=>{G.insertTableColumn(d,r,{path:u,insertMode:"before"})},[d,r,u]),h=c(()=>{G.insertTableColumn(d,r,{path:u,insertMode:"after"})},[d,r,u]),f=c(()=>{G.deleteTableColumn(d,r,{path:u})},[d,r,u]),g=c(()=>{G.toggleHeaderColumn(d,r)},[d,r]);return e(Q,Object.assign({id:`table-column-controls-${r}-${o}`},{children:e("div",Object.assign({className:"fixed z-[9999] pointer-events-auto",style:{left:`${i.left}px`,top:`${i.top+4}px`,width:`${i.width}px`,height:"18px"},onMouseEnter:a,onMouseLeave:s},{children:n(nv,{children:[e(rv,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"sm",className:"h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md p-0 transition-all hover:shadow-md",onMouseDown:e=>e.preventDefault()},{children:e(en,{className:"h-3 w-3 text-muted-foreground"})}))})),n(ov,Object.assign({align:"start",side:"top",className:"w-48"},{children:[0===o&&n(t,{children:[n(iv,Object.assign({onClick:g},{children:[e(kn,{className:"mr-2 h-4 w-4"}),"Header column"]})),e(av,{})]}),n(iv,Object.assign({onClick:p},{children:[e(Ft,{className:"mr-2 h-4 w-4"}),"Insert column left"]})),n(iv,Object.assign({onClick:h},{children:[e(Wt,{className:"mr-2 h-4 w-4"}),"Insert column right"]})),e(av,{}),n(iv,Object.assign({onClick:f,className:"text-destructive focus:text-destructive"},{children:[e(Nn,{className:"mr-2 h-4 w-4"}),"Delete column"]}))]}))]})}))}))},yv=({blockId:r,rowIndex:o,position:i,onMouseEnter:a,onMouseLeave:s})=>{const d=x(),u=l(()=>[0,o,0,0],[o]),p=c(()=>{G.insertTableRow(d,r,{path:u,insertMode:"before"})},[d,r,u]),h=c(()=>{G.insertTableRow(d,r,{path:u,insertMode:"after"})},[d,r,u]),f=c(()=>{G.deleteTableRow(d,r,{path:u})},[d,r,u]),g=c(()=>{G.toggleHeaderRow(d,r)},[d,r]);return e(Q,Object.assign({id:`table-row-controls-${r}-${o}`},{children:e("div",Object.assign({className:"fixed z-[9998] pointer-events-auto",style:{left:`${i.left+20}px`,top:`${i.top}px`,width:"18px",height:`${i.height}px`},onMouseEnter:a,onMouseLeave:s},{children:n(nv,{children:[e(rv,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"sm",className:"h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md p-0 transition-all hover:shadow-md flex items-center justify-center",onMouseDown:e=>e.preventDefault()},{children:e(Qt,{className:"h-3 w-3 text-muted-foreground"})}))})),n(ov,Object.assign({align:"start",side:"left",className:"w-48"},{children:[0===o&&n(t,{children:[n(iv,Object.assign({onClick:g},{children:[e(kn,{className:"mr-2 h-4 w-4"}),"Header row"]})),e(av,{})]}),n(iv,Object.assign({onClick:p},{children:[e(Bt,{className:"mr-2 h-4 w-4"}),"Insert row above"]})),n(iv,Object.assign({onClick:h},{children:[e(Ht,{className:"mr-2 h-4 w-4"}),"Insert row below"]})),e(av,{}),n(iv,Object.assign({onClick:f,className:"text-destructive focus:text-destructive"},{children:[e(Nn,{className:"mr-2 h-4 w-4"}),"Delete row"]}))]}))]})}))}))},xv=({blockId:r})=>{const o=x(),i=l(()=>k.getBlockSlate(o,{id:r}),[r,o]),[a,s]=u(null),[h,f]=u(!1),[g,m]=u({rowControls:null,columnControls:null,addRowButton:null,addColumnButton:null}),b=d(!1),v=d(!1),w=d(null),y=d(null);y.current=a;const N=c(()=>{const e=y.current;if(!e)return void m({rowControls:null,columnControls:null,addRowButton:null,addColumnButton:null});const t=document.querySelector(`[data-yoopta-block-id="${r}"][data-table-container]`);if(!t)return;const n=t.querySelector("table");if(!n)return;const o=n.getBoundingClientRect(),i=Array.from(t.querySelectorAll("tr")),a=i[e.rowIndex];if(!a)return;const s=Array.from(a.querySelectorAll('[data-element-type="table-data-cell"]'));if(0===s.length)return;const l=s.map(e=>e.getBoundingClientRect()),c=Math.min(...l.map(e=>e.top)),d=Math.max(...l.map(e=>e.bottom)),u=Math.min(...l.map(e=>e.left)),p=Math.max(...l.map(e=>e.right)),h=d-c,f=[];i.forEach(t=>{const n=Array.from(t.querySelectorAll('[data-element-type="table-data-cell"]'));n[e.colIndex]&&f.push(n[e.colIndex].getBoundingClientRect())});const g=f.length>0?Math.min(...f.map(e=>e.left)):u,b=f.length>0?Math.max(...f.map(e=>e.right)):p,v=b-g,w=f.length>0?Math.min(...f.map(e=>e.top)):c,x=e.rowIndex===e.totalRows-1,k=e.colIndex===e.totalColumns-1;m({rowControls:{left:Math.max(0,u-32),top:c,height:h},columnControls:{left:g,top:w-32,width:v},addRowButton:x?{left:o.left,top:o.bottom,width:o.width}:null,addColumnButton:k?{left:o.right,top:o.top,height:o.height}:null})},[r]);p(()=>{if(!a||!h)return;const e=()=>{N()};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),N(),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[a,h,N]);const O=c(()=>{w.current&&(clearTimeout(w.current),w.current=null)},[]),C=c(()=>{O(),w.current=setTimeout(()=>{b.current||v.current||(f(!1),s(null))},150)},[O]),S=c(e=>{if(!i)return null;const t=Array.from(R.nodes(i,{at:[0],match:t=>{if(!P.isElement(t))return!1;const n=t;return"table-data-cell"===n.type&&"id"in n&&n.id===e},mode:"all"}));if(0===t.length)return null;const[,n]=t[0],r=n[n.length-2],o=n[n.length-1],a=Array.from(R.nodes(i,{at:[0],match:e=>P.isElement(e)&&"table"===e.type,mode:"lowest"}));if(0===a.length)return null;const[s]=a[0];if(!P.isElement(s))return null;const l=s.children.length,c=s.children[0];if(!P.isElement(c))return null;const d=c.children.length;return{rowIndex:r,colIndex:o,cellElementId:e,totalRows:l,totalColumns:d}},[i]);p(()=>{const e=document.querySelector(`[data-yoopta-block-id="${r}"][data-table-container]`);if(!e||!i)return;const t=e=>{O(),b.current=!0;const t=e.target.closest('[data-element-type="table-data-cell"]');if(!t)return;const n=t.getAttribute("data-yoopta-element-id");if(!n)return;const r=y.current;if((null==r?void 0:r.cellElementId)===n)return void f(!0);const o=S(n);o&&(s(o),f(!0))},n=()=>{b.current=!1,C()};return e.addEventListener("mousemove",t),e.addEventListener("mouseleave",n),()=>{O(),e.removeEventListener("mousemove",t),e.removeEventListener("mouseleave",n)}},[r,i,S,O,C]);const j=c(()=>{O(),v.current=!0},[O]),E=c(()=>{v.current=!1,C()},[C]);return h&&a?n(t,{children:[g.rowControls&&e(yv,{blockId:r,rowIndex:a.rowIndex,position:g.rowControls,onMouseEnter:j,onMouseLeave:E}),g.columnControls&&e(wv,{blockId:r,colIndex:a.colIndex,position:g.columnControls,onMouseEnter:j,onMouseLeave:E}),g.addColumnButton&&e(bv,{blockId:r,totalColumns:a.totalColumns,position:g.addColumnButton,onMouseEnter:j,onMouseLeave:E}),g.addRowButton&&e(vv,{blockId:r,totalRows:a.totalRows,position:g.addRowButton,onMouseEnter:j,onMouseLeave:E})]}):null},kv=[{label:"None",value:"transparent",color:"transparent"},{label:"Gray",value:"hsl(var(--muted))",color:"hsl(var(--muted))"},{label:"Red",value:"hsl(0 70% 95%)",color:"hsl(0 70% 95%)"},{label:"Orange",value:"hsl(30 70% 95%)",color:"hsl(30 70% 95%)"},{label:"Yellow",value:"hsl(60 70% 95%)",color:"hsl(60 70% 95%)"},{label:"Green",value:"hsl(120 70% 95%)",color:"hsl(120 70% 95%)"},{label:"Blue",value:"hsl(210 70% 95%)",color:"hsl(210 70% 95%)"},{label:"Purple",value:"hsl(270 70% 95%)",color:"hsl(270 70% 95%)"}],Nv=[{label:"Default",value:"inherit",color:"currentColor"},{label:"Gray",value:"hsl(var(--muted-foreground))",color:"hsl(var(--muted-foreground))"},{label:"Red",value:"hsl(0 70% 50%)",color:"hsl(0 70% 50%)"},{label:"Orange",value:"hsl(30 70% 50%)",color:"hsl(30 70% 50%)"},{label:"Yellow",value:"hsl(60 70% 40%)",color:"hsl(60 70% 40%)"},{label:"Green",value:"hsl(120 70% 40%)",color:"hsl(120 70% 40%)"},{label:"Blue",value:"hsl(210 70% 50%)",color:"hsl(210 70% 50%)"},{label:"Purple",value:"hsl(270 70% 50%)",color:"hsl(270 70% 50%)"}],Ov=({blockId:r})=>{const o=x(),i=l(()=>k.getBlockSlate(o,{id:r}),[r,o]),[a,s]=u(null),[c,d]=u(!1),[h,f]=u([]),g=i?Z.get(i):[];p(()=>{f(g)},[g]);const m=Array.isArray(g)&&(null==g?void 0:g.length)>0?g:h;p(()=>{if(!i||!m||m.length<=1)return void s(null);const e=document.querySelector(`[data-yoopta-block-id="${r}"]`);if(!e)return void s(null);const t=e.getBoundingClientRect();let n=1/0,o=-1/0,a=1/0,l=-1/0;for(const[e]of m){const t=document.querySelector(`[data-yoopta-block-id="${r}"] [data-yoopta-element-id="${e.id}"]`);if(!t)continue;const i=t.getBoundingClientRect();if(!i)continue;const{top:s,bottom:c,left:d,right:u}=i;n=Math.min(n,s),o=Math.max(o,c),a=Math.min(a,d),l=Math.max(l,u)}s(n!==1/0?{top:n-t.top,left:a-t.left,width:l-a,height:o-n}:null)},[i,m,r]),p(()=>{if(!m||m.length<=1)return;const e=()=>{s(e=>e?Object.assign({},e):null)};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[m]);const b=e=>{o&&m&&0!==m.length&&(G.setCellHorizontalAlign(o,r,{cells:m,align:e}),d(!1))},v=e=>{o&&m&&0!==m.length&&(G.setCellVerticalAlign(o,r,{cells:m,align:e}),d(!1))};return a?n(t,{children:[e("div",{className:"pointer-events-none absolute z-[9999]",style:{top:`${a.top}px`,left:`${a.left}px`,width:`${a.width}px`,height:`${a.height}px`,border:"2px solid hsl(var(--primary))",backgroundColor:"hsl(var(--primary) / 0.05)",borderRadius:"2px"}}),e("div",Object.assign({className:"absolute z-20 pointer-events-auto",style:{top:`${a.top+a.height/2}px`,left:`${a.left+a.width}px`,transform:"translate(-50%, -50%)"}},{children:n(Hl,Object.assign({open:c,onOpenChange:d},{children:[e(Fl,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"secondary",size:"icon",className:"h-4 w-4 rounded-full shadow-lg bg-primary hover:bg-primary/90",onMouseDown:e=>e.preventDefault()},{children:e(Qt,{className:"h-3 w-3 text-primary-foreground"})}))})),e(Wl,Object.assign({className:"w-64 p-2",align:"start",side:"right"},{children:n("div",Object.assign({className:"space-y-2"},{children:[n(vo,Object.assign({variant:"ghost",size:"sm",className:"w-full justify-start gap-2",onClick:()=>{!o||!m||m.length<=1||(G.mergeCells(o,r,{cells:m}),d(!1))},disabled:!m||m.length<=1},{children:[e(cn,{className:"h-4 w-4"}),"Merge cells"]})),e(Dd,{}),n("div",Object.assign({className:"space-y-1"},{children:[e(yh,Object.assign({className:"text-sm font-medium"},{children:"Color"})),n(nv,{children:[e(rv,Object.assign({asChild:!0},{children:n(vo,Object.assign({variant:"outline",size:"sm",className:"w-full justify-between"},{children:[n("span",Object.assign({className:"flex items-center gap-2"},{children:[e(fn,{className:"h-4 w-4"}),"Select color"]})),e(Vt,{className:"h-4 w-4 opacity-50"})]}))})),n(ov,Object.assign({className:"w-56",align:"start"},{children:[n(sv,{children:[n(lv,{children:[e(fn,{className:"mr-2 h-4 w-4"}),"Background color"]}),e(cv,{children:kv.map(t=>e(iv,Object.assign({onClick:()=>(e=>{o&&m&&0!==m.length&&(G.setCellBackgroundColor(o,r,{cells:m,color:e}),d(!1))})(t.value)},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",{className:"h-4 w-4 rounded border",style:{backgroundColor:t.color}}),t.label]}))}),t.value))})]}),n(sv,{children:[n(lv,{children:[e(On,{className:"mr-2 h-4 w-4"}),"Text color"]}),e(cv,{children:Nv.map(t=>e(iv,Object.assign({onClick:()=>(e=>{o&&m&&0!==m.length&&(G.setCellTextColor(o,r,{cells:m,color:e}),d(!1))})(t.value)},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"h-4 w-4 rounded border flex items-center justify-center text-xs font-bold",style:{color:t.color}},{children:"A"})),t.label]}))}),t.value))})]})]}))]})]})),n("div",Object.assign({className:"space-y-1"},{children:[e(yh,Object.assign({className:"text-sm font-medium"},{children:"Alignment"})),n(nv,{children:[e(rv,Object.assign({asChild:!0},{children:n(vo,Object.assign({variant:"outline",size:"sm",className:"w-full justify-between"},{children:[n("span",Object.assign({className:"flex items-center gap-2"},{children:[e(un,{className:"h-4 w-4"}),"Select alignment"]})),e(Vt,{className:"h-4 w-4 opacity-50"})]}))})),n(ov,Object.assign({className:"w-56",align:"start"},{children:[n(sv,{children:[n(lv,{children:[e(un,{className:"mr-2 h-4 w-4"}),"Horizontal"]}),n(cv,{children:[e(iv,Object.assign({onClick:()=>b("left")},{children:"Left"})),e(iv,Object.assign({onClick:()=>b("center")},{children:"Center"})),e(iv,Object.assign({onClick:()=>b("right")},{children:"Right"})),e(iv,Object.assign({onClick:()=>b("justify")},{children:"Justify"}))]})]}),n(sv,{children:[n(lv,{children:[e(pn,{className:"mr-2 h-4 w-4"}),"Vertical"]}),n(cv,{children:[e(iv,Object.assign({onClick:()=>v("top")},{children:"Top"})),e(iv,Object.assign({onClick:()=>v("middle")},{children:"Middle"})),e(iv,Object.assign({onClick:()=>v("bottom")},{children:"Bottom"}))]})]})]}))]})]})),e(Dd,{}),n(vo,Object.assign({variant:"ghost",size:"sm",className:"w-full justify-start gap-2 text-destructive hover:text-destructive",onClick:()=>{o&&m&&0!==m.length&&(G.clearContents(o,r,{cells:m}),d(!1))}},{children:[e(tn,{className:"h-4 w-4"}),"Clear contents"]}))]}))}))]}))}))]}):null};le("[data-element-type=table-data-cell] [data-slate-node=element]{margin:0}[data-slate-node=table]{-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-slate-node=table-data-cell]{cursor:cell}[data-slate-node=table-data-cell]:active{cursor:crosshair}[data-is-selecting=true] ::-moz-selection{background:none}[data-is-selecting=true] ::selection{background:none}.column-resize-handle{transition:background-color .15s ease}.column-resize-handle:hover{background-color:hsl(var(--primary)/.3)!important}body.resizing-column{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}body.resizing-column,body.resizing-column *{cursor:col-resize!important}");const Cv={table:{render:t=>{var r,o;const{attributes:i,children:a,element:s}=t,c=s,d=x(),u=l(()=>k.getBlockSlate(d,{id:t.blockId}),[d,t.blockId]),p=u?J.get(u):null;return n("div",Object.assign({className:"p-4 overflow-x-auto","data-yoopta-block-id":t.blockId,"data-table-container":!0},{children:[n(uv,Object.assign({},i,{"data-is-selecting":!!p},{children:[e("colgroup",{children:null===(o=null===(r=c.props)||void 0===r?void 0:r.columnWidths)||void 0===o?void 0:o.map((t,n)=>e("col",{style:{width:`${t}px`}},n))}),e(pv,{children:a})]})),e(Ov,{blockId:t.blockId}),e(xv,{blockId:t.blockId}),e(mv,{blockId:t.blockId})]}))}},"table-row":{render:t=>{const{attributes:n,children:r}=t;return e(hv,Object.assign({},n,{children:r}))}},"table-data-cell":{render:t=>{var n,r,o,i,a,s,c,d,u,p,h,f;const{attributes:g,children:m,element:b}=t,v=b,w=x(),y=l(()=>k.getBlockSlate(w,{id:t.blockId}),[w,t.blockId]),N=(null===(n=v.props)||void 0===n?void 0:n.asHeader)?fv:gv;return e(N,Object.assign({},g,{onMouseDown:e=>{e.stopPropagation(),y&&(Z.delete(y),J.delete(y))},colSpan:null!==(o=null===(r=v.props)||void 0===r?void 0:r.colSpan)&&void 0!==o?o:1,rowSpan:null!==(a=null===(i=v.props)||void 0===i?void 0:i.rowSpan)&&void 0!==a?a:1,align:null!==(c=null===(s=v.props)||void 0===s?void 0:s.align)&&void 0!==c?c:"left",valign:null!==(u=null===(d=v.props)||void 0===d?void 0:d.verticalAlign)&&void 0!==u?u:"middle","data-yoopta-element-id":v.id,className:Or("relative group transition-colors"),style:{backgroundColor:null===(p=v.props)||void 0===p?void 0:p.backgroundColor,color:null!==(f=null===(h=v.props)||void 0===h?void 0:h.color)&&void 0!==f?f:"inherit"}},{children:m}))}}},Sv={"tabs-container":{render:t=>{var n;const{attributes:r,children:o,blockId:i,element:a}=t,s=x();return e(Ec,Object.assign({},r,{value:null===(n=a.props)||void 0===n?void 0:n.activeTabId,onValueChange:e=>{const t=k.getBlockSlate(s,{id:i});t&&D.setNodes(t,{props:Object.assign(Object.assign({},a.props),{activeTabId:e})},{at:[0],match:e=>P.isElement(e)&&"tabs-container"===e.type})},className:"w-full"},{children:o}))}},"tabs-list":{render:t=>{const{attributes:r,children:o,blockId:i}=t,a=x();return n(vd,Object.assign({className:"w-full"},{children:[n(Rc,Object.assign({},r,{className:"w-full relative justify-start"},{children:[o,e("button",Object.assign({type:"button",contentEditable:!1,onClick:e=>{e.preventDefault(),e.stopPropagation(),ee.addTabItem(a,i)},className:"ml-1 flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1.5",title:"Add tab"},{children:e(bn,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}))]})),e(bd,{orientation:"horizontal"})]}))}},"tabs-item-heading":{render:t=>{const{attributes:r,children:o,element:i,blockId:a}=t,s=x();return n(zc,Object.assign({},r,{value:i.id,className:"relative group/tab flex items-center gap-2 pr-8 whitespace-nowrap"},{children:[e("div",Object.assign({className:"flex-1 min-w-0"},{children:o})),e("span",Object.assign({contentEditable:!1,onClick:()=>{ee.deleteTabItem(s,a,{tabId:i.id})},className:"absolute right-1 flex items-center justify-center rounded-sm opacity-0 group-hover/tab:opacity-100 transition-opacity hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1",title:"Close tab"},{children:e(jn,{className:"h-3 w-3 shrink-0 text-muted-foreground"})}))]}))}},"tabs-item-content":{render:t=>{var n;const{attributes:r,children:o,element:i}=t;return e(Dc,Object.assign({},r,{value:null===(n=i.props)||void 0===n?void 0:n.referenceId,className:"mt-2"},{children:o}))}}},jv=({preview:t})=>e("div",Object.assign({className:"absolute inset-0 overflow-hidden flex items-center justify-center bg-black/5"},{children:e("video",{src:t.url,className:"max-w-full max-h-full object-contain",style:{maxWidth:t.width||"100%",maxHeight:t.height||"100%"},controls:!1,muted:!0,draggable:!1})})),Ev=({progress:t})=>e("div",Object.assign({className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-4 bg-black/70 backdrop-blur-sm p-6"},{children:e("div",Object.assign({className:"w-full max-w-md space-y-4"},{children:n("div",Object.assign({className:"space-y-2"},{children:[n("div",Object.assign({className:"flex items-center justify-between text-sm"},{children:[e("span",Object.assign({className:"font-medium text-white"},{children:"Uploading video..."})),n("span",Object.assign({className:"text-white/80"},{children:[t.percentage,"%"]}))]})),e("div",Object.assign({className:"h-2 w-full overflow-hidden rounded-full bg-white/20"},{children:e("div",{className:"h-full bg-primary transition-all duration-300 ease-out",style:{width:`${t.percentage}%`}})})),n("div",Object.assign({className:"flex items-center justify-between text-xs text-white/60"},{children:[n("span",{children:[(t.loaded/1024/1024).toFixed(2)," MB /"," ",(t.total/1024/1024).toFixed(2)," MB"]}),e(sn,{className:"h-3.5 w-3.5 animate-spin"})]}))]}))}))})),Rv=({onUpload:t,hasPreview:r})=>{const o=d(null);return n("div",r?Object.assign({className:"flex flex-col items-center justify-center gap-4 py-8"},{children:[n("div",Object.assign({className:"text-center space-y-2"},{children:[e("p",Object.assign({className:"text-sm font-medium text-white"},{children:"Video preview"})),e("p",Object.assign({className:"text-xs text-white/80"},{children:"Uploading your video..."}))]})),e("input",{ref:o,type:"file",accept:"video/*",onChange:t,className:"hidden"})]}):Object.assign({className:"flex flex-col items-center gap-3 py-6"},{children:[e("div",Object.assign({className:"rounded-lg bg-muted p-3"},{children:e(Sn,{className:"h-6 w-6 text-muted-foreground"})})),n("div",Object.assign({className:"text-center"},{children:[e("p",Object.assign({className:"text-sm font-medium"},{children:"Upload a video"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Click or drag and drop"}))]})),e(vo,Object.assign({onClick:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.click()}},{children:"Choose file"})),e("input",{ref:o,type:"file",accept:"video/*",onChange:t,className:"hidden"})]}))},zv=({onInsertUrl:t})=>{const[r,o]=u(""),[i,a]=u(!1),[s,l]=u(null),c=()=>{r.trim()&&(t(r.trim()),o(""),a(!1),l(null))};return n("div",Object.assign({className:"mt-4 space-y-3"},{children:[n("div",Object.assign({className:"space-y-2"},{children:[e(To,{placeholder:"Paste video URL (YouTube, Vimeo, Dailymotion, Loom, Wistia)...",value:r,onChange:e=>(e=>{if(o(e),e.trim()){const t=te(e.trim());a(t.isValid),l(t.provider?t.provider.charAt(0).toUpperCase()+t.provider.slice(1):null)}else a(!1),l(null)})(e.target.value),onKeyDown:e=>{"Enter"===e.key&&r.trim()&&i&&c()}}),r.trim()&&e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:i?n("span",Object.assign({className:"flex items-center gap-1.5 text-green-600 dark:text-green-400"},{children:[e(mn,{className:"h-3 w-3"}),s," video detected"]})):e("span",Object.assign({className:"text-destructive"},{children:"Invalid video URL. Supported: YouTube, Vimeo, Dailymotion, Loom, Wistia"}))}))]})),e(vo,Object.assign({className:"w-full",onClick:c,disabled:!r.trim()||!i},{children:i?`Embed ${s} video`:"Embed video"}))]}))},Dv=({onUpload:t,onInsertUrl:r,hasPreview:o})=>e("div",Object.assign({className:Or("relative p-4",o&&"min-h-[300px] flex flex-col")},{children:n(Ec,Object.assign({defaultValue:"upload",className:"w-full"},{children:[n(Rc,Object.assign({className:Or("grid w-full grid-cols-2",o&&"bg-background/80 backdrop-blur-sm")},{children:[n(zc,Object.assign({value:"upload",className:"gap-1.5"},{children:[e(Cn,{className:"h-3.5 w-3.5"}),"Upload"]})),n(zc,Object.assign({value:"link",className:"gap-1.5"},{children:[e(an,{className:"h-3.5 w-3.5"}),"Link"]}))]})),e(Dc,Object.assign({value:"upload",className:"mt-4"},{children:e(Rv,{onUpload:t,hasPreview:o})})),e(Dc,Object.assign({value:"link"},{children:e(zv,{onInsertUrl:r})}))]}))})),Pv=({onUpload:t,onInsertUrl:r,className:o,attributes:i,children:a,preview:s,progress:l,loading:c})=>{const d=null!==s&&!!s.url,u=c&&l;return n("div",Object.assign({className:Or("mt-2 relative rounded-lg border bg-background overflow-hidden",d&&"min-h-[300px]",o)},i,{contentEditable:!1},{children:[d&&e(jv,{preview:s}),!d&&e(Dv,{onUpload:t,onInsertUrl:r,hasPreview:d}),u&&l&&e(Ev,{progress:l}),a]}))};var Mv="Switch",[Tv,Iv]=pe(Mv),[_v,Av]=Tv(Mv),Lv=r.forwardRef((t,o)=>{const{__scopeSwitch:i,name:a,checked:s,defaultChecked:l,required:c,disabled:d,value:u="on",onCheckedChange:p,form:h,...f}=t,[g,m]=r.useState(null),b=me(o,e=>m(e)),v=r.useRef(!1),w=!g||(h||!!g.closest("form")),[y,x]=Ce({prop:s,defaultProp:l??!1,onChange:p,caller:Mv});return n(_v,{scope:i,checked:y,disabled:d,children:[e(Se.button,{type:"button",role:"switch","aria-checked":y,"aria-required":c,"data-state":Bv(y),"data-disabled":d?"":void 0,disabled:d,value:u,...f,ref:b,onClick:ke(t.onClick,e=>{x(e=>!e),w&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),w&&e(Wv,{control:g,bubbles:!v.current,name:a,value:u,checked:y,required:c,disabled:d,form:h,style:{transform:"translateX(-100%)"}})]})});Lv.displayName=Mv;var Hv="SwitchThumb",Fv=r.forwardRef((t,n)=>{const{__scopeSwitch:r,...o}=t,i=Av(Hv,r);return e(Se.span,{"data-state":Bv(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:n})});Fv.displayName=Hv;var Wv=r.forwardRef(({__scopeSwitch:t,control:n,checked:o,bubbles:i=!0,...a},s)=>{const l=r.useRef(null),c=me(l,s),d=xh(o),u=Ja(n);return r.useEffect(()=>{const e=l.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:i});n.call(e,o),e.dispatchEvent(t)}},[d,o,i]),e("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...a,tabIndex:-1,ref:c,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Bv(e){return e?"checked":"unchecked"}Wv.displayName="SwitchBubbleInput";var Uv=Lv,Vv=Fv;const $v=r.forwardRef((t,n)=>{var{className:r}=t,o=de(t,["className"]);return e(Uv,Object.assign({className:Or("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",r)},o,{ref:n},{children:e(Vv,{className:Or("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}))});$v.displayName=Uv.displayName;const Xv={contain:{label:"Contain",description:"Fit within bounds"},cover:{label:"Cover",description:"Fill and crop"},fill:{label:"Fill",description:"Stretch to fit"}},Yv=({fit:t,settings:r,onUpdate:o})=>{var i,a,s,l,c,d,p,h,f,g,m,b;const[v,w]=u(!1),y=e=>{o({settings:Object.assign(Object.assign({},r),e)})};return n(Hl,Object.assign({open:v,onOpenChange:w},{children:[e(Kp,{children:n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(Fl,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:v?"secondary":"ghost",size:"icon",className:"h-7 w-7"},{children:e(yn,{className:"h-4 w-4"})}))}))})),e(Zp,{children:"Settings"})]})}),e(Wl,Object.assign({className:"w-80 p-3",align:"start",contentEditable:!1,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},{children:n("div",Object.assign({className:"space-y-3"},{children:[n("div",{children:[e("h4",Object.assign({className:"font-semibold"},{children:"Video settings"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Customize video playback and display"}))]}),e(Dd,{}),n("div",Object.assign({className:"space-y-1"},{children:[e(yh,Object.assign({htmlFor:"object-fit",className:"text-sm font-medium"},{children:"How video fits"})),n(Lf,Object.assign({value:t||"contain",onValueChange:e=>o({fit:e})},{children:[e(Wf,Object.assign({id:"object-fit",className:"h-9 w-full"},{children:e(Ff,Object.assign({placeholder:"Select how video fits"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(i=Xv[t||"contain"])||void 0===i?void 0:i.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(a=Xv[t||"contain"])||void 0===a?void 0:a.description}))]}))}))})),e(Vf,{children:n(Hf,{children:[e($f,Object.assign({value:"contain",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-4 w-3 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(s=Xv.contain)||void 0===s?void 0:s.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(l=Xv.contain)||void 0===l?void 0:l.description}))]}))]}))})),e($f,Object.assign({value:"cover",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-8 w-6 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(c=Xv.cover)||void 0===c?void 0:c.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(d=Xv.cover)||void 0===d?void 0:d.description}))]}))]}))})),e($f,Object.assign({value:"fill",className:"cursor-pointer"},{children:n("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:e("div",{className:"h-8 w-8 rounded bg-primary"})})),n("div",Object.assign({className:"flex-1"},{children:[e("div",Object.assign({className:"font-medium"},{children:null===(p=Xv.fill)||void 0===p?void 0:p.label})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(h=Xv.fill)||void 0===h?void 0:h.description}))]}))]}))}))]})})]}))]})),e(Dd,{}),n("div",Object.assign({className:"space-y-3"},{children:[n("div",Object.assign({className:"flex items-center justify-between"},{children:[n("div",Object.assign({className:"space-y-0.5"},{children:[e(yh,Object.assign({htmlFor:"controls",className:"text-sm font-medium"},{children:"Show controls"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Display video player controls"}))]})),e($v,{id:"controls",checked:null!==(f=r.controls)&&void 0!==f&&f,onCheckedChange:e=>y({controls:e})})]})),n("div",Object.assign({className:"flex items-center justify-between"},{children:[n("div",Object.assign({className:"space-y-0.5"},{children:[e(yh,Object.assign({htmlFor:"loop",className:"text-sm font-medium"},{children:"Loop video"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Automatically replay when finished"}))]})),e($v,{id:"loop",checked:null!==(g=r.loop)&&void 0!==g&&g,onCheckedChange:e=>y({loop:e})})]})),n("div",Object.assign({className:"flex items-center justify-between"},{children:[n("div",Object.assign({className:"space-y-0.5"},{children:[e(yh,Object.assign({htmlFor:"muted",className:"text-sm font-medium"},{children:"Muted"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Start video without sound"}))]})),e($v,{id:"muted",checked:null!==(m=r.muted)&&void 0!==m&&m,onCheckedChange:e=>y({muted:e})})]})),n("div",Object.assign({className:"flex items-center justify-between"},{children:[n("div",Object.assign({className:"space-y-0.5"},{children:[e(yh,Object.assign({htmlFor:"autoplay",className:"text-sm font-medium"},{children:"Autoplay"})),e("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Start playing automatically (may require muted)"}))]})),e($v,{id:"autoplay",checked:null!==(b=r.autoPlay)&&void 0!==b&&b,onCheckedChange:e=>y({autoPlay:e})})]}))]}))]}))}))]}))},Kv=({referenceRef:r,elementProps:o,onUpdate:i,onReplace:a,onDelete:s,onDownload:l,onCopy:c})=>{var d,h;const[f,g]=u(!1),m=o.provider&&o.provider.type,b="alignment"in o,{refs:v,floatingStyles:w}=dp({placement:"top",strategy:"fixed",middleware:[Ba(8),Ka(),Ua({padding:10})],whileElementsMounted:Ca});p(()=>{requestAnimationFrame(()=>{g(!0)})},[]),p(()=>{const e=r.current;e&&v.setReference(e)},[r,v]);return e("div",Object.assign({ref:v.setFloating,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),className:Or("pointer-events-auto","flex items-center gap-1 rounded-lg border bg-background/95 backdrop-blur-sm p-1 shadow-lg","transition-all duration-200 ease-out",f?"opacity-100 translate-y-0":"opacity-0 translate-y-2"),style:w},{children:n(Kp,Object.assign({delayDuration:0},{children:[b&&n("div",Object.assign({className:"flex items-center gap-0.5 border-r pr-1"},{children:[n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"left"===o.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>i({alignment:"left"})},{children:e(At,{className:"h-4 w-4"})}))})),e(Zp,{children:"Align left"})]}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"center"===o.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>i({alignment:"center"})},{children:e(_t,{className:"h-4 w-4"})}))})),e(Zp,{children:"Align center"})]}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"right"===o.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>i({alignment:"right"})},{children:e(Lt,{className:"h-4 w-4"})}))})),e(Zp,{children:"Align right"})]})]})),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a},{children:e(vn,{className:"h-4 w-4"})}))})),e(Zp,{children:"Replace"})]}),!m&&o.src&&n(t,{children:[n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{if(l)l();else if(o.src&&!m){const e=document.createElement("a");e.href=o.src,e.download=`video-${Date.now()}.mp4`,e.click()}}},{children:e(Jt,{className:"h-4 w-4"})}))})),e(Zp,{children:"Download"})]}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{c?c():o.src&&Po(o.src)}},{children:e(Zt,{className:"h-4 w-4"})}))})),e(Zp,{children:"Copy URL"})]})]}),m&&(null===(d=o.provider)||void 0===d?void 0:d.url)&&n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{var e;(null===(e=o.provider)||void 0===e?void 0:e.url)&&window.open(o.provider.url,"_blank")}},{children:e(nn,{className:"h-4 w-4"})}))})),e(Zp,{children:"Open in new tab"})]}),!m&&n(t,{children:[e(Dd,{orientation:"vertical",className:"h-4"}),e(Yv,{fit:null!==(h=o.fit)&&void 0!==h?h:"contain",settings:o.settings||{controls:!1,loop:!1,muted:!1,autoPlay:!1},onUpdate:i})]}),n(qp,{children:[e(Gp,Object.assign({asChild:!0},{children:e(vo,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:s},{children:e(Nn,{className:"h-4 w-4"})}))})),e(Zp,{children:"Delete"})]})]}))}))},qv=({blockId:t,attributes:r,children:o,elementProps:i,onUpdate:a,onDelete:s,onReplace:l,pluginOptions:c})=>{var h,f,g,m;const[b,v]=u(i.sizes||{width:650,height:400}),{isElementSelected:w}=C(),y=S({blockId:t}),k=w&&y,N=d(null),O=x(),[j,E]=u(()=>{var e;const t=(null===(e=O.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,n=null==c?void 0:c.maxSizes;return{maxWidth:(null==n?void 0:n.maxWidth)?"number"==typeof n.maxWidth?n.maxWidth:parseInt(String(n.maxWidth).replace(/[^\d]/g,""),10):t,maxHeight:(null==n?void 0:n.maxHeight)?"number"==typeof n.maxHeight?n.maxHeight:parseInt(String(n.maxHeight).replace(/[^\d]/g,""),10):550}});p(()=>{const e=()=>{var e;const t=(null===(e=O.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,n=null==c?void 0:c.maxSizes;E({maxWidth:(null==n?void 0:n.maxWidth)?"number"==typeof n.maxWidth?n.maxWidth:parseInt(String(n.maxWidth).replace(/[^\d]/g,""),10):t,maxHeight:(null==n?void 0:n.maxHeight)?"number"==typeof n.maxHeight?n.maxHeight:parseInt(String(n.maxHeight).replace(/[^\d]/g,""),10):550})};e();const t=new ResizeObserver(e);return O.refElement&&t.observe(O.refElement),window.addEventListener("resize",e),()=>{t.disconnect(),window.removeEventListener("resize",e)}},[O,c]);const R=(e,t)=>{const n=e=>"number"==typeof e?e:parseInt(String(e).replace(/[^\d]/g,""),10),r=n(e.width),o=n(e.height),i=n(t.width),a=n(t.height);if(r<=i&&o<=a)return{width:r,height:o};const s=r/i,l=o/a,c=Math.max(s,l),d=Math.round(r/c),u=Math.round(o/c);return{width:Math.min(d,i),height:Math.min(u,a)}},z=i.provider&&i.provider.type,D=i.src||"",P=z&&(null===(h=i.provider)||void 0===h?void 0:h.id)?ne(i.provider.type,i.provider.id):null,M=i.settings||{controls:!0,loop:!1,muted:!1,autoPlay:!1},T={left:"justify-start",center:"justify-center",right:"justify-end"}[null!==(f=i.alignment)&&void 0!==f?f:"center"];return n("div",Object.assign({},r,{className:Or("group/video mt-2 relative transition-all w-full flex",T)},{children:[n("div",Object.assign({className:"relative",contentEditable:!1},{children:[e(Qu,Object.assign({ref:e=>{(null==e?void 0:e.resizableElement)&&e.resizableElement instanceof HTMLElement&&(N.current=e.resizableElement)},style:{position:"relative",outline:k?".125rem solid rgba(0, 0, 0, 0)":"none",outlineColor:k?"hsl(var(--primary))":"none"},size:{width:"number"==typeof b.width?b.width:parseInt(String(b.width),10),height:"number"==typeof b.height?b.height:parseInt(String(b.height),10)},onResize:(e,t,n)=>{const r=parseInt(n.style.width,10),o=parseInt(n.style.height,10),i=R({width:r,height:o},{width:j.maxWidth,height:j.maxHeight});v(i)},onResizeStop:(e,t,n)=>{const r=parseInt(n.style.width,10),o=parseInt(n.style.height,10),i=R({width:r,height:o},{width:j.maxWidth,height:j.maxHeight});a({sizes:i})},lockAspectRatio:!0,minWidth:200,minHeight:150,maxWidth:j.maxWidth,maxHeight:j.maxHeight,enableResizing:!!k&&{bottom:!1,bottomLeft:!1,bottomRight:!1,left:!0,right:!0,top:!1,topLeft:!1,topRight:!1},disableDragging:!0,resizeHandleStyles:{left:{width:"auto",height:"40px",left:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"},right:{width:"auto",height:"40px",right:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"}},resizeHandleComponent:{left:e("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"}),right:e("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"})},className:Or("rounded-sm overflow-hidden")},{children:z&&P?e("iframe",{title:i.provider.type,src:P,width:"100%",height:"100%",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full",style:{aspectRatio:`${b.width} / ${b.height}`}}):e("video",{title:"Video",src:D,controls:M.controls,loop:M.loop,muted:M.muted,autoPlay:M.autoPlay,poster:null!==(g=i.poster)&&void 0!==g?g:void 0,className:"w-full h-full transition-all duration-200",style:{objectFit:null!==(m=i.fit)&&void 0!==m?m:"contain"},draggable:!1})})),k&&e(Kv,{referenceRef:N,elementProps:i,onUpdate:a,onReplace:l,onDelete:s,onDownload:()=>ue(void 0,void 0,void 0,function*(){if(i.src&&!z)try{const e=yield fetch(i.src),t=yield e.blob(),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=`video-${Date.now()}.mp4`,r.click(),URL.revokeObjectURL(n)}catch(e){}}),onCopy:()=>ue(void 0,void 0,void 0,function*(){var e;if(i.src)try{if(z&&(null===(e=i.provider)||void 0===e?void 0:e.url)){const{default:e}=yield Promise.resolve().then(function(){return Mo});e(i.provider.url)}else{const e=yield fetch(i.src),t=yield e.blob();if(navigator.clipboard&&ClipboardItem)yield navigator.clipboard.write([new ClipboardItem({[t.type]:t})]);else{const{default:e}=yield Promise.resolve().then(function(){return Mo});e(i.src)}}}catch(e){const{default:t}=yield Promise.resolve().then(function(){return Mo});t(i.src||"")}})})]})),o]}))},Gv={video:{render:({element:t,attributes:n,children:r,blockId:o})=>{const i=x(),a=j("Video"),{upload:s,progress:l,loading:d}=re(a.upload),{deleteVideo:u}=oe(a.delete),{preview:p,generatePreview:h,clearPreview:f}=ie(),g=c(e=>{N.updateElement(i,{blockId:o,type:"video",props:Object.assign(Object.assign({},t.props),e)})},[i,o,t.props]),m=c(()=>ue(void 0,void 0,void 0,function*(){yield u(t);const e=k.getBlockSlate(i,{id:o});if(!e)return;const n=N.getElementPath(i,{blockId:o,element:t});if(!n)return;const r=n?R.parent(e,n):void 0;r&&P.isElement(r[0])&&!R.isEditor(r[0])?N.deleteElement(i,{blockId:o,type:"video",path:n}):k.deleteBlock(i,{blockId:o,focus:!0})}),[i,o,t,u]),b=c(()=>{N.updateElement(i,{blockId:o,type:"video",props:Object.assign(Object.assign({},t.props),{src:null,provider:null})})},[i,o,t.props]),v=c(e=>ue(void 0,void 0,void 0,function*(){var n;const r=null===(n=e.target.files)||void 0===n?void 0:n[0];if(!r)return;h(r);const o=yield s(r);g({id:o.id||o.fileId,src:o.url,sizes:o.width&&o.height?{width:o.width,height:o.height}:t.props.sizes||{width:650,height:400},provider:o.provider||null,poster:o.poster||null}),f()}),[s,g,h,f,t.props.sizes]),w=c(e=>ue(void 0,void 0,void 0,function*(){const n=te(e);if(n.isValid&&n.provider){const r=ae(e);g({src:n.embedUrl,provider:r,sizes:t.props.sizes||{width:650,height:400}})}else e.trim()&&g({src:e.trim(),provider:null,sizes:t.props.sizes||{width:650,height:400}})}),[g,t.props.sizes]);return t.props.src||t.props.provider?e(qv,Object.assign({blockId:o,elementId:t.id,onUpdate:g,onDelete:m,attributes:n,onReplace:b,elementProps:t.props,pluginOptions:a},{children:r})):e(Pv,Object.assign({onUpload:v,preview:p,progress:l,loading:d,onInsertUrl:w,attributes:n},{children:r}))}}};function Zv(e,t){const n={Accordion:En,Paragraph:am,Blockquote:Rn,Callout:Sr,Table:Cv,Link:rm,HeadingOne:th.HeadingOne,HeadingTwo:th.HeadingTwo,HeadingThree:th.HeadingThree,BulletedList:im.BulletedList,NumberedList:im.NumberedList,TodoList:im.TodoList,Image:Eg,Video:Gv,Code:$l,Tabs:Sv,CodeGroup:wd,Steps:dv,Carousel:Eo,Divider:Pd,Embed:eh};return e.map(e=>{var r;const o=e.getPlugin.type,i=n[o];if(!i)return e;const a=null==t?void 0:t[o],s=null!==(r=null==a?void 0:a.elements)&&void 0!==r?r:i;return e.extend(Object.assign({elements:s},a&&{injectElementsFromPlugins:a.injectElementsFromPlugins,events:a.events,options:a.options}))})}export{En as AccordionUI,Rn as BlockquoteUI,Sr as CalloutUI,$l as CodeUI,Pd as DividerUI,eh as EmbedUI,th as HeadingsUI,Eg as ImageUI,rm as LinkUI,im as ListsUI,am as ParagraphUI,dv as StepsUI,Cv as TableUI,Sv as TabsUI,Gv as VideoUI,Zv as default};
|