@nice2dev/ui-presentations 1.0.5 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1401 @@
1
+ "use strict";const n=require("react/jsx-runtime"),o=require("react");class nn{constructor(t){this.undoStack=[],this.redoStack=[],this.listeners=new Set,this.maxHistory=100,this.doc=t??nn.createEmpty()}static createEmpty(t="Untitled Presentation"){const a=new Date().toISOString(),i={id:it(),title:"Title Slide",layout:"titleSlide",background:{type:"solid",color:"#ffffff"},elements:[{id:it(),type:"text",position:{x:10,y:30,width:80,height:20},content:{kind:"text",text:t,fontSize:48,fontWeight:"bold",textAlign:"center"}},{id:it(),type:"text",position:{x:20,y:55,width:60,height:10},content:{kind:"text",text:"Subtitle",fontSize:24,textAlign:"center",fontColor:"#666666"}}]};return{version:"1.0",id:it(),title:t,slideSize:{width:1920,height:1080},slides:[i],theme:{name:"NiceToDev",backgroundColor:"#f8f9fa",primaryColor:"#6366f1",secondaryColor:"#8b5cf6",accentColor:"#06b6d4",textColor:"#334155",headingColor:"#1e293b",fontFamily:"Inter, sans-serif",headingFontFamily:'"Plus Jakarta Sans", Inter, sans-serif',codeFontFamily:'"Fira Code", monospace'},metadata:{createdAt:a,updatedAt:a}}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.doc.metadata.updatedAt=new Date().toISOString(),this.listeners.forEach(t=>t())}pushUndo(t){this.undoStack.push({label:t,snapshot:JSON.stringify(this.doc)}),this.undoStack.length>this.maxHistory&&this.undoStack.shift(),this.redoStack.length=0}undo(){const t=this.undoStack.pop();t&&(this.redoStack.push({label:"redo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(t.snapshot),this.notify())}redo(){const t=this.redoStack.pop();t&&(this.undoStack.push({label:"undo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(t.snapshot),this.notify())}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}getDocument(){return this.doc}getSlides(){return this.doc.slides}getSlide(t){return this.doc.slides.find(a=>a.id===t)}getTheme(){return this.doc.theme}loadDocument(t){this.pushUndo("loadDocument"),this.doc=JSON.parse(JSON.stringify(t)),this.notify()}addSlide(t,a="titleContent"){this.pushUndo("addSlide");const i={id:it(),title:`Slide ${this.doc.slides.length+1}`,layout:a,background:{type:"solid",color:this.doc.theme.backgroundColor},elements:[]},r=t!==void 0?t+1:this.doc.slides.length;return this.doc.slides.splice(r,0,i),this.notify(),i}removeSlide(t){this.pushUndo("removeSlide"),this.doc.slides=this.doc.slides.filter(a=>a.id!==t),this.notify()}moveSlide(t,a){const i=this.doc.slides.findIndex(s=>s.id===t);if(i===-1||i===a)return;this.pushUndo("moveSlide");const[r]=this.doc.slides.splice(i,1);this.doc.slides.splice(a,0,r),this.notify()}duplicateSlide(t){const a=this.getSlide(t);if(!a)return null;this.pushUndo("duplicateSlide");const i=JSON.parse(JSON.stringify(a));i.id=it(),i.title=`${a.title} (copy)`,i.elements.forEach(s=>{s.id=it()});const r=this.doc.slides.findIndex(s=>s.id===t);return this.doc.slides.splice(r+1,0,i),this.notify(),i}updateSlide(t,a){const i=this.doc.slides.find(r=>r.id===t);i&&(this.pushUndo("updateSlide"),Object.assign(i,a),this.notify())}addElement(t,a){const i=this.doc.slides.find(s=>s.id===t);if(!i)return null;this.pushUndo("addElement");const r={...a,id:it()};return i.elements.push(r),this.notify(),r}updateElement(t,a,i){const r=this.doc.slides.find(l=>l.id===t);if(!r)return;const s=r.elements.find(l=>l.id===a);s&&(this.pushUndo("updateElement"),Object.assign(s,i),this.notify())}removeElement(t,a){const i=this.doc.slides.find(r=>r.id===t);i&&(this.pushUndo("removeElement"),i.elements=i.elements.filter(r=>r.id!==a),this.notify())}moveElement(t,a,i){this.updateElement(t,a,{position:i})}setTheme(t){this.pushUndo("setTheme"),this.doc.theme={...t},this.notify()}}function it(){return`ndp_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function Ua(e){const t=o.useRef(null);t.current||(t.current=new nn(e));const a=t.current,[,i]=o.useState(0),r=o.useCallback(()=>i(d=>d+1),[]),[s,l]=o.useState(0);o.useEffect(()=>a.subscribe(r),[a,r]);const c=a.getDocument();return o.useMemo(()=>({document:c,slides:c.slides,theme:c.theme,currentSlideIndex:s,currentSlide:c.slides[s],setCurrentSlideIndex:l,addSlide:(d,u)=>a.addSlide(d,u),removeSlide:d=>a.removeSlide(d),moveSlide:(d,u)=>a.moveSlide(d,u),duplicateSlide:d=>a.duplicateSlide(d),updateSlide:(d,u)=>a.updateSlide(d,u),addElement:(d,u)=>a.addElement(d,u),updateElement:(d,u,g)=>a.updateElement(d,u,g),removeElement:(d,u)=>a.removeElement(d,u),moveElement:(d,u,g)=>a.moveElement(d,u,g),setTheme:d=>a.setTheme(d),undo:()=>a.undo(),redo:()=>a.redo(),canUndo:a.canUndo(),canRedo:a.canRedo(),loadDocument:d=>a.loadDocument(d),model:a}),[c,a,s])}function Cn(e){return e.series&&e.series.length>0?e.series:e.datasets&&e.datasets.length>0?e.datasets.map(t=>({name:t.label??"",values:t.data,color:t.color??t.backgroundColor})):[]}function Ya(e,t,a){const i=e.data,r=e.options??{},s=r.colors??["#6366f1","#06b6d4","#10b981","#f59e0b","#ef4444","#8b5cf6"];switch(e.chartType){case"bar":return fa(i,t,a,s,r);case"line":return ro(i,t,a,s);case"pie":case"doughnut":return oo(i,t,a,s,e.chartType==="doughnut");default:return fa(i,t,a,s,r)}}function fa(e,t,a,i,r){const s={top:20,right:20,bottom:40,left:50},l=t-s.left-s.right,c=a-s.top-s.bottom,d=Cn(e),u=d.flatMap(v=>v.values),g=Math.max(...u,1),h=e.labels.length,p=d.length,m=l/h,k=m*.7/p,b=m*.15,C=[],_=[];for(let v=0;v<h;v++){const j=s.left+v*m;_.push(`<text x="${j+m/2}" y="${a-10}" text-anchor="middle" font-size="11" fill="#666">${_n(e.labels[v])}</text>`);for(let S=0;S<p;S++){const M=(d[S].values[v]??0)/g*c,w=j+b+S*k,E=s.top+c-M,P=d[S].color??i[S%i.length];C.push(`<rect x="${w}" y="${E}" width="${k}" height="${M}" fill="${P}" rx="2" />`)}}const f=[];for(let v=0;v<=4;v++){const j=Math.round(g/4*v),S=s.top+c-v/4*c;f.push(`<text x="${s.left-8}" y="${S+4}" text-anchor="end" font-size="10" fill="#999">${j}</text>`),r.showGrid!==!1&&f.push(`<line x1="${s.left}" y1="${S}" x2="${s.left+l}" y2="${S}" stroke="#eee" />`)}return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${a}">
2
+ ${f.join(`
3
+ `)}
4
+ ${C.join(`
5
+ `)}
6
+ ${_.join(`
7
+ `)}
8
+ </svg>`}function ro(e,t,a,i,r){const s={top:20,right:20,bottom:40,left:50},l=t-s.left-s.right,c=a-s.top-s.bottom,d=Cn(e),u=d.flatMap(b=>b.values),g=Math.max(...u,1),h=e.labels.length,p=l/Math.max(h-1,1),m=[];for(let b=0;b<d.length;b++){const C=d[b].color??i[b%i.length],_=d[b].values.map((f,v)=>{const j=s.left+v*p,S=s.top+c-f/g*c;return`${j},${S}`});m.push(`<polyline points="${_.join(" ")}" fill="none" stroke="${C}" stroke-width="2" />`),d[b].values.forEach((f,v)=>{const j=s.left+v*p,S=s.top+c-f/g*c;m.push(`<circle cx="${j}" cy="${S}" r="3" fill="${C}" />`)})}const k=e.labels.map((b,C)=>`<text x="${s.left+C*p}" y="${a-10}" text-anchor="middle" font-size="11" fill="#666">${_n(b)}</text>`);return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${a}">
9
+ ${m.join(`
10
+ `)}
11
+ ${k.join(`
12
+ `)}
13
+ </svg>`}function oo(e,t,a,i,r){const s=Cn(e);if(s.length===0)return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${a}" />`;const l=s[0].values,c=l.reduce((k,b)=>k+b,0)||1,d=t/2,u=a/2,g=Math.min(t,a)*.38,h=r?g*.55:0,p=[];let m=-Math.PI/2;return l.forEach((k,b)=>{const C=k/c*Math.PI*2,_=m+C,f=C>Math.PI?1:0,v=i[b%i.length],j=d+g*Math.cos(m),S=u+g*Math.sin(m),I=d+g*Math.cos(_),M=u+g*Math.sin(_);if(r){const A=d+h*Math.cos(m),N=u+h*Math.sin(m),x=d+h*Math.cos(_),O=u+h*Math.sin(_);p.push(`<path d="M ${j} ${S} A ${g} ${g} 0 ${f} 1 ${I} ${M} L ${x} ${O} A ${h} ${h} 0 ${f} 0 ${A} ${N} Z" fill="${v}" />`)}else p.push(`<path d="M ${d} ${u} L ${j} ${S} A ${g} ${g} 0 ${f} 1 ${I} ${M} Z" fill="${v}" />`);const w=m+C/2,E=g*1.15,P=d+E*Math.cos(w),L=u+E*Math.sin(w);e.labels[b]&&p.push(`<text x="${P}" y="${L}" text-anchor="middle" font-size="11" fill="#444">${_n(e.labels[b])}</text>`),m=_}),`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${a}">
14
+ ${p.join(`
15
+ `)}
16
+ </svg>`}function _n(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const ft=({slide:e,slideSize:t,theme:a,scale:i=1,selectedElementId:r,onSelectElement:s,onElementDrag:l,onElementResize:c,onElementRotate:d,interactive:u=!1,showGrid:g=!1,gridSnap:h=0,className:p})=>{const[m,k]=o.useState(null),[b,C]=o.useState(null),_=w=>h>0?Math.round(w/h)*h:w,f=o.useMemo(()=>{const w=e.background;if(w.type==="gradient"&&w.gradientStops){const E=w.gradientStops.map(P=>`${P.color} ${P.position*100}%`).join(", ");return{background:`linear-gradient(${w.gradientDirection??180}deg, ${E})`}}return w.type==="image"&&w.imageUrl?{backgroundImage:`url(${w.imageUrl})`,backgroundSize:w.imageFit??"cover",backgroundPosition:"center",backgroundColor:w.color??a.backgroundColor}:{backgroundColor:w.color??a.backgroundColor}},[e.background,a.backgroundColor]),v=o.useCallback((w,E)=>{!u||E.locked||(w.stopPropagation(),s==null||s(E.id),k({id:E.id,startX:w.clientX,startY:w.clientY,elStartX:E.position.x,elStartY:E.position.y}))},[u,s]),j=o.useCallback(w=>{if(m&&l){const E=(w.clientX-m.startX)/i,P=(w.clientY-m.startY)/i,L=_(m.elStartX+E/t.width*100),A=_(m.elStartY+P/t.height*100);l(m.id,L,A)}if(b&&c){const E=(w.clientX-b.startX)/i/t.width*100,P=(w.clientY-b.startY)/i/t.height*100,L=b.elPos;let{x:A,y:N,width:x,height:O}=L;const D=b.handle;D.includes("e")&&(x=_(Math.max(2,L.width+E))),D.includes("w")&&(x=_(Math.max(2,L.width-E)),A=_(L.x+(L.width-x))),D.includes("s")&&(O=_(Math.max(2,L.height+P))),D.includes("n")&&(O=_(Math.max(2,L.height-P)),N=_(L.y+(L.height-O))),c(b.id,x,O,A,N)}},[m,b,l,c,i,t,_]),S=o.useCallback(()=>{k(null),C(null)},[]),I=o.useCallback((w,E,P)=>{u&&(w.stopPropagation(),w.preventDefault(),C({id:E.id,handle:P,startX:w.clientX,startY:w.clientY,elPos:{...E.position}}))},[u]),M=o.useCallback(w=>{w.target.classList.contains("nice-slide-canvas__surface")&&(s==null||s(null))},[s]);return n.jsxs("div",{className:`nice-slide-canvas ${p??""}`,style:{width:t.width*i,height:t.height*i,position:"relative",overflow:"hidden",boxShadow:"0 2px 12px rgba(0,0,0,0.15)",borderRadius:4,...f,color:a.textColor,fontFamily:a.fontFamily},onMouseMove:j,onMouseUp:S,onMouseLeave:S,onClick:M,children:[n.jsx("div",{className:"nice-slide-canvas__surface",style:{width:"100%",height:"100%",position:"absolute"}}),g&&n.jsx("svg",{style:{position:"absolute",inset:0,width:"100%",height:"100%",pointerEvents:"none",opacity:.15},children:Array.from({length:9},(w,E)=>{const P=(E+1)*10;return n.jsxs(o.Fragment,{children:[n.jsx("line",{x1:`${P}%`,y1:"0",x2:`${P}%`,y2:"100%",stroke:"#666",strokeWidth:"0.5"}),n.jsx("line",{x1:"0",y1:`${P}%`,x2:"100%",y2:`${P}%`,stroke:"#666",strokeWidth:"0.5"})]},E)})}),[...e.elements].sort((w,E)=>(w.zIndex??0)-(E.zIndex??0)).map(w=>n.jsx(uo,{element:w,slideSize:t,scale:i,theme:a,isSelected:r===w.id,onMouseDown:E=>v(E,w),onResizeStart:(E,P)=>I(E,w,P),interactive:u},w.id))]})},so=["nw","n","ne","e","se","s","sw","w"],lo={nw:"nwse-resize",n:"ns-resize",ne:"nesw-resize",e:"ew-resize",se:"nwse-resize",s:"ns-resize",sw:"nesw-resize",w:"ew-resize"},co={nw:{top:-4,left:-4},n:{top:-4,left:"50%",marginLeft:-4},ne:{top:-4,right:-4},e:{top:"50%",right:-4,marginTop:-4},se:{bottom:-4,right:-4},s:{bottom:-4,left:"50%",marginLeft:-4},sw:{bottom:-4,left:-4},w:{top:"50%",left:-4,marginTop:-4}},uo=({element:e,slideSize:t,scale:a,theme:i,isSelected:r,onMouseDown:s,onResizeStart:l,interactive:c})=>{const{position:d,content:u,rotation:g,opacity:h}=e,p=d.x/100*t.width*a,m=d.y/100*t.height*a,k=d.width/100*t.width*a,b=d.height/100*t.height*a,C={position:"absolute",left:p,top:m,width:k,height:b,opacity:h??1,transform:g?`rotate(${g}deg)`:void 0,cursor:c&&!e.locked?"move":"default",outline:r?"2px solid #2196f3":void 0,outlineOffset:r?2:void 0,zIndex:e.zIndex??0};return n.jsxs("div",{style:C,onMouseDown:s,children:[po(u,k,b,a,i),r&&c&&!e.locked&&so.map(_=>n.jsx("div",{style:{position:"absolute",width:8,height:8,background:"#2196f3",border:"1px solid #fff",borderRadius:2,cursor:lo[_],zIndex:10,...co[_]},onMouseDown:f=>l(f,_)},_))]})};function po(e,t,a,i,r){switch(e.kind){case"text":{const s=e;return n.jsx("div",{style:{width:"100%",height:"100%",fontSize:(s.fontSize??16)*i,fontFamily:s.fontFamily??r.fontFamily,fontWeight:s.fontWeight??"normal",color:s.fontColor??r.textColor,textAlign:s.textAlign??"left",lineHeight:s.lineHeight??1.4,whiteSpace:"pre-wrap",wordBreak:"break-word",overflow:"hidden"},children:s.text})}case"image":{const s=e;return n.jsx("img",{src:s.src,alt:s.alt??"",style:{width:"100%",height:"100%",objectFit:s.objectFit??"contain",borderRadius:s.borderRadius??0,boxShadow:s.shadow?"0 4px 16px rgba(0,0,0,0.2)":void 0}})}case"shape":{const s=e;return n.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:s.fill??"#ccc",border:s.strokeWidth?`${s.strokeWidth}px solid ${s.stroke??"#333"}`:void 0,borderRadius:s.shapeType==="ellipse"?"50%":0}})}case"code":{const s=e;return n.jsx("pre",{style:{width:"100%",height:"100%",margin:0,padding:12*i,fontSize:(s.fontSize??14)*i,fontFamily:r.codeFontFamily??"monospace",backgroundColor:s.theme==="light"?"#f5f5f5":"#1e1e1e",color:s.theme==="light"?"#333":"#d4d4d4",borderRadius:8,overflow:"auto",whiteSpace:"pre"},children:n.jsx("code",{children:s.code})})}case"chart":{const l=Ya(e,t,a);return n.jsx("div",{style:{width:"100%",height:"100%"},dangerouslySetInnerHTML:{__html:l}})}case"table":{const s=e;return n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14*i},children:[n.jsx("thead",{children:n.jsx("tr",{children:s.headers.map((l,c)=>n.jsx("th",{style:{padding:`${6*i}px ${8*i}px`,backgroundColor:s.headerBg??r.primaryColor,color:s.headerColor??"#fff",textAlign:"left",borderBottom:`2px solid ${s.borderColor??"#ddd"}`},children:l},c))})}),n.jsx("tbody",{children:s.rows.map((l,c)=>n.jsx("tr",{style:{backgroundColor:s.stripedRows&&c%2===1?"rgba(0,0,0,0.03)":void 0},children:l.map((d,u)=>n.jsx("td",{style:{padding:`${4*i}px ${8*i}px`,borderBottom:`1px solid ${s.borderColor??"#eee"}`},children:d},u))},c))})]})}default:return n.jsx("div",{style:{width:"100%",height:"100%",background:"#f0f0f0",borderRadius:4}})}}ft.displayName="SlideCanvas";const ga={en:{"toolbar.addSlide":"Add Slide","toolbar.deleteSlide":"Delete Slide","toolbar.duplicateSlide":"Duplicate","toolbar.undo":"Undo","toolbar.redo":"Redo","toolbar.present":"Present","toolbar.export":"Export","toolbar.theme":"Theme","element.text":"Text","element.image":"Image","element.shape":"Shape","element.chart":"Chart","element.table":"Table","element.code":"Code","element.diagram":"Diagram","element.video":"Video","element.icon":"Icon","element.addElement":"Add Element","panel.slideProperties":"Slide Properties","panel.elementProperties":"Element Properties","panel.noSelection":"Select a slide or element","panel.layout":"Layout","panel.background":"Background","panel.transition":"Transition","panel.notes":"Speaker Notes","player.play":"Play","player.pause":"Pause","player.fullscreen":"Fullscreen","player.exit":"Exit","player.slideOf":"of","layout.blank":"Blank","layout.titleSlide":"Title Slide","layout.titleContent":"Title + Content","layout.twoColumn":"Two Column","layout.titleOnly":"Title Only","layout.sectionHeader":"Section Header","layout.comparison":"Comparison","layout.custom":"Custom","export.html":"HTML Presentation","export.ndp":".ndp.json"},pl:{"toolbar.addSlide":"Dodaj slajd","toolbar.deleteSlide":"Usuń slajd","toolbar.duplicateSlide":"Duplikuj","toolbar.undo":"Cofnij","toolbar.redo":"Powtórz","toolbar.present":"Prezentuj","toolbar.export":"Eksport","toolbar.theme":"Motyw","element.text":"Tekst","element.image":"Obraz","element.shape":"Kształt","element.chart":"Wykres","element.table":"Tabela","element.code":"Kod","element.diagram":"Diagram","element.video":"Wideo","element.icon":"Ikona","element.addElement":"Dodaj element","panel.slideProperties":"Właściwości slajdu","panel.elementProperties":"Właściwości elementu","panel.noSelection":"Wybierz slajd lub element","panel.layout":"Układ","panel.background":"Tło","panel.transition":"Przejście","panel.notes":"Notatki prelegenta","player.play":"Odtwórz","player.pause":"Pauza","player.fullscreen":"Pełny ekran","player.exit":"Wyjdź","player.slideOf":"z","layout.blank":"Puste","layout.titleSlide":"Slajd tytułowy","layout.titleContent":"Tytuł + treść","layout.twoColumn":"Dwie kolumny","layout.titleOnly":"Tylko tytuł","layout.sectionHeader":"Nagłówek sekcji","layout.comparison":"Porównanie","layout.custom":"Niestandardowy","export.html":"Prezentacja HTML","export.ndp":".ndp.json"},de:{"toolbar.addSlide":"Folie hinzufügen","toolbar.deleteSlide":"Folie löschen","toolbar.duplicateSlide":"Duplizieren","toolbar.undo":"Rückgängig","toolbar.redo":"Wiederholen","toolbar.present":"Präsentieren","toolbar.export":"Exportieren","toolbar.theme":"Design","element.text":"Text","element.image":"Bild","element.shape":"Form","element.chart":"Diagramm","element.table":"Tabelle","element.code":"Code","element.diagram":"Diagramm","element.video":"Video","element.icon":"Symbol","element.addElement":"Element hinzufügen","panel.slideProperties":"Folieneigenschaften","panel.elementProperties":"Elementeigenschaften","panel.noSelection":"Wählen Sie eine Folie oder ein Element","panel.layout":"Layout","panel.background":"Hintergrund","panel.transition":"Übergang","panel.notes":"Sprechernotizen","player.play":"Abspielen","player.pause":"Pause","player.fullscreen":"Vollbild","player.exit":"Beenden","player.slideOf":"von","layout.blank":"Leer","layout.titleSlide":"Titelfolie","layout.titleContent":"Titel + Inhalt","layout.twoColumn":"Zwei Spalten","layout.titleOnly":"Nur Titel","layout.sectionHeader":"Abschnittskopf","layout.comparison":"Vergleich","layout.custom":"Benutzerdefiniert","export.html":"HTML-Präsentation","export.ndp":".ndp.json"},fr:{"toolbar.addSlide":"Ajouter une diapositive","toolbar.deleteSlide":"Supprimer la diapositive","toolbar.duplicateSlide":"Dupliquer","toolbar.undo":"Annuler","toolbar.redo":"Rétablir","toolbar.present":"Présenter","toolbar.export":"Exporter","toolbar.theme":"Thème","element.text":"Texte","element.image":"Image","element.shape":"Forme","element.chart":"Graphique","element.table":"Tableau","element.code":"Code","element.diagram":"Diagramme","element.video":"Vidéo","element.icon":"Icône","element.addElement":"Ajouter un élément","panel.slideProperties":"Propriétés de la diapositive","panel.elementProperties":"Propriétés de l'élément","panel.noSelection":"Sélectionnez une diapositive ou un élément","panel.layout":"Disposition","panel.background":"Arrière-plan","panel.transition":"Transition","panel.notes":"Notes du présentateur","player.play":"Lire","player.pause":"Pause","player.fullscreen":"Plein écran","player.exit":"Quitter","player.slideOf":"sur","layout.blank":"Vide","layout.titleSlide":"Diapositive de titre","layout.titleContent":"Titre + contenu","layout.twoColumn":"Deux colonnes","layout.titleOnly":"Titre seul","layout.sectionHeader":"En-tête de section","layout.comparison":"Comparaison","layout.custom":"Personnalisé","export.html":"Présentation HTML","export.ndp":".ndp.json"},es:{"toolbar.addSlide":"Añadir diapositiva","toolbar.deleteSlide":"Eliminar diapositiva","toolbar.duplicateSlide":"Duplicar","toolbar.undo":"Deshacer","toolbar.redo":"Rehacer","toolbar.present":"Presentar","toolbar.export":"Exportar","toolbar.theme":"Tema","element.text":"Texto","element.image":"Imagen","element.shape":"Forma","element.chart":"Gráfico","element.table":"Tabla","element.code":"Código","element.diagram":"Diagrama","element.video":"Vídeo","element.icon":"Icono","element.addElement":"Añadir elemento","panel.slideProperties":"Propiedades de la diapositiva","panel.elementProperties":"Propiedades del elemento","panel.noSelection":"Seleccione una diapositiva o un elemento","panel.layout":"Diseño","panel.background":"Fondo","panel.transition":"Transición","panel.notes":"Notas del presentador","player.play":"Reproducir","player.pause":"Pausa","player.fullscreen":"Pantalla completa","player.exit":"Salir","player.slideOf":"de","layout.blank":"En blanco","layout.titleSlide":"Diapositiva de título","layout.titleContent":"Título + contenido","layout.twoColumn":"Dos columnas","layout.titleOnly":"Solo título","layout.sectionHeader":"Encabezado de sección","layout.comparison":"Comparación","layout.custom":"Personalizado","export.html":"Presentación HTML","export.ndp":".ndp.json"}},Za=o.createContext(e=>e),Ga=({lang:e="en",children:t})=>{const a=ga[e]??ga.en,i=r=>a[r]??r;return n.jsx(Za.Provider,{value:i,children:t})};function an(){return o.useContext(Za)}function ke(e){const t=o.useId();return e||t}function ot(e,t){o.useEffect(()=>{const a=i=>{!e.current||e.current.contains(i.target)||t()};return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[e,t])}function mo(e,t){o.useEffect(()=>{if(!t||!e.current)return;const a=e.current,i=document.activeElement,r=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=r[0],l=r[r.length-1],c=d=>{d.key==="Tab"&&(d.shiftKey?document.activeElement===s&&(d.preventDefault(),l==null||l.focus()):document.activeElement===l&&(d.preventDefault(),s==null||s.focus()))};return s==null||s.focus(),a.addEventListener("keydown",c),()=>{var d;a.removeEventListener("keydown",c),(d=i==null?void 0:i.focus)==null||d.call(i)}},[e,t])}const ho={ok:"OK",cancel:"Cancel",save:"Save",close:"Close",delete:"Delete",edit:"Edit",add:"Add",remove:"Remove",search:"Search",filter:"Filter",refresh:"Refresh",loading:"Loading…",noData:"No data",error:"Error",success:"Success",warning:"Warning",info:"Information",yes:"Yes",no:"No",confirm:"Confirm",back:"Back",next:"Next",previous:"Previous",finish:"Finish",submit:"Submit",reset:"Reset",apply:"Apply",undo:"Undo",redo:"Redo",copy:"Copy",cut:"Cut",paste:"Paste",selectAll:"Select all",clear:"Clear",upload:"Upload",download:"Download",print:"Print",export:"Export",import:"Import",settings:"Settings",help:"Help",about:"About",more:"More",less:"Less",show:"Show",hide:"Hide",expand:"Expand",collapse:"Collapse",enabled:"Enabled",disabled:"Disabled",required:"Required",optional:"Optional",actions:"Actions",details:"Details",overview:"Overview",all:"All",none:"None",selected:"Selected",total:"Total",of:"of",items:"items",page:"Page",rows:"Rows","app.name":"Application","app.version":"Version","app.about":"About","nav.home":"Home","nav.back":"Back","nav.forward":"Forward","nav.menu":"Menu","nav.sidebar":"Sidebar","nav.search":"Search","nav.favorites":"Favorites","nav.recent":"Recent","nav.notifications":"Notifications","nav.profile":"Profile","nav.logout":"Log out","carousel.prev":"Previous slide","carousel.next":"Next slide","carousel.slide":"Slide","carousel.of":"of","carousel.autoplay":"Auto-play","carousel.pause":"Pause","confirm.yes":"Yes","confirm.no":"No","confirm.ok":"OK","confirm.cancel":"Cancel","confirm.title":"Confirmation","confirm.deleteMessage":"Are you sure you want to delete this?","confirm.unsavedChanges":"You have unsaved changes. Discard?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Enter command…","console.clear":"Clear console","console.run":"Run","console.output":"Output","console.newSession":"New session","console.closeSession":"Close session","controls.save":"Save","controls.cancel":"Cancel","controls.delete":"Delete","controls.edit":"Edit","controls.add":"Add","controls.remove":"Remove","controls.close":"Close","controls.open":"Open","controls.refresh":"Refresh","controls.new":"New","controls.duplicate":"Duplicate","controls.sort":"Sort","controls.group":"Group","controls.pin":"Pin","controls.unpin":"Unpin","controls.lock":"Lock","controls.unlock":"Unlock","controls.share":"Share","controls.archive":"Archive","cookie.title":"Cookie consent","cookie.message":"This site uses cookies to improve your experience.","cookie.accept":"Accept all","cookie.reject":"Reject all","cookie.settings":"Cookie settings","cookie.necessary":"Necessary","cookie.analytics":"Analytics","cookie.marketing":"Marketing","dashboard.title":"Dashboard","dashboard.addWidget":"Add widget","dashboard.removeWidget":"Remove widget","dashboard.layout":"Layout","dashboard.settings":"Settings","dashboard.customize":"Customize","dashboard.resetLayout":"Reset layout","datetime.today":"Today","datetime.yesterday":"Yesterday","datetime.tomorrow":"Tomorrow","datetime.selectDate":"Select date","datetime.selectTime":"Select time","datetime.startDate":"Start date","datetime.endDate":"End date","datetime.startTime":"Start time","datetime.endTime":"End time","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Start","desktop.taskbar":"Taskbar","desktop.systemTray":"System tray","desktop.wallpaper":"Wallpaper","desktop.icons":"Desktop icons","desktop.arrangeIcons":"Arrange icons","dock.pin":"Pin to dock","dock.unpin":"Unpin from dock","dock.close":"Close","dock.minimize":"Minimize","dock.maximize":"Maximize","dock.restore":"Restore","docEditor.paragraph":"Paragraph","docEditor.heading":"Heading","docEditor.heading1":"Heading 1","docEditor.heading2":"Heading 2","docEditor.heading3":"Heading 3","docEditor.bulletList":"Bullet list","docEditor.numberedList":"Numbered list","docEditor.quote":"Quote","docEditor.code":"Code block","docEditor.divider":"Divider","docEditor.image":"Image","docEditor.table":"Table","docEditor.callout":"Callout","docEditor.placeholder":"Start typing…","docEditor.slashCommand":"Type / for commands","files.upload":"Upload file","files.download":"Download","files.delete":"Delete file","files.rename":"Rename","files.newFolder":"New folder","files.selectFile":"Select file","files.dropzone":"Drop files here","files.dragDrop":"Drag & drop files here or click to browse","files.maxSize":"Maximum file size","files.fileType":"File type","forms.required":"This field is required","forms.optional":"Optional","forms.submit":"Submit","forms.reset":"Reset","forms.validate":"Validate","forms.invalid":"Invalid value","forms.minLength":"Minimum length: {0}","forms.maxLength":"Maximum length: {0}","forms.email":"Enter a valid email","forms.phone":"Enter a valid phone number","imageEditor.crop":"Crop","imageEditor.rotate":"Rotate","imageEditor.flip":"Flip","imageEditor.resize":"Resize","imageEditor.filter":"Filter","imageEditor.draw":"Draw","imageEditor.text":"Text","imageEditor.undo":"Undo","imageEditor.redo":"Redo","imageEditor.save":"Save","imageEditor.brightness":"Brightness","imageEditor.contrast":"Contrast","imageEditor.saturation":"Saturation","inbox.compose":"Compose","inbox.reply":"Reply","inbox.replyAll":"Reply all","inbox.forward":"Forward","inbox.delete":"Delete","inbox.archive":"Archive","inbox.markRead":"Mark as read","inbox.markUnread":"Mark as unread","inbox.folders":"Folders","inbox.inbox":"Inbox","inbox.sent":"Sent","inbox.drafts":"Drafts","inbox.trash":"Trash","inbox.spam":"Spam","inbox.starred":"Starred","inbox.to":"To","inbox.cc":"Cc","inbox.bcc":"Bcc","inbox.subject":"Subject","inbox.send":"Send","inbox.discard":"Discard","inbox.attachFile":"Attach file","kanban.addCard":"Add card","kanban.addColumn":"Add column","kanban.moveCard":"Move card","kanban.editCard":"Edit card","kanban.deleteCard":"Delete card","kanban.editColumn":"Edit column","kanban.deleteColumn":"Delete column","lang.en":"English","lang.pl":"Polish","lang.de":"German","lang.fr":"French","lang.es":"Spanish","lang.it":"Italian","lang.pt":"Portuguese","lang.nl":"Dutch","lang.sv":"Swedish","lang.no":"Norwegian","lang.da":"Danish","lang.fi":"Finnish","lang.cs":"Czech","lang.sk":"Slovak","lang.hu":"Hungarian","lang.ro":"Romanian","lang.bg":"Bulgarian","lang.uk":"Ukrainian","lang.ja":"Japanese","lang.ko":"Korean","lang.zh":"Chinese","lang.ar":"Arabic","login.username":"Username","login.password":"Password","login.signIn":"Sign in","login.signOut":"Sign out","login.forgotPassword":"Forgot password?","login.register":"Register","login.rememberMe":"Remember me","login.newPassword":"New password","login.confirmPassword":"Confirm password","login.twoFactor":"Two-factor authentication","password.strength":"Password strength","password.weak":"Weak","password.medium":"Medium","password.strong":"Strong","password.requirements":"Password requirements","pdfviewer.page":"Page","pdfviewer.of":"of","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Fit page","pdfviewer.fitWidth":"Fit width","pdfviewer.download":"Download","pdfviewer.print":"Print","pdfviewer.search":"Search in document","pdfviewer.bookmark":"Bookmarks","pdfviewer.thumbnail":"Thumbnails","picklist.available":"Available","picklist.selected":"Selected","picklist.addAll":"Add all","picklist.removeAll":"Remove all","picklist.filter":"Filter items","scheduling.calendar":"Calendar","scheduling.event":"Event","scheduling.allDay":"All day","scheduling.today":"Today","scheduling.week":"Week","scheduling.month":"Month","scheduling.year":"Year","scheduling.day":"Day","scheduling.agenda":"Agenda","scheduling.addEvent":"Add event","scheduling.editEvent":"Edit event","scheduling.deleteEvent":"Delete event","scheduling.noEvents":"No events","shortcuts.title":"Keyboard shortcuts","shortcuts.description":"Available shortcuts","shortcuts.key":"Key","shortcuts.command":"Command","shortcuts.search":"Search shortcuts","signature.clear":"Clear","signature.save":"Save","signature.sign":"Sign here","signature.draw":"Draw your signature","spreadsheet.cell":"Cell","spreadsheet.row":"Row","spreadsheet.column":"Column","spreadsheet.formula":"Formula","spreadsheet.insert":"Insert","spreadsheet.delete":"Delete","spreadsheet.sort":"Sort","spreadsheet.sortAsc":"Sort ascending","spreadsheet.sortDesc":"Sort descending","spreadsheet.filter":"Filter","spreadsheet.export":"Export","spreadsheet.import":"Import","spreadsheet.addRow":"Add row","spreadsheet.addColumn":"Add column","spreadsheet.deleteRow":"Delete row","spreadsheet.deleteColumn":"Delete column","spreadsheet.freezeRow":"Freeze row","spreadsheet.freezeColumn":"Freeze column","spreadsheet.merge":"Merge cells","spreadsheet.unmerge":"Unmerge cells","terminal.run":"Run","terminal.clear":"Clear","terminal.copy":"Copy","terminal.paste":"Paste","terminal.newSession":"New session","terminal.closeSession":"Close session","terminal.selectAll":"Select all","theme.light":"Light","theme.dark":"Dark","theme.system":"System","theme.custom":"Custom","theme.colors":"Colors","theme.fonts":"Fonts","theme.apply":"Apply theme","theme.preview":"Preview","theme.reset":"Reset to default","theme.gallery":"Theme gallery","users.profile":"Profile","users.settings":"Settings","users.permissions":"Permissions","users.role":"Role","users.active":"Active","users.inactive":"Inactive","users.online":"Online","users.offline":"Offline","users.lastSeen":"Last seen","wm.close":"Close","wm.minimize":"Minimize","wm.maximize":"Maximize","wm.restore":"Restore","wm.tile":"Tile windows","wm.cascade":"Cascade windows","wm.closeAll":"Close all","wm.minimizeAll":"Minimize all","wm.newWindow":"New window","wm.moveToFront":"Move to front","git.commit":"Commit","git.commits":"Commits","git.branch":"Branch","git.branches":"Branches","git.merge":"Merge","git.rebase":"Rebase","git.pull":"Pull","git.push":"Push","git.fetch":"Fetch","git.checkout":"Checkout","git.stash":"Stash","git.diff":"Diff","git.blame":"Blame","git.history":"History","git.conflict":"Conflict","git.resolve":"Resolve","git.createBranch":"Create branch","git.deleteBranch":"Delete branch","git.mergeRequest":"Merge request","git.pullRequest":"Pull request","pipeline.run":"Run pipeline","pipeline.stop":"Stop pipeline","pipeline.status":"Pipeline status","pipeline.logs":"Pipeline logs","pipeline.stages":"Stages","pipeline.jobs":"Jobs","pipeline.artifacts":"Artifacts","pipeline.trigger":"Trigger","pipeline.schedule":"Schedule","pipeline.manual":"Manual","devops.deploy":"Deploy","devops.rollback":"Rollback","devops.release":"Release","devops.environment":"Environment","dataBranching.environment":"Environment","dataBranching.environments":"Environments","dataBranching.dev":"Development","dataBranching.test":"Test","dataBranching.uat":"UAT","dataBranching.staging":"Staging","dataBranching.prod":"Production","dataBranching.snapshot":"Snapshot","dataBranching.createSnapshot":"Create snapshot","dataBranching.restoreSnapshot":"Restore snapshot","dataBranching.diff":"Data diff","dataBranching.compare":"Compare","dataBranching.merge":"Merge data","dataBranching.promote":"Promote","dataBranching.conflict":"Conflict","dataBranching.resolveConflict":"Resolve conflict","dataBranching.accept":"Accept","dataBranching.reject":"Reject","dataBranching.useSource":"Use source","dataBranching.useTarget":"Use target","dataBranching.entity":"Entity","dataBranching.entities":"Entities","dataBranching.record":"Record","dataBranching.records":"Records","dataBranching.changes":"Changes","dataBranching.added":"Added","dataBranching.modified":"Modified","dataBranching.deleted":"Deleted","dataBranching.unchanged":"Unchanged","dataBranching.status":"Status","dataBranching.synced":"Synced","dataBranching.pending":"Pending","dataBranching.inProgress":"In progress","dataBranching.completed":"Completed","dataBranching.failed":"Failed"},fo={ok:"OK",cancel:"Anuluj",save:"Zapisz",close:"Zamknij",delete:"Usuń",edit:"Edytuj",add:"Dodaj",remove:"Usuń",search:"Szukaj",filter:"Filtruj",refresh:"Odśwież",loading:"Ładowanie…",noData:"Brak danych",error:"Błąd",success:"Sukces",warning:"Ostrzeżenie",info:"Informacja",yes:"Tak",no:"Nie",confirm:"Potwierdź",back:"Wstecz",next:"Dalej",previous:"Poprzedni",finish:"Zakończ",submit:"Wyślij",reset:"Resetuj",apply:"Zastosuj",undo:"Cofnij",redo:"Ponów",copy:"Kopiuj",cut:"Wytnij",paste:"Wklej",selectAll:"Zaznacz wszystko",clear:"Wyczyść",upload:"Prześlij",download:"Pobierz",print:"Drukuj",export:"Eksportuj",import:"Importuj",settings:"Ustawienia",help:"Pomoc",about:"O programie",more:"Więcej",less:"Mniej",show:"Pokaż",hide:"Ukryj",expand:"Rozwiń",collapse:"Zwiń",enabled:"Włączony",disabled:"Wyłączony",required:"Wymagane",optional:"Opcjonalne",actions:"Akcje",details:"Szczegóły",overview:"Przegląd",all:"Wszystkie",none:"Żaden",selected:"Zaznaczono",total:"Razem",of:"z",items:"elementów",page:"Strona",rows:"Wiersze","app.name":"Aplikacja","app.version":"Wersja","app.about":"O programie","nav.home":"Strona główna","nav.back":"Wstecz","nav.forward":"Dalej","nav.menu":"Menu","nav.sidebar":"Panel boczny","nav.search":"Szukaj","nav.favorites":"Ulubione","nav.recent":"Ostatnie","nav.notifications":"Powiadomienia","nav.profile":"Profil","nav.logout":"Wyloguj się","carousel.prev":"Poprzedni slajd","carousel.next":"Następny slajd","carousel.slide":"Slajd","carousel.of":"z","carousel.autoplay":"Autoodtwarzanie","carousel.pause":"Pauza","confirm.yes":"Tak","confirm.no":"Nie","confirm.ok":"OK","confirm.cancel":"Anuluj","confirm.title":"Potwierdzenie","confirm.deleteMessage":"Czy na pewno chcesz to usunąć?","confirm.unsavedChanges":"Masz niezapisane zmiany. Odrzucić?","console.shell":"Powłoka","console.terminal":"Terminal","console.prompt":"Wpisz polecenie…","console.clear":"Wyczyść konsolę","console.run":"Uruchom","console.output":"Wyjście","console.newSession":"Nowa sesja","console.closeSession":"Zamknij sesję","controls.save":"Zapisz","controls.cancel":"Anuluj","controls.delete":"Usuń","controls.edit":"Edytuj","controls.add":"Dodaj","controls.remove":"Usuń","controls.close":"Zamknij","controls.open":"Otwórz","controls.refresh":"Odśwież","controls.new":"Nowy","controls.duplicate":"Duplikuj","controls.sort":"Sortuj","controls.group":"Grupuj","controls.pin":"Przypnij","controls.unpin":"Odepnij","controls.lock":"Zablokuj","controls.unlock":"Odblokuj","controls.share":"Udostępnij","controls.archive":"Archiwizuj","cookie.title":"Zgoda na pliki cookie","cookie.message":"Ta strona używa plików cookie.","cookie.accept":"Zaakceptuj wszystkie","cookie.reject":"Odrzuć wszystkie","cookie.settings":"Ustawienia cookie","cookie.necessary":"Niezbędne","cookie.analytics":"Analityczne","cookie.marketing":"Marketingowe","dashboard.title":"Pulpit","dashboard.addWidget":"Dodaj widżet","dashboard.removeWidget":"Usuń widżet","dashboard.layout":"Układ","dashboard.settings":"Ustawienia","dashboard.customize":"Dostosuj","dashboard.resetLayout":"Resetuj układ","datetime.today":"Dzisiaj","datetime.yesterday":"Wczoraj","datetime.tomorrow":"Jutro","datetime.selectDate":"Wybierz datę","datetime.selectTime":"Wybierz godzinę","datetime.startDate":"Data początkowa","datetime.endDate":"Data końcowa","datetime.startTime":"Godzina rozpoczęcia","datetime.endTime":"Godzina zakończenia","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Start","desktop.taskbar":"Pasek zadań","desktop.systemTray":"Zasobnik systemowy","desktop.wallpaper":"Tapeta","desktop.icons":"Ikony pulpitu","desktop.arrangeIcons":"Ułóż ikony","dock.pin":"Przypnij do doku","dock.unpin":"Odepnij z doku","dock.close":"Zamknij","dock.minimize":"Minimalizuj","dock.maximize":"Maksymalizuj","dock.restore":"Przywróć","docEditor.paragraph":"Akapit","docEditor.heading":"Nagłówek","docEditor.heading1":"Nagłówek 1","docEditor.heading2":"Nagłówek 2","docEditor.heading3":"Nagłówek 3","docEditor.bulletList":"Lista punktowana","docEditor.numberedList":"Lista numerowana","docEditor.quote":"Cytat","docEditor.code":"Blok kodu","docEditor.divider":"Separator","docEditor.image":"Obraz","docEditor.table":"Tabela","docEditor.callout":"Wyróżnienie","docEditor.placeholder":"Zacznij pisać…","docEditor.slashCommand":"Wpisz / aby zobaczyć komendy","files.upload":"Prześlij plik","files.download":"Pobierz","files.delete":"Usuń plik","files.rename":"Zmień nazwę","files.newFolder":"Nowy folder","files.selectFile":"Wybierz plik","files.dropzone":"Upuść pliki tutaj","files.dragDrop":"Przeciągnij i upuść pliki lub kliknij aby wybrać","files.maxSize":"Maksymalny rozmiar pliku","files.fileType":"Typ pliku","forms.required":"To pole jest wymagane","forms.optional":"Opcjonalne","forms.submit":"Wyślij","forms.reset":"Resetuj","forms.validate":"Zweryfikuj","forms.invalid":"Nieprawidłowa wartość","forms.minLength":"Minimalna długość: {0}","forms.maxLength":"Maksymalna długość: {0}","forms.email":"Podaj prawidłowy adres e-mail","forms.phone":"Podaj prawidłowy numer telefonu","imageEditor.crop":"Przytnij","imageEditor.rotate":"Obróć","imageEditor.flip":"Odbij","imageEditor.resize":"Zmień rozmiar","imageEditor.filter":"Filtr","imageEditor.draw":"Rysuj","imageEditor.text":"Tekst","imageEditor.undo":"Cofnij","imageEditor.redo":"Ponów","imageEditor.save":"Zapisz","imageEditor.brightness":"Jasność","imageEditor.contrast":"Kontrast","imageEditor.saturation":"Nasycenie","inbox.compose":"Nowa wiadomość","inbox.reply":"Odpowiedz","inbox.replyAll":"Odpowiedz wszystkim","inbox.forward":"Przekaż","inbox.delete":"Usuń","inbox.archive":"Archiwizuj","inbox.markRead":"Oznacz jako przeczytane","inbox.markUnread":"Oznacz jako nieprzeczytane","inbox.folders":"Foldery","inbox.inbox":"Odebrane","inbox.sent":"Wysłane","inbox.drafts":"Wersje robocze","inbox.trash":"Kosz","inbox.spam":"Spam","inbox.starred":"Oznaczone gwiazdką","inbox.to":"Do","inbox.cc":"DW","inbox.bcc":"UDW","inbox.subject":"Temat","inbox.send":"Wyślij","inbox.discard":"Odrzuć","inbox.attachFile":"Załącz plik","kanban.addCard":"Dodaj kartę","kanban.addColumn":"Dodaj kolumnę","kanban.moveCard":"Przenieś kartę","kanban.editCard":"Edytuj kartę","kanban.deleteCard":"Usuń kartę","kanban.editColumn":"Edytuj kolumnę","kanban.deleteColumn":"Usuń kolumnę","lang.en":"Angielski","lang.pl":"Polski","lang.de":"Niemiecki","lang.fr":"Francuski","lang.es":"Hiszpański","lang.it":"Włoski","lang.pt":"Portugalski","lang.nl":"Holenderski","lang.sv":"Szwedzki","lang.no":"Norweski","lang.da":"Duński","lang.fi":"Fiński","lang.cs":"Czeski","lang.sk":"Słowacki","lang.hu":"Węgierski","lang.ro":"Rumuński","lang.bg":"Bułgarski","lang.uk":"Ukraiński","lang.ja":"Japoński","lang.ko":"Koreański","lang.zh":"Chiński","lang.ar":"Arabski","login.username":"Nazwa użytkownika","login.password":"Hasło","login.signIn":"Zaloguj się","login.signOut":"Wyloguj się","login.forgotPassword":"Zapomniałeś hasła?","login.register":"Zarejestruj się","login.rememberMe":"Zapamiętaj mnie","login.newPassword":"Nowe hasło","login.confirmPassword":"Potwierdź hasło","login.twoFactor":"Uwierzytelnianie dwuskładnikowe","password.strength":"Siła hasła","password.weak":"Słabe","password.medium":"Średnie","password.strong":"Silne","password.requirements":"Wymagania dotyczące hasła","pdfviewer.page":"Strona","pdfviewer.of":"z","pdfviewer.zoom":"Powiększenie","pdfviewer.fitPage":"Dopasuj stronę","pdfviewer.fitWidth":"Dopasuj szerokość","pdfviewer.download":"Pobierz","pdfviewer.print":"Drukuj","pdfviewer.search":"Szukaj w dokumencie","pdfviewer.bookmark":"Zakładki","pdfviewer.thumbnail":"Miniatury","picklist.available":"Dostępne","picklist.selected":"Wybrane","picklist.addAll":"Dodaj wszystkie","picklist.removeAll":"Usuń wszystkie","picklist.filter":"Filtruj elementy","scheduling.calendar":"Kalendarz","scheduling.event":"Wydarzenie","scheduling.allDay":"Cały dzień","scheduling.today":"Dzisiaj","scheduling.week":"Tydzień","scheduling.month":"Miesiąc","scheduling.year":"Rok","scheduling.day":"Dzień","scheduling.agenda":"Agenda","scheduling.addEvent":"Dodaj wydarzenie","scheduling.editEvent":"Edytuj wydarzenie","scheduling.deleteEvent":"Usuń wydarzenie","scheduling.noEvents":"Brak wydarzeń","shortcuts.title":"Skróty klawiszowe","shortcuts.description":"Dostępne skróty","shortcuts.key":"Klawisz","shortcuts.command":"Polecenie","shortcuts.search":"Szukaj skrótów","signature.clear":"Wyczyść","signature.save":"Zapisz","signature.sign":"Podpisz tutaj","signature.draw":"Narysuj swój podpis","spreadsheet.cell":"Komórka","spreadsheet.row":"Wiersz","spreadsheet.column":"Kolumna","spreadsheet.formula":"Formuła","spreadsheet.insert":"Wstaw","spreadsheet.delete":"Usuń","spreadsheet.sort":"Sortuj","spreadsheet.sortAsc":"Sortuj rosnąco","spreadsheet.sortDesc":"Sortuj malejąco","spreadsheet.filter":"Filtruj","spreadsheet.export":"Eksportuj","spreadsheet.import":"Importuj","spreadsheet.addRow":"Dodaj wiersz","spreadsheet.addColumn":"Dodaj kolumnę","spreadsheet.deleteRow":"Usuń wiersz","spreadsheet.deleteColumn":"Usuń kolumnę","spreadsheet.freezeRow":"Zamroź wiersz","spreadsheet.freezeColumn":"Zamroź kolumnę","spreadsheet.merge":"Scal komórki","spreadsheet.unmerge":"Rozdziel komórki","terminal.run":"Uruchom","terminal.clear":"Wyczyść","terminal.copy":"Kopiuj","terminal.paste":"Wklej","terminal.newSession":"Nowa sesja","terminal.closeSession":"Zamknij sesję","terminal.selectAll":"Zaznacz wszystko","theme.light":"Jasny","theme.dark":"Ciemny","theme.system":"Systemowy","theme.custom":"Własny","theme.colors":"Kolory","theme.fonts":"Czcionki","theme.apply":"Zastosuj motyw","theme.preview":"Podgląd","theme.reset":"Przywróć domyślne","theme.gallery":"Galeria motywów","users.profile":"Profil","users.settings":"Ustawienia","users.permissions":"Uprawnienia","users.role":"Rola","users.active":"Aktywny","users.inactive":"Nieaktywny","users.online":"Online","users.offline":"Offline","users.lastSeen":"Ostatnio widziano","wm.close":"Zamknij","wm.minimize":"Minimalizuj","wm.maximize":"Maksymalizuj","wm.restore":"Przywróć","wm.tile":"Ułóż kafelkowo","wm.cascade":"Ułóż kaskadowo","wm.closeAll":"Zamknij wszystkie","wm.minimizeAll":"Minimalizuj wszystkie","wm.newWindow":"Nowe okno","wm.moveToFront":"Na wierzch","git.commit":"Commit","git.commits":"Commity","git.branch":"Gałąź","git.branches":"Gałęzie","git.merge":"Scal","git.rebase":"Rebase","git.pull":"Pobierz","git.push":"Wyślij","git.fetch":"Pobierz","git.checkout":"Przełącz","git.stash":"Schowek","git.diff":"Różnice","git.blame":"Blame","git.history":"Historia","git.conflict":"Konflikt","git.resolve":"Rozwiąż","git.createBranch":"Utwórz gałąź","git.deleteBranch":"Usuń gałąź","git.mergeRequest":"Żądanie scalenia","git.pullRequest":"Pull request","pipeline.run":"Uruchom pipeline","pipeline.stop":"Zatrzymaj pipeline","pipeline.status":"Status pipeline","pipeline.logs":"Logi pipeline","pipeline.stages":"Etapy","pipeline.jobs":"Zadania","pipeline.artifacts":"Artefakty","pipeline.trigger":"Wyzwalacz","pipeline.schedule":"Harmonogram","pipeline.manual":"Ręczny","devops.deploy":"Wdróż","devops.rollback":"Wycofaj","devops.release":"Wydanie","devops.environment":"Środowisko","dataBranching.environment":"Środowisko","dataBranching.environments":"Środowiska","dataBranching.dev":"Development","dataBranching.test":"Test","dataBranching.uat":"UAT","dataBranching.staging":"Staging","dataBranching.prod":"Produkcja","dataBranching.snapshot":"Migawka","dataBranching.createSnapshot":"Utwórz migawkę","dataBranching.restoreSnapshot":"Przywróć migawkę","dataBranching.diff":"Różnice danych","dataBranching.compare":"Porównaj","dataBranching.merge":"Scal dane","dataBranching.promote":"Promuj","dataBranching.conflict":"Konflikt","dataBranching.resolveConflict":"Rozwiąż konflikt","dataBranching.accept":"Akceptuj","dataBranching.reject":"Odrzuć","dataBranching.useSource":"Użyj źródła","dataBranching.useTarget":"Użyj celu","dataBranching.entity":"Encja","dataBranching.entities":"Encje","dataBranching.record":"Rekord","dataBranching.records":"Rekordy","dataBranching.changes":"Zmiany","dataBranching.added":"Dodano","dataBranching.modified":"Zmodyfikowano","dataBranching.deleted":"Usunięto","dataBranching.unchanged":"Bez zmian","dataBranching.status":"Status","dataBranching.synced":"Zsynchronizowano","dataBranching.pending":"Oczekuje","dataBranching.inProgress":"W trakcie","dataBranching.completed":"Zakończono","dataBranching.failed":"Niepowodzenie"},go={ok:"OK",cancel:"Abbrechen",save:"Speichern",close:"Schließen",delete:"Löschen",edit:"Bearbeiten",add:"Hinzufügen",remove:"Entfernen",search:"Suchen",filter:"Filtern",refresh:"Aktualisieren",loading:"Laden…",noData:"Keine Daten",error:"Fehler",success:"Erfolg",warning:"Warnung",info:"Information",yes:"Ja",no:"Nein",confirm:"Bestätigen",back:"Zurück",next:"Weiter",previous:"Vorherige",finish:"Fertig",submit:"Absenden",reset:"Zurücksetzen",apply:"Anwenden",undo:"Rückgängig",redo:"Wiederholen",copy:"Kopieren",cut:"Ausschneiden",paste:"Einfügen",selectAll:"Alle auswählen",clear:"Löschen",upload:"Hochladen",download:"Herunterladen",print:"Drucken",export:"Exportieren",import:"Importieren",settings:"Einstellungen",help:"Hilfe",about:"Über",more:"Mehr",less:"Weniger",show:"Anzeigen",hide:"Ausblenden",expand:"Erweitern",collapse:"Einklappen",enabled:"Aktiviert",disabled:"Deaktiviert",required:"Erforderlich",optional:"Optional",actions:"Aktionen",details:"Details",overview:"Übersicht",all:"Alle",none:"Keine",selected:"Ausgewählt",total:"Gesamt",of:"von",items:"Einträge",page:"Seite",rows:"Zeilen","app.name":"Anwendung","app.version":"Version","app.about":"Über","nav.home":"Startseite","nav.back":"Zurück","nav.forward":"Vorwärts","nav.menu":"Menü","nav.sidebar":"Seitenleiste","nav.search":"Suchen","nav.favorites":"Favoriten","nav.recent":"Zuletzt","nav.notifications":"Benachrichtigungen","nav.profile":"Profil","nav.logout":"Abmelden","carousel.prev":"Vorherige Folie","carousel.next":"Nächste Folie","carousel.slide":"Folie","carousel.of":"von","carousel.autoplay":"Automatisch abspielen","carousel.pause":"Pause","confirm.yes":"Ja","confirm.no":"Nein","confirm.ok":"OK","confirm.cancel":"Abbrechen","confirm.title":"Bestätigung","confirm.deleteMessage":"Möchten Sie dies wirklich löschen?","confirm.unsavedChanges":"Ungespeicherte Änderungen. Verwerfen?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Befehl eingeben…","console.clear":"Konsole leeren","console.run":"Ausführen","console.output":"Ausgabe","console.newSession":"Neue Sitzung","console.closeSession":"Sitzung schließen","controls.save":"Speichern","controls.cancel":"Abbrechen","controls.delete":"Löschen","controls.edit":"Bearbeiten","controls.add":"Hinzufügen","controls.remove":"Entfernen","controls.close":"Schließen","controls.open":"Öffnen","controls.refresh":"Aktualisieren","controls.new":"Neu","controls.duplicate":"Duplizieren","controls.sort":"Sortieren","controls.group":"Gruppieren","controls.pin":"Anheften","controls.unpin":"Lösen","controls.lock":"Sperren","controls.unlock":"Entsperren","controls.share":"Teilen","controls.archive":"Archivieren","cookie.title":"Cookie-Einwilligung","cookie.message":"Diese Website verwendet Cookies.","cookie.accept":"Alle akzeptieren","cookie.reject":"Alle ablehnen","cookie.settings":"Cookie-Einstellungen","cookie.necessary":"Erforderlich","cookie.analytics":"Analyse","cookie.marketing":"Marketing","dashboard.title":"Dashboard","dashboard.addWidget":"Widget hinzufügen","dashboard.removeWidget":"Widget entfernen","dashboard.layout":"Layout","dashboard.settings":"Einstellungen","dashboard.customize":"Anpassen","dashboard.resetLayout":"Layout zurücksetzen","datetime.today":"Heute","datetime.yesterday":"Gestern","datetime.tomorrow":"Morgen","datetime.selectDate":"Datum auswählen","datetime.selectTime":"Uhrzeit auswählen","datetime.startDate":"Startdatum","datetime.endDate":"Enddatum","datetime.startTime":"Startzeit","datetime.endTime":"Endzeit","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Start","desktop.taskbar":"Taskleiste","desktop.systemTray":"Systemleiste","desktop.wallpaper":"Hintergrundbild","desktop.icons":"Desktop-Symbole","desktop.arrangeIcons":"Symbole anordnen","dock.pin":"An Dock anheften","dock.unpin":"Vom Dock lösen","dock.close":"Schließen","dock.minimize":"Minimieren","dock.maximize":"Maximieren","dock.restore":"Wiederherstellen","docEditor.paragraph":"Absatz","docEditor.heading":"Überschrift","docEditor.heading1":"Überschrift 1","docEditor.heading2":"Überschrift 2","docEditor.heading3":"Überschrift 3","docEditor.bulletList":"Aufzählungsliste","docEditor.numberedList":"Nummerierte Liste","docEditor.quote":"Zitat","docEditor.code":"Codeblock","docEditor.divider":"Trennlinie","docEditor.image":"Bild","docEditor.table":"Tabelle","docEditor.callout":"Hervorhebung","docEditor.placeholder":"Schreiben Sie los…","docEditor.slashCommand":"Tippen Sie / für Befehle","files.upload":"Datei hochladen","files.download":"Herunterladen","files.delete":"Datei löschen","files.rename":"Umbenennen","files.newFolder":"Neuer Ordner","files.selectFile":"Datei auswählen","files.dropzone":"Dateien hier ablegen","files.dragDrop":"Dateien hierher ziehen oder klicken","files.maxSize":"Maximale Dateigröße","files.fileType":"Dateityp","forms.required":"Dieses Feld ist erforderlich","forms.optional":"Optional","forms.submit":"Absenden","forms.reset":"Zurücksetzen","forms.validate":"Validieren","forms.invalid":"Ungültiger Wert","forms.minLength":"Mindestlänge: {0}","forms.maxLength":"Maximallänge: {0}","forms.email":"Gültige E-Mail eingeben","forms.phone":"Gültige Telefonnummer eingeben","imageEditor.crop":"Zuschneiden","imageEditor.rotate":"Drehen","imageEditor.flip":"Spiegeln","imageEditor.resize":"Größe ändern","imageEditor.filter":"Filter","imageEditor.draw":"Zeichnen","imageEditor.text":"Text","imageEditor.undo":"Rückgängig","imageEditor.redo":"Wiederholen","imageEditor.save":"Speichern","imageEditor.brightness":"Helligkeit","imageEditor.contrast":"Kontrast","imageEditor.saturation":"Sättigung","inbox.compose":"Verfassen","inbox.reply":"Antworten","inbox.replyAll":"Allen antworten","inbox.forward":"Weiterleiten","inbox.delete":"Löschen","inbox.archive":"Archivieren","inbox.markRead":"Als gelesen markieren","inbox.markUnread":"Als ungelesen markieren","inbox.folders":"Ordner","inbox.inbox":"Posteingang","inbox.sent":"Gesendet","inbox.drafts":"Entwürfe","inbox.trash":"Papierkorb","inbox.spam":"Spam","inbox.starred":"Markiert","inbox.to":"An","inbox.cc":"Cc","inbox.bcc":"Bcc","inbox.subject":"Betreff","inbox.send":"Senden","inbox.discard":"Verwerfen","inbox.attachFile":"Datei anhängen","kanban.addCard":"Karte hinzufügen","kanban.addColumn":"Spalte hinzufügen","kanban.moveCard":"Karte verschieben","kanban.editCard":"Karte bearbeiten","kanban.deleteCard":"Karte löschen","kanban.editColumn":"Spalte bearbeiten","kanban.deleteColumn":"Spalte löschen","lang.en":"Englisch","lang.pl":"Polnisch","lang.de":"Deutsch","lang.fr":"Französisch","lang.es":"Spanisch","lang.it":"Italienisch","lang.pt":"Portugiesisch","lang.nl":"Niederländisch","lang.sv":"Schwedisch","lang.no":"Norwegisch","lang.da":"Dänisch","lang.fi":"Finnisch","lang.cs":"Tschechisch","lang.sk":"Slowakisch","lang.hu":"Ungarisch","lang.ro":"Rumänisch","lang.bg":"Bulgarisch","lang.uk":"Ukrainisch","lang.ja":"Japanisch","lang.ko":"Koreanisch","lang.zh":"Chinesisch","lang.ar":"Arabisch","login.username":"Benutzername","login.password":"Passwort","login.signIn":"Anmelden","login.signOut":"Abmelden","login.forgotPassword":"Passwort vergessen?","login.register":"Registrieren","login.rememberMe":"Angemeldet bleiben","login.newPassword":"Neues Passwort","login.confirmPassword":"Passwort bestätigen","login.twoFactor":"Zwei-Faktor-Authentifizierung","password.strength":"Passwortstärke","password.weak":"Schwach","password.medium":"Mittel","password.strong":"Stark","password.requirements":"Passwortanforderungen","pdfviewer.page":"Seite","pdfviewer.of":"von","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Seite einpassen","pdfviewer.fitWidth":"Breite einpassen","pdfviewer.download":"Herunterladen","pdfviewer.print":"Drucken","pdfviewer.search":"Im Dokument suchen","pdfviewer.bookmark":"Lesezeichen","pdfviewer.thumbnail":"Miniaturansichten","picklist.available":"Verfügbar","picklist.selected":"Ausgewählt","picklist.addAll":"Alle hinzufügen","picklist.removeAll":"Alle entfernen","picklist.filter":"Einträge filtern","scheduling.calendar":"Kalender","scheduling.event":"Termin","scheduling.allDay":"Ganztägig","scheduling.today":"Heute","scheduling.week":"Woche","scheduling.month":"Monat","scheduling.year":"Jahr","scheduling.day":"Tag","scheduling.agenda":"Agenda","scheduling.addEvent":"Termin hinzufügen","scheduling.editEvent":"Termin bearbeiten","scheduling.deleteEvent":"Termin löschen","scheduling.noEvents":"Keine Termine","shortcuts.title":"Tastenkombinationen","shortcuts.description":"Verfügbare Tastenkombinationen","shortcuts.key":"Taste","shortcuts.command":"Befehl","shortcuts.search":"Tastenkombinationen suchen","signature.clear":"Löschen","signature.save":"Speichern","signature.sign":"Hier unterschreiben","signature.draw":"Unterschrift zeichnen","spreadsheet.cell":"Zelle","spreadsheet.row":"Zeile","spreadsheet.column":"Spalte","spreadsheet.formula":"Formel","spreadsheet.insert":"Einfügen","spreadsheet.delete":"Löschen","spreadsheet.sort":"Sortieren","spreadsheet.sortAsc":"Aufsteigend sortieren","spreadsheet.sortDesc":"Absteigend sortieren","spreadsheet.filter":"Filtern","spreadsheet.export":"Exportieren","spreadsheet.import":"Importieren","spreadsheet.addRow":"Zeile hinzufügen","spreadsheet.addColumn":"Spalte hinzufügen","spreadsheet.deleteRow":"Zeile löschen","spreadsheet.deleteColumn":"Spalte löschen","spreadsheet.freezeRow":"Zeile einfrieren","spreadsheet.freezeColumn":"Spalte einfrieren","spreadsheet.merge":"Zellen zusammenführen","spreadsheet.unmerge":"Zellen trennen","terminal.run":"Ausführen","terminal.clear":"Leeren","terminal.copy":"Kopieren","terminal.paste":"Einfügen","terminal.newSession":"Neue Sitzung","terminal.closeSession":"Sitzung schließen","terminal.selectAll":"Alles auswählen","theme.light":"Hell","theme.dark":"Dunkel","theme.system":"System","theme.custom":"Benutzerdefiniert","theme.colors":"Farben","theme.fonts":"Schriftarten","theme.apply":"Design anwenden","theme.preview":"Vorschau","theme.reset":"Standard wiederherstellen","theme.gallery":"Design-Galerie","users.profile":"Profil","users.settings":"Einstellungen","users.permissions":"Berechtigungen","users.role":"Rolle","users.active":"Aktiv","users.inactive":"Inaktiv","users.online":"Online","users.offline":"Offline","users.lastSeen":"Zuletzt gesehen","wm.close":"Schließen","wm.minimize":"Minimieren","wm.maximize":"Maximieren","wm.restore":"Wiederherstellen","wm.tile":"Fenster kacheln","wm.cascade":"Fenster kaskadieren","wm.closeAll":"Alle schließen","wm.minimizeAll":"Alle minimieren","wm.newWindow":"Neues Fenster","wm.moveToFront":"In den Vordergrund","git.commit":"Commit","git.commits":"Commits","git.branch":"Branch","git.branches":"Branches","git.merge":"Zusammenführen","git.rebase":"Rebase","git.pull":"Pull","git.push":"Push","git.fetch":"Fetch","git.checkout":"Auschecken","git.stash":"Stash","git.diff":"Diff","git.blame":"Blame","git.history":"Verlauf","git.conflict":"Konflikt","git.resolve":"Auflösen","git.createBranch":"Branch erstellen","git.deleteBranch":"Branch löschen","git.mergeRequest":"Merge Request","git.pullRequest":"Pull Request","pipeline.run":"Pipeline starten","pipeline.stop":"Pipeline stoppen","pipeline.status":"Pipeline-Status","pipeline.logs":"Pipeline-Protokolle","pipeline.stages":"Phasen","pipeline.jobs":"Jobs","pipeline.artifacts":"Artefakte","pipeline.trigger":"Auslöser","pipeline.schedule":"Zeitplan","pipeline.manual":"Manuell","devops.deploy":"Bereitstellen","devops.rollback":"Zurücksetzen","devops.release":"Release","devops.environment":"Umgebung","dataBranching.environment":"Umgebung","dataBranching.environments":"Umgebungen","dataBranching.dev":"Entwicklung","dataBranching.test":"Test","dataBranching.uat":"UAT","dataBranching.staging":"Staging","dataBranching.prod":"Produktion","dataBranching.snapshot":"Snapshot","dataBranching.createSnapshot":"Snapshot erstellen","dataBranching.restoreSnapshot":"Snapshot wiederherstellen","dataBranching.diff":"Daten-Diff","dataBranching.compare":"Vergleichen","dataBranching.merge":"Daten zusammenführen","dataBranching.promote":"Hochstufen","dataBranching.conflict":"Konflikt","dataBranching.resolveConflict":"Konflikt auflösen","dataBranching.accept":"Akzeptieren","dataBranching.reject":"Ablehnen","dataBranching.useSource":"Quelle verwenden","dataBranching.useTarget":"Ziel verwenden","dataBranching.entity":"Entität","dataBranching.entities":"Entitäten","dataBranching.record":"Datensatz","dataBranching.records":"Datensätze","dataBranching.changes":"Änderungen","dataBranching.added":"Hinzugefügt","dataBranching.modified":"Geändert","dataBranching.deleted":"Gelöscht","dataBranching.unchanged":"Unverändert","dataBranching.status":"Status","dataBranching.synced":"Synchronisiert","dataBranching.pending":"Ausstehend","dataBranching.inProgress":"In Bearbeitung","dataBranching.completed":"Abgeschlossen","dataBranching.failed":"Fehlgeschlagen"},yo={ok:"OK",cancel:"Annuler",save:"Enregistrer",close:"Fermer",delete:"Supprimer",edit:"Modifier",add:"Ajouter",remove:"Retirer",search:"Rechercher",filter:"Filtrer",refresh:"Actualiser",loading:"Chargement…",noData:"Aucune donnée",error:"Erreur",success:"Succès",warning:"Avertissement",info:"Information",yes:"Oui",no:"Non",confirm:"Confirmer",back:"Retour",next:"Suivant",previous:"Précédent",finish:"Terminer",submit:"Soumettre",reset:"Réinitialiser",apply:"Appliquer",undo:"Annuler",redo:"Rétablir",copy:"Copier",cut:"Couper",paste:"Coller",selectAll:"Tout sélectionner",clear:"Effacer",upload:"Télécharger",download:"Télécharger",print:"Imprimer",export:"Exporter",import:"Importer",settings:"Paramètres",help:"Aide",about:"À propos",more:"Plus",less:"Moins",show:"Afficher",hide:"Masquer",expand:"Développer",collapse:"Réduire",enabled:"Activé",disabled:"Désactivé",required:"Obligatoire",optional:"Facultatif",actions:"Actions",details:"Détails",overview:"Aperçu",all:"Tous",none:"Aucun",selected:"Sélectionné",total:"Total",of:"de",items:"éléments",page:"Page",rows:"Lignes","app.name":"Application","app.version":"Version","app.about":"À propos","nav.home":"Accueil","nav.back":"Retour","nav.forward":"Suivant","nav.menu":"Menu","nav.sidebar":"Barre latérale","nav.search":"Rechercher","nav.favorites":"Favoris","nav.recent":"Récent","nav.notifications":"Notifications","nav.profile":"Profil","nav.logout":"Déconnexion","carousel.prev":"Diapo précédente","carousel.next":"Diapo suivante","carousel.slide":"Diapo","carousel.of":"de","carousel.autoplay":"Lecture auto","carousel.pause":"Pause","confirm.yes":"Oui","confirm.no":"Non","confirm.ok":"OK","confirm.cancel":"Annuler","confirm.title":"Confirmation","confirm.deleteMessage":"Voulez-vous vraiment supprimer ceci ?","confirm.unsavedChanges":"Modifications non enregistrées. Abandonner ?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Entrez une commande…","console.clear":"Effacer la console","console.run":"Exécuter","console.output":"Sortie","console.newSession":"Nouvelle session","console.closeSession":"Fermer la session","controls.save":"Enregistrer","controls.cancel":"Annuler","controls.delete":"Supprimer","controls.edit":"Modifier","controls.add":"Ajouter","controls.remove":"Retirer","controls.close":"Fermer","controls.open":"Ouvrir","controls.refresh":"Actualiser","controls.new":"Nouveau","controls.duplicate":"Dupliquer","controls.sort":"Trier","controls.group":"Grouper","controls.pin":"Épingler","controls.unpin":"Désépingler","controls.lock":"Verrouiller","controls.unlock":"Déverrouiller","controls.share":"Partager","controls.archive":"Archiver","cookie.title":"Consentement aux cookies","cookie.message":"Ce site utilise des cookies.","cookie.accept":"Tout accepter","cookie.reject":"Tout refuser","cookie.settings":"Paramètres des cookies","cookie.necessary":"Nécessaires","cookie.analytics":"Analytiques","cookie.marketing":"Marketing","dashboard.title":"Tableau de bord","dashboard.addWidget":"Ajouter un widget","dashboard.removeWidget":"Supprimer le widget","dashboard.layout":"Disposition","dashboard.settings":"Paramètres","dashboard.customize":"Personnaliser","dashboard.resetLayout":"Réinitialiser la disposition","datetime.today":"Aujourd'hui","datetime.yesterday":"Hier","datetime.tomorrow":"Demain","datetime.selectDate":"Sélectionner une date","datetime.selectTime":"Sélectionner une heure","datetime.startDate":"Date de début","datetime.endDate":"Date de fin","datetime.startTime":"Heure de début","datetime.endTime":"Heure de fin","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Démarrer","desktop.taskbar":"Barre des tâches","desktop.systemTray":"Zone de notification","desktop.wallpaper":"Fond d'écran","desktop.icons":"Icônes du bureau","desktop.arrangeIcons":"Organiser les icônes","dock.pin":"Épingler au dock","dock.unpin":"Désépingler du dock","dock.close":"Fermer","dock.minimize":"Réduire","dock.maximize":"Agrandir","dock.restore":"Restaurer","docEditor.paragraph":"Paragraphe","docEditor.heading":"Titre","docEditor.heading1":"Titre 1","docEditor.heading2":"Titre 2","docEditor.heading3":"Titre 3","docEditor.bulletList":"Liste à puces","docEditor.numberedList":"Liste numérotée","docEditor.quote":"Citation","docEditor.code":"Bloc de code","docEditor.divider":"Séparateur","docEditor.image":"Image","docEditor.table":"Tableau","docEditor.callout":"Encadré","docEditor.placeholder":"Commencez à écrire…","docEditor.slashCommand":"Tapez / pour les commandes","files.upload":"Envoyer un fichier","files.download":"Télécharger","files.delete":"Supprimer le fichier","files.rename":"Renommer","files.newFolder":"Nouveau dossier","files.selectFile":"Sélectionner un fichier","files.dropzone":"Déposez les fichiers ici","files.dragDrop":"Glissez-déposez les fichiers ou cliquez","files.maxSize":"Taille maximale du fichier","files.fileType":"Type de fichier","forms.required":"Ce champ est obligatoire","forms.optional":"Facultatif","forms.submit":"Soumettre","forms.reset":"Réinitialiser","forms.validate":"Valider","forms.invalid":"Valeur invalide","forms.minLength":"Longueur minimale : {0}","forms.maxLength":"Longueur maximale : {0}","forms.email":"Saisissez un e-mail valide","forms.phone":"Saisissez un numéro valide","imageEditor.crop":"Recadrer","imageEditor.rotate":"Pivoter","imageEditor.flip":"Retourner","imageEditor.resize":"Redimensionner","imageEditor.filter":"Filtre","imageEditor.draw":"Dessiner","imageEditor.text":"Texte","imageEditor.undo":"Annuler","imageEditor.redo":"Rétablir","imageEditor.save":"Enregistrer","imageEditor.brightness":"Luminosité","imageEditor.contrast":"Contraste","imageEditor.saturation":"Saturation","inbox.compose":"Rédiger","inbox.reply":"Répondre","inbox.replyAll":"Répondre à tous","inbox.forward":"Transférer","inbox.delete":"Supprimer","inbox.archive":"Archiver","inbox.markRead":"Marquer comme lu","inbox.markUnread":"Marquer comme non lu","inbox.folders":"Dossiers","inbox.inbox":"Boîte de réception","inbox.sent":"Envoyés","inbox.drafts":"Brouillons","inbox.trash":"Corbeille","inbox.spam":"Spam","inbox.starred":"Favoris","inbox.to":"À","inbox.cc":"Cc","inbox.bcc":"Cci","inbox.subject":"Objet","inbox.send":"Envoyer","inbox.discard":"Annuler","inbox.attachFile":"Joindre un fichier","kanban.addCard":"Ajouter une carte","kanban.addColumn":"Ajouter une colonne","kanban.moveCard":"Déplacer la carte","kanban.editCard":"Modifier la carte","kanban.deleteCard":"Supprimer la carte","kanban.editColumn":"Modifier la colonne","kanban.deleteColumn":"Supprimer la colonne","lang.en":"Anglais","lang.pl":"Polonais","lang.de":"Allemand","lang.fr":"Français","lang.es":"Espagnol","lang.it":"Italien","lang.pt":"Portugais","lang.nl":"Néerlandais","lang.sv":"Suédois","lang.no":"Norvégien","lang.da":"Danois","lang.fi":"Finnois","lang.cs":"Tchèque","lang.sk":"Slovaque","lang.hu":"Hongrois","lang.ro":"Roumain","lang.bg":"Bulgare","lang.uk":"Ukrainien","lang.ja":"Japonais","lang.ko":"Coréen","lang.zh":"Chinois","lang.ar":"Arabe","login.username":"Nom d'utilisateur","login.password":"Mot de passe","login.signIn":"Se connecter","login.signOut":"Se déconnecter","login.forgotPassword":"Mot de passe oublié ?","login.register":"S'inscrire","login.rememberMe":"Se souvenir de moi","login.newPassword":"Nouveau mot de passe","login.confirmPassword":"Confirmer le mot de passe","login.twoFactor":"Authentification à deux facteurs","password.strength":"Force du mot de passe","password.weak":"Faible","password.medium":"Moyen","password.strong":"Fort","password.requirements":"Exigences du mot de passe","pdfviewer.page":"Page","pdfviewer.of":"de","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Ajuster à la page","pdfviewer.fitWidth":"Ajuster à la largeur","pdfviewer.download":"Télécharger","pdfviewer.print":"Imprimer","pdfviewer.search":"Rechercher dans le document","pdfviewer.bookmark":"Signets","pdfviewer.thumbnail":"Miniatures","picklist.available":"Disponible","picklist.selected":"Sélectionné","picklist.addAll":"Tout ajouter","picklist.removeAll":"Tout retirer","picklist.filter":"Filtrer les éléments","scheduling.calendar":"Calendrier","scheduling.event":"Événement","scheduling.allDay":"Toute la journée","scheduling.today":"Aujourd'hui","scheduling.week":"Semaine","scheduling.month":"Mois","scheduling.year":"Année","scheduling.day":"Jour","scheduling.agenda":"Agenda","scheduling.addEvent":"Ajouter un événement","scheduling.editEvent":"Modifier l'événement","scheduling.deleteEvent":"Supprimer l'événement","scheduling.noEvents":"Aucun événement","shortcuts.title":"Raccourcis clavier","shortcuts.description":"Raccourcis disponibles","shortcuts.key":"Touche","shortcuts.command":"Commande","shortcuts.search":"Rechercher des raccourcis","signature.clear":"Effacer","signature.save":"Enregistrer","signature.sign":"Signez ici","signature.draw":"Dessinez votre signature","spreadsheet.cell":"Cellule","spreadsheet.row":"Ligne","spreadsheet.column":"Colonne","spreadsheet.formula":"Formule","spreadsheet.insert":"Insérer","spreadsheet.delete":"Supprimer","spreadsheet.sort":"Trier","spreadsheet.sortAsc":"Tri croissant","spreadsheet.sortDesc":"Tri décroissant","spreadsheet.filter":"Filtrer","spreadsheet.export":"Exporter","spreadsheet.import":"Importer","spreadsheet.addRow":"Ajouter une ligne","spreadsheet.addColumn":"Ajouter une colonne","spreadsheet.deleteRow":"Supprimer la ligne","spreadsheet.deleteColumn":"Supprimer la colonne","spreadsheet.freezeRow":"Figer la ligne","spreadsheet.freezeColumn":"Figer la colonne","spreadsheet.merge":"Fusionner les cellules","spreadsheet.unmerge":"Scinder les cellules","terminal.run":"Exécuter","terminal.clear":"Effacer","terminal.copy":"Copier","terminal.paste":"Coller","terminal.newSession":"Nouvelle session","terminal.closeSession":"Fermer la session","terminal.selectAll":"Tout sélectionner","theme.light":"Clair","theme.dark":"Sombre","theme.system":"Système","theme.custom":"Personnalisé","theme.colors":"Couleurs","theme.fonts":"Polices","theme.apply":"Appliquer le thème","theme.preview":"Aperçu","theme.reset":"Réinitialiser","theme.gallery":"Galerie de thèmes","users.profile":"Profil","users.settings":"Paramètres","users.permissions":"Autorisations","users.role":"Rôle","users.active":"Actif","users.inactive":"Inactif","users.online":"En ligne","users.offline":"Hors ligne","users.lastSeen":"Dernière connexion","wm.close":"Fermer","wm.minimize":"Réduire","wm.maximize":"Agrandir","wm.restore":"Restaurer","wm.tile":"Fenêtres en mosaïque","wm.cascade":"Fenêtres en cascade","wm.closeAll":"Tout fermer","wm.minimizeAll":"Tout réduire","wm.newWindow":"Nouvelle fenêtre","wm.moveToFront":"Au premier plan","git.commit":"Commit","git.commits":"Commits","git.branch":"Branche","git.branches":"Branches","git.merge":"Fusionner","git.rebase":"Rebase","git.pull":"Tirer","git.push":"Pousser","git.fetch":"Récupérer","git.checkout":"Extraire","git.stash":"Remiser","git.diff":"Diff","git.blame":"Blame","git.history":"Historique","git.conflict":"Conflit","git.resolve":"Résoudre","git.createBranch":"Créer une branche","git.deleteBranch":"Supprimer la branche","git.mergeRequest":"Merge Request","git.pullRequest":"Pull Request","pipeline.run":"Exécuter le pipeline","pipeline.stop":"Arrêter le pipeline","pipeline.status":"Statut du pipeline","pipeline.logs":"Journaux du pipeline","pipeline.stages":"Étapes","pipeline.jobs":"Tâches","pipeline.artifacts":"Artefacts","pipeline.trigger":"Déclencheur","pipeline.schedule":"Planification","pipeline.manual":"Manuel","devops.deploy":"Déployer","devops.rollback":"Restaurer","devops.release":"Version","devops.environment":"Environnement","dataBranching.environment":"Environnement","dataBranching.environments":"Environnements","dataBranching.dev":"Développement","dataBranching.test":"Test","dataBranching.uat":"UAT","dataBranching.staging":"Pré-production","dataBranching.prod":"Production","dataBranching.snapshot":"Instantané","dataBranching.createSnapshot":"Créer un instantané","dataBranching.restoreSnapshot":"Restaurer l'instantané","dataBranching.diff":"Diff des données","dataBranching.compare":"Comparer","dataBranching.merge":"Fusionner les données","dataBranching.promote":"Promouvoir","dataBranching.conflict":"Conflit","dataBranching.resolveConflict":"Résoudre le conflit","dataBranching.accept":"Accepter","dataBranching.reject":"Rejeter","dataBranching.useSource":"Utiliser la source","dataBranching.useTarget":"Utiliser la cible","dataBranching.entity":"Entité","dataBranching.entities":"Entités","dataBranching.record":"Enregistrement","dataBranching.records":"Enregistrements","dataBranching.changes":"Modifications","dataBranching.added":"Ajouté","dataBranching.modified":"Modifié","dataBranching.deleted":"Supprimé","dataBranching.unchanged":"Inchangé","dataBranching.status":"Statut","dataBranching.synced":"Synchronisé","dataBranching.pending":"En attente","dataBranching.inProgress":"En cours","dataBranching.completed":"Terminé","dataBranching.failed":"Échoué"},bo={ok:"OK",cancel:"Cancelar",save:"Guardar",close:"Cerrar",delete:"Eliminar",edit:"Editar",add:"Agregar",remove:"Quitar",search:"Buscar",filter:"Filtrar",refresh:"Actualizar",loading:"Cargando…",noData:"Sin datos",error:"Error",success:"Éxito",warning:"Advertencia",info:"Información",yes:"Sí",no:"No",confirm:"Confirmar",back:"Atrás",next:"Siguiente",previous:"Anterior",finish:"Finalizar",submit:"Enviar",reset:"Restablecer",apply:"Aplicar",undo:"Deshacer",redo:"Rehacer",copy:"Copiar",cut:"Cortar",paste:"Pegar",selectAll:"Seleccionar todo",clear:"Borrar",upload:"Subir",download:"Descargar",print:"Imprimir",export:"Exportar",import:"Importar",settings:"Configuración",help:"Ayuda",about:"Acerca de",more:"Más",less:"Menos",show:"Mostrar",hide:"Ocultar",expand:"Expandir",collapse:"Contraer",enabled:"Habilitado",disabled:"Deshabilitado",required:"Obligatorio",optional:"Opcional",actions:"Acciones",details:"Detalles",overview:"Vista general",all:"Todos",none:"Ninguno",selected:"Seleccionado",total:"Total",of:"de",items:"elementos",page:"Página",rows:"Filas","app.name":"Aplicación","app.version":"Versión","app.about":"Acerca de","nav.home":"Inicio","nav.back":"Atrás","nav.forward":"Adelante","nav.menu":"Menú","nav.sidebar":"Barra lateral","nav.search":"Buscar","nav.favorites":"Favoritos","nav.recent":"Reciente","nav.notifications":"Notificaciones","nav.profile":"Perfil","nav.logout":"Cerrar sesión","carousel.prev":"Diapositiva anterior","carousel.next":"Diapositiva siguiente","carousel.slide":"Diapositiva","carousel.of":"de","carousel.autoplay":"Reproducción automática","carousel.pause":"Pausa","confirm.yes":"Sí","confirm.no":"No","confirm.ok":"OK","confirm.cancel":"Cancelar","confirm.title":"Confirmación","confirm.deleteMessage":"¿Seguro que desea eliminar esto?","confirm.unsavedChanges":"Hay cambios sin guardar. ¿Descartar?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Ingrese un comando…","console.clear":"Limpiar consola","console.run":"Ejecutar","console.output":"Salida","console.newSession":"Nueva sesión","console.closeSession":"Cerrar sesión","controls.save":"Guardar","controls.cancel":"Cancelar","controls.delete":"Eliminar","controls.edit":"Editar","controls.add":"Agregar","controls.remove":"Quitar","controls.close":"Cerrar","controls.open":"Abrir","controls.refresh":"Actualizar","controls.new":"Nuevo","controls.duplicate":"Duplicar","controls.sort":"Ordenar","controls.group":"Agrupar","controls.pin":"Fijar","controls.unpin":"Desfijar","controls.lock":"Bloquear","controls.unlock":"Desbloquear","controls.share":"Compartir","controls.archive":"Archivar","cookie.title":"Consentimiento de cookies","cookie.message":"Este sitio utiliza cookies.","cookie.accept":"Aceptar todas","cookie.reject":"Rechazar todas","cookie.settings":"Configuración de cookies","cookie.necessary":"Necesarias","cookie.analytics":"Analíticas","cookie.marketing":"Marketing","dashboard.title":"Panel","dashboard.addWidget":"Agregar widget","dashboard.removeWidget":"Quitar widget","dashboard.layout":"Diseño","dashboard.settings":"Configuración","dashboard.customize":"Personalizar","dashboard.resetLayout":"Restablecer diseño","datetime.today":"Hoy","datetime.yesterday":"Ayer","datetime.tomorrow":"Mañana","datetime.selectDate":"Seleccionar fecha","datetime.selectTime":"Seleccionar hora","datetime.startDate":"Fecha de inicio","datetime.endDate":"Fecha de fin","datetime.startTime":"Hora de inicio","datetime.endTime":"Hora de fin","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Inicio","desktop.taskbar":"Barra de tareas","desktop.systemTray":"Bandeja del sistema","desktop.wallpaper":"Fondo de pantalla","desktop.icons":"Iconos del escritorio","desktop.arrangeIcons":"Organizar iconos","dock.pin":"Fijar al dock","dock.unpin":"Desfijar del dock","dock.close":"Cerrar","dock.minimize":"Minimizar","dock.maximize":"Maximizar","dock.restore":"Restaurar","docEditor.paragraph":"Párrafo","docEditor.heading":"Encabezado","docEditor.heading1":"Encabezado 1","docEditor.heading2":"Encabezado 2","docEditor.heading3":"Encabezado 3","docEditor.bulletList":"Lista con viñetas","docEditor.numberedList":"Lista numerada","docEditor.quote":"Cita","docEditor.code":"Bloque de código","docEditor.divider":"Separador","docEditor.image":"Imagen","docEditor.table":"Tabla","docEditor.callout":"Destacado","docEditor.placeholder":"Empiece a escribir…","docEditor.slashCommand":"Escriba / para comandos","files.upload":"Subir archivo","files.download":"Descargar","files.delete":"Eliminar archivo","files.rename":"Renombrar","files.newFolder":"Nueva carpeta","files.selectFile":"Seleccionar archivo","files.dropzone":"Suelte archivos aquí","files.dragDrop":"Arrastre y suelte archivos o haga clic","files.maxSize":"Tamaño máximo del archivo","files.fileType":"Tipo de archivo","forms.required":"Este campo es obligatorio","forms.optional":"Opcional","forms.submit":"Enviar","forms.reset":"Restablecer","forms.validate":"Validar","forms.invalid":"Valor inválido","forms.minLength":"Longitud mínima: {0}","forms.maxLength":"Longitud máxima: {0}","forms.email":"Ingrese un correo válido","forms.phone":"Ingrese un teléfono válido","imageEditor.crop":"Recortar","imageEditor.rotate":"Rotar","imageEditor.flip":"Voltear","imageEditor.resize":"Redimensionar","imageEditor.filter":"Filtro","imageEditor.draw":"Dibujar","imageEditor.text":"Texto","imageEditor.undo":"Deshacer","imageEditor.redo":"Rehacer","imageEditor.save":"Guardar","imageEditor.brightness":"Brillo","imageEditor.contrast":"Contraste","imageEditor.saturation":"Saturación","inbox.compose":"Redactar","inbox.reply":"Responder","inbox.replyAll":"Responder a todos","inbox.forward":"Reenviar","inbox.delete":"Eliminar","inbox.archive":"Archivar","inbox.markRead":"Marcar como leído","inbox.markUnread":"Marcar como no leído","inbox.folders":"Carpetas","inbox.inbox":"Bandeja de entrada","inbox.sent":"Enviados","inbox.drafts":"Borradores","inbox.trash":"Papelera","inbox.spam":"Spam","inbox.starred":"Destacados","inbox.to":"Para","inbox.cc":"CC","inbox.bcc":"CCO","inbox.subject":"Asunto","inbox.send":"Enviar","inbox.discard":"Descartar","inbox.attachFile":"Adjuntar archivo","kanban.addCard":"Agregar tarjeta","kanban.addColumn":"Agregar columna","kanban.moveCard":"Mover tarjeta","kanban.editCard":"Editar tarjeta","kanban.deleteCard":"Eliminar tarjeta","kanban.editColumn":"Editar columna","kanban.deleteColumn":"Eliminar columna","lang.en":"Inglés","lang.pl":"Polaco","lang.de":"Alemán","lang.fr":"Francés","lang.es":"Español","lang.it":"Italiano","lang.pt":"Portugués","lang.nl":"Neerlandés","lang.sv":"Sueco","lang.no":"Noruego","lang.da":"Danés","lang.fi":"Finlandés","lang.cs":"Checo","lang.sk":"Eslovaco","lang.hu":"Húngaro","lang.ro":"Rumano","lang.bg":"Búlgaro","lang.uk":"Ucraniano","lang.ja":"Japonés","lang.ko":"Coreano","lang.zh":"Chino","lang.ar":"Árabe","login.username":"Nombre de usuario","login.password":"Contraseña","login.signIn":"Iniciar sesión","login.signOut":"Cerrar sesión","login.forgotPassword":"¿Olvidó su contraseña?","login.register":"Registrarse","login.rememberMe":"Recordarme","login.newPassword":"Nueva contraseña","login.confirmPassword":"Confirmar contraseña","login.twoFactor":"Autenticación de dos factores","password.strength":"Fuerza de la contraseña","password.weak":"Débil","password.medium":"Media","password.strong":"Fuerte","password.requirements":"Requisitos de contraseña","pdfviewer.page":"Página","pdfviewer.of":"de","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Ajustar a página","pdfviewer.fitWidth":"Ajustar a ancho","pdfviewer.download":"Descargar","pdfviewer.print":"Imprimir","pdfviewer.search":"Buscar en el documento","pdfviewer.bookmark":"Marcadores","pdfviewer.thumbnail":"Miniaturas","picklist.available":"Disponibles","picklist.selected":"Seleccionados","picklist.addAll":"Agregar todos","picklist.removeAll":"Quitar todos","picklist.filter":"Filtrar elementos","scheduling.calendar":"Calendario","scheduling.event":"Evento","scheduling.allDay":"Todo el día","scheduling.today":"Hoy","scheduling.week":"Semana","scheduling.month":"Mes","scheduling.year":"Año","scheduling.day":"Día","scheduling.agenda":"Agenda","scheduling.addEvent":"Agregar evento","scheduling.editEvent":"Editar evento","scheduling.deleteEvent":"Eliminar evento","scheduling.noEvents":"Sin eventos","shortcuts.title":"Atajos de teclado","shortcuts.description":"Atajos disponibles","shortcuts.key":"Tecla","shortcuts.command":"Comando","shortcuts.search":"Buscar atajos","signature.clear":"Borrar","signature.save":"Guardar","signature.sign":"Firme aquí","signature.draw":"Dibuje su firma","spreadsheet.cell":"Celda","spreadsheet.row":"Fila","spreadsheet.column":"Columna","spreadsheet.formula":"Fórmula","spreadsheet.insert":"Insertar","spreadsheet.delete":"Eliminar","spreadsheet.sort":"Ordenar","spreadsheet.sortAsc":"Orden ascendente","spreadsheet.sortDesc":"Orden descendente","spreadsheet.filter":"Filtrar","spreadsheet.export":"Exportar","spreadsheet.import":"Importar","spreadsheet.addRow":"Agregar fila","spreadsheet.addColumn":"Agregar columna","spreadsheet.deleteRow":"Eliminar fila","spreadsheet.deleteColumn":"Eliminar columna","spreadsheet.freezeRow":"Inmovilizar fila","spreadsheet.freezeColumn":"Inmovilizar columna","spreadsheet.merge":"Combinar celdas","spreadsheet.unmerge":"Separar celdas","terminal.run":"Ejecutar","terminal.clear":"Limpiar","terminal.copy":"Copiar","terminal.paste":"Pegar","terminal.newSession":"Nueva sesión","terminal.closeSession":"Cerrar sesión","terminal.selectAll":"Seleccionar todo","theme.light":"Claro","theme.dark":"Oscuro","theme.system":"Sistema","theme.custom":"Personalizado","theme.colors":"Colores","theme.fonts":"Fuentes","theme.apply":"Aplicar tema","theme.preview":"Vista previa","theme.reset":"Restablecer","theme.gallery":"Galería de temas","users.profile":"Perfil","users.settings":"Configuración","users.permissions":"Permisos","users.role":"Rol","users.active":"Activo","users.inactive":"Inactivo","users.online":"En línea","users.offline":"Desconectado","users.lastSeen":"Última vez visto","wm.close":"Cerrar","wm.minimize":"Minimizar","wm.maximize":"Maximizar","wm.restore":"Restaurar","wm.tile":"Mosaico de ventanas","wm.cascade":"Cascada de ventanas","wm.closeAll":"Cerrar todo","wm.minimizeAll":"Minimizar todo","wm.newWindow":"Nueva ventana","wm.moveToFront":"Al frente","git.commit":"Commit","git.commits":"Commits","git.branch":"Rama","git.branches":"Ramas","git.merge":"Fusionar","git.rebase":"Rebase","git.pull":"Tirar","git.push":"Empujar","git.fetch":"Obtener","git.checkout":"Extraer","git.stash":"Guardar","git.diff":"Diferencias","git.blame":"Blame","git.history":"Historial","git.conflict":"Conflicto","git.resolve":"Resolver","git.createBranch":"Crear rama","git.deleteBranch":"Eliminar rama","git.mergeRequest":"Solicitud de fusión","git.pullRequest":"Pull Request","pipeline.run":"Ejecutar pipeline","pipeline.stop":"Detener pipeline","pipeline.status":"Estado del pipeline","pipeline.logs":"Registros del pipeline","pipeline.stages":"Etapas","pipeline.jobs":"Trabajos","pipeline.artifacts":"Artefactos","pipeline.trigger":"Disparador","pipeline.schedule":"Programación","pipeline.manual":"Manual","devops.deploy":"Desplegar","devops.rollback":"Revertir","devops.release":"Lanzamiento","devops.environment":"Entorno","dataBranching.environment":"Entorno","dataBranching.environments":"Entornos","dataBranching.dev":"Desarrollo","dataBranching.test":"Pruebas","dataBranching.uat":"UAT","dataBranching.staging":"Pre-producción","dataBranching.prod":"Producción","dataBranching.snapshot":"Instantánea","dataBranching.createSnapshot":"Crear instantánea","dataBranching.restoreSnapshot":"Restaurar instantánea","dataBranching.diff":"Diferencias de datos","dataBranching.compare":"Comparar","dataBranching.merge":"Fusionar datos","dataBranching.promote":"Promover","dataBranching.conflict":"Conflicto","dataBranching.resolveConflict":"Resolver conflicto","dataBranching.accept":"Aceptar","dataBranching.reject":"Rechazar","dataBranching.useSource":"Usar origen","dataBranching.useTarget":"Usar destino","dataBranching.entity":"Entidad","dataBranching.entities":"Entidades","dataBranching.record":"Registro","dataBranching.records":"Registros","dataBranching.changes":"Cambios","dataBranching.added":"Agregado","dataBranching.modified":"Modificado","dataBranching.deleted":"Eliminado","dataBranching.unchanged":"Sin cambios","dataBranching.status":"Estado","dataBranching.synced":"Sincronizado","dataBranching.pending":"Pendiente","dataBranching.inProgress":"En progreso","dataBranching.completed":"Completado","dataBranching.failed":"Fallido"},xo={ok:"OK",cancel:"Annulla",save:"Salva",close:"Chiudi",delete:"Elimina",edit:"Modifica",add:"Aggiungi",remove:"Rimuovi",search:"Cerca",filter:"Filtra",refresh:"Aggiorna",loading:"Caricamento…",noData:"Nessun dato",error:"Errore",success:"Successo",warning:"Avviso",info:"Informazione",yes:"Sì",no:"No",confirm:"Conferma",back:"Indietro",next:"Avanti",previous:"Precedente",finish:"Fine",submit:"Invia",reset:"Ripristina",apply:"Applica",undo:"Annulla",redo:"Ripeti",copy:"Copia",cut:"Taglia",paste:"Incolla",selectAll:"Seleziona tutto",clear:"Cancella",upload:"Carica",download:"Scarica",print:"Stampa",export:"Esporta",import:"Importa",settings:"Impostazioni",help:"Aiuto",about:"Info",more:"Altro",less:"Meno",show:"Mostra",hide:"Nascondi",expand:"Espandi",collapse:"Comprimi",enabled:"Abilitato",disabled:"Disabilitato",required:"Obbligatorio",optional:"Facoltativo",actions:"Azioni",details:"Dettagli",overview:"Panoramica",all:"Tutti",none:"Nessuno",selected:"Selezionato",total:"Totale",of:"di",items:"elementi",page:"Pagina",rows:"Righe","nav.home":"Home","nav.back":"Indietro","nav.forward":"Avanti","nav.menu":"Menu","nav.sidebar":"Barra laterale","nav.search":"Cerca","nav.favorites":"Preferiti","nav.recent":"Recenti","nav.notifications":"Notifiche","nav.profile":"Profilo","nav.logout":"Esci","confirm.title":"Conferma","confirm.deleteMessage":"Sei sicuro di voler eliminare?","confirm.unsavedChanges":"Modifiche non salvate. Annullare?","login.username":"Nome utente","login.password":"Password","login.signIn":"Accedi","login.signOut":"Esci","login.forgotPassword":"Password dimenticata?","login.register":"Registrati","login.rememberMe":"Ricordami","theme.light":"Chiaro","theme.dark":"Scuro","theme.system":"Sistema","wm.close":"Chiudi","wm.minimize":"Riduci","wm.maximize":"Ingrandisci","wm.restore":"Ripristina","lang.en":"Inglese","lang.pl":"Polacco","lang.de":"Tedesco","lang.fr":"Francese","lang.es":"Spagnolo","lang.it":"Italiano","lang.pt":"Portoghese","lang.nl":"Olandese","lang.sv":"Svedese","lang.no":"Norvegese","lang.da":"Danese","lang.fi":"Finlandese","lang.cs":"Ceco","lang.sk":"Slovacco","lang.hu":"Ungherese","lang.ro":"Rumeno","lang.bg":"Bulgaro","lang.uk":"Ucraino","lang.ja":"Giapponese","lang.ko":"Coreano","lang.zh":"Cinese","lang.ar":"Arabo"},vo={ok:"OK",cancel:"Cancelar",save:"Salvar",close:"Fechar",delete:"Excluir",edit:"Editar",add:"Adicionar",remove:"Remover",search:"Pesquisar",filter:"Filtrar",refresh:"Atualizar",loading:"Carregando…",noData:"Sem dados",error:"Erro",success:"Sucesso",warning:"Aviso",info:"Informação",yes:"Sim",no:"Não",confirm:"Confirmar",back:"Voltar",next:"Próximo",previous:"Anterior",finish:"Concluir",submit:"Enviar",reset:"Redefinir",apply:"Aplicar",undo:"Desfazer",redo:"Refazer",copy:"Copiar",cut:"Recortar",paste:"Colar",selectAll:"Selecionar tudo",clear:"Limpar",upload:"Enviar",download:"Baixar",print:"Imprimir",export:"Exportar",import:"Importar",settings:"Configurações",help:"Ajuda",about:"Sobre",more:"Mais",less:"Menos",show:"Mostrar",hide:"Ocultar",expand:"Expandir",collapse:"Recolher",enabled:"Ativado",disabled:"Desativado",required:"Obrigatório",optional:"Opcional",actions:"Ações",details:"Detalhes",overview:"Visão geral",all:"Todos",none:"Nenhum",selected:"Selecionado",total:"Total",of:"de",items:"itens",page:"Página",rows:"Linhas","app.name":"Aplicação","app.version":"Versão","app.about":"Sobre","nav.home":"Início","nav.back":"Voltar","nav.forward":"Avançar","nav.menu":"Menu","nav.sidebar":"Barra lateral","nav.search":"Pesquisar","nav.favorites":"Favoritos","nav.recent":"Recentes","nav.notifications":"Notificações","nav.profile":"Perfil","nav.logout":"Sair","carousel.prev":"Slide anterior","carousel.next":"Próximo slide","carousel.slide":"Slide","carousel.of":"de","carousel.autoplay":"Reprodução automática","carousel.pause":"Pausar","confirm.yes":"Sim","confirm.no":"Não","confirm.ok":"OK","confirm.cancel":"Cancelar","confirm.title":"Confirmação","confirm.deleteMessage":"Tem certeza de que deseja excluir?","confirm.unsavedChanges":"Alterações não salvas. Descartar?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Digite o comando…","console.clear":"Limpar console","console.run":"Executar","console.output":"Saída","console.newSession":"Nova sessão","console.closeSession":"Fechar sessão","controls.save":"Salvar","controls.cancel":"Cancelar","controls.delete":"Excluir","controls.edit":"Editar","controls.add":"Adicionar","controls.remove":"Remover","controls.close":"Fechar","controls.open":"Abrir","controls.refresh":"Atualizar","controls.new":"Novo","controls.duplicate":"Duplicar","controls.sort":"Ordenar","controls.group":"Agrupar","controls.pin":"Fixar","controls.unpin":"Desfixar","controls.lock":"Bloquear","controls.unlock":"Desbloquear","controls.share":"Compartilhar","controls.archive":"Arquivar","cookie.title":"Consentimento de cookies","cookie.message":"Este site usa cookies para melhorar sua experiência.","cookie.accept":"Aceitar todos","cookie.reject":"Rejeitar todos","cookie.settings":"Configurações de cookies","cookie.necessary":"Necessários","cookie.analytics":"Analíticos","cookie.marketing":"Marketing","dashboard.title":"Painel","dashboard.addWidget":"Adicionar widget","dashboard.removeWidget":"Remover widget","dashboard.layout":"Layout","dashboard.settings":"Configurações","dashboard.customize":"Personalizar","dashboard.resetLayout":"Redefinir layout","datetime.today":"Hoje","datetime.yesterday":"Ontem","datetime.tomorrow":"Amanhã","datetime.selectDate":"Selecionar data","datetime.selectTime":"Selecionar hora","datetime.startDate":"Data de início","datetime.endDate":"Data de término","datetime.startTime":"Hora de início","datetime.endTime":"Hora de término","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Iniciar","desktop.taskbar":"Barra de tarefas","desktop.systemTray":"Bandeja do sistema","desktop.wallpaper":"Papel de parede","desktop.icons":"Ícones da área de trabalho","desktop.arrangeIcons":"Organizar ícones","dock.pin":"Fixar no dock","dock.unpin":"Desfixar do dock","dock.close":"Fechar","dock.minimize":"Minimizar","dock.maximize":"Maximizar","dock.restore":"Restaurar","docEditor.paragraph":"Parágrafo","docEditor.heading":"Título","docEditor.heading1":"Título 1","docEditor.heading2":"Título 2","docEditor.heading3":"Título 3","docEditor.bulletList":"Lista com marcadores","docEditor.numberedList":"Lista numerada","docEditor.quote":"Citação","docEditor.code":"Bloco de código","docEditor.divider":"Divisor","docEditor.image":"Imagem","docEditor.table":"Tabela","docEditor.callout":"Destaque","docEditor.placeholder":"Comece a digitar…","docEditor.slashCommand":"Digite / para comandos","files.upload":"Enviar arquivo","files.download":"Baixar","files.delete":"Excluir arquivo","files.rename":"Renomear","files.newFolder":"Nova pasta","files.selectFile":"Selecionar arquivo","files.dropzone":"Arraste arquivos aqui","files.dragDrop":"Arraste e solte arquivos ou clique para selecionar","files.maxSize":"Tamanho máximo do arquivo","files.fileType":"Tipo de arquivo","forms.required":"Este campo é obrigatório","forms.optional":"Opcional","forms.submit":"Enviar","forms.reset":"Redefinir","forms.validate":"Validar","forms.invalid":"Valor inválido","forms.minLength":"Comprimento mínimo: {0}","forms.maxLength":"Comprimento máximo: {0}","forms.email":"Insira um e-mail válido","forms.phone":"Insira um telefone válido","imageEditor.crop":"Cortar","imageEditor.rotate":"Girar","imageEditor.flip":"Espelhar","imageEditor.resize":"Redimensionar","imageEditor.filter":"Filtro","imageEditor.draw":"Desenhar","imageEditor.text":"Texto","imageEditor.undo":"Desfazer","imageEditor.redo":"Refazer","imageEditor.save":"Salvar","imageEditor.brightness":"Brilho","imageEditor.contrast":"Contraste","imageEditor.saturation":"Saturação","inbox.compose":"Escrever","inbox.reply":"Responder","inbox.replyAll":"Responder a todos","inbox.forward":"Encaminhar","inbox.delete":"Excluir","inbox.archive":"Arquivar","inbox.markRead":"Marcar como lido","inbox.markUnread":"Marcar como não lido","inbox.folders":"Pastas","inbox.inbox":"Caixa de entrada","inbox.sent":"Enviados","inbox.drafts":"Rascunhos","inbox.trash":"Lixeira","inbox.spam":"Spam","inbox.starred":"Com estrela","inbox.to":"Para","inbox.cc":"Cc","inbox.bcc":"Cco","inbox.subject":"Assunto","inbox.send":"Enviar","inbox.discard":"Descartar","inbox.attachFile":"Anexar arquivo","kanban.addCard":"Adicionar cartão","kanban.addColumn":"Adicionar coluna","kanban.moveCard":"Mover cartão","kanban.editCard":"Editar cartão","kanban.deleteCard":"Excluir cartão","kanban.editColumn":"Editar coluna","kanban.deleteColumn":"Excluir coluna","lang.en":"Inglês","lang.pl":"Polonês","lang.de":"Alemão","lang.fr":"Francês","lang.es":"Espanhol","lang.it":"Italiano","lang.pt":"Português","lang.nl":"Holandês","lang.sv":"Sueco","lang.no":"Norueguês","lang.da":"Dinamarquês","lang.fi":"Finlandês","lang.cs":"Tcheco","lang.sk":"Eslovaco","lang.hu":"Húngaro","lang.ro":"Romeno","lang.bg":"Búlgaro","lang.uk":"Ucraniano","lang.ja":"Japonês","lang.ko":"Coreano","lang.zh":"Chinês","lang.ar":"Árabe","login.username":"Nome de usuário","login.password":"Senha","login.signIn":"Entrar","login.signOut":"Sair","login.forgotPassword":"Esqueceu a senha?","login.register":"Registrar","login.rememberMe":"Lembrar-me","login.newPassword":"Nova senha","login.confirmPassword":"Confirmar senha","login.twoFactor":"Autenticação de dois fatores","password.strength":"Força da senha","password.weak":"Fraca","password.medium":"Média","password.strong":"Forte","password.requirements":"Requisitos de senha","pdfviewer.page":"Página","pdfviewer.of":"de","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Ajustar à página","pdfviewer.fitWidth":"Ajustar à largura","pdfviewer.download":"Baixar","pdfviewer.print":"Imprimir","pdfviewer.search":"Pesquisar no documento","pdfviewer.bookmark":"Marcadores","pdfviewer.thumbnail":"Miniaturas","picklist.available":"Disponíveis","picklist.selected":"Selecionados","picklist.addAll":"Adicionar todos","picklist.removeAll":"Remover todos","picklist.filter":"Filtrar itens","scheduling.calendar":"Calendário","scheduling.event":"Evento","scheduling.allDay":"Dia inteiro","scheduling.today":"Hoje","scheduling.week":"Semana","scheduling.month":"Mês","scheduling.year":"Ano","scheduling.day":"Dia","scheduling.agenda":"Agenda","scheduling.addEvent":"Adicionar evento","scheduling.editEvent":"Editar evento","scheduling.deleteEvent":"Excluir evento","scheduling.noEvents":"Sem eventos","shortcuts.title":"Atalhos de teclado","shortcuts.description":"Atalhos disponíveis","shortcuts.key":"Tecla","shortcuts.command":"Comando","shortcuts.search":"Pesquisar atalhos","signature.clear":"Limpar","signature.save":"Salvar","signature.sign":"Assine aqui","signature.draw":"Desenhe sua assinatura","spreadsheet.cell":"Célula","spreadsheet.row":"Linha","spreadsheet.column":"Coluna","spreadsheet.formula":"Fórmula","spreadsheet.insert":"Inserir","spreadsheet.delete":"Excluir","spreadsheet.sort":"Ordenar","spreadsheet.sortAsc":"Ordem crescente","spreadsheet.sortDesc":"Ordem decrescente","spreadsheet.filter":"Filtrar","spreadsheet.export":"Exportar","spreadsheet.import":"Importar","spreadsheet.addRow":"Adicionar linha","spreadsheet.addColumn":"Adicionar coluna","spreadsheet.deleteRow":"Excluir linha","spreadsheet.deleteColumn":"Excluir coluna","spreadsheet.freezeRow":"Congelar linha","spreadsheet.freezeColumn":"Congelar coluna","spreadsheet.merge":"Mesclar células","spreadsheet.unmerge":"Desfazer mesclagem","terminal.run":"Executar","terminal.clear":"Limpar","terminal.copy":"Copiar","terminal.paste":"Colar","terminal.newSession":"Nova sessão","terminal.closeSession":"Fechar sessão","terminal.selectAll":"Selecionar tudo","theme.light":"Claro","theme.dark":"Escuro","theme.system":"Sistema","theme.custom":"Personalizado","theme.colors":"Cores","theme.fonts":"Fontes","theme.apply":"Aplicar tema","theme.preview":"Visualizar","theme.reset":"Restaurar padrão","theme.gallery":"Galeria de temas","users.profile":"Perfil","users.settings":"Configurações","users.permissions":"Permissões","users.role":"Papel","users.active":"Ativo","users.inactive":"Inativo","users.online":"Online","users.offline":"Offline","users.lastSeen":"Último acesso","wm.close":"Fechar","wm.minimize":"Minimizar","wm.maximize":"Maximizar","wm.restore":"Restaurar","wm.tile":"Organizar janelas","wm.cascade":"Cascata","wm.closeAll":"Fechar todos","wm.minimizeAll":"Minimizar todos","wm.newWindow":"Nova janela","wm.moveToFront":"Trazer para frente"},wo={ok:"OK",cancel:"Annuleren",save:"Opslaan",close:"Sluiten",delete:"Verwijderen",edit:"Bewerken",add:"Toevoegen",remove:"Verwijderen",search:"Zoeken",filter:"Filteren",refresh:"Vernieuwen",loading:"Laden…",noData:"Geen gegevens",error:"Fout",success:"Gelukt",warning:"Waarschuwing",info:"Informatie",yes:"Ja",no:"Nee",confirm:"Bevestigen",back:"Terug",next:"Volgende",previous:"Vorige",finish:"Voltooien",submit:"Indienen",reset:"Herstellen",apply:"Toepassen",undo:"Ongedaan maken",redo:"Opnieuw",copy:"Kopiëren",cut:"Knippen",paste:"Plakken",selectAll:"Alles selecteren",clear:"Wissen",upload:"Uploaden",download:"Downloaden",print:"Afdrukken",export:"Exporteren",import:"Importeren",settings:"Instellingen",help:"Help",required:"Verplicht",optional:"Optioneel","nav.home":"Startpagina","nav.back":"Terug","nav.favorites":"Favorieten","nav.notifications":"Meldingen","nav.profile":"Profiel","nav.logout":"Uitloggen","login.username":"Gebruikersnaam","login.password":"Wachtwoord","login.signIn":"Inloggen","login.signOut":"Uitloggen","login.forgotPassword":"Wachtwoord vergeten?","login.register":"Registreren","theme.light":"Licht","theme.dark":"Donker","theme.system":"Systeem","wm.close":"Sluiten","wm.minimize":"Minimaliseren","wm.maximize":"Maximaliseren","wm.restore":"Herstellen","lang.en":"Engels","lang.pl":"Pools","lang.de":"Duits","lang.fr":"Frans","lang.es":"Spaans","lang.it":"Italiaans","lang.pt":"Portugees","lang.nl":"Nederlands","lang.sv":"Zweeds","lang.no":"Noors","lang.da":"Deens","lang.fi":"Fins","lang.cs":"Tsjechisch","lang.sk":"Slowaaks","lang.hu":"Hongaars","lang.ro":"Roemeens","lang.bg":"Bulgaars","lang.uk":"Oekraïens","lang.ja":"Japans","lang.ko":"Koreaans","lang.zh":"Chinees","lang.ar":"Arabisch"},ko={ok:"OK",cancel:"Avbryt",save:"Spara",close:"Stäng",delete:"Ta bort",edit:"Redigera",add:"Lägg till",remove:"Ta bort",search:"Sök",filter:"Filtrera",refresh:"Uppdatera",loading:"Laddar…",noData:"Ingen data",error:"Fel",success:"Lyckades",warning:"Varning",info:"Information",yes:"Ja",no:"Nej",confirm:"Bekräfta",back:"Tillbaka",next:"Nästa",undo:"Ångra",redo:"Gör om",copy:"Kopiera",cut:"Klipp",paste:"Klistra in",settings:"Inställningar",help:"Hjälp",required:"Obligatoriskt","nav.home":"Hem","nav.favorites":"Favoriter","nav.notifications":"Aviseringar","nav.logout":"Logga ut","login.username":"Användarnamn","login.password":"Lösenord","login.signIn":"Logga in","login.signOut":"Logga ut","login.forgotPassword":"Glömt lösenordet?","login.register":"Registrera","theme.light":"Ljust","theme.dark":"Mörkt","theme.system":"System","wm.close":"Stäng","wm.minimize":"Minimera","wm.maximize":"Maximera","wm.restore":"Återställ","lang.en":"Engelska","lang.pl":"Polska","lang.de":"Tyska","lang.fr":"Franska","lang.es":"Spanska","lang.it":"Italienska","lang.pt":"Portugisiska","lang.nl":"Nederländska","lang.sv":"Svenska","lang.no":"Norska","lang.da":"Danska","lang.fi":"Finska","lang.cs":"Tjeckiska","lang.sk":"Slovakiska","lang.hu":"Ungerska","lang.ro":"Rumänska","lang.bg":"Bulgariska","lang.uk":"Ukrainska","lang.ja":"Japanska","lang.ko":"Koreanska","lang.zh":"Kinesiska","lang.ar":"Arabiska"},So={ok:"OK",cancel:"Avbryt",save:"Lagre",close:"Lukk",delete:"Slett",edit:"Rediger",add:"Legg til",remove:"Fjern",search:"Søk",filter:"Filtrer",refresh:"Oppdater",loading:"Laster…",noData:"Ingen data",error:"Feil",success:"Vellykket",warning:"Advarsel",yes:"Ja",no:"Nei",confirm:"Bekreft",back:"Tilbake",next:"Neste",undo:"Angre",redo:"Gjør om",copy:"Kopier",paste:"Lim inn",settings:"Innstillinger",help:"Hjelp","nav.home":"Hjem","nav.favorites":"Favoritter","nav.logout":"Logg ut","login.username":"Brukernavn","login.password":"Passord","login.signIn":"Logg inn","theme.light":"Lys","theme.dark":"Mørk","theme.system":"System","wm.close":"Lukk","wm.minimize":"Minimer","wm.maximize":"Maksimer","wm.restore":"Gjenopprett","lang.en":"Engelsk","lang.pl":"Polsk","lang.de":"Tysk","lang.fr":"Fransk","lang.es":"Spansk","lang.it":"Italiensk","lang.pt":"Portugisisk","lang.nl":"Nederlandsk","lang.sv":"Svensk","lang.no":"Norsk","lang.da":"Dansk","lang.fi":"Finsk","lang.cs":"Tsjekkisk","lang.sk":"Slovakisk","lang.hu":"Ungarsk","lang.ro":"Rumensk","lang.bg":"Bulgarsk","lang.uk":"Ukrainsk","lang.ja":"Japansk","lang.ko":"Koreansk","lang.zh":"Kinesisk","lang.ar":"Arabisk"},Co={ok:"OK",cancel:"Annuller",save:"Gem",close:"Luk",delete:"Slet",edit:"Rediger",add:"Tilføj",remove:"Fjern",search:"Søg",filter:"Filtrer",refresh:"Opdater",loading:"Indlæser…",noData:"Ingen data",error:"Fejl",success:"Succes",warning:"Advarsel",yes:"Ja",no:"Nej",confirm:"Bekræft",back:"Tilbage",next:"Næste",undo:"Fortryd",redo:"Gentag",copy:"Kopiér",paste:"Indsæt",settings:"Indstillinger",help:"Hjælp","nav.home":"Hjem","nav.favorites":"Favoritter","nav.logout":"Log ud","login.username":"Brugernavn","login.password":"Adgangskode","login.signIn":"Log ind","theme.light":"Lys","theme.dark":"Mørk","theme.system":"System","wm.close":"Luk","wm.minimize":"Minimer","wm.maximize":"Maksimer","wm.restore":"Gendan","lang.en":"Engelsk","lang.pl":"Polsk","lang.de":"Tysk","lang.fr":"Fransk","lang.es":"Spansk","lang.it":"Italiensk","lang.pt":"Portugisisk","lang.nl":"Nederlandsk","lang.sv":"Svensk","lang.no":"Norsk","lang.da":"Dansk","lang.fi":"Finsk","lang.cs":"Tjekkisk","lang.sk":"Slovakisk","lang.hu":"Ungarsk","lang.ro":"Rumænsk","lang.bg":"Bulgarsk","lang.uk":"Ukrainsk","lang.ja":"Japansk","lang.ko":"Koreansk","lang.zh":"Kinesisk","lang.ar":"Arabisk"},_o={ok:"OK",cancel:"Peruuta",save:"Tallenna",close:"Sulje",delete:"Poista",edit:"Muokkaa",add:"Lisää",remove:"Poista",search:"Hae",filter:"Suodata",refresh:"Päivitä",loading:"Lataa…",noData:"Ei tietoja",error:"Virhe",success:"Onnistui",warning:"Varoitus",yes:"Kyllä",no:"Ei",confirm:"Vahvista",back:"Takaisin",next:"Seuraava",undo:"Kumoa",redo:"Tee uudelleen",copy:"Kopioi",paste:"Liitä",settings:"Asetukset",help:"Ohje","nav.home":"Etusivu","nav.favorites":"Suosikit","nav.logout":"Kirjaudu ulos","login.username":"Käyttäjänimi","login.password":"Salasana","login.signIn":"Kirjaudu sisään","theme.light":"Vaalea","theme.dark":"Tumma","theme.system":"Järjestelmä","wm.close":"Sulje","wm.minimize":"Pienennä","wm.maximize":"Suurenna","wm.restore":"Palauta","lang.en":"Englanti","lang.pl":"Puola","lang.de":"Saksa","lang.fr":"Ranska","lang.es":"Espanja","lang.it":"Italia","lang.pt":"Portugali","lang.nl":"Hollanti","lang.sv":"Ruotsi","lang.no":"Norja","lang.da":"Tanska","lang.fi":"Suomi","lang.cs":"Tšekki","lang.sk":"Slovakia","lang.hu":"Unkari","lang.ro":"Romania","lang.bg":"Bulgaria","lang.uk":"Ukraina","lang.ja":"Japani","lang.ko":"Korea","lang.zh":"Kiina","lang.ar":"Arabia"},jo={ok:"OK",cancel:"Zrušit",save:"Uložit",close:"Zavřít",delete:"Smazat",edit:"Upravit",add:"Přidat",remove:"Odebrat",search:"Hledat",filter:"Filtrovat",refresh:"Obnovit",loading:"Načítání…",noData:"Žádná data",error:"Chyba",success:"Úspěch",warning:"Upozornění",info:"Informace",yes:"Ano",no:"Ne",confirm:"Potvrdit",back:"Zpět",next:"Další",previous:"Předchozí",finish:"Dokončit",submit:"Odeslat",reset:"Obnovit",apply:"Použít",undo:"Zpět",redo:"Znovu",copy:"Kopírovat",cut:"Vyjmout",paste:"Vložit",selectAll:"Vybrat vše",clear:"Vymazat",upload:"Nahrát",download:"Stáhnout",print:"Tisk",export:"Exportovat",import:"Importovat",settings:"Nastavení",help:"Nápověda",about:"O aplikaci",more:"Více",less:"Méně",show:"Zobrazit",hide:"Skrýt",expand:"Rozbalit",collapse:"Sbalit",enabled:"Povoleno",disabled:"Zakázáno",required:"Povinné",optional:"Volitelné",actions:"Akce",details:"Podrobnosti",overview:"Přehled",all:"Vše",none:"Žádné",selected:"Vybráno",total:"Celkem",of:"z",items:"položek",page:"Stránka",rows:"Řádky","app.name":"Aplikace","app.version":"Verze","app.about":"O aplikaci","nav.home":"Domů","nav.back":"Zpět","nav.forward":"Vpřed","nav.menu":"Menu","nav.sidebar":"Postranní panel","nav.search":"Hledat","nav.favorites":"Oblíbené","nav.recent":"Nedávné","nav.notifications":"Oznámení","nav.profile":"Profil","nav.logout":"Odhlásit se","carousel.prev":"Předchozí snímek","carousel.next":"Další snímek","carousel.slide":"Snímek","carousel.of":"z","carousel.autoplay":"Automatické přehrávání","carousel.pause":"Pozastavit","confirm.yes":"Ano","confirm.no":"Ne","confirm.ok":"OK","confirm.cancel":"Zrušit","confirm.title":"Potvrzení","confirm.deleteMessage":"Opravdu chcete smazat?","confirm.unsavedChanges":"Máte neuložené změny. Zahodit?","console.shell":"Příkazový řádek","console.terminal":"Terminál","console.prompt":"Zadejte příkaz…","console.clear":"Vymazat konzoli","console.run":"Spustit","console.output":"Výstup","console.newSession":"Nová relace","console.closeSession":"Zavřít relaci","controls.save":"Uložit","controls.cancel":"Zrušit","controls.delete":"Smazat","controls.edit":"Upravit","controls.add":"Přidat","controls.remove":"Odebrat","controls.close":"Zavřít","controls.open":"Otevřít","controls.refresh":"Obnovit","controls.new":"Nový","controls.duplicate":"Duplikovat","controls.sort":"Řadit","controls.group":"Seskupit","controls.pin":"Připnout","controls.unpin":"Odepnout","controls.lock":"Zamknout","controls.unlock":"Odemknout","controls.share":"Sdílet","controls.archive":"Archivovat","cookie.title":"Souhlas s cookies","cookie.message":"Tento web používá cookies pro zlepšení vašeho zážitku.","cookie.accept":"Přijmout vše","cookie.reject":"Odmítnout vše","cookie.settings":"Nastavení cookies","cookie.necessary":"Nezbytné","cookie.analytics":"Analytické","cookie.marketing":"Marketingové","dashboard.title":"Nástěnka","dashboard.addWidget":"Přidat widget","dashboard.removeWidget":"Odebrat widget","dashboard.layout":"Rozložení","dashboard.settings":"Nastavení","dashboard.customize":"Přizpůsobit","dashboard.resetLayout":"Obnovit rozložení","datetime.today":"Dnes","datetime.yesterday":"Včera","datetime.tomorrow":"Zítra","datetime.selectDate":"Vybrat datum","datetime.selectTime":"Vybrat čas","datetime.startDate":"Datum zahájení","datetime.endDate":"Datum ukončení","datetime.startTime":"Čas zahájení","datetime.endTime":"Čas ukončení","datetime.am":"dop.","datetime.pm":"odp.","desktop.start":"Start","desktop.taskbar":"Hlavní panel","desktop.systemTray":"Systémová lišta","desktop.wallpaper":"Tapeta","desktop.icons":"Ikony plochy","desktop.arrangeIcons":"Uspořádat ikony","dock.pin":"Připnout na dock","dock.unpin":"Odepnout z docku","dock.close":"Zavřít","dock.minimize":"Minimalizovat","dock.maximize":"Maximalizovat","dock.restore":"Obnovit","docEditor.paragraph":"Odstavec","docEditor.heading":"Nadpis","docEditor.heading1":"Nadpis 1","docEditor.heading2":"Nadpis 2","docEditor.heading3":"Nadpis 3","docEditor.bulletList":"Odrážkový seznam","docEditor.numberedList":"Číslovaný seznam","docEditor.quote":"Citace","docEditor.code":"Blok kódu","docEditor.divider":"Oddělovač","docEditor.image":"Obrázek","docEditor.table":"Tabulka","docEditor.callout":"Upozornění","docEditor.placeholder":"Začněte psát…","docEditor.slashCommand":"Napište / pro příkazy","files.upload":"Nahrát soubor","files.download":"Stáhnout","files.delete":"Smazat soubor","files.rename":"Přejmenovat","files.newFolder":"Nová složka","files.selectFile":"Vybrat soubor","files.dropzone":"Přetáhněte soubory sem","files.dragDrop":"Přetáhněte soubory sem nebo klikněte","files.maxSize":"Maximální velikost souboru","files.fileType":"Typ souboru","forms.required":"Toto pole je povinné","forms.optional":"Volitelné","forms.submit":"Odeslat","forms.reset":"Obnovit","forms.validate":"Ověřit","forms.invalid":"Neplatná hodnota","forms.minLength":"Minimální délka: {0}","forms.maxLength":"Maximální délka: {0}","forms.email":"Zadejte platný e-mail","forms.phone":"Zadejte platné telefonní číslo","imageEditor.crop":"Oříznout","imageEditor.rotate":"Otočit","imageEditor.flip":"Překlopit","imageEditor.resize":"Změnit velikost","imageEditor.filter":"Filtr","imageEditor.draw":"Kreslit","imageEditor.text":"Text","imageEditor.undo":"Zpět","imageEditor.redo":"Znovu","imageEditor.save":"Uložit","imageEditor.brightness":"Jas","imageEditor.contrast":"Kontrast","imageEditor.saturation":"Sytost","inbox.compose":"Napsat","inbox.reply":"Odpovědět","inbox.replyAll":"Odpovědět všem","inbox.forward":"Přeposlat","inbox.delete":"Smazat","inbox.archive":"Archivovat","inbox.markRead":"Označit jako přečtené","inbox.markUnread":"Označit jako nepřečtené","inbox.folders":"Složky","inbox.inbox":"Doručená pošta","inbox.sent":"Odeslaná pošta","inbox.drafts":"Koncepty","inbox.trash":"Koš","inbox.spam":"Spam","inbox.starred":"S hvězdičkou","inbox.to":"Komu","inbox.cc":"Kopie","inbox.bcc":"Skrytá kopie","inbox.subject":"Předmět","inbox.send":"Odeslat","inbox.discard":"Zahodit","inbox.attachFile":"Připojit soubor","kanban.addCard":"Přidat kartu","kanban.addColumn":"Přidat sloupec","kanban.moveCard":"Přesunout kartu","kanban.editCard":"Upravit kartu","kanban.deleteCard":"Smazat kartu","kanban.editColumn":"Upravit sloupec","kanban.deleteColumn":"Smazat sloupec","lang.en":"Angličtina","lang.pl":"Polština","lang.de":"Němčina","lang.fr":"Francouzština","lang.es":"Španělština","lang.it":"Italština","lang.pt":"Portugalština","lang.nl":"Nizozemština","lang.sv":"Švédština","lang.no":"Norština","lang.da":"Dánština","lang.fi":"Finština","lang.cs":"Čeština","lang.sk":"Slovenčina","lang.hu":"Maďarština","lang.ro":"Rumunština","lang.bg":"Bulharština","lang.uk":"Ukrajinčina","lang.ja":"Japonština","lang.ko":"Korejština","lang.zh":"Čínština","lang.ar":"Arabština","login.username":"Uživatelské jméno","login.password":"Heslo","login.signIn":"Přihlásit se","login.signOut":"Odhlásit se","login.forgotPassword":"Zapomenuté heslo?","login.register":"Registrovat se","login.rememberMe":"Zapamatovat si mě","login.newPassword":"Nové heslo","login.confirmPassword":"Potvrdit heslo","login.twoFactor":"Dvoufaktorové ověření","password.strength":"Síla hesla","password.weak":"Slabé","password.medium":"Střední","password.strong":"Silné","password.requirements":"Požadavky na heslo","pdfviewer.page":"Stránka","pdfviewer.of":"z","pdfviewer.zoom":"Přiblížení","pdfviewer.fitPage":"Přizpůsobit stránce","pdfviewer.fitWidth":"Přizpůsobit šířce","pdfviewer.download":"Stáhnout","pdfviewer.print":"Tisk","pdfviewer.search":"Hledat v dokumentu","pdfviewer.bookmark":"Záložky","pdfviewer.thumbnail":"Miniatury","picklist.available":"Dostupné","picklist.selected":"Vybrané","picklist.addAll":"Přidat vše","picklist.removeAll":"Odebrat vše","picklist.filter":"Filtrovat položky","scheduling.calendar":"Kalendář","scheduling.event":"Událost","scheduling.allDay":"Celý den","scheduling.today":"Dnes","scheduling.week":"Týden","scheduling.month":"Měsíc","scheduling.year":"Rok","scheduling.day":"Den","scheduling.agenda":"Program","scheduling.addEvent":"Přidat událost","scheduling.editEvent":"Upravit událost","scheduling.deleteEvent":"Smazat událost","scheduling.noEvents":"Žádné události","shortcuts.title":"Klávesové zkratky","shortcuts.description":"Dostupné zkratky","shortcuts.key":"Klávesa","shortcuts.command":"Příkaz","shortcuts.search":"Hledat zkratky","signature.clear":"Vymazat","signature.save":"Uložit","signature.sign":"Podepište zde","signature.draw":"Nakreslete svůj podpis","spreadsheet.cell":"Buňka","spreadsheet.row":"Řádek","spreadsheet.column":"Sloupec","spreadsheet.formula":"Vzorec","spreadsheet.insert":"Vložit","spreadsheet.delete":"Smazat","spreadsheet.sort":"Řadit","spreadsheet.sortAsc":"Řadit vzestupně","spreadsheet.sortDesc":"Řadit sestupně","spreadsheet.filter":"Filtrovat","spreadsheet.export":"Exportovat","spreadsheet.import":"Importovat","spreadsheet.addRow":"Přidat řádek","spreadsheet.addColumn":"Přidat sloupec","spreadsheet.deleteRow":"Smazat řádek","spreadsheet.deleteColumn":"Smazat sloupec","spreadsheet.freezeRow":"Ukotvit řádek","spreadsheet.freezeColumn":"Ukotvit sloupec","spreadsheet.merge":"Sloučit buňky","spreadsheet.unmerge":"Rozdělit buňky","terminal.run":"Spustit","terminal.clear":"Vymazat","terminal.copy":"Kopírovat","terminal.paste":"Vložit","terminal.newSession":"Nová relace","terminal.closeSession":"Zavřít relaci","terminal.selectAll":"Vybrat vše","theme.light":"Světlý","theme.dark":"Tmavý","theme.system":"Systém","theme.custom":"Vlastní","theme.colors":"Barvy","theme.fonts":"Písma","theme.apply":"Použít motiv","theme.preview":"Náhled","theme.reset":"Obnovit výchozí","theme.gallery":"Galerie motivů","users.profile":"Profil","users.settings":"Nastavení","users.permissions":"Oprávnění","users.role":"Role","users.active":"Aktivní","users.inactive":"Neaktivní","users.online":"Online","users.offline":"Offline","users.lastSeen":"Naposledy viděn","wm.close":"Zavřít","wm.minimize":"Minimalizovat","wm.maximize":"Maximalizovat","wm.restore":"Obnovit","wm.tile":"Dlaždice oken","wm.cascade":"Kaskáda oken","wm.closeAll":"Zavřít vše","wm.minimizeAll":"Minimalizovat vše","wm.newWindow":"Nové okno","wm.moveToFront":"Přenést dopředu"},No={ok:"OK",cancel:"Zrušiť",save:"Uložiť",close:"Zavrieť",delete:"Odstrániť",edit:"Upraviť",add:"Pridať",remove:"Odobrať",search:"Hľadať",filter:"Filtrovať",refresh:"Obnoviť",loading:"Načítava sa…",noData:"Žiadne dáta",error:"Chyba",success:"Úspech",warning:"Upozornenie",yes:"Áno",no:"Nie",confirm:"Potvrdiť",back:"Späť",next:"Ďalej",undo:"Späť",redo:"Znova",copy:"Kopírovať",paste:"Vložiť",settings:"Nastavenia",help:"Pomoc","nav.home":"Domov","nav.favorites":"Obľúbené","nav.logout":"Odhlásiť sa","login.username":"Používateľské meno","login.password":"Heslo","login.signIn":"Prihlásiť sa","theme.light":"Svetlý","theme.dark":"Tmavý","theme.system":"Systém","wm.close":"Zavrieť","wm.minimize":"Minimalizovať","wm.maximize":"Maximalizovať","wm.restore":"Obnoviť","lang.en":"Angličtina","lang.pl":"Poľština","lang.de":"Nemčina","lang.fr":"Francúzština","lang.es":"Španielčina","lang.it":"Taliančina","lang.pt":"Portugalčina","lang.nl":"Holandčina","lang.sv":"Švédčina","lang.no":"Nórčina","lang.da":"Dánčina","lang.fi":"Fínčina","lang.cs":"Čeština","lang.sk":"Slovenčina","lang.hu":"Maďarčina","lang.ro":"Rumunčina","lang.bg":"Bulharčina","lang.uk":"Ukrajinčina","lang.ja":"Japončina","lang.ko":"Kórejčina","lang.zh":"Čínština","lang.ar":"Arabčina"},Mo={ok:"OK",cancel:"Mégse",save:"Mentés",close:"Bezárás",delete:"Törlés",edit:"Szerkesztés",add:"Hozzáadás",remove:"Eltávolítás",search:"Keresés",filter:"Szűrés",refresh:"Frissítés",loading:"Betöltés…",noData:"Nincs adat",error:"Hiba",success:"Sikeres",warning:"Figyelmeztetés",yes:"Igen",no:"Nem",confirm:"Megerősítés",back:"Vissza",next:"Következő",undo:"Visszavonás",redo:"Újra",copy:"Másolás",paste:"Beillesztés",settings:"Beállítások",help:"Segítség","nav.home":"Főoldal","nav.favorites":"Kedvencek","nav.logout":"Kijelentkezés","login.username":"Felhasználónév","login.password":"Jelszó","login.signIn":"Bejelentkezés","theme.light":"Világos","theme.dark":"Sötét","theme.system":"Rendszer","wm.close":"Bezárás","wm.minimize":"Kis méret","wm.maximize":"Teljes méret","wm.restore":"Visszaállítás","lang.en":"Angol","lang.pl":"Lengyel","lang.de":"Német","lang.fr":"Francia","lang.es":"Spanyol","lang.it":"Olasz","lang.pt":"Portugál","lang.nl":"Holland","lang.sv":"Svéd","lang.no":"Norvég","lang.da":"Dán","lang.fi":"Finn","lang.cs":"Cseh","lang.sk":"Szlovák","lang.hu":"Magyar","lang.ro":"Román","lang.bg":"Bolgár","lang.uk":"Ukrán","lang.ja":"Japán","lang.ko":"Koreai","lang.zh":"Kínai","lang.ar":"Arab"},$o={ok:"OK",cancel:"Anulare",save:"Salvare",close:"Închide",delete:"Șterge",edit:"Editare",add:"Adaugă",remove:"Elimină",search:"Căutare",filter:"Filtrare",refresh:"Actualizare",loading:"Se încarcă…",noData:"Fără date",error:"Eroare",success:"Succes",warning:"Avertisment",yes:"Da",no:"Nu",confirm:"Confirmă",back:"Înapoi",next:"Următor",settings:"Setări",help:"Ajutor","nav.home":"Acasă","nav.favorites":"Favorite","nav.logout":"Deconectare","login.username":"Utilizator","login.password":"Parolă","login.signIn":"Autentificare","theme.light":"Luminos","theme.dark":"Întunecat","theme.system":"Sistem","lang.en":"Engleză","lang.pl":"Poloneză","lang.de":"Germană","lang.fr":"Franceză","lang.es":"Spaniolă","lang.it":"Italiană","lang.pt":"Portugheză","lang.nl":"Olandeză","lang.sv":"Suedeză","lang.no":"Norvegiană","lang.da":"Daneză","lang.fi":"Finlandeză","lang.cs":"Cehă","lang.sk":"Slovacă","lang.hu":"Maghiară","lang.ro":"Română","lang.bg":"Bulgară","lang.uk":"Ucraineană","lang.ja":"Japoneză","lang.ko":"Coreeană","lang.zh":"Chineză","lang.ar":"Arabă"},Eo={ok:"OK",cancel:"Отказ",save:"Запис",close:"Затвори",delete:"Изтрий",edit:"Редактирай",add:"Добави",remove:"Премахни",search:"Търси",filter:"Филтрирай",refresh:"Обнови",loading:"Зареждане…",noData:"Няма данни",error:"Грешка",success:"Успех",warning:"Предупреждение",yes:"Да",no:"Не",confirm:"Потвърди",back:"Назад",next:"Напред",settings:"Настройки",help:"Помощ","nav.home":"Начало","nav.favorites":"Любими","nav.logout":"Изход","login.username":"Потребителско име","login.password":"Парола","login.signIn":"Вход","theme.light":"Светла","theme.dark":"Тъмна","theme.system":"Системна","lang.en":"Английски","lang.pl":"Полски","lang.de":"Немски","lang.fr":"Френски","lang.es":"Испански","lang.it":"Италиански","lang.pt":"Португалски","lang.nl":"Нидерландски","lang.sv":"Шведски","lang.no":"Норвежки","lang.da":"Датски","lang.fi":"Фински","lang.cs":"Чешки","lang.sk":"Словашки","lang.hu":"Унгарски","lang.ro":"Румънски","lang.bg":"Български","lang.uk":"Украински","lang.ja":"Японски","lang.ko":"Корейски","lang.zh":"Китайски","lang.ar":"Арабски"},zo={ok:"OK",cancel:"Скасувати",save:"Зберегти",close:"Закрити",delete:"Видалити",edit:"Редагувати",add:"Додати",remove:"Прибрати",search:"Пошук",filter:"Фільтрувати",refresh:"Оновити",loading:"Завантаження…",noData:"Немає даних",error:"Помилка",success:"Успіх",warning:"Попередження",info:"Інформація",yes:"Так",no:"Ні",confirm:"Підтвердити",back:"Назад",next:"Далі",previous:"Попередній",finish:"Завершити",submit:"Надіслати",reset:"Скинути",apply:"Застосувати",undo:"Скасувати",redo:"Повторити",copy:"Копіювати",cut:"Вирізати",paste:"Вставити",selectAll:"Вибрати все",clear:"Очистити",upload:"Завантажити",download:"Завантажити",print:"Друкувати",export:"Експортувати",import:"Імпортувати",settings:"Налаштування",help:"Допомога",about:"Про програму",more:"Більше",less:"Менше",show:"Показати",hide:"Приховати",expand:"Розгорнути",collapse:"Згорнути",enabled:"Увімкнено",disabled:"Вимкнено",required:"Обов'язково",optional:"Необов'язково",actions:"Дії",details:"Деталі",overview:"Огляд",all:"Всі",none:"Немає",selected:"Обрано",total:"Всього",of:"з",items:"елементів",page:"Сторінка",rows:"Рядки","app.name":"Додаток","app.version":"Версія","app.about":"Про програму","nav.home":"Головна","nav.back":"Назад","nav.forward":"Вперед","nav.menu":"Меню","nav.sidebar":"Бічна панель","nav.search":"Пошук","nav.favorites":"Обране","nav.recent":"Нещодавнє","nav.notifications":"Сповіщення","nav.profile":"Профіль","nav.logout":"Вийти","carousel.prev":"Попередній слайд","carousel.next":"Наступний слайд","carousel.slide":"Слайд","carousel.of":"з","carousel.autoplay":"Автопрогравання","carousel.pause":"Пауза","confirm.yes":"Так","confirm.no":"Ні","confirm.ok":"OK","confirm.cancel":"Скасувати","confirm.title":"Підтвердження","confirm.deleteMessage":"Ви впевнені, що хочете видалити?","confirm.unsavedChanges":"Незбережені зміни. Відхилити?","console.shell":"Оболонка","console.terminal":"Термінал","console.prompt":"Введіть команду…","console.clear":"Очистити консоль","console.run":"Виконати","console.output":"Вивід","console.newSession":"Нова сесія","console.closeSession":"Закрити сесію","controls.save":"Зберегти","controls.cancel":"Скасувати","controls.delete":"Видалити","controls.edit":"Редагувати","controls.add":"Додати","controls.remove":"Видалити","controls.close":"Закрити","controls.open":"Відкрити","controls.refresh":"Оновити","controls.new":"Новий","controls.duplicate":"Дублювати","controls.sort":"Сортувати","controls.group":"Групувати","controls.pin":"Закріпити","controls.unpin":"Відкріпити","controls.lock":"Заблокувати","controls.unlock":"Розблокувати","controls.share":"Поділитися","controls.archive":"Архівувати","cookie.title":"Згода на cookies","cookie.message":"Цей сайт використовує cookies.","cookie.accept":"Прийняти всі","cookie.reject":"Відхилити всі","cookie.settings":"Налаштування cookies","cookie.necessary":"Необхідні","cookie.analytics":"Аналітичні","cookie.marketing":"Маркетингові","dashboard.title":"Панель керування","dashboard.addWidget":"Додати віджет","dashboard.removeWidget":"Видалити віджет","dashboard.layout":"Макет","dashboard.settings":"Налаштування","dashboard.customize":"Налаштувати","dashboard.resetLayout":"Скинути макет","datetime.today":"Сьогодні","datetime.yesterday":"Вчора","datetime.tomorrow":"Завтра","datetime.selectDate":"Вибрати дату","datetime.selectTime":"Вибрати час","datetime.startDate":"Дата початку","datetime.endDate":"Дата закінчення","datetime.startTime":"Час початку","datetime.endTime":"Час закінчення","datetime.am":"ДП","datetime.pm":"ПП","desktop.start":"Пуск","desktop.taskbar":"Панель завдань","desktop.systemTray":"Системний лоток","desktop.wallpaper":"Шпалери","desktop.icons":"Значки робочого столу","desktop.arrangeIcons":"Упорядкувати значки","dock.pin":"Закріпити на док-панелі","dock.unpin":"Відкріпити від док-панелі","dock.close":"Закрити","dock.minimize":"Згорнути","dock.maximize":"Розгорнути","dock.restore":"Відновити","docEditor.paragraph":"Абзац","docEditor.heading":"Заголовок","docEditor.heading1":"Заголовок 1","docEditor.heading2":"Заголовок 2","docEditor.heading3":"Заголовок 3","docEditor.bulletList":"Маркований список","docEditor.numberedList":"Нумерований список","docEditor.quote":"Цитата","docEditor.code":"Блок коду","docEditor.divider":"Роздільник","docEditor.image":"Зображення","docEditor.table":"Таблиця","docEditor.callout":"Виноска","docEditor.placeholder":"Почніть писати…","docEditor.slashCommand":"Введіть / для команд","files.upload":"Завантажити файл","files.download":"Завантажити","files.delete":"Видалити файл","files.rename":"Перейменувати","files.newFolder":"Нова папка","files.selectFile":"Вибрати файл","files.dropzone":"Перетягніть файли сюди","files.dragDrop":"Перетягніть файли або натисніть","files.maxSize":"Максимальний розмір файлу","files.fileType":"Тип файлу","forms.required":"Це поле обов'язкове","forms.optional":"Необов'язково","forms.submit":"Надіслати","forms.reset":"Скинути","forms.validate":"Перевірити","forms.invalid":"Недійсне значення","forms.minLength":"Мінімальна довжина: {0}","forms.maxLength":"Максимальна довжина: {0}","forms.email":"Введіть дійсну електронну пошту","forms.phone":"Введіть дійсний номер телефону","imageEditor.crop":"Обрізати","imageEditor.rotate":"Повернути","imageEditor.flip":"Відобразити","imageEditor.resize":"Змінити розмір","imageEditor.filter":"Фільтр","imageEditor.draw":"Малювати","imageEditor.text":"Текст","imageEditor.undo":"Скасувати","imageEditor.redo":"Повторити","imageEditor.save":"Зберегти","imageEditor.brightness":"Яскравість","imageEditor.contrast":"Контрастність","imageEditor.saturation":"Насиченість","inbox.compose":"Написати","inbox.reply":"Відповісти","inbox.replyAll":"Відповісти всім","inbox.forward":"Переслати","inbox.delete":"Видалити","inbox.archive":"Архівувати","inbox.markRead":"Позначити як прочитане","inbox.markUnread":"Позначити як непрочитане","inbox.folders":"Папки","inbox.inbox":"Вхідні","inbox.sent":"Надіслані","inbox.drafts":"Чернетки","inbox.trash":"Кошик","inbox.spam":"Спам","inbox.starred":"Позначені","inbox.to":"Кому","inbox.cc":"Копія","inbox.bcc":"Прихована копія","inbox.subject":"Тема","inbox.send":"Надіслати","inbox.discard":"Скасувати","inbox.attachFile":"Прикріпити файл","kanban.addCard":"Додати картку","kanban.addColumn":"Додати колонку","kanban.moveCard":"Перемістити картку","kanban.editCard":"Редагувати картку","kanban.deleteCard":"Видалити картку","kanban.editColumn":"Редагувати колонку","kanban.deleteColumn":"Видалити колонку","lang.en":"Англійська","lang.pl":"Польська","lang.de":"Німецька","lang.fr":"Французька","lang.es":"Іспанська","lang.it":"Італійська","lang.pt":"Португальська","lang.nl":"Нідерландська","lang.sv":"Шведська","lang.no":"Норвезька","lang.da":"Данська","lang.fi":"Фінська","lang.cs":"Чеська","lang.sk":"Словацька","lang.hu":"Угорська","lang.ro":"Румунська","lang.bg":"Болгарська","lang.uk":"Українська","lang.ja":"Японська","lang.ko":"Корейська","lang.zh":"Китайська","lang.ar":"Арабська","login.username":"Ім'я користувача","login.password":"Пароль","login.signIn":"Увійти","login.signOut":"Вийти","login.forgotPassword":"Забули пароль?","login.register":"Зареєструватися","login.rememberMe":"Запам'ятати мене","login.newPassword":"Новий пароль","login.confirmPassword":"Підтвердити пароль","login.twoFactor":"Двофакторна автентифікація","password.strength":"Надійність пароля","password.weak":"Слабкий","password.medium":"Середній","password.strong":"Сильний","password.requirements":"Вимоги до пароля","pdfviewer.page":"Сторінка","pdfviewer.of":"з","pdfviewer.zoom":"Масштаб","pdfviewer.fitPage":"За розміром сторінки","pdfviewer.fitWidth":"За шириною","pdfviewer.download":"Завантажити","pdfviewer.print":"Друкувати","pdfviewer.search":"Пошук у документі","pdfviewer.bookmark":"Закладки","pdfviewer.thumbnail":"Мініатюри","picklist.available":"Доступні","picklist.selected":"Обрані","picklist.addAll":"Додати всі","picklist.removeAll":"Видалити всі","picklist.filter":"Фільтрувати елементи","scheduling.calendar":"Календар","scheduling.event":"Подія","scheduling.allDay":"Весь день","scheduling.today":"Сьогодні","scheduling.week":"Тиждень","scheduling.month":"Місяць","scheduling.year":"Рік","scheduling.day":"День","scheduling.agenda":"Порядок денний","scheduling.addEvent":"Додати подію","scheduling.editEvent":"Редагувати подію","scheduling.deleteEvent":"Видалити подію","scheduling.noEvents":"Немає подій","shortcuts.title":"Гарячі клавіші","shortcuts.description":"Доступні гарячі клавіші","shortcuts.key":"Клавіша","shortcuts.command":"Команда","shortcuts.search":"Пошук гарячих клавіш","signature.clear":"Очистити","signature.save":"Зберегти","signature.sign":"Підпишіть тут","signature.draw":"Намалюйте підпис","spreadsheet.cell":"Клітинка","spreadsheet.row":"Рядок","spreadsheet.column":"Колонка","spreadsheet.formula":"Формула","spreadsheet.insert":"Вставити","spreadsheet.delete":"Видалити","spreadsheet.sort":"Сортувати","spreadsheet.sortAsc":"За зростанням","spreadsheet.sortDesc":"За спаданням","spreadsheet.filter":"Фільтрувати","spreadsheet.export":"Експортувати","spreadsheet.import":"Імпортувати","spreadsheet.addRow":"Додати рядок","spreadsheet.addColumn":"Додати колонку","spreadsheet.deleteRow":"Видалити рядок","spreadsheet.deleteColumn":"Видалити колонку","spreadsheet.freezeRow":"Закріпити рядок","spreadsheet.freezeColumn":"Закріпити колонку","spreadsheet.merge":"Об'єднати клітинки","spreadsheet.unmerge":"Роз'єднати клітинки","terminal.run":"Виконати","terminal.clear":"Очистити","terminal.copy":"Копіювати","terminal.paste":"Вставити","terminal.newSession":"Нова сесія","terminal.closeSession":"Закрити сесію","terminal.selectAll":"Вибрати все","theme.light":"Світла","theme.dark":"Темна","theme.system":"Системна","theme.custom":"Власна","theme.colors":"Кольори","theme.fonts":"Шрифти","theme.apply":"Застосувати тему","theme.preview":"Попередній перегляд","theme.reset":"Скинути","theme.gallery":"Галерея тем","users.profile":"Профіль","users.settings":"Налаштування","users.permissions":"Дозволи","users.role":"Роль","users.active":"Активний","users.inactive":"Неактивний","users.online":"Онлайн","users.offline":"Офлайн","users.lastSeen":"Востаннє бачено","wm.close":"Закрити","wm.minimize":"Згорнути","wm.maximize":"Розгорнути","wm.restore":"Відновити","wm.tile":"Вікна плиткою","wm.cascade":"Вікна каскадом","wm.closeAll":"Закрити всі","wm.minimizeAll":"Згорнути всі","wm.newWindow":"Нове вікно","wm.moveToFront":"На передній план"},Ao={ok:"OK",cancel:"キャンセル",save:"保存",close:"閉じる",delete:"削除",edit:"編集",add:"追加",remove:"削除",search:"検索",filter:"フィルター",refresh:"更新",loading:"読み込み中…",noData:"データなし",error:"エラー",success:"成功",warning:"警告",info:"情報",yes:"はい",no:"いいえ",confirm:"確認",back:"戻る",next:"次へ",previous:"前へ",finish:"完了",submit:"送信",reset:"リセット",apply:"適用",undo:"元に戻す",redo:"やり直す",copy:"コピー",cut:"切り取り",paste:"貼り付け",selectAll:"すべて選択",clear:"クリア",upload:"アップロード",download:"ダウンロード",print:"印刷",export:"エクスポート",import:"インポート",settings:"設定",help:"ヘルプ",about:"バージョン情報",more:"もっと見る",less:"閉じる",show:"表示",hide:"非表示",expand:"展開",collapse:"折りたたむ",enabled:"有効",disabled:"無効",required:"必須",optional:"任意",actions:"アクション",details:"詳細",overview:"概要",all:"すべて",none:"なし",selected:"選択済み",total:"合計",of:"/",items:"件",page:"ページ",rows:"行","app.name":"アプリケーション","app.version":"バージョン","app.about":"バージョン情報","nav.home":"ホーム","nav.back":"戻る","nav.forward":"進む","nav.menu":"メニュー","nav.sidebar":"サイドバー","nav.search":"検索","nav.favorites":"お気に入り","nav.recent":"最近","nav.notifications":"通知","nav.profile":"プロフィール","nav.logout":"ログアウト","carousel.prev":"前のスライド","carousel.next":"次のスライド","carousel.slide":"スライド","carousel.of":"/","carousel.autoplay":"自動再生","carousel.pause":"一時停止","confirm.yes":"はい","confirm.no":"いいえ","confirm.ok":"OK","confirm.cancel":"キャンセル","confirm.title":"確認","confirm.deleteMessage":"本当に削除しますか?","confirm.unsavedChanges":"未保存の変更があります。破棄しますか?","console.shell":"シェル","console.terminal":"ターミナル","console.prompt":"コマンドを入力…","console.clear":"コンソールをクリア","console.run":"実行","console.output":"出力","console.newSession":"新しいセッション","console.closeSession":"セッションを閉じる","controls.save":"保存","controls.cancel":"キャンセル","controls.delete":"削除","controls.edit":"編集","controls.add":"追加","controls.remove":"削除","controls.close":"閉じる","controls.open":"開く","controls.refresh":"更新","controls.new":"新規","controls.duplicate":"複製","controls.sort":"並べ替え","controls.group":"グループ化","controls.pin":"ピン留め","controls.unpin":"ピン留め解除","controls.lock":"ロック","controls.unlock":"ロック解除","controls.share":"共有","controls.archive":"アーカイブ","cookie.title":"Cookieの同意","cookie.message":"このサイトではCookieを使用しています。","cookie.accept":"すべて許可","cookie.reject":"すべて拒否","cookie.settings":"Cookie設定","cookie.necessary":"必須","cookie.analytics":"分析","cookie.marketing":"マーケティング","dashboard.title":"ダッシュボード","dashboard.addWidget":"ウィジェットを追加","dashboard.removeWidget":"ウィジェットを削除","dashboard.layout":"レイアウト","dashboard.settings":"設定","dashboard.customize":"カスタマイズ","dashboard.resetLayout":"レイアウトをリセット","datetime.today":"今日","datetime.yesterday":"昨日","datetime.tomorrow":"明日","datetime.selectDate":"日付を選択","datetime.selectTime":"時刻を選択","datetime.startDate":"開始日","datetime.endDate":"終了日","datetime.startTime":"開始時刻","datetime.endTime":"終了時刻","datetime.am":"午前","datetime.pm":"午後","desktop.start":"スタート","desktop.taskbar":"タスクバー","desktop.systemTray":"システムトレイ","desktop.wallpaper":"壁紙","desktop.icons":"デスクトップアイコン","desktop.arrangeIcons":"アイコンの整列","dock.pin":"ドックに固定","dock.unpin":"ドックから外す","dock.close":"閉じる","dock.minimize":"最小化","dock.maximize":"最大化","dock.restore":"復元","docEditor.paragraph":"段落","docEditor.heading":"見出し","docEditor.heading1":"見出し1","docEditor.heading2":"見出し2","docEditor.heading3":"見出し3","docEditor.bulletList":"箇条書き","docEditor.numberedList":"番号付きリスト","docEditor.quote":"引用","docEditor.code":"コードブロック","docEditor.divider":"区切り線","docEditor.image":"画像","docEditor.table":"テーブル","docEditor.callout":"注意書き","docEditor.placeholder":"入力を開始…","docEditor.slashCommand":"/でコマンド入力","files.upload":"ファイルをアップロード","files.download":"ダウンロード","files.delete":"ファイルを削除","files.rename":"名前を変更","files.newFolder":"新しいフォルダー","files.selectFile":"ファイルを選択","files.dropzone":"ここにファイルをドロップ","files.dragDrop":"ファイルをドラッグ&ドロップまたはクリック","files.maxSize":"最大ファイルサイズ","files.fileType":"ファイルの種類","forms.required":"この項目は必須です","forms.optional":"任意","forms.submit":"送信","forms.reset":"リセット","forms.validate":"検証","forms.invalid":"無効な値","forms.minLength":"最小文字数: {0}","forms.maxLength":"最大文字数: {0}","forms.email":"有効なメールアドレスを入力してください","forms.phone":"有効な電話番号を入力してください","imageEditor.crop":"トリミング","imageEditor.rotate":"回転","imageEditor.flip":"反転","imageEditor.resize":"サイズ変更","imageEditor.filter":"フィルター","imageEditor.draw":"描画","imageEditor.text":"テキスト","imageEditor.undo":"元に戻す","imageEditor.redo":"やり直す","imageEditor.save":"保存","imageEditor.brightness":"明るさ","imageEditor.contrast":"コントラスト","imageEditor.saturation":"彩度","inbox.compose":"作成","inbox.reply":"返信","inbox.replyAll":"全員に返信","inbox.forward":"転送","inbox.delete":"削除","inbox.archive":"アーカイブ","inbox.markRead":"既読にする","inbox.markUnread":"未読にする","inbox.folders":"フォルダー","inbox.inbox":"受信トレイ","inbox.sent":"送信済み","inbox.drafts":"下書き","inbox.trash":"ゴミ箱","inbox.spam":"スパム","inbox.starred":"スター付き","inbox.to":"宛先","inbox.cc":"CC","inbox.bcc":"BCC","inbox.subject":"件名","inbox.send":"送信","inbox.discard":"破棄","inbox.attachFile":"ファイルを添付","kanban.addCard":"カードを追加","kanban.addColumn":"列を追加","kanban.moveCard":"カードを移動","kanban.editCard":"カードを編集","kanban.deleteCard":"カードを削除","kanban.editColumn":"列を編集","kanban.deleteColumn":"列を削除","lang.en":"英語","lang.pl":"ポーランド語","lang.de":"ドイツ語","lang.fr":"フランス語","lang.es":"スペイン語","lang.it":"イタリア語","lang.pt":"ポルトガル語","lang.nl":"オランダ語","lang.sv":"スウェーデン語","lang.no":"ノルウェー語","lang.da":"デンマーク語","lang.fi":"フィンランド語","lang.cs":"チェコ語","lang.sk":"スロバキア語","lang.hu":"ハンガリー語","lang.ro":"ルーマニア語","lang.bg":"ブルガリア語","lang.uk":"ウクライナ語","lang.ja":"日本語","lang.ko":"韓国語","lang.zh":"中国語","lang.ar":"アラビア語","login.username":"ユーザー名","login.password":"パスワード","login.signIn":"サインイン","login.signOut":"サインアウト","login.forgotPassword":"パスワードをお忘れですか?","login.register":"新規登録","login.rememberMe":"ログイン状態を保持","login.newPassword":"新しいパスワード","login.confirmPassword":"パスワードの確認","login.twoFactor":"二要素認証","password.strength":"パスワード強度","password.weak":"弱い","password.medium":"普通","password.strong":"強い","password.requirements":"パスワード要件","pdfviewer.page":"ページ","pdfviewer.of":"/","pdfviewer.zoom":"ズーム","pdfviewer.fitPage":"ページに合わせる","pdfviewer.fitWidth":"幅に合わせる","pdfviewer.download":"ダウンロード","pdfviewer.print":"印刷","pdfviewer.search":"ドキュメント内を検索","pdfviewer.bookmark":"ブックマーク","pdfviewer.thumbnail":"サムネイル","picklist.available":"利用可能","picklist.selected":"選択済み","picklist.addAll":"すべて追加","picklist.removeAll":"すべて削除","picklist.filter":"項目をフィルター","scheduling.calendar":"カレンダー","scheduling.event":"イベント","scheduling.allDay":"終日","scheduling.today":"今日","scheduling.week":"週","scheduling.month":"月","scheduling.year":"年","scheduling.day":"日","scheduling.agenda":"アジェンダ","scheduling.addEvent":"イベントを追加","scheduling.editEvent":"イベントを編集","scheduling.deleteEvent":"イベントを削除","scheduling.noEvents":"イベントなし","shortcuts.title":"キーボードショートカット","shortcuts.description":"利用可能なショートカット","shortcuts.key":"キー","shortcuts.command":"コマンド","shortcuts.search":"ショートカットを検索","signature.clear":"クリア","signature.save":"保存","signature.sign":"ここに署名","signature.draw":"署名を描いてください","spreadsheet.cell":"セル","spreadsheet.row":"行","spreadsheet.column":"列","spreadsheet.formula":"数式","spreadsheet.insert":"挿入","spreadsheet.delete":"削除","spreadsheet.sort":"並べ替え","spreadsheet.sortAsc":"昇順","spreadsheet.sortDesc":"降順","spreadsheet.filter":"フィルター","spreadsheet.export":"エクスポート","spreadsheet.import":"インポート","spreadsheet.addRow":"行を追加","spreadsheet.addColumn":"列を追加","spreadsheet.deleteRow":"行を削除","spreadsheet.deleteColumn":"列を削除","spreadsheet.freezeRow":"行を固定","spreadsheet.freezeColumn":"列を固定","spreadsheet.merge":"セルを結合","spreadsheet.unmerge":"セルの結合を解除","terminal.run":"実行","terminal.clear":"クリア","terminal.copy":"コピー","terminal.paste":"貼り付け","terminal.newSession":"新しいセッション","terminal.closeSession":"セッションを閉じる","terminal.selectAll":"すべて選択","theme.light":"ライト","theme.dark":"ダーク","theme.system":"システム","theme.custom":"カスタム","theme.colors":"色","theme.fonts":"フォント","theme.apply":"テーマを適用","theme.preview":"プレビュー","theme.reset":"デフォルトに戻す","theme.gallery":"テーマギャラリー","users.profile":"プロフィール","users.settings":"設定","users.permissions":"権限","users.role":"ロール","users.active":"アクティブ","users.inactive":"非アクティブ","users.online":"オンライン","users.offline":"オフライン","users.lastSeen":"最終ログイン","wm.close":"閉じる","wm.minimize":"最小化","wm.maximize":"最大化","wm.restore":"復元","wm.tile":"ウィンドウの並替","wm.cascade":"カスケード","wm.closeAll":"すべて閉じる","wm.minimizeAll":"すべて最小化","wm.newWindow":"新しいウィンドウ","wm.moveToFront":"最前面に移動"},Fo={ok:"확인",cancel:"취소",save:"저장",close:"닫기",delete:"삭제",edit:"편집",add:"추가",remove:"제거",search:"검색",filter:"필터",refresh:"새로고침",loading:"로딩 중…",noData:"데이터 없음",error:"오류",success:"성공",warning:"경고",info:"정보",yes:"예",no:"아니오",confirm:"확인",back:"뒤로",next:"다음",previous:"이전",finish:"완료",submit:"제출",reset:"초기화",apply:"적용",undo:"실행취소",redo:"다시실행",copy:"복사",cut:"잘라내기",paste:"붙여넣기",selectAll:"전체선택",clear:"지우기",upload:"업로드",download:"다운로드",print:"인쇄",export:"내보내기",import:"가져오기",settings:"설정",help:"도움말",about:"정보",more:"더보기",less:"줄이기",show:"표시",hide:"숨기기",expand:"펼치기",collapse:"접기",enabled:"활성",disabled:"비활성",required:"필수",optional:"선택사항",actions:"작업",details:"상세",overview:"개요",all:"전체",none:"없음",selected:"선택됨",total:"합계",of:"/",items:"개",page:"페이지",rows:"행","app.name":"애플리케이션","app.version":"버전","app.about":"정보","nav.home":"홈","nav.back":"뒤로","nav.forward":"앞으로","nav.menu":"메뉴","nav.sidebar":"사이드바","nav.search":"검색","nav.favorites":"즐겨찾기","nav.recent":"최근","nav.notifications":"알림","nav.profile":"프로필","nav.logout":"로그아웃","carousel.prev":"이전 슬라이드","carousel.next":"다음 슬라이드","carousel.slide":"슬라이드","carousel.of":"/","carousel.autoplay":"자동재생","carousel.pause":"일시정지","confirm.yes":"예","confirm.no":"아니오","confirm.ok":"확인","confirm.cancel":"취소","confirm.title":"확인","confirm.deleteMessage":"정말 삭제하시겠습니까?","confirm.unsavedChanges":"저장되지 않은 변경사항이 있습니다. 취소하시겠습니까?","console.shell":"셸","console.terminal":"터미널","console.prompt":"명령어 입력…","console.clear":"콘솔 지우기","console.run":"실행","console.output":"출력","console.newSession":"새 세션","console.closeSession":"세션 닫기","controls.save":"저장","controls.cancel":"취소","controls.delete":"삭제","controls.edit":"편집","controls.add":"추가","controls.remove":"제거","controls.close":"닫기","controls.open":"열기","controls.refresh":"새로고침","controls.new":"새로 만들기","controls.duplicate":"복제","controls.sort":"정렬","controls.group":"그룹화","controls.pin":"고정","controls.unpin":"고정 해제","controls.lock":"잠금","controls.unlock":"잠금 해제","controls.share":"공유","controls.archive":"보관","cookie.title":"쿠키 동의","cookie.message":"이 사이트는 쿠키를 사용합니다.","cookie.accept":"모두 허용","cookie.reject":"모두 거부","cookie.settings":"쿠키 설정","cookie.necessary":"필수","cookie.analytics":"분석","cookie.marketing":"마케팅","dashboard.title":"대시보드","dashboard.addWidget":"위젯 추가","dashboard.removeWidget":"위젯 제거","dashboard.layout":"레이아웃","dashboard.settings":"설정","dashboard.customize":"사용자 정의","dashboard.resetLayout":"레이아웃 초기화","datetime.today":"오늘","datetime.yesterday":"어제","datetime.tomorrow":"내일","datetime.selectDate":"날짜 선택","datetime.selectTime":"시간 선택","datetime.startDate":"시작일","datetime.endDate":"종료일","datetime.startTime":"시작 시간","datetime.endTime":"종료 시간","datetime.am":"오전","datetime.pm":"오후","desktop.start":"시작","desktop.taskbar":"작업 표시줄","desktop.systemTray":"시스템 트레이","desktop.wallpaper":"배경화면","desktop.icons":"바탕화면 아이콘","desktop.arrangeIcons":"아이콘 정렬","dock.pin":"독에 고정","dock.unpin":"독에서 해제","dock.close":"닫기","dock.minimize":"최소화","dock.maximize":"최대화","dock.restore":"복원","docEditor.paragraph":"단락","docEditor.heading":"제목","docEditor.heading1":"제목 1","docEditor.heading2":"제목 2","docEditor.heading3":"제목 3","docEditor.bulletList":"글머리 기호 목록","docEditor.numberedList":"번호 매기기 목록","docEditor.quote":"인용","docEditor.code":"코드 블록","docEditor.divider":"구분선","docEditor.image":"이미지","docEditor.table":"표","docEditor.callout":"설명","docEditor.placeholder":"입력 시작…","docEditor.slashCommand":"/로 명령 입력","files.upload":"파일 업로드","files.download":"다운로드","files.delete":"파일 삭제","files.rename":"이름 변경","files.newFolder":"새 폴더","files.selectFile":"파일 선택","files.dropzone":"여기에 파일을 드롭하세요","files.dragDrop":"파일을 드래그 앤 드롭하거나 클릭","files.maxSize":"최대 파일 크기","files.fileType":"파일 유형","forms.required":"이 항목은 필수입니다","forms.optional":"선택사항","forms.submit":"제출","forms.reset":"초기화","forms.validate":"검증","forms.invalid":"잘못된 값","forms.minLength":"최소 길이: {0}","forms.maxLength":"최대 길이: {0}","forms.email":"유효한 이메일을 입력하세요","forms.phone":"유효한 전화번호를 입력하세요","imageEditor.crop":"자르기","imageEditor.rotate":"회전","imageEditor.flip":"뒤집기","imageEditor.resize":"크기 조정","imageEditor.filter":"필터","imageEditor.draw":"그리기","imageEditor.text":"텍스트","imageEditor.undo":"실행취소","imageEditor.redo":"다시실행","imageEditor.save":"저장","imageEditor.brightness":"밝기","imageEditor.contrast":"대비","imageEditor.saturation":"채도","inbox.compose":"작성","inbox.reply":"답장","inbox.replyAll":"전체 답장","inbox.forward":"전달","inbox.delete":"삭제","inbox.archive":"보관","inbox.markRead":"읽음으로 표시","inbox.markUnread":"읽지 않음으로 표시","inbox.folders":"폴더","inbox.inbox":"받은편지함","inbox.sent":"보낸편지함","inbox.drafts":"임시보관함","inbox.trash":"휴지통","inbox.spam":"스팸","inbox.starred":"별표","inbox.to":"받는 사람","inbox.cc":"참조","inbox.bcc":"숨은 참조","inbox.subject":"제목","inbox.send":"보내기","inbox.discard":"취소","inbox.attachFile":"파일 첨부","kanban.addCard":"카드 추가","kanban.addColumn":"열 추가","kanban.moveCard":"카드 이동","kanban.editCard":"카드 편집","kanban.deleteCard":"카드 삭제","kanban.editColumn":"열 편집","kanban.deleteColumn":"열 삭제","lang.en":"영어","lang.pl":"폴란드어","lang.de":"독일어","lang.fr":"프랑스어","lang.es":"스페인어","lang.it":"이탈리아어","lang.pt":"포르투갈어","lang.nl":"네덜란드어","lang.sv":"스웨덴어","lang.no":"노르웨이어","lang.da":"덴마크어","lang.fi":"핀란드어","lang.cs":"체코어","lang.sk":"슬로바키아어","lang.hu":"헝가리어","lang.ro":"루마니아어","lang.bg":"불가리아어","lang.uk":"우크라이나어","lang.ja":"일본어","lang.ko":"한국어","lang.zh":"중국어","lang.ar":"아랍어","login.username":"사용자 이름","login.password":"비밀번호","login.signIn":"로그인","login.signOut":"로그아웃","login.forgotPassword":"비밀번호를 잊으셨나요?","login.register":"회원가입","login.rememberMe":"로그인 상태 유지","login.newPassword":"새 비밀번호","login.confirmPassword":"비밀번호 확인","login.twoFactor":"이중 인증","password.strength":"비밀번호 강도","password.weak":"약함","password.medium":"보통","password.strong":"강함","password.requirements":"비밀번호 요구사항","pdfviewer.page":"페이지","pdfviewer.of":"/","pdfviewer.zoom":"확대/축소","pdfviewer.fitPage":"페이지에 맞추기","pdfviewer.fitWidth":"너비에 맞추기","pdfviewer.download":"다운로드","pdfviewer.print":"인쇄","pdfviewer.search":"문서 내 검색","pdfviewer.bookmark":"북마크","pdfviewer.thumbnail":"썸네일","picklist.available":"사용 가능","picklist.selected":"선택됨","picklist.addAll":"전체 추가","picklist.removeAll":"전체 제거","picklist.filter":"항목 필터","scheduling.calendar":"캘린더","scheduling.event":"이벤트","scheduling.allDay":"종일","scheduling.today":"오늘","scheduling.week":"주","scheduling.month":"월","scheduling.year":"년","scheduling.day":"일","scheduling.agenda":"일정","scheduling.addEvent":"이벤트 추가","scheduling.editEvent":"이벤트 편집","scheduling.deleteEvent":"이벤트 삭제","scheduling.noEvents":"이벤트 없음","shortcuts.title":"키보드 단축키","shortcuts.description":"사용 가능한 단축키","shortcuts.key":"키","shortcuts.command":"명령","shortcuts.search":"단축키 검색","signature.clear":"지우기","signature.save":"저장","signature.sign":"여기에 서명","signature.draw":"서명을 그려주세요","spreadsheet.cell":"셀","spreadsheet.row":"행","spreadsheet.column":"열","spreadsheet.formula":"수식","spreadsheet.insert":"삽입","spreadsheet.delete":"삭제","spreadsheet.sort":"정렬","spreadsheet.sortAsc":"오름차순","spreadsheet.sortDesc":"내림차순","spreadsheet.filter":"필터","spreadsheet.export":"내보내기","spreadsheet.import":"가져오기","spreadsheet.addRow":"행 추가","spreadsheet.addColumn":"열 추가","spreadsheet.deleteRow":"행 삭제","spreadsheet.deleteColumn":"열 삭제","spreadsheet.freezeRow":"행 고정","spreadsheet.freezeColumn":"열 고정","spreadsheet.merge":"셀 병합","spreadsheet.unmerge":"셀 병합 해제","terminal.run":"실행","terminal.clear":"지우기","terminal.copy":"복사","terminal.paste":"붙여넣기","terminal.newSession":"새 세션","terminal.closeSession":"세션 닫기","terminal.selectAll":"전체선택","theme.light":"라이트","theme.dark":"다크","theme.system":"시스템","theme.custom":"사용자 정의","theme.colors":"색상","theme.fonts":"글꼴","theme.apply":"테마 적용","theme.preview":"미리보기","theme.reset":"기본값으로 복원","theme.gallery":"테마 갤러리","users.profile":"프로필","users.settings":"설정","users.permissions":"권한","users.role":"역할","users.active":"활성","users.inactive":"비활성","users.online":"온라인","users.offline":"오프라인","users.lastSeen":"마지막 접속","wm.close":"닫기","wm.minimize":"최소화","wm.maximize":"최대화","wm.restore":"복원","wm.tile":"창 정렬","wm.cascade":"계단식 배열","wm.closeAll":"모두 닫기","wm.minimizeAll":"모두 최소화","wm.newWindow":"새 창","wm.moveToFront":"맨 앞으로"},Io={ok:"确定",cancel:"取消",save:"保存",close:"关闭",delete:"删除",edit:"编辑",add:"添加",remove:"移除",search:"搜索",filter:"筛选",refresh:"刷新",loading:"加载中…",noData:"暂无数据",error:"错误",success:"成功",warning:"警告",info:"信息",yes:"是",no:"否",confirm:"确认",back:"返回",next:"下一步",previous:"上一步",finish:"完成",submit:"提交",reset:"重置",apply:"应用",undo:"撤销",redo:"重做",copy:"复制",cut:"剪切",paste:"粘贴",selectAll:"全选",clear:"清除",upload:"上传",download:"下载",print:"打印",export:"导出",import:"导入",settings:"设置",help:"帮助",about:"关于",more:"更多",less:"收起",show:"显示",hide:"隐藏",expand:"展开",collapse:"折叠",enabled:"已启用",disabled:"已禁用",required:"必填",optional:"选填",actions:"操作",details:"详情",overview:"概览",all:"全部",none:"无",selected:"已选择",total:"合计",of:"/",items:"项",page:"页",rows:"行","app.name":"应用程序","app.version":"版本","app.about":"关于","nav.home":"首页","nav.back":"返回","nav.forward":"前进","nav.menu":"菜单","nav.sidebar":"侧边栏","nav.search":"搜索","nav.favorites":"收藏","nav.recent":"最近","nav.notifications":"通知","nav.profile":"个人资料","nav.logout":"退出登录","carousel.prev":"上一张","carousel.next":"下一张","carousel.slide":"幻灯片","carousel.of":"/","carousel.autoplay":"自动播放","carousel.pause":"暂停","confirm.yes":"是","confirm.no":"否","confirm.ok":"确定","confirm.cancel":"取消","confirm.title":"确认","confirm.deleteMessage":"确定要删除吗?","confirm.unsavedChanges":"有未保存的更改。要放弃吗?","console.shell":"命令行","console.terminal":"终端","console.prompt":"输入命令…","console.clear":"清空控制台","console.run":"运行","console.output":"输出","console.newSession":"新建会话","console.closeSession":"关闭会话","controls.save":"保存","controls.cancel":"取消","controls.delete":"删除","controls.edit":"编辑","controls.add":"添加","controls.remove":"移除","controls.close":"关闭","controls.open":"打开","controls.refresh":"刷新","controls.new":"新建","controls.duplicate":"复制","controls.sort":"排序","controls.group":"分组","controls.pin":"固定","controls.unpin":"取消固定","controls.lock":"锁定","controls.unlock":"解锁","controls.share":"分享","controls.archive":"归档","cookie.title":"Cookie 同意","cookie.message":"本网站使用 Cookie 以改善您的体验。","cookie.accept":"全部接受","cookie.reject":"全部拒绝","cookie.settings":"Cookie 设置","cookie.necessary":"必要","cookie.analytics":"分析","cookie.marketing":"营销","dashboard.title":"仪表盘","dashboard.addWidget":"添加小部件","dashboard.removeWidget":"移除小部件","dashboard.layout":"布局","dashboard.settings":"设置","dashboard.customize":"自定义","dashboard.resetLayout":"重置布局","datetime.today":"今天","datetime.yesterday":"昨天","datetime.tomorrow":"明天","datetime.selectDate":"选择日期","datetime.selectTime":"选择时间","datetime.startDate":"开始日期","datetime.endDate":"结束日期","datetime.startTime":"开始时间","datetime.endTime":"结束时间","datetime.am":"上午","datetime.pm":"下午","desktop.start":"开始","desktop.taskbar":"任务栏","desktop.systemTray":"系统托盘","desktop.wallpaper":"壁纸","desktop.icons":"桌面图标","desktop.arrangeIcons":"排列图标","dock.pin":"固定到 Dock","dock.unpin":"从 Dock 取消固定","dock.close":"关闭","dock.minimize":"最小化","dock.maximize":"最大化","dock.restore":"还原","docEditor.paragraph":"段落","docEditor.heading":"标题","docEditor.heading1":"标题 1","docEditor.heading2":"标题 2","docEditor.heading3":"标题 3","docEditor.bulletList":"无序列表","docEditor.numberedList":"有序列表","docEditor.quote":"引用","docEditor.code":"代码块","docEditor.divider":"分割线","docEditor.image":"图片","docEditor.table":"表格","docEditor.callout":"提示框","docEditor.placeholder":"开始输入…","docEditor.slashCommand":"输入 / 查看命令","files.upload":"上传文件","files.download":"下载","files.delete":"删除文件","files.rename":"重命名","files.newFolder":"新建文件夹","files.selectFile":"选择文件","files.dropzone":"将文件拖放到此处","files.dragDrop":"拖放文件或点击浏览","files.maxSize":"最大文件大小","files.fileType":"文件类型","forms.required":"此字段为必填项","forms.optional":"选填","forms.submit":"提交","forms.reset":"重置","forms.validate":"验证","forms.invalid":"无效值","forms.minLength":"最小长度:{0}","forms.maxLength":"最大长度:{0}","forms.email":"请输入有效的电子邮件","forms.phone":"请输入有效的电话号码","imageEditor.crop":"裁剪","imageEditor.rotate":"旋转","imageEditor.flip":"翻转","imageEditor.resize":"调整大小","imageEditor.filter":"滤镜","imageEditor.draw":"绘制","imageEditor.text":"文字","imageEditor.undo":"撤销","imageEditor.redo":"重做","imageEditor.save":"保存","imageEditor.brightness":"亮度","imageEditor.contrast":"对比度","imageEditor.saturation":"饱和度","inbox.compose":"撰写","inbox.reply":"回复","inbox.replyAll":"全部回复","inbox.forward":"转发","inbox.delete":"删除","inbox.archive":"归档","inbox.markRead":"标为已读","inbox.markUnread":"标为未读","inbox.folders":"文件夹","inbox.inbox":"收件箱","inbox.sent":"已发送","inbox.drafts":"草稿箱","inbox.trash":"回收站","inbox.spam":"垃圾邮件","inbox.starred":"星标邮件","inbox.to":"收件人","inbox.cc":"抄送","inbox.bcc":"密送","inbox.subject":"主题","inbox.send":"发送","inbox.discard":"放弃","inbox.attachFile":"添加附件","kanban.addCard":"添加卡片","kanban.addColumn":"添加列","kanban.moveCard":"移动卡片","kanban.editCard":"编辑卡片","kanban.deleteCard":"删除卡片","kanban.editColumn":"编辑列","kanban.deleteColumn":"删除列","lang.en":"英语","lang.pl":"波兰语","lang.de":"德语","lang.fr":"法语","lang.es":"西班牙语","lang.it":"意大利语","lang.pt":"葡萄牙语","lang.nl":"荷兰语","lang.sv":"瑞典语","lang.no":"挪威语","lang.da":"丹麦语","lang.fi":"芬兰语","lang.cs":"捷克语","lang.sk":"斯洛伐克语","lang.hu":"匈牙利语","lang.ro":"罗马尼亚语","lang.bg":"保加利亚语","lang.uk":"乌克兰语","lang.ja":"日语","lang.ko":"韩语","lang.zh":"中文","lang.ar":"阿拉伯语","login.username":"用户名","login.password":"密码","login.signIn":"登录","login.signOut":"退出","login.forgotPassword":"忘记密码?","login.register":"注册","login.rememberMe":"记住我","login.newPassword":"新密码","login.confirmPassword":"确认密码","login.twoFactor":"两步验证","password.strength":"密码强度","password.weak":"弱","password.medium":"中","password.strong":"强","password.requirements":"密码要求","pdfviewer.page":"页","pdfviewer.of":"/","pdfviewer.zoom":"缩放","pdfviewer.fitPage":"适合页面","pdfviewer.fitWidth":"适合宽度","pdfviewer.download":"下载","pdfviewer.print":"打印","pdfviewer.search":"在文档中搜索","pdfviewer.bookmark":"书签","pdfviewer.thumbnail":"缩略图","picklist.available":"可用","picklist.selected":"已选择","picklist.addAll":"全部添加","picklist.removeAll":"全部移除","picklist.filter":"筛选项目","scheduling.calendar":"日历","scheduling.event":"事件","scheduling.allDay":"全天","scheduling.today":"今天","scheduling.week":"周","scheduling.month":"月","scheduling.year":"年","scheduling.day":"日","scheduling.agenda":"日程","scheduling.addEvent":"添加事件","scheduling.editEvent":"编辑事件","scheduling.deleteEvent":"删除事件","scheduling.noEvents":"暂无事件","shortcuts.title":"键盘快捷键","shortcuts.description":"可用快捷键","shortcuts.key":"按键","shortcuts.command":"命令","shortcuts.search":"搜索快捷键","signature.clear":"清除","signature.save":"保存","signature.sign":"在此签名","signature.draw":"请绘制您的签名","spreadsheet.cell":"单元格","spreadsheet.row":"行","spreadsheet.column":"列","spreadsheet.formula":"公式","spreadsheet.insert":"插入","spreadsheet.delete":"删除","spreadsheet.sort":"排序","spreadsheet.sortAsc":"升序","spreadsheet.sortDesc":"降序","spreadsheet.filter":"筛选","spreadsheet.export":"导出","spreadsheet.import":"导入","spreadsheet.addRow":"添加行","spreadsheet.addColumn":"添加列","spreadsheet.deleteRow":"删除行","spreadsheet.deleteColumn":"删除列","spreadsheet.freezeRow":"冻结行","spreadsheet.freezeColumn":"冻结列","spreadsheet.merge":"合并单元格","spreadsheet.unmerge":"取消合并","terminal.run":"运行","terminal.clear":"清除","terminal.copy":"复制","terminal.paste":"粘贴","terminal.newSession":"新建会话","terminal.closeSession":"关闭会话","terminal.selectAll":"全选","theme.light":"浅色","theme.dark":"深色","theme.system":"跟随系统","theme.custom":"自定义","theme.colors":"颜色","theme.fonts":"字体","theme.apply":"应用主题","theme.preview":"预览","theme.reset":"恢复默认","theme.gallery":"主题库","users.profile":"个人资料","users.settings":"设置","users.permissions":"权限","users.role":"角色","users.active":"活跃","users.inactive":"不活跃","users.online":"在线","users.offline":"离线","users.lastSeen":"最后在线","wm.close":"关闭","wm.minimize":"最小化","wm.maximize":"最大化","wm.restore":"还原","wm.tile":"平铺窗口","wm.cascade":"层叠窗口","wm.closeAll":"关闭全部","wm.minimizeAll":"最小化全部","wm.newWindow":"新建窗口","wm.moveToFront":"置于最前"},Do={ok:"حسناً",cancel:"إلغاء",save:"حفظ",close:"إغلاق",delete:"حذف",edit:"تعديل",add:"إضافة",remove:"إزالة",search:"بحث",filter:"تصفية",refresh:"تحديث",loading:"جاري التحميل…",noData:"لا توجد بيانات",error:"خطأ",success:"نجاح",warning:"تحذير",info:"معلومات",yes:"نعم",no:"لا",confirm:"تأكيد",back:"رجوع",next:"التالي",previous:"السابق",finish:"إنهاء",submit:"إرسال",reset:"إعادة تعيين",apply:"تطبيق",undo:"تراجع",redo:"إعادة",copy:"نسخ",cut:"قص",paste:"لصق",selectAll:"تحديد الكل",clear:"مسح",upload:"رفع",download:"تنزيل",print:"طباعة",export:"تصدير",import:"استيراد",settings:"إعدادات",help:"مساعدة",about:"حول",more:"المزيد",less:"أقل",show:"إظهار",hide:"إخفاء",expand:"توسيع",collapse:"طي",enabled:"مُفعّل",disabled:"مُعطّل",required:"مطلوب",optional:"اختياري",actions:"إجراءات",details:"تفاصيل",overview:"نظرة عامة",all:"الكل",none:"لا شيء",selected:"محدد",total:"المجموع",of:"من",items:"عناصر",page:"صفحة",rows:"صفوف","app.name":"التطبيق","app.version":"الإصدار","app.about":"حول","nav.home":"الرئيسية","nav.back":"رجوع","nav.forward":"تقدم","nav.menu":"القائمة","nav.sidebar":"الشريط الجانبي","nav.search":"بحث","nav.favorites":"المفضلة","nav.recent":"الأخيرة","nav.notifications":"الإشعارات","nav.profile":"الملف الشخصي","nav.logout":"تسجيل خروج","carousel.prev":"الشريحة السابقة","carousel.next":"الشريحة التالية","carousel.slide":"شريحة","carousel.of":"من","carousel.autoplay":"تشغيل تلقائي","carousel.pause":"إيقاف مؤقت","confirm.yes":"نعم","confirm.no":"لا","confirm.ok":"حسناً","confirm.cancel":"إلغاء","confirm.title":"تأكيد","confirm.deleteMessage":"هل أنت متأكد أنك تريد الحذف؟","confirm.unsavedChanges":"لديك تغييرات غير محفوظة. هل تريد التجاهل؟","console.shell":"سطر أوامر","console.terminal":"طرفية","console.prompt":"أدخل أمراً…","console.clear":"مسح وحدة التحكم","console.run":"تشغيل","console.output":"المخرجات","console.newSession":"جلسة جديدة","console.closeSession":"إغلاق الجلسة","controls.save":"حفظ","controls.cancel":"إلغاء","controls.delete":"حذف","controls.edit":"تعديل","controls.add":"إضافة","controls.remove":"إزالة","controls.close":"إغلاق","controls.open":"فتح","controls.refresh":"تحديث","controls.new":"جديد","controls.duplicate":"تكرار","controls.sort":"ترتيب","controls.group":"تجميع","controls.pin":"تثبيت","controls.unpin":"إلغاء التثبيت","controls.lock":"قفل","controls.unlock":"فتح القفل","controls.share":"مشاركة","controls.archive":"أرشفة","cookie.title":"موافقة ملفات تعريف الارتباط","cookie.message":"يستخدم هذا الموقع ملفات تعريف الارتباط لتحسين تجربتك.","cookie.accept":"قبول الكل","cookie.reject":"رفض الكل","cookie.settings":"إعدادات ملفات تعريف الارتباط","cookie.necessary":"ضرورية","cookie.analytics":"تحليلية","cookie.marketing":"تسويقية","dashboard.title":"لوحة المعلومات","dashboard.addWidget":"إضافة عنصر","dashboard.removeWidget":"إزالة عنصر","dashboard.layout":"التخطيط","dashboard.settings":"الإعدادات","dashboard.customize":"تخصيص","dashboard.resetLayout":"إعادة تعيين التخطيط","datetime.today":"اليوم","datetime.yesterday":"أمس","datetime.tomorrow":"غداً","datetime.selectDate":"اختر تاريخاً","datetime.selectTime":"اختر وقتاً","datetime.startDate":"تاريخ البداية","datetime.endDate":"تاريخ النهاية","datetime.startTime":"وقت البداية","datetime.endTime":"وقت النهاية","datetime.am":"ص","datetime.pm":"م","desktop.start":"ابدأ","desktop.taskbar":"شريط المهام","desktop.systemTray":"علبة النظام","desktop.wallpaper":"خلفية","desktop.icons":"أيقونات سطح المكتب","desktop.arrangeIcons":"ترتيب الأيقونات","dock.pin":"تثبيت في الشريط","dock.unpin":"إلغاء التثبيت من الشريط","dock.close":"إغلاق","dock.minimize":"تصغير","dock.maximize":"تكبير","dock.restore":"استعادة","docEditor.paragraph":"فقرة","docEditor.heading":"عنوان","docEditor.heading1":"عنوان 1","docEditor.heading2":"عنوان 2","docEditor.heading3":"عنوان 3","docEditor.bulletList":"قائمة نقطية","docEditor.numberedList":"قائمة مرقمة","docEditor.quote":"اقتباس","docEditor.code":"كتلة برمجية","docEditor.divider":"فاصل","docEditor.image":"صورة","docEditor.table":"جدول","docEditor.callout":"تنبيه","docEditor.placeholder":"ابدأ بالكتابة…","docEditor.slashCommand":"اكتب / للأوامر","files.upload":"رفع ملف","files.download":"تنزيل","files.delete":"حذف ملف","files.rename":"إعادة تسمية","files.newFolder":"مجلد جديد","files.selectFile":"اختر ملفاً","files.dropzone":"اسحب الملفات هنا","files.dragDrop":"اسحب وأفلت الملفات أو انقر للتصفح","files.maxSize":"الحجم الأقصى للملف","files.fileType":"نوع الملف","forms.required":"هذا الحقل مطلوب","forms.optional":"اختياري","forms.submit":"إرسال","forms.reset":"إعادة تعيين","forms.validate":"تحقق","forms.invalid":"قيمة غير صالحة","forms.minLength":"الحد الأدنى للطول: {0}","forms.maxLength":"الحد الأقصى للطول: {0}","forms.email":"أدخل بريداً إلكترونياً صالحاً","forms.phone":"أدخل رقم هاتف صالحاً","imageEditor.crop":"اقتصاص","imageEditor.rotate":"تدوير","imageEditor.flip":"قلب","imageEditor.resize":"تغيير الحجم","imageEditor.filter":"مرشح","imageEditor.draw":"رسم","imageEditor.text":"نص","imageEditor.undo":"تراجع","imageEditor.redo":"إعادة","imageEditor.save":"حفظ","imageEditor.brightness":"السطوع","imageEditor.contrast":"التباين","imageEditor.saturation":"التشبع","inbox.compose":"إنشاء","inbox.reply":"رد","inbox.replyAll":"الرد على الكل","inbox.forward":"إعادة توجيه","inbox.delete":"حذف","inbox.archive":"أرشفة","inbox.markRead":"تحديد كمقروء","inbox.markUnread":"تحديد كغير مقروء","inbox.folders":"المجلدات","inbox.inbox":"البريد الوارد","inbox.sent":"المرسل","inbox.drafts":"المسودات","inbox.trash":"المحذوفات","inbox.spam":"البريد العشوائي","inbox.starred":"المميز بنجمة","inbox.to":"إلى","inbox.cc":"نسخة","inbox.bcc":"نسخة مخفية","inbox.subject":"الموضوع","inbox.send":"إرسال","inbox.discard":"تجاهل","inbox.attachFile":"إرفاق ملف","kanban.addCard":"إضافة بطاقة","kanban.addColumn":"إضافة عمود","kanban.moveCard":"نقل بطاقة","kanban.editCard":"تعديل بطاقة","kanban.deleteCard":"حذف بطاقة","kanban.editColumn":"تعديل عمود","kanban.deleteColumn":"حذف عمود","lang.en":"الإنجليزية","lang.pl":"البولندية","lang.de":"الألمانية","lang.fr":"الفرنسية","lang.es":"الإسبانية","lang.it":"الإيطالية","lang.pt":"البرتغالية","lang.nl":"الهولندية","lang.sv":"السويدية","lang.no":"النرويجية","lang.da":"الدانماركية","lang.fi":"الفنلندية","lang.cs":"التشيكية","lang.sk":"السلوفاكية","lang.hu":"المجرية","lang.ro":"الرومانية","lang.bg":"البلغارية","lang.uk":"الأوكرانية","lang.ja":"اليابانية","lang.ko":"الكورية","lang.zh":"الصينية","lang.ar":"العربية","login.username":"اسم المستخدم","login.password":"كلمة المرور","login.signIn":"تسجيل الدخول","login.signOut":"تسجيل الخروج","login.forgotPassword":"نسيت كلمة المرور؟","login.register":"إنشاء حساب","login.rememberMe":"تذكرني","login.newPassword":"كلمة مرور جديدة","login.confirmPassword":"تأكيد كلمة المرور","login.twoFactor":"المصادقة الثنائية","password.strength":"قوة كلمة المرور","password.weak":"ضعيفة","password.medium":"متوسطة","password.strong":"قوية","password.requirements":"متطلبات كلمة المرور","pdfviewer.page":"صفحة","pdfviewer.of":"من","pdfviewer.zoom":"تكبير","pdfviewer.fitPage":"ملاءمة الصفحة","pdfviewer.fitWidth":"ملاءمة العرض","pdfviewer.download":"تنزيل","pdfviewer.print":"طباعة","pdfviewer.search":"البحث في المستند","pdfviewer.bookmark":"إشارات مرجعية","pdfviewer.thumbnail":"صور مصغرة","picklist.available":"متاح","picklist.selected":"محدد","picklist.addAll":"إضافة الكل","picklist.removeAll":"إزالة الكل","picklist.filter":"تصفية العناصر","scheduling.calendar":"التقويم","scheduling.event":"حدث","scheduling.allDay":"طوال اليوم","scheduling.today":"اليوم","scheduling.week":"أسبوع","scheduling.month":"شهر","scheduling.year":"سنة","scheduling.day":"يوم","scheduling.agenda":"جدول أعمال","scheduling.addEvent":"إضافة حدث","scheduling.editEvent":"تعديل حدث","scheduling.deleteEvent":"حذف حدث","scheduling.noEvents":"لا توجد أحداث","shortcuts.title":"اختصارات لوحة المفاتيح","shortcuts.description":"الاختصارات المتاحة","shortcuts.key":"مفتاح","shortcuts.command":"أمر","shortcuts.search":"البحث عن اختصارات","signature.clear":"مسح","signature.save":"حفظ","signature.sign":"وقّع هنا","signature.draw":"ارسم توقيعك","spreadsheet.cell":"خلية","spreadsheet.row":"صف","spreadsheet.column":"عمود","spreadsheet.formula":"صيغة","spreadsheet.insert":"إدراج","spreadsheet.delete":"حذف","spreadsheet.sort":"ترتيب","spreadsheet.sortAsc":"ترتيب تصاعدي","spreadsheet.sortDesc":"ترتيب تنازلي","spreadsheet.filter":"تصفية","spreadsheet.export":"تصدير","spreadsheet.import":"استيراد","spreadsheet.addRow":"إضافة صف","spreadsheet.addColumn":"إضافة عمود","spreadsheet.deleteRow":"حذف صف","spreadsheet.deleteColumn":"حذف عمود","spreadsheet.freezeRow":"تجميد صف","spreadsheet.freezeColumn":"تجميد عمود","spreadsheet.merge":"دمج خلايا","spreadsheet.unmerge":"إلغاء دمج خلايا","terminal.run":"تشغيل","terminal.clear":"مسح","terminal.copy":"نسخ","terminal.paste":"لصق","terminal.newSession":"جلسة جديدة","terminal.closeSession":"إغلاق الجلسة","terminal.selectAll":"تحديد الكل","theme.light":"فاتح","theme.dark":"داكن","theme.system":"النظام","theme.custom":"مخصص","theme.colors":"الألوان","theme.fonts":"الخطوط","theme.apply":"تطبيق السمة","theme.preview":"معاينة","theme.reset":"استعادة الافتراضي","theme.gallery":"معرض السمات","users.profile":"الملف الشخصي","users.settings":"الإعدادات","users.permissions":"الصلاحيات","users.role":"الدور","users.active":"نشط","users.inactive":"غير نشط","users.online":"متصل","users.offline":"غير متصل","users.lastSeen":"آخر ظهور","wm.close":"إغلاق","wm.minimize":"تصغير","wm.maximize":"تكبير","wm.restore":"استعادة","wm.tile":"ترتيب النوافذ","wm.cascade":"تتالي النوافذ","wm.closeAll":"إغلاق الكل","wm.minimizeAll":"تصغير الكل","wm.newWindow":"نافذة جديدة","wm.moveToFront":"نقل إلى الأمام"},ya={en:ho,pl:fo,de:go,fr:yo,es:bo,it:xo,pt:vo,nl:wo,sv:ko,no:So,da:Co,fi:_o,cs:jo,sk:No,hu:Mo,ro:$o,bg:Eo,uk:zo,ja:Ao,ko:Fo,zh:Io,ar:Do},To=(e,t)=>t,Xa=o.createContext(To),Ro=({t:e,lang:t="en",overrides:a,children:i})=>{const r=o.useMemo(()=>{if(e)return e;const s=ya[t]??ya.en,l=a?{...s,...a}:s;return(c,d)=>l[c]??d},[e,t,a]);return n.jsx(Xa.Provider,{value:r,children:i})};function Se(){return{t:o.useContext(Xa)}}const Qa={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M18 15l-6-6-6 6","chevron-left":"M15 18l-6-6 6-6","chevron-right":"M9 6l6 6-6 6","arrow-left":"M19 12H5m0 0l7 7m-7-7l7-7","arrow-right":"M5 12h14m0 0l-7-7m7 7l-7 7","arrow-up":"M12 19V5m0 0l-7 7m7-7l7 7","arrow-down":"M12 5v14m0 0l7-7m-7 7l-7-7",close:"M18 6L6 18M6 6l12 12",plus:"M12 5v14m-7-7h14",minus:"M5 12h14",check:"M5 13l4 4L19 7",edit:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 113 3L12 15l-4 1 1-4 9.5-9.5z",trash:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",copy:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",upload:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",refresh:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",search:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",filter:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z","sort-asc":"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12","sort-desc":"M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4",menu:"M4 6h16M4 12h16M4 18h16","more-vertical":"M12 5v.01M12 12v.01M12 19v.01","more-horizontal":"M5 12h.01M12 12h.01M19 12h.01",settings:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",eye:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z M15 12a3 3 0 11-6 0 3 3 0 016 0z","eye-off":"M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24 M1 1l22 22",lock:"M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2zm-3-4a4 4 0 10-8 0v4h8V7z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",help:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",calendar:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",clock:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",file:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",folder:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",image:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",mail:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",phone:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",user:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",users:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",home:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",star:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",heart:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",grip:"M4 6h2m4 0h2m4 0h2M4 12h2m4 0h2m4 0h2M4 18h2m4 0h2m4 0h2",play:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",pause:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",stop:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",expand:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",collapse:"M9 9V5m0 4H5m4 0L4 4m11 5h4m-4 0V5m0 4l5-5M9 15v4m0-4H5m4 0l-5 5m15-5h-4m4 0v4m0-4l-5 5","external-link":"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},Po={xs:12,sm:16,md:20,lg:24,xl:32},Bo=o.createContext({});function Lo({path:e,size:t,className:a,style:i,color:r,title:s,onClick:l}){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:r||"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:`nice-icon ${a||""}`,style:i,role:s?"img":"presentation","aria-label":s,"aria-hidden":!s,onClick:l,children:[s&&n.jsx("title",{children:s}),n.jsx("path",{d:e})]})}const Oo=({name:e,size:t="md",className:a,style:i,color:r,title:s,onClick:l})=>{const{resolver:c}=o.useContext(Bo),d=typeof t=="number"?t:Po[t];if(c){const g=c(e,d);if(g)return n.jsx("span",{className:`nice-icon-wrap ${a||""}`,style:i,onClick:l,children:g})}const u=Qa[e];return u?n.jsx(Lo,{path:u,size:d,className:a,style:i,color:r,title:s,onClick:l}):null},Ho=Object.keys(Qa);o.createContext(null);const Ae={submit:{key:"Enter",description:"Submit / Confirm",descriptionKey:"shortcuts.submit"},cancel:{key:"Escape",description:"Cancel / Close",descriptionKey:"shortcuts.cancel"},moveUp:{key:"ArrowUp",description:"Move up",descriptionKey:"shortcuts.moveUp"},moveDown:{key:"ArrowDown",description:"Move down",descriptionKey:"shortcuts.moveDown"},moveLeft:{key:"ArrowLeft",description:"Move left",descriptionKey:"shortcuts.moveLeft"},moveRight:{key:"ArrowRight",description:"Move right",descriptionKey:"shortcuts.moveRight"},first:{key:"Home",description:"Go to first",descriptionKey:"shortcuts.first"},last:{key:"End",description:"Go to last",descriptionKey:"shortcuts.last"},pageUp:{key:"PageUp",description:"Page up",descriptionKey:"shortcuts.pageUp"},pageDown:{key:"PageDown",description:"Page down",descriptionKey:"shortcuts.pageDown"},increment:{key:"ArrowUp",description:"Increase value",descriptionKey:"shortcuts.increment"},decrement:{key:"ArrowDown",description:"Decrease value",descriptionKey:"shortcuts.decrement"},incrementBig:{key:"PageUp",description:"Increase by 10",descriptionKey:"shortcuts.incrementBig"},decrementBig:{key:"PageDown",description:"Decrease by 10",descriptionKey:"shortcuts.decrementBig"}};function Wo(e){var a,i,r,s;const t=[];return(a=e.modifiers)!=null&&a.includes("ctrl")&&t.push("Ctrl"),(i=e.modifiers)!=null&&i.includes("alt")&&t.push("Alt"),(r=e.modifiers)!=null&&r.includes("shift")&&t.push("Shift"),(s=e.modifiers)!=null&&s.includes("meta")&&t.push("⌘"),t.push(e.key),t.join("+")}function qo(e,t){if(!(e.key===t.key||e.key.toLowerCase()===t.key.toLowerCase()))return!1;const a=t.modifiers??[];return!(a.includes("ctrl")!==(e.ctrlKey||e.metaKey)||a.includes("alt")!==e.altKey||a.includes("shift")!==e.shiftKey)}const Oe=({shortcuts:e,position:t="top",icon:a,size:i="sm",className:r})=>{const[s,l]=o.useState(!1),c=o.useRef(null),[d,u]=o.useState({top:0,left:0}),g=o.useCallback(()=>{if(!c.current)return;const m=c.current.getBoundingClientRect(),k=8;let b=0,C=0;switch(t){case"top":b=m.top-k,C=m.left+m.width/2;break;case"bottom":b=m.bottom+k,C=m.left+m.width/2;break;case"left":b=m.top+m.height/2,C=m.left-k;break;case"right":b=m.top+m.height/2,C=m.right+k;break}u({top:b,left:C})},[t]),h=o.useCallback(()=>{g(),l(!0)},[g]),p=o.useCallback(()=>{g(),l(!0)},[g]);return e.length===0?null:n.jsxs(n.Fragment,{children:[n.jsx("button",{ref:c,type:"button",className:`nice-keyboard-hint nice-keyboard-hint--${i} ${r||""}`,onMouseEnter:h,onMouseLeave:()=>l(!1),onFocus:p,onBlur:()=>l(!1),"aria-label":"Keyboard shortcuts",tabIndex:-1,children:a||"?"}),s&&n.jsxs("div",{className:`nice-keyboard-hint__tooltip nice-keyboard-hint__tooltip--${t}`,style:{position:"fixed",top:d.top,left:d.left,transform:t==="top"?"translate(-50%, -100%)":t==="bottom"?"translate(-50%, 0)":t==="left"?"translate(-100%, -50%)":"translate(0, -50%)"},role:"tooltip",children:[n.jsx("div",{className:"nice-keyboard-hint__title",children:"Keyboard Shortcuts"}),n.jsx("ul",{className:"nice-keyboard-hint__list",children:e.map((m,k)=>n.jsxs("li",{className:"nice-keyboard-hint__item",children:[n.jsx("kbd",{className:"nice-keyboard-hint__key",children:Wo(m)}),n.jsx("span",{className:"nice-keyboard-hint__desc",children:m.description})]},k))})]})]})};Oe.displayName="NiceKeyboardHint";function jn(e={}){const{enabled:t=!1,onSubmit:a,preventDefault:i=!0,requireCtrl:r=!1,skipTextarea:s=!0}=e;return o.useCallback(l=>{!t||!a||l.key==="Enter"&&(r&&!l.ctrlKey&&!l.metaKey||s&&l.target.tagName==="TEXTAREA"||(i&&l.preventDefault(),a()))},[t,a,i,r,s])}o.createContext(null);o.createContext({direction:"ltr",isRTL:!1,flip:e=>e,flipStyle:(e,t)=>({[e]:t})});const Vo=o.createContext({permissions:{},getAccessMode:()=>"full"});function $e(e,t,a){const i=o.useContext(Vo);return e||i.getAccessMode(t,a)}const Ko=o.createContext(null);function et(){const e=o.useContext(Ko);if(!e)throw new Error("useNiceAI must be used within a NiceAIProvider");return e}function Uo(e={}){const t=et(),[a,i]=o.useState(""),[r,s]=o.useState(!1),l=o.useCallback(async(g,h="")=>{s(!0),i("");try{const p=(await t.complete([{role:"user",content:`Complete the following ${e.language||""} code. Return ONLY the completion text, no explanation.
17
+
18
+ Code before cursor:
19
+ \`\`\`
20
+ ${g}
21
+ \`\`\`
22
+
23
+ Code after cursor:
24
+ \`\`\`
25
+ ${h}
26
+ \`\`\`
27
+
28
+ Completion:`}],{model:e.model,temperature:.2,maxTokens:200})).content.trim();return i(p),p}catch{return""}finally{s(!1)}},[t,e]),c=o.useCallback(async g=>{s(!0);try{return(await t.complete([{role:"user",content:`Explain the following ${e.language||""} code concisely:
29
+
30
+ \`\`\`
31
+ ${g}
32
+ \`\`\``}],{model:e.model,temperature:.3})).content}finally{s(!1)}},[t,e]),d=o.useCallback(async(g,h)=>{s(!0);try{const p=await t.complete([{role:"user",content:`Refactor the following ${e.language||""} code according to the instruction. Return ONLY the refactored code.
33
+
34
+ Code:
35
+ \`\`\`
36
+ ${g}
37
+ \`\`\`
38
+
39
+ Instruction: ${h}
40
+
41
+ Refactored code:`}],{model:e.model,temperature:.2}),m=p.content.match(/```[\w]*\n?([\s\S]*?)```/);return m?m[1].trim():p.content.trim()}finally{s(!1)}},[t,e]),u=o.useCallback(async g=>{s(!0);try{const h=await t.complete([{role:"user",content:`Generate ${e.language||""} code from this comment/description. Return ONLY the code.
42
+
43
+ Description: ${g}
44
+
45
+ Code:`}],{model:e.model,temperature:.3}),p=h.content.match(/```[\w]*\n?([\s\S]*?)```/);return p?p[1].trim():h.content.trim()}finally{s(!1)}},[t,e]);return{suggestion:a,isLoading:r,complete:l,explain:c,refactor:d,generateFromComment:u}}function Yo(){const e=et(),[t,a]=o.useState(!1);return{parseFilter:o.useCallback(async(i,r)=>{a(!0);try{const s=await e.complete([{role:"user",content:`Convert this natural language query to filter conditions. Available columns: ${JSON.stringify(r)}
46
+
47
+ Query: "${i}"
48
+
49
+ Return a JSON array of filter objects with: field, operator (eq, ne, gt, gte, lt, lte, contains, startsWith, endsWith), value.
50
+ Only return the JSON array, no explanation.`}],{temperature:.1,maxTokens:500});try{const l=JSON.parse(s.content);return Array.isArray(l)?l:[]}catch{return[]}}finally{a(!1)}},[e]),isLoading:t}}function Zo(){const e=et(),[t,a]=o.useState(!1),i=o.useCallback(async(s,l)=>{a(!0);try{const c=s.slice(0,5),d=await e.complete([{role:"user",content:`Analyze this data and suggest the best chart type. Data sample: ${JSON.stringify(c)}
51
+ ${l?`Context: ${l}`:""}
52
+
53
+ Return JSON with: type (line, bar, pie, scatter, area, donut), reason (brief explanation), config (suggested chart configuration like xField, yField, etc.)
54
+ Only return JSON.`}],{temperature:.2,maxTokens:500});try{return JSON.parse(d.content)}catch{return{type:"bar",reason:"Default chart type",config:{}}}}finally{a(!1)}},[e]),r=o.useCallback(async(s,l)=>{a(!0);try{const c=await e.complete([{role:"user",content:`Analyze this ${l} chart data and provide 3-5 key insights. Data: ${JSON.stringify(s.slice(0,20))}
55
+
56
+ Return a JSON array of insight strings.`}],{temperature:.3,maxTokens:500});try{return JSON.parse(c.content)}catch{return[]}}finally{a(!1)}},[e]);return{suggestChartType:i,generateInsights:r,isLoading:t}}function Go(){const e=et(),[t,a]=o.useState(!1);return{generateForm:o.useCallback(async i=>{a(!0);try{const r=await e.complete([{role:"user",content:`Generate a form definition from this description: "${i}"
57
+
58
+ Return a JSON array of field objects with: label, field (camelCase), type (text, number, email, date, select, checkbox, textarea), required (boolean), options (for select type).
59
+ Only return JSON.`}],{temperature:.3,maxTokens:1e3});try{return JSON.parse(r.content)}catch{return[]}}finally{a(!1)}},[e]),isLoading:t}}function Xo(){const e=et(),[t,a]=o.useState(!1),i=o.useCallback(async(l,c)=>{a(!0);try{return(await e.complete([{role:"user",content:`Improve this text to be more ${c||"professional"}. Keep the same meaning. Return only the improved text.
60
+
61
+ Text: ${l}
62
+
63
+ Improved:`}],{temperature:.4})).content.trim()}finally{a(!1)}},[e]),r=o.useCallback(async(l,c)=>{a(!0);try{return(await e.complete([{role:"user",content:`Translate this text to ${c}. Return only the translation.
64
+
65
+ Text: ${l}
66
+
67
+ Translation:`}],{temperature:.2})).content.trim()}finally{a(!1)}},[e]),s=o.useCallback(async l=>{a(!0);try{const c=await e.complete([{role:"user",content:`Generate clean semantic HTML from this prompt. Use proper tags (h1-h6, p, ul, ol, table, etc.). Return only HTML.
68
+
69
+ Prompt: ${l}
70
+
71
+ HTML:`}],{temperature:.3}),d=c.content.match(/```html?\n?([\s\S]*?)```/);return d?d[1].trim():c.content.trim()}finally{a(!1)}},[e]);return{improveText:i,translate:r,generateHtml:s,isLoading:t}}function Qo(e,t){const a=(t==null?void 0:t.autoLoad)??!0,i=(t==null?void 0:t.defaultPageSize)??20,[r,s]=o.useState([]),[l,c]=o.useState(0),[d,u]=o.useState(!1),[g,h]=o.useState(null),[p,m]=o.useState(1),[k,b]=o.useState(i),[C,_]=o.useState((t==null?void 0:t.defaultSort)??[]),[f,v]=o.useState(t==null?void 0:t.defaultFilter),[j,S]=o.useState((t==null?void 0:t.defaultSearch)??""),I=o.useRef(0),M=t==null?void 0:t.loadOptions,w=o.useCallback(async()=>{if(!e)return;const D=++I.current;u(!0),h(null);try{const F=await e.load({skip:(p-1)*k,take:k,sort:C.length?C:void 0,filter:f,search:j||void 0,...M});if(D!==I.current)return;s(F.data),c(F.totalCount)}catch(F){if(D!==I.current)return;h(F instanceof Error?F.message:String(F))}finally{D===I.current&&u(!1)}},[e,p,k,C,f,j,M]);o.useEffect(()=>{a&&w()},[w,a]),o.useEffect(()=>{if(e)return e.on("changed",()=>{w()})},[e,w]);const E=o.useCallback((D,F)=>{_([{field:D,direction:F}]),m(1)},[]),P=o.useCallback(D=>{v(D),m(1)},[]),L=o.useCallback(D=>{S(D),m(1)},[]),A=o.useCallback(D=>{b(D),m(1)},[]),N=o.useCallback(async D=>{if(!(e!=null&&e.insert))throw new Error("DataSource is not writable");await e.insert(D)},[e]),x=o.useCallback(async(D,F)=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");await e.update(D,F)},[e]),O=o.useCallback(async D=>{if(!(e!=null&&e.remove))throw new Error("DataSource is not writable");await e.remove(D)},[e]);return{data:r,totalCount:l,loading:d,error:g,page:p,pageSize:k,sort:C,filter:f,search:j,setPage:m,setPageSize:A,setSort:_,setSortField:E,setFilter:P,setSearch:L,reload:w,insert:N,update:x,remove:O}}function Jo(e,t){const[a,i]=o.useState(void 0),[r,s]=o.useState({}),[l,c]=o.useState(!1),[d,u]=o.useState(null),g=o.useRef(0),h=o.useCallback(async()=>{if(!e||t==null){i(void 0);return}const f=++g.current;c(!0),u(null);try{const v=await e.byKey(t);if(f!==g.current)return;i(v),s({})}catch(v){if(f!==g.current)return;u(v instanceof Error?v.message:String(v))}finally{f===g.current&&c(!1)}},[e,t]);o.useEffect(()=>{h()},[h]),o.useEffect(()=>{if(e)return e.on("changed",()=>{h()})},[e,h]);const p=o.useMemo(()=>({...a??{},...r}),[a,r]),m=Object.keys(r).length>0,k=o.useCallback((f,v)=>{s(j=>({...j,[f]:v}))},[]),b=o.useCallback(f=>{s(v=>({...v,...f}))},[]),C=o.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");m&&await e.update(t,r)},[e,t,r,m]),_=o.useCallback(()=>{s({})},[]);return{data:a,editData:p,loading:l,error:d,changes:r,isDirty:m,set:k,setMany:b,save:C,reload:h,reset:_}}function es(e,t,a,i){const[l,c]=o.useState([]),[d,u]=o.useState(!1),[g,h]=o.useState(null),p=o.useRef(0),m=o.useCallback(async C=>{if(!e)return;const _=++p.current;u(!0),h(null);try{const f=await e.load({take:200,search:C||void 0,searchFields:i==null?void 0:i.searchFields});if(_!==p.current)return;c(f.data)}catch(f){if(_!==p.current)return;h(f instanceof Error?f.message:String(f))}finally{_===p.current&&u(!1)}},[e,200,i==null?void 0:i.searchFields]);o.useEffect(()=>{m()},[m,!0]);const k=o.useMemo(()=>l.map(C=>{const _=C;return{value:String(_[t]??""),label:String(_[a]??"")}}),[l,t,a,i==null?void 0:i.iconField,i==null?void 0:i.descriptionField,i==null?void 0:i.groupField]),b=o.useCallback(C=>{m(C)},[m]);return{options:k,loading:d,error:g,search:b,reload:()=>m()}}const Ct={cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",source:"default",requiresConsentBanner:!1,resolvedAt:Date.now(),version:"1.0.0"},ts=new Map;let ns=class{constructor(t,a="nice2dev",i="local"){this.policy=t,this.namespace=a,this.defaultBackend=i}getBackend(t){const a=t||this.defaultBackend;if(a==="local"&&this.policy.localStorageAllowed)try{if(typeof localStorage<"u")return localStorage}catch{}if((a==="session"||a==="local")&&this.policy.sessionStorageAllowed)try{if(typeof sessionStorage<"u")return sessionStorage}catch{}return ts}getKey(t){return`${this.namespace}:${t}`}get(t,a){const i=this.getBackend(a),r=this.getKey(t);try{const s=i instanceof Map?i.get(r):i.getItem(r);if(s==null)return null;try{return JSON.parse(s)}catch{return s}}catch{return null}}set(t,a,i){const r=this.getBackend(i),s=this.getKey(t);try{const l=typeof a=="string"?a:JSON.stringify(a);return r instanceof Map?r.set(s,l):r.setItem(s,l),!0}catch{return!1}}remove(t,a){const i=this.getBackend(a),r=this.getKey(t);try{return i instanceof Map?i.delete(r):(i.removeItem(r),!0)}catch{return!1}}clear(t){const a=this.getBackend(t),i=`${this.namespace}:`;try{if(a instanceof Map)for(const r of a.keys())r.startsWith(i)&&a.delete(r);else{const r=[];for(let s=0;s<a.length;s++){const l=a.key(s);l&&l.startsWith(i)&&r.push(l)}r.forEach(s=>a.removeItem(s))}}catch{}}keys(t){const a=this.getBackend(t),i=`${this.namespace}:`,r=[];try{if(a instanceof Map)for(const s of a.keys())s.startsWith(i)&&r.push(s.slice(i.length));else for(let s=0;s<a.length;s++){const l=a.key(s);l&&l.startsWith(i)&&r.push(l.slice(i.length))}}catch{}return r}has(t,a){return this.get(t,a)!==null}getCapabilities(){return{canUseCookies:this.policy.cookiesAllowed,canUseLocalStorage:this.policy.localStorageAllowed,canUseSessionStorage:this.policy.sessionStorageAllowed,canPersist:this.policy.localStorageAllowed,effectiveMode:this.policy.effectiveMode,actualBackend:this.getActualBackendType()}}getActualBackendType(){const t=this.getBackend();return t instanceof Map?"memory":t===sessionStorage?"session":"local"}updatePolicy(t){this.policy=t}};function as(e,t,a){return{generatedAt:new Date().toISOString(),instanceId:t,tenantId:a,effectiveMode:e.effectiveMode,cookies:{count:0,allowed:e.cookiesAllowed,strictAuthOnly:e.strictAuthCookieOnly,thirdParty:!1,tracking:!1},localStorage:{bytesUsed:0,allowed:e.localStorageAllowed,keysCount:0},sessionStorage:{bytesUsed:0,allowed:e.sessionStorageAllowed,keysCount:0},consentBanner:{required:e.requiresConsentBanner,shown:e.requiresConsentBanner},compliance:{ePrivacyCompliant:!e.cookiesAllowed||e.requiresConsentBanner,gdprCompliant:!0,pecrCompliant:!e.cookiesAllowed||e.requiresConsentBanner},statement:is(e)}}function is(e){return e.effectiveMode==="traceless"?"This OmniVerk instance operates in Traceless™ mode. No cookies are set (0), no data is saved to localStorage (0), and no sessionStorage is used (0). No cookie consent banner is required under ePrivacy Directive Art. 5(3) as no similar technologies are employed.":e.effectiveMode==="ephemeral"?"This OmniVerk instance operates in Ephemeral mode. No cookies are set, no localStorage is used. sessionStorage is used for session-only data that is automatically cleared when the browser tab is closed. No cookie consent banner is required.":e.effectiveMode==="private"?"This OmniVerk instance operates in Private mode. One strictly necessary httpOnly authentication cookie may be set. sessionStorage is used for session preferences. No consent banner is required as only strictly necessary technologies are used.":e.effectiveMode==="balanced"?"This OmniVerk instance operates in Balanced mode. localStorage is used for user preferences. sessionStorage is used for session data. No cookies are set. Depending on jurisdiction, a consent banner may be shown.":"This OmniVerk instance operates in Full mode. Cookies, localStorage, and sessionStorage are enabled. A consent banner is displayed to users before any non-essential storage is used."}function rs(e){const{effectiveMode:t}=e;switch(t){case"traceless":return{mode:"traceless",icon:"🟢",color:"#10b981",label:"Traceless™",tooltip:"Your data is not stored on this device. Zero cookies, zero localStorage, zero traces.",cssClass:"nice-traceless-badge--traceless"};case"ephemeral":return{mode:"ephemeral",icon:"🔵",color:"#3b82f6",label:"Ephemeral",tooltip:"Session-only storage. Data is cleared when you close this tab.",cssClass:"nice-traceless-badge--ephemeral"};case"private":return{mode:"private",icon:"🟡",color:"#eab308",label:"Private",tooltip:"Minimal storage with one secure authentication cookie.",cssClass:"nice-traceless-badge--private"};case"balanced":return{mode:"balanced",icon:"🟠",color:"#f97316",label:"Balanced",tooltip:"Preferences are saved locally. No tracking cookies.",cssClass:"nice-traceless-badge--balanced"};case"full":return{mode:"full",icon:"🔴",color:"#ef4444",label:"Full",tooltip:"All storage enabled including analytics. You control what is stored via consent.",cssClass:"nice-traceless-badge--full"};case"custom":default:return{mode:"custom",icon:"⚪",color:"#6b7280",label:"Custom",tooltip:"Custom storage configuration.",cssClass:"nice-traceless-badge--custom"}}}function os(e){const t=[];if(!e.cookiesAllowed&&typeof document<"u"){const a=document.cookie;a&&a.length>0&&t.push({type:"cookie",severity:"high",message:`Cookies found but not allowed: ${a.split(";").length} cookie(s)`,data:a})}if(!e.localStorageAllowed)try{typeof localStorage<"u"&&localStorage.length>0&&t.push({type:"localStorage",severity:"high",message:`localStorage has ${localStorage.length} item(s) but not allowed`})}catch{}if(!e.sessionStorageAllowed)try{typeof sessionStorage<"u"&&sessionStorage.length>0&&t.push({type:"sessionStorage",severity:"medium",message:`sessionStorage has ${sessionStorage.length} item(s) but not allowed`})}catch{}return{compliant:t.length===0,violations:t,auditedAt:Date.now(),policy:e.effectiveMode}}const ss=o.createContext(null);function ls(){const e=o.useContext(ss);if(e)return e;const t=new ns(Ct);return{policy:Ct,canUseCookies:!1,canUseLocalStorage:!1,canUseSessionStorage:!1,canPersist:!1,mode:"traceless",requiresConsentBanner:!1,badgeInfo:rs(Ct),setUserPreference:()=>{},generateReport:()=>as(Ct,"default"),runAudit:()=>os(Ct),refreshPolicy:async()=>{},getStorageAdapter:()=>t,isLoading:!1,error:null}}function Ja(e="nice2dev"){const{getStorageAdapter:t}=ls();return o.useMemo(()=>t(e),[t,e])}const ei={"colors.primary":"--color-primary","colors.primaryHover":"--color-primary-hover","colors.success":"--color-success","colors.warning":"--color-warning","colors.error":"--color-error","colors.info":"--color-info","colors.accent":"--color-accent","colors.accentHover":"--color-accent-hover","colors.link":"--color-link","colors.linkHover":"--color-link-hover","colors.focus":"--color-focus","colors.overlay":"--color-overlay","colors.surface":"--color-surface","colors.surfaceHover":"--color-surface-hover","colors.disabled":"--color-disabled","colors.disabledText":"--color-disabled-text","backgrounds.primary":"--bg-primary","backgrounds.secondary":"--bg-secondary","backgrounds.tertiary":"--bg-tertiary","backgrounds.hover":"--hover-bg","backgrounds.elevated":"--bg-elevated","backgrounds.inset":"--bg-inset","backgrounds.canvas":"--bg-canvas","text.primary":"--text-primary","text.secondary":"--text-secondary","text.muted":"--text-muted","text.inverse":"--text-inverse","text.onPrimary":"--text-on-primary","text.onAccent":"--text-on-accent","borders.color":"--border-color","borders.radiusSm":"--nice-radius-sm","borders.radiusMd":"--nice-radius-md","borders.radiusLg":"--nice-radius-lg","borders.radiusXl":"--nice-radius-xl","borders.radiusFull":"--nice-radius-full","borders.width":"--border-width","borders.focusColor":"--border-focus-color","borders.divider":"--border-divider","shadows.sm":"--shadow-sm","shadows.md":"--shadow-md","shadows.lg":"--shadow-lg","shadows.xl":"--shadow-xl","shadows.inner":"--shadow-inner","shadows.glow":"--shadow-glow","spacing.space1":"--nice-space-1","spacing.space2":"--nice-space-2","spacing.space3":"--nice-space-3","spacing.space4":"--nice-space-4","spacing.space5":"--nice-space-5","spacing.space6":"--nice-space-6","spacing.space8":"--nice-space-8","spacing.space10":"--nice-space-10","spacing.space12":"--nice-space-12","spacing.space16":"--nice-space-16","typography.fontFamily":"--nice-font-family","typography.fontSizeXs":"--nice-font-size-xs","typography.fontSizeSm":"--nice-font-size-sm","typography.fontSizeMd":"--nice-font-size-md","typography.fontSizeLg":"--nice-font-size-lg","typography.fontSizeXl":"--nice-font-size-xl","typography.fontSize2xl":"--nice-font-size-2xl","typography.fontSize3xl":"--nice-font-size-3xl","typography.fontWeightNormal":"--nice-font-weight-normal","typography.fontWeightMedium":"--nice-font-weight-medium","typography.fontWeightSemibold":"--nice-font-weight-semibold","typography.fontWeightBold":"--nice-font-weight-bold","typography.lineHeight":"--nice-line-height","typography.headingFontFamily":"--nice-heading-font-family","typography.monoFontFamily":"--nice-mono-font-family","typography.letterSpacing":"--nice-letter-spacing","typography.headingLetterSpacing":"--nice-heading-letter-spacing","transitions.fast":"--nice-transition-fast","transitions.normal":"--nice-transition","transitions.slow":"--nice-transition-slow"};function cs(e,t){return t.split(".").reduce((a,i)=>{if(a&&typeof a=="object")return a[i]},e)}function Nn(e){const t={};for(const[a,i]of Object.entries(ei)){const r=cs(e,a);r!==void 0&&(t[i]=String(r))}return t}function ds(e,t){const a=document.documentElement,i=Nn(e);for(const[r,s]of Object.entries(i))a.style.setProperty(r,s);ps(e.backgroundImage,a),e.darkMode&&(a.dataset.ntdColorScheme=e.darkMode)}const us={dots:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="currentColor" opacity="0.15"/></svg>',grid:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M20 0H0v20" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',diagonal:'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0" stroke="currentColor" stroke-opacity="0.08"/></svg>',"cross-hatch":'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0M-1 1L1 -1M9 11L11 9" stroke="currentColor" stroke-opacity="0.06"/></svg>',waves:'<svg width="40" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6c5 0 5-6 10-6s5 6 10 6 5-6 10-6 5 6 10 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',hexagons:'<svg width="28" height="49" xmlns="http://www.w3.org/2000/svg"><path d="M14 0l14 8.5v16L14 33 0 24.5v-16z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',triangles:'<svg width="20" height="17" xmlns="http://www.w3.org/2000/svg"><path d="M0 17L10 0l10 17z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',circles:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="6" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',zigzag:'<svg width="20" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6l5-6 5 6 5-6 5 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',noise:'<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency=".9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(#n)"/></svg>'};function ps(e,t){if(t.style.removeProperty("--ntd-bg-image"),t.style.removeProperty("--ntd-bg-image-size"),t.style.removeProperty("--ntd-bg-image-position"),t.style.removeProperty("--ntd-bg-image-attachment"),t.style.removeProperty("--ntd-bg-image-repeat"),t.style.removeProperty("--ntd-bg-image-opacity"),t.style.removeProperty("--ntd-bg-image-blend"),!(!e||e.type==="none")){if(e.type==="gradient"&&e.gradient)t.style.setProperty("--ntd-bg-image",e.gradient);else if(e.type==="image"&&e.imageUrl)t.style.setProperty("--ntd-bg-image",`url("${e.imageUrl}")`),e.imageSize&&t.style.setProperty("--ntd-bg-image-size",e.imageSize),e.imagePosition&&t.style.setProperty("--ntd-bg-image-position",e.imagePosition),e.imageAttachment&&t.style.setProperty("--ntd-bg-image-attachment",e.imageAttachment),e.imageRepeat&&t.style.setProperty("--ntd-bg-image-repeat",e.imageRepeat);else if(e.type==="pattern"&&e.pattern){const a=us[e.pattern];if(a){const i=`url("data:image/svg+xml,${encodeURIComponent(a)}")`;t.style.setProperty("--ntd-bg-image",i),t.style.setProperty("--ntd-bg-image-repeat","repeat")}}e.opacity!==void 0&&t.style.setProperty("--ntd-bg-image-opacity",String(e.opacity)),e.blendMode&&t.style.setProperty("--ntd-bg-image-blend",e.blendMode)}}function ms(e){const t=e??document.documentElement;for(const a of Object.values(ei))t.style.removeProperty(a);for(const a of["--ntd-bg-image","--ntd-bg-image-size","--ntd-bg-image-position","--ntd-bg-image-attachment","--ntd-bg-image-repeat","--ntd-bg-image-opacity","--ntd-bg-image-blend"])t.style.removeProperty(a);delete t.dataset.ntdColorScheme}function hs(e){return JSON.stringify(e,null,2)}function fs(e){const t=JSON.parse(e);if(!t||typeof t!="object"||!t.name||!t.colors||!t.backgrounds)throw new Error("Invalid theme format: missing required fields (name, colors, backgrounds)");return t}const gs=o.createContext(null);/**
72
+ * @file themeVariants.ts
73
+ * @description Extended theme variants - radius, shadows, fills, gradients, effects
74
+ *
75
+ * Allows fine-grained customization of theme appearance
76
+ *
77
+ * @version 1.0.0
78
+ * @since 2026-03
79
+ * @license MIT
80
+ */const ys={none:{xs:"0",sm:"0",md:"0",lg:"0",xl:"0",full:"0"},sm:{xs:"2px",sm:"3px",md:"4px",lg:"6px",xl:"8px",full:"9999px"},md:{xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px",full:"9999px"},lg:{xs:"6px",sm:"10px",md:"14px",lg:"20px",xl:"28px",full:"9999px"},xl:{xs:"10px",sm:"16px",md:"24px",lg:"32px",xl:"48px",full:"9999px"},"2xl":{xs:"16px",sm:"24px",md:"32px",lg:"48px",xl:"64px",full:"9999px"},full:{xs:"9999px",sm:"9999px",md:"9999px",lg:"9999px",xl:"9999px",full:"9999px"}},bs={none:"none",subtle:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.05)",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.4))",glow:"0 0 20px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))"},xs={none:"none",subtle:"0 1px 2px 0 rgba(0, 0, 0, 0.2)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.3)",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))",glow:"0 0 30px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.6))"},vs={compact:{paddingX:"8px",paddingY:"4px",gap:"4px",fontSize:"13px",lineHeight:"1.3",inputHeight:"28px",buttonHeight:"28px"},normal:{paddingX:"12px",paddingY:"8px",gap:"8px",fontSize:"14px",lineHeight:"1.5",inputHeight:"36px",buttonHeight:"36px"},comfortable:{paddingX:"16px",paddingY:"12px",gap:"12px",fontSize:"15px",lineHeight:"1.6",inputHeight:"44px",buttonHeight:"44px"},spacious:{paddingX:"24px",paddingY:"16px",gap:"16px",fontSize:"16px",lineHeight:"1.7",inputHeight:"52px",buttonHeight:"52px"}},ws={none:{duration:"0ms",easing:"linear",hoverScale:"1",clickScale:"1",enterAnimation:"none",exitAnimation:"none"},subtle:{duration:"150ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.01",clickScale:"0.99",enterAnimation:"ntd-fade-in 150ms ease-out",exitAnimation:"ntd-fade-out 100ms ease-in"},normal:{duration:"200ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.02",clickScale:"0.98",enterAnimation:"ntd-slide-up 200ms ease-out",exitAnimation:"ntd-slide-down 150ms ease-in"},playful:{duration:"300ms",easing:"cubic-bezier(0.34, 1.56, 0.64, 1)",hoverScale:"1.05",clickScale:"0.95",enterAnimation:"ntd-bounce-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",exitAnimation:"ntd-bounce-out 200ms ease-in"},dramatic:{duration:"400ms",easing:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",hoverScale:"1.08",clickScale:"0.92",enterAnimation:"ntd-zoom-in 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55)",exitAnimation:"ntd-zoom-out 250ms ease-in"}};function ks(e,t){const a={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...a,background:t,boxShadow:"none",border:"none"};case"raised":return{...a,background:t,boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:"none"};case"outlined":return{...a,background:"transparent",border:`2px solid ${t}`,color:t};case"ghost":return{...a,background:"transparent",border:"none",color:t};case"soft":return{...a,background:`${t}20`,border:"none",color:t};case"gradient":return{...a,background:`linear-gradient(135deg, ${t} 0%, ${yn(t,-20)} 100%)`,border:"none",boxShadow:`0 4px 14px ${t}40`};case"3d":return{...a,background:t,border:"none",boxShadow:`0 4px 0 ${yn(t,-30)}, 0 6px 10px rgba(0, 0, 0, 0.2)`,transform:"translateY(-2px)"};case"neumorphic":return{...a,background:"var(--ntd-bg-surface)",border:"none",boxShadow:"5px 5px 10px rgba(0, 0, 0, 0.1), -5px -5px 10px rgba(255, 255, 255, 0.8)",color:t};case"pill":return{...a,background:t,border:"none",borderRadius:"9999px",paddingLeft:"24px",paddingRight:"24px"};case"link":return{...a,background:"transparent",border:"none",color:t,textDecoration:"underline",padding:"0"};case"brutal":return{...a,background:t,border:"3px solid #000",boxShadow:"4px 4px 0 #000",borderRadius:"0"};default:return a}}function Ss(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"bordered":return{...t,background:"var(--ntd-bg-input, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"var(--ntd-radius-md, 8px)"};case"filled":return{...t,background:"var(--ntd-bg-input-filled, #f3f4f6)",border:"2px solid transparent",borderRadius:"var(--ntd-radius-md, 8px)"};case"underlined":return{...t,background:"transparent",border:"none",borderBottom:"2px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"0",paddingLeft:"0",paddingRight:"0"};case"floating":return{...t,background:"var(--ntd-bg-input, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"var(--ntd-radius-md, 8px)",paddingTop:"20px"};case"soft":return{...t,background:"var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.1))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface)",border:"none",borderRadius:"var(--ntd-radius-md, 8px)",boxShadow:"inset 3px 3px 6px rgba(0, 0, 0, 0.1), inset -3px -3px 6px rgba(255, 255, 255, 0.8)"};case"pill":return{...t,background:"var(--ntd-bg-input, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"9999px",paddingLeft:"20px",paddingRight:"20px"};case"flush":return{...t,background:"transparent",border:"none",borderRadius:"0",padding:"0",outline:"none"};default:return t}}function Cs(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...t,background:"var(--ntd-bg-surface, #fff)",border:"none",boxShadow:"none"};case"elevated":return{...t,background:"var(--ntd-bg-surface, #fff)",border:"none",boxShadow:"var(--ntd-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1))"};case"bordered":return{...t,background:"var(--ntd-bg-surface, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",boxShadow:"none"};case"glass":return{...t,background:"rgba(255, 255, 255, 0.1)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",border:"1px solid rgba(255, 255, 255, 0.2)",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.1)"};case"gradient":return{...t,background:"linear-gradient(135deg, var(--ntd-bg-surface) 0%, var(--ntd-bg-elevated) 100%)",border:"none",boxShadow:"var(--ntd-shadow-md)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface)",border:"none",boxShadow:"8px 8px 16px rgba(0, 0, 0, 0.1), -8px -8px 16px rgba(255, 255, 255, 0.8)"};case"outlined":return{...t,background:"transparent",border:"2px solid var(--ntd-border-color, #e5e7eb)",boxShadow:"none"};case"paper":return{...t,background:"#fffef9",border:"none",boxShadow:"2px 3px 8px rgba(0,0,0,0.06)",borderRadius:"2px"};default:return t}}function _s(e,t){const a={display:"inline-flex",alignItems:"center",fontSize:"0.75rem",fontWeight:"600",lineHeight:"1"};switch(e){case"solid":return{...a,background:t,color:"#fff",padding:"2px 8px",borderRadius:"4px"};case"soft":return{...a,background:`${t}20`,color:t,padding:"2px 8px",borderRadius:"4px"};case"outlined":return{...a,background:"transparent",border:`1px solid ${t}`,color:t,padding:"2px 8px",borderRadius:"4px"};case"dot":return{...a,background:t,width:"8px",height:"8px",borderRadius:"50%",padding:"0"};case"pill":return{...a,background:t,color:"#fff",padding:"2px 12px",borderRadius:"9999px"};case"gradient":return{...a,background:`linear-gradient(135deg, ${t}, ${yn(t,-20)})`,color:"#fff",padding:"2px 8px",borderRadius:"4px"};default:return a}}function js(e,t){switch(e){case"underline":return{borderBottom:`2px solid ${t}`,background:"transparent",color:t};case"pills":return{background:t,color:"#fff",borderRadius:"9999px",padding:"6px 16px"};case"enclosed":return{background:"var(--ntd-bg-surface,#fff)",border:"1px solid var(--ntd-border-color,#e5e7eb)",borderBottom:"none",borderRadius:"8px 8px 0 0"};case"soft":return{background:`${t}15`,color:t,borderRadius:"6px",padding:"6px 16px"};case"lifted":return{background:"var(--ntd-bg-surface,#fff)",boxShadow:"0 -2px 8px rgba(0,0,0,0.06)",borderRadius:"8px 8px 0 0",transform:"translateY(-2px)"};case"bordered":return{border:`2px solid ${t}`,borderBottom:"none",background:"transparent",borderRadius:"8px 8px 0 0"};default:return{}}}function Ns(e){switch(e){case"default":return{borderRadius:"12px",width:"44px",height:"24px"};case"ios":return{borderRadius:"16px",width:"51px",height:"31px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"};case"flat":return{borderRadius:"4px",width:"40px",height:"22px"};case"pill":return{borderRadius:"9999px",width:"48px",height:"24px"};case"square":return{borderRadius:"0",width:"40px",height:"22px"};default:return{}}}function Ms(e){switch(e){case"dark":return{background:"#1f2937",color:"#f9fafb",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)"};case"light":return{background:"#fff",color:"#374151",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",border:"1px solid #e5e7eb"};case"primary":return{background:"var(--color-primary,#6366f1)",color:"#fff",borderRadius:"6px",padding:"6px 12px"};case"glass":return{background:"rgba(255,255,255,0.15)",backdropFilter:"blur(12px)",color:"#fff",borderRadius:"8px",padding:"8px 14px"};case"bordered":return{background:"#fff",color:"#374151",borderRadius:"6px",padding:"6px 12px",border:"2px solid var(--color-primary,#6366f1)"};default:return{}}}function $s(e){switch(e){case"default":return{borderCollapse:"collapse"};case"striped":return{borderCollapse:"collapse"};case"bordered":return{border:"1px solid var(--ntd-border-color,#e5e7eb)",borderCollapse:"collapse"};case"compact":return{borderCollapse:"collapse",fontSize:"0.8125rem"};case"hoverable":return{borderCollapse:"collapse"};case"minimal":return{borderCollapse:"collapse",borderBottom:"1px solid var(--ntd-border-color,#e5e7eb)"};default:return{}}}const Jt={radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",modalStyle:"default",tableStyle:"default",menuStyle:"default",animation:"normal",density:"normal"},Es={minimal:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},rounded:{radius:"xl",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"comfortable"},sharp:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"subtle",density:"compact"},glass:{radius:"lg",shadow:"none",fill:"glass",buttonStyle:"ghost",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"normal"},neumorphic:{radius:"lg",shadow:"none",fill:"solid",buttonStyle:"neumorphic",inputStyle:"neumorphic",cardStyle:"neumorphic",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"default",animation:"subtle",density:"comfortable"},playful:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},enterprise:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},modern3d:{radius:"lg",shadow:"xl",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},brutalist:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},luxe:{radius:"sm",shadow:"lg",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"floating",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"underline",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"normal",density:"comfortable"},pill:{radius:"full",shadow:"md",fill:"solid",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},flat:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},editorial:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},dashboard:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},softCloud:{radius:"xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"normal",density:"comfortable"},cosmic:{radius:"lg",shadow:"glow",fill:"mesh",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},corporate:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"compact"},bank:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},government:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"flat",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"normal"},military:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},legal:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"none",density:"comfortable"},medical:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"striped",animation:"subtle",density:"normal"},swiss:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},scandinavian:{radius:"lg",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},bauhaus:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},notebook:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},terminal:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},hacker:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"compact"},retro8bit:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},vapor:{radius:"lg",shadow:"glow",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"playful",density:"comfortable"},synthwave:{radius:"md",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"normal"},cyberpunk:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"compact"},steampunk:{radius:"sm",shadow:"inner",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"normal"},origami:{radius:"none",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"default",animation:"normal",density:"normal"},watercolor:{radius:"2xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},neon:{radius:"md",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},candy:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},bubblegum:{radius:"full",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},cartoon:{radius:"xl",shadow:"colored",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"pill",tooltipStyle:"bordered",tableStyle:"bordered",animation:"playful",density:"comfortable"},kawaii:{radius:"full",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"dramatic",density:"spacious"},circus:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"},paper:{radius:"sm",shadow:"md",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},zen:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},monochrome:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},windows95:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},material:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},fluent:{radius:"md",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"subtle",density:"normal"},cupertino:{radius:"xl",shadow:"md",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},ant:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"subtle",density:"normal"},bootstrap:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"normal"},chakra:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},notion:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"flush",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},linear:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"subtle",density:"compact"},vercel:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"minimal",animation:"subtle",density:"normal"},gaming:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"gradient",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},kiddo:{radius:"2xl",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},disco:{radius:"full",shadow:"glow",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},clown:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"brutal",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"}};function zs(e){const t=ys[e.radius],a=e.shadow,i=vs[e.density],r=ws[e.animation],s=[":root {"];for(const[l,c]of Object.entries(t))s.push(` --ntd-radius-${l}: ${c};`);s.push(` --ntd-shadow: ${bs[a]};`),s.push(` --ntd-shadow-dark: ${xs[a]};`);for(const[l,c]of Object.entries(i)){const d=l.replace(/([A-Z])/g,"-$1").toLowerCase();s.push(` --ntd-${d}: ${c};`)}for(const[l,c]of Object.entries(r)){const d=l.replace(/([A-Z])/g,"-$1").toLowerCase();s.push(` --ntd-animation-${d}: ${c};`)}return e.backgroundImage&&s.push(` --ntd-bg-image: url('${e.backgroundImage}');`),e.backgroundOverlay&&s.push(` --ntd-bg-overlay: ${e.backgroundOverlay};`),s.push("}"),s.join(`
81
+ `)}function As(e,t=document.documentElement){const a=zs(e);let i=document.getElementById("ntd-variant-styles");i||(i=document.createElement("style"),i.id="ntd-variant-styles",document.head.appendChild(i)),i.textContent=a,t.dataset.ntdRadius=e.radius,t.dataset.ntdShadow=e.shadow,t.dataset.ntdFill=e.fill,t.dataset.ntdButton=e.buttonStyle,t.dataset.ntdInput=e.inputStyle,t.dataset.ntdCard=e.cardStyle,t.dataset.ntdAnimation=e.animation,t.dataset.ntdDensity=e.density,e.badgeStyle&&(t.dataset.ntdBadge=e.badgeStyle),e.tabStyle&&(t.dataset.ntdTab=e.tabStyle),e.toggleStyle&&(t.dataset.ntdToggle=e.toggleStyle),e.tooltipStyle&&(t.dataset.ntdTooltip=e.tooltipStyle),e.modalStyle&&(t.dataset.ntdModal=e.modalStyle),e.tableStyle&&(t.dataset.ntdTable=e.tableStyle),e.menuStyle&&(t.dataset.ntdMenu=e.menuStyle)}function yn(e,t){if(e.startsWith("#")){const a=e.slice(1),i=parseInt(a,16),r=Math.max(0,Math.min(255,(i>>16&255)+t)),s=Math.max(0,Math.min(255,(i>>8&255)+t)),l=Math.max(0,Math.min(255,(i&255)+t));return`#${(r<<16|s<<8|l).toString(16).padStart(6,"0")}`}return e}function en(e){return e==="default"?Jt:Es[e]??Jt}const ti=o.createContext({displayStyle:"default",variantConfig:Jt,setDisplayStyle:()=>{}});function ni(e){const t=o.useContext(ti),a=e??t.displayStyle??"default",i=en(a);return{style:a,config:i}}function Ge(e,t,a="var(--color-primary, #6366f1)"){const{config:i}=ni(t);return Fs(e,i,a)}function qe(e,t){const{config:a}=ni(t);switch(e){case"button":return a.buttonStyle;case"input":return a.inputStyle;case"card":return a.cardStyle;case"badge":return a.badgeStyle??"solid";case"tab":return a.tabStyle??"underline";case"toggle":return a.toggleStyle??"default";case"tooltip":return a.tooltipStyle??"dark";case"modal":return a.modalStyle??"default";case"table":return a.tableStyle??"default";case"menu":return a.menuStyle??"default";default:return"default"}}function Fs(e,t,a="#6366f1"){switch(e){case"button":return ks(t.buttonStyle,a);case"input":return Ss(t.inputStyle);case"card":return Cs(t.cardStyle);case"badge":return _s(t.badgeStyle??"solid",a);case"tab":return js(t.tabStyle??"underline",a);case"toggle":return Ns(t.toggleStyle??"default");case"tooltip":return Ms(t.tooltipStyle??"dark");case"table":return $s(t.tableStyle??"default");case"menu":return{};case"modal":return{};default:return{}}}function Is(e){const t=en(e);return{"data-ntd-display-style":e,"data-ntd-density":t.density,"data-ntd-animation":t.animation,"data-ntd-radius":t.radius,"data-ntd-button":t.buttonStyle,"data-ntd-input":t.inputStyle,"data-ntd-card":t.cardStyle}}function tn(e){if(!e)return"";let t=e;return t=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),t=t.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""),t=t.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi,'$1=""'),t=t.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi,'$1=""'),t=t.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi,""),t}const It={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Dt={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},Tt={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},Mn=e=>({color:e,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),ai={sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},Ds={sm:"0 1px 2px rgba(0,0,0,0.3)",md:"0 4px 6px -1px rgba(0,0,0,0.4)",lg:"0 10px 15px -3px rgba(0,0,0,0.4)",xl:"0 20px 25px -5px rgba(0,0,0,0.4)"};function be(e,t,a,i,r){return{name:e,colors:t,backgrounds:a,text:i,borders:Mn(r),shadows:ai,spacing:It,typography:Dt,transitions:Tt}}function De(e,t,a,i,r){return{name:e,colors:t,backgrounds:a,text:i,borders:Mn(r),shadows:Ds,spacing:It,typography:Dt,transitions:Tt}}const Ts=be("Slate",{primary:"#64748b",primaryHover:"#475569",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},"#cbd5e1"),Rs=be("Zinc",{primary:"#71717a",primaryHover:"#52525b",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fafafa",secondary:"#f4f4f5",tertiary:"#e4e4e7",hover:"#e4e4e7"},{primary:"#18181b",secondary:"#3f3f46",muted:"#a1a1aa"},"#d4d4d8"),Ps=be("Stone",{primary:"#78716c",primaryHover:"#57534e",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#1c1917",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),Bs=be("Cool Gray",{primary:"#6b7280",primaryHover:"#4b5563",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#d1d5db"),Ls=be("Warm Gray",{primary:"#7c7568",primaryHover:"#5c564c",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf9f7",secondary:"#f5f4f0",tertiary:"#e8e6e1",hover:"#e8e6e1"},{primary:"#1f1d19",secondary:"#4a463d",muted:"#a09888"},"#d4d0c8"),Os=be("Silver",{primary:"#94a3b8",primaryHover:"#64748b",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#38bdf8"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#334155",secondary:"#64748b",muted:"#94a3b8"},"#cbd5e1"),Hs=be("Charcoal",{primary:"#374151",primaryHover:"#1f2937",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#6b7280"},"#d1d5db"),Ws=be("Ivory",{primary:"#92876d",primaryHover:"#7a6f55",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffef7",secondary:"#faf6eb",tertiary:"#f0ead6",hover:"#f0ead6"},{primary:"#2b2517",secondary:"#5c5340",muted:"#9c9280"},"#ddd8c4"),qs=be("Rose",{primary:"#e11d48",primaryHover:"#be123c",success:"#16a34a",warning:"#ea580c",error:"#dc2626",info:"#0891b2"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f43f5e"},"#fda4af"),Vs=be("Emerald",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#34d399"},"#6ee7b7"),Ks=be("Amber",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0284c7"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#f59e0b"},"#fcd34d"),Us=be("Violet",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#2e1065",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),Ys=be("Teal",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),Zs=be("Indigo",{primary:"#4f46e5",primaryHover:"#4338ca",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#eef2ff",secondary:"#e0e7ff",tertiary:"#c7d2fe",hover:"#e0e7ff"},{primary:"#1e1b4b",secondary:"#312e81",muted:"#818cf8"},"#a5b4fc"),Gs=be("Cyan",{primary:"#0891b2",primaryHover:"#0e7490",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#0284c7"},{primary:"#ecfeff",secondary:"#cffafe",tertiary:"#a5f3fc",hover:"#cffafe"},{primary:"#164e63",secondary:"#155e75",muted:"#22d3ee"},"#67e8f9"),Xs=be("Lime",{primary:"#65a30d",primaryHover:"#4d7c0f",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f7fee7",secondary:"#ecfccb",tertiary:"#d9f99d",hover:"#ecfccb"},{primary:"#1a2e05",secondary:"#365314",muted:"#84cc16"},"#bef264"),Qs=be("Pink",{primary:"#db2777",primaryHover:"#be185d",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#500724",secondary:"#831843",muted:"#f472b6"},"#f9a8d4"),Js=be("Orange",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#7c2d12",muted:"#fb923c"},"#fdba74"),el=be("Fuchsia",{primary:"#c026d3",primaryHover:"#a21caf",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf4ff",secondary:"#fae8ff",tertiary:"#f5d0fe",hover:"#fae8ff"},{primary:"#4a044e",secondary:"#701a75",muted:"#d946ef"},"#e879f9"),tl=be("Sky",{primary:"#0284c7",primaryHover:"#0369a1",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#075985",muted:"#38bdf8"},"#7dd3fc"),nl=be("Ruby",{primary:"#be123c",primaryHover:"#9f1239",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#fb7185"},"#fda4af"),al=be("Coral",{primary:"#f97316",primaryHover:"#ea580c",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#fb923c"},"#fdba74"),il=De("Midnight",{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#020617",secondary:"#0f172a",tertiary:"#1e293b",hover:"#1e293b"},{primary:"#f1f5f9",secondary:"#94a3b8",muted:"#475569"},"#1e293b"),rl=De("Obsidian",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#facc15",error:"#fb7185",info:"#38bdf8"},{primary:"#09090b",secondary:"#18181b",tertiary:"#27272a",hover:"#27272a"},{primary:"#fafafa",secondary:"#a1a1aa",muted:"#52525b"},"#3f3f46"),ol=De("Eclipse",{primary:"#c084fc",primaryHover:"#a855f7",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#67e8f9"},{primary:"#0c0a1d",secondary:"#1a1533",tertiary:"#2a2248",hover:"#2a2248"},{primary:"#f5f3ff",secondary:"#a78bfa",muted:"#6d5eac"},"#3b3266"),sl=De("Onyx",{primary:"#60a5fa",primaryHover:"#3b82f6",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#000000",secondary:"#0a0a0a",tertiary:"#171717",hover:"#171717"},{primary:"#ffffff",secondary:"#a3a3a3",muted:"#525252"},"#262626"),ll=De("Carbon",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#67e8f9"},{primary:"#161616",secondary:"#262626",tertiary:"#393939",hover:"#393939"},{primary:"#f4f4f4",secondary:"#c6c6c6",muted:"#6f6f6f"},"#525252"),cl=De("Cosmos",{primary:"#6366f1",primaryHover:"#4f46e5",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#030712",secondary:"#111827",tertiary:"#1f2937",hover:"#1f2937"},{primary:"#e5e7eb",secondary:"#9ca3af",muted:"#4b5563"},"#374151"),dl=De("Nebula",{primary:"#e879f9",primaryHover:"#d946ef",success:"#4ade80",warning:"#fbbf24",error:"#fb7185",info:"#67e8f9"},{primary:"#0d0117",secondary:"#1a0533",tertiary:"#2d0a52",hover:"#2d0a52"},{primary:"#fae8ff",secondary:"#d8b4fe",muted:"#7c3aed"},"#581c87"),ul=De("Abyss",{primary:"#22d3ee",primaryHover:"#06b6d4",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#001219",secondary:"#002a3a",tertiary:"#003e54",hover:"#003e54"},{primary:"#e0f2fe",secondary:"#7dd3fc",muted:"#0369a1"},"#075985"),pl=De("Shadow",{primary:"#a3a3a3",primaryHover:"#737373",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#38bdf8"},{primary:"#171717",secondary:"#1f1f1f",tertiary:"#2a2a2a",hover:"#2a2a2a"},{primary:"#e5e5e5",secondary:"#a3a3a3",muted:"#525252"},"#404040"),ml=De("Emerald Dark",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#022c22",secondary:"#064e3b",tertiary:"#065f46",hover:"#065f46"},{primary:"#ecfdf5",secondary:"#6ee7b7",muted:"#047857"},"#047857"),hl=be("Forest",{primary:"#166534",primaryHover:"#14532d",success:"#22c55e",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),fl=be("Ocean",{primary:"#0369a1",primaryHover:"#075985",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#38bdf8"},"#7dd3fc"),gl=be("Desert",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#422006",secondary:"#713f12",muted:"#ca8a04"},"#fde047"),yl=be("Sunset",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#f97316"},"#fdba74"),bl=be("Aurora",{primary:"#0d9488",primaryHover:"#0f766e",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),xl=be("Lavender",{primary:"#7e22ce",primaryHover:"#6b21a8",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#3b0764",secondary:"#581c87",muted:"#a855f7"},"#d8b4fe"),vl=be("Autumn",{primary:"#c2410c",primaryHover:"#9a3412",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#7f1d1d",muted:"#f87171"},"#fca5a5"),wl=be("Spring",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#14532d",secondary:"#166534",muted:"#4ade80"},"#86efac"),kl=be("Arctic",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),Sl=be("Tropical",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),Cl=be("Pastel Rose",{primary:"#f472b6",primaryHover:"#ec4899",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#f9a8d4"),_l=be("Pastel Sky",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#075985",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),jl=be("Pastel Mint",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#065f46",secondary:"#047857",muted:"#6ee7b7"},"#a7f3d0"),Nl=be("Pastel Peach",{primary:"#fb923c",primaryHover:"#f97316",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#7c2d12",secondary:"#9a3412",muted:"#fdba74"},"#fed7aa"),Ml=be("Pastel Lavender",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#4c1d95",secondary:"#5b21b6",muted:"#c4b5fd"},"#ddd6fe"),$l=be("Pastel Lemon",{primary:"#facc15",primaryHover:"#eab308",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#713f12",secondary:"#854d0e",muted:"#fde047"},"#fef08a"),El=be("Pastel Sage",{primary:"#86efac",primaryHover:"#4ade80",success:"#22c55e",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#166534",secondary:"#15803d",muted:"#86efac"},"#bbf7d0"),zl=be("Pastel Coral",{primary:"#fb7185",primaryHover:"#f43f5e",success:"#4ade80",warning:"#fcd34d",error:"#ef4444",info:"#67e8f9"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#881337",secondary:"#9f1239",muted:"#fda4af"},"#fecdd3"),Al=be("Banking",{primary:"#1e3a5f",primaryHover:"#152c4a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#334155",muted:"#94a3b8"},"#cbd5e1"),Fl=be("Healthcare",{primary:"#0891b2",primaryHover:"#0e7490",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#e0f7fa",tertiary:"#b2ebf2",hover:"#e0f7fa"},{primary:"#134e4a",secondary:"#1a6b6a",muted:"#80cbc4"},"#b2dfdb"),Il=be("Legal",{primary:"#1e293b",primaryHover:"#0f172a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#0f172a",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),Dl=be("Tech Startup",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#1e1b4b",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),Tl=be("Enterprise",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#60a5fa"},"#93c5fd"),Rl=be("Government",{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#1e293b",muted:"#64748b"},"#cbd5e1"),Pl=be("Education",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#0891b2"},{primary:"#f0fdf9",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),Bl=be("Real Estate",{primary:"#92400e",primaryHover:"#78350f",success:"#059669",warning:"#b45309",error:"#dc2626",info:"#0891b2"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#422006",secondary:"#713f12",muted:"#d97706"},"#fcd34d"),Ll=be("Nord",{primary:"#5e81ac",primaryHover:"#4c6b90",success:"#a3be8c",warning:"#ebcb8b",error:"#bf616a",info:"#88c0d0"},{primary:"#eceff4",secondary:"#e5e9f0",tertiary:"#d8dee9",hover:"#d8dee9"},{primary:"#2e3440",secondary:"#3b4252",muted:"#4c566a"},"#d8dee9"),Ol=De("Dracula",{primary:"#bd93f9",primaryHover:"#9d79d9",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#8be9fd"},{primary:"#282a36",secondary:"#343746",tertiary:"#44475a",hover:"#44475a"},{primary:"#f8f8f2",secondary:"#c0c0c0",muted:"#6272a4"},"#44475a"),Hl=be("Solarized Light",{primary:"#268bd2",primaryHover:"#1a6da0",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#fdf6e3",secondary:"#eee8d5",tertiary:"#e0dbc7",hover:"#eee8d5"},{primary:"#073642",secondary:"#586e75",muted:"#93a1a1"},"#eee8d5"),Wl=De("Solarized Dark",{primary:"#268bd2",primaryHover:"#3d98db",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#002b36",secondary:"#073642",tertiary:"#0a4858",hover:"#073642"},{primary:"#eee8d5",secondary:"#93a1a1",muted:"#586e75"},"#073642"),ql=De("Monokai",{primary:"#66d9ef",primaryHover:"#45c0d6",success:"#a6e22e",warning:"#e6db74",error:"#f92672",info:"#66d9ef"},{primary:"#272822",secondary:"#34352e",tertiary:"#3e3d32",hover:"#3e3d32"},{primary:"#f8f8f2",secondary:"#cfcfc2",muted:"#75715e"},"#3e3d32"),Vl=De("One Dark",{primary:"#61afef",primaryHover:"#4b9ee0",success:"#98c379",warning:"#e5c07b",error:"#e06c75",info:"#56b6c2"},{primary:"#282c34",secondary:"#2c313a",tertiary:"#353b45",hover:"#353b45"},{primary:"#abb2bf",secondary:"#828997",muted:"#545862"},"#3e4452"),Kl=De("Synthwave",{primary:"#ff7edb",primaryHover:"#e660c2",success:"#72f1b8",warning:"#fede5d",error:"#fe4450",info:"#36f9f6"},{primary:"#241b2f",secondary:"#2d2140",tertiary:"#362a50",hover:"#362a50"},{primary:"#f0e4fc",secondary:"#b4a0cc",muted:"#6c5c84"},"#4a3866"),Ul=be("Vaporwave",{primary:"#ff71ce",primaryHover:"#e655b5",success:"#78dcca",warning:"#ffb86c",error:"#ff5555",info:"#76e8fc"},{primary:"#fce4f7",secondary:"#e8d0f4",tertiary:"#d4bcf0",hover:"#e8d0f4"},{primary:"#4a1a4e",secondary:"#7b3f7d",muted:"#c080c0"},"#d8a8e8"),Yl=De("Terminal Green",{primary:"#00ff41",primaryHover:"#00cc34",success:"#00ff41",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0a0a0a",secondary:"#0d1a0d",tertiary:"#1a2e1a",hover:"#1a2e1a"},{primary:"#00ff41",secondary:"#00cc33",muted:"#008822"},"#003300"),Zl=be("Sepia",{primary:"#8b6914",primaryHover:"#704f10",success:"#6b8e23",warning:"#cd853f",error:"#b22222",info:"#5f9ea0"},{primary:"#faf0e6",secondary:"#f5e6d3",tertiary:"#eddcc7",hover:"#f5e6d3"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#d7ccc8"),Gl=be("Vintage",{primary:"#8d6e63",primaryHover:"#6d4c41",success:"#66bb6a",warning:"#ffb300",error:"#e53935",info:"#29b6f6"},{primary:"#efebe9",secondary:"#d7ccc8",tertiary:"#bcaaa4",hover:"#d7ccc8"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#bcaaa4"),Xl=De("Cyberpunk",{primary:"#00f0ff",primaryHover:"#00c8d4",success:"#39ff14",warning:"#ffff00",error:"#ff003c",info:"#bf00ff"},{primary:"#0a0e17",secondary:"#131824",tertiary:"#1c2333",hover:"#1c2333"},{primary:"#e0fbfc",secondary:"#80d4dd",muted:"#3a6b72"},"#1c3a44"),Ql=De("Neon",{primary:"#ff00ff",primaryHover:"#cc00cc",success:"#00ff00",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0d0d0d",secondary:"#1a1a1a",tertiary:"#262626",hover:"#262626"},{primary:"#ffffff",secondary:"#cccccc",muted:"#666666"},"#333333"),Jl=De("Retrowave",{primary:"#f77fbe",primaryHover:"#e462a3",success:"#72f1b8",warning:"#ffe261",error:"#ff4444",info:"#79e8fb"},{primary:"#1b0a2e",secondary:"#261440",tertiary:"#321e52",hover:"#321e52"},{primary:"#ffe6f7",secondary:"#c9a0c9",muted:"#6b4c7a"},"#4a2d66"),ec=be("Christmas",{primary:"#c41e3a",primaryHover:"#a01830",success:"#228b22",warning:"#ffd700",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),tc=De("Halloween",{primary:"#ff6600",primaryHover:"#e05500",success:"#4ade80",warning:"#fbbf24",error:"#ff0000",info:"#9333ea"},{primary:"#1a0a00",secondary:"#2d1500",tertiary:"#402000",hover:"#402000"},{primary:"#ffedd5",secondary:"#fdba74",muted:"#9a5c28"},"#5c3400"),nc=be("Valentine",{primary:"#e11d48",primaryHover:"#be123c",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#ec4899"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f9a8d4"},"#fda4af"),ac=be("Easter",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fef9ff",secondary:"#f3e8ff",tertiary:"#e8d5ff",hover:"#f3e8ff"},{primary:"#581c87",secondary:"#6d28d9",muted:"#c4b5fd"},"#ddd6fe"),ic=be("Summer Beach",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#fcd34d"),rc=be("Winter Frost",{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#93c5fd"},"#bfdbfe"),oc=be("Cherry Blossom",{primary:"#ec4899",primaryHover:"#db2777",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#fbcfe8"),sc=be("Harvest",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#d97706"},"#fcd34d"),lc=be("Japanese Zen",{primary:"#6b7280",primaryHover:"#4b5563",success:"#6b8e23",warning:"#d4a017",error:"#c0392b",info:"#5f9ea0"},{primary:"#faf9f6",secondary:"#f0ece3",tertiary:"#e6e0d4",hover:"#f0ece3"},{primary:"#2c2c2c",secondary:"#5c5c5c",muted:"#a0998a"},"#d5cec0"),cc=be("Moroccan",{primary:"#c2410c",primaryHover:"#9a3412",success:"#15803d",warning:"#ca8a04",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbf0",secondary:"#fef3e0",tertiary:"#fde6c4",hover:"#fef3e0"},{primary:"#3a1a00",secondary:"#7c2d12",muted:"#d97706"},"#f5d0a0"),dc=be("Scandinavian",{primary:"#4b5563",primaryHover:"#374151",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ffffff",secondary:"#f9fafb",tertiary:"#f3f4f6",hover:"#f3f4f6"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#e5e7eb"),uc=be("Mediterranean",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#2563eb",muted:"#93c5fd"},"#bfdbfe"),pc=be("Chinese New Year",{primary:"#dc2626",primaryHover:"#b91c1c",success:"#16a34a",warning:"#d4a017",error:"#ef4444",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#991b1b",muted:"#f87171"},"#fca5a5"),mc=be("Indian Festive",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#7c3aed"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#92400e",muted:"#f59e0b"},"#fcd34d"),hc=be("Brazilian Carnival",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#facc15",error:"#ef4444",info:"#0ea5e9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),fc=be("African Earth",{primary:"#92400e",primaryHover:"#78350f",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf5f0",secondary:"#f0e6d6",tertiary:"#e6d5bb",hover:"#f0e6d6"},{primary:"#2b1a0e",secondary:"#5c3d1e",muted:"#a08060"},"#d4b896"),gc=De("High Contrast Dark",{primary:"#ffff00",primaryHover:"#cccc00",success:"#00ff00",warning:"#ff8c00",error:"#ff0000",info:"#00ffff"},{primary:"#000000",secondary:"#1a1a1a",tertiary:"#333333",hover:"#333333"},{primary:"#ffffff",secondary:"#ffffff",muted:"#cccccc"},"#ffffff"),yc=be("Monochrome",{primary:"#404040",primaryHover:"#262626",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fafafa",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0"},{primary:"#1a1a1a",secondary:"#404040",muted:"#808080"},"#c0c0c0"),bc=be("Enhanced Contrast",{primary:"#0050b3",primaryHover:"#003d8c",success:"#006400",warning:"#cc7000",error:"#cc0000",info:"#006680"},{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#ebebeb"},{primary:"#000000",secondary:"#1a1a1a",muted:"#595959"},"#8c8c8c"),xc={name:"Large Text",colors:{primary:"#2563eb",primaryHover:"#1d4ed8",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8"},borders:Mn("#e2e8f0"),shadows:ai,spacing:{space1:"6px",space2:"12px",space3:"16px",space4:"20px",space5:"24px",space6:"32px",space8:"40px"},typography:{fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.875rem",fontSizeSm:"1rem",fontSizeMd:"1.125rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6},transitions:Tt},vc={name:"Glassmorphism",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},backgrounds:{primary:"rgba(255,255,255,0.7)",secondary:"rgba(255,255,255,0.5)",tertiary:"rgba(255,255,255,0.3)",hover:"rgba(255,255,255,0.5)"},text:{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},borders:{color:"rgba(255,255,255,0.3)",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"24px",radiusFull:"9999px"},shadows:{sm:"0 2px 8px rgba(0,0,0,0.04)",md:"0 4px 16px rgba(0,0,0,0.08)",lg:"0 8px 32px rgba(0,0,0,0.12)",xl:"0 16px 48px rgba(0,0,0,0.16)"},spacing:It,typography:Dt,transitions:{fast:"150ms ease",normal:"250ms ease",slow:"350ms ease"}},wc={name:"Neumorphism Light",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},backgrounds:{primary:"#e0e5ec",secondary:"#d5dae2",tertiary:"#ccd1d9",hover:"#d5dae2"},text:{primary:"#2d3748",secondary:"#4a5568",muted:"#718096"},borders:{color:"#d0d5dd",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #b8bec7, -3px -3px 6px #ffffff",md:"5px 5px 10px #b8bec7, -5px -5px 10px #ffffff",lg:"8px 8px 16px #b8bec7, -8px -8px 16px #ffffff",xl:"12px 12px 24px #b8bec7, -12px -12px 24px #ffffff"},spacing:It,typography:Dt,transitions:Tt},kc={name:"Neumorphism Dark",colors:{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},backgrounds:{primary:"#2d3748",secondary:"#283141",tertiary:"#232b3a",hover:"#283141"},text:{primary:"#e2e8f0",secondary:"#a0aec0",muted:"#718096"},borders:{color:"#3a4556",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #1a202c, -3px -3px 6px #404d64",md:"5px 5px 10px #1a202c, -5px -5px 10px #404d64",lg:"8px 8px 16px #1a202c, -8px -8px 16px #404d64",xl:"12px 12px 24px #1a202c, -12px -12px 24px #404d64"},spacing:It,typography:Dt,transitions:Tt},Sc=be("Minimalist",{primary:"#18181b",primaryHover:"#27272a",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"},{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f5f5f5"},{primary:"#0a0a0a",secondary:"#404040",muted:"#a3a3a3"},"#e5e5e5"),Cc=De("Warm Dark",{primary:"#f59e0b",primaryHover:"#d97706",success:"#10b981",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#1c1917",secondary:"#292524",tertiary:"#44403c",hover:"#44403c"},{primary:"#fafaf9",secondary:"#d6d3d1",muted:"#78716c"},"#57534e"),_c=De("Soft Dark",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#34d399",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#1e1e2e",secondary:"#262637",tertiary:"#313147",hover:"#313147"},{primary:"#e8e8f0",secondary:"#a0a0b8",muted:"#5c5c74"},"#3e3e58"),jc=be("Coffee",{primary:"#6f4e37",primaryHover:"#5c3d28",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf6f1",secondary:"#f0e8dc",tertiary:"#e6d8c6",hover:"#f0e8dc"},{primary:"#2c1a0e",secondary:"#5c3d28",muted:"#a08868"},"#d4c4a8"),Nc=be("Wine",{primary:"#7f1d1d",primaryHover:"#641717",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),Mc=[Ts,Rs,Ps,Bs,Ls,Os,Hs,Ws,qs,Vs,Ks,Us,Ys,Zs,Gs,Xs,Qs,Js,el,tl,nl,al,il,rl,ol,sl,ll,cl,dl,ul,pl,ml,hl,fl,gl,yl,bl,xl,vl,wl,kl,Sl,Cl,_l,jl,Nl,Ml,$l,El,zl,Al,Fl,Il,Dl,Tl,Rl,Pl,Bl,Ll,Ol,Hl,Wl,ql,Vl,Kl,Ul,Yl,Zl,Gl,Xl,Ql,Jl,ec,tc,nc,ac,ic,rc,oc,sc,lc,cc,dc,uc,pc,mc,hc,fc,gc,yc,bc,xc,vc,wc,kc,Sc,Cc,_c,jc,Nc],xt={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},rn={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},Rt={color:"#e2e8f0",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},Pt={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},ii={name:"Light",colors:{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#f8fafc"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:Rt,shadows:{sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},spacing:xt,typography:rn,transitions:Pt},$c={name:"Dark",colors:{primary:"#3b82f6",primaryHover:"#60a5fa",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4",surface:"#141414",surfaceHover:"#1e1e1e"},backgrounds:{primary:"#0a0a0a",secondary:"#141414",tertiary:"#1e1e1e",hover:"#1a1a1a",elevated:"#141414",inset:"#0a0a0a",canvas:"#0a0a0a"},text:{primary:"#ffffff",secondary:"#a1a1a1",muted:"#6b6b6b",inverse:"#0f172a"},borders:{...Rt,color:"#2a2a2a"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.5)",md:"0 4px 6px -1px rgba(0,0,0,0.6)",lg:"0 10px 15px -3px rgba(0,0,0,0.6)",xl:"0 20px 25px -5px rgba(0,0,0,0.6)"},spacing:xt,typography:rn,transitions:Pt},Ec={name:"Blue",colors:{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2",surface:"#eff6ff",surfaceHover:"#dbeafe"},backgrounds:{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe",elevated:"#ffffff",inset:"#dbeafe",canvas:"#eff6ff"},text:{primary:"#1e3a5f",secondary:"#3b628a",muted:"#7da0c4",inverse:"#ffffff"},borders:{...Rt,color:"#93c5fd"},shadows:{sm:"0 1px 2px rgba(29,78,216,0.08)",md:"0 4px 6px -1px rgba(29,78,216,0.12)",lg:"0 10px 15px -3px rgba(29,78,216,0.15)",xl:"0 20px 25px -5px rgba(29,78,216,0.18)"},spacing:xt,typography:rn,transitions:Pt},zc={name:"High Contrast",colors:{primary:"#0000ff",primaryHover:"#0000cc",success:"#008000",warning:"#ff8c00",error:"#ff0000",info:"#008b8b",surface:"#ffffff",surfaceHover:"#f0f0f0"},backgrounds:{primary:"#ffffff",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0",elevated:"#ffffff",inset:"#e0e0e0",canvas:"#ffffff"},text:{primary:"#000000",secondary:"#1a1a1a",muted:"#4d4d4d",inverse:"#ffffff"},borders:{...Rt,color:"#000000"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.15)",md:"0 4px 6px rgba(0,0,0,0.2)",lg:"0 10px 15px rgba(0,0,0,0.25)",xl:"0 20px 25px rgba(0,0,0,0.3)"},spacing:xt,typography:rn,transitions:Pt},Ac={name:"Material",colors:{primary:"#6750a4",primaryHover:"#4f378b",success:"#386a20",warning:"#7c5800",error:"#ba1a1a",info:"#00629e",surface:"#fffbfe",surfaceHover:"#f6edff"},backgrounds:{primary:"#fffbfe",secondary:"#f6edff",tertiary:"#ece6f0",hover:"#eaddff",elevated:"#ffffff",inset:"#ece6f0",canvas:"#fffbfe"},text:{primary:"#1c1b1f",secondary:"#49454f",muted:"#79747e",inverse:"#ffffff"},borders:{...Rt,color:"#cac4d0",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"28px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15)",md:"0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15)",lg:"0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3)",xl:"0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3)"},spacing:xt,typography:{fontFamily:"'Roboto', 'Noto Sans', system-ui, sans-serif",fontSizeXs:"0.6875rem",fontSizeSm:"0.75rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:{fast:"100ms cubic-bezier(0.2,0,0,1)",normal:"200ms cubic-bezier(0.2,0,0,1)",slow:"300ms cubic-bezier(0.2,0,0,1)"}},Fc={name:"Bootstrap",colors:{primary:"#0d6efd",primaryHover:"#0b5ed7",success:"#198754",warning:"#ffc107",error:"#dc3545",info:"#0dcaf0",surface:"#ffffff",surfaceHover:"#f8f9fa"},backgrounds:{primary:"#ffffff",secondary:"#f8f9fa",tertiary:"#e9ecef",hover:"#e9ecef",elevated:"#ffffff",inset:"#e9ecef",canvas:"#f8f9fa"},text:{primary:"#212529",secondary:"#6c757d",muted:"#adb5bd",inverse:"#ffffff"},borders:{color:"#dee2e6",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"16px",radiusFull:"50rem"},shadows:{sm:"0 0.125rem 0.25rem rgba(0,0,0,0.075)",md:"0 0.5rem 1rem rgba(0,0,0,0.15)",lg:"0 1rem 3rem rgba(0,0,0,0.175)",xl:"0 1rem 3rem rgba(0,0,0,0.25)"},spacing:xt,typography:{fontFamily:"system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:Pt},Ic={name:"Fluent",colors:{primary:"#0078d4",primaryHover:"#106ebe",success:"#107c10",warning:"#fce100",error:"#d13438",info:"#00b7c3",surface:"#ffffff",surfaceHover:"#faf9f8"},backgrounds:{primary:"#ffffff",secondary:"#faf9f8",tertiary:"#f3f2f1",hover:"#edebe9",elevated:"#ffffff",inset:"#f3f2f1",canvas:"#faf9f8"},text:{primary:"#323130",secondary:"#605e5c",muted:"#a19f9d",inverse:"#ffffff"},borders:{color:"#e1dfdd",radiusSm:"2px",radiusMd:"4px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"0 1.6px 3.6px 0 rgba(0,0,0,0.132), 0 0.3px 0.9px 0 rgba(0,0,0,0.108)",md:"0 3.2px 7.2px 0 rgba(0,0,0,0.132), 0 0.6px 1.8px 0 rgba(0,0,0,0.108)",lg:"0 6.4px 14.4px 0 rgba(0,0,0,0.132), 0 1.2px 3.6px 0 rgba(0,0,0,0.108)",xl:"0 25.6px 57.6px 0 rgba(0,0,0,0.22), 0 4.8px 14.4px 0 rgba(0,0,0,0.18)"},spacing:xt,typography:{fontFamily:"'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",fontSizeXs:"10px",fontSizeSm:"12px",fontSizeMd:"14px",fontSizeLg:"16px",fontSizeXl:"20px",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.42857},transitions:{fast:"100ms cubic-bezier(0.1,0.9,0.2,1)",normal:"200ms cubic-bezier(0.1,0.9,0.2,1)",slow:"300ms cubic-bezier(0.1,0.9,0.2,1)"}},Dc=[ii,$c,Ec,zc,Ac,Fc,Ic,...Mc],ri=({theme:e,darkTheme:t,variantConfig:a,darkMode:i,displayStyle:r,animateTransitions:s=!0,children:l})=>{const c=o.useRef(null),[d,u]=o.useState(e),[g,h]=o.useState(!1),[p,m]=o.useState(r??"default");o.useEffect(()=>{r!==void 0&&m(r)},[r]),o.useEffect(()=>{const v=window.matchMedia("(prefers-color-scheme: dark)");h(v.matches);const j=S=>h(S.matches);return v.addEventListener("change",j),()=>v.removeEventListener("change",j)},[]);const k=i??e.darkMode??"light",b=k==="dark"||k==="auto"&&g;o.useEffect(()=>{u(b&&t?t:e)},[e,t,b]),o.useEffect(()=>{const v=c.current;if(!v)return;s&&(v.style.transition="background-color 300ms ease, color 300ms ease");const j=Nn(d);for(const[I,M]of Object.entries(j))v.style.setProperty(I,M);v.style.colorScheme=b?"dark":"light",v.dataset.ntdColorScheme=b?"dark":"light";const S=d.backgroundImage;return S&&S.type!=="none"&&S.type==="gradient"&&S.gradient&&v.style.setProperty("--ntd-bg-image",S.gradient),()=>{v&&ms(v)}},[d,b,s]),o.useEffect(()=>{const v=c.current;if(!v)return;const j=a?{...Jt,...a}:en(p);As(j,v);const S=Is(p);for(const[I,M]of Object.entries(S))v.setAttribute(I,M)},[a,p]);const C=o.useCallback(v=>{u(v)},[]),_=o.useMemo(()=>({theme:d,setTheme:C}),[d,C]),f=o.useMemo(()=>({displayStyle:p,variantConfig:en(p),setDisplayStyle:m}),[p]);return n.jsx(gs.Provider,{value:_,children:n.jsx(ti.Provider,{value:f,children:n.jsx("div",{ref:c,className:"nice-theme-scope",style:{display:"contents"},children:l})})})};ri.displayName="NiceThemeProvider";const yt=({height:e=200})=>n.jsx("div",{className:"ntd-lazy-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",height:e,background:"var(--ntd-color-surface, #f5f5f5)",borderRadius:"var(--ntd-radius, 8px)",animation:"ntd-pulse 1.5s ease-in-out infinite"},children:n.jsx("div",{className:"ntd-lazy-loading-spinner",style:{width:24,height:24,border:"2px solid var(--ntd-color-border, #ddd)",borderTopColor:"var(--ntd-color-primary, #6366f1)",borderRadius:"50%",animation:"ntd-spin 0.8s linear infinite"}})}),Tc=(e,t)=>n.jsxs("div",{className:"ntd-lazy-error",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,background:"var(--ntd-color-error-bg, #fee2e2)",borderRadius:"var(--ntd-radius, 8px)",color:"var(--ntd-color-error, #dc2626)"},children:[n.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),n.jsx("p",{style:{margin:"12px 0 8px",fontWeight:500},children:"Failed to load component"}),n.jsx("p",{style:{margin:0,fontSize:"0.875em",opacity:.8},children:e.message}),n.jsx("button",{onClick:t,style:{marginTop:16,padding:"8px 16px",border:"none",borderRadius:"var(--ntd-radius, 8px)",background:"var(--ntd-color-error, #dc2626)",color:"#fff",cursor:"pointer",fontSize:"0.875em"},children:"Retry"})]});class Rc extends o.Component{constructor(){super(...arguments),this.state={error:null},this.handleRetry=()=>{this.setState({error:null})}}static getDerivedStateFromError(t){return{error:t}}render(){return this.state.error?this.props.fallback(this.state.error,this.handleRetry):this.props.children}}function Ue(e,t={}){const{fallback:a=n.jsx(yt,{}),preloadOnMount:i=!1,preloadOnHover:r=!1,preloadAfterIdle:s,minLoadingTime:l=0,ssrFallback:c,errorFallback:d=Tc,displayName:u}=t;let g=null,h=!1;const p=async()=>{if(g)return g;const _=Date.now();g=e();const f=await g;if(l>0){const v=Date.now()-_;v<l&&await new Promise(j=>setTimeout(j,l-v))}return h=!0,f},m=o.lazy(p),k=_=>{const f=o.useRef(null);return o.useEffect(()=>{i&&!h&&p()},[]),o.useEffect(()=>{if(s&&!h){const v="requestIdleCallback"in window?window.requestIdleCallback(()=>p(),{timeout:s}):setTimeout(()=>p(),s);return()=>{"cancelIdleCallback"in window?window.cancelIdleCallback(v):clearTimeout(v)}}},[]),o.useEffect(()=>{if(!r||h)return;const v=f.current;if(!v)return;const j=()=>{h||p()};return v.addEventListener("mouseenter",j,{once:!0}),()=>v.removeEventListener("mouseenter",j)},[]),typeof window>"u"&&c?n.jsx(n.Fragment,{children:c}):n.jsx("div",{ref:f,className:"ntd-lazy-wrapper",children:n.jsx(Rc,{fallback:d,children:n.jsx(o.Suspense,{fallback:a,children:n.jsx(m,{..._})})})})},b=async()=>{h||await p()},C=k;return C.preload=b,C.displayName=u||"LazyComponent",C}const ba=()=>n.jsx(yt,{height:400}),xa=()=>n.jsx(yt,{height:300}),va=()=>n.jsx(yt,{height:500}),wa=()=>n.jsx(yt,{height:600}),Ye=e=>e;Ue(Ye(()=>Promise.resolve().then(()=>Ha).then(e=>e.ar).then(e=>({default:e.NiceCodeEditor}))),{fallback:n.jsx(ba,{}),preloadOnHover:!0,displayName:"LazyCodeEditor"}),Ue(Ye(()=>Promise.resolve().then(()=>Ha).then(e=>e.aq).then(e=>({default:e.NiceHtmlEditor}))),{fallback:n.jsx(ba,{}),preloadOnHover:!0,displayName:"LazyHtmlEditor"}),Ue(Ye(()=>Promise.resolve().then(()=>require("./index-CIl98Vbm-DPDdqp0C.cjs")).then(e=>e.fP).then(e=>({default:e.NiceDocumentViewer}))),{fallback:n.jsx(yt,{height:600}),displayName:"LazyDocumentViewer"}),Ue(Ye(()=>Promise.resolve().then(()=>dn).then(e=>e.A).then(e=>({default:e.NiceChart}))),{fallback:n.jsx(xa,{}),preloadAfterIdle:3e3,displayName:"LazyChart"}),Ue(Ye(()=>Promise.resolve().then(()=>dn).then(e=>e.D).then(e=>({default:e.NiceVectorMap}))),{fallback:n.jsx(yt,{height:400}),displayName:"LazyVectorMap"}),Ue(Ye(()=>Promise.resolve().then(()=>dn).then(e=>e.B).then(e=>({default:e.NiceSankey}))),{fallback:n.jsx(xa,{}),displayName:"LazySankey"}),Ue(Ye(()=>Promise.resolve().then(()=>require("./index-CIl98Vbm-DPDdqp0C.cjs")).then(e=>e.fN).then(e=>({default:e.NiceScheduler}))),{fallback:n.jsx(wa,{}),displayName:"LazyScheduler"}),Ue(Ye(()=>Promise.resolve().then(()=>require("./index-CIl98Vbm-DPDdqp0C.cjs")).then(e=>e.fO).then(e=>({default:e.NiceGantt}))),{fallback:n.jsx(wa,{}),displayName:"LazyGantt"}),Ue(Ye(()=>Promise.resolve().then(()=>require("./NiceSavedQueryPanel-CUAsdOjJ-CluPYvkx.cjs")).then(e=>e.s).then(e=>({default:e.NicePivotGrid}))),{fallback:n.jsx(va,{}),displayName:"LazyPivotGrid"}),Ue(Ye(()=>Promise.resolve().then(()=>require("./NiceSavedQueryPanel-CUAsdOjJ-CluPYvkx.cjs")).then(e=>e.r).then(e=>({default:e.NiceDataGrid}))),{fallback:n.jsx(va,{}),preloadAfterIdle:2e3,displayName:"LazyDataGrid"});process.env.NODE_ENV;const Pc=process.env.NODE_ENV==="development";let oi={enabled:Pc,slowRenderThreshold:16};const si=[],$n=new Map,li=new Map;function Bc(){si.length=0,$n.clear(),li.clear()}function Lc(e){const t=oi.slowRenderThreshold;return si.filter(a=>a.actualDuration>t)}function ut(e){return e<1?`${(e*1e3).toFixed(0)}μs`:e<1e3?`${e.toFixed(2)}ms`:`${(e/1e3).toFixed(2)}s`}function Oc(){const e=Array.from($n.values()),t=Lc(),a=e.reduce((s,l)=>s+l.renderCount,0),i=e.length>0?e.reduce((s,l)=>s+l.avgRenderTime,0)/e.length:0,r=Array.from(li.values());return{stats:e,slowRenders:t,totalRenders:a,avgRenderTime:i,marks:r}}function Hc(){const e=Oc();console.group("%c[Nice2Dev Performance Report]","color: #6366f1; font-weight: bold; font-size: 14px"),console.log(`Total renders: ${e.totalRenders}`),console.log(`Average render time: ${ut(e.avgRenderTime)}`),console.log(`Slow renders: ${e.slowRenders.length}`),console.group("Component Stats"),console.table(e.stats.sort((t,a)=>a.totalRenderTime-t.totalRenderTime).map(t=>({Name:t.componentName,Renders:t.renderCount,"Avg Time":ut(t.avgRenderTime),"Max Time":ut(t.maxRenderTime),"Total Time":ut(t.totalRenderTime),"Slow Renders":t.slowRenderCount}))),console.groupEnd(),e.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(e.slowRenders.slice(-10).map(t=>({Component:t.componentName,Phase:t.phase,Duration:ut(t.actualDuration),Time:new Date(t.timestamp).toLocaleTimeString()}))),console.groupEnd()),e.marks.length>0&&(console.group("Custom Marks"),console.table(e.marks.filter(t=>t.duration).map(t=>({Name:t.name,Duration:ut(t.duration)}))),console.groupEnd()),console.groupEnd()}const Wc=o.memo(({position:e="bottom-right",defaultCollapsed:t=!0})=>{const[a,i]=o.useState(t),[r,s]=o.useState([]),[l,c]=o.useState({used:0,total:0});if(o.useEffect(()=>{const u=()=>{const h=Array.from($n.values());s(h.sort((m,k)=>k.totalRenderTime-m.totalRenderTime).slice(0,10));const p=window.performance;p.memory&&c({used:p.memory.usedJSHeapSize/1024/1024,total:p.memory.totalJSHeapSize/1024/1024})};u();const g=setInterval(u,2e3);return()=>clearInterval(g)},[]),!oi.enabled)return null;const d={position:"fixed",zIndex:99999,...e.includes("top")?{top:8}:{bottom:8},...e.includes("left")?{left:8}:{right:8}};return n.jsxs("div",{style:{...d,background:"rgba(0, 0, 0, 0.85)",color:"#fff",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:a?"4px 8px":8,maxWidth:a?"auto":300,maxHeight:a?"auto":400,overflow:"auto"},children:[n.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>i(u=>!u),children:[n.jsx("span",{style:{color:"#22c55e"},children:"●"}),n.jsx("span",{children:"Profiler"}),l.used>0&&n.jsxs("span",{style:{color:l.used>100?"#f59e0b":"#64748b"},children:[l.used.toFixed(0),"MB"]}),n.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:a?"▼":"▲"})]}),!a&&n.jsxs("div",{style:{marginTop:8},children:[n.jsx("div",{style:{borderBottom:"1px solid #333",paddingBottom:4,marginBottom:8},children:n.jsx("strong",{children:"Top Components"})}),r.map(u=>n.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[n.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:u.componentName}),n.jsx("span",{style:{color:u.avgRenderTime>16?"#f59e0b":"#22c55e"},children:ut(u.avgRenderTime)}),n.jsxs("span",{style:{color:"#64748b",minWidth:30,textAlign:"right"},children:["x",u.renderCount]})]},u.componentName)),n.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[n.jsx("button",{onClick:Hc,style:{flex:1,padding:"4px 8px",background:"#333",border:"none",borderRadius:4,color:"#fff",cursor:"pointer",fontSize:10},children:"Print Report"}),n.jsx("button",{onClick:Bc,style:{flex:1,padding:"4px 8px",background:"#333",border:"none",borderRadius:4,color:"#fff",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});Wc.displayName="ProfilerOverlay";o.createContext(null);o.createContext(null);const ht=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,displayStyle:p,value:m,defaultValue:k,onChange:b,onBlur:C,onKeyDown:_,placeholder:f,type:v="text",maxLength:j,prefix:S,suffix:I,clearable:M,autoFocus:w,submitOnEnter:E,onSubmit:P,showKeyboardHints:L,...A},N)=>{const x=$e(h,d);if(x==="hidden")return null;x==="disabled"&&(r=!0),x==="readOnly"&&(s=!0);const{t:O}=Se(),D=ke(d),F=Ge("input",p),y=qe("input",p),$=o.useCallback(()=>b==null?void 0:b(""),[b]),z=jn({enabled:E,onSubmit:P}),R=o.useCallback(B=>{z(B),_==null||_(B)},[z,_]),T=o.useMemo(()=>{const B=[];return E&&B.push({key:"Enter",description:O("shortcuts.submit","Submit")}),M&&B.push({key:"Escape",description:O("shortcuts.clear","Clear")}),B},[E,M,O]);return n.jsxs("div",{className:`nice-field ${u||""}`,style:g,children:[e&&n.jsxs("label",{htmlFor:D,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,L&&T.length>0&&n.jsx(Oe,{shortcuts:T,size:"sm"})]}),n.jsxs("div",{className:`nice-input nice-input--${l} nice-input--ds-${y} ${a?"nice-input--error":""} ${r?"nice-input--disabled":""} ${s?"nice-input--readonly":""}`,style:F,children:[S&&n.jsx("span",{className:"nice-input__icon",children:S}),n.jsx("input",{ref:N,id:D,className:"nice-input__native",type:v,name:c,value:m,defaultValue:k,placeholder:f,disabled:r,readOnly:s,maxLength:j,autoFocus:w,"aria-invalid":!!a,"aria-describedby":a?`${D}-error`:t?`${D}-helper`:void 0,onChange:B=>b==null?void 0:b(B.target.value),onBlur:C,onKeyDown:R,...A}),M&&m&&n.jsx("button",{type:"button",className:"nice-input__clear",onClick:$,"aria-label":O("controls.clear","Clear"),children:"✕"}),I&&n.jsx("span",{className:"nice-input__icon",children:I})]}),a&&n.jsx("div",{id:`${D}-error`,className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{id:`${D}-helper`,className:"nice-field__helper",children:t})]})});ht.displayName="NiceTextInput";const gt=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,size:s="md",name:l,id:c,className:d,style:u,accessMode:g,displayStyle:h,options:p,value:m,onChange:k,placeholder:b,multiple:C=!1,searchable:_=!1,clearable:f=!1,emptyText:v,maxHeight:j=240,optionsSource:S,valueField:I,labelField:M,virtualScroll:w,optionHeight:E=36,onSearch:P,loading:L,renderOption:A,showKeyboardHints:N},x)=>{const O=$e(g,c);if(O==="hidden")return null;(O==="disabled"||O==="readOnly")&&(r=!0);const{t:D}=Se(),F=Ge("input",h),y=qe("input",h),$=ke(c),[z,R]=o.useState(!1),[T,B]=o.useState(""),[V,K]=o.useState(-1),[H,q]=o.useState(0),Z=o.useRef(null),Q=es(S??null,I??(S==null?void 0:S.keyField)??"id",M??"name"),J=S?Q.options:p??[];ot(Z,()=>{R(!1),B("")});const ee=o.useMemo(()=>m?Array.isArray(m)?m:[m]:[],[m]),ie=o.useMemo(()=>{if(!T&&!P||P)return J;const Y=T.toLowerCase();return J.filter(X=>X.label.toLowerCase().includes(Y)||String(X.value).toLowerCase().includes(Y))},[J,T,P]),pe=o.useMemo(()=>{const Y=new Map;for(const X of ie){const W=X.group||"";Y.has(W)||Y.set(W,[]),Y.get(W).push(X)}return Y},[ie]),te=o.useCallback(Y=>{if(C){const X=ee.includes(Y)?ee.filter(W=>W!==Y):[...ee,Y];k==null||k(X)}else k==null||k(Y),R(!1),B("")},[C,ee,k]),ue=o.useCallback(Y=>{if(Y.key==="Escape"){R(!1),B("");return}if(Y.key==="Enter"||Y.key===" "){if(!z){R(!0),Y.preventDefault();return}V>=0&&ie[V]&&(te(ie[V].value),Y.preventDefault());return}Y.key==="ArrowDown"&&(Y.preventDefault(),K(X=>Math.min(X+1,ie.length-1))),Y.key==="ArrowUp"&&(Y.preventDefault(),K(X=>Math.max(X-1,0)))},[z,V,ie,te]),fe=o.useMemo(()=>{var Y;return ee.length===0?null:C?ee.map(X=>{var W;return((W=J.find(G=>G.value===X))==null?void 0:W.label)||X}).join(", "):((Y=J.find(X=>X.value===ee[0]))==null?void 0:Y.label)||ee[0]},[ee,J,C]),ae=o.useCallback(Y=>{Y.stopPropagation(),k==null||k(C?[]:"")},[k,C]),he=o.useMemo(()=>[{key:"Enter",description:D("shortcuts.select","Select")},{key:"Space",description:D("shortcuts.openDropdown","Open dropdown")},Ae.moveUp,Ae.moveDown,Ae.cancel],[D]);return n.jsxs("div",{className:`nice-field ${d||""}`,style:u,children:[e&&n.jsxs("label",{htmlFor:$,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,N&&n.jsx(Oe,{shortcuts:he,size:"sm"})]}),n.jsxs("div",{className:"nice-select",ref:Z,children:[n.jsxs("button",{ref:x,type:"button",id:$,role:"combobox","aria-expanded":z,"aria-haspopup":"listbox","aria-invalid":!!a,className:`nice-select__trigger nice-select__trigger--${s} nice-select--ds-${y} ${z?"nice-select__trigger--open":""} ${a?"nice-select__trigger--error":""} ${r?"nice-select__trigger--disabled":""}`,style:F,disabled:r,onClick:()=>R(!z),onKeyDown:ue,children:[fe?n.jsx("span",{children:fe}):n.jsx("span",{className:"nice-select__placeholder",children:b||D("controls.select","Select...")}),n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[f&&ee.length>0&&n.jsx("span",{className:"nice-input__clear",onClick:ae,role:"button","aria-label":D("controls.clear","Clear"),children:"✕"}),n.jsx("svg",{className:`nice-select__chevron ${z?"nice-select__chevron--open":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]})]}),z&&n.jsxs("div",{className:"nice-select__dropdown",role:"listbox",style:{maxHeight:j},onScroll:w?Y=>q(Y.currentTarget.scrollTop):void 0,children:[(_||P)&&n.jsx("div",{className:"nice-select__search",children:n.jsx("input",{type:"text",value:T,onChange:Y=>{B(Y.target.value),K(0),P==null||P(Y.target.value)},placeholder:D("controls.search","Search..."),autoFocus:!0})}),L&&n.jsx("div",{className:"nice-select__loading",children:n.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!L&&ie.length===0?n.jsx("div",{className:"nice-select__empty",children:v||D("controls.noResults","No results found")}):w&&!Array.from(pe.keys()).some(Y=>Y!=="")?(()=>{const Y=ie.length*E,X=Math.max(0,Math.floor(H/E)-3),W=Math.min(ie.length,Math.ceil((H+j)/E)+3),G=ie.slice(X,W);return n.jsx("div",{style:{height:Y,position:"relative"},children:G.map((re,ne)=>{const se=X+ne,oe=ee.includes(re.value);return n.jsx("div",{role:"option","aria-selected":oe,className:`nice-select__option ${oe?"nice-select__option--selected":""} ${se===V?"nice-select__option--highlighted":""} ${re.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:se*E,left:0,right:0,height:E,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!re.disabled&&te(String(re.value)),onMouseEnter:()=>K(se),children:A?A(re,oe):n.jsxs(n.Fragment,{children:[re.icon&&n.jsx("span",{children:re.icon}),n.jsxs("div",{style:{flex:1},children:[n.jsx("div",{children:re.label}),re.description&&n.jsx("div",{className:"nice-select__option-desc",children:re.description})]}),oe&&n.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},re.value)})})})():Array.from(pe.entries()).map(([Y,X])=>n.jsxs(o.Fragment,{children:[Y&&n.jsx("div",{className:"nice-select__group-label",children:Y}),X.map(W=>{const G=ee.includes(W.value),re=ie.indexOf(W);return n.jsx("div",{role:"option","aria-selected":G,className:`nice-select__option ${G?"nice-select__option--selected":""} ${re===V?"nice-select__option--highlighted":""} ${W.disabled?"nice-select__option--disabled":""}`,onClick:()=>!W.disabled&&te(String(W.value)),onMouseEnter:()=>K(re),children:A?A(W,G):n.jsxs(n.Fragment,{children:[W.icon&&n.jsx("span",{children:W.icon}),n.jsxs("div",{style:{flex:1},children:[n.jsx("div",{children:W.label}),W.description&&n.jsx("div",{className:"nice-select__option-desc",children:W.description})]}),G&&n.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},W.value)})]},Y))]})]}),a&&n.jsx("div",{className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{className:"nice-field__helper",children:t})]})});gt.displayName="NiceSelect";const qc=["#ef4444","#f97316","#f59e0b","#84cc16","#10b981","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#ec4899","#64748b","#1e293b"];function Vc(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}const bt=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,id:s,className:l,style:c,accessMode:d,displayStyle:u,value:g="#3b82f6",onChange:h,presets:p=qc,showInput:m=!0,showRandom:k=!0,showKeyboardHints:b},C)=>{const _=$e(d,s);if(_==="hidden")return null;(_==="disabled"||_==="readOnly")&&(r=!0);const{t:f}=Se(),v=ke(s);qe("input",u);const j=o.useRef(null),S=o.useCallback(()=>{r||(h==null||h(Vc()))},[r,h]),I=o.useMemo(()=>[{key:"Enter",description:f("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:f("shortcuts.navigatePresets","Navigate presets")}],[f]);return n.jsxs("div",{className:`nice-field ${l||""}`,style:c,children:[e&&n.jsxs("label",{htmlFor:v,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,b&&n.jsx(Oe,{shortcuts:I,size:"sm"})]}),n.jsxs("div",{className:"nice-color-picker",children:[n.jsxs("div",{className:"nice-color-picker__preview-row",children:[n.jsx("div",{className:"nice-color-picker__swatch",style:{background:g},onClick:()=>{var M;return(M=j.current)==null?void 0:M.click()},role:"button",tabIndex:0,"aria-label":"Pick color",children:n.jsx("input",{ref:M=>{j.current=M,typeof C=="function"?C(M):C&&(C.current=M)},type:"color",className:"nice-color-picker__native",id:v,value:g,disabled:r,onChange:M=>h==null?void 0:h(M.target.value)})}),m&&n.jsx("div",{className:"nice-input nice-input--sm",style:{width:100},children:n.jsx("input",{className:"nice-input__native",type:"text",value:g,disabled:r,onChange:M=>h==null?void 0:h(M.target.value),maxLength:7})}),k&&n.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:S,disabled:r,title:"Random color","aria-label":"Random color",children:"🎲"})]}),p.length>0&&n.jsx("div",{className:"nice-color-picker__presets",children:p.map(M=>n.jsx("div",{className:`nice-color-picker__preset ${g===M?"nice-color-picker__preset--active":""}`,style:{background:M},onClick:()=>h==null?void 0:h(M),role:"button",tabIndex:0,"aria-label":M},M))})]}),a&&n.jsx("div",{className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{className:"nice-field__helper",children:t})]})});bt.displayName="NiceColorPicker";const ve=o.forwardRef(({children:e,variant:t="primary",size:a="md",type:i="button",disabled:r,loading:s,fullWidth:l,onClick:c,leftIcon:d,rightIcon:u,className:g,style:h,id:p,accessMode:m,displayStyle:k,...b},C)=>{const _=$e(m,p);if(_==="hidden")return null;(_==="disabled"||_==="readOnly")&&(r=!0);const f=Ge("button",k),v=qe("button",k);return n.jsxs("button",{ref:C,type:i,id:p,className:`nice-btn nice-btn--${t} nice-btn--${a} nice-btn--ds-${v} ${l?"nice-btn--full-width":""} ${s?"nice-btn--loading":""} ${g||""}`,style:{...f,...h},disabled:r||s,"aria-busy":s||void 0,"aria-disabled":r||s||void 0,onClick:c,...b,children:[s&&n.jsx("svg",{className:"nice-btn__spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3","aria-hidden":"true",children:n.jsx("circle",{cx:"12",cy:"12",r:"10",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})}),!s&&d&&n.jsx("span",{"aria-hidden":"true",children:d}),n.jsx("span",{children:e}),!s&&u&&n.jsx("span",{"aria-hidden":"true",children:u})]})});ve.displayName="NiceButton";const Kc=(e,t)=>t,Uc=o.createContext(Kc);function Bt(){return{t:o.useContext(Uc)}}o.createContext({dir:"ltr",isRTL:!1,flip:e=>e,value:e=>e.ltr});o.createContext(null);o.createContext(null);const Wt=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#06b6d4","#84cc16"],Lt=({series:e,categories:t,width:a=600,height:i=400,title:r,showLegend:s=!0,showGrid:l=!0,yAxisLabel:c,xAxisLabel:d,stacked:u,zoomable:g,crosshair:h,annotations:p,legendInteractive:m,onDataPointClick:k,exportable:b,className:C,style:_})=>{var ue,fe;const f=o.useRef(null),[v,j]=o.useState(new Set),[S,I]=o.useState(null),[M,w]=o.useState(null),[E,P]=o.useState(!1),L=o.useRef(null),A=o.useMemo(()=>e.filter(ae=>!v.has(ae.name)),[e,v]),N=o.useCallback(ae=>{m&&j(he=>{const Y=new Set(he);return Y.has(ae)?Y.delete(ae):Y.add(ae),Y})},[m]),x={top:r?40:20,right:20,bottom:d?60:40,left:c?60:50},O=a-x.left-x.right,D=i-x.top-x.bottom,F=((ue=A[0])==null?void 0:ue.data.length)??((fe=e[0])==null?void 0:fe.data.length)??0,y=(M==null?void 0:M.start)??0,$=(M==null?void 0:M.end)??F,z=$-y,R=o.useMemo(()=>A.map(ae=>({...ae,data:ae.data.slice(y,$)})),[A,y,$]),T=o.useMemo(()=>t==null?void 0:t.slice(y,$),[t,y,$]),{minY:B,maxY:V,yTicks:K}=o.useMemo(()=>{let ae;if(u){ae=[];for(let se=0;se<z;se++)ae.push(R.reduce((oe,ye)=>oe+(ye.data[se]||0),0))}else ae=R.flatMap(se=>se.data);ae.length===0&&(ae=[0]);const he=Math.min(0,...ae),Y=Math.max(0,...ae),X=Y-he||1,W=Math.pow(10,Math.floor(Math.log10(X)))||1,G=Math.floor(he/W)*W,re=Math.ceil(Y/W)*W,ne=[];for(let se=G;se<=re;se+=W)ne.push(Math.round(se*1e6)/1e6);return ne.length<2&&ne.push(re),{minY:G,maxY:re,yTicks:ne}},[R,z,u]),H=ae=>D-(ae-B)/(V-B||1)*D,q=ae=>(ae+.5)/z*O,Z=z>0?O/z/(u?1.5:Math.max(A.length,1)*1.5):20,Q=o.useCallback(ae=>{if(!g)return;ae.preventDefault();const he=M??{start:0,end:F},Y=he.end-he.start,X=(he.start+he.end)/2,W=ae.deltaY>0?1.2:.8,G=Math.max(2,Math.min(F,Math.round(Y*W))),re=Math.max(0,Math.round(X-G/2)),ne=Math.min(F,re+G);w({start:re,end:ne})},[g,M,F]),J=o.useCallback(ae=>{g&&(P(!0),L.current={x:ae.clientX,range:M??{start:0,end:F}})},[g,M,F]),ee=o.useCallback(ae=>{var Y;const he=(Y=f.current)==null?void 0:Y.getBoundingClientRect();if(he&&I({x:ae.clientX-he.left-x.left,y:ae.clientY-he.top-x.top}),E&&L.current&&g){const X=ae.clientX-L.current.x,W=O/z,G=-Math.round(X/W),re=L.current.range,ne=re.end-re.start;let se=re.start+G;se<0&&(se=0),se+ne>F&&(se=F-ne),w({start:se,end:se+ne})}},[E,g,O,z,F,x.left,x.top]),ie=o.useCallback(()=>{P(!1),L.current=null},[]),pe=o.useCallback(()=>{I(null),P(!1),L.current=null},[]),te=o.useCallback(()=>{const ae=f.current;if(!ae)return;const he=new XMLSerializer().serializeToString(ae),Y=document.createElement("canvas");Y.width=a,Y.height=i+(s?30:0);const X=Y.getContext("2d");if(!X)return;const W=new Image;W.onload=()=>{X.fillStyle="#fff",X.fillRect(0,0,Y.width,Y.height),X.drawImage(W,0,0);const G=document.createElement("a");G.download="chart.png",G.href=Y.toDataURL("image/png"),G.click()},W.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(he)},[a,i,s]);return n.jsxs("div",{className:`nice-chart ${C||""}`,style:_,children:[b&&n.jsx("button",{type:"button",className:"nice-chart__export-btn",onClick:te,title:"Export PNG",children:"📷"}),n.jsxs("svg",{ref:f,width:a,height:i+(s?30:0),className:"nice-chart__svg",onWheel:Q,onMouseDown:J,onMouseMove:ee,onMouseUp:ie,onMouseLeave:pe,children:[n.jsxs("g",{transform:`translate(${x.left},${x.top})`,children:[r&&n.jsx("text",{x:O/2,y:-10,textAnchor:"middle",className:"nice-chart__title",children:r}),l&&K.map(ae=>n.jsxs("g",{children:[n.jsx("line",{x1:0,y1:H(ae),x2:O,y2:H(ae),className:"nice-chart__grid-line"}),n.jsx("text",{x:-8,y:H(ae)+4,textAnchor:"end",className:"nice-chart__axis-label",children:ae})]},ae)),T&&T.map((ae,he)=>n.jsx("text",{x:q(he),y:D+20,textAnchor:"middle",className:"nice-chart__axis-label",children:ae},he)),c&&n.jsx("text",{x:-x.left+14,y:D/2,textAnchor:"middle",transform:`rotate(-90, -${x.left-14}, ${D/2})`,className:"nice-chart__axis-title",children:c}),d&&n.jsx("text",{x:O/2,y:D+45,textAnchor:"middle",className:"nice-chart__axis-title",children:d}),n.jsx("line",{x1:0,y1:0,x2:0,y2:D,className:"nice-chart__axis"}),n.jsx("line",{x1:0,y1:D,x2:O,y2:D,className:"nice-chart__axis"}),p==null?void 0:p.map((ae,he)=>{if(ae.type==="line"){const Y=H(ae.value);return n.jsxs("g",{children:[n.jsx("line",{x1:0,y1:Y,x2:O,y2:Y,stroke:ae.color||"#ef4444",strokeWidth:1.5,strokeDasharray:ae.dash||"6,3"}),ae.label&&n.jsx("text",{x:O+4,y:Y+4,className:"nice-chart__annotation-label",fill:ae.color||"#ef4444",children:ae.label})]},he)}return n.jsx("text",{x:q(ae.value),y:-4,textAnchor:"middle",className:"nice-chart__annotation-label",fill:ae.color||"#6b7280",children:ae.label},he)}),h&&S&&S.x>=0&&S.x<=O&&S.y>=0&&S.y<=D&&n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:S.x,y1:0,x2:S.x,y2:D,stroke:"#9ca3af",strokeWidth:1,strokeDasharray:"4,2"}),n.jsx("line",{x1:0,y1:S.y,x2:O,y2:S.y,stroke:"#9ca3af",strokeWidth:1,strokeDasharray:"4,2"})]}),R.map((ae,he)=>{const Y=ae.color||Wt[he%Wt.length],X=ae.type||"bar";if(X==="bar")return n.jsx("g",{children:ae.data.map((G,re)=>{let ne,se;if(u){const ye=R.slice(0,he).reduce((ge,we)=>ge+(we.data[re]||0),0);ne=H(ye+G),se=H(ye)-ne}else ne=H(Math.max(0,G)),se=Math.abs(H(G)-H(0));const oe=u?q(re)-Z/2:q(re)-R.length*Z/2+he*Z;return n.jsx("rect",{x:oe,y:ne,width:Z*.9,height:Math.max(0,se),fill:Y,rx:2,style:k?{cursor:"pointer"}:void 0,onClick:k?()=>k(ae.name,y+re,G):void 0,children:n.jsx("title",{children:`${ae.name}: ${G}`})},re)})},ae.name);const W=ae.data.map((G,re)=>`${q(re)},${H(G)}`);return n.jsxs("g",{children:[X==="area"&&n.jsx("polygon",{points:`${q(0)},${H(0)} ${W.join(" ")} ${q(z-1)},${H(0)}`,fill:Y,opacity:.15}),n.jsx("polyline",{points:W.join(" "),fill:"none",stroke:Y,strokeWidth:2}),ae.data.map((G,re)=>n.jsx("circle",{cx:q(re),cy:H(G),r:3,fill:Y,style:k?{cursor:"pointer"}:void 0,onClick:k?()=>k(ae.name,y+re,G):void 0,children:n.jsx("title",{children:`${ae.name}: ${G}`})},re))]},ae.name)})]}),s&&n.jsx("g",{transform:`translate(${x.left}, ${i})`,children:e.map((ae,he)=>{const Y=he*120,X=v.has(ae.name);return n.jsxs("g",{transform:`translate(${Y}, 10)`,style:m?{cursor:"pointer"}:void 0,onClick:()=>N(ae.name),opacity:X?.35:1,children:[n.jsx("rect",{width:12,height:12,rx:2,fill:ae.color||Wt[he%Wt.length]}),n.jsx("text",{x:16,y:10,className:"nice-chart__legend-text",style:X?{textDecoration:"line-through"}:void 0,children:ae.name})]},ae.name)})})]})]})},Yc=Object.freeze(Object.defineProperty({__proto__:null,NiceChart:Lt},Symbol.toStringTag,{value:"Module"}));function Zc(e){if(!e.length)return{categories:[],numericFields:[],sampleValues:{}};const t=e[0],a=[],i={};let r=null;for(const[s,l]of Object.entries(t))typeof l=="number"?(a.push(s),i[s]=e.map(c=>Number(c[s])||0)):!r&&(typeof l=="string"||l instanceof Date)&&(r=s);return{categories:r?e.map(s=>String(s[r]||"")):e.map((s,l)=>`Item ${l+1}`),numericFields:a,sampleValues:i}}function Gc(e,t){const{categories:a,numericFields:i,sampleValues:r}=Zc(e);return{series:i.map((s,l)=>({name:s.replace(/([A-Z])/g," $1").replace(/^./,c=>c.toUpperCase()).trim(),data:r[s],type:t==="area"?"area":t==="line"?"line":"bar"})),categories:a}}o.forwardRef(function(e,t){const{rawData:a,enableAI:i=!0,aiModel:r,enableAutoType:s=!0,enableInsights:l=!0,dataDescription:c,onChartSuggestion:d,onInsights:u,showAIToolbar:g=!0,showInsightsOnLoad:h=!1,series:p,categories:m,...k}=e,[b,C]=o.useState("bar"),[_,f]=o.useState(null),[v,j]=o.useState([]),[S,I]=o.useState(h),[M,w]=o.useState(null),{t:E}=Bt(),P=et(),{suggestChartType:L,generateInsights:A,isLoading:N}=Zo(),x=i&&P.isConfigured,{series:O,categories:D}=a?Gc(a,M||b):{series:p||[],categories:m},F=o.useCallback(async()=>{if(!x||!s)return{type:"bar",reason:"Default",config:{}};const T=a||(p!=null&&p.length?p.flatMap(B=>B.data.map((V,K)=>({[B.name]:V,index:K}))):[]);try{const B=await L(T,c),V={type:B.type,reason:B.reason,config:B.config};return f(V),C(V.type),d==null||d(V),V}catch{return{type:"bar",reason:"Default fallback",config:{}}}},[x,s,a,p,c,L,d]),y=o.useCallback(async()=>{if(!x||!l)return[];const T=a||(p!=null&&p.length?p.flatMap(B=>B.data.map((V,K)=>({[B.name]:V,category:(m==null?void 0:m[K])||K}))):[]);try{const B=await A(T,M||b);return j(B),u==null||u(B),B}catch{return[]}},[x,l,a,p,m,b,M,A,u]),$=o.useCallback(()=>M||b,[M,b]);o.useEffect(()=>{x&&s&&(a!=null&&a.length||p!=null&&p.length)&&F()},[x,s,a,p]),o.useImperativeHandle(t,()=>({getSuggestion:F,generateInsights:y,getCurrentType:$}));const z=[{type:"bar",icon:"📊",label:"Bar"},{type:"line",icon:"📈",label:"Line"},{type:"area",icon:"🏔️",label:"Area"},{type:"pie",icon:"🥧",label:"Pie"},{type:"donut",icon:"🍩",label:"Donut"},{type:"scatter",icon:"⭐",label:"Scatter"}],R=M||b;return n.jsxs("div",{className:"nice-chart-ai","data-testid":e["data-testid"],children:[g&&x&&n.jsxs("div",{className:"nice-chart-ai__toolbar",children:[n.jsxs("div",{className:"nice-chart-ai__toolbar-left",children:[n.jsx("span",{className:"nice-chart-ai__badge",children:"AI"}),_&&n.jsxs("div",{className:"nice-chart-ai__suggestion",children:[n.jsx("span",{className:"nice-chart-ai__suggestion-icon",children:"💡"}),n.jsxs("span",{className:"nice-chart-ai__suggestion-text",children:[E("chartAI.suggestedType","Suggested:")," ",_.type]}),n.jsxs("span",{className:"nice-chart-ai__suggestion-reason",title:_.reason,children:["(",_.reason,")"]})]}),N&&n.jsx("span",{className:"nice-chart-ai__loading",children:E("chartAI.analyzing","Analyzing...")})]}),n.jsx("div",{className:"nice-chart-ai__toolbar-center",children:n.jsx("div",{className:"nice-chart-ai__type-selector",children:z.filter(T=>["bar","line","area"].includes(T.type)).map(({type:T,icon:B,label:V})=>n.jsx("button",{type:"button",className:`nice-chart-ai__type-btn ${R===T?"nice-chart-ai__type-btn--active":""}`,onClick:()=>w(T),title:V,children:B},T))})}),n.jsxs("div",{className:"nice-chart-ai__toolbar-right",children:[n.jsxs("button",{type:"button",className:"nice-chart-ai__auto-btn",onClick:()=>F(),disabled:N,title:E("chartAI.autoDetect","Auto-detect best chart type"),children:["🔮 ",E("chartAI.auto","Auto")]}),l&&n.jsxs("button",{type:"button",className:"nice-chart-ai__insights-btn",onClick:()=>{v.length||y(),I(!S)},disabled:N,title:E("chartAI.showInsights","Show data insights"),children:["💡 ",E("chartAI.insights","Insights")]})]})]}),n.jsx("div",{className:"nice-chart-ai__chart-wrapper",children:n.jsx(Lt,{series:O,categories:D,...k})}),S&&v.length>0&&n.jsxs("div",{className:"nice-chart-ai__insights",children:[n.jsxs("div",{className:"nice-chart-ai__insights-header",children:[n.jsxs("h4",{children:["💡 ",E("chartAI.dataInsights","Data Insights")]}),n.jsx("button",{type:"button",className:"nice-chart-ai__insights-close",onClick:()=>I(!1),children:"✕"})]}),n.jsx("ul",{className:"nice-chart-ai__insights-list",children:v.map((T,B)=>n.jsxs("li",{className:"nice-chart-ai__insight",children:[n.jsx("span",{className:"nice-chart-ai__insight-icon",children:"•"}),T]},B))}),n.jsx("div",{className:"nice-chart-ai__insights-footer",children:n.jsxs("button",{type:"button",className:"nice-chart-ai__refresh",onClick:()=>y(),disabled:N,children:["🔄 ",E("chartAI.refresh","Refresh")]})})]}),S&&N&&n.jsx("div",{className:"nice-chart-ai__insights nice-chart-ai__insights--loading",children:n.jsxs("div",{className:"nice-chart-ai__loading-content",children:[n.jsx("span",{className:"nice-chart-ai__spinner"}),E("chartAI.generatingInsights","Generating insights...")]})})]})});function Xc(e,t){const a=e?typeof e=="number"?new Date(e):new Date(e):new Date,i=d=>d.toString().padStart(2,"0"),r=i(a.getHours()),s=i(a.getMinutes()),l=i(a.getSeconds()),c=a.getMilliseconds().toString().padStart(3,"0");switch(t){case"HH:mm:ss":return`${r}:${s}:${l}`;case"HH:mm":return`${r}:${s}`;case"mm:ss":return`${s}:${l}`;case"ss.SSS":return`${l}.${c}`;case"ISO":return a.toISOString();default:return`${r}:${s}:${l}`}}function ka(e){if(e.length===0)return null;const t=Math.min(...e),a=Math.max(...e),i=e.reduce((s,l)=>s+l,0)/e.length,r=e[e.length-1];return{min:t,max:a,avg:i,current:r,count:e.length}}const ci=o.forwardRef(({series:e,maxPoints:t=100,slidingWindow:a=!0,refreshRate:i=16,dataSource:r,width:s=600,height:l=400,title:c,showLegend:d=!0,showGrid:u=!0,yAxisLabel:g,xAxisLabel:h,stacked:p,zoomable:m,crosshair:k,annotations:b=[],legendInteractive:C,onDataPointClick:_,exportable:f,showControls:v=!0,showStatus:j=!0,initialPaused:S=!1,onDataReceived:I,onDataDropped:M,timeFormat:w="HH:mm:ss",showStats:E,thresholds:P=[],className:L,style:A},N)=>{const[x,O]=o.useState(()=>{var ie;const ee=new Map;for(const pe of e)ee.set(pe.name,((ie=pe.initialData)==null?void 0:ie.slice())??[]);return ee}),[D,F]=o.useState([]),[y,$]=o.useState(S),[z,R]=o.useState(!1),T=o.useRef([]),B=o.useRef(Date.now()),V=o.useRef(null),K=o.useCallback(()=>{const ee=T.current;ee.length!==0&&(T.current=[],O(ie=>{const pe=new Map(ie);for(const te of ee){const ue=pe.get(te.series);if(!ue)continue;const fe=[...ue,te.value];if(a&&fe.length>t){const ae=fe.length-t;M==null||M(ae,te.series),fe.splice(0,ae)}pe.set(te.series,fe)}return pe}),ee.length>0&&F(ie=>{const pe=[...ie];for(const te of ee){const ue=te.category??Xc(te.timestamp,w);pe.push(ue)}return a&&pe.length>t&&pe.splice(0,pe.length-t),pe}))},[a,t,w,M]),H=o.useCallback(()=>{const ee=Date.now();ee-B.current>=i&&(K(),B.current=ee),V.current=requestAnimationFrame(H)},[i,K]);o.useEffect(()=>(y||(V.current=requestAnimationFrame(H)),()=>{V.current!==null&&(cancelAnimationFrame(V.current),V.current=null)}),[y,H]);const q=o.useCallback(ee=>{if(y)return;const ie="points"in ee?ee.points:[ee];for(const pe of ie)x.has(pe.series)&&(T.current.push(pe),I==null||I(pe))},[y,x,I]);o.useEffect(()=>{if(!r)return;const ee=r.subscribe(q);let ie;return r.onStatusChange?ie=r.onStatusChange(R):R(!0),r.fetchHistory&&r.fetchHistory(t).then(pe=>{for(const te of pe)T.current.push(te);K()}),()=>{ee(),ie==null||ie()}},[r,q,t,K]);const Z=o.useMemo(()=>e.map(ee=>({name:ee.name,color:ee.color,type:ee.type,data:x.get(ee.name)??[]})),[e,x]),Q=o.useMemo(()=>{const ee=[...b];for(const ie of P)ee.push({type:"line",value:ie.value,color:ie.color,label:ie.label,dash:ie.style==="dashed"?"5,5":ie.style==="dotted"?"2,2":void 0});return ee},[b,P]);o.useImperativeHandle(N,()=>({pause(){$(!0)},resume(){$(!1)},isPaused(){return y},clear(){O(ee=>{const ie=new Map(ee);for(const pe of ie.keys())ie.set(pe,[]);return ie}),F([]),T.current=[]},addPoint(ee){q(ee)},addPoints(ee){q({points:ee})},getData(ee){return x.get(ee)??[]},getCategories(){return D},exportData(){return{series:Z,categories:D}},getStats(ee){const ie=x.get(ee);return ie?ka(ie):null}}),[y,x,D,Z,q]);const J=o.useMemo(()=>{if(!E)return null;const ee={};for(const[ie,pe]of x)ee[ie]=ka(pe);return ee},[E,x]);return n.jsxs("div",{className:L,style:{position:"relative",...A},children:[j&&n.jsxs("div",{style:{position:"absolute",top:8,right:8,display:"flex",alignItems:"center",gap:4,fontSize:12,color:z?"#22c55e":"#ef4444",zIndex:10},children:[n.jsx("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:z?"#22c55e":"#ef4444"}}),z?"Live":"Disconnected"]}),v&&n.jsx("div",{style:{position:"absolute",top:8,left:8,display:"flex",gap:4,zIndex:10},children:n.jsx("button",{onClick:()=>$(ee=>!ee),style:{padding:"4px 8px",fontSize:12,border:"1px solid #ddd",borderRadius:4,background:y?"#fef3c7":"#fff",cursor:"pointer"},title:y?"Resume":"Pause",children:y?"▶":"⏸"})}),E&&J&&n.jsx("div",{style:{position:"absolute",bottom:50,right:8,background:"rgba(255,255,255,0.9)",border:"1px solid #ddd",borderRadius:4,padding:8,fontSize:11,zIndex:10},children:Object.entries(J).map(([ee,ie])=>ie?n.jsxs("div",{style:{marginBottom:4},children:[n.jsx("strong",{children:ee}),n.jsxs("div",{children:["Min: ",ie.min.toFixed(2)," | Max: ",ie.max.toFixed(2)]}),n.jsxs("div",{children:["Avg: ",ie.avg.toFixed(2)," | Now: ",ie.current.toFixed(2)]})]},ee):null)}),n.jsx(Lt,{series:Z,categories:D,width:s,height:l,title:c,showLegend:d,showGrid:u,yAxisLabel:g,xAxisLabel:h,stacked:p,zoomable:m,crosshair:k,annotations:Q,legendInteractive:C,onDataPointClick:_,exportable:f})]})});ci.displayName="NiceLiveChart";const Le=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#06b6d4","#84cc16"],di=({data:e,width:t=400,height:a=400,innerRadius:i=0,title:r,showLegend:s=!0,showLabels:l=!0,className:c,style:d})=>{const u=t/2,g=(a-(s?30:0))/2+(r?10:0),h=Math.min(u,g)-40,p=e.reduce((b,C)=>b+C.value,0);let m=-Math.PI/2;const k=e.map((b,C)=>{const _=b.value/(p||1)*Math.PI*2,f=m;m+=_;const v=m,j=(f+v)/2,S=u+h*Math.cos(f),I=g+h*Math.sin(f),M=u+h*Math.cos(v),w=g+h*Math.sin(v),E=_>Math.PI?1:0,P=b.color||Le[C%Le.length];let L;if(i>0){const O=u+i*Math.cos(f),D=g+i*Math.sin(f),F=u+i*Math.cos(v),y=g+i*Math.sin(v);L=`M${S},${I} A${h},${h} 0 ${E},1 ${M},${w} L${F},${y} A${i},${i} 0 ${E},0 ${O},${D} Z`}else L=`M${u},${g} L${S},${I} A${h},${h} 0 ${E},1 ${M},${w} Z`;const A=u+h*.7*Math.cos(j),N=g+h*.7*Math.sin(j),x=p>0?Math.round(b.value/p*100):0;return{...b,path:L,labelX:A,labelY:N,pct:x,color:P}});return n.jsx("div",{className:`nice-piechart ${c||""}`,style:d,children:n.jsxs("svg",{width:t,height:a,className:"nice-piechart__svg",children:[r&&n.jsx("text",{x:u,y:20,textAnchor:"middle",className:"nice-chart__title",children:r}),k.map((b,C)=>n.jsxs("g",{children:[n.jsx("path",{d:b.path,fill:b.color,stroke:"var(--bg-primary, #fff)",strokeWidth:2,children:n.jsx("title",{children:`${b.label}: ${b.value} (${b.pct}%)`})}),l&&b.pct>=5&&n.jsxs("text",{x:b.labelX,y:b.labelY,textAnchor:"middle",dominantBaseline:"middle",className:"nice-piechart__label",children:[b.pct,"%"]})]},C)),s&&n.jsx("g",{transform:`translate(10, ${a-25})`,children:e.map((b,C)=>n.jsxs("g",{transform:`translate(${C*100}, 0)`,children:[n.jsx("rect",{width:10,height:10,rx:2,fill:b.color||Le[C%Le.length]}),n.jsx("text",{x:14,y:9,className:"nice-chart__legend-text",children:b.label})]},C))})]})})},ui=({series:e,categories:t,width:a=400,height:i=400,maxValue:r,title:s,showLegend:l=!0,className:c,style:d})=>{const u=a/2,g=(i-(l?30:0))/2+(s?10:0),h=Math.min(u,g)-40,p=t.length,m=r??Math.max(...e.flatMap(_=>_.data),1),k=Math.PI*2/p,b=5,C=(_,f)=>{const v=_*k-Math.PI/2,j=f/m*h;return{x:u+j*Math.cos(v),y:g+j*Math.sin(v)}};return n.jsx("div",{className:`nice-polarchart ${c||""}`,style:d,children:n.jsxs("svg",{width:a,height:i,className:"nice-polarchart__svg",children:[s&&n.jsx("text",{x:u,y:20,textAnchor:"middle",className:"nice-chart__title",children:s}),Array.from({length:b},(_,f)=>{const v=h*((f+1)/b);return n.jsx("circle",{cx:u,cy:g,r:v,fill:"none",stroke:"var(--border-color, #ddd)",strokeWidth:.5},f)}),t.map((_,f)=>{const v=C(f,m),j=C(f,m*1.12);return n.jsxs("g",{children:[n.jsx("line",{x1:u,y1:g,x2:v.x,y2:v.y,stroke:"var(--border-color, #ddd)",strokeWidth:.5}),n.jsx("text",{x:j.x,y:j.y,textAnchor:"middle",dominantBaseline:"middle",className:"nice-chart__axis-label",children:_})]},f)}),e.map((_,f)=>{const v=_.color||Le[f%Le.length],j=_.data.map((S,I)=>{const M=C(I,S);return`${M.x},${M.y}`}).join(" ");return n.jsxs("g",{children:[n.jsx("polygon",{points:j,fill:_.fill!==!1?v:"none",fillOpacity:.15,stroke:v,strokeWidth:2}),_.data.map((S,I)=>{const M=C(I,S);return n.jsx("circle",{cx:M.x,cy:M.y,r:3,fill:v,children:n.jsx("title",{children:`${_.name} - ${t[I]}: ${S}`})},I)})]},_.name)}),l&&n.jsx("g",{transform:`translate(10, ${i-25})`,children:e.map((_,f)=>n.jsxs("g",{transform:`translate(${f*100}, 0)`,children:[n.jsx("rect",{width:10,height:10,rx:2,fill:_.color||Le[f%Le.length]}),n.jsx("text",{x:14,y:9,className:"nice-chart__legend-text",children:_.name})]},f))})]})})},pi=({value:e,min:t=0,max:a=100,width:i=200,height:r=200,startAngle:s=225,endAngle:l=-45,color:c="#3b82f6",trackColor:d,label:u,formatValue:g,ranges:h,className:p,style:m})=>{const k=i/2,b=r/2,C=Math.min(k,b)-20,_=Math.max(0,Math.min(1,(e-t)/(a-t||1))),f=E=>E*Math.PI/180,v=(s-l+360)%360||360,j=E=>({x:k+C*Math.cos(f(E)),y:b-C*Math.sin(f(E))}),S=(E,P)=>{const L=j(E),A=j(P),N=(E-P+360)%360>180?1:0;return`M${L.x},${L.y} A${C},${C} 0 ${N},1 ${A.x},${A.y}`},I=s-_*v,M=j(I);let w=c;if(h){for(const E of h)if(e>=E.start&&e<=E.end){w=E.color;break}}return n.jsx("div",{className:`nice-gauge nice-gauge--circular ${p||""}`,style:m,children:n.jsxs("svg",{width:i,height:r,children:[n.jsx("path",{d:S(s,l),fill:"none",stroke:d||"var(--border-color, #e2e8f0)",strokeWidth:12,strokeLinecap:"round"}),_>0&&n.jsx("path",{d:S(s,I),fill:"none",stroke:w,strokeWidth:12,strokeLinecap:"round"}),n.jsx("line",{x1:k,y1:b,x2:M.x,y2:M.y,stroke:"var(--text-primary, #333)",strokeWidth:2,strokeLinecap:"round"}),n.jsx("circle",{cx:k,cy:b,r:4,fill:"var(--text-primary, #333)"}),n.jsx("text",{x:k,y:b+C*.35,textAnchor:"middle",className:"nice-gauge__value",children:g?g(e):e}),u&&n.jsx("text",{x:k,y:b+C*.55,textAnchor:"middle",className:"nice-gauge__label",children:u})]})})},mi=({value:e,min:t=0,max:a=100,width:i=300,height:r=60,orientation:s="horizontal",color:l="#3b82f6",label:c,formatValue:d,ranges:u,showTicks:g=!0,tickCount:h=5,className:p,style:m})=>{const k=s==="horizontal",b=k?i-40:r-40,C=Math.max(0,Math.min(1,(e-t)/(a-t||1))),_=10;let f=l;if(u){for(const j of u)if(e>=j.start&&e<=j.end){f=j.color;break}}const v=Array.from({length:h},(j,S)=>t+(a-t)*(S/(h-1)));return k?n.jsx("div",{className:`nice-gauge nice-gauge--linear ${p||""}`,style:m,children:n.jsxs("svg",{width:i,height:r,children:[c&&n.jsx("text",{x:i/2,y:14,textAnchor:"middle",className:"nice-gauge__label",children:c}),n.jsx("rect",{x:20,y:r/2-_/2,width:b,height:_,rx:5,fill:"var(--border-color, #e2e8f0)"}),n.jsx("rect",{x:20,y:r/2-_/2,width:b*C,height:_,rx:5,fill:f}),n.jsx("polygon",{points:`${20+b*C},${r/2-_/2-2} ${20+b*C-5},${r/2-_/2-10} ${20+b*C+5},${r/2-_/2-10}`,fill:"var(--text-primary, #333)"}),n.jsx("text",{x:20+b*C,y:r/2-_/2-12,textAnchor:"middle",className:"nice-gauge__value",style:{fontSize:11},children:d?d(e):e}),g&&v.map((j,S)=>{const I=20+(j-t)/(a-t)*b;return n.jsx("text",{x:I,y:r/2+_/2+14,textAnchor:"middle",className:"nice-gauge__tick",children:j},S)})]})}):n.jsx("div",{className:`nice-gauge nice-gauge--linear nice-gauge--vertical ${p||""}`,style:m,children:n.jsxs("svg",{width:i,height:r,children:[n.jsx("rect",{x:i/2-_/2,y:20,width:_,height:b,rx:5,fill:"var(--border-color, #e2e8f0)"}),n.jsx("rect",{x:i/2-_/2,y:20+b*(1-C),width:_,height:b*C,rx:5,fill:f}),n.jsx("text",{x:i/2,y:14,textAnchor:"middle",className:"nice-gauge__value",children:d?d(e):e}),c&&n.jsx("text",{x:i/2,y:r-4,textAnchor:"middle",className:"nice-gauge__label",children:c})]})})},hi=({items:e,min:t=0,max:a=100,width:i=300,height:r=300,startAngle:s=225,endAngle:l=-45,formatValue:c,title:d,className:u,style:g})=>{const h=i/2,p=r/2,m=Math.min(h,p)-30,k=Math.min(20,m/(e.length+1)),b=4,C=v=>v*Math.PI/180,_=(s-l+360)%360||360,f=(v,j,S)=>{const I=h+v*Math.cos(C(j)),M=p-v*Math.sin(C(j)),w=h+v*Math.cos(C(S)),E=p-v*Math.sin(C(S)),P=(j-S+360)%360;return`M${I},${M} A${v},${v} 0 ${P>180?1:0},1 ${w},${E}`};return n.jsx("div",{className:`nice-bargauge ${u||""}`,style:g,children:n.jsxs("svg",{width:i,height:r,children:[d&&n.jsx("text",{x:h,y:20,textAnchor:"middle",className:"nice-chart__title",children:d}),e.map((v,j)=>{const S=m-j*(k+b),I=Math.max(0,Math.min(1,(v.value-t)/(a-t||1))),M=s-I*_,w=v.color||Le[j%Le.length];return n.jsxs("g",{children:[n.jsx("path",{d:f(S,s,l),fill:"none",stroke:"var(--border-color, #e2e8f0)",strokeWidth:k,strokeLinecap:"round"}),I>0&&n.jsx("path",{d:f(S,s,M),fill:"none",stroke:w,strokeWidth:k,strokeLinecap:"round"})]},j)}),n.jsx("g",{children:e.map((v,j)=>n.jsxs("text",{x:h,y:p-((e.length-1)/2-j)*16,textAnchor:"middle",dominantBaseline:"middle",className:"nice-gauge__value",style:{fontSize:12},children:[v.label?`${v.label}: `:"",c?c(v.value):v.value]},j))})]})})},fi=({data:e,width:t=120,height:a=30,type:i="line",color:r="#3b82f6",showMinMax:s,showLastPoint:l=!0,className:c,style:d})=>{if(e.length===0)return null;const u=2,g=Math.min(...e),h=Math.max(...e),p=h-g||1,m=t-u*2,k=a-u*2,b=S=>u+S/(e.length-1||1)*m,C=S=>u+k-(S-g)/p*k;if(i==="bar"){const S=Math.max(1,m/e.length-1);return n.jsx("svg",{width:t,height:a,className:`nice-sparkline ${c||""}`,style:d,children:e.map((I,M)=>n.jsx("rect",{x:u+M/e.length*m,y:C(I),width:S,height:k-(C(I)-u),fill:r,rx:1},M))})}const _=e.map((S,I)=>`${b(I)},${C(S)}`).join(" "),f=e.indexOf(g),v=e.indexOf(h),j=e.length-1;return n.jsxs("svg",{width:t,height:a,className:`nice-sparkline ${c||""}`,style:d,children:[i==="area"&&n.jsx("polygon",{points:`${b(0)},${u+k} ${_} ${b(j)},${u+k}`,fill:r,opacity:.15}),n.jsx("polyline",{points:_,fill:"none",stroke:r,strokeWidth:1.5}),s&&n.jsx("circle",{cx:b(f),cy:C(g),r:2,fill:"#ef4444"}),s&&n.jsx("circle",{cx:b(v),cy:C(h),r:2,fill:"#22c55e"}),l&&n.jsx("circle",{cx:b(j),cy:C(e[j]),r:2,fill:r})]})},gi=({value:e,target:t,min:a=0,max:i=100,width:r=200,height:s=30,color:l="#3b82f6",targetColor:c="#ef4444",className:d,style:u})=>{const g=r-8,h=s-8,p=Math.max(0,Math.min(1,(e-a)/(i-a||1))),m=t!=null?Math.max(0,Math.min(1,(t-a)/(i-a||1))):null;return n.jsxs("svg",{width:r,height:s,className:`nice-bullet ${d||""}`,style:u,children:[n.jsx("rect",{x:4,y:4,width:g,height:h,rx:3,fill:"var(--border-color, #e2e8f0)"}),n.jsx("rect",{x:4,y:4+h*.2,width:g*p,height:h*.6,rx:2,fill:l}),m!=null&&n.jsx("line",{x1:4+g*m,y1:6,x2:4+g*m,y2:4+h-2,stroke:c,strokeWidth:2})]})},yi=({data:e,width:t=400,height:a=300,inverted:i,showLabels:r=!0,showValues:s=!0,title:l,className:c,style:d})=>{const u={top:l?30:10,bottom:10,x:40},g=t-u.x*2,h=a-u.top-u.bottom,p=i?[...e].reverse():e,m=Math.max(...p.map(b=>b.value),1),k=h/p.length;return n.jsx("div",{className:`nice-funnel ${c||""}`,style:d,children:n.jsxs("svg",{width:t,height:a,children:[l&&n.jsx("text",{x:t/2,y:20,textAnchor:"middle",className:"nice-chart__title",children:l}),p.map((b,C)=>{const _=b.value/m*g,f=C<p.length-1?p[C+1].value/m*g:_*.3,v=u.top+C*k,j=v+k,S=t/2,I=`${S-_/2},${v} ${S+_/2},${v} ${S+f/2},${j} ${S-f/2},${j}`,M=b.color||Le[C%Le.length];return n.jsxs("g",{children:[n.jsx("polygon",{points:I,fill:M,stroke:"var(--bg-primary, #fff)",strokeWidth:1,children:n.jsx("title",{children:`${b.label}: ${b.value}`})}),r&&n.jsx("text",{x:S,y:v+k/2-(s?4:0),textAnchor:"middle",dominantBaseline:"middle",className:"nice-funnel__label",children:b.label}),s&&n.jsx("text",{x:S,y:v+k/2+10,textAnchor:"middle",dominantBaseline:"middle",className:"nice-funnel__value",children:b.value})]},C)})]})})},En=({nodes:e,links:t,width:a=600,height:i=400,nodeWidth:r=20,nodePadding:s=10,title:l,className:c,style:d})=>{const u={top:l?40:20,bottom:20,left:20,right:20},g=a-u.left-u.right,h=i-u.top-u.bottom,p=new Set(t.map(E=>E.source)),m=new Set(t.map(E=>E.target)),k=e.filter(E=>p.has(E.id)&&!m.has(E.id)),b=e.filter(E=>m.has(E.id)),C=e.filter(E=>p.has(E.id)&&m.has(E.id)),_=[k,...C.length?[C]:[],b].filter(E=>E.length>0),f=_.length,v=new Map;e.forEach(E=>{const P=t.filter(A=>A.source===E.id).reduce((A,N)=>A+N.value,0),L=t.filter(A=>A.target===E.id).reduce((A,N)=>A+N.value,0);v.set(E.id,Math.max(P,L))});const j=_.map(E=>E.reduce((P,L)=>P+(v.get(L.id)||0),0)+(E.length-1)*s),S=Math.max(...j,1),I=new Map;_.forEach((E,P)=>{const L=u.left+P/(f-1||1)*(g-r);let A=0;E.forEach(N=>{const x=(v.get(N.id)||0)/S*h;I.set(N.id,{x:L,y:u.top+A,h:x}),A+=x+s})});const M=new Map,w=new Map;return e.forEach(E=>{M.set(E.id,0),w.set(E.id,0)}),n.jsx("div",{className:`nice-sankey ${c||""}`,style:d,children:n.jsxs("svg",{width:a,height:i,children:[l&&n.jsx("text",{x:a/2,y:20,textAnchor:"middle",className:"nice-chart__title",children:l}),t.map((E,P)=>{var T;const L=I.get(E.source),A=I.get(E.target);if(!L||!A)return null;const N=M.get(E.source)||0,x=w.get(E.target)||0,O=E.value/S*h;M.set(E.source,N+O),w.set(E.target,x+O);const D=L.x+r,F=L.y+N,y=A.x,$=A.y+x,z=(D+y)/2,R=((T=e.find(B=>B.id===E.source))==null?void 0:T.color)||Le[P%Le.length];return n.jsx("path",{d:`M${D},${F} C${z},${F} ${z},${$} ${y},${$} L${y},${$+O} C${z},${$+O} ${z},${F+O} ${D},${F+O} Z`,fill:R,fillOpacity:.3,stroke:R,strokeOpacity:.5,strokeWidth:.5,children:n.jsx("title",{children:`${E.source} → ${E.target}: ${E.value}`})},P)}),e.map((E,P)=>{const L=I.get(E.id);if(!L)return null;const A=E.color||Le[P%Le.length];return n.jsxs("g",{children:[n.jsx("rect",{x:L.x,y:L.y,width:r,height:Math.max(L.h,2),fill:A,rx:2}),n.jsx("text",{x:L.x<g/2?L.x+r+4:L.x-4,y:L.y+L.h/2,textAnchor:L.x<g/2?"start":"end",dominantBaseline:"middle",className:"nice-chart__legend-text",children:E.label})]},E.id)})]})})},Qc=Object.freeze(Object.defineProperty({__proto__:null,NiceSankey:En},Symbol.toStringTag,{value:"Module"})),bi=({data:e,min:t,max:a,start:i,end:r,onChange:s,width:l=500,height:c=100,step:d=1,formatValue:u,chartColor:g="#3b82f6",className:h,style:p})=>{const m={top:10,bottom:30,left:10,right:10},k=l-m.left-m.right,b=c-m.top-m.bottom,C=S=>m.left+(S-t)/(a-t||1)*k,_=S=>{const I=Math.max(0,Math.min(1,(S-m.left)/k)),M=t+I*(a-t);return Math.round(M/d)*d},f=(S,I)=>{I.preventDefault();const M=I.target.closest("svg");if(!M)return;const w=P=>{const L=M.getBoundingClientRect(),A=_(P.clientX-L.left);S==="start"?s(Math.min(A,r),r):s(i,Math.max(A,i))},E=()=>{document.removeEventListener("pointermove",w),document.removeEventListener("pointerup",E)};document.addEventListener("pointermove",w),document.addEventListener("pointerup",E)},v=e?Math.min(...e):0,j=(e?Math.max(...e):1)-v||1;return n.jsx("div",{className:`nice-rangeselector ${h||""}`,style:p,children:n.jsxs("svg",{width:l,height:c,children:[e&&e.length>1&&n.jsx("polygon",{points:`${m.left},${m.top+b} ${e.map((S,I)=>`${m.left+I/(e.length-1)*k},${m.top+b-(S-v)/j*b}`).join(" ")} ${m.left+k},${m.top+b}`,fill:g,opacity:.15}),n.jsx("rect",{x:C(i),y:m.top,width:C(r)-C(i),height:b,fill:g,opacity:.1}),n.jsx("rect",{x:m.left,y:m.top,width:C(i)-m.left,height:b,fill:"var(--bg-secondary, #f5f5f5)",opacity:.6}),n.jsx("rect",{x:C(r),y:m.top,width:m.left+k-C(r),height:b,fill:"var(--bg-secondary, #f5f5f5)",opacity:.6}),n.jsx("rect",{x:C(i)-4,y:m.top,width:8,height:b,fill:g,rx:2,cursor:"ew-resize",onPointerDown:S=>f("start",S)}),n.jsx("rect",{x:C(r)-4,y:m.top,width:8,height:b,fill:g,rx:2,cursor:"ew-resize",onPointerDown:S=>f("end",S)}),n.jsx("text",{x:C(i),y:m.top+b+18,textAnchor:"middle",className:"nice-chart__axis-label",children:u?u(i):i}),n.jsx("text",{x:C(r),y:m.top+b+18,textAnchor:"middle",className:"nice-chart__axis-label",children:u?u(r):r})]})})},zn=({regions:e,width:t=600,height:a=400,viewBox:i="0 0 1000 600",colorRange:r=["#dbeafe","#1d4ed8"],maxValue:s,onRegionClick:l,selectedRegionId:c,title:d,showTooltip:u=!0,className:g,style:h})=>{const p=s??Math.max(...e.map(k=>k.value??0),1),m=k=>{const b=E=>[parseInt(E.slice(1,3),16),parseInt(E.slice(3,5),16),parseInt(E.slice(5,7),16)],[C,_,f]=b(r[0]),[v,j,S]=b(r[1]),I=Math.round(C+(v-C)*k),M=Math.round(_+(j-_)*k),w=Math.round(f+(S-f)*k);return`rgb(${I},${M},${w})`};return n.jsxs("div",{className:`nice-vectormap ${g||""}`,style:h,children:[d&&n.jsx("div",{className:"nice-vectormap__title",children:d}),n.jsx("svg",{width:t,height:a,viewBox:i,children:e.map(k=>{const b=k.value!=null?Math.max(0,Math.min(1,k.value/p)):0,C=k.value!=null?m(b):"var(--bg-tertiary, #e5e7eb)",_=k.id===c;return n.jsx("path",{d:k.path,fill:C,stroke:_?"var(--color-primary, #3b82f6)":"var(--border-color, #d1d5db)",strokeWidth:_?2:.5,cursor:l?"pointer":void 0,onClick:()=>l==null?void 0:l(k),children:u&&n.jsx("title",{children:`${k.name}${k.value!=null?`: ${k.value}`:""}`})},k.id)})})]})},Jc=Object.freeze(Object.defineProperty({__proto__:null,NiceVectorMap:zn},Symbol.toStringTag,{value:"Module"})),ed=`
82
+ .nice-forecast-chart {
83
+ display: flex;
84
+ flex-direction: column;
85
+ background: var(--nice-bg-primary, #ffffff);
86
+ border: 1px solid var(--nice-border-color, #e5e7eb);
87
+ border-radius: 0.5rem;
88
+ overflow: hidden;
89
+ }
90
+
91
+ .nice-forecast-chart__header {
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: space-between;
95
+ padding: 0.75rem 1rem;
96
+ border-bottom: 1px solid var(--nice-border-color, #e5e7eb);
97
+ }
98
+
99
+ .nice-forecast-chart__title {
100
+ font-size: 1rem;
101
+ font-weight: 600;
102
+ color: var(--nice-text-primary);
103
+ margin: 0;
104
+ }
105
+
106
+ .nice-forecast-chart__actions {
107
+ display: flex;
108
+ gap: 0.5rem;
109
+ }
110
+
111
+ .nice-forecast-chart__btn {
112
+ display: inline-flex;
113
+ align-items: center;
114
+ justify-content: center;
115
+ width: 2rem;
116
+ height: 2rem;
117
+ font-size: 1rem;
118
+ border-radius: 0.375rem;
119
+ cursor: pointer;
120
+ transition: all 0.15s ease;
121
+ border: 1px solid var(--nice-border-color, #d1d5db);
122
+ background: var(--nice-bg-primary, #ffffff);
123
+ color: var(--nice-text-secondary);
124
+ }
125
+
126
+ .nice-forecast-chart__btn:hover {
127
+ background: var(--nice-bg-hover, #f3f4f6);
128
+ color: var(--nice-text-primary);
129
+ }
130
+
131
+ .nice-forecast-chart__btn:disabled {
132
+ opacity: 0.5;
133
+ cursor: not-allowed;
134
+ }
135
+
136
+ .nice-forecast-chart__container {
137
+ position: relative;
138
+ width: 100%;
139
+ padding: 1rem;
140
+ }
141
+
142
+ .nice-forecast-chart__svg {
143
+ width: 100%;
144
+ overflow: visible;
145
+ }
146
+
147
+ .nice-forecast-chart__grid-line {
148
+ stroke: var(--nice-border-divider, #f3f4f6);
149
+ stroke-width: 1;
150
+ }
151
+
152
+ .nice-forecast-chart__axis-line {
153
+ stroke: var(--nice-border-color, #e5e7eb);
154
+ stroke-width: 1;
155
+ }
156
+
157
+ .nice-forecast-chart__axis-label {
158
+ font-size: 0.6875rem;
159
+ fill: var(--nice-text-secondary);
160
+ }
161
+
162
+ .nice-forecast-chart__axis-title {
163
+ font-size: 0.75rem;
164
+ font-weight: 500;
165
+ fill: var(--nice-text-primary);
166
+ }
167
+
168
+ .nice-forecast-chart__historical-line {
169
+ fill: none;
170
+ stroke-width: 2;
171
+ stroke-linecap: round;
172
+ stroke-linejoin: round;
173
+ }
174
+
175
+ .nice-forecast-chart__forecast-line {
176
+ fill: none;
177
+ stroke-width: 2;
178
+ stroke-linecap: round;
179
+ stroke-linejoin: round;
180
+ stroke-dasharray: 6, 4;
181
+ }
182
+
183
+ .nice-forecast-chart__confidence-band {
184
+ opacity: 0.2;
185
+ }
186
+
187
+ .nice-forecast-chart__forecast-region {
188
+ fill: var(--nice-bg-secondary, #f9fafb);
189
+ opacity: 0.5;
190
+ }
191
+
192
+ .nice-forecast-chart__point {
193
+ cursor: pointer;
194
+ transition: r 0.15s ease;
195
+ }
196
+
197
+ .nice-forecast-chart__point:hover {
198
+ r: 6;
199
+ }
200
+
201
+ .nice-forecast-chart__annotation-line {
202
+ stroke-dasharray: 4, 2;
203
+ stroke-width: 1;
204
+ }
205
+
206
+ .nice-forecast-chart__annotation-marker {
207
+ cursor: pointer;
208
+ transition: transform 0.15s ease;
209
+ }
210
+
211
+ .nice-forecast-chart__annotation-marker:hover {
212
+ transform: scale(1.2);
213
+ }
214
+
215
+ .nice-forecast-chart__reference-line {
216
+ stroke-width: 1;
217
+ }
218
+
219
+ .nice-forecast-chart__reference-label {
220
+ font-size: 0.625rem;
221
+ fill: var(--nice-text-secondary);
222
+ }
223
+
224
+ .nice-forecast-chart__cash-runway {
225
+ pointer-events: none;
226
+ }
227
+
228
+ .nice-forecast-chart__cash-runway-line {
229
+ stroke: #ef4444;
230
+ stroke-width: 2;
231
+ stroke-dasharray: 8, 4;
232
+ }
233
+
234
+ .nice-forecast-chart__cash-runway-label-bg {
235
+ fill: #ef4444;
236
+ rx: 4;
237
+ }
238
+
239
+ .nice-forecast-chart__cash-runway-label {
240
+ font-size: 0.6875rem;
241
+ font-weight: 600;
242
+ fill: #ffffff;
243
+ }
244
+
245
+ .nice-forecast-chart__cash-runway-date {
246
+ font-size: 0.625rem;
247
+ fill: #ef4444;
248
+ font-weight: 500;
249
+ }
250
+
251
+ .nice-forecast-chart__tooltip {
252
+ position: absolute;
253
+ pointer-events: none;
254
+ z-index: 100;
255
+ padding: 0.75rem;
256
+ background: var(--nice-bg-primary, #ffffff);
257
+ border: 1px solid var(--nice-border-color, #e5e7eb);
258
+ border-radius: 0.5rem;
259
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
260
+ font-size: 0.8125rem;
261
+ max-width: 250px;
262
+ }
263
+
264
+ .nice-forecast-chart__tooltip-date {
265
+ font-weight: 600;
266
+ color: var(--nice-text-primary);
267
+ margin-bottom: 0.5rem;
268
+ padding-bottom: 0.5rem;
269
+ border-bottom: 1px solid var(--nice-border-divider, #f3f4f6);
270
+ }
271
+
272
+ .nice-forecast-chart__tooltip-item {
273
+ display: flex;
274
+ align-items: center;
275
+ gap: 0.5rem;
276
+ margin-bottom: 0.25rem;
277
+ }
278
+
279
+ .nice-forecast-chart__tooltip-color {
280
+ width: 10px;
281
+ height: 10px;
282
+ border-radius: 2px;
283
+ flex-shrink: 0;
284
+ }
285
+
286
+ .nice-forecast-chart__tooltip-label {
287
+ color: var(--nice-text-secondary);
288
+ flex: 1;
289
+ }
290
+
291
+ .nice-forecast-chart__tooltip-value {
292
+ font-weight: 600;
293
+ color: var(--nice-text-primary);
294
+ font-variant-numeric: tabular-nums;
295
+ }
296
+
297
+ .nice-forecast-chart__tooltip-confidence {
298
+ font-size: 0.75rem;
299
+ color: var(--nice-text-tertiary);
300
+ }
301
+
302
+ .nice-forecast-chart__legend {
303
+ display: flex;
304
+ flex-wrap: wrap;
305
+ gap: 1rem;
306
+ padding: 0.75rem 1rem;
307
+ border-top: 1px solid var(--nice-border-color, #e5e7eb);
308
+ }
309
+
310
+ .nice-forecast-chart__legend-item {
311
+ display: flex;
312
+ align-items: center;
313
+ gap: 0.375rem;
314
+ font-size: 0.8125rem;
315
+ color: var(--nice-text-secondary);
316
+ cursor: pointer;
317
+ user-select: none;
318
+ transition: opacity 0.15s ease;
319
+ }
320
+
321
+ .nice-forecast-chart__legend-item:hover {
322
+ color: var(--nice-text-primary);
323
+ }
324
+
325
+ .nice-forecast-chart__legend-item--hidden {
326
+ opacity: 0.4;
327
+ }
328
+
329
+ .nice-forecast-chart__legend-color {
330
+ width: 16px;
331
+ height: 3px;
332
+ border-radius: 1px;
333
+ }
334
+
335
+ .nice-forecast-chart__legend-color--dashed {
336
+ background: repeating-linear-gradient(
337
+ 90deg,
338
+ currentColor,
339
+ currentColor 4px,
340
+ transparent 4px,
341
+ transparent 6px
342
+ );
343
+ }
344
+
345
+ .nice-forecast-chart__empty {
346
+ display: flex;
347
+ align-items: center;
348
+ justify-content: center;
349
+ height: 300px;
350
+ color: var(--nice-text-secondary);
351
+ }
352
+
353
+ /* Dark mode */
354
+ .dark .nice-forecast-chart {
355
+ background: var(--nice-bg-primary-dark, #111827);
356
+ border-color: var(--nice-border-color-dark, #374151);
357
+ }
358
+
359
+ .dark .nice-forecast-chart__tooltip {
360
+ background: var(--nice-bg-secondary-dark, #1f2937);
361
+ border-color: var(--nice-border-color-dark, #374151);
362
+ }
363
+
364
+ .dark .nice-forecast-chart__forecast-region {
365
+ fill: var(--nice-bg-secondary-dark, #1f2937);
366
+ }
367
+ `,Sa=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#f97316"];function Be(e){return e instanceof Date?e:new Date(e)}function cn(e,t="pl-PL"){return e.toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"})}function qt(e,t="pl-PL"){return new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:2}).format(e)}o.forwardRef(function(e,t){var Y,X;const{scenarios:a,annotations:i=[],referenceLines:r=[],forecastStartDate:s,cashRunway:l,xAxis:c,yAxis:d,confidenceBands:u=[{level:95,color:"#3b82f6",opacity:.15}],tooltip:g,legend:h={enabled:!0,position:"bottom",interactive:!0},height:p=350,showForecastRegion:m=!0,lineWidth:k=2,showPoints:b=!1,pointRadius:C=4,enableZoom:_=!1,animationDuration:f=300,responsive:v=!0,onPointClick:j,onAnnotationClick:S,onScenarioToggle:I,onViewportChange:M,size:w="medium",disabled:E=!1,labels:P={},locale:L="pl-PL",className:A,style:N}=e,[x,O]=o.useState(()=>a.map((W,G)=>({...W,color:W.color??Sa[G%Sa.length],visible:W.visible!==!1}))),[D,F]=o.useState(null),[y,$]=o.useState({x:0,y:0}),z=o.useRef(null),R=o.useRef(null),T={top:20,right:30,bottom:40,left:60},[B,V]=o.useState({width:600,height:typeof p=="number"?p:350});o.useEffect(()=>{if(!v||!z.current)return;const W=new ResizeObserver(G=>{for(const re of G)V(ne=>({width:re.contentRect.width,height:ne.height}))});return W.observe(z.current),()=>W.disconnect()},[v]),o.useEffect(()=>{const W="nice-forecast-chart-styles";if(!document.getElementById(W)){const G=document.createElement("style");G.id=W,G.textContent=ed,document.head.appendChild(G)}},[]);const{xScale:K,yScale:H,allDates:q,minY:Z,maxY:Q}=o.useMemo(()=>{const W=x.filter(je=>je.visible!==!1).flatMap(je=>je.data);if(W.length===0)return{xScale:()=>0,yScale:()=>0,allDates:[],minY:0,maxY:100};const G=W.map(je=>Be(je.date).getTime()),re=Math.min(...G),ne=Math.max(...G),se=W.flatMap(je=>[je.value,je.forecast,je.lowerBound,je.upperBound]).filter(je=>je!=null),oe=(d==null?void 0:d.min)??Math.min(...se)*.95,ye=(d==null?void 0:d.max)??Math.max(...se)*1.05,ge=B.width-T.left-T.right,we=B.height-T.top-T.bottom,Ce=je=>{const He=typeof je=="number"?je:je.getTime();return T.left+(He-re)/(ne-re)*ge},_e=je=>T.top+we-(je-oe)/(ye-oe)*we,Ie=[...new Set(G)].sort((je,He)=>je-He).map(je=>new Date(je));return{xScale:Ce,yScale:_e,allDates:Ie,minY:oe,maxY:ye}},[x,B,T,d]),J=s?Be(s):null,ee=o.useMemo(()=>{if(!(l!=null&&l.enabled))return null;const W=l.threshold??0,G=l.scenarioId?x.find(ne=>ne.id===l.scenarioId&&ne.visible!==!1):x.find(ne=>ne.visible!==!1);if(!G)return null;const re=G.data.sort((ne,se)=>Be(ne.date).getTime()-Be(se.date).getTime());for(let ne=1;ne<re.length;ne++){const se=re[ne-1],oe=re[ne],ye=se.forecast??se.value,ge=oe.forecast??oe.value;if(ye!=null&&ge!=null&&ye>W&&ge<=W){const we=(ye-W)/(ye-ge),Ce=Be(se.date).getTime(),_e=Be(oe.date).getTime(),Ie=Ce+we*(_e-Ce);return new Date(Ie)}}return null},[l,x]),ie=o.useCallback((W,G)=>{const re=W.filter(ne=>ne[G]!=null).map(ne=>({x:K(Be(ne.date)),y:H(ne[G])}));return re.length===0?"":`M ${re.map(ne=>`${ne.x},${ne.y}`).join(" L ")}`},[K,H]),pe=o.useCallback(W=>{const G=W.filter(se=>se.lowerBound!=null&&se.upperBound!=null);if(G.length===0)return"";const re=G.map(se=>({x:K(Be(se.date)),y:H(se.upperBound)})),ne=G.map(se=>({x:K(Be(se.date)),y:H(se.lowerBound)})).reverse();return`M ${re.map(se=>`${se.x},${se.y}`).join(" L ")} L ${ne.map(se=>`${se.x},${se.y}`).join(" L ")} Z`},[K,H]),te=o.useCallback(W=>{if(!R.current||(g==null?void 0:g.enabled)===!1)return;const G=R.current.getBoundingClientRect(),re=W.clientX-G.left;W.clientY-G.top;let ne=null,se=1/0;for(const oe of q){const ye=K(oe),ge=Math.abs(ye-re);ge<se&&(se=ge,ne=oe)}if(ne&&se<50){const oe=x.filter(ge=>ge.visible!==!1).map(ge=>{const we=ge.data.find(Ce=>Be(Ce.date).getTime()===ne.getTime());return{scenario:ge,value:we==null?void 0:we.value,forecast:we==null?void 0:we.forecast,lowerBound:we==null?void 0:we.lowerBound,upperBound:we==null?void 0:we.upperBound}}),ye=i.filter(ge=>Math.abs(Be(ge.date).getTime()-ne.getTime())<864e5);F({date:ne,values:oe,annotations:ye}),$({x:W.clientX-G.left+10,y:W.clientY-G.top-10})}else F(null)},[K,q,x,i,g]),ue=o.useCallback(W=>{if(!h.interactive)return;O(re=>re.map(ne=>ne.id===W?{...ne,visible:!ne.visible}:ne));const G=x.find(re=>re.id===W);G&&(I==null||I(W,!G.visible))},[h.interactive,x,I]);o.useImperativeHandle(t,()=>({getScenarios:()=>x,updateScenario:(W,G)=>{O(re=>re.map(ne=>ne.id===W?{...ne,data:G}:ne))},toggleScenario:ue,setZoomRange:()=>{},resetZoom:()=>{},exportImage:W=>{if(!R.current)return null;const G=R.current,re=new XMLSerializer().serializeToString(G);return`data:image/svg+xml;base64,${btoa(re)}`},getDataAtDate:W=>{const G=x.filter(re=>re.visible!==!1).map(re=>{const ne=re.data.find(se=>Be(se.date).getTime()===W.getTime());return{scenario:re,value:ne==null?void 0:ne.value,forecast:ne==null?void 0:ne.forecast,lowerBound:ne==null?void 0:ne.lowerBound,upperBound:ne==null?void 0:ne.upperBound}});return{date:W,values:G,annotations:i.filter(re=>Be(re.date).getTime()===W.getTime())}}}),[x,i,ue]),B.width-T.left-T.right;const fe=B.height-T.top-T.bottom,ae=o.useMemo(()=>{const W=(d==null?void 0:d.tickCount)??5,G=[],re=(Q-Z)/(W-1);for(let ne=0;ne<W;ne++)G.push(Z+re*ne);return G},[Z,Q,d==null?void 0:d.tickCount]),he=o.useMemo(()=>{const W=(c==null?void 0:c.tickCount)??6;if(q.length===0)return[];const G=Math.max(1,Math.floor(q.length/(W-1)));return q.filter((re,ne)=>ne%G===0||ne===q.length-1)},[q,c==null?void 0:c.tickCount]);return x.length===0||x.every(W=>W.data.length===0)?n.jsx("div",{className:`nice-forecast-chart ${A??""}`,style:N,children:n.jsx("div",{className:"nice-forecast-chart__empty",children:P.noData??"No data available"})}):n.jsxs("div",{className:`nice-forecast-chart ${A??""}`,style:{...N,height:p},children:[n.jsxs("div",{ref:z,className:"nice-forecast-chart__container",children:[n.jsxs("svg",{ref:R,className:"nice-forecast-chart__svg",width:B.width,height:B.height,onMouseMove:te,onMouseLeave:()=>F(null),children:[(d==null?void 0:d.showGrid)!==!1&&ae.map(W=>n.jsx("line",{className:"nice-forecast-chart__grid-line",x1:T.left,x2:B.width-T.right,y1:H(W),y2:H(W)},W)),m&&J&&n.jsx("rect",{className:"nice-forecast-chart__forecast-region",x:K(J),y:T.top,width:B.width-T.right-K(J),height:fe}),r.map(W=>n.jsxs("g",{children:[n.jsx("line",{className:"nice-forecast-chart__reference-line",x1:T.left,x2:B.width-T.right,y1:H(W.value),y2:H(W.value),stroke:W.color??"#9ca3af",strokeDasharray:W.dashArray??"4,2"}),W.label&&n.jsx("text",{className:"nice-forecast-chart__reference-label",x:B.width-T.right-4,y:H(W.value)-4,textAnchor:"end",children:W.label})]},W.id)),ee&&(l==null?void 0:l.enabled)&&n.jsxs("g",{className:"nice-forecast-chart__cash-runway",children:[n.jsx("line",{className:"nice-forecast-chart__cash-runway-line",x1:K(ee),x2:K(ee),y1:T.top,y2:B.height-T.bottom,stroke:l.color??"#ef4444"}),l.showLabel!==!1&&n.jsxs(n.Fragment,{children:[n.jsx("rect",{className:"nice-forecast-chart__cash-runway-label-bg",x:K(ee)-60,y:T.top-2,width:120,height:l.showDate!==!1?32:20,fill:l.color??"#ef4444",rx:4}),n.jsx("text",{className:"nice-forecast-chart__cash-runway-label",x:K(ee),y:T.top+12,textAnchor:"middle",fill:"#ffffff",children:l.label??P.cashRunsOut??"💰 Cash runs out"}),l.showDate!==!1&&n.jsx("text",{className:"nice-forecast-chart__cash-runway-label",x:K(ee),y:T.top+26,textAnchor:"middle",fill:"#ffffff",style:{fontSize:"0.625rem",opacity:.9},children:cn(ee,L)})]})]}),x.filter(W=>W.visible!==!1&&W.showConfidenceBand).map(W=>n.jsx("path",{className:"nice-forecast-chart__confidence-band",d:pe(W.data),fill:W.color},`band-${W.id}`)),x.filter(W=>W.visible!==!1).map(W=>{const G=J?W.data.filter(ne=>Be(ne.date)<J):W.data.filter(ne=>ne.value!=null),re=J?W.data.filter(ne=>Be(ne.date)>=J):W.data.filter(ne=>ne.forecast!=null);return n.jsxs("g",{children:[n.jsx("path",{className:"nice-forecast-chart__historical-line",d:ie(G,"value"),stroke:W.color,strokeWidth:k}),n.jsx("path",{className:"nice-forecast-chart__forecast-line",d:ie(re,J?"value":"forecast"),stroke:W.color,strokeWidth:k}),re.length>0&&W.data.some(ne=>ne.forecast!=null)&&n.jsx("path",{className:"nice-forecast-chart__forecast-line",d:ie(W.data,"forecast"),stroke:W.color,strokeWidth:k}),b&&W.data.map((ne,se)=>{const oe=ne.value??ne.forecast;return oe==null?null:n.jsx("circle",{className:"nice-forecast-chart__point",cx:K(Be(ne.date)),cy:H(oe),r:C,fill:W.color,onClick:()=>j==null?void 0:j(ne,W)},se)})]},W.id)}),i.map(W=>{const G=K(Be(W.date));return n.jsxs("g",{className:"nice-forecast-chart__annotation-marker",onClick:()=>S==null?void 0:S(W),children:[W.showLine!==!1&&n.jsx("line",{className:"nice-forecast-chart__annotation-line",x1:G,x2:G,y1:T.top,y2:B.height-T.bottom,stroke:W.color??"#9ca3af"}),n.jsx("circle",{cx:G,cy:T.top+10,r:8,fill:W.color??"#9ca3af"}),n.jsx("text",{x:G,y:T.top+14,textAnchor:"middle",fill:"white",fontSize:"10",children:W.icon??"!"})]},W.id)}),n.jsx("line",{className:"nice-forecast-chart__axis-line",x1:T.left,x2:T.left,y1:T.top,y2:B.height-T.bottom}),n.jsx("line",{className:"nice-forecast-chart__axis-line",x1:T.left,x2:B.width-T.right,y1:B.height-T.bottom,y2:B.height-T.bottom}),ae.map(W=>n.jsx("text",{className:"nice-forecast-chart__axis-label",x:T.left-8,y:H(W)+4,textAnchor:"end",children:d!=null&&d.format?d.format(W):qt(W,L)},W)),he.map(W=>n.jsx("text",{className:"nice-forecast-chart__axis-label",x:K(W),y:B.height-T.bottom+16,textAnchor:"middle",children:c!=null&&c.format?c.format(W):cn(W,L)},W.getTime())),(d==null?void 0:d.title)&&n.jsx("text",{className:"nice-forecast-chart__axis-title",x:15,y:B.height/2,textAnchor:"middle",transform:`rotate(-90, 15, ${B.height/2})`,children:d.title})]}),D&&n.jsxs("div",{className:"nice-forecast-chart__tooltip",style:{left:y.x,top:y.y},children:[n.jsx("div",{className:"nice-forecast-chart__tooltip-date",children:cn(D.date,L)}),D.values.map(W=>{const G=W.value??W.forecast;return G==null?null:n.jsxs("div",{className:"nice-forecast-chart__tooltip-item",children:[n.jsx("span",{className:"nice-forecast-chart__tooltip-color",style:{background:W.scenario.color}}),n.jsx("span",{className:"nice-forecast-chart__tooltip-label",children:W.scenario.name}),n.jsx("span",{className:"nice-forecast-chart__tooltip-value",children:qt(G,L)})]},W.scenario.id)}),D.values.some(W=>W.lowerBound!=null)&&n.jsxs("div",{className:"nice-forecast-chart__tooltip-confidence",children:[P.confidence??"CI",":"," ",qt(((Y=D.values[0])==null?void 0:Y.lowerBound)??0,L)," –"," ",qt(((X=D.values[0])==null?void 0:X.upperBound)??0,L)]})]})]}),h.enabled&&n.jsx("div",{className:"nice-forecast-chart__legend",children:x.map(W=>n.jsxs("div",{className:`nice-forecast-chart__legend-item ${W.visible===!1?"nice-forecast-chart__legend-item--hidden":""}`,onClick:()=>ue(W.id),children:[n.jsx("span",{className:`nice-forecast-chart__legend-color ${W.isBase?"":"nice-forecast-chart__legend-color--dashed"}`,style:{background:W.color}}),W.name]},W.id))})]})});const td=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#06b6d4","#84cc16","#f97316","#6366f1"],xi=o.forwardRef((e,t)=>{var z,R;const{levels:a,initialLevelId:i,chartType:r="bar",width:s=600,height:l=400,showBreadcrumbs:c=!0,showBackButton:d=!0,animationDuration:u=300,onLevelChange:g,onItemClick:h,colors:p=td,showValues:m=!0,showLegend:k=!0,className:b,style:C,..._}=e,[f,v]=o.useState(i||((z=a[0])==null?void 0:z.id)),[j,S]=o.useState([i||((R=a[0])==null?void 0:R.id)]),[I,M]=o.useState(!1),[w,E]=o.useState("in"),P=o.useMemo(()=>a.find(T=>T.id===f),[a,f]),L=o.useCallback(T=>{a.find(B=>B.id===T)&&(E("in"),M(!0),setTimeout(()=>{v(T),S(B=>[...B,T]),g==null||g(T,[...j,T]),M(!1)},u/2))},[a,j,u,g]),A=o.useCallback(()=>{if(j.length<=1)return;E("out"),M(!0);const T=j.slice(0,-1),B=T[T.length-1];setTimeout(()=>{v(B),S(T),g==null||g(B,T),M(!1)},u/2)},[j,u,g]),N=o.useCallback(()=>{var B;const T=(B=a[0])==null?void 0:B.id;T&&(E("out"),M(!0),setTimeout(()=>{v(T),S([T]),g==null||g(T,[T]),M(!1)},u/2))},[a,u,g]);o.useImperativeHandle(t,()=>({drillDown:L,drillUp:A,resetToRoot:N,getCurrentLevel:()=>f,getPath:()=>j}),[L,A,N,f,j]);const x=o.useCallback((T,B)=>{h==null||h(T,f);const V=a.find(K=>{var H;return K.parentId===f&&K.id===((H=T.metadata)==null?void 0:H.childLevelId)});V&&L(V.id)},[f,a,L,h]),O=o.useMemo(()=>(P==null?void 0:P.data.reduce((T,B)=>T+B.value,0))||0,[P]),D=o.useMemo(()=>j.map(T=>{var B;return((B=a.find(V=>V.id===T))==null?void 0:B.label)||T}),[j,a]),F=()=>{if(!P)return null;const T=P.data,B=Math.max(...T.map(K=>K.value)),V=Math.min(40,(l-100)/T.length-8);return n.jsx("div",{className:"nice-drilldown-bars",children:T.map((K,H)=>{const q=K.value/B*100;return n.jsxs("div",{className:"nice-drilldown-bar-row",onClick:()=>x(K,H),children:[n.jsx("span",{className:"nice-drilldown-bar-label",children:K.label||`Item ${H+1}`}),n.jsx("div",{className:"nice-drilldown-bar-track",children:n.jsx("div",{className:"nice-drilldown-bar-fill",style:{width:`${q}%`,backgroundColor:K.color||p[H%p.length],height:V}})}),m&&n.jsx("span",{className:"nice-drilldown-bar-value",children:K.value.toLocaleString()})]},H)})})},y=()=>{if(!P)return null;const T=P.data,B=s/2,V=(l-60)/2+30,K=Math.min(B,V)-40;let H=-90;const q=T.map((Z,Q)=>{const J=Z.value/O*360,ee=H+J,ie=J>180?1:0,pe=H*Math.PI/180,te=ee*Math.PI/180,ue=B+K*Math.cos(pe),fe=V+K*Math.sin(pe),ae=B+K*Math.cos(te),he=V+K*Math.sin(te),Y=(H+J/2)*Math.PI/180,X=B+K*.7*Math.cos(Y),W=V+K*.7*Math.sin(Y),G=`M ${B} ${V} L ${ue} ${fe} A ${K} ${K} 0 ${ie} 1 ${ae} ${he} Z`;return H=ee,{path:G,color:Z.color||p[Q%p.length],label:Z.label||`Item ${Q+1}`,value:Z.value,percentage:(Z.value/O*100).toFixed(1),labelX:X,labelY:W,item:Z,index:Q}});return n.jsx("svg",{width:s,height:l-40,className:"nice-drilldown-pie",children:n.jsx("g",{children:q.map((Z,Q)=>n.jsxs("g",{onClick:()=>x(Z.item,Z.index),children:[n.jsx("path",{d:Z.path,fill:Z.color,stroke:"white",strokeWidth:2,className:"nice-drilldown-pie-slice"}),m&&parseFloat(Z.percentage)>5&&n.jsxs("text",{x:Z.labelX,y:Z.labelY,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontSize:"12",fontWeight:"600",children:[Z.percentage,"%"]})]},Q))})})},$=()=>{if(!P)return null;const T=P.data,B=Math.max(...T.map(H=>H.value)),V=Math.min(60,(s-100)/T.length-8),K=l-100;return n.jsx("svg",{width:s,height:l-40,className:"nice-drilldown-columns",children:n.jsxs("g",{transform:"translate(50, 20)",children:[[0,.25,.5,.75,1].map((H,q)=>n.jsxs("g",{children:[n.jsx("line",{x1:0,y1:K*(1-H),x2:s-80,y2:K*(1-H),stroke:"#e5e7eb",strokeDasharray:H===0?void 0:"4"}),n.jsx("text",{x:-8,y:K*(1-H),textAnchor:"end",dominantBaseline:"middle",fontSize:"11",fill:"#6b7280",children:Math.round(B*H).toLocaleString()})]},q)),T.map((H,q)=>{const Z=H.value/B*K,Q=q*((s-100)/T.length)+((s-100)/T.length-V)/2;return n.jsxs("g",{onClick:()=>x(H,q),children:[n.jsx("rect",{x:Q,y:K-Z,width:V,height:Z,fill:H.color||p[q%p.length],rx:4,className:"nice-drilldown-column-bar"}),n.jsx("text",{x:Q+V/2,y:K+16,textAnchor:"middle",fontSize:"11",fill:"#374151",children:(H.label||`${q+1}`).slice(0,10)}),m&&n.jsx("text",{x:Q+V/2,y:K-Z-8,textAnchor:"middle",fontSize:"11",fill:"#374151",fontWeight:"500",children:H.value.toLocaleString()})]},q)})]})})};return n.jsxs("div",{className:`nice-drilldown-chart ${I?`animating ${w}`:""} ${b||""}`,style:{width:s,...C},..._,children:[n.jsxs("div",{className:"nice-drilldown-header",children:[d&&j.length>1&&n.jsx("button",{className:"nice-drilldown-back",onClick:A,children:"← Wstecz"}),c&&n.jsx("div",{className:"nice-drilldown-breadcrumbs",children:D.map((T,B)=>n.jsxs(o.Fragment,{children:[B>0&&n.jsx("span",{className:"nice-drilldown-separator",children:"/"}),n.jsx("span",{className:`nice-drilldown-crumb ${B===D.length-1?"active":""}`,onClick:()=>{if(B<D.length-1){const V=j.slice(0,B+1);S(V),v(V[V.length-1])}},children:T})]},B))})]}),n.jsxs("div",{className:"nice-drilldown-content",style:{height:l-40},children:[r==="bar"&&F(),r==="pie"&&y(),r==="column"&&$()]}),k&&P&&n.jsx("div",{className:"nice-drilldown-legend",children:P.data.map((T,B)=>n.jsxs("div",{className:"nice-drilldown-legend-item",children:[n.jsx("span",{className:"nice-drilldown-legend-color",style:{backgroundColor:T.color||p[B%p.length]}}),n.jsx("span",{className:"nice-drilldown-legend-label",children:T.label||`Item ${B+1}`})]},B))}),n.jsx("style",{children:`
368
+ .nice-drilldown-chart {
369
+ font-family: system-ui, -apple-system, sans-serif;
370
+ background: white;
371
+ border-radius: 8px;
372
+ overflow: hidden;
373
+ }
374
+
375
+ .nice-drilldown-header {
376
+ display: flex;
377
+ align-items: center;
378
+ gap: 12px;
379
+ padding: 12px 16px;
380
+ border-bottom: 1px solid #e5e7eb;
381
+ min-height: 40px;
382
+ }
383
+
384
+ .nice-drilldown-back {
385
+ background: #f3f4f6;
386
+ border: none;
387
+ padding: 6px 12px;
388
+ border-radius: 6px;
389
+ cursor: pointer;
390
+ font-size: 13px;
391
+ color: #374151;
392
+ transition: background 0.2s;
393
+ }
394
+
395
+ .nice-drilldown-back:hover {
396
+ background: #e5e7eb;
397
+ }
398
+
399
+ .nice-drilldown-breadcrumbs {
400
+ display: flex;
401
+ align-items: center;
402
+ gap: 4px;
403
+ font-size: 13px;
404
+ }
405
+
406
+ .nice-drilldown-separator {
407
+ color: #9ca3af;
408
+ }
409
+
410
+ .nice-drilldown-crumb {
411
+ color: #6b7280;
412
+ cursor: pointer;
413
+ }
414
+
415
+ .nice-drilldown-crumb:hover:not(.active) {
416
+ color: #3b82f6;
417
+ }
418
+
419
+ .nice-drilldown-crumb.active {
420
+ color: #111827;
421
+ font-weight: 500;
422
+ cursor: default;
423
+ }
424
+
425
+ .nice-drilldown-content {
426
+ padding: 16px;
427
+ transition: opacity 0.15s, transform 0.15s;
428
+ }
429
+
430
+ .nice-drilldown-chart.animating .nice-drilldown-content {
431
+ opacity: 0;
432
+ }
433
+
434
+ .nice-drilldown-chart.animating.in .nice-drilldown-content {
435
+ transform: translateX(20px);
436
+ }
437
+
438
+ .nice-drilldown-chart.animating.out .nice-drilldown-content {
439
+ transform: translateX(-20px);
440
+ }
441
+
442
+ .nice-drilldown-bars {
443
+ display: flex;
444
+ flex-direction: column;
445
+ gap: 8px;
446
+ }
447
+
448
+ .nice-drilldown-bar-row {
449
+ display: flex;
450
+ align-items: center;
451
+ gap: 12px;
452
+ cursor: pointer;
453
+ padding: 4px 8px;
454
+ margin: -4px -8px;
455
+ border-radius: 6px;
456
+ transition: background 0.2s;
457
+ }
458
+
459
+ .nice-drilldown-bar-row:hover {
460
+ background: #f9fafb;
461
+ }
462
+
463
+ .nice-drilldown-bar-label {
464
+ width: 120px;
465
+ font-size: 13px;
466
+ color: #374151;
467
+ overflow: hidden;
468
+ text-overflow: ellipsis;
469
+ white-space: nowrap;
470
+ }
471
+
472
+ .nice-drilldown-bar-track {
473
+ flex: 1;
474
+ background: #f3f4f6;
475
+ border-radius: 6px;
476
+ overflow: hidden;
477
+ }
478
+
479
+ .nice-drilldown-bar-fill {
480
+ transition: width 0.3s ease;
481
+ border-radius: 6px;
482
+ }
483
+
484
+ .nice-drilldown-bar-value {
485
+ width: 80px;
486
+ text-align: right;
487
+ font-size: 13px;
488
+ font-weight: 500;
489
+ color: #111827;
490
+ }
491
+
492
+ .nice-drilldown-pie-slice {
493
+ cursor: pointer;
494
+ transition: transform 0.2s, opacity 0.2s;
495
+ transform-origin: center;
496
+ }
497
+
498
+ .nice-drilldown-pie-slice:hover {
499
+ opacity: 0.85;
500
+ transform: scale(1.02);
501
+ }
502
+
503
+ .nice-drilldown-column-bar {
504
+ cursor: pointer;
505
+ transition: opacity 0.2s;
506
+ }
507
+
508
+ .nice-drilldown-column-bar:hover {
509
+ opacity: 0.8;
510
+ }
511
+
512
+ .nice-drilldown-legend {
513
+ display: flex;
514
+ flex-wrap: wrap;
515
+ gap: 16px;
516
+ padding: 12px 16px;
517
+ border-top: 1px solid #e5e7eb;
518
+ }
519
+
520
+ .nice-drilldown-legend-item {
521
+ display: flex;
522
+ align-items: center;
523
+ gap: 6px;
524
+ }
525
+
526
+ .nice-drilldown-legend-color {
527
+ width: 12px;
528
+ height: 12px;
529
+ border-radius: 3px;
530
+ }
531
+
532
+ .nice-drilldown-legend-label {
533
+ font-size: 12px;
534
+ color: #6b7280;
535
+ }
536
+ `})]})});xi.displayName="NiceDrillDownChart";const vi=o.forwardRef((e,t)=>{const{initialData:a=[],maxPoints:i=60,updateInterval:r=1e3,fetchData:s,width:l=600,height:c=200,chartType:d="line",color:u="#3b82f6",showGrid:g=!0,showTimeAxis:h=!0,showCurrentValue:p=!0,title:m,valueFormatter:k=Z=>Z.toFixed(2),timeFormatter:b=Z=>new Date(Z).toLocaleTimeString(),onDataUpdate:C,paused:_,className:f,style:v,...j}=e,[S,I]=o.useState(a),[M,w]=o.useState(_||!1),E=o.useRef();o.useEffect(()=>{_!==void 0&&w(_)},[_]),o.useEffect(()=>{if(M||!s)return;const Z=async()=>{try{const Q=await s();I(J=>{const ee=[...J,Q].slice(-i);return C==null||C(ee),ee})}catch(Q){console.error("Failed to fetch realtime data:",Q)}};return E.current=setInterval(Z,r),()=>{E.current&&clearInterval(E.current)}},[M,s,r,i,C]);const P=o.useCallback(Z=>{I(Q=>{const J=[...Q,Z].slice(-i);return C==null||C(J),J})},[i,C]),L=o.useCallback(()=>{I([]),C==null||C([])},[C]),A=o.useCallback(()=>w(!0),[]),N=o.useCallback(()=>w(!1),[]);o.useImperativeHandle(t,()=>({addDataPoint:P,clearData:L,pause:A,resume:N,getData:()=>S}),[P,L,S]);const x={top:20,right:60,bottom:h?40:20,left:50},O=l-x.left-x.right,D=c-x.top-x.bottom,F=S.map(Z=>Z.value),y=F.length?Math.min(...F):0,$=F.length?Math.max(...F):100,z=($-y||1)*.1,R=y-z,T=$+z-R,B=Z=>x.left+Z/(i-1)*O,V=Z=>x.top+D-(Z-R)/T*D,K=S.map((Z,Q)=>`${B(Q)},${V(Z.value)}`).join(" "),H=S.length>0?`M ${B(0)},${x.top+D} L ${K} L ${B(S.length-1)},${x.top+D} Z`:"",q=S.length>0?S[S.length-1].value:null;return n.jsxs("div",{className:`nice-realtime-chart ${f||""}`,style:{width:l,...v},...j,children:[m&&n.jsxs("div",{className:"nice-realtime-header",children:[n.jsx("span",{className:"nice-realtime-title",children:m}),n.jsxs("div",{className:"nice-realtime-controls",children:[n.jsx("button",{className:`nice-realtime-btn ${M?"paused":""}`,onClick:()=>w(!M),children:M?"▶️":"⏸️"}),p&&q!==null&&n.jsx("span",{className:"nice-realtime-value",children:k(q)})]})]}),n.jsxs("svg",{width:l,height:c,className:"nice-realtime-svg",children:[g&&n.jsx("g",{className:"nice-realtime-grid",children:[0,.25,.5,.75,1].map((Z,Q)=>{const J=x.top+D*(1-Z),ee=R+T*Z;return n.jsxs("g",{children:[n.jsx("line",{x1:x.left,y1:J,x2:l-x.right,y2:J,stroke:"#e5e7eb",strokeDasharray:Z===0?void 0:"3"}),n.jsx("text",{x:x.left-8,y:J,textAnchor:"end",dominantBaseline:"middle",fontSize:"10",fill:"#6b7280",children:k(ee)})]},Q)})}),d==="area"&&S.length>0&&n.jsx("path",{d:H,fill:u,fillOpacity:.2}),S.length>1&&n.jsx("polyline",{points:K,fill:"none",stroke:u,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),S.length>0&&n.jsx("circle",{cx:B(S.length-1),cy:V(S[S.length-1].value),r:4,fill:u,className:"nice-realtime-point"}),h&&S.length>0&&n.jsx("g",{className:"nice-realtime-time-axis",children:[0,Math.floor(S.length/2),S.length-1].filter(Z=>S[Z]).map(Z=>n.jsx("text",{x:B(Z),y:c-8,textAnchor:"middle",fontSize:"10",fill:"#6b7280",children:b(S[Z].timestamp)},Z))})]}),n.jsxs("div",{className:`nice-realtime-status ${M?"paused":"live"}`,children:[n.jsx("span",{className:"nice-realtime-status-dot"}),n.jsx("span",{children:M?"Wstrzymano":"Na żywo"})]}),n.jsx("style",{children:`
537
+ .nice-realtime-chart {
538
+ font-family: system-ui, -apple-system, sans-serif;
539
+ background: white;
540
+ border-radius: 8px;
541
+ position: relative;
542
+ }
543
+
544
+ .nice-realtime-header {
545
+ display: flex;
546
+ justify-content: space-between;
547
+ align-items: center;
548
+ padding: 12px 16px;
549
+ border-bottom: 1px solid #e5e7eb;
550
+ }
551
+
552
+ .nice-realtime-title {
553
+ font-size: 14px;
554
+ font-weight: 600;
555
+ color: #111827;
556
+ }
557
+
558
+ .nice-realtime-controls {
559
+ display: flex;
560
+ align-items: center;
561
+ gap: 12px;
562
+ }
563
+
564
+ .nice-realtime-btn {
565
+ background: none;
566
+ border: none;
567
+ cursor: pointer;
568
+ font-size: 16px;
569
+ padding: 4px;
570
+ }
571
+
572
+ .nice-realtime-value {
573
+ font-size: 18px;
574
+ font-weight: 600;
575
+ color: ${u};
576
+ font-variant-numeric: tabular-nums;
577
+ }
578
+
579
+ .nice-realtime-point {
580
+ animation: realtime-pulse 1s ease-out infinite;
581
+ }
582
+
583
+ @keyframes realtime-pulse {
584
+ 0% { opacity: 1; transform: scale(1); }
585
+ 50% { opacity: 0.5; transform: scale(1.5); }
586
+ 100% { opacity: 1; transform: scale(1); }
587
+ }
588
+
589
+ .nice-realtime-status {
590
+ position: absolute;
591
+ bottom: 8px;
592
+ right: 8px;
593
+ display: flex;
594
+ align-items: center;
595
+ gap: 6px;
596
+ font-size: 11px;
597
+ color: #6b7280;
598
+ }
599
+
600
+ .nice-realtime-status-dot {
601
+ width: 8px;
602
+ height: 8px;
603
+ border-radius: 50%;
604
+ background: #22c55e;
605
+ }
606
+
607
+ .nice-realtime-status.paused .nice-realtime-status-dot {
608
+ background: #f59e0b;
609
+ }
610
+
611
+ .nice-realtime-status.live .nice-realtime-status-dot {
612
+ animation: live-pulse 2s ease-in-out infinite;
613
+ }
614
+
615
+ @keyframes live-pulse {
616
+ 0%, 100% { opacity: 1; }
617
+ 50% { opacity: 0.4; }
618
+ }
619
+ `})]})});vi.displayName="NiceRealtimeChart";const An=o.forwardRef(({data:e,renderNode:t,selectable:a,selectedKey:i,onSelect:r,direction:s="top-down",collapsible:l=!0,className:c,style:d,id:u},g)=>{const h=ke(u),[p,m]=o.useState(new Set),k=o.useCallback(_=>{m(f=>{const v=new Set(f);return v.has(_)?v.delete(_):v.add(_),v})},[]),b=o.useCallback(_=>{a&&(r==null||r(_))},[a,r]),C=o.useCallback(_=>{const f=p.has(_.key),v=_.children&&_.children.length>0;return n.jsxs("li",{className:"nice-org-chart__item",children:[n.jsxs("div",{className:`nice-org-chart__node${i===_.key?" nice-org-chart__node--selected":""}`,onClick:()=>b(_.key),role:a?"button":void 0,children:[t?t(_):n.jsx("span",{children:_.label}),l&&v&&n.jsx("button",{type:"button",className:"nice-org-chart__toggle",onClick:j=>{j.stopPropagation(),k(_.key)},"aria-label":f?"Expand":"Collapse",children:f?"+":"−"})]}),v&&!f&&n.jsx("ul",{className:"nice-org-chart__children",children:_.children.map(j=>C(j))})]},_.key)},[p,i,t,a,l,b,k]);return n.jsx("div",{ref:g,id:h,className:`nice-org-chart nice-org-chart--${s} ${c||""}`,style:d,children:n.jsx("ul",{className:"nice-org-chart__root",children:C(e)})})});An.displayName="NiceOrganizationChart";function nd(e,t,a){const i=m=>{const k=m.replace("#","");return[parseInt(k.slice(0,2),16),parseInt(k.slice(2,4),16),parseInt(k.slice(4,6),16)]},[r,s,l]=i(e),[c,d,u]=i(t),g=Math.round(r+(c-r)*a),h=Math.round(s+(d-s)*a),p=Math.round(l+(u-l)*a);return`rgb(${g},${h},${p})`}const Fn=o.forwardRef(({data:e,xLabels:t,yLabels:a,colors:i=["#e0f2fe","#1d4ed8"],onCellClick:r,cellSize:s=40,showValues:l=!0,className:c,style:d,id:u},g)=>{const h=ke(u),{minVal:p,maxVal:m}=o.useMemo(()=>{let b=1/0,C=-1/0;for(const _ of e)for(const f of _)f<b&&(b=f),f>C&&(C=f);return{minVal:b,maxVal:C}},[e]),k=o.useCallback(b=>m===p?.5:(b-p)/(m-p),[p,m]);return n.jsx("div",{ref:g,id:h,className:`nice-heatmap ${c||""}`,style:d,children:n.jsxs("table",{className:"nice-heatmap__table",children:[t&&n.jsx("thead",{children:n.jsxs("tr",{children:[a&&n.jsx("th",{}),t.map((b,C)=>n.jsx("th",{className:"nice-heatmap__header",children:b},C))]})}),n.jsx("tbody",{children:e.map((b,C)=>n.jsxs("tr",{children:[a&&n.jsx("th",{className:"nice-heatmap__row-label",children:a[C]}),b.map((_,f)=>n.jsx("td",{className:"nice-heatmap__cell",style:{background:nd(i[0],i[1],k(_)),width:s,height:s,textAlign:"center",color:k(_)>.6?"#fff":"#333",cursor:r?"pointer":void 0},onClick:()=>r==null?void 0:r(C,f,_),title:String(_),children:l?_:""},f))]},C))})]})})});Fn.displayName="NiceHeatMap";function ad(e,t){const a=e.reduce((u,g)=>u+g.value,0);if(a===0||e.length===0)return[];const i=[];let{x:r,y:s,w:l,h:c}=t;const d=[...e].sort((u,g)=>g.value-u.value);for(const u of d){const g=u.value/a;if(l>=c){const h=l*g;i.push({x:r,y:s,w:h,h:c,node:u}),r+=h,l-=h}else{const h=c*g;i.push({x:r,y:s,w:l,h,node:u}),s+=h,c-=h}}return i}const id=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#84cc16"],In=o.forwardRef(({data:e,width:t=600,height:a=400,onNodeClick:i,colors:r=id,className:s,style:l,id:c},d)=>{const u=ke(c),g=o.useMemo(()=>{const h=e.children??[e];return ad(h,{x:0,y:0,w:t,h:a})},[e,t,a]);return n.jsx("div",{ref:d,id:u,className:`nice-treemap ${s||""}`,style:l,children:n.jsx("svg",{width:t,height:a,className:"nice-treemap__svg",children:g.map((h,p)=>n.jsxs("g",{onClick:()=>i==null?void 0:i(h.node),style:{cursor:i?"pointer":void 0},children:[n.jsx("rect",{x:h.x,y:h.y,width:Math.max(h.w-1,0),height:Math.max(h.h-1,0),fill:h.node.color??r[p%r.length],rx:2}),h.w>40&&h.h>20&&n.jsx("text",{x:h.x+h.w/2,y:h.y+h.h/2,textAnchor:"middle",dominantBaseline:"central",fill:"#fff",fontSize:Math.min(12,h.w/6),className:"nice-treemap__label",children:h.node.label})]},h.node.key))})})});In.displayName="NiceTreeMap";const Dn=o.forwardRef(({data:e,type:t="candlestick",showVolume:a=!0,width:i=800,height:r=400,bullColor:s="#22c55e",bearColor:l="#ef4444",className:c,style:d,id:u},g)=>{const h=ke(u),p={top:20,right:20,bottom:a?80:30,left:60},m=i-p.left-p.right,k=a?50:0,b=r-p.top-p.bottom-k,{minP:C,maxP:_,maxVol:f}=o.useMemo(()=>{let M=1/0,w=-1/0,E=0;for(const P of e)P.low<M&&(M=P.low),P.high>w&&(w=P.high),P.volume&&P.volume>E&&(E=P.volume);return{minP:M,maxP:w,maxVol:E}},[e]),v=Math.max(1,m/e.length*.7),j=M=>p.left+(M+.5)*(m/e.length),S=M=>p.top+b-(M-C)/(_-C||1)*b,I=M=>r-p.bottom-k+k*(1-M/(f||1));return n.jsx("div",{ref:g,id:h,className:`nice-stock-chart ${c||""}`,style:d,children:n.jsxs("svg",{width:i,height:r,className:"nice-stock-chart__svg",children:[[0,.25,.5,.75,1].map(M=>{const w=C+M*(_-C);return n.jsxs("g",{children:[n.jsx("line",{x1:p.left,x2:i-p.right,y1:S(w),y2:S(w),stroke:"#e5e7eb",strokeDasharray:"2,2"}),n.jsx("text",{x:p.left-4,y:S(w)+4,textAnchor:"end",fontSize:10,fill:"#888",children:w.toFixed(2)})]},M)}),t==="line"?n.jsx("polyline",{points:e.map((M,w)=>`${j(w)},${S(M.close)}`).join(" "),fill:"none",stroke:s,strokeWidth:1.5}):e.map((M,w)=>{const E=M.close>=M.open,P=E?s:l,L=j(w);if(t==="ohlc")return n.jsxs("g",{children:[n.jsx("line",{x1:L,x2:L,y1:S(M.high),y2:S(M.low),stroke:P,strokeWidth:1}),n.jsx("line",{x1:L-v/2,x2:L,y1:S(M.open),y2:S(M.open),stroke:P,strokeWidth:1.5}),n.jsx("line",{x1:L,x2:L+v/2,y1:S(M.close),y2:S(M.close),stroke:P,strokeWidth:1.5})]},w);const A=S(Math.max(M.open,M.close)),N=S(Math.min(M.open,M.close));return n.jsxs("g",{children:[n.jsx("line",{x1:L,x2:L,y1:S(M.high),y2:S(M.low),stroke:P,strokeWidth:1}),n.jsx("rect",{x:L-v/2,y:A,width:v,height:Math.max(N-A,1),fill:E?"transparent":P,stroke:P,strokeWidth:1})]},w)}),a&&e.map((M,w)=>{if(!M.volume)return null;const E=M.close>=M.open;return n.jsx("rect",{x:j(w)-v/2,y:I(M.volume),width:v,height:r-p.bottom-I(M.volume),fill:E?s:l,opacity:.3},`v${w}`)}),e.map((M,w)=>w%Math.max(1,Math.floor(e.length/8))!==0?null:n.jsx("text",{x:j(w),y:r-p.bottom+k+14,textAnchor:"middle",fontSize:9,fill:"#888",children:M.date},`l${w}`))]})})});Dn.displayName="NiceStockChart";const dn=Object.freeze(Object.defineProperty({__proto__:null,A:Yc,B:Qc,C:Le,D:Jc,N:zn,R:Bt,a:bi,b:An,c:Dn,d:In,e:Fn,f:En,g:yi,h:gi,i:fi,j:hi,k:mi,l:pi,m:ui,n:di,o:Lt,q:xi,s:ci,u:vi},Symbol.toStringTag,{value:"Module"})),Tn=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,displayStyle:p,value:m,defaultValue:k,onChange:b,onBlur:C,onKeyDown:_,placeholder:f,rows:v=3,maxLength:j,resize:S="vertical",autoFocus:I,showCount:M,submitOnEnter:w,onSubmit:E,showKeyboardHints:P},L)=>{const A=$e(h,d);if(A==="hidden")return null;A==="disabled"&&(r=!0),A==="readOnly"&&(s=!0);const{t:N}=Se(),x=ke(d),O=Ge("input",p),D=qe("input",p),F=(m==null?void 0:m.length)??0,y=j?F>j:!1,$={key:"Enter",ctrl:!0,description:N("shortcuts.submit","Submit")},z=o.useCallback(T=>{w&&qo(T,$)&&(T.preventDefault(),E==null||E()),_==null||_(T)},[w,E,_,$]),R=o.useMemo(()=>{const T=[];return w&&T.push($),T.push({key:"Tab",description:N("shortcuts.indent","Indent (when supported)")}),T},[w,N,$]);return n.jsxs("div",{className:`nice-field ${u||""}`,style:g,children:[e&&n.jsxs("label",{htmlFor:x,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,P&&R.length>0&&n.jsx(Oe,{shortcuts:R,size:"sm"})]}),n.jsx("textarea",{ref:L,id:x,className:`nice-textarea nice-input--${l} nice-textarea--ds-${D} ${a?"nice-textarea--error":""} ${r?"nice-textarea--disabled":""}`,style:{...O,resize:S},name:c,value:m,defaultValue:k,placeholder:f,rows:v,maxLength:j,disabled:r,readOnly:s,autoFocus:I,"aria-invalid":!!a,"aria-describedby":a?`${x}-error`:t?`${x}-helper`:void 0,onChange:T=>b==null?void 0:b(T.target.value),onBlur:C,onKeyDown:z}),(M||j)&&n.jsxs("div",{className:`nice-textarea__counter ${y?"nice-textarea__counter--over":""}`,children:[F,j?` / ${j}`:""]}),a&&n.jsx("div",{id:`${x}-error`,className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{id:`${x}-helper`,className:"nice-field__helper",children:t})]})});Tn.displayName="NiceTextArea";const Rn=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,value:p,onChange:m,onBlur:k,onKeyDown:b,min:C,max:_,type:f="date",submitOnEnter:v,onSubmit:j,showKeyboardHints:S,displayStyle:I},M)=>{Ge("input",I),qe("input",I);const w=$e(h,d);if(w==="hidden")return null;w==="disabled"&&(r=!0),w==="readOnly"&&(s=!0);const{t:E}=Se(),P=ke(d),L=jn({enabled:v,onSubmit:j}),A=o.useCallback(x=>{L(x),b==null||b(x)},[L,b]),N=o.useMemo(()=>{const x=[];return v&&x.push(Ae.submit),x.push({key:"ArrowUp",description:E("shortcuts.increaseDate","Increase value")}),x.push({key:"ArrowDown",description:E("shortcuts.decreaseDate","Decrease value")}),x},[v,E]);return n.jsxs("div",{className:`nice-field ${u||""}`,style:g,children:[e&&n.jsxs("label",{htmlFor:P,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,S&&N.length>0&&n.jsx(Oe,{shortcuts:N,size:"sm"})]}),n.jsx("div",{className:`nice-input nice-input--${l} ${a?"nice-input--error":""} ${r?"nice-input--disabled":""} ${s?"nice-input--readonly":""}`,children:n.jsx("input",{ref:M,id:P,className:"nice-input__native",type:f,name:c,value:p??"",min:C,max:_,disabled:r,readOnly:s,"aria-invalid":!!a,onChange:x=>m==null?void 0:m(x.target.value),onBlur:k,onKeyDown:A})}),a&&n.jsx("div",{className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{className:"nice-field__helper",children:t})]})});Rn.displayName="NiceDatePicker";const wi=({label:e,helperText:t,error:a,required:i,disabled:r,size:s="md",name:l,id:c,className:d,style:u,accessMode:g,options:h,value:p,onChange:m,direction:k="horizontal",showKeyboardHints:b,displayStyle:C})=>{qe("toggle",C);const _=$e(g,c);if(_==="hidden")return null;(_==="disabled"||_==="readOnly")&&(r=!0);const{t:f}=Se(),v=ke(c),j=l||v,S=o.useMemo(()=>[{key:"ArrowUp",description:f("shortcuts.previousOption","Previous option")},{key:"ArrowDown",description:f("shortcuts.nextOption","Next option")},{key:"Space",description:f("shortcuts.select","Select")}],[f]);return n.jsxs("div",{className:`nice-field ${d||""}`,style:u,role:"radiogroup","aria-labelledby":`${v}-label`,children:[e&&n.jsxs("span",{id:`${v}-label`,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,b&&n.jsx(Oe,{shortcuts:S,size:"sm"})]}),n.jsx("div",{className:`nice-radio-group ${k==="vertical"?"nice-radio-group--vertical":""}`,children:h.map(I=>n.jsxs("label",{className:`nice-radio ${r||I.disabled?"nice-radio--disabled":""}`,children:[n.jsx("input",{type:"radio",className:"nice-radio__input",name:j,value:I.value,checked:p===I.value,disabled:r||I.disabled,onChange:()=>m==null?void 0:m(I.value)}),n.jsx("span",{className:"nice-radio__circle",children:n.jsx("span",{className:"nice-radio__dot"})}),n.jsx("span",{children:I.label})]},I.value))}),a&&n.jsx("div",{className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{className:"nice-field__helper",children:t})]})},on=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,id:s,className:l,style:c,accessMode:d,value:u=0,onChange:g,min:h=0,max:p=100,step:m=1,showValue:k=!0,showMinMax:b=!1,formatValue:C,showKeyboardHints:_,displayStyle:f},v)=>{qe("input",f);const j=$e(d,s);if(j==="hidden")return null;(j==="disabled"||j==="readOnly")&&(r=!0),Se();const S=ke(s),I=o.useMemo(()=>(u-h)/(p-h)*100,[u,h,p]),M=C?C(u):u.toString(),w=o.useMemo(()=>[Ae.increment,Ae.decrement,Ae.first,Ae.last,Ae.incrementBig,Ae.decrementBig],[]);return n.jsxs("div",{className:`nice-field ${l||""}`,style:c,children:[(e||k||_)&&n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e&&n.jsxs("label",{htmlFor:S,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,_&&n.jsx(Oe,{shortcuts:w,size:"sm"})]}),k&&n.jsx("span",{className:"nice-slider__value",children:M})]}),n.jsxs("div",{className:`nice-slider ${r?"nice-slider--disabled":""}`,children:[n.jsxs("div",{className:"nice-slider__track-wrapper",children:[n.jsx("div",{className:"nice-slider__track",children:n.jsx("div",{className:"nice-slider__fill",style:{width:`${I}%`}})}),n.jsx("input",{ref:v,id:S,type:"range",className:"nice-slider__native",min:h,max:p,step:m,value:u,disabled:r,"aria-valuenow":u,"aria-valuemin":h,"aria-valuemax":p,onChange:E=>g==null?void 0:g(parseFloat(E.target.value))}),n.jsx("div",{className:"nice-slider__thumb-visual",style:{left:`${I}%`}})]}),b&&n.jsxs("div",{className:"nice-slider__labels",children:[n.jsx("span",{children:C?C(h):h}),n.jsx("span",{children:C?C(p):p})]})]}),a&&n.jsx("div",{className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{className:"nice-field__helper",children:t})]})});on.displayName="NiceSlider";function Ca(e,t,a){return Math.max(t,Math.min(a,e))}function ki({h:e,s:t,v:a}){e=(e%360+360)%360;const i=a*t,r=i*(1-Math.abs(e/60%2-1)),s=a-i;let l=0,c=0,d=0;return e<60?(l=i,c=r):e<120?(l=r,c=i):e<180?(c=i,d=r):e<240?(c=r,d=i):e<300?(l=r,d=i):(l=i,d=r),{r:Math.round((l+s)*255),g:Math.round((c+s)*255),b:Math.round((d+s)*255)}}function Pn({r:e,g:t,b:a}){e/=255,t/=255,a/=255;const i=Math.max(e,t,a),r=Math.min(e,t,a),s=i-r;let l=0;return s!==0&&(i===e?l=(t-a)/s%6:i===t?l=(a-e)/s+2:l=(e-t)/s+4,l=(l*60+360)%360),{h:l,s:i===0?0:s/i,v:i}}function Si({r:e,g:t,b:a}){e/=255,t/=255,a/=255;const i=Math.max(e,t,a),r=Math.min(e,t,a),s=(i+r)/2;if(i===r)return{h:0,s:0,l:s};const l=i-r,c=s>.5?l/(2-i-r):l/(i+r);let d=0;return i===e?d=((t-a)/l+(t<a?6:0))/6:i===t?d=((a-e)/l+2)/6:d=((e-t)/l+4)/6,{h:d*360,s:c,l:s}}function At(e){const t=e.replace("#",""),a=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,i=parseInt(a,16);return{r:i>>16&255,g:i>>8&255,b:i&255}}function Ci({r:e,g:t,b:a}){return"#"+[e,t,a].map(i=>i.toString(16).padStart(2,"0")).join("")}function Ze(e){return Ci(ki(e))}function Nt(e){return Pn(At(e))}function _i(e,t){const a=[];for(let i=0;i<t;i++){const r=t<=1?.5:i/(t-1),s=Ca(e.s*(.3+r*.7),0,1),l=Ca(e.v*(1.2-r*.7),0,1);a.push(Ze({h:e.h,s,v:l}))}return a}function Bn(e,t){const a=t??30;switch(e){case"monochromatic":return[0];case"complementary":return[0,180];case"split-complementary":return[0,180-a,180+a];case"analogous":return[0,-a,a];case"triadic":return[0,120,240];case"tetradic":return[0,60,180,240];case"square":return[0,90,180,270]}}function Et(e,t,a){return Bn(t,a).map(i=>((e+i)%360+360)%360)}function _a({r:e,g:t,b:a}){const[i,r,s]=[e,t,a].map(l=>{const c=l/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)});return .2126*i+.7152*r+.0722*s}function Gt(e,t){const a=_a(At(e)),i=_a(At(t)),r=Math.max(a,i),s=Math.min(a,i);return(r+.05)/(s+.05)}function Xt(e){return e>=7?"AAA":e>=4.5?"AA":e>=3?"AA-lg":"Fail"}const ji={"lightest-pastel":{sRange:[.1,.25],vRange:[.92,1]},"bright-pastel":{sRange:[.25,.45],vRange:[.9,1]},shiny:{sRange:[.7,.95],vRange:[.9,1]},pastel:{sRange:[.3,.55],vRange:[.75,.92]},full:{sRange:[.75,1],vRange:[.75,1]},dark:{sRange:[.6,.9],vRange:[.3,.55]},deep:{sRange:[.85,1],vRange:[.45,.65]},muted:{sRange:[.15,.35],vRange:[.5,.7]},earth:{sRange:[.3,.6],vRange:[.4,.65]}};function Qt(e,t){const a=ji[t];return e.map(i=>{const r=(a.sRange[0]+a.sRange[1])/2,s=(a.vRange[0]+a.vRange[1])/2;return Ze({h:i,s:r,v:s})})}function rd(){return Math.floor(Math.random()*360)}function Ni(e,t,a){const i=rd(),r=Et(i,e,a),s=[];for(let l=0;l<t;l++){const c=r[l%r.length],d=.55+Math.random()*.4,u=.5+Math.random()*.45;s.push(Ze({h:c+(Math.random()-.5)*8,s:d,v:u}))}return s}const od=({hues:e,baseHue:t,onBaseHueChange:a,mode:i,distance:r,disabled:s})=>{const l=o.useCallback(h=>{if(s)return;const p=h.currentTarget.getBoundingClientRect(),m=h.clientX-p.left-120,k=h.clientY-p.top-120,b=(Math.atan2(k,m)*180/Math.PI+360)%360;a(Math.round(b))},[120,120,s,a]),c=[];for(let h=0;h<360;h+=2){const p=(h-1)*Math.PI/180,m=(h+1)*Math.PI/180,k=Ze({h,s:1,v:1});c.push(n.jsx("path",{d:`M${120+55*Math.cos(p)},${120+55*Math.sin(p)} L${120+110*Math.cos(p)},${120+110*Math.sin(p)} A110,110 0 0,1 ${120+110*Math.cos(m)},${120+110*Math.sin(m)} L${120+55*Math.cos(m)},${120+55*Math.sin(m)} A55,55 0 0,0 ${120+55*Math.cos(p)},${120+55*Math.sin(p)} Z`,fill:k},h))}const d=`wheel-center-${i}`,u=e.map((h,p)=>{const m=h*Math.PI/180;return n.jsx("circle",{cx:120+82.5*Math.cos(m),cy:120+82.5*Math.sin(m),r:p===0?8:6,fill:Ze({h,s:.85,v:.9}),stroke:p===0?"#fff":"#ccc",strokeWidth:p===0?3:2},p)});let g=null;if(i==="analogous"||i==="split-complementary"){const h=Bn(i,r).slice(1).map((p,m)=>{const k=(t+p)*Math.PI/180;return n.jsx("line",{x1:120,y1:120,x2:120+82.5*Math.cos(k),y2:120+82.5*Math.sin(k),stroke:"rgba(255,255,255,0.3)",strokeWidth:1,strokeDasharray:"3,3"},`dline-${m}`)});g=n.jsx(n.Fragment,{children:h})}return n.jsxs("svg",{className:"nice-palette__wheel",viewBox:"0 0 240 240",width:240,height:240,onClick:l,style:{cursor:s?"default":"crosshair"},children:[n.jsx("defs",{children:n.jsxs("radialGradient",{id:d,children:[n.jsx("stop",{offset:"0%",stopColor:"#fff"}),n.jsx("stop",{offset:"100%",stopColor:"transparent"})]})}),c,n.jsx("circle",{cx:120,cy:120,r:53,fill:Ze({h:t,s:.6,v:.85})}),n.jsx("circle",{cx:120,cy:120,r:53,fill:`url(#${d})`,opacity:.4}),g,u]})},sd=({colors:e})=>{if(e.length<2)return null;const t=[];for(let a=0;a<e.length;a++){const i=Gt(e[a],"#ffffff"),r=Gt(e[a],"#000000");t.push({a:e[a],b:"#ffffff",ratio:i,level:Xt(i)}),t.push({a:e[a],b:"#000000",ratio:r,level:Xt(r)});for(let s=a+1;s<e.length;s++){const l=Gt(e[a],e[s]);t.push({a:e[a],b:e[s],ratio:l,level:Xt(l)})}}return n.jsxs("div",{className:"nice-palette__contrast",children:[n.jsx("div",{className:"nice-palette__section-title",children:"Contrast Analysis (WCAG 2.1)"}),n.jsx("div",{className:"nice-palette__contrast-grid",children:t.map((a,i)=>n.jsxs("div",{className:"nice-palette__contrast-pair",children:[n.jsxs("div",{className:"nice-palette__contrast-swatches",children:[n.jsx("span",{className:"nice-palette__contrast-dot",style:{background:a.a}}),n.jsx("span",{className:"nice-palette__contrast-vs",children:"vs"}),n.jsx("span",{className:"nice-palette__contrast-dot",style:{background:a.b}})]}),n.jsxs("span",{className:"nice-palette__contrast-ratio",children:[a.ratio.toFixed(1),":1"]}),n.jsx("span",{className:`nice-palette__contrast-level nice-palette__contrast-level--${a.level.toLowerCase().replace("-","")}`,children:a.level})]},i))})]})},ld=({hex:e})=>{const t=At(e),a=Si(t),i=Pn(t);return n.jsxs("div",{className:"nice-palette__color-info",children:[n.jsxs("div",{children:[n.jsx("strong",{children:"HEX"})," ",e.toUpperCase()]}),n.jsxs("div",{children:[n.jsx("strong",{children:"RGB"})," ",t.r,", ",t.g,", ",t.b]}),n.jsxs("div",{children:[n.jsx("strong",{children:"HSL"})," ",Math.round(a.h),"°, ",Math.round(a.s*100),"%,"," ",Math.round(a.l*100),"%"]}),n.jsxs("div",{children:[n.jsx("strong",{children:"HSV"})," ",Math.round(i.h),"°, ",Math.round(i.s*100),"%,"," ",Math.round(i.v*100),"%"]})]})},ja={monochromatic:"Monochromatic",complementary:"Complementary","split-complementary":"Split-Complementary",analogous:"Analogous",triadic:"Triadic",tetradic:"Tetradic (Rectangle)",square:"Square"},cd={"lightest-pastel":"Lightest Pastel","bright-pastel":"Bright Pastel",shiny:"Shiny",pastel:"Pastel",full:"Full Colors",dark:"Dark",deep:"Deep Colors",muted:"Muted",earth:"Earth Tones"},dd=["monochromatic","complementary","split-complementary","analogous","triadic","tetradic","square"],ud=["lightest-pastel","bright-pastel","shiny","pastel","full","dark","deep","muted","earth"],Ln=o.forwardRef(({id:e,className:t,style:a,accessMode:i,value:r,onChange:s,minColors:l=1,maxColors:c=8,harmonyMode:d,onHarmonyModeChange:u,distance:g,onDistanceChange:h,preset:p,onPresetChange:m,showWheel:k=!0,showContrast:b=!0,showInfo:C=!0,showPresets:_=!0,showVariations:f=!0,showRandom:v=!0,variationCount:j=5,label:S,disabled:I},M)=>{const w=$e(i,e);if(w==="hidden")return null;(w==="disabled"||w==="readOnly")&&(I=!0);const E=ke(e),[P,L]=o.useState("analogous"),[A,N]=o.useState(30),[x,O]=o.useState(""),[D,F]=o.useState(0),y=d??P,$=g??A,z=p??x,R=o.useCallback(W=>{L(W),u==null||u(W)},[u]),T=o.useCallback(W=>{N(W),h==null||h(W)},[h]),B=o.useCallback(W=>{O(W),W&&(m==null||m(W))},[m]),V=o.useMemo(()=>["#3b82f6","#ef4444","#22c55e"],[]),K=r&&r.length>0?r:V,H=K[0],q=o.useMemo(()=>Nt(H),[H]),Z=o.useMemo(()=>Et(q.h,y,$),[q.h,y,$]),Q=o.useCallback((W,G,re,ne)=>{const se=Et(W,G,re);let oe;for(ne&&ji[ne]?oe=Qt(se,ne):oe=se.map(ye=>Ze({h:ye,s:q.s||.7,v:q.v||.85}));oe.length<l;)oe.push(oe[oe.length-1]||"#888888");oe.length>c&&(oe=oe.slice(0,c)),s==null||s(oe)},[q.s,q.v,l,c,s]),J=o.useCallback(W=>{I||Q(W,y,$,z)},[I,y,$,z,Q]),ee=o.useCallback(W=>{I||(R(W),Q(q.h,W,$,z))},[I,q.h,$,z,R,Q]),ie=o.useCallback(W=>{I||(T(W),Q(q.h,y,W,z))},[I,q.h,y,z,T,Q]),pe=o.useCallback(W=>{if(I)return;B(W);const G=Et(q.h,y,$),re=Qt(G,W);s==null||s(re.slice(0,c))},[I,q.h,y,$,c,B,s]),te=o.useCallback((W,G)=>{if(I)return;const re=[...K];re[W]=G,s==null||s(re)},[I,K,s]),ue=o.useCallback(()=>{if(I||K.length>=c)return;const W=Nt(K[K.length-1]),G=Ze({h:(W.h+30)%360,s:W.s,v:W.v});s==null||s([...K,G])},[I,K,c,s]),fe=o.useCallback(W=>{if(I||K.length<=l)return;const G=K.filter((re,ne)=>ne!==W);s==null||s(G),D>=G.length&&F(Math.max(0,G.length-1))},[I,K,l,s,D]),ae=o.useCallback(()=>{if(I)return;const W=Math.max(l,Math.min(c,Bn(y).length)),G=Ni(y,W,$);s==null||s(G)},[I,l,c,y,$,s]),he=o.useMemo(()=>{if(!f)return[];const W=K[D]||K[0];return _i(Nt(W),j)},[f,K,D,j]),Y=K[D]||K[0],X=o.useMemo(()=>{const W=Nt(Y);return Ze({h:(W.h+180)%360,s:W.s,v:W.v})},[Y]);return n.jsxs("div",{ref:M,id:E,className:`nice-palette ${I?"nice-palette--disabled":""} ${t||""}`,style:a,children:[S&&n.jsx("div",{className:"nice-palette__label",children:S}),n.jsx("div",{className:"nice-palette__modes",children:dd.map(W=>n.jsx("button",{type:"button",className:`nice-palette__mode-btn ${y===W?"nice-palette__mode-btn--active":""}`,onClick:()=>ee(W),disabled:I,title:ja[W],children:ja[W]},W))}),n.jsxs("div",{className:"nice-palette__main",children:[k&&n.jsxs("div",{className:"nice-palette__wheel-container",children:[n.jsx(od,{hues:Z,baseHue:q.h,onBaseHueChange:J,mode:y,distance:$,disabled:I}),(y==="analogous"||y==="split-complementary")&&n.jsxs("div",{className:"nice-palette__distance",children:[n.jsxs("label",{children:["Distance: ",$,"°"]}),n.jsx("input",{type:"range",min:10,max:90,value:$,onChange:W=>ie(Number(W.target.value)),disabled:I,className:"nice-palette__distance-slider"})]})]}),n.jsxs("div",{className:"nice-palette__strips",children:[n.jsxs("div",{className:"nice-palette__swatches",children:[K.map((W,G)=>n.jsxs("div",{className:`nice-palette__swatch-wrapper ${D===G?"nice-palette__swatch-wrapper--selected":""}`,onClick:()=>F(G),children:[n.jsx("div",{className:"nice-palette__swatch",style:{background:W},children:K.length>l&&n.jsx("button",{type:"button",className:"nice-palette__swatch-remove",onClick:re=>{re.stopPropagation(),fe(G)},disabled:I,"aria-label":"Remove color",children:"×"})}),n.jsx("input",{type:"text",className:"nice-palette__hex-input",value:W.toUpperCase(),maxLength:7,disabled:I,onChange:re=>te(G,re.target.value)})]},G)),K.length<c&&n.jsx("button",{type:"button",className:"nice-palette__add-btn",onClick:ue,disabled:I,title:"Add color",children:"+"})]}),n.jsxs("div",{className:"nice-palette__complementary",children:[n.jsx("span",{className:"nice-palette__section-tag",children:"Complementary"}),n.jsx("div",{className:"nice-palette__swatch nice-palette__swatch--sm",style:{background:X},title:X.toUpperCase()}),n.jsx("span",{className:"nice-palette__hex-label",children:X.toUpperCase()})]}),f&&he.length>0&&n.jsxs("div",{className:"nice-palette__variations",children:[n.jsx("span",{className:"nice-palette__section-tag",children:"Tints & Shades"}),n.jsx("div",{className:"nice-palette__variation-strip",children:he.map((W,G)=>n.jsx("div",{className:"nice-palette__variation-chip",style:{background:W},title:W.toUpperCase(),onClick:()=>{I||te(D,W)},role:"button",tabIndex:0},G))})]}),v&&n.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-palette__random-btn",onClick:ae,disabled:I,title:"Random palette","aria-label":"Random palette",children:"🎲 Random Palette"})]})]}),_&&n.jsxs("div",{className:"nice-palette__presets",children:[n.jsx("div",{className:"nice-palette__section-title",children:"Style Presets"}),n.jsx("div",{className:"nice-palette__preset-grid",children:ud.map(W=>{const G=Qt(Z,W);return n.jsxs("button",{type:"button",className:`nice-palette__preset-card ${z===W?"nice-palette__preset-card--active":""}`,onClick:()=>pe(W),disabled:I,children:[n.jsx("div",{className:"nice-palette__preset-strip",children:G.map((re,ne)=>n.jsx("span",{className:"nice-palette__preset-dot",style:{background:re}},ne))}),n.jsx("span",{className:"nice-palette__preset-label",children:cd[W]})]},W)})})]}),C&&n.jsxs("div",{className:"nice-palette__info-panel",children:[n.jsx("div",{className:"nice-palette__section-title",children:"Selected Color Info"}),n.jsx(ld,{hex:Y})]}),b&&n.jsx(sd,{colors:K})]})});Ln.displayName="NiceColorPalette";function bn(){return{type:"linear",angle:90,stops:[{color:"#3b82f6",position:0},{color:"#8b5cf6",position:100}]}}function xn(e){const t=e.stops.slice().sort((i,r)=>i.position-r.position).map(i=>`${i.color} ${i.position}%`).join(", "),a=e.repeating?"repeating-":"";switch(e.type){case"linear":return`${a}linear-gradient(${e.angle}deg, ${t})`;case"radial":{const i=e.shape||"ellipse",r=e.size||"farthest-corner",s=e.positionX??50,l=e.positionY??50;return`${a}radial-gradient(${i} ${r} at ${s}% ${l}%, ${t})`}case"conic":{const i=e.angle??0,r=e.positionX??50,s=e.positionY??50;return`${a}conic-gradient(from ${i}deg at ${r}% ${s}%, ${t})`}}}function Mi(e){var i,r,s;const t=e.trim(),a=t.startsWith("repeating-");if(t.includes("linear-gradient")){const l=(i=t.match(/linear-gradient\((.+)\)/))==null?void 0:i[1];if(!l)return null;const c=l.split(",").map(p=>p.trim());let d=90,u=0;const g=c[0].match(/^(\d+)deg$/);g&&(d=parseInt(g[1]),u=1);const h=un(c.slice(u));return{type:"linear",angle:d,repeating:a,stops:h}}if(t.includes("radial-gradient")){const l=(r=t.match(/radial-gradient\((.+)\)/))==null?void 0:r[1];if(!l)return null;const c=l.split(",").map(u=>u.trim()),d=un(c.filter(u=>u.includes("#")||u.includes("rgb")));return{type:"radial",angle:0,repeating:a,stops:d.length>=2?d:bn().stops}}if(t.includes("conic-gradient")){const l=(s=t.match(/conic-gradient\((.+)\)/))==null?void 0:s[1];if(!l)return null;const c=l.split(",").map(u=>u.trim()),d=un(c.filter(u=>u.includes("#")||u.includes("rgb")));return{type:"conic",angle:0,repeating:a,stops:d.length>=2?d:bn().stops}}return null}function un(e){return e.map((t,a,i)=>{const r=t.match(/^(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\))\s*(\d+%?)?$/);if(r){const s=r[2]?parseFloat(r[2]):a/Math.max(1,i.length-1)*100;return{color:r[1],position:s}}return{color:t,position:a/Math.max(1,i.length-1)*100}})}function pd(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}function md(e=2){const t=["linear","radial","conic"],a=t[Math.floor(Math.random()*t.length)],i=[];for(let r=0;r<e;r++)i.push({color:pd(),position:Math.round(r/(e-1)*100)});return{type:a,angle:Math.floor(Math.random()*360),stops:i,shape:a==="radial"?Math.random()>.5?"circle":"ellipse":void 0,positionX:a!=="linear"?Math.round(Math.random()*100):void 0,positionY:a!=="linear"?Math.round(Math.random()*100):void 0}}const $i=[{name:"Sunset",value:{type:"linear",angle:135,stops:[{color:"#ff6b6b",position:0},{color:"#feca57",position:100}]}},{name:"Ocean",value:{type:"linear",angle:180,stops:[{color:"#667eea",position:0},{color:"#764ba2",position:100}]}},{name:"Forest",value:{type:"linear",angle:120,stops:[{color:"#11998e",position:0},{color:"#38ef7d",position:100}]}},{name:"Fire",value:{type:"linear",angle:90,stops:[{color:"#f12711",position:0},{color:"#f5af19",position:100}]}},{name:"Aurora",value:{type:"linear",angle:135,stops:[{color:"#a18cd1",position:0},{color:"#fbc2eb",position:50},{color:"#a6c1ee",position:100}]}},{name:"Midnight",value:{type:"linear",angle:180,stops:[{color:"#0f0c29",position:0},{color:"#302b63",position:50},{color:"#24243e",position:100}]}},{name:"Candy",value:{type:"linear",angle:45,stops:[{color:"#fc5c7d",position:0},{color:"#6a82fb",position:100}]}},{name:"Radial Glow",value:{type:"radial",angle:0,shape:"circle",stops:[{color:"#ffecd2",position:0},{color:"#fcb69f",position:100}],positionX:50,positionY:50}},{name:"Rainbow",value:{type:"conic",angle:0,stops:[{color:"#ff0000",position:0},{color:"#ff8800",position:17},{color:"#ffff00",position:33},{color:"#00ff00",position:50},{color:"#0088ff",position:67},{color:"#8800ff",position:83},{color:"#ff0000",position:100}],positionX:50,positionY:50}}],On=o.forwardRef(({id:e,className:t,style:a,accessMode:i,value:r,onChange:s,showCssOutput:l=!0,showPresets:c=!0,showRandom:d=!0,maxStops:u=10,label:g,disabled:h},p)=>{const m=$e(i,e);if(m==="hidden")return null;(m==="disabled"||m==="readOnly")&&(h=!0);const k=ke(e),b=r??bn(),C=o.useMemo(()=>xn(b),[b]),[_,f]=o.useState(0),[v,j]=o.useState(""),S=o.useRef(null),I=o.useCallback(y=>{s==null||s(y)},[s]),M=o.useCallback(y=>{h||I({...b,type:y})},[h,b,I]),w=o.useCallback(y=>{h||I({...b,angle:y})},[h,b,I]),E=o.useCallback(y=>{h||I({...b,repeating:y})},[h,b,I]),P=o.useCallback(y=>{h||I({...b,shape:y})},[h,b,I]),L=o.useCallback((y,$)=>{if(h)return;const z=b.stops.map((R,T)=>T===y?{...R,...$}:R);I({...b,stops:z})},[h,b,I]),A=o.useCallback(()=>{if(h||b.stops.length>=u)return;const y=b.stops.slice().sort((B,V)=>B.position-V.position);let $=0,z=y[0];for(let B=0;B<y.length-1;B++){const V=y[B+1].position-y[B].position;V>$&&($=V,z=y[B])}const R=Math.round(z.position+$/2),T="#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0");I({...b,stops:[...b.stops,{color:T,position:R}]})},[h,b,u,I]),N=o.useCallback(y=>{if(h||b.stops.length<=2)return;const $=b.stops.filter((z,R)=>R!==y);I({...b,stops:$}),_>=$.length&&f($.length-1)},[h,b,_,I]),x=o.useCallback(()=>{if(h)return;const y=2+Math.floor(Math.random()*3);I(md(y))},[h,I]),O=o.useCallback(()=>{if(h||!v.trim())return;const y=Mi(v);y&&I(y)},[h,v,I]),D=o.useCallback(y=>{if(h||!S.current||b.stops.length>=u)return;const $=S.current.getBoundingClientRect(),z=Math.round((y.clientX-$.left)/$.width*100),R="#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0"),T=[...b.stops,{color:R,position:z}];I({...b,stops:T}),f(T.length-1)},[h,b,u,I]),F=o.useMemo(()=>b.stops.slice().sort((y,$)=>y.position-$.position),[b.stops]);return n.jsxs("div",{ref:p,id:k,className:`nice-gradient ${h?"nice-gradient--disabled":""} ${t||""}`,style:a,children:[g&&n.jsx("div",{className:"nice-gradient__label",children:g}),n.jsx("div",{className:"nice-gradient__preview",style:{background:C}}),n.jsxs("div",{className:"nice-gradient__type-row",children:[["linear","radial","conic"].map(y=>n.jsx("button",{type:"button",className:`nice-gradient__type-btn ${b.type===y?"nice-gradient__type-btn--active":""}`,onClick:()=>M(y),disabled:h,children:y.charAt(0).toUpperCase()+y.slice(1)},y)),n.jsxs("label",{className:"nice-gradient__repeat-label",children:[n.jsx("input",{type:"checkbox",checked:b.repeating??!1,onChange:y=>E(y.target.checked),disabled:h}),"Repeating"]})]}),n.jsxs("div",{className:"nice-gradient__controls",children:[b.type==="linear"&&n.jsxs("div",{className:"nice-gradient__control-group",children:[n.jsxs("label",{children:["Angle: ",b.angle,"°"]}),n.jsx("input",{type:"range",min:0,max:360,value:b.angle,onChange:y=>w(Number(y.target.value)),disabled:h,className:"nice-gradient__slider"}),n.jsx("div",{className:"nice-gradient__angle-presets",children:[0,45,90,135,180,225,270,315].map(y=>n.jsx("button",{type:"button",className:`nice-gradient__angle-btn ${b.angle===y?"nice-gradient__angle-btn--active":""}`,onClick:()=>w(y),disabled:h,title:`${y}°`,children:n.jsx("span",{style:{transform:`rotate(${y}deg)`,display:"inline-block"},children:"→"})},y))})]}),b.type==="radial"&&n.jsxs("div",{className:"nice-gradient__control-group",children:[n.jsx("label",{children:"Shape:"}),n.jsx("div",{className:"nice-gradient__shape-btns",children:["circle","ellipse"].map(y=>n.jsx("button",{type:"button",className:`nice-gradient__shape-btn ${(b.shape||"ellipse")===y?"nice-gradient__shape-btn--active":""}`,onClick:()=>P(y),disabled:h,children:y},y))})]}),(b.type==="radial"||b.type==="conic")&&n.jsxs("div",{className:"nice-gradient__control-group",children:[n.jsxs("label",{children:["Center: ",b.positionX??50,"%, ",b.positionY??50,"%"]}),n.jsxs("div",{className:"nice-gradient__center-inputs",children:[n.jsx("input",{type:"range",min:0,max:100,value:b.positionX??50,onChange:y=>I({...b,positionX:Number(y.target.value)}),disabled:h,className:"nice-gradient__slider"}),n.jsx("input",{type:"range",min:0,max:100,value:b.positionY??50,onChange:y=>I({...b,positionY:Number(y.target.value)}),disabled:h,className:"nice-gradient__slider"})]})]}),b.type==="conic"&&n.jsxs("div",{className:"nice-gradient__control-group",children:[n.jsxs("label",{children:["Start angle: ",b.angle,"°"]}),n.jsx("input",{type:"range",min:0,max:360,value:b.angle,onChange:y=>w(Number(y.target.value)),disabled:h,className:"nice-gradient__slider"})]})]}),n.jsxs("div",{className:"nice-gradient__bar-container",children:[n.jsx("div",{ref:S,className:"nice-gradient__bar",style:{background:C},onClick:D,children:b.stops.map((y,$)=>n.jsx("div",{className:`nice-gradient__stop-marker ${_===$?"nice-gradient__stop-marker--active":""}`,style:{left:`${y.position}%`},onClick:z=>{z.stopPropagation(),f($)},title:`${y.color} @ ${y.position}%`,children:n.jsx("div",{className:"nice-gradient__stop-dot",style:{background:y.color}})},$))}),n.jsx("button",{type:"button",className:"nice-gradient__add-stop",onClick:A,disabled:h||b.stops.length>=u,title:"Add stop",children:"+"})]}),n.jsx("div",{className:"nice-gradient__stop-editor",children:n.jsx("div",{className:"nice-gradient__stop-list",children:F.map((y,$)=>{const z=b.stops.indexOf(y);return n.jsxs("div",{className:`nice-gradient__stop-row ${_===z?"nice-gradient__stop-row--active":""}`,onClick:()=>f(z),children:[n.jsx("input",{type:"color",value:y.color,onChange:R=>L(z,{color:R.target.value}),disabled:h,className:"nice-gradient__stop-color"}),n.jsx("input",{type:"text",value:y.color.toUpperCase(),maxLength:7,onChange:R=>L(z,{color:R.target.value}),disabled:h,className:"nice-gradient__stop-hex"}),n.jsx("input",{type:"number",min:0,max:100,value:y.position,onChange:R=>L(z,{position:Number(R.target.value)}),disabled:h,className:"nice-gradient__stop-pos"}),n.jsx("span",{className:"nice-gradient__stop-pct",children:"%"}),b.stops.length>2&&n.jsx("button",{type:"button",className:"nice-gradient__stop-del",onClick:()=>N(z),disabled:h,"aria-label":"Remove stop",children:"×"})]},z)})})}),d&&n.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-gradient__random-btn",onClick:x,disabled:h,title:"Random gradient","aria-label":"Random gradient",children:"🎲 Random Gradient"}),c&&n.jsxs("div",{className:"nice-gradient__presets",children:[n.jsx("div",{className:"nice-gradient__section-title",children:"Presets"}),n.jsx("div",{className:"nice-gradient__preset-grid",children:$i.map((y,$)=>n.jsxs("button",{type:"button",className:"nice-gradient__preset-card",onClick:()=>{h||I(y.value)},disabled:h,title:y.name,children:[n.jsx("div",{className:"nice-gradient__preset-preview",style:{background:xn(y.value)}}),n.jsx("span",{className:"nice-gradient__preset-name",children:y.name})]},$))})]}),l&&n.jsxs("div",{className:"nice-gradient__css",children:[n.jsx("div",{className:"nice-gradient__section-title",children:"CSS Output"}),n.jsxs("div",{className:"nice-gradient__css-output",children:[n.jsx("code",{children:`background: ${C};`}),n.jsx("button",{type:"button",className:"nice-gradient__copy-btn",onClick:()=>{var y;return(y=navigator.clipboard)==null?void 0:y.writeText(`background: ${C};`)},title:"Copy CSS",children:"📋"})]}),n.jsxs("div",{className:"nice-gradient__css-import",children:[n.jsx("input",{type:"text",className:"nice-gradient__css-input",placeholder:"Paste CSS gradient to import...",value:v,onChange:y=>j(y.target.value),disabled:h}),n.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",onClick:O,disabled:h,children:"Import"})]})]})]})});On.displayName="NiceGradientPicker";function hd({text:e,query:t}){if(!t)return n.jsx(n.Fragment,{children:e});const a=e.toLowerCase().indexOf(t.toLowerCase());return a<0?n.jsx(n.Fragment,{children:e}):n.jsxs(n.Fragment,{children:[e.slice(0,a),n.jsx("strong",{children:e.slice(a,a+t.length)}),e.slice(a+t.length)]})}const Ei=({options:e,value:t,onChange:a,minSearchLength:i=1,maxResults:r=10,onSearch:s,clearable:l,loading:c,multiple:d,renderOption:u,highlightMatch:g=!0,label:h,error:p,helperText:m,required:k,disabled:b,size:C="md",id:_,className:f,style:v,accessMode:j,showKeyboardHints:S,displayStyle:I})=>{Ge("input",I),qe("input",I);const M=$e(j,_);if(M==="hidden")return null;(M==="disabled"||M==="readOnly")&&(b=!0);const w=ke(_),{t:E}=Se(),P=o.useMemo(()=>d?Array.isArray(t)?t:t?[t]:[]:[],[t,d]),[L,A]=o.useState(d||Array.isArray(t)?"":t),[N,x]=o.useState(!1),[O,D]=o.useState(-1),F=o.useRef(null),y=o.useRef(null);ot(F,()=>x(!1));const $=o.useMemo(()=>{const H=[Ae.moveDown,Ae.moveUp,Ae.submit,Ae.cancel];return d&&H.push({key:"Backspace",description:E("shortcuts.removeLastTag","Remove last tag")}),H},[d,E]);o.useEffect(()=>{d||A(Array.isArray(t)?"":t)},[t,d]);const z=o.useMemo(()=>{if(L.length<i)return[];if(s)return e.slice(0,r);const H=L.toLowerCase();return e.filter(q=>q.label.toLowerCase().includes(H)).slice(0,r)},[e,L,i,r,s]),R=o.useMemo(()=>{const H=new Map;for(const q of z){const Z=q.group||"";H.has(Z)||H.set(Z,[]),H.get(Z).push(q)}return H},[z]),T=o.useCallback(H=>{A(H),x(H.length>=i),D(-1),s==null||s(H)},[i,s]),B=o.useCallback(H=>{if(d){const q=String(H.value),Z=P.includes(q)?P.filter(Q=>Q!==q):[...P,q];a==null||a(Z),A("")}else A(H.label),a==null||a(String(H.value)),x(!1)},[a,d,P]),V=H=>{if(d&&H.key==="Backspace"&&!L&&P.length>0){a==null||a(P.slice(0,-1));return}N&&(H.key==="ArrowDown"?(H.preventDefault(),D(q=>Math.min(q+1,z.length-1))):H.key==="ArrowUp"?(H.preventDefault(),D(q=>Math.max(q-1,0))):H.key==="Enter"&&O>=0?(H.preventDefault(),B(z[O])):H.key==="Escape"&&x(!1))},K=o.useCallback(H=>{a==null||a(P.filter(q=>q!==H))},[P,a]);return n.jsxs("div",{className:`nice-field nice-field--${C} ${p?"nice-field--error":""} ${f||""}`,style:v,ref:F,children:[h&&n.jsxs("label",{className:"nice-field__label",htmlFor:w,children:[h,k&&n.jsx("span",{className:"nice-field__required",children:"*"}),S&&n.jsx(Oe,{shortcuts:$,size:"sm"})]}),n.jsxs("div",{className:"nice-field__input-wrap",style:d?{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"}:void 0,children:[d&&P.map(H=>{const q=e.find(Z=>String(Z.value)===H);return n.jsxs("span",{className:"nice-autocomplete__tag",children:[(q==null?void 0:q.label)||H,n.jsx("button",{type:"button",className:"nice-autocomplete__tag-remove",onClick:()=>K(H),children:"✕"})]},H)}),n.jsx("input",{ref:y,id:w,type:"text",className:"nice-input",value:L,onChange:H=>T(H.target.value),onFocus:()=>L.length>=i&&x(!0),onKeyDown:V,disabled:b,required:k,role:"combobox","aria-expanded":N,"aria-autocomplete":"list",autoComplete:"off",style:d?{flex:1,minWidth:60,border:"none",outline:"none"}:void 0}),l&&!d&&L&&!b&&n.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>{A(""),a==null||a("")},"aria-label":E("controls.clear","Clear"),children:"✕"}),c&&n.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)"}})]}),N&&z.length>0&&n.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:Array.from(R.entries()).map(([H,q])=>n.jsxs(o.Fragment,{children:[H&&n.jsx("li",{className:"nice-dropdown__group-label",children:H}),q.map(Z=>{const Q=z.indexOf(Z)===O,J=d&&P.includes(String(Z.value));return n.jsx("li",{role:"option",className:`nice-dropdown__option ${Q?"nice-dropdown__option--active":""} ${J?"nice-dropdown__option--selected":""}`,onMouseDown:ee=>{ee.preventDefault(),B(Z)},"aria-selected":Q,children:u?u(Z,L):g?n.jsx(hd,{text:Z.label,query:L}):Z.label},String(Z.value))})]},H))}),p&&n.jsx("div",{className:"nice-field__error",children:p}),m&&!p&&n.jsx("div",{className:"nice-field__hint",children:m})]})},zi=({options:e,value:t,onChange:a,searchable:i=!0,clearable:r,loading:s,placeholder:l,label:c,error:d,helperText:u,required:g,disabled:h,size:p="md",id:m,className:k,style:b})=>{const C=ke(m),{t:_}=Se(),[f,v]=o.useState(!1),[j,S]=o.useState(""),I=o.useRef(null);ot(I,()=>v(!1));const M=e.find(E=>String(E.value)===t),w=o.useMemo(()=>{if(!j)return e;const E=j.toLowerCase();return e.filter(P=>P.label.toLowerCase().includes(E))},[e,j]);return n.jsxs("div",{className:`nice-field nice-field--${p} ${d?"nice-field--error":""} ${k||""}`,style:b,ref:I,children:[c&&n.jsxs("label",{className:"nice-field__label",htmlFor:C,children:[c,g&&n.jsx("span",{className:"nice-field__required",children:"*"})]}),n.jsxs("div",{className:"nice-field__input-wrap",children:[n.jsxs("button",{type:"button",id:C,className:"nice-select__trigger",onClick:()=>!h&&v(!f),disabled:h,children:[n.jsx("span",{children:(M==null?void 0:M.label)||l||_("controls.select","Select...")}),n.jsx("span",{className:"nice-select__arrow",children:"▾"})]}),r&&t&&!h&&n.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>a(""),"aria-label":_("controls.clear","Clear"),children:"✕"})]}),f&&n.jsxs("div",{className:"nice-dropdown",children:[i&&n.jsx("div",{className:"nice-dropdown__search",children:n.jsx("input",{type:"text",value:j,onChange:E=>S(E.target.value),placeholder:_("controls.search","Search..."),autoFocus:!0})}),n.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:w.length===0?n.jsx("li",{className:"nice-dropdown__empty",children:_("controls.noResults","No results")}):w.map(E=>n.jsx("li",{role:"option",className:`nice-dropdown__option ${String(E.value)===t?"nice-dropdown__option--selected":""}`,onClick:()=>{a(String(E.value)),v(!1),S("")},"aria-selected":String(E.value)===t,children:E.label},String(E.value)))})]}),d&&n.jsx("div",{className:"nice-field__error",children:d}),u&&!d&&n.jsx("div",{className:"nice-field__hint",children:u})]})},fd=["Su","Mo","Tu","We","Th","Fr","Sa"];function gd(e,t){return new Date(e,t+1,0).getDate()}function yd(e,t){return new Date(e,t,1).getDay()}function Na(e,t,a){return`${e}-${String(t+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`}function bd(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()));t.setUTCDate(t.getUTCDate()+4-(t.getUTCDay()||7));const a=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-a.getTime())/864e5+1)/7)}const Ma=["January","February","March","April","May","June","July","August","September","October","November","December"],sn=({value:e,onChange:t,min:a,max:i,disabledDates:r=[],firstDayOfWeek:s=1,size:l="md",showWeekNumbers:c,onMonthChange:d,className:u,style:g,accessMode:h,id:p,multiple:m,selectedDates:k=[],onSelectedDatesChange:b,renderDay:C,showKeyboardHints:_,persistPreferences:f=!1,cookies:v=!1,localStorage:j=!0,sessionStorage:S=!1,storageMode:I,storageKey:M})=>{const w=$e(h,p);if(w==="hidden")return null;const E=w==="disabled"||w==="readOnly",{t:P}=Se(),L=new Date,A=e?new Date(e):L,N=Ja(M??"nice-calendar"),x=o.useMemo(()=>f?N.get("prefs")??{}:{},[f,N]),O=x.firstDayOfWeek??s,[D,F]=o.useState(x.lastViewYear??A.getFullYear()),[y,$]=o.useState(x.lastViewMonth??A.getMonth()),[z,R]=o.useState(x.preferredView??"days"),T=o.useCallback(G=>{if(!f)return;const re=N.get("prefs")??{};N.set("prefs",{...re,...G})},[f,N]),B=o.useCallback(G=>{R(G),T({preferredView:G})},[T]),V=o.useCallback((G,re)=>{T({lastViewYear:G,lastViewMonth:re})},[T]),K=o.useMemo(()=>[Ae.moveUp,Ae.moveDown,Ae.moveLeft,Ae.moveRight,{key:"Enter",description:P("shortcuts.selectDate","Select date")},Ae.pageUp,Ae.pageDown],[P]),H=o.useMemo(()=>gd(D,y),[D,y]),q=o.useMemo(()=>(yd(D,y)-O+7)%7,[D,y,O]),Z=o.useMemo(()=>{const G=[...fd];for(let re=0;re<O;re++)G.push(G.shift());return G},[O]),Q=o.useCallback(G=>a&&G<a||i&&G>i?!0:r.includes(G),[a,i,r]),J=o.useCallback(G=>{if(z==="years"){F(se=>se+G*10);return}if(z==="months"){F(se=>se+G);return}let re=y+G,ne=D;re<0&&(re=11,ne--),re>11&&(re=0,ne++),$(re),F(ne),V(ne,re),d==null||d(ne,re)},[y,D,d,z,V]),ee=Na(L.getFullYear(),L.getMonth(),L.getDate()),ie=o.useCallback(G=>m?k.includes(G):G===e,[m,k,e]),pe=o.useCallback(G=>{if(!E){if(m){const re=k.includes(G)?k.filter(ne=>ne!==G):[...k,G];b==null||b(re)}t==null||t(G)}},[m,k,t,b]),te=o.useCallback(()=>{z==="days"?B("months"):z==="months"&&B("years")},[z,B]),ue=o.useCallback(G=>{$(G),B("days"),V(D,G),d==null||d(D,G)},[D,d,B,V]),fe=o.useCallback(G=>{F(G),B("months")},[B]),ae=z==="years"?`${D-D%10} – ${D-D%10+9}`:z==="months"?`${D}`:`${Ma[y]} ${D}`,he=z==="years"?"decade":z==="months"?"year":"month",Y=[];for(let G=0;G<q;G++)Y.push(null);for(let G=1;G<=H;G++)Y.push(G);for(;Y.length%7!==0;)Y.push(null);const X=[];for(let G=0;G<Y.length;G+=7)X.push(Y.slice(G,G+7));const W=D-D%10;return n.jsxs("div",{className:`nice-calendar nice-calendar--${l} ${u||""}`,style:g,children:[n.jsxs("div",{className:"nice-calendar__header",children:[n.jsx("button",{type:"button",className:"nice-calendar__nav",onClick:()=>J(-1),"aria-label":`Previous ${he}`,children:"‹"}),n.jsx("button",{type:"button",className:"nice-calendar__title",onClick:te,"aria-label":z==="days"?"Show month picker":z==="months"?"Show year picker":void 0,disabled:z==="years",children:ae}),n.jsx("button",{type:"button",className:"nice-calendar__nav",onClick:()=>J(1),"aria-label":`Next ${he}`,children:"›"}),_&&n.jsx(Oe,{shortcuts:K,size:"sm"})]}),z==="days"&&n.jsxs("table",{className:"nice-calendar__grid",role:"grid",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[c&&n.jsx("th",{className:"nice-calendar__wk",children:"W"}),Z.map(G=>n.jsx("th",{children:G},G))]})}),n.jsx("tbody",{children:X.map((G,re)=>n.jsxs("tr",{children:[c&&n.jsx("td",{className:"nice-calendar__wk",children:G.find(ne=>ne!=null)?bd(new Date(D,y,G.find(ne=>ne!=null))):""}),G.map((ne,se)=>{if(ne==null)return n.jsx("td",{className:"nice-calendar__empty-cell"},se);const oe=Na(D,y,ne),ye=Q(oe),ge=ie(oe);return n.jsx("td",{className:`nice-calendar__day${ge?" nice-calendar__day--selected":""}${oe===ee?" nice-calendar__day--today":""}${ye?" nice-calendar__day--disabled":""}`,onClick:()=>!ye&&pe(oe),role:"gridcell","aria-selected":ge,"aria-disabled":ye,children:C?C(oe,ne):ne},se)})]},re))})]}),z==="months"&&n.jsx("div",{className:"nice-calendar__picker-grid",children:Ma.map((G,re)=>n.jsx("button",{type:"button",className:`nice-calendar__picker-cell${re===y&&D===A.getFullYear()?" nice-calendar__picker-cell--selected":""}`,onClick:()=>ue(re),children:G.slice(0,3)},re))}),z==="years"&&n.jsx("div",{className:"nice-calendar__picker-grid",children:Array.from({length:12},(G,re)=>W-1+re).map(G=>n.jsx("button",{type:"button",className:`nice-calendar__picker-cell${G===D?" nice-calendar__picker-cell--selected":""}${G<W||G>W+9?" nice-calendar__picker-cell--other":""}`,onClick:()=>fe(G),children:G},G))})]})};sn.displayName="NiceCalendar";const Ai=({startDate:e,endDate:t,onStartChange:a,onEndChange:i,min:r,max:s,clearable:l,placeholder:c,startPlaceholder:d,endPlaceholder:u,label:g,error:h,helperText:p,required:m,disabled:k,size:b="md",id:C,className:_,style:f,accessMode:v,showKeyboardHints:j})=>{const S=$e(v,C);if(S==="hidden")return null;(S==="disabled"||S==="readOnly")&&(k=!0);const I=ke(C),{t:M}=Se(),[w,E]=o.useState(null),P=o.useRef(null);ot(P,()=>E(null));const L=o.useMemo(()=>[{key:"Tab",description:M("shortcuts.switchField","Switch between start/end")},Ae.cancel],[M]),A=o.useCallback(x=>{a(x),(!t||x>t)&&i(x),E("end")},[a,i,t]),N=o.useCallback(x=>{i(x),E(null)},[i]);return n.jsxs("div",{className:`nice-field nice-field--${b} ${h?"nice-field--error":""} ${_||""}`,style:f,ref:P,children:[g&&n.jsxs("label",{className:"nice-field__label",htmlFor:I,children:[g,m&&n.jsx("span",{className:"nice-field__required",children:"*"}),j&&n.jsx(Oe,{shortcuts:L,size:"sm"})]}),n.jsxs("div",{className:"nice-daterange",children:[n.jsx("input",{id:I,type:"text",className:"nice-input nice-daterange__start",value:e,readOnly:!0,placeholder:d||M("controls.startDate","Start date"),onClick:()=>!k&&E("start"),disabled:k}),n.jsx("span",{className:"nice-daterange__separator",children:"–"}),n.jsx("input",{type:"text",className:"nice-input nice-daterange__end",value:t,readOnly:!0,placeholder:u||M("controls.endDate","End date"),onClick:()=>!k&&E("end"),disabled:k}),l&&(e||t)&&!k&&n.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>{a(""),i("")},"aria-label":M("controls.clear","Clear"),children:"✕"})]}),w&&n.jsx("div",{className:"nice-daterange__popup",children:n.jsx(sn,{value:w==="start"?e:t,onChange:w==="start"?A:N,min:w==="end"&&e?e:r,max:s,size:b})}),h&&n.jsx("div",{className:"nice-field__error",children:h}),p&&!h&&n.jsx("div",{className:"nice-field__hint",children:p})]})},Fi=({options:e,value:t,onChange:a,searchable:i=!0,clearable:r,maxTags:s,allowCustom:l,placeholder:c,label:d,error:u,helperText:g,required:h,disabled:p,size:m="md",id:k,className:b,style:C,accessMode:_,showKeyboardHints:f})=>{const v=$e(_,k);if(v==="hidden")return null;(v==="disabled"||v==="readOnly")&&(p=!0);const j=ke(k),{t:S}=Se(),[I,M]=o.useState(!1),[w,E]=o.useState(""),P=o.useRef(null),L=o.useRef(null);ot(P,()=>M(!1));const A=o.useMemo(()=>[Ae.submit,Ae.cancel,{key:"Backspace",description:S("shortcuts.removeLastTag","Remove last tag")}],[S]),N=o.useMemo(()=>{let y=e.filter($=>!t.includes(String($.value)));if(w){const $=w.toLowerCase();y=y.filter(z=>z.label.toLowerCase().includes($))}return y},[e,t,w]),x=o.useCallback(y=>{s&&t.length>=s||(t.includes(y)||a([...t,y]),E(""))},[t,a,s]),O=o.useCallback(y=>{a(t.filter($=>$!==y))},[t,a]),D=y=>{y.key==="Backspace"&&!w&&t.length>0?O(t[t.length-1]):y.key==="Enter"&&w?(y.preventDefault(),N.length>0?x(String(N[0].value)):l&&x(w)):y.key==="Escape"&&M(!1)},F=y=>{var $;return(($=e.find(z=>String(z.value)===y))==null?void 0:$.label)??y};return n.jsxs("div",{className:`nice-field nice-field--${m} ${u?"nice-field--error":""} ${b||""}`,style:C,ref:P,children:[d&&n.jsxs("label",{className:"nice-field__label",htmlFor:j,children:[d,h&&n.jsx("span",{className:"nice-field__required",children:"*"}),f&&n.jsx(Oe,{shortcuts:A,size:"sm"})]}),n.jsxs("div",{className:"nice-tagbox",onClick:()=>{var y;p||(M(!0),(y=L.current)==null||y.focus())},children:[n.jsxs("div",{className:"nice-tagbox__tags",children:[t.map(y=>n.jsxs("span",{className:"nice-tag nice-tagbox__tag",children:[F(y),!p&&n.jsx("button",{type:"button",className:"nice-tag__remove",onClick:$=>{$.stopPropagation(),O(y)},children:"✕"})]},y)),i&&n.jsx("input",{ref:L,id:j,type:"text",className:"nice-tagbox__input",value:w,onChange:y=>{E(y.target.value),M(!0)},onFocus:()=>M(!0),onKeyDown:D,placeholder:t.length===0?c||S("controls.select","Select..."):"",disabled:p,autoComplete:"off"})]}),r&&t.length>0&&!p&&n.jsx("button",{type:"button",className:"nice-field__clear",onClick:y=>{y.stopPropagation(),a([])},"aria-label":S("controls.clear","Clear"),children:"✕"})]}),I&&N.length>0&&n.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:N.map(y=>n.jsx("li",{role:"option",className:"nice-dropdown__option",onMouseDown:$=>{$.preventDefault(),x(String(y.value))},children:y.label},String(y.value)))}),u&&n.jsx("div",{className:"nice-field__error",children:u}),g&&!u&&n.jsx("div",{className:"nice-field__hint",children:g})]})},Ii=({min:e=0,max:t=100,step:a=1,startValue:i,endValue:r,onChange:s,showLabels:l=!0,formatLabel:c,label:d,error:u,helperText:g,required:h,disabled:p,size:m="md",id:k,className:b,style:C,accessMode:_,showKeyboardHints:f})=>{const v=$e(_,k);if(v==="hidden")return null;(v==="disabled"||v==="readOnly")&&(p=!0);const{t:j}=Se(),S=ke(k),I=o.useRef(null),M=o.useMemo(()=>[Ae.increment,Ae.decrement,Ae.first,Ae.last,{key:"Tab",description:j("shortcuts.switchThumb","Switch thumb")}],[j]),w=A=>(A-e)/(t-e)*100,E=A=>c?c(A):String(A),P=A=>{const N=Math.round(A/a)*a;return Math.max(e,Math.min(t,N))},L=o.useCallback((A,N)=>{A.preventDefault();const x=I.current;if(!x||p)return;const O=F=>{const y=x.getBoundingClientRect(),$=Math.max(0,Math.min(1,(F.clientX-y.left)/y.width)),z=P(e+$*(t-e));N==="start"?s(Math.min(z,r),r):s(i,Math.max(z,i))},D=()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",D)};document.addEventListener("pointermove",O),document.addEventListener("pointerup",D)},[e,t,a,i,r,s,p]);return n.jsxs("div",{className:`nice-field nice-field--${m} ${u?"nice-field--error":""} ${b||""}`,style:C,children:[d&&n.jsxs("label",{className:"nice-field__label",htmlFor:S,children:[d,h&&n.jsx("span",{className:"nice-field__required",children:"*"}),f&&n.jsx(Oe,{shortcuts:M,size:"sm"})]}),n.jsxs("div",{className:"nice-range-slider",ref:I,children:[n.jsx("div",{className:"nice-range-slider__track",children:n.jsx("div",{className:"nice-range-slider__fill",style:{left:`${w(i)}%`,width:`${w(r)-w(i)}%`}})}),n.jsx("div",{className:"nice-range-slider__thumb",style:{left:`${w(i)}%`},onPointerDown:A=>L(A,"start"),role:"slider","aria-valuemin":e,"aria-valuemax":r,"aria-valuenow":i,tabIndex:p?-1:0,id:S}),n.jsx("div",{className:"nice-range-slider__thumb",style:{left:`${w(r)}%`},onPointerDown:A=>L(A,"end"),role:"slider","aria-valuemin":i,"aria-valuemax":t,"aria-valuenow":r,tabIndex:p?-1:0}),l&&n.jsxs("div",{className:"nice-range-slider__labels",children:[n.jsx("span",{style:{left:`${w(i)}%`},children:E(i)}),n.jsx("span",{style:{left:`${w(r)}%`},children:E(r)})]})]}),u&&n.jsx("div",{className:"nice-field__error",children:u}),g&&!u&&n.jsx("div",{className:"nice-field__hint",children:g})]})},Di=({displayValue:e,placeholder:t,clearable:a,children:i,onClear:r,open:s,onOpenChange:l,dropdownWidth:c,label:d,error:u,helperText:g,required:h,disabled:p,size:m="md",id:k,className:b,style:C,accessMode:_,showKeyboardHints:f,displayStyle:v})=>{Ge("input",v),qe("input",v);const j=$e(_,k);if(j==="hidden")return null;(j==="disabled"||j==="readOnly")&&(p=!0);const S=ke(k),{t:I}=Se(),[M,w]=o.useState(!1),E=o.useRef(null),P=s??M,L=o.useMemo(()=>[{key:"Enter",description:I("shortcuts.openDropdown","Open dropdown")},Ae.cancel],[I]),A=N=>{l?l(N):w(N)};return ot(E,()=>A(!1)),n.jsxs("div",{className:`nice-field nice-field--${m} ${u?"nice-field--error":""} ${b||""}`,style:C,ref:E,children:[d&&n.jsxs("label",{className:"nice-field__label",htmlFor:S,children:[d,h&&n.jsx("span",{className:"nice-field__required",children:"*"}),f&&n.jsx(Oe,{shortcuts:L,size:"sm"})]}),n.jsxs("div",{className:"nice-field__input-wrap",children:[n.jsxs("button",{type:"button",id:S,className:"nice-select__trigger",onClick:()=>!p&&A(!P),disabled:p,children:[n.jsx("span",{children:e||t||I("controls.select","Select...")}),n.jsx("span",{className:"nice-select__arrow",children:"▾"})]}),a&&e&&!p&&n.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>r==null?void 0:r(),"aria-label":I("controls.clear","Clear"),children:"✕"})]}),P&&n.jsx("div",{className:"nice-dropdown",style:{width:c},children:i}),u&&n.jsx("div",{className:"nice-field__error",children:u}),g&&!u&&n.jsx("div",{className:"nice-field__hint",children:g})]})},Hn=({items:e,data:t,onFieldChange:a,onSubmit:i,dataSource:r,recordKey:s,columns:l=1,responsiveColumns:c,gap:d=16,labelPosition:u="top",size:g="md",readOnly:h,disabled:p,className:m,style:k,accessMode:b,id:C,autoSaveDelay:_,onDirtyChange:f})=>{const v=$e(b,C);if(v==="hidden")return null;v==="disabled"&&(p=!0),v==="readOnly"&&(h=!0);const j=Jo(r??null,s),S=!!r&&s!=null,I=S?j.editData:t??{},[M]=o.useState(()=>({...I})),[w,E]=o.useState([]),P=o.useMemo(()=>Object.keys(I).some(V=>I[V]!==M[V]),[I,M]),L=o.useRef(!1);o.useEffect(()=>{P!==L.current&&(L.current=P,f==null||f(P))},[P,f]);const A=o.useRef(null),N=o.useCallback(()=>{_&&(A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{S?j.save():i==null||i(I)},_))},[_,S,j,i,I]),x=o.useCallback((V,K)=>{h||p||(E(H=>[...H,{field:V,prev:I[V]}]),S?j.set(V,K):a==null||a(V,K),N())},[S,j,a,h,p,I,N]);o.useCallback(()=>{if(w.length===0)return;const V=w[w.length-1];E(K=>K.slice(0,-1)),S?j.set(V.field,V.prev):a==null||a(V.field,V.prev)},[w,S,j,a]);const O=o.useCallback(V=>{V.preventDefault(),A.current&&clearTimeout(A.current),S?j.save():i==null||i(I)},[I,i,S,j]),D=o.useRef(null),[F,y]=o.useState(l);o.useEffect(()=>{if(!c||!D.current){y(l);return}const V=D.current,K=new ResizeObserver(H=>{var Q;const q=((Q=H[0])==null?void 0:Q.contentRect.width)??0,Z=Object.keys(c).map(Number).sort((J,ee)=>ee-J);for(const J of Z)if(q>=J){y(c[J]);return}y(l)});return K.observe(V),()=>K.disconnect()},[c,l]);const $=o.useMemo(()=>e.filter(V=>!(V.visible===!1||V.visibleWhen&&!V.visibleWhen(I))),[e,I]),z=o.useMemo(()=>{const V=[];let K=null;for(const H of $)!K||K.name!==H.group?(K={name:H.group,items:[H]},V.push(K)):K.items.push(H);return V},[$]),R=V=>{var K;return n.jsxs("div",{className:"nice-form__item",style:{gridColumn:V.colSpan?`span ${V.colSpan}`:void 0},children:[V.label&&n.jsxs("label",{className:"nice-form__label",children:[V.label,V.required&&n.jsx("span",{className:"nice-field__required",children:"*"})]}),n.jsx("div",{className:"nice-form__control",children:(K=V.render)==null?void 0:K.call(V,I[V.field],H=>x(V.field,H))}),V.hint&&n.jsx("div",{className:"nice-form__hint",children:V.hint})]},V.field)},T={display:"grid",gridTemplateColumns:`repeat(${F}, 1fr)`,gap:d},B=z.some(V=>V.name!=null);return n.jsx("form",{ref:D,className:`nice-form nice-form--label-${u}${P?" nice-form--dirty":""} ${m||""}`,style:B?{...k}:{...T,...k},onSubmit:O,noValidate:!0,children:B?z.map((V,K)=>n.jsxs("fieldset",{className:V.name?"nice-form__group":"nice-form__group nice-form__group--no-title",children:[V.name&&n.jsx("legend",{className:"nice-form__group-title",children:V.name}),n.jsx("div",{style:T,children:V.items.map(R)})]},K)):$.map(R)})};Hn.displayName="NiceForm";function $a(e){const t=e.trim().toLowerCase();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")?!0:!(t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:text"))}const xd=["bold","italic","underline","strikethrough","h1","h2","h3","ul","ol","blockquote","hr","link","unlink","image","table","code","alignLeft","alignCenter","alignRight","fontSize","fontColor","undo","redo","clear","findReplace","emoji","source","fullscreen","markdown"],vd={bold:"B",italic:"I",underline:"U",strikethrough:"S",h1:"H1",h2:"H2",h3:"H3",ul:"⊞",ol:"⊟",link:"🔗",unlink:"⛓️‍💥",undo:"↩",redo:"↪",clear:"⌧",table:"⊞T",image:"🖼",code:"</>",markdown:"MD",blockquote:"❝",hr:"─",subscript:"x₂",superscript:"x²",indent:"→⊞",outdent:"←⊞",alignLeft:"⬅",alignCenter:"⬌",alignRight:"➡",alignJustify:"⬌⬌",fullscreen:"⛶",removeFormat:"⌧F",print:"🖨",source:"🗏",emoji:"😀",findReplace:"🔍"},wd=[{value:"1",label:"8pt"},{value:"2",label:"10pt"},{value:"3",label:"12pt"},{value:"4",label:"14pt"},{value:"5",label:"18pt"},{value:"6",label:"24pt"},{value:"7",label:"36pt"}],kd=[{label:"Faces",emojis:["😀","😂","😊","😍","🤔","😢","😎","🥳","😤","🤯","🥰","😴"]},{label:"Hands",emojis:["👍","👎","👏","🤝","✌️","🤞","💪","🙌","👋","🤙"]},{label:"Symbols",emojis:["❤️","⭐","🔥","✅","❌","⚡","💡","📌","🎯","🏆","🎉","💬"]},{label:"Arrows",emojis:["➡️","⬅️","⬆️","⬇️","↩️","🔄","▶️","⏸️","⏹️","⏩"]}];function Sd(e){let t=e;return t=t.replace(/<h1[^>]*>(.*?)<\/h1>/gi,`# $1
620
+ `),t=t.replace(/<h2[^>]*>(.*?)<\/h2>/gi,`## $1
621
+ `),t=t.replace(/<h3[^>]*>(.*?)<\/h3>/gi,`### $1
622
+ `),t=t.replace(/<strong[^>]*>(.*?)<\/strong>/gi,"**$1**"),t=t.replace(/<b[^>]*>(.*?)<\/b>/gi,"**$1**"),t=t.replace(/<em[^>]*>(.*?)<\/em>/gi,"*$1*"),t=t.replace(/<i[^>]*>(.*?)<\/i>/gi,"*$1*"),t=t.replace(/<code[^>]*>(.*?)<\/code>/gi,"`$1`"),t=t.replace(/<pre[^>]*>(.*?)<\/pre>/gis,"```\n$1\n```\n"),t=t.replace(/<br\s*\/?>/gi,`
623
+ `),t=t.replace(/<li[^>]*>(.*?)<\/li>/gi,`- $1
624
+ `),t=t.replace(/<\/?(?:ul|ol|p|div)[^>]*>/gi,`
625
+ `),t=t.replace(/<[^>]+>/g,""),t=t.replace(/\n{3,}/g,`
626
+
627
+ `),t.trim()}function Cd(e){let t=e;return t=t.replace(/^### (.+)$/gm,"<h3>$1</h3>"),t=t.replace(/^## (.+)$/gm,"<h2>$1</h2>"),t=t.replace(/^# (.+)$/gm,"<h1>$1</h1>"),t=t.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/\*(.+?)\*/g,"<em>$1</em>"),t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/```\n?([\s\S]*?)\n?```/g,"<pre>$1</pre>"),t=t.replace(/^- (.+)$/gm,"<li>$1</li>"),t=t.replace(/(<li>.*<\/li>)/gs,"<ul>$1</ul>"),t=t.replace(/\n/g,"<br>"),t}const ln=({value:e,onChange:t,placeholder:a,height:i=200,toolbar:r=xd,readOnly:s,onImageUpload:l,mentionTrigger:c,mentionSuggestions:d,onMentionSearch:u,onFileDrop:g,pasteCleanup:h=!0,maxLength:p=0,showWordCount:m=!1,templates:k,label:b,error:C,helperText:_,required:f,disabled:v,size:j="md",id:S,className:I,style:M,accessMode:w})=>{const E=$e(w,S);if(E==="hidden")return null;E==="disabled"&&(v=!0),E==="readOnly"&&(s=!0);const P=ke(S),L=o.useRef(null),A=o.useRef(null),N=o.useRef(null),[x,O]=o.useState(!1),[D,F]=o.useState(""),[y,$]=o.useState(!1),[z,R]=o.useState(""),[T,B]=o.useState(!1),[V,K]=o.useState(""),[H,q]=o.useState(0),[Z,Q]=o.useState(!1),[J,ee]=o.useState("#000000"),[ie,pe]=o.useState("#ffff00"),[te,ue]=o.useState(0),[fe,ae]=o.useState(0),[he,Y]=o.useState(!1),[X,W]=o.useState(""),[G,re]=o.useState(""),[ne,se]=o.useState(!1),[oe,ye]=o.useState(!1),ge=o.useCallback((le,xe)=>{var Fe,Ee,Re;if(s||v)return;const Ne=L.current;if(Ne){if(le==="markdown"){if(!x)F(Sd(e)),O(!0),$(!1);else{const ze=Cd(D);t(ze),O(!1)}return}if(le==="source"){y?(t(z),$(!1)):(R(e),$(!0),O(!1));return}if(le==="fullscreen"){Q(ze=>!ze);return}if(le==="emoji"){se(ze=>!ze);return}if(le==="findReplace"){Y(ze=>!ze);return}if(le==="image"){if(l)(Fe=A.current)==null||Fe.click();else{const ze=prompt("Image URL:");ze&&$a(ze)&&(Ne.focus(),document.execCommand("insertImage",!1,ze),t(tn(Ne.innerHTML)))}return}switch(Ne.focus(),le){case"bold":document.execCommand("bold");break;case"italic":document.execCommand("italic");break;case"underline":document.execCommand("underline");break;case"strikethrough":document.execCommand("strikeThrough");break;case"h1":document.execCommand("formatBlock",!1,"h1");break;case"h2":document.execCommand("formatBlock",!1,"h2");break;case"h3":document.execCommand("formatBlock",!1,"h3");break;case"ul":document.execCommand("insertUnorderedList");break;case"ol":document.execCommand("insertOrderedList");break;case"blockquote":document.execCommand("formatBlock",!1,"blockquote");break;case"hr":document.execCommand("insertHorizontalRule");break;case"subscript":document.execCommand("subscript");break;case"superscript":document.execCommand("superscript");break;case"indent":document.execCommand("indent");break;case"outdent":document.execCommand("outdent");break;case"alignLeft":document.execCommand("justifyLeft");break;case"alignCenter":document.execCommand("justifyCenter");break;case"alignRight":document.execCommand("justifyRight");break;case"alignJustify":document.execCommand("justifyFull");break;case"removeFormat":document.execCommand("removeFormat");break;case"print":window.print();return;case"link":{const ze=prompt("URL:");ze&&$a(ze)&&document.execCommand("createLink",!1,ze);break}case"unlink":document.execCommand("unlink");break;case"undo":document.execCommand("undo");break;case"redo":document.execCommand("redo");break;case"clear":document.execCommand("removeFormat");break;case"fontSize":{xe&&document.execCommand("fontSize",!1,xe);break}case"fontColor":{xe&&document.execCommand("foreColor",!1,xe);break}case"bgColor":{xe&&document.execCommand("hiliteColor",!1,xe);break}case"table":{document.execCommand("insertHTML",!1,'<table class="nice-htmleditor__table"><thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead><tbody><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>');break}case"code":{const ze=((Ee=window.getSelection())==null?void 0:Ee.toString())||"";ze.includes(`
628
+ `)||ze.length>60?document.execCommand("insertHTML",!1,`<pre class="nice-htmleditor__code-block">${ze||"// code"}</pre>`):document.execCommand("insertHTML",!1,`<code>${ze||"code"}</code>`);break}}t(tn(Ne.innerHTML)),ue(((Re=Ne.textContent)==null?void 0:Re.length)??0)}},[t,s,v,x,D,e,l,y,z]),we=o.useCallback(async le=>{var Ee;const xe=(Ee=le.target.files)==null?void 0:Ee[0];if(!xe||!l)return;const Ne=await l(xe),Fe=L.current;Fe&&Ne&&(Fe.focus(),document.execCommand("insertImage",!1,Ne),t(Fe.innerHTML)),le.target.value=""},[l,t]),Ce=o.useCallback(()=>{var Ne;const le=L.current;if(!le)return;const xe=((Ne=le.textContent)==null?void 0:Ne.length)??0;if(p>0&&xe>p&&(le.textContent=(le.textContent??"").slice(0,p)),ue(xe),ae((le.textContent??"").trim().split(/\s+/).filter(Boolean).length),t(le.innerHTML),c){const Fe=window.getSelection();if(Fe&&Fe.rangeCount>0){const Ee=Fe.getRangeAt(0),Re=Ee.startContainer;if(Re.nodeType===Node.TEXT_NODE){const ze=Re.textContent||"",dt=Ee.startOffset,Xe=ze.slice(0,dt),Qe=Xe.lastIndexOf(c);if(Qe>=0&&(Qe===0||/\s/.test(Xe[Qe-1]))){const nt=Xe.slice(Qe+c.length);if(!/\s/.test(nt)){B(!0),K(nt),q(0),u==null||u(nt);return}}}}B(!1)}},[t,c,u]),_e=(d==null?void 0:d.filter(le=>le.label.toLowerCase().includes(V.toLowerCase())).slice(0,8))??[],Ie=o.useCallback(le=>{var Re;const xe=L.current;if(!xe)return;const Ne=window.getSelection();if(!Ne||Ne.rangeCount===0)return;const Fe=Ne.getRangeAt(0),Ee=Fe.startContainer;if(Ee.nodeType===Node.TEXT_NODE&&c){const ze=Ee.textContent||"",dt=Fe.startOffset,Xe=ze.slice(0,dt).lastIndexOf(c);if(Xe>=0){const Qe=ze.slice(0,Xe),nt=ze.slice(dt),Ot=`<span class="nice-htmleditor__mention" data-mention="${le.key}" contenteditable="false">${c}${le.label}</span>&nbsp;`;Ee.textContent=Qe;const vt=document.createRange();vt.setStartAfter(Ee),vt.collapse(!0);const Ht=vt.createContextualFragment(Ot+nt);(Re=Ee.parentNode)==null||Re.insertBefore(Ht,Ee.nextSibling),Ne.collapseToEnd(),t(xe.innerHTML)}}B(!1)},[c,t]),je=o.useCallback(le=>{if(T&&_e.length>0){le.key==="ArrowDown"?(le.preventDefault(),q(xe=>Math.min(xe+1,_e.length-1))):le.key==="ArrowUp"?(le.preventDefault(),q(xe=>Math.max(xe-1,0))):le.key==="Enter"?(le.preventDefault(),Ie(_e[H])):le.key==="Escape"&&B(!1);return}(le.ctrlKey||le.metaKey)&&le.key==="b"?(le.preventDefault(),ge("bold")):(le.ctrlKey||le.metaKey)&&le.key==="i"?(le.preventDefault(),ge("italic")):(le.ctrlKey||le.metaKey)&&le.key==="u"?(le.preventDefault(),ge("underline")):(le.ctrlKey||le.metaKey)&&le.key==="f"?(le.preventDefault(),Y(xe=>!xe)):(le.ctrlKey||le.metaKey)&&le.key==="z"&&!le.shiftKey?(le.preventDefault(),ge("undo")):(le.ctrlKey||le.metaKey)&&(le.key==="y"||le.key==="z"&&le.shiftKey)&&(le.preventDefault(),ge("redo"))},[T,_e,H,Ie,ge]),He=o.useCallback(le=>{var Ee;if(!h)return;le.preventDefault();const xe=le.clipboardData.getData("text/html"),Ne=le.clipboardData.getData("text/plain");if(xe){const Re=xe.replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<script[\s\S]*?<\/script>/gi,"").replace(/class="[^"]*"/gi,"").replace(/style="[^"]*"/gi,"").replace(/<o:[^>]*>[\s\S]*?<\/o:[^>]*>/gi,"").replace(/<!--[\s\S]*?-->/g,"").replace(/<\/?(?:xml|meta|link|font|span)[^>]*>/gi,"");document.execCommand("insertHTML",!1,Re)}else Ne&&document.execCommand("insertText",!1,Ne);const Fe=L.current;Fe&&(t(Fe.innerHTML),ue(((Ee=Fe.textContent)==null?void 0:Ee.length)??0))},[h,t]),St=o.useCallback(async le=>{if(!g)return;le.preventDefault();const xe=Array.from(le.dataTransfer.files);if(xe.length===0)return;const Ne=await g(xe),Fe=L.current;if(Fe){Fe.focus();for(const Ee of Ne)if(/\.(png|jpe?g|gif|webp|svg|bmp|ico)$/i.test(Ee)||Ee.startsWith("data:image/"))document.execCommand("insertImage",!1,Ee);else{const Re=`<a href="${Ee}">${Ee.split("/").pop()??Ee}</a>`;document.execCommand("insertHTML",!1,Re)}t(Fe.innerHTML)}},[g,t]),st=o.useCallback(le=>{g&&le.preventDefault()},[g]),Ke=o.useCallback(le=>{var Re;const xe=L.current;if(!xe||!X)return;const Ne=xe.textContent??"",Fe=X.toLowerCase(),Ee=Ne.toLowerCase();(le===1?Ee.indexOf(Fe):Ee.lastIndexOf(Fe))!==-1&&(xe.focus(),(Re=window.find)==null||Re.call(window,X))},[X]),lt=o.useCallback(()=>{const le=L.current;!le||!X||(le.innerHTML=le.innerHTML.split(X).join(G),t(le.innerHTML))},[X,G,t]),ct=o.useCallback(()=>{if(!X)return;const le=e.split(X).join(G);t(le);const xe=L.current;xe&&(xe.innerHTML=le)},[X,G,e,t]),tt=o.useCallback(le=>{const xe=L.current;xe&&(xe.focus(),document.execCommand("insertText",!1,le),t(xe.innerHTML),se(!1))},[t]),Pe=o.useCallback(le=>{const xe=L.current;xe&&(xe.focus(),document.execCommand("insertHTML",!1,le),t(xe.innerHTML),ye(!1))},[t]),We=o.useCallback(le=>{const xe=v||s;return le==="fontSize"?n.jsx(gt,{size:"sm",value:"",onChange:Ne=>ge("fontSize",String(Ne)),disabled:xe,placeholder:"Size",options:wd.map(Ne=>({value:Ne.value,label:Ne.label})),style:{minWidth:70,maxWidth:80}},le):le==="fontColor"?n.jsx(bt,{value:J,onChange:Ne=>{ee(Ne),ge("fontColor",Ne)},disabled:xe,size:"sm",label:"",title:"Text color"},le):le==="bgColor"?n.jsx(bt,{value:ie,onChange:Ne=>{pe(Ne),ge("bgColor",Ne)},disabled:xe,size:"sm",label:"",title:"Highlight color"},le):n.jsx(ve,{size:"sm",variant:le==="markdown"&&x||le==="fullscreen"&&Z||le==="source"&&y||le==="findReplace"&&he||le==="emoji"&&ne?"primary":"ghost",onClick:()=>ge(le),title:le,disabled:xe,children:vd[le]||le},le)},[v,s,ge,x,Z,J,ie,y,he,ne]);return n.jsxs("div",{className:`nice-field nice-field--${j} ${C?"nice-field--error":""} ${I||""}`,style:M,children:[b&&n.jsxs("label",{className:"nice-field__label",htmlFor:P,children:[b,f&&n.jsx("span",{className:"nice-field__required",children:"*"})]}),n.jsxs("div",{ref:N,className:`nice-htmleditor${Z?" nice-htmleditor--fullscreen":""}`,children:[n.jsxs("div",{className:"nice-htmleditor__toolbar",style:{display:"flex",flexWrap:"wrap",gap:2,alignItems:"center"},children:[r.map(We),k&&k.length>0&&n.jsxs("div",{style:{position:"relative"},children:[n.jsx(ve,{size:"sm",variant:oe?"primary":"ghost",onClick:()=>ye(le=>!le),title:"Insert template",children:"📋"}),oe&&n.jsx("ul",{style:{position:"absolute",top:"100%",right:0,zIndex:200,background:"#fff",border:"1px solid #ddd",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,.12)",listStyle:"none",margin:0,padding:4,minWidth:160,maxHeight:200,overflow:"auto"},children:k.map((le,xe)=>n.jsx("li",{style:{padding:"6px 10px",cursor:"pointer",borderRadius:4},onMouseDown:Ne=>{Ne.preventDefault(),Pe(le.html)},children:le.label},xe))})]})]}),he&&n.jsxs("div",{className:"nice-htmleditor__find-bar",style:{display:"flex",gap:4,alignItems:"center",padding:"4px 8px",background:"#f8f9fa",borderBottom:"1px solid #ddd",fontSize:"0.875em"},children:[n.jsx("input",{type:"text",placeholder:"Find...",value:X,onChange:le=>W(le.target.value),style:{flex:1,maxWidth:180,padding:"2px 6px",border:"1px solid #ccc",borderRadius:4}}),n.jsx("input",{type:"text",placeholder:"Replace...",value:G,onChange:le=>re(le.target.value),style:{flex:1,maxWidth:180,padding:"2px 6px",border:"1px solid #ccc",borderRadius:4}}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>Ke(1),title:"Find next",children:"▶"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>Ke(-1),title:"Find previous",children:"◀"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:lt,disabled:v||s,children:"Replace"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:ct,disabled:v||s,children:"All"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>Y(!1),children:"✕"})]}),ne&&n.jsx("div",{className:"nice-htmleditor__emoji-picker",style:{padding:8,background:"#fff",borderBottom:"1px solid #ddd",maxHeight:180,overflowY:"auto"},children:kd.map(le=>n.jsxs("div",{children:[n.jsx("div",{style:{fontSize:"0.7em",fontWeight:600,color:"#999",padding:"4px 0"},children:le.label}),n.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:2},children:le.emojis.map(xe=>n.jsx("span",{style:{cursor:"pointer",fontSize:"1.2em",padding:2,borderRadius:4},onClick:()=>tt(xe),title:xe,children:xe},xe))})]},le.label))}),n.jsx("input",{ref:A,type:"file",accept:"image/*",style:{display:"none"},onChange:we}),y?n.jsx("textarea",{className:"nice-htmleditor__source",value:z,onChange:le=>R(le.target.value),style:{minHeight:i,width:"100%",fontFamily:"monospace",resize:"vertical",whiteSpace:"pre",fontSize:"0.85em"},disabled:v||s}):x?n.jsx("textarea",{className:"nice-htmleditor__markdown",value:D,onChange:le=>F(le.target.value),style:{minHeight:i,width:"100%",fontFamily:"monospace",resize:"vertical"},disabled:v||s}):n.jsxs("div",{style:{position:"relative"},children:[n.jsx("div",{ref:L,id:P,className:"nice-htmleditor__content",contentEditable:!v&&!s,dangerouslySetInnerHTML:{__html:e},onInput:Ce,onKeyDown:je,onPaste:He,onDrop:St,onDragOver:st,style:{minHeight:i},"data-placeholder":a,role:"textbox","aria-multiline":"true",suppressContentEditableWarning:!0}),T&&_e.length>0&&n.jsx("ul",{className:"nice-htmleditor__mention-list",children:_e.map((le,xe)=>n.jsx("li",{className:`nice-htmleditor__mention-item ${xe===H?"nice-htmleditor__mention-item--active":""}`,onMouseDown:Ne=>{Ne.preventDefault(),Ie(le)},children:le.label},le.key))})]}),n.jsxs("div",{className:"nice-htmleditor__statusbar",style:{display:"flex",gap:12,padding:"2px 8px",fontSize:"0.75em",color:"#666",borderTop:"1px solid #eee"},children:[p>0&&n.jsxs("span",{children:[te," / ",p]}),m&&n.jsxs("span",{children:[fe," words"]}),m&&n.jsxs("span",{children:[te," chars"]}),y&&n.jsx("span",{style:{fontWeight:600},children:"HTML Source"}),x&&n.jsx("span",{style:{fontWeight:600},children:"Markdown"})]})]}),C&&n.jsx("div",{className:"nice-field__error",children:C}),_&&!C&&n.jsx("div",{className:"nice-field__hint",children:_})]})},_d=Object.freeze(Object.defineProperty({__proto__:null,NiceHtmlEditor:ln},Symbol.toStringTag,{value:"Module"})),jd=[{code:"en",label:"English"},{code:"es",label:"Spanish"},{code:"fr",label:"French"},{code:"de",label:"German"},{code:"it",label:"Italian"},{code:"pt",label:"Portuguese"},{code:"pl",label:"Polish"},{code:"ru",label:"Russian"},{code:"zh",label:"Chinese"},{code:"ja",label:"Japanese"},{code:"ko",label:"Korean"},{code:"ar",label:"Arabic"}],Nd=[{style:"professional",label:"Professional"},{style:"casual",label:"Casual"},{style:"formal",label:"Formal"},{style:"concise",label:"Concise"}];o.forwardRef(function(e,t){var ae,he;const{enableAI:a=!0,aiModel:i,enableImprove:r=!0,enableTranslate:s=!0,enableGenerate:l=!0,toolbar:c,languages:d=jd,textStyles:u=Nd,onImprove:g,onTranslate:h,onGenerate:p,showAIToolbar:m=!0,value:k,onChange:b,...C}=e,_=o.useRef(null),[f,v]=o.useState(!1),[j,S]=o.useState(!1),[I,M]=o.useState(!1),[w,E]=o.useState(""),[P,L]=o.useState(""),[A,N]=o.useState("professional"),[x,O]=o.useState(""),[D,F]=o.useState(((ae=d[0])==null?void 0:ae.code)||"en"),[y,$]=o.useState(""),[z,R]=o.useState(""),{t:T}=Bt(),B=et(),{improveText:V,translate:K,generateHtml:H,isLoading:q}=Xo(),Z=a&&B.isConfigured,Q=o.useCallback(()=>{const Y=window.getSelection();return Y&&Y.toString().trim()?Y.toString():""},[]),J=o.useCallback(Y=>{const X=window.getSelection();if(X&&X.rangeCount>0){const W=X.getRangeAt(0);W.deleteContents();const G=document.createElement("div");G.innerHTML=Y;const re=document.createDocumentFragment();for(;G.firstChild;)re.appendChild(G.firstChild);if(W.insertNode(re),_.current){const ne=_.current.innerHTML;b(ne)}}},[b]),ee=o.useCallback(async(Y="professional")=>{if(!Z||!r)return"";const X=Q();if(!X)return"";E(X),N(Y),v(!0),L("");try{const W=await V(X,Y);return L(W),g==null||g(X,W,Y),W}catch{return L(T("htmlEditorAI.improveFailed","Failed to improve text")),""}},[Z,r,Q,V,g,T]),ie=o.useCallback(async Y=>{var W;if(!Z||!s)return"";const X=Q();if(!X)return"";E(X),F(Y),S(!0),O("");try{const G=((W=d.find(ne=>ne.code===Y))==null?void 0:W.label)||Y,re=await K(X,G);return O(re),h==null||h(X,re,Y),re}catch{return O(T("htmlEditorAI.translateFailed","Failed to translate text")),""}},[Z,s,Q,K,d,h,T]),pe=o.useCallback(async Y=>{if(!Z||!l||!Y.trim())return"";$(Y),R("");try{const X=await H(Y);return R(X),p==null||p(Y,X),X}catch{return R(T("htmlEditorAI.generateFailed","Failed to generate HTML")),""}},[Z,l,H,p,T]),te=o.useCallback(()=>{P&&J(P),v(!1),L("")},[P,J]),ue=o.useCallback(()=>{x&&J(x),S(!1),O("")},[x,J]),fe=o.useCallback(()=>{if(z&&_.current){document.execCommand("insertHTML",!1,z);const Y=_.current.innerHTML;b(Y)}M(!1),R(""),$("")},[z,b]);return o.useImperativeHandle(t,()=>({getEditor:()=>_.current,focus:()=>{var Y;return(Y=_.current)==null?void 0:Y.focus()},getValue:()=>{var Y;return((Y=_.current)==null?void 0:Y.innerHTML)||""},setValue:Y=>{_.current&&(_.current.innerHTML=Y,b(Y))},getSelection:Q,insertHtml:Y=>{document.execCommand("insertHTML",!1,Y),_.current&&b(_.current.innerHTML)},improveSelection:ee,translateSelection:ie,generateHtml:pe})),o.useCallback(Y=>{_.current=Y},[]),n.jsxs("div",{className:"nice-html-editor-ai","data-testid":e["data-testid"],children:[m&&Z&&n.jsxs("div",{className:"nice-html-editor-ai__toolbar",children:[n.jsxs("div",{className:"nice-html-editor-ai__toolbar-left",children:[n.jsx("span",{className:"nice-html-editor-ai__badge",children:"AI"}),q&&n.jsx("span",{className:"nice-html-editor-ai__loading",children:T("htmlEditorAI.processing","Processing...")})]}),n.jsxs("div",{className:"nice-html-editor-ai__toolbar-right",children:[r&&n.jsxs("div",{className:"nice-html-editor-ai__dropdown",children:[n.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",onClick:()=>ee(),disabled:q,title:T("htmlEditorAI.improveText","Improve selected text"),children:["✨ ",T("htmlEditorAI.improve","Improve")]}),n.jsx("div",{className:"nice-html-editor-ai__dropdown-menu",children:u.map(({style:Y,label:X})=>n.jsx("button",{type:"button",className:"nice-html-editor-ai__dropdown-item",onClick:()=>ee(Y),children:X},Y))})]}),s&&n.jsxs("div",{className:"nice-html-editor-ai__dropdown",children:[n.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",disabled:q,title:T("htmlEditorAI.translateText","Translate selected text"),children:["🌐 ",T("htmlEditorAI.translate","Translate")]}),n.jsx("div",{className:"nice-html-editor-ai__dropdown-menu nice-html-editor-ai__dropdown-menu--languages",children:d.map(({code:Y,label:X})=>n.jsx("button",{type:"button",className:"nice-html-editor-ai__dropdown-item",onClick:()=>ie(Y),children:X},Y))})]}),l&&n.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",onClick:()=>M(!0),disabled:q,title:T("htmlEditorAI.generateHtml","Generate HTML from description"),children:["⚡ ",T("htmlEditorAI.generate","Generate")]})]})]}),n.jsx("div",{className:"nice-html-editor-ai__editor-wrapper",children:n.jsx(ln,{value:k,onChange:b,toolbar:c,...C})}),f&&n.jsxs("div",{className:"nice-html-editor-ai__panel",children:[n.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[n.jsxs("h4",{children:["✨ ",T("htmlEditorAI.improveText","Improve Text")]}),n.jsx("div",{className:"nice-html-editor-ai__style-selector",children:u.map(({style:Y,label:X})=>n.jsx("button",{type:"button",className:`nice-html-editor-ai__style-btn ${A===Y?"nice-html-editor-ai__style-btn--active":""}`,onClick:()=>{N(Y),ee(Y)},children:X},Y))}),n.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>v(!1),children:"✕"})]}),n.jsx("div",{className:"nice-html-editor-ai__panel-body",children:q?n.jsx("div",{className:"nice-html-editor-ai__loading-panel",children:T("htmlEditorAI.improving","Improving text...")}):n.jsxs("div",{className:"nice-html-editor-ai__comparison",children:[n.jsxs("div",{className:"nice-html-editor-ai__text-block",children:[n.jsx("h5",{children:T("htmlEditorAI.original","Original")}),n.jsx("div",{className:"nice-html-editor-ai__text-content",children:w})]}),n.jsxs("div",{className:"nice-html-editor-ai__text-block nice-html-editor-ai__text-block--improved",children:[n.jsx("h5",{children:T("htmlEditorAI.improved","Improved")}),n.jsx("div",{className:"nice-html-editor-ai__text-content",children:P})]})]})}),n.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[n.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:te,disabled:!P||q,children:["✓ ",T("htmlEditorAI.apply","Apply")]}),n.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{v(!1),L("")},children:T("htmlEditorAI.cancel","Cancel")})]})]}),j&&n.jsxs("div",{className:"nice-html-editor-ai__panel",children:[n.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[n.jsxs("h4",{children:["🌐 ",T("htmlEditorAI.translateText","Translate Text")]}),n.jsx("div",{className:"nice-html-editor-ai__language-selector",children:n.jsx("select",{value:D,onChange:Y=>{F(Y.target.value),ie(Y.target.value)},className:"nice-html-editor-ai__language-select",children:d.map(({code:Y,label:X})=>n.jsx("option",{value:Y,children:X},Y))})}),n.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>S(!1),children:"✕"})]}),n.jsx("div",{className:"nice-html-editor-ai__panel-body",children:q?n.jsx("div",{className:"nice-html-editor-ai__loading-panel",children:T("htmlEditorAI.translating","Translating...")}):n.jsxs("div",{className:"nice-html-editor-ai__comparison",children:[n.jsxs("div",{className:"nice-html-editor-ai__text-block",children:[n.jsx("h5",{children:T("htmlEditorAI.original","Original")}),n.jsx("div",{className:"nice-html-editor-ai__text-content",children:w})]}),n.jsxs("div",{className:"nice-html-editor-ai__text-block nice-html-editor-ai__text-block--translated",children:[n.jsx("h5",{children:((he=d.find(Y=>Y.code===D))==null?void 0:he.label)||D}),n.jsx("div",{className:"nice-html-editor-ai__text-content",children:x})]})]})}),n.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[n.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:ue,disabled:!x||q,children:["✓ ",T("htmlEditorAI.apply","Apply")]}),n.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{S(!1),O("")},children:T("htmlEditorAI.cancel","Cancel")})]})]}),I&&n.jsxs("div",{className:"nice-html-editor-ai__panel nice-html-editor-ai__panel--generate",children:[n.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[n.jsxs("h4",{children:["⚡ ",T("htmlEditorAI.generateHtml","Generate HTML")]}),n.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>{M(!1),R(""),$("")},children:"✕"})]}),n.jsxs("div",{className:"nice-html-editor-ai__panel-body",children:[n.jsxs("div",{className:"nice-html-editor-ai__generate-input",children:[n.jsx("textarea",{placeholder:T("htmlEditorAI.generatePlaceholder",'Describe what you want to create (e.g., "A pricing table with 3 tiers", "A contact form with name, email, and message")'),value:y,onChange:Y=>$(Y.target.value),className:"nice-html-editor-ai__generate-textarea",rows:3}),n.jsx("button",{type:"button",className:"nice-html-editor-ai__generate-btn",onClick:()=>pe(y),disabled:q||!y.trim(),children:q?T("htmlEditorAI.generating","Generating..."):T("htmlEditorAI.generate","Generate")})]}),z&&n.jsxs("div",{className:"nice-html-editor-ai__generate-result",children:[n.jsx("h5",{children:T("htmlEditorAI.preview","Preview")}),n.jsx("div",{className:"nice-html-editor-ai__preview",dangerouslySetInnerHTML:{__html:z}}),n.jsx("h5",{children:T("htmlEditorAI.htmlCode","HTML Code")}),n.jsx("pre",{className:"nice-html-editor-ai__code",children:z})]})]}),n.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[n.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:fe,disabled:!z||q,children:["✓ ",T("htmlEditorAI.insert","Insert")]}),n.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{M(!1),R(""),$("")},children:T("htmlEditorAI.cancel","Cancel")})]})]})]})});function Je(e){return e.toString().padStart(2,"0")}function Md(e){if(!e)return{date:"",hours:0,minutes:0,seconds:0};const t=new Date(e);if(isNaN(t.getTime()))return{date:"",hours:0,minutes:0,seconds:0};const a=t.getFullYear(),i=Je(t.getMonth()+1),r=Je(t.getDate());return{date:`${a}-${i}-${r}`,hours:t.getHours(),minutes:t.getMinutes(),seconds:t.getSeconds()}}function $d(e,t,a,i){return e?`${e}T${Je(t)}:${Je(a)}:${Je(i)}`:""}const Wn=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,value:h,onChange:p,onBlur:m,min:k,max:b,hourFormat:C="24",minuteStep:_=1,showSeconds:f=!1,showNow:v=!1,clearable:j=!1,...S},I)=>{const{t:M}=Se(),w=ke(d),E=o.useRef(null),P=o.useMemo(()=>Md(h),[h]),L=o.useCallback((B,V,K,H)=>{p==null||p($d(B,V,K,H))},[p]),A=o.useCallback(B=>{L(B.target.value,P.hours,P.minutes,P.seconds)},[L,P]),N=o.useCallback(B=>{const V=Math.max(0,Math.min(23,parseInt(B.target.value,10)||0));L(P.date,V,P.minutes,P.seconds)},[L,P]),x=o.useCallback(B=>{const V=Math.max(0,Math.min(59,parseInt(B.target.value,10)||0));L(P.date,P.hours,V,P.seconds)},[L,P]),O=o.useCallback(B=>{const V=Math.max(0,Math.min(59,parseInt(B.target.value,10)||0));L(P.date,P.hours,P.minutes,V)},[L,P]),D=o.useCallback(()=>{const B=P.hours>=12?P.hours-12:P.hours+12;L(P.date,B,P.minutes,P.seconds)},[L,P]),F=o.useCallback(()=>{const B=new Date,V=`${B.getFullYear()}-${Je(B.getMonth()+1)}-${Je(B.getDate())}`;L(V,B.getHours(),B.getMinutes(),B.getSeconds())},[L]),y=o.useCallback(()=>{p==null||p("")},[p]),$=C==="12"?P.hours===0?12:P.hours>12?P.hours-12:P.hours:P.hours,z=P.hours>=12?"PM":"AM",R=k?k.split("T")[0]:void 0,T=b?b.split("T")[0]:void 0;return n.jsxs("div",{ref:I,className:`nice-field ${u||""}`,style:g,...S,children:[e&&n.jsx("label",{htmlFor:w,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:e}),n.jsxs("div",{className:`nice-datetime nice-datetime--${l} ${a?"nice-datetime--error":""} ${r?"nice-datetime--disabled":""} ${s?"nice-datetime--readonly":""}`,children:[n.jsx("input",{ref:E,id:w,type:"date",className:"nice-datetime__date",name:c?`${c}_date`:void 0,value:P.date,min:R,max:T,disabled:r,readOnly:s,"aria-invalid":!!a,"aria-describedby":a?`${w}-error`:t?`${w}-helper`:void 0,onChange:A,onBlur:m}),n.jsx("span",{className:"nice-datetime__separator",children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{d:"M10 2a8 8 0 100 16 8 8 0 000-16zm.75 4a.75.75 0 00-1.5 0v4c0 .2.08.39.22.53l2 2a.75.75 0 101.06-1.06L10.75 9.69V6z"})})}),n.jsx("input",{type:"number",className:"nice-datetime__time-part",value:$,min:C==="12"?1:0,max:C==="12"?12:23,disabled:r,readOnly:s,"aria-label":M("datetime.hours","Hours"),onChange:N}),n.jsx("span",{className:"nice-datetime__colon",children:":"}),n.jsx("input",{type:"number",className:"nice-datetime__time-part",value:Je(P.minutes),min:0,max:59,step:_,disabled:r,readOnly:s,"aria-label":M("datetime.minutes","Minutes"),onChange:x}),f&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"nice-datetime__colon",children:":"}),n.jsx("input",{type:"number",className:"nice-datetime__time-part",value:Je(P.seconds),min:0,max:59,disabled:r,readOnly:s,"aria-label":M("datetime.seconds","Seconds"),onChange:O})]}),C==="12"&&n.jsx("button",{type:"button",className:"nice-datetime__ampm",disabled:r||s,onClick:D,"aria-label":M("datetime.toggleAmPm","Toggle AM/PM"),children:z}),v&&n.jsx("button",{type:"button",className:"nice-datetime__now",disabled:r||s,onClick:F,"aria-label":M("datetime.now","Now"),children:M("datetime.now","Now")}),j&&h&&n.jsx("button",{type:"button",className:"nice-input__clear",disabled:r||s,onClick:y,"aria-label":M("controls.clear","Clear"),children:"✕"})]}),a&&n.jsx("div",{id:`${w}-error`,className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{id:`${w}-helper`,className:"nice-field__helper",children:t})]})});Wn.displayName="NiceDateTimePicker";function pt(e){return e.toString().padStart(2,"0")}function pn(e){if(!e)return{hours:0,minutes:0,seconds:0};const t=e.split(":").map(Number);return{hours:Math.max(0,Math.min(23,t[0]||0)),minutes:Math.max(0,Math.min(59,t[1]||0)),seconds:Math.max(0,Math.min(59,t[2]||0))}}function Ed(e,t,a,i){return i?`${pt(e)}:${pt(t)}:${pt(a)}`:`${pt(e)}:${pt(t)}`}const qn=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,value:h,onChange:p,onBlur:m,hourFormat:k="24",minuteStep:b=1,showSeconds:C=!1,min:_,max:f,clearable:v=!1,...j},S)=>{const{t:I}=Se(),M=ke(d),w=o.useMemo(()=>pn(h),[h]),E=o.useCallback(($,z,R)=>{p==null||p(Ed($,z,R,C))},[p,C]),P=o.useCallback(($,z,R)=>{if(_){const T=pn(_),B=T.hours*3600+T.minutes*60+T.seconds;if($*3600+z*60+R<B)return[T.hours,T.minutes,T.seconds]}if(f){const T=pn(f),B=T.hours*3600+T.minutes*60+T.seconds;if($*3600+z*60+R>B)return[T.hours,T.minutes,T.seconds]}return[$,z,R]},[_,f]),L=o.useCallback($=>{let z=parseInt($.target.value,10)||0;if(k==="12"){const V=w.hours<12;z=Math.max(1,Math.min(12,z)),z===12?z=V?0:12:z=V?z:z+12}else z=Math.max(0,Math.min(23,z));const[R,T,B]=P(z,w.minutes,w.seconds);E(R,T,B)},[E,w,k,P]),A=o.useCallback($=>{const z=Math.max(0,Math.min(59,parseInt($.target.value,10)||0)),[R,T,B]=P(w.hours,z,w.seconds);E(R,T,B)},[E,w,P]),N=o.useCallback($=>{const z=Math.max(0,Math.min(59,parseInt($.target.value,10)||0)),[R,T,B]=P(w.hours,w.minutes,z);E(R,T,B)},[E,w,P]),x=o.useCallback(()=>{const $=w.hours>=12?w.hours-12:w.hours+12,[z,R,T]=P($,w.minutes,w.seconds);E(z,R,T)},[E,w,P]),O=o.useCallback(()=>{p==null||p("")},[p]),D=o.useCallback(($,z)=>{if(s||r)return;const R=$==="m"?b:1;if(z.key==="ArrowUp"||z.key==="ArrowDown"){z.preventDefault();const T=z.key==="ArrowUp"?R:-R;let B=w.hours,V=w.minutes,K=w.seconds;$==="h"?B=((B+T)%24+24)%24:$==="m"?V=((V+T)%60+60)%60:K=((K+T)%60+60)%60;const[H,q,Z]=P(B,V,K);E(H,q,Z)}},[w,b,E,P,s,r]),F=k==="12"?w.hours===0?12:w.hours>12?w.hours-12:w.hours:w.hours,y=w.hours>=12?"PM":"AM";return n.jsxs("div",{ref:S,className:`nice-field ${u||""}`,style:g,...j,children:[e&&n.jsx("label",{htmlFor:M,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:e}),n.jsxs("div",{className:`nice-timepicker nice-timepicker--${l} ${a?"nice-timepicker--error":""} ${r?"nice-timepicker--disabled":""} ${s?"nice-timepicker--readonly":""}`,children:[n.jsx("svg",{className:"nice-timepicker__icon",width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{d:"M10 2a8 8 0 100 16 8 8 0 000-16zm.75 4a.75.75 0 00-1.5 0v4c0 .2.08.39.22.53l2 2a.75.75 0 101.06-1.06L10.75 9.69V6z"})}),n.jsx("input",{id:M,type:"number",className:"nice-timepicker__part",value:F,min:k==="12"?1:0,max:k==="12"?12:23,disabled:r,readOnly:s,name:c,"aria-invalid":!!a,"aria-describedby":a?`${M}-error`:t?`${M}-helper`:void 0,"aria-label":I("datetime.hours","Hours"),onChange:L,onKeyDown:$=>D("h",$),onBlur:m}),n.jsx("span",{className:"nice-timepicker__colon",children:":"}),n.jsx("input",{type:"number",className:"nice-timepicker__part",value:pt(w.minutes),min:0,max:59,step:b,disabled:r,readOnly:s,"aria-label":I("datetime.minutes","Minutes"),onChange:A,onKeyDown:$=>D("m",$)}),C&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"nice-timepicker__colon",children:":"}),n.jsx("input",{type:"number",className:"nice-timepicker__part",value:pt(w.seconds),min:0,max:59,disabled:r,readOnly:s,"aria-label":I("datetime.seconds","Seconds"),onChange:N,onKeyDown:$=>D("s",$)})]}),k==="12"&&n.jsx("button",{type:"button",className:"nice-timepicker__ampm",disabled:r||s,onClick:x,"aria-label":I("datetime.toggleAmPm","Toggle AM/PM"),children:y}),v&&h&&n.jsx("button",{type:"button",className:"nice-input__clear",disabled:r||s,onClick:O,"aria-label":I("controls.clear","Clear"),children:"✕"})]}),a&&n.jsx("div",{id:`${M}-error`,className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{id:`${M}-helper`,className:"nice-field__helper",children:t})]})});qn.displayName="NiceTimePicker";function zd(e){return[...e].map(t=>t==="9"?{type:"digit"}:t==="a"?{type:"letter"}:t==="*"?{type:"alphanum"}:{type:"literal",literal:t})}function Ad(e,t){return t.type==="digit"?/\d/.test(e):t.type==="letter"?/[a-zA-Z]/.test(e):t.type==="alphanum"?/[a-zA-Z0-9]/.test(e):!1}function Ea(e,t,a){let i=0,r="";for(const s of t)s.type==="literal"?r+=s.literal:i<e.length?(r+=e[i],i++):r+=a;return r}function Fd(e,t){return e.map(a=>a.type==="literal"?a.literal:t).join("")}function Id(e,t){for(let a=t;a<e.length;a++)if(e[a].type!=="literal")return a;return e.length}const Vn=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,value:h="",onChange:p,onBlur:m,onKeyDown:k,mask:b,maskChar:C="_",placeholder:_,showMaskAsPlaceholder:f=!0,clearable:v=!1,autoFocus:j,...S},I)=>{const{t:M}=Se(),w=ke(d),E=o.useRef(null),[P,L]=o.useState(!1),A=o.useMemo(()=>zd(b),[b]),N=o.useMemo(()=>Ea(h,A,C),[h,A,C]),x=P||h?N:"",O=_??(f?Fd(A,C):void 0),D=o.useCallback(B=>{E.current=B,typeof I=="function"?I(B):I&&(I.current=B)},[I]),F=o.useCallback(B=>{const V=Ea(B,A,C);p==null||p(B,V)},[p,A,C]),y=o.useCallback(B=>{const V=B.currentTarget,K=V.value;let H="",q=0;for(let Z=0;Z<K.length&&q<A.length;Z++){const Q=K[Z];for(;q<A.length&&A[q].type==="literal";)q++;if(q>=A.length)break;Ad(Q,A[q])&&(H+=Q,q++)}F(H),requestAnimationFrame(()=>{Id(A,0);let Z=0,Q=0;for(let J=0;J<A.length;J++)if(A[J].type==="literal")Z=J+1;else if(Q<H.length)Q++,Z=J+1;else{Z=J;break}Q>=H.length&&H.length>0&&(Z=Math.min(Z,A.length)),V.setSelectionRange(Z,Z)})},[A,F]),$=o.useCallback(B=>{if(B.key==="Backspace"&&h.length>0){B.preventDefault();const V=h.slice(0,-1);F(V)}k==null||k(B)},[h,F,k]),z=o.useCallback(()=>L(!0),[]),R=o.useCallback(B=>{L(!1),m==null||m(B)},[m]),T=o.useCallback(()=>{var B;F(""),(B=E.current)==null||B.focus()},[F]);return n.jsxs("div",{className:`nice-field ${u||""}`,style:g,children:[e&&n.jsx("label",{htmlFor:w,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:e}),n.jsxs("div",{className:`nice-input nice-input--${l} ${a?"nice-input--error":""} ${r?"nice-input--disabled":""} ${s?"nice-input--readonly":""}`,children:[n.jsx("input",{ref:D,id:w,className:"nice-input__native nice-masked-input",type:"text",name:c,value:x,placeholder:O,disabled:r,readOnly:s,autoFocus:j,"aria-invalid":!!a,"aria-describedby":a?`${w}-error`:t?`${w}-helper`:void 0,onInput:y,onChange:()=>{},onKeyDown:$,onFocus:z,onBlur:R,...S}),v&&h&&n.jsx("button",{type:"button",className:"nice-input__clear",disabled:r||s,onClick:T,"aria-label":M("controls.clear","Clear"),children:"✕"})]}),a&&n.jsx("div",{id:`${w}-error`,className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{id:`${w}-helper`,className:"nice-field__helper",children:t})]})});Vn.displayName="NiceMaskedInput";const Dd=({filled:e,size:t})=>n.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e==="half"&&n.jsx("defs",{children:n.jsxs("linearGradient",{id:"halfGrad",children:[n.jsx("stop",{offset:"50%",stopColor:"currentColor"}),n.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),n.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z",fill:e==="full"?"currentColor":e==="half"?"url(#halfGrad)":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]}),Td={xxs:10,xs:14,sm:18,md:22,lg:28,xl:34,xxl:42},Kn=o.forwardRef(({value:e=0,onChange:t,count:a=5,half:i=!1,readOnly:r=!1,disabled:s=!1,size:l="md",label:c,icon:d,name:u,error:g,id:h,className:p,style:m,...k},b)=>{const{t:C}=Se(),_=ke(h),[f,v]=o.useState(null),j=Td[l],S=!r&&!s,I=f??e,M=A=>I>=A+1?"full":i&&I>=A+.5?"half":"empty",w=o.useCallback((A,N)=>{if(!S)return;const x=N&&i?A+.5:A+1;t==null||t(x===e?0:x)},[S,i,t,e]),E=o.useCallback((A,N)=>{if(S)if(i){const x=N.currentTarget.getBoundingClientRect(),O=N.clientX-x.left<x.width/2;v(O?A+.5:A+1)}else v(A+1)},[S,i]),P=o.useCallback(()=>{S&&v(null)},[S]),L=o.useCallback(A=>{if(!S)return;const N=i?.5:1;if(A.key==="ArrowRight"||A.key==="ArrowUp"){A.preventDefault();const x=Math.min(a,e+N);t==null||t(x)}else if(A.key==="ArrowLeft"||A.key==="ArrowDown"){A.preventDefault();const x=Math.max(0,e-N);t==null||t(x)}},[S,i,a,e,t]);return n.jsxs("div",{className:`nice-field ${p||""}`,style:m,...k,children:[c&&n.jsx("label",{htmlFor:_,className:"nice-field__label",children:c}),n.jsxs("div",{ref:b,id:_,className:`nice-rating nice-rating--${l} ${s?"nice-rating--disabled":""} ${r?"nice-rating--readonly":""}`,role:"slider","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":a,"aria-label":c||C("controls.rating","Rating"),"aria-invalid":!!g,tabIndex:S?0:-1,onMouseLeave:P,onKeyDown:L,children:[u&&n.jsx("input",{type:"hidden",name:u,value:e}),Array.from({length:a},(A,N)=>{const x=M(N);return n.jsx("span",{className:`nice-rating__star nice-rating__star--${x}`,onClick:O=>{if(!S)return;const D=O.currentTarget.getBoundingClientRect(),F=i&&O.clientX-D.left<D.width/2;w(N,F)},onMouseMove:O=>E(N,O),"aria-label":`${N+1} ${C("controls.star","star")}`,children:d?d(x):n.jsx(Dd,{filled:x,size:j})},N)})]}),g&&n.jsx("div",{className:"nice-field__error",role:"alert",children:g})]})});Kn.displayName="NiceRating";const Rd=[{id:"length",label:"At least 8 characters",test:e=>e.length>=8},{id:"uppercase",label:"At least one uppercase letter",test:e=>/[A-Z]/.test(e)},{id:"lowercase",label:"At least one lowercase letter",test:e=>/[a-z]/.test(e)},{id:"digit",label:"At least one digit",test:e=>/\d/.test(e)},{id:"special",label:"At least one special character",test:e=>/[^a-zA-Z0-9]/.test(e)}];function Pd(e,t){if(!e)return{level:"none",passed:[],ratio:0};const a=t.filter(s=>s.test(e)).map(s=>s.id),i=a.length/t.length;let r="weak";return i>=1?r="strong":i>=.75?r="good":i>=.5&&(r="fair"),{level:r,passed:a,ratio:i}}const Un=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,value:h="",onChange:p,onBlur:m,onKeyDown:k,placeholder:b,maxLength:C,showToggle:_=!0,showStrength:f=!1,strengthRules:v,autoFocus:j,autoComplete:S,...I},M)=>{const{t:w}=Se(),E=ke(d),[P,L]=o.useState(!1),A=v??Rd,N=o.useMemo(()=>f?Pd(h,A):null,[f,h,A]),x=o.useCallback(()=>L(O=>!O),[]);return n.jsxs("div",{className:`nice-field ${u||""}`,style:g,children:[e&&n.jsx("label",{htmlFor:E,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:e}),n.jsxs("div",{className:`nice-input nice-input--${l} ${a?"nice-input--error":""} ${r?"nice-input--disabled":""} ${s?"nice-input--readonly":""}`,children:[n.jsx("input",{ref:M,id:E,className:"nice-input__native",type:P?"text":"password",name:c,value:h,placeholder:b,disabled:r,readOnly:s,maxLength:C,autoFocus:j,autoComplete:S,"aria-invalid":!!a,"aria-describedby":a?`${E}-error`:t?`${E}-helper`:void 0,onChange:O=>p==null?void 0:p(O.target.value),onBlur:m,onKeyDown:k,...I}),_&&n.jsx("button",{type:"button",className:"nice-password__toggle",onClick:x,disabled:r,tabIndex:-1,"aria-label":P?w("password.hide","Hide password"):w("password.show","Show password"),children:P?n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"}),n.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),f&&N&&h&&n.jsxs("div",{className:"nice-password__strength",children:[n.jsx("div",{className:"nice-password__meter",children:n.jsx("div",{className:`nice-password__meter-fill nice-password__meter-fill--${N.level}`,style:{width:`${N.ratio*100}%`}})}),n.jsx("span",{className:`nice-password__strength-label nice-password__strength-label--${N.level}`,children:w(`password.strength.${N.level}`,N.level.charAt(0).toUpperCase()+N.level.slice(1))}),n.jsx("ul",{className:"nice-password__rules",children:A.map(O=>{const D=N.passed.includes(O.id);return n.jsxs("li",{className:`nice-password__rule ${D?"nice-password__rule--passed":""}`,children:[n.jsx("span",{className:"nice-password__rule-icon",children:D?"✓":"✗"}),O.label]},O.id)})})]}),a&&n.jsx("div",{id:`${E}-error`,className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{id:`${E}-helper`,className:"nice-field__helper",children:t})]})});Un.displayName="NicePasswordInput";const Yn=o.forwardRef(({length:e=6,value:t="",onChange:a,masked:i=!1,onComplete:r,label:s,helperText:l,error:c,required:d,disabled:u,readOnly:g,size:h="md",name:p,id:m,className:k,style:b,autoFocus:C,..._},f)=>{const v=ke(m),j=o.useRef([]),S=t.padEnd(e,"").slice(0,e).split(""),I=o.useCallback(L=>{var N;const A=Math.max(0,Math.min(e-1,L));(N=j.current[A])==null||N.focus()},[e]),M=o.useCallback(L=>{const A=L.join("");a==null||a(A),A.length===e&&A.indexOf("")===-1&&/^\d+$/.test(A)&&(r==null||r(A))},[a,r,e]),w=o.useCallback((L,A)=>{const N=A.target.value.replace(/\D/g,"").slice(-1);if(!N)return;const x=[...S];x[L]=N,M(x),I(L+1)},[S,M,I]),E=o.useCallback((L,A)=>{if(A.key==="Backspace"){A.preventDefault();const N=[...S];S[L]?(N[L]="",M(N)):L>0&&(N[L-1]="",M(N),I(L-1))}else A.key==="ArrowLeft"?(A.preventDefault(),I(L-1)):A.key==="ArrowRight"&&(A.preventDefault(),I(L+1))},[S,M,I]),P=o.useCallback(L=>{L.preventDefault();const A=L.clipboardData.getData("text").replace(/\D/g,"").slice(0,e);if(!A)return;const N=A.padEnd(e,"").slice(0,e).split("");for(let x=A.length;x<e;x++)N[x]=S[x]||"";M(N),I(Math.min(A.length,e-1))},[e,S,M,I]);return n.jsxs("div",{className:`nice-field ${k||""}`,style:b,..._,children:[s&&n.jsx("label",{htmlFor:`${v}-0`,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:s}),n.jsxs("div",{ref:f,className:`nice-otp nice-otp--${h} ${c?"nice-otp--error":""} ${u?"nice-otp--disabled":""}`,onPaste:P,children:[Array.from({length:e},(L,A)=>n.jsx("input",{ref:N=>{j.current[A]=N},id:A===0?`${v}-0`:void 0,className:"nice-otp__digit",type:i?"password":"text",inputMode:"numeric",maxLength:2,value:S[A]||"",disabled:u,readOnly:g,autoFocus:C&&A===0,"aria-invalid":!!c,"aria-label":`${A+1}`,onChange:N=>w(A,N),onKeyDown:N=>E(A,N),onFocus:N=>N.target.select()},A)),p&&n.jsx("input",{type:"hidden",name:p,value:t})]}),c&&n.jsx("div",{id:`${v}-error`,className:"nice-field__error",role:"alert",children:c}),!c&&l&&n.jsx("div",{id:`${v}-helper`,className:"nice-field__helper",children:l})]})});Yn.displayName="NiceInputOtp";const Bd={xxs:36,xs:48,sm:64,md:80,lg:100,xl:128,xxl:160},Vt=6,Ve=135,Mt=405,mn=Mt-Ve;function vn(e,t,a,i){const r=(i-90)*(Math.PI/180);return{x:e+a*Math.cos(r),y:t+a*Math.sin(r)}}function za(e,t,a,i,r){const s=vn(e,t,a,i),l=vn(e,t,a,r),c=r-i>180?1:0;return`M ${s.x} ${s.y} A ${a} ${a} 0 ${c} 1 ${l.x} ${l.y}`}const Zn=o.forwardRef(({value:e=0,onChange:t,min:a=0,max:i=100,step:r=1,showValue:s=!0,valueTemplate:l="{value}",label:c,helperText:d,error:u,required:g,disabled:h,readOnly:p,size:m="md",name:k,id:b,className:C,style:_,...f},v)=>{const j=ke(b),S=o.useRef(!1),I=o.useRef(null),M=typeof m=="number"?m:Bd[m],w=M/2,E=M/2,P=(M-Vt*2)/2,L=i>a?(e-a)/(i-a):0,A=Ve+L*mn,N=o.useCallback(y=>{let $=y<0?y+360:y;$=$+90,$>360&&($-=360),$<Ve&&($=Ve),$>Mt-360&&$<Ve&&($=Ve);let z=$;z<Ve&&(z+=360);let R=(z-Ve)/mn;R=Math.max(0,Math.min(1,R));const T=a+R*(i-a);return Math.round(T/r)*r},[a,i,r]),x=o.useCallback(y=>{if(h||p)return;const $=I.current;if(!$)return;const z=$.getBoundingClientRect(),R=y.clientX-z.left-z.width/2,T=y.clientY-z.top-z.height/2,B=Math.atan2(T,R)*(180/Math.PI)+90;let V=B<0?B+360:B;V<Ve-360+mn&&V>Mt-360&&(V=V<180?Mt-360:Ve);const K=N(V-90),H=Math.max(a,Math.min(i,K));t==null||t(H)},[N,h,p,a,i,t]);o.useEffect(()=>{const y=z=>{S.current&&x(z)},$=()=>{S.current=!1};return window.addEventListener("pointermove",y),window.addEventListener("pointerup",$),()=>{window.removeEventListener("pointermove",y),window.removeEventListener("pointerup",$)}},[x]);const O=o.useCallback(y=>{if(h||p)return;let $=e;y.key==="ArrowUp"||y.key==="ArrowRight"?(y.preventDefault(),$=Math.min(i,e+r)):(y.key==="ArrowDown"||y.key==="ArrowLeft")&&(y.preventDefault(),$=Math.max(a,e-r)),$!==e&&(t==null||t($))},[e,t,a,i,r,h,p]),D=l.replace("{value}",String(e)),F=vn(w,E,P,A);return n.jsxs("div",{className:`nice-field ${C||""}`,style:_,...f,children:[c&&n.jsx("label",{htmlFor:j,className:`nice-field__label ${g?"nice-field__label--required":""}`,children:c}),n.jsxs("div",{ref:y=>{I.current=y,typeof v=="function"?v(y):v&&(v.current=y)},className:`nice-knob nice-knob--${m} ${h?"nice-knob--disabled":""} ${u?"nice-knob--error":""}`,role:"slider",id:j,tabIndex:h?-1:0,"aria-valuenow":e,"aria-valuemin":a,"aria-valuemax":i,"aria-disabled":h,"aria-invalid":!!u,onPointerDown:y=>{h||p||(S.current=!0,x(y))},onKeyDown:O,children:[n.jsxs("svg",{width:M,height:M,viewBox:`0 0 ${M} ${M}`,children:[n.jsx("path",{d:za(w,E,P,Ve,Mt),fill:"none",stroke:"var(--nice-border-color, #d1d5db)",strokeWidth:Vt,strokeLinecap:"round"}),L>0&&n.jsx("path",{d:za(w,E,P,Ve,A),fill:"none",stroke:"var(--nice-primary, #3b82f6)",strokeWidth:Vt,strokeLinecap:"round"}),n.jsx("circle",{cx:F.x,cy:F.y,r:Vt,fill:"var(--nice-primary, #3b82f6)"})]}),s&&n.jsx("span",{className:"nice-knob__value",children:D}),k&&n.jsx("input",{type:"hidden",name:k,value:e})]}),u&&n.jsx("div",{className:"nice-field__error",role:"alert",children:u}),!u&&d&&n.jsx("div",{className:"nice-field__helper",children:d})]})});Zn.displayName="NiceKnob";const Gn=o.forwardRef(({value:e="",onChange:t,suggestions:a=[],onSearch:i,trigger:r="@",renderSuggestion:s,placeholder:l,rows:c=3,label:d,helperText:u,error:g,required:h,disabled:p,readOnly:m,size:k="md",name:b,id:C,className:_,style:f,...v},j)=>{const S=ke(C),[I,M]=o.useState(!1),[w,E]=o.useState(""),[P,L]=o.useState(0),[A,N]=o.useState({top:0,left:0}),x=o.useRef(null),O=o.useRef(-1),D=a.map(R=>typeof R=="string"?{key:R,label:R}:R).filter(R=>R.label.toLowerCase().includes(w.toLowerCase())),F=o.useCallback(()=>{M(!1),E(""),L(0),O.current=-1},[]),y=o.useCallback(R=>{const T=x.current;if(!T||O.current<0)return;const B=e.slice(0,O.current),V=e.slice(T.selectionStart),K=`${r}${R.label} `,H=B+K+V;t==null||t(H),F(),requestAnimationFrame(()=>{const q=B.length+K.length;T.setSelectionRange(q,q),T.focus()})},[e,t,r,F]),$=o.useCallback(R=>{const T=R.target.value;t==null||t(T);const B=R.target.selectionStart,V=T.slice(0,B),K=V.lastIndexOf(r);if(K>=0){const H=K>0?V[K-1]:" ",q=V.slice(K+r.length);if(/\s/.test(H)&&!/\s/.test(q)){O.current=K;const Z=q;E(Z),M(!0),L(0),i==null||i(Z);const Q=R.target,J=Q.getBoundingClientRect(),ee=parseInt(getComputedStyle(Q).lineHeight)||20,ie=V.split(`
629
+ `);N({top:J.top+ie.length*ee+4-Q.scrollTop,left:J.left+8});return}}F()},[t,r,i,F]),z=o.useCallback(R=>{!I||D.length===0||(R.key==="ArrowDown"?(R.preventDefault(),L(T=>(T+1)%D.length)):R.key==="ArrowUp"?(R.preventDefault(),L(T=>(T-1+D.length)%D.length)):R.key==="Enter"?(R.preventDefault(),D[P]&&y(D[P])):R.key==="Escape"&&F())},[I,D,P,y,F]);return o.useEffect(()=>{if(!I)return;const R=T=>{const B=x.current;B&&!B.contains(T.target)&&F()};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[I,F]),n.jsxs("div",{className:`nice-field ${_||""}`,style:f,...v,children:[d&&n.jsx("label",{htmlFor:S,className:`nice-field__label ${h?"nice-field__label--required":""}`,children:d}),n.jsxs("div",{className:`nice-mention nice-mention--${k} ${g?"nice-mention--error":""} ${p?"nice-mention--disabled":""}`,children:[n.jsx("textarea",{ref:R=>{x.current=R,typeof j=="function"?j(R):j&&(j.current=R)},id:S,name:b,className:"nice-mention__input",value:e,onChange:$,onKeyDown:z,placeholder:l,rows:c,disabled:p,readOnly:m,"aria-invalid":!!g,"aria-describedby":g?`${S}-error`:u?`${S}-helper`:void 0,"aria-autocomplete":"list","aria-expanded":I}),I&&D.length>0&&n.jsx("ul",{className:"nice-mention__suggestions",role:"listbox",style:{position:"fixed",top:A.top,left:A.left},children:D.map((R,T)=>n.jsx("li",{role:"option","aria-selected":T===P,className:`nice-mention__suggestion ${T===P?"nice-mention__suggestion--active":""}`,onMouseDown:B=>{B.preventDefault(),y(R)},onMouseEnter:()=>L(T),children:s?s(R):n.jsxs(n.Fragment,{children:[R.icon&&n.jsx("span",{className:"nice-mention__suggestion-icon",children:R.icon}),n.jsx("span",{children:R.label})]})},R.key))})]}),g&&n.jsx("div",{id:`${S}-error`,className:"nice-field__error",role:"alert",children:g}),!g&&u&&n.jsx("div",{id:`${S}-helper`,className:"nice-field__helper",children:u})]})});Gn.displayName="NiceMention";function Ld(e){const t=[],a=i=>{for(const r of i)t.push(r),r.children&&a(r.children)};return a(e),t}function Ti(e,t){const a=t.toLowerCase();return e.reduce((i,r)=>{const s=r.children?Ti(r.children,t):[];return(r.label.toLowerCase().includes(a)||s.length>0)&&i.push({...r,children:s.length>0?s:r.children}),i},[])}const Ri=({node:e,level:t,selectedKeys:a,expandedKeys:i,onToggleExpand:r,onSelect:s,selectableLeafsOnly:l})=>{const c=e.children&&e.children.length>0,d=i.has(e.key),u=a.has(e.key),g=!c,h=!e.disabled&&(!l||g);return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`nice-tree-select__node ${u?"nice-tree-select__node--selected":""} ${e.disabled?"nice-tree-select__node--disabled":""}`,style:{paddingLeft:t*16+8},onClick:()=>h&&s(e.key),role:"treeitem","aria-selected":u,"aria-expanded":c?d:void 0,"aria-disabled":e.disabled,children:[c?n.jsx("button",{type:"button",className:"nice-tree-select__toggle",onClick:p=>{p.stopPropagation(),r(e.key)},"aria-label":"Toggle",children:n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",style:{transform:d?"rotate(90deg)":"none",transition:"transform 0.15s"},children:n.jsx("path",{d:"M4.5 2l4 4-4 4"})})}):n.jsx("span",{style:{width:12,display:"inline-block"}}),e.icon&&n.jsx("span",{className:"nice-tree-select__node-icon",children:e.icon}),n.jsx("span",{className:"nice-tree-select__node-label",children:e.label})]}),c&&d&&e.children.map(p=>n.jsx(Ri,{node:p,level:t+1,selectedKeys:a,expandedKeys:i,onToggleExpand:r,onSelect:s,selectableLeafsOnly:l},p.key))]})},Xn=o.forwardRef(({nodes:e,value:t,onChange:a,multiple:i=!1,searchable:r=!1,placeholder:s,selectableLeafsOnly:l=!1,clearable:c=!1,label:d,helperText:u,error:g,required:h,disabled:p,readOnly:m,size:k="md",name:b,id:C,className:_,style:f,...v},j)=>{const{t:S}=Se(),I=ke(C),[M,w]=o.useState(!1),[E,P]=o.useState(""),[L,A]=o.useState(new Set),N=o.useRef(null);ot(N,()=>w(!1));const x=o.useMemo(()=>t==null?new Set:new Set(Array.isArray(t)?t:[t]),[t]),O=o.useMemo(()=>E?Ti(e,E):e,[e,E]),D=o.useMemo(()=>{const z=Ld(e);return Array.from(x).map(R=>{var T;return(T=z.find(B=>B.key===R))==null?void 0:T.label}).filter(Boolean)},[x,e]),F=o.useCallback(z=>{A(R=>{const T=new Set(R);return T.has(z)?T.delete(z):T.add(z),T})},[]),y=o.useCallback(z=>{if(i){const R=new Set(x);R.has(z)?R.delete(z):R.add(z),a==null||a(Array.from(R))}else a==null||a(z),w(!1)},[i,x,a]),$=o.useCallback(z=>{z.stopPropagation(),a==null||a(i?[]:"")},[a,i]);return n.jsxs("div",{className:`nice-field ${_||""}`,style:f,...v,children:[d&&n.jsx("label",{htmlFor:I,className:`nice-field__label ${h?"nice-field__label--required":""}`,children:d}),n.jsxs("div",{ref:N,className:"nice-tree-select",style:{position:"relative"},children:[n.jsxs("div",{ref:j,id:I,className:`nice-input nice-input--${k} ${g?"nice-input--error":""} ${p?"nice-input--disabled":""} ${m?"nice-input--readonly":""}`,role:"combobox","aria-expanded":M,"aria-haspopup":"tree","aria-invalid":!!g,tabIndex:p?-1:0,onClick:()=>!p&&!m&&w(!M),onKeyDown:z=>{(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),!p&&!m&&w(!M))},children:[n.jsx("span",{className:"nice-tree-select__display",children:D.length>0?D.join(", "):n.jsx("span",{className:"nice-tree-select__placeholder",children:s??S("controls.select","Select...")})}),c&&x.size>0&&n.jsx("button",{type:"button",className:"nice-input__clear",onClick:$,"aria-label":S("controls.clear","Clear"),children:"✕"}),n.jsx("svg",{className:"nice-tree-select__arrow",width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",style:{transform:M?"rotate(180deg)":"none",transition:"transform 0.15s"},children:n.jsx("path",{d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"})})]}),M&&n.jsxs("div",{className:"nice-tree-select__dropdown",role:"tree",children:[r&&n.jsx("div",{className:"nice-tree-select__search",children:n.jsx("input",{className:"nice-input__native",type:"text",placeholder:S("controls.search","Search..."),value:E,onChange:z=>P(z.target.value),autoFocus:!0,onClick:z=>z.stopPropagation()})}),n.jsx("div",{className:"nice-tree-select__list",children:O.length===0?n.jsx("div",{className:"nice-tree-select__empty",children:S("controls.noResults","No results")}):O.map(z=>n.jsx(Ri,{node:z,level:0,selectedKeys:x,expandedKeys:L,onToggleExpand:F,onSelect:y,selectableLeafsOnly:l},z.key))})]})]}),b&&n.jsx("input",{type:"hidden",name:b,value:Array.isArray(t)?t.join(","):t??""}),g&&n.jsx("div",{id:`${I}-error`,className:"nice-field__error",role:"alert",children:g}),!g&&u&&n.jsx("div",{id:`${I}-helper`,className:"nice-field__helper",children:u})]})});Xn.displayName="NiceTreeSelect";function _t(e,t){return String(e[t])}const Qn=o.forwardRef(({source:e,target:t,onChange:a,keyField:i="id",labelField:r="label",renderItem:s,filterable:l=!1,sourceHeader:c,targetHeader:d,disabled:u=!1,size:g="md",className:h,style:p,id:m,...k},b)=>{const{t:C}=Se(),[_,f]=o.useState(new Set),[v,j]=o.useState(new Set),[S,I]=o.useState(""),[M,w]=o.useState(""),E=o.useCallback((D,F,y)=>{F($=>{const z=new Set($);return z.has(y)?z.delete(y):z.add(y),z})},[]),P=o.useCallback(()=>{const D=e.filter(y=>_.has(_t(y,i))),F=e.filter(y=>!_.has(_t(y,i)));a(F,[...t,...D]),f(new Set)},[e,t,_,i,a]),L=o.useCallback(()=>{const D=t.filter(y=>v.has(_t(y,i))),F=t.filter(y=>!v.has(_t(y,i)));a([...e,...D],F),j(new Set)},[e,t,v,i,a]),A=o.useCallback(()=>{a([],[...t,...e]),f(new Set)},[e,t,a]),N=o.useCallback(()=>{a([...e,...t],[]),j(new Set)},[e,t,a]),x=(D,F)=>{if(!F)return D;const y=F.toLowerCase();return D.filter($=>String($[r]).toLowerCase().includes(y))},O=(D,F,y,$,z,R)=>{const T=x(D,$);return n.jsxs("div",{className:"nice-picklist__panel",children:[R&&n.jsx("div",{className:"nice-picklist__header",children:R}),l&&n.jsx("div",{className:"nice-picklist__filter",children:n.jsx("input",{className:"nice-input__native",type:"text",placeholder:C("controls.search","Search..."),value:$,onChange:B=>z(B.target.value)})}),n.jsxs("div",{className:"nice-picklist__list",role:"listbox","aria-multiselectable":"true",children:[T.map(B=>{const V=_t(B,i),K=F.has(V);return n.jsx("div",{className:`nice-picklist__item ${K?"nice-picklist__item--selected":""}`,role:"option","aria-selected":K,onClick:()=>!u&&E(F,y,V),children:s?s(B):String(B[r])},V)}),T.length===0&&n.jsx("div",{className:"nice-picklist__empty",children:C("controls.noItems","No items")})]})]})};return n.jsxs("div",{ref:b,id:m,className:`nice-picklist nice-picklist--${g} ${u?"nice-picklist--disabled":""} ${h||""}`,style:p,...k,children:[O(e,_,f,S,I,c??C("picklist.source","Available")),n.jsxs("div",{className:"nice-picklist__controls",children:[n.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:u||_.size===0,onClick:P,"aria-label":C("picklist.moveRight","Move right"),children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"})})}),n.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:u||e.length===0,onClick:A,"aria-label":C("picklist.moveAllRight","Move all right"),children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:[n.jsx("path",{d:"M4.293 14.707a1 1 0 010-1.414L7.586 10 4.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"}),n.jsx("path",{d:"M10.293 14.707a1 1 0 010-1.414L13.586 10 10.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"})]})}),n.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:u||v.size===0,onClick:L,"aria-label":C("picklist.moveLeft","Move left"),children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"})})}),n.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:u||t.length===0,onClick:N,"aria-label":C("picklist.moveAllLeft","Move all left"),children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:[n.jsx("path",{d:"M15.707 5.293a1 1 0 010 1.414L12.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"}),n.jsx("path",{d:"M9.707 5.293a1 1 0 010 1.414L6.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"})]})})]}),O(t,v,j,M,w,d??C("picklist.target","Selected"))]})});Qn.displayName="NicePickList";let hn=null,jt=null;const Aa="https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min/vs";function Pi(){return jt?Promise.resolve(jt):hn||(hn=new Promise((e,t)=>{if(window.monaco){jt=window.monaco,e(jt);return}const a=document.createElement("script");a.src=`${Aa}/loader.min.js`,a.async=!0,a.onload=()=>{const i=window.require;i.config({paths:{vs:Aa}}),i(["vs/editor/editor.main"],r=>{jt=r,e(r)})},a.onerror=()=>{t(new Error("Failed to load Monaco Editor"))},document.head.appendChild(a)}),hn)}const Jn=o.forwardRef(function(e,t){const{value:a,onChange:i,language:r="plaintext",theme:s="vs",options:l={},height:c=400,width:d="100%",markers:u=[],decorations:g=[],completionProvider:h,onMount:p,onCursorPositionChange:m,onSelectionChange:k,onSave:b,loading:C,disabled:_=!1,showToolbar:f=!1,showStatusBar:v=!1,editorSize:j="standard",className:S,"data-testid":I}=e,M=o.useRef(null),w=o.useRef(null),E=o.useRef(null),P=o.useRef([]),L=o.useRef(null),[A,N]=o.useState(!0),[x,O]=o.useState(null),[D,F]=o.useState({lineNumber:1,column:1}),[y,$]=o.useState(""),[z,R]=o.useState(l.wordWrap==="on"),T=o.useMemo(()=>({automaticLayout:!0,readOnly:_||l.readOnly,minimap:{enabled:l.minimap??!0},lineNumbers:l.lineNumbers??"on",wordWrap:l.wordWrap??"off",tabSize:l.tabSize??2,insertSpaces:l.insertSpaces??!0,fontSize:l.fontSize??14,fontFamily:l.fontFamily??"'Fira Code', 'Consolas', 'Monaco', monospace",fontLigatures:l.fontLigatures??!0,cursorStyle:l.cursorStyle??"line",cursorBlinking:l.cursorBlinking??"blink",autoClosingBrackets:l.autoClosingBrackets??"languageDefined",autoClosingQuotes:l.autoClosingQuotes??"languageDefined",formatOnPaste:l.formatOnPaste??!1,formatOnType:l.formatOnType??!1,renderWhitespace:l.renderWhitespace??"selection",renderControlCharacters:l.renderControlCharacters??!1,scrollBeyondLastLine:l.scrollBeyondLastLine??!0,smoothScrolling:l.smoothScrolling??!0,folding:l.folding??!0,showFoldingControls:l.showFoldingControls??"mouseover","bracketPairColorization.enabled":l.bracketPairColorization??!0,guides:l.guides??{bracketPairs:!0,indentation:!0,highlightActiveIndentation:!0},stickyScroll:{enabled:l.stickyScroll??!1},quickSuggestions:l.quickSuggestions??!0,suggestOnTriggerCharacters:l.suggestOnTriggerCharacters??!0,acceptSuggestionOnEnter:l.acceptSuggestionOnEnter??"on",inlayHints:{enabled:l.inlayHints?"on":"off"}}),[l,_]);o.useEffect(()=>{if(!M.current)return;let H=!0;return Pi().then(q=>{if(!H||!M.current)return;E.current=q;const Z=q.editor.create(M.current,{value:a,language:r,theme:s,...T});w.current=Z,N(!1),Z.onDidChangeModelContent(()=>{const Q=Z.getValue();i==null||i(Q)}),Z.onDidChangeCursorPosition(Q=>{F({lineNumber:Q.position.lineNumber,column:Q.position.column}),m==null||m({lineNumber:Q.position.lineNumber,column:Q.position.column})}),Z.onDidChangeCursorSelection(Q=>{var ie;const J=Q.selection,ee=((ie=Z.getModel())==null?void 0:ie.getValueInRange(J))??"";$(ee),k==null||k({startLineNumber:J.startLineNumber,startColumn:J.startColumn,endLineNumber:J.endLineNumber,endColumn:J.endColumn})}),Z.addCommand(q.KeyMod.CtrlCmd|q.KeyCode.KeyS,()=>{b==null||b(Z.getValue())}),p==null||p(Z,q)}).catch(q=>{H&&(O(q.message??"Failed to load editor"),N(!1))}),()=>{var q,Z;H=!1,(q=w.current)==null||q.dispose(),(Z=L.current)==null||Z.dispose()}},[]),o.useEffect(()=>{const H=w.current;if(H&&a!==H.getValue()){const q=H.getPosition();H.setValue(a),q&&H.setPosition(q)}},[a]),o.useEffect(()=>{const H=w.current,q=E.current;if(H&&q){const Z=H.getModel();Z&&q.editor.setModelLanguage(Z,r)}},[r]),o.useEffect(()=>{const H=E.current;H&&H.editor.setTheme(s)},[s]),o.useEffect(()=>{const H=w.current;H&&H.updateOptions(T)},[T]),o.useEffect(()=>{const H=w.current,q=E.current;if(H&&q){const Z=H.getModel();if(Z){const Q=u.map(J=>({startLineNumber:J.startLineNumber,startColumn:J.startColumn,endLineNumber:J.endLineNumber,endColumn:J.endColumn,message:J.message,severity:J.severity}));q.editor.setModelMarkers(Z,"owner",Q)}}},[u]),o.useEffect(()=>{const H=w.current;if(H&&g.length>0){const q=g.map(Z=>({range:{startLineNumber:Z.range.startLineNumber,startColumn:Z.range.startColumn,endLineNumber:Z.range.endLineNumber,endColumn:Z.range.endColumn},options:{className:Z.className,glyphMarginClassName:Z.glyphMarginClassName,hoverMessage:Z.hoverMessage?{value:Z.hoverMessage}:void 0,isWholeLine:Z.isWholeLine}}));P.current=H.deltaDecorations(P.current,q)}},[g]),o.useEffect(()=>{var Z;const H=E.current;if(!H||!h)return;(Z=L.current)==null||Z.dispose();const q={text:0,method:1,function:2,constructor:3,field:4,variable:5,class:6,interface:7,module:8,property:9,keyword:13,snippet:14,color:15,file:16,reference:17,folder:18};return L.current=H.languages.registerCompletionItemProvider(r,{provideCompletionItems:async(Q,J)=>({suggestions:(await h(Q,J)).map(ee=>({label:ee.label,kind:q[ee.kind]??0,insertText:ee.insertText,insertTextRules:ee.insertTextRules==="insertAsSnippet"?4:void 0,documentation:ee.documentation,detail:ee.detail,range:{startLineNumber:J.lineNumber,startColumn:J.column,endLineNumber:J.lineNumber,endColumn:J.column}}))})}),()=>{var Q;(Q=L.current)==null||Q.dispose()}},[r,h]),o.useImperativeHandle(t,()=>({getEditor:()=>w.current,getMonaco:()=>E.current,focus:()=>{var H;return(H=w.current)==null?void 0:H.focus()},getValue:()=>{var H;return((H=w.current)==null?void 0:H.getValue())??""},setValue:H=>{var q;return(q=w.current)==null?void 0:q.setValue(H)},getSelection:()=>{var Z;const H=w.current;if(!H)return"";const q=H.getSelection();return q?((Z=H.getModel())==null?void 0:Z.getValueInRange(q))??"":""},insertText:H=>{const q=w.current;if(!q)return;const Z=q.getSelection();Z&&q.executeEdits("",[{range:Z,text:H}])},formatDocument:()=>{var H,q;(q=(H=w.current)==null?void 0:H.getAction("editor.action.formatDocument"))==null||q.run()},goToLine:(H,q=1)=>{const Z=w.current;Z&&(Z.setPosition({lineNumber:H,column:q}),Z.revealLineInCenter(H),Z.focus())},findReplace:()=>{var H,q;(q=(H=w.current)==null?void 0:H.getAction("editor.action.startFindReplaceAction"))==null||q.run()},undo:()=>{var H;(H=w.current)==null||H.trigger("keyboard","undo",null)},redo:()=>{var H;(H=w.current)==null||H.trigger("keyboard","redo",null)},getCursorPosition:()=>{var q;const H=(q=w.current)==null?void 0:q.getPosition();return{lineNumber:(H==null?void 0:H.lineNumber)??1,column:(H==null?void 0:H.column)??1}},setMarkers:H=>{const q=w.current,Z=E.current;if(q&&Z){const Q=q.getModel();if(Q){const J=H.map(ee=>({startLineNumber:ee.startLineNumber,startColumn:ee.startColumn,endLineNumber:ee.endLineNumber,endColumn:ee.endColumn,message:ee.message,severity:ee.severity}));Z.editor.setModelMarkers(Q,"owner",J)}}}}),[]);const B=o.useMemo(()=>({format:()=>{var H,q;return(q=(H=w.current)==null?void 0:H.getAction("editor.action.formatDocument"))==null?void 0:q.run()},undo:()=>{var H;return(H=w.current)==null?void 0:H.trigger("keyboard","undo",null)},redo:()=>{var H;return(H=w.current)==null?void 0:H.trigger("keyboard","redo",null)},find:()=>{var H,q;return(q=(H=w.current)==null?void 0:H.getAction("editor.action.startFindReplaceAction"))==null?void 0:q.run()},toggleWordWrap:()=>{var q;const H=!z;R(H),(q=w.current)==null||q.updateOptions({wordWrap:H?"on":"off"})},toggleMinimap:()=>{var q,Z,Q,J,ee,ie;const H=(ee=(q=w.current)==null?void 0:q.getOption)==null?void 0:ee.call(q,(J=(Q=(Z=E.current)==null?void 0:Z.editor)==null?void 0:Q.EditorOption)==null?void 0:J.minimap);(ie=w.current)==null||ie.updateOptions({minimap:{enabled:!(H!=null&&H.enabled)}})},foldAll:()=>{var H,q;return(q=(H=w.current)==null?void 0:H.getAction("editor.foldAll"))==null?void 0:q.run()},unfoldAll:()=>{var H,q;return(q=(H=w.current)==null?void 0:H.getAction("editor.unfoldAll"))==null?void 0:q.run()}}),[z]),V=a.split(`
630
+ `).length,K=a.length;return A?n.jsx("div",{className:`nice-code-editor nice-code-editor--loading ${S??""}`,style:{height:c,width:d},"data-testid":I,children:C??n.jsx("div",{className:"nice-code-editor__loader",children:"Loading editor..."})}):x?n.jsx("div",{className:`nice-code-editor nice-code-editor--error ${S??""}`,style:{height:c,width:d},"data-testid":I,children:n.jsxs("div",{className:"nice-code-editor__error",children:[n.jsxs("span",{children:["⚠️ ",x]}),n.jsx("textarea",{value:a,onChange:H=>i==null?void 0:i(H.target.value),readOnly:_||l.readOnly,style:{width:"100%",height:"100%",fontFamily:"monospace"}})]})}):n.jsxs("div",{className:`nice-code-editor-wrap nice-editor--${j} ${S??""}`,style:{height:c,width:d,display:"flex",flexDirection:"column"},"data-testid":I,children:[f&&n.jsxs("div",{className:"nice-code-editor__toolbar",children:[n.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:B.undo,title:"Undo (Ctrl+Z)",children:"↶"}),n.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:B.redo,title:"Redo (Ctrl+Y)",children:"↷"}),n.jsx("span",{className:"nice-code-editor__toolbar-sep"}),n.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:B.format,title:"Format (Shift+Alt+F)",children:"⎘"}),n.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:B.find,title:"Find & Replace (Ctrl+H)",children:"🔍"}),n.jsx("span",{className:"nice-code-editor__toolbar-sep"}),n.jsx("button",{className:`nice-code-editor__toolbar-btn${z?" nice-code-editor__toolbar-btn--active":""}`,onClick:B.toggleWordWrap,title:"Toggle Word Wrap",children:"↩"}),n.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:B.toggleMinimap,title:"Toggle Minimap",children:"▥"}),n.jsx("span",{className:"nice-code-editor__toolbar-sep"}),n.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:B.foldAll,title:"Fold All",children:"⊟"}),n.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:B.unfoldAll,title:"Unfold All",children:"⊞"})]}),n.jsx("div",{ref:M,className:"nice-code-editor",style:{flex:1,minHeight:0}}),v&&n.jsxs("div",{className:"nice-code-editor__statusbar",children:[n.jsxs("span",{children:["Ln ",D.lineNumber,", Col ",D.column]}),y.length>0&&n.jsxs("span",{children:["(",y.length," selected)"]}),n.jsx("span",{className:"nice-code-editor__statusbar-spacer"}),n.jsxs("span",{children:[V," lines · ",K," chars"]}),n.jsx("span",{className:"nice-code-editor__statusbar-lang",children:r}),u.length>0&&n.jsxs("span",{className:"nice-code-editor__statusbar-markers",children:["⚠ ",u.length]})]})]})});function Bi(e){const{original:t,modified:a,language:i="plaintext",theme:r="vs",height:s=400,width:l="100%",inline:c=!1,renderSideBySide:d=!0,originalEditable:u=!1,modifiedEditable:g=!1,onOriginalChange:h,onModifiedChange:p,loading:m,className:k,"data-testid":b}=e,C=o.useRef(null),_=o.useRef(null),[f,v]=o.useState(!0);return o.useEffect(()=>{if(!C.current)return;let j=!0;return Pi().then(S=>{if(!j||!C.current)return;const I=S.editor.createModel(t,i),M=S.editor.createModel(a,i),w=S.editor.createDiffEditor(C.current,{automaticLayout:!0,theme:r,renderSideBySide:!c&&d,originalEditable:u,readOnly:!g});w.setModel({original:I,modified:M}),_.current=w,v(!1),u&&I.onDidChangeContent(()=>{h==null||h(I.getValue())}),g&&M.onDidChangeContent(()=>{p==null||p(M.getValue())})}),()=>{var S;j=!1,(S=_.current)==null||S.dispose()}},[]),o.useEffect(()=>{const j=_.current;if(!j)return;const S=j.getModel();S&&(S.original.getValue()!==t&&S.original.setValue(t),S.modified.getValue()!==a&&S.modified.setValue(a))},[t,a]),f?n.jsx("div",{className:`nice-code-diff-editor nice-code-diff-editor--loading ${k??""}`,style:{height:s,width:l},"data-testid":b,children:m??n.jsx("div",{className:"nice-code-editor__loader",children:"Loading diff editor..."})}):n.jsx("div",{ref:C,className:`nice-code-diff-editor ${k??""}`,style:{height:s,width:l},"data-testid":b})}function Li(e){const{value:t,onChange:a,language:i="plaintext",height:r=300,width:s="100%",readOnly:l=!1,tabSize:c=2,lineNumbers:d=!0,placeholder:u,className:g,"data-testid":h}=e,p=o.useRef(null),m=o.useCallback(b=>{var C;if(b.key==="Tab"){b.preventDefault();const _=b.currentTarget,f=_.selectionStart,v=_.selectionEnd,j=" ".repeat(c);if(b.shiftKey){const S=t.substring(0,f).lastIndexOf(`
631
+ `)+1;if((((C=t.substring(S,f).match(/^(\s*)/))==null?void 0:C[1])??"").length>=c){const I=t.substring(0,S)+t.substring(S+c);a==null||a(I),setTimeout(()=>{_.selectionStart=_.selectionEnd=f-c},0)}}else{const S=t.substring(0,f)+j+t.substring(v);a==null||a(S),setTimeout(()=>{_.selectionStart=_.selectionEnd=f+c},0)}}},[t,a,c]),k=t.split(`
632
+ `).length;return n.jsxs("div",{className:`nice-simple-code-editor ${g??""}`,style:{height:r,width:s},"data-testid":h,"data-language":i,children:[d&&n.jsx("div",{className:"nice-simple-code-editor__line-numbers",children:Array.from({length:k},(b,C)=>n.jsx("div",{className:"nice-simple-code-editor__line-number",children:C+1},C))}),n.jsx("textarea",{ref:p,className:"nice-simple-code-editor__textarea",value:t,onChange:b=>a==null?void 0:a(b.target.value),onKeyDown:m,readOnly:l,placeholder:u,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off"})]})}const Fa="nice-code-editor-styles";if(typeof document<"u"&&!document.getElementById(Fa)){const e=document.createElement("style");e.id=Fa,e.textContent=`
633
+ .nice-code-editor,
634
+ .nice-code-diff-editor {
635
+ border: 1px solid var(--nice-border, #e0e0e0);
636
+ border-radius: 4px;
637
+ overflow: hidden;
638
+ }
639
+
640
+ .nice-code-editor--loading,
641
+ .nice-code-editor--error,
642
+ .nice-code-diff-editor--loading {
643
+ display: flex;
644
+ align-items: center;
645
+ justify-content: center;
646
+ background: var(--nice-bg-muted, #f5f5f5);
647
+ }
648
+
649
+ .nice-code-editor__loader {
650
+ color: var(--nice-text-secondary, #666);
651
+ font-size: 14px;
652
+ }
653
+
654
+ .nice-code-editor__error {
655
+ display: flex;
656
+ flex-direction: column;
657
+ width: 100%;
658
+ height: 100%;
659
+ padding: 8px;
660
+ gap: 8px;
661
+ }
662
+
663
+ .nice-code-editor__error span {
664
+ color: var(--nice-error, #d32f2f);
665
+ }
666
+
667
+ /* Simple code editor */
668
+ .nice-simple-code-editor {
669
+ display: flex;
670
+ border: 1px solid var(--nice-border, #e0e0e0);
671
+ border-radius: 4px;
672
+ overflow: hidden;
673
+ font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
674
+ font-size: 14px;
675
+ line-height: 1.5;
676
+ background: var(--nice-bg-surface, #fff);
677
+ }
678
+
679
+ .nice-simple-code-editor__line-numbers {
680
+ padding: 8px 0;
681
+ background: var(--nice-bg-muted, #f5f5f5);
682
+ border-right: 1px solid var(--nice-border, #e0e0e0);
683
+ user-select: none;
684
+ text-align: right;
685
+ color: var(--nice-text-secondary, #999);
686
+ }
687
+
688
+ .nice-simple-code-editor__line-number {
689
+ padding: 0 12px;
690
+ min-width: 40px;
691
+ }
692
+
693
+ .nice-simple-code-editor__textarea {
694
+ flex: 1;
695
+ padding: 8px 12px;
696
+ border: none;
697
+ outline: none;
698
+ resize: none;
699
+ font: inherit;
700
+ background: transparent;
701
+ color: var(--nice-text-primary, #333);
702
+ white-space: pre;
703
+ overflow-wrap: normal;
704
+ overflow-x: auto;
705
+ }
706
+
707
+ .nice-simple-code-editor__textarea::placeholder {
708
+ color: var(--nice-text-secondary, #999);
709
+ }
710
+
711
+ /* Toolbar */
712
+ .nice-code-editor-wrap {
713
+ border: 1px solid var(--nice-border, #e0e0e0);
714
+ border-radius: 4px;
715
+ overflow: hidden;
716
+ }
717
+ .nice-code-editor-wrap .nice-code-editor {
718
+ border: none;
719
+ border-radius: 0;
720
+ }
721
+ .nice-code-editor__toolbar {
722
+ display: flex;
723
+ align-items: center;
724
+ gap: 2px;
725
+ padding: 3px 6px;
726
+ background: var(--nice-bg-muted, #f5f5f5);
727
+ border-bottom: 1px solid var(--nice-border, #e0e0e0);
728
+ }
729
+ .nice-code-editor__toolbar-btn {
730
+ display: inline-flex;
731
+ align-items: center;
732
+ justify-content: center;
733
+ width: 26px;
734
+ height: 26px;
735
+ border: none;
736
+ border-radius: 3px;
737
+ background: transparent;
738
+ color: var(--nice-text-secondary, #666);
739
+ cursor: pointer;
740
+ font-size: 14px;
741
+ transition: background 0.15s, color 0.15s;
742
+ }
743
+ .nice-code-editor__toolbar-btn:hover {
744
+ background: var(--nice-hover, #e0e0e0);
745
+ color: var(--nice-text-primary, #333);
746
+ }
747
+ .nice-code-editor__toolbar-btn--active {
748
+ background: var(--nice-accent, #1976d2);
749
+ color: #fff;
750
+ }
751
+ .nice-code-editor__toolbar-sep {
752
+ width: 1px;
753
+ height: 18px;
754
+ background: var(--nice-border, #e0e0e0);
755
+ margin: 0 4px;
756
+ }
757
+
758
+ /* Status bar */
759
+ .nice-code-editor__statusbar {
760
+ display: flex;
761
+ align-items: center;
762
+ gap: 12px;
763
+ padding: 2px 10px;
764
+ background: var(--nice-bg-muted, #f5f5f5);
765
+ border-top: 1px solid var(--nice-border, #e0e0e0);
766
+ font-size: 12px;
767
+ color: var(--nice-text-secondary, #666);
768
+ user-select: none;
769
+ }
770
+ .nice-code-editor__statusbar-spacer { flex: 1; }
771
+ .nice-code-editor__statusbar-lang {
772
+ text-transform: uppercase;
773
+ font-weight: 600;
774
+ font-size: 11px;
775
+ }
776
+ .nice-code-editor__statusbar-markers {
777
+ color: var(--nice-warning, #f39c12);
778
+ font-weight: 600;
779
+ }
780
+ `,document.head.appendChild(e)}const Od=Object.freeze(Object.defineProperty({__proto__:null,NiceCodeDiffEditor:Bi,NiceCodeEditor:Jn,NiceSimpleCodeEditor:Li},Symbol.toStringTag,{value:"Module"}));o.forwardRef(function(e,t){const{enableAI:a=!0,aiModel:i,enableInlineCompletion:r=!0,completionDelay:s=500,enableExplain:l=!0,enableRefactor:c=!0,enableGenerate:d=!0,systemPrompt:u,onExplain:g,onRefactor:h,showAIToolbar:p=!0,aiShortcutKey:m="Ctrl",language:k="plaintext",value:b,onChange:C,..._}=e,f=o.useRef(null),[v,j]=o.useState(null),[S,I]=o.useState(!1),[M,w]=o.useState(""),[E,P]=o.useState(!1),[L,A]=o.useState(""),[N,x]=o.useState(""),[O,D]=o.useState(""),F=o.useRef(),{t:y}=Bt(),$=et(),{complete:z,explain:R,refactor:T,generateFromComment:B,isLoading:V}=Uo({language:k,model:i}),K=a&&$.isConfigured,H=o.useCallback(async()=>{if(!K||!r||!f.current||!f.current.getEditor())return;const te=f.current.getCursorPosition(),ue=f.current.getValue().split(`
781
+ `),fe=ue.slice(0,te.lineNumber-1),ae=ue[te.lineNumber-1]||"",he=[...fe,ae.slice(0,te.column-1)].join(`
782
+ `),Y=[ae.slice(te.column-1),...ue.slice(te.lineNumber)].join(`
783
+ `);try{const X=await z(he,Y);X&&j({lineNumber:te.lineNumber,column:te.column,text:X})}catch{}},[K,r,z]),q=o.useCallback(async()=>{if(!K||!l||!f.current)return"";const te=f.current.getSelection();if(!te)return"";D(te),I(!0),w("");try{const ue=await R(te);return w(ue),g==null||g(te,ue),ue}catch{return w(y("codeEditorAI.explanationFailed","Failed to explain code")),""}},[K,l,R,g,y]),Z=o.useCallback(async te=>{if(!K||!c||!f.current)return"";const ue=f.current.getSelection();if(!ue)return"";try{const fe=await T(ue,te);return x(fe),h==null||h(ue,fe),fe}catch{return""}},[K,c,T,h]),Q=o.useCallback(async()=>{var ae;if(!K||!d||!f.current)return;const te=f.current.getCursorPosition(),ue=f.current.getValue().split(`
784
+ `);let fe="";for(let he=te.lineNumber-1;he>=0&&he>=te.lineNumber-3;he--){const Y=((ae=ue[he])==null?void 0:ae.trim())||"";if(Y.startsWith("//")||Y.startsWith("#")||Y.startsWith("/*")||Y.startsWith("*")){fe=Y.replace(/^\/\/\s*|^#\s*|^\/\*\s*|\*\/\s*$|^\*\s*/g,"").trim();break}}if(fe)try{const he=await B(fe);he&&f.current&&f.current.insertText(`
785
+ `+he)}catch{}},[K,d,B]),J=o.useCallback(()=>{!v||!f.current||(f.current.insertText(v.text),j(null))},[v]),ee=o.useCallback(()=>{j(null)},[]),ie=o.useCallback(te=>{var ue;(ue=e.onCursorPositionChange)==null||ue.call(e,te),!(!K||!r)&&(F.current&&clearTimeout(F.current),j(null),F.current=setTimeout(()=>{H()},s))},[e.onCursorPositionChange,K,r,s,H]);o.useEffect(()=>{var ue;if(!((ue=f.current)!=null&&ue.getEditor())||!K)return;const te=fe=>{var ae;if(m==="Ctrl"&&fe.ctrlKey||m==="Alt"&&fe.altKey||m==="Meta"&&fe.metaKey){if(fe.key===" "&&r&&(fe.preventDefault(),H()),fe.key==="e"&&l&&(fe.preventDefault(),q()),fe.key==="r"&&c){fe.preventDefault();const he=(ae=f.current)==null?void 0:ae.getSelection();he&&(D(he),P(!0))}fe.key==="g"&&d&&(fe.preventDefault(),Q())}fe.key==="Tab"&&v&&(fe.preventDefault(),J()),fe.key==="Escape"&&v&&ee()};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[K,m,r,l,c,d,H,q,Q,v,J,ee]),o.useEffect(()=>()=>{F.current&&clearTimeout(F.current)},[]);const pe=o.useCallback(()=>{if(!N||!f.current)return;const te=f.current.getEditor();if(te!=null&&te.executeEdits&&(te!=null&&te.getSelection)){const ue=te.getSelection();te.executeEdits("ai-refactor",[{range:ue,text:N}])}P(!1),x(""),A("")},[N]);return o.useImperativeHandle(t,()=>({...f.current,getEditor:()=>{var te;return(te=f.current)==null?void 0:te.getEditor()},getMonaco:()=>{var te;return(te=f.current)==null?void 0:te.getMonaco()},focus:()=>{var te;return(te=f.current)==null?void 0:te.focus()},getValue:()=>{var te;return((te=f.current)==null?void 0:te.getValue())||""},setValue:te=>{var ue;return(ue=f.current)==null?void 0:ue.setValue(te)},getSelection:()=>{var te;return((te=f.current)==null?void 0:te.getSelection())||""},insertText:te=>{var ue;return(ue=f.current)==null?void 0:ue.insertText(te)},formatDocument:()=>{var te;return(te=f.current)==null?void 0:te.formatDocument()},goToLine:(te,ue)=>{var fe;return(fe=f.current)==null?void 0:fe.goToLine(te,ue)},findReplace:()=>{var te;return(te=f.current)==null?void 0:te.findReplace()},undo:()=>{var te;return(te=f.current)==null?void 0:te.undo()},redo:()=>{var te;return(te=f.current)==null?void 0:te.redo()},getCursorPosition:()=>{var te;return((te=f.current)==null?void 0:te.getCursorPosition())||{lineNumber:1,column:1}},setMarkers:te=>{var ue;return(ue=f.current)==null?void 0:ue.setMarkers(te)},triggerCompletion:H,explainSelection:q,refactorSelection:Z,generateFromComment:Q,acceptCompletion:J,dismissCompletion:ee})),n.jsxs("div",{className:"nice-code-editor-ai","data-testid":e["data-testid"],children:[p&&K&&n.jsxs("div",{className:"nice-code-editor-ai__toolbar",children:[n.jsxs("div",{className:"nice-code-editor-ai__toolbar-left",children:[n.jsx("span",{className:"nice-code-editor-ai__toolbar-badge",children:"AI"}),V&&n.jsx("span",{className:"nice-code-editor-ai__loading",children:y("codeEditorAI.loading","Thinking...")})]}),n.jsxs("div",{className:"nice-code-editor-ai__toolbar-right",children:[r&&n.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>H(),disabled:V,title:`${y("codeEditorAI.complete","Complete")} (${m}+Space)`,children:["💡 ",y("codeEditorAI.complete","Complete")]}),l&&n.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>q(),disabled:V,title:`${y("codeEditorAI.explain","Explain")} (${m}+E)`,children:["📖 ",y("codeEditorAI.explain","Explain")]}),c&&n.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>{var ue;const te=(ue=f.current)==null?void 0:ue.getSelection();te&&(D(te),P(!0))},disabled:V,title:`${y("codeEditorAI.refactor","Refactor")} (${m}+R)`,children:["🔧 ",y("codeEditorAI.refactor","Refactor")]}),d&&n.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>Q(),disabled:V,title:`${y("codeEditorAI.generate","Generate")} (${m}+G)`,children:["⚡ ",y("codeEditorAI.generate","Generate")]})]})]}),n.jsxs("div",{className:"nice-code-editor-ai__editor-wrapper",children:[n.jsx(Jn,{ref:f,value:b,onChange:C,language:k,onCursorPositionChange:ie,..._}),v&&n.jsxs("div",{className:"nice-code-editor-ai__ghost-text",style:{top:`calc(${(v.lineNumber-1)*19}px + 4px)`,left:`calc(${(v.column-1)*7.8}px + 60px)`},children:[n.jsx("span",{className:"nice-code-editor-ai__ghost-text-content",children:v.text}),n.jsxs("span",{className:"nice-code-editor-ai__ghost-text-hint",children:["Tab ",y("codeEditorAI.toAccept","to accept")]})]})]}),S&&n.jsxs("div",{className:"nice-code-editor-ai__panel nice-code-editor-ai__panel--explain",children:[n.jsxs("div",{className:"nice-code-editor-ai__panel-header",children:[n.jsxs("h4",{children:["📖 ",y("codeEditorAI.explanation","Explanation")]}),n.jsx("button",{type:"button",className:"nice-code-editor-ai__panel-close",onClick:()=>I(!1),children:"✕"})]}),n.jsx("div",{className:"nice-code-editor-ai__panel-body",children:V?n.jsx("div",{className:"nice-code-editor-ai__panel-loading",children:y("codeEditorAI.analyzing","Analyzing code...")}):n.jsxs("div",{className:"nice-code-editor-ai__explanation",children:[n.jsx("pre",{className:"nice-code-editor-ai__code-preview",children:O}),n.jsx("div",{className:"nice-code-editor-ai__explanation-text",children:M||y("codeEditorAI.noExplanation","Select code and click Explain")})]})})]}),E&&n.jsxs("div",{className:"nice-code-editor-ai__panel nice-code-editor-ai__panel--refactor",children:[n.jsxs("div",{className:"nice-code-editor-ai__panel-header",children:[n.jsxs("h4",{children:["🔧 ",y("codeEditorAI.refactorCode","Refactor Code")]}),n.jsx("button",{type:"button",className:"nice-code-editor-ai__panel-close",onClick:()=>{P(!1),x(""),A("")},children:"✕"})]}),n.jsxs("div",{className:"nice-code-editor-ai__panel-body",children:[n.jsx("pre",{className:"nice-code-editor-ai__code-preview",children:O}),n.jsxs("div",{className:"nice-code-editor-ai__refactor-input",children:[n.jsx("input",{type:"text",placeholder:y("codeEditorAI.refactorInstruction",'Describe how to refactor (e.g., "extract function", "add error handling")'),value:L,onChange:te=>A(te.target.value),onKeyDown:te=>{te.key==="Enter"&&L&&Z(L)}}),n.jsx("button",{type:"button",className:"nice-code-editor-ai__refactor-btn",onClick:()=>Z(L),disabled:V||!L,children:V?y("codeEditorAI.refactoring","Refactoring..."):y("codeEditorAI.refactor","Refactor")})]}),N&&n.jsxs("div",{className:"nice-code-editor-ai__refactor-result",children:[n.jsx("h5",{children:y("codeEditorAI.refactoredCode","Refactored Code")}),n.jsx("pre",{className:"nice-code-editor-ai__code-preview nice-code-editor-ai__code-preview--result",children:N}),n.jsxs("div",{className:"nice-code-editor-ai__refactor-actions",children:[n.jsxs("button",{type:"button",className:"nice-code-editor-ai__refactor-apply",onClick:pe,children:["✓ ",y("codeEditorAI.apply","Apply")]}),n.jsxs("button",{type:"button",className:"nice-code-editor-ai__refactor-discard",onClick:()=>{x(""),A("")},children:["✕ ",y("codeEditorAI.discard","Discard")]})]})]})]})]})]})});function Ia(e,t){const a=t.getBoundingClientRect();let i,r,s;if("touches"in e){const d=e.touches[0];i=d.clientX-a.left,r=d.clientY-a.top,s=d.force}else"pressure"in e?(i=e.clientX-a.left,r=e.clientY-a.top,s=e.pressure):(i=e.clientX-a.left,r=e.clientY-a.top);const l=t.width/a.width,c=t.height/a.height;return{x:i*l,y:r*c,time:Date.now(),pressure:s!==void 0?s:.5}}function Da(e,t,a,i,r){if(!t)return(a+i)/2;const s=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))/Math.max(1,e.time-t.time),l=Math.min(s/5,1),c=i-l*(i-a),d=e.pressure??.5,u=a+d*(i-a);return c*.7+u*.3}function Ta(e,t,a,i){e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(a.x,a.y),e.lineWidth=i,e.lineCap="round",e.lineJoin="round",e.stroke()}o.forwardRef(function(e,t){const{value:a,onChange:i,width:r="100%",height:s=200,penColor:l="#000000",penWidth:c=2,minWidth:d=.5,maxWidth:u=4,backgroundColor:g="#ffffff",placeholder:h="Sign here",showClearButton:p=!0,showUndoButton:m=!0,showColorPicker:k=!1,showSizeSlider:b=!1,velocityFilterWeight:C=.7,throttle:_=16,disabled:f=!1,readOnly:v=!1,onBegin:j,onEnd:S,className:I,"data-testid":M}=e,w=o.useRef(null),[E,P]=o.useState((a==null?void 0:a.strokes)??[]),[L,A]=o.useState([]),[N,x]=o.useState(!1),[O,D]=o.useState(l),[F,y]=o.useState(c),$=o.useRef(null),z=o.useRef(0),R=E.length===0&&L.length===0;o.useEffect(()=>{const ie=w.current;if(!ie)return;const pe=ie.getContext("2d");if(!pe)return;const te=ie.getBoundingClientRect(),ue=window.devicePixelRatio||1;ie.width=te.width*ue,ie.height=te.height*ue,pe.scale(ue,ue),T()},[r,s]);const T=o.useCallback(()=>{const ie=w.current;if(!ie)return;const pe=ie.getContext("2d");if(!pe)return;const te=ie.getBoundingClientRect();pe.fillStyle=g,pe.fillRect(0,0,te.width,te.height),E.forEach(ue=>{if(pe.strokeStyle=ue.color,!(ue.points.length<2))for(let fe=1;fe<ue.points.length;fe++){const ae=ue.points[fe-1],he=ue.points[fe],Y=Da(he,ae,d,u);Ta(pe,ae,he,Y)}})},[E,g,d,u,C]);o.useEffect(()=>{T()},[T]),o.useEffect(()=>{a!=null&&a.strokes&&P(a.strokes)},[a]),o.useEffect(()=>{const ie=w.current;if(ie)if(E.length===0)i==null||i(null);else{const pe=ie.getBoundingClientRect();i==null||i({strokes:E,width:pe.width,height:pe.height,timestamp:Date.now()})}},[E,i]);const B=o.useCallback(ie=>{if(f||v)return;const pe=w.current;if(!pe)return;pe.setPointerCapture(ie.pointerId);const te=Ia(ie.nativeEvent,pe);x(!0),A([te]),$.current=te,z.current=te.time,j==null||j()},[f,v,j]),V=o.useCallback(ie=>{if(!N||f||v)return;const pe=w.current;if(!pe)return;const te=pe.getContext("2d");if(!te)return;const ue=Date.now();if(ue-z.current<_)return;const fe=Ia(ie.nativeEvent,pe),ae=$.current;if(ae){te.strokeStyle=O;const he=Da(fe,ae,d,u);Ta(te,ae,fe,he)}A(he=>[...he,fe]),$.current=fe,z.current=ue},[N,f,v,O,d,u,C,_]),K=o.useCallback(ie=>{if(!N)return;const pe=w.current;if(pe&&pe.releasePointerCapture(ie.pointerId),L.length>0){const te={points:L,color:O,width:F};P(ue=>[...ue,te])}x(!1),A([]),$.current=null,S==null||S()},[N,L,O,F,S]),H=o.useCallback(()=>{P([]),A([]),T()},[T]),q=o.useCallback(()=>{P(ie=>ie.slice(0,-1))},[]),Z=o.useCallback((ie="png",pe=.92)=>{const te=w.current;if(!te)return"";const ue=ie==="jpeg"?"image/jpeg":"image/png";return te.toDataURL(ue,pe)},[]),Q=o.useCallback(async(ie="png",pe=.92)=>{const te=w.current;return te?new Promise(ue=>{const fe=ie==="jpeg"?"image/jpeg":"image/png";te.toBlob(ae=>ue(ae),fe,pe)}):null},[]),J=o.useCallback(()=>{const ie=w.current;if(!ie)return"";const pe=ie.getBoundingClientRect(),te=E.map(ue=>ue.points.length<2?"":`<path d="${ue.points.reduce((fe,ae,he)=>he===0?`M ${ae.x} ${ae.y}`:`${fe} L ${ae.x} ${ae.y}`,"")}" stroke="${ue.color}" stroke-width="${ue.width}" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`).join(`
786
+ `);return`<svg xmlns="http://www.w3.org/2000/svg" width="${pe.width}" height="${pe.height}" viewBox="0 0 ${ie.width} ${ie.height}">
787
+ <rect width="100%" height="100%" fill="${g}"/>
788
+ ${te}
789
+ </svg>`},[E,g]);o.useImperativeHandle(t,()=>({clear:H,undo:q,isEmpty:()=>E.length===0,getData:()=>{const ie=w.current;if(!ie||E.length===0)return null;const pe=ie.getBoundingClientRect();return{strokes:E,width:pe.width,height:pe.height,timestamp:Date.now()}},setData:ie=>{P(ie.strokes)},toDataURL:Z,toBlob:Q,toSVG:J,getCanvas:()=>w.current}),[E,H,q,Z,Q,J]),o.useEffect(()=>{const ie=w.current;if(!ie)return;const pe=te=>{N&&te.preventDefault()};return ie.addEventListener("touchmove",pe,{passive:!1}),()=>ie.removeEventListener("touchmove",pe)},[N]);const ee=p||m||k||b;return n.jsxs("div",{className:`nice-signature ${f?"nice-signature--disabled":""} ${v?"nice-signature--readonly":""} ${I??""}`,style:{width:r},"data-testid":M,children:[ee&&n.jsxs("div",{className:"nice-signature__toolbar",children:[k&&n.jsx("div",{className:"nice-signature__color-picker",children:n.jsx("input",{type:"color",value:O,onChange:ie=>D(ie.target.value),disabled:f||v,title:"Pen color"})}),b&&n.jsx("div",{className:"nice-signature__size-slider",children:n.jsx("input",{type:"range",min:d,max:u,step:.5,value:F,onChange:ie=>y(parseFloat(ie.target.value)),disabled:f||v,title:"Pen size"})}),n.jsxs("div",{className:"nice-signature__actions",children:[m&&n.jsx("button",{type:"button",onClick:q,disabled:f||v||E.length===0,className:"nice-signature__btn",title:"Undo",children:"↩️"}),p&&n.jsx("button",{type:"button",onClick:H,disabled:f||v||R,className:"nice-signature__btn",title:"Clear",children:"🗑️"})]})]}),n.jsxs("div",{className:"nice-signature__canvas-wrapper",style:{height:s},children:[n.jsx("canvas",{ref:w,className:"nice-signature__canvas",style:{width:"100%",height:"100%",cursor:f||v?"not-allowed":"crosshair",touchAction:"none"},onPointerDown:B,onPointerMove:V,onPointerUp:K,onPointerLeave:K}),R&&!N&&h&&n.jsx("div",{className:"nice-signature__placeholder",children:h}),n.jsx("div",{className:"nice-signature__line"})]})]})});const Ra="nice-signature-styles";if(typeof document<"u"&&!document.getElementById(Ra)){const e=document.createElement("style");e.id=Ra,e.textContent=`
790
+ .nice-signature {
791
+ display: flex;
792
+ flex-direction: column;
793
+ border: 1px solid var(--nice-border, #e0e0e0);
794
+ border-radius: 4px;
795
+ overflow: hidden;
796
+ background: var(--nice-bg-surface, #fff);
797
+ }
798
+
799
+ .nice-signature--disabled {
800
+ opacity: 0.6;
801
+ }
802
+
803
+ .nice-signature__toolbar {
804
+ display: flex;
805
+ align-items: center;
806
+ gap: 8px;
807
+ padding: 8px;
808
+ background: var(--nice-bg-muted, #f5f5f5);
809
+ border-bottom: 1px solid var(--nice-border, #e0e0e0);
810
+ }
811
+
812
+ .nice-signature__color-picker input {
813
+ width: 32px;
814
+ height: 32px;
815
+ padding: 2px;
816
+ border: 1px solid var(--nice-border, #e0e0e0);
817
+ border-radius: 4px;
818
+ cursor: pointer;
819
+ }
820
+
821
+ .nice-signature__size-slider {
822
+ flex: 1;
823
+ max-width: 120px;
824
+ }
825
+
826
+ .nice-signature__size-slider input {
827
+ width: 100%;
828
+ }
829
+
830
+ .nice-signature__actions {
831
+ display: flex;
832
+ gap: 4px;
833
+ margin-left: auto;
834
+ }
835
+
836
+ .nice-signature__btn {
837
+ padding: 6px 10px;
838
+ border: 1px solid var(--nice-border, #e0e0e0);
839
+ border-radius: 4px;
840
+ background: var(--nice-bg-surface, #fff);
841
+ cursor: pointer;
842
+ font-size: 14px;
843
+ }
844
+
845
+ .nice-signature__btn:hover:not(:disabled) {
846
+ background: var(--nice-bg-hover, #f0f0f0);
847
+ }
848
+
849
+ .nice-signature__btn:disabled {
850
+ opacity: 0.4;
851
+ cursor: not-allowed;
852
+ }
853
+
854
+ .nice-signature__canvas-wrapper {
855
+ position: relative;
856
+ background: #fff;
857
+ }
858
+
859
+ .nice-signature__canvas {
860
+ display: block;
861
+ }
862
+
863
+ .nice-signature__placeholder {
864
+ position: absolute;
865
+ top: 50%;
866
+ left: 50%;
867
+ transform: translate(-50%, -50%);
868
+ color: var(--nice-text-secondary, #999);
869
+ font-size: 14px;
870
+ pointer-events: none;
871
+ user-select: none;
872
+ }
873
+
874
+ .nice-signature__line {
875
+ position: absolute;
876
+ bottom: 30px;
877
+ left: 20px;
878
+ right: 20px;
879
+ height: 1px;
880
+ background: var(--nice-border, #ccc);
881
+ pointer-events: none;
882
+ }
883
+
884
+ /* Display component */
885
+ .nice-signature-display {
886
+ border: 1px solid var(--nice-border, #e0e0e0);
887
+ border-radius: 4px;
888
+ overflow: hidden;
889
+ }
890
+
891
+ .nice-signature-display__canvas-wrapper {
892
+ position: relative;
893
+ background: #fff;
894
+ }
895
+
896
+ .nice-signature-display__canvas {
897
+ display: block;
898
+ }
899
+
900
+ .nice-signature-display__placeholder {
901
+ position: absolute;
902
+ top: 50%;
903
+ left: 50%;
904
+ transform: translate(-50%, -50%);
905
+ color: var(--nice-text-secondary, #999);
906
+ font-size: 14px;
907
+ }
908
+ `,document.head.appendChild(e)}const Oi=o.forwardRef(({label:e,helperText:t,error:a,success:i=!1,startIcon:r,endIcon:s,showCounter:l=!1,variant:c="outlined",size:d="md",fullWidth:u=!1,className:g="",disabled:h=!1,required:p=!1,maxLength:m,value:k,defaultValue:b,onFocus:C,onBlur:_,onChange:f,"data-testid":v="nice-floating-input",...j},S)=>{Se();const I=o.useId(),[M,w]=o.useState(!1),[E,P]=o.useState(b??""),L=k!==void 0?k:E,A=String(L).length>0,N=M||A,x=o.useCallback(y=>{w(!0),C==null||C(y)},[C]),O=o.useCallback(y=>{w(!1),_==null||_(y)},[_]),D=o.useCallback(y=>{k===void 0&&P(y.target.value),f==null||f(y)},[k,f]),F=["nice-floating-input",`nice-floating-input--${c}`,`nice-floating-input--${d}`,M&&"nice-floating-input--focused",A&&"nice-floating-input--has-value",h&&"nice-floating-input--disabled",a&&"nice-floating-input--error",i&&"nice-floating-input--success",r&&"nice-floating-input--has-start-icon",s&&"nice-floating-input--has-end-icon",u&&"nice-floating-input--full-width",g].filter(Boolean).join(" ");return n.jsxs("div",{className:F,"data-testid":v,children:[n.jsxs("div",{className:"nice-floating-input__container",children:[r&&n.jsx("span",{className:"nice-floating-input__icon nice-floating-input__icon--start",children:r}),n.jsxs("div",{className:"nice-floating-input__field",children:[n.jsx("input",{ref:S,id:I,className:"nice-floating-input__input",value:L,onChange:D,onFocus:x,onBlur:O,disabled:h,required:p,maxLength:m,"aria-invalid":!!a,"aria-describedby":a?`${I}-error`:t?`${I}-helper`:void 0,"data-testid":`${v}-input`,...j}),n.jsxs("label",{htmlFor:I,className:`nice-floating-input__label ${N?"nice-floating-input__label--floating":""}`,children:[e,p&&n.jsx("span",{className:"nice-floating-input__required",children:"*"})]}),c==="outlined"&&n.jsx("fieldset",{className:"nice-floating-input__fieldset","aria-hidden":"true",children:n.jsx("legend",{className:`nice-floating-input__legend ${N?"nice-floating-input__legend--floating":""}`,children:n.jsxs("span",{children:[e,p&&" *"]})})})]}),s&&n.jsx("span",{className:"nice-floating-input__icon nice-floating-input__icon--end",children:s})]}),n.jsxs("div",{className:"nice-floating-input__footer",children:[a?n.jsx("span",{id:`${I}-error`,className:"nice-floating-input__error",role:"alert",children:a}):t?n.jsx("span",{id:`${I}-helper`,className:"nice-floating-input__helper",children:t}):n.jsx("span",{}),l&&m!==void 0&&n.jsxs("span",{className:"nice-floating-input__counter",children:[String(L).length,"/",m]})]})]})});Oi.displayName="NiceFloatingLabelInput";const Hi=o.forwardRef(({label:e,helperText:t,error:a,success:i=!1,showCounter:r=!1,variant:s="outlined",size:l="md",fullWidth:c=!1,autoResize:d=!1,minRows:u=3,maxRows:g=10,className:h="",disabled:p=!1,required:m=!1,maxLength:k,value:b,defaultValue:C,onFocus:_,onBlur:f,onChange:v,"data-testid":j="nice-floating-textarea",...S},I)=>{Se();const M=o.useId(),w=o.useRef(null),[E,P]=o.useState(!1),[L,A]=o.useState(C??""),N=b!==void 0?b:L,x=String(N).length>0,O=E||x;o.useEffect(()=>{if(!d||!w.current)return;const R=w.current,T=parseInt(getComputedStyle(R).lineHeight)||20,B=u*T,V=g*T;R.style.height="auto";const K=R.scrollHeight;R.style.height=`${Math.min(Math.max(K,B),V)}px`},[N,d,u,g]);const D=o.useCallback(R=>{w.current=R,typeof I=="function"?I(R):I&&(I.current=R)},[I]),F=o.useCallback(R=>{P(!0),_==null||_(R)},[_]),y=o.useCallback(R=>{P(!1),f==null||f(R)},[f]),$=o.useCallback(R=>{b===void 0&&A(R.target.value),v==null||v(R)},[b,v]),z=["nice-floating-input","nice-floating-input--textarea",`nice-floating-input--${s}`,`nice-floating-input--${l}`,E&&"nice-floating-input--focused",x&&"nice-floating-input--has-value",p&&"nice-floating-input--disabled",a&&"nice-floating-input--error",i&&"nice-floating-input--success",c&&"nice-floating-input--full-width",h].filter(Boolean).join(" ");return n.jsxs("div",{className:z,"data-testid":j,children:[n.jsx("div",{className:"nice-floating-input__container",children:n.jsxs("div",{className:"nice-floating-input__field",children:[n.jsx("textarea",{ref:D,id:M,className:"nice-floating-input__input nice-floating-input__input--textarea",value:N,onChange:$,onFocus:F,onBlur:y,disabled:p,required:m,maxLength:k,rows:u,"aria-invalid":!!a,"aria-describedby":a?`${M}-error`:t?`${M}-helper`:void 0,"data-testid":`${j}-textarea`,...S}),n.jsxs("label",{htmlFor:M,className:`nice-floating-input__label ${O?"nice-floating-input__label--floating":""}`,children:[e,m&&n.jsx("span",{className:"nice-floating-input__required",children:"*"})]}),s==="outlined"&&n.jsx("fieldset",{className:"nice-floating-input__fieldset","aria-hidden":"true",children:n.jsx("legend",{className:`nice-floating-input__legend ${O?"nice-floating-input__legend--floating":""}`,children:n.jsxs("span",{children:[e,m&&" *"]})})})]})}),n.jsxs("div",{className:"nice-floating-input__footer",children:[a?n.jsx("span",{id:`${M}-error`,className:"nice-floating-input__error",role:"alert",children:a}):t?n.jsx("span",{id:`${M}-helper`,className:"nice-floating-input__helper",children:t}):n.jsx("span",{}),r&&k!==void 0&&n.jsxs("span",{className:"nice-floating-input__counter",children:[String(N).length,"/",k]})]})]})});Hi.displayName="NiceFloatingLabelTextarea";const Hd={strokeColor:"#ff3333",fillColor:"transparent",strokeWidth:2,opacity:1,fontSize:16,fontFamily:"sans-serif"};function Wd(e,t){switch(t.type){case"SET_TOOL":return{...e,activeTool:t.tool,selectedId:null};case"SET_STYLE":return{...e,style:{...e.style,...t.style}};case"ADD_ANNOTATION":return{...e,annotations:[...e.annotations,t.annotation],past:[...e.past,e.annotations],future:[]};case"UPDATE_ANNOTATION":return{...e,annotations:e.annotations.map(a=>a.id===t.id?{...a,...t.updates}:a),past:[...e.past,e.annotations],future:[]};case"DELETE_ANNOTATION":return{...e,annotations:e.annotations.filter(a=>a.id!==t.id),selectedId:e.selectedId===t.id?null:e.selectedId,past:[...e.past,e.annotations],future:[]};case"SELECT":return{...e,selectedId:t.id};case"SET_ANNOTATIONS":return{...e,annotations:t.annotations,past:[],future:[]};case"SET_ZOOM":return{...e,zoom:t.zoom};case"SET_PAN":return{...e,panX:t.panX,panY:t.panY};case"UNDO":{if(e.past.length===0)return e;const a=e.past[e.past.length-1];return{...e,annotations:a,past:e.past.slice(0,-1),future:[e.annotations,...e.future]}}case"REDO":{if(e.future.length===0)return e;const a=e.future[0];return{...e,annotations:a,past:[...e.past,e.annotations],future:e.future.slice(1)}}case"CLEAR":return{...e,annotations:[],selectedId:null,past:[...e.past,e.annotations],future:[]};default:return e}}let qd=0;function Vd(){return`ann-${Date.now()}-${qd++}`}function Kd(e){const{style:t}=e,a=`stroke="${t.strokeColor}" stroke-width="${t.strokeWidth}" fill="${t.fillColor}" opacity="${t.opacity}"`;switch(e.tool){case"rectangle":return`<rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" ${a} />`;case"ellipse":{const i=e.x+e.width/2,r=e.y+e.height/2;return`<ellipse cx="${i}" cy="${r}" rx="${e.width/2}" ry="${e.height/2}" ${a} />`}case"arrow":{const i=e,r=Math.atan2(i.endY-i.y,i.endX-i.x),s=12,l=i.endX-s*Math.cos(r-Math.PI/6),c=i.endY-s*Math.sin(r-Math.PI/6),d=i.endX-s*Math.cos(r+Math.PI/6),u=i.endY-s*Math.sin(r+Math.PI/6);return`<line x1="${i.x}" y1="${i.y}" x2="${i.endX}" y2="${i.endY}" ${a} />
909
+ <polygon points="${i.endX},${i.endY} ${l},${c} ${d},${u}" fill="${t.strokeColor}" opacity="${t.opacity}" />`}case"line":{const i=e;return`<line x1="${i.x}" y1="${i.y}" x2="${i.endX}" y2="${i.endY}" ${a} />`}case"text":{const i=e;return`<text x="${i.x}" y="${i.y+(i.style.fontSize??16)}" fill="${t.strokeColor}" font-size="${t.fontSize}" font-family="${t.fontFamily}" opacity="${t.opacity}">${Ud(i.text)}</text>`}case"freehand":{const i=e;return i.points.length<2?"":`<path d="${i.points.map((r,s)=>`${s===0?"M":"L"}${r.x},${r.y}`).join(" ")}" ${a} fill="none" />`}case"blur":{const i=e,r=`blur-${i.id}`;return`<defs><filter id="${r}"><feGaussianBlur stdDeviation="${i.intensity??5}" /></filter></defs>
910
+ <rect x="${i.x}" y="${i.y}" width="${i.width}" height="${i.height}" fill="transparent" stroke="none" filter="url(#${r})" />`}default:return""}}function Ud(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const Wi=o.forwardRef(({src:e,alt:t="Annotatable image",annotations:a,activeTool:i,defaultStyle:r,onAnnotationsChange:s,className:l,readOnly:c=!1,minZoom:d=.1,maxZoom:u=5},g)=>{const h=o.useRef(null),p=o.useRef(null),m=o.useRef(null),[k,b]=o.useState(!1),[C,_]=o.useState({width:0,height:0}),[f,v]=o.useReducer(Wd,{annotations:a??[],selectedId:null,activeTool:i??"select",style:{...Hd,...r},zoom:1,panX:0,panY:0,past:[],future:[]});o.useEffect(()=>{i&&v({type:"SET_TOOL",tool:i})},[i]),o.useEffect(()=>{s==null||s(f.annotations)},[f.annotations,s]),o.useEffect(()=>{const N=new Image;N.crossOrigin="anonymous",N.onload=()=>{m.current=N,_({width:N.naturalWidth,height:N.naturalHeight}),b(!0)},N.src=e},[e]);const j=o.useRef({isDrawing:!1,startX:0,startY:0,currentAnnotation:null,freehandPoints:[]}),S=o.useCallback((N,x)=>{const O=h.current;if(!O)return{x:0,y:0};const D=O.getBoundingClientRect();return{x:(N-D.left-f.panX)/f.zoom,y:(x-D.top-f.panY)/f.zoom}},[f.zoom,f.panX,f.panY]),I=o.useCallback(()=>{var F,y;const N=h.current,x=N==null?void 0:N.getContext("2d"),O=m.current;if(!N||!x||!O||!k)return;N.width=((F=p.current)==null?void 0:F.clientWidth)??O.naturalWidth,N.height=((y=p.current)==null?void 0:y.clientHeight)??O.naturalHeight,x.clearRect(0,0,N.width,N.height),x.save(),x.translate(f.panX,f.panY),x.scale(f.zoom,f.zoom),x.drawImage(O,0,0);for(const $ of f.annotations){switch(x.save(),x.globalAlpha=$.style.opacity,x.strokeStyle=$.style.strokeColor,x.fillStyle=$.style.fillColor,x.lineWidth=$.style.strokeWidth,$.tool){case"rectangle":x.strokeRect($.x,$.y,$.width,$.height),$.style.fillColor!=="transparent"&&x.fillRect($.x,$.y,$.width,$.height);break;case"ellipse":{x.beginPath(),x.ellipse($.x+$.width/2,$.y+$.height/2,Math.abs($.width/2),Math.abs($.height/2),0,0,Math.PI*2),x.stroke(),$.style.fillColor!=="transparent"&&x.fill();break}case"arrow":{const z=$;x.beginPath(),x.moveTo(z.x,z.y),x.lineTo(z.endX,z.endY),x.stroke();const R=Math.atan2(z.endY-z.y,z.endX-z.x),T=12;x.beginPath(),x.moveTo(z.endX,z.endY),x.lineTo(z.endX-T*Math.cos(R-Math.PI/6),z.endY-T*Math.sin(R-Math.PI/6)),x.lineTo(z.endX-T*Math.cos(R+Math.PI/6),z.endY-T*Math.sin(R+Math.PI/6)),x.closePath(),x.fillStyle=$.style.strokeColor,x.fill();break}case"line":{const z=$;x.beginPath(),x.moveTo(z.x,z.y),x.lineTo(z.endX,z.endY),x.stroke();break}case"text":{const z=$;x.font=`${z.style.fontSize??16}px ${z.style.fontFamily??"sans-serif"}`,x.fillStyle=z.style.strokeColor,x.fillText(z.text,z.x,z.y+(z.style.fontSize??16));break}case"freehand":{const z=$;if(z.points.length<2)break;x.beginPath(),x.moveTo(z.points[0].x,z.points[0].y);for(let R=1;R<z.points.length;R++)x.lineTo(z.points[R].x,z.points[R].y);x.stroke();break}case"blur":{const z=$;x.filter=`blur(${z.intensity??5}px)`,x.drawImage(O,z.x,z.y,z.width,z.height,z.x,z.y,z.width,z.height),x.filter="none";break}}$.id===f.selectedId&&(x.strokeStyle="#4488ff",x.lineWidth=1,x.setLineDash([4,4]),x.strokeRect($.x-2,$.y-2,$.width+4,$.height+4),x.setLineDash([])),x.restore()}const D=j.current;if(D.isDrawing&&D.currentAnnotation){x.save();const $=D.currentAnnotation;if(x.globalAlpha=$.style.opacity,x.strokeStyle=$.style.strokeColor,x.lineWidth=$.style.strokeWidth,x.setLineDash([6,3]),$.tool==="freehand"){const z=$;if(z.points.length>=2){x.beginPath(),x.moveTo(z.points[0].x,z.points[0].y);for(let R=1;R<z.points.length;R++)x.lineTo(z.points[R].x,z.points[R].y);x.stroke()}}else if($.tool==="rectangle")x.strokeRect($.x,$.y,$.width,$.height);else if($.tool==="ellipse")x.beginPath(),x.ellipse($.x+$.width/2,$.y+$.height/2,Math.abs($.width/2),Math.abs($.height/2),0,0,Math.PI*2),x.stroke();else if($.tool==="arrow"||$.tool==="line"){const z=$;x.beginPath(),x.moveTo(z.x,z.y),x.lineTo(z.endX,z.endY),x.stroke()}x.restore()}x.restore()},[f,k]);o.useEffect(()=>{I()},[I]);const M=o.useCallback(N=>{if(c)return;const x=S(N.clientX,N.clientY),O=f.activeTool;if(O==="select"){const y=[...f.annotations].reverse().find($=>$.tool==="freehand"?!1:x.x>=$.x&&x.x<=$.x+$.width&&x.y>=$.y&&x.y<=$.y+$.height);v({type:"SELECT",id:(y==null?void 0:y.id)??null});return}const D=j.current;D.isDrawing=!0,D.startX=x.x,D.startY=x.y;const F={id:Vd(),style:{...f.style},x:x.x,y:x.y,width:0,height:0};switch(O){case"rectangle":D.currentAnnotation={...F,tool:"rectangle"};break;case"ellipse":D.currentAnnotation={...F,tool:"ellipse"};break;case"arrow":D.currentAnnotation={...F,tool:"arrow",endX:x.x,endY:x.y};break;case"line":D.currentAnnotation={...F,tool:"line",endX:x.x,endY:x.y};break;case"text":D.currentAnnotation={...F,tool:"text",text:"Text",width:100,height:f.style.fontSize??16};break;case"freehand":D.freehandPoints=[x],D.currentAnnotation={...F,tool:"freehand",points:[x]};break;case"blur":D.currentAnnotation={...F,tool:"blur",intensity:5};break}},[c,S,f.activeTool,f.style,f.annotations]),w=o.useCallback(N=>{const x=j.current;if(!x.isDrawing||!x.currentAnnotation)return;const O=S(N.clientX,N.clientY),D=x.currentAnnotation;if(D.tool==="freehand"){x.freehandPoints.push(O),D.points=[...x.freehandPoints];const F=x.freehandPoints.map($=>$.x),y=x.freehandPoints.map($=>$.y);D.x=Math.min(...F),D.y=Math.min(...y),D.width=Math.max(...F)-D.x,D.height=Math.max(...y)-D.y}else if(D.tool==="arrow"||D.tool==="line")D.endX=O.x,D.endY=O.y,D.width=Math.abs(O.x-x.startX),D.height=Math.abs(O.y-x.startY);else{const F=Math.min(x.startX,O.x),y=Math.min(x.startY,O.y);D.x=F,D.y=y,D.width=Math.abs(O.x-x.startX),D.height=Math.abs(O.y-x.startY)}I()},[S,I]),E=o.useCallback(()=>{const N=j.current;if(!N.isDrawing||!N.currentAnnotation)return;const x=N.currentAnnotation;(x.tool==="text"||x.tool==="freehand"||Math.abs(x.width)>2||Math.abs(x.height)>2)&&v({type:"ADD_ANNOTATION",annotation:x}),N.isDrawing=!1,N.currentAnnotation=null,N.freehandPoints=[]},[]),P=o.useCallback(N=>{N.preventDefault();const x=N.deltaY>0?.9:1.1,O=Math.max(d,Math.min(u,f.zoom*x));v({type:"SET_ZOOM",zoom:O})},[f.zoom,d,u]);o.useEffect(()=>{if(c)return;const N=x=>{(x.metaKey||x.ctrlKey)&&x.key==="z"&&!x.shiftKey?(x.preventDefault(),v({type:"UNDO"})):(x.metaKey||x.ctrlKey)&&(x.key==="y"||x.key==="z"&&x.shiftKey)?(x.preventDefault(),v({type:"REDO"})):(x.key==="Delete"||x.key==="Backspace")&&f.selectedId&&v({type:"DELETE_ANNOTATION",id:f.selectedId})};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[c,f.selectedId]),o.useImperativeHandle(g,()=>({exportAsDataURL:async(N="png",x=.92)=>{const O=document.createElement("canvas"),D=m.current;if(!D)return"";O.width=D.naturalWidth,O.height=D.naturalHeight;const F=O.getContext("2d");F.drawImage(D,0,0);for(const y of f.annotations){if(F.save(),F.globalAlpha=y.style.opacity,F.strokeStyle=y.style.strokeColor,F.fillStyle=y.style.fillColor,F.lineWidth=y.style.strokeWidth,y.tool==="rectangle")F.strokeRect(y.x,y.y,y.width,y.height);else if(y.tool==="ellipse")F.beginPath(),F.ellipse(y.x+y.width/2,y.y+y.height/2,Math.abs(y.width/2),Math.abs(y.height/2),0,0,Math.PI*2),F.stroke();else if(y.tool==="freehand"){const $=y;if($.points.length>=2){F.beginPath(),F.moveTo($.points[0].x,$.points[0].y);for(let z=1;z<$.points.length;z++)F.lineTo($.points[z].x,$.points[z].y);F.stroke()}}else if(y.tool==="text"){const $=y;F.font=`${$.style.fontSize??16}px ${$.style.fontFamily??"sans-serif"}`,F.fillStyle=$.style.strokeColor,F.fillText($.text,$.x,$.y+($.style.fontSize??16))}F.restore()}return O.toDataURL(`image/${N}`,x)},exportAnnotations:()=>[...f.annotations],importAnnotations:N=>{v({type:"SET_ANNOTATIONS",annotations:N})},exportAsSVG:()=>{const{width:N,height:x}=C,O=f.annotations.map(Kd);return`<svg xmlns="http://www.w3.org/2000/svg" width="${N}" height="${x}" viewBox="0 0 ${N} ${x}">
911
+ ${O.join(`
912
+ `)}
913
+ </svg>`},undo:()=>v({type:"UNDO"}),redo:()=>v({type:"REDO"}),setZoom:N=>{v({type:"SET_ZOOM",zoom:Math.max(d,Math.min(u,N))})},fitToScreen:()=>{const N=p.current,x=m.current;if(!N||!x)return;const O=N.clientWidth/x.naturalWidth,D=N.clientHeight/x.naturalHeight,F=Math.min(O,D,1);v({type:"SET_ZOOM",zoom:F}),v({type:"SET_PAN",panX:0,panY:0})},clear:()=>v({type:"CLEAR"})}),[f.annotations,C,d,u]);const L=o.useCallback(N=>{if(N.touches.length!==1)return;const x=N.touches[0];M({clientX:x.clientX,clientY:x.clientY,preventDefault:()=>{}})},[M]),A=o.useCallback(N=>{if(N.touches.length!==1)return;const x=N.touches[0];w({clientX:x.clientX,clientY:x.clientY})},[w]);return n.jsx("div",{ref:p,className:`nice-image-annotator ${l??""}`,style:{position:"relative",overflow:"hidden",width:"100%",height:"100%"},children:n.jsx("canvas",{ref:h,className:"nice-image-annotator__canvas",style:{cursor:f.activeTool==="select"?"default":"crosshair"},onMouseDown:M,onMouseMove:w,onMouseUp:E,onMouseLeave:E,onWheel:P,onTouchStart:L,onTouchMove:A,onTouchEnd:E,role:"img","aria-label":t})})});Wi.displayName="NiceImageAnnotator";const ea=o.forwardRef(({options:e,value:t=[],onChange:a,placeholder:i,disabled:r,size:s="md",className:l,style:c,id:d},u)=>{const g=ke(d),{t:h}=Se(),[p,m]=o.useState(!1),k=o.useMemo(()=>{const _=[e];let f=e;for(const v of t){const j=f.find(S=>S.value===v);if(j!=null&&j.children)_.push(j.children),f=j.children;else break}return _},[e,t]),b=o.useCallback((_,f)=>{var S;const v=[...t.slice(0,_),f],j=(S=k[_])==null?void 0:S.find(I=>I.value===f);(!(j!=null&&j.children)||j.children.length===0)&&m(!1),a==null||a(v)},[t,k,a]),C=t.length>0?t.map((_,f)=>{var v,j;return((j=(v=k[f])==null?void 0:v.find(S=>S.value===_))==null?void 0:j.label)??_}).join(" › "):i??h("controls.select","Select...");return n.jsxs("div",{ref:u,id:g,className:`nice-cascade-select nice-cascade-select--${s}${r?" nice-cascade-select--disabled":""} ${l||""}`,style:c,children:[n.jsxs("button",{type:"button",className:"nice-cascade-select__trigger",onClick:()=>!r&&m(_=>!_),"aria-haspopup":"listbox","aria-expanded":p,disabled:r,children:[n.jsx("span",{className:`nice-cascade-select__display${t.length===0?" nice-cascade-select__display--placeholder":""}`,children:C}),n.jsx("span",{className:"nice-cascade-select__arrow",children:"▾"})]}),p&&n.jsx("div",{className:"nice-cascade-select__dropdown",children:k.map((_,f)=>n.jsx("div",{className:"nice-cascade-select__column",role:"listbox",children:_.map(v=>n.jsxs("div",{className:`nice-cascade-select__option${t[f]===v.value?" nice-cascade-select__option--selected":""}`,role:"option","aria-selected":t[f]===v.value,onClick:()=>b(f,v.value),children:[n.jsx("span",{children:v.label}),v.children&&v.children.length>0&&n.jsx("span",{className:"nice-cascade-select__chevron",children:"›"})]},v.value))},f))})]})});ea.displayName="NiceCascadeSelect";const ta=o.forwardRef(({columns:e,data:t,value:a,onChange:i,displayExpr:r="label",valueExpr:s="id",placeholder:l,disabled:c,size:d="md",filterable:u=!0,className:g,style:h,id:p},m)=>{const k=ke(p),{t:b}=Se(),[C,_]=o.useState(!1),[f,v]=o.useState(""),j=o.useRef(null);o.useEffect(()=>{if(!C)return;const E=P=>{j.current&&!j.current.contains(P.target)&&_(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[C]);const S=o.useMemo(()=>{if(!u||!f)return t;const E=f.toLowerCase();return t.filter(P=>e.some(L=>String(P[L.field]??"").toLowerCase().includes(E)))},[t,f,e,u]),I=t.find(E=>String(E[s])===a),M=I?String(I[r]):"",w=o.useCallback(E=>{i==null||i(String(E[s])),_(!1),v("")},[i,s]);return n.jsx("div",{ref:m,id:k,className:`nice-mc-combo nice-mc-combo--${d}${c?" nice-mc-combo--disabled":""} ${g||""}`,style:h,children:n.jsxs("div",{ref:j,className:"nice-mc-combo__wrap",children:[n.jsx("input",{className:"nice-mc-combo__input",type:"text",value:C?f:M,placeholder:l??b("controls.select","Select..."),disabled:c,onFocus:()=>{_(!0),v("")},onChange:E=>v(E.target.value),"aria-autocomplete":"list","aria-expanded":C}),n.jsx("button",{type:"button",className:"nice-mc-combo__toggle",onClick:()=>!c&&_(E=>!E),tabIndex:-1,"aria-label":"Toggle",children:"▾"}),C&&n.jsx("div",{className:"nice-mc-combo__dropdown",children:n.jsxs("table",{className:"nice-mc-combo__table",children:[n.jsx("thead",{children:n.jsx("tr",{children:e.map(E=>n.jsx("th",{style:{width:E.width},children:E.header},E.field))})}),n.jsxs("tbody",{children:[S.map((E,P)=>n.jsx("tr",{className:`nice-mc-combo__row${String(E[s])===a?" nice-mc-combo__row--selected":""}`,onClick:()=>w(E),children:e.map(L=>n.jsx("td",{children:String(E[L.field]??"")},L.field))},P)),S.length===0&&n.jsx("tr",{children:n.jsx("td",{colSpan:e.length,className:"nice-mc-combo__empty",children:b("controls.noData","No data")})})]})]})})]})})});ta.displayName="NiceMultiColumnComboBox";const na=o.forwardRef(({value:e,onChange:t,type:a="text",options:i=[],submitOnBlur:r=!0,placeholder:s,disabled:l,size:c="md",className:d,style:u,id:g},h)=>{var M;const p=ke(g),[m,k]=o.useState(!1),[b,C]=o.useState(e),_=o.useRef(null);o.useEffect(()=>{C(e)},[e]),o.useEffect(()=>{m&&_.current&&_.current.focus()},[m]);const f=o.useCallback(()=>{l||(C(e),k(!0))},[l,e]),v=o.useCallback(()=>{k(!1),b!==e&&t(b)},[b,e,t]),j=o.useCallback(()=>{k(!1),C(e)},[e]),S=o.useCallback(w=>{w.key==="Enter"&&a!=="textarea"&&v(),w.key==="Escape"&&j()},[v,j,a]),I=a==="select"&&((M=i.find(w=>w.value===e))==null?void 0:M.label)||e;return n.jsx("div",{ref:h,id:p,className:`nice-inplace nice-inplace--${c}${l?" nice-inplace--disabled":""} ${d||""}`,style:u,children:m?n.jsxs("span",{className:"nice-inplace__editor",children:[a==="textarea"?n.jsx("textarea",{ref:_,className:"nice-inplace__input",value:b,onChange:w=>C(w.target.value),onBlur:r?v:void 0,onKeyDown:w=>w.key==="Escape"&&j(),rows:3}):a==="select"?n.jsx("select",{ref:_,className:"nice-inplace__input",value:b,onChange:w=>{C(w.target.value)},onBlur:r?v:void 0,onKeyDown:S,children:i.map(w=>n.jsx("option",{value:w.value,children:w.label},w.value))}):n.jsx("input",{ref:_,className:"nice-inplace__input",type:a==="number"?"number":a==="date"?"date":"text",value:b,onChange:w=>C(w.target.value),onBlur:r?v:void 0,onKeyDown:S}),n.jsx("button",{type:"button",className:"nice-inplace__save",onClick:v,"aria-label":"Save",children:"✓"}),n.jsx("button",{type:"button",className:"nice-inplace__cancel",onClick:j,"aria-label":"Cancel",children:"✕"})]}):n.jsxs("span",{className:"nice-inplace__display",onClick:f,role:"button",tabIndex:0,onKeyDown:w=>w.key==="Enter"&&f(),children:[I||n.jsx("span",{className:"nice-inplace__placeholder",children:s||"Click to edit"}),!l&&n.jsx("span",{className:"nice-inplace__icon",children:"✎"})]})})});na.displayName="NiceInPlaceEditor";function Yd(e){let t=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return t=t.replace(/```(\w*)\n([\s\S]*?)```/g,(a,i,r)=>`<pre><code class="language-${i}">${r.trim()}</code></pre>`),t=t.replace(/^(\|.+\|)\n(\|[-| :]+\|)\n((?:\|.+\|\n?)+)/gm,(a,i,r,s)=>{const l=i.split("|").filter(d=>d.trim()).map(d=>`<th>${d.trim()}</th>`).join(""),c=s.trim().split(`
914
+ `).map(d=>`<tr>${d.split("|").filter(u=>u.trim()).map(u=>`<td>${u.trim()}</td>`).join("")}</tr>`).join("");return`<table><thead><tr>${l}</tr></thead><tbody>${c}</tbody></table>`}),t=t.replace(/^#### (.+)$/gm,"<h4>$1</h4>"),t=t.replace(/^### (.+)$/gm,"<h3>$1</h3>"),t=t.replace(/^## (.+)$/gm,"<h2>$1</h2>"),t=t.replace(/^# (.+)$/gm,"<h1>$1</h1>"),t=t.replace(/^&gt; (.+)$/gm,"<blockquote>$1</blockquote>"),t=t.replace(/^---$/gm,"<hr/>"),t=t.replace(/^- \[x\] (.+)$/gm,'<li class="task done">☑ $1</li>'),t=t.replace(/^- \[ \] (.+)$/gm,'<li class="task">☐ $1</li>'),t=t.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/\*(.+?)\*/g,"<em>$1</em>"),t=t.replace(/~~(.+?)~~/g,"<del>$1</del>"),t=t.replace(/`(.+?)`/g,"<code>$1</code>"),t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,'<img src="$2" alt="$1" style="max-width:100%"/>'),t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>'),t=t.replace(/^\- (.+)$/gm,"<li>$1</li>"),t=t.replace(/^\d+\. (.+)$/gm,"<li>$1</li>"),t=t.replace(/\n/g,"<br/>"),t}const Zd=[{key:"bold",label:"B",md:"**",tip:"Bold",shortcut:"Ctrl+B",group:"format"},{key:"italic",label:"I",md:"*",tip:"Italic",shortcut:"Ctrl+I",group:"format"},{key:"strike",label:"S̶",md:"~~",tip:"Strikethrough",group:"format"},{key:"code",label:"< >",md:"`",tip:"Inline code",group:"format"},{key:"h1",label:"H1",md:"# ",tip:"Heading 1",group:"heading"},{key:"h2",label:"H2",md:"## ",tip:"Heading 2",group:"heading"},{key:"h3",label:"H3",md:"### ",tip:"Heading 3",group:"heading"},{key:"ul",label:"•",md:"- ",tip:"Unordered list",group:"list"},{key:"ol",label:"1.",md:"1. ",tip:"Ordered list",group:"list"},{key:"task",label:"☑",md:"- [ ] ",tip:"Task list",group:"list"},{key:"quote",label:"❝",md:"> ",tip:"Blockquote",group:"block"},{key:"hr",label:"—",md:`---
915
+ `,tip:"Horizontal rule",group:"block"},{key:"link",label:"🔗",md:"[](url)",tip:"Link",shortcut:"Ctrl+K",group:"insert"},{key:"image",label:"🖼",md:"![](url)",tip:"Image",group:"insert"},{key:"table",label:"⊞",md:`| H1 | H2 | H3 |
916
+ | --- | --- | --- |
917
+ | c1 | c2 | c3 |
918
+ `,tip:"Table",group:"insert"},{key:"codeblock",label:"```",md:"```\n",tip:"Code block",group:"insert"}],Gd=["format","heading","list","block","insert"],aa=o.forwardRef(({value:e="",onChange:t,preview:a="side",placeholder:i,disabled:r,readOnly:s,size:l="md",editorSize:c="standard",toolbar:d=!0,minHeight:u=200,showWordCount:g=!1,showLineNumbers:h=!1,onExportHtml:p,onImageUpload:m,className:k,style:b,id:C},_)=>{const f=ke(C),[v,j]=o.useState("edit"),[S,I]=o.useState(!1),M=o.useRef(null),w=o.useMemo(()=>Yd(e),[e]),E=o.useMemo(()=>{const D=e.trim()?e.trim().split(/\s+/).length:0,F=e.length,y=e.split(`
919
+ `).length;return{words:D,chars:F,lines:y}},[e]),P=o.useCallback(D=>{const F=M.current;if(!F)return;const y=F.selectionStart,$=F.selectionEnd,z=e.slice(y,$);let R,T;D==="[](url)"?(R=e.slice(0,y)+`[${z||"text"}](url)`+e.slice($),T=y+1+(z||"text").length+2):D==="![](url)"?(R=e.slice(0,y)+`![${z||"alt"}](url)`+e.slice($),T=y+2+(z||"alt").length+2):D.endsWith(`
920
+ `)||D.endsWith(" ")?(R=e.slice(0,y)+D+z+e.slice($),T=y+D.length+z.length):(R=e.slice(0,y)+D+z+D+e.slice($),T=y+D.length+z.length+D.length),t==null||t(R),requestAnimationFrame(()=>{F.focus(),F.setSelectionRange(T,T)})},[e,t]),L=o.useCallback(D=>{if((D.ctrlKey||D.metaKey)&&(D.key==="b"?(D.preventDefault(),P("**")):D.key==="i"?(D.preventDefault(),P("*")):D.key==="k"&&(D.preventDefault(),P("[](url)"))),D.key==="Tab"){D.preventDefault();const F=D.currentTarget,y=F.selectionStart,$=F.selectionEnd,z=" ";if(D.shiftKey){const R=e.slice(0,y).lastIndexOf(`
921
+ `)+1;if(e.slice(R,R+z.length)===z){const T=e.slice(0,R)+e.slice(R+z.length);t==null||t(T),requestAnimationFrame(()=>{F.selectionStart=F.selectionEnd=y-z.length})}}else{const R=e.slice(0,y)+z+e.slice($);t==null||t(R),requestAnimationFrame(()=>{F.selectionStart=F.selectionEnd=y+z.length})}}},[e,t,P]),A=o.useCallback(async D=>{if(!m)return;const F=Array.from(D.dataTransfer.files).filter(y=>y.type.startsWith("image/"));if(F.length!==0){D.preventDefault();for(const y of F){const $=await m(y),z=M.current;if(!z)continue;const R=z.selectionStart,T=`![${y.name}](${$})
922
+ `,B=e.slice(0,R)+T+e.slice(R);t==null||t(B)}}},[e,t,m]),N=a!=="tab"||v==="edit",x=a==="side"||a==="tab"&&v==="preview"||a===!0,O=`nice-md-editor nice-md-editor--${l} nice-editor--${c} nice-md-editor--preview-${a}${S?" nice-md-editor--fullscreen":""} ${k||""}`;return n.jsxs("div",{ref:_,id:f,className:O,style:b,children:[d&&n.jsxs("div",{className:"nice-md-editor__toolbar",children:[Gd.map((D,F)=>n.jsxs(o.Fragment,{children:[F>0&&n.jsx("span",{className:"nice-md-editor__sep"}),Zd.filter(y=>y.group===D).map(y=>n.jsx("button",{type:"button",className:"nice-md-editor__btn",title:y.shortcut?`${y.tip} (${y.shortcut})`:y.tip,disabled:r||s,onClick:()=>P(y.md),children:y.label},y.key))]},D)),n.jsx("span",{className:"nice-md-editor__sep"}),n.jsx("button",{type:"button",className:"nice-md-editor__btn",title:"Fullscreen",onClick:()=>I(!S),children:S?"⊙":"⛶"}),p&&n.jsx("button",{type:"button",className:"nice-md-editor__btn",title:"Export HTML",onClick:()=>p(w),children:"↗"}),a==="tab"&&n.jsxs("span",{className:"nice-md-editor__tabs",children:[n.jsx("button",{type:"button",className:`nice-md-editor__tab${v==="edit"?" nice-md-editor__tab--active":""}`,onClick:()=>j("edit"),children:"Edit"}),n.jsx("button",{type:"button",className:`nice-md-editor__tab${v==="preview"?" nice-md-editor__tab--active":""}`,onClick:()=>j("preview"),children:"Preview"})]})]}),n.jsxs("div",{className:"nice-md-editor__body",style:{minHeight:u},children:[N&&n.jsxs("div",{className:"nice-md-editor__editor-wrap",children:[h&&n.jsx("div",{className:"nice-md-editor__line-numbers",children:Array.from({length:E.lines},(D,F)=>n.jsx("div",{className:"nice-md-editor__line-no",children:F+1},F))}),n.jsx("textarea",{ref:M,className:"nice-md-editor__textarea",value:e,onChange:D=>t==null?void 0:t(D.target.value),onKeyDown:L,onDrop:A,placeholder:i,disabled:r,readOnly:s,style:{minHeight:u}})]}),x&&n.jsx("div",{className:"nice-md-editor__preview",dangerouslySetInnerHTML:{__html:tn(w)},style:{minHeight:u}})]}),g&&n.jsxs("div",{className:"nice-md-editor__statusbar",children:[n.jsxs("span",{children:[E.words," words"]}),n.jsxs("span",{children:[E.chars," chars"]}),n.jsxs("span",{children:[E.lines," lines"]})]})]})});aa.displayName="NiceMarkdownEditor";const Pa={rotation:0,flipH:!1,flipV:!1,brightness:100,contrast:100,saturate:100,blur:0,crop:null,annotations:[]},Xd=["crop","rotate","flip","brightness","contrast","saturate","blur","annotate"],ia=o.forwardRef(({src:e,size:t="md",editorSize:a="standard",tools:i=Xd,showToolbar:r=!0,showZoom:s=!0,maxUndo:l=30,onSave:c,onCancel:d,onChange:u,width:g="100%",height:h=500,className:p,style:m,id:k,...b},C)=>{const _=ke(k),{t:f}=Se(),v=o.useRef(null),j=o.useRef(null),[S,I]=o.useState({...Pa}),[M,w]=o.useState(null),[E,P]=o.useState(!1),[L,A]=o.useState(1),[N,x]=o.useState("rect"),[O,D]=o.useState("#ff0000"),[F,y]=o.useState({w:0,h:0}),[$,z]=o.useState([]),[R,T]=o.useState([]),[B,V]=o.useState(null),[K,H]=o.useState(null),[q,Z]=o.useState(null),Q=o.useCallback(Y=>{z(X=>[...X.slice(-(l-1)),Y]),T([])},[l]),J=o.useCallback(Y=>{I(X=>{Q(X);const W={...X,...Y};return u==null||u(W),W})},[u,Q]),ee=o.useCallback(()=>{if($.length===0)return;const Y=$[$.length-1];z(X=>X.slice(0,-1)),T(X=>[...X,S]),I(Y),u==null||u(Y)},[$,S,u]),ie=o.useCallback(()=>{if(R.length===0)return;const Y=R[R.length-1];T(X=>X.slice(0,-1)),z(X=>[...X,S]),I(Y),u==null||u(Y)},[R,S,u]);o.useEffect(()=>{const Y=new Image;Y.crossOrigin="anonymous",Y.onload=()=>{j.current=Y,y({w:Y.width,h:Y.height}),P(!0)},Y.src=e},[e]),o.useEffect(()=>{if(!E||!v.current||!j.current)return;const Y=v.current,X=Y.getContext("2d");if(!X)return;const W=j.current,G=S.rotation%180!==0,re=G?W.height:W.width,ne=G?W.width:W.height;Y.width=re,Y.height=ne,X.clearRect(0,0,re,ne),X.save(),X.filter=`brightness(${S.brightness}%) contrast(${S.contrast}%) saturate(${S.saturate}%) blur(${S.blur}px)`,X.translate(re/2,ne/2),X.rotate(S.rotation*Math.PI/180),X.scale(S.flipH?-1:1,S.flipV?-1:1),X.drawImage(W,-W.width/2,-W.height/2),X.restore(),S.annotations.forEach(se=>{switch(X.save(),X.strokeStyle=se.color??"red",X.fillStyle=se.color??"red",X.lineWidth=se.strokeWidth??2,X.font=`${se.fontSize??16}px sans-serif`,se.type){case"text":X.fillText(se.text??"",se.x,se.y);break;case"rect":X.strokeRect(se.x,se.y,se.width??100,se.height??50);break;case"circle":{const oe=(se.width??50)/2,ye=(se.height??50)/2;X.beginPath(),X.ellipse(se.x+oe,se.y+ye,oe,ye,0,0,Math.PI*2),X.stroke();break}case"line":X.beginPath(),X.moveTo(se.x,se.y),X.lineTo(se.x+(se.width??100),se.y+(se.height??0)),X.stroke();break;case"arrow":{const oe=se.x+(se.width??100),ye=se.y+(se.height??0);X.beginPath(),X.moveTo(se.x,se.y),X.lineTo(oe,ye),X.stroke();const ge=Math.atan2(ye-se.y,oe-se.x),we=10;X.beginPath(),X.moveTo(oe,ye),X.lineTo(oe-we*Math.cos(ge-.4),ye-we*Math.sin(ge-.4)),X.lineTo(oe-we*Math.cos(ge+.4),ye-we*Math.sin(ge+.4)),X.closePath(),X.fill();break}}X.restore()}),K&&(X.save(),X.fillStyle="rgba(0,0,0,0.5)",X.fillRect(0,0,re,ne),X.clearRect(K.x,K.y,K.w,K.h),X.strokeStyle="#fff",X.lineWidth=2,X.setLineDash([5,5]),X.strokeRect(K.x,K.y,K.w,K.h),X.restore())},[E,S,K]);const pe=o.useCallback(Y=>{if(!v.current)return;const X=v.current.getBoundingClientRect(),W=v.current.width/X.width,G=v.current.height/X.height,re=(Y.clientX-X.left)*W,ne=(Y.clientY-X.top)*G;M==="crop"?V({startX:re,startY:ne}):M==="annotate"&&Z({startX:re,startY:ne})},[M]),te=o.useCallback(Y=>{if(!v.current)return;const X=v.current.getBoundingClientRect(),W=v.current.width/X.width,G=v.current.height/X.height,re=(Y.clientX-X.left)*W,ne=(Y.clientY-X.top)*G;B&&H({x:Math.min(B.startX,re),y:Math.min(B.startY,ne),w:Math.abs(re-B.startX),h:Math.abs(ne-B.startY)})},[B]),ue=o.useCallback(Y=>{if(B&&K&&K.w>5&&K.h>5&&J({crop:{x:K.x,y:K.y,width:K.w,height:K.h}}),V(null),q&&v.current){const X=v.current.getBoundingClientRect(),W=v.current.width/X.width,G=v.current.height/X.height,re=(Y.clientX-X.left)*W,ne=(Y.clientY-X.top)*G,se=re-q.startX,oe=ne-q.startY;if(Math.abs(se)>3||Math.abs(oe)>3||N==="text"){const ye={type:N,x:q.startX,y:q.startY,width:Math.abs(se)||100,height:Math.abs(oe)||50,color:O,strokeWidth:2,text:N==="text"?prompt(f("imageEditor.annotationText","Text:"))??"":void 0};J({annotations:[...S.annotations,ye]})}Z(null)}},[B,K,q,N,O,S.annotations,J,f]),fe=o.useCallback(()=>{if(!S.crop||!v.current)return;const Y=v.current,X=Y.getContext("2d");if(!X)return;const{x:W,y:G,width:re,height:ne}=S.crop,se=X.getImageData(W,G,re,ne);Y.width=re,Y.height=ne,X.putImageData(se,0,0),H(null),w(null)},[S.crop]),ae=o.useCallback(()=>{if(!v.current)return;const Y=v.current.toDataURL("image/png");c==null||c(Y,S)},[c,S]),he=o.useCallback(()=>{I({...Pa}),H(null),w(null)},[]);return o.useMemo(()=>`brightness(${S.brightness}%) contrast(${S.contrast}%) saturate(${S.saturate}%) blur(${S.blur}px)`,[S.brightness,S.contrast,S.saturate,S.blur]),n.jsxs("div",{ref:C,id:_,className:`nice-image-editor nice-image-editor--${t} nice-editor--${a} ${p??""}`,style:{...m,width:g,height:h},role:"application","aria-label":f("imageEditor.label","Image Editor"),...b,children:[r&&n.jsxs("div",{className:"nice-image-editor__toolbar",role:"toolbar",children:[n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:ee,disabled:$.length===0,title:f("imageEditor.undo","Undo"),children:"↶"}),n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:ie,disabled:R.length===0,title:f("imageEditor.redo","Redo"),children:"↷"}),n.jsx("span",{className:"nice-image-editor__sep"}),i.includes("rotate")&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>J({rotation:(S.rotation-90+360)%360}),title:f("imageEditor.rotateLeft","Rotate left"),children:"↺"}),n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>J({rotation:(S.rotation+90)%360}),title:f("imageEditor.rotateRight","Rotate right"),children:"↻"})]}),i.includes("flip")&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>J({flipH:!S.flipH}),title:f("imageEditor.flipH","Flip horizontal"),children:"⇔"}),n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>J({flipV:!S.flipV}),title:f("imageEditor.flipV","Flip vertical"),children:"⇕"})]}),i.includes("crop")&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:`nice-image-editor__btn ${M==="crop"?"nice-image-editor__btn--active":""}`,onClick:()=>w(M==="crop"?null:"crop"),title:f("imageEditor.crop","Crop"),children:"⊡"}),M==="crop"&&S.crop&&n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:fe,title:f("imageEditor.applyCrop","Apply crop"),children:"✓"})]}),i.includes("brightness")&&n.jsxs("label",{className:"nice-image-editor__slider-label",children:[f("imageEditor.brightness","☀"),n.jsx("input",{type:"range",min:0,max:200,value:S.brightness,onChange:Y=>J({brightness:Number(Y.target.value)}),className:"nice-image-editor__slider",title:f("imageEditor.brightness","Brightness")})]}),i.includes("contrast")&&n.jsxs("label",{className:"nice-image-editor__slider-label",children:[f("imageEditor.contrast","◑"),n.jsx("input",{type:"range",min:0,max:200,value:S.contrast,onChange:Y=>J({contrast:Number(Y.target.value)}),className:"nice-image-editor__slider",title:f("imageEditor.contrast","Contrast")})]}),i.includes("saturate")&&n.jsxs("label",{className:"nice-image-editor__slider-label",children:[f("imageEditor.saturate","🎨"),n.jsx("input",{type:"range",min:0,max:200,value:S.saturate,onChange:Y=>J({saturate:Number(Y.target.value)}),className:"nice-image-editor__slider",title:f("imageEditor.saturate","Saturation")})]}),i.includes("blur")&&n.jsxs("label",{className:"nice-image-editor__slider-label",children:[f("imageEditor.blur","⊘"),n.jsx("input",{type:"range",min:0,max:20,step:.5,value:S.blur,onChange:Y=>J({blur:Number(Y.target.value)}),className:"nice-image-editor__slider",title:f("imageEditor.blur","Blur")})]}),i.includes("annotate")&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"nice-image-editor__sep"}),n.jsx("button",{type:"button",className:`nice-image-editor__btn ${M==="annotate"?"nice-image-editor__btn--active":""}`,onClick:()=>w(M==="annotate"?null:"annotate"),title:f("imageEditor.annotate","Annotate"),children:"✎"}),M==="annotate"&&n.jsxs(n.Fragment,{children:[n.jsxs("select",{className:"nice-image-editor__select",value:N,onChange:Y=>x(Y.target.value),children:[n.jsx("option",{value:"rect",children:"□ Rect"}),n.jsx("option",{value:"circle",children:"○ Circle"}),n.jsx("option",{value:"line",children:"╱ Line"}),n.jsx("option",{value:"arrow",children:"→ Arrow"}),n.jsx("option",{value:"text",children:"T Text"})]}),n.jsx("input",{type:"color",value:O,onChange:Y=>D(Y.target.value),className:"nice-image-editor__color",title:f("imageEditor.color","Color")}),S.annotations.length>0&&n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>J({annotations:S.annotations.slice(0,-1)}),title:f("imageEditor.removeLastAnnotation","Remove last"),children:"⌫"})]})]}),n.jsx("span",{className:"nice-image-editor__sep"}),n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:he,title:f("imageEditor.reset","Reset"),children:"⟲"}),c&&n.jsx("button",{type:"button",className:"nice-image-editor__btn nice-image-editor__btn--save",onClick:ae,children:f("imageEditor.save","Save")}),d&&n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:d,children:f("imageEditor.cancel","Cancel")})]}),n.jsx("div",{className:"nice-image-editor__canvas-wrap",children:n.jsx("canvas",{ref:v,className:"nice-image-editor__canvas",onMouseDown:pe,onMouseMove:te,onMouseUp:ue,style:{cursor:M==="crop"||M==="annotate"?"crosshair":"default",transform:`scale(${L})`,transformOrigin:"center center"}})}),s&&n.jsxs("div",{className:"nice-image-editor__footer",children:[n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>A(Y=>Math.max(.1,Y-.1)),title:"Zoom out",children:"−"}),n.jsxs("span",{style:{fontSize:"0.85em",minWidth:40,textAlign:"center"},children:[Math.round(L*100),"%"]}),n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>A(Y=>Math.min(5,Y+.1)),title:"Zoom in",children:"+"}),n.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>A(1),title:"Reset zoom",children:"1:1"}),n.jsx("span",{style:{flex:1}}),n.jsxs("span",{style:{fontSize:"0.8em",color:"var(--nice-text-secondary, #666)"},children:[F.w,"×",F.h,"px · ",S.rotation,"°"]})]})]})});ia.displayName="NiceImageEditor";const ra=o.forwardRef(({value:e,onChange:t,penColor:a="#000",penWidth:i=2,backgroundColor:r="#fff",width:s=400,height:l=200,size:c="md",disabled:d=!1,readOnly:u=!1,showClear:g=!0,showUndo:h=!0,label:p,exportFormat:m="image/png",className:k,style:b,id:C,..._},f)=>{const v=ke(C),{t:j}=Se(),S=o.useRef(null),[I,M]=o.useState(!1),w=o.useRef([]),E=o.useRef([]),[P,L]=o.useState(!0),A=o.useCallback(()=>{const $=S.current;if(!$)return;const z=$.getContext("2d");if(z){z.fillStyle=r,z.fillRect(0,0,$.width,$.height),z.strokeStyle=a,z.lineWidth=i,z.lineCap="round",z.lineJoin="round";for(const R of w.current)if(!(R.length<2)){z.beginPath(),z.moveTo(R[0].x,R[0].y);for(let T=1;T<R.length;T++)z.lineTo(R[T].x,R[T].y);z.stroke()}}},[r,a,i]);o.useEffect(()=>{if(e&&S.current){const $=new Image;$.onload=()=>{var R;const z=(R=S.current)==null?void 0:R.getContext("2d");!z||!S.current||(z.fillStyle=r,z.fillRect(0,0,S.current.width,S.current.height),z.drawImage($,0,0),L(!1))},$.src=e}else e||(w.current=[],L(!0),A())},[e,r,A]),o.useEffect(()=>{const $=S.current;$&&($.width=s,$.height=l,A())},[s,l,A]);const N=o.useCallback($=>{const z=S.current,R=z.getBoundingClientRect(),T=z.width/R.width,B=z.height/R.height;if("touches"in $){const V=$.touches[0];return{x:(V.clientX-R.left)*T,y:(V.clientY-R.top)*B}}return{x:($.clientX-R.left)*T,y:($.clientY-R.top)*B}},[]),x=o.useCallback($=>{if(d||u)return;$.preventDefault();const z=N($);E.current=[z],M(!0)},[d,u,N]),O=o.useCallback($=>{if(!I)return;$.preventDefault();const z=N($);E.current.push(z);const R=S.current,T=R==null?void 0:R.getContext("2d");if(!T||!R)return;const B=E.current;B.length>=2&&(T.strokeStyle=a,T.lineWidth=i,T.lineCap="round",T.beginPath(),T.moveTo(B[B.length-2].x,B[B.length-2].y),T.lineTo(z.x,z.y),T.stroke())},[I,N,a,i]),D=o.useCallback(()=>{if(I&&(M(!1),E.current.length>0&&(w.current.push([...E.current]),E.current=[],L(!1),S.current))){const $=S.current.toDataURL(m);t==null||t($)}},[I,m,t]),F=o.useCallback(()=>{w.current=[],E.current=[],L(!0),A(),t==null||t(null)},[A,t]),y=o.useCallback(()=>{if(w.current.length!==0&&(w.current.pop(),L(w.current.length===0),A(),S.current)){const $=w.current.length>0?S.current.toDataURL(m):null;t==null||t($)}},[A,m,t]);return n.jsxs("div",{ref:f,id:v,className:`nice-signature nice-signature--${c} ${d?"nice-signature--disabled":""} ${u?"nice-signature--readonly":""} ${k??""}`,style:b,..._,children:[p&&n.jsx("label",{className:"nice-signature__label",children:p}),n.jsx("div",{className:"nice-signature__canvas-wrap",style:{width:s,height:l},children:n.jsx("canvas",{ref:S,className:"nice-signature__canvas",onMouseDown:x,onMouseMove:O,onMouseUp:D,onMouseLeave:D,onTouchStart:x,onTouchMove:O,onTouchEnd:D,style:{touchAction:"none",cursor:d||u?"default":"crosshair"},"aria-label":p??j("signature.label","Signature pad"),role:"img"})}),(g||h)&&!u&&!d&&n.jsxs("div",{className:"nice-signature__actions",children:[h&&n.jsx("button",{type:"button",className:"nice-signature__btn",onClick:y,disabled:P,children:j("signature.undo","Undo")}),g&&n.jsx("button",{type:"button",className:"nice-signature__btn",onClick:F,disabled:P,children:j("signature.clear","Clear")})]})]})});ra.displayName="NiceSignaturePad";const qi=o.createContext(null),Vi=()=>{const e=o.useContext(qi);if(!e)throw new Error("useUploadContext must be used within NiceFileUpload");return e},Qd=()=>`file-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,zt=e=>{if(e===0)return"0 B";const t=1024,a=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,i)).toFixed(2))+" "+a[i]},Ki=e=>e.startsWith("image/")?"🖼️":e.startsWith("video/")?"🎬":e.startsWith("audio/")?"🎵":e.includes("pdf")?"📄":e.includes("word")||e.includes("document")?"📝":e.includes("excel")||e.includes("spreadsheet")?"📊":e.includes("powerpoint")||e.includes("presentation")?"📽️":e.includes("zip")||e.includes("rar")||e.includes("7z")?"📦":e.includes("text/")||e.includes("json")||e.includes("xml")?"📃":"📁",Ui=e=>e.startsWith("image/"),Yi=e=>e.startsWith("video/"),Jd=e=>e.startsWith("audio/"),eu=e=>{if(Ui(e.type)||Yi(e.type)||Jd(e.type))return URL.createObjectURL(e)},tu=(e,t)=>async a=>{const i=new FormData;a.chunk?(i.append("chunk",a.chunk),i.append("chunkIndex",String(a.chunkIndex)),i.append("totalChunks",String(a.totalChunks)),i.append("fileName",a.file.name),i.append("fileId",a.fileId||"")):i.append("file",a.file);const r=new XMLHttpRequest;return new Promise((s,l)=>{r.upload.addEventListener("progress",c=>{c.lengthComputable&&a.onProgress&&a.onProgress(c.loaded/c.total*100)}),r.addEventListener("load",()=>{if(r.status>=200&&r.status<300)try{const c=JSON.parse(r.responseText);s({success:!0,url:c.url,fileId:c.fileId||c.id,metadata:c})}catch{s({success:!0,url:r.responseText})}else s({success:!1,error:`Upload failed: ${r.status} ${r.statusText}`})}),r.addEventListener("error",()=>{s({success:!1,error:"Network error"})}),r.addEventListener("abort",()=>{s({success:!1,error:"Upload cancelled"})}),a.signal&&a.signal.addEventListener("abort",()=>r.abort()),r.open("POST",e),t&&Object.entries(t).forEach(([c,d])=>{r.setRequestHeader(c,d)}),r.send(i)})},fn=({progress:e,status:t})=>{const a=()=>{switch(t){case"success":return"#22c55e";case"error":return"#ef4444";case"cancelled":return"#6b7280";default:return"#3b82f6"}};return n.jsxs("div",{className:"nice-upload-progress",children:[n.jsx("div",{className:"nice-upload-progress-bar",style:{width:`${e}%`,backgroundColor:a()}}),n.jsxs("span",{className:"nice-upload-progress-text",children:[Math.round(e),"%"]})]})},Ba=({file:e,size:t="md",customRender:a})=>{if(a)return n.jsx(n.Fragment,{children:a(e)});const i={xxs:24,xs:32,sm:48,md:80,lg:120,xl:160,xxl:200}[t]??80;return e.previewUrl&&Ui(e.type)?n.jsx("div",{className:"nice-upload-preview",style:{width:i,height:i},children:n.jsx("img",{src:e.previewUrl,alt:e.name,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:4}})}):e.previewUrl&&Yi(e.type)?n.jsxs("div",{className:"nice-upload-preview",style:{width:i,height:i},children:[n.jsx("video",{src:e.previewUrl,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:4},muted:!0}),n.jsx("span",{className:"nice-upload-preview-overlay",children:"▶️"})]}):n.jsx("div",{className:"nice-upload-preview nice-upload-preview-icon",style:{width:i,height:i,fontSize:i*.5},children:Ki(e.type)})},nu=({file:e,actions:t,showPreview:a=!0,previewSize:i="md",customRenderPreview:r,customRender:s,mode:l="list"})=>{const{disabled:c,readOnly:d}=Vi();if(s)return n.jsx(n.Fragment,{children:s(e,t)});const u=()=>{switch(e.status){case"pending":return n.jsx("span",{className:"nice-upload-badge pending",children:"Oczekuje"});case"uploading":return n.jsx("span",{className:"nice-upload-badge uploading",children:"Wysyłanie..."});case"success":return n.jsx("span",{className:"nice-upload-badge success",children:"✓ Przesłano"});case"error":return n.jsx("span",{className:"nice-upload-badge error",children:"✗ Błąd"});case"cancelled":return n.jsx("span",{className:"nice-upload-badge cancelled",children:"Anulowano"})}};return l==="compact"?n.jsxs("div",{className:`nice-upload-item compact ${e.status}`,children:[n.jsx("span",{className:"nice-upload-item-icon",children:Ki(e.type)}),n.jsx("span",{className:"nice-upload-item-name",title:e.name,children:e.name}),n.jsx("span",{className:"nice-upload-item-size",children:zt(e.size)}),e.status==="uploading"&&n.jsx(fn,{progress:e.progress,status:e.status}),u(),!d&&!c&&e.status!=="uploading"&&n.jsx("button",{className:"nice-upload-item-remove",onClick:t.remove,title:"Usuń",children:"✕"})]}):l==="grid"?n.jsxs("div",{className:`nice-upload-item grid ${e.status}`,children:[a&&n.jsx(Ba,{file:e,size:"lg",customRender:r}),n.jsxs("div",{className:"nice-upload-item-info",children:[n.jsx("span",{className:"nice-upload-item-name",title:e.name,children:e.name}),n.jsx("span",{className:"nice-upload-item-size",children:zt(e.size)})]}),e.status==="uploading"&&n.jsx(fn,{progress:e.progress,status:e.status}),u(),e.error&&n.jsx("span",{className:"nice-upload-item-error",children:e.error}),!d&&!c&&n.jsxs("div",{className:"nice-upload-item-actions",children:[e.status==="pending"&&n.jsx("button",{onClick:t.upload,className:"nice-upload-btn upload",children:"Wyślij"}),e.status==="uploading"&&n.jsx("button",{onClick:t.cancel,className:"nice-upload-btn cancel",children:"Anuluj"}),e.status==="error"&&n.jsx("button",{onClick:t.retry,className:"nice-upload-btn retry",children:"Ponów"}),e.status!=="uploading"&&n.jsx("button",{onClick:t.remove,className:"nice-upload-btn remove",children:"Usuń"})]})]}):n.jsxs("div",{className:`nice-upload-item list ${e.status}`,children:[a&&n.jsx(Ba,{file:e,size:i,customRender:r}),n.jsxs("div",{className:"nice-upload-item-content",children:[n.jsxs("div",{className:"nice-upload-item-header",children:[n.jsx("span",{className:"nice-upload-item-name",title:e.name,children:e.name}),u()]}),n.jsx("span",{className:"nice-upload-item-size",children:zt(e.size)}),e.status==="uploading"&&n.jsx(fn,{progress:e.progress,status:e.status}),e.error&&n.jsx("span",{className:"nice-upload-item-error",children:e.error}),e.uploadedUrl&&n.jsx("a",{href:e.uploadedUrl,target:"_blank",rel:"noopener noreferrer",className:"nice-upload-item-link",children:"Otwórz plik"})]}),!d&&!c&&n.jsxs("div",{className:"nice-upload-item-actions",children:[e.status==="pending"&&n.jsx("button",{onClick:t.upload,className:"nice-upload-btn upload",title:"Wyślij",children:"⬆️"}),e.status==="uploading"&&n.jsx("button",{onClick:t.cancel,className:"nice-upload-btn cancel",title:"Anuluj",children:"⏹️"}),e.status==="error"&&n.jsx("button",{onClick:t.retry,className:"nice-upload-btn retry",title:"Ponów",children:"🔄"}),e.status!=="uploading"&&n.jsx("button",{onClick:t.remove,className:"nice-upload-btn remove",title:"Usuń",children:"🗑️"})]})]})},au=({files:e,mode:t="list",showPreview:a=!0,previewSize:i,renderPreview:r,renderFileItem:s})=>{const l=Vi();return e.length===0?null:n.jsx("div",{className:`nice-upload-list ${t}`,children:e.map(c=>n.jsx(nu,{file:c,actions:{upload:()=>l.uploadFile(c.id),cancel:()=>l.cancelFile(c.id),retry:()=>l.retryFile(c.id),remove:()=>l.removeFile(c.id)},mode:t,showPreview:a,previewSize:i,customRenderPreview:r,customRender:s},c.id))})},iu=({onFiles:e,accept:t,multiple:a=!0,disabled:i,readOnly:r,dropzoneText:s="Przeciągnij pliki tutaj lub",browseText:l="wybierz z dysku",dragActiveText:c="Upuść pliki tutaj",className:d,inputRef:u})=>{const[g,h]=o.useState(!1),p=o.useRef(0),m=o.useCallback(v=>{v.preventDefault(),v.stopPropagation(),p.current++,v.dataTransfer.items&&v.dataTransfer.items.length>0&&h(!0)},[]),k=o.useCallback(v=>{v.preventDefault(),v.stopPropagation(),p.current--,p.current===0&&h(!1)},[]),b=o.useCallback(v=>{v.preventDefault(),v.stopPropagation()},[]),C=o.useCallback(v=>{if(v.preventDefault(),v.stopPropagation(),h(!1),p.current=0,i||r)return;const j=Array.from(v.dataTransfer.files);j.length>0&&e(a?j:[j[0]])},[i,r,a,e]),_=o.useCallback(()=>{!i&&!r&&u.current&&u.current.click()},[i,r,u]),f=o.useCallback(v=>{const j=v.target.files?Array.from(v.target.files):[];j.length>0&&e(j),u.current&&(u.current.value="")},[e,u]);return n.jsxs("div",{className:`nice-upload-dropzone ${g?"drag-active":""} ${i?"disabled":""} ${r?"readonly":""} ${d||""}`,onDragEnter:m,onDragLeave:k,onDragOver:b,onDrop:C,onClick:_,children:[n.jsx("input",{ref:u,type:"file",accept:t,multiple:a,onChange:f,style:{display:"none"},disabled:i||r}),n.jsxs("div",{className:"nice-upload-dropzone-content",children:[n.jsx("span",{className:"nice-upload-dropzone-icon",children:"📁"}),g?n.jsx("span",{className:"nice-upload-dropzone-text active",children:c}):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"nice-upload-dropzone-text",children:s}),n.jsx("button",{type:"button",className:"nice-upload-browse-btn",disabled:i||r,children:l})]})]})]})},Zi=o.forwardRef((e,t)=>{const{accept:a,multiple:i=!0,maxFileSize:r,maxFiles:s,minFileSize:l,chunkSize:c=5*1024*1024,chunkThreshold:d=10*1024*1024,autoUpload:u=!1,uploadHandler:g,uploadUrl:h,uploadHeaders:p,onFilesAdded:m,onUploadComplete:k,onUploadError:b,onProgress:C,onFileRemoved:_,onChange:f,renderPreview:v,renderFileItem:j,showPreview:S=!0,showFileList:I=!0,listMode:M="list",previewSize:w="md",dropzoneText:E,browseText:P,dragActiveText:L,disabled:A,readOnly:N,dropzoneClassName:x,maxRetries:O=3,concurrentUploads:D=3,validateFile:F,keepFilesAfterUpload:y=!0,initialFiles:$=[],className:z,style:R,...T}=e,[B,V]=o.useState($),K=o.useRef(null),H=o.useRef(new Map),q=o.useRef([]),Z=o.useRef(new Set);o.useEffect(()=>()=>{B.forEach(oe=>{oe.previewUrl&&URL.revokeObjectURL(oe.previewUrl)})},[]),o.useEffect(()=>{f==null||f(B)},[B,f]);const Q=o.useCallback(()=>g||(h?tu(h,p):null),[g,h,p]),J=o.useCallback(oe=>{var ye;if(F){const ge=F(oe);if(ge)return ge}if(r&&oe.size>r)return`Plik jest za duży. Maksymalny rozmiar: ${zt(r)}`;if(l&&oe.size<l)return`Plik jest za mały. Minimalny rozmiar: ${zt(l)}`;if(a){const ge=a.split(",").map(_e=>_e.trim().toLowerCase()),we=oe.type.toLowerCase(),Ce="."+((ye=oe.name.split(".").pop())==null?void 0:ye.toLowerCase());if(!ge.some(_e=>_e.startsWith(".")?Ce===_e:_e.endsWith("/*")?we.startsWith(_e.replace("/*","/")):we===_e))return`Niedozwolony typ pliku. Akceptowane typy: ${a}`}return null},[F,r,l,a]),ee=o.useCallback(oe=>{if(A||N)return;const ye=B.length;let ge=oe;s&&ye+ge.length>s&&(ge=ge.slice(0,s-ye));const we=ge.map(Ce=>{const _e=J(Ce);return{id:Qd(),file:Ce,name:Ce.name,size:Ce.size,type:Ce.type,status:_e?"error":"pending",progress:0,error:_e||void 0,previewUrl:eu(Ce)}});V(Ce=>[...Ce,...we]),m==null||m(we),u&&(we.filter(Ce=>Ce.status==="pending").forEach(Ce=>{q.current.push(Ce.id)}),ie())},[A,N,B.length,s,J,u,m]),ie=o.useCallback(()=>{const oe=Q();if(oe)for(;q.current.length>0&&Z.current.size<D;){const ye=q.current.shift();ye&&pe(ye,oe)}},[D,Q]),pe=o.useCallback(async(oe,ye)=>{const ge=B.find(Ce=>Ce.id===oe);if(!ge||ge.status==="uploading"||ge.status==="success")return;const we=new AbortController;H.current.set(oe,we),Z.current.add(oe),V(Ce=>Ce.map(_e=>_e.id===oe?{..._e,status:"uploading",progress:0,error:void 0}:_e));try{const Ce=ge.file;let _e;if(Ce.size>d?_e=await te(ge,ye,we.signal):_e=await ye({file:Ce,onProgress:Ie=>{V(je=>je.map(He=>He.id===oe?{...He,progress:Ie}:He)),C==null||C(ge,Ie)},signal:we.signal}),_e.success)V(Ie=>Ie.map(je=>je.id===oe?{...je,status:"success",progress:100,uploadedUrl:_e.url,uploadedAt:new Date}:je)),k==null||k({...ge,status:"success",uploadedUrl:_e.url});else throw new Error(_e.error||"Upload failed")}catch(Ce){if(Ce.name==="AbortError"||Ce.message==="Upload cancelled")V(_e=>_e.map(Ie=>Ie.id===oe?{...Ie,status:"cancelled",error:"Anulowano"}:Ie));else{const _e=Ce.message||"Błąd uploadu";V(Ie=>Ie.map(je=>je.id===oe?{...je,status:"error",error:_e}:je)),b==null||b(ge,_e)}}finally{H.current.delete(oe),Z.current.delete(oe),ie()}},[B,d,C,k,b,ie]),te=async(oe,ye,ge)=>{const we=oe.file,Ce=Math.ceil(we.size/c);let _e=0,Ie={success:!1};for(let je=0;je<Ce;je++){if(ge.aborted)throw new Error("Upload cancelled");const He=je*c,St=Math.min(He+c,we.size),st=we.slice(He,St);let Ke=0,lt=!1;for(;!lt&&Ke<O;)try{Ie=await ye({file:we,chunk:st,chunkIndex:je,totalChunks:Ce,fileId:oe.id,onProgress:ct=>{const tt=(_e+st.size*ct/100)/we.size*100;V(Pe=>Pe.map(We=>We.id===oe.id?{...We,progress:tt}:We))},signal:ge}),Ie.success?(lt=!0,_e+=st.size):Ke++}catch(ct){if(Ke++,Ke>=O)throw ct}if(!lt)throw new Error(`Failed to upload chunk ${je+1}/${Ce}`)}return Ie},ue=o.useCallback(oe=>{const ye=Q();if(!ye){console.error("No upload handler configured");return}pe(oe,ye)},[Q,pe]),fe=o.useCallback(oe=>{const ye=H.current.get(oe);ye&&ye.abort(),V(ge=>ge.map(we=>we.id===oe&&we.status==="uploading"?{...we,status:"cancelled",error:"Anulowano"}:we))},[]),ae=o.useCallback(oe=>{V(ye=>ye.map(ge=>ge.id===oe?{...ge,status:"pending",progress:0,error:void 0}:ge)),ue(oe)},[ue]),he=o.useCallback(oe=>{const ye=B.find(ge=>ge.id===oe);if(ye){const ge=H.current.get(oe);ge&&ge.abort(),ye.previewUrl&&URL.revokeObjectURL(ye.previewUrl),V(we=>we.filter(Ce=>Ce.id!==oe)),_==null||_(ye)}},[B,_]),Y=o.useCallback(()=>{B.filter(oe=>oe.status==="pending").forEach(oe=>{q.current.push(oe.id)}),ie()},[B,ie]),X=o.useCallback(()=>{H.current.forEach(oe=>oe.abort()),V(oe=>oe.map(ye=>ye.status==="uploading"?{...ye,status:"cancelled",error:"Anulowano"}:ye))},[]),W=o.useCallback(()=>{X(),B.forEach(oe=>{oe.previewUrl&&URL.revokeObjectURL(oe.previewUrl)}),V([])},[X,B]),G=o.useCallback(()=>{B.filter(oe=>oe.status==="error").forEach(oe=>ae(oe.id))},[B,ae]),re=o.useCallback(()=>{var oe;(oe=K.current)==null||oe.click()},[]);o.useImperativeHandle(t,()=>({addFiles:ee,uploadAll:Y,cancelAll:X,clearAll:W,getFiles:()=>B,getFile:oe=>B.find(ye=>ye.id===oe),retryFailed:G,openFileBrowser:re}),[ee,Y,X,W,B,G,re]);const ne=o.useMemo(()=>({files:B,uploadFile:ue,cancelFile:fe,retryFile:ae,removeFile:he,disabled:A,readOnly:N}),[B,ue,fe,ae,he,A,N]),se=o.useMemo(()=>({total:B.length,pending:B.filter(oe=>oe.status==="pending").length,uploading:B.filter(oe=>oe.status==="uploading").length,success:B.filter(oe=>oe.status==="success").length,error:B.filter(oe=>oe.status==="error").length}),[B]);return n.jsx(qi.Provider,{value:ne,children:n.jsxs("div",{className:`nice-file-upload ${A?"disabled":""} ${N?"readonly":""} ${z||""}`,style:R,...T,children:[!N&&n.jsx(iu,{onFiles:ee,accept:a,multiple:i,disabled:A,readOnly:N,dropzoneText:E,browseText:P,dragActiveText:L,className:x,inputRef:K}),I&&B.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"nice-upload-stats",children:[n.jsxs("span",{children:[se.total," ",se.total===1?"plik":"plików"]}),se.pending>0&&n.jsxs("span",{className:"pending",children:[se.pending," oczekuje"]}),se.uploading>0&&n.jsxs("span",{className:"uploading",children:[se.uploading," wysyłanie"]}),se.success>0&&n.jsxs("span",{className:"success",children:[se.success," przesłano"]}),se.error>0&&n.jsxs("span",{className:"error",children:[se.error," błędów"]})]}),!N&&!A&&se.pending>0&&n.jsxs("div",{className:"nice-upload-actions",children:[n.jsxs("button",{onClick:Y,className:"nice-upload-btn primary",children:["Wyślij wszystkie (",se.pending,")"]}),se.error>0&&n.jsxs("button",{onClick:G,className:"nice-upload-btn secondary",children:["Ponów nieudane (",se.error,")"]}),n.jsx("button",{onClick:W,className:"nice-upload-btn danger",children:"Wyczyść"})]}),n.jsx(au,{files:B,mode:M,showPreview:S,previewSize:w,renderPreview:v,renderFileItem:j})]}),n.jsx("style",{children:`
923
+ .nice-file-upload {
924
+ font-family: system-ui, -apple-system, sans-serif;
925
+ }
926
+
927
+ .nice-file-upload.disabled {
928
+ opacity: 0.5;
929
+ pointer-events: none;
930
+ }
931
+
932
+ .nice-upload-dropzone {
933
+ border: 2px dashed #d1d5db;
934
+ border-radius: 12px;
935
+ padding: 40px 24px;
936
+ text-align: center;
937
+ cursor: pointer;
938
+ transition: all 0.2s ease;
939
+ background: #fafafa;
940
+ }
941
+
942
+ .nice-upload-dropzone:hover:not(.disabled):not(.readonly) {
943
+ border-color: #3b82f6;
944
+ background: #eff6ff;
945
+ }
946
+
947
+ .nice-upload-dropzone.drag-active {
948
+ border-color: #3b82f6;
949
+ background: #dbeafe;
950
+ transform: scale(1.01);
951
+ }
952
+
953
+ .nice-upload-dropzone.disabled,
954
+ .nice-upload-dropzone.readonly {
955
+ cursor: default;
956
+ background: #f3f4f6;
957
+ }
958
+
959
+ .nice-upload-dropzone-content {
960
+ display: flex;
961
+ flex-direction: column;
962
+ align-items: center;
963
+ gap: 12px;
964
+ }
965
+
966
+ .nice-upload-dropzone-icon {
967
+ font-size: 48px;
968
+ }
969
+
970
+ .nice-upload-dropzone-text {
971
+ font-size: 14px;
972
+ color: #6b7280;
973
+ }
974
+
975
+ .nice-upload-dropzone-text.active {
976
+ font-size: 16px;
977
+ color: #3b82f6;
978
+ font-weight: 500;
979
+ }
980
+
981
+ .nice-upload-browse-btn {
982
+ background: #3b82f6;
983
+ color: white;
984
+ border: none;
985
+ padding: 8px 20px;
986
+ border-radius: 6px;
987
+ font-size: 14px;
988
+ cursor: pointer;
989
+ transition: background 0.2s;
990
+ }
991
+
992
+ .nice-upload-browse-btn:hover:not(:disabled) {
993
+ background: #2563eb;
994
+ }
995
+
996
+ .nice-upload-browse-btn:disabled {
997
+ background: #9ca3af;
998
+ cursor: not-allowed;
999
+ }
1000
+
1001
+ .nice-upload-stats {
1002
+ display: flex;
1003
+ gap: 16px;
1004
+ padding: 12px 0;
1005
+ font-size: 13px;
1006
+ color: #6b7280;
1007
+ border-bottom: 1px solid #e5e7eb;
1008
+ margin-top: 16px;
1009
+ }
1010
+
1011
+ .nice-upload-stats .pending { color: #f59e0b; }
1012
+ .nice-upload-stats .uploading { color: #3b82f6; }
1013
+ .nice-upload-stats .success { color: #22c55e; }
1014
+ .nice-upload-stats .error { color: #ef4444; }
1015
+
1016
+ .nice-upload-actions {
1017
+ display: flex;
1018
+ gap: 8px;
1019
+ padding: 12px 0;
1020
+ }
1021
+
1022
+ .nice-upload-btn {
1023
+ padding: 6px 14px;
1024
+ border-radius: 6px;
1025
+ font-size: 13px;
1026
+ cursor: pointer;
1027
+ border: 1px solid transparent;
1028
+ transition: all 0.2s;
1029
+ }
1030
+
1031
+ .nice-upload-btn.primary {
1032
+ background: #3b82f6;
1033
+ color: white;
1034
+ }
1035
+
1036
+ .nice-upload-btn.primary:hover {
1037
+ background: #2563eb;
1038
+ }
1039
+
1040
+ .nice-upload-btn.secondary {
1041
+ background: white;
1042
+ border-color: #d1d5db;
1043
+ color: #374151;
1044
+ }
1045
+
1046
+ .nice-upload-btn.secondary:hover {
1047
+ background: #f3f4f6;
1048
+ }
1049
+
1050
+ .nice-upload-btn.danger {
1051
+ background: white;
1052
+ border-color: #fca5a5;
1053
+ color: #dc2626;
1054
+ }
1055
+
1056
+ .nice-upload-btn.danger:hover {
1057
+ background: #fef2f2;
1058
+ }
1059
+
1060
+ .nice-upload-btn.upload { background: #22c55e; color: white; border: none; }
1061
+ .nice-upload-btn.cancel { background: #f59e0b; color: white; border: none; }
1062
+ .nice-upload-btn.retry { background: #3b82f6; color: white; border: none; }
1063
+ .nice-upload-btn.remove { background: #ef4444; color: white; border: none; }
1064
+
1065
+ .nice-upload-list {
1066
+ margin-top: 12px;
1067
+ }
1068
+
1069
+ .nice-upload-list.grid {
1070
+ display: grid;
1071
+ grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
1072
+ gap: 16px;
1073
+ }
1074
+
1075
+ .nice-upload-item {
1076
+ display: flex;
1077
+ align-items: center;
1078
+ gap: 12px;
1079
+ padding: 12px;
1080
+ background: #f9fafb;
1081
+ border-radius: 8px;
1082
+ border: 1px solid #e5e7eb;
1083
+ margin-bottom: 8px;
1084
+ }
1085
+
1086
+ .nice-upload-item.error {
1087
+ border-color: #fca5a5;
1088
+ background: #fef2f2;
1089
+ }
1090
+
1091
+ .nice-upload-item.success {
1092
+ border-color: #86efac;
1093
+ background: #f0fdf4;
1094
+ }
1095
+
1096
+ .nice-upload-item.grid {
1097
+ flex-direction: column;
1098
+ text-align: center;
1099
+ padding: 16px;
1100
+ }
1101
+
1102
+ .nice-upload-item.compact {
1103
+ padding: 8px 12px;
1104
+ font-size: 13px;
1105
+ }
1106
+
1107
+ .nice-upload-preview {
1108
+ flex-shrink: 0;
1109
+ display: flex;
1110
+ align-items: center;
1111
+ justify-content: center;
1112
+ background: #e5e7eb;
1113
+ border-radius: 6px;
1114
+ overflow: hidden;
1115
+ position: relative;
1116
+ }
1117
+
1118
+ .nice-upload-preview-icon {
1119
+ background: #f3f4f6;
1120
+ }
1121
+
1122
+ .nice-upload-preview-overlay {
1123
+ position: absolute;
1124
+ font-size: 24px;
1125
+ }
1126
+
1127
+ .nice-upload-item-content {
1128
+ flex: 1;
1129
+ min-width: 0;
1130
+ }
1131
+
1132
+ .nice-upload-item-header {
1133
+ display: flex;
1134
+ align-items: center;
1135
+ gap: 8px;
1136
+ margin-bottom: 4px;
1137
+ }
1138
+
1139
+ .nice-upload-item-name {
1140
+ font-weight: 500;
1141
+ font-size: 14px;
1142
+ color: #111827;
1143
+ overflow: hidden;
1144
+ text-overflow: ellipsis;
1145
+ white-space: nowrap;
1146
+ }
1147
+
1148
+ .nice-upload-item-size {
1149
+ font-size: 12px;
1150
+ color: #6b7280;
1151
+ }
1152
+
1153
+ .nice-upload-item-error {
1154
+ font-size: 12px;
1155
+ color: #dc2626;
1156
+ margin-top: 4px;
1157
+ }
1158
+
1159
+ .nice-upload-item-link {
1160
+ font-size: 12px;
1161
+ color: #3b82f6;
1162
+ text-decoration: none;
1163
+ }
1164
+
1165
+ .nice-upload-item-link:hover {
1166
+ text-decoration: underline;
1167
+ }
1168
+
1169
+ .nice-upload-item-actions {
1170
+ display: flex;
1171
+ gap: 4px;
1172
+ }
1173
+
1174
+ .nice-upload-item-actions button {
1175
+ padding: 4px 8px;
1176
+ font-size: 12px;
1177
+ }
1178
+
1179
+ .nice-upload-item-remove {
1180
+ background: none;
1181
+ border: none;
1182
+ color: #9ca3af;
1183
+ cursor: pointer;
1184
+ padding: 4px;
1185
+ font-size: 14px;
1186
+ line-height: 1;
1187
+ }
1188
+
1189
+ .nice-upload-item-remove:hover {
1190
+ color: #ef4444;
1191
+ }
1192
+
1193
+ .nice-upload-badge {
1194
+ font-size: 11px;
1195
+ padding: 2px 8px;
1196
+ border-radius: 10px;
1197
+ font-weight: 500;
1198
+ }
1199
+
1200
+ .nice-upload-badge.pending { background: #fef3c7; color: #92400e; }
1201
+ .nice-upload-badge.uploading { background: #dbeafe; color: #1e40af; }
1202
+ .nice-upload-badge.success { background: #dcfce7; color: #166534; }
1203
+ .nice-upload-badge.error { background: #fee2e2; color: #991b1b; }
1204
+ .nice-upload-badge.cancelled { background: #f3f4f6; color: #4b5563; }
1205
+
1206
+ .nice-upload-progress {
1207
+ height: 6px;
1208
+ background: #e5e7eb;
1209
+ border-radius: 3px;
1210
+ overflow: hidden;
1211
+ margin-top: 6px;
1212
+ position: relative;
1213
+ }
1214
+
1215
+ .nice-upload-progress-bar {
1216
+ height: 100%;
1217
+ transition: width 0.2s ease;
1218
+ border-radius: 3px;
1219
+ }
1220
+
1221
+ .nice-upload-progress-text {
1222
+ position: absolute;
1223
+ right: 0;
1224
+ top: -18px;
1225
+ font-size: 11px;
1226
+ color: #6b7280;
1227
+ }
1228
+
1229
+ .nice-upload-item.compact .nice-upload-progress {
1230
+ flex: 1;
1231
+ margin: 0 8px;
1232
+ }
1233
+
1234
+ .nice-upload-item.compact .nice-upload-progress-text {
1235
+ position: static;
1236
+ }
1237
+
1238
+ .nice-upload-item-info {
1239
+ margin-top: 8px;
1240
+ }
1241
+
1242
+ .nice-upload-item.grid .nice-upload-item-name {
1243
+ font-size: 13px;
1244
+ max-width: 100%;
1245
+ }
1246
+
1247
+ @media (max-width: 640px) {
1248
+ .nice-upload-dropzone {
1249
+ padding: 24px 16px;
1250
+ }
1251
+
1252
+ .nice-upload-actions {
1253
+ flex-wrap: wrap;
1254
+ }
1255
+
1256
+ .nice-upload-list.grid {
1257
+ grid-template-columns: repeat(2, 1fr);
1258
+ }
1259
+ }
1260
+ `})]})})});Zi.displayName="NiceFileUpload";let ru=0;function oa(){return`blk-${++ru}-${Date.now().toString(36)}`}function La(e=""){return{id:oa(),type:"paragraph",content:e}}function ou(e,t=""){const a={id:oa(),type:e,content:t};return e==="heading"&&(a.level=2),e==="list"&&(a.listType="unordered"),e==="callout"&&(a.icon="ℹ️"),e==="toggle"&&(a.open=!0),a}const su=[{type:"paragraph",label:"Text",icon:"¶",keywords:"paragraph text"},{type:"heading",label:"Heading",icon:"H",keywords:"heading title"},{type:"list",label:"Bulleted list",icon:"•",keywords:"bullet unordered list"},{type:"list",label:"Numbered list",icon:"1.",keywords:"numbered ordered list"},{type:"list",label:"Checklist",icon:"☑",keywords:"check todo list"},{type:"quote",label:"Quote",icon:"❝",keywords:"quote blockquote"},{type:"callout",label:"Callout",icon:"ℹ️",keywords:"callout info alert"},{type:"toggle",label:"Toggle",icon:"▶",keywords:"toggle collapse expand"},{type:"code",label:"Code",icon:"</>",keywords:"code snippet"},{type:"image",label:"Image",icon:"🖼",keywords:"image photo picture"},{type:"video",label:"Video",icon:"🎬",keywords:"video embed"},{type:"table",label:"Table",icon:"⊞",keywords:"table grid"},{type:"divider",label:"Divider",icon:"─",keywords:"divider line separator"},{type:"pageBreak",label:"Page Break",icon:"⤓",keywords:"page break"}];function lu(e){const t=[e.align?`text-align:${e.align}`:"",e.color?`color:${e.color}`:"",e.bgColor?`background-color:${e.bgColor}`:"",e.indent?`margin-left:${e.indent*24}px`:""].filter(Boolean).join(";"),a=t?` style="${t}"`:"",i=(r,s)=>{let l=s;return e.bold&&(l=`<strong>${l}</strong>`),e.italic&&(l=`<em>${l}</em>`),e.underline&&(l=`<u>${l}</u>`),e.strikethrough&&(l=`<s>${l}</s>`),`<${r}${a}>${l}</${r}>`};switch(e.type){case"heading":return i(`h${e.level??2}`,e.content);case"paragraph":return i("p",e.content||"&nbsp;");case"list":{const r=e.listType==="ordered"?"ol":"ul",s=e.content.split(`
1261
+ `).map((l,c)=>{var d;return e.listType==="checklist"?`<li><input type="checkbox" ${((d=e.checked)==null?void 0:d[c])??!1?"checked":""} disabled />${l}</li>`:`<li>${l}</li>`}).join("");return`<${r}${a}>${s}</${r}>`}case"image":return`<figure${a}><img src="${e.src??""}" alt="${e.alt??""}" /></figure>`;case"video":return`<figure${a}><video src="${e.src??""}" controls></video></figure>`;case"divider":return"<hr />";case"pageBreak":return'<div style="page-break-after:always"></div>';case"code":return`<pre><code class="language-${e.language??""}">${e.content}</code></pre>`;case"quote":return i("blockquote",e.content);case"callout":return`<div class="nice-doc-callout"${a}><span>${e.icon??"ℹ️"}</span><div>${e.content}</div></div>`;case"toggle":return`<details${a}><summary>${e.content.split(`
1262
+ `)[0]}</summary>${e.content.split(`
1263
+ `).slice(1).join("<br>")}</details>`;case"table":return`<table${a}>${e.content}</table>`;case"embed":return`<iframe src="${e.src??""}" style="width:100%;border:none;min-height:300px"></iframe>`;default:return i("p",e.content)}}function cu(e){let t=0,a=0;for(const i of e){const r=i.content??"";t+=r.length;const s=r.trim().split(/\s+/).filter(Boolean);a+=s.length}return{words:a,chars:t,readingTime:Math.max(1,Math.ceil(a/200))}}const sa=o.forwardRef(({blocks:e,onChange:t,readOnly:a=!1,showToolbar:i=!0,size:r="md",editorSize:s="standard",placeholder:l,onExport:c,onImageUpload:d,maxUndo:u=50,slashCommands:g=!0,showWordCount:h=!1,showToc:p=!1,showFindReplace:m=!0,className:k,style:b,id:C,..._},f)=>{var xe,Ne,Fe,Ee,Re,ze,dt,Xe,Qe,nt,Ot,vt,Ht,pa,ma,ha;const v=ke(C),{t:j}=Se(),[S,I]=o.useState(()=>e??[La()]),M=e??S,[w,E]=o.useState(0),P=o.useRef(new Map),L=o.useRef(null),[A,N]=o.useState(!1),[x,O]=o.useState(""),[D,F]=o.useState(""),[y,$]=o.useState([]),[z,R]=o.useState(0),[T,B]=o.useState(!1),V=o.useRef([]),K=o.useRef([]),H=o.useCallback(U=>{V.current.push(U.map(ce=>({...ce,checked:ce.checked?[...ce.checked]:void 0}))),V.current.length>u&&V.current.shift(),K.current=[]},[u]),q=o.useCallback(()=>{if(V.current.length===0)return;const U=V.current.pop();K.current.push(M.map(ce=>({...ce}))),e||I(U),t==null||t(U)},[M,e,t]),Z=o.useCallback(()=>{if(K.current.length===0)return;const U=K.current.pop();V.current.push(M.map(ce=>({...ce}))),e||I(U),t==null||t(U)},[M,e,t]),[Q,J]=o.useState(!1),[ee,ie]=o.useState(""),[pe,te]=o.useState(0),ue=o.useMemo(()=>{if(!Q||!g)return[];const U=ee.toLowerCase();return su.filter(ce=>ce.label.toLowerCase().includes(U)||ce.keywords.includes(U))},[Q,ee,g]),[fe,ae]=o.useState(null),[he,Y]=o.useState(null),X=o.useCallback(U=>{H(M);const ce=U(M);e||I(ce),t==null||t(ce)},[M,e,t,H]),W=o.useCallback((U,ce)=>{X(de=>de.map((Me,Te)=>Te===U?{...Me,...ce}:Me))},[X]),G=o.useCallback((U,ce)=>{const de=ce??La();X(Me=>{const Te=[...Me];return Te.splice(U+1,0,de),Te}),E(U+1)},[X]),re=o.useCallback(U=>{const ce={...M[U],id:oa()};G(U,ce)},[M,G]),ne=o.useCallback(U=>{M.length<=1||(X(ce=>ce.filter((de,Me)=>Me!==U)),E(Math.max(0,U-1)))},[M.length,X]),se=o.useCallback((U,ce)=>{const de=U+ce;de<0||de>=M.length||(X(Me=>{const Te=[...Me];return[Te[U],Te[de]]=[Te[de],Te[U]],Te}),E(de))},[M.length,X]),oe=o.useCallback((U,ce)=>{const de={type:ce};ce==="heading"&&(de.level=2),ce==="list"&&(de.listType="unordered"),ce==="callout"&&(de.icon="ℹ️"),ce==="toggle"&&(de.open=!0),W(U,de)},[W]),ye=o.useCallback(U=>{var de,Me;const ce=ou(U.type);U.type==="list"&&U.label.includes("Numbered")&&(ce.listType="ordered"),U.type==="list"&&U.label.includes("Checklist")&&(ce.listType="checklist",ce.checked=[]),((de=M[w])==null?void 0:de.content)===""||((Me=M[w])==null?void 0:Me.content)==="/"?X(Te=>Te.map((at,wt)=>wt===w?{...ce,id:at.id}:at)):G(w,ce),J(!1),ie("")},[M,w,X,G]),ge=o.useCallback((U,ce)=>{if(a)return;const de=M[ce];if(!(de!=null&&de.locked)){if((U.ctrlKey||U.metaKey)&&U.key==="z"&&!U.shiftKey){U.preventDefault(),q();return}if((U.ctrlKey||U.metaKey)&&(U.key==="y"||U.key==="z"&&U.shiftKey)){U.preventDefault(),Z();return}if((U.ctrlKey||U.metaKey)&&U.key==="d"){U.preventDefault(),re(ce);return}if((U.ctrlKey||U.metaKey)&&U.key==="b"){U.preventDefault(),W(ce,{bold:!(de!=null&&de.bold)});return}if((U.ctrlKey||U.metaKey)&&U.key==="i"){U.preventDefault(),W(ce,{italic:!(de!=null&&de.italic)});return}if((U.ctrlKey||U.metaKey)&&U.key==="u"){U.preventDefault(),W(ce,{underline:!(de!=null&&de.underline)});return}if((U.ctrlKey||U.metaKey)&&U.key==="e"){U.preventDefault(),W(ce,{strikethrough:!(de!=null&&de.strikethrough)});return}if(U.key==="Tab"&&!U.shiftKey){U.preventDefault(),W(ce,{indent:Math.min(((de==null?void 0:de.indent)??0)+1,4)});return}if(U.key==="Tab"&&U.shiftKey){U.preventDefault(),W(ce,{indent:Math.max(((de==null?void 0:de.indent)??0)-1,0)});return}if((U.ctrlKey||U.metaKey)&&U.key==="f"&&m){U.preventDefault(),N(Me=>!Me);return}if(Q&&ue.length>0){if(U.key==="ArrowDown"){U.preventDefault(),te(Me=>Math.min(Me+1,ue.length-1));return}if(U.key==="ArrowUp"){U.preventDefault(),te(Me=>Math.max(Me-1,0));return}if(U.key==="Enter"){U.preventDefault(),ye(ue[pe]);return}if(U.key==="Escape"){J(!1);return}}U.key==="Enter"&&!U.shiftKey?(U.preventDefault(),G(ce)):U.key==="Backspace"&&M[ce].content===""&&M.length>1?(U.preventDefault(),ne(ce)):U.key==="ArrowUp"&&U.altKey?(U.preventDefault(),se(ce,-1)):U.key==="ArrowDown"&&U.altKey&&(U.preventDefault(),se(ce,1))}},[a,M,G,ne,se,q,Z,re,W,Q,ue,pe,ye,m]),we=o.useCallback((U,ce)=>{const de=U.target.textContent??"";g&&de.startsWith("/")?(J(!0),ie(de.slice(1)),te(0)):Q&&J(!1),H(M);const Me=M.map((Te,at)=>at===ce?{...Te,content:de}:Te);e||I(Me),t==null||t(Me)},[M,e,t,H,g,Q]),Ce=o.useCallback((U,ce)=>{ae(ce),U.dataTransfer.effectAllowed="move"},[]),_e=o.useCallback((U,ce)=>{U.preventDefault(),U.dataTransfer.dropEffect="move",Y(ce)},[]),Ie=o.useCallback((U,ce)=>{if(U.preventDefault(),fe===null||fe===ce){ae(null),Y(null);return}X(de=>{const Me=[...de],[Te]=Me.splice(fe,1);return Me.splice(ce>fe?ce-1:ce,0,Te),Me}),E(ce>fe?ce-1:ce),ae(null),Y(null)},[fe,X]);o.useEffect(()=>{if(!A||!x){$([]);return}const U=x.toLowerCase(),ce=[];M.forEach((de,Me)=>{const Te=(de.content??"").toLowerCase();let at=0;for(;at<Te.length;){const wt=Te.indexOf(U,at);if(wt===-1)break;ce.push({blockIdx:Me,start:wt,end:wt+U.length}),at=wt+1}}),$(ce),R(0)},[x,A,M]);const je=o.useCallback(()=>{if(y.length===0)return;const U=(z+1)%y.length;R(U),E(y[U].blockIdx)},[y,z]),He=o.useCallback(()=>{if(y.length===0)return;const U=(z-1+y.length)%y.length;R(U),E(y[U].blockIdx)},[y,z]),St=o.useCallback(()=>{if(y.length===0||!x)return;const U=y[z],ce=M[U.blockIdx],de=ce.content.slice(0,U.start),Me=ce.content.slice(U.end);W(U.blockIdx,{content:de+D+Me})},[y,z,x,D,M,W]),st=o.useCallback(()=>{if(!x)return;const U=x;X(ce=>ce.map(de=>({...de,content:de.content.split(U).join(D)})))},[x,D,X]),Ke=o.useMemo(()=>p?M.map((U,ce)=>U.type==="heading"?{idx:ce,level:U.level??2,text:U.content}:null).filter(Boolean):[],[M,p]),lt=o.useCallback(async U=>{var de;const ce=(de=U.target.files)==null?void 0:de[0];if(ce){if(d){const Me=await d(ce);W(w,{src:Me})}U.target.value=""}},[d,w,W]);o.useEffect(()=>{const U=M[w];if(U){const ce=P.current.get(U.id);ce&&ce.focus()}},[w,M]);const ct=o.useCallback(()=>{const U=M.map(lu).join(`
1264
+ `);c==null||c(U)},[M,c]),tt=o.useMemo(()=>h?cu(M):null,[M,h]),[Pe,We]=o.useState(null),le=o.useCallback((U,ce)=>{a||(U.preventDefault(),We({x:U.clientX,y:U.clientY,idx:ce}))},[a]);return o.useEffect(()=>{if(!Pe)return;const U=()=>We(null);return window.addEventListener("click",U),()=>window.removeEventListener("click",U)},[Pe]),n.jsxs("div",{ref:f,id:v,className:`nice-doc-editor nice-doc-editor--${r} nice-editor--${s} ${a?"nice-doc-editor--readonly":""} ${k??""}`,style:b,role:"application","aria-label":j("docEditor.label","Document Editor"),..._,children:[i&&!a&&n.jsxs("div",{className:"nice-doc-editor__toolbar",role:"toolbar",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center",padding:"4px 8px"},children:[n.jsx(ve,{size:"sm",variant:"ghost",onClick:q,title:j("docEditor.undo","Undo (Ctrl+Z)"),children:"↩"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:Z,title:j("docEditor.redo","Redo (Ctrl+Y)"),children:"↪"}),n.jsx("span",{className:"nice-doc-editor__sep"}),n.jsx(gt,{size:"sm",value:((xe=M[w])==null?void 0:xe.type)??"paragraph",onChange:U=>oe(w,U),label:"",options:[{value:"paragraph",label:j("docEditor.paragraph","Paragraph")},{value:"heading",label:j("docEditor.heading","Heading")},{value:"list",label:j("docEditor.list","List")},{value:"code",label:j("docEditor.code","Code")},{value:"quote",label:j("docEditor.quote","Quote")},{value:"callout",label:j("docEditor.callout","Callout")},{value:"toggle",label:j("docEditor.toggle","Toggle")},{value:"divider",label:j("docEditor.divider","Divider")},{value:"image",label:j("docEditor.image","Image")},{value:"video",label:j("docEditor.video","Video")},{value:"pageBreak",label:j("docEditor.pageBreak","Page Break")}],style:{minWidth:100}}),((Ne=M[w])==null?void 0:Ne.type)==="heading"&&n.jsx(gt,{size:"sm",value:String(((Fe=M[w])==null?void 0:Fe.level)??2),onChange:U=>W(w,{level:Number(U)}),label:"",options:[{value:"1",label:"H1"},{value:"2",label:"H2"},{value:"3",label:"H3"},{value:"4",label:"H4"},{value:"5",label:"H5"},{value:"6",label:"H6"}],style:{minWidth:55}}),((Ee=M[w])==null?void 0:Ee.type)==="list"&&n.jsx(gt,{size:"sm",value:((Re=M[w])==null?void 0:Re.listType)??"unordered",onChange:U=>W(w,{listType:U}),label:"",options:[{value:"unordered",label:"• Bullets"},{value:"ordered",label:"1. Numbers"},{value:"checklist",label:"☑ Checklist"}],style:{minWidth:90}}),n.jsx("span",{className:"nice-doc-editor__sep"}),n.jsx(ve,{size:"sm",variant:(ze=M[w])!=null&&ze.bold?"primary":"ghost",onClick:()=>{var U;return W(w,{bold:!((U=M[w])!=null&&U.bold)})},title:j("docEditor.bold","Bold (Ctrl+B)"),children:n.jsx("strong",{children:"B"})}),n.jsx(ve,{size:"sm",variant:(dt=M[w])!=null&&dt.italic?"primary":"ghost",onClick:()=>{var U;return W(w,{italic:!((U=M[w])!=null&&U.italic)})},title:j("docEditor.italic","Italic (Ctrl+I)"),children:n.jsx("em",{children:"I"})}),n.jsx(ve,{size:"sm",variant:(Xe=M[w])!=null&&Xe.underline?"primary":"ghost",onClick:()=>{var U;return W(w,{underline:!((U=M[w])!=null&&U.underline)})},title:j("docEditor.underline","Underline (Ctrl+U)"),children:n.jsx("u",{children:"U"})}),n.jsx(ve,{size:"sm",variant:(Qe=M[w])!=null&&Qe.strikethrough?"primary":"ghost",onClick:()=>{var U;return W(w,{strikethrough:!((U=M[w])!=null&&U.strikethrough)})},title:j("docEditor.strikethrough","Strikethrough (Ctrl+E)"),children:n.jsx("s",{children:"S"})}),n.jsx("span",{className:"nice-doc-editor__sep"}),n.jsx(ve,{size:"sm",variant:((nt=M[w])==null?void 0:nt.align)==="left"?"primary":"ghost",onClick:()=>W(w,{align:"left"}),title:j("docEditor.alignLeft","Left"),children:"⬅"}),n.jsx(ve,{size:"sm",variant:((Ot=M[w])==null?void 0:Ot.align)==="center"?"primary":"ghost",onClick:()=>W(w,{align:"center"}),title:j("docEditor.alignCenter","Center"),children:"⬌"}),n.jsx(ve,{size:"sm",variant:((vt=M[w])==null?void 0:vt.align)==="right"?"primary":"ghost",onClick:()=>W(w,{align:"right"}),title:j("docEditor.alignRight","Right"),children:"➡"}),n.jsx("span",{className:"nice-doc-editor__sep"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>{var U;return W(w,{indent:Math.min((((U=M[w])==null?void 0:U.indent)??0)+1,4)})},title:j("docEditor.indent","Indent (Tab)"),children:"→⊞"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>{var U;return W(w,{indent:Math.max((((U=M[w])==null?void 0:U.indent)??0)-1,0)})},title:j("docEditor.outdent","Outdent (Shift+Tab)"),children:"←⊞"}),n.jsx("span",{className:"nice-doc-editor__sep"}),n.jsx(bt,{size:"sm",label:"",value:((Ht=M[w])==null?void 0:Ht.color)??"#000000",onChange:U=>W(w,{color:U}),title:"Text color"}),n.jsx(bt,{size:"sm",label:"",value:((pa=M[w])==null?void 0:pa.bgColor)??"#ffffff",onChange:U=>W(w,{bgColor:U}),title:"Block background"}),n.jsx("span",{className:"nice-doc-editor__sep"}),n.jsx(ve,{size:"sm",variant:(ma=M[w])!=null&&ma.locked?"primary":"ghost",onClick:()=>{var U;return W(w,{locked:!((U=M[w])!=null&&U.locked)})},title:j("docEditor.lock","Lock/Unlock block"),children:"🔒"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>re(w),title:j("docEditor.duplicate","Duplicate (Ctrl+D)"),children:"⧉"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>ne(w),title:j("docEditor.delete","Delete block"),children:"🗑"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>G(w),title:j("docEditor.addBlock","Add block"),children:"+"}),m&&n.jsx(ve,{size:"sm",variant:A?"primary":"ghost",onClick:()=>N(U=>!U),title:j("docEditor.find","Find & Replace (Ctrl+F)"),children:"🔍"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>B(U=>!U),title:j("docEditor.shortcuts","Keyboard shortcuts"),children:"⌨"}),c&&n.jsx(ve,{size:"sm",variant:"ghost",onClick:ct,children:j("docEditor.export","Export HTML")})]}),n.jsx("input",{ref:L,type:"file",accept:"image/*,video/*",style:{display:"none"},onChange:lt}),A&&n.jsxs("div",{className:"nice-doc-editor__find-bar",style:{display:"flex",gap:4,alignItems:"center",padding:"4px 8px",background:"var(--nice-doc-find-bg, #f8f9fa)",borderBottom:"1px solid #ddd"},children:[n.jsx(ht,{size:"sm",placeholder:j("docEditor.findPlaceholder","Find..."),value:x,onChange:O,style:{flex:1,maxWidth:200}}),n.jsx(ht,{size:"sm",placeholder:j("docEditor.replacePlaceholder","Replace..."),value:D,onChange:F,style:{flex:1,maxWidth:200}}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:He,title:j("docEditor.findPrev","Previous"),children:"◀"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:je,title:j("docEditor.findNext","Next"),children:"▶"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:St,title:j("docEditor.replaceOne","Replace"),disabled:a,children:j("docEditor.replace","Replace")}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:st,title:j("docEditor.replaceAll","Replace all"),disabled:a,children:j("docEditor.replaceAllBtn","All")}),n.jsx("span",{style:{fontSize:"0.75em",color:"#666"},children:y.length>0?`${z+1}/${y.length}`:"0/0"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>N(!1),children:"✕"})]}),T&&n.jsx("div",{className:"nice-doc-editor__shortcuts-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>B(!1),children:n.jsxs("div",{style:{background:"#fff",borderRadius:8,padding:24,maxWidth:420,width:"90%",boxShadow:"0 8px 32px rgba(0,0,0,.2)"},onClick:U=>U.stopPropagation(),children:[n.jsx("h3",{style:{margin:"0 0 12px"},children:j("docEditor.shortcutsTitle","Keyboard Shortcuts")}),n.jsx("table",{style:{width:"100%",fontSize:"0.875em",borderCollapse:"collapse"},children:n.jsx("tbody",{children:[["Ctrl+B",j("docEditor.bold","Bold")],["Ctrl+I",j("docEditor.italic","Italic")],["Ctrl+U",j("docEditor.underline","Underline")],["Ctrl+E",j("docEditor.strikethrough","Strikethrough")],["Ctrl+D",j("docEditor.duplicate","Duplicate block")],["Ctrl+Z",j("docEditor.undo","Undo")],["Ctrl+Y",j("docEditor.redo","Redo")],["Ctrl+F",j("docEditor.find","Find & Replace")],["Enter",j("docEditor.newBlock","New block")],["Backspace",j("docEditor.deleteEmpty","Delete empty block")],["Alt+↑",j("docEditor.moveUp","Move block up")],["Alt+↓",j("docEditor.moveDown","Move block down")],["Tab",j("docEditor.indent","Indent")],["Shift+Tab",j("docEditor.outdent","Outdent")],["/",j("docEditor.slashCmd","Slash commands")]].map(([U,ce])=>n.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[n.jsx("td",{style:{padding:"4px 8px",fontFamily:"monospace",fontWeight:600},children:U}),n.jsx("td",{style:{padding:"4px 8px"},children:ce})]},U))})}),n.jsx("div",{style:{textAlign:"right",marginTop:12},children:n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>B(!1),children:j("docEditor.close","Close")})})]})}),n.jsxs("div",{style:{display:"flex",gap:0},children:[p&&Ke.length>0&&n.jsxs("nav",{className:"nice-doc-editor__toc",style:{width:200,minWidth:160,borderRight:"1px solid #eee",padding:"8px 4px",fontSize:"0.8em",overflowY:"auto",maxHeight:500},children:[n.jsx("div",{style:{fontWeight:600,padding:"4px 8px",fontSize:"0.75em",textTransform:"uppercase",color:"#999"},children:j("docEditor.toc","Contents")}),Ke.map(U=>n.jsx("div",{style:{padding:"3px 8px",paddingLeft:8+(U.level-1)*12,cursor:"pointer",borderRadius:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",background:U.idx===w?"#e8f0fe":void 0},onClick:()=>E(U.idx),title:U.text,children:U.text||j("docEditor.untitled","Untitled")},U.idx))]}),n.jsx("div",{className:"nice-doc-editor__body",style:{flex:1},children:M.map((U,ce)=>n.jsxs("div",{className:`nice-doc-editor__block nice-doc-editor__block--${U.type} ${ce===w?"nice-doc-editor__block--focused":""} ${he===ce?"nice-doc-editor__block--drop-target":""} ${U.locked?"nice-doc-editor__block--locked":""}`,onClick:()=>E(ce),onContextMenu:de=>le(de,ce),draggable:!a&&!U.locked,onDragStart:de=>Ce(de,ce),onDragOver:de=>_e(de,ce),onDrop:de=>Ie(de,ce),onDragEnd:()=>{ae(null),Y(null)},style:{opacity:fe===ce?.4:1,marginLeft:(U.indent??0)*24},children:[!a&&!U.locked&&n.jsx("div",{className:"nice-doc-editor__block-handle",title:j("docEditor.drag","Drag to reorder"),children:"⠿"}),U.locked&&n.jsx("span",{className:"nice-doc-editor__lock-icon",style:{position:"absolute",top:2,right:4,fontSize:"0.7em",opacity:.5},children:"🔒"}),U.type==="divider"?n.jsx("hr",{className:"nice-doc-editor__divider"}):U.type==="pageBreak"?n.jsxs("div",{className:"nice-doc-editor__page-break",style:{borderTop:"2px dashed #ccc",textAlign:"center",padding:4,fontSize:"0.75em",color:"#999"},children:["— ",j("docEditor.pageBreak","Page Break")," —"]}):U.type==="image"||U.type==="video"?n.jsx("div",{className:"nice-doc-editor__media-block",children:U.src?U.type==="image"?n.jsx("img",{src:U.src,alt:U.alt??"",className:"nice-doc-editor__image",style:{maxWidth:"100%"}}):n.jsx("video",{src:U.src,controls:!0,className:"nice-doc-editor__video",style:{maxWidth:"100%"}}):!a&&n.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[n.jsx(ht,{size:"sm",placeholder:j("docEditor.mediaUrl",U.type==="image"?"Image URL":"Video URL"),value:U.src??"",onChange:de=>W(ce,{src:de})}),d&&n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>{var de;E(ce),(de=L.current)==null||de.click()},children:"📎"})]})}):U.type==="callout"?n.jsxs("div",{className:"nice-doc-editor__callout",style:{display:"flex",gap:8,padding:"8px 12px",background:U.bgColor??"#f0f7ff",borderRadius:4,color:U.color},children:[n.jsx("span",{style:{fontSize:"1.2em"},children:U.icon??"ℹ️"}),n.jsx("div",{ref:de=>{de&&P.current.set(U.id,de)},className:"nice-doc-editor__content",contentEditable:!a&&!U.locked,suppressContentEditableWarning:!0,onInput:de=>we(de,ce),onFocus:()=>E(ce),onKeyDown:de=>ge(de,ce),"data-placeholder":j("docEditor.calloutPlaceholder","Callout text..."),role:"textbox","aria-multiline":"true",style:{flex:1,outline:"none"},children:U.content})]}):U.type==="toggle"?n.jsxs("details",{open:U.open,className:"nice-doc-editor__toggle",onToggle:de=>W(ce,{open:de.target.open}),children:[n.jsx("summary",{style:{cursor:"pointer",fontWeight:500},children:U.content.split(`
1265
+ `)[0]||j("docEditor.toggleTitle","Toggle")}),n.jsx("div",{ref:de=>{de&&P.current.set(U.id,de)},className:"nice-doc-editor__content",contentEditable:!a&&!U.locked,suppressContentEditableWarning:!0,onInput:de=>we(de,ce),onFocus:()=>E(ce),onKeyDown:de=>ge(de,ce),role:"textbox","aria-multiline":"true",style:{padding:"4px 0"},children:U.content.split(`
1266
+ `).slice(1).join(`
1267
+ `)})]}):U.type==="code"?n.jsxs("div",{className:"nice-doc-editor__code-block",style:{position:"relative"},children:[!a&&n.jsx(ht,{size:"sm",value:U.language??"",onChange:de=>W(ce,{language:de}),placeholder:"Language",style:{position:"absolute",top:4,right:4,width:80,opacity:.7}}),n.jsx("pre",{ref:de=>{de&&P.current.set(U.id,de)},className:"nice-doc-editor__content",contentEditable:!a&&!U.locked,suppressContentEditableWarning:!0,onInput:de=>we(de,ce),onFocus:()=>E(ce),onKeyDown:de=>ge(de,ce),role:"textbox","aria-multiline":"true",style:{fontFamily:"monospace",background:"#1e1e1e",color:"#d4d4d4",padding:12,borderRadius:4,overflow:"auto"},children:U.content})]}):n.jsxs("div",{style:{position:"relative"},children:[n.jsx("div",{ref:de=>{de&&P.current.set(U.id,de)},className:"nice-doc-editor__content",contentEditable:!a&&!U.locked,suppressContentEditableWarning:!0,style:{textAlign:U.align,fontWeight:U.bold?"bold":void 0,fontStyle:U.italic?"italic":void 0,textDecoration:[U.underline?"underline":"",U.strikethrough?"line-through":""].filter(Boolean).join(" ")||void 0,color:U.color,backgroundColor:U.bgColor},onInput:de=>we(de,ce),onFocus:()=>E(ce),onKeyDown:de=>ge(de,ce),"data-placeholder":!U.content&&l?l:void 0,role:"textbox","aria-multiline":"true",children:U.content}),Q&&ce===w&&ue.length>0&&n.jsx("ul",{className:"nice-doc-editor__slash-menu",style:{position:"absolute",left:0,top:"100%",zIndex:100,background:"#fff",border:"1px solid #ddd",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,.12)",listStyle:"none",margin:0,padding:4,minWidth:180,maxHeight:240,overflow:"auto"},children:ue.map((de,Me)=>n.jsxs("li",{className:Me===pe?"nice-doc-editor__slash-item--active":"",style:{padding:"6px 10px",cursor:"pointer",borderRadius:4,display:"flex",gap:8,alignItems:"center",background:Me===pe?"#e8f0fe":void 0},onMouseDown:Te=>{Te.preventDefault(),ye(de)},onMouseEnter:()=>te(Me),children:[n.jsx("span",{style:{width:24,textAlign:"center"},children:de.icon}),n.jsx("span",{children:de.label})]},`${de.type}-${de.label}`))})]})]},U.id))})]}),Pe&&n.jsxs("div",{className:"nice-doc-editor__ctx-menu",style:{position:"fixed",left:Pe.x,top:Pe.y,zIndex:1e3,background:"#fff",border:"1px solid #ddd",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,.12)",padding:4,minWidth:160},children:[n.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{re(Pe.idx),We(null)},children:"⧉ Duplicate"}),n.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{G(Pe.idx),We(null)},children:"+ Insert below"}),n.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{se(Pe.idx,-1),We(null)},children:"↑ Move up"}),n.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{se(Pe.idx,1),We(null)},children:"↓ Move down"}),n.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{var U;W(Pe.idx,{locked:!((U=M[Pe.idx])!=null&&U.locked)}),We(null)},children:(ha=M[Pe.idx])!=null&&ha.locked?"🔓 Unlock":"🔒 Lock"}),n.jsx("hr",{style:{margin:"2px 0",border:"none",borderTop:"1px solid #eee"}}),n.jsx("div",{style:{padding:"6px 12px",cursor:"pointer",color:"#d32f2f"},onClick:()=>{ne(Pe.idx),We(null)},children:"🗑 Delete"})]}),h&&tt&&n.jsxs("div",{className:"nice-doc-editor__footer",style:{padding:"4px 12px",fontSize:"0.75em",color:"#666",borderTop:"1px solid #eee",display:"flex",gap:16},children:[n.jsxs("span",{children:[tt.words," ",j("docEditor.words","words")]}),n.jsxs("span",{children:[tt.chars," ",j("docEditor.chars","characters")]}),n.jsxs("span",{children:[M.length," ",j("docEditor.blocks","blocks")]}),n.jsxs("span",{children:["~",tt.readingTime," ",j("docEditor.readingTime","min read")]})]})]})});sa.displayName="NiceDocumentEditor";const du=["street","streetNumber","apartment","city","postalCode","state","country"],Kt={street:"Street",streetNumber:"Number",apartment:"Apt/Suite",city:"City",postalCode:"Postal Code",state:"State/Province",country:"Country"},Gi=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,value:p={},onChange:m,fields:k=du,placeholders:b={},countries:C,layout:_="vertical",countryFirst:f=!1,validatePostalCode:v},j)=>{const S=$e(h,d);if(S==="hidden")return null;S==="disabled"&&(r=!0),S==="readOnly"&&(s=!0);const{t:I}=Se(),M=ke(d),w=o.useCallback((A,N)=>{m==null||m({...p,[A]:N})},[p,m]),E=o.useMemo(()=>{if(v&&p.postalCode)return v(p.postalCode,p.country)},[v,p.postalCode,p.country]),P=o.useMemo(()=>f&&k.includes("country")?["country",...k.filter(A=>A!=="country")]:k,[k,f]),L=`nice-address nice-address--${_} nice-size-${l}`;return n.jsxs("div",{ref:j,id:M,className:`${L}${u?` ${u}`:""}${a?" nice-error":""}${r?" nice-disabled":""}`,style:g,role:"group","aria-label":e??I("address","Address"),children:[e&&n.jsxs("label",{className:"nice-address__label",children:[e,i&&n.jsx("span",{className:"nice-required",children:"*"})]}),n.jsx("div",{className:"nice-address__fields",children:P.map(A=>A==="country"&&C?n.jsxs("div",{className:`nice-address__field nice-address__field--${A}`,children:[n.jsx("label",{className:"nice-address__field-label",children:I(A,Kt[A])}),n.jsxs("select",{className:"nice-input nice-select",value:p.country??"",onChange:N=>w("country",N.target.value),disabled:r,"aria-label":I(A,Kt[A]),children:[n.jsx("option",{value:"",children:b.country??I("selectCountry","— Select country —")}),C.map(N=>n.jsx("option",{value:N.code,children:N.name},N.code))]})]},A):n.jsxs("div",{className:`nice-address__field nice-address__field--${A}`,children:[n.jsx("label",{className:"nice-address__field-label",children:I(A,Kt[A])}),n.jsx("input",{className:`nice-input${A==="postalCode"&&E?" nice-input--error":""}`,type:"text",name:c?`${c}.${A}`:A,value:p[A]??"",onChange:N=>w(A,N.target.value),placeholder:b[A]??"",disabled:r,readOnly:s,"aria-label":I(A,Kt[A])}),A==="postalCode"&&E&&n.jsx("span",{className:"nice-error-text",children:E})]},A))}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),a&&typeof a=="string"&&n.jsx("span",{className:"nice-error-text",children:a})]})});Gi.displayName="NiceAddressInput";const uu=[{code:"PL",dialCode:"+48",name:"Poland",mask:"### ### ###"},{code:"US",dialCode:"+1",name:"United States",mask:"(###) ###-####"},{code:"GB",dialCode:"+44",name:"United Kingdom",mask:"#### ######"},{code:"DE",dialCode:"+49",name:"Germany",mask:"### ########"},{code:"FR",dialCode:"+33",name:"France",mask:"# ## ## ## ##"},{code:"CZ",dialCode:"+420",name:"Czech Republic",mask:"### ### ###"},{code:"SK",dialCode:"+421",name:"Slovakia",mask:"### ### ###"}],Oa=127397;function pu(e){return String.fromCodePoint(e.charCodeAt(0)+Oa,e.charCodeAt(1)+Oa)}function mu(e,t){if(!t)return e;const a=e.replace(/\D/g,"");let i="",r=0;for(let s=0;s<t.length&&r<a.length;s++)t[s]==="#"?i+=a[r++]:i+=t[s];return i}function gn(e,t){return`${e}${t.replace(/\D/g,"")}`}const Xi=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,value:p={},onChange:m,onBlur:k,countryCodes:b=uu,defaultCountry:C="PL",placeholder:_,showFlag:f=!0,validateE164:v=!1},j)=>{var D;const S=$e(h,d);if(S==="hidden")return null;S==="disabled"&&(r=!0),S==="readOnly"&&(s=!0);const{t:I}=Se(),M=ke(d),w=o.useMemo(()=>{const F=p.countryCode??C;return b.find(y=>y.code===F)??b[0]},[p.countryCode,C,b]),[E,P]=o.useState(),L=o.useMemo(()=>mu(p.number??"",w==null?void 0:w.mask),[p.number,w]),A=o.useCallback(F=>{const y=b.find(z=>z.code===F);if(!y)return;const $=p.number??"";m==null||m({countryCode:y.code,dialCode:y.dialCode,number:$,e164:gn(y.dialCode,$)})},[b,p.number,m]),N=o.useCallback(F=>{const y=F.replace(/\D/g,""),$=w;m==null||m({countryCode:$==null?void 0:$.code,dialCode:$==null?void 0:$.dialCode,number:y,e164:$?gn($.dialCode,y):y}),P(void 0)},[w,m]),x=o.useCallback(F=>{if(v&&p.number){const y=gn((w==null?void 0:w.dialCode)??"",p.number);/^\+\d{7,15}$/.test(y)||P(I("invalidPhone","Invalid phone number"))}k==null||k(F)},[v,p.number,w,k,I]),O=a||E;return n.jsxs("div",{ref:j,id:M,className:`nice-phone nice-size-${l}${u?` ${u}`:""}${O?" nice-error":""}${r?" nice-disabled":""}`,style:g,children:[e&&n.jsxs("label",{className:"nice-phone__label",children:[e,i&&n.jsx("span",{className:"nice-required",children:"*"})]}),n.jsxs("div",{className:"nice-phone__row",children:[n.jsx("select",{className:"nice-phone__country nice-select",value:w==null?void 0:w.code,onChange:F=>A(F.target.value),disabled:r,"aria-label":I("countryCode","Country code"),children:b.map(F=>n.jsxs("option",{value:F.code,children:[f?`${pu(F.code)} `:"",F.dialCode," ",F.name]},F.code))}),n.jsx("input",{className:"nice-input nice-phone__number",type:"tel",name:c,value:L,onChange:F=>N(F.target.value),onBlur:x,placeholder:_??((D=w==null?void 0:w.mask)==null?void 0:D.replace(/#/g,"_"))??"",disabled:r,readOnly:s,"aria-label":I("phoneNumber","Phone number")})]}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),O&&typeof O=="string"&&n.jsx("span",{className:"nice-error-text",children:O})]})});Xi.displayName="NicePhoneInput";const hu=[{code:"PLN",symbol:"zł",name:"Polish Zloty"},{code:"EUR",symbol:"€",name:"Euro"},{code:"USD",symbol:"$",name:"US Dollar"},{code:"GBP",symbol:"£",name:"British Pound"},{code:"CZK",symbol:"Kč",name:"Czech Koruna"},{code:"CHF",symbol:"Fr",name:"Swiss Franc"}],Qi=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,value:p,onChange:m,onBlur:k,currency:b="PLN",onCurrencyChange:C,currencies:_=hu,useMinorUnit:f=!1,min:v,max:j,locale:S,placeholder:I,showCurrencySelector:M},w)=>{const E=$e(h,d);if(E==="hidden")return null;E==="disabled"&&(r=!0),E==="readOnly"&&(s=!0);const{t:P}=Se(),L=ke(d),A=o.useMemo(()=>_.find(y=>y.code===b)??_[0],[b,_]),N=(A==null?void 0:A.decimals)??2,x=o.useMemo(()=>p==null?"":(f?p/Math.pow(10,N):p).toFixed(N),[p,f,N]),O=o.useCallback(y=>{const $=y.replace(/[^\d.,\-]/g,"").replace(",",".");if($===""||$==="-"){m==null||m(null);return}const z=parseFloat($);if(isNaN(z))return;const R=f?Math.round(z*Math.pow(10,N)):z;v!=null&&R<v||j!=null&&R>j||(m==null||m(R))},[m,f,N,v,j]),D=M??_.length>1,F=o.useMemo(()=>{if(p==null)return"";const y=f?p/Math.pow(10,N):p;try{return new Intl.NumberFormat(S,{style:"currency",currency:(A==null?void 0:A.code)??"USD",minimumFractionDigits:N}).format(y)}catch{return`${y.toFixed(N)} ${A==null?void 0:A.code}`}},[p,f,N,S,A]);return n.jsxs("div",{ref:w,id:L,className:`nice-currency nice-size-${l}${u?` ${u}`:""}${a?" nice-error":""}${r?" nice-disabled":""}`,style:g,children:[e&&n.jsxs("label",{className:"nice-currency__label",children:[e,i&&n.jsx("span",{className:"nice-required",children:"*"})]}),n.jsxs("div",{className:"nice-currency__row",children:[D&&n.jsx("select",{className:"nice-currency__select nice-select",value:b,onChange:y=>C==null?void 0:C(y.target.value),disabled:r,"aria-label":P("currency","Currency"),children:_.map(y=>n.jsxs("option",{value:y.code,children:[y.symbol," ",y.code]},y.code))}),!D&&n.jsx("span",{className:"nice-currency__symbol",children:A==null?void 0:A.symbol}),n.jsx("input",{className:"nice-input nice-currency__amount",type:"text",inputMode:"decimal",name:c,value:x,onChange:y=>O(y.target.value),onBlur:k,placeholder:I??`0.${"0".repeat(N)}`,disabled:r,readOnly:s,"aria-label":P("amount","Amount")})]}),F&&p!=null&&n.jsx("span",{className:"nice-currency__formatted",children:F}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),a&&typeof a=="string"&&n.jsx("span",{className:"nice-error-text",children:a})]})});Qi.displayName="NiceCurrencyInput";let fu=1;function gu(e){return{id:`new-${fu++}`,description:"",quantity:1,unitPrice:0,vatRate:e,discount:0,unit:"szt."}}function Ji(e){const t=e.quantity*e.unitPrice*(1-(e.discount??0)/100),a=Math.round(t*100)/100,i=Math.round(a*(e.vatRate??0)/100*100)/100;return{...e,netAmount:a,grossAmount:a+i}}function yu(e){const t=e.map(Ji),a=t.reduce((c,d)=>c+(d.netAmount??0),0),i=t.reduce((c,d)=>c+(d.grossAmount??0),0),r=i-a,s=new Map;for(const c of t){const d=c.vatRate??0,u=s.get(d)??{base:0,amount:0};u.base+=c.netAmount??0,u.amount+=(c.grossAmount??0)-(c.netAmount??0),s.set(d,u)}const l=Array.from(s.entries()).map(([c,d])=>({rate:c,base:Math.round(d.base*100)/100,amount:Math.round(d.amount*100)/100}));return{totalNet:Math.round(a*100)/100,totalVat:Math.round(r*100)/100,totalGross:Math.round(i*100)/100,vatBreakdown:l}}const er=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,value:p=[],onChange:m,onTotalsChange:k,currencySymbol:b="zł",defaultVatRate:C=23,vatRates:_=[0,5,8,23],units:f=["szt.","h","kg","m","usł."],showDiscount:v=!0,showUnit:j=!0,showTotals:S=!0,editable:I=!0,maxLines:M},w)=>{const E=$e(h,d);if(E==="hidden")return null;E==="disabled"&&(r=!0),E==="readOnly"&&(s=!0);const{t:P}=Se(),L=ke(d),A=o.useMemo(()=>p.map(Ji),[p]),N=o.useMemo(()=>yu(p),[p]);o.useEffect(()=>{k==null||k(N)},[N,k]);const x=o.useCallback((y,$,z)=>{const R=[...p];R[y]={...R[y],[$]:z},m==null||m(R)},[p,m]),O=o.useCallback(()=>{M&&p.length>=M||(m==null||m([...p,gu(C)]))},[p,m,C,M]),D=o.useCallback(y=>{m==null||m(p.filter(($,z)=>z!==y))},[p,m]),F=y=>`${y.toFixed(2)} ${b}`;return n.jsxs("div",{ref:w,id:L,className:`nice-invoice-lines nice-size-${l}${u?` ${u}`:""}${a?" nice-error":""}${r?" nice-disabled":""}`,style:g,children:[e&&n.jsxs("label",{className:"nice-invoice-lines__label",children:[e,i&&n.jsx("span",{className:"nice-required",children:"*"})]}),n.jsxs("table",{className:"nice-invoice-lines__table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"nice-il__th-num",children:"#"}),n.jsx("th",{className:"nice-il__th-desc",children:P("description","Description")}),n.jsx("th",{className:"nice-il__th-qty",children:P("qty","Qty")}),j&&n.jsx("th",{className:"nice-il__th-unit",children:P("unit","Unit")}),n.jsx("th",{className:"nice-il__th-price",children:P("unitPrice","Unit Price")}),v&&n.jsx("th",{className:"nice-il__th-disc",children:P("discount","Disc %")}),n.jsx("th",{className:"nice-il__th-vat",children:P("vat","VAT %")}),n.jsx("th",{className:"nice-il__th-net",children:P("net","Net")}),n.jsx("th",{className:"nice-il__th-gross",children:P("gross","Gross")}),I&&!s&&n.jsx("th",{className:"nice-il__th-actions"})]})}),n.jsx("tbody",{children:A.map((y,$)=>n.jsxs("tr",{children:[n.jsx("td",{className:"nice-il__cell-num",children:$+1}),n.jsx("td",{className:"nice-il__cell-desc",children:n.jsx("input",{className:"nice-input",type:"text",value:y.description,onChange:z=>x($,"description",z.target.value),disabled:r,readOnly:s,placeholder:P("itemDescription","Item description")})}),n.jsx("td",{className:"nice-il__cell-qty",children:n.jsx("input",{className:"nice-input",type:"number",value:y.quantity,onChange:z=>x($,"quantity",parseFloat(z.target.value)||0),disabled:r,readOnly:s,min:0,step:"any"})}),j&&n.jsx("td",{className:"nice-il__cell-unit",children:n.jsx("select",{className:"nice-select",value:y.unit??"",onChange:z=>x($,"unit",z.target.value),disabled:r,children:f.map(z=>n.jsx("option",{value:z,children:z},z))})}),n.jsx("td",{className:"nice-il__cell-price",children:n.jsx("input",{className:"nice-input",type:"number",value:y.unitPrice,onChange:z=>x($,"unitPrice",parseFloat(z.target.value)||0),disabled:r,readOnly:s,min:0,step:"0.01"})}),v&&n.jsx("td",{className:"nice-il__cell-disc",children:n.jsx("input",{className:"nice-input",type:"number",value:y.discount??0,onChange:z=>x($,"discount",parseFloat(z.target.value)||0),disabled:r,readOnly:s,min:0,max:100})}),n.jsx("td",{className:"nice-il__cell-vat",children:n.jsx("select",{className:"nice-select",value:y.vatRate??0,onChange:z=>x($,"vatRate",parseInt(z.target.value,10)),disabled:r,children:_.map(z=>n.jsxs("option",{value:z,children:[z,"%"]},z))})}),n.jsx("td",{className:"nice-il__cell-net",children:F(y.netAmount??0)}),n.jsx("td",{className:"nice-il__cell-gross",children:F(y.grossAmount??0)}),I&&!s&&n.jsx("td",{className:"nice-il__cell-actions",children:n.jsx("button",{type:"button",className:"nice-btn nice-btn--icon nice-btn--sm",onClick:()=>D($),disabled:r,title:P("remove","Remove"),children:"✕"})})]},y.id))})]}),I&&!s&&n.jsxs("button",{type:"button",className:"nice-btn nice-btn--outlined nice-btn--sm nice-invoice-lines__add",onClick:O,disabled:r||M!=null&&p.length>=M,children:["+ ",P("addLine","Add line")]}),S&&n.jsxs("div",{className:"nice-invoice-lines__totals",children:[n.jsxs("div",{className:"nice-il__total-row",children:[n.jsxs("span",{children:[P("totalNet","Net total"),":"]}),n.jsx("span",{className:"nice-il__total-value",children:F(N.totalNet)})]}),N.vatBreakdown.map(y=>n.jsxs("div",{className:"nice-il__total-row nice-il__total-row--vat",children:[n.jsxs("span",{children:["VAT ",y.rate,"%:"]}),n.jsx("span",{className:"nice-il__total-value",children:F(y.amount)})]},y.rate)),n.jsxs("div",{className:"nice-il__total-row nice-il__total-row--gross",children:[n.jsxs("span",{children:[P("totalGross","Gross total"),":"]}),n.jsx("span",{className:"nice-il__total-value nice-il__total-value--gross",children:F(N.totalGross)})]})]}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),a&&typeof a=="string"&&n.jsx("span",{className:"nice-error-text",children:a})]})});er.displayName="NiceInvoiceLineEditor";const tr=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,value:p=[],onChange:m,contacts:k=[],onSearch:b,searchDelay:C=300,multiple:_=!1,placeholder:f,onContactClick:v,maxSelections:j},S)=>{const I=$e(h,d);if(I==="hidden")return null;I==="disabled"&&(r=!0),I==="readOnly"&&(s=!0);const{t:M}=Se(),w=ke(d),[E,P]=o.useState(""),[L,A]=o.useState([]),[N,x]=o.useState(!1),[O,D]=o.useState(!1),F=o.useMemo(()=>{const R=[...k,...L],T=new Map(R.map(B=>[B.id,B]));return p.map(B=>T.get(B)).filter(Boolean)},[p,k,L]),y=o.useCallback(R=>{if(P(R),R.length<1){A([]),x(!1);return}if(b){D(!0);const V=setTimeout(async()=>{const K=await b(R);A(K),x(!0),D(!1)},C);return()=>clearTimeout(V)}const T=R.toLowerCase(),B=k.filter(V=>{var K,H;return V.name.toLowerCase().includes(T)||((K=V.email)==null?void 0:K.toLowerCase().includes(T))||((H=V.phone)==null?void 0:H.includes(R))});A(B),x(!0)},[b,k,C]),$=o.useCallback(R=>{if(_)if(p.includes(R.id))m==null||m(p.filter(T=>T!==R.id));else{if(j&&p.length>=j)return;m==null||m([...p,R.id])}else m==null||m([R.id]),x(!1),P("")},[p,m,_,j]),z=o.useCallback(R=>{m==null||m(p.filter(T=>T!==R))},[p,m]);return n.jsxs("div",{ref:S,id:w,className:`nice-contact-picker nice-size-${l}${u?` ${u}`:""}${a?" nice-error":""}${r?" nice-disabled":""}`,style:g,children:[e&&n.jsxs("label",{className:"nice-contact-picker__label",children:[e,i&&n.jsx("span",{className:"nice-required",children:"*"})]}),F.length>0&&n.jsx("div",{className:"nice-contact-picker__chips",children:F.map(R=>n.jsxs("span",{className:"nice-contact-picker__chip",onClick:()=>v==null?void 0:v(R),children:[R.avatarUrl&&n.jsx("img",{src:R.avatarUrl,alt:"",className:"nice-contact-picker__chip-avatar"}),n.jsx("span",{children:R.name}),!s&&n.jsx("button",{type:"button",className:"nice-contact-picker__chip-remove",onClick:T=>{T.stopPropagation(),z(R.id)},disabled:r,children:"×"})]},R.id))}),!s&&n.jsxs("div",{className:"nice-contact-picker__search",children:[n.jsx("input",{className:"nice-input",type:"text",value:E,onChange:R=>y(R.target.value),onFocus:()=>E.length>0&&x(!0),onBlur:()=>setTimeout(()=>x(!1),200),placeholder:f??M("searchContacts","Search contacts…"),disabled:r,"aria-label":M("searchContacts","Search contacts")}),O&&n.jsx("span",{className:"nice-contact-picker__spinner",children:"⏳"})]}),N&&L.length>0&&n.jsx("div",{className:"nice-contact-picker__dropdown",role:"listbox",children:L.map(R=>n.jsxs("div",{className:`nice-contact-picker__option${p.includes(R.id)?" nice-contact-picker__option--selected":""}`,role:"option","aria-selected":p.includes(R.id),onClick:()=>$(R),children:[R.avatarUrl&&n.jsx("img",{src:R.avatarUrl,alt:"",className:"nice-contact-picker__option-avatar"}),n.jsxs("div",{className:"nice-contact-picker__option-info",children:[n.jsx("span",{className:"nice-contact-picker__option-name",children:R.name}),R.subtitle&&n.jsx("span",{className:"nice-contact-picker__option-subtitle",children:R.subtitle}),R.email&&n.jsx("span",{className:"nice-contact-picker__option-email",children:R.email})]}),R.type&&n.jsx("span",{className:"nice-contact-picker__option-type",children:R.type==="person"?"👤":"🏢"})]},R.id))}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),a&&typeof a=="string"&&n.jsx("span",{className:"nice-error-text",children:a})]})});tr.displayName="NiceContactPicker";const bu=["highlight","underline","strikethrough","freehand","text","rect","arrow"],xu={highlight:"🖍️",underline:"⎁",strikethrough:"S̶",freehand:"✏️",text:"T",rect:"▭",arrow:"→",stamp:"🔏"},nr=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",id:c,className:d,style:u,accessMode:g,src:h,annotations:p=[],onAnnotationsChange:m,activeTool:k,onToolChange:b,currentPage:C=1,onPageChange:_,totalPages:f=1,defaultColor:v="#FFFF00",tools:j=bu,author:S,zoom:I=1,onZoomChange:M,onAnnotationClick:w,onAnnotationDelete:E},P)=>{const L=$e(g,c);if(L==="hidden")return null;L==="disabled"&&(r=!0),L==="readOnly"&&(s=!0);const{t:A}=Se(),N=ke(c),x=p.filter(F=>F.page===C),O=o.useCallback(F=>{b==null||b(k===F?null:F)},[k,b]),D=o.useCallback(F=>{if(s||!k||k==="freehand")return;const y=F.currentTarget.getBoundingClientRect(),$=(F.clientX-y.left)/y.width,z=(F.clientY-y.top)/y.height,R={id:`ann-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,tool:k,page:C,x:$,y:z,color:v,author:S,createdAt:new Date().toISOString(),text:k==="text"?"":void 0};m==null||m([...p,R])},[s,k,C,v,S,p,m]);return n.jsxs("div",{ref:P,id:N,className:`nice-pdf-annotation nice-size-${l}${d?` ${d}`:""}${a?" nice-error":""}${r?" nice-disabled":""}`,style:u,children:[e&&n.jsxs("div",{className:"nice-pdf-annotation__label",children:[e,i&&n.jsx("span",{className:"nice-required",children:"*"})]}),!s&&n.jsxs("div",{className:"nice-pdf-annotation__toolbar",children:[j.map(F=>n.jsx("button",{type:"button",className:`nice-pdf-annotation__tool-btn${k===F?" nice-pdf-annotation__tool-btn--active":""}`,onClick:()=>O(F),disabled:r,title:A(`pdfTool_${F}`,F),children:xu[F]},F)),n.jsx("span",{className:"nice-pdf-annotation__toolbar-sep"}),n.jsx("button",{type:"button",disabled:r,onClick:()=>M==null?void 0:M(Math.max(.25,I-.25)),title:A("zoomOut","Zoom out"),children:"−"}),n.jsxs("span",{className:"nice-pdf-annotation__zoom",children:[Math.round(I*100),"%"]}),n.jsx("button",{type:"button",disabled:r,onClick:()=>M==null?void 0:M(Math.min(4,I+.25)),title:A("zoomIn","Zoom in"),children:"+"})]}),n.jsxs("div",{className:"nice-pdf-annotation__viewport",style:{transform:`scale(${I})`,transformOrigin:"top left"},children:[n.jsx("iframe",{src:h,className:"nice-pdf-annotation__frame",title:A("pdfViewer","PDF Viewer")}),n.jsx("div",{className:"nice-pdf-annotation__layer",onClick:D,children:x.map(F=>n.jsxs("div",{className:`nice-pdf-annotation__mark nice-pdf-annotation__mark--${F.tool}`,style:{left:`${F.x*100}%`,top:`${F.y*100}%`,backgroundColor:F.color},onClick:y=>{y.stopPropagation(),w==null||w(F)},title:F.text??F.tool,children:[F.text&&n.jsx("span",{children:F.text}),!s&&n.jsx("button",{type:"button",className:"nice-pdf-annotation__mark-delete",onClick:y=>{y.stopPropagation(),E==null||E(F.id)},children:"×"})]},F.id))})]}),n.jsxs("div",{className:"nice-pdf-annotation__pager",children:[n.jsx("button",{type:"button",disabled:r||C<=1,onClick:()=>_==null?void 0:_(C-1),children:"◀"}),n.jsx("span",{children:A("pageOf","{page} / {total}").replace("{page}",String(C)).replace("{total}",String(f))}),n.jsx("button",{type:"button",disabled:r||C>=f,onClick:()=>_==null?void 0:_(C+1),children:"▶"})]}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),a&&typeof a=="string"&&n.jsx("span",{className:"nice-error-text",children:a})]})});nr.displayName="NicePDFAnnotationEditor";const ar=o.forwardRef(({label:e,helperText:t,error:a,disabled:i,readOnly:r,size:s="md",id:l,className:c,style:d,accessMode:u,pages:g,selectedPageId:h,content:p="",contentFormat:m="html",editing:k=!1,onPageSelect:b,onContentChange:C,onSave:_,onCreatePage:f,onDeletePage:v,onEditToggle:j,onVersionHistory:S,sidebarWidth:I=260,sidebarCollapsed:M=!1,onSidebarToggle:w,searchable:E=!0,onSearch:P},L)=>{const A=$e(u,l);if(A==="hidden")return null;A==="disabled"&&(i=!0),A==="readOnly"&&(r=!0);const{t:N}=Se(),x=ke(l),[O,D]=o.useState(""),[F,y]=o.useState(""),[$,z]=o.useState(!1),R=o.useMemo(()=>{const K=H=>{for(const q of H){if(q.id===h)return q;if(q.children){const Z=K(q.children);if(Z)return Z}}};return K(g)},[g,h]),T=o.useCallback(K=>{D(K),P==null||P(K)},[P]),B=o.useCallback(()=>{F.trim()&&(f==null||f(h??null,F.trim()),y(""),z(!1))},[F,h,f]),V=(K,H=0)=>n.jsx("ul",{className:"nice-wiki__tree",style:{paddingLeft:H>0?16:0},children:K.map(q=>{var Z;return n.jsxs("li",{className:"nice-wiki__tree-item",children:[n.jsxs("div",{className:`nice-wiki__tree-node${q.id===h?" nice-wiki__tree-node--active":""}${q.isDraft?" nice-wiki__tree-node--draft":""}`,onClick:()=>b==null?void 0:b(q),role:"treeitem","aria-selected":q.id===h,children:[n.jsx("span",{className:"nice-wiki__tree-icon",children:(Z=q.children)!=null&&Z.length?"📁":"📄"}),n.jsx("span",{className:"nice-wiki__tree-title",children:q.title}),q.isDraft&&n.jsx("span",{className:"nice-wiki__tree-draft",children:N("draft","Draft")})]}),q.children&&q.children.length>0&&V(q.children,H+1)]},q.id)})});return n.jsxs("div",{ref:L,id:x,className:`nice-wiki nice-size-${s}${c?` ${c}`:""}${i?" nice-disabled":""}`,style:d,children:[!M&&n.jsxs("aside",{className:"nice-wiki__sidebar",style:{width:I},children:[n.jsxs("div",{className:"nice-wiki__sidebar-header",children:[n.jsx("span",{className:"nice-wiki__sidebar-title",children:e??N("wiki","Wiki")}),w&&n.jsx("button",{type:"button",className:"nice-wiki__sidebar-toggle",onClick:()=>w(!0),children:"«"})]}),E&&n.jsx("input",{type:"text",className:"nice-input nice-wiki__search",value:O,onChange:K=>T(K.target.value),placeholder:N("searchPages","Search pages…"),disabled:i}),n.jsx("div",{className:"nice-wiki__page-tree",role:"tree",children:V(g)}),f&&!r&&n.jsx("div",{className:"nice-wiki__sidebar-footer",children:$?n.jsxs("div",{className:"nice-wiki__create-form",children:[n.jsx("input",{type:"text",className:"nice-input",value:F,onChange:K=>y(K.target.value),placeholder:N("pageTitle","Page title"),onKeyDown:K=>K.key==="Enter"&&B(),disabled:i}),n.jsx("button",{type:"button",disabled:i||!F.trim(),onClick:B,children:"✓"}),n.jsx("button",{type:"button",onClick:()=>z(!1),children:"✕"})]}):n.jsxs("button",{type:"button",className:"nice-wiki__add-page",onClick:()=>z(!0),disabled:i,children:["+ ",N("newPage","New page")]})})]}),M&&w&&n.jsx("button",{type:"button",className:"nice-wiki__sidebar-expand",onClick:()=>w(!1),children:"»"}),n.jsx("main",{className:"nice-wiki__content",children:R?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"nice-wiki__content-header",children:[n.jsx("h1",{className:"nice-wiki__page-title",children:R.title}),n.jsxs("div",{className:"nice-wiki__content-actions",children:[j&&!r&&n.jsx("button",{type:"button",disabled:i,onClick:()=>j(!k),children:k?N("preview","Preview"):N("edit","Edit")}),S&&n.jsx("button",{type:"button",disabled:i,onClick:()=>S(R.id),children:N("history","History")}),v&&!r&&n.jsx("button",{type:"button",className:"nice-btn--danger",disabled:i,onClick:()=>v(R.id),children:N("delete","Delete")})]})]}),R.updatedAt&&n.jsxs("div",{className:"nice-wiki__page-meta",children:[R.updatedBy&&n.jsxs("span",{children:[N("lastEditedBy","Last edited by")," ",R.updatedBy]}),n.jsx("span",{children:new Date(R.updatedAt).toLocaleDateString()})]}),k?n.jsxs("div",{className:"nice-wiki__editor",children:[n.jsx("textarea",{className:"nice-wiki__editor-textarea",value:p,onChange:K=>C==null?void 0:C(K.target.value),disabled:i}),_&&n.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",disabled:i,onClick:()=>_(R.id,p),children:N("save","Save")})]}):n.jsx("div",{className:"nice-wiki__viewer",children:m==="html"?n.jsx("div",{className:"nice-wiki__html",dangerouslySetInnerHTML:{__html:tn(p)}}):n.jsx("pre",{className:"nice-wiki__markdown",children:p})})]}):n.jsx("div",{className:"nice-wiki__empty",children:n.jsx("p",{children:N("selectPage","Select a page from the sidebar or create a new one.")})})}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),a&&typeof a=="string"&&n.jsx("span",{className:"nice-error-text",children:a})]})});ar.displayName="NiceWiki";const vu=[{code:"PL",label:"Polska",prefix:"PL",pattern:/^\d{10}$/,placeholder:"1234567890"},{code:"DE",label:"Deutschland",prefix:"DE",pattern:/^\d{9}$/,placeholder:"123456789"},{code:"GB",label:"United Kingdom",prefix:"GB",pattern:/^\d{9}(\d{3})?$/,placeholder:"123456789"},{code:"FR",label:"France",prefix:"FR",pattern:/^[A-Z0-9]{2}\d{9}$/,placeholder:"XX123456789"},{code:"CZ",label:"Česko",prefix:"CZ",pattern:/^\d{8,10}$/,placeholder:"12345678"},{code:"SK",label:"Slovensko",prefix:"SK",pattern:/^\d{10}$/,placeholder:"1234567890"},{code:"IT",label:"Italia",prefix:"IT",pattern:/^\d{11}$/,placeholder:"12345678901"},{code:"ES",label:"España",prefix:"ES",pattern:/^[A-Z0-9]\d{7}[A-Z0-9]$/,placeholder:"X1234567X"}],ir=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,value:p="",onChange:m,countryCode:k="PL",onCountryChange:b,countries:C=vu,showCountrySelector:_=!0,autoPrefixVat:f=!0,validationResult:v,onValidateRequest:j,placeholder:S},I)=>{const M=$e(h,d);if(M==="hidden")return null;M==="disabled"&&(r=!0),M==="readOnly"&&(s=!0);const{t:w}=Se(),E=ke(d),P=o.useMemo(()=>C.find(O=>O.code===k)??C[0],[C,k]),L=o.useCallback(O=>{let D=O.toUpperCase();return P&&D.startsWith(P.prefix)&&(D=D.slice(P.prefix.length)),P?P.pattern.test(D):D.length>0},[P]),A=o.useCallback(O=>{const D=O.target.value.replace(/\s/g,"");m==null||m(D,L(D))},[m,L]),N=f&&p&&P&&!p.toUpperCase().startsWith(P.prefix)?`${P.prefix}${p}`:p,x=L(p);return n.jsxs("div",{ref:I,id:E,className:`nice-vat-input nice-size-${l}${u?` ${u}`:""}${a||!x&&p.length>0?" nice-error":""}${r?" nice-disabled":""}`,style:g,children:[e&&n.jsxs("label",{className:"nice-vat-input__label",htmlFor:`${E}-input`,children:[e,i&&n.jsx("span",{className:"nice-required",children:"*"})]}),n.jsxs("div",{className:"nice-vat-input__row",children:[_&&n.jsx("select",{className:"nice-vat-input__country",value:k,onChange:O=>b==null?void 0:b(O.target.value),disabled:r||s,children:C.map(O=>n.jsx("option",{value:O.code,children:O.prefix},O.code))}),n.jsx("input",{id:`${E}-input`,className:"nice-input nice-vat-input__field",type:"text",name:c,value:p,onChange:A,readOnly:s,disabled:r,placeholder:S??(P==null?void 0:P.placeholder),required:i,"aria-invalid":!x&&p.length>0}),j&&p.length>0&&n.jsx("button",{type:"button",className:"nice-vat-input__verify",disabled:r||!x,onClick:()=>j(f?N:p,k),title:w("verifyVat","Verify VAT number"),children:"🔍"})]}),v&&n.jsxs("div",{className:`nice-vat-input__result nice-vat-input__result--${v.valid?"valid":"invalid"}`,children:[v.valid?"✅":"❌"," ",v.companyName??v.error??(v.valid?w("vatValid","VAT number valid"):w("vatInvalid","VAT number invalid"))]}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),a&&typeof a=="string"&&n.jsx("span",{className:"nice-error-text",children:a})]})});ir.displayName="NiceVatInput";const wu=[{id:"pl-23",label:"23%",rate:.23,countryCode:"PL",category:"standard",isDefault:!0},{id:"pl-8",label:"8%",rate:.08,countryCode:"PL",category:"reduced"},{id:"pl-5",label:"5%",rate:.05,countryCode:"PL",category:"reduced"},{id:"pl-0",label:"0%",rate:0,countryCode:"PL",category:"zero"},{id:"pl-zw",label:"zw.",rate:0,countryCode:"PL",category:"exempt"},{id:"pl-np",label:"n.p.",rate:0,countryCode:"PL",category:"exempt"}],rr=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,value:p,onChange:m,rates:k,countryCode:b,placeholder:C,showPercentage:_=!0},f)=>{const v=$e(h,d);if(v==="hidden")return null;v==="disabled"&&(r=!0),v==="readOnly"&&(s=!0);const{t:j}=Se(),S=ke(d),I=o.useMemo(()=>{const w=k??wu;return b?w.filter(E=>!E.countryCode||E.countryCode===b):w},[k,b]),M=o.useCallback(w=>{const E=w.target.value,P=I.find(L=>L.id===E);P&&(m==null||m(E,P))},[m,I]);return n.jsxs("div",{ref:f,id:S,className:`nice-tax-rate nice-size-${l}${u?` ${u}`:""}${a?" nice-error":""}${r?" nice-disabled":""}`,style:g,children:[e&&n.jsxs("label",{className:"nice-tax-rate__label",htmlFor:`${S}-select`,children:[e,i&&n.jsx("span",{className:"nice-required",children:"*"})]}),n.jsxs("select",{id:`${S}-select`,className:"nice-select nice-tax-rate__select",name:c,value:p??"",onChange:M,disabled:r||s,required:i,children:[n.jsx("option",{value:"",disabled:!0,children:C??j("selectRate","Select rate…")}),I.map(w=>n.jsxs("option",{value:w.id,children:[w.label,_&&w.category!=="exempt"?` (${(w.rate*100).toFixed(0)}%)`:""]},w.id))]}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),a&&typeof a=="string"&&n.jsx("span",{className:"nice-error-text",children:a})]})});rr.displayName="NiceTaxRatePicker";const ku={asset:"var(--nice-color-info, #5bc0de)",liability:"var(--nice-color-warning, #f0ad4e)",equity:"var(--nice-color-success, #5cb85c)",revenue:"var(--nice-color-primary, #337ab7)",expense:"var(--nice-color-error, #d9534f)"},or=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,value:p,onChange:m,accounts:k,treeView:b=!1,placeholder:C,searchable:_=!0,showType:f=!0,onSearch:v},j)=>{const S=$e(h,d);if(S==="hidden")return null;S==="disabled"&&(r=!0),S==="readOnly"&&(s=!0);const{t:I}=Se(),M=ke(d),[w,E]=o.useState(""),[P,L]=o.useState(!1),A=o.useMemo(()=>{const F=y=>{for(const $ of y){if($.code===p)return $;if($.children){const z=F($.children);if(z)return z}}};return F(k)},[k,p]),N=o.useMemo(()=>{const F=[],y=$=>{for(const z of $)F.push(z),z.children&&y(z.children)};return y(k),F},[k]),x=o.useMemo(()=>{if(!w)return N;const F=w.toLowerCase();return N.filter(y=>y.code.toLowerCase().includes(F)||y.name.toLowerCase().includes(F))},[N,w]),O=o.useCallback(F=>{E(F),v==null||v(F),L(!0)},[v]),D=o.useCallback(F=>{m==null||m(F.code,F),L(!1),E("")},[m]);return n.jsxs("div",{ref:j,id:M,className:`nice-account-picker nice-size-${l}${u?` ${u}`:""}${a?" nice-error":""}${r?" nice-disabled":""}`,style:g,children:[e&&n.jsxs("label",{className:"nice-account-picker__label",htmlFor:`${M}-input`,children:[e,i&&n.jsx("span",{className:"nice-required",children:"*"})]}),n.jsx("div",{className:"nice-account-picker__control",children:_&&!s?n.jsx("input",{id:`${M}-input`,className:"nice-input",type:"text",value:P?w:A?`${A.code} — ${A.name}`:"",onChange:F=>O(F.target.value),onFocus:()=>{E(""),L(!0)},onBlur:()=>setTimeout(()=>L(!1),200),placeholder:C??I("searchAccount","Search account…"),disabled:r,required:i}):n.jsx("div",{className:"nice-account-picker__display",children:A?`${A.code} — ${A.name}`:C??I("selectAccount","Select account…")})}),P&&x.length>0&&n.jsx("div",{className:"nice-account-picker__dropdown",role:"listbox",children:x.map(F=>n.jsxs("div",{className:`nice-account-picker__option${F.code===p?" nice-account-picker__option--selected":""}${F.isActive===!1?" nice-account-picker__option--inactive":""}`,role:"option","aria-selected":F.code===p,onClick:()=>D(F),children:[f&&F.type&&n.jsx("span",{className:"nice-account-picker__type",style:{color:ku[F.type]},title:F.type,children:"●"}),n.jsx("span",{className:"nice-account-picker__code",children:F.code}),n.jsx("span",{className:"nice-account-picker__name",children:F.name})]},F.code))}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),a&&typeof a=="string"&&n.jsx("span",{className:"nice-error-text",children:a})]})});or.displayName="NiceAccountPicker";const sr=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",id:c,className:d,style:u,accessMode:g,mode:h="manual",onScan:p,onModeChange:m,beepOnScan:k=!0,beepFrequency:b=1800,beepDuration:C=150,placeholder:_,scanHistory:f=[],showHistory:v=!0,maxHistory:j=10,autoFocus:S=!0,onCameraFrame:I},M)=>{const w=$e(g,c);if(w==="hidden")return null;w==="disabled"&&(r=!0),w==="readOnly"&&(s=!0);const{t:E}=Se(),P=ke(c),[L,A]=o.useState(""),N=o.useRef(null),x=o.useRef(null),O=o.useCallback(()=>{if(k)try{x.current||(x.current=new AudioContext);const y=x.current,$=y.createOscillator(),z=y.createGain();$.connect(z),z.connect(y.destination),$.frequency.value=b,$.type="square",z.gain.value=.3,$.start(),$.stop(y.currentTime+C/1e3)}catch{}},[k,b,C]),D=o.useCallback(()=>{var y;L.trim()&&(O(),p==null||p({value:L.trim(),format:"manual",scannedAt:new Date}),A(""),(y=N.current)==null||y.focus())},[L,p,O]),F=f.slice(0,j);return n.jsxs("div",{ref:M,id:P,className:`nice-scanner nice-size-${l}${d?` ${d}`:""}${a?" nice-error":""}${r?" nice-disabled":""}`,style:u,children:[e&&n.jsxs("div",{className:"nice-scanner__label",children:[e,i&&n.jsx("span",{className:"nice-required",children:"*"})]}),n.jsxs("div",{className:"nice-scanner__modes",children:[n.jsxs("button",{type:"button",className:`nice-scanner__mode-btn${h==="camera"?" nice-scanner__mode-btn--active":""}`,onClick:()=>m==null?void 0:m("camera"),disabled:r,children:["📷 ",E("camera","Camera")]}),n.jsxs("button",{type:"button",className:`nice-scanner__mode-btn${h==="manual"?" nice-scanner__mode-btn--active":""}`,onClick:()=>m==null?void 0:m("manual"),disabled:r,children:["⌨️ ",E("manual","Manual")]})]}),h==="camera"&&n.jsx("div",{className:"nice-scanner__camera",children:n.jsx("div",{className:"nice-scanner__viewfinder",children:n.jsxs("div",{className:"nice-scanner__viewfinder-overlay",children:[n.jsx("span",{children:"📷"}),n.jsx("p",{children:E("cameraPlaceholder","Camera preview — connect scanner adapter")})]})})}),h==="manual"&&!s&&n.jsxs("div",{className:"nice-scanner__manual",children:[n.jsx("input",{ref:N,className:"nice-input nice-scanner__input",type:"text",value:L,onChange:y=>A(y.target.value),onKeyDown:y=>y.key==="Enter"&&D(),placeholder:_??E("enterCode","Enter or scan code…"),disabled:r,autoFocus:S}),n.jsx("button",{type:"button",className:"nice-scanner__submit",onClick:D,disabled:r||!L.trim(),children:"✓"})]}),v&&F.length>0&&n.jsxs("div",{className:"nice-scanner__history",children:[n.jsx("div",{className:"nice-scanner__history-label",children:E("recentScans","Recent scans")}),F.map((y,$)=>n.jsxs("div",{className:"nice-scanner__history-item",children:[n.jsx("span",{className:"nice-scanner__history-value",children:y.value}),y.format&&n.jsx("span",{className:"nice-scanner__history-format",children:y.format}),n.jsx("span",{className:"nice-scanner__history-time",children:y.scannedAt.toLocaleTimeString()})]},$))]}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),a&&typeof a=="string"&&n.jsx("span",{className:"nice-error-text",children:a})]})});sr.displayName="NiceScannerControl";const lr=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",id:c,className:d,style:u,accessMode:g,value:h="",onChange:p,onComplete:m,length:k=4,masked:b=!0,showKeypad:C=!1,autoSubmit:_=!0,shake:f=!1,placeholderChar:v="·"},j)=>{const S=$e(g,c);if(S==="hidden")return null;S==="disabled"&&(r=!0),S==="readOnly"&&(s=!0);const{t:I}=Se(),M=ke(c),w=o.useRef([]),[E,P]=o.useState(!1);o.useEffect(()=>{if(f){P(!0);const O=setTimeout(()=>P(!1),500);return()=>clearTimeout(O)}},[f]);const L=h.split("").slice(0,k);for(;L.length<k;)L.push("");const A=o.useCallback((O,D)=>{var $;const F=[...L];F[O]=D;const y=F.join("");p==null||p(y),D&&O<k-1&&(($=w.current[O+1])==null||$.focus()),_&&y.length===k&&y.indexOf("")===-1&&(m==null||m(y))},[L,k,p,m,_]),N=o.useCallback((O,D)=>{var F,y,$;O.key==="Backspace"&&!L[D]&&D>0&&((F=w.current[D-1])==null||F.focus(),A(D-1,"")),O.key==="ArrowLeft"&&D>0&&((y=w.current[D-1])==null||y.focus()),O.key==="ArrowRight"&&D<k-1&&(($=w.current[D+1])==null||$.focus())},[L,k,A]),x=o.useCallback(O=>{var D,F,y;if(O==="clear"){p==null||p(""),(D=w.current[0])==null||D.focus();return}if(O==="backspace"){const $=h.slice(0,-1);p==null||p($);const z=Math.max(0,$.length-1);(F=w.current[z])==null||F.focus();return}if(h.length<k){const $=h+O;p==null||p($),$.length<k&&((y=w.current[$.length])==null||y.focus()),_&&$.length===k&&(m==null||m($))}},[h,k,p,m,_]);return n.jsxs("div",{ref:j,id:M,className:`nice-pin nice-size-${l}${E?" nice-pin--shake":""}${d?` ${d}`:""}${a?" nice-error":""}${r?" nice-disabled":""}`,style:u,children:[e&&n.jsxs("label",{className:"nice-pin__label",children:[e,i&&n.jsx("span",{className:"nice-required",children:"*"})]}),n.jsx("div",{className:"nice-pin__boxes",children:L.map((O,D)=>n.jsx("input",{ref:F=>{w.current[D]=F},className:"nice-pin__box",type:b?"password":"text",inputMode:"numeric",maxLength:1,value:O,onChange:F=>{const y=F.target.value.replace(/\D/g,"");y.length<=1&&A(D,y)},onKeyDown:F=>N(F,D),disabled:r,readOnly:s,placeholder:v,"aria-label":`${I("digit","Digit")} ${D+1}`},D))}),C&&!s&&n.jsx("div",{className:"nice-pin__keypad",children:["1","2","3","4","5","6","7","8","9","clear","0","backspace"].map(O=>n.jsx("button",{type:"button",className:`nice-pin__key${O==="clear"||O==="backspace"?" nice-pin__key--action":""}`,onClick:()=>x(O),disabled:r,children:O==="clear"?"C":O==="backspace"?"⌫":O},O))}),t&&n.jsx("span",{className:"nice-helper-text",children:t}),a&&typeof a=="string"&&n.jsx("span",{className:"nice-error-text",children:a})]})});lr.displayName="NicePinCodeInput";const Ha=Object.freeze(Object.defineProperty({__proto__:null,$:ir,A:Yn,B:er,C:Zn,D:zi,E:aa,F:Vn,G:Gn,H:ta,I:nr,J:Un,K:Xi,L:Qn,M:lr,N:or,O:wi,P:Ii,Q:Kn,R:sr,T:ra,U:on,V:Fi,W:rr,X:Tn,Y:qn,_:Xn,a:Gi,a0:ar,a4:$i,a5:Bi,a8:Hi,aa:Li,ab:Qt,ac:Gt,ad:Mi,ae:Et,af:_i,ag:xn,ah:Nt,ai:At,aj:Ze,ak:ki,al:Ni,am:Ci,an:Si,ao:Pn,ap:Xt,aq:_d,ar:Od,b:Ei,c:sn,d:ea,e:Jn,g:Ln,h:tr,k:Qi,l:Rn,m:Ai,n:Wn,o:sa,p:Di,r:Zi,s:Oi,t:Hn,u:On,v:ln,x:Wi,y:ia,z:na},Symbol.toStringTag,{value:"Module"})),mt=o.forwardRef(({label:e,helperText:t,error:a,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:g,accessMode:h,displayStyle:p,value:m,onChange:k,onBlur:b,onKeyDown:C,placeholder:_,min:f,max:v,step:j=1,precision:S,prefix:I,suffix:M,showStepper:w=!0,submitOnEnter:E,onSubmit:P,showKeyboardHints:L},A)=>{const N=$e(h,d);if(N==="hidden")return null;N==="disabled"&&(r=!0),N==="readOnly"&&(s=!0);const{t:x}=Se(),O=ke(d),D=Ge("input",p),F=qe("input",p),y=o.useCallback(K=>{let H=K;return f!==void 0&&(H=Math.max(f,H)),v!==void 0&&(H=Math.min(v,H)),S!==void 0&&(H=parseFloat(H.toFixed(S))),H},[f,v,S]),$=o.useCallback(K=>{const H=K.target.value;if(H===""){k==null||k(null);return}const q=parseFloat(H);isNaN(q)||(k==null||k(y(q)))},[k,y]),z=o.useCallback(()=>{k==null||k(y((m??0)+j))},[m,j,k,y]),R=o.useCallback(()=>{k==null||k(y((m??0)-j))},[m,j,k,y]),T=jn({enabled:E,onSubmit:P}),B=o.useCallback(K=>{T(K),C==null||C(K)},[T,C]),V=o.useMemo(()=>{const K=[];return E&&K.push(Ae.submit),w&&(K.push({key:"ArrowUp",description:x("shortcuts.increment","Increase value")}),K.push({key:"ArrowDown",description:x("shortcuts.decrement","Decrease value")})),K},[E,w,x]);return n.jsxs("div",{className:`nice-field ${u||""}`,style:g,children:[e&&n.jsxs("label",{htmlFor:O,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,L&&V.length>0&&n.jsx(Oe,{shortcuts:V,size:"sm"})]}),n.jsxs("div",{className:`nice-input nice-input--${l} nice-input--ds-${F} ${a?"nice-input--error":""} ${r?"nice-input--disabled":""} ${s?"nice-input--readonly":""}`,style:D,children:[I&&n.jsx("span",{className:"nice-input__icon",children:I}),w&&!s&&n.jsx("button",{type:"button",className:"nice-input__clear",onClick:R,disabled:r,"aria-label":x("controls.decrement","Decrement"),children:"−"}),n.jsx("input",{ref:A,id:O,className:"nice-input__native",type:"number",name:c,value:m??"",placeholder:_,min:f,max:v,step:j,disabled:r,readOnly:s,"aria-invalid":!!a,onChange:$,onBlur:b,onKeyDown:B}),w&&!s&&n.jsx("button",{type:"button",className:"nice-input__clear",onClick:z,disabled:r,"aria-label":x("controls.increment","Increment"),children:"+"}),M&&n.jsx("span",{className:"nice-input__icon",children:M})]}),a&&n.jsx("div",{className:"nice-field__error",role:"alert",children:a}),!a&&t&&n.jsx("div",{className:"nice-field__helper",children:t})]})});mt.displayName="NiceNumberInput";const cr=o.forwardRef(({label:e,checked:t=!1,indeterminate:a=!1,onChange:i,disabled:r,size:s="md",name:l,id:c,className:d,style:u,error:g,accessMode:h,displayStyle:p,showKeyboardHints:m},k)=>{const b=$e(h,c);if(b==="hidden")return null;(b==="disabled"||b==="readOnly")&&(r=!0);const{t:C}=Se(),_=ke(c);qe("toggle",p);const f=o.useMemo(()=>[{key:"Space",description:C("shortcuts.toggle","Toggle")}],[C]),v=o.useCallback(j=>{j&&(j.indeterminate=a),typeof k=="function"?k(j):k&&(k.current=j)},[a,k]);return n.jsxs("div",{className:d,style:u,children:[n.jsxs("label",{className:`nice-checkbox ${s!=="md"?`nice-checkbox--${s}`:""} ${r?"nice-checkbox--disabled":""}`,htmlFor:_,children:[n.jsx("input",{ref:v,id:_,type:"checkbox",className:"nice-checkbox__input",name:l,checked:t,disabled:r,"aria-invalid":!!g,onChange:j=>i==null?void 0:i(j.target.checked)}),n.jsx("span",{className:"nice-checkbox__box",children:n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a?n.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"}):n.jsx("polyline",{points:"2 6 5 9 10 3"})})}),e&&n.jsx("span",{children:e}),m&&n.jsx(Oe,{shortcuts:f,size:"sm"})]}),g&&n.jsx("div",{className:"nice-field__error",role:"alert",children:g})]})});cr.displayName="NiceCheckbox";const dr=o.forwardRef(({label:e,checked:t=!1,onChange:a,disabled:i,size:r="md",name:s,id:l,className:c,style:d,accessMode:u,displayStyle:g,showKeyboardHints:h},p)=>{const m=$e(u,l);if(m==="hidden")return null;(m==="disabled"||m==="readOnly")&&(i=!0);const{t:k}=Se(),b=ke(l),C=Ge("toggle",g),_=qe("toggle",g),f=o.useMemo(()=>[{key:"Space",description:k("shortcuts.toggle","Toggle on/off")}],[k]);return n.jsxs("label",{className:`nice-toggle nice-toggle--ds-${_} ${r!=="md"?`nice-toggle--${r}`:""} ${i?"nice-toggle--disabled":""} ${c||""}`,htmlFor:b,style:{...C,...d},children:[n.jsx("input",{ref:p,id:b,type:"checkbox",className:"nice-toggle__input",name:s,checked:t,disabled:i,role:"switch","aria-checked":t,onChange:v=>a==null?void 0:a(v.target.checked)}),n.jsx("span",{className:"nice-toggle__track",children:n.jsx("span",{className:"nice-toggle__thumb"})}),e&&n.jsx("span",{children:e}),h&&n.jsx(Oe,{shortcuts:f,size:"sm"})]})});dr.displayName="NiceToggle";const Su=180,la=({slides:e,slideSize:t,theme:a,currentIndex:i,onSelectSlide:r,onAddSlide:s,onDuplicateSlide:l,onRemoveSlide:c,className:d})=>{const u=an(),g=Su/t.width;return n.jsxs("div",{className:`nice-slide-thumbs ${d??""}`,style:{overflowY:"auto",padding:8},children:[e.map((h,p)=>n.jsxs("div",{className:`nice-slide-thumbs__item ${p===i?"nice-slide-thumbs__item--active":""}`,onClick:()=>r(p),style:{marginBottom:8,border:p===i?"2px solid #2196f3":"2px solid transparent",borderRadius:4,cursor:"pointer",position:"relative"},children:[n.jsx("div",{style:{pointerEvents:"none"},children:n.jsx(ft,{slide:h,slideSize:t,theme:a,scale:g})}),n.jsxs("div",{style:{fontSize:10,textAlign:"center",padding:"2px 0",color:"#666"},children:[p+1,". ",h.title]}),(l||c)&&n.jsxs("div",{className:"nice-slide-thumbs__actions",style:{position:"absolute",top:2,right:2,display:"flex",gap:2},children:[l&&n.jsx(ve,{className:"nice-slide-thumbs__action-btn",variant:"ghost",size:"sm",onClick:m=>{m.stopPropagation(),l(h.id)},title:u("toolbar.duplicateSlide"),style:{fontSize:10,padding:"1px 4px"},children:"⧉"}),c&&e.length>1&&n.jsx(ve,{className:"nice-slide-thumbs__action-btn",variant:"ghost",size:"sm",onClick:m=>{m.stopPropagation(),c(h.id)},title:u("toolbar.deleteSlide"),style:{fontSize:10,padding:"1px 4px",color:"#d32f2f"},children:"×"})]})]},h.id)),s&&n.jsxs(ve,{className:"nice-slide-thumbs__add",variant:"ghost",size:"sm",onClick:s,style:{width:"100%",padding:"8px 0",fontSize:13,color:"#888"},children:["+ ",u("toolbar.addSlide")]})]})};la.displayName="SlideThumbnailList";const Cu=["text","image","shape","chart","table","code","diagram","icon"],_u=["blank","titleSlide","titleContent","twoColumn","titleOnly","sectionHeader","comparison"],ca=({onAddElement:e,onAddSlide:t,onUndo:a,onRedo:i,canUndo:r=!1,canRedo:s=!1,onPresent:l,onExport:c,className:d})=>{const u=an(),[g,h]=o.useState(!1),[p,m]=o.useState(!1),[k,b]=o.useState(!1),C=o.useCallback(f=>{e==null||e(f),h(!1)},[e]),_=o.useCallback(f=>{t==null||t(f),m(!1)},[t]);return n.jsxs("div",{className:`nice-pres-toolbar ${d??""}`,children:[n.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[n.jsxs(ve,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>m(f=>!f),children:["+ ",u("toolbar.addSlide")]}),p&&n.jsx("div",{className:"nice-pres-toolbar__dropdown",children:_u.map(f=>n.jsx(ve,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>_(f),children:u(`layout.${f}`)},f))})]}),n.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[n.jsxs(ve,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>h(f=>!f),children:["+ ",u("element.addElement")]}),g&&n.jsx("div",{className:"nice-pres-toolbar__dropdown",children:Cu.map(f=>n.jsx(ve,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>C(f),children:u(`element.${f}`)},f))})]}),n.jsxs("div",{className:"nice-pres-toolbar__group",children:[n.jsx(ve,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:a,disabled:!r,title:u("toolbar.undo"),children:"↩"}),n.jsx(ve,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:i,disabled:!s,title:u("toolbar.redo"),children:"↪"})]}),n.jsx("div",{className:"nice-pres-toolbar__group",children:n.jsxs(ve,{className:"nice-pres-toolbar__btn nice-pres-toolbar__btn--primary",variant:"primary",size:"sm",onClick:l,children:["▶ ",u("toolbar.present")]})}),n.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[n.jsxs(ve,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>b(f=>!f),children:["⤓ ",u("toolbar.export")]}),k&&n.jsxs("div",{className:"nice-pres-toolbar__dropdown",children:[n.jsx(ve,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{c==null||c("ndp"),b(!1)},children:u("export.ndp")}),n.jsx(ve,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{c==null||c("html"),b(!1)},children:u("export.html")})]})]})]})};ca.displayName="PresentationToolbar";const ju=["blank","titleSlide","titleContent","twoColumn","titleOnly","sectionHeader","comparison","custom"],da=({slide:e,selectedElement:t,onSlideChange:a,onElementChange:i,onRemoveElement:r,className:s})=>{const l=an();return e?t&&e?n.jsxs("div",{className:`nice-pres-panel ${s??""}`,children:[n.jsx("h3",{className:"nice-pres-panel__title",children:l("panel.elementProperties")}),n.jsxs("div",{className:"nice-pres-panel__row",children:[n.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["X (%)",n.jsx(mt,{value:Math.round(t.position.x*10)/10,min:0,max:100,step:.5,onChange:c=>i==null?void 0:i(e.id,t.id,{position:{...t.position,x:c??0}}),className:"nice-pres-panel__input"})]}),n.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["Y (%)",n.jsx(mt,{value:Math.round(t.position.y*10)/10,min:0,max:100,step:.5,onChange:c=>i==null?void 0:i(e.id,t.id,{position:{...t.position,y:c??0}}),className:"nice-pres-panel__input"})]})]}),n.jsxs("div",{className:"nice-pres-panel__row",children:[n.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["W (%)",n.jsx(mt,{value:Math.round(t.position.width*10)/10,min:1,max:100,step:.5,onChange:c=>i==null?void 0:i(e.id,t.id,{position:{...t.position,width:c??1}}),className:"nice-pres-panel__input"})]}),n.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["H (%)",n.jsx(mt,{value:Math.round(t.position.height*10)/10,min:1,max:100,step:.5,onChange:c=>i==null?void 0:i(e.id,t.id,{position:{...t.position,height:c??1}}),className:"nice-pres-panel__input"})]})]}),n.jsxs("label",{className:"nice-pres-panel__label",children:["Opacity",n.jsx(on,{min:0,max:1,step:.05,value:t.opacity??1,onChange:c=>i==null?void 0:i(e.id,t.id,{opacity:c})})]}),t.content.kind==="text"&&n.jsxs(n.Fragment,{children:[n.jsxs("label",{className:"nice-pres-panel__label",children:[l("element.text"),n.jsx("textarea",{value:t.content.text,onChange:c=>i==null?void 0:i(e.id,t.id,{content:{...t.content,text:c.target.value}}),className:"nice-pres-panel__textarea",rows:4})]}),n.jsxs("label",{className:"nice-pres-panel__label",children:["Font Size",n.jsx(mt,{value:t.content.fontSize??16,min:8,max:200,onChange:c=>i==null?void 0:i(e.id,t.id,{content:{...t.content,fontSize:c??16}}),className:"nice-pres-panel__input"})]})]}),n.jsx(ve,{className:"nice-pres-panel__btn nice-pres-panel__btn--danger",variant:"ghost",size:"sm",onClick:()=>r==null?void 0:r(e.id,t.id),children:"Delete Element"})]}):n.jsxs("div",{className:`nice-pres-panel ${s??""}`,children:[n.jsx("h3",{className:"nice-pres-panel__title",children:l("panel.slideProperties")}),n.jsxs("label",{className:"nice-pres-panel__label",children:["Title",n.jsx(ht,{value:e.title,onChange:c=>a==null?void 0:a(e.id,{title:c}),className:"nice-pres-panel__input"})]}),n.jsxs("label",{className:"nice-pres-panel__label",children:[l("panel.layout"),n.jsx(gt,{value:e.layout,onChange:c=>a==null?void 0:a(e.id,{layout:c}),options:ju.map(c=>({value:c,label:l(`layout.${c}`)})),className:"nice-pres-panel__select"})]}),n.jsxs("label",{className:"nice-pres-panel__label",children:[l("panel.background"),n.jsx(bt,{value:e.background.color??"#ffffff",onChange:c=>a==null?void 0:a(e.id,{background:{...e.background,type:"solid",color:c}}),className:"nice-pres-panel__color"})]}),n.jsxs("label",{className:"nice-pres-panel__label",children:[l("panel.notes"),n.jsx("textarea",{value:e.notes??"",onChange:c=>a==null?void 0:a(e.id,{notes:c.target.value||void 0}),className:"nice-pres-panel__textarea",rows:4,placeholder:l("panel.notes")})]})]}):n.jsx("div",{className:`nice-pres-panel nice-pres-panel--empty ${s??""}`,children:n.jsx("p",{style:{color:"#999",fontStyle:"italic",textAlign:"center",padding:16},children:l("panel.noSelection")})})};da.displayName="SlidePropertyPanel";function Nu(e){let t;try{t=JSON.parse(e)}catch{return{ok:!1,error:"Invalid JSON"}}if(typeof t!="object"||t===null)return{ok:!1,error:"Root must be an object"};const a=t;return a.version!=="1.0"?{ok:!1,error:`Unsupported version: ${String(a.version)}`}:!a.id||typeof a.id!="string"?{ok:!1,error:'Missing or invalid "id"'}:!a.title||typeof a.title!="string"?{ok:!1,error:'Missing or invalid "title"'}:Array.isArray(a.slides)?!a.theme||typeof a.theme!="object"?{ok:!1,error:'Missing "theme"'}:{ok:!0,document:t}:{ok:!1,error:'"slides" must be an array'}}function ur(e,t=!1){return JSON.stringify(e,null,t?2:void 0)}function pr(e){const{slideSize:t,theme:a,slides:i}=e,r=i.map((s,l)=>Mu(s,t,a,l)).join(`
1268
+ `);return`<!DOCTYPE html>
1269
+ <html lang="en">
1270
+ <head>
1271
+ <meta charset="UTF-8" />
1272
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1273
+ <title>${$t(e.title)}</title>
1274
+ <style>
1275
+ * { margin: 0; padding: 0; box-sizing: border-box; }
1276
+ body { background: #000; overflow: hidden; font-family: ${a.fontFamily??"sans-serif"}; }
1277
+ .ndp-slide {
1278
+ position: absolute; top: 0; left: 0;
1279
+ width: ${t.width}px; height: ${t.height}px;
1280
+ transform-origin: top left;
1281
+ display: none;
1282
+ }
1283
+ .ndp-slide.active { display: block; }
1284
+ .ndp-element {
1285
+ position: absolute;
1286
+ }
1287
+ .ndp-element-text { white-space: pre-wrap; }
1288
+ .ndp-controls {
1289
+ position: fixed; bottom: 20px; right: 20px; z-index: 1000;
1290
+ display: flex; gap: 8px;
1291
+ }
1292
+ .ndp-controls button {
1293
+ padding: 8px 16px; border: none; border-radius: 4px;
1294
+ background: rgba(255,255,255,0.2); color: #fff;
1295
+ cursor: pointer; font-size: 14px;
1296
+ }
1297
+ .ndp-controls button:hover { background: rgba(255,255,255,0.35); }
1298
+ .ndp-counter {
1299
+ position: fixed; bottom: 20px; left: 20px; z-index: 1000;
1300
+ color: rgba(255,255,255,0.5); font-size: 14px;
1301
+ }
1302
+ </style>
1303
+ </head>
1304
+ <body>
1305
+ ${r}
1306
+ <div class="ndp-controls">
1307
+ <button onclick="prevSlide()">◀ Prev</button>
1308
+ <button onclick="nextSlide()">Next ▶</button>
1309
+ </div>
1310
+ <div class="ndp-counter" id="counter"></div>
1311
+ <script>
1312
+ (function() {
1313
+ var slides = document.querySelectorAll('.ndp-slide');
1314
+ var current = 0;
1315
+ var total = slides.length;
1316
+ function show(idx) {
1317
+ slides.forEach(function(s) { s.classList.remove('active'); });
1318
+ slides[idx].classList.add('active');
1319
+ document.getElementById('counter').textContent = (idx + 1) + ' / ' + total;
1320
+ fitSlide();
1321
+ }
1322
+ function fitSlide() {
1323
+ var sw = ${t.width}, sh = ${t.height};
1324
+ var ww = window.innerWidth, wh = window.innerHeight;
1325
+ var scale = Math.min(ww / sw, wh / sh);
1326
+ var ox = (ww - sw * scale) / 2, oy = (wh - sh * scale) / 2;
1327
+ slides.forEach(function(s) {
1328
+ s.style.transform = 'translate(' + ox + 'px,' + oy + 'px) scale(' + scale + ')';
1329
+ });
1330
+ }
1331
+ window.nextSlide = function() { if (current < total - 1) show(++current); };
1332
+ window.prevSlide = function() { if (current > 0) show(--current); };
1333
+ document.addEventListener('keydown', function(e) {
1334
+ if (e.key === 'ArrowRight' || e.key === ' ') { e.preventDefault(); nextSlide(); }
1335
+ if (e.key === 'ArrowLeft') { e.preventDefault(); prevSlide(); }
1336
+ if (e.key === 'Escape' || e.key === 'f' || e.key === 'F') {
1337
+ if (!document.fullscreenElement) document.documentElement.requestFullscreen();
1338
+ else document.exitFullscreen();
1339
+ }
1340
+ });
1341
+ window.addEventListener('resize', fitSlide);
1342
+ show(0);
1343
+ })();
1344
+ <\/script>
1345
+ </body>
1346
+ </html>`}function Mu(e,t,a,i){const r=a.backgroundColor??"#ffffff",s=a.textColor??"#000000";let l="";const c=e.background;if(c.type==="gradient"&&c.gradientStops){const u=c.gradientStops.map(g=>`${g.color} ${g.position*100}%`).join(", ");l=`background: linear-gradient(${c.gradientDirection??180}deg, ${u});`}else c.type==="image"&&c.imageUrl?l=`background: url('${c.imageUrl}') center/${c.imageFit??"cover"} no-repeat; background-color: ${c.color??r};`:l=`background: ${c.color??r};`;const d=e.elements.map(u=>$u(u,t,a)).join(`
1347
+ `);return`<div class="ndp-slide${i===0?" active":""}" style="${l} color: ${s};">
1348
+ ${d}
1349
+ </div>`}function $u(e,t,a){const{position:i}=e,r=i.x/100*t.width,s=i.y/100*t.height,l=i.width/100*t.width,c=i.height/100*t.height,d=e.rotation?`transform: rotate(${e.rotation}deg);`:"",u=e.opacity!==void 0?`opacity: ${e.opacity};`:"",g=`position: absolute; left: ${r}px; top: ${s}px; width: ${l}px; height: ${c}px; ${d} ${u}`,h=e.content;switch(h.kind??h.type){case"text":{const m=h,k=m.fontSize??16,b=m.fontColor??a.textColor??"#000",C=m.fontFamily??a.fontFamily??"sans-serif",_=m.fontWeight??"normal",f=m.textAlign??"left";return`<div class="ndp-element ndp-element-text" style="${g} font-size: ${k}px; color: ${b}; font-family: ${C}; font-weight: ${_}; text-align: ${f};">${$t(m.text)}</div>`}case"image":{const m=h;return`<div class="ndp-element" style="${g}"><img src="${$t(m.src)}" alt="${$t(m.alt??"")}" style="width:100%;height:100%;object-fit:${m.objectFit??"contain"};border-radius:${m.borderRadius??0}px;" /></div>`}case"code":{const m=h;return`<div class="ndp-element" style="${g} background: ${m.theme==="light"?"#f5f5f5":"#1e1e1e"}; color: ${m.theme==="light"?"#333":"#d4d4d4"}; padding: 16px; border-radius: 8px; overflow: auto; font-family: monospace; font-size: ${m.fontSize??14}px; white-space: pre;">${$t(m.code)}</div>`}case"shape":{const m=h,k=m.fill??"#ccc";return`<div class="ndp-element" style="${g} background: ${k}; border-radius: ${m.shapeType==="ellipse"?"50%":"0"}; border: ${m.strokeWidth??0}px solid ${m.stroke??"transparent"};"></div>`}default:return`<div class="ndp-element" style="${g}"></div>`}}function $t(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Eu(e){const t={x:20,y:20,width:60,height:40};switch(e){case"text":return{position:{x:10,y:30,width:80,height:20},content:{kind:"text",text:"New Text",fontSize:24,textAlign:"left"}};case"shape":return{position:{x:30,y:30,width:40,height:30},content:{kind:"shape",shapeType:"rectangle",fill:"#6366f1",stroke:"#4f46e5",strokeWidth:2}};case"code":return{position:{x:10,y:20,width:80,height:50},content:{kind:"code",code:`// Your code here
1350
+ console.log("Hello!");`,language:"typescript",theme:"dark"}};case"chart":return{position:t,content:{kind:"chart",chartType:"bar",data:{labels:["Q1","Q2","Q3","Q4"],series:[{name:"Revenue",values:[30,45,60,80],color:"#6366f1"}]}}};case"table":return{position:{x:10,y:20,width:80,height:40},content:{kind:"table",headers:["Name","Value","Status"],rows:[["Item A","100","Active"],["Item B","200","Pending"]],stripedRows:!0}};case"image":return{position:t,content:{kind:"image",src:"",alt:"Image",objectFit:"contain"}};case"diagram":return{position:t,content:{kind:"diagram",autoPlayAnimations:!1}};case"icon":return{position:{x:45,y:40,width:10,height:15},content:{kind:"icon",name:"star",size:48,color:"#6366f1"}};default:return{position:t,content:{kind:"text",text:e,fontSize:16}}}}const mr=({initialDocument:e,onChange:t,onExport:a,onPresent:i,lang:r="en",showToolbar:s=!0,showThumbnails:l=!0,showPropertyPanel:c=!0,className:d,style:u})=>{const g=Ua(e),[h,p]=o.useState(null),[m,k]=o.useState(!1),[b,C]=o.useState(5),_=o.useRef(g.document);g.document!==_.current&&(_.current=g.document,t==null||t(g.document));const f=g.currentSlide,v=o.useMemo(()=>h&&f?f.elements.find(x=>x.id===h)??null:null,[h,f]),j=o.useMemo(()=>Math.min(1,800/g.document.slideSize.width),[g.document.slideSize]),S=o.useCallback(x=>{if(!f)return;const{content:O,position:D}=Eu(x),F=g.addElement(f.id,{type:x,position:D,content:O});F&&p(F.id)},[f,g]),I=o.useCallback(x=>{g.addSlide(g.currentSlideIndex,x),g.setCurrentSlideIndex(g.currentSlideIndex+1)},[g]),M=o.useCallback(x=>{g.removeSlide(x),g.currentSlideIndex>=g.slides.length-1&&g.setCurrentSlideIndex(Math.max(0,g.slides.length-2))},[g]),w=o.useCallback((x,O,D)=>{if(!f)return;const F=f.elements.find(y=>y.id===x);F&&g.moveElement(f.id,x,{...F.position,x:O,y:D})},[f,g]),E=o.useCallback((x,O,D,F,y)=>{if(!f)return;const $=f.elements.find(z=>z.id===x);$&&g.moveElement(f.id,x,{...$.position,width:O,height:D,...F!=null?{x:F}:{},...y!=null?{y}:{}})},[f,g]),P=o.useCallback(()=>{if(!f||!h)return;const x=Math.max(0,...f.elements.map(O=>O.zIndex??0));g.updateElement(f.id,h,{zIndex:x+1})},[f,h,g]),L=o.useCallback(()=>{if(!f||!h)return;const x=Math.min(0,...f.elements.map(O=>O.zIndex??0));g.updateElement(f.id,h,{zIndex:x-1})},[f,h,g]),A=o.useCallback(x=>{const O=g.document;let D;switch(x){case"ndp":D=ur(O,!0);break;case"html":D=pr(O);break}a==null||a(x,D)},[g,a]),N=o.useCallback(()=>{i==null||i(g.document,g.currentSlideIndex)},[g,i]);return n.jsx(Ga,{lang:r,children:n.jsxs("div",{className:`nice-pres-editor ${d??""}`,style:{display:"flex",flexDirection:"column",height:"100%",...u},children:[s&&n.jsx(ca,{onAddElement:S,onAddSlide:I,onUndo:g.undo,onRedo:g.redo,canUndo:g.canUndo,canRedo:g.canRedo,onPresent:N,onExport:A}),s&&n.jsxs("div",{style:{display:"flex",gap:4,padding:"2px 8px",borderBottom:"1px solid #eee",alignItems:"center",fontSize:"0.85em"},children:[n.jsx(ve,{size:"sm",variant:m?"primary":"ghost",onClick:()=>k(x=>!x),children:"⊞ Grid"}),v&&n.jsxs(n.Fragment,{children:[n.jsx(ve,{size:"sm",variant:"ghost",onClick:P,title:"Bring to front",children:"↑ Front"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:L,title:"Send to back",children:"↓ Back"}),n.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>{if(f&&h){const x={...v,id:`el-${Date.now().toString(36)}`,position:{...v.position,x:v.position.x+3,y:v.position.y+3}};g.addElement(f.id,x)}},title:"Duplicate",children:"⧉ Duplicate"})]})]}),n.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[l&&n.jsx("div",{style:{width:200,borderRight:"1px solid #ddd",background:"#fafafa"},children:n.jsx(la,{slides:g.slides,slideSize:g.document.slideSize,theme:g.theme,currentIndex:g.currentSlideIndex,onSelectSlide:g.setCurrentSlideIndex,onAddSlide:()=>I(),onDuplicateSlide:x=>g.duplicateSlide(x),onRemoveSlide:M})}),n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",background:"#e8e8e8",overflow:"auto",padding:24},children:f&&n.jsx(ft,{slide:f,slideSize:g.document.slideSize,theme:g.theme,scale:j,selectedElementId:h,onSelectElement:p,onElementDrag:w,onElementResize:E,showGrid:m,gridSnap:b,interactive:!0})}),c&&n.jsx("div",{style:{width:260,borderLeft:"1px solid #ddd",overflowY:"auto"},children:n.jsx(da,{slide:f,selectedElement:v,onSlideChange:g.updateSlide,onElementChange:g.updateElement,onRemoveElement:g.removeElement})})]})]})})};mr.displayName="NicePresentationEditor";const Wa={linear:e=>e,easeIn:e=>e*e,easeOut:e=>e*(2-e),easeInOut:e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*.5)*Math.exp(-6*e),bounce:e=>{if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){const a=e-.5454545454545454;return 7.5625*a*a+.75}if(e<2.5/2.75){const a=e-.8181818181818182;return 7.5625*a*a+.9375}const t=e-2.625/2.75;return 7.5625*t*t+.984375}},Ut={opacity:1,transform:"",filter:"",visible:!0};function zu(e,t,a){if(!e)return{...Ut};const i=e.entrance;if(!i)return{...Ut};if((e.trigger==="onClick"||e.trigger==="afterPrevious")&&!a)return{...Ut,opacity:0,visible:!1};const r=i.delayMs??0,s=t-r;if(s<0)return{...Ut,opacity:0,visible:!1};const l=Math.min(s/i.durationMs,1),c=(Wa[i.easing??"linear"]??Wa.linear)(l);return Au(i.effect,c)}function Au(e,t){const a={opacity:1,transform:"",filter:"",visible:!0};switch(e){case"fadeIn":a.opacity=t;break;case"fadeOut":a.opacity=1-t;break;case"slideInLeft":a.transform=`translateX(${-100*(1-t)}%)`,a.opacity=t;break;case"slideInRight":a.transform=`translateX(${100*(1-t)}%)`,a.opacity=t;break;case"slideInTop":a.transform=`translateY(${-100*(1-t)}%)`,a.opacity=t;break;case"slideInBottom":a.transform=`translateY(${100*(1-t)}%)`,a.opacity=t;break;case"zoomIn":a.transform=`scale(${t})`,a.opacity=t;break;case"zoomOut":a.transform=`scale(${2-t})`,a.opacity=t;break;case"bounceIn":a.transform=`scale(${t>.8?1+.1*Math.sin((t-.8)/.2*Math.PI):t})`,a.opacity=t;break;case"flipInX":a.transform=`perspective(400px) rotateX(${90*(1-t)}deg)`,a.opacity=t;break;case"flipInY":a.transform=`perspective(400px) rotateY(${90*(1-t)}deg)`,a.opacity=t;break;case"rotateIn":a.transform=`rotate(${-180*(1-t)}deg) scale(${t})`,a.opacity=t;break;case"typewriter":a.opacity=t>0?1:0;break;case"wipeLeft":a.transform=`scaleX(${t})`,a.opacity=1;break;case"wipeRight":a.transform=`scaleX(${t})`,a.opacity=1;break;case"splitReveal":a.transform=`scaleY(${t})`,a.opacity=1;break;case"pulse":a.transform=`scale(${1+.05*Math.sin(t*Math.PI*4)})`;break;case"shake":a.transform=`translateX(${5*Math.sin(t*Math.PI*8)*(1-t)}px)`;break;case"glow":a.filter=`drop-shadow(0 0 ${8*t}px gold)`;break}return a}function hr(e,t,a="left"){const i={},r={};switch(e){case"fade":i.opacity=1-t,r.opacity=t;break;case"slide":{const s=a==="right"||a==="down"?-1:1,l=a==="up"||a==="down"?"Y":"X";i.transform=`translate${l}(${-s*t*100}%)`,r.transform=`translate${l}(${s*(1-t)*100}%)`;break}case"zoom":i.transform=`scale(${1-t*.3})`,i.opacity=1-t,r.transform=`scale(${.7+t*.3})`,r.opacity=t;break;case"flip":i.transform=`perspective(1000px) rotateY(${t*90}deg)`,i.opacity=t>.5?0:1,r.transform=`perspective(1000px) rotateY(${(1-t)*-90}deg)`,r.opacity=t>.5?1:0;break;default:i.opacity=1-t,r.opacity=t;break}return{outgoing:i,incoming:r}}const Fu={width:1920,height:1080},Iu={width:1024,height:768},Du={width:2560,height:1440},fr={name:"Corporate",backgroundColor:"#ffffff",primaryColor:"#1a365d",secondaryColor:"#2b6cb0",accentColor:"#ed8936",textColor:"#2d3748",headingColor:"#1a365d",fontFamily:'"Segoe UI", Roboto, sans-serif',headingFontFamily:'"Segoe UI", Roboto, sans-serif',codeFontFamily:'"Cascadia Code", "Fira Code", monospace'},Tu={name:"Modern Dark",backgroundColor:"#1a1a2e",primaryColor:"#e94560",secondaryColor:"#0f3460",accentColor:"#16213e",textColor:"#e0e0e0",headingColor:"#ffffff",fontFamily:"Inter, sans-serif",headingFontFamily:"Inter, sans-serif",codeFontFamily:'"JetBrains Mono", monospace'},Ru={name:"Minimal",backgroundColor:"#fafafa",primaryColor:"#333333",secondaryColor:"#666666",accentColor:"#2196f3",textColor:"#333333",headingColor:"#111111",fontFamily:'"Helvetica Neue", Arial, sans-serif',codeFontFamily:'"SF Mono", monospace'},Pu={name:"NiceToDev",backgroundColor:"#f8f9fa",primaryColor:"#6366f1",secondaryColor:"#8b5cf6",accentColor:"#06b6d4",textColor:"#334155",headingColor:"#1e293b",fontFamily:"Inter, sans-serif",headingFontFamily:'"Plus Jakarta Sans", Inter, sans-serif',codeFontFamily:'"Fira Code", monospace'},Bu=500,gr=({document:e,startSlide:t=0,onExit:a,autoAdvanceMs:i=0,showNotes:r=!1,showSlideNumber:s=!0,showProgressBar:l=!0,showTimer:c=!1,enableTouch:d=!0,className:u})=>{const[g,h]=o.useState(t),[p,m]=o.useState(0),[k,b]=o.useState(!1),[C,_]=o.useState(0),[f,v]=o.useState(null),[j,S]=o.useState(!1),[I,M]=o.useState(0),w=o.useRef(null),E=o.useRef(0),P=o.useRef(null),L=o.useRef(null),A=e.slides,N=A[g]??null,x=f!==null?A[f]??null:null,O=e.theme??fr,D=e.slideSize,F=A.length,y=o.useMemo(()=>{if(!N)return 0;const Q=N.elements.filter(J=>{var ee;return(ee=J.animation)==null?void 0:ee.entrance}).map(J=>{var ee;return((ee=J.animation)==null?void 0:ee.buildOrder)??0});return Q.length>0?Math.max(...Q)+1:0},[N]),$=o.useCallback(Q=>{var ue,fe;if(Q<0||Q>=F||Q===g||k)return;const J=A[Q];if((((ue=J==null?void 0:J.transition)==null?void 0:ue.effect)??"none")==="none"){v(null),h(Q),m(0);return}v(g),h(Q),m(0),b(!0);const ie=((fe=J==null?void 0:J.transition)==null?void 0:fe.durationMs)??Bu,pe=performance.now(),te=ae=>{const he=Math.min(1,(ae-pe)/ie);_(he),he<1?E.current=requestAnimationFrame(te):(b(!1),v(null))};E.current=requestAnimationFrame(te)},[g,F,k,A]),z=o.useCallback(()=>{if(p<y){m(Q=>Q+1);return}g<F-1&&$(g+1)},[p,y,g,F,$]),R=o.useCallback(()=>{if(p>0){m(Q=>Q-1);return}g>0&&$(g-1)},[p,g,$]);o.useEffect(()=>{const Q=J=>{switch(J.key){case"ArrowRight":case"ArrowDown":case" ":case"Enter":J.preventDefault(),z();break;case"ArrowLeft":case"ArrowUp":case"Backspace":J.preventDefault(),R();break;case"Escape":J.preventDefault(),a==null||a();break;case"Home":J.preventDefault(),$(0);break;case"End":J.preventDefault(),$(F-1);break}};return window.addEventListener("keydown",Q),()=>window.removeEventListener("keydown",Q)},[z,R,a,$,F]);const T=o.useCallback(Q=>{if(!d)return;const J=Q.touches[0];P.current={x:J.clientX,y:J.clientY,time:Date.now()}},[d]),B=o.useCallback(Q=>{if(!d||!P.current)return;const J=Q.changedTouches[0],ee=J.clientX-P.current.x,ie=J.clientY-P.current.y,pe=Date.now()-P.current.time;if(P.current=null,pe>500||Math.abs(ee)<30&&Math.abs(ie)<30){z();return}Math.abs(ee)>Math.abs(ie)&&(ee<-30?z():ee>30&&R())},[d,z,R]);o.useEffect(()=>{if(c)return L.current=setInterval(()=>M(Q=>Q+1e3),1e3),()=>{L.current&&clearInterval(L.current)}},[c]);const V=Q=>{const J=Math.floor(Q/1e3),ee=Math.floor(J/60),ie=Math.floor(ee/60);return ie>0?`${ie}:${String(ee%60).padStart(2,"0")}:${String(J%60).padStart(2,"0")}`:`${ee}:${String(J%60).padStart(2,"0")}`};o.useEffect(()=>{const Q=J=>{(J.key==="g"||J.key==="G")&&S(ee=>!ee)};return window.addEventListener("keydown",Q),()=>window.removeEventListener("keydown",Q)},[]),o.useEffect(()=>{if(i<=0||k)return;const Q=setTimeout(z,i);return()=>clearTimeout(Q)},[i,z,k,g,p]),o.useEffect(()=>{var J;const Q=w.current;return Q&&!window.document.fullscreenElement&&((J=Q.requestFullscreen)==null||J.call(Q).catch(()=>{})),()=>{var ee,ie;window.document.fullscreenElement&&((ie=(ee=window.document).exitFullscreen)==null||ie.call(ee).catch(()=>{})),E.current&&cancelAnimationFrame(E.current)}},[]);const K=o.useMemo(()=>N?N.elements.filter(Q=>{var ee;return(ee=Q.animation)!=null&&ee.entrance?(Q.animation.buildOrder??0)<=p:!0}):[],[N,p]),H=o.useMemo(()=>{if(!k||!N)return{outgoing:{},incoming:{}};const Q=N.transition??{effect:"fade"};return hr(Q.effect,C,Q.direction)},[k,N,C]),[q,Z]=o.useState(1);return o.useEffect(()=>{const Q=()=>{const J=window.innerWidth,ee=window.innerHeight,ie=D.width,pe=D.height;Z(Math.min(J/ie,ee/pe))};return Q(),window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},[D]),n.jsxs("div",{ref:w,className:`nice-pres-player ${u??""}`,style:{position:"fixed",inset:0,background:"#000",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",cursor:"none",zIndex:9999},onClick:z,onContextMenu:Q=>{Q.preventDefault(),R()},onTouchStart:T,onTouchEnd:B,children:[j&&n.jsx("div",{style:{position:"absolute",inset:0,zIndex:100,background:"rgba(0,0,0,0.9)",overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))",gap:16,padding:24,alignContent:"start"},onClick:Q=>Q.stopPropagation(),children:A.map((Q,J)=>n.jsxs("div",{style:{cursor:"pointer",border:J===g?"3px solid #2196f3":"2px solid transparent",borderRadius:4,overflow:"hidden"},onClick:()=>{$(J),S(!1)},children:[n.jsx(ft,{slide:Q,slideSize:D,theme:O,scale:240/D.width,interactive:!1}),n.jsxs("div",{style:{color:"#fff",fontSize:12,textAlign:"center",padding:4},children:[J+1,". ",Q.title]})]},Q.id))}),k&&x&&n.jsx("div",{style:{position:"absolute",...H.outgoing},children:n.jsx(ft,{slide:x,slideSize:D,theme:O,scale:q,interactive:!1})}),N&&n.jsx("div",{style:{position:"absolute",...k?H.incoming:{}},children:n.jsx(ft,{slide:{...N,elements:K},slideSize:D,theme:O,scale:q,interactive:!1})}),s&&n.jsxs("div",{style:{position:"absolute",bottom:12,right:20,color:"rgba(255,255,255,0.5)",fontSize:14,fontFamily:"sans-serif",pointerEvents:"none"},children:[g+1," / ",F]}),r&&(N==null?void 0:N.notes)&&n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"rgba(0,0,0,0.8)",color:"#fff",padding:"12px 24px",fontSize:14,fontFamily:"sans-serif",maxHeight:"20vh",overflowY:"auto",pointerEvents:"none"},children:N.notes}),l&&n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:3,background:"rgba(255,255,255,0.15)",pointerEvents:"none",zIndex:50},children:n.jsx("div",{style:{height:"100%",width:`${(g+1)/F*100}%`,background:"#2196f3",transition:"width 0.3s ease"}})}),c&&n.jsx("div",{style:{position:"absolute",top:12,right:20,color:"rgba(255,255,255,0.5)",fontSize:14,fontFamily:"monospace",pointerEvents:"none",zIndex:50},children:V(I)}),n.jsxs("div",{className:"nice-pres-player-controls",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,opacity:.3},onMouseEnter:Q=>{Q.currentTarget.style.opacity="0.9",Q.currentTarget.style.cursor="pointer"},onMouseLeave:Q=>{Q.currentTarget.style.opacity="0.3"},children:[n.jsx(ve,{variant:"ghost",size:"sm",onClick:Q=>{Q.stopPropagation(),R()},style:{background:"rgba(255,255,255,0.15)",color:"#fff",padding:"6px 14px",borderRadius:4,fontSize:16},title:"Previous",children:"◀"}),n.jsx(ve,{variant:"ghost",size:"sm",onClick:Q=>{Q.stopPropagation(),z()},style:{background:"rgba(255,255,255,0.15)",color:"#fff",padding:"6px 14px",borderRadius:4,fontSize:16},title:"Next",children:"▶"}),n.jsx(ve,{variant:"ghost",size:"sm",onClick:Q=>{Q.stopPropagation(),a==null||a()},style:{background:"rgba(255,255,255,0.15)",color:"#fff",padding:"6px 14px",borderRadius:4,fontSize:14},title:"Exit (Esc)",children:"✕"}),n.jsx(ve,{variant:"ghost",size:"sm",onClick:Q=>{Q.stopPropagation(),S(J=>!J)},style:{background:"rgba(255,255,255,0.15)",color:"#fff",padding:"6px 14px",borderRadius:4,fontSize:14},title:"Overview (G)",children:"⊞"})]})]})};gr.displayName="NicePresentationPlayer";const Lu="_interactiveElement_1mfsb_13",Ou="_interactiveButton_1mfsb_27",Hu="_disabled_1mfsb_57",Wu="_variant_primary_1mfsb_87",qu="_variant_secondary_1mfsb_97",Vu="_variant_outline_1mfsb_107",Ku="_variant_ghost_1mfsb_119",Uu="_size_small_1mfsb_139",Yu="_size_medium_1mfsb_149",Zu="_size_large_1mfsb_159",Gu="_buttonIcon_1mfsb_169",Xu="_buttonLabel_1mfsb_177",Qu="_interactivePoll_1mfsb_189",Ju="_pollQuestion_1mfsb_209",ep="_pollOptions_1mfsb_223",tp="_pollOption_1mfsb_223",np="_pollOptionDisabled_1mfsb_261",ap="_pollOptionSelected_1mfsb_271",ip="_pollOptionContent_1mfsb_289",rp="_pollOptionIcon_1mfsb_305",op="_pollOptionText_1mfsb_313",sp="_pollCheckbox_1mfsb_321",lp="_pollResultBar_1mfsb_331",cp="_pollResultFill_1mfsb_353",dp="_pollResultPercent_1mfsb_365",up="_pollResultCount_1mfsb_381",pp="_pollSubmitBtn_1mfsb_395",mp="_pollTotalVotes_1mfsb_431",hp="_pollVotedMessage_1mfsb_443",fp="_interactiveQuiz_1mfsb_485",gp="_quizHeader_1mfsb_505",yp="_quizQuestion_1mfsb_519",bp="_quizTimer_1mfsb_537",xp="_quizTimerWarning_1mfsb_555",vp="_timerPulse_1mfsb_1",wp="_quizPoints_1mfsb_577",kp="_quizAnswers_1mfsb_595",Sp="_quizAnswer_1mfsb_595",Cp="_quizAnswerDisabled_1mfsb_633",_p="_quizAnswerSelected_1mfsb_643",jp="_quizAnswerCorrect_1mfsb_661",Np="_quizAnswerIncorrect_1mfsb_671",Mp="_quizAnswerMarker_1mfsb_681",$p="_quizAnswerText_1mfsb_691",Ep="_quizCorrectMark_1mfsb_703",zp="_quizIncorrectMark_1mfsb_715",Ap="_quizSubmitBtn_1mfsb_727",Fp="_quizFeedback_1mfsb_775",Ip="_quizFeedbackMessage_1mfsb_783",Dp="_quizFeedbackCorrect_1mfsb_797",Tp="_quizFeedbackIncorrect_1mfsb_807",Rp="_quizExplanation_1mfsb_817",Pp="_interactiveCountdown_1mfsb_841",Bp="_countdownWarning_1mfsb_857",Lp="_countdownPulse_1mfsb_1",Op="_countdownComplete_1mfsb_875",Hp="_countdownDigital_1mfsb_885",Wp="_countdownSeparator_1mfsb_903",qp="_countdownDigit_1mfsb_885",Vp="_countdownCircular_1mfsb_923",Kp="_countdownCircleSvg_1mfsb_935",Up="_countdownProgressRing_1mfsb_947",Yp="_countdownCircleText_1mfsb_955",Zp="_countdownLargeSeconds_1mfsb_975",Gp="_countdownFlip_1mfsb_985",Xp="_flipCardContainer_1mfsb_997",Qp="_flipCard_1mfsb_997",Jp="_flipLabel_1mfsb_1033",em="_flipSeparator_1mfsb_1047",tm="_countdownMinimal_1mfsb_1063",nm="_countdownCompleteMessage_1mfsb_1075",am="_interactiveQnA_1mfsb_1093",im="_qnaHeader_1mfsb_1117",rm="_qnaTitle_1mfsb_1133",om="_qnaCount_1mfsb_1147",sm="_qnaInputForm_1mfsb_1157",lm="_qnaInputWrapper_1mfsb_1169",cm="_qnaInput_1mfsb_1157",dm="_qnaCharCount_1mfsb_1219",um="_qnaInputActions_1mfsb_1235",pm="_qnaAnonymousToggle_1mfsb_1249",mm="_qnaSubmitBtn_1mfsb_1279",hm="_qnaClosedMessage_1mfsb_1321",fm="_qnaQuestionsList_1mfsb_1339",gm="_qnaQuestion_1mfsb_1339",ym="_qnaQuestionAnswered_1mfsb_1381",bm="_qnaQuestionContent_1mfsb_1391",xm="_qnaQuestionText_1mfsb_1405",vm="_qnaQuestionMeta_1mfsb_1417",wm="_qnaAuthor_1mfsb_1431",km="_qnaQuestionActions_1mfsb_1439",Sm="_qnaUpvoteBtn_1mfsb_1453",Cm="_qnaUpvoted_1mfsb_1489",_m="_qnaUpvoteIcon_1mfsb_1509",jm="_qnaUpvoteCount_1mfsb_1517",Nm="_qnaAnsweredBtn_1mfsb_1527",Mm="_qnaMarkedAnswered_1mfsb_1555",$m="_qnaEmptyState_1mfsb_1567",Em="_qnaMoreQuestions_1mfsb_1581",zm="_qnaStyle_stack_1mfsb_1599",Am="_qnaStyle_floating_1mfsb_1609",me={interactiveElement:Lu,interactiveButton:Ou,disabled:Hu,variant_primary:Wu,variant_secondary:qu,variant_outline:Vu,variant_ghost:Ku,size_small:Uu,size_medium:Yu,size_large:Zu,buttonIcon:Gu,buttonLabel:Xu,interactivePoll:Qu,pollQuestion:Ju,pollOptions:ep,pollOption:tp,pollOptionDisabled:np,pollOptionSelected:ap,pollOptionContent:ip,pollOptionIcon:rp,pollOptionText:op,pollCheckbox:sp,pollResultBar:lp,pollResultFill:cp,pollResultPercent:dp,pollResultCount:up,pollSubmitBtn:pp,pollTotalVotes:mp,pollVotedMessage:hp,"pollStyle_horizontal-bar":"_pollStyle_horizontal-bar_1mfsb_463",interactiveQuiz:fp,quizHeader:gp,quizQuestion:yp,quizTimer:bp,quizTimerWarning:xp,timerPulse:vp,quizPoints:wp,quizAnswers:kp,quizAnswer:Sp,quizAnswerDisabled:Cp,quizAnswerSelected:_p,quizAnswerCorrect:jp,quizAnswerIncorrect:Np,quizAnswerMarker:Mp,quizAnswerText:$p,quizCorrectMark:Ep,quizIncorrectMark:zp,quizSubmitBtn:Ap,quizFeedback:Fp,quizFeedbackMessage:Ip,quizFeedbackCorrect:Dp,quizFeedbackIncorrect:Tp,quizExplanation:Rp,interactiveCountdown:Pp,countdownWarning:Bp,countdownPulse:Lp,countdownComplete:Op,countdownDigital:Hp,countdownSeparator:Wp,countdownDigit:qp,countdownCircular:Vp,countdownCircleSvg:Kp,countdownProgressRing:Up,countdownCircleText:Yp,countdownLargeSeconds:Zp,countdownFlip:Gp,flipCardContainer:Xp,flipCard:Qp,flipLabel:Jp,flipSeparator:em,countdownMinimal:tm,countdownCompleteMessage:nm,interactiveQnA:am,qnaHeader:im,qnaTitle:rm,qnaCount:om,qnaInputForm:sm,qnaInputWrapper:lm,qnaInput:cm,qnaCharCount:dm,qnaInputActions:um,qnaAnonymousToggle:pm,qnaSubmitBtn:mm,qnaClosedMessage:hm,qnaQuestionsList:fm,qnaQuestion:gm,qnaQuestionAnswered:ym,qnaQuestionContent:bm,qnaQuestionText:xm,qnaQuestionMeta:vm,qnaAuthor:wm,qnaQuestionActions:km,qnaUpvoteBtn:Sm,qnaUpvoted:Cm,qnaUpvoteIcon:_m,qnaUpvoteCount:jm,qnaAnsweredBtn:Nm,qnaMarkedAnswered:Mm,qnaEmptyState:$m,qnaMoreQuestions:Em,qnaStyle_stack:zm,qnaStyle_floating:Am},Fm=({content:e,onAction:t,disabled:a=!1,className:i,theme:r})=>{const{label:s,action:l,variant:c="primary",size:d="medium",icon:u,iconPosition:g="left",backgroundColor:h,textColor:p,borderRadius:m}=e,k=o.useCallback(()=>{if(!a){if(l.type==="openUrl"){const{url:f,newTab:v=!0}=l;v?window.open(f,"_blank","noopener,noreferrer"):window.location.href=f}t==null||t(l)}},[l,a,t]),b={backgroundColor:h??(c==="primary"?r==null?void 0:r.primaryColor:void 0),color:p,borderRadius:m!==void 0?`${m}px`:void 0,fontFamily:r==null?void 0:r.fontFamily},C=[me.interactiveButton,me[`variant_${c}`],me[`size_${d}`],a?me.disabled:"",i??""].filter(Boolean).join(" "),_=()=>u?n.jsx("span",{className:me.buttonIcon,children:Im(u)}):null;return n.jsxs("button",{className:C,style:b,onClick:k,disabled:a,type:"button",children:[g==="left"&&_(),n.jsx("span",{className:me.buttonLabel,children:s}),g==="right"&&_()]})};function Im(e){return{"arrow-right":"→","arrow-left":"←",play:"▶",pause:"⏸",stop:"⏹",link:"🔗",external:"↗",check:"✓",close:"✕",info:"ℹ",question:"?",star:"★",heart:"♥",download:"⬇",upload:"⬆",share:"↗",copy:"📋",edit:"✏",delete:"🗑",refresh:"↻"}[e]??e}const Dm=({content:e,onVote:t,onResultsUpdate:a,votingClosed:i=!1,userVote:r,className:s,theme:l})=>{const{question:c,options:d,multiSelect:u=!1,showResultsAfterVote:g=!0,liveResults:h=!1,displayStyle:p="buttons",resultColors:m,results:k={}}=e,[b,C]=o.useState(r??[]),[_,f]=o.useState(!!(r!=null&&r.length)),[v,j]=o.useState(k),S=o.useMemo(()=>Object.values(v).reduce((A,N)=>A+N,0),[v]),I=[(l==null?void 0:l.primaryColor)??"#6366f1","#8b5cf6","#06b6d4","#10b981","#f59e0b","#ef4444"],M=m??I,w=o.useCallback(A=>{_||i||C(N=>u?N.includes(A)?N.filter(x=>x!==A):[...N,A]:[A])},[_,i,u]),E=o.useCallback(()=>{if(b.length===0||_)return;const A={...v};b.forEach(N=>{A[N]=(A[N]??0)+1}),j(A),f(!0),t==null||t(b),a==null||a(A)},[b,_,v,t,a]),P=h||g&&_,L=(A,N)=>{const x=b.includes(A.id),O=v[A.id]??0,D=S>0?O/S*100:0,F=A.color??M[N%M.length],y=[me.pollOption,me[`pollStyle_${p}`],x?me.pollOptionSelected:"",_||i?me.pollOptionDisabled:""].filter(Boolean).join(" ");return n.jsxs("button",{className:y,onClick:()=>w(A.id),disabled:_||i,type:"button",style:{"--poll-option-color":F,fontFamily:l==null?void 0:l.fontFamily},children:[n.jsxs("div",{className:me.pollOptionContent,children:[A.icon&&n.jsx("span",{className:me.pollOptionIcon,children:A.icon}),n.jsx("span",{className:me.pollOptionText,children:A.text}),u&&!_&&n.jsx("span",{className:me.pollCheckbox,children:x?"☑":"☐"})]}),P&&n.jsxs("div",{className:me.pollResultBar,children:[n.jsx("div",{className:me.pollResultFill,style:{width:`${D}%`,backgroundColor:F}}),n.jsxs("span",{className:me.pollResultPercent,children:[D.toFixed(0),"%"]}),n.jsxs("span",{className:me.pollResultCount,children:["(",O,")"]})]})]},A.id)};return n.jsxs("div",{className:`${me.interactivePoll} ${s??""}`,children:[n.jsx("h3",{className:me.pollQuestion,style:{fontFamily:l==null?void 0:l.fontFamily},children:c}),n.jsx("div",{className:me.pollOptions,children:d.map((A,N)=>L(A,N))}),!_&&!i&&b.length>0&&n.jsx("button",{className:me.pollSubmitBtn,onClick:E,style:{backgroundColor:l==null?void 0:l.primaryColor,fontFamily:l==null?void 0:l.fontFamily},children:"Oddaj głos"}),P&&S>0&&n.jsxs("div",{className:me.pollTotalVotes,children:["Łącznie głosów: ",S]}),_&&n.jsx("div",{className:me.pollVotedMessage,children:"✓ Dziękujemy za głos!"})]})},Tm=({content:e,onSubmit:t,locked:a=!1,className:i,theme:r})=>{const{question:s,answers:l,quizType:c="single",showCorrectAfterSubmit:d=!0,timeLimitSeconds:u=0,points:g=10,correctFeedback:h="Poprawna odpowiedź! 🎉",incorrectFeedback:p="Niestety, to nie jest poprawna odpowiedź.",explanation:m}=e,[k,b]=o.useState([]),[C,_]=o.useState(!1),[f,v]=o.useState(!1),[j,S]=o.useState(u),I=o.useRef(null);o.useEffect(()=>{if(u>0&&!C&&!a)return S(u),I.current=setInterval(()=>{S(L=>L<=1?(clearInterval(I.current),0):L-1)},1e3),()=>{I.current&&clearInterval(I.current)}},[u,C,a]),o.useEffect(()=>{j===0&&u>0&&!C&&w()},[j,u,C]);const M=o.useCallback(L=>{C||a||b(A=>c==="single"||c==="true-false"?[L]:A.includes(L)?A.filter(N=>N!==L):[...A,L])},[C,a,c]),w=o.useCallback(()=>{if(C||k.length===0)return;I.current&&clearInterval(I.current);const L=l.filter(D=>D.isCorrect).map(D=>D.id),A=new Set(k),N=new Set(L),x=A.size===N.size&&[...A].every(D=>N.has(D));v(x),_(!0);const O=x?g:0;t==null||t(k,x,O)},[C,k,l,g,t]),E=L=>{const A=Math.floor(L/60),N=L%60;return A>0?`${A}:${N.toString().padStart(2,"0")}`:`${N}s`},P=L=>{const A=k.includes(L.id),N=C&&d,x=[me.quizAnswer,A?me.quizAnswerSelected:"",C?me.quizAnswerDisabled:"",N&&L.isCorrect?me.quizAnswerCorrect:"",N&&A&&!L.isCorrect?me.quizAnswerIncorrect:""].filter(Boolean).join(" ");return n.jsxs("button",{className:x,onClick:()=>M(L.id),disabled:C||a,type:"button",style:{fontFamily:r==null?void 0:r.fontFamily},children:[n.jsxs("span",{className:me.quizAnswerMarker,children:[c==="multiple"&&(A?"☑":"☐"),(c==="single"||c==="true-false")&&(A?"●":"○")]}),n.jsx("span",{className:me.quizAnswerText,children:L.text}),N&&L.isCorrect&&n.jsx("span",{className:me.quizCorrectMark,children:"✓"}),N&&A&&!L.isCorrect&&n.jsx("span",{className:me.quizIncorrectMark,children:"✗"})]},L.id)};return n.jsxs("div",{className:`${me.interactiveQuiz} ${i??""}`,children:[n.jsxs("div",{className:me.quizHeader,children:[n.jsx("h3",{className:me.quizQuestion,style:{fontFamily:r==null?void 0:r.fontFamily},children:s}),u>0&&!C&&n.jsxs("div",{className:`${me.quizTimer} ${j<=10?me.quizTimerWarning:""}`,children:["⏱ ",E(j)]}),g>0&&n.jsx("div",{className:me.quizPoints,children:C?f?`+${g} pkt`:"0 pkt":`${g} pkt`})]}),n.jsx("div",{className:me.quizAnswers,children:l.map(P)}),!C&&!a&&k.length>0&&n.jsx("button",{className:me.quizSubmitBtn,onClick:w,style:{backgroundColor:r==null?void 0:r.primaryColor,fontFamily:r==null?void 0:r.fontFamily},children:"Zatwierdź odpowiedź"}),C&&d&&n.jsxs("div",{className:me.quizFeedback,children:[n.jsx("div",{className:`${me.quizFeedbackMessage} ${f?me.quizFeedbackCorrect:me.quizFeedbackIncorrect}`,children:f?h:p}),m&&n.jsxs("div",{className:me.quizExplanation,children:[n.jsx("strong",{children:"Wyjaśnienie:"})," ",m]})]})]})},Rm=({content:e,onComplete:t,paused:a=!1,className:i,theme:r})=>{const{target:s,format:l="mm:ss",style:c="digital",showLabels:d=!0,onComplete:u,textColor:g,backgroundColor:h,warningThreshold:p=10,warningColor:m="#ef4444"}=e,[k,b]=o.useState(()=>{if(typeof s=="number")return s;const A=new Date(s),N=new Date;return Math.max(0,Math.floor((A.getTime()-N.getTime())/1e3))}),[C,_]=o.useState(!1),f=o.useRef(null);o.useEffect(()=>{if(a||C){f.current&&(clearInterval(f.current),f.current=null);return}return f.current=setInterval(()=>{b(A=>A<=1?(clearInterval(f.current),_(!0),0):A-1)},1e3),()=>{f.current&&clearInterval(f.current)}},[a,C]),o.useEffect(()=>{C&&(t==null||t(u))},[C,t,u]);const v=o.useMemo(()=>{const A=Math.floor(k/3600),N=Math.floor(k%3600/60),x=k%60;return{hours:A,minutes:N,seconds:x}},[k]),j=k<=p&&k>0,S=(A,N=2)=>A.toString().padStart(N,"0"),I=()=>{const{hours:A,minutes:N,seconds:x}=v;let O=[];return l==="hh:mm:ss"||A>0?O=[S(A),S(N),S(x)]:l==="mm:ss"?O=[S(N),S(x)]:O=[x.toString()],n.jsx("div",{className:me.countdownDigital,children:O.map((D,F)=>n.jsxs(o.Fragment,{children:[F>0&&n.jsx("span",{className:me.countdownSeparator,children:":"}),n.jsx("span",{className:me.countdownDigit,children:D})]},F))})},M=()=>{const{hours:A,minutes:N,seconds:x}=v,O=typeof s=="number"?s:k,D=O>0?k/O:0,F=2*Math.PI*45;return n.jsxs("div",{className:me.countdownCircular,children:[n.jsxs("svg",{viewBox:"0 0 100 100",className:me.countdownCircleSvg,children:[n.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"currentColor",strokeWidth:"8",opacity:"0.2"}),n.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:j?m:g??(r==null?void 0:r.primaryColor)??"#6366f1",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:F,strokeDashoffset:F*(1-D),transform:"rotate(-90 50 50)",className:me.countdownProgressRing})]}),n.jsx("div",{className:me.countdownCircleText,children:l!=="ss"?n.jsxs(n.Fragment,{children:[A>0&&n.jsxs("span",{children:[S(A),":"]}),n.jsxs("span",{children:[S(N),":"]}),n.jsx("span",{children:S(x)})]}):n.jsx("span",{className:me.countdownLargeSeconds,children:x})})]})},w=()=>{const{hours:A,minutes:N,seconds:x}=v,O=(D,F)=>n.jsxs("div",{className:me.flipCardContainer,children:[n.jsx("div",{className:me.flipCard,children:n.jsx("span",{children:D})}),d&&n.jsx("span",{className:me.flipLabel,children:F})]});return n.jsxs("div",{className:me.countdownFlip,children:[(l==="hh:mm:ss"||A>0)&&n.jsxs(n.Fragment,{children:[O(S(A),"godz."),n.jsx("span",{className:me.flipSeparator,children:":"})]}),l!=="ss"&&n.jsxs(n.Fragment,{children:[O(S(N),"min."),n.jsx("span",{className:me.flipSeparator,children:":"})]}),O(S(x),"sek.")]})},E=()=>{const{hours:A,minutes:N,seconds:x}=v;if(l==="ss")return n.jsxs("span",{className:me.countdownMinimal,children:[x,"s"]});let O="";return A>0&&(O+=`${A}h `),(N>0||A>0)&&(O+=`${N}m `),O+=`${x}s`,n.jsx("span",{className:me.countdownMinimal,children:O.trim()})},P={color:j?m:g,backgroundColor:h,fontFamily:r==null?void 0:r.fontFamily},L=[me.interactiveCountdown,me[`countdownStyle_${c}`],j?me.countdownWarning:"",C?me.countdownComplete:"",i??""].filter(Boolean).join(" ");return n.jsxs("div",{className:L,style:P,children:[c==="digital"&&I(),c==="circular"&&M(),c==="flip"&&w(),c==="minimal"&&E(),C&&n.jsx("div",{className:me.countdownCompleteMessage,children:"⏰ Czas minął!"})]})},Pm=({content:e,userName:t,onSubmitQuestion:a,onUpvote:i,onMarkAnswered:r,submissionClosed:s=!1,isModerator:l=!1,upvotedQuestions:c=[],className:d,theme:u})=>{const{placeholder:g="Zadaj pytanie...",allowAnonymous:h=!0,moderated:p=!1,allowUpvote:m=!0,maxVisible:k=10,displayStyle:b="list",charLimit:C=500,questions:_=[]}=e,[f,v]=o.useState(_),[j,S]=o.useState(""),[I,M]=o.useState(!1),[w,E]=o.useState(new Set(c)),P=o.useMemo(()=>[...f].filter(F=>!p||F.answered||l).sort((F,y)=>y.upvotes!==F.upvotes?y.upvotes-F.upvotes:new Date(y.timestamp).getTime()-new Date(F.timestamp).getTime()).slice(0,k),[f,p,l,k]),L=o.useCallback(F=>{F.preventDefault();const y=j.trim();if(!y||s)return;const $={id:`q_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,text:y,author:I||!t?void 0:t,timestamp:new Date().toISOString(),upvotes:0,answered:!1};v(z=>[$,...z]),S(""),a==null||a({text:$.text,author:$.author,answered:!1})},[j,s,I,t,a]),A=o.useCallback(F=>{!m||w.has(F)||(v(y=>y.map($=>$.id===F?{...$,upvotes:$.upvotes+1}:$)),E(y=>new Set(y).add(F)),i==null||i(F))},[m,w,i]),N=o.useCallback(F=>{l&&(v(y=>y.map($=>$.id===F?{...$,answered:!$.answered}:$)),r==null||r(F))},[l,r]),x=()=>n.jsxs("form",{className:me.qnaInputForm,onSubmit:L,children:[n.jsxs("div",{className:me.qnaInputWrapper,children:[n.jsx("textarea",{className:me.qnaInput,placeholder:g,value:j,onChange:F=>S(F.target.value.slice(0,C)),disabled:s,rows:2,style:{fontFamily:u==null?void 0:u.fontFamily}}),n.jsxs("span",{className:me.qnaCharCount,children:[j.length,"/",C]})]}),n.jsxs("div",{className:me.qnaInputActions,children:[h&&n.jsxs("label",{className:me.qnaAnonymousToggle,children:[n.jsx("input",{type:"checkbox",checked:I,onChange:F=>M(F.target.checked)}),n.jsx("span",{children:"Anonimowo"})]}),n.jsx("button",{type:"submit",className:me.qnaSubmitBtn,disabled:!j.trim()||s,style:{backgroundColor:u==null?void 0:u.primaryColor,fontFamily:u==null?void 0:u.fontFamily},children:"Wyślij pytanie"})]})]}),O=F=>{const y=w.has(F.id);return n.jsxs("div",{className:`${me.qnaQuestion} ${F.answered?me.qnaQuestionAnswered:""}`,children:[n.jsxs("div",{className:me.qnaQuestionContent,children:[n.jsx("span",{className:me.qnaQuestionText,style:{fontFamily:u==null?void 0:u.fontFamily},children:F.text}),n.jsxs("div",{className:me.qnaQuestionMeta,children:[n.jsx("span",{className:me.qnaAuthor,children:F.author?`@${F.author}`:"👤 Anonim"}),n.jsx("span",{className:me.qnaTimestamp,children:Bm(F.timestamp)})]})]}),n.jsxs("div",{className:me.qnaQuestionActions,children:[m&&n.jsxs("button",{className:`${me.qnaUpvoteBtn} ${y?me.qnaUpvoted:""}`,onClick:()=>A(F.id),disabled:y,title:y?"Już zagłosowałeś":"Zagłosuj",children:[n.jsx("span",{className:me.qnaUpvoteIcon,children:"▲"}),n.jsx("span",{className:me.qnaUpvoteCount,children:F.upvotes})]}),l&&n.jsx("button",{className:`${me.qnaAnsweredBtn} ${F.answered?me.qnaMarkedAnswered:""}`,onClick:()=>N(F.id),title:F.answered?"Oznacz jako nieodpowiedziane":"Oznacz jako odpowiedziane",children:F.answered?"✓":"○"})]})]},F.id)},D=[me.interactiveQnA,me[`qnaStyle_${b}`],d??""].filter(Boolean).join(" ");return n.jsxs("div",{className:D,children:[n.jsxs("div",{className:me.qnaHeader,children:[n.jsx("h3",{className:me.qnaTitle,style:{fontFamily:u==null?void 0:u.fontFamily},children:"Pytania i odpowiedzi"}),n.jsxs("span",{className:me.qnaCount,children:[f.length," ",f.length===1?"pytanie":"pytań"]})]}),!s&&x(),s&&n.jsx("div",{className:me.qnaClosedMessage,children:"Zadawanie pytań zostało zamknięte"}),n.jsx("div",{className:me.qnaQuestionsList,children:P.length===0?n.jsx("div",{className:me.qnaEmptyState,children:"Brak pytań. Bądź pierwszy!"}):P.map(O)}),f.length>k&&n.jsxs("div",{className:me.qnaMoreQuestions,children:["+",f.length-k," więcej pytań"]})]})};function Bm(e){const t=new Date(e),i=new Date().getTime()-t.getTime(),r=Math.floor(i/6e4);if(r<1)return"Teraz";if(r<60)return`${r} min temu`;const s=Math.floor(r/60);return s<24?`${s}h temu`:t.toLocaleDateString("pl-PL",{day:"numeric",month:"short"})}const yr={id:"fade",name:"Fade",description:"Smooth fade between slides",outgoingStyles:{from:{opacity:1},to:{opacity:0}},incomingStyles:{from:{opacity:0},to:{opacity:1}},defaultDuration:500,defaultEasing:"ease-in-out",category:"basic"},br={id:"slide-left",name:"Slide Left",description:"Slide to the left",outgoingStyles:{from:{transform:"translateX(0%)"},to:{transform:"translateX(-100%)"}},incomingStyles:{from:{transform:"translateX(100%)"},to:{transform:"translateX(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},xr={id:"slide-right",name:"Slide Right",description:"Slide to the right",outgoingStyles:{from:{transform:"translateX(0%)"},to:{transform:"translateX(100%)"}},incomingStyles:{from:{transform:"translateX(-100%)"},to:{transform:"translateX(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},vr={id:"slide-up",name:"Slide Up",description:"Slide upward",outgoingStyles:{from:{transform:"translateY(0%)"},to:{transform:"translateY(-100%)"}},incomingStyles:{from:{transform:"translateY(100%)"},to:{transform:"translateY(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},wr={id:"slide-down",name:"Slide Down",description:"Slide downward",outgoingStyles:{from:{transform:"translateY(0%)"},to:{transform:"translateY(100%)"}},incomingStyles:{from:{transform:"translateY(-100%)"},to:{transform:"translateY(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},kr={id:"zoom-in",name:"Zoom In",description:"Zoom in from center",outgoingStyles:{from:{transform:"scale(1)",opacity:1},to:{transform:"scale(1.2)",opacity:0}},incomingStyles:{from:{transform:"scale(0.8)",opacity:0},to:{transform:"scale(1)",opacity:1}},defaultDuration:500,defaultEasing:"ease-out",category:"zoom"},Sr={id:"zoom-out",name:"Zoom Out",description:"Zoom out to center",outgoingStyles:{from:{transform:"scale(1)",opacity:1},to:{transform:"scale(0.8)",opacity:0}},incomingStyles:{from:{transform:"scale(1.2)",opacity:0},to:{transform:"scale(1)",opacity:1}},defaultDuration:500,defaultEasing:"ease-out",category:"zoom"},Cr={id:"flip-horizontal",name:"Flip Horizontal",description:"3D flip around vertical axis",outgoingStyles:{from:{transform:"perspective(1000px) rotateY(0deg)",opacity:1},to:{transform:"perspective(1000px) rotateY(-90deg)",opacity:0}},incomingStyles:{from:{transform:"perspective(1000px) rotateY(90deg)",opacity:0},to:{transform:"perspective(1000px) rotateY(0deg)",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"3d"},_r={id:"flip-vertical",name:"Flip Vertical",description:"3D flip around horizontal axis",outgoingStyles:{from:{transform:"perspective(1000px) rotateX(0deg)",opacity:1},to:{transform:"perspective(1000px) rotateX(90deg)",opacity:0}},incomingStyles:{from:{transform:"perspective(1000px) rotateX(-90deg)",opacity:0},to:{transform:"perspective(1000px) rotateX(0deg)",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"3d"},jr={id:"cube-left",name:"Cube Left",description:"3D cube rotation to the left",outgoingStyles:{from:{transform:"perspective(1000px) translateZ(0) rotateY(0deg)"},to:{transform:"perspective(1000px) translateZ(-50%) rotateY(90deg)"}},incomingStyles:{from:{transform:"perspective(1000px) translateZ(-50%) rotateY(-90deg)"},to:{transform:"perspective(1000px) translateZ(0) rotateY(0deg)"}},defaultDuration:800,defaultEasing:"ease-in-out",category:"3d"},Nr={id:"rotate-in",name:"Rotate In",description:"Rotate and fade in",outgoingStyles:{from:{transform:"rotate(0deg) scale(1)",opacity:1},to:{transform:"rotate(-15deg) scale(0.8)",opacity:0}},incomingStyles:{from:{transform:"rotate(15deg) scale(0.8)",opacity:0},to:{transform:"rotate(0deg) scale(1)",opacity:1}},defaultDuration:600,defaultEasing:"ease-out",category:"rotate"},Mr={id:"blur-fade",name:"Blur Fade",description:"Fade with blur effect",outgoingStyles:{from:{filter:"blur(0px)",opacity:1},to:{filter:"blur(10px)",opacity:0}},incomingStyles:{from:{filter:"blur(10px)",opacity:0},to:{filter:"blur(0px)",opacity:1}},defaultDuration:600,defaultEasing:"ease-in-out",category:"blur"},$r={id:"wipe-left",name:"Wipe Left",description:"Wipe from right to left",outgoingStyles:{from:{clipPath:"inset(0 0 0 0)"},to:{clipPath:"inset(0 100% 0 0)"}},incomingStyles:{from:{clipPath:"inset(0 0 0 100%)"},to:{clipPath:"inset(0 0 0 0)"}},defaultDuration:600,defaultEasing:"ease-in-out",category:"creative"},Er={id:"wipe-right",name:"Wipe Right",description:"Wipe from left to right",outgoingStyles:{from:{clipPath:"inset(0 0 0 0)"},to:{clipPath:"inset(0 0 0 100%)"}},incomingStyles:{from:{clipPath:"inset(0 100% 0 0)"},to:{clipPath:"inset(0 0 0 0)"}},defaultDuration:600,defaultEasing:"ease-in-out",category:"creative"},zr={id:"circle-reveal",name:"Circle Reveal",description:"Reveal with expanding circle",outgoingStyles:{from:{clipPath:"circle(100% at 50% 50%)"},to:{clipPath:"circle(0% at 50% 50%)"}},incomingStyles:{from:{clipPath:"circle(0% at 50% 50%)"},to:{clipPath:"circle(100% at 50% 50%)"}},defaultDuration:700,defaultEasing:"ease-out",category:"creative"},Ar={id:"glitch",name:"Glitch",description:"Digital glitch effect",outgoingStyles:{from:{transform:"translateX(0)",filter:"hue-rotate(0deg)"},keyframes:[{offset:.2,style:{transform:"translateX(-5px)",filter:"hue-rotate(90deg)"}},{offset:.4,style:{transform:"translateX(5px)",filter:"hue-rotate(180deg)"}},{offset:.6,style:{transform:"translateX(-3px)",filter:"hue-rotate(270deg)"}},{offset:.8,style:{transform:"translateX(3px)",filter:"hue-rotate(360deg)"}}],to:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:0}},incomingStyles:{from:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:0},keyframes:[{offset:.2,style:{transform:"translateX(5px)",filter:"hue-rotate(270deg)",opacity:.5}},{offset:.4,style:{transform:"translateX(-5px)",filter:"hue-rotate(180deg)",opacity:.7}},{offset:.6,style:{transform:"translateX(3px)",filter:"hue-rotate(90deg)",opacity:.9}},{offset:.8,style:{transform:"translateX(-3px)",filter:"hue-rotate(0deg)",opacity:1}}],to:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:1}},defaultDuration:500,defaultEasing:"linear",category:"creative"},Fr={id:"morph",name:"Morph",description:"Smooth morphing effect",outgoingStyles:{from:{transform:"scale(1)",borderRadius:"0%",opacity:1},to:{transform:"scale(0.5)",borderRadius:"50%",opacity:0}},incomingStyles:{from:{transform:"scale(0.5)",borderRadius:"50%",opacity:0},to:{transform:"scale(1)",borderRadius:"0%",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"creative"},Ir=[yr,br,xr,vr,wr,kr,Sr,Cr,_r,jr,Nr,Mr,$r,Er,zr,Ar,Fr];class Lm{constructor(){this.transitions=new Map,Ir.forEach(t=>this.transitions.set(t.id,t))}get(t){return this.transitions.get(t)}register(t){this.transitions.has(t.id)&&console.warn(`Transition "${t.id}" already exists and will be overwritten.`),this.transitions.set(t.id,t)}unregister(t){this.transitions.delete(t)}getAll(){return Array.from(this.transitions.values())}getByCategory(t){return this.getAll().filter(a=>a.category===t)}}const Dr=new Lm;function qa(e,t,a,i){if(i&&i.length>0){const r=[{offset:0,style:e},...i,{offset:1,style:t}].sort((u,g)=>u.offset-g.offset);let s=r[0],l=r[r.length-1];for(let u=0;u<r.length-1;u++)if(a>=r[u].offset&&a<=r[u+1].offset){s=r[u],l=r[u+1];break}const c=l.offset-s.offset,d=c>0?(a-s.offset)/c:1;return Va(s.style,l.style,d)}return Va(e,t,a)}function Va(e,t,a){const i={};return new Set([...Object.keys(e),...Object.keys(t)]).forEach(s=>{const l=e[s],c=t[s];l===void 0?i[s]=c:c===void 0?i[s]=l:typeof l=="number"&&typeof c=="number"?i[s]=l+(c-l)*a:i[s]=a<.5?l:c}),i}function Om(e,t){const a=Dr.get(e);if(!a)return{progress:t,outgoingStyle:{opacity:1-t},incomingStyle:{opacity:t},isComplete:t>=1};const{outgoingStyles:i,incomingStyles:r}=a;return{progress:t,outgoingStyle:qa(i.from,i.to,t,i.keyframes),incomingStyle:qa(r.from,r.to,t,r.keyframes),isComplete:t>=1}}function Hm(e,t){return{none:"fade",fade:"fade",slide:t==="right"?"slide-right":t==="up"?"slide-up":t==="down"?"slide-down":"slide-left",zoom:"zoom-in",flip:"flip-horizontal",cube:"cube-left",wipe:t==="right"?"wipe-right":"wipe-left",dissolve:"blur-fade",push:t==="right"?"slide-right":"slide-left",cover:"slide-left"}[e]??"fade"}function Wm(e,t){switch(t){case"linear":return e;case"ease-in":return e*e;case"ease-out":return 1-Math.pow(1-e,2);case"ease-in-out":return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2;case"ease":default:return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}}function qm(e,t,a,i,r){return{id:e,name:t,outgoingStyles:a,incomingStyles:i,defaultDuration:(r==null?void 0:r.defaultDuration)??500,defaultEasing:(r==null?void 0:r.defaultEasing)??"ease-in-out",description:r==null?void 0:r.description,supportsDirection:r==null?void 0:r.supportsDirection,previewUrl:r==null?void 0:r.previewUrl,category:(r==null?void 0:r.category)??"custom"}}function Vm(e,t){const a=t==="outgoing"?e.outgoingStyles:e.incomingStyles,i=[];return i.push({offset:0,...a.from}),a.keyframes&&a.keyframes.forEach(r=>{i.push({offset:r.offset,...r.style})}),i.push({offset:1,...a.to}),i}function Ft(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(e)}function Yt(e){return`${e>=0?"+":""}${e.toFixed(1)}%`}function Zt(e){return e>=0?"#10B981":"#EF4444"}function Km(e){return{id:"slide-title",title:"Title",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3B82F6",position:100}],gradientDirection:135},elements:[{id:"title-main",type:"text",position:{x:10,y:35,width:80,height:15,unit:"percent"},content:{type:"text",text:`${e.quarter} ${e.year} Quarterly Report`,style:{fontFamily:"Inter, sans-serif",fontSize:56,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:800,delayMs:200}},{id:"title-company",type:"text",position:{x:10,y:52,width:80,height:8,unit:"percent"},content:{type:"text",text:e.companyName,style:{fontFamily:"Inter, sans-serif",fontSize:32,fontWeight:400,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:600}},{id:"title-date",type:"text",position:{x:10,y:85,width:80,height:5,unit:"percent"},content:{type:"text",text:e.reportDate||new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),style:{fontFamily:"Inter, sans-serif",fontSize:18,color:"#BFDBFE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Welcome stakeholders. This presentation covers our Q"+e.quarter[1]+" results.",durationMs:3e4}}function Um(e){const t=[{id:"kpi-revenue",type:"shape",position:{x:5,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E5E7EB",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:200}},{id:"kpi-revenue-icon",type:"text",position:{x:7,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"💰",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-revenue-label",type:"text",position:{x:7,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Revenue",style:{fontSize:14,color:"#6B7280",textAlign:"center",fontWeight:500}}},{id:"kpi-revenue-value",type:"text",position:{x:7,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:Ft(e.kpis.revenue.value),style:{fontSize:28,fontWeight:700,color:"#1F2937",textAlign:"center"}}},{id:"kpi-revenue-change",type:"text",position:{x:7,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:Yt(e.kpis.revenue.change),style:{fontSize:16,fontWeight:600,color:Zt(e.kpis.revenue.change),textAlign:"center"}}},{id:"kpi-profit",type:"shape",position:{x:28,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E5E7EB",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:350}},{id:"kpi-profit-icon",type:"text",position:{x:30,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"📈",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-profit-label",type:"text",position:{x:30,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Profit",style:{fontSize:14,color:"#6B7280",textAlign:"center",fontWeight:500}}},{id:"kpi-profit-value",type:"text",position:{x:30,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:Ft(e.kpis.profit.value),style:{fontSize:28,fontWeight:700,color:"#1F2937",textAlign:"center"}}},{id:"kpi-profit-change",type:"text",position:{x:30,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:Yt(e.kpis.profit.change),style:{fontSize:16,fontWeight:600,color:Zt(e.kpis.profit.change),textAlign:"center"}}},{id:"kpi-customers",type:"shape",position:{x:51,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E5E7EB",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:500}},{id:"kpi-customers-icon",type:"text",position:{x:53,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"👥",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-customers-label",type:"text",position:{x:53,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Customers",style:{fontSize:14,color:"#6B7280",textAlign:"center",fontWeight:500}}},{id:"kpi-customers-value",type:"text",position:{x:53,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:e.kpis.customers.value.toLocaleString(),style:{fontSize:28,fontWeight:700,color:"#1F2937",textAlign:"center"}}},{id:"kpi-customers-change",type:"text",position:{x:53,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:Yt(e.kpis.customers.change),style:{fontSize:16,fontWeight:600,color:Zt(e.kpis.customers.change),textAlign:"center"}}},{id:"kpi-satisfaction",type:"shape",position:{x:74,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E5E7EB",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:650}},{id:"kpi-satisfaction-icon",type:"text",position:{x:76,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"⭐",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-satisfaction-label",type:"text",position:{x:76,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Satisfaction",style:{fontSize:14,color:"#6B7280",textAlign:"center",fontWeight:500}}},{id:"kpi-satisfaction-value",type:"text",position:{x:76,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:`${e.kpis.satisfaction.value}%`,style:{fontSize:28,fontWeight:700,color:"#1F2937",textAlign:"center"}}},{id:"kpi-satisfaction-change",type:"text",position:{x:76,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:Yt(e.kpis.satisfaction.change),style:{fontSize:16,fontWeight:600,color:Zt(e.kpis.satisfaction.change),textAlign:"center"}}}];return{id:"slide-kpis",title:"Key Performance Indicators",layout:"titleContent",background:{type:"solid",color:"#F3F4F6"},elements:[{id:"kpis-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Key Performance Indicators",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...t],notes:"Review each KPI and highlight the most significant changes from last quarter.",durationMs:45e3}}function Ym(e){var a;const t={type:"chart",chartType:"bar",title:"Monthly Revenue",data:{labels:e.financials.revenueByMonth.map(i=>i.month),datasets:[{label:`${e.year}`,data:e.financials.revenueByMonth.map(i=>i.value),backgroundColor:"#3B82F6"},...((a=e.financials.revenueByMonth[0])==null?void 0:a.lastYear)!==void 0?[{label:`${e.year-1}`,data:e.financials.revenueByMonth.map(i=>i.lastYear||0),backgroundColor:"#93C5FD"}]:[]]},options:{showLegend:!0,showGridLines:!0,animation:!0}};return{id:"slide-revenue",title:"Revenue Analysis",layout:"titleContent",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"revenue-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Revenue Analysis",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"revenue-chart",type:"chart",position:{x:5,y:18,width:90,height:75,unit:"percent"},content:t,animation:{effect:"fadeIn",durationMs:800,delayMs:400}}],notes:"Highlight the revenue trend and compare with last year if applicable.",durationMs:6e4}}function Zm(e){const t={type:"chart",chartType:"pie",title:"Cost Breakdown",data:{labels:e.financials.costBreakdown.map(a=>a.category),datasets:[{label:"Cost Distribution",data:e.financials.costBreakdown.map(a=>a.value),backgroundColor:["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899","#14B8A6","#6366F1"]}]},options:{showLegend:!0,showDataLabels:!0,animation:!0}};return{id:"slide-costs",title:"Cost Analysis",layout:"twoColumn",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"costs-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Cost Analysis",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"costs-chart",type:"chart",position:{x:5,y:18,width:45,height:70,unit:"percent"},content:t,animation:{effect:"zoomIn",durationMs:600,delayMs:400}},{id:"costs-table",type:"table",position:{x:52,y:18,width:43,height:70,unit:"percent"},content:{type:"table",headers:["Category","Amount","%"],rows:e.financials.costBreakdown.map(a=>[a.category,Ft(a.value),`${a.percentage}%`]),style:{headerBackground:"#F3F4F6",headerColor:"#374151",cellPadding:12,fontSize:14,borderColor:"#E5E7EB"}},animation:{effect:"slideInRight",durationMs:600,delayMs:600}}],notes:"Discuss major cost categories and opportunities for optimization.",durationMs:6e4}}function Gm(e){const t=e.pipeline.opportunities.map((i,r)=>({id:`pipeline-stage-${r}`,type:"shape",position:{x:5+r*2,y:25+r*12,width:90-r*4,height:10,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:`hsl(${220-r*15}, 70%, ${50+r*8}%)`,cornerRadius:6},animation:{effect:"slideInLeft",durationMs:400,delayMs:200+r*150}})),a=e.pipeline.opportunities.map((i,r)=>({id:`pipeline-label-${r}`,type:"text",position:{x:8+r*2,y:26.5+r*12,width:84-r*4,height:7,unit:"percent"},content:{type:"text",text:`${i.stage}: ${i.count} opportunities (${Ft(i.value)})`,style:{fontSize:16,fontWeight:600,color:r<2?"#FFFFFF":"#1F2937",textAlign:"center"}}}));return{id:"slide-pipeline",title:"Sales Pipeline",layout:"titleContent",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"pipeline-title",type:"text",position:{x:5,y:5,width:60,height:10,unit:"percent"},content:{type:"text",text:"Sales Pipeline",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"pipeline-total",type:"text",position:{x:65,y:5,width:30,height:10,unit:"percent"},content:{type:"text",text:`Total: ${Ft(e.pipeline.totalValue)}`,style:{fontSize:28,fontWeight:700,color:"#3B82F6",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...t,...a],notes:"Walk through the pipeline stages and highlight key deals approaching close.",durationMs:6e4}}function Xm(e){const t={high:"#EF4444",medium:"#F59E0B",low:"#10B981"},a=e.risks.slice(0,5).flatMap((i,r)=>[{id:`risk-card-${r}`,type:"shape",position:{x:5,y:20+r*15,width:90,height:13,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:t[i.impact],strokeWidth:2,cornerRadius:8},animation:{effect:"slideInLeft",durationMs:400,delayMs:200+r*100}},{id:`risk-name-${r}`,type:"text",position:{x:7,y:21.5+r*15,width:50,height:5,unit:"percent"},content:{type:"text",text:i.name,style:{fontSize:16,fontWeight:600,color:"#1F2937"}}},{id:`risk-impact-${r}`,type:"text",position:{x:58,y:21.5+r*15,width:15,height:5,unit:"percent"},content:{type:"text",text:`Impact: ${i.impact.toUpperCase()}`,style:{fontSize:12,fontWeight:500,color:t[i.impact]}}},{id:`risk-prob-${r}`,type:"text",position:{x:75,y:21.5+r*15,width:18,height:5,unit:"percent"},content:{type:"text",text:`Prob: ${i.probability.toUpperCase()}`,style:{fontSize:12,fontWeight:500,color:"#6B7280"}}},{id:`risk-mitigation-${r}`,type:"text",position:{x:7,y:27+r*15,width:86,height:4,unit:"percent"},content:{type:"text",text:`Mitigation: ${i.mitigation}`,style:{fontSize:12,color:"#6B7280"}}}]);return{id:"slide-risks",title:"Risks & Mitigation",layout:"titleContent",background:{type:"solid",color:"#F9FAFB"},elements:[{id:"risks-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Risks & Mitigation",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...a],notes:"Discuss each risk, its current status, and mitigation actions in progress.",durationMs:9e4}}function Qm(e){const t={"on-track":"#10B981","at-risk":"#F59E0B",completed:"#3B82F6","not-started":"#9CA3AF"},a={"on-track":"✅","at-risk":"⚠️",completed:"🎉","not-started":"⏳"},i=e.plan.slice(0,6).flatMap((r,s)=>[{id:`plan-item-${s}`,type:"shape",position:{x:5,y:18+s*13,width:90,height:11,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:t[r.status],strokeWidth:2,cornerRadius:8},animation:{effect:"slideInRight",durationMs:400,delayMs:200+s*100}},{id:`plan-icon-${s}`,type:"text",position:{x:7,y:20+s*13,width:5,height:7,unit:"percent"},content:{type:"text",text:a[r.status],style:{fontSize:24}}},{id:`plan-goal-${s}`,type:"text",position:{x:13,y:20+s*13,width:60,height:7,unit:"percent"},content:{type:"text",text:r.goal,style:{fontSize:16,fontWeight:500,color:"#1F2937"}}},{id:`plan-status-${s}`,type:"text",position:{x:75,y:20+s*13,width:18,height:7,unit:"percent"},content:{type:"text",text:r.status.replace("-"," ").toUpperCase(),style:{fontSize:12,fontWeight:600,color:t[r.status],textAlign:"right"}}}]);return{id:"slide-plan",title:"Strategic Plan",layout:"titleContent",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"plan-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Strategic Plan Status",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...i],notes:"Review progress on strategic initiatives and discuss any blockers.",durationMs:6e4}}function Jm(e){const t=e.team||{headcount:0,newHires:0,departures:0,highlights:[]};return{id:"slide-team",title:"Team Updates",layout:"twoColumn",background:{type:"gradient",gradientStops:[{color:"#F0F9FF",position:0},{color:"#E0F2FE",position:100}],gradientDirection:180},elements:[{id:"team-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Team Updates",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"team-headcount-card",type:"shape",position:{x:5,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#3B82F6",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},{id:"team-headcount-icon",type:"text",position:{x:12,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"👥",style:{fontSize:40,textAlign:"center"}}},{id:"team-headcount-value",type:"text",position:{x:7,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:t.headcount.toString(),style:{fontSize:36,fontWeight:700,color:"#1F2937",textAlign:"center"}}},{id:"team-headcount-label",type:"text",position:{x:7,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"Total Headcount",style:{fontSize:12,color:"#6B7280",textAlign:"center"}}},{id:"team-new-card",type:"shape",position:{x:36,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#10B981",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:350}},{id:"team-new-icon",type:"text",position:{x:43,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"🆕",style:{fontSize:40,textAlign:"center"}}},{id:"team-new-value",type:"text",position:{x:38,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:`+${t.newHires||0}`,style:{fontSize:36,fontWeight:700,color:"#10B981",textAlign:"center"}}},{id:"team-new-label",type:"text",position:{x:38,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"New Hires",style:{fontSize:12,color:"#6B7280",textAlign:"center"}}},{id:"team-dept-card",type:"shape",position:{x:67,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#F59E0B",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:500}},{id:"team-dept-icon",type:"text",position:{x:74,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"👋",style:{fontSize:40,textAlign:"center"}}},{id:"team-dept-value",type:"text",position:{x:69,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:`-${t.departures||0}`,style:{fontSize:36,fontWeight:700,color:"#F59E0B",textAlign:"center"}}},{id:"team-dept-label",type:"text",position:{x:69,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"Departures",style:{fontSize:12,color:"#6B7280",textAlign:"center"}}},{id:"team-highlights-title",type:"text",position:{x:5,y:50,width:90,height:6,unit:"percent"},content:{type:"text",text:"Team Highlights",style:{fontSize:24,fontWeight:600,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}},...(t.highlights||[]).slice(0,4).map((a,i)=>({id:`team-highlight-${i}`,type:"text",position:{x:7,y:58+i*8,width:88,height:6,unit:"percent"},content:{type:"text",text:`• ${a}`,style:{fontSize:16,color:"#374151"}},animation:{effect:"slideInLeft",durationMs:300,delayMs:800+i*100}}))],notes:"Celebrate new team members and acknowledge departures. Highlight team achievements.",durationMs:45e3}}function eh(e){return{id:"slide-qa",title:"Q&A",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3B82F6",position:100}],gradientDirection:135},elements:[{id:"qa-title",type:"text",position:{x:10,y:35,width:80,height:20,unit:"percent"},content:{type:"text",text:"Questions?",style:{fontFamily:"Inter, sans-serif",fontSize:72,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:800,delayMs:200}},{id:"qa-subtitle",type:"text",position:{x:10,y:55,width:80,height:10,unit:"percent"},content:{type:"text",text:"Thank you for your attention",style:{fontFamily:"Inter, sans-serif",fontSize:28,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:800}},{id:"qa-contact",type:"text",position:{x:10,y:85,width:80,height:5,unit:"percent"},content:{type:"text",text:e.preparedBy?`Prepared by: ${e.preparedBy}`:e.companyName,style:{fontSize:16,color:"#BFDBFE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Open floor for questions. Have backup slides ready for detailed questions.",durationMs:3e5}}function th(e){return{version:"1.0",id:`quarterly-report-${e.quarter}-${e.year}`,title:`${e.quarter} ${e.year} Quarterly Report - ${e.companyName}`,author:e.preparedBy,slideSize:{width:1920,height:1080,unit:"px"},slides:[Km(e),Um(e),Ym(e),Zm(e),Gm(e),Xm(e),Qm(e),Jm(e),eh(e)],theme:{colors:{primary:"#3B82F6",secondary:"#10B981",background:"#FFFFFF",text:"#1F2937",accent:"#F59E0B"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["quarterly-report",e.quarter,e.year.toString()],templateId:"quarterly-report-v1"}}}function nh(){return{quarter:"Q4",year:2024,companyName:"TechCorp Inc.",reportDate:"January 15, 2025",preparedBy:"Finance Team",kpis:{revenue:{value:125e5,change:15.3,target:12e6},profit:{value:28e5,change:8.7,target:25e5},customers:{value:1250,change:22.5,target:1e3},satisfaction:{value:92,change:3.2,target:90}},financials:{revenueByMonth:[{month:"Oct",value:38e5,lastYear:32e5},{month:"Nov",value:42e5,lastYear:35e5},{month:"Dec",value:45e5,lastYear:4e6}],costBreakdown:[{category:"Personnel",value:52e5,percentage:42},{category:"Infrastructure",value:23e5,percentage:18},{category:"Marketing",value:18e5,percentage:14},{category:"R&D",value:15e5,percentage:12},{category:"Operations",value:11e5,percentage:9},{category:"Other",value:6e5,percentage:5}],profitMargin:[{month:"Oct",margin:21},{month:"Nov",margin:22},{month:"Dec",margin:24}]},pipeline:{totalValue:185e5,opportunities:[{stage:"Qualified",count:45,value:85e5},{stage:"Proposal",count:28,value:52e5},{stage:"Negotiation",count:15,value:32e5},{stage:"Closing",count:8,value:16e5}]},risks:[{name:"Supply chain delays",impact:"high",probability:"medium",mitigation:"Diversifying suppliers and increasing inventory buffer",owner:"Operations"},{name:"Key talent retention",impact:"high",probability:"low",mitigation:"Competitive compensation review and career development programs",owner:"HR"},{name:"Market competition",impact:"medium",probability:"high",mitigation:"Accelerating product innovation and customer loyalty programs",owner:"Product"}],plan:[{goal:"Launch v2.0 platform",status:"on-track",dueDate:"Q1 2025",owner:"Engineering"},{goal:"Expand to EMEA market",status:"at-risk",dueDate:"Q2 2025",owner:"Sales"},{goal:"Achieve SOC2 certification",status:"completed",owner:"Security"},{goal:"Implement AI-powered support",status:"on-track",dueDate:"Q1 2025",owner:"Support"},{goal:"Reduce customer churn by 15%",status:"on-track",dueDate:"Q4 2024",owner:"Customer Success"}],team:{headcount:156,newHires:23,departures:8,highlights:["Promoted 12 team members to senior roles","Launched engineering mentorship program","Achieved 95% employee engagement score","Completed company-wide DEI training"]}}}function ah(e){const t=e.problem.painPoints.slice(0,4).map((a,i)=>({id:`pain-${i}`,type:"text",position:{x:55,y:28+i*15,width:40,height:12,unit:"percent"},content:{type:"text",text:`❌ ${a}`,style:{fontSize:20,color:"#374151",lineHeight:1.5}},animation:{effect:"slideInRight",durationMs:400,delayMs:400+i*200}}));return{id:"slide-problem",title:"The Problem",layout:"twoColumn",background:{type:"solid",color:"#FEF2F2"},elements:[{id:"problem-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:e.problem.headline,style:{fontSize:48,fontWeight:700,color:"#991B1B"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"problem-icon",type:"text",position:{x:10,y:30,width:35,height:40,unit:"percent"},content:{type:"text",text:"😫",style:{fontSize:150,textAlign:"center"}},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},...t,...(e.problem.statistics||[]).slice(0,2).map((a,i)=>({id:`stat-${i}`,type:"shape",position:{x:5+i*47,y:80,width:43,height:15,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FEE2E2",cornerRadius:8},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3+i*200}}))],notes:"Set up the problem. Make the audience feel the pain before presenting the solution.",durationMs:6e4}}function ih(e){const t=e.solution.keyBenefits.slice(0,3).flatMap((a,i)=>[{id:`benefit-card-${i}`,type:"shape",position:{x:5+i*32,y:45,width:29,height:45,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#10B981",strokeWidth:2,cornerRadius:12},animation:{effect:"slideInUp",durationMs:500,delayMs:400+i*200}},{id:`benefit-icon-${i}`,type:"text",position:{x:10+i*32,y:50,width:19,height:12,unit:"percent"},content:{type:"text",text:a.icon||"✅",style:{fontSize:48,textAlign:"center"}}},{id:`benefit-title-${i}`,type:"text",position:{x:7+i*32,y:64,width:25,height:8,unit:"percent"},content:{type:"text",text:a.title,style:{fontSize:20,fontWeight:600,color:"#1F2937",textAlign:"center"}}},{id:`benefit-desc-${i}`,type:"text",position:{x:7+i*32,y:73,width:25,height:14,unit:"percent"},content:{type:"text",text:a.description,style:{fontSize:14,color:"#6B7280",textAlign:"center",lineHeight:1.4}}}]);return{id:"slide-solution",title:"The Solution",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#ECFDF5",position:0},{color:"#D1FAE5",position:100}],gradientDirection:180},elements:[{id:"solution-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:e.solution.headline,style:{fontSize:48,fontWeight:700,color:"#047857"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"solution-desc",type:"text",position:{x:5,y:20,width:90,height:15,unit:"percent"},content:{type:"text",text:e.solution.description,style:{fontSize:24,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},...t],notes:"Introduce your solution as the hero. Emphasize key benefits.",durationMs:6e4}}function rh(e){var a,i;const t=(((a=e.demo)==null?void 0:a.features)||[]).slice(0,5).map((r,s)=>({id:`demo-feature-${s}`,type:"text",position:{x:55,y:25+s*12,width:40,height:10,unit:"percent"},content:{type:"text",text:`▸ ${r.name}`,style:{fontSize:18,color:"#374151",fontWeight:500}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+s*150}}));return{id:"slide-demo",title:"Product Demo",layout:"twoColumn",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"demo-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:`See ${e.productName} in Action`,style:{fontSize:44,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"demo-screenshot",type:"shape",position:{x:5,y:22,width:45,height:70,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#F3F4F6",stroke:"#E5E7EB",strokeWidth:2,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:600,delayMs:300}},{id:"demo-placeholder",type:"text",position:{x:15,y:50,width:25,height:10,unit:"percent"},content:{type:"text",text:(i=e.demo)!=null&&i.screenshotUrl?"":"📱 Demo Screenshot",style:{fontSize:20,color:"#9CA3AF",textAlign:"center"}}},{id:"features-title",type:"text",position:{x:55,y:18,width:40,height:6,unit:"percent"},content:{type:"text",text:"Key Features",style:{fontSize:24,fontWeight:600,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t],notes:"This is where you do the live demo or show screenshots. Keep it focused.",durationMs:12e4}}function oh(e){const t=e.features.slice(0,6).flatMap((a,i)=>{const r=Math.floor(i/3),s=i%3,l=a.highlight;return[{id:`feature-card-${i}`,type:"shape",position:{x:5+s*32,y:22+r*38,width:29,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:l?"#3B82F6":"#FFFFFF",stroke:l?"#2563EB":"#E5E7EB",strokeWidth:l?3:1,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:200+i*100}},{id:`feature-icon-${i}`,type:"text",position:{x:10+s*32,y:26+r*38,width:19,height:10,unit:"percent"},content:{type:"text",text:a.icon||"⚡",style:{fontSize:36,textAlign:"center"}}},{id:`feature-name-${i}`,type:"text",position:{x:7+s*32,y:37+r*38,width:25,height:6,unit:"percent"},content:{type:"text",text:a.name,style:{fontSize:18,fontWeight:600,color:l?"#FFFFFF":"#1F2937",textAlign:"center"}}},{id:`feature-desc-${i}`,type:"text",position:{x:7+s*32,y:44+r*38,width:25,height:10,unit:"percent"},content:{type:"text",text:a.description,style:{fontSize:12,color:l?"#DBEAFE":"#6B7280",textAlign:"center",lineHeight:1.3}}}]});return{id:"slide-features",title:"Features",layout:"titleContent",background:{type:"solid",color:"#F9FAFB"},elements:[{id:"features-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"Powerful Features",style:{fontSize:44,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Highlight key features. Focus on benefits, not just functionality.",durationMs:6e4}}function sh(e){const t=e.pricing.plans.slice(0,3).flatMap((a,i)=>{const r=a.highlighted,s=r?18:22,l=r?72:65;return[{id:`pricing-card-${i}`,type:"shape",position:{x:5+i*32,y:s,width:29,height:l,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:r?"#3B82F6":"#FFFFFF",stroke:r?"#1D4ED8":"#E5E7EB",strokeWidth:r?3:1,cornerRadius:16},animation:{effect:"slideInUp",durationMs:500,delayMs:200+i*150}},...r?[{id:`pricing-badge-${i}`,type:"text",position:{x:10+i*32,y:s+2,width:19,height:4,unit:"percent"},content:{type:"text",text:"⭐ POPULAR",style:{fontSize:12,fontWeight:700,color:"#FCD34D",textAlign:"center"}}}]:[],{id:`pricing-name-${i}`,type:"text",position:{x:7+i*32,y:s+(r?8:5),width:25,height:6,unit:"percent"},content:{type:"text",text:a.name,style:{fontSize:24,fontWeight:600,color:r?"#FFFFFF":"#1F2937",textAlign:"center"}}},{id:`pricing-price-${i}`,type:"text",position:{x:7+i*32,y:s+(r?16:13),width:25,height:10,unit:"percent"},content:{type:"text",text:a.price==="custom"?"Custom":`${e.pricing.currency}${a.price}/${a.period==="month"?"mo":a.period==="year"?"yr":""}`,style:{fontSize:36,fontWeight:700,color:r?"#FFFFFF":"#3B82F6",textAlign:"center"}}},...a.features.slice(0,5).map((c,d)=>({id:`pricing-feature-${i}-${d}`,type:"text",position:{x:7+i*32,y:s+(r?28:25)+d*7,width:25,height:5,unit:"percent"},content:{type:"text",text:`✓ ${c}`,style:{fontSize:12,color:r?"#DBEAFE":"#6B7280",textAlign:"center"}}})),{id:`pricing-cta-${i}`,type:"shape",position:{x:9+i*32,y:s+l-12,width:21,height:8,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:r?"#FFFFFF":"#3B82F6",cornerRadius:8}},{id:`pricing-cta-text-${i}`,type:"text",position:{x:9+i*32,y:s+l-10.5,width:21,height:5,unit:"percent"},content:{type:"text",text:a.cta||"Get Started",style:{fontSize:14,fontWeight:600,color:r?"#3B82F6":"#FFFFFF",textAlign:"center"}}}]});return{id:"slide-pricing",title:"Pricing",layout:"titleContent",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"pricing-title",type:"text",position:{x:5,y:3,width:90,height:10,unit:"percent"},content:{type:"text",text:"Simple, Transparent Pricing",style:{fontSize:44,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Present pricing clearly. Emphasize value, not just cost.",durationMs:6e4}}function lh(e){return{id:"slide-cta",title:"Call to Action",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E40AF",position:0},{color:"#3B82F6",position:50},{color:"#60A5FA",position:100}],gradientDirection:135},elements:[{id:"cta-headline",type:"text",position:{x:10,y:25,width:80,height:20,unit:"percent"},content:{type:"text",text:e.cta.headline,style:{fontSize:56,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:700,delayMs:0}},...e.cta.subheadline?[{id:"cta-subheadline",type:"text",position:{x:15,y:48,width:70,height:10,unit:"percent"},content:{type:"text",text:e.cta.subheadline,style:{fontSize:24,color:"#BFDBFE",textAlign:"center",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:500,delayMs:500}}]:[],{id:"cta-button",type:"shape",position:{x:35,y:65,width:30,height:12,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",cornerRadius:30},animation:{effect:"slideInUp",durationMs:500,delayMs:800}},{id:"cta-button-text",type:"text",position:{x:35,y:68,width:30,height:6,unit:"percent"},content:{type:"text",text:e.cta.buttonText,style:{fontSize:24,fontWeight:700,color:"#1E40AF",textAlign:"center"}}},...e.cta.contactEmail?[{id:"cta-contact",type:"text",position:{x:20,y:82,width:60,height:6,unit:"percent"},content:{type:"text",text:`📧 ${e.cta.contactEmail}`,style:{fontSize:18,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}]:[],...e.cta.websiteUrl?[{id:"cta-website",type:"text",position:{x:20,y:88,width:60,height:5,unit:"percent"},content:{type:"text",text:`🌐 ${e.cta.websiteUrl}`,style:{fontSize:16,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1100}}]:[]],notes:"Strong call to action. Make it easy for them to take the next step.",durationMs:6e4}}function ch(e){return{id:"slide-title",title:"Title",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#0F172A",position:0},{color:"#1E293B",position:100}],gradientDirection:180},elements:[{id:"title-product",type:"text",position:{x:10,y:30,width:80,height:20,unit:"percent"},content:{type:"text",text:e.productName,style:{fontSize:72,fontWeight:800,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:800,delayMs:200}},{id:"title-tagline",type:"text",position:{x:15,y:52,width:70,height:12,unit:"percent"},content:{type:"text",text:e.tagline,style:{fontSize:28,color:"#94A3B8",textAlign:"center",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:600,delayMs:800}},{id:"title-company",type:"text",position:{x:10,y:88,width:80,height:6,unit:"percent"},content:{type:"text",text:e.companyName,style:{fontSize:18,color:"#64748B",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Opening slide. Create intrigue and set the tone.",durationMs:15e3}}function dh(e){return{version:"1.0",id:`product-pitch-${e.productName.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.productName} - Product Pitch`,slideSize:{width:1920,height:1080,unit:"px"},slides:[ch(e),ah(e),ih(e),rh(e),oh(e),sh(e),lh(e)],theme:{colors:{primary:"#3B82F6",secondary:"#10B981",background:"#FFFFFF",text:"#1F2937",accent:"#F59E0B"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["product-pitch","sales"],templateId:"product-pitch-v1"}}}function uh(){return{productName:"FlowSync",tagline:"Seamless workflow automation that actually works",companyName:"FlowSync Inc.",problem:{headline:"Manual processes are killing productivity",painPoints:["Teams waste 20+ hours/week on repetitive tasks","Data silos cause costly errors and delays","No visibility into process bottlenecks","Integration nightmares with existing tools"],statistics:[{stat:"60%",description:"of knowledge workers spend time on busy work"},{stat:"$1.8T",description:"lost annually to inefficient processes"}]},solution:{headline:"Automate in minutes, not months",description:"FlowSync connects your existing tools and automates workflows with AI-powered intelligence. No coding required.",keyBenefits:[{title:"Easy Setup",description:"Connect apps in seconds with 200+ integrations",icon:"🔌"},{title:"AI-Powered",description:"Smart automation that learns from your workflows",icon:"🧠"},{title:"Real-time Insights",description:"Dashboard with live metrics and bottleneck detection",icon:"📊"}]},demo:{features:[{name:"Visual Workflow Builder",description:"Drag-and-drop interface"},{name:"Smart Triggers",description:"Event-based automation"},{name:"Error Handling",description:"Automatic retry and alerts"},{name:"Version Control",description:"Track changes and rollback"},{name:"Team Collaboration",description:"Share and comment on flows"}]},features:[{name:"Visual Builder",description:"Intuitive drag-and-drop workflow design",icon:"🎨",highlight:!0},{name:"200+ Integrations",description:"Connect to popular apps instantly",icon:"🔗"},{name:"AI Suggestions",description:"Get smart automation recommendations",icon:"🤖"},{name:"Real-time Monitoring",description:"Track all workflows in one dashboard",icon:"📈"},{name:"Enterprise Security",description:"SOC2 compliant, encrypted data",icon:"🔒"},{name:"24/7 Support",description:"Expert help whenever you need it",icon:"💬"}],pricing:{currency:"$",plans:[{name:"Starter",price:29,period:"month",features:["5 workflows","1,000 runs/month","10 integrations","Email support"],cta:"Start Free"},{name:"Professional",price:99,period:"month",features:["Unlimited workflows","50,000 runs/month","All integrations","Priority support","AI suggestions"],highlighted:!0,cta:"Try 14 Days Free"},{name:"Enterprise",price:"custom",period:"month",features:["Everything in Pro","Unlimited runs","Dedicated support","Custom integrations","SLA guarantee"],cta:"Contact Sales"}]},cta:{headline:"Ready to automate your workflow?",subheadline:"Join 10,000+ teams already saving hours every week",buttonText:"Start Your Free Trial",contactEmail:"hello@flowsync.io",websiteUrl:"flowsync.io"}}}function ph(e){const t=Math.round(e.completed.totalPoints/e.completed.committedPoints*100);return{id:"slide-title",title:"Sprint Review",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3B82F6",position:100}],gradientDirection:135},elements:[{id:"title-sprint",type:"text",position:{x:10,y:25,width:80,height:15,unit:"percent"},content:{type:"text",text:`Sprint ${e.sprint.number} Review`,style:{fontSize:64,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"title-name",type:"text",position:{x:15,y:42,width:70,height:8,unit:"percent"},content:{type:"text",text:e.sprint.name,style:{fontSize:32,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},{id:"title-team",type:"text",position:{x:30,y:55,width:40,height:5,unit:"percent"},content:{type:"text",text:`Team ${e.team.name}`,style:{fontSize:20,color:"#BFDBFE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-dates",type:"text",position:{x:25,y:62,width:50,height:5,unit:"percent"},content:{type:"text",text:`${e.sprint.startDate} - ${e.sprint.endDate}`,style:{fontSize:18,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},{id:"title-completion",type:"text",position:{x:35,y:75,width:30,height:10,unit:"percent"},content:{type:"text",text:`${t}% Complete`,style:{fontSize:36,fontWeight:700,color:t>=80?"#4ADE80":t>=60?"#FBBF24":"#F87171",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:600,delayMs:800}}],notes:"Welcome stakeholders. Quick overview of sprint completion.",durationMs:3e4}}function mh(e){return{id:"slide-goal",title:"Sprint Goal",layout:"titleContent",background:{type:"solid",color:"#F0F9FF"},elements:[{id:"goal-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Sprint Goal",style:{fontSize:44,fontWeight:700,color:"#1E3A8A"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"goal-card",type:"shape",position:{x:10,y:25,width:80,height:30,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#3B82F6",strokeWidth:3,cornerRadius:16},animation:{effect:"slideInUp",durationMs:500,delayMs:200}},{id:"goal-icon",type:"text",position:{x:15,y:30,width:10,height:15,unit:"percent"},content:{type:"text",text:"🎯",style:{fontSize:64}}},{id:"goal-text",type:"text",position:{x:27,y:32,width:58,height:20,unit:"percent"},content:{type:"text",text:e.sprint.goal,style:{fontSize:28,color:"#1F2937",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"goal-status",type:"text",position:{x:10,y:60,width:80,height:8,unit:"percent"},content:{type:"text",text:e.completed.totalPoints>=e.completed.committedPoints*.8?"✅ Goal Achieved":"⚠️ Goal Partially Met",style:{fontSize:32,fontWeight:600,color:e.completed.totalPoints>=e.completed.committedPoints*.8?"#059669":"#D97706",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:500,delayMs:700}}],notes:"Review whether the sprint goal was achieved and why.",durationMs:45e3}}function hh(e){const t=e.completed.stories.slice(0,8).map((a,i)=>{const r=Math.floor(i/2),s=i%2,l=a.type==="feature"?"✨":a.type==="bug"?"🐛":a.type==="tech-debt"?"🔧":"🔬",c=a.type==="feature"?"#059669":a.type==="bug"?"#DC2626":a.type==="tech-debt"?"#7C3AED":"#0891B2";return{id:`story-${i}`,type:"text",position:{x:5+s*48,y:22+r*9,width:44,height:7,unit:"percent"},content:{type:"text",text:`${l} ${a.key}: ${a.title}`,style:{fontSize:16,color:c,fontWeight:a.demo?700:400}},animation:{effect:"slideInRight",durationMs:300,delayMs:300+i*100}}});return{id:"slide-completed",title:"Completed Work",layout:"titleContent",background:{type:"solid",color:"#F0FDF4"},elements:[{id:"completed-title",type:"text",position:{x:5,y:5,width:60,height:10,unit:"percent"},content:{type:"text",text:"Completed Work",style:{fontSize:44,fontWeight:700,color:"#166534"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"completed-points",type:"text",position:{x:70,y:5,width:25,height:12,unit:"percent"},content:{type:"text",text:`${e.completed.totalPoints} / ${e.completed.committedPoints} pts`,style:{fontSize:32,fontWeight:700,color:"#059669",textAlign:"right"}},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},...t,{id:"legend",type:"text",position:{x:5,y:90,width:90,height:5,unit:"percent"},content:{type:"text",text:"✨ Feature | 🐛 Bug Fix | 🔧 Tech Debt | 🔬 Spike",style:{fontSize:14,color:"#6B7280",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Walk through completed items. Highlight any notable achievements.",durationMs:9e4}}function fh(e){const t=Math.max(...e.velocity.history.map(r=>r.points),e.velocity.current),a=e.velocity.history.slice(-5).map((r,s)=>{const l=r.points/t*45;return{id:`bar-${s}`,type:"shape",position:{x:10+s*16,y:75-l,width:12,height:l,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#93C5FD",cornerRadius:8},animation:{effect:"slideInUp",durationMs:500,delayMs:400+s*100}}}),i=e.velocity.current/t*45;return{id:"slide-velocity",title:"Velocity",layout:"titleContent",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"velocity-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Sprint Velocity",style:{fontSize:44,fontWeight:700,color:"#1E3A8A"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...a,{id:"current-bar",type:"shape",position:{x:10+e.velocity.history.slice(-5).length*16,y:75-i,width:12,height:i,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#3B82F6",cornerRadius:8},animation:{effect:"slideInUp",durationMs:600,delayMs:900}},{id:"current-label",type:"text",position:{x:10+e.velocity.history.slice(-5).length*16,y:77,width:12,height:6,unit:"percent"},content:{type:"text",text:`S${e.sprint.number}`,style:{fontSize:14,color:"#1E3A8A",fontWeight:600,textAlign:"center"}}},{id:"current-value",type:"text",position:{x:10+e.velocity.history.slice(-5).length*16,y:70-i,width:12,height:5,unit:"percent"},content:{type:"text",text:`${e.velocity.current}`,style:{fontSize:18,color:"#3B82F6",fontWeight:700,textAlign:"center"}}},{id:"average-line",type:"text",position:{x:5,y:18,width:35,height:10,unit:"percent"},content:{type:"text",text:`Average: ${e.velocity.average} pts/sprint`,style:{fontSize:24,color:"#6B7280"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"trend",type:"text",position:{x:60,y:18,width:35,height:10,unit:"percent"},content:{type:"text",text:e.velocity.current>=e.velocity.average?"📈 On Track":"📉 Below Average",style:{fontSize:24,color:e.velocity.current>=e.velocity.average?"#059669":"#DC2626",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Review velocity trends. Discuss any significant changes.",durationMs:6e4}}function gh(e){const t=(e.impediments||[]).slice(0,5).map((a,i)=>{const r=a.status==="resolved"?"✅":a.status==="ongoing"?"🔄":"🚨",s=a.status==="resolved"?"#059669":a.status==="ongoing"?"#D97706":"#DC2626";return{id:`impediment-${i}`,type:"text",position:{x:5,y:25+i*13,width:90,height:11,unit:"percent"},content:{type:"text",text:`${r} ${a.description}${a.owner?` (${a.owner})`:""}`,style:{fontSize:20,color:s,lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:400,delayMs:300+i*150}}});return{id:"slide-impediments",title:"Impediments",layout:"titleContent",background:{type:"solid",color:"#FEF2F2"},elements:[{id:"impediments-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"Impediments & Blockers",style:{fontSize:44,fontWeight:700,color:"#991B1B"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t,{id:"legend-impediments",type:"text",position:{x:5,y:90,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Resolved | 🔄 Ongoing | 🚨 Escalated",style:{fontSize:14,color:"#6B7280",textAlign:"center"}}}],notes:"Discuss blockers and what help is needed from stakeholders.",durationMs:6e4}}function yh(e){const t=e.nextSprint.topPriorities.slice(0,5).map((a,i)=>({id:`priority-${i}`,type:"text",position:{x:5,y:45+i*10,width:90,height:8,unit:"percent"},content:{type:"text",text:`${i+1}. ${a.key}: ${a.title}${a.points?` (${a.points} pts)`:""}`,style:{fontSize:20,color:"#374151",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+i*100}}));return{id:"slide-next",title:"Next Sprint",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#EEF2FF",position:0},{color:"#E0E7FF",position:100}],gradientDirection:180},elements:[{id:"next-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:`Sprint ${e.sprint.number+1} Preview`,style:{fontSize:44,fontWeight:700,color:"#4338CA"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"next-goal-label",type:"text",position:{x:5,y:18,width:20,height:6,unit:"percent"},content:{type:"text",text:"Sprint Goal:",style:{fontSize:20,fontWeight:600,color:"#6366F1"}}},{id:"next-goal",type:"text",position:{x:5,y:25,width:90,height:12,unit:"percent"},content:{type:"text",text:e.nextSprint.goal,style:{fontSize:28,color:"#1F2937",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"priorities-label",type:"text",position:{x:5,y:40,width:30,height:5,unit:"percent"},content:{type:"text",text:"Top Priorities:",style:{fontSize:20,fontWeight:600,color:"#6366F1"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t,{id:"capacity",type:"text",position:{x:70,y:5,width:25,height:10,unit:"percent"},content:{type:"text",text:`Capacity: ${e.nextSprint.capacity} pts`,style:{fontSize:20,fontWeight:600,color:"#059669",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}}],notes:"Preview next sprint. Get stakeholder input on priorities.",durationMs:6e4}}function bh(e){const t=[ph(e),mh(e),hh(e),fh(e)];return e.impediments&&e.impediments.length>0&&t.push(gh(e)),t.push(yh(e)),{version:"1.0",id:`sprint-review-${e.sprint.number}`,title:`Sprint ${e.sprint.number} Review - ${e.team.name}`,slideSize:{width:1920,height:1080,unit:"px"},slides:t,theme:{colors:{primary:"#3B82F6",secondary:"#10B981",background:"#FFFFFF",text:"#1F2937",accent:"#8B5CF6"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["sprint-review","agile","scrum"],templateId:"sprint-review-v1"}}}function xh(){return{sprint:{number:24,name:"Phoenix Release",startDate:"2024-03-04",endDate:"2024-03-15",goal:"Complete user authentication flow and improve dashboard performance by 50%"},team:{name:"Alpha",members:[{name:"Sarah Chen",role:"Tech Lead"},{name:"Mike Johnson",role:"Senior Dev"},{name:"Emily Davis",role:"Frontend Dev"},{name:"Alex Kim",role:"QA Engineer"}]},completed:{stories:[{key:"AUTH-123",title:"OAuth2 integration",points:8,assignee:"Sarah",type:"feature",demo:!0},{key:"AUTH-124",title:"Password reset flow",points:5,assignee:"Mike",type:"feature",demo:!0},{key:"DASH-45",title:"Query optimization",points:8,assignee:"Sarah",type:"tech-debt"},{key:"DASH-46",title:"Caching layer",points:5,assignee:"Mike",type:"feature"},{key:"BUG-89",title:"Login timeout issue",points:3,assignee:"Emily",type:"bug"},{key:"BUG-90",title:"Memory leak in charts",points:5,assignee:"Emily",type:"bug"}],totalPoints:34,committedPoints:40},notCompleted:[{key:"AUTH-125",title:"MFA implementation",points:6,reason:"Blocked by security review"}],demos:[{title:"OAuth2 Login",description:"Full OAuth2 flow with Google and GitHub",presenter:"Sarah"},{title:"Password Reset",description:"Email-based password reset with security tokens",presenter:"Mike"}],velocity:{current:34,history:[{sprint:"S20",points:28},{sprint:"S21",points:32},{sprint:"S22",points:35},{sprint:"S23",points:30}],average:31},metrics:{bugsFixed:2,bugsCreated:1,testCoverage:78,deployments:3,cycleTime:4.2},impediments:[{description:"Security review delayed MFA implementation",status:"ongoing",owner:"Security Team"},{description:"CI pipeline slow - 45min builds",status:"resolved",owner:"DevOps"}],nextSprint:{goal:"Complete MFA implementation and launch beta user onboarding",topPriorities:[{key:"AUTH-125",title:"MFA implementation",points:6},{key:"ONBOARD-01",title:"Welcome wizard",points:8},{key:"ONBOARD-02",title:"User tutorial system",points:5},{key:"DASH-50",title:"Real-time notifications",points:5}],capacity:32}}}function vh(e){return{id:"slide-title",title:"Architecture Overview",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#0F172A",position:0},{color:"#1E293B",position:100}],gradientDirection:135},elements:[{id:"title-main",type:"text",position:{x:10,y:28,width:80,height:15,unit:"percent"},content:{type:"text",text:e.project.name,style:{fontSize:64,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"title-subtitle",type:"text",position:{x:15,y:45,width:70,height:8,unit:"percent"},content:{type:"text",text:"Architecture Overview",style:{fontSize:36,color:"#60A5FA",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},{id:"title-version",type:"text",position:{x:35,y:58,width:30,height:5,unit:"percent"},content:{type:"text",text:`v${e.project.version}`,style:{fontSize:20,color:"#94A3B8",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-desc",type:"text",position:{x:15,y:68,width:70,height:12,unit:"percent"},content:{type:"text",text:e.project.description,style:{fontSize:18,color:"#CBD5E1",textAlign:"center",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}},...e.project.team?[{id:"title-team",type:"text",position:{x:10,y:88,width:80,height:5,unit:"percent"},content:{type:"text",text:`Team: ${e.project.team}`,style:{fontSize:16,color:"#64748B",textAlign:"center"}}}]:[]],notes:"Introduction to the system architecture. Set context for the audience.",durationMs:3e4}}function wh(e){const t=e.systemOverview.keyCharacteristics.slice(0,4).map((a,i)=>[{id:`char-card-${i}`,type:"shape",position:{x:5+i*24,y:65,width:22,height:28,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1E293B",stroke:"#334155",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInUp",durationMs:400,delayMs:600+i*100}},{id:`char-value-${i}`,type:"text",position:{x:7+i*24,y:70,width:18,height:10,unit:"percent"},content:{type:"text",text:a.value,style:{fontSize:32,fontWeight:700,color:"#60A5FA",textAlign:"center"}}},{id:`char-label-${i}`,type:"text",position:{x:7+i*24,y:82,width:18,height:8,unit:"percent"},content:{type:"text",text:a.label,style:{fontSize:14,color:"#94A3B8",textAlign:"center"}}}]).flat();return{id:"slide-overview",title:"System Overview",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"overview-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"System Overview",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"overview-summary",type:"text",position:{x:5,y:18,width:90,height:15,unit:"percent"},content:{type:"text",text:e.systemOverview.summary,style:{fontSize:22,color:"#CBD5E1",lineHeight:1.6}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"diagram-placeholder",type:"shape",position:{x:20,y:35,width:60,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1E293B",stroke:"#334155",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:400}},{id:"diagram-label",type:"text",position:{x:35,y:45,width:30,height:6,unit:"percent"},content:{type:"text",text:"📊 System Diagram",style:{fontSize:18,color:"#64748B",textAlign:"center"}}},...t],notes:"High-level system overview. Explain the main purpose and characteristics.",durationMs:6e4}}function kh(e){const t={frontend:"#3B82F6",backend:"#10B981",service:"#8B5CF6",database:"#F59E0B",cache:"#EC4899",queue:"#06B6D4",external:"#6B7280"},a={frontend:"🖥️",backend:"⚙️",service:"🔧",database:"🗄️",cache:"⚡",queue:"📬",external:"🔗"},i=e.components.slice(0,6).flatMap((r,s)=>{const l=Math.floor(s/3),c=s%3,d=t[r.type]||"#6B7280",u=a[r.type]||"📦";return[{id:`comp-card-${s}`,type:"shape",position:{x:5+c*32,y:22+l*38,width:29,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1E293B",stroke:d,strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:200+s*100}},{id:`comp-icon-${s}`,type:"text",position:{x:7+c*32,y:25+l*38,width:6,height:8,unit:"percent"},content:{type:"text",text:u,style:{fontSize:28}}},{id:`comp-name-${s}`,type:"text",position:{x:14+c*32,y:26+l*38,width:18,height:6,unit:"percent"},content:{type:"text",text:r.name,style:{fontSize:18,fontWeight:600,color:"#F8FAFC"}}},{id:`comp-tech-${s}`,type:"text",position:{x:7+c*32,y:34+l*38,width:25,height:5,unit:"percent"},content:{type:"text",text:r.technology,style:{fontSize:12,color:d,fontWeight:500}}},{id:`comp-desc-${s}`,type:"text",position:{x:7+c*32,y:40+l*38,width:25,height:14,unit:"percent"},content:{type:"text",text:r.description,style:{fontSize:12,color:"#94A3B8",lineHeight:1.4}}}]});return{id:"slide-components",title:"Components",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"components-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"System Components",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...i],notes:"Walk through each component. Explain responsibilities and interactions.",durationMs:9e4}}function Sh(e){const a=[{key:"frontend",label:"Frontend",icon:"🖥️",color:"#3B82F6"},{key:"backend",label:"Backend",icon:"⚙️",color:"#10B981"},{key:"database",label:"Database",icon:"🗄️",color:"#F59E0B"},{key:"infrastructure",label:"Infrastructure",icon:"☁️",color:"#8B5CF6"}].flatMap((i,r)=>{const s=e.techStack[i.key];if(!s||s.length===0)return[];const l=r%2,c=Math.floor(r/2);return[{id:`tech-header-${i.key}`,type:"text",position:{x:5+l*48,y:20+c*40,width:44,height:6,unit:"percent"},content:{type:"text",text:`${i.icon} ${i.label}`,style:{fontSize:24,fontWeight:600,color:i.color}},animation:{effect:"fadeIn",durationMs:400,delayMs:200+r*100}},...s.slice(0,4).map((d,u)=>({id:`tech-item-${i.key}-${u}`,type:"text",position:{x:7+l*48,y:28+c*40+u*7,width:40,height:5,unit:"percent"},content:{type:"text",text:`• ${d.name}${d.version?` v${d.version}`:""} - ${d.purpose}`,style:{fontSize:14,color:"#CBD5E1",lineHeight:1.3}},animation:{effect:"slideInRight",durationMs:300,delayMs:400+r*100+u*50}}))]});return{id:"slide-techstack",title:"Tech Stack",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"techstack-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Technology Stack",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...a],notes:"Overview of technologies used. Explain key decisions.",durationMs:6e4}}function Ch(e){const t=e.infrastructure.services.slice(0,8).map((a,i)=>{const r=i%4,s=Math.floor(i/4);return{id:`infra-svc-${i}`,type:"text",position:{x:5+r*24,y:50+s*15,width:22,height:12,unit:"percent"},content:{type:"text",text:`${a.icon||"☁️"} ${a.name}
1351
+ ${a.purpose}`,style:{fontSize:14,color:"#CBD5E1",textAlign:"center",lineHeight:1.4}},animation:{effect:"zoomIn",durationMs:300,delayMs:400+i*80}}});return{id:"slide-infrastructure",title:"Infrastructure",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#0F172A",position:0},{color:"#1E1B4B",position:100}],gradientDirection:180},elements:[{id:"infra-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Infrastructure",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"infra-provider",type:"text",position:{x:5,y:18,width:45,height:8,unit:"percent"},content:{type:"text",text:`☁️ Provider: ${e.infrastructure.provider}`,style:{fontSize:24,color:"#A78BFA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...e.infrastructure.regions?[{id:"infra-regions",type:"text",position:{x:55,y:18,width:40,height:8,unit:"percent"},content:{type:"text",text:`🌍 Regions: ${e.infrastructure.regions.join(", ")}`,style:{fontSize:18,color:"#94A3B8",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}}]:[],{id:"infra-diagram",type:"shape",position:{x:15,y:28,width:70,height:18,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1E293B",stroke:"#8B5CF6",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:350}},{id:"infra-diagram-text",type:"text",position:{x:35,y:35,width:30,height:5,unit:"percent"},content:{type:"text",text:"🏗️ Infrastructure Diagram",style:{fontSize:16,color:"#64748B",textAlign:"center"}}},...t],notes:"Explain infrastructure setup, scaling strategy, and deployment.",durationMs:6e4}}function _h(e){if(!e.security)return{id:"slide-security",title:"Security",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"security-placeholder",type:"text",position:{x:30,y:45,width:40,height:10,unit:"percent"},content:{type:"text",text:"Security details to be added",style:{fontSize:24,color:"#64748B",textAlign:"center"}}}],durationMs:3e4};const t=e.security.practices.slice(0,6).map((a,i)=>({id:`practice-${i}`,type:"text",position:{x:5,y:55+i*7,width:90,height:5,unit:"percent"},content:{type:"text",text:`✓ ${a}`,style:{fontSize:18,color:"#4ADE80"}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+i*100}}));return{id:"slide-security",title:"Security",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"security-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔒 Security",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"security-auth",type:"text",position:{x:5,y:20,width:45,height:10,unit:"percent"},content:{type:"text",text:`🔑 Auth: ${e.security.authMethod}`,style:{fontSize:22,color:"#60A5FA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"security-encryption",type:"text",position:{x:5,y:30,width:45,height:10,unit:"percent"},content:{type:"text",text:`🔐 Encryption: ${e.security.encryption}`,style:{fontSize:22,color:"#60A5FA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...e.security.compliance?[{id:"security-compliance",type:"text",position:{x:55,y:20,width:40,height:20,unit:"percent"},content:{type:"text",text:`📋 Compliance:
1352
+ ${e.security.compliance.join(`
1353
+ `)}`,style:{fontSize:18,color:"#94A3B8",lineHeight:1.6}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}}]:[],{id:"practices-header",type:"text",position:{x:5,y:45,width:90,height:8,unit:"percent"},content:{type:"text",text:"Security Practices",style:{fontSize:24,fontWeight:600,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t],notes:"Cover security measures and compliance requirements.",durationMs:6e4}}function jh(e){const t=[vh(e),wh(e),kh(e),Sh(e),Ch(e)];return e.security&&t.push(_h(e)),{version:"1.0",id:`architecture-${e.project.name.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.project.name} - Architecture Overview`,slideSize:{width:1920,height:1080,unit:"px"},slides:t,theme:{colors:{primary:"#3B82F6",secondary:"#8B5CF6",background:"#0F172A",text:"#F8FAFC",accent:"#10B981"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["architecture","technical","system-design"],templateId:"architecture-overview-v1"}}}function Nh(){return{project:{name:"E-Commerce Platform",version:"2.5.0",description:"Scalable microservices-based e-commerce platform serving 10M+ users",team:"Platform Engineering"},systemOverview:{summary:"A modern e-commerce platform built on microservices architecture, designed for high availability, horizontal scaling, and real-time inventory management. The system handles 50K+ concurrent users with sub-100ms response times.",keyCharacteristics:[{label:"Services",value:"12"},{label:"Availability",value:"99.9%"},{label:"Response Time",value:"<100ms"},{label:"Daily Orders",value:"500K+"}]},components:[{name:"Web App",type:"frontend",description:"React SPA with SSR support",technology:"Next.js 14"},{name:"Mobile BFF",type:"backend",description:"Backend for mobile apps",technology:"Node.js/Express"},{name:"Order Service",type:"service",description:"Order processing and management",technology:"Go"},{name:"Inventory Service",type:"service",description:"Real-time stock management",technology:"Rust"},{name:"PostgreSQL",type:"database",description:"Primary transactional database",technology:"PostgreSQL 15"},{name:"Redis Cluster",type:"cache",description:"Session and caching layer",technology:"Redis 7"}],dataFlow:{description:"Request flows from CDN through API Gateway to microservices",steps:[{from:"Client",to:"CDN",description:"Static assets",protocol:"HTTPS"},{from:"Client",to:"API Gateway",description:"API requests",protocol:"HTTPS"},{from:"API Gateway",to:"Services",description:"Routed requests",protocol:"gRPC"},{from:"Services",to:"Message Queue",description:"Async events",protocol:"AMQP"}]},techStack:{frontend:[{name:"Next.js",version:"14",purpose:"React framework with SSR"},{name:"TypeScript",version:"5.3",purpose:"Type safety"},{name:"Tailwind CSS",version:"3.4",purpose:"Styling"}],backend:[{name:"Go",version:"1.21",purpose:"High-performance services"},{name:"Node.js",version:"20",purpose:"BFF and tooling"},{name:"gRPC",purpose:"Service communication"}],database:[{name:"PostgreSQL",version:"15",purpose:"Primary OLTP"},{name:"Redis",version:"7",purpose:"Caching"},{name:"Elasticsearch",version:"8",purpose:"Search"}],infrastructure:[{name:"Kubernetes",purpose:"Container orchestration"},{name:"Terraform",purpose:"Infrastructure as Code"},{name:"ArgoCD",purpose:"GitOps deployments"}]},infrastructure:{provider:"AWS",regions:["us-east-1","eu-west-1","ap-southeast-1"],services:[{name:"EKS",purpose:"Kubernetes",icon:"⚙️"},{name:"RDS",purpose:"PostgreSQL",icon:"🗄️"},{name:"ElastiCache",purpose:"Redis",icon:"⚡"},{name:"S3",purpose:"Object Storage",icon:"📦"},{name:"CloudFront",purpose:"CDN",icon:"🌐"},{name:"Route 53",purpose:"DNS",icon:"🔗"},{name:"SQS/SNS",purpose:"Messaging",icon:"📬"},{name:"CloudWatch",purpose:"Monitoring",icon:"📊"}]},security:{authMethod:"OAuth 2.0 + JWT",encryption:"AES-256 at rest, TLS 1.3 in transit",compliance:["SOC 2 Type II","PCI DSS","GDPR"],practices:["Zero-trust network architecture","Secrets managed via HashiCorp Vault","Regular penetration testing","Automated vulnerability scanning","Role-based access control (RBAC)","Audit logging for all operations"]}}}function Mh(e){return{id:"slide-welcome",title:"Welcome",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#7C3AED",position:0},{color:"#A78BFA",position:50},{color:"#C4B5FD",position:100}],gradientDirection:135},elements:[{id:"welcome-title",type:"text",position:{x:10,y:20,width:80,height:15,unit:"percent"},content:{type:"text",text:`Welcome to ${e.company.name}! 🎉`,style:{fontSize:56,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:700,delayMs:0}},{id:"welcome-name",type:"text",position:{x:15,y:42,width:70,height:12,unit:"percent"},content:{type:"text",text:e.newHire.name,style:{fontSize:48,fontWeight:600,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:400}},{id:"welcome-role",type:"text",position:{x:20,y:56,width:60,height:8,unit:"percent"},content:{type:"text",text:e.newHire.role,style:{fontSize:28,color:"#EDE9FE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:600}},{id:"welcome-team",type:"text",position:{x:25,y:66,width:50,height:6,unit:"percent"},content:{type:"text",text:`Team: ${e.newHire.team}`,style:{fontSize:22,color:"#DDD6FE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:750}},{id:"welcome-date",type:"text",position:{x:30,y:75,width:40,height:5,unit:"percent"},content:{type:"text",text:`Start Date: ${e.newHire.startDate}`,style:{fontSize:18,color:"#C4B5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:900}},...e.company.tagline?[{id:"welcome-tagline",type:"text",position:{x:15,y:88,width:70,height:5,unit:"percent"},content:{type:"text",text:`"${e.company.tagline}"`,style:{fontSize:18,fontStyle:"italic",color:"#EDE9FE",textAlign:"center"}}}]:[]],notes:"Warm welcome! Make the new hire feel excited to join.",durationMs:3e4}}function $h(e){const t=e.culture.values.slice(0,4).flatMap((a,i)=>{const r=i%2,s=Math.floor(i/2);return[{id:`value-card-${i}`,type:"shape",position:{x:5+r*48,y:45+s*27,width:44,height:24,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E9D5FF",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:500+i*150}},{id:`value-icon-${i}`,type:"text",position:{x:8+r*48,y:48+s*27,width:8,height:10,unit:"percent"},content:{type:"text",text:a.icon||"✨",style:{fontSize:36}}},{id:`value-name-${i}`,type:"text",position:{x:17+r*48,y:49+s*27,width:30,height:6,unit:"percent"},content:{type:"text",text:a.name,style:{fontSize:20,fontWeight:600,color:"#6D28D9"}}},{id:`value-desc-${i}`,type:"text",position:{x:8+r*48,y:58+s*27,width:38,height:10,unit:"percent"},content:{type:"text",text:a.description,style:{fontSize:14,color:"#6B7280",lineHeight:1.4}}}]});return{id:"slide-culture",title:"Culture & Values",layout:"titleContent",background:{type:"solid",color:"#FAF5FF"},elements:[{id:"culture-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Our Culture & Values",style:{fontSize:44,fontWeight:700,color:"#6D28D9"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"culture-mission-label",type:"text",position:{x:5,y:18,width:20,height:5,unit:"percent"},content:{type:"text",text:"🎯 Our Mission",style:{fontSize:18,fontWeight:600,color:"#7C3AED"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"culture-mission",type:"text",position:{x:5,y:25,width:90,height:15,unit:"percent"},content:{type:"text",text:e.culture.mission,style:{fontSize:24,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:500,delayMs:350}},...t],notes:"Explain company culture and core values. Share real examples.",durationMs:9e4}}function Eh(e){const t=e.team.members.slice(0,8).map((a,i)=>{const r=i%4,s=Math.floor(i/4);return{id:`member-${i}`,type:"text",position:{x:5+r*24,y:40+s*25,width:22,height:22,unit:"percent"},content:{type:"text",text:`👤
1354
+ ${a.name}
1355
+ ${a.role}`,style:{fontSize:14,color:"#374151",textAlign:"center",lineHeight:1.6}},animation:{effect:"zoomIn",durationMs:300,delayMs:400+i*80}}});return{id:"slide-team",title:"Meet the Team",layout:"titleContent",background:{type:"solid",color:"#F0FDF4"},elements:[{id:"team-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:`Meet Team ${e.team.name} 👋`,style:{fontSize:44,fontWeight:700,color:"#166534"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"team-desc",type:"text",position:{x:5,y:18,width:90,height:12,unit:"percent"},content:{type:"text",text:e.team.description,style:{fontSize:20,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...e.newHire.manager?[{id:"team-manager",type:"text",position:{x:5,y:32,width:45,height:6,unit:"percent"},content:{type:"text",text:`📋 Manager: ${e.newHire.manager}`,style:{fontSize:18,color:"#059669"}}}]:[],...e.newHire.buddy?[{id:"team-buddy",type:"text",position:{x:50,y:32,width:45,height:6,unit:"percent"},content:{type:"text",text:`🤝 Onboarding Buddy: ${e.newHire.buddy}`,style:{fontSize:18,color:"#059669"}}}]:[],...t],notes:"Introduce team members. Share their roles and how to reach them.",durationMs:9e4}}function zh(e){const t=e.tools.filter(s=>s.priority==="essential"),a=e.tools.filter(s=>s.priority==="recommended"),i=t.slice(0,4).map((s,l)=>({id:`tool-essential-${l}`,type:"text",position:{x:5,y:28+l*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${s.icon||"🔧"} ${s.name} - ${s.purpose}`,style:{fontSize:16,color:"#374151",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:400+l*100}})),r=a.slice(0,4).map((s,l)=>({id:`tool-recommended-${l}`,type:"text",position:{x:52,y:28+l*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${s.icon||"📦"} ${s.name} - ${s.purpose}`,style:{fontSize:16,color:"#6B7280",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+l*100}}));return{id:"slide-tools",title:"Tools & Access",layout:"twoColumn",background:{type:"solid",color:"#F0F9FF"},elements:[{id:"tools-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🛠️ Tools & Access",style:{fontSize:44,fontWeight:700,color:"#1E40AF"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"tools-essential-header",type:"text",position:{x:5,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"⭐ Essential (Day 1)",style:{fontSize:22,fontWeight:600,color:"#1D4ED8"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"tools-recommended-header",type:"text",position:{x:52,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"📦 Recommended",style:{fontSize:22,fontWeight:600,color:"#3B82F6"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...i,...r,{id:"tools-note",type:"text",position:{x:5,y:85,width:90,height:8,unit:"percent"},content:{type:"text",text:"💡 IT will help set up your accounts. Contact IT Support if you have issues.",style:{fontSize:16,color:"#6B7280",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Review all tools needed for day 1. Ensure access is set up.",durationMs:6e4}}function Ah(e){const t=e.firstTasks.slice(0,5).flatMap((a,i)=>[{id:`day-header-${i}`,type:"text",position:{x:5+i*19,y:22,width:17,height:8,unit:"percent"},content:{type:"text",text:`Day ${a.day}`,style:{fontSize:20,fontWeight:700,color:"#6D28D9",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200+i*100}},{id:`day-card-${i}`,type:"shape",position:{x:5+i*19,y:32,width:17,height:58,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E9D5FF",strokeWidth:1,cornerRadius:8},animation:{effect:"slideInUp",durationMs:400,delayMs:300+i*100}},...a.tasks.slice(0,4).map((r,s)=>({id:`task-${i}-${s}`,type:"text",position:{x:6+i*19,y:35+s*12,width:15,height:10,unit:"percent"},content:{type:"text",text:`☐ ${r.task}`,style:{fontSize:11,color:"#374151",lineHeight:1.3}}}))]);return{id:"slide-firstweek",title:"First Week",layout:"titleContent",background:{type:"solid",color:"#FAF5FF"},elements:[{id:"firstweek-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"📅 Your First Week",style:{fontSize:44,fontWeight:700,color:"#6D28D9"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Walk through first week schedule. Be realistic about expectations.",durationMs:9e4}}function Fh(e){const t=[];let a=0;return e.contacts.hr&&(t.push({id:"contact-hr",type:"text",position:{x:5+a*32,y:45,width:29,height:25,unit:"percent"},content:{type:"text",text:`👥 HR
1356
+ ${e.contacts.hr.name}
1357
+ ${e.contacts.hr.email}`,style:{fontSize:18,color:"#374151",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:400}}),a++),e.contacts.it&&(t.push({id:"contact-it",type:"text",position:{x:5+a*32,y:45,width:29,height:25,unit:"percent"},content:{type:"text",text:`💻 IT Support
1358
+ ${e.contacts.it.name}
1359
+ ${e.contacts.it.email}`,style:{fontSize:18,color:"#374151",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:500}}),a++),e.contacts.facilities&&t.push({id:"contact-facilities",type:"text",position:{x:5+a*32,y:45,width:29,height:25,unit:"percent"},content:{type:"text",text:`🏢 Facilities
1360
+ ${e.contacts.facilities.name}
1361
+ ${e.contacts.facilities.email}`,style:{fontSize:18,color:"#374151",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:600}}),{id:"slide-contacts",title:"Key Contacts",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#7C3AED",position:0},{color:"#8B5CF6",position:100}],gradientDirection:180},elements:[{id:"contacts-title",type:"text",position:{x:5,y:10,width:90,height:12,unit:"percent"},content:{type:"text",text:"📞 Key Contacts",style:{fontSize:44,fontWeight:700,color:"#FFFFFF"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"contacts-subtitle",type:"text",position:{x:10,y:25,width:80,height:10,unit:"percent"},content:{type:"text",text:"Your go-to people for help",style:{fontSize:24,color:"#DDD6FE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...t,{id:"contacts-welcome",type:"text",position:{x:15,y:80,width:70,height:12,unit:"percent"},content:{type:"text",text:"We're excited to have you on the team! 🚀",style:{fontSize:28,fontWeight:600,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:600,delayMs:800}}],notes:"Share key contacts. Encourage asking questions.",durationMs:45e3}}function Ih(e){return{version:"1.0",id:`onboarding-${e.newHire.name.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.newHire.name} - Welcome to ${e.company.name}`,slideSize:{width:1920,height:1080,unit:"px"},slides:[Mh(e),$h(e),Eh(e),zh(e),Ah(e),Fh(e)],theme:{colors:{primary:"#7C3AED",secondary:"#10B981",background:"#FFFFFF",text:"#1F2937",accent:"#F59E0B"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["onboarding","new-hire","welcome"],templateId:"onboarding-v1"}}}function Dh(){return{company:{name:"TechCorp",tagline:"Building the future, together",founded:"2015"},newHire:{name:"Alex Johnson",role:"Senior Software Engineer",team:"Platform",startDate:"March 20, 2024",manager:"Sarah Chen",buddy:"Mike Rodriguez"},culture:{mission:"To empower developers worldwide with tools that make their work more productive, enjoyable, and impactful.",values:[{name:"Innovation",description:"We embrace new ideas and technologies to solve problems in creative ways.",icon:"💡"},{name:"Collaboration",description:"Great things happen when we work together. We value every voice.",icon:"🤝"},{name:"Quality",description:"We take pride in our craft and deliver excellence in everything we do.",icon:"⭐"},{name:"Growth",description:"We invest in learning and support each other's professional development.",icon:"🌱"}]},team:{name:"Platform",description:"We build and maintain the core infrastructure that powers all TechCorp products. Our focus is on reliability, scalability, and developer experience.",members:[{name:"Sarah Chen",role:"Engineering Manager"},{name:"Mike Rodriguez",role:"Staff Engineer"},{name:"Emily Park",role:"Senior Engineer"},{name:"James Wilson",role:"Senior Engineer"},{name:"Priya Sharma",role:"Engineer II"},{name:"David Kim",role:"Engineer I"}],channels:[{name:"#platform-team",purpose:"Team discussions"},{name:"#platform-oncall",purpose:"On-call coordination"}]},tools:[{name:"Slack",purpose:"Team communication",icon:"💬",priority:"essential"},{name:"GitHub",purpose:"Code repository",icon:"🐙",priority:"essential"},{name:"Jira",purpose:"Project tracking",icon:"📋",priority:"essential"},{name:"Notion",purpose:"Documentation",icon:"📝",priority:"essential"},{name:"Figma",purpose:"Design collaboration",icon:"🎨",priority:"recommended"},{name:"1Password",purpose:"Password management",icon:"🔐",priority:"recommended"},{name:"Zoom",purpose:"Video meetings",icon:"📹",priority:"recommended"}],processes:[{name:"Daily Standup",description:"15min sync every morning at 9:30am",frequency:"Daily"},{name:"Sprint Planning",description:"Plan upcoming sprint work",frequency:"Bi-weekly"},{name:"Code Review",description:"All PRs require 2 approvals",frequency:"Per PR"},{name:"1:1 with Manager",description:"Regular check-in with your manager",frequency:"Weekly"}],firstTasks:[{day:1,tasks:[{task:"Complete HR paperwork"},{task:"Set up laptop"},{task:"Join Slack channels"},{task:"Meet your buddy"}]},{day:2,tasks:[{task:"Dev environment setup"},{task:"Read team docs"},{task:"Shadow code review"},{task:"Team lunch 🍕"}]},{day:3,tasks:[{task:"First small PR"},{task:"Attend standup"},{task:"Architecture overview"},{task:"1:1 with manager"}]},{day:4,tasks:[{task:"Deep-dive session"},{task:"Continue coding"},{task:"Ask questions!"}]},{day:5,tasks:[{task:"Week 1 retro"},{task:"Set goals for week 2"},{task:"Friday demo"}]}],resources:[{category:"Engineering",items:[{name:"Engineering Handbook",url:"notion.so/engineering",description:"Our engineering practices"},{name:"Architecture Docs",url:"notion.so/architecture",description:"System design docs"}]}],contacts:{hr:{name:"Lisa Thompson",email:"lisa.t@techcorp.com"},it:{name:"IT Help Desk",email:"it-support@techcorp.com"},facilities:{name:"Office Admin",email:"facilities@techcorp.com"}}}}function Th(e){return{P1:"#DC2626",P2:"#F59E0B",P3:"#3B82F6",P4:"#6B7280"}[e]||"#6B7280"}function Rh(e){return{P1:"Critical",P2:"High",P3:"Medium",P4:"Low"}[e]||"Unknown"}function Ph(e){const t=Th(e.incident.severity);return{id:"slide-title",title:"Incident Report",layout:"titleSlide",background:{type:"solid",color:"#0F172A"},elements:[{id:"title-badge",type:"shape",position:{x:35,y:15,width:30,height:8,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:t,cornerRadius:20},animation:{effect:"zoomIn",durationMs:400,delayMs:0}},{id:"title-severity",type:"text",position:{x:35,y:16.5,width:30,height:5,unit:"percent"},content:{type:"text",text:`${e.incident.severity} - ${Rh(e.incident.severity)}`,style:{fontSize:24,fontWeight:700,color:"#FFFFFF",textAlign:"center"}}},{id:"title-main",type:"text",position:{x:5,y:28,width:90,height:18,unit:"percent"},content:{type:"text",text:`Incident Report:
1362
+ ${e.incident.title}`,style:{fontSize:44,fontWeight:700,color:"#F8FAFC",textAlign:"center",lineHeight:1.3}},animation:{effect:"fadeIn",durationMs:600,delayMs:200}},{id:"title-id",type:"text",position:{x:35,y:50,width:30,height:5,unit:"percent"},content:{type:"text",text:`ID: ${e.incident.id}`,style:{fontSize:18,color:"#94A3B8",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}},{id:"title-date",type:"text",position:{x:25,y:60,width:50,height:5,unit:"percent"},content:{type:"text",text:`Date: ${e.incident.date} | Duration: ${e.incident.duration}`,style:{fontSize:20,color:"#CBD5E1",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-status",type:"text",position:{x:35,y:70,width:30,height:5,unit:"percent"},content:{type:"text",text:`Status: ${e.incident.status.toUpperCase()}`,style:{fontSize:22,fontWeight:600,color:e.incident.status==="resolved"?"#4ADE80":"#FBBF24",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},...e.incident.commander?[{id:"title-commander",type:"text",position:{x:30,y:80,width:40,height:5,unit:"percent"},content:{type:"text",text:`Incident Commander: ${e.incident.commander}`,style:{fontSize:16,color:"#64748B",textAlign:"center"}}}]:[]],notes:"Set the context. State severity and basic facts.",durationMs:3e4}}function Bh(e){return{id:"slide-summary",title:"Executive Summary",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"summary-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Executive Summary",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"summary-what-label",type:"text",position:{x:5,y:20,width:90,height:5,unit:"percent"},content:{type:"text",text:"❓ What Happened",style:{fontSize:22,fontWeight:600,color:"#60A5FA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"summary-what",type:"text",position:{x:5,y:27,width:90,height:15,unit:"percent"},content:{type:"text",text:e.summary.whatHappened,style:{fontSize:18,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"summary-impact-label",type:"text",position:{x:5,y:45,width:90,height:5,unit:"percent"},content:{type:"text",text:"💥 Impact",style:{fontSize:22,fontWeight:600,color:"#F87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}},{id:"summary-impact",type:"text",position:{x:5,y:52,width:90,height:12,unit:"percent"},content:{type:"text",text:e.summary.impact,style:{fontSize:18,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"summary-resolution-label",type:"text",position:{x:5,y:68,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Resolution",style:{fontSize:22,fontWeight:600,color:"#4ADE80"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},{id:"summary-resolution",type:"text",position:{x:5,y:75,width:90,height:15,unit:"percent"},content:{type:"text",text:e.summary.resolution,style:{fontSize:18,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}}],notes:"High-level summary for executives. Keep it brief and factual.",durationMs:6e4}}function Lh(e){const t={detection:"#F59E0B",escalation:"#EF4444",action:"#3B82F6",resolution:"#10B981",communication:"#8B5CF6"},a={detection:"🔍",escalation:"🚨",action:"⚡",resolution:"✅",communication:"📢"},i=e.timeline.slice(0,10).flatMap((r,s)=>{const l=22+s*7.5,c=t[r.type]||"#6B7280",d=a[r.type]||"•";return[{id:`timeline-time-${s}`,type:"text",position:{x:5,y:l,width:12,height:6,unit:"percent"},content:{type:"text",text:r.time,style:{fontSize:14,fontWeight:600,color:"#94A3B8"}},animation:{effect:"fadeIn",durationMs:200,delayMs:300+s*100}},{id:`timeline-dot-${s}`,type:"text",position:{x:18,y:l,width:4,height:6,unit:"percent"},content:{type:"text",text:d,style:{fontSize:16}}},{id:`timeline-event-${s}`,type:"text",position:{x:23,y:l,width:72,height:6,unit:"percent"},content:{type:"text",text:r.event,style:{fontSize:15,color:c}},animation:{effect:"slideInRight",durationMs:300,delayMs:350+s*100}}]});return{id:"slide-timeline",title:"Timeline",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"timeline-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"📅 Incident Timeline",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"timeline-line",type:"shape",position:{x:20,y:22,width:.5,height:70,unit:"percent"},content:{type:"shape",shape:"rect",fill:"#334155"},animation:{effect:"fadeIn",durationMs:300,delayMs:200}},...i,{id:"timeline-legend",type:"text",position:{x:5,y:92,width:90,height:5,unit:"percent"},content:{type:"text",text:"🔍 Detection | 🚨 Escalation | ⚡ Action | ✅ Resolution | 📢 Communication",style:{fontSize:12,color:"#64748B",textAlign:"center"}}}],notes:"Walk through the timeline. Identify key decision points.",durationMs:12e4}}function Oh(e){const t=[];let a=0;e.impact.usersAffected&&(t.push({id:"impact-users",type:"text",position:{x:5+a*24,y:25,width:22,height:20,unit:"percent"},content:{type:"text",text:`👥
1363
+ ${e.impact.usersAffected}
1364
+ Users Affected`,style:{fontSize:18,color:"#F87171",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:300+a*100}}),a++),e.impact.revenueImpact&&(t.push({id:"impact-revenue",type:"text",position:{x:5+a*24,y:25,width:22,height:20,unit:"percent"},content:{type:"text",text:`💰
1365
+ ${e.impact.revenueImpact}
1366
+ Revenue Impact`,style:{fontSize:18,color:"#FBBF24",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:300+a*100}}),a++),e.impact.slaViolation!==void 0&&(t.push({id:"impact-sla",type:"text",position:{x:5+a*24,y:25,width:22,height:20,unit:"percent"},content:{type:"text",text:`📋
1367
+ ${e.impact.slaViolation?"Yes":"No"}
1368
+ SLA Violation`,style:{fontSize:18,color:e.impact.slaViolation?"#F87171":"#4ADE80",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:300+a*100}}),a++);const i=e.impact.affectedServices.slice(0,6).map((r,s)=>({id:`impact-svc-${s}`,type:"text",position:{x:5+s%3*32,y:55+Math.floor(s/3)*10,width:30,height:8,unit:"percent"},content:{type:"text",text:`⚠️ ${r}`,style:{fontSize:16,color:"#F87171"}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+s*80}}));return{id:"slide-impact",title:"Impact Assessment",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"impact-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"💥 Impact Assessment",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t,{id:"impact-services-label",type:"text",position:{x:5,y:48,width:90,height:6,unit:"percent"},content:{type:"text",text:"Affected Services",style:{fontSize:22,fontWeight:600,color:"#94A3B8"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...i,...e.impact.dataLoss?[{id:"impact-dataloss",type:"text",position:{x:5,y:80,width:90,height:10,unit:"percent"},content:{type:"text",text:`📊 Data Loss: ${e.impact.dataLoss}`,style:{fontSize:18,color:"#F87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:900}}]:[]],notes:"Quantify the impact. Be specific about affected users and services.",durationMs:6e4}}function Hh(e){const t=e.rootCause.contributing.slice(0,4).map((a,i)=>({id:`contributing-${i}`,type:"text",position:{x:5,y:68+i*7,width:90,height:6,unit:"percent"},content:{type:"text",text:`• ${a}`,style:{fontSize:16,color:"#94A3B8",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:800+i*100}}));return{id:"slide-rootcause",title:"Root Cause Analysis",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"rootcause-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔍 Root Cause Analysis",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"rootcause-immediate-label",type:"text",position:{x:5,y:18,width:90,height:5,unit:"percent"},content:{type:"text",text:"⚡ Immediate Cause",style:{fontSize:20,fontWeight:600,color:"#F87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"rootcause-immediate",type:"text",position:{x:5,y:25,width:90,height:12,unit:"percent"},content:{type:"text",text:e.rootCause.immediate,style:{fontSize:18,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:350}},{id:"rootcause-underlying-label",type:"text",position:{x:5,y:40,width:90,height:5,unit:"percent"},content:{type:"text",text:"🎯 Underlying Root Cause",style:{fontSize:20,fontWeight:600,color:"#FBBF24"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"rootcause-underlying",type:"text",position:{x:5,y:47,width:90,height:12,unit:"percent"},content:{type:"text",text:e.rootCause.underlying,style:{fontSize:18,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:650}},{id:"rootcause-contributing-label",type:"text",position:{x:5,y:62,width:90,height:5,unit:"percent"},content:{type:"text",text:"📋 Contributing Factors",style:{fontSize:20,fontWeight:600,color:"#60A5FA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:750}},...t],notes:"Be blameless. Focus on systems and processes, not individuals.",durationMs:9e4}}function Wh(e){const t=e.remediation.immediate.slice(0,4).map((i,r)=>{const s=i.status==="done"?"✅":i.status==="in-progress"?"🔄":"📋",l=i.status==="done"?"#4ADE80":i.status==="in-progress"?"#FBBF24":"#94A3B8";return{id:`remediation-immediate-${r}`,type:"text",position:{x:5,y:28+r*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${s} ${i.action}
1369
+ Owner: ${i.owner}`,style:{fontSize:14,color:l,lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:400+r*100}}}),a=e.remediation.longTerm.slice(0,4).map((i,r)=>{const s=i.priority==="high"?"🔴":i.priority==="medium"?"🟡":"🟢";return{id:`remediation-longterm-${r}`,type:"text",position:{x:52,y:28+r*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${s} ${i.action}
1370
+ Owner: ${i.owner}`,style:{fontSize:14,color:"#CBD5E1",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+r*100}}});return{id:"slide-remediation",title:"Remediation",layout:"twoColumn",background:{type:"solid",color:"#0F172A"},elements:[{id:"remediation-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔧 Remediation Actions",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"remediation-immediate-header",type:"text",position:{x:5,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"⚡ Immediate Actions",style:{fontSize:22,fontWeight:600,color:"#F87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"remediation-longterm-header",type:"text",position:{x:52,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"📅 Long-term Actions",style:{fontSize:22,fontWeight:600,color:"#60A5FA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...t,...a,{id:"remediation-legend",type:"text",position:{x:5,y:88,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Done | 🔄 In Progress | 📋 Planned || 🔴 High | 🟡 Medium | 🟢 Low",style:{fontSize:12,color:"#64748B",textAlign:"center"}}}],notes:"Track action items. Ensure clear ownership and deadlines.",durationMs:6e4}}function qh(e){const t=e.lessons.slice(0,6).map((a,i)=>({id:`lesson-${i}`,type:"text",position:{x:5,y:25+i*12,width:90,height:10,unit:"percent"},content:{type:"text",text:`${i+1}. ${a}`,style:{fontSize:20,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"slideInRight",durationMs:400,delayMs:300+i*150}}));return{id:"slide-lessons",title:"Lessons Learned",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#0F172A",position:0},{color:"#1E3A8A",position:100}],gradientDirection:180},elements:[{id:"lessons-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"💡 Lessons Learned",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Key takeaways. Focus on actionable improvements.",durationMs:9e4}}function Vh(e){return{version:"1.0",id:`incident-${e.incident.id}`,title:`Incident Report - ${e.incident.id}: ${e.incident.title}`,slideSize:{width:1920,height:1080,unit:"px"},slides:[Ph(e),Bh(e),Lh(e),Oh(e),Hh(e),Wh(e),qh(e)],theme:{colors:{primary:"#3B82F6",secondary:"#F87171",background:"#0F172A",text:"#F8FAFC",accent:"#4ADE80"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["incident","postmortem","PIR"],templateId:"incident-report-v1"}}}function Kh(){return{incident:{id:"INC-2024-0342",title:"Payment Service Outage",severity:"P1",status:"resolved",date:"March 15, 2024",duration:"2h 34m",commander:"Emily Chen"},summary:{whatHappened:"The payment processing service became unresponsive due to a database connection pool exhaustion, preventing customers from completing purchases.",impact:"Approximately 15,000 users were unable to complete transactions, resulting in an estimated revenue loss of $127,000.",resolution:"Database connection pool limits were increased, and a connection leak in the payment service was identified and fixed."},timeline:[{time:"14:23",event:"Automated alert: Payment service error rate >5%",type:"detection"},{time:"14:25",event:"On-call engineer acknowledges alert",type:"action"},{time:"14:32",event:"Incident declared, Emily Chen as IC",type:"escalation"},{time:"14:35",event:"Status page updated",type:"communication"},{time:"14:45",event:"Database team joined",type:"escalation"},{time:"15:12",event:"Root cause identified: connection pool exhaustion",type:"action"},{time:"15:28",event:"Emergency fix deployed",type:"action"},{time:"16:15",event:"Service fully recovered",type:"resolution"},{time:"16:57",event:"Incident marked resolved",type:"resolution"}],impact:{usersAffected:"~15,000",revenueImpact:"$127,000",slaViolation:!0,affectedServices:["Payment Gateway","Checkout Flow","Order Service","Mobile App"],regions:["North America","Europe"]},rootCause:{immediate:"Database connection pool was exhausted due to connections not being properly released after use.",underlying:"A recent code change introduced a connection leak in the retry logic of the payment service.",contributing:["Insufficient connection pool monitoring alerts","Code review did not catch the connection leak","No automated testing for connection handling","Documentation for database client usage was outdated"]},response:{detectionTime:"2 minutes",responseTime:"9 minutes",resolutionTime:"2h 34m",whatWorked:["Automated alerting triggered quickly","Clear incident commander assignment","Good cross-team communication"],whatDidntWork:["Initial diagnosis took too long","Runbooks were outdated","No quick rollback option available"]},remediation:{immediate:[{action:"Increase connection pool size",owner:"Platform Team",status:"done"},{action:"Fix connection leak in payment service",owner:"Payments Team",status:"done"},{action:"Add connection pool metrics to dashboard",owner:"SRE Team",status:"in-progress"}],longTerm:[{action:"Implement automated connection leak detection",owner:"Platform Team",priority:"high",dueDate:"Q2 2024"},{action:"Update code review checklist",owner:"Engineering Leads",priority:"medium",dueDate:"April 2024"},{action:"Improve runbooks for database issues",owner:"SRE Team",priority:"medium",dueDate:"April 2024"},{action:"Add integration tests for connection handling",owner:"Payments Team",priority:"high",dueDate:"Q2 2024"}]},lessons:["Connection pool monitoring should be a standard metric for all services","Code changes affecting database connections need explicit review","Having a quick rollback plan is critical for payment systems","Runbooks must be tested and updated regularly","Cross-team communication during incidents was effective and should be maintained"],team:[{name:"Emily Chen",role:"Incident Commander"},{name:"Marcus Johnson",role:"On-call Engineer"},{name:"Priya Patel",role:"Database Expert"},{name:"Alex Kim",role:"Payments Team Lead"}]}}function Tr(e){return{name:e.name,primaryColor:e.colors.primary,secondaryColor:e.colors.secondary,accentColor:e.colors.accent,backgroundColor:e.colors.background,textColor:e.colors.text,headingColor:e.colors.heading,fontFamily:e.fonts.body,headingFontFamily:e.fonts.heading,codeFontFamily:e.fonts.code??"monospace",colors:e.colors.palette}}function Uh(e,t){const a=Tr(t),i=e.slides.map(r=>{let s=[...r.elements];if(t.logo&&!s.some(c=>c.id===`brand-logo-${t.id}`)){const c=Zh(t.logo);s=[...s,{id:`brand-logo-${t.id}`,type:"image",position:c,content:{type:"image",src:t.logo.url,alt:`${t.name} logo`,objectFit:"contain"},opacity:.9}]}return{...r,elements:s}});return{...e,theme:a,slides:i,metadata:{...e.metadata,updatedAt:new Date().toISOString()}}}function Yh(e,t){const a=e.slides.map(i=>({...i,elements:i.elements.filter(r=>r.id!==`brand-logo-${t}`)}));return{...e,slides:a,metadata:{...e.metadata,updatedAt:new Date().toISOString()}}}function Zh(e){const t=e.width??8,a=e.height??5,i=e.position??"bottom-right",r={"top-left":{x:2,y:2},"top-right":{x:90,y:2},"bottom-left":{x:2,y:93},"bottom-right":{x:90,y:93}},{x:s,y:l}=r[i];return{x:s,y:l,width:t,height:a,unit:"percent"}}const Gh={id:"nice2dev",name:"NiceToDev",colors:{primary:"#6366F1",secondary:"#8B5CF6",accent:"#06B6D4",background:"#0F172A",text:"#E2E8F0",heading:"#FFFFFF",palette:["#6366F1","#8B5CF6","#06B6D4","#10B981","#F59E0B"]},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"}},Xh={id:"corporate",name:"Corporate Blue",colors:{primary:"#1A365D",secondary:"#2B6CB0",accent:"#ED8936",background:"#FFFFFF",text:"#2D3748",heading:"#1A365D",palette:["#1A365D","#2B6CB0","#4299E1","#ED8936","#48BB78"]},fonts:{heading:"Georgia, serif",body:"Arial, sans-serif",code:"Consolas, monospace"}},Qh={id:"startup",name:"Startup Fresh",colors:{primary:"#7C3AED",secondary:"#EC4899",accent:"#34D399",background:"#FAFAFA",text:"#374151",heading:"#111827",palette:["#7C3AED","#EC4899","#34D399","#F59E0B","#3B82F6"]},fonts:{heading:"Poppins, sans-serif",body:"Open Sans, sans-serif",code:"Fira Code, monospace"}};class Rr{constructor(t,a={}){this.currentAnimation=null,this.frameIndex=0,this.elapsed=0,this.playing=!1,this.loop=!0,this.speed=1,this.onComplete=null,this.onEvent=null,this.character=t,this.onComplete=a.onAnimationComplete||null,this.onEvent=a.onFrameEvent||null}getCharacter(){return this.character}getCurrentAnimation(){return this.currentAnimation}getCurrentFrameIndex(){return this.frameIndex}isPlaying(){return this.playing}play(t,a={}){const i=this.character.animations.find(r=>r.id===t);if(!i){console.warn(`Animation "${t}" not found on character "${this.character.id}"`);return}this.currentAnimation=i,this.frameIndex=a.startFrame??0,this.elapsed=0,this.playing=!0,this.loop=a.loop??i.loop,this.speed=a.speed??1,this.checkFrameEvent()}stop(){this.playing=!1}pause(){this.playing=!1}resume(){this.currentAnimation&&(this.playing=!0)}setSpeed(t){this.speed=t}update(t){if(!this.playing||!this.currentAnimation)return;const a=this.currentAnimation,i=a.frames[this.frameIndex];if(!i)return;const r=1e3/a.fps,s=i.duration??r;for(this.elapsed+=t*this.speed;this.elapsed>=s&&this.playing;){if(this.elapsed-=s,this.frameIndex++,this.frameIndex>=a.frames.length)if(this.loop)this.frameIndex=0;else{this.frameIndex=a.frames.length-1,this.playing=!1,this.onComplete&&this.onComplete(a.id);return}this.checkFrameEvent()}}checkFrameEvent(){if(!this.currentAnimation||!this.onEvent)return;const t=this.currentAnimation.frames[this.frameIndex];t!=null&&t.event&&this.onEvent(this.currentAnimation.id,t.event)}getCurrentFrame(){return this.currentAnimation?this.currentAnimation.frames[this.frameIndex]??null:null}getSpriteRect(){const t=this.getCurrentFrame();if(!t||!this.character.visual.atlas)return null;const i=this.character.visual.atlas.frames[t.frameId];return i?i.frame:null}}function Jh(e,t,a,i,r){if(!r.visible||r.opacity===0||!i.getCurrentFrame())return;const l=i.getSpriteRect();if(!l)return;const{position:c,scale:d,rotation:u,opacity:g,flipX:h}=r,{anchor:p}=t;e.save(),e.translate(c.x,c.y),e.scale(h?-d:d,d),e.rotate(u*Math.PI/180),e.globalAlpha=g;const m=-p.x*l.w,k=-p.y*l.h;e.drawImage(a,l.x,l.y,l.w,l.h,m,k,l.w,l.h),e.restore()}function ef({character:e,state:t,spriteSheet:a,className:i,style:r}){const[s,l]=o.useState(null);if(o.useEffect(()=>{if(!e.visual.atlas)return;const b=e.animations.find(f=>f.id===t.currentAnimation);if(!b)return;const C=b.frames[t.animationFrame];if(!C)return;const _=e.visual.atlas.frames[C.frameId];l(_||null)},[e,t.currentAnimation,t.animationFrame]),!t.visible||!s)return null;const{position:c,scale:d,rotation:u,opacity:g,flipX:h}=t,{frame:p}=s,m={position:"absolute",left:c.x,top:c.y,transform:`
1371
+ translate(-${e.anchor.x*100}%, -${e.anchor.y*100}%)
1372
+ scale(${h?-d:d}, ${d})
1373
+ rotate(${u}deg)
1374
+ `,opacity:g,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`,pointerEvents:"none",...r},k={width:p.w,height:p.h,backgroundImage:a?`url(${a.src})`:`url(${e.visual.spriteSheet})`,backgroundPosition:`-${p.x}px -${p.y}px`,backgroundRepeat:"no-repeat"};return o.createElement("div",{className:i,style:m},o.createElement("div",{style:k}))}class ua{constructor(){this.characters=new Map,this.spriteSheets=new Map,this.loadingPromises=new Map}register(t){this.characters.set(t.id,t)}unregister(t){this.characters.delete(t),this.spriteSheets.delete(t)}get(t){return this.characters.get(t)}getAll(){return Array.from(this.characters.values())}async loadSpriteSheet(t){const a=this.spriteSheets.get(t);if(a)return a;const i=this.loadingPromises.get(t);if(i)return i;const r=this.characters.get(t);if(!(r!=null&&r.visual.spriteSheet))throw new Error(`Character ${t} has no sprite sheet`);const s=new Promise((l,c)=>{const d=new Image;d.onload=()=>{this.spriteSheets.set(t,d),this.loadingPromises.delete(t),l(d)},d.onerror=()=>{this.loadingPromises.delete(t),c(new Error(`Failed to load sprite sheet for ${t}`))},d.src=r.visual.spriteSheet});return this.loadingPromises.set(t,s),s}getSpriteSheet(t){return this.spriteSheets.get(t)}}function tf(e,t={}){const a=o.useRef(null),[i,r]=o.useState(0),[s,l]=o.useState(!1),[c,d]=o.useState(null);a.current||(a.current=new Rr(e,{...t,onAnimationComplete:m=>{var k;(k=t.onAnimationComplete)==null||k.call(t,m),l(!1)},onFrameEvent:t.onFrameEvent})),o.useEffect(()=>{let m,k=performance.now();const b=C=>{const _=C-k;k=C,a.current&&(a.current.update(_),r(a.current.getCurrentFrameIndex()),d(a.current.getCurrentFrame()),l(a.current.isPlaying())),m=requestAnimationFrame(b)};return m=requestAnimationFrame(b),()=>{cancelAnimationFrame(m)}},[]);const u=o.useCallback((m,k)=>{var b;(b=a.current)==null||b.play(m,k),l(!0)},[]),g=o.useCallback(()=>{var m;(m=a.current)==null||m.stop(),l(!1)},[]),h=o.useCallback(()=>{var m;(m=a.current)==null||m.pause(),l(!1)},[]),p=o.useCallback(()=>{var m;(m=a.current)==null||m.resume(),l(!0)},[]);return{controller:a.current,currentFrame:c,frameIndex:i,isPlaying:s,play:u,stop:g,pause:h,resume:p}}function nf(){const e=o.useRef(null);e.current||(e.current=new ua);const t=o.useCallback(r=>{var s;(s=e.current)==null||s.register(r)},[]),a=o.useCallback(r=>{var s;return(s=e.current)==null?void 0:s.get(r)},[]),i=o.useCallback(r=>e.current.loadSpriteSheet(r),[]);return{registry:e.current,register:t,get:a,loadSpriteSheet:i}}function af(e,t,a,i,r,s,l){const c={};for(let d=0;d<s;d++){const u=d%l,g=Math.floor(d/l);c[`frame_${d}`]={frame:{x:u*i,y:g*r,w:i,h:r},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:i,h:r},sourceSize:{w:i,h:r}}}return{id:e,name:t,type:"sprite",visual:{type:"sprite",spriteSheet:a,atlas:{frames:c,meta:{image:a,size:{w:l*i,h:Math.ceil(s/l)*r},scale:1}},width:i,height:r},animations:[],expressions:[],defaultScale:1,anchor:{x:.5,y:1}}}function rf(e,t,a,i,r,s,l="custom"){const c=i.map(g=>({frameId:g})),d=c.length/r*1e3,u={id:t,name:a,category:l,frames:c,fps:r,loop:s,duration:d};return{...e,animations:[...e.animations,u]}}function of(e,t,a,i,r,s){const l={id:t,name:a,emotion:i,frameId:r,overlay:s};return{...e,expressions:[...e.expressions,l]}}const sf=o.createContext(null);function lf(){const e=o.useContext(sf);if(!e)throw new Error("usePuppetStage must be used within PuppetStageProvider");return e}function Pr({background:e,width:t,height:a}){const i={position:"absolute",top:0,left:0,width:t,height:a,overflow:"hidden"};switch(e.type){case"solid":return o.createElement("div",{style:{...i,backgroundColor:e.color||"#000000"}});case"gradient":{const r=e.gradient;if(!r)return o.createElement("div",{style:{...i,backgroundColor:"#000000"}});const s=r.stops.map(c=>`${c.color} ${c.position*100}%`).join(", "),l=r.type==="radial"?`radial-gradient(circle, ${s})`:`linear-gradient(${r.angle||180}deg, ${s})`;return o.createElement("div",{style:{...i,background:l}})}case"image":return o.createElement("div",{style:{...i,backgroundImage:`url(${e.image})`,backgroundSize:"cover",backgroundPosition:"center"}});case"video":return o.createElement("div",{style:i},o.createElement("video",{src:e.video,autoPlay:!0,loop:!0,muted:!0,style:{width:"100%",height:"100%",objectFit:"cover"}}));case"parallax":{const r=e.parallaxLayers||[];return o.createElement("div",{style:i},r.map((s,l)=>{var c,d;return o.createElement("div",{key:l,style:{position:"absolute",top:((c=s.offset)==null?void 0:c.y)||0,left:((d=s.offset)==null?void 0:d.x)||0,width:"100%",height:"100%",backgroundImage:`url(${s.image})`,backgroundRepeat:s.repeat?"repeat-x":"no-repeat",backgroundSize:"auto 100%"}})}))}default:return o.createElement("div",{style:{...i,backgroundColor:"#000000"}})}}function Br({effects:e,width:t,height:a}){return e.length===0?null:o.createElement(o.Fragment,null,e.map(i=>{const{effectId:r,type:s,params:l,progress:c}=i;switch(s){case"flash":return o.createElement("div",{key:r,style:{position:"absolute",top:0,left:0,width:t,height:a,backgroundColor:l.color||"#ffffff",opacity:1-c,pointerEvents:"none"}});case"vignette":return o.createElement("div",{key:r,style:{position:"absolute",top:0,left:0,width:t,height:a,background:`radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,${l.intensity||.5}) 100%)`,pointerEvents:"none"}});case"colorFilter":return o.createElement("div",{key:r,style:{position:"absolute",top:0,left:0,width:t,height:a,backgroundColor:l.color,opacity:l.intensity||.3,mixBlendMode:l.blendMode||"multiply",pointerEvents:"none"}});case"fog":return o.createElement("div",{key:r,style:{position:"absolute",top:0,left:0,width:t,height:a,background:`linear-gradient(to top, rgba(200,200,200,${l.density||.5}) 0%, transparent 70%)`,pointerEvents:"none"}});default:return null}}))}function Lr({document:e,scene:t,characterStates:a,camera:i,activeEffects:r,characterRegistry:s,className:l,style:c,onCharacterClick:d}){const u=o.useRef(null),[g,h]=o.useState({width:0,height:0}),p=o.useMemo(()=>{if(g.width===0||g.height===0)return 1;const _=g.width/e.stageSize.width,f=g.height/e.stageSize.height;return Math.min(_,f)},[g,e.stageSize]);o.useEffect(()=>{const _=u.current;if(!_)return;const f=new ResizeObserver(v=>{const j=v[0];j&&h({width:j.contentRect.width,height:j.contentRect.height})});return f.observe(_),()=>f.disconnect()},[]);const m=e.stageSize.width,k=e.stageSize.height,b=o.useMemo(()=>{const{position:_,zoom:f,rotation:v}=i,j=m/2,S=k/2,I=j-_.x,M=S-_.y;return`translate(${I}px, ${M}px) scale(${f}) rotate(${v}deg)`},[i,m,k]),C=o.useMemo(()=>{const _=[];return t.cast.forEach(f=>{_.push({type:"character",data:f,zIndex:f.zIndex})}),t.scenery.forEach(f=>{_.push({type:"prop",data:f,zIndex:f.zIndex})}),_.sort((f,v)=>f.zIndex-v.zIndex)},[t.cast,t.scenery]);return o.createElement("div",{ref:u,className:l,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"#000000",...c}},o.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",width:m,height:k,transform:`translate(-50%, -50%) scale(${p})`,transformOrigin:"center center"}},o.createElement("div",{style:{position:"absolute",top:0,left:0,width:m,height:k,transform:b,transformOrigin:"center center"}},o.createElement(Pr,{background:t.background,width:m,height:k}),C.map(({type:_,data:f})=>{if(_==="character"){const v=f,j=a.get(v.instanceId);if(!j||!j.visible)return null;const S=e.characters.find(I=>I.id===v.characterId);return S?o.createElement(cf,{key:v.instanceId,characterDef:S,state:j,onClick:d?()=>d(v.instanceId):void 0}):null}else{const v=f,j=e.props.find(S=>S.id===v.propId);return j?o.createElement(df,{key:v.instanceId,propDef:j,state:v}):null}}),o.createElement(Br,{effects:r,width:m,height:k}))))}function cf({characterDef:e,state:t,onClick:a}){const{position:i,scale:r,rotation:s,opacity:l,flipX:c,currentAnimation:d,animationFrame:u}=t,g=o.useMemo(()=>{const k=e.animations.find(C=>C.id===d);if(!k)return null;const b=k.frames[u];return!b||!e.visual.atlas?null:e.visual.atlas.frames[b.frameId]},[e,d,u]);if(!g)return null;const{frame:h}=g,p={position:"absolute",left:i.x,top:i.y,transform:`
1375
+ translate(-${e.anchor.x*100}%, -${e.anchor.y*100}%)
1376
+ scale(${c?-r:r}, ${r})
1377
+ rotate(${s}deg)
1378
+ `,opacity:l,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`,cursor:a?"pointer":"default"},m={width:h.w,height:h.h,backgroundImage:`url(${e.visual.spriteSheet})`,backgroundPosition:`-${h.x}px -${h.y}px`,backgroundRepeat:"no-repeat"};return o.createElement("div",{style:p,onClick:a},o.createElement("div",{style:m}))}function df({propDef:e,state:t}){const{position:a,scale:i,rotation:r,opacity:s}=t,l={position:"absolute",left:a.x,top:a.y,transform:`
1379
+ translate(-${e.anchor.x*100}%, -${e.anchor.y*100}%)
1380
+ scale(${i})
1381
+ rotate(${r}deg)
1382
+ `,opacity:s,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`};return e.type==="image"||e.type==="sprite"?o.createElement("img",{src:e.asset,style:{...l,width:e.width,height:e.height,pointerEvents:"none"},alt:e.name}):e.type==="vector"?o.createElement("div",{style:l,dangerouslySetInnerHTML:{__html:e.asset}}):e.type==="text"?o.createElement("div",{style:l},e.asset):o.createElement("div",{style:l})}function Or({text:e,speakerName:t,style:a={},targetPosition:i,visible:r,typewriterProgress:s=1}){if(!r)return null;const{position:l="bottom",backgroundColor:c="rgba(0,0,0,0.85)",textColor:d="#ffffff",fontSize:u=18,maxWidth:g=600}=a,h=e.slice(0,Math.floor(e.length*s)),p={position:"absolute",maxWidth:g,padding:"16px 24px",backgroundColor:c,color:d,fontSize:u,borderRadius:12,boxShadow:"0 4px 20px rgba(0,0,0,0.3)",zIndex:1e3};switch(l){case"bottom":Object.assign(p,{bottom:20,left:"50%",transform:"translateX(-50%)",width:"90%"});break;case"top":Object.assign(p,{top:20,left:"50%",transform:"translateX(-50%)",width:"90%"});break;case"center":Object.assign(p,{top:"50%",left:"50%",transform:"translate(-50%, -50%)"});break;case"bubble":i&&Object.assign(p,{left:i.x,bottom:i.y+20,transform:"translateX(-50%)"});break}return o.createElement("div",{style:p},t&&o.createElement("div",{style:{fontWeight:"bold",marginBottom:8,color:"#60a5fa"}},t),o.createElement("div",null,h))}function uf(e,t,a){const[i,r]=o.useState({offsetX:0,offsetY:0}),s=o.useRef(null);return o.useEffect(()=>{if(!a){r({offsetX:0,offsetY:0});return}s.current=performance.now();let l;const c=d=>{const u=d-s.current;if(u>=t){r({offsetX:0,offsetY:0});return}const h=1-u/t,p=(Math.random()-.5)*2*e*h,m=(Math.random()-.5)*2*e*h;r({offsetX:p,offsetY:m}),l=requestAnimationFrame(c)};return l=requestAnimationFrame(c),()=>{cancelAnimationFrame(l)}},[a,e,t]),i}const kt={linear:e=>e,easeIn:e=>e*e,easeOut:e=>e*(2-e),easeInOut:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInElastic:e=>e===0||e===1?e:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI),easeOutElastic:e=>e===0||e===1?e:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1,easeInOutElastic:e=>e===0||e===1?e:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1),easeInBounce:e=>1-kt.easeOutBounce(1-e),easeOutBounce:e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,easeInOutBounce:e=>e<.5?kt.easeInBounce(e*2)*.5:kt.easeOutBounce(e*2-1)*.5+.5,step:e=>Math.round(e)};function Hr(e){return kt[e]||kt.linear}function rt(e,t,a){return e+(t-e)*a}function wn(e,t,a){return{x:rt(e.x,t.x,a),y:rt(e.y,t.y,a)}}class Wr{constructor(t){this.currentTime=0,this.scene=t.scene,this.characterDefs=new Map(t.characterDefs.map(a=>[a.id,a])),this.typewriterSpeed=t.typewriterSpeed||30,this.onAudioCommand=t.onAudioCommand}evaluate(t){this.currentTime=t;const a=this.evaluateAllCharacters(t),i=this.evaluateCamera(t),r=this.evaluateDialogue(t),s=this.evaluateEffects(t),l=this.evaluateAudio(t);return{characterStates:a,camera:i,activeDialogue:r,activeEffects:s,audioCommands:l}}getDuration(){return this.scene.duration}findSurroundingKeyframes(t,a){const i=t.keyframes;if(i.length===0)return{prev:null,next:null,progress:0};let r=-1;for(let p=0;p<i.length&&i[p].time<=a;p++)r=p;if(r===-1)return{prev:null,next:i[0],progress:0};const s=i[r],l=i[r+1]||null;if(!l)return{prev:s,next:null,progress:1};const c=l.time-s.time,d=a-s.time,u=c>0?d/c:0,h=Hr(s.easing||"linear")(Math.min(1,Math.max(0,u)));return{prev:s,next:l,progress:h}}evaluateAllCharacters(t){const a=new Map;for(const i of this.scene.cast){const r=this.evaluateCharacter(i.instanceId,t);a.set(i.instanceId,r)}return a}evaluateCharacter(t,a){var l;const i=this.scene.cast.find(c=>c.instanceId===t);if(!i)return this.createDefaultCharacterState();const r=this.characterDefs.get(i.characterId);let s={instanceId:t,characterId:i.characterId,position:{...i.position},scale:i.scale,rotation:i.rotation,opacity:i.opacity??1,flipX:i.flipX??!1,visible:!0,currentAnimation:i.initialAnimation||(((l=r==null?void 0:r.animations[0])==null?void 0:l.id)??""),animationFrame:0,animationStartTime:0,currentExpression:i.initialExpression??""};for(const c of this.scene.timeline)if(c.targetId===t)switch(c.type){case"animation":s=this.applyAnimationTrack(c,s,a);break;case"transform":s=this.applyTransformTrack(c,s,a);break;case"expression":s=this.applyExpressionTrack(c,s,a);break}if(r&&s.currentAnimation){const c=r.animations.find(d=>d.id===s.currentAnimation);if(c){const d=(a-s.animationStartTime)%(c.duration||c.frames.length/c.fps*1e3),u=Math.floor(d/1e3*c.fps)%c.frames.length;s.animationFrame=u}}return s}createDefaultCharacterState(){return{instanceId:"",characterId:"",position:{x:0,y:0},scale:1,rotation:0,opacity:1,flipX:!1,visible:!1,currentAnimation:"",animationFrame:0,animationStartTime:0,currentExpression:""}}applyAnimationTrack(t,a,i){const{prev:r}=this.findSurroundingKeyframes(t,i);if(r){const s=r.value;return{...a,currentAnimation:s.animationId,animationStartTime:r.time}}return a}applyTransformTrack(t,a,i){const{prev:r,next:s,progress:l}=this.findSurroundingKeyframes(t,i);if(!r)return a;const c=r.value,d=s?s.value:null;return d?{...a,position:c.position&&d.position?wn(c.position,d.position,l):c.position??a.position,scale:c.scale!==void 0&&d.scale!==void 0?rt(c.scale,d.scale,l):c.scale??a.scale,rotation:c.rotation!==void 0&&d.rotation!==void 0?rt(c.rotation,d.rotation,l):c.rotation??a.rotation,opacity:c.opacity!==void 0&&d.opacity!==void 0?rt(c.opacity,d.opacity,l):c.opacity??a.opacity}:{...a,position:c.position??a.position,scale:c.scale??a.scale,rotation:c.rotation??a.rotation,opacity:c.opacity??a.opacity}}applyExpressionTrack(t,a,i){const{prev:r}=this.findSurroundingKeyframes(t,i);if(r){const s=r.value;return{...a,currentExpression:s.expressionId}}return a}evaluateCamera(t){let a=this.scene.camera?{...this.scene.camera}:{position:{x:640,y:360},zoom:1,rotation:0};for(const i of this.scene.timeline){if(i.type!=="camera")continue;const{prev:r,next:s,progress:l}=this.findSurroundingKeyframes(i,t);if(!r)continue;const c=r.value,d=s?s.value:null;d?a={position:c.position&&d.position?wn(c.position,d.position,l):c.position??a.position,zoom:c.zoom!==void 0&&d.zoom!==void 0?rt(c.zoom,d.zoom,l):c.zoom??a.zoom,rotation:c.rotation!==void 0&&d.rotation!==void 0?rt(c.rotation,d.rotation,l):c.rotation??a.rotation}:a={position:c.position??a.position,zoom:c.zoom??a.zoom,rotation:c.rotation??a.rotation}}return a}evaluateDialogue(t){for(const a of this.scene.timeline){if(a.type!=="dialogue")continue;const{prev:i}=this.findSurroundingKeyframes(a,t);if(i){const r=i.value,s=i.time+(i.duration??0);if(t>=i.time&&t<s){const l=t-i.time,c=r.text.length/this.typewriterSpeed*1e3,d=Math.min(1,l/c);return{text:r.text,speakerId:a.targetId,typewriterProgress:d}}}}return null}evaluateEffects(t){const a=[];for(const i of this.scene.timeline)if(i.type==="effect")for(const r of i.keyframes){const s=r.value,l=r.time+(r.duration??0);if(t>=r.time&&t<l){const c=r.duration?(t-r.time)/r.duration:1;a.push({effectId:i.id+"_"+r.time,type:s.effectType,params:s.params,startTime:r.time,duration:r.duration??0,progress:c})}}return a}evaluateAudio(t){const a=[];for(const i of this.scene.timeline)if(i.type==="audio")for(const r of i.keyframes){const s=r.value;Math.abs(t-r.time)<50&&a.push({trackId:i.targetId,command:s.action,time:t})}return a}}class pf{constructor(t,a,i){this.track={id:i||`track_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:t,targetId:a,keyframes:[]}}addAnimationKeyframe(t,a,i){return this.track.keyframes.push({time:t,easing:(i==null?void 0:i.easing)??"linear",value:{type:"animation",animationId:a,speed:(i==null?void 0:i.speed)??1}}),this}addTransformKeyframe(t,a,i){return this.track.keyframes.push({time:t,easing:i??"easeInOut",value:{type:"transform",...a}}),this}addExpressionKeyframe(t,a,i){return this.track.keyframes.push({time:t,easing:(i==null?void 0:i.easing)??"easeOut",duration:(i==null?void 0:i.transition)??200,value:{type:"expression",expressionId:a}}),this}addDialogueKeyframe(t,a,i,r){return this.track.keyframes.push({time:t,duration:i,easing:(r==null?void 0:r.easing)??"linear",value:{type:"dialogue",text:a,audioClip:r==null?void 0:r.voiceOver,style:r==null?void 0:r.style}}),this}addCameraKeyframe(t,a,i){return this.track.keyframes.push({time:t,easing:i??"easeInOut",value:{type:"camera",...a}}),this}addEffectKeyframe(t,a,i,r,s){return this.track.keyframes.push({time:t,duration:i,easing:s??"linear",value:{type:"effect",effectType:a,params:r??{}}}),this}build(){return this.track.keyframes.sort((t,a)=>t.time-a.time),this.track}}class mf{constructor(t,a,i){this.scene={id:t,title:a,duration:i,background:{type:"solid",color:"#000000"},cast:[],scenery:[],timeline:[],camera:{position:{x:640,y:360},zoom:1,rotation:0}}}setBackground(t){return this.scene.background=t,this}setCamera(t){return this.scene.camera=t,this}setTransition(t){return this.scene.transition=t,this}addCastMember(t,a,i){return this.scene.cast.push({instanceId:t,characterId:a,position:i.position??{x:640,y:360},scale:i.scale??1,rotation:i.rotation??0,zIndex:i.zIndex??this.scene.cast.length,initialAnimation:i.initialAnimation,initialExpression:i.initialExpression,opacity:i.opacity??1,flipX:i.flipX??!1}),this}addProp(t,a,i){return this.scene.scenery.push({instanceId:t,propId:a,position:i.position??{x:640,y:360},scale:i.scale??1,rotation:i.rotation??0,zIndex:i.zIndex??this.scene.scenery.length,opacity:i.opacity??1}),this}addTrack(t){return this.scene.timeline.push(t),this}addAudio(t){return this.scene.audio=t,this}build(){return this.scene}}function hf(e){return JSON.parse(JSON.stringify(e))}function qr(e){if(e.keyframes.length===0)return 0;const t=e.keyframes[e.keyframes.length-1];return"duration"in t&&typeof t.duration=="number"?t.time+t.duration:t.time}function ff(e){let t=0;for(const a of e.timeline){const i=qr(a);i>t&&(t=i)}return Math.max(e.duration,t)}function gf(e,t){return Math.floor(e/1e3*t)}function yf(e,t){return e/t*1e3}function bf(e){const t=Math.floor(e/1e3),a=Math.floor(t/60),i=t%60,r=Math.floor(e%1e3/10);return`${a.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}.${r.toString().padStart(2,"0")}`}function xf(e){const t=e.match(/^(\d+):(\d{2})(?:\.(\d{2}))?$/);if(!t)return 0;const a=parseInt(t[1],10),i=parseInt(t[2],10),r=t[3]?parseInt(t[3],10)*10:0;return(a*60+i)*1e3+r}const Vr=o.createContext(null);function vf(){const e=o.useContext(Vr);if(!e)throw new Error("usePuppetPlayer must be used within PuppetPlayerProvider");return e}class wf{constructor(){this.audioElements=new Map,this.volume=1,this.muted=!1}preloadAudio(t,a){return new Promise((i,r)=>{const s=new Audio(a);s.preload="auto",s.volume=this.volume,s.muted=this.muted,s.addEventListener("canplaythrough",()=>i(),{once:!0}),s.addEventListener("error",r,{once:!0}),this.audioElements.set(t,s)})}play(t,a){const i=this.audioElements.get(t);i&&(a!==void 0&&(i.currentTime=a/1e3),i.play().catch(()=>{}))}pause(t){const a=this.audioElements.get(t);a&&a.pause()}stop(t){const a=this.audioElements.get(t);a&&(a.pause(),a.currentTime=0)}stopAll(){this.audioElements.forEach(t=>{t.pause(),t.currentTime=0})}setVolume(t){this.volume=Math.max(0,Math.min(1,t)),this.audioElements.forEach(a=>{a.volume=this.volume})}setMuted(t){this.muted=t,this.audioElements.forEach(a=>{a.muted=t})}dispose(){this.stopAll(),this.audioElements.clear()}}function Kr(e){const{document:t,autoPlay:a=!1,loop:i=!1,initialVolume:r=1,initialSpeed:s=1}=e,[l,c]=o.useState({isPlaying:!1,isPaused:!1,currentSceneIndex:0,currentTime:0,totalDuration:0,playbackSpeed:s,volume:r,isMuted:!1,characterStates:new Map,activeEffects:[],loop:i}),[d,u]=o.useState(null),g=o.useRef(null),h=o.useRef(0),p=o.useRef(new wf),m=o.useRef(null),k=o.useRef(new ua),b=o.useMemo(()=>t.scenes.reduce((N,x)=>N+x.duration,0),[t.scenes]),C=o.useMemo(()=>t.scenes[l.currentSceneIndex]||null,[t.scenes,l.currentSceneIndex]);o.useEffect(()=>{C&&(m.current=new Wr({scene:C,characterDefs:t.characters,onAudioCommand:(N,x,O)=>{const D=p.current;switch(x){case"play":D.play(N,O);break;case"pause":D.pause(N);break;case"stop":D.stop(N);break}}}))},[C,t.characters]),o.useEffect(()=>{var x;const N=p.current;return(x=t.audioTracks)==null||x.forEach(O=>{O.src&&N.preloadAudio(O.id,O.src).catch(()=>{})}),()=>{N.dispose()}},[t.audioTracks]);const _=o.useCallback(N=>{if(!m.current)return;const x=N-h.current;h.current=N,c(O=>{var y,$,z;if(!O.isPlaying||O.isPaused)return O;const D=O.currentTime+x*O.playbackSpeed,F=(C==null?void 0:C.duration)??0;if(D>=F){const R=O.currentSceneIndex+1;return R>=t.scenes.length?O.loop?((y=e.onSceneChange)==null||y.call(e,0,t.scenes[0]),{...O,currentSceneIndex:0,currentTime:0}):(($=e.onEnd)==null||$.call(e),{...O,isPlaying:!1,isPaused:!1,currentTime:F}):((z=e.onSceneChange)==null||z.call(e,R,t.scenes[R]),{...O,currentSceneIndex:R,currentTime:0})}return{...O,currentTime:D}}),g.current=requestAnimationFrame(_)},[C,t.scenes,e]);o.useEffect(()=>(l.isPlaying&&!l.isPaused?(h.current=performance.now(),g.current=requestAnimationFrame(_)):g.current&&cancelAnimationFrame(g.current),()=>{g.current&&cancelAnimationFrame(g.current)}),[l.isPlaying,l.isPaused,_]),o.useEffect(()=>{if(m.current){const N=m.current.evaluate(l.currentTime);u(N),N.audioCommands.forEach(x=>{const O=p.current;switch(x.command){case"play":O.play(x.trackId);break;case"pause":O.pause(x.trackId);break;case"stop":O.stop(x.trackId);break}}),c(x=>({...x,characterStates:N.characterStates,activeEffects:N.activeEffects}))}},[l.currentTime]),o.useEffect(()=>{a&&c(N=>({...N,isPlaying:!0}))},[a]);const f=o.useCallback(()=>{c(N=>({...N,isPlaying:!0,isPaused:!1}))},[]),v=o.useCallback(()=>{c(N=>({...N,isPaused:!0})),p.current.stopAll()},[]),j=o.useCallback(()=>{c(N=>({...N,isPlaying:!1,isPaused:!1,currentTime:0,currentSceneIndex:0})),p.current.stopAll()},[]),S=o.useCallback(N=>{c(x=>({...x,currentTime:Math.max(0,Math.min(N,(C==null?void 0:C.duration)??0))}))},[C]),I=o.useCallback(N=>{var x;N>=0&&N<t.scenes.length&&(p.current.stopAll(),c(O=>({...O,currentSceneIndex:N,currentTime:0})),(x=e.onSceneChange)==null||x.call(e,N,t.scenes[N]))},[t.scenes,e]),M=o.useCallback(N=>{c(x=>({...x,playbackSpeed:Math.max(.25,Math.min(4,N))}))},[]),w=o.useCallback(N=>{const x=Math.max(0,Math.min(1,N));p.current.setVolume(x),c(O=>({...O,volume:x}))},[]),E=o.useCallback(()=>{c(N=>{const x=!N.isMuted;return p.current.setMuted(x),{...N,isMuted:x}})},[]),P=o.useCallback(()=>{I(l.currentSceneIndex+1)},[l.currentSceneIndex,I]),L=o.useCallback(()=>{I(l.currentSceneIndex-1)},[l.currentSceneIndex,I]),A=o.useCallback(N=>{c(x=>({...x,loop:N}))},[]);return{playerState:{...l,totalDuration:b},timelineState:d,characterRegistry:k.current,play:f,pause:v,stop:j,seek:S,seekToScene:I,setPlaybackSpeed:M,setVolume:w,toggleMute:E,nextScene:P,previousScene:L,setLoop:A}}function Ur({document:e,autoPlay:t=!1,loop:a=!1,showControls:i=!0,className:r,style:s,onSceneChange:l,onEnd:c}){var M;const{playerState:d,timelineState:u,characterRegistry:g,play:h,pause:p,stop:m,seek:k,seekToScene:b,setPlaybackSpeed:C,setVolume:_,toggleMute:f,nextScene:v,previousScene:j,setLoop:S}=Kr({document:e,autoPlay:t,loop:a,onSceneChange:l,onEnd:c}),I=e.scenes[d.currentSceneIndex];return I?o.createElement(Vr.Provider,{value:{document:e,playerState:d,play:h,pause:p,stop:m,seek:k,seekToScene:b,setPlaybackSpeed:C,setVolume:_,toggleMute:f,nextScene:v,previousScene:j,setLoop:S}},o.createElement("div",{className:r,style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#000",...s}},o.createElement("div",{style:{flex:1,position:"relative"}},o.createElement(Lr,{document:e,scene:I,characterStates:d.characterStates,camera:(u==null?void 0:u.camera)??I.camera??{position:{x:640,y:360},zoom:1,rotation:0},activeEffects:d.activeEffects,characterRegistry:g}),(u==null?void 0:u.activeDialogue)&&o.createElement(Or,{text:u.activeDialogue.text,speakerName:(M=e.characters.find(w=>{var E;return w.id===((E=u.activeDialogue)==null?void 0:E.speakerId)}))==null?void 0:M.name,visible:!0,typewriterProgress:u.activeDialogue.typewriterProgress})),i&&o.createElement(kf,{playerState:d,currentScene:I,totalScenes:e.scenes.length,onPlay:h,onPause:p,onStop:m,onSeek:k,onPreviousScene:j,onNextScene:v,onSpeedChange:C,onVolumeChange:_,onToggleMute:f,onToggleLoop:()=>S(!d.loop)}))):o.createElement("div",{className:r,style:s},"No scenes")}function kf({playerState:e,currentScene:t,totalScenes:a,onPlay:i,onPause:r,onStop:s,onSeek:l,onPreviousScene:c,onNextScene:d,onSpeedChange:u,onVolumeChange:g,onToggleMute:h,onToggleLoop:p}){const m=f=>{const v=Math.floor(f/1e3),j=Math.floor(v/60),S=v%60;return`${j}:${S.toString().padStart(2,"0")}`},k=t.duration>0?e.currentTime/t.duration*100:0,b={display:"flex",alignItems:"center",gap:8,padding:"12px 16px",backgroundColor:"rgba(0,0,0,0.9)",color:"#fff"},C={background:"none",border:"none",color:"#fff",cursor:"pointer",padding:"8px",fontSize:16,opacity:.9},_={flex:1,height:4,backgroundColor:"#444",borderRadius:2,cursor:"pointer"};return o.createElement("div",{style:b},o.createElement("button",{style:C,onClick:e.isPlaying&&!e.isPaused?r:i,title:e.isPlaying&&!e.isPaused?"Pause":"Play"},e.isPlaying&&!e.isPaused?"⏸":"▶"),o.createElement("button",{style:C,onClick:s,title:"Stop"},"⏹"),o.createElement("button",{style:{...C,opacity:e.currentSceneIndex>0?.9:.3},onClick:c,disabled:e.currentSceneIndex<=0,title:"Previous Scene"},"⏮"),o.createElement("button",{style:{...C,opacity:e.currentSceneIndex<a-1?.9:.3},onClick:d,disabled:e.currentSceneIndex>=a-1,title:"Next Scene"},"⏭"),o.createElement("span",{style:{fontSize:12,fontFamily:"monospace"}},`${m(e.currentTime)} / ${m(t.duration)}`),o.createElement("div",{style:_,onClick:f=>{const v=f.currentTarget.getBoundingClientRect(),S=(f.clientX-v.left)/v.width;l(S*t.duration)}},o.createElement("div",{style:{width:`${k}%`,height:"100%",backgroundColor:"#60a5fa",borderRadius:2}})),o.createElement("select",{value:e.playbackSpeed,onChange:f=>u(parseFloat(f.target.value)),style:{background:"#333",color:"#fff",border:"none",padding:"4px 8px",borderRadius:4,fontSize:12}},o.createElement("option",{value:.25},"0.25x"),o.createElement("option",{value:.5},"0.5x"),o.createElement("option",{value:1},"1x"),o.createElement("option",{value:1.5},"1.5x"),o.createElement("option",{value:2},"2x")),o.createElement("button",{style:C,onClick:h,title:e.isMuted?"Unmute":"Mute"},e.isMuted?"🔇":"🔊"),o.createElement("input",{type:"range",min:0,max:1,step:.1,value:e.volume,onChange:f=>g(parseFloat(f.target.value)),style:{width:60}}),o.createElement("button",{style:{...C,color:e.loop?"#60a5fa":"#fff"},onClick:p,title:"Loop"},"🔁"),o.createElement("span",{style:{fontSize:12}},`Scene ${e.currentSceneIndex+1}/${a}`))}function Sf({document:e,width:t=320,height:a=240,autoPlay:i=!1,className:r,style:s}){return o.createElement(Ur,{document:e,autoPlay:i,showControls:!1,className:r,style:{width:t,height:a,borderRadius:8,overflow:"hidden",...s}})}function Yr(e,t,a){var l,c,d,u;const i=t.assets.find(g=>g.id===e.assetId),r=[];if(e.animations)for(const[g,h]of Object.entries(e.animations)){const p=h.frames.map((m,k)=>({frameId:`${g}_frame_${k}`,duration:m.duration||1e3/h.fps,offset:{x:0,y:0}}));r.push({id:`anim_${g}`,name:g,category:Qr(g),frames:p,fps:h.fps,loop:h.loop,duration:p.reduce((m,k)=>m+(k.duration??0),0)})}const s={};if(e.animations)for(const[g,h]of Object.entries(e.animations))h.frames.forEach((p,m)=>{s[`${g}_frame_${m}`]={frame:{x:p.srcRect.x,y:p.srcRect.y,w:p.srcRect.width,h:p.srcRect.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:p.srcRect.width,h:p.srcRect.height},sourceSize:{w:p.srcRect.width,h:p.srcRect.height}}});return{id:`char_${e.id}`,name:e.name,type:"sprite",visual:{type:"sprite",spriteSheet:(i==null?void 0:i.path)||"",atlas:{frames:s,meta:{image:(i==null?void 0:i.path)||"",size:{w:((l=i==null?void 0:i.metadata)==null?void 0:l.width)||e.width,h:((c=i==null?void 0:i.metadata)==null?void 0:c.height)||e.height},scale:1}},width:((d=i==null?void 0:i.metadata)==null?void 0:d.width)||e.width||100,height:((u=i==null?void 0:i.metadata)==null?void 0:u.height)||e.height||100},anchor:e.anchor||{x:.5,y:1},animations:r,expressions:[],defaultScale:1}}function Zr(e,t,a){var u,g,h,p;const{sprite:i,animator:r,transform:s}=e.components;if(!i)return null;const l=t.assets.find(m=>m.id===i.assetId),c=[];if(r!=null&&r.animations)for(const[m,k]of Object.entries(r.animations)){const b=k.frames.map((C,_)=>({frameId:`${m}_frame_${_}`,duration:C.duration||1e3/k.fps,offset:{x:0,y:0}}));c.push({id:`anim_${m}`,name:m,category:Qr(m),frames:b,fps:k.fps,loop:k.loop,duration:b.reduce((C,_)=>C+(_.duration??0),0)})}const d={};if(r!=null&&r.animations)for(const[m,k]of Object.entries(r.animations))k.frames.forEach((b,C)=>{d[`${m}_frame_${C}`]={frame:{x:b.srcRect.x,y:b.srcRect.y,w:b.srcRect.width,h:b.srcRect.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:b.srcRect.width,h:b.srcRect.height},sourceSize:{w:b.srcRect.width,h:b.srcRect.height}}});return{id:`char_${e.id}`,name:e.name,type:"sprite",visual:{type:"sprite",spriteSheet:(l==null?void 0:l.path)||"",atlas:{frames:d,meta:{image:(l==null?void 0:l.path)||"",size:{w:((u=l==null?void 0:l.metadata)==null?void 0:u.width)||i.width,h:((g=l==null?void 0:l.metadata)==null?void 0:g.height)||i.height},scale:1}},width:((h=l==null?void 0:l.metadata)==null?void 0:h.width)||i.width||100,height:((p=l==null?void 0:l.metadata)==null?void 0:p.height)||i.height||100},anchor:i.anchor||{x:.5,y:1},animations:c,expressions:[],defaultScale:1}}function Gr(e,t){var a,i;return e.type!=="image"&&e.type!=="spritesheet"?null:{id:`prop_${e.id}`,name:e.name,type:"image",asset:e.path,width:((a=e.metadata)==null?void 0:a.width)||100,height:((i=e.metadata)==null?void 0:i.height)||100,anchor:{x:.5,y:.5}}}function Cf(e,t){const a=[];for(const i of e.sprites)a.push(Yr(i,e));for(const i of e.entities){const r=Zr(i,e);r&&a.push(r)}return a}function _f(e,t){const a=[];for(const i of e.assets){const r=Gr(i);r&&a.push(r)}return a}function Xr(e){const t={};for(const r of e.animations){const s=[];if(e.visual.atlas)for(const l of r.frames){const c=e.visual.atlas.frames[l.frameId];c&&s.push({assetId:e.id+"_sheet",srcRect:{x:c.frame.x,y:c.frame.y,width:c.frame.w,height:c.frame.h},duration:l.duration})}t[r.name]={frames:s,fps:r.fps,loop:r.loop}}let a=64,i=64;if(e.visual.atlas){const r=Object.keys(e.visual.atlas.frames)[0];if(r){const s=e.visual.atlas.frames[r];a=s.frame.w,i=s.frame.h}}return{id:e.id,name:e.name,assetId:e.id+"_sheet",width:a,height:i,anchor:e.anchor,animations:t}}function jf(e,t){var i;const a=Xr(e);return{id:e.id,name:e.name,components:{sprite:{assetId:a.assetId,width:a.width,height:a.height,anchor:a.anchor,visible:!0},animator:{currentAnimation:((i=e.animations[0])==null?void 0:i.name)||"",animations:a.animations||{},frame:0,elapsed:0,playing:!0,loop:!0},transform:{position:t||{x:0,y:0},rotation:0,scale:{x:1,y:1}}}}}function Qr(e){const t=e.toLowerCase();return t.includes("idle")||t.includes("stand")?"idle":t.includes("walk")?"walk":t.includes("run")||t.includes("sprint")?"run":t.includes("jump")||t.includes("fall")||t.includes("attack")||t.includes("hit")||t.includes("shoot")?"action":t.includes("hurt")||t.includes("damage")||t.includes("die")?"emotion":(t.includes("special")||t.includes("skill"),"custom")}function Nf(e,t){const a=(t==null?void 0:t.columns)||Math.ceil(Math.sqrt(e.length)),i=(t==null?void 0:t.padding)||0;if(e.length===0)return{image:"",atlas:{frames:{},meta:{image:"",size:{w:0,h:0},scale:1}}};const r=e[0].width,s=e[0].height,l=Math.ceil(e.length/a),c=a*(r+i)-i,d=l*(s+i)-i,u={};return e.forEach((g,h)=>{const p=h%a,m=Math.floor(h/a);u[g.id]={frame:{x:p*(r+i),y:m*(s+i),w:r,h:s},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:r,h:s},sourceSize:{w:r,h:s}}}),{image:"",atlas:{frames:u,meta:{image:"",size:{w:c,h:d},scale:1}}}}function Mf(e,t,a,i,r){const s=r||Math.ceil(Math.sqrt(i)),l={};for(let d=0;d<i;d++){const u=d%s,g=Math.floor(d/s);l[`frame_${d}`]={frame:{x:u*t,y:g*a,w:t,h:a},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:t,h:a},sourceSize:{w:t,h:a}}}const c=Math.ceil(i/s);return{frames:l,meta:{image:e,size:{w:s*t,h:c*a},scale:1}}}function $f(e){const t=[],a=[];e.id||t.push("Project is missing an ID"),(!e.assets||e.assets.length===0)&&a.push("Project has no assets"),!e.sprites&&!e.entities&&t.push("Project has no sprites or entities to import");for(const i of e.sprites||[])e.assets.find(s=>s.id===i.assetId)||a.push(`Sprite "${i.name}" references missing asset: ${i.assetId}`);for(const i of e.sprites||[])(!i.animations||Object.keys(i.animations).length===0)&&a.push(`Sprite "${i.name}" has no animations`);return{valid:t.length===0,errors:t,warnings:a}}function Ef(e,t){var c,d,u;const{flattenScenes:a=!1,includeCharacterSprites:i=!0,includeDialogue:r=!0,slideDuration:s=5e3}=t||{},l=[];if(a)for(const g of e.scenes){const h=zf(g);for(let p=0;p<h.length;p++){const m=h[p],k=h[p+1]??g.duration,b=Af(e,g,m,k-m,i,r);l.push(b)}}else for(const g of e.scenes){const h=Ff(e,g,i,r);l.push(h)}return{version:"1.0.0",id:e.id+"_presentation",title:e.title,description:(c=e.metadata)==null?void 0:c.description,author:(d=e.metadata)==null?void 0:d.author,createdAt:((u=e.metadata)==null?void 0:u.createdAt)||new Date().toISOString(),updatedAt:new Date().toISOString(),layout:{width:e.stageSize.width,height:e.stageSize.height,aspectRatio:`${e.stageSize.width}:${e.stageSize.height}`},slides:l,metadata:{sourcePuppetShow:e.id,convertedAt:new Date().toISOString()}}}function zf(e){const t=new Set([0]);for(const a of e.timeline)for(const i of a.keyframes)t.add(i.time),"duration"in i&&typeof i.duration=="number"&&t.add(i.time+i.duration);return Array.from(t).sort((a,i)=>a-i)}function Af(e,t,a,i,r,s){var c,d;const l=[];if(r)for(const u of t.cast){const g=e.characters.find(m=>m.id===u.characterId);if(!g)continue;const h=If(t,u.instanceId,a)||u.position,p=Df(t,u.instanceId,a);l.push({id:`char_${u.instanceId}_${a}`,type:"image",position:{x:h.x,y:h.y,rotation:(p==null?void 0:p.rotation)??u.rotation},size:{width:((c=g.visual.atlas)==null?void 0:c.meta.size.w)??100,height:((d=g.visual.atlas)==null?void 0:d.meta.size.h)??100},content:{src:g.visual.spriteSheet,alt:g.name},style:{opacity:(p==null?void 0:p.opacity)??u.opacity??1,transform:(p==null?void 0:p.scale)!==void 0?`scale(${u.flipX?-p.scale:p.scale}, ${p.scale})`:void 0},zIndex:u.zIndex})}if(s){const u=Tf(t,a);if(u){const g=e.characters.find(h=>{const p=t.timeline.find(m=>m.type==="dialogue");return(p==null?void 0:p.targetId)===h.id});l.push({id:`dialogue_${a}`,type:"text",position:{x:e.stageSize.width/2,y:e.stageSize.height-100},size:{width:e.stageSize.width*.9,height:80},content:{text:g?`${g.name}: ${u.text}`:u.text},style:{backgroundColor:"rgba(0,0,0,0.85)",borderRadius:12},zIndex:1e3})}}return{id:`slide_${t.id}_${a}`,title:t.title,elements:l,background:Jr(t.background),transition:t.transition?{type:t.transition.type,duration:t.transition.duration}:void 0,duration:i}}function Ff(e,t,a,i){var s,l;const r=[];if(a)for(const c of t.cast){const d=e.characters.find(u=>u.id===c.characterId);d&&r.push({id:`char_${c.instanceId}`,type:"image",position:{x:c.position.x,y:c.position.y,rotation:c.rotation},size:{width:((s=d.visual.atlas)==null?void 0:s.meta.size.w)??100,height:((l=d.visual.atlas)==null?void 0:l.meta.size.h)??100},content:{src:d.visual.spriteSheet,alt:d.name},style:{opacity:c.opacity??1},animation:Pf(t,c.instanceId),zIndex:c.zIndex})}for(const c of t.scenery){const d=e.props.find(u=>u.id===c.propId);d&&r.push({id:`prop_${c.instanceId}`,type:"image",position:{x:c.position.x,y:c.position.y,rotation:c.rotation},size:{width:d.width,height:d.height},content:{src:d.asset,alt:d.name},style:{opacity:c.opacity??1},zIndex:c.zIndex})}return i&&Rf(t).forEach((d,u)=>{const g=e.characters.find(h=>h.id===d.speakerId);r.push({id:`dialogue_${u}`,type:"text",position:{x:e.stageSize.width/2,y:e.stageSize.height-100},size:{width:e.stageSize.width*.9,height:80},content:{text:g?`${g.name}: ${d.text}`:d.text},style:{backgroundColor:"rgba(0,0,0,0.85)",borderRadius:12},animation:{enter:{type:"fadeIn",duration:300,delay:d.time},exit:{type:"fadeOut",duration:300,delay:d.time+d.duration-300}},zIndex:1e3+u})}),{id:`slide_${t.id}`,title:t.title,elements:r,background:Jr(t.background),transition:t.transition?{type:t.transition.type,duration:t.transition.duration}:void 0,duration:t.duration,notes:`Converted from Puppet Show scene: ${t.title}`}}function If(e,t,a){const i=e.timeline.find(l=>l.type==="transform"&&l.targetId===t);if(!i)return null;const r=i.keyframes;let s=null;for(const l of r){const c=l.value;l.time<=a&&c.position&&(s=c)}return(s==null?void 0:s.position)??null}function Df(e,t,a){const i=e.timeline.find(l=>l.type==="transform"&&l.targetId===t);if(!i)return null;const r=i.keyframes;let s=null;for(const l of r)l.time<=a&&(s=l.value);return s?{scale:s.scale,rotation:s.rotation,opacity:s.opacity}:null}function Tf(e,t){for(const a of e.timeline)if(a.type==="dialogue")for(const i of a.keyframes){const r=i.value;if(t>=i.time&&t<i.time+(i.duration??0))return{text:r.text,speakerId:a.targetId}}return null}function Rf(e){const t=[];for(const a of e.timeline)if(a.type==="dialogue")for(const i of a.keyframes){const r=i.value;t.push({text:r.text,speakerId:a.targetId,time:i.time,duration:i.duration??0})}return t.sort((a,i)=>a.time-i.time)}function Jr(e){var t,a;switch(e.type){case"solid":return{type:"solid",color:e.color};case"gradient":return e.gradient?{type:"gradient",gradient:e.gradient}:{type:"solid",color:"#000000"};case"image":return{type:"image",image:e.image};case"video":return{type:"video",video:e.video};case"parallax":return{type:"image",image:(a=(t=e.parallaxLayers)==null?void 0:t[0])==null?void 0:a.image};default:return{type:"solid",color:"#000000"}}}function Pf(e,t){const a=e.timeline.find(r=>r.type==="transform"&&r.targetId===t);return!a||a.keyframes.length===0?void 0:{timeline:a.keyframes.map(r=>{var l,c;const s=r.value;return{time:r.time,properties:{x:(l=s.position)==null?void 0:l.x,y:(c=s.position)==null?void 0:c.y,scale:s.scale,rotation:s.rotation,opacity:s.opacity},easing:r.easing}})}}function Bf(e,t){const a=[],i=[],r=[],s=new Map;for(const l of e.slides)for(const c of l.elements)c.type==="image"&&c.content.src&&(s.has(c.content.src)||s.set(c.content.src,new Set),s.get(c.content.src).add(c));if(t!=null&&t.createCharacterFromImages){for(const[l,c]of s)if(c.size>=2){const d=Array.from(c)[0],u=`char_${a.length}`;a.push({id:u,name:d.content.alt||`Character ${a.length+1}`,type:"sprite",visual:{type:"sprite",spriteSheet:l,atlas:{frames:{default:{frame:{x:0,y:0,w:d.size.width,h:d.size.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:d.size.width,h:d.size.height},sourceSize:{w:d.size.width,h:d.size.height}}},meta:{image:l,size:{w:d.size.width,h:d.size.height},scale:1}},width:d.size.width,height:d.size.height},anchor:{x:.5,y:1},animations:[{id:"idle",name:"Idle",category:"idle",frames:[{frameId:"default",duration:1e3,offset:{x:0,y:0}}],fps:1,loop:!0,duration:1e3}],expressions:[],defaultScale:1})}}for(const[l,c]of s)if(c.size<2||!(t!=null&&t.createCharacterFromImages)){const d=Array.from(c)[0];i.push({id:`prop_${i.length}`,name:d.content.alt||`Prop ${i.length+1}`,type:"image",asset:l,width:d.size.width,height:d.size.height,anchor:{x:.5,y:.5}})}for(const l of e.slides){const c=Lf(l,e,a,i);r.push(c)}return{version:"1.0",id:e.id+"_puppetshow",title:e.title,stageSize:{width:e.layout.width,height:e.layout.height},scenes:r,characters:a,props:i,audioTracks:[],settings:{defaultFps:24,allowSpeedControl:!0,allowSeek:!0,autoPlay:!1,showControls:!0,loop:!1},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),duration:e.slides.reduce((l,c)=>l+(c.duration??5e3),0),sceneCount:r.length,characterCount:a.length,sourcePresentation:e.id,convertedAt:new Date().toISOString()}}}function Lf(e,t,a,i){var u,g,h,p;const r=[],s=[],l=[];let c=0,d=0;for(const m of e.elements)if(m.type==="image"&&m.content.src){const k=a.find(b=>b.visual.spriteSheet===m.content.src);if(k){const b=`${k.id}_instance_${c++}`;if(r.push({instanceId:b,characterId:k.id,position:{x:m.position.x,y:m.position.y},scale:1,rotation:m.position.rotation??0,zIndex:m.zIndex??c,opacity:((u=m.style)==null?void 0:u.opacity)??1,flipX:!1}),(g=m.animation)!=null&&g.timeline&&m.animation.timeline.length>1){const C={id:`transform_${b}`,type:"transform",targetId:b,keyframes:m.animation.timeline.map(_=>({time:_.time,easing:_.easing??"easeInOut",value:{type:"transform",position:_.properties.x!==void 0?{x:_.properties.x,y:_.properties.y??0}:void 0,scale:_.properties.scale,rotation:_.properties.rotation,opacity:_.properties.opacity}}))};l.push(C)}}else{const b=i.find(C=>C.asset===m.content.src);b&&s.push({instanceId:`${b.id}_instance_${d++}`,propId:b.id,position:{x:m.position.x,y:m.position.y},scale:1,rotation:m.position.rotation??0,zIndex:m.zIndex??d,opacity:((h=m.style)==null?void 0:h.opacity)??1})}}else if(m.type==="text"&&m.content.text&&m.position.y>t.layout.height*.7){const b=((p=r[0])==null?void 0:p.characterId)??"narrator",C=l.find(f=>f.type==="dialogue"&&f.targetId===b),_={time:0,duration:e.duration??3e3,easing:"linear",value:{type:"dialogue",text:m.content.text}};C?C.keyframes.push(_):l.push({id:`dialogue_${b}`,type:"dialogue",targetId:b,keyframes:[_]})}return{id:e.id,title:e.title||"Untitled Scene",duration:e.duration??5e3,background:e.background?{type:e.background.type,color:e.background.color,gradient:e.background.gradient,image:e.background.image,video:e.background.video}:{type:"solid",color:"#000000"},cast:r,scenery:s,timeline:l,camera:{position:{x:t.layout.width/2,y:t.layout.height/2},zoom:1,rotation:0},transition:e.transition?{type:(()=>{const m=e.transition.type;return m==="fade"?"fade":m==="zoom"?"zoom":m==="slide"?"slideLeft":"cut"})(),duration:e.transition.duration??500}:void 0}}function Of(e){const t=[],a=[];e.id||t.push("Document missing id"),e.title||a.push("Document missing title"),e.version||a.push("Document missing version"),e.stageSize||t.push("Document missing stageSize"),(!e.scenes||e.scenes.length===0)&&t.push("Document has no scenes");const i=new Set(e.characters.map(s=>s.id));for(const s of e.scenes)for(const l of s.cast)i.has(l.characterId)||t.push(`Scene "${s.id}" references unknown character: ${l.characterId}`);const r=new Set(e.props.map(s=>s.id));for(const s of e.scenes)for(const l of s.scenery)r.has(l.propId)||t.push(`Scene "${s.id}" references unknown prop: ${l.propId}`);return{valid:t.length===0,errors:t,warnings:a}}function Hf(e,t){if(e.length===0)throw new Error("Cannot merge empty array of puppet shows");const a={version:"1.0",id:`merged_${Date.now()}`,title:e.map(s=>s.title).join(" + "),stageSize:e[0].stageSize,scenes:[],characters:[],props:[],audioTracks:[],settings:e[0].settings,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),duration:e.reduce((s,l)=>{var c;return s+(((c=l.metadata)==null?void 0:c.duration)??0)},0),sceneCount:0,characterCount:0,mergedFrom:e.map(s=>s.id),mergedAt:new Date().toISOString()}},i=new Map,r=new Map;for(const s of e){for(const l of s.characters){if(t!=null&&t.deduplicateCharacters){const d=a.characters.find(u=>u.name===l.name);if(d){i.set(l.id,d.id);continue}}const c=`${s.id}_${l.id}`;i.set(l.id,c),a.characters.push({...l,id:c})}for(const l of s.props){const c=`${s.id}_${l.id}`;r.set(l.id,c),a.props.push({...l,id:c})}for(const l of s.scenes){const c={...l,id:`${s.id}_${l.id}`,cast:l.cast.map(d=>({...d,instanceId:`${s.id}_${d.instanceId}`,characterId:i.get(d.characterId)||d.characterId})),scenery:l.scenery.map(d=>({...d,instanceId:`${s.id}_${d.instanceId}`,propId:r.get(d.propId)||d.propId})),timeline:l.timeline.map(d=>({...d,id:`${s.id}_${d.id}`,targetId:i.get(d.targetId)||r.get(d.targetId)||`${s.id}_${d.targetId}`}))};a.scenes.push(c)}for(const l of s.audioTracks||[])a.audioTracks.push({...l,id:`${s.id}_${l.id}`})}return a}const eo={good:"#4caf50",warning:"#ff9800",critical:"#f44336",info:"#2196f3",neutral:"#9e9e9e",background:"#ffffff",text:"#212121",textMuted:"#757575"};function Wf(e){const t={...eo,...e.colorScheme};return{id:e.id,title:e.title,type:"dashboard",layout:{columns:e.columns,rows:e.rows,gap:e.gap??16,padding:e.padding??24},widgets:e.widgets.map(a=>({...a,colSpan:a.colSpan??1,rowSpan:a.rowSpan??1,colors:{...t,...a.colors},animation:{countUp:!0,countUpDuration:1e3,entrance:"fadeIn",entranceDelay:0,...a.animation}})),dataSources:e.dataSources??[],refreshInterval:e.refreshInterval??3e4,colorScheme:t,background:e.background??t.background,showLastUpdated:e.showLastUpdated??!0,autoCycle:e.autoCycle??!1,autoCycleInterval:e.autoCycleInterval??5e3,lastUpdated:new Date().toISOString()}}function qf(e,t,a=!0){var r;if(!t||t.length===0)return"neutral";const i=[...t].sort((s,l)=>a?l.value-s.value:s.value-l.value);for(const s of i)if(a){if(e>=s.value)return s.status}else if(e<=s.value)return s.status;return((r=i[i.length-1])==null?void 0:r.status)??"neutral"}function Vf(e,t){return t==null?"unknown":e>t?"up":e<t?"down":"flat"}function Kf(e,t){if(typeof e=="string")return e;const{unit:a="",precision:i=0,compact:r=!1,locale:s="en-US"}=t??{};let l;return r&&Math.abs(e)>=1e3?l=new Intl.NumberFormat(s,{notation:"compact",maximumFractionDigits:1}).format(e):l=e.toLocaleString(s,{minimumFractionDigits:i,maximumFractionDigits:i}),a?`${l}${a}`:l}function to(e){return{id:"revenue",title:"Revenue",type:"number-tile",column:1,row:1,unit:"$",precision:0,icon:"dollar-sign",thresholds:[{value:1e6,status:"good"},{value:5e5,status:"warning"},{value:0,status:"critical"}],...e}}function no(e){return{id:"customers",title:"Customers",type:"number-tile",column:2,row:1,icon:"users",thresholds:[{value:1e4,status:"good"},{value:5e3,status:"warning"},{value:0,status:"critical"}],...e}}function Uf(e){return{id:"percentage-gauge",title:"Completion",type:"gauge",column:1,row:1,unit:"%",precision:1,gaugeConfig:{min:0,max:100,style:"semicircle",showNeedle:!0,showTicks:!0,tickCount:5,thickness:20},thresholds:[{value:80,status:"good"},{value:50,status:"warning"},{value:0,status:"critical"}],...e}}function Yf(e){return{id:"sparkline-trend",title:"Weekly Trend",type:"sparkline",column:1,row:1,sparklineData:[],...e}}function Zf(e){return{id:"traffic-light",title:"System Status",type:"traffic-light",column:1,row:1,...e}}function Gf(e){return{id:"comparison",title:"Budget vs Actual",type:"comparison",column:1,row:1,targetValue:1e5,value:85e3,unit:"$",...e}}function Xf(){return{id:"executive-dashboard",title:"Executive Summary",columns:4,rows:3,widgets:[to({column:1,row:1,colSpan:1}),no({column:2,row:1,colSpan:1}),{id:"orders",title:"Orders",type:"number-tile",column:3,row:1,icon:"shopping-cart"},{id:"satisfaction",title:"CSAT Score",type:"gauge",column:4,row:1,unit:"%",gaugeConfig:{min:0,max:100,style:"semicircle"}},{id:"revenue-trend",title:"Revenue Trend",type:"sparkline",column:1,row:2,colSpan:2},{id:"top-products",title:"Top Products",type:"mini-bar",column:3,row:2,colSpan:2,chartData:[{label:"Product A",value:45e3},{label:"Product B",value:38e3},{label:"Product C",value:32e3},{label:"Product D",value:28e3},{label:"Product E",value:22e3}]},{id:"regional-breakdown",title:"Regional Sales",type:"mini-pie",column:1,row:3,colSpan:2,chartData:[{label:"North",value:35},{label:"South",value:25},{label:"East",value:22},{label:"West",value:18}]},{id:"budget-status",title:"Budget Status",type:"bullet-chart",column:3,row:3,colSpan:2,value:72e3,targetValue:1e5,unit:"$"}]}}function Qf(){return{id:"operational-dashboard",title:"Operational Metrics",columns:3,rows:2,widgets:[{id:"uptime",title:"System Uptime",type:"gauge",column:1,row:1,value:99.9,unit:"%",gaugeConfig:{min:0,max:100,style:"full-circle"},thresholds:[{value:99.5,status:"good"},{value:99,status:"warning"},{value:0,status:"critical"}]},{id:"response-time",title:"Avg Response Time",type:"number-tile",column:2,row:1,value:145,unit:"ms",icon:"clock",thresholds:[{value:0,status:"good"},{value:200,status:"warning"},{value:500,status:"critical"}]},{id:"error-rate",title:"Error Rate",type:"traffic-light",column:3,row:1,value:.5,unit:"%"},{id:"throughput",title:"Requests/sec",type:"sparkline",column:1,row:2,colSpan:2,sparklineData:[120,135,128,145,152,148,160,155,170,165]},{id:"incidents",title:"Open Incidents",type:"number-tile",column:3,row:2,value:3,icon:"alert-triangle",thresholds:[{value:0,status:"good"},{value:5,status:"warning"},{value:10,status:"critical"}]}]}}function Jf(e){var t,a,i;return{id:e.id,type:"datagrid",title:e.title,subtitle:e.subtitle,config:{...e,columns:e.columns.map(r=>({width:"auto",align:"left",dataType:"string",sortable:!0,filterable:!1,...r})),interactiveSort:e.interactiveSort??!0,interactiveFilter:e.interactiveFilter??!1,enableSelection:e.enableSelection??!0,showRowNumbers:e.showRowNumbers??!1,showColumnBorders:e.showColumnBorders??!1,stripedRows:e.stripedRows??!0,pageSize:e.pageSize??10,animation:{rowEntrance:"fadeIn",staggerDelay:50,duration:300,progressiveReveal:!1,revealBatchSize:5,...e.animation},style:{headerBackground:"#f5f5f5",headerColor:"#212121",rowBackground:"#ffffff",rowBackgroundAlt:"#fafafa",cellColor:"#424242",borderColor:"#e0e0e0",fontSize:14,headerFontSize:14,rowHeight:48,cellPadding:12,borderRadius:8,...e.style}},state:{currentSort:e.defaultSort??[],currentFilters:e.defaultFilters??[],selectedCells:[],currentPage:0,revealedRowCount:(t=e.animation)!=null&&t.progressiveReveal?e.animation.revealBatchSize??5:((a=e.data)==null?void 0:a.length)??0,isFullyRevealed:!((i=e.animation)!=null&&i.progressiveReveal),lastUpdated:new Date().toISOString()}}}function eg(e,t){return t.length===0?e:[...e].sort((a,i)=>{for(const r of t){const s=a[r.field],l=i[r.field];let c=0;if(s==null&&l==null?c=0:s==null?c=1:l==null?c=-1:typeof s=="number"&&typeof l=="number"?c=s-l:c=String(s).localeCompare(String(l)),c!==0)return r.direction==="desc"?-c:c}return 0})}function tg(e,t){return t.length===0?e:e.filter(a=>t.every(i=>{const r=a[i.field],s=i.value;switch(i.operator){case"equals":return r===s;case"notEquals":return r!==s;case"contains":return String(r).toLowerCase().includes(String(s).toLowerCase());case"startsWith":return String(r).toLowerCase().startsWith(String(s).toLowerCase());case"endsWith":return String(r).toLowerCase().endsWith(String(s).toLowerCase());case"greaterThan":return Number(r)>Number(s);case"lessThan":return Number(r)<Number(s);case"between":return Number(r)>=Number(s)&&Number(r)<=Number(i.valueTo);case"in":return Array.isArray(s)&&s.includes(r);default:return!0}}))}function ng(e,t){const a={};for(const i of t.columns){const r=e.map(s=>s[i.columnId]).filter(s=>s!=null);switch(i.aggregation){case"sum":a[i.columnId]=r.reduce((s,l)=>s+Number(l),0);break;case"avg":a[i.columnId]=r.length>0?r.reduce((s,l)=>s+Number(l),0)/r.length:0;break;case"min":a[i.columnId]=Math.min(...r.map(Number));break;case"max":a[i.columnId]=Math.max(...r.map(Number));break;case"count":a[i.columnId]=r.length;break;case"custom":a[i.columnId]=i.customValue??"";break}}return a}function ag(e,t,a="en-US"){if(e==null)return"";switch(t.dataType){case"number":return Number(e).toLocaleString(a,{minimumFractionDigits:t.precision??0,maximumFractionDigits:t.precision??0});case"currency":return Number(e).toLocaleString(a,{style:"currency",currency:t.currency??"USD"});case"percent":return Number(e).toLocaleString(a,{style:"percent",minimumFractionDigits:t.precision??0});case"date":return new Date(String(e)).toLocaleDateString(a);case"boolean":return e?"✓":"✗";default:return String(e)}}function ig(e,t){if(!t)return null;for(const a of t){const{operator:i,value:r,valueTo:s}=a.condition;let l=!1;switch(i){case"equals":l=e===r;break;case"notEquals":l=e!==r;break;case"greaterThan":l=Number(e)>Number(r);break;case"lessThan":l=Number(e)<Number(r);break;case"between":l=Number(e)>=Number(r)&&Number(e)<=Number(s);break;case"contains":l=String(e).toLowerCase().includes(String(r).toLowerCase());break;case"isEmpty":l=e==null||e==="";break}if(l)return a.style}return null}function rg(e){return{id:"sales-grid",title:"Sales Report",subtitle:"Q4 2025 Performance",columns:[{id:"region",header:"Region",field:"region",width:150},{id:"product",header:"Product",field:"product",width:200},{id:"units",header:"Units Sold",field:"units",dataType:"number",align:"right"},{id:"revenue",header:"Revenue",field:"revenue",dataType:"currency",align:"right",conditionalFormat:[{condition:{operator:"greaterThan",value:1e5},style:{backgroundColor:"#e8f5e9",color:"#2e7d32"}},{condition:{operator:"lessThan",value:5e4},style:{backgroundColor:"#ffebee",color:"#c62828"}}]},{id:"growth",header:"Growth %",field:"growth",dataType:"percent",align:"right",precision:1}],data:e??[{region:"North",product:"Widget Pro",units:1250,revenue:125e3,growth:.15},{region:"South",product:"Widget Pro",units:980,revenue:98e3,growth:.08},{region:"East",product:"Gadget Plus",units:1500,revenue:18e4,growth:.22},{region:"West",product:"Gadget Plus",units:1100,revenue:132e3,growth:.12}],summaryRow:{enabled:!0,columns:[{columnId:"units",aggregation:"sum",label:"Total"},{columnId:"revenue",aggregation:"sum"},{columnId:"growth",aggregation:"avg"}]},animation:{rowEntrance:"slideInLeft",staggerDelay:100}}}function og(e){return{id:"employee-grid",title:"Team Directory",columns:[{id:"name",header:"Name",field:"name",width:180},{id:"role",header:"Role",field:"role",width:150},{id:"department",header:"Department",field:"department",width:120,filterable:!0},{id:"email",header:"Email",field:"email",width:200},{id:"status",header:"Status",field:"status",cellRenderer:"badge",width:100}],data:e??[],showRowNumbers:!0,interactiveFilter:!0}}function sg(e){var a;const t={};return(a=e.parameters)==null||a.forEach(i=>{i.defaultValue!==void 0&&(t[i.name]=i.defaultValue)}),{id:e.id,type:"query",title:e.title,subtitle:e.subtitle,config:{...e,autoExecute:e.autoExecute??!1,showQueryEditor:e.showQueryEditor??!0,allowQueryEdit:e.allowQueryEdit??!1,showExecutionStats:e.showExecutionStats??!0,cacheDuration:e.cacheDuration??0,style:{editorTheme:"dark",editorFontSize:14,resultBackground:"#ffffff",accentColor:"#1976d2",borderRadius:8,...e.style}},state:{currentQuery:e.query,currentParameters:t,result:null,isExecuting:!1,lastExecutedAt:null,error:null,visualizationMode:e.visualization.mode,history:[]}}}function lg(e,t){const a=[];switch(t){case"sql":const i=e.matchAll(/[@:](\w+)/g);for(const c of i)a.includes(c[1])||a.push(c[1]);break;case"odata":const r=e.matchAll(/\{(\w+)\}/g);for(const c of r)a.includes(c[1])||a.push(c[1]);break;case"graphql":const s=e.matchAll(/\$(\w+)/g);for(const c of s)a.includes(c[1])||a.push(c[1]);break;case"kql":const l=e.matchAll(/\{(\w+)\}/g);for(const c of l)a.includes(c[1])||a.push(c[1]);break}return a}function cg(e,t,a){let i=e;for(const[r,s]of Object.entries(a)){const l=dg(s);switch(t){case"sql":i=i.replace(new RegExp(`@${r}\\b`,"g"),l),i=i.replace(new RegExp(`:${r}\\b`,"g"),l);break;case"odata":case"kql":i=i.replace(new RegExp(`\\{${r}\\}`,"g"),l);break}}return i}function dg(e){return e==null?"NULL":typeof e=="number"?String(e):typeof e=="boolean"?e?"TRUE":"FALSE":e instanceof Date?`'${e.toISOString()}'`:`'${String(e).replace(/'/g,"''")}'`}function ug(e,t){const a={};for(const i of e){const r=t[i.name];if(i.required&&(r==null||r==="")){a[i.name]=`${i.label} is required`;continue}if(r!=null&&i.validation){if(i.type==="number"){const s=Number(r);i.validation.min!==void 0&&s<i.validation.min&&(a[i.name]=i.validation.message??`Minimum value is ${i.validation.min}`),i.validation.max!==void 0&&s>i.validation.max&&(a[i.name]=i.validation.message??`Maximum value is ${i.validation.max}`)}i.type==="string"&&i.validation.pattern&&(new RegExp(i.validation.pattern).test(String(r))||(a[i.name]=i.validation.message??"Invalid format"))}}return{valid:Object.keys(a).length===0,errors:a}}function pg(e){if(!e.success||e.rowCount===0)return"table";const t=e.columns.filter(i=>i.type==="number"),a=e.columns.filter(i=>i.type==="date");return e.rowCount===1&&t.length>=3?"metrics":a.length===1&&t.length>=1&&e.rowCount>3?"line-chart":t.length===1&&e.rowCount<=15?"bar-chart":t.length===1&&e.rowCount<=8?"pie-chart":"table"}function mg(e,t){var c,d,u;if(!e.success||e.columns.length===0)return;const a=e.columns.filter(g=>g.type==="number"),i=e.columns.filter(g=>g.type!=="number"),s=((c=e.columns.filter(g=>g.type==="date")[0])==null?void 0:c.name)??((d=i[0])==null?void 0:d.name)??e.columns[0].name,l=a.length>0?a.length===1?a[0].name:a.slice(0,3).map(g=>g.name):(u=e.columns[1])==null?void 0:u.name;return{xAxis:s,yAxis:l,showLegend:Array.isArray(l)&&l.length>1,showGrid:!0,colorScheme:["#1976d2","#43a047","#fb8c00","#e53935","#8e24aa"]}}function hg(){return{id:"sales-query",title:"Sales Analysis",subtitle:"Query live sales data",language:"sql",query:`SELECT
1383
+ Region,
1384
+ ProductCategory,
1385
+ SUM(Revenue) as TotalRevenue,
1386
+ COUNT(*) as OrderCount,
1387
+ AVG(Revenue) as AvgOrderValue
1388
+ FROM Sales
1389
+ WHERE OrderDate >= @startDate AND OrderDate <= @endDate
1390
+ GROUP BY Region, ProductCategory
1391
+ ORDER BY TotalRevenue DESC`,parameters:[{name:"startDate",label:"Start Date",type:"date",required:!0,defaultValue:new Date(Date.now()-30*24*60*60*1e3).toISOString().split("T")[0]},{name:"endDate",label:"End Date",type:"date",required:!0,defaultValue:new Date().toISOString().split("T")[0]}],dataSource:{id:"sales-query-ds",name:"Sales Query Source",type:"rest-api",config:{type:"rest-api",url:"/api/query",method:"POST"},status:"idle"},visualization:{mode:"bar-chart",chartConfig:{xAxis:"Region",yAxis:"TotalRevenue",seriesField:"ProductCategory",showLegend:!0}},showQueryEditor:!0,showExecutionStats:!0}}function fg(){return{id:"odata-query",title:"Product Catalog",subtitle:"OData Query Example",language:"odata",query:"Products?$filter=Category eq '{category}' and Price gt {minPrice}&$orderby=Price desc&$top=20&$select=Name,Category,Price,Stock",parameters:[{name:"category",label:"Category",type:"select",required:!0,defaultValue:"Electronics",options:[{value:"Electronics",label:"Electronics"},{value:"Clothing",label:"Clothing"},{value:"Books",label:"Books"}]},{name:"minPrice",label:"Minimum Price",type:"number",defaultValue:0,validation:{min:0}}],dataSource:{id:"odata-query-ds",name:"OData Query Source",type:"rest-api",config:{type:"rest-api",url:"https://api.example.com/odata",method:"GET"},status:"idle"},visualization:{mode:"table",tableConfig:{pageSize:10,sortable:!0}}}}function gg(){return{id:"kql-query",title:"Application Insights",subtitle:"Request Performance Analysis",language:"kql",query:`requests
1392
+ | where timestamp > ago({timeRange})
1393
+ | summarize
1394
+ RequestCount = count(),
1395
+ AvgDuration = avg(duration),
1396
+ P95Duration = percentile(duration, 95),
1397
+ FailureRate = countif(success == false) * 100.0 / count()
1398
+ by bin(timestamp, 1h)
1399
+ | order by timestamp asc`,parameters:[{name:"timeRange",label:"Time Range",type:"select",defaultValue:"24h",options:[{value:"1h",label:"Last Hour"},{value:"24h",label:"Last 24 Hours"},{value:"7d",label:"Last 7 Days"},{value:"30d",label:"Last 30 Days"}]}],dataSource:{id:"kql-query-ds",name:"KQL Query Source",type:"rest-api",config:{type:"rest-api",url:"https://api.applicationinsights.azure.com/v1/apps/{app-id}/query",method:"POST"},status:"idle"},visualization:{mode:"line-chart",chartConfig:{xAxis:"timestamp",yAxis:["AvgDuration","P95Duration"],showLegend:!0,showGrid:!0}},autoExecute:!0}}class yg{constructor(t,a,i){this.versions=new Map,this.branches=new Map,this.currentVersionId=null,this.currentBranch="main",this.autoSaveTimer=null,this.lastAutoSaveTime=0,this.presentationId=t,this.config={maxVersions:50,autoSaveInterval:6e4,autoSaveDebounce:5e3,preserveLabeledVersions:!0,enableBranching:!0,...a},this.onChange=i,this.branches.set("main",{name:"main",headVersionId:"",createdAt:new Date().toISOString(),createdBy:a.currentUser})}getVersionHistory(){return Array.from(this.versions.values()).filter(t=>!t.branchName||t.branchName===this.currentBranch).sort((t,a)=>a.versionNumber-t.versionNumber)}getVersion(t){return this.versions.get(t)}getCurrentVersion(){return this.currentVersionId?this.versions.get(this.currentVersionId):void 0}saveVersion(t,a={}){var u;const i=this.generateVersionId(),r=this.getCurrentVersion(),s=((r==null?void 0:r.versionNumber)??0)+1,l=r?this.calculateDiff(r.snapshot,t):void 0,c={versionId:i,versionNumber:s,snapshot:this.clonePresentation(t),createdAt:new Date().toISOString(),createdBy:this.config.currentUser,label:a.label,description:a.description??this.generateAutoDescription(l),tags:a.tags,isAutoSave:a.isAutoSave??!1,parentVersionId:this.currentVersionId??void 0,branchName:this.currentBranch,diff:l};this.versions.set(i,c),this.currentVersionId=i;const d=this.branches.get(this.currentBranch);return d&&(d.headVersionId=i),this.pruneVersions(),(u=this.onChange)==null||u.call(this,c),c}scheduleAutoSave(t){if(this.config.autoSaveInterval<=0)return;this.autoSaveTimer&&clearTimeout(this.autoSaveTimer);const i=Date.now()-this.lastAutoSaveTime,r=Math.max(this.config.autoSaveDebounce,this.config.autoSaveInterval-i);this.autoSaveTimer=setTimeout(()=>{this.saveVersion(t,{isAutoSave:!0}),this.lastAutoSaveTime=Date.now()},r)}cancelAutoSave(){this.autoSaveTimer&&(clearTimeout(this.autoSaveTimer),this.autoSaveTimer=null)}restoreVersion(t){const a=this.versions.get(t);if(!a)return null;const i=this.getCurrentVersion();return i&&this.saveVersion(i.snapshot,{label:`Before restore to v${a.versionNumber}`,description:`Auto-saved before restoring to version ${a.versionNumber}`}),this.saveVersion(a.snapshot,{description:`Restored from version ${a.versionNumber}`}).snapshot}previewVersion(t){const a=this.versions.get(t);return a?this.clonePresentation(a.snapshot):null}labelVersion(t,a){const i=this.versions.get(t);return i?(i.label=a,!0):!1}tagVersion(t,a){const i=this.versions.get(t);return i?(i.tags=[...new Set([...i.tags??[],...a])],!0):!1}createBranch(t,a){if(!this.config.enableBranching||this.branches.has(t))return null;const i={name:t,headVersionId:this.currentVersionId??"",createdAt:new Date().toISOString(),createdBy:this.config.currentUser,description:a};return this.branches.set(t,i),i}switchBranch(t){const a=this.branches.get(t);return a?(this.currentBranch=t,this.currentVersionId=a.headVersionId,!0):!1}getBranches(){return Array.from(this.branches.values())}getCurrentBranch(){return this.currentBranch}compareVersions(t,a){const i=this.versions.get(t),r=this.versions.get(a);return!i||!r?null:this.calculateDiff(i.snapshot,r.snapshot)}calculateDiff(t,a){const i=[],r=[],s=new Map(t.slides.map((k,b)=>[k.id,{slide:k,index:b}])),l=new Map(a.slides.map((k,b)=>[k.id,{slide:k,index:b}]));let c=0,d=0,u=0,g=0,h=0,p=0;for(const[k,{slide:b,index:C}]of l){const _=s.get(k);if(!_)c++,g+=b.elements.length,i.push({slideId:k,slideIndex:C,changeType:"added",slideTitle:this.getSlideTitle(b)});else{const f=this.calculateElementChanges(_.slide,b);if((f.length>0||_.index!==C)&&(_.index!==C&&i.push({slideId:k,slideIndex:C,changeType:"reordered",slideTitle:this.getSlideTitle(b),previousIndex:_.index}),f.length>0)){u++,i.push({slideId:k,slideIndex:C,changeType:"modified",slideTitle:this.getSlideTitle(b),elementChanges:f});for(const v of f)v.changeType==="added"?g++:v.changeType==="removed"?h++:p++}}}for(const[k,{slide:b,index:C}]of s)l.has(k)||(d++,h+=b.elements.length,i.push({slideId:k,slideIndex:C,changeType:"removed",slideTitle:this.getSlideTitle(b)}));const m=["title","author","theme"];for(const k of m)JSON.stringify(t[k])!==JSON.stringify(a[k])&&r.push({property:k,oldValue:t[k],newValue:a[k]});return{summary:{slidesAdded:c,slidesRemoved:d,slidesModified:u,elementsAdded:g,elementsRemoved:h,elementsModified:p,totalChanges:c+d+u+r.length},slideChanges:i,metadataChanges:r}}calculateElementChanges(t,a){const i=[],r=new Map(t.elements.map(l=>[l.id,l])),s=new Map(a.elements.map(l=>[l.id,l]));for(const[l,c]of s){const d=r.get(l);if(!d)i.push({elementId:l,elementType:c.type,changeType:"added"});else{const u=this.calculatePropertyChanges(d,c);u.length>0&&i.push({elementId:l,elementType:c.type,changeType:"modified",propertyChanges:u})}}for(const[l,c]of r)s.has(l)||i.push({elementId:l,elementType:c.type,changeType:"removed"});return i}calculatePropertyChanges(t,a){const i=[],r=t,s=a,l=new Set([...Object.keys(r),...Object.keys(s)]);for(const c of l)c!=="id"&&JSON.stringify(r[c])!==JSON.stringify(s[c])&&i.push({property:c,oldValue:r[c],newValue:s[c]});return i}getSlideTitle(t){const a=t.elements.find(i=>{var r;return i.type==="text"&&((r=i.content)==null?void 0:r.text)});if(a){const i=a.content.text;return i.substring(0,50)+(i.length>50?"...":"")}return`Slide ${t.id}`}generateAutoDescription(t){if(!t)return"Initial version";const a=[],{summary:i}=t;return i.slidesAdded>0&&a.push(`+${i.slidesAdded} slide(s)`),i.slidesRemoved>0&&a.push(`-${i.slidesRemoved} slide(s)`),i.slidesModified>0&&a.push(`~${i.slidesModified} slide(s) modified`),t.metadataChanges.length>0&&a.push("metadata updated"),a.length>0?a.join(", "):"No significant changes"}clonePresentation(t){return JSON.parse(JSON.stringify(t))}generateVersionId(){return`v_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}pruneVersions(){const t=Array.from(this.versions.values()).filter(r=>!r.branchName||r.branchName===this.currentBranch).sort((r,s)=>r.versionNumber-s.versionNumber),a=new Set;if(this.currentVersionId&&a.add(this.currentVersionId),this.config.preserveLabeledVersions)for(const r of t)r.label&&a.add(r.versionId);const i=t.slice(-this.config.maxVersions);for(const r of i)a.add(r.versionId);for(const r of t)a.has(r.versionId)||this.versions.delete(r.versionId)}exportHistory(){return JSON.stringify({presentationId:this.presentationId,currentVersionId:this.currentVersionId,currentBranch:this.currentBranch,versions:Array.from(this.versions.values()),branches:Array.from(this.branches.values())})}importHistory(t){const a=JSON.parse(t);this.presentationId=a.presentationId,this.currentVersionId=a.currentVersionId,this.currentBranch=a.currentBranch,this.versions=new Map(a.versions.map(i=>[i.versionId,i])),this.branches=new Map(a.branches.map(i=>[i.name,i]))}dispose(){this.cancelAutoSave()}}class bg{constructor(t,a){this.slides=new Map,this.elements=new Map,this.templates=new Map,this.collections=new Map,this.linkedInstances=new Map,this.currentUser=t,this.onUpdate=a}addSlide(t,a){const i=this.generateId(),r=new Date().toISOString(),s={metadata:{id:i,type:"slide",name:a.name,description:a.description,tags:a.tags??[],collectionIds:a.collectionIds??[],createdBy:this.currentUser,createdAt:r,updatedAt:r,version:1,usageCount:0,visibility:a.visibility??"private"},slide:this.cloneSlide(t),placeholders:a.placeholders};return this.slides.set(i,s),this.updateCollectionCounts(),s}updateSlide(t,a){var r;const i=this.slides.get(t);return!i||i.metadata.createdBy.id!==this.currentUser.id?null:(a.slide&&(i.slide=this.cloneSlide(a.slide),i.metadata.version++),a.name!==void 0&&(i.metadata.name=a.name),a.description!==void 0&&(i.metadata.description=a.description),a.tags!==void 0&&(i.metadata.tags=a.tags),a.placeholders!==void 0&&(i.placeholders=a.placeholders),i.metadata.updatedAt=new Date().toISOString(),(r=this.onUpdate)==null||r.call(this,"slide",t),i)}removeSlide(t){const a=this.slides.get(t);return!a||a.metadata.createdBy.id!==this.currentUser.id?!1:(this.slides.delete(t),this.updateCollectionCounts(),!0)}getSlide(t){return this.slides.get(t)}useSlide(t,a){const i=this.slides.get(t);if(!i)return null;i.metadata.usageCount++;const r=this.cloneSlide(i.slide);if(r.id=this.generateId(),a!=null&&a.placeholderValues&&i.placeholders&&this.applyPlaceholderValues(r,i.placeholders,a.placeholderValues),a!=null&&a.elementOverrides)for(const s of r.elements){const l=a.elementOverrides[s.id];l&&Object.assign(s,l)}return a!=null&&a.backgroundOverride&&(r.background=a.backgroundOverride),r}linkSlide(t,a,i,r){const s=this.slides.get(t);if(!s)return null;const l=this.generateId(),c={instanceId:l,libraryItemId:t,presentationId:a,slideIndex:i,overrides:r,syncStatus:"synced",syncedVersion:s.metadata.version};return this.linkedInstances.set(l,c),s.metadata.usageCount++,c}syncLinkedSlide(t){const a=this.linkedInstances.get(t);if(!a)return null;const i=this.slides.get(a.libraryItemId);if(!i)return null;const r=this.useSlide(a.libraryItemId,a.overrides);return r&&(a.syncStatus="synced",a.syncedVersion=i.metadata.version),r}getOutdatedInstances(){const t=[];for(const a of this.linkedInstances.values()){const i=this.slides.get(a.libraryItemId);i&&i.metadata.version>a.syncedVersion&&(a.syncStatus="outdated",t.push(a))}return t}addElement(t,a){const i=this.generateId(),r=new Date().toISOString(),s={metadata:{id:i,type:"element",name:a.name,description:a.description,tags:a.tags??[],createdBy:this.currentUser,createdAt:r,updatedAt:r,version:1,usageCount:0,visibility:a.visibility??"private"},element:JSON.parse(JSON.stringify(t))};return this.elements.set(i,s),s}getElement(t){return this.elements.get(t)}useElement(t){const a=this.elements.get(t);if(!a)return null;a.metadata.usageCount++;const i=JSON.parse(JSON.stringify(a.element));return i.id=this.generateId(),i}addTemplate(t,a){const i=this.generateId(),r=new Date().toISOString(),s={metadata:{id:i,type:"template",name:a.name,description:a.description,tags:a.tags??[],createdBy:this.currentUser,createdAt:r,updatedAt:r,version:1,usageCount:0,visibility:a.visibility??"private"},slides:t.map(l=>this.cloneSlide(l)),variables:a.variables,useCases:a.useCases};return this.templates.set(i,s),s}getTemplate(t){return this.templates.get(t)}useTemplate(t,a){const i=this.templates.get(t);if(!i)return null;i.metadata.usageCount++;const r=i.slides.map(s=>{const l=this.cloneSlide(s);return l.id=this.generateId(),l});return a&&i.variables&&this.applyTemplateVariables(r,i.variables,a),r}createCollection(t){const a=this.generateId(),i={id:a,name:t.name,description:t.description,icon:t.icon,color:t.color,parentId:t.parentId,itemCount:0,createdBy:this.currentUser,createdAt:new Date().toISOString(),visibility:t.visibility??"private"};return this.collections.set(a,i),i}getCollections(){return Array.from(this.collections.values())}addToCollection(t,a){const i=this.slides.get(t),r=this.elements.get(t),s=this.templates.get(t),l=i??r??s;return!l||!this.collections.get(a)?!1:(l.metadata.collectionIds||(l.metadata.collectionIds=[]),l.metadata.collectionIds.includes(a)||(l.metadata.collectionIds.push(a),this.updateCollectionCounts()),!0)}search(t){let a=[];const i=t.types??["slide","element","template"];if(i.includes("slide")&&a.push(...Array.from(this.slides.values())),i.includes("element")&&a.push(...Array.from(this.elements.values())),i.includes("template")&&a.push(...Array.from(this.templates.values())),t.visibility&&(a=a.filter(u=>t.visibility.includes(u.metadata.visibility))),t.query){const u=t.query.toLowerCase();a=a.filter(g=>{var h,p;return g.metadata.name.toLowerCase().includes(u)||((h=g.metadata.description)==null?void 0:h.toLowerCase().includes(u))||((p=g.metadata.tags)==null?void 0:p.some(m=>m.toLowerCase().includes(u)))})}t.tags&&t.tags.length>0&&(a=a.filter(u=>t.tags.some(g=>{var h;return(h=u.metadata.tags)==null?void 0:h.includes(g)}))),t.collectionIds&&t.collectionIds.length>0&&(a=a.filter(u=>t.collectionIds.some(g=>{var h;return(h=u.metadata.collectionIds)==null?void 0:h.includes(g)}))),t.createdBy&&(a=a.filter(u=>u.metadata.createdBy.id===t.createdBy));const r=t.sortBy??"updatedAt",s=t.sortOrder??"desc";a.sort((u,g)=>{let h=0;switch(r){case"name":h=u.metadata.name.localeCompare(g.metadata.name);break;case"createdAt":h=u.metadata.createdAt.localeCompare(g.metadata.createdAt);break;case"updatedAt":h=u.metadata.updatedAt.localeCompare(g.metadata.updatedAt);break;case"usageCount":h=u.metadata.usageCount-g.metadata.usageCount;break}return s==="desc"?-h:h});const l=a.length,c=t.offset??0,d=t.limit??20;return a=a.slice(c,c+d),{items:a,totalCount:l,hasMore:c+a.length<l}}getRecent(t=10){return this.search({sortBy:"updatedAt",sortOrder:"desc",limit:t}).items}getFavorites(){return[...Array.from(this.slides.values()),...Array.from(this.elements.values()),...Array.from(this.templates.values())].filter(a=>a.metadata.isFavorite)}toggleFavorite(t){const a=this.slides.get(t)??this.elements.get(t)??this.templates.get(t);return a?(a.metadata.isFavorite=!a.metadata.isFavorite,!0):!1}generateId(){return`lib_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}cloneSlide(t){return JSON.parse(JSON.stringify(t))}applyPlaceholderValues(t,a,i){for(const r of a){const s=i[r.id];if(s===void 0)continue;const l=t.elements.find(c=>c.id===r.elementId);if(l)switch(r.type){case"text":l.type==="text"&&l.content&&(l.content.text=String(s));break;case"image":l.type==="image"&&l.content&&(l.content.src=String(s));break;case"chart-data":l.type==="chart"&&l.content&&(l.content.data=s);break;case"table-data":l.type==="table"&&l.content&&(l.content.rows=s);break}}}applyTemplateVariables(t,a,i){const r={};for(const s of a){const l=i[s.name]??s.defaultValue;l!==void 0&&(r[`{{${s.name}}}`]=String(l))}for(const s of t)for(const l of s.elements)if(l.type==="text"&&l.content){let c=l.content.text;for(const[d,u]of Object.entries(r))c=c.replace(new RegExp(d.replace(/[{}]/g,"\\$&"),"g"),u);l.content.text=c}}updateCollectionCounts(){for(const a of this.collections.values())a.itemCount=0;const t=[...Array.from(this.slides.values()),...Array.from(this.elements.values()),...Array.from(this.templates.values())];for(const a of t)for(const i of a.metadata.collectionIds??[]){const r=this.collections.get(i);r&&r.itemCount++}}exportLibrary(){return JSON.stringify({slides:Array.from(this.slides.values()),elements:Array.from(this.elements.values()),templates:Array.from(this.templates.values()),collections:Array.from(this.collections.values())})}importLibrary(t){const a=JSON.parse(t);this.slides=new Map(a.slides.map(i=>[i.metadata.id,i])),this.elements=new Map(a.elements.map(i=>[i.metadata.id,i])),this.templates=new Map(a.templates.map(i=>[i.metadata.id,i])),this.collections=new Map(a.collections.map(i=>[i.id,i]))}}function ao(e){const t=e.data;if(typeof t=="string")return t;switch(t.type){case"url":return t.url;case"email":return`mailto:${t.to}${t.subject||t.body?"?":""}${t.subject?`subject=${encodeURIComponent(t.subject)}`:""}${t.subject&&t.body?"&":""}${t.body?`body=${encodeURIComponent(t.body)}`:""}`;case"phone":return`tel:${t.number}`;case"sms":return`sms:${t.number}${t.message?`?body=${encodeURIComponent(t.message)}`:""}`;case"vcard":return xg(t);case"wifi":return`WIFI:T:${t.encryption};S:${t.ssid};P:${t.password??""};H:${t.hidden?"true":"false"};;`;case"geo":return`geo:${t.latitude},${t.longitude}${t.altitude?`,${t.altitude}`:""}${t.label?`?q=${encodeURIComponent(t.label)}`:""}`;case"calendar":return vg(t);case"presentation-link":return wg(t);case"feedback-form":return`${kn()}/feedback/${t.formId}?p=${t.presentationId}`;case"poll":return`${kn()}/poll/${t.pollId}`;default:return String(t)}}function xg(e){const t=["BEGIN:VCARD","VERSION:3.0",`N:${e.lastName};${e.firstName};;;`,`FN:${e.firstName} ${e.lastName}`];if(e.organization&&t.push(`ORG:${e.organization}`),e.title&&t.push(`TITLE:${e.title}`),e.email&&t.push(`EMAIL:${e.email}`),e.phone&&t.push(`TEL;TYPE=WORK:${e.phone}`),e.mobile&&t.push(`TEL;TYPE=CELL:${e.mobile}`),e.website&&t.push(`URL:${e.website}`),e.note&&t.push(`NOTE:${e.note}`),e.address){const a=e.address;t.push(`ADR;TYPE=WORK:;;${a.street??""};${a.city??""};${a.state??""};${a.postalCode??""};${a.country??""}`)}return t.push("END:VCARD"),t.join(`
1400
+ `)}function vg(e){const t=(i,r)=>{const s=new Date(i);return r?s.toISOString().replace(/[-:]/g,"").split("T")[0]:s.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"")},a=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",`DTSTART${e.allDay?";VALUE=DATE":""}:${t(e.startDate,e.allDay)}`,`DTEND${e.allDay?";VALUE=DATE":""}:${t(e.endDate,e.allDay)}`,`SUMMARY:${e.title}`];return e.description&&a.push(`DESCRIPTION:${e.description}`),e.location&&a.push(`LOCATION:${e.location}`),a.push("END:VEVENT","END:VCALENDAR"),a.join(`
1401
+ `)}function wg(e){const t=`${kn()}/present/${e.presentationId}`,a=new URLSearchParams;e.slideIndex!==void 0&&a.set("slide",String(e.slideIndex)),e.accessCode&&a.set("code",e.accessCode),e.allowDownload&&a.set("download","1");const i=a.toString();return i?`${t}?${i}`:t}function kn(){return typeof window<"u"?window.location.origin:"https://app.nice2dev.com"}function kg(e){const t=e.qrCodes.map(a=>({id:a.id,dataUrl:"",rawData:ao(a),size:a.size??256,config:{...a,errorCorrection:a.errorCorrection??"M",style:{foregroundColor:"#000000",backgroundColor:"#ffffff",cornerSquareStyle:"square",dotStyle:"square",...a.style}}}));return{id:e.id,type:"qrcode",title:e.title,subtitle:e.subtitle,config:{...e,layout:e.layout??"single",showLabels:e.showLabels??!0,animate:e.animate??!0},qrCodes:t}}function Sg(e,t){return{id:"presentation-link-slide",title:(t==null?void 0:t.title)??"Join the Presentation",subtitle:"Scan to follow along on your device",layout:"single",qrCodes:[{id:"presentation-qr",type:"presentation-link",data:{type:"presentation-link",presentationId:e,accessCode:t==null?void 0:t.accessCode,expiresAt:t!=null&&t.expiresIn?new Date(Date.now()+t.expiresIn*60*60*1e3).toISOString():void 0},label:"Open Presentation",size:400,style:{cornerSquareStyle:"rounded",dotStyle:"rounded",frame:{style:"banner",text:"Scan Me",color:"#1976d2",textColor:"#ffffff"}}}],callToAction:"Scan the QR code to view on your device",showLabels:!0,animate:!0}}function Cg(e,t){return{id:"feedback-slide",title:"We Value Your Feedback",subtitle:"Help us improve",layout:"single",qrCodes:[{id:"feedback-qr",type:"feedback-form",data:{type:"feedback-form",formId:`feedback_${Date.now()}`,presentationId:e,questions:t??[{id:"q1",type:"rating",question:"How would you rate this presentation?",required:!0},{id:"q2",type:"text",question:"What did you find most valuable?",required:!1},{id:"q3",type:"text",question:"Any suggestions for improvement?",required:!1}],anonymous:!0},label:"Share Feedback",size:350,style:{foregroundColor:"#2e7d32",cornerSquareStyle:"rounded",dotStyle:"classy-rounded"}}],callToAction:"Your feedback helps us improve!",instructions:"Scan the code and answer a few quick questions",showLabels:!0}}function _g(e,t,a){const i=`poll_${Date.now()}`;return{id:"poll-slide",title:"Live Poll",subtitle:e,layout:"single",qrCodes:[{id:"poll-qr",type:"poll",data:{type:"poll",pollId:i,question:e,options:t,allowMultiple:(a==null?void 0:a.allowMultiple)??!1,showResults:(a==null?void 0:a.showResults)??!0,closesAt:a!=null&&a.closesIn?new Date(Date.now()+a.closesIn*60*1e3).toISOString():void 0},label:"Vote Now",size:350,style:{foregroundColor:"#7b1fa2",cornerSquareStyle:"dot",dotStyle:"dots"}}],callToAction:"Cast your vote!",instructions:"Scan to participate in the poll",showLabels:!0,animate:!0}}function jg(e){return{id:"contact-slide",title:"Connect With Me",subtitle:`${e.firstName} ${e.lastName}`,layout:"single",qrCodes:[{id:"contact-qr",type:"vcard",data:{type:"vcard",...e},label:"Save Contact",size:350,style:{cornerSquareStyle:"rounded",dotStyle:"rounded",frame:{style:"rounded",text:"Add to Contacts",color:"#424242",textColor:"#ffffff"}}}],callToAction:"Scan to save my contact information",showLabels:!0}}function Ng(e,t,a="WPA"){return{id:"wifi-slide",title:"WiFi Network",subtitle:e,layout:"single",qrCodes:[{id:"wifi-qr",type:"wifi",data:{type:"wifi",ssid:e,password:t,encryption:a},label:"Connect to WiFi",size:300,style:{foregroundColor:"#0288d1",cornerSquareStyle:"rounded",dotStyle:"rounded"}}],callToAction:"Scan to connect automatically",showLabels:!0}}function Mg(e){return{id:"multi-qr-slide",title:"Resources & Links",layout:e.length<=2?"side-by-side":"grid",qrCodes:e.map((t,a)=>({id:`qr-${a}`,type:"url",data:t.url,label:t.label,size:e.length<=2?250:180,style:{foregroundColor:t.color??"#000000",cornerSquareStyle:"rounded",dotStyle:"rounded"}})),showLabels:!0,animate:!0}}const Ka=["#FF6B6B","#4ECDC4","#45B7D1","#96CEB4","#FFEAA7","#DDA0DD","#98D8C8","#F7DC6F","#BB8FCE","#85C1E9"];function $g(e){return Ka[e%Ka.length]}function io(e,t){const a=e.toArray();return{version:"1.0",id:t.get("id")||Date.now().toString(),title:t.get("title")||"Untitled",author:t.get("author"),slideSize:t.get("slideSize")??{width:1920,height:1080},slides:a,theme:t.get("theme")??{backgroundColor:"#1a1a2e",textColor:"#ffffff",accentColor:"#4ECDC4",fontHeading:"Inter",fontBody:"Inter"},speakerSettings:t.get("speakerSettings"),metadata:t.get("metadata")??{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}}}function Sn(e,t,a,i){i.transact(()=>{t.length>0&&t.delete(0,t.length),t.push(e.slides),a.set("id",e.id),a.set("version",e.version),a.set("title",e.title),a.set("author",e.author),a.set("slideSize",e.slideSize),a.set("theme",e.theme),a.set("speakerSettings",e.speakerSettings),a.set("metadata",{...e.metadata,updatedAt:new Date().toISOString()})})}function Eg(e){const{provider:t,user:a,initialDocument:i,onSync:r,onUserJoin:s,onUserLeave:l,onConnectionChange:c,createYDoc:d,createProvider:u,createUndoManager:g}=e,h=o.useRef(null),p=o.useRef(null),m=o.useRef(null),[k,b]=o.useState({document:i||null,collaborators:[],collaboratorSlides:new Map,collaboratorEditing:new Map,cursors:new Map,selections:new Map,isConnected:!1,isSynced:!1,localUser:a,undoManager:null});o.useEffect(()=>{var K,H;if(!d)return;const R=d();h.current=R;const T=R.getArray("slides"),B=R.getMap("meta");if(i&&Sn(i,T,B,R),g){const q=g(R,[T,B]);m.current=q,b(Z=>({...Z,undoManager:q}))}const V=()=>{const q=io(T,B);b(Z=>({...Z,document:q})),r==null||r(q)};if(R.on("update",V),t&&u){const q=u(R,t);p.current=q,q.on("sync",J=>{b(ee=>({...ee,isSynced:J})),J&&V()}),q.on("connection-error",()=>{b(J=>({...J,isConnected:!1})),c==null||c(!1)}),q.on("connection-close",()=>{b(J=>({...J,isConnected:!1})),c==null||c(!1)});const Z=q.awareness;Z.setLocalState({user:a,currentSlideId:(H=(K=i==null?void 0:i.slides)==null?void 0:K[0])==null?void 0:H.id});const Q=J=>{const ee=Z.getStates(),ie=[],pe=new Map,te=new Map,ue=new Map,fe=new Map;ee.forEach((ae,he)=>{if(he===Z.clientID||!(ae!=null&&ae.user))return;const Y={id:ae.user.id,name:ae.user.name,color:ae.user.color||$g(ie.length),avatar:ae.user.avatar};ie.push(Y),ae.currentSlideId&&pe.set(Y.id,ae.currentSlideId),ae.editingElementId!==void 0&&te.set(Y.id,ae.editingElementId),ae.cursor&&ue.set(Y.id,{x:ae.cursor.x,y:ae.cursor.y}),ae.selection&&fe.set(Y.id,ae.selection)}),b(ae=>({...ae,collaborators:ie,collaboratorSlides:pe,collaboratorEditing:te,cursors:ue,selections:fe,isConnected:q.connected}));for(const ae of J.added){const he=ee.get(ae);he!=null&&he.user&&(s==null||s(he.user))}for(const ae of J.removed)l==null||l({id:String(ae),name:"",color:""})};Z.on("change",Q),q.connect(),b(J=>({...J,isConnected:q.connected})),c==null||c(q.connected)}return()=>{var q,Z;R.off("update",V),(q=p.current)==null||q.destroy(),(Z=h.current)==null||Z.destroy(),m.current=null,h.current=null,p.current=null}},[]);const C=o.useCallback((R,T)=>{const B=h.current;if(!B)return;const V=B.getArray("slides");B.transact(()=>{T!==void 0&&T<V.length?V.insert(T,[R]):V.push([R])})},[]),_=o.useCallback((R,T)=>{const B=h.current;if(!B)return;const V=B.getArray("slides");B.transact(()=>{const K=V.toArray(),H=K.findIndex(Z=>Z.id===R);if(H===-1)return;const q={...K[H],...T};V.delete(H,1),V.insert(H,[q])})},[]),f=o.useCallback(R=>{const T=h.current;if(!T)return;const B=T.getArray("slides");T.transact(()=>{const K=B.toArray().findIndex(H=>H.id===R);K!==-1&&B.delete(K,1)})},[]),v=o.useCallback(R=>{const T=h.current;if(!T)return;const B=T.getArray("slides");T.transact(()=>{const V=B.toArray(),K=R.map(H=>V.find(q=>q.id===H)).filter(Boolean);K.length===V.length&&(B.delete(0,B.length),B.push(K))})},[]),j=o.useCallback((R,T)=>{const B=h.current;if(!B)return;const V=B.getArray("slides");B.transact(()=>{const K=V.toArray(),H=K.findIndex(Q=>Q.id===R);if(H===-1)return;const q=K[H],Z={...q,elements:[...q.elements,T]};V.delete(H,1),V.insert(H,[Z])})},[]),S=o.useCallback((R,T,B)=>{const V=h.current;if(!V)return;const K=V.getArray("slides");V.transact(()=>{const H=K.toArray(),q=H.findIndex(ee=>ee.id===R);if(q===-1)return;const Z=H[q],Q=Z.elements.map(ee=>ee.id===T?{...ee,...B}:ee),J={...Z,elements:Q};K.delete(q,1),K.insert(q,[J])})},[]),I=o.useCallback((R,T)=>{const B=h.current;if(!B)return;const V=B.getArray("slides");B.transact(()=>{const K=V.toArray(),H=K.findIndex(Q=>Q.id===R);if(H===-1)return;const q=K[H],Z={...q,elements:q.elements.filter(Q=>Q.id!==T)};V.delete(H,1),V.insert(H,[Z])})},[]),M=o.useCallback(R=>{const T=h.current;if(!T)return;const B=T.getMap("meta");T.transact(()=>{const V=B.get("theme")||{};B.set("theme",{...V,...R})})},[]),w=o.useCallback(R=>{const T=h.current;if(!T)return;const B=T.getMap("meta");T.transact(()=>{const V=B.get("metadata")||{};B.set("metadata",{...V,...R,updatedAt:new Date().toISOString()})})},[]),E=o.useCallback(R=>{const T=h.current;if(!T)return;const B=T.getMap("meta");T.transact(()=>{B.set("title",R)})},[]),P=o.useCallback(R=>{var T;(T=p.current)==null||T.awareness.setLocalStateField("currentSlideId",R)},[]),L=o.useCallback(R=>{var T;(T=p.current)==null||T.awareness.setLocalStateField("editingElementId",R)},[]),A=o.useCallback(R=>{var T,B;R?(T=p.current)==null||T.awareness.setLocalStateField("cursor",{...R,timestamp:Date.now()}):(B=p.current)==null||B.awareness.setLocalStateField("cursor",null)},[]),N=o.useCallback(R=>{var T;(T=p.current)==null||T.awareness.setLocalStateField("selection",R)},[]),x=o.useCallback(()=>{var R;(R=m.current)==null||R.undo()},[]),O=o.useCallback(()=>{var R;(R=m.current)==null||R.redo()},[]),D=o.useCallback(()=>{var R;(R=p.current)==null||R.connect()},[]),F=o.useCallback(()=>{var R;(R=p.current)==null||R.disconnect()},[]),y=o.useCallback(R=>{const T=h.current;if(!T){b(K=>({...K,document:R}));return}const B=T.getArray("slides"),V=T.getMap("meta");Sn(R,B,V,T)},[]),$=o.useCallback(()=>k.document,[k.document]);return{state:k,actions:{addSlide:C,updateSlide:_,deleteSlide:f,reorderSlides:v,addElement:j,updateElement:S,deleteElement:I,updateTheme:M,updateMetadata:w,setTitle:E,setCurrentSlide:P,setEditingElement:L,setCursor:A,setSelection:N,undo:x,redo:O,connect:D,disconnect:F,setDocument:y,getDocument:$}}}exports.$i=Un;exports.$o=ri;exports.Ae=bt;exports.An=Rn;exports.BRAND_KIT_CORPORATE=Xh;exports.BRAND_KIT_NICE2DEV=Gh;exports.BRAND_KIT_STARTUP=Qh;exports.BUILT_IN_TRANSITIONS=Ir;exports.BackgroundRenderer=Pr;exports.CharacterRegistry=ua;exports.DEFAULT_KPI_COLORS=eo;exports.De=gt;exports.Di=Xn;exports.DialogueBox=Or;exports.Dn=on;exports.EffectRenderer=Br;exports.Ei=Gn;exports.En=Tn;exports.Es=Ro;exports.Fe=ve;exports.Ht=Nn;exports.Ii=Qn;exports.InteractiveButton=Fm;exports.InteractiveCountdown=Rm;exports.InteractivePoll=Dm;exports.InteractiveQnA=Pm;exports.InteractiveQuiz=Tm;exports.Je=zn;exports.Ke=Ja;exports.Lo=ii;exports.Mi=Yn;exports.Ms=Ho;exports.Mt=bi;exports.NiceI18nProvider=Ga;exports.NicePresentationEditor=mr;exports.NicePresentationPlayer=gr;exports.PresentationModel=nn;exports.PresentationToolbar=ca;exports.PresentationVersionManager=yg;exports.PuppetAnimationController=Rr;exports.PuppetCharacter=ef;exports.PuppetSceneBuilder=mf;exports.PuppetShowMiniPlayer=Sf;exports.PuppetShowPlayer=Ur;exports.PuppetStage=Lr;exports.Qa=wi;exports.Qi=ds;exports.Qi$1=ea;exports.Re=ht;exports.SLIDE_16_9=Fu;exports.SLIDE_4_3=Iu;exports.SLIDE_WIDESCREEN=Du;exports.SlideCanvas=ft;exports.SlideLibraryManager=bg;exports.SlidePropertyPanel=da;exports.SlideThumbnailList=la;exports.THEME_CORPORATE=fr;exports.THEME_MINIMAL=Ru;exports.THEME_MODERN_DARK=Tu;exports.THEME_NICE2DEV=Pu;exports.TRANSITION_BLUR_FADE=Mr;exports.TRANSITION_CIRCLE_REVEAL=zr;exports.TRANSITION_CUBE_LEFT=jr;exports.TRANSITION_FADE=yr;exports.TRANSITION_FLIP_HORIZONTAL=Cr;exports.TRANSITION_FLIP_VERTICAL=_r;exports.TRANSITION_GLITCH=Ar;exports.TRANSITION_MORPH=Fr;exports.TRANSITION_ROTATE_IN=Nr;exports.TRANSITION_SLIDE_DOWN=wr;exports.TRANSITION_SLIDE_LEFT=br;exports.TRANSITION_SLIDE_RIGHT=xr;exports.TRANSITION_SLIDE_UP=vr;exports.TRANSITION_WIPE_LEFT=$r;exports.TRANSITION_WIPE_RIGHT=Er;exports.TRANSITION_ZOOM_IN=kr;exports.TRANSITION_ZOOM_OUT=Sr;exports.Ti=Zn;exports.TimelineEngine=Wr;exports.TimelineTrackBuilder=pf;exports.Ve=Bt;exports.Vn=Ln;exports.We=In;exports.Zn=On;exports._t=gi;exports.addAnimationToCharacter=rf;exports.addExpressionToCharacter=of;exports.ao=Ii;exports.applyBrandKit=Uh;exports.applyEasing=Wm;exports.applyFiltersToData=tg;exports.applySortToData=eg;exports.at=Fn;exports.brandKitToTheme=Tr;exports.bt=hi;exports.ca=ia;exports.calculateSummaryRow=ng;exports.cl=qe;exports.cloneTimeline=hf;exports.cn=sn;exports.computeCustomTransitionState=Om;exports.computeElementState=zu;exports.computeKPIStatus=qf;exports.computeTransitionState=hr;exports.computeTrend=Vf;exports.createCharacterFromSpriteSheet=af;exports.createComparisonWidget=Gf;exports.createContactSlide=jg;exports.createCustomTransition=qm;exports.createCustomerCountWidget=no;exports.createDashboardSlide=Wf;exports.createDataGridSlide=Jf;exports.createEmployeeDataGrid=og;exports.createExecutiveDashboard=Xf;exports.createFeedbackSlide=Cg;exports.createKQLQuerySlide=gg;exports.createMultiQRSlide=Mg;exports.createODataQuerySlide=fg;exports.createOperationalDashboard=Qf;exports.createPercentageGauge=Uf;exports.createPollSlide=_g;exports.createPresentationLinkSlide=Sg;exports.createQRCodeSlide=kg;exports.createQuerySlide=sg;exports.createRevenueWidget=to;exports.createSalesDataGrid=rg;exports.createSalesQuerySlide=hg;exports.createSampleArchitectureData=Nh;exports.createSampleIncidentReportData=Kh;exports.createSampleOnboardingData=Dh;exports.createSampleProductPitchData=uh;exports.createSampleQuarterlyReportData=nh;exports.createSampleSprintReviewData=xh;exports.createSparklineTrend=Yf;exports.createSpriteSheetFromFrames=Nf;exports.createTrafficLight=Zf;exports.createWiFiSlide=Ng;exports.de=Se;exports.detectBestVisualization=pg;exports.ea=ta;exports.easingFunctions=kt;exports.ei=$e;exports.encodeQRContent=ao;exports.eo=Ei;exports.exportCharacterToEntity=jf;exports.exportCharacterToSprite=Xr;exports.exportToHtml=pr;exports.extractQueryParameters=lg;exports.fi=qn;exports.fl=Dc;exports.formatCellValue=ag;exports.formatKPIValue=Kf;exports.formatTime=bf;exports.framesToTime=yf;exports.generateArchitectureOverview=jh;exports.generateChartConfig=mg;exports.generateIncidentReport=Vh;exports.generateOnboarding=Ih;exports.generateProductPitch=dh;exports.generateQuarterlyReport=th;exports.generateSprintReview=bh;exports.getConditionalStyle=ig;exports.getEasingFunction=Hr;exports.getSceneDuration=ff;exports.getTrackDuration=qr;exports.gi=Go;exports.gt=ui;exports.hi=Wn;exports.ie=mt;exports.ii=Hn;exports.importAssetAsProp=Gr;exports.importEntityAsCharacter=Zr;exports.importProjectCharacters=Cf;exports.importProjectProps=_f;exports.importSpriteAsCharacter=Yr;exports.io=Fi;exports.ki=Vn;exports.ki$1=Qo;exports.le=dr;exports.lerp=rt;exports.lerpPosition=wn;exports.ll=Ge;exports.mapTransitionEffectToId=Hm;exports.mergePuppetShows=Hf;exports.mt=di;exports.no=Ai;exports.oa=aa;exports.oo=Di;exports.ot=Dn;exports.parseNdpJson=Nu;exports.parseSpriteSheetGrid=Mf;exports.parseTime=xf;exports.pi=Yo;exports.presentationToPuppetShow=Bf;exports.puppetShowToPresentation=Ef;exports.qe=En;exports.qr=Oo;exports.removeBrandKit=Yh;exports.renderCharacterToCanvas=Jh;exports.renderChartSvg=Ya;exports.rl=fs;exports.sa=ra;exports.se=cr;exports.sn=ln;exports.stringifyNdpJson=ur;exports.substituteParameters=cg;exports.syncPresentationToYjs=Sn;exports.syncYjsToPresentation=io;exports.ta=na;exports.timeToFrames=gf;exports.tl=hs;exports.to=zi;exports.transitionRegistry=Dr;exports.transitionToKeyframes=Vm;exports.tt=An;exports.ue=et;exports.useCameraShake=uf;exports.useCharacterRegistry=nf;exports.useCollaborativePresentation=Eg;exports.useNiceTranslation=an;exports.usePresentationEditor=Ua;exports.usePuppetAnimation=tf;exports.usePuppetPlayer=vf;exports.usePuppetShowPlayer=Kr;exports.usePuppetStage=lf;exports.validateParameters=ug;exports.validateProjectForImport=$f;exports.validatePuppetShowDocument=Of;exports.vs=ot;exports.vt=fi;exports.wa=sa;exports.ws=mo;exports.wt=yi;exports.xi=Kn;exports.xt=pi;exports.ys=ke;exports.yt=mi;exports.ze=Lt;