@nice2dev/ui-diagrams 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.
- package/dist/NiceSavedQueryPanel-CUAsdOjJ-CSZLnNPf.cjs +596 -0
- package/dist/NiceSavedQueryPanel-CUAsdOjJ-DTz1kPLr.js +6078 -0
- package/dist/NiceSavedQueryPanel-DUw8plYP-B8ZfDGaR.cjs +596 -0
- package/dist/NiceSavedQueryPanel-DUw8plYP-CAQV8eYE.js +5568 -0
- package/dist/NiceStockChart-Cpmv9_Cc-CLoIAI1L.cjs +287 -0
- package/dist/NiceStockChart-Cpmv9_Cc-I6rQ6rNU.js +2246 -0
- package/dist/index-B5y4azp8.cjs +1257 -0
- package/dist/index-CIl98Vbm-B1-8VqB_.js +46639 -0
- package/dist/index-CIl98Vbm-Uj4gSRsL.cjs +4993 -0
- package/dist/index-CNwVELPJ-BC-pDqbh.cjs +5243 -0
- package/dist/index-CNwVELPJ-Bc5jJdv3.js +37303 -0
- package/dist/index-D8CoTxGO.js +36732 -0
- package/dist/index-DdOXScZS.js +30597 -0
- package/dist/index-Gq4eeeO7.cjs +719 -0
- package/dist/index.cjs +1 -6842
- package/dist/index.mjs +88 -74558
- package/package.json +1 -1
|
@@ -0,0 +1,719 @@
|
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),s=require("react");class na{constructor(e){this.undoStack=[],this.redoStack=[],this.listeners=new Set,this.maxHistory=100,this.doc=e??na.createEmpty()}static createEmpty(e="flowchart"){const r=new Date().toISOString();return{version:"1.0",id:St(),title:"Untitled Diagram",diagramType:e,nodes:[],edges:[],groups:[],animations:[],viewport:{x:0,y:0,zoom:1},metadata:{createdAt:r,updatedAt:r}}}getDocument(){return this.doc}getNodes(){return this.doc.nodes}getEdges(){return this.doc.edges}getGroups(){return this.doc.groups}getAnimations(){return this.doc.animations}getNodeById(e){return this.doc.nodes.find(r=>r.id===e)}getEdgeById(e){return this.doc.edges.find(r=>r.id===e)}getViewport(){return{...this.doc.viewport}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notify(){this.doc.metadata.updatedAt=new Date().toISOString(),this.listeners.forEach(e=>e())}pushUndo(e){this.undoStack.push({label:e,snapshot:JSON.stringify(this.doc)}),this.undoStack.length>this.maxHistory&&this.undoStack.shift(),this.redoStack=[]}undo(){const e=this.undoStack.pop();return e?(this.redoStack.push({label:"redo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(e.snapshot),this.notify(),!0):!1}redo(){const e=this.redoStack.pop();return e?(this.undoStack.push({label:"undo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(e.snapshot),this.notify(),!0):!1}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}addNode(e,r,i="roundedRect",n={width:160,height:60}){this.pushUndo("Add node");const o=Sn(),c={id:St(),label:e,position:r,size:n,shape:i,style:{},ports:o};return this.doc.nodes.push(c),this.notify(),c}updateNode(e,r){this.pushUndo("Update node");const i=this.doc.nodes.find(n=>n.id===e);i&&Object.assign(i,r),this.notify()}moveNode(e,r){const i=this.doc.nodes.find(n=>n.id===e);i&&(this.pushUndo("Move node"),i.position=r,this.notify())}resizeNode(e,r){const i=this.doc.nodes.find(n=>n.id===e);i&&(this.pushUndo("Resize node"),i.size=r,this.notify())}removeNode(e){this.pushUndo("Remove node"),this.doc.nodes=this.doc.nodes.filter(r=>r.id!==e),this.doc.edges=this.doc.edges.filter(r=>r.sourceNodeId!==e&&r.targetNodeId!==e),this.doc.groups.forEach(r=>{r.nodeIds=r.nodeIds.filter(i=>i!==e)}),this.doc.animations=this.doc.animations.filter(r=>r.targetId!==e),this.notify()}addEdge(e,r,i,n,o){if(e===i||!this.getNodeById(e)||!this.getNodeById(i))return null;this.pushUndo("Add edge");const c={id:St(),sourceNodeId:e,sourcePortId:r,targetNodeId:i,targetPortId:n,label:o,style:{lineType:"bezier",targetArrow:"arrow"}};return this.doc.edges.push(c),this.notify(),c}updateEdge(e,r){this.pushUndo("Update edge");const i=this.doc.edges.find(n=>n.id===e);i&&Object.assign(i,r),this.notify()}removeEdge(e){this.pushUndo("Remove edge"),this.doc.edges=this.doc.edges.filter(r=>r.id!==e),this.doc.animations=this.doc.animations.filter(r=>r.targetId!==e),this.notify()}createGroup(e,r){this.pushUndo("Create group");const i={id:St(),label:e,nodeIds:[...r]};return r.forEach(n=>{const o=this.doc.nodes.find(c=>c.id===n);o&&(o.groupId=i.id)}),this.doc.groups.push(i),this.notify(),i}removeGroup(e){this.pushUndo("Remove group");const r=this.doc.groups.find(i=>i.id===e);r&&r.nodeIds.forEach(i=>{const n=this.doc.nodes.find(o=>o.id===i);n&&(n.groupId=void 0)}),this.doc.groups=this.doc.groups.filter(i=>i.id!==e),this.notify()}addAnimation(e){this.pushUndo("Add animation");const r={id:St(),...e};return this.doc.animations.push(r),this.notify(),r}removeAnimation(e){this.pushUndo("Remove animation"),this.doc.animations=this.doc.animations.filter(r=>r.id!==e),this.notify()}setViewport(e){this.doc.viewport={...e},this.notify()}toggleGroupCollapse(e){const r=this.doc.groups.find(i=>i.id===e);r&&(this.pushUndo("Toggle group collapse"),r.collapsed=!r.collapsed,r.nodeIds.forEach(i=>{const n=this.doc.nodes.find(o=>o.id===i);n&&(n.hidden=r.collapsed)}),this.notify())}toggleNodeCollapse(e){const r=this.doc.nodes.find(i=>i.id===e);r&&(this.pushUndo("Toggle node collapse"),r.collapsed=!r.collapsed,(r.childNodeIds??[]).forEach(i=>{const n=this.doc.nodes.find(o=>o.id===i);n&&(n.hidden=r.collapsed)}),this.notify())}getAnimationModes(){return this.doc.animationModes??[]}getActiveAnimationMode(){var e;if((e=this.doc.animationModes)!=null&&e.length)return this.doc.animationModes.find(r=>r.id===this.doc.activeAnimationModeId)??this.doc.animationModes.find(r=>r.isDefault)??this.doc.animationModes[0]}addAnimationMode(e,r){this.pushUndo("Add animation mode"),this.doc.animationModes||(this.doc.animationModes=[]);const i={id:St(),name:e,animations:r??[],isDefault:this.doc.animationModes.length===0};return this.doc.animationModes.push(i),i.isDefault&&(this.doc.activeAnimationModeId=i.id),this.notify(),i}removeAnimationMode(e){var r;this.doc.animationModes&&(this.pushUndo("Remove animation mode"),this.doc.animationModes=this.doc.animationModes.filter(i=>i.id!==e),this.doc.activeAnimationModeId===e&&(this.doc.activeAnimationModeId=(r=this.doc.animationModes[0])==null?void 0:r.id),this.notify())}setActiveAnimationMode(e){var r;(r=this.doc.animationModes)!=null&&r.find(i=>i.id===e)&&(this.doc.activeAnimationModeId=e,this.notify())}addAnimationToMode(e,r){var o;const i=(o=this.doc.animationModes)==null?void 0:o.find(c=>c.id===e);if(!i)return null;this.pushUndo("Add animation to mode");const n={id:St(),...r};return i.animations.push(n),this.notify(),n}removeAnimationFromMode(e,r){var n;const i=(n=this.doc.animationModes)==null?void 0:n.find(o=>o.id===e);i&&(this.pushUndo("Remove animation from mode"),i.animations=i.animations.filter(o=>o.id!==r),this.notify())}setStylePreset(e){this.pushUndo("Set style preset"),this.doc.stylePresetId=e,this.notify()}setStyleOverrides(e){this.pushUndo("Set style overrides"),this.doc.styleOverrides=e,this.notify()}getPlayerConfig(){return this.doc.playerConfig??{mode:"editor",interactionsEnabled:!0,showModeSwitcher:!0,showPlaybackControls:!0,autoPlay:!1,showGhostElements:!0,ghostOpacity:.15,ghostCursorStyle:"pointer"}}setPlayerConfig(e){this.pushUndo("Update player config"),this.doc.playerConfig={...this.getPlayerConfig(),...e},this.notify()}setViewMode(e){const r=this.getPlayerConfig();r.mode=e,this.doc.playerConfig=r,this.notify()}updateAnimation(e,r){this.pushUndo("Update animation");const i=this.doc.animations.find(n=>n.id===e);i&&Object.assign(i,r),this.notify()}loadDocument(e){this.doc=structuredClone(e),this.undoStack=[],this.redoStack=[],this.notify()}}function St(){return`ndd_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function Sn(){return[{id:"top",side:"top",offset:.5},{id:"right",side:"right",offset:.5},{id:"bottom",side:"bottom",offset:.5},{id:"left",side:"left",offset:.5}]}function Kr(t,e,r){switch(r.algorithm){case"dagre":return Gr(t,e,r);case"grid":return jn(t,r);case"radial":return Nn(t,e);case"tree":return Mn(t,e,r);case"forceDirected":return zn(t,e,r);case"manual":default:return{positions:new Map(t.map(i=>[i.id,{...i.position}]))}}}function Gr(t,e,r){const i=r.direction??"TB",n=r.nodeSpacing??60,o=r.rankSpacing??100,c=new Map,l=new Map,d=new Set(t.map(w=>w.id));t.forEach(w=>{c.set(w.id,[]),l.set(w.id,[])}),e.forEach(w=>{d.has(w.sourceNodeId)&&d.has(w.targetNodeId)&&(c.get(w.sourceNodeId).push(w.targetNodeId),l.get(w.targetNodeId).push(w.sourceNodeId))});const p=t.filter(w=>{var k;return(((k=l.get(w.id))==null?void 0:k.length)??0)===0});p.length===0&&t.length>0&&p.push(t[0]);const f=new Map,u=[];for(p.forEach(w=>{f.set(w.id,0),u.push(w.id)});u.length>0;){const w=u.shift(),k=f.get(w)??0;for(const b of c.get(w)??[])f.has(b)||(f.set(b,k+1),u.push(b))}t.forEach(w=>{f.has(w.id)||f.set(w.id,0)});const y=new Map;t.forEach(w=>{const k=f.get(w.id)??0;y.has(k)||y.set(k,[]),y.get(k).push(w)});const h=new Map,m=i==="LR"||i==="RL",v=i==="BT"||i==="RL";return[...y.keys()].sort((w,k)=>w-k).forEach((w,k)=>{const b=y.get(w);let j=-(b.reduce((N,$)=>N+$.size.width,0)+(b.length-1)*n)/2;b.forEach(N=>{const $=k*(o+(m?N.size.width:N.size.height)),x=j+N.size.width/2;let F,I;m?(F=v?-$:$,I=x):(F=x,I=v?-$:$),h.set(N.id,{x:F,y:I}),j+=N.size.width+n})}),r.centerGraph&&ja(h),{positions:h}}function jn(t,e){const r=e.nodeSpacing??80,i=Math.ceil(Math.sqrt(t.length)),n=new Map;return t.forEach((o,c)=>{const l=c%i,d=Math.floor(c/i);n.set(o.id,{x:l*(o.size.width+r),y:d*(o.size.height+r)})}),e.centerGraph&&ja(n),{positions:n}}function Nn(t,e){const r=new Map;if(t.length===0)return{positions:r};const i=new Map;t.forEach(d=>i.set(d.id,0)),e.forEach(d=>{i.set(d.sourceNodeId,(i.get(d.sourceNodeId)??0)+1),i.set(d.targetNodeId,(i.get(d.targetNodeId)??0)+1)});const n=[...t].sort((d,p)=>(i.get(p.id)??0)-(i.get(d.id)??0)),o=n[0];r.set(o.id,{x:0,y:0});const c=n.slice(1),l=200+c.length*20;return c.forEach((d,p)=>{const f=2*Math.PI*p/c.length;r.set(d.id,{x:Math.cos(f)*l,y:Math.sin(f)*l})}),{positions:r}}function Mn(t,e,r){return Gr(t,e,{...r,direction:r.direction??"TB",nodeSpacing:r.nodeSpacing??40,rankSpacing:r.rankSpacing??80})}function zn(t,e,r){const i=new Map;if(t.length===0)return{positions:i};const n=400,o=new Map;t.forEach(u=>{o.set(u.id,{x:(Math.random()-.5)*n,y:(Math.random()-.5)*n})});const c=e.map(u=>({source:u.sourceNodeId,target:u.targetNodeId})),l=r.nodeSpacing??150,d=80,p=.95;let f=n/2;for(let u=0;u<d;u++){const y=new Map;t.forEach(h=>y.set(h.id,{fx:0,fy:0}));for(let h=0;h<t.length;h++)for(let m=h+1;m<t.length;m++){const v=o.get(t[h].id),D=o.get(t[m].id),w=D.x-v.x,k=D.y-v.y,b=Math.max(Math.sqrt(w*w+k*k),1),C=l*l/b,j=w/b*C,N=k/b*C;y.get(t[h].id).fx-=j,y.get(t[h].id).fy-=N,y.get(t[m].id).fx+=j,y.get(t[m].id).fy+=N}for(const h of c){const m=o.get(h.source),v=o.get(h.target);if(!m||!v)continue;const D=v.x-m.x,w=v.y-m.y,k=Math.max(Math.sqrt(D*D+w*w),1),b=k*k/l,C=D/k*b,j=w/k*b;y.get(h.source).fx+=C,y.get(h.source).fy+=j,y.get(h.target).fx-=C,y.get(h.target).fy-=j}t.forEach(h=>{const m=y.get(h.id),v=o.get(h.id),D=Math.sqrt(m.fx*m.fx+m.fy*m.fy);if(D>0){const w=Math.min(D,f);v.x+=m.fx/D*w,v.y+=m.fy/D*w}}),f*=p}return t.forEach(u=>{i.set(u.id,{...o.get(u.id)})}),r.centerGraph&&ja(i),{positions:i}}function ja(t){if(t.size===0)return;let e=1/0,r=1/0,i=-1/0,n=-1/0;t.forEach(l=>{e=Math.min(e,l.x),r=Math.min(r,l.y),i=Math.max(i,l.x),n=Math.max(n,l.y)});const o=(e+i)/2,c=(r+n)/2;t.forEach(l=>{l.x-=o,l.y-=c})}function Yr(t){const e=s.useRef(null);e.current||(e.current=new na(t));const r=e.current,[,i]=s.useState(0),n=s.useCallback(()=>i(l=>l+1),[]);s.useEffect(()=>r.subscribe(n),[r,n]);const o=r.getDocument(),c=s.useCallback(l=>{Kr(r.getNodes(),r.getEdges(),l).positions.forEach((p,f)=>{r.moveNode(f,p)})},[r]);return s.useMemo(()=>({document:o,nodes:o.nodes,edges:o.edges,groups:o.groups,animations:o.animations,viewport:o.viewport,addNode:(l,d,p,f)=>r.addNode(l,d,p,f),updateNode:(l,d)=>r.updateNode(l,d),moveNode:(l,d)=>r.moveNode(l,d),resizeNode:(l,d)=>r.resizeNode(l,d),removeNode:l=>r.removeNode(l),addEdge:(l,d,p,f,u)=>r.addEdge(l,d,p,f,u),updateEdge:(l,d)=>r.updateEdge(l,d),removeEdge:l=>r.removeEdge(l),createGroup:(l,d)=>r.createGroup(l,d),removeGroup:l=>r.removeGroup(l),toggleGroupCollapse:l=>r.toggleGroupCollapse(l),toggleNodeCollapse:l=>r.toggleNodeCollapse(l),addAnimation:l=>r.addAnimation(l),updateAnimation:(l,d)=>r.updateAnimation(l,d),removeAnimation:l=>r.removeAnimation(l),animationModes:r.getAnimationModes(),activeAnimationMode:r.getActiveAnimationMode(),addAnimationMode:(l,d)=>r.addAnimationMode(l,d),removeAnimationMode:l=>r.removeAnimationMode(l),setActiveAnimationMode:l=>r.setActiveAnimationMode(l),addAnimationToMode:(l,d)=>r.addAnimationToMode(l,d),removeAnimationFromMode:(l,d)=>r.removeAnimationFromMode(l,d),setStylePreset:l=>r.setStylePreset(l),setStyleOverrides:l=>r.setStyleOverrides(l),stylePresetId:o.stylePresetId,playerConfig:r.getPlayerConfig(),setPlayerConfig:l=>r.setPlayerConfig(l),setViewMode:l=>r.setViewMode(l),viewMode:r.getPlayerConfig().mode,applyLayout:c,setViewport:l=>r.setViewport(l),undo:()=>r.undo(),redo:()=>r.redo(),canUndo:r.canUndo(),canRedo:r.canRedo(),loadDocument:l=>r.loadDocument(l),model:r}),[o,r,c])}class Ur{constructor(e){this.liquidFlows=new Map,this.glowStates=new Map,this.particles=[],this.emitters=[],this.rafId=0,this.running=!1,this.lastTime=0,this.tick=()=>{if(!this.running)return;const r=performance.now(),i=Math.min((r-this.lastTime)/1e3,.1);this.lastTime=r;for(const[,n]of this.liquidFlows)if(n.active){n.gradientOffset=(n.gradientOffset+i*.5)%1;for(const o of n.particles)o.t=(o.t+i*.3)%1,o.offset+=(Math.random()-.5)*i*2,o.offset=Math.max(-4,Math.min(4,o.offset)),o.opacity=.3+Math.sin(o.t*Math.PI)*.5}for(const[,n]of this.glowStates)n.pulse=(n.pulse+i*2)%(Math.PI*2);this.particles=this.particles.filter(n=>(n.life-=i/n.maxLife,n.life<=0?!1:(n.x+=n.vx*i,n.y+=n.vy*i,n.opacity=Math.min(1,n.life*2),!0)));for(const n of this.emitters)for(n.accumulator=(n.accumulator??0)+i*n.rate;n.accumulator>=1;){n.accumulator-=1;const o=Math.random()*Math.PI*2,c=n.speed*(.5+Math.random());this.particles.push({x:n.position.x+(Math.random()-.5)*n.spread,y:n.position.y+(Math.random()-.5)*n.spread,vx:Math.cos(o)*c,vy:Math.sin(o)*c,life:1,maxLife:n.particleLife,size:n.particleSize*(.5+Math.random()),color:n.color,opacity:1})}this.onFrame(this.getState()),this.rafId=requestAnimationFrame(this.tick)},this.onFrame=e}startLiquidFlow(e,r){const i=[],n=r.particleDensity??3;for(let o=0;o<n;o++)i.push({t:Math.random(),offset:(Math.random()-.5)*(r.pipeWidth??6),size:1.5+Math.random()*2,opacity:.4+Math.random()*.5});this.liquidFlows.set(e,{edgeId:e,gradientOffset:0,fillProgress:r.progress??0,particles:i,active:!0}),this.running||this.start()}stopLiquidFlow(e){this.liquidFlows.delete(e),this.liquidFlows.size===0&&this.glowStates.size===0&&this.emitters.length===0&&this.stop()}setGlow(e,r,i){this.glowStates.set(e,{elementId:e,color:r,intensity:i,pulse:0}),this.running||this.start()}removeGlow(e){this.glowStates.delete(e)}addEmitter(e){return this.emitters.push(e),this.running||this.start(),e.id}removeEmitter(e){this.emitters=this.emitters.filter(r=>r.id!==e)}start(){this.running||(this.running=!0,this.lastTime=performance.now(),this.tick())}stop(){this.running=!1,this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0}destroy(){this.stop(),this.liquidFlows.clear(),this.glowStates.clear(),this.particles=[],this.emitters=[]}isRunning(){return this.running}getState(){return{liquidFlows:new Map(this.liquidFlows),glowStates:new Map(this.glowStates),particles:[...this.particles]}}}function $n(t,e,r){if(!r)return{x:0,y:0};const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d",t),r.appendChild(i);try{const n=i.getTotalLength(),o=i.getPointAtLength(e*n);return{x:o.x,y:o.y}}finally{r.removeChild(i)}}function Zr(t){return`nd-glow-${t.replace(/[^a-zA-Z0-9]/g,"_")}`}function Xr(t,e){const r=t*12,i=1+Math.sin(e)*.3;return r*i}const En=.1,An=5,Yt=8,ua=[{cursor:"nw-resize",dx:0,dy:0,resizeX:-1,resizeY:-1},{cursor:"n-resize",dx:.5,dy:0,resizeX:0,resizeY:-1},{cursor:"ne-resize",dx:1,dy:0,resizeX:1,resizeY:-1},{cursor:"w-resize",dx:0,dy:.5,resizeX:-1,resizeY:0},{cursor:"e-resize",dx:1,dy:.5,resizeX:1,resizeY:0},{cursor:"sw-resize",dx:0,dy:1,resizeX:-1,resizeY:1},{cursor:"s-resize",dx:.5,dy:1,resizeX:0,resizeY:1},{cursor:"se-resize",dx:1,dy:1,resizeX:1,resizeY:1}],lt=({nodes:t,edges:e,groups:r=[],viewport:i,onViewportChange:n,theme:o,selectedId:c,selectedIds:l=[],onSelectElement:d,onMultiSelect:p,onNodeDragStart:f,onNodeDrag:u,onNodeDragEnd:y,onNodeResize:h,onNodeLabelChange:m,animationStates:v,particleState:D,viewMode:w="editor",ghostOpacity:k=.15,onGroupCollapse:b,onNodeCollapse:C,onInteraction:j,interactive:N=!1,showGrid:$=!0,showRulers:x=!1,snapToGrid:F=!0,gridSnapSize:I=10,className:P})=>{const A=s.useRef(null),[E,M]=s.useState(!1),[W,z]=s.useState({x:0,y:0}),[T,g]=s.useState(null),[_,S]=s.useState({x:0,y:0}),[R,L]=s.useState(null),[O,Y]=s.useState(null),[G,B]=s.useState(null),[K,J]=s.useState(null),[he,pe]=s.useState(""),[we,se]=s.useState([]),Ce=(o==null?void 0:o.canvasBackground)??"#f8f9fa",ee=(o==null?void 0:o.gridColor)??"#e0e0e0",de=(o==null?void 0:o.gridSize)??20,xe=(o==null?void 0:o.selectionColor)??"#2196f3",$e=s.useMemo(()=>{const H=new Set(l);return c&&H.add(c),H},[c,l]),Ne=s.useCallback(H=>F?Math.round(H/I)*I:H,[F,I]),U=s.useCallback((H,ae,le)=>{const ce=[],ne=ae.x,V=ae.y,ue=ne+le.width/2,ge=V+le.height/2,ke=ne+le.width,_e=V+le.height;for(const Te of t){if(Te.id===H)continue;const Me=Te.position.x,Ie=Te.position.y,Oe=Me+Te.size.width/2,Ze=Ie+Te.size.height/2,Xe=Me+Te.size.width,et=Ie+Te.size.height;Math.abs(ne-Me)<5&&ce.push({x:Me}),Math.abs(ke-Xe)<5&&ce.push({x:Xe}),Math.abs(ue-Oe)<5&&ce.push({x:Oe}),Math.abs(ne-Xe)<5&&ce.push({x:Xe}),Math.abs(ke-Me)<5&&ce.push({x:Me}),Math.abs(V-Ie)<5&&ce.push({y:Ie}),Math.abs(_e-et)<5&&ce.push({y:et}),Math.abs(ge-Ze)<5&&ce.push({y:Ze}),Math.abs(V-et)<5&&ce.push({y:et}),Math.abs(_e-Ie)<5&&ce.push({y:Ie})}se(ce)},[t]),Z=s.useCallback(H=>{if(H.preventDefault(),!n)return;const ae=H.deltaY>0?.9:1.1,le=Math.min(An,Math.max(En,i.zoom*ae)),ce=A.current;if(!ce)return;const ye=ce.getBoundingClientRect(),ne=H.clientX-ye.left,V=H.clientY-ye.top,ue=le/i.zoom,ge=ne-(ne-i.x)*ue,ke=V-(V-i.y)*ue;n({x:ge,y:ke,zoom:le})},[i,n]),X=s.useCallback(H=>{if(H.button===1||H.button===0&&H.target.tagName==="svg"){if(H.button===0&&N&&!H.shiftKey&&H.target.tagName==="svg"){const ae=A.current;if(ae){const le=ae.getBoundingClientRect(),ce=(H.clientX-le.left-i.x)/i.zoom,ye=(H.clientY-le.top-i.y)/i.zoom;Y({x:ce,y:ye}),L({x1:ce,y1:ye,x2:ce,y2:ye})}d&&d(null),p&&p([]);return}M(!0),z({x:H.clientX-i.x,y:H.clientY-i.y}),d&&H.button===0&&d(null)}},[i,d,p,N]),Q=s.useCallback(H=>{if(O){const ae=A.current;if(!ae)return;const le=ae.getBoundingClientRect(),ce=(H.clientX-le.left-i.x)/i.zoom,ye=(H.clientY-le.top-i.y)/i.zoom;L({x1:O.x,y1:O.y,x2:ce,y2:ye});return}if(E&&n){n({...i,x:H.clientX-W.x,y:H.clientY-W.y});return}if(G&&h){const ae=A.current;if(!ae)return;const le=ae.getBoundingClientRect(),ce=(H.clientX-le.left-i.x)/i.zoom,ye=(H.clientY-le.top-i.y)/i.zoom,ne=ce-G.startMouse.x,V=ye-G.startMouse.y,ue=ua[G.handleIdx];let ge=G.startSize.width+ne*ue.resizeX,ke=G.startSize.height+V*ue.resizeY,_e=G.startPos.x+(ue.resizeX<0?ne:0),Te=G.startPos.y+(ue.resizeY<0?V:0);ge=Math.max(30,Ne(ge)),ke=Math.max(20,Ne(ke)),_e=Ne(_e),Te=Ne(Te),h(G.nodeId,{width:ge,height:ke},{x:_e,y:Te});return}if(T&&u){const ae=A.current;if(!ae)return;const le=ae.getBoundingClientRect(),ce=Ne((H.clientX-le.left-i.x)/i.zoom-_.x),ye=Ne((H.clientY-le.top-i.y)/i.zoom-_.y);u(T,{x:ce,y:ye});const ne=t.find(V=>V.id===T);ne&&U(T,{x:ce,y:ye},ne.size)}},[O,E,n,i,W,G,h,T,u,_,Ne,t,U]),fe=s.useCallback(H=>{if(R&&O){const ae=Math.min(R.x1,R.x2),le=Math.min(R.y1,R.y2),ce=Math.max(R.x1,R.x2),ye=Math.max(R.y1,R.y2);if(Math.abs(ce-ae)>5||Math.abs(ye-le)>5){const ne=t.filter(V=>{const ue=V.position.x,ge=V.position.y,ke=ue+V.size.width,_e=ge+V.size.height;return ke>ae&&ue<ce&&_e>le&&ge<ye}).map(V=>V.id);p==null||p(ne),ne.length===1&&(d==null||d(ne[0]))}L(null),Y(null);return}if(E&&M(!1),G){B(null);return}if(T&&y){const ae=A.current;if(!ae)return;const le=ae.getBoundingClientRect(),ce=Ne((H.clientX-le.left-i.x)/i.zoom-_.x),ye=Ne((H.clientY-le.top-i.y)/i.zoom-_.y);y(T,{x:ce,y:ye})}g(null),se([])},[R,O,E,G,T,y,i,_,Ne,t,p,d]),Se=s.useCallback((H,ae)=>{if(H.stopPropagation(),!N)return;const le=t.find(ue=>ue.id===ae);if(!le||le.locked)return;if(H.shiftKey&&p){const ue=[...l],ge=ue.indexOf(ae);ge>=0?ue.splice(ge,1):ue.push(ae),p(ue);return}d==null||d(ae);const ce=A.current;if(!ce)return;const ye=ce.getBoundingClientRect(),ne=(H.clientX-ye.left-i.x)/i.zoom,V=(H.clientY-ye.top-i.y)/i.zoom;S({x:ne-le.position.x,y:V-le.position.y}),g(ae),f==null||f(ae)},[N,t,i,d,f,p,l]),be=s.useCallback((H,ae,le)=>{if(H.stopPropagation(),!N)return;const ce=t.find(ge=>ge.id===ae);if(!ce||ce.locked)return;const ye=A.current;if(!ye)return;const ne=ye.getBoundingClientRect(),V=(H.clientX-ne.left-i.x)/i.zoom,ue=(H.clientY-ne.top-i.y)/i.zoom;B({nodeId:ae,handleIdx:le,startMouse:{x:V,y:ue},startPos:{...ce.position},startSize:{...ce.size}}),d==null||d(ae)},[N,t,i,d]),ie=s.useCallback((H,ae)=>{if(H.stopPropagation(),!N||!m)return;const le=t.find(ce=>ce.id===ae);!le||le.locked||(J(ae),pe(le.label))},[N,t,m]),je=s.useCallback(()=>{K&&m&&m(K,he),J(null)},[K,he,m]),oe=s.useCallback((H,ae)=>{H.stopPropagation(),d==null||d(ae)},[d]),Ae=s.useCallback(H=>{const ae=t.find(le=>le.id===H);return ae?{x:ae.position.x+ae.size.width/2,y:ae.position.y+ae.size.height/2}:{x:0,y:0}},[t]),ze=s.useCallback((H,ae)=>{const le=t.find(V=>V.id===H);if(!le)return{x:0,y:0};const ce=le.ports.find(V=>V.id===ae);if(!ce)return Ae(H);const{position:ye,size:ne}=le;switch(ce.side){case"top":return{x:ye.x+ne.width*ce.offset,y:ye.y};case"bottom":return{x:ye.x+ne.width*ce.offset,y:ye.y+ne.height};case"left":return{x:ye.x,y:ye.y+ne.height*ce.offset};case"right":return{x:ye.x+ne.width,y:ye.y+ne.height*ce.offset};default:return Ae(H)}},[t,Ae]),Fe=s.useCallback(H=>{const ae=ze(H.sourceNodeId,H.sourcePortId),le=ze(H.targetNodeId,H.targetPortId);switch(H.style.lineType??"bezier"){case"straight":return`M ${ae.x} ${ae.y} L ${le.x} ${le.y}`;case"orthogonal":{const ye=(ae.x+le.x)/2;return`M ${ae.x} ${ae.y} L ${ye} ${ae.y} L ${ye} ${le.y} L ${le.x} ${le.y}`}case"step":{const ye=(ae.y+le.y)/2;return`M ${ae.x} ${ae.y} L ${ae.x} ${ye} L ${le.x} ${ye} L ${le.x} ${le.y}`}case"bezier":default:{const ye=Math.abs(le.x-ae.x)*.5;return`M ${ae.x} ${ae.y} C ${ae.x+ye} ${ae.y}, ${le.x-ye} ${le.y}, ${le.x} ${le.y}`}}},[ze]),Ge=s.useCallback((H,ae)=>{const{size:le,style:ce,shape:ye}=H,ne=le.width,V=le.height,ge=!!(ce.gradientColor&&ce.backgroundColor)?`url(#${ae})`:ce.backgroundColor??"#ffffff",ke=ce.borderColor??"#333333",_e=ce.borderWidth??1,Te=ce.borderRadius??(ye==="roundedRect"?8:0),Me=ce.borderStyle==="dashed"?"8,4":ce.borderStyle==="dotted"?"2,4":void 0,Ie=ce.shadow?"url(#nd-shadow)":void 0;switch(ye){case"ellipse":case"circle":return a.jsx("ellipse",{cx:ne/2,cy:V/2,rx:ne/2,ry:V/2,fill:ge,stroke:ke,strokeWidth:_e,strokeDasharray:Me,filter:Ie});case"diamond":return a.jsx("polygon",{points:`${ne/2},0 ${ne},${V/2} ${ne/2},${V} 0,${V/2}`,fill:ge,stroke:ke,strokeWidth:_e,strokeDasharray:Me,filter:Ie});case"hexagon":{const Oe=ne/4;return a.jsx("polygon",{points:`${Oe},0 ${ne-Oe},0 ${ne},${V/2} ${ne-Oe},${V} ${Oe},${V} 0,${V/2}`,fill:ge,stroke:ke,strokeWidth:_e,strokeDasharray:Me,filter:Ie})}case"parallelogram":{const Oe=ne*.15;return a.jsx("polygon",{points:`${Oe},0 ${ne},0 ${ne-Oe},${V} 0,${V}`,fill:ge,stroke:ke,strokeWidth:_e,strokeDasharray:Me,filter:Ie})}case"cylinder":return a.jsxs("g",{filter:Ie,children:[a.jsx("ellipse",{cx:ne/2,cy:V*.1,rx:ne/2,ry:V*.1,fill:ge,stroke:ke,strokeWidth:_e}),a.jsx("rect",{x:0,y:V*.1,width:ne,height:V*.8,fill:ge,stroke:"none"}),a.jsx("line",{x1:0,y1:V*.1,x2:0,y2:V*.9,stroke:ke,strokeWidth:_e}),a.jsx("line",{x1:ne,y1:V*.1,x2:ne,y2:V*.9,stroke:ke,strokeWidth:_e}),a.jsx("ellipse",{cx:ne/2,cy:V*.9,rx:ne/2,ry:V*.1,fill:ge,stroke:ke,strokeWidth:_e})]});case"triangle":return a.jsx("polygon",{points:`${ne/2},0 ${ne},${V} 0,${V}`,fill:ge,stroke:ke,strokeWidth:_e,strokeDasharray:Me,filter:Ie});case"cloud":{const Oe=`M${ne*.25},${V*.8} A${ne*.2},${ne*.2},0,1,1,${ne*.15},${V*.45} A${ne*.18},${ne*.18},0,1,1,${ne*.35},${V*.2} A${ne*.2},${ne*.2},0,1,1,${ne*.65},${V*.2} A${ne*.18},${ne*.18},0,1,1,${ne*.85},${V*.45} A${ne*.2},${ne*.2},0,1,1,${ne*.75},${V*.8} Z`;return a.jsx("path",{d:Oe,fill:ge,stroke:ke,strokeWidth:_e,filter:Ie})}case"document":{const Oe=`M 0 0 L ${ne} 0 L ${ne} ${V*.85} Q ${ne*.75} ${V*.7}, ${ne*.5} ${V*.85} Q ${ne*.25} ${V}, 0 ${V*.85} Z`;return a.jsx("path",{d:Oe,fill:ge,stroke:ke,strokeWidth:_e,filter:Ie})}case"actor":return a.jsxs("g",{stroke:ke,strokeWidth:_e,fill:"none",filter:Ie,children:[a.jsx("circle",{cx:ne/2,cy:V*.15,r:V*.12,fill:ge}),a.jsx("line",{x1:ne/2,y1:V*.27,x2:ne/2,y2:V*.6}),a.jsx("line",{x1:ne*.15,y1:V*.4,x2:ne*.85,y2:V*.4}),a.jsx("line",{x1:ne/2,y1:V*.6,x2:ne*.2,y2:V}),a.jsx("line",{x1:ne/2,y1:V*.6,x2:ne*.8,y2:V})]});case"rectangle":case"roundedRect":case"custom":default:return a.jsx("rect",{width:ne,height:V,rx:Te,ry:Te,fill:ge,stroke:ke,strokeWidth:_e,strokeDasharray:Me,filter:Ie})}},[]),Ye=s.useCallback(H=>{if(!v)return{};const ae=v.get(H);if(!ae)return{};const le=ae.glow>0?`drop-shadow(0 0 ${ae.glow}px gold)`:"",ce=ae.highlightColor?`drop-shadow(0 0 6px ${ae.highlightColor})`:"";return{opacity:ae.opacity,transform:`translate(${ae.translateX}px, ${ae.translateY}px) scale(${ae.scale})`,filter:[le,ce].filter(Boolean).join(" ")||void 0}},[v]),it=s.useMemo(()=>{if(!D)return null;const H=[];for(const[,ae]of D.glowStates){const le=Zr(ae.elementId),ce=Xr(ae.intensity,ae.pulse);H.push(a.jsxs("filter",{id:le,x:"-50%",y:"-50%",width:"200%",height:"200%",children:[a.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:ce,result:"blur"}),a.jsx("feFlood",{floodColor:ae.color,floodOpacity:.6,result:"color"}),a.jsx("feComposite",{in:"color",in2:"blur",operator:"in",result:"glowColored"}),a.jsxs("feMerge",{children:[a.jsx("feMergeNode",{in:"glowColored"}),a.jsx("feMergeNode",{in:"SourceGraphic"})]})]},le))}return H},[D]),_t=s.useMemo(()=>{if(!D)return null;const H=[];for(const[ae,le]of D.liquidFlows){if(!le.active)continue;const ce=e.find(ge=>ge.id===ae);if(!(ce!=null&&ce.style.liquidFlow))continue;const{color:ye,colorEnd:ne}=ce.style.liquidFlow,V=`nd-liquid-${ae}`,ue=le.gradientOffset;H.push(a.jsxs("linearGradient",{id:V,x1:"0",y1:"0",x2:"1",y2:"0",children:[a.jsx("stop",{offset:`${ue*100%100}%`,stopColor:ye,stopOpacity:.8}),a.jsx("stop",{offset:`${(ue+.3)*100%100}%`,stopColor:ne??ye,stopOpacity:.4}),a.jsx("stop",{offset:`${(ue+.6)*100%100}%`,stopColor:ye,stopOpacity:.8})]},V))}return H},[D,e]),ht=s.useMemo(()=>t.filter(H=>H.style.gradientColor&&H.style.backgroundColor).map(H=>{const ae=`nd-grad-${H.id}`,le=H.style.gradientDirection??"vertical";if(le==="radial")return a.jsxs("radialGradient",{id:ae,children:[a.jsx("stop",{offset:"0%",stopColor:H.style.backgroundColor}),a.jsx("stop",{offset:"100%",stopColor:H.style.gradientColor})]},ae);const ce=le==="horizontal"||le==="diagonal"?"1":"0",ye=le==="vertical"||le==="diagonal"?"1":"0";return a.jsxs("linearGradient",{id:ae,x1:"0",y1:"0",x2:ce,y2:ye,children:[a.jsx("stop",{offset:"0%",stopColor:H.style.backgroundColor}),a.jsx("stop",{offset:"100%",stopColor:H.style.gradientColor})]},ae)}),[t]);return a.jsxs("svg",{ref:A,className:`nice-diagram-canvas ${P??""}`,style:{width:"100%",height:"100%",background:Ce,cursor:E?"grabbing":G&&G.nodeId?ua[G.handleIdx].cursor:"default"},onWheel:Z,onMouseDown:X,onMouseMove:Q,onMouseUp:fe,onMouseLeave:fe,children:[a.jsxs("defs",{children:[a.jsx("marker",{id:"nd-arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:a.jsx("path",{d:"M 0 0 L 10 5 L 0 10 Z",fill:"#333"})}),a.jsx("marker",{id:"nd-open-arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:a.jsx("path",{d:"M 0 0 L 10 5 L 0 10",fill:"none",stroke:"#333",strokeWidth:"1.5"})}),a.jsx("marker",{id:"nd-diamond-marker",viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"10",markerHeight:"10",orient:"auto-start-reverse",children:a.jsx("polygon",{points:"5,0 10,5 5,10 0,5",fill:"#333"})}),a.jsx("marker",{id:"nd-circle-marker",viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:a.jsx("circle",{cx:"5",cy:"5",r:"4",fill:"#333"})}),a.jsx("filter",{id:"nd-shadow",x:"-10%",y:"-10%",width:"130%",height:"130%",children:a.jsx("feDropShadow",{dx:"2",dy:"2",stdDeviation:"3",floodColor:"#00000033"})}),$&&a.jsx("pattern",{id:"nd-grid",width:de,height:de,patternUnits:"userSpaceOnUse",children:a.jsx("path",{d:`M ${de} 0 L 0 0 0 ${de}`,fill:"none",stroke:ee,strokeWidth:"0.5"})}),ht,it,_t,t.filter(H=>H.style.glowColor).map(H=>{const ae=`nd-node-glow-${H.id}`,le=(H.style.glowIntensity??.5)*10;return a.jsxs("filter",{id:ae,x:"-50%",y:"-50%",width:"200%",height:"200%",children:[a.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:le,result:"blur"}),a.jsx("feFlood",{floodColor:H.style.glowColor,floodOpacity:.5,result:"color"}),a.jsx("feComposite",{in:"color",in2:"blur",operator:"in",result:"glowColored"}),a.jsxs("feMerge",{children:[a.jsx("feMergeNode",{in:"glowColored"}),a.jsx("feMergeNode",{in:"SourceGraphic"})]})]},ae)})]}),x&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"0",y:"0",width:"100%",height:"20",fill:"#f0f0f0",stroke:"#ccc",strokeWidth:"0.5"}),a.jsx("rect",{x:"0",y:"0",width:"20",height:"100%",fill:"#f0f0f0",stroke:"#ccc",strokeWidth:"0.5"}),Array.from({length:100},(H,ae)=>{const le=ae*de*i.zoom+i.x,ce=ae*de;return le>20?a.jsxs("g",{children:[a.jsx("line",{x1:le,y1:"0",x2:le,y2:"20",stroke:"#999",strokeWidth:"0.5"}),a.jsx("text",{x:le+2,y:"14",fontSize:"9",fill:"#666",children:ce})]},`rx${ae}`):null}),Array.from({length:100},(H,ae)=>{const le=ae*de*i.zoom+i.y,ce=ae*de;return le>20?a.jsxs("g",{children:[a.jsx("line",{x1:"0",y1:le,x2:"20",y2:le,stroke:"#999",strokeWidth:"0.5"}),a.jsx("text",{x:"2",y:le-2,fontSize:"9",fill:"#666",writingMode:"tb",children:ce})]},`ry${ae}`):null})]}),a.jsxs("g",{transform:`translate(${i.x}, ${i.y}) scale(${i.zoom})`,children:[$&&a.jsx("rect",{x:"-10000",y:"-10000",width:"20000",height:"20000",fill:"url(#nd-grid)"}),r.map(H=>{var ue,ge,ke,_e,Te,Me,Ie,Oe,Ze,Xe,et,st;const ae=t.filter(He=>H.nodeIds.includes(He.id));if(ae.length===0&&!H.collapsed)return null;const le=((ue=H.style)==null?void 0:ue.padding)??20;if(H.collapsed){const He=t.find(Et=>H.nodeIds.includes(Et.id)),gt=He?He.position.x:0,Ct=He?He.position.y:0;return a.jsxs("g",{style:{cursor:"pointer"},onClick:()=>b==null?void 0:b(H.id),children:[a.jsx("rect",{x:gt,y:Ct,width:160,height:40,fill:((ge=H.style)==null?void 0:ge.backgroundColor)??"rgba(200,200,255,0.3)",stroke:((ke=H.style)==null?void 0:ke.borderColor)??"#aab",strokeWidth:((_e=H.style)==null?void 0:_e.borderWidth)??1,rx:((Te=H.style)==null?void 0:Te.borderRadius)??6,strokeDasharray:"6,3"}),a.jsxs("text",{x:gt+24,y:Ct+24,fontSize:"12",fill:((Me=H.style)==null?void 0:Me.labelColor)??"#666",fontWeight:"bold",children:["▶ ",H.label," (",H.nodeIds.length,")"]})]},H.id)}const ce=Math.min(...ae.map(He=>He.position.x))-le,ye=Math.min(...ae.map(He=>He.position.y))-le,ne=Math.max(...ae.map(He=>He.position.x+He.size.width))+le,V=Math.max(...ae.map(He=>He.position.y+He.size.height))+le;return a.jsxs("g",{children:[a.jsx("rect",{x:ce,y:ye,width:ne-ce,height:V-ye,fill:((Ie=H.style)==null?void 0:Ie.backgroundColor)??"rgba(200,200,255,0.1)",stroke:((Oe=H.style)==null?void 0:Oe.borderColor)??"#aab",strokeWidth:((Ze=H.style)==null?void 0:Ze.borderWidth)??1,rx:((Xe=H.style)==null?void 0:Xe.borderRadius)??6,strokeDasharray:((et=H.style)==null?void 0:et.borderStyle)==="dashed"?"6,3":void 0}),a.jsx("text",{x:ce+6,y:ye-4,fontSize:"12",fill:((st=H.style)==null?void 0:st.labelColor)??"#666",fontWeight:"bold",children:H.label}),(N||w!=="editor")&&b&&a.jsxs("g",{style:{cursor:"pointer"},onClick:He=>{He.stopPropagation(),b(H.id)},children:[a.jsx("rect",{x:ne-24,y:ye-12,width:20,height:20,rx:4,fill:"white",stroke:"#999",strokeWidth:1}),a.jsx("text",{x:ne-14,y:ye+3,textAnchor:"middle",fontSize:"12",fill:"#666",children:"▼"})]})]},H.id)}),we.map((H,ae)=>a.jsx("line",{x1:H.x!=null?H.x:-1e4,y1:H.y!=null?H.y:-1e4,x2:H.x!=null?H.x:1e4,y2:H.y!=null?H.y:1e4,stroke:"#ff4081",strokeWidth:.5,strokeDasharray:"4,4"},`snap-${ae}`)),e.map(H=>{var Te;const ae=Fe(H),le=$e.has(H.id),ce=H.style.targetArrow==="diamond"?"url(#nd-diamond-marker)":H.style.targetArrow==="circle"?"url(#nd-circle-marker)":H.style.targetArrow==="openArrow"?"url(#nd-open-arrow)":H.style.targetArrow!=="none"?"url(#nd-arrow)":void 0,ye=H.style.sourceArrow==="diamond"?"url(#nd-diamond-marker)":H.style.sourceArrow==="circle"?"url(#nd-circle-marker)":H.style.sourceArrow==="openArrow"?"url(#nd-open-arrow)":H.style.sourceArrow==="arrow"?"url(#nd-arrow)":void 0,ne=Ye(H.id),V=v==null?void 0:v.get(H.id),ue=V==null?void 0:V.strokeProgress,ge=ue!=null&&ue>=0&&ue<1?{strokeDasharray:"1000",strokeDashoffset:`${1e3*(1-ue)}`}:void 0,ke=H.style.liquidFlow,_e=D==null?void 0:D.liquidFlows.get(H.id);return a.jsxs("g",{style:ne,onClick:Me=>oe(Me,H.id),children:[N&&a.jsx("path",{d:ae,fill:"none",stroke:"transparent",strokeWidth:12,style:{cursor:"pointer"}}),(ke==null?void 0:ke.active)&&a.jsx("path",{d:ae,fill:"none",stroke:`url(#nd-liquid-${H.id})`,strokeWidth:ke.pipeWidth??(H.style.strokeWidth??1.5)*4,strokeLinecap:"round",opacity:.5}),a.jsx("path",{d:ae,fill:"none",stroke:le?xe:H.style.strokeColor??"#333",strokeWidth:H.style.strokeWidth??1.5,strokeDasharray:(ge==null?void 0:ge.strokeDasharray)??((Te=H.style.strokeDash)==null?void 0:Te.join(","))??(H.style.animated?"6,4":void 0),strokeDashoffset:ge==null?void 0:ge.strokeDashoffset,markerEnd:ce,markerStart:ye,opacity:H.style.opacity??1,style:N?{cursor:"pointer",transition:ge?void 0:"stroke-dashoffset 0.1s"}:void 0}),H.style.animated&&a.jsx("circle",{r:3,fill:xe,children:a.jsx("animateMotion",{dur:`${1/(H.style.flowSpeed||1)}s`,repeatCount:"indefinite",path:ae})}),(_e==null?void 0:_e.active)&&_e.particles.map((Me,Ie)=>a.jsx("circle",{r:Me.size,fill:(ke==null?void 0:ke.color)??"#3b82f6",opacity:Me.opacity*.6,children:a.jsx("animateMotion",{dur:`${3/(((ke==null?void 0:ke.speed)??1)+.5)}s`,repeatCount:"indefinite",path:ae,begin:`${Me.t*3}s`})},`lp-${H.id}-${Ie}`)),V&&V.particleTrailT>=0&&a.jsxs(a.Fragment,{children:[a.jsx("circle",{r:4,fill:"#fbbf24",opacity:.8,children:a.jsx("animateMotion",{dur:"2s",repeatCount:"indefinite",path:ae,begin:`${V.particleTrailT*2}s`})}),a.jsx("circle",{r:2,fill:"#fbbf24",opacity:.5,children:a.jsx("animateMotion",{dur:"2s",repeatCount:"indefinite",path:ae,begin:`${(V.particleTrailT+.1)*2}s`})})]}),H.label&&(()=>{const Me=ze(H.sourceNodeId,H.sourcePortId),Ie=ze(H.targetNodeId,H.targetPortId),Oe=(Me.x+Ie.x)/2,Ze=(Me.y+Ie.y)/2;return a.jsxs("g",{children:[a.jsx("rect",{x:Oe-4,y:Ze-16,width:H.label.length*7+8,height:18,rx:3,fill:"white",fillOpacity:.85}),a.jsx("text",{x:Oe,y:Ze-2,textAnchor:"start",fontSize:"11",fill:"#555",children:H.label})]})})()]},H.id)}),t.filter(H=>!H.hidden||w==="editor").map(H=>{const ae=$e.has(H.id),le=Ye(H.id),ce=v==null?void 0:v.get(H.id),ye=H.style.fontFamily??(o==null?void 0:o.fontFamily)??"sans-serif",ne=H.style.fontSize??14,V=H.style.fontColor??"#222",ue=H.style.fontWeight??"normal",ge=H.style.fontStyle??"normal",ke=H.style.textAlign??"center",_e=H.style.rotation??0,Te=`nd-grad-${H.id}`,Me=!!H.hidden,Ie=Me?k??.3:H.style.opacity??1,Oe=H.style.glowColor?`url(#nd-node-glow-${H.id})`:void 0,Ze=ke==="left"?"start":ke==="right"?"end":"middle",Xe=ke==="left"?8:ke==="right"?H.size.width-8:H.size.width/2,et=ce==null?void 0:ce.typewriterChars,st=et!=null&&et>=0?H.label.slice(0,et):H.label,He=ce==null?void 0:ce.liquidFillProgress,gt=ce==null?void 0:ce.rippleRadius,Ct=ce==null?void 0:ce.rippleOpacity,Et=H.childNodeIds&&H.childNodeIds.length>0,q=!!H.collapsed;return a.jsxs("g",{transform:`translate(${H.position.x}, ${H.position.y})${_e?` rotate(${_e}, ${H.size.width/2}, ${H.size.height/2})`:""}`,style:{...le,cursor:Me?"pointer":N&&!H.locked?"grab":"default",opacity:Ie,filter:Oe},onMouseDown:te=>Se(te,H.id),onDoubleClick:te=>ie(te,H.id),onClick:te=>{te.stopPropagation(),d==null||d(H.id),H.interactions&&H.interactions.length>0&&H.interactions.filter(Re=>Re.trigger==="click").forEach(Re=>j==null?void 0:j(H.id,Re.id))},onMouseEnter:()=>{H.interactions&&H.interactions.filter(re=>re.trigger==="hover").forEach(re=>j==null?void 0:j(H.id,re.id))},children:[Me&&a.jsx("rect",{x:-1,y:-1,width:H.size.width+2,height:H.size.height+2,fill:"none",stroke:"#999",strokeWidth:1,strokeDasharray:"3,3",rx:4,opacity:.5}),Ge(H,Te),He!=null&&He>0&&He<1&&a.jsx("clipPath",{id:`nd-liquid-clip-${H.id}`,children:a.jsx("rect",{x:0,y:H.size.height*(1-He),width:H.size.width,height:H.size.height*He})}),He!=null&&He>0&&He<1&&a.jsx("rect",{x:0,y:0,width:H.size.width,height:H.size.height,fill:H.style.glowColor??"#3b82f6",opacity:.25,rx:H.style.borderRadius??4,clipPath:`url(#nd-liquid-clip-${H.id})`}),gt!=null&>>0&&a.jsx("circle",{cx:H.size.width/2,cy:H.size.height/2,r:gt,fill:"none",stroke:H.style.glowColor??xe,strokeWidth:2,opacity:Ct??.5}),ae&&a.jsx("rect",{x:-3,y:-3,width:H.size.width+6,height:H.size.height+6,fill:"none",stroke:xe,strokeWidth:2,strokeDasharray:"4,3",rx:6}),ae&&N&&!H.locked&&ua.map((te,re)=>a.jsx("rect",{x:te.dx*H.size.width-Yt/2,y:te.dy*H.size.height-Yt/2,width:Yt,height:Yt,fill:"white",stroke:xe,strokeWidth:1.5,rx:1,style:{cursor:te.cursor},onMouseDown:Re=>be(Re,H.id,re)},re)),K===H.id?a.jsx("foreignObject",{x:4,y:4,width:H.size.width-8,height:H.size.height-8,children:a.jsx("input",{xmlns:"http://www.w3.org/1999/xhtml",type:"text",value:he,onChange:te=>pe(te.target.value),onBlur:je,onKeyDown:te=>{te.key==="Enter"&&je(),te.key==="Escape"&&J(null)},autoFocus:!0,style:{width:"100%",height:"100%",border:"1px solid "+xe,borderRadius:3,padding:"2px 4px",fontSize:ne,fontFamily:ye,fontWeight:ue,fontStyle:ge,textAlign:ke,background:"rgba(255,255,255,0.95)",outline:"none"}})}):a.jsxs(a.Fragment,{children:[a.jsx("text",{x:Xe,y:H.size.height/2+(H.description?-4:0),textAnchor:Ze,dominantBaseline:"central",fontFamily:ye,fontSize:ne,fontWeight:ue,fontStyle:ge,fill:V,pointerEvents:"none",children:st}),H.description&&a.jsx("text",{x:Xe,y:H.size.height/2+ne*.8,textAnchor:Ze,dominantBaseline:"central",fontFamily:ye,fontSize:ne*.75,fill:"#777",pointerEvents:"none",children:H.description}),H.icon&&a.jsx("text",{x:H.size.width/2,y:14,textAnchor:"middle",fontSize:16,pointerEvents:"none",children:H.icon}),H.style.linkUrl&&a.jsx("text",{x:H.size.width-4,y:12,textAnchor:"end",fontSize:10,fill:"#1976d2",pointerEvents:"none",children:"🔗"}),Et&&N&&a.jsxs("g",{onClick:te=>{te.stopPropagation(),C==null||C(H.id)},style:{cursor:"pointer"},children:[a.jsx("rect",{x:H.size.width-18,y:H.size.height-18,width:16,height:16,rx:3,fill:"white",stroke:"#aaa",strokeWidth:.5}),a.jsx("text",{x:H.size.width-10,y:H.size.height-7,textAnchor:"middle",dominantBaseline:"central",fontSize:10,fill:"#666",children:q?"▶":"▼"})]})]}),N&&H.ports.map(te=>{const re=Dn(H,te.id);return a.jsx("circle",{cx:re.x,cy:re.y,r:4,fill:"#fff",stroke:"#666",strokeWidth:1,style:{cursor:"crosshair"}},te.id)})]},H.id)}),D&&D.particles.length>0&&a.jsx("g",{className:"nd-particle-overlay",children:D.particles.map((H,ae)=>a.jsx("circle",{cx:H.x,cy:H.y,r:H.size,fill:H.color,opacity:H.opacity},`ptcl-${ae}`))}),R&&a.jsx("rect",{x:Math.min(R.x1,R.x2),y:Math.min(R.y1,R.y2),width:Math.abs(R.x2-R.x1),height:Math.abs(R.y2-R.y1),fill:"rgba(33,150,243,0.1)",stroke:xe,strokeWidth:1,strokeDasharray:"4,2"})]})]})};function Dn(t,e){const r=t.ports.find(n=>n.id===e);if(!r)return{x:0,y:0};const{size:i}=t;switch(r.side){case"top":return{x:i.width*r.offset,y:0};case"bottom":return{x:i.width*r.offset,y:i.height};case"left":return{x:0,y:i.height*r.offset};case"right":return{x:i.width,y:i.height*r.offset};default:return{x:0,y:0}}}lt.displayName="DiagramCanvas";const mr={en:{"toolbar.select":"Select","toolbar.addNode":"Add Node","toolbar.addEdge":"Add Edge","toolbar.group":"Group","toolbar.ungroup":"Ungroup","toolbar.delete":"Delete","toolbar.undo":"Undo","toolbar.redo":"Redo","toolbar.zoomIn":"Zoom In","toolbar.zoomOut":"Zoom Out","toolbar.fitToScreen":"Fit to Screen","toolbar.export":"Export","toolbar.import":"Import","toolbar.autoLayout":"Auto Layout","toolbar.animations":"Animations","toolbar.dataBinding":"Data Binding","layout.dagre":"Hierarchical","layout.forceDirected":"Force-Directed","layout.grid":"Grid","layout.radial":"Radial","layout.tree":"Tree","panel.properties":"Properties","panel.style":"Style","panel.animations":"Animations","panel.data":"Data","node.label":"Label","node.description":"Description","node.shape":"Shape","node.color":"Color","node.border":"Border","edge.label":"Label","edge.lineType":"Line Type","edge.arrow":"Arrow","export.svg":"SVG","export.png":"PNG","export.pdf":"PDF","export.mermaid":"Mermaid","export.ndd":"NDD (Native)","viewer.fullscreen":"Fullscreen","viewer.playAnimations":"Play Animations","viewer.stopAnimations":"Stop","viewer.print":"Print",untitled:"Untitled Diagram"},pl:{"toolbar.select":"Zaznacz","toolbar.addNode":"Dodaj węzeł","toolbar.addEdge":"Dodaj połączenie","toolbar.group":"Grupuj","toolbar.ungroup":"Rozgrupuj","toolbar.delete":"Usuń","toolbar.undo":"Cofnij","toolbar.redo":"Ponów","toolbar.zoomIn":"Powiększ","toolbar.zoomOut":"Pomniejsz","toolbar.fitToScreen":"Dopasuj do ekranu","toolbar.export":"Eksportuj","toolbar.import":"Importuj","toolbar.autoLayout":"Auto układ","toolbar.animations":"Animacje","toolbar.dataBinding":"Dane","layout.dagre":"Hierarchiczny","layout.forceDirected":"Siłowy","layout.grid":"Siatka","layout.radial":"Promieniowy","layout.tree":"Drzewo","panel.properties":"Właściwości","panel.style":"Styl","panel.animations":"Animacje","panel.data":"Dane","node.label":"Etykieta","node.description":"Opis","node.shape":"Kształt","node.color":"Kolor","node.border":"Obramowanie","edge.label":"Etykieta","edge.lineType":"Typ linii","edge.arrow":"Strzałka","export.svg":"SVG","export.png":"PNG","export.pdf":"PDF","export.mermaid":"Mermaid","export.ndd":"NDD (Natywny)","viewer.fullscreen":"Pełny ekran","viewer.playAnimations":"Odtwórz animacje","viewer.stopAnimations":"Zatrzymaj","viewer.print":"Drukuj",untitled:"Diagram bez nazwy"},de:{"toolbar.select":"Auswählen","toolbar.addNode":"Knoten hinzufügen","toolbar.addEdge":"Kante hinzufügen","toolbar.group":"Gruppieren","toolbar.ungroup":"Gruppierung aufheben","toolbar.delete":"Löschen","toolbar.undo":"Rückgängig","toolbar.redo":"Wiederholen","toolbar.zoomIn":"Vergrößern","toolbar.zoomOut":"Verkleinern","toolbar.fitToScreen":"An Bildschirm anpassen","toolbar.export":"Exportieren","toolbar.import":"Importieren","toolbar.autoLayout":"Automatisches Layout","toolbar.animations":"Animationen","toolbar.dataBinding":"Datenbindung","layout.dagre":"Hierarchisch","layout.forceDirected":"Kräftebasiert","layout.grid":"Raster","layout.radial":"Radial","layout.tree":"Baum","panel.properties":"Eigenschaften","panel.style":"Stil","panel.animations":"Animationen","panel.data":"Daten","node.label":"Bezeichnung","node.description":"Beschreibung","node.shape":"Form","node.color":"Farbe","node.border":"Rahmen","edge.label":"Bezeichnung","edge.lineType":"Linientyp","edge.arrow":"Pfeil","export.svg":"SVG","export.png":"PNG","export.pdf":"PDF","export.mermaid":"Mermaid","export.ndd":"NDD (Nativ)","viewer.fullscreen":"Vollbild","viewer.playAnimations":"Animationen abspielen","viewer.stopAnimations":"Stopp","viewer.print":"Drucken",untitled:"Unbenanntes Diagramm"},fr:{"toolbar.select":"Sélectionner","toolbar.addNode":"Ajouter un nœud","toolbar.addEdge":"Ajouter une arête","toolbar.group":"Grouper","toolbar.ungroup":"Dégrouper","toolbar.delete":"Supprimer","toolbar.undo":"Annuler","toolbar.redo":"Rétablir","toolbar.zoomIn":"Agrandir","toolbar.zoomOut":"Réduire","toolbar.fitToScreen":"Ajuster à l'écran","toolbar.export":"Exporter","toolbar.import":"Importer","toolbar.autoLayout":"Mise en page auto","toolbar.animations":"Animations","toolbar.dataBinding":"Liaison de données","layout.dagre":"Hiérarchique","layout.forceDirected":"Force dirigée","layout.grid":"Grille","layout.radial":"Radial","layout.tree":"Arbre","panel.properties":"Propriétés","panel.style":"Style","panel.animations":"Animations","panel.data":"Données","node.label":"Étiquette","node.description":"Description","node.shape":"Forme","node.color":"Couleur","node.border":"Bordure","edge.label":"Étiquette","edge.lineType":"Type de ligne","edge.arrow":"Flèche","export.svg":"SVG","export.png":"PNG","export.pdf":"PDF","export.mermaid":"Mermaid","export.ndd":"NDD (Natif)","viewer.fullscreen":"Plein écran","viewer.playAnimations":"Lire les animations","viewer.stopAnimations":"Arrêter","viewer.print":"Imprimer",untitled:"Diagramme sans titre"},es:{"toolbar.select":"Seleccionar","toolbar.addNode":"Añadir nodo","toolbar.addEdge":"Añadir arista","toolbar.group":"Agrupar","toolbar.ungroup":"Desagrupar","toolbar.delete":"Eliminar","toolbar.undo":"Deshacer","toolbar.redo":"Rehacer","toolbar.zoomIn":"Ampliar","toolbar.zoomOut":"Reducir","toolbar.fitToScreen":"Ajustar a pantalla","toolbar.export":"Exportar","toolbar.import":"Importar","toolbar.autoLayout":"Diseño automático","toolbar.animations":"Animaciones","toolbar.dataBinding":"Enlace de datos","layout.dagre":"Jerárquico","layout.forceDirected":"Fuerza dirigida","layout.grid":"Cuadrícula","layout.radial":"Radial","layout.tree":"Árbol","panel.properties":"Propiedades","panel.style":"Estilo","panel.animations":"Animaciones","panel.data":"Datos","node.label":"Etiqueta","node.description":"Descripción","node.shape":"Forma","node.color":"Color","node.border":"Borde","edge.label":"Etiqueta","edge.lineType":"Tipo de línea","edge.arrow":"Flecha","export.svg":"SVG","export.png":"PNG","export.pdf":"PDF","export.mermaid":"Mermaid","export.ndd":"NDD (Nativo)","viewer.fullscreen":"Pantalla completa","viewer.playAnimations":"Reproducir animaciones","viewer.stopAnimations":"Detener","viewer.print":"Imprimir",untitled:"Diagrama sin título"}},Jr=s.createContext({locale:"en",t:(t,e)=>e??t});function Na({locale:t="en",overrides:e,children:r}){const i=s.useMemo(()=>{const n={...mr.en,...mr[t],...e};return{locale:t,t:(c,l)=>n[c]??l??c}},[t,e]);return s.createElement(Jr.Provider,{value:i},r)}function Wt(){return s.useContext(Jr)}function qe(t){return{primary:"#3b82f6",primaryLight:"#93c5fd",secondary:"#6366f1",accent:"#f59e0b",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",text:"#1e293b",textMuted:"#94a3b8",border:"#e2e8f0",surface:"#ffffff",surfaceAlt:"#f8fafc",...t}}function Tn(t,e={}){return{backgroundColor:t.surface,borderColor:t.primary,borderWidth:2,borderRadius:8,fontColor:t.text,fontSize:14,fontWeight:"normal",opacity:1,shadow:!0,...e}}function Fn(t,e={}){return{strokeColor:t.border,strokeWidth:2,lineType:"bezier",targetArrow:"arrow",...e}}function Rn(t,e={}){return{backgroundColor:`${t.primaryLight}18`,borderColor:t.primaryLight,borderWidth:1,borderStyle:"dashed",borderRadius:12,labelColor:t.text,padding:16,...e}}function Ve(t,e,r,i,n,o,c){return{canvas:t,nodeDefaults:Tn(e,i),edgeDefaults:Fn(e,n),groupDefaults:Rn(e,o),fontFamily:r,palette:e,effects:c}}const ct="'Inter', system-ui, sans-serif",Ma="'Fira Code', 'Cascadia Code', monospace",In="'Merriweather', 'Georgia', serif",Pn={id:"default-light",name:"Default Light",category:"corporate",themeSource:"Light",config:Ve({background:"#ffffff",gridColor:"#e2e8f020",gridSize:20,selectionColor:"#3b82f6"},qe({}),ct)},Ln=qe({primary:"#60a5fa",primaryLight:"#3b82f6",secondary:"#818cf8",accent:"#fbbf24",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee",text:"#f8fafc",textMuted:"#64748b",border:"#334155",surface:"#1e293b",surfaceAlt:"#0f172a"}),On={id:"default-dark",name:"Default Dark",category:"dark",themeSource:"Dark",config:Ve({background:"#0f172a",gridColor:"#334155",gridSize:20,selectionColor:"#60a5fa"},Ln,ct,{shadow:!1},{strokeColor:"#475569"},{backgroundColor:"#60a5fa10",borderColor:"#3b82f680"})},Hn=qe({primary:"#1d4ed8",primaryLight:"#93c5fd",secondary:"#3b82f6",text:"#1e3a5f",textMuted:"#7da0c4",border:"#93c5fd",surface:"#eff6ff",surfaceAlt:"#dbeafe"}),Wn={id:"corporate-blue",name:"Corporate Blue",category:"corporate",themeSource:"Blue",config:Ve({background:"#f0f5ff",gridColor:"#93c5fd20",gridSize:20,selectionColor:"#1d4ed8"},Hn,ct,{borderWidth:2,borderRadius:6},{strokeColor:"#93c5fd",strokeWidth:2})},Bn=qe({primary:"#00ff88",primaryLight:"#00cc6b",secondary:"#ff00ff",accent:"#00ffff",success:"#00ff88",warning:"#ffff00",error:"#ff3366",info:"#00ffff",text:"#e0e0e0",textMuted:"#808080",border:"#00ff8840",surface:"#1a1a2e",surfaceAlt:"#16213e"}),qn={id:"neon-glow",name:"Neon Glow",category:"dark",config:Ve({background:"#0a0a1a",gridColor:"#00ff8810",gridSize:20,selectionColor:"#00ff88"},Bn,Ma,{borderColor:"#00ff88",borderWidth:2,shadow:!0,glowColor:"#00ff88",glowIntensity:.6},{strokeColor:"#00ff8880",strokeWidth:2},{backgroundColor:"#00ff880a",borderColor:"#00ff8840"},{glowColor:"#00ff88",glowIntensity:.8,particleColor:"#00ffff",liquidColor:"#00ff88",liquidColorEnd:"#00ffff"})},Vn=qe({primary:"#ff2d95",primaryLight:"#ff6db6",secondary:"#7928ca",accent:"#00d4ff",success:"#39ff14",warning:"#ffd700",error:"#ff073a",info:"#00d4ff",text:"#ffffff",textMuted:"#b0b0b0",border:"#ff2d9540",surface:"#1a0030",surfaceAlt:"#2d004a"}),Kn={id:"cyberpunk",name:"Cyberpunk",category:"dark",config:Ve({background:"#0d001a",gridColor:"#ff2d9510",gridSize:24,selectionColor:"#ff2d95"},Vn,Ma,{borderColor:"#ff2d95",borderWidth:2,glowColor:"#ff2d95",glowIntensity:.7,shadow:!0,gradientColor:"#2d004a",gradientDirection:"vertical"},{strokeColor:"#7928ca80",strokeWidth:3},{},{glowColor:"#ff2d95",glowIntensity:.9,particleColor:"#00d4ff",liquidColor:"#ff2d95",liquidColorEnd:"#7928ca"})},Gn=qe({primary:"#ffffff",primaryLight:"#ffffffaa",secondary:"#4da6ff",accent:"#ffffff",text:"#ffffff",textMuted:"#ffffffaa",border:"#ffffff40",surface:"#1e3d6e",surfaceAlt:"#163050"}),Yn={id:"blueprint",name:"Technical Blueprint",category:"technical",config:Ve({background:"#0a1929",gridColor:"#4da6ff30",gridSize:16,selectionColor:"#ffffff"},Gn,Ma,{backgroundColor:"transparent",borderColor:"#4da6ff",borderWidth:1,borderStyle:"solid",fontColor:"#ffffff",shadow:!1},{strokeColor:"#4da6ff",strokeWidth:1,strokeDash:[4,4]},{backgroundColor:"transparent",borderColor:"#4da6ff40",borderStyle:"dashed",borderWidth:1})},Un=qe({primary:"#a78bfa",primaryLight:"#c4b5fd",secondary:"#f472b6",accent:"#fbbf24",success:"#6ee7b7",warning:"#fde68a",error:"#fca5a5",info:"#93c5fd",text:"#4a4a68",textMuted:"#9494b0",border:"#e2d8f4",surface:"#faf5ff",surfaceAlt:"#f3e8ff"}),Zn={id:"pastel-dream",name:"Pastel Dream",category:"pastel",config:Ve({background:"#fefcff",gridColor:"#e2d8f420",gridSize:20,selectionColor:"#a78bfa"},Un,"'Nunito', 'Quicksand', sans-serif",{borderColor:"#c4b5fd",borderWidth:2,borderRadius:16,shadow:!0},{strokeColor:"#c4b5fd",strokeWidth:2},{backgroundColor:"#a78bfa10",borderColor:"#c4b5fd",borderRadius:16})},Xn=qe({primary:"#059669",primaryLight:"#6ee7b7",secondary:"#065f46",accent:"#f59e0b",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#0d9488",text:"#1a3d2f",textMuted:"#6b8f7f",border:"#a7d7c5",surface:"#ecfdf5",surfaceAlt:"#d1fae5"}),Jn={id:"nature-forest",name:"Nature Forest",category:"nature",config:Ve({background:"#f0fdf4",gridColor:"#a7d7c520",gridSize:20,selectionColor:"#059669"},Xn,ct,{borderColor:"#059669",borderRadius:12},{strokeColor:"#6ee7b7"},{backgroundColor:"#05966910",borderColor:"#6ee7b7"},{liquidColor:"#059669",liquidColorEnd:"#6ee7b7",particleColor:"#f59e0b"})},Qn=qe({primary:"#00ff00",primaryLight:"#00cc00",secondary:"#00ff00",accent:"#ffff00",text:"#00ff00",textMuted:"#00990088",border:"#00ff0040",surface:"#001100",surfaceAlt:"#002200"}),es={id:"retro-terminal",name:"Retro Terminal",category:"retro",config:Ve({background:"#000800",gridColor:"#00ff0010",gridSize:16,selectionColor:"#00ff00"},Qn,"'Courier New', 'Fira Code', monospace",{backgroundColor:"#001100",borderColor:"#00ff0060",borderWidth:1,fontColor:"#00ff00",shadow:!1,glowColor:"#00ff00",glowIntensity:.4},{strokeColor:"#00ff0060",strokeWidth:1},{},{glowColor:"#00ff00",glowIntensity:.6,particleColor:"#00ff00",liquidColor:"#00ff00"})},ts=qe({primary:"#0000ff",primaryLight:"#6666ff",secondary:"#ff00ff",accent:"#ffff00",text:"#000000",textMuted:"#555555",border:"#000000",surface:"#ffffff",surfaceAlt:"#eeeeee"}),as={id:"high-contrast",name:"High Contrast",category:"accessibility",themeSource:"High Contrast",config:Ve({background:"#ffffff",gridColor:"#00000020",gridSize:20,selectionColor:"#0000ff"},ts,"Arial, sans-serif",{borderColor:"#000000",borderWidth:3,fontColor:"#000000",fontWeight:"bold"},{strokeColor:"#000000",strokeWidth:3},{borderColor:"#000000",borderWidth:2})},rs=qe({primary:"#1976d2",primaryLight:"#64b5f6",secondary:"#9c27b0",accent:"#ff9800",success:"#4caf50",warning:"#ff9800",error:"#f44336",info:"#03a9f4",text:"#212121",textMuted:"#757575",border:"#e0e0e0",surface:"#fafafa",surfaceAlt:"#f5f5f5"}),is={id:"material-design",name:"Material Design",category:"theme-based",themeSource:"Material",config:Ve({background:"#fafafa",gridColor:"#e0e0e020",gridSize:20,selectionColor:"#1976d2"},rs,"'Roboto', 'Noto Sans', sans-serif",{borderRadius:4,borderWidth:0,shadow:!0},{strokeColor:"#bdbdbd",strokeWidth:2},{borderRadius:8})},ns=qe({primary:"#0078d4",primaryLight:"#6cb8f7",secondary:"#8661c5",accent:"#ffaa44",success:"#107c10",warning:"#ffaa44",error:"#d13438",info:"#0078d4",text:"#323130",textMuted:"#a19f9d",border:"#edebe9",surface:"#ffffff",surfaceAlt:"#faf9f8"}),ss={id:"fluent-ui",name:"Fluent UI",category:"theme-based",themeSource:"Fluent",config:Ve({background:"#faf9f8",gridColor:"#edebe920",gridSize:20,selectionColor:"#0078d4"},ns,"'Segoe UI', system-ui, sans-serif",{borderRadius:4,borderWidth:1,shadow:!0},{strokeColor:"#c8c6c4",strokeWidth:1})},os=qe({primary:"#e65100",primaryLight:"#ff9e80",secondary:"#ff6f00",accent:"#ffd600",success:"#43a047",warning:"#ff6f00",error:"#c62828",info:"#0277bd",text:"#3e2723",textMuted:"#8d6e63",border:"#ffccbc",surface:"#fff8e1",surfaceAlt:"#fff3e0"}),ls={id:"sunset-warm",name:"Sunset Warm",category:"creative",config:Ve({background:"#fffde7",gridColor:"#ffccbc20",gridSize:20,selectionColor:"#e65100"},os,ct,{borderColor:"#ff9e80",gradientColor:"#fff3e0",gradientDirection:"vertical"},{strokeColor:"#ff9e80"},{},{liquidColor:"#e65100",liquidColorEnd:"#ffd600",particleColor:"#ffd600"})},cs=qe({primary:"#006064",primaryLight:"#4dd0e1",secondary:"#00838f",accent:"#ffd54f",success:"#00e676",warning:"#ffd54f",error:"#ff5252",info:"#40c4ff",text:"#004d40",textMuted:"#80cbc4",border:"#b2ebf2",surface:"#e0f7fa",surfaceAlt:"#b2ebf2"}),ds={id:"ocean-deep",name:"Ocean Deep",category:"nature",config:Ve({background:"#e0f7fa",gridColor:"#b2ebf220",gridSize:20,selectionColor:"#006064"},cs,ct,{borderColor:"#00838f",borderRadius:12},{strokeColor:"#4dd0e1"},{},{liquidColor:"#006064",liquidColorEnd:"#4dd0e1",particleColor:"#ffd54f"})},us=qe({primary:"#5d4037",primaryLight:"#a1887f",secondary:"#795548",accent:"#c6a263",text:"#3e2723",textMuted:"#8d6e63",border:"#bcaaa4",surface:"#fdf6f0",surfaceAlt:"#efebe9"}),ps={id:"elegant-serif",name:"Elegant Serif",category:"creative",config:Ve({background:"#fdf6f0",gridColor:"#bcaaa420",gridSize:24,selectionColor:"#5d4037"},us,In,{borderColor:"#a1887f",borderWidth:1,borderRadius:2,fontStyle:"normal"},{strokeColor:"#bcaaa4",strokeWidth:1},{borderRadius:4})},ms=qe({primary:"#333333",primaryLight:"#666666",secondary:"#555555",accent:"#ff6600",text:"#333333",textMuted:"#999999",border:"#cccccc",surface:"#ffffff",surfaceAlt:"#f5f5f5"}),fs={id:"wireframe",name:"Wireframe",category:"technical",config:Ve({background:"#ffffff",gridColor:"#00000008",gridSize:16,selectionColor:"#ff6600"},ms,"'Balsamiq Sans', 'Comic Sans MS', cursive",{backgroundColor:"transparent",borderColor:"#999999",borderWidth:1,borderStyle:"solid",shadow:!1,borderRadius:4},{strokeColor:"#999999",strokeWidth:1},{backgroundColor:"transparent",borderStyle:"dashed",borderWidth:1,borderColor:"#cccccc"})},hs=qe({primary:"#00bfa5",primaryLight:"#64ffda",secondary:"#00897b",accent:"#ff6e40",success:"#00e676",warning:"#ffc400",error:"#ff1744",info:"#00e5ff",text:"#1b5e20",textMuted:"#81c784",border:"#a7ffeb",surface:"#e0f2f1",surfaceAlt:"#b2dfdb"}),gs={id:"mint-fresh",name:"Mint Fresh",category:"nature",config:Ve({background:"#e8f5e9",gridColor:"#a7ffeb20",gridSize:20,selectionColor:"#00bfa5"},hs,ct,{borderColor:"#00bfa5",borderRadius:20,borderWidth:2,gradientColor:"#b2dfdb",gradientDirection:"radial"},{strokeColor:"#64ffda",strokeWidth:2},{borderRadius:16},{liquidColor:"#00bfa5",liquidColorEnd:"#64ffda",particleColor:"#ff6e40"})},ys=qe({primary:"#424242",primaryLight:"#9e9e9e",secondary:"#616161",accent:"#ff5722",text:"#212121",textMuted:"#bdbdbd",border:"#e0e0e0",surface:"#fafafa",surfaceAlt:"#f5f5f5"}),bs={id:"monochrome",name:"Monochrome",category:"corporate",config:Ve({background:"#fafafa",gridColor:"#e0e0e020",gridSize:20,selectionColor:"#424242"},ys,ct,{borderColor:"#9e9e9e",borderWidth:1,shadow:!0,borderRadius:4},{strokeColor:"#9e9e9e",strokeWidth:1.5})},xs=qe({primary:"#e91e63",primaryLight:"#f48fb1",secondary:"#9c27b0",accent:"#ffeb3b",success:"#4caf50",warning:"#ff9800",error:"#f44336",info:"#00bcd4",text:"#4a148c",textMuted:"#ce93d8",border:"#f8bbd0",surface:"#fce4ec",surfaceAlt:"#f3e5f5"}),vs={id:"candy-pop",name:"Candy Pop",category:"creative",config:Ve({background:"#fff0f5",gridColor:"#f8bbd020",gridSize:20,selectionColor:"#e91e63"},xs,"'Quicksand', 'Nunito', sans-serif",{borderColor:"#e91e63",borderRadius:24,borderWidth:3,gradientColor:"#f3e5f5",gradientDirection:"diagonal"},{strokeColor:"#f48fb1",strokeWidth:3},{borderRadius:20,borderColor:"#f48fb1"},{glowColor:"#e91e63",glowIntensity:.5,particleColor:"#ffeb3b"})},ks=qe({primary:"#475569",primaryLight:"#94a3b8",secondary:"#334155",accent:"#f59e0b",text:"#0f172a",textMuted:"#94a3b8",border:"#cbd5e1",surface:"#f8fafc",surfaceAlt:"#f1f5f9"}),ws={id:"slate-professional",name:"Slate Professional",category:"corporate",config:Ve({background:"#f8fafc",gridColor:"#cbd5e120",gridSize:20,selectionColor:"#475569"},ks,"'Inter', system-ui, sans-serif",{borderColor:"#cbd5e1",borderWidth:1,borderRadius:6,shadow:!0},{strokeColor:"#94a3b8",strokeWidth:1.5},{borderColor:"#cbd5e1",borderRadius:8})},_s=qe({primary:"#7c3aed",primaryLight:"#a78bfa",secondary:"#06b6d4",accent:"#f472b6",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee",text:"#e2e8f0",textMuted:"#94a3b8",border:"#7c3aed40",surface:"#1e1b4b",surfaceAlt:"#312e81"}),Cs={id:"aurora-borealis",name:"Aurora Borealis",category:"dark",config:Ve({background:"#0f0b2e",gridColor:"#7c3aed15",gridSize:24,selectionColor:"#a78bfa"},_s,ct,{borderColor:"#7c3aed",borderWidth:2,gradientColor:"#312e81",gradientDirection:"vertical",glowColor:"#a78bfa",glowIntensity:.5},{strokeColor:"#7c3aed80",strokeWidth:2},{},{glowColor:"#a78bfa",glowIntensity:.7,particleColor:"#06b6d4",liquidColor:"#7c3aed",liquidColorEnd:"#06b6d4"})},Ss=qe({primary:"#2c3e50",primaryLight:"#7f8c8d",secondary:"#2980b9",accent:"#e74c3c",text:"#2c3e50",textMuted:"#95a5a6",border:"#bdc3c7",surface:"#fdfaf6",surfaceAlt:"#f5f0e8"}),js={id:"sketch-hand-drawn",name:"Sketch / Hand-drawn",category:"creative",config:Ve({background:"#fdfaf6",gridColor:"#bdc3c720",gridSize:20,selectionColor:"#2980b9"},Ss,"'Caveat', 'Patrick Hand', cursive",{backgroundColor:"#fdfaf6",borderColor:"#2c3e50",borderWidth:2,borderRadius:2,shadow:!1},{strokeColor:"#2c3e50",strokeWidth:2},{borderStyle:"dashed",borderWidth:2})},Ns=qe({primary:"#2196f3",primaryLight:"#64b5f6",secondary:"#ff9800",accent:"#ff5722",success:"#4caf50",warning:"#ffc107",error:"#f44336",info:"#03a9f4",text:"#ffffff",textMuted:"#b0bec5",border:"#ffffff40",surface:"#2196f3",surfaceAlt:"#1565c0"}),Ms={id:"infographic-bold",name:"Infographic Bold",category:"creative",config:Ve({background:"#eceff1",gridColor:"#b0bec520",gridSize:24,selectionColor:"#ff5722"},Ns,"'Montserrat', 'Roboto', sans-serif",{backgroundColor:"#2196f3",borderColor:"#1565c0",borderWidth:0,fontColor:"#ffffff",fontWeight:"bold",borderRadius:12,shadow:!0},{strokeColor:"#90a4ae",strokeWidth:3},{backgroundColor:"#2196f320",borderWidth:2,borderRadius:16})},zs=qe({primary:"#9333ea",primaryLight:"#c084fc",secondary:"#6366f1",accent:"#f59e0b",text:"#f1f5f9",textMuted:"#a78bfa",border:"#7c3aed40",surface:"#1c1033",surfaceAlt:"#2d1b69"}),$s={id:"midnight-purple",name:"Midnight Purple",category:"dark",config:Ve({background:"#0f0720",gridColor:"#9333ea10",gridSize:20,selectionColor:"#c084fc"},zs,ct,{borderColor:"#9333ea",borderWidth:2,gradientColor:"#2d1b69",gradientDirection:"vertical",shadow:!1},{strokeColor:"#9333ea80",strokeWidth:2},{},{glowColor:"#9333ea",glowIntensity:.6,liquidColor:"#9333ea",liquidColorEnd:"#c084fc"})},sa=[Pn,On,Wn,is,ss,qn,Kn,Yn,es,Zn,ls,ds,ps,Jn,fs,as,gs,bs,vs,ws,Cs,js,Ms,$s],Es=[{id:"fill-solid",name:"Solid Fill",category:"fill",style:{opacity:1}},{id:"fill-gradient-v",name:"Vertical Gradient",category:"fill",style:{gradientColor:"#e2e8f0",gradientDirection:"vertical"}},{id:"fill-gradient-h",name:"Horizontal Gradient",category:"fill",style:{gradientColor:"#e2e8f0",gradientDirection:"horizontal"}},{id:"fill-gradient-d",name:"Diagonal Gradient",category:"fill",style:{gradientColor:"#e2e8f0",gradientDirection:"diagonal"}},{id:"fill-gradient-r",name:"Radial Gradient",category:"fill",style:{gradientColor:"#e2e8f0",gradientDirection:"radial"}},{id:"fill-transparent",name:"Transparent",category:"fill",style:{backgroundColor:"transparent",opacity:1}},{id:"fill-semi",name:"Semi-transparent",category:"fill",style:{opacity:.6}},{id:"fill-glass",name:"Glassmorphism",category:"fill",style:{opacity:.7,gradientColor:"#ffffff40",gradientDirection:"vertical",borderWidth:1,borderColor:"#ffffff60"}},{id:"border-none",name:"No Border",category:"border",style:{borderWidth:0}},{id:"border-thin",name:"Thin Border",category:"border",style:{borderWidth:1}},{id:"border-medium",name:"Medium Border",category:"border",style:{borderWidth:2}},{id:"border-thick",name:"Thick Border",category:"border",style:{borderWidth:3}},{id:"border-heavy",name:"Heavy Border",category:"border",style:{borderWidth:4}},{id:"border-solid",name:"Solid",category:"border",style:{borderStyle:"solid"}},{id:"border-dashed",name:"Dashed",category:"border",style:{borderStyle:"dashed"}},{id:"border-dotted",name:"Dotted",category:"border",style:{borderStyle:"dotted"}},{id:"border-rounded-sm",name:"Rounded Small",category:"border",style:{borderRadius:4}},{id:"border-rounded-md",name:"Rounded Medium",category:"border",style:{borderRadius:8}},{id:"border-rounded-lg",name:"Rounded Large",category:"border",style:{borderRadius:16}},{id:"border-rounded-xl",name:"Rounded XL",category:"border",style:{borderRadius:24}},{id:"border-pill",name:"Pill / Capsule",category:"border",style:{borderRadius:999}},{id:"border-sharp",name:"Sharp Corners",category:"border",style:{borderRadius:0}},{id:"effect-shadow",name:"Drop Shadow",category:"effect",style:{shadow:!0}},{id:"effect-no-shadow",name:"No Shadow",category:"effect",style:{shadow:!1}},{id:"effect-glow-blue",name:"Blue Glow",category:"effect",style:{glowColor:"#3b82f6",glowIntensity:.6}},{id:"effect-glow-green",name:"Green Glow",category:"effect",style:{glowColor:"#10b981",glowIntensity:.6}},{id:"effect-glow-red",name:"Red Glow",category:"effect",style:{glowColor:"#ef4444",glowIntensity:.6}},{id:"effect-glow-purple",name:"Purple Glow",category:"effect",style:{glowColor:"#8b5cf6",glowIntensity:.6}},{id:"effect-glow-gold",name:"Gold Glow",category:"effect",style:{glowColor:"#f59e0b",glowIntensity:.6}},{id:"effect-glow-neon",name:"Neon Glow",category:"effect",style:{glowColor:"#00ff88",glowIntensity:.8}}],As=[{id:"line-straight",name:"Straight",category:"type",style:{lineType:"straight"}},{id:"line-bezier",name:"Bezier Curve",category:"type",style:{lineType:"bezier"}},{id:"line-orthogonal",name:"Orthogonal",category:"type",style:{lineType:"orthogonal"}},{id:"line-step",name:"Step",category:"type",style:{lineType:"step"}},{id:"stroke-thin",name:"Thin Stroke",category:"stroke",style:{strokeWidth:1}},{id:"stroke-medium",name:"Medium Stroke",category:"stroke",style:{strokeWidth:2}},{id:"stroke-thick",name:"Thick Stroke",category:"stroke",style:{strokeWidth:3}},{id:"stroke-heavy",name:"Heavy Stroke",category:"stroke",style:{strokeWidth:4}},{id:"stroke-solid",name:"Solid",category:"stroke",style:{strokeDash:[]}},{id:"stroke-dashed",name:"Dashed",category:"stroke",style:{strokeDash:[8,4]}},{id:"stroke-dotted",name:"Dotted",category:"stroke",style:{strokeDash:[2,4]}},{id:"stroke-dash-dot",name:"Dash-Dot",category:"stroke",style:{strokeDash:[8,4,2,4]}},{id:"stroke-long-dash",name:"Long Dash",category:"stroke",style:{strokeDash:[16,8]}},{id:"arrow-target-none",name:"No Target Arrow",category:"arrow",style:{targetArrow:"none"}},{id:"arrow-target-arrow",name:"Arrow →",category:"arrow",style:{targetArrow:"arrow"}},{id:"arrow-target-open",name:"Open Arrow ▷",category:"arrow",style:{targetArrow:"openArrow"}},{id:"arrow-target-diamond",name:"Diamond ◇",category:"arrow",style:{targetArrow:"diamond"}},{id:"arrow-target-circle",name:"Circle ○",category:"arrow",style:{targetArrow:"circle"}},{id:"arrow-source-none",name:"No Source Arrow",category:"arrow",style:{sourceArrow:"none"}},{id:"arrow-source-arrow",name:"← Source Arrow",category:"arrow",style:{sourceArrow:"arrow"}},{id:"arrow-source-open",name:"◁ Open Source",category:"arrow",style:{sourceArrow:"openArrow"}},{id:"arrow-source-diamond",name:"◇ Diamond Source",category:"arrow",style:{sourceArrow:"diamond"}},{id:"arrow-source-circle",name:"○ Circle Source",category:"arrow",style:{sourceArrow:"circle"}},{id:"arrow-bidirectional",name:"↔ Bidirectional",category:"arrow",style:{sourceArrow:"arrow",targetArrow:"arrow"}},{id:"arrow-association",name:" Association (none)",category:"arrow",style:{sourceArrow:"none",targetArrow:"none"}},{id:"arrow-composition",name:"◆→ Composition",category:"arrow",style:{sourceArrow:"diamond",targetArrow:"arrow"}},{id:"arrow-aggregation",name:"◇→ Aggregation",category:"arrow",style:{sourceArrow:"diamond",targetArrow:"arrow"}},{id:"arrow-dependency",name:"- - → Dependency",category:"arrow",style:{targetArrow:"openArrow",strokeDash:[8,4]}},{id:"arrow-inheritance",name:"△→ Inheritance",category:"arrow",style:{targetArrow:"openArrow"}},{id:"effect-animated",name:"Animated Flow",category:"effect",style:{animated:!0,flowSpeed:1}},{id:"effect-animated-fast",name:"Fast Animated",category:"effect",style:{animated:!0,flowSpeed:2}},{id:"effect-animated-slow",name:"Slow Animated",category:"effect",style:{animated:!0,flowSpeed:.5}},{id:"effect-liquid",name:"Liquid Flow",category:"effect",style:{liquidFlow:{active:!0,color:"#3b82f6",speed:1}}},{id:"effect-liquid-neon",name:"Neon Liquid",category:"effect",style:{liquidFlow:{active:!0,color:"#00ff88",colorEnd:"#00ffff",speed:1.5,particleDensity:5}}}],Qr=[{id:"tp-fade-in",name:"Fade In",effect:"fadeIn",durationMs:400,easing:"easeOut",description:"Smoothly fades in"},{id:"tp-fade-out",name:"Fade Out",effect:"fadeOut",durationMs:400,easing:"easeIn",description:"Smoothly fades out"},{id:"tp-slide-left",name:"Slide Left",effect:"slideInLeft",durationMs:500,easing:"easeOut",description:"Slides in from left"},{id:"tp-slide-right",name:"Slide Right",effect:"slideInRight",durationMs:500,easing:"easeOut",description:"Slides in from right"},{id:"tp-slide-top",name:"Slide Down",effect:"slideInTop",durationMs:500,easing:"easeOut",description:"Slides in from top"},{id:"tp-slide-bottom",name:"Slide Up",effect:"slideInBottom",durationMs:500,easing:"easeOut",description:"Slides in from bottom"},{id:"tp-zoom-in",name:"Zoom In",effect:"zoomIn",durationMs:400,easing:"spring",description:"Zooms in with spring"},{id:"tp-zoom-out",name:"Zoom Out",effect:"zoomOut",durationMs:400,easing:"easeIn",description:"Zooms out"},{id:"tp-bounce",name:"Bounce In",effect:"bounce",durationMs:800,easing:"bounce",description:"Bounces into place"},{id:"tp-pulse",name:"Pulse",effect:"pulse",durationMs:1e3,easing:"easeInOut",description:"Pulsing scale effect"},{id:"tp-shake",name:"Shake",effect:"shake",durationMs:600,easing:"linear",description:"Shakes horizontally"},{id:"tp-glow",name:"Glow",effect:"glow",durationMs:1200,easing:"easeInOut",description:"Glowing highlight"},{id:"tp-highlight",name:"Highlight",effect:"highlight",durationMs:800,easing:"easeInOut",description:"Golden highlight flash"},{id:"tp-ripple",name:"Ripple",effect:"ripple",durationMs:1e3,easing:"easeOut",description:"Ripple wave effect"},{id:"tp-expand",name:"Expand",effect:"expand",durationMs:500,easing:"spring",description:"Expand from collapsed"},{id:"tp-collapse",name:"Collapse",effect:"collapse",durationMs:400,easing:"easeIn",description:"Collapse to hidden"},{id:"tp-color-shift",name:"Color Shift",effect:"colorShift",durationMs:2e3,easing:"linear",description:"Rainbow color cycle"},{id:"tp-liquid-fill",name:"Liquid Fill",effect:"liquidFill",durationMs:1500,easing:"easeInOut",description:"Liquid filling effect"},{id:"tp-draw-path",name:"Draw Path",effect:"drawPath",durationMs:1200,easing:"easeOut",description:"Edge draws itself"},{id:"tp-particle-trail",name:"Particle Trail",effect:"particleTrail",durationMs:2e3,easing:"linear",description:"Particles along edge"},{id:"tp-typewriter",name:"Typewriter",effect:"typewriter",durationMs:1500,easing:"linear",description:"Text appears letter by letter"}];function Ds(t){return sa.find(e=>e.id===t)}function Ts(t){return sa.filter(e=>e.category===t)}function Fs(t){return{canvasBackground:t.canvas.background,gridColor:t.canvas.gridColor,gridSize:t.canvas.gridSize,selectionColor:t.canvas.selectionColor,fontFamily:t.fontFamily,nodeDefaults:t.nodeDefaults,edgeDefaults:t.edgeDefaults,groupDefaults:t.groupDefaults,palette:t.palette,effects:t.effects}}function Rs(t,e,r,i,n,o){const c=qe({primary:r.primary,primaryLight:r.primaryHover,secondary:r.info,accent:r.warning,success:r.success,warning:r.warning,error:r.error,info:r.info,text:n.primary,textMuted:n.muted,border:o.color,surface:i.primary,surfaceAlt:i.secondary}),l=Is(i.primary);return{id:t,name:`${e} Theme`,category:"theme-based",themeSource:e,config:Ve({background:i.primary,gridColor:l?`${o.color}40`:`${o.color}20`,gridSize:20,selectionColor:r.primary},c,ct,{shadow:!l,borderWidth:l?1:2},{strokeColor:l?`${o.color}80`:o.color})}}function Is(t){const e=t.replace("#","");if(e.length<6)return!1;const r=parseInt(e.slice(0,2),16),i=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16);return(r*299+i*587+n*114)/1e3<128}function Ee(t){const e=s.useId();return t||e}function vt(t,e){s.useEffect(()=>{const r=i=>{!t.current||t.current.contains(i.target)||e()};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[t,e])}function Ps(t,e){s.useEffect(()=>{if(!e||!t.current)return;const r=t.current,i=document.activeElement,n=r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),o=n[0],c=n[n.length-1],l=d=>{d.key==="Tab"&&(d.shiftKey?document.activeElement===o&&(d.preventDefault(),c==null||c.focus()):document.activeElement===c&&(d.preventDefault(),o==null||o.focus()))};return o==null||o.focus(),r.addEventListener("keydown",l),()=>{var d;r.removeEventListener("keydown",l),(d=i==null?void 0:i.focus)==null||d.call(i)}},[t,e])}const Ls={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"},Os={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"},Hs={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"},Ws={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"},Bs={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"},qs={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"},Vs={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"},Ks={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"},Gs={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"},Ys={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"},Us={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"},Zs={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"},Xs={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"},Js={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"},Qs={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"},eo={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ă"},to={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":"Арабски"},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":"Згода на 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":"На передній план"},ro={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":"最前面に移動"},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.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":"맨 앞으로"},no={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":"置于最前"},so={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":"نقل إلى الأمام"},fr={en:Ls,pl:Os,de:Hs,fr:Ws,es:Bs,it:qs,pt:Vs,nl:Ks,sv:Gs,no:Ys,da:Us,fi:Zs,cs:Xs,sk:Js,hu:Qs,ro:eo,bg:to,uk:ao,ja:ro,ko:io,zh:no,ar:so},oo=(t,e)=>e,ei=s.createContext(oo),lo=({t,lang:e="en",overrides:r,children:i})=>{const n=s.useMemo(()=>{if(t)return t;const o=fr[e]??fr.en,c=r?{...o,...r}:o;return(l,d)=>c[l]??d},[t,e,r]);return a.jsx(ei.Provider,{value:n,children:i})};function De(){return{t:s.useContext(ei)}}const ti={"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"},co={xs:12,sm:16,md:20,lg:24,xl:32},uo=s.createContext({});function po({path:t,size:e,className:r,style:i,color:n,title:o,onClick:c}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:n||"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:`nice-icon ${r||""}`,style:i,role:o?"img":"presentation","aria-label":o,"aria-hidden":!o,onClick:c,children:[o&&a.jsx("title",{children:o}),a.jsx("path",{d:t})]})}const mo=({name:t,size:e="md",className:r,style:i,color:n,title:o,onClick:c})=>{const{resolver:l}=s.useContext(uo),d=typeof e=="number"?e:co[e];if(l){const f=l(t,d);if(f)return a.jsx("span",{className:`nice-icon-wrap ${r||""}`,style:i,onClick:c,children:f})}const p=ti[t];return p?a.jsx(po,{path:p,size:d,className:r,style:i,color:n,title:o,onClick:c}):null},fo=Object.keys(ti);s.createContext(null);const Be={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 ho(t){var r,i,n,o;const e=[];return(r=t.modifiers)!=null&&r.includes("ctrl")&&e.push("Ctrl"),(i=t.modifiers)!=null&&i.includes("alt")&&e.push("Alt"),(n=t.modifiers)!=null&&n.includes("shift")&&e.push("Shift"),(o=t.modifiers)!=null&&o.includes("meta")&&e.push("⌘"),e.push(t.key),e.join("+")}function go(t,e){if(!(t.key===e.key||t.key.toLowerCase()===e.key.toLowerCase()))return!1;const r=e.modifiers??[];return!(r.includes("ctrl")!==(t.ctrlKey||t.metaKey)||r.includes("alt")!==t.altKey||r.includes("shift")!==t.shiftKey)}const Qe=({shortcuts:t,position:e="top",icon:r,size:i="sm",className:n})=>{const[o,c]=s.useState(!1),l=s.useRef(null),[d,p]=s.useState({top:0,left:0}),f=s.useCallback(()=>{if(!l.current)return;const h=l.current.getBoundingClientRect(),m=8;let v=0,D=0;switch(e){case"top":v=h.top-m,D=h.left+h.width/2;break;case"bottom":v=h.bottom+m,D=h.left+h.width/2;break;case"left":v=h.top+h.height/2,D=h.left-m;break;case"right":v=h.top+h.height/2,D=h.right+m;break}p({top:v,left:D})},[e]),u=s.useCallback(()=>{f(),c(!0)},[f]),y=s.useCallback(()=>{f(),c(!0)},[f]);return t.length===0?null:a.jsxs(a.Fragment,{children:[a.jsx("button",{ref:l,type:"button",className:`nice-keyboard-hint nice-keyboard-hint--${i} ${n||""}`,onMouseEnter:u,onMouseLeave:()=>c(!1),onFocus:y,onBlur:()=>c(!1),"aria-label":"Keyboard shortcuts",tabIndex:-1,children:r||"?"}),o&&a.jsxs("div",{className:`nice-keyboard-hint__tooltip nice-keyboard-hint__tooltip--${e}`,style:{position:"fixed",top:d.top,left:d.left,transform:e==="top"?"translate(-50%, -100%)":e==="bottom"?"translate(-50%, 0)":e==="left"?"translate(-100%, -50%)":"translate(0, -50%)"},role:"tooltip",children:[a.jsx("div",{className:"nice-keyboard-hint__title",children:"Keyboard Shortcuts"}),a.jsx("ul",{className:"nice-keyboard-hint__list",children:t.map((h,m)=>a.jsxs("li",{className:"nice-keyboard-hint__item",children:[a.jsx("kbd",{className:"nice-keyboard-hint__key",children:ho(h)}),a.jsx("span",{className:"nice-keyboard-hint__desc",children:h.description})]},m))})]})]})};Qe.displayName="NiceKeyboardHint";function za(t={}){const{enabled:e=!1,onSubmit:r,preventDefault:i=!0,requireCtrl:n=!1,skipTextarea:o=!0}=t;return s.useCallback(c=>{!e||!r||c.key==="Enter"&&(n&&!c.ctrlKey&&!c.metaKey||o&&c.target.tagName==="TEXTAREA"||(i&&c.preventDefault(),r()))},[e,r,i,n,o])}s.createContext(null);s.createContext({direction:"ltr",isRTL:!1,flip:t=>t,flipStyle:(t,e)=>({[t]:e})});const yo=s.createContext({permissions:{},getAccessMode:()=>"full"});function Le(t,e,r){const i=s.useContext(yo);return t||i.getAccessMode(e,r)}const bo=s.createContext(null);function kt(){const t=s.useContext(bo);if(!t)throw new Error("useNiceAI must be used within a NiceAIProvider");return t}function xo(t={}){const e=kt(),[r,i]=s.useState(""),[n,o]=s.useState(!1),c=s.useCallback(async(f,u="")=>{o(!0),i("");try{const y=(await e.complete([{role:"user",content:`Complete the following ${t.language||""} code. Return ONLY the completion text, no explanation.
|
|
2
|
+
|
|
3
|
+
Code before cursor:
|
|
4
|
+
\`\`\`
|
|
5
|
+
${f}
|
|
6
|
+
\`\`\`
|
|
7
|
+
|
|
8
|
+
Code after cursor:
|
|
9
|
+
\`\`\`
|
|
10
|
+
${u}
|
|
11
|
+
\`\`\`
|
|
12
|
+
|
|
13
|
+
Completion:`}],{model:t.model,temperature:.2,maxTokens:200})).content.trim();return i(y),y}catch{return""}finally{o(!1)}},[e,t]),l=s.useCallback(async f=>{o(!0);try{return(await e.complete([{role:"user",content:`Explain the following ${t.language||""} code concisely:
|
|
14
|
+
|
|
15
|
+
\`\`\`
|
|
16
|
+
${f}
|
|
17
|
+
\`\`\``}],{model:t.model,temperature:.3})).content}finally{o(!1)}},[e,t]),d=s.useCallback(async(f,u)=>{o(!0);try{const y=await e.complete([{role:"user",content:`Refactor the following ${t.language||""} code according to the instruction. Return ONLY the refactored code.
|
|
18
|
+
|
|
19
|
+
Code:
|
|
20
|
+
\`\`\`
|
|
21
|
+
${f}
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
Instruction: ${u}
|
|
25
|
+
|
|
26
|
+
Refactored code:`}],{model:t.model,temperature:.2}),h=y.content.match(/```[\w]*\n?([\s\S]*?)```/);return h?h[1].trim():y.content.trim()}finally{o(!1)}},[e,t]),p=s.useCallback(async f=>{o(!0);try{const u=await e.complete([{role:"user",content:`Generate ${t.language||""} code from this comment/description. Return ONLY the code.
|
|
27
|
+
|
|
28
|
+
Description: ${f}
|
|
29
|
+
|
|
30
|
+
Code:`}],{model:t.model,temperature:.3}),y=u.content.match(/```[\w]*\n?([\s\S]*?)```/);return y?y[1].trim():u.content.trim()}finally{o(!1)}},[e,t]);return{suggestion:r,isLoading:n,complete:c,explain:l,refactor:d,generateFromComment:p}}function vo(){const t=kt(),[e,r]=s.useState(!1);return{parseFilter:s.useCallback(async(i,n)=>{r(!0);try{const o=await t.complete([{role:"user",content:`Convert this natural language query to filter conditions. Available columns: ${JSON.stringify(n)}
|
|
31
|
+
|
|
32
|
+
Query: "${i}"
|
|
33
|
+
|
|
34
|
+
Return a JSON array of filter objects with: field, operator (eq, ne, gt, gte, lt, lte, contains, startsWith, endsWith), value.
|
|
35
|
+
Only return the JSON array, no explanation.`}],{temperature:.1,maxTokens:500});try{const c=JSON.parse(o.content);return Array.isArray(c)?c:[]}catch{return[]}}finally{r(!1)}},[t]),isLoading:e}}function ko(){const t=kt(),[e,r]=s.useState(!1),i=s.useCallback(async(o,c)=>{r(!0);try{const l=o.slice(0,5),d=await t.complete([{role:"user",content:`Analyze this data and suggest the best chart type. Data sample: ${JSON.stringify(l)}
|
|
36
|
+
${c?`Context: ${c}`:""}
|
|
37
|
+
|
|
38
|
+
Return JSON with: type (line, bar, pie, scatter, area, donut), reason (brief explanation), config (suggested chart configuration like xField, yField, etc.)
|
|
39
|
+
Only return JSON.`}],{temperature:.2,maxTokens:500});try{return JSON.parse(d.content)}catch{return{type:"bar",reason:"Default chart type",config:{}}}}finally{r(!1)}},[t]),n=s.useCallback(async(o,c)=>{r(!0);try{const l=await t.complete([{role:"user",content:`Analyze this ${c} chart data and provide 3-5 key insights. Data: ${JSON.stringify(o.slice(0,20))}
|
|
40
|
+
|
|
41
|
+
Return a JSON array of insight strings.`}],{temperature:.3,maxTokens:500});try{return JSON.parse(l.content)}catch{return[]}}finally{r(!1)}},[t]);return{suggestChartType:i,generateInsights:n,isLoading:e}}function wo(){const t=kt(),[e,r]=s.useState(!1);return{generateForm:s.useCallback(async i=>{r(!0);try{const n=await t.complete([{role:"user",content:`Generate a form definition from this description: "${i}"
|
|
42
|
+
|
|
43
|
+
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).
|
|
44
|
+
Only return JSON.`}],{temperature:.3,maxTokens:1e3});try{return JSON.parse(n.content)}catch{return[]}}finally{r(!1)}},[t]),isLoading:e}}function _o(){const t=kt(),[e,r]=s.useState(!1),i=s.useCallback(async(c,l)=>{r(!0);try{return(await t.complete([{role:"user",content:`Improve this text to be more ${l||"professional"}. Keep the same meaning. Return only the improved text.
|
|
45
|
+
|
|
46
|
+
Text: ${c}
|
|
47
|
+
|
|
48
|
+
Improved:`}],{temperature:.4})).content.trim()}finally{r(!1)}},[t]),n=s.useCallback(async(c,l)=>{r(!0);try{return(await t.complete([{role:"user",content:`Translate this text to ${l}. Return only the translation.
|
|
49
|
+
|
|
50
|
+
Text: ${c}
|
|
51
|
+
|
|
52
|
+
Translation:`}],{temperature:.2})).content.trim()}finally{r(!1)}},[t]),o=s.useCallback(async c=>{r(!0);try{const l=await t.complete([{role:"user",content:`Generate clean semantic HTML from this prompt. Use proper tags (h1-h6, p, ul, ol, table, etc.). Return only HTML.
|
|
53
|
+
|
|
54
|
+
Prompt: ${c}
|
|
55
|
+
|
|
56
|
+
HTML:`}],{temperature:.3}),d=l.content.match(/```html?\n?([\s\S]*?)```/);return d?d[1].trim():l.content.trim()}finally{r(!1)}},[t]);return{improveText:i,translate:n,generateHtml:o,isLoading:e}}function Co(t,e){const r=(e==null?void 0:e.autoLoad)??!0,i=(e==null?void 0:e.defaultPageSize)??20,[n,o]=s.useState([]),[c,l]=s.useState(0),[d,p]=s.useState(!1),[f,u]=s.useState(null),[y,h]=s.useState(1),[m,v]=s.useState(i),[D,w]=s.useState((e==null?void 0:e.defaultSort)??[]),[k,b]=s.useState(e==null?void 0:e.defaultFilter),[C,j]=s.useState((e==null?void 0:e.defaultSearch)??""),N=s.useRef(0),$=e==null?void 0:e.loadOptions,x=s.useCallback(async()=>{if(!t)return;const z=++N.current;p(!0),u(null);try{const T=await t.load({skip:(y-1)*m,take:m,sort:D.length?D:void 0,filter:k,search:C||void 0,...$});if(z!==N.current)return;o(T.data),l(T.totalCount)}catch(T){if(z!==N.current)return;u(T instanceof Error?T.message:String(T))}finally{z===N.current&&p(!1)}},[t,y,m,D,k,C,$]);s.useEffect(()=>{r&&x()},[x,r]),s.useEffect(()=>{if(t)return t.on("changed",()=>{x()})},[t,x]);const F=s.useCallback((z,T)=>{w([{field:z,direction:T}]),h(1)},[]),I=s.useCallback(z=>{b(z),h(1)},[]),P=s.useCallback(z=>{j(z),h(1)},[]),A=s.useCallback(z=>{v(z),h(1)},[]),E=s.useCallback(async z=>{if(!(t!=null&&t.insert))throw new Error("DataSource is not writable");await t.insert(z)},[t]),M=s.useCallback(async(z,T)=>{if(!(t!=null&&t.update))throw new Error("DataSource is not writable");await t.update(z,T)},[t]),W=s.useCallback(async z=>{if(!(t!=null&&t.remove))throw new Error("DataSource is not writable");await t.remove(z)},[t]);return{data:n,totalCount:c,loading:d,error:f,page:y,pageSize:m,sort:D,filter:k,search:C,setPage:h,setPageSize:A,setSort:w,setSortField:F,setFilter:I,setSearch:P,reload:x,insert:E,update:M,remove:W}}function So(t,e){const[r,i]=s.useState(void 0),[n,o]=s.useState({}),[c,l]=s.useState(!1),[d,p]=s.useState(null),f=s.useRef(0),u=s.useCallback(async()=>{if(!t||e==null){i(void 0);return}const k=++f.current;l(!0),p(null);try{const b=await t.byKey(e);if(k!==f.current)return;i(b),o({})}catch(b){if(k!==f.current)return;p(b instanceof Error?b.message:String(b))}finally{k===f.current&&l(!1)}},[t,e]);s.useEffect(()=>{u()},[u]),s.useEffect(()=>{if(t)return t.on("changed",()=>{u()})},[t,u]);const y=s.useMemo(()=>({...r??{},...n}),[r,n]),h=Object.keys(n).length>0,m=s.useCallback((k,b)=>{o(C=>({...C,[k]:b}))},[]),v=s.useCallback(k=>{o(b=>({...b,...k}))},[]),D=s.useCallback(async()=>{if(!(t!=null&&t.update))throw new Error("DataSource is not writable");h&&await t.update(e,n)},[t,e,n,h]),w=s.useCallback(()=>{o({})},[]);return{data:r,editData:y,loading:c,error:d,changes:n,isDirty:h,set:m,setMany:v,save:D,reload:u,reset:w}}function jo(t,e,r,i){const[c,l]=s.useState([]),[d,p]=s.useState(!1),[f,u]=s.useState(null),y=s.useRef(0),h=s.useCallback(async D=>{if(!t)return;const w=++y.current;p(!0),u(null);try{const k=await t.load({take:200,search:D||void 0,searchFields:i==null?void 0:i.searchFields});if(w!==y.current)return;l(k.data)}catch(k){if(w!==y.current)return;u(k instanceof Error?k.message:String(k))}finally{w===y.current&&p(!1)}},[t,200,i==null?void 0:i.searchFields]);s.useEffect(()=>{h()},[h,!0]);const m=s.useMemo(()=>c.map(D=>{const w=D;return{value:String(w[e]??""),label:String(w[r]??"")}}),[c,e,r,i==null?void 0:i.iconField,i==null?void 0:i.descriptionField,i==null?void 0:i.groupField]),v=s.useCallback(D=>{h(D)},[h]);return{options:m,loading:d,error:f,search:v,reload:()=>h()}}const Tt={cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",source:"default",requiresConsentBanner:!1,resolvedAt:Date.now(),version:"1.0.0"},No=new Map;let Mo=class{constructor(e,r="nice2dev",i="local"){this.policy=e,this.namespace=r,this.defaultBackend=i}getBackend(e){const r=e||this.defaultBackend;if(r==="local"&&this.policy.localStorageAllowed)try{if(typeof localStorage<"u")return localStorage}catch{}if((r==="session"||r==="local")&&this.policy.sessionStorageAllowed)try{if(typeof sessionStorage<"u")return sessionStorage}catch{}return No}getKey(e){return`${this.namespace}:${e}`}get(e,r){const i=this.getBackend(r),n=this.getKey(e);try{const o=i instanceof Map?i.get(n):i.getItem(n);if(o==null)return null;try{return JSON.parse(o)}catch{return o}}catch{return null}}set(e,r,i){const n=this.getBackend(i),o=this.getKey(e);try{const c=typeof r=="string"?r:JSON.stringify(r);return n instanceof Map?n.set(o,c):n.setItem(o,c),!0}catch{return!1}}remove(e,r){const i=this.getBackend(r),n=this.getKey(e);try{return i instanceof Map?i.delete(n):(i.removeItem(n),!0)}catch{return!1}}clear(e){const r=this.getBackend(e),i=`${this.namespace}:`;try{if(r instanceof Map)for(const n of r.keys())n.startsWith(i)&&r.delete(n);else{const n=[];for(let o=0;o<r.length;o++){const c=r.key(o);c&&c.startsWith(i)&&n.push(c)}n.forEach(o=>r.removeItem(o))}}catch{}}keys(e){const r=this.getBackend(e),i=`${this.namespace}:`,n=[];try{if(r instanceof Map)for(const o of r.keys())o.startsWith(i)&&n.push(o.slice(i.length));else for(let o=0;o<r.length;o++){const c=r.key(o);c&&c.startsWith(i)&&n.push(c.slice(i.length))}}catch{}return n}has(e,r){return this.get(e,r)!==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 e=this.getBackend();return e instanceof Map?"memory":e===sessionStorage?"session":"local"}updatePolicy(e){this.policy=e}};function zo(t,e,r){return{generatedAt:new Date().toISOString(),instanceId:e,tenantId:r,effectiveMode:t.effectiveMode,cookies:{count:0,allowed:t.cookiesAllowed,strictAuthOnly:t.strictAuthCookieOnly,thirdParty:!1,tracking:!1},localStorage:{bytesUsed:0,allowed:t.localStorageAllowed,keysCount:0},sessionStorage:{bytesUsed:0,allowed:t.sessionStorageAllowed,keysCount:0},consentBanner:{required:t.requiresConsentBanner,shown:t.requiresConsentBanner},compliance:{ePrivacyCompliant:!t.cookiesAllowed||t.requiresConsentBanner,gdprCompliant:!0,pecrCompliant:!t.cookiesAllowed||t.requiresConsentBanner},statement:$o(t)}}function $o(t){return t.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.":t.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.":t.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.":t.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 Eo(t){const{effectiveMode:e}=t;switch(e){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 Ao(t){const e=[];if(!t.cookiesAllowed&&typeof document<"u"){const r=document.cookie;r&&r.length>0&&e.push({type:"cookie",severity:"high",message:`Cookies found but not allowed: ${r.split(";").length} cookie(s)`,data:r})}if(!t.localStorageAllowed)try{typeof localStorage<"u"&&localStorage.length>0&&e.push({type:"localStorage",severity:"high",message:`localStorage has ${localStorage.length} item(s) but not allowed`})}catch{}if(!t.sessionStorageAllowed)try{typeof sessionStorage<"u"&&sessionStorage.length>0&&e.push({type:"sessionStorage",severity:"medium",message:`sessionStorage has ${sessionStorage.length} item(s) but not allowed`})}catch{}return{compliant:e.length===0,violations:e,auditedAt:Date.now(),policy:t.effectiveMode}}const Do=s.createContext(null);function To(){const t=s.useContext(Do);if(t)return t;const e=new Mo(Tt);return{policy:Tt,canUseCookies:!1,canUseLocalStorage:!1,canUseSessionStorage:!1,canPersist:!1,mode:"traceless",requiresConsentBanner:!1,badgeInfo:Eo(Tt),setUserPreference:()=>{},generateReport:()=>zo(Tt,"default"),runAudit:()=>Ao(Tt),refreshPolicy:async()=>{},getStorageAdapter:()=>e,isLoading:!1,error:null}}function ai(t="nice2dev"){const{getStorageAdapter:e}=To();return s.useMemo(()=>e(t),[e,t])}const ri={"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 Fo(t,e){return e.split(".").reduce((r,i)=>{if(r&&typeof r=="object")return r[i]},t)}function $a(t){const e={};for(const[r,i]of Object.entries(ri)){const n=Fo(t,r);n!==void 0&&(e[i]=String(n))}return e}function Ro(t,e){const r=document.documentElement,i=$a(t);for(const[n,o]of Object.entries(i))r.style.setProperty(n,o);Po(t.backgroundImage,r),t.darkMode&&(r.dataset.ntdColorScheme=t.darkMode)}const Io={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 Po(t,e){if(e.style.removeProperty("--ntd-bg-image"),e.style.removeProperty("--ntd-bg-image-size"),e.style.removeProperty("--ntd-bg-image-position"),e.style.removeProperty("--ntd-bg-image-attachment"),e.style.removeProperty("--ntd-bg-image-repeat"),e.style.removeProperty("--ntd-bg-image-opacity"),e.style.removeProperty("--ntd-bg-image-blend"),!(!t||t.type==="none")){if(t.type==="gradient"&&t.gradient)e.style.setProperty("--ntd-bg-image",t.gradient);else if(t.type==="image"&&t.imageUrl)e.style.setProperty("--ntd-bg-image",`url("${t.imageUrl}")`),t.imageSize&&e.style.setProperty("--ntd-bg-image-size",t.imageSize),t.imagePosition&&e.style.setProperty("--ntd-bg-image-position",t.imagePosition),t.imageAttachment&&e.style.setProperty("--ntd-bg-image-attachment",t.imageAttachment),t.imageRepeat&&e.style.setProperty("--ntd-bg-image-repeat",t.imageRepeat);else if(t.type==="pattern"&&t.pattern){const r=Io[t.pattern];if(r){const i=`url("data:image/svg+xml,${encodeURIComponent(r)}")`;e.style.setProperty("--ntd-bg-image",i),e.style.setProperty("--ntd-bg-image-repeat","repeat")}}t.opacity!==void 0&&e.style.setProperty("--ntd-bg-image-opacity",String(t.opacity)),t.blendMode&&e.style.setProperty("--ntd-bg-image-blend",t.blendMode)}}function Lo(t){const e=t??document.documentElement;for(const r of Object.values(ri))e.style.removeProperty(r);for(const r 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"])e.style.removeProperty(r);delete e.dataset.ntdColorScheme}function Oo(t){return JSON.stringify(t,null,2)}function Ho(t){const e=JSON.parse(t);if(!e||typeof e!="object"||!e.name||!e.colors||!e.backgrounds)throw new Error("Invalid theme format: missing required fields (name, colors, backgrounds)");return e}const Wo=s.createContext(null);/**
|
|
57
|
+
* @file themeVariants.ts
|
|
58
|
+
* @description Extended theme variants - radius, shadows, fills, gradients, effects
|
|
59
|
+
*
|
|
60
|
+
* Allows fine-grained customization of theme appearance
|
|
61
|
+
*
|
|
62
|
+
* @version 1.0.0
|
|
63
|
+
* @since 2026-03
|
|
64
|
+
* @license MIT
|
|
65
|
+
*/const Bo={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"}},qo={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))"},Vo={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))"},Ko={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"}},Go={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 Yo(t,e){const r={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(t){case"flat":return{...r,background:e,boxShadow:"none",border:"none"};case"raised":return{...r,background:e,boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:"none"};case"outlined":return{...r,background:"transparent",border:`2px solid ${e}`,color:e};case"ghost":return{...r,background:"transparent",border:"none",color:e};case"soft":return{...r,background:`${e}20`,border:"none",color:e};case"gradient":return{...r,background:`linear-gradient(135deg, ${e} 0%, ${va(e,-20)} 100%)`,border:"none",boxShadow:`0 4px 14px ${e}40`};case"3d":return{...r,background:e,border:"none",boxShadow:`0 4px 0 ${va(e,-30)}, 0 6px 10px rgba(0, 0, 0, 0.2)`,transform:"translateY(-2px)"};case"neumorphic":return{...r,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:e};case"pill":return{...r,background:e,border:"none",borderRadius:"9999px",paddingLeft:"24px",paddingRight:"24px"};case"link":return{...r,background:"transparent",border:"none",color:e,textDecoration:"underline",padding:"0"};case"brutal":return{...r,background:e,border:"3px solid #000",boxShadow:"4px 4px 0 #000",borderRadius:"0"};default:return r}}function Uo(t){const e={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(t){case"bordered":return{...e,background:"var(--ntd-bg-input, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"var(--ntd-radius-md, 8px)"};case"filled":return{...e,background:"var(--ntd-bg-input-filled, #f3f4f6)",border:"2px solid transparent",borderRadius:"var(--ntd-radius-md, 8px)"};case"underlined":return{...e,background:"transparent",border:"none",borderBottom:"2px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"0",paddingLeft:"0",paddingRight:"0"};case"floating":return{...e,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{...e,background:"var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.1))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)"};case"neumorphic":return{...e,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{...e,background:"var(--ntd-bg-input, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"9999px",paddingLeft:"20px",paddingRight:"20px"};case"flush":return{...e,background:"transparent",border:"none",borderRadius:"0",padding:"0",outline:"none"};default:return e}}function Zo(t){const e={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(t){case"flat":return{...e,background:"var(--ntd-bg-surface, #fff)",border:"none",boxShadow:"none"};case"elevated":return{...e,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{...e,background:"var(--ntd-bg-surface, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",boxShadow:"none"};case"glass":return{...e,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{...e,background:"linear-gradient(135deg, var(--ntd-bg-surface) 0%, var(--ntd-bg-elevated) 100%)",border:"none",boxShadow:"var(--ntd-shadow-md)"};case"neumorphic":return{...e,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{...e,background:"transparent",border:"2px solid var(--ntd-border-color, #e5e7eb)",boxShadow:"none"};case"paper":return{...e,background:"#fffef9",border:"none",boxShadow:"2px 3px 8px rgba(0,0,0,0.06)",borderRadius:"2px"};default:return e}}function Xo(t,e){const r={display:"inline-flex",alignItems:"center",fontSize:"0.75rem",fontWeight:"600",lineHeight:"1"};switch(t){case"solid":return{...r,background:e,color:"#fff",padding:"2px 8px",borderRadius:"4px"};case"soft":return{...r,background:`${e}20`,color:e,padding:"2px 8px",borderRadius:"4px"};case"outlined":return{...r,background:"transparent",border:`1px solid ${e}`,color:e,padding:"2px 8px",borderRadius:"4px"};case"dot":return{...r,background:e,width:"8px",height:"8px",borderRadius:"50%",padding:"0"};case"pill":return{...r,background:e,color:"#fff",padding:"2px 12px",borderRadius:"9999px"};case"gradient":return{...r,background:`linear-gradient(135deg, ${e}, ${va(e,-20)})`,color:"#fff",padding:"2px 8px",borderRadius:"4px"};default:return r}}function Jo(t,e){switch(t){case"underline":return{borderBottom:`2px solid ${e}`,background:"transparent",color:e};case"pills":return{background:e,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:`${e}15`,color:e,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 ${e}`,borderBottom:"none",background:"transparent",borderRadius:"8px 8px 0 0"};default:return{}}}function Qo(t){switch(t){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 el(t){switch(t){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 tl(t){switch(t){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 ea={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"},al={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 rl(t){const e=Bo[t.radius],r=t.shadow,i=Ko[t.density],n=Go[t.animation],o=[":root {"];for(const[c,l]of Object.entries(e))o.push(` --ntd-radius-${c}: ${l};`);o.push(` --ntd-shadow: ${qo[r]};`),o.push(` --ntd-shadow-dark: ${Vo[r]};`);for(const[c,l]of Object.entries(i)){const d=c.replace(/([A-Z])/g,"-$1").toLowerCase();o.push(` --ntd-${d}: ${l};`)}for(const[c,l]of Object.entries(n)){const d=c.replace(/([A-Z])/g,"-$1").toLowerCase();o.push(` --ntd-animation-${d}: ${l};`)}return t.backgroundImage&&o.push(` --ntd-bg-image: url('${t.backgroundImage}');`),t.backgroundOverlay&&o.push(` --ntd-bg-overlay: ${t.backgroundOverlay};`),o.push("}"),o.join(`
|
|
66
|
+
`)}function il(t,e=document.documentElement){const r=rl(t);let i=document.getElementById("ntd-variant-styles");i||(i=document.createElement("style"),i.id="ntd-variant-styles",document.head.appendChild(i)),i.textContent=r,e.dataset.ntdRadius=t.radius,e.dataset.ntdShadow=t.shadow,e.dataset.ntdFill=t.fill,e.dataset.ntdButton=t.buttonStyle,e.dataset.ntdInput=t.inputStyle,e.dataset.ntdCard=t.cardStyle,e.dataset.ntdAnimation=t.animation,e.dataset.ntdDensity=t.density,t.badgeStyle&&(e.dataset.ntdBadge=t.badgeStyle),t.tabStyle&&(e.dataset.ntdTab=t.tabStyle),t.toggleStyle&&(e.dataset.ntdToggle=t.toggleStyle),t.tooltipStyle&&(e.dataset.ntdTooltip=t.tooltipStyle),t.modalStyle&&(e.dataset.ntdModal=t.modalStyle),t.tableStyle&&(e.dataset.ntdTable=t.tableStyle),t.menuStyle&&(e.dataset.ntdMenu=t.menuStyle)}function va(t,e){if(t.startsWith("#")){const r=t.slice(1),i=parseInt(r,16),n=Math.max(0,Math.min(255,(i>>16&255)+e)),o=Math.max(0,Math.min(255,(i>>8&255)+e)),c=Math.max(0,Math.min(255,(i&255)+e));return`#${(n<<16|o<<8|c).toString(16).padStart(6,"0")}`}return t}function ta(t){return t==="default"?ea:al[t]??ea}const ii=s.createContext({displayStyle:"default",variantConfig:ea,setDisplayStyle:()=>{}});function ni(t){const e=s.useContext(ii),r=t??e.displayStyle??"default",i=ta(r);return{style:r,config:i}}function ft(t,e,r="var(--color-primary, #6366f1)"){const{config:i}=ni(e);return nl(t,i,r)}function at(t,e){const{config:r}=ni(e);switch(t){case"button":return r.buttonStyle;case"input":return r.inputStyle;case"card":return r.cardStyle;case"badge":return r.badgeStyle??"solid";case"tab":return r.tabStyle??"underline";case"toggle":return r.toggleStyle??"default";case"tooltip":return r.tooltipStyle??"dark";case"modal":return r.modalStyle??"default";case"table":return r.tableStyle??"default";case"menu":return r.menuStyle??"default";default:return"default"}}function nl(t,e,r="#6366f1"){switch(t){case"button":return Yo(e.buttonStyle,r);case"input":return Uo(e.inputStyle);case"card":return Zo(e.cardStyle);case"badge":return Xo(e.badgeStyle??"solid",r);case"tab":return Jo(e.tabStyle??"underline",r);case"toggle":return Qo(e.toggleStyle??"default");case"tooltip":return el(e.tooltipStyle??"dark");case"table":return tl(e.tableStyle??"default");case"menu":return{};case"modal":return{};default:return{}}}function sl(t){const e=ta(t);return{"data-ntd-display-style":t,"data-ntd-density":e.density,"data-ntd-animation":e.animation,"data-ntd-radius":e.radius,"data-ntd-button":e.buttonStyle,"data-ntd-input":e.inputStyle,"data-ntd-card":e.cardStyle}}function aa(t){if(!t)return"";let e=t;return e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),e=e.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""),e=e.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi,'$1=""'),e=e.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi,'$1=""'),e=e.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi,""),e}const Bt={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},qt={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},Vt={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},Ea=t=>({color:t,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),si={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)"},ol={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 ve(t,e,r,i,n){return{name:t,colors:e,backgrounds:r,text:i,borders:Ea(n),shadows:si,spacing:Bt,typography:qt,transitions:Vt}}function Ke(t,e,r,i,n){return{name:t,colors:e,backgrounds:r,text:i,borders:Ea(n),shadows:ol,spacing:Bt,typography:qt,transitions:Vt}}const ll=ve("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"),cl=ve("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"),dl=ve("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"),ul=ve("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"),pl=ve("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"),ml=ve("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"),fl=ve("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"),hl=ve("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"),gl=ve("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"),yl=ve("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"),bl=ve("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"),xl=ve("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"),vl=ve("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"),kl=ve("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"),wl=ve("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"),_l=ve("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"),Cl=ve("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"),Sl=ve("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"),jl=ve("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"),Nl=ve("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"),Ml=ve("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"),zl=ve("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"),$l=Ke("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"),El=Ke("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"),Al=Ke("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"),Dl=Ke("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"),Tl=Ke("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"),Fl=Ke("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"),Rl=Ke("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"),Il=Ke("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=Ke("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"),Ll=Ke("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"),Ol=ve("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"),Hl=ve("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"),Wl=ve("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"),Bl=ve("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"),ql=ve("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"),Vl=ve("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"),Kl=ve("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"),Gl=ve("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"),Yl=ve("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"),Ul=ve("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"),Zl=ve("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"),Xl=ve("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=ve("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"),Ql=ve("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"),ec=ve("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"),tc=ve("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"),ac=ve("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"),rc=ve("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"),ic=ve("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"),nc=ve("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"),sc=ve("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"),oc=ve("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"),lc=ve("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"),cc=ve("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"),dc=ve("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"),uc=ve("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"),pc=ve("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"),mc=Ke("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"),fc=ve("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"),hc=Ke("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"),gc=Ke("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"),yc=Ke("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"),bc=Ke("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"),xc=ve("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"),vc=Ke("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"),kc=ve("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"),wc=ve("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"),_c=Ke("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"),Cc=Ke("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"),Sc=Ke("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"),jc=ve("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"),Nc=Ke("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"),Mc=ve("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"),zc=ve("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"),$c=ve("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"),Ec=ve("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"),Ac=ve("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"),Dc=ve("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"),Tc=ve("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"),Fc=ve("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"),Rc=ve("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"),Ic=ve("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=ve("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"),Lc=ve("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"),Oc=ve("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"),Hc=ve("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"),Wc=Ke("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"),Bc=ve("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"),qc=ve("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"),Vc={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:Ea("#e2e8f0"),shadows:si,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:Vt},Kc={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:Bt,typography:qt,transitions:{fast:"150ms ease",normal:"250ms ease",slow:"350ms ease"}},Gc={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:Bt,typography:qt,transitions:Vt},Yc={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:Bt,typography:qt,transitions:Vt},Uc=ve("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"),Zc=Ke("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"),Xc=Ke("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=ve("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"),Qc=ve("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"),ed=[ll,cl,dl,ul,pl,ml,fl,hl,gl,yl,bl,xl,vl,kl,wl,_l,Cl,Sl,jl,Nl,Ml,zl,$l,El,Al,Dl,Tl,Fl,Rl,Il,Pl,Ll,Ol,Hl,Wl,Bl,ql,Vl,Kl,Gl,Yl,Ul,Zl,Xl,Jl,Ql,ec,tc,ac,rc,ic,nc,sc,oc,lc,cc,dc,uc,pc,mc,fc,hc,gc,yc,bc,xc,vc,kc,wc,_c,Cc,Sc,jc,Nc,Mc,zc,$c,Ec,Ac,Dc,Tc,Fc,Rc,Ic,Pc,Lc,Oc,Hc,Wc,Bc,qc,Vc,Kc,Gc,Yc,Uc,Zc,Xc,Jc,Qc],$t={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},oa={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},Kt={color:"#e2e8f0",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},Gt={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},oi={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:Kt,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:$t,typography:oa,transitions:Gt},td={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:{...Kt,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:$t,typography:oa,transitions:Gt},ad={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:{...Kt,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:$t,typography:oa,transitions:Gt},rd={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:{...Kt,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:$t,typography:oa,transitions:Gt},id={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:{...Kt,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:$t,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)"}},nd={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:$t,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:Gt},sd={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:$t,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)"}},od=[oi,td,ad,rd,id,nd,sd,...ed],li=({theme:t,darkTheme:e,variantConfig:r,darkMode:i,displayStyle:n,animateTransitions:o=!0,children:c})=>{const l=s.useRef(null),[d,p]=s.useState(t),[f,u]=s.useState(!1),[y,h]=s.useState(n??"default");s.useEffect(()=>{n!==void 0&&h(n)},[n]),s.useEffect(()=>{const b=window.matchMedia("(prefers-color-scheme: dark)");u(b.matches);const C=j=>u(j.matches);return b.addEventListener("change",C),()=>b.removeEventListener("change",C)},[]);const m=i??t.darkMode??"light",v=m==="dark"||m==="auto"&&f;s.useEffect(()=>{p(v&&e?e:t)},[t,e,v]),s.useEffect(()=>{const b=l.current;if(!b)return;o&&(b.style.transition="background-color 300ms ease, color 300ms ease");const C=$a(d);for(const[N,$]of Object.entries(C))b.style.setProperty(N,$);b.style.colorScheme=v?"dark":"light",b.dataset.ntdColorScheme=v?"dark":"light";const j=d.backgroundImage;return j&&j.type!=="none"&&j.type==="gradient"&&j.gradient&&b.style.setProperty("--ntd-bg-image",j.gradient),()=>{b&&Lo(b)}},[d,v,o]),s.useEffect(()=>{const b=l.current;if(!b)return;const C=r?{...ea,...r}:ta(y);il(C,b);const j=sl(y);for(const[N,$]of Object.entries(j))b.setAttribute(N,$)},[r,y]);const D=s.useCallback(b=>{p(b)},[]),w=s.useMemo(()=>({theme:d,setTheme:D}),[d,D]),k=s.useMemo(()=>({displayStyle:y,variantConfig:ta(y),setDisplayStyle:h}),[y]);return a.jsx(Wo.Provider,{value:w,children:a.jsx(ii.Provider,{value:k,children:a.jsx("div",{ref:l,className:"nice-theme-scope",style:{display:"contents"},children:c})})})};li.displayName="NiceThemeProvider";const zt=({height:t=200})=>a.jsx("div",{className:"ntd-lazy-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",height:t,background:"var(--ntd-color-surface, #f5f5f5)",borderRadius:"var(--ntd-radius, 8px)",animation:"ntd-pulse 1.5s ease-in-out infinite"},children:a.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"}})}),ld=(t,e)=>a.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:[a.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),a.jsx("p",{style:{margin:"12px 0 8px",fontWeight:500},children:"Failed to load component"}),a.jsx("p",{style:{margin:0,fontSize:"0.875em",opacity:.8},children:t.message}),a.jsx("button",{onClick:e,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 cd extends s.Component{constructor(){super(...arguments),this.state={error:null},this.handleRetry=()=>{this.setState({error:null})}}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?this.props.fallback(this.state.error,this.handleRetry):this.props.children}}function dt(t,e={}){const{fallback:r=a.jsx(zt,{}),preloadOnMount:i=!1,preloadOnHover:n=!1,preloadAfterIdle:o,minLoadingTime:c=0,ssrFallback:l,errorFallback:d=ld,displayName:p}=e;let f=null,u=!1;const y=async()=>{if(f)return f;const w=Date.now();f=t();const k=await f;if(c>0){const b=Date.now()-w;b<c&&await new Promise(C=>setTimeout(C,c-b))}return u=!0,k},h=s.lazy(y),m=w=>{const k=s.useRef(null);return s.useEffect(()=>{i&&!u&&y()},[]),s.useEffect(()=>{if(o&&!u){const b="requestIdleCallback"in window?window.requestIdleCallback(()=>y(),{timeout:o}):setTimeout(()=>y(),o);return()=>{"cancelIdleCallback"in window?window.cancelIdleCallback(b):clearTimeout(b)}}},[]),s.useEffect(()=>{if(!n||u)return;const b=k.current;if(!b)return;const C=()=>{u||y()};return b.addEventListener("mouseenter",C,{once:!0}),()=>b.removeEventListener("mouseenter",C)},[]),typeof window>"u"&&l?a.jsx(a.Fragment,{children:l}):a.jsx("div",{ref:k,className:"ntd-lazy-wrapper",children:a.jsx(cd,{fallback:d,children:a.jsx(s.Suspense,{fallback:r,children:a.jsx(h,{...w})})})})},v=async()=>{u||await y()},D=m;return D.preload=v,D.displayName=p||"LazyComponent",D}const hr=()=>a.jsx(zt,{height:400}),gr=()=>a.jsx(zt,{height:300}),yr=()=>a.jsx(zt,{height:500}),br=()=>a.jsx(zt,{height:600}),ut=t=>t;dt(ut(()=>Promise.resolve().then(()=>Ir).then(t=>t.ar).then(t=>({default:t.NiceCodeEditor}))),{fallback:a.jsx(hr,{}),preloadOnHover:!0,displayName:"LazyCodeEditor"}),dt(ut(()=>Promise.resolve().then(()=>Ir).then(t=>t.aq).then(t=>({default:t.NiceHtmlEditor}))),{fallback:a.jsx(hr,{}),preloadOnHover:!0,displayName:"LazyHtmlEditor"}),dt(ut(()=>Promise.resolve().then(()=>require("./index-CNwVELPJ-BC-pDqbh.cjs")).then(t=>t.fy).then(t=>({default:t.NiceDocumentViewer}))),{fallback:a.jsx(zt,{height:600}),displayName:"LazyDocumentViewer"}),dt(ut(()=>Promise.resolve().then(()=>require("./NiceStockChart-Cpmv9_Cc-CLoIAI1L.cjs")).then(t=>t.v).then(t=>({default:t.NiceChart}))),{fallback:a.jsx(gr,{}),preloadAfterIdle:3e3,displayName:"LazyChart"}),dt(ut(()=>Promise.resolve().then(()=>require("./NiceStockChart-Cpmv9_Cc-CLoIAI1L.cjs")).then(t=>t.x).then(t=>({default:t.NiceVectorMap}))),{fallback:a.jsx(zt,{height:400}),displayName:"LazyVectorMap"}),dt(ut(()=>Promise.resolve().then(()=>require("./NiceStockChart-Cpmv9_Cc-CLoIAI1L.cjs")).then(t=>t.w).then(t=>({default:t.NiceSankey}))),{fallback:a.jsx(gr,{}),displayName:"LazySankey"}),dt(ut(()=>Promise.resolve().then(()=>require("./index-CNwVELPJ-BC-pDqbh.cjs")).then(t=>t.fw).then(t=>({default:t.NiceScheduler}))),{fallback:a.jsx(br,{}),displayName:"LazyScheduler"}),dt(ut(()=>Promise.resolve().then(()=>require("./index-CNwVELPJ-BC-pDqbh.cjs")).then(t=>t.fx).then(t=>({default:t.NiceGantt}))),{fallback:a.jsx(br,{}),displayName:"LazyGantt"}),dt(ut(()=>Promise.resolve().then(()=>require("./NiceSavedQueryPanel-DUw8plYP-B8ZfDGaR.cjs")).then(t=>t.s).then(t=>({default:t.NicePivotGrid}))),{fallback:a.jsx(yr,{}),displayName:"LazyPivotGrid"}),dt(ut(()=>Promise.resolve().then(()=>require("./NiceSavedQueryPanel-DUw8plYP-B8ZfDGaR.cjs")).then(t=>t.r).then(t=>({default:t.NiceDataGrid}))),{fallback:a.jsx(yr,{}),preloadAfterIdle:2e3,displayName:"LazyDataGrid"});process.env.NODE_ENV;const dd=process.env.NODE_ENV==="development";let ci={enabled:dd,slowRenderThreshold:16};const di=[],Aa=new Map,ui=new Map;function ud(){di.length=0,Aa.clear(),ui.clear()}function pd(t){const e=ci.slowRenderThreshold;return di.filter(r=>r.actualDuration>e)}function jt(t){return t<1?`${(t*1e3).toFixed(0)}μs`:t<1e3?`${t.toFixed(2)}ms`:`${(t/1e3).toFixed(2)}s`}function md(){const t=Array.from(Aa.values()),e=pd(),r=t.reduce((o,c)=>o+c.renderCount,0),i=t.length>0?t.reduce((o,c)=>o+c.avgRenderTime,0)/t.length:0,n=Array.from(ui.values());return{stats:t,slowRenders:e,totalRenders:r,avgRenderTime:i,marks:n}}function fd(){const t=md();console.group("%c[Nice2Dev Performance Report]","color: #6366f1; font-weight: bold; font-size: 14px"),console.log(`Total renders: ${t.totalRenders}`),console.log(`Average render time: ${jt(t.avgRenderTime)}`),console.log(`Slow renders: ${t.slowRenders.length}`),console.group("Component Stats"),console.table(t.stats.sort((e,r)=>r.totalRenderTime-e.totalRenderTime).map(e=>({Name:e.componentName,Renders:e.renderCount,"Avg Time":jt(e.avgRenderTime),"Max Time":jt(e.maxRenderTime),"Total Time":jt(e.totalRenderTime),"Slow Renders":e.slowRenderCount}))),console.groupEnd(),t.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(t.slowRenders.slice(-10).map(e=>({Component:e.componentName,Phase:e.phase,Duration:jt(e.actualDuration),Time:new Date(e.timestamp).toLocaleTimeString()}))),console.groupEnd()),t.marks.length>0&&(console.group("Custom Marks"),console.table(t.marks.filter(e=>e.duration).map(e=>({Name:e.name,Duration:jt(e.duration)}))),console.groupEnd()),console.groupEnd()}const hd=s.memo(({position:t="bottom-right",defaultCollapsed:e=!0})=>{const[r,i]=s.useState(e),[n,o]=s.useState([]),[c,l]=s.useState({used:0,total:0});if(s.useEffect(()=>{const p=()=>{const u=Array.from(Aa.values());o(u.sort((h,m)=>m.totalRenderTime-h.totalRenderTime).slice(0,10));const y=window.performance;y.memory&&l({used:y.memory.usedJSHeapSize/1024/1024,total:y.memory.totalJSHeapSize/1024/1024})};p();const f=setInterval(p,2e3);return()=>clearInterval(f)},[]),!ci.enabled)return null;const d={position:"fixed",zIndex:99999,...t.includes("top")?{top:8}:{bottom:8},...t.includes("left")?{left:8}:{right:8}};return a.jsxs("div",{style:{...d,background:"rgba(0, 0, 0, 0.85)",color:"#fff",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:r?"4px 8px":8,maxWidth:r?"auto":300,maxHeight:r?"auto":400,overflow:"auto"},children:[a.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>i(p=>!p),children:[a.jsx("span",{style:{color:"#22c55e"},children:"●"}),a.jsx("span",{children:"Profiler"}),c.used>0&&a.jsxs("span",{style:{color:c.used>100?"#f59e0b":"#64748b"},children:[c.used.toFixed(0),"MB"]}),a.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:r?"▼":"▲"})]}),!r&&a.jsxs("div",{style:{marginTop:8},children:[a.jsx("div",{style:{borderBottom:"1px solid #333",paddingBottom:4,marginBottom:8},children:a.jsx("strong",{children:"Top Components"})}),n.map(p=>a.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[a.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:p.componentName}),a.jsx("span",{style:{color:p.avgRenderTime>16?"#f59e0b":"#22c55e"},children:jt(p.avgRenderTime)}),a.jsxs("span",{style:{color:"#64748b",minWidth:30,textAlign:"right"},children:["x",p.renderCount]})]},p.componentName)),a.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[a.jsx("button",{onClick:fd,style:{flex:1,padding:"4px 8px",background:"#333",border:"none",borderRadius:4,color:"#fff",cursor:"pointer",fontSize:10},children:"Print Report"}),a.jsx("button",{onClick:ud,style:{flex:1,padding:"4px 8px",background:"#333",border:"none",borderRadius:4,color:"#fff",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});hd.displayName="ProfilerOverlay";s.createContext(null);s.createContext(null);const pt=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,displayStyle:y,value:h,defaultValue:m,onChange:v,onBlur:D,onKeyDown:w,placeholder:k,type:b="text",maxLength:C,prefix:j,suffix:N,clearable:$,autoFocus:x,submitOnEnter:F,onSubmit:I,showKeyboardHints:P,...A},E)=>{const M=Le(u,d);if(M==="hidden")return null;M==="disabled"&&(n=!0),M==="readOnly"&&(o=!0);const{t:W}=De(),z=Ee(d),T=ft("input",y),g=at("input",y),_=s.useCallback(()=>v==null?void 0:v(""),[v]),S=za({enabled:F,onSubmit:I}),R=s.useCallback(O=>{S(O),w==null||w(O)},[S,w]),L=s.useMemo(()=>{const O=[];return F&&O.push({key:"Enter",description:W("shortcuts.submit","Submit")}),$&&O.push({key:"Escape",description:W("shortcuts.clear","Clear")}),O},[F,$,W]);return a.jsxs("div",{className:`nice-field ${p||""}`,style:f,children:[t&&a.jsxs("label",{htmlFor:z,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[t,P&&L.length>0&&a.jsx(Qe,{shortcuts:L,size:"sm"})]}),a.jsxs("div",{className:`nice-input nice-input--${c} nice-input--ds-${g} ${r?"nice-input--error":""} ${n?"nice-input--disabled":""} ${o?"nice-input--readonly":""}`,style:T,children:[j&&a.jsx("span",{className:"nice-input__icon",children:j}),a.jsx("input",{ref:E,id:z,className:"nice-input__native",type:b,name:l,value:h,defaultValue:m,placeholder:k,disabled:n,readOnly:o,maxLength:C,autoFocus:x,"aria-invalid":!!r,"aria-describedby":r?`${z}-error`:e?`${z}-helper`:void 0,onChange:O=>v==null?void 0:v(O.target.value),onBlur:D,onKeyDown:R,...A}),$&&h&&a.jsx("button",{type:"button",className:"nice-input__clear",onClick:_,"aria-label":W("controls.clear","Clear"),children:"✕"}),N&&a.jsx("span",{className:"nice-input__icon",children:N})]}),r&&a.jsx("div",{id:`${z}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{id:`${z}-helper`,className:"nice-field__helper",children:e})]})});pt.displayName="NiceTextInput";const Je=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,size:o="md",name:c,id:l,className:d,style:p,accessMode:f,displayStyle:u,options:y,value:h,onChange:m,placeholder:v,multiple:D=!1,searchable:w=!1,clearable:k=!1,emptyText:b,maxHeight:C=240,optionsSource:j,valueField:N,labelField:$,virtualScroll:x,optionHeight:F=36,onSearch:I,loading:P,renderOption:A,showKeyboardHints:E},M)=>{const W=Le(f,l);if(W==="hidden")return null;(W==="disabled"||W==="readOnly")&&(n=!0);const{t:z}=De(),T=ft("input",u),g=at("input",u),_=Ee(l),[S,R]=s.useState(!1),[L,O]=s.useState(""),[Y,G]=s.useState(-1),[B,K]=s.useState(0),J=s.useRef(null),he=jo(j??null,N??(j==null?void 0:j.keyField)??"id",$??"name"),pe=j?he.options:y??[];vt(J,()=>{R(!1),O("")});const we=s.useMemo(()=>h?Array.isArray(h)?h:[h]:[],[h]),se=s.useMemo(()=>{if(!L&&!I||I)return pe;const U=L.toLowerCase();return pe.filter(Z=>Z.label.toLowerCase().includes(U)||String(Z.value).toLowerCase().includes(U))},[pe,L,I]),Ce=s.useMemo(()=>{const U=new Map;for(const Z of se){const X=Z.group||"";U.has(X)||U.set(X,[]),U.get(X).push(Z)}return U},[se]),ee=s.useCallback(U=>{if(D){const Z=we.includes(U)?we.filter(X=>X!==U):[...we,U];m==null||m(Z)}else m==null||m(U),R(!1),O("")},[D,we,m]),de=s.useCallback(U=>{if(U.key==="Escape"){R(!1),O("");return}if(U.key==="Enter"||U.key===" "){if(!S){R(!0),U.preventDefault();return}Y>=0&&se[Y]&&(ee(se[Y].value),U.preventDefault());return}U.key==="ArrowDown"&&(U.preventDefault(),G(Z=>Math.min(Z+1,se.length-1))),U.key==="ArrowUp"&&(U.preventDefault(),G(Z=>Math.max(Z-1,0)))},[S,Y,se,ee]),xe=s.useMemo(()=>{var U;return we.length===0?null:D?we.map(Z=>{var X;return((X=pe.find(Q=>Q.value===Z))==null?void 0:X.label)||Z}).join(", "):((U=pe.find(Z=>Z.value===we[0]))==null?void 0:U.label)||we[0]},[we,pe,D]),$e=s.useCallback(U=>{U.stopPropagation(),m==null||m(D?[]:"")},[m,D]),Ne=s.useMemo(()=>[{key:"Enter",description:z("shortcuts.select","Select")},{key:"Space",description:z("shortcuts.openDropdown","Open dropdown")},Be.moveUp,Be.moveDown,Be.cancel],[z]);return a.jsxs("div",{className:`nice-field ${d||""}`,style:p,children:[t&&a.jsxs("label",{htmlFor:_,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[t,E&&a.jsx(Qe,{shortcuts:Ne,size:"sm"})]}),a.jsxs("div",{className:"nice-select",ref:J,children:[a.jsxs("button",{ref:M,type:"button",id:_,role:"combobox","aria-expanded":S,"aria-haspopup":"listbox","aria-invalid":!!r,className:`nice-select__trigger nice-select__trigger--${o} nice-select--ds-${g} ${S?"nice-select__trigger--open":""} ${r?"nice-select__trigger--error":""} ${n?"nice-select__trigger--disabled":""}`,style:T,disabled:n,onClick:()=>R(!S),onKeyDown:de,children:[xe?a.jsx("span",{children:xe}):a.jsx("span",{className:"nice-select__placeholder",children:v||z("controls.select","Select...")}),a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[k&&we.length>0&&a.jsx("span",{className:"nice-input__clear",onClick:$e,role:"button","aria-label":z("controls.clear","Clear"),children:"✕"}),a.jsx("svg",{className:`nice-select__chevron ${S?"nice-select__chevron--open":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:a.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"})})]})]}),S&&a.jsxs("div",{className:"nice-select__dropdown",role:"listbox",style:{maxHeight:C},onScroll:x?U=>K(U.currentTarget.scrollTop):void 0,children:[(w||I)&&a.jsx("div",{className:"nice-select__search",children:a.jsx("input",{type:"text",value:L,onChange:U=>{O(U.target.value),G(0),I==null||I(U.target.value)},placeholder:z("controls.search","Search..."),autoFocus:!0})}),P&&a.jsx("div",{className:"nice-select__loading",children:a.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!P&&se.length===0?a.jsx("div",{className:"nice-select__empty",children:b||z("controls.noResults","No results found")}):x&&!Array.from(Ce.keys()).some(U=>U!=="")?(()=>{const U=se.length*F,Z=Math.max(0,Math.floor(B/F)-3),X=Math.min(se.length,Math.ceil((B+C)/F)+3),Q=se.slice(Z,X);return a.jsx("div",{style:{height:U,position:"relative"},children:Q.map((fe,Se)=>{const be=Z+Se,ie=we.includes(fe.value);return a.jsx("div",{role:"option","aria-selected":ie,className:`nice-select__option ${ie?"nice-select__option--selected":""} ${be===Y?"nice-select__option--highlighted":""} ${fe.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:be*F,left:0,right:0,height:F,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!fe.disabled&&ee(String(fe.value)),onMouseEnter:()=>G(be),children:A?A(fe,ie):a.jsxs(a.Fragment,{children:[fe.icon&&a.jsx("span",{children:fe.icon}),a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{children:fe.label}),fe.description&&a.jsx("div",{className:"nice-select__option-desc",children:fe.description})]}),ie&&a.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:a.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"})})]})},fe.value)})})})():Array.from(Ce.entries()).map(([U,Z])=>a.jsxs(s.Fragment,{children:[U&&a.jsx("div",{className:"nice-select__group-label",children:U}),Z.map(X=>{const Q=we.includes(X.value),fe=se.indexOf(X);return a.jsx("div",{role:"option","aria-selected":Q,className:`nice-select__option ${Q?"nice-select__option--selected":""} ${fe===Y?"nice-select__option--highlighted":""} ${X.disabled?"nice-select__option--disabled":""}`,onClick:()=>!X.disabled&&ee(String(X.value)),onMouseEnter:()=>G(fe),children:A?A(X,Q):a.jsxs(a.Fragment,{children:[X.icon&&a.jsx("span",{children:X.icon}),a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{children:X.label}),X.description&&a.jsx("div",{className:"nice-select__option-desc",children:X.description})]}),Q&&a.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:a.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"})})]})},X.value)})]},U))]})]}),r&&a.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{className:"nice-field__helper",children:e})]})});Je.displayName="NiceSelect";const gd=["#ef4444","#f97316","#f59e0b","#84cc16","#10b981","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#ec4899","#64748b","#1e293b"];function yd(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}const rt=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,id:o,className:c,style:l,accessMode:d,displayStyle:p,value:f="#3b82f6",onChange:u,presets:y=gd,showInput:h=!0,showRandom:m=!0,showKeyboardHints:v},D)=>{const w=Le(d,o);if(w==="hidden")return null;(w==="disabled"||w==="readOnly")&&(n=!0);const{t:k}=De(),b=Ee(o);at("input",p);const C=s.useRef(null),j=s.useCallback(()=>{n||(u==null||u(yd()))},[n,u]),N=s.useMemo(()=>[{key:"Enter",description:k("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:k("shortcuts.navigatePresets","Navigate presets")}],[k]);return a.jsxs("div",{className:`nice-field ${c||""}`,style:l,children:[t&&a.jsxs("label",{htmlFor:b,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[t,v&&a.jsx(Qe,{shortcuts:N,size:"sm"})]}),a.jsxs("div",{className:"nice-color-picker",children:[a.jsxs("div",{className:"nice-color-picker__preview-row",children:[a.jsx("div",{className:"nice-color-picker__swatch",style:{background:f},onClick:()=>{var $;return($=C.current)==null?void 0:$.click()},role:"button",tabIndex:0,"aria-label":"Pick color",children:a.jsx("input",{ref:$=>{C.current=$,typeof D=="function"?D($):D&&(D.current=$)},type:"color",className:"nice-color-picker__native",id:b,value:f,disabled:n,onChange:$=>u==null?void 0:u($.target.value)})}),h&&a.jsx("div",{className:"nice-input nice-input--sm",style:{width:100},children:a.jsx("input",{className:"nice-input__native",type:"text",value:f,disabled:n,onChange:$=>u==null?void 0:u($.target.value),maxLength:7})}),m&&a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:j,disabled:n,title:"Random color","aria-label":"Random color",children:"🎲"})]}),y.length>0&&a.jsx("div",{className:"nice-color-picker__presets",children:y.map($=>a.jsx("div",{className:`nice-color-picker__preset ${f===$?"nice-color-picker__preset--active":""}`,style:{background:$},onClick:()=>u==null?void 0:u($),role:"button",tabIndex:0,"aria-label":$},$))})]}),r&&a.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{className:"nice-field__helper",children:e})]})});rt.displayName="NiceColorPicker";const me=s.forwardRef(({children:t,variant:e="primary",size:r="md",type:i="button",disabled:n,loading:o,fullWidth:c,onClick:l,leftIcon:d,rightIcon:p,className:f,style:u,id:y,accessMode:h,displayStyle:m,...v},D)=>{const w=Le(h,y);if(w==="hidden")return null;(w==="disabled"||w==="readOnly")&&(n=!0);const k=ft("button",m),b=at("button",m);return a.jsxs("button",{ref:D,type:i,id:y,className:`nice-btn nice-btn--${e} nice-btn--${r} nice-btn--ds-${b} ${c?"nice-btn--full-width":""} ${o?"nice-btn--loading":""} ${f||""}`,style:{...k,...u},disabled:n||o,"aria-busy":o||void 0,"aria-disabled":n||o||void 0,onClick:l,...v,children:[o&&a.jsx("svg",{className:"nice-btn__spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3","aria-hidden":"true",children:a.jsx("circle",{cx:"12",cy:"12",r:"10",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})}),!o&&d&&a.jsx("span",{"aria-hidden":"true",children:d}),a.jsx("span",{children:t}),!o&&p&&a.jsx("span",{"aria-hidden":"true",children:p})]})});me.displayName="NiceButton";const bd=(t,e)=>e,xd=s.createContext(bd);function Da(){return{t:s.useContext(xd)}}s.createContext({dir:"ltr",isRTL:!1,flip:t=>t,value:t=>t.ltr});s.createContext(null);s.createContext(null);const Ta=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,displayStyle:y,value:h,defaultValue:m,onChange:v,onBlur:D,onKeyDown:w,placeholder:k,rows:b=3,maxLength:C,resize:j="vertical",autoFocus:N,showCount:$,submitOnEnter:x,onSubmit:F,showKeyboardHints:I},P)=>{const A=Le(u,d);if(A==="hidden")return null;A==="disabled"&&(n=!0),A==="readOnly"&&(o=!0);const{t:E}=De(),M=Ee(d),W=ft("input",y),z=at("input",y),T=(h==null?void 0:h.length)??0,g=C?T>C:!1,_={key:"Enter",ctrl:!0,description:E("shortcuts.submit","Submit")},S=s.useCallback(L=>{x&&go(L,_)&&(L.preventDefault(),F==null||F()),w==null||w(L)},[x,F,w,_]),R=s.useMemo(()=>{const L=[];return x&&L.push(_),L.push({key:"Tab",description:E("shortcuts.indent","Indent (when supported)")}),L},[x,E,_]);return a.jsxs("div",{className:`nice-field ${p||""}`,style:f,children:[t&&a.jsxs("label",{htmlFor:M,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[t,I&&R.length>0&&a.jsx(Qe,{shortcuts:R,size:"sm"})]}),a.jsx("textarea",{ref:P,id:M,className:`nice-textarea nice-input--${c} nice-textarea--ds-${z} ${r?"nice-textarea--error":""} ${n?"nice-textarea--disabled":""}`,style:{...W,resize:j},name:l,value:h,defaultValue:m,placeholder:k,rows:b,maxLength:C,disabled:n,readOnly:o,autoFocus:N,"aria-invalid":!!r,"aria-describedby":r?`${M}-error`:e?`${M}-helper`:void 0,onChange:L=>v==null?void 0:v(L.target.value),onBlur:D,onKeyDown:S}),($||C)&&a.jsxs("div",{className:`nice-textarea__counter ${g?"nice-textarea__counter--over":""}`,children:[T,C?` / ${C}`:""]}),r&&a.jsx("div",{id:`${M}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{id:`${M}-helper`,className:"nice-field__helper",children:e})]})});Ta.displayName="NiceTextArea";const Fa=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,value:y,onChange:h,onBlur:m,onKeyDown:v,min:D,max:w,type:k="date",submitOnEnter:b,onSubmit:C,showKeyboardHints:j,displayStyle:N},$)=>{ft("input",N),at("input",N);const x=Le(u,d);if(x==="hidden")return null;x==="disabled"&&(n=!0),x==="readOnly"&&(o=!0);const{t:F}=De(),I=Ee(d),P=za({enabled:b,onSubmit:C}),A=s.useCallback(M=>{P(M),v==null||v(M)},[P,v]),E=s.useMemo(()=>{const M=[];return b&&M.push(Be.submit),M.push({key:"ArrowUp",description:F("shortcuts.increaseDate","Increase value")}),M.push({key:"ArrowDown",description:F("shortcuts.decreaseDate","Decrease value")}),M},[b,F]);return a.jsxs("div",{className:`nice-field ${p||""}`,style:f,children:[t&&a.jsxs("label",{htmlFor:I,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[t,j&&E.length>0&&a.jsx(Qe,{shortcuts:E,size:"sm"})]}),a.jsx("div",{className:`nice-input nice-input--${c} ${r?"nice-input--error":""} ${n?"nice-input--disabled":""} ${o?"nice-input--readonly":""}`,children:a.jsx("input",{ref:$,id:I,className:"nice-input__native",type:k,name:l,value:y??"",min:D,max:w,disabled:n,readOnly:o,"aria-invalid":!!r,onChange:M=>h==null?void 0:h(M.target.value),onBlur:m,onKeyDown:A})}),r&&a.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{className:"nice-field__helper",children:e})]})});Fa.displayName="NiceDatePicker";const pi=({label:t,helperText:e,error:r,required:i,disabled:n,size:o="md",name:c,id:l,className:d,style:p,accessMode:f,options:u,value:y,onChange:h,direction:m="horizontal",showKeyboardHints:v,displayStyle:D})=>{at("toggle",D);const w=Le(f,l);if(w==="hidden")return null;(w==="disabled"||w==="readOnly")&&(n=!0);const{t:k}=De(),b=Ee(l),C=c||b,j=s.useMemo(()=>[{key:"ArrowUp",description:k("shortcuts.previousOption","Previous option")},{key:"ArrowDown",description:k("shortcuts.nextOption","Next option")},{key:"Space",description:k("shortcuts.select","Select")}],[k]);return a.jsxs("div",{className:`nice-field ${d||""}`,style:p,role:"radiogroup","aria-labelledby":`${b}-label`,children:[t&&a.jsxs("span",{id:`${b}-label`,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[t,v&&a.jsx(Qe,{shortcuts:j,size:"sm"})]}),a.jsx("div",{className:`nice-radio-group ${m==="vertical"?"nice-radio-group--vertical":""}`,children:u.map(N=>a.jsxs("label",{className:`nice-radio ${n||N.disabled?"nice-radio--disabled":""}`,children:[a.jsx("input",{type:"radio",className:"nice-radio__input",name:C,value:N.value,checked:y===N.value,disabled:n||N.disabled,onChange:()=>h==null?void 0:h(N.value)}),a.jsx("span",{className:"nice-radio__circle",children:a.jsx("span",{className:"nice-radio__dot"})}),a.jsx("span",{children:N.label})]},N.value))}),r&&a.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{className:"nice-field__helper",children:e})]})},xt=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,id:o,className:c,style:l,accessMode:d,value:p=0,onChange:f,min:u=0,max:y=100,step:h=1,showValue:m=!0,showMinMax:v=!1,formatValue:D,showKeyboardHints:w,displayStyle:k},b)=>{at("input",k);const C=Le(d,o);if(C==="hidden")return null;(C==="disabled"||C==="readOnly")&&(n=!0),De();const j=Ee(o),N=s.useMemo(()=>(p-u)/(y-u)*100,[p,u,y]),$=D?D(p):p.toString(),x=s.useMemo(()=>[Be.increment,Be.decrement,Be.first,Be.last,Be.incrementBig,Be.decrementBig],[]);return a.jsxs("div",{className:`nice-field ${c||""}`,style:l,children:[(t||m||w)&&a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t&&a.jsxs("label",{htmlFor:j,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[t,w&&a.jsx(Qe,{shortcuts:x,size:"sm"})]}),m&&a.jsx("span",{className:"nice-slider__value",children:$})]}),a.jsxs("div",{className:`nice-slider ${n?"nice-slider--disabled":""}`,children:[a.jsxs("div",{className:"nice-slider__track-wrapper",children:[a.jsx("div",{className:"nice-slider__track",children:a.jsx("div",{className:"nice-slider__fill",style:{width:`${N}%`}})}),a.jsx("input",{ref:b,id:j,type:"range",className:"nice-slider__native",min:u,max:y,step:h,value:p,disabled:n,"aria-valuenow":p,"aria-valuemin":u,"aria-valuemax":y,onChange:F=>f==null?void 0:f(parseFloat(F.target.value))}),a.jsx("div",{className:"nice-slider__thumb-visual",style:{left:`${N}%`}})]}),v&&a.jsxs("div",{className:"nice-slider__labels",children:[a.jsx("span",{children:D?D(u):u}),a.jsx("span",{children:D?D(y):y})]})]}),r&&a.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{className:"nice-field__helper",children:e})]})});xt.displayName="NiceSlider";function xr(t,e,r){return Math.max(e,Math.min(r,t))}function mi({h:t,s:e,v:r}){t=(t%360+360)%360;const i=r*e,n=i*(1-Math.abs(t/60%2-1)),o=r-i;let c=0,l=0,d=0;return t<60?(c=i,l=n):t<120?(c=n,l=i):t<180?(l=i,d=n):t<240?(l=n,d=i):t<300?(c=n,d=i):(c=i,d=n),{r:Math.round((c+o)*255),g:Math.round((l+o)*255),b:Math.round((d+o)*255)}}function Ra({r:t,g:e,b:r}){t/=255,e/=255,r/=255;const i=Math.max(t,e,r),n=Math.min(t,e,r),o=i-n;let c=0;return o!==0&&(i===t?c=(e-r)/o%6:i===e?c=(r-t)/o+2:c=(t-e)/o+4,c=(c*60+360)%360),{h:c,s:i===0?0:o/i,v:i}}function fi({r:t,g:e,b:r}){t/=255,e/=255,r/=255;const i=Math.max(t,e,r),n=Math.min(t,e,r),o=(i+n)/2;if(i===n)return{h:0,s:0,l:o};const c=i-n,l=o>.5?c/(2-i-n):c/(i+n);let d=0;return i===t?d=((e-r)/c+(e<r?6:0))/6:i===e?d=((r-t)/c+2)/6:d=((t-e)/c+4)/6,{h:d*360,s:l,l:o}}function Ht(t){const e=t.replace("#",""),r=e.length===3?e[0]+e[0]+e[1]+e[1]+e[2]+e[2]:e,i=parseInt(r,16);return{r:i>>16&255,g:i>>8&255,b:i&255}}function hi({r:t,g:e,b:r}){return"#"+[t,e,r].map(i=>i.toString(16).padStart(2,"0")).join("")}function mt(t){return hi(mi(t))}function It(t){return Ra(Ht(t))}function gi(t,e){const r=[];for(let i=0;i<e;i++){const n=e<=1?.5:i/(e-1),o=xr(t.s*(.3+n*.7),0,1),c=xr(t.v*(1.2-n*.7),0,1);r.push(mt({h:t.h,s:o,v:c}))}return r}function Ia(t,e){const r=e??30;switch(t){case"monochromatic":return[0];case"complementary":return[0,180];case"split-complementary":return[0,180-r,180+r];case"analogous":return[0,-r,r];case"triadic":return[0,120,240];case"tetradic":return[0,60,180,240];case"square":return[0,90,180,270]}}function Lt(t,e,r){return Ia(e,r).map(i=>((t+i)%360+360)%360)}function vr({r:t,g:e,b:r}){const[i,n,o]=[t,e,r].map(c=>{const l=c/255;return l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4)});return .2126*i+.7152*n+.0722*o}function Xt(t,e){const r=vr(Ht(t)),i=vr(Ht(e)),n=Math.max(r,i),o=Math.min(r,i);return(n+.05)/(o+.05)}function Jt(t){return t>=7?"AAA":t>=4.5?"AA":t>=3?"AA-lg":"Fail"}const yi={"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(t,e){const r=yi[e];return t.map(i=>{const n=(r.sRange[0]+r.sRange[1])/2,o=(r.vRange[0]+r.vRange[1])/2;return mt({h:i,s:n,v:o})})}function vd(){return Math.floor(Math.random()*360)}function bi(t,e,r){const i=vd(),n=Lt(i,t,r),o=[];for(let c=0;c<e;c++){const l=n[c%n.length],d=.55+Math.random()*.4,p=.5+Math.random()*.45;o.push(mt({h:l+(Math.random()-.5)*8,s:d,v:p}))}return o}const kd=({hues:t,baseHue:e,onBaseHueChange:r,mode:i,distance:n,disabled:o})=>{const c=s.useCallback(u=>{if(o)return;const y=u.currentTarget.getBoundingClientRect(),h=u.clientX-y.left-120,m=u.clientY-y.top-120,v=(Math.atan2(m,h)*180/Math.PI+360)%360;r(Math.round(v))},[120,120,o,r]),l=[];for(let u=0;u<360;u+=2){const y=(u-1)*Math.PI/180,h=(u+1)*Math.PI/180,m=mt({h:u,s:1,v:1});l.push(a.jsx("path",{d:`M${120+55*Math.cos(y)},${120+55*Math.sin(y)} L${120+110*Math.cos(y)},${120+110*Math.sin(y)} A110,110 0 0,1 ${120+110*Math.cos(h)},${120+110*Math.sin(h)} L${120+55*Math.cos(h)},${120+55*Math.sin(h)} A55,55 0 0,0 ${120+55*Math.cos(y)},${120+55*Math.sin(y)} Z`,fill:m},u))}const d=`wheel-center-${i}`,p=t.map((u,y)=>{const h=u*Math.PI/180;return a.jsx("circle",{cx:120+82.5*Math.cos(h),cy:120+82.5*Math.sin(h),r:y===0?8:6,fill:mt({h:u,s:.85,v:.9}),stroke:y===0?"#fff":"#ccc",strokeWidth:y===0?3:2},y)});let f=null;if(i==="analogous"||i==="split-complementary"){const u=Ia(i,n).slice(1).map((y,h)=>{const m=(e+y)*Math.PI/180;return a.jsx("line",{x1:120,y1:120,x2:120+82.5*Math.cos(m),y2:120+82.5*Math.sin(m),stroke:"rgba(255,255,255,0.3)",strokeWidth:1,strokeDasharray:"3,3"},`dline-${h}`)});f=a.jsx(a.Fragment,{children:u})}return a.jsxs("svg",{className:"nice-palette__wheel",viewBox:"0 0 240 240",width:240,height:240,onClick:c,style:{cursor:o?"default":"crosshair"},children:[a.jsx("defs",{children:a.jsxs("radialGradient",{id:d,children:[a.jsx("stop",{offset:"0%",stopColor:"#fff"}),a.jsx("stop",{offset:"100%",stopColor:"transparent"})]})}),l,a.jsx("circle",{cx:120,cy:120,r:53,fill:mt({h:e,s:.6,v:.85})}),a.jsx("circle",{cx:120,cy:120,r:53,fill:`url(#${d})`,opacity:.4}),f,p]})},wd=({colors:t})=>{if(t.length<2)return null;const e=[];for(let r=0;r<t.length;r++){const i=Xt(t[r],"#ffffff"),n=Xt(t[r],"#000000");e.push({a:t[r],b:"#ffffff",ratio:i,level:Jt(i)}),e.push({a:t[r],b:"#000000",ratio:n,level:Jt(n)});for(let o=r+1;o<t.length;o++){const c=Xt(t[r],t[o]);e.push({a:t[r],b:t[o],ratio:c,level:Jt(c)})}}return a.jsxs("div",{className:"nice-palette__contrast",children:[a.jsx("div",{className:"nice-palette__section-title",children:"Contrast Analysis (WCAG 2.1)"}),a.jsx("div",{className:"nice-palette__contrast-grid",children:e.map((r,i)=>a.jsxs("div",{className:"nice-palette__contrast-pair",children:[a.jsxs("div",{className:"nice-palette__contrast-swatches",children:[a.jsx("span",{className:"nice-palette__contrast-dot",style:{background:r.a}}),a.jsx("span",{className:"nice-palette__contrast-vs",children:"vs"}),a.jsx("span",{className:"nice-palette__contrast-dot",style:{background:r.b}})]}),a.jsxs("span",{className:"nice-palette__contrast-ratio",children:[r.ratio.toFixed(1),":1"]}),a.jsx("span",{className:`nice-palette__contrast-level nice-palette__contrast-level--${r.level.toLowerCase().replace("-","")}`,children:r.level})]},i))})]})},_d=({hex:t})=>{const e=Ht(t),r=fi(e),i=Ra(e);return a.jsxs("div",{className:"nice-palette__color-info",children:[a.jsxs("div",{children:[a.jsx("strong",{children:"HEX"})," ",t.toUpperCase()]}),a.jsxs("div",{children:[a.jsx("strong",{children:"RGB"})," ",e.r,", ",e.g,", ",e.b]}),a.jsxs("div",{children:[a.jsx("strong",{children:"HSL"})," ",Math.round(r.h),"°, ",Math.round(r.s*100),"%, ",Math.round(r.l*100),"%"]}),a.jsxs("div",{children:[a.jsx("strong",{children:"HSV"})," ",Math.round(i.h),"°, ",Math.round(i.s*100),"%, ",Math.round(i.v*100),"%"]})]})},kr={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"},Sd=["monochromatic","complementary","split-complementary","analogous","triadic","tetradic","square"],jd=["lightest-pastel","bright-pastel","shiny","pastel","full","dark","deep","muted","earth"],Pa=s.forwardRef(({id:t,className:e,style:r,accessMode:i,value:n,onChange:o,minColors:c=1,maxColors:l=8,harmonyMode:d,onHarmonyModeChange:p,distance:f,onDistanceChange:u,preset:y,onPresetChange:h,showWheel:m=!0,showContrast:v=!0,showInfo:D=!0,showPresets:w=!0,showVariations:k=!0,showRandom:b=!0,variationCount:C=5,label:j,disabled:N},$)=>{const x=Le(i,t);if(x==="hidden")return null;(x==="disabled"||x==="readOnly")&&(N=!0);const F=Ee(t),[I,P]=s.useState("analogous"),[A,E]=s.useState(30),[M,W]=s.useState(""),[z,T]=s.useState(0),g=d??I,_=f??A,S=y??M,R=s.useCallback(X=>{P(X),p==null||p(X)},[p]),L=s.useCallback(X=>{E(X),u==null||u(X)},[u]),O=s.useCallback(X=>{W(X),X&&(h==null||h(X))},[h]),Y=s.useMemo(()=>["#3b82f6","#ef4444","#22c55e"],[]),G=n&&n.length>0?n:Y,B=G[0],K=s.useMemo(()=>It(B),[B]),J=s.useMemo(()=>Lt(K.h,g,_),[K.h,g,_]),he=s.useCallback((X,Q,fe,Se)=>{const be=Lt(X,Q,fe);let ie;for(Se&&yi[Se]?ie=Qt(be,Se):ie=be.map(je=>mt({h:je,s:K.s||.7,v:K.v||.85}));ie.length<c;)ie.push(ie[ie.length-1]||"#888888");ie.length>l&&(ie=ie.slice(0,l)),o==null||o(ie)},[K.s,K.v,c,l,o]),pe=s.useCallback(X=>{N||he(X,g,_,S)},[N,g,_,S,he]),we=s.useCallback(X=>{N||(R(X),he(K.h,X,_,S))},[N,K.h,_,S,R,he]),se=s.useCallback(X=>{N||(L(X),he(K.h,g,X,S))},[N,K.h,g,S,L,he]),Ce=s.useCallback(X=>{if(N)return;O(X);const Q=Lt(K.h,g,_),fe=Qt(Q,X);o==null||o(fe.slice(0,l))},[N,K.h,g,_,l,O,o]),ee=s.useCallback((X,Q)=>{if(N)return;const fe=[...G];fe[X]=Q,o==null||o(fe)},[N,G,o]),de=s.useCallback(()=>{if(N||G.length>=l)return;const X=It(G[G.length-1]),Q=mt({h:(X.h+30)%360,s:X.s,v:X.v});o==null||o([...G,Q])},[N,G,l,o]),xe=s.useCallback(X=>{if(N||G.length<=c)return;const Q=G.filter((fe,Se)=>Se!==X);o==null||o(Q),z>=Q.length&&T(Math.max(0,Q.length-1))},[N,G,c,o,z]),$e=s.useCallback(()=>{if(N)return;const X=Math.max(c,Math.min(l,Ia(g).length)),Q=bi(g,X,_);o==null||o(Q)},[N,c,l,g,_,o]),Ne=s.useMemo(()=>{if(!k)return[];const X=G[z]||G[0];return gi(It(X),C)},[k,G,z,C]),U=G[z]||G[0],Z=s.useMemo(()=>{const X=It(U);return mt({h:(X.h+180)%360,s:X.s,v:X.v})},[U]);return a.jsxs("div",{ref:$,id:F,className:`nice-palette ${N?"nice-palette--disabled":""} ${e||""}`,style:r,children:[j&&a.jsx("div",{className:"nice-palette__label",children:j}),a.jsx("div",{className:"nice-palette__modes",children:Sd.map(X=>a.jsx("button",{type:"button",className:`nice-palette__mode-btn ${g===X?"nice-palette__mode-btn--active":""}`,onClick:()=>we(X),disabled:N,title:kr[X],children:kr[X]},X))}),a.jsxs("div",{className:"nice-palette__main",children:[m&&a.jsxs("div",{className:"nice-palette__wheel-container",children:[a.jsx(kd,{hues:J,baseHue:K.h,onBaseHueChange:pe,mode:g,distance:_,disabled:N}),(g==="analogous"||g==="split-complementary")&&a.jsxs("div",{className:"nice-palette__distance",children:[a.jsxs("label",{children:["Distance: ",_,"°"]}),a.jsx("input",{type:"range",min:10,max:90,value:_,onChange:X=>se(Number(X.target.value)),disabled:N,className:"nice-palette__distance-slider"})]})]}),a.jsxs("div",{className:"nice-palette__strips",children:[a.jsxs("div",{className:"nice-palette__swatches",children:[G.map((X,Q)=>a.jsxs("div",{className:`nice-palette__swatch-wrapper ${z===Q?"nice-palette__swatch-wrapper--selected":""}`,onClick:()=>T(Q),children:[a.jsx("div",{className:"nice-palette__swatch",style:{background:X},children:G.length>c&&a.jsx("button",{type:"button",className:"nice-palette__swatch-remove",onClick:fe=>{fe.stopPropagation(),xe(Q)},disabled:N,"aria-label":"Remove color",children:"×"})}),a.jsx("input",{type:"text",className:"nice-palette__hex-input",value:X.toUpperCase(),maxLength:7,disabled:N,onChange:fe=>ee(Q,fe.target.value)})]},Q)),G.length<l&&a.jsx("button",{type:"button",className:"nice-palette__add-btn",onClick:de,disabled:N,title:"Add color",children:"+"})]}),a.jsxs("div",{className:"nice-palette__complementary",children:[a.jsx("span",{className:"nice-palette__section-tag",children:"Complementary"}),a.jsx("div",{className:"nice-palette__swatch nice-palette__swatch--sm",style:{background:Z},title:Z.toUpperCase()}),a.jsx("span",{className:"nice-palette__hex-label",children:Z.toUpperCase()})]}),k&&Ne.length>0&&a.jsxs("div",{className:"nice-palette__variations",children:[a.jsx("span",{className:"nice-palette__section-tag",children:"Tints & Shades"}),a.jsx("div",{className:"nice-palette__variation-strip",children:Ne.map((X,Q)=>a.jsx("div",{className:"nice-palette__variation-chip",style:{background:X},title:X.toUpperCase(),onClick:()=>{N||ee(z,X)},role:"button",tabIndex:0},Q))})]}),b&&a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-palette__random-btn",onClick:$e,disabled:N,title:"Random palette","aria-label":"Random palette",children:"🎲 Random Palette"})]})]}),w&&a.jsxs("div",{className:"nice-palette__presets",children:[a.jsx("div",{className:"nice-palette__section-title",children:"Style Presets"}),a.jsx("div",{className:"nice-palette__preset-grid",children:jd.map(X=>{const Q=Qt(J,X);return a.jsxs("button",{type:"button",className:`nice-palette__preset-card ${S===X?"nice-palette__preset-card--active":""}`,onClick:()=>Ce(X),disabled:N,children:[a.jsx("div",{className:"nice-palette__preset-strip",children:Q.map((fe,Se)=>a.jsx("span",{className:"nice-palette__preset-dot",style:{background:fe}},Se))}),a.jsx("span",{className:"nice-palette__preset-label",children:Cd[X]})]},X)})})]}),D&&a.jsxs("div",{className:"nice-palette__info-panel",children:[a.jsx("div",{className:"nice-palette__section-title",children:"Selected Color Info"}),a.jsx(_d,{hex:U})]}),v&&a.jsx(wd,{colors:G})]})});Pa.displayName="NiceColorPalette";function ka(){return{type:"linear",angle:90,stops:[{color:"#3b82f6",position:0},{color:"#8b5cf6",position:100}]}}function wa(t){const e=t.stops.slice().sort((i,n)=>i.position-n.position).map(i=>`${i.color} ${i.position}%`).join(", "),r=t.repeating?"repeating-":"";switch(t.type){case"linear":return`${r}linear-gradient(${t.angle}deg, ${e})`;case"radial":{const i=t.shape||"ellipse",n=t.size||"farthest-corner",o=t.positionX??50,c=t.positionY??50;return`${r}radial-gradient(${i} ${n} at ${o}% ${c}%, ${e})`}case"conic":{const i=t.angle??0,n=t.positionX??50,o=t.positionY??50;return`${r}conic-gradient(from ${i}deg at ${n}% ${o}%, ${e})`}}}function xi(t){var i,n,o;const e=t.trim(),r=e.startsWith("repeating-");if(e.includes("linear-gradient")){const c=(i=e.match(/linear-gradient\((.+)\)/))==null?void 0:i[1];if(!c)return null;const l=c.split(",").map(y=>y.trim());let d=90,p=0;const f=l[0].match(/^(\d+)deg$/);f&&(d=parseInt(f[1]),p=1);const u=pa(l.slice(p));return{type:"linear",angle:d,repeating:r,stops:u}}if(e.includes("radial-gradient")){const c=(n=e.match(/radial-gradient\((.+)\)/))==null?void 0:n[1];if(!c)return null;const l=c.split(",").map(p=>p.trim()),d=pa(l.filter(p=>p.includes("#")||p.includes("rgb")));return{type:"radial",angle:0,repeating:r,stops:d.length>=2?d:ka().stops}}if(e.includes("conic-gradient")){const c=(o=e.match(/conic-gradient\((.+)\)/))==null?void 0:o[1];if(!c)return null;const l=c.split(",").map(p=>p.trim()),d=pa(l.filter(p=>p.includes("#")||p.includes("rgb")));return{type:"conic",angle:0,repeating:r,stops:d.length>=2?d:ka().stops}}return null}function pa(t){return t.map((e,r,i)=>{const n=e.match(/^(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\))\s*(\d+%?)?$/);if(n){const o=n[2]?parseFloat(n[2]):r/Math.max(1,i.length-1)*100;return{color:n[1],position:o}}return{color:e,position:r/Math.max(1,i.length-1)*100}})}function Nd(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}function Md(t=2){const e=["linear","radial","conic"],r=e[Math.floor(Math.random()*e.length)],i=[];for(let n=0;n<t;n++)i.push({color:Nd(),position:Math.round(n/(t-1)*100)});return{type:r,angle:Math.floor(Math.random()*360),stops:i,shape:r==="radial"?Math.random()>.5?"circle":"ellipse":void 0,positionX:r!=="linear"?Math.round(Math.random()*100):void 0,positionY:r!=="linear"?Math.round(Math.random()*100):void 0}}const vi=[{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}}],La=s.forwardRef(({id:t,className:e,style:r,accessMode:i,value:n,onChange:o,showCssOutput:c=!0,showPresets:l=!0,showRandom:d=!0,maxStops:p=10,label:f,disabled:u},y)=>{const h=Le(i,t);if(h==="hidden")return null;(h==="disabled"||h==="readOnly")&&(u=!0);const m=Ee(t),v=n??ka(),D=s.useMemo(()=>wa(v),[v]),[w,k]=s.useState(0),[b,C]=s.useState(""),j=s.useRef(null),N=s.useCallback(g=>{o==null||o(g)},[o]),$=s.useCallback(g=>{u||N({...v,type:g})},[u,v,N]),x=s.useCallback(g=>{u||N({...v,angle:g})},[u,v,N]),F=s.useCallback(g=>{u||N({...v,repeating:g})},[u,v,N]),I=s.useCallback(g=>{u||N({...v,shape:g})},[u,v,N]),P=s.useCallback((g,_)=>{if(u)return;const S=v.stops.map((R,L)=>L===g?{...R,..._}:R);N({...v,stops:S})},[u,v,N]),A=s.useCallback(()=>{if(u||v.stops.length>=p)return;const g=v.stops.slice().sort((O,Y)=>O.position-Y.position);let _=0,S=g[0];for(let O=0;O<g.length-1;O++){const Y=g[O+1].position-g[O].position;Y>_&&(_=Y,S=g[O])}const R=Math.round(S.position+_/2),L="#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0");N({...v,stops:[...v.stops,{color:L,position:R}]})},[u,v,p,N]),E=s.useCallback(g=>{if(u||v.stops.length<=2)return;const _=v.stops.filter((S,R)=>R!==g);N({...v,stops:_}),w>=_.length&&k(_.length-1)},[u,v,w,N]),M=s.useCallback(()=>{if(u)return;const g=2+Math.floor(Math.random()*3);N(Md(g))},[u,N]),W=s.useCallback(()=>{if(u||!b.trim())return;const g=xi(b);g&&N(g)},[u,b,N]),z=s.useCallback(g=>{if(u||!j.current||v.stops.length>=p)return;const _=j.current.getBoundingClientRect(),S=Math.round((g.clientX-_.left)/_.width*100),R="#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0"),L=[...v.stops,{color:R,position:S}];N({...v,stops:L}),k(L.length-1)},[u,v,p,N]),T=s.useMemo(()=>v.stops.slice().sort((g,_)=>g.position-_.position),[v.stops]);return a.jsxs("div",{ref:y,id:m,className:`nice-gradient ${u?"nice-gradient--disabled":""} ${e||""}`,style:r,children:[f&&a.jsx("div",{className:"nice-gradient__label",children:f}),a.jsx("div",{className:"nice-gradient__preview",style:{background:D}}),a.jsxs("div",{className:"nice-gradient__type-row",children:[["linear","radial","conic"].map(g=>a.jsx("button",{type:"button",className:`nice-gradient__type-btn ${v.type===g?"nice-gradient__type-btn--active":""}`,onClick:()=>$(g),disabled:u,children:g.charAt(0).toUpperCase()+g.slice(1)},g)),a.jsxs("label",{className:"nice-gradient__repeat-label",children:[a.jsx("input",{type:"checkbox",checked:v.repeating??!1,onChange:g=>F(g.target.checked),disabled:u}),"Repeating"]})]}),a.jsxs("div",{className:"nice-gradient__controls",children:[v.type==="linear"&&a.jsxs("div",{className:"nice-gradient__control-group",children:[a.jsxs("label",{children:["Angle: ",v.angle,"°"]}),a.jsx("input",{type:"range",min:0,max:360,value:v.angle,onChange:g=>x(Number(g.target.value)),disabled:u,className:"nice-gradient__slider"}),a.jsx("div",{className:"nice-gradient__angle-presets",children:[0,45,90,135,180,225,270,315].map(g=>a.jsx("button",{type:"button",className:`nice-gradient__angle-btn ${v.angle===g?"nice-gradient__angle-btn--active":""}`,onClick:()=>x(g),disabled:u,title:`${g}°`,children:a.jsx("span",{style:{transform:`rotate(${g}deg)`,display:"inline-block"},children:"→"})},g))})]}),v.type==="radial"&&a.jsxs("div",{className:"nice-gradient__control-group",children:[a.jsx("label",{children:"Shape:"}),a.jsx("div",{className:"nice-gradient__shape-btns",children:["circle","ellipse"].map(g=>a.jsx("button",{type:"button",className:`nice-gradient__shape-btn ${(v.shape||"ellipse")===g?"nice-gradient__shape-btn--active":""}`,onClick:()=>I(g),disabled:u,children:g},g))})]}),(v.type==="radial"||v.type==="conic")&&a.jsxs("div",{className:"nice-gradient__control-group",children:[a.jsxs("label",{children:["Center: ",v.positionX??50,"%, ",v.positionY??50,"%"]}),a.jsxs("div",{className:"nice-gradient__center-inputs",children:[a.jsx("input",{type:"range",min:0,max:100,value:v.positionX??50,onChange:g=>N({...v,positionX:Number(g.target.value)}),disabled:u,className:"nice-gradient__slider"}),a.jsx("input",{type:"range",min:0,max:100,value:v.positionY??50,onChange:g=>N({...v,positionY:Number(g.target.value)}),disabled:u,className:"nice-gradient__slider"})]})]}),v.type==="conic"&&a.jsxs("div",{className:"nice-gradient__control-group",children:[a.jsxs("label",{children:["Start angle: ",v.angle,"°"]}),a.jsx("input",{type:"range",min:0,max:360,value:v.angle,onChange:g=>x(Number(g.target.value)),disabled:u,className:"nice-gradient__slider"})]})]}),a.jsxs("div",{className:"nice-gradient__bar-container",children:[a.jsx("div",{ref:j,className:"nice-gradient__bar",style:{background:D},onClick:z,children:v.stops.map((g,_)=>a.jsx("div",{className:`nice-gradient__stop-marker ${w===_?"nice-gradient__stop-marker--active":""}`,style:{left:`${g.position}%`},onClick:S=>{S.stopPropagation(),k(_)},title:`${g.color} @ ${g.position}%`,children:a.jsx("div",{className:"nice-gradient__stop-dot",style:{background:g.color}})},_))}),a.jsx("button",{type:"button",className:"nice-gradient__add-stop",onClick:A,disabled:u||v.stops.length>=p,title:"Add stop",children:"+"})]}),a.jsx("div",{className:"nice-gradient__stop-editor",children:a.jsx("div",{className:"nice-gradient__stop-list",children:T.map((g,_)=>{const S=v.stops.indexOf(g);return a.jsxs("div",{className:`nice-gradient__stop-row ${w===S?"nice-gradient__stop-row--active":""}`,onClick:()=>k(S),children:[a.jsx("input",{type:"color",value:g.color,onChange:R=>P(S,{color:R.target.value}),disabled:u,className:"nice-gradient__stop-color"}),a.jsx("input",{type:"text",value:g.color.toUpperCase(),maxLength:7,onChange:R=>P(S,{color:R.target.value}),disabled:u,className:"nice-gradient__stop-hex"}),a.jsx("input",{type:"number",min:0,max:100,value:g.position,onChange:R=>P(S,{position:Number(R.target.value)}),disabled:u,className:"nice-gradient__stop-pos"}),a.jsx("span",{className:"nice-gradient__stop-pct",children:"%"}),v.stops.length>2&&a.jsx("button",{type:"button",className:"nice-gradient__stop-del",onClick:()=>E(S),disabled:u,"aria-label":"Remove stop",children:"×"})]},S)})})}),d&&a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-gradient__random-btn",onClick:M,disabled:u,title:"Random gradient","aria-label":"Random gradient",children:"🎲 Random Gradient"}),l&&a.jsxs("div",{className:"nice-gradient__presets",children:[a.jsx("div",{className:"nice-gradient__section-title",children:"Presets"}),a.jsx("div",{className:"nice-gradient__preset-grid",children:vi.map((g,_)=>a.jsxs("button",{type:"button",className:"nice-gradient__preset-card",onClick:()=>{u||N(g.value)},disabled:u,title:g.name,children:[a.jsx("div",{className:"nice-gradient__preset-preview",style:{background:wa(g.value)}}),a.jsx("span",{className:"nice-gradient__preset-name",children:g.name})]},_))})]}),c&&a.jsxs("div",{className:"nice-gradient__css",children:[a.jsx("div",{className:"nice-gradient__section-title",children:"CSS Output"}),a.jsxs("div",{className:"nice-gradient__css-output",children:[a.jsx("code",{children:`background: ${D};`}),a.jsx("button",{type:"button",className:"nice-gradient__copy-btn",onClick:()=>{var g;return(g=navigator.clipboard)==null?void 0:g.writeText(`background: ${D};`)},title:"Copy CSS",children:"📋"})]}),a.jsxs("div",{className:"nice-gradient__css-import",children:[a.jsx("input",{type:"text",className:"nice-gradient__css-input",placeholder:"Paste CSS gradient to import...",value:b,onChange:g=>C(g.target.value),disabled:u}),a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",onClick:W,disabled:u,children:"Import"})]})]})]})});La.displayName="NiceGradientPicker";function zd({text:t,query:e}){if(!e)return a.jsx(a.Fragment,{children:t});const r=t.toLowerCase().indexOf(e.toLowerCase());return r<0?a.jsx(a.Fragment,{children:t}):a.jsxs(a.Fragment,{children:[t.slice(0,r),a.jsx("strong",{children:t.slice(r,r+e.length)}),t.slice(r+e.length)]})}const ki=({options:t,value:e,onChange:r,minSearchLength:i=1,maxResults:n=10,onSearch:o,clearable:c,loading:l,multiple:d,renderOption:p,highlightMatch:f=!0,label:u,error:y,helperText:h,required:m,disabled:v,size:D="md",id:w,className:k,style:b,accessMode:C,showKeyboardHints:j,displayStyle:N})=>{ft("input",N),at("input",N);const $=Le(C,w);if($==="hidden")return null;($==="disabled"||$==="readOnly")&&(v=!0);const x=Ee(w),{t:F}=De(),I=s.useMemo(()=>d?Array.isArray(e)?e:e?[e]:[]:[],[e,d]),[P,A]=s.useState(d||Array.isArray(e)?"":e),[E,M]=s.useState(!1),[W,z]=s.useState(-1),T=s.useRef(null),g=s.useRef(null);vt(T,()=>M(!1));const _=s.useMemo(()=>{const B=[Be.moveDown,Be.moveUp,Be.submit,Be.cancel];return d&&B.push({key:"Backspace",description:F("shortcuts.removeLastTag","Remove last tag")}),B},[d,F]);s.useEffect(()=>{d||A(Array.isArray(e)?"":e)},[e,d]);const S=s.useMemo(()=>{if(P.length<i)return[];if(o)return t.slice(0,n);const B=P.toLowerCase();return t.filter(K=>K.label.toLowerCase().includes(B)).slice(0,n)},[t,P,i,n,o]),R=s.useMemo(()=>{const B=new Map;for(const K of S){const J=K.group||"";B.has(J)||B.set(J,[]),B.get(J).push(K)}return B},[S]),L=s.useCallback(B=>{A(B),M(B.length>=i),z(-1),o==null||o(B)},[i,o]),O=s.useCallback(B=>{if(d){const K=String(B.value),J=I.includes(K)?I.filter(he=>he!==K):[...I,K];r==null||r(J),A("")}else A(B.label),r==null||r(String(B.value)),M(!1)},[r,d,I]),Y=B=>{if(d&&B.key==="Backspace"&&!P&&I.length>0){r==null||r(I.slice(0,-1));return}E&&(B.key==="ArrowDown"?(B.preventDefault(),z(K=>Math.min(K+1,S.length-1))):B.key==="ArrowUp"?(B.preventDefault(),z(K=>Math.max(K-1,0))):B.key==="Enter"&&W>=0?(B.preventDefault(),O(S[W])):B.key==="Escape"&&M(!1))},G=s.useCallback(B=>{r==null||r(I.filter(K=>K!==B))},[I,r]);return a.jsxs("div",{className:`nice-field nice-field--${D} ${y?"nice-field--error":""} ${k||""}`,style:b,ref:T,children:[u&&a.jsxs("label",{className:"nice-field__label",htmlFor:x,children:[u,m&&a.jsx("span",{className:"nice-field__required",children:"*"}),j&&a.jsx(Qe,{shortcuts:_,size:"sm"})]}),a.jsxs("div",{className:"nice-field__input-wrap",style:d?{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"}:void 0,children:[d&&I.map(B=>{const K=t.find(J=>String(J.value)===B);return a.jsxs("span",{className:"nice-autocomplete__tag",children:[(K==null?void 0:K.label)||B,a.jsx("button",{type:"button",className:"nice-autocomplete__tag-remove",onClick:()=>G(B),children:"✕"})]},B)}),a.jsx("input",{ref:g,id:x,type:"text",className:"nice-input",value:P,onChange:B=>L(B.target.value),onFocus:()=>P.length>=i&&M(!0),onKeyDown:Y,disabled:v,required:m,role:"combobox","aria-expanded":E,"aria-autocomplete":"list",autoComplete:"off",style:d?{flex:1,minWidth:60,border:"none",outline:"none"}:void 0}),c&&!d&&P&&!v&&a.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>{A(""),r==null||r("")},"aria-label":F("controls.clear","Clear"),children:"✕"}),l&&a.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)"}})]}),E&&S.length>0&&a.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:Array.from(R.entries()).map(([B,K])=>a.jsxs(s.Fragment,{children:[B&&a.jsx("li",{className:"nice-dropdown__group-label",children:B}),K.map(J=>{const he=S.indexOf(J)===W,pe=d&&I.includes(String(J.value));return a.jsx("li",{role:"option",className:`nice-dropdown__option ${he?"nice-dropdown__option--active":""} ${pe?"nice-dropdown__option--selected":""}`,onMouseDown:we=>{we.preventDefault(),O(J)},"aria-selected":he,children:p?p(J,P):f?a.jsx(zd,{text:J.label,query:P}):J.label},String(J.value))})]},B))}),y&&a.jsx("div",{className:"nice-field__error",children:y}),h&&!y&&a.jsx("div",{className:"nice-field__hint",children:h})]})},wi=({options:t,value:e,onChange:r,searchable:i=!0,clearable:n,loading:o,placeholder:c,label:l,error:d,helperText:p,required:f,disabled:u,size:y="md",id:h,className:m,style:v})=>{const D=Ee(h),{t:w}=De(),[k,b]=s.useState(!1),[C,j]=s.useState(""),N=s.useRef(null);vt(N,()=>b(!1));const $=t.find(F=>String(F.value)===e),x=s.useMemo(()=>{if(!C)return t;const F=C.toLowerCase();return t.filter(I=>I.label.toLowerCase().includes(F))},[t,C]);return a.jsxs("div",{className:`nice-field nice-field--${y} ${d?"nice-field--error":""} ${m||""}`,style:v,ref:N,children:[l&&a.jsxs("label",{className:"nice-field__label",htmlFor:D,children:[l,f&&a.jsx("span",{className:"nice-field__required",children:"*"})]}),a.jsxs("div",{className:"nice-field__input-wrap",children:[a.jsxs("button",{type:"button",id:D,className:"nice-select__trigger",onClick:()=>!u&&b(!k),disabled:u,children:[a.jsx("span",{children:($==null?void 0:$.label)||c||w("controls.select","Select...")}),a.jsx("span",{className:"nice-select__arrow",children:"▾"})]}),n&&e&&!u&&a.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>r(""),"aria-label":w("controls.clear","Clear"),children:"✕"})]}),k&&a.jsxs("div",{className:"nice-dropdown",children:[i&&a.jsx("div",{className:"nice-dropdown__search",children:a.jsx("input",{type:"text",value:C,onChange:F=>j(F.target.value),placeholder:w("controls.search","Search..."),autoFocus:!0})}),a.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:x.length===0?a.jsx("li",{className:"nice-dropdown__empty",children:w("controls.noResults","No results")}):x.map(F=>a.jsx("li",{role:"option",className:`nice-dropdown__option ${String(F.value)===e?"nice-dropdown__option--selected":""}`,onClick:()=>{r(String(F.value)),b(!1),j("")},"aria-selected":String(F.value)===e,children:F.label},String(F.value)))})]}),d&&a.jsx("div",{className:"nice-field__error",children:d}),p&&!d&&a.jsx("div",{className:"nice-field__hint",children:p})]})},$d=["Su","Mo","Tu","We","Th","Fr","Sa"];function Ed(t,e){return new Date(t,e+1,0).getDate()}function Ad(t,e){return new Date(t,e,1).getDay()}function wr(t,e,r){return`${t}-${String(e+1).padStart(2,"0")}-${String(r).padStart(2,"0")}`}function Dd(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const r=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-r.getTime())/864e5+1)/7)}const _r=["January","February","March","April","May","June","July","August","September","October","November","December"],la=({value:t,onChange:e,min:r,max:i,disabledDates:n=[],firstDayOfWeek:o=1,size:c="md",showWeekNumbers:l,onMonthChange:d,className:p,style:f,accessMode:u,id:y,multiple:h,selectedDates:m=[],onSelectedDatesChange:v,renderDay:D,showKeyboardHints:w,persistPreferences:k=!1,cookies:b=!1,localStorage:C=!0,sessionStorage:j=!1,storageMode:N,storageKey:$})=>{const x=Le(u,y);if(x==="hidden")return null;const F=x==="disabled"||x==="readOnly",{t:I}=De(),P=new Date,A=t?new Date(t):P,E=ai($??"nice-calendar"),M=s.useMemo(()=>k?E.get("prefs")??{}:{},[k,E]),W=M.firstDayOfWeek??o,[z,T]=s.useState(M.lastViewYear??A.getFullYear()),[g,_]=s.useState(M.lastViewMonth??A.getMonth()),[S,R]=s.useState(M.preferredView??"days"),L=s.useCallback(Q=>{if(!k)return;const fe=E.get("prefs")??{};E.set("prefs",{...fe,...Q})},[k,E]),O=s.useCallback(Q=>{R(Q),L({preferredView:Q})},[L]),Y=s.useCallback((Q,fe)=>{L({lastViewYear:Q,lastViewMonth:fe})},[L]),G=s.useMemo(()=>[Be.moveUp,Be.moveDown,Be.moveLeft,Be.moveRight,{key:"Enter",description:I("shortcuts.selectDate","Select date")},Be.pageUp,Be.pageDown],[I]),B=s.useMemo(()=>Ed(z,g),[z,g]),K=s.useMemo(()=>(Ad(z,g)-W+7)%7,[z,g,W]),J=s.useMemo(()=>{const Q=[...$d];for(let fe=0;fe<W;fe++)Q.push(Q.shift());return Q},[W]),he=s.useCallback(Q=>r&&Q<r||i&&Q>i?!0:n.includes(Q),[r,i,n]),pe=s.useCallback(Q=>{if(S==="years"){T(be=>be+Q*10);return}if(S==="months"){T(be=>be+Q);return}let fe=g+Q,Se=z;fe<0&&(fe=11,Se--),fe>11&&(fe=0,Se++),_(fe),T(Se),Y(Se,fe),d==null||d(Se,fe)},[g,z,d,S,Y]),we=wr(P.getFullYear(),P.getMonth(),P.getDate()),se=s.useCallback(Q=>h?m.includes(Q):Q===t,[h,m,t]),Ce=s.useCallback(Q=>{if(!F){if(h){const fe=m.includes(Q)?m.filter(Se=>Se!==Q):[...m,Q];v==null||v(fe)}e==null||e(Q)}},[h,m,e,v]),ee=s.useCallback(()=>{S==="days"?O("months"):S==="months"&&O("years")},[S,O]),de=s.useCallback(Q=>{_(Q),O("days"),Y(z,Q),d==null||d(z,Q)},[z,d,O,Y]),xe=s.useCallback(Q=>{T(Q),O("months")},[O]),$e=S==="years"?`${z-z%10} – ${z-z%10+9}`:S==="months"?`${z}`:`${_r[g]} ${z}`,Ne=S==="years"?"decade":S==="months"?"year":"month",U=[];for(let Q=0;Q<K;Q++)U.push(null);for(let Q=1;Q<=B;Q++)U.push(Q);for(;U.length%7!==0;)U.push(null);const Z=[];for(let Q=0;Q<U.length;Q+=7)Z.push(U.slice(Q,Q+7));const X=z-z%10;return a.jsxs("div",{className:`nice-calendar nice-calendar--${c} ${p||""}`,style:f,children:[a.jsxs("div",{className:"nice-calendar__header",children:[a.jsx("button",{type:"button",className:"nice-calendar__nav",onClick:()=>pe(-1),"aria-label":`Previous ${Ne}`,children:"‹"}),a.jsx("button",{type:"button",className:"nice-calendar__title",onClick:ee,"aria-label":S==="days"?"Show month picker":S==="months"?"Show year picker":void 0,disabled:S==="years",children:$e}),a.jsx("button",{type:"button",className:"nice-calendar__nav",onClick:()=>pe(1),"aria-label":`Next ${Ne}`,children:"›"}),w&&a.jsx(Qe,{shortcuts:G,size:"sm"})]}),S==="days"&&a.jsxs("table",{className:"nice-calendar__grid",role:"grid",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[l&&a.jsx("th",{className:"nice-calendar__wk",children:"W"}),J.map(Q=>a.jsx("th",{children:Q},Q))]})}),a.jsx("tbody",{children:Z.map((Q,fe)=>a.jsxs("tr",{children:[l&&a.jsx("td",{className:"nice-calendar__wk",children:Q.find(Se=>Se!=null)?Dd(new Date(z,g,Q.find(Se=>Se!=null))):""}),Q.map((Se,be)=>{if(Se==null)return a.jsx("td",{className:"nice-calendar__empty-cell"},be);const ie=wr(z,g,Se),je=he(ie),oe=se(ie);return a.jsx("td",{className:`nice-calendar__day${oe?" nice-calendar__day--selected":""}${ie===we?" nice-calendar__day--today":""}${je?" nice-calendar__day--disabled":""}`,onClick:()=>!je&&Ce(ie),role:"gridcell","aria-selected":oe,"aria-disabled":je,children:D?D(ie,Se):Se},be)})]},fe))})]}),S==="months"&&a.jsx("div",{className:"nice-calendar__picker-grid",children:_r.map((Q,fe)=>a.jsx("button",{type:"button",className:`nice-calendar__picker-cell${fe===g&&z===A.getFullYear()?" nice-calendar__picker-cell--selected":""}`,onClick:()=>de(fe),children:Q.slice(0,3)},fe))}),S==="years"&&a.jsx("div",{className:"nice-calendar__picker-grid",children:Array.from({length:12},(Q,fe)=>X-1+fe).map(Q=>a.jsx("button",{type:"button",className:`nice-calendar__picker-cell${Q===z?" nice-calendar__picker-cell--selected":""}${Q<X||Q>X+9?" nice-calendar__picker-cell--other":""}`,onClick:()=>xe(Q),children:Q},Q))})]})};la.displayName="NiceCalendar";const _i=({startDate:t,endDate:e,onStartChange:r,onEndChange:i,min:n,max:o,clearable:c,placeholder:l,startPlaceholder:d,endPlaceholder:p,label:f,error:u,helperText:y,required:h,disabled:m,size:v="md",id:D,className:w,style:k,accessMode:b,showKeyboardHints:C})=>{const j=Le(b,D);if(j==="hidden")return null;(j==="disabled"||j==="readOnly")&&(m=!0);const N=Ee(D),{t:$}=De(),[x,F]=s.useState(null),I=s.useRef(null);vt(I,()=>F(null));const P=s.useMemo(()=>[{key:"Tab",description:$("shortcuts.switchField","Switch between start/end")},Be.cancel],[$]),A=s.useCallback(M=>{r(M),(!e||M>e)&&i(M),F("end")},[r,i,e]),E=s.useCallback(M=>{i(M),F(null)},[i]);return a.jsxs("div",{className:`nice-field nice-field--${v} ${u?"nice-field--error":""} ${w||""}`,style:k,ref:I,children:[f&&a.jsxs("label",{className:"nice-field__label",htmlFor:N,children:[f,h&&a.jsx("span",{className:"nice-field__required",children:"*"}),C&&a.jsx(Qe,{shortcuts:P,size:"sm"})]}),a.jsxs("div",{className:"nice-daterange",children:[a.jsx("input",{id:N,type:"text",className:"nice-input nice-daterange__start",value:t,readOnly:!0,placeholder:d||$("controls.startDate","Start date"),onClick:()=>!m&&F("start"),disabled:m}),a.jsx("span",{className:"nice-daterange__separator",children:"–"}),a.jsx("input",{type:"text",className:"nice-input nice-daterange__end",value:e,readOnly:!0,placeholder:p||$("controls.endDate","End date"),onClick:()=>!m&&F("end"),disabled:m}),c&&(t||e)&&!m&&a.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>{r(""),i("")},"aria-label":$("controls.clear","Clear"),children:"✕"})]}),x&&a.jsx("div",{className:"nice-daterange__popup",children:a.jsx(la,{value:x==="start"?t:e,onChange:x==="start"?A:E,min:x==="end"&&t?t:n,max:o,size:v})}),u&&a.jsx("div",{className:"nice-field__error",children:u}),y&&!u&&a.jsx("div",{className:"nice-field__hint",children:y})]})},Ci=({options:t,value:e,onChange:r,searchable:i=!0,clearable:n,maxTags:o,allowCustom:c,placeholder:l,label:d,error:p,helperText:f,required:u,disabled:y,size:h="md",id:m,className:v,style:D,accessMode:w,showKeyboardHints:k})=>{const b=Le(w,m);if(b==="hidden")return null;(b==="disabled"||b==="readOnly")&&(y=!0);const C=Ee(m),{t:j}=De(),[N,$]=s.useState(!1),[x,F]=s.useState(""),I=s.useRef(null),P=s.useRef(null);vt(I,()=>$(!1));const A=s.useMemo(()=>[Be.submit,Be.cancel,{key:"Backspace",description:j("shortcuts.removeLastTag","Remove last tag")}],[j]),E=s.useMemo(()=>{let g=t.filter(_=>!e.includes(String(_.value)));if(x){const _=x.toLowerCase();g=g.filter(S=>S.label.toLowerCase().includes(_))}return g},[t,e,x]),M=s.useCallback(g=>{o&&e.length>=o||(e.includes(g)||r([...e,g]),F(""))},[e,r,o]),W=s.useCallback(g=>{r(e.filter(_=>_!==g))},[e,r]),z=g=>{g.key==="Backspace"&&!x&&e.length>0?W(e[e.length-1]):g.key==="Enter"&&x?(g.preventDefault(),E.length>0?M(String(E[0].value)):c&&M(x)):g.key==="Escape"&&$(!1)},T=g=>{var _;return((_=t.find(S=>String(S.value)===g))==null?void 0:_.label)??g};return a.jsxs("div",{className:`nice-field nice-field--${h} ${p?"nice-field--error":""} ${v||""}`,style:D,ref:I,children:[d&&a.jsxs("label",{className:"nice-field__label",htmlFor:C,children:[d,u&&a.jsx("span",{className:"nice-field__required",children:"*"}),k&&a.jsx(Qe,{shortcuts:A,size:"sm"})]}),a.jsxs("div",{className:"nice-tagbox",onClick:()=>{var g;y||($(!0),(g=P.current)==null||g.focus())},children:[a.jsxs("div",{className:"nice-tagbox__tags",children:[e.map(g=>a.jsxs("span",{className:"nice-tag nice-tagbox__tag",children:[T(g),!y&&a.jsx("button",{type:"button",className:"nice-tag__remove",onClick:_=>{_.stopPropagation(),W(g)},children:"✕"})]},g)),i&&a.jsx("input",{ref:P,id:C,type:"text",className:"nice-tagbox__input",value:x,onChange:g=>{F(g.target.value),$(!0)},onFocus:()=>$(!0),onKeyDown:z,placeholder:e.length===0?l||j("controls.select","Select..."):"",disabled:y,autoComplete:"off"})]}),n&&e.length>0&&!y&&a.jsx("button",{type:"button",className:"nice-field__clear",onClick:g=>{g.stopPropagation(),r([])},"aria-label":j("controls.clear","Clear"),children:"✕"})]}),N&&E.length>0&&a.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:E.map(g=>a.jsx("li",{role:"option",className:"nice-dropdown__option",onMouseDown:_=>{_.preventDefault(),M(String(g.value))},children:g.label},String(g.value)))}),p&&a.jsx("div",{className:"nice-field__error",children:p}),f&&!p&&a.jsx("div",{className:"nice-field__hint",children:f})]})},Si=({min:t=0,max:e=100,step:r=1,startValue:i,endValue:n,onChange:o,showLabels:c=!0,formatLabel:l,label:d,error:p,helperText:f,required:u,disabled:y,size:h="md",id:m,className:v,style:D,accessMode:w,showKeyboardHints:k})=>{const b=Le(w,m);if(b==="hidden")return null;(b==="disabled"||b==="readOnly")&&(y=!0);const{t:C}=De(),j=Ee(m),N=s.useRef(null),$=s.useMemo(()=>[Be.increment,Be.decrement,Be.first,Be.last,{key:"Tab",description:C("shortcuts.switchThumb","Switch thumb")}],[C]),x=A=>(A-t)/(e-t)*100,F=A=>l?l(A):String(A),I=A=>{const E=Math.round(A/r)*r;return Math.max(t,Math.min(e,E))},P=s.useCallback((A,E)=>{A.preventDefault();const M=N.current;if(!M||y)return;const W=T=>{const g=M.getBoundingClientRect(),_=Math.max(0,Math.min(1,(T.clientX-g.left)/g.width)),S=I(t+_*(e-t));E==="start"?o(Math.min(S,n),n):o(i,Math.max(S,i))},z=()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",z)};document.addEventListener("pointermove",W),document.addEventListener("pointerup",z)},[t,e,r,i,n,o,y]);return a.jsxs("div",{className:`nice-field nice-field--${h} ${p?"nice-field--error":""} ${v||""}`,style:D,children:[d&&a.jsxs("label",{className:"nice-field__label",htmlFor:j,children:[d,u&&a.jsx("span",{className:"nice-field__required",children:"*"}),k&&a.jsx(Qe,{shortcuts:$,size:"sm"})]}),a.jsxs("div",{className:"nice-range-slider",ref:N,children:[a.jsx("div",{className:"nice-range-slider__track",children:a.jsx("div",{className:"nice-range-slider__fill",style:{left:`${x(i)}%`,width:`${x(n)-x(i)}%`}})}),a.jsx("div",{className:"nice-range-slider__thumb",style:{left:`${x(i)}%`},onPointerDown:A=>P(A,"start"),role:"slider","aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":i,tabIndex:y?-1:0,id:j}),a.jsx("div",{className:"nice-range-slider__thumb",style:{left:`${x(n)}%`},onPointerDown:A=>P(A,"end"),role:"slider","aria-valuemin":i,"aria-valuemax":e,"aria-valuenow":n,tabIndex:y?-1:0}),c&&a.jsxs("div",{className:"nice-range-slider__labels",children:[a.jsx("span",{style:{left:`${x(i)}%`},children:F(i)}),a.jsx("span",{style:{left:`${x(n)}%`},children:F(n)})]})]}),p&&a.jsx("div",{className:"nice-field__error",children:p}),f&&!p&&a.jsx("div",{className:"nice-field__hint",children:f})]})},ji=({displayValue:t,placeholder:e,clearable:r,children:i,onClear:n,open:o,onOpenChange:c,dropdownWidth:l,label:d,error:p,helperText:f,required:u,disabled:y,size:h="md",id:m,className:v,style:D,accessMode:w,showKeyboardHints:k,displayStyle:b})=>{ft("input",b),at("input",b);const C=Le(w,m);if(C==="hidden")return null;(C==="disabled"||C==="readOnly")&&(y=!0);const j=Ee(m),{t:N}=De(),[$,x]=s.useState(!1),F=s.useRef(null),I=o??$,P=s.useMemo(()=>[{key:"Enter",description:N("shortcuts.openDropdown","Open dropdown")},Be.cancel],[N]),A=E=>{c?c(E):x(E)};return vt(F,()=>A(!1)),a.jsxs("div",{className:`nice-field nice-field--${h} ${p?"nice-field--error":""} ${v||""}`,style:D,ref:F,children:[d&&a.jsxs("label",{className:"nice-field__label",htmlFor:j,children:[d,u&&a.jsx("span",{className:"nice-field__required",children:"*"}),k&&a.jsx(Qe,{shortcuts:P,size:"sm"})]}),a.jsxs("div",{className:"nice-field__input-wrap",children:[a.jsxs("button",{type:"button",id:j,className:"nice-select__trigger",onClick:()=>!y&&A(!I),disabled:y,children:[a.jsx("span",{children:t||e||N("controls.select","Select...")}),a.jsx("span",{className:"nice-select__arrow",children:"▾"})]}),r&&t&&!y&&a.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>n==null?void 0:n(),"aria-label":N("controls.clear","Clear"),children:"✕"})]}),I&&a.jsx("div",{className:"nice-dropdown",style:{width:l},children:i}),p&&a.jsx("div",{className:"nice-field__error",children:p}),f&&!p&&a.jsx("div",{className:"nice-field__hint",children:f})]})},Oa=({items:t,data:e,onFieldChange:r,onSubmit:i,dataSource:n,recordKey:o,columns:c=1,responsiveColumns:l,gap:d=16,labelPosition:p="top",size:f="md",readOnly:u,disabled:y,className:h,style:m,accessMode:v,id:D,autoSaveDelay:w,onDirtyChange:k})=>{const b=Le(v,D);if(b==="hidden")return null;b==="disabled"&&(y=!0),b==="readOnly"&&(u=!0);const C=So(n??null,o),j=!!n&&o!=null,N=j?C.editData:e??{},[$]=s.useState(()=>({...N})),[x,F]=s.useState([]),I=s.useMemo(()=>Object.keys(N).some(Y=>N[Y]!==$[Y]),[N,$]),P=s.useRef(!1);s.useEffect(()=>{I!==P.current&&(P.current=I,k==null||k(I))},[I,k]);const A=s.useRef(null),E=s.useCallback(()=>{w&&(A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{j?C.save():i==null||i(N)},w))},[w,j,C,i,N]),M=s.useCallback((Y,G)=>{u||y||(F(B=>[...B,{field:Y,prev:N[Y]}]),j?C.set(Y,G):r==null||r(Y,G),E())},[j,C,r,u,y,N,E]);s.useCallback(()=>{if(x.length===0)return;const Y=x[x.length-1];F(G=>G.slice(0,-1)),j?C.set(Y.field,Y.prev):r==null||r(Y.field,Y.prev)},[x,j,C,r]);const W=s.useCallback(Y=>{Y.preventDefault(),A.current&&clearTimeout(A.current),j?C.save():i==null||i(N)},[N,i,j,C]),z=s.useRef(null),[T,g]=s.useState(c);s.useEffect(()=>{if(!l||!z.current){g(c);return}const Y=z.current,G=new ResizeObserver(B=>{var he;const K=((he=B[0])==null?void 0:he.contentRect.width)??0,J=Object.keys(l).map(Number).sort((pe,we)=>we-pe);for(const pe of J)if(K>=pe){g(l[pe]);return}g(c)});return G.observe(Y),()=>G.disconnect()},[l,c]);const _=s.useMemo(()=>t.filter(Y=>!(Y.visible===!1||Y.visibleWhen&&!Y.visibleWhen(N))),[t,N]),S=s.useMemo(()=>{const Y=[];let G=null;for(const B of _)!G||G.name!==B.group?(G={name:B.group,items:[B]},Y.push(G)):G.items.push(B);return Y},[_]),R=Y=>{var G;return a.jsxs("div",{className:"nice-form__item",style:{gridColumn:Y.colSpan?`span ${Y.colSpan}`:void 0},children:[Y.label&&a.jsxs("label",{className:"nice-form__label",children:[Y.label,Y.required&&a.jsx("span",{className:"nice-field__required",children:"*"})]}),a.jsx("div",{className:"nice-form__control",children:(G=Y.render)==null?void 0:G.call(Y,N[Y.field],B=>M(Y.field,B))}),Y.hint&&a.jsx("div",{className:"nice-form__hint",children:Y.hint})]},Y.field)},L={display:"grid",gridTemplateColumns:`repeat(${T}, 1fr)`,gap:d},O=S.some(Y=>Y.name!=null);return a.jsx("form",{ref:z,className:`nice-form nice-form--label-${p}${I?" nice-form--dirty":""} ${h||""}`,style:O?{...m}:{...L,...m},onSubmit:W,noValidate:!0,children:O?S.map((Y,G)=>a.jsxs("fieldset",{className:Y.name?"nice-form__group":"nice-form__group nice-form__group--no-title",children:[Y.name&&a.jsx("legend",{className:"nice-form__group-title",children:Y.name}),a.jsx("div",{style:L,children:Y.items.map(R)})]},G)):_.map(R)})};Oa.displayName="NiceForm";function Cr(t){const e=t.trim().toLowerCase();return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")||e.startsWith("./")||e.startsWith("../")?!0:!(e.startsWith("javascript:")||e.startsWith("vbscript:")||e.startsWith("data:text"))}const Td=["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"],Fd={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:"🔍"},Rd=[{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"}],Id=[{label:"Faces",emojis:["😀","😂","😊","😍","🤔","😢","😎","🥳","😤","🤯","🥰","😴"]},{label:"Hands",emojis:["👍","👎","👏","🤝","✌️","🤞","💪","🙌","👋","🤙"]},{label:"Symbols",emojis:["❤️","⭐","🔥","✅","❌","⚡","💡","📌","🎯","🏆","🎉","💬"]},{label:"Arrows",emojis:["➡️","⬅️","⬆️","⬇️","↩️","🔄","▶️","⏸️","⏹️","⏩"]}];function Pd(t){let e=t;return e=e.replace(/<h1[^>]*>(.*?)<\/h1>/gi,`# $1
|
|
67
|
+
`),e=e.replace(/<h2[^>]*>(.*?)<\/h2>/gi,`## $1
|
|
68
|
+
`),e=e.replace(/<h3[^>]*>(.*?)<\/h3>/gi,`### $1
|
|
69
|
+
`),e=e.replace(/<strong[^>]*>(.*?)<\/strong>/gi,"**$1**"),e=e.replace(/<b[^>]*>(.*?)<\/b>/gi,"**$1**"),e=e.replace(/<em[^>]*>(.*?)<\/em>/gi,"*$1*"),e=e.replace(/<i[^>]*>(.*?)<\/i>/gi,"*$1*"),e=e.replace(/<code[^>]*>(.*?)<\/code>/gi,"`$1`"),e=e.replace(/<pre[^>]*>(.*?)<\/pre>/gis,"```\n$1\n```\n"),e=e.replace(/<br\s*\/?>/gi,`
|
|
70
|
+
`),e=e.replace(/<li[^>]*>(.*?)<\/li>/gi,`- $1
|
|
71
|
+
`),e=e.replace(/<\/?(?:ul|ol|p|div)[^>]*>/gi,`
|
|
72
|
+
`),e=e.replace(/<[^>]+>/g,""),e=e.replace(/\n{3,}/g,`
|
|
73
|
+
|
|
74
|
+
`),e.trim()}function Ld(t){let e=t;return e=e.replace(/^### (.+)$/gm,"<h3>$1</h3>"),e=e.replace(/^## (.+)$/gm,"<h2>$1</h2>"),e=e.replace(/^# (.+)$/gm,"<h1>$1</h1>"),e=e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),e=e.replace(/\*(.+?)\*/g,"<em>$1</em>"),e=e.replace(/`([^`]+)`/g,"<code>$1</code>"),e=e.replace(/```\n?([\s\S]*?)\n?```/g,"<pre>$1</pre>"),e=e.replace(/^- (.+)$/gm,"<li>$1</li>"),e=e.replace(/(<li>.*<\/li>)/gs,"<ul>$1</ul>"),e=e.replace(/\n/g,"<br>"),e}const ca=({value:t,onChange:e,placeholder:r,height:i=200,toolbar:n=Td,readOnly:o,onImageUpload:c,mentionTrigger:l,mentionSuggestions:d,onMentionSearch:p,onFileDrop:f,pasteCleanup:u=!0,maxLength:y=0,showWordCount:h=!1,templates:m,label:v,error:D,helperText:w,required:k,disabled:b,size:C="md",id:j,className:N,style:$,accessMode:x})=>{const F=Le(x,j);if(F==="hidden")return null;F==="disabled"&&(b=!0),F==="readOnly"&&(o=!0);const I=Ee(j),P=s.useRef(null),A=s.useRef(null),E=s.useRef(null),[M,W]=s.useState(!1),[z,T]=s.useState(""),[g,_]=s.useState(!1),[S,R]=s.useState(""),[L,O]=s.useState(!1),[Y,G]=s.useState(""),[B,K]=s.useState(0),[J,he]=s.useState(!1),[pe,we]=s.useState("#000000"),[se,Ce]=s.useState("#ffff00"),[ee,de]=s.useState(0),[xe,$e]=s.useState(0),[Ne,U]=s.useState(!1),[Z,X]=s.useState(""),[Q,fe]=s.useState(""),[Se,be]=s.useState(!1),[ie,je]=s.useState(!1),oe=s.useCallback((V,ue)=>{var ke,_e,Te;if(o||b)return;const ge=P.current;if(ge){if(V==="markdown"){if(!M)T(Pd(t)),W(!0),_(!1);else{const Me=Ld(z);e(Me),W(!1)}return}if(V==="source"){g?(e(S),_(!1)):(R(t),_(!0),W(!1));return}if(V==="fullscreen"){he(Me=>!Me);return}if(V==="emoji"){be(Me=>!Me);return}if(V==="findReplace"){U(Me=>!Me);return}if(V==="image"){if(c)(ke=A.current)==null||ke.click();else{const Me=prompt("Image URL:");Me&&Cr(Me)&&(ge.focus(),document.execCommand("insertImage",!1,Me),e(aa(ge.innerHTML)))}return}switch(ge.focus(),V){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 Me=prompt("URL:");Me&&Cr(Me)&&document.execCommand("createLink",!1,Me);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":{ue&&document.execCommand("fontSize",!1,ue);break}case"fontColor":{ue&&document.execCommand("foreColor",!1,ue);break}case"bgColor":{ue&&document.execCommand("hiliteColor",!1,ue);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> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table><p> </p>');break}case"code":{const Me=((_e=window.getSelection())==null?void 0:_e.toString())||"";Me.includes(`
|
|
75
|
+
`)||Me.length>60?document.execCommand("insertHTML",!1,`<pre class="nice-htmleditor__code-block">${Me||"// code"}</pre>`):document.execCommand("insertHTML",!1,`<code>${Me||"code"}</code>`);break}}e(aa(ge.innerHTML)),de(((Te=ge.textContent)==null?void 0:Te.length)??0)}},[e,o,b,M,z,t,c,g,S]),Ae=s.useCallback(async V=>{var _e;const ue=(_e=V.target.files)==null?void 0:_e[0];if(!ue||!c)return;const ge=await c(ue),ke=P.current;ke&&ge&&(ke.focus(),document.execCommand("insertImage",!1,ge),e(ke.innerHTML)),V.target.value=""},[c,e]),ze=s.useCallback(()=>{var ge;const V=P.current;if(!V)return;const ue=((ge=V.textContent)==null?void 0:ge.length)??0;if(y>0&&ue>y&&(V.textContent=(V.textContent??"").slice(0,y)),de(ue),$e((V.textContent??"").trim().split(/\s+/).filter(Boolean).length),e(V.innerHTML),l){const ke=window.getSelection();if(ke&&ke.rangeCount>0){const _e=ke.getRangeAt(0),Te=_e.startContainer;if(Te.nodeType===Node.TEXT_NODE){const Me=Te.textContent||"",Ie=_e.startOffset,Oe=Me.slice(0,Ie),Ze=Oe.lastIndexOf(l);if(Ze>=0&&(Ze===0||/\s/.test(Oe[Ze-1]))){const Xe=Oe.slice(Ze+l.length);if(!/\s/.test(Xe)){O(!0),G(Xe),K(0),p==null||p(Xe);return}}}}O(!1)}},[e,l,p]),Fe=(d==null?void 0:d.filter(V=>V.label.toLowerCase().includes(Y.toLowerCase())).slice(0,8))??[],Ge=s.useCallback(V=>{var Te;const ue=P.current;if(!ue)return;const ge=window.getSelection();if(!ge||ge.rangeCount===0)return;const ke=ge.getRangeAt(0),_e=ke.startContainer;if(_e.nodeType===Node.TEXT_NODE&&l){const Me=_e.textContent||"",Ie=ke.startOffset,Oe=Me.slice(0,Ie).lastIndexOf(l);if(Oe>=0){const Ze=Me.slice(0,Oe),Xe=Me.slice(Ie),et=`<span class="nice-htmleditor__mention" data-mention="${V.key}" contenteditable="false">${l}${V.label}</span> `;_e.textContent=Ze;const st=document.createRange();st.setStartAfter(_e),st.collapse(!0);const He=st.createContextualFragment(et+Xe);(Te=_e.parentNode)==null||Te.insertBefore(He,_e.nextSibling),ge.collapseToEnd(),e(ue.innerHTML)}}O(!1)},[l,e]),Ye=s.useCallback(V=>{if(L&&Fe.length>0){V.key==="ArrowDown"?(V.preventDefault(),K(ue=>Math.min(ue+1,Fe.length-1))):V.key==="ArrowUp"?(V.preventDefault(),K(ue=>Math.max(ue-1,0))):V.key==="Enter"?(V.preventDefault(),Ge(Fe[B])):V.key==="Escape"&&O(!1);return}(V.ctrlKey||V.metaKey)&&V.key==="b"?(V.preventDefault(),oe("bold")):(V.ctrlKey||V.metaKey)&&V.key==="i"?(V.preventDefault(),oe("italic")):(V.ctrlKey||V.metaKey)&&V.key==="u"?(V.preventDefault(),oe("underline")):(V.ctrlKey||V.metaKey)&&V.key==="f"?(V.preventDefault(),U(ue=>!ue)):(V.ctrlKey||V.metaKey)&&V.key==="z"&&!V.shiftKey?(V.preventDefault(),oe("undo")):(V.ctrlKey||V.metaKey)&&(V.key==="y"||V.key==="z"&&V.shiftKey)&&(V.preventDefault(),oe("redo"))},[L,Fe,B,Ge,oe]),it=s.useCallback(V=>{var _e;if(!u)return;V.preventDefault();const ue=V.clipboardData.getData("text/html"),ge=V.clipboardData.getData("text/plain");if(ue){const Te=ue.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,Te)}else ge&&document.execCommand("insertText",!1,ge);const ke=P.current;ke&&(e(ke.innerHTML),de(((_e=ke.textContent)==null?void 0:_e.length)??0))},[u,e]),_t=s.useCallback(async V=>{if(!f)return;V.preventDefault();const ue=Array.from(V.dataTransfer.files);if(ue.length===0)return;const ge=await f(ue),ke=P.current;if(ke){ke.focus();for(const _e of ge)if(/\.(png|jpe?g|gif|webp|svg|bmp|ico)$/i.test(_e)||_e.startsWith("data:image/"))document.execCommand("insertImage",!1,_e);else{const Te=`<a href="${_e}">${_e.split("/").pop()??_e}</a>`;document.execCommand("insertHTML",!1,Te)}e(ke.innerHTML)}},[f,e]),ht=s.useCallback(V=>{f&&V.preventDefault()},[f]),H=s.useCallback(V=>{var Te;const ue=P.current;if(!ue||!Z)return;const ge=ue.textContent??"",ke=Z.toLowerCase(),_e=ge.toLowerCase();(V===1?_e.indexOf(ke):_e.lastIndexOf(ke))!==-1&&(ue.focus(),(Te=window.find)==null||Te.call(window,Z))},[Z]),ae=s.useCallback(()=>{const V=P.current;!V||!Z||(V.innerHTML=V.innerHTML.split(Z).join(Q),e(V.innerHTML))},[Z,Q,e]),le=s.useCallback(()=>{if(!Z)return;const V=t.split(Z).join(Q);e(V);const ue=P.current;ue&&(ue.innerHTML=V)},[Z,Q,t,e]),ce=s.useCallback(V=>{const ue=P.current;ue&&(ue.focus(),document.execCommand("insertText",!1,V),e(ue.innerHTML),be(!1))},[e]),ye=s.useCallback(V=>{const ue=P.current;ue&&(ue.focus(),document.execCommand("insertHTML",!1,V),e(ue.innerHTML),je(!1))},[e]),ne=s.useCallback(V=>{const ue=b||o;return V==="fontSize"?a.jsx(Je,{size:"sm",value:"",onChange:ge=>oe("fontSize",String(ge)),disabled:ue,placeholder:"Size",options:Rd.map(ge=>({value:ge.value,label:ge.label})),style:{minWidth:70,maxWidth:80}},V):V==="fontColor"?a.jsx(rt,{value:pe,onChange:ge=>{we(ge),oe("fontColor",ge)},disabled:ue,size:"sm",label:"",title:"Text color"},V):V==="bgColor"?a.jsx(rt,{value:se,onChange:ge=>{Ce(ge),oe("bgColor",ge)},disabled:ue,size:"sm",label:"",title:"Highlight color"},V):a.jsx(me,{size:"sm",variant:V==="markdown"&&M||V==="fullscreen"&&J||V==="source"&&g||V==="findReplace"&&Ne||V==="emoji"&&Se?"primary":"ghost",onClick:()=>oe(V),title:V,disabled:ue,children:Fd[V]||V},V)},[b,o,oe,M,J,pe,se,g,Ne,Se]);return a.jsxs("div",{className:`nice-field nice-field--${C} ${D?"nice-field--error":""} ${N||""}`,style:$,children:[v&&a.jsxs("label",{className:"nice-field__label",htmlFor:I,children:[v,k&&a.jsx("span",{className:"nice-field__required",children:"*"})]}),a.jsxs("div",{ref:E,className:`nice-htmleditor${J?" nice-htmleditor--fullscreen":""}`,children:[a.jsxs("div",{className:"nice-htmleditor__toolbar",style:{display:"flex",flexWrap:"wrap",gap:2,alignItems:"center"},children:[n.map(ne),m&&m.length>0&&a.jsxs("div",{style:{position:"relative"},children:[a.jsx(me,{size:"sm",variant:ie?"primary":"ghost",onClick:()=>je(V=>!V),title:"Insert template",children:"📋"}),ie&&a.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:m.map((V,ue)=>a.jsx("li",{style:{padding:"6px 10px",cursor:"pointer",borderRadius:4},onMouseDown:ge=>{ge.preventDefault(),ye(V.html)},children:V.label},ue))})]})]}),Ne&&a.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:[a.jsx("input",{type:"text",placeholder:"Find...",value:Z,onChange:V=>X(V.target.value),style:{flex:1,maxWidth:180,padding:"2px 6px",border:"1px solid #ccc",borderRadius:4}}),a.jsx("input",{type:"text",placeholder:"Replace...",value:Q,onChange:V=>fe(V.target.value),style:{flex:1,maxWidth:180,padding:"2px 6px",border:"1px solid #ccc",borderRadius:4}}),a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>H(1),title:"Find next",children:"▶"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>H(-1),title:"Find previous",children:"◀"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:ae,disabled:b||o,children:"Replace"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:le,disabled:b||o,children:"All"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>U(!1),children:"✕"})]}),Se&&a.jsx("div",{className:"nice-htmleditor__emoji-picker",style:{padding:8,background:"#fff",borderBottom:"1px solid #ddd",maxHeight:180,overflowY:"auto"},children:Id.map(V=>a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"0.7em",fontWeight:600,color:"#999",padding:"4px 0"},children:V.label}),a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:2},children:V.emojis.map(ue=>a.jsx("span",{style:{cursor:"pointer",fontSize:"1.2em",padding:2,borderRadius:4},onClick:()=>ce(ue),title:ue,children:ue},ue))})]},V.label))}),a.jsx("input",{ref:A,type:"file",accept:"image/*",style:{display:"none"},onChange:Ae}),g?a.jsx("textarea",{className:"nice-htmleditor__source",value:S,onChange:V=>R(V.target.value),style:{minHeight:i,width:"100%",fontFamily:"monospace",resize:"vertical",whiteSpace:"pre",fontSize:"0.85em"},disabled:b||o}):M?a.jsx("textarea",{className:"nice-htmleditor__markdown",value:z,onChange:V=>T(V.target.value),style:{minHeight:i,width:"100%",fontFamily:"monospace",resize:"vertical"},disabled:b||o}):a.jsxs("div",{style:{position:"relative"},children:[a.jsx("div",{ref:P,id:I,className:"nice-htmleditor__content",contentEditable:!b&&!o,dangerouslySetInnerHTML:{__html:t},onInput:ze,onKeyDown:Ye,onPaste:it,onDrop:_t,onDragOver:ht,style:{minHeight:i},"data-placeholder":r,role:"textbox","aria-multiline":"true",suppressContentEditableWarning:!0}),L&&Fe.length>0&&a.jsx("ul",{className:"nice-htmleditor__mention-list",children:Fe.map((V,ue)=>a.jsx("li",{className:`nice-htmleditor__mention-item ${ue===B?"nice-htmleditor__mention-item--active":""}`,onMouseDown:ge=>{ge.preventDefault(),Ge(V)},children:V.label},V.key))})]}),a.jsxs("div",{className:"nice-htmleditor__statusbar",style:{display:"flex",gap:12,padding:"2px 8px",fontSize:"0.75em",color:"#666",borderTop:"1px solid #eee"},children:[y>0&&a.jsxs("span",{children:[ee," / ",y]}),h&&a.jsxs("span",{children:[xe," words"]}),h&&a.jsxs("span",{children:[ee," chars"]}),g&&a.jsx("span",{style:{fontWeight:600},children:"HTML Source"}),M&&a.jsx("span",{style:{fontWeight:600},children:"Markdown"})]})]}),D&&a.jsx("div",{className:"nice-field__error",children:D}),w&&!D&&a.jsx("div",{className:"nice-field__hint",children:w})]})},Od=Object.freeze(Object.defineProperty({__proto__:null,NiceHtmlEditor:ca},Symbol.toStringTag,{value:"Module"})),Hd=[{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"}],Wd=[{style:"professional",label:"Professional"},{style:"casual",label:"Casual"},{style:"formal",label:"Formal"},{style:"concise",label:"Concise"}];s.forwardRef(function(t,e){var $e,Ne;const{enableAI:r=!0,aiModel:i,enableImprove:n=!0,enableTranslate:o=!0,enableGenerate:c=!0,toolbar:l,languages:d=Hd,textStyles:p=Wd,onImprove:f,onTranslate:u,onGenerate:y,showAIToolbar:h=!0,value:m,onChange:v,...D}=t,w=s.useRef(null),[k,b]=s.useState(!1),[C,j]=s.useState(!1),[N,$]=s.useState(!1),[x,F]=s.useState(""),[I,P]=s.useState(""),[A,E]=s.useState("professional"),[M,W]=s.useState(""),[z,T]=s.useState((($e=d[0])==null?void 0:$e.code)||"en"),[g,_]=s.useState(""),[S,R]=s.useState(""),{t:L}=Da(),O=kt(),{improveText:Y,translate:G,generateHtml:B,isLoading:K}=_o(),J=r&&O.isConfigured,he=s.useCallback(()=>{const U=window.getSelection();return U&&U.toString().trim()?U.toString():""},[]),pe=s.useCallback(U=>{const Z=window.getSelection();if(Z&&Z.rangeCount>0){const X=Z.getRangeAt(0);X.deleteContents();const Q=document.createElement("div");Q.innerHTML=U;const fe=document.createDocumentFragment();for(;Q.firstChild;)fe.appendChild(Q.firstChild);if(X.insertNode(fe),w.current){const Se=w.current.innerHTML;v(Se)}}},[v]),we=s.useCallback(async(U="professional")=>{if(!J||!n)return"";const Z=he();if(!Z)return"";F(Z),E(U),b(!0),P("");try{const X=await Y(Z,U);return P(X),f==null||f(Z,X,U),X}catch{return P(L("htmlEditorAI.improveFailed","Failed to improve text")),""}},[J,n,he,Y,f,L]),se=s.useCallback(async U=>{var X;if(!J||!o)return"";const Z=he();if(!Z)return"";F(Z),T(U),j(!0),W("");try{const Q=((X=d.find(Se=>Se.code===U))==null?void 0:X.label)||U,fe=await G(Z,Q);return W(fe),u==null||u(Z,fe,U),fe}catch{return W(L("htmlEditorAI.translateFailed","Failed to translate text")),""}},[J,o,he,G,d,u,L]),Ce=s.useCallback(async U=>{if(!J||!c||!U.trim())return"";_(U),R("");try{const Z=await B(U);return R(Z),y==null||y(U,Z),Z}catch{return R(L("htmlEditorAI.generateFailed","Failed to generate HTML")),""}},[J,c,B,y,L]),ee=s.useCallback(()=>{I&&pe(I),b(!1),P("")},[I,pe]),de=s.useCallback(()=>{M&&pe(M),j(!1),W("")},[M,pe]),xe=s.useCallback(()=>{if(S&&w.current){document.execCommand("insertHTML",!1,S);const U=w.current.innerHTML;v(U)}$(!1),R(""),_("")},[S,v]);return s.useImperativeHandle(e,()=>({getEditor:()=>w.current,focus:()=>{var U;return(U=w.current)==null?void 0:U.focus()},getValue:()=>{var U;return((U=w.current)==null?void 0:U.innerHTML)||""},setValue:U=>{w.current&&(w.current.innerHTML=U,v(U))},getSelection:he,insertHtml:U=>{document.execCommand("insertHTML",!1,U),w.current&&v(w.current.innerHTML)},improveSelection:we,translateSelection:se,generateHtml:Ce})),s.useCallback(U=>{w.current=U},[]),a.jsxs("div",{className:"nice-html-editor-ai","data-testid":t["data-testid"],children:[h&&J&&a.jsxs("div",{className:"nice-html-editor-ai__toolbar",children:[a.jsxs("div",{className:"nice-html-editor-ai__toolbar-left",children:[a.jsx("span",{className:"nice-html-editor-ai__badge",children:"AI"}),K&&a.jsx("span",{className:"nice-html-editor-ai__loading",children:L("htmlEditorAI.processing","Processing...")})]}),a.jsxs("div",{className:"nice-html-editor-ai__toolbar-right",children:[n&&a.jsxs("div",{className:"nice-html-editor-ai__dropdown",children:[a.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",onClick:()=>we(),disabled:K,title:L("htmlEditorAI.improveText","Improve selected text"),children:["✨ ",L("htmlEditorAI.improve","Improve")]}),a.jsx("div",{className:"nice-html-editor-ai__dropdown-menu",children:p.map(({style:U,label:Z})=>a.jsx("button",{type:"button",className:"nice-html-editor-ai__dropdown-item",onClick:()=>we(U),children:Z},U))})]}),o&&a.jsxs("div",{className:"nice-html-editor-ai__dropdown",children:[a.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",disabled:K,title:L("htmlEditorAI.translateText","Translate selected text"),children:["🌐 ",L("htmlEditorAI.translate","Translate")]}),a.jsx("div",{className:"nice-html-editor-ai__dropdown-menu nice-html-editor-ai__dropdown-menu--languages",children:d.map(({code:U,label:Z})=>a.jsx("button",{type:"button",className:"nice-html-editor-ai__dropdown-item",onClick:()=>se(U),children:Z},U))})]}),c&&a.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",onClick:()=>$(!0),disabled:K,title:L("htmlEditorAI.generateHtml","Generate HTML from description"),children:["⚡ ",L("htmlEditorAI.generate","Generate")]})]})]}),a.jsx("div",{className:"nice-html-editor-ai__editor-wrapper",children:a.jsx(ca,{value:m,onChange:v,toolbar:l,...D})}),k&&a.jsxs("div",{className:"nice-html-editor-ai__panel",children:[a.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[a.jsxs("h4",{children:["✨ ",L("htmlEditorAI.improveText","Improve Text")]}),a.jsx("div",{className:"nice-html-editor-ai__style-selector",children:p.map(({style:U,label:Z})=>a.jsx("button",{type:"button",className:`nice-html-editor-ai__style-btn ${A===U?"nice-html-editor-ai__style-btn--active":""}`,onClick:()=>{E(U),we(U)},children:Z},U))}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>b(!1),children:"✕"})]}),a.jsx("div",{className:"nice-html-editor-ai__panel-body",children:K?a.jsx("div",{className:"nice-html-editor-ai__loading-panel",children:L("htmlEditorAI.improving","Improving text...")}):a.jsxs("div",{className:"nice-html-editor-ai__comparison",children:[a.jsxs("div",{className:"nice-html-editor-ai__text-block",children:[a.jsx("h5",{children:L("htmlEditorAI.original","Original")}),a.jsx("div",{className:"nice-html-editor-ai__text-content",children:x})]}),a.jsxs("div",{className:"nice-html-editor-ai__text-block nice-html-editor-ai__text-block--improved",children:[a.jsx("h5",{children:L("htmlEditorAI.improved","Improved")}),a.jsx("div",{className:"nice-html-editor-ai__text-content",children:I})]})]})}),a.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[a.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:ee,disabled:!I||K,children:["✓ ",L("htmlEditorAI.apply","Apply")]}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{b(!1),P("")},children:L("htmlEditorAI.cancel","Cancel")})]})]}),C&&a.jsxs("div",{className:"nice-html-editor-ai__panel",children:[a.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[a.jsxs("h4",{children:["🌐 ",L("htmlEditorAI.translateText","Translate Text")]}),a.jsx("div",{className:"nice-html-editor-ai__language-selector",children:a.jsx("select",{value:z,onChange:U=>{T(U.target.value),se(U.target.value)},className:"nice-html-editor-ai__language-select",children:d.map(({code:U,label:Z})=>a.jsx("option",{value:U,children:Z},U))})}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>j(!1),children:"✕"})]}),a.jsx("div",{className:"nice-html-editor-ai__panel-body",children:K?a.jsx("div",{className:"nice-html-editor-ai__loading-panel",children:L("htmlEditorAI.translating","Translating...")}):a.jsxs("div",{className:"nice-html-editor-ai__comparison",children:[a.jsxs("div",{className:"nice-html-editor-ai__text-block",children:[a.jsx("h5",{children:L("htmlEditorAI.original","Original")}),a.jsx("div",{className:"nice-html-editor-ai__text-content",children:x})]}),a.jsxs("div",{className:"nice-html-editor-ai__text-block nice-html-editor-ai__text-block--translated",children:[a.jsx("h5",{children:((Ne=d.find(U=>U.code===z))==null?void 0:Ne.label)||z}),a.jsx("div",{className:"nice-html-editor-ai__text-content",children:M})]})]})}),a.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[a.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:de,disabled:!M||K,children:["✓ ",L("htmlEditorAI.apply","Apply")]}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{j(!1),W("")},children:L("htmlEditorAI.cancel","Cancel")})]})]}),N&&a.jsxs("div",{className:"nice-html-editor-ai__panel nice-html-editor-ai__panel--generate",children:[a.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[a.jsxs("h4",{children:["⚡ ",L("htmlEditorAI.generateHtml","Generate HTML")]}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>{$(!1),R(""),_("")},children:"✕"})]}),a.jsxs("div",{className:"nice-html-editor-ai__panel-body",children:[a.jsxs("div",{className:"nice-html-editor-ai__generate-input",children:[a.jsx("textarea",{placeholder:L("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:g,onChange:U=>_(U.target.value),className:"nice-html-editor-ai__generate-textarea",rows:3}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__generate-btn",onClick:()=>Ce(g),disabled:K||!g.trim(),children:K?L("htmlEditorAI.generating","Generating..."):L("htmlEditorAI.generate","Generate")})]}),S&&a.jsxs("div",{className:"nice-html-editor-ai__generate-result",children:[a.jsx("h5",{children:L("htmlEditorAI.preview","Preview")}),a.jsx("div",{className:"nice-html-editor-ai__preview",dangerouslySetInnerHTML:{__html:S}}),a.jsx("h5",{children:L("htmlEditorAI.htmlCode","HTML Code")}),a.jsx("pre",{className:"nice-html-editor-ai__code",children:S})]})]}),a.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[a.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:xe,disabled:!S||K,children:["✓ ",L("htmlEditorAI.insert","Insert")]}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{$(!1),R(""),_("")},children:L("htmlEditorAI.cancel","Cancel")})]})]})]})});function yt(t){return t.toString().padStart(2,"0")}function Bd(t){if(!t)return{date:"",hours:0,minutes:0,seconds:0};const e=new Date(t);if(isNaN(e.getTime()))return{date:"",hours:0,minutes:0,seconds:0};const r=e.getFullYear(),i=yt(e.getMonth()+1),n=yt(e.getDate());return{date:`${r}-${i}-${n}`,hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function qd(t,e,r,i){return t?`${t}T${yt(e)}:${yt(r)}:${yt(i)}`:""}const Ha=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,value:u,onChange:y,onBlur:h,min:m,max:v,hourFormat:D="24",minuteStep:w=1,showSeconds:k=!1,showNow:b=!1,clearable:C=!1,...j},N)=>{const{t:$}=De(),x=Ee(d),F=s.useRef(null),I=s.useMemo(()=>Bd(u),[u]),P=s.useCallback((O,Y,G,B)=>{y==null||y(qd(O,Y,G,B))},[y]),A=s.useCallback(O=>{P(O.target.value,I.hours,I.minutes,I.seconds)},[P,I]),E=s.useCallback(O=>{const Y=Math.max(0,Math.min(23,parseInt(O.target.value,10)||0));P(I.date,Y,I.minutes,I.seconds)},[P,I]),M=s.useCallback(O=>{const Y=Math.max(0,Math.min(59,parseInt(O.target.value,10)||0));P(I.date,I.hours,Y,I.seconds)},[P,I]),W=s.useCallback(O=>{const Y=Math.max(0,Math.min(59,parseInt(O.target.value,10)||0));P(I.date,I.hours,I.minutes,Y)},[P,I]),z=s.useCallback(()=>{const O=I.hours>=12?I.hours-12:I.hours+12;P(I.date,O,I.minutes,I.seconds)},[P,I]),T=s.useCallback(()=>{const O=new Date,Y=`${O.getFullYear()}-${yt(O.getMonth()+1)}-${yt(O.getDate())}`;P(Y,O.getHours(),O.getMinutes(),O.getSeconds())},[P]),g=s.useCallback(()=>{y==null||y("")},[y]),_=D==="12"?I.hours===0?12:I.hours>12?I.hours-12:I.hours:I.hours,S=I.hours>=12?"PM":"AM",R=m?m.split("T")[0]:void 0,L=v?v.split("T")[0]:void 0;return a.jsxs("div",{ref:N,className:`nice-field ${p||""}`,style:f,...j,children:[t&&a.jsx("label",{htmlFor:x,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:t}),a.jsxs("div",{className:`nice-datetime nice-datetime--${c} ${r?"nice-datetime--error":""} ${n?"nice-datetime--disabled":""} ${o?"nice-datetime--readonly":""}`,children:[a.jsx("input",{ref:F,id:x,type:"date",className:"nice-datetime__date",name:l?`${l}_date`:void 0,value:I.date,min:R,max:L,disabled:n,readOnly:o,"aria-invalid":!!r,"aria-describedby":r?`${x}-error`:e?`${x}-helper`:void 0,onChange:A,onBlur:h}),a.jsx("span",{className:"nice-datetime__separator",children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor",children:a.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"})})}),a.jsx("input",{type:"number",className:"nice-datetime__time-part",value:_,min:D==="12"?1:0,max:D==="12"?12:23,disabled:n,readOnly:o,"aria-label":$("datetime.hours","Hours"),onChange:E}),a.jsx("span",{className:"nice-datetime__colon",children:":"}),a.jsx("input",{type:"number",className:"nice-datetime__time-part",value:yt(I.minutes),min:0,max:59,step:w,disabled:n,readOnly:o,"aria-label":$("datetime.minutes","Minutes"),onChange:M}),k&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"nice-datetime__colon",children:":"}),a.jsx("input",{type:"number",className:"nice-datetime__time-part",value:yt(I.seconds),min:0,max:59,disabled:n,readOnly:o,"aria-label":$("datetime.seconds","Seconds"),onChange:W})]}),D==="12"&&a.jsx("button",{type:"button",className:"nice-datetime__ampm",disabled:n||o,onClick:z,"aria-label":$("datetime.toggleAmPm","Toggle AM/PM"),children:S}),b&&a.jsx("button",{type:"button",className:"nice-datetime__now",disabled:n||o,onClick:T,"aria-label":$("datetime.now","Now"),children:$("datetime.now","Now")}),C&&u&&a.jsx("button",{type:"button",className:"nice-input__clear",disabled:n||o,onClick:g,"aria-label":$("controls.clear","Clear"),children:"✕"})]}),r&&a.jsx("div",{id:`${x}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{id:`${x}-helper`,className:"nice-field__helper",children:e})]})});Ha.displayName="NiceDateTimePicker";function Nt(t){return t.toString().padStart(2,"0")}function ma(t){if(!t)return{hours:0,minutes:0,seconds:0};const e=t.split(":").map(Number);return{hours:Math.max(0,Math.min(23,e[0]||0)),minutes:Math.max(0,Math.min(59,e[1]||0)),seconds:Math.max(0,Math.min(59,e[2]||0))}}function Vd(t,e,r,i){return i?`${Nt(t)}:${Nt(e)}:${Nt(r)}`:`${Nt(t)}:${Nt(e)}`}const Wa=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,value:u,onChange:y,onBlur:h,hourFormat:m="24",minuteStep:v=1,showSeconds:D=!1,min:w,max:k,clearable:b=!1,...C},j)=>{const{t:N}=De(),$=Ee(d),x=s.useMemo(()=>ma(u),[u]),F=s.useCallback((_,S,R)=>{y==null||y(Vd(_,S,R,D))},[y,D]),I=s.useCallback((_,S,R)=>{if(w){const L=ma(w),O=L.hours*3600+L.minutes*60+L.seconds;if(_*3600+S*60+R<O)return[L.hours,L.minutes,L.seconds]}if(k){const L=ma(k),O=L.hours*3600+L.minutes*60+L.seconds;if(_*3600+S*60+R>O)return[L.hours,L.minutes,L.seconds]}return[_,S,R]},[w,k]),P=s.useCallback(_=>{let S=parseInt(_.target.value,10)||0;if(m==="12"){const Y=x.hours<12;S=Math.max(1,Math.min(12,S)),S===12?S=Y?0:12:S=Y?S:S+12}else S=Math.max(0,Math.min(23,S));const[R,L,O]=I(S,x.minutes,x.seconds);F(R,L,O)},[F,x,m,I]),A=s.useCallback(_=>{const S=Math.max(0,Math.min(59,parseInt(_.target.value,10)||0)),[R,L,O]=I(x.hours,S,x.seconds);F(R,L,O)},[F,x,I]),E=s.useCallback(_=>{const S=Math.max(0,Math.min(59,parseInt(_.target.value,10)||0)),[R,L,O]=I(x.hours,x.minutes,S);F(R,L,O)},[F,x,I]),M=s.useCallback(()=>{const _=x.hours>=12?x.hours-12:x.hours+12,[S,R,L]=I(_,x.minutes,x.seconds);F(S,R,L)},[F,x,I]),W=s.useCallback(()=>{y==null||y("")},[y]),z=s.useCallback((_,S)=>{if(o||n)return;const R=_==="m"?v:1;if(S.key==="ArrowUp"||S.key==="ArrowDown"){S.preventDefault();const L=S.key==="ArrowUp"?R:-R;let O=x.hours,Y=x.minutes,G=x.seconds;_==="h"?O=((O+L)%24+24)%24:_==="m"?Y=((Y+L)%60+60)%60:G=((G+L)%60+60)%60;const[B,K,J]=I(O,Y,G);F(B,K,J)}},[x,v,F,I,o,n]),T=m==="12"?x.hours===0?12:x.hours>12?x.hours-12:x.hours:x.hours,g=x.hours>=12?"PM":"AM";return a.jsxs("div",{ref:j,className:`nice-field ${p||""}`,style:f,...C,children:[t&&a.jsx("label",{htmlFor:$,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:t}),a.jsxs("div",{className:`nice-timepicker nice-timepicker--${c} ${r?"nice-timepicker--error":""} ${n?"nice-timepicker--disabled":""} ${o?"nice-timepicker--readonly":""}`,children:[a.jsx("svg",{className:"nice-timepicker__icon",width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor",children:a.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"})}),a.jsx("input",{id:$,type:"number",className:"nice-timepicker__part",value:T,min:m==="12"?1:0,max:m==="12"?12:23,disabled:n,readOnly:o,name:l,"aria-invalid":!!r,"aria-describedby":r?`${$}-error`:e?`${$}-helper`:void 0,"aria-label":N("datetime.hours","Hours"),onChange:P,onKeyDown:_=>z("h",_),onBlur:h}),a.jsx("span",{className:"nice-timepicker__colon",children:":"}),a.jsx("input",{type:"number",className:"nice-timepicker__part",value:Nt(x.minutes),min:0,max:59,step:v,disabled:n,readOnly:o,"aria-label":N("datetime.minutes","Minutes"),onChange:A,onKeyDown:_=>z("m",_)}),D&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"nice-timepicker__colon",children:":"}),a.jsx("input",{type:"number",className:"nice-timepicker__part",value:Nt(x.seconds),min:0,max:59,disabled:n,readOnly:o,"aria-label":N("datetime.seconds","Seconds"),onChange:E,onKeyDown:_=>z("s",_)})]}),m==="12"&&a.jsx("button",{type:"button",className:"nice-timepicker__ampm",disabled:n||o,onClick:M,"aria-label":N("datetime.toggleAmPm","Toggle AM/PM"),children:g}),b&&u&&a.jsx("button",{type:"button",className:"nice-input__clear",disabled:n||o,onClick:W,"aria-label":N("controls.clear","Clear"),children:"✕"})]}),r&&a.jsx("div",{id:`${$}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{id:`${$}-helper`,className:"nice-field__helper",children:e})]})});Wa.displayName="NiceTimePicker";function Kd(t){return[...t].map(e=>e==="9"?{type:"digit"}:e==="a"?{type:"letter"}:e==="*"?{type:"alphanum"}:{type:"literal",literal:e})}function Gd(t,e){return e.type==="digit"?/\d/.test(t):e.type==="letter"?/[a-zA-Z]/.test(t):e.type==="alphanum"?/[a-zA-Z0-9]/.test(t):!1}function Sr(t,e,r){let i=0,n="";for(const o of e)o.type==="literal"?n+=o.literal:i<t.length?(n+=t[i],i++):n+=r;return n}function Yd(t,e){return t.map(r=>r.type==="literal"?r.literal:e).join("")}function Ud(t,e){for(let r=e;r<t.length;r++)if(t[r].type!=="literal")return r;return t.length}const Ba=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,value:u="",onChange:y,onBlur:h,onKeyDown:m,mask:v,maskChar:D="_",placeholder:w,showMaskAsPlaceholder:k=!0,clearable:b=!1,autoFocus:C,...j},N)=>{const{t:$}=De(),x=Ee(d),F=s.useRef(null),[I,P]=s.useState(!1),A=s.useMemo(()=>Kd(v),[v]),E=s.useMemo(()=>Sr(u,A,D),[u,A,D]),M=I||u?E:"",W=w??(k?Yd(A,D):void 0),z=s.useCallback(O=>{F.current=O,typeof N=="function"?N(O):N&&(N.current=O)},[N]),T=s.useCallback(O=>{const Y=Sr(O,A,D);y==null||y(O,Y)},[y,A,D]),g=s.useCallback(O=>{const Y=O.currentTarget,G=Y.value;let B="",K=0;for(let J=0;J<G.length&&K<A.length;J++){const he=G[J];for(;K<A.length&&A[K].type==="literal";)K++;if(K>=A.length)break;Gd(he,A[K])&&(B+=he,K++)}T(B),requestAnimationFrame(()=>{Ud(A,0);let J=0,he=0;for(let pe=0;pe<A.length;pe++)if(A[pe].type==="literal")J=pe+1;else if(he<B.length)he++,J=pe+1;else{J=pe;break}he>=B.length&&B.length>0&&(J=Math.min(J,A.length)),Y.setSelectionRange(J,J)})},[A,T]),_=s.useCallback(O=>{if(O.key==="Backspace"&&u.length>0){O.preventDefault();const Y=u.slice(0,-1);T(Y)}m==null||m(O)},[u,T,m]),S=s.useCallback(()=>P(!0),[]),R=s.useCallback(O=>{P(!1),h==null||h(O)},[h]),L=s.useCallback(()=>{var O;T(""),(O=F.current)==null||O.focus()},[T]);return a.jsxs("div",{className:`nice-field ${p||""}`,style:f,children:[t&&a.jsx("label",{htmlFor:x,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:t}),a.jsxs("div",{className:`nice-input nice-input--${c} ${r?"nice-input--error":""} ${n?"nice-input--disabled":""} ${o?"nice-input--readonly":""}`,children:[a.jsx("input",{ref:z,id:x,className:"nice-input__native nice-masked-input",type:"text",name:l,value:M,placeholder:W,disabled:n,readOnly:o,autoFocus:C,"aria-invalid":!!r,"aria-describedby":r?`${x}-error`:e?`${x}-helper`:void 0,onInput:g,onChange:()=>{},onKeyDown:_,onFocus:S,onBlur:R,...j}),b&&u&&a.jsx("button",{type:"button",className:"nice-input__clear",disabled:n||o,onClick:L,"aria-label":$("controls.clear","Clear"),children:"✕"})]}),r&&a.jsx("div",{id:`${x}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{id:`${x}-helper`,className:"nice-field__helper",children:e})]})});Ba.displayName="NiceMaskedInput";const Zd=({filled:t,size:e})=>a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t==="half"&&a.jsx("defs",{children:a.jsxs("linearGradient",{id:"halfGrad",children:[a.jsx("stop",{offset:"50%",stopColor:"currentColor"}),a.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),a.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:t==="full"?"currentColor":t==="half"?"url(#halfGrad)":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]}),Xd={xxs:10,xs:14,sm:18,md:22,lg:28,xl:34,xxl:42},qa=s.forwardRef(({value:t=0,onChange:e,count:r=5,half:i=!1,readOnly:n=!1,disabled:o=!1,size:c="md",label:l,icon:d,name:p,error:f,id:u,className:y,style:h,...m},v)=>{const{t:D}=De(),w=Ee(u),[k,b]=s.useState(null),C=Xd[c],j=!n&&!o,N=k??t,$=A=>N>=A+1?"full":i&&N>=A+.5?"half":"empty",x=s.useCallback((A,E)=>{if(!j)return;const M=E&&i?A+.5:A+1;e==null||e(M===t?0:M)},[j,i,e,t]),F=s.useCallback((A,E)=>{if(j)if(i){const M=E.currentTarget.getBoundingClientRect(),W=E.clientX-M.left<M.width/2;b(W?A+.5:A+1)}else b(A+1)},[j,i]),I=s.useCallback(()=>{j&&b(null)},[j]),P=s.useCallback(A=>{if(!j)return;const E=i?.5:1;if(A.key==="ArrowRight"||A.key==="ArrowUp"){A.preventDefault();const M=Math.min(r,t+E);e==null||e(M)}else if(A.key==="ArrowLeft"||A.key==="ArrowDown"){A.preventDefault();const M=Math.max(0,t-E);e==null||e(M)}},[j,i,r,t,e]);return a.jsxs("div",{className:`nice-field ${y||""}`,style:h,...m,children:[l&&a.jsx("label",{htmlFor:w,className:"nice-field__label",children:l}),a.jsxs("div",{ref:v,id:w,className:`nice-rating nice-rating--${c} ${o?"nice-rating--disabled":""} ${n?"nice-rating--readonly":""}`,role:"slider","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":r,"aria-label":l||D("controls.rating","Rating"),"aria-invalid":!!f,tabIndex:j?0:-1,onMouseLeave:I,onKeyDown:P,children:[p&&a.jsx("input",{type:"hidden",name:p,value:t}),Array.from({length:r},(A,E)=>{const M=$(E);return a.jsx("span",{className:`nice-rating__star nice-rating__star--${M}`,onClick:W=>{if(!j)return;const z=W.currentTarget.getBoundingClientRect(),T=i&&W.clientX-z.left<z.width/2;x(E,T)},onMouseMove:W=>F(E,W),"aria-label":`${E+1} ${D("controls.star","star")}`,children:d?d(M):a.jsx(Zd,{filled:M,size:C})},E)})]}),f&&a.jsx("div",{className:"nice-field__error",role:"alert",children:f})]})});qa.displayName="NiceRating";const Jd=[{id:"length",label:"At least 8 characters",test:t=>t.length>=8},{id:"uppercase",label:"At least one uppercase letter",test:t=>/[A-Z]/.test(t)},{id:"lowercase",label:"At least one lowercase letter",test:t=>/[a-z]/.test(t)},{id:"digit",label:"At least one digit",test:t=>/\d/.test(t)},{id:"special",label:"At least one special character",test:t=>/[^a-zA-Z0-9]/.test(t)}];function Qd(t,e){if(!t)return{level:"none",passed:[],ratio:0};const r=e.filter(o=>o.test(t)).map(o=>o.id),i=r.length/e.length;let n="weak";return i>=1?n="strong":i>=.75?n="good":i>=.5&&(n="fair"),{level:n,passed:r,ratio:i}}const Va=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,value:u="",onChange:y,onBlur:h,onKeyDown:m,placeholder:v,maxLength:D,showToggle:w=!0,showStrength:k=!1,strengthRules:b,autoFocus:C,autoComplete:j,...N},$)=>{const{t:x}=De(),F=Ee(d),[I,P]=s.useState(!1),A=b??Jd,E=s.useMemo(()=>k?Qd(u,A):null,[k,u,A]),M=s.useCallback(()=>P(W=>!W),[]);return a.jsxs("div",{className:`nice-field ${p||""}`,style:f,children:[t&&a.jsx("label",{htmlFor:F,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:t}),a.jsxs("div",{className:`nice-input nice-input--${c} ${r?"nice-input--error":""} ${n?"nice-input--disabled":""} ${o?"nice-input--readonly":""}`,children:[a.jsx("input",{ref:$,id:F,className:"nice-input__native",type:I?"text":"password",name:l,value:u,placeholder:v,disabled:n,readOnly:o,maxLength:D,autoFocus:C,autoComplete:j,"aria-invalid":!!r,"aria-describedby":r?`${F}-error`:e?`${F}-helper`:void 0,onChange:W=>y==null?void 0:y(W.target.value),onBlur:h,onKeyDown:m,...N}),w&&a.jsx("button",{type:"button",className:"nice-password__toggle",onClick:M,disabled:n,tabIndex:-1,"aria-label":I?x("password.hide","Hide password"):x("password.show","Show password"),children:I?a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.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"}),a.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),k&&E&&u&&a.jsxs("div",{className:"nice-password__strength",children:[a.jsx("div",{className:"nice-password__meter",children:a.jsx("div",{className:`nice-password__meter-fill nice-password__meter-fill--${E.level}`,style:{width:`${E.ratio*100}%`}})}),a.jsx("span",{className:`nice-password__strength-label nice-password__strength-label--${E.level}`,children:x(`password.strength.${E.level}`,E.level.charAt(0).toUpperCase()+E.level.slice(1))}),a.jsx("ul",{className:"nice-password__rules",children:A.map(W=>{const z=E.passed.includes(W.id);return a.jsxs("li",{className:`nice-password__rule ${z?"nice-password__rule--passed":""}`,children:[a.jsx("span",{className:"nice-password__rule-icon",children:z?"✓":"✗"}),W.label]},W.id)})})]}),r&&a.jsx("div",{id:`${F}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{id:`${F}-helper`,className:"nice-field__helper",children:e})]})});Va.displayName="NicePasswordInput";const Ka=s.forwardRef(({length:t=6,value:e="",onChange:r,masked:i=!1,onComplete:n,label:o,helperText:c,error:l,required:d,disabled:p,readOnly:f,size:u="md",name:y,id:h,className:m,style:v,autoFocus:D,...w},k)=>{const b=Ee(h),C=s.useRef([]),j=e.padEnd(t,"").slice(0,t).split(""),N=s.useCallback(P=>{var E;const A=Math.max(0,Math.min(t-1,P));(E=C.current[A])==null||E.focus()},[t]),$=s.useCallback(P=>{const A=P.join("");r==null||r(A),A.length===t&&A.indexOf("")===-1&&/^\d+$/.test(A)&&(n==null||n(A))},[r,n,t]),x=s.useCallback((P,A)=>{const E=A.target.value.replace(/\D/g,"").slice(-1);if(!E)return;const M=[...j];M[P]=E,$(M),N(P+1)},[j,$,N]),F=s.useCallback((P,A)=>{if(A.key==="Backspace"){A.preventDefault();const E=[...j];j[P]?(E[P]="",$(E)):P>0&&(E[P-1]="",$(E),N(P-1))}else A.key==="ArrowLeft"?(A.preventDefault(),N(P-1)):A.key==="ArrowRight"&&(A.preventDefault(),N(P+1))},[j,$,N]),I=s.useCallback(P=>{P.preventDefault();const A=P.clipboardData.getData("text").replace(/\D/g,"").slice(0,t);if(!A)return;const E=A.padEnd(t,"").slice(0,t).split("");for(let M=A.length;M<t;M++)E[M]=j[M]||"";$(E),N(Math.min(A.length,t-1))},[t,j,$,N]);return a.jsxs("div",{className:`nice-field ${m||""}`,style:v,...w,children:[o&&a.jsx("label",{htmlFor:`${b}-0`,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:o}),a.jsxs("div",{ref:k,className:`nice-otp nice-otp--${u} ${l?"nice-otp--error":""} ${p?"nice-otp--disabled":""}`,onPaste:I,children:[Array.from({length:t},(P,A)=>a.jsx("input",{ref:E=>{C.current[A]=E},id:A===0?`${b}-0`:void 0,className:"nice-otp__digit",type:i?"password":"text",inputMode:"numeric",maxLength:2,value:j[A]||"",disabled:p,readOnly:f,autoFocus:D&&A===0,"aria-invalid":!!l,"aria-label":`${A+1}`,onChange:E=>x(A,E),onKeyDown:E=>F(A,E),onFocus:E=>E.target.select()},A)),y&&a.jsx("input",{type:"hidden",name:y,value:e})]}),l&&a.jsx("div",{id:`${b}-error`,className:"nice-field__error",role:"alert",children:l}),!l&&c&&a.jsx("div",{id:`${b}-helper`,className:"nice-field__helper",children:c})]})});Ka.displayName="NiceInputOtp";const eu={xxs:36,xs:48,sm:64,md:80,lg:100,xl:128,xxl:160},Ut=6,nt=135,Pt=405,fa=Pt-nt;function _a(t,e,r,i){const n=(i-90)*(Math.PI/180);return{x:t+r*Math.cos(n),y:e+r*Math.sin(n)}}function jr(t,e,r,i,n){const o=_a(t,e,r,i),c=_a(t,e,r,n),l=n-i>180?1:0;return`M ${o.x} ${o.y} A ${r} ${r} 0 ${l} 1 ${c.x} ${c.y}`}const Ga=s.forwardRef(({value:t=0,onChange:e,min:r=0,max:i=100,step:n=1,showValue:o=!0,valueTemplate:c="{value}",label:l,helperText:d,error:p,required:f,disabled:u,readOnly:y,size:h="md",name:m,id:v,className:D,style:w,...k},b)=>{const C=Ee(v),j=s.useRef(!1),N=s.useRef(null),$=typeof h=="number"?h:eu[h],x=$/2,F=$/2,I=($-Ut*2)/2,P=i>r?(t-r)/(i-r):0,A=nt+P*fa,E=s.useCallback(g=>{let _=g<0?g+360:g;_=_+90,_>360&&(_-=360),_<nt&&(_=nt),_>Pt-360&&_<nt&&(_=nt);let S=_;S<nt&&(S+=360);let R=(S-nt)/fa;R=Math.max(0,Math.min(1,R));const L=r+R*(i-r);return Math.round(L/n)*n},[r,i,n]),M=s.useCallback(g=>{if(u||y)return;const _=N.current;if(!_)return;const S=_.getBoundingClientRect(),R=g.clientX-S.left-S.width/2,L=g.clientY-S.top-S.height/2,O=Math.atan2(L,R)*(180/Math.PI)+90;let Y=O<0?O+360:O;Y<nt-360+fa&&Y>Pt-360&&(Y=Y<180?Pt-360:nt);const G=E(Y-90),B=Math.max(r,Math.min(i,G));e==null||e(B)},[E,u,y,r,i,e]);s.useEffect(()=>{const g=S=>{j.current&&M(S)},_=()=>{j.current=!1};return window.addEventListener("pointermove",g),window.addEventListener("pointerup",_),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",_)}},[M]);const W=s.useCallback(g=>{if(u||y)return;let _=t;g.key==="ArrowUp"||g.key==="ArrowRight"?(g.preventDefault(),_=Math.min(i,t+n)):(g.key==="ArrowDown"||g.key==="ArrowLeft")&&(g.preventDefault(),_=Math.max(r,t-n)),_!==t&&(e==null||e(_))},[t,e,r,i,n,u,y]),z=c.replace("{value}",String(t)),T=_a(x,F,I,A);return a.jsxs("div",{className:`nice-field ${D||""}`,style:w,...k,children:[l&&a.jsx("label",{htmlFor:C,className:`nice-field__label ${f?"nice-field__label--required":""}`,children:l}),a.jsxs("div",{ref:g=>{N.current=g,typeof b=="function"?b(g):b&&(b.current=g)},className:`nice-knob nice-knob--${h} ${u?"nice-knob--disabled":""} ${p?"nice-knob--error":""}`,role:"slider",id:C,tabIndex:u?-1:0,"aria-valuenow":t,"aria-valuemin":r,"aria-valuemax":i,"aria-disabled":u,"aria-invalid":!!p,onPointerDown:g=>{u||y||(j.current=!0,M(g))},onKeyDown:W,children:[a.jsxs("svg",{width:$,height:$,viewBox:`0 0 ${$} ${$}`,children:[a.jsx("path",{d:jr(x,F,I,nt,Pt),fill:"none",stroke:"var(--nice-border-color, #d1d5db)",strokeWidth:Ut,strokeLinecap:"round"}),P>0&&a.jsx("path",{d:jr(x,F,I,nt,A),fill:"none",stroke:"var(--nice-primary, #3b82f6)",strokeWidth:Ut,strokeLinecap:"round"}),a.jsx("circle",{cx:T.x,cy:T.y,r:Ut,fill:"var(--nice-primary, #3b82f6)"})]}),o&&a.jsx("span",{className:"nice-knob__value",children:z}),m&&a.jsx("input",{type:"hidden",name:m,value:t})]}),p&&a.jsx("div",{className:"nice-field__error",role:"alert",children:p}),!p&&d&&a.jsx("div",{className:"nice-field__helper",children:d})]})});Ga.displayName="NiceKnob";const Ya=s.forwardRef(({value:t="",onChange:e,suggestions:r=[],onSearch:i,trigger:n="@",renderSuggestion:o,placeholder:c,rows:l=3,label:d,helperText:p,error:f,required:u,disabled:y,readOnly:h,size:m="md",name:v,id:D,className:w,style:k,...b},C)=>{const j=Ee(D),[N,$]=s.useState(!1),[x,F]=s.useState(""),[I,P]=s.useState(0),[A,E]=s.useState({top:0,left:0}),M=s.useRef(null),W=s.useRef(-1),z=r.map(R=>typeof R=="string"?{key:R,label:R}:R).filter(R=>R.label.toLowerCase().includes(x.toLowerCase())),T=s.useCallback(()=>{$(!1),F(""),P(0),W.current=-1},[]),g=s.useCallback(R=>{const L=M.current;if(!L||W.current<0)return;const O=t.slice(0,W.current),Y=t.slice(L.selectionStart),G=`${n}${R.label} `,B=O+G+Y;e==null||e(B),T(),requestAnimationFrame(()=>{const K=O.length+G.length;L.setSelectionRange(K,K),L.focus()})},[t,e,n,T]),_=s.useCallback(R=>{const L=R.target.value;e==null||e(L);const O=R.target.selectionStart,Y=L.slice(0,O),G=Y.lastIndexOf(n);if(G>=0){const B=G>0?Y[G-1]:" ",K=Y.slice(G+n.length);if(/\s/.test(B)&&!/\s/.test(K)){W.current=G;const J=K;F(J),$(!0),P(0),i==null||i(J);const he=R.target,pe=he.getBoundingClientRect(),we=parseInt(getComputedStyle(he).lineHeight)||20,se=Y.split(`
|
|
76
|
+
`);E({top:pe.top+se.length*we+4-he.scrollTop,left:pe.left+8});return}}T()},[e,n,i,T]),S=s.useCallback(R=>{!N||z.length===0||(R.key==="ArrowDown"?(R.preventDefault(),P(L=>(L+1)%z.length)):R.key==="ArrowUp"?(R.preventDefault(),P(L=>(L-1+z.length)%z.length)):R.key==="Enter"?(R.preventDefault(),z[I]&&g(z[I])):R.key==="Escape"&&T())},[N,z,I,g,T]);return s.useEffect(()=>{if(!N)return;const R=L=>{const O=M.current;O&&!O.contains(L.target)&&T()};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[N,T]),a.jsxs("div",{className:`nice-field ${w||""}`,style:k,...b,children:[d&&a.jsx("label",{htmlFor:j,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:d}),a.jsxs("div",{className:`nice-mention nice-mention--${m} ${f?"nice-mention--error":""} ${y?"nice-mention--disabled":""}`,children:[a.jsx("textarea",{ref:R=>{M.current=R,typeof C=="function"?C(R):C&&(C.current=R)},id:j,name:v,className:"nice-mention__input",value:t,onChange:_,onKeyDown:S,placeholder:c,rows:l,disabled:y,readOnly:h,"aria-invalid":!!f,"aria-describedby":f?`${j}-error`:p?`${j}-helper`:void 0,"aria-autocomplete":"list","aria-expanded":N}),N&&z.length>0&&a.jsx("ul",{className:"nice-mention__suggestions",role:"listbox",style:{position:"fixed",top:A.top,left:A.left},children:z.map((R,L)=>a.jsx("li",{role:"option","aria-selected":L===I,className:`nice-mention__suggestion ${L===I?"nice-mention__suggestion--active":""}`,onMouseDown:O=>{O.preventDefault(),g(R)},onMouseEnter:()=>P(L),children:o?o(R):a.jsxs(a.Fragment,{children:[R.icon&&a.jsx("span",{className:"nice-mention__suggestion-icon",children:R.icon}),a.jsx("span",{children:R.label})]})},R.key))})]}),f&&a.jsx("div",{id:`${j}-error`,className:"nice-field__error",role:"alert",children:f}),!f&&p&&a.jsx("div",{id:`${j}-helper`,className:"nice-field__helper",children:p})]})});Ya.displayName="NiceMention";function tu(t){const e=[],r=i=>{for(const n of i)e.push(n),n.children&&r(n.children)};return r(t),e}function Ni(t,e){const r=e.toLowerCase();return t.reduce((i,n)=>{const o=n.children?Ni(n.children,e):[];return(n.label.toLowerCase().includes(r)||o.length>0)&&i.push({...n,children:o.length>0?o:n.children}),i},[])}const Mi=({node:t,level:e,selectedKeys:r,expandedKeys:i,onToggleExpand:n,onSelect:o,selectableLeafsOnly:c})=>{const l=t.children&&t.children.length>0,d=i.has(t.key),p=r.has(t.key),f=!l,u=!t.disabled&&(!c||f);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`nice-tree-select__node ${p?"nice-tree-select__node--selected":""} ${t.disabled?"nice-tree-select__node--disabled":""}`,style:{paddingLeft:e*16+8},onClick:()=>u&&o(t.key),role:"treeitem","aria-selected":p,"aria-expanded":l?d:void 0,"aria-disabled":t.disabled,children:[l?a.jsx("button",{type:"button",className:"nice-tree-select__toggle",onClick:y=>{y.stopPropagation(),n(t.key)},"aria-label":"Toggle",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",style:{transform:d?"rotate(90deg)":"none",transition:"transform 0.15s"},children:a.jsx("path",{d:"M4.5 2l4 4-4 4"})})}):a.jsx("span",{style:{width:12,display:"inline-block"}}),t.icon&&a.jsx("span",{className:"nice-tree-select__node-icon",children:t.icon}),a.jsx("span",{className:"nice-tree-select__node-label",children:t.label})]}),l&&d&&t.children.map(y=>a.jsx(Mi,{node:y,level:e+1,selectedKeys:r,expandedKeys:i,onToggleExpand:n,onSelect:o,selectableLeafsOnly:c},y.key))]})},Ua=s.forwardRef(({nodes:t,value:e,onChange:r,multiple:i=!1,searchable:n=!1,placeholder:o,selectableLeafsOnly:c=!1,clearable:l=!1,label:d,helperText:p,error:f,required:u,disabled:y,readOnly:h,size:m="md",name:v,id:D,className:w,style:k,...b},C)=>{const{t:j}=De(),N=Ee(D),[$,x]=s.useState(!1),[F,I]=s.useState(""),[P,A]=s.useState(new Set),E=s.useRef(null);vt(E,()=>x(!1));const M=s.useMemo(()=>e==null?new Set:new Set(Array.isArray(e)?e:[e]),[e]),W=s.useMemo(()=>F?Ni(t,F):t,[t,F]),z=s.useMemo(()=>{const S=tu(t);return Array.from(M).map(R=>{var L;return(L=S.find(O=>O.key===R))==null?void 0:L.label}).filter(Boolean)},[M,t]),T=s.useCallback(S=>{A(R=>{const L=new Set(R);return L.has(S)?L.delete(S):L.add(S),L})},[]),g=s.useCallback(S=>{if(i){const R=new Set(M);R.has(S)?R.delete(S):R.add(S),r==null||r(Array.from(R))}else r==null||r(S),x(!1)},[i,M,r]),_=s.useCallback(S=>{S.stopPropagation(),r==null||r(i?[]:"")},[r,i]);return a.jsxs("div",{className:`nice-field ${w||""}`,style:k,...b,children:[d&&a.jsx("label",{htmlFor:N,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:d}),a.jsxs("div",{ref:E,className:"nice-tree-select",style:{position:"relative"},children:[a.jsxs("div",{ref:C,id:N,className:`nice-input nice-input--${m} ${f?"nice-input--error":""} ${y?"nice-input--disabled":""} ${h?"nice-input--readonly":""}`,role:"combobox","aria-expanded":$,"aria-haspopup":"tree","aria-invalid":!!f,tabIndex:y?-1:0,onClick:()=>!y&&!h&&x(!$),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),!y&&!h&&x(!$))},children:[a.jsx("span",{className:"nice-tree-select__display",children:z.length>0?z.join(", "):a.jsx("span",{className:"nice-tree-select__placeholder",children:o??j("controls.select","Select...")})}),l&&M.size>0&&a.jsx("button",{type:"button",className:"nice-input__clear",onClick:_,"aria-label":j("controls.clear","Clear"),children:"✕"}),a.jsx("svg",{className:"nice-tree-select__arrow",width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",style:{transform:$?"rotate(180deg)":"none",transition:"transform 0.15s"},children:a.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"})})]}),$&&a.jsxs("div",{className:"nice-tree-select__dropdown",role:"tree",children:[n&&a.jsx("div",{className:"nice-tree-select__search",children:a.jsx("input",{className:"nice-input__native",type:"text",placeholder:j("controls.search","Search..."),value:F,onChange:S=>I(S.target.value),autoFocus:!0,onClick:S=>S.stopPropagation()})}),a.jsx("div",{className:"nice-tree-select__list",children:W.length===0?a.jsx("div",{className:"nice-tree-select__empty",children:j("controls.noResults","No results")}):W.map(S=>a.jsx(Mi,{node:S,level:0,selectedKeys:M,expandedKeys:P,onToggleExpand:T,onSelect:g,selectableLeafsOnly:c},S.key))})]})]}),v&&a.jsx("input",{type:"hidden",name:v,value:Array.isArray(e)?e.join(","):e??""}),f&&a.jsx("div",{id:`${N}-error`,className:"nice-field__error",role:"alert",children:f}),!f&&p&&a.jsx("div",{id:`${N}-helper`,className:"nice-field__helper",children:p})]})});Ua.displayName="NiceTreeSelect";function Ft(t,e){return String(t[e])}const Za=s.forwardRef(({source:t,target:e,onChange:r,keyField:i="id",labelField:n="label",renderItem:o,filterable:c=!1,sourceHeader:l,targetHeader:d,disabled:p=!1,size:f="md",className:u,style:y,id:h,...m},v)=>{const{t:D}=De(),[w,k]=s.useState(new Set),[b,C]=s.useState(new Set),[j,N]=s.useState(""),[$,x]=s.useState(""),F=s.useCallback((z,T,g)=>{T(_=>{const S=new Set(_);return S.has(g)?S.delete(g):S.add(g),S})},[]),I=s.useCallback(()=>{const z=t.filter(g=>w.has(Ft(g,i))),T=t.filter(g=>!w.has(Ft(g,i)));r(T,[...e,...z]),k(new Set)},[t,e,w,i,r]),P=s.useCallback(()=>{const z=e.filter(g=>b.has(Ft(g,i))),T=e.filter(g=>!b.has(Ft(g,i)));r([...t,...z],T),C(new Set)},[t,e,b,i,r]),A=s.useCallback(()=>{r([],[...e,...t]),k(new Set)},[t,e,r]),E=s.useCallback(()=>{r([...t,...e],[]),C(new Set)},[t,e,r]),M=(z,T)=>{if(!T)return z;const g=T.toLowerCase();return z.filter(_=>String(_[n]).toLowerCase().includes(g))},W=(z,T,g,_,S,R)=>{const L=M(z,_);return a.jsxs("div",{className:"nice-picklist__panel",children:[R&&a.jsx("div",{className:"nice-picklist__header",children:R}),c&&a.jsx("div",{className:"nice-picklist__filter",children:a.jsx("input",{className:"nice-input__native",type:"text",placeholder:D("controls.search","Search..."),value:_,onChange:O=>S(O.target.value)})}),a.jsxs("div",{className:"nice-picklist__list",role:"listbox","aria-multiselectable":"true",children:[L.map(O=>{const Y=Ft(O,i),G=T.has(Y);return a.jsx("div",{className:`nice-picklist__item ${G?"nice-picklist__item--selected":""}`,role:"option","aria-selected":G,onClick:()=>!p&&F(T,g,Y),children:o?o(O):String(O[n])},Y)}),L.length===0&&a.jsx("div",{className:"nice-picklist__empty",children:D("controls.noItems","No items")})]})]})};return a.jsxs("div",{ref:v,id:h,className:`nice-picklist nice-picklist--${f} ${p?"nice-picklist--disabled":""} ${u||""}`,style:y,...m,children:[W(t,w,k,j,N,l??D("picklist.source","Available")),a.jsxs("div",{className:"nice-picklist__controls",children:[a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:p||w.size===0,onClick:I,"aria-label":D("picklist.moveRight","Move right"),children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:a.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"})})}),a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:p||t.length===0,onClick:A,"aria-label":D("picklist.moveAllRight","Move all right"),children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:[a.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"}),a.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"})]})}),a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:p||b.size===0,onClick:P,"aria-label":D("picklist.moveLeft","Move left"),children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:a.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"})})}),a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:p||e.length===0,onClick:E,"aria-label":D("picklist.moveAllLeft","Move all left"),children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:[a.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"}),a.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"})]})})]}),W(e,b,C,$,x,d??D("picklist.target","Selected"))]})});Za.displayName="NicePickList";let ha=null,Rt=null;const Nr="https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min/vs";function zi(){return Rt?Promise.resolve(Rt):ha||(ha=new Promise((t,e)=>{if(window.monaco){Rt=window.monaco,t(Rt);return}const r=document.createElement("script");r.src=`${Nr}/loader.min.js`,r.async=!0,r.onload=()=>{const i=window.require;i.config({paths:{vs:Nr}}),i(["vs/editor/editor.main"],n=>{Rt=n,t(n)})},r.onerror=()=>{e(new Error("Failed to load Monaco Editor"))},document.head.appendChild(r)}),ha)}const Xa=s.forwardRef(function(t,e){const{value:r,onChange:i,language:n="plaintext",theme:o="vs",options:c={},height:l=400,width:d="100%",markers:p=[],decorations:f=[],completionProvider:u,onMount:y,onCursorPositionChange:h,onSelectionChange:m,onSave:v,loading:D,disabled:w=!1,showToolbar:k=!1,showStatusBar:b=!1,editorSize:C="standard",className:j,"data-testid":N}=t,$=s.useRef(null),x=s.useRef(null),F=s.useRef(null),I=s.useRef([]),P=s.useRef(null),[A,E]=s.useState(!0),[M,W]=s.useState(null),[z,T]=s.useState({lineNumber:1,column:1}),[g,_]=s.useState(""),[S,R]=s.useState(c.wordWrap==="on"),L=s.useMemo(()=>({automaticLayout:!0,readOnly:w||c.readOnly,minimap:{enabled:c.minimap??!0},lineNumbers:c.lineNumbers??"on",wordWrap:c.wordWrap??"off",tabSize:c.tabSize??2,insertSpaces:c.insertSpaces??!0,fontSize:c.fontSize??14,fontFamily:c.fontFamily??"'Fira Code', 'Consolas', 'Monaco', monospace",fontLigatures:c.fontLigatures??!0,cursorStyle:c.cursorStyle??"line",cursorBlinking:c.cursorBlinking??"blink",autoClosingBrackets:c.autoClosingBrackets??"languageDefined",autoClosingQuotes:c.autoClosingQuotes??"languageDefined",formatOnPaste:c.formatOnPaste??!1,formatOnType:c.formatOnType??!1,renderWhitespace:c.renderWhitespace??"selection",renderControlCharacters:c.renderControlCharacters??!1,scrollBeyondLastLine:c.scrollBeyondLastLine??!0,smoothScrolling:c.smoothScrolling??!0,folding:c.folding??!0,showFoldingControls:c.showFoldingControls??"mouseover","bracketPairColorization.enabled":c.bracketPairColorization??!0,guides:c.guides??{bracketPairs:!0,indentation:!0,highlightActiveIndentation:!0},stickyScroll:{enabled:c.stickyScroll??!1},quickSuggestions:c.quickSuggestions??!0,suggestOnTriggerCharacters:c.suggestOnTriggerCharacters??!0,acceptSuggestionOnEnter:c.acceptSuggestionOnEnter??"on",inlayHints:{enabled:c.inlayHints?"on":"off"}}),[c,w]);s.useEffect(()=>{if(!$.current)return;let B=!0;return zi().then(K=>{if(!B||!$.current)return;F.current=K;const J=K.editor.create($.current,{value:r,language:n,theme:o,...L});x.current=J,E(!1),J.onDidChangeModelContent(()=>{const he=J.getValue();i==null||i(he)}),J.onDidChangeCursorPosition(he=>{T({lineNumber:he.position.lineNumber,column:he.position.column}),h==null||h({lineNumber:he.position.lineNumber,column:he.position.column})}),J.onDidChangeCursorSelection(he=>{var se;const pe=he.selection,we=((se=J.getModel())==null?void 0:se.getValueInRange(pe))??"";_(we),m==null||m({startLineNumber:pe.startLineNumber,startColumn:pe.startColumn,endLineNumber:pe.endLineNumber,endColumn:pe.endColumn})}),J.addCommand(K.KeyMod.CtrlCmd|K.KeyCode.KeyS,()=>{v==null||v(J.getValue())}),y==null||y(J,K)}).catch(K=>{B&&(W(K.message??"Failed to load editor"),E(!1))}),()=>{var K,J;B=!1,(K=x.current)==null||K.dispose(),(J=P.current)==null||J.dispose()}},[]),s.useEffect(()=>{const B=x.current;if(B&&r!==B.getValue()){const K=B.getPosition();B.setValue(r),K&&B.setPosition(K)}},[r]),s.useEffect(()=>{const B=x.current,K=F.current;if(B&&K){const J=B.getModel();J&&K.editor.setModelLanguage(J,n)}},[n]),s.useEffect(()=>{const B=F.current;B&&B.editor.setTheme(o)},[o]),s.useEffect(()=>{const B=x.current;B&&B.updateOptions(L)},[L]),s.useEffect(()=>{const B=x.current,K=F.current;if(B&&K){const J=B.getModel();if(J){const he=p.map(pe=>({startLineNumber:pe.startLineNumber,startColumn:pe.startColumn,endLineNumber:pe.endLineNumber,endColumn:pe.endColumn,message:pe.message,severity:pe.severity}));K.editor.setModelMarkers(J,"owner",he)}}},[p]),s.useEffect(()=>{const B=x.current;if(B&&f.length>0){const K=f.map(J=>({range:{startLineNumber:J.range.startLineNumber,startColumn:J.range.startColumn,endLineNumber:J.range.endLineNumber,endColumn:J.range.endColumn},options:{className:J.className,glyphMarginClassName:J.glyphMarginClassName,hoverMessage:J.hoverMessage?{value:J.hoverMessage}:void 0,isWholeLine:J.isWholeLine}}));I.current=B.deltaDecorations(I.current,K)}},[f]),s.useEffect(()=>{var J;const B=F.current;if(!B||!u)return;(J=P.current)==null||J.dispose();const K={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 P.current=B.languages.registerCompletionItemProvider(n,{provideCompletionItems:async(he,pe)=>({suggestions:(await u(he,pe)).map(we=>({label:we.label,kind:K[we.kind]??0,insertText:we.insertText,insertTextRules:we.insertTextRules==="insertAsSnippet"?4:void 0,documentation:we.documentation,detail:we.detail,range:{startLineNumber:pe.lineNumber,startColumn:pe.column,endLineNumber:pe.lineNumber,endColumn:pe.column}}))})}),()=>{var he;(he=P.current)==null||he.dispose()}},[n,u]),s.useImperativeHandle(e,()=>({getEditor:()=>x.current,getMonaco:()=>F.current,focus:()=>{var B;return(B=x.current)==null?void 0:B.focus()},getValue:()=>{var B;return((B=x.current)==null?void 0:B.getValue())??""},setValue:B=>{var K;return(K=x.current)==null?void 0:K.setValue(B)},getSelection:()=>{var J;const B=x.current;if(!B)return"";const K=B.getSelection();return K?((J=B.getModel())==null?void 0:J.getValueInRange(K))??"":""},insertText:B=>{const K=x.current;if(!K)return;const J=K.getSelection();J&&K.executeEdits("",[{range:J,text:B}])},formatDocument:()=>{var B,K;(K=(B=x.current)==null?void 0:B.getAction("editor.action.formatDocument"))==null||K.run()},goToLine:(B,K=1)=>{const J=x.current;J&&(J.setPosition({lineNumber:B,column:K}),J.revealLineInCenter(B),J.focus())},findReplace:()=>{var B,K;(K=(B=x.current)==null?void 0:B.getAction("editor.action.startFindReplaceAction"))==null||K.run()},undo:()=>{var B;(B=x.current)==null||B.trigger("keyboard","undo",null)},redo:()=>{var B;(B=x.current)==null||B.trigger("keyboard","redo",null)},getCursorPosition:()=>{var K;const B=(K=x.current)==null?void 0:K.getPosition();return{lineNumber:(B==null?void 0:B.lineNumber)??1,column:(B==null?void 0:B.column)??1}},setMarkers:B=>{const K=x.current,J=F.current;if(K&&J){const he=K.getModel();if(he){const pe=B.map(we=>({startLineNumber:we.startLineNumber,startColumn:we.startColumn,endLineNumber:we.endLineNumber,endColumn:we.endColumn,message:we.message,severity:we.severity}));J.editor.setModelMarkers(he,"owner",pe)}}}}),[]);const O=s.useMemo(()=>({format:()=>{var B,K;return(K=(B=x.current)==null?void 0:B.getAction("editor.action.formatDocument"))==null?void 0:K.run()},undo:()=>{var B;return(B=x.current)==null?void 0:B.trigger("keyboard","undo",null)},redo:()=>{var B;return(B=x.current)==null?void 0:B.trigger("keyboard","redo",null)},find:()=>{var B,K;return(K=(B=x.current)==null?void 0:B.getAction("editor.action.startFindReplaceAction"))==null?void 0:K.run()},toggleWordWrap:()=>{var K;const B=!S;R(B),(K=x.current)==null||K.updateOptions({wordWrap:B?"on":"off"})},toggleMinimap:()=>{var K,J,he,pe,we,se;const B=(we=(K=x.current)==null?void 0:K.getOption)==null?void 0:we.call(K,(pe=(he=(J=F.current)==null?void 0:J.editor)==null?void 0:he.EditorOption)==null?void 0:pe.minimap);(se=x.current)==null||se.updateOptions({minimap:{enabled:!(B!=null&&B.enabled)}})},foldAll:()=>{var B,K;return(K=(B=x.current)==null?void 0:B.getAction("editor.foldAll"))==null?void 0:K.run()},unfoldAll:()=>{var B,K;return(K=(B=x.current)==null?void 0:B.getAction("editor.unfoldAll"))==null?void 0:K.run()}}),[S]),Y=r.split(`
|
|
77
|
+
`).length,G=r.length;return A?a.jsx("div",{className:`nice-code-editor nice-code-editor--loading ${j??""}`,style:{height:l,width:d},"data-testid":N,children:D??a.jsx("div",{className:"nice-code-editor__loader",children:"Loading editor..."})}):M?a.jsx("div",{className:`nice-code-editor nice-code-editor--error ${j??""}`,style:{height:l,width:d},"data-testid":N,children:a.jsxs("div",{className:"nice-code-editor__error",children:[a.jsxs("span",{children:["⚠️ ",M]}),a.jsx("textarea",{value:r,onChange:B=>i==null?void 0:i(B.target.value),readOnly:w||c.readOnly,style:{width:"100%",height:"100%",fontFamily:"monospace"}})]})}):a.jsxs("div",{className:`nice-code-editor-wrap nice-editor--${C} ${j??""}`,style:{height:l,width:d,display:"flex",flexDirection:"column"},"data-testid":N,children:[k&&a.jsxs("div",{className:"nice-code-editor__toolbar",children:[a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:O.undo,title:"Undo (Ctrl+Z)",children:"↶"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:O.redo,title:"Redo (Ctrl+Y)",children:"↷"}),a.jsx("span",{className:"nice-code-editor__toolbar-sep"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:O.format,title:"Format (Shift+Alt+F)",children:"⎘"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:O.find,title:"Find & Replace (Ctrl+H)",children:"🔍"}),a.jsx("span",{className:"nice-code-editor__toolbar-sep"}),a.jsx("button",{className:`nice-code-editor__toolbar-btn${S?" nice-code-editor__toolbar-btn--active":""}`,onClick:O.toggleWordWrap,title:"Toggle Word Wrap",children:"↩"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:O.toggleMinimap,title:"Toggle Minimap",children:"▥"}),a.jsx("span",{className:"nice-code-editor__toolbar-sep"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:O.foldAll,title:"Fold All",children:"⊟"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:O.unfoldAll,title:"Unfold All",children:"⊞"})]}),a.jsx("div",{ref:$,className:"nice-code-editor",style:{flex:1,minHeight:0}}),b&&a.jsxs("div",{className:"nice-code-editor__statusbar",children:[a.jsxs("span",{children:["Ln ",z.lineNumber,", Col ",z.column]}),g.length>0&&a.jsxs("span",{children:["(",g.length," selected)"]}),a.jsx("span",{className:"nice-code-editor__statusbar-spacer"}),a.jsxs("span",{children:[Y," lines · ",G," chars"]}),a.jsx("span",{className:"nice-code-editor__statusbar-lang",children:n}),p.length>0&&a.jsxs("span",{className:"nice-code-editor__statusbar-markers",children:["⚠ ",p.length]})]})]})});function $i(t){const{original:e,modified:r,language:i="plaintext",theme:n="vs",height:o=400,width:c="100%",inline:l=!1,renderSideBySide:d=!0,originalEditable:p=!1,modifiedEditable:f=!1,onOriginalChange:u,onModifiedChange:y,loading:h,className:m,"data-testid":v}=t,D=s.useRef(null),w=s.useRef(null),[k,b]=s.useState(!0);return s.useEffect(()=>{if(!D.current)return;let C=!0;return zi().then(j=>{if(!C||!D.current)return;const N=j.editor.createModel(e,i),$=j.editor.createModel(r,i),x=j.editor.createDiffEditor(D.current,{automaticLayout:!0,theme:n,renderSideBySide:!l&&d,originalEditable:p,readOnly:!f});x.setModel({original:N,modified:$}),w.current=x,b(!1),p&&N.onDidChangeContent(()=>{u==null||u(N.getValue())}),f&&$.onDidChangeContent(()=>{y==null||y($.getValue())})}),()=>{var j;C=!1,(j=w.current)==null||j.dispose()}},[]),s.useEffect(()=>{const C=w.current;if(!C)return;const j=C.getModel();j&&(j.original.getValue()!==e&&j.original.setValue(e),j.modified.getValue()!==r&&j.modified.setValue(r))},[e,r]),k?a.jsx("div",{className:`nice-code-diff-editor nice-code-diff-editor--loading ${m??""}`,style:{height:o,width:c},"data-testid":v,children:h??a.jsx("div",{className:"nice-code-editor__loader",children:"Loading diff editor..."})}):a.jsx("div",{ref:D,className:`nice-code-diff-editor ${m??""}`,style:{height:o,width:c},"data-testid":v})}function Ei(t){const{value:e,onChange:r,language:i="plaintext",height:n=300,width:o="100%",readOnly:c=!1,tabSize:l=2,lineNumbers:d=!0,placeholder:p,className:f,"data-testid":u}=t,y=s.useRef(null),h=s.useCallback(v=>{var D;if(v.key==="Tab"){v.preventDefault();const w=v.currentTarget,k=w.selectionStart,b=w.selectionEnd,C=" ".repeat(l);if(v.shiftKey){const j=e.substring(0,k).lastIndexOf(`
|
|
78
|
+
`)+1;if((((D=e.substring(j,k).match(/^(\s*)/))==null?void 0:D[1])??"").length>=l){const N=e.substring(0,j)+e.substring(j+l);r==null||r(N),setTimeout(()=>{w.selectionStart=w.selectionEnd=k-l},0)}}else{const j=e.substring(0,k)+C+e.substring(b);r==null||r(j),setTimeout(()=>{w.selectionStart=w.selectionEnd=k+l},0)}}},[e,r,l]),m=e.split(`
|
|
79
|
+
`).length;return a.jsxs("div",{className:`nice-simple-code-editor ${f??""}`,style:{height:n,width:o},"data-testid":u,"data-language":i,children:[d&&a.jsx("div",{className:"nice-simple-code-editor__line-numbers",children:Array.from({length:m},(v,D)=>a.jsx("div",{className:"nice-simple-code-editor__line-number",children:D+1},D))}),a.jsx("textarea",{ref:y,className:"nice-simple-code-editor__textarea",value:e,onChange:v=>r==null?void 0:r(v.target.value),onKeyDown:h,readOnly:c,placeholder:p,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off"})]})}const Mr="nice-code-editor-styles";if(typeof document<"u"&&!document.getElementById(Mr)){const t=document.createElement("style");t.id=Mr,t.textContent=`
|
|
80
|
+
.nice-code-editor,
|
|
81
|
+
.nice-code-diff-editor {
|
|
82
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
83
|
+
border-radius: 4px;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.nice-code-editor--loading,
|
|
88
|
+
.nice-code-editor--error,
|
|
89
|
+
.nice-code-diff-editor--loading {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.nice-code-editor__loader {
|
|
97
|
+
color: var(--nice-text-secondary, #666);
|
|
98
|
+
font-size: 14px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.nice-code-editor__error {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
padding: 8px;
|
|
107
|
+
gap: 8px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.nice-code-editor__error span {
|
|
111
|
+
color: var(--nice-error, #d32f2f);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Simple code editor */
|
|
115
|
+
.nice-simple-code-editor {
|
|
116
|
+
display: flex;
|
|
117
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
118
|
+
border-radius: 4px;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
|
|
121
|
+
font-size: 14px;
|
|
122
|
+
line-height: 1.5;
|
|
123
|
+
background: var(--nice-bg-surface, #fff);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.nice-simple-code-editor__line-numbers {
|
|
127
|
+
padding: 8px 0;
|
|
128
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
129
|
+
border-right: 1px solid var(--nice-border, #e0e0e0);
|
|
130
|
+
user-select: none;
|
|
131
|
+
text-align: right;
|
|
132
|
+
color: var(--nice-text-secondary, #999);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.nice-simple-code-editor__line-number {
|
|
136
|
+
padding: 0 12px;
|
|
137
|
+
min-width: 40px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.nice-simple-code-editor__textarea {
|
|
141
|
+
flex: 1;
|
|
142
|
+
padding: 8px 12px;
|
|
143
|
+
border: none;
|
|
144
|
+
outline: none;
|
|
145
|
+
resize: none;
|
|
146
|
+
font: inherit;
|
|
147
|
+
background: transparent;
|
|
148
|
+
color: var(--nice-text-primary, #333);
|
|
149
|
+
white-space: pre;
|
|
150
|
+
overflow-wrap: normal;
|
|
151
|
+
overflow-x: auto;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.nice-simple-code-editor__textarea::placeholder {
|
|
155
|
+
color: var(--nice-text-secondary, #999);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Toolbar */
|
|
159
|
+
.nice-code-editor-wrap {
|
|
160
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
161
|
+
border-radius: 4px;
|
|
162
|
+
overflow: hidden;
|
|
163
|
+
}
|
|
164
|
+
.nice-code-editor-wrap .nice-code-editor {
|
|
165
|
+
border: none;
|
|
166
|
+
border-radius: 0;
|
|
167
|
+
}
|
|
168
|
+
.nice-code-editor__toolbar {
|
|
169
|
+
display: flex;
|
|
170
|
+
align-items: center;
|
|
171
|
+
gap: 2px;
|
|
172
|
+
padding: 3px 6px;
|
|
173
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
174
|
+
border-bottom: 1px solid var(--nice-border, #e0e0e0);
|
|
175
|
+
}
|
|
176
|
+
.nice-code-editor__toolbar-btn {
|
|
177
|
+
display: inline-flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
width: 26px;
|
|
181
|
+
height: 26px;
|
|
182
|
+
border: none;
|
|
183
|
+
border-radius: 3px;
|
|
184
|
+
background: transparent;
|
|
185
|
+
color: var(--nice-text-secondary, #666);
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
font-size: 14px;
|
|
188
|
+
transition: background 0.15s, color 0.15s;
|
|
189
|
+
}
|
|
190
|
+
.nice-code-editor__toolbar-btn:hover {
|
|
191
|
+
background: var(--nice-hover, #e0e0e0);
|
|
192
|
+
color: var(--nice-text-primary, #333);
|
|
193
|
+
}
|
|
194
|
+
.nice-code-editor__toolbar-btn--active {
|
|
195
|
+
background: var(--nice-accent, #1976d2);
|
|
196
|
+
color: #fff;
|
|
197
|
+
}
|
|
198
|
+
.nice-code-editor__toolbar-sep {
|
|
199
|
+
width: 1px;
|
|
200
|
+
height: 18px;
|
|
201
|
+
background: var(--nice-border, #e0e0e0);
|
|
202
|
+
margin: 0 4px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Status bar */
|
|
206
|
+
.nice-code-editor__statusbar {
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
gap: 12px;
|
|
210
|
+
padding: 2px 10px;
|
|
211
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
212
|
+
border-top: 1px solid var(--nice-border, #e0e0e0);
|
|
213
|
+
font-size: 12px;
|
|
214
|
+
color: var(--nice-text-secondary, #666);
|
|
215
|
+
user-select: none;
|
|
216
|
+
}
|
|
217
|
+
.nice-code-editor__statusbar-spacer { flex: 1; }
|
|
218
|
+
.nice-code-editor__statusbar-lang {
|
|
219
|
+
text-transform: uppercase;
|
|
220
|
+
font-weight: 600;
|
|
221
|
+
font-size: 11px;
|
|
222
|
+
}
|
|
223
|
+
.nice-code-editor__statusbar-markers {
|
|
224
|
+
color: var(--nice-warning, #f39c12);
|
|
225
|
+
font-weight: 600;
|
|
226
|
+
}
|
|
227
|
+
`,document.head.appendChild(t)}const au=Object.freeze(Object.defineProperty({__proto__:null,NiceCodeDiffEditor:$i,NiceCodeEditor:Xa,NiceSimpleCodeEditor:Ei},Symbol.toStringTag,{value:"Module"}));s.forwardRef(function(t,e){const{enableAI:r=!0,aiModel:i,enableInlineCompletion:n=!0,completionDelay:o=500,enableExplain:c=!0,enableRefactor:l=!0,enableGenerate:d=!0,systemPrompt:p,onExplain:f,onRefactor:u,showAIToolbar:y=!0,aiShortcutKey:h="Ctrl",language:m="plaintext",value:v,onChange:D,...w}=t,k=s.useRef(null),[b,C]=s.useState(null),[j,N]=s.useState(!1),[$,x]=s.useState(""),[F,I]=s.useState(!1),[P,A]=s.useState(""),[E,M]=s.useState(""),[W,z]=s.useState(""),T=s.useRef(),{t:g}=Da(),_=kt(),{complete:S,explain:R,refactor:L,generateFromComment:O,isLoading:Y}=xo({language:m,model:i}),G=r&&_.isConfigured,B=s.useCallback(async()=>{if(!G||!n||!k.current||!k.current.getEditor())return;const ee=k.current.getCursorPosition(),de=k.current.getValue().split(`
|
|
228
|
+
`),xe=de.slice(0,ee.lineNumber-1),$e=de[ee.lineNumber-1]||"",Ne=[...xe,$e.slice(0,ee.column-1)].join(`
|
|
229
|
+
`),U=[$e.slice(ee.column-1),...de.slice(ee.lineNumber)].join(`
|
|
230
|
+
`);try{const Z=await S(Ne,U);Z&&C({lineNumber:ee.lineNumber,column:ee.column,text:Z})}catch{}},[G,n,S]),K=s.useCallback(async()=>{if(!G||!c||!k.current)return"";const ee=k.current.getSelection();if(!ee)return"";z(ee),N(!0),x("");try{const de=await R(ee);return x(de),f==null||f(ee,de),de}catch{return x(g("codeEditorAI.explanationFailed","Failed to explain code")),""}},[G,c,R,f,g]),J=s.useCallback(async ee=>{if(!G||!l||!k.current)return"";const de=k.current.getSelection();if(!de)return"";try{const xe=await L(de,ee);return M(xe),u==null||u(de,xe),xe}catch{return""}},[G,l,L,u]),he=s.useCallback(async()=>{var $e;if(!G||!d||!k.current)return;const ee=k.current.getCursorPosition(),de=k.current.getValue().split(`
|
|
231
|
+
`);let xe="";for(let Ne=ee.lineNumber-1;Ne>=0&&Ne>=ee.lineNumber-3;Ne--){const U=(($e=de[Ne])==null?void 0:$e.trim())||"";if(U.startsWith("//")||U.startsWith("#")||U.startsWith("/*")||U.startsWith("*")){xe=U.replace(/^\/\/\s*|^#\s*|^\/\*\s*|\*\/\s*$|^\*\s*/g,"").trim();break}}if(xe)try{const Ne=await O(xe);Ne&&k.current&&k.current.insertText(`
|
|
232
|
+
`+Ne)}catch{}},[G,d,O]),pe=s.useCallback(()=>{!b||!k.current||(k.current.insertText(b.text),C(null))},[b]),we=s.useCallback(()=>{C(null)},[]),se=s.useCallback(ee=>{var de;(de=t.onCursorPositionChange)==null||de.call(t,ee),!(!G||!n)&&(T.current&&clearTimeout(T.current),C(null),T.current=setTimeout(()=>{B()},o))},[t.onCursorPositionChange,G,n,o,B]);s.useEffect(()=>{var de;if(!((de=k.current)!=null&&de.getEditor())||!G)return;const ee=xe=>{var $e;if(h==="Ctrl"&&xe.ctrlKey||h==="Alt"&&xe.altKey||h==="Meta"&&xe.metaKey){if(xe.key===" "&&n&&(xe.preventDefault(),B()),xe.key==="e"&&c&&(xe.preventDefault(),K()),xe.key==="r"&&l){xe.preventDefault();const Ne=($e=k.current)==null?void 0:$e.getSelection();Ne&&(z(Ne),I(!0))}xe.key==="g"&&d&&(xe.preventDefault(),he())}xe.key==="Tab"&&b&&(xe.preventDefault(),pe()),xe.key==="Escape"&&b&&we()};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[G,h,n,c,l,d,B,K,he,b,pe,we]),s.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]);const Ce=s.useCallback(()=>{if(!E||!k.current)return;const ee=k.current.getEditor();if(ee!=null&&ee.executeEdits&&(ee!=null&&ee.getSelection)){const de=ee.getSelection();ee.executeEdits("ai-refactor",[{range:de,text:E}])}I(!1),M(""),A("")},[E]);return s.useImperativeHandle(e,()=>({...k.current,getEditor:()=>{var ee;return(ee=k.current)==null?void 0:ee.getEditor()},getMonaco:()=>{var ee;return(ee=k.current)==null?void 0:ee.getMonaco()},focus:()=>{var ee;return(ee=k.current)==null?void 0:ee.focus()},getValue:()=>{var ee;return((ee=k.current)==null?void 0:ee.getValue())||""},setValue:ee=>{var de;return(de=k.current)==null?void 0:de.setValue(ee)},getSelection:()=>{var ee;return((ee=k.current)==null?void 0:ee.getSelection())||""},insertText:ee=>{var de;return(de=k.current)==null?void 0:de.insertText(ee)},formatDocument:()=>{var ee;return(ee=k.current)==null?void 0:ee.formatDocument()},goToLine:(ee,de)=>{var xe;return(xe=k.current)==null?void 0:xe.goToLine(ee,de)},findReplace:()=>{var ee;return(ee=k.current)==null?void 0:ee.findReplace()},undo:()=>{var ee;return(ee=k.current)==null?void 0:ee.undo()},redo:()=>{var ee;return(ee=k.current)==null?void 0:ee.redo()},getCursorPosition:()=>{var ee;return((ee=k.current)==null?void 0:ee.getCursorPosition())||{lineNumber:1,column:1}},setMarkers:ee=>{var de;return(de=k.current)==null?void 0:de.setMarkers(ee)},triggerCompletion:B,explainSelection:K,refactorSelection:J,generateFromComment:he,acceptCompletion:pe,dismissCompletion:we})),a.jsxs("div",{className:"nice-code-editor-ai","data-testid":t["data-testid"],children:[y&&G&&a.jsxs("div",{className:"nice-code-editor-ai__toolbar",children:[a.jsxs("div",{className:"nice-code-editor-ai__toolbar-left",children:[a.jsx("span",{className:"nice-code-editor-ai__toolbar-badge",children:"AI"}),Y&&a.jsx("span",{className:"nice-code-editor-ai__loading",children:g("codeEditorAI.loading","Thinking...")})]}),a.jsxs("div",{className:"nice-code-editor-ai__toolbar-right",children:[n&&a.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>B(),disabled:Y,title:`${g("codeEditorAI.complete","Complete")} (${h}+Space)`,children:["💡 ",g("codeEditorAI.complete","Complete")]}),c&&a.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>K(),disabled:Y,title:`${g("codeEditorAI.explain","Explain")} (${h}+E)`,children:["📖 ",g("codeEditorAI.explain","Explain")]}),l&&a.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>{var de;const ee=(de=k.current)==null?void 0:de.getSelection();ee&&(z(ee),I(!0))},disabled:Y,title:`${g("codeEditorAI.refactor","Refactor")} (${h}+R)`,children:["🔧 ",g("codeEditorAI.refactor","Refactor")]}),d&&a.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>he(),disabled:Y,title:`${g("codeEditorAI.generate","Generate")} (${h}+G)`,children:["⚡ ",g("codeEditorAI.generate","Generate")]})]})]}),a.jsxs("div",{className:"nice-code-editor-ai__editor-wrapper",children:[a.jsx(Xa,{ref:k,value:v,onChange:D,language:m,onCursorPositionChange:se,...w}),b&&a.jsxs("div",{className:"nice-code-editor-ai__ghost-text",style:{top:`calc(${(b.lineNumber-1)*19}px + 4px)`,left:`calc(${(b.column-1)*7.8}px + 60px)`},children:[a.jsx("span",{className:"nice-code-editor-ai__ghost-text-content",children:b.text}),a.jsxs("span",{className:"nice-code-editor-ai__ghost-text-hint",children:["Tab ",g("codeEditorAI.toAccept","to accept")]})]})]}),j&&a.jsxs("div",{className:"nice-code-editor-ai__panel nice-code-editor-ai__panel--explain",children:[a.jsxs("div",{className:"nice-code-editor-ai__panel-header",children:[a.jsxs("h4",{children:["📖 ",g("codeEditorAI.explanation","Explanation")]}),a.jsx("button",{type:"button",className:"nice-code-editor-ai__panel-close",onClick:()=>N(!1),children:"✕"})]}),a.jsx("div",{className:"nice-code-editor-ai__panel-body",children:Y?a.jsx("div",{className:"nice-code-editor-ai__panel-loading",children:g("codeEditorAI.analyzing","Analyzing code...")}):a.jsxs("div",{className:"nice-code-editor-ai__explanation",children:[a.jsx("pre",{className:"nice-code-editor-ai__code-preview",children:W}),a.jsx("div",{className:"nice-code-editor-ai__explanation-text",children:$||g("codeEditorAI.noExplanation","Select code and click Explain")})]})})]}),F&&a.jsxs("div",{className:"nice-code-editor-ai__panel nice-code-editor-ai__panel--refactor",children:[a.jsxs("div",{className:"nice-code-editor-ai__panel-header",children:[a.jsxs("h4",{children:["🔧 ",g("codeEditorAI.refactorCode","Refactor Code")]}),a.jsx("button",{type:"button",className:"nice-code-editor-ai__panel-close",onClick:()=>{I(!1),M(""),A("")},children:"✕"})]}),a.jsxs("div",{className:"nice-code-editor-ai__panel-body",children:[a.jsx("pre",{className:"nice-code-editor-ai__code-preview",children:W}),a.jsxs("div",{className:"nice-code-editor-ai__refactor-input",children:[a.jsx("input",{type:"text",placeholder:g("codeEditorAI.refactorInstruction",'Describe how to refactor (e.g., "extract function", "add error handling")'),value:P,onChange:ee=>A(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&P&&J(P)}}),a.jsx("button",{type:"button",className:"nice-code-editor-ai__refactor-btn",onClick:()=>J(P),disabled:Y||!P,children:Y?g("codeEditorAI.refactoring","Refactoring..."):g("codeEditorAI.refactor","Refactor")})]}),E&&a.jsxs("div",{className:"nice-code-editor-ai__refactor-result",children:[a.jsx("h5",{children:g("codeEditorAI.refactoredCode","Refactored Code")}),a.jsx("pre",{className:"nice-code-editor-ai__code-preview nice-code-editor-ai__code-preview--result",children:E}),a.jsxs("div",{className:"nice-code-editor-ai__refactor-actions",children:[a.jsxs("button",{type:"button",className:"nice-code-editor-ai__refactor-apply",onClick:Ce,children:["✓ ",g("codeEditorAI.apply","Apply")]}),a.jsxs("button",{type:"button",className:"nice-code-editor-ai__refactor-discard",onClick:()=>{M(""),A("")},children:["✕ ",g("codeEditorAI.discard","Discard")]})]})]})]})]})]})});function zr(t,e){const r=e.getBoundingClientRect();let i,n,o;if("touches"in t){const d=t.touches[0];i=d.clientX-r.left,n=d.clientY-r.top,o=d.force}else"pressure"in t?(i=t.clientX-r.left,n=t.clientY-r.top,o=t.pressure):(i=t.clientX-r.left,n=t.clientY-r.top);const c=e.width/r.width,l=e.height/r.height;return{x:i*c,y:n*l,time:Date.now(),pressure:o!==void 0?o:.5}}function $r(t,e,r,i,n){if(!e)return(r+i)/2;const o=Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))/Math.max(1,t.time-e.time),c=Math.min(o/5,1),l=i-c*(i-r),d=t.pressure??.5,p=r+d*(i-r);return l*.7+p*.3}function Er(t,e,r,i){t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(r.x,r.y),t.lineWidth=i,t.lineCap="round",t.lineJoin="round",t.stroke()}s.forwardRef(function(t,e){const{value:r,onChange:i,width:n="100%",height:o=200,penColor:c="#000000",penWidth:l=2,minWidth:d=.5,maxWidth:p=4,backgroundColor:f="#ffffff",placeholder:u="Sign here",showClearButton:y=!0,showUndoButton:h=!0,showColorPicker:m=!1,showSizeSlider:v=!1,velocityFilterWeight:D=.7,throttle:w=16,disabled:k=!1,readOnly:b=!1,onBegin:C,onEnd:j,className:N,"data-testid":$}=t,x=s.useRef(null),[F,I]=s.useState((r==null?void 0:r.strokes)??[]),[P,A]=s.useState([]),[E,M]=s.useState(!1),[W,z]=s.useState(c),[T,g]=s.useState(l),_=s.useRef(null),S=s.useRef(0),R=F.length===0&&P.length===0;s.useEffect(()=>{const se=x.current;if(!se)return;const Ce=se.getContext("2d");if(!Ce)return;const ee=se.getBoundingClientRect(),de=window.devicePixelRatio||1;se.width=ee.width*de,se.height=ee.height*de,Ce.scale(de,de),L()},[n,o]);const L=s.useCallback(()=>{const se=x.current;if(!se)return;const Ce=se.getContext("2d");if(!Ce)return;const ee=se.getBoundingClientRect();Ce.fillStyle=f,Ce.fillRect(0,0,ee.width,ee.height),F.forEach(de=>{if(Ce.strokeStyle=de.color,!(de.points.length<2))for(let xe=1;xe<de.points.length;xe++){const $e=de.points[xe-1],Ne=de.points[xe],U=$r(Ne,$e,d,p);Er(Ce,$e,Ne,U)}})},[F,f,d,p,D]);s.useEffect(()=>{L()},[L]),s.useEffect(()=>{r!=null&&r.strokes&&I(r.strokes)},[r]),s.useEffect(()=>{const se=x.current;if(se)if(F.length===0)i==null||i(null);else{const Ce=se.getBoundingClientRect();i==null||i({strokes:F,width:Ce.width,height:Ce.height,timestamp:Date.now()})}},[F,i]);const O=s.useCallback(se=>{if(k||b)return;const Ce=x.current;if(!Ce)return;Ce.setPointerCapture(se.pointerId);const ee=zr(se.nativeEvent,Ce);M(!0),A([ee]),_.current=ee,S.current=ee.time,C==null||C()},[k,b,C]),Y=s.useCallback(se=>{if(!E||k||b)return;const Ce=x.current;if(!Ce)return;const ee=Ce.getContext("2d");if(!ee)return;const de=Date.now();if(de-S.current<w)return;const xe=zr(se.nativeEvent,Ce),$e=_.current;if($e){ee.strokeStyle=W;const Ne=$r(xe,$e,d,p);Er(ee,$e,xe,Ne)}A(Ne=>[...Ne,xe]),_.current=xe,S.current=de},[E,k,b,W,d,p,D,w]),G=s.useCallback(se=>{if(!E)return;const Ce=x.current;if(Ce&&Ce.releasePointerCapture(se.pointerId),P.length>0){const ee={points:P,color:W,width:T};I(de=>[...de,ee])}M(!1),A([]),_.current=null,j==null||j()},[E,P,W,T,j]),B=s.useCallback(()=>{I([]),A([]),L()},[L]),K=s.useCallback(()=>{I(se=>se.slice(0,-1))},[]),J=s.useCallback((se="png",Ce=.92)=>{const ee=x.current;if(!ee)return"";const de=se==="jpeg"?"image/jpeg":"image/png";return ee.toDataURL(de,Ce)},[]),he=s.useCallback(async(se="png",Ce=.92)=>{const ee=x.current;return ee?new Promise(de=>{const xe=se==="jpeg"?"image/jpeg":"image/png";ee.toBlob($e=>de($e),xe,Ce)}):null},[]),pe=s.useCallback(()=>{const se=x.current;if(!se)return"";const Ce=se.getBoundingClientRect(),ee=F.map(de=>de.points.length<2?"":`<path d="${de.points.reduce((xe,$e,Ne)=>Ne===0?`M ${$e.x} ${$e.y}`:`${xe} L ${$e.x} ${$e.y}`,"")}" stroke="${de.color}" stroke-width="${de.width}" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`).join(`
|
|
233
|
+
`);return`<svg xmlns="http://www.w3.org/2000/svg" width="${Ce.width}" height="${Ce.height}" viewBox="0 0 ${se.width} ${se.height}">
|
|
234
|
+
<rect width="100%" height="100%" fill="${f}"/>
|
|
235
|
+
${ee}
|
|
236
|
+
</svg>`},[F,f]);s.useImperativeHandle(e,()=>({clear:B,undo:K,isEmpty:()=>F.length===0,getData:()=>{const se=x.current;if(!se||F.length===0)return null;const Ce=se.getBoundingClientRect();return{strokes:F,width:Ce.width,height:Ce.height,timestamp:Date.now()}},setData:se=>{I(se.strokes)},toDataURL:J,toBlob:he,toSVG:pe,getCanvas:()=>x.current}),[F,B,K,J,he,pe]),s.useEffect(()=>{const se=x.current;if(!se)return;const Ce=ee=>{E&&ee.preventDefault()};return se.addEventListener("touchmove",Ce,{passive:!1}),()=>se.removeEventListener("touchmove",Ce)},[E]);const we=y||h||m||v;return a.jsxs("div",{className:`nice-signature ${k?"nice-signature--disabled":""} ${b?"nice-signature--readonly":""} ${N??""}`,style:{width:n},"data-testid":$,children:[we&&a.jsxs("div",{className:"nice-signature__toolbar",children:[m&&a.jsx("div",{className:"nice-signature__color-picker",children:a.jsx("input",{type:"color",value:W,onChange:se=>z(se.target.value),disabled:k||b,title:"Pen color"})}),v&&a.jsx("div",{className:"nice-signature__size-slider",children:a.jsx("input",{type:"range",min:d,max:p,step:.5,value:T,onChange:se=>g(parseFloat(se.target.value)),disabled:k||b,title:"Pen size"})}),a.jsxs("div",{className:"nice-signature__actions",children:[h&&a.jsx("button",{type:"button",onClick:K,disabled:k||b||F.length===0,className:"nice-signature__btn",title:"Undo",children:"↩️"}),y&&a.jsx("button",{type:"button",onClick:B,disabled:k||b||R,className:"nice-signature__btn",title:"Clear",children:"🗑️"})]})]}),a.jsxs("div",{className:"nice-signature__canvas-wrapper",style:{height:o},children:[a.jsx("canvas",{ref:x,className:"nice-signature__canvas",style:{width:"100%",height:"100%",cursor:k||b?"not-allowed":"crosshair",touchAction:"none"},onPointerDown:O,onPointerMove:Y,onPointerUp:G,onPointerLeave:G}),R&&!E&&u&&a.jsx("div",{className:"nice-signature__placeholder",children:u}),a.jsx("div",{className:"nice-signature__line"})]})]})});const Ar="nice-signature-styles";if(typeof document<"u"&&!document.getElementById(Ar)){const t=document.createElement("style");t.id=Ar,t.textContent=`
|
|
237
|
+
.nice-signature {
|
|
238
|
+
display: flex;
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
241
|
+
border-radius: 4px;
|
|
242
|
+
overflow: hidden;
|
|
243
|
+
background: var(--nice-bg-surface, #fff);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.nice-signature--disabled {
|
|
247
|
+
opacity: 0.6;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.nice-signature__toolbar {
|
|
251
|
+
display: flex;
|
|
252
|
+
align-items: center;
|
|
253
|
+
gap: 8px;
|
|
254
|
+
padding: 8px;
|
|
255
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
256
|
+
border-bottom: 1px solid var(--nice-border, #e0e0e0);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.nice-signature__color-picker input {
|
|
260
|
+
width: 32px;
|
|
261
|
+
height: 32px;
|
|
262
|
+
padding: 2px;
|
|
263
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
264
|
+
border-radius: 4px;
|
|
265
|
+
cursor: pointer;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.nice-signature__size-slider {
|
|
269
|
+
flex: 1;
|
|
270
|
+
max-width: 120px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.nice-signature__size-slider input {
|
|
274
|
+
width: 100%;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.nice-signature__actions {
|
|
278
|
+
display: flex;
|
|
279
|
+
gap: 4px;
|
|
280
|
+
margin-left: auto;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.nice-signature__btn {
|
|
284
|
+
padding: 6px 10px;
|
|
285
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
286
|
+
border-radius: 4px;
|
|
287
|
+
background: var(--nice-bg-surface, #fff);
|
|
288
|
+
cursor: pointer;
|
|
289
|
+
font-size: 14px;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.nice-signature__btn:hover:not(:disabled) {
|
|
293
|
+
background: var(--nice-bg-hover, #f0f0f0);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.nice-signature__btn:disabled {
|
|
297
|
+
opacity: 0.4;
|
|
298
|
+
cursor: not-allowed;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.nice-signature__canvas-wrapper {
|
|
302
|
+
position: relative;
|
|
303
|
+
background: #fff;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.nice-signature__canvas {
|
|
307
|
+
display: block;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.nice-signature__placeholder {
|
|
311
|
+
position: absolute;
|
|
312
|
+
top: 50%;
|
|
313
|
+
left: 50%;
|
|
314
|
+
transform: translate(-50%, -50%);
|
|
315
|
+
color: var(--nice-text-secondary, #999);
|
|
316
|
+
font-size: 14px;
|
|
317
|
+
pointer-events: none;
|
|
318
|
+
user-select: none;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.nice-signature__line {
|
|
322
|
+
position: absolute;
|
|
323
|
+
bottom: 30px;
|
|
324
|
+
left: 20px;
|
|
325
|
+
right: 20px;
|
|
326
|
+
height: 1px;
|
|
327
|
+
background: var(--nice-border, #ccc);
|
|
328
|
+
pointer-events: none;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* Display component */
|
|
332
|
+
.nice-signature-display {
|
|
333
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
334
|
+
border-radius: 4px;
|
|
335
|
+
overflow: hidden;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.nice-signature-display__canvas-wrapper {
|
|
339
|
+
position: relative;
|
|
340
|
+
background: #fff;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.nice-signature-display__canvas {
|
|
344
|
+
display: block;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.nice-signature-display__placeholder {
|
|
348
|
+
position: absolute;
|
|
349
|
+
top: 50%;
|
|
350
|
+
left: 50%;
|
|
351
|
+
transform: translate(-50%, -50%);
|
|
352
|
+
color: var(--nice-text-secondary, #999);
|
|
353
|
+
font-size: 14px;
|
|
354
|
+
}
|
|
355
|
+
`,document.head.appendChild(t)}const Ai=s.forwardRef(({label:t,helperText:e,error:r,success:i=!1,startIcon:n,endIcon:o,showCounter:c=!1,variant:l="outlined",size:d="md",fullWidth:p=!1,className:f="",disabled:u=!1,required:y=!1,maxLength:h,value:m,defaultValue:v,onFocus:D,onBlur:w,onChange:k,"data-testid":b="nice-floating-input",...C},j)=>{De();const N=s.useId(),[$,x]=s.useState(!1),[F,I]=s.useState(v??""),P=m!==void 0?m:F,A=String(P).length>0,E=$||A,M=s.useCallback(g=>{x(!0),D==null||D(g)},[D]),W=s.useCallback(g=>{x(!1),w==null||w(g)},[w]),z=s.useCallback(g=>{m===void 0&&I(g.target.value),k==null||k(g)},[m,k]),T=["nice-floating-input",`nice-floating-input--${l}`,`nice-floating-input--${d}`,$&&"nice-floating-input--focused",A&&"nice-floating-input--has-value",u&&"nice-floating-input--disabled",r&&"nice-floating-input--error",i&&"nice-floating-input--success",n&&"nice-floating-input--has-start-icon",o&&"nice-floating-input--has-end-icon",p&&"nice-floating-input--full-width",f].filter(Boolean).join(" ");return a.jsxs("div",{className:T,"data-testid":b,children:[a.jsxs("div",{className:"nice-floating-input__container",children:[n&&a.jsx("span",{className:"nice-floating-input__icon nice-floating-input__icon--start",children:n}),a.jsxs("div",{className:"nice-floating-input__field",children:[a.jsx("input",{ref:j,id:N,className:"nice-floating-input__input",value:P,onChange:z,onFocus:M,onBlur:W,disabled:u,required:y,maxLength:h,"aria-invalid":!!r,"aria-describedby":r?`${N}-error`:e?`${N}-helper`:void 0,"data-testid":`${b}-input`,...C}),a.jsxs("label",{htmlFor:N,className:`nice-floating-input__label ${E?"nice-floating-input__label--floating":""}`,children:[t,y&&a.jsx("span",{className:"nice-floating-input__required",children:"*"})]}),l==="outlined"&&a.jsx("fieldset",{className:"nice-floating-input__fieldset","aria-hidden":"true",children:a.jsx("legend",{className:`nice-floating-input__legend ${E?"nice-floating-input__legend--floating":""}`,children:a.jsxs("span",{children:[t,y&&" *"]})})})]}),o&&a.jsx("span",{className:"nice-floating-input__icon nice-floating-input__icon--end",children:o})]}),a.jsxs("div",{className:"nice-floating-input__footer",children:[r?a.jsx("span",{id:`${N}-error`,className:"nice-floating-input__error",role:"alert",children:r}):e?a.jsx("span",{id:`${N}-helper`,className:"nice-floating-input__helper",children:e}):a.jsx("span",{}),c&&h!==void 0&&a.jsxs("span",{className:"nice-floating-input__counter",children:[String(P).length,"/",h]})]})]})});Ai.displayName="NiceFloatingLabelInput";const Di=s.forwardRef(({label:t,helperText:e,error:r,success:i=!1,showCounter:n=!1,variant:o="outlined",size:c="md",fullWidth:l=!1,autoResize:d=!1,minRows:p=3,maxRows:f=10,className:u="",disabled:y=!1,required:h=!1,maxLength:m,value:v,defaultValue:D,onFocus:w,onBlur:k,onChange:b,"data-testid":C="nice-floating-textarea",...j},N)=>{De();const $=s.useId(),x=s.useRef(null),[F,I]=s.useState(!1),[P,A]=s.useState(D??""),E=v!==void 0?v:P,M=String(E).length>0,W=F||M;s.useEffect(()=>{if(!d||!x.current)return;const R=x.current,L=parseInt(getComputedStyle(R).lineHeight)||20,O=p*L,Y=f*L;R.style.height="auto";const G=R.scrollHeight;R.style.height=`${Math.min(Math.max(G,O),Y)}px`},[E,d,p,f]);const z=s.useCallback(R=>{x.current=R,typeof N=="function"?N(R):N&&(N.current=R)},[N]),T=s.useCallback(R=>{I(!0),w==null||w(R)},[w]),g=s.useCallback(R=>{I(!1),k==null||k(R)},[k]),_=s.useCallback(R=>{v===void 0&&A(R.target.value),b==null||b(R)},[v,b]),S=["nice-floating-input","nice-floating-input--textarea",`nice-floating-input--${o}`,`nice-floating-input--${c}`,F&&"nice-floating-input--focused",M&&"nice-floating-input--has-value",y&&"nice-floating-input--disabled",r&&"nice-floating-input--error",i&&"nice-floating-input--success",l&&"nice-floating-input--full-width",u].filter(Boolean).join(" ");return a.jsxs("div",{className:S,"data-testid":C,children:[a.jsx("div",{className:"nice-floating-input__container",children:a.jsxs("div",{className:"nice-floating-input__field",children:[a.jsx("textarea",{ref:z,id:$,className:"nice-floating-input__input nice-floating-input__input--textarea",value:E,onChange:_,onFocus:T,onBlur:g,disabled:y,required:h,maxLength:m,rows:p,"aria-invalid":!!r,"aria-describedby":r?`${$}-error`:e?`${$}-helper`:void 0,"data-testid":`${C}-textarea`,...j}),a.jsxs("label",{htmlFor:$,className:`nice-floating-input__label ${W?"nice-floating-input__label--floating":""}`,children:[t,h&&a.jsx("span",{className:"nice-floating-input__required",children:"*"})]}),o==="outlined"&&a.jsx("fieldset",{className:"nice-floating-input__fieldset","aria-hidden":"true",children:a.jsx("legend",{className:`nice-floating-input__legend ${W?"nice-floating-input__legend--floating":""}`,children:a.jsxs("span",{children:[t,h&&" *"]})})})]})}),a.jsxs("div",{className:"nice-floating-input__footer",children:[r?a.jsx("span",{id:`${$}-error`,className:"nice-floating-input__error",role:"alert",children:r}):e?a.jsx("span",{id:`${$}-helper`,className:"nice-floating-input__helper",children:e}):a.jsx("span",{}),n&&m!==void 0&&a.jsxs("span",{className:"nice-floating-input__counter",children:[String(E).length,"/",m]})]})]})});Di.displayName="NiceFloatingLabelTextarea";const ru={strokeColor:"#ff3333",fillColor:"transparent",strokeWidth:2,opacity:1,fontSize:16,fontFamily:"sans-serif"};function iu(t,e){switch(e.type){case"SET_TOOL":return{...t,activeTool:e.tool,selectedId:null};case"SET_STYLE":return{...t,style:{...t.style,...e.style}};case"ADD_ANNOTATION":return{...t,annotations:[...t.annotations,e.annotation],past:[...t.past,t.annotations],future:[]};case"UPDATE_ANNOTATION":return{...t,annotations:t.annotations.map(r=>r.id===e.id?{...r,...e.updates}:r),past:[...t.past,t.annotations],future:[]};case"DELETE_ANNOTATION":return{...t,annotations:t.annotations.filter(r=>r.id!==e.id),selectedId:t.selectedId===e.id?null:t.selectedId,past:[...t.past,t.annotations],future:[]};case"SELECT":return{...t,selectedId:e.id};case"SET_ANNOTATIONS":return{...t,annotations:e.annotations,past:[],future:[]};case"SET_ZOOM":return{...t,zoom:e.zoom};case"SET_PAN":return{...t,panX:e.panX,panY:e.panY};case"UNDO":{if(t.past.length===0)return t;const r=t.past[t.past.length-1];return{...t,annotations:r,past:t.past.slice(0,-1),future:[t.annotations,...t.future]}}case"REDO":{if(t.future.length===0)return t;const r=t.future[0];return{...t,annotations:r,past:[...t.past,t.annotations],future:t.future.slice(1)}}case"CLEAR":return{...t,annotations:[],selectedId:null,past:[...t.past,t.annotations],future:[]};default:return t}}let nu=0;function su(){return`ann-${Date.now()}-${nu++}`}function ou(t){const{style:e}=t,r=`stroke="${e.strokeColor}" stroke-width="${e.strokeWidth}" fill="${e.fillColor}" opacity="${e.opacity}"`;switch(t.tool){case"rectangle":return`<rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" ${r} />`;case"ellipse":{const i=t.x+t.width/2,n=t.y+t.height/2;return`<ellipse cx="${i}" cy="${n}" rx="${t.width/2}" ry="${t.height/2}" ${r} />`}case"arrow":{const i=t,n=Math.atan2(i.endY-i.y,i.endX-i.x),o=12,c=i.endX-o*Math.cos(n-Math.PI/6),l=i.endY-o*Math.sin(n-Math.PI/6),d=i.endX-o*Math.cos(n+Math.PI/6),p=i.endY-o*Math.sin(n+Math.PI/6);return`<line x1="${i.x}" y1="${i.y}" x2="${i.endX}" y2="${i.endY}" ${r} />
|
|
356
|
+
<polygon points="${i.endX},${i.endY} ${c},${l} ${d},${p}" fill="${e.strokeColor}" opacity="${e.opacity}" />`}case"line":{const i=t;return`<line x1="${i.x}" y1="${i.y}" x2="${i.endX}" y2="${i.endY}" ${r} />`}case"text":{const i=t;return`<text x="${i.x}" y="${i.y+(i.style.fontSize??16)}" fill="${e.strokeColor}" font-size="${e.fontSize}" font-family="${e.fontFamily}" opacity="${e.opacity}">${lu(i.text)}</text>`}case"freehand":{const i=t;return i.points.length<2?"":`<path d="${i.points.map((n,o)=>`${o===0?"M":"L"}${n.x},${n.y}`).join(" ")}" ${r} fill="none" />`}case"blur":{const i=t,n=`blur-${i.id}`;return`<defs><filter id="${n}"><feGaussianBlur stdDeviation="${i.intensity??5}" /></filter></defs>
|
|
357
|
+
<rect x="${i.x}" y="${i.y}" width="${i.width}" height="${i.height}" fill="transparent" stroke="none" filter="url(#${n})" />`}default:return""}}function lu(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const Ti=s.forwardRef(({src:t,alt:e="Annotatable image",annotations:r,activeTool:i,defaultStyle:n,onAnnotationsChange:o,className:c,readOnly:l=!1,minZoom:d=.1,maxZoom:p=5},f)=>{const u=s.useRef(null),y=s.useRef(null),h=s.useRef(null),[m,v]=s.useState(!1),[D,w]=s.useState({width:0,height:0}),[k,b]=s.useReducer(iu,{annotations:r??[],selectedId:null,activeTool:i??"select",style:{...ru,...n},zoom:1,panX:0,panY:0,past:[],future:[]});s.useEffect(()=>{i&&b({type:"SET_TOOL",tool:i})},[i]),s.useEffect(()=>{o==null||o(k.annotations)},[k.annotations,o]),s.useEffect(()=>{const E=new Image;E.crossOrigin="anonymous",E.onload=()=>{h.current=E,w({width:E.naturalWidth,height:E.naturalHeight}),v(!0)},E.src=t},[t]);const C=s.useRef({isDrawing:!1,startX:0,startY:0,currentAnnotation:null,freehandPoints:[]}),j=s.useCallback((E,M)=>{const W=u.current;if(!W)return{x:0,y:0};const z=W.getBoundingClientRect();return{x:(E-z.left-k.panX)/k.zoom,y:(M-z.top-k.panY)/k.zoom}},[k.zoom,k.panX,k.panY]),N=s.useCallback(()=>{var T,g;const E=u.current,M=E==null?void 0:E.getContext("2d"),W=h.current;if(!E||!M||!W||!m)return;E.width=((T=y.current)==null?void 0:T.clientWidth)??W.naturalWidth,E.height=((g=y.current)==null?void 0:g.clientHeight)??W.naturalHeight,M.clearRect(0,0,E.width,E.height),M.save(),M.translate(k.panX,k.panY),M.scale(k.zoom,k.zoom),M.drawImage(W,0,0);for(const _ of k.annotations){switch(M.save(),M.globalAlpha=_.style.opacity,M.strokeStyle=_.style.strokeColor,M.fillStyle=_.style.fillColor,M.lineWidth=_.style.strokeWidth,_.tool){case"rectangle":M.strokeRect(_.x,_.y,_.width,_.height),_.style.fillColor!=="transparent"&&M.fillRect(_.x,_.y,_.width,_.height);break;case"ellipse":{M.beginPath(),M.ellipse(_.x+_.width/2,_.y+_.height/2,Math.abs(_.width/2),Math.abs(_.height/2),0,0,Math.PI*2),M.stroke(),_.style.fillColor!=="transparent"&&M.fill();break}case"arrow":{const S=_;M.beginPath(),M.moveTo(S.x,S.y),M.lineTo(S.endX,S.endY),M.stroke();const R=Math.atan2(S.endY-S.y,S.endX-S.x),L=12;M.beginPath(),M.moveTo(S.endX,S.endY),M.lineTo(S.endX-L*Math.cos(R-Math.PI/6),S.endY-L*Math.sin(R-Math.PI/6)),M.lineTo(S.endX-L*Math.cos(R+Math.PI/6),S.endY-L*Math.sin(R+Math.PI/6)),M.closePath(),M.fillStyle=_.style.strokeColor,M.fill();break}case"line":{const S=_;M.beginPath(),M.moveTo(S.x,S.y),M.lineTo(S.endX,S.endY),M.stroke();break}case"text":{const S=_;M.font=`${S.style.fontSize??16}px ${S.style.fontFamily??"sans-serif"}`,M.fillStyle=S.style.strokeColor,M.fillText(S.text,S.x,S.y+(S.style.fontSize??16));break}case"freehand":{const S=_;if(S.points.length<2)break;M.beginPath(),M.moveTo(S.points[0].x,S.points[0].y);for(let R=1;R<S.points.length;R++)M.lineTo(S.points[R].x,S.points[R].y);M.stroke();break}case"blur":{const S=_;M.filter=`blur(${S.intensity??5}px)`,M.drawImage(W,S.x,S.y,S.width,S.height,S.x,S.y,S.width,S.height),M.filter="none";break}}_.id===k.selectedId&&(M.strokeStyle="#4488ff",M.lineWidth=1,M.setLineDash([4,4]),M.strokeRect(_.x-2,_.y-2,_.width+4,_.height+4),M.setLineDash([])),M.restore()}const z=C.current;if(z.isDrawing&&z.currentAnnotation){M.save();const _=z.currentAnnotation;if(M.globalAlpha=_.style.opacity,M.strokeStyle=_.style.strokeColor,M.lineWidth=_.style.strokeWidth,M.setLineDash([6,3]),_.tool==="freehand"){const S=_;if(S.points.length>=2){M.beginPath(),M.moveTo(S.points[0].x,S.points[0].y);for(let R=1;R<S.points.length;R++)M.lineTo(S.points[R].x,S.points[R].y);M.stroke()}}else if(_.tool==="rectangle")M.strokeRect(_.x,_.y,_.width,_.height);else if(_.tool==="ellipse")M.beginPath(),M.ellipse(_.x+_.width/2,_.y+_.height/2,Math.abs(_.width/2),Math.abs(_.height/2),0,0,Math.PI*2),M.stroke();else if(_.tool==="arrow"||_.tool==="line"){const S=_;M.beginPath(),M.moveTo(S.x,S.y),M.lineTo(S.endX,S.endY),M.stroke()}M.restore()}M.restore()},[k,m]);s.useEffect(()=>{N()},[N]);const $=s.useCallback(E=>{if(l)return;const M=j(E.clientX,E.clientY),W=k.activeTool;if(W==="select"){const g=[...k.annotations].reverse().find(_=>_.tool==="freehand"?!1:M.x>=_.x&&M.x<=_.x+_.width&&M.y>=_.y&&M.y<=_.y+_.height);b({type:"SELECT",id:(g==null?void 0:g.id)??null});return}const z=C.current;z.isDrawing=!0,z.startX=M.x,z.startY=M.y;const T={id:su(),style:{...k.style},x:M.x,y:M.y,width:0,height:0};switch(W){case"rectangle":z.currentAnnotation={...T,tool:"rectangle"};break;case"ellipse":z.currentAnnotation={...T,tool:"ellipse"};break;case"arrow":z.currentAnnotation={...T,tool:"arrow",endX:M.x,endY:M.y};break;case"line":z.currentAnnotation={...T,tool:"line",endX:M.x,endY:M.y};break;case"text":z.currentAnnotation={...T,tool:"text",text:"Text",width:100,height:k.style.fontSize??16};break;case"freehand":z.freehandPoints=[M],z.currentAnnotation={...T,tool:"freehand",points:[M]};break;case"blur":z.currentAnnotation={...T,tool:"blur",intensity:5};break}},[l,j,k.activeTool,k.style,k.annotations]),x=s.useCallback(E=>{const M=C.current;if(!M.isDrawing||!M.currentAnnotation)return;const W=j(E.clientX,E.clientY),z=M.currentAnnotation;if(z.tool==="freehand"){M.freehandPoints.push(W),z.points=[...M.freehandPoints];const T=M.freehandPoints.map(_=>_.x),g=M.freehandPoints.map(_=>_.y);z.x=Math.min(...T),z.y=Math.min(...g),z.width=Math.max(...T)-z.x,z.height=Math.max(...g)-z.y}else if(z.tool==="arrow"||z.tool==="line")z.endX=W.x,z.endY=W.y,z.width=Math.abs(W.x-M.startX),z.height=Math.abs(W.y-M.startY);else{const T=Math.min(M.startX,W.x),g=Math.min(M.startY,W.y);z.x=T,z.y=g,z.width=Math.abs(W.x-M.startX),z.height=Math.abs(W.y-M.startY)}N()},[j,N]),F=s.useCallback(()=>{const E=C.current;if(!E.isDrawing||!E.currentAnnotation)return;const M=E.currentAnnotation;(M.tool==="text"||M.tool==="freehand"||Math.abs(M.width)>2||Math.abs(M.height)>2)&&b({type:"ADD_ANNOTATION",annotation:M}),E.isDrawing=!1,E.currentAnnotation=null,E.freehandPoints=[]},[]),I=s.useCallback(E=>{E.preventDefault();const M=E.deltaY>0?.9:1.1,W=Math.max(d,Math.min(p,k.zoom*M));b({type:"SET_ZOOM",zoom:W})},[k.zoom,d,p]);s.useEffect(()=>{if(l)return;const E=M=>{(M.metaKey||M.ctrlKey)&&M.key==="z"&&!M.shiftKey?(M.preventDefault(),b({type:"UNDO"})):(M.metaKey||M.ctrlKey)&&(M.key==="y"||M.key==="z"&&M.shiftKey)?(M.preventDefault(),b({type:"REDO"})):(M.key==="Delete"||M.key==="Backspace")&&k.selectedId&&b({type:"DELETE_ANNOTATION",id:k.selectedId})};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[l,k.selectedId]),s.useImperativeHandle(f,()=>({exportAsDataURL:async(E="png",M=.92)=>{const W=document.createElement("canvas"),z=h.current;if(!z)return"";W.width=z.naturalWidth,W.height=z.naturalHeight;const T=W.getContext("2d");T.drawImage(z,0,0);for(const g of k.annotations){if(T.save(),T.globalAlpha=g.style.opacity,T.strokeStyle=g.style.strokeColor,T.fillStyle=g.style.fillColor,T.lineWidth=g.style.strokeWidth,g.tool==="rectangle")T.strokeRect(g.x,g.y,g.width,g.height);else if(g.tool==="ellipse")T.beginPath(),T.ellipse(g.x+g.width/2,g.y+g.height/2,Math.abs(g.width/2),Math.abs(g.height/2),0,0,Math.PI*2),T.stroke();else if(g.tool==="freehand"){const _=g;if(_.points.length>=2){T.beginPath(),T.moveTo(_.points[0].x,_.points[0].y);for(let S=1;S<_.points.length;S++)T.lineTo(_.points[S].x,_.points[S].y);T.stroke()}}else if(g.tool==="text"){const _=g;T.font=`${_.style.fontSize??16}px ${_.style.fontFamily??"sans-serif"}`,T.fillStyle=_.style.strokeColor,T.fillText(_.text,_.x,_.y+(_.style.fontSize??16))}T.restore()}return W.toDataURL(`image/${E}`,M)},exportAnnotations:()=>[...k.annotations],importAnnotations:E=>{b({type:"SET_ANNOTATIONS",annotations:E})},exportAsSVG:()=>{const{width:E,height:M}=D,W=k.annotations.map(ou);return`<svg xmlns="http://www.w3.org/2000/svg" width="${E}" height="${M}" viewBox="0 0 ${E} ${M}">
|
|
358
|
+
${W.join(`
|
|
359
|
+
`)}
|
|
360
|
+
</svg>`},undo:()=>b({type:"UNDO"}),redo:()=>b({type:"REDO"}),setZoom:E=>{b({type:"SET_ZOOM",zoom:Math.max(d,Math.min(p,E))})},fitToScreen:()=>{const E=y.current,M=h.current;if(!E||!M)return;const W=E.clientWidth/M.naturalWidth,z=E.clientHeight/M.naturalHeight,T=Math.min(W,z,1);b({type:"SET_ZOOM",zoom:T}),b({type:"SET_PAN",panX:0,panY:0})},clear:()=>b({type:"CLEAR"})}),[k.annotations,D,d,p]);const P=s.useCallback(E=>{if(E.touches.length!==1)return;const M=E.touches[0];$({clientX:M.clientX,clientY:M.clientY,preventDefault:()=>{}})},[$]),A=s.useCallback(E=>{if(E.touches.length!==1)return;const M=E.touches[0];x({clientX:M.clientX,clientY:M.clientY})},[x]);return a.jsx("div",{ref:y,className:`nice-image-annotator ${c??""}`,style:{position:"relative",overflow:"hidden",width:"100%",height:"100%"},children:a.jsx("canvas",{ref:u,className:"nice-image-annotator__canvas",style:{cursor:k.activeTool==="select"?"default":"crosshair"},onMouseDown:$,onMouseMove:x,onMouseUp:F,onMouseLeave:F,onWheel:I,onTouchStart:P,onTouchMove:A,onTouchEnd:F,role:"img","aria-label":e})})});Ti.displayName="NiceImageAnnotator";const Ja=s.forwardRef(({options:t,value:e=[],onChange:r,placeholder:i,disabled:n,size:o="md",className:c,style:l,id:d},p)=>{const f=Ee(d),{t:u}=De(),[y,h]=s.useState(!1),m=s.useMemo(()=>{const w=[t];let k=t;for(const b of e){const C=k.find(j=>j.value===b);if(C!=null&&C.children)w.push(C.children),k=C.children;else break}return w},[t,e]),v=s.useCallback((w,k)=>{var j;const b=[...e.slice(0,w),k],C=(j=m[w])==null?void 0:j.find(N=>N.value===k);(!(C!=null&&C.children)||C.children.length===0)&&h(!1),r==null||r(b)},[e,m,r]),D=e.length>0?e.map((w,k)=>{var b,C;return((C=(b=m[k])==null?void 0:b.find(j=>j.value===w))==null?void 0:C.label)??w}).join(" › "):i??u("controls.select","Select...");return a.jsxs("div",{ref:p,id:f,className:`nice-cascade-select nice-cascade-select--${o}${n?" nice-cascade-select--disabled":""} ${c||""}`,style:l,children:[a.jsxs("button",{type:"button",className:"nice-cascade-select__trigger",onClick:()=>!n&&h(w=>!w),"aria-haspopup":"listbox","aria-expanded":y,disabled:n,children:[a.jsx("span",{className:`nice-cascade-select__display${e.length===0?" nice-cascade-select__display--placeholder":""}`,children:D}),a.jsx("span",{className:"nice-cascade-select__arrow",children:"▾"})]}),y&&a.jsx("div",{className:"nice-cascade-select__dropdown",children:m.map((w,k)=>a.jsx("div",{className:"nice-cascade-select__column",role:"listbox",children:w.map(b=>a.jsxs("div",{className:`nice-cascade-select__option${e[k]===b.value?" nice-cascade-select__option--selected":""}`,role:"option","aria-selected":e[k]===b.value,onClick:()=>v(k,b.value),children:[a.jsx("span",{children:b.label}),b.children&&b.children.length>0&&a.jsx("span",{className:"nice-cascade-select__chevron",children:"›"})]},b.value))},k))})]})});Ja.displayName="NiceCascadeSelect";const Qa=s.forwardRef(({columns:t,data:e,value:r,onChange:i,displayExpr:n="label",valueExpr:o="id",placeholder:c,disabled:l,size:d="md",filterable:p=!0,className:f,style:u,id:y},h)=>{const m=Ee(y),{t:v}=De(),[D,w]=s.useState(!1),[k,b]=s.useState(""),C=s.useRef(null);s.useEffect(()=>{if(!D)return;const F=I=>{C.current&&!C.current.contains(I.target)&&w(!1)};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[D]);const j=s.useMemo(()=>{if(!p||!k)return e;const F=k.toLowerCase();return e.filter(I=>t.some(P=>String(I[P.field]??"").toLowerCase().includes(F)))},[e,k,t,p]),N=e.find(F=>String(F[o])===r),$=N?String(N[n]):"",x=s.useCallback(F=>{i==null||i(String(F[o])),w(!1),b("")},[i,o]);return a.jsx("div",{ref:h,id:m,className:`nice-mc-combo nice-mc-combo--${d}${l?" nice-mc-combo--disabled":""} ${f||""}`,style:u,children:a.jsxs("div",{ref:C,className:"nice-mc-combo__wrap",children:[a.jsx("input",{className:"nice-mc-combo__input",type:"text",value:D?k:$,placeholder:c??v("controls.select","Select..."),disabled:l,onFocus:()=>{w(!0),b("")},onChange:F=>b(F.target.value),"aria-autocomplete":"list","aria-expanded":D}),a.jsx("button",{type:"button",className:"nice-mc-combo__toggle",onClick:()=>!l&&w(F=>!F),tabIndex:-1,"aria-label":"Toggle",children:"▾"}),D&&a.jsx("div",{className:"nice-mc-combo__dropdown",children:a.jsxs("table",{className:"nice-mc-combo__table",children:[a.jsx("thead",{children:a.jsx("tr",{children:t.map(F=>a.jsx("th",{style:{width:F.width},children:F.header},F.field))})}),a.jsxs("tbody",{children:[j.map((F,I)=>a.jsx("tr",{className:`nice-mc-combo__row${String(F[o])===r?" nice-mc-combo__row--selected":""}`,onClick:()=>x(F),children:t.map(P=>a.jsx("td",{children:String(F[P.field]??"")},P.field))},I)),j.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:t.length,className:"nice-mc-combo__empty",children:v("controls.noData","No data")})})]})]})})]})})});Qa.displayName="NiceMultiColumnComboBox";const er=s.forwardRef(({value:t,onChange:e,type:r="text",options:i=[],submitOnBlur:n=!0,placeholder:o,disabled:c,size:l="md",className:d,style:p,id:f},u)=>{var $;const y=Ee(f),[h,m]=s.useState(!1),[v,D]=s.useState(t),w=s.useRef(null);s.useEffect(()=>{D(t)},[t]),s.useEffect(()=>{h&&w.current&&w.current.focus()},[h]);const k=s.useCallback(()=>{c||(D(t),m(!0))},[c,t]),b=s.useCallback(()=>{m(!1),v!==t&&e(v)},[v,t,e]),C=s.useCallback(()=>{m(!1),D(t)},[t]),j=s.useCallback(x=>{x.key==="Enter"&&r!=="textarea"&&b(),x.key==="Escape"&&C()},[b,C,r]),N=r==="select"&&(($=i.find(x=>x.value===t))==null?void 0:$.label)||t;return a.jsx("div",{ref:u,id:y,className:`nice-inplace nice-inplace--${l}${c?" nice-inplace--disabled":""} ${d||""}`,style:p,children:h?a.jsxs("span",{className:"nice-inplace__editor",children:[r==="textarea"?a.jsx("textarea",{ref:w,className:"nice-inplace__input",value:v,onChange:x=>D(x.target.value),onBlur:n?b:void 0,onKeyDown:x=>x.key==="Escape"&&C(),rows:3}):r==="select"?a.jsx("select",{ref:w,className:"nice-inplace__input",value:v,onChange:x=>{D(x.target.value)},onBlur:n?b:void 0,onKeyDown:j,children:i.map(x=>a.jsx("option",{value:x.value,children:x.label},x.value))}):a.jsx("input",{ref:w,className:"nice-inplace__input",type:r==="number"?"number":r==="date"?"date":"text",value:v,onChange:x=>D(x.target.value),onBlur:n?b:void 0,onKeyDown:j}),a.jsx("button",{type:"button",className:"nice-inplace__save",onClick:b,"aria-label":"Save",children:"✓"}),a.jsx("button",{type:"button",className:"nice-inplace__cancel",onClick:C,"aria-label":"Cancel",children:"✕"})]}):a.jsxs("span",{className:"nice-inplace__display",onClick:k,role:"button",tabIndex:0,onKeyDown:x=>x.key==="Enter"&&k(),children:[N||a.jsx("span",{className:"nice-inplace__placeholder",children:o||"Click to edit"}),!c&&a.jsx("span",{className:"nice-inplace__icon",children:"✎"})]})})});er.displayName="NiceInPlaceEditor";function cu(t){let e=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");return e=e.replace(/```(\w*)\n([\s\S]*?)```/g,(r,i,n)=>`<pre><code class="language-${i}">${n.trim()}</code></pre>`),e=e.replace(/^(\|.+\|)\n(\|[-| :]+\|)\n((?:\|.+\|\n?)+)/gm,(r,i,n,o)=>{const c=i.split("|").filter(d=>d.trim()).map(d=>`<th>${d.trim()}</th>`).join(""),l=o.trim().split(`
|
|
361
|
+
`).map(d=>`<tr>${d.split("|").filter(p=>p.trim()).map(p=>`<td>${p.trim()}</td>`).join("")}</tr>`).join("");return`<table><thead><tr>${c}</tr></thead><tbody>${l}</tbody></table>`}),e=e.replace(/^#### (.+)$/gm,"<h4>$1</h4>"),e=e.replace(/^### (.+)$/gm,"<h3>$1</h3>"),e=e.replace(/^## (.+)$/gm,"<h2>$1</h2>"),e=e.replace(/^# (.+)$/gm,"<h1>$1</h1>"),e=e.replace(/^> (.+)$/gm,"<blockquote>$1</blockquote>"),e=e.replace(/^---$/gm,"<hr/>"),e=e.replace(/^- \[x\] (.+)$/gm,'<li class="task done">☑ $1</li>'),e=e.replace(/^- \[ \] (.+)$/gm,'<li class="task">☐ $1</li>'),e=e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),e=e.replace(/\*(.+?)\*/g,"<em>$1</em>"),e=e.replace(/~~(.+?)~~/g,"<del>$1</del>"),e=e.replace(/`(.+?)`/g,"<code>$1</code>"),e=e.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,'<img src="$2" alt="$1" style="max-width:100%"/>'),e=e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>'),e=e.replace(/^\- (.+)$/gm,"<li>$1</li>"),e=e.replace(/^\d+\. (.+)$/gm,"<li>$1</li>"),e=e.replace(/\n/g,"<br/>"),e}const du=[{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:`---
|
|
362
|
+
`,tip:"Horizontal rule",group:"block"},{key:"link",label:"🔗",md:"[](url)",tip:"Link",shortcut:"Ctrl+K",group:"insert"},{key:"image",label:"🖼",md:"",tip:"Image",group:"insert"},{key:"table",label:"⊞",md:`| H1 | H2 | H3 |
|
|
363
|
+
| --- | --- | --- |
|
|
364
|
+
| c1 | c2 | c3 |
|
|
365
|
+
`,tip:"Table",group:"insert"},{key:"codeblock",label:"```",md:"```\n",tip:"Code block",group:"insert"}],uu=["format","heading","list","block","insert"],tr=s.forwardRef(({value:t="",onChange:e,preview:r="side",placeholder:i,disabled:n,readOnly:o,size:c="md",editorSize:l="standard",toolbar:d=!0,minHeight:p=200,showWordCount:f=!1,showLineNumbers:u=!1,onExportHtml:y,onImageUpload:h,className:m,style:v,id:D},w)=>{const k=Ee(D),[b,C]=s.useState("edit"),[j,N]=s.useState(!1),$=s.useRef(null),x=s.useMemo(()=>cu(t),[t]),F=s.useMemo(()=>{const z=t.trim()?t.trim().split(/\s+/).length:0,T=t.length,g=t.split(`
|
|
366
|
+
`).length;return{words:z,chars:T,lines:g}},[t]),I=s.useCallback(z=>{const T=$.current;if(!T)return;const g=T.selectionStart,_=T.selectionEnd,S=t.slice(g,_);let R,L;z==="[](url)"?(R=t.slice(0,g)+`[${S||"text"}](url)`+t.slice(_),L=g+1+(S||"text").length+2):z===""?(R=t.slice(0,g)+``+t.slice(_),L=g+2+(S||"alt").length+2):z.endsWith(`
|
|
367
|
+
`)||z.endsWith(" ")?(R=t.slice(0,g)+z+S+t.slice(_),L=g+z.length+S.length):(R=t.slice(0,g)+z+S+z+t.slice(_),L=g+z.length+S.length+z.length),e==null||e(R),requestAnimationFrame(()=>{T.focus(),T.setSelectionRange(L,L)})},[t,e]),P=s.useCallback(z=>{if((z.ctrlKey||z.metaKey)&&(z.key==="b"?(z.preventDefault(),I("**")):z.key==="i"?(z.preventDefault(),I("*")):z.key==="k"&&(z.preventDefault(),I("[](url)"))),z.key==="Tab"){z.preventDefault();const T=z.currentTarget,g=T.selectionStart,_=T.selectionEnd,S=" ";if(z.shiftKey){const R=t.slice(0,g).lastIndexOf(`
|
|
368
|
+
`)+1;if(t.slice(R,R+S.length)===S){const L=t.slice(0,R)+t.slice(R+S.length);e==null||e(L),requestAnimationFrame(()=>{T.selectionStart=T.selectionEnd=g-S.length})}}else{const R=t.slice(0,g)+S+t.slice(_);e==null||e(R),requestAnimationFrame(()=>{T.selectionStart=T.selectionEnd=g+S.length})}}},[t,e,I]),A=s.useCallback(async z=>{if(!h)return;const T=Array.from(z.dataTransfer.files).filter(g=>g.type.startsWith("image/"));if(T.length!==0){z.preventDefault();for(const g of T){const _=await h(g),S=$.current;if(!S)continue;const R=S.selectionStart,L=`
|
|
369
|
+
`,O=t.slice(0,R)+L+t.slice(R);e==null||e(O)}}},[t,e,h]),E=r!=="tab"||b==="edit",M=r==="side"||r==="tab"&&b==="preview"||r===!0,W=`nice-md-editor nice-md-editor--${c} nice-editor--${l} nice-md-editor--preview-${r}${j?" nice-md-editor--fullscreen":""} ${m||""}`;return a.jsxs("div",{ref:w,id:k,className:W,style:v,children:[d&&a.jsxs("div",{className:"nice-md-editor__toolbar",children:[uu.map((z,T)=>a.jsxs(s.Fragment,{children:[T>0&&a.jsx("span",{className:"nice-md-editor__sep"}),du.filter(g=>g.group===z).map(g=>a.jsx("button",{type:"button",className:"nice-md-editor__btn",title:g.shortcut?`${g.tip} (${g.shortcut})`:g.tip,disabled:n||o,onClick:()=>I(g.md),children:g.label},g.key))]},z)),a.jsx("span",{className:"nice-md-editor__sep"}),a.jsx("button",{type:"button",className:"nice-md-editor__btn",title:"Fullscreen",onClick:()=>N(!j),children:j?"⊙":"⛶"}),y&&a.jsx("button",{type:"button",className:"nice-md-editor__btn",title:"Export HTML",onClick:()=>y(x),children:"↗"}),r==="tab"&&a.jsxs("span",{className:"nice-md-editor__tabs",children:[a.jsx("button",{type:"button",className:`nice-md-editor__tab${b==="edit"?" nice-md-editor__tab--active":""}`,onClick:()=>C("edit"),children:"Edit"}),a.jsx("button",{type:"button",className:`nice-md-editor__tab${b==="preview"?" nice-md-editor__tab--active":""}`,onClick:()=>C("preview"),children:"Preview"})]})]}),a.jsxs("div",{className:"nice-md-editor__body",style:{minHeight:p},children:[E&&a.jsxs("div",{className:"nice-md-editor__editor-wrap",children:[u&&a.jsx("div",{className:"nice-md-editor__line-numbers",children:Array.from({length:F.lines},(z,T)=>a.jsx("div",{className:"nice-md-editor__line-no",children:T+1},T))}),a.jsx("textarea",{ref:$,className:"nice-md-editor__textarea",value:t,onChange:z=>e==null?void 0:e(z.target.value),onKeyDown:P,onDrop:A,placeholder:i,disabled:n,readOnly:o,style:{minHeight:p}})]}),M&&a.jsx("div",{className:"nice-md-editor__preview",dangerouslySetInnerHTML:{__html:aa(x)},style:{minHeight:p}})]}),f&&a.jsxs("div",{className:"nice-md-editor__statusbar",children:[a.jsxs("span",{children:[F.words," words"]}),a.jsxs("span",{children:[F.chars," chars"]}),a.jsxs("span",{children:[F.lines," lines"]})]})]})});tr.displayName="NiceMarkdownEditor";const Dr={rotation:0,flipH:!1,flipV:!1,brightness:100,contrast:100,saturate:100,blur:0,crop:null,annotations:[]},pu=["crop","rotate","flip","brightness","contrast","saturate","blur","annotate"],ar=s.forwardRef(({src:t,size:e="md",editorSize:r="standard",tools:i=pu,showToolbar:n=!0,showZoom:o=!0,maxUndo:c=30,onSave:l,onCancel:d,onChange:p,width:f="100%",height:u=500,className:y,style:h,id:m,...v},D)=>{const w=Ee(m),{t:k}=De(),b=s.useRef(null),C=s.useRef(null),[j,N]=s.useState({...Dr}),[$,x]=s.useState(null),[F,I]=s.useState(!1),[P,A]=s.useState(1),[E,M]=s.useState("rect"),[W,z]=s.useState("#ff0000"),[T,g]=s.useState({w:0,h:0}),[_,S]=s.useState([]),[R,L]=s.useState([]),[O,Y]=s.useState(null),[G,B]=s.useState(null),[K,J]=s.useState(null),he=s.useCallback(U=>{S(Z=>[...Z.slice(-(c-1)),U]),L([])},[c]),pe=s.useCallback(U=>{N(Z=>{he(Z);const X={...Z,...U};return p==null||p(X),X})},[p,he]),we=s.useCallback(()=>{if(_.length===0)return;const U=_[_.length-1];S(Z=>Z.slice(0,-1)),L(Z=>[...Z,j]),N(U),p==null||p(U)},[_,j,p]),se=s.useCallback(()=>{if(R.length===0)return;const U=R[R.length-1];L(Z=>Z.slice(0,-1)),S(Z=>[...Z,j]),N(U),p==null||p(U)},[R,j,p]);s.useEffect(()=>{const U=new Image;U.crossOrigin="anonymous",U.onload=()=>{C.current=U,g({w:U.width,h:U.height}),I(!0)},U.src=t},[t]),s.useEffect(()=>{if(!F||!b.current||!C.current)return;const U=b.current,Z=U.getContext("2d");if(!Z)return;const X=C.current,Q=j.rotation%180!==0,fe=Q?X.height:X.width,Se=Q?X.width:X.height;U.width=fe,U.height=Se,Z.clearRect(0,0,fe,Se),Z.save(),Z.filter=`brightness(${j.brightness}%) contrast(${j.contrast}%) saturate(${j.saturate}%) blur(${j.blur}px)`,Z.translate(fe/2,Se/2),Z.rotate(j.rotation*Math.PI/180),Z.scale(j.flipH?-1:1,j.flipV?-1:1),Z.drawImage(X,-X.width/2,-X.height/2),Z.restore(),j.annotations.forEach(be=>{switch(Z.save(),Z.strokeStyle=be.color??"red",Z.fillStyle=be.color??"red",Z.lineWidth=be.strokeWidth??2,Z.font=`${be.fontSize??16}px sans-serif`,be.type){case"text":Z.fillText(be.text??"",be.x,be.y);break;case"rect":Z.strokeRect(be.x,be.y,be.width??100,be.height??50);break;case"circle":{const ie=(be.width??50)/2,je=(be.height??50)/2;Z.beginPath(),Z.ellipse(be.x+ie,be.y+je,ie,je,0,0,Math.PI*2),Z.stroke();break}case"line":Z.beginPath(),Z.moveTo(be.x,be.y),Z.lineTo(be.x+(be.width??100),be.y+(be.height??0)),Z.stroke();break;case"arrow":{const ie=be.x+(be.width??100),je=be.y+(be.height??0);Z.beginPath(),Z.moveTo(be.x,be.y),Z.lineTo(ie,je),Z.stroke();const oe=Math.atan2(je-be.y,ie-be.x),Ae=10;Z.beginPath(),Z.moveTo(ie,je),Z.lineTo(ie-Ae*Math.cos(oe-.4),je-Ae*Math.sin(oe-.4)),Z.lineTo(ie-Ae*Math.cos(oe+.4),je-Ae*Math.sin(oe+.4)),Z.closePath(),Z.fill();break}}Z.restore()}),G&&(Z.save(),Z.fillStyle="rgba(0,0,0,0.5)",Z.fillRect(0,0,fe,Se),Z.clearRect(G.x,G.y,G.w,G.h),Z.strokeStyle="#fff",Z.lineWidth=2,Z.setLineDash([5,5]),Z.strokeRect(G.x,G.y,G.w,G.h),Z.restore())},[F,j,G]);const Ce=s.useCallback(U=>{if(!b.current)return;const Z=b.current.getBoundingClientRect(),X=b.current.width/Z.width,Q=b.current.height/Z.height,fe=(U.clientX-Z.left)*X,Se=(U.clientY-Z.top)*Q;$==="crop"?Y({startX:fe,startY:Se}):$==="annotate"&&J({startX:fe,startY:Se})},[$]),ee=s.useCallback(U=>{if(!b.current)return;const Z=b.current.getBoundingClientRect(),X=b.current.width/Z.width,Q=b.current.height/Z.height,fe=(U.clientX-Z.left)*X,Se=(U.clientY-Z.top)*Q;O&&B({x:Math.min(O.startX,fe),y:Math.min(O.startY,Se),w:Math.abs(fe-O.startX),h:Math.abs(Se-O.startY)})},[O]),de=s.useCallback(U=>{if(O&&G&&G.w>5&&G.h>5&&pe({crop:{x:G.x,y:G.y,width:G.w,height:G.h}}),Y(null),K&&b.current){const Z=b.current.getBoundingClientRect(),X=b.current.width/Z.width,Q=b.current.height/Z.height,fe=(U.clientX-Z.left)*X,Se=(U.clientY-Z.top)*Q,be=fe-K.startX,ie=Se-K.startY;if(Math.abs(be)>3||Math.abs(ie)>3||E==="text"){const je={type:E,x:K.startX,y:K.startY,width:Math.abs(be)||100,height:Math.abs(ie)||50,color:W,strokeWidth:2,text:E==="text"?prompt(k("imageEditor.annotationText","Text:"))??"":void 0};pe({annotations:[...j.annotations,je]})}J(null)}},[O,G,K,E,W,j.annotations,pe,k]),xe=s.useCallback(()=>{if(!j.crop||!b.current)return;const U=b.current,Z=U.getContext("2d");if(!Z)return;const{x:X,y:Q,width:fe,height:Se}=j.crop,be=Z.getImageData(X,Q,fe,Se);U.width=fe,U.height=Se,Z.putImageData(be,0,0),B(null),x(null)},[j.crop]),$e=s.useCallback(()=>{if(!b.current)return;const U=b.current.toDataURL("image/png");l==null||l(U,j)},[l,j]),Ne=s.useCallback(()=>{N({...Dr}),B(null),x(null)},[]);return s.useMemo(()=>`brightness(${j.brightness}%) contrast(${j.contrast}%) saturate(${j.saturate}%) blur(${j.blur}px)`,[j.brightness,j.contrast,j.saturate,j.blur]),a.jsxs("div",{ref:D,id:w,className:`nice-image-editor nice-image-editor--${e} nice-editor--${r} ${y??""}`,style:{...h,width:f,height:u},role:"application","aria-label":k("imageEditor.label","Image Editor"),...v,children:[n&&a.jsxs("div",{className:"nice-image-editor__toolbar",role:"toolbar",children:[a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:we,disabled:_.length===0,title:k("imageEditor.undo","Undo"),children:"↶"}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:se,disabled:R.length===0,title:k("imageEditor.redo","Redo"),children:"↷"}),a.jsx("span",{className:"nice-image-editor__sep"}),i.includes("rotate")&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>pe({rotation:(j.rotation-90+360)%360}),title:k("imageEditor.rotateLeft","Rotate left"),children:"↺"}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>pe({rotation:(j.rotation+90)%360}),title:k("imageEditor.rotateRight","Rotate right"),children:"↻"})]}),i.includes("flip")&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>pe({flipH:!j.flipH}),title:k("imageEditor.flipH","Flip horizontal"),children:"⇔"}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>pe({flipV:!j.flipV}),title:k("imageEditor.flipV","Flip vertical"),children:"⇕"})]}),i.includes("crop")&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:`nice-image-editor__btn ${$==="crop"?"nice-image-editor__btn--active":""}`,onClick:()=>x($==="crop"?null:"crop"),title:k("imageEditor.crop","Crop"),children:"⊡"}),$==="crop"&&j.crop&&a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:xe,title:k("imageEditor.applyCrop","Apply crop"),children:"✓"})]}),i.includes("brightness")&&a.jsxs("label",{className:"nice-image-editor__slider-label",children:[k("imageEditor.brightness","☀"),a.jsx("input",{type:"range",min:0,max:200,value:j.brightness,onChange:U=>pe({brightness:Number(U.target.value)}),className:"nice-image-editor__slider",title:k("imageEditor.brightness","Brightness")})]}),i.includes("contrast")&&a.jsxs("label",{className:"nice-image-editor__slider-label",children:[k("imageEditor.contrast","◑"),a.jsx("input",{type:"range",min:0,max:200,value:j.contrast,onChange:U=>pe({contrast:Number(U.target.value)}),className:"nice-image-editor__slider",title:k("imageEditor.contrast","Contrast")})]}),i.includes("saturate")&&a.jsxs("label",{className:"nice-image-editor__slider-label",children:[k("imageEditor.saturate","🎨"),a.jsx("input",{type:"range",min:0,max:200,value:j.saturate,onChange:U=>pe({saturate:Number(U.target.value)}),className:"nice-image-editor__slider",title:k("imageEditor.saturate","Saturation")})]}),i.includes("blur")&&a.jsxs("label",{className:"nice-image-editor__slider-label",children:[k("imageEditor.blur","⊘"),a.jsx("input",{type:"range",min:0,max:20,step:.5,value:j.blur,onChange:U=>pe({blur:Number(U.target.value)}),className:"nice-image-editor__slider",title:k("imageEditor.blur","Blur")})]}),i.includes("annotate")&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"nice-image-editor__sep"}),a.jsx("button",{type:"button",className:`nice-image-editor__btn ${$==="annotate"?"nice-image-editor__btn--active":""}`,onClick:()=>x($==="annotate"?null:"annotate"),title:k("imageEditor.annotate","Annotate"),children:"✎"}),$==="annotate"&&a.jsxs(a.Fragment,{children:[a.jsxs("select",{className:"nice-image-editor__select",value:E,onChange:U=>M(U.target.value),children:[a.jsx("option",{value:"rect",children:"□ Rect"}),a.jsx("option",{value:"circle",children:"○ Circle"}),a.jsx("option",{value:"line",children:"╱ Line"}),a.jsx("option",{value:"arrow",children:"→ Arrow"}),a.jsx("option",{value:"text",children:"T Text"})]}),a.jsx("input",{type:"color",value:W,onChange:U=>z(U.target.value),className:"nice-image-editor__color",title:k("imageEditor.color","Color")}),j.annotations.length>0&&a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>pe({annotations:j.annotations.slice(0,-1)}),title:k("imageEditor.removeLastAnnotation","Remove last"),children:"⌫"})]})]}),a.jsx("span",{className:"nice-image-editor__sep"}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:Ne,title:k("imageEditor.reset","Reset"),children:"⟲"}),l&&a.jsx("button",{type:"button",className:"nice-image-editor__btn nice-image-editor__btn--save",onClick:$e,children:k("imageEditor.save","Save")}),d&&a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:d,children:k("imageEditor.cancel","Cancel")})]}),a.jsx("div",{className:"nice-image-editor__canvas-wrap",children:a.jsx("canvas",{ref:b,className:"nice-image-editor__canvas",onMouseDown:Ce,onMouseMove:ee,onMouseUp:de,style:{cursor:$==="crop"||$==="annotate"?"crosshair":"default",transform:`scale(${P})`,transformOrigin:"center center"}})}),o&&a.jsxs("div",{className:"nice-image-editor__footer",children:[a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>A(U=>Math.max(.1,U-.1)),title:"Zoom out",children:"−"}),a.jsxs("span",{style:{fontSize:"0.85em",minWidth:40,textAlign:"center"},children:[Math.round(P*100),"%"]}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>A(U=>Math.min(5,U+.1)),title:"Zoom in",children:"+"}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>A(1),title:"Reset zoom",children:"1:1"}),a.jsx("span",{style:{flex:1}}),a.jsxs("span",{style:{fontSize:"0.8em",color:"var(--nice-text-secondary, #666)"},children:[T.w,"×",T.h,"px · ",j.rotation,"°"]})]})]})});ar.displayName="NiceImageEditor";const rr=s.forwardRef(({value:t,onChange:e,penColor:r="#000",penWidth:i=2,backgroundColor:n="#fff",width:o=400,height:c=200,size:l="md",disabled:d=!1,readOnly:p=!1,showClear:f=!0,showUndo:u=!0,label:y,exportFormat:h="image/png",className:m,style:v,id:D,...w},k)=>{const b=Ee(D),{t:C}=De(),j=s.useRef(null),[N,$]=s.useState(!1),x=s.useRef([]),F=s.useRef([]),[I,P]=s.useState(!0),A=s.useCallback(()=>{const _=j.current;if(!_)return;const S=_.getContext("2d");if(S){S.fillStyle=n,S.fillRect(0,0,_.width,_.height),S.strokeStyle=r,S.lineWidth=i,S.lineCap="round",S.lineJoin="round";for(const R of x.current)if(!(R.length<2)){S.beginPath(),S.moveTo(R[0].x,R[0].y);for(let L=1;L<R.length;L++)S.lineTo(R[L].x,R[L].y);S.stroke()}}},[n,r,i]);s.useEffect(()=>{if(t&&j.current){const _=new Image;_.onload=()=>{var R;const S=(R=j.current)==null?void 0:R.getContext("2d");!S||!j.current||(S.fillStyle=n,S.fillRect(0,0,j.current.width,j.current.height),S.drawImage(_,0,0),P(!1))},_.src=t}else t||(x.current=[],P(!0),A())},[t,n,A]),s.useEffect(()=>{const _=j.current;_&&(_.width=o,_.height=c,A())},[o,c,A]);const E=s.useCallback(_=>{const S=j.current,R=S.getBoundingClientRect(),L=S.width/R.width,O=S.height/R.height;if("touches"in _){const Y=_.touches[0];return{x:(Y.clientX-R.left)*L,y:(Y.clientY-R.top)*O}}return{x:(_.clientX-R.left)*L,y:(_.clientY-R.top)*O}},[]),M=s.useCallback(_=>{if(d||p)return;_.preventDefault();const S=E(_);F.current=[S],$(!0)},[d,p,E]),W=s.useCallback(_=>{if(!N)return;_.preventDefault();const S=E(_);F.current.push(S);const R=j.current,L=R==null?void 0:R.getContext("2d");if(!L||!R)return;const O=F.current;O.length>=2&&(L.strokeStyle=r,L.lineWidth=i,L.lineCap="round",L.beginPath(),L.moveTo(O[O.length-2].x,O[O.length-2].y),L.lineTo(S.x,S.y),L.stroke())},[N,E,r,i]),z=s.useCallback(()=>{if(N&&($(!1),F.current.length>0&&(x.current.push([...F.current]),F.current=[],P(!1),j.current))){const _=j.current.toDataURL(h);e==null||e(_)}},[N,h,e]),T=s.useCallback(()=>{x.current=[],F.current=[],P(!0),A(),e==null||e(null)},[A,e]),g=s.useCallback(()=>{if(x.current.length!==0&&(x.current.pop(),P(x.current.length===0),A(),j.current)){const _=x.current.length>0?j.current.toDataURL(h):null;e==null||e(_)}},[A,h,e]);return a.jsxs("div",{ref:k,id:b,className:`nice-signature nice-signature--${l} ${d?"nice-signature--disabled":""} ${p?"nice-signature--readonly":""} ${m??""}`,style:v,...w,children:[y&&a.jsx("label",{className:"nice-signature__label",children:y}),a.jsx("div",{className:"nice-signature__canvas-wrap",style:{width:o,height:c},children:a.jsx("canvas",{ref:j,className:"nice-signature__canvas",onMouseDown:M,onMouseMove:W,onMouseUp:z,onMouseLeave:z,onTouchStart:M,onTouchMove:W,onTouchEnd:z,style:{touchAction:"none",cursor:d||p?"default":"crosshair"},"aria-label":y??C("signature.label","Signature pad"),role:"img"})}),(f||u)&&!p&&!d&&a.jsxs("div",{className:"nice-signature__actions",children:[u&&a.jsx("button",{type:"button",className:"nice-signature__btn",onClick:g,disabled:I,children:C("signature.undo","Undo")}),f&&a.jsx("button",{type:"button",className:"nice-signature__btn",onClick:T,disabled:I,children:C("signature.clear","Clear")})]})]})});rr.displayName="NiceSignaturePad";const Fi=s.createContext(null),Ri=()=>{const t=s.useContext(Fi);if(!t)throw new Error("useUploadContext must be used within NiceFileUpload");return t},mu=()=>`file-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,Ot=t=>{if(t===0)return"0 B";const e=1024,r=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,i)).toFixed(2))+" "+r[i]},Ii=t=>t.startsWith("image/")?"🖼️":t.startsWith("video/")?"🎬":t.startsWith("audio/")?"🎵":t.includes("pdf")?"📄":t.includes("word")||t.includes("document")?"📝":t.includes("excel")||t.includes("spreadsheet")?"📊":t.includes("powerpoint")||t.includes("presentation")?"📽️":t.includes("zip")||t.includes("rar")||t.includes("7z")?"📦":t.includes("text/")||t.includes("json")||t.includes("xml")?"📃":"📁",Pi=t=>t.startsWith("image/"),Li=t=>t.startsWith("video/"),fu=t=>t.startsWith("audio/"),hu=t=>{if(Pi(t.type)||Li(t.type)||fu(t.type))return URL.createObjectURL(t)},gu=(t,e)=>async r=>{const i=new FormData;r.chunk?(i.append("chunk",r.chunk),i.append("chunkIndex",String(r.chunkIndex)),i.append("totalChunks",String(r.totalChunks)),i.append("fileName",r.file.name),i.append("fileId",r.fileId||"")):i.append("file",r.file);const n=new XMLHttpRequest;return new Promise((o,c)=>{n.upload.addEventListener("progress",l=>{l.lengthComputable&&r.onProgress&&r.onProgress(l.loaded/l.total*100)}),n.addEventListener("load",()=>{if(n.status>=200&&n.status<300)try{const l=JSON.parse(n.responseText);o({success:!0,url:l.url,fileId:l.fileId||l.id,metadata:l})}catch{o({success:!0,url:n.responseText})}else o({success:!1,error:`Upload failed: ${n.status} ${n.statusText}`})}),n.addEventListener("error",()=>{o({success:!1,error:"Network error"})}),n.addEventListener("abort",()=>{o({success:!1,error:"Upload cancelled"})}),r.signal&&r.signal.addEventListener("abort",()=>n.abort()),n.open("POST",t),e&&Object.entries(e).forEach(([l,d])=>{n.setRequestHeader(l,d)}),n.send(i)})},ga=({progress:t,status:e})=>{const r=()=>{switch(e){case"success":return"#22c55e";case"error":return"#ef4444";case"cancelled":return"#6b7280";default:return"#3b82f6"}};return a.jsxs("div",{className:"nice-upload-progress",children:[a.jsx("div",{className:"nice-upload-progress-bar",style:{width:`${t}%`,backgroundColor:r()}}),a.jsxs("span",{className:"nice-upload-progress-text",children:[Math.round(t),"%"]})]})},Tr=({file:t,size:e="md",customRender:r})=>{if(r)return a.jsx(a.Fragment,{children:r(t)});const i={xxs:24,xs:32,sm:48,md:80,lg:120,xl:160,xxl:200}[e]??80;return t.previewUrl&&Pi(t.type)?a.jsx("div",{className:"nice-upload-preview",style:{width:i,height:i},children:a.jsx("img",{src:t.previewUrl,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:4}})}):t.previewUrl&&Li(t.type)?a.jsxs("div",{className:"nice-upload-preview",style:{width:i,height:i},children:[a.jsx("video",{src:t.previewUrl,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:4},muted:!0}),a.jsx("span",{className:"nice-upload-preview-overlay",children:"▶️"})]}):a.jsx("div",{className:"nice-upload-preview nice-upload-preview-icon",style:{width:i,height:i,fontSize:i*.5},children:Ii(t.type)})},yu=({file:t,actions:e,showPreview:r=!0,previewSize:i="md",customRenderPreview:n,customRender:o,mode:c="list"})=>{const{disabled:l,readOnly:d}=Ri();if(o)return a.jsx(a.Fragment,{children:o(t,e)});const p=()=>{switch(t.status){case"pending":return a.jsx("span",{className:"nice-upload-badge pending",children:"Oczekuje"});case"uploading":return a.jsx("span",{className:"nice-upload-badge uploading",children:"Wysyłanie..."});case"success":return a.jsx("span",{className:"nice-upload-badge success",children:"✓ Przesłano"});case"error":return a.jsx("span",{className:"nice-upload-badge error",children:"✗ Błąd"});case"cancelled":return a.jsx("span",{className:"nice-upload-badge cancelled",children:"Anulowano"})}};return c==="compact"?a.jsxs("div",{className:`nice-upload-item compact ${t.status}`,children:[a.jsx("span",{className:"nice-upload-item-icon",children:Ii(t.type)}),a.jsx("span",{className:"nice-upload-item-name",title:t.name,children:t.name}),a.jsx("span",{className:"nice-upload-item-size",children:Ot(t.size)}),t.status==="uploading"&&a.jsx(ga,{progress:t.progress,status:t.status}),p(),!d&&!l&&t.status!=="uploading"&&a.jsx("button",{className:"nice-upload-item-remove",onClick:e.remove,title:"Usuń",children:"✕"})]}):c==="grid"?a.jsxs("div",{className:`nice-upload-item grid ${t.status}`,children:[r&&a.jsx(Tr,{file:t,size:"lg",customRender:n}),a.jsxs("div",{className:"nice-upload-item-info",children:[a.jsx("span",{className:"nice-upload-item-name",title:t.name,children:t.name}),a.jsx("span",{className:"nice-upload-item-size",children:Ot(t.size)})]}),t.status==="uploading"&&a.jsx(ga,{progress:t.progress,status:t.status}),p(),t.error&&a.jsx("span",{className:"nice-upload-item-error",children:t.error}),!d&&!l&&a.jsxs("div",{className:"nice-upload-item-actions",children:[t.status==="pending"&&a.jsx("button",{onClick:e.upload,className:"nice-upload-btn upload",children:"Wyślij"}),t.status==="uploading"&&a.jsx("button",{onClick:e.cancel,className:"nice-upload-btn cancel",children:"Anuluj"}),t.status==="error"&&a.jsx("button",{onClick:e.retry,className:"nice-upload-btn retry",children:"Ponów"}),t.status!=="uploading"&&a.jsx("button",{onClick:e.remove,className:"nice-upload-btn remove",children:"Usuń"})]})]}):a.jsxs("div",{className:`nice-upload-item list ${t.status}`,children:[r&&a.jsx(Tr,{file:t,size:i,customRender:n}),a.jsxs("div",{className:"nice-upload-item-content",children:[a.jsxs("div",{className:"nice-upload-item-header",children:[a.jsx("span",{className:"nice-upload-item-name",title:t.name,children:t.name}),p()]}),a.jsx("span",{className:"nice-upload-item-size",children:Ot(t.size)}),t.status==="uploading"&&a.jsx(ga,{progress:t.progress,status:t.status}),t.error&&a.jsx("span",{className:"nice-upload-item-error",children:t.error}),t.uploadedUrl&&a.jsx("a",{href:t.uploadedUrl,target:"_blank",rel:"noopener noreferrer",className:"nice-upload-item-link",children:"Otwórz plik"})]}),!d&&!l&&a.jsxs("div",{className:"nice-upload-item-actions",children:[t.status==="pending"&&a.jsx("button",{onClick:e.upload,className:"nice-upload-btn upload",title:"Wyślij",children:"⬆️"}),t.status==="uploading"&&a.jsx("button",{onClick:e.cancel,className:"nice-upload-btn cancel",title:"Anuluj",children:"⏹️"}),t.status==="error"&&a.jsx("button",{onClick:e.retry,className:"nice-upload-btn retry",title:"Ponów",children:"🔄"}),t.status!=="uploading"&&a.jsx("button",{onClick:e.remove,className:"nice-upload-btn remove",title:"Usuń",children:"🗑️"})]})]})},bu=({files:t,mode:e="list",showPreview:r=!0,previewSize:i,renderPreview:n,renderFileItem:o})=>{const c=Ri();return t.length===0?null:a.jsx("div",{className:`nice-upload-list ${e}`,children:t.map(l=>a.jsx(yu,{file:l,actions:{upload:()=>c.uploadFile(l.id),cancel:()=>c.cancelFile(l.id),retry:()=>c.retryFile(l.id),remove:()=>c.removeFile(l.id)},mode:e,showPreview:r,previewSize:i,customRenderPreview:n,customRender:o},l.id))})},xu=({onFiles:t,accept:e,multiple:r=!0,disabled:i,readOnly:n,dropzoneText:o="Przeciągnij pliki tutaj lub",browseText:c="wybierz z dysku",dragActiveText:l="Upuść pliki tutaj",className:d,inputRef:p})=>{const[f,u]=s.useState(!1),y=s.useRef(0),h=s.useCallback(b=>{b.preventDefault(),b.stopPropagation(),y.current++,b.dataTransfer.items&&b.dataTransfer.items.length>0&&u(!0)},[]),m=s.useCallback(b=>{b.preventDefault(),b.stopPropagation(),y.current--,y.current===0&&u(!1)},[]),v=s.useCallback(b=>{b.preventDefault(),b.stopPropagation()},[]),D=s.useCallback(b=>{if(b.preventDefault(),b.stopPropagation(),u(!1),y.current=0,i||n)return;const C=Array.from(b.dataTransfer.files);C.length>0&&t(r?C:[C[0]])},[i,n,r,t]),w=s.useCallback(()=>{!i&&!n&&p.current&&p.current.click()},[i,n,p]),k=s.useCallback(b=>{const C=b.target.files?Array.from(b.target.files):[];C.length>0&&t(C),p.current&&(p.current.value="")},[t,p]);return a.jsxs("div",{className:`nice-upload-dropzone ${f?"drag-active":""} ${i?"disabled":""} ${n?"readonly":""} ${d||""}`,onDragEnter:h,onDragLeave:m,onDragOver:v,onDrop:D,onClick:w,children:[a.jsx("input",{ref:p,type:"file",accept:e,multiple:r,onChange:k,style:{display:"none"},disabled:i||n}),a.jsxs("div",{className:"nice-upload-dropzone-content",children:[a.jsx("span",{className:"nice-upload-dropzone-icon",children:"📁"}),f?a.jsx("span",{className:"nice-upload-dropzone-text active",children:l}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"nice-upload-dropzone-text",children:o}),a.jsx("button",{type:"button",className:"nice-upload-browse-btn",disabled:i||n,children:c})]})]})]})},Oi=s.forwardRef((t,e)=>{const{accept:r,multiple:i=!0,maxFileSize:n,maxFiles:o,minFileSize:c,chunkSize:l=5*1024*1024,chunkThreshold:d=10*1024*1024,autoUpload:p=!1,uploadHandler:f,uploadUrl:u,uploadHeaders:y,onFilesAdded:h,onUploadComplete:m,onUploadError:v,onProgress:D,onFileRemoved:w,onChange:k,renderPreview:b,renderFileItem:C,showPreview:j=!0,showFileList:N=!0,listMode:$="list",previewSize:x="md",dropzoneText:F,browseText:I,dragActiveText:P,disabled:A,readOnly:E,dropzoneClassName:M,maxRetries:W=3,concurrentUploads:z=3,validateFile:T,keepFilesAfterUpload:g=!0,initialFiles:_=[],className:S,style:R,...L}=t,[O,Y]=s.useState(_),G=s.useRef(null),B=s.useRef(new Map),K=s.useRef([]),J=s.useRef(new Set);s.useEffect(()=>()=>{O.forEach(ie=>{ie.previewUrl&&URL.revokeObjectURL(ie.previewUrl)})},[]),s.useEffect(()=>{k==null||k(O)},[O,k]);const he=s.useCallback(()=>f||(u?gu(u,y):null),[f,u,y]),pe=s.useCallback(ie=>{var je;if(T){const oe=T(ie);if(oe)return oe}if(n&&ie.size>n)return`Plik jest za duży. Maksymalny rozmiar: ${Ot(n)}`;if(c&&ie.size<c)return`Plik jest za mały. Minimalny rozmiar: ${Ot(c)}`;if(r){const oe=r.split(",").map(Fe=>Fe.trim().toLowerCase()),Ae=ie.type.toLowerCase(),ze="."+((je=ie.name.split(".").pop())==null?void 0:je.toLowerCase());if(!oe.some(Fe=>Fe.startsWith(".")?ze===Fe:Fe.endsWith("/*")?Ae.startsWith(Fe.replace("/*","/")):Ae===Fe))return`Niedozwolony typ pliku. Akceptowane typy: ${r}`}return null},[T,n,c,r]),we=s.useCallback(ie=>{if(A||E)return;const je=O.length;let oe=ie;o&&je+oe.length>o&&(oe=oe.slice(0,o-je));const Ae=oe.map(ze=>{const Fe=pe(ze);return{id:mu(),file:ze,name:ze.name,size:ze.size,type:ze.type,status:Fe?"error":"pending",progress:0,error:Fe||void 0,previewUrl:hu(ze)}});Y(ze=>[...ze,...Ae]),h==null||h(Ae),p&&(Ae.filter(ze=>ze.status==="pending").forEach(ze=>{K.current.push(ze.id)}),se())},[A,E,O.length,o,pe,p,h]),se=s.useCallback(()=>{const ie=he();if(ie)for(;K.current.length>0&&J.current.size<z;){const je=K.current.shift();je&&Ce(je,ie)}},[z,he]),Ce=s.useCallback(async(ie,je)=>{const oe=O.find(ze=>ze.id===ie);if(!oe||oe.status==="uploading"||oe.status==="success")return;const Ae=new AbortController;B.current.set(ie,Ae),J.current.add(ie),Y(ze=>ze.map(Fe=>Fe.id===ie?{...Fe,status:"uploading",progress:0,error:void 0}:Fe));try{const ze=oe.file;let Fe;if(ze.size>d?Fe=await ee(oe,je,Ae.signal):Fe=await je({file:ze,onProgress:Ge=>{Y(Ye=>Ye.map(it=>it.id===ie?{...it,progress:Ge}:it)),D==null||D(oe,Ge)},signal:Ae.signal}),Fe.success)Y(Ge=>Ge.map(Ye=>Ye.id===ie?{...Ye,status:"success",progress:100,uploadedUrl:Fe.url,uploadedAt:new Date}:Ye)),m==null||m({...oe,status:"success",uploadedUrl:Fe.url});else throw new Error(Fe.error||"Upload failed")}catch(ze){if(ze.name==="AbortError"||ze.message==="Upload cancelled")Y(Fe=>Fe.map(Ge=>Ge.id===ie?{...Ge,status:"cancelled",error:"Anulowano"}:Ge));else{const Fe=ze.message||"Błąd uploadu";Y(Ge=>Ge.map(Ye=>Ye.id===ie?{...Ye,status:"error",error:Fe}:Ye)),v==null||v(oe,Fe)}}finally{B.current.delete(ie),J.current.delete(ie),se()}},[O,d,D,m,v,se]),ee=async(ie,je,oe)=>{const Ae=ie.file,ze=Math.ceil(Ae.size/l);let Fe=0,Ge={success:!1};for(let Ye=0;Ye<ze;Ye++){if(oe.aborted)throw new Error("Upload cancelled");const it=Ye*l,_t=Math.min(it+l,Ae.size),ht=Ae.slice(it,_t);let H=0,ae=!1;for(;!ae&&H<W;)try{Ge=await je({file:Ae,chunk:ht,chunkIndex:Ye,totalChunks:ze,fileId:ie.id,onProgress:le=>{const ce=(Fe+ht.size*le/100)/Ae.size*100;Y(ye=>ye.map(ne=>ne.id===ie.id?{...ne,progress:ce}:ne))},signal:oe}),Ge.success?(ae=!0,Fe+=ht.size):H++}catch(le){if(H++,H>=W)throw le}if(!ae)throw new Error(`Failed to upload chunk ${Ye+1}/${ze}`)}return Ge},de=s.useCallback(ie=>{const je=he();if(!je){console.error("No upload handler configured");return}Ce(ie,je)},[he,Ce]),xe=s.useCallback(ie=>{const je=B.current.get(ie);je&&je.abort(),Y(oe=>oe.map(Ae=>Ae.id===ie&&Ae.status==="uploading"?{...Ae,status:"cancelled",error:"Anulowano"}:Ae))},[]),$e=s.useCallback(ie=>{Y(je=>je.map(oe=>oe.id===ie?{...oe,status:"pending",progress:0,error:void 0}:oe)),de(ie)},[de]),Ne=s.useCallback(ie=>{const je=O.find(oe=>oe.id===ie);if(je){const oe=B.current.get(ie);oe&&oe.abort(),je.previewUrl&&URL.revokeObjectURL(je.previewUrl),Y(Ae=>Ae.filter(ze=>ze.id!==ie)),w==null||w(je)}},[O,w]),U=s.useCallback(()=>{O.filter(ie=>ie.status==="pending").forEach(ie=>{K.current.push(ie.id)}),se()},[O,se]),Z=s.useCallback(()=>{B.current.forEach(ie=>ie.abort()),Y(ie=>ie.map(je=>je.status==="uploading"?{...je,status:"cancelled",error:"Anulowano"}:je))},[]),X=s.useCallback(()=>{Z(),O.forEach(ie=>{ie.previewUrl&&URL.revokeObjectURL(ie.previewUrl)}),Y([])},[Z,O]),Q=s.useCallback(()=>{O.filter(ie=>ie.status==="error").forEach(ie=>$e(ie.id))},[O,$e]),fe=s.useCallback(()=>{var ie;(ie=G.current)==null||ie.click()},[]);s.useImperativeHandle(e,()=>({addFiles:we,uploadAll:U,cancelAll:Z,clearAll:X,getFiles:()=>O,getFile:ie=>O.find(je=>je.id===ie),retryFailed:Q,openFileBrowser:fe}),[we,U,Z,X,O,Q,fe]);const Se=s.useMemo(()=>({files:O,uploadFile:de,cancelFile:xe,retryFile:$e,removeFile:Ne,disabled:A,readOnly:E}),[O,de,xe,$e,Ne,A,E]),be=s.useMemo(()=>({total:O.length,pending:O.filter(ie=>ie.status==="pending").length,uploading:O.filter(ie=>ie.status==="uploading").length,success:O.filter(ie=>ie.status==="success").length,error:O.filter(ie=>ie.status==="error").length}),[O]);return a.jsx(Fi.Provider,{value:Se,children:a.jsxs("div",{className:`nice-file-upload ${A?"disabled":""} ${E?"readonly":""} ${S||""}`,style:R,...L,children:[!E&&a.jsx(xu,{onFiles:we,accept:r,multiple:i,disabled:A,readOnly:E,dropzoneText:F,browseText:I,dragActiveText:P,className:M,inputRef:G}),N&&O.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"nice-upload-stats",children:[a.jsxs("span",{children:[be.total," ",be.total===1?"plik":"plików"]}),be.pending>0&&a.jsxs("span",{className:"pending",children:[be.pending," oczekuje"]}),be.uploading>0&&a.jsxs("span",{className:"uploading",children:[be.uploading," wysyłanie"]}),be.success>0&&a.jsxs("span",{className:"success",children:[be.success," przesłano"]}),be.error>0&&a.jsxs("span",{className:"error",children:[be.error," błędów"]})]}),!E&&!A&&be.pending>0&&a.jsxs("div",{className:"nice-upload-actions",children:[a.jsxs("button",{onClick:U,className:"nice-upload-btn primary",children:["Wyślij wszystkie (",be.pending,")"]}),be.error>0&&a.jsxs("button",{onClick:Q,className:"nice-upload-btn secondary",children:["Ponów nieudane (",be.error,")"]}),a.jsx("button",{onClick:X,className:"nice-upload-btn danger",children:"Wyczyść"})]}),a.jsx(bu,{files:O,mode:$,showPreview:j,previewSize:x,renderPreview:b,renderFileItem:C})]}),a.jsx("style",{children:`
|
|
370
|
+
.nice-file-upload {
|
|
371
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.nice-file-upload.disabled {
|
|
375
|
+
opacity: 0.5;
|
|
376
|
+
pointer-events: none;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.nice-upload-dropzone {
|
|
380
|
+
border: 2px dashed #d1d5db;
|
|
381
|
+
border-radius: 12px;
|
|
382
|
+
padding: 40px 24px;
|
|
383
|
+
text-align: center;
|
|
384
|
+
cursor: pointer;
|
|
385
|
+
transition: all 0.2s ease;
|
|
386
|
+
background: #fafafa;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.nice-upload-dropzone:hover:not(.disabled):not(.readonly) {
|
|
390
|
+
border-color: #3b82f6;
|
|
391
|
+
background: #eff6ff;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.nice-upload-dropzone.drag-active {
|
|
395
|
+
border-color: #3b82f6;
|
|
396
|
+
background: #dbeafe;
|
|
397
|
+
transform: scale(1.01);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.nice-upload-dropzone.disabled,
|
|
401
|
+
.nice-upload-dropzone.readonly {
|
|
402
|
+
cursor: default;
|
|
403
|
+
background: #f3f4f6;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.nice-upload-dropzone-content {
|
|
407
|
+
display: flex;
|
|
408
|
+
flex-direction: column;
|
|
409
|
+
align-items: center;
|
|
410
|
+
gap: 12px;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.nice-upload-dropzone-icon {
|
|
414
|
+
font-size: 48px;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.nice-upload-dropzone-text {
|
|
418
|
+
font-size: 14px;
|
|
419
|
+
color: #6b7280;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.nice-upload-dropzone-text.active {
|
|
423
|
+
font-size: 16px;
|
|
424
|
+
color: #3b82f6;
|
|
425
|
+
font-weight: 500;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.nice-upload-browse-btn {
|
|
429
|
+
background: #3b82f6;
|
|
430
|
+
color: white;
|
|
431
|
+
border: none;
|
|
432
|
+
padding: 8px 20px;
|
|
433
|
+
border-radius: 6px;
|
|
434
|
+
font-size: 14px;
|
|
435
|
+
cursor: pointer;
|
|
436
|
+
transition: background 0.2s;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.nice-upload-browse-btn:hover:not(:disabled) {
|
|
440
|
+
background: #2563eb;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.nice-upload-browse-btn:disabled {
|
|
444
|
+
background: #9ca3af;
|
|
445
|
+
cursor: not-allowed;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.nice-upload-stats {
|
|
449
|
+
display: flex;
|
|
450
|
+
gap: 16px;
|
|
451
|
+
padding: 12px 0;
|
|
452
|
+
font-size: 13px;
|
|
453
|
+
color: #6b7280;
|
|
454
|
+
border-bottom: 1px solid #e5e7eb;
|
|
455
|
+
margin-top: 16px;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.nice-upload-stats .pending { color: #f59e0b; }
|
|
459
|
+
.nice-upload-stats .uploading { color: #3b82f6; }
|
|
460
|
+
.nice-upload-stats .success { color: #22c55e; }
|
|
461
|
+
.nice-upload-stats .error { color: #ef4444; }
|
|
462
|
+
|
|
463
|
+
.nice-upload-actions {
|
|
464
|
+
display: flex;
|
|
465
|
+
gap: 8px;
|
|
466
|
+
padding: 12px 0;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.nice-upload-btn {
|
|
470
|
+
padding: 6px 14px;
|
|
471
|
+
border-radius: 6px;
|
|
472
|
+
font-size: 13px;
|
|
473
|
+
cursor: pointer;
|
|
474
|
+
border: 1px solid transparent;
|
|
475
|
+
transition: all 0.2s;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.nice-upload-btn.primary {
|
|
479
|
+
background: #3b82f6;
|
|
480
|
+
color: white;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.nice-upload-btn.primary:hover {
|
|
484
|
+
background: #2563eb;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.nice-upload-btn.secondary {
|
|
488
|
+
background: white;
|
|
489
|
+
border-color: #d1d5db;
|
|
490
|
+
color: #374151;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.nice-upload-btn.secondary:hover {
|
|
494
|
+
background: #f3f4f6;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.nice-upload-btn.danger {
|
|
498
|
+
background: white;
|
|
499
|
+
border-color: #fca5a5;
|
|
500
|
+
color: #dc2626;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.nice-upload-btn.danger:hover {
|
|
504
|
+
background: #fef2f2;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.nice-upload-btn.upload { background: #22c55e; color: white; border: none; }
|
|
508
|
+
.nice-upload-btn.cancel { background: #f59e0b; color: white; border: none; }
|
|
509
|
+
.nice-upload-btn.retry { background: #3b82f6; color: white; border: none; }
|
|
510
|
+
.nice-upload-btn.remove { background: #ef4444; color: white; border: none; }
|
|
511
|
+
|
|
512
|
+
.nice-upload-list {
|
|
513
|
+
margin-top: 12px;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.nice-upload-list.grid {
|
|
517
|
+
display: grid;
|
|
518
|
+
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
|
519
|
+
gap: 16px;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.nice-upload-item {
|
|
523
|
+
display: flex;
|
|
524
|
+
align-items: center;
|
|
525
|
+
gap: 12px;
|
|
526
|
+
padding: 12px;
|
|
527
|
+
background: #f9fafb;
|
|
528
|
+
border-radius: 8px;
|
|
529
|
+
border: 1px solid #e5e7eb;
|
|
530
|
+
margin-bottom: 8px;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.nice-upload-item.error {
|
|
534
|
+
border-color: #fca5a5;
|
|
535
|
+
background: #fef2f2;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.nice-upload-item.success {
|
|
539
|
+
border-color: #86efac;
|
|
540
|
+
background: #f0fdf4;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.nice-upload-item.grid {
|
|
544
|
+
flex-direction: column;
|
|
545
|
+
text-align: center;
|
|
546
|
+
padding: 16px;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.nice-upload-item.compact {
|
|
550
|
+
padding: 8px 12px;
|
|
551
|
+
font-size: 13px;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
.nice-upload-preview {
|
|
555
|
+
flex-shrink: 0;
|
|
556
|
+
display: flex;
|
|
557
|
+
align-items: center;
|
|
558
|
+
justify-content: center;
|
|
559
|
+
background: #e5e7eb;
|
|
560
|
+
border-radius: 6px;
|
|
561
|
+
overflow: hidden;
|
|
562
|
+
position: relative;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
.nice-upload-preview-icon {
|
|
566
|
+
background: #f3f4f6;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
.nice-upload-preview-overlay {
|
|
570
|
+
position: absolute;
|
|
571
|
+
font-size: 24px;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.nice-upload-item-content {
|
|
575
|
+
flex: 1;
|
|
576
|
+
min-width: 0;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.nice-upload-item-header {
|
|
580
|
+
display: flex;
|
|
581
|
+
align-items: center;
|
|
582
|
+
gap: 8px;
|
|
583
|
+
margin-bottom: 4px;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.nice-upload-item-name {
|
|
587
|
+
font-weight: 500;
|
|
588
|
+
font-size: 14px;
|
|
589
|
+
color: #111827;
|
|
590
|
+
overflow: hidden;
|
|
591
|
+
text-overflow: ellipsis;
|
|
592
|
+
white-space: nowrap;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.nice-upload-item-size {
|
|
596
|
+
font-size: 12px;
|
|
597
|
+
color: #6b7280;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.nice-upload-item-error {
|
|
601
|
+
font-size: 12px;
|
|
602
|
+
color: #dc2626;
|
|
603
|
+
margin-top: 4px;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.nice-upload-item-link {
|
|
607
|
+
font-size: 12px;
|
|
608
|
+
color: #3b82f6;
|
|
609
|
+
text-decoration: none;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.nice-upload-item-link:hover {
|
|
613
|
+
text-decoration: underline;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
.nice-upload-item-actions {
|
|
617
|
+
display: flex;
|
|
618
|
+
gap: 4px;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.nice-upload-item-actions button {
|
|
622
|
+
padding: 4px 8px;
|
|
623
|
+
font-size: 12px;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.nice-upload-item-remove {
|
|
627
|
+
background: none;
|
|
628
|
+
border: none;
|
|
629
|
+
color: #9ca3af;
|
|
630
|
+
cursor: pointer;
|
|
631
|
+
padding: 4px;
|
|
632
|
+
font-size: 14px;
|
|
633
|
+
line-height: 1;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.nice-upload-item-remove:hover {
|
|
637
|
+
color: #ef4444;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.nice-upload-badge {
|
|
641
|
+
font-size: 11px;
|
|
642
|
+
padding: 2px 8px;
|
|
643
|
+
border-radius: 10px;
|
|
644
|
+
font-weight: 500;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.nice-upload-badge.pending { background: #fef3c7; color: #92400e; }
|
|
648
|
+
.nice-upload-badge.uploading { background: #dbeafe; color: #1e40af; }
|
|
649
|
+
.nice-upload-badge.success { background: #dcfce7; color: #166534; }
|
|
650
|
+
.nice-upload-badge.error { background: #fee2e2; color: #991b1b; }
|
|
651
|
+
.nice-upload-badge.cancelled { background: #f3f4f6; color: #4b5563; }
|
|
652
|
+
|
|
653
|
+
.nice-upload-progress {
|
|
654
|
+
height: 6px;
|
|
655
|
+
background: #e5e7eb;
|
|
656
|
+
border-radius: 3px;
|
|
657
|
+
overflow: hidden;
|
|
658
|
+
margin-top: 6px;
|
|
659
|
+
position: relative;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.nice-upload-progress-bar {
|
|
663
|
+
height: 100%;
|
|
664
|
+
transition: width 0.2s ease;
|
|
665
|
+
border-radius: 3px;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.nice-upload-progress-text {
|
|
669
|
+
position: absolute;
|
|
670
|
+
right: 0;
|
|
671
|
+
top: -18px;
|
|
672
|
+
font-size: 11px;
|
|
673
|
+
color: #6b7280;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.nice-upload-item.compact .nice-upload-progress {
|
|
677
|
+
flex: 1;
|
|
678
|
+
margin: 0 8px;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.nice-upload-item.compact .nice-upload-progress-text {
|
|
682
|
+
position: static;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.nice-upload-item-info {
|
|
686
|
+
margin-top: 8px;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
.nice-upload-item.grid .nice-upload-item-name {
|
|
690
|
+
font-size: 13px;
|
|
691
|
+
max-width: 100%;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
@media (max-width: 640px) {
|
|
695
|
+
.nice-upload-dropzone {
|
|
696
|
+
padding: 24px 16px;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
.nice-upload-actions {
|
|
700
|
+
flex-wrap: wrap;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
.nice-upload-list.grid {
|
|
704
|
+
grid-template-columns: repeat(2, 1fr);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
`})]})})});Oi.displayName="NiceFileUpload";let vu=0;function ir(){return`blk-${++vu}-${Date.now().toString(36)}`}function Fr(t=""){return{id:ir(),type:"paragraph",content:t}}function ku(t,e=""){const r={id:ir(),type:t,content:e};return t==="heading"&&(r.level=2),t==="list"&&(r.listType="unordered"),t==="callout"&&(r.icon="ℹ️"),t==="toggle"&&(r.open=!0),r}const wu=[{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 _u(t){const e=[t.align?`text-align:${t.align}`:"",t.color?`color:${t.color}`:"",t.bgColor?`background-color:${t.bgColor}`:"",t.indent?`margin-left:${t.indent*24}px`:""].filter(Boolean).join(";"),r=e?` style="${e}"`:"",i=(n,o)=>{let c=o;return t.bold&&(c=`<strong>${c}</strong>`),t.italic&&(c=`<em>${c}</em>`),t.underline&&(c=`<u>${c}</u>`),t.strikethrough&&(c=`<s>${c}</s>`),`<${n}${r}>${c}</${n}>`};switch(t.type){case"heading":return i(`h${t.level??2}`,t.content);case"paragraph":return i("p",t.content||" ");case"list":{const n=t.listType==="ordered"?"ol":"ul",o=t.content.split(`
|
|
708
|
+
`).map((c,l)=>{var d;return t.listType==="checklist"?`<li><input type="checkbox" ${((d=t.checked)==null?void 0:d[l])??!1?"checked":""} disabled />${c}</li>`:`<li>${c}</li>`}).join("");return`<${n}${r}>${o}</${n}>`}case"image":return`<figure${r}><img src="${t.src??""}" alt="${t.alt??""}" /></figure>`;case"video":return`<figure${r}><video src="${t.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-${t.language??""}">${t.content}</code></pre>`;case"quote":return i("blockquote",t.content);case"callout":return`<div class="nice-doc-callout"${r}><span>${t.icon??"ℹ️"}</span><div>${t.content}</div></div>`;case"toggle":return`<details${r}><summary>${t.content.split(`
|
|
709
|
+
`)[0]}</summary>${t.content.split(`
|
|
710
|
+
`).slice(1).join("<br>")}</details>`;case"table":return`<table${r}>${t.content}</table>`;case"embed":return`<iframe src="${t.src??""}" style="width:100%;border:none;min-height:300px"></iframe>`;default:return i("p",t.content)}}function Cu(t){let e=0,r=0;for(const i of t){const n=i.content??"";e+=n.length;const o=n.trim().split(/\s+/).filter(Boolean);r+=o.length}return{words:r,chars:e,readingTime:Math.max(1,Math.ceil(r/200))}}const nr=s.forwardRef(({blocks:t,onChange:e,readOnly:r=!1,showToolbar:i=!0,size:n="md",editorSize:o="standard",placeholder:c,onExport:l,onImageUpload:d,maxUndo:p=50,slashCommands:f=!0,showWordCount:u=!1,showToc:y=!1,showFindReplace:h=!0,className:m,style:v,id:D,...w},k)=>{var ue,ge,ke,_e,Te,Me,Ie,Oe,Ze,Xe,et,st,He,gt,Ct,Et;const b=Ee(D),{t:C}=De(),[j,N]=s.useState(()=>t??[Fr()]),$=t??j,[x,F]=s.useState(0),I=s.useRef(new Map),P=s.useRef(null),[A,E]=s.useState(!1),[M,W]=s.useState(""),[z,T]=s.useState(""),[g,_]=s.useState([]),[S,R]=s.useState(0),[L,O]=s.useState(!1),Y=s.useRef([]),G=s.useRef([]),B=s.useCallback(q=>{Y.current.push(q.map(te=>({...te,checked:te.checked?[...te.checked]:void 0}))),Y.current.length>p&&Y.current.shift(),G.current=[]},[p]),K=s.useCallback(()=>{if(Y.current.length===0)return;const q=Y.current.pop();G.current.push($.map(te=>({...te}))),t||N(q),e==null||e(q)},[$,t,e]),J=s.useCallback(()=>{if(G.current.length===0)return;const q=G.current.pop();Y.current.push($.map(te=>({...te}))),t||N(q),e==null||e(q)},[$,t,e]),[he,pe]=s.useState(!1),[we,se]=s.useState(""),[Ce,ee]=s.useState(0),de=s.useMemo(()=>{if(!he||!f)return[];const q=we.toLowerCase();return wu.filter(te=>te.label.toLowerCase().includes(q)||te.keywords.includes(q))},[he,we,f]),[xe,$e]=s.useState(null),[Ne,U]=s.useState(null),Z=s.useCallback(q=>{B($);const te=q($);t||N(te),e==null||e(te)},[$,t,e,B]),X=s.useCallback((q,te)=>{Z(re=>re.map((Re,Ue)=>Ue===q?{...Re,...te}:Re))},[Z]),Q=s.useCallback((q,te)=>{const re=te??Fr();Z(Re=>{const Ue=[...Re];return Ue.splice(q+1,0,re),Ue}),F(q+1)},[Z]),fe=s.useCallback(q=>{const te={...$[q],id:ir()};Q(q,te)},[$,Q]),Se=s.useCallback(q=>{$.length<=1||(Z(te=>te.filter((re,Re)=>Re!==q)),F(Math.max(0,q-1)))},[$.length,Z]),be=s.useCallback((q,te)=>{const re=q+te;re<0||re>=$.length||(Z(Re=>{const Ue=[...Re];return[Ue[q],Ue[re]]=[Ue[re],Ue[q]],Ue}),F(re))},[$.length,Z]),ie=s.useCallback((q,te)=>{const re={type:te};te==="heading"&&(re.level=2),te==="list"&&(re.listType="unordered"),te==="callout"&&(re.icon="ℹ️"),te==="toggle"&&(re.open=!0),X(q,re)},[X]),je=s.useCallback(q=>{var re,Re;const te=ku(q.type);q.type==="list"&&q.label.includes("Numbered")&&(te.listType="ordered"),q.type==="list"&&q.label.includes("Checklist")&&(te.listType="checklist",te.checked=[]),((re=$[x])==null?void 0:re.content)===""||((Re=$[x])==null?void 0:Re.content)==="/"?Z(Ue=>Ue.map((bt,At)=>At===x?{...te,id:bt.id}:bt)):Q(x,te),pe(!1),se("")},[$,x,Z,Q]),oe=s.useCallback((q,te)=>{if(r)return;const re=$[te];if(!(re!=null&&re.locked)){if((q.ctrlKey||q.metaKey)&&q.key==="z"&&!q.shiftKey){q.preventDefault(),K();return}if((q.ctrlKey||q.metaKey)&&(q.key==="y"||q.key==="z"&&q.shiftKey)){q.preventDefault(),J();return}if((q.ctrlKey||q.metaKey)&&q.key==="d"){q.preventDefault(),fe(te);return}if((q.ctrlKey||q.metaKey)&&q.key==="b"){q.preventDefault(),X(te,{bold:!(re!=null&&re.bold)});return}if((q.ctrlKey||q.metaKey)&&q.key==="i"){q.preventDefault(),X(te,{italic:!(re!=null&&re.italic)});return}if((q.ctrlKey||q.metaKey)&&q.key==="u"){q.preventDefault(),X(te,{underline:!(re!=null&&re.underline)});return}if((q.ctrlKey||q.metaKey)&&q.key==="e"){q.preventDefault(),X(te,{strikethrough:!(re!=null&&re.strikethrough)});return}if(q.key==="Tab"&&!q.shiftKey){q.preventDefault(),X(te,{indent:Math.min(((re==null?void 0:re.indent)??0)+1,4)});return}if(q.key==="Tab"&&q.shiftKey){q.preventDefault(),X(te,{indent:Math.max(((re==null?void 0:re.indent)??0)-1,0)});return}if((q.ctrlKey||q.metaKey)&&q.key==="f"&&h){q.preventDefault(),E(Re=>!Re);return}if(he&&de.length>0){if(q.key==="ArrowDown"){q.preventDefault(),ee(Re=>Math.min(Re+1,de.length-1));return}if(q.key==="ArrowUp"){q.preventDefault(),ee(Re=>Math.max(Re-1,0));return}if(q.key==="Enter"){q.preventDefault(),je(de[Ce]);return}if(q.key==="Escape"){pe(!1);return}}q.key==="Enter"&&!q.shiftKey?(q.preventDefault(),Q(te)):q.key==="Backspace"&&$[te].content===""&&$.length>1?(q.preventDefault(),Se(te)):q.key==="ArrowUp"&&q.altKey?(q.preventDefault(),be(te,-1)):q.key==="ArrowDown"&&q.altKey&&(q.preventDefault(),be(te,1))}},[r,$,Q,Se,be,K,J,fe,X,he,de,Ce,je,h]),Ae=s.useCallback((q,te)=>{const re=q.target.textContent??"";f&&re.startsWith("/")?(pe(!0),se(re.slice(1)),ee(0)):he&&pe(!1),B($);const Re=$.map((Ue,bt)=>bt===te?{...Ue,content:re}:Ue);t||N(Re),e==null||e(Re)},[$,t,e,B,f,he]),ze=s.useCallback((q,te)=>{$e(te),q.dataTransfer.effectAllowed="move"},[]),Fe=s.useCallback((q,te)=>{q.preventDefault(),q.dataTransfer.dropEffect="move",U(te)},[]),Ge=s.useCallback((q,te)=>{if(q.preventDefault(),xe===null||xe===te){$e(null),U(null);return}Z(re=>{const Re=[...re],[Ue]=Re.splice(xe,1);return Re.splice(te>xe?te-1:te,0,Ue),Re}),F(te>xe?te-1:te),$e(null),U(null)},[xe,Z]);s.useEffect(()=>{if(!A||!M){_([]);return}const q=M.toLowerCase(),te=[];$.forEach((re,Re)=>{const Ue=(re.content??"").toLowerCase();let bt=0;for(;bt<Ue.length;){const At=Ue.indexOf(q,bt);if(At===-1)break;te.push({blockIdx:Re,start:At,end:At+q.length}),bt=At+1}}),_(te),R(0)},[M,A,$]);const Ye=s.useCallback(()=>{if(g.length===0)return;const q=(S+1)%g.length;R(q),F(g[q].blockIdx)},[g,S]),it=s.useCallback(()=>{if(g.length===0)return;const q=(S-1+g.length)%g.length;R(q),F(g[q].blockIdx)},[g,S]),_t=s.useCallback(()=>{if(g.length===0||!M)return;const q=g[S],te=$[q.blockIdx],re=te.content.slice(0,q.start),Re=te.content.slice(q.end);X(q.blockIdx,{content:re+z+Re})},[g,S,M,z,$,X]),ht=s.useCallback(()=>{if(!M)return;const q=M;Z(te=>te.map(re=>({...re,content:re.content.split(q).join(z)})))},[M,z,Z]),H=s.useMemo(()=>y?$.map((q,te)=>q.type==="heading"?{idx:te,level:q.level??2,text:q.content}:null).filter(Boolean):[],[$,y]),ae=s.useCallback(async q=>{var re;const te=(re=q.target.files)==null?void 0:re[0];if(te){if(d){const Re=await d(te);X(x,{src:Re})}q.target.value=""}},[d,x,X]);s.useEffect(()=>{const q=$[x];if(q){const te=I.current.get(q.id);te&&te.focus()}},[x,$]);const le=s.useCallback(()=>{const q=$.map(_u).join(`
|
|
711
|
+
`);l==null||l(q)},[$,l]),ce=s.useMemo(()=>u?Cu($):null,[$,u]),[ye,ne]=s.useState(null),V=s.useCallback((q,te)=>{r||(q.preventDefault(),ne({x:q.clientX,y:q.clientY,idx:te}))},[r]);return s.useEffect(()=>{if(!ye)return;const q=()=>ne(null);return window.addEventListener("click",q),()=>window.removeEventListener("click",q)},[ye]),a.jsxs("div",{ref:k,id:b,className:`nice-doc-editor nice-doc-editor--${n} nice-editor--${o} ${r?"nice-doc-editor--readonly":""} ${m??""}`,style:v,role:"application","aria-label":C("docEditor.label","Document Editor"),...w,children:[i&&!r&&a.jsxs("div",{className:"nice-doc-editor__toolbar",role:"toolbar",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center",padding:"4px 8px"},children:[a.jsx(me,{size:"sm",variant:"ghost",onClick:K,title:C("docEditor.undo","Undo (Ctrl+Z)"),children:"↩"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:J,title:C("docEditor.redo","Redo (Ctrl+Y)"),children:"↪"}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(Je,{size:"sm",value:((ue=$[x])==null?void 0:ue.type)??"paragraph",onChange:q=>ie(x,q),label:"",options:[{value:"paragraph",label:C("docEditor.paragraph","Paragraph")},{value:"heading",label:C("docEditor.heading","Heading")},{value:"list",label:C("docEditor.list","List")},{value:"code",label:C("docEditor.code","Code")},{value:"quote",label:C("docEditor.quote","Quote")},{value:"callout",label:C("docEditor.callout","Callout")},{value:"toggle",label:C("docEditor.toggle","Toggle")},{value:"divider",label:C("docEditor.divider","Divider")},{value:"image",label:C("docEditor.image","Image")},{value:"video",label:C("docEditor.video","Video")},{value:"pageBreak",label:C("docEditor.pageBreak","Page Break")}],style:{minWidth:100}}),((ge=$[x])==null?void 0:ge.type)==="heading"&&a.jsx(Je,{size:"sm",value:String(((ke=$[x])==null?void 0:ke.level)??2),onChange:q=>X(x,{level:Number(q)}),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}}),((_e=$[x])==null?void 0:_e.type)==="list"&&a.jsx(Je,{size:"sm",value:((Te=$[x])==null?void 0:Te.listType)??"unordered",onChange:q=>X(x,{listType:q}),label:"",options:[{value:"unordered",label:"• Bullets"},{value:"ordered",label:"1. Numbers"},{value:"checklist",label:"☑ Checklist"}],style:{minWidth:90}}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(me,{size:"sm",variant:(Me=$[x])!=null&&Me.bold?"primary":"ghost",onClick:()=>{var q;return X(x,{bold:!((q=$[x])!=null&&q.bold)})},title:C("docEditor.bold","Bold (Ctrl+B)"),children:a.jsx("strong",{children:"B"})}),a.jsx(me,{size:"sm",variant:(Ie=$[x])!=null&&Ie.italic?"primary":"ghost",onClick:()=>{var q;return X(x,{italic:!((q=$[x])!=null&&q.italic)})},title:C("docEditor.italic","Italic (Ctrl+I)"),children:a.jsx("em",{children:"I"})}),a.jsx(me,{size:"sm",variant:(Oe=$[x])!=null&&Oe.underline?"primary":"ghost",onClick:()=>{var q;return X(x,{underline:!((q=$[x])!=null&&q.underline)})},title:C("docEditor.underline","Underline (Ctrl+U)"),children:a.jsx("u",{children:"U"})}),a.jsx(me,{size:"sm",variant:(Ze=$[x])!=null&&Ze.strikethrough?"primary":"ghost",onClick:()=>{var q;return X(x,{strikethrough:!((q=$[x])!=null&&q.strikethrough)})},title:C("docEditor.strikethrough","Strikethrough (Ctrl+E)"),children:a.jsx("s",{children:"S"})}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(me,{size:"sm",variant:((Xe=$[x])==null?void 0:Xe.align)==="left"?"primary":"ghost",onClick:()=>X(x,{align:"left"}),title:C("docEditor.alignLeft","Left"),children:"⬅"}),a.jsx(me,{size:"sm",variant:((et=$[x])==null?void 0:et.align)==="center"?"primary":"ghost",onClick:()=>X(x,{align:"center"}),title:C("docEditor.alignCenter","Center"),children:"⬌"}),a.jsx(me,{size:"sm",variant:((st=$[x])==null?void 0:st.align)==="right"?"primary":"ghost",onClick:()=>X(x,{align:"right"}),title:C("docEditor.alignRight","Right"),children:"➡"}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>{var q;return X(x,{indent:Math.min((((q=$[x])==null?void 0:q.indent)??0)+1,4)})},title:C("docEditor.indent","Indent (Tab)"),children:"→⊞"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>{var q;return X(x,{indent:Math.max((((q=$[x])==null?void 0:q.indent)??0)-1,0)})},title:C("docEditor.outdent","Outdent (Shift+Tab)"),children:"←⊞"}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(rt,{size:"sm",label:"",value:((He=$[x])==null?void 0:He.color)??"#000000",onChange:q=>X(x,{color:q}),title:"Text color"}),a.jsx(rt,{size:"sm",label:"",value:((gt=$[x])==null?void 0:gt.bgColor)??"#ffffff",onChange:q=>X(x,{bgColor:q}),title:"Block background"}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(me,{size:"sm",variant:(Ct=$[x])!=null&&Ct.locked?"primary":"ghost",onClick:()=>{var q;return X(x,{locked:!((q=$[x])!=null&&q.locked)})},title:C("docEditor.lock","Lock/Unlock block"),children:"🔒"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>fe(x),title:C("docEditor.duplicate","Duplicate (Ctrl+D)"),children:"⧉"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>Se(x),title:C("docEditor.delete","Delete block"),children:"🗑"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>Q(x),title:C("docEditor.addBlock","Add block"),children:"+"}),h&&a.jsx(me,{size:"sm",variant:A?"primary":"ghost",onClick:()=>E(q=>!q),title:C("docEditor.find","Find & Replace (Ctrl+F)"),children:"🔍"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>O(q=>!q),title:C("docEditor.shortcuts","Keyboard shortcuts"),children:"⌨"}),l&&a.jsx(me,{size:"sm",variant:"ghost",onClick:le,children:C("docEditor.export","Export HTML")})]}),a.jsx("input",{ref:P,type:"file",accept:"image/*,video/*",style:{display:"none"},onChange:ae}),A&&a.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:[a.jsx(pt,{size:"sm",placeholder:C("docEditor.findPlaceholder","Find..."),value:M,onChange:W,style:{flex:1,maxWidth:200}}),a.jsx(pt,{size:"sm",placeholder:C("docEditor.replacePlaceholder","Replace..."),value:z,onChange:T,style:{flex:1,maxWidth:200}}),a.jsx(me,{size:"sm",variant:"ghost",onClick:it,title:C("docEditor.findPrev","Previous"),children:"◀"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:Ye,title:C("docEditor.findNext","Next"),children:"▶"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:_t,title:C("docEditor.replaceOne","Replace"),disabled:r,children:C("docEditor.replace","Replace")}),a.jsx(me,{size:"sm",variant:"ghost",onClick:ht,title:C("docEditor.replaceAll","Replace all"),disabled:r,children:C("docEditor.replaceAllBtn","All")}),a.jsx("span",{style:{fontSize:"0.75em",color:"#666"},children:g.length>0?`${S+1}/${g.length}`:"0/0"}),a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>E(!1),children:"✕"})]}),L&&a.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:()=>O(!1),children:a.jsxs("div",{style:{background:"#fff",borderRadius:8,padding:24,maxWidth:420,width:"90%",boxShadow:"0 8px 32px rgba(0,0,0,.2)"},onClick:q=>q.stopPropagation(),children:[a.jsx("h3",{style:{margin:"0 0 12px"},children:C("docEditor.shortcutsTitle","Keyboard Shortcuts")}),a.jsx("table",{style:{width:"100%",fontSize:"0.875em",borderCollapse:"collapse"},children:a.jsx("tbody",{children:[["Ctrl+B",C("docEditor.bold","Bold")],["Ctrl+I",C("docEditor.italic","Italic")],["Ctrl+U",C("docEditor.underline","Underline")],["Ctrl+E",C("docEditor.strikethrough","Strikethrough")],["Ctrl+D",C("docEditor.duplicate","Duplicate block")],["Ctrl+Z",C("docEditor.undo","Undo")],["Ctrl+Y",C("docEditor.redo","Redo")],["Ctrl+F",C("docEditor.find","Find & Replace")],["Enter",C("docEditor.newBlock","New block")],["Backspace",C("docEditor.deleteEmpty","Delete empty block")],["Alt+↑",C("docEditor.moveUp","Move block up")],["Alt+↓",C("docEditor.moveDown","Move block down")],["Tab",C("docEditor.indent","Indent")],["Shift+Tab",C("docEditor.outdent","Outdent")],["/",C("docEditor.slashCmd","Slash commands")]].map(([q,te])=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsx("td",{style:{padding:"4px 8px",fontFamily:"monospace",fontWeight:600},children:q}),a.jsx("td",{style:{padding:"4px 8px"},children:te})]},q))})}),a.jsx("div",{style:{textAlign:"right",marginTop:12},children:a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>O(!1),children:C("docEditor.close","Close")})})]})}),a.jsxs("div",{style:{display:"flex",gap:0},children:[y&&H.length>0&&a.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:[a.jsx("div",{style:{fontWeight:600,padding:"4px 8px",fontSize:"0.75em",textTransform:"uppercase",color:"#999"},children:C("docEditor.toc","Contents")}),H.map(q=>a.jsx("div",{style:{padding:"3px 8px",paddingLeft:8+(q.level-1)*12,cursor:"pointer",borderRadius:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",background:q.idx===x?"#e8f0fe":void 0},onClick:()=>F(q.idx),title:q.text,children:q.text||C("docEditor.untitled","Untitled")},q.idx))]}),a.jsx("div",{className:"nice-doc-editor__body",style:{flex:1},children:$.map((q,te)=>a.jsxs("div",{className:`nice-doc-editor__block nice-doc-editor__block--${q.type} ${te===x?"nice-doc-editor__block--focused":""} ${Ne===te?"nice-doc-editor__block--drop-target":""} ${q.locked?"nice-doc-editor__block--locked":""}`,onClick:()=>F(te),onContextMenu:re=>V(re,te),draggable:!r&&!q.locked,onDragStart:re=>ze(re,te),onDragOver:re=>Fe(re,te),onDrop:re=>Ge(re,te),onDragEnd:()=>{$e(null),U(null)},style:{opacity:xe===te?.4:1,marginLeft:(q.indent??0)*24},children:[!r&&!q.locked&&a.jsx("div",{className:"nice-doc-editor__block-handle",title:C("docEditor.drag","Drag to reorder"),children:"⠿"}),q.locked&&a.jsx("span",{className:"nice-doc-editor__lock-icon",style:{position:"absolute",top:2,right:4,fontSize:"0.7em",opacity:.5},children:"🔒"}),q.type==="divider"?a.jsx("hr",{className:"nice-doc-editor__divider"}):q.type==="pageBreak"?a.jsxs("div",{className:"nice-doc-editor__page-break",style:{borderTop:"2px dashed #ccc",textAlign:"center",padding:4,fontSize:"0.75em",color:"#999"},children:["— ",C("docEditor.pageBreak","Page Break")," —"]}):q.type==="image"||q.type==="video"?a.jsx("div",{className:"nice-doc-editor__media-block",children:q.src?q.type==="image"?a.jsx("img",{src:q.src,alt:q.alt??"",className:"nice-doc-editor__image",style:{maxWidth:"100%"}}):a.jsx("video",{src:q.src,controls:!0,className:"nice-doc-editor__video",style:{maxWidth:"100%"}}):!r&&a.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[a.jsx(pt,{size:"sm",placeholder:C("docEditor.mediaUrl",q.type==="image"?"Image URL":"Video URL"),value:q.src??"",onChange:re=>X(te,{src:re})}),d&&a.jsx(me,{size:"sm",variant:"ghost",onClick:()=>{var re;F(te),(re=P.current)==null||re.click()},children:"📎"})]})}):q.type==="callout"?a.jsxs("div",{className:"nice-doc-editor__callout",style:{display:"flex",gap:8,padding:"8px 12px",background:q.bgColor??"#f0f7ff",borderRadius:4,color:q.color},children:[a.jsx("span",{style:{fontSize:"1.2em"},children:q.icon??"ℹ️"}),a.jsx("div",{ref:re=>{re&&I.current.set(q.id,re)},className:"nice-doc-editor__content",contentEditable:!r&&!q.locked,suppressContentEditableWarning:!0,onInput:re=>Ae(re,te),onFocus:()=>F(te),onKeyDown:re=>oe(re,te),"data-placeholder":C("docEditor.calloutPlaceholder","Callout text..."),role:"textbox","aria-multiline":"true",style:{flex:1,outline:"none"},children:q.content})]}):q.type==="toggle"?a.jsxs("details",{open:q.open,className:"nice-doc-editor__toggle",onToggle:re=>X(te,{open:re.target.open}),children:[a.jsx("summary",{style:{cursor:"pointer",fontWeight:500},children:q.content.split(`
|
|
712
|
+
`)[0]||C("docEditor.toggleTitle","Toggle")}),a.jsx("div",{ref:re=>{re&&I.current.set(q.id,re)},className:"nice-doc-editor__content",contentEditable:!r&&!q.locked,suppressContentEditableWarning:!0,onInput:re=>Ae(re,te),onFocus:()=>F(te),onKeyDown:re=>oe(re,te),role:"textbox","aria-multiline":"true",style:{padding:"4px 0"},children:q.content.split(`
|
|
713
|
+
`).slice(1).join(`
|
|
714
|
+
`)})]}):q.type==="code"?a.jsxs("div",{className:"nice-doc-editor__code-block",style:{position:"relative"},children:[!r&&a.jsx(pt,{size:"sm",value:q.language??"",onChange:re=>X(te,{language:re}),placeholder:"Language",style:{position:"absolute",top:4,right:4,width:80,opacity:.7}}),a.jsx("pre",{ref:re=>{re&&I.current.set(q.id,re)},className:"nice-doc-editor__content",contentEditable:!r&&!q.locked,suppressContentEditableWarning:!0,onInput:re=>Ae(re,te),onFocus:()=>F(te),onKeyDown:re=>oe(re,te),role:"textbox","aria-multiline":"true",style:{fontFamily:"monospace",background:"#1e1e1e",color:"#d4d4d4",padding:12,borderRadius:4,overflow:"auto"},children:q.content})]}):a.jsxs("div",{style:{position:"relative"},children:[a.jsx("div",{ref:re=>{re&&I.current.set(q.id,re)},className:"nice-doc-editor__content",contentEditable:!r&&!q.locked,suppressContentEditableWarning:!0,style:{textAlign:q.align,fontWeight:q.bold?"bold":void 0,fontStyle:q.italic?"italic":void 0,textDecoration:[q.underline?"underline":"",q.strikethrough?"line-through":""].filter(Boolean).join(" ")||void 0,color:q.color,backgroundColor:q.bgColor},onInput:re=>Ae(re,te),onFocus:()=>F(te),onKeyDown:re=>oe(re,te),"data-placeholder":!q.content&&c?c:void 0,role:"textbox","aria-multiline":"true",children:q.content}),he&&te===x&&de.length>0&&a.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:de.map((re,Re)=>a.jsxs("li",{className:Re===Ce?"nice-doc-editor__slash-item--active":"",style:{padding:"6px 10px",cursor:"pointer",borderRadius:4,display:"flex",gap:8,alignItems:"center",background:Re===Ce?"#e8f0fe":void 0},onMouseDown:Ue=>{Ue.preventDefault(),je(re)},onMouseEnter:()=>ee(Re),children:[a.jsx("span",{style:{width:24,textAlign:"center"},children:re.icon}),a.jsx("span",{children:re.label})]},`${re.type}-${re.label}`))})]})]},q.id))})]}),ye&&a.jsxs("div",{className:"nice-doc-editor__ctx-menu",style:{position:"fixed",left:ye.x,top:ye.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:[a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{fe(ye.idx),ne(null)},children:"⧉ Duplicate"}),a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{Q(ye.idx),ne(null)},children:"+ Insert below"}),a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{be(ye.idx,-1),ne(null)},children:"↑ Move up"}),a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{be(ye.idx,1),ne(null)},children:"↓ Move down"}),a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{var q;X(ye.idx,{locked:!((q=$[ye.idx])!=null&&q.locked)}),ne(null)},children:(Et=$[ye.idx])!=null&&Et.locked?"🔓 Unlock":"🔒 Lock"}),a.jsx("hr",{style:{margin:"2px 0",border:"none",borderTop:"1px solid #eee"}}),a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer",color:"#d32f2f"},onClick:()=>{Se(ye.idx),ne(null)},children:"🗑 Delete"})]}),u&&ce&&a.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:[a.jsxs("span",{children:[ce.words," ",C("docEditor.words","words")]}),a.jsxs("span",{children:[ce.chars," ",C("docEditor.chars","characters")]}),a.jsxs("span",{children:[$.length," ",C("docEditor.blocks","blocks")]}),a.jsxs("span",{children:["~",ce.readingTime," ",C("docEditor.readingTime","min read")]})]})]})});nr.displayName="NiceDocumentEditor";const Su=["street","streetNumber","apartment","city","postalCode","state","country"],Zt={street:"Street",streetNumber:"Number",apartment:"Apt/Suite",city:"City",postalCode:"Postal Code",state:"State/Province",country:"Country"},Hi=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,value:y={},onChange:h,fields:m=Su,placeholders:v={},countries:D,layout:w="vertical",countryFirst:k=!1,validatePostalCode:b},C)=>{const j=Le(u,d);if(j==="hidden")return null;j==="disabled"&&(n=!0),j==="readOnly"&&(o=!0);const{t:N}=De(),$=Ee(d),x=s.useCallback((A,E)=>{h==null||h({...y,[A]:E})},[y,h]),F=s.useMemo(()=>{if(b&&y.postalCode)return b(y.postalCode,y.country)},[b,y.postalCode,y.country]),I=s.useMemo(()=>k&&m.includes("country")?["country",...m.filter(A=>A!=="country")]:m,[m,k]),P=`nice-address nice-address--${w} nice-size-${c}`;return a.jsxs("div",{ref:C,id:$,className:`${P}${p?` ${p}`:""}${r?" nice-error":""}${n?" nice-disabled":""}`,style:f,role:"group","aria-label":t??N("address","Address"),children:[t&&a.jsxs("label",{className:"nice-address__label",children:[t,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsx("div",{className:"nice-address__fields",children:I.map(A=>A==="country"&&D?a.jsxs("div",{className:`nice-address__field nice-address__field--${A}`,children:[a.jsx("label",{className:"nice-address__field-label",children:N(A,Zt[A])}),a.jsxs("select",{className:"nice-input nice-select",value:y.country??"",onChange:E=>x("country",E.target.value),disabled:n,"aria-label":N(A,Zt[A]),children:[a.jsx("option",{value:"",children:v.country??N("selectCountry","— Select country —")}),D.map(E=>a.jsx("option",{value:E.code,children:E.name},E.code))]})]},A):a.jsxs("div",{className:`nice-address__field nice-address__field--${A}`,children:[a.jsx("label",{className:"nice-address__field-label",children:N(A,Zt[A])}),a.jsx("input",{className:`nice-input${A==="postalCode"&&F?" nice-input--error":""}`,type:"text",name:l?`${l}.${A}`:A,value:y[A]??"",onChange:E=>x(A,E.target.value),placeholder:v[A]??"",disabled:n,readOnly:o,"aria-label":N(A,Zt[A])}),A==="postalCode"&&F&&a.jsx("span",{className:"nice-error-text",children:F})]},A))}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),r&&typeof r=="string"&&a.jsx("span",{className:"nice-error-text",children:r})]})});Hi.displayName="NiceAddressInput";const ju=[{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:"### ### ###"}],Rr=127397;function Nu(t){return String.fromCodePoint(t.charCodeAt(0)+Rr,t.charCodeAt(1)+Rr)}function Mu(t,e){if(!e)return t;const r=t.replace(/\D/g,"");let i="",n=0;for(let o=0;o<e.length&&n<r.length;o++)e[o]==="#"?i+=r[n++]:i+=e[o];return i}function ya(t,e){return`${t}${e.replace(/\D/g,"")}`}const Wi=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,value:y={},onChange:h,onBlur:m,countryCodes:v=ju,defaultCountry:D="PL",placeholder:w,showFlag:k=!0,validateE164:b=!1},C)=>{var z;const j=Le(u,d);if(j==="hidden")return null;j==="disabled"&&(n=!0),j==="readOnly"&&(o=!0);const{t:N}=De(),$=Ee(d),x=s.useMemo(()=>{const T=y.countryCode??D;return v.find(g=>g.code===T)??v[0]},[y.countryCode,D,v]),[F,I]=s.useState(),P=s.useMemo(()=>Mu(y.number??"",x==null?void 0:x.mask),[y.number,x]),A=s.useCallback(T=>{const g=v.find(S=>S.code===T);if(!g)return;const _=y.number??"";h==null||h({countryCode:g.code,dialCode:g.dialCode,number:_,e164:ya(g.dialCode,_)})},[v,y.number,h]),E=s.useCallback(T=>{const g=T.replace(/\D/g,""),_=x;h==null||h({countryCode:_==null?void 0:_.code,dialCode:_==null?void 0:_.dialCode,number:g,e164:_?ya(_.dialCode,g):g}),I(void 0)},[x,h]),M=s.useCallback(T=>{if(b&&y.number){const g=ya((x==null?void 0:x.dialCode)??"",y.number);/^\+\d{7,15}$/.test(g)||I(N("invalidPhone","Invalid phone number"))}m==null||m(T)},[b,y.number,x,m,N]),W=r||F;return a.jsxs("div",{ref:C,id:$,className:`nice-phone nice-size-${c}${p?` ${p}`:""}${W?" nice-error":""}${n?" nice-disabled":""}`,style:f,children:[t&&a.jsxs("label",{className:"nice-phone__label",children:[t,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("div",{className:"nice-phone__row",children:[a.jsx("select",{className:"nice-phone__country nice-select",value:x==null?void 0:x.code,onChange:T=>A(T.target.value),disabled:n,"aria-label":N("countryCode","Country code"),children:v.map(T=>a.jsxs("option",{value:T.code,children:[k?`${Nu(T.code)} `:"",T.dialCode," ",T.name]},T.code))}),a.jsx("input",{className:"nice-input nice-phone__number",type:"tel",name:l,value:P,onChange:T=>E(T.target.value),onBlur:M,placeholder:w??((z=x==null?void 0:x.mask)==null?void 0:z.replace(/#/g,"_"))??"",disabled:n,readOnly:o,"aria-label":N("phoneNumber","Phone number")})]}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),W&&typeof W=="string"&&a.jsx("span",{className:"nice-error-text",children:W})]})});Wi.displayName="NicePhoneInput";const zu=[{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"}],Bi=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,value:y,onChange:h,onBlur:m,currency:v="PLN",onCurrencyChange:D,currencies:w=zu,useMinorUnit:k=!1,min:b,max:C,locale:j,placeholder:N,showCurrencySelector:$},x)=>{const F=Le(u,d);if(F==="hidden")return null;F==="disabled"&&(n=!0),F==="readOnly"&&(o=!0);const{t:I}=De(),P=Ee(d),A=s.useMemo(()=>w.find(g=>g.code===v)??w[0],[v,w]),E=(A==null?void 0:A.decimals)??2,M=s.useMemo(()=>y==null?"":(k?y/Math.pow(10,E):y).toFixed(E),[y,k,E]),W=s.useCallback(g=>{const _=g.replace(/[^\d.,\-]/g,"").replace(",",".");if(_===""||_==="-"){h==null||h(null);return}const S=parseFloat(_);if(isNaN(S))return;const R=k?Math.round(S*Math.pow(10,E)):S;b!=null&&R<b||C!=null&&R>C||(h==null||h(R))},[h,k,E,b,C]),z=$??w.length>1,T=s.useMemo(()=>{if(y==null)return"";const g=k?y/Math.pow(10,E):y;try{return new Intl.NumberFormat(j,{style:"currency",currency:(A==null?void 0:A.code)??"USD",minimumFractionDigits:E}).format(g)}catch{return`${g.toFixed(E)} ${A==null?void 0:A.code}`}},[y,k,E,j,A]);return a.jsxs("div",{ref:x,id:P,className:`nice-currency nice-size-${c}${p?` ${p}`:""}${r?" nice-error":""}${n?" nice-disabled":""}`,style:f,children:[t&&a.jsxs("label",{className:"nice-currency__label",children:[t,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("div",{className:"nice-currency__row",children:[z&&a.jsx("select",{className:"nice-currency__select nice-select",value:v,onChange:g=>D==null?void 0:D(g.target.value),disabled:n,"aria-label":I("currency","Currency"),children:w.map(g=>a.jsxs("option",{value:g.code,children:[g.symbol," ",g.code]},g.code))}),!z&&a.jsx("span",{className:"nice-currency__symbol",children:A==null?void 0:A.symbol}),a.jsx("input",{className:"nice-input nice-currency__amount",type:"text",inputMode:"decimal",name:l,value:M,onChange:g=>W(g.target.value),onBlur:m,placeholder:N??`0.${"0".repeat(E)}`,disabled:n,readOnly:o,"aria-label":I("amount","Amount")})]}),T&&y!=null&&a.jsx("span",{className:"nice-currency__formatted",children:T}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),r&&typeof r=="string"&&a.jsx("span",{className:"nice-error-text",children:r})]})});Bi.displayName="NiceCurrencyInput";let $u=1;function Eu(t){return{id:`new-${$u++}`,description:"",quantity:1,unitPrice:0,vatRate:t,discount:0,unit:"szt."}}function qi(t){const e=t.quantity*t.unitPrice*(1-(t.discount??0)/100),r=Math.round(e*100)/100,i=Math.round(r*(t.vatRate??0)/100*100)/100;return{...t,netAmount:r,grossAmount:r+i}}function Au(t){const e=t.map(qi),r=e.reduce((l,d)=>l+(d.netAmount??0),0),i=e.reduce((l,d)=>l+(d.grossAmount??0),0),n=i-r,o=new Map;for(const l of e){const d=l.vatRate??0,p=o.get(d)??{base:0,amount:0};p.base+=l.netAmount??0,p.amount+=(l.grossAmount??0)-(l.netAmount??0),o.set(d,p)}const c=Array.from(o.entries()).map(([l,d])=>({rate:l,base:Math.round(d.base*100)/100,amount:Math.round(d.amount*100)/100}));return{totalNet:Math.round(r*100)/100,totalVat:Math.round(n*100)/100,totalGross:Math.round(i*100)/100,vatBreakdown:c}}const Vi=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,value:y=[],onChange:h,onTotalsChange:m,currencySymbol:v="zł",defaultVatRate:D=23,vatRates:w=[0,5,8,23],units:k=["szt.","h","kg","m","usł."],showDiscount:b=!0,showUnit:C=!0,showTotals:j=!0,editable:N=!0,maxLines:$},x)=>{const F=Le(u,d);if(F==="hidden")return null;F==="disabled"&&(n=!0),F==="readOnly"&&(o=!0);const{t:I}=De(),P=Ee(d),A=s.useMemo(()=>y.map(qi),[y]),E=s.useMemo(()=>Au(y),[y]);s.useEffect(()=>{m==null||m(E)},[E,m]);const M=s.useCallback((g,_,S)=>{const R=[...y];R[g]={...R[g],[_]:S},h==null||h(R)},[y,h]),W=s.useCallback(()=>{$&&y.length>=$||(h==null||h([...y,Eu(D)]))},[y,h,D,$]),z=s.useCallback(g=>{h==null||h(y.filter((_,S)=>S!==g))},[y,h]),T=g=>`${g.toFixed(2)} ${v}`;return a.jsxs("div",{ref:x,id:P,className:`nice-invoice-lines nice-size-${c}${p?` ${p}`:""}${r?" nice-error":""}${n?" nice-disabled":""}`,style:f,children:[t&&a.jsxs("label",{className:"nice-invoice-lines__label",children:[t,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("table",{className:"nice-invoice-lines__table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"nice-il__th-num",children:"#"}),a.jsx("th",{className:"nice-il__th-desc",children:I("description","Description")}),a.jsx("th",{className:"nice-il__th-qty",children:I("qty","Qty")}),C&&a.jsx("th",{className:"nice-il__th-unit",children:I("unit","Unit")}),a.jsx("th",{className:"nice-il__th-price",children:I("unitPrice","Unit Price")}),b&&a.jsx("th",{className:"nice-il__th-disc",children:I("discount","Disc %")}),a.jsx("th",{className:"nice-il__th-vat",children:I("vat","VAT %")}),a.jsx("th",{className:"nice-il__th-net",children:I("net","Net")}),a.jsx("th",{className:"nice-il__th-gross",children:I("gross","Gross")}),N&&!o&&a.jsx("th",{className:"nice-il__th-actions"})]})}),a.jsx("tbody",{children:A.map((g,_)=>a.jsxs("tr",{children:[a.jsx("td",{className:"nice-il__cell-num",children:_+1}),a.jsx("td",{className:"nice-il__cell-desc",children:a.jsx("input",{className:"nice-input",type:"text",value:g.description,onChange:S=>M(_,"description",S.target.value),disabled:n,readOnly:o,placeholder:I("itemDescription","Item description")})}),a.jsx("td",{className:"nice-il__cell-qty",children:a.jsx("input",{className:"nice-input",type:"number",value:g.quantity,onChange:S=>M(_,"quantity",parseFloat(S.target.value)||0),disabled:n,readOnly:o,min:0,step:"any"})}),C&&a.jsx("td",{className:"nice-il__cell-unit",children:a.jsx("select",{className:"nice-select",value:g.unit??"",onChange:S=>M(_,"unit",S.target.value),disabled:n,children:k.map(S=>a.jsx("option",{value:S,children:S},S))})}),a.jsx("td",{className:"nice-il__cell-price",children:a.jsx("input",{className:"nice-input",type:"number",value:g.unitPrice,onChange:S=>M(_,"unitPrice",parseFloat(S.target.value)||0),disabled:n,readOnly:o,min:0,step:"0.01"})}),b&&a.jsx("td",{className:"nice-il__cell-disc",children:a.jsx("input",{className:"nice-input",type:"number",value:g.discount??0,onChange:S=>M(_,"discount",parseFloat(S.target.value)||0),disabled:n,readOnly:o,min:0,max:100})}),a.jsx("td",{className:"nice-il__cell-vat",children:a.jsx("select",{className:"nice-select",value:g.vatRate??0,onChange:S=>M(_,"vatRate",parseInt(S.target.value,10)),disabled:n,children:w.map(S=>a.jsxs("option",{value:S,children:[S,"%"]},S))})}),a.jsx("td",{className:"nice-il__cell-net",children:T(g.netAmount??0)}),a.jsx("td",{className:"nice-il__cell-gross",children:T(g.grossAmount??0)}),N&&!o&&a.jsx("td",{className:"nice-il__cell-actions",children:a.jsx("button",{type:"button",className:"nice-btn nice-btn--icon nice-btn--sm",onClick:()=>z(_),disabled:n,title:I("remove","Remove"),children:"✕"})})]},g.id))})]}),N&&!o&&a.jsxs("button",{type:"button",className:"nice-btn nice-btn--outlined nice-btn--sm nice-invoice-lines__add",onClick:W,disabled:n||$!=null&&y.length>=$,children:["+ ",I("addLine","Add line")]}),j&&a.jsxs("div",{className:"nice-invoice-lines__totals",children:[a.jsxs("div",{className:"nice-il__total-row",children:[a.jsxs("span",{children:[I("totalNet","Net total"),":"]}),a.jsx("span",{className:"nice-il__total-value",children:T(E.totalNet)})]}),E.vatBreakdown.map(g=>a.jsxs("div",{className:"nice-il__total-row nice-il__total-row--vat",children:[a.jsxs("span",{children:["VAT ",g.rate,"%:"]}),a.jsx("span",{className:"nice-il__total-value",children:T(g.amount)})]},g.rate)),a.jsxs("div",{className:"nice-il__total-row nice-il__total-row--gross",children:[a.jsxs("span",{children:[I("totalGross","Gross total"),":"]}),a.jsx("span",{className:"nice-il__total-value nice-il__total-value--gross",children:T(E.totalGross)})]})]}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),r&&typeof r=="string"&&a.jsx("span",{className:"nice-error-text",children:r})]})});Vi.displayName="NiceInvoiceLineEditor";const Ki=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,value:y=[],onChange:h,contacts:m=[],onSearch:v,searchDelay:D=300,multiple:w=!1,placeholder:k,onContactClick:b,maxSelections:C},j)=>{const N=Le(u,d);if(N==="hidden")return null;N==="disabled"&&(n=!0),N==="readOnly"&&(o=!0);const{t:$}=De(),x=Ee(d),[F,I]=s.useState(""),[P,A]=s.useState([]),[E,M]=s.useState(!1),[W,z]=s.useState(!1),T=s.useMemo(()=>{const R=[...m,...P],L=new Map(R.map(O=>[O.id,O]));return y.map(O=>L.get(O)).filter(Boolean)},[y,m,P]),g=s.useCallback(R=>{if(I(R),R.length<1){A([]),M(!1);return}if(v){z(!0);const Y=setTimeout(async()=>{const G=await v(R);A(G),M(!0),z(!1)},D);return()=>clearTimeout(Y)}const L=R.toLowerCase(),O=m.filter(Y=>{var G,B;return Y.name.toLowerCase().includes(L)||((G=Y.email)==null?void 0:G.toLowerCase().includes(L))||((B=Y.phone)==null?void 0:B.includes(R))});A(O),M(!0)},[v,m,D]),_=s.useCallback(R=>{if(w)if(y.includes(R.id))h==null||h(y.filter(L=>L!==R.id));else{if(C&&y.length>=C)return;h==null||h([...y,R.id])}else h==null||h([R.id]),M(!1),I("")},[y,h,w,C]),S=s.useCallback(R=>{h==null||h(y.filter(L=>L!==R))},[y,h]);return a.jsxs("div",{ref:j,id:x,className:`nice-contact-picker nice-size-${c}${p?` ${p}`:""}${r?" nice-error":""}${n?" nice-disabled":""}`,style:f,children:[t&&a.jsxs("label",{className:"nice-contact-picker__label",children:[t,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),T.length>0&&a.jsx("div",{className:"nice-contact-picker__chips",children:T.map(R=>a.jsxs("span",{className:"nice-contact-picker__chip",onClick:()=>b==null?void 0:b(R),children:[R.avatarUrl&&a.jsx("img",{src:R.avatarUrl,alt:"",className:"nice-contact-picker__chip-avatar"}),a.jsx("span",{children:R.name}),!o&&a.jsx("button",{type:"button",className:"nice-contact-picker__chip-remove",onClick:L=>{L.stopPropagation(),S(R.id)},disabled:n,children:"×"})]},R.id))}),!o&&a.jsxs("div",{className:"nice-contact-picker__search",children:[a.jsx("input",{className:"nice-input",type:"text",value:F,onChange:R=>g(R.target.value),onFocus:()=>F.length>0&&M(!0),onBlur:()=>setTimeout(()=>M(!1),200),placeholder:k??$("searchContacts","Search contacts…"),disabled:n,"aria-label":$("searchContacts","Search contacts")}),W&&a.jsx("span",{className:"nice-contact-picker__spinner",children:"⏳"})]}),E&&P.length>0&&a.jsx("div",{className:"nice-contact-picker__dropdown",role:"listbox",children:P.map(R=>a.jsxs("div",{className:`nice-contact-picker__option${y.includes(R.id)?" nice-contact-picker__option--selected":""}`,role:"option","aria-selected":y.includes(R.id),onClick:()=>_(R),children:[R.avatarUrl&&a.jsx("img",{src:R.avatarUrl,alt:"",className:"nice-contact-picker__option-avatar"}),a.jsxs("div",{className:"nice-contact-picker__option-info",children:[a.jsx("span",{className:"nice-contact-picker__option-name",children:R.name}),R.subtitle&&a.jsx("span",{className:"nice-contact-picker__option-subtitle",children:R.subtitle}),R.email&&a.jsx("span",{className:"nice-contact-picker__option-email",children:R.email})]}),R.type&&a.jsx("span",{className:"nice-contact-picker__option-type",children:R.type==="person"?"👤":"🏢"})]},R.id))}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),r&&typeof r=="string"&&a.jsx("span",{className:"nice-error-text",children:r})]})});Ki.displayName="NiceContactPicker";const Du=["highlight","underline","strikethrough","freehand","text","rect","arrow"],Tu={highlight:"🖍️",underline:"⎁",strikethrough:"S̶",freehand:"✏️",text:"T",rect:"▭",arrow:"→",stamp:"🔏"},Gi=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",id:l,className:d,style:p,accessMode:f,src:u,annotations:y=[],onAnnotationsChange:h,activeTool:m,onToolChange:v,currentPage:D=1,onPageChange:w,totalPages:k=1,defaultColor:b="#FFFF00",tools:C=Du,author:j,zoom:N=1,onZoomChange:$,onAnnotationClick:x,onAnnotationDelete:F},I)=>{const P=Le(f,l);if(P==="hidden")return null;P==="disabled"&&(n=!0),P==="readOnly"&&(o=!0);const{t:A}=De(),E=Ee(l),M=y.filter(T=>T.page===D),W=s.useCallback(T=>{v==null||v(m===T?null:T)},[m,v]),z=s.useCallback(T=>{if(o||!m||m==="freehand")return;const g=T.currentTarget.getBoundingClientRect(),_=(T.clientX-g.left)/g.width,S=(T.clientY-g.top)/g.height,R={id:`ann-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,tool:m,page:D,x:_,y:S,color:b,author:j,createdAt:new Date().toISOString(),text:m==="text"?"":void 0};h==null||h([...y,R])},[o,m,D,b,j,y,h]);return a.jsxs("div",{ref:I,id:E,className:`nice-pdf-annotation nice-size-${c}${d?` ${d}`:""}${r?" nice-error":""}${n?" nice-disabled":""}`,style:p,children:[t&&a.jsxs("div",{className:"nice-pdf-annotation__label",children:[t,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),!o&&a.jsxs("div",{className:"nice-pdf-annotation__toolbar",children:[C.map(T=>a.jsx("button",{type:"button",className:`nice-pdf-annotation__tool-btn${m===T?" nice-pdf-annotation__tool-btn--active":""}`,onClick:()=>W(T),disabled:n,title:A(`pdfTool_${T}`,T),children:Tu[T]},T)),a.jsx("span",{className:"nice-pdf-annotation__toolbar-sep"}),a.jsx("button",{type:"button",disabled:n,onClick:()=>$==null?void 0:$(Math.max(.25,N-.25)),title:A("zoomOut","Zoom out"),children:"−"}),a.jsxs("span",{className:"nice-pdf-annotation__zoom",children:[Math.round(N*100),"%"]}),a.jsx("button",{type:"button",disabled:n,onClick:()=>$==null?void 0:$(Math.min(4,N+.25)),title:A("zoomIn","Zoom in"),children:"+"})]}),a.jsxs("div",{className:"nice-pdf-annotation__viewport",style:{transform:`scale(${N})`,transformOrigin:"top left"},children:[a.jsx("iframe",{src:u,className:"nice-pdf-annotation__frame",title:A("pdfViewer","PDF Viewer")}),a.jsx("div",{className:"nice-pdf-annotation__layer",onClick:z,children:M.map(T=>a.jsxs("div",{className:`nice-pdf-annotation__mark nice-pdf-annotation__mark--${T.tool}`,style:{left:`${T.x*100}%`,top:`${T.y*100}%`,backgroundColor:T.color},onClick:g=>{g.stopPropagation(),x==null||x(T)},title:T.text??T.tool,children:[T.text&&a.jsx("span",{children:T.text}),!o&&a.jsx("button",{type:"button",className:"nice-pdf-annotation__mark-delete",onClick:g=>{g.stopPropagation(),F==null||F(T.id)},children:"×"})]},T.id))})]}),a.jsxs("div",{className:"nice-pdf-annotation__pager",children:[a.jsx("button",{type:"button",disabled:n||D<=1,onClick:()=>w==null?void 0:w(D-1),children:"◀"}),a.jsx("span",{children:A("pageOf","{page} / {total}").replace("{page}",String(D)).replace("{total}",String(k))}),a.jsx("button",{type:"button",disabled:n||D>=k,onClick:()=>w==null?void 0:w(D+1),children:"▶"})]}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),r&&typeof r=="string"&&a.jsx("span",{className:"nice-error-text",children:r})]})});Gi.displayName="NicePDFAnnotationEditor";const Yi=s.forwardRef(({label:t,helperText:e,error:r,disabled:i,readOnly:n,size:o="md",id:c,className:l,style:d,accessMode:p,pages:f,selectedPageId:u,content:y="",contentFormat:h="html",editing:m=!1,onPageSelect:v,onContentChange:D,onSave:w,onCreatePage:k,onDeletePage:b,onEditToggle:C,onVersionHistory:j,sidebarWidth:N=260,sidebarCollapsed:$=!1,onSidebarToggle:x,searchable:F=!0,onSearch:I},P)=>{const A=Le(p,c);if(A==="hidden")return null;A==="disabled"&&(i=!0),A==="readOnly"&&(n=!0);const{t:E}=De(),M=Ee(c),[W,z]=s.useState(""),[T,g]=s.useState(""),[_,S]=s.useState(!1),R=s.useMemo(()=>{const G=B=>{for(const K of B){if(K.id===u)return K;if(K.children){const J=G(K.children);if(J)return J}}};return G(f)},[f,u]),L=s.useCallback(G=>{z(G),I==null||I(G)},[I]),O=s.useCallback(()=>{T.trim()&&(k==null||k(u??null,T.trim()),g(""),S(!1))},[T,u,k]),Y=(G,B=0)=>a.jsx("ul",{className:"nice-wiki__tree",style:{paddingLeft:B>0?16:0},children:G.map(K=>{var J;return a.jsxs("li",{className:"nice-wiki__tree-item",children:[a.jsxs("div",{className:`nice-wiki__tree-node${K.id===u?" nice-wiki__tree-node--active":""}${K.isDraft?" nice-wiki__tree-node--draft":""}`,onClick:()=>v==null?void 0:v(K),role:"treeitem","aria-selected":K.id===u,children:[a.jsx("span",{className:"nice-wiki__tree-icon",children:(J=K.children)!=null&&J.length?"📁":"📄"}),a.jsx("span",{className:"nice-wiki__tree-title",children:K.title}),K.isDraft&&a.jsx("span",{className:"nice-wiki__tree-draft",children:E("draft","Draft")})]}),K.children&&K.children.length>0&&Y(K.children,B+1)]},K.id)})});return a.jsxs("div",{ref:P,id:M,className:`nice-wiki nice-size-${o}${l?` ${l}`:""}${i?" nice-disabled":""}`,style:d,children:[!$&&a.jsxs("aside",{className:"nice-wiki__sidebar",style:{width:N},children:[a.jsxs("div",{className:"nice-wiki__sidebar-header",children:[a.jsx("span",{className:"nice-wiki__sidebar-title",children:t??E("wiki","Wiki")}),x&&a.jsx("button",{type:"button",className:"nice-wiki__sidebar-toggle",onClick:()=>x(!0),children:"«"})]}),F&&a.jsx("input",{type:"text",className:"nice-input nice-wiki__search",value:W,onChange:G=>L(G.target.value),placeholder:E("searchPages","Search pages…"),disabled:i}),a.jsx("div",{className:"nice-wiki__page-tree",role:"tree",children:Y(f)}),k&&!n&&a.jsx("div",{className:"nice-wiki__sidebar-footer",children:_?a.jsxs("div",{className:"nice-wiki__create-form",children:[a.jsx("input",{type:"text",className:"nice-input",value:T,onChange:G=>g(G.target.value),placeholder:E("pageTitle","Page title"),onKeyDown:G=>G.key==="Enter"&&O(),disabled:i}),a.jsx("button",{type:"button",disabled:i||!T.trim(),onClick:O,children:"✓"}),a.jsx("button",{type:"button",onClick:()=>S(!1),children:"✕"})]}):a.jsxs("button",{type:"button",className:"nice-wiki__add-page",onClick:()=>S(!0),disabled:i,children:["+ ",E("newPage","New page")]})})]}),$&&x&&a.jsx("button",{type:"button",className:"nice-wiki__sidebar-expand",onClick:()=>x(!1),children:"»"}),a.jsx("main",{className:"nice-wiki__content",children:R?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"nice-wiki__content-header",children:[a.jsx("h1",{className:"nice-wiki__page-title",children:R.title}),a.jsxs("div",{className:"nice-wiki__content-actions",children:[C&&!n&&a.jsx("button",{type:"button",disabled:i,onClick:()=>C(!m),children:m?E("preview","Preview"):E("edit","Edit")}),j&&a.jsx("button",{type:"button",disabled:i,onClick:()=>j(R.id),children:E("history","History")}),b&&!n&&a.jsx("button",{type:"button",className:"nice-btn--danger",disabled:i,onClick:()=>b(R.id),children:E("delete","Delete")})]})]}),R.updatedAt&&a.jsxs("div",{className:"nice-wiki__page-meta",children:[R.updatedBy&&a.jsxs("span",{children:[E("lastEditedBy","Last edited by")," ",R.updatedBy]}),a.jsx("span",{children:new Date(R.updatedAt).toLocaleDateString()})]}),m?a.jsxs("div",{className:"nice-wiki__editor",children:[a.jsx("textarea",{className:"nice-wiki__editor-textarea",value:y,onChange:G=>D==null?void 0:D(G.target.value),disabled:i}),w&&a.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",disabled:i,onClick:()=>w(R.id,y),children:E("save","Save")})]}):a.jsx("div",{className:"nice-wiki__viewer",children:h==="html"?a.jsx("div",{className:"nice-wiki__html",dangerouslySetInnerHTML:{__html:aa(y)}}):a.jsx("pre",{className:"nice-wiki__markdown",children:y})})]}):a.jsx("div",{className:"nice-wiki__empty",children:a.jsx("p",{children:E("selectPage","Select a page from the sidebar or create a new one.")})})}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),r&&typeof r=="string"&&a.jsx("span",{className:"nice-error-text",children:r})]})});Yi.displayName="NiceWiki";const Fu=[{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"}],Ui=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,value:y="",onChange:h,countryCode:m="PL",onCountryChange:v,countries:D=Fu,showCountrySelector:w=!0,autoPrefixVat:k=!0,validationResult:b,onValidateRequest:C,placeholder:j},N)=>{const $=Le(u,d);if($==="hidden")return null;$==="disabled"&&(n=!0),$==="readOnly"&&(o=!0);const{t:x}=De(),F=Ee(d),I=s.useMemo(()=>D.find(W=>W.code===m)??D[0],[D,m]),P=s.useCallback(W=>{let z=W.toUpperCase();return I&&z.startsWith(I.prefix)&&(z=z.slice(I.prefix.length)),I?I.pattern.test(z):z.length>0},[I]),A=s.useCallback(W=>{let z=W.target.value.replace(/\s/g,"");h==null||h(z,P(z))},[h,P]),E=k&&y&&I&&!y.toUpperCase().startsWith(I.prefix)?`${I.prefix}${y}`:y,M=P(y);return a.jsxs("div",{ref:N,id:F,className:`nice-vat-input nice-size-${c}${p?` ${p}`:""}${r||!M&&y.length>0?" nice-error":""}${n?" nice-disabled":""}`,style:f,children:[t&&a.jsxs("label",{className:"nice-vat-input__label",htmlFor:`${F}-input`,children:[t,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("div",{className:"nice-vat-input__row",children:[w&&a.jsx("select",{className:"nice-vat-input__country",value:m,onChange:W=>v==null?void 0:v(W.target.value),disabled:n||o,children:D.map(W=>a.jsx("option",{value:W.code,children:W.prefix},W.code))}),a.jsx("input",{id:`${F}-input`,className:"nice-input nice-vat-input__field",type:"text",name:l,value:y,onChange:A,readOnly:o,disabled:n,placeholder:j??(I==null?void 0:I.placeholder),required:i,"aria-invalid":!M&&y.length>0}),C&&y.length>0&&a.jsx("button",{type:"button",className:"nice-vat-input__verify",disabled:n||!M,onClick:()=>C(k?E:y,m),title:x("verifyVat","Verify VAT number"),children:"🔍"})]}),b&&a.jsxs("div",{className:`nice-vat-input__result nice-vat-input__result--${b.valid?"valid":"invalid"}`,children:[b.valid?"✅":"❌"," ",b.companyName??b.error??(b.valid?x("vatValid","VAT number valid"):x("vatInvalid","VAT number invalid"))]}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),r&&typeof r=="string"&&a.jsx("span",{className:"nice-error-text",children:r})]})});Ui.displayName="NiceVatInput";const Ru=[{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"}],Zi=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,value:y,onChange:h,rates:m,countryCode:v,placeholder:D,showPercentage:w=!0},k)=>{const b=Le(u,d);if(b==="hidden")return null;b==="disabled"&&(n=!0),b==="readOnly"&&(o=!0);const{t:C}=De(),j=Ee(d),N=s.useMemo(()=>{const x=m??Ru;return v?x.filter(F=>!F.countryCode||F.countryCode===v):x},[m,v]),$=s.useCallback(x=>{const F=x.target.value,I=N.find(P=>P.id===F);I&&(h==null||h(F,I))},[h,N]);return a.jsxs("div",{ref:k,id:j,className:`nice-tax-rate nice-size-${c}${p?` ${p}`:""}${r?" nice-error":""}${n?" nice-disabled":""}`,style:f,children:[t&&a.jsxs("label",{className:"nice-tax-rate__label",htmlFor:`${j}-select`,children:[t,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("select",{id:`${j}-select`,className:"nice-select nice-tax-rate__select",name:l,value:y??"",onChange:$,disabled:n||o,required:i,children:[a.jsx("option",{value:"",disabled:!0,children:D??C("selectRate","Select rate…")}),N.map(x=>a.jsxs("option",{value:x.id,children:[x.label,w&&x.category!=="exempt"?` (${(x.rate*100).toFixed(0)}%)`:""]},x.id))]}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),r&&typeof r=="string"&&a.jsx("span",{className:"nice-error-text",children:r})]})});Zi.displayName="NiceTaxRatePicker";const Iu={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)"},Xi=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,value:y,onChange:h,accounts:m,treeView:v=!1,placeholder:D,searchable:w=!0,showType:k=!0,onSearch:b},C)=>{const j=Le(u,d);if(j==="hidden")return null;j==="disabled"&&(n=!0),j==="readOnly"&&(o=!0);const{t:N}=De(),$=Ee(d),[x,F]=s.useState(""),[I,P]=s.useState(!1),A=s.useMemo(()=>{const T=g=>{for(const _ of g){if(_.code===y)return _;if(_.children){const S=T(_.children);if(S)return S}}};return T(m)},[m,y]),E=s.useMemo(()=>{const T=[],g=_=>{for(const S of _)T.push(S),S.children&&g(S.children)};return g(m),T},[m]),M=s.useMemo(()=>{if(!x)return E;const T=x.toLowerCase();return E.filter(g=>g.code.toLowerCase().includes(T)||g.name.toLowerCase().includes(T))},[E,x]),W=s.useCallback(T=>{F(T),b==null||b(T),P(!0)},[b]),z=s.useCallback(T=>{h==null||h(T.code,T),P(!1),F("")},[h]);return a.jsxs("div",{ref:C,id:$,className:`nice-account-picker nice-size-${c}${p?` ${p}`:""}${r?" nice-error":""}${n?" nice-disabled":""}`,style:f,children:[t&&a.jsxs("label",{className:"nice-account-picker__label",htmlFor:`${$}-input`,children:[t,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsx("div",{className:"nice-account-picker__control",children:w&&!o?a.jsx("input",{id:`${$}-input`,className:"nice-input",type:"text",value:I?x:A?`${A.code} — ${A.name}`:"",onChange:T=>W(T.target.value),onFocus:()=>{F(""),P(!0)},onBlur:()=>setTimeout(()=>P(!1),200),placeholder:D??N("searchAccount","Search account…"),disabled:n,required:i}):a.jsx("div",{className:"nice-account-picker__display",children:A?`${A.code} — ${A.name}`:D??N("selectAccount","Select account…")})}),I&&M.length>0&&a.jsx("div",{className:"nice-account-picker__dropdown",role:"listbox",children:M.map(T=>a.jsxs("div",{className:`nice-account-picker__option${T.code===y?" nice-account-picker__option--selected":""}${T.isActive===!1?" nice-account-picker__option--inactive":""}`,role:"option","aria-selected":T.code===y,onClick:()=>z(T),children:[k&&T.type&&a.jsx("span",{className:"nice-account-picker__type",style:{color:Iu[T.type]},title:T.type,children:"●"}),a.jsx("span",{className:"nice-account-picker__code",children:T.code}),a.jsx("span",{className:"nice-account-picker__name",children:T.name})]},T.code))}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),r&&typeof r=="string"&&a.jsx("span",{className:"nice-error-text",children:r})]})});Xi.displayName="NiceAccountPicker";const Ji=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",id:l,className:d,style:p,accessMode:f,mode:u="manual",onScan:y,onModeChange:h,beepOnScan:m=!0,beepFrequency:v=1800,beepDuration:D=150,placeholder:w,scanHistory:k=[],showHistory:b=!0,maxHistory:C=10,autoFocus:j=!0,onCameraFrame:N},$)=>{const x=Le(f,l);if(x==="hidden")return null;x==="disabled"&&(n=!0),x==="readOnly"&&(o=!0);const{t:F}=De(),I=Ee(l),[P,A]=s.useState(""),E=s.useRef(null),M=s.useRef(null),W=s.useCallback(()=>{if(m)try{M.current||(M.current=new AudioContext);const g=M.current,_=g.createOscillator(),S=g.createGain();_.connect(S),S.connect(g.destination),_.frequency.value=v,_.type="square",S.gain.value=.3,_.start(),_.stop(g.currentTime+D/1e3)}catch{}},[m,v,D]),z=s.useCallback(()=>{var g;P.trim()&&(W(),y==null||y({value:P.trim(),format:"manual",scannedAt:new Date}),A(""),(g=E.current)==null||g.focus())},[P,y,W]),T=k.slice(0,C);return a.jsxs("div",{ref:$,id:I,className:`nice-scanner nice-size-${c}${d?` ${d}`:""}${r?" nice-error":""}${n?" nice-disabled":""}`,style:p,children:[t&&a.jsxs("div",{className:"nice-scanner__label",children:[t,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("div",{className:"nice-scanner__modes",children:[a.jsxs("button",{type:"button",className:`nice-scanner__mode-btn${u==="camera"?" nice-scanner__mode-btn--active":""}`,onClick:()=>h==null?void 0:h("camera"),disabled:n,children:["📷 ",F("camera","Camera")]}),a.jsxs("button",{type:"button",className:`nice-scanner__mode-btn${u==="manual"?" nice-scanner__mode-btn--active":""}`,onClick:()=>h==null?void 0:h("manual"),disabled:n,children:["⌨️ ",F("manual","Manual")]})]}),u==="camera"&&a.jsx("div",{className:"nice-scanner__camera",children:a.jsx("div",{className:"nice-scanner__viewfinder",children:a.jsxs("div",{className:"nice-scanner__viewfinder-overlay",children:[a.jsx("span",{children:"📷"}),a.jsx("p",{children:F("cameraPlaceholder","Camera preview — connect scanner adapter")})]})})}),u==="manual"&&!o&&a.jsxs("div",{className:"nice-scanner__manual",children:[a.jsx("input",{ref:E,className:"nice-input nice-scanner__input",type:"text",value:P,onChange:g=>A(g.target.value),onKeyDown:g=>g.key==="Enter"&&z(),placeholder:w??F("enterCode","Enter or scan code…"),disabled:n,autoFocus:j}),a.jsx("button",{type:"button",className:"nice-scanner__submit",onClick:z,disabled:n||!P.trim(),children:"✓"})]}),b&&T.length>0&&a.jsxs("div",{className:"nice-scanner__history",children:[a.jsx("div",{className:"nice-scanner__history-label",children:F("recentScans","Recent scans")}),T.map((g,_)=>a.jsxs("div",{className:"nice-scanner__history-item",children:[a.jsx("span",{className:"nice-scanner__history-value",children:g.value}),g.format&&a.jsx("span",{className:"nice-scanner__history-format",children:g.format}),a.jsx("span",{className:"nice-scanner__history-time",children:g.scannedAt.toLocaleTimeString()})]},_))]}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),r&&typeof r=="string"&&a.jsx("span",{className:"nice-error-text",children:r})]})});Ji.displayName="NiceScannerControl";const Qi=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",id:l,className:d,style:p,accessMode:f,value:u="",onChange:y,onComplete:h,length:m=4,masked:v=!0,showKeypad:D=!1,autoSubmit:w=!0,shake:k=!1,placeholderChar:b="·"},C)=>{const j=Le(f,l);if(j==="hidden")return null;j==="disabled"&&(n=!0),j==="readOnly"&&(o=!0);const{t:N}=De(),$=Ee(l),x=s.useRef([]),[F,I]=s.useState(!1);s.useEffect(()=>{if(k){I(!0);const W=setTimeout(()=>I(!1),500);return()=>clearTimeout(W)}},[k]);const P=u.split("").slice(0,m);for(;P.length<m;)P.push("");const A=s.useCallback((W,z)=>{var _;const T=[...P];T[W]=z;const g=T.join("");y==null||y(g),z&&W<m-1&&((_=x.current[W+1])==null||_.focus()),w&&g.length===m&&g.indexOf("")===-1&&(h==null||h(g))},[P,m,y,h,w]),E=s.useCallback((W,z)=>{var T,g,_;W.key==="Backspace"&&!P[z]&&z>0&&((T=x.current[z-1])==null||T.focus(),A(z-1,"")),W.key==="ArrowLeft"&&z>0&&((g=x.current[z-1])==null||g.focus()),W.key==="ArrowRight"&&z<m-1&&((_=x.current[z+1])==null||_.focus())},[P,m,A]),M=s.useCallback(W=>{var z,T,g;if(W==="clear"){y==null||y(""),(z=x.current[0])==null||z.focus();return}if(W==="backspace"){const _=u.slice(0,-1);y==null||y(_);const S=Math.max(0,_.length-1);(T=x.current[S])==null||T.focus();return}if(u.length<m){const _=u+W;y==null||y(_),_.length<m&&((g=x.current[_.length])==null||g.focus()),w&&_.length===m&&(h==null||h(_))}},[u,m,y,h,w]);return a.jsxs("div",{ref:C,id:$,className:`nice-pin nice-size-${c}${F?" nice-pin--shake":""}${d?` ${d}`:""}${r?" nice-error":""}${n?" nice-disabled":""}`,style:p,children:[t&&a.jsxs("label",{className:"nice-pin__label",children:[t,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsx("div",{className:"nice-pin__boxes",children:P.map((W,z)=>a.jsx("input",{ref:T=>{x.current[z]=T},className:"nice-pin__box",type:v?"password":"text",inputMode:"numeric",maxLength:1,value:W,onChange:T=>{const g=T.target.value.replace(/\D/g,"");g.length<=1&&A(z,g)},onKeyDown:T=>E(T,z),disabled:n,readOnly:o,placeholder:b,"aria-label":`${N("digit","Digit")} ${z+1}`},z))}),D&&!o&&a.jsx("div",{className:"nice-pin__keypad",children:["1","2","3","4","5","6","7","8","9","clear","0","backspace"].map(W=>a.jsx("button",{type:"button",className:`nice-pin__key${W==="clear"||W==="backspace"?" nice-pin__key--action":""}`,onClick:()=>M(W),disabled:n,children:W==="clear"?"C":W==="backspace"?"⌫":W},W))}),e&&a.jsx("span",{className:"nice-helper-text",children:e}),r&&typeof r=="string"&&a.jsx("span",{className:"nice-error-text",children:r})]})});Qi.displayName="NicePinCodeInput";const Ir=Object.freeze(Object.defineProperty({__proto__:null,$:Ui,A:Ka,B:Vi,C:Ga,D:wi,E:tr,F:Ba,G:Ya,H:Qa,I:Gi,J:Va,K:Wi,L:Za,M:Qi,N:Xi,O:pi,P:Si,Q:qa,R:Ji,T:rr,U:xt,V:Ci,W:Zi,X:Ta,Y:Wa,_:Ua,a:Hi,a0:Yi,a4:vi,a5:$i,a8:Di,aa:Ei,ab:Qt,ac:Xt,ad:xi,ae:Lt,af:gi,ag:wa,ah:It,ai:Ht,aj:mt,ak:mi,al:bi,am:hi,an:fi,ao:Ra,ap:Jt,aq:Od,ar:au,b:ki,c:la,d:Ja,e:Xa,g:Pa,h:Ki,k:Bi,l:Fa,m:_i,n:Ha,o:nr,p:ji,r:Oi,s:Ai,t:Oa,u:La,v:ca,x:Ti,y:ar,z:er},Symbol.toStringTag,{value:"Module"})),ot=s.forwardRef(({label:t,helperText:e,error:r,required:i,disabled:n,readOnly:o,size:c="md",name:l,id:d,className:p,style:f,accessMode:u,displayStyle:y,value:h,onChange:m,onBlur:v,onKeyDown:D,placeholder:w,min:k,max:b,step:C=1,precision:j,prefix:N,suffix:$,showStepper:x=!0,submitOnEnter:F,onSubmit:I,showKeyboardHints:P},A)=>{const E=Le(u,d);if(E==="hidden")return null;E==="disabled"&&(n=!0),E==="readOnly"&&(o=!0);const{t:M}=De(),W=Ee(d),z=ft("input",y),T=at("input",y),g=s.useCallback(G=>{let B=G;return k!==void 0&&(B=Math.max(k,B)),b!==void 0&&(B=Math.min(b,B)),j!==void 0&&(B=parseFloat(B.toFixed(j))),B},[k,b,j]),_=s.useCallback(G=>{const B=G.target.value;if(B===""){m==null||m(null);return}const K=parseFloat(B);isNaN(K)||(m==null||m(g(K)))},[m,g]),S=s.useCallback(()=>{m==null||m(g((h??0)+C))},[h,C,m,g]),R=s.useCallback(()=>{m==null||m(g((h??0)-C))},[h,C,m,g]),L=za({enabled:F,onSubmit:I}),O=s.useCallback(G=>{L(G),D==null||D(G)},[L,D]),Y=s.useMemo(()=>{const G=[];return F&&G.push(Be.submit),x&&(G.push({key:"ArrowUp",description:M("shortcuts.increment","Increase value")}),G.push({key:"ArrowDown",description:M("shortcuts.decrement","Decrease value")})),G},[F,x,M]);return a.jsxs("div",{className:`nice-field ${p||""}`,style:f,children:[t&&a.jsxs("label",{htmlFor:W,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[t,P&&Y.length>0&&a.jsx(Qe,{shortcuts:Y,size:"sm"})]}),a.jsxs("div",{className:`nice-input nice-input--${c} nice-input--ds-${T} ${r?"nice-input--error":""} ${n?"nice-input--disabled":""} ${o?"nice-input--readonly":""}`,style:z,children:[N&&a.jsx("span",{className:"nice-input__icon",children:N}),x&&!o&&a.jsx("button",{type:"button",className:"nice-input__clear",onClick:R,disabled:n,"aria-label":M("controls.decrement","Decrement"),children:"−"}),a.jsx("input",{ref:A,id:W,className:"nice-input__native",type:"number",name:l,value:h??"",placeholder:w,min:k,max:b,step:C,disabled:n,readOnly:o,"aria-invalid":!!r,onChange:_,onBlur:v,onKeyDown:O}),x&&!o&&a.jsx("button",{type:"button",className:"nice-input__clear",onClick:S,disabled:n,"aria-label":M("controls.increment","Increment"),children:"+"}),$&&a.jsx("span",{className:"nice-input__icon",children:$})]}),r&&a.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&e&&a.jsx("div",{className:"nice-field__helper",children:e})]})});ot.displayName="NiceNumberInput";const Mt=s.forwardRef(({label:t,checked:e=!1,indeterminate:r=!1,onChange:i,disabled:n,size:o="md",name:c,id:l,className:d,style:p,error:f,accessMode:u,displayStyle:y,showKeyboardHints:h},m)=>{const v=Le(u,l);if(v==="hidden")return null;(v==="disabled"||v==="readOnly")&&(n=!0);const{t:D}=De(),w=Ee(l);at("toggle",y);const k=s.useMemo(()=>[{key:"Space",description:D("shortcuts.toggle","Toggle")}],[D]),b=s.useCallback(C=>{C&&(C.indeterminate=r),typeof m=="function"?m(C):m&&(m.current=C)},[r,m]);return a.jsxs("div",{className:d,style:p,children:[a.jsxs("label",{className:`nice-checkbox ${o!=="md"?`nice-checkbox--${o}`:""} ${n?"nice-checkbox--disabled":""}`,htmlFor:w,children:[a.jsx("input",{ref:b,id:w,type:"checkbox",className:"nice-checkbox__input",name:c,checked:e,disabled:n,"aria-invalid":!!f,onChange:C=>i==null?void 0:i(C.target.checked)}),a.jsx("span",{className:"nice-checkbox__box",children:a.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r?a.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"}):a.jsx("polyline",{points:"2 6 5 9 10 3"})})}),t&&a.jsx("span",{children:t}),h&&a.jsx(Qe,{shortcuts:k,size:"sm"})]}),f&&a.jsx("div",{className:"nice-field__error",role:"alert",children:f})]})});Mt.displayName="NiceCheckbox";const en=s.forwardRef(({label:t,checked:e=!1,onChange:r,disabled:i,size:n="md",name:o,id:c,className:l,style:d,accessMode:p,displayStyle:f,showKeyboardHints:u},y)=>{const h=Le(p,c);if(h==="hidden")return null;(h==="disabled"||h==="readOnly")&&(i=!0);const{t:m}=De(),v=Ee(c),D=ft("toggle",f),w=at("toggle",f),k=s.useMemo(()=>[{key:"Space",description:m("shortcuts.toggle","Toggle on/off")}],[m]);return a.jsxs("label",{className:`nice-toggle nice-toggle--ds-${w} ${n!=="md"?`nice-toggle--${n}`:""} ${i?"nice-toggle--disabled":""} ${l||""}`,htmlFor:v,style:{...D,...d},children:[a.jsx("input",{ref:y,id:v,type:"checkbox",className:"nice-toggle__input",name:o,checked:e,disabled:i,role:"switch","aria-checked":e,onChange:b=>r==null?void 0:r(b.target.checked)}),a.jsx("span",{className:"nice-toggle__track",children:a.jsx("span",{className:"nice-toggle__thumb"})}),t&&a.jsx("span",{children:t}),u&&a.jsx(Qe,{shortcuts:k,size:"sm"})]})});en.displayName="NiceToggle";const Pr={flowchart:["rectangle","roundedRect","diamond","parallelogram","ellipse","circle","document","cylinder"],orgchart:["roundedRect","ellipse","rectangle"],mindmap:["roundedRect","ellipse","cloud","rectangle"],bpmn:["rectangle","roundedRect","circle","diamond","document"],er:["rectangle","diamond","ellipse"],sequence:["rectangle","actor","circle"],stateMachine:["roundedRect","circle","diamond"],networkTopology:["rectangle","circle","cloud","cylinder","hexagon"],decisionTree:["rectangle","diamond","roundedRect"],custom:["rectangle","roundedRect","ellipse","circle","diamond","hexagon","parallelogram","cylinder","triangle","cloud","document","actor"]},Pu=["dagre","forceDirected","grid","radial","tree"],Lu=["sans-serif","serif","monospace","Arial","Helvetica","Times New Roman","Courier New","Georgia","Verdana","Tahoma","Trebuchet MS"],Ou=[8,9,10,11,12,14,16,18,20,24,28,32,36,48,72],sr=({activeTool:t,onToolChange:e,diagramType:r,onAddNode:i,onApplyLayout:n,onUndo:o,onRedo:c,canUndo:l=!1,canRedo:d=!1,onExport:p,onZoomIn:f,onZoomOut:u,onZoomReset:y,zoomLevel:h=1,onToggleBold:m,onToggleItalic:v,isBold:D=!1,isItalic:w=!1,onFontFamilyChange:k,currentFontFamily:b="sans-serif",onFontSizeChange:C,currentFontSize:j=14,onAlignLeft:N,onAlignCenterH:$,onAlignRight:x,onAlignTop:F,onAlignCenterV:I,onAlignBottom:P,onDistributeH:A,onDistributeV:E,onBringToFront:M,onSendToBack:W,onGroupSelected:z,onUngroupSelected:T,onCopy:g,onPaste:_,onDuplicate:S,onSelectAll:R,selectionCount:L=0,onFind:O,showFind:Y=!1,findQuery:G="",onFindQueryChange:B,viewMode:K="editor",onViewModeChange:J,stylePresetId:he,onStylePresetChange:pe,className:we})=>{const{t:se}=Wt(),[Ce,ee]=s.useState(!1),[de,xe]=s.useState(!1),[$e,Ne]=s.useState(!1),[U,Z]=s.useState(!1),[X,Q]=s.useState(!1),[fe,Se]=s.useState(!1),be=Pr[r]??Pr.custom,ie=s.useCallback(oe=>{i==null||i(oe),ee(!1)},[i]),je=s.useCallback(oe=>{n==null||n(oe),xe(!1)},[n]);return a.jsxs("div",{className:`nice-diagram-toolbar ${we??""}`,children:[a.jsxs("div",{className:"nice-diagram-toolbar__row",children:[a.jsxs("div",{className:"nice-diagram-toolbar__group",children:[a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:t==="select"?"primary":"ghost",size:"sm",onClick:()=>e("select"),title:`${se("toolbar.select")} (V)`,children:"◇"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:t==="pan"?"primary":"ghost",size:"sm",onClick:()=>e("pan"),title:`${se("toolbar.pan")} (H)`,children:"✋"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:t==="addEdge"?"primary":"ghost",size:"sm",onClick:()=>e("addEdge"),title:`${se("toolbar.addEdge")} (C)`,children:"↗"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:t==="text"?"primary":"ghost",size:"sm",onClick:()=>e("text"),title:"Text (T)",children:"T"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:t==="freehand"?"primary":"ghost",size:"sm",onClick:()=>e("freehand"),title:"Freehand (F)",children:"✎"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:t==="delete"?"primary":"ghost",size:"sm",onClick:()=>e("delete"),title:`${se("toolbar.delete")} (Del)`,children:"🗑"})]}),a.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[a.jsxs(me,{className:"nice-diagram-toolbar__btn",variant:t==="addNode"?"primary":"ghost",size:"sm",onClick:()=>ee(oe=>!oe),title:se("toolbar.addNode"),children:["+ ",se("toolbar.addNode")]}),Ce&&a.jsx("div",{className:"nice-diagram-toolbar__dropdown nice-diagram-toolbar__dropdown--shapes",children:be.map(oe=>a.jsxs(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>ie(oe),children:[Hu(oe)," ",oe]},oe))})]}),a.jsxs("div",{className:"nice-diagram-toolbar__group",children:[a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:g,title:"Copy (Ctrl+C)",children:"📋"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:_,title:"Paste (Ctrl+V)",children:"📃"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:S,title:"Duplicate (Ctrl+D)",children:"⧉"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:R,title:"Select All (Ctrl+A)",children:"⬚"})]}),a.jsxs("div",{className:"nice-diagram-toolbar__group",children:[a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:o,disabled:!l,title:`${se("toolbar.undo")} (Ctrl+Z)`,children:"↩"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:c,disabled:!d,title:`${se("toolbar.redo")} (Ctrl+Y)`,children:"↪"})]}),a.jsxs("div",{className:"nice-diagram-toolbar__group",children:[a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:u,title:se("toolbar.zoomOut"),children:"−"}),a.jsxs("span",{className:"nice-diagram-toolbar__zoom-label",children:[Math.round(h*100),"%"]}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:f,title:se("toolbar.zoomIn"),children:"+"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:y,title:se("toolbar.zoomReset"),children:"1:1"})]}),a.jsxs("div",{className:"nice-diagram-toolbar__group",children:[a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:O,title:"Find (Ctrl+F)",children:"🔍"}),Y&&a.jsx(pt,{className:"nice-diagram-toolbar__search",placeholder:"Search nodes…",value:G,onChange:oe=>B==null?void 0:B(oe),autoFocus:!0})]}),a.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[a.jsxs(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>Ne(oe=>!oe),title:se("toolbar.export"),children:["⤓ ",se("toolbar.export")]}),$e&&a.jsxs("div",{className:"nice-diagram-toolbar__dropdown",children:[a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{p==null||p("ndd"),Ne(!1)},children:".ndd.json"}),a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{p==null||p("svg"),Ne(!1)},children:"SVG"}),a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{p==null||p("mermaid"),Ne(!1)},children:"Mermaid"}),a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{p==null||p("png"),Ne(!1)},children:"PNG"})]})]})]}),a.jsxs("div",{className:"nice-diagram-toolbar__row nice-diagram-toolbar__format-bar",children:[a.jsxs("div",{className:"nice-diagram-toolbar__group",children:[a.jsx(Je,{className:"nice-diagram-toolbar__font-select",value:b,onChange:oe=>k==null?void 0:k(oe),options:Lu.map(oe=>({value:oe,label:oe})),title:"Font Family"}),a.jsx(Je,{className:"nice-diagram-toolbar__size-select",value:String(j),onChange:oe=>C==null?void 0:C(Number(oe)),options:Ou.map(oe=>({value:String(oe),label:String(oe)})),title:"Font Size"})]}),a.jsxs("div",{className:"nice-diagram-toolbar__group",children:[a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:D?"primary":"ghost",size:"sm",onClick:m,title:"Bold (Ctrl+B)",children:a.jsx("strong",{children:"B"})}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:w?"primary":"ghost",size:"sm",onClick:v,title:"Italic (Ctrl+I)",children:a.jsx("em",{children:"I"})})]}),a.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>Z(oe=>!oe),title:"Alignment & Distribution",children:"≡ Align"}),U&&a.jsxs("div",{className:"nice-diagram-toolbar__dropdown nice-diagram-toolbar__dropdown--align",children:[a.jsx("div",{className:"nice-diagram-toolbar__dropdown-section",children:"Align"}),a.jsxs("div",{className:"nice-diagram-toolbar__dropdown-row",children:[a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{N==null||N(),Z(!1)},title:"Align Left",children:"⫷ Left"}),a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{$==null||$(),Z(!1)},title:"Align Center",children:"⫿ Center"}),a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{x==null||x(),Z(!1)},title:"Align Right",children:"⫸ Right"})]}),a.jsxs("div",{className:"nice-diagram-toolbar__dropdown-row",children:[a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{F==null||F(),Z(!1)},title:"Align Top",children:"⫠ Top"}),a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{I==null||I(),Z(!1)},title:"Align Middle",children:"⫟ Middle"}),a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{P==null||P(),Z(!1)},title:"Align Bottom",children:"⫡ Bottom"})]}),a.jsx("div",{className:"nice-diagram-toolbar__dropdown-section",children:"Distribute"}),a.jsxs("div",{className:"nice-diagram-toolbar__dropdown-row",children:[a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{A==null||A(),Z(!1)},title:"Distribute Horizontally",children:"⟺ H"}),a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{E==null||E(),Z(!1)},title:"Distribute Vertically",children:"⟺ V"})]})]})]}),a.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>Q(oe=>!oe),title:"Arrange",children:"☰ Arrange"}),X&&a.jsxs("div",{className:"nice-diagram-toolbar__dropdown",children:[a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{M==null||M(),Q(!1)},children:"↑ Bring to Front"}),a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{W==null||W(),Q(!1)},children:"↓ Send to Back"}),a.jsx("div",{className:"nice-diagram-toolbar__dropdown-divider"}),a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{z==null||z(),Q(!1)},disabled:L<2,children:"⊞ Group"}),a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{T==null||T(),Q(!1)},children:"⊟ Ungroup"})]})]}),a.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[a.jsxs(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>xe(oe=>!oe),title:se("toolbar.layout"),children:["⊞ ",se("toolbar.layout")]}),de&&a.jsx("div",{className:"nice-diagram-toolbar__dropdown",children:Pu.map(oe=>a.jsx(me,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>je(oe),children:se(`layout.${oe}`)},oe))})]}),L>1&&a.jsxs("span",{className:"nice-diagram-toolbar__selection-info",children:[L," selected"]}),a.jsxs("div",{className:"nice-diagram-toolbar__group",children:[a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:K==="editor"?"primary":"ghost",size:"sm",onClick:()=>J==null?void 0:J("editor"),title:"Editor Mode",children:"🖊 Editor"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:K==="player"?"primary":"ghost",size:"sm",onClick:()=>J==null?void 0:J("player"),title:"Player Mode",children:"▶ Player"}),a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:K==="playerAnimated"?"primary":"ghost",size:"sm",onClick:()=>J==null?void 0:J("playerAnimated"),title:"Animated Player Mode",children:"⚡ Animated"})]}),a.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[a.jsx(me,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>Se(oe=>!oe),title:"Style Presets",children:"🎨 Style"}),fe&&a.jsx("div",{className:"nice-diagram-toolbar__dropdown nice-diagram-toolbar__dropdown--presets",style:{maxHeight:320,overflowY:"auto",width:220},children:Object.entries(sa.reduce((oe,Ae)=>{const ze=Ae.category??"Other";return oe[ze]||(oe[ze]=[]),oe[ze].push(Ae),oe},{})).map(([oe,Ae])=>a.jsxs("div",{children:[a.jsx("div",{className:"nice-diagram-toolbar__dropdown-section",style:{fontSize:10,color:"#888",padding:"6px 8px 2px",textTransform:"uppercase"},children:oe}),Ae.map(ze=>a.jsxs(me,{className:`nice-diagram-toolbar__dropdown-item ${he===ze.id?"nice-diagram-toolbar__dropdown-item--active":""}`,variant:he===ze.id?"primary":"ghost",size:"sm",onClick:()=>{pe==null||pe(ze.id),Se(!1)},style:{display:"flex",alignItems:"center",gap:8},children:[a.jsx("span",{style:{width:16,height:16,borderRadius:3,background:ze.config.palette.primary,border:"1px solid "+(ze.config.palette.border??"#ccc"),display:"inline-block",flexShrink:0}}),a.jsx("span",{style:{fontSize:12},children:ze.name})]},ze.id))]},oe))})]})]})]})};function Hu(t){switch(t){case"rectangle":return"▭";case"roundedRect":return"▢";case"ellipse":return"⬭";case"circle":return"●";case"diamond":return"◇";case"hexagon":return"⬡";case"parallelogram":return"▱";case"cylinder":return"⌂";case"triangle":return"△";case"cloud":return"☁";case"document":return"📄";case"actor":return"🧑";default:return"▢"}}sr.displayName="DiagramToolbar";const Wu=["rectangle","roundedRect","ellipse","circle","diamond","hexagon","parallelogram","cylinder","triangle","cloud","document","actor"],or=({selectedNode:t,selectedEdge:e,onNodeChange:r,onEdgeChange:i,onRemove:n,className:o})=>{var p,f,u,y,h;const{t:c}=Wt(),l=s.useCallback((m,v)=>{!t||!r||r(t.id,{style:{...t.style,[m]:v}})},[t,r]),d=s.useCallback((m,v)=>{!e||!i||i(e.id,{style:{...e.style,[m]:v}})},[e,i]);return!t&&!e?a.jsx("div",{className:`nice-diagram-property-panel nice-diagram-property-panel--empty ${o??""}`,children:a.jsx("p",{className:"nice-diagram-property-panel__hint",children:c("panel.noSelection")})}):t?a.jsxs("div",{className:`nice-diagram-property-panel ${o??""}`,children:[a.jsx("h3",{className:"nice-diagram-property-panel__title",children:c("panel.nodeProperties")}),a.jsxs("label",{className:"nice-diagram-property-panel__label",children:[c("node.label"),a.jsx(pt,{value:t.label,onChange:m=>r==null?void 0:r(t.id,{label:m}),className:"nice-diagram-property-panel__input"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label",children:[c("node.description"),a.jsx(pt,{value:t.description??"",onChange:m=>r==null?void 0:r(t.id,{description:m||void 0}),className:"nice-diagram-property-panel__input"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label",children:[c("node.shape"),a.jsx(Je,{value:t.shape,onChange:m=>r==null?void 0:r(t.id,{shape:m}),options:Wu.map(m=>({value:m,label:m})),className:"nice-diagram-property-panel__select"})]}),a.jsxs("div",{className:"nice-diagram-property-panel__row",children:[a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.width"),a.jsx(ot,{value:t.size.width,min:20,onChange:m=>r==null?void 0:r(t.id,{size:{...t.size,width:m??40}}),className:"nice-diagram-property-panel__input"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.height"),a.jsx(ot,{value:t.size.height,min:20,onChange:m=>r==null?void 0:r(t.id,{size:{...t.size,height:m??40}}),className:"nice-diagram-property-panel__input"})]})]}),a.jsxs("div",{className:"nice-diagram-property-panel__row",children:[a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.bgColor"),a.jsx(rt,{value:t.style.backgroundColor??"#ffffff",onChange:m=>l("backgroundColor",m),className:"nice-diagram-property-panel__color"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.borderColor"),a.jsx(rt,{value:t.style.borderColor??"#333333",onChange:m=>l("borderColor",m),className:"nice-diagram-property-panel__color"})]})]}),a.jsxs("div",{className:"nice-diagram-property-panel__row",children:[a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.fontSize"),a.jsx(ot,{value:t.style.fontSize??14,min:8,max:72,onChange:m=>l("fontSize",m??14),className:"nice-diagram-property-panel__input"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.fontColor"),a.jsx(rt,{value:t.style.fontColor??"#222222",onChange:m=>l("fontColor",m),className:"nice-diagram-property-panel__color"})]})]}),a.jsx(Mt,{checked:t.locked??!1,onChange:m=>r==null?void 0:r(t.id,{locked:m}),label:c("node.locked"),className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--check"}),a.jsx("h4",{className:"nice-diagram-property-panel__section-title",style:{fontSize:12,marginTop:12,marginBottom:4,color:"#666"},children:"Effects"}),a.jsxs("div",{className:"nice-diagram-property-panel__row",children:[a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Glow Color",a.jsx(rt,{value:t.style.glowColor??"#3b82f6",onChange:m=>l("glowColor",m),className:"nice-diagram-property-panel__color"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Glow Intensity",a.jsx(xt,{min:0,max:3,step:.1,value:t.style.glowIntensity??0,onChange:m=>l("glowIntensity",m),className:"nice-diagram-property-panel__input"})]})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Opacity",a.jsx(xt,{min:0,max:1,step:.05,value:t.style.opacity??1,onChange:m=>l("opacity",m),className:"nice-diagram-property-panel__input"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Border Radius",a.jsx(ot,{min:0,max:50,value:t.style.borderRadius??4,onChange:m=>l("borderRadius",m??4),className:"nice-diagram-property-panel__input"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Border Width",a.jsx(ot,{min:0,max:10,step:.5,value:t.style.borderWidth??1,onChange:m=>l("borderWidth",m??1),className:"nice-diagram-property-panel__input"})]}),a.jsx(Mt,{checked:t.style.shadow??!1,onChange:m=>l("shadow",m),label:"Shadow",className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--check"}),a.jsxs("div",{className:"nice-diagram-property-panel__row",children:[a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Gradient End",a.jsx(rt,{value:t.style.gradientColor??"#ffffff",onChange:m=>l("gradientColor",m),className:"nice-diagram-property-panel__color"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Gradient Dir",a.jsx(Je,{value:t.style.gradientDirection??"vertical",onChange:m=>l("gradientDirection",m),options:[{value:"vertical",label:"Vertical"},{value:"horizontal",label:"Horizontal"},{value:"diagonal",label:"Diagonal"},{value:"radial",label:"Radial"}],className:"nice-diagram-property-panel__select"})]})]}),a.jsx(Mt,{checked:t.hidden??!1,onChange:m=>r==null?void 0:r(t.id,{hidden:m}),label:"Hidden (ghost in editor)",className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--check"}),a.jsx(me,{className:"nice-diagram-property-panel__btn nice-diagram-property-panel__btn--danger",variant:"ghost",size:"sm",onClick:()=>n==null?void 0:n(t.id),children:c("toolbar.delete")})]}):e?a.jsxs("div",{className:`nice-diagram-property-panel ${o??""}`,children:[a.jsx("h3",{className:"nice-diagram-property-panel__title",children:c("panel.edgeProperties")}),a.jsxs("label",{className:"nice-diagram-property-panel__label",children:[c("edge.label"),a.jsx(pt,{value:e.label??"",onChange:m=>i==null?void 0:i(e.id,{label:m||void 0}),className:"nice-diagram-property-panel__input"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label",children:[c("edge.lineType"),a.jsx(Je,{value:e.style.lineType??"bezier",onChange:m=>d("lineType",m),options:[{value:"straight",label:"Straight"},{value:"bezier",label:"Bezier"},{value:"orthogonal",label:"Orthogonal"},{value:"step",label:"Step"}],className:"nice-diagram-property-panel__select"})]}),a.jsxs("div",{className:"nice-diagram-property-panel__row",children:[a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("edge.color"),a.jsx(rt,{value:e.style.strokeColor??"#333333",onChange:m=>d("strokeColor",m),className:"nice-diagram-property-panel__color"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("edge.width"),a.jsx(ot,{value:e.style.strokeWidth??1.5,min:.5,max:10,step:.5,onChange:m=>d("strokeWidth",m??1.5),className:"nice-diagram-property-panel__input"})]})]}),a.jsx(Mt,{checked:e.style.animated??!1,onChange:m=>d("animated",m),label:c("edge.animated"),className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--check"}),e.style.animated&&a.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Flow Speed",a.jsx(xt,{min:.1,max:5,step:.1,value:e.style.flowSpeed??1,onChange:m=>d("flowSpeed",m),className:"nice-diagram-property-panel__input"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Dash Style",a.jsx(Je,{value:e.style.strokeDash?e.style.strokeDash.join(","):"solid",onChange:m=>{const v=m;v==="solid"?d("strokeDash",[]):d("strokeDash",v.split(",").map(Number))},options:[{value:"solid",label:"Solid"},{value:"6,4",label:"Dashed"},{value:"2,2",label:"Dotted"},{value:"8,4,2,4",label:"Dash-Dot"},{value:"12,6",label:"Long Dash"}],className:"nice-diagram-property-panel__select"})]}),a.jsxs("div",{className:"nice-diagram-property-panel__row",children:[a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Target Arrow",a.jsx(Je,{value:e.style.targetArrow??"arrow",onChange:m=>d("targetArrow",m),options:[{value:"arrow",label:"Arrow"},{value:"openArrow",label:"Open Arrow"},{value:"diamond",label:"Diamond"},{value:"circle",label:"Circle"},{value:"none",label:"None"}],className:"nice-diagram-property-panel__select"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Source Arrow",a.jsx(Je,{value:e.style.sourceArrow??"none",onChange:m=>d("sourceArrow",m),options:[{value:"none",label:"None"},{value:"arrow",label:"Arrow"},{value:"openArrow",label:"Open Arrow"},{value:"diamond",label:"Diamond"},{value:"circle",label:"Circle"}],className:"nice-diagram-property-panel__select"})]})]}),a.jsx("h4",{className:"nice-diagram-property-panel__section-title",style:{fontSize:12,marginTop:12,marginBottom:4,color:"#666"},children:"Liquid Flow"}),a.jsx(Mt,{checked:((p=e.style.liquidFlow)==null?void 0:p.active)??!1,onChange:m=>{const v=e.style.liquidFlow??{active:!1,color:"#3b82f6",speed:1,pipeWidth:6};i==null||i(e.id,{style:{...e.style,liquidFlow:{...v,active:m}}})},label:"Enable Liquid Flow",className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--check"}),((f=e.style.liquidFlow)==null?void 0:f.active)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"nice-diagram-property-panel__row",children:[a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Color",a.jsx(rt,{value:((u=e.style.liquidFlow)==null?void 0:u.color)??"#3b82f6",onChange:m=>{const v=e.style.liquidFlow;i==null||i(e.id,{style:{...e.style,liquidFlow:{...v,color:m}}})},className:"nice-diagram-property-panel__color"})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Speed",a.jsx(xt,{min:.1,max:5,step:.1,value:((y=e.style.liquidFlow)==null?void 0:y.speed)??1,onChange:m=>{const v=e.style.liquidFlow;i==null||i(e.id,{style:{...e.style,liquidFlow:{...v,speed:m}}})},className:"nice-diagram-property-panel__input"})]})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Pipe Width",a.jsx(ot,{min:2,max:20,value:((h=e.style.liquidFlow)==null?void 0:h.pipeWidth)??6,onChange:m=>{const v=e.style.liquidFlow;i==null||i(e.id,{style:{...e.style,liquidFlow:{...v,pipeWidth:m??6}}})},className:"nice-diagram-property-panel__input"})]})]}),a.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Opacity",a.jsx(xt,{min:0,max:1,step:.05,value:e.style.opacity??1,onChange:m=>d("opacity",m),className:"nice-diagram-property-panel__input"})]}),a.jsx(me,{className:"nice-diagram-property-panel__btn nice-diagram-property-panel__btn--danger",variant:"ghost",size:"sm",onClick:()=>n==null?void 0:n(e.id),children:c("toolbar.delete")})]}):null};or.displayName="DiagramPropertyPanel";const Bu=180,qu=120,lr=({nodes:t,edges:e,viewport:r,onViewportChange:i,canvasWidth:n=800,canvasHeight:o=600,width:c=Bu,height:l=qu,className:d})=>{const p=s.useMemo(()=>{if(t.length===0)return{minX:0,minY:0,maxX:400,maxY:300};let v=1/0,D=1/0,w=-1/0,k=-1/0;for(const C of t)v=Math.min(v,C.position.x),D=Math.min(D,C.position.y),w=Math.max(w,C.position.x+C.size.width),k=Math.max(k,C.position.y+C.size.height);const b=50;return{minX:v-b,minY:D-b,maxX:w+b,maxY:k+b}},[t]),f=p.maxX-p.minX,u=p.maxY-p.minY,y=Math.min(c/f,l/u),h=s.useMemo(()=>{const v=(-r.x/r.zoom-p.minX)*y,D=(-r.y/r.zoom-p.minY)*y,w=n/r.zoom*y,k=o/r.zoom*y;return{x:v,y:D,w,h:k}},[r,p,y,n,o]),m=s.useCallback(v=>{if(!i)return;const D=v.currentTarget.getBoundingClientRect(),w=v.clientX-D.left,k=v.clientY-D.top,b=w/y+p.minX,C=k/y+p.minY;i({...r,x:-(b*r.zoom-n/2),y:-(C*r.zoom-o/2)})},[i,r,y,p,n,o]);return a.jsxs("svg",{className:`nice-diagram-minimap ${d??""}`,width:c,height:l,style:{border:"1px solid #ccc",background:"#fff",borderRadius:4,cursor:"pointer"},onClick:m,children:[e.map(v=>{const D=t.find(N=>N.id===v.sourceNodeId),w=t.find(N=>N.id===v.targetNodeId);if(!D||!w)return null;const k=(D.position.x+D.size.width/2-p.minX)*y,b=(D.position.y+D.size.height/2-p.minY)*y,C=(w.position.x+w.size.width/2-p.minX)*y,j=(w.position.y+w.size.height/2-p.minY)*y;return a.jsx("line",{x1:k,y1:b,x2:C,y2:j,stroke:"#aaa",strokeWidth:.5},v.id)}),t.map(v=>a.jsx("rect",{x:(v.position.x-p.minX)*y,y:(v.position.y-p.minY)*y,width:v.size.width*y,height:v.size.height*y,fill:v.style.backgroundColor??"#ddd",stroke:"#999",strokeWidth:.5},v.id)),a.jsx("rect",{x:h.x,y:h.y,width:h.w,height:h.h,fill:"rgba(33,150,243,0.15)",stroke:"#2196f3",strokeWidth:1})]})};lr.displayName="DiagramMinimap";const Vu=["fadeIn","fadeOut","slideInLeft","slideInRight","slideInTop","slideInBottom","zoomIn","zoomOut","pulse","shake","highlight","flowPulse","bounce","glow","colorShift","liquidFill","expand","collapse","ripple","typewriter","morphShape","drawPath","particleTrail"],Ku=["linear","easeIn","easeOut","easeInOut","spring","bounce"],cr=({animations:t,onAdd:e,onRemove:r,onUpdate:i,onPlay:n,onStop:o,isPlaying:c=!1,availableTargets:l=[],className:d})=>{const{t:p}=Wt(),[f,u]=s.useState(!1),[y,h]=s.useState(null),m=s.useCallback(()=>{if(!e||l.length===0)return;const w=l[0];e({name:`Animation ${t.length+1}`,targetId:w.id,targetType:w.type,effect:"fadeIn",startMs:t.length*500,durationMs:600,easing:"easeOut"})},[e,t.length,l]),v=s.useCallback(w=>{if(!e||l.length===0)return;const k=l[0];e({name:w.name,targetId:k.id,targetType:k.type,effect:w.effect,startMs:t.length*500,durationMs:w.durationMs,easing:w.easing}),u(!1)},[e,t.length,l]),D=Math.max(2e3,...t.map(w=>w.startMs+w.durationMs+(w.delayMs??0)));return a.jsxs("div",{className:`nice-diagram-timeline ${d??""}`,children:[a.jsxs("div",{className:"nice-diagram-timeline__header",children:[a.jsx("h4",{className:"nice-diagram-timeline__title",children:p("animation.timeline")}),a.jsxs("div",{className:"nice-diagram-timeline__controls",children:[c?a.jsxs(me,{className:"nice-diagram-timeline__btn",variant:"ghost",size:"sm",onClick:o,children:["⏹ ",p("animation.stop")]}):a.jsxs(me,{className:"nice-diagram-timeline__btn",variant:"ghost",size:"sm",onClick:n,children:["▶ ",p("animation.play")]}),a.jsxs(me,{className:"nice-diagram-timeline__btn",variant:"ghost",size:"sm",onClick:m,disabled:l.length===0,children:["+ ",p("animation.add")]}),a.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[a.jsx(me,{className:"nice-diagram-timeline__btn",variant:"ghost",size:"sm",onClick:()=>u(w=>!w),disabled:l.length===0,title:"Add from preset",children:"🎬 Presets"}),f&&a.jsx("div",{style:{position:"absolute",bottom:"100%",left:0,background:"#fff",border:"1px solid #ddd",borderRadius:6,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",maxHeight:280,overflowY:"auto",width:200,zIndex:100},children:Qr.map(w=>a.jsx(me,{variant:"ghost",size:"sm",onClick:()=>v(w),style:{display:"block",width:"100%",textAlign:"left",padding:"6px 10px",fontSize:12,borderBottom:"1px solid #f0f0f0"},title:`${w.effect} — ${w.durationMs}ms ${w.easing}`,children:w.name},w.id))})]})]})]}),a.jsxs("div",{className:"nice-diagram-timeline__tracks",children:[t.length===0&&a.jsx("p",{className:"nice-diagram-timeline__empty",children:p("animation.noAnimations")}),t.map(w=>{const k=w.startMs/D*100,b=w.durationMs/D*100,C=y===w.id;return a.jsxs("div",{className:"nice-diagram-timeline__track",children:[a.jsxs("div",{className:"nice-diagram-timeline__track-label",children:[a.jsx("span",{className:"nice-diagram-timeline__track-name",onClick:()=>h(C?null:w.id),style:{cursor:"pointer"},title:"Click to edit",children:w.name}),a.jsx("span",{className:"nice-diagram-timeline__track-effect",children:w.effect}),a.jsx(me,{className:"nice-diagram-timeline__track-remove",variant:"ghost",size:"sm",onClick:()=>r==null?void 0:r(w.id),title:p("toolbar.delete"),children:"×"})]}),C&&a.jsxs("div",{className:"nice-diagram-timeline__track-editor",style:{display:"flex",gap:4,padding:"4px 0",flexWrap:"wrap",fontSize:11},children:[a.jsx(Je,{value:w.effect,onChange:j=>i==null?void 0:i(w.id,{effect:j}),options:Vu.map(j=>({value:j,label:j})),style:{fontSize:11,padding:"1px 4px"}}),a.jsx(Je,{value:w.easing,onChange:j=>i==null?void 0:i(w.id,{easing:j}),options:Ku.map(j=>({value:j,label:j})),style:{fontSize:11,padding:"1px 4px"}}),a.jsx(Je,{value:w.targetId,onChange:j=>{const N=l.find($=>$.id===j);N&&(i==null||i(w.id,{targetId:N.id,targetType:N.type}))},options:l.map(j=>({value:j.id,label:j.label})),style:{fontSize:11,padding:"1px 4px",maxWidth:100}}),a.jsx(ot,{value:w.startMs,min:0,step:100,onChange:j=>i==null?void 0:i(w.id,{startMs:j??0}),style:{width:60,fontSize:11},title:"Start (ms)"}),a.jsx(ot,{value:w.durationMs,min:50,step:50,onChange:j=>i==null?void 0:i(w.id,{durationMs:j??50}),style:{width:60,fontSize:11},title:"Duration (ms)"})]}),a.jsx("div",{className:"nice-diagram-timeline__track-bar",children:a.jsx("div",{className:"nice-diagram-timeline__track-segment",style:{left:`${k}%`,width:`${b}%`},title:`${w.effect} ${w.startMs}ms → ${w.startMs+w.durationMs}ms (${w.easing})`})})]},w.id)})]}),a.jsx("div",{className:"nice-diagram-timeline__ruler",children:Array.from({length:5}).map((w,k)=>{const b=Math.round(D/4*k);return a.jsxs("span",{className:"nice-diagram-timeline__ruler-mark",style:{left:`${k/4*100}%`},children:[b,"ms"]},k)})})]})};cr.displayName="AnimationTimeline";function Gu(t){const e=[];let r;try{r=JSON.parse(t)}catch{return{ok:!1,errors:["Invalid JSON: parse failed"]}}if(typeof r!="object"||r===null||Array.isArray(r))return{ok:!1,errors:["Root must be a JSON object"]};const i=r;if(i.version!=="1.0"&&e.push(`Unsupported version "${String(i.version)}", expected "1.0"`),(typeof i.id!="string"||i.id.length===0)&&e.push('Missing or invalid "id" field'),typeof i.title!="string"&&e.push('Missing or invalid "title" field'),Array.isArray(i.nodes)||e.push('Missing or invalid "nodes" array'),Array.isArray(i.edges)||e.push('Missing or invalid "edges" array'),Array.isArray(i.nodes)&&Array.isArray(i.edges)){const n=new Set(i.nodes.map(o=>o.id).filter(Boolean));for(const o of i.edges)o.sourceNodeId&&!n.has(o.sourceNodeId)&&e.push(`Edge "${o.id}" references non-existent source node "${o.sourceNodeId}"`),o.targetNodeId&&!n.has(o.targetNodeId)&&e.push(`Edge "${o.id}" references non-existent target node "${o.targetNodeId}"`)}return e.length>0?{ok:!1,errors:e}:{ok:!0,document:r,errors:[]}}function tn(t,e=!0){return JSON.stringify(t,null,e?2:void 0)}function Ca(t,e){const r=(e==null?void 0:e.scale)??1,i=(e==null?void 0:e.background)??"transparent";let n=1/0,o=1/0,c=-1/0,l=-1/0;for(const m of t.nodes)n=Math.min(n,m.position.x),o=Math.min(o,m.position.y),c=Math.max(c,m.position.x+m.size.width),l=Math.max(l,m.position.y+m.size.height);t.nodes.length===0&&(n=o=0,c=l=100);const d=40,p=(c-n+d*2)*r,f=(l-o+d*2)*r,u=-n+d,y=-o+d,h=[];h.push(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${p} ${f}" width="${p}" height="${f}">`),h.push("<defs>"),h.push('<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">'),h.push(' <polygon points="0 0, 10 3.5, 0 7" fill="#666" />'),h.push("</marker>"),h.push("</defs>"),i!=="transparent"&&h.push(`<rect width="${p}" height="${f}" fill="${i}" />`),h.push(`<g transform="translate(${u*r}, ${y*r}) scale(${r})">`);for(const m of t.edges){const v=t.nodes.find(x=>x.id===m.sourceNodeId),D=t.nodes.find(x=>x.id===m.targetNodeId);if(!v||!D)continue;const w=v.position.x+v.size.width/2,k=v.position.y+v.size.height/2,b=D.position.x+D.size.width/2,C=D.position.y+D.size.height/2,j=m.style.strokeColor??"#666",N=m.style.strokeWidth??2,$=m.style.targetArrow!=="none"?' marker-end="url(#arrowhead)"':"";if(m.style.lineType==="bezier"){const x=(w+b)/2,F=k,I=(w+b)/2,P=C;h.push(`<path d="M${w},${k} C${x},${F} ${I},${P} ${b},${C}" fill="none" stroke="${j}" stroke-width="${N}"${$} />`)}else h.push(`<line x1="${w}" y1="${k}" x2="${b}" y2="${C}" stroke="${j}" stroke-width="${N}"${$} />`);if(m.label){const x=(w+b)/2,F=(k+C)/2;h.push(`<text x="${x}" y="${F-6}" text-anchor="middle" font-size="12" fill="#333">${Lr(m.label)}</text>`)}}for(const m of t.nodes){const{x:v,y:D}=m.position,{width:w,height:k}=m.size,b=m.style.backgroundColor??"#fff",C=m.style.borderColor??"#ccc",j=m.style.borderWidth??1,N=m.style.borderRadius??(m.shape==="roundedRect"?8:0),$=m.style.fontColor??"#333",x=m.style.fontSize??14;switch(m.shape){case"ellipse":case"circle":h.push(`<ellipse cx="${v+w/2}" cy="${D+k/2}" rx="${w/2}" ry="${k/2}" fill="${b}" stroke="${C}" stroke-width="${j}" />`);break;case"diamond":h.push(`<polygon points="${v+w/2},${D} ${v+w},${D+k/2} ${v+w/2},${D+k} ${v},${D+k/2}" fill="${b}" stroke="${C}" stroke-width="${j}" />`);break;default:h.push(`<rect x="${v}" y="${D}" width="${w}" height="${k}" rx="${N}" fill="${b}" stroke="${C}" stroke-width="${j}" />`)}h.push(`<text x="${v+w/2}" y="${D+k/2+x/3}" text-anchor="middle" font-size="${x}" fill="${$}" font-family="sans-serif">${Lr(m.label)}</text>`)}return h.push("</g>"),h.push("</svg>"),h.join(`
|
|
715
|
+
`)}function an(t){const e=[],r=t.diagramType==="orgchart"||t.diagramType==="mindmap"?"graph TB":t.diagramType==="stateMachine"?"stateDiagram-v2":"flowchart TD";e.push(r);for(const i of t.nodes){const n=ba(i.id),o=i.label.replace(/"/g,"'");switch(i.shape){case"diamond":e.push(` ${n}{${o}}`);break;case"circle":case"ellipse":e.push(` ${n}((${o}))`);break;case"cylinder":e.push(` ${n}[(${o})]`);break;default:e.push(` ${n}["${o}"]`)}}for(const i of t.edges){const n=ba(i.sourceNodeId),o=ba(i.targetNodeId),c=i.label?`|${i.label}|`:"",l=i.style.targetArrow==="none"?"---":"-->";e.push(` ${n} ${l}${c} ${o}`)}return e.join(`
|
|
716
|
+
`)}function ba(t){return t.replace(/[^a-zA-Z0-9_]/g,"_")}function Lr(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const rn=({initialDocument:t,diagramType:e="flowchart",onChange:r,onExport:i,lang:n="en",showToolbar:o=!0,showPropertyPanel:c=!0,showMinimap:l=!0,showTimeline:d=!0,className:p,style:f})=>{var R;const u=Yr(t),[y,h]=s.useState("select"),[m,v]=s.useState(null),D=s.useRef(null),[w,k]=s.useState("editor"),b=s.useRef(null),[C,j]=s.useState({particles:[],liquidFlows:new Map,glowStates:new Map});s.useEffect(()=>{const L=new Ur(O=>{j(O)});return b.current=L,L.start(),()=>{L.stop(),b.current=null}},[]),s.useEffect(()=>{var O;const L=b.current;if(L)for(const Y of u.edges)(O=Y.style.liquidFlow)!=null&&O.active?L.startLiquidFlow(Y.id,Y.style.liquidFlow):L.stopLiquidFlow(Y.id)},[u.edges]),s.useEffect(()=>{const L=b.current;if(L)for(const O of u.nodes)O.style.glowColor?L.setGlow(O.id,O.style.glowColor,O.style.glowIntensity??1):L.removeGlow(O.id)},[u.nodes]);const N=s.useCallback(L=>{u.setStylePreset(L)},[u]),$=s.useCallback((L,O)=>{const Y=u.nodes.find(B=>B.id===L);if(!(Y!=null&&Y.interactions))return;const G=Y.interactions.find(B=>B.id===O);if(G)switch(G.action){case"reveal":{if(G.targetId){const B=u.nodes.find(K=>K.id===G.targetId);B!=null&&B.hidden&&u.updateNode(G.targetId,{hidden:!1})}break}case"navigate":{if(G.targetId){const B=u.nodes.find(K=>K.id===G.targetId);B&&(u.setViewport({x:-B.position.x+300,y:-B.position.y+200,zoom:u.viewport.zoom}),v(G.targetId))}break}case"switchAnimationMode":{G.targetId&&u.setActiveAnimationMode(G.targetId);break}case"highlight":{G.targetId&&v(G.targetId);break}case"toggleCollapse":{u.toggleNodeCollapse(L);break}}},[u]),x=s.useRef(u.document);u.document!==x.current&&(x.current=u.document,r==null||r(u.document));const F=s.useMemo(()=>m?u.nodes.find(L=>L.id===m)??null:null,[m,u.nodes]),I=s.useMemo(()=>m?u.edges.find(L=>L.id===m)??null:null,[m,u.edges]),P=s.useCallback(L=>{const O=u.viewport,Y=(-O.x+400)/O.zoom,G=(-O.y+300)/O.zoom,B=u.addNode("New Node",{x:Y,y:G},L);v(B.id),h("select")},[u]),A=s.useCallback(L=>{u.applyLayout({algorithm:L,centerGraph:!0})},[u]),E=s.useCallback((L,O)=>{u.moveNode(L,O)},[u]),M=s.useCallback((L,O)=>{u.moveNode(L,O)},[u]),W=s.useCallback(L=>{u.nodes.find(O=>O.id===L)?u.removeNode(L):u.edges.find(O=>O.id===L)&&u.removeEdge(L),v(null)},[u]),z=s.useCallback(L=>{const O=u.document;let Y;switch(L){case"ndd":Y=tn(O,!0);break;case"svg":Y=Ca(O);break;case"mermaid":Y=an(O);break;case"png":Y=Ca(O);break}i==null||i(L,Y)},[u,i]),T=s.useCallback(()=>{u.setViewport({...u.viewport,zoom:Math.min(5,u.viewport.zoom*1.2)})},[u]),g=s.useCallback(()=>{u.setViewport({...u.viewport,zoom:Math.max(.1,u.viewport.zoom/1.2)})},[u]),_=s.useCallback(()=>{u.setViewport({x:0,y:0,zoom:1})},[u]),S=s.useMemo(()=>[...u.nodes.map(L=>({id:L.id,label:L.label,type:"node"})),...u.edges.map(L=>({id:L.id,label:L.label??L.id,type:"edge"}))],[u.nodes,u.edges]);return a.jsx(Na,{locale:n,children:a.jsxs("div",{ref:D,className:`nice-diagram-editor ${p??""}`,style:{display:"flex",flexDirection:"column",height:"100%",...f},children:[o&&a.jsx(sr,{activeTool:y,onToolChange:h,diagramType:u.document.diagramType,onAddNode:P,onApplyLayout:A,onUndo:u.undo,onRedo:u.redo,canUndo:u.canUndo,canRedo:u.canRedo,onExport:z,onZoomIn:T,onZoomOut:g,onZoomReset:_,viewMode:w,onViewModeChange:k,stylePresetId:u.stylePresetId,onStylePresetChange:N}),u.animationModes.length>0&&a.jsxs("div",{className:"nice-diagram-editor__mode-tabs",style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid #e0e0e0",background:"#f9f9f9",fontSize:12,alignItems:"center"},children:[a.jsx("span",{style:{color:"#888",marginRight:4},children:"Modes:"}),u.animationModes.map(L=>{var O;return a.jsx(me,{variant:((O=u.activeAnimationMode)==null?void 0:O.id)===L.id?"primary":"ghost",size:"sm",onClick:()=>u.setActiveAnimationMode(L.id),style:{padding:"2px 10px",fontSize:11},children:L.name},L.id)}),a.jsx(me,{variant:"ghost",size:"sm",onClick:()=>u.addAnimationMode(`Mode ${u.animationModes.length+1}`),style:{padding:"2px 8px",fontSize:11,color:"#888"},title:"Add animation mode",children:"+"})]}),a.jsxs("div",{className:"nice-diagram-editor__body",style:{display:"flex",flex:1,overflow:"hidden",position:"relative"},children:[a.jsxs("div",{className:"nice-diagram-editor__canvas",style:{flex:1,position:"relative"},children:[a.jsx(lt,{nodes:u.nodes,edges:u.edges,groups:u.groups,viewport:u.viewport,onViewportChange:u.setViewport,selectedId:m,onSelectElement:v,onNodeDrag:E,onNodeDragEnd:M,interactive:w==="editor",showGrid:w==="editor",particleState:C,viewMode:w,ghostOpacity:((R=u.playerConfig)==null?void 0:R.ghostOpacity)??.3,onGroupCollapse:u.toggleGroupCollapse,onNodeCollapse:u.toggleNodeCollapse,onInteraction:$}),l&&a.jsx("div",{style:{position:"absolute",bottom:8,left:8},children:a.jsx(lr,{nodes:u.nodes,edges:u.edges,viewport:u.viewport,onViewportChange:u.setViewport})})]}),c&&a.jsx("div",{className:"nice-diagram-editor__panel",style:{width:260,borderLeft:"1px solid #ddd",overflowY:"auto"},children:a.jsx(or,{selectedNode:F,selectedEdge:I,onNodeChange:u.updateNode,onEdgeChange:u.updateEdge,onRemove:W})})]}),d&&a.jsx("div",{className:"nice-diagram-editor__timeline",style:{borderTop:"1px solid #ddd"},children:a.jsx(cr,{animations:u.animations,onAdd:u.addAnimation,onRemove:u.removeAnimation,availableTargets:S})})]})})};rn.displayName="NiceDiagramEditor";const Or={linear:t=>t,easeIn:t=>t*t,easeOut:t=>t*(2-t),easeInOut:t=>t<.5?2*t*t:-1+(4-2*t)*t,spring:t=>1-Math.cos(t*Math.PI*.5)*Math.exp(-6*t),bounce:t=>{if(t<1/2.75)return 7.5625*t*t;if(t<2/2.75){const r=t-.5454545454545454;return 7.5625*r*r+.75}if(t<2.5/2.75){const r=t-.8181818181818182;return 7.5625*r*r+.9375}const e=t-2.625/2.75;return 7.5625*e*e+.984375}};function nn(t){return Or[t]??Or.linear}const sn={opacity:1,scale:1,translateX:0,translateY:0,glow:0,highlightColor:"",strokeProgress:1,rippleRadius:0,rippleOpacity:0,typewriterChars:-1,liquidFillProgress:-1,particleTrailT:-1};class on{constructor(e,r){this.startTime=0,this.playing=!1,this.rafId=0,this.stateMap=new Map,this.tick=()=>{if(!this.playing)return;const i=performance.now()-this.startTime;this.stateMap.clear();let n=!1;for(const o of this.animations){const c=o.startMs+(o.delayMs??0);c+o.durationMs;const l=o.repeat??0;let d=i-c;if(d<0){this.stateMap.set(o.targetId,Uu(o)),n=!0;continue}if(l===-1)d=d%o.durationMs,n=!0;else if(l>0){const y=o.durationMs*(l+1);if(d>y)continue;d=d%o.durationMs,n=!0}else{if(d>o.durationMs)continue;n=!0}const p=Math.min(d/o.durationMs,1),f=nn(o.easing)(p),u=Yu(o,f);this.stateMap.set(o.targetId,u)}this.onFrame(this.stateMap),n?this.rafId=requestAnimationFrame(this.tick):this.playing=!1},this.animations=[...e].sort((i,n)=>i.startMs-n.startMs),this.onFrame=r}play(){this.playing||(this.playing=!0,this.startTime=performance.now(),this.tick())}stop(){this.playing=!1,this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.stateMap.clear(),this.onFrame(this.stateMap)}pause(){this.playing=!1,this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0}isPlaying(){return this.playing}}function Yu(t,e){const r={...sn};switch(t.effect){case"fadeIn":r.opacity=e;break;case"fadeOut":r.opacity=1-e;break;case"slideInLeft":r.translateX=-200*(1-e),r.opacity=e;break;case"slideInRight":r.translateX=200*(1-e),r.opacity=e;break;case"slideInTop":r.translateY=-200*(1-e),r.opacity=e;break;case"slideInBottom":r.translateY=200*(1-e),r.opacity=e;break;case"zoomIn":r.scale=e,r.opacity=e;break;case"zoomOut":r.scale=1-e*.5,r.opacity=1-e;break;case"pulse":r.scale=1+.15*Math.sin(e*Math.PI*2);break;case"shake":r.translateX=10*Math.sin(e*Math.PI*6)*(1-e);break;case"highlight":r.highlightColor=`rgba(255, 200, 0, ${.6*(1-Math.abs(2*e-1))})`;break;case"flowPulse":r.opacity=1,r.translateX=e;break;case"bounce":r.translateY=-40*Math.abs(Math.sin(e*Math.PI*3))*(1-e);break;case"glow":r.glow=12*Math.sin(e*Math.PI);break;case"colorShift":r.highlightColor=`hsl(${e*360}, 70%, 60%)`;break;case"liquidFill":r.liquidFillProgress=e;break;case"expand":r.scale=e,r.opacity=e;break;case"collapse":r.scale=1-e,r.opacity=1-e;break;case"ripple":r.rippleRadius=e*40,r.rippleOpacity=1-e;break;case"typewriter":r.typewriterChars=Math.floor(e*100);break;case"morphShape":r.scale=1+.1*Math.sin(e*Math.PI*4)*(1-e),r.translateX=2*Math.sin(e*Math.PI*3)*(1-e);break;case"drawPath":r.strokeProgress=e;break;case"particleTrail":r.particleTrailT=e;break}return r}function Uu(t){const e={...sn};switch(t.effect){case"fadeIn":case"slideInLeft":case"slideInRight":case"slideInTop":case"slideInBottom":case"zoomIn":case"expand":e.opacity=0;break;case"drawPath":e.strokeProgress=0;break;case"typewriter":e.typewriterChars=0;break;case"liquidFill":e.liquidFillProgress=0;break}return e}const ln=({document:t,lang:e="en",autoPlay:r=!1,showControls:i=!0,showGrid:n=!1,className:o,style:c})=>{const[l,d]=s.useState({...t.viewport}),[p,f]=s.useState(new Map),[u,y]=s.useState(!1),h=s.useRef(null),m=s.useCallback(()=>{h.current&&h.current.stop();const b=new on(t.animations,C=>{f(new Map(C)),b.isPlaying()||y(!1)});h.current=b,b.play(),y(!0)},[t.animations]),v=s.useCallback(()=>{var b;(b=h.current)==null||b.stop(),y(!1),f(new Map)},[]);s.useEffect(()=>(r&&t.animations.length>0&&m(),()=>{var b;(b=h.current)==null||b.stop()}),[r]);const D=s.useCallback(()=>d(b=>({...b,zoom:Math.min(5,b.zoom*1.2)})),[]),w=s.useCallback(()=>d(b=>({...b,zoom:Math.max(.1,b.zoom/1.2)})),[]),k=s.useCallback(()=>d({x:0,y:0,zoom:1}),[]);return a.jsx(Na,{locale:e,children:a.jsxs("div",{className:`nice-diagram-viewer ${o??""}`,style:{display:"flex",flexDirection:"column",height:"100%",...c},children:[i&&a.jsx(Zu,{isPlaying:u,hasAnimations:t.animations.length>0,onPlay:m,onStop:v,onZoomIn:D,onZoomOut:w,onZoomReset:k}),a.jsx("div",{style:{flex:1,position:"relative"},children:a.jsx(lt,{nodes:t.nodes,edges:t.edges,groups:t.groups,viewport:l,onViewportChange:d,theme:t.theme,animationStates:p,interactive:!1,showGrid:n})})]})})},Zu=({isPlaying:t,hasAnimations:e,onPlay:r,onStop:i,onZoomIn:n,onZoomOut:o,onZoomReset:c})=>{const{t:l}=Wt();return a.jsxs("div",{className:"nice-diagram-viewer__controls",style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid #ddd",background:"#fafafa"},children:[e&&(t?a.jsxs(me,{className:"nice-diagram-viewer__btn",variant:"ghost",size:"sm",onClick:i,children:["⏹ ",l("animation.stop")]}):a.jsxs(me,{className:"nice-diagram-viewer__btn",variant:"ghost",size:"sm",onClick:r,children:["▶ ",l("animation.play")]})),a.jsx("span",{style:{flex:1}}),a.jsx(me,{className:"nice-diagram-viewer__btn",variant:"ghost",size:"sm",onClick:n,children:"🔍+"}),a.jsx(me,{className:"nice-diagram-viewer__btn",variant:"ghost",size:"sm",onClick:o,children:"🔍−"}),a.jsx(me,{className:"nice-diagram-viewer__btn",variant:"ghost",size:"sm",onClick:c,children:"1:1"})]})};ln.displayName="NiceDiagramViewer";const Xu="_cell_10q3j_9",Ju="_expandable_10q3j_29",Qu="_svg_10q3j_57",ep="_emptyText_10q3j_67",tp="_badge_10q3j_79",ap="_expandIcon_10q3j_117",rp="_modalOverlay_10q3j_165",ip="_modalContent_10q3j_213",np="_modalHeader_10q3j_263",sp="_modalTitle_10q3j_281",op="_modalClose_10q3j_295",lp="_modalBody_10q3j_333",cp="_modalSvg_10q3j_353",dp="_modalFooter_10q3j_367",up="_modalInfo_10q3j_385",tt={cell:Xu,expandable:Ju,svg:Qu,emptyText:ep,badge:tp,expandIcon:ap,modalOverlay:rp,modalContent:ip,modalHeader:np,modalTitle:sp,modalClose:op,modalBody:lp,modalSvg:cp,modalFooter:dp,modalInfo:up},pp=120,mp=48,fp=4,Hr={default:"#3b82f6",process:"#22c55e",decision:"#f59e0b",start:"#6366f1",end:"#ef4444",data:"#8b5cf6",custom:"#64748b"};function dr(t){if(t.length===0)return{minX:0,minY:0,maxX:100,maxY:100,width:100,height:100};let e=1/0,r=1/0,i=-1/0,n=-1/0;for(const o of t){const c=o.position.x,l=o.position.y,d=o.position.x+o.size.width,p=o.position.y+o.size.height;c<e&&(e=c),l<r&&(r=l),d>i&&(i=d),p>n&&(n=p)}return{minX:e,minY:r,maxX:i,maxY:n,width:i-e,height:n-r}}function cn(t){var r;if((r=t.style)!=null&&r.fill)return t.style.fill;const e=t.type??"default";return Hr[e]??Hr.default}function dn(t,e){const r=e.get(t.sourceNodeId),i=e.get(t.targetNodeId);if(!r||!i)return null;const n=r.position.x+r.size.width/2,o=r.position.y+r.size.height/2,c=i.position.x+i.size.width/2,l=i.position.y+i.size.height/2;return`M ${n} ${o} L ${c} ${l}`}function hp(t,e){const r=dr(t);return{id:`mini-diagram-${Date.now()}`,name:"Mini Diagram",nodes:t,edges:e,groups:[],viewport:{x:r.minX-20,y:r.minY-20,zoom:1},animations:[],metadata:{author:"",createdAt:new Date().toISOString(),modifiedAt:new Date().toISOString(),version:"1.0.0",tags:[]}}}const gp=({document:t,onClose:e})=>{const r=dr(t.nodes),i=40,n=r.width+i*2,o=r.height+i*2,c=s.useMemo(()=>new Map(t.nodes.map(l=>[l.id,l])),[t.nodes]);return a.jsx("div",{className:tt.modalOverlay,onClick:e,children:a.jsxs("div",{className:tt.modalContent,onClick:l=>l.stopPropagation(),children:[a.jsxs("div",{className:tt.modalHeader,children:[a.jsx("h3",{className:tt.modalTitle,children:t.name||"Diagram"}),a.jsx("button",{className:tt.modalClose,onClick:e,children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),a.jsx("div",{className:tt.modalBody,children:a.jsxs("svg",{viewBox:`${r.minX-i} ${r.minY-i} ${n} ${o}`,className:tt.modalSvg,children:[t.edges.map(l=>{var p,f,u;const d=dn(l,c);return d?a.jsx("path",{d,stroke:((p=l.style)==null?void 0:p.stroke)??"#64748b",strokeWidth:((f=l.style)==null?void 0:f.strokeWidth)??1.5,fill:"none",markerEnd:(u=l.style)!=null&&u.arrowHead?"url(#arrowhead-modal)":void 0},l.id):null}),t.nodes.map(l=>{var d,p;return a.jsxs("g",{children:[a.jsx("rect",{x:l.position.x,y:l.position.y,width:l.size.width,height:l.size.height,rx:((d=l.style)==null?void 0:d.borderRadius)??4,fill:cn(l),stroke:((p=l.style)==null?void 0:p.stroke)??"#1e293b",strokeWidth:1}),a.jsx("text",{x:l.position.x+l.size.width/2,y:l.position.y+l.size.height/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#ffffff",fontSize:12,fontFamily:"system-ui, sans-serif",children:l.label.substring(0,30)})]},l.id)}),a.jsx("defs",{children:a.jsx("marker",{id:"arrowhead-modal",markerWidth:"10",markerHeight:"7",refX:"9",refY:"3.5",orient:"auto",children:a.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#64748b"})})})]})}),a.jsx("div",{className:tt.modalFooter,children:a.jsxs("span",{className:tt.modalInfo,children:[t.nodes.length," nodes • ",t.edges.length," edges"]})})]})})},yp=({document:t,nodes:e,edges:r,width:i=pp,height:n=mp,showCount:o=!0,expandable:c=!0,onExpand:l,padding:d=fp,backgroundColor:p="transparent",borderRadius:f=4,showLabels:u=!1,edgeColor:y="#94a3b8",tooltip:h})=>{const[m,v]=s.useState(!1),D=s.useMemo(()=>t||(e||r?hp(e??[],r??[]):null),[t,e,r]),w=s.useMemo(()=>D?new Map(D.nodes.map($=>[$.id,$])):new Map,[D]),{bounds:k,scale:b,translateX:C,translateY:j}=s.useMemo(()=>{if(!D||D.nodes.length===0)return{bounds:{minX:0,minY:0,width:100,height:100},scale:1,translateX:0,translateY:0};const $=dr(D.nodes),x=i-d*2,F=n-d*2,I=x/$.width,P=F/$.height,A=Math.min(I,P,1),E=$.width*A,M=$.height*A,W=(i-E)/2-$.minX*A,z=(n-M)/2-$.minY*A;return{bounds:$,scale:A,translateX:W,translateY:z}},[D,i,n,d]),N=s.useCallback(()=>{!D||!c||(l?l(D):v(!0))},[D,c,l]);return!D||D.nodes.length===0?a.jsx("div",{className:tt.cell,style:{width:i,height:n,backgroundColor:p,borderRadius:f},title:h,children:a.jsx("span",{className:tt.emptyText,children:"—"})}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${tt.cell} ${c?tt.expandable:""}`,style:{width:i,height:n,backgroundColor:p,borderRadius:f},onClick:N,title:h??`${D.nodes.length} nodes, ${D.edges.length} edges`,children:[a.jsx("svg",{width:i,height:n,viewBox:`0 0 ${i} ${n}`,className:tt.svg,children:a.jsxs("g",{transform:`translate(${C}, ${j}) scale(${b})`,children:[D.edges.map($=>{const x=dn($,w);return x?a.jsx("path",{d:x,stroke:y,strokeWidth:1/b,fill:"none"},$.id):null}),D.nodes.map($=>{const x=cn($);return a.jsxs("g",{children:[a.jsx("rect",{x:$.position.x,y:$.position.y,width:$.size.width,height:$.size.height,rx:Math.min(4,$.size.width/4),fill:x}),u&&b>.3&&a.jsx("text",{x:$.position.x+$.size.width/2,y:$.position.y+$.size.height/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#ffffff",fontSize:10/b,fontFamily:"system-ui, sans-serif",children:$.label.substring(0,5)})]},$.id)})]})}),o&&a.jsx("span",{className:tt.badge,children:D.nodes.length}),c&&a.jsx("span",{className:tt.expandIcon,children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:a.jsx("path",{d:"M2 10V7M2 10h3M2 10l4-4M10 2v3M10 2H7M10 2L6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})})})]}),m&&D&&a.jsx(gp,{document:D,onClose:()=>v(!1)})]})};function un(t,e,r="roundedRect"){const i=[],n=[],o=new Map;for(const c of t){const l=String(c[e.nodeMapping.idField]??"");if(!l)continue;const d=String(c[e.nodeMapping.labelField]??l),p=e.nodeMapping.descriptionField?String(c[e.nodeMapping.descriptionField]??""):void 0,f=e.nodeMapping.iconField?String(c[e.nodeMapping.iconField]??""):void 0,u=e.nodeMapping.colorField?String(c[e.nodeMapping.colorField]??""):void 0,y={id:`data_${l}`,label:d,description:p,icon:f,position:{x:0,y:0},size:{width:180,height:70},shape:r,style:u?{backgroundColor:u}:{},ports:[{id:"top",side:"top",offset:.5},{id:"right",side:"right",offset:.5},{id:"bottom",side:"bottom",offset:.5},{id:"left",side:"left",offset:.5}],data:c};i.push(y),o.set(l,y)}if(e.nodeMapping.parentField)for(const c of t){const l=String(c[e.nodeMapping.idField]??""),d=String(c[e.nodeMapping.parentField]??"");if(!l||!d)continue;const p=o.get(l),f=o.get(d);!p||!f||n.push({id:`edge_${d}_${l}`,sourceNodeId:f.id,sourcePortId:"bottom",targetNodeId:p.id,targetPortId:"top",style:{lineType:"orthogonal",targetArrow:"arrow"}})}if(e.edgeMapping)for(const c of t){const l=String(c[e.edgeMapping.sourceField]??""),d=String(c[e.edgeMapping.targetField]??"");if(!l||!d)continue;const p=o.get(l),f=o.get(d);if(!p||!f)continue;const u=e.edgeMapping.labelField?String(c[e.edgeMapping.labelField]??""):void 0;n.push({id:`edge_${l}_${d}`,sourceNodeId:p.id,sourcePortId:"right",targetNodeId:f.id,targetPortId:"left",label:u,style:{lineType:"bezier",targetArrow:"arrow"}})}return{nodes:i,edges:n}}async function bp(t,e,r){const i=await fetch(t.sourceUrl,{signal:r});if(!i.ok)throw new Error(`Failed to fetch data: ${i.status} ${i.statusText}`);const n=await i.json(),o=Array.isArray(n)?n:n.value??[];return un(o,t,e)}function xp(t){return{rectangle:"rectangle",roundedRect:"roundedRect",ellipse:"ellipse",circle:"circle",diamond:"diamond",hexagon:"hexagon",cylinder:"cylinder",cloud:"cloud",triangle:"triangle"}[t||"rectangle"]||"rectangle"}function vp(t){return t?{backgroundColor:t.fill,borderColor:t.stroke,borderWidth:t.strokeWidth,fontColor:t.fontColor,fontSize:t.fontSize,borderRadius:t.borderRadius,borderStyle:t.strokeDasharray?"dashed":"solid"}:{}}function kp(t){if(!t)return{};let e="straight";return t.lineType==="orthogonal"?e="orthogonal":t.lineType==="curved"||t.lineType==="bezier"?e="bezier":t.lineType==="step"&&(e="step"),{strokeColor:t.stroke,strokeWidth:t.strokeWidth,strokeDash:t.strokeDasharray?t.strokeDasharray.split(",").map(Number):void 0,lineType:e,sourceArrow:"none",targetArrow:t.arrowHead?"arrow":"none",opacity:t.opacity}}function wp(t){if(t)return{backgroundColor:t.fill,borderColor:t.stroke,borderWidth:t.strokeWidth}}function pn(t){return{id:t.id,label:t.label,position:{x:t.x,y:t.y},size:{width:t.width,height:t.height},shape:xp(t.shape),style:vp(t.style),ports:(t.ports||[]).map((e,r)=>({id:e.id,side:e.position||"right",offset:.5})),data:t.data}}function mn(t,e){var c,l;const r=e.find(d=>d.id===t.source),i=e.find(d=>d.id===t.target),n=t.sourcePort||((c=r==null?void 0:r.ports[0])==null?void 0:c.id)||`${t.source}-out`,o=t.targetPort||((l=i==null?void 0:i.ports[0])==null?void 0:l.id)||`${t.target}-in`;return{id:t.id,sourceNodeId:t.source,sourcePortId:n,targetNodeId:t.target,targetPortId:o,label:t.label,style:kp(t.style),data:t.data}}function fn(t){return{id:t.id,label:t.label,nodeIds:t.nodeIds,style:wp(t.style)}}function hn(t){var e;return{id:t.id,name:t.id,targetId:t.targetId||((e=t.targets)==null?void 0:e[0])||"",targetType:"node",effect:t.type==="highlight"?"highlight":"fadeIn",startMs:t.delay,durationMs:t.duration,easing:"easeInOut"}}function wt(t){const e=t.nodes.map(pn);return e.forEach((r,i)=>{r.ports.length===0&&(r.ports=[{id:`${r.id}-out`,side:"right",offset:.5},{id:`${r.id}-in`,side:"left",offset:.5},{id:`${r.id}-top`,side:"top",offset:.5},{id:`${r.id}-bottom`,side:"bottom",offset:.5}])}),{version:"1.0",id:t.id,title:t.title,diagramType:t.diagramType,nodes:e,edges:t.edges.map(r=>mn(r,e)),groups:(t.groups||[]).map(fn),animations:(t.animations||[]).map(hn),viewport:{x:0,y:0,zoom:1},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),...t.metadata}}}const _p={pending:"#9CA3AF",active:"#3B82F6",completed:"#10B981",failed:"#EF4444",skipped:"#F59E0B",waiting:"#8B5CF6"},Cp={start:"ellipse",end:"ellipse",task:"rectangle",decision:"diamond",parallel:"rectangle",join:"rectangle",subprocess:"rectangle",timer:"ellipse",message:"rectangle",error:"rectangle"},Sp={start:"▶",end:"⬛",task:"📋",decision:"❓",parallel:"⫘",join:"⫗",subprocess:"📦",timer:"⏱",message:"✉",error:"⚠"},jp=({data:t,onStepClick:e,onTransitionClick:r,autoPlay:i=!1,animationDelay:n=1e3,showTooltips:o=!0,showMinimap:c=!0,statusColors:l=_p,typeShapes:d=Cp,direction:p="horizontal",className:f,style:u})=>{const[y,h]=s.useState(0),m=s.useMemo(()=>{const k=t.steps.map((j,N)=>{const $=j.id===t.currentStepId,x=j.status||"pending",F=l[x],I=d[j.type],P=p==="horizontal"?N*200:100,A=p==="horizontal"?100:N*150;return{id:j.id,label:j.name,x:P,y:A,width:150,height:60,shape:I,style:{fill:F,stroke:$?"#1F2937":F,strokeWidth:$?3:1,fontColor:"#FFFFFF",fontSize:12},data:{type:j.type,status:j.status,assignee:j.assignee,dueDate:j.dueDate,icon:Sp[j.type],...j.metadata},ports:[{id:`${j.id}-in`,position:"left"},{id:`${j.id}-out`,position:"right"}]}}),b=t.transitions.map(j=>{const N=t.steps.find(F=>F.id===j.from),$=t.steps.find(F=>F.id===j.to);let x="#9CA3AF";return(N==null?void 0:N.status)==="completed"&&($==null?void 0:$.status)!=="pending"?x="#10B981":(N==null?void 0:N.status)==="failed"&&(x="#EF4444"),{id:j.id,source:j.from,target:j.to,sourcePort:`${j.from}-out`,targetPort:`${j.to}-in`,label:j.label||j.condition,style:{stroke:x,strokeWidth:2,arrowHead:"arrow",lineType:"bezier"},data:{condition:j.condition}}}),C=i?Np(t.steps):[];return wt({id:t.id,title:t.name,diagramType:"flowchart",nodes:k,edges:b,animations:C,metadata:{type:"workflow",...t.metadata}})},[t,l,d,p,i]);s.useEffect(()=>{if(!i)return;const k=t.steps.filter(C=>C.status==="completed").length;if(y>=k)return;const b=setTimeout(()=>{h(C=>C+1)},n);return()=>clearTimeout(b)},[i,y,n,t.steps]),s.useCallback(k=>{if(!e)return;const b=t.steps.find(C=>C.id===k);b&&e(b)},[t.steps,e]);const[v,D]=s.useState({x:0,y:0,zoom:1}),w=s.useCallback(k=>{if(k&&e){const b=t.steps.find(C=>C.id===k);b&&e(b)}if(k&&r){const b=t.transitions.find(C=>C.id===k);b&&r(b)}},[t.steps,t.transitions,e,r]);return a.jsx("div",{className:`nice-workflow-visualizer ${f||""}`,style:{position:"relative",width:"100%",height:"100%",...u},children:a.jsx(lt,{nodes:m.nodes,edges:m.edges,groups:m.groups,viewport:v,onViewportChange:D,onSelectElement:w,showGrid:!0})})};function Np(t){return t.filter(r=>r.status==="completed").map((r,i)=>({id:`anim-${r.id}`,targetId:r.id,type:"highlight",delay:i*500,duration:300,easing:"ease-out"}))}function Mp(t){var o,c;const r=new DOMParser().parseFromString(t,"text/xml"),i=[],n=[];return r.querySelectorAll("startEvent").forEach(l=>{i.push({id:l.getAttribute("id")||`start-${i.length}`,name:l.getAttribute("name")||"Start",type:"start"})}),r.querySelectorAll("task, userTask, serviceTask").forEach(l=>{i.push({id:l.getAttribute("id")||`task-${i.length}`,name:l.getAttribute("name")||"Task",type:"task"})}),r.querySelectorAll("exclusiveGateway, parallelGateway").forEach(l=>{const d=l.tagName==="parallelGateway";i.push({id:l.getAttribute("id")||`gateway-${i.length}`,name:l.getAttribute("name")||(d?"Parallel":"Decision"),type:d?"parallel":"decision"})}),r.querySelectorAll("endEvent").forEach(l=>{i.push({id:l.getAttribute("id")||`end-${i.length}`,name:l.getAttribute("name")||"End",type:"end"})}),r.querySelectorAll("sequenceFlow").forEach(l=>{n.push({id:l.getAttribute("id")||`flow-${n.length}`,from:l.getAttribute("sourceRef")||"",to:l.getAttribute("targetRef")||"",label:l.getAttribute("name")||void 0})}),{id:((o=r.querySelector("process"))==null?void 0:o.getAttribute("id"))||"workflow",name:((c=r.querySelector("process"))==null?void 0:c.getAttribute("name"))||"Workflow",steps:i,transitions:n}}function zp(t,e){const r=[],i=[];r.push({id:"start",name:"Start",type:"start",status:"completed"}),t.forEach((n,o)=>{r.push({id:`step-${o}`,name:n,type:"task",status:"pending"})}),r.push({id:"end",name:"End",type:"end",status:"pending"}),i.push({id:"start-to-first",from:"start",to:"step-0"});for(let n=0;n<t.length-1;n++)i.push({id:`step-${n}-to-${n+1}`,from:`step-${n}`,to:`step-${n+1}`});return i.push({id:"last-to-end",from:`step-${t.length-1}`,to:"end"}),{id:"linear-workflow",name:"Linear Workflow",steps:r,transitions:i}}const $p={dbo:"#3B82F6",public:"#10B981",auth:"#8B5CF6",billing:"#F59E0B",audit:"#EF4444"},Ep={"one-to-one":{left:"1",right:"1"},"one-to-many":{left:"1",right:"*"},"many-to-one":{left:"*",right:"1"},"many-to-many":{left:"*",right:"*"}},Ap=({schema:t,onTableClick:e,onColumnClick:r,onRelationClick:i,showColumnDetails:n=!0,showOnlyKeys:o=!1,highlightTables:c=[],showMinimap:l=!0,schemaColors:d=$p,layout:p="auto",maxColumnsDisplay:f=15,className:u,style:y})=>{const[h,m]=s.useState(null),v=s.useMemo(()=>{const b=Dp(t.tables,p),C=t.tables.map((N,$)=>{const x=b[N.name]||{x:$%4*300,y:Math.floor($/4)*400},F=c.includes(N.name),I=h===N.name,P=d[N.schema||"dbo"]||"#6B7280";let A=N.columns;o&&(A=A.filter(z=>z.primaryKey||z.foreignKey)),A.length>f&&(A=A.slice(0,f));const E=40,M=n?28:20,W=E+A.length*M+10;return{id:N.name,label:N.schema?`${N.schema}.${N.name}`:N.name,x:x.x,y:x.y,width:250,height:W,shape:"rectangle",style:{fill:F||I?P:"#FFFFFF",stroke:P,strokeWidth:I?3:F?2:1,fontColor:F||I?"#FFFFFF":"#1F2937",fontSize:14,borderRadius:8},data:{type:"table",schema:N.schema,columns:A.map(z=>({...z,icon:Tp(z)})),totalColumns:N.columns.length,truncated:N.columns.length>f,comment:N.comment,...N.metadata},ports:[...N.columns.filter(z=>z.primaryKey).map(z=>({id:`${N.name}.${z.name}-pk`,position:"left"})),...N.columns.filter(z=>z.foreignKey).map(z=>({id:`${N.name}.${z.name}-fk`,position:"right"}))]}}),j=t.relations.map(N=>{const $=Ep[N.type];return{id:N.id,source:N.fromTable,target:N.toTable,sourcePort:`${N.fromTable}.${N.fromColumn}-fk`,targetPort:`${N.toTable}.${N.toColumn}-pk`,label:N.name||`${$.left}─${$.right}`,style:{stroke:"#6B7280",strokeWidth:1.5,arrowHead:Fp(N.type),arrowTail:Rp(N.type),lineType:"orthogonal",strokeDasharray:N.type==="many-to-many"?"5,5":void 0},data:{type:N.type,fromColumn:N.fromColumn,toColumn:N.toColumn}}});return wt({id:`schema-${t.name}`,title:t.name,diagramType:"er",nodes:C,edges:j,metadata:{type:"er-diagram",...t.metadata}})},[t,n,o,c,h,d,p,f]);s.useCallback(b=>{if(m(C=>C===b?null:b),e){const C=t.tables.find(j=>j.name===b);C&&e(C)}},[t.tables,e]),s.useCallback(b=>{if(!i)return;const C=t.relations.find(j=>j.id===b);C&&i(C)},[t.relations,i]);const[D,w]=s.useState({x:0,y:0,zoom:1}),k=s.useCallback(b=>{if(b){if(m(C=>C===b?null:b),e){const C=t.tables.find(j=>j.name===b);C&&e(C)}if(i){const C=t.relations.find(j=>j.id===b);C&&i(C)}}},[t.tables,t.relations,e,i]);return a.jsx("div",{className:`nice-database-schema-viewer ${u||""}`,style:{position:"relative",width:"100%",height:"100%",...y},children:a.jsx(lt,{nodes:v.nodes,edges:v.edges,groups:v.groups,viewport:D,onViewportChange:w,onSelectElement:k,showGrid:!0})})};function Dp(t,e){const r={};if(e==="grid"){const i=Math.ceil(Math.sqrt(t.length));t.forEach((n,o)=>{r[n.name]={x:o%i*320+50,y:Math.floor(o/i)*450+50}})}else if(e==="hierarchical"){const i={};t.forEach(o=>{const c=o.schema||"default";i[c]||(i[c]=[]),i[c].push(o)});let n=50;Object.entries(i).forEach(([o,c])=>{c.forEach((l,d)=>{r[l.name]={x:d*320+50,y:n}}),n+=500})}else t.forEach((i,n)=>{const o=n/t.length*2*Math.PI,c=300+t.length*20;r[i.name]={x:Math.cos(o)*c+500,y:Math.sin(o)*c+400}});return r}function Tp(t){return t.primaryKey?"🔑":t.foreignKey?"🔗":t.unique?"⚡":"📄"}function Fp(t){switch(t){case"one-to-one":case"many-to-one":return"none";case"one-to-many":case"many-to-many":return"crow"}}function Rp(t){switch(t){case"one-to-one":case"one-to-many":return"none";case"many-to-one":case"many-to-many":return"crow"}}function Ip(t){const e=[],r=[],i=/CREATE\s+TABLE\s+(?:`?(\w+)`?\.)?`?(\w+)`?\s*\(([\s\S]*?)\);/gi;let n;for(;(n=i.exec(t))!==null;){const o=n[1]||"dbo",c=n[2],l=n[3],d=[],p=/`?(\w+)`?\s+(\w+(?:\([^)]+\))?)\s*(NOT\s+NULL|NULL)?/gi;let f;for(;(f=p.exec(l))!==null;)d.push({name:f[1],type:f[2],nullable:!f[3]||f[3].toUpperCase()!=="NOT NULL"});const u=/PRIMARY\s+KEY\s*\(`?(\w+)`?\)/i.exec(l);if(u){const m=d.find(v=>v.name===u[1]);m&&(m.primaryKey=!0)}const y=/FOREIGN\s+KEY\s*\(`?(\w+)`?\)\s*REFERENCES\s+`?(\w+)`?\s*\(`?(\w+)`?\)/gi;let h;for(;(h=y.exec(l))!==null;){const m=h,v=d.find(D=>D.name===m[1]);v&&(v.foreignKey={table:m[2],column:m[3]},r.push({id:`fk-${c}-${m[1]}`,fromTable:c,fromColumn:m[1],toTable:m[2],toColumn:m[3],type:"many-to-one"}))}e.push({name:c,schema:o,columns:d})}return{name:"Parsed Schema",tables:e,relations:r}}function Pp(t,e="postgres"){const r=[];for(const i of t.tables){const n=i.schema?`${i.schema}.${i.name}`:i.name;r.push(`CREATE TABLE ${n} (`);const o=i.columns.map(l=>{let d=` ${l.name} ${l.type}`;return l.nullable||(d+=" NOT NULL"),l.primaryKey&&(d+=" PRIMARY KEY"),l.unique&&(d+=" UNIQUE"),l.defaultValue&&(d+=` DEFAULT ${l.defaultValue}`),d}),c=i.columns.filter(l=>l.foreignKey).map(l=>` FOREIGN KEY (${l.name}) REFERENCES ${l.foreignKey.table}(${l.foreignKey.column})`);r.push([...o,...c].join(`,
|
|
717
|
+
`)),r.push(`);
|
|
718
|
+
`)}return r.join(`
|
|
719
|
+
`)}const Lp={active:"#10B981",away:"#F59E0B",busy:"#EF4444",offline:"#6B7280",vacation:"#8B5CF6",leave:"#3B82F6"},ra=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899","#14B8A6","#6366F1"],Op=({data:t,rootEmployeeId:e,onEmployeeClick:r,onDepartmentClick:i,showAvatars:n=!0,showContactInfo:o=!1,groupByDepartment:c=!0,collapsedDepartments:l=[],maxLevels:d=0,orientation:p="vertical",spacing:f={horizontal:200,vertical:150},statusColors:u=Lp,showMinimap:y=!0,className:h,style:m})=>{const[v,D]=s.useState(new Set),[w,k]=s.useState(null),b=s.useMemo(()=>{var I;if(e)return e;const F=t.employees.find(P=>!P.managerId);return(F==null?void 0:F.id)||((I=t.employees[0])==null?void 0:I.id)},[t.employees,e]),C=s.useMemo(()=>Hp(t.employees,b),[t.employees,b]),j=s.useMemo(()=>{const F=Wp(C,p,f,d),I=[],P={};c&&t.departments&&t.departments.forEach((W,z)=>{const T=W.color||ra[z%ra.length];P[W.id]=T;const g=t.employees.filter(_=>_.department===W.id);g.length!==0&&I.push({id:`dept-${W.id}`,label:W.name,nodeIds:g.map(_=>_.id),style:{fill:`${T}15`,stroke:T,strokeWidth:2},data:{department:W}})});const A=[],E=[],M=(W,z=0)=>{if(d>0&&z>=d||W.employee.department&&l.includes(W.employee.department))return;const T=F[W.employee.id]||{x:0,y:0},g=w===W.employee.id,_=W.employee.status||"active",S=W.employee.department?P[W.employee.department]:"#6B7280",R=180,L=o?120:n?90:70;A.push({id:W.employee.id,label:W.employee.name,x:T.x,y:T.y,width:R,height:L,shape:"rectangle",style:{fill:g?S:"#FFFFFF",stroke:S,strokeWidth:g?3:1,fontColor:g?"#FFFFFF":"#1F2937",fontSize:13,borderRadius:12},data:{type:"employee",employee:W.employee,statusColor:u[_],hasChildren:W.children.length>0,childrenCount:W.children.length}}),W.employee.managerId&&E.push({id:`rel-${W.employee.managerId}-${W.employee.id}`,source:W.employee.managerId,target:W.employee.id,style:{stroke:"#CBD5E1",strokeWidth:2,arrowHead:"none",lineType:p==="vertical"?"orthogonal":"curved"}}),W.children.forEach(O=>M(O,z+1))};return C&&M(C),wt({id:"org-chart",title:"Organization Chart",diagramType:"orgchart",nodes:A,edges:E,groups:I,metadata:{type:"org-chart",...t.metadata}})},[t,C,p,f,d,c,l,n,o,u,w]);s.useCallback(F=>{if(k(I=>I===F?null:F),D(I=>{const P=new Set(I);return P.has(F)?P.delete(F):P.add(F),P}),r){const I=t.employees.find(P=>P.id===F);I&&r(I)}},[t.employees,r]),s.useCallback(F=>{if(!i||!t.departments)return;const I=F.replace("dept-",""),P=t.departments.find(A=>A.id===I);P&&i(P)},[t.departments,i]);const[N,$]=s.useState({x:0,y:0,zoom:1}),x=s.useCallback(F=>{if(F&&(k(I=>I===F?null:F),r)){const I=t.employees.find(P=>P.id===F);I&&r(I)}},[t.employees,r]);return a.jsx("div",{className:`nice-org-chart-visualizer ${h||""}`,style:{position:"relative",width:"100%",height:"100%",...m},children:a.jsx(lt,{nodes:j.nodes,edges:j.edges,groups:j.groups,viewport:N,onViewportChange:$,onSelectElement:x,showGrid:!1})})};function Hp(t,e){const i=new Map(t.map(o=>[o.id,o])).get(e);if(!i)return null;const n=(o,c)=>{const l=t.filter(d=>d.managerId===o.id);return{employee:o,children:l.map(d=>n(d,c+1)),level:c}};return n(i,0)}function Wp(t,e,r,i){const n={};if(!t)return n;const o=(d,p)=>i>0&&p>=i?0:d.children.length===0?1:d.children.reduce((f,u)=>f+o(u,p+1),0),c=(d,p,f,u)=>{if(i>0&&p>=i)return;const y=f+u*r.horizontal/2,h=p*r.vertical+50;n[d.employee.id]=e==="vertical"?{x:y,y:h}:{x:h,y};let m=f;d.children.forEach(v=>{const D=o(v,p+1);c(v,p+1,m,D),m+=D*r.horizontal})},l=o(t,0);return c(t,0,0,l),n}function Bp(t){const r=[...new Set(t.map(i=>i.department).filter(Boolean))].map((i,n)=>({id:i,name:i,color:ra[n%ra.length],headcount:t.filter(o=>o.department===i).length}));return{employees:t,departments:r}}function qp(t){var l;const e=new Set(t.employees.map(d=>d.managerId).filter(Boolean)),r=(d,p=new Set)=>{if(p.has(d))return 0;p.add(d);const f=t.employees.find(u=>u.id===d);return f!=null&&f.managerId?1+r(f.managerId,p):1},i=t.employees.map(d=>r(d.id)),n=Math.max(...i,0),o=Array.from(e).map(d=>t.employees.filter(p=>p.managerId===d).length),c=o.length>0?o.reduce((d,p)=>d+p,0)/o.length:0;return{totalEmployees:t.employees.length,departmentCount:((l=t.departments)==null?void 0:l.length)||0,maxDepth:n,averageSpan:Math.round(c*10)/10,managers:e.size}}const Vp=({data:t,onActivityClick:e,onTransitionClick:r,minEdgeFrequency:i=.05,showFrequency:n=!0,showDuration:o=!0,highlightBottlenecks:c=!0,bottleneckThreshold:l=.9,colorScheme:d="frequency",activityColors:p,layout:f="hierarchical",animationSpeed:u=0,showMinimap:y=!0,className:h,style:m})=>{const[v,D]=s.useState(null),w=s.useMemo(()=>"activities"in t?t:gn(t),[t]),k=s.useMemo(()=>{if(!c)return new Set;const $=w.activities.filter(F=>F.avgDuration!==void 0).map(F=>F.avgDuration);if($.length===0)return new Set;$.sort((F,I)=>F-I);const x=$[Math.floor($.length*l)]||0;return new Set(w.activities.filter(F=>(F.avgDuration||0)>=x).map(F=>F.name))},[w.activities,c,l]),b=s.useMemo(()=>{const $=Math.max(...w.activities.map(E=>E.frequency),1),x=Kp(w,f),F=w.transitions.filter(E=>E.frequency/w.totalCases>=i),I=w.activities.map(E=>{const M=x[E.name]||{x:0,y:0},W=w.startActivities.includes(E.name),z=w.endActivities.includes(E.name),T=k.has(E.name),g=v===E.name,_=Yp(E,d,$,p,T);return{id:E.name,label:E.name,x:M.x,y:M.y,width:140,height:60,shape:W?"ellipse":z?"roundedRect":"rectangle",style:{fill:g?_:"#FFFFFF",stroke:_,strokeWidth:T?4:g?3:2,fontColor:g?"#FFFFFF":"#1F2937",fontSize:12,borderRadius:z?20:8},data:{type:"activity",activity:E,isStart:W,isEnd:z,isBottleneck:T,frequencyPercent:Math.round(E.frequency/w.totalCases*100)}}}),P=F.map((E,M)=>{const W=E.probability||E.frequency/w.totalCases,z=W>.5,T=[];return n&&T.push(`${E.frequency}x`),o&&E.avgDuration&&T.push(Up(E.avgDuration)),{id:`trans-${M}`,source:E.from,target:E.to,label:T.join(" | "),style:{stroke:z?"#3B82F6":"#9CA3AF",strokeWidth:Math.max(1,Math.min(6,W*8)),arrowHead:"triangle",lineType:"curved",opacity:Math.max(.3,W)},data:{type:"transition",transition:E,probability:W}}}),A=u>0?Zp(w,u):[];return wt({id:"process-mining",title:"Process Mining Diagram",diagramType:"flowchart",nodes:I,edges:P,animations:A,metadata:{type:"process-mining",totalCases:w.totalCases,avgCaseDuration:w.avgCaseDuration}})},[w,i,n,o,c,k,d,p,f,u,v]);s.useCallback($=>{if(D(x=>x===$?null:$),e){const x=w.activities.find(F=>F.name===$);x&&e(x)}},[w.activities,e]),s.useCallback($=>{if(!r)return;const x=parseInt($.replace("trans-",""),10),F=w.transitions[x];F&&r(F)},[w.transitions,r]);const[C,j]=s.useState({x:0,y:0,zoom:1}),N=s.useCallback($=>{if($&&(D(x=>x===$?null:$),e)){const x=w.activities.find(F=>F.name===$);x&&e(x)}},[w.activities,e]);return a.jsx("div",{className:`nice-process-mining-diagram ${h||""}`,style:{position:"relative",width:"100%",height:"100%",...m},children:a.jsx(lt,{nodes:b.nodes,edges:b.edges,groups:b.groups,viewport:C,onViewportChange:j,onSelectElement:N,showGrid:!0})})};function Kp(t,e){const r={};if(e==="circular"){const i=t.activities;i.forEach((n,o)=>{const c=o/i.length*2*Math.PI-Math.PI/2,l=200+i.length*15;r[n.name]={x:Math.cos(c)*l+400,y:Math.sin(c)*l+300}})}else{const i=Gp(t),n={};t.activities.forEach(c=>{const l=i[c.name]||0;n[l]=(n[l]||0)+1});const o={};t.activities.forEach(c=>{const l=i[c.name]||0,d=o[l]||0;o[l]=d+1;const p=n[l],f=(d-(p-1)/2)*180;r[c.name]={x:400+f,y:50+l*120}})}return r}function Gp(t){const e={},r=new Set,i=t.startActivities.map(n=>({activity:n,level:0}));for(;i.length>0;){const{activity:n,level:o}=i.shift();if(r.has(n))continue;r.add(n),e[n]=o,t.transitions.filter(l=>l.from===n).forEach(l=>{r.has(l.to)||i.push({activity:l.to,level:o+1})})}return t.activities.forEach(n=>{e[n.name]===void 0&&(e[n.name]=0)}),e}function Yp(t,e,r,i,n){if(n)return"#EF4444";if(i!=null&&i[t.name])return i[t.name];const o=t.frequency/r;switch(e){case"frequency":return xa("#10B981","#3B82F6",o);case"duration":return t.avgDuration?xa("#10B981","#F59E0B",o):"#6B7280";case"cost":return t.avgCost?xa("#10B981","#EF4444",o):"#6B7280";default:return"#3B82F6"}}function xa(t,e,r){const i=p=>{const f=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(p);return f?{r:parseInt(f[1],16),g:parseInt(f[2],16),b:parseInt(f[3],16)}:{r:0,g:0,b:0}},n=i(t),o=i(e),c=Math.round(n.r+(o.r-n.r)*r),l=Math.round(n.g+(o.g-n.g)*r),d=Math.round(n.b+(o.b-n.b)*r);return`#${[c,l,d].map(p=>p.toString(16).padStart(2,"0")).join("")}`}function Up(t){return t<1e3?`${t}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:t<36e5?`${(t/6e4).toFixed(1)}m`:t<864e5?`${(t/36e5).toFixed(1)}h`:`${(t/864e5).toFixed(1)}d`}function Zp(t,e){var i;const r=(i=t.variants)==null?void 0:i[0];return r?r.activities.map((n,o)=>({id:`flow-${o}`,type:"highlight",targets:[n],duration:e,delay:o*e})):[]}function gn(t){const e=t.events.map(h=>({...h,timestamp:h.timestamp instanceof Date?h.timestamp:new Date(h.timestamp)})),r=new Map;e.forEach(h=>{r.has(h.caseId)||r.set(h.caseId,[]),r.get(h.caseId).push(h)}),r.forEach(h=>{h.sort((m,v)=>m.timestamp.getTime()-v.timestamp.getTime())});const i=new Map,n=new Map,o=new Set,c=new Set;r.forEach(h=>{if(h.length!==0){o.add(h[0].activity),c.add(h[h.length-1].activity);for(let m=0;m<h.length;m++){const v=h[m];i.has(v.activity)||i.set(v.activity,{frequency:0,durations:[],resources:new Set,costs:[]});const D=i.get(v.activity);if(D.frequency++,v.resource&&D.resources.add(v.resource),v.cost!==void 0&&D.costs.push(v.cost),m<h.length-1){const w=h[m+1],k=w.timestamp.getTime()-v.timestamp.getTime();D.durations.push(k);const b=`${v.activity}→${w.activity}`;n.has(b)||n.set(b,{frequency:0,durations:[]});const C=n.get(b);C.frequency++,C.durations.push(k)}}}});const l=Array.from(i.entries()).map(([h,m])=>({name:h,frequency:m.frequency,avgDuration:m.durations.length>0?m.durations.reduce((v,D)=>v+D,0)/m.durations.length:void 0,minDuration:m.durations.length>0?Math.min(...m.durations):void 0,maxDuration:m.durations.length>0?Math.max(...m.durations):void 0,resources:Array.from(m.resources),avgCost:m.costs.length>0?m.costs.reduce((v,D)=>v+D,0)/m.costs.length:void 0})),d=Array.from(n.entries()).map(([h,m])=>{const[v,D]=h.split("→");return{from:v,to:D,frequency:m.frequency,avgDuration:m.durations.length>0?m.durations.reduce((w,k)=>w+k,0)/m.durations.length:void 0,probability:m.frequency/r.size}}),p=new Map;r.forEach((h,m)=>{const v=h.map(w=>w.activity).join("→");p.has(v)||p.set(v,{caseIds:[],durations:[]});const D=p.get(v);if(D.caseIds.push(m),h.length>=2){const w=h[h.length-1].timestamp.getTime()-h[0].timestamp.getTime();D.durations.push(w)}});const f=Array.from(p.entries()).map(([h,m])=>({activities:h.split("→"),frequency:m.caseIds.length,avgDuration:m.durations.length>0?m.durations.reduce((v,D)=>v+D,0)/m.durations.length:0,caseIds:m.caseIds})).sort((h,m)=>m.frequency-h.frequency),u=Array.from(r.values()).filter(h=>h.length>=2).map(h=>h[h.length-1].timestamp.getTime()-h[0].timestamp.getTime()),y=u.length>0?u.reduce((h,m)=>h+m,0)/u.length:void 0;return{activities:l,transitions:d,variants:f,startActivities:Array.from(o),endActivities:Array.from(c),totalCases:r.size,avgCaseDuration:y}}const yn={module:"#3B82F6",package:"#10B981",microservice:"#8B5CF6",library:"#F59E0B",api:"#EC4899",database:"#14B8A6",external:"#6B7280",deprecated:"#EF4444"},bn={healthy:"#10B981",warning:"#F59E0B",critical:"#EF4444",unknown:"#6B7280",deprecated:"#9CA3AF"},Wr={import:{color:"#3B82F6"},runtime:{color:"#10B981"},dev:{color:"#6B7280",dash:"5,5"},peer:{color:"#F59E0B",dash:"10,5"},"api-call":{color:"#8B5CF6"},database:{color:"#14B8A6"},event:{color:"#EC4899",dash:"2,2"},circular:{color:"#EF4444"}},Xp={module:"📦",package:"📁",microservice:"🔲",library:"📚",api:"🔌",database:"🗄️",external:"🌐",deprecated:"⚠️"},Jp=({data:t,onNodeClick:e,onEdgeClick:r,visibleTypes:i,visibleEdgeTypes:n,highlightCircular:o=!0,showOnlyIssues:c=!1,layout:l="force",groupBy:d="type",nodeSizeBy:p="dependencies",colorScheme:f="type",nodeColors:u,showMetrics:y=!0,interactive:h=!0,showMinimap:m=!0,className:v,style:D})=>{const[w,k]=s.useState(null),[b,C]=s.useState(null),j=s.useMemo(()=>o?xn(t):new Set,[t,o]),N=s.useMemo(()=>{let A=t.nodes;return i&&i.length>0&&(A=A.filter(E=>i.includes(E.type))),c&&(A=A.filter(E=>{var M;return E.status==="critical"||E.status==="warning"||((M=E.metrics)==null?void 0:M.issues)&&E.metrics.issues>0})),A},[t.nodes,i,c]),$=s.useMemo(()=>{const A=new Set(N.map(M=>M.id));let E=t.edges.filter(M=>A.has(M.source)&&A.has(M.target));return n&&n.length>0&&(E=E.filter(M=>n.includes(M.type))),E},[t.edges,N,n]),x=s.useMemo(()=>{const A=Qp(N,$,l),E=tm(N,p),M=[];if(d!=="none"){const T=new Map;N.forEach(_=>{const S=d==="type"?_.type:_.group||"ungrouped";T.has(S)||T.set(S,[]),T.get(S).push(_.id)});let g=0;T.forEach((_,S)=>{var L,O;const R=d==="type"?yn[S]||"#6B7280":((O=(L=t.groups)==null?void 0:L.find(Y=>Y.id===S))==null?void 0:O.color)||ia[g%ia.length];M.push({id:`group-${S}`,label:S,nodeIds:_,style:{fill:`${R}10`,stroke:R,strokeWidth:1}}),g++})}const W=N.map(T=>{const g=A[T.id]||{x:0,y:0},_=w===T.id,S=b===T.id,R=j.has(T.id),L=am(T,p,E),O=rm(T,f,u,R);return{id:T.id,label:T.name,x:g.x,y:g.y,width:L.width,height:L.height,shape:im(T.type),style:{fill:_||S?O:"#FFFFFF",stroke:O,strokeWidth:R?4:_?3:2,fontColor:_||S?"#FFFFFF":"#1F2937",fontSize:11,borderRadius:8,strokeDasharray:T.status==="deprecated"?"4,4":void 0},data:{type:"dependency",node:T,icon:Xp[T.type],isCircular:R,statusColor:bn[T.status||"unknown"]}}}),z=$.map((T,g)=>{const _=T.type==="circular"||j.has(T.source)&&j.has(T.target),S=Wr[T.type]||Wr.import;return{id:T.id||`edge-${g}`,source:T.source,target:T.target,label:T.optional?"(optional)":void 0,style:{stroke:_?"#EF4444":S.color,strokeWidth:Math.max(1,Math.min(4,T.weight||1)),strokeDasharray:S.dash,arrowHead:"triangle",lineType:"curved",opacity:T.optional?.5:1},data:{type:T.type,edge:T,isCircular:_}}});return wt({id:"dependency-graph",title:"Dependency Graph",diagramType:"custom",nodes:W,edges:z,groups:M,metadata:{type:"dependency-graph",...t.metadata}})},[N,$,l,d,t.groups,p,f,u,j,w,b]);s.useCallback(A=>{if(k(E=>E===A?null:A),e){const E=t.nodes.find(M=>M.id===A);E&&e(E)}},[t.nodes,e]),s.useCallback(A=>{if(!r)return;const E=t.edges.find(M=>M.id===A);E&&r(E)},[t.edges,r]),s.useCallback(A=>{C(A)},[]);const[F,I]=s.useState({x:0,y:0,zoom:1}),P=s.useCallback(A=>{if(A){if(k(E=>E===A?null:A),e){const E=t.nodes.find(M=>M.id===A);E&&e(E)}if(r){const E=t.edges.find(M=>M.id===A);E&&r(E)}}},[t.nodes,t.edges,e,r]);return a.jsx("div",{className:`nice-dependency-graph ${v||""}`,style:{position:"relative",width:"100%",height:"100%",...D},children:a.jsx(lt,{nodes:x.nodes,edges:x.edges,groups:x.groups,viewport:F,onViewportChange:I,onSelectElement:P,interactive:h,showGrid:!0})})},ia=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899","#14B8A6","#6366F1"];function xn(t){const e=new Set,r=new Map;t.nodes.forEach(c=>r.set(c.id,[])),t.edges.forEach(c=>{var l;(l=r.get(c.source))==null||l.push(c.target)});const i=new Set,n=new Set,o=(c,l)=>{i.add(c),n.add(c),l.push(c);const d=r.get(c)||[];for(const p of d)if(i.has(p)){if(n.has(p)){const f=l.indexOf(p);l.slice(f).forEach(y=>e.add(y))}}else if(o(p,[...l]))return!0;return n.delete(c),!1};return t.nodes.forEach(c=>{i.has(c.id)||o(c.id,[])}),e}function Qp(t,e,r){const i={};switch(r){case"circular":{t.forEach((n,o)=>{const c=o/t.length*2*Math.PI-Math.PI/2,l=150+t.length*12;i[n.id]={x:Math.cos(c)*l+400,y:Math.sin(c)*l+300}});break}case"grid":{const n=Math.ceil(Math.sqrt(t.length));t.forEach((o,c)=>{i[o.id]={x:c%n*200+100,y:Math.floor(c/n)*150+100}});break}case"hierarchical":{const n=em(t,e),o={},c={};t.forEach(l=>{const d=n[l.id]||0;o[d]=(o[d]||0)+1}),t.forEach(l=>{const d=n[l.id]||0,p=c[d]||0;c[d]=p+1;const f=o[d],u=(p-(f-1)/2)*200;i[l.id]={x:400+u,y:80+d*130}});break}default:{t.forEach((n,o)=>{const c=o/t.length*2*Math.PI,l=200+t.length*10;i[n.id]={x:Math.cos(c)*l+400,y:Math.sin(c)*l+300}});for(let n=0;n<50;n++){const o={};t.forEach(c=>o[c.id]={x:0,y:0});for(let c=0;c<t.length;c++)for(let l=c+1;l<t.length;l++){const d=t[c].id,p=t[l].id,f=i[p].x-i[d].x,u=i[p].y-i[d].y,y=Math.max(1,Math.sqrt(f*f+u*u)),h=5e3/(y*y);o[d].x-=f/y*h,o[d].y-=u/y*h,o[p].x+=f/y*h,o[p].y+=u/y*h}e.forEach(c=>{const l=i[c.target].x-i[c.source].x,d=i[c.target].y-i[c.source].y,p=Math.sqrt(l*l+d*d),f=p*.01;o[c.source].x+=l/p*f,o[c.source].y+=d/p*f,o[c.target].x-=l/p*f,o[c.target].y-=d/p*f}),t.forEach(c=>{i[c.id].x+=Math.max(-10,Math.min(10,o[c.id].x)),i[c.id].y+=Math.max(-10,Math.min(10,o[c.id].y))})}break}}return i}function em(t,e){const r={},i={};t.forEach(o=>{r[o.id]=0,i[o.id]=0}),e.forEach(o=>{i[o.target]=(i[o.target]||0)+1});const n=t.filter(o=>i[o.id]===0).map(o=>o.id);for(;n.length>0;){const o=n.shift();e.filter(l=>l.source===o).forEach(l=>{r[l.target]=Math.max(r[l.target],r[o]+1),i[l.target]--,i[l.target]===0&&n.push(l.target)})}return r}function tm(t,e){const r=t.map(i=>{var n,o,c;switch(e){case"dependencies":return((n=i.metrics)==null?void 0:n.dependencies)||0;case"dependents":return((o=i.metrics)==null?void 0:o.dependents)||0;case"complexity":return((c=i.metrics)==null?void 0:c.complexity)||0;case"size":return i.size||0;default:return 1}});return{min:Math.min(...r,0),max:Math.max(...r,1)}}function am(t,e,r){var d,p,f;if(e==="fixed")return{width:140,height:70};let i;switch(e){case"dependencies":i=((d=t.metrics)==null?void 0:d.dependencies)||0;break;case"dependents":i=((p=t.metrics)==null?void 0:p.dependents)||0;break;case"complexity":i=((f=t.metrics)==null?void 0:f.complexity)||0;break;case"size":i=t.size||0;break;default:i=1}const n=r.max>r.min?(i-r.min)/(r.max-r.min):.5,o=100,l=o+n*(180-o);return{width:l,height:l*.5}}function rm(t,e,r,i){if(i)return"#EF4444";if(r!=null&&r[t.id])return r[t.id];switch(e){case"status":return bn[t.status||"unknown"];case"group":return ia[nm(t.group||"")%ia.length];default:return yn[t.type]||"#6B7280"}}function im(t){switch(t){case"database":return"cylinder";case"microservice":return"hexagon";case"api":return"diamond";case"external":return"cloud";default:return"rectangle"}}function nm(t){let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}function sm(t){const e=[{id:t.name,name:t.name,version:t.version,type:"package",status:"healthy"}],r=[];let i=0;const n=(o,c)=>{o&&Object.entries(o).forEach(([l,d])=>{e.find(p=>p.id===l)||e.push({id:l,name:l,version:d.replace(/[\^~>=<]/g,""),type:"library",status:"unknown"}),r.push({id:`edge-${i++}`,source:t.name,target:l,type:c})})};return n(t.dependencies,"runtime"),n(t.devDependencies,"dev"),n(t.peerDependencies,"peer"),e.forEach(o=>{o.metrics={dependencies:r.filter(c=>c.source===o.id).length,dependents:r.filter(c=>c.target===o.id).length}}),{nodes:e,edges:r}}function om(t){const e=new Map,r=new Map;t.nodes.forEach(f=>{e.set(f.id,0),r.set(f.id,0)}),t.edges.forEach(f=>{e.set(f.target,(e.get(f.target)||0)+1),r.set(f.source,(r.get(f.source)||0)+1)}),xn(t);let i=null,n=0;t.nodes.forEach(f=>{const u=e.get(f.id)||0;u>n&&(n=u,i=f)});let o=null,c=0;t.nodes.forEach(f=>{const u=r.get(f.id)||0;u>c&&(c=u,o=f)});const l=t.nodes.filter(f=>(e.get(f.id)||0)===0&&(r.get(f.id)||0)===0),d=Array.from(r.values()).reduce((f,u)=>f+u,0),p=t.nodes.length>0?d/t.nodes.length:0;return{totalNodes:t.nodes.length,totalEdges:t.edges.length,circularDependencies:[],mostDependent:i,mostDependencies:o,orphanNodes:l,avgDependencies:Math.round(p*10)/10}}const lm={online:"#10B981",offline:"#6B7280",warning:"#F59E0B",critical:"#EF4444",maintenance:"#3B82F6",unknown:"#9CA3AF"},cm={router:"🔀",switch:"🔌",firewall:"🛡️",server:"🖥️",workstation:"💻",laptop:"💻",phone:"📱",printer:"🖨️",camera:"📷",iot:"📡",loadbalancer:"⚖️",storage:"💾",cloud:"☁️",internet:"🌐",unknown:"❓"},dm={ethernet:"#3B82F6",fiber:"#10B981",wireless:"#8B5CF6",vpn:"#F59E0B",wan:"#EC4899",trunk:"#14B8A6"},um=({data:t,onDeviceClick:e,onConnectionClick:r,onRefresh:i,autoRefreshInterval:n=0,visibleDeviceTypes:o,showOnlyIssues:c=!1,layout:l="hierarchical",groupBy:d="group",showMetrics:p=!0,showBandwidth:f=!0,showLatency:u=!1,animateTraffic:y=!1,statusColors:h=lm,showMinimap:m=!0,className:v,style:D})=>{const[w,k]=s.useState(null),[b,C]=s.useState(new Date);s.useEffect(()=>{if(n<=0||!i)return;const P=setInterval(()=>{i(),C(new Date)},n);return()=>clearInterval(P)},[n,i]);const j=s.useMemo(()=>{let P=t.devices;return o&&o.length>0&&(P=P.filter(A=>o.includes(A.type))),c&&(P=P.filter(A=>A.status==="critical"||A.status==="warning"||A.status==="offline")),P},[t.devices,o,c]),N=s.useMemo(()=>{const P=new Set(j.map(A=>A.id));return t.connections.filter(A=>P.has(A.source)&&P.has(A.target))},[t.connections,j]),$=s.useMemo(()=>{const P=pm(j,N,l,t.groups),A=[];if(d!=="none"){const z=new Map;j.forEach(g=>{let _;switch(d){case"type":_=g.type;break;case"location":_=g.location||"Unknown Location";break;default:_=g.group||"ungrouped"}z.has(_)||z.set(_,[]),z.get(_).push(g.id)});let T=0;z.forEach((g,_)=>{var L;const S=(L=t.groups)==null?void 0:L.find(O=>O.id===_||O.name===_),R=(S==null?void 0:S.color)||Br[T%Br.length];A.push({id:`group-${_}`,label:(S==null?void 0:S.name)||_,nodeIds:g,style:{fill:`${R}15`,stroke:R,strokeWidth:2}}),T++})}const E=j.map(z=>{const T=P[z.id]||{x:0,y:0},g=w===z.id,_=h[z.status],S=cm[z.type];return{id:z.id,label:z.name,x:T.x,y:T.y,width:120,height:p?90:70,shape:mm(z.type),style:{fill:g?_:"#FFFFFF",stroke:_,strokeWidth:g?3:2,fontColor:g?"#FFFFFF":"#1F2937",fontSize:11,borderRadius:8},data:{type:"network-device",device:z,icon:S,statusColor:_}}}),M=N.map((z,T)=>{const g=dm[z.type]||"#6B7280",_=z.status==="active",S=z.status==="degraded"||z.status==="error",R=[];if(f&&z.bandwidth){const L=Math.round(z.bandwidth.used/z.bandwidth.total*100);R.push(`${L}%`)}return u&&z.latency!==void 0&&R.push(`${z.latency}ms`),{id:z.id||`conn-${T}`,source:z.source,target:z.target,sourcePort:z.sourcePort,targetPort:z.targetPort,label:R.join(" | ")||void 0,style:{stroke:S?"#EF4444":g,strokeWidth:Math.max(1,Math.min(6,(z.speed||1e3)/1e3)),strokeDasharray:_?void 0:"5,5",arrowHead:"none",lineType:z.type==="wireless"?"curved":"orthogonal",opacity:z.status==="inactive"?.3:1},data:{type:z.type,connection:z,isActive:_,isDegraded:S}}}),W=y?fm(N):[];return wt({id:"network-topology",title:"Network Topology",diagramType:"networkTopology",nodes:E,edges:M,groups:A,animations:W,metadata:{type:"network-topology",lastRefresh:b.toISOString(),...t.metadata}})},[j,N,l,d,t.groups,p,f,u,y,h,w,b]);s.useCallback(P=>{if(k(A=>A===P?null:P),e){const A=t.devices.find(E=>E.id===P);A&&e(A)}},[t.devices,e]),s.useCallback(P=>{if(!r)return;const A=t.connections.find(E=>E.id===P);A&&r(A)},[t.connections,r]);const[x,F]=s.useState({x:0,y:0,zoom:1}),I=s.useCallback(P=>{if(P&&(k(A=>A===P?null:P),e)){const A=t.devices.find(E=>E.id===P);A&&e(A)}},[t.devices,e]);return a.jsx("div",{className:`nice-network-topology ${v||""}`,style:{position:"relative",width:"100%",height:"100%",...D},children:a.jsx(lt,{nodes:$.nodes,edges:$.edges,groups:$.groups,viewport:x,onViewportChange:F,onSelectElement:I,showGrid:!0})})},Br=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899","#14B8A6","#6366F1"];function pm(t,e,r,i){var o;const n={};switch(r){case"star":{const c=new Map;t.forEach(f=>c.set(f.id,0)),e.forEach(f=>{c.set(f.source,(c.get(f.source)||0)+1),c.set(f.target,(c.get(f.target)||0)+1)});let l=(o=t[0])==null?void 0:o.id,d=0;c.forEach((f,u)=>{f>d&&(d=f,l=u)}),n[l]={x:400,y:300};const p=t.filter(f=>f.id!==l);p.forEach((f,u)=>{const y=u/p.length*2*Math.PI-Math.PI/2,h=200;n[f.id]={x:Math.cos(y)*h+400,y:Math.sin(y)*h+300}});break}case"mesh":{const c=Math.ceil(Math.sqrt(t.length));t.forEach((l,d)=>{n[l.id]={x:d%c*150+100,y:Math.floor(d/c)*130+100}});break}case"tree":{const c=t.filter(y=>y.type==="internet"||y.type==="cloud"||y.type==="router"),l=new Map,d=c.map(y=>y.id);d.forEach(y=>l.set(y,0));const p=new Set(d);for(;d.length>0;){const y=d.shift(),h=l.get(y)||0;e.forEach(m=>{let v=null;m.source===y&&!p.has(m.target)&&(v=m.target),m.target===y&&!p.has(m.source)&&(v=m.source),v&&(p.add(v),l.set(v,h+1),d.push(v))})}const f={},u={};t.forEach(y=>{const h=l.get(y.id)||0;f[h]=(f[h]||0)+1}),t.forEach(y=>{const h=l.get(y.id)||0,m=u[h]||0;u[h]=m+1;const v=f[h],D=(m-(v-1)/2)*160;n[y.id]={x:400+D,y:80+h*120}});break}case"hierarchical":default:{const c=["internet","cloud","router","firewall","loadbalancer","switch","server","storage","workstation","laptop","phone","printer","camera","iot","unknown"],l=new Map;t.forEach(p=>{l.has(p.type)||l.set(p.type,[]),l.get(p.type).push(p)});let d=50;c.forEach(p=>{const f=l.get(p);!f||f.length===0||(f.forEach((u,y)=>{const h=(y-(f.length-1)/2)*150;n[u.id]={x:400+h,y:d}}),d+=130)});break}}return n}function mm(t){switch(t){case"router":case"switch":return"diamond";case"firewall":return"hexagon";case"server":case"storage":return"rectangle";case"cloud":case"internet":return"cloud";default:return"rectangle"}}function fm(t){return t.filter(e=>e.status==="active"&&e.bandwidth&&e.bandwidth.used>0).map((e,r)=>({id:`traffic-${r}`,type:"flow",targets:[e.id],duration:2e3,delay:r*200}))}async function hm(t={}){return console.log("Network discovery with options:",t),{devices:[{id:"internet",name:"Internet",type:"internet",status:"online"},{id:"router-1",name:"Edge Router",type:"router",ipAddress:"192.168.1.1",status:"online",metrics:{cpu:45,memory:60,latency:5}},{id:"firewall-1",name:"Firewall",type:"firewall",ipAddress:"192.168.1.2",status:"online",metrics:{cpu:30,memory:55}},{id:"switch-1",name:"Core Switch",type:"switch",ipAddress:"192.168.1.10",status:"online"},{id:"server-1",name:"Web Server",type:"server",ipAddress:"192.168.1.100",status:"online",metrics:{cpu:75,memory:80}},{id:"server-2",name:"Database Server",type:"server",ipAddress:"192.168.1.101",status:"warning",metrics:{cpu:90,memory:85}}],connections:[{id:"c1",source:"internet",target:"router-1",type:"wan",status:"active",speed:1e3},{id:"c2",source:"router-1",target:"firewall-1",type:"ethernet",status:"active",speed:1e4},{id:"c3",source:"firewall-1",target:"switch-1",type:"ethernet",status:"active",speed:1e4},{id:"c4",source:"switch-1",target:"server-1",type:"ethernet",status:"active",speed:1e4},{id:"c5",source:"switch-1",target:"server-2",type:"ethernet",status:"active",speed:1e4}]}}function gm(t){const e=t.devices.filter(u=>u.status==="online").length,r=t.devices.filter(u=>u.status==="offline").length,i=t.devices.filter(u=>u.status==="warning").length,n=t.devices.filter(u=>u.status==="critical").length,o=t.connections.filter(u=>u.status==="active").length,c=t.connections.filter(u=>u.status==="degraded"||u.status==="error").length,l=t.devices.length>0?e/t.devices.length*100:0,d=t.connections.length>0?o/t.connections.length*100:0,p=n*10+i*5+c*5;return{score:Math.max(0,Math.min(100,Math.round(l*.5+d*.5-p))),onlineDevices:e,offlineDevices:r,warningDevices:i,criticalDevices:n,activeConnections:o,degradedConnections:c}}const ym={root:"#8B5CF6",decision:"#3B82F6",leaf:"#10B981",chance:"#F59E0B",end:"#EF4444"},bm=({data:t,onChange:e,onNodeClick:r,editable:i=!1,showMetrics:n=!0,showProbabilities:o=!0,showSamples:c=!0,highlightPath:l,colorScheme:d="outcome",nodeColors:p,orientation:f="vertical",spacing:u={horizontal:180,vertical:120},showMinimap:y=!0,className:h,style:m})=>{const[v,D]=s.useState(null),[w,k]=s.useState(new Set),b=s.useMemo(()=>l?_m(t.root,l):new Set,[t.root,l]),{nodes:C,edges:j}=s.useMemo(()=>xm(t.root,t.edges),[t.root,t.edges]),N=s.useMemo(()=>km(C),[C]),$=s.useMemo(()=>{var M,W;const P=vm(t.root,f,u),A=C.map(z=>{const T=P[z.id]||{x:0,y:0},g=v===z.id,_=b.has(z.id),S=z.type==="leaf"||z.type==="end",R=wm(z,d,p,N),L=S?120:160,O=n?80:S?60:70;return{id:z.id,label:z.label,x:T.x,y:T.y,width:L,height:O,shape:S?"roundedRect":"diamond",style:{fill:g||_?R:"#FFFFFF",stroke:R,strokeWidth:_?4:g?3:2,fontColor:g||_?"#FFFFFF":"#1F2937",fontSize:11,borderRadius:S?8:0},data:{type:"decision-tree-node",node:z,isLeaf:S,isHighlighted:_}}}),E=j.map((z,T)=>{const g=b.has(z.source)&&b.has(z.target);let _=z.label||"";return o&&z.probability!==void 0&&(_+=_?` (${(z.probability*100).toFixed(0)}%)`:`${(z.probability*100).toFixed(0)}%`),{id:z.id||`edge-${T}`,source:z.source,target:z.target,label:_||void 0,style:{stroke:g?"#3B82F6":"#9CA3AF",strokeWidth:g?3:2,arrowHead:"triangle",lineType:f==="vertical"?"orthogonal":"curved"},data:{type:"decision-edge",edge:z,isHighlighted:g}}});return wt({id:"decision-tree",title:"Decision Tree",diagramType:"decisionTree",nodes:A,edges:E,animations:l?Cm(Array.from(b)):[],metadata:{type:"decision-tree",algorithm:(M=t.metadata)==null?void 0:M.algorithm,accuracy:(W=t.metadata)==null?void 0:W.accuracy}})},[C,j,f,u,n,o,d,p,N,v,b,l,t.metadata]);s.useCallback(P=>{D(E=>E===P?null:P);const A=C.find(E=>E.id===P);A&&A.type!=="leaf"&&A.type!=="end"&&k(E=>{const M=new Set(E);return M.has(P)?M.delete(P):M.add(P),M}),r&&A&&r(A)},[C,r]);const[x,F]=s.useState({x:0,y:0,zoom:1}),I=s.useCallback(P=>{if(!P)return;D(E=>E===P?null:P);const A=C.find(E=>E.id===P);A&&A.type!=="leaf"&&A.type!=="end"&&k(E=>{const M=new Set(E);return M.has(P)?M.delete(P):M.add(P),M}),r&&A&&r(A)},[C,r]);return a.jsx("div",{className:`nice-decision-tree-editor ${h||""}`,style:{position:"relative",width:"100%",height:"100%",...m},children:a.jsx(lt,{nodes:$.nodes,edges:$.edges,groups:$.groups,viewport:x,onViewportChange:F,onSelectElement:I,interactive:!0,showGrid:!1})})};function xm(t,e){const r=[],i=e?[...e]:[],n=new Set(i.map(c=>`${c.source}-${c.target}`)),o=(c,l)=>{r.push(c),l&&!n.has(`${l}-${c.id}`)&&i.push({id:`e-${l}-${c.id}`,source:l,target:c.id}),c.children&&c.children.forEach((d,p)=>{let f="";c.condition&&(f=p===0?"Yes":"No");const u=`${c.id}-${d.id}`;n.has(u)||(i.push({id:`e-${u}`,source:c.id,target:d.id,label:f,branch:p===0?"yes":"no"}),n.add(u)),o(d,c.id)})};return o(t),{nodes:r,edges:i}}function vm(t,e,r){const i={},n=l=>!l.children||l.children.length===0?1:l.children.reduce((d,p)=>d+n(p),0),o=(l,d,p,f)=>{const u=p+f*r.horizontal/2,y=d*r.vertical+50;if(i[l.id]=e==="vertical"?{x:u,y}:{x:y,y:u},l.children){let h=p;l.children.forEach(m=>{const v=n(m);o(m,d+1,h,v),h+=v*r.horizontal})}},c=n(t);return o(t,0,0,c),i}function km(t){const e=t.filter(i=>{var n;return((n=i.metrics)==null?void 0:n.impurity)!==void 0}).map(i=>i.metrics.impurity),r=t.filter(i=>{var n;return((n=i.metrics)==null?void 0:n.samples)!==void 0}).map(i=>i.metrics.samples);return{impurity:{min:Math.min(...e,0),max:Math.max(...e,1)},samples:{min:Math.min(...r,0),max:Math.max(...r,100)}}}function wm(t,e,r,i){var n,o,c;if(r!=null&&r[t.id])return r[t.id];switch(e){case"impurity":if(((n=t.metrics)==null?void 0:n.impurity)!==void 0&&i){const l=(t.metrics.impurity-i.impurity.min)/(i.impurity.max-i.impurity.min||1);return qr("#10B981","#EF4444",l)}break;case"samples":if(((o=t.metrics)==null?void 0:o.samples)!==void 0&&i){const l=(t.metrics.samples-i.samples.min)/(i.samples.max-i.samples.min||1);return qr("#FEF3C7","#F59E0B",l)}break;case"outcome":if(t.type==="leaf"&&((c=t.outcome)!=null&&c.class))return{positive:"#10B981",negative:"#EF4444",true:"#10B981",false:"#EF4444",yes:"#10B981",no:"#EF4444"}[t.outcome.class.toLowerCase()]||"#3B82F6";break}return ym[t.type]||"#6B7280"}function qr(t,e,r){const i=p=>({r:parseInt(p.slice(1,3),16),g:parseInt(p.slice(3,5),16),b:parseInt(p.slice(5,7),16)}),n=i(t),o=i(e),c=Math.round(n.r+(o.r-n.r)*r),l=Math.round(n.g+(o.g-n.g)*r),d=Math.round(n.b+(o.b-n.b)*r);return`#${[c,l,d].map(p=>p.toString(16).padStart(2,"0")).join("")}`}function _m(t,e){const r=new Set,i=n=>{if(r.add(n.id),n.type==="leaf"||n.type==="end"||!n.children)return!0;if(n.condition){const o=e[n.condition.feature],l=vn(o,n.condition.operator,n.condition.value)?0:1;if(n.children[l])return i(n.children[l])}return n.children[0]?i(n.children[0]):!0};return i(t),r}function vn(t,e,r){switch(e){case"=":return t===r;case"!=":return t!==r;case"<":return Number(t)<Number(r);case"<=":return Number(t)<=Number(r);case">":return Number(t)>Number(r);case">=":return Number(t)>=Number(r);case"in":return Array.isArray(r)&&r.includes(t);case"not_in":return Array.isArray(r)&&!r.includes(t);case"contains":return String(t).includes(String(r));default:return!1}}function Cm(t){return t.map((e,r)=>({id:`path-${r}`,type:"highlight",targets:[e],duration:500,delay:r*300}))}function Sm(t){const{tree:e,feature_names:r,class_names:i}=t;e.children_left.length;const n=c=>{const l=e.children_left[c]===-1,d=e.n_node_samples[c],p=e.impurity[c],f=e.value[c];if(l){const D=Array.isArray(f)?f:[f],w=Array.isArray(D[0])?D[0]:D,k=w.indexOf(Math.max(...w)),b=(i==null?void 0:i[k])||`Class ${k}`,C=w.reduce((N,$)=>N+$,0),j=C>0?w[k]/C:0;return{id:`node-${c}`,type:"leaf",label:b,outcome:{value:b,class:b,probability:j,samples:d},metrics:{samples:d,impurity:p}}}const u=e.feature[c],y=e.threshold[c],h=r[u]||`feature_${u}`,m=n(e.children_left[c]),v=n(e.children_right[c]);return{id:`node-${c}`,type:c===0?"root":"decision",label:`${h} <= ${y.toFixed(2)}`,condition:{feature:h,operator:"<=",value:y},children:[m,v],metrics:{samples:d,impurity:p,giniIndex:p}}},o=n(0);return{root:o,features:r,classes:i,metadata:{algorithm:"sklearn.DecisionTreeClassifier",maxDepth:kn(o)}}}function kn(t,e=0){return!t.children||t.children.length===0?e:Math.max(...t.children.map(r=>kn(r,e+1)))}function jm(t){const e=(i,n)=>typeof i=="string"?{id:n,type:"leaf",label:i,outcome:{value:i}}:{...i,id:n};return{root:{id:"root",type:"root",label:t.question,condition:{feature:t.feature,operator:typeof t.threshold=="number"?"<=":"=",value:t.threshold},children:[e(t.yesOutcome,"yes-outcome"),e(t.noOutcome,"no-outcome")]}}}function Nm(t,e){const r=[],i=o=>{var c,l;if(r.push(o.id),o.type==="leaf"||o.type==="end"||!o.children)return{value:((c=o.outcome)==null?void 0:c.value)??o.label,probability:(l=o.outcome)==null?void 0:l.probability};if(o.condition){const d=e[o.condition.feature],f=vn(d,o.condition.operator,o.condition.value)?0:1;if(o.children[f])return i(o.children[f])}return o.children[0]?i(o.children[0]):{value:null}},n=i(t.root);return{prediction:n.value,probability:n.probability,path:r}}const Mm={size:20,enabled:!0,guideThreshold:5,showGuides:!0};function Sa(t,e){return Math.round(t/e)*e}function wn(t,e){return{x:Sa(t.x,e),y:Sa(t.y,e)}}function zm(t,e,r){return wn(t,r)}function Vr(t,e,r){return{id:t,left:e.x,right:e.x+r.width,top:e.y,bottom:e.y+r.height,centerX:e.x+r.width/2,centerY:e.y+r.height/2}}function $m(t,e,r,i,n=5){const o=[],c=Vr(t,e,r);for(const l of i){if(l.id===t)continue;const d=Vr(l.id,l.position,l.size);Math.abs(c.centerX-d.centerX)<=n&&o.push({axis:"vertical",position:d.centerX,sourceNodeIds:[t,l.id],type:"center"}),Math.abs(c.left-d.left)<=n&&o.push({axis:"vertical",position:d.left,sourceNodeIds:[t,l.id],type:"edge"}),Math.abs(c.right-d.right)<=n&&o.push({axis:"vertical",position:d.right,sourceNodeIds:[t,l.id],type:"edge"}),Math.abs(c.centerY-d.centerY)<=n&&o.push({axis:"horizontal",position:d.centerY,sourceNodeIds:[t,l.id],type:"center"}),Math.abs(c.top-d.top)<=n&&o.push({axis:"horizontal",position:d.top,sourceNodeIds:[t,l.id],type:"edge"}),Math.abs(c.bottom-d.bottom)<=n&&o.push({axis:"horizontal",position:d.bottom,sourceNodeIds:[t,l.id],type:"edge"})}return Am(o)}function Em(t,e,r){let i=t.x,n=t.y;const o=[],c=r.filter(d=>d.axis==="vertical");if(c.length>0){const d=t.x+e.width/2;let p=null,f=1/0;for(const u of c){const y=u.type==="center"?Math.abs(d-u.position):Math.abs(t.x-u.position);y<f&&(f=y,p=u)}p&&(i=p.type==="center"?p.position-e.width/2:p.position,o.push(p))}const l=r.filter(d=>d.axis==="horizontal");if(l.length>0){const d=t.y+e.height/2;let p=null,f=1/0;for(const u of l){const y=u.type==="center"?Math.abs(d-u.position):Math.abs(t.y-u.position);y<f&&(f=y,p=u)}p&&(n=p.type==="center"?p.position-e.height/2:p.position,o.push(p))}return{snappedPosition:{x:i,y:n},activeGuides:o}}function Am(t){const e=new Set;return t.filter(r=>{const i=`${r.axis}-${r.position}-${r.type}`;return e.has(i)?!1:(e.add(i),!0)})}let Dm=0;function ur(){return`tmpl-${++Dm}-${Date.now().toString(36)}`}function Pe(t,e,r="roundedRect",i={width:160,height:60},n){return{id:ur(),label:t,position:e,size:i,shape:r,style:{},ports:[{id:"top",side:"top",offset:.5},{id:"right",side:"right",offset:.5},{id:"bottom",side:"bottom",offset:.5},{id:"left",side:"left",offset:.5}],data:n}}function We(t,e,r="bottom",i="top",n){return{id:ur(),sourceNodeId:t.id,sourcePortId:r,targetNodeId:e.id,targetPortId:i,label:n,style:{lineType:"bezier",targetArrow:"arrow"}}}function Dt(t,e,r,i){const n=new Date().toISOString();return{version:"1.0",id:ur(),title:t,diagramType:e,nodes:r,edges:i,groups:[],animations:[],viewport:{x:0,y:0,zoom:1},metadata:{createdAt:n,updatedAt:n}}}function Tm(){const t=Pe("Commit",{x:40,y:200},"circle",{width:80,height:80}),e=Pe("Build",{x:200,y:200},"roundedRect"),r=Pe("Test",{x:420,y:200},"roundedRect"),i=Pe("Deploy",{x:640,y:200},"roundedRect"),n=Pe("Production",{x:860,y:200},"hexagon",{width:140,height:80});return Dt("CI/CD Pipeline","flowchart",[t,e,r,i,n],[We(t,e,"right","left"),We(e,r,"right","left"),We(r,i,"right","left"),We(i,n,"right","left")])}function Fm(){const t=Pe("API Gateway",{x:350,y:40},"hexagon",{width:160,height:80}),e=Pe("Auth Service",{x:80,y:200},"roundedRect"),r=Pe("User Service",{x:300,y:200},"roundedRect"),i=Pe("Order Service",{x:520,y:200},"roundedRect"),n=Pe("Notification",{x:740,y:200},"roundedRect"),o=Pe("Users DB",{x:180,y:380},"cylinder",{width:120,height:70}),c=Pe("Orders DB",{x:520,y:380},"cylinder",{width:120,height:70}),l=Pe("Message Queue",{x:620,y:380},"parallelogram",{width:160,height:60}),d=[t,e,r,i,n,o,c,l],p=[We(t,e,"bottom","top"),We(t,r,"bottom","top"),We(t,i,"bottom","top"),We(i,n,"right","left"),We(r,o,"bottom","top"),We(i,c,"bottom","top"),We(n,l,"bottom","top")];return Dt("Microservices Architecture","flowchart",d,p)}function Rm(){const t=Pe("Start",{x:350,y:20},"circle",{width:70,height:70}),e=Pe("Landing Page",{x:310,y:140},"roundedRect"),r=Pe("Sign Up",{x:140,y:280},"roundedRect"),i=Pe("Log In",{x:480,y:280},"roundedRect"),n=Pe("Dashboard",{x:310,y:420},"roundedRect"),o=Pe("End",{x:350,y:560},"circle",{width:70,height:70});return Dt("User Flow","flowchart",[t,e,r,i,n,o],[We(t,e,"bottom","top"),We(e,r,"bottom","top","New user"),We(e,i,"bottom","top","Returning"),We(r,n,"bottom","top"),We(i,n,"bottom","top"),We(n,o,"bottom","top")])}function Im(){const t=Pe("Users",{x:80,y:100},"rectangle",{width:180,height:100}),e=Pe("Orders",{x:380,y:100},"rectangle",{width:180,height:100}),r=Pe("Products",{x:380,y:320},"rectangle",{width:180,height:100}),i=Pe("Categories",{x:680,y:320},"rectangle",{width:180,height:100});return Dt("Entity Relationship","er",[t,e,r,i],[We(t,e,"right","left","1:N"),We(e,r,"bottom","top","N:M"),We(r,i,"right","left","N:1")])}function Pm(){const t=Pe("CEO",{x:350,y:40},"roundedRect"),e=Pe("CTO",{x:150,y:180},"roundedRect"),r=Pe("CFO",{x:550,y:180},"roundedRect"),i=Pe("Engineering",{x:50,y:320},"roundedRect"),n=Pe("DevOps",{x:250,y:320},"roundedRect"),o=Pe("Accounting",{x:550,y:320},"roundedRect");return Dt("Organization Chart","orgchart",[t,e,r,i,n,o],[We(t,e,"bottom","top"),We(t,r,"bottom","top"),We(e,i,"bottom","top"),We(e,n,"bottom","top"),We(r,o,"bottom","top")])}function Lm(){const t=Pe("Idle",{x:80,y:200},"circle",{width:90,height:90}),e=Pe("Loading",{x:300,y:80},"roundedRect"),r=Pe("Success",{x:520,y:80},"roundedRect"),i=Pe("Error",{x:520,y:320},"roundedRect"),n=Pe("Retry",{x:300,y:320},"diamond",{width:100,height:100});return Dt("State Machine","stateMachine",[t,e,r,i,n],[We(t,e,"right","left","fetch"),We(e,r,"right","left","ok"),We(e,i,"bottom","top","fail"),We(i,n,"left","right"),We(n,e,"top","bottom","retry"),We(n,t,"left","right","cancel")])}const da=[{id:"cicd-pipeline",name:"CI/CD Pipeline",description:"Continuous integration and deployment pipeline",category:"software",diagramType:"flowchart",tags:["devops","ci","cd","pipeline","deployment"],create:Tm},{id:"microservices",name:"Microservices Architecture",description:"Microservices with API gateway, databases, and message queue",category:"software",diagramType:"flowchart",tags:["architecture","microservices","api","backend"],create:Fm},{id:"user-flow",name:"User Flow",description:"User journey through signup, login, and dashboard",category:"general",diagramType:"flowchart",tags:["ux","user-flow","journey","wireframe"],create:Rm},{id:"er-diagram",name:"Entity Relationship",description:"Database ER diagram with tables and relations",category:"software",diagramType:"er",tags:["database","er","schema","sql"],create:Im},{id:"org-chart",name:"Organization Chart",description:"Company organizational hierarchy",category:"business",diagramType:"orgchart",tags:["org","hierarchy","team","management"],create:Pm},{id:"state-machine",name:"State Machine",description:"Finite state machine with transitions",category:"software",diagramType:"stateMachine",tags:["state","fsm","transitions","machine"],create:Lm}];function Om(t){return da.find(e=>e.id===t)}function Hm(t){return da.filter(e=>e.category===t)}function Wm(t){const e=t.toLowerCase();return da.filter(r=>r.name.toLowerCase().includes(e)||r.description.toLowerCase().includes(e)||r.tags.some(i=>i.includes(e)))}class _n{constructor(e={}){this.versions=[],this.currentVersionIndex=-1,this.autoSaveTimer=null,this.lastDocument=null,this.listeners=new Set,this.config={maxVersions:e.maxVersions??100,autoSaveInterval:e.autoSaveInterval??3e4,compressOldVersions:e.compressOldVersions??!1,userId:e.userId??"",userName:e.userName??"Anonymous"}}startAutoSave(e){this.config.autoSaveInterval<=0||(this.autoSaveTimer=setInterval(()=>{const r=e();this.hasChanges(r)&&this.saveVersion(r,"Auto-save")},this.config.autoSaveInterval))}stopAutoSave(){this.autoSaveTimer&&(clearInterval(this.autoSaveTimer),this.autoSaveTimer=null)}hasChanges(e){return this.lastDocument?JSON.stringify(e)!==JSON.stringify(this.lastDocument):!0}saveVersion(e,r){const i=this.lastDocument?this.calculateChanges(this.lastDocument,e):[{type:"node-added",description:"Initial version"}],n={id:Bm(),number:this.versions.length+1,timestamp:new Date().toISOString(),userId:this.config.userId,userName:this.config.userName,label:r,snapshot:JSON.stringify(e),changes:i};return this.currentVersionIndex<this.versions.length-1&&(this.versions=this.versions.slice(0,this.currentVersionIndex+1)),this.versions.push(n),this.currentVersionIndex=this.versions.length-1,this.lastDocument=JSON.parse(JSON.stringify(e)),this.versions.length>this.config.maxVersions&&(this.versions.shift(),this.currentVersionIndex--),this.notify(),n}getVersions(){return this.versions}getCurrentVersionIndex(){return this.currentVersionIndex}getCurrentVersion(){return this.versions[this.currentVersionIndex]??null}getVersion(e){return this.versions.find(r=>r.id===e)}getDocumentAtVersion(e){const r=this.getVersion(e);return r?JSON.parse(r.snapshot):null}restoreToVersion(e){const r=this.versions.findIndex(n=>n.id===e);if(r===-1)return null;this.currentVersionIndex=r;const i=JSON.parse(this.versions[r].snapshot);return this.lastDocument=JSON.parse(JSON.stringify(i)),this.notify(),i}diff(e,r){const i=this.getVersion(e),n=this.getVersion(r);if(!i||!n)return null;const o=JSON.parse(i.snapshot),c=JSON.parse(n.snapshot),l=this.calculateChanges(o,c),d={nodesAdded:l.filter(p=>p.type==="node-added").length,nodesRemoved:l.filter(p=>p.type==="node-removed").length,nodesMoved:l.filter(p=>p.type==="node-moved").length,nodesRestyled:l.filter(p=>p.type==="node-restyled").length,edgesAdded:l.filter(p=>p.type==="edge-added").length,edgesRemoved:l.filter(p=>p.type==="edge-removed").length,edgesRestyled:l.filter(p=>p.type==="edge-restyled").length,groupsModified:l.filter(p=>p.type.startsWith("group-")).length,totalChanges:l.length};return{fromVersionId:e,toVersionId:r,changes:l,summary:d}}calculateChanges(e,r){const i=[];e.title!==r.title&&i.push({type:"title-changed",elementType:"document",previousValue:e.title,newValue:r.title,description:`Title changed from "${e.title}" to "${r.title}"`});const n=new Set(e.nodes.map(f=>f.id)),o=new Set(r.nodes.map(f=>f.id));for(const f of r.nodes)n.has(f.id)||i.push({type:"node-added",elementId:f.id,elementType:"node",newValue:f,description:`Node "${f.label||f.id}" added`});for(const f of e.nodes)o.has(f.id)||i.push({type:"node-removed",elementId:f.id,elementType:"node",previousValue:f,description:`Node "${f.label||f.id}" removed`});for(const f of r.nodes){const u=e.nodes.find(y=>y.id===f.id);u&&((u.position.x!==f.position.x||u.position.y!==f.position.y)&&i.push({type:"node-moved",elementId:f.id,elementType:"node",previousValue:{x:u.position.x,y:u.position.y},newValue:{x:f.position.x,y:f.position.y},description:`Node "${f.label||f.id}" moved`}),(u.size.width!==f.size.width||u.size.height!==f.size.height)&&i.push({type:"node-resized",elementId:f.id,elementType:"node",previousValue:{width:u.size.width,height:u.size.height},newValue:{width:f.size.width,height:f.size.height},description:`Node "${f.label||f.id}" resized`}),u.label!==f.label&&i.push({type:"node-relabeled",elementId:f.id,elementType:"node",previousValue:u.label,newValue:f.label,description:`Node label changed from "${u.label}" to "${f.label}"`}),JSON.stringify(u.style)!==JSON.stringify(f.style)&&i.push({type:"node-restyled",elementId:f.id,elementType:"node",previousValue:u.style,newValue:f.style,description:`Node "${f.label||f.id}" style changed`}))}const c=new Set(e.edges.map(f=>f.id)),l=new Set(r.edges.map(f=>f.id));for(const f of r.edges)c.has(f.id)||i.push({type:"edge-added",elementId:f.id,elementType:"edge",newValue:f,description:`Edge from "${f.sourceNodeId}" to "${f.targetNodeId}" added`});for(const f of e.edges)l.has(f.id)||i.push({type:"edge-removed",elementId:f.id,elementType:"edge",previousValue:f,description:`Edge from "${f.sourceNodeId}" to "${f.targetNodeId}" removed`});for(const f of r.edges){const u=e.edges.find(y=>y.id===f.id);u&&((u.sourceNodeId!==f.sourceNodeId||u.targetNodeId!==f.targetNodeId)&&i.push({type:"edge-rerouted",elementId:f.id,elementType:"edge",previousValue:{source:u.sourceNodeId,target:u.targetNodeId},newValue:{source:f.sourceNodeId,target:f.targetNodeId},description:"Edge rerouted"}),JSON.stringify(u.style)!==JSON.stringify(f.style)&&i.push({type:"edge-restyled",elementId:f.id,elementType:"edge",previousValue:u.style,newValue:f.style,description:"Edge style changed"}))}const d=new Set(e.groups.map(f=>f.id)),p=new Set(r.groups.map(f=>f.id));for(const f of r.groups)d.has(f.id)||i.push({type:"group-added",elementId:f.id,elementType:"group",newValue:f,description:`Group "${f.label||f.id}" added`});for(const f of e.groups)p.has(f.id)||i.push({type:"group-removed",elementId:f.id,elementType:"group",previousValue:f,description:`Group "${f.label||f.id}" removed`});return(e.viewport.x!==r.viewport.x||e.viewport.y!==r.viewport.y||e.viewport.zoom!==r.viewport.zoom)&&i.push({type:"viewport-changed",elementType:"document",previousValue:e.viewport,newValue:r.viewport,description:"Viewport changed"}),JSON.stringify(e.theme)!==JSON.stringify(r.theme)&&i.push({type:"theme-changed",elementType:"document",previousValue:e.theme,newValue:r.theme,description:"Theme changed"}),i}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notify(){this.listeners.forEach(e=>e())}exportHistory(){return JSON.stringify({versions:this.versions,currentVersionIndex:this.currentVersionIndex})}importHistory(e){const r=JSON.parse(e);this.versions=r.versions??[],this.currentVersionIndex=r.currentVersionIndex??-1,this.versions.length>0&&this.currentVersionIndex>=0&&(this.lastDocument=JSON.parse(this.versions[this.currentVersionIndex].snapshot)),this.notify()}clearHistory(){this.versions=[],this.currentVersionIndex=-1,this.lastDocument=null,this.notify()}}function Bm(){return`v_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function qm(t){const e=new _n(t);return{manager:e,saveVersion:e.saveVersion.bind(e),getVersions:e.getVersions.bind(e),restoreToVersion:e.restoreToVersion.bind(e),diff:e.diff.bind(e)}}class Vm{constructor(e){this.comments=new Map,this.listeners=new Set,this.mentionListeners=new Set,this.config=e}addComment(e,r,i){const n=this.parseMentions(r),o={id:Km(),anchor:e,status:"open",authorId:this.config.userId,authorName:this.config.userName,authorAvatar:this.config.userAvatar,text:r,mentions:n,replies:[],createdAt:new Date().toISOString(),style:(i==null?void 0:i.style)??this.config.defaultStyle,tags:i==null?void 0:i.tags,priority:i==null?void 0:i.priority};return this.comments.set(o.id,o),this.notify(),n.forEach(c=>this.notifyMention(o,c.userId)),o}updateComment(e,r){const i=this.comments.get(e);return i?(r.text!==void 0&&(i.text=r.text,i.mentions=this.parseMentions(r.text),i.editedAt=new Date().toISOString()),r.style!==void 0&&(i.style=r.style),r.tags!==void 0&&(i.tags=r.tags),r.priority!==void 0&&(i.priority=r.priority),r.anchor!==void 0&&(i.anchor=r.anchor),this.notify(),i):null}deleteComment(e){const r=this.comments.delete(e);return r&&this.notify(),r}resolveComment(e,r="resolved"){const i=this.comments.get(e);return i?(i.status=r,i.resolvedBy=this.config.userId,i.resolvedAt=new Date().toISOString(),this.notify(),i):null}reopenComment(e){const r=this.comments.get(e);return r?(r.status="open",r.resolvedBy=void 0,r.resolvedAt=void 0,this.notify(),r):null}addReply(e,r){const i=this.comments.get(e);if(!i)return null;const n=this.parseMentions(r),o={id:Gm(),authorId:this.config.userId,authorName:this.config.userName,authorAvatar:this.config.userAvatar,text:r,mentions:n,createdAt:new Date().toISOString()};return i.replies.push(o),this.notify(),n.forEach(c=>this.notifyMention(i,c.userId)),o}editReply(e,r,i){const n=this.comments.get(e);if(!n)return null;const o=n.replies.find(c=>c.id===r);return o?(o.text=i,o.mentions=this.parseMentions(i),o.editedAt=new Date().toISOString(),this.notify(),o):null}deleteReply(e,r){const i=this.comments.get(e);if(!i)return!1;const n=i.replies.find(o=>o.id===r);return n?(n.deleted=!0,n.text="[deleted]",this.notify(),!0):!1}getComment(e){return this.comments.get(e)}getAllComments(){return Array.from(this.comments.values())}getCommentsForElement(e){return Array.from(this.comments.values()).filter(r=>r.anchor.elementId===e)}getOpenComments(){return Array.from(this.comments.values()).filter(e=>e.status==="open")}getCommentsMentioningUser(e){return Array.from(this.comments.values()).filter(r=>{const i=r.mentions.some(o=>o.userId===e),n=r.replies.some(o=>o.mentions.some(c=>c.userId===e));return i||n})}filterComments(e){return Array.from(this.comments.values()).filter(r=>{if(e.status&&!e.status.includes(r.status)||e.authorId&&r.authorId!==e.authorId||e.priority&&r.priority&&!e.priority.includes(r.priority)||e.tags&&e.tags.length>0&&(!r.tags||!e.tags.some(i=>r.tags.includes(i)))||e.anchorType&&!e.anchorType.includes(r.anchor.type)||e.elementId&&r.anchor.elementId!==e.elementId)return!1;if(e.searchText){const i=e.searchText.toLowerCase();if(![r.text,...r.replies.map(o=>o.text)].join(" ").toLowerCase().includes(i))return!1}return!(e.mentionedUserId&&!(r.mentions.some(n=>n.userId===e.mentionedUserId)||r.replies.some(n=>n.mentions.some(o=>o.userId===e.mentionedUserId))))})}parseMentions(e){var o;const r=[],i=/@(\w+)/g;let n;for(;(n=i.exec(e))!==null;){const c=n[1],l=(o=this.config.availableUsers)==null?void 0:o.find(d=>d.name.toLowerCase()===c.toLowerCase()||d.id===c);l&&r.push({userId:l.id,userName:l.name,startIndex:n.index,endIndex:n.index+n[0].length})}return r}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}onMention(e){return this.mentionListeners.add(e),()=>this.mentionListeners.delete(e)}notify(){this.listeners.forEach(e=>e())}notifyMention(e,r){this.mentionListeners.forEach(i=>i(e,r))}exportComments(){return JSON.stringify(Array.from(this.comments.values()))}importComments(e){const r=JSON.parse(e);this.comments.clear(),r.forEach(i=>this.comments.set(i.id,i)),this.notify()}getCounts(){const e=Array.from(this.comments.values());return{open:e.filter(r=>r.status==="open").length,resolved:e.filter(r=>r.status==="resolved").length,wontfix:e.filter(r=>r.status==="wontfix").length,total:e.length}}updateConfig(e){Object.assign(this.config,e)}}function Km(){return`comment_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function Gm(){return`reply_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}const Ym={low:{backgroundColor:"#e3f2fd",borderColor:"#2196f3",textColor:"#1565c0",icon:"info"},medium:{backgroundColor:"#fff3e0",borderColor:"#ff9800",textColor:"#e65100",icon:"warning"},high:{backgroundColor:"#ffebee",borderColor:"#f44336",textColor:"#c62828",icon:"error"},critical:{backgroundColor:"#fce4ec",borderColor:"#e91e63",textColor:"#880e4f",icon:"flame"}};function Um(t){const e=new Date(t),i=new Date().getTime()-e.getTime(),n=Math.floor(i/(1e3*60)),o=Math.floor(n/60),c=Math.floor(o/24);return n<1?"just now":n<60?`${n}m ago`:o<24?`${o}h ago`:c<7?`${c}d ago`:e.toLocaleDateString()}function Zm(t,e){if(e.length===0)return t;const r=[...e].sort((n,o)=>o.startIndex-n.startIndex);let i=t;for(const n of r){const o=i.slice(0,n.startIndex),c=i.slice(n.endIndex);i=`${o}<span class="mention" data-user-id="${n.userId}">@${n.userName}</span>${c}`}return i}class Cn{constructor(){this.profiles=new Map,this.activeProfileId=null,this.listeners=new Set,this.cache=new Map,this.profiles.set("default",{id:"default",name:"Default",description:"Default conditional styling profile",rules:[],enabled:!0}),this.activeProfileId="default"}addRule(e,r="default"){const i=this.profiles.get(r);i&&(i.rules=i.rules.filter(n=>n.id!==e.id),i.rules.push(e),i.rules.sort((n,o)=>n.priority-o.priority),this.invalidateCache(),this.notify())}removeRule(e,r="default"){const i=this.profiles.get(r);i&&(i.rules=i.rules.filter(n=>n.id!==e),this.invalidateCache(),this.notify())}updateRule(e,r,i="default"){const n=this.profiles.get(i);if(!n)return;const o=n.rules.find(c=>c.id===e);o&&(Object.assign(o,r),n.rules.sort((c,l)=>c.priority-l.priority),this.invalidateCache(),this.notify())}toggleRule(e,r,i="default"){this.updateRule(e,{enabled:r},i)}addProfile(e){this.profiles.set(e.id,e),this.notify()}removeProfile(e){e!=="default"&&(this.profiles.delete(e),this.activeProfileId===e&&(this.activeProfileId="default"),this.invalidateCache(),this.notify())}setActiveProfile(e){this.profiles.has(e)&&(this.activeProfileId=e,this.invalidateCache(),this.notify())}getProfiles(){return Array.from(this.profiles.values())}getActiveProfile(){return this.activeProfileId?this.profiles.get(this.activeProfileId)??null:null}applyToNode(e){const r=`node_${e.id}_${JSON.stringify(e.data)}`,i=this.cache.get(r);if(i)return i;const n=this.getActiveProfile();if(!(n!=null&&n.enabled))return this.emptyStyles(e.id);const o=n.rules.filter(l=>l.enabled&&(l.target==="node"||l.target==="both")&&(!l.elementShapes||l.elementShapes.includes(e.shape))),c=this.processRules(e.id,o,e);return this.cache.set(r,c),c}applyToEdge(e){const r=`edge_${e.id}_${JSON.stringify(e.data)}`,i=this.cache.get(r);if(i)return i;const n=this.getActiveProfile();if(!(n!=null&&n.enabled))return this.emptyStyles(e.id);const o=n.rules.filter(l=>l.enabled&&(l.target==="edge"||l.target==="both")),c=this.processRules(e.id,o,e);return this.cache.set(r,c),c}applyToAll(e,r){const i=new Map;for(const n of e)i.set(n.id,this.applyToNode(n));for(const n of r)i.set(n.id,this.applyToEdge(n));return i}processRules(e,r,i){const n={elementId:e,matchedRules:[],styleOverrides:{},addedClasses:[]};for(const o of r)if(this.evaluateCondition(o.condition,i)&&(n.matchedRules.push(o.id),this.applyActions(o.actions,n),o.stopProcessing))break;return n}evaluateCondition(e,r){if("logic"in e)return e.logic==="and"?e.conditions.every(n=>this.evaluateCondition(n,r)):e.conditions.some(n=>this.evaluateCondition(n,r));const i=this.getPropertyValue(r,e.property);return this.compareValues(i,e)}getPropertyValue(e,r){const i=r.split(".");let n=e;for(const o of i){if(n==null)return;n=n[o]}return n}compareValues(e,r){const{operator:i,value:n,valueTo:o,caseInsensitive:c}=r;if(i==="is_null")return e==null;if(i==="is_not_null")return e!=null;if(i==="is_empty")return e===""||Array.isArray(e)&&e.length===0;if(i==="is_not_empty")return e!==""&&(!Array.isArray(e)||e.length>0);const l=c&&typeof e=="string"?e.toLowerCase():e,d=c&&typeof n=="string"?n.toLowerCase():n;switch(i){case"equals":return l===d;case"not_equals":return l!==d;case"greater_than":return e>n;case"greater_than_or_equals":return e>=n;case"less_than":return e<n;case"less_than_or_equals":return e<=n;case"contains":return typeof l=="string"&&typeof d=="string"?l.includes(d):Array.isArray(e)?e.includes(n):!1;case"not_contains":return typeof l=="string"&&typeof d=="string"?!l.includes(d):Array.isArray(e)?!e.includes(n):!0;case"starts_with":return typeof l=="string"&&typeof d=="string"&&l.startsWith(d);case"ends_with":return typeof l=="string"&&typeof d=="string"&&l.endsWith(d);case"regex":if(typeof e!="string"||typeof n!="string")return!1;try{const p=c?"i":"";return new RegExp(n,p).test(e)}catch{return!1}case"in":return Array.isArray(n)&&n.includes(e);case"not_in":return!Array.isArray(n)||!n.includes(e);case"between":return e>=n&&e<=o;default:return!1}}applyActions(e,r){for(const i of e)switch(i.type){case"set_fill":r.styleOverrides.backgroundColor=i.value;break;case"set_stroke":r.styleOverrides.borderColor=i.value;break;case"set_stroke_width":r.styleOverrides.borderWidth=i.value;break;case"set_text_color":r.styleOverrides.fontColor=i.value;break;case"set_opacity":r.styleOverrides.opacity=i.value;break;case"set_icon":r.icon=i.value;break;case"set_class":r.addedClasses=[i.value];break;case"add_class":r.addedClasses.includes(i.value)||r.addedClasses.push(i.value);break;case"remove_class":r.addedClasses=r.addedClasses.filter(n=>n!==i.value);break;case"set_shadow":r.styleOverrides.shadow=i.value;break;case"set_border_radius":r.styleOverrides.borderRadius=i.value;break;case"set_dash_array":r.styleOverrides.strokeDash=i.value;break;case"set_animation":r.animation=i.value;break;case"set_badge":r.badge=i.value;break;case"set_tooltip":r.tooltip=i.value;break}}emptyStyles(e){return{elementId:e,matchedRules:[],styleOverrides:{},addedClasses:[]}}invalidateCache(){this.cache.clear()}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notify(){this.listeners.forEach(e=>e())}exportConfig(){return JSON.stringify({profiles:Array.from(this.profiles.values()),activeProfileId:this.activeProfileId})}importConfig(e){const r=JSON.parse(e);this.profiles.clear();for(const i of r.profiles)this.profiles.set(i.id,i);this.activeProfileId=r.activeProfileId,this.invalidateCache(),this.notify()}}const pr=[{id:"status-success",name:"Status: Success",description:"Green fill for successful status",enabled:!0,priority:10,target:"node",condition:{property:"data.status",operator:"in",value:["success","completed","done","active","healthy"],caseInsensitive:!0},actions:[{type:"set_fill",value:"#4caf50"},{type:"set_stroke",value:"#2e7d32"},{type:"set_text_color",value:"#ffffff"}]},{id:"status-warning",name:"Status: Warning",description:"Orange fill for warning status",enabled:!0,priority:10,target:"node",condition:{property:"data.status",operator:"in",value:["warning","pending","processing","degraded"],caseInsensitive:!0},actions:[{type:"set_fill",value:"#ff9800"},{type:"set_stroke",value:"#e65100"},{type:"set_text_color",value:"#000000"}]},{id:"status-error",name:"Status: Error",description:"Red fill for error status",enabled:!0,priority:10,target:"node",condition:{property:"data.status",operator:"in",value:["error","failed","critical","down","unhealthy"],caseInsensitive:!0},actions:[{type:"set_fill",value:"#f44336"},{type:"set_stroke",value:"#b71c1c"},{type:"set_text_color",value:"#ffffff"},{type:"set_animation",value:"pulse"}]},{id:"high-value",name:"High Value Highlight",description:"Bold border for high-value nodes",enabled:!1,priority:20,target:"node",condition:{property:"data.value",operator:"greater_than",value:1e6},actions:[{type:"set_stroke_width",value:4},{type:"set_stroke",value:"#ffd700"},{type:"set_badge",value:{text:"$$$",color:"#ffd700"}}]},{id:"inactive-dim",name:"Dim Inactive",description:"Reduce opacity for inactive elements",enabled:!1,priority:5,target:"both",condition:{property:"data.active",operator:"equals",value:!1},actions:[{type:"set_opacity",value:.5}]}];function Xm(t){const e=pr.find(r=>r.id===t);return e?{...e,id:`${e.id}_${Date.now()}`}:null}function Jm(t=!1){const e=new Cn;if(t)for(const r of pr)e.addRule(r);return e}class Qm{constructor(){this.nodes=[],this.edges=[],this.groups=[],this.presets=new Map,this.state={query:"",results:[],selectedIndex:-1,filters:[],isActive:!1,totalCount:0},this.listeners=new Set}updateData(e,r,i){this.nodes=e,this.edges=r,this.groups=i,this.state.isActive&&this.state.query&&this.search(this.state.query)}search(e,r={}){const{scope:i="all",matchType:n="contains",caseSensitive:o=!1,searchData:c=!0,dataProperties:l=[],maxResults:d=100,nodeShapes:p=[],groupIds:f=[]}=r;if(!e.trim())return this.state={...this.state,query:"",results:[],selectedIndex:-1,isActive:!1,totalCount:0},this.notify(),[];const u=[],y=o?e:e.toLowerCase();if(i==="all"||i==="nodes"||i==="labels")for(const h of this.nodes){if(u.length>=d)break;if(p.length>0&&!p.includes(h.shape)||f.length>0&&h.groupId&&!f.includes(h.groupId))continue;const m=this.matchElement(h,y,n,o,c,l);m&&u.push({id:h.id,type:"node",label:h.label||h.id,element:h,matchText:m.text,matchProperty:m.property,matchPositions:m.positions,score:m.score})}if(i==="all"||i==="edges"||i==="labels")for(const h of this.edges){if(u.length>=d)break;const m=this.matchElement(h,y,n,o,c,l);m&&u.push({id:h.id,type:"edge",label:h.label||`${h.sourceNodeId} → ${h.targetNodeId}`,element:h,matchText:m.text,matchProperty:m.property,matchPositions:m.positions,score:m.score})}if(i==="all"||i==="groups")for(const h of this.groups){if(u.length>=d)break;if(f.length>0&&!f.includes(h.id))continue;const m=this.matchElement(h,y,n,o,c,l);m&&u.push({id:h.id,type:"group",label:h.label||h.id,element:h,matchText:m.text,matchProperty:m.property,matchPositions:m.positions,score:m.score})}return u.sort((h,m)=>m.score-h.score),this.state={...this.state,query:e,results:u,selectedIndex:u.length>0?0:-1,isActive:!0,totalCount:u.length},this.notify(),u}matchElement(e,r,i,n,o,c){let l=null;const d=(f,u,y,h)=>{(!l||h>l.score)&&(l={text:f,property:u,positions:y,score:h})},p=this.matchText(e.id,r,i,n);if(p&&d(e.id,"id",p.positions,100+p.positions.length*10),"label"in e&&e.label){const f=this.matchText(e.label,r,i,n);f&&d(e.label,"label",f.positions,150+f.positions.length*10)}if("shape"in e&&e.shape){const f=this.matchText(e.shape,r,i,n);f&&d(e.shape,"shape",f.positions,80+f.positions.length*10)}if(o&&"data"in e&&e.data){const f=this.searchInData(e.data,r,i,n,c);for(const u of f)d(u.text,`data.${u.property}`,u.positions,50+u.positions.length*10)}return l}matchText(e,r,i,n){const o=n?e:e.toLowerCase(),c=n?r:r.toLowerCase(),l=[];switch(i){case"exact":o===c&&l.push({start:0,end:e.length});break;case"starts_with":o.startsWith(c)&&l.push({start:0,end:r.length});break;case"ends_with":o.endsWith(c)&&l.push({start:e.length-r.length,end:e.length});break;case"regex":try{const p=n?"g":"gi",f=new RegExp(r,p);let u;for(;(u=f.exec(e))!==null&&(l.push({start:u.index,end:u.index+u[0].length}),!!f.global););}catch{}break;case"contains":default:let d=0;for(;(d=o.indexOf(c,d))!==-1;)l.push({start:d,end:d+r.length}),d+=r.length;break}return l.length>0?{positions:l}:null}searchInData(e,r,i,n,o,c=""){const l=[];for(const[d,p]of Object.entries(e)){const f=c?`${c}.${d}`:d;if(!(o.length>0&&!o.some(u=>f.startsWith(u))))if(typeof p=="string"){const u=this.matchText(p,r,i,n);u&&l.push({text:p,property:f,positions:u.positions})}else if(typeof p=="number"||typeof p=="boolean"){const u=String(p),y=this.matchText(u,r,i,n);y&&l.push({text:u,property:f,positions:y.positions})}else p!=null&&typeof p=="object"&&!Array.isArray(p)&&l.push(...this.searchInData(p,r,i,n,o,f))}return l}filter(e){if(this.state.filters=e,e.length===0)return{nodes:this.nodes,edges:this.edges,groups:this.groups};const r=this.nodes.filter(o=>this.matchFilters(o,e)),i=this.edges.filter(o=>this.matchFilters(o,e)),n=this.groups.filter(o=>this.matchFilters(o,e));return this.notify(),{nodes:r,edges:i,groups:n}}matchFilters(e,r){return r.every(i=>this.matchFilter(e,i))}matchFilter(e,r){const i=this.getPropertyValue(e,r.property);switch(r.operator){case"equals":return i===r.value;case"not_equals":return i!==r.value;case"contains":return typeof i=="string"&&typeof r.value=="string"?i.toLowerCase().includes(r.value.toLowerCase()):Array.isArray(i)?i.includes(r.value):!1;case"greater_than":return typeof i=="number"&&i>r.value;case"less_than":return typeof i=="number"&&i<r.value;case"in":return Array.isArray(r.value)&&r.value.includes(i);case"not_in":return!Array.isArray(r.value)||!r.value.includes(i);case"is_null":return i==null;case"is_not_null":return i!=null;default:return!0}}getPropertyValue(e,r){const i=r.split(".");let n=e;for(const o of i){if(n==null)return;n=n[o]}return n}nextResult(){return this.state.results.length===0?null:(this.state.selectedIndex=(this.state.selectedIndex+1)%this.state.results.length,this.notify(),this.state.results[this.state.selectedIndex])}previousResult(){return this.state.results.length===0?null:(this.state.selectedIndex=(this.state.selectedIndex-1+this.state.results.length)%this.state.results.length,this.notify(),this.state.results[this.state.selectedIndex])}selectResult(e){return e<0||e>=this.state.results.length?null:(this.state.selectedIndex=e,this.notify(),this.state.results[e])}getState(){return{...this.state}}getSelectedResult(){return this.state.selectedIndex<0?null:this.state.results[this.state.selectedIndex]??null}clearSearch(){this.state={query:"",results:[],selectedIndex:-1,filters:this.state.filters,isActive:!1,totalCount:0},this.notify()}clearFilters(){this.state.filters=[],this.notify()}clearAll(){this.state={query:"",results:[],selectedIndex:-1,filters:[],isActive:!1,totalCount:0},this.notify()}savePreset(e,r){const i={id:`preset_${Date.now()}`,name:e,description:r,filters:[...this.state.filters],searchQuery:this.state.query||void 0,searchOptions:void 0};return this.presets.set(i.id,i),i}loadPreset(e){const r=this.presets.get(e);r&&(this.state.filters=[...r.filters],r.searchQuery&&this.search(r.searchQuery,r.searchOptions),this.notify())}deletePreset(e){return this.presets.delete(e)}getPresets(){return Array.from(this.presets.values())}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notify(){this.listeners.forEach(e=>e(this.state))}getUniqueValues(e,r){const i=new Set;if(!r||r==="node")for(const n of this.nodes){const o=this.getPropertyValue(n,e);o!=null&&i.add(o)}if(!r||r==="edge")for(const n of this.edges){const o=this.getPropertyValue(n,e);o!=null&&i.add(o)}if(!r||r==="group")for(const n of this.groups){const o=this.getPropertyValue(n,e);o!=null&&i.add(o)}return Array.from(i)}getNodeShapes(){return[...new Set(this.nodes.map(e=>e.shape))]}getEdgeLineTypes(){return[...new Set(this.edges.filter(e=>{var r;return(r=e.style)==null?void 0:r.lineType}).map(e=>e.style.lineType))]}getGroups(){return this.groups}exportPresets(){return JSON.stringify(Array.from(this.presets.values()))}importPresets(e){JSON.parse(e).forEach(i=>this.presets.set(i.id,i))}}function ef(t,e,r="search-highlight"){if(e.length===0)return t;const i=[...e].sort((o,c)=>c.start-o.start);let n=t;for(const o of i){const c=n.slice(0,o.start),l=n.slice(o.start,o.end),d=n.slice(o.end);n=`${c}<span class="${r}">${l}</span>${d}`}return n}function tf(t,e){switch(t){case"by-type":return{id:`filter_type_${Date.now()}`,property:"type",operator:"equals",value:e};case"by-layer":return{id:`filter_layer_${Date.now()}`,property:"layer",operator:"equals",value:e};case"by-status":return{id:`filter_status_${Date.now()}`,property:"data.status",operator:"equals",value:e};case"custom":default:return{id:`filter_custom_${Date.now()}`,property:"",operator:"equals",value:e}}}exports.$i=Va;exports.$t=$a;exports.Ae=rt;exports.An=Fa;exports.AnimationPlayer=on;exports.AnimationTimeline=cr;exports.Bo=li;exports.COMMENT_PRIORITY_STYLES=Ym;exports.ConditionalStylingEngine=Cn;exports.DEFAULT_GRID_CONFIG=Mm;exports.DIAGRAM_STYLE_PRESETS=sa;exports.DIAGRAM_TEMPLATES=da;exports.De=Je;exports.Di=Ua;exports.DiagramCanvas=lt;exports.DiagramCellRenderer=yp;exports.DiagramCommentManager=Vm;exports.DiagramMinimap=lr;exports.DiagramModel=na;exports.DiagramParticleEngine=Ur;exports.DiagramPropertyPanel=or;exports.DiagramSearchFilterEngine=Qm;exports.DiagramToolbar=sr;exports.DiagramVersioningManager=_n;exports.Dn=xt;exports.EDGE_STYLE_CATALOG=As;exports.Ei=Ya;exports.En=Ta;exports.Es=lo;exports.Fe=me;exports.Ii=Za;exports.Ke=ai;exports.Lo=oi;exports.Mi=Ka;exports.Ms=fo;exports.NODE_STYLE_CATALOG=Es;exports.NiceDatabaseSchemaViewer=Ap;exports.NiceDecisionTreeEditor=bm;exports.NiceDependencyGraph=Jp;exports.NiceDiagramEditor=rn;exports.NiceDiagramViewer=ln;exports.NiceI18nProvider=Na;exports.NiceNetworkTopology=um;exports.NiceOrgChartVisualizer=Op;exports.NiceProcessMiningDiagram=Vp;exports.NiceWorkflowVisualizer=jp;exports.PRESET_RULES=pr;exports.Qa=pi;exports.Qi=Ro;exports.Qi$1=Ja;exports.Re=pt;exports.TRANSITION_PRESETS=Qr;exports.Ti=Ga;exports.Vn=Pa;exports.Zn=La;exports.a=Da;exports.analyzeDependencyGraph=om;exports.ao=Si;exports.applyAlignmentSnap=Em;exports.ca=ar;exports.calculateNetworkHealth=gm;exports.calculateOrgStats=qp;exports.cl=at;exports.cn=la;exports.computeAlignmentGuides=$m;exports.computeGlowRadius=Xr;exports.computeLayout=Kr;exports.convertAnimation=hn;exports.convertEdge=mn;exports.convertGroup=fn;exports.convertNode=pn;exports.createConditionalStylingEngine=Jm;exports.createDecisionTree=jm;exports.createDiagramDocument=wt;exports.createGlowFilterId=Zr;exports.createLinearWorkflow=zp;exports.createOrgChartFromEmployees=Bp;exports.createPresetFromTheme=Rs;exports.createQuickFilter=tf;exports.createRuleFromPreset=Xm;exports.createVersioningHook=qm;exports.de=De;exports.discoverNetworkTopology=hm;exports.ea=Qa;exports.ei=Le;exports.eo=ki;exports.exportToMermaid=an;exports.exportToSvg=Ca;exports.fetchAndGenerateDiagram=bp;exports.fi=Wa;exports.fi$1=ko;exports.fl=od;exports.formatCommentDate=Um;exports.generateDiagramFromData=un;exports.getDiagramStylePreset=Ds;exports.getDiagramStylePresetsByCategory=Ts;exports.getEasing=nn;exports.getPointOnPath=$n;exports.getTemplateById=Om;exports.getTemplatesByCategory=Hm;exports.gi=wo;exports.hi=Ha;exports.highlightMatches=ef;exports.ie=ot;exports.ii=Oa;exports.io=Ci;exports.ki=Ba;exports.ki$1=Co;exports.le=en;exports.ll=ft;exports.mineProcessFromLog=gn;exports.no=_i;exports.oa=tr;exports.oo=ji;exports.parseBPMNToWorkflow=Mp;exports.parseNddJson=Gu;exports.parsePackageJsonToDependencies=sm;exports.parseSQLToSchema=Ip;exports.parseSklearnTree=Sm;exports.pi=vo;exports.predictWithTree=Nm;exports.presetToThemeOverrides=Fs;exports.qr=mo;exports.renderTextWithMentions=Zm;exports.rl=Ho;exports.sa=rr;exports.schemaToSQL=Pp;exports.se=Mt;exports.searchTemplates=Wm;exports.sn=ca;exports.snapNodePosition=zm;exports.snapPointToGrid=wn;exports.snapToGrid=Sa;exports.stringifyNddJson=tn;exports.ta=er;exports.tl=Oo;exports.to=wi;exports.ue=kt;exports.useDiagramEditor=Yr;exports.useNiceTranslation=Wt;exports.vs=vt;exports.wa=nr;exports.ws=Ps;exports.xi=qa;exports.ys=Ee;
|