slidecanvas 1.1.3 → 1.1.4

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  "use strict";var ha=Object.create;var We=Object.defineProperty,ba=Object.defineProperties,fa=Object.getOwnPropertyDescriptor,xa=Object.getOwnPropertyDescriptors,va=Object.getOwnPropertyNames,$t=Object.getOwnPropertySymbols,wa=Object.getPrototypeOf,Gt=Object.prototype.hasOwnProperty,ya=Object.prototype.propertyIsEnumerable;var Zt=(m,a,c)=>a in m?We(m,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):m[a]=c,z=(m,a)=>{for(var c in a||(a={}))Gt.call(a,c)&&Zt(m,c,a[c]);if($t)for(var c of $t(a))ya.call(a,c)&&Zt(m,c,a[c]);return m},R=(m,a)=>ba(m,xa(a));var Na=(m,a)=>{for(var c in a)We(m,c,{get:a[c],enumerable:!0})},Ot=(m,a,c,h)=>{if(a&&typeof a=="object"||typeof a=="function")for(let v of va(a))!Gt.call(m,v)&&v!==c&&We(m,v,{get:()=>a[v],enumerable:!(h=fa(a,v))||h.enumerable});return m};var He=(m,a,c)=>(c=m!=null?ha(wa(m)):{},Ot(a||!m||!m.__esModule?We(c,"default",{value:m,enumerable:!0}):c,m)),ka=m=>Ot(We({},"__esModule",{value:!0}),m);var ja={};Na(ja,{PptEditor:()=>Ha,PptxBlobExporter:()=>yt,PptxExporter:()=>qe,PptxParser:()=>Xe});module.exports=ka(ja);function ft(m,{insertAt:a}={}){if(!m||typeof document=="undefined")return;let c=document.head||document.getElementsByTagName("head")[0],h=document.createElement("style");h.type="text/css",a==="top"&&c.firstChild?c.insertBefore(h,c.firstChild):c.appendChild(h),h.styleSheet?h.styleSheet.cssText=m:h.appendChild(document.createTextNode(m))}ft(`@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lato:wght@400;700&family=Open+Sans:wght@400;600;700&family=Poppins:wght@400;500;600;700&family=Roboto:wght@400;500;700&family=Roboto+Slab:wght@400;700&family=Playfair+Display:wght@400;700&family=Merriweather:wght@400;700&family=Nunito+Sans:wght@400;600;700&family=Montserrat:wght@400;600;700&family=Oswald:wght@400;500&family=Raleway:wght@400;600;700&family=Ubuntu:wght@400;500;700&family=Lora:wght@400;700&family=PT+Sans:wght@400;700&family=PT+Serif:wght@400;700&family=Play:wght@400;700&family=Arvo:wght@400;700&family=Kanit:wght@400;500;600&display=swap";/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50: oklch(97.1% .013 17.38);--color-red-100: oklch(93.6% .032 17.717);--color-red-200: oklch(88.5% .062 18.334);--color-red-400: oklch(70.4% .191 22.216);--color-red-500: oklch(63.7% .237 25.331);--color-red-600: oklch(57.7% .245 27.325);--color-orange-50: oklch(98% .016 73.684);--color-orange-500: oklch(70.5% .213 47.604);--color-amber-500: oklch(76.9% .188 70.08);--color-green-500: oklch(72.3% .219 149.579);--color-emerald-50: oklch(97.9% .021 166.113);--color-emerald-100: oklch(95% .052 163.051);--color-emerald-500: oklch(69.6% .17 162.48);--color-emerald-600: oklch(59.6% .145 163.225);--color-emerald-700: oklch(50.8% .118 165.612);--color-teal-500: oklch(70.4% .14 182.503);--color-blue-50: oklch(97% .014 254.604);--color-blue-100: oklch(93.2% .032 255.585);--color-blue-400: oklch(70.7% .165 254.624);--color-blue-500: oklch(62.3% .214 259.815);--color-blue-600: oklch(54.6% .245 262.881);--color-blue-700: oklch(48.8% .243 264.376);--color-indigo-500: oklch(58.5% .233 277.117);--color-purple-50: oklch(97.7% .014 308.299);--color-purple-100: oklch(94.6% .033 307.174);--color-purple-300: oklch(82.7% .119 306.383);--color-purple-500: oklch(62.7% .265 303.9);--color-purple-600: oklch(55.8% .288 302.321);--color-purple-700: oklch(49.6% .265 301.924);--color-pink-500: oklch(65.6% .241 354.308);--color-slate-50: oklch(98.4% .003 247.858);--color-slate-100: oklch(96.8% .007 247.896);--color-slate-200: oklch(92.9% .013 255.508);--color-slate-300: oklch(86.9% .022 252.894);--color-slate-400: oklch(70.4% .04 256.788);--color-slate-500: oklch(55.4% .046 257.417);--color-slate-600: oklch(44.6% .043 257.281);--color-slate-700: oklch(37.2% .044 257.287);--color-slate-800: oklch(27.9% .041 260.031);--color-slate-900: oklch(20.8% .042 265.755);--color-black: #000;--color-white: #fff;--spacing: .25rem;--container-2xl: 42rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-base: 1rem;--text-base--line-height: 1.5 ;--text-lg: 1.125rem;--text-lg--line-height: calc(1.75 / 1.125);--text-xl: 1.25rem;--text-xl--line-height: calc(1.75 / 1.25);--text-2xl: 1.5rem;--text-2xl--line-height: calc(2 / 1.5);--text-4xl: 2.25rem;--text-4xl--line-height: calc(2.5 / 2.25);--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--font-weight-black: 900;--tracking-tighter: -.05em;--tracking-tight: -.025em;--tracking-wide: .025em;--tracking-wider: .05em;--tracking-widest: .1em;--leading-tight: 1.25;--leading-relaxed: 1.625;--radius-sm: .25rem;--radius-md: .375rem;--radius-lg: .5rem;--radius-xl: .75rem;--radius-2xl: 1rem;--radius-3xl: 1.5rem;--ease-out: cubic-bezier(0, 0, .2, 1);--animate-spin: spin 1s linear infinite;--blur-sm: 8px;--blur-md: 12px;--aspect-video: 16 / 9;--default-transition-duration: .15s;--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);--default-font-family: var(--font-sans);--default-mono-font-family: var(--font-mono)}}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:currentcolor;@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-5{top:calc(var(--spacing) * 5)}.top-10{top:calc(var(--spacing) * 10)}.top-\\[24px\\]{top:24px}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-1\\.5{right:calc(var(--spacing) * 1.5)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.right-6{right:calc(var(--spacing) * 6)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-1{bottom:calc(var(--spacing) * 1)}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-6{bottom:calc(var(--spacing) * 6)}.bottom-8{bottom:calc(var(--spacing) * 8)}.bottom-10{bottom:calc(var(--spacing) * 10)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1{left:calc(var(--spacing) * 1)}.left-1\\.5{left:calc(var(--spacing) * 1.5)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-4{left:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-50{z-index:50}.z-\\[100\\]{z-index:100}.z-\\[1000\\]{z-index:1000}.z-\\[2000\\]{z-index:2000}.z-\\[2001\\]{z-index:2001}.z-\\[5000\\]{z-index:5000}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.z-\\[10000\\]{z-index:10000}.z-\\[11000\\]{z-index:11000}.z-\\[99999\\]{z-index:99999}.col-span-1{grid-column:span 1 / span 1}.container{width:100%;@media(width>=40rem){max-width:40rem}@media(width>=48rem){max-width:48rem}@media(width>=64rem){max-width:64rem}@media(width>=80rem){max-width:80rem}@media(width>=96rem){max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-1\\.5{margin-inline:calc(var(--spacing) * 1.5)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.my-1{margin-block:calc(var(--spacing) * 1)}.my-auto{margin-block:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0{margin-top:calc(var(--spacing) * 0)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-0{margin-right:calc(var(--spacing) * 0)}.mr-0\\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0{margin-bottom:calc(var(--spacing) * 0)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.-ml-0{margin-left:calc(var(--spacing) * -0)}.-ml-0\\.5{margin-left:calc(var(--spacing) * -.5)}.ml-0{margin-left:calc(var(--spacing) * 0)}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.table{display:table}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:var(--aspect-video)}.h-0{height:calc(var(--spacing) * 0)}.h-1{height:calc(var(--spacing) * 1)}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-7\\.5{height:calc(var(--spacing) * 7.5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-32{height:calc(var(--spacing) * 32)}.h-48{height:calc(var(--spacing) * 48)}.h-\\[1px\\]{height:1px}.h-\\[2\\.5px\\]{height:2.5px}.h-\\[4px\\]{height:4px}.h-\\[22px\\]{height:22px}.h-\\[28px\\]{height:28px}.h-full{height:100%}.h-screen{height:100vh}.max-h-\\[60vh\\]{max-height:60vh}.max-h-\\[90vh\\]{max-height:90vh}.max-h-\\[200px\\]{max-height:200px}.max-h-\\[250px\\]{max-height:250px}.min-h-\\[56px\\]{min-height:56px}.min-h-\\[300px\\]{min-height:300px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing) * 1)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\\.5{width:calc(var(--spacing) * 2.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-15{width:calc(var(--spacing) * 15)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-60{width:calc(var(--spacing) * 60)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-96{width:calc(var(--spacing) * 96)}.w-\\[1px\\]{width:1px}.w-\\[15px\\]{width:15px}.w-\\[32px\\]{width:32px}.w-\\[480px\\]{width:480px}.w-\\[500px\\]{width:500px}.w-\\[600px\\]{width:600px}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[90vw\\]{max-width:90vw}.max-w-\\[300px\\]{max-width:300px}.max-w-\\[400px\\]{max-width:400px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\\[64px\\]{min-width:64px}.min-w-\\[68px\\]{min-width:68px}.min-w-\\[80px\\]{min-width:80px}.min-w-\\[180px\\]{min-width:180px}.min-w-\\[280px\\]{min-width:280px}.min-w-fit{min-width:fit-content}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-bottom-left{transform-origin:0 100%}.origin-center{transform-origin:center}.origin-top-left{transform-origin:0 0}.-translate-x-1{--tw-translate-x: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1{--tw-translate-y: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\[1px\\]{--tw-translate-y: 1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-75{--tw-scale-x: 75%;--tw-scale-y: 75%;--tw-scale-z: 75%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-105{--tw-scale-x: 105%;--tw-scale-y: 105%;--tw-scale-z: 105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-110{--tw-scale-x: 110%;--tw-scale-y: 110%;--tw-scale-z: 110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.appearance-none{appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.justify-stretch{justify-content:stretch}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-4{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-6{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}}.self-start{align-self:flex-start}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\\[2\\.5rem\\]{border-radius:2.5rem}.rounded-\\[3px\\]{border-radius:3px}.rounded-full{border-radius:calc(infinity * 1px)}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-\\[3px\\]{border-top-left-radius:3px;border-bottom-left-radius:3px}.rounded-l-lg{border-top-left-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-r-\\[3px\\]{border-top-right-radius:3px;border-bottom-right-radius:3px}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.rounded-b-xl{border-bottom-right-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[1\\.5px\\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style: dashed;border-style:dashed}.border-none{--tw-border-style: none;border-style:none}.border-solid{--tw-border-style: solid;border-style:solid}.border-black{border-color:var(--color-black)}.border-emerald-100{border-color:var(--color-emerald-100)}.border-emerald-100\\/50{border-color:color-mix(in srgb,oklch(95% .052 163.051) 50%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-emerald-100) 50%,transparent)}}.border-purple-100{border-color:var(--color-purple-100)}.border-red-200{border-color:var(--color-red-200)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-100\\/50{border-color:color-mix(in srgb,oklch(96.8% .007 247.896) 50%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-200\\/60{border-color:color-mix(in srgb,oklch(92.9% .013 255.508) 60%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-slate-200) 60%,transparent)}}.border-slate-300{border-color:var(--color-slate-300)}.border-transparent{border-color:transparent}.border-white{border-color:var(--color-white)}.border-white\\/10{border-color:color-mix(in srgb,#fff 10%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-\\[\\#0A0A0A\\]{background-color:#0a0a0a}.bg-black{background-color:var(--color-black)}.bg-black\\/20{background-color:color-mix(in srgb,#000 20%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-black\\/40{background-color:color-mix(in srgb,#000 40%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\\/60{background-color:color-mix(in srgb,#000 60%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-100\\/50{background-color:color-mix(in srgb,oklch(93.2% .032 255.585) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-blue-100) 50%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-50\\/50{background-color:color-mix(in srgb,oklch(97.9% .021 166.113) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-emerald-50) 50%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-purple-50\\/50{background-color:color-mix(in srgb,oklch(97.7% .014 308.299) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-purple-50) 50%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-50\\/50{background-color:color-mix(in srgb,oklch(98.4% .003 247.858) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-50) 50%,transparent)}}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-100\\/50{background-color:color-mix(in srgb,oklch(96.8% .007 247.896) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-200\\/50{background-color:color-mix(in srgb,oklch(92.9% .013 255.508) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-200) 50%,transparent)}}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-900\\/40{background-color:color-mix(in srgb,oklch(20.8% .042 265.755) 40%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-900) 40%,transparent)}}.bg-transparent{background-color:transparent}.bg-white{background-color:var(--color-white)}.bg-white\\/10{background-color:color-mix(in srgb,#fff 10%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-white\\/50{background-color:color-mix(in srgb,#fff 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.bg-white\\/80{background-color:color-mix(in srgb,#fff 80%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.bg-gradient-to-b{--tw-gradient-position: to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black{--tw-gradient-from: var(--color-black);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-black\\/60{--tw-gradient-from: color-mix(in srgb, #000 60%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-gradient-from: color-mix(in oklab, var(--color-black) 60%, transparent)}--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to: transparent;--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-purple-300{fill:var(--color-purple-300)}.fill-slate-700{fill:var(--color-slate-700)}.p-0{padding:calc(var(--spacing) * 0)}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-10{padding:calc(var(--spacing) * 10)}.p-12{padding:calc(var(--spacing) * 12)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-10{padding-inline:calc(var(--spacing) * 10)}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-5{padding-right:calc(var(--spacing) * 5)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-11{padding-left:calc(var(--spacing) * 11)}.pl-12{padding-left:calc(var(--spacing) * 12)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading, var(--text-2xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading, var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading, var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading, var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading, var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.text-\\[6px\\]{font-size:6px}.text-\\[7px\\]{font-size:7px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12\\.5px\\]{font-size:12.5px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[16px\\]{font-size:16px}.text-\\[17px\\]{font-size:17px}.leading-none{--tw-leading: 1;line-height:1}.leading-relaxed{--tw-leading: var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading: var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight: var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight: var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight: var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight: var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.2em\\]{--tw-tracking: .2em;letter-spacing:.2em}.tracking-\\[0\\.15em\\]{--tw-tracking: .15em;letter-spacing:.15em}.tracking-tight{--tw-tracking: var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-tighter{--tw-tracking: var(--tracking-tighter);letter-spacing:var(--tracking-tighter)}.tracking-wide{--tw-tracking: var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking: var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking: var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-500{color:var(--color-amber-500)}.text-black{color:var(--color-black)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-600{color:var(--color-emerald-600)}.text-emerald-600\\/70{color:color-mix(in srgb,oklch(59.6% .145 163.225) 70%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-emerald-600) 70%,transparent)}}.text-emerald-700{color:var(--color-emerald-700)}.text-green-500{color:var(--color-green-500)}.text-indigo-500{color:var(--color-indigo-500)}.text-orange-500{color:var(--color-orange-500)}.text-pink-500{color:var(--color-pink-500)}.text-purple-500{color:var(--color-purple-500)}.text-purple-600{color:var(--color-purple-600)}.text-purple-700{color:var(--color-purple-700)}.text-red-400{color:var(--color-red-400)}.text-red-400\\/80{color:color-mix(in srgb,oklch(70.4% .191 22.216) 80%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-red-400) 80%,transparent)}}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-slate-200{color:var(--color-slate-200)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-teal-500{color:var(--color-teal-500)}.text-white{color:var(--color-white)}.text-white\\/50{color:color-mix(in srgb,#fff 50%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.text-white\\/80{color:color-mix(in srgb,#fff 80%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0%}.opacity-25{opacity:25%}.opacity-40{opacity:40%}.opacity-50{opacity:50%}.opacity-75{opacity:75%}.opacity-100{opacity:100%}.shadow-2xl{--tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, rgb(0 0 0 / .25));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_20px_50px_rgba\\(0\\,0\\,0\\,0\\.15\\)\\]{--tw-shadow: 0 20px 50px var(--tw-shadow-color, rgba(0,0,0,.15));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 8px 10px -6px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-4{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black{--tw-shadow-color: #000;@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, var(--color-black) var(--tw-shadow-alpha), transparent)}}.shadow-black\\/80{--tw-shadow-color: color-mix(in srgb, #000 80%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-black) 80%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-blue-500{--tw-shadow-color: oklch(62.3% .214 259.815);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, var(--color-blue-500) var(--tw-shadow-alpha), transparent)}}.shadow-blue-500\\/20{--tw-shadow-color: color-mix(in srgb, oklch(62.3% .214 259.815) 20%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-blue-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500{--tw-shadow-color: oklch(69.6% .17 162.48);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, var(--color-emerald-500) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\\/20{--tw-shadow-color: color-mix(in srgb, oklch(69.6% .17 162.48) 20%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-black{--tw-ring-color: var(--color-black)}.ring-black\\/5{--tw-ring-color: color-mix(in srgb, #000 5%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-black) 5%, transparent)}}.ring-purple-100{--tw-ring-color: var(--color-purple-100)}.ring-white{--tw-ring-color: var(--color-white)}.backdrop-blur-\\[1px\\]{--tw-backdrop-blur: blur(1px);-webkit-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,);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,)}.backdrop-blur-\\[2px\\]{--tw-backdrop-blur: blur(2px);-webkit-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,);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,)}.backdrop-blur-md{--tw-backdrop-blur: blur(var(--blur-md));-webkit-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,);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,)}.backdrop-blur-sm{--tw-backdrop-blur: blur(var(--blur-sm));-webkit-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,);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{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.duration-150{--tw-duration: .15s;transition-duration:.15s}.duration-200{--tw-duration: .2s;transition-duration:.2s}.duration-300{--tw-duration: .3s;transition-duration:.3s}.duration-500{--tw-duration: .5s;transition-duration:.5s}.duration-700{--tw-duration: .7s;transition-duration:.7s}.ease-out{--tw-ease: var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style: none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\\:text-slate-600{&:is(:where(.group):focus-within *){color:var(--color-slate-600)}}.group-hover\\:scale-105{&:is(:where(.group):hover *){@media(hover:hover){--tw-scale-x: 105%;--tw-scale-y: 105%;--tw-scale-z: 105%;scale:var(--tw-scale-x) var(--tw-scale-y)}}}.group-hover\\:scale-110{&:is(:where(.group):hover *){@media(hover:hover){--tw-scale-x: 110%;--tw-scale-y: 110%;--tw-scale-z: 110%;scale:var(--tw-scale-x) var(--tw-scale-y)}}}.group-hover\\:bg-blue-50{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-blue-50)}}}.group-hover\\:bg-blue-100{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-blue-100)}}}.group-hover\\:bg-blue-600{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-blue-600)}}}.group-hover\\:bg-emerald-50{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-emerald-50)}}}.group-hover\\:bg-emerald-600{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-emerald-600)}}}.group-hover\\:bg-purple-600{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-purple-600)}}}.group-hover\\:bg-red-500{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-red-500)}}}.group-hover\\:bg-slate-200{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-slate-200)}}}.group-hover\\:fill-slate-900{&:is(:where(.group):hover *){@media(hover:hover){fill:var(--color-slate-900)}}}.group-hover\\:text-blue-600{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-blue-600)}}}.group-hover\\:text-slate-700{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-slate-700)}}}.group-hover\\:text-slate-900{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-slate-900)}}}.group-hover\\:text-white{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-white)}}}.group-hover\\:opacity-100{&:is(:where(.group):hover *){@media(hover:hover){opacity:100%}}}.group-hover\\:shadow-sm{&:is(:where(.group):hover *){@media(hover:hover){--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}}.placeholder\\:text-slate-400{&::placeholder{color:var(--color-slate-400)}}.hover\\:border-blue-400{&:hover{@media(hover:hover){border-color:var(--color-blue-400)}}}.hover\\:border-slate-100{&:hover{@media(hover:hover){border-color:var(--color-slate-100)}}}.hover\\:border-slate-200{&:hover{@media(hover:hover){border-color:var(--color-slate-200)}}}.hover\\:border-slate-300{&:hover{@media(hover:hover){border-color:var(--color-slate-300)}}}.hover\\:bg-black{&:hover{@media(hover:hover){background-color:var(--color-black)}}}.hover\\:bg-blue-50{&:hover{@media(hover:hover){background-color:var(--color-blue-50)}}}.hover\\:bg-blue-50\\/50{&:hover{@media(hover:hover){background-color:color-mix(in srgb,oklch(97% .014 254.604) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-blue-50) 50%,transparent)}}}}.hover\\:bg-blue-700{&:hover{@media(hover:hover){background-color:var(--color-blue-700)}}}.hover\\:bg-emerald-700{&:hover{@media(hover:hover){background-color:var(--color-emerald-700)}}}.hover\\:bg-purple-50{&:hover{@media(hover:hover){background-color:var(--color-purple-50)}}}.hover\\:bg-red-50{&:hover{@media(hover:hover){background-color:var(--color-red-50)}}}.hover\\:bg-red-100{&:hover{@media(hover:hover){background-color:var(--color-red-100)}}}.hover\\:bg-slate-50{&:hover{@media(hover:hover){background-color:var(--color-slate-50)}}}.hover\\:bg-slate-100{&:hover{@media(hover:hover){background-color:var(--color-slate-100)}}}.hover\\:bg-slate-200{&:hover{@media(hover:hover){background-color:var(--color-slate-200)}}}.hover\\:bg-white{&:hover{@media(hover:hover){background-color:var(--color-white)}}}.hover\\:bg-white\\/20{&:hover{@media(hover:hover){background-color:color-mix(in srgb,#fff 20%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}}}.hover\\:text-blue-500{&:hover{@media(hover:hover){color:var(--color-blue-500)}}}.hover\\:text-blue-600{&:hover{@media(hover:hover){color:var(--color-blue-600)}}}.hover\\:text-purple-600{&:hover{@media(hover:hover){color:var(--color-purple-600)}}}.hover\\:text-red-500{&:hover{@media(hover:hover){color:var(--color-red-500)}}}.hover\\:text-slate-500{&:hover{@media(hover:hover){color:var(--color-slate-500)}}}.hover\\:text-slate-600{&:hover{@media(hover:hover){color:var(--color-slate-600)}}}.hover\\:text-slate-700{&:hover{@media(hover:hover){color:var(--color-slate-700)}}}.hover\\:text-white{&:hover{@media(hover:hover){color:var(--color-white)}}}.hover\\:opacity-100{&:hover{@media(hover:hover){opacity:100%}}}.hover\\:shadow-md{&:hover{@media(hover:hover){--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}}.focus\\:border-blue-500{&:focus{border-color:var(--color-blue-500)}}.focus\\:border-slate-400{&:focus{border-color:var(--color-slate-400)}}.focus\\:ring-2{&:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\\:ring-4{&:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\\:ring-blue-500\\/10{&:focus{--tw-ring-color: color-mix(in srgb, oklch(62.3% .214 259.815) 10%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-blue-500) 10%, transparent)}}}.focus\\:ring-blue-500\\/20{&:focus{--tw-ring-color: color-mix(in srgb, oklch(62.3% .214 259.815) 20%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-blue-500) 20%, transparent)}}}.focus\\:ring-slate-400\\/5{&:focus{--tw-ring-color: color-mix(in srgb, oklch(70.4% .04 256.788) 5%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-slate-400) 5%, transparent)}}}.focus\\:outline-none{&:focus{--tw-outline-style: none;outline-style:none}}.active\\:scale-95{&:active{--tw-scale-x: 95%;--tw-scale-y: 95%;--tw-scale-z: 95%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.active\\:scale-\\[0\\.98\\]{&:active{scale:.98}}.active\\:cursor-grabbing{&:active{cursor:grabbing}}.disabled\\:cursor-not-allowed{&:disabled{cursor:not-allowed}}.disabled\\:bg-slate-100{&:disabled{background-color:var(--color-slate-100)}}.disabled\\:bg-slate-300{&:disabled{background-color:var(--color-slate-300)}}.disabled\\:text-slate-400{&:disabled{color:var(--color-slate-400)}}.disabled\\:opacity-20{&:disabled{opacity:20%}}.disabled\\:opacity-40{&:disabled{opacity:40%}}.disabled\\:opacity-50{&:disabled{opacity:50%}}.disabled\\:active\\:scale-100{&:disabled{&:active{--tw-scale-x: 100%;--tw-scale-y: 100%;--tw-scale-z: 100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}}.md\\:space-y-8{@media(width>=48rem){:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}}}.md\\:p-12{@media(width>=48rem){padding:calc(var(--spacing) * 12)}}}@keyframes blob{0%{transform:translate(0) scale(1)}33%{transform:translate(30px,-50px) scale(1.1)}66%{transform:translate(-20px,20px) scale(.9)}to{transform:translate(0) scale(1)}}.animate-blob{animation:blob 7s infinite}.animation-delay-2000{animation-delay:2s}.animation-delay-4000{animation-delay:4s}@property --tw-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-scale-x{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-y{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-z{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-rotate-x{syntax: "*"; inherits: false;}@property --tw-rotate-y{syntax: "*"; inherits: false;}@property --tw-rotate-z{syntax: "*"; inherits: false;}@property --tw-skew-x{syntax: "*"; inherits: false;}@property --tw-skew-y{syntax: "*"; inherits: false;}@property --tw-space-y-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-gradient-position{syntax: "*"; inherits: false;}@property --tw-gradient-from{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-via{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-to{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-stops{syntax: "*"; inherits: false;}@property --tw-gradient-via-stops{syntax: "*"; inherits: false;}@property --tw-gradient-from-position{syntax: "<length-percentage>"; inherits: false; initial-value: 0%;}@property --tw-gradient-via-position{syntax: "<length-percentage>"; inherits: false; initial-value: 50%;}@property --tw-gradient-to-position{syntax: "<length-percentage>"; inherits: false; initial-value: 100%;}@property --tw-leading{syntax: "*"; inherits: false;}@property --tw-font-weight{syntax: "*"; inherits: false;}@property --tw-tracking{syntax: "*"; inherits: false;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false;}@property --tw-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false;}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false;}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false;}@property --tw-ring-offset-width{syntax: "<length>"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-backdrop-blur{syntax: "*"; inherits: false;}@property --tw-backdrop-brightness{syntax: "*"; inherits: false;}@property --tw-backdrop-contrast{syntax: "*"; inherits: false;}@property --tw-backdrop-grayscale{syntax: "*"; inherits: false;}@property --tw-backdrop-hue-rotate{syntax: "*"; inherits: false;}@property --tw-backdrop-invert{syntax: "*"; inherits: false;}@property --tw-backdrop-opacity{syntax: "*"; inherits: false;}@property --tw-backdrop-saturate{syntax: "*"; inherits: false;}@property --tw-backdrop-sepia{syntax: "*"; inherits: false;}@property --tw-duration{syntax: "*"; inherits: false;}@property --tw-ease{syntax: "*"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-scale-z: 1;--tw-rotate-x: initial;--tw-rotate-y: initial;--tw-rotate-z: initial;--tw-skew-x: initial;--tw-skew-y: initial;--tw-space-y-reverse: 0;--tw-border-style: solid;--tw-gradient-position: initial;--tw-gradient-from: #0000;--tw-gradient-via: #0000;--tw-gradient-to: #0000;--tw-gradient-stops: initial;--tw-gradient-via-stops: initial;--tw-gradient-from-position: 0%;--tw-gradient-via-position: 50%;--tw-gradient-to-position: 100%;--tw-leading: initial;--tw-font-weight: initial;--tw-tracking: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-backdrop-blur: initial;--tw-backdrop-brightness: initial;--tw-backdrop-contrast: initial;--tw-backdrop-grayscale: initial;--tw-backdrop-hue-rotate: initial;--tw-backdrop-invert: initial;--tw-backdrop-opacity: initial;--tw-backdrop-saturate: initial;--tw-backdrop-sepia: initial;--tw-duration: initial;--tw-ease: initial}}}
3
- `);var B=require("react");var de=He(require("react")),w=require("lucide-react");var Wt=require("clsx"),qt=require("tailwind-merge");function I(...m){return(0,qt.twMerge)((0,Wt.clsx)(m))}var e=require("react/jsx-runtime"),Ca=["Inter","Lato","Open Sans","Poppins","Roboto","Roboto Slab","Georgia","Playfair Display","Merriweather","Nunito Sans","Montserrat","Oswald","Raleway","Ubuntu","Lora","PT Sans","PT Serif","Play","Arvo","Kanit","Times New Roman","Arial"],La=[12,14,16,18,20,24,28,32,36,48,64,72,96],Sa=[{name:"Basic Shapes",shapes:["rect","circle","triangle","rightTriangle","rhombus","parallelogram","trapezoid","pentagon","hexagon","heptagon","octagon","heart","smiley","sun","moon"]},{name:"Arrows",shapes:["arrowRight","arrowLeft","arrowUp","arrowDown","arrowLeftRight","arrowUpDown"]},{name:"Stars & Symbols",shapes:["star4","star5","star6","star8","cloud","lightning"]},{name:"Equation Shapes",shapes:["plus","minus","multiply","divide","equal"]}],za=({type:m,className:a})=>{switch(m){case"rect":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",fill:"currentColor"})});case"circle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor"})});case"triangle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4L20 18H4L12 4Z",fill:"currentColor"})});case"rightTriangle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 4V20H20L4 4Z",fill:"currentColor"})});case"rhombus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4L20 12L12 20L4 12L12 4Z",fill:"currentColor"})});case"parallelogram":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M7 4H21L17 20H3L7 4Z",fill:"currentColor"})});case"trapezoid":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M6 4H18L21 20H3L6 4Z",fill:"currentColor"})});case"pentagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L21 9V19H3V9L12 3Z",fill:"currentColor"})});case"hexagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L20 7.5V16.5L12 21L4 16.5V7.5L12 3Z",fill:"currentColor"})});case"heptagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L18.5 6L21 13L16 20H8L3 13L5.5 6L12 3Z",fill:"currentColor"})});case"octagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M8.5 3H15.5L21 8.5V15.5L15.5 21H8.5L3 15.5V8.5L8.5 3Z",fill:"currentColor"})});case"heart":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",fill:"currentColor"})});case"smiley":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.2",stroke:"currentColor",strokeWidth:"2"}),(0,e.jsx)("circle",{cx:"9",cy:"9",r:"1.5",fill:"currentColor"}),(0,e.jsx)("circle",{cx:"15",cy:"9",r:"1.5",fill:"currentColor"}),(0,e.jsx)("path",{d:"M8 15C8 15 9.5 17 12 17C14.5 17 16 15 16 15",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]});case"sun":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"}),(0,e.jsx)("path",{d:"M12 2V4M12 20V22M4 12H2M22 12H20M19.07 4.93L17.66 6.34M6.34 17.66L4.93 19.07M4.93 4.93L6.34 6.34M17.66 17.66L19.07 19.07",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]});case"moon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9 7 7 0 0 1-9-9",fill:"currentColor"})});case"arrowRight":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 11h11.5l-3.5-3.5 1.5-1.5 6 6-6 6-1.5-1.5 3.5-3.5H4z",fill:"currentColor"})});case"arrowLeft":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M20 11H8.5l3.5-3.5L10.5 6l-6 6 6 6 1.5-1.5-3.5-3.5H20z",fill:"currentColor"})});case"arrowUp":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M13 20V8.5l3.5 3.5 1.5-1.5-6-6-6 6 1.5 1.5 3.5-3.5V20z",fill:"currentColor"})});case"arrowDown":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M11 4v11.5l-3.5-3.5-1.5 1.5 6 6 6-6-1.5-1.5-3.5 3.5V4z",fill:"currentColor"})});case"arrowLeftRight":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 12l4-4v3h8V8l4 4-4 4v-3H8v3l-4-4z",fill:"currentColor"})});case"arrowUpDown":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4l-4 4h3v8H8l4 4 4-4h-3V8h3l-4-4z",fill:"currentColor"})});case"star4":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2 8 8 2-8 2-2 8-2-8-8-2 8-2 2-8z",fill:"currentColor"})});case"star5":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2.5 7.5H22l-6 4.5 2.5 7.5-6.5-4.5-6.5 4.5 2.5-7.5-6-4.5h7.5L12 2z",fill:"currentColor"})});case"star6":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l3 5 6-1-4 4.5 2 6.5-7-3-7 3 2-6.5-4-4.5 6 1 3-5z",fill:"currentColor"})});case"star8":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2 4 4-2-2 4 4 2-4 2 2 4-4-2-2 4-2-4-4 2 2-4-4-2 4-2-2-4 4 2 2-4z",fill:"currentColor"})});case"cloud":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M17.5 19c-3 0-5.5-2.5-5.5-5.5 0-.2 0-.4.1-.6-2-.8-3.6-2.5-4.1-4.7C6.5 7.4 5 6 3 6c-1.7 0-3 1.3-3 3s1.3 3 3 3c.4 0 .8-.1 1.2-.2C4.1 13 5 14.5 6.5 15.5c.3 1.8 1.4 3.4 3 4.3.4.2.8.3 1.2.4 1.2.4 2.5.6 3.8.6 4.4 0 8-3.6 8-8s-3.6-8-8-8c-.4 0-.8 0-1.2.1-1.2.2-2.3.7-3.2 1.5C11 4.2 12.4 3.5 14 3.5c4.1 0 7.5 3.4 7.5 7.5s-1.8 7.5-4 8z",fill:"currentColor",transform:"scale(0.8) translate(3,3)"})});case"lightning":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M13 2L3 14h9v8l10-12h-9l3-8z",fill:"currentColor"})});case"plus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})});case"minus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})});case"multiply":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:"currentColor"})});case"divide":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"7",r:"2",fill:"currentColor"}),(0,e.jsx)("circle",{cx:"12",cy:"17",r:"2",fill:"currentColor"}),(0,e.jsx)("rect",{x:"5",y:"11",width:"14",height:"2",fill:"currentColor"})]});case"equal":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 10H5V8h14v2zm0 6H5v-2h14v2z",fill:"currentColor"})});default:return(0,e.jsx)("div",{className:"w-6 h-6 bg-slate-200 rounded-sm"})}},Ia=({onAddShape:m,uiScale:a})=>{let[c,h]=(0,de.useState)(!1);return de.default.useEffect(()=>(window._toggleShapesMenu=()=>h(!c),()=>{window._toggleShapesMenu=void 0}),[c]),c?(0,e.jsx)("div",{className:"absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-2xl shadow-2xl p-4 overflow-y-auto z-[100] animate-in fade-in zoom-in-95 duration-200",style:{width:`${320*a}px`,maxHeight:`${480*a}px`},children:(0,e.jsx)("div",{className:"flex flex-col gap-6",children:Sa.map(v=>(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400 px-1",style:{fontSize:`${10*a}px`},children:v.name}),(0,e.jsx)("div",{className:"grid grid-cols-5 gap-1",children:v.shapes.map(s=>(0,e.jsx)("button",{onClick:()=>{m(s),h(!1)},className:"aspect-square hover:bg-slate-50 rounded-lg flex items-center justify-center border border-transparent hover:border-slate-100 transition-all group p-1",title:s,children:(0,e.jsx)("div",{className:"w-full h-full bg-slate-100 rounded-sm group-hover:bg-blue-100 group-hover:scale-110 transition-all flex items-center justify-center overflow-hidden p-1.5",children:(0,e.jsx)(za,{type:s,className:"w-full h-full text-slate-400 group-hover:text-blue-600 transition-colors"})})},s))})]},v.name))})}):null},Xt=({onAddText:m,onAddImage:a,onAddShape:c,onAddSlide:h,onExport:v,onFormatText:s,onDeleteElement:j,onApplyLayout:P,onPlay:M,selectedElement:r,appName:T,onAiAction:g,onAiResponseAction:S,aiResponse:V,isAiLoading:L,onNewPresentation:y,onLoadPresentation:b,appBgColor:Z="#B7472A",uiScale:U,source:J,onGenerateImageClick:te,onGenerateInfographicClick:N,onUploadImageClick:k})=>{let K=de.default.useRef(null),[_,X]=(0,de.useState)("Home"),[Q,n]=(0,de.useState)(!1),[f,o]=(0,de.useState)(!1),[x,C]=(0,de.useState)(!1),[$,D]=(0,de.useState)(!1),[se,ne]=(0,de.useState)("file"),[G,xe]=(0,de.useState)(""),[ae,E]=(0,de.useState)(!1),[W,oe]=(0,de.useState)(!1),[Se,me]=(0,de.useState)(!1),[Ne,ve]=(0,de.useState)(!1),fe=H=>{if(!O||!r)return;let ie=r.content||"",he=ie;switch(H){case"sentence":he=ie.charAt(0).toUpperCase()+ie.slice(1).toLowerCase();break;case"lowercase":he=ie.toLowerCase();break;case"uppercase":he=ie.toUpperCase();break;case"capitalize":he=ie.split(" ").map(ke=>ke.charAt(0).toUpperCase()+ke.slice(1).toLowerCase()).join(" ");break;case"toggle":he=ie.split("").map(ke=>ke===ke.toUpperCase()?ke.toLowerCase():ke.toUpperCase()).join("");break}s({content:he}),E(!1)},O=(r==null?void 0:r.type)==="text",tt=(r==null?void 0:r.type)==="shape",at=(r==null?void 0:r.type)==="image",rt="#B7472A";return(0,e.jsxs)("div",{className:"flex flex-col border-b border-slate-200 bg-white z-50 select-none",style:{fontSize:`${12*U}px`},children:[(0,e.jsxs)("div",{className:"bg-white flex items-center justify-stretch border-b border-slate-200/60 transition-all duration-300 relative z-[1000]",style:{height:`${120*U}px`,overflow:"visible"},children:[(0,e.jsxs)("div",{className:I("flex-1 flex flex-col items-center border-r border-slate-100 px-3 gap-1 h-full py-2",U<.84?"min-w-0":"min-w-fit"),children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto",children:[(0,e.jsxs)("button",{onClick:h,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg group transition-all min-w-[64px]",children:[(0,e.jsx)("div",{className:"bg-orange-50 p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Plus,{size:20,style:{color:Z}})}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700",children:"New Slide"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{onClick:()=>n(!Q),className:I("flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg transition-all min-w-[64px]",Q&&"bg-slate-100"),children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg",children:(0,e.jsx)(w.Layout,{size:20,className:"text-slate-500"})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Layout"})]}),Q&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-2xl shadow-3xl p-2 w-60 flex flex-col gap-1 z-[100] animate-in fade-in zoom-in-95 duration-200 ring-4 ring-black/5",children:[(0,e.jsxs)("button",{onClick:()=>{P("title"),n(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-lg group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.FileText,{size:18})}),"Title Slide"]}),(0,e.jsxs)("button",{onClick:()=>{P("content"),n(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-emerald-50 text-emerald-600 rounded-lg group-hover:bg-emerald-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.List,{size:18})}),"Title & Content"]}),(0,e.jsxs)("button",{onClick:()=>{P("split"),n(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-purple-50 text-purple-600 rounded-lg group-hover:bg-purple-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.Columns,{size:18})}),"Two Columns"]})]})]})]}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Slides"})]}),(0,e.jsxs)("div",{className:I("flex flex-col border-r border-slate-200 h-full py-2 relative",U<.85?"px-2":"px-4"),children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mt-2 mb-3",children:[(0,e.jsxs)("div",{className:"flex items-center bg-white border border-slate-300 rounded-[3px] h-[28px] overflow-hidden",children:[(0,e.jsx)("select",{disabled:!O,value:(r==null?void 0:r.fontFamily)||"Open Sans",onChange:H=>s({fontFamily:H.target.value}),className:I("h-full px-1.5 text-[13px] text-slate-800 font-normal bg-transparent outline-none disabled:opacity-50 appearance-none cursor-pointer",U<.85?"w-20":"w-32"),children:Ca.map(H=>(0,e.jsx)("option",{value:H,children:H},H))}),(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400 mr-1"})]}),(0,e.jsxs)("div",{className:"flex items-center bg-white border border-slate-300 rounded-[3px] h-[28px] overflow-hidden w-15",children:[(0,e.jsx)("select",{disabled:!O,value:(r==null?void 0:r.fontSize)||10,onChange:H=>s({fontSize:parseInt(H.target.value)}),className:"h-full w-full px-1 text-[12.5px] text-slate-800 font-normal bg-transparent outline-none disabled:opacity-50 appearance-none cursor-pointer text-center",children:La.map(H=>(0,e.jsx)("option",{value:H,children:H},H))}),(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400 mr-0.5"})]}),(0,e.jsxs)("button",{disabled:!O,onClick:()=>s({fontSize:Math.min(200,((r==null?void 0:r.fontSize)||24)+2)}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Increase Font Size",children:[(0,e.jsx)("span",{className:"text-[16px] font-semibold text-slate-700",children:"A"}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700 -ml-0.5 -mt-1",children:"\u25B2"})]}),(0,e.jsxs)("button",{disabled:!O,onClick:()=>s({fontSize:Math.max(8,((r==null?void 0:r.fontSize)||24)-2)}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Decrease Font Size",children:[(0,e.jsx)("span",{className:"text-[14px] font-semibold text-slate-700",children:"A"}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700 -ml-0.5 mt-1",children:"\u25BC"})]}),(0,e.jsxs)("button",{disabled:!O,onClick:()=>s({isBold:!1,isItalic:!1,isUnderline:!1,highlightColor:"",color:"#000000",isStrikethrough:!1}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Clear All Formatting",children:[(0,e.jsx)("span",{className:"text-[16px] font-semibold text-slate-700",children:"A"}),(0,e.jsx)(w.Eraser,{size:11,className:"text-pink-500 -ml-0.5"})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)("button",{disabled:!O,onClick:()=>s({isBold:!r.isBold}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isBold?"bg-blue-100":"hover:bg-slate-100"),title:"Bold",children:(0,e.jsx)("span",{className:`text-[17px] font-black ${r!=null&&r.isBold?"text-slate-900":"text-slate-700"}`,children:"B"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>s({isItalic:!r.isItalic}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isItalic?"bg-blue-100":"hover:bg-slate-100"),title:"Italic",children:(0,e.jsx)("span",{className:`text-[17px] font-semibold italic ${r!=null&&r.isItalic?"text-slate-900":"text-slate-700"}`,style:{fontFamily:"serif"},children:"I"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>s({isUnderline:!r.isUnderline}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isUnderline?"bg-blue-100":"hover:bg-slate-100"),title:"Underline",children:(0,e.jsx)("span",{className:`text-[17px] font-semibold underline underline-offset-2 ${r!=null&&r.isUnderline?"text-slate-900":"text-slate-700"}`,children:"U"})}),(0,e.jsxs)("button",{disabled:!O,onClick:()=>s({isStrikethrough:!r.isStrikethrough}),className:I("h-8 px-1.5 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isStrikethrough?"bg-blue-100":"hover:bg-slate-100"),title:"Strikethrough",children:[(0,e.jsx)("span",{className:`text-[12px] font-medium line-through ${r!=null&&r.isStrikethrough?"text-slate-900":"text-slate-600"}`,children:"abc"}),(0,e.jsx)(w.ChevronDown,{size:12,className:"text-slate-400 ml-0.5"})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{disabled:!O,onClick:()=>oe(!W),className:I("h-8 px-1.5 flex flex-col items-center justify-center rounded-[3px] transition-all disabled:opacity-40",W?"bg-slate-100":"hover:bg-slate-100"),title:"Character Spacing",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)("span",{className:"text-[12px] font-bold text-slate-700",children:"A"}),(0,e.jsx)("span",{className:"text-[12px] font-bold text-slate-700 -ml-0.5",children:"V"}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 ml-0.5"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-0",children:[(0,e.jsx)("span",{className:"text-[7px] text-blue-500",children:"\u25C0"}),(0,e.jsx)("div",{className:"w-2.5 h-[1px] bg-blue-500"}),(0,e.jsx)("span",{className:"text-[7px] text-blue-500",children:"\u25B6"})]})]}),W&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl py-1 w-32 z-[100] animate-in fade-in zoom-in-95 duration-150",children:[(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:-50}),oe(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Very Tight",(r==null?void 0:r.charSpacing)===-50&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:-25}),oe(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Tight",(r==null?void 0:r.charSpacing)===-25&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:0}),oe(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Normal",((r==null?void 0:r.charSpacing)===0||!(r!=null&&r.charSpacing))&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:25}),oe(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Loose",(r==null?void 0:r.charSpacing)===25&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:50}),oe(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Very Loose",(r==null?void 0:r.charSpacing)===50&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,e.jsx)("button",{className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 disabled:opacity-50",children:"More Spacing..."})]})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{disabled:!O,onClick:()=>E(!ae),className:"h-8 px-1.5 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Change Case",children:[(0,e.jsx)("span",{className:"text-[14px] font-medium text-slate-700",children:"Aa"}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 ml-0.5"})]}),ae&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl py-1 w-44 z-[100] animate-in fade-in zoom-in-95 duration-150",children:[(0,e.jsxs)("button",{onClick:()=>fe("sentence"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400",children:"Aa"})," Sentence case."]}),(0,e.jsxs)("button",{onClick:()=>fe("lowercase"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"l"})," lowercase"]}),(0,e.jsxs)("button",{onClick:()=>fe("uppercase"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"U"})," UPPERCASE"]}),(0,e.jsxs)("button",{onClick:()=>fe("capitalize"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"C"})," Capitalize Each Word"]}),(0,e.jsxs)("button",{onClick:()=>fe("toggle"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"t"})," tOGGLE cASE"]})]})]}),(0,e.jsx)("div",{className:"w-[1px] h-5 bg-slate-200 mx-1.5"}),(0,e.jsxs)("div",{className:"relative flex items-center",children:[(0,e.jsxs)("button",{disabled:!O,className:I("w-9 h-7.5 flex flex-col items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.highlightColor?"bg-slate-100":"hover:bg-slate-100"),title:"Text Highlight Color",children:[(0,e.jsx)(w.Highlighter,{size:21,strokeWidth:2.5,className:r!=null&&r.highlightColor?"text-slate-900":"text-slate-500"}),(0,e.jsx)("div",{className:"absolute top-[24px] left-1.5 right-1.5 h-1.5",style:{backgroundColor:(r==null?void 0:r.highlightColor)||"transparent"}})]}),(0,e.jsx)("input",{type:"color",disabled:!O,className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full disabled:cursor-not-allowed",value:(r==null?void 0:r.highlightColor)||"#ffff00",onChange:H=>s({highlightColor:H.target.value}),title:"Choose Highlight Color"}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 -ml-0.5"})]}),(0,e.jsxs)("div",{className:"relative flex items-center",children:[(0,e.jsxs)("button",{className:"w-9 h-7.5 flex flex-col items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all",title:"Font Color",children:[(0,e.jsx)("span",{className:"text-[16px] font-black text-slate-800 leading-none",children:"A"}),(0,e.jsx)("div",{className:"w-6 h-[4px] rounded-sm mt-0.5",style:{backgroundColor:(r==null?void 0:r.color)||"#ff0000"}}),(0,e.jsx)("input",{type:"color",className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full",value:(r==null?void 0:r.color)||"#ff0000",onChange:H=>s({color:H.target.value})})]}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 -ml-0.5"})]})]}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] text-center uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Font"})]}),(0,e.jsxs)("div",{className:I("flex flex-col border-r border-slate-200 h-full py-2 relative",U<.85?"px-2":"px-4"),children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mt-2 mb-3",children:[(0,e.jsxs)("div",{className:"relative flex items-center rounded-[3px] hover:bg-slate-100 transition-all",children:[(0,e.jsx)("button",{disabled:!O,onClick:()=>{r!=null&&r.isBulleted?s({isBulleted:!1,isNumbered:!1,listType:"none"}):s({isBulleted:!0,isNumbered:!1,listType:"bullet-disc"})},className:I("w-[32px] h-8 flex items-center justify-center rounded-l-[3px] transition-all disabled:opacity-40",r!=null&&r.isBulleted?"bg-blue-100":"hover:bg-slate-100"),title:"Bullets",children:(0,e.jsx)(w.List,{size:19,className:r!=null&&r.isBulleted?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>me(!Se),className:I("w-[15px] h-8 flex items-center justify-center rounded-r-[3px] border-l border-transparent hover:border-slate-200 transition-all disabled:opacity-40",Se?"bg-slate-100":"hover:bg-slate-200"),title:"Bullet Options",children:(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400"})}),Se&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!1,listType:"none"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,e.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-disc"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-circle"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-square"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-square-outlined"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-diamond"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-arrow"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-check"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,e.jsxs)("div",{className:"relative flex items-center rounded-[3px] hover:bg-slate-100 transition-all",children:[(0,e.jsx)("button",{disabled:!O,onClick:()=>{r!=null&&r.isNumbered?s({isBulleted:!1,isNumbered:!1,listType:"none"}):s({isBulleted:!1,isNumbered:!0,listType:"number-decimal"})},className:I("w-[32px] h-8 flex items-center justify-center rounded-l-[3px] transition-all disabled:opacity-40",r!=null&&r.isNumbered?"bg-blue-100":"hover:bg-slate-100"),title:"Numbering",children:(0,e.jsx)(w.ListOrdered,{size:19,className:r!=null&&r.isNumbered?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>ve(!Ne),className:I("w-[15px] h-8 flex items-center justify-center rounded-r-[3px] border-l border-transparent hover:border-slate-200 transition-all disabled:opacity-40",Ne?"bg-slate-100":"hover:bg-slate-200"),title:"Numbering Options",children:(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400"})}),Ne&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!1,listType:"none"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,e.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-decimal"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"1."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"2."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"3."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-decimal-paren"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"1)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"2)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"3)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-roman-upper"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"I."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"II."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"III."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-upper"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"A."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"B."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"C."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-lower-paren"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"a)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"b)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"c)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-lower"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"a."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"b."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"c."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-roman-lower"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"i."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"ii."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"iii."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,e.jsx)("div",{className:"w-[1px] h-6 bg-slate-200 mx-1.5"}),(0,e.jsx)("button",{disabled:!O,className:"w-8 h-8 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Decrease List Level",children:(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 14 14",fill:"none",className:"text-slate-600",children:(0,e.jsx)("path",{d:"M2 3H12M6 7H12M6 11H12M2 7L4 9L2 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,e.jsx)("button",{disabled:!O,className:"w-8 h-8 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Increase List Level",children:(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 14 14",fill:"none",className:"text-slate-600",children:(0,e.jsx)("path",{d:"M2 3H12M6 7H12M6 11H12M4 7L2 9L4 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)("button",{disabled:!O,onClick:()=>s({textAlign:"left"}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="left"?"bg-blue-100":"hover:bg-slate-100"),title:"Align Left",children:(0,e.jsx)(w.AlignLeft,{size:19,className:(r==null?void 0:r.textAlign)==="left"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>s({textAlign:"center"}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="center"?"bg-blue-100":"hover:bg-slate-100"),title:"Center",children:(0,e.jsx)(w.AlignCenter,{size:19,className:(r==null?void 0:r.textAlign)==="center"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>s({textAlign:"right"}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="right"?"bg-blue-100":"hover:bg-slate-100"),title:"Align Right",children:(0,e.jsx)(w.AlignRight,{size:19,className:(r==null?void 0:r.textAlign)==="right"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>s({textAlign:"justify"}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="justify"?"bg-blue-100":"hover:bg-slate-100"),title:"Justify",children:(0,e.jsx)(w.AlignJustify,{size:19,className:(r==null?void 0:r.textAlign)==="justify"?"text-slate-900":"text-slate-600"})})]}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] text-center uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Paragraph"})]}),(0,e.jsxs)("div",{className:"flex-1 flex flex-col items-center border-r border-slate-100 px-2 gap-1 h-full py-1.5 shrink-0",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto",children:[(0,e.jsxs)("div",{className:"relative group/shapes flex justify-center",children:[(0,e.jsxs)("button",{className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg group transition-all min-w-[64px]",onClick:()=>{var H;return(H=window._toggleShapesMenu)==null?void 0:H.call(window)},children:[(0,e.jsx)("div",{className:"bg-blue-50 p-1.5 rounded-lg group-hover:scale-105 transition-transform",children:(0,e.jsx)(w.Square,{size:20,className:"text-blue-600"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700",children:"Shapes"})]}),(0,e.jsx)(Ia,{onAddShape:H=>{c(H)},uiScale:U})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:m,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 transition-colors min-w-[64px]",title:"Text Box",children:[(0,e.jsx)("div",{className:"p-1.5",children:(0,e.jsx)(w.Type,{size:20})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Text Box"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:()=>{var H;return(H=K.current)==null?void 0:H.click()},className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 transition-colors min-w-[64px]",title:"Image",children:[(0,e.jsx)("div",{className:"p-1.5",children:(0,e.jsx)(w.Image,{size:20})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Image"}),(0,e.jsx)("input",{type:"file",ref:K,className:"hidden",accept:"image/*",onChange:H=>{var ie;return((ie=H.target.files)==null?void 0:ie[0])&&a(H.target.files[0])}})]})]}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Drawing"})]}),(0,e.jsxs)("div",{className:"flex-1 flex flex-col items-center border-r border-slate-100 px-2 gap-1 h-full py-1.5 relative",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-0.5 my-auto h-full",children:[(0,e.jsxs)("button",{disabled:!O||L,onClick:()=>g(r.id,"shorten"),className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all min-w-[64px]",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Sparkles,{size:20,className:"text-purple-500"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Shorten"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{disabled:!O||L,onClick:()=>g(r.id,"reframe"),className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all min-w-[64px]",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Sparkles,{size:20,className:"text-blue-500"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Reframe"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{disabled:!O||L,onClick:()=>g(r.id,"lengthen"),className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all min-w-[68px]",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Sparkles,{size:20,className:"text-emerald-500"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-center leading-tight",children:"Lengthen"})]})]}),L&&(0,e.jsx)("div",{className:"absolute inset-x-0 top-2 bottom-8 bg-white/80 flex items-center justify-center rounded-lg z-10 backdrop-blur-[1px]",children:(0,e.jsx)(w.RefreshCw,{size:16,className:"text-blue-600 animate-spin"})}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"AI Text"})]}),(0,e.jsxs)("div",{className:"flex-1 flex flex-col items-center pl-4 pr-3 gap-1 h-full py-2 relative",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto h-full",children:[(0,e.jsxs)("button",{onClick:M,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-700 transition-all min-w-[64px] group",title:"Present",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Play,{size:20,className:"fill-slate-700 group-hover:fill-slate-900"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Present"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:v,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-700 transition-all min-w-[64px] group",title:"Export",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Download,{size:20,className:"text-emerald-600"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Export"})]}),r&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:j,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-red-50 rounded-lg text-red-600 transition-all min-w-[64px] group",title:"Delete",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Trash2,{size:20})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Delete"})]})]})]}),(0,e.jsxs)("div",{className:"absolute bottom-2 right-3 flex items-center gap-1 px-1.5 py-0.5 bg-emerald-50/50 rounded-md border border-emerald-100/50",children:[(0,e.jsx)(w.Check,{size:9,className:"text-emerald-500"}),(0,e.jsx)("span",{className:"text-[7px] font-black text-emerald-600/70 tracking-tighter uppercase",children:"Saved"})]}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Actions"})]})]}),$&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[2000]",onClick:()=>D(!1)}),(0,e.jsxs)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[480px] bg-white rounded-3xl shadow-2xl z-[2001] border border-slate-200 p-8 animate-in fade-in zoom-in-95 duration-200",children:[(0,e.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,e.jsxs)("h3",{className:"text-lg font-black text-slate-800 tracking-tight flex items-center gap-3",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-xl",children:(0,e.jsx)(w.Download,{size:20})}),"Upload Presentation"]}),(0,e.jsx)("button",{onClick:()=>D(!1),className:"text-slate-400 hover:text-slate-600 transition-colors",children:(0,e.jsx)(w.RefreshCw,{size:20,className:"rotate-45"})})]}),(0,e.jsxs)("div",{className:"flex gap-2 p-1 bg-slate-50 rounded-2xl mb-8",children:[(0,e.jsx)("button",{onClick:()=>ne("file"),className:I("flex-1 py-3 text-xs font-black rounded-xl transition-all",se==="file"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"FILE UPLOAD"}),(0,e.jsx)("button",{onClick:()=>ne("link"),className:I("flex-1 py-3 text-xs font-black rounded-xl transition-all",se==="link"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"LINK UPLOAD"})]}),se==="file"?(0,e.jsxs)("label",{className:"flex flex-col items-center justify-center gap-4 py-12 border-2 border-dashed border-slate-200 rounded-3xl hover:border-blue-400 hover:bg-blue-50/50 transition-all cursor-pointer group",children:[(0,e.jsx)("div",{className:"p-4 bg-white rounded-2xl shadow-sm border border-slate-100 group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Plus,{size:24,className:"text-blue-500"})}),(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("p",{className:"text-sm font-bold text-slate-700",children:"Choose a PPTX file"}),(0,e.jsx)("p",{className:"text-xs text-slate-400 mt-1",children:"Maximum file size: 50MB"})]}),(0,e.jsx)("input",{type:"file",accept:".pptx",className:"hidden",onChange:H=>{var he;let ie=(he=H.target.files)==null?void 0:he[0];ie&&(b(ie),D(!1))}})]}):(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("div",{className:"relative",children:(0,e.jsx)("input",{type:"text",placeholder:"Paste S3 or public URL",value:G,onChange:H=>xe(H.target.value),className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 focus:outline-none focus:ring-4 focus:ring-blue-500/10 focus:border-blue-500 text-sm placeholder:text-slate-400 text-black"})}),(0,e.jsx)("button",{onClick:()=>{G.trim()&&(b(G.trim()),D(!1))},disabled:!G.trim(),className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-slate-300 text-white font-black py-4 rounded-2xl transition-all shadow-lg shadow-blue-500/20",children:"LOAD PRESENTATION"}),(0,e.jsx)("p",{className:"text-[10px] text-slate-400 text-center uppercase tracking-widest font-black",children:"Supports S3, Dropbox, and public URLS"})]})]})]})]})};var je=require("lucide-react"),be=require("@dnd-kit/core"),Me=require("@dnd-kit/sortable"),Yt=require("@dnd-kit/utilities");var Y=require("react/jsx-runtime"),_t={triangle:"M 12,4 L 20,18 H 4 L 12,4 Z",rightTriangle:"M 4,4 V 20 H 20 L 4,4 Z",rhombus:"M 12,4 L 20,12 L 12,20 L 4,12 L 12,4 Z",parallelogram:"M 7,4 H 21 L 17,20 H 3 L 7,4 Z",trapezoid:"M 6,4 H 18 L 21,20 H 3 L 6,4 Z",pentagon:"M 12,3 L 21,9 V 19 H 3 V 9 L 12,3 Z",hexagon:"M 12,3 L 20,7.5 V 16.5 L 12,21 L 4,16.5 V 7.5 L 12,3 Z",heptagon:"M 12,3 L 18.5,6 L 21,13 L 16,20 H 8 L 3,13 L 5.5,6 L 12,3 Z",octagon:"M 8.5,3 H 15.5 L 21,8.5 V 15.5 L 15.5,21 H 8.5 L 3,15.5 V 8.5 L 8.5,3 Z",heart:"M 12,21.35 L 10.55,20.03 C 5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3 C 9.24,3 10.91,3.81 12,5.09 C 13.09,3.81 14.76,3 16.5,3 C 19.58,3 22,5.42 22,8.5 C 22,12.28 18.6,15.36 13.45,20.04 L 12,21.35 Z",smiley:"M 12,3 A 9,9 0 1,0 12,21 A 9,9 0 1,0 12,3 M 9,9 A 1.5,1.5 0 1,1 9,10.5 A 1.5,1.5 0 1,1 9,9 M 15,9 A 1.5,1.5 0 1,1 15,10.5 A 1.5,1.5 0 1,1 15,9 M 8,15 C 8,15 9.5,17 12,17 C 14.5,17 16,15 16,15",sun:"M 12,7 A 5,5 0 1,1 12,17 A 5,5 0 1,1 12,7 M 12,2 V 4 M 12,20 V 22 M 4,12 H 2 M 22,12 H 20 M 19.07,4.93 L 17.66,6.34 M 6.34,17.66 L 4.93,19.07 M 4.93,4.93 L 6.34,6.34 M 17.66,17.66 L 19.07,19.07",moon:"M 12,3 A 9,9 0 1,0 12,21 A 7,7 0 0,1 12,3 Z",circle:"M 12,3 A 9,9 0 1,1 12,21 A 9,9 0 1,1 12,3 Z",arrowRight:"M 4,11 H 15.5 L 12,7.5 L 13.5,6 L 19.5,12 L 13.5,18 L 12,16.5 L 15.5,13 H 4 Z",arrowLeft:"M 20,11 H 8.5 L 12,7.5 L 10.5,6 L 4.5,12 L 10.5,18 L 12,16.5 L 8.5,13 H 20 Z",arrowUp:"M 13,20 V 8.5 L 16.5,12 L 18,10.5 L 12,4.5 L 6,10.5 L 7.5,12 L 11,8.5 V 20 Z",arrowDown:"M 11,4 V 15.5 L 7.5,12 L 6,13.5 L 12,19.5 L 18,13.5 L 16.5,12 L 13,15.5 V 4 Z",arrowLeftRight:"M 4,12 L 8,8 V 11 H 16 V 8 L 20,12 L 16,16 V 13 H 8 V 16 L 4,12 Z",arrowUpDown:"M 12,4 L 8,8 H 11 V 16 H 8 L 12,20 L 16,16 H 13 V 8 H 16 L 12,4 Z",star4:"M 12,2 L 14,10 L 22,12 L 14,14 L 12,22 L 10,14 L 2,12 L 10,10 L 12,2 Z",star5:"M 12,2 L 14.5,9.5 H 22 L 16,14 L 18.5,21.5 L 12,17 L 5.5,21.5 L 8,14 L 2,9.5 H 9.5 L 12,2 Z",star6:"M 12,2 L 15,7 L 21,6 L 17,10.5 L 19,17 L 12,14 L 5,17 L 7,10.5 L 3,6 L 9,7 L 12,2 Z",star8:"M 12,2 L 14,6 L 18,4 L 16,8 L 20,10 L 16,12 L 18,16 L 14,14 L 12,18 L 10,14 L 6,16 L 8,12 L 4,10 L 8,8 L 6,4 L 10,6 L 12,2 Z",cloud:"M 17,19 C 14.8,19 13.1,17.7 12.3,15.8 C 11.4,16 10.5,16.2 9.6,16.2 C 7,16.2 4.7,14.6 3.7,12.3 C 1.5,11.8 0,9.9 0,7.6 C 0,5 2.1,2.9 4.7,2.9 C 5.3,2.9 5.8,3 6.3,3.1 C 7.6,1.4 9.6,0.3 11.9,0.3 C 12.5,0.3 13.1,0.4 13.7,0.5 C 15,1.9 15.9,3.7 16,5.7 C 18.2,6.1 20,8.1 20,10.5 C 20,13.2 17.8,15.4 15.1,15.4 C 14.8,15.4 14.5,15.4 14.2,15.3 C 14.2,15.4 14.2,15.4 14.2,15.5 C 14.2,17.4 15.5,19 17,19 Z",lightning:"M 13,2 L 3,14 H 12 V 22 L 22,10 H 13 L 16,2 Z",plus:"M 19,13 H 13 V 19 H 11 V 13 H 5 V 11 H 11 V 5 H 13 V 11 H 19 V 13 Z",minus:"M 19,13 H 5 V 11 H 19 V 13 Z",multiply:"M 19,6.41 L 17.59,5 L 12,10.59 L 6.41,5 L 5,6.41 L 10.59,12 L 5,17.59 L 6.41,19 L 12,13.41 L 17.59,19 L 19,17.59 L 13.41,12 L 19,6.41 Z",divide:"M 12,7 A 2,2 0 1,1 12,11 A 2,2 0 1,1 12,7 M 12,17 A 2,2 0 1,1 12,21 A 2,2 0 1,1 12,17 M 5,11 H 19 V 13 H 5 V 11 Z",equal:"M 19,10 H 5 V 8 H 19 V 10 M 19,16 H 5 V 14 H 19 V 16 Z"},Ma=({slide:m,index:a,isActive:c,onSelect:h,onDelete:v,onDuplicate:s,showDelete:j,uiScale:P,appBgColor:M})=>{let{attributes:r,listeners:T,setNodeRef:g,transform:S,transition:V,isDragging:L}=(0,Me.useSortable)({id:m.id}),y={transform:Yt.CSS.Transform.toString(S),transition:V,zIndex:L?2:1,opacity:L?.5:1};return(0,Y.jsxs)("div",{ref:g,onClick:h,className:I("cursor-pointer border-[1.5px] border-solid p-2 transition-all duration-300 group relative select-none",c?"bg-white":"border-transparent hover:border-slate-200 bg-white/50 hover:bg-white"),style:R(z({},y),{borderColor:c?M:void 0}),children:[(0,Y.jsxs)("div",{className:I("text-[10px] font-bold mb-1 flex items-center justify-between transition-colors",!c&&"text-slate-400"),style:{color:c?M:void 0},children:[(0,Y.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Y.jsx)("div",R(z(z({},r),T),{className:"cursor-grab active:cursor-grabbing p-0.5 hover:bg-slate-100 text-slate-300 hover:text-slate-500",children:(0,Y.jsx)(je.GripVertical,{size:10})})),(0,Y.jsxs)("span",{children:["SLIDE ",a+1]})]}),(0,Y.jsxs)("div",{className:"flex items-center gap-1",children:[c&&(0,Y.jsx)("span",{className:"h-1.5 w-1.5",style:{backgroundColor:M}}),(0,Y.jsxs)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,Y.jsx)("button",{onClick:b=>{b.stopPropagation(),s()},className:"p-1 hover:bg-blue-50 text-slate-400 hover:text-blue-500 transition-all",title:"Duplicate Slide",children:(0,Y.jsx)(je.Copy,{size:12})}),j&&(0,Y.jsx)("button",{onClick:b=>{b.stopPropagation(),v()},className:"p-1 hover:bg-red-50 text-red-400 hover:text-red-500 transition-all",title:"Delete Slide",children:(0,Y.jsx)(je.Trash2,{size:12})})]})]})]}),(0,Y.jsx)("div",{className:"aspect-video bg-white flex items-center justify-center border border-slate-200 overflow-hidden relative group-hover:shadow-sm transition-shadow",children:(0,Y.jsx)("div",{className:"origin-center pointer-events-none select-none shrink-0",style:{width:"1200px",height:"675px",transform:`scale(${180*P/1200})`,backgroundColor:"#ffffff"},children:m.elements.sort((b,Z)=>(b.zIndex||0)-(Z.zIndex||0)).map(b=>{var U;let Z={position:"absolute",left:b.x,top:b.y,width:b.width,height:b.height,opacity:(U=b.opacity)!=null?U:1};if(b.type==="text")return(0,Y.jsx)("div",{style:R(z({},Z),{fontSize:b.fontSize,fontFamily:b.fontFamily,color:b.color,textAlign:b.textAlign||"left",fontWeight:b.isBold?"bold":"normal",fontStyle:b.isItalic?"italic":"normal",lineHeight:1.2,overflow:"hidden",wordBreak:"break-word",whiteSpace:"pre-wrap"}),children:b.content},b.id);if(b.type==="shape"){let J=_t[b.shapeType]||(b.shapeType==="ellipse"?_t.circle:null);return J?(0,Y.jsx)("svg",{viewBox:"0 0 24 24",style:R(z({},Z),{fill:b.fill}),preserveAspectRatio:"none",children:(0,Y.jsx)("path",{d:J})},b.id):(0,Y.jsx)("div",{style:R(z({},Z),{backgroundColor:b.fill,borderRadius:b.shapeType==="ellipse"?"50%":"0"})},b.id)}else if(b.type==="image")return(0,Y.jsx)("img",{src:b.src,alt:"",style:R(z({},Z),{objectFit:"contain"})},b.id);return null})})})]})},Kt=({slides:m,currentSlideIndex:a,onSelectSlide:c,onDeleteSlide:h,onDuplicateSlide:v,onReorderSlides:s,uiScale:j,appBgColor:P="#B7472A"})=>{let M=(0,be.useSensors)((0,be.useSensor)(be.PointerSensor,{activationConstraint:{distance:5}}),(0,be.useSensor)(be.KeyboardSensor,{coordinateGetter:Me.sortableKeyboardCoordinates})),r=T=>{let{active:g,over:S}=T;if(g.id!==(S==null?void 0:S.id)){let V=m.findIndex(y=>y.id===g.id),L=m.findIndex(y=>y.id===(S==null?void 0:S.id));s(V,L)}};return(0,Y.jsx)("div",{className:"bg-white border-r border-slate-100 overflow-y-auto p-4 flex flex-col gap-4",style:{width:`${256*j}px`},children:(0,Y.jsx)(be.DndContext,{sensors:M,collisionDetection:be.closestCenter,onDragEnd:r,children:(0,Y.jsx)(Me.SortableContext,{items:m.map(T=>T.id),strategy:Me.verticalListSortingStrategy,children:m.map((T,g)=>(0,Y.jsx)(Ma,{slide:T,index:g,isActive:g===a,onSelect:()=>c(g),onDelete:()=>h(g),onDuplicate:()=>v(g),showDelete:m.length>1,uiScale:j,appBgColor:P},T.id))})})})};var pe=require("react"),le=He(require("fabric")),Ae=require("lucide-react");var F=require("react/jsx-runtime"),Aa={triangle:"M 12,4 L 20,18 H 4 L 12,4 Z",rightTriangle:"M 4,4 V 20 H 20 L 4,4 Z",rhombus:"M 12,4 L 20,12 L 12,20 L 4,12 L 12,4 Z",parallelogram:"M 7,4 H 21 L 17,20 H 3 L 7,4 Z",trapezoid:"M 6,4 H 18 L 21,20 H 3 L 6,4 Z",pentagon:"M 12,3 L 21,9 V 19 H 3 V 9 L 12,3 Z",hexagon:"M 12,3 L 20,7.5 V 16.5 L 12,21 L 4,16.5 V 7.5 L 12,3 Z",heptagon:"M 12,3 L 18.5,6 L 21,13 L 16,20 H 8 L 3,13 L 5.5,6 L 12,3 Z",octagon:"M 8.5,3 H 15.5 L 21,8.5 V 15.5 L 15.5,21 H 8.5 L 3,15.5 V 8.5 L 8.5,3 Z",heart:"M 12,21.35 L 10.55,20.03 C 5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3 C 9.24,3 10.91,3.81 12,5.09 C 13.09,3.81 14.76,3 16.5,3 C 19.58,3 22,5.42 22,8.5 C 22,12.28 18.6,15.36 13.45,20.04 L 12,21.35 Z",smiley:"M 12,3 A 9,9 0 1,0 12,21 A 9,9 0 1,0 12,3 M 9,9 A 1.5,1.5 0 1,1 9,10.5 A 1.5,1.5 0 1,1 9,9 M 15,9 A 1.5,1.5 0 1,1 15,10.5 A 1.5,1.5 0 1,1 15,9 M 8,15 C 8,15 9.5,17 12,17 C 14.5,17 16,15 16,15",sun:"M 12,7 A 5,5 0 1,1 12,17 A 5,5 0 1,1 12,7 M 12,2 V 4 M 12,20 V 22 M 4,12 H 2 M 22,12 H 20 M 19.07,4.93 L 17.66,6.34 M 6.34,17.66 L 4.93,19.07 M 4.93,4.93 L 6.34,6.34 M 17.66,17.66 L 19.07,19.07",moon:"M 12,3 A 9,9 0 1,0 12,21 A 7,7 0 0,1 12,3 Z",circle:"M 12,3 A 9,9 0 1,1 12,21 A 9,9 0 1,1 12,3 Z",arrowRight:"M 4,11 H 15.5 L 12,7.5 L 13.5,6 L 19.5,12 L 13.5,18 L 12,16.5 L 15.5,13 H 4 Z",arrowLeft:"M 20,11 H 8.5 L 12,7.5 L 10.5,6 L 4.5,12 L 10.5,18 L 12,16.5 L 8.5,13 H 20 Z",arrowUp:"M 13,20 V 8.5 L 16.5,12 L 18,10.5 L 12,4.5 L 6,10.5 L 7.5,12 L 11,8.5 V 20 Z",arrowDown:"M 11,4 V 15.5 L 7.5,12 L 6,13.5 L 12,19.5 L 18,13.5 L 16.5,12 L 13,15.5 V 4 Z",arrowLeftRight:"M 4,12 L 8,8 V 11 H 16 V 8 L 20,12 L 16,16 V 13 H 8 V 16 L 4,12 Z",arrowUpDown:"M 12,4 L 8,8 H 11 V 16 H 8 L 12,20 L 16,16 H 13 V 8 H 16 L 12,4 Z",star4:"M 12,2 L 14,10 L 22,12 L 14,14 L 12,22 L 10,14 L 2,12 L 10,10 L 12,2 Z",star5:"M 12,2 L 14.5,9.5 H 22 L 16,14 L 18.5,21.5 L 12,17 L 5.5,21.5 L 8,14 L 2,9.5 H 9.5 L 12,2 Z",star6:"M 12,2 L 15,7 L 21,6 L 17,10.5 L 19,17 L 12,14 L 5,17 L 7,10.5 L 3,6 L 9,7 L 12,2 Z",star8:"M 12,2 L 14,6 L 18,4 L 16,8 L 20,10 L 16,12 L 18,16 L 14,14 L 12,18 L 10,14 L 6,16 L 8,12 L 4,10 L 8,8 L 6,4 L 10,6 L 12,2 Z",cloud:"M 17,19 C 14.8,19 13.1,17.7 12.3,15.8 C 11.4,16 10.5,16.2 9.6,16.2 C 7,16.2 4.7,14.6 3.7,12.3 C 1.5,11.8 0,9.9 0,7.6 C 0,5 2.1,2.9 4.7,2.9 C 5.3,2.9 5.8,3 6.3,3.1 C 7.6,1.4 9.6,0.3 11.9,0.3 C 12.5,0.3 13.1,0.4 13.7,0.5 C 15,1.9 15.9,3.7 16,5.7 C 18.2,6.1 20,8.1 20,10.5 C 20,13.2 17.8,15.4 15.1,15.4 C 14.8,15.4 14.5,15.4 14.2,15.3 C 14.2,15.4 14.2,15.4 14.2,15.5 C 14.2,17.4 15.5,19 17,19 Z",lightning:"M 13,2 L 3,14 H 12 V 22 L 22,10 H 13 L 16,2 Z",plus:"M 19,13 H 13 V 19 H 11 V 13 H 5 V 11 H 11 V 5 H 13 V 11 H 19 V 13 Z",minus:"M 19,13 H 5 V 11 H 19 V 13 Z",multiply:"M 19,6.41 L 17.59,5 L 12,10.59 L 6.41,5 L 5,6.41 L 10.59,12 L 5,17.59 L 6.41,19 L 12,13.41 L 17.59,19 L 19,17.59 L 13.41,12 L 19,6.41 Z",divide:"M 12,7 A 2,2 0 1,1 12,11 A 2,2 0 1,1 12,7 M 12,17 A 2,2 0 1,1 12,21 A 2,2 0 1,1 12,17 M 5,11 H 19 V 13 H 5 V 11 Z",equal:"M 19,10 H 5 V 8 H 19 V 10 M 19,16 H 5 V 14 H 19 V 16 Z"},Ba=(m,a,c,h)=>{if(a)switch(m){case"bullet-disc":return"\u2022";case"bullet-circle":return"\u25CB";case"bullet-square":return"\u25A0";case"bullet-square-outlined":return"\u25A1";case"bullet-diamond":return"\u25C6";case"bullet-arrow":return"\u27A4";case"bullet-check":return"\u2713";case"none":return"";default:return"\u2022"}else if(c){let v=h+1;switch(m){case"number-decimal":return`${v}.`;case"number-decimal-paren":return`${v})`;case"number-roman-upper":return Jt(v)+".";case"number-roman-lower":return Jt(v).toLowerCase()+".";case"number-alpha-upper":return xt(v)+".";case"number-alpha-lower":return xt(v).toLowerCase()+".";case"number-alpha-lower-paren":return xt(v).toLowerCase()+")";case"none":return"";default:return`${v}.`}}return""},Jt=m=>{let a={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},c="";for(let h in a)for(;m>=a[h];)c+=h,m-=a[h];return c},xt=m=>String.fromCharCode(64+m),Ee=class extends le.Textbox{_renderTextLine(a,c,h,v,s,j){if(super._renderTextLine(a,c,h,v,s,j),(this.isBulleted||this.isNumbered)&&this.listType!=="none"){let P=Ba(this.listType,this.isBulleted,this.isNumbered,j);if(P){c.save();let M=this.fontSize||22,r=-M*1,T=M*.6;c.font=`${this.fontStyle} ${this.fontWeight} ${T}px ${this.fontFamily}`,c.fillStyle=this.fill,c.fillText(P,v+r,s-M*.35),c.restore()}}}},et=({slide:m,onElementUpdate:a,onSelect:c,uiScale:h,onSlashCommand:v,selectedElementId:s,onAiGenerateClick:j,onAiGenerateInfographicClick:P,onUploadImageClick:M,onDeleteElement:r})=>{let T=(0,pe.useRef)(null),g=(0,pe.useRef)(null),S=(0,pe.useRef)(!1),V=(0,pe.useRef)(a),L=(0,pe.useRef)(c),y=(0,pe.useRef)(null),[b,Z]=(0,pe.useState)(1),[U,J]=(0,pe.useState)(!1),te=(0,pe.useRef)({x:0,y:0});(0,pe.useEffect)(()=>{if(!y.current)return;let k=new ResizeObserver(K=>{let _=K[0];if(_){let{width:X,height:Q}=_.contentRect,n=X/1200,f=Q/675,o=Math.min(n,f)*.95;Z(o)}});return k.observe(y.current),()=>k.disconnect()},[]),(0,pe.useEffect)(()=>{V.current=a,L.current=c},[a,c]),(0,pe.useEffect)(()=>{if(T.current&&!g.current){let k=new le.Canvas(T.current,{width:1200,height:675,backgroundColor:"white",selection:!0,preserveObjectStacking:!0});g.current=k,J(!0);let K=o=>{o.left<0&&o.set("left",0),o.top<0&&o.set("top",0);let x=o.getBoundingRect();x.left+x.width>(k.width||1200)&&o.set("left",(k.width||1200)-x.width),x.top+x.height>(k.height||675)&&o.set("top",(k.height||675)-x.height)};k.on("object:moving",o=>K(o.target)),k.on("object:scaling",o=>K(o.target));let _=o=>{var $;if(S.current)return;let x=o.target,C=($=x.get("data"))==null?void 0:$.id;x&&C&&V.current(C,z({x:x.left,y:x.top,width:x.getScaledWidth(),height:x.getScaledHeight()},x.isType("textbox")?{content:x.text,textAlign:x.textAlign,fontSize:x.fontSize,fontFamily:x.fontFamily,color:x.fill}:{fill:x.fill}))};k.on("object:modified",_),k.on("text:changed",_);let X=o=>{if(!(!o||!o.isType("textbox")))return{fontFamily:o.fontFamily,fontSize:o.fontSize,isBold:o.fontWeight==="bold",isItalic:o.fontStyle==="italic",isUnderline:o.underline,textAlign:o.textAlign,color:o.fill,highlightColor:o.textBackgroundColor,isBulleted:!!o.isBulleted,isNumbered:!!o.isNumbered}},Q=(o,x=!1)=>{var C;try{let $=(C=T.current)==null?void 0:C.getBoundingClientRect();if(!$||!o)return;let D=0,se=0,ne=(ae,E)=>typeof ae=="object"&&ae!==null&&typeof ae[E]=="function",G=ne(o,"isType")&&o.isType("textbox");if(G&&o.isEditing){let E=(W=>{try{let oe=W.selectionStart||0;if(ne(W,"getCursorCoords"))return W.getCursorCoords(oe);if(ne(W,"_getCursorCoords"))return W._getCursorCoords(oe)}catch(oe){}return null})(o);if(E){let W=le.util.transformPoint(new le.Point(E.left,E.top),ne(o,"calcTransformMatrix")?o.calcTransformMatrix():[1,0,0,1,0,0]),oe=k.viewportTransform||[1,0,0,1,0,0],Se=le.util.transformPoint(W,oe);D=$.left+Se.x*b,se=$.top+Se.y*b}else{let W=ne(o,"getBoundingRect")?o.getBoundingRect():{left:0,top:0,width:0,height:0};D=$.left+(W.left+W.width/2)*b,se=$.top+W.top*b}}else{let ae=ne(o,"getBoundingRect")?o.getBoundingRect():{left:te.current.x,top:te.current.y,width:0,height:0};D=$.left+(ae.left+ae.width/2)*b,se=$.top+ae.top*b}if(D&&se){let ae=x?"text-selection":G?"textbox":"default",E=D,W=se;ae==="default"?(E=D+5,W=se+5):(E=D-220,W=se-140),v({x:E,y:W},ae,X(o))}}catch($){console.error("Critical error in triggerSlashMenu:",$)}},n=o=>{var C,$;let x=((C=o.selected)==null?void 0:C[0])||o.target;if(x){let D=($=x.get("data"))==null?void 0:$.id;L.current(D),x.isType("textbox")&&!S.current&&Q(x)}};k.on("selection:created",n),k.on("selection:updated",n),k.on("selection:cleared",()=>{L.current(null),v({x:0,y:0},"default")}),k.on("text:selection:changed",o=>{let x=o.target;x&&x.isType("textbox")&&x.selectionStart!==x.selectionEnd&&Q(x,!0)}),k.on("mouse:move",o=>{o.pointer&&(te.current={x:o.pointer.x,y:o.pointer.y})});let f=o=>{let x=g.current;if(!x)return;let C=x.getActiveObject();if(o.key==="/"){o.preventDefault(),Q(C||{isType:()=>!1,getBoundingRect:()=>({left:te.current.x,top:te.current.y,width:0,height:0})});return}if(C&&C.isType("textbox")&&C.isEditing||!C)return;let $=o.shiftKey?10:1,D=!1;switch(o.key){case"ArrowLeft":C.set("left",C.left-$),D=!0;break;case"ArrowRight":C.set("left",C.left+$),D=!0;break;case"ArrowUp":C.set("top",C.top-$),D=!0;break;case"ArrowDown":C.set("top",C.top+$),D=!0;break}D&&(K(C),x.requestRenderAll(),_({target:C}))};window.addEventListener("keydown",f),k._keyboardListener=f}return()=>{if(g.current){let k=g.current._keyboardListener;k&&window.removeEventListener("keydown",k),g.current.dispose(),g.current=null}}},[]),(0,pe.useEffect)(()=>{if(!g.current)return;let k=g.current;(async()=>{S.current=!0;let _=k.getObjects(),X=new Set(m.elements.map(n=>n.id));_.forEach(n=>{var o;let f=(o=n.get("data"))==null?void 0:o.id;f&&!X.has(f)&&k.remove(n)});let Q=[...m.elements].sort((n,f)=>(n.zIndex||0)-(f.zIndex||0));for(let n of Q){let f=_.find(o=>{var x;return((x=o.get("data"))==null?void 0:x.id)===n.id});if(f&&f.type==="textbox"&&!(f instanceof Ee)&&(k.remove(f),f=null),f){if(f===k.getActiveObject()&&f.isType("textbox")&&f.isEditing)continue;let o={left:n.x,top:n.y,opacity:n.opacity!==void 0?n.opacity:1,zIndex:n.zIndex};n.type==="text"&&f.isType("textbox")?(o.text=n.content||" ",o.fontSize=n.fontSize||22,o.fill=n.color||"#000000",o.textBackgroundColor=n.highlightColor||"",o.textAlign=n.textAlign||"left",o.fontWeight=n.isBold?"bold":"normal",o.fontStyle=n.isItalic?"italic":"normal",o.underline=n.isUnderline||!1,o.linethrough=n.isStrikethrough||!1,o.charSpacing=n.charSpacing||0,o.fontFamily=n.fontFamily||"Arial",f.isBulleted=n.isBulleted,f.isNumbered=n.isNumbered,f.listType=n.listType,o.width=Math.max(n.width||50,10)):n.type==="shape"?(o.fill=n.fill||"#cccccc",o.scaleX=(n.width||50)/(f.width||1),o.scaleY=(n.height||50)/(f.height||1)):n.type==="image"&&(o.scaleX=(n.width||100)/(f.width||1),o.scaleY=(n.height||100)/(f.height||1)),f.set(o)}else{let o=null,x={left:n.x,top:n.y,data:{id:n.id},originX:"left",originY:"top",opacity:n.opacity!==void 0?n.opacity:1};if(n.type==="text")o=new Ee(n.content||" ",R(z({},x),{width:Math.max(n.width||200,10),fontSize:n.fontSize||22,fill:n.color||"#000000",backgroundColor:n.highlightColor||"",fontFamily:n.fontFamily||"Inter, Arial, sans-serif",textAlign:n.textAlign||"left",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isItalic?"italic":"normal",underline:n.isUnderline||!1,linethrough:n.isStrikethrough||!1,charSpacing:n.charSpacing||0,splitByGrapheme:!1,objectCaching:!1})),o.isBulleted=n.isBulleted,o.isNumbered=n.isNumbered,o.listType=n.listType;else if(n.type==="shape"){let C=n.fill||"#3b82f6";if(n.shapeType==="ellipse")o=new le.Circle(R(z({},x),{radius:(n.width||100)/2,scaleY:(n.height||100)/(n.width||100),fill:C}));else if(n.shapeType==="rect")o=new le.Rect(R(z({},x),{width:n.width||100,height:n.height||100,fill:C}));else{let $=Aa[n.shapeType];if($){o=new le.Path($,R(z({},x),{fill:C}));let D=o;D.set({scaleX:(n.width||100)/(D.width||1),scaleY:(n.height||100)/(D.height||1)})}else o=new le.Rect(R(z({},x),{width:n.width||100,height:n.height||100,fill:C}))}}else if(n.type==="image")try{let C=await le.FabricImage.fromURL(n.src);C.set(R(z({},x),{scaleX:(n.width||100)/(C.width||1),scaleY:(n.height||100)/(C.height||1)})),o=C}catch(C){console.error(C)}o&&k.add(o)}}k.renderAll(),S.current=!1})()},[m,U]);let N=m.elements.find(k=>k.id===s);return(0,F.jsx)("div",{ref:y,className:"w-full h-full flex items-center justify-center overflow-hidden relative",children:(0,F.jsxs)("div",{className:"border border-slate-200 overflow-hidden bg-white shadow-xl transition-all duration-300 ease-out shrink-0 relative",style:{transform:`scale(${b})`,transformOrigin:"center center"},children:[(0,F.jsx)("canvas",{ref:T}),m.elements.length===0&&(0,F.jsx)("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none select-none animate-in fade-in duration-700",children:(0,F.jsx)("div",{className:"flex flex-col items-center gap-4 text-slate-300",children:(0,F.jsx)("div",{className:"flex flex-col items-center gap-1 text-center",children:(0,F.jsxs)("h1",{className:"text-2xl font-medium text-slate-400",children:["Click ",(0,F.jsx)("span",{className:"px-2 py-0.5 bg-slate-100 rounded-md text-slate-500 font-bold",children:"/"})," for options"]})})})}),N&&N.type==="image"&&(0,F.jsxs)("div",{className:"absolute z-[5000] flex flex-col w-96 bg-white border border-slate-200 shadow-2xl rounded-2xl overflow-hidden animate-in fade-in zoom-in duration-200",style:{left:N.x+N.width/2>600?`${N.x-12}px`:`${N.x+N.width+12}px`,top:`${N.y+N.height/2}px`,transform:N.x+N.width/2>600?"translate(-100%, -50%)":"translate(0, -50%)"},children:[(0,F.jsx)("div",{className:"px-5 py-3.5 text-sm uppercase tracking-wider font-bold text-slate-400 bg-slate-50/50 border-b border-slate-100",children:"Image Actions"}),(0,F.jsxs)("div",{className:"p-2.5 flex flex-col gap-1",children:[(0,F.jsxs)("button",{onClick:k=>{k.stopPropagation(),j()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,F.jsx)("div",{className:"p-3 rounded-xl bg-blue-50 text-blue-600 group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,F.jsx)(Ae.Sparkles,{size:28})}),(0,F.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,F.jsx)("span",{className:"text-lg font-bold text-slate-900",children:"AI Generate Image"}),(0,F.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Create an image with AI prompt"})]})]}),(0,F.jsxs)("button",{onClick:k=>{k.stopPropagation(),P()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,F.jsx)("div",{className:"p-3 rounded-xl bg-purple-50 text-purple-600 group-hover:bg-purple-600 group-hover:text-white transition-colors",children:(0,F.jsx)(Ae.PieChart,{size:28})}),(0,F.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,F.jsx)("span",{className:"text-lg font-bold text-slate-900",children:"AI Infographic"}),(0,F.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Generate chart or diagram"})]})]}),(0,F.jsxs)("button",{onClick:k=>{k.stopPropagation(),M()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,F.jsx)("div",{className:"p-3 rounded-xl bg-slate-100 text-slate-500 group-hover:bg-slate-200 group-hover:text-slate-700 transition-colors",children:(0,F.jsx)(Ae.Image,{size:28})}),(0,F.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,F.jsx)("span",{className:"text-lg font-bold text-slate-700",children:"Change Image"}),(0,F.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Replace with local file"})]})]}),(0,F.jsx)("div",{className:"h-[1px] bg-slate-100 my-1 mx-3"}),(0,F.jsxs)("button",{onClick:k=>{k.stopPropagation(),r()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-red-50 group",children:[(0,F.jsx)("div",{className:"p-3 rounded-xl bg-red-50 text-red-500 group-hover:bg-red-500 group-hover:text-white transition-colors",children:(0,F.jsx)(Ae.Trash2,{size:28})}),(0,F.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,F.jsx)("span",{className:"text-lg font-bold text-red-600",children:"Delete Element"}),(0,F.jsx)("span",{className:"text-sm text-red-400/80 truncate leading-tight",children:"Remove from slide"})]})]})]})]})]})})};var Qt=He(require("pptxgenjs"));var qe=class{async export(a){var r,T;let c=new Qt.default,h=((r=a.layout)==null?void 0:r.width)||12192e3,v=((T=a.layout)==null?void 0:T.height)||6858e3,s=1200,j=675,P=g=>g/s*(h/914400),M=g=>g/j*(v/914400);a.slides.forEach(g=>{let S=c.addSlide();[...g.elements].sort((L,y)=>L.zIndex-y.zIndex).forEach(L=>{var Z,U;let y=L.opacity!==void 0?(1-L.opacity)*100:0,b={x:P(L.x),y:M(L.y),w:P(L.width),h:M(L.height)};if(L.type==="text")S.addText(L.content,R(z({},b),{fontSize:(L.fontSize||18)/2,color:((Z=L.color)==null?void 0:Z.replace("#",""))||"000000",fontFace:L.fontFamily||"Arial"}));else if(L.type==="image")S.addImage(R(z({},b),{path:L.src,transparency:y}));else if(L.type==="shape"){let J=L.shapeType==="ellipse"?c.ShapeType.ellipse:c.ShapeType.rect;S.addShape(J,R(z({},b),{fill:{color:((U=L.fill)==null?void 0:U.replace("#",""))||"CCCCCC",transparency:y>0?Math.min(y+10,100):0}}))}})}),await c.writeFile({fileName:"presentation.pptx"})}};var Et=He(require("jszip")),Xe=class{constructor(){this.slideWidth=12192e3;this.slideHeight=6858e3;this.CANVAS_WIDTH=1200;this.CANVAS_HEIGHT=675}async parse(a){var T,g;let c=a;if(typeof a=="string"){let S=await fetch(a);if(!S.ok){let V=S.status,L=S.statusText,y="";try{let b=await S.json();y=b.details||b.error||""}catch(b){}throw new Error(`Failed to fetch PPTX from ${a}: ${V} ${L} ${y?`(${y})`:""}`)}c=await S.arrayBuffer()}let h=await Et.default.loadAsync(c),v=await((T=h.file("ppt/presentation.xml"))==null?void 0:T.async("string"));if(!v)throw new Error("Invalid PPTX");let j=new DOMParser().parseFromString(v,"text/xml"),P=this.findFirstByLocalName(j,"sldSz");P&&(this.slideWidth=parseInt(this.getAttr(P,"cx")||"12192000"),this.slideHeight=parseInt(this.getAttr(P,"cy")||"6858000"));let M=Array.from(j.getElementsByTagNameNS("*","sldId")),r=[];for(let S=0;S<M.length;S++){let V=S+1,L=`ppt/slides/slide${V}.xml`,y=await((g=h.file(L))==null?void 0:g.async("string"));if(y){let b=await this.parseSlide(y,V,h);r.push(b)}}return{slides:r,layout:{width:this.slideWidth,height:this.slideHeight}}}getAttr(a,c){return a.getAttribute(c)||a.getAttribute(`a:${c}`)||a.getAttribute(`p:${c}`)||a.getAttribute(`r:${c}`)}findFirstByLocalName(a,c){let h=a.getElementsByTagNameNS("*",c);return h.length>0?h[0]:null}findAllByLocalName(a,c){return Array.from(a.getElementsByTagNameNS("*",c))}scaleX(a){return a/this.slideWidth*this.CANVAS_WIDTH}scaleY(a){return a/this.slideHeight*this.CANVAS_HEIGHT}parseColor(a){let c=this.findFirstByLocalName(a,"srgbClr");if(c){let v=`#${this.getAttr(c,"val")}`,s=this.findFirstByLocalName(c,"alpha"),j=s?parseInt(this.getAttr(s,"val")||"100000")/1e5:1;return{color:v,opacity:j}}let h=this.findFirstByLocalName(a,"schemeClr");if(h){let v=this.findFirstByLocalName(h,"alpha");return{color:"#000000",opacity:v?parseInt(this.getAttr(v,"val")||"100000")/1e5:1}}return{color:"#000000",opacity:1}}async resolveImage(a,c,h){var r,T;let v=await((r=h.file(`ppt/slides/_rels/slide${c}.xml.rels`))==null?void 0:r.async("string"));if(!v)return null;let j=new DOMParser().parseFromString(v,"text/xml"),P=Array.from(j.getElementsByTagName("Relationship")).find(g=>g.getAttribute("Id")===a),M=P==null?void 0:P.getAttribute("Target");if(M){let g=(M.startsWith("../")?`ppt/${M.substring(3)}`:`ppt/slides/${M}`).replace("ppt/slides/../","ppt/");return await((T=h.file(g))==null?void 0:T.async("blob"))||null}return null}async parseSlide(a,c,h){let s=new DOMParser().parseFromString(a,"text/xml"),j=[],P=0,M=this.findFirstByLocalName(s,"bg");if(M){let g=this.findFirstByLocalName(M,"blip"),S=(g==null?void 0:g.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","embed"))||(g==null?void 0:g.getAttribute("r:embed"));if(S){let V=await this.resolveImage(S,c,h);V&&j.push({id:`bg-${c}`,type:"image",src:URL.createObjectURL(V),x:0,y:0,width:this.CANVAS_WIDTH,height:this.CANVAS_HEIGHT,zIndex:P++,opacity:1})}}let r=this.findFirstByLocalName(s,"spTree");if(!r)return{id:`slide-${c}`,elements:j};let T=Array.from(r.children);for(let g of T){let S=g.localName;if(S==="sp"){let V=this.findFirstByLocalName(g,"txBody"),L=this.findFirstByLocalName(g,"nvSpPr"),y=L?this.findFirstByLocalName(L,"nvPr"):null,b=y?this.findFirstByLocalName(y,"ph"):null,Z=b?this.getAttr(b,"type"):null,U=b&&(!Z||Z==="body"),J=this.findFirstByLocalName(g,"xfrm"),te=J?this.findFirstByLocalName(J,"off"):null,N=J?this.findFirstByLocalName(J,"ext"):null;if(V&&te&&N){let K=this.findAllByLocalName(V,"p"),_="",X=18,Q="#000000",n=1,f=!1,o=!1;for(let x of K){let C=this.findFirstByLocalName(x,"pPr"),$=C?this.findFirstByLocalName(C,"buNone"):null,D="";C&&!$?this.findFirstByLocalName(C,"buAutoNum")?o=!0:(this.findFirstByLocalName(C,"buChar")||parseInt(this.getAttr(C,"indent")||"0")<0||U)&&(f=!0):!C&&U&&(f=!0);let se=this.findAllByLocalName(x,"r");for(let xe of se){let ae=this.findFirstByLocalName(xe,"t");ae&&(D+=ae.textContent);let E=this.findFirstByLocalName(xe,"rPr");if(E){let W=this.getAttr(E,"sz");W&&(X=parseInt(W)/100*2);let oe=this.parseColor(E);Q=oe.color,n=oe.opacity}}let ne=/^\s*([•\u2022\u2023\u25E6\u2043\u2219])\s+/;D.match(ne)&&(f=!0,D=D.replace(ne,"")),_+=D+`
3
+ `);var B=require("react");var de=He(require("react")),w=require("lucide-react");var Wt=require("clsx"),qt=require("tailwind-merge");function I(...m){return(0,qt.twMerge)((0,Wt.clsx)(m))}var e=require("react/jsx-runtime"),Ca=["Inter","Lato","Open Sans","Poppins","Roboto","Roboto Slab","Georgia","Playfair Display","Merriweather","Nunito Sans","Montserrat","Oswald","Raleway","Ubuntu","Lora","PT Sans","PT Serif","Play","Arvo","Kanit","Times New Roman","Arial"],La=[12,14,16,18,20,24,28,32,36,48,64,72,96],Sa=[{name:"Basic Shapes",shapes:["rect","circle","triangle","rightTriangle","rhombus","parallelogram","trapezoid","pentagon","hexagon","heptagon","octagon","heart","smiley","sun","moon"]},{name:"Arrows",shapes:["arrowRight","arrowLeft","arrowUp","arrowDown","arrowLeftRight","arrowUpDown"]},{name:"Stars & Symbols",shapes:["star4","star5","star6","star8","cloud","lightning"]},{name:"Equation Shapes",shapes:["plus","minus","multiply","divide","equal"]}],za=({type:m,className:a})=>{switch(m){case"rect":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",fill:"currentColor"})});case"circle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor"})});case"triangle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4L20 18H4L12 4Z",fill:"currentColor"})});case"rightTriangle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 4V20H20L4 4Z",fill:"currentColor"})});case"rhombus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4L20 12L12 20L4 12L12 4Z",fill:"currentColor"})});case"parallelogram":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M7 4H21L17 20H3L7 4Z",fill:"currentColor"})});case"trapezoid":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M6 4H18L21 20H3L6 4Z",fill:"currentColor"})});case"pentagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L21 9V19H3V9L12 3Z",fill:"currentColor"})});case"hexagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L20 7.5V16.5L12 21L4 16.5V7.5L12 3Z",fill:"currentColor"})});case"heptagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L18.5 6L21 13L16 20H8L3 13L5.5 6L12 3Z",fill:"currentColor"})});case"octagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M8.5 3H15.5L21 8.5V15.5L15.5 21H8.5L3 15.5V8.5L8.5 3Z",fill:"currentColor"})});case"heart":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",fill:"currentColor"})});case"smiley":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.2",stroke:"currentColor",strokeWidth:"2"}),(0,e.jsx)("circle",{cx:"9",cy:"9",r:"1.5",fill:"currentColor"}),(0,e.jsx)("circle",{cx:"15",cy:"9",r:"1.5",fill:"currentColor"}),(0,e.jsx)("path",{d:"M8 15C8 15 9.5 17 12 17C14.5 17 16 15 16 15",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]});case"sun":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"}),(0,e.jsx)("path",{d:"M12 2V4M12 20V22M4 12H2M22 12H20M19.07 4.93L17.66 6.34M6.34 17.66L4.93 19.07M4.93 4.93L6.34 6.34M17.66 17.66L19.07 19.07",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]});case"moon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9 7 7 0 0 1-9-9",fill:"currentColor"})});case"arrowRight":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 11h11.5l-3.5-3.5 1.5-1.5 6 6-6 6-1.5-1.5 3.5-3.5H4z",fill:"currentColor"})});case"arrowLeft":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M20 11H8.5l3.5-3.5L10.5 6l-6 6 6 6 1.5-1.5-3.5-3.5H20z",fill:"currentColor"})});case"arrowUp":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M13 20V8.5l3.5 3.5 1.5-1.5-6-6-6 6 1.5 1.5 3.5-3.5V20z",fill:"currentColor"})});case"arrowDown":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M11 4v11.5l-3.5-3.5-1.5 1.5 6 6 6-6-1.5-1.5-3.5 3.5V4z",fill:"currentColor"})});case"arrowLeftRight":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 12l4-4v3h8V8l4 4-4 4v-3H8v3l-4-4z",fill:"currentColor"})});case"arrowUpDown":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4l-4 4h3v8H8l4 4 4-4h-3V8h3l-4-4z",fill:"currentColor"})});case"star4":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2 8 8 2-8 2-2 8-2-8-8-2 8-2 2-8z",fill:"currentColor"})});case"star5":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2.5 7.5H22l-6 4.5 2.5 7.5-6.5-4.5-6.5 4.5 2.5-7.5-6-4.5h7.5L12 2z",fill:"currentColor"})});case"star6":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l3 5 6-1-4 4.5 2 6.5-7-3-7 3 2-6.5-4-4.5 6 1 3-5z",fill:"currentColor"})});case"star8":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2 4 4-2-2 4 4 2-4 2 2 4-4-2-2 4-2-4-4 2 2-4-4-2 4-2-2-4 4 2 2-4z",fill:"currentColor"})});case"cloud":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M17.5 19c-3 0-5.5-2.5-5.5-5.5 0-.2 0-.4.1-.6-2-.8-3.6-2.5-4.1-4.7C6.5 7.4 5 6 3 6c-1.7 0-3 1.3-3 3s1.3 3 3 3c.4 0 .8-.1 1.2-.2C4.1 13 5 14.5 6.5 15.5c.3 1.8 1.4 3.4 3 4.3.4.2.8.3 1.2.4 1.2.4 2.5.6 3.8.6 4.4 0 8-3.6 8-8s-3.6-8-8-8c-.4 0-.8 0-1.2.1-1.2.2-2.3.7-3.2 1.5C11 4.2 12.4 3.5 14 3.5c4.1 0 7.5 3.4 7.5 7.5s-1.8 7.5-4 8z",fill:"currentColor",transform:"scale(0.8) translate(3,3)"})});case"lightning":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M13 2L3 14h9v8l10-12h-9l3-8z",fill:"currentColor"})});case"plus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})});case"minus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})});case"multiply":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:"currentColor"})});case"divide":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"7",r:"2",fill:"currentColor"}),(0,e.jsx)("circle",{cx:"12",cy:"17",r:"2",fill:"currentColor"}),(0,e.jsx)("rect",{x:"5",y:"11",width:"14",height:"2",fill:"currentColor"})]});case"equal":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 10H5V8h14v2zm0 6H5v-2h14v2z",fill:"currentColor"})});default:return(0,e.jsx)("div",{className:"w-6 h-6 bg-slate-200 rounded-sm"})}},Ia=({onAddShape:m,uiScale:a})=>{let[c,h]=(0,de.useState)(!1);return de.default.useEffect(()=>(window._toggleShapesMenu=()=>h(!c),()=>{window._toggleShapesMenu=void 0}),[c]),c?(0,e.jsx)("div",{className:"absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-2xl shadow-2xl p-4 overflow-y-auto z-[100] animate-in fade-in zoom-in-95 duration-200",style:{width:`${320*a}px`,maxHeight:`${480*a}px`},children:(0,e.jsx)("div",{className:"flex flex-col gap-6",children:Sa.map(v=>(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400 px-1",style:{fontSize:`${10*a}px`},children:v.name}),(0,e.jsx)("div",{className:"grid grid-cols-5 gap-1",children:v.shapes.map(s=>(0,e.jsx)("button",{onClick:()=>{m(s),h(!1)},className:"aspect-square hover:bg-slate-50 rounded-lg flex items-center justify-center border border-transparent hover:border-slate-100 transition-all group p-1",title:s,children:(0,e.jsx)("div",{className:"w-full h-full bg-slate-100 rounded-sm group-hover:bg-blue-100 group-hover:scale-110 transition-all flex items-center justify-center overflow-hidden p-1.5",children:(0,e.jsx)(za,{type:s,className:"w-full h-full text-slate-400 group-hover:text-blue-600 transition-colors"})})},s))})]},v.name))})}):null},Xt=({onAddText:m,onAddImage:a,onAddShape:c,onAddSlide:h,onExport:v,onFormatText:s,onDeleteElement:j,onApplyLayout:P,onPlay:M,selectedElement:r,appName:T,onAiAction:g,onAiResponseAction:S,aiResponse:V,isAiLoading:L,onNewPresentation:y,onLoadPresentation:b,appBgColor:Z="#B7472A",uiScale:U,source:J,onGenerateImageClick:te,onGenerateInfographicClick:N,onUploadImageClick:k})=>{let K=de.default.useRef(null),[_,X]=(0,de.useState)("Home"),[Q,n]=(0,de.useState)(!1),[f,o]=(0,de.useState)(!1),[x,C]=(0,de.useState)(!1),[$,D]=(0,de.useState)(!1),[se,ne]=(0,de.useState)("file"),[G,xe]=(0,de.useState)(""),[ae,E]=(0,de.useState)(!1),[W,oe]=(0,de.useState)(!1),[Se,me]=(0,de.useState)(!1),[Ne,ve]=(0,de.useState)(!1),fe=H=>{if(!O||!r)return;let ie=r.content||"",he=ie;switch(H){case"sentence":he=ie.charAt(0).toUpperCase()+ie.slice(1).toLowerCase();break;case"lowercase":he=ie.toLowerCase();break;case"uppercase":he=ie.toUpperCase();break;case"capitalize":he=ie.split(" ").map(ke=>ke.charAt(0).toUpperCase()+ke.slice(1).toLowerCase()).join(" ");break;case"toggle":he=ie.split("").map(ke=>ke===ke.toUpperCase()?ke.toLowerCase():ke.toUpperCase()).join("");break}s({content:he}),E(!1)},O=(r==null?void 0:r.type)==="text",tt=(r==null?void 0:r.type)==="shape",at=(r==null?void 0:r.type)==="image",rt="#B7472A";return(0,e.jsxs)("div",{className:"flex flex-col border-b border-slate-200 bg-white z-50 select-none",style:{fontSize:`${12*U}px`},children:[(0,e.jsxs)("div",{className:"bg-white flex items-center justify-stretch border-b border-slate-200/60 transition-all duration-300 relative z-[1000]",style:{height:`${140*U}px`,overflow:"visible"},children:[(0,e.jsxs)("div",{className:I("flex-1 flex flex-col items-center border-r border-slate-100 px-3 gap-1 h-full py-2",U<.84?"min-w-0":"min-w-fit"),children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto",children:[(0,e.jsxs)("button",{onClick:h,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg group transition-all min-w-[64px]",children:[(0,e.jsx)("div",{className:"bg-orange-50 p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Plus,{size:20,style:{color:Z}})}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700",children:"New Slide"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{onClick:()=>n(!Q),className:I("flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg transition-all min-w-[64px]",Q&&"bg-slate-100"),children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg",children:(0,e.jsx)(w.Layout,{size:20,className:"text-slate-500"})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Layout"})]}),Q&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-2xl shadow-3xl p-2 w-60 flex flex-col gap-1 z-[100] animate-in fade-in zoom-in-95 duration-200 ring-4 ring-black/5",children:[(0,e.jsxs)("button",{onClick:()=>{P("title"),n(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-lg group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.FileText,{size:18})}),"Title Slide"]}),(0,e.jsxs)("button",{onClick:()=>{P("content"),n(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-emerald-50 text-emerald-600 rounded-lg group-hover:bg-emerald-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.List,{size:18})}),"Title & Content"]}),(0,e.jsxs)("button",{onClick:()=>{P("split"),n(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-purple-50 text-purple-600 rounded-lg group-hover:bg-purple-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.Columns,{size:18})}),"Two Columns"]})]})]})]}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Slides"})]}),(0,e.jsxs)("div",{className:I("flex flex-col border-r border-slate-200 h-full py-2 relative",U<.85?"px-2":"px-4"),children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mt-2 mb-3",children:[(0,e.jsxs)("div",{className:"flex items-center bg-white border border-slate-300 rounded-[3px] h-[28px] overflow-hidden",children:[(0,e.jsx)("select",{disabled:!O,value:(r==null?void 0:r.fontFamily)||"Open Sans",onChange:H=>s({fontFamily:H.target.value}),className:I("h-full px-1.5 text-[13px] text-slate-800 font-normal bg-transparent outline-none disabled:opacity-50 appearance-none cursor-pointer",U<.85?"w-20":"w-32"),children:Ca.map(H=>(0,e.jsx)("option",{value:H,children:H},H))}),(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400 mr-1"})]}),(0,e.jsxs)("div",{className:"flex items-center bg-white border border-slate-300 rounded-[3px] h-[28px] overflow-hidden w-15",children:[(0,e.jsx)("select",{disabled:!O,value:(r==null?void 0:r.fontSize)||10,onChange:H=>s({fontSize:parseInt(H.target.value)}),className:"h-full w-full px-1 text-[12.5px] text-slate-800 font-normal bg-transparent outline-none disabled:opacity-50 appearance-none cursor-pointer text-center",children:La.map(H=>(0,e.jsx)("option",{value:H,children:H},H))}),(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400 mr-0.5"})]}),(0,e.jsxs)("button",{disabled:!O,onClick:()=>s({fontSize:Math.min(200,((r==null?void 0:r.fontSize)||24)+2)}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Increase Font Size",children:[(0,e.jsx)("span",{className:"text-[16px] font-semibold text-slate-700",children:"A"}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700 -ml-0.5 -mt-1",children:"\u25B2"})]}),(0,e.jsxs)("button",{disabled:!O,onClick:()=>s({fontSize:Math.max(8,((r==null?void 0:r.fontSize)||24)-2)}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Decrease Font Size",children:[(0,e.jsx)("span",{className:"text-[14px] font-semibold text-slate-700",children:"A"}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700 -ml-0.5 mt-1",children:"\u25BC"})]}),(0,e.jsxs)("button",{disabled:!O,onClick:()=>s({isBold:!1,isItalic:!1,isUnderline:!1,highlightColor:"",color:"#000000",isStrikethrough:!1}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Clear All Formatting",children:[(0,e.jsx)("span",{className:"text-[16px] font-semibold text-slate-700",children:"A"}),(0,e.jsx)(w.Eraser,{size:11,className:"text-pink-500 -ml-0.5"})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)("button",{disabled:!O,onClick:()=>s({isBold:!r.isBold}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isBold?"bg-blue-100":"hover:bg-slate-100"),title:"Bold",children:(0,e.jsx)("span",{className:`text-[17px] font-black ${r!=null&&r.isBold?"text-slate-900":"text-slate-700"}`,children:"B"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>s({isItalic:!r.isItalic}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isItalic?"bg-blue-100":"hover:bg-slate-100"),title:"Italic",children:(0,e.jsx)("span",{className:`text-[17px] font-semibold italic ${r!=null&&r.isItalic?"text-slate-900":"text-slate-700"}`,style:{fontFamily:"serif"},children:"I"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>s({isUnderline:!r.isUnderline}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isUnderline?"bg-blue-100":"hover:bg-slate-100"),title:"Underline",children:(0,e.jsx)("span",{className:`text-[17px] font-semibold underline underline-offset-2 ${r!=null&&r.isUnderline?"text-slate-900":"text-slate-700"}`,children:"U"})}),(0,e.jsxs)("button",{disabled:!O,onClick:()=>s({isStrikethrough:!r.isStrikethrough}),className:I("h-8 px-1.5 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isStrikethrough?"bg-blue-100":"hover:bg-slate-100"),title:"Strikethrough",children:[(0,e.jsx)("span",{className:`text-[12px] font-medium line-through ${r!=null&&r.isStrikethrough?"text-slate-900":"text-slate-600"}`,children:"abc"}),(0,e.jsx)(w.ChevronDown,{size:12,className:"text-slate-400 ml-0.5"})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{disabled:!O,onClick:()=>oe(!W),className:I("h-8 px-1.5 flex flex-col items-center justify-center rounded-[3px] transition-all disabled:opacity-40",W?"bg-slate-100":"hover:bg-slate-100"),title:"Character Spacing",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)("span",{className:"text-[12px] font-bold text-slate-700",children:"A"}),(0,e.jsx)("span",{className:"text-[12px] font-bold text-slate-700 -ml-0.5",children:"V"}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 ml-0.5"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-0",children:[(0,e.jsx)("span",{className:"text-[7px] text-blue-500",children:"\u25C0"}),(0,e.jsx)("div",{className:"w-2.5 h-[1px] bg-blue-500"}),(0,e.jsx)("span",{className:"text-[7px] text-blue-500",children:"\u25B6"})]})]}),W&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl py-1 w-32 z-[100] animate-in fade-in zoom-in-95 duration-150",children:[(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:-50}),oe(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Very Tight",(r==null?void 0:r.charSpacing)===-50&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:-25}),oe(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Tight",(r==null?void 0:r.charSpacing)===-25&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:0}),oe(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Normal",((r==null?void 0:r.charSpacing)===0||!(r!=null&&r.charSpacing))&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:25}),oe(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Loose",(r==null?void 0:r.charSpacing)===25&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:50}),oe(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Very Loose",(r==null?void 0:r.charSpacing)===50&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,e.jsx)("button",{className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 disabled:opacity-50",children:"More Spacing..."})]})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{disabled:!O,onClick:()=>E(!ae),className:"h-8 px-1.5 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Change Case",children:[(0,e.jsx)("span",{className:"text-[14px] font-medium text-slate-700",children:"Aa"}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 ml-0.5"})]}),ae&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl py-1 w-44 z-[100] animate-in fade-in zoom-in-95 duration-150",children:[(0,e.jsxs)("button",{onClick:()=>fe("sentence"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400",children:"Aa"})," Sentence case."]}),(0,e.jsxs)("button",{onClick:()=>fe("lowercase"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"l"})," lowercase"]}),(0,e.jsxs)("button",{onClick:()=>fe("uppercase"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"U"})," UPPERCASE"]}),(0,e.jsxs)("button",{onClick:()=>fe("capitalize"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"C"})," Capitalize Each Word"]}),(0,e.jsxs)("button",{onClick:()=>fe("toggle"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"t"})," tOGGLE cASE"]})]})]}),(0,e.jsx)("div",{className:"w-[1px] h-5 bg-slate-200 mx-1.5"}),(0,e.jsxs)("div",{className:"relative flex items-center",children:[(0,e.jsxs)("button",{disabled:!O,className:I("w-9 h-7.5 flex flex-col items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.highlightColor?"bg-slate-100":"hover:bg-slate-100"),title:"Text Highlight Color",children:[(0,e.jsx)(w.Highlighter,{size:21,strokeWidth:2.5,className:r!=null&&r.highlightColor?"text-slate-900":"text-slate-500"}),(0,e.jsx)("div",{className:"absolute top-[24px] left-1.5 right-1.5 h-1.5",style:{backgroundColor:(r==null?void 0:r.highlightColor)||"transparent"}})]}),(0,e.jsx)("input",{type:"color",disabled:!O,className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full disabled:cursor-not-allowed",value:(r==null?void 0:r.highlightColor)||"#ffff00",onChange:H=>s({highlightColor:H.target.value}),title:"Choose Highlight Color"}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 -ml-0.5"})]}),(0,e.jsxs)("div",{className:"relative flex items-center",children:[(0,e.jsxs)("button",{className:"w-9 h-7.5 flex flex-col items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all",title:"Font Color",children:[(0,e.jsx)("span",{className:"text-[16px] font-black text-slate-800 leading-none",children:"A"}),(0,e.jsx)("div",{className:"w-6 h-[4px] rounded-sm mt-0.5",style:{backgroundColor:(r==null?void 0:r.color)||"#ff0000"}}),(0,e.jsx)("input",{type:"color",className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full",value:(r==null?void 0:r.color)||"#ff0000",onChange:H=>s({color:H.target.value})})]}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 -ml-0.5"})]})]}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] text-center uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Font"})]}),(0,e.jsxs)("div",{className:I("flex flex-col border-r border-slate-200 h-full py-2 relative",U<.85?"px-2":"px-4"),children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mt-2 mb-3",children:[(0,e.jsxs)("div",{className:"relative flex items-center rounded-[3px] hover:bg-slate-100 transition-all",children:[(0,e.jsx)("button",{disabled:!O,onClick:()=>{r!=null&&r.isBulleted?s({isBulleted:!1,isNumbered:!1,listType:"none"}):s({isBulleted:!0,isNumbered:!1,listType:"bullet-disc"})},className:I("w-[32px] h-8 flex items-center justify-center rounded-l-[3px] transition-all disabled:opacity-40",r!=null&&r.isBulleted?"bg-blue-100":"hover:bg-slate-100"),title:"Bullets",children:(0,e.jsx)(w.List,{size:19,className:r!=null&&r.isBulleted?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>me(!Se),className:I("w-[15px] h-8 flex items-center justify-center rounded-r-[3px] border-l border-transparent hover:border-slate-200 transition-all disabled:opacity-40",Se?"bg-slate-100":"hover:bg-slate-200"),title:"Bullet Options",children:(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400"})}),Se&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!1,listType:"none"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,e.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-disc"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-circle"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-square"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-square-outlined"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-diamond"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-arrow"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-check"}),me(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,e.jsxs)("div",{className:"relative flex items-center rounded-[3px] hover:bg-slate-100 transition-all",children:[(0,e.jsx)("button",{disabled:!O,onClick:()=>{r!=null&&r.isNumbered?s({isBulleted:!1,isNumbered:!1,listType:"none"}):s({isBulleted:!1,isNumbered:!0,listType:"number-decimal"})},className:I("w-[32px] h-8 flex items-center justify-center rounded-l-[3px] transition-all disabled:opacity-40",r!=null&&r.isNumbered?"bg-blue-100":"hover:bg-slate-100"),title:"Numbering",children:(0,e.jsx)(w.ListOrdered,{size:19,className:r!=null&&r.isNumbered?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>ve(!Ne),className:I("w-[15px] h-8 flex items-center justify-center rounded-r-[3px] border-l border-transparent hover:border-slate-200 transition-all disabled:opacity-40",Ne?"bg-slate-100":"hover:bg-slate-200"),title:"Numbering Options",children:(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400"})}),Ne&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!1,listType:"none"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,e.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-decimal"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"1."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"2."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"3."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-decimal-paren"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"1)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"2)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"3)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-roman-upper"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"I."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"II."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"III."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-upper"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"A."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"B."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"C."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-lower-paren"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"a)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"b)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"c)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-lower"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"a."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"b."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"c."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-roman-lower"}),ve(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"i."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"ii."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"iii."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,e.jsx)("div",{className:"w-[1px] h-6 bg-slate-200 mx-1.5"}),(0,e.jsx)("button",{disabled:!O,className:"w-8 h-8 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Decrease List Level",children:(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 14 14",fill:"none",className:"text-slate-600",children:(0,e.jsx)("path",{d:"M2 3H12M6 7H12M6 11H12M2 7L4 9L2 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,e.jsx)("button",{disabled:!O,className:"w-8 h-8 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Increase List Level",children:(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 14 14",fill:"none",className:"text-slate-600",children:(0,e.jsx)("path",{d:"M2 3H12M6 7H12M6 11H12M4 7L2 9L4 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)("button",{disabled:!O,onClick:()=>s({textAlign:"left"}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="left"?"bg-blue-100":"hover:bg-slate-100"),title:"Align Left",children:(0,e.jsx)(w.AlignLeft,{size:19,className:(r==null?void 0:r.textAlign)==="left"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>s({textAlign:"center"}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="center"?"bg-blue-100":"hover:bg-slate-100"),title:"Center",children:(0,e.jsx)(w.AlignCenter,{size:19,className:(r==null?void 0:r.textAlign)==="center"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>s({textAlign:"right"}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="right"?"bg-blue-100":"hover:bg-slate-100"),title:"Align Right",children:(0,e.jsx)(w.AlignRight,{size:19,className:(r==null?void 0:r.textAlign)==="right"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!O,onClick:()=>s({textAlign:"justify"}),className:I("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="justify"?"bg-blue-100":"hover:bg-slate-100"),title:"Justify",children:(0,e.jsx)(w.AlignJustify,{size:19,className:(r==null?void 0:r.textAlign)==="justify"?"text-slate-900":"text-slate-600"})})]}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] text-center uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Paragraph"})]}),(0,e.jsxs)("div",{className:"flex-1 flex flex-col items-center border-r border-slate-100 px-2 gap-1 h-full py-1.5 shrink-0",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto",children:[(0,e.jsxs)("div",{className:"relative group/shapes flex justify-center",children:[(0,e.jsxs)("button",{className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg group transition-all min-w-[64px]",onClick:()=>{var H;return(H=window._toggleShapesMenu)==null?void 0:H.call(window)},children:[(0,e.jsx)("div",{className:"bg-blue-50 p-1.5 rounded-lg group-hover:scale-105 transition-transform",children:(0,e.jsx)(w.Square,{size:20,className:"text-blue-600"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700",children:"Shapes"})]}),(0,e.jsx)(Ia,{onAddShape:H=>{c(H)},uiScale:U})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:m,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 transition-colors min-w-[64px]",title:"Text Box",children:[(0,e.jsx)("div",{className:"p-1.5",children:(0,e.jsx)(w.Type,{size:20})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Text Box"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:()=>{var H;return(H=K.current)==null?void 0:H.click()},className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 transition-colors min-w-[64px]",title:"Image",children:[(0,e.jsx)("div",{className:"p-1.5",children:(0,e.jsx)(w.Image,{size:20})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Image"}),(0,e.jsx)("input",{type:"file",ref:K,className:"hidden",accept:"image/*",onChange:H=>{var ie;return((ie=H.target.files)==null?void 0:ie[0])&&a(H.target.files[0])}})]})]}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Drawing"})]}),(0,e.jsxs)("div",{className:"flex-1 flex flex-col items-center border-r border-slate-100 px-2 gap-1 h-full py-1.5 relative",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-0.5 my-auto h-full",children:[(0,e.jsxs)("button",{disabled:!O||L,onClick:()=>g(r.id,"shorten"),className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all min-w-[64px]",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Sparkles,{size:20,className:"text-purple-500"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Shorten"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{disabled:!O||L,onClick:()=>g(r.id,"reframe"),className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all min-w-[64px]",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Sparkles,{size:20,className:"text-blue-500"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Reframe"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{disabled:!O||L,onClick:()=>g(r.id,"lengthen"),className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all min-w-[68px]",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Sparkles,{size:20,className:"text-emerald-500"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-center leading-tight",children:"Lengthen"})]})]}),L&&(0,e.jsx)("div",{className:"absolute inset-x-0 top-2 bottom-8 bg-white/80 flex items-center justify-center rounded-lg z-10 backdrop-blur-[1px]",children:(0,e.jsx)(w.RefreshCw,{size:16,className:"text-blue-600 animate-spin"})}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"AI Text"})]}),(0,e.jsxs)("div",{className:"flex-1 flex flex-col items-center pl-4 pr-3 gap-1 h-full py-2 relative",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto h-full",children:[(0,e.jsxs)("button",{onClick:M,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-700 transition-all min-w-[64px] group",title:"Present",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Play,{size:20,className:"fill-slate-700 group-hover:fill-slate-900"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Present"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:v,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-700 transition-all min-w-[64px] group",title:"Export",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Download,{size:20,className:"text-emerald-600"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Export"})]}),r&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:j,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-red-50 rounded-lg text-red-600 transition-all min-w-[64px] group",title:"Delete",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Trash2,{size:20})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Delete"})]})]})]}),(0,e.jsxs)("div",{className:"absolute bottom-2 right-3 flex items-center gap-1 px-1.5 py-0.5 bg-emerald-50/50 rounded-md border border-emerald-100/50",children:[(0,e.jsx)(w.Check,{size:9,className:"text-emerald-500"}),(0,e.jsx)("span",{className:"text-[7px] font-black text-emerald-600/70 tracking-tighter uppercase",children:"Saved"})]}),U>=.85&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Actions"})]})]}),$&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[2000]",onClick:()=>D(!1)}),(0,e.jsxs)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[480px] bg-white rounded-3xl shadow-2xl z-[2001] border border-slate-200 p-8 animate-in fade-in zoom-in-95 duration-200",children:[(0,e.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,e.jsxs)("h3",{className:"text-lg font-black text-slate-800 tracking-tight flex items-center gap-3",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-xl",children:(0,e.jsx)(w.Download,{size:20})}),"Upload Presentation"]}),(0,e.jsx)("button",{onClick:()=>D(!1),className:"text-slate-400 hover:text-slate-600 transition-colors",children:(0,e.jsx)(w.RefreshCw,{size:20,className:"rotate-45"})})]}),(0,e.jsxs)("div",{className:"flex gap-2 p-1 bg-slate-50 rounded-2xl mb-8",children:[(0,e.jsx)("button",{onClick:()=>ne("file"),className:I("flex-1 py-3 text-xs font-black rounded-xl transition-all",se==="file"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"FILE UPLOAD"}),(0,e.jsx)("button",{onClick:()=>ne("link"),className:I("flex-1 py-3 text-xs font-black rounded-xl transition-all",se==="link"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"LINK UPLOAD"})]}),se==="file"?(0,e.jsxs)("label",{className:"flex flex-col items-center justify-center gap-4 py-12 border-2 border-dashed border-slate-200 rounded-3xl hover:border-blue-400 hover:bg-blue-50/50 transition-all cursor-pointer group",children:[(0,e.jsx)("div",{className:"p-4 bg-white rounded-2xl shadow-sm border border-slate-100 group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Plus,{size:24,className:"text-blue-500"})}),(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("p",{className:"text-sm font-bold text-slate-700",children:"Choose a PPTX file"}),(0,e.jsx)("p",{className:"text-xs text-slate-400 mt-1",children:"Maximum file size: 50MB"})]}),(0,e.jsx)("input",{type:"file",accept:".pptx",className:"hidden",onChange:H=>{var he;let ie=(he=H.target.files)==null?void 0:he[0];ie&&(b(ie),D(!1))}})]}):(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("div",{className:"relative",children:(0,e.jsx)("input",{type:"text",placeholder:"Paste S3 or public URL",value:G,onChange:H=>xe(H.target.value),className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 focus:outline-none focus:ring-4 focus:ring-blue-500/10 focus:border-blue-500 text-sm placeholder:text-slate-400 text-black"})}),(0,e.jsx)("button",{onClick:()=>{G.trim()&&(b(G.trim()),D(!1))},disabled:!G.trim(),className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-slate-300 text-white font-black py-4 rounded-2xl transition-all shadow-lg shadow-blue-500/20",children:"LOAD PRESENTATION"}),(0,e.jsx)("p",{className:"text-[10px] text-slate-400 text-center uppercase tracking-widest font-black",children:"Supports S3, Dropbox, and public URLS"})]})]})]})]})};var je=require("lucide-react"),be=require("@dnd-kit/core"),Me=require("@dnd-kit/sortable"),Yt=require("@dnd-kit/utilities");var Y=require("react/jsx-runtime"),_t={triangle:"M 12,4 L 20,18 H 4 L 12,4 Z",rightTriangle:"M 4,4 V 20 H 20 L 4,4 Z",rhombus:"M 12,4 L 20,12 L 12,20 L 4,12 L 12,4 Z",parallelogram:"M 7,4 H 21 L 17,20 H 3 L 7,4 Z",trapezoid:"M 6,4 H 18 L 21,20 H 3 L 6,4 Z",pentagon:"M 12,3 L 21,9 V 19 H 3 V 9 L 12,3 Z",hexagon:"M 12,3 L 20,7.5 V 16.5 L 12,21 L 4,16.5 V 7.5 L 12,3 Z",heptagon:"M 12,3 L 18.5,6 L 21,13 L 16,20 H 8 L 3,13 L 5.5,6 L 12,3 Z",octagon:"M 8.5,3 H 15.5 L 21,8.5 V 15.5 L 15.5,21 H 8.5 L 3,15.5 V 8.5 L 8.5,3 Z",heart:"M 12,21.35 L 10.55,20.03 C 5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3 C 9.24,3 10.91,3.81 12,5.09 C 13.09,3.81 14.76,3 16.5,3 C 19.58,3 22,5.42 22,8.5 C 22,12.28 18.6,15.36 13.45,20.04 L 12,21.35 Z",smiley:"M 12,3 A 9,9 0 1,0 12,21 A 9,9 0 1,0 12,3 M 9,9 A 1.5,1.5 0 1,1 9,10.5 A 1.5,1.5 0 1,1 9,9 M 15,9 A 1.5,1.5 0 1,1 15,10.5 A 1.5,1.5 0 1,1 15,9 M 8,15 C 8,15 9.5,17 12,17 C 14.5,17 16,15 16,15",sun:"M 12,7 A 5,5 0 1,1 12,17 A 5,5 0 1,1 12,7 M 12,2 V 4 M 12,20 V 22 M 4,12 H 2 M 22,12 H 20 M 19.07,4.93 L 17.66,6.34 M 6.34,17.66 L 4.93,19.07 M 4.93,4.93 L 6.34,6.34 M 17.66,17.66 L 19.07,19.07",moon:"M 12,3 A 9,9 0 1,0 12,21 A 7,7 0 0,1 12,3 Z",circle:"M 12,3 A 9,9 0 1,1 12,21 A 9,9 0 1,1 12,3 Z",arrowRight:"M 4,11 H 15.5 L 12,7.5 L 13.5,6 L 19.5,12 L 13.5,18 L 12,16.5 L 15.5,13 H 4 Z",arrowLeft:"M 20,11 H 8.5 L 12,7.5 L 10.5,6 L 4.5,12 L 10.5,18 L 12,16.5 L 8.5,13 H 20 Z",arrowUp:"M 13,20 V 8.5 L 16.5,12 L 18,10.5 L 12,4.5 L 6,10.5 L 7.5,12 L 11,8.5 V 20 Z",arrowDown:"M 11,4 V 15.5 L 7.5,12 L 6,13.5 L 12,19.5 L 18,13.5 L 16.5,12 L 13,15.5 V 4 Z",arrowLeftRight:"M 4,12 L 8,8 V 11 H 16 V 8 L 20,12 L 16,16 V 13 H 8 V 16 L 4,12 Z",arrowUpDown:"M 12,4 L 8,8 H 11 V 16 H 8 L 12,20 L 16,16 H 13 V 8 H 16 L 12,4 Z",star4:"M 12,2 L 14,10 L 22,12 L 14,14 L 12,22 L 10,14 L 2,12 L 10,10 L 12,2 Z",star5:"M 12,2 L 14.5,9.5 H 22 L 16,14 L 18.5,21.5 L 12,17 L 5.5,21.5 L 8,14 L 2,9.5 H 9.5 L 12,2 Z",star6:"M 12,2 L 15,7 L 21,6 L 17,10.5 L 19,17 L 12,14 L 5,17 L 7,10.5 L 3,6 L 9,7 L 12,2 Z",star8:"M 12,2 L 14,6 L 18,4 L 16,8 L 20,10 L 16,12 L 18,16 L 14,14 L 12,18 L 10,14 L 6,16 L 8,12 L 4,10 L 8,8 L 6,4 L 10,6 L 12,2 Z",cloud:"M 17,19 C 14.8,19 13.1,17.7 12.3,15.8 C 11.4,16 10.5,16.2 9.6,16.2 C 7,16.2 4.7,14.6 3.7,12.3 C 1.5,11.8 0,9.9 0,7.6 C 0,5 2.1,2.9 4.7,2.9 C 5.3,2.9 5.8,3 6.3,3.1 C 7.6,1.4 9.6,0.3 11.9,0.3 C 12.5,0.3 13.1,0.4 13.7,0.5 C 15,1.9 15.9,3.7 16,5.7 C 18.2,6.1 20,8.1 20,10.5 C 20,13.2 17.8,15.4 15.1,15.4 C 14.8,15.4 14.5,15.4 14.2,15.3 C 14.2,15.4 14.2,15.4 14.2,15.5 C 14.2,17.4 15.5,19 17,19 Z",lightning:"M 13,2 L 3,14 H 12 V 22 L 22,10 H 13 L 16,2 Z",plus:"M 19,13 H 13 V 19 H 11 V 13 H 5 V 11 H 11 V 5 H 13 V 11 H 19 V 13 Z",minus:"M 19,13 H 5 V 11 H 19 V 13 Z",multiply:"M 19,6.41 L 17.59,5 L 12,10.59 L 6.41,5 L 5,6.41 L 10.59,12 L 5,17.59 L 6.41,19 L 12,13.41 L 17.59,19 L 19,17.59 L 13.41,12 L 19,6.41 Z",divide:"M 12,7 A 2,2 0 1,1 12,11 A 2,2 0 1,1 12,7 M 12,17 A 2,2 0 1,1 12,21 A 2,2 0 1,1 12,17 M 5,11 H 19 V 13 H 5 V 11 Z",equal:"M 19,10 H 5 V 8 H 19 V 10 M 19,16 H 5 V 14 H 19 V 16 Z"},Ma=({slide:m,index:a,isActive:c,onSelect:h,onDelete:v,onDuplicate:s,showDelete:j,uiScale:P,appBgColor:M})=>{let{attributes:r,listeners:T,setNodeRef:g,transform:S,transition:V,isDragging:L}=(0,Me.useSortable)({id:m.id}),y={transform:Yt.CSS.Transform.toString(S),transition:V,zIndex:L?2:1,opacity:L?.5:1};return(0,Y.jsxs)("div",{ref:g,onClick:h,className:I("cursor-pointer border-[1.5px] border-solid p-2 transition-all duration-300 group relative select-none",c?"bg-white":"border-transparent hover:border-slate-200 bg-white/50 hover:bg-white"),style:R(z({},y),{borderColor:c?M:void 0}),children:[(0,Y.jsxs)("div",{className:I("text-[10px] font-bold mb-1 flex items-center justify-between transition-colors",!c&&"text-slate-400"),style:{color:c?M:void 0},children:[(0,Y.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Y.jsx)("div",R(z(z({},r),T),{className:"cursor-grab active:cursor-grabbing p-0.5 hover:bg-slate-100 text-slate-300 hover:text-slate-500",children:(0,Y.jsx)(je.GripVertical,{size:10})})),(0,Y.jsxs)("span",{children:["SLIDE ",a+1]})]}),(0,Y.jsxs)("div",{className:"flex items-center gap-1",children:[c&&(0,Y.jsx)("span",{className:"h-1.5 w-1.5",style:{backgroundColor:M}}),(0,Y.jsxs)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,Y.jsx)("button",{onClick:b=>{b.stopPropagation(),s()},className:"p-1 hover:bg-blue-50 text-slate-400 hover:text-blue-500 transition-all",title:"Duplicate Slide",children:(0,Y.jsx)(je.Copy,{size:12})}),j&&(0,Y.jsx)("button",{onClick:b=>{b.stopPropagation(),v()},className:"p-1 hover:bg-red-50 text-red-400 hover:text-red-500 transition-all",title:"Delete Slide",children:(0,Y.jsx)(je.Trash2,{size:12})})]})]})]}),(0,Y.jsx)("div",{className:"aspect-video bg-white flex items-center justify-center border border-slate-200 overflow-hidden relative group-hover:shadow-sm transition-shadow",children:(0,Y.jsx)("div",{className:"origin-center pointer-events-none select-none shrink-0",style:{width:"1200px",height:"675px",transform:`scale(${180*P/1200})`,backgroundColor:"#ffffff"},children:m.elements.sort((b,Z)=>(b.zIndex||0)-(Z.zIndex||0)).map(b=>{var U;let Z={position:"absolute",left:b.x,top:b.y,width:b.width,height:b.height,opacity:(U=b.opacity)!=null?U:1};if(b.type==="text")return(0,Y.jsx)("div",{style:R(z({},Z),{fontSize:b.fontSize,fontFamily:b.fontFamily,color:b.color,textAlign:b.textAlign||"left",fontWeight:b.isBold?"bold":"normal",fontStyle:b.isItalic?"italic":"normal",lineHeight:1.2,overflow:"hidden",wordBreak:"break-word",whiteSpace:"pre-wrap"}),children:b.content},b.id);if(b.type==="shape"){let J=_t[b.shapeType]||(b.shapeType==="ellipse"?_t.circle:null);return J?(0,Y.jsx)("svg",{viewBox:"0 0 24 24",style:R(z({},Z),{fill:b.fill}),preserveAspectRatio:"none",children:(0,Y.jsx)("path",{d:J})},b.id):(0,Y.jsx)("div",{style:R(z({},Z),{backgroundColor:b.fill,borderRadius:b.shapeType==="ellipse"?"50%":"0"})},b.id)}else if(b.type==="image")return(0,Y.jsx)("img",{src:b.src,alt:"",style:R(z({},Z),{objectFit:"contain"})},b.id);return null})})})]})},Kt=({slides:m,currentSlideIndex:a,onSelectSlide:c,onDeleteSlide:h,onDuplicateSlide:v,onReorderSlides:s,uiScale:j,appBgColor:P="#B7472A"})=>{let M=(0,be.useSensors)((0,be.useSensor)(be.PointerSensor,{activationConstraint:{distance:5}}),(0,be.useSensor)(be.KeyboardSensor,{coordinateGetter:Me.sortableKeyboardCoordinates})),r=T=>{let{active:g,over:S}=T;if(g.id!==(S==null?void 0:S.id)){let V=m.findIndex(y=>y.id===g.id),L=m.findIndex(y=>y.id===(S==null?void 0:S.id));s(V,L)}};return(0,Y.jsx)("div",{className:"bg-white border-r border-slate-100 overflow-y-auto p-4 flex flex-col gap-4",style:{width:`${256*j}px`},children:(0,Y.jsx)(be.DndContext,{sensors:M,collisionDetection:be.closestCenter,onDragEnd:r,children:(0,Y.jsx)(Me.SortableContext,{items:m.map(T=>T.id),strategy:Me.verticalListSortingStrategy,children:m.map((T,g)=>(0,Y.jsx)(Ma,{slide:T,index:g,isActive:g===a,onSelect:()=>c(g),onDelete:()=>h(g),onDuplicate:()=>v(g),showDelete:m.length>1,uiScale:j,appBgColor:P},T.id))})})})};var pe=require("react"),le=He(require("fabric")),Ae=require("lucide-react");var F=require("react/jsx-runtime"),Aa={triangle:"M 12,4 L 20,18 H 4 L 12,4 Z",rightTriangle:"M 4,4 V 20 H 20 L 4,4 Z",rhombus:"M 12,4 L 20,12 L 12,20 L 4,12 L 12,4 Z",parallelogram:"M 7,4 H 21 L 17,20 H 3 L 7,4 Z",trapezoid:"M 6,4 H 18 L 21,20 H 3 L 6,4 Z",pentagon:"M 12,3 L 21,9 V 19 H 3 V 9 L 12,3 Z",hexagon:"M 12,3 L 20,7.5 V 16.5 L 12,21 L 4,16.5 V 7.5 L 12,3 Z",heptagon:"M 12,3 L 18.5,6 L 21,13 L 16,20 H 8 L 3,13 L 5.5,6 L 12,3 Z",octagon:"M 8.5,3 H 15.5 L 21,8.5 V 15.5 L 15.5,21 H 8.5 L 3,15.5 V 8.5 L 8.5,3 Z",heart:"M 12,21.35 L 10.55,20.03 C 5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3 C 9.24,3 10.91,3.81 12,5.09 C 13.09,3.81 14.76,3 16.5,3 C 19.58,3 22,5.42 22,8.5 C 22,12.28 18.6,15.36 13.45,20.04 L 12,21.35 Z",smiley:"M 12,3 A 9,9 0 1,0 12,21 A 9,9 0 1,0 12,3 M 9,9 A 1.5,1.5 0 1,1 9,10.5 A 1.5,1.5 0 1,1 9,9 M 15,9 A 1.5,1.5 0 1,1 15,10.5 A 1.5,1.5 0 1,1 15,9 M 8,15 C 8,15 9.5,17 12,17 C 14.5,17 16,15 16,15",sun:"M 12,7 A 5,5 0 1,1 12,17 A 5,5 0 1,1 12,7 M 12,2 V 4 M 12,20 V 22 M 4,12 H 2 M 22,12 H 20 M 19.07,4.93 L 17.66,6.34 M 6.34,17.66 L 4.93,19.07 M 4.93,4.93 L 6.34,6.34 M 17.66,17.66 L 19.07,19.07",moon:"M 12,3 A 9,9 0 1,0 12,21 A 7,7 0 0,1 12,3 Z",circle:"M 12,3 A 9,9 0 1,1 12,21 A 9,9 0 1,1 12,3 Z",arrowRight:"M 4,11 H 15.5 L 12,7.5 L 13.5,6 L 19.5,12 L 13.5,18 L 12,16.5 L 15.5,13 H 4 Z",arrowLeft:"M 20,11 H 8.5 L 12,7.5 L 10.5,6 L 4.5,12 L 10.5,18 L 12,16.5 L 8.5,13 H 20 Z",arrowUp:"M 13,20 V 8.5 L 16.5,12 L 18,10.5 L 12,4.5 L 6,10.5 L 7.5,12 L 11,8.5 V 20 Z",arrowDown:"M 11,4 V 15.5 L 7.5,12 L 6,13.5 L 12,19.5 L 18,13.5 L 16.5,12 L 13,15.5 V 4 Z",arrowLeftRight:"M 4,12 L 8,8 V 11 H 16 V 8 L 20,12 L 16,16 V 13 H 8 V 16 L 4,12 Z",arrowUpDown:"M 12,4 L 8,8 H 11 V 16 H 8 L 12,20 L 16,16 H 13 V 8 H 16 L 12,4 Z",star4:"M 12,2 L 14,10 L 22,12 L 14,14 L 12,22 L 10,14 L 2,12 L 10,10 L 12,2 Z",star5:"M 12,2 L 14.5,9.5 H 22 L 16,14 L 18.5,21.5 L 12,17 L 5.5,21.5 L 8,14 L 2,9.5 H 9.5 L 12,2 Z",star6:"M 12,2 L 15,7 L 21,6 L 17,10.5 L 19,17 L 12,14 L 5,17 L 7,10.5 L 3,6 L 9,7 L 12,2 Z",star8:"M 12,2 L 14,6 L 18,4 L 16,8 L 20,10 L 16,12 L 18,16 L 14,14 L 12,18 L 10,14 L 6,16 L 8,12 L 4,10 L 8,8 L 6,4 L 10,6 L 12,2 Z",cloud:"M 17,19 C 14.8,19 13.1,17.7 12.3,15.8 C 11.4,16 10.5,16.2 9.6,16.2 C 7,16.2 4.7,14.6 3.7,12.3 C 1.5,11.8 0,9.9 0,7.6 C 0,5 2.1,2.9 4.7,2.9 C 5.3,2.9 5.8,3 6.3,3.1 C 7.6,1.4 9.6,0.3 11.9,0.3 C 12.5,0.3 13.1,0.4 13.7,0.5 C 15,1.9 15.9,3.7 16,5.7 C 18.2,6.1 20,8.1 20,10.5 C 20,13.2 17.8,15.4 15.1,15.4 C 14.8,15.4 14.5,15.4 14.2,15.3 C 14.2,15.4 14.2,15.4 14.2,15.5 C 14.2,17.4 15.5,19 17,19 Z",lightning:"M 13,2 L 3,14 H 12 V 22 L 22,10 H 13 L 16,2 Z",plus:"M 19,13 H 13 V 19 H 11 V 13 H 5 V 11 H 11 V 5 H 13 V 11 H 19 V 13 Z",minus:"M 19,13 H 5 V 11 H 19 V 13 Z",multiply:"M 19,6.41 L 17.59,5 L 12,10.59 L 6.41,5 L 5,6.41 L 10.59,12 L 5,17.59 L 6.41,19 L 12,13.41 L 17.59,19 L 19,17.59 L 13.41,12 L 19,6.41 Z",divide:"M 12,7 A 2,2 0 1,1 12,11 A 2,2 0 1,1 12,7 M 12,17 A 2,2 0 1,1 12,21 A 2,2 0 1,1 12,17 M 5,11 H 19 V 13 H 5 V 11 Z",equal:"M 19,10 H 5 V 8 H 19 V 10 M 19,16 H 5 V 14 H 19 V 16 Z"},Ba=(m,a,c,h)=>{if(a)switch(m){case"bullet-disc":return"\u2022";case"bullet-circle":return"\u25CB";case"bullet-square":return"\u25A0";case"bullet-square-outlined":return"\u25A1";case"bullet-diamond":return"\u25C6";case"bullet-arrow":return"\u27A4";case"bullet-check":return"\u2713";case"none":return"";default:return"\u2022"}else if(c){let v=h+1;switch(m){case"number-decimal":return`${v}.`;case"number-decimal-paren":return`${v})`;case"number-roman-upper":return Jt(v)+".";case"number-roman-lower":return Jt(v).toLowerCase()+".";case"number-alpha-upper":return xt(v)+".";case"number-alpha-lower":return xt(v).toLowerCase()+".";case"number-alpha-lower-paren":return xt(v).toLowerCase()+")";case"none":return"";default:return`${v}.`}}return""},Jt=m=>{let a={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},c="";for(let h in a)for(;m>=a[h];)c+=h,m-=a[h];return c},xt=m=>String.fromCharCode(64+m),Ee=class extends le.Textbox{_renderTextLine(a,c,h,v,s,j){if(super._renderTextLine(a,c,h,v,s,j),(this.isBulleted||this.isNumbered)&&this.listType!=="none"){let P=Ba(this.listType,this.isBulleted,this.isNumbered,j);if(P){c.save();let M=this.fontSize||22,r=-M*1,T=M*.6;c.font=`${this.fontStyle} ${this.fontWeight} ${T}px ${this.fontFamily}`,c.fillStyle=this.fill,c.fillText(P,v+r,s-M*.35),c.restore()}}}},et=({slide:m,onElementUpdate:a,onSelect:c,uiScale:h,onSlashCommand:v,selectedElementId:s,onAiGenerateClick:j,onAiGenerateInfographicClick:P,onUploadImageClick:M,onDeleteElement:r})=>{let T=(0,pe.useRef)(null),g=(0,pe.useRef)(null),S=(0,pe.useRef)(!1),V=(0,pe.useRef)(a),L=(0,pe.useRef)(c),y=(0,pe.useRef)(null),[b,Z]=(0,pe.useState)(1),[U,J]=(0,pe.useState)(!1),te=(0,pe.useRef)({x:0,y:0});(0,pe.useEffect)(()=>{if(!y.current)return;let k=new ResizeObserver(K=>{let _=K[0];if(_){let{width:X,height:Q}=_.contentRect,n=X/1200,f=Q/675,o=Math.min(n,f)*.95;Z(o)}});return k.observe(y.current),()=>k.disconnect()},[]),(0,pe.useEffect)(()=>{V.current=a,L.current=c},[a,c]),(0,pe.useEffect)(()=>{if(T.current&&!g.current){let k=new le.Canvas(T.current,{width:1200,height:675,backgroundColor:"white",selection:!0,preserveObjectStacking:!0});g.current=k,J(!0);let K=o=>{o.left<0&&o.set("left",0),o.top<0&&o.set("top",0);let x=o.getBoundingRect();x.left+x.width>(k.width||1200)&&o.set("left",(k.width||1200)-x.width),x.top+x.height>(k.height||675)&&o.set("top",(k.height||675)-x.height)};k.on("object:moving",o=>K(o.target)),k.on("object:scaling",o=>K(o.target));let _=o=>{var $;if(S.current)return;let x=o.target,C=($=x.get("data"))==null?void 0:$.id;x&&C&&V.current(C,z({x:x.left,y:x.top,width:x.getScaledWidth(),height:x.getScaledHeight()},x.isType("textbox")?{content:x.text,textAlign:x.textAlign,fontSize:x.fontSize,fontFamily:x.fontFamily,color:x.fill}:{fill:x.fill}))};k.on("object:modified",_),k.on("text:changed",_);let X=o=>{if(!(!o||!o.isType("textbox")))return{fontFamily:o.fontFamily,fontSize:o.fontSize,isBold:o.fontWeight==="bold",isItalic:o.fontStyle==="italic",isUnderline:o.underline,textAlign:o.textAlign,color:o.fill,highlightColor:o.textBackgroundColor,isBulleted:!!o.isBulleted,isNumbered:!!o.isNumbered}},Q=(o,x=!1)=>{var C;try{let $=(C=T.current)==null?void 0:C.getBoundingClientRect();if(!$||!o)return;let D=0,se=0,ne=(ae,E)=>typeof ae=="object"&&ae!==null&&typeof ae[E]=="function",G=ne(o,"isType")&&o.isType("textbox");if(G&&o.isEditing){let E=(W=>{try{let oe=W.selectionStart||0;if(ne(W,"getCursorCoords"))return W.getCursorCoords(oe);if(ne(W,"_getCursorCoords"))return W._getCursorCoords(oe)}catch(oe){}return null})(o);if(E){let W=le.util.transformPoint(new le.Point(E.left,E.top),ne(o,"calcTransformMatrix")?o.calcTransformMatrix():[1,0,0,1,0,0]),oe=k.viewportTransform||[1,0,0,1,0,0],Se=le.util.transformPoint(W,oe);D=$.left+Se.x*b,se=$.top+Se.y*b}else{let W=ne(o,"getBoundingRect")?o.getBoundingRect():{left:0,top:0,width:0,height:0};D=$.left+(W.left+W.width/2)*b,se=$.top+W.top*b}}else{let ae=ne(o,"getBoundingRect")?o.getBoundingRect():{left:te.current.x,top:te.current.y,width:0,height:0};D=$.left+(ae.left+ae.width/2)*b,se=$.top+ae.top*b}if(D&&se){let ae=x?"text-selection":G?"textbox":"default",E=D,W=se;ae==="default"?(E=D+5,W=se+5):(E=D-220,W=se-140),v({x:E,y:W},ae,X(o))}}catch($){console.error("Critical error in triggerSlashMenu:",$)}},n=o=>{var C,$;let x=((C=o.selected)==null?void 0:C[0])||o.target;if(x){let D=($=x.get("data"))==null?void 0:$.id;L.current(D),x.isType("textbox")&&!S.current&&Q(x)}};k.on("selection:created",n),k.on("selection:updated",n),k.on("selection:cleared",()=>{L.current(null),v({x:0,y:0},"default")}),k.on("text:selection:changed",o=>{let x=o.target;x&&x.isType("textbox")&&x.selectionStart!==x.selectionEnd&&Q(x,!0)}),k.on("mouse:move",o=>{o.pointer&&(te.current={x:o.pointer.x,y:o.pointer.y})});let f=o=>{let x=g.current;if(!x)return;let C=x.getActiveObject();if(o.key==="/"){o.preventDefault(),Q(C||{isType:()=>!1,getBoundingRect:()=>({left:te.current.x,top:te.current.y,width:0,height:0})});return}if(C&&C.isType("textbox")&&C.isEditing||!C)return;let $=o.shiftKey?10:1,D=!1;switch(o.key){case"ArrowLeft":C.set("left",C.left-$),D=!0;break;case"ArrowRight":C.set("left",C.left+$),D=!0;break;case"ArrowUp":C.set("top",C.top-$),D=!0;break;case"ArrowDown":C.set("top",C.top+$),D=!0;break}D&&(K(C),x.requestRenderAll(),_({target:C}))};window.addEventListener("keydown",f),k._keyboardListener=f}return()=>{if(g.current){let k=g.current._keyboardListener;k&&window.removeEventListener("keydown",k),g.current.dispose(),g.current=null}}},[]),(0,pe.useEffect)(()=>{if(!g.current)return;let k=g.current;(async()=>{S.current=!0;let _=k.getObjects(),X=new Set(m.elements.map(n=>n.id));_.forEach(n=>{var o;let f=(o=n.get("data"))==null?void 0:o.id;f&&!X.has(f)&&k.remove(n)});let Q=[...m.elements].sort((n,f)=>(n.zIndex||0)-(f.zIndex||0));for(let n of Q){let f=_.find(o=>{var x;return((x=o.get("data"))==null?void 0:x.id)===n.id});if(f&&f.type==="textbox"&&!(f instanceof Ee)&&(k.remove(f),f=null),f){if(f===k.getActiveObject()&&f.isType("textbox")&&f.isEditing)continue;let o={left:n.x,top:n.y,opacity:n.opacity!==void 0?n.opacity:1,zIndex:n.zIndex};n.type==="text"&&f.isType("textbox")?(o.text=n.content||" ",o.fontSize=n.fontSize||22,o.fill=n.color||"#000000",o.textBackgroundColor=n.highlightColor||"",o.textAlign=n.textAlign||"left",o.fontWeight=n.isBold?"bold":"normal",o.fontStyle=n.isItalic?"italic":"normal",o.underline=n.isUnderline||!1,o.linethrough=n.isStrikethrough||!1,o.charSpacing=n.charSpacing||0,o.fontFamily=n.fontFamily||"Arial",f.isBulleted=n.isBulleted,f.isNumbered=n.isNumbered,f.listType=n.listType,o.width=Math.max(n.width||50,10)):n.type==="shape"?(o.fill=n.fill||"#cccccc",o.scaleX=(n.width||50)/(f.width||1),o.scaleY=(n.height||50)/(f.height||1)):n.type==="image"&&(o.scaleX=(n.width||100)/(f.width||1),o.scaleY=(n.height||100)/(f.height||1)),f.set(o)}else{let o=null,x={left:n.x,top:n.y,data:{id:n.id},originX:"left",originY:"top",opacity:n.opacity!==void 0?n.opacity:1};if(n.type==="text")o=new Ee(n.content||" ",R(z({},x),{width:Math.max(n.width||200,10),fontSize:n.fontSize||22,fill:n.color||"#000000",backgroundColor:n.highlightColor||"",fontFamily:n.fontFamily||"Inter, Arial, sans-serif",textAlign:n.textAlign||"left",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isItalic?"italic":"normal",underline:n.isUnderline||!1,linethrough:n.isStrikethrough||!1,charSpacing:n.charSpacing||0,splitByGrapheme:!1,objectCaching:!1})),o.isBulleted=n.isBulleted,o.isNumbered=n.isNumbered,o.listType=n.listType;else if(n.type==="shape"){let C=n.fill||"#3b82f6";if(n.shapeType==="ellipse")o=new le.Circle(R(z({},x),{radius:(n.width||100)/2,scaleY:(n.height||100)/(n.width||100),fill:C}));else if(n.shapeType==="rect")o=new le.Rect(R(z({},x),{width:n.width||100,height:n.height||100,fill:C}));else{let $=Aa[n.shapeType];if($){o=new le.Path($,R(z({},x),{fill:C}));let D=o;D.set({scaleX:(n.width||100)/(D.width||1),scaleY:(n.height||100)/(D.height||1)})}else o=new le.Rect(R(z({},x),{width:n.width||100,height:n.height||100,fill:C}))}}else if(n.type==="image")try{let C=await le.FabricImage.fromURL(n.src);C.set(R(z({},x),{scaleX:(n.width||100)/(C.width||1),scaleY:(n.height||100)/(C.height||1)})),o=C}catch(C){console.error(C)}o&&k.add(o)}}k.renderAll(),S.current=!1})()},[m,U]);let N=m.elements.find(k=>k.id===s);return(0,F.jsx)("div",{ref:y,className:"w-full h-full flex items-center justify-center overflow-hidden relative",children:(0,F.jsxs)("div",{className:"border border-slate-200 overflow-hidden bg-white shadow-xl transition-all duration-300 ease-out shrink-0 relative",style:{transform:`scale(${b})`,transformOrigin:"center center"},children:[(0,F.jsx)("canvas",{ref:T}),m.elements.length===0&&(0,F.jsx)("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none select-none animate-in fade-in duration-700",children:(0,F.jsx)("div",{className:"flex flex-col items-center gap-4 text-slate-300",children:(0,F.jsx)("div",{className:"flex flex-col items-center gap-1 text-center",children:(0,F.jsxs)("h1",{className:"text-2xl font-medium text-slate-400",children:["Click ",(0,F.jsx)("span",{className:"px-2 py-0.5 bg-slate-100 rounded-md text-slate-500 font-bold",children:"/"})," for options"]})})})}),N&&N.type==="image"&&(0,F.jsxs)("div",{className:"absolute z-[5000] flex flex-col w-96 bg-white border border-slate-200 shadow-2xl rounded-2xl overflow-hidden animate-in fade-in zoom-in duration-200",style:{left:N.x+N.width/2>600?`${N.x-12}px`:`${N.x+N.width+12}px`,top:`${N.y+N.height/2}px`,transform:N.x+N.width/2>600?"translate(-100%, -50%)":"translate(0, -50%)"},children:[(0,F.jsx)("div",{className:"px-5 py-3.5 text-sm uppercase tracking-wider font-bold text-slate-400 bg-slate-50/50 border-b border-slate-100",children:"Image Actions"}),(0,F.jsxs)("div",{className:"p-2.5 flex flex-col gap-1",children:[(0,F.jsxs)("button",{onClick:k=>{k.stopPropagation(),j()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,F.jsx)("div",{className:"p-3 rounded-xl bg-blue-50 text-blue-600 group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,F.jsx)(Ae.Sparkles,{size:28})}),(0,F.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,F.jsx)("span",{className:"text-lg font-bold text-slate-900",children:"AI Generate Image"}),(0,F.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Create an image with AI prompt"})]})]}),(0,F.jsxs)("button",{onClick:k=>{k.stopPropagation(),P()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,F.jsx)("div",{className:"p-3 rounded-xl bg-purple-50 text-purple-600 group-hover:bg-purple-600 group-hover:text-white transition-colors",children:(0,F.jsx)(Ae.PieChart,{size:28})}),(0,F.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,F.jsx)("span",{className:"text-lg font-bold text-slate-900",children:"AI Infographic"}),(0,F.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Generate chart or diagram"})]})]}),(0,F.jsxs)("button",{onClick:k=>{k.stopPropagation(),M()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,F.jsx)("div",{className:"p-3 rounded-xl bg-slate-100 text-slate-500 group-hover:bg-slate-200 group-hover:text-slate-700 transition-colors",children:(0,F.jsx)(Ae.Image,{size:28})}),(0,F.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,F.jsx)("span",{className:"text-lg font-bold text-slate-700",children:"Change Image"}),(0,F.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Replace with local file"})]})]}),(0,F.jsx)("div",{className:"h-[1px] bg-slate-100 my-1 mx-3"}),(0,F.jsxs)("button",{onClick:k=>{k.stopPropagation(),r()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-red-50 group",children:[(0,F.jsx)("div",{className:"p-3 rounded-xl bg-red-50 text-red-500 group-hover:bg-red-500 group-hover:text-white transition-colors",children:(0,F.jsx)(Ae.Trash2,{size:28})}),(0,F.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,F.jsx)("span",{className:"text-lg font-bold text-red-600",children:"Delete Element"}),(0,F.jsx)("span",{className:"text-sm text-red-400/80 truncate leading-tight",children:"Remove from slide"})]})]})]})]})]})})};var Qt=He(require("pptxgenjs"));var qe=class{async export(a){var r,T;let c=new Qt.default,h=((r=a.layout)==null?void 0:r.width)||12192e3,v=((T=a.layout)==null?void 0:T.height)||6858e3,s=1200,j=675,P=g=>g/s*(h/914400),M=g=>g/j*(v/914400);a.slides.forEach(g=>{let S=c.addSlide();[...g.elements].sort((L,y)=>L.zIndex-y.zIndex).forEach(L=>{var Z,U;let y=L.opacity!==void 0?(1-L.opacity)*100:0,b={x:P(L.x),y:M(L.y),w:P(L.width),h:M(L.height)};if(L.type==="text")S.addText(L.content,R(z({},b),{fontSize:(L.fontSize||18)/2,color:((Z=L.color)==null?void 0:Z.replace("#",""))||"000000",fontFace:L.fontFamily||"Arial"}));else if(L.type==="image")S.addImage(R(z({},b),{path:L.src,transparency:y}));else if(L.type==="shape"){let J=L.shapeType==="ellipse"?c.ShapeType.ellipse:c.ShapeType.rect;S.addShape(J,R(z({},b),{fill:{color:((U=L.fill)==null?void 0:U.replace("#",""))||"CCCCCC",transparency:y>0?Math.min(y+10,100):0}}))}})}),await c.writeFile({fileName:"presentation.pptx"})}};var Et=He(require("jszip")),Xe=class{constructor(){this.slideWidth=12192e3;this.slideHeight=6858e3;this.CANVAS_WIDTH=1200;this.CANVAS_HEIGHT=675}async parse(a){var T,g;let c=a;if(typeof a=="string"){let S=await fetch(a);if(!S.ok){let V=S.status,L=S.statusText,y="";try{let b=await S.json();y=b.details||b.error||""}catch(b){}throw new Error(`Failed to fetch PPTX from ${a}: ${V} ${L} ${y?`(${y})`:""}`)}c=await S.arrayBuffer()}let h=await Et.default.loadAsync(c),v=await((T=h.file("ppt/presentation.xml"))==null?void 0:T.async("string"));if(!v)throw new Error("Invalid PPTX");let j=new DOMParser().parseFromString(v,"text/xml"),P=this.findFirstByLocalName(j,"sldSz");P&&(this.slideWidth=parseInt(this.getAttr(P,"cx")||"12192000"),this.slideHeight=parseInt(this.getAttr(P,"cy")||"6858000"));let M=Array.from(j.getElementsByTagNameNS("*","sldId")),r=[];for(let S=0;S<M.length;S++){let V=S+1,L=`ppt/slides/slide${V}.xml`,y=await((g=h.file(L))==null?void 0:g.async("string"));if(y){let b=await this.parseSlide(y,V,h);r.push(b)}}return{slides:r,layout:{width:this.slideWidth,height:this.slideHeight}}}getAttr(a,c){return a.getAttribute(c)||a.getAttribute(`a:${c}`)||a.getAttribute(`p:${c}`)||a.getAttribute(`r:${c}`)}findFirstByLocalName(a,c){let h=a.getElementsByTagNameNS("*",c);return h.length>0?h[0]:null}findAllByLocalName(a,c){return Array.from(a.getElementsByTagNameNS("*",c))}scaleX(a){return a/this.slideWidth*this.CANVAS_WIDTH}scaleY(a){return a/this.slideHeight*this.CANVAS_HEIGHT}parseColor(a){let c=this.findFirstByLocalName(a,"srgbClr");if(c){let v=`#${this.getAttr(c,"val")}`,s=this.findFirstByLocalName(c,"alpha"),j=s?parseInt(this.getAttr(s,"val")||"100000")/1e5:1;return{color:v,opacity:j}}let h=this.findFirstByLocalName(a,"schemeClr");if(h){let v=this.findFirstByLocalName(h,"alpha");return{color:"#000000",opacity:v?parseInt(this.getAttr(v,"val")||"100000")/1e5:1}}return{color:"#000000",opacity:1}}async resolveImage(a,c,h){var r,T;let v=await((r=h.file(`ppt/slides/_rels/slide${c}.xml.rels`))==null?void 0:r.async("string"));if(!v)return null;let j=new DOMParser().parseFromString(v,"text/xml"),P=Array.from(j.getElementsByTagName("Relationship")).find(g=>g.getAttribute("Id")===a),M=P==null?void 0:P.getAttribute("Target");if(M){let g=(M.startsWith("../")?`ppt/${M.substring(3)}`:`ppt/slides/${M}`).replace("ppt/slides/../","ppt/");return await((T=h.file(g))==null?void 0:T.async("blob"))||null}return null}async parseSlide(a,c,h){let s=new DOMParser().parseFromString(a,"text/xml"),j=[],P=0,M=this.findFirstByLocalName(s,"bg");if(M){let g=this.findFirstByLocalName(M,"blip"),S=(g==null?void 0:g.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","embed"))||(g==null?void 0:g.getAttribute("r:embed"));if(S){let V=await this.resolveImage(S,c,h);V&&j.push({id:`bg-${c}`,type:"image",src:URL.createObjectURL(V),x:0,y:0,width:this.CANVAS_WIDTH,height:this.CANVAS_HEIGHT,zIndex:P++,opacity:1})}}let r=this.findFirstByLocalName(s,"spTree");if(!r)return{id:`slide-${c}`,elements:j};let T=Array.from(r.children);for(let g of T){let S=g.localName;if(S==="sp"){let V=this.findFirstByLocalName(g,"txBody"),L=this.findFirstByLocalName(g,"nvSpPr"),y=L?this.findFirstByLocalName(L,"nvPr"):null,b=y?this.findFirstByLocalName(y,"ph"):null,Z=b?this.getAttr(b,"type"):null,U=b&&(!Z||Z==="body"),J=this.findFirstByLocalName(g,"xfrm"),te=J?this.findFirstByLocalName(J,"off"):null,N=J?this.findFirstByLocalName(J,"ext"):null;if(V&&te&&N){let K=this.findAllByLocalName(V,"p"),_="",X=18,Q="#000000",n=1,f=!1,o=!1;for(let x of K){let C=this.findFirstByLocalName(x,"pPr"),$=C?this.findFirstByLocalName(C,"buNone"):null,D="";C&&!$?this.findFirstByLocalName(C,"buAutoNum")?o=!0:(this.findFirstByLocalName(C,"buChar")||parseInt(this.getAttr(C,"indent")||"0")<0||U)&&(f=!0):!C&&U&&(f=!0);let se=this.findAllByLocalName(x,"r");for(let xe of se){let ae=this.findFirstByLocalName(xe,"t");ae&&(D+=ae.textContent);let E=this.findFirstByLocalName(xe,"rPr");if(E){let W=this.getAttr(E,"sz");W&&(X=parseInt(W)/100*2);let oe=this.parseColor(E);Q=oe.color,n=oe.opacity}}let ne=/^\s*([•\u2022\u2023\u25E6\u2043\u2219])\s+/;D.match(ne)&&(f=!0,D=D.replace(ne,"")),_+=D+`
4
4
  `}if(_.trim()){j.push({id:`el-${c}-${Date.now()}-${P}`,type:"text",content:_.trim(),x:this.scaleX(parseInt(this.getAttr(te,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(te,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(N,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(N,"cy")||"0")),fontSize:X,color:Q,fontFamily:"Arial",zIndex:P++,isBulleted:f,isNumbered:o,listType:o?"number-decimal":f?"bullet-disc":"none",opacity:n});continue}}let k=this.findFirstByLocalName(g,"prstGeom");if(k&&te&&N){let K=this.getAttr(k,"prst")||"rect",_=this.findFirstByLocalName(g,"spPr"),X=_?this.parseColor(_):{color:"#cccccc",opacity:1},Q={rect:"rect",roundRect:"rect",ellipse:"ellipse",circle:"ellipse",triangle:"triangle",rtTriangle:"rightTriangle",diamond:"rhombus",parallelogram:"parallelogram",trapezoid:"trapezoid",pentagon:"pentagon",hexagon:"hexagon",heptagon:"heptagon",octagon:"octagon",heart:"heart",smileyFace:"smiley",sun:"sun",moon:"moon",rightArrow:"arrowRight",leftArrow:"arrowLeft",upArrow:"arrowUp",downArrow:"arrowDown",leftRightArrow:"arrowLeftRight",upDownArrow:"arrowUpDown",star4:"star4",star5:"star5",star6:"star6",star8:"star8",cloud:"cloud",lightningBolt:"lightning",plus:"plus",minus:"minus",multiply:"multiply",divide:"divide",equal:"equal"};j.push({id:`el-${c}-${Date.now()}-${P}`,type:"shape",shapeType:Q[K]||"rect",fill:X.color,opacity:X.opacity,x:this.scaleX(parseInt(this.getAttr(te,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(te,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(N,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(N,"cy")||"0")),zIndex:P++})}}if(S==="pic"){let V=this.findFirstByLocalName(g,"blip"),L=(V==null?void 0:V.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","embed"))||(V==null?void 0:V.getAttribute("r:embed")),y=this.findFirstByLocalName(g,"xfrm"),b=y?this.findFirstByLocalName(y,"off"):null,Z=y?this.findFirstByLocalName(y,"ext"):null;if(L&&b&&Z){let U=await this.resolveImage(L,c,h);U&&j.push({id:`el-${c}-${Date.now()}-${P}`,type:"image",src:URL.createObjectURL(U),x:this.scaleX(parseInt(this.getAttr(b,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(b,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(Z,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(Z,"cy")||"0")),zIndex:P++,opacity:1})}}}return{id:`slide-${c}`,elements:j}}};var Re=require("react"),De=require("lucide-react");var ge=require("react/jsx-runtime"),vt=({presentation:m,initialSlideIndex:a,onClose:c})=>{let[h,v]=(0,Re.useState)(a),s=m.slides[h],j=()=>{h>0&&v(h-1)},P=()=>{h<m.slides.length-1&&v(h+1)};(0,Re.useEffect)(()=>{let T=g=>{g.key==="ArrowRight"||g.key===" "||g.key==="PageDown"?P():g.key==="ArrowLeft"||g.key==="Backspace"||g.key==="PageUp"?j():g.key==="Escape"&&c()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[h]);let[M,r]=(0,Re.useState)(1);return(0,Re.useEffect)(()=>{let T=()=>{let S=window.innerWidth-40,V=window.innerHeight-40,L=1200,y=675,b=S/L,Z=V/y,U=Math.min(b,Z);r(U)};return T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]),(0,ge.jsxs)("div",{className:"fixed inset-0 z-[99999] bg-[#0A0A0A] flex flex-col items-center justify-center overflow-hidden",children:[(0,ge.jsxs)("div",{className:"absolute top-0 left-0 right-0 p-6 flex justify-between items-center opacity-0 hover:opacity-100 transition-opacity bg-gradient-to-b from-black/60 to-transparent z-[100] pointer-events-none",children:[(0,ge.jsxs)("div",{className:"text-white/80 font-bold ml-4 pointer-events-auto",children:["Slide ",h+1," of ",m.slides.length]}),(0,ge.jsx)("button",{onClick:c,className:"p-3 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all pointer-events-auto",children:(0,ge.jsx)(De.X,{size:24})})]}),(0,ge.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,ge.jsx)("div",{className:"relative shadow-2xl shadow-black/80 bg-white",style:{width:"1200px",height:"675px",transform:`scale(${M})`,transformOrigin:"center center"},children:(0,ge.jsx)(et,{slide:s,onElementUpdate:()=>{},onSelect:()=>{},uiScale:.75,onSlashCommand:()=>{},selectedElementId:null,onAiGenerateClick:()=>{},onAiGenerateInfographicClick:()=>{},onUploadImageClick:()=>{},onDeleteElement:()=>{}})})}),(0,ge.jsxs)("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 flex items-center gap-6 opacity-0 hover:opacity-100 transition-opacity bg-black/40 backdrop-blur-md px-6 py-3 rounded-full border border-white/10 pointer-events-auto",children:[(0,ge.jsx)("button",{disabled:h===0,onClick:j,className:"p-2 text-white/50 hover:text-white disabled:opacity-20 transition-colors",children:(0,ge.jsx)(De.ChevronLeft,{size:32})}),(0,ge.jsx)("div",{className:"h-6 w-[1px] bg-white/10"}),(0,ge.jsx)("button",{disabled:h===m.slides.length-1,onClick:P,className:"p-2 text-white/50 hover:text-white disabled:opacity-20 transition-colors",children:(0,ge.jsx)(De.ChevronRight,{size:32})})]})]})};var wt=require("@google/generative-ai");var re=He(require("react")),u=require("lucide-react");var t=require("react/jsx-runtime"),Pa=["Inter","Arial","Lato","Open Sans","Poppins","Roboto","Georgia","Times New Roman"],Ta=[8,9,10,11,12,14,16,18,20,24,28,32,36,48,64,72,96],ea=({onClose:m,onAction:a,position:c,canUseAi:h,mode:v="default",context:s,aiResult:j,isAiLoading:P,onAiResponseAction:M})=>{let[r,T]=(0,re.useState)(""),[g,S]=(0,re.useState)(0),V=(0,re.useRef)(null),[L,y]=(0,re.useState)(!1),[b,Z]=(0,re.useState)(!1),[U,J]=(0,re.useState)(!1),[te,N]=(0,re.useState)(!1),[k,K]=(0,re.useState)(!1),_=(0,re.useMemo)(()=>[{id:"generate-image",label:"AI Generate Image",icon:u.Sparkles,category:"AI",description:"Create an image with AI prompt",action:()=>a("generate-image")},{id:"generate-infographic",label:"AI Generate Infographic",icon:u.PieChart,category:"AI",description:"Create an infographic with AI prompt",action:()=>a("generate-infographic")},{id:"text",label:"Text Box",icon:u.Type,category:"Basic",description:"Insert a new text element",action:()=>a("add-text")},{id:"image",label:"Image",icon:u.Image,category:"Basic",description:"Upload and insert an image",action:()=>a("add-image")},{id:"new-slide",label:"New Slide",icon:u.PlusCircle,category:"Canvas",description:"Add a fresh slide to deck",action:()=>a("new-slide")},{id:"rect",label:"Rectangle",icon:u.Square,category:"Shapes",action:()=>a("add-shape","rect")},{id:"circle",label:"Circle",icon:u.Circle,category:"Shapes",action:()=>a("add-shape","circle")},{id:"triangle",label:"Triangle",icon:u.Triangle,category:"Shapes",action:()=>a("add-shape","triangle")},{id:"star5",label:"Star",icon:u.Star,category:"Shapes",action:()=>a("add-shape","star5")},{id:"arrowRight",label:"Arrow",icon:u.ArrowRight,category:"Shapes",action:()=>a("add-shape","arrowRight")}],[a]),X=(0,re.useMemo)(()=>_.filter(f=>f.label.toLowerCase().includes(r.toLowerCase())||f.category.toLowerCase().includes(r.toLowerCase())),[_,r]);if((0,re.useEffect)(()=>{S(0)},[r]),(0,re.useEffect)(()=>{let f=o=>{v==="default"&&(o.key==="ArrowDown"?(o.preventDefault(),S(x=>(x+1)%X.length)):o.key==="ArrowUp"?(o.preventDefault(),S(x=>(x-1+X.length)%X.length)):o.key==="Enter"&&(o.preventDefault(),X[g]&&X[g].action())),o.key==="Escape"&&(o.preventDefault(),m())};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[X,g,m,v]),(0,re.useEffect)(()=>{if(v==="default"&&V.current){let f=V.current.children[g];f&&f.scrollIntoView({block:"nearest"})}},[g,v]),v==="default"&&X.length===0&&r==="")return null;if(v==="textbox"||v==="text-selection"){let f=(s==null?void 0:s.fontFamily)||"Arial",o=(s==null?void 0:s.fontSize)||24,x=(0,re.useRef)(null),[C,$]=(0,re.useState)(null);re.default.useLayoutEffect(()=>{if(x.current){let G=x.current.getBoundingClientRect(),xe=window.innerWidth,ae=window.innerHeight,E=c.x,W=c.y;E+G.width>xe-100&&(E=xe-G.width-100),E=Math.max(10,E),W+G.height>ae-20&&(W=ae-G.height-20),$({x:E,y:W})}},[c.x,c.y]);let D=C||{x:c.x,y:c.y},se=C?1:0,ne=D.y>window.innerHeight/2;return(0,t.jsxs)("div",{ref:x,className:"fixed z-[9999] bg-white rounded-xl shadow-[0_20px_50px_rgba(0,0,0,0.15)] border border-slate-200 p-2.5 flex flex-col gap-2.5 animate-in fade-in zoom-in-95 duration-200",style:{left:`${D.x}px`,top:`${D.y}px`,width:"auto",minWidth:"440px",maxWidth:"90vw",opacity:se},onClick:G=>G.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 h-9",children:[(0,t.jsxs)("div",{className:"flex items-center bg-slate-50 border border-slate-200 rounded-lg h-full flex-1 shadow-sm",children:[(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsxs)("button",{onClick:()=>{y(!L),Z(!1)},className:"w-full flex items-center justify-between px-3 h-full text-xs font-bold text-slate-800 hover:bg-white transition-colors border-r border-slate-100 rounded-l-lg",children:[(0,t.jsx)("span",{className:"truncate",children:f}),(0,t.jsx)(u.ChevronDown,{size:14,className:"text-slate-400"})]}),L&&(0,t.jsx)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-2xl z-50 py-1 min-w-[180px] max-h-[250px] overflow-y-auto animate-in fade-in slide-in-from-top-2",children:Pa.map(G=>(0,t.jsx)("button",{onClick:()=>{a("format",{fontFamily:G}),y(!1)},className:I("w-full text-left px-4 py-2 text-xs hover:bg-blue-50 transition-colors",f===G?"text-blue-600 font-bold bg-blue-100/50":"text-slate-700"),style:{fontFamily:G},children:G},G))})]}),(0,t.jsxs)("div",{className:"relative w-16",children:[(0,t.jsxs)("button",{onClick:()=>{Z(!b),y(!1)},className:"w-full flex items-center justify-between px-2 h-full text-xs font-black text-slate-900 hover:bg-white transition-colors rounded-r-lg",children:[(0,t.jsx)("span",{children:o}),(0,t.jsx)(u.ChevronDown,{size:14,className:"text-slate-400"})]}),b&&(0,t.jsx)("div",{className:"absolute top-full right-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-2xl z-50 py-1 min-w-[80px] max-h-[250px] overflow-y-auto animate-in fade-in slide-in-from-top-2",children:Ta.map(G=>(0,t.jsx)("button",{onClick:()=>{a("format",{fontSize:G}),Z(!1)},className:I("w-full text-center px-4 py-2 text-xs hover:bg-blue-50 transition-colors",o===G?"text-blue-600 font-bold bg-blue-100/50":"text-slate-700"),children:G},G))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 px-1 bg-slate-50 border border-slate-200 rounded-lg h-full shadow-sm",children:[(0,t.jsxs)("button",{onClick:()=>a("format",{fontSize:o+2}),className:"p-1 hover:bg-white hover:text-blue-600 rounded-md text-slate-500 transition-all active:scale-95 flex items-center justify-center",title:"Increase font size",children:[(0,t.jsx)("span",{className:"text-[13px] font-black leading-none translate-y-[1px]",children:"A"}),(0,t.jsx)(u.ChevronUp,{size:10,strokeWidth:4,className:"ml-0.5"})]}),(0,t.jsxs)("button",{onClick:()=>a("format",{fontSize:Math.max(1,o-2)}),className:"p-1 hover:bg-white hover:text-blue-600 rounded-md text-slate-500 transition-all active:scale-95 flex items-center justify-center",title:"Decrease font size",children:[(0,t.jsx)("span",{className:"text-[11px] font-black leading-none translate-y-[1px]",children:"A"}),(0,t.jsx)(u.ChevronDown,{size:10,strokeWidth:4,className:"ml-0.5"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 border-t border-slate-100 pt-2.5 flex-nowrap",children:[(0,t.jsx)("button",{onClick:()=>a("format",{isBold:!(s!=null&&s.isBold)}),className:I("p-1.5 rounded-md transition-all",s!=null&&s.isBold?"text-blue-600 bg-blue-50 shadow-sm":"text-slate-200 hover:bg-slate-50 hover:text-slate-500"),title:"Bold",children:(0,t.jsx)(u.Bold,{size:18,strokeWidth:2})}),(0,t.jsx)("button",{onClick:()=>a("format",{isItalic:!(s!=null&&s.isItalic)}),className:I("p-1.5 rounded-md transition-all",s!=null&&s.isItalic?"text-blue-600 bg-blue-50 shadow-sm":"text-slate-200 hover:bg-slate-50 hover:text-slate-500"),title:"Italic",children:(0,t.jsx)(u.Italic,{size:18,strokeWidth:2})}),(0,t.jsx)("button",{onClick:()=>a("format",{isUnderline:!(s!=null&&s.isUnderline)}),className:I("p-1.5 rounded-md transition-all",s!=null&&s.isUnderline?"text-blue-600 bg-blue-50 shadow-sm":"text-slate-200 hover:bg-slate-50 hover:text-slate-500"),title:"Underline",children:(0,t.jsx)(u.Underline,{size:18,strokeWidth:2})}),(0,t.jsx)("div",{className:"w-[1px] h-4 bg-slate-100 mx-1.5"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{onClick:()=>K(!k),className:I("flex items-center gap-1.5 px-2 py-1 rounded-md transition-all text-sm font-bold whitespace-nowrap",k?"bg-purple-50 text-purple-600 ring-1 ring-purple-100":"text-slate-500 hover:bg-purple-50 hover:text-purple-600"),children:[(0,t.jsx)(u.Sparkles,{size:14,className:k?"fill-purple-300":""}),(0,t.jsx)("span",{children:"Ask AI"}),(0,t.jsx)(u.ChevronDown,{size:12,className:"opacity-50"})]}),k&&(0,t.jsxs)("div",{className:I("absolute left-0 w-80 bg-white border border-slate-200 rounded-xl shadow-2xl z-[1000] animate-in fade-in zoom-in-95 duration-200 overflow-hidden text-left",ne?"bottom-full mb-2 origin-bottom-left":"top-full mt-2 origin-top-left"),children:[(0,t.jsx)("div",{className:"px-3 py-2.5 bg-purple-50/50 border-b border-purple-100 flex items-center justify-between",children:(0,t.jsxs)("span",{className:"text-xs font-bold text-purple-700 uppercase tracking-wider flex items-center gap-2",children:[(0,t.jsx)(u.Sparkles,{size:12}),"Ask AI"]})}),P?(0,t.jsxs)("div",{className:"p-8 flex flex-col items-center justify-center gap-3 text-slate-400",children:[(0,t.jsx)(u.RefreshCw,{size:24,className:"animate-spin text-purple-500"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:"AI is thinking..."})]}):j?(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"p-4 bg-slate-50/50 max-h-[200px] overflow-y-auto text-sm text-slate-700 leading-relaxed border-b border-slate-100",children:j}),(0,t.jsxs)("div",{className:"p-1.5 flex flex-col gap-0.5",children:[(0,t.jsxs)("button",{onClick:()=>{M==null||M("replace"),K(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.Check,{size:14,className:"text-slate-400"}),(0,t.jsx)("span",{children:"Replace selection"})]}),(0,t.jsxs)("button",{onClick:()=>{M==null||M("addBelow"),K(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.ArrowRightFromLine,{size:14,className:"text-slate-400 rotate-90"}),(0,t.jsx)("span",{children:"Insert below"})]}),(0,t.jsxs)("button",{onClick:()=>{M==null||M("regenerate"),K(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-blue-600 hover:bg-blue-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.RefreshCw,{size:14}),(0,t.jsx)("span",{children:"Try again"})]}),(0,t.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,t.jsxs)("button",{onClick:()=>{M==null||M("discard"),K(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-red-600 hover:bg-red-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.Trash2,{size:14}),(0,t.jsx)("span",{children:"Discard"})]})]})]}):(0,t.jsxs)("div",{className:"p-1.5 flex flex-col gap-0.5",children:[(0,t.jsx)("div",{className:"px-2 py-1 text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:"Edit Selection"}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","rewrite")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.RefreshCw,{size:14,className:"text-blue-500"}),(0,t.jsx)("span",{children:"Improve writing"})]}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","grammar")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.SpellCheck,{size:14,className:"text-green-500"}),(0,t.jsx)("span",{children:"Fix grammar"})]}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","shorten")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.ALargeSmall,{size:14,className:"text-orange-500"}),(0,t.jsx)("span",{children:"Make shorter"})]}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","lengthen")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.ArrowRightFromLine,{size:14,className:"text-purple-500"}),(0,t.jsx)("span",{children:"Make longer"})]}),(0,t.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,t.jsx)("div",{className:"px-2 py-1 text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Generate"}),(0,t.jsxs)("button",{onClick:()=>{a("generate-image"),K(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.Image,{size:14,className:"text-pink-500"}),(0,t.jsx)("span",{children:"Generate Image"})]}),(0,t.jsxs)("button",{onClick:()=>{a("generate-infographic"),K(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.PieChart,{size:14,className:"text-indigo-500"}),(0,t.jsx)("span",{children:"Generate Infographic"})]}),(0,t.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,t.jsx)("div",{className:"px-2 py-1 text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"More"}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","continue")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.MoveDown,{size:14,className:"text-teal-500"}),(0,t.jsx)("span",{children:"Continue writing"})]})]})]})]}),(0,t.jsx)("div",{className:"w-[1px] h-4 bg-slate-100 mx-1.5"}),(0,t.jsxs)("div",{className:"relative flex items-center rounded-md transition-all",children:[(0,t.jsx)("button",{onClick:()=>a("format",{isBulleted:!(s!=null&&s.isBulleted),isNumbered:!1,listType:s!=null&&s.isBulleted?"none":"bullet-disc"}),className:I("p-1.5 rounded-l-md transition-all",s!=null&&s.isBulleted?"text-blue-600 bg-blue-50":"text-slate-500 hover:bg-slate-50"),title:"Bullets",children:(0,t.jsx)(u.List,{size:18,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>J(!U),className:I("p-0.5 rounded-r-md border-l border-transparent hover:border-slate-200 transition-all",U?"bg-slate-100":"hover:bg-slate-50"),children:(0,t.jsx)(u.ChevronDown,{size:10,className:"text-slate-400"})}),U&&(0,t.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!1,listType:"none"}),J(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,t.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-disc"}),J(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-circle"}),J(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-square"}),J(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-check"}),J(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"\u2713"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"\u2713"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,t.jsxs)("div",{className:"relative text-black flex items-center rounded-md transition-all",children:[(0,t.jsx)("button",{onClick:()=>a("format",{isNumbered:!(s!=null&&s.isNumbered),isBulleted:!1,listType:s!=null&&s.isNumbered?"none":"number-decimal"}),className:I("p-1.5 rounded-l-md transition-all",s!=null&&s.isNumbered?"text-blue-600 bg-blue-50":"text-slate-500 hover:bg-slate-50"),title:"Numbering",children:(0,t.jsx)(u.ListOrdered,{size:18,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>N(!te),className:I("p-0.5 rounded-r-md border-l border-transparent hover:border-slate-200 transition-all",te?"bg-slate-100":"hover:bg-slate-50"),children:(0,t.jsx)(u.ChevronDown,{size:10,className:"text-slate-400"})}),te&&(0,t.jsxs)("div",{className:"absolute text-black top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!1,listType:"none"}),N(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,t.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!0,isBulleted:!1,listType:"number-decimal"}),N(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"1."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"2."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!0,isBulleted:!1,listType:"number-decimal-paren"}),N(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"1)"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"2)"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!0,isBulleted:!1,listType:"number-roman-lower"}),N(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"i."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"ii."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,t.jsx)("div",{className:"w-[1px] h-4 bg-slate-100 mx-1.5"}),(0,t.jsxs)("div",{className:"relative flex items-center",children:[(0,t.jsxs)("button",{className:"w-7 h-[22px] flex flex-col items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all relative",title:"Font Color",children:[(0,t.jsx)("span",{className:"text-[13px] font-black text-slate-800 leading-none",children:"A"}),(0,t.jsx)("div",{className:"w-4 h-[2.5px] rounded-sm mt-0.5",style:{backgroundColor:(s==null?void 0:s.color)||"#000000"}}),(0,t.jsx)("input",{type:"color",className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full",value:(s==null?void 0:s.color)||"#000000",onChange:G=>a("format",{color:G.target.value})})]}),(0,t.jsx)(u.ChevronDown,{size:8,className:"text-slate-400 -ml-0.5"})]}),(0,t.jsxs)("div",{className:"relative flex items-center",children:[(0,t.jsxs)("button",{className:"w-7 h-[22px] flex flex-col items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all relative",title:"Highlight Color",children:[(0,t.jsx)(u.Highlighter,{size:14,strokeWidth:2.5,className:s!=null&&s.highlightColor?"text-slate-900":"text-slate-500"}),(0,t.jsx)("div",{className:"w-4 h-[2.5px] rounded-sm mt-0.5",style:{backgroundColor:(s==null?void 0:s.highlightColor)||"transparent"}}),(0,t.jsx)("input",{type:"color",className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full",value:(s==null?void 0:s.highlightColor)||"#ffff00",onChange:G=>a("format",{highlightColor:G.target.value})})]}),(0,t.jsx)(u.ChevronDown,{size:8,className:"text-slate-400 -ml-0.5"})]}),(0,t.jsx)("button",{onClick:()=>a("format",{isBold:!1,isItalic:!1,isUnderline:!1,highlightColor:"",color:"#000000"}),className:"p-1.5 rounded-md text-slate-400 hover:bg-slate-50 hover:text-slate-600 transition-all",title:"Clear Formatting",children:(0,t.jsx)(u.Eraser,{size:18,strokeWidth:2.5})}),(0,t.jsxs)("div",{className:"gap-0.5 ml-auto",children:[(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"left"}),className:I("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="left"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(u.AlignLeft,{size:12,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"center"}),className:I("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="center"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(u.AlignCenter,{size:12,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"right"}),className:I("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="right"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(u.AlignRight,{size:12,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"justify"}),className:I("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="justify"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(u.AlignJustify,{size:12,strokeWidth:2.5})})]})]})]})}let Q=Math.max(10,Math.min(c.x,window.innerWidth-300)),n=Math.max(10,Math.min(c.y,window.innerHeight-450));return(0,t.jsxs)("div",{className:"fixed z-[9999] w-72 bg-white rounded-xl shadow-2xl border border-slate-200 overflow-hidden flex flex-col animate-in fade-in zoom-in duration-200",style:{left:`${Q}px`,top:`${n}px`,maxHeight:"400px"},onClick:f=>f.stopPropagation(),children:[(0,t.jsxs)("div",{className:"p-3 border-b border-slate-100 flex items-center gap-2 bg-slate-50/50",children:[(0,t.jsx)(u.Search,{size:14,className:"text-slate-400"}),(0,t.jsx)("input",{autoFocus:!0,type:"text",placeholder:"Type a command...",className:"bg-transparent border-none outline-none text-sm w-full font-medium text-slate-700 placeholder:text-slate-400",value:r,onChange:f=>T(f.target.value)})]}),(0,t.jsx)("div",{ref:V,className:"overflow-y-auto py-2 px-1 custom-scrollbar",children:X.length>0?X.map((f,o)=>{let x=o===g,C=o===0||X[o-1].category!==f.category;return(0,t.jsxs)(re.default.Fragment,{children:[C&&(0,t.jsx)("div",{className:"px-3 py-1.5 text-[10px] uppercase tracking-wider font-bold text-slate-400",children:f.category}),(0,t.jsxs)("button",{className:I("w-full flex items-center gap-3 px-3 py-2 text-left transition-all duration-150 rounded-lg group",x?"bg-slate-100":"hover:bg-slate-50"),onClick:()=>f.action(),onMouseEnter:()=>S(o),children:[(0,t.jsx)("div",{className:I("p-1.5 rounded-md transition-colors flex items-center justify-center relative",x?"bg-white shadow-sm text-blue-600":"bg-slate-100 text-slate-500 group-hover:text-slate-700"),children:(0,t.jsx)(f.icon,{size:16})}),(0,t.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,t.jsx)("span",{className:I("text-sm font-semibold truncate",x?"text-slate-900":"text-slate-700"),children:f.label}),f.description&&(0,t.jsx)("span",{className:"text-[11px] text-slate-400 truncate leading-tight",children:f.description})]}),x&&(0,t.jsx)("div",{className:"ml-auto text-[10px] font-mono font-bold text-slate-400 flex items-center gap-1 border border-slate-200 rounded px-1 bg-white",children:(0,t.jsx)("span",{children:"\u21B5"})})]})]},f.id)}):(0,t.jsxs)("div",{className:"px-3 py-8 text-center flex flex-col items-center gap-2",children:[(0,t.jsx)("div",{className:"p-3 bg-slate-50 rounded-full",children:(0,t.jsx)(u.Search,{size:20,className:"text-slate-300"})}),(0,t.jsxs)("span",{className:"text-sm text-slate-400 font-medium whitespace-nowrap",children:['No commands found for "',r,'"']})]})}),(0,t.jsxs)("div",{className:"px-3 py-2 border-t border-slate-100 bg-slate-50/50 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] font-medium text-slate-400",children:[(0,t.jsx)("span",{className:"border border-slate-200 rounded px-1 bg-white",children:"\u2191\u2193"}),(0,t.jsx)("span",{children:"to navigate"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] font-medium text-slate-400",children:[(0,t.jsx)("span",{className:"border border-slate-200 rounded px-1 bg-white",children:"Esc"}),(0,t.jsx)("span",{children:"to close"})]})]})]})};var q=require("lucide-react");var ta=require("react"),Be=require("lucide-react");var Le=require("react/jsx-runtime"),aa=({message:m,type:a="info",isOpen:c,onClose:h,autoHideDuration:v=4e3})=>{if((0,ta.useEffect)(()=>{if(c&&v>0){let P=setTimeout(()=>{h()},v);return()=>clearTimeout(P)}},[c,v,h]),!c)return null;let s={error:(0,Le.jsx)(Be.AlertCircle,{size:20,className:"text-white"}),success:(0,Le.jsx)(Be.CheckCircle,{size:20,className:"text-white"}),info:(0,Le.jsx)(Be.Info,{size:20,className:"text-white"})};return(0,Le.jsxs)("div",{className:I("fixed bottom-6 right-6 z-[10000] flex items-center gap-3 px-4 py-2 rounded-md shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300 min-w-[280px] max-w-[400px]",{error:"bg-red-500",success:"bg-emerald-500",info:"bg-slate-800"}[a]),children:[s[a],(0,Le.jsx)("span",{className:"text-white text-sm font-medium flex-1",children:m}),(0,Le.jsx)("button",{onClick:h,className:"p-1 hover:bg-white/20 rounded-full transition-colors ml-1",children:(0,Le.jsx)(Be.X,{size:14,className:"text-white"})})]})};var l=require("react/jsx-runtime"),Ha=({initialPresentation:m,url:a,appName:c="My Studio",onChange:h,geminiApiKey:v="AIzaSyAcBfseKzoFZJMfuRzhRJjygQ-u2UKFxOw",width:s,height:j,appBgColor:P="#B7472A",showHomeOnEmpty:M=!1,initialSource:r,onSourceChange:T,proxyUrl:g,onGenerateImage:S,onGenerateInfographic:V,onAiRewrite:L,onAiGrammar:y,onAiShorten:b,onAiLengthen:Z,onAiContinue:U,isTwoStepInfographicGeneration:J,onRefineInfographicPrompt:te})=>{var Ut,Ft;let[N,k]=(0,B.useState)(m||{slides:[{id:"slide-1",elements:[]}],layout:{width:12192e3,height:6858e3}}),[K,_]=(0,B.useState)([]),[X,Q]=(0,B.useState)([]),[n,f]=(0,B.useState)(0),[o,x]=(0,B.useState)(null),[C,$]=(0,B.useState)(!1),[D,se]=(0,B.useState)(null),[ne,G]=(0,B.useState)(!1),[xe,ae]=(0,B.useState)(r||(a?"url":null)),[E,W]=(0,B.useState)(M&&!m&&!a&&!r),[oe,Se]=(0,B.useState)(""),[me,Ne]=(0,B.useState)({visible:!1,position:{x:0,y:0},mode:"default"}),[ve,fe]=(0,B.useState)(!1),[O,tt]=(0,B.useState)(""),[at,rt]=(0,B.useState)(!1),[H,ie]=(0,B.useState)(null),[he,ke]=(0,B.useState)(!1),[_e,Pe]=(0,B.useState)(!1),[sa,Ye]=(0,B.useState)(!1),[st,Nt]=(0,B.useState)(""),[kt,Ct]=(0,B.useState)(!1),[Ce,ot]=(0,B.useState)(null),[it,Lt]=(0,B.useState)(!1),[oa,St]=(0,B.useState)(!1),[lt,Ve]=(0,B.useState)(null),[nt,zt]=(0,B.useState)({open:!1,message:"",type:"info"}),ze=(i,d="info")=>{zt({open:!0,message:i,type:d})};(0,B.useEffect)(()=>{H&&(ke(!1),Pe(!0))},[H]),(0,B.useEffect)(()=>{Ce&&(Lt(!1),Pe(!0))},[Ce]),(0,B.useEffect)(()=>{a&&Je(a)},[a]);let[It,Te]=(0,B.useState)(!1),[Ue,ct]=(0,B.useState)(null),Ke=(0,B.useMemo)(()=>{let i=typeof s=="number"?s:parseInt(String(s));return isNaN(i)?1:Math.min(Math.max(i/1600,.7),1)},[s]),we=N.slides[n],Fe=(0,B.useMemo)(()=>we.elements.find(i=>i.id===o)||null,[we,o]),$e=(0,B.useCallback)(i=>{_(d=>[...d.slice(-19),N]),Q([]),k(i),h==null||h(i)},[h,N]),Mt=()=>{if(K.length===0)return;let i=K[K.length-1];Q(d=>[...d,N]),_(d=>d.slice(0,-1)),k(i)},dt=()=>{if(X.length===0)return;let i=X[X.length-1];_(d=>[...d,N]),Q(d=>d.slice(0,-1)),k(i)},Ie=(0,B.useCallback)(i=>{k(d=>{let p=[...d.slides];p[n]=z(z({},p[n]),i);let A=R(z({},d),{slides:p});return _(ee=>[...ee.slice(-19),d]),Q([]),h==null||h(A),A})},[n,h]),Ze=(0,B.useCallback)((i,d)=>{k(p=>{let A=p.slides[n],ee=A.elements.map(ce=>ce.id===i?z(z({},ce),d):ce),ue=[...p.slides];ue[n]=R(z({},A),{elements:ee});let ye=R(z({},p),{slides:ue});return h==null||h(ye),ye})},[n,h]),At=i=>{if(!o)return;if(we.elements.find(p=>p.id===o)){Ze(o,i);let p=N.slides[n],A=p.elements.map(ue=>ue.id===o?z(z({},ue),i):ue),ee=[...N.slides];ee[n]=R(z({},p),{elements:A}),$e(R(z({},N),{slides:ee}))}},Ge=(0,B.useCallback)(()=>{if(!o)return;let d=N.slides[n].elements.filter(p=>p.id!==o);Ie({elements:d}),x(null)},[o,n,N,Ie]),Bt=()=>{let i={id:`text-${Date.now()}`,type:"text",content:"New Text",x:100,y:100,width:400,height:100,fontSize:48,fontFamily:"Arial",color:"#000000",zIndex:we.elements.length};Ie({elements:[...we.elements,i]})},Oe=(0,B.useCallback)(async i=>{let d="";typeof i=="string"?d=i:d=await new Promise(ee=>{let ue=new FileReader;ue.onload=ye=>{var ce;return ee((ce=ye.target)==null?void 0:ce.result)},ue.readAsDataURL(i)});let p=`img-${Date.now()}`,A={id:p,type:"image",src:d,x:100,y:100,width:400,height:250,zIndex:we.elements.length};Ie({elements:[...we.elements,A]}),x(p)},[we.elements,Ie,x]),Pt=i=>{let d={id:`shape-${Date.now()}`,type:"shape",shapeType:i,fill:"#3b82f6",x:200,y:200,width:200,height:200,zIndex:we.elements.length};Ie({elements:[...we.elements,d]})},Tt=()=>{let i={id:`slide-${Date.now()}`,elements:[]};$e(R(z({},N),{slides:[...N.slides,i]})),f(N.slides.length)},ia=i=>{if(N.slides.length<=1)return;let d=N.slides.filter((p,A)=>A!==i);$e(R(z({},N),{slides:d})),i<=n&&f(Math.max(0,n-1))},la=i=>{let d=N.slides[i],p=R(z({},d),{id:`slide-${Date.now()}`,elements:d.elements.map(ee=>R(z({},ee),{id:`${ee.type}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}))}),A=[...N.slides];A.splice(i+1,0,p),$e(R(z({},N),{slides:A})),f(i+1)},na=(i,d)=>{if(i===d)return;let p=[...N.slides],[A]=p.splice(i,1);p.splice(d,0,A),$e(R(z({},N),{slides:p})),n===i?f(d):n>i&&n<=d?f(n-1):n<i&&n>=d&&f(n+1)},ca=i=>{let d=[],p=Date.now();i==="title"?d=[{id:`text-title-${p}`,type:"text",content:"Presentation Title",x:100,y:200,width:1e3,height:150,fontSize:80,fontFamily:"Inter",color:"#000000",textAlign:"center",isBold:!0,zIndex:0},{id:`text-sub-${p}`,type:"text",content:"Subtitle goes here",x:200,y:380,width:800,height:80,fontSize:36,fontFamily:"Inter",color:"#64748b",textAlign:"center",zIndex:1}]:i==="content"?d=[{id:`text-title-${p}`,type:"text",content:"Slide Title",x:60,y:40,width:800,height:80,fontSize:48,fontFamily:"Inter",color:"#000000",isBold:!0,zIndex:0},{id:`text-body-${p}`,type:"text",content:`\u2022 Add your points here
5
5
  \u2022 Press Enter for new line
6
6
  \u2022 Use the toolbar to format`,x:60,y:150,width:1080,height:480,fontSize:28,fontFamily:"Inter",color:"#334155",zIndex:1,isBulleted:!0}]:i==="split"&&(d=[{id:`text-title-${p}`,type:"text",content:"Comparison Layout",x:60,y:40,width:1080,height:80,fontSize:48,fontFamily:"Inter",color:"#000000",isBold:!0,textAlign:"center",zIndex:0},{id:`text-left-${p}`,type:"text",content:"Left column content goes here.",x:60,y:180,width:520,height:400,fontSize:24,fontFamily:"Inter",color:"#334155",zIndex:1},{id:`text-right-${p}`,type:"text",content:"Right column content goes here.",x:620,y:180,width:520,height:400,fontSize:24,fontFamily:"Inter",color:"#334155",zIndex:2}]),Ie({elements:d})},pt=async(i,d)=>{let A=N.slides[n].elements.find(ee=>ee.id===i);if(!(!A||A.type!=="text")){Te(!0),se(null),ct({id:i,action:d});try{if(!v){ze("Gemini API key is missing. Please provide it via the 'geminiApiKey' prop.","error"),Te(!1);return}let ue=new wt.GoogleGenerativeAI(v).getGenerativeModel({model:"gemini-flash-latest",systemInstruction:`You are a professional presentation assistant. Your task is to transform slide text according to specific user requests (shorten, reframe, or lengthen).