@veevarts/design-system 1.15.0-alpha.13 → 1.15.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),c=require("@heroui/react"),p=require("react"),K=require("lucide-react"),ke=require("framer-motion"),un=require("@tiptap/react"),Rn=require("@tiptap/core"),$a=require("@tiptap/extension-bold"),Ea=require("@tiptap/extension-italic"),Ia=require("@tiptap/extension-strike"),Fa=require("@tiptap/extension-underline"),Ma=require("@tiptap/extension-code"),Ta=require("@tiptap/extension-color"),La=require("@tiptap/extension-highlight"),Oa=require("@tiptap/extension-link"),Pa=require("@tiptap/extension-text-style"),_a=require("@tiptap/extension-heading"),za=require("@tiptap/extension-paragraph"),Ra=require("@tiptap/extension-bullet-list"),Ba=require("@tiptap/extension-ordered-list"),Va=require("@tiptap/extension-task-list"),Ua=require("@tiptap/extension-task-item"),Ha=require("@tiptap/extension-list-item"),qa=require("@tiptap/extension-code-block"),Wa=require("@tiptap/extension-blockquote"),Ya=require("@tiptap/extension-horizontal-rule"),Ga=require("@tiptap/extension-hard-break"),Bn=require("@tiptap/extension-history"),Ka=require("@tiptap/extension-text-align"),Qa=require("@tiptap/extension-document"),Za=require("@tiptap/extension-text"),Xa=require("@tiptap/extension-dropcursor"),Ja=require("@tiptap/extension-gapcursor");function ei({children:e}){return s.jsx(c.HeroUIProvider,{children:e})}function ti(e,t){const n=e.icons,r=e.aliases||Object.create(null),a=Object.create(null);function i(o){if(n[o])return a[o]=[];if(!(o in a)){a[o]=null;const l=r[o]&&r[o].parent,d=l&&i(l);d&&(a[o]=[l].concat(d))}return a[o]}return Object.keys(n).concat(Object.keys(r)).forEach(i),a}const Es=Object.freeze({left:0,top:0,width:16,height:16}),bt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),fn=Object.freeze({...Es,...bt}),Zt=Object.freeze({...fn,body:"",hidden:!1});function ni(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Vn(e,t){const n=ni(e,t);for(const r in Zt)r in bt?r in e&&!(r in n)&&(n[r]=bt[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function si(e,t,n){const r=e.icons,a=e.aliases||Object.create(null);let i={};function o(l){i=Vn(r[l]||a[l],i)}return o(t),n.forEach(o),Vn(e,i)}function Is(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(a=>{t(a,null),n.push(a)});const r=ti(e);for(const a in r){const i=r[a];i&&(t(a,si(e,a,i)),n.push(a))}return n}const ri={provider:"",aliases:{},not_found:{},...Es};function Mt(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Fs(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Mt(e,ri))return null;const n=t.icons;for(const a in n){const i=n[a];if(!a||typeof i.body!="string"||!Mt(i,Zt))return null}const r=t.aliases||Object.create(null);for(const a in r){const i=r[a],o=i.parent;if(!a||typeof o!="string"||!n[o]&&!r[o]||!Mt(i,Zt))return null}return t}const Un=Object.create(null);function ai(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Ze(e,t){const n=Un[e]||(Un[e]=Object.create(null));return n[t]||(n[t]=ai(e,t))}function Ms(e,t){return Fs(t)?Is(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function ii(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}const Ts=/^[a-z0-9]+(-[a-z0-9]+)*$/,kt=(e,t,n,r="")=>{const a=e.split(":");if(e.slice(0,1)==="@"){if(a.length<2||a.length>3)return null;r=a.shift().slice(1)}if(a.length>3||!a.length)return null;if(a.length>1){const l=a.pop(),d=a.pop(),u={provider:a.length>0?a[0]:r,prefix:d,name:l};return t&&!xt(u)?null:u}const i=a[0],o=i.split("-");if(o.length>1){const l={provider:r,prefix:o.shift(),name:o.join("-")};return t&&!xt(l)?null:l}if(n&&r===""){const l={provider:r,prefix:"",name:i};return t&&!xt(l,n)?null:l}return null},xt=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;let ot=!1;function Ls(e){return typeof e=="boolean"&&(ot=e),ot}function Hn(e){const t=typeof e=="string"?kt(e,!0,ot):e;if(t){const n=Ze(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function li(e,t){const n=kt(e,!0,ot);if(!n)return!1;const r=Ze(n.provider,n.prefix);return t?ii(r,n.name,t):(r.missing.add(n.name),!0)}function oi(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),ot&&!t&&!e.prefix){let a=!1;return Fs(e)&&(e.prefix="",Is(e,(i,o)=>{li(i,o)&&(a=!0)})),a}const n=e.prefix;if(!xt({prefix:n,name:"a"}))return!1;const r=Ze(t,n);return!!Ms(r,e)}const Os=Object.freeze({width:null,height:null}),Ps=Object.freeze({...Os,...bt}),ci=/(-?[0-9.]*[0-9]+[0-9.]*)/g,di=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function qn(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(ci);if(r===null||!r.length)return e;const a=[];let i=r.shift(),o=di.test(i);for(;;){if(o){const l=parseFloat(i);isNaN(l)?a.push(i):a.push(Math.ceil(l*t*n)/n)}else a.push(i);if(i=r.shift(),i===void 0)return a.join("");o=!o}}function ui(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const a=e.indexOf(">",r),i=e.indexOf("</"+t);if(a===-1||i===-1)break;const o=e.indexOf(">",i);if(o===-1)break;n+=e.slice(a+1,i).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function fi(e,t){return e?"<defs>"+e+"</defs>"+t:t}function mi(e,t,n){const r=ui(e);return fi(r.defs,t+r.content+n)}const hi=e=>e==="unset"||e==="undefined"||e==="none";function xi(e,t){const n={...fn,...e},r={...Ps,...t},a={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach(k=>{const g=[],w=k.hFlip,N=k.vFlip;let S=k.rotate;w?N?S+=2:(g.push("translate("+(a.width+a.left).toString()+" "+(0-a.top).toString()+")"),g.push("scale(-1 1)"),a.top=a.left=0):N&&(g.push("translate("+(0-a.left).toString()+" "+(a.height+a.top).toString()+")"),g.push("scale(1 -1)"),a.top=a.left=0);let y;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:y=a.height/2+a.top,g.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:g.unshift("rotate(180 "+(a.width/2+a.left).toString()+" "+(a.height/2+a.top).toString()+")");break;case 3:y=a.width/2+a.left,g.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}S%2===1&&(a.left!==a.top&&(y=a.left,a.left=a.top,a.top=y),a.width!==a.height&&(y=a.width,a.width=a.height,a.height=y)),g.length&&(i=mi(i,'<g transform="'+g.join(" ")+'">',"</g>"))});const o=r.width,l=r.height,d=a.width,u=a.height;let f,h;o===null?(h=l===null?"1em":l==="auto"?u:l,f=qn(h,d/u)):(f=o==="auto"?d:o,h=l===null?qn(f,u/d):l==="auto"?u:l);const b={},m=(k,g)=>{hi(g)||(b[k]=g.toString())};m("width",f),m("height",h);const j=[a.left,a.top,d,u];return b.viewBox=j.join(" "),{attributes:b,viewBox:j,body:i}}const pi=/\sid="(\S+)"/g,gi="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let bi=0;function yi(e,t=gi){const n=[];let r;for(;r=pi.exec(e);)n.push(r[1]);if(!n.length)return e;const a="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(i=>{const o=typeof t=="function"?t(i):t+(bi++).toString(),l=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+o+a+"$3")}),e=e.replace(new RegExp(a,"g"),""),e}const Xt=Object.create(null);function vi(e,t){Xt[e]=t}function Jt(e){return Xt[e]||Xt[""]}function mn(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const hn=Object.create(null),et=["https://api.simplesvg.com","https://api.unisvg.com"],pt=[];for(;et.length>0;)et.length===1||Math.random()>.5?pt.push(et.shift()):pt.push(et.pop());hn[""]=mn({resources:["https://api.iconify.design"].concat(pt)});function ji(e,t){const n=mn(t);return n===null?!1:(hn[e]=n,!0)}function xn(e){return hn[e]}const wi=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Wn=wi();function Ni(e,t){const n=xn(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let a=0;n.resources.forEach(o=>{a=Math.max(a,o.length)});const i=t+".json?icons=";r=n.maxURL-a-n.path.length-i.length}return r}function Ci(e){return e===404}const ki=(e,t,n)=>{const r=[],a=Ni(e,t),i="icons";let o={type:i,provider:e,prefix:t,icons:[]},l=0;return n.forEach((d,u)=>{l+=d.length+1,l>=a&&u>0&&(r.push(o),o={type:i,provider:e,prefix:t,icons:[]},l=d.length),o.icons.push(d)}),r.push(o),r};function Si(e){if(typeof e=="string"){const t=xn(e);if(t)return t.path}return"/"}const Ai=(e,t,n)=>{if(!Wn){n("abort",424);return}let r=Si(t.provider);switch(t.type){case"icons":{const i=t.prefix,l=t.icons.join(","),d=new URLSearchParams({icons:l});r+=i+".json?"+d.toString();break}case"custom":{const i=t.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:n("abort",400);return}let a=503;Wn(e+r).then(i=>{const o=i.status;if(o!==200){setTimeout(()=>{n(Ci(o)?"abort":"next",o)});return}return a=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{i===404?n("abort",i):n("next",a)});return}setTimeout(()=>{n("success",i)})}).catch(()=>{n("next",a)})},Di={prepare:ki,send:Ai};function _s(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(a=>a.id!==t))})}function $i(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,a=e.prefix;t.forEach(i=>{const o=i.icons,l=o.pending.length;o.pending=o.pending.filter(d=>{if(d.prefix!==a)return!0;const u=d.name;if(e.icons[u])o.loaded.push({provider:r,prefix:a,name:u});else if(e.missing.has(u))o.missing.push({provider:r,prefix:a,name:u});else return n=!0,!0;return!1}),o.pending.length!==l&&(n||_s([e],i.id),i.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),i.abort))})}))}let Ei=0;function Ii(e,t,n){const r=Ei++,a=_s.bind(null,n,r);if(!t.pending.length)return a;const i={id:r,icons:t,callback:e,abort:a};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(i)}),a}function Fi(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((a,i)=>a.provider!==i.provider?a.provider.localeCompare(i.provider):a.prefix!==i.prefix?a.prefix.localeCompare(i.prefix):a.name.localeCompare(i.name));let r={provider:"",prefix:"",name:""};return e.forEach(a=>{if(r.name===a.name&&r.prefix===a.prefix&&r.provider===a.provider)return;r=a;const i=a.provider,o=a.prefix,l=a.name,d=n[i]||(n[i]=Object.create(null)),u=d[o]||(d[o]=Ze(i,o));let f;l in u.icons?f=t.loaded:o===""||u.missing.has(l)?f=t.missing:f=t.pending;const h={provider:i,prefix:o,name:l};f.push(h)}),t}function Mi(e,t=!0,n=!1){const r=[];return e.forEach(a=>{const i=typeof a=="string"?kt(a,t,n):a;i&&r.push(i)}),r}const Ti={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Li(e,t,n,r){const a=e.resources.length,i=e.random?Math.floor(Math.random()*a):e.index;let o;if(e.random){let E=e.resources.slice(0);for(o=[];E.length>1;){const F=Math.floor(Math.random()*E.length);o.push(E[F]),E=E.slice(0,F).concat(E.slice(F+1))}o=o.concat(E)}else o=e.resources.slice(i).concat(e.resources.slice(0,i));const l=Date.now();let d="pending",u=0,f,h=null,b=[],m=[];typeof r=="function"&&m.push(r);function j(){h&&(clearTimeout(h),h=null)}function k(){d==="pending"&&(d="aborted"),j(),b.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),b=[]}function g(E,F){F&&(m=[]),typeof E=="function"&&m.push(E)}function w(){return{startTime:l,payload:t,status:d,queriesSent:u,queriesPending:b.length,subscribe:g,abort:k}}function N(){d="failed",m.forEach(E=>{E(void 0,f)})}function S(){b.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),b=[]}function y(E,F,T){const A=F!=="success";switch(b=b.filter(_=>_!==E),d){case"pending":break;case"failed":if(A||!e.dataAfterTimeout)return;break;default:return}if(F==="abort"){f=T,N();return}if(A){f=T,b.length||(o.length?v():N());return}if(j(),S(),!e.random){const _=e.resources.indexOf(E.resource);_!==-1&&_!==e.index&&(e.index=_)}d="completed",m.forEach(_=>{_(T)})}function v(){if(d!=="pending")return;j();const E=o.shift();if(E===void 0){if(b.length){h=setTimeout(()=>{j(),d==="pending"&&(S(),N())},e.timeout);return}N();return}const F={status:"pending",resource:E,callback:(T,A)=>{y(F,T,A)}};b.push(F),u++,h=setTimeout(v,e.rotate),n(E,t,F.callback)}return setTimeout(v),w}function zs(e){const t={...Ti,...e};let n=[];function r(){n=n.filter(l=>l().status==="pending")}function a(l,d,u){const f=Li(t,l,d,(h,b)=>{r(),u&&u(h,b)});return n.push(f),f}function i(l){return n.find(d=>l(d))||null}return{query:a,find:i,setIndex:l=>{t.index=l},getIndex:()=>t.index,cleanup:r}}function Yn(){}const Tt=Object.create(null);function Oi(e){if(!Tt[e]){const t=xn(e);if(!t)return;const n=zs(t),r={config:t,redundancy:n};Tt[e]=r}return Tt[e]}function Pi(e,t,n){let r,a;if(typeof e=="string"){const i=Jt(e);if(!i)return n(void 0,424),Yn;a=i.send;const o=Oi(e);o&&(r=o.redundancy)}else{const i=mn(e);if(i){r=zs(i);const o=e.resources?e.resources[0]:"",l=Jt(o);l&&(a=l.send)}}return!r||!a?(n(void 0,424),Yn):r.query(t,a,n)().abort}function Gn(){}function _i(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,$i(e)}))}function zi(e){const t=[],n=[];return e.forEach(r=>{(r.match(Ts)?t:n).push(r)}),{valid:t,invalid:n}}function tt(e,t,n){function r(){const a=e.pendingIcons;t.forEach(i=>{a&&a.delete(i),e.icons[i]||e.missing.add(i)})}if(n&&typeof n=="object")try{if(!Ms(e,n).length){r();return}}catch(a){console.error(a)}r(),_i(e)}function Kn(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function Ri(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,a=e.iconsToLoad;if(delete e.iconsToLoad,!a||!a.length)return;const i=e.loadIcon;if(e.loadIcons&&(a.length>1||!i)){Kn(e.loadIcons(a,r,n),f=>{tt(e,a,f)});return}if(i){a.forEach(f=>{const h=i(f,r,n);Kn(h,b=>{const m=b?{prefix:r,icons:{[f]:b}}:null;tt(e,[f],m)})});return}const{valid:o,invalid:l}=zi(a);if(l.length&&tt(e,l,null),!o.length)return;const d=r.match(Ts)?Jt(n):null;if(!d){tt(e,o,null);return}d.prepare(n,r,o).forEach(f=>{Pi(n,f,h=>{tt(e,f.icons,h)})})}))}const Bi=(e,t)=>{const n=Mi(e,!0,Ls()),r=Fi(n);if(!r.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(r.loaded,r.missing,r.pending,Gn)}),()=>{d=!1}}const a=Object.create(null),i=[];let o,l;return r.pending.forEach(d=>{const{provider:u,prefix:f}=d;if(f===l&&u===o)return;o=u,l=f,i.push(Ze(u,f));const h=a[u]||(a[u]=Object.create(null));h[f]||(h[f]=[])}),r.pending.forEach(d=>{const{provider:u,prefix:f,name:h}=d,b=Ze(u,f),m=b.pendingIcons||(b.pendingIcons=new Set);m.has(h)||(m.add(h),a[u][f].push(h))}),i.forEach(d=>{const u=a[d.provider][d.prefix];u.length&&Ri(d,u)}),t?Ii(t,r,i):Gn};function Vi(e,t){const n={...e};for(const r in t){const a=t[r],i=typeof a;r in Os?(a===null||a&&(i==="string"||i==="number"))&&(n[r]=a):i===typeof n[r]&&(n[r]=r==="rotate"?a%4:a)}return n}const Ui=/[\s,]+/;function Hi(e,t){t.split(Ui).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function qi(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(a){for(;a<0;)a+=4;return a%4}if(n===""){const a=parseInt(e);return isNaN(a)?0:r(a)}else if(n!==e){let a=0;switch(n){case"%":a=25;break;case"deg":a=90}if(a){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i=i/a,i%1===0?r(i):0)}}return t}function Wi(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Yi(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Gi(e){return"data:image/svg+xml,"+Yi(e)}function Ki(e){return'url("'+Gi(e)+'")'}let at;function Qi(){try{at=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{at=null}}function Zi(e){return at===void 0&&Qi(),at?at.createHTML(e):e}const Rs={...Ps,inline:!1},Xi={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ji={display:"inline-block"},en={backgroundColor:"currentColor"},Bs={backgroundColor:"transparent"},Qn={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Zn={WebkitMask:en,mask:en,background:Bs};for(const e in Zn){const t=Zn[e];for(const n in Qn)t[e+n]=Qn[n]}const el={...Rs,inline:!0};function Xn(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const tl=(e,t,n)=>{const r=t.inline?el:Rs,a=Vi(r,t),i=t.mode||"svg",o={},l=t.style||{},d={...i==="svg"?Xi:{}};if(n){const g=kt(n,!1,!0);if(g){const w=["iconify"],N=["provider","prefix"];for(const S of N)g[S]&&w.push("iconify--"+g[S]);d.className=w.join(" ")}}for(let g in t){const w=t[g];if(w!==void 0)switch(g){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":d.ref=w;break;case"className":d[g]=(d[g]?d[g]+" ":"")+w;break;case"inline":case"hFlip":case"vFlip":a[g]=w===!0||w==="true"||w===1;break;case"flip":typeof w=="string"&&Hi(a,w);break;case"color":o.color=w;break;case"rotate":typeof w=="string"?a[g]=qi(w):typeof w=="number"&&(a[g]=w);break;case"ariaHidden":case"aria-hidden":w!==!0&&w!=="true"&&delete d["aria-hidden"];break;default:r[g]===void 0&&(d[g]=w)}}const u=xi(e,a),f=u.attributes;if(a.inline&&(o.verticalAlign="-0.125em"),i==="svg"){d.style={...o,...l},Object.assign(d,f);let g=0,w=t.id;return typeof w=="string"&&(w=w.replace(/-/g,"_")),d.dangerouslySetInnerHTML={__html:Zi(yi(u.body,w?()=>w+"ID"+g++:"iconifyReact"))},p.createElement("svg",d)}const{body:h,width:b,height:m}=e,j=i==="mask"||(i==="bg"?!1:h.indexOf("currentColor")!==-1),k=Wi(h,{...f,width:b+"",height:m+""});return d.style={...o,"--svg":Ki(k),width:Xn(f.width),height:Xn(f.height),...Ji,...j?en:Bs,...l},p.createElement("span",d)};Ls(!0);vi("",Di);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!oi(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const a=t[n];if(typeof a!="object"||!a||a.resources===void 0)continue;ji(n,a)||console.error(r)}catch{console.error(r)}}}}function Vs(e){const[t,n]=p.useState(!!e.ssr),[r,a]=p.useState({});function i(m){if(m){const j=e.icon;if(typeof j=="object")return{name:"",data:j};const k=Hn(j);if(k)return{name:j,data:k}}return{name:""}}const[o,l]=p.useState(i(!!e.ssr));function d(){const m=r.callback;m&&(m(),a({}))}function u(m){if(JSON.stringify(o)!==JSON.stringify(m))return d(),l(m),!0}function f(){var m;const j=e.icon;if(typeof j=="object"){u({name:"",data:j});return}const k=Hn(j);if(u({name:j,data:k}))if(k===void 0){const g=Bi([j],f);a({callback:g})}else k&&((m=e.onLoad)===null||m===void 0||m.call(e,j))}p.useEffect(()=>(n(!0),d),[]),p.useEffect(()=>{t&&f()},[e.icon,t]);const{name:h,data:b}=o;return b?tl({...fn,...b},e,h):e.children?e.children:e.fallback?e.fallback:p.createElement("span",{})}const V=p.forwardRef((e,t)=>Vs({...e,_ref:t}));p.forwardRef((e,t)=>Vs({inline:!0,...e,_ref:t}));const H=p.forwardRef(({color:e="primary",radius:t="full",testId:n="veevart-button",...r},a)=>s.jsx(c.Button,{ref:a,color:e,radius:t,"data-testid":n,...r}));H.displayName="Button";function Us({code:e,amount:t,onRemove:n,label:r="Gift Card",removeAriaLabel:a="Remove gift card",testId:i="veevart-applied-code-card"}){return s.jsx(c.Card,{"data-testid":i,shadow:"sm",className:"w-full",children:s.jsxs(c.CardBody,{className:"flex flex-row items-start justify-between gap-2 p-4",children:[s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx("span",{className:"text-xs text-default-500",children:r}),s.jsx("span",{"data-testid":`${i}-code`,className:"truncate font-medium text-foreground",children:e}),s.jsx("span",{"data-testid":`${i}-amount`,className:"text-lg font-semibold text-primary",children:t})]}),s.jsx(H,{testId:`${i}-remove`,isIconOnly:!0,size:"sm",variant:"light","aria-label":a,onPress:n,children:s.jsx(V,{icon:"solar:close-circle-linear",className:"size-4","aria-hidden":"true"})})]})})}function Lt(e,t){return e-t*Math.floor(e/t)}const Hs=1721426;function mt(e,t,n,r){t=pn(e,t);let a=t-1,i=-2;return n<=2?i=0:gt(t)&&(i=-1),Hs-1+365*a+Math.floor(a/4)-Math.floor(a/100)+Math.floor(a/400)+Math.floor((367*n-362)/12+i+r)}function gt(e){return e%4===0&&(e%100!==0||e%400===0)}function pn(e,t){return e==="BC"?1-t:t}function nl(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const sl={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class St{fromJulianDay(t){let n=t,r=n-Hs,a=Math.floor(r/146097),i=Lt(r,146097),o=Math.floor(i/36524),l=Lt(i,36524),d=Math.floor(l/1461),u=Lt(l,1461),f=Math.floor(u/365),h=a*400+o*100+d*4+f+(o!==4&&f!==4?1:0),[b,m]=nl(h),j=n-mt(b,m,1,1),k=2;n<mt(b,m,3,1)?k=0:gt(m)&&(k=1);let g=Math.floor(((j+k)*12+373)/367),w=n-mt(b,m,g,1)+1;return new ct(b,m,g,w)}toJulianDay(t){return mt(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return sl[gt(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return gt(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}function rl(e,t){var n,r,a,i;return(i=(a=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&a!==void 0?a:(r=t.isEqual)===null||r===void 0?void 0:r.call(t,e))!==null&&i!==void 0?i:e.identifier===t.identifier}function qs(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function Ws(e,t){return Jn(e)-Jn(t)}function Jn(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Ot=null;function Ys(){return Ot==null&&(Ot=new Intl.DateTimeFormat().resolvedOptions().timeZone),Ot}function es(e){e=gn(e,new St);let t=pn(e.era,e.year);return Gs(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Gs(e,t,n,r,a,i,o){let l=new Date;return l.setUTCHours(r,a,i,o),l.setUTCFullYear(e,t-1,n),l.getTime()}function ts(e,t){if(t==="UTC")return 0;if(e>0&&t===Ys())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:a,hour:i,minute:o,second:l}=Ks(e,t);return Gs(n,r,a,i,o,l,0)-Math.floor(e/1e3)*1e3}const ns=new Map;function Ks(e,t){let n=ns.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),ns.set(t,n));let r=n.formatToParts(new Date(e)),a={};for(let i of r)i.type!=="literal"&&(a[i.type]=i.value);return{year:a.era==="BC"||a.era==="B"?-a.year+1:+a.year,month:+a.month,day:+a.day,hour:a.hour==="24"?0:+a.hour,minute:+a.minute,second:+a.second}}const ss=864e5;function al(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>il(e,t,i))}function il(e,t,n){let r=Ks(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function ll(e,t,n="compatible"){let r=Zs(e);if(t==="UTC")return es(r);if(t===Ys()&&n==="compatible"){r=gn(r,new St);let d=new Date,u=pn(r.era,r.year);return d.setFullYear(u,r.month-1,r.day),d.setHours(r.hour,r.minute,r.second,r.millisecond),d.getTime()}let a=es(r),i=ts(a-ss,t),o=ts(a+ss,t),l=al(r,t,a-i,a-o);if(l.length===1)return l[0];if(l.length>1)switch(n){case"compatible":case"earlier":return l[0];case"later":return l[l.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(a-i,a-o);case"compatible":case"later":return Math.max(a-i,a-o);case"reject":throw new RangeError("No such absolute time found")}}function Qs(e,t,n="compatible"){return new Date(ll(e,t,n))}function Zs(e,t){let n=0,r=0,a=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:a,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:a,millisecond:i}=t),new yt(e.calendar,e.era,e.year,e.month,e.day,n,r,a,i)}function gn(e,t){if(rl(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Xe(r),r}function bn(e,t){let n=e.copy(),r="hour"in n?rr(n,t):0;tn(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,nn(n),Xs(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,ol(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let a=n.calendar.getYearsInEra(n);if(n.year>a){var i,o;let d=(i=(o=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(o,n);n.year=a,n.month=d?1:n.calendar.getMonthsInYear(n),n.day=d?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let l=n.calendar.getMonthsInYear(n);return n.month>l&&(n.month=l,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function tn(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function nn(e){for(;e.month<1;)tn(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,tn(e,1)}function ol(e){for(;e.day<1;)e.month--,nn(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,nn(e)}function Xs(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Xe(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Xs(e)}function Js(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function er(e,t){return bn(e,Js(t))}function tr(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),Xe(n),n}function nr(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),sr(n),n}function cl(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=ht(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=ht(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=ht(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=ht(e.hour,24),t}function sr(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function ht(e,t){let n=e%t;return n<0&&(n+=t),n}function rr(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,cl(e)}function ar(e,t){let n=e.copy();return rr(n,t),n}function dl(e,t){return ar(e,Js(t))}function ir(e,t,n,r){let a=e.copy();switch(t){case"era":{let l=e.calendar.getEras(),d=l.indexOf(e.era);if(d<0)throw new Error("Invalid era: "+e.era);d=Pe(d,n,0,l.length-1,r?.round),a.era=l[d],Xe(a);break}case"year":var i,o;!((i=(o=a.calendar).isInverseEra)===null||i===void 0)&&i.call(o,a)&&(n=-n),a.year=Pe(e.year,n,-1/0,9999,r?.round),a.year===-1/0&&(a.year=1),a.calendar.balanceYearMonth&&a.calendar.balanceYearMonth(a,e);break;case"month":a.month=Pe(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":a.day=Pe(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(a),Xe(a),a}function lr(e,t,n,r){let a=e.copy();switch(t){case"hour":{let i=e.hour,o=0,l=23;if(r?.hourCycle===12){let d=i>=12;o=d?12:0,l=d?23:11}a.hour=Pe(i,n,o,l,r?.round);break}case"minute":a.minute=Pe(e.minute,n,0,59,r?.round);break;case"second":a.second=Pe(e.second,n,0,59,r?.round);break;case"millisecond":a.millisecond=Pe(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return a}function Pe(e,t,n,r,a=!1){if(a){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}const ul=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,fl=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function ml(e){let t=e.match(ul);if(!t)throw fl.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let n=new ct(Pt(t[1],0,9999),Pt(t[2],1,12),1);return n.day=Pt(t[3],1,n.calendar.getDaysInMonth(n)),n}function Pt(e,t,n){let r=Number(e);if(r<t||r>n)throw new RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);return r}function or(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function cr(e){let t=gn(e,new St),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function hl(e){return`${cr(e)}T${or(e)}`}function xl(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yn(e,t,n){xl(e,t),t.set(e,n)}function dr(e){let t=typeof e[0]=="object"?e.shift():new St,n;if(typeof e[0]=="string")n=e.shift();else{let o=t.getEras();n=o[o.length-1]}let r=e.shift(),a=e.shift(),i=e.shift();return[t,n,r,a,i]}var pl=new WeakMap;class ct{copy(){return this.era?new ct(this.calendar,this.era,this.year,this.month,this.day):new ct(this.calendar,this.year,this.month,this.day)}add(t){return bn(this,t)}subtract(t){return er(this,t)}set(t){return tr(this,t)}cycle(t,n,r){return ir(this,t,n,r)}toDate(t){return Qs(this,t)}toString(){return cr(this)}compare(t){return qs(this,t)}constructor(...t){yn(this,pl,{writable:!0,value:void 0});let[n,r,a,i,o]=dr(t);this.calendar=n,this.era=r,this.year=a,this.month=i,this.day=o,Xe(this)}}var gl=new WeakMap;class At{copy(){return new At(this.hour,this.minute,this.second,this.millisecond)}add(t){return ar(this,t)}subtract(t){return dl(this,t)}set(t){return nr(this,t)}cycle(t,n,r){return lr(this,t,n,r)}toString(){return or(this)}compare(t){return Ws(this,t)}constructor(t=0,n=0,r=0,a=0){yn(this,gl,{writable:!0,value:void 0}),this.hour=t,this.minute=n,this.second=r,this.millisecond=a,sr(this)}}var bl=new WeakMap;class yt{copy(){return this.era?new yt(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new yt(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return bn(this,t)}subtract(t){return er(this,t)}set(t){return tr(nr(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return ir(this,t,n,r);default:return lr(this,t,n,r)}}toDate(t,n){return Qs(this,t,n)}toString(){return hl(this)}compare(t){let n=qs(this,t);return n===0?Ws(this,Zs(t)):n}constructor(...t){yn(this,bl,{writable:!0,value:void 0});let[n,r,a,i,o]=dr(t);this.calendar=n,this.era=r,this.year=a,this.month=i,this.day=o,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Xe(this)}}const yl="Open time options",vl=320;function rs(e,t){return typeof t=="string"&&t.length>0?`${e} ${t}`:e}function _t(e){if(!e)return null;const t="hour"in e&&typeof e.hour=="number"?e.hour:0,n="minute"in e&&typeof e.minute=="number"?e.minute:0,r="second"in e&&typeof e.second=="number"?e.second:0;return new At(t,n,r)}function jl(e,t){const n=new Date(2e3,0,1,e.hour,e.minute,e.second);return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:t===12}).format(n)}function wl(e){const t=[];for(let n=0;n<24;n+=1)for(let r=0;r<60;r+=e)t.push(new At(n,r));return t}function Nl(e){const{minuteStep:t=15,timeListClassName:n,timeListLabel:r=yl,selectorButtonProps:a,endContent:i,onChange:o,value:l,defaultValue:d,hourCycle:u=12,...f}=e,h=l!==void 0,[b,m]=p.useState(()=>_t(d)),j=h?_t(l):b,k=p.useMemo(()=>wl(t),[t]),g=N=>{h||m(N),o?.(N)},w=s.jsxs(c.Popover,{placement:"bottom-end",children:[s.jsx(c.PopoverTrigger,{children:s.jsx(c.Button,{isIconOnly:!0,variant:"light","aria-label":r,...a,onPress:void 0,children:s.jsx(K.Clock3,{className:"size-4",strokeWidth:1.75})})}),s.jsx(c.PopoverContent,{className:"min-w-[8.5rem] p-0",children:s.jsx(c.ScrollShadow,{className:n??"max-h-64 py-1",children:s.jsx("div",{className:"flex flex-col p-1",children:k.map(N=>{const S=j?.hour===N.hour&&j?.minute===N.minute;return s.jsx(c.Button,{variant:S?"flat":"light",color:S?"primary":"default",className:"h-9 min-w-0 justify-start px-3",onPress:()=>g(N),children:jl(N,u)},`${N.hour}:${N.minute}`)})})})})]});return s.jsx(c.TimeInput,{...f,value:h?j:void 0,defaultValue:h?void 0:d,hourCycle:u,endContent:s.jsxs("div",{className:"flex items-center gap-1",children:[i,w]}),onChange:N=>g(_t(N))})}function vn(e){if(e.mode==="time")return s.jsx(Nl,{...e});if(e.mode==="datetime"){const{mode:a,granularity:i="minute",hideTimeZone:o=!0,calendarWidth:l=vl,disableAnimation:d=!0,classNames:u,...f}=e;return s.jsx(c.DatePicker,{...f,calendarWidth:l,classNames:{...u,popoverContent:rs("min-w-[20rem]",u?.popoverContent),calendarContent:rs("min-h-[18rem]",u?.calendarContent)},disableAnimation:d,granularity:i,hideTimeZone:o})}const{mode:t,granularity:n="day",...r}=e;return s.jsx(c.DatePicker,{...r,granularity:n})}function Cl(e){const t=e?.closest('[role="dialog"]');return t?.parentElement??t??void 0}const _e=p.forwardRef(({popoverProps:e,...t},n)=>{const r=p.useRef(null),[a,i]=p.useState(void 0),o={...e,disableDialogFocus:e?.disableDialogFocus??(a?!0:void 0),portalContainer:e?.portalContainer??a};return p.useEffect(()=>{i(Cl(r.current))},[]),s.jsx("span",{ref:r,className:"contents",children:s.jsx(c.Select,{ref:n,...t,popoverProps:o})})});_e.displayName="Select";function kl({state:e,onSubmit:t,onRemove:n,appliedCredit:r,errorMessage:a,label:i="Gift Card",placeholder:o="GC-XXXX-XXXX-XXXX",applyLabel:l="Apply",removeAriaLabel:d="Remove gift card",testId:u="veevart-redeem-code-input"}){const[f,h]=p.useState(""),[b,m]=p.useState(e);e!==b&&(m(e),e==="applied"&&h(""));const j=()=>{const g=f.trim();g&&t(g)},k=g=>{g.key==="Enter"&&(g.preventDefault(),j())};return e==="applied"&&r?s.jsx("div",{"data-testid":u,children:s.jsx(Us,{code:r.code,amount:r.amount,onRemove:n,removeAriaLabel:d,testId:`${u}-card`})}):s.jsxs("div",{"data-testid":u,className:"flex items-end gap-2",children:[s.jsx(c.Input,{"data-testid":`${u}-input`,label:i,placeholder:o,value:f,onValueChange:h,onKeyDown:k,isDisabled:e==="loading",isInvalid:e==="error",errorMessage:e==="error"?a:void 0}),s.jsx(H,{testId:`${u}-button`,isLoading:e==="loading",isDisabled:!f.trim(),onPress:j,children:l})]})}const Sl={login:"Login",logout:"Logout",selectLanguage:"Select your language"};function Al({languages:e,selectedLanguage:t,onLanguageChange:n,label:r}){const a=e.find(i=>i.code===t);return s.jsx("div",{className:"flex items-center",children:s.jsxs("div",{className:"relative flex items-center",children:[s.jsx(_e,{"data-testid":"language-select-desktop",variant:"bordered","aria-label":r,selectedKeys:t?[t]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||t;n?.(o)},className:"min-w-36 hidden md:inline-flex",isDisabled:e.length===0,placeholder:r,startContent:s.jsx(K.Globe,{className:"w-5 h-5 text-black"}),renderValue:()=>s.jsx("span",{children:a?.label||r}),size:"md",radius:"full",children:e.map(i=>s.jsx(c.SelectItem,{textValue:i.label,"data-testid":`language-select-option-${i.code}`,children:i.label},i.code))}),s.jsx(_e,{"aria-label":r,"data-testid":"language-select-mobile",variant:"bordered",selectedKeys:t?[t]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||t;n?.(o)},className:"w-24 inline-flex md:hidden",isDisabled:e.length===0,placeholder:"",startContent:s.jsx(K.Globe,{className:"w-6 h-6 text-black"}),renderValue:()=>s.jsx("span",{children:a?.code.toUpperCase()||""}),size:"md",radius:"full",children:e.map(i=>s.jsx(c.SelectItem,{textValue:i.code.toUpperCase(),"data-testid":`language-select-option-mobile-${i.code}`,children:i.code.toUpperCase()},i.code))})]})})}function Dl({isLoggedIn:e,onLogin:t,onLogout:n,labels:r}){return e?s.jsxs(H,{"data-testid":"navbar-auth-button",className:"px-2 py-1 w-1 min-w-12 md:min-w-24 rounded-full bg-black text-white text-sm flex items-center",onPress:n,size:"md",children:[s.jsx(K.User,{className:"inline w-5 h-5"}),s.jsx("span",{className:"hidden md:inline",children:r.logout})]}):s.jsxs(H,{"data-testid":"navbar-auth-button",className:"px-2 py-1 min-w-12 md:min-w-24 rounded-full bg-black text-white text-sm flex items-center",onPress:t,size:"md",children:[s.jsx(K.User,{className:"inline w-5 h-5"}),s.jsx("span",{className:"hidden md:inline",children:r.login})]})}function $l({logo:e,languages:t=[],selectedLanguage:n,onLanguageChange:r,isLoggedIn:a,onLogin:i,onLogout:o,hasLanguages:l,hasAuth:d,labels:u={},className:f}){const h={...Sl,...u};return s.jsxs("nav",{"data-testid":"navbar",className:c.cn("w-full px-4 md:px-8 py-3 bg-white border-b border-zinc-100 flex items-center justify-between",f),children:[s.jsx("div",{className:"flex items-center min-w-10",children:e&&s.jsx("a",{href:"/",className:"block",children:s.jsx("img",{"data-testid":"navbar-logo",src:e,alt:"Logo",className:"h-8 w-auto max-w-28 md:max-w-40 object-contain"})})}),s.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[(l||t.length>0)&&s.jsx(Al,{languages:t,selectedLanguage:n,onLanguageChange:r,label:h.selectLanguage}),d&&s.jsx(Dl,{isLoggedIn:a,onLogin:i,onLogout:o,labels:h})]})]})}function El(e){return s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:s.jsx(c.Alert,{description:"This template combines Navbar, Footer, and a confirmation Card. Include title, message, confirmation number, details list, icon, and action buttons. Use Card for the confirmation content.",title:"TODO: Implement ConfirmationPageTemplate",variant:"faded",className:"max-w-2xl"})})})}var zt;const Il=typeof document<"u"?(zt=p.useInsertionEffect)!==null&&zt!==void 0?zt:p.useLayoutEffect:()=>{};function jn(e,t,n){let[r,a]=p.useState(e||t),i=p.useRef(r),o=p.useRef(e!==void 0),l=e!==void 0;p.useEffect(()=>{let h=o.current;h!==l&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),o.current=l},[l]);let d=l?e:r;Il(()=>{i.current=d});let[,u]=p.useReducer(()=>({}),{}),f=p.useCallback((h,...b)=>{let m=typeof h=="function"?h(i.current):h;Object.is(i.current,m)||(i.current=m,a(m),u(),n?.(m,...b))},[n]);return[d,f]}function Fl(e){return s.jsx("svg",{...e,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:s.jsx(ke.m.path,{animate:{pathLength:1},d:"M5 13l4 4L19 7",initial:{pathLength:0},strokeLinecap:"round",strokeLinejoin:"round",transition:{delay:.2,type:"tween",ease:"easeOut",duration:.3}})})}const ur=p.forwardRef(({color:e="primary",variant:t="default",stepsCount:n=3,defaultStep:r=0,label:a,stepLabels:i,showStepLabelTooltip:o=!1,stepLabelTooltipPlacement:l="top",showStepCounter:d=!1,stepCounterPosition:u="right",layout:f="compact",stepCounterFormat:h,onStepChange:b,currentStep:m,hideProgressBars:j=!1,stepClassName:k,className:g,isDisabled:w=!1,...N},S)=>{const[y,v]=jn(m,r,b),E=p.useMemo(()=>{let F,T;const A=["[--active-fg-color:hsl(var(--step-fg-color))]","[--active-border-color:hsl(var(--step-color))]","[--active-color:hsl(var(--step-color))]","[--complete-background-color:hsl(var(--step-color))]","[--complete-border-color:hsl(var(--step-color))]","[--inactive-border-color:hsl(var(--heroui-default-300))]","[--inactive-color:hsl(var(--heroui-default-300))]"];switch(e){case"primary":F="[--step-color:var(--heroui-primary)]",T="[--step-fg-color:var(--heroui-primary-foreground)]";break;case"secondary":F="[--step-color:var(--heroui-secondary)]",T="[--step-fg-color:var(--heroui-secondary-foreground)]";break;case"success":F="[--step-color:var(--heroui-success)]",T="[--step-fg-color:var(--heroui-success-foreground)]";break;case"warning":F="[--step-color:var(--heroui-warning)]",T="[--step-fg-color:var(--heroui-warning-foreground)]";break;case"danger":F="[--step-color:var(--heroui-danger)]",T="[--step-fg-color:var(--heroui-danger-foreground)]";break;case"default":F="[--step-color:var(--heroui-default)]",T="[--step-fg-color:var(--heroui-default-foreground)]";break;default:F="[--step-color:var(--heroui-primary)]",T="[--step-fg-color:var(--heroui-primary-foreground)]";break}return A.unshift(T),A.unshift(F),A},[e]);return s.jsxs("nav",{ref:S,"aria-label":"Progress",className:c.cn("flex items-center overflow-x-auto",f==="spread"?"w-full justify-between gap-6":"max-w-fit gap-3",g),"data-testid":"stepper-root",...N,children:[d&&u==="left"?s.jsx("span",{className:"text-default-500 text-2xl whitespace-nowrap","data-testid":"stepper-counter",children:h?h(y+1,n):`Step ${y+1} of ${n}`}):null,a&&s.jsx("label",{className:"text-small text-default-foreground lg:text-medium font-light whitespace-nowrap me-3","data-testid":"stepper-label",children:a}),s.jsx("ol",{className:c.cn("flex flex-row flex-nowrap gap-x-3",E,g),"data-testid":"stepper-list",children:Array.from({length:n})?.map((F,T)=>{const A=y===T?"active":y<T?"inactive":"complete",_=t==="activeLabel"&&A==="active"&&!!i?.[T],I=o&&A!=="active"&&!!i?.[T];return s.jsxs("li",{className:"relative flex shrink-0 items-center gap-x-3","data-testid":`stepper-step-${T}`,children:[s.jsx(c.Tooltip,{content:I?i?.[T]:void 0,isDisabled:!I,offset:12,placement:l,classNames:{base:"px-0 py-0",content:"rounded-full border border-default-200 bg-white px-4 py-2 text-small font-medium text-default-700 shadow-sm"},children:s.jsxs("button",{"aria-current":A==="active"?"step":void 0,className:c.cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5",{"rounded-full border border-(--active-border-color)/20 bg-(--active-border-color)/10 pl-2 pr-4 py-1.5":_},{"cursor-not-allowed opacity-50":w},k),onClick:()=>!w&&v(T),disabled:w,"data-testid":`stepper-step-btn-${T}`,children:[s.jsx("div",{className:"h-full relative flex items-center",children:s.jsx(ke.LazyMotion,{features:ke.domAnimation,children:s.jsx(ke.m.div,{animate:A,className:"relative z-10",children:s.jsx(ke.m.div,{animate:A,className:c.cn("border-medium text-large text-default-foreground relative z-10 flex h-[26px] w-[26px] shrink-0 items-center justify-center rounded-full font-semibold bg-white",{"border-(--complete-border-color) bg-(--complete-background-color) text-(--active-fg-color)":_,"bg-(--complete-background-color)":A==="complete","shadow-lg":A==="complete"}),initial:!1,transition:{duration:.25},variants:{inactive:{backgroundColor:"transparent",borderColor:"var(--inactive-border-color)",color:"var(--inactive-color)"},active:{backgroundColor:"transparent",borderColor:"var(--active-border-color)",color:"var(--active-color)"},complete:{backgroundColor:"var(--complete-background-color)",borderColor:"var(--complete-border-color)",color:"var(--active-fg-color)"}},children:s.jsx("div",{className:"flex items-center justify-center",children:A==="complete"&&t==="default"?s.jsx(Fl,{className:"h-5 w-5 text-(--active-fg-color)","data-testid":`stepper-step-check-${T}`}):s.jsx("span",{children:T+1})})})})})}),_?s.jsx("span",{className:"pr-2 text-2xl leading-none font-medium whitespace-nowrap text-(--active-color)","data-testid":`stepper-step-label-${T}`,children:i[T]}):null]},T)}),T<n-1&&!j&&s.jsx("div",{"aria-hidden":"true",className:"pointer-events-none z-0 w-12 flex-none items-center",style:{"--idx":T},children:s.jsx("div",{className:c.cn("bg-default-200 relative h-0.5 w-full transition-colors duration-300","after:absolute after:block after:h-full after:w-0 after:bg-(--active-border-color) after:transition-[width] after:duration-300 after:content-['']",{"after:w-full":T<y})})})]},T)})}),d&&u==="right"?s.jsx("span",{className:"text-default-500 text-2xl whitespace-nowrap","data-testid":"stepper-counter",children:h?h(y+1,n):`Step ${y+1} of ${n}`}):null]})});ur.displayName="Stepper";function Ml(e){return s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:s.jsx(c.Alert,{description:"This template combines Navbar, Stepper, Footer, and an event details Card. Include event image, category/spots chips, tags, details grid, and action buttons. Use Card, CardHeader, CardBody for content structure.",title:"TODO: Implement EventDetailsTemplate",variant:"faded",className:"max-w-2xl"})})})}function ze(e,t="en-US",n="USD"){try{return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e)}catch{return`${n} ${e.toFixed(2)}`}}function wn(e,t="en-US"){try{const n=new Intl.NumberFormat(t,{style:"currency",currency:e}).resolvedOptions();return typeof n.maximumFractionDigits=="number"?n.maximumFractionDigits:2}catch{return 2}}function fr(e,t,n="en-US"){const r=wn(t,n),a=Math.pow(10,r);return Math.round(e*a)/a}function sn(e,t,n,r){return fr(e-t,n,r)}function Tl(){return s.jsxs("footer",{"data-testid":"footer",className:"fixed left-0 bottom-0 w-full text-left p-4 bg-white font-inter font-light text-base text-zinc-500",children:["Powered by Veevart ® ",new Date().getFullYear()]})}const Ll=e=>{const t=p.useMemo(()=>JSON.stringify({allItems:e.allItems,selected:e.selected}),[e.allItems,e.selected]);return s.jsx(Ol,{...e},t)},Ol=({allItems:e,selected:t,onSelectedChange:n,titleLeft:r,titleRight:a})=>{const[i,o]=p.useState([]),[l,d]=p.useState([]),[u,f]=p.useState(null),[h,b]=p.useState(null),m=p.useMemo(()=>new Set(t),[t]),j=p.useMemo(()=>new Set(e),[e]),k=p.useMemo(()=>e.filter(I=>!m.has(I)),[e,m]),g=I=>{if(I.length===0)return;const D=Array.from(new Set([...t,...I]));n(D)},w=I=>{if(I.length===0)return;const D=new Set(I);n(t.filter(M=>!D.has(M)))},N=()=>{i.length!==0&&(g(i),o([]))},S=()=>{l.length!==0&&(w(l),d([]))},y=()=>{k.length!==0&&(g(k),o([]))},v=()=>{t.length!==0&&(n([]),d([]))},E=(I,D,M)=>{const O=Math.min(D,M),Q=Math.max(D,M);return I.slice(O,Q+1)},F=(I,D,M)=>{if(M&&u!==null){o(E(k,u,D)),d([]),f(D);return}const O=i.includes(I);o(O?i.filter(Q=>Q!==I):[...i,I]),d([]),f(D)},T=(I,D,M)=>{if(M&&h!==null){d(E(t,h,D)),o([]),b(D);return}const O=l.includes(I);d(O?l.filter(Q=>Q!==I):[...l,I]),o([]),b(D)},A=(I,D,M)=>{const O=M==="available"?i.includes(D)?i:[D]:l.includes(D)?l:[D];I.dataTransfer.setData("text/plain",JSON.stringify({source:M,items:O})),I.dataTransfer.effectAllowed="move"},_=(I,D)=>{I.preventDefault();const M=I.dataTransfer.getData("text/plain");if(M)try{const O=JSON.parse(M),Q=(O.items||[]).filter(W=>j.has(W));if(Q.length===0||O.source===D)return;D==="selected"?(g(Q),o([])):(w(Q),d([]))}catch{return}};return s.jsxs("div",{className:"flex flex-col gap-6 md:flex-row md:items-start md:justify-between",children:[s.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[s.jsx("h2",{className:"text-sm font-medium text-gray-700",children:r}),s.jsx(c.Card,{className:"w-full border border-gray-200 shadow-none",children:s.jsx(c.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:I=>I.preventDefault(),onDrop:I=>_(I,"available"),children:k.map((I,D)=>{const M=i.includes(I);return s.jsx("button",{type:"button",onClick:O=>{F(I,D,O.shiftKey)},onMouseDown:O=>{O.shiftKey&&O.preventDefault()},draggable:!0,onDragStart:O=>A(O,I,"available"),className:`rounded-md px-3 py-2 text-left text-sm transition ${M?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:I},I)})})})]}),s.jsxs("div",{className:"flex flex-row items-center justify-center gap-3 md:flex-col md:pt-6",children:[s.jsx(H,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-selected-to-available",onPress:N,isDisabled:i.length===0,"aria-label":"Move selected to right",children:"›"}),s.jsx(H,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-selected-to-available",onPress:S,isDisabled:l.length===0,"aria-label":"Move selected to left",children:"‹"}),s.jsx(H,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-all-to-selected",onPress:y,isDisabled:k.length===0,"aria-label":"Move all to right",children:"»"}),s.jsx(H,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,onPress:v,"data-testid":"move-all-to-available",isDisabled:t.length===0,"aria-label":"Move all to left",children:"«"})]}),s.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[s.jsx("h2",{className:"text-sm font-medium text-gray-700",children:a}),s.jsx(c.Card,{className:"w-full border border-gray-200 shadow-none",children:s.jsx(c.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:I=>I.preventDefault(),onDrop:I=>_(I,"selected"),children:t.map((I,D)=>{const M=l.includes(I);return s.jsx("button",{type:"button",onClick:O=>{T(I,D,O.shiftKey)},onMouseDown:O=>{O.shiftKey&&O.preventDefault()},draggable:!0,onDragStart:O=>A(O,I,"selected"),className:`rounded-md px-3 py-2 text-left text-sm transition ${M?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:I},I)})})})]})]})};function dt(e){return typeof e=="string"?e:e.type}function Ue({className:e}){return s.jsx("div",{className:`flex items-center h-6 ${e||""}`,children:s.jsx(c.Divider,{orientation:"vertical"})})}function He({icon:e,label:t,isActive:n=!1,isDisabled:r=!1,onClick:a,shortcut:i,iconSize:o=16,className:l}){const d=i?`${t} (${i})`:t;return s.jsx(c.Tooltip,{content:d,placement:"top",offset:10,children:s.jsx(H,{size:"sm",radius:"sm",color:n?"primary":"default",variant:n?"solid":"bordered",isIconOnly:!0,isDisabled:r,onPress:a,"aria-label":t,className:l,children:s.jsx(e,{size:o})})})}const Ie={bold:{execute:({editor:e})=>e.chain().focus().toggleBold().run(),canExecute:e=>e.can().chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold"),shortcut:"Mod-b",label:"Bold"},italic:{execute:({editor:e})=>e.chain().focus().toggleItalic().run(),canExecute:e=>e.can().chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic"),shortcut:"Mod-i",label:"Italic"},strike:{execute:({editor:e})=>e.chain().focus().toggleStrike().run(),canExecute:e=>e.can().chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike"),shortcut:"Mod-Shift-x",label:"Strikethrough"},underline:{execute:({editor:e})=>e.chain().focus().toggleUnderline().run(),canExecute:e=>e.can().chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline"),shortcut:"Mod-u",label:"Underline"},code:{execute:({editor:e})=>e.chain().focus().toggleCode().run(),canExecute:e=>e.can().chain().focus().toggleCode().run(),isActive:e=>e.isActive("code"),shortcut:"Mod-e",label:"Inline code"},textColor:{execute:({editor:e,config:t})=>{const n=t?.type==="textColor"?t.color:"";n?e.chain().focus().setColor(n).run():e.chain().focus().unsetColor().run()},canExecute:()=>!0,isActive:e=>e.isActive("textStyle"),label:"Text color"},highlight:{execute:({editor:e,config:t})=>{const n=t?.type==="highlight"?t.color:"";n?e.chain().focus().setHighlight({color:n}).run():e.chain().focus().unsetHighlight().run()},canExecute:()=>!0,isActive:e=>e.isActive("highlight"),label:"Highlight"},link:{execute:({editor:e,config:t})=>{const n=t?.type==="link"?t.href:"";if(n){const r=t?.type==="link"?t.target:void 0,a=t?.type==="link"?t.rel:void 0;e.chain().focus().setLink({href:n,target:r,rel:a}).run()}else e.chain().focus().unsetLink().run()},canExecute:()=>!0,isActive:e=>e.isActive("link"),shortcut:"Mod-k",label:"Link"},paragraph:{execute:({editor:e})=>e.chain().focus().setParagraph().run(),canExecute:e=>e.can().chain().focus().setParagraph().run(),isActive:e=>e.isActive("paragraph"),shortcut:"Mod-Alt-0",label:"Paragraph"},heading:{execute:({editor:e,config:t})=>{const n=t?.type==="heading"?t.level:1;e.chain().focus().toggleHeading({level:n}).run()},canExecute:(e,t)=>{const n=t?.type==="heading"?t.level:1;return e.can().chain().focus().toggleHeading({level:n}).run()},isActive:(e,t)=>t?.type==="heading"?e.isActive("heading",{level:t.level}):e.isActive("heading"),label:"Heading"},bulletList:{execute:({editor:e})=>e.chain().focus().toggleBulletList().run(),canExecute:e=>e.can().chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList"),shortcut:"Mod-Shift-8",label:"Bullet list"},orderedList:{execute:({editor:e})=>e.chain().focus().toggleOrderedList().run(),canExecute:e=>e.can().chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList"),shortcut:"Mod-Shift-7",label:"Numbered list"},taskList:{execute:({editor:e})=>e.chain().focus().toggleTaskList().run(),canExecute:e=>e.can().chain().focus().toggleTaskList().run(),isActive:e=>e.isActive("taskList"),label:"Task list"},codeBlock:{execute:({editor:e})=>e.chain().focus().toggleCodeBlock().run(),canExecute:e=>e.can().chain().focus().toggleCodeBlock().run(),isActive:e=>e.isActive("codeBlock"),shortcut:"Mod-Alt-c",label:"Code block"},blockquote:{execute:({editor:e})=>e.chain().focus().toggleBlockquote().run(),canExecute:e=>e.can().chain().focus().toggleBlockquote().run(),isActive:e=>e.isActive("blockquote"),shortcut:"Mod-Shift-b",label:"Blockquote"},horizontalRule:{execute:({editor:e})=>e.chain().focus().setHorizontalRule().run(),canExecute:e=>e.can().chain().focus().setHorizontalRule().run(),isActive:()=>!1,label:"Horizontal rule"},hardBreak:{execute:({editor:e})=>e.chain().focus().setHardBreak().run(),canExecute:e=>e.can().chain().focus().setHardBreak().run(),isActive:()=>!1,shortcut:"Mod-Enter",label:"Line break"},textAlign:{execute:({editor:e,config:t})=>{const n=t?.type==="textAlign"?t.alignment:"left";e.chain().focus().setTextAlign(n).run()},canExecute:()=>!0,isActive:(e,t)=>t?.type==="textAlign"?e.isActive({textAlign:t.alignment}):!1,label:"Text alignment"},clearMarks:{execute:({editor:e})=>e.chain().focus().unsetAllMarks().run(),canExecute:e=>e.can().chain().focus().unsetAllMarks().run(),isActive:()=>!1,label:"Clear formatting"},clearNodes:{execute:({editor:e})=>e.chain().focus().clearNodes().run(),canExecute:e=>e.can().chain().focus().clearNodes().run(),isActive:()=>!1,label:"Clear nodes"},undo:{execute:({editor:e})=>e.chain().focus().undo().run(),canExecute:e=>e.can().chain().focus().undo().run(),isActive:()=>!1,shortcut:"Mod-z",label:"Undo"},redo:{execute:({editor:e})=>e.chain().focus().redo().run(),canExecute:e=>e.can().chain().focus().redo().run(),isActive:()=>!1,shortcut:"Mod-Shift-z",label:"Redo"}},Pl={1:"Heading 1",2:"Heading 2",3:"Heading 3",4:"Heading 4",5:"Heading 5",6:"Heading 6"};function _l({editor:e,levels:t=[1,2,3,4,5,6],isDisabled:n=!1}){const[,r]=p.useState(0);p.useEffect(()=>{const o=()=>r(l=>l+1);return e.on("selectionUpdate",o),e.on("transaction",o),()=>{e.off("selectionUpdate",o),e.off("transaction",o)}},[e]);const a=t.find(o=>e.isActive("heading",{level:o})),i=o=>{const l=Number(o),d=Ie.heading;d&&d.execute({editor:e,config:{type:"heading",level:l}})};return s.jsxs(c.Dropdown,{placement:"top-start",offset:10,children:[s.jsx(c.DropdownTrigger,{children:s.jsx(H,{size:"sm",radius:"sm",variant:a?"solid":"bordered",color:a?"primary":"default",isDisabled:n,startContent:s.jsx(K.Heading,{size:16}),"aria-label":"Select heading level",children:a?`H${a}`:"H"})}),s.jsx(c.DropdownMenu,{"aria-label":"Heading levels",selectionMode:"single",selectedKeys:a?new Set([String(a)]):new Set,onAction:i,children:t.map(o=>s.jsx(c.DropdownItem,{startContent:e.isActive("heading",{level:o})?s.jsx(K.Check,{size:16}):s.jsx("div",{className:"w-4"}),children:Pl[o]},o))})]})}const Rt={bulletList:{label:"Bullet List",icon:K.List},orderedList:{label:"Numbered List",icon:K.ListOrdered},taskList:{label:"Task List",icon:K.ListTodo}};function zl({editor:e,types:t=["bulletList","orderedList","taskList"],isDisabled:n=!1}){const[,r]=p.useState(0);p.useEffect(()=>{const l=()=>r(d=>d+1);return e.on("selectionUpdate",l),e.on("transaction",l),()=>{e.off("selectionUpdate",l),e.off("transaction",l)}},[e]);const a=t.find(l=>e.isActive(l)),i=a?Rt[a].icon:K.List,o=l=>{const u=Ie[l];u&&u.execute({editor:e})};return s.jsxs(c.Dropdown,{placement:"top-start",offset:10,children:[s.jsx(c.DropdownTrigger,{children:s.jsx(H,{size:"sm",radius:"sm",variant:a?"solid":"bordered",color:a?"primary":"default",isDisabled:n,isIconOnly:!0,"aria-label":"Select list type",children:s.jsx(i,{size:16})})}),s.jsx(c.DropdownMenu,{"aria-label":"List types",selectionMode:"single",selectedKeys:a?new Set([a]):new Set,onAction:o,children:t.map(l=>{const d=Rt[l].icon;return s.jsx(c.DropdownItem,{startContent:s.jsx(d,{size:16}),children:Rt[l].label},l)})})]})}function Rl({colors:e,selectedColor:t,onColorSelect:n,columns:r=4}){return s.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${r}, minmax(0, 1fr))`},children:e.map(a=>{const i=t===a;return s.jsx("button",{type:"button",onClick:()=>n(a),className:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),c=require("@heroui/react"),p=require("react"),K=require("lucide-react"),ke=require("framer-motion"),un=require("@tiptap/react"),Rn=require("@tiptap/core"),$a=require("@tiptap/extension-bold"),Ea=require("@tiptap/extension-italic"),Ia=require("@tiptap/extension-strike"),Fa=require("@tiptap/extension-underline"),Ma=require("@tiptap/extension-code"),Ta=require("@tiptap/extension-color"),La=require("@tiptap/extension-highlight"),Oa=require("@tiptap/extension-link"),Pa=require("@tiptap/extension-text-style"),_a=require("@tiptap/extension-heading"),za=require("@tiptap/extension-paragraph"),Ra=require("@tiptap/extension-bullet-list"),Ba=require("@tiptap/extension-ordered-list"),Va=require("@tiptap/extension-task-list"),Ua=require("@tiptap/extension-task-item"),Ha=require("@tiptap/extension-list-item"),qa=require("@tiptap/extension-code-block"),Wa=require("@tiptap/extension-blockquote"),Ya=require("@tiptap/extension-horizontal-rule"),Ga=require("@tiptap/extension-hard-break"),Bn=require("@tiptap/extension-history"),Ka=require("@tiptap/extension-text-align"),Qa=require("@tiptap/extension-document"),Za=require("@tiptap/extension-text"),Xa=require("@tiptap/extension-dropcursor"),Ja=require("@tiptap/extension-gapcursor");function ei({children:e}){return s.jsx(c.HeroUIProvider,{children:e})}function ti(e,t){const n=e.icons,r=e.aliases||Object.create(null),a=Object.create(null);function i(o){if(n[o])return a[o]=[];if(!(o in a)){a[o]=null;const l=r[o]&&r[o].parent,d=l&&i(l);d&&(a[o]=[l].concat(d))}return a[o]}return Object.keys(n).concat(Object.keys(r)).forEach(i),a}const Es=Object.freeze({left:0,top:0,width:16,height:16}),bt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),fn=Object.freeze({...Es,...bt}),Zt=Object.freeze({...fn,body:"",hidden:!1});function ni(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Vn(e,t){const n=ni(e,t);for(const r in Zt)r in bt?r in e&&!(r in n)&&(n[r]=bt[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function si(e,t,n){const r=e.icons,a=e.aliases||Object.create(null);let i={};function o(l){i=Vn(r[l]||a[l],i)}return o(t),n.forEach(o),Vn(e,i)}function Is(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(a=>{t(a,null),n.push(a)});const r=ti(e);for(const a in r){const i=r[a];i&&(t(a,si(e,a,i)),n.push(a))}return n}const ri={provider:"",aliases:{},not_found:{},...Es};function Mt(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Fs(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Mt(e,ri))return null;const n=t.icons;for(const a in n){const i=n[a];if(!a||typeof i.body!="string"||!Mt(i,Zt))return null}const r=t.aliases||Object.create(null);for(const a in r){const i=r[a],o=i.parent;if(!a||typeof o!="string"||!n[o]&&!r[o]||!Mt(i,Zt))return null}return t}const Un=Object.create(null);function ai(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Ze(e,t){const n=Un[e]||(Un[e]=Object.create(null));return n[t]||(n[t]=ai(e,t))}function Ms(e,t){return Fs(t)?Is(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function ii(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}const Ts=/^[a-z0-9]+(-[a-z0-9]+)*$/,kt=(e,t,n,r="")=>{const a=e.split(":");if(e.slice(0,1)==="@"){if(a.length<2||a.length>3)return null;r=a.shift().slice(1)}if(a.length>3||!a.length)return null;if(a.length>1){const l=a.pop(),d=a.pop(),u={provider:a.length>0?a[0]:r,prefix:d,name:l};return t&&!xt(u)?null:u}const i=a[0],o=i.split("-");if(o.length>1){const l={provider:r,prefix:o.shift(),name:o.join("-")};return t&&!xt(l)?null:l}if(n&&r===""){const l={provider:r,prefix:"",name:i};return t&&!xt(l,n)?null:l}return null},xt=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;let ot=!1;function Ls(e){return typeof e=="boolean"&&(ot=e),ot}function Hn(e){const t=typeof e=="string"?kt(e,!0,ot):e;if(t){const n=Ze(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function li(e,t){const n=kt(e,!0,ot);if(!n)return!1;const r=Ze(n.provider,n.prefix);return t?ii(r,n.name,t):(r.missing.add(n.name),!0)}function oi(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),ot&&!t&&!e.prefix){let a=!1;return Fs(e)&&(e.prefix="",Is(e,(i,o)=>{li(i,o)&&(a=!0)})),a}const n=e.prefix;if(!xt({prefix:n,name:"a"}))return!1;const r=Ze(t,n);return!!Ms(r,e)}const Os=Object.freeze({width:null,height:null}),Ps=Object.freeze({...Os,...bt}),ci=/(-?[0-9.]*[0-9]+[0-9.]*)/g,di=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function qn(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(ci);if(r===null||!r.length)return e;const a=[];let i=r.shift(),o=di.test(i);for(;;){if(o){const l=parseFloat(i);isNaN(l)?a.push(i):a.push(Math.ceil(l*t*n)/n)}else a.push(i);if(i=r.shift(),i===void 0)return a.join("");o=!o}}function ui(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const a=e.indexOf(">",r),i=e.indexOf("</"+t);if(a===-1||i===-1)break;const o=e.indexOf(">",i);if(o===-1)break;n+=e.slice(a+1,i).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function fi(e,t){return e?"<defs>"+e+"</defs>"+t:t}function mi(e,t,n){const r=ui(e);return fi(r.defs,t+r.content+n)}const hi=e=>e==="unset"||e==="undefined"||e==="none";function xi(e,t){const n={...fn,...e},r={...Ps,...t},a={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach(k=>{const g=[],w=k.hFlip,N=k.vFlip;let S=k.rotate;w?N?S+=2:(g.push("translate("+(a.width+a.left).toString()+" "+(0-a.top).toString()+")"),g.push("scale(-1 1)"),a.top=a.left=0):N&&(g.push("translate("+(0-a.left).toString()+" "+(a.height+a.top).toString()+")"),g.push("scale(1 -1)"),a.top=a.left=0);let y;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:y=a.height/2+a.top,g.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:g.unshift("rotate(180 "+(a.width/2+a.left).toString()+" "+(a.height/2+a.top).toString()+")");break;case 3:y=a.width/2+a.left,g.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}S%2===1&&(a.left!==a.top&&(y=a.left,a.left=a.top,a.top=y),a.width!==a.height&&(y=a.width,a.width=a.height,a.height=y)),g.length&&(i=mi(i,'<g transform="'+g.join(" ")+'">',"</g>"))});const o=r.width,l=r.height,d=a.width,u=a.height;let f,h;o===null?(h=l===null?"1em":l==="auto"?u:l,f=qn(h,d/u)):(f=o==="auto"?d:o,h=l===null?qn(f,u/d):l==="auto"?u:l);const b={},m=(k,g)=>{hi(g)||(b[k]=g.toString())};m("width",f),m("height",h);const j=[a.left,a.top,d,u];return b.viewBox=j.join(" "),{attributes:b,viewBox:j,body:i}}const pi=/\sid="(\S+)"/g,gi="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let bi=0;function yi(e,t=gi){const n=[];let r;for(;r=pi.exec(e);)n.push(r[1]);if(!n.length)return e;const a="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(i=>{const o=typeof t=="function"?t(i):t+(bi++).toString(),l=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+o+a+"$3")}),e=e.replace(new RegExp(a,"g"),""),e}const Xt=Object.create(null);function vi(e,t){Xt[e]=t}function Jt(e){return Xt[e]||Xt[""]}function mn(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const hn=Object.create(null),et=["https://api.simplesvg.com","https://api.unisvg.com"],pt=[];for(;et.length>0;)et.length===1||Math.random()>.5?pt.push(et.shift()):pt.push(et.pop());hn[""]=mn({resources:["https://api.iconify.design"].concat(pt)});function ji(e,t){const n=mn(t);return n===null?!1:(hn[e]=n,!0)}function xn(e){return hn[e]}const wi=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Wn=wi();function Ni(e,t){const n=xn(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let a=0;n.resources.forEach(o=>{a=Math.max(a,o.length)});const i=t+".json?icons=";r=n.maxURL-a-n.path.length-i.length}return r}function Ci(e){return e===404}const ki=(e,t,n)=>{const r=[],a=Ni(e,t),i="icons";let o={type:i,provider:e,prefix:t,icons:[]},l=0;return n.forEach((d,u)=>{l+=d.length+1,l>=a&&u>0&&(r.push(o),o={type:i,provider:e,prefix:t,icons:[]},l=d.length),o.icons.push(d)}),r.push(o),r};function Si(e){if(typeof e=="string"){const t=xn(e);if(t)return t.path}return"/"}const Ai=(e,t,n)=>{if(!Wn){n("abort",424);return}let r=Si(t.provider);switch(t.type){case"icons":{const i=t.prefix,l=t.icons.join(","),d=new URLSearchParams({icons:l});r+=i+".json?"+d.toString();break}case"custom":{const i=t.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:n("abort",400);return}let a=503;Wn(e+r).then(i=>{const o=i.status;if(o!==200){setTimeout(()=>{n(Ci(o)?"abort":"next",o)});return}return a=501,i.json()}).then(i=>{if(typeof i!="object"||i===null){setTimeout(()=>{i===404?n("abort",i):n("next",a)});return}setTimeout(()=>{n("success",i)})}).catch(()=>{n("next",a)})},Di={prepare:ki,send:Ai};function _s(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(a=>a.id!==t))})}function $i(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,a=e.prefix;t.forEach(i=>{const o=i.icons,l=o.pending.length;o.pending=o.pending.filter(d=>{if(d.prefix!==a)return!0;const u=d.name;if(e.icons[u])o.loaded.push({provider:r,prefix:a,name:u});else if(e.missing.has(u))o.missing.push({provider:r,prefix:a,name:u});else return n=!0,!0;return!1}),o.pending.length!==l&&(n||_s([e],i.id),i.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),i.abort))})}))}let Ei=0;function Ii(e,t,n){const r=Ei++,a=_s.bind(null,n,r);if(!t.pending.length)return a;const i={id:r,icons:t,callback:e,abort:a};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(i)}),a}function Fi(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((a,i)=>a.provider!==i.provider?a.provider.localeCompare(i.provider):a.prefix!==i.prefix?a.prefix.localeCompare(i.prefix):a.name.localeCompare(i.name));let r={provider:"",prefix:"",name:""};return e.forEach(a=>{if(r.name===a.name&&r.prefix===a.prefix&&r.provider===a.provider)return;r=a;const i=a.provider,o=a.prefix,l=a.name,d=n[i]||(n[i]=Object.create(null)),u=d[o]||(d[o]=Ze(i,o));let f;l in u.icons?f=t.loaded:o===""||u.missing.has(l)?f=t.missing:f=t.pending;const h={provider:i,prefix:o,name:l};f.push(h)}),t}function Mi(e,t=!0,n=!1){const r=[];return e.forEach(a=>{const i=typeof a=="string"?kt(a,t,n):a;i&&r.push(i)}),r}const Ti={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Li(e,t,n,r){const a=e.resources.length,i=e.random?Math.floor(Math.random()*a):e.index;let o;if(e.random){let E=e.resources.slice(0);for(o=[];E.length>1;){const F=Math.floor(Math.random()*E.length);o.push(E[F]),E=E.slice(0,F).concat(E.slice(F+1))}o=o.concat(E)}else o=e.resources.slice(i).concat(e.resources.slice(0,i));const l=Date.now();let d="pending",u=0,f,h=null,b=[],m=[];typeof r=="function"&&m.push(r);function j(){h&&(clearTimeout(h),h=null)}function k(){d==="pending"&&(d="aborted"),j(),b.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),b=[]}function g(E,F){F&&(m=[]),typeof E=="function"&&m.push(E)}function w(){return{startTime:l,payload:t,status:d,queriesSent:u,queriesPending:b.length,subscribe:g,abort:k}}function N(){d="failed",m.forEach(E=>{E(void 0,f)})}function S(){b.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),b=[]}function y(E,F,T){const A=F!=="success";switch(b=b.filter(_=>_!==E),d){case"pending":break;case"failed":if(A||!e.dataAfterTimeout)return;break;default:return}if(F==="abort"){f=T,N();return}if(A){f=T,b.length||(o.length?v():N());return}if(j(),S(),!e.random){const _=e.resources.indexOf(E.resource);_!==-1&&_!==e.index&&(e.index=_)}d="completed",m.forEach(_=>{_(T)})}function v(){if(d!=="pending")return;j();const E=o.shift();if(E===void 0){if(b.length){h=setTimeout(()=>{j(),d==="pending"&&(S(),N())},e.timeout);return}N();return}const F={status:"pending",resource:E,callback:(T,A)=>{y(F,T,A)}};b.push(F),u++,h=setTimeout(v,e.rotate),n(E,t,F.callback)}return setTimeout(v),w}function zs(e){const t={...Ti,...e};let n=[];function r(){n=n.filter(l=>l().status==="pending")}function a(l,d,u){const f=Li(t,l,d,(h,b)=>{r(),u&&u(h,b)});return n.push(f),f}function i(l){return n.find(d=>l(d))||null}return{query:a,find:i,setIndex:l=>{t.index=l},getIndex:()=>t.index,cleanup:r}}function Yn(){}const Tt=Object.create(null);function Oi(e){if(!Tt[e]){const t=xn(e);if(!t)return;const n=zs(t),r={config:t,redundancy:n};Tt[e]=r}return Tt[e]}function Pi(e,t,n){let r,a;if(typeof e=="string"){const i=Jt(e);if(!i)return n(void 0,424),Yn;a=i.send;const o=Oi(e);o&&(r=o.redundancy)}else{const i=mn(e);if(i){r=zs(i);const o=e.resources?e.resources[0]:"",l=Jt(o);l&&(a=l.send)}}return!r||!a?(n(void 0,424),Yn):r.query(t,a,n)().abort}function Gn(){}function _i(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,$i(e)}))}function zi(e){const t=[],n=[];return e.forEach(r=>{(r.match(Ts)?t:n).push(r)}),{valid:t,invalid:n}}function tt(e,t,n){function r(){const a=e.pendingIcons;t.forEach(i=>{a&&a.delete(i),e.icons[i]||e.missing.add(i)})}if(n&&typeof n=="object")try{if(!Ms(e,n).length){r();return}}catch(a){console.error(a)}r(),_i(e)}function Kn(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function Ri(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,a=e.iconsToLoad;if(delete e.iconsToLoad,!a||!a.length)return;const i=e.loadIcon;if(e.loadIcons&&(a.length>1||!i)){Kn(e.loadIcons(a,r,n),f=>{tt(e,a,f)});return}if(i){a.forEach(f=>{const h=i(f,r,n);Kn(h,b=>{const m=b?{prefix:r,icons:{[f]:b}}:null;tt(e,[f],m)})});return}const{valid:o,invalid:l}=zi(a);if(l.length&&tt(e,l,null),!o.length)return;const d=r.match(Ts)?Jt(n):null;if(!d){tt(e,o,null);return}d.prepare(n,r,o).forEach(f=>{Pi(n,f,h=>{tt(e,f.icons,h)})})}))}const Bi=(e,t)=>{const n=Mi(e,!0,Ls()),r=Fi(n);if(!r.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(r.loaded,r.missing,r.pending,Gn)}),()=>{d=!1}}const a=Object.create(null),i=[];let o,l;return r.pending.forEach(d=>{const{provider:u,prefix:f}=d;if(f===l&&u===o)return;o=u,l=f,i.push(Ze(u,f));const h=a[u]||(a[u]=Object.create(null));h[f]||(h[f]=[])}),r.pending.forEach(d=>{const{provider:u,prefix:f,name:h}=d,b=Ze(u,f),m=b.pendingIcons||(b.pendingIcons=new Set);m.has(h)||(m.add(h),a[u][f].push(h))}),i.forEach(d=>{const u=a[d.provider][d.prefix];u.length&&Ri(d,u)}),t?Ii(t,r,i):Gn};function Vi(e,t){const n={...e};for(const r in t){const a=t[r],i=typeof a;r in Os?(a===null||a&&(i==="string"||i==="number"))&&(n[r]=a):i===typeof n[r]&&(n[r]=r==="rotate"?a%4:a)}return n}const Ui=/[\s,]+/;function Hi(e,t){t.split(Ui).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function qi(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(a){for(;a<0;)a+=4;return a%4}if(n===""){const a=parseInt(e);return isNaN(a)?0:r(a)}else if(n!==e){let a=0;switch(n){case"%":a=25;break;case"deg":a=90}if(a){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i=i/a,i%1===0?r(i):0)}}return t}function Wi(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Yi(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Gi(e){return"data:image/svg+xml,"+Yi(e)}function Ki(e){return'url("'+Gi(e)+'")'}let at;function Qi(){try{at=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{at=null}}function Zi(e){return at===void 0&&Qi(),at?at.createHTML(e):e}const Rs={...Ps,inline:!1},Xi={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ji={display:"inline-block"},en={backgroundColor:"currentColor"},Bs={backgroundColor:"transparent"},Qn={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Zn={WebkitMask:en,mask:en,background:Bs};for(const e in Zn){const t=Zn[e];for(const n in Qn)t[e+n]=Qn[n]}const el={...Rs,inline:!0};function Xn(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const tl=(e,t,n)=>{const r=t.inline?el:Rs,a=Vi(r,t),i=t.mode||"svg",o={},l=t.style||{},d={...i==="svg"?Xi:{}};if(n){const g=kt(n,!1,!0);if(g){const w=["iconify"],N=["provider","prefix"];for(const S of N)g[S]&&w.push("iconify--"+g[S]);d.className=w.join(" ")}}for(let g in t){const w=t[g];if(w!==void 0)switch(g){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":d.ref=w;break;case"className":d[g]=(d[g]?d[g]+" ":"")+w;break;case"inline":case"hFlip":case"vFlip":a[g]=w===!0||w==="true"||w===1;break;case"flip":typeof w=="string"&&Hi(a,w);break;case"color":o.color=w;break;case"rotate":typeof w=="string"?a[g]=qi(w):typeof w=="number"&&(a[g]=w);break;case"ariaHidden":case"aria-hidden":w!==!0&&w!=="true"&&delete d["aria-hidden"];break;default:r[g]===void 0&&(d[g]=w)}}const u=xi(e,a),f=u.attributes;if(a.inline&&(o.verticalAlign="-0.125em"),i==="svg"){d.style={...o,...l},Object.assign(d,f);let g=0,w=t.id;return typeof w=="string"&&(w=w.replace(/-/g,"_")),d.dangerouslySetInnerHTML={__html:Zi(yi(u.body,w?()=>w+"ID"+g++:"iconifyReact"))},p.createElement("svg",d)}const{body:h,width:b,height:m}=e,j=i==="mask"||(i==="bg"?!1:h.indexOf("currentColor")!==-1),k=Wi(h,{...f,width:b+"",height:m+""});return d.style={...o,"--svg":Ki(k),width:Xn(f.width),height:Xn(f.height),...Ji,...j?en:Bs,...l},p.createElement("span",d)};Ls(!0);vi("",Di);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!oi(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const a=t[n];if(typeof a!="object"||!a||a.resources===void 0)continue;ji(n,a)||console.error(r)}catch{console.error(r)}}}}function Vs(e){const[t,n]=p.useState(!!e.ssr),[r,a]=p.useState({});function i(m){if(m){const j=e.icon;if(typeof j=="object")return{name:"",data:j};const k=Hn(j);if(k)return{name:j,data:k}}return{name:""}}const[o,l]=p.useState(i(!!e.ssr));function d(){const m=r.callback;m&&(m(),a({}))}function u(m){if(JSON.stringify(o)!==JSON.stringify(m))return d(),l(m),!0}function f(){var m;const j=e.icon;if(typeof j=="object"){u({name:"",data:j});return}const k=Hn(j);if(u({name:j,data:k}))if(k===void 0){const g=Bi([j],f);a({callback:g})}else k&&((m=e.onLoad)===null||m===void 0||m.call(e,j))}p.useEffect(()=>(n(!0),d),[]),p.useEffect(()=>{t&&f()},[e.icon,t]);const{name:h,data:b}=o;return b?tl({...fn,...b},e,h):e.children?e.children:e.fallback?e.fallback:p.createElement("span",{})}const V=p.forwardRef((e,t)=>Vs({...e,_ref:t}));p.forwardRef((e,t)=>Vs({inline:!0,...e,_ref:t}));const H=p.forwardRef(({color:e="primary",radius:t="full",testId:n="veevart-button",...r},a)=>s.jsx(c.Button,{ref:a,color:e,radius:t,"data-testid":n,...r}));H.displayName="Button";function Us({code:e,amount:t,onRemove:n,label:r="Gift Card",removeAriaLabel:a="Remove gift card",testId:i="veevart-applied-code-card"}){return s.jsx(c.Card,{"data-testid":i,shadow:"sm",className:"w-full",children:s.jsxs(c.CardBody,{className:"flex flex-row items-start justify-between gap-2 p-4",children:[s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx("span",{className:"text-xs text-default-500",children:r}),s.jsx("span",{"data-testid":`${i}-code`,className:"truncate font-medium text-foreground",children:e}),s.jsx("span",{"data-testid":`${i}-amount`,className:"text-lg font-semibold text-primary",children:t})]}),s.jsx(H,{testId:`${i}-remove`,isIconOnly:!0,size:"sm",variant:"light","aria-label":a,onPress:n,children:s.jsx(V,{icon:"solar:close-circle-linear",className:"size-4","aria-hidden":"true"})})]})})}function Lt(e,t){return e-t*Math.floor(e/t)}const Hs=1721426;function mt(e,t,n,r){t=pn(e,t);let a=t-1,i=-2;return n<=2?i=0:gt(t)&&(i=-1),Hs-1+365*a+Math.floor(a/4)-Math.floor(a/100)+Math.floor(a/400)+Math.floor((367*n-362)/12+i+r)}function gt(e){return e%4===0&&(e%100!==0||e%400===0)}function pn(e,t){return e==="BC"?1-t:t}function nl(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const sl={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class St{fromJulianDay(t){let n=t,r=n-Hs,a=Math.floor(r/146097),i=Lt(r,146097),o=Math.floor(i/36524),l=Lt(i,36524),d=Math.floor(l/1461),u=Lt(l,1461),f=Math.floor(u/365),h=a*400+o*100+d*4+f+(o!==4&&f!==4?1:0),[b,m]=nl(h),j=n-mt(b,m,1,1),k=2;n<mt(b,m,3,1)?k=0:gt(m)&&(k=1);let g=Math.floor(((j+k)*12+373)/367),w=n-mt(b,m,g,1)+1;return new ct(b,m,g,w)}toJulianDay(t){return mt(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return sl[gt(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return gt(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}function rl(e,t){var n,r,a,i;return(i=(a=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&a!==void 0?a:(r=t.isEqual)===null||r===void 0?void 0:r.call(t,e))!==null&&i!==void 0?i:e.identifier===t.identifier}function qs(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function Ws(e,t){return Jn(e)-Jn(t)}function Jn(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Ot=null;function Ys(){return Ot==null&&(Ot=new Intl.DateTimeFormat().resolvedOptions().timeZone),Ot}function es(e){e=gn(e,new St);let t=pn(e.era,e.year);return Gs(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Gs(e,t,n,r,a,i,o){let l=new Date;return l.setUTCHours(r,a,i,o),l.setUTCFullYear(e,t-1,n),l.getTime()}function ts(e,t){if(t==="UTC")return 0;if(e>0&&t===Ys())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:a,hour:i,minute:o,second:l}=Ks(e,t);return Gs(n,r,a,i,o,l,0)-Math.floor(e/1e3)*1e3}const ns=new Map;function Ks(e,t){let n=ns.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),ns.set(t,n));let r=n.formatToParts(new Date(e)),a={};for(let i of r)i.type!=="literal"&&(a[i.type]=i.value);return{year:a.era==="BC"||a.era==="B"?-a.year+1:+a.year,month:+a.month,day:+a.day,hour:a.hour==="24"?0:+a.hour,minute:+a.minute,second:+a.second}}const ss=864e5;function al(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>il(e,t,i))}function il(e,t,n){let r=Ks(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function ll(e,t,n="compatible"){let r=Zs(e);if(t==="UTC")return es(r);if(t===Ys()&&n==="compatible"){r=gn(r,new St);let d=new Date,u=pn(r.era,r.year);return d.setFullYear(u,r.month-1,r.day),d.setHours(r.hour,r.minute,r.second,r.millisecond),d.getTime()}let a=es(r),i=ts(a-ss,t),o=ts(a+ss,t),l=al(r,t,a-i,a-o);if(l.length===1)return l[0];if(l.length>1)switch(n){case"compatible":case"earlier":return l[0];case"later":return l[l.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(a-i,a-o);case"compatible":case"later":return Math.max(a-i,a-o);case"reject":throw new RangeError("No such absolute time found")}}function Qs(e,t,n="compatible"){return new Date(ll(e,t,n))}function Zs(e,t){let n=0,r=0,a=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:a,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:a,millisecond:i}=t),new yt(e.calendar,e.era,e.year,e.month,e.day,n,r,a,i)}function gn(e,t){if(rl(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Xe(r),r}function bn(e,t){let n=e.copy(),r="hour"in n?rr(n,t):0;tn(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,nn(n),Xs(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,ol(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let a=n.calendar.getYearsInEra(n);if(n.year>a){var i,o;let d=(i=(o=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(o,n);n.year=a,n.month=d?1:n.calendar.getMonthsInYear(n),n.day=d?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let l=n.calendar.getMonthsInYear(n);return n.month>l&&(n.month=l,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function tn(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function nn(e){for(;e.month<1;)tn(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,tn(e,1)}function ol(e){for(;e.day<1;)e.month--,nn(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,nn(e)}function Xs(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Xe(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Xs(e)}function Js(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function er(e,t){return bn(e,Js(t))}function tr(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),Xe(n),n}function nr(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),sr(n),n}function cl(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=ht(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=ht(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=ht(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=ht(e.hour,24),t}function sr(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function ht(e,t){let n=e%t;return n<0&&(n+=t),n}function rr(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,cl(e)}function ar(e,t){let n=e.copy();return rr(n,t),n}function dl(e,t){return ar(e,Js(t))}function ir(e,t,n,r){let a=e.copy();switch(t){case"era":{let l=e.calendar.getEras(),d=l.indexOf(e.era);if(d<0)throw new Error("Invalid era: "+e.era);d=Pe(d,n,0,l.length-1,r?.round),a.era=l[d],Xe(a);break}case"year":var i,o;!((i=(o=a.calendar).isInverseEra)===null||i===void 0)&&i.call(o,a)&&(n=-n),a.year=Pe(e.year,n,-1/0,9999,r?.round),a.year===-1/0&&(a.year=1),a.calendar.balanceYearMonth&&a.calendar.balanceYearMonth(a,e);break;case"month":a.month=Pe(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":a.day=Pe(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(a),Xe(a),a}function lr(e,t,n,r){let a=e.copy();switch(t){case"hour":{let i=e.hour,o=0,l=23;if(r?.hourCycle===12){let d=i>=12;o=d?12:0,l=d?23:11}a.hour=Pe(i,n,o,l,r?.round);break}case"minute":a.minute=Pe(e.minute,n,0,59,r?.round);break;case"second":a.second=Pe(e.second,n,0,59,r?.round);break;case"millisecond":a.millisecond=Pe(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return a}function Pe(e,t,n,r,a=!1){if(a){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}const ul=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,fl=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function ml(e){let t=e.match(ul);if(!t)throw fl.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let n=new ct(Pt(t[1],0,9999),Pt(t[2],1,12),1);return n.day=Pt(t[3],1,n.calendar.getDaysInMonth(n)),n}function Pt(e,t,n){let r=Number(e);if(r<t||r>n)throw new RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);return r}function or(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function cr(e){let t=gn(e,new St),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function hl(e){return`${cr(e)}T${or(e)}`}function xl(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yn(e,t,n){xl(e,t),t.set(e,n)}function dr(e){let t=typeof e[0]=="object"?e.shift():new St,n;if(typeof e[0]=="string")n=e.shift();else{let o=t.getEras();n=o[o.length-1]}let r=e.shift(),a=e.shift(),i=e.shift();return[t,n,r,a,i]}var pl=new WeakMap;class ct{copy(){return this.era?new ct(this.calendar,this.era,this.year,this.month,this.day):new ct(this.calendar,this.year,this.month,this.day)}add(t){return bn(this,t)}subtract(t){return er(this,t)}set(t){return tr(this,t)}cycle(t,n,r){return ir(this,t,n,r)}toDate(t){return Qs(this,t)}toString(){return cr(this)}compare(t){return qs(this,t)}constructor(...t){yn(this,pl,{writable:!0,value:void 0});let[n,r,a,i,o]=dr(t);this.calendar=n,this.era=r,this.year=a,this.month=i,this.day=o,Xe(this)}}var gl=new WeakMap;class At{copy(){return new At(this.hour,this.minute,this.second,this.millisecond)}add(t){return ar(this,t)}subtract(t){return dl(this,t)}set(t){return nr(this,t)}cycle(t,n,r){return lr(this,t,n,r)}toString(){return or(this)}compare(t){return Ws(this,t)}constructor(t=0,n=0,r=0,a=0){yn(this,gl,{writable:!0,value:void 0}),this.hour=t,this.minute=n,this.second=r,this.millisecond=a,sr(this)}}var bl=new WeakMap;class yt{copy(){return this.era?new yt(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new yt(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return bn(this,t)}subtract(t){return er(this,t)}set(t){return tr(nr(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return ir(this,t,n,r);default:return lr(this,t,n,r)}}toDate(t,n){return Qs(this,t,n)}toString(){return hl(this)}compare(t){let n=qs(this,t);return n===0?Ws(this,Zs(t)):n}constructor(...t){yn(this,bl,{writable:!0,value:void 0});let[n,r,a,i,o]=dr(t);this.calendar=n,this.era=r,this.year=a,this.month=i,this.day=o,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Xe(this)}}const yl="Open time options",vl=320;function rs(e,t){return typeof t=="string"&&t.length>0?`${e} ${t}`:e}function _t(e){if(!e)return null;const t="hour"in e&&typeof e.hour=="number"?e.hour:0,n="minute"in e&&typeof e.minute=="number"?e.minute:0,r="second"in e&&typeof e.second=="number"?e.second:0;return new At(t,n,r)}function jl(e,t){const n=new Date(2e3,0,1,e.hour,e.minute,e.second);return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:t===12}).format(n)}function wl(e){const t=[];for(let n=0;n<24;n+=1)for(let r=0;r<60;r+=e)t.push(new At(n,r));return t}function Nl(e){const{minuteStep:t=15,timeListClassName:n,timeListLabel:r=yl,selectorButtonProps:a,endContent:i,onChange:o,value:l,defaultValue:d,hourCycle:u=12,...f}=e,h=l!==void 0,[b,m]=p.useState(()=>_t(d)),j=h?_t(l):b,k=p.useMemo(()=>wl(t),[t]),g=N=>{h||m(N),o?.(N)},w=s.jsxs(c.Popover,{placement:"bottom-end",children:[s.jsx(c.PopoverTrigger,{children:s.jsx(c.Button,{isIconOnly:!0,variant:"light","aria-label":r,...a,onPress:void 0,children:s.jsx(K.Clock3,{className:"size-4",strokeWidth:1.75})})}),s.jsx(c.PopoverContent,{className:"min-w-[8.5rem] p-0",children:s.jsx(c.ScrollShadow,{className:n??"max-h-64 py-1",children:s.jsx("div",{className:"flex flex-col p-1",children:k.map(N=>{const S=j?.hour===N.hour&&j?.minute===N.minute;return s.jsx(c.Button,{variant:S?"flat":"light",color:S?"primary":"default",className:"h-9 min-w-0 justify-start px-3",onPress:()=>g(N),children:jl(N,u)},`${N.hour}:${N.minute}`)})})})})]});return s.jsx(c.TimeInput,{...f,value:h?j:void 0,defaultValue:h?void 0:d,hourCycle:u,endContent:s.jsxs("div",{className:"flex items-center gap-1",children:[i,w]}),onChange:N=>g(_t(N))})}function vn(e){if(e.mode==="time")return s.jsx(Nl,{...e});if(e.mode==="datetime"){const{mode:a,granularity:i="minute",hideTimeZone:o=!0,calendarWidth:l=vl,disableAnimation:d=!0,classNames:u,...f}=e;return s.jsx(c.DatePicker,{...f,calendarWidth:l,classNames:{...u,popoverContent:rs("min-w-[20rem]",u?.popoverContent),calendarContent:rs("min-h-[18rem]",u?.calendarContent)},disableAnimation:d,granularity:i,hideTimeZone:o})}const{mode:t,granularity:n="day",...r}=e;return s.jsx(c.DatePicker,{...r,granularity:n})}function Cl(e){const t=e?.closest('[role="dialog"]');return t?.parentElement??t??void 0}const _e=p.forwardRef(({popoverProps:e,...t},n)=>{const r=p.useRef(null),[a,i]=p.useState(void 0),o={...e,disableDialogFocus:e?.disableDialogFocus??(a?!0:void 0),portalContainer:e?.portalContainer??a};return p.useEffect(()=>{i(Cl(r.current))},[]),s.jsx("span",{ref:r,className:"contents",children:s.jsx(c.Select,{ref:n,...t,popoverProps:o})})});_e.displayName="Select";function kl({state:e,onSubmit:t,onRemove:n,appliedCredit:r,errorMessage:a,label:i="Gift Card",placeholder:o="GC-XXXX-XXXX-XXXX",applyLabel:l="Apply",removeAriaLabel:d="Remove gift card",testId:u="veevart-redeem-code-input"}){const[f,h]=p.useState(""),b=p.useId(),[m,j]=p.useState(e);e!==m&&(j(e),e==="applied"&&h(""));const k=()=>{const N=f.trim();N&&t(N)},g=N=>{N.key==="Enter"&&(N.preventDefault(),k())};if(e==="applied"&&r)return s.jsx("div",{"data-testid":u,children:s.jsx(Us,{code:r.code,amount:r.amount,onRemove:n,removeAriaLabel:d,testId:`${u}-card`})});const w=e==="error"&&a!=null;return s.jsxs("div",{"data-testid":u,className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(c.Input,{"data-testid":`${u}-input`,label:i,labelPlacement:"outside",variant:"bordered",radius:"lg",classNames:{label:"text-xs text-default-500 group-data-[filled-within=true]:text-default-500 group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_16px)]",inputWrapper:"border-small"},placeholder:o,value:f,onValueChange:h,onKeyDown:g,isDisabled:e==="loading",isInvalid:e==="error","aria-describedby":w?b:void 0}),s.jsx(H,{testId:`${u}-button`,isLoading:e==="loading",isDisabled:!f.trim(),onPress:k,children:l})]}),w&&s.jsx("p",{id:b,"data-testid":`${u}-error`,className:"text-tiny text-danger",children:a})]})}const Sl={login:"Login",logout:"Logout",selectLanguage:"Select your language"};function Al({languages:e,selectedLanguage:t,onLanguageChange:n,label:r}){const a=e.find(i=>i.code===t);return s.jsx("div",{className:"flex items-center",children:s.jsxs("div",{className:"relative flex items-center",children:[s.jsx(_e,{"data-testid":"language-select-desktop",variant:"bordered","aria-label":r,selectedKeys:t?[t]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||t;n?.(o)},className:"min-w-36 hidden md:inline-flex",isDisabled:e.length===0,placeholder:r,startContent:s.jsx(K.Globe,{className:"w-5 h-5 text-black"}),renderValue:()=>s.jsx("span",{children:a?.label||r}),size:"md",radius:"full",children:e.map(i=>s.jsx(c.SelectItem,{textValue:i.label,"data-testid":`language-select-option-${i.code}`,children:i.label},i.code))}),s.jsx(_e,{"aria-label":r,"data-testid":"language-select-mobile",variant:"bordered",selectedKeys:t?[t]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||t;n?.(o)},className:"w-24 inline-flex md:hidden",isDisabled:e.length===0,placeholder:"",startContent:s.jsx(K.Globe,{className:"w-6 h-6 text-black"}),renderValue:()=>s.jsx("span",{children:a?.code.toUpperCase()||""}),size:"md",radius:"full",children:e.map(i=>s.jsx(c.SelectItem,{textValue:i.code.toUpperCase(),"data-testid":`language-select-option-mobile-${i.code}`,children:i.code.toUpperCase()},i.code))})]})})}function Dl({isLoggedIn:e,onLogin:t,onLogout:n,labels:r}){return e?s.jsxs(H,{"data-testid":"navbar-auth-button",className:"px-2 py-1 w-1 min-w-12 md:min-w-24 rounded-full bg-black text-white text-sm flex items-center",onPress:n,size:"md",children:[s.jsx(K.User,{className:"inline w-5 h-5"}),s.jsx("span",{className:"hidden md:inline",children:r.logout})]}):s.jsxs(H,{"data-testid":"navbar-auth-button",className:"px-2 py-1 min-w-12 md:min-w-24 rounded-full bg-black text-white text-sm flex items-center",onPress:t,size:"md",children:[s.jsx(K.User,{className:"inline w-5 h-5"}),s.jsx("span",{className:"hidden md:inline",children:r.login})]})}function $l({logo:e,languages:t=[],selectedLanguage:n,onLanguageChange:r,isLoggedIn:a,onLogin:i,onLogout:o,hasLanguages:l,hasAuth:d,labels:u={},className:f}){const h={...Sl,...u};return s.jsxs("nav",{"data-testid":"navbar",className:c.cn("w-full px-4 md:px-8 py-3 bg-white border-b border-zinc-100 flex items-center justify-between",f),children:[s.jsx("div",{className:"flex items-center min-w-10",children:e&&s.jsx("a",{href:"/",className:"block",children:s.jsx("img",{"data-testid":"navbar-logo",src:e,alt:"Logo",className:"h-8 w-auto max-w-28 md:max-w-40 object-contain"})})}),s.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[(l||t.length>0)&&s.jsx(Al,{languages:t,selectedLanguage:n,onLanguageChange:r,label:h.selectLanguage}),d&&s.jsx(Dl,{isLoggedIn:a,onLogin:i,onLogout:o,labels:h})]})]})}function El(e){return s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:s.jsx(c.Alert,{description:"This template combines Navbar, Footer, and a confirmation Card. Include title, message, confirmation number, details list, icon, and action buttons. Use Card for the confirmation content.",title:"TODO: Implement ConfirmationPageTemplate",variant:"faded",className:"max-w-2xl"})})})}var zt;const Il=typeof document<"u"?(zt=p.useInsertionEffect)!==null&&zt!==void 0?zt:p.useLayoutEffect:()=>{};function jn(e,t,n){let[r,a]=p.useState(e||t),i=p.useRef(r),o=p.useRef(e!==void 0),l=e!==void 0;p.useEffect(()=>{let h=o.current;h!==l&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),o.current=l},[l]);let d=l?e:r;Il(()=>{i.current=d});let[,u]=p.useReducer(()=>({}),{}),f=p.useCallback((h,...b)=>{let m=typeof h=="function"?h(i.current):h;Object.is(i.current,m)||(i.current=m,a(m),u(),n?.(m,...b))},[n]);return[d,f]}function Fl(e){return s.jsx("svg",{...e,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:s.jsx(ke.m.path,{animate:{pathLength:1},d:"M5 13l4 4L19 7",initial:{pathLength:0},strokeLinecap:"round",strokeLinejoin:"round",transition:{delay:.2,type:"tween",ease:"easeOut",duration:.3}})})}const ur=p.forwardRef(({color:e="primary",variant:t="default",stepsCount:n=3,defaultStep:r=0,label:a,stepLabels:i,showStepLabelTooltip:o=!1,stepLabelTooltipPlacement:l="top",showStepCounter:d=!1,stepCounterPosition:u="right",layout:f="compact",stepCounterFormat:h,onStepChange:b,currentStep:m,hideProgressBars:j=!1,stepClassName:k,className:g,isDisabled:w=!1,...N},S)=>{const[y,v]=jn(m,r,b),E=p.useMemo(()=>{let F,T;const A=["[--active-fg-color:hsl(var(--step-fg-color))]","[--active-border-color:hsl(var(--step-color))]","[--active-color:hsl(var(--step-color))]","[--complete-background-color:hsl(var(--step-color))]","[--complete-border-color:hsl(var(--step-color))]","[--inactive-border-color:hsl(var(--heroui-default-300))]","[--inactive-color:hsl(var(--heroui-default-300))]"];switch(e){case"primary":F="[--step-color:var(--heroui-primary)]",T="[--step-fg-color:var(--heroui-primary-foreground)]";break;case"secondary":F="[--step-color:var(--heroui-secondary)]",T="[--step-fg-color:var(--heroui-secondary-foreground)]";break;case"success":F="[--step-color:var(--heroui-success)]",T="[--step-fg-color:var(--heroui-success-foreground)]";break;case"warning":F="[--step-color:var(--heroui-warning)]",T="[--step-fg-color:var(--heroui-warning-foreground)]";break;case"danger":F="[--step-color:var(--heroui-danger)]",T="[--step-fg-color:var(--heroui-danger-foreground)]";break;case"default":F="[--step-color:var(--heroui-default)]",T="[--step-fg-color:var(--heroui-default-foreground)]";break;default:F="[--step-color:var(--heroui-primary)]",T="[--step-fg-color:var(--heroui-primary-foreground)]";break}return A.unshift(T),A.unshift(F),A},[e]);return s.jsxs("nav",{ref:S,"aria-label":"Progress",className:c.cn("flex items-center overflow-x-auto",f==="spread"?"w-full justify-between gap-6":"max-w-fit gap-3",g),"data-testid":"stepper-root",...N,children:[d&&u==="left"?s.jsx("span",{className:"text-default-500 text-2xl whitespace-nowrap","data-testid":"stepper-counter",children:h?h(y+1,n):`Step ${y+1} of ${n}`}):null,a&&s.jsx("label",{className:"text-small text-default-foreground lg:text-medium font-light whitespace-nowrap me-3","data-testid":"stepper-label",children:a}),s.jsx("ol",{className:c.cn("flex flex-row flex-nowrap gap-x-3",E,g),"data-testid":"stepper-list",children:Array.from({length:n})?.map((F,T)=>{const A=y===T?"active":y<T?"inactive":"complete",_=t==="activeLabel"&&A==="active"&&!!i?.[T],I=o&&A!=="active"&&!!i?.[T];return s.jsxs("li",{className:"relative flex shrink-0 items-center gap-x-3","data-testid":`stepper-step-${T}`,children:[s.jsx(c.Tooltip,{content:I?i?.[T]:void 0,isDisabled:!I,offset:12,placement:l,classNames:{base:"px-0 py-0",content:"rounded-full border border-default-200 bg-white px-4 py-2 text-small font-medium text-default-700 shadow-sm"},children:s.jsxs("button",{"aria-current":A==="active"?"step":void 0,className:c.cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5",{"rounded-full border border-(--active-border-color)/20 bg-(--active-border-color)/10 pl-2 pr-4 py-1.5":_},{"cursor-not-allowed opacity-50":w},k),onClick:()=>!w&&v(T),disabled:w,"data-testid":`stepper-step-btn-${T}`,children:[s.jsx("div",{className:"h-full relative flex items-center",children:s.jsx(ke.LazyMotion,{features:ke.domAnimation,children:s.jsx(ke.m.div,{animate:A,className:"relative z-10",children:s.jsx(ke.m.div,{animate:A,className:c.cn("border-medium text-large text-default-foreground relative z-10 flex h-[26px] w-[26px] shrink-0 items-center justify-center rounded-full font-semibold bg-white",{"border-(--complete-border-color) bg-(--complete-background-color) text-(--active-fg-color)":_,"bg-(--complete-background-color)":A==="complete","shadow-lg":A==="complete"}),initial:!1,transition:{duration:.25},variants:{inactive:{backgroundColor:"transparent",borderColor:"var(--inactive-border-color)",color:"var(--inactive-color)"},active:{backgroundColor:"transparent",borderColor:"var(--active-border-color)",color:"var(--active-color)"},complete:{backgroundColor:"var(--complete-background-color)",borderColor:"var(--complete-border-color)",color:"var(--active-fg-color)"}},children:s.jsx("div",{className:"flex items-center justify-center",children:A==="complete"&&t==="default"?s.jsx(Fl,{className:"h-5 w-5 text-(--active-fg-color)","data-testid":`stepper-step-check-${T}`}):s.jsx("span",{children:T+1})})})})})}),_?s.jsx("span",{className:"pr-2 text-2xl leading-none font-medium whitespace-nowrap text-(--active-color)","data-testid":`stepper-step-label-${T}`,children:i[T]}):null]},T)}),T<n-1&&!j&&s.jsx("div",{"aria-hidden":"true",className:"pointer-events-none z-0 w-12 flex-none items-center",style:{"--idx":T},children:s.jsx("div",{className:c.cn("bg-default-200 relative h-0.5 w-full transition-colors duration-300","after:absolute after:block after:h-full after:w-0 after:bg-(--active-border-color) after:transition-[width] after:duration-300 after:content-['']",{"after:w-full":T<y})})})]},T)})}),d&&u==="right"?s.jsx("span",{className:"text-default-500 text-2xl whitespace-nowrap","data-testid":"stepper-counter",children:h?h(y+1,n):`Step ${y+1} of ${n}`}):null]})});ur.displayName="Stepper";function Ml(e){return s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:s.jsx(c.Alert,{description:"This template combines Navbar, Stepper, Footer, and an event details Card. Include event image, category/spots chips, tags, details grid, and action buttons. Use Card, CardHeader, CardBody for content structure.",title:"TODO: Implement EventDetailsTemplate",variant:"faded",className:"max-w-2xl"})})})}function ze(e,t="en-US",n="USD"){try{return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e)}catch{return`${n} ${e.toFixed(2)}`}}function wn(e,t="en-US"){try{const n=new Intl.NumberFormat(t,{style:"currency",currency:e}).resolvedOptions();return typeof n.maximumFractionDigits=="number"?n.maximumFractionDigits:2}catch{return 2}}function fr(e,t,n="en-US"){const r=wn(t,n),a=Math.pow(10,r);return Math.round(e*a)/a}function sn(e,t,n,r){return fr(e-t,n,r)}function Tl(){return s.jsxs("footer",{"data-testid":"footer",className:"fixed left-0 bottom-0 w-full text-left p-4 bg-white font-inter font-light text-base text-zinc-500",children:["Powered by Veevart ® ",new Date().getFullYear()]})}const Ll=e=>{const t=p.useMemo(()=>JSON.stringify({allItems:e.allItems,selected:e.selected}),[e.allItems,e.selected]);return s.jsx(Ol,{...e},t)},Ol=({allItems:e,selected:t,onSelectedChange:n,titleLeft:r,titleRight:a})=>{const[i,o]=p.useState([]),[l,d]=p.useState([]),[u,f]=p.useState(null),[h,b]=p.useState(null),m=p.useMemo(()=>new Set(t),[t]),j=p.useMemo(()=>new Set(e),[e]),k=p.useMemo(()=>e.filter(I=>!m.has(I)),[e,m]),g=I=>{if(I.length===0)return;const D=Array.from(new Set([...t,...I]));n(D)},w=I=>{if(I.length===0)return;const D=new Set(I);n(t.filter(M=>!D.has(M)))},N=()=>{i.length!==0&&(g(i),o([]))},S=()=>{l.length!==0&&(w(l),d([]))},y=()=>{k.length!==0&&(g(k),o([]))},v=()=>{t.length!==0&&(n([]),d([]))},E=(I,D,M)=>{const O=Math.min(D,M),Q=Math.max(D,M);return I.slice(O,Q+1)},F=(I,D,M)=>{if(M&&u!==null){o(E(k,u,D)),d([]),f(D);return}const O=i.includes(I);o(O?i.filter(Q=>Q!==I):[...i,I]),d([]),f(D)},T=(I,D,M)=>{if(M&&h!==null){d(E(t,h,D)),o([]),b(D);return}const O=l.includes(I);d(O?l.filter(Q=>Q!==I):[...l,I]),o([]),b(D)},A=(I,D,M)=>{const O=M==="available"?i.includes(D)?i:[D]:l.includes(D)?l:[D];I.dataTransfer.setData("text/plain",JSON.stringify({source:M,items:O})),I.dataTransfer.effectAllowed="move"},_=(I,D)=>{I.preventDefault();const M=I.dataTransfer.getData("text/plain");if(M)try{const O=JSON.parse(M),Q=(O.items||[]).filter(W=>j.has(W));if(Q.length===0||O.source===D)return;D==="selected"?(g(Q),o([])):(w(Q),d([]))}catch{return}};return s.jsxs("div",{className:"flex flex-col gap-6 md:flex-row md:items-start md:justify-between",children:[s.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[s.jsx("h2",{className:"text-sm font-medium text-gray-700",children:r}),s.jsx(c.Card,{className:"w-full border border-gray-200 shadow-none",children:s.jsx(c.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:I=>I.preventDefault(),onDrop:I=>_(I,"available"),children:k.map((I,D)=>{const M=i.includes(I);return s.jsx("button",{type:"button",onClick:O=>{F(I,D,O.shiftKey)},onMouseDown:O=>{O.shiftKey&&O.preventDefault()},draggable:!0,onDragStart:O=>A(O,I,"available"),className:`rounded-md px-3 py-2 text-left text-sm transition ${M?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:I},I)})})})]}),s.jsxs("div",{className:"flex flex-row items-center justify-center gap-3 md:flex-col md:pt-6",children:[s.jsx(H,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-selected-to-available",onPress:N,isDisabled:i.length===0,"aria-label":"Move selected to right",children:"›"}),s.jsx(H,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-selected-to-available",onPress:S,isDisabled:l.length===0,"aria-label":"Move selected to left",children:"‹"}),s.jsx(H,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-all-to-selected",onPress:y,isDisabled:k.length===0,"aria-label":"Move all to right",children:"»"}),s.jsx(H,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,onPress:v,"data-testid":"move-all-to-available",isDisabled:t.length===0,"aria-label":"Move all to left",children:"«"})]}),s.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[s.jsx("h2",{className:"text-sm font-medium text-gray-700",children:a}),s.jsx(c.Card,{className:"w-full border border-gray-200 shadow-none",children:s.jsx(c.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:I=>I.preventDefault(),onDrop:I=>_(I,"selected"),children:t.map((I,D)=>{const M=l.includes(I);return s.jsx("button",{type:"button",onClick:O=>{T(I,D,O.shiftKey)},onMouseDown:O=>{O.shiftKey&&O.preventDefault()},draggable:!0,onDragStart:O=>A(O,I,"selected"),className:`rounded-md px-3 py-2 text-left text-sm transition ${M?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:I},I)})})})]})]})};function dt(e){return typeof e=="string"?e:e.type}function Ue({className:e}){return s.jsx("div",{className:`flex items-center h-6 ${e||""}`,children:s.jsx(c.Divider,{orientation:"vertical"})})}function He({icon:e,label:t,isActive:n=!1,isDisabled:r=!1,onClick:a,shortcut:i,iconSize:o=16,className:l}){const d=i?`${t} (${i})`:t;return s.jsx(c.Tooltip,{content:d,placement:"top",offset:10,children:s.jsx(H,{size:"sm",radius:"sm",color:n?"primary":"default",variant:n?"solid":"bordered",isIconOnly:!0,isDisabled:r,onPress:a,"aria-label":t,className:l,children:s.jsx(e,{size:o})})})}const Ie={bold:{execute:({editor:e})=>e.chain().focus().toggleBold().run(),canExecute:e=>e.can().chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold"),shortcut:"Mod-b",label:"Bold"},italic:{execute:({editor:e})=>e.chain().focus().toggleItalic().run(),canExecute:e=>e.can().chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic"),shortcut:"Mod-i",label:"Italic"},strike:{execute:({editor:e})=>e.chain().focus().toggleStrike().run(),canExecute:e=>e.can().chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike"),shortcut:"Mod-Shift-x",label:"Strikethrough"},underline:{execute:({editor:e})=>e.chain().focus().toggleUnderline().run(),canExecute:e=>e.can().chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline"),shortcut:"Mod-u",label:"Underline"},code:{execute:({editor:e})=>e.chain().focus().toggleCode().run(),canExecute:e=>e.can().chain().focus().toggleCode().run(),isActive:e=>e.isActive("code"),shortcut:"Mod-e",label:"Inline code"},textColor:{execute:({editor:e,config:t})=>{const n=t?.type==="textColor"?t.color:"";n?e.chain().focus().setColor(n).run():e.chain().focus().unsetColor().run()},canExecute:()=>!0,isActive:e=>e.isActive("textStyle"),label:"Text color"},highlight:{execute:({editor:e,config:t})=>{const n=t?.type==="highlight"?t.color:"";n?e.chain().focus().setHighlight({color:n}).run():e.chain().focus().unsetHighlight().run()},canExecute:()=>!0,isActive:e=>e.isActive("highlight"),label:"Highlight"},link:{execute:({editor:e,config:t})=>{const n=t?.type==="link"?t.href:"";if(n){const r=t?.type==="link"?t.target:void 0,a=t?.type==="link"?t.rel:void 0;e.chain().focus().setLink({href:n,target:r,rel:a}).run()}else e.chain().focus().unsetLink().run()},canExecute:()=>!0,isActive:e=>e.isActive("link"),shortcut:"Mod-k",label:"Link"},paragraph:{execute:({editor:e})=>e.chain().focus().setParagraph().run(),canExecute:e=>e.can().chain().focus().setParagraph().run(),isActive:e=>e.isActive("paragraph"),shortcut:"Mod-Alt-0",label:"Paragraph"},heading:{execute:({editor:e,config:t})=>{const n=t?.type==="heading"?t.level:1;e.chain().focus().toggleHeading({level:n}).run()},canExecute:(e,t)=>{const n=t?.type==="heading"?t.level:1;return e.can().chain().focus().toggleHeading({level:n}).run()},isActive:(e,t)=>t?.type==="heading"?e.isActive("heading",{level:t.level}):e.isActive("heading"),label:"Heading"},bulletList:{execute:({editor:e})=>e.chain().focus().toggleBulletList().run(),canExecute:e=>e.can().chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList"),shortcut:"Mod-Shift-8",label:"Bullet list"},orderedList:{execute:({editor:e})=>e.chain().focus().toggleOrderedList().run(),canExecute:e=>e.can().chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList"),shortcut:"Mod-Shift-7",label:"Numbered list"},taskList:{execute:({editor:e})=>e.chain().focus().toggleTaskList().run(),canExecute:e=>e.can().chain().focus().toggleTaskList().run(),isActive:e=>e.isActive("taskList"),label:"Task list"},codeBlock:{execute:({editor:e})=>e.chain().focus().toggleCodeBlock().run(),canExecute:e=>e.can().chain().focus().toggleCodeBlock().run(),isActive:e=>e.isActive("codeBlock"),shortcut:"Mod-Alt-c",label:"Code block"},blockquote:{execute:({editor:e})=>e.chain().focus().toggleBlockquote().run(),canExecute:e=>e.can().chain().focus().toggleBlockquote().run(),isActive:e=>e.isActive("blockquote"),shortcut:"Mod-Shift-b",label:"Blockquote"},horizontalRule:{execute:({editor:e})=>e.chain().focus().setHorizontalRule().run(),canExecute:e=>e.can().chain().focus().setHorizontalRule().run(),isActive:()=>!1,label:"Horizontal rule"},hardBreak:{execute:({editor:e})=>e.chain().focus().setHardBreak().run(),canExecute:e=>e.can().chain().focus().setHardBreak().run(),isActive:()=>!1,shortcut:"Mod-Enter",label:"Line break"},textAlign:{execute:({editor:e,config:t})=>{const n=t?.type==="textAlign"?t.alignment:"left";e.chain().focus().setTextAlign(n).run()},canExecute:()=>!0,isActive:(e,t)=>t?.type==="textAlign"?e.isActive({textAlign:t.alignment}):!1,label:"Text alignment"},clearMarks:{execute:({editor:e})=>e.chain().focus().unsetAllMarks().run(),canExecute:e=>e.can().chain().focus().unsetAllMarks().run(),isActive:()=>!1,label:"Clear formatting"},clearNodes:{execute:({editor:e})=>e.chain().focus().clearNodes().run(),canExecute:e=>e.can().chain().focus().clearNodes().run(),isActive:()=>!1,label:"Clear nodes"},undo:{execute:({editor:e})=>e.chain().focus().undo().run(),canExecute:e=>e.can().chain().focus().undo().run(),isActive:()=>!1,shortcut:"Mod-z",label:"Undo"},redo:{execute:({editor:e})=>e.chain().focus().redo().run(),canExecute:e=>e.can().chain().focus().redo().run(),isActive:()=>!1,shortcut:"Mod-Shift-z",label:"Redo"}},Pl={1:"Heading 1",2:"Heading 2",3:"Heading 3",4:"Heading 4",5:"Heading 5",6:"Heading 6"};function _l({editor:e,levels:t=[1,2,3,4,5,6],isDisabled:n=!1}){const[,r]=p.useState(0);p.useEffect(()=>{const o=()=>r(l=>l+1);return e.on("selectionUpdate",o),e.on("transaction",o),()=>{e.off("selectionUpdate",o),e.off("transaction",o)}},[e]);const a=t.find(o=>e.isActive("heading",{level:o})),i=o=>{const l=Number(o),d=Ie.heading;d&&d.execute({editor:e,config:{type:"heading",level:l}})};return s.jsxs(c.Dropdown,{placement:"top-start",offset:10,children:[s.jsx(c.DropdownTrigger,{children:s.jsx(H,{size:"sm",radius:"sm",variant:a?"solid":"bordered",color:a?"primary":"default",isDisabled:n,startContent:s.jsx(K.Heading,{size:16}),"aria-label":"Select heading level",children:a?`H${a}`:"H"})}),s.jsx(c.DropdownMenu,{"aria-label":"Heading levels",selectionMode:"single",selectedKeys:a?new Set([String(a)]):new Set,onAction:i,children:t.map(o=>s.jsx(c.DropdownItem,{startContent:e.isActive("heading",{level:o})?s.jsx(K.Check,{size:16}):s.jsx("div",{className:"w-4"}),children:Pl[o]},o))})]})}const Rt={bulletList:{label:"Bullet List",icon:K.List},orderedList:{label:"Numbered List",icon:K.ListOrdered},taskList:{label:"Task List",icon:K.ListTodo}};function zl({editor:e,types:t=["bulletList","orderedList","taskList"],isDisabled:n=!1}){const[,r]=p.useState(0);p.useEffect(()=>{const l=()=>r(d=>d+1);return e.on("selectionUpdate",l),e.on("transaction",l),()=>{e.off("selectionUpdate",l),e.off("transaction",l)}},[e]);const a=t.find(l=>e.isActive(l)),i=a?Rt[a].icon:K.List,o=l=>{const u=Ie[l];u&&u.execute({editor:e})};return s.jsxs(c.Dropdown,{placement:"top-start",offset:10,children:[s.jsx(c.DropdownTrigger,{children:s.jsx(H,{size:"sm",radius:"sm",variant:a?"solid":"bordered",color:a?"primary":"default",isDisabled:n,isIconOnly:!0,"aria-label":"Select list type",children:s.jsx(i,{size:16})})}),s.jsx(c.DropdownMenu,{"aria-label":"List types",selectionMode:"single",selectedKeys:a?new Set([a]):new Set,onAction:o,children:t.map(l=>{const d=Rt[l].icon;return s.jsx(c.DropdownItem,{startContent:s.jsx(d,{size:16}),children:Rt[l].label},l)})})]})}function Rl({colors:e,selectedColor:t,onColorSelect:n,columns:r=4}){return s.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${r}, minmax(0, 1fr))`},children:e.map(a=>{const i=t===a;return s.jsx("button",{type:"button",onClick:()=>n(a),className:`
2
2
  w-8 h-8 rounded-full border-2 cursor-pointer
3
3
  transition-all duration-200
4
4
  hover:scale-110 hover:shadow-md