@abduljebar/text-editor 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  (function(te,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react"],A):(te=typeof globalThis<"u"?globalThis:te||self,A(te.TextEditor={},te.React,te.LucideReact))})(this,(function(te,A,V){"use strict";var pt=document.createElement("style");pt.textContent=`/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */@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-border-style:solid;--tw-leading:initial;--tw-font-weight: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-duration:initial;--tw-space-y-reverse:0}}}@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-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-600:oklch(64.6% .222 41.116);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--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-blue-800:oklch(42.4% .199 265.638);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-6xl:72rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--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-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--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{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;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{vertical-align:baseline;font-size:75%;line-height:0;position:relative}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{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}: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}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{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{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-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]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.inline{display:inline}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.min-h-\\[400px\\]{min-height:400px}.min-h-\\[500px\\]{min-height:500px}.w-9{width:calc(var(--spacing)*9)}.w-full{width:100%}.w-px{width:1px}.max-w-6xl{max-width:var(--container-6xl)}.max-w-none{max-width:none}.resize-none{resize:none}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-blue-300{border-color:var(--color-blue-300)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-green-600{background-color:var(--color-green-600)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.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)}.text-blue-600{color:var(--color-blue-600)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-orange-600{color:var(--color-orange-600)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.placeholder-gray-400::-moz-placeholder{color:var(--color-gray-400)}.placeholder-gray-400::placeholder{color:var(--color-gray-400)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.hover\\:bg-blue-200:hover{background-color:var(--color-blue-200)}.hover\\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\\:bg-red-700:hover{background-color:var(--color-red-700)}}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-blue-300:disabled{background-color:var(--color-blue-300)}@media (min-width:40rem){.sm\\:mt-0{margin-top:calc(var(--spacing)*0)}}.animate-fadeIn{animation:.3s ease-in-out fadeIn}}.editor-content h1{margin-top:calc(var(--spacing)*4);margin-bottom:calc(var(--spacing)*2);font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content p{margin-bottom:calc(var(--spacing)*4)}.editor-content a{color:var(--color-blue-600);text-decoration-line:underline}@keyframes fadeIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.editor-content h1{margin-top:calc(var(--spacing)*6);margin-bottom:calc(var(--spacing)*4);border-bottom-style:var(--tw-border-style);padding-bottom:calc(var(--spacing)*2);font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800);border-bottom-width:1px}.editor-content h2{margin-top:calc(var(--spacing)*5);margin-bottom:calc(var(--spacing)*3);font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content h3{margin-top:calc(var(--spacing)*4);margin-bottom:calc(var(--spacing)*2);font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content p{margin-bottom:calc(var(--spacing)*4);--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);color:var(--color-gray-700)}.editor-content ul{margin-bottom:calc(var(--spacing)*4);margin-left:calc(var(--spacing)*4);list-style-type:disc;list-style-position:inside}:where(.editor-content ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.editor-content ol{margin-bottom:calc(var(--spacing)*4);margin-left:calc(var(--spacing)*4);list-style-type:decimal;list-style-position:inside}:where(.editor-content ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.editor-content li{margin-bottom:calc(var(--spacing)*1)}.editor-content a{color:var(--color-blue-600);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));text-decoration-line:underline}@media (hover:hover){.editor-content a:hover{color:var(--color-blue-800)}}.editor-content blockquote{margin-block:calc(var(--spacing)*4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--color-blue-500);padding-left:calc(var(--spacing)*4);color:var(--color-gray-600);font-style:italic}.editor-content code{background-color:var(--color-gray-100);padding-inline:calc(var(--spacing)*2);padding-block:calc(var(--spacing)*1);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:.25rem}.editor-content pre{margin-block:calc(var(--spacing)*4);border-radius:var(--radius-lg);background-color:var(--color-gray-800);padding:calc(var(--spacing)*4);color:var(--color-gray-100);overflow-x:auto}.editor-content pre code{padding:calc(var(--spacing)*0);color:inherit;background-color:#0000}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{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:0}@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-duration{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}
2
- /*$vite$:1*/`,document.head.appendChild(pt);var $e={exports:{}},ve={};/**
2
+ /*$vite$:1*/`,document.head.appendChild(pt);var Te={exports:{}},ve={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
5
5
  *
@@ -15,15 +15,15 @@
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var ft;function Er(){return ft||(ft=1,process.env.NODE_ENV!=="production"&&(function(){function e(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===Ve?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case N:return"Fragment";case U:return"Profiler";case D:return"StrictMode";case J:return"Suspense";case $:return"SuspenseList";case H:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case I:return"Portal";case R:return u.displayName||"Context";case M:return(u._context.displayName||"Context")+".Consumer";case F:var x=u.render;return u=u.displayName,u||(u=x.displayName||x.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case b:return x=u.displayName||null,x!==null?x:e(u.type)||"Memo";case G:x=u._payload,u=u._init;try{return e(u(x))}catch{}}return null}function t(u){return""+u}function r(u){try{t(u);var x=!1}catch{x=!0}if(x){x=console;var E=x.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return E.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),t(u)}}function o(u){if(u===N)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===G)return"<...>";try{var x=e(u);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function n(){var u=ne.A;return u===null?null:u.getOwner()}function i(){return Error("react-stack-top-frame")}function a(u){if(ze.call(u,"key")){var x=Object.getOwnPropertyDescriptor(u,"key").get;if(x&&x.isReactWarning)return!1}return u.key!==void 0}function s(u,x){function E(){Y||(Y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}E.isReactWarning=!0,Object.defineProperty(u,"key",{get:E,configurable:!0})}function c(){var u=e(this.type);return K[u]||(K[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function d(u,x,E,C,Q,ge){var Z=E.ref;return u={$$typeof:w,type:u,key:x,props:E,_owner:C},(Z!==void 0?Z:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:c}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ge}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function p(u,x,E,C,Q,ge){var Z=x.children;if(Z!==void 0)if(C)if(Ee(Z)){for(C=0;C<Z.length;C++)_(Z[C]);Object.freeze&&Object.freeze(Z)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(Z);if(ze.call(x,"key")){Z=e(u);var ee=Object.keys(x).filter(function(be){return be!=="key"});C=0<ee.length?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}",Ce[Z+C]||(ee=0<ee.length?"{"+ee.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ */var ft;function Er(){return ft||(ft=1,process.env.NODE_ENV!=="production"&&(function(){function e(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===Ve?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case N:return"Fragment";case U:return"Profiler";case D:return"StrictMode";case J:return"Suspense";case $:return"SuspenseList";case H:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case T:return"Portal";case R:return u.displayName||"Context";case M:return(u._context.displayName||"Context")+".Consumer";case F:var _=u.render;return u=u.displayName,u||(u=_.displayName||_.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case w:return _=u.displayName||null,_!==null?_:e(u.type)||"Memo";case G:_=u._payload,u=u._init;try{return e(u(_))}catch{}}return null}function t(u){return""+u}function r(u){try{t(u);var _=!1}catch{_=!0}if(_){_=console;var z=_.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return z.call(_,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),t(u)}}function o(u){if(u===N)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===G)return"<...>";try{var _=e(u);return _?"<"+_+">":"<...>"}catch{return"<...>"}}function n(){var u=ne.A;return u===null?null:u.getOwner()}function i(){return Error("react-stack-top-frame")}function a(u){if(ze.call(u,"key")){var _=Object.getOwnPropertyDescriptor(u,"key").get;if(_&&_.isReactWarning)return!1}return u.key!==void 0}function s(u,_){function z(){Y||(Y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",_))}z.isReactWarning=!0,Object.defineProperty(u,"key",{get:z,configurable:!0})}function c(){var u=e(this.type);return K[u]||(K[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function d(u,_,z,C,Q,ge){var E=z.ref;return u={$$typeof:b,type:u,key:_,props:z,_owner:C},(E!==void 0?E:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:c}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ge}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function h(u,_,z,C,Q,ge){var E=_.children;if(E!==void 0)if(C)if(Ee(E)){for(C=0;C<E.length;C++)Z(E[C]);Object.freeze&&Object.freeze(E)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Z(E);if(ze.call(_,"key")){E=e(u);var ee=Object.keys(_).filter(function(be){return be!=="key"});C=0<ee.length?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}",Ce[E+C]||(ee=0<ee.length?"{"+ee.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
19
19
  let props = %s;
20
20
  <%s {...props} />
21
21
  React keys must be passed directly to JSX without using spread:
22
22
  let props = %s;
23
- <%s key={someKey} {...props} />`,C,Z,ee,Z),Ce[Z+C]=!0)}if(Z=null,E!==void 0&&(r(E),Z=""+E),a(x)&&(r(x.key),Z=""+x.key),"key"in x){E={};for(var ie in x)ie!=="key"&&(E[ie]=x[ie])}else E=x;return Z&&s(E,typeof u=="function"?u.displayName||u.name||"Unknown":u),d(u,Z,E,n(),Q,ge)}function _(u){k(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===G&&(u._payload.status==="fulfilled"?k(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function k(u){return typeof u=="object"&&u!==null&&u.$$typeof===w}var m=A,w=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),R=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),Ve=Symbol.for("react.client.reference"),ne=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ze=Object.prototype.hasOwnProperty,Ee=Array.isArray,X=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(u){return u()}};var Y,K={},v=m.react_stack_bottom_frame.bind(m,i)(),Ze=X(o(i)),Ce={};we.Fragment=N,we.jsx=function(u,x,E){var C=1e4>ne.recentlyCreatedOwnerStacks++;return p(u,x,E,!1,C?Error("react-stack-top-frame"):v,C?X(o(u)):Ze)},we.jsxs=function(u,x,E){var C=1e4>ne.recentlyCreatedOwnerStacks++;return p(u,x,E,!0,C?Error("react-stack-top-frame"):v,C?X(o(u)):Ze)}})()),we}var ht;function Zr(){return ht||(ht=1,process.env.NODE_ENV==="production"?$e.exports=zr():$e.exports=Er()),$e.exports}var y=Zr();const Cr=({onCommand:e,onSave:t,onExport:r,onClear:o,showButtons:n=!1,hasUnsavedChanges:i})=>{const[a,s]=A.useState([]),[c,d]=A.useState("p"),p=()=>{const m=[];let w="p";document.queryCommandState("bold")&&m.push("bold"),document.queryCommandState("italic")&&m.push("italic"),document.queryCommandState("underline")&&m.push("underline"),document.queryCommandState("strikeThrough")&&m.push("strikeThrough"),document.queryCommandState("insertUnorderedList")&&m.push("insertUnorderedList"),document.queryCommandState("insertOrderedList")&&m.push("insertOrderedList"),document.queryCommandState("justifyLeft")&&m.push("justifyLeft"),document.queryCommandState("justifyCenter")&&m.push("justifyCenter"),document.queryCommandState("justifyRight")&&m.push("justifyRight");const I=window.getSelection();if(I&&I.rangeCount>0){let N=I.getRangeAt(0).commonAncestorContainer;for(;N&&N.nodeType===Node.ELEMENT_NODE;){const D=N,U=D.tagName.toLowerCase();if(["h1","h2","p","div"].includes(U)){U==="h1"||U==="h2"?(w=U,m.push(`formatBlock:${U}`)):(U==="p"||U==="div"&&!w)&&(w="p");break}N=D.parentNode}}d(w),s(m)};A.useEffect(()=>{const m=()=>{p()},w=()=>{setTimeout(p,10)};return document.addEventListener("selectionchange",m),document.addEventListener("click",w),document.addEventListener("keyup",w),()=>{document.removeEventListener("selectionchange",m),document.removeEventListener("click",w),document.removeEventListener("keyup",w)}},[]);const _=()=>{const m=prompt("Enter URL:");m&&e("createLink",m)},k=[{id:"bold",command:"bold",icon:y.jsx(V.Bold,{size:18}),title:"Bold"},{id:"italic",command:"italic",icon:y.jsx(V.Italic,{size:18}),title:"Italic"},{id:"underline",command:"underline",icon:y.jsx(V.Underline,{size:18}),title:"Underline"},{id:"strikeThrough",command:"strikeThrough",icon:y.jsx(V.Strikethrough,{size:18}),title:"Strikethrough"},{id:"separator-1",separator:!0},{id:"unordered-list",command:"insertUnorderedList",icon:y.jsx(V.List,{size:18}),title:"Bullet List"},{id:"ordered-list",command:"insertOrderedList",icon:y.jsx(V.ListOrdered,{size:18}),title:"Numbered List"},{id:"separator-2",separator:!0},{id:"heading-1",command:"formatBlock",value:"h1",icon:y.jsx(V.Heading1,{size:18}),title:"Heading 1",isActive:c==="h1"},{id:"heading-2",command:"formatBlock",value:"h2",icon:y.jsx(V.Heading2,{size:18}),title:"Heading 2",isActive:c==="h2"},{id:"paragraph",command:"formatBlock",value:"p",icon:y.jsx(V.Type,{size:18}),title:"Paragraph",isActive:c==="p"},{id:"separator-3",separator:!0},{id:"align-left",command:"justifyLeft",icon:y.jsx(V.AlignLeft,{size:18}),title:"Align Left"},{id:"align-center",command:"justifyCenter",icon:y.jsx(V.AlignCenter,{size:18}),title:"Center"},{id:"align-right",command:"justifyRight",icon:y.jsx(V.AlignRight,{size:18}),title:"Align Right"},{id:"separator-4",separator:!0},{id:"link",command:"createLink",icon:y.jsx(V.Link,{size:18}),title:"Insert Link",onClick:_}];return y.jsxs("div",{className:"flex flex-wrap justify-between items-center p-3 bg-gray-50 border-b border-gray-200",children:[y.jsx("div",{className:"flex flex-wrap items-center gap-1",children:k.map(m=>{if("separator"in m)return y.jsx("div",{className:"w-px h-6 bg-gray-300 mx-2"},m.id);const w=m.isActive!==void 0?m.isActive:a.includes(m.command);return y.jsx("button",{onClick:()=>m.onClick?m.onClick():e(m.command,m.value),title:m.title,type:"button",className:`w-9 h-9 flex items-center justify-center rounded-md border transition-colors duration-200
24
- ${w?"bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200":"bg-white border-gray-300 text-gray-700 hover:bg-gray-100"}`,children:m.icon},m.id)})}),n&&y.jsxs("div",{className:"flex items-center gap-2 mt-2 sm:mt-0",children:[y.jsxs("button",{onClick:t,disabled:!i,title:"Save Document",className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed transition-colors duration-200",children:[y.jsx(V.Save,{size:16}),y.jsx("span",{children:"Save"})]}),y.jsxs("button",{onClick:r,title:"Export as HTML",className:"flex items-center gap-2 px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 transition-colors duration-200",children:[y.jsx(V.FileDown,{size:16}),y.jsx("span",{children:"Export"})]}),y.jsxs("button",{onClick:o,title:"Clear Editor",className:"flex items-center gap-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 transition-colors duration-200",children:[y.jsx(V.Trash2,{size:16}),y.jsx("span",{children:"Clear"})]})]})]})},$r=({wordCount:e,characterCount:t,hasUnsavedChanges:r})=>y.jsx("div",{className:"flex justify-between items-center px-5 py-3 bg-gray-50 border-t border-gray-200 text-sm text-gray-600",children:y.jsxs("div",{className:"flex items-center gap-6",children:[y.jsxs("div",{children:["Words: ",y.jsx("strong",{className:"text-gray-800",children:e})]}),y.jsxs("div",{children:["Characters: ",y.jsx("strong",{className:"text-gray-800",children:t})]}),y.jsxs("div",{children:["Status: ",y.jsx("strong",{className:r?"text-orange-600":"text-green-600",children:r?"Unsaved Changes":"Saved"})]})]})});function l(e,t,r){function o(s,c){var d;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(d=s._zod).traits??(d.traits=new Set),s._zod.traits.add(e),t(s,c);for(const p in a.prototype)p in s||Object.defineProperty(s,p,{value:a.prototype[p].bind(s)});s._zod.constr=a,s._zod.def=c}const n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var c;const d=r?.Parent?new i:this;o(d,s),(c=d._zod).deferred??(c.deferred=[]);for(const p of d._zod.deferred)p();return d}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class de extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const bt={};function ae(e){return bt}function Tr(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function We(e,t){return typeof t=="bigint"?t.toString():t}function Be(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ye(e){return e==null}function Je(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ar(e,t){const r=(e.toString().split(".")[1]||"").length,o=t.toString();let n=(o.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(o)){const c=o.match(/\d?e-(\d?)/);c?.[1]&&(n=Number.parseInt(c[1]))}const i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}const vt=Symbol("evaluating");function T(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==vt)return o===void 0&&(o=vt,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function se(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ce(...e){const t={};for(const r of e){const o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function wt(e){return JSON.stringify(e)}const kt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Sr=Be(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ke(e){if(Te(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(Te(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function yt(e){return ke(e)?{...e}:Array.isArray(e)?[...e]:e}const Ir=new Set(["string","number","symbol"]);function Ae(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function re(e,t,r){const o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function g(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function jr(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Pr={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Rr(e,t){const r=e._zod.def,o=ce(e._zod.def,{get shape(){const n={};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(n[i]=r.shape[i])}return se(this,"shape",n),n},checks:[]});return re(e,o)}function Or(e,t){const r=e._zod.def,o=ce(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete n[i]}return se(this,"shape",n),n},checks:[]});return re(e,o)}function Nr(e,t){if(!ke(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const n=ce(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return se(this,"shape",i),i},checks:[]});return re(e,n)}function Lr(e,t){if(!ke(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const o={...e._zod.def.shape,...t};return se(this,"shape",o),o},checks:e._zod.def.checks};return re(e,r)}function Mr(e,t){const r=ce(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return se(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return re(e,r)}function Ur(e,t,r){const o=ce(t._zod.def,{get shape(){const n=t._zod.def.shape,i={...n};if(r)for(const a in r){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=e?new e({type:"optional",innerType:n[a]}):n[a])}else for(const a in n)i[a]=e?new e({type:"optional",innerType:n[a]}):n[a];return se(this,"shape",i),i},checks:[]});return re(t,o)}function Dr(e,t,r){const o=ce(t._zod.def,{get shape(){const n=t._zod.def.shape,i={...n};if(r)for(const a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(const a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return se(this,"shape",i),i},checks:[]});return re(t,o)}function pe(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function _t(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Se(e){return typeof e=="string"?e:e?.message}function le(e,t,r){const o={...e,path:e.path??[]};if(!e.message){const n=Se(e.inst?._zod.def?.error?.(e))??Se(t?.error?.(e))??Se(r.customError?.(e))??Se(r.localeError?.(e))??"Invalid input";o.message=n}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function He(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ye(...e){const[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}const xt=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,We,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},zt=l("$ZodError",xt),Et=l("$ZodError",xt,{Parent:Error});function Fr(e,t=r=>r.message){const r={},o=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Vr(e,t=r=>r.message){const r={_errors:[]},o=n=>{for(const i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(t(i));else{let a=r,s=0;for(;s<i.path.length;){const c=i.path[s];s===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(i))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return o(e),r}const Xe=e=>(t,r,o,n)=>{const i=o?Object.assign(o,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new de;if(a.issues.length){const s=new(n?.Err??e)(a.issues.map(c=>le(c,i,ae())));throw kt(s,n?.callee),s}return a.value},Ke=e=>async(t,r,o,n)=>{const i=o?Object.assign(o,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new(n?.Err??e)(a.issues.map(c=>le(c,i,ae())));throw kt(s,n?.callee),s}return a.value},Ie=e=>(t,r,o)=>{const n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new de;return i.issues.length?{success:!1,error:new(e??zt)(i.issues.map(a=>le(a,n,ae())))}:{success:!0,data:i.value}},Gr=Ie(Et),je=e=>async(t,r,o)=>{const n=o?Object.assign(o,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>le(a,n,ae())))}:{success:!0,data:i.value}},Wr=je(Et),Br=e=>(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Xe(e)(t,r,n)},Yr=e=>(t,r,o)=>Xe(e)(t,r,o),Jr=e=>async(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,r,n)},Hr=e=>async(t,r,o)=>Ke(e)(t,r,o),Xr=e=>(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ie(e)(t,r,n)},Kr=e=>(t,r,o)=>Ie(e)(t,r,o),qr=e=>async(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return je(e)(t,r,n)},Qr=e=>async(t,r,o)=>je(e)(t,r,o),eo=/^[cC][^\s-]{8,}$/,to=/^[0-9a-z]+$/,ro=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,oo=/^[0-9a-vA-V]{20}$/,no=/^[A-Za-z0-9]{27}$/,io=/^[a-zA-Z0-9_-]{21}$/,ao=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,so=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Zt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,co=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function uo(){return new RegExp(lo,"u")}const po=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,fo=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ho=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,go=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ct=/^[A-Za-z0-9_-]*$/,bo=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,vo=/^\+(?:[0-9]){6,14}[0-9]$/,$t="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",wo=new RegExp(`^${$t}$`);function Tt(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ko(e){return new RegExp(`^${Tt(e)}$`)}function yo(e){const t=Tt({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${r.join("|")})`;return new RegExp(`^${$t}T(?:${o})$`)}const _o=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},xo=/^-?\d+$/,zo=/^-?\d+(?:\.\d+)?/,Eo=/^(?:true|false)$/i,Zo=/^[^A-Z]*$/,Co=/^[^a-z]*$/,W=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),At={number:"number",bigint:"bigint",object:"date"},St=l("$ZodCheckLessThan",(e,t)=>{W.init(e,t);const r=At[typeof t.value];e._zod.onattach.push(o=>{const n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),It=l("$ZodCheckGreaterThan",(e,t)=>{W.init(e,t);const r=At[typeof t.value];e._zod.onattach.push(o=>{const n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$o=l("$ZodCheckMultipleOf",(e,t)=>{W.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Ar(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),To=l("$ZodCheckNumberFormat",(e,t)=>{W.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),o=r?"int":"number",[n,i]=Pr[t.format];e._zod.onattach.push(a=>{const s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=xo)}),e._zod.check=a=>{const s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inst:e})}}),Ao=l("$ZodCheckMaxLength",(e,t)=>{var r;W.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Ye(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const n=o.value;if(n.length<=t.maximum)return;const a=He(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),So=l("$ZodCheckMinLength",(e,t)=>{var r;W.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Ye(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const n=o.value;if(n.length>=t.minimum)return;const a=He(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Io=l("$ZodCheckLengthEquals",(e,t)=>{var r;W.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Ye(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{const n=o.value,i=n.length;if(i===t.length)return;const a=He(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Pe=l("$ZodCheckStringFormat",(e,t)=>{var r,o;W.init(e,t),e._zod.onattach.push(n=>{const i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),jo=l("$ZodCheckRegex",(e,t)=>{Pe.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Po=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Zo),Pe.init(e,t)}),Ro=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Co),Pe.init(e,t)}),Oo=l("$ZodCheckIncludes",(e,t)=>{W.init(e,t);const r=Ae(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),No=l("$ZodCheckStartsWith",(e,t)=>{W.init(e,t);const r=new RegExp(`^${Ae(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Lo=l("$ZodCheckEndsWith",(e,t)=>{W.init(e,t);const r=new RegExp(`.*${Ae(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),Mo=l("$ZodCheckOverwrite",(e,t)=>{W.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Uo{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
23
+ <%s key={someKey} {...props} />`,C,E,ee,E),Ce[E+C]=!0)}if(E=null,z!==void 0&&(r(z),E=""+z),a(_)&&(r(_.key),E=""+_.key),"key"in _){z={};for(var ie in _)ie!=="key"&&(z[ie]=_[ie])}else z=_;return E&&s(z,typeof u=="function"?u.displayName||u.name||"Unknown":u),d(u,E,z,n(),Q,ge)}function Z(u){g(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===G&&(u._payload.status==="fulfilled"?g(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function g(u){return typeof u=="object"&&u!==null&&u.$$typeof===b}var p=A,b=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),R=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),Ve=Symbol.for("react.client.reference"),ne=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ze=Object.prototype.hasOwnProperty,Ee=Array.isArray,X=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(u){return u()}};var Y,K={},k=p.react_stack_bottom_frame.bind(p,i)(),Ze=X(o(i)),Ce={};we.Fragment=N,we.jsx=function(u,_,z){var C=1e4>ne.recentlyCreatedOwnerStacks++;return h(u,_,z,!1,C?Error("react-stack-top-frame"):k,C?X(o(u)):Ze)},we.jsxs=function(u,_,z){var C=1e4>ne.recentlyCreatedOwnerStacks++;return h(u,_,z,!0,C?Error("react-stack-top-frame"):k,C?X(o(u)):Ze)}})()),we}var ht;function Zr(){return ht||(ht=1,process.env.NODE_ENV==="production"?Te.exports=zr():Te.exports=Er()),Te.exports}var y=Zr();const Cr=({onCommand:e,onSave:t,onExport:r,onClear:o,showButtons:n=!1,hasUnsavedChanges:i})=>{const[a,s]=A.useState([]),[c,d]=A.useState("p"),h=()=>{const p=[];let b="p";document.queryCommandState("bold")&&p.push("bold"),document.queryCommandState("italic")&&p.push("italic"),document.queryCommandState("underline")&&p.push("underline"),document.queryCommandState("strikeThrough")&&p.push("strikeThrough"),document.queryCommandState("insertUnorderedList")&&p.push("insertUnorderedList"),document.queryCommandState("insertOrderedList")&&p.push("insertOrderedList"),document.queryCommandState("justifyLeft")&&p.push("justifyLeft"),document.queryCommandState("justifyCenter")&&p.push("justifyCenter"),document.queryCommandState("justifyRight")&&p.push("justifyRight");const T=window.getSelection();if(T&&T.rangeCount>0){let N=T.getRangeAt(0).commonAncestorContainer;for(;N&&N.nodeType===Node.ELEMENT_NODE;){const D=N,U=D.tagName.toLowerCase();if(["h1","h2","p","div"].includes(U)){U==="h1"||U==="h2"?(b=U,p.push(`formatBlock:${U}`)):(U==="p"||U==="div"&&!b)&&(b="p");break}N=D.parentNode}}d(b),s(p)};A.useEffect(()=>{const p=()=>{h()},b=()=>{setTimeout(h,10)};return document.addEventListener("selectionchange",p),document.addEventListener("click",b),document.addEventListener("keyup",b),()=>{document.removeEventListener("selectionchange",p),document.removeEventListener("click",b),document.removeEventListener("keyup",b)}},[]);const Z=()=>{const p=prompt("Enter URL:");p&&e("createLink",p)},g=[{id:"bold",command:"bold",icon:y.jsx(V.Bold,{size:18}),title:"Bold"},{id:"italic",command:"italic",icon:y.jsx(V.Italic,{size:18}),title:"Italic"},{id:"underline",command:"underline",icon:y.jsx(V.Underline,{size:18}),title:"Underline"},{id:"strikeThrough",command:"strikeThrough",icon:y.jsx(V.Strikethrough,{size:18}),title:"Strikethrough"},{id:"separator-1",separator:!0},{id:"unordered-list",command:"insertUnorderedList",icon:y.jsx(V.List,{size:18}),title:"Bullet List"},{id:"ordered-list",command:"insertOrderedList",icon:y.jsx(V.ListOrdered,{size:18}),title:"Numbered List"},{id:"separator-2",separator:!0},{id:"heading-1",command:"formatBlock",value:"h1",icon:y.jsx(V.Heading1,{size:18}),title:"Heading 1",isActive:c==="h1"},{id:"heading-2",command:"formatBlock",value:"h2",icon:y.jsx(V.Heading2,{size:18}),title:"Heading 2",isActive:c==="h2"},{id:"paragraph",command:"formatBlock",value:"p",icon:y.jsx(V.Type,{size:18}),title:"Paragraph",isActive:c==="p"},{id:"separator-3",separator:!0},{id:"align-left",command:"justifyLeft",icon:y.jsx(V.AlignLeft,{size:18}),title:"Align Left"},{id:"align-center",command:"justifyCenter",icon:y.jsx(V.AlignCenter,{size:18}),title:"Center"},{id:"align-right",command:"justifyRight",icon:y.jsx(V.AlignRight,{size:18}),title:"Align Right"},{id:"separator-4",separator:!0},{id:"link",command:"createLink",icon:y.jsx(V.Link,{size:18}),title:"Insert Link",onClick:Z}];return y.jsxs("div",{className:"flex flex-wrap justify-between items-center p-3 bg-gray-50 border-b border-gray-200",children:[y.jsx("div",{className:"flex flex-wrap items-center gap-1",children:g.map(p=>{if("separator"in p)return y.jsx("div",{className:"w-px h-6 bg-gray-300 mx-2"},p.id);const b=p.isActive!==void 0?p.isActive:a.includes(p.command);return y.jsx("button",{onClick:()=>p.onClick?p.onClick():e(p.command,p.value),title:p.title,type:"button",className:`w-9 h-9 flex items-center justify-center rounded-md border transition-colors duration-200
24
+ ${b?"bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200":"bg-white border-gray-300 text-gray-700 hover:bg-gray-100"}`,children:p.icon},p.id)})}),n&&y.jsxs("div",{className:"flex items-center gap-2 mt-2 sm:mt-0",children:[y.jsxs("button",{onClick:t,disabled:!i,title:"Save Document",className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed transition-colors duration-200",children:[y.jsx(V.Save,{size:16}),y.jsx("span",{children:"Save"})]}),y.jsxs("button",{onClick:r,title:"Export as HTML",className:"flex items-center gap-2 px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 transition-colors duration-200",children:[y.jsx(V.FileDown,{size:16}),y.jsx("span",{children:"Export"})]}),y.jsxs("button",{onClick:o,title:"Clear Editor",className:"flex items-center gap-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 transition-colors duration-200",children:[y.jsx(V.Trash2,{size:16}),y.jsx("span",{children:"Clear"})]})]})]})},Tr=({wordCount:e,characterCount:t,hasUnsavedChanges:r})=>y.jsx("div",{className:"flex justify-between items-center px-5 py-3 bg-gray-50 border-t border-gray-200 text-sm text-gray-600",children:y.jsxs("div",{className:"flex items-center gap-6",children:[y.jsxs("div",{children:["Words: ",y.jsx("strong",{className:"text-gray-800",children:e})]}),y.jsxs("div",{children:["Characters: ",y.jsx("strong",{className:"text-gray-800",children:t})]}),y.jsxs("div",{children:["Status: ",y.jsx("strong",{className:r?"text-orange-600":"text-green-600",children:r?"Unsaved Changes":"Saved"})]})]})});function l(e,t,r){function o(s,c){var d;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(d=s._zod).traits??(d.traits=new Set),s._zod.traits.add(e),t(s,c);for(const h in a.prototype)h in s||Object.defineProperty(s,h,{value:a.prototype[h].bind(s)});s._zod.constr=a,s._zod.def=c}const n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var c;const d=r?.Parent?new i:this;o(d,s),(c=d._zod).deferred??(c.deferred=[]);for(const h of d._zod.deferred)h();return d}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class de extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const bt={};function ae(e){return bt}function Ar(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function We(e,t){return typeof t=="bigint"?t.toString():t}function Be(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ye(e){return e==null}function Je(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function $r(e,t){const r=(e.toString().split(".")[1]||"").length,o=t.toString();let n=(o.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(o)){const c=o.match(/\d?e-(\d?)/);c?.[1]&&(n=Number.parseInt(c[1]))}const i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}const vt=Symbol("evaluating");function S(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==vt)return o===void 0&&(o=vt,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function se(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ce(...e){const t={};for(const r of e){const o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function wt(e){return JSON.stringify(e)}const kt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ae(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Sr=Be(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ke(e){if(Ae(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(Ae(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function yt(e){return ke(e)?{...e}:Array.isArray(e)?[...e]:e}const Ir=new Set(["string","number","symbol"]);function $e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function re(e,t,r){const o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function v(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function jr(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Pr={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Rr(e,t){const r=e._zod.def,o=ce(e._zod.def,{get shape(){const n={};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(n[i]=r.shape[i])}return se(this,"shape",n),n},checks:[]});return re(e,o)}function Or(e,t){const r=e._zod.def,o=ce(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete n[i]}return se(this,"shape",n),n},checks:[]});return re(e,o)}function Nr(e,t){if(!ke(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const n=ce(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return se(this,"shape",i),i},checks:[]});return re(e,n)}function Lr(e,t){if(!ke(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const o={...e._zod.def.shape,...t};return se(this,"shape",o),o},checks:e._zod.def.checks};return re(e,r)}function Mr(e,t){const r=ce(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return se(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return re(e,r)}function Ur(e,t,r){const o=ce(t._zod.def,{get shape(){const n=t._zod.def.shape,i={...n};if(r)for(const a in r){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=e?new e({type:"optional",innerType:n[a]}):n[a])}else for(const a in n)i[a]=e?new e({type:"optional",innerType:n[a]}):n[a];return se(this,"shape",i),i},checks:[]});return re(t,o)}function Dr(e,t,r){const o=ce(t._zod.def,{get shape(){const n=t._zod.def.shape,i={...n};if(r)for(const a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(const a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return se(this,"shape",i),i},checks:[]});return re(t,o)}function pe(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function _t(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Se(e){return typeof e=="string"?e:e?.message}function le(e,t,r){const o={...e,path:e.path??[]};if(!e.message){const n=Se(e.inst?._zod.def?.error?.(e))??Se(t?.error?.(e))??Se(r.customError?.(e))??Se(r.localeError?.(e))??"Invalid input";o.message=n}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function He(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ye(...e){const[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}const xt=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,We,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},zt=l("$ZodError",xt),Et=l("$ZodError",xt,{Parent:Error});function Fr(e,t=r=>r.message){const r={},o=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Vr(e,t=r=>r.message){const r={_errors:[]},o=n=>{for(const i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(t(i));else{let a=r,s=0;for(;s<i.path.length;){const c=i.path[s];s===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(i))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return o(e),r}const Xe=e=>(t,r,o,n)=>{const i=o?Object.assign(o,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new de;if(a.issues.length){const s=new(n?.Err??e)(a.issues.map(c=>le(c,i,ae())));throw kt(s,n?.callee),s}return a.value},Ke=e=>async(t,r,o,n)=>{const i=o?Object.assign(o,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new(n?.Err??e)(a.issues.map(c=>le(c,i,ae())));throw kt(s,n?.callee),s}return a.value},Ie=e=>(t,r,o)=>{const n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new de;return i.issues.length?{success:!1,error:new(e??zt)(i.issues.map(a=>le(a,n,ae())))}:{success:!0,data:i.value}},Gr=Ie(Et),je=e=>async(t,r,o)=>{const n=o?Object.assign(o,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>le(a,n,ae())))}:{success:!0,data:i.value}},Wr=je(Et),Br=e=>(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Xe(e)(t,r,n)},Yr=e=>(t,r,o)=>Xe(e)(t,r,o),Jr=e=>async(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,r,n)},Hr=e=>async(t,r,o)=>Ke(e)(t,r,o),Xr=e=>(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ie(e)(t,r,n)},Kr=e=>(t,r,o)=>Ie(e)(t,r,o),qr=e=>async(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return je(e)(t,r,n)},Qr=e=>async(t,r,o)=>je(e)(t,r,o),eo=/^[cC][^\s-]{8,}$/,to=/^[0-9a-z]+$/,ro=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,oo=/^[0-9a-vA-V]{20}$/,no=/^[A-Za-z0-9]{27}$/,io=/^[a-zA-Z0-9_-]{21}$/,ao=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,so=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Zt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,co=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function uo(){return new RegExp(lo,"u")}const po=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,fo=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ho=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,go=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ct=/^[A-Za-z0-9_-]*$/,bo=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,vo=/^\+(?:[0-9]){6,14}[0-9]$/,Tt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",wo=new RegExp(`^${Tt}$`);function At(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ko(e){return new RegExp(`^${At(e)}$`)}function yo(e){const t=At({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Tt}T(?:${o})$`)}const _o=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},xo=/^-?\d+$/,zo=/^-?\d+(?:\.\d+)?/,Eo=/^(?:true|false)$/i,Zo=/^[^A-Z]*$/,Co=/^[^a-z]*$/,W=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),$t={number:"number",bigint:"bigint",object:"date"},St=l("$ZodCheckLessThan",(e,t)=>{W.init(e,t);const r=$t[typeof t.value];e._zod.onattach.push(o=>{const n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),It=l("$ZodCheckGreaterThan",(e,t)=>{W.init(e,t);const r=$t[typeof t.value];e._zod.onattach.push(o=>{const n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),To=l("$ZodCheckMultipleOf",(e,t)=>{W.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):$r(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Ao=l("$ZodCheckNumberFormat",(e,t)=>{W.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),o=r?"int":"number",[n,i]=Pr[t.format];e._zod.onattach.push(a=>{const s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=xo)}),e._zod.check=a=>{const s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inst:e})}}),$o=l("$ZodCheckMaxLength",(e,t)=>{var r;W.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Ye(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const n=o.value;if(n.length<=t.maximum)return;const a=He(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),So=l("$ZodCheckMinLength",(e,t)=>{var r;W.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Ye(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const n=o.value;if(n.length>=t.minimum)return;const a=He(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Io=l("$ZodCheckLengthEquals",(e,t)=>{var r;W.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Ye(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{const n=o.value,i=n.length;if(i===t.length)return;const a=He(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Pe=l("$ZodCheckStringFormat",(e,t)=>{var r,o;W.init(e,t),e._zod.onattach.push(n=>{const i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),jo=l("$ZodCheckRegex",(e,t)=>{Pe.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Po=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Zo),Pe.init(e,t)}),Ro=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Co),Pe.init(e,t)}),Oo=l("$ZodCheckIncludes",(e,t)=>{W.init(e,t);const r=$e(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),No=l("$ZodCheckStartsWith",(e,t)=>{W.init(e,t);const r=new RegExp(`^${$e(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Lo=l("$ZodCheckEndsWith",(e,t)=>{W.init(e,t);const r=new RegExp(`.*${$e(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),Mo=l("$ZodCheckOverwrite",(e,t)=>{W.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Uo{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
25
25
  `).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(const a of i)this.content.push(a)}compile(){const t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
26
- `))}}const Do={major:4,minor:1,patch:12},P=l("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Do;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const n of o)for(const i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const n=(a,s,c)=>{let d=pe(a),p;for(const _ of s){if(_._zod.def.when){if(!_._zod.def.when(a))continue}else if(d)continue;const k=a.issues.length,m=_._zod.check(a);if(m instanceof Promise&&c?.async===!1)throw new de;if(p||m instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await m,a.issues.length!==k&&(d||(d=pe(a,k)))});else{if(a.issues.length===k)continue;d||(d=pe(a,k))}}return p?p.then(()=>a):a},i=(a,s,c)=>{if(pe(a))return a.aborted=!0,a;const d=n(s,o,c);if(d instanceof Promise){if(c.async===!1)throw new de;return d.then(p=>e._zod.parse(p,c))}return e._zod.parse(d,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){const d=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(p=>i(p,a,s)):i(d,a,s)}const c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new de;return c.then(d=>n(d,o,s))}return n(c,o,s)}}e["~standard"]={validate:n=>{try{const i=Gr(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Wr(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),qe=l("$ZodString",(e,t)=>{P.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_o(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),S=l("$ZodStringFormat",(e,t)=>{Pe.init(e,t),qe.init(e,t)}),Fo=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=so),S.init(e,t)}),Vo=l("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Zt(o))}else t.pattern??(t.pattern=Zt());S.init(e,t)}),Go=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=co),S.init(e,t)}),Wo=l("$ZodURL",(e,t)=>{S.init(e,t),e._zod.check=r=>{try{const o=r.value.trim(),n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:bo.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Bo=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=uo()),S.init(e,t)}),Yo=l("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=io),S.init(e,t)}),Jo=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eo),S.init(e,t)}),Ho=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=to),S.init(e,t)}),Xo=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ro),S.init(e,t)}),Ko=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=oo),S.init(e,t)}),qo=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=no),S.init(e,t)}),Qo=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=yo(t)),S.init(e,t)}),en=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=wo),S.init(e,t)}),tn=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ko(t)),S.init(e,t)}),rn=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ao),S.init(e,t)}),on=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=po),S.init(e,t),e._zod.onattach.push(r=>{const o=r._zod.bag;o.format="ipv4"})}),nn=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mo),S.init(e,t),e._zod.onattach.push(r=>{const o=r._zod.bag;o.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),an=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fo),S.init(e,t)}),sn=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ho),S.init(e,t),e._zod.check=r=>{const o=r.value.split("/");try{if(o.length!==2)throw new Error;const[n,i]=o;if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function jt(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const cn=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=go),S.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{jt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function ln(e){if(!Ct.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return jt(r)}const un=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ct),S.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{ln(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),dn=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vo),S.init(e,t)});function pn(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[o]=r;if(!o)return!1;const n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const mn=l("$ZodJWT",(e,t)=>{S.init(e,t),e._zod.check=r=>{pn(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Pt=l("$ZodNumber",(e,t)=>{P.init(e,t),e._zod.pattern=e._zod.bag.pattern??zo,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;const i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),fn=l("$ZodNumber",(e,t)=>{To.init(e,t),Pt.init(e,t)}),hn=l("$ZodBoolean",(e,t)=>{P.init(e,t),e._zod.pattern=Eo,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}const n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),gn=l("$ZodUnknown",(e,t)=>{P.init(e,t),e._zod.parse=r=>r}),bn=l("$ZodNever",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Rt(e,t,r){e.issues.length&&t.issues.push(..._t(r,e.issues)),t.value[r]=e.value}const vn=l("$ZodArray",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const i=[];for(let a=0;a<n.length;a++){const s=n[a],c=t.element._zod.run({value:s,issues:[]},o);c instanceof Promise?i.push(c.then(d=>Rt(d,r,a))):Rt(c,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function Re(e,t,r,o){e.issues.length&&t.issues.push(..._t(r,e.issues)),e.value===void 0?r in o&&(t.value[r]=void 0):t.value[r]=e.value}function Ot(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const r=jr(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Nt(e,t,r,o,n,i){const a=[],s=n.keySet,c=n.catchall._zod,d=c.def.type;for(const p of Object.keys(t)){if(s.has(p))continue;if(d==="never"){a.push(p);continue}const _=c.run({value:t[p],issues:[]},o);_ instanceof Promise?e.push(_.then(k=>Re(k,r,p,t))):Re(_,r,p,t)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}const wn=l("$ZodObject",(e,t)=>{if(P.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}const o=Be(()=>Ot(t));T(e._zod,"propValues",()=>{const s=t.shape,c={};for(const d in s){const p=s[d]._zod;if(p.values){c[d]??(c[d]=new Set);for(const _ of p.values)c[d].add(_)}}return c});const n=Te,i=t.catchall;let a;e._zod.parse=(s,c)=>{a??(a=o.value);const d=s.value;if(!n(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),s;s.value={};const p=[],_=a.shape;for(const k of a.keys){const w=_[k]._zod.run({value:d[k],issues:[]},c);w instanceof Promise?p.push(w.then(I=>Re(I,s,k,d))):Re(w,s,k,d)}return i?Nt(p,d,s,c,o.value,e):p.length?Promise.all(p).then(()=>s):s}}),kn=l("$ZodObjectJIT",(e,t)=>{wn.init(e,t);const r=e._zod.parse,o=Be(()=>Ot(t)),n=k=>{const m=new Uo(["shape","payload","ctx"]),w=o.value,I=M=>{const R=wt(M);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};m.write("const input = payload.value;");const N=Object.create(null);let D=0;for(const M of w.keys)N[M]=`key_${D++}`;m.write("const newResult = {};");for(const M of w.keys){const R=N[M],F=wt(M);m.write(`const ${R} = ${I(M)};`),m.write(`
26
+ `))}}const Do={major:4,minor:1,patch:12},P=l("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Do;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const n of o)for(const i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const n=(a,s,c)=>{let d=pe(a),h;for(const Z of s){if(Z._zod.def.when){if(!Z._zod.def.when(a))continue}else if(d)continue;const g=a.issues.length,p=Z._zod.check(a);if(p instanceof Promise&&c?.async===!1)throw new de;if(h||p instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await p,a.issues.length!==g&&(d||(d=pe(a,g)))});else{if(a.issues.length===g)continue;d||(d=pe(a,g))}}return h?h.then(()=>a):a},i=(a,s,c)=>{if(pe(a))return a.aborted=!0,a;const d=n(s,o,c);if(d instanceof Promise){if(c.async===!1)throw new de;return d.then(h=>e._zod.parse(h,c))}return e._zod.parse(d,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){const d=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(h=>i(h,a,s)):i(d,a,s)}const c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new de;return c.then(d=>n(d,o,s))}return n(c,o,s)}}e["~standard"]={validate:n=>{try{const i=Gr(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Wr(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),qe=l("$ZodString",(e,t)=>{P.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_o(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),I=l("$ZodStringFormat",(e,t)=>{Pe.init(e,t),qe.init(e,t)}),Fo=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=so),I.init(e,t)}),Vo=l("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Zt(o))}else t.pattern??(t.pattern=Zt());I.init(e,t)}),Go=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=co),I.init(e,t)}),Wo=l("$ZodURL",(e,t)=>{I.init(e,t),e._zod.check=r=>{try{const o=r.value.trim(),n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:bo.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Bo=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=uo()),I.init(e,t)}),Yo=l("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=io),I.init(e,t)}),Jo=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eo),I.init(e,t)}),Ho=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=to),I.init(e,t)}),Xo=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ro),I.init(e,t)}),Ko=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=oo),I.init(e,t)}),qo=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=no),I.init(e,t)}),Qo=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=yo(t)),I.init(e,t)}),en=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=wo),I.init(e,t)}),tn=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ko(t)),I.init(e,t)}),rn=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ao),I.init(e,t)}),on=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=po),I.init(e,t),e._zod.onattach.push(r=>{const o=r._zod.bag;o.format="ipv4"})}),nn=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mo),I.init(e,t),e._zod.onattach.push(r=>{const o=r._zod.bag;o.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),an=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fo),I.init(e,t)}),sn=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ho),I.init(e,t),e._zod.check=r=>{const o=r.value.split("/");try{if(o.length!==2)throw new Error;const[n,i]=o;if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function jt(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const cn=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=go),I.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{jt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function ln(e){if(!Ct.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return jt(r)}const un=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ct),I.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{ln(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),dn=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vo),I.init(e,t)});function pn(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[o]=r;if(!o)return!1;const n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const mn=l("$ZodJWT",(e,t)=>{I.init(e,t),e._zod.check=r=>{pn(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Pt=l("$ZodNumber",(e,t)=>{P.init(e,t),e._zod.pattern=e._zod.bag.pattern??zo,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;const i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),fn=l("$ZodNumber",(e,t)=>{Ao.init(e,t),Pt.init(e,t)}),hn=l("$ZodBoolean",(e,t)=>{P.init(e,t),e._zod.pattern=Eo,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}const n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),gn=l("$ZodUnknown",(e,t)=>{P.init(e,t),e._zod.parse=r=>r}),bn=l("$ZodNever",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Rt(e,t,r){e.issues.length&&t.issues.push(..._t(r,e.issues)),t.value[r]=e.value}const vn=l("$ZodArray",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const i=[];for(let a=0;a<n.length;a++){const s=n[a],c=t.element._zod.run({value:s,issues:[]},o);c instanceof Promise?i.push(c.then(d=>Rt(d,r,a))):Rt(c,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function Re(e,t,r,o){e.issues.length&&t.issues.push(..._t(r,e.issues)),e.value===void 0?r in o&&(t.value[r]=void 0):t.value[r]=e.value}function Ot(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const r=jr(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Nt(e,t,r,o,n,i){const a=[],s=n.keySet,c=n.catchall._zod,d=c.def.type;for(const h of Object.keys(t)){if(s.has(h))continue;if(d==="never"){a.push(h);continue}const Z=c.run({value:t[h],issues:[]},o);Z instanceof Promise?e.push(Z.then(g=>Re(g,r,h,t))):Re(Z,r,h,t)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}const wn=l("$ZodObject",(e,t)=>{if(P.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}const o=Be(()=>Ot(t));S(e._zod,"propValues",()=>{const s=t.shape,c={};for(const d in s){const h=s[d]._zod;if(h.values){c[d]??(c[d]=new Set);for(const Z of h.values)c[d].add(Z)}}return c});const n=Ae,i=t.catchall;let a;e._zod.parse=(s,c)=>{a??(a=o.value);const d=s.value;if(!n(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),s;s.value={};const h=[],Z=a.shape;for(const g of a.keys){const b=Z[g]._zod.run({value:d[g],issues:[]},c);b instanceof Promise?h.push(b.then(T=>Re(T,s,g,d))):Re(b,s,g,d)}return i?Nt(h,d,s,c,o.value,e):h.length?Promise.all(h).then(()=>s):s}}),kn=l("$ZodObjectJIT",(e,t)=>{wn.init(e,t);const r=e._zod.parse,o=Be(()=>Ot(t)),n=g=>{const p=new Uo(["shape","payload","ctx"]),b=o.value,T=M=>{const R=wt(M);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};p.write("const input = payload.value;");const N=Object.create(null);let D=0;for(const M of b.keys)N[M]=`key_${D++}`;p.write("const newResult = {};");for(const M of b.keys){const R=N[M],F=wt(M);p.write(`const ${R} = ${T(M)};`),p.write(`
27
27
  if (${R}.issues.length) {
28
28
  payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
29
29
  ...iss,
@@ -40,12 +40,12 @@ React keys must be passed directly to JSX without using spread:
40
40
  newResult[${F}] = ${R}.value;
41
41
  }
42
42
 
43
- `)}m.write("payload.value = newResult;"),m.write("return payload;");const U=m.compile();return(M,R)=>U(k,M,R)};let i;const a=Te,s=!bt.jitless,d=s&&Sr.value,p=t.catchall;let _;e._zod.parse=(k,m)=>{_??(_=o.value);const w=k.value;return a(w)?s&&d&&m?.async===!1&&m.jitless!==!0?(i||(i=n(t.shape)),k=i(k,m),p?Nt([],w,k,m,_,e):k):r(k,m):(k.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),k)}});function Lt(e,t,r,o){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const n=e.filter(i=>!pe(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>le(a,o,ae())))}),t)}const yn=l("$ZodUnion",(e,t)=>{P.init(e,t),T(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),T(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),T(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),T(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>Je(i.source)).join("|")})$`)}});const r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let a=!1;const s=[];for(const c of t.options){const d=c._zod.run({value:n.value,issues:[]},i);if(d instanceof Promise)s.push(d),a=!0;else{if(d.issues.length===0)return d;s.push(d)}}return a?Promise.all(s).then(c=>Lt(c,n,e,i)):Lt(s,n,e,i)}}),_n=l("$ZodIntersection",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>{const n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,d])=>Mt(r,c,d)):Mt(r,i,a)}});function Qe(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ke(e)&&ke(t)){const r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(const i of o){const a=Qe(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;o<e.length;o++){const n=e[o],i=t[o],a=Qe(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Mt(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),pe(e))return e;const o=Qe(t.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const xn=l("$ZodEnum",(e,t)=>{P.init(e,t);const r=Tr(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Ir.has(typeof n)).map(n=>typeof n=="string"?Ae(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{const a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),zn=l("$ZodTransform",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new gt(e.constructor.name);const n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new de;return r.value=n,r}});function Ut(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const En=l("$ZodOptional",(e,t)=>{P.init(e,t),e._zod.optin="optional",e._zod.optout="optional",T(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),T(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Je(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Ut(i,r.value)):Ut(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),Zn=l("$ZodNullable",(e,t)=>{P.init(e,t),T(e._zod,"optin",()=>t.innerType._zod.optin),T(e._zod,"optout",()=>t.innerType._zod.optout),T(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Je(r.source)}|null)$`):void 0}),T(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Cn=l("$ZodDefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Dt(i,t)):Dt(n,t)}});function Dt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const $n=l("$ZodPrefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),Tn=l("$ZodNonOptional",(e,t)=>{P.init(e,t),T(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Ft(i,e)):Ft(n,e)}});function Ft(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const An=l("$ZodCatch",(e,t)=>{P.init(e,t),T(e._zod,"optin",()=>t.innerType._zod.optin),T(e._zod,"optout",()=>t.innerType._zod.optout),T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>le(a,o,ae()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>le(i,o,ae()))},input:r.value}),r.issues=[]),r)}}),Sn=l("$ZodPipe",(e,t)=>{P.init(e,t),T(e._zod,"values",()=>t.in._zod.values),T(e._zod,"optin",()=>t.in._zod.optin),T(e._zod,"optout",()=>t.out._zod.optout),T(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){const i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Oe(a,t.in,o)):Oe(i,t.in,o)}const n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Oe(i,t.out,o)):Oe(n,t.out,o)}});function Oe(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const In=l("$ZodReadonly",(e,t)=>{P.init(e,t),T(e._zod,"propValues",()=>t.innerType._zod.propValues),T(e._zod,"values",()=>t.innerType._zod.values),T(e._zod,"optin",()=>t.innerType._zod.optin),T(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Vt):Vt(n)}});function Vt(e){return e.value=Object.freeze(e.value),e}const jn=l("$ZodCustom",(e,t)=>{W.init(e,t),P.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{const o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>Gt(i,r,o,e));Gt(n,r,o,e)}});function Gt(e,t,r,o){if(!e){const n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(ye(n))}}class Pn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const o=r[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const o={...this.get(r)??{}};delete o.id;const n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Rn(){return new Pn}const Ne=Rn();function On(e,t){return new e({type:"string",...g(t)})}function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function Wt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function Ln(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function Mn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function Un(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function Dn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function Fn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function Vn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function Gn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function Wn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function Bn(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function Yn(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function Jn(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function Hn(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function Xn(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function Kn(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function qn(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function Qn(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function ei(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function ti(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function ri(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function oi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function ni(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function ii(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function ai(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function si(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function ci(e,t){return new e({type:"number",checks:[],...g(t)})}function li(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function ui(e,t){return new e({type:"boolean",...g(t)})}function di(e){return new e({type:"unknown"})}function pi(e,t){return new e({type:"never",...g(t)})}function Bt(e,t){return new St({check:"less_than",...g(t),value:e,inclusive:!1})}function et(e,t){return new St({check:"less_than",...g(t),value:e,inclusive:!0})}function Yt(e,t){return new It({check:"greater_than",...g(t),value:e,inclusive:!1})}function tt(e,t){return new It({check:"greater_than",...g(t),value:e,inclusive:!0})}function Jt(e,t){return new $o({check:"multiple_of",...g(t),value:e})}function Ht(e,t){return new Ao({check:"max_length",...g(t),maximum:e})}function Le(e,t){return new So({check:"min_length",...g(t),minimum:e})}function Xt(e,t){return new Io({check:"length_equals",...g(t),length:e})}function mi(e,t){return new jo({check:"string_format",format:"regex",...g(t),pattern:e})}function fi(e){return new Po({check:"string_format",format:"lowercase",...g(e)})}function hi(e){return new Ro({check:"string_format",format:"uppercase",...g(e)})}function gi(e,t){return new Oo({check:"string_format",format:"includes",...g(t),includes:e})}function bi(e,t){return new No({check:"string_format",format:"starts_with",...g(t),prefix:e})}function vi(e,t){return new Lo({check:"string_format",format:"ends_with",...g(t),suffix:e})}function _e(e){return new Mo({check:"overwrite",tx:e})}function wi(e){return _e(t=>t.normalize(e))}function ki(){return _e(e=>e.trim())}function yi(){return _e(e=>e.toLowerCase())}function _i(){return _e(e=>e.toUpperCase())}function xi(e,t,r){return new e({type:"array",element:t,...g(r)})}function zi(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}function Ei(e){const t=Zi(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(ye(o,r.value,t._zod.def));else{const n=o;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(ye(n))}},e(r.value,r)));return t}function Zi(e,t){const r=new W({check:"custom",...g(t)});return r._zod.check=e,r}const Ci=l("ZodISODateTime",(e,t)=>{Qo.init(e,t),j.init(e,t)});function $i(e){return ni(Ci,e)}const Ti=l("ZodISODate",(e,t)=>{en.init(e,t),j.init(e,t)});function Ai(e){return ii(Ti,e)}const Si=l("ZodISOTime",(e,t)=>{tn.init(e,t),j.init(e,t)});function Ii(e){return ai(Si,e)}const ji=l("ZodISODuration",(e,t)=>{rn.init(e,t),j.init(e,t)});function Pi(e){return si(ji,e)}const B=l("ZodError",(e,t)=>{zt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Vr(e,r)},flatten:{value:r=>Fr(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,We,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,We,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ri=Xe(B),Oi=Ke(B),Ni=Ie(B),Li=je(B),Mi=Br(B),Ui=Yr(B),Di=Jr(B),Fi=Hr(B),Vi=Xr(B),Gi=Kr(B),Wi=qr(B),Bi=Qr(B),O=l("ZodType",(e,t)=>(P.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ce(t,{checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),e.clone=(r,o)=>re(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>Ri(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Ni(e,r,o),e.parseAsync=async(r,o)=>Oi(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Li(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Mi(e,r,o),e.decode=(r,o)=>Ui(e,r,o),e.encodeAsync=async(r,o)=>Di(e,r,o),e.decodeAsync=async(r,o)=>Fi(e,r,o),e.safeEncode=(r,o)=>Vi(e,r,o),e.safeDecode=(r,o)=>Gi(e,r,o),e.safeEncodeAsync=async(r,o)=>Wi(e,r,o),e.safeDecodeAsync=async(r,o)=>Bi(e,r,o),e.refine=(r,o)=>e.check(Na(r,o)),e.superRefine=r=>e.check(La(r)),e.overwrite=r=>e.check(_e(r)),e.optional=()=>ir(e),e.nullable=()=>ar(e),e.nullish=()=>ir(ar(e)),e.nonoptional=r=>Aa(e,r),e.array=()=>ba(e),e.or=r=>ka([e,r]),e.and=r=>_a(e,r),e.transform=r=>cr(e,za(r)),e.default=r=>Ca(e,r),e.prefault=r=>Ta(e,r),e.catch=r=>Ia(e,r),e.pipe=r=>cr(e,r),e.readonly=()=>Ra(e),e.describe=r=>{const o=e.clone();return Ne.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return Ne.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ne.get(e);const o=e.clone();return Ne.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Kt=l("_ZodString",(e,t)=>{qe.init(e,t),O.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(mi(...o)),e.includes=(...o)=>e.check(gi(...o)),e.startsWith=(...o)=>e.check(bi(...o)),e.endsWith=(...o)=>e.check(vi(...o)),e.min=(...o)=>e.check(Le(...o)),e.max=(...o)=>e.check(Ht(...o)),e.length=(...o)=>e.check(Xt(...o)),e.nonempty=(...o)=>e.check(Le(1,...o)),e.lowercase=o=>e.check(fi(o)),e.uppercase=o=>e.check(hi(o)),e.trim=()=>e.check(ki()),e.normalize=(...o)=>e.check(wi(...o)),e.toLowerCase=()=>e.check(yi()),e.toUpperCase=()=>e.check(_i())}),Yi=l("ZodString",(e,t)=>{qe.init(e,t),Kt.init(e,t),e.email=r=>e.check(Nn(Ji,r)),e.url=r=>e.check(Fn(Hi,r)),e.jwt=r=>e.check(oi(ua,r)),e.emoji=r=>e.check(Vn(Xi,r)),e.guid=r=>e.check(Wt(qt,r)),e.uuid=r=>e.check(Ln(Ue,r)),e.uuidv4=r=>e.check(Mn(Ue,r)),e.uuidv6=r=>e.check(Un(Ue,r)),e.uuidv7=r=>e.check(Dn(Ue,r)),e.nanoid=r=>e.check(Gn(Ki,r)),e.guid=r=>e.check(Wt(qt,r)),e.cuid=r=>e.check(Wn(qi,r)),e.cuid2=r=>e.check(Bn(Qi,r)),e.ulid=r=>e.check(Yn(ea,r)),e.base64=r=>e.check(ei(sa,r)),e.base64url=r=>e.check(ti(ca,r)),e.xid=r=>e.check(Jn(ta,r)),e.ksuid=r=>e.check(Hn(ra,r)),e.ipv4=r=>e.check(Xn(oa,r)),e.ipv6=r=>e.check(Kn(na,r)),e.cidrv4=r=>e.check(qn(ia,r)),e.cidrv6=r=>e.check(Qn(aa,r)),e.e164=r=>e.check(ri(la,r)),e.datetime=r=>e.check($i(r)),e.date=r=>e.check(Ai(r)),e.time=r=>e.check(Ii(r)),e.duration=r=>e.check(Pi(r))});function Me(e){return On(Yi,e)}const j=l("ZodStringFormat",(e,t)=>{S.init(e,t),Kt.init(e,t)}),Ji=l("ZodEmail",(e,t)=>{Go.init(e,t),j.init(e,t)}),qt=l("ZodGUID",(e,t)=>{Fo.init(e,t),j.init(e,t)}),Ue=l("ZodUUID",(e,t)=>{Vo.init(e,t),j.init(e,t)}),Hi=l("ZodURL",(e,t)=>{Wo.init(e,t),j.init(e,t)}),Xi=l("ZodEmoji",(e,t)=>{Bo.init(e,t),j.init(e,t)}),Ki=l("ZodNanoID",(e,t)=>{Yo.init(e,t),j.init(e,t)}),qi=l("ZodCUID",(e,t)=>{Jo.init(e,t),j.init(e,t)}),Qi=l("ZodCUID2",(e,t)=>{Ho.init(e,t),j.init(e,t)}),ea=l("ZodULID",(e,t)=>{Xo.init(e,t),j.init(e,t)}),ta=l("ZodXID",(e,t)=>{Ko.init(e,t),j.init(e,t)}),ra=l("ZodKSUID",(e,t)=>{qo.init(e,t),j.init(e,t)}),oa=l("ZodIPv4",(e,t)=>{on.init(e,t),j.init(e,t)}),na=l("ZodIPv6",(e,t)=>{nn.init(e,t),j.init(e,t)}),ia=l("ZodCIDRv4",(e,t)=>{an.init(e,t),j.init(e,t)}),aa=l("ZodCIDRv6",(e,t)=>{sn.init(e,t),j.init(e,t)}),sa=l("ZodBase64",(e,t)=>{cn.init(e,t),j.init(e,t)}),ca=l("ZodBase64URL",(e,t)=>{un.init(e,t),j.init(e,t)}),la=l("ZodE164",(e,t)=>{dn.init(e,t),j.init(e,t)}),ua=l("ZodJWT",(e,t)=>{mn.init(e,t),j.init(e,t)}),Qt=l("ZodNumber",(e,t)=>{Pt.init(e,t),O.init(e,t),e.gt=(o,n)=>e.check(Yt(o,n)),e.gte=(o,n)=>e.check(tt(o,n)),e.min=(o,n)=>e.check(tt(o,n)),e.lt=(o,n)=>e.check(Bt(o,n)),e.lte=(o,n)=>e.check(et(o,n)),e.max=(o,n)=>e.check(et(o,n)),e.int=o=>e.check(tr(o)),e.safe=o=>e.check(tr(o)),e.positive=o=>e.check(Yt(0,o)),e.nonnegative=o=>e.check(tt(0,o)),e.negative=o=>e.check(Bt(0,o)),e.nonpositive=o=>e.check(et(0,o)),e.multipleOf=(o,n)=>e.check(Jt(o,n)),e.step=(o,n)=>e.check(Jt(o,n)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function er(e){return ci(Qt,e)}const da=l("ZodNumberFormat",(e,t)=>{fn.init(e,t),Qt.init(e,t)});function tr(e){return li(da,e)}const pa=l("ZodBoolean",(e,t)=>{hn.init(e,t),O.init(e,t)});function rr(e){return ui(pa,e)}const ma=l("ZodUnknown",(e,t)=>{gn.init(e,t),O.init(e,t)});function or(){return di(ma)}const fa=l("ZodNever",(e,t)=>{bn.init(e,t),O.init(e,t)});function ha(e){return pi(fa,e)}const ga=l("ZodArray",(e,t)=>{vn.init(e,t),O.init(e,t),e.element=t.element,e.min=(r,o)=>e.check(Le(r,o)),e.nonempty=r=>e.check(Le(1,r)),e.max=(r,o)=>e.check(Ht(r,o)),e.length=(r,o)=>e.check(Xt(r,o)),e.unwrap=()=>e.element});function ba(e,t){return xi(ga,e,t)}const va=l("ZodObject",(e,t)=>{kn.init(e,t),O.init(e,t),T(e,"shape",()=>t.shape),e.keyof=()=>nt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:or()}),e.loose=()=>e.clone({...e._zod.def,catchall:or()}),e.strict=()=>e.clone({...e._zod.def,catchall:ha()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Nr(e,r),e.safeExtend=r=>Lr(e,r),e.merge=r=>Mr(e,r),e.pick=r=>Rr(e,r),e.omit=r=>Or(e,r),e.partial=(...r)=>Ur(nr,e,r[0]),e.required=(...r)=>Dr(sr,e,r[0])});function rt(e,t){const r={type:"object",shape:e??{},...g(t)};return new va(r)}const wa=l("ZodUnion",(e,t)=>{yn.init(e,t),O.init(e,t),e.options=t.options});function ka(e,t){return new wa({type:"union",options:e,...g(t)})}const ya=l("ZodIntersection",(e,t)=>{_n.init(e,t),O.init(e,t)});function _a(e,t){return new ya({type:"intersection",left:e,right:t})}const ot=l("ZodEnum",(e,t)=>{xn.init(e,t),O.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{const i={};for(const a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ot({...t,checks:[],...g(n),entries:i})},e.exclude=(o,n)=>{const i={...t.entries};for(const a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new ot({...t,checks:[],...g(n),entries:i})}});function nt(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ot({type:"enum",entries:r,...g(t)})}const xa=l("ZodTransform",(e,t)=>{zn.init(e,t),O.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new gt(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(ye(i,r.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(ye(a))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});function za(e){return new xa({type:"transform",transform:e})}const nr=l("ZodOptional",(e,t)=>{En.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ir(e){return new nr({type:"optional",innerType:e})}const Ea=l("ZodNullable",(e,t)=>{Zn.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ar(e){return new Ea({type:"nullable",innerType:e})}const Za=l("ZodDefault",(e,t)=>{Cn.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ca(e,t){return new Za({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():yt(t)}})}const $a=l("ZodPrefault",(e,t)=>{$n.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ta(e,t){return new $a({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():yt(t)}})}const sr=l("ZodNonOptional",(e,t)=>{Tn.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Aa(e,t){return new sr({type:"nonoptional",innerType:e,...g(t)})}const Sa=l("ZodCatch",(e,t)=>{An.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ia(e,t){return new Sa({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ja=l("ZodPipe",(e,t)=>{Sn.init(e,t),O.init(e,t),e.in=t.in,e.out=t.out});function cr(e,t){return new ja({type:"pipe",in:e,out:t})}const Pa=l("ZodReadonly",(e,t)=>{In.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ra(e){return new Pa({type:"readonly",innerType:e})}const Oa=l("ZodCustom",(e,t)=>{jn.init(e,t),O.init(e,t)});function Na(e,t={}){return zi(Oa,e,t)}function La(e){return Ei(e)}const Ma=rt({title:Me().min(1,"Title is required").max(200,"Title too long"),content:Me().min(1,"Content is required"),format:nt(["html","markdown"]).default("html"),metadata:rt({createdAt:Me().datetime(),updatedAt:Me().datetime(),wordCount:er().min(0),characterCount:er().min(0)}).optional()});rt({includeStyles:rr().default(!0),includeMeta:rr().default(!0),format:nt(["html","txt"]).default("html")});const Ua=(e="")=>{const[t,r]=A.useState({content:e,title:"Untitled Document",wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:!1}),o=A.useRef(null);A.useEffect(()=>{o.current&&e!==t.content&&(o.current.innerHTML=e,r(p=>({...p,content:e,wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length})))},[e]);const n=A.useCallback(p=>{const _=p.trim()?p.trim().split(/\s+/).length:0,k=p.length;r(m=>({...m,content:p,wordCount:_,characterCount:k,hasUnsavedChanges:!0}))},[]),i=A.useCallback(p=>{r(_=>({..._,title:p,hasUnsavedChanges:!0}))},[]),a=A.useCallback((p,_)=>{document.execCommand(p,!1,_),o.current?.focus()},[]),s=A.useCallback(()=>{try{return{success:!0,data:Ma.parse({title:t.title,content:t.content,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),wordCount:t.wordCount,characterCount:t.characterCount}})}}catch(p){return{success:!1,error:p instanceof Error?p.message:"Validation failed"}}},[t]),c=A.useCallback((p={includeStyles:!0,includeMeta:!0})=>{const _=s();if(!_.success)throw new Error(_.error);const{data:k}=_;let m=`<!DOCTYPE html>
43
+ `)}p.write("payload.value = newResult;"),p.write("return payload;");const U=p.compile();return(M,R)=>U(g,M,R)};let i;const a=Ae,s=!bt.jitless,d=s&&Sr.value,h=t.catchall;let Z;e._zod.parse=(g,p)=>{Z??(Z=o.value);const b=g.value;return a(b)?s&&d&&p?.async===!1&&p.jitless!==!0?(i||(i=n(t.shape)),g=i(g,p),h?Nt([],b,g,p,Z,e):g):r(g,p):(g.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),g)}});function Lt(e,t,r,o){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const n=e.filter(i=>!pe(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>le(a,o,ae())))}),t)}const yn=l("$ZodUnion",(e,t)=>{P.init(e,t),S(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),S(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),S(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),S(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>Je(i.source)).join("|")})$`)}});const r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let a=!1;const s=[];for(const c of t.options){const d=c._zod.run({value:n.value,issues:[]},i);if(d instanceof Promise)s.push(d),a=!0;else{if(d.issues.length===0)return d;s.push(d)}}return a?Promise.all(s).then(c=>Lt(c,n,e,i)):Lt(s,n,e,i)}}),_n=l("$ZodIntersection",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>{const n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,d])=>Mt(r,c,d)):Mt(r,i,a)}});function Qe(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ke(e)&&ke(t)){const r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(const i of o){const a=Qe(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;o<e.length;o++){const n=e[o],i=t[o],a=Qe(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Mt(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),pe(e))return e;const o=Qe(t.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const xn=l("$ZodEnum",(e,t)=>{P.init(e,t);const r=Ar(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Ir.has(typeof n)).map(n=>typeof n=="string"?$e(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{const a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),zn=l("$ZodTransform",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new gt(e.constructor.name);const n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new de;return r.value=n,r}});function Ut(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const En=l("$ZodOptional",(e,t)=>{P.init(e,t),e._zod.optin="optional",e._zod.optout="optional",S(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),S(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Je(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Ut(i,r.value)):Ut(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),Zn=l("$ZodNullable",(e,t)=>{P.init(e,t),S(e._zod,"optin",()=>t.innerType._zod.optin),S(e._zod,"optout",()=>t.innerType._zod.optout),S(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Je(r.source)}|null)$`):void 0}),S(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Cn=l("$ZodDefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",S(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Dt(i,t)):Dt(n,t)}});function Dt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Tn=l("$ZodPrefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",S(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),An=l("$ZodNonOptional",(e,t)=>{P.init(e,t),S(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Ft(i,e)):Ft(n,e)}});function Ft(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const $n=l("$ZodCatch",(e,t)=>{P.init(e,t),S(e._zod,"optin",()=>t.innerType._zod.optin),S(e._zod,"optout",()=>t.innerType._zod.optout),S(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>le(a,o,ae()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>le(i,o,ae()))},input:r.value}),r.issues=[]),r)}}),Sn=l("$ZodPipe",(e,t)=>{P.init(e,t),S(e._zod,"values",()=>t.in._zod.values),S(e._zod,"optin",()=>t.in._zod.optin),S(e._zod,"optout",()=>t.out._zod.optout),S(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){const i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Oe(a,t.in,o)):Oe(i,t.in,o)}const n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Oe(i,t.out,o)):Oe(n,t.out,o)}});function Oe(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const In=l("$ZodReadonly",(e,t)=>{P.init(e,t),S(e._zod,"propValues",()=>t.innerType._zod.propValues),S(e._zod,"values",()=>t.innerType._zod.values),S(e._zod,"optin",()=>t.innerType._zod.optin),S(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Vt):Vt(n)}});function Vt(e){return e.value=Object.freeze(e.value),e}const jn=l("$ZodCustom",(e,t)=>{W.init(e,t),P.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{const o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>Gt(i,r,o,e));Gt(n,r,o,e)}});function Gt(e,t,r,o){if(!e){const n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(ye(n))}}class Pn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const o=r[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const o={...this.get(r)??{}};delete o.id;const n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Rn(){return new Pn}const Ne=Rn();function On(e,t){return new e({type:"string",...v(t)})}function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...v(t)})}function Wt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...v(t)})}function Ln(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...v(t)})}function Mn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...v(t)})}function Un(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...v(t)})}function Dn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...v(t)})}function Fn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...v(t)})}function Vn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...v(t)})}function Gn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...v(t)})}function Wn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...v(t)})}function Bn(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...v(t)})}function Yn(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...v(t)})}function Jn(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...v(t)})}function Hn(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...v(t)})}function Xn(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...v(t)})}function Kn(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...v(t)})}function qn(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...v(t)})}function Qn(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...v(t)})}function ei(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...v(t)})}function ti(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...v(t)})}function ri(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...v(t)})}function oi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...v(t)})}function ni(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...v(t)})}function ii(e,t){return new e({type:"string",format:"date",check:"string_format",...v(t)})}function ai(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...v(t)})}function si(e,t){return new e({type:"string",format:"duration",check:"string_format",...v(t)})}function ci(e,t){return new e({type:"number",checks:[],...v(t)})}function li(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...v(t)})}function ui(e,t){return new e({type:"boolean",...v(t)})}function di(e){return new e({type:"unknown"})}function pi(e,t){return new e({type:"never",...v(t)})}function Bt(e,t){return new St({check:"less_than",...v(t),value:e,inclusive:!1})}function et(e,t){return new St({check:"less_than",...v(t),value:e,inclusive:!0})}function Yt(e,t){return new It({check:"greater_than",...v(t),value:e,inclusive:!1})}function tt(e,t){return new It({check:"greater_than",...v(t),value:e,inclusive:!0})}function Jt(e,t){return new To({check:"multiple_of",...v(t),value:e})}function Ht(e,t){return new $o({check:"max_length",...v(t),maximum:e})}function Le(e,t){return new So({check:"min_length",...v(t),minimum:e})}function Xt(e,t){return new Io({check:"length_equals",...v(t),length:e})}function mi(e,t){return new jo({check:"string_format",format:"regex",...v(t),pattern:e})}function fi(e){return new Po({check:"string_format",format:"lowercase",...v(e)})}function hi(e){return new Ro({check:"string_format",format:"uppercase",...v(e)})}function gi(e,t){return new Oo({check:"string_format",format:"includes",...v(t),includes:e})}function bi(e,t){return new No({check:"string_format",format:"starts_with",...v(t),prefix:e})}function vi(e,t){return new Lo({check:"string_format",format:"ends_with",...v(t),suffix:e})}function _e(e){return new Mo({check:"overwrite",tx:e})}function wi(e){return _e(t=>t.normalize(e))}function ki(){return _e(e=>e.trim())}function yi(){return _e(e=>e.toLowerCase())}function _i(){return _e(e=>e.toUpperCase())}function xi(e,t,r){return new e({type:"array",element:t,...v(r)})}function zi(e,t,r){return new e({type:"custom",check:"custom",fn:t,...v(r)})}function Ei(e){const t=Zi(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(ye(o,r.value,t._zod.def));else{const n=o;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(ye(n))}},e(r.value,r)));return t}function Zi(e,t){const r=new W({check:"custom",...v(t)});return r._zod.check=e,r}const Ci=l("ZodISODateTime",(e,t)=>{Qo.init(e,t),j.init(e,t)});function Ti(e){return ni(Ci,e)}const Ai=l("ZodISODate",(e,t)=>{en.init(e,t),j.init(e,t)});function $i(e){return ii(Ai,e)}const Si=l("ZodISOTime",(e,t)=>{tn.init(e,t),j.init(e,t)});function Ii(e){return ai(Si,e)}const ji=l("ZodISODuration",(e,t)=>{rn.init(e,t),j.init(e,t)});function Pi(e){return si(ji,e)}const B=l("ZodError",(e,t)=>{zt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Vr(e,r)},flatten:{value:r=>Fr(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,We,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,We,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ri=Xe(B),Oi=Ke(B),Ni=Ie(B),Li=je(B),Mi=Br(B),Ui=Yr(B),Di=Jr(B),Fi=Hr(B),Vi=Xr(B),Gi=Kr(B),Wi=qr(B),Bi=Qr(B),O=l("ZodType",(e,t)=>(P.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ce(t,{checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),e.clone=(r,o)=>re(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>Ri(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Ni(e,r,o),e.parseAsync=async(r,o)=>Oi(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Li(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Mi(e,r,o),e.decode=(r,o)=>Ui(e,r,o),e.encodeAsync=async(r,o)=>Di(e,r,o),e.decodeAsync=async(r,o)=>Fi(e,r,o),e.safeEncode=(r,o)=>Vi(e,r,o),e.safeDecode=(r,o)=>Gi(e,r,o),e.safeEncodeAsync=async(r,o)=>Wi(e,r,o),e.safeDecodeAsync=async(r,o)=>Bi(e,r,o),e.refine=(r,o)=>e.check(Na(r,o)),e.superRefine=r=>e.check(La(r)),e.overwrite=r=>e.check(_e(r)),e.optional=()=>ir(e),e.nullable=()=>ar(e),e.nullish=()=>ir(ar(e)),e.nonoptional=r=>$a(e,r),e.array=()=>ba(e),e.or=r=>ka([e,r]),e.and=r=>_a(e,r),e.transform=r=>cr(e,za(r)),e.default=r=>Ca(e,r),e.prefault=r=>Aa(e,r),e.catch=r=>Ia(e,r),e.pipe=r=>cr(e,r),e.readonly=()=>Ra(e),e.describe=r=>{const o=e.clone();return Ne.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return Ne.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ne.get(e);const o=e.clone();return Ne.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Kt=l("_ZodString",(e,t)=>{qe.init(e,t),O.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(mi(...o)),e.includes=(...o)=>e.check(gi(...o)),e.startsWith=(...o)=>e.check(bi(...o)),e.endsWith=(...o)=>e.check(vi(...o)),e.min=(...o)=>e.check(Le(...o)),e.max=(...o)=>e.check(Ht(...o)),e.length=(...o)=>e.check(Xt(...o)),e.nonempty=(...o)=>e.check(Le(1,...o)),e.lowercase=o=>e.check(fi(o)),e.uppercase=o=>e.check(hi(o)),e.trim=()=>e.check(ki()),e.normalize=(...o)=>e.check(wi(...o)),e.toLowerCase=()=>e.check(yi()),e.toUpperCase=()=>e.check(_i())}),Yi=l("ZodString",(e,t)=>{qe.init(e,t),Kt.init(e,t),e.email=r=>e.check(Nn(Ji,r)),e.url=r=>e.check(Fn(Hi,r)),e.jwt=r=>e.check(oi(ua,r)),e.emoji=r=>e.check(Vn(Xi,r)),e.guid=r=>e.check(Wt(qt,r)),e.uuid=r=>e.check(Ln(Ue,r)),e.uuidv4=r=>e.check(Mn(Ue,r)),e.uuidv6=r=>e.check(Un(Ue,r)),e.uuidv7=r=>e.check(Dn(Ue,r)),e.nanoid=r=>e.check(Gn(Ki,r)),e.guid=r=>e.check(Wt(qt,r)),e.cuid=r=>e.check(Wn(qi,r)),e.cuid2=r=>e.check(Bn(Qi,r)),e.ulid=r=>e.check(Yn(ea,r)),e.base64=r=>e.check(ei(sa,r)),e.base64url=r=>e.check(ti(ca,r)),e.xid=r=>e.check(Jn(ta,r)),e.ksuid=r=>e.check(Hn(ra,r)),e.ipv4=r=>e.check(Xn(oa,r)),e.ipv6=r=>e.check(Kn(na,r)),e.cidrv4=r=>e.check(qn(ia,r)),e.cidrv6=r=>e.check(Qn(aa,r)),e.e164=r=>e.check(ri(la,r)),e.datetime=r=>e.check(Ti(r)),e.date=r=>e.check($i(r)),e.time=r=>e.check(Ii(r)),e.duration=r=>e.check(Pi(r))});function Me(e){return On(Yi,e)}const j=l("ZodStringFormat",(e,t)=>{I.init(e,t),Kt.init(e,t)}),Ji=l("ZodEmail",(e,t)=>{Go.init(e,t),j.init(e,t)}),qt=l("ZodGUID",(e,t)=>{Fo.init(e,t),j.init(e,t)}),Ue=l("ZodUUID",(e,t)=>{Vo.init(e,t),j.init(e,t)}),Hi=l("ZodURL",(e,t)=>{Wo.init(e,t),j.init(e,t)}),Xi=l("ZodEmoji",(e,t)=>{Bo.init(e,t),j.init(e,t)}),Ki=l("ZodNanoID",(e,t)=>{Yo.init(e,t),j.init(e,t)}),qi=l("ZodCUID",(e,t)=>{Jo.init(e,t),j.init(e,t)}),Qi=l("ZodCUID2",(e,t)=>{Ho.init(e,t),j.init(e,t)}),ea=l("ZodULID",(e,t)=>{Xo.init(e,t),j.init(e,t)}),ta=l("ZodXID",(e,t)=>{Ko.init(e,t),j.init(e,t)}),ra=l("ZodKSUID",(e,t)=>{qo.init(e,t),j.init(e,t)}),oa=l("ZodIPv4",(e,t)=>{on.init(e,t),j.init(e,t)}),na=l("ZodIPv6",(e,t)=>{nn.init(e,t),j.init(e,t)}),ia=l("ZodCIDRv4",(e,t)=>{an.init(e,t),j.init(e,t)}),aa=l("ZodCIDRv6",(e,t)=>{sn.init(e,t),j.init(e,t)}),sa=l("ZodBase64",(e,t)=>{cn.init(e,t),j.init(e,t)}),ca=l("ZodBase64URL",(e,t)=>{un.init(e,t),j.init(e,t)}),la=l("ZodE164",(e,t)=>{dn.init(e,t),j.init(e,t)}),ua=l("ZodJWT",(e,t)=>{mn.init(e,t),j.init(e,t)}),Qt=l("ZodNumber",(e,t)=>{Pt.init(e,t),O.init(e,t),e.gt=(o,n)=>e.check(Yt(o,n)),e.gte=(o,n)=>e.check(tt(o,n)),e.min=(o,n)=>e.check(tt(o,n)),e.lt=(o,n)=>e.check(Bt(o,n)),e.lte=(o,n)=>e.check(et(o,n)),e.max=(o,n)=>e.check(et(o,n)),e.int=o=>e.check(tr(o)),e.safe=o=>e.check(tr(o)),e.positive=o=>e.check(Yt(0,o)),e.nonnegative=o=>e.check(tt(0,o)),e.negative=o=>e.check(Bt(0,o)),e.nonpositive=o=>e.check(et(0,o)),e.multipleOf=(o,n)=>e.check(Jt(o,n)),e.step=(o,n)=>e.check(Jt(o,n)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function er(e){return ci(Qt,e)}const da=l("ZodNumberFormat",(e,t)=>{fn.init(e,t),Qt.init(e,t)});function tr(e){return li(da,e)}const pa=l("ZodBoolean",(e,t)=>{hn.init(e,t),O.init(e,t)});function rr(e){return ui(pa,e)}const ma=l("ZodUnknown",(e,t)=>{gn.init(e,t),O.init(e,t)});function or(){return di(ma)}const fa=l("ZodNever",(e,t)=>{bn.init(e,t),O.init(e,t)});function ha(e){return pi(fa,e)}const ga=l("ZodArray",(e,t)=>{vn.init(e,t),O.init(e,t),e.element=t.element,e.min=(r,o)=>e.check(Le(r,o)),e.nonempty=r=>e.check(Le(1,r)),e.max=(r,o)=>e.check(Ht(r,o)),e.length=(r,o)=>e.check(Xt(r,o)),e.unwrap=()=>e.element});function ba(e,t){return xi(ga,e,t)}const va=l("ZodObject",(e,t)=>{kn.init(e,t),O.init(e,t),S(e,"shape",()=>t.shape),e.keyof=()=>nt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:or()}),e.loose=()=>e.clone({...e._zod.def,catchall:or()}),e.strict=()=>e.clone({...e._zod.def,catchall:ha()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Nr(e,r),e.safeExtend=r=>Lr(e,r),e.merge=r=>Mr(e,r),e.pick=r=>Rr(e,r),e.omit=r=>Or(e,r),e.partial=(...r)=>Ur(nr,e,r[0]),e.required=(...r)=>Dr(sr,e,r[0])});function rt(e,t){const r={type:"object",shape:e??{},...v(t)};return new va(r)}const wa=l("ZodUnion",(e,t)=>{yn.init(e,t),O.init(e,t),e.options=t.options});function ka(e,t){return new wa({type:"union",options:e,...v(t)})}const ya=l("ZodIntersection",(e,t)=>{_n.init(e,t),O.init(e,t)});function _a(e,t){return new ya({type:"intersection",left:e,right:t})}const ot=l("ZodEnum",(e,t)=>{xn.init(e,t),O.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{const i={};for(const a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ot({...t,checks:[],...v(n),entries:i})},e.exclude=(o,n)=>{const i={...t.entries};for(const a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new ot({...t,checks:[],...v(n),entries:i})}});function nt(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ot({type:"enum",entries:r,...v(t)})}const xa=l("ZodTransform",(e,t)=>{zn.init(e,t),O.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new gt(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(ye(i,r.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(ye(a))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});function za(e){return new xa({type:"transform",transform:e})}const nr=l("ZodOptional",(e,t)=>{En.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ir(e){return new nr({type:"optional",innerType:e})}const Ea=l("ZodNullable",(e,t)=>{Zn.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ar(e){return new Ea({type:"nullable",innerType:e})}const Za=l("ZodDefault",(e,t)=>{Cn.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ca(e,t){return new Za({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():yt(t)}})}const Ta=l("ZodPrefault",(e,t)=>{Tn.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Aa(e,t){return new Ta({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():yt(t)}})}const sr=l("ZodNonOptional",(e,t)=>{An.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function $a(e,t){return new sr({type:"nonoptional",innerType:e,...v(t)})}const Sa=l("ZodCatch",(e,t)=>{$n.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ia(e,t){return new Sa({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ja=l("ZodPipe",(e,t)=>{Sn.init(e,t),O.init(e,t),e.in=t.in,e.out=t.out});function cr(e,t){return new ja({type:"pipe",in:e,out:t})}const Pa=l("ZodReadonly",(e,t)=>{In.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ra(e){return new Pa({type:"readonly",innerType:e})}const Oa=l("ZodCustom",(e,t)=>{jn.init(e,t),O.init(e,t)});function Na(e,t={}){return zi(Oa,e,t)}function La(e){return Ei(e)}const Ma=rt({title:Me().min(1,"Title is required").max(200,"Title too long"),content:Me().min(1,"Content is required"),format:nt(["html","markdown"]).default("html"),metadata:rt({createdAt:Me().datetime(),updatedAt:Me().datetime(),wordCount:er().min(0),characterCount:er().min(0)}).optional()});rt({includeStyles:rr().default(!0),includeMeta:rr().default(!0),format:nt(["html","txt"]).default("html")});const Ua=(e="")=>{const[t,r]=A.useState({content:e,title:"Untitled Document",wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:!1}),o=A.useRef(null),n=A.useRef(e);A.useEffect(()=>{e!==n.current&&(o.current&&(o.current.innerHTML=e),r(g=>({...g,content:e,wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:g.hasUnsavedChanges})),n.current=e)},[e]),A.useEffect(()=>{o.current&&!o.current.innerHTML&&e&&(o.current.innerHTML=e)},[]);const i=A.useCallback(g=>{const p=g.trim()?g.trim().split(/\s+/).length:0,b=g.length;r(T=>({...T,content:g,wordCount:p,characterCount:b,hasUnsavedChanges:!0})),n.current=g},[]),a=A.useCallback(g=>{r(p=>({...p,title:g,hasUnsavedChanges:!0}))},[]),s=A.useCallback((g,p)=>{document.execCommand(g,!1,p),o.current&&i(o.current.innerHTML),o.current?.focus()},[i]),c=A.useCallback(()=>{try{return{success:!0,data:Ma.parse({title:t.title,content:t.content,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),wordCount:t.wordCount,characterCount:t.characterCount}})}}catch(g){return{success:!1,error:g instanceof Error?g.message:"Validation failed"}}},[t]),d=A.useCallback((g={includeStyles:!0,includeMeta:!0})=>{const p=c();if(!p.success)throw new Error(p.error);const{data:b}=p;let T=`<!DOCTYPE html>
44
44
  <html>
45
45
  <head>
46
46
  <meta charset="UTF-8">
47
47
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
48
- <title>${k?.title}</title>`;return p.includeStyles&&(m+=`
48
+ <title>${b?.title}</title>`;return g.includeStyles&&(T+=`
49
49
  <style>
50
50
  body {
51
51
  font-family: Arial, sans-serif;
@@ -59,18 +59,18 @@ React keys must be passed directly to JSX without using spread:
59
59
  border-radius: 8px;
60
60
  background: white;
61
61
  }
62
- </style>`),m+=`
62
+ </style>`),T+=`
63
63
  </head>
64
- <body>`,p.includeMeta&&(m+=`
64
+ <body>`,g.includeMeta&&(T+=`
65
65
  <div class="document-meta">
66
- <h1>${k?.title}</h1>
67
- <p><small>Created: ${new Date(k?.metadata.createdAt??"").toLocaleString()} |
68
- Words: ${k?.metadata.wordCount} |
69
- Characters: ${k?.metadata.characterCount}</small></p>
66
+ <h1>${b?.title}</h1>
67
+ <p><small>Created: ${new Date(b?.metadata.createdAt??"").toLocaleString()} |
68
+ Words: ${b?.metadata.wordCount} |
69
+ Characters: ${b?.metadata.characterCount}</small></p>
70
70
  <hr>
71
- </div>`),m+=`
71
+ </div>`),T+=`
72
72
  <div class="editor-content">
73
- ${k?.content}
73
+ ${b?.content}
74
74
  </div>
75
75
  </body>
76
- </html>`,m},[s]),d=A.useCallback(()=>{r({content:"",title:"Untitled Document",wordCount:0,characterCount:0,hasUnsavedChanges:!1}),o.current&&(o.current.innerHTML="")},[]);return{editorState:t,editorRef:o,updateContent:n,updateTitle:i,executeCommand:a,getValidationResult:s,exportToHTML:c,clearEditor:d}};function lr(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=lr(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Da(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=lr(e))&&(o&&(o+=" "),o+=t);return o}const it="-",Fa=e=>{const t=Ga(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const s=a.split(it);return s[0]===""&&s.length!==1&&s.shift(),ur(s,t)||Va(a)},getConflictingClassGroupIds:(a,s)=>{const c=r[a]||[];return s&&o[a]?[...c,...o[a]]:c}}},ur=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),n=o?ur(e.slice(1),o):void 0;if(n)return n;if(t.validators.length===0)return;const i=e.join(it);return t.validators.find(({validator:a})=>a(i))?.classGroupId},dr=/^\[(.+)\]$/,Va=e=>{if(dr.test(e)){const t=dr.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Ga=e=>{const{theme:t,classGroups:r}=e,o={nextPart:new Map,validators:[]};for(const n in r)at(r[n],o,n,t);return o},at=(e,t,r,o)=>{e.forEach(n=>{if(typeof n=="string"){const i=n===""?t:pr(t,n);i.classGroupId=r;return}if(typeof n=="function"){if(Wa(n)){at(n(o),t,r,o);return}t.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(([i,a])=>{at(a,pr(t,i),r,o)})})},pr=(e,t)=>{let r=e;return t.split(it).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},Wa=e=>e.isThemeGetter,Ba=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const n=(i,a)=>{r.set(i,a),t++,t>e&&(t=0,o=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=o.get(i))!==void 0)return n(i,a),a},set(i,a){r.has(i)?r.set(i,a):n(i,a)}}},st="!",ct=":",Ya=ct.length,Ja=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=n=>{const i=[];let a=0,s=0,c=0,d;for(let w=0;w<n.length;w++){let I=n[w];if(a===0&&s===0){if(I===ct){i.push(n.slice(c,w)),c=w+Ya;continue}if(I==="/"){d=w;continue}}I==="["?a++:I==="]"?a--:I==="("?s++:I===")"&&s--}const p=i.length===0?n:n.substring(c),_=Ha(p),k=_!==p,m=d&&d>c?d-c:void 0;return{modifiers:i,hasImportantModifier:k,baseClassName:_,maybePostfixModifierPosition:m}};if(t){const n=t+ct,i=o;o=a=>a.startsWith(n)?i(a.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(r){const n=o;o=i=>r({className:i,parseClassName:n})}return o},Ha=e=>e.endsWith(st)?e.substring(0,e.length-1):e.startsWith(st)?e.substring(1):e,Xa=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const n=[];let i=[];return o.forEach(a=>{a[0]==="["||t[a]?(n.push(...i.sort(),a),i=[]):i.push(a)}),n.push(...i.sort()),n}},Ka=e=>({cache:Ba(e.cacheSize),parseClassName:Ja(e),sortModifiers:Xa(e),...Fa(e)}),qa=/\s+/,Qa=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:i}=t,a=[],s=e.trim().split(qa);let c="";for(let d=s.length-1;d>=0;d-=1){const p=s[d],{isExternal:_,modifiers:k,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:I}=r(p);if(_){c=p+(c.length>0?" "+c:c);continue}let N=!!I,D=o(N?w.substring(0,I):w);if(!D){if(!N){c=p+(c.length>0?" "+c:c);continue}if(D=o(w),!D){c=p+(c.length>0?" "+c:c);continue}N=!1}const U=i(k).join(":"),M=m?U+st:U,R=M+D;if(a.includes(R))continue;a.push(R);const F=n(D,N);for(let J=0;J<F.length;++J){const $=F[J];a.push(M+$)}c=p+(c.length>0?" "+c:c)}return c};function es(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=mr(t))&&(o&&(o+=" "),o+=r);return o}const mr=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=mr(e[o]))&&(r&&(r+=" "),r+=t);return r};function ts(e,...t){let r,o,n,i=a;function a(c){const d=t.reduce((p,_)=>_(p),e());return r=Ka(d),o=r.cache.get,n=r.cache.set,i=s,s(c)}function s(c){const d=o(c);if(d)return d;const p=Qa(c,r);return n(c,p),p}return function(){return i(es.apply(null,arguments))}}const L=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},fr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rs=/^\d+\/\d+$/,os=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ns=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,is=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,as=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ss=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,me=e=>rs.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),oe=e=>!!e&&Number.isInteger(Number(e)),lt=e=>e.endsWith("%")&&z(e.slice(0,-1)),q=e=>os.test(e),cs=()=>!0,ls=e=>ns.test(e)&&!is.test(e),gr=()=>!1,us=e=>as.test(e),ds=e=>ss.test(e),ps=e=>!f(e)&&!h(e),ms=e=>fe(e,yr,gr),f=e=>fr.test(e),ue=e=>fe(e,_r,ls),ut=e=>fe(e,vs,z),br=e=>fe(e,wr,gr),fs=e=>fe(e,kr,ds),De=e=>fe(e,xr,us),h=e=>hr.test(e),xe=e=>he(e,_r),hs=e=>he(e,ws),vr=e=>he(e,wr),gs=e=>he(e,yr),bs=e=>he(e,kr),Fe=e=>he(e,xr,!0),fe=(e,t,r)=>{const o=fr.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},he=(e,t,r=!1)=>{const o=hr.exec(e);return o?o[1]?t(o[1]):r:!1},wr=e=>e==="position"||e==="percentage",kr=e=>e==="image"||e==="url",yr=e=>e==="length"||e==="size"||e==="bg-size",_r=e=>e==="length",vs=e=>e==="number",ws=e=>e==="family-name",xr=e=>e==="shadow",ks=ts(()=>{const e=L("color"),t=L("font"),r=L("text"),o=L("font-weight"),n=L("tracking"),i=L("leading"),a=L("breakpoint"),s=L("container"),c=L("spacing"),d=L("radius"),p=L("shadow"),_=L("inset-shadow"),k=L("text-shadow"),m=L("drop-shadow"),w=L("blur"),I=L("perspective"),N=L("aspect"),D=L("ease"),U=L("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...R(),h,f],J=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],b=()=>[h,f,c],G=()=>[me,"full","auto",...b()],H=()=>[oe,"none","subgrid",h,f],Ve=()=>["auto",{span:["full",oe,h,f]},oe,h,f],ne=()=>[oe,"auto",h,f],ze=()=>["auto","min","max","fr",h,f],Ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...b()],K=()=>[me,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],v=()=>[e,h,f],Ze=()=>[...R(),vr,br,{position:[h,f]}],Ce=()=>["no-repeat",{repeat:["","x","y","space","round"]}],u=()=>["auto","cover","contain",gs,ms,{size:[h,f]}],x=()=>[lt,xe,ue],E=()=>["","none","full",d,h,f],C=()=>["",z,xe,ue],Q=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[z,lt,vr,br],ee=()=>["","none",w,h,f],ie=()=>["none",z,h,f],be=()=>["none",z,h,f],dt=()=>[z,h,f],Ge=()=>[me,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[q],breakpoint:[q],color:[cs],container:[q],"drop-shadow":[q],ease:["in","out","in-out"],font:[ps],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[q],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[q],shadow:[q],spacing:["px",z],text:[q],"text-shadow":[q],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",me,f,h,N]}],container:["container"],columns:[{columns:[z,f,h,s]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:F()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{start:G()}],end:[{end:G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[oe,"auto",h,f]}],basis:[{basis:[me,"full","auto",s,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[z,me,"auto","initial","none",f]}],grow:[{grow:["",z,h,f]}],shrink:[{shrink:["",z,h,f]}],order:[{order:[oe,"first","last","none",h,f]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:Ve()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:Ve()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ze()}],"auto-rows":[{"auto-rows":ze()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...Ee(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...Ee()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ee()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[s,"screen",...K()]}],"min-w":[{"min-w":[s,"screen","none",...K()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",r,xe,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,h,ut]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lt,f]}],"font-family":[{font:[hs,f,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,h,f]}],"line-clamp":[{"line-clamp":[z,"none",h,ut]}],leading:[{leading:[i,...b()]}],"list-image":[{"list-image":["none",h,f]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",h,f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:v()}],"text-color":[{text:v()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[z,"from-font","auto",h,ue]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[z,"auto",h,f]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h,f]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h,f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ze()}],"bg-repeat":[{bg:Ce()}],"bg-size":[{bg:u()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oe,h,f],radial:["",h,f],conic:[oe,h,f]},bs,fs]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:x()}],"gradient-via-pos":[{via:x()}],"gradient-to-pos":[{to:x()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:E()}],"rounded-s":[{"rounded-s":E()}],"rounded-e":[{"rounded-e":E()}],"rounded-t":[{"rounded-t":E()}],"rounded-r":[{"rounded-r":E()}],"rounded-b":[{"rounded-b":E()}],"rounded-l":[{"rounded-l":E()}],"rounded-ss":[{"rounded-ss":E()}],"rounded-se":[{"rounded-se":E()}],"rounded-ee":[{"rounded-ee":E()}],"rounded-es":[{"rounded-es":E()}],"rounded-tl":[{"rounded-tl":E()}],"rounded-tr":[{"rounded-tr":E()}],"rounded-br":[{"rounded-br":E()}],"rounded-bl":[{"rounded-bl":E()}],"border-w":[{border:C()}],"border-w-x":[{"border-x":C()}],"border-w-y":[{"border-y":C()}],"border-w-s":[{"border-s":C()}],"border-w-e":[{"border-e":C()}],"border-w-t":[{"border-t":C()}],"border-w-r":[{"border-r":C()}],"border-w-b":[{"border-b":C()}],"border-w-l":[{"border-l":C()}],"divide-x":[{"divide-x":C()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":C()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:v()}],"border-color-x":[{"border-x":v()}],"border-color-y":[{"border-y":v()}],"border-color-s":[{"border-s":v()}],"border-color-e":[{"border-e":v()}],"border-color-t":[{"border-t":v()}],"border-color-r":[{"border-r":v()}],"border-color-b":[{"border-b":v()}],"border-color-l":[{"border-l":v()}],"divide-color":[{divide:v()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[z,h,f]}],"outline-w":[{outline:["",z,xe,ue]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",p,Fe,De]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",_,Fe,De]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:C()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[z,ue]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":C()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",k,Fe,De]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[z,h,f]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":v()}],"mask-image-linear-to-color":[{"mask-linear-to":v()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":v()}],"mask-image-t-to-color":[{"mask-t-to":v()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":v()}],"mask-image-r-to-color":[{"mask-r-to":v()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":v()}],"mask-image-b-to-color":[{"mask-b-to":v()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":v()}],"mask-image-l-to-color":[{"mask-l-to":v()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":v()}],"mask-image-x-to-color":[{"mask-x-to":v()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[h,f]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":v()}],"mask-image-radial-to-color":[{"mask-radial-to":v()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":v()}],"mask-image-conic-to-color":[{"mask-conic-to":v()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ze()}],"mask-repeat":[{mask:Ce()}],"mask-size":[{mask:u()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",h,f]}],filter:[{filter:["","none",h,f]}],blur:[{blur:ee()}],brightness:[{brightness:[z,h,f]}],contrast:[{contrast:[z,h,f]}],"drop-shadow":[{"drop-shadow":["","none",m,Fe,De]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",z,h,f]}],"hue-rotate":[{"hue-rotate":[z,h,f]}],invert:[{invert:["",z,h,f]}],saturate:[{saturate:[z,h,f]}],sepia:[{sepia:["",z,h,f]}],"backdrop-filter":[{"backdrop-filter":["","none",h,f]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[z,h,f]}],"backdrop-contrast":[{"backdrop-contrast":[z,h,f]}],"backdrop-grayscale":[{"backdrop-grayscale":["",z,h,f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,h,f]}],"backdrop-invert":[{"backdrop-invert":["",z,h,f]}],"backdrop-opacity":[{"backdrop-opacity":[z,h,f]}],"backdrop-saturate":[{"backdrop-saturate":[z,h,f]}],"backdrop-sepia":[{"backdrop-sepia":["",z,h,f]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",h,f]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[z,"initial",h,f]}],ease:[{ease:["linear","initial",D,h,f]}],delay:[{delay:[z,h,f]}],animate:[{animate:["none",U,h,f]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[I,h,f]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[h,f,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],accent:[{accent:v()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:v()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h,f]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h,f]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[z,xe,ue,ut]}],stroke:[{stroke:["none",...v()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ys(...e){return ks(Da(e))}const _s=({initialContent:e="",onSave:t,onExport:r,onChange:o,showButtons:n=!1,showSaveTitle:i=!1,showStatusBar:a=!1,height:s="500px"})=>{const{editorState:c,editorRef:d,updateContent:p,updateTitle:_,executeCommand:k,getValidationResult:m,exportToHTML:w,clearEditor:I}=Ua(e),[N,D]=A.useState(!1);A.useEffect(()=>{if(o)try{const $=w({includeStyles:!1,includeMeta:!1});o(c.content,$,c.title)}catch{const b=`<!DOCTYPE html><html><body>${c.content}</body></html>`;o(c.content,b,c.title)}},[c.content,c.title,o,w]);const U=A.useCallback(()=>{if(m().success){const b=w();t?.(c.content,b)}else D(!0),setTimeout(()=>D(!1),3e3)},[c.content,m,w,t]),M=A.useCallback(()=>{try{const $=w();r?.($);const b=new Blob([$],{type:"text/html"}),G=URL.createObjectURL(b),H=document.createElement("a");H.href=G,H.download=`${c.title.replace(/\s+/g,"_")||"document"}.html`,document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(G)}catch($){alert("Export failed: "+($ instanceof Error?$.message:"Unknown error"))}},[w,c.title,r]),R=A.useCallback(()=>{confirm("Are you sure you want to clear the editor? All unsaved changes will be lost.")&&I()},[I]),F=A.useCallback($=>{p($)},[p]),J=A.useCallback($=>{_($)},[_]);return console.log(" height : ",s),y.jsxs("div",{className:"w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden",children:[i&&y.jsxs("div",{className:"p-6 border-b border-gray-200 bg-gray-50",children:[y.jsx("input",{type:"text",className:"w-full bg-transparent text-2xl font-bold text-gray-800 outline-none placeholder-gray-400",value:c.title,onChange:$=>J($.target.value),placeholder:"Document Title"}),N&&y.jsx("div",{className:"text-red-600 text-sm mt-2 animate-fadeIn",children:"Please add content before saving"})]}),y.jsx(Cr,{onCommand:k,onSave:U,onExport:M,showButtons:n,onClear:R,hasUnsavedChanges:c.hasUnsavedChanges}),y.jsx("div",{ref:d,className:ys("editor-content p-8 border-none outline-none resize-none text-gray-700 leading-relaxed prose max-w-none",s||"min-h-[500px]"),contentEditable:!0,onInput:$=>F($.currentTarget.innerHTML),onBlur:$=>F($.currentTarget.innerHTML),suppressContentEditableWarning:!0}),a&&y.jsx($r,{wordCount:c.wordCount,characterCount:c.characterCount,hasUnsavedChanges:c.hasUnsavedChanges})]})};te.TextEditor=_s,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})}));
76
+ </html>`,T},[c]),h=A.useCallback(()=>{r({content:"",title:"Untitled Document",wordCount:0,characterCount:0,hasUnsavedChanges:!1}),o.current&&(o.current.innerHTML=""),n.current=""},[]),Z=A.useCallback(()=>{o.current&&(o.current.innerHTML=e),r(g=>({...g,content:e,wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:!1})),n.current=e},[e]);return{editorState:t,editorRef:o,updateContent:i,updateTitle:a,executeCommand:s,getValidationResult:c,exportToHTML:d,clearEditor:h,resetToInitial:Z}};function lr(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=lr(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Da(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=lr(e))&&(o&&(o+=" "),o+=t);return o}const it="-",Fa=e=>{const t=Ga(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const s=a.split(it);return s[0]===""&&s.length!==1&&s.shift(),ur(s,t)||Va(a)},getConflictingClassGroupIds:(a,s)=>{const c=r[a]||[];return s&&o[a]?[...c,...o[a]]:c}}},ur=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),n=o?ur(e.slice(1),o):void 0;if(n)return n;if(t.validators.length===0)return;const i=e.join(it);return t.validators.find(({validator:a})=>a(i))?.classGroupId},dr=/^\[(.+)\]$/,Va=e=>{if(dr.test(e)){const t=dr.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Ga=e=>{const{theme:t,classGroups:r}=e,o={nextPart:new Map,validators:[]};for(const n in r)at(r[n],o,n,t);return o},at=(e,t,r,o)=>{e.forEach(n=>{if(typeof n=="string"){const i=n===""?t:pr(t,n);i.classGroupId=r;return}if(typeof n=="function"){if(Wa(n)){at(n(o),t,r,o);return}t.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(([i,a])=>{at(a,pr(t,i),r,o)})})},pr=(e,t)=>{let r=e;return t.split(it).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},Wa=e=>e.isThemeGetter,Ba=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const n=(i,a)=>{r.set(i,a),t++,t>e&&(t=0,o=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=o.get(i))!==void 0)return n(i,a),a},set(i,a){r.has(i)?r.set(i,a):n(i,a)}}},st="!",ct=":",Ya=ct.length,Ja=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=n=>{const i=[];let a=0,s=0,c=0,d;for(let b=0;b<n.length;b++){let T=n[b];if(a===0&&s===0){if(T===ct){i.push(n.slice(c,b)),c=b+Ya;continue}if(T==="/"){d=b;continue}}T==="["?a++:T==="]"?a--:T==="("?s++:T===")"&&s--}const h=i.length===0?n:n.substring(c),Z=Ha(h),g=Z!==h,p=d&&d>c?d-c:void 0;return{modifiers:i,hasImportantModifier:g,baseClassName:Z,maybePostfixModifierPosition:p}};if(t){const n=t+ct,i=o;o=a=>a.startsWith(n)?i(a.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(r){const n=o;o=i=>r({className:i,parseClassName:n})}return o},Ha=e=>e.endsWith(st)?e.substring(0,e.length-1):e.startsWith(st)?e.substring(1):e,Xa=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const n=[];let i=[];return o.forEach(a=>{a[0]==="["||t[a]?(n.push(...i.sort(),a),i=[]):i.push(a)}),n.push(...i.sort()),n}},Ka=e=>({cache:Ba(e.cacheSize),parseClassName:Ja(e),sortModifiers:Xa(e),...Fa(e)}),qa=/\s+/,Qa=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:i}=t,a=[],s=e.trim().split(qa);let c="";for(let d=s.length-1;d>=0;d-=1){const h=s[d],{isExternal:Z,modifiers:g,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:T}=r(h);if(Z){c=h+(c.length>0?" "+c:c);continue}let N=!!T,D=o(N?b.substring(0,T):b);if(!D){if(!N){c=h+(c.length>0?" "+c:c);continue}if(D=o(b),!D){c=h+(c.length>0?" "+c:c);continue}N=!1}const U=i(g).join(":"),M=p?U+st:U,R=M+D;if(a.includes(R))continue;a.push(R);const F=n(D,N);for(let J=0;J<F.length;++J){const $=F[J];a.push(M+$)}c=h+(c.length>0?" "+c:c)}return c};function es(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=mr(t))&&(o&&(o+=" "),o+=r);return o}const mr=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=mr(e[o]))&&(r&&(r+=" "),r+=t);return r};function ts(e,...t){let r,o,n,i=a;function a(c){const d=t.reduce((h,Z)=>Z(h),e());return r=Ka(d),o=r.cache.get,n=r.cache.set,i=s,s(c)}function s(c){const d=o(c);if(d)return d;const h=Qa(c,r);return n(c,h),h}return function(){return i(es.apply(null,arguments))}}const L=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},fr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rs=/^\d+\/\d+$/,os=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ns=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,is=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,as=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ss=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,me=e=>rs.test(e),x=e=>!!e&&!Number.isNaN(Number(e)),oe=e=>!!e&&Number.isInteger(Number(e)),lt=e=>e.endsWith("%")&&x(e.slice(0,-1)),q=e=>os.test(e),cs=()=>!0,ls=e=>ns.test(e)&&!is.test(e),gr=()=>!1,us=e=>as.test(e),ds=e=>ss.test(e),ps=e=>!m(e)&&!f(e),ms=e=>fe(e,yr,gr),m=e=>fr.test(e),ue=e=>fe(e,_r,ls),ut=e=>fe(e,vs,x),br=e=>fe(e,wr,gr),fs=e=>fe(e,kr,ds),De=e=>fe(e,xr,us),f=e=>hr.test(e),xe=e=>he(e,_r),hs=e=>he(e,ws),vr=e=>he(e,wr),gs=e=>he(e,yr),bs=e=>he(e,kr),Fe=e=>he(e,xr,!0),fe=(e,t,r)=>{const o=fr.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},he=(e,t,r=!1)=>{const o=hr.exec(e);return o?o[1]?t(o[1]):r:!1},wr=e=>e==="position"||e==="percentage",kr=e=>e==="image"||e==="url",yr=e=>e==="length"||e==="size"||e==="bg-size",_r=e=>e==="length",vs=e=>e==="number",ws=e=>e==="family-name",xr=e=>e==="shadow",ks=ts(()=>{const e=L("color"),t=L("font"),r=L("text"),o=L("font-weight"),n=L("tracking"),i=L("leading"),a=L("breakpoint"),s=L("container"),c=L("spacing"),d=L("radius"),h=L("shadow"),Z=L("inset-shadow"),g=L("text-shadow"),p=L("drop-shadow"),b=L("blur"),T=L("perspective"),N=L("aspect"),D=L("ease"),U=L("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...R(),f,m],J=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],w=()=>[f,m,c],G=()=>[me,"full","auto",...w()],H=()=>[oe,"none","subgrid",f,m],Ve=()=>["auto",{span:["full",oe,f,m]},oe,f,m],ne=()=>[oe,"auto",f,m],ze=()=>["auto","min","max","fr",f,m],Ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...w()],K=()=>[me,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],k=()=>[e,f,m],Ze=()=>[...R(),vr,br,{position:[f,m]}],Ce=()=>["no-repeat",{repeat:["","x","y","space","round"]}],u=()=>["auto","cover","contain",gs,ms,{size:[f,m]}],_=()=>[lt,xe,ue],z=()=>["","none","full",d,f,m],C=()=>["",x,xe,ue],Q=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>[x,lt,vr,br],ee=()=>["","none",b,f,m],ie=()=>["none",x,f,m],be=()=>["none",x,f,m],dt=()=>[x,f,m],Ge=()=>[me,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[q],breakpoint:[q],color:[cs],container:[q],"drop-shadow":[q],ease:["in","out","in-out"],font:[ps],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[q],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[q],shadow:[q],spacing:["px",x],text:[q],"text-shadow":[q],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",me,m,f,N]}],container:["container"],columns:[{columns:[x,m,f,s]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:F()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{start:G()}],end:[{end:G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[oe,"auto",f,m]}],basis:[{basis:[me,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[x,me,"auto","initial","none",m]}],grow:[{grow:["",x,f,m]}],shrink:[{shrink:["",x,f,m]}],order:[{order:[oe,"first","last","none",f,m]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:Ve()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:Ve()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ze()}],"auto-rows":[{"auto-rows":ze()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...Ee(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...Ee()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ee()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[s,"screen",...K()]}],"min-w":[{"min-w":[s,"screen","none",...K()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",r,xe,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,f,ut]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lt,m]}],"font-family":[{font:[hs,m,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,f,m]}],"line-clamp":[{"line-clamp":[x,"none",f,ut]}],leading:[{leading:[i,...w()]}],"list-image":[{"list-image":["none",f,m]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",f,m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[x,"from-font","auto",f,ue]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[x,"auto",f,m]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",f,m]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",f,m]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ze()}],"bg-repeat":[{bg:Ce()}],"bg-size":[{bg:u()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oe,f,m],radial:["",f,m],conic:[oe,f,m]},bs,fs]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:_()}],"gradient-via-pos":[{via:_()}],"gradient-to-pos":[{to:_()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:C()}],"border-w-x":[{"border-x":C()}],"border-w-y":[{"border-y":C()}],"border-w-s":[{"border-s":C()}],"border-w-e":[{"border-e":C()}],"border-w-t":[{"border-t":C()}],"border-w-r":[{"border-r":C()}],"border-w-b":[{"border-b":C()}],"border-w-l":[{"border-l":C()}],"divide-x":[{"divide-x":C()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":C()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[x,f,m]}],"outline-w":[{outline:["",x,xe,ue]}],"outline-color":[{outline:k()}],shadow:[{shadow:["","none",h,Fe,De]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":["none",Z,Fe,De]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:C()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[x,ue]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":C()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":["none",g,Fe,De]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[x,f,m]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[x]}],"mask-image-linear-from-pos":[{"mask-linear-from":E()}],"mask-image-linear-to-pos":[{"mask-linear-to":E()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":E()}],"mask-image-t-to-pos":[{"mask-t-to":E()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":E()}],"mask-image-r-to-pos":[{"mask-r-to":E()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":E()}],"mask-image-b-to-pos":[{"mask-b-to":E()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":E()}],"mask-image-l-to-pos":[{"mask-l-to":E()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":E()}],"mask-image-x-to-pos":[{"mask-x-to":E()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":E()}],"mask-image-y-to-pos":[{"mask-y-to":E()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[f,m]}],"mask-image-radial-from-pos":[{"mask-radial-from":E()}],"mask-image-radial-to-pos":[{"mask-radial-to":E()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[x]}],"mask-image-conic-from-pos":[{"mask-conic-from":E()}],"mask-image-conic-to-pos":[{"mask-conic-to":E()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ze()}],"mask-repeat":[{mask:Ce()}],"mask-size":[{mask:u()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",f,m]}],filter:[{filter:["","none",f,m]}],blur:[{blur:ee()}],brightness:[{brightness:[x,f,m]}],contrast:[{contrast:[x,f,m]}],"drop-shadow":[{"drop-shadow":["","none",p,Fe,De]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:["",x,f,m]}],"hue-rotate":[{"hue-rotate":[x,f,m]}],invert:[{invert:["",x,f,m]}],saturate:[{saturate:[x,f,m]}],sepia:[{sepia:["",x,f,m]}],"backdrop-filter":[{"backdrop-filter":["","none",f,m]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[x,f,m]}],"backdrop-contrast":[{"backdrop-contrast":[x,f,m]}],"backdrop-grayscale":[{"backdrop-grayscale":["",x,f,m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x,f,m]}],"backdrop-invert":[{"backdrop-invert":["",x,f,m]}],"backdrop-opacity":[{"backdrop-opacity":[x,f,m]}],"backdrop-saturate":[{"backdrop-saturate":[x,f,m]}],"backdrop-sepia":[{"backdrop-sepia":["",x,f,m]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",f,m]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[x,"initial",f,m]}],ease:[{ease:["linear","initial",D,f,m]}],delay:[{delay:[x,f,m]}],animate:[{animate:["none",U,f,m]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,f,m]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[f,m,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],accent:[{accent:k()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",f,m]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",f,m]}],fill:[{fill:["none",...k()]}],"stroke-w":[{stroke:[x,xe,ue,ut]}],stroke:[{stroke:["none",...k()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ys(...e){return ks(Da(e))}const _s=({initialContent:e="",onSave:t,onExport:r,onChange:o,showButtons:n=!1,showSaveTitle:i=!1,showStatusBar:a=!1,height:s="500px"})=>{const{editorState:c,editorRef:d,updateContent:h,updateTitle:Z,executeCommand:g,getValidationResult:p,exportToHTML:b,clearEditor:T}=Ua(e),[N,D]=A.useState(!1);A.useEffect(()=>{if(o)try{const $=b({includeStyles:!1,includeMeta:!1});o(c.content,$,c.title)}catch{const w=`<!DOCTYPE html><html><body>${c.content}</body></html>`;o(c.content,w,c.title)}},[c.content,c.title,o,b]);const U=A.useCallback(()=>{if(p().success){const w=b();t?.(c.content,w)}else D(!0),setTimeout(()=>D(!1),3e3)},[c.content,p,b,t]),M=A.useCallback(()=>{try{const $=b();r?.($);const w=new Blob([$],{type:"text/html"}),G=URL.createObjectURL(w),H=document.createElement("a");H.href=G,H.download=`${c.title.replace(/\s+/g,"_")||"document"}.html`,document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(G)}catch($){alert("Export failed: "+($ instanceof Error?$.message:"Unknown error"))}},[b,c.title,r]),R=A.useCallback(()=>{confirm("Are you sure you want to clear the editor? All unsaved changes will be lost.")&&T()},[T]),F=A.useCallback($=>{h($)},[h]),J=A.useCallback($=>{Z($)},[Z]);return y.jsxs("div",{className:"w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden",children:[i&&y.jsxs("div",{className:"p-6 border-b border-gray-200 bg-gray-50",children:[y.jsx("input",{type:"text",className:"w-full bg-transparent text-2xl font-bold text-gray-800 outline-none placeholder-gray-400",value:c.title,onChange:$=>J($.target.value),placeholder:"Document Title"}),N&&y.jsx("div",{className:"text-red-600 text-sm mt-2 animate-fadeIn",children:"Please add content before saving"})]}),y.jsx(Cr,{onCommand:g,onSave:U,onExport:M,showButtons:n,onClear:R,hasUnsavedChanges:c.hasUnsavedChanges}),y.jsx("div",{ref:d,className:ys("editor-content p-8 border-none outline-none resize-none text-gray-700 leading-relaxed prose max-w-none",s||"min-h-[500px]"),contentEditable:!0,onInput:$=>F($.currentTarget.innerHTML),onBlur:$=>F($.currentTarget.innerHTML),suppressContentEditableWarning:!0}),a&&y.jsx(Tr,{wordCount:c.wordCount,characterCount:c.characterCount,hasUnsavedChanges:c.hasUnsavedChanges})]})};te.TextEditor=_s,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})}));